@francofantomius/material-components 0.1.0
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/LICENSE +22 -0
- package/README.md +192 -0
- package/custom-elements.json +5448 -0
- package/dist/chunks/base-component-DQTjlEVL.js +34 -0
- package/dist/chunks/base-component-DQTjlEVL.js.map +1 -0
- package/dist/chunks/focus-ring-Dl-XoEKK.js +71 -0
- package/dist/chunks/focus-ring-Dl-XoEKK.js.map +1 -0
- package/dist/chunks/form-associated-fKbeX_2P.js +74 -0
- package/dist/chunks/form-associated-fKbeX_2P.js.map +1 -0
- package/dist/chunks/theme.css-DV3DRha-.js +263 -0
- package/dist/chunks/theme.css-DV3DRha-.js.map +1 -0
- package/dist/components/badge/badge.css.d.ts +2 -0
- package/dist/components/badge/badge.css.d.ts.map +1 -0
- package/dist/components/badge/badge.d.ts +16 -0
- package/dist/components/badge/badge.d.ts.map +1 -0
- package/dist/components/badge/badge.js +93 -0
- package/dist/components/badge/badge.js.map +1 -0
- package/dist/components/button/button.css.d.ts +2 -0
- package/dist/components/button/button.css.d.ts.map +1 -0
- package/dist/components/button/button.d.ts +25 -0
- package/dist/components/button/button.d.ts.map +1 -0
- package/dist/components/button/button.js +263 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/card/card.css.d.ts +2 -0
- package/dist/components/card/card.css.d.ts.map +1 -0
- package/dist/components/card/card.d.ts +18 -0
- package/dist/components/card/card.d.ts.map +1 -0
- package/dist/components/card/card.js +169 -0
- package/dist/components/card/card.js.map +1 -0
- package/dist/components/checkbox/checkbox.css.d.ts +2 -0
- package/dist/components/checkbox/checkbox.css.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.d.ts +24 -0
- package/dist/components/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox/checkbox.js +188 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/chip/chip.css.d.ts +3 -0
- package/dist/components/chip/chip.css.d.ts.map +1 -0
- package/dist/components/chip/chip.d.ts +27 -0
- package/dist/components/chip/chip.d.ts.map +1 -0
- package/dist/components/chip/chip.js +174 -0
- package/dist/components/chip/chip.js.map +1 -0
- package/dist/components/dialog/dialog.css.d.ts +2 -0
- package/dist/components/dialog/dialog.css.d.ts.map +1 -0
- package/dist/components/dialog/dialog.d.ts +22 -0
- package/dist/components/dialog/dialog.d.ts.map +1 -0
- package/dist/components/dialog/dialog.js +167 -0
- package/dist/components/dialog/dialog.js.map +1 -0
- package/dist/components/divider/divider.css.d.ts +2 -0
- package/dist/components/divider/divider.css.d.ts.map +1 -0
- package/dist/components/divider/divider.d.ts +16 -0
- package/dist/components/divider/divider.d.ts.map +1 -0
- package/dist/components/divider/divider.js +81 -0
- package/dist/components/divider/divider.js.map +1 -0
- package/dist/components/fab/fab.css.d.ts +2 -0
- package/dist/components/fab/fab.css.d.ts.map +1 -0
- package/dist/components/fab/fab.d.ts +19 -0
- package/dist/components/fab/fab.d.ts.map +1 -0
- package/dist/components/fab/fab.js +155 -0
- package/dist/components/fab/fab.js.map +1 -0
- package/dist/components/icon/icon.css.d.ts +2 -0
- package/dist/components/icon/icon.css.d.ts.map +1 -0
- package/dist/components/icon/icon.d.ts +15 -0
- package/dist/components/icon/icon.d.ts.map +1 -0
- package/dist/components/icon/icon.js +70 -0
- package/dist/components/icon/icon.js.map +1 -0
- package/dist/components/icon-button/icon-button.css.d.ts +2 -0
- package/dist/components/icon-button/icon-button.css.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.d.ts +22 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -0
- package/dist/components/icon-button/icon-button.js +192 -0
- package/dist/components/icon-button/icon-button.js.map +1 -0
- package/dist/components/list/list.css.d.ts +3 -0
- package/dist/components/list/list.css.d.ts.map +1 -0
- package/dist/components/list/list.d.ts +25 -0
- package/dist/components/list/list.d.ts.map +1 -0
- package/dist/components/list/list.js +190 -0
- package/dist/components/list/list.js.map +1 -0
- package/dist/components/progress/progress.css.d.ts +2 -0
- package/dist/components/progress/progress.css.d.ts.map +1 -0
- package/dist/components/progress/progress.d.ts +19 -0
- package/dist/components/progress/progress.d.ts.map +1 -0
- package/dist/components/progress/progress.js +183 -0
- package/dist/components/progress/progress.js.map +1 -0
- package/dist/components/radio/radio.css.d.ts +3 -0
- package/dist/components/radio/radio.css.d.ts.map +1 -0
- package/dist/components/radio/radio.d.ts +38 -0
- package/dist/components/radio/radio.d.ts.map +1 -0
- package/dist/components/radio/radio.js +205 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/snackbar/snackbar.css.d.ts +2 -0
- package/dist/components/snackbar/snackbar.css.d.ts.map +1 -0
- package/dist/components/snackbar/snackbar.d.ts +24 -0
- package/dist/components/snackbar/snackbar.d.ts.map +1 -0
- package/dist/components/snackbar/snackbar.js +164 -0
- package/dist/components/snackbar/snackbar.js.map +1 -0
- package/dist/components/switch/switch.css.d.ts +2 -0
- package/dist/components/switch/switch.css.d.ts.map +1 -0
- package/dist/components/switch/switch.d.ts +22 -0
- package/dist/components/switch/switch.d.ts.map +1 -0
- package/dist/components/switch/switch.js +171 -0
- package/dist/components/switch/switch.js.map +1 -0
- package/dist/components/tabs/tabs.css.d.ts +3 -0
- package/dist/components/tabs/tabs.css.d.ts.map +1 -0
- package/dist/components/tabs/tabs.d.ts +33 -0
- package/dist/components/tabs/tabs.d.ts.map +1 -0
- package/dist/components/tabs/tabs.js +200 -0
- package/dist/components/tabs/tabs.js.map +1 -0
- package/dist/components/text-field/text-field.css.d.ts +2 -0
- package/dist/components/text-field/text-field.css.d.ts.map +1 -0
- package/dist/components/text-field/text-field.d.ts +40 -0
- package/dist/components/text-field/text-field.d.ts.map +1 -0
- package/dist/components/text-field/text-field.js +327 -0
- package/dist/components/text-field/text-field.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/base-component.d.ts +13 -0
- package/dist/internal/base-component.d.ts.map +1 -0
- package/dist/internal/focus-ring/focus-ring.css.d.ts +2 -0
- package/dist/internal/focus-ring/focus-ring.css.d.ts.map +1 -0
- package/dist/internal/focus-ring/focus-ring.d.ts +18 -0
- package/dist/internal/focus-ring/focus-ring.d.ts.map +1 -0
- package/dist/internal/form-associated.d.ts +26 -0
- package/dist/internal/form-associated.d.ts.map +1 -0
- package/dist/internal/ripple/ripple.css.d.ts +2 -0
- package/dist/internal/ripple/ripple.css.d.ts.map +1 -0
- package/dist/internal/ripple/ripple.d.ts +26 -0
- package/dist/internal/ripple/ripple.d.ts.map +1 -0
- package/dist/internal/ripple/ripple.js +144 -0
- package/dist/internal/ripple/ripple.js.map +1 -0
- package/dist/tokens/colors.d.ts +42 -0
- package/dist/tokens/colors.d.ts.map +1 -0
- package/dist/tokens/elevation.d.ts +9 -0
- package/dist/tokens/elevation.d.ts.map +1 -0
- package/dist/tokens/index.d.ts +7 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/index.js +13 -0
- package/dist/tokens/index.js.map +1 -0
- package/dist/tokens/motion.d.ts +21 -0
- package/dist/tokens/motion.d.ts.map +1 -0
- package/dist/tokens/shape.d.ts +10 -0
- package/dist/tokens/shape.d.ts.map +1 -0
- package/dist/tokens/theme.css.d.ts +4 -0
- package/dist/tokens/theme.css.d.ts.map +1 -0
- package/dist/tokens/typography.d.ts +101 -0
- package/dist/tokens/typography.d.ts.map +1 -0
- package/package.json +133 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../src/components/badge/badge.css.ts","../../../src/components/badge/badge.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const badgeStyles = css`\n :host {\n display: inline-flex;\n position: relative;\n vertical-align: middle;\n }\n\n .badge {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background-color: var(--md-sys-color-error, #B3261E);\n color: var(--md-sys-color-on-error, #FFFFFF);\n font-family: var(--md-sys-typescale-font-family, inherit);\n font-weight: 500;\n line-height: 1;\n white-space: nowrap;\n user-select: none;\n border-radius: var(--md-sys-shape-corner-full, 9999px);\n transition: transform 150ms cubic-bezier(0.2, 0, 0, 1),\n opacity 150ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n /* Small Dot Badge */\n :host(:not([value])) .badge,\n :host([dot]) .badge {\n width: 6px;\n height: 6px;\n padding: 0;\n }\n\n /* Large Badge with text */\n :host([value]:not([dot])) .badge {\n min-width: 16px;\n height: 16px;\n padding: 0 4px;\n font-size: 11px;\n letter-spacing: 0.5px;\n }\n\n /* Anchored Positioning over slotted element */\n :host([anchored]) .badge {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n z-index: 10;\n }\n`;\n\n","import { html, nothing } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\nimport { MdBaseElement } from '../../internal/base-component.js';\nimport { badgeStyles } from './badge.css.js';\n\n@customElement('md-badge')\nexport class MdBadge extends MdBaseElement {\n static override styles = [MdBaseElement.styles, badgeStyles];\n\n @property({ type: String, reflect: true })\n value = '';\n\n @property({ type: Boolean, reflect: true })\n dot = false;\n\n @property({ type: Boolean, reflect: true })\n anchored = false;\n\n @queryAssignedElements()\n private assignedChildren!: HTMLElement[];\n\n private handleSlotChange = () => {\n this.anchored = this.assignedChildren.length > 0;\n };\n\n override render() {\n return html`\n <slot @slotchange=${this.handleSlotChange}></slot>\n <span class=\"badge\">\n ${!this.dot && this.value ? this.value : nothing}\n </span>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-badge': MdBadge;\n }\n}\n\n"],"names":["badgeStyles","css","MdBadge","MdBaseElement","html","nothing","__decorateClass","property","queryAssignedElements","customElement"],"mappings":";;;AAEO,MAAMA,IAAcC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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import { MdBaseElement } from '../../internal/base-component.js';
|
|
2
|
+
export type ButtonVariant = 'filled' | 'elevated' | 'tonal' | 'outlined' | 'text';
|
|
3
|
+
export declare class MdButton extends MdBaseElement {
|
|
4
|
+
static styles: import('lit').CSSResultGroup[];
|
|
5
|
+
variant: ButtonVariant;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
type: 'button' | 'submit' | 'reset';
|
|
9
|
+
href: string;
|
|
10
|
+
target: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
trailingIcon: string;
|
|
13
|
+
private assignedIcons;
|
|
14
|
+
private assignedTrailingIcons;
|
|
15
|
+
private handleClick;
|
|
16
|
+
private handleSlotChange;
|
|
17
|
+
firstUpdated(): void;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'md-button': MdButton;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/button/button.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,iCAAiC,CAAC;AACzC,OAAO,yCAAyC,CAAC;AACjD,OAAO,iBAAiB,CAAC;AAGzB,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAElF,qBACa,QAAS,SAAQ,aAAa;IACzC,OAAgB,MAAM,iCAAwC;IAG9D,OAAO,EAAE,aAAa,CAAY;IAGlC,QAAQ,UAAS;IAGjB,OAAO,UAAS;IAGhB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAY;IAG/C,IAAI,SAAM;IAGV,MAAM,SAAM;IAGZ,IAAI,SAAM;IAGV,YAAY,SAAM;IAGlB,OAAO,CAAC,aAAa,CAAiB;IAGtC,OAAO,CAAC,qBAAqB,CAAiB;IAE9C,OAAO,CAAC,WAAW,CAiBjB;IAEF,OAAO,CAAC,gBAAgB;IAQf,YAAY;IAIZ,MAAM;CA+ChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { css as g, nothing as s, html as a } from "lit";
|
|
2
|
+
import { property as n, queryAssignedElements as p, customElement as v } from "lit/decorators.js";
|
|
3
|
+
import { M as b } from "../../chunks/base-component-DQTjlEVL.js";
|
|
4
|
+
import "../../internal/ripple/ripple.js";
|
|
5
|
+
import "../../chunks/focus-ring-Dl-XoEKK.js";
|
|
6
|
+
import "../icon/icon.js";
|
|
7
|
+
const u = g`
|
|
8
|
+
:host {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
outline: none;
|
|
11
|
+
vertical-align: middle;
|
|
12
|
+
-webkit-tap-highlight-color: transparent;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
:host([disabled]) {
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
button, a {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
min-width: 64px;
|
|
26
|
+
height: 40px;
|
|
27
|
+
padding: 0 24px;
|
|
28
|
+
border: none;
|
|
29
|
+
border-radius: var(--md-sys-shape-corner-full, 9999px);
|
|
30
|
+
font-family: var(--md-sys-typescale-font-family, inherit);
|
|
31
|
+
font-size: var(--md-sys-typescale-label-large-size, 14px);
|
|
32
|
+
font-weight: 500;
|
|
33
|
+
line-height: 20px;
|
|
34
|
+
letter-spacing: 0.1px;
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
text-align: center;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
user-select: none;
|
|
39
|
+
outline: none;
|
|
40
|
+
transition: box-shadow 200ms cubic-bezier(0.2, 0, 0, 1),
|
|
41
|
+
background-color 200ms cubic-bezier(0.2, 0, 0, 1),
|
|
42
|
+
color 200ms cubic-bezier(0.2, 0, 0, 1);
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host([has-icon]) button,
|
|
47
|
+
:host([has-icon]) a {
|
|
48
|
+
padding-left: 16px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([has-trailing-icon]) button,
|
|
52
|
+
:host([has-trailing-icon]) a {
|
|
53
|
+
padding-right: 16px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* --- Filled (Default) --- */
|
|
57
|
+
:host(:not([variant])) button,
|
|
58
|
+
:host(:not([variant])) a,
|
|
59
|
+
:host([variant="filled"]) button,
|
|
60
|
+
:host([variant="filled"]) a {
|
|
61
|
+
background-color: var(--md-sys-color-primary, #6750a4);
|
|
62
|
+
color: var(--md-sys-color-on-primary, #ffffff);
|
|
63
|
+
box-shadow: var(--md-sys-elevation-level0, none);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([variant="filled"]:hover) button,
|
|
67
|
+
:host([variant="filled"]:hover) a,
|
|
68
|
+
:host(:not([variant]):hover) button,
|
|
69
|
+
:host(:not([variant]):hover) a {
|
|
70
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* --- Elevated --- */
|
|
74
|
+
:host([variant="elevated"]) button,
|
|
75
|
+
:host([variant="elevated"]) a {
|
|
76
|
+
background-color: var(--md-sys-color-surface-container-low, #f7f2fa);
|
|
77
|
+
color: var(--md-sys-color-primary, #6750a4);
|
|
78
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([variant="elevated"]:hover) button,
|
|
82
|
+
:host([variant="elevated"]:hover) a {
|
|
83
|
+
box-shadow: var(--md-sys-elevation-level2, 0px 2px 6px 2px rgba(0,0,0,0.15));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* --- Filled Tonal --- */
|
|
87
|
+
:host([variant="tonal"]) button,
|
|
88
|
+
:host([variant="tonal"]) a {
|
|
89
|
+
background-color: var(--md-sys-color-secondary-container, #e8def8);
|
|
90
|
+
color: var(--md-sys-color-on-secondary-container, #1d192b);
|
|
91
|
+
box-shadow: var(--md-sys-elevation-level0, none);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([variant="tonal"]:hover) button,
|
|
95
|
+
:host([variant="tonal"]:hover) a {
|
|
96
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/* --- Outlined --- */
|
|
100
|
+
:host([variant="outlined"]) button,
|
|
101
|
+
:host([variant="outlined"]) a {
|
|
102
|
+
background-color: transparent;
|
|
103
|
+
color: var(--md-sys-color-primary, #6750a4);
|
|
104
|
+
border: 1px solid var(--md-sys-color-outline, #79747e);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* --- Text --- */
|
|
108
|
+
:host([variant="text"]) button,
|
|
109
|
+
:host([variant="text"]) a {
|
|
110
|
+
background-color: transparent;
|
|
111
|
+
color: var(--md-sys-color-primary, #6750a4);
|
|
112
|
+
padding: 0 12px;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* --- Disabled --- */
|
|
116
|
+
:host([disabled]) button,
|
|
117
|
+
:host([disabled]) a {
|
|
118
|
+
cursor: not-allowed;
|
|
119
|
+
box-shadow: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([disabled]:not([variant="outlined"]):not([variant="text"])) button,
|
|
123
|
+
:host([disabled]:not([variant="outlined"]):not([variant="text"])) a {
|
|
124
|
+
background-color: rgba(29, 27, 32, 0.12);
|
|
125
|
+
color: rgba(29, 27, 32, 0.38);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
:host([disabled][variant="outlined"]) button,
|
|
129
|
+
:host([disabled][variant="outlined"]) a {
|
|
130
|
+
border-color: rgba(29, 27, 32, 0.12);
|
|
131
|
+
color: rgba(29, 27, 32, 0.38);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
:host([disabled][variant="text"]) button,
|
|
135
|
+
:host([disabled][variant="text"]) a {
|
|
136
|
+
color: rgba(29, 27, 32, 0.38);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.content {
|
|
140
|
+
display: inline-flex;
|
|
141
|
+
align-items: center;
|
|
142
|
+
gap: 8px;
|
|
143
|
+
position: relative;
|
|
144
|
+
z-index: 1;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.spinner {
|
|
148
|
+
width: 18px;
|
|
149
|
+
height: 18px;
|
|
150
|
+
border: 2px solid currentColor;
|
|
151
|
+
border-top-color: transparent;
|
|
152
|
+
border-radius: 50%;
|
|
153
|
+
animation: md-spin 800ms linear infinite;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@keyframes md-spin {
|
|
157
|
+
to {
|
|
158
|
+
transform: rotate(360deg);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
var m = Object.defineProperty, y = Object.getOwnPropertyDescriptor, o = (e, i, d, l) => {
|
|
163
|
+
for (var r = l > 1 ? void 0 : l ? y(i, d) : i, h = e.length - 1, c; h >= 0; h--)
|
|
164
|
+
(c = e[h]) && (r = (l ? c(i, d, r) : c(r)) || r);
|
|
165
|
+
return l && r && m(i, d, r), r;
|
|
166
|
+
};
|
|
167
|
+
let t = class extends b {
|
|
168
|
+
constructor() {
|
|
169
|
+
super(...arguments), this.variant = "filled", this.disabled = !1, this.loading = !1, this.type = "button", this.href = "", this.target = "", this.icon = "", this.trailingIcon = "", this.handleClick = (e) => {
|
|
170
|
+
if (this.disabled || this.loading) {
|
|
171
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (this.type === "submit" || this.type === "reset") {
|
|
175
|
+
const i = this.closest("form");
|
|
176
|
+
i && (this.type === "submit" ? i.requestSubmit() : i.reset());
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
handleSlotChange() {
|
|
181
|
+
const e = !!(this.icon || this.assignedIcons && this.assignedIcons.length > 0), i = !!(this.trailingIcon || this.assignedTrailingIcons && this.assignedTrailingIcons.length > 0);
|
|
182
|
+
this.toggleAttribute("has-icon", e), this.toggleAttribute("has-trailing-icon", i);
|
|
183
|
+
}
|
|
184
|
+
firstUpdated() {
|
|
185
|
+
this.handleSlotChange();
|
|
186
|
+
}
|
|
187
|
+
render() {
|
|
188
|
+
const e = a`
|
|
189
|
+
<md-ripple ?disabled=${this.disabled || this.loading}></md-ripple>
|
|
190
|
+
<md-focus-ring></md-focus-ring>
|
|
191
|
+
<span class="content">
|
|
192
|
+
${this.loading ? a`<span class="spinner" aria-hidden="true"></span>` : a`
|
|
193
|
+
<slot name="icon" @slotchange=${this.handleSlotChange}>
|
|
194
|
+
${this.icon ? a`<md-icon name=${this.icon}></md-icon>` : s}
|
|
195
|
+
</slot>
|
|
196
|
+
`}
|
|
197
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
198
|
+
${this.loading ? s : a`
|
|
199
|
+
<slot name="trailing-icon" @slotchange=${this.handleSlotChange}>
|
|
200
|
+
${this.trailingIcon ? a`<md-icon name=${this.trailingIcon}></md-icon>` : s}
|
|
201
|
+
</slot>
|
|
202
|
+
`}
|
|
203
|
+
</span>
|
|
204
|
+
`;
|
|
205
|
+
return this.href ? a`
|
|
206
|
+
<a
|
|
207
|
+
href=${this.disabled ? s : this.href}
|
|
208
|
+
target=${this.target || s}
|
|
209
|
+
aria-disabled=${this.disabled ? "true" : s}
|
|
210
|
+
tabindex=${this.disabled ? "-1" : "0"}
|
|
211
|
+
@click=${this.handleClick}
|
|
212
|
+
>
|
|
213
|
+
${e}
|
|
214
|
+
</a>
|
|
215
|
+
` : a`
|
|
216
|
+
<button
|
|
217
|
+
type=${this.type}
|
|
218
|
+
?disabled=${this.disabled || this.loading}
|
|
219
|
+
@click=${this.handleClick}
|
|
220
|
+
>
|
|
221
|
+
${e}
|
|
222
|
+
</button>
|
|
223
|
+
`;
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
t.styles = [b.styles, u];
|
|
227
|
+
o([
|
|
228
|
+
n({ type: String, reflect: !0 })
|
|
229
|
+
], t.prototype, "variant", 2);
|
|
230
|
+
o([
|
|
231
|
+
n({ type: Boolean, reflect: !0 })
|
|
232
|
+
], t.prototype, "disabled", 2);
|
|
233
|
+
o([
|
|
234
|
+
n({ type: Boolean, reflect: !0 })
|
|
235
|
+
], t.prototype, "loading", 2);
|
|
236
|
+
o([
|
|
237
|
+
n({ type: String })
|
|
238
|
+
], t.prototype, "type", 2);
|
|
239
|
+
o([
|
|
240
|
+
n({ type: String })
|
|
241
|
+
], t.prototype, "href", 2);
|
|
242
|
+
o([
|
|
243
|
+
n({ type: String })
|
|
244
|
+
], t.prototype, "target", 2);
|
|
245
|
+
o([
|
|
246
|
+
n({ type: String })
|
|
247
|
+
], t.prototype, "icon", 2);
|
|
248
|
+
o([
|
|
249
|
+
n({ type: String, attribute: "trailing-icon" })
|
|
250
|
+
], t.prototype, "trailingIcon", 2);
|
|
251
|
+
o([
|
|
252
|
+
p({ slot: "icon" })
|
|
253
|
+
], t.prototype, "assignedIcons", 2);
|
|
254
|
+
o([
|
|
255
|
+
p({ slot: "trailing-icon" })
|
|
256
|
+
], t.prototype, "assignedTrailingIcons", 2);
|
|
257
|
+
t = o([
|
|
258
|
+
v("md-button")
|
|
259
|
+
], t);
|
|
260
|
+
export {
|
|
261
|
+
t as MdButton
|
|
262
|
+
};
|
|
263
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../src/components/button/button.css.ts","../../../src/components/button/button.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const buttonStyles = css`\n :host {\n display: inline-flex;\n outline: none;\n vertical-align: middle;\n -webkit-tap-highlight-color: transparent;\n }\n\n :host([disabled]) {\n pointer-events: none;\n }\n\n button, a {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n min-width: 64px;\n height: 40px;\n padding: 0 24px;\n border: none;\n border-radius: var(--md-sys-shape-corner-full, 9999px);\n font-family: var(--md-sys-typescale-font-family, inherit);\n font-size: var(--md-sys-typescale-label-large-size, 14px);\n font-weight: 500;\n line-height: 20px;\n letter-spacing: 0.1px;\n text-decoration: none;\n text-align: center;\n cursor: pointer;\n user-select: none;\n outline: none;\n transition: box-shadow 200ms cubic-bezier(0.2, 0, 0, 1),\n background-color 200ms cubic-bezier(0.2, 0, 0, 1),\n color 200ms cubic-bezier(0.2, 0, 0, 1);\n overflow: hidden;\n }\n\n :host([has-icon]) button,\n :host([has-icon]) a {\n padding-left: 16px;\n }\n\n :host([has-trailing-icon]) button,\n :host([has-trailing-icon]) a {\n padding-right: 16px;\n }\n\n /* --- Filled (Default) --- */\n :host(:not([variant])) button,\n :host(:not([variant])) a,\n :host([variant=\"filled\"]) button,\n :host([variant=\"filled\"]) a {\n background-color: var(--md-sys-color-primary, #6750a4);\n color: var(--md-sys-color-on-primary, #ffffff);\n box-shadow: var(--md-sys-elevation-level0, none);\n }\n\n :host([variant=\"filled\"]:hover) button,\n :host([variant=\"filled\"]:hover) a,\n :host(:not([variant]):hover) button,\n :host(:not([variant]):hover) a {\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));\n }\n\n /* --- Elevated --- */\n :host([variant=\"elevated\"]) button,\n :host([variant=\"elevated\"]) a {\n background-color: var(--md-sys-color-surface-container-low, #f7f2fa);\n color: var(--md-sys-color-primary, #6750a4);\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));\n }\n\n :host([variant=\"elevated\"]:hover) button,\n :host([variant=\"elevated\"]:hover) a {\n box-shadow: var(--md-sys-elevation-level2, 0px 2px 6px 2px rgba(0,0,0,0.15));\n }\n\n /* --- Filled Tonal --- */\n :host([variant=\"tonal\"]) button,\n :host([variant=\"tonal\"]) a {\n background-color: var(--md-sys-color-secondary-container, #e8def8);\n color: var(--md-sys-color-on-secondary-container, #1d192b);\n box-shadow: var(--md-sys-elevation-level0, none);\n }\n\n :host([variant=\"tonal\"]:hover) button,\n :host([variant=\"tonal\"]:hover) a {\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));\n }\n\n /* --- Outlined --- */\n :host([variant=\"outlined\"]) button,\n :host([variant=\"outlined\"]) a {\n background-color: transparent;\n color: var(--md-sys-color-primary, #6750a4);\n border: 1px solid var(--md-sys-color-outline, #79747e);\n }\n\n /* --- Text --- */\n :host([variant=\"text\"]) button,\n :host([variant=\"text\"]) a {\n background-color: transparent;\n color: var(--md-sys-color-primary, #6750a4);\n padding: 0 12px;\n }\n\n /* --- Disabled --- */\n :host([disabled]) button,\n :host([disabled]) a {\n cursor: not-allowed;\n box-shadow: none;\n }\n\n :host([disabled]:not([variant=\"outlined\"]):not([variant=\"text\"])) button,\n :host([disabled]:not([variant=\"outlined\"]):not([variant=\"text\"])) a {\n background-color: rgba(29, 27, 32, 0.12);\n color: rgba(29, 27, 32, 0.38);\n }\n\n :host([disabled][variant=\"outlined\"]) button,\n :host([disabled][variant=\"outlined\"]) a {\n border-color: rgba(29, 27, 32, 0.12);\n color: rgba(29, 27, 32, 0.38);\n }\n\n :host([disabled][variant=\"text\"]) button,\n :host([disabled][variant=\"text\"]) a {\n color: rgba(29, 27, 32, 0.38);\n }\n\n .content {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n position: relative;\n z-index: 1;\n }\n\n .spinner {\n width: 18px;\n height: 18px;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: md-spin 800ms linear infinite;\n }\n\n @keyframes md-spin {\n to {\n transform: rotate(360deg);\n }\n }\n`;\n\n","import { html, nothing } from 'lit';\nimport { customElement, property, queryAssignedElements } from 'lit/decorators.js';\nimport { MdBaseElement } from '../../internal/base-component.js';\nimport '../../internal/ripple/ripple.js';\nimport '../../internal/focus-ring/focus-ring.js';\nimport '../icon/icon.js';\nimport { buttonStyles } from './button.css.js';\n\nexport type ButtonVariant = 'filled' | 'elevated' | 'tonal' | 'outlined' | 'text';\n\n@customElement('md-button')\nexport class MdButton extends MdBaseElement {\n static override styles = [MdBaseElement.styles, buttonStyles];\n\n @property({ type: String, reflect: true })\n variant: ButtonVariant = 'filled';\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n @property({ type: String })\n type: 'button' | 'submit' | 'reset' = 'button';\n\n @property({ type: String })\n href = '';\n\n @property({ type: String })\n target = '';\n\n @property({ type: String })\n icon = '';\n\n @property({ type: String, attribute: 'trailing-icon' })\n trailingIcon = '';\n\n @queryAssignedElements({ slot: 'icon' })\n private assignedIcons!: HTMLElement[];\n\n @queryAssignedElements({ slot: 'trailing-icon' })\n private assignedTrailingIcons!: HTMLElement[];\n\n private handleClick = (event: MouseEvent): void => {\n if (this.disabled || this.loading) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n\n if (this.type === 'submit' || this.type === 'reset') {\n const form = this.closest('form');\n if (form) {\n if (this.type === 'submit') {\n form.requestSubmit();\n } else {\n form.reset();\n }\n }\n }\n };\n\n private handleSlotChange(): void {\n const hasLeading = Boolean(this.icon || (this.assignedIcons && this.assignedIcons.length > 0));\n const hasTrailing = Boolean(this.trailingIcon || (this.assignedTrailingIcons && this.assignedTrailingIcons.length > 0));\n\n this.toggleAttribute('has-icon', hasLeading);\n this.toggleAttribute('has-trailing-icon', hasTrailing);\n }\n\n override firstUpdated() {\n this.handleSlotChange();\n }\n\n override render() {\n const content = html`\n <md-ripple ?disabled=${this.disabled || this.loading}></md-ripple>\n <md-focus-ring></md-focus-ring>\n <span class=\"content\">\n ${this.loading\n ? html`<span class=\"spinner\" aria-hidden=\"true\"></span>`\n : html`\n <slot name=\"icon\" @slotchange=${this.handleSlotChange}>\n ${this.icon ? html`<md-icon name=${this.icon}></md-icon>` : nothing}\n </slot>\n `}\n <slot @slotchange=${this.handleSlotChange}></slot>\n ${!this.loading\n ? html`\n <slot name=\"trailing-icon\" @slotchange=${this.handleSlotChange}>\n ${this.trailingIcon ? html`<md-icon name=${this.trailingIcon}></md-icon>` : nothing}\n </slot>\n `\n : nothing}\n </span>\n `;\n\n if (this.href) {\n return html`\n <a\n href=${this.disabled ? nothing : this.href}\n target=${this.target || nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClick}\n >\n ${content}\n </a>\n `;\n }\n\n return html`\n <button\n type=${this.type}\n ?disabled=${this.disabled || this.loading}\n @click=${this.handleClick}\n >\n ${content}\n </button>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-button': MdButton;\n }\n}\n\n"],"names":["buttonStyles","css","MdButton","MdBaseElement","event","form","hasLeading","hasTrailing","content","html","nothing","__decorateClass","property","queryAssignedElements","customElement"],"mappings":";;;;;;AAEO,MAAMA,IAAeC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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S,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAN/BV,EAOX,WAAA,YAAA,CAAA;AAGAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAT/BV,EAUX,WAAA,WAAA,CAAA;AAGAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAZfV,EAaX,WAAA,QAAA,CAAA;AAGAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAffV,EAgBX,WAAA,QAAA,CAAA;AAGAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAlBfV,EAmBX,WAAA,UAAA,CAAA;AAGAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GArBfV,EAsBX,WAAA,QAAA,CAAA;AAGAS,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,QAAQ,WAAW,iBAAiB;AAAA,GAxB3CV,EAyBX,WAAA,gBAAA,CAAA;AAGQS,EAAA;AAAA,EADPE,EAAsB,EAAE,MAAM,OAAA,CAAQ;AAAA,GA3B5BX,EA4BH,WAAA,iBAAA,CAAA;AAGAS,EAAA;AAAA,EADPE,EAAsB,EAAE,MAAM,gBAAA,CAAiB;AAAA,GA9BrCX,EA+BH,WAAA,yBAAA,CAAA;AA/BGA,IAANS,EAAA;AAAA,EADNG,EAAc,WAAW;AAAA,GACbZ,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.css.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,yBAyFtB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MdBaseElement } from '../../internal/base-component.js';
|
|
2
|
+
export type CardVariant = 'elevated' | 'filled' | 'outlined';
|
|
3
|
+
export declare class MdCard extends MdBaseElement {
|
|
4
|
+
static styles: import('lit').CSSResultGroup[];
|
|
5
|
+
variant: CardVariant;
|
|
6
|
+
interactive: boolean;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
href: string;
|
|
9
|
+
target: string;
|
|
10
|
+
private handleClick;
|
|
11
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'md-card': MdCard;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/card/card.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,iCAAiC,CAAC;AACzC,OAAO,yCAAyC,CAAC;AAGjD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE7D,qBACa,MAAO,SAAQ,aAAa;IACvC,OAAgB,MAAM,iCAAsC;IAG5D,OAAO,EAAE,WAAW,CAAc;IAGlC,WAAW,UAAS;IAGpB,QAAQ,UAAS;IAGjB,IAAI,SAAM;IAGV,MAAM,SAAM;IAEZ,OAAO,CAAC,WAAW,CASjB;IAEO,MAAM;CAwChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { css as h, nothing as r, html as l } from "lit";
|
|
2
|
+
import { property as o, customElement as m } from "lit/decorators.js";
|
|
3
|
+
import { M as v } from "../../chunks/base-component-DQTjlEVL.js";
|
|
4
|
+
import "../../internal/ripple/ripple.js";
|
|
5
|
+
import "../../chunks/focus-ring-Dl-XoEKK.js";
|
|
6
|
+
const x = h`
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
border-radius: var(--md-sys-shape-corner-medium, 12px);
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
font-family: var(--md-sys-typescale-font-family, inherit);
|
|
12
|
+
position: relative;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
transition: box-shadow 200ms cubic-bezier(0.2, 0, 0, 1),
|
|
15
|
+
background-color 200ms cubic-bezier(0.2, 0, 0, 1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* --- Elevated (Default) --- */
|
|
19
|
+
:host(:not([variant])),
|
|
20
|
+
:host([variant="elevated"]) {
|
|
21
|
+
background-color: var(--md-sys-color-surface-container-low, #F7F2FA);
|
|
22
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:host(:not([variant])[interactive]:hover),
|
|
26
|
+
:host([variant="elevated"][interactive]:hover) {
|
|
27
|
+
box-shadow: var(--md-sys-elevation-level2, 0px 2px 6px 2px rgba(0,0,0,0.15));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* --- Filled --- */
|
|
31
|
+
:host([variant="filled"]) {
|
|
32
|
+
background-color: var(--md-sys-color-surface-container-highest, #E6E0E9);
|
|
33
|
+
box-shadow: var(--md-sys-elevation-level0, none);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:host([variant="filled"][interactive]:hover) {
|
|
37
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* --- Outlined --- */
|
|
41
|
+
:host([variant="outlined"]) {
|
|
42
|
+
background-color: var(--md-sys-color-surface, #FEF7FF);
|
|
43
|
+
border: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);
|
|
44
|
+
box-shadow: var(--md-sys-elevation-level0, none);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
:host([variant="outlined"][interactive]:hover) {
|
|
48
|
+
box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([interactive]) {
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([disabled]) {
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
opacity: 0.38;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.card-container {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
height: 100%;
|
|
64
|
+
position: relative;
|
|
65
|
+
text-decoration: none;
|
|
66
|
+
color: inherit;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
::slotted([slot="media"]) {
|
|
70
|
+
width: 100%;
|
|
71
|
+
max-height: 200px;
|
|
72
|
+
object-fit: cover;
|
|
73
|
+
display: block;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.header {
|
|
77
|
+
padding: 16px 16px 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.body {
|
|
81
|
+
padding: 16px;
|
|
82
|
+
flex: 1;
|
|
83
|
+
font-size: var(--md-sys-typescale-body-medium-size, 14px);
|
|
84
|
+
line-height: 20px;
|
|
85
|
+
color: var(--md-sys-color-on-surface-variant, #49454F);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.actions {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
padding: 8px 16px 16px;
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
var b = Object.defineProperty, f = Object.getOwnPropertyDescriptor, a = (e, s, d, n) => {
|
|
97
|
+
for (var i = n > 1 ? void 0 : n ? f(s, d) : s, c = e.length - 1, p; c >= 0; c--)
|
|
98
|
+
(p = e[c]) && (i = (n ? p(s, d, i) : p(i)) || i);
|
|
99
|
+
return n && i && b(s, d, i), i;
|
|
100
|
+
};
|
|
101
|
+
let t = class extends v {
|
|
102
|
+
constructor() {
|
|
103
|
+
super(...arguments), this.variant = "elevated", this.interactive = !1, this.disabled = !1, this.href = "", this.target = "", this.handleClick = (e) => {
|
|
104
|
+
if (this.disabled) {
|
|
105
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
this.interactive && this.emitEvent("card-click");
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
render() {
|
|
112
|
+
const e = l`
|
|
113
|
+
${this.interactive ? l`<md-ripple ?disabled=${this.disabled}></md-ripple><md-focus-ring></md-focus-ring>` : r}
|
|
114
|
+
<slot name="media"></slot>
|
|
115
|
+
<div class="header">
|
|
116
|
+
<slot name="header"></slot>
|
|
117
|
+
</div>
|
|
118
|
+
<div class="body">
|
|
119
|
+
<slot></slot>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="actions">
|
|
122
|
+
<slot name="actions"></slot>
|
|
123
|
+
</div>
|
|
124
|
+
`;
|
|
125
|
+
return this.href ? l`
|
|
126
|
+
<a
|
|
127
|
+
class="card-container"
|
|
128
|
+
href=${this.disabled ? r : this.href}
|
|
129
|
+
target=${this.target || r}
|
|
130
|
+
aria-disabled=${this.disabled ? "true" : r}
|
|
131
|
+
tabindex=${this.disabled ? "-1" : this.interactive ? "0" : r}
|
|
132
|
+
@click=${this.handleClick}
|
|
133
|
+
>
|
|
134
|
+
${e}
|
|
135
|
+
</a>
|
|
136
|
+
` : l`
|
|
137
|
+
<div
|
|
138
|
+
class="card-container"
|
|
139
|
+
tabindex=${this.interactive && !this.disabled ? "0" : r}
|
|
140
|
+
@click=${this.handleClick}
|
|
141
|
+
>
|
|
142
|
+
${e}
|
|
143
|
+
</div>
|
|
144
|
+
`;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
t.styles = [v.styles, x];
|
|
148
|
+
a([
|
|
149
|
+
o({ type: String, reflect: !0 })
|
|
150
|
+
], t.prototype, "variant", 2);
|
|
151
|
+
a([
|
|
152
|
+
o({ type: Boolean, reflect: !0 })
|
|
153
|
+
], t.prototype, "interactive", 2);
|
|
154
|
+
a([
|
|
155
|
+
o({ type: Boolean, reflect: !0 })
|
|
156
|
+
], t.prototype, "disabled", 2);
|
|
157
|
+
a([
|
|
158
|
+
o({ type: String })
|
|
159
|
+
], t.prototype, "href", 2);
|
|
160
|
+
a([
|
|
161
|
+
o({ type: String })
|
|
162
|
+
], t.prototype, "target", 2);
|
|
163
|
+
t = a([
|
|
164
|
+
m("md-card")
|
|
165
|
+
], t);
|
|
166
|
+
export {
|
|
167
|
+
t as MdCard
|
|
168
|
+
};
|
|
169
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../../src/components/card/card.css.ts","../../../src/components/card/card.ts"],"sourcesContent":["import { css } from 'lit';\n\nexport const cardStyles = css`\n :host {\n display: block;\n border-radius: var(--md-sys-shape-corner-medium, 12px);\n box-sizing: border-box;\n font-family: var(--md-sys-typescale-font-family, inherit);\n position: relative;\n overflow: hidden;\n transition: box-shadow 200ms cubic-bezier(0.2, 0, 0, 1),\n background-color 200ms cubic-bezier(0.2, 0, 0, 1);\n }\n\n /* --- Elevated (Default) --- */\n :host(:not([variant])),\n :host([variant=\"elevated\"]) {\n background-color: var(--md-sys-color-surface-container-low, #F7F2FA);\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));\n }\n\n :host(:not([variant])[interactive]:hover),\n :host([variant=\"elevated\"][interactive]:hover) {\n box-shadow: var(--md-sys-elevation-level2, 0px 2px 6px 2px rgba(0,0,0,0.15));\n }\n\n /* --- Filled --- */\n :host([variant=\"filled\"]) {\n background-color: var(--md-sys-color-surface-container-highest, #E6E0E9);\n box-shadow: var(--md-sys-elevation-level0, none);\n }\n\n :host([variant=\"filled\"][interactive]:hover) {\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));\n }\n\n /* --- Outlined --- */\n :host([variant=\"outlined\"]) {\n background-color: var(--md-sys-color-surface, #FEF7FF);\n border: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);\n box-shadow: var(--md-sys-elevation-level0, none);\n }\n\n :host([variant=\"outlined\"][interactive]:hover) {\n box-shadow: var(--md-sys-elevation-level1, 0px 1px 3px 1px rgba(0,0,0,0.15));\n }\n\n :host([interactive]) {\n cursor: pointer;\n }\n\n :host([disabled]) {\n pointer-events: none;\n opacity: 0.38;\n }\n\n .card-container {\n display: flex;\n flex-direction: column;\n height: 100%;\n position: relative;\n text-decoration: none;\n color: inherit;\n }\n\n ::slotted([slot=\"media\"]) {\n width: 100%;\n max-height: 200px;\n object-fit: cover;\n display: block;\n }\n\n .header {\n padding: 16px 16px 0;\n }\n\n .body {\n padding: 16px;\n flex: 1;\n font-size: var(--md-sys-typescale-body-medium-size, 14px);\n line-height: 20px;\n color: var(--md-sys-color-on-surface-variant, #49454F);\n }\n\n .actions {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n gap: 8px;\n padding: 8px 16px 16px;\n }\n`;\n\n","import { html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { MdBaseElement } from '../../internal/base-component.js';\nimport '../../internal/ripple/ripple.js';\nimport '../../internal/focus-ring/focus-ring.js';\nimport { cardStyles } from './card.css.js';\n\nexport type CardVariant = 'elevated' | 'filled' | 'outlined';\n\n@customElement('md-card')\nexport class MdCard extends MdBaseElement {\n static override styles = [MdBaseElement.styles, cardStyles];\n\n @property({ type: String, reflect: true })\n variant: CardVariant = 'elevated';\n\n @property({ type: Boolean, reflect: true })\n interactive = false;\n\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n @property({ type: String })\n href = '';\n\n @property({ type: String })\n target = '';\n\n private handleClick = (event: MouseEvent) => {\n if (this.disabled) {\n event.preventDefault();\n event.stopImmediatePropagation();\n return;\n }\n if (this.interactive) {\n this.emitEvent('card-click');\n }\n };\n\n override render() {\n const innerContent = html`\n ${this.interactive ? html`<md-ripple ?disabled=${this.disabled}></md-ripple><md-focus-ring></md-focus-ring>` : nothing}\n <slot name=\"media\"></slot>\n <div class=\"header\">\n <slot name=\"header\"></slot>\n </div>\n <div class=\"body\">\n <slot></slot>\n </div>\n <div class=\"actions\">\n <slot name=\"actions\"></slot>\n </div>\n `;\n\n if (this.href) {\n return html`\n <a\n class=\"card-container\"\n href=${this.disabled ? nothing : this.href}\n target=${this.target || nothing}\n aria-disabled=${this.disabled ? 'true' : nothing}\n tabindex=${this.disabled ? '-1' : (this.interactive ? '0' : nothing)}\n @click=${this.handleClick}\n >\n ${innerContent}\n </a>\n `;\n }\n\n return html`\n <div\n class=\"card-container\"\n tabindex=${this.interactive && !this.disabled ? '0' : nothing}\n @click=${this.handleClick}\n >\n ${innerContent}\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-card': MdCard;\n }\n}\n\n"],"names":["cardStyles","css","MdCard","MdBaseElement","event","innerContent","html","nothing","__decorateClass","property","customElement"],"mappings":";;;;;AAEO,MAAMA,IAAaC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AGAM,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAT/BP,EAUX,WAAA,YAAA,CAAA;AAGAM,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAZfP,EAaX,WAAA,QAAA,CAAA;AAGAM,EAAA;AAAA,EADCC,EAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAffP,EAgBX,WAAA,UAAA,CAAA;AAhBWA,IAANM,EAAA;AAAA,EADNE,EAAc,SAAS;AAAA,GACXR,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.css.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.css.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,yBAoG1B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MdFormAssociatedElement } from '../../internal/form-associated.js';
|
|
2
|
+
export declare class MdCheckbox extends MdFormAssociatedElement {
|
|
3
|
+
static styles: import('lit').CSSResultGroup[];
|
|
4
|
+
checked: boolean;
|
|
5
|
+
indeterminate: boolean;
|
|
6
|
+
error: boolean;
|
|
7
|
+
value: string;
|
|
8
|
+
private inputElement?;
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
updated(changedProperties: Map<string, unknown>): void;
|
|
12
|
+
formResetCallback(): void;
|
|
13
|
+
private updateFormValue;
|
|
14
|
+
private handleClick;
|
|
15
|
+
private handleKeyDown;
|
|
16
|
+
private toggle;
|
|
17
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
18
|
+
}
|
|
19
|
+
declare global {
|
|
20
|
+
interface HTMLElementTagNameMap {
|
|
21
|
+
'md-checkbox': MdCheckbox;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/checkbox/checkbox.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,iCAAiC,CAAC;AACzC,OAAO,yCAAyC,CAAC;AAGjD,qBACa,UAAW,SAAQ,uBAAuB;IACrD,OAAgB,MAAM,iCAAoD;IAG1E,OAAO,UAAS;IAGhB,aAAa,UAAS;IAGtB,KAAK,UAAS;IAGd,KAAK,SAAQ;IAGb,OAAO,CAAC,YAAY,CAAC,CAAmB;IAE/B,iBAAiB;IAQjB,oBAAoB;IAMpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAO/C,iBAAiB;IAM1B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,WAAW,CAIjB;IAEF,OAAO,CAAC,aAAa,CAMnB;IAEF,OAAO,CAAC,MAAM;IAYL,MAAM;CA2BhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|