@warp-ds/elements 2.10.0-next.3 → 2.10.0-next.5
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/dist/custom-elements.json +77 -14
- package/dist/docs/affix/affix.md +2 -0
- package/dist/docs/affix/styling.md +1 -0
- package/dist/docs/alert/alert.md +2 -0
- package/dist/docs/alert/styling.md +1 -0
- package/dist/docs/attention/attention.md +2 -0
- package/dist/docs/attention/styling.md +1 -0
- package/dist/docs/badge/badge.md +2 -0
- package/dist/docs/badge/styling.md +1 -0
- package/dist/docs/box/box.md +22 -38
- package/dist/docs/box/examples.md +20 -38
- package/dist/docs/box/styling.md +1 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +8 -0
- package/dist/docs/breadcrumbs/examples.md +7 -1
- package/dist/docs/breadcrumbs/styling.md +1 -0
- package/dist/docs/button/button.md +73 -0
- package/dist/docs/button/styling.md +72 -0
- package/dist/docs/card/card.md +2 -0
- package/dist/docs/card/styling.md +1 -0
- package/dist/docs/checkbox/api.md +128 -0
- package/dist/docs/checkbox/checkbox.md +134 -0
- package/dist/docs/checkbox-group/accessibility.md +71 -0
- package/dist/docs/checkbox-group/api.md +79 -0
- package/dist/docs/checkbox-group/checkbox-group.md +492 -0
- package/dist/docs/checkbox-group/examples.md +105 -0
- package/dist/docs/checkbox-group/styling.md +132 -0
- package/dist/docs/checkbox-group/usage.md +95 -0
- package/dist/docs/combobox/combobox.md +2 -0
- package/dist/docs/combobox/styling.md +1 -0
- package/dist/docs/datepicker/accessibility.md +25 -0
- package/dist/docs/datepicker/api.md +22 -14
- package/dist/docs/datepicker/datepicker.md +208 -14
- package/dist/docs/datepicker/examples.md +75 -0
- package/dist/docs/datepicker/styling.md +1 -0
- package/dist/docs/datepicker/usage.md +84 -0
- package/dist/docs/expandable/api.md +20 -32
- package/dist/docs/expandable/examples.md +54 -0
- package/dist/docs/expandable/expandable.md +74 -32
- package/dist/docs/expandable/styling.md +1 -0
- package/dist/docs/icon/icon.md +2 -0
- package/dist/docs/icon/styling.md +1 -0
- package/dist/docs/link/link.md +2 -0
- package/dist/docs/link/styling.md +1 -0
- package/dist/docs/modal/modal.md +2 -0
- package/dist/docs/modal/styling.md +1 -0
- package/dist/docs/modal-footer/modal-footer.md +0 -6
- package/dist/docs/modal-header/modal-header.md +0 -6
- package/dist/docs/page-indicator/page-indicator.md +2 -0
- package/dist/docs/page-indicator/styling.md +1 -0
- package/dist/docs/pagination/pagination.md +2 -0
- package/dist/docs/pagination/styling.md +1 -0
- package/dist/docs/pill/pill.md +2 -0
- package/dist/docs/pill/styling.md +1 -0
- package/dist/docs/radio/radio.md +0 -6
- package/dist/docs/select/select.md +2 -0
- package/dist/docs/select/styling.md +1 -0
- package/dist/docs/slider/slider.md +2 -0
- package/dist/docs/slider/styling.md +1 -0
- package/dist/docs/slider-thumb/slider-thumb.md +2 -0
- package/dist/docs/slider-thumb/styling.md +1 -0
- package/dist/docs/step-indicator/step-indicator.md +2 -0
- package/dist/docs/step-indicator/styling.md +1 -0
- package/dist/docs/switch/styling.md +1 -0
- package/dist/docs/switch/switch.md +2 -0
- package/dist/docs/tabs/styling.md +1 -0
- package/dist/docs/tabs/tabs.md +2 -0
- package/dist/docs/textarea/styling.md +1 -0
- package/dist/docs/textarea/textarea.md +2 -0
- package/dist/docs/textfield/styling.md +1 -0
- package/dist/docs/textfield/textfield.md +2 -0
- package/dist/index.d.ts +164 -128
- package/dist/packages/affix/affix.hydration.test.js +1 -1
- package/dist/packages/alert/alert.hydration.test.js +1 -1
- package/dist/packages/attention/attention.hydration.test.js +1 -1
- package/dist/packages/attention/attention.js +397 -446
- package/dist/packages/attention/attention.js.map +4 -4
- package/dist/packages/badge/badge.hydration.test.js +1 -1
- package/dist/packages/box/box.hydration.test.js +1 -1
- package/dist/packages/breadcrumbs/breadcrumbs.hydration.test.js +3 -2
- package/dist/packages/button/button.hydration.test.js +1 -1
- package/dist/packages/button/button.js +387 -436
- package/dist/packages/button/button.js.map +4 -4
- package/dist/packages/button/button.stories.d.ts +29 -0
- package/dist/packages/button/button.stories.js +176 -2
- package/dist/packages/button/styles.d.ts +22 -1
- package/dist/packages/button/styles.js +390 -1
- package/dist/packages/card/card.hydration.test.js +1 -1
- package/dist/packages/checkbox/checkbox.d.ts +5 -3
- package/dist/packages/checkbox/checkbox.hydration.test.js +1 -1
- package/dist/packages/checkbox/checkbox.js +2 -2
- package/dist/packages/checkbox/checkbox.js.map +3 -3
- package/dist/packages/checkbox/checkbox.react.stories.d.ts +1 -1
- package/dist/packages/checkbox/checkbox.stories.d.ts +2 -2
- package/dist/packages/checkbox/react.d.ts +2 -2
- package/dist/packages/checkbox-group/checkbox-group.d.ts +5 -3
- package/dist/packages/checkbox-group/checkbox-group.hydration.test.js +1 -1
- package/dist/packages/checkbox-group/checkbox-group.js +6 -6
- package/dist/packages/checkbox-group/checkbox-group.js.map +3 -3
- package/dist/packages/checkbox-group/react.d.ts +3 -3
- package/dist/packages/datepicker/datepicker.d.ts +22 -30
- package/dist/packages/datepicker/datepicker.hydration.test.js +1 -1
- package/dist/packages/datepicker/datepicker.js.map +2 -2
- package/dist/packages/expandable/expandable.d.ts +11 -32
- package/dist/packages/expandable/expandable.hydration.test.js +1 -1
- package/dist/packages/expandable/expandable.js.map +2 -2
- package/dist/packages/expandable/expandable.react.stories.d.ts +2 -2
- package/dist/packages/expandable/react.d.ts +1 -1
- package/dist/packages/icon/icon.hydration.test.js +1 -1
- package/dist/packages/link/link.hydration.test.js +1 -1
- package/dist/packages/link/link.js +420 -190
- package/dist/packages/link/link.js.map +4 -4
- package/dist/packages/link/styles.d.ts +5 -0
- package/dist/packages/link/styles.js +80 -0
- package/dist/packages/modal/modal.d.ts +1 -0
- package/dist/packages/modal/modal.hydration.test.js +1 -1
- package/dist/packages/modal/modal.js +4 -4
- package/dist/packages/modal/modal.js.map +2 -2
- package/dist/packages/page-indicator/page-indicator.hydration.test.js +1 -1
- package/dist/packages/pagination/pagination.hydration.test.js +1 -1
- package/dist/packages/pill/pill.hydration.test.js +1 -1
- package/dist/packages/radio/radio.hydration.test.js +1 -1
- package/dist/packages/radio/radio.js.map +1 -1
- package/dist/packages/radio-group/radio-group.a11y.test.js +6 -2
- package/dist/packages/radio-group/radio-group.hydration.test.js +6 -2
- package/dist/packages/radio-group/radio-group.js +2 -2
- package/dist/packages/radio-group/radio-group.js.map +4 -4
- package/dist/packages/select/select.a11y.test.js +6 -2
- package/dist/packages/select/select.hydration.test.js +1 -1
- package/dist/packages/select/select.test.js +4 -2
- package/dist/packages/slider/slider.hydration.test.js +7 -2
- package/dist/packages/slider/slider.js.map +1 -1
- package/dist/packages/slider/slider.react.stories.js +2 -2
- package/dist/packages/slider-thumb/slider-thumb.hydration.test.js +1 -1
- package/dist/packages/step/step.hydration.test.js +1 -1
- package/dist/packages/step-indicator/step-indicator.hydration.test.js +1 -1
- package/dist/packages/switch/switch.hydration.test.js +1 -1
- package/dist/packages/tab/tab.hydration.test.js +1 -1
- package/dist/packages/tab-panel/tab-panel.hydration.test.js +1 -1
- package/dist/packages/tabs/tabs.a11y.test.js +1 -1
- package/dist/packages/tabs/tabs.hydration.test.js +1 -1
- package/dist/packages/tabs/tabs.test.js +3 -3
- package/dist/packages/textarea/textarea.hydration.test.js +1 -1
- package/dist/packages/textfield/textfield.hydration.test.js +1 -1
- package/dist/web-types.json +91 -28
- package/eik/index.js +115 -0
- package/package.json +7 -4
- package/dist/docs/modal-footer/accessibility.md +0 -1
- package/dist/docs/modal-footer/examples.md +0 -1
- package/dist/docs/modal-footer/usage.md +0 -1
- package/dist/docs/modal-header/accessibility.md +0 -1
- package/dist/docs/modal-header/examples.md +0 -1
- package/dist/docs/modal-header/usage.md +0 -1
- package/dist/docs/radio/accessibility.md +0 -1
- package/dist/docs/radio/examples.md +0 -1
- package/dist/docs/radio/usage.md +0 -1
- package/dist/packages/button/styles/w-button.styles.d.ts +0 -1
- package/dist/packages/button/styles/w-button.styles.js +0 -282
- package/dist/packages/link/styles/w-link.styles.d.ts +0 -1
- package/dist/packages/link/styles/w-link.styles.js +0 -213
|
@@ -20,3 +20,32 @@ export declare const Loading: Story;
|
|
|
20
20
|
export declare const FullWidth: Story;
|
|
21
21
|
export declare const AsLink: Story;
|
|
22
22
|
export declare const FormControl: Story;
|
|
23
|
+
export declare const Overlay: Story;
|
|
24
|
+
export declare const OverlayInverted: Story;
|
|
25
|
+
export declare const OverlayQuiet: Story;
|
|
26
|
+
export declare const OverlayInvertedQuiet: Story;
|
|
27
|
+
/**
|
|
28
|
+
* Helpful grid to spot:
|
|
29
|
+
* - hover backgrounds (especially link + quiet variants)
|
|
30
|
+
* - pill icon color regressions
|
|
31
|
+
* - any padding/outline oddities
|
|
32
|
+
*/
|
|
33
|
+
export declare const AllVariantsGrid: Story;
|
|
34
|
+
/**
|
|
35
|
+
* Confirms backwards compat mapping for the deprecated `quiet` flag.
|
|
36
|
+
* Especially relevant for overlay/overlayInverted and negative/utility.
|
|
37
|
+
*/
|
|
38
|
+
export declare const QuietBackCompatMapping: Story;
|
|
39
|
+
/**
|
|
40
|
+
* Loading should be consistent across variants (disabled-like + stripes).
|
|
41
|
+
* This story makes it obvious if a variant leaks hover/background/color into loading.
|
|
42
|
+
*/
|
|
43
|
+
export declare const LoadingAcrossVariants: Story;
|
|
44
|
+
/**
|
|
45
|
+
* This targets the known tricky path:
|
|
46
|
+
* w-button with href renders w-link (back-compat).
|
|
47
|
+
* Great for spotting:
|
|
48
|
+
* - hover gray bg (should not happen for "link" look)
|
|
49
|
+
* - double padding when link is rendered inside button styling assumptions
|
|
50
|
+
*/
|
|
51
|
+
export declare const HrefModeRegression: Story;
|
|
@@ -48,8 +48,6 @@ export const Link = {
|
|
|
48
48
|
args: {
|
|
49
49
|
variant: 'link',
|
|
50
50
|
type: 'button',
|
|
51
|
-
href: 'https://developer.mozilla.org/en-US/docs/Web/API/Web_components',
|
|
52
|
-
target: '_new',
|
|
53
51
|
},
|
|
54
52
|
};
|
|
55
53
|
export const Pill = {
|
|
@@ -144,3 +142,179 @@ export const FormControl = {
|
|
|
144
142
|
`;
|
|
145
143
|
},
|
|
146
144
|
};
|
|
145
|
+
/* -------------------------------------------------------------------------------------------------
|
|
146
|
+
* Added stories: overlay variants + regressions (href mode + quiet mapping + loading across variants)
|
|
147
|
+
* ------------------------------------------------------------------------------------------------- */
|
|
148
|
+
export const Overlay = {
|
|
149
|
+
args: {
|
|
150
|
+
variant: 'overlay',
|
|
151
|
+
type: 'button',
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
export const OverlayInverted = {
|
|
155
|
+
args: {
|
|
156
|
+
variant: 'overlayInverted',
|
|
157
|
+
type: 'button',
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
export const OverlayQuiet = {
|
|
161
|
+
args: {
|
|
162
|
+
variant: 'overlayQuiet',
|
|
163
|
+
type: 'button',
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
export const OverlayInvertedQuiet = {
|
|
167
|
+
args: {
|
|
168
|
+
variant: 'overlayInvertedQuiet',
|
|
169
|
+
type: 'button',
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Helpful grid to spot:
|
|
174
|
+
* - hover backgrounds (especially link + quiet variants)
|
|
175
|
+
* - pill icon color regressions
|
|
176
|
+
* - any padding/outline oddities
|
|
177
|
+
*/
|
|
178
|
+
export const AllVariantsGrid = {
|
|
179
|
+
args: {},
|
|
180
|
+
render() {
|
|
181
|
+
const locale = detectLocale();
|
|
182
|
+
const variants = [
|
|
183
|
+
'primary',
|
|
184
|
+
'secondary',
|
|
185
|
+
'negative',
|
|
186
|
+
'negativeQuiet',
|
|
187
|
+
'utility',
|
|
188
|
+
'utilityQuiet',
|
|
189
|
+
'quiet',
|
|
190
|
+
'link',
|
|
191
|
+
'pill',
|
|
192
|
+
'overlay',
|
|
193
|
+
'overlayInverted',
|
|
194
|
+
'overlayQuiet',
|
|
195
|
+
'overlayInvertedQuiet',
|
|
196
|
+
];
|
|
197
|
+
return html `
|
|
198
|
+
<div style="display:grid; gap: 16px;">
|
|
199
|
+
<div style="font: 12px/1.4 system-ui; opacity: 0.8;">
|
|
200
|
+
Grid for visual regression checking (hover states / padding / icon colors).
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<div style="display:grid; gap: 12px;">
|
|
204
|
+
${variants.map((v) => html `
|
|
205
|
+
<div style="display:flex; align-items:center; gap: 12px; flex-wrap: wrap;">
|
|
206
|
+
<div style="width: 210px; font: 12px/1.4 system-ui; opacity: 0.8;">variant="${v}"</div>
|
|
207
|
+
|
|
208
|
+
<w-button variant=${v} type="button">Label</w-button>
|
|
209
|
+
|
|
210
|
+
${v === 'pill'
|
|
211
|
+
? html `
|
|
212
|
+
<w-button variant="pill" type="button" icon-only aria-label="Pill icon">
|
|
213
|
+
<w-icon
|
|
214
|
+
name="Heart"
|
|
215
|
+
size="small"
|
|
216
|
+
locale="${locale}"
|
|
217
|
+
style="height: 16px;"
|
|
218
|
+
class="flex"
|
|
219
|
+
></w-icon>
|
|
220
|
+
</w-button>
|
|
221
|
+
`
|
|
222
|
+
: null}
|
|
223
|
+
</div>
|
|
224
|
+
`)}
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
`;
|
|
228
|
+
},
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Confirms backwards compat mapping for the deprecated `quiet` flag.
|
|
232
|
+
* Especially relevant for overlay/overlayInverted and negative/utility.
|
|
233
|
+
*/
|
|
234
|
+
export const QuietBackCompatMapping = {
|
|
235
|
+
args: {},
|
|
236
|
+
render() {
|
|
237
|
+
return html `
|
|
238
|
+
<div style="display:grid; gap: 12px;">
|
|
239
|
+
<div style="font: 12px/1.4 system-ui; opacity: 0.8;">
|
|
240
|
+
These should look like their corresponding <code>*Quiet</code> variants.
|
|
241
|
+
</div>
|
|
242
|
+
|
|
243
|
+
<div style="display:flex; gap: 12px; flex-wrap: wrap;">
|
|
244
|
+
<w-button variant="negative" quiet type="button">negative + quiet</w-button>
|
|
245
|
+
<w-button variant="utility" quiet type="button">utility + quiet</w-button>
|
|
246
|
+
<w-button variant="overlay" quiet type="button">overlay + quiet</w-button>
|
|
247
|
+
<w-button variant="overlayInverted" quiet type="button">overlayInverted + quiet</w-button>
|
|
248
|
+
<w-button variant="secondary" quiet type="button">secondary + quiet</w-button>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
`;
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* Loading should be consistent across variants (disabled-like + stripes).
|
|
256
|
+
* This story makes it obvious if a variant leaks hover/background/color into loading.
|
|
257
|
+
*/
|
|
258
|
+
export const LoadingAcrossVariants = {
|
|
259
|
+
args: {},
|
|
260
|
+
render() {
|
|
261
|
+
const variants = [
|
|
262
|
+
'primary',
|
|
263
|
+
'secondary',
|
|
264
|
+
'negative',
|
|
265
|
+
'negativeQuiet',
|
|
266
|
+
'utility',
|
|
267
|
+
'utilityQuiet',
|
|
268
|
+
'quiet',
|
|
269
|
+
'link',
|
|
270
|
+
'overlay',
|
|
271
|
+
'overlayInverted',
|
|
272
|
+
'overlayQuiet',
|
|
273
|
+
'overlayInvertedQuiet',
|
|
274
|
+
'pill',
|
|
275
|
+
];
|
|
276
|
+
return html `
|
|
277
|
+
<div style="display:grid; gap: 16px;">
|
|
278
|
+
<div style="font: 12px/1.4 system-ui; opacity: 0.8;">
|
|
279
|
+
Loading should look the same no matter the variant.
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
<div style="display:flex; flex-wrap: wrap; gap: 12px;">
|
|
283
|
+
${variants.map((v) => html `<w-button variant=${v} loading type="button">${v}</w-button>`)}
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
`;
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* This targets the known tricky path:
|
|
291
|
+
* w-button with href renders w-link (back-compat).
|
|
292
|
+
* Great for spotting:
|
|
293
|
+
* - hover gray bg (should not happen for "link" look)
|
|
294
|
+
* - double padding when link is rendered inside button styling assumptions
|
|
295
|
+
*/
|
|
296
|
+
export const HrefModeRegression = {
|
|
297
|
+
args: {},
|
|
298
|
+
render() {
|
|
299
|
+
return html `
|
|
300
|
+
<div style="display:grid; gap: 12px;">
|
|
301
|
+
<div style="font: 12px/1.4 system-ui; opacity: 0.8;">
|
|
302
|
+
<code>w-button[href]</code> renders <code>w-link</code> (backwards compatibility path).
|
|
303
|
+
Hover these and check for unwanted gray backgrounds / padding.
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
<div style="display:flex; gap: 12px; flex-wrap: wrap;">
|
|
307
|
+
<w-button variant="primary" href="https://example.com" target="_blank" type="button">primary href</w-button>
|
|
308
|
+
<w-button variant="overlay" href="https://example.com" target="_blank" type="button">overlay href</w-button>
|
|
309
|
+
<w-button variant="overlayQuiet" href="https://example.com" target="_blank" type="button"
|
|
310
|
+
>overlayQuiet href</w-button
|
|
311
|
+
>
|
|
312
|
+
<w-button variant="overlayInvertedQuiet" href="https://example.com" target="_blank" type="button"
|
|
313
|
+
>overlayInvertedQuiet href</w-button
|
|
314
|
+
>
|
|
315
|
+
<w-button variant="link" href="https://example.com" target="_blank" type="button">link href</w-button>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
`;
|
|
319
|
+
},
|
|
320
|
+
};
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Shared base tokens used by both w-button and w-link.
|
|
3
|
+
* These define the internal CSS variables that map component tokens to semantic tokens.
|
|
4
|
+
*/
|
|
5
|
+
export declare const buttonSharedBase: import("lit").CSSResult;
|
|
6
|
+
/**
|
|
7
|
+
* Shared variant styles used by both w-button and w-link.
|
|
8
|
+
* These set component tokens for different visual styles.
|
|
9
|
+
*/
|
|
10
|
+
export declare const buttonSharedVariants: import("lit").CSSResult;
|
|
11
|
+
/**
|
|
12
|
+
* Shared sizing styles used by both w-button and w-link.
|
|
13
|
+
*/
|
|
14
|
+
export declare const buttonSharedSizing: import("lit").CSSResult;
|
|
15
|
+
/**
|
|
16
|
+
* Shared disabled state used by both w-button and w-link.
|
|
17
|
+
*/
|
|
18
|
+
export declare const buttonSharedDisabled: import("lit").CSSResult;
|
|
19
|
+
/**
|
|
20
|
+
* Complete w-button styles (shared + button-specific).
|
|
21
|
+
*/
|
|
22
|
+
export declare const wButtonStyles: import("lit").CSSResult;
|
|
@@ -1,2 +1,391 @@
|
|
|
1
|
+
/* packages/button/styles.ts */
|
|
1
2
|
import { css } from 'lit';
|
|
2
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Shared base tokens used by both w-button and w-link.
|
|
5
|
+
* These define the internal CSS variables that map component tokens to semantic tokens.
|
|
6
|
+
*/
|
|
7
|
+
export const buttonSharedBase = css `
|
|
8
|
+
:host {
|
|
9
|
+
display: inline-block;
|
|
10
|
+
|
|
11
|
+
/* Internal resolved vars (defaults) */
|
|
12
|
+
--_bg: var(--w-c-button-bg, var(--w-s-color-background));
|
|
13
|
+
--_bg-hover: var(--w-c-button-bg-hover, var(--w-s-color-background-hover));
|
|
14
|
+
--_bg-active: var(--w-c-button-bg-active, var(--w-s-color-background-active));
|
|
15
|
+
|
|
16
|
+
--_color: var(--w-c-button-color, var(--w-s-color-text-link));
|
|
17
|
+
--_color-hover: var(--w-c-button-color-hover, var(--_color));
|
|
18
|
+
--_color-active: var(--w-c-button-color-active, var(--_color));
|
|
19
|
+
|
|
20
|
+
--_border-width: var(--w-c-button-border-width, 2px);
|
|
21
|
+
--_border-color: var(--w-c-button-border-color, var(--w-s-color-border));
|
|
22
|
+
--_border-color-hover: var(--w-c-button-border-color-hover, var(--w-s-color-border-hover));
|
|
23
|
+
--_border-color-active: var(--w-c-button-border-color-active, var(--w-s-color-border-active));
|
|
24
|
+
|
|
25
|
+
--_radius: var(--w-c-button-radius, 8px);
|
|
26
|
+
|
|
27
|
+
--_font-size: var(--w-c-button-font-size, var(--w-font-size-m));
|
|
28
|
+
--_line-height: var(--w-c-button-line-height, var(--w-line-height-m));
|
|
29
|
+
--_font-weight: var(--w-c-button-font-weight, 700);
|
|
30
|
+
|
|
31
|
+
--_pad-x: var(--w-c-button-padding-x, 16px);
|
|
32
|
+
--_pad-y: var(--w-c-button-padding-y, 13px);
|
|
33
|
+
|
|
34
|
+
--_outline-width: var(--w-c-button-outline-width, 2px);
|
|
35
|
+
--_outline-color: var(--w-c-button-outline-color, var(--w-s-color-border-focus));
|
|
36
|
+
--_outline-offset: var(--w-c-button-outline-offset, var(--w-outline-offset, 1px));
|
|
37
|
+
|
|
38
|
+
--_transition: var(
|
|
39
|
+
--w-c-button-transition,
|
|
40
|
+
color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
41
|
+
background-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
|
|
42
|
+
border-color 150ms cubic-bezier(0.4, 0, 0.2, 1)
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
/* Icon color for pill/icon-only variants (semantic; default dark grey icon) */
|
|
46
|
+
--w-c-button-icon-color: var(--w-s-color-icon);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host(:focus-visible) {
|
|
50
|
+
outline: none;
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
/**
|
|
54
|
+
* Shared variant styles used by both w-button and w-link.
|
|
55
|
+
* These set component tokens for different visual styles.
|
|
56
|
+
*/
|
|
57
|
+
export const buttonSharedVariants = css `
|
|
58
|
+
:host([variant='primary']) {
|
|
59
|
+
--w-c-button-bg: var(--w-s-color-background-primary);
|
|
60
|
+
--w-c-button-bg-hover: var(--w-s-color-background-primary-hover);
|
|
61
|
+
--w-c-button-bg-active: var(--w-s-color-background-primary-active);
|
|
62
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
63
|
+
--w-c-button-border-width: 0px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([variant='negative']) {
|
|
67
|
+
--w-c-button-bg: var(--w-s-color-background-negative);
|
|
68
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-hover);
|
|
69
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-active);
|
|
70
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
71
|
+
--w-c-button-border-width: 0px;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([variant='negativeQuiet']) {
|
|
75
|
+
--w-c-button-bg: transparent;
|
|
76
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
77
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-subtle-active);
|
|
78
|
+
--w-c-button-color: var(--w-s-color-text-negative);
|
|
79
|
+
--w-c-button-border-width: 0px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([variant='utility']) {
|
|
83
|
+
--w-c-button-bg: var(--w-s-color-background);
|
|
84
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
85
|
+
--w-c-button-radius: 4px;
|
|
86
|
+
--w-c-button-border-width: 1px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
:host([variant='utilityQuiet']) {
|
|
90
|
+
--w-c-button-bg: transparent;
|
|
91
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
92
|
+
--w-c-button-border-width: 0px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:host([variant='quiet']) {
|
|
96
|
+
--w-c-button-bg: transparent;
|
|
97
|
+
--w-c-button-border-width: 0px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host([variant='overlay']) {
|
|
101
|
+
--w-c-button-bg: var(--w-s-color-background);
|
|
102
|
+
--w-c-button-bg-hover: var(--w-s-color-background-hover);
|
|
103
|
+
--w-c-button-bg-active: var(--w-s-color-background-active);
|
|
104
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
105
|
+
--w-c-button-radius: 9999px;
|
|
106
|
+
--w-c-button-border-width: 0px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:host([variant='overlayInverted']) {
|
|
110
|
+
--w-c-button-bg: var(--w-s-color-background-inverted);
|
|
111
|
+
--w-c-button-bg-hover: var(--w-s-color-background-inverted-hover);
|
|
112
|
+
--w-c-button-bg-active: var(--w-s-color-background-inverted-active);
|
|
113
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
114
|
+
--w-c-button-radius: 9999px;
|
|
115
|
+
--w-c-button-border-width: 0px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host([variant='overlayQuiet']) {
|
|
119
|
+
--w-c-button-bg: transparent;
|
|
120
|
+
--w-c-button-bg-hover: var(--w-s-color-background-hover);
|
|
121
|
+
--w-c-button-bg-active: var(--w-s-color-background-active);
|
|
122
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
123
|
+
--w-c-button-radius: 9999px;
|
|
124
|
+
--w-c-button-border-width: 0px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:host([variant='overlayInvertedQuiet']) {
|
|
128
|
+
--w-c-button-bg: transparent;
|
|
129
|
+
--w-c-button-bg-hover: var(--w-s-color-background-inverted-hover);
|
|
130
|
+
--w-c-button-bg-active: var(--w-s-color-background-inverted-active);
|
|
131
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
132
|
+
--w-c-button-radius: 9999px;
|
|
133
|
+
--w-c-button-border-width: 0px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:host([variant='link']) {
|
|
137
|
+
--w-c-button-bg: transparent;
|
|
138
|
+
--w-c-button-border-width: 0px;
|
|
139
|
+
--w-c-button-padding-x: 0px;
|
|
140
|
+
--w-c-button-padding-y: 0px;
|
|
141
|
+
--w-c-button-font-weight: 400;
|
|
142
|
+
|
|
143
|
+
--w-c-button-bg-hover: transparent;
|
|
144
|
+
--w-c-button-bg-active: transparent;
|
|
145
|
+
|
|
146
|
+
--w-c-button-color: var(--w-s-color-text-link);
|
|
147
|
+
--w-c-button-color-hover: var(--w-s-color-text-link-hover, var(--w-c-button-color));
|
|
148
|
+
--w-c-button-color-active: var(--w-s-color-text-link-active, var(--w-c-button-color));
|
|
149
|
+
}
|
|
150
|
+
`;
|
|
151
|
+
/**
|
|
152
|
+
* Shared sizing styles used by both w-button and w-link.
|
|
153
|
+
*/
|
|
154
|
+
export const buttonSharedSizing = css `
|
|
155
|
+
:host([small]) {
|
|
156
|
+
--w-c-button-padding-x: 12px;
|
|
157
|
+
--w-c-button-padding-y: 8px;
|
|
158
|
+
--w-c-button-font-size: var(--w-font-size-xs);
|
|
159
|
+
--w-c-button-line-height: var(--w-line-height-xs);
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
/**
|
|
163
|
+
* Shared disabled state used by both w-button and w-link.
|
|
164
|
+
*/
|
|
165
|
+
export const buttonSharedDisabled = css `
|
|
166
|
+
:host([disabled]) {
|
|
167
|
+
pointer-events: none;
|
|
168
|
+
|
|
169
|
+
--w-c-button-bg: var(--w-s-color-background-disabled);
|
|
170
|
+
--w-c-button-bg-hover: var(--w-s-color-background-disabled);
|
|
171
|
+
--w-c-button-bg-active: var(--w-s-color-background-disabled);
|
|
172
|
+
|
|
173
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
174
|
+
--w-c-button-border-width: 0px;
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
/**
|
|
178
|
+
* Complete w-button styles (shared + button-specific).
|
|
179
|
+
*/
|
|
180
|
+
export const wButtonStyles = css `
|
|
181
|
+
${buttonSharedBase}
|
|
182
|
+
|
|
183
|
+
/* ============================================================
|
|
184
|
+
* Base element (NATIVE button mode ONLY)
|
|
185
|
+
* ============================================================ */
|
|
186
|
+
button[part='base'] {
|
|
187
|
+
display: inline-flex;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
align-items: center;
|
|
190
|
+
text-align: center;
|
|
191
|
+
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
|
|
194
|
+
background-color: var(--_bg);
|
|
195
|
+
color: var(--_color);
|
|
196
|
+
|
|
197
|
+
border: var(--_border-width) solid var(--_border-color);
|
|
198
|
+
border-radius: var(--_radius);
|
|
199
|
+
|
|
200
|
+
padding: calc(var(--_pad-y) - var(--_border-width))
|
|
201
|
+
calc(var(--_pad-x) - var(--_border-width));
|
|
202
|
+
|
|
203
|
+
font-size: var(--_font-size);
|
|
204
|
+
line-height: var(--_line-height);
|
|
205
|
+
font-weight: var(--_font-weight);
|
|
206
|
+
|
|
207
|
+
transition: var(--_transition);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* Optional: helps avoid "grew a bit" from slot typography differences */
|
|
211
|
+
button[part='base'] ::slotted(*) {
|
|
212
|
+
line-height: inherit;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* ============================================================
|
|
216
|
+
* Link mode wrapper (w-link host carries part="base" in button.ts)
|
|
217
|
+
* Keep it layout-only to avoid double chrome.
|
|
218
|
+
* ============================================================ */
|
|
219
|
+
:host > w-link[part='base'] {
|
|
220
|
+
display: inline-block;
|
|
221
|
+
padding: 0;
|
|
222
|
+
border: 0;
|
|
223
|
+
background: transparent;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* Hover / active (native button mode only) */
|
|
227
|
+
:host(:not([disabled]):not([loading])) button[part='base']:hover {
|
|
228
|
+
background-color: var(--_bg-hover);
|
|
229
|
+
border-color: var(--_border-color-hover);
|
|
230
|
+
color: var(--_color-hover);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
:host(:not([disabled]):not([loading])) button[part='base']:active {
|
|
234
|
+
background-color: var(--_bg-active);
|
|
235
|
+
border-color: var(--_border-color-active);
|
|
236
|
+
color: var(--_color-active);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
:host(:focus-visible) button[part='base'] {
|
|
240
|
+
outline: var(--_outline-width) solid var(--_outline-color);
|
|
241
|
+
outline-offset: var(--_outline-offset);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* ============================================================
|
|
245
|
+
* Variants (shared + button-specific quiet mappings)
|
|
246
|
+
* ============================================================ */
|
|
247
|
+
${buttonSharedVariants}
|
|
248
|
+
|
|
249
|
+
/* Button-specific: quiet attribute backwards compatibility */
|
|
250
|
+
:host([variant='negative'][quiet]) {
|
|
251
|
+
--w-c-button-bg: transparent;
|
|
252
|
+
--w-c-button-bg-hover: var(--w-s-color-background-negative-subtle-hover);
|
|
253
|
+
--w-c-button-bg-active: var(--w-s-color-background-negative-subtle-active);
|
|
254
|
+
--w-c-button-color: var(--w-s-color-text-negative);
|
|
255
|
+
--w-c-button-border-width: 0px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:host([variant='utility'][quiet]) {
|
|
259
|
+
--w-c-button-bg: transparent;
|
|
260
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
261
|
+
--w-c-button-border-width: 0px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* Button-specific: pill variant */
|
|
265
|
+
:host([variant='pill']) {
|
|
266
|
+
--w-c-button-bg: transparent;
|
|
267
|
+
--w-c-button-radius: 50%;
|
|
268
|
+
--w-c-button-border-width: 0px;
|
|
269
|
+
--w-c-button-padding-x: 14px;
|
|
270
|
+
--w-c-button-padding-y: 14px;
|
|
271
|
+
|
|
272
|
+
/* pill uses semantic icon color (dark grey by default) */
|
|
273
|
+
--w-c-button-color: var(--w-c-button-icon-color, var(--w-s-color-icon));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* Button-specific: link variant element styles */
|
|
277
|
+
:host([variant='link']) button[part='base'] {
|
|
278
|
+
display: inline;
|
|
279
|
+
padding: 0;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
:host([variant='link']:not([disabled]):not([loading])) button[part='base']:hover {
|
|
283
|
+
text-decoration: underline;
|
|
284
|
+
background-color: transparent;
|
|
285
|
+
border-color: transparent;
|
|
286
|
+
color: var(--w-c-button-color-hover);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* ===== Size ===== */
|
|
290
|
+
${buttonSharedSizing}
|
|
291
|
+
|
|
292
|
+
:host([small][variant='pill']) {
|
|
293
|
+
--w-c-button-padding-x: 8px;
|
|
294
|
+
--w-c-button-padding-y: 8px;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* ===== Layout ===== */
|
|
298
|
+
|
|
299
|
+
:host([full-width]) button[part='base'],
|
|
300
|
+
:host([full-width]) > w-link[part='base'] {
|
|
301
|
+
width: 100%;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
:host([icon-only]) button[part='base'] {
|
|
305
|
+
aspect-ratio: 1 / 1;
|
|
306
|
+
padding-left: calc(var(--w-c-button-padding-y) - var(--w-c-button-border-width, 0px));
|
|
307
|
+
padding-right: calc(var(--w-c-button-padding-y) - var(--w-c-button-border-width, 0px));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* ============================================================
|
|
311
|
+
* STATE OVERRIDES (must be last so they win over variants)
|
|
312
|
+
* Disabled first, Loading last (loading is disabled-like + visuals)
|
|
313
|
+
*
|
|
314
|
+
* IMPORTANT:
|
|
315
|
+
* Some variant selectors are more specific (e.g. [variant='negative']:not([quiet])).
|
|
316
|
+
* To ensure states always win, we match similar specificity via extra attribute selectors.
|
|
317
|
+
* ============================================================ */
|
|
318
|
+
|
|
319
|
+
/* ===== Disabled ===== */
|
|
320
|
+
${buttonSharedDisabled}
|
|
321
|
+
|
|
322
|
+
/* Additional specificity for button to override quiet variants */
|
|
323
|
+
:host([disabled][variant]),
|
|
324
|
+
:host([disabled][quiet]) {
|
|
325
|
+
--w-c-button-bg: var(--w-s-color-background-disabled);
|
|
326
|
+
--w-c-button-bg-hover: var(--w-s-color-background-disabled);
|
|
327
|
+
--w-c-button-bg-active: var(--w-s-color-background-disabled);
|
|
328
|
+
|
|
329
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
330
|
+
|
|
331
|
+
--w-c-button-border-width: 0px;
|
|
332
|
+
--w-c-button-border-color: transparent;
|
|
333
|
+
--w-c-button-border-color-hover: transparent;
|
|
334
|
+
--w-c-button-border-color-active: transparent;
|
|
335
|
+
|
|
336
|
+
--w-c-button-color-hover: var(--w-s-color-text-inverted);
|
|
337
|
+
--w-c-button-color-active: var(--w-s-color-text-inverted);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* ===== Loading (wins over everything) ===== */
|
|
341
|
+
:host([loading]),
|
|
342
|
+
:host([loading][variant]),
|
|
343
|
+
:host([loading][quiet]) {
|
|
344
|
+
pointer-events: none;
|
|
345
|
+
|
|
346
|
+
/* Strong overrides so variants can't leak through */
|
|
347
|
+
--w-c-button-bg: var(--w-s-color-background-subtle);
|
|
348
|
+
--w-c-button-bg-hover: var(--w-s-color-background-subtle);
|
|
349
|
+
--w-c-button-bg-active: var(--w-s-color-background-subtle);
|
|
350
|
+
|
|
351
|
+
--w-c-button-color: var(--w-s-color-text);
|
|
352
|
+
--w-c-button-color-hover: var(--w-s-color-text);
|
|
353
|
+
--w-c-button-color-active: var(--w-s-color-text);
|
|
354
|
+
|
|
355
|
+
--w-c-button-border-width: 0px;
|
|
356
|
+
--w-c-button-border-color: transparent;
|
|
357
|
+
--w-c-button-border-color-hover: transparent;
|
|
358
|
+
--w-c-button-border-color-active: transparent;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* Loading stripes (native button mode only) */
|
|
362
|
+
:host([loading]) button[part='base'] {
|
|
363
|
+
background-image: linear-gradient(
|
|
364
|
+
135deg,
|
|
365
|
+
rgba(0, 0, 0, 0.05) 25%,
|
|
366
|
+
transparent 25%,
|
|
367
|
+
transparent 50%,
|
|
368
|
+
rgba(0, 0, 0, 0.05) 50%,
|
|
369
|
+
rgba(0, 0, 0, 0.05) 75%,
|
|
370
|
+
transparent 75%,
|
|
371
|
+
transparent
|
|
372
|
+
);
|
|
373
|
+
background-size: 30px 30px;
|
|
374
|
+
animation: animate-inprogress 3s linear infinite;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
@media (prefers-reduced-motion: reduce) {
|
|
378
|
+
:host([loading]) button[part='base'] {
|
|
379
|
+
animation: none;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
@keyframes animate-inprogress {
|
|
384
|
+
0% {
|
|
385
|
+
background-position: 0 0;
|
|
386
|
+
}
|
|
387
|
+
100% {
|
|
388
|
+
background-position: 60px 0;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
|
|
2
2
|
import { setupHydrationWarningCapture, testHydration } from '../../tests/react-hydration';
|
|
3
3
|
import './card.js';
|
|
4
4
|
describe('w-card React SSR hydration', () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
-
declare const
|
|
2
|
+
declare const WarpCheckbox_base: import("@open-wc/form-control").Constructor<import("@open-wc/form-control").FormControlInterface> & typeof LitElement;
|
|
3
3
|
/**
|
|
4
4
|
* @parent w-checkbox-group
|
|
5
5
|
*/
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class WarpCheckbox extends WarpCheckbox_base {
|
|
7
7
|
#private;
|
|
8
8
|
static styles: import("lit").CSSResult[];
|
|
9
9
|
static shadowRootOptions: {
|
|
@@ -88,9 +88,11 @@ export declare class WCheckbox extends WCheckbox_base {
|
|
|
88
88
|
reportValidity(): boolean;
|
|
89
89
|
render(): import("lit").TemplateResult<1>;
|
|
90
90
|
}
|
|
91
|
+
/** @deprecated Use WarpCheckbox */
|
|
92
|
+
export declare const WCheckbox: typeof WarpCheckbox;
|
|
91
93
|
declare global {
|
|
92
94
|
interface HTMLElementTagNameMap {
|
|
93
|
-
'w-checkbox':
|
|
95
|
+
'w-checkbox': WarpCheckbox;
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
|
|
2
2
|
import { setupHydrationWarningCapture, testHydration } from '../../tests/react-hydration';
|
|
3
3
|
import './checkbox.js';
|
|
4
4
|
describe('w-checkbox React SSR hydration', () => {
|