@warp-ds/elements 2.10.0-next.4 → 2.10.0-next.6
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/README.md +4 -0
- package/dist/custom-elements.json +68 -14
- package/dist/docs/affix/affix.md +2 -2
- package/dist/docs/affix/styling.md +1 -0
- package/dist/docs/alert/alert.md +2 -2
- 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 -40
- package/dist/docs/box/examples.md +20 -38
- package/dist/docs/box/styling.md +1 -0
- package/dist/docs/breadcrumbs/breadcrumbs.md +8 -2
- package/dist/docs/breadcrumbs/examples.md +7 -1
- package/dist/docs/breadcrumbs/styling.md +1 -0
- package/dist/docs/button/button.md +73 -2
- package/dist/docs/button/styling.md +72 -0
- package/dist/docs/card/card.md +2 -2
- 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 -2
- 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 -16
- 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 +3 -1
- package/dist/docs/icon/styling.md +1 -0
- package/dist/docs/index.md +46 -0
- package/dist/docs/link/link.md +2 -2
- 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 +1 -7
- 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.hydration.test.js +1 -1
- 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 -7
- 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
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
### Basic
|
|
4
4
|
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<h2 id="delivery-heading">Delivery</h2>
|
|
8
|
-
<p>Choose how you want the item delivered.</p>
|
|
9
|
-
</w-box>
|
|
10
|
-
</style-isolate>
|
|
11
|
-
|
|
5
|
+
<elements-example>
|
|
6
|
+
|
|
12
7
|
```html
|
|
13
8
|
<w-box aria-labelledby="delivery-heading">
|
|
14
9
|
<h2 id="delivery-heading">Delivery</h2>
|
|
@@ -16,14 +11,11 @@
|
|
|
16
11
|
</w-box>
|
|
17
12
|
```
|
|
18
13
|
|
|
14
|
+
</elements-example>
|
|
15
|
+
|
|
19
16
|
### Neutral
|
|
20
17
|
|
|
21
|
-
<
|
|
22
|
-
<w-box neutral aria-labelledby="order-summary-heading">
|
|
23
|
-
<h2 id="order-summary-heading">Order summary</h2>
|
|
24
|
-
<p>Review the item price, delivery, and total before continuing.</p>
|
|
25
|
-
</w-box>
|
|
26
|
-
</style-isolate>
|
|
18
|
+
<elements-example>
|
|
27
19
|
|
|
28
20
|
```html
|
|
29
21
|
<w-box neutral aria-labelledby="order-summary-heading">
|
|
@@ -32,14 +24,11 @@
|
|
|
32
24
|
</w-box>
|
|
33
25
|
```
|
|
34
26
|
|
|
27
|
+
</elements-example>
|
|
28
|
+
|
|
35
29
|
### Info
|
|
36
30
|
|
|
37
|
-
<
|
|
38
|
-
<w-box info aria-labelledby="good-to-know-heading">
|
|
39
|
-
<h2 id="good-to-know-heading">Good to know</h2>
|
|
40
|
-
<p>You can change the delivery method before payment.</p>
|
|
41
|
-
</w-box>
|
|
42
|
-
</style-isolate>
|
|
31
|
+
<elements-example>
|
|
43
32
|
|
|
44
33
|
```html
|
|
45
34
|
<w-box info aria-labelledby="good-to-know-heading">
|
|
@@ -48,14 +37,11 @@
|
|
|
48
37
|
</w-box>
|
|
49
38
|
```
|
|
50
39
|
|
|
40
|
+
</elements-example>
|
|
41
|
+
|
|
51
42
|
### Bordered
|
|
52
43
|
|
|
53
|
-
<
|
|
54
|
-
<w-box bordered aria-labelledby="contact-seller-heading">
|
|
55
|
-
<h2 id="contact-seller-heading">Contact seller</h2>
|
|
56
|
-
<p>Send a message to ask about pickup times.</p>
|
|
57
|
-
</w-box>
|
|
58
|
-
</style-isolate>
|
|
44
|
+
<elements-example>
|
|
59
45
|
|
|
60
46
|
```html
|
|
61
47
|
<w-box bordered aria-labelledby="contact-seller-heading">
|
|
@@ -64,16 +50,11 @@
|
|
|
64
50
|
</w-box>
|
|
65
51
|
```
|
|
66
52
|
|
|
53
|
+
</elements-example>
|
|
54
|
+
|
|
67
55
|
### Bleed
|
|
68
56
|
|
|
69
|
-
<
|
|
70
|
-
<div style="padding: 0 16px;">
|
|
71
|
-
<w-box neutral bleed aria-labelledby="summary-heading">
|
|
72
|
-
<h2 id="summary-heading">Summary</h2>
|
|
73
|
-
<p>This box extends into the horizontal gutter on narrow screens.</p>
|
|
74
|
-
</w-box>
|
|
75
|
-
</div>
|
|
76
|
-
</style-isolate>
|
|
57
|
+
<elements-example>
|
|
77
58
|
|
|
78
59
|
```html
|
|
79
60
|
<div style="padding: 0 16px;">
|
|
@@ -84,16 +65,17 @@
|
|
|
84
65
|
</div>
|
|
85
66
|
```
|
|
86
67
|
|
|
68
|
+
</elements-example>
|
|
69
|
+
|
|
70
|
+
|
|
87
71
|
### Visual Grouping Without Accessibility Landmarking
|
|
88
72
|
|
|
89
|
-
<
|
|
90
|
-
<w-box role="none">
|
|
91
|
-
<p>This box is only a visual container.</p>
|
|
92
|
-
</w-box>
|
|
93
|
-
</style-isolate>
|
|
73
|
+
<elements-example>
|
|
94
74
|
|
|
95
75
|
```html
|
|
96
76
|
<w-box role="none">
|
|
97
77
|
<p>This box is only a visual container.</p>
|
|
98
78
|
</w-box>
|
|
99
79
|
```
|
|
80
|
+
|
|
81
|
+
</elements-example>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## Styling API
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
Shows the navigation structure for the current page.
|
|
6
6
|
Renders direct child links and non-link elements as a breadcrumb trail, inserts separators between items, and exposes the trail as navigation.
|
|
7
7
|
|
|
8
|
-
[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-breadcrumbs--docs)
|
|
9
|
-
|
|
10
8
|
## Usage
|
|
11
9
|
|
|
12
10
|
Breadcrumbs show where the current page sits in a site hierarchy and let users move back to parent pages.
|
|
@@ -98,6 +96,7 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
|
|
|
98
96
|
### Basic
|
|
99
97
|
|
|
100
98
|
<elements-example>
|
|
99
|
+
|
|
101
100
|
```html
|
|
102
101
|
<w-breadcrumbs>
|
|
103
102
|
<a href="#/real-estate">Real estate</a>
|
|
@@ -105,11 +104,13 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
|
|
|
105
104
|
<span aria-current="page">Oslo</span>
|
|
106
105
|
</w-breadcrumbs>
|
|
107
106
|
```
|
|
107
|
+
|
|
108
108
|
</elements-example>
|
|
109
109
|
|
|
110
110
|
### Custom Accessible Label
|
|
111
111
|
|
|
112
112
|
<elements-example>
|
|
113
|
+
|
|
113
114
|
```html
|
|
114
115
|
<w-breadcrumbs aria-label="Product category path">
|
|
115
116
|
<a href="#/marketplace">Marketplace</a>
|
|
@@ -117,19 +118,24 @@ Breadcrumbs should support orientation within the site hierarchy. They should no
|
|
|
117
118
|
<span aria-current="page">Sofas</span>
|
|
118
119
|
</w-breadcrumbs>
|
|
119
120
|
```
|
|
121
|
+
|
|
120
122
|
</elements-example>
|
|
121
123
|
|
|
122
124
|
### Short Path
|
|
123
125
|
|
|
124
126
|
<elements-example>
|
|
127
|
+
|
|
125
128
|
```html
|
|
126
129
|
<w-breadcrumbs>
|
|
127
130
|
<a href="#/help">Help</a>
|
|
128
131
|
<span aria-current="page">Contact us</span>
|
|
129
132
|
</w-breadcrumbs>
|
|
130
133
|
```
|
|
134
|
+
|
|
131
135
|
</elements-example>
|
|
132
136
|
|
|
137
|
+
## Styling API
|
|
138
|
+
|
|
133
139
|
## `<w-breadcrumbs>` API
|
|
134
140
|
|
|
135
141
|
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
### Basic
|
|
4
4
|
|
|
5
5
|
<elements-example>
|
|
6
|
+
|
|
6
7
|
```html
|
|
7
8
|
<w-breadcrumbs>
|
|
8
9
|
<a href="#/real-estate">Real estate</a>
|
|
@@ -10,11 +11,13 @@
|
|
|
10
11
|
<span aria-current="page">Oslo</span>
|
|
11
12
|
</w-breadcrumbs>
|
|
12
13
|
```
|
|
14
|
+
|
|
13
15
|
</elements-example>
|
|
14
16
|
|
|
15
17
|
### Custom Accessible Label
|
|
16
18
|
|
|
17
19
|
<elements-example>
|
|
20
|
+
|
|
18
21
|
```html
|
|
19
22
|
<w-breadcrumbs aria-label="Product category path">
|
|
20
23
|
<a href="#/marketplace">Marketplace</a>
|
|
@@ -22,15 +25,18 @@
|
|
|
22
25
|
<span aria-current="page">Sofas</span>
|
|
23
26
|
</w-breadcrumbs>
|
|
24
27
|
```
|
|
28
|
+
|
|
25
29
|
</elements-example>
|
|
26
30
|
|
|
27
31
|
### Short Path
|
|
28
32
|
|
|
29
33
|
<elements-example>
|
|
34
|
+
|
|
30
35
|
```html
|
|
31
36
|
<w-breadcrumbs>
|
|
32
37
|
<a href="#/help">Help</a>
|
|
33
38
|
<span aria-current="page">Contact us</span>
|
|
34
39
|
</w-breadcrumbs>
|
|
35
40
|
```
|
|
36
|
-
|
|
41
|
+
|
|
42
|
+
</elements-example>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## Styling API
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
Performs an action or renders a link with button styling.
|
|
6
6
|
Use button variants to match action priority, risk, and context.
|
|
7
7
|
|
|
8
|
-
[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/buttons-button--docs)
|
|
9
|
-
|
|
10
8
|
## Usage
|
|
11
9
|
|
|
12
10
|
Button is used for actions. Use it when the user can submit, save, confirm, cancel, open, close, or trigger something on the current page.
|
|
@@ -270,6 +268,79 @@ For backwards compatibility, if `href` is set, `w-button` renders a link with bu
|
|
|
270
268
|
|
|
271
269
|
</elements-example>
|
|
272
270
|
|
|
271
|
+
## Styling API
|
|
272
|
+
|
|
273
|
+
This component supports styling through **component tokens** (CSS custom properties with a --w-c- prefix) and **parts**.
|
|
274
|
+
|
|
275
|
+
### Parts
|
|
276
|
+
|
|
277
|
+
Use `::part(...)` from outside the component.
|
|
278
|
+
|
|
279
|
+
- `base` — the clickable element (`<button>` or `<w-link>`)
|
|
280
|
+
|
|
281
|
+
Example:
|
|
282
|
+
|
|
283
|
+
```css
|
|
284
|
+
w-button::part(base) {
|
|
285
|
+
text-transform: uppercase;
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Component tokens
|
|
290
|
+
|
|
291
|
+
Set these on `w-button` to override visuals.
|
|
292
|
+
|
|
293
|
+
```css
|
|
294
|
+
w-button {
|
|
295
|
+
--w-c-button-bg: var(--w-s-color-background-primary);
|
|
296
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
#### Layout & typography
|
|
301
|
+
|
|
302
|
+
- `--w-c-button-radius`
|
|
303
|
+
- `--w-c-button-font-size`
|
|
304
|
+
- `--w-c-button-line-height`
|
|
305
|
+
- `--w-c-button-font-weight`
|
|
306
|
+
- `--w-c-button-padding-x`
|
|
307
|
+
- `--w-c-button-padding-y`
|
|
308
|
+
|
|
309
|
+
#### Background
|
|
310
|
+
|
|
311
|
+
- `--w-c-button-bg`
|
|
312
|
+
- `--w-c-button-bg-hover`
|
|
313
|
+
- `--w-c-button-bg-active`
|
|
314
|
+
|
|
315
|
+
#### Text color
|
|
316
|
+
|
|
317
|
+
- `--w-c-button-color`
|
|
318
|
+
- `--w-c-button-color-hover`
|
|
319
|
+
- `--w-c-button-color-active`
|
|
320
|
+
|
|
321
|
+
#### Border
|
|
322
|
+
|
|
323
|
+
- `--w-c-button-border-width`
|
|
324
|
+
- `--w-c-button-border-color`
|
|
325
|
+
- `--w-c-button-border-color-hover`
|
|
326
|
+
- `--w-c-button-border-color-active`
|
|
327
|
+
|
|
328
|
+
#### Focus
|
|
329
|
+
|
|
330
|
+
- `--w-c-button-outline-width`
|
|
331
|
+
- `--w-c-button-outline-color`
|
|
332
|
+
- `--w-c-button-outline-offset`
|
|
333
|
+
|
|
334
|
+
#### Motion
|
|
335
|
+
|
|
336
|
+
- `--w-c-button-transition`
|
|
337
|
+
|
|
338
|
+
### Notes
|
|
339
|
+
|
|
340
|
+
- Variant defaults are set internally using fallbacks, so overriding tokens works across variants.
|
|
341
|
+
- The `quiet` boolean is supported for backwards compatibility. Prefer `variant="quiet"` going forward.
|
|
342
|
+
- When `loading` is set, the button is treated as disabled (no pointer interaction).
|
|
343
|
+
|
|
273
344
|
## `<w-button>` API
|
|
274
345
|
|
|
275
346
|
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
## Styling API
|
|
2
|
+
|
|
3
|
+
This component supports styling through **component tokens** (CSS custom properties with a --w-c- prefix) and **parts**.
|
|
4
|
+
|
|
5
|
+
### Parts
|
|
6
|
+
|
|
7
|
+
Use `::part(...)` from outside the component.
|
|
8
|
+
|
|
9
|
+
- `base` — the clickable element (`<button>` or `<w-link>`)
|
|
10
|
+
|
|
11
|
+
Example:
|
|
12
|
+
|
|
13
|
+
```css
|
|
14
|
+
w-button::part(base) {
|
|
15
|
+
text-transform: uppercase;
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Component tokens
|
|
20
|
+
|
|
21
|
+
Set these on `w-button` to override visuals.
|
|
22
|
+
|
|
23
|
+
```css
|
|
24
|
+
w-button {
|
|
25
|
+
--w-c-button-bg: var(--w-s-color-background-primary);
|
|
26
|
+
--w-c-button-color: var(--w-s-color-text-inverted);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
#### Layout & typography
|
|
31
|
+
|
|
32
|
+
- `--w-c-button-radius`
|
|
33
|
+
- `--w-c-button-font-size`
|
|
34
|
+
- `--w-c-button-line-height`
|
|
35
|
+
- `--w-c-button-font-weight`
|
|
36
|
+
- `--w-c-button-padding-x`
|
|
37
|
+
- `--w-c-button-padding-y`
|
|
38
|
+
|
|
39
|
+
#### Background
|
|
40
|
+
|
|
41
|
+
- `--w-c-button-bg`
|
|
42
|
+
- `--w-c-button-bg-hover`
|
|
43
|
+
- `--w-c-button-bg-active`
|
|
44
|
+
|
|
45
|
+
#### Text color
|
|
46
|
+
|
|
47
|
+
- `--w-c-button-color`
|
|
48
|
+
- `--w-c-button-color-hover`
|
|
49
|
+
- `--w-c-button-color-active`
|
|
50
|
+
|
|
51
|
+
#### Border
|
|
52
|
+
|
|
53
|
+
- `--w-c-button-border-width`
|
|
54
|
+
- `--w-c-button-border-color`
|
|
55
|
+
- `--w-c-button-border-color-hover`
|
|
56
|
+
- `--w-c-button-border-color-active`
|
|
57
|
+
|
|
58
|
+
#### Focus
|
|
59
|
+
|
|
60
|
+
- `--w-c-button-outline-width`
|
|
61
|
+
- `--w-c-button-outline-color`
|
|
62
|
+
- `--w-c-button-outline-offset`
|
|
63
|
+
|
|
64
|
+
#### Motion
|
|
65
|
+
|
|
66
|
+
- `--w-c-button-transition`
|
|
67
|
+
|
|
68
|
+
### Notes
|
|
69
|
+
|
|
70
|
+
- Variant defaults are set internally using fallbacks, so overriding tokens works across variants.
|
|
71
|
+
- The `quiet` boolean is supported for backwards compatibility. Prefer `variant="quiet"` going forward.
|
|
72
|
+
- When `loading` is set, the button is treated as disabled (no pointer interaction).
|
package/dist/docs/card/card.md
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
Card is a layout component used for separating content areas on a page.
|
|
6
6
|
|
|
7
|
-
[See Storybook for usage examples](https://warp-ds.github.io/elements/?path=/docs/navigation-card--docs)
|
|
8
|
-
|
|
9
7
|
## Usage
|
|
10
8
|
|
|
11
9
|
Card is a layout component for visually grouping related content as one item.
|
|
@@ -237,6 +235,8 @@ Use a button for an action on the current page:
|
|
|
237
235
|
|
|
238
236
|
</elements-example>
|
|
239
237
|
|
|
238
|
+
## Styling API
|
|
239
|
+
|
|
240
240
|
## `<w-card>` API
|
|
241
241
|
|
|
242
242
|
Unless otherwise noted all properties are HTML attributes (as opposed to JavaScript object properties).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
## Styling API
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
### `<w-checkbox>` API
|
|
2
|
+
|
|
3
|
+
#### Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Default | Summary |
|
|
6
|
+
|-|-|-|-|
|
|
7
|
+
| _computedInvalid (JS only) | `boolean` | `-` | Computed invalid state: combines own invalid with group invalid |
|
|
8
|
+
| checked | `boolean` | `false` | Whether the checkbox is checked. |
|
|
9
|
+
| disabled | `boolean` | `false` | Whether the checkbox is disabled. |
|
|
10
|
+
| indeterminate | `boolean` | `false` | Whether the checkbox is visually indeterminate. |
|
|
11
|
+
| input (JS only) | `HTMLInputElement \| null` | `-` | - |
|
|
12
|
+
| invalid | `boolean` | `false` | Whether the checkbox is visually invalid. |
|
|
13
|
+
| name | `string \| undefined` | `-` | The name of the checkbox. |
|
|
14
|
+
| required | `boolean` | `false` | Whether the checkbox must be checked before form submission. |
|
|
15
|
+
| shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true }` | - |
|
|
16
|
+
| validationMessage (JS only) | `string` | `-` | Returns the validation message if the checkbox is invalid, otherwise an empty string |
|
|
17
|
+
| validity (JS only) | `ValidityState` | `-` | Returns the validity state of the checkbox |
|
|
18
|
+
| value | `string \| null` | `null` | The value submitted when the checkbox is checked. |
|
|
19
|
+
|
|
20
|
+
#### Property Details
|
|
21
|
+
|
|
22
|
+
##### _computedInvalid (JS only)
|
|
23
|
+
|
|
24
|
+
Computed invalid state: combines own invalid with group invalid
|
|
25
|
+
|
|
26
|
+
- Type: `boolean`
|
|
27
|
+
- Default: `-`
|
|
28
|
+
|
|
29
|
+
##### checked
|
|
30
|
+
|
|
31
|
+
Whether the checkbox is checked.
|
|
32
|
+
|
|
33
|
+
Checked checkboxes submit their value with form data. The property is reflected to the `checked` attribute.
|
|
34
|
+
|
|
35
|
+
- Type: `boolean`
|
|
36
|
+
- Default: `false`
|
|
37
|
+
|
|
38
|
+
##### disabled
|
|
39
|
+
|
|
40
|
+
Whether the checkbox is disabled.
|
|
41
|
+
|
|
42
|
+
Disabled checkboxes cannot be focused, changed, or submitted with form data.
|
|
43
|
+
|
|
44
|
+
- Type: `boolean`
|
|
45
|
+
- Default: `false`
|
|
46
|
+
|
|
47
|
+
##### indeterminate
|
|
48
|
+
|
|
49
|
+
Whether the checkbox is visually indeterminate.
|
|
50
|
+
|
|
51
|
+
Use this for parent options that represent a mixed set of child selections. Clicking the checkbox clears the indeterminate state and sets the checkbox to checked.
|
|
52
|
+
|
|
53
|
+
- Type: `boolean`
|
|
54
|
+
- Default: `false`
|
|
55
|
+
|
|
56
|
+
##### input (JS only)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
- Type: `HTMLInputElement | null`
|
|
61
|
+
- Default: `-`
|
|
62
|
+
|
|
63
|
+
##### invalid
|
|
64
|
+
|
|
65
|
+
Whether the checkbox is visually invalid.
|
|
66
|
+
|
|
67
|
+
Use this to show an externally managed validation error. Required validation also sets the invalid state after the user interacts with the checkbox or tries to submit the form.
|
|
68
|
+
|
|
69
|
+
- Type: `boolean`
|
|
70
|
+
- Default: `false`
|
|
71
|
+
|
|
72
|
+
##### name
|
|
73
|
+
|
|
74
|
+
The name of the checkbox.
|
|
75
|
+
|
|
76
|
+
When the checkbox is checked and belongs to a form, this name is submitted with the checkbox value. If the checkbox is inside a `w-checkbox-group` with a name, the group name is used when the checkbox does not have its own name.
|
|
77
|
+
|
|
78
|
+
- Type: `string | undefined`
|
|
79
|
+
- Default: `-`
|
|
80
|
+
|
|
81
|
+
##### required
|
|
82
|
+
|
|
83
|
+
Whether the checkbox must be checked before form submission.
|
|
84
|
+
|
|
85
|
+
A required checkbox is invalid until it is checked. For requiring at least one option in a set, use `required` on `w-checkbox-group`.
|
|
86
|
+
|
|
87
|
+
- Type: `boolean`
|
|
88
|
+
- Default: `false`
|
|
89
|
+
|
|
90
|
+
##### shadowRootOptions (JS only)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
- Type: `object`
|
|
95
|
+
- Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true }`
|
|
96
|
+
|
|
97
|
+
##### validationMessage (JS only)
|
|
98
|
+
|
|
99
|
+
Returns the validation message if the checkbox is invalid, otherwise an empty string
|
|
100
|
+
|
|
101
|
+
- Type: `string`
|
|
102
|
+
- Default: `-`
|
|
103
|
+
|
|
104
|
+
##### validity (JS only)
|
|
105
|
+
|
|
106
|
+
Returns the validity state of the checkbox
|
|
107
|
+
|
|
108
|
+
- Type: `ValidityState`
|
|
109
|
+
- Default: `-`
|
|
110
|
+
|
|
111
|
+
##### value
|
|
112
|
+
|
|
113
|
+
The value submitted when the checkbox is checked.
|
|
114
|
+
|
|
115
|
+
If no value attribute is set, the checkbox defaults to `on`. Unchecked and disabled checkboxes do not submit a value.
|
|
116
|
+
|
|
117
|
+
- Type: `string | null`
|
|
118
|
+
- Default: `null`
|
|
119
|
+
|
|
120
|
+
#### Events
|
|
121
|
+
|
|
122
|
+
##### change
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
- Type: `Event`
|
|
127
|
+
|
|
128
|
+
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Checkbox (w-checkbox)
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Checkbox lets users select one or more options. Use it for independent yes/no choices, multi-select lists, and terms or consent confirmations.
|
|
6
|
+
|
|
7
|
+
### `<w-checkbox>` API
|
|
8
|
+
|
|
9
|
+
#### Properties
|
|
10
|
+
|
|
11
|
+
| Name | Type | Default | Summary |
|
|
12
|
+
|-|-|-|-|
|
|
13
|
+
| _computedInvalid (JS only) | `boolean` | `-` | Computed invalid state: combines own invalid with group invalid |
|
|
14
|
+
| checked | `boolean` | `false` | Whether the checkbox is checked. |
|
|
15
|
+
| disabled | `boolean` | `false` | Whether the checkbox is disabled. |
|
|
16
|
+
| indeterminate | `boolean` | `false` | Whether the checkbox is visually indeterminate. |
|
|
17
|
+
| input (JS only) | `HTMLInputElement \| null` | `-` | - |
|
|
18
|
+
| invalid | `boolean` | `false` | Whether the checkbox is visually invalid. |
|
|
19
|
+
| name | `string \| undefined` | `-` | The name of the checkbox. |
|
|
20
|
+
| required | `boolean` | `false` | Whether the checkbox must be checked before form submission. |
|
|
21
|
+
| shadowRootOptions (JS only) | `object` | `{ ...LitElement.shadowRootOptions, delegatesFocus: true }` | - |
|
|
22
|
+
| validationMessage (JS only) | `string` | `-` | Returns the validation message if the checkbox is invalid, otherwise an empty string |
|
|
23
|
+
| validity (JS only) | `ValidityState` | `-` | Returns the validity state of the checkbox |
|
|
24
|
+
| value | `string \| null` | `null` | The value submitted when the checkbox is checked. |
|
|
25
|
+
|
|
26
|
+
#### Property Details
|
|
27
|
+
|
|
28
|
+
##### _computedInvalid (JS only)
|
|
29
|
+
|
|
30
|
+
Computed invalid state: combines own invalid with group invalid
|
|
31
|
+
|
|
32
|
+
- Type: `boolean`
|
|
33
|
+
- Default: `-`
|
|
34
|
+
|
|
35
|
+
##### checked
|
|
36
|
+
|
|
37
|
+
Whether the checkbox is checked.
|
|
38
|
+
|
|
39
|
+
Checked checkboxes submit their value with form data. The property is reflected to the `checked` attribute.
|
|
40
|
+
|
|
41
|
+
- Type: `boolean`
|
|
42
|
+
- Default: `false`
|
|
43
|
+
|
|
44
|
+
##### disabled
|
|
45
|
+
|
|
46
|
+
Whether the checkbox is disabled.
|
|
47
|
+
|
|
48
|
+
Disabled checkboxes cannot be focused, changed, or submitted with form data.
|
|
49
|
+
|
|
50
|
+
- Type: `boolean`
|
|
51
|
+
- Default: `false`
|
|
52
|
+
|
|
53
|
+
##### indeterminate
|
|
54
|
+
|
|
55
|
+
Whether the checkbox is visually indeterminate.
|
|
56
|
+
|
|
57
|
+
Use this for parent options that represent a mixed set of child selections. Clicking the checkbox clears the indeterminate state and sets the checkbox to checked.
|
|
58
|
+
|
|
59
|
+
- Type: `boolean`
|
|
60
|
+
- Default: `false`
|
|
61
|
+
|
|
62
|
+
##### input (JS only)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
- Type: `HTMLInputElement | null`
|
|
67
|
+
- Default: `-`
|
|
68
|
+
|
|
69
|
+
##### invalid
|
|
70
|
+
|
|
71
|
+
Whether the checkbox is visually invalid.
|
|
72
|
+
|
|
73
|
+
Use this to show an externally managed validation error. Required validation also sets the invalid state after the user interacts with the checkbox or tries to submit the form.
|
|
74
|
+
|
|
75
|
+
- Type: `boolean`
|
|
76
|
+
- Default: `false`
|
|
77
|
+
|
|
78
|
+
##### name
|
|
79
|
+
|
|
80
|
+
The name of the checkbox.
|
|
81
|
+
|
|
82
|
+
When the checkbox is checked and belongs to a form, this name is submitted with the checkbox value. If the checkbox is inside a `w-checkbox-group` with a name, the group name is used when the checkbox does not have its own name.
|
|
83
|
+
|
|
84
|
+
- Type: `string | undefined`
|
|
85
|
+
- Default: `-`
|
|
86
|
+
|
|
87
|
+
##### required
|
|
88
|
+
|
|
89
|
+
Whether the checkbox must be checked before form submission.
|
|
90
|
+
|
|
91
|
+
A required checkbox is invalid until it is checked. For requiring at least one option in a set, use `required` on `w-checkbox-group`.
|
|
92
|
+
|
|
93
|
+
- Type: `boolean`
|
|
94
|
+
- Default: `false`
|
|
95
|
+
|
|
96
|
+
##### shadowRootOptions (JS only)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
- Type: `object`
|
|
101
|
+
- Default: `{ ...LitElement.shadowRootOptions, delegatesFocus: true }`
|
|
102
|
+
|
|
103
|
+
##### validationMessage (JS only)
|
|
104
|
+
|
|
105
|
+
Returns the validation message if the checkbox is invalid, otherwise an empty string
|
|
106
|
+
|
|
107
|
+
- Type: `string`
|
|
108
|
+
- Default: `-`
|
|
109
|
+
|
|
110
|
+
##### validity (JS only)
|
|
111
|
+
|
|
112
|
+
Returns the validity state of the checkbox
|
|
113
|
+
|
|
114
|
+
- Type: `ValidityState`
|
|
115
|
+
- Default: `-`
|
|
116
|
+
|
|
117
|
+
##### value
|
|
118
|
+
|
|
119
|
+
The value submitted when the checkbox is checked.
|
|
120
|
+
|
|
121
|
+
If no value attribute is set, the checkbox defaults to `on`. Unchecked and disabled checkboxes do not submit a value.
|
|
122
|
+
|
|
123
|
+
- Type: `string | null`
|
|
124
|
+
- Default: `null`
|
|
125
|
+
|
|
126
|
+
#### Events
|
|
127
|
+
|
|
128
|
+
##### change
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
- Type: `Event`
|
|
133
|
+
|
|
134
|
+
|