@lit-material/button 0.0.2 → 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/custom-elements.json +367 -0
- package/dist/button-styles.js +4 -4
- package/dist/button.d.ts +4 -0
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +4 -0
- package/dist/button.js.map +1 -1
- package/package.json +8 -5
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/button-styles.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "variable",
|
|
11
|
+
"name": "styles",
|
|
12
|
+
"default": "css` :host { display: inline-flex; outline: none; vertical-align: top; -webkit-tap-highlight-color: transparent; } :host([disabled]) { pointer-events: none; } .button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; height: var(--lit-material-button-height, 40px); min-width: 64px; padding: 0 var(--lit-material-button-padding-inline, 24px); border: none; border-radius: var(--md-sys-shape-corner-full, 9999px); background-color: transparent; cursor: pointer; font-family: var(--md-sys-typescale-label-large-font, Roboto, system-ui, sans-serif); font-size: var(--md-sys-typescale-label-large-size, 0.875rem); font-weight: var(--md-sys-typescale-label-large-weight, 500); line-height: var(--md-sys-typescale-label-large-line-height, 1.25rem); letter-spacing: var(--md-sys-typescale-label-large-tracking, 0.00625rem); text-decoration: none; -webkit-appearance: none; appearance: none; transition: box-shadow 150ms var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)), background-color 150ms var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0, 0, 1)); } .button:disabled, .button[aria-disabled=\"true\"] { cursor: default; } .state-layer { position: absolute; inset: 0; border-radius: inherit; background-color: currentColor; opacity: 0; pointer-events: none; transition: opacity 100ms linear; } .button:hover .state-layer { opacity: var(--md-sys-state-hover-state-layer-opacity, 0.08); } .state-layer[data-pressed] { opacity: var(--md-sys-state-pressed-state-layer-opacity, 0.1); } .focus-ring { position: absolute; inset: -2px; border-radius: inherit; outline: 3px solid var(--md-sys-color-secondary, #625b71); outline-offset: 2px; pointer-events: none; } .focus-ring[hidden] { display: none; } slot.icon::slotted(*) { width: 18px; height: 18px; } .label { position: relative; } /* Filled (default): solid primary container. */ :host([variant=\"filled\"]) .button, :host(:not([variant])) .button { background-color: var(--md-sys-color-primary, #6750a4); color: var(--md-sys-color-on-primary, #ffffff); } /* Tonal: solid secondary container, lower emphasis than filled. */ :host([variant=\"tonal\"]) .button { background-color: var(--md-sys-color-secondary-container, #e8def8); color: var(--md-sys-color-on-secondary-container, #1d192b); } /* Elevated: surface-colored container that floats above the page via shadow. */ :host([variant=\"elevated\"]) .button { background-color: var(--md-sys-color-surface-container-low, #f7f2fa); color: var(--md-sys-color-primary, #6750a4); box-shadow: var(--md-sys-elevation-level1, 0 1px 2px rgba(0, 0, 0, 0.3)); } :host([variant=\"elevated\"]) .button:hover { box-shadow: var(--md-sys-elevation-level2, 0 1px 3px rgba(0, 0, 0, 0.3)); } /* Outlined: transparent container with a visible border, for medium emphasis. */ :host([variant=\"outlined\"]) .button { background-color: transparent; color: var(--md-sys-color-primary, #6750a4); border: 1px solid var(--md-sys-color-outline, #79747e); } :host([variant=\"outlined\"][disabled]) .button { border-color: color-mix(in srgb, var(--md-sys-color-on-surface, #1c1b1f) 12%, transparent); } /* Text: no container at all, lowest emphasis. */ :host([variant=\"text\"]) .button { background-color: transparent; color: var(--md-sys-color-primary, #6750a4); padding: 0 var(--lit-material-button-text-padding-inline, 12px); } /* Disabled treatment is identical across variants: on-surface at fixed opacities. */ :host([disabled]) .button { background-color: color-mix(in srgb, var(--md-sys-color-on-surface, #1c1b1f) 12%, transparent); color: color-mix(in srgb, var(--md-sys-color-on-surface, #1c1b1f) 38%, transparent); box-shadow: none; } :host([variant=\"outlined\"][disabled]) .button, :host([variant=\"text\"][disabled]) .button { background-color: transparent; } `"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"exports": [
|
|
16
|
+
{
|
|
17
|
+
"kind": "js",
|
|
18
|
+
"name": "styles",
|
|
19
|
+
"declaration": {
|
|
20
|
+
"name": "styles",
|
|
21
|
+
"module": "src/button-styles.ts"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "javascript-module",
|
|
28
|
+
"path": "src/button.ts",
|
|
29
|
+
"declarations": [
|
|
30
|
+
{
|
|
31
|
+
"kind": "class",
|
|
32
|
+
"description": "Material Design 3 button.",
|
|
33
|
+
"name": "LitMaterialButton",
|
|
34
|
+
"cssProperties": [
|
|
35
|
+
{
|
|
36
|
+
"description": "Button height (default `40px`).",
|
|
37
|
+
"name": "--lit-material-button-height"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"description": "Left and right padding (default `24px`).",
|
|
41
|
+
"name": "--lit-material-button-padding-inline"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"description": "The same for `variant=\"text\"` (default `12px`).",
|
|
45
|
+
"name": "--lit-material-button-text-padding-inline"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"cssParts": [
|
|
49
|
+
{
|
|
50
|
+
"description": "The native `<button>` or `<a>` element rendered inside the shadow root.",
|
|
51
|
+
"name": "button"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"description": "The state-layer element the hover/press feedback is drawn on.",
|
|
55
|
+
"name": "ripple"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"description": "The focus indicator element.",
|
|
59
|
+
"name": "focus-ring"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"slots": [
|
|
63
|
+
{
|
|
64
|
+
"description": "The button's label.",
|
|
65
|
+
"name": ""
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"description": "An optional leading icon.",
|
|
69
|
+
"name": "icon"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"members": [
|
|
73
|
+
{
|
|
74
|
+
"kind": "field",
|
|
75
|
+
"name": "shadowRootOptions",
|
|
76
|
+
"type": {
|
|
77
|
+
"text": "ShadowRootInit"
|
|
78
|
+
},
|
|
79
|
+
"static": true,
|
|
80
|
+
"default": "{ ...LitElement.shadowRootOptions, delegatesFocus: true, }"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"kind": "field",
|
|
84
|
+
"name": "formAssociated",
|
|
85
|
+
"type": {
|
|
86
|
+
"text": "boolean"
|
|
87
|
+
},
|
|
88
|
+
"static": true,
|
|
89
|
+
"default": "true",
|
|
90
|
+
"description": "Form-associated custom element: lets this button participate in an ancestor `<form>`."
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"kind": "field",
|
|
94
|
+
"name": "variant",
|
|
95
|
+
"type": {
|
|
96
|
+
"text": "ButtonVariant"
|
|
97
|
+
},
|
|
98
|
+
"default": "\"filled\"",
|
|
99
|
+
"attribute": "variant"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"kind": "field",
|
|
103
|
+
"name": "type",
|
|
104
|
+
"type": {
|
|
105
|
+
"text": "ButtonType"
|
|
106
|
+
},
|
|
107
|
+
"default": "\"button\"",
|
|
108
|
+
"attribute": "type"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"kind": "field",
|
|
112
|
+
"name": "disabled",
|
|
113
|
+
"type": {
|
|
114
|
+
"text": "boolean"
|
|
115
|
+
},
|
|
116
|
+
"default": "false",
|
|
117
|
+
"attribute": "disabled",
|
|
118
|
+
"reflects": true
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"kind": "field",
|
|
122
|
+
"name": "name",
|
|
123
|
+
"type": {
|
|
124
|
+
"text": "string"
|
|
125
|
+
},
|
|
126
|
+
"default": "\"\"",
|
|
127
|
+
"attribute": "name"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"kind": "field",
|
|
131
|
+
"name": "value",
|
|
132
|
+
"type": {
|
|
133
|
+
"text": "string"
|
|
134
|
+
},
|
|
135
|
+
"default": "\"\"",
|
|
136
|
+
"attribute": "value"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"kind": "field",
|
|
140
|
+
"name": "form",
|
|
141
|
+
"type": {
|
|
142
|
+
"text": "string | undefined"
|
|
143
|
+
},
|
|
144
|
+
"attribute": "form",
|
|
145
|
+
"reflects": true
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"kind": "field",
|
|
149
|
+
"name": "href",
|
|
150
|
+
"type": {
|
|
151
|
+
"text": "string"
|
|
152
|
+
},
|
|
153
|
+
"default": "\"\"",
|
|
154
|
+
"description": "If set, renders the button as a link (`<a>`) instead of a `<button>`.",
|
|
155
|
+
"attribute": "href"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"kind": "field",
|
|
159
|
+
"name": "target",
|
|
160
|
+
"type": {
|
|
161
|
+
"text": "string"
|
|
162
|
+
},
|
|
163
|
+
"default": "\"\"",
|
|
164
|
+
"attribute": "target"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"kind": "field",
|
|
168
|
+
"name": "stateLayerElement",
|
|
169
|
+
"type": {
|
|
170
|
+
"text": "HTMLElement | undefined"
|
|
171
|
+
},
|
|
172
|
+
"privacy": "private",
|
|
173
|
+
"readonly": true
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"kind": "field",
|
|
177
|
+
"name": "internals",
|
|
178
|
+
"type": {
|
|
179
|
+
"text": "ElementInternals"
|
|
180
|
+
},
|
|
181
|
+
"privacy": "private",
|
|
182
|
+
"readonly": true
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"kind": "field",
|
|
186
|
+
"name": "ripple",
|
|
187
|
+
"privacy": "private",
|
|
188
|
+
"readonly": true,
|
|
189
|
+
"default": "new RippleController(this)"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"kind": "field",
|
|
193
|
+
"name": "focusRing",
|
|
194
|
+
"privacy": "private",
|
|
195
|
+
"readonly": true,
|
|
196
|
+
"default": "new FocusRingController(this)"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"kind": "field",
|
|
200
|
+
"name": "labelId",
|
|
201
|
+
"privacy": "private",
|
|
202
|
+
"readonly": true,
|
|
203
|
+
"default": "`lit-material-button-label-${++instanceCount}`"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"kind": "method",
|
|
207
|
+
"name": "handleClick",
|
|
208
|
+
"privacy": "private",
|
|
209
|
+
"return": {
|
|
210
|
+
"type": {
|
|
211
|
+
"text": "void"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"parameters": [
|
|
215
|
+
{
|
|
216
|
+
"name": "event",
|
|
217
|
+
"type": {
|
|
218
|
+
"text": "MouseEvent"
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"kind": "method",
|
|
225
|
+
"name": "handleLinkClick",
|
|
226
|
+
"privacy": "private",
|
|
227
|
+
"return": {
|
|
228
|
+
"type": {
|
|
229
|
+
"text": "void"
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
"parameters": [
|
|
233
|
+
{
|
|
234
|
+
"name": "event",
|
|
235
|
+
"type": {
|
|
236
|
+
"text": "MouseEvent"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
]
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"attributes": [
|
|
243
|
+
{
|
|
244
|
+
"name": "variant",
|
|
245
|
+
"type": {
|
|
246
|
+
"text": "ButtonVariant"
|
|
247
|
+
},
|
|
248
|
+
"default": "\"filled\"",
|
|
249
|
+
"fieldName": "variant"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "type",
|
|
253
|
+
"type": {
|
|
254
|
+
"text": "ButtonType"
|
|
255
|
+
},
|
|
256
|
+
"default": "\"button\"",
|
|
257
|
+
"fieldName": "type"
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
"name": "disabled",
|
|
261
|
+
"type": {
|
|
262
|
+
"text": "boolean"
|
|
263
|
+
},
|
|
264
|
+
"default": "false",
|
|
265
|
+
"fieldName": "disabled"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "name",
|
|
269
|
+
"type": {
|
|
270
|
+
"text": "string"
|
|
271
|
+
},
|
|
272
|
+
"default": "\"\"",
|
|
273
|
+
"fieldName": "name"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "value",
|
|
277
|
+
"type": {
|
|
278
|
+
"text": "string"
|
|
279
|
+
},
|
|
280
|
+
"default": "\"\"",
|
|
281
|
+
"fieldName": "value"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"name": "form",
|
|
285
|
+
"type": {
|
|
286
|
+
"text": "string | undefined"
|
|
287
|
+
},
|
|
288
|
+
"fieldName": "form"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "href",
|
|
292
|
+
"type": {
|
|
293
|
+
"text": "string"
|
|
294
|
+
},
|
|
295
|
+
"default": "\"\"",
|
|
296
|
+
"description": "If set, renders the button as a link (`<a>`) instead of a `<button>`.",
|
|
297
|
+
"fieldName": "href"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"name": "target",
|
|
301
|
+
"type": {
|
|
302
|
+
"text": "string"
|
|
303
|
+
},
|
|
304
|
+
"default": "\"\"",
|
|
305
|
+
"fieldName": "target"
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
"superclass": {
|
|
309
|
+
"name": "LitElement",
|
|
310
|
+
"package": "lit"
|
|
311
|
+
},
|
|
312
|
+
"tagName": "lit-material-button",
|
|
313
|
+
"customElement": true
|
|
314
|
+
}
|
|
315
|
+
],
|
|
316
|
+
"exports": [
|
|
317
|
+
{
|
|
318
|
+
"kind": "js",
|
|
319
|
+
"name": "LitMaterialButton",
|
|
320
|
+
"declaration": {
|
|
321
|
+
"name": "LitMaterialButton",
|
|
322
|
+
"module": "src/button.ts"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"kind": "custom-element-definition",
|
|
327
|
+
"name": "lit-material-button",
|
|
328
|
+
"declaration": {
|
|
329
|
+
"name": "LitMaterialButton",
|
|
330
|
+
"module": "src/button.ts"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
"kind": "javascript-module",
|
|
337
|
+
"path": "src/index.ts",
|
|
338
|
+
"declarations": [],
|
|
339
|
+
"exports": [
|
|
340
|
+
{
|
|
341
|
+
"kind": "js",
|
|
342
|
+
"name": "LitMaterialButton",
|
|
343
|
+
"declaration": {
|
|
344
|
+
"name": "LitMaterialButton",
|
|
345
|
+
"module": "./button.js"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"kind": "js",
|
|
350
|
+
"name": "ButtonVariant",
|
|
351
|
+
"declaration": {
|
|
352
|
+
"name": "ButtonVariant",
|
|
353
|
+
"module": "./button.js"
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"kind": "js",
|
|
358
|
+
"name": "ButtonType",
|
|
359
|
+
"declaration": {
|
|
360
|
+
"name": "ButtonType",
|
|
361
|
+
"module": "./button.js"
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
]
|
|
367
|
+
}
|
package/dist/button-styles.js
CHANGED
|
@@ -18,9 +18,9 @@ export const styles = css `
|
|
|
18
18
|
justify-content: center;
|
|
19
19
|
gap: 8px;
|
|
20
20
|
box-sizing: border-box;
|
|
21
|
-
height: 40px;
|
|
21
|
+
height: var(--lit-material-button-height, 40px);
|
|
22
22
|
min-width: 64px;
|
|
23
|
-
padding: 0 24px;
|
|
23
|
+
padding: 0 var(--lit-material-button-padding-inline, 24px);
|
|
24
24
|
border: none;
|
|
25
25
|
border-radius: var(--md-sys-shape-corner-full, 9999px);
|
|
26
26
|
background-color: transparent;
|
|
@@ -74,7 +74,7 @@ export const styles = css `
|
|
|
74
74
|
display: none;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
.icon
|
|
77
|
+
slot.icon::slotted(*) {
|
|
78
78
|
width: 18px;
|
|
79
79
|
height: 18px;
|
|
80
80
|
}
|
|
@@ -122,7 +122,7 @@ export const styles = css `
|
|
|
122
122
|
:host([variant="text"]) .button {
|
|
123
123
|
background-color: transparent;
|
|
124
124
|
color: var(--md-sys-color-primary, #6750a4);
|
|
125
|
-
padding: 0 12px;
|
|
125
|
+
padding: 0 var(--lit-material-button-text-padding-inline, 12px);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
/* Disabled treatment is identical across variants: on-surface at fixed opacities. */
|
package/dist/button.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export type ButtonType = "button" | "submit" | "reset";
|
|
|
9
9
|
* @slot - The button's label.
|
|
10
10
|
* @slot icon - An optional leading icon.
|
|
11
11
|
*
|
|
12
|
+
* @cssprop --lit-material-button-height - Button height (default `40px`).
|
|
13
|
+
* @cssprop --lit-material-button-padding-inline - Left and right padding (default `24px`).
|
|
14
|
+
* @cssprop --lit-material-button-text-padding-inline - The same for `variant="text"` (default `12px`).
|
|
15
|
+
*
|
|
12
16
|
* @csspart button - The native `<button>` or `<a>` element rendered inside the shadow root.
|
|
13
17
|
* @csspart ripple - The state-layer element the hover/press feedback is drawn on.
|
|
14
18
|
* @csspart focus-ring - The focus indicator element.
|
package/dist/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EA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7B,qBAAqB,EAAE,iBAAiB,CAAC;KAC1C;CACF"}
|
package/dist/button.js
CHANGED
|
@@ -17,6 +17,10 @@ let instanceCount = 0;
|
|
|
17
17
|
* @slot - The button's label.
|
|
18
18
|
* @slot icon - An optional leading icon.
|
|
19
19
|
*
|
|
20
|
+
* @cssprop --lit-material-button-height - Button height (default `40px`).
|
|
21
|
+
* @cssprop --lit-material-button-padding-inline - Left and right padding (default `24px`).
|
|
22
|
+
* @cssprop --lit-material-button-text-padding-inline - The same for `variant="text"` (default `12px`).
|
|
23
|
+
*
|
|
20
24
|
* @csspart button - The native `<button>` or `<a>` element rendered inside the shadow root.
|
|
21
25
|
* @csspart ripple - The state-layer element the hover/press feedback is drawn on.
|
|
22
26
|
* @csspart focus-ring - The focus indicator element.
|
package/dist/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAK5C,IAAI,aAAa,GAAG,CAAC,CAAC;AAEtB
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../src/button.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE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C;;AAzFW;IAAX,QAAQ,EAAE;kDAAmC;AAClC;IAAX,QAAQ,EAAE;+CAA6B;AACI;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAkB;AACjD;IAAX,QAAQ,EAAE;+CAAW;AACV;IAAX,QAAQ,EAAE;gDAAY;AACM;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CAAe;AAG/B;IAAX,QAAQ,EAAE;+CAAW;AACV;IAAX,QAAQ,EAAE;iDAAa;AAEgB;IAAvC,KAAK,CAAC,cAAc,CAAC;4DAAkD;AAtB7D,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CAqG7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lit-material/button",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Material Design 3 button web component (filled, outlined, text, elevated, tonal).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -33,15 +33,16 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
|
-
"dist"
|
|
36
|
+
"dist",
|
|
37
|
+
"custom-elements.json"
|
|
37
38
|
],
|
|
38
39
|
"publishConfig": {
|
|
39
40
|
"access": "public"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
42
43
|
"lit": "^3.2.0",
|
|
43
|
-
"@lit-material/
|
|
44
|
-
"@lit-material/
|
|
44
|
+
"@lit-material/tokens": "0.0.1",
|
|
45
|
+
"@lit-material/core": "0.0.2"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@lit-labs/ssr": "^3.3.1",
|
|
@@ -53,9 +54,11 @@
|
|
|
53
54
|
"tsx": "^4.19.0",
|
|
54
55
|
"typescript": "^5.7.0"
|
|
55
56
|
},
|
|
57
|
+
"customElements": "custom-elements.json",
|
|
56
58
|
"scripts": {
|
|
57
59
|
"build": "tsc -p tsconfig.json",
|
|
58
60
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
59
|
-
"test": "web-test-runner && node --import tsx --test src/button.ssr.test.ts"
|
|
61
|
+
"test": "web-test-runner && node --import tsx --test src/button.ssr.test.ts",
|
|
62
|
+
"analyze": "custom-elements-manifest analyze --litelement --globs \"src/**/*.ts\" --exclude \"src/**/*.test.ts\" --exclude \"src/**/*.ssr.test.ts\""
|
|
60
63
|
}
|
|
61
64
|
}
|