@epilot/zenith-react 0.2.0-next.0 → 0.2.0-next.1
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/components/accordion/accordion.js +57 -48
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +120 -92
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar-group.js +38 -35
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/avatar.js +78 -71
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +60 -55
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +99 -54
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +87 -77
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +36 -32
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +105 -98
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js +62 -52
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +22 -19
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code-block/code-block.js +135 -123
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-editor/code-editor.js +276 -260
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js +62 -56
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
- package/dist/components/command/command.js +116 -105
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +38 -34
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +30 -26
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-order.js +79 -73
- package/dist/components/data-table/data-table-column-order.js.map +1 -1
- package/dist/components/data-table/data-table-column-visibility.js +25 -22
- package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
- package/dist/components/data-table/data-table-content.js +47 -44
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-error.js +36 -32
- package/dist/components/data-table/data-table-error.js.map +1 -1
- package/dist/components/data-table/data-table-footer.js +10 -8
- package/dist/components/data-table/data-table-footer.js.map +1 -1
- package/dist/components/data-table/data-table-header-draggable.js +40 -36
- package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
- package/dist/components/data-table/data-table-loading.js +21 -18
- package/dist/components/data-table/data-table-loading.js.map +1 -1
- package/dist/components/data-table/data-table-resize-handle.js +13 -11
- package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
- package/dist/components/data-table/data-table-row.js +47 -44
- package/dist/components/data-table/data-table-row.js.map +1 -1
- package/dist/components/data-table/data-table-toolbar.js +9 -7
- package/dist/components/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data-table/data-table.js +48 -46
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +173 -164
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/range-calendar.js +36 -34
- package/dist/components/date-range-picker/range-calendar.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +290 -272
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +22 -20
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +126 -120
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker.js +42 -40
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +95 -87
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/dialog/dialog.js +115 -95
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +144 -109
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +141 -112
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +196 -176
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +137 -126
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/list/list.js +237 -219
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +129 -116
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +55 -51
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +53 -36
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +38 -34
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +38 -35
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +166 -151
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +93 -85
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +149 -128
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js +19 -16
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +34 -30
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/spinner/spinner.js +22 -17
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/surface/surface.js +25 -22
- package/dist/components/surface/surface.js.map +1 -1
- package/dist/components/switch/switch.js +66 -57
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +139 -129
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +104 -90
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.js +206 -128
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/toast/toast.js +112 -100
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.js +32 -30
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +59 -46
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/lib/clear-button.js +18 -17
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/styles/host-reset.js +47 -0
- package/dist/styles/host-reset.js.map +1 -0
- package/dist/styles/overlay-layer.js +5 -0
- package/dist/styles/overlay-layer.js.map +1 -0
- package/dist/tokens.json +1 -1
- package/package.json +8 -7
- package/scripts/migration-diagnostics.mjs +42 -7
- package/scripts/migration-sweep.mjs +9 -1
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as F, Fragment as J } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { Root as
|
|
4
|
-
import { Item as
|
|
5
|
-
import { mergeClasses as
|
|
6
|
-
import { makeZenithStyles as
|
|
7
|
-
import {
|
|
8
|
-
|
|
3
|
+
import { Root as K } from "../../vendor/.bun/@radix-ui_react-toggle@1.1.10_2b23df507bdda662/vendor/@radix-ui/react-toggle/dist/index.js";
|
|
4
|
+
import { Item as Q, Root as tt } from "../../vendor/.bun/@radix-ui_react-toggle-group@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-toggle-group/dist/index.js";
|
|
5
|
+
import { mergeClasses as m, SLOT_ATTR as r, shorthands as s } from "@epilot/zenith-runtime/v1";
|
|
6
|
+
import { makeZenithStyles as ot } from "../../styles/make-styles.js";
|
|
7
|
+
import { boxModel as l, nativeControl as rt } from "../../styles/host-reset.js";
|
|
8
|
+
import { grayContrast as et, grayA3 as nt, accentContrast as it, accentSoft as C, accentSolid as b, grayA11 as at, fontWeightNormal as G, leadingXs as st, textXs as ct, fontWeightSemibold as dt, spacingElement1 as D, spacingElement2 as lt, accentLight as pt, accentA8 as P, grayA12 as ut, leadingSm as ht, textSm as mt, accentA7 as W, radiusLg as E, spacingElement3 as L, grayA6 as gt, spacingGroup1 as ft } from "../../tokens/index.js";
|
|
9
|
+
const Ct = "grid", bt = "OptionCard: a card inside an OptionCardGroup is missing a `value`. Give each card a unique `value` so it can be selected and controlled.", M = n.createContext(null), S = n.createContext(
|
|
9
10
|
null
|
|
10
|
-
),
|
|
11
|
+
), u = ot({
|
|
11
12
|
// Group layouts
|
|
12
13
|
group: {
|
|
14
|
+
...l,
|
|
13
15
|
// The GROUP only lays out. v1's group base class is literally "" -- every border, padding and
|
|
14
16
|
// interaction style below used to live here, copied from v1's CARD class onto the wrong element,
|
|
15
17
|
// while `styles.card` and `styles[layout]` were read but never declared. See make-styles.ts for
|
|
16
18
|
// why tsc accepted that for as long as it did.
|
|
17
19
|
display: "grid",
|
|
18
|
-
...s.gap(
|
|
20
|
+
...s.gap(ft)
|
|
19
21
|
},
|
|
20
22
|
// v1: grid-cols-[repeat(auto-fit,minmax(200px,1fr))]
|
|
21
23
|
grid: {
|
|
@@ -30,23 +32,24 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
30
32
|
// v1: plain `grid` with no template. One column, stacked.
|
|
31
33
|
column: {},
|
|
32
34
|
card: {
|
|
35
|
+
...rt,
|
|
33
36
|
position: "relative",
|
|
34
37
|
display: "flex",
|
|
35
38
|
alignItems: "center",
|
|
36
39
|
// v1 gap-3 = 0.75rem. No token: the semantic scale has no 0.75rem step.
|
|
37
|
-
...s.gap(
|
|
40
|
+
...s.gap(L),
|
|
38
41
|
overflow: "hidden",
|
|
39
|
-
...s.borderRadius(
|
|
42
|
+
...s.borderRadius(E),
|
|
40
43
|
// Not currentColor: that picked up this rule's `color: grayA12` and painted a near-black
|
|
41
44
|
// edge. The predecessor's bare `border` resolved to a subtle grey; grayA6 is its match.
|
|
42
|
-
...s.border("1px", "solid",
|
|
43
|
-
...s.paddingInline(
|
|
45
|
+
...s.border("1px", "solid", gt),
|
|
46
|
+
...s.paddingInline(L),
|
|
44
47
|
...s.paddingBlock("0.375rem"),
|
|
45
48
|
textAlign: "left",
|
|
46
|
-
fontSize:
|
|
47
|
-
lineHeight:
|
|
48
|
-
fontWeight:
|
|
49
|
-
color:
|
|
49
|
+
fontSize: mt,
|
|
50
|
+
lineHeight: ht,
|
|
51
|
+
fontWeight: G,
|
|
52
|
+
color: ut,
|
|
50
53
|
backgroundColor: "transparent",
|
|
51
54
|
transitionProperty: "color, background-color, border-color, box-shadow",
|
|
52
55
|
transitionDuration: "150ms",
|
|
@@ -59,31 +62,31 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
59
62
|
outlineWidth: "2px",
|
|
60
63
|
outlineStyle: "solid",
|
|
61
64
|
outlineOffset: "2px",
|
|
62
|
-
outlineColor:
|
|
65
|
+
outlineColor: P
|
|
63
66
|
},
|
|
64
67
|
":disabled, &[data-disabled]": {
|
|
65
68
|
pointerEvents: "none",
|
|
66
69
|
opacity: 0.5
|
|
67
70
|
},
|
|
68
71
|
"&[data-state='on']": {
|
|
69
|
-
backgroundColor:
|
|
70
|
-
...s.borderColor(
|
|
72
|
+
backgroundColor: C,
|
|
73
|
+
...s.borderColor(P)
|
|
71
74
|
},
|
|
72
75
|
[`&[data-state='on'] [${r}="option-card-radio-outer"]`]: {
|
|
73
|
-
...s.borderColor(
|
|
76
|
+
...s.borderColor(b)
|
|
74
77
|
},
|
|
75
78
|
[`&[data-state='on'] [${r}="option-card-radio-dot"]`]: {
|
|
76
79
|
opacity: 1
|
|
77
80
|
},
|
|
78
81
|
[`&[data-state='on'] [${r}="option-card-checkbox-outer"]`]: {
|
|
79
82
|
...s.borderColor("transparent"),
|
|
80
|
-
backgroundColor:
|
|
83
|
+
backgroundColor: b
|
|
81
84
|
},
|
|
82
85
|
[`&[data-state='on'] [${r}="option-card-checkbox-check"]`]: {
|
|
83
86
|
opacity: 1
|
|
84
87
|
},
|
|
85
88
|
[`&[data-state='on'] [${r}="option-card-switch-track"]`]: {
|
|
86
|
-
backgroundColor:
|
|
89
|
+
backgroundColor: b
|
|
87
90
|
},
|
|
88
91
|
[`&[data-state='on'] [${r}="option-card-switch-thumb"]`]: {
|
|
89
92
|
transform: "translateX(calc(100% - 1px))"
|
|
@@ -94,14 +97,15 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
94
97
|
flexShrink: 0
|
|
95
98
|
},
|
|
96
99
|
mediaIcon: {
|
|
100
|
+
...l,
|
|
97
101
|
display: "grid",
|
|
98
102
|
width: "2.5rem",
|
|
99
103
|
height: "2.5rem",
|
|
100
104
|
placeContent: "center",
|
|
101
105
|
alignSelf: "start",
|
|
102
|
-
...s.borderRadius(
|
|
103
|
-
backgroundColor:
|
|
104
|
-
color:
|
|
106
|
+
...s.borderRadius(E),
|
|
107
|
+
backgroundColor: C,
|
|
108
|
+
color: pt,
|
|
105
109
|
"& svg": {
|
|
106
110
|
width: "1.25rem",
|
|
107
111
|
height: "1.25rem"
|
|
@@ -128,6 +132,7 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
128
132
|
},
|
|
129
133
|
// Content
|
|
130
134
|
content: {
|
|
135
|
+
...l,
|
|
131
136
|
display: "grid",
|
|
132
137
|
minWidth: 0,
|
|
133
138
|
flexGrow: 1,
|
|
@@ -135,15 +140,16 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
135
140
|
flexBasis: "0%",
|
|
136
141
|
gridAutoRows: "min-content",
|
|
137
142
|
alignItems: "center",
|
|
138
|
-
columnGap:
|
|
139
|
-
paddingTop:
|
|
140
|
-
paddingBottom:
|
|
143
|
+
columnGap: lt,
|
|
144
|
+
paddingTop: D,
|
|
145
|
+
paddingBottom: D,
|
|
141
146
|
[`&:has([${r}="option-card-control"])`]: {
|
|
142
147
|
gridTemplateColumns: "1fr auto"
|
|
143
148
|
}
|
|
144
149
|
},
|
|
145
150
|
// Title
|
|
146
151
|
title: {
|
|
152
|
+
...l,
|
|
147
153
|
gridColumnStart: 1,
|
|
148
154
|
gridRowStart: 1,
|
|
149
155
|
minWidth: 0,
|
|
@@ -151,18 +157,19 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
151
157
|
overflow: "hidden",
|
|
152
158
|
textOverflow: "ellipsis",
|
|
153
159
|
whiteSpace: "nowrap",
|
|
154
|
-
fontWeight:
|
|
160
|
+
fontWeight: dt
|
|
155
161
|
},
|
|
156
162
|
// Description
|
|
157
163
|
description: {
|
|
164
|
+
...l,
|
|
158
165
|
gridColumnStart: 1,
|
|
159
166
|
gridRowStart: 2,
|
|
160
167
|
minWidth: 0,
|
|
161
168
|
overflowWrap: "break-word",
|
|
162
|
-
fontSize:
|
|
163
|
-
lineHeight:
|
|
164
|
-
fontWeight:
|
|
165
|
-
color:
|
|
169
|
+
fontSize: ct,
|
|
170
|
+
lineHeight: st,
|
|
171
|
+
fontWeight: G,
|
|
172
|
+
color: at
|
|
166
173
|
},
|
|
167
174
|
// Control
|
|
168
175
|
control: {
|
|
@@ -173,41 +180,45 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
173
180
|
},
|
|
174
181
|
// Radio glyph
|
|
175
182
|
radioOuter: {
|
|
183
|
+
...l,
|
|
176
184
|
display: "grid",
|
|
177
185
|
width: "1rem",
|
|
178
186
|
height: "1rem",
|
|
179
187
|
flexShrink: 0,
|
|
180
188
|
placeContent: "center",
|
|
181
189
|
borderRadius: "9999px",
|
|
182
|
-
...s.border("1px", "solid",
|
|
183
|
-
backgroundColor:
|
|
190
|
+
...s.border("1px", "solid", W),
|
|
191
|
+
backgroundColor: C,
|
|
184
192
|
transitionProperty: "border-color",
|
|
185
193
|
transitionDuration: "150ms"
|
|
186
194
|
},
|
|
187
195
|
radioDot: {
|
|
196
|
+
...l,
|
|
188
197
|
width: "0.5rem",
|
|
189
198
|
height: "0.5rem",
|
|
190
199
|
borderRadius: "9999px",
|
|
191
|
-
backgroundColor:
|
|
200
|
+
backgroundColor: b,
|
|
192
201
|
opacity: 0,
|
|
193
202
|
transitionProperty: "opacity",
|
|
194
203
|
transitionDuration: "150ms"
|
|
195
204
|
},
|
|
196
205
|
// Checkbox glyph
|
|
197
206
|
checkboxOuter: {
|
|
207
|
+
...l,
|
|
198
208
|
display: "grid",
|
|
199
209
|
width: "1rem",
|
|
200
210
|
height: "1rem",
|
|
201
211
|
flexShrink: 0,
|
|
202
212
|
placeContent: "center",
|
|
203
213
|
...s.borderRadius("4px"),
|
|
204
|
-
...s.border("1px", "solid",
|
|
205
|
-
backgroundColor:
|
|
206
|
-
color:
|
|
214
|
+
...s.border("1px", "solid", W),
|
|
215
|
+
backgroundColor: C,
|
|
216
|
+
color: it,
|
|
207
217
|
transitionProperty: "background-color, border-color",
|
|
208
218
|
transitionDuration: "150ms"
|
|
209
219
|
},
|
|
210
220
|
checkboxCheck: {
|
|
221
|
+
...l,
|
|
211
222
|
width: "0.75rem",
|
|
212
223
|
height: "0.75rem",
|
|
213
224
|
opacity: 0,
|
|
@@ -216,6 +227,7 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
216
227
|
},
|
|
217
228
|
// Switch glyph
|
|
218
229
|
switchTrack: {
|
|
230
|
+
...l,
|
|
219
231
|
display: "inline-flex",
|
|
220
232
|
height: "1.25rem",
|
|
221
233
|
width: "2.125rem",
|
|
@@ -223,23 +235,24 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
223
235
|
alignItems: "center",
|
|
224
236
|
borderRadius: "9999px",
|
|
225
237
|
...s.border("1px", "solid", "transparent"),
|
|
226
|
-
backgroundColor:
|
|
238
|
+
backgroundColor: nt,
|
|
227
239
|
transitionProperty: "background-color",
|
|
228
240
|
transitionDuration: "150ms"
|
|
229
241
|
},
|
|
230
242
|
switchThumb: {
|
|
243
|
+
...l,
|
|
231
244
|
display: "block",
|
|
232
245
|
width: "1rem",
|
|
233
246
|
height: "1rem",
|
|
234
247
|
transform: "translateX(1px)",
|
|
235
248
|
borderRadius: "9999px",
|
|
236
|
-
backgroundColor:
|
|
249
|
+
backgroundColor: et,
|
|
237
250
|
// v1 shadow-xs; no shadow tokens in this package.
|
|
238
251
|
boxShadow: "0 1px 2px 0 #0000000d",
|
|
239
252
|
transitionProperty: "transform",
|
|
240
253
|
transitionDuration: "150ms"
|
|
241
254
|
}
|
|
242
|
-
}),
|
|
255
|
+
}), xt = (o) => /* @__PURE__ */ t(
|
|
243
256
|
"svg",
|
|
244
257
|
{
|
|
245
258
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -249,8 +262,8 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
249
262
|
...o,
|
|
250
263
|
children: /* @__PURE__ */ t("path", { d: "m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z" })
|
|
251
264
|
}
|
|
252
|
-
),
|
|
253
|
-
const o =
|
|
265
|
+
), yt = () => {
|
|
266
|
+
const o = u();
|
|
254
267
|
return /* @__PURE__ */ t(
|
|
255
268
|
"span",
|
|
256
269
|
{
|
|
@@ -265,15 +278,15 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
265
278
|
)
|
|
266
279
|
}
|
|
267
280
|
);
|
|
268
|
-
},
|
|
269
|
-
const o =
|
|
281
|
+
}, wt = () => {
|
|
282
|
+
const o = u();
|
|
270
283
|
return /* @__PURE__ */ t(
|
|
271
284
|
"span",
|
|
272
285
|
{
|
|
273
286
|
className: o.checkboxOuter,
|
|
274
287
|
[r]: "option-card-checkbox-outer",
|
|
275
288
|
children: /* @__PURE__ */ t(
|
|
276
|
-
|
|
289
|
+
xt,
|
|
277
290
|
{
|
|
278
291
|
className: o.checkboxCheck,
|
|
279
292
|
[r]: "option-card-checkbox-check"
|
|
@@ -281,8 +294,8 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
281
294
|
)
|
|
282
295
|
}
|
|
283
296
|
);
|
|
284
|
-
},
|
|
285
|
-
const o =
|
|
297
|
+
}, kt = () => {
|
|
298
|
+
const o = u();
|
|
286
299
|
return /* @__PURE__ */ t(
|
|
287
300
|
"span",
|
|
288
301
|
{
|
|
@@ -297,40 +310,40 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
297
310
|
)
|
|
298
311
|
}
|
|
299
312
|
);
|
|
300
|
-
},
|
|
301
|
-
const d =
|
|
302
|
-
return /* @__PURE__ */ t(
|
|
303
|
-
|
|
313
|
+
}, Pt = n.forwardRef(function({ className: i, layout: e = Ct, ...a }, c) {
|
|
314
|
+
const d = u();
|
|
315
|
+
return /* @__PURE__ */ t(M.Provider, { value: { type: a.type, layout: e }, children: /* @__PURE__ */ t(
|
|
316
|
+
tt,
|
|
304
317
|
{
|
|
305
318
|
ref: c,
|
|
306
319
|
"data-slot": "option-card-group",
|
|
307
320
|
[r]: "option-card-group",
|
|
308
321
|
"data-layout": e,
|
|
309
322
|
...a.type === "single" ? { role: "radiogroup" } : {},
|
|
310
|
-
className:
|
|
323
|
+
className: m(d.group, d[e], i),
|
|
311
324
|
...a
|
|
312
325
|
}
|
|
313
326
|
) });
|
|
314
327
|
}), _ = n.forwardRef(function({ className: i, type: e, ...a }, c) {
|
|
315
|
-
const d =
|
|
328
|
+
const d = u(), p = n.useContext(S), g = p == null ? void 0 : p.registerType;
|
|
316
329
|
n.useEffect(() => {
|
|
317
|
-
e &&
|
|
318
|
-
}, [e,
|
|
319
|
-
const
|
|
320
|
-
return
|
|
330
|
+
e && g && g(e);
|
|
331
|
+
}, [e, g]);
|
|
332
|
+
const f = e ?? (p == null ? void 0 : p.controlType) ?? "checkbox";
|
|
333
|
+
return f === "none" ? null : /* @__PURE__ */ t(
|
|
321
334
|
"span",
|
|
322
335
|
{
|
|
323
336
|
ref: c,
|
|
324
337
|
"aria-hidden": "true",
|
|
325
338
|
"data-slot": "option-card-control",
|
|
326
339
|
[r]: "option-card-control",
|
|
327
|
-
className:
|
|
340
|
+
className: m(d.control, i),
|
|
328
341
|
...a,
|
|
329
|
-
children:
|
|
342
|
+
children: f === "radio" ? /* @__PURE__ */ t(yt, {}) : f === "switch" ? /* @__PURE__ */ t(kt, {}) : /* @__PURE__ */ t(wt, {})
|
|
330
343
|
}
|
|
331
344
|
);
|
|
332
|
-
}),
|
|
333
|
-
const d =
|
|
345
|
+
}), $ = n.forwardRef(function({ className: i, variant: e = "icon", ...a }, c) {
|
|
346
|
+
const d = u();
|
|
334
347
|
return /* @__PURE__ */ t(
|
|
335
348
|
"span",
|
|
336
349
|
{
|
|
@@ -339,7 +352,7 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
339
352
|
"data-slot": "option-card-media",
|
|
340
353
|
[r]: "option-card-media",
|
|
341
354
|
"data-variant": e,
|
|
342
|
-
className:
|
|
355
|
+
className: m(
|
|
343
356
|
d.mediaRoot,
|
|
344
357
|
e === "illustration" ? d.mediaIllustration : d.mediaIcon,
|
|
345
358
|
i
|
|
@@ -347,110 +360,110 @@ const gt = "grid", ft = "OptionCard: a card inside an OptionCardGroup is missing
|
|
|
347
360
|
...a
|
|
348
361
|
}
|
|
349
362
|
);
|
|
350
|
-
}),
|
|
351
|
-
const c =
|
|
363
|
+
}), St = n.forwardRef(function({ className: i, ...e }, a) {
|
|
364
|
+
const c = u();
|
|
352
365
|
return /* @__PURE__ */ t(
|
|
353
366
|
"span",
|
|
354
367
|
{
|
|
355
368
|
ref: a,
|
|
356
369
|
"data-slot": "option-card-title",
|
|
357
370
|
[r]: "option-card-title",
|
|
358
|
-
className:
|
|
371
|
+
className: m(c.title, i),
|
|
359
372
|
...e
|
|
360
373
|
}
|
|
361
374
|
);
|
|
362
|
-
}),
|
|
363
|
-
const c =
|
|
375
|
+
}), Wt = n.forwardRef(function({ className: i, ...e }, a) {
|
|
376
|
+
const c = u();
|
|
364
377
|
return /* @__PURE__ */ t(
|
|
365
378
|
"span",
|
|
366
379
|
{
|
|
367
380
|
ref: a,
|
|
368
381
|
"data-slot": "option-card-description",
|
|
369
382
|
[r]: "option-card-description",
|
|
370
|
-
className:
|
|
383
|
+
className: m(c.description, i),
|
|
371
384
|
...e
|
|
372
385
|
}
|
|
373
386
|
);
|
|
374
|
-
}),
|
|
387
|
+
}), vt = (o) => n.Children.toArray(o).some(
|
|
375
388
|
(i) => n.isValidElement(i) && i.type === _
|
|
376
|
-
),
|
|
377
|
-
const d =
|
|
378
|
-
return /* @__PURE__ */
|
|
389
|
+
), q = n.forwardRef(function({ className: i, children: e, ...a }, c) {
|
|
390
|
+
const d = u();
|
|
391
|
+
return /* @__PURE__ */ F(
|
|
379
392
|
"span",
|
|
380
393
|
{
|
|
381
394
|
ref: c,
|
|
382
395
|
"data-slot": "option-card-content",
|
|
383
396
|
[r]: "option-card-content",
|
|
384
|
-
className:
|
|
397
|
+
className: m(d.content, i),
|
|
385
398
|
...a,
|
|
386
399
|
children: [
|
|
387
400
|
e,
|
|
388
|
-
!
|
|
401
|
+
!vt(e) && /* @__PURE__ */ t(_, {})
|
|
389
402
|
]
|
|
390
403
|
}
|
|
391
404
|
);
|
|
392
|
-
}),
|
|
405
|
+
}), k = (o, ...i) => n.isValidElement(o) && i.includes(o.type), Et = n.forwardRef(
|
|
393
406
|
function({
|
|
394
407
|
className: i,
|
|
395
408
|
children: e,
|
|
396
409
|
value: a,
|
|
397
410
|
pressed: c,
|
|
398
411
|
defaultPressed: d,
|
|
399
|
-
onPressedChange:
|
|
400
|
-
...
|
|
401
|
-
},
|
|
402
|
-
const
|
|
403
|
-
process.env.NODE_ENV !== "production" &&
|
|
404
|
-
const [B,
|
|
412
|
+
onPressedChange: p,
|
|
413
|
+
...g
|
|
414
|
+
}, f) {
|
|
415
|
+
const v = u(), R = n.useContext(M), x = R !== null, j = n.useId();
|
|
416
|
+
process.env.NODE_ENV !== "production" && x && a === void 0 && console.warn(bt);
|
|
417
|
+
const [B, V] = n.useState(
|
|
405
418
|
d ?? !1
|
|
406
|
-
),
|
|
407
|
-
|
|
408
|
-
},
|
|
409
|
-
() => ({ controlType:
|
|
410
|
-
[
|
|
411
|
-
),
|
|
412
|
-
|
|
413
|
-
|
|
419
|
+
), O = c !== void 0, T = O ? c : B, X = (h) => {
|
|
420
|
+
O || V(h), p == null || p(h);
|
|
421
|
+
}, z = x ? R.type === "multiple" ? "checkbox" : "radio" : "checkbox", [y, U] = n.useState(z), N = n.useMemo(
|
|
422
|
+
() => ({ controlType: y, registerType: U }),
|
|
423
|
+
[y]
|
|
424
|
+
), w = n.Children.toArray(e), H = w.some((h) => k(h, q)), Z = w.filter((h) => k(h, $)), A = w.filter((h) => !k(h, $)), I = /* @__PURE__ */ F(J, { children: [
|
|
425
|
+
Z,
|
|
426
|
+
H ? A : /* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(St, { children: A }) })
|
|
414
427
|
] });
|
|
415
|
-
if (
|
|
416
|
-
return /* @__PURE__ */ t(
|
|
417
|
-
|
|
428
|
+
if (x)
|
|
429
|
+
return /* @__PURE__ */ t(S.Provider, { value: N, children: /* @__PURE__ */ t(
|
|
430
|
+
Q,
|
|
418
431
|
{
|
|
419
|
-
ref:
|
|
432
|
+
ref: f,
|
|
420
433
|
"data-slot": "option-card",
|
|
421
434
|
[r]: "option-card",
|
|
422
435
|
value: a ?? j,
|
|
423
|
-
className:
|
|
424
|
-
...
|
|
425
|
-
children:
|
|
436
|
+
className: m(v.card, i),
|
|
437
|
+
...g,
|
|
438
|
+
children: I
|
|
426
439
|
}
|
|
427
440
|
) });
|
|
428
|
-
const
|
|
429
|
-
return /* @__PURE__ */ t(
|
|
430
|
-
|
|
441
|
+
const Y = y === "switch" ? "switch" : "checkbox";
|
|
442
|
+
return /* @__PURE__ */ t(S.Provider, { value: N, children: /* @__PURE__ */ t(
|
|
443
|
+
K,
|
|
431
444
|
{
|
|
432
|
-
ref:
|
|
445
|
+
ref: f,
|
|
433
446
|
"data-slot": "option-card",
|
|
434
447
|
[r]: "option-card",
|
|
435
|
-
pressed:
|
|
436
|
-
onPressedChange:
|
|
437
|
-
role:
|
|
438
|
-
"aria-checked":
|
|
448
|
+
pressed: T,
|
|
449
|
+
onPressedChange: X,
|
|
450
|
+
role: Y,
|
|
451
|
+
"aria-checked": T,
|
|
439
452
|
"aria-pressed": void 0,
|
|
440
|
-
className:
|
|
441
|
-
...
|
|
442
|
-
children:
|
|
453
|
+
className: m(v.card, i),
|
|
454
|
+
...g,
|
|
455
|
+
children: I
|
|
443
456
|
}
|
|
444
457
|
) });
|
|
445
458
|
}
|
|
446
459
|
);
|
|
447
460
|
export {
|
|
448
|
-
|
|
449
|
-
|
|
461
|
+
Et as OptionCard,
|
|
462
|
+
q as OptionCardContent,
|
|
450
463
|
_ as OptionCardControl,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
464
|
+
Wt as OptionCardDescription,
|
|
465
|
+
Pt as OptionCardGroup,
|
|
466
|
+
$ as OptionCardMedia,
|
|
467
|
+
St as OptionCardTitle
|
|
455
468
|
};
|
|
456
469
|
//# sourceMappingURL=option-card.js.map
|