@universal-material/web 3.0.10 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/button/button-base.d.ts +43 -0
- package/button/button-base.d.ts.map +1 -0
- package/button/button-base.js +152 -0
- package/button/button-base.js.map +1 -0
- package/button/button-base.styles.d.ts +2 -0
- package/button/button-base.styles.d.ts.map +1 -0
- package/button/button-base.styles.js +75 -0
- package/button/button-base.styles.js.map +1 -0
- package/button/button-set.d.ts +20 -0
- package/button/button-set.d.ts.map +1 -0
- package/button/button-set.js +38 -0
- package/button/button-set.js.map +1 -0
- package/button/button-set.styles.d.ts +2 -0
- package/button/button-set.styles.d.ts.map +1 -0
- package/button/button-set.styles.js +39 -0
- package/button/button-set.styles.js.map +1 -0
- package/button/button.d.ts +34 -0
- package/button/button.d.ts.map +1 -0
- package/button/button.js +64 -0
- package/button/button.js.map +1 -0
- package/button/button.styles.d.ts +2 -0
- package/button/button.styles.d.ts.map +1 -0
- package/button/button.styles.js +96 -0
- package/button/button.styles.js.map +1 -0
- package/button/fab.d.ts +31 -0
- package/button/fab.d.ts.map +1 -0
- package/button/fab.js +63 -0
- package/button/fab.js.map +1 -0
- package/button/fab.styles.d.ts +2 -0
- package/button/fab.styles.d.ts.map +1 -0
- package/button/fab.styles.js +89 -0
- package/button/fab.styles.js.map +1 -0
- package/button/icon-button.d.ts +35 -0
- package/button/icon-button.d.ts.map +1 -0
- package/button/icon-button.js +79 -0
- package/button/icon-button.js.map +1 -0
- package/button/icon-button.styles.d.ts +2 -0
- package/button/icon-button.styles.d.ts.map +1 -0
- package/button/icon-button.styles.js +70 -0
- package/button/icon-button.styles.js.map +1 -0
- package/card/card-content.d.ts +13 -0
- package/card/card-content.d.ts.map +1 -0
- package/card/card-content.js +44 -0
- package/card/card-content.js.map +1 -0
- package/card/card-content.styles.d.ts +2 -0
- package/card/card-content.styles.d.ts.map +1 -0
- package/card/card-content.styles.js +15 -0
- package/card/card-content.styles.js.map +1 -0
- package/card/card-media.d.ts +12 -0
- package/card/card-media.d.ts.map +1 -0
- package/card/card-media.js +29 -0
- package/card/card-media.js.map +1 -0
- package/card/card-media.styles.d.ts +2 -0
- package/card/card-media.styles.d.ts.map +1 -0
- package/card/card-media.styles.js +13 -0
- package/card/card-media.styles.js.map +1 -0
- package/card/card.d.ts +19 -0
- package/card/card.d.ts.map +1 -0
- package/card/card.js +40 -0
- package/card/card.js.map +1 -0
- package/card/card.styles.d.ts +2 -0
- package/card/card.styles.d.ts.map +1 -0
- package/card/card.styles.js +28 -0
- package/card/card.styles.js.map +1 -0
- package/checkbox/checkbox.d.ts +16 -0
- package/checkbox/checkbox.d.ts.map +1 -0
- package/checkbox/checkbox.js +75 -0
- package/checkbox/checkbox.js.map +1 -0
- package/container/container.d.ts +13 -0
- package/container/container.d.ts.map +1 -0
- package/container/container.js +23 -0
- package/container/container.js.map +1 -0
- package/container/container.styles.d.ts +2 -0
- package/container/container.styles.d.ts.map +1 -0
- package/container/container.styles.js +43 -0
- package/container/container.styles.js.map +1 -0
- package/custom-elements.json +3706 -0
- package/divider/divider.d.ts +14 -0
- package/divider/divider.d.ts.map +1 -0
- package/divider/divider.js +27 -0
- package/divider/divider.js.map +1 -0
- package/divider/divider.styles.d.ts +2 -0
- package/divider/divider.styles.d.ts.map +1 -0
- package/divider/divider.styles.js +15 -0
- package/divider/divider.styles.js.map +1 -0
- package/elevation/elevation.d.ts +11 -0
- package/elevation/elevation.d.ts.map +1 -0
- package/elevation/elevation.js +21 -0
- package/elevation/elevation.js.map +1 -0
- package/elevation/elevation.styles.d.ts +2 -0
- package/elevation/elevation.styles.d.ts.map +1 -0
- package/elevation/elevation.styles.js +28 -0
- package/elevation/elevation.styles.js.map +1 -0
- package/index.d.ts +27 -0
- package/index.d.ts.map +1 -0
- package/{src/index.ts → index.js} +1 -1
- package/index.js.map +1 -0
- package/package.json +1 -1
- package/ripple/ripple.d.ts +25 -0
- package/ripple/ripple.d.ts.map +1 -0
- package/ripple/ripple.js +119 -0
- package/ripple/ripple.js.map +1 -0
- package/ripple/ripple.styles.d.ts +2 -0
- package/ripple/ripple.styles.d.ts.map +1 -0
- package/ripple/ripple.styles.js +74 -0
- package/ripple/ripple.styles.js.map +1 -0
- package/shared/base.styles.d.ts +2 -0
- package/shared/base.styles.d.ts.map +1 -0
- package/shared/base.styles.js +9 -0
- package/shared/base.styles.js.map +1 -0
- package/table/table-body.d.ts +11 -0
- package/table/table-body.d.ts.map +1 -0
- package/table/table-body.js +21 -0
- package/table/table-body.js.map +1 -0
- package/table/table-body.styles.d.ts +2 -0
- package/table/table-body.styles.d.ts.map +1 -0
- package/table/table-body.styles.js +11 -0
- package/table/table-body.styles.js.map +1 -0
- package/table/table-cell.d.ts +11 -0
- package/table/table-cell.d.ts.map +1 -0
- package/table/table-cell.js +21 -0
- package/table/table-cell.js.map +1 -0
- package/table/table-cell.styles.d.ts +2 -0
- package/table/table-cell.styles.d.ts.map +1 -0
- package/table/table-cell.styles.js +11 -0
- package/table/table-cell.styles.js.map +1 -0
- package/table/table-head.d.ts +11 -0
- package/table/table-head.d.ts.map +1 -0
- package/table/table-head.js +21 -0
- package/table/table-head.js.map +1 -0
- package/table/table-head.styles.d.ts +2 -0
- package/table/table-head.styles.d.ts.map +1 -0
- package/table/table-head.styles.js +11 -0
- package/table/table-head.styles.js.map +1 -0
- package/table/table-header-cell.d.ts +11 -0
- package/table/table-header-cell.d.ts.map +1 -0
- package/table/table-header-cell.js +21 -0
- package/table/table-header-cell.js.map +1 -0
- package/table/table-header-cell.styles.d.ts +2 -0
- package/table/table-header-cell.styles.d.ts.map +1 -0
- package/table/table-header-cell.styles.js +12 -0
- package/table/table-header-cell.styles.js.map +1 -0
- package/table/table-row.d.ts +11 -0
- package/table/table-row.d.ts.map +1 -0
- package/table/table-row.js +21 -0
- package/table/table-row.js.map +1 -0
- package/table/table-row.styles.d.ts +2 -0
- package/table/table-row.styles.d.ts.map +1 -0
- package/table/table-row.styles.js +7 -0
- package/table/table-row.styles.js.map +1 -0
- package/table/table.d.ts +16 -0
- package/table/table.d.ts.map +1 -0
- package/{src/table/table.ts → table/table.js} +6 -15
- package/table/table.js.map +1 -0
- package/table/table.styles.d.ts +2 -0
- package/table/table.styles.d.ts.map +1 -0
- package/table/table.styles.js +16 -0
- package/table/table.styles.js.map +1 -0
- package/theme/color.d.ts +7 -0
- package/theme/color.d.ts.map +1 -0
- package/theme/color.js +2 -0
- package/theme/color.js.map +1 -0
- package/theme/css-var-builder.d.ts +9 -0
- package/theme/css-var-builder.d.ts.map +1 -0
- package/theme/css-var-builder.js +25 -0
- package/theme/css-var-builder.js.map +1 -0
- package/theme/index.d.ts +2 -0
- package/theme/index.d.ts.map +1 -0
- package/{src/theme/index.ts → theme/index.js} +1 -0
- package/theme/index.js.map +1 -0
- package/theme/neutral-colors.d.ts +4 -0
- package/theme/neutral-colors.d.ts.map +1 -0
- package/theme/neutral-colors.js +19 -0
- package/theme/neutral-colors.js.map +1 -0
- package/theme/rgb-color.d.ts +9 -0
- package/theme/rgb-color.d.ts.map +1 -0
- package/theme/rgb-color.js +13 -0
- package/theme/rgb-color.js.map +1 -0
- package/theme/theme-builder.d.ts +27 -0
- package/theme/theme-builder.d.ts.map +1 -0
- package/theme/theme-builder.js +146 -0
- package/theme/theme-builder.js.map +1 -0
- package/{src/theme/theme-color.ts → theme/theme-color.d.ts} +2 -3
- package/theme/theme-color.d.ts.map +1 -0
- package/theme/theme-color.js +2 -0
- package/theme/theme-color.js.map +1 -0
- package/.editorconfig +0 -8
- package/.eleventy.cjs +0 -21
- package/.eslintignore +0 -6
- package/.eslintrc.json +0 -98
- package/.prettierrc.json +0 -7
- package/.vscode/extensions.json +0 -9
- package/CHANGELOG.md +0 -98
- package/LICENSE +0 -28
- package/docs/.nojekyll +0 -0
- package/docs/api/index.html +0 -149
- package/docs/docs.css +0 -185
- package/docs/examples/index.html +0 -75
- package/docs/examples/name-property/index.html +0 -65
- package/docs/index.html +0 -75
- package/docs/install/index.html +0 -53
- package/docs/prism-okaidia.css +0 -123
- package/docs/src/_api-section.pug +0 -27
- package/docs/src/_layout.pug +0 -182
- package/docs/src/components/button-set/alignment.html +0 -29
- package/docs/src/components/button-set/stack.html +0 -5
- package/docs/src/components/button-set/usage.html +0 -35
- package/docs/src/components/button-set.pug +0 -16
- package/docs/src/components/cards/card-media.html +0 -39
- package/docs/src/components/cards/card-with-actions.html +0 -38
- package/docs/src/components/cards/simple-card.html +0 -3
- package/docs/src/components/cards.pug +0 -15
- package/docs/src/components/checkbox/usage.html +0 -33
- package/docs/src/components/checkbox.pug +0 -7
- package/docs/src/components/chips/chip-input.html +0 -73
- package/docs/src/components/chips/default-chips.html +0 -25
- package/docs/src/components/chips/elevated-chips.html +0 -25
- package/docs/src/components/chips/selected-chips.html +0 -50
- package/docs/src/components/chips.pug +0 -16
- package/docs/src/components/common-buttons/anchor-buttons.html +0 -6
- package/docs/src/components/common-buttons/buttons-icons.html +0 -24
- package/docs/src/components/common-buttons/buttons-trailing-icons.html +0 -25
- package/docs/src/components/common-buttons/buttons-variants.html +0 -6
- package/docs/src/components/common-buttons/filled-colors.html +0 -4
- package/docs/src/components/common-buttons.pug +0 -22
- package/docs/src/components/data-tables/simple-table.html +0 -47
- package/docs/src/components/data-tables/table-footer.html +0 -59
- package/docs/src/components/data-tables/table-header.html +0 -43
- package/docs/src/components/data-tables.pug +0 -15
- package/docs/src/components/datepicker.pug +0 -133
- package/docs/src/components/dialogs/example.html +0 -44
- package/docs/src/components/dialogs.pug +0 -19
- package/docs/src/components/dividers/no-margin.html +0 -7
- package/docs/src/components/dividers/usage.html +0 -7
- package/docs/src/components/dividers.pug +0 -13
- package/docs/src/components/dropdown-menus/down-end.html +0 -10
- package/docs/src/components/dropdown-menus/down-left.html +0 -10
- package/docs/src/components/dropdown-menus/down-right.html +0 -10
- package/docs/src/components/dropdown-menus/down-start.html +0 -10
- package/docs/src/components/dropdown-menus/down.html +0 -10
- package/docs/src/components/dropdown-menus/up-end.html +0 -10
- package/docs/src/components/dropdown-menus/up-left.html +0 -10
- package/docs/src/components/dropdown-menus/up-right.html +0 -10
- package/docs/src/components/dropdown-menus/up-start.html +0 -10
- package/docs/src/components/dropdown-menus/up.html +0 -10
- package/docs/src/components/expansion-panel.pug +0 -33
- package/docs/src/components/fab/button-colors.html +0 -18
- package/docs/src/components/fab/button-sizes.html +0 -11
- package/docs/src/components/fab/extended-buttons.html +0 -18
- package/docs/src/components/fab/floating-action-area.html +0 -5
- package/docs/src/components/fab/floating-menu.html +0 -10
- package/docs/src/components/fab/lowered-buttons.html +0 -6
- package/docs/src/components/fab.pug +0 -25
- package/docs/src/components/icon-buttons/anchor-buttons.html +0 -15
- package/docs/src/components/icon-buttons/buttons-variants.html +0 -15
- package/docs/src/components/icon-buttons/toggle-buttons-manual.html +0 -44
- package/docs/src/components/icon-buttons/toggle-buttons.html +0 -48
- package/docs/src/components/icon-buttons.pug +0 -18
- package/docs/src/components/lists/list-avatars.html +0 -14
- package/docs/src/components/lists/list-custom-dividers.html +0 -23
- package/docs/src/components/lists/list-dividers.html +0 -17
- package/docs/src/components/lists/list-dynamic.html +0 -26
- package/docs/src/components/lists/list-hover.html +0 -17
- package/docs/src/components/lists/list-icons.html +0 -17
- package/docs/src/components/lists/list-indexed.html +0 -123
- package/docs/src/components/lists/list-sections.html +0 -16
- package/docs/src/components/lists/list-three-lines.html +0 -20
- package/docs/src/components/lists/list-two-lines.html +0 -20
- package/docs/src/components/lists/list-with-action.html +0 -26
- package/docs/src/components/lists/list-with-activated-item.html +0 -17
- package/docs/src/components/lists/simple-list.html +0 -17
- package/docs/src/components/lists.pug +0 -94
- package/docs/src/components/menus.pug +0 -55
- package/docs/src/components/progress/circular-progress.html +0 -13
- package/docs/src/components/progress/determinate-progress.html +0 -3
- package/docs/src/components/progress/indeterminate-progress.html +0 -3
- package/docs/src/components/progress/progress-color.html +0 -3
- package/docs/src/components/progress.pug +0 -18
- package/docs/src/components/ripple/usage.html +0 -9
- package/docs/src/components/ripple.pug +0 -10
- package/docs/src/components/selection-controls/checkbox.html +0 -22
- package/docs/src/components/selection-controls/radio-button.html +0 -36
- package/docs/src/components/selection-controls/switch.html +0 -12
- package/docs/src/components/selection-controls.pug +0 -13
- package/docs/src/components/sliders/example.html +0 -42
- package/docs/src/components/sliders.pug +0 -7
- package/docs/src/components/snackbar/example.html +0 -35
- package/docs/src/components/snackbars.pug +0 -21
- package/docs/src/components/steppers.pug +0 -57
- package/docs/src/components/tabs/example.html +0 -45
- package/docs/src/components/tabs.pug +0 -8
- package/docs/src/components/text-fields.pug +0 -88
- package/docs/src/components/toolbars/simple-toolbar.html +0 -33
- package/docs/src/components/toolbars.pug +0 -7
- package/docs/src/content/typography/example.html +0 -15
- package/docs/src/content/typography.pug +0 -8
- package/docs/src/css/docs.scss +0 -189
- package/docs/src/index.pug +0 -10
- package/docs/src/js/docs.js +0 -161
- package/docs/src/js/universal-material.js +0 -757
- package/docs/src/js/universal-material.js.map +0 -1
- package/docs/src/js/universal-material.min.js +0 -17
- package/docs/src/js/universal-material.min.js.map +0 -1
- package/docs/src/layout/grid.pug +0 -15
- package/docs/src/utilities/background-colors/common-colors.html +0 -7
- package/docs/src/utilities/background-colors/theme-colors.html +0 -16
- package/docs/src/utilities/background-colors.pug +0 -10
- package/docs/src/utilities/text-and-background-colors/common-colors.html +0 -80
- package/docs/src/utilities/text-and-background-colors/theme-colors.html +0 -208
- package/docs/src/utilities/text-and-background-colors.pug +0 -10
- package/docs/src/utilities/text-colors/common-colors.html +0 -12
- package/docs/src/utilities/text-colors/emphasis-colors.html +0 -26
- package/docs/src/utilities/text-colors/theme-colors.html +0 -37
- package/docs/src/utilities/text-colors.pug +0 -13
- package/gulpfile.js +0 -225
- package/index.html +0 -11
- package/rollup.config.js +0 -42
- package/src/_utils.scss +0 -20
- package/src/_variables.scss +0 -68
- package/src/button/button-base.styles.scss +0 -75
- package/src/button/button-base.ts +0 -147
- package/src/button/button-set.styles.scss +0 -35
- package/src/button/button-set.ts +0 -33
- package/src/button/button.styles.scss +0 -97
- package/src/button/button.ts +0 -64
- package/src/button/fab.styles.scss +0 -90
- package/src/button/fab.ts +0 -55
- package/src/button/icon-button.styles.scss +0 -74
- package/src/button/icon-button.ts +0 -72
- package/src/card/card-content.styles.scss +0 -11
- package/src/card/card-content.ts +0 -45
- package/src/card/card-media.styles.scss +0 -9
- package/src/card/card-media.ts +0 -24
- package/src/card/card.styles.scss +0 -27
- package/src/card/card.ts +0 -37
- package/src/checkbox/checkbox.ts +0 -77
- package/src/container/container.styles.scss +0 -39
- package/src/container/container.ts +0 -24
- package/src/divider/divider.styles.scss +0 -13
- package/src/divider/divider.ts +0 -21
- package/src/elevation/elevation.styles.scss +0 -31
- package/src/elevation/elevation.ts +0 -17
- package/src/ripple/ripple.styles.scss +0 -80
- package/src/ripple/ripple.ts +0 -150
- package/src/shared/base.styles.scss +0 -5
- package/src/table/table-body.styles.scss +0 -9
- package/src/table/table-body.ts +0 -21
- package/src/table/table-cell.styles.scss +0 -9
- package/src/table/table-cell.ts +0 -21
- package/src/table/table-head.styles.scss +0 -9
- package/src/table/table-head.ts +0 -21
- package/src/table/table-header-cell.styles.scss +0 -10
- package/src/table/table-header-cell.ts +0 -21
- package/src/table/table-row.styles.scss +0 -3
- package/src/table/table-row.ts +0 -21
- package/src/table/table.styles.scss +0 -12
- package/src/theme/color.ts +0 -6
- package/src/theme/css-var-builder.ts +0 -36
- package/src/theme/neutral-colors.ts +0 -21
- package/src/theme/rgb-color.ts +0 -19
- package/src/theme/theme-builder.ts +0 -201
- package/tsconfig.json +0 -36
- package/web-dev-server.config.js +0 -25
- package/web-test-runner.config.js +0 -120
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement, nothing } from 'lit';
|
|
2
|
+
import '../elevation/elevation.js';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
export declare abstract class UmButtonBase extends LitElement {
|
|
5
|
+
#private;
|
|
6
|
+
static readonly formAssociated = true;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the button is disabled or not.
|
|
9
|
+
*/
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The URL that the link button points to.
|
|
13
|
+
*/
|
|
14
|
+
href: string;
|
|
15
|
+
/**
|
|
16
|
+
* Where to display the linked `href` URL for a link button. Common options
|
|
17
|
+
* include `_blank` to open in a new tab.
|
|
18
|
+
*/
|
|
19
|
+
target: string;
|
|
20
|
+
type: string;
|
|
21
|
+
value: string;
|
|
22
|
+
name: string | undefined;
|
|
23
|
+
private readonly buttonElement;
|
|
24
|
+
private readonly ripple;
|
|
25
|
+
/**
|
|
26
|
+
* The `<form>` element to associate the button with (its form owner). The value of this attribute must be the id of a `<form>` in the same document. (If this attribute is not set, the button is associated with its ancestor `<form>` element, if any.)
|
|
27
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form
|
|
28
|
+
*/
|
|
29
|
+
get form(): HTMLFormElement | null;
|
|
30
|
+
constructor();
|
|
31
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
32
|
+
private renderButton;
|
|
33
|
+
private renderLink;
|
|
34
|
+
protected abstract renderContent(): HTMLTemplateResult;
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
disconnectedCallback(): void;
|
|
37
|
+
focus(): void;
|
|
38
|
+
blur(): void;
|
|
39
|
+
protected getAriaLabel(): string | null | typeof nothing;
|
|
40
|
+
private innerHandleClick;
|
|
41
|
+
protected handleClick(_: UIEvent): void;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=button-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-base.d.ts","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGpE,OAAO,2BAA2B,CAAC;AACnC,OAAO,qBAAqB,CAAC;AAG7B,8BAAsB,YAAa,SAAQ,UAAU;;IAEnD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC;;OAEG;IACuC,QAAQ,UAAS;IAE3D;;OAEG;IACS,IAAI,SAAM;IAEtB;;;OAGG;IACS,MAAM,EAAE,MAAM,CAAM;IAEpB,IAAI,EAAE,MAAM,CAAY;IAET,KAAK,EAAE,MAAM,CAAM;IAClC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IAEtD;;;OAGG;IACH,IACI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;;cASkB,MAAM;IAMzB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,UAAU;IAelB,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,kBAAkB;IAE7C,iBAAiB;IAMjB,oBAAoB;IAMpB,KAAK;IAIL,IAAI;IAIb,SAAS,CAAC,YAAY,IAAI,MAAM,GAAG,IAAI,GAAG,OAAO,OAAO;IAIxD,OAAO,CAAC,gBAAgB;IA8BxB,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;CAGxC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
13
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
15
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
16
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
17
|
+
};
|
|
18
|
+
var _UmButtonBase_elementInternals;
|
|
19
|
+
import { html, LitElement, nothing } from 'lit';
|
|
20
|
+
import { property, query } from 'lit/decorators.js';
|
|
21
|
+
import '../elevation/elevation.js';
|
|
22
|
+
import '../ripple/ripple.js';
|
|
23
|
+
export class UmButtonBase extends LitElement {
|
|
24
|
+
/**
|
|
25
|
+
* The `<form>` element to associate the button with (its form owner). The value of this attribute must be the id of a `<form>` in the same document. (If this attribute is not set, the button is associated with its ancestor `<form>` element, if any.)
|
|
26
|
+
* @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form
|
|
27
|
+
*/
|
|
28
|
+
get form() {
|
|
29
|
+
return __classPrivateFieldGet(this, _UmButtonBase_elementInternals, "f").form;
|
|
30
|
+
}
|
|
31
|
+
constructor() {
|
|
32
|
+
super();
|
|
33
|
+
/**
|
|
34
|
+
* Whether the button is disabled or not.
|
|
35
|
+
*/
|
|
36
|
+
this.disabled = false;
|
|
37
|
+
/**
|
|
38
|
+
* The URL that the link button points to.
|
|
39
|
+
*/
|
|
40
|
+
this.href = '';
|
|
41
|
+
/**
|
|
42
|
+
* Where to display the linked `href` URL for a link button. Common options
|
|
43
|
+
* include `_blank` to open in a new tab.
|
|
44
|
+
*/
|
|
45
|
+
this.target = '';
|
|
46
|
+
this.type = 'submit';
|
|
47
|
+
this.value = '';
|
|
48
|
+
_UmButtonBase_elementInternals.set(this, void 0);
|
|
49
|
+
__classPrivateFieldSet(this, _UmButtonBase_elementInternals, this.attachInternals(), "f");
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
return this.href
|
|
53
|
+
? this.renderLink()
|
|
54
|
+
: this.renderButton();
|
|
55
|
+
}
|
|
56
|
+
renderButton() {
|
|
57
|
+
return html `
|
|
58
|
+
<button
|
|
59
|
+
id="button"
|
|
60
|
+
class="button"
|
|
61
|
+
?disabled=${this.disabled}
|
|
62
|
+
aria-label="${this.getAriaLabel()}"
|
|
63
|
+
type="button">
|
|
64
|
+
<u-ripple ?disabled=${this.disabled}></u-ripple>
|
|
65
|
+
<u-elevation></u-elevation>
|
|
66
|
+
</button>
|
|
67
|
+
${this.renderContent()}`;
|
|
68
|
+
}
|
|
69
|
+
renderLink() {
|
|
70
|
+
return html `<a
|
|
71
|
+
id="link"
|
|
72
|
+
class="button"
|
|
73
|
+
href=${this.disabled ? nothing : this.href}
|
|
74
|
+
aria-disabled=${this.disabled || nothing}
|
|
75
|
+
aria-label="${this.getAriaLabel()}"
|
|
76
|
+
target=${this.target || nothing}>
|
|
77
|
+
<u-elevation></u-elevation>
|
|
78
|
+
<u-ripple ?disabled=${this.disabled}></u-ripple>
|
|
79
|
+
</a>
|
|
80
|
+
${this.renderContent()}`;
|
|
81
|
+
}
|
|
82
|
+
connectedCallback() {
|
|
83
|
+
super.connectedCallback();
|
|
84
|
+
this.addEventListener('click', this.innerHandleClick);
|
|
85
|
+
}
|
|
86
|
+
disconnectedCallback() {
|
|
87
|
+
super.disconnectedCallback();
|
|
88
|
+
this.removeEventListener('click', this.innerHandleClick);
|
|
89
|
+
}
|
|
90
|
+
focus() {
|
|
91
|
+
this.buttonElement?.focus();
|
|
92
|
+
}
|
|
93
|
+
blur() {
|
|
94
|
+
this.buttonElement?.blur();
|
|
95
|
+
}
|
|
96
|
+
getAriaLabel() {
|
|
97
|
+
return this.ariaLabel || nothing;
|
|
98
|
+
}
|
|
99
|
+
innerHandleClick(event) {
|
|
100
|
+
if (this.disabled) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (event.detail === 0) {
|
|
104
|
+
this.ripple.createRipple();
|
|
105
|
+
}
|
|
106
|
+
this.handleClick(event);
|
|
107
|
+
if (this.type === 'button' || !!this.href) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (!this.form) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
__classPrivateFieldGet(this, _UmButtonBase_elementInternals, "f").setFormValue(this.value);
|
|
114
|
+
if (this.type === 'submit') {
|
|
115
|
+
this.form.requestSubmit();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
this.form.reset();
|
|
119
|
+
}
|
|
120
|
+
handleClick(_) {
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
_UmButtonBase_elementInternals = new WeakMap();
|
|
124
|
+
UmButtonBase.formAssociated = true;
|
|
125
|
+
__decorate([
|
|
126
|
+
property({ type: Boolean, reflect: true })
|
|
127
|
+
], UmButtonBase.prototype, "disabled", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
property()
|
|
130
|
+
], UmButtonBase.prototype, "href", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
property()
|
|
133
|
+
], UmButtonBase.prototype, "target", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
property()
|
|
136
|
+
], UmButtonBase.prototype, "type", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
property({ reflect: true })
|
|
139
|
+
], UmButtonBase.prototype, "value", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
property()
|
|
142
|
+
], UmButtonBase.prototype, "name", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
query('.button')
|
|
145
|
+
], UmButtonBase.prototype, "buttonElement", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
query('u-ripple')
|
|
148
|
+
], UmButtonBase.prototype, "ripple", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
property()
|
|
151
|
+
], UmButtonBase.prototype, "form", null);
|
|
152
|
+
//# sourceMappingURL=button-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-base.js","sourceRoot":"","sources":["../../src/button/button-base.ts"],"names":[],"mappings":"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","sourcesContent":["import { html, HTMLTemplateResult, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport '../elevation/elevation.js';\nimport '../ripple/ripple.js';\nimport { UmRipple } from '../ripple/ripple';\n\nexport abstract class UmButtonBase extends LitElement {\n\n static readonly formAssociated = true;\n\n /**\n * Whether the button is disabled or not.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * The URL that the link button points to.\n */\n @property() href = '';\n\n /**\n * Where to display the linked `href` URL for a link button. Common options\n * include `_blank` to open in a new tab.\n */\n @property() target: string = '';\n\n @property() type: string = 'submit';\n\n @property({reflect: true}) value: string = '';\n @property() name: string | undefined;\n\n @query('.button') private readonly buttonElement!: HTMLElement;\n @query('u-ripple') private readonly ripple!: UmRipple;\n\n /**\n * The `<form>` element to associate the button with (its form owner). The value of this attribute must be the id of a `<form>` in the same document. (If this attribute is not set, the button is associated with its ancestor `<form>` element, if any.)\n * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form\n */\n @property()\n get form(): HTMLFormElement | null {\n return this.#elementInternals.form;\n }\n\n readonly #elementInternals: ElementInternals;\n\n constructor() {\n super();\n this.#elementInternals = this.attachInternals();\n }\n\n protected override render() {\n return this.href\n ? this.renderLink()\n : this.renderButton();\n }\n\n private renderButton() {\n\n return html`\n <button\n id=\"button\"\n class=\"button\"\n ?disabled=${this.disabled}\n aria-label=\"${this.getAriaLabel()}\"\n type=\"button\">\n <u-ripple ?disabled=${this.disabled}></u-ripple>\n <u-elevation></u-elevation>\n </button>\n ${this.renderContent()}`;\n }\n\n private renderLink() {\n\n return html`<a\n id=\"link\"\n class=\"button\"\n href=${this.disabled ? nothing : this.href}\n aria-disabled=${this.disabled || nothing}\n aria-label=\"${this.getAriaLabel()}\"\n target=${this.target || nothing}>\n <u-elevation></u-elevation>\n <u-ripple ?disabled=${this.disabled}></u-ripple>\n </a>\n ${this.renderContent()}`;\n }\n\n protected abstract renderContent(): HTMLTemplateResult;\n\n override connectedCallback() {\n super.connectedCallback();\n\n this.addEventListener('click', this.innerHandleClick);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n\n this.removeEventListener('click', this.innerHandleClick);\n }\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n protected getAriaLabel(): string | null | typeof nothing {\n return this.ariaLabel || nothing;\n }\n\n private innerHandleClick(event: UIEvent): void {\n\n if (this.disabled) {\n return;\n }\n\n if (event.detail === 0) {\n this.ripple.createRipple();\n }\n\n this.handleClick(event);\n\n if (this.type === 'button' || !!this.href) {\n return;\n }\n\n if (!this.form) {\n return;\n }\n\n this.#elementInternals.setFormValue(this.value);\n\n if (this.type === 'submit') {\n this.form.requestSubmit();\n return;\n }\n\n this.form.reset();\n }\n\n protected handleClick(_: UIEvent): void {\n\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-base.styles.d.ts","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAwElB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_color-primary: var(--u-color-primary, rgb(103, 80, 164));
|
|
5
|
+
-webkit-tap-highlight-color: transparent;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
vertical-align: baseline;
|
|
10
|
+
position: relative;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
font-family: var(--u-font-family-base, system-ui);
|
|
13
|
+
transition: color 150ms ease-in-out, background-color 150ms ease-in-out;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([disabled]) {
|
|
17
|
+
--u-elevation-level: 0 !important;
|
|
18
|
+
background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), 0.12)) !important;
|
|
19
|
+
color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), 0.38)) !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([disabled]) .button {
|
|
23
|
+
cursor: default;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
* {
|
|
27
|
+
color: inherit;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
u-elevation {
|
|
31
|
+
z-index: -1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.button {
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
border-radius: inherit;
|
|
40
|
+
color: inherit;
|
|
41
|
+
border: none;
|
|
42
|
+
margin: 0;
|
|
43
|
+
padding: 0;
|
|
44
|
+
text-align: center;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
background: transparent;
|
|
47
|
+
user-select: none;
|
|
48
|
+
text-decoration: none;
|
|
49
|
+
outline: 0;
|
|
50
|
+
z-index: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.button:focus-visible {
|
|
54
|
+
animation: offset-pulse 400ms ease;
|
|
55
|
+
animation-fill-mode: forwards;
|
|
56
|
+
outline-offset: 2px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
::slotted([slot=icon]) {
|
|
60
|
+
display: inline-block;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@keyframes offset-pulse {
|
|
64
|
+
0% {
|
|
65
|
+
outline: 4px solid var(--_color-primary);
|
|
66
|
+
}
|
|
67
|
+
50% {
|
|
68
|
+
outline: 8px solid var(--_color-primary);
|
|
69
|
+
}
|
|
70
|
+
100% {
|
|
71
|
+
outline: 4px solid var(--_color-primary);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
75
|
+
//# sourceMappingURL=button-base.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-base.styles.js","sourceRoot":"","sources":["../../src/button/button-base.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_color-primary: var(--u-color-primary, rgb(103, 80, 164));\n -webkit-tap-highlight-color: transparent;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n vertical-align: baseline;\n position: relative;\n white-space: nowrap;\n font-family: var(--u-font-family-base, system-ui);\n transition: color 150ms ease-in-out, background-color 150ms ease-in-out;\n }\n\n :host([disabled]) {\n --u-elevation-level: 0 !important;\n background-color: var(--u-button-disabled-background-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), 0.12)) !important;\n color: var(--u-button-disabled-text-color, rgba(var(--u-color-on-surface-rgb, 29, 27, 32), 0.38)) !important;\n }\n\n :host([disabled]) .button {\n cursor: default;\n }\n\n * {\n color: inherit;\n }\n\n u-elevation {\n z-index: -1;\n }\n\n .button {\n cursor: pointer;\n position: absolute;\n inset: 0;\n font-family: inherit;\n border-radius: inherit;\n color: inherit;\n border: none;\n margin: 0;\n padding: 0;\n text-align: center;\n white-space: nowrap;\n background: transparent;\n user-select: none;\n text-decoration: none;\n outline: 0;\n z-index: 0;\n }\n\n .button:focus-visible {\n animation: offset-pulse 400ms ease;\n animation-fill-mode: forwards;\n outline-offset: 2px;\n }\n\n ::slotted([slot=icon]) {\n display: inline-block;\n }\n\n @keyframes offset-pulse {\n 0% {\n outline: 4px solid var(--_color-primary);\n }\n 50% {\n outline: 8px solid var(--_color-primary);\n }\n 100% {\n outline: 4px solid var(--_color-primary);\n }\n }\n`;\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
export type UmButtonSetAlignment = 'start' | 'center' | 'end';
|
|
3
|
+
export declare class UmButtonSet extends LitElement {
|
|
4
|
+
static styles: import("lit").CSSResult;
|
|
5
|
+
/**
|
|
6
|
+
* Set the alignment of the buttons at the `start`, `center` or at the `end`.
|
|
7
|
+
*/
|
|
8
|
+
align: UmButtonSetAlignment;
|
|
9
|
+
/**
|
|
10
|
+
* Whether to render the buttons stacked or not
|
|
11
|
+
*/
|
|
12
|
+
stack: boolean;
|
|
13
|
+
render(): HTMLTemplateResult;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'u-button-set': UmButtonSet;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=button-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.d.ts","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAK3D,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9D,qBACa,WAAY,SAAQ,UAAU;IAEzC,OAAgB,MAAM,0BAAU;IAEhC;;OAEG;IACwB,KAAK,EAAE,oBAAoB,CAAS;IAE/D;;OAEG;IACuC,KAAK,UAAS;IAE/C,MAAM,IAAI,kBAAkB;CAItC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { styles } from './button-set.styles';
|
|
10
|
+
let UmButtonSet = class UmButtonSet extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
/**
|
|
14
|
+
* Set the alignment of the buttons at the `start`, `center` or at the `end`.
|
|
15
|
+
*/
|
|
16
|
+
this.align = 'end';
|
|
17
|
+
/**
|
|
18
|
+
* Whether to render the buttons stacked or not
|
|
19
|
+
*/
|
|
20
|
+
this.stack = false;
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
return html `
|
|
24
|
+
<slot></slot>`;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
UmButtonSet.styles = styles;
|
|
28
|
+
__decorate([
|
|
29
|
+
property({ reflect: true })
|
|
30
|
+
], UmButtonSet.prototype, "align", void 0);
|
|
31
|
+
__decorate([
|
|
32
|
+
property({ type: Boolean, reflect: true })
|
|
33
|
+
], UmButtonSet.prototype, "stack", void 0);
|
|
34
|
+
UmButtonSet = __decorate([
|
|
35
|
+
customElement('u-button-set')
|
|
36
|
+
], UmButtonSet);
|
|
37
|
+
export { UmButtonSet };
|
|
38
|
+
//# sourceMappingURL=button-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.js","sourceRoot":"","sources":["../../src/button/button-set.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAKtC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAIL;;WAEG;QACwB,UAAK,GAAyB,KAAK,CAAC;QAE/D;;WAEG;QACuC,UAAK,GAAG,KAAK,CAAC;IAM1D,CAAC;IAJU,MAAM;QACb,OAAO,IAAI,CAAA;oBACK,CAAC;IACnB,CAAC;;AAfe,kBAAM,GAAG,MAAM,AAAT,CAAU;AAKL;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAqC;AAKrB;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAe;AAZ7C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAkBvB","sourcesContent":["import { html, HTMLTemplateResult, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles } from './button-set.styles';\n\nexport type UmButtonSetAlignment = 'start' | 'center' | 'end';\n\n@customElement('u-button-set')\nexport class UmButtonSet extends LitElement {\n\n static override styles = styles;\n\n /**\n * Set the alignment of the buttons at the `start`, `center` or at the `end`.\n */\n @property({reflect: true}) align: UmButtonSetAlignment = 'end';\n\n /**\n * Whether to render the buttons stacked or not\n */\n @property({type: Boolean, reflect: true}) stack = false;\n\n override render(): HTMLTemplateResult {\n return html`\n <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-button-set': UmButtonSet;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.styles.d.ts","sourceRoot":"","sources":["../../src/button/button-set.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAoClB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: flex;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
align-items: center;
|
|
7
|
+
flex-wrap: nowrap;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:host([align=start]) {
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([align=center]) {
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host([align=end]) {
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([stack][align=start]) {
|
|
23
|
+
align-items: flex-start;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
:host([stack][align=center]) {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([stack][align=end]) {
|
|
31
|
+
align-items: flex-end;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([stack]) {
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
justify-content: flex-start;
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
//# sourceMappingURL=button-set.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-set.styles.js","sourceRoot":"","sources":["../../src/button/button-set.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: flex;\n gap: 8px;\n align-items: center;\n flex-wrap: nowrap;\n }\n\n :host([align=start]) {\n justify-content: flex-start;\n }\n\n :host([align=center]) {\n justify-content: center;\n }\n\n :host([align=end]) {\n justify-content: flex-end;\n }\n\n :host([stack][align=start]) {\n align-items: flex-start;\n }\n\n :host([stack][align=center]) {\n align-items: center;\n }\n\n :host([stack][align=end]) {\n align-items: flex-end;\n }\n\n :host([stack]) {\n flex-direction: column;\n justify-content: flex-start;\n }\n`;\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CSSResult, HTMLTemplateResult } from 'lit';
|
|
2
|
+
import { UmButtonBase } from './button-base';
|
|
3
|
+
import '../ripple/ripple.js';
|
|
4
|
+
export type UmButtonVariant = 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';
|
|
5
|
+
export type UmButtonColor = 'primary' | 'secondary' | 'tertiary' | 'error' | undefined;
|
|
6
|
+
export declare class UmButton extends UmButtonBase {
|
|
7
|
+
static styles: CSSResult | CSSResult[];
|
|
8
|
+
/**
|
|
9
|
+
* The Button variant to render
|
|
10
|
+
*/
|
|
11
|
+
variant: UmButtonVariant;
|
|
12
|
+
/**
|
|
13
|
+
* The Button color
|
|
14
|
+
*
|
|
15
|
+
* _Note:_ Filled buttons only
|
|
16
|
+
*/
|
|
17
|
+
color: UmButtonColor;
|
|
18
|
+
trailingIcon: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the button has icon or not
|
|
21
|
+
*
|
|
22
|
+
* _Note:_ Readonly
|
|
23
|
+
*/
|
|
24
|
+
hasIcon: boolean;
|
|
25
|
+
private readonly assignedIcons;
|
|
26
|
+
protected renderContent(): HTMLTemplateResult;
|
|
27
|
+
private handleSlotChange;
|
|
28
|
+
}
|
|
29
|
+
declare global {
|
|
30
|
+
interface HTMLElementTagNameMap {
|
|
31
|
+
'u-button': UmButton;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,qBAAqB,CAAC;AAE7B,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;AACpF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,SAAS,CAAC;AAEvF,qBACa,QAAS,SAAQ,YAAY;IAExC,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CAA8B;IAE7E;;OAEG;IACwB,OAAO,EAAE,eAAe,CAAY;IAE/D;;;;OAIG;IACwB,KAAK,EAAE,aAAa,CAAC;IAEsB,YAAY,UAAS;IAE3F;;;;OAIG;IAC8D,OAAO,UAAS;IAGjF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;cAE5B,aAAa,IAAI,kBAAkB;IActD,OAAO,CAAC,gBAAgB;CAGzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,QAAQ,CAAC;KACtB;CACF"}
|
package/button/button.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html, nothing } from 'lit';
|
|
8
|
+
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
+
import { UmButtonBase } from './button-base';
|
|
10
|
+
import { styles as buttonBaseStyles } from './button-base.styles';
|
|
11
|
+
import { styles } from './button.styles';
|
|
12
|
+
import '../ripple/ripple.js';
|
|
13
|
+
let UmButton = class UmButton extends UmButtonBase {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
/**
|
|
17
|
+
* The Button variant to render
|
|
18
|
+
*/
|
|
19
|
+
this.variant = 'filled';
|
|
20
|
+
this.trailingIcon = false;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the button has icon or not
|
|
23
|
+
*
|
|
24
|
+
* _Note:_ Readonly
|
|
25
|
+
*/
|
|
26
|
+
this.hasIcon = false;
|
|
27
|
+
}
|
|
28
|
+
renderContent() {
|
|
29
|
+
const icon = html `
|
|
30
|
+
<slot
|
|
31
|
+
name="icon"
|
|
32
|
+
aria-hidden="true"
|
|
33
|
+
@slotchange="${this.handleSlotChange}"></slot>`;
|
|
34
|
+
return html `
|
|
35
|
+
${this.trailingIcon ? nothing : icon}
|
|
36
|
+
<span><slot></slot></span>
|
|
37
|
+
${this.trailingIcon ? icon : nothing}
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
handleSlotChange() {
|
|
41
|
+
this.hasIcon = this.assignedIcons.length > 0;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
UmButton.styles = [buttonBaseStyles, styles];
|
|
45
|
+
__decorate([
|
|
46
|
+
property({ reflect: true })
|
|
47
|
+
], UmButton.prototype, "variant", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
property({ reflect: true })
|
|
50
|
+
], UmButton.prototype, "color", void 0);
|
|
51
|
+
__decorate([
|
|
52
|
+
property({ type: Boolean, attribute: 'trailing-icon', reflect: true })
|
|
53
|
+
], UmButton.prototype, "trailingIcon", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
property({ type: Boolean, attribute: 'has-icon', reflect: true })
|
|
56
|
+
], UmButton.prototype, "hasIcon", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
queryAssignedElements({ slot: 'icon', flatten: true })
|
|
59
|
+
], UmButton.prototype, "assignedIcons", void 0);
|
|
60
|
+
UmButton = __decorate([
|
|
61
|
+
customElement('u-button')
|
|
62
|
+
], UmButton);
|
|
63
|
+
export { UmButton };
|
|
64
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/button/button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAa,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,qBAAqB,CAAC;AAMtB,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,YAAY;IAAnC;;QAIL;;WAEG;QACwB,YAAO,GAAoB,QAAQ,CAAC;QASO,iBAAY,GAAG,KAAK,CAAC;QAE3F;;;;WAIG;QAC8D,YAAO,GAAG,KAAK,CAAC;IAsBnF,CAAC;IAjBoB,aAAa;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAA;;;;uBAIE,IAAI,CAAC,gBAAgB,WAAW,CAAC;QAEpD,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;;QAElC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO;KACrC,CAAC;IACJ,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/C,CAAC;;AA1Ce,eAAM,GAA4B,CAAC,gBAAgB,EAAE,MAAM,CAAC,AAAtD,CAAuD;AAKlD;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAqC;AAOpC;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAAsB;AAEsB;IAArE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAAsB;AAO1B;IAAhE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAiB;AAGhE;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;+CACN;AA1BpC,QAAQ;IADpB,aAAa,CAAC,UAAU,CAAC;GACb,QAAQ,CA6CpB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { UmButtonBase } from './button-base';\nimport { styles as buttonBaseStyles } from './button-base.styles';\nimport { styles } from './button.styles';\nimport '../ripple/ripple.js';\n\nexport type UmButtonVariant = 'filled' | 'tonal' | 'elevated' | 'outlined' | 'text';\nexport type UmButtonColor = 'primary' | 'secondary' | 'tertiary' | 'error' | undefined;\n\n@customElement('u-button')\nexport class UmButton extends UmButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];\n\n /**\n * The Button variant to render\n */\n @property({reflect: true}) variant: UmButtonVariant = 'filled';\n\n /**\n * The Button color\n *\n * _Note:_ Filled buttons only\n */\n @property({reflect: true}) color: UmButtonColor;\n\n @property({type: Boolean, attribute: 'trailing-icon', reflect: true}) trailingIcon = false;\n\n /**\n * Whether the button has icon or not\n *\n * _Note:_ Readonly\n */\n @property({type: Boolean, attribute: 'has-icon', reflect: true}) hasIcon = false;\n\n @queryAssignedElements({slot: 'icon', flatten: true})\n private readonly assignedIcons!: HTMLElement[];\n\n protected override renderContent(): HTMLTemplateResult {\n const icon = html`\n <slot\n name=\"icon\"\n aria-hidden=\"true\"\n @slotchange=\"${this.handleSlotChange}\"></slot>`;\n\n return html`\n ${this.trailingIcon ? nothing : icon}\n <span><slot></slot></span>\n ${this.trailingIcon ? icon : nothing}\n `;\n }\n\n private handleSlotChange() {\n this.hasIcon = this.assignedIcons.length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-button': UmButton;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.styles.d.ts","sourceRoot":"","sources":["../../src/button/button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA6FlB,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--u-common-button-line-height: var(--u-label-large-line-height, 1.25rem);
|
|
5
|
+
--u-common-button-font-size: var(--u-label-large-font-size, 0.875rem);
|
|
6
|
+
--u-common-button-font-weight: var(--u-font-weight-medium, 500);
|
|
7
|
+
--_common-button-height: var(--u-common-button-height, 2.5rem);
|
|
8
|
+
--_common-button-padding: var(--u-common-button-padding, 24px);
|
|
9
|
+
--_common-button-icon-padding: var(--u-common-button-icon-padding, 16px);
|
|
10
|
+
border-radius: var(--u-common-button-shape-corner, var(--u-shape-corner-full, 9999px));
|
|
11
|
+
font-family: var(--u-font-family-base, system-ui);
|
|
12
|
+
height: var(--u-common-button-height, 40px);
|
|
13
|
+
font-size: var(--u-common-button-font-size);
|
|
14
|
+
font-weight: var(--u-common-button-font-weight);
|
|
15
|
+
padding-inline: var(--_common-button-padding);
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
:host([variant=filled]),
|
|
20
|
+
:host([variant=filled][color=primary]) {
|
|
21
|
+
background-color: var(--u-filled-button-primary-container-color, var(--_color-primary));
|
|
22
|
+
color: var(--u-filled-button-primary-text-color, var(--u-color-on-primary, rgb(255, 255, 255)));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host([variant=filled][color=secondary]) {
|
|
26
|
+
background-color: var(--u-filled-button-secondary-container-color, var(--u-color-secondary, rgb(98, 91, 113)));
|
|
27
|
+
color: var(--u-filled-button-secondary-text-color, var(--u-color-on-secondary, rgb(255, 255, 255)));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([variant=filled][color=tertiary]) {
|
|
31
|
+
background-color: var(--u-filled-button-tertiary-container-color, var(--u-color-tertiary, rgb(125, 82, 96)));
|
|
32
|
+
color: var(--u-filled-button-tertiary-text-color, var(--u-color-on-tertiary, rgb(255, 255, 255)));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([variant=filled][color=error]) {
|
|
36
|
+
background-color: var(--u-filled-button-error-container-color, var(--u-color-error, rgb(179, 38, 30)));
|
|
37
|
+
color: var(--u-filled-button-error-text-color, var(--u-color-on-error, rgb(255, 255, 255)));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:host([variant=tonal]) {
|
|
41
|
+
background-color: var(--u-tonal-button-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));
|
|
42
|
+
color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([variant=elevated]) {
|
|
46
|
+
background-color: var(--u-elevated-button-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));
|
|
47
|
+
color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (hover: hover) {
|
|
51
|
+
:host([variant=filled]:hover:not(:focus-within):not(:active)),
|
|
52
|
+
:host([variant=tonal]:hover:not(:focus-within):not(:active)) {
|
|
53
|
+
--u-elevation-level: var(--u-filled-button-hover-elevation-level, 1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
:host([variant=outlined]),
|
|
57
|
+
:host([variant=text]),
|
|
58
|
+
:host([variant=elevated]) {
|
|
59
|
+
color: var(--_color-primary);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([variant=outlined]) {
|
|
63
|
+
border: 1px solid var(--u-color-outline, rgb(121, 116, 126));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([variant=elevated]) {
|
|
67
|
+
--u-elevation-level: var(--u-elevated-button-elevation-level, 1);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (hover: hover) {
|
|
71
|
+
:host([variant=elevated]:hover) {
|
|
72
|
+
--u-elevation-level: var(--u-elevated-button-hover-elevation-level, 2);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
:host([has-icon]) {
|
|
76
|
+
padding-inline: var(--_common-button-icon-padding) var(--_common-button-padding);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([has-icon][trailing-icon]) {
|
|
80
|
+
padding-inline: var(--_common-button-padding) var(--_common-button-icon-padding);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
::slotted([slot=icon]) {
|
|
84
|
+
display: inline-block;
|
|
85
|
+
width: var(--u-common-button-icon-size, 1.125rem);
|
|
86
|
+
height: var(--u-common-button-icon-size, 1.125rem);
|
|
87
|
+
margin-inline-end: 8px;
|
|
88
|
+
font-size: var(--u-common-button-icon-size, 1.125rem);
|
|
89
|
+
line-height: var(--u-common-button-icon-size, 1.125rem);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([trailing-icon]) ::slotted([slot=icon]) {
|
|
93
|
+
margin-inline: 8px 0;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
//# sourceMappingURL=button.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.styles.js","sourceRoot":"","sources":["../../src/button/button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6FzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --u-common-button-line-height: var(--u-label-large-line-height, 1.25rem);\n --u-common-button-font-size: var(--u-label-large-font-size, 0.875rem);\n --u-common-button-font-weight: var(--u-font-weight-medium, 500);\n --_common-button-height: var(--u-common-button-height, 2.5rem);\n --_common-button-padding: var(--u-common-button-padding, 24px);\n --_common-button-icon-padding: var(--u-common-button-icon-padding, 16px);\n border-radius: var(--u-common-button-shape-corner, var(--u-shape-corner-full, 9999px));\n font-family: var(--u-font-family-base, system-ui);\n height: var(--u-common-button-height, 40px);\n font-size: var(--u-common-button-font-size);\n font-weight: var(--u-common-button-font-weight);\n padding-inline: var(--_common-button-padding);\n box-sizing: border-box;\n }\n\n :host([variant=filled]),\n :host([variant=filled][color=primary]) {\n background-color: var(--u-filled-button-primary-container-color, var(--_color-primary));\n color: var(--u-filled-button-primary-text-color, var(--u-color-on-primary, rgb(255, 255, 255)));\n }\n\n :host([variant=filled][color=secondary]) {\n background-color: var(--u-filled-button-secondary-container-color, var(--u-color-secondary, rgb(98, 91, 113)));\n color: var(--u-filled-button-secondary-text-color, var(--u-color-on-secondary, rgb(255, 255, 255)));\n }\n\n :host([variant=filled][color=tertiary]) {\n background-color: var(--u-filled-button-tertiary-container-color, var(--u-color-tertiary, rgb(125, 82, 96)));\n color: var(--u-filled-button-tertiary-text-color, var(--u-color-on-tertiary, rgb(255, 255, 255)));\n }\n\n :host([variant=filled][color=error]) {\n background-color: var(--u-filled-button-error-container-color, var(--u-color-error, rgb(179, 38, 30)));\n color: var(--u-filled-button-error-text-color, var(--u-color-on-error, rgb(255, 255, 255)));\n }\n\n :host([variant=tonal]) {\n background-color: var(--u-tonal-button-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n :host([variant=elevated]) {\n background-color: var(--u-elevated-button-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));\n color: var(--u-tonal-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n @media (hover: hover) {\n :host([variant=filled]:hover:not(:focus-within):not(:active)),\n :host([variant=tonal]:hover:not(:focus-within):not(:active)) {\n --u-elevation-level: var(--u-filled-button-hover-elevation-level, 1);\n }\n }\n :host([variant=outlined]),\n :host([variant=text]),\n :host([variant=elevated]) {\n color: var(--_color-primary);\n }\n\n :host([variant=outlined]) {\n border: 1px solid var(--u-color-outline, rgb(121, 116, 126));\n }\n\n :host([variant=elevated]) {\n --u-elevation-level: var(--u-elevated-button-elevation-level, 1);\n }\n\n @media (hover: hover) {\n :host([variant=elevated]:hover) {\n --u-elevation-level: var(--u-elevated-button-hover-elevation-level, 2);\n }\n }\n :host([has-icon]) {\n padding-inline: var(--_common-button-icon-padding) var(--_common-button-padding);\n }\n\n :host([has-icon][trailing-icon]) {\n padding-inline: var(--_common-button-padding) var(--_common-button-icon-padding);\n }\n\n ::slotted([slot=icon]) {\n display: inline-block;\n width: var(--u-common-button-icon-size, 1.125rem);\n height: var(--u-common-button-icon-size, 1.125rem);\n margin-inline-end: 8px;\n font-size: var(--u-common-button-icon-size, 1.125rem);\n line-height: var(--u-common-button-icon-size, 1.125rem);\n }\n\n :host([trailing-icon]) ::slotted([slot=icon]) {\n margin-inline: 8px 0;\n }\n`;\n"]}
|