Skip to content

Commit

Permalink
feat: use 3.0.0-beta.* release for styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed Jul 17, 2020
1 parent 0fad511 commit 84ff0e1
Show file tree
Hide file tree
Showing 15 changed files with 178 additions and 93 deletions.
16 changes: 16 additions & 0 deletions __snapshots__/Checkbox.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# `Checkbox`

#### `loads`

```html
<sp-checkbox
data-js-focus-visible=""
dir="ltr"
id="checkbox0"
tabindex="5"
>
Component
</sp-checkbox>

```

6 changes: 6 additions & 0 deletions __snapshots__/Dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
>
<sp-menu-item
data-js-focus-visible=""
dir="ltr"
role="option"
tabindex="0"
>
Deselect
</sp-menu-item>
<sp-menu-item
data-js-focus-visible=""
dir="ltr"
role="option"
tabindex="-1"
value="option-2"
Expand All @@ -24,13 +26,15 @@
</sp-menu-item>
<sp-menu-item
data-js-focus-visible=""
dir="ltr"
role="option"
tabindex="-1"
>
Feather...
</sp-menu-item>
<sp-menu-item
data-js-focus-visible=""
dir="ltr"
role="option"
tabindex="-1"
>
Expand All @@ -40,6 +44,7 @@
</sp-menu-divider>
<sp-menu-item
data-js-focus-visible=""
dir="ltr"
role="option"
tabindex="-1"
>
Expand All @@ -48,6 +53,7 @@
<sp-menu-item
aria-disabled="true"
data-js-focus-visible=""
dir="ltr"
disabled=""
role="option"
tabindex="-1"
Expand Down
1 change: 1 addition & 0 deletions __snapshots__/Search.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
</sp-icon>
<sp-clear-button
data-js-focus-visible=""
dir="ltr"
id="button"
label="Reset"
tabindex="-1"
Expand Down
3 changes: 2 additions & 1 deletion packages/actionbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"@spectrum-css/actionbar": "^2.1.5"
"@spectrum-css/actionbar": "^3.0.0-beta.3"
},
"dependencies": {
"@spectrum-web-components/base": "^0.0.1",
"lit-element": "^2.1.0",
"lit-html": "^1.0.0",
"tslib": "^2.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/actionbar/src/Actionbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ governing permissions and limitations under the License.

import {
html,
LitElement,
SpectrumElement,
CSSResultArray,
TemplateResult,
property,
} from 'lit-element';
} from '@spectrum-web-components/base';

import actionbarStyles from './actionbar.css.js';

Expand All @@ -25,7 +25,7 @@ export const actionbarVariants = ['sticky', 'fixed'];
/**
* Actionbar component
*/
export class Actionbar extends LitElement {
export class Actionbar extends SpectrumElement {
public static get styles(): CSSResultArray {
return [actionbarStyles];
}
Expand Down
16 changes: 14 additions & 2 deletions packages/actionbar/src/spectrum-actionbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,22 @@ THIS FILE IS MACHINE GENERATED. DO NOT EDIT */
);
opacity: 1;
}
:host([variant='sticky']) {
/* .spectrum-ActionBar--sticky */
:host([dir='ltr'][variant='sticky']) {
/* [dir=ltr] .spectrum-ActionBar--sticky */
left: 0;
}
:host([dir='ltr'][variant='sticky']),
:host([dir='rtl'][variant='sticky']) {
/* [dir=ltr] .spectrum-ActionBar--sticky,
* [dir=rtl] .spectrum-ActionBar--sticky */
right: 0;
}
:host([dir='rtl'][variant='sticky']) {
/* [dir=rtl] .spectrum-ActionBar--sticky */
left: 0;
}
:host([variant='sticky']) {
/* .spectrum-ActionBar--sticky */
position: -webkit-sticky;
position: sticky;
}
Expand Down
5 changes: 0 additions & 5 deletions packages/base/src/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ type Constructor<T = Record<string, unknown>> = {
prototype: T;
};

// export interface SlotTextObservingInterface {
// slotHasContent: boolean;
// manageObservedSlot(): void;
// }

export function SpectrumMixin<T extends Constructor<UpdatingElement>>(
constructor: T
): T & Constructor<UpdatingElement> {
Expand Down
2 changes: 1 addition & 1 deletion packages/checkbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"@spectrum-css/checkbox": "^2.1.0"
"@spectrum-css/checkbox": "^3.0.0-beta.3"
},
"dependencies": {
"@spectrum-web-components/icon": "^0.4.8",
Expand Down
22 changes: 10 additions & 12 deletions packages/checkbox/src/Checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,16 @@ export class Checkbox extends CheckboxBase {

protected render(): TemplateResult {
return html`
<label id="root">
${super.render()}
<span id="box">
<sp-icon id="checkmark" size="s" class="checkmark-small">
${CheckmarkSmallIcon({ hidden: true })}
</sp-icon>
<sp-icon id="partialCheckmark" size="s" class="dash-small">
${DashSmallIcon({ hidden: true })}
</sp-icon>
</span>
<span id="label"><slot></slot></span>
</label>
${super.render()}
<span id="box">
<sp-icon id="checkmark" size="s" class="checkmark-small">
${CheckmarkSmallIcon({ hidden: true })}
</sp-icon>
<sp-icon id="partialCheckmark" size="s" class="dash-small">
${DashSmallIcon({ hidden: true })}
</sp-icon>
</span>
<label id="label"><slot></slot></label>
`;
}

Expand Down
Loading

0 comments on commit 84ff0e1

Please sign in to comment.