@namroodinc/liquid-editorial 0.12.0 → 0.13.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/README.md +17 -7
- package/UPGRADING.md +70 -0
- package/dist/chunks/{Avatar-DPnrvkwd.cjs → Avatar-BY0dAItT.cjs} +2 -2
- package/dist/chunks/{Avatar-DPnrvkwd.cjs.map → Avatar-BY0dAItT.cjs.map} +1 -1
- package/dist/chunks/{Avatar-BK8IdL5W.js → Avatar-UjhjcHh5.js} +2 -2
- package/dist/chunks/{Avatar-BK8IdL5W.js.map → Avatar-UjhjcHh5.js.map} +1 -1
- package/dist/chunks/{CollectionView-DrszOUOt.cjs → CollectionView-CIJdNwcq.cjs} +2 -2
- package/dist/chunks/{CollectionView-DrszOUOt.cjs.map → CollectionView-CIJdNwcq.cjs.map} +1 -1
- package/dist/chunks/{CollectionView-B0ZJxkNK.js → CollectionView-JRNdXHti.js} +2 -2
- package/dist/chunks/{CollectionView-B0ZJxkNK.js.map → CollectionView-JRNdXHti.js.map} +1 -1
- package/dist/chunks/{ColourField-C39pcjkG.js → ColourField-BTj9NHgI.js} +146 -152
- package/dist/chunks/ColourField-BTj9NHgI.js.map +1 -0
- package/dist/chunks/ColourField-DuoVeXjG.cjs +2 -0
- package/dist/chunks/ColourField-DuoVeXjG.cjs.map +1 -0
- package/dist/chunks/{DatePicker-Dpvfomrm.cjs → DatePicker-BYpGsfL4.cjs} +2 -2
- package/dist/chunks/{DatePicker-Dpvfomrm.cjs.map → DatePicker-BYpGsfL4.cjs.map} +1 -1
- package/dist/chunks/{DatePicker-DDc1nDTb.js → DatePicker-Cb5WspIC.js} +21 -21
- package/dist/chunks/{DatePicker-DDc1nDTb.js.map → DatePicker-Cb5WspIC.js.map} +1 -1
- package/dist/chunks/{Drawer-C3mWT9Kh.js → Drawer-Ck5XKT_V.js} +3 -3
- package/dist/chunks/{Drawer-C3mWT9Kh.js.map → Drawer-Ck5XKT_V.js.map} +1 -1
- package/dist/chunks/{Drawer-DTKZptua.cjs → Drawer-DdIH9jpe.cjs} +2 -2
- package/dist/chunks/{Drawer-DTKZptua.cjs.map → Drawer-DdIH9jpe.cjs.map} +1 -1
- package/dist/chunks/{EntryPicker-CgWbgWnc.cjs → EntryPicker-CCCoJxbd.cjs} +2 -2
- package/dist/chunks/{EntryPicker-CgWbgWnc.cjs.map → EntryPicker-CCCoJxbd.cjs.map} +1 -1
- package/dist/chunks/{EntryPicker-DlEsVCvA.js → EntryPicker-DLCP4S-q.js} +3 -3
- package/dist/chunks/{EntryPicker-DlEsVCvA.js.map → EntryPicker-DLCP4S-q.js.map} +1 -1
- package/dist/chunks/{FormEditor-iACd0El-.cjs → FormEditor-ArvjKtJJ.cjs} +2 -2
- package/dist/chunks/{FormEditor-iACd0El-.cjs.map → FormEditor-ArvjKtJJ.cjs.map} +1 -1
- package/dist/chunks/{FormEditor-CLLOHKiO.js → FormEditor-DnNBv9Xf.js} +16 -16
- package/dist/chunks/{FormEditor-CLLOHKiO.js.map → FormEditor-DnNBv9Xf.js.map} +1 -1
- package/dist/chunks/{Message-CyLq9ef-.js → Message-C73sJfdo.js} +4 -8
- package/dist/chunks/{Message-CyLq9ef-.js.map → Message-C73sJfdo.js.map} +1 -1
- package/dist/chunks/{Message-D3b8HDhm.cjs → Message-CIKSTXp8.cjs} +2 -2
- package/dist/chunks/{Message-D3b8HDhm.cjs.map → Message-CIKSTXp8.cjs.map} +1 -1
- package/dist/chunks/RichTextEditor--kMao88d.cjs +2 -0
- package/dist/chunks/RichTextEditor--kMao88d.cjs.map +1 -0
- package/dist/chunks/{RichTextEditor-B0P53GFt.js → RichTextEditor-CvbboqJY.js} +391 -374
- package/dist/chunks/RichTextEditor-CvbboqJY.js.map +1 -0
- package/dist/chunks/{dialogLabel-D18maX-p.js → dialogLabel-DT7rCr3_.js} +19 -19
- package/dist/chunks/{dialogLabel-D18maX-p.js.map → dialogLabel-DT7rCr3_.js.map} +1 -1
- package/dist/chunks/{dialogLabel-2HRYMHbF.cjs → dialogLabel-_-MTckE_.cjs} +2 -2
- package/dist/chunks/{dialogLabel-2HRYMHbF.cjs.map → dialogLabel-_-MTckE_.cjs.map} +1 -1
- package/dist/chunks/overlayLayer-iGhuAByk.cjs +2 -0
- package/dist/chunks/overlayLayer-iGhuAByk.cjs.map +1 -0
- package/dist/chunks/{overlayLayer-IuoPVwTO.js → overlayLayer-lU4iWSjO.js} +32 -28
- package/dist/chunks/overlayLayer-lU4iWSjO.js.map +1 -0
- package/dist/chunks/{group-7Z_xRlQx.js → style-7Z_xRlQx.js} +1 -1
- package/dist/chunks/{group-7Z_xRlQx.js.map → style-7Z_xRlQx.js.map} +1 -1
- package/dist/chunks/{group-nulIa2_8.cjs → style-nulIa2_8.cjs} +1 -1
- package/dist/chunks/{group-nulIa2_8.cjs.map → style-nulIa2_8.cjs.map} +1 -1
- package/dist/chunks/{use-picker-session-DbfOJstX.cjs → use-picker-session-Bue5MJHQ.cjs} +2 -2
- package/dist/chunks/{use-picker-session-DbfOJstX.cjs.map → use-picker-session-Bue5MJHQ.cjs.map} +1 -1
- package/dist/chunks/{use-picker-session-BnMxbGAZ.js → use-picker-session-DUO4G8Cs.js} +2 -2
- package/dist/chunks/{use-picker-session-BnMxbGAZ.js.map → use-picker-session-DUO4G8Cs.js.map} +1 -1
- package/dist/chunks/{useTooltip-BXAvQwt4.cjs → useTooltip-C7ON4nkV.cjs} +2 -2
- package/dist/chunks/{useTooltip-BXAvQwt4.cjs.map → useTooltip-C7ON4nkV.cjs.map} +1 -1
- package/dist/chunks/{useTooltip-BrC7FdeH.js → useTooltip-DnJEFBLg.js} +2 -2
- package/dist/chunks/{useTooltip-BrC7FdeH.js.map → useTooltip-DnJEFBLg.js.map} +1 -1
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/style.css +9 -9
- package/dist/components/Banner/index.cjs +1 -1
- package/dist/components/Banner/index.js +1 -1
- package/dist/components/Board/style.css +3 -3
- package/dist/components/Button/style.css +4 -8
- package/dist/components/Choice/index.cjs +1 -1
- package/dist/components/Choice/index.cjs.map +1 -1
- package/dist/components/Choice/index.js +3 -3
- package/dist/components/Choice/index.js.map +1 -1
- package/dist/components/Choice/style.css +29 -18
- package/dist/components/CollectionView/index.cjs +1 -1
- package/dist/components/CollectionView/index.js +1 -1
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.d.cts.map +1 -1
- package/dist/components/ColourField/index.d.ts.map +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/ColourField/style.css +4 -4
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/Drawer/style.css +2 -4
- package/dist/components/EditLayout/index.cjs +1 -1
- package/dist/components/EditLayout/index.js +3 -3
- package/dist/components/EditLayout/style.css +1 -7
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.js +1 -1
- package/dist/components/EntryPicker/style.css +3 -1
- package/dist/components/Field/style.css +1 -1
- package/dist/components/FormEditor/README.md +26 -33
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.js +1 -1
- package/dist/components/FormEditor/style.css +1 -0
- package/dist/components/LimitReading/style.css +1 -1
- package/dist/components/Menu/index.cjs +1 -1
- package/dist/components/Menu/index.js +1 -1
- package/dist/components/Menu/style.css +3 -2
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/Modal/style.css +1 -3
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +58 -55
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.d.cts.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RichTextEditor/storyblock-view.d.cts.map +1 -1
- package/dist/components/RichTextEditor/storyblock-view.d.ts.map +1 -1
- package/dist/components/RichTextEditor/style.css +91 -60
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/SelectionCard/index.cjs +1 -1
- package/dist/components/SelectionCard/index.cjs.map +1 -1
- package/dist/components/SelectionCard/index.d.cts.map +1 -1
- package/dist/components/SelectionCard/index.d.ts.map +1 -1
- package/dist/components/SelectionCard/index.js +2 -2
- package/dist/components/SelectionCard/index.js.map +1 -1
- package/dist/components/SelectionCard/style.css +20 -65
- package/dist/components/Skeleton/style.css +1 -1
- package/dist/components/Slider/style.css +12 -23
- package/dist/components/Switch/index.cjs +1 -1
- package/dist/components/Switch/index.cjs.map +1 -1
- package/dist/components/Switch/index.d.cts.map +1 -1
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +2 -1
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Switch/style.css +14 -2
- package/dist/components/TagsInput/style.css +3 -21
- package/dist/components/Time/index.cjs +1 -1
- package/dist/components/Time/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/elements.css +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +29 -29
- package/dist/internal/dialogFocus.d.cts +2 -0
- package/dist/internal/dialogFocus.d.cts.map +1 -1
- package/dist/internal/dialogFocus.d.ts +2 -0
- package/dist/internal/dialogFocus.d.ts.map +1 -1
- package/dist/message.css +5 -3
- package/dist/tokens.css +83 -309
- package/package.json +1 -1
- package/dist/chunks/ColourField-BdobU76j.cjs +0 -2
- package/dist/chunks/ColourField-BdobU76j.cjs.map +0 -1
- package/dist/chunks/ColourField-C39pcjkG.js.map +0 -1
- package/dist/chunks/RichTextEditor-B0P53GFt.js.map +0 -1
- package/dist/chunks/RichTextEditor-Wu_yjvD7.cjs +0 -2
- package/dist/chunks/RichTextEditor-Wu_yjvD7.cjs.map +0 -1
- package/dist/chunks/overlayLayer-IuoPVwTO.js.map +0 -1
- package/dist/chunks/overlayLayer-seJG-EFn.cjs +0 -2
- package/dist/chunks/overlayLayer-seJG-EFn.cjs.map +0 -1
- package/dist/components/ColourField/focus.d.cts +0 -3
- package/dist/components/ColourField/focus.d.cts.map +0 -1
- package/dist/components/ColourField/focus.d.ts +0 -3
- package/dist/components/ColourField/focus.d.ts.map +0 -1
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
@layer components {
|
|
2
|
-
|
|
2
|
+
.ds-rte,
|
|
3
|
+
.ds-rte__surface[data-expanded] {
|
|
4
|
+
--rte-fill: var(--field-rest);
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
.ds-rte {
|
|
4
8
|
display: flex;
|
|
5
9
|
flex-direction: column;
|
|
6
10
|
border: 0;
|
|
7
11
|
border-radius: var(--field-radius);
|
|
8
|
-
|
|
9
|
-
/* Surface on the canvas, the alternate row fill inside Modal and Drawer,
|
|
10
|
-
* so the writing area keeps its shape on any ground. */
|
|
11
|
-
background: var(--fill-card);
|
|
12
|
+
background: var(--rte-fill);
|
|
12
13
|
color: var(--color-text);
|
|
13
14
|
font-family: var(--font-sans);
|
|
14
15
|
overflow: hidden;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
.ds-rte[data-
|
|
18
|
+
.ds-rte:where(:hover):not([data-disabled], [data-expanded]),
|
|
19
|
+
.ds-rte__surface[data-expanded]:where(:hover):not([data-disabled]),
|
|
20
|
+
.ds-rte[data-focused],
|
|
21
|
+
.ds-rte__surface[data-expanded][data-focused] {
|
|
22
|
+
--rte-fill: var(--field-hover);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ds-rte[data-focused],
|
|
26
|
+
.ds-rte__surface[data-expanded][data-focused] {
|
|
18
27
|
outline: var(--focus-width) solid var(--color-focus);
|
|
19
28
|
outline-offset: 2px;
|
|
20
29
|
}
|
|
21
30
|
|
|
22
|
-
.ds-rte[data-
|
|
31
|
+
.ds-rte[data-invalid]:not([data-expanded]),
|
|
32
|
+
.ds-rte__surface[data-expanded][data-invalid] {
|
|
33
|
+
--rte-fill: var(--field-invalid);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Invalid and focused steps further, as the Field skin does. */
|
|
37
|
+
.ds-rte[data-invalid][data-focused]:not([data-expanded]),
|
|
38
|
+
.ds-rte__surface[data-expanded][data-invalid][data-focused] {
|
|
39
|
+
--rte-fill: var(--field-invalid-focus);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-rte[data-disabled],
|
|
43
|
+
.ds-rte__surface[data-expanded][data-disabled] {
|
|
23
44
|
opacity: 0.45;
|
|
24
45
|
cursor: not-allowed;
|
|
25
46
|
}
|
|
@@ -32,7 +53,7 @@
|
|
|
32
53
|
padding: var(--space-2);
|
|
33
54
|
background: var(--field-bg);
|
|
34
55
|
|
|
35
|
-
--field-bg:
|
|
56
|
+
--field-bg: var(--rte-fill);
|
|
36
57
|
}
|
|
37
58
|
|
|
38
59
|
.ds-rte__expand {
|
|
@@ -58,12 +79,11 @@
|
|
|
58
79
|
flex-direction: column;
|
|
59
80
|
flex: 1;
|
|
60
81
|
min-block-size: 0;
|
|
61
|
-
|
|
82
|
+
gap: 2px;
|
|
62
83
|
|
|
63
|
-
|
|
84
|
+
/* The seam between toolbar and content shows the ground the field sits
|
|
85
|
+
* on: the page, a card, a band or the expanded Modal. */
|
|
64
86
|
background: var(--field-bg);
|
|
65
|
-
|
|
66
|
-
--field-bg: color-mix(in srgb, var(--color-danger) 12%, var(--fill-card));
|
|
67
87
|
}
|
|
68
88
|
|
|
69
89
|
/* While expanded, the inline frame keeps its height and marks the editor's place. */
|
|
@@ -98,6 +118,10 @@
|
|
|
98
118
|
}
|
|
99
119
|
|
|
100
120
|
.ds-rte__content {
|
|
121
|
+
--field-bg: var(--rte-fill);
|
|
122
|
+
|
|
123
|
+
flex-grow: 1;
|
|
124
|
+
background: var(--field-bg);
|
|
101
125
|
padding: var(--space-3);
|
|
102
126
|
font-size: var(--font-size-md);
|
|
103
127
|
line-height: var(--line-height-body);
|
|
@@ -155,7 +179,7 @@
|
|
|
155
179
|
.ds-rte__content pre {
|
|
156
180
|
padding: var(--space-3);
|
|
157
181
|
border-radius: var(--field-radius);
|
|
158
|
-
background: var(--
|
|
182
|
+
background: var(--field-hover);
|
|
159
183
|
font-family: var(--font-mono);
|
|
160
184
|
font-size: var(--font-size-sm);
|
|
161
185
|
overflow-x: auto;
|
|
@@ -168,7 +192,7 @@
|
|
|
168
192
|
block-size: 2px;
|
|
169
193
|
padding-block: var(--space-2);
|
|
170
194
|
margin-block: var(--space-2);
|
|
171
|
-
background: var(--
|
|
195
|
+
background: var(--color-rule) content-box;
|
|
172
196
|
}
|
|
173
197
|
|
|
174
198
|
.ds-rte__content hr.ProseMirror-selectednode {
|
|
@@ -194,9 +218,6 @@
|
|
|
194
218
|
* motion. The surface fills its body, and only the content scrolls. */
|
|
195
219
|
.ds-modal.ds-rte__modal {
|
|
196
220
|
block-size: 100%;
|
|
197
|
-
|
|
198
|
-
/* The Modal body is the writing surface here, so blocks step from it. */
|
|
199
|
-
--fill-card: var(--color-surface);
|
|
200
221
|
}
|
|
201
222
|
|
|
202
223
|
.ds-rte__modal .ds-modal__body {
|
|
@@ -211,13 +232,10 @@
|
|
|
211
232
|
.ds-rte__modal .ds-rte__toolbar {
|
|
212
233
|
flex-shrink: 0;
|
|
213
234
|
padding: var(--space-3) var(--space-6);
|
|
214
|
-
background: var(--field-bg);
|
|
215
235
|
}
|
|
216
236
|
|
|
217
|
-
.ds-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
--field-bg: color-mix(in srgb, var(--color-danger) 12%, var(--fill-card));
|
|
237
|
+
.ds-rte__surface[data-expanded][data-focused] {
|
|
238
|
+
outline-offset: -2px;
|
|
221
239
|
}
|
|
222
240
|
|
|
223
241
|
.ds-rte__modal .ds-rte__content {
|
|
@@ -240,16 +258,16 @@
|
|
|
240
258
|
}
|
|
241
259
|
|
|
242
260
|
.ds-storyblock {
|
|
243
|
-
--
|
|
261
|
+
--field-bg: var(--color-canvas);
|
|
262
|
+
--storyblock-bar-bg: var(--field-bg);
|
|
244
263
|
|
|
245
264
|
display: flex;
|
|
246
265
|
flex-direction: column;
|
|
247
|
-
container: storyblock / inline-size;
|
|
248
266
|
overflow: hidden;
|
|
249
267
|
margin-block-end: var(--space-3);
|
|
250
268
|
border: 0;
|
|
251
269
|
border-radius: var(--radius-md);
|
|
252
|
-
background:
|
|
270
|
+
background: var(--field-bg);
|
|
253
271
|
font-size: var(--font-size-sm);
|
|
254
272
|
line-height: 1.3;
|
|
255
273
|
}
|
|
@@ -277,6 +295,10 @@
|
|
|
277
295
|
margin: var(--space-1) 0 var(--space-3) var(--storyblock-gutter);
|
|
278
296
|
}
|
|
279
297
|
|
|
298
|
+
.ds-storyblock:where(:hover) {
|
|
299
|
+
--storyblock-bar-bg: var(--field-rest);
|
|
300
|
+
}
|
|
301
|
+
|
|
280
302
|
.ds-storyblock[data-tone="draft"] {
|
|
281
303
|
--storyblock-bar-bg: var(--color-warning-soft);
|
|
282
304
|
}
|
|
@@ -289,21 +311,14 @@
|
|
|
289
311
|
}
|
|
290
312
|
|
|
291
313
|
.ds-storyblock[data-missing] {
|
|
314
|
+
--field-bg: color-mix(in srgb, var(--color-danger) 5%, var(--color-canvas));
|
|
292
315
|
--storyblock-bar-bg: var(--color-danger-soft);
|
|
293
|
-
|
|
294
|
-
background: color-mix(in srgb, var(--color-danger) 9%, var(--fill-card));
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.ds-storyblock[data-missing] .ds-storyblock__kind-label {
|
|
298
|
-
--badge-ink: var(--color-text-on-solid);
|
|
299
|
-
--badge-soft: var(--color-danger);
|
|
300
|
-
--badge-soft-marker: var(--color-text-on-solid);
|
|
301
316
|
}
|
|
302
317
|
|
|
303
318
|
.ds-storyblock__bar {
|
|
304
|
-
display:
|
|
305
|
-
grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
|
|
319
|
+
display: flex;
|
|
306
320
|
align-items: center;
|
|
321
|
+
justify-content: space-between;
|
|
307
322
|
gap: var(--space-2);
|
|
308
323
|
min-block-size: var(--space-12);
|
|
309
324
|
padding: calc(var(--space-3) / 2) var(--space-2);
|
|
@@ -312,14 +327,9 @@
|
|
|
312
327
|
--field-bg: var(--storyblock-bar-bg);
|
|
313
328
|
}
|
|
314
329
|
|
|
315
|
-
.ds-storyblock__kind
|
|
316
|
-
.ds-storyblock__actions {
|
|
330
|
+
.ds-storyblock__kind {
|
|
317
331
|
display: flex;
|
|
318
332
|
align-items: center;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/* The drag handle fills its column and the bar's height. It holds no buttons. */
|
|
322
|
-
.ds-storyblock__kind {
|
|
323
333
|
align-self: stretch;
|
|
324
334
|
gap: var(--space-2);
|
|
325
335
|
color: var(--color-text-muted);
|
|
@@ -329,21 +339,18 @@
|
|
|
329
339
|
cursor: grab;
|
|
330
340
|
}
|
|
331
341
|
|
|
342
|
+
/* The label keeps Badge's neutral fill, which steps from the bar it sits
|
|
343
|
+
* on, so it holds its shape on the resting and hovered bar alike. */
|
|
332
344
|
.ds-storyblock__kind-label {
|
|
333
345
|
width: fit-content;
|
|
334
346
|
|
|
335
|
-
--badge-
|
|
347
|
+
--badge-ink: var(--color-text-muted);
|
|
336
348
|
}
|
|
337
349
|
|
|
338
350
|
.ds-storyblock__grip {
|
|
339
351
|
display: flex;
|
|
340
352
|
}
|
|
341
353
|
|
|
342
|
-
.ds-storyblock__actions {
|
|
343
|
-
justify-self: end;
|
|
344
|
-
gap: calc(var(--space-1) / 2);
|
|
345
|
-
}
|
|
346
|
-
|
|
347
354
|
.ds-storyblock__body {
|
|
348
355
|
padding: var(--space-3);
|
|
349
356
|
}
|
|
@@ -356,26 +363,50 @@
|
|
|
356
363
|
padding: 0 var(--space-3) var(--space-3);
|
|
357
364
|
}
|
|
358
365
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
grid-template-columns: 1fr auto;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.ds-storyblock__actions {
|
|
366
|
-
grid-column: 1 / -1;
|
|
367
|
-
}
|
|
366
|
+
.ds-storyblock[data-tone="draft"] .ds-storyblock__kind-label {
|
|
367
|
+
--badge-soft: var(--color-canvas);
|
|
368
|
+
--badge-ink: var(--color-warning-text);
|
|
368
369
|
}
|
|
369
|
-
}
|
|
370
370
|
|
|
371
|
-
@layer components {
|
|
372
371
|
.ds-storyblock[data-selected] .ds-storyblock__kind-label {
|
|
373
|
-
--badge-soft: var(--color-
|
|
372
|
+
--badge-soft: var(--color-canvas);
|
|
374
373
|
--badge-ink: var(--color-primary-text);
|
|
375
374
|
}
|
|
376
375
|
|
|
377
|
-
.ds-storyblock[data-missing]
|
|
376
|
+
.ds-storyblock[data-missing] .ds-storyblock__kind-label {
|
|
378
377
|
--badge-soft: var(--color-danger);
|
|
379
378
|
--badge-ink: var(--color-text-on-solid);
|
|
380
379
|
}
|
|
380
|
+
|
|
381
|
+
.ds-storyblock__popover.ds-popover {
|
|
382
|
+
inline-size: 248px;
|
|
383
|
+
padding: var(--space-2);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.ds-storyblock__popover-content {
|
|
387
|
+
display: flex;
|
|
388
|
+
flex-direction: column;
|
|
389
|
+
gap: var(--space-1);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.ds-storyblock__popover-label {
|
|
393
|
+
padding-inline: var(--space-2);
|
|
394
|
+
color: var(--color-text-muted);
|
|
395
|
+
font-size: var(--font-size-xs);
|
|
396
|
+
font-weight: var(--font-weight-bold);
|
|
397
|
+
letter-spacing: var(--table-head-tracking);
|
|
398
|
+
text-transform: uppercase;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.ds-storyblock__alignment.ds-button-group {
|
|
402
|
+
display: grid;
|
|
403
|
+
grid-template-columns: repeat(3, minmax(max-content, 1fr));
|
|
404
|
+
width: 100%;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* Actions keep Button's variants; only their layout is a list's. */
|
|
408
|
+
.ds-storyblock__action.ds-button {
|
|
409
|
+
justify-content: start;
|
|
410
|
+
text-align: start;
|
|
411
|
+
}
|
|
381
412
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CD3oeiNA.cjs"),t=require("../Button/index.cjs"),n=require("../../chunks/overlayLayer-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CD3oeiNA.cjs"),t=require("../Button/index.cjs"),n=require("../../chunks/overlayLayer-iGhuAByk.cjs");;/* empty css */const r=require("../Popover/index.cjs");let i=require("react"),a=require("react/jsx-runtime");function o(...e){return e.filter(Boolean).join(` `)}var s=(0,i.forwardRef)(function({options:s,value:c,defaultValue:l,onValueChange:u,placeholder:d=`Select an option`,size:f=`md`,isDisabled:p=!1,isInvalid:m=!1,"aria-invalid":h,required:g,menuPlacement:_=`bottom`,className:v,disabled:y,onClick:b,onKeyDown:x,...S},C){let[w,T]=(0,i.useState)(l??``),E=c??w,[D,O]=(0,i.useState)(!1),k=n.o(D),[A,j]=(0,i.useState)(0),M=(0,i.useRef)(null),N=(0,i.useRef)(null),P=(0,i.useRef)(null),F=(0,i.useId)(),I=p||y,L=k&&!I,R=s.find(e=>e.value===E),z=s.filter(e=>!e.isDisabled),B=(0,i.useCallback)(e=>{c===void 0&&T(e),u?.(e),O(!1)},[u,c]);(0,i.useEffect)(()=>{if(!L)return;let e=s.findIndex(e=>e.value===E&&!e.isDisabled);j(e<0?s.indexOf(z[0]):e);let t=e=>{let t=e.target;!M.current?.contains(t)&&!P.current?.contains(t)&&O(!1)};return document.addEventListener(`mousedown`,t),()=>document.removeEventListener(`mousedown`,t)},[L]),(0,i.useEffect)(()=>{L&&(P.current?.querySelectorAll(`[role='option']`)[A])?.scrollIntoView({block:`nearest`})},[A,L]);let V=e=>{let t=s.map((e,t)=>({option:e,index:t})).filter(e=>!e.option.isDisabled);if(t.length===0)return;let n=t[(t.findIndex(e=>e.index===A)+e+t.length)%t.length];j(n.index)},H=e=>{switch(e.key){case`Escape`:e.preventDefault(),O(!1),N.current?.focus();break;case`Tab`:O(!1);break;case`ArrowDown`:case`ArrowUp`:e.preventDefault(),V(e.key===`ArrowDown`?1:-1);break;case`Home`:case`End`:{e.preventDefault();let t=e.key===`Home`?z[0]:z[z.length-1];t&&j(s.indexOf(t));break}case`Enter`:case` `:{e.preventDefault();let t=s[A];t&&!t.isDisabled&&B(t.value);break}}},U=e=>{I||(L?H(e):[`ArrowDown`,`ArrowUp`,`Enter`,` `].includes(e.key)&&(e.preventDefault(),O(!0)))};return(0,a.jsxs)(`div`,{className:`ds-select-root`,ref:M,children:[(0,a.jsxs)(t.Button,{ref:e=>{N.current=e,typeof C==`function`?C(e):C&&(C.current=e)},size:f,role:`combobox`,"aria-required":g||void 0,"aria-haspopup":`listbox`,"aria-expanded":L,"aria-controls":L?F:void 0,"aria-activedescendant":L&&s[A]&&!s[A].isDisabled?`${F}-option-${A}`:void 0,"aria-invalid":m||h||void 0,isDisabled:I,"data-placeholder":R?void 0:``,className:o(`ds-field-skin`,`ds-select`,v),onClick:e=>{b?.(e),e.defaultPrevented||O(e=>!e)},onKeyDown:e=>{x?.(e),e.defaultPrevented||U(e)},...S,children:[(0,a.jsx)(`span`,{className:`ds-select__value`,children:R?R.label:d}),(0,a.jsx)(e.t,{name:`chevron-down`,size:16,className:`ds-select__chevron`})]}),(0,a.jsx)(r.Popover,{anchorRef:N,isOpen:L,align:`start`,placement:_,matchAnchorWidth:!0,panelRef:P,id:F,role:`listbox`,"aria-label":S[`aria-labelledby`]?void 0:S[`aria-label`]??d,"aria-labelledby":S[`aria-labelledby`],className:`ds-surface-raised ds-field-surface ds-select__menu`,children:(0,a.jsx)(`div`,{onKeyDown:U,onPointerDown:e=>e.preventDefault(),children:s.map((n,r)=>(0,a.jsxs)(t.Button,{variant:r===A?`active`:`simple`,size:`sm`,isDisabled:n.isDisabled,tabIndex:-1,id:`${F}-option-${r}`,role:`option`,"aria-selected":n.value===E,"aria-disabled":n.isDisabled||void 0,"data-active":r===A||void 0,className:`ds-select__option`,onMouseEnter:()=>!n.isDisabled&&j(r),onClick:()=>{n.isDisabled||(B(n.value),N.current?.focus())},children:[(0,a.jsxs)(`span`,{className:`ds-select__option-body`,children:[(0,a.jsx)(`span`,{className:`ds-select__option-label`,children:n.label}),n.description&&(0,a.jsx)(`span`,{className:`ds-select__option-description`,children:n.description})]}),n.value===E&&(0,a.jsx)(e.t,{name:`check`,size:16})]},n.value))})})]})});exports.Select=s;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "../../chunks/Icon-CYXOo0Kt.js";
|
|
2
2
|
import { Button as t } from "../Button/index.js";
|
|
3
|
-
import { o as n } from "../../chunks/overlayLayer-
|
|
3
|
+
import { o as n } from "../../chunks/overlayLayer-lU4iWSjO.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { Popover as r } from "../Popover/index.js";
|
|
6
6
|
import { forwardRef as i, useCallback as a, useEffect as o, useId as s, useRef as c, useState as l } from "react";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/style-nulIa2_8.cjs"),t=require("../Grid/index.cjs");let n=require("react"),r=require("react/jsx-runtime");function i({kind:e,title:t,description:n,children:i,className:a,inputProps:o,inputRef:s}){return(0,r.jsxs)(`label`,{className:[`ds-selection-card`,`ds-field-surface`,a].filter(Boolean).join(` `),children:[(0,r.jsx)(`input`,{ref:s,type:e,"data-kind":e,className:`ds-selection-card__control ds-indicator`,...o}),(0,r.jsxs)(`span`,{className:`ds-selection-card__text`,children:[(0,r.jsx)(`span`,{className:`ds-selection-card__title`,children:t}),n&&(0,r.jsx)(`span`,{className:`ds-selection-card__description`,children:n}),i&&(0,r.jsx)(`span`,{className:`ds-selection-card__extra`,children:i})]})]})}var a=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`checkbox`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})}),o=(0,n.forwardRef)(function({title:e,description:t,children:n,className:a,...o},s){return(0,r.jsx)(i,{kind:`radio`,title:e,description:t,className:a,inputProps:o,inputRef:s,children:n})});function s({label:n,columns:i=2,gap:a=`md`,children:o,className:s,...c}){return(0,r.jsx)(e.t,{...c,label:n,className:[`ds-selection-card-group`,s].filter(Boolean).join(` `),children:(0,r.jsx)(t.Grid,{columns:i,gap:a,className:`ds-selection-card-group__grid ds-field-group-grid`,style:{"--field-group-columns":i},children:o})})}exports.CheckboxCard=a,exports.RadioCard=o,exports.SelectionCardGroup=s;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["forwardRef","FieldGroup","Grid","
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["forwardRef","FieldGroup","Grid","require_style","require_components_Grid_index","react","react_jsx_runtime","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","rest","ref","RadioCard","SelectionCardGroup","fieldProps","columns"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"../Choice/style.css\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label\n className={[\"ds-selection-card\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control ds-indicator\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":"A,2MAoBA,SAASO,EAAS,CAChB,OACA,QACA,cACA,WACA,YACA,aACA,YAMC,CACD,OACE,EAAAD,EAAA,KAAA,CAAC,QAAD,CACE,UAAW,CAAC,oBAAqB,mBAAoBE,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAD1F,SAAA,EAGE,EAAAF,EAAA,IAAA,CAAC,QAAD,CACE,IAAKG,EACL,KAAMC,EACN,YAAWA,EACX,UAAU,0CACV,GAAIC,CACL,CAAA,GACD,EAAAL,EAAA,KAAA,CAAC,OAAD,CAAM,UAAU,0BAAhB,SAAA,EACE,EAAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,SAAAM,CAAY,CAAA,EACvDC,IAAe,EAAAP,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,iCAAkC,SAAAO,CAAkB,CAAA,EACnFC,IAAY,EAAAR,EAAA,IAAA,CAAC,OAAD,CAAM,UAAU,2BAA4B,UAAe,CAAA,CACpE,CACD,CAAA,CAAA,C,EAEX,CAQA,IAAaS,GAAA,EAAef,EAAAA,WAAAA,CAAgD,SAC1E,CAAE,QAAO,cAAa,WAAU,YAAW,GAAGgB,GAC9C,EACA,CACA,OACE,EAAAV,EAAA,IAAA,CAACC,EAAD,CACE,KAAK,WACE,QACM,cACF,YACX,WAAYS,EACZ,SAAUC,EAET,UACO,CAAA,CAEd,CAAC,EAKYC,GAAA,EAAYlB,EAAAA,WAAAA,CAA6C,SACpE,CAAE,QAAO,cAAa,WAAU,YAAW,GAAGgB,GAC9C,EACA,CACA,OACE,EAAAV,EAAA,IAAA,CAACC,EAAD,CACE,KAAK,QACE,QACM,cACF,YACX,WAAYS,EACZ,SAAUC,EAET,UACO,CAAA,CAEd,CAAC,EAaD,SAAgBE,EAAmB,CACjC,QACA,UAAU,EACV,MAAM,KACN,WACA,YACA,GAAGC,GACuB,CAC1B,OACE,EAAAd,EAAA,IAAA,CAACL,EAAAA,EAAD,CACE,GAAImB,EACG,QACP,UAAW,CAAC,0BAA2BZ,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EAE1E,UAAA,EAAAF,EAAA,IAAA,CAACJ,EAAAA,KAAD,CACW,UACJ,MACL,UAAU,oDACV,MAAO,CAAE,wBAAyBmB,CAAQ,EAEzC,UACG,CAAA,CACI,CAAA,CAEhB,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SelectionCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjG,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,aAAa,CAAC;AAErB,UAAU,iBAAiB;IACzB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC;IACjB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACvC,CAAC;AAoCF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAE5E;;;GAGG;AACH,eAAO,MAAM,YAAY,gHAgBvB,CAAC;AAEH,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAEzE,iFAAiF;AACjF,eAAO,MAAM,SAAS,6GAgBpB,CAAC;AAEH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,sFAAsF;IACtF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAW,EACX,GAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,uBAAuB,+BAiBzB"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SelectionCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjG,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,aAAa,CAAC;AAErB,UAAU,iBAAiB;IACzB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC;IACjB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACvC,CAAC;AAoCF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAE5E;;;GAGG;AACH,eAAO,MAAM,YAAY,gHAgBvB,CAAC;AAEH,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAEzE,iFAAiF;AACjF,eAAO,MAAM,SAAS,6GAgBpB,CAAC;AAEH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,sFAAsF;IACtF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAW,EACX,GAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,uBAAuB,+BAiBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjG,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,aAAa,CAAC;AAErB,UAAU,iBAAiB;IACzB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC;IACjB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACvC,CAAC;AAoCF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAE5E;;;GAGG;AACH,eAAO,MAAM,YAAY,gHAgBvB,CAAC;AAEH,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAEzE,iFAAiF;AACjF,eAAO,MAAM,SAAS,6GAgBpB,CAAC;AAEH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,sFAAsF;IACtF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAW,EACX,GAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,uBAAuB,+BAiBzB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SelectionCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjG,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAQ,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,qBAAqB,CAAC;AAC7B,OAAO,aAAa,CAAC;AAErB,UAAU,iBAAiB;IACzB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC;IACjB,4FAA4F;IAC5F,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,KAAK,WAAW,GAAG,IAAI,CACrB,mBAAmB,CAAC,gBAAgB,CAAC,EACrC,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACvC,CAAC;AAoCF,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAE5E;;;GAGG;AACH,eAAO,MAAM,YAAY,gHAgBvB,CAAC;AAEH,MAAM,WAAW,cAAe,SAAQ,iBAAiB,EAAE,WAAW;CAAG;AAEzE,iFAAiF;AACjF,eAAO,MAAM,SAAS,6GAgBpB,CAAC;AAEH,MAAM,WAAW,uBAAwB,SAAQ,eAAe;IAC9D,mDAAmD;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,sFAAsF;IACtF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAW,EACX,GAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,UAAU,EACd,EAAE,uBAAuB,+BAiBzB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../chunks/
|
|
1
|
+
import { t as e } from "../../chunks/style-7Z_xRlQx.js";
|
|
2
2
|
import { Grid as t } from "../Grid/index.js";
|
|
3
3
|
import { forwardRef as n } from "react";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@ function a({ kind: e, title: t, description: n, children: a, className: o, input
|
|
|
14
14
|
ref: c,
|
|
15
15
|
type: e,
|
|
16
16
|
"data-kind": e,
|
|
17
|
-
className: "ds-selection-card__control",
|
|
17
|
+
className: "ds-selection-card__control ds-indicator",
|
|
18
18
|
...s
|
|
19
19
|
}), /* @__PURE__ */ i("span", {
|
|
20
20
|
className: "ds-selection-card__text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["FieldGroup","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","forwardRef","rest","ref","RadioCard","SelectionCardGroup","fieldProps","Grid","columns"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label\n className={[\"ds-selection-card\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":["FieldGroup","CardBody","className","inputRef","kind","inputProps","title","description","children","CheckboxCard","forwardRef","rest","ref","RadioCard","SelectionCardGroup","fieldProps","Grid","columns"],"sources":["../../../src/components/SelectionCard/index.tsx"],"sourcesContent":["import { forwardRef, type CSSProperties, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { FieldGroup, type FieldGroupProps } from \"../Field/group\";\nimport { Grid, type GapSize } from \"../Grid\";\nimport \"../Choice/style.css\";\nimport \"./style.css\";\n\ninterface SelectionCardBase {\n /** The commitment, in the user's words. */\n title: ReactNode;\n /** One line on what picking this means. Takes nodes, so a chip or a link can sit inline. */\n description?: ReactNode;\n /** Extra content under the description — a price, a sample, a badge. */\n children?: ReactNode;\n}\n\ntype NativeInput = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"children\" | \"title\"\n>;\n\nfunction CardBody({\n kind,\n title,\n description,\n children,\n className,\n inputProps,\n inputRef,\n}: SelectionCardBase & {\n kind: \"checkbox\" | \"radio\";\n className?: string;\n inputProps: NativeInput;\n inputRef: React.Ref<HTMLInputElement>;\n}) {\n return (\n <label\n className={[\"ds-selection-card\", \"ds-field-surface\", className].filter(Boolean).join(\" \")}\n >\n <input\n ref={inputRef}\n type={kind}\n data-kind={kind}\n className=\"ds-selection-card__control ds-indicator\"\n {...inputProps}\n />\n <span className=\"ds-selection-card__text\">\n <span className=\"ds-selection-card__title\">{title}</span>\n {description && <span className=\"ds-selection-card__description\">{description}</span>}\n {children && <span className=\"ds-selection-card__extra\">{children}</span>}\n </span>\n </label>\n );\n}\n\nexport interface CheckboxCardProps extends SelectionCardBase, NativeInput {}\n\n/**\n * A checkbox with room to explain itself. Same 20px box as the bare control —\n * the card is a bigger target, not a different decision.\n */\nexport const CheckboxCard = forwardRef<HTMLInputElement, CheckboxCardProps>(function CheckboxCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"checkbox\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface RadioCardProps extends SelectionCardBase, NativeInput {}\n\n/** One of a set of mutually exclusive options, each with its own explanation. */\nexport const RadioCard = forwardRef<HTMLInputElement, RadioCardProps>(function RadioCard(\n { title, description, children, className, ...rest },\n ref,\n) {\n return (\n <CardBody\n kind=\"radio\"\n title={title}\n description={description}\n className={className}\n inputProps={rest}\n inputRef={ref}\n >\n {children}\n </CardBody>\n );\n});\n\nexport interface SelectionCardGroupProps extends FieldGroupProps {\n /** Group label — the question the cards answer. */\n label: string;\n /** Cards per row at full width. Steps down inside a narrow container. */\n columns?: 1 | 2 | 3;\n /** Space between cards in both axes, using Grid's spacing scale. Defaults to `md`. */\n gap?: GapSize;\n children: ReactNode;\n}\n\n/** A grid of selection cards under one legend, spaced by the shared Grid. */\nexport function SelectionCardGroup({\n label,\n columns = 2,\n gap = \"md\",\n children,\n className,\n ...fieldProps\n}: SelectionCardGroupProps) {\n return (\n <FieldGroup\n {...fieldProps}\n label={label}\n className={[\"ds-selection-card-group\", className].filter(Boolean).join(\" \")}\n >\n <Grid\n columns={columns}\n gap={gap}\n className=\"ds-selection-card-group__grid ds-field-group-grid\"\n style={{ \"--field-group-columns\": columns } as CSSProperties}\n >\n {children}\n </Grid>\n </FieldGroup>\n );\n}\n"],"mappings":";;;;;AAoBA,SAASC,EAAS,EAChB,SACA,UACA,gBACA,aACA,cACA,eACA,eAMC;CACD,OACE,kBAAC,SAAD;EACE,WAAW;GAAC;GAAqB;GAAoBC;EAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAD1F,UAAA,CAGE,kBAAC,SAAD;GACE,KAAKC;GACL,MAAMC;GACN,aAAWA;GACX,WAAU;GACV,GAAIC;EACL,CAAA,GACD,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA;IACE,kBAAC,QAAD;KAAM,WAAU;KAA4B,UAAAC;IAAY,CAAA;IACvDC,KAAe,kBAAC,QAAD;KAAM,WAAU;KAAkC,UAAAA;IAAkB,CAAA;IACnFC,KAAY,kBAAC,QAAD;KAAM,WAAU;KAA4B;IAAe,CAAA;GACpE;EACD,CAAA,CAAA;;AAEX;AAQA,IAAaC,IAAeC,EAAgD,SAC1E,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAC9C,GACA;CACA,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CAAC,GAKYC,IAAYH,EAA6C,SACpE,EAAE,UAAO,gBAAa,aAAU,cAAW,GAAGC,KAC9C,GACA;CACA,OACE,kBAACV,GAAD;EACE,MAAK;EACE;EACM;EACF;EACX,YAAYU;EACZ,UAAUC;EAET;CACO,CAAA;AAEd,CAAC;AAaD,SAAgBE,EAAmB,EACjC,UACA,aAAU,GACV,SAAM,MACN,aACA,cACA,GAAGC,KACuB;CAC1B,OACE,kBAACf,GAAD;EACE,GAAIe;EACG;EACP,WAAW,CAAC,2BAA2Bb,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EAE1E,UAAA,kBAACc,GAAD;GACW;GACJ;GACL,WAAU;GACV,OAAO,EAAE,yBAAyBC,EAAQ;GAEzC;EACG,CAAA;CACI,CAAA;AAEhB"}
|
|
@@ -5,28 +5,34 @@
|
|
|
5
5
|
gap: var(--space-3);
|
|
6
6
|
padding: var(--space-4);
|
|
7
7
|
min-inline-size: min(100%, var(--choice-card-min-width));
|
|
8
|
-
background: var(--field-
|
|
8
|
+
background: var(--field-rest);
|
|
9
9
|
border: 0;
|
|
10
10
|
border-radius: var(--field-radius);
|
|
11
11
|
cursor: pointer;
|
|
12
12
|
transition: background-color var(--duration-fast) var(--ease-standard);
|
|
13
13
|
|
|
14
|
-
--field-
|
|
14
|
+
--field-paint: var(--field-rest);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.ds-selection-card:hover:not(:has(:disabled)) {
|
|
17
|
+
.ds-selection-card:hover:where(:not(:has(:disabled))) {
|
|
18
18
|
--field-paint: var(--field-hover);
|
|
19
19
|
|
|
20
20
|
background: var(--field-hover);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
/* Checked and invalid cards paint their own ground, hovered or not. */
|
|
24
23
|
.ds-selection-card:has(.ds-selection-card__control:checked) {
|
|
25
|
-
background: var(--field-bg);
|
|
26
|
-
|
|
27
24
|
--field-bg: var(--color-primary-soft);
|
|
28
25
|
--field-paint: initial;
|
|
29
26
|
--button-active-bg: var(--color-primary-soft-pressed);
|
|
27
|
+
|
|
28
|
+
background: var(--field-bg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ds-selection-card:has(.ds-selection-card__control:checked):where(:hover:not(:has(:disabled))) {
|
|
32
|
+
--field-paint: var(--color-primary-soft-hover);
|
|
33
|
+
--indicator-checked: var(--color-primary-hover);
|
|
34
|
+
|
|
35
|
+
background: var(--color-primary-soft-hover);
|
|
30
36
|
}
|
|
31
37
|
|
|
32
38
|
.ds-selection-card:has(.ds-selection-card__control:focus-visible) {
|
|
@@ -34,17 +40,11 @@
|
|
|
34
40
|
outline-offset: 2px;
|
|
35
41
|
}
|
|
36
42
|
|
|
43
|
+
/* The checked card derives its invalid tint from its selected ground. */
|
|
37
44
|
.ds-selection-card:has(.ds-selection-card__control[aria-invalid="true"]) {
|
|
38
|
-
--field-
|
|
39
|
-
--field-paint: initial;
|
|
40
|
-
|
|
41
|
-
background: var(--field-bg);
|
|
42
|
-
}
|
|
45
|
+
--field-paint: var(--field-invalid);
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
* fill under the danger tint and still differs from unchecked cards. */
|
|
46
|
-
.ds-selection-card:has(.ds-selection-card__control[aria-invalid="true"]:checked) {
|
|
47
|
-
--field-bg: color-mix(in srgb, var(--color-danger) 12%, var(--color-primary-soft));
|
|
47
|
+
background: var(--field-invalid);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
.ds-selection-card:has(.ds-selection-card__control:disabled) {
|
|
@@ -52,47 +52,14 @@
|
|
|
52
52
|
opacity: 0.45;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
appearance: none;
|
|
58
|
-
flex: none;
|
|
59
|
-
inline-size: var(--icon-md);
|
|
60
|
-
block-size: var(--icon-md);
|
|
61
|
-
margin: 0;
|
|
62
|
-
margin-block-start: calc((1lh - var(--icon-md)) / 2);
|
|
63
|
-
border: 0;
|
|
64
|
-
background: var(--fill-indicator);
|
|
65
|
-
cursor: inherit;
|
|
66
|
-
display: grid;
|
|
67
|
-
place-content: center;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.ds-selection-card__control[data-kind="checkbox"] {
|
|
71
|
-
border-radius: var(--field-radius);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.ds-selection-card__control[data-kind="radio"] {
|
|
75
|
-
border-radius: var(--radius-pill);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.ds-selection-card__control[data-kind="checkbox"]:checked {
|
|
79
|
-
background: var(--color-primary);
|
|
80
|
-
}
|
|
55
|
+
.ds-selection-card .ds-selection-card__control {
|
|
56
|
+
--indicator-fill: var(--color-canvas);
|
|
81
57
|
|
|
82
|
-
|
|
83
|
-
content: "";
|
|
84
|
-
inline-size: 13px;
|
|
85
|
-
block-size: 13px;
|
|
86
|
-
background: var(--color-text-on-solid);
|
|
87
|
-
clip-path: polygon(14% 47%, 0 61%, 40% 100%, 100% 22%, 85% 10%, 38% 71%);
|
|
58
|
+
cursor: inherit;
|
|
88
59
|
}
|
|
89
60
|
|
|
90
|
-
.ds-selection-card__control
|
|
91
|
-
|
|
92
|
-
inline-size: var(--space-2);
|
|
93
|
-
block-size: var(--space-2);
|
|
94
|
-
border-radius: var(--radius-pill);
|
|
95
|
-
background: var(--color-text-on-solid);
|
|
61
|
+
.ds-selection-card .ds-selection-card__control:focus-visible {
|
|
62
|
+
outline: none;
|
|
96
63
|
}
|
|
97
64
|
|
|
98
65
|
.ds-selection-card__text {
|
|
@@ -135,15 +102,3 @@
|
|
|
135
102
|
}
|
|
136
103
|
}
|
|
137
104
|
}
|
|
138
|
-
|
|
139
|
-
@layer components {
|
|
140
|
-
.ds-selection-card__control[data-kind="radio"]:checked {
|
|
141
|
-
background: var(--color-primary);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@layer components {
|
|
146
|
-
.ds-selection-card__control[aria-invalid="true"][data-kind] {
|
|
147
|
-
background: var(--color-danger);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@layer components {
|
|
2
2
|
.ds-skeleton {
|
|
3
3
|
display: block;
|
|
4
|
-
background: color-mix(in srgb, var(--color-text) 9%, var(--color-
|
|
4
|
+
background: color-mix(in srgb, var(--color-text) 9%, var(--color-canvas));
|
|
5
5
|
border-radius: var(--field-radius);
|
|
6
6
|
animation: ds-skeleton-pulse var(--skeleton-duration) var(--skeleton-easing) infinite;
|
|
7
7
|
}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
.ds-slider__rail {
|
|
37
37
|
inset-inline: 0;
|
|
38
|
-
background:
|
|
38
|
+
background: var(--field-hover);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.ds-slider__fill {
|
|
@@ -111,46 +111,35 @@
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
.ds-slider__input:hover:not(:disabled)::-webkit-slider-thumb {
|
|
114
|
-
background:
|
|
114
|
+
background: var(--color-text-muted);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
.ds-slider__input:hover:not(:disabled)::-moz-range-thumb {
|
|
118
|
-
background:
|
|
118
|
+
background: var(--color-text-muted);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
.ds-slider__input:focus-visible {
|
|
122
|
+
outline: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ds-slider__input:focus-visible::-webkit-slider-thumb {
|
|
122
126
|
outline: var(--focus-width) solid var(--color-focus);
|
|
123
127
|
outline-offset: 2px;
|
|
124
|
-
border-radius: var(--radius-pill);
|
|
125
128
|
}
|
|
126
129
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
background: color-mix(in srgb, var(--color-text) 6%, var(--field-bg));
|
|
130
|
+
.ds-slider__input:focus-visible::-moz-range-thumb {
|
|
131
|
+
outline: var(--focus-width) solid var(--color-focus);
|
|
132
|
+
outline-offset: 2px;
|
|
131
133
|
}
|
|
132
134
|
|
|
133
|
-
.ds-
|
|
134
|
-
|
|
135
|
+
.ds-slider[data-disabled] {
|
|
136
|
+
opacity: 0.45;
|
|
135
137
|
}
|
|
136
138
|
|
|
137
139
|
.ds-slider__input:disabled {
|
|
138
140
|
cursor: not-allowed;
|
|
139
141
|
}
|
|
140
142
|
|
|
141
|
-
.ds-slider__input:disabled::-webkit-slider-thumb {
|
|
142
|
-
background: color-mix(in srgb, var(--color-text) 35%, transparent);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.ds-slider__input:disabled::-moz-range-thumb {
|
|
146
|
-
background: color-mix(in srgb, var(--color-text) 35%, transparent);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.ds-slider[data-disabled] .ds-slider__value {
|
|
150
|
-
opacity: 0.55;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
/* Invalid paints the fill and thumbs; disabled keeps its muted track. */
|
|
154
143
|
.ds-slider:not([data-disabled]):has(.ds-slider__input[aria-invalid="true"])
|
|
155
144
|
.ds-slider__fill::before {
|
|
156
145
|
background: var(--color-danger);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs");let t=require("react"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=(0,t.forwardRef)(function({isSelected:i,defaultSelected:a=!1,onSelectedChange:o,isDisabled:s=!1,required:c,className:l,children:u,onClick:d,...f},p){let[m,h]=(0,t.useState)(a),g=i??m,_=f[`aria-invalid`]===!0||f[`aria-invalid`]===`true`;return(0,n.jsxs)(`label`,{className:r(`ds-switch`,l),children:[(0,n.jsx)(e.Button,{ref:p,variant:_?`danger
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../Button/index.cjs");let t=require("react"),n=require("react/jsx-runtime");function r(...e){return e.filter(Boolean).join(` `)}var i=(0,t.forwardRef)(function({isSelected:i,defaultSelected:a=!1,onSelectedChange:o,isDisabled:s=!1,required:c,className:l,children:u,onClick:d,...f},p){let[m,h]=(0,t.useState)(a),g=i??m,_=f[`aria-invalid`]===!0||f[`aria-invalid`]===`true`;return(0,n.jsxs)(`label`,{className:r(`ds-switch`,l),children:[(0,n.jsx)(e.Button,{ref:p,variant:g?_?`danger`:`primary`:`neutral`,"data-invalid":_&&!g||void 0,size:`sm`,role:`switch`,"aria-checked":g,"aria-required":c||void 0,isDisabled:s,className:`ds-switch__track`,onClick:e=>{if(d?.(e),e.defaultPrevented)return;let t=!g;i===void 0&&h(t),o?.(t)},...f,children:(0,n.jsx)(`span`,{className:`ds-switch__knob`,"aria-hidden":`true`})}),u&&(0,n.jsx)(`span`,{className:`ds-switch__label`,children:u})]})});exports.Switch=i;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|