@universal-material/web 3.0.9 → 3.0.11
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
package/button/fab.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CSSResult, HTMLTemplateResult } from 'lit';
|
|
2
|
+
import { UmButtonBase } from './button-base';
|
|
3
|
+
export type UmFabColor = 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded';
|
|
4
|
+
export type UmFabSize = 'small' | 'medium' | 'large';
|
|
5
|
+
export declare class UmFab extends UmButtonBase {
|
|
6
|
+
static styles: CSSResult | CSSResult[];
|
|
7
|
+
/**
|
|
8
|
+
* The FAB color variant to render.
|
|
9
|
+
*/
|
|
10
|
+
color: UmFabColor;
|
|
11
|
+
/**
|
|
12
|
+
* The size of the FAB.
|
|
13
|
+
*/
|
|
14
|
+
size: UmFabSize;
|
|
15
|
+
/**
|
|
16
|
+
* The text to display the FAB.
|
|
17
|
+
*/
|
|
18
|
+
label: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* Lowers the FAB's elevation.
|
|
21
|
+
*/
|
|
22
|
+
lowered: boolean;
|
|
23
|
+
get extended(): boolean;
|
|
24
|
+
protected renderContent(): HTMLTemplateResult;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'u-fab': UmFab;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=fab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab.d.ts","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAW,MAAM,KAAK,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAI7C,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,CAAC;AACtF,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAErD,qBACa,KAAM,SAAQ,YAAY;IAErC,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CAA8B;IAE7E;;OAEG;IACwB,KAAK,EAAE,UAAU,CAAa;IAEzD;;OAEG;IACwB,IAAI,EAAE,SAAS,CAAY;IAEtD;;OAEG;IACwB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEvD;;OAEG;IACuC,OAAO,UAAS;IAE1D,IACI,QAAQ,IAAI,OAAO,CAEtB;cAEkB,aAAa,IAAI,kBAAkB;CAQvD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,OAAO,EAAE,KAAK,CAAC;KAChB;CACF"}
|
package/button/fab.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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 } from 'lit/decorators.js';
|
|
9
|
+
import { UmButtonBase } from './button-base';
|
|
10
|
+
import { styles as buttonBaseStyles } from './button-base.styles';
|
|
11
|
+
import { styles } from './fab.styles';
|
|
12
|
+
let UmFab = class UmFab extends UmButtonBase {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
/**
|
|
16
|
+
* The FAB color variant to render.
|
|
17
|
+
*/
|
|
18
|
+
this.color = 'primary';
|
|
19
|
+
/**
|
|
20
|
+
* The size of the FAB.
|
|
21
|
+
*/
|
|
22
|
+
this.size = 'medium';
|
|
23
|
+
/**
|
|
24
|
+
* The text to display the FAB.
|
|
25
|
+
*/
|
|
26
|
+
this.label = null;
|
|
27
|
+
/**
|
|
28
|
+
* Lowers the FAB's elevation.
|
|
29
|
+
*/
|
|
30
|
+
this.lowered = false;
|
|
31
|
+
}
|
|
32
|
+
get extended() {
|
|
33
|
+
return !!this.label;
|
|
34
|
+
}
|
|
35
|
+
renderContent() {
|
|
36
|
+
const labelTag = html `<span>${this.label}</span>`;
|
|
37
|
+
return html `
|
|
38
|
+
<span class="icon" aria-hidden="true"><slot></slot></span>
|
|
39
|
+
${this.label ? labelTag : nothing}
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
UmFab.styles = [buttonBaseStyles, styles];
|
|
44
|
+
__decorate([
|
|
45
|
+
property({ reflect: true })
|
|
46
|
+
], UmFab.prototype, "color", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
property({ reflect: true })
|
|
49
|
+
], UmFab.prototype, "size", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
property({ reflect: true })
|
|
52
|
+
], UmFab.prototype, "label", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
property({ type: Boolean, reflect: true })
|
|
55
|
+
], UmFab.prototype, "lowered", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
property({ type: Boolean, reflect: true })
|
|
58
|
+
], UmFab.prototype, "extended", null);
|
|
59
|
+
UmFab = __decorate([
|
|
60
|
+
customElement('u-fab')
|
|
61
|
+
], UmFab);
|
|
62
|
+
export { UmFab };
|
|
63
|
+
//# sourceMappingURL=fab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab.js","sourceRoot":"","sources":["../../src/button/fab.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAa,IAAI,EAAsB,OAAO,EAAE,MAAM,KAAK,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAM/B,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,YAAY;IAAhC;;QAIL;;WAEG;QACwB,UAAK,GAAe,SAAS,CAAC;QAEzD;;WAEG;QACwB,SAAI,GAAc,QAAQ,CAAC;QAEtD;;WAEG;QACwB,UAAK,GAAkB,IAAI,CAAC;QAEvD;;WAEG;QACuC,YAAO,GAAG,KAAK,CAAC;IAe5D,CAAC;IAZC,IAAI,QAAQ;QACV,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAEkB,aAAa;QAC9B,MAAM,QAAQ,GAAG,IAAI,CAAA,SAAS,IAAI,CAAC,KAAK,SAAS,CAAC;QAElD,OAAO,IAAI,CAAA;;QAEP,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO;KAClC,CAAC;IACJ,CAAC;;AAlCe,YAAM,GAA4B,CAAC,gBAAgB,EAAE,MAAM,CAAC,AAAtD,CAAuD;AAKlD;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;oCAA+B;AAK9B;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;mCAA4B;AAK3B;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;oCAA6B;AAKb;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;sCAAiB;AAG1D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;qCAGxC;AA3BU,KAAK;IADjB,aAAa,CAAC,OAAO,CAAC;GACV,KAAK,CAqCjB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { UmButtonBase } from './button-base';\nimport { styles as buttonBaseStyles } from './button-base.styles';\nimport { styles } from './fab.styles';\n\nexport type UmFabColor = 'primary' | 'secondary' | 'tertiary' | 'surface' | 'branded';\nexport type UmFabSize = 'small' | 'medium' | 'large';\n\n@customElement('u-fab')\nexport class UmFab extends UmButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];\n \n /**\n * The FAB color variant to render.\n */\n @property({reflect: true}) color: UmFabColor = 'primary';\n\n /**\n * The size of the FAB.\n */\n @property({reflect: true}) size: UmFabSize = 'medium';\n\n /**\n * The text to display the FAB.\n */\n @property({reflect: true}) label: string | null = null;\n\n /**\n * Lowers the FAB's elevation.\n */\n @property({type: Boolean, reflect: true}) lowered = false;\n\n @property({type: Boolean, reflect: true})\n get extended(): boolean {\n return !!this.label;\n }\n\n protected override renderContent(): HTMLTemplateResult {\n const labelTag = html`<span>${this.label}</span>`;\n\n return html`\n <span class=\"icon\" aria-hidden=\"true\"><slot></slot></span>\n ${this.label ? labelTag : nothing}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-fab': UmFab;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab.styles.d.ts","sourceRoot":"","sources":["../../src/button/fab.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAsFlB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
aspect-ratio: 1;
|
|
5
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 3);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
:host([lowered]) {
|
|
9
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (hover: hover) {
|
|
13
|
+
:host(:hover:not(:focus-within):not(:active)) {
|
|
14
|
+
--u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
|
|
15
|
+
}
|
|
16
|
+
:host(:hover:not(:focus-within):not(:active)[lowered]) {
|
|
17
|
+
--u-elevation-level: var(--u-fab-button-elevation-level, 2);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
@media (hover: hover) {
|
|
21
|
+
:host(:hover:not(:focus-within):not(:active)) {
|
|
22
|
+
--u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
:host([size=small]) {
|
|
26
|
+
width: var(--u-fab-button-small-size, 40px);
|
|
27
|
+
border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-medium, 12px));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host([size=large]) {
|
|
31
|
+
width: var(--u-fab-button-medium-size, 96px);
|
|
32
|
+
border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-extra-large, 28px));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:host([extended]),
|
|
36
|
+
:host([size=medium]) {
|
|
37
|
+
width: var(--u-fab-button-medium-size, 56px);
|
|
38
|
+
border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-large, 16px));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([size=large]) .icon {
|
|
42
|
+
font-size: var(--u-fab-button-icon-size, 2rem);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([extended]) .icon,
|
|
46
|
+
:host([size=small]) .icon,
|
|
47
|
+
:host([size=medium]) .icon {
|
|
48
|
+
font-size: var(--u-fab-button-icon-size, 1.5rem);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([extended]) {
|
|
52
|
+
width: auto;
|
|
53
|
+
height: var(--u-extended-fab-button-height, 56px);
|
|
54
|
+
aspect-ratio: auto;
|
|
55
|
+
min-width: var(--u-extended-fab-button-min-width, 80px);
|
|
56
|
+
padding-inline: var(--u-extended-fab-button-padding, 16px 24px);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([extended]) .icon {
|
|
60
|
+
margin-inline-end: var(--u-extended-fab-button-icon-margin, 12px);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:host([color=primary]) {
|
|
64
|
+
background-color: var(--u-fab-button-primary-background-color, var(--u-color-primary-container, rgb(234, 221, 255)));
|
|
65
|
+
color: var(--u-fab-button-primary-text-color, var(--u-color-on-primary-container, rgb(33, 0, 93)));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([color=secondary]) {
|
|
69
|
+
background-color: var(--u-fab-button-secondary-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));
|
|
70
|
+
color: var(--u-fab-button-secondary-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:host([color=tertiary]) {
|
|
74
|
+
background-color: var(--u-fab-button-tertiary-background-color, var(--u-color-tertiary-container, rgb(255, 216, 228)));
|
|
75
|
+
color: var(--u-fab-button-tertiary-text-color, var(--u-color-on-tertiary-container, rgb(49, 17, 29)));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([color=branded]),
|
|
79
|
+
:host([color=surface]) {
|
|
80
|
+
background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-high, rgb(236, 230, 240)));
|
|
81
|
+
color: var(--u-fab-button-surface-text-color, var(--_color-primary));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([color=branded][lowered]),
|
|
85
|
+
:host([color=surface][lowered]) {
|
|
86
|
+
background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
//# sourceMappingURL=fab.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fab.styles.js","sourceRoot":"","sources":["../../src/button/fab.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n aspect-ratio: 1;\n --u-elevation-level: var(--u-fab-button-elevation-level, 3);\n }\n\n :host([lowered]) {\n --u-elevation-level: var(--u-fab-button-elevation-level, 1);\n }\n\n @media (hover: hover) {\n :host(:hover:not(:focus-within):not(:active)) {\n --u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);\n }\n :host(:hover:not(:focus-within):not(:active)[lowered]) {\n --u-elevation-level: var(--u-fab-button-elevation-level, 2);\n }\n }\n @media (hover: hover) {\n :host(:hover:not(:focus-within):not(:active)) {\n --u-elevation-level: var(--u-fab-button-hover-elevation-level, 4);\n }\n }\n :host([size=small]) {\n width: var(--u-fab-button-small-size, 40px);\n border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-medium, 12px));\n }\n\n :host([size=large]) {\n width: var(--u-fab-button-medium-size, 96px);\n border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-extra-large, 28px));\n }\n\n :host([extended]),\n :host([size=medium]) {\n width: var(--u-fab-button-medium-size, 56px);\n border-radius: var(--u-fab-button-medium-shape-corner, var(--u-shape-corner-large, 16px));\n }\n\n :host([size=large]) .icon {\n font-size: var(--u-fab-button-icon-size, 2rem);\n }\n\n :host([extended]) .icon,\n :host([size=small]) .icon,\n :host([size=medium]) .icon {\n font-size: var(--u-fab-button-icon-size, 1.5rem);\n }\n\n :host([extended]) {\n width: auto;\n height: var(--u-extended-fab-button-height, 56px);\n aspect-ratio: auto;\n min-width: var(--u-extended-fab-button-min-width, 80px);\n padding-inline: var(--u-extended-fab-button-padding, 16px 24px);\n }\n\n :host([extended]) .icon {\n margin-inline-end: var(--u-extended-fab-button-icon-margin, 12px);\n }\n\n :host([color=primary]) {\n background-color: var(--u-fab-button-primary-background-color, var(--u-color-primary-container, rgb(234, 221, 255)));\n color: var(--u-fab-button-primary-text-color, var(--u-color-on-primary-container, rgb(33, 0, 93)));\n }\n\n :host([color=secondary]) {\n background-color: var(--u-fab-button-secondary-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n color: var(--u-fab-button-secondary-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n :host([color=tertiary]) {\n background-color: var(--u-fab-button-tertiary-background-color, var(--u-color-tertiary-container, rgb(255, 216, 228)));\n color: var(--u-fab-button-tertiary-text-color, var(--u-color-on-tertiary-container, rgb(49, 17, 29)));\n }\n\n :host([color=branded]),\n :host([color=surface]) {\n background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-high, rgb(236, 230, 240)));\n color: var(--u-fab-button-surface-text-color, var(--_color-primary));\n }\n\n :host([color=branded][lowered]),\n :host([color=surface][lowered]) {\n background-color: var(--u-fab-button-surface-background-color, var(--u-color-surface-container-low, rgb(247, 242, 250)));\n }\n`;\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSResult, HTMLTemplateResult, nothing } from 'lit';
|
|
2
|
+
import '../ripple/ripple.js';
|
|
3
|
+
import { UmButtonBase } from './button-base';
|
|
4
|
+
export type UmIconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';
|
|
5
|
+
export declare class UmIconButton extends UmButtonBase {
|
|
6
|
+
static styles: CSSResult | CSSResult[];
|
|
7
|
+
variant: UmIconButtonVariant;
|
|
8
|
+
/**
|
|
9
|
+
* When true, the button will toggle between selected and unselected
|
|
10
|
+
* states
|
|
11
|
+
*/
|
|
12
|
+
toggle: boolean;
|
|
13
|
+
hasSelectionIcon: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the selected state. When false, displays the default icon. When true,
|
|
16
|
+
* displays the selected icon, or the default icon If no `slot="selected"`
|
|
17
|
+
* icon is provided.
|
|
18
|
+
*/
|
|
19
|
+
selected: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The `aria-label` of the button when the button is toggleable and selected.
|
|
22
|
+
*/
|
|
23
|
+
ariaLabelSelected: string;
|
|
24
|
+
private readonly selectedIcons;
|
|
25
|
+
protected renderContent(): HTMLTemplateResult;
|
|
26
|
+
protected handleClick(_: UIEvent): void;
|
|
27
|
+
getAriaLabel(): string | null | typeof nothing;
|
|
28
|
+
private handleSlotChange;
|
|
29
|
+
}
|
|
30
|
+
declare global {
|
|
31
|
+
interface HTMLElementTagNameMap {
|
|
32
|
+
'u-icon-button': UmIconButton;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAQ,kBAAkB,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGnE,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAI7C,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAE/E,qBACa,YAAa,SAAQ,YAAY;IAE5C,OAAgB,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CAA8B;IAElD,OAAO,EAAE,mBAAmB,CAAc;IAErE;;;OAGG;IACwB,MAAM,UAAS;IAEiC,gBAAgB,UAAS;IAEpG;;;;OAIG;IACuC,QAAQ,UAAS;IAE3D;;OAEG;IAC2C,iBAAiB,SAAM;IAGrE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;cAE5B,aAAa,IAAI,kBAAkB;cAUnC,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI;IAMvC,YAAY,IAAI,MAAM,GAAG,IAAI,GAAG,OAAO,OAAO;IAMvD,OAAO,CAAC,gBAAgB;CAGzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 } from 'lit';
|
|
8
|
+
import { customElement, property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
+
import '../ripple/ripple.js';
|
|
10
|
+
import { UmButtonBase } from './button-base';
|
|
11
|
+
import { styles as buttonBaseStyles } from './button-base.styles';
|
|
12
|
+
import { styles } from './icon-button.styles';
|
|
13
|
+
let UmIconButton = class UmIconButton extends UmButtonBase {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.variant = 'standard';
|
|
17
|
+
/**
|
|
18
|
+
* When true, the button will toggle between selected and unselected
|
|
19
|
+
* states
|
|
20
|
+
*/
|
|
21
|
+
this.toggle = false;
|
|
22
|
+
this.hasSelectionIcon = false;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the selected state. When false, displays the default icon. When true,
|
|
25
|
+
* displays the selected icon, or the default icon If no `slot="selected"`
|
|
26
|
+
* icon is provided.
|
|
27
|
+
*/
|
|
28
|
+
this.selected = false;
|
|
29
|
+
/**
|
|
30
|
+
* The `aria-label` of the button when the button is toggleable and selected.
|
|
31
|
+
*/
|
|
32
|
+
this.ariaLabelSelected = '';
|
|
33
|
+
}
|
|
34
|
+
renderContent() {
|
|
35
|
+
return html `
|
|
36
|
+
<span class="icon" aria-hidden="true"><slot></slot></span>
|
|
37
|
+
<span class="icon icon-selected" aria-hidden="true">
|
|
38
|
+
<slot name="selected" @slotchange="${this.handleSlotChange}"></slot>
|
|
39
|
+
</span>
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
handleClick(_) {
|
|
43
|
+
if (this.toggle) {
|
|
44
|
+
this.selected = !this.selected;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
getAriaLabel() {
|
|
48
|
+
return this.selected
|
|
49
|
+
? this.ariaLabelSelected || super.getAriaLabel()
|
|
50
|
+
: super.getAriaLabel();
|
|
51
|
+
}
|
|
52
|
+
handleSlotChange() {
|
|
53
|
+
this.hasSelectionIcon = this.selectedIcons.length > 0;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
UmIconButton.styles = [buttonBaseStyles, styles];
|
|
57
|
+
__decorate([
|
|
58
|
+
property({ reflect: true })
|
|
59
|
+
], UmIconButton.prototype, "variant", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
property({ type: Boolean })
|
|
62
|
+
], UmIconButton.prototype, "toggle", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
property({ type: Boolean, attribute: 'has-selection-icon', reflect: true })
|
|
65
|
+
], UmIconButton.prototype, "hasSelectionIcon", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property({ type: Boolean, reflect: true })
|
|
68
|
+
], UmIconButton.prototype, "selected", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
property({ attribute: 'aria-label-selected' })
|
|
71
|
+
], UmIconButton.prototype, "ariaLabelSelected", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
queryAssignedElements({ slot: 'selected', flatten: true })
|
|
74
|
+
], UmIconButton.prototype, "selectedIcons", void 0);
|
|
75
|
+
UmIconButton = __decorate([
|
|
76
|
+
customElement('u-icon-button')
|
|
77
|
+
], UmIconButton);
|
|
78
|
+
export { UmIconButton };
|
|
79
|
+
//# sourceMappingURL=icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["../../src/button/icon-button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAa,IAAI,EAA+B,MAAM,KAAK,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAKvC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,YAAY;IAAvC;;QAIsB,YAAO,GAAwB,UAAU,CAAC;QAErE;;;WAGG;QACwB,WAAM,GAAG,KAAK,CAAC;QAEiC,qBAAgB,GAAG,KAAK,CAAC;QAEpG;;;;WAIG;QACuC,aAAQ,GAAG,KAAK,CAAC;QAE3D;;WAEG;QAC2C,sBAAiB,GAAG,EAAE,CAAC;IA8BvE,CAAC;IAzBoB,aAAa;QAE9B,OAAO,IAAI,CAAA;;;6CAG8B,IAAI,CAAC,gBAAgB;;KAE7D,CAAC;IACJ,CAAC;IAEkB,WAAW,CAAC,CAAU;QACvC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;QACjC,CAAC;IACH,CAAC;IAEQ,YAAY;QACnB,OAAO,IAAI,CAAC,QAAQ;YAClB,CAAC,CAAC,IAAI,CAAC,iBAAiB,IAAI,KAAK,CAAC,YAAY,EAAE;YAChD,CAAC,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IAC3B,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IACxD,CAAC;;AAnDe,mBAAM,GAA4B,CAAC,gBAAgB,EAAE,MAAM,CAAC,AAAtD,CAAuD;AAElD;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;6CAA2C;AAM1C;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAgB;AAEiC;IAA1E,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;sDAA0B;AAO1D;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAAkB;AAKb;IAA7C,QAAQ,CAAC,EAAC,SAAS,EAAE,qBAAqB,EAAC,CAAC;uDAAwB;AAGpD;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;mDACV;AA3BpC,YAAY;IADxB,aAAa,CAAC,eAAe,CAAC;GAClB,YAAY,CAsDxB","sourcesContent":["import { CSSResult, html, HTMLTemplateResult, nothing } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\n\nimport '../ripple/ripple.js';\nimport { UmButtonBase } from './button-base';\nimport { styles as buttonBaseStyles } from './button-base.styles';\nimport { styles } from './icon-button.styles';\n\nexport type UmIconButtonVariant = 'standard' | 'filled' | 'tonal' | 'outlined';\n\n@customElement('u-icon-button')\nexport class UmIconButton extends UmButtonBase {\n\n static override styles: CSSResult | CSSResult[] = [buttonBaseStyles, styles];\n\n @property({reflect: true}) variant: UmIconButtonVariant = 'standard';\n\n /**\n * When true, the button will toggle between selected and unselected\n * states\n */\n @property({type: Boolean}) toggle = false;\n\n @property({type: Boolean, attribute: 'has-selection-icon', reflect: true}) hasSelectionIcon = false;\n\n /**\n * Sets the selected state. When false, displays the default icon. When true,\n * displays the selected icon, or the default icon If no `slot=\"selected\"`\n * icon is provided.\n */\n @property({type: Boolean, reflect: true}) selected = false;\n\n /**\n * The `aria-label` of the button when the button is toggleable and selected.\n */\n @property({attribute: 'aria-label-selected'}) ariaLabelSelected = '';\n\n @queryAssignedElements({slot: 'selected', flatten: true})\n private readonly selectedIcons!: HTMLElement[];\n\n protected override renderContent(): HTMLTemplateResult {\n\n return html`\n <span class=\"icon\" aria-hidden=\"true\"><slot></slot></span>\n <span class=\"icon icon-selected\" aria-hidden=\"true\">\n <slot name=\"selected\" @slotchange=\"${this.handleSlotChange}\"></slot>\n </span>\n `;\n }\n\n protected override handleClick(_: UIEvent): void {\n if (this.toggle) {\n this.selected = !this.selected;\n }\n }\n\n override getAriaLabel(): string | null | typeof nothing {\n return this.selected\n ? this.ariaLabelSelected || super.getAriaLabel()\n : super.getAriaLabel();\n }\n\n private handleSlotChange() {\n this.hasSelectionIcon = this.selectedIcons.length > 0;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-icon-button': UmIconButton;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.styles.d.ts","sourceRoot":"","sources":["../../src/button/icon-button.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAmElB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_surface-container-highest-color: var(--u-color-surface-container-highest, rgb(230, 224, 233));
|
|
5
|
+
width: var(--u-icon-button-size, 2.5rem);
|
|
6
|
+
height: var(--u-icon-button-size, 2.5rem);
|
|
7
|
+
border-radius: var(--u-icon-button-shape-corner, 9999px);
|
|
8
|
+
font-family: var(--u-font-family-base, system-ui);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.icon {
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
font-size: var(--u-icon-button-icon-size, 1.5rem);
|
|
16
|
+
line-height: var(--u-icon-button-icon-size, 1.5rem);
|
|
17
|
+
}
|
|
18
|
+
.icon.icon-selected {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host([selected]) .icon:not(.icon-selected) {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
:host([selected]) .icon.icon-selected {
|
|
26
|
+
display: inline-block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([variant=filled]) {
|
|
30
|
+
background-color: var(--u-filled-icon-button-unselected-background-color, var(--_surface-container-highest-color));
|
|
31
|
+
color: var(--u-filled-icon-button-unselected-text-color, var(--_color-primary));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
:host([variant=tonal]) {
|
|
35
|
+
background-color: var(--u-total-icon-button-unselected-background-color, var(--_surface-container-highest-color));
|
|
36
|
+
color: var(--u-tonal-icon-button-unselected-text-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
:host([selected][variant=filled]),
|
|
40
|
+
:host([variant=filled]:not([has-selection-icon])) {
|
|
41
|
+
background-color: var(--u-filled-icon-button-background-color, var(--_color-primary));
|
|
42
|
+
color: var(--u-filled-icon-button-text-color, var(--u-color-on-primary, rgb(255, 255, 255)));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:host([selected][variant=tonal]),
|
|
46
|
+
:host([variant=tonal]:not([has-selection-icon])) {
|
|
47
|
+
background-color: var(--u-tonal-icon-button-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));
|
|
48
|
+
color: var(--u-tonal-icon-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([variant=standard]),
|
|
52
|
+
:host([variant=outlined]) {
|
|
53
|
+
color: var(--u-color-on-surface-variant, rgb(73, 69, 79));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host([variant=outlined]) {
|
|
57
|
+
border: 1px solid var(--u-color-outline, rgb(121, 116, 126));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([selected][variant=outlined]) {
|
|
61
|
+
border: none;
|
|
62
|
+
background-color: var(--u-outlined-icon-button-selected-background-color, var(--u-color-inverse-surface, rgb(50, 47, 53)));
|
|
63
|
+
color: var(--u-outlined-icon-button-selected-text-color, var(--u-color-inverse-on-surface, rgb(245, 239, 247)));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([selected][variant=standard]) {
|
|
67
|
+
color: var(--u-standard-icon-button-selected-text-color, var(--_color-primary));
|
|
68
|
+
}
|
|
69
|
+
`;
|
|
70
|
+
//# sourceMappingURL=icon-button.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.styles.js","sourceRoot":"","sources":["../../src/button/icon-button.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n --_surface-container-highest-color: var(--u-color-surface-container-highest, rgb(230, 224, 233));\n width: var(--u-icon-button-size, 2.5rem);\n height: var(--u-icon-button-size, 2.5rem);\n border-radius: var(--u-icon-button-shape-corner, 9999px);\n font-family: var(--u-font-family-base, system-ui);\n }\n\n .icon {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: var(--u-icon-button-icon-size, 1.5rem);\n line-height: var(--u-icon-button-icon-size, 1.5rem);\n }\n .icon.icon-selected {\n display: none;\n }\n\n :host([selected]) .icon:not(.icon-selected) {\n display: none;\n }\n :host([selected]) .icon.icon-selected {\n display: inline-block;\n }\n\n :host([variant=filled]) {\n background-color: var(--u-filled-icon-button-unselected-background-color, var(--_surface-container-highest-color));\n color: var(--u-filled-icon-button-unselected-text-color, var(--_color-primary));\n }\n\n :host([variant=tonal]) {\n background-color: var(--u-total-icon-button-unselected-background-color, var(--_surface-container-highest-color));\n color: var(--u-tonal-icon-button-unselected-text-color, var(--u-color-on-surface-variant, rgb(73, 69, 79)));\n }\n\n :host([selected][variant=filled]),\n :host([variant=filled]:not([has-selection-icon])) {\n background-color: var(--u-filled-icon-button-background-color, var(--_color-primary));\n color: var(--u-filled-icon-button-text-color, var(--u-color-on-primary, rgb(255, 255, 255)));\n }\n\n :host([selected][variant=tonal]),\n :host([variant=tonal]:not([has-selection-icon])) {\n background-color: var(--u-tonal-icon-button-background-color, var(--u-color-secondary-container, rgb(232, 222, 248)));\n color: var(--u-tonal-icon-button-text-color, var(--u-color-on-secondary-container, rgb(29, 25, 43)));\n }\n\n :host([variant=standard]),\n :host([variant=outlined]) {\n color: var(--u-color-on-surface-variant, rgb(73, 69, 79));\n }\n\n :host([variant=outlined]) {\n border: 1px solid var(--u-color-outline, rgb(121, 116, 126));\n }\n\n :host([selected][variant=outlined]) {\n border: none;\n background-color: var(--u-outlined-icon-button-selected-background-color, var(--u-color-inverse-surface, rgb(50, 47, 53)));\n color: var(--u-outlined-icon-button-selected-text-color, var(--u-color-inverse-on-surface, rgb(245, 239, 247)));\n }\n\n :host([selected][variant=standard]) {\n color: var(--u-standard-icon-button-selected-text-color, var(--_color-primary));\n }\n`;\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
export declare class UmCardContent extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
hasContent: boolean;
|
|
5
|
+
render(): HTMLTemplateResult;
|
|
6
|
+
private handleSlotChange;
|
|
7
|
+
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'u-card-content': UmCardContent;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=card-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-content.d.ts","sourceRoot":"","sources":["../../src/card/card-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAM3D,qBACa,aAAc,SAAQ,UAAU;IAE3C,OAAgB,MAAM,4BAAwB;IAEsB,UAAU,UAAS;IAE9E,MAAM,IAAI,kBAAkB;IAKrC,OAAO,CAAC,gBAAgB;CAoBzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { LitElement, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { styles as baseStyles } from '../shared/base.styles';
|
|
10
|
+
import { styles } from './card-content.styles';
|
|
11
|
+
let UmCardContent = class UmCardContent extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.hasContent = false;
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<slot @slotchange="${this.handleSlotChange}"></slot>`;
|
|
19
|
+
}
|
|
20
|
+
handleSlotChange(e) {
|
|
21
|
+
const slot = e.target;
|
|
22
|
+
this.hasContent = slot.assignedElements({ flatten: true }).length > 0;
|
|
23
|
+
if (this.hasContent) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const nodes = slot.assignedNodes({ flatten: true });
|
|
27
|
+
for (const node of nodes) {
|
|
28
|
+
if (node.nodeValue?.trim()) {
|
|
29
|
+
this.hasContent = true;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
this.hasContent = false;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
UmCardContent.styles = [baseStyles, styles];
|
|
37
|
+
__decorate([
|
|
38
|
+
property({ type: Boolean, attribute: 'has-content', reflect: true })
|
|
39
|
+
], UmCardContent.prototype, "hasContent", void 0);
|
|
40
|
+
UmCardContent = __decorate([
|
|
41
|
+
customElement('u-card-content')
|
|
42
|
+
], UmCardContent);
|
|
43
|
+
export { UmCardContent };
|
|
44
|
+
//# sourceMappingURL=card-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-content.js","sourceRoot":"","sources":["../../src/card/card-content.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAsB,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAAtC;;QAI+D,eAAU,GAAG,KAAK,CAAC;IA2BzF,CAAC;IAzBU,MAAM;QACb,OAAO,IAAI,CAAA;2BACY,IAAI,CAAC,gBAAgB,WAAW,CAAC;IAC1D,CAAC;IAEO,gBAAgB,CAAC,CAAQ;QAC/B,MAAM,IAAI,GAAoB,CAAC,CAAC,MAAM,CAAC;QAEvC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAEpE,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QAElD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;gBAC3B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;gBACvB,OAAO;YACT,CAAC;QACH,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;;AA5Be,oBAAM,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,AAAvB,CAAwB;AAEsB;IAAnE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;iDAAoB;AAJ5E,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CA+BzB","sourcesContent":["import { HTMLTemplateResult, LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles as baseStyles } from '../shared/base.styles';\nimport { styles } from './card-content.styles';\n\n@customElement('u-card-content')\nexport class UmCardContent extends LitElement {\n\n static override styles = [baseStyles, styles];\n\n @property({type: Boolean, attribute: 'has-content', reflect: true}) hasContent = false;\n\n override render(): HTMLTemplateResult {\n return html`\n <slot @slotchange=\"${this.handleSlotChange}\"></slot>`;\n }\n\n private handleSlotChange(e: Event) {\n const slot = <HTMLSlotElement>e.target;\n\n this.hasContent = slot.assignedElements({flatten: true}).length > 0;\n\n if (this.hasContent) {\n return;\n }\n\n const nodes = slot.assignedNodes({flatten: true});\n\n for (const node of nodes) {\n if (node.nodeValue?.trim()) {\n this.hasContent = true;\n return;\n }\n }\n\n this.hasContent = false;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-card-content': UmCardContent;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-content.styles.d.ts","sourceRoot":"","sources":["../../src/card/card-content.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAYlB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
:host(:has(slot > *)) {
|
|
8
|
+
display: none;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:host([has-content]) {
|
|
12
|
+
padding: var(--u-card-padding, 16px);
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
//# sourceMappingURL=card-content.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-content.styles.js","sourceRoot":"","sources":["../../src/card/card-content.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;;;CAYzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: block;\n }\n\n :host(:has(slot > *)) {\n display: none;\n }\n\n :host([has-content]) {\n padding: var(--u-card-padding, 16px);\n }\n`;\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
export declare class UmCardMedia extends LitElement {
|
|
3
|
+
static styles: import("lit").CSSResult[];
|
|
4
|
+
wide: boolean;
|
|
5
|
+
render(): HTMLTemplateResult;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'u-card-media': UmCardMedia;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=card-media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-media.d.ts","sourceRoot":"","sources":["../../src/card/card-media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAM3D,qBACa,WAAY,SAAQ,UAAU;IAEzC,OAAgB,MAAM,4BAAwB;IAEJ,IAAI,UAAS;IAE9C,MAAM,IAAI,kBAAkB;CAItC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { LitElement, html } from 'lit';
|
|
8
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
+
import { styles as baseStyles } from '../shared/base.styles';
|
|
10
|
+
import { styles } from './card-media.styles';
|
|
11
|
+
let UmCardMedia = class UmCardMedia extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.wide = false;
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<slot></slot>`;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
UmCardMedia.styles = [baseStyles, styles];
|
|
22
|
+
__decorate([
|
|
23
|
+
property({ type: Boolean, reflect: true })
|
|
24
|
+
], UmCardMedia.prototype, "wide", void 0);
|
|
25
|
+
UmCardMedia = __decorate([
|
|
26
|
+
customElement('u-card-media')
|
|
27
|
+
], UmCardMedia);
|
|
28
|
+
export { UmCardMedia };
|
|
29
|
+
//# sourceMappingURL=card-media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-media.js","sourceRoot":"","sources":["../../src/card/card-media.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAsB,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGtC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAIqC,SAAI,GAAG,KAAK,CAAC;IAMzD,CAAC;IAJU,MAAM;QACb,OAAO,IAAI,CAAA;oBACK,CAAC;IACnB,CAAC;;AAPe,kBAAM,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,AAAvB,CAAwB;AAEJ;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAc;AAJ5C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAUvB","sourcesContent":["import { HTMLTemplateResult, LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { styles as baseStyles } from '../shared/base.styles';\nimport { styles } from './card-media.styles';\n\n@customElement('u-card-media')\nexport class UmCardMedia extends LitElement {\n\n static override styles = [baseStyles, styles];\n\n @property({type: Boolean, reflect: true}) wide = false;\n\n override render(): HTMLTemplateResult {\n return html`\n <slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'u-card-media': UmCardMedia;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-media.styles.d.ts","sourceRoot":"","sources":["../../src/card/card-media.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBAUlB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
aspect-ratio: 1;
|
|
6
|
+
border-radius: var(--u-card-shape-corner, var(--u-shape-corner-medium, 12px));
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([wide]) {
|
|
10
|
+
aspect-ratio: 16/9;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
//# sourceMappingURL=card-media.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-media.styles.js","sourceRoot":"","sources":["../../src/card/card-media.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAC;;;;;;;;;;CAUzB,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css `\n :host {\n display: block;\n aspect-ratio: 1;\n border-radius: var(--u-card-shape-corner, var(--u-shape-corner-medium, 12px));\n }\n\n :host([wide]) {\n aspect-ratio: 16/9;\n }\n`;\n"]}
|
package/card/card.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLTemplateResult, LitElement } from 'lit';
|
|
2
|
+
import './card-content.js';
|
|
3
|
+
import './card-media.js';
|
|
4
|
+
import '../elevation/elevation.js';
|
|
5
|
+
export type UmCardVariant = 'filled' | 'elevated' | 'outlined';
|
|
6
|
+
export declare class UmCard extends LitElement {
|
|
7
|
+
static styles: import("lit").CSSResult[];
|
|
8
|
+
/**
|
|
9
|
+
* The Card variant to render.
|
|
10
|
+
*/
|
|
11
|
+
variant: UmCardVariant;
|
|
12
|
+
render(): HTMLTemplateResult;
|
|
13
|
+
}
|
|
14
|
+
declare global {
|
|
15
|
+
interface HTMLElementTagNameMap {
|
|
16
|
+
'u-card': UmCard;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/card/card.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAK3D,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,2BAA2B,CAAC;AAEnC,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAE/D,qBACa,MAAO,SAAQ,UAAU;IAEpC,OAAgB,MAAM,4BAAwB;IAE9C;;OAEG;IACwB,OAAO,EAAE,aAAa,CAAc;IAEtD,MAAM,IAAI,kBAAkB;CAStC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF"}
|