@sanity/ui 5.0.0-alpha.10 → 5.0.0-alpha.11

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.
Files changed (39) hide show
  1. package/dist/LazyRefractor-CQ22IeXB.js +19 -0
  2. package/dist/LazyRefractor-CQ22IeXB.js.map +1 -0
  3. package/dist/index.d.ts +405 -825
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +2033 -1972
  6. package/dist/index.js.map +1 -1
  7. package/dist/polyfills.d.ts +1 -1
  8. package/dist/polyfills.js +4 -4
  9. package/dist/polyfills.js.map +1 -1
  10. package/dist/styles.css +1 -1
  11. package/package.json +8 -7
  12. package/src/components/box/Box.tsx +1 -6
  13. package/src/components/box/box.css +5 -0
  14. package/src/components/checkbox/Checkbox.tsx +1 -1
  15. package/src/components/container/Container.tsx +5 -1
  16. package/src/components/container/container.css +4 -0
  17. package/src/components/flex/Flex.tsx +1 -6
  18. package/src/components/flex/flex.css +5 -0
  19. package/src/components/grid/Grid.tsx +1 -6
  20. package/src/components/grid/grid.css +5 -0
  21. package/src/components/h-stack/HStack.tsx +8 -14
  22. package/src/components/h-stack/hStack.props.ts +5 -15
  23. package/src/components/index.css +1 -0
  24. package/src/components/select/Select.tsx +47 -0
  25. package/src/components/select/select.css +67 -0
  26. package/src/components/select/select.props.ts +25 -0
  27. package/src/components/v-stack/VStack.tsx +8 -14
  28. package/src/components/v-stack/vStack.props.ts +5 -15
  29. package/src/css/classes/system/shadow.css +6 -6
  30. package/src/css/global/reset.css +12 -1
  31. package/src/css/tokens/surface.css +2 -0
  32. package/src/index.ts +3 -0
  33. package/src/polyfills.ts +2 -0
  34. package/src/props/formElement.ts +34 -0
  35. package/src/types/FormElement.ts +2 -0
  36. package/src/utils/getProps.ts +1 -1
  37. package/src/version.ts +2 -2
  38. package/dist/_chunks-es/LazyRefractor.js +0 -20
  39. package/dist/_chunks-es/LazyRefractor.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,2134 +1,2195 @@
1
1
  "use client";
2
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
2
  import { c } from "react/compiler-runtime";
4
3
  import clsx from "clsx";
5
- import { isValidElement, useRef, useEffect, lazy, Suspense, useId, Children, useSyncExternalStore, useState, cloneElement, Activity } from "react";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { Activity, Children, Suspense, cloneElement, isValidElement, lazy, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
6
6
  import { SpinnerIcon } from "@sanity/icons/Spinner";
7
7
  import { CheckmarkIcon } from "@sanity/icons/Checkmark";
8
8
  import { RemoveIcon } from "@sanity/icons/Remove";
9
9
  import { CloseIcon } from "@sanity/icons/Close";
10
10
  import { createPortal } from "react-dom";
11
- const PREFIX = "sui", BREAKPOINTS_LENGTH = 6;
11
+ import SelectIcon from "@sanity/icons/Select";
12
12
  function getProps(componentProps, propDefs) {
13
- const {
14
- allComponentProps,
15
- allPropDefs
16
- } = flattenCompositeProps(componentProps, propDefs), restProps = {};
17
- let className = componentProps?.className || "", style = componentProps?.style || {};
18
- for (const key in allComponentProps) {
19
- const propDef = allPropDefs?.[key], propValue = allComponentProps[key];
20
- if (!(propDef && "className" in propDef && propDef.className || propDef?.type === "conditional")) {
21
- restProps[key] = propValue;
22
- continue;
23
- }
24
- if (Array.isArray(propValue))
25
- for (let i = 0, len = Math.min(propValue.length, BREAKPOINTS_LENGTH); i < len; i++) {
26
- const resolvedPropDef = getResolvedPropDef(propValue[i], propDef);
27
- resolvedPropDef && (className = clsx(className, getClassName(propValue[i], resolvedPropDef, i)), style = {
28
- ...style,
29
- ...getStyle(propValue[i], resolvedPropDef, i)
30
- });
31
- }
32
- else {
33
- const resolvedPropDef = getResolvedPropDef(propValue, propDef);
34
- if (!resolvedPropDef) {
35
- restProps[key] = propValue;
36
- continue;
37
- }
38
- className = clsx(className, getClassName(propValue, resolvedPropDef)), style = {
39
- ...style,
40
- ...getStyle(propValue, resolvedPropDef)
41
- };
42
- }
43
- }
44
- return {
45
- ...restProps,
46
- className,
47
- style
48
- };
13
+ let { allComponentProps, allPropDefs } = flattenCompositeProps(componentProps, propDefs), restProps = {}, className = componentProps?.className || "", style = componentProps?.style || {};
14
+ for (let key in allComponentProps) {
15
+ let propDef = allPropDefs?.[key], propValue = allComponentProps[key];
16
+ if (!(propDef && "className" in propDef && propDef.className || propDef?.type === "conditional")) {
17
+ restProps[key] = propValue;
18
+ continue;
19
+ }
20
+ if (Array.isArray(propValue)) for (let i = 0, len = Math.min(propValue.length, 6); i < len; i++) {
21
+ let resolvedPropDef = getResolvedPropDef(propValue[i], propDef);
22
+ resolvedPropDef && (className = clsx(className, getClassName(propValue[i], resolvedPropDef, i)), style = {
23
+ ...style,
24
+ ...getStyle(propValue[i], resolvedPropDef, i)
25
+ });
26
+ }
27
+ else {
28
+ let resolvedPropDef = getResolvedPropDef(propValue, propDef);
29
+ if (!resolvedPropDef) {
30
+ restProps[key] = propValue;
31
+ continue;
32
+ }
33
+ className = clsx(className, getClassName(propValue, resolvedPropDef)), style = {
34
+ ...style,
35
+ ...getStyle(propValue, resolvedPropDef)
36
+ };
37
+ }
38
+ }
39
+ return {
40
+ ...restProps,
41
+ className,
42
+ style
43
+ };
49
44
  }
50
45
  function getResolvedPropDef(propValue, propDef) {
51
- if (propDef?.type !== "conditional")
52
- return propDef;
53
- const resolvedPropDef = propDef.resolve(propValue);
54
- return resolvedPropDef && "className" in resolvedPropDef && resolvedPropDef.className ? resolvedPropDef : null;
46
+ if (propDef?.type !== "conditional") return propDef;
47
+ let resolvedPropDef = propDef.resolve(propValue);
48
+ return resolvedPropDef && "className" in resolvedPropDef && resolvedPropDef.className ? resolvedPropDef : null;
55
49
  }
56
50
  function getClassName(propValue, propDef, bp) {
57
- if (propDef.type === "union" && propDef.values?.includes(propValue))
58
- return `${PREFIX}-${propDef.className}${typeof propValue == "string" ? `-${propValue}` : propValue}${bp ? `-bp-${bp}` : ""}`;
59
- if (propDef.type === "string" || propDef.type === "number")
60
- return `${PREFIX}-${propDef.className}${bp ? `-bp-${bp}` : ""}`;
61
- if (propDef.type === "boolean") {
62
- if (propValue)
63
- return `${PREFIX}-${propDef.className}${bp ? `-bp-${bp}` : ""}`;
64
- if (!propValue && propDef.inverseClassName)
65
- return `${PREFIX}-${propDef.inverseClassName}${bp ? `-bp-${bp}` : ""}`;
66
- }
67
- return "";
51
+ if (propDef.type === "union" && propDef.values?.includes(propValue)) return `sui-${propDef.className}${typeof propValue == "string" ? `-${propValue}` : propValue}${bp ? `-bp-${bp}` : ""}`;
52
+ if (propDef.type === "string" || propDef.type === "number") return `sui-${propDef.className}${bp ? `-bp-${bp}` : ""}`;
53
+ if (propDef.type === "boolean") {
54
+ if (propValue) return `sui-${propDef.className}${bp ? `-bp-${bp}` : ""}`;
55
+ if (!propValue && propDef.inverseClassName) return `sui-${propDef.inverseClassName}${bp ? `-bp-${bp}` : ""}`;
56
+ }
57
+ return "";
68
58
  }
69
59
  function getStyle(propValue, propDef, bp) {
70
- return (propDef.type === "string" || propDef.type === "number") && propDef.variable ? {
71
- [`${propDef.variable}${bp ? `-bp-${bp}` : ""}`]: propValue
72
- } : {};
60
+ return (propDef.type === "string" || propDef.type === "number") && propDef.variable ? { [`${propDef.variable}${bp ? `-bp-${bp}` : ""}`]: propValue } : {};
73
61
  }
74
62
  function flattenCompositeProps(componentProps, propDefs) {
75
- const props = {
76
- allComponentProps: {},
77
- allPropDefs: {}
78
- };
79
- for (const key in componentProps)
80
- if (propDefs?.[key] && propDefs?.[key].type === "composite")
81
- for (const compositeKey in propDefs?.[key].composition) {
82
- const compositeValue = getCompositeValue(componentProps[key], propDefs[key], compositeKey);
83
- props.allComponentProps[compositeKey] = compositeValue, props.allPropDefs[compositeKey] = propDefs[key].composition[compositeKey]?.propDef;
84
- }
85
- else
86
- props.allComponentProps[key] = componentProps[key], props.allPropDefs[key] = propDefs?.[key];
87
- return props;
63
+ let props = {
64
+ allComponentProps: {},
65
+ allPropDefs: {}
66
+ };
67
+ for (let key in componentProps) if (propDefs?.[key] && propDefs?.[key].type === "composite") for (let compositeKey in propDefs?.[key].composition) {
68
+ let compositeValue = getCompositeValue(componentProps[key], propDefs[key], compositeKey);
69
+ props.allComponentProps[compositeKey] = compositeValue, props.allPropDefs[compositeKey] = propDefs[key].composition[compositeKey]?.propDef;
70
+ }
71
+ else props.allComponentProps[key] = componentProps[key], props.allPropDefs[key] = propDefs?.[key];
72
+ return props;
88
73
  }
89
74
  function getCompositeValue(propValue, propDef, key) {
90
- if (!("composition" in propDef))
91
- return;
92
- const mapping = propDef.composition[key]?.mapping;
93
- let compositeValue;
94
- if (Array.isArray(propValue)) {
95
- compositeValue = [];
96
- for (let i = 0, len = propValue.length; i < len; i++)
97
- compositeValue[i] = mapping?.[propValue[i]];
98
- } else
99
- compositeValue = mapping?.[propValue];
100
- return compositeValue;
75
+ if (!("composition" in propDef)) return;
76
+ let mapping = propDef.composition[key]?.mapping, compositeValue;
77
+ if (Array.isArray(propValue)) {
78
+ compositeValue = [];
79
+ for (let i = 0, len = propValue.length; i < len; i++) compositeValue[i] = mapping?.[propValue[i]];
80
+ } else compositeValue = mapping?.[propValue];
81
+ return compositeValue;
101
82
  }
102
- const HASH = "ad9fa1";
103
83
  function suffixClassName(className) {
104
- return `${className}-${HASH}`;
84
+ return `${className}-8b95a0`;
105
85
  }
106
- const RADIUS = [0, 1, 2, 3, 4, 5, 6, "full"], borderProps = {
107
- border: {
108
- type: "boolean",
109
- className: "border",
110
- inverseClassName: "border-none"
111
- },
112
- borderTop: {
113
- type: "boolean",
114
- className: "border-top",
115
- inverseClassName: "border-top-none"
116
- },
117
- borderRight: {
118
- type: "boolean",
119
- className: "border-right",
120
- inverseClassName: "border-right-none"
121
- },
122
- borderBottom: {
123
- type: "boolean",
124
- className: "border-bottom",
125
- inverseClassName: "border-bottom-none"
126
- },
127
- borderLeft: {
128
- type: "boolean",
129
- className: "border-left",
130
- inverseClassName: "border-left-none"
131
- },
132
- radius: {
133
- type: "union",
134
- className: "radius",
135
- values: RADIUS
136
- }
86
+ const borderProps = {
87
+ border: {
88
+ type: "boolean",
89
+ className: "border",
90
+ inverseClassName: "border-none"
91
+ },
92
+ borderTop: {
93
+ type: "boolean",
94
+ className: "border-top",
95
+ inverseClassName: "border-top-none"
96
+ },
97
+ borderRight: {
98
+ type: "boolean",
99
+ className: "border-right",
100
+ inverseClassName: "border-right-none"
101
+ },
102
+ borderBottom: {
103
+ type: "boolean",
104
+ className: "border-bottom",
105
+ inverseClassName: "border-bottom-none"
106
+ },
107
+ borderLeft: {
108
+ type: "boolean",
109
+ className: "border-left",
110
+ inverseClassName: "border-left-none"
111
+ },
112
+ radius: {
113
+ type: "union",
114
+ className: "radius",
115
+ values: [
116
+ 0,
117
+ 1,
118
+ 2,
119
+ 3,
120
+ 4,
121
+ 5,
122
+ 6,
123
+ "full"
124
+ ]
125
+ }
137
126
  }, flexChildProps = {
138
- flexBasis: {
139
- type: "string",
140
- className: "flex-basis",
141
- variable: "--flex-basis"
142
- },
143
- flexGrow: {
144
- type: "number",
145
- className: "flex-grow",
146
- variable: "--flex-grow"
147
- },
148
- flexShrink: {
149
- type: "number",
150
- className: "flex-shrink",
151
- variable: "--flex-shrink"
152
- }
127
+ flexBasis: {
128
+ type: "string",
129
+ className: "flex-basis",
130
+ variable: "--flex-basis"
131
+ },
132
+ flexGrow: {
133
+ type: "number",
134
+ className: "flex-grow",
135
+ variable: "--flex-grow"
136
+ },
137
+ flexShrink: {
138
+ type: "number",
139
+ className: "flex-shrink",
140
+ variable: "--flex-shrink"
141
+ }
153
142
  }, gridChildProps = {
154
- gridColumn: {
155
- type: "string",
156
- className: "grid-column",
157
- variable: "--grid-column"
158
- },
159
- gridColumnStart: {
160
- type: "string",
161
- className: "grid-column-start",
162
- variable: "--grid-column-start"
163
- },
164
- gridColumnEnd: {
165
- type: "string",
166
- className: "grid-column-end",
167
- variable: "--grid-column-end"
168
- },
169
- gridRow: {
170
- type: "string",
171
- className: "grid-row",
172
- variable: "--grid-row"
173
- },
174
- gridRowStart: {
175
- type: "string",
176
- className: "grid-row-start",
177
- variable: "--grid-row-start"
178
- },
179
- gridRowEnd: {
180
- type: "string",
181
- className: "grid-row-end",
182
- variable: "--grid-row-end"
183
- }
143
+ gridColumn: {
144
+ type: "string",
145
+ className: "grid-column",
146
+ variable: "--grid-column"
147
+ },
148
+ gridColumnStart: {
149
+ type: "string",
150
+ className: "grid-column-start",
151
+ variable: "--grid-column-start"
152
+ },
153
+ gridColumnEnd: {
154
+ type: "string",
155
+ className: "grid-column-end",
156
+ variable: "--grid-column-end"
157
+ },
158
+ gridRow: {
159
+ type: "string",
160
+ className: "grid-row",
161
+ variable: "--grid-row"
162
+ },
163
+ gridRowStart: {
164
+ type: "string",
165
+ className: "grid-row-start",
166
+ variable: "--grid-row-start"
167
+ },
168
+ gridRowEnd: {
169
+ type: "string",
170
+ className: "grid-row-end",
171
+ variable: "--grid-row-end"
172
+ }
184
173
  }, heightProps = {
185
- height: {
186
- type: "string",
187
- className: "height",
188
- variable: "--height"
189
- },
190
- minHeight: {
191
- type: "string",
192
- className: "min-height",
193
- variable: "--min-height"
194
- },
195
- maxHeight: {
196
- type: "string",
197
- className: "max-height",
198
- variable: "--max-height"
199
- }
200
- }, SPACE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], SPACE_AUTO = [...SPACE, "auto"], SPACE_INHERIT = [...SPACE, "inherit"], SPACE_AUTO_NEGATIVE = [-9, -8, -7, -6, -5, -4, -3, -2, -1, ...SPACE, "auto"], marginProps = {
201
- margin: {
202
- type: "union",
203
- className: "m",
204
- values: SPACE_AUTO_NEGATIVE
205
- },
206
- marginX: {
207
- type: "union",
208
- className: "mx",
209
- values: SPACE_AUTO_NEGATIVE
210
- },
211
- marginY: {
212
- type: "union",
213
- className: "my",
214
- values: SPACE_AUTO_NEGATIVE
215
- },
216
- marginTop: {
217
- type: "union",
218
- className: "mt",
219
- values: SPACE_AUTO_NEGATIVE
220
- },
221
- marginRight: {
222
- type: "union",
223
- className: "mr",
224
- values: SPACE_AUTO_NEGATIVE
225
- },
226
- marginBottom: {
227
- type: "union",
228
- className: "mb",
229
- values: SPACE_AUTO_NEGATIVE
230
- },
231
- marginLeft: {
232
- type: "union",
233
- className: "ml",
234
- values: SPACE_AUTO_NEGATIVE
235
- }
236
- }, OVERFLOW = ["visible", "hidden", "auto", "scroll", "clip"], overflowProps = {
237
- overflow: {
238
- type: "union",
239
- className: "overflow",
240
- values: OVERFLOW
241
- },
242
- overflowX: {
243
- type: "union",
244
- className: "overflow-x",
245
- values: OVERFLOW
246
- },
247
- overflowY: {
248
- type: "union",
249
- className: "overflow-y",
250
- values: OVERFLOW
251
- }
174
+ height: {
175
+ type: "string",
176
+ className: "height",
177
+ variable: "--height"
178
+ },
179
+ minHeight: {
180
+ type: "string",
181
+ className: "min-height",
182
+ variable: "--min-height"
183
+ },
184
+ maxHeight: {
185
+ type: "string",
186
+ className: "max-height",
187
+ variable: "--max-height"
188
+ }
189
+ }, SPACE = [
190
+ 0,
191
+ 1,
192
+ 2,
193
+ 3,
194
+ 4,
195
+ 5,
196
+ 6,
197
+ 7,
198
+ 8,
199
+ 9
200
+ ], SPACE_AUTO = [...SPACE, "auto"], SPACE_INHERIT = [...SPACE, "inherit"], SPACE_AUTO_NEGATIVE = [
201
+ -9,
202
+ -8,
203
+ -7,
204
+ -6,
205
+ -5,
206
+ -4,
207
+ -3,
208
+ -2,
209
+ -1,
210
+ ...SPACE,
211
+ "auto"
212
+ ], marginProps = {
213
+ margin: {
214
+ type: "union",
215
+ className: "m",
216
+ values: SPACE_AUTO_NEGATIVE
217
+ },
218
+ marginX: {
219
+ type: "union",
220
+ className: "mx",
221
+ values: SPACE_AUTO_NEGATIVE
222
+ },
223
+ marginY: {
224
+ type: "union",
225
+ className: "my",
226
+ values: SPACE_AUTO_NEGATIVE
227
+ },
228
+ marginTop: {
229
+ type: "union",
230
+ className: "mt",
231
+ values: SPACE_AUTO_NEGATIVE
232
+ },
233
+ marginRight: {
234
+ type: "union",
235
+ className: "mr",
236
+ values: SPACE_AUTO_NEGATIVE
237
+ },
238
+ marginBottom: {
239
+ type: "union",
240
+ className: "mb",
241
+ values: SPACE_AUTO_NEGATIVE
242
+ },
243
+ marginLeft: {
244
+ type: "union",
245
+ className: "ml",
246
+ values: SPACE_AUTO_NEGATIVE
247
+ }
248
+ }, OVERFLOW = [
249
+ "visible",
250
+ "hidden",
251
+ "auto",
252
+ "scroll",
253
+ "clip"
254
+ ], overflowProps = {
255
+ overflow: {
256
+ type: "union",
257
+ className: "overflow",
258
+ values: OVERFLOW
259
+ },
260
+ overflowX: {
261
+ type: "union",
262
+ className: "overflow-x",
263
+ values: OVERFLOW
264
+ },
265
+ overflowY: {
266
+ type: "union",
267
+ className: "overflow-y",
268
+ values: OVERFLOW
269
+ }
252
270
  }, paddingProps = {
253
- padding: {
254
- type: "union",
255
- className: "p",
256
- values: SPACE
257
- },
258
- paddingX: {
259
- type: "union",
260
- className: "px",
261
- values: SPACE
262
- },
263
- paddingY: {
264
- type: "union",
265
- className: "py",
266
- values: SPACE
267
- },
268
- paddingTop: {
269
- type: "union",
270
- className: "pt",
271
- values: SPACE
272
- },
273
- paddingRight: {
274
- type: "union",
275
- className: "pr",
276
- values: SPACE
277
- },
278
- paddingBottom: {
279
- type: "union",
280
- className: "pb",
281
- values: SPACE
282
- },
283
- paddingLeft: {
284
- type: "union",
285
- className: "pl",
286
- values: SPACE
287
- }
288
- }, POSITION = ["absolute", "fixed", "relative", "static", "sticky"], positionProps = {
289
- position: {
290
- type: "union",
291
- className: "position",
292
- values: POSITION
293
- },
294
- inset: {
295
- type: "union",
296
- className: "inset",
297
- values: SPACE_AUTO
298
- },
299
- top: {
300
- type: "union",
301
- className: "top",
302
- values: SPACE_AUTO
303
- },
304
- right: {
305
- type: "union",
306
- className: "right",
307
- values: SPACE_AUTO
308
- },
309
- bottom: {
310
- type: "union",
311
- className: "bottom",
312
- values: SPACE_AUTO
313
- },
314
- left: {
315
- type: "union",
316
- className: "left",
317
- values: SPACE_AUTO
318
- }
319
- }, SHADOW = [0, 1, 2, 3, 4, 5], shadowProps = {
320
- shadow: {
321
- type: "union",
322
- className: "shadow",
323
- values: SHADOW
324
- }
325
- }, TONE = ["neutral", "positive", "suggest", "caution", "critical"], toneProps = {
326
- tone: {
327
- type: "union",
328
- className: "tone",
329
- values: TONE
330
- }
331
- }, widthProps = {
332
- width: {
333
- type: "string",
334
- className: "width",
335
- variable: "--width"
336
- },
337
- minWidth: {
338
- type: "string",
339
- className: "min-width",
340
- variable: "--min-width"
341
- },
342
- maxWidth: {
343
- type: "string",
344
- className: "max-width",
345
- variable: "--max-width"
346
- }
347
- }, zIndexProps = {
348
- zIndex: {
349
- type: "number",
350
- className: "z-index",
351
- variable: "--z-index"
352
- }
353
- }, layoutProps = {
354
- ...toneProps,
355
- ...widthProps,
356
- ...heightProps,
357
- ...marginProps,
358
- ...borderProps,
359
- ...paddingProps,
360
- ...positionProps,
361
- ...overflowProps,
362
- ...flexChildProps,
363
- ...gridChildProps,
364
- ...shadowProps,
365
- ...zIndexProps
366
- }, DISPLAY_BLOCK = ["block", "inline-block", "none"], DISPLAY_FLEX = ["flex", "inline-flex", "none"], DISPLAY_GRID = ["grid", "inline-grid", "none"], boxProps = {
367
- as: {
368
- type: "string"
369
- },
370
- display: {
371
- type: "union",
372
- className: "display",
373
- values: DISPLAY_BLOCK
374
- },
375
- ...layoutProps
271
+ padding: {
272
+ type: "union",
273
+ className: "p",
274
+ values: SPACE
275
+ },
276
+ paddingX: {
277
+ type: "union",
278
+ className: "px",
279
+ values: SPACE
280
+ },
281
+ paddingY: {
282
+ type: "union",
283
+ className: "py",
284
+ values: SPACE
285
+ },
286
+ paddingTop: {
287
+ type: "union",
288
+ className: "pt",
289
+ values: SPACE
290
+ },
291
+ paddingRight: {
292
+ type: "union",
293
+ className: "pr",
294
+ values: SPACE
295
+ },
296
+ paddingBottom: {
297
+ type: "union",
298
+ className: "pb",
299
+ values: SPACE
300
+ },
301
+ paddingLeft: {
302
+ type: "union",
303
+ className: "pl",
304
+ values: SPACE
305
+ }
306
+ }, positionProps = {
307
+ position: {
308
+ type: "union",
309
+ className: "position",
310
+ values: [
311
+ "absolute",
312
+ "fixed",
313
+ "relative",
314
+ "static",
315
+ "sticky"
316
+ ]
317
+ },
318
+ inset: {
319
+ type: "union",
320
+ className: "inset",
321
+ values: SPACE_AUTO
322
+ },
323
+ top: {
324
+ type: "union",
325
+ className: "top",
326
+ values: SPACE_AUTO
327
+ },
328
+ right: {
329
+ type: "union",
330
+ className: "right",
331
+ values: SPACE_AUTO
332
+ },
333
+ bottom: {
334
+ type: "union",
335
+ className: "bottom",
336
+ values: SPACE_AUTO
337
+ },
338
+ left: {
339
+ type: "union",
340
+ className: "left",
341
+ values: SPACE_AUTO
342
+ }
343
+ }, shadowProps = { shadow: {
344
+ type: "union",
345
+ className: "shadow",
346
+ values: [
347
+ 0,
348
+ 1,
349
+ 2,
350
+ 3,
351
+ 4,
352
+ 5
353
+ ]
354
+ } }, toneProps = { tone: {
355
+ type: "union",
356
+ className: "tone",
357
+ values: [
358
+ "neutral",
359
+ "positive",
360
+ "suggest",
361
+ "caution",
362
+ "critical"
363
+ ]
364
+ } }, widthProps = {
365
+ width: {
366
+ type: "string",
367
+ className: "width",
368
+ variable: "--width"
369
+ },
370
+ minWidth: {
371
+ type: "string",
372
+ className: "min-width",
373
+ variable: "--min-width"
374
+ },
375
+ maxWidth: {
376
+ type: "string",
377
+ className: "max-width",
378
+ variable: "--max-width"
379
+ }
380
+ }, zIndexProps = { zIndex: {
381
+ type: "number",
382
+ className: "z-index",
383
+ variable: "--z-index"
384
+ } }, layoutProps = {
385
+ ...toneProps,
386
+ ...widthProps,
387
+ ...heightProps,
388
+ ...marginProps,
389
+ ...borderProps,
390
+ ...paddingProps,
391
+ ...positionProps,
392
+ ...overflowProps,
393
+ ...flexChildProps,
394
+ ...gridChildProps,
395
+ ...shadowProps,
396
+ ...zIndexProps
397
+ }, DISPLAY_BLOCK = [
398
+ "block",
399
+ "inline-block",
400
+ "none"
401
+ ], DISPLAY_FLEX = [
402
+ "flex",
403
+ "inline-flex",
404
+ "none"
405
+ ], DISPLAY_GRID = [
406
+ "grid",
407
+ "inline-grid",
408
+ "none"
409
+ ], boxProps = {
410
+ as: { type: "string" },
411
+ display: {
412
+ type: "union",
413
+ className: "display",
414
+ values: DISPLAY_BLOCK
415
+ },
416
+ ...layoutProps
376
417
  }, boxClassName = suffixClassName("sui-Box");
418
+ /** @public */
377
419
  function Box(t0) {
378
- const $ = c(12);
379
- let T0, children, rest, style, t1;
380
- if ($[0] !== t0) {
381
- const {
382
- display: t22,
383
- minHeight: t3,
384
- minWidth: t4,
385
- ...props
386
- } = t0, display = t22 === void 0 ? "block" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
387
- as,
388
- children: t5,
389
- className,
390
- style: t6,
391
- ...t7
392
- } = getProps({
393
- display,
394
- minHeight,
395
- minWidth,
396
- ...props
397
- }, boxProps);
398
- children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(boxClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
399
- } else
400
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
401
- let t2;
402
- return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Box", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
420
+ let $ = c(12), T0, children, rest, style, t1;
421
+ if ($[0] !== t0) {
422
+ let { display: t2, ...props } = t0, { as, children: t3, className, style: t4, ...t5 } = getProps({
423
+ display: t2 === void 0 ? "block" : t2,
424
+ ...props
425
+ }, boxProps);
426
+ children = t3, style = t4, rest = t5, T0 = as || "div", t1 = clsx(boxClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
427
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
428
+ let t2;
429
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
430
+ className: t1,
431
+ style,
432
+ "data-ui": "Box",
433
+ ...rest,
434
+ children
435
+ }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
403
436
  }
404
- const ALIGN_ITEMS = ["baseline", "center", "flex-end", "flex-start", "stretch"], JUSTIFY_CONTENT = ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly"], FLEX_DIRECTION = ["row", "row-reverse", "column", "column-reverse"], FLEX_WRAP = ["wrap", "wrap-reverse", "nowrap"], flexParentProps = {
405
- alignItems: {
406
- type: "union",
407
- className: "align-items",
408
- values: ALIGN_ITEMS
409
- },
410
- justifyContent: {
411
- type: "union",
412
- className: "justify-content",
413
- values: JUSTIFY_CONTENT
414
- },
415
- flexDirection: {
416
- type: "union",
417
- className: "flex-direction",
418
- values: FLEX_DIRECTION
419
- },
420
- flexWrap: {
421
- type: "union",
422
- className: "flex",
423
- values: FLEX_WRAP
424
- }
437
+ const flexParentProps = {
438
+ alignItems: {
439
+ type: "union",
440
+ className: "align-items",
441
+ values: [
442
+ "baseline",
443
+ "center",
444
+ "flex-end",
445
+ "flex-start",
446
+ "stretch"
447
+ ]
448
+ },
449
+ justifyContent: {
450
+ type: "union",
451
+ className: "justify-content",
452
+ values: [
453
+ "flex-start",
454
+ "flex-end",
455
+ "center",
456
+ "space-between",
457
+ "space-around",
458
+ "space-evenly"
459
+ ]
460
+ },
461
+ flexDirection: {
462
+ type: "union",
463
+ className: "flex-direction",
464
+ values: [
465
+ "row",
466
+ "row-reverse",
467
+ "column",
468
+ "column-reverse"
469
+ ]
470
+ },
471
+ flexWrap: {
472
+ type: "union",
473
+ className: "flex",
474
+ values: [
475
+ "wrap",
476
+ "wrap-reverse",
477
+ "nowrap"
478
+ ]
479
+ }
425
480
  }, gapProps = {
426
- gap: {
427
- type: "union",
428
- className: "gap",
429
- values: SPACE_INHERIT
430
- },
431
- rowGap: {
432
- type: "union",
433
- className: "row-gap",
434
- values: SPACE_INHERIT
435
- },
436
- columnGap: {
437
- type: "union",
438
- className: "column-gap",
439
- values: SPACE_INHERIT
440
- }
481
+ gap: {
482
+ type: "union",
483
+ className: "gap",
484
+ values: SPACE_INHERIT
485
+ },
486
+ rowGap: {
487
+ type: "union",
488
+ className: "row-gap",
489
+ values: SPACE_INHERIT
490
+ },
491
+ columnGap: {
492
+ type: "union",
493
+ className: "column-gap",
494
+ values: SPACE_INHERIT
495
+ }
441
496
  }, flexProps = {
442
- as: {
443
- type: "string"
444
- },
445
- display: {
446
- type: "union",
447
- className: "display",
448
- values: DISPLAY_FLEX
449
- },
450
- ...flexParentProps,
451
- ...gapProps,
452
- ...layoutProps
497
+ as: { type: "string" },
498
+ display: {
499
+ type: "union",
500
+ className: "display",
501
+ values: DISPLAY_FLEX
502
+ },
503
+ ...flexParentProps,
504
+ ...gapProps,
505
+ ...layoutProps
453
506
  }, flexClassName = suffixClassName("sui-Flex");
507
+ /** @public */
454
508
  function Flex(t0) {
455
- const $ = c(12);
456
- let T0, children, rest, style, t1;
457
- if ($[0] !== t0) {
458
- const {
459
- display: t22,
460
- minHeight: t3,
461
- minWidth: t4,
462
- ...props
463
- } = t0, display = t22 === void 0 ? "flex" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
464
- as,
465
- children: t5,
466
- className,
467
- style: t6,
468
- ...t7
469
- } = getProps({
470
- display,
471
- minHeight,
472
- minWidth,
473
- ...props
474
- }, flexProps);
475
- children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(flexClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
476
- } else
477
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
478
- let t2;
479
- return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Flex", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
509
+ let $ = c(12), T0, children, rest, style, t1;
510
+ if ($[0] !== t0) {
511
+ let { display: t2, ...props } = t0, { as, children: t3, className, style: t4, ...t5 } = getProps({
512
+ display: t2 === void 0 ? "flex" : t2,
513
+ ...props
514
+ }, flexProps);
515
+ children = t3, style = t4, rest = t5, T0 = as || "div", t1 = clsx(flexClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
516
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
517
+ let t2;
518
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
519
+ className: t1,
520
+ style,
521
+ "data-ui": "Flex",
522
+ ...rest,
523
+ children
524
+ }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
480
525
  }
481
- const FONT_WEIGHT = ["regular", "medium", "semibold", "bold"], TEXT_ALIGN = ["left", "center", "right", "justify"], typographyProps = {
482
- align: {
483
- type: "union",
484
- className: "text",
485
- values: TEXT_ALIGN
486
- },
487
- muted: {
488
- type: "boolean",
489
- className: "text-muted",
490
- inverseClassName: "text-default"
491
- },
492
- trim: {
493
- type: "boolean",
494
- className: "text-trim",
495
- inverseClassName: "text-trim-none"
496
- },
497
- truncate: {
498
- type: "conditional",
499
- resolve: (value) => value === 1 ? {
500
- type: "number",
501
- className: "text-overflow"
502
- } : {
503
- type: "number",
504
- className: "line-clamp",
505
- variable: "--line-clamp"
506
- }
507
- },
508
- weight: {
509
- type: "union",
510
- className: "weight",
511
- values: FONT_WEIGHT
512
- },
513
- ...marginProps,
514
- ...toneProps
515
- }, ICON_SIZE = [0, 1, 2, 3, 4], iconProps = {
516
- icon: {
517
- type: "string"
518
- },
519
- size: {
520
- type: "union",
521
- className: "icon-body",
522
- values: ICON_SIZE
523
- },
524
- muted: typographyProps.muted,
525
- ...toneProps,
526
- ...marginProps
526
+ const typographyProps = {
527
+ align: {
528
+ type: "union",
529
+ className: "text",
530
+ values: [
531
+ "left",
532
+ "center",
533
+ "right",
534
+ "justify"
535
+ ]
536
+ },
537
+ muted: {
538
+ type: "boolean",
539
+ className: "text-muted",
540
+ inverseClassName: "text-default"
541
+ },
542
+ trim: {
543
+ type: "boolean",
544
+ className: "text-trim",
545
+ inverseClassName: "text-trim-none"
546
+ },
547
+ truncate: {
548
+ type: "conditional",
549
+ resolve: (value) => value === 1 ? {
550
+ type: "number",
551
+ className: "text-overflow"
552
+ } : {
553
+ type: "number",
554
+ className: "line-clamp",
555
+ variable: "--line-clamp"
556
+ }
557
+ },
558
+ weight: {
559
+ type: "union",
560
+ className: "weight",
561
+ values: [
562
+ "regular",
563
+ "medium",
564
+ "semibold",
565
+ "bold"
566
+ ]
567
+ },
568
+ ...marginProps,
569
+ ...toneProps
570
+ }, ICON_SIZE = [
571
+ 0,
572
+ 1,
573
+ 2,
574
+ 3,
575
+ 4
576
+ ], iconProps = {
577
+ icon: { type: "string" },
578
+ size: {
579
+ type: "union",
580
+ className: "icon-body",
581
+ values: ICON_SIZE
582
+ },
583
+ muted: typographyProps.muted,
584
+ ...toneProps,
585
+ ...marginProps
527
586
  }, iconClassName = suffixClassName("sui-Icon");
587
+ /** @public */
528
588
  function Icon(t0) {
529
- const $ = c(12);
530
- let T0, props, rest, style, t1;
531
- if ($[0] !== t0) {
532
- const {
533
- size: t22,
534
- ...t32
535
- } = t0;
536
- props = t32;
537
- const size = t22 === void 0 ? 2 : t22, {
538
- className,
539
- style: t4,
540
- icon: Component,
541
- ...t5
542
- } = getProps({
543
- size,
544
- ...props
545
- }, iconProps);
546
- style = t4, rest = t5, T0 = Component, t1 = clsx(iconClassName, className), $[0] = t0, $[1] = T0, $[2] = props, $[3] = rest, $[4] = style, $[5] = t1;
547
- } else
548
- T0 = $[1], props = $[2], rest = $[3], style = $[4], t1 = $[5];
549
- const t2 = props["aria-label"] ? void 0 : !0;
550
- let t3;
551
- return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, "data-ui": "Icon", style, "aria-hidden": t2, ...rest }), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
589
+ let $ = c(12), T0, props, rest, style, t1;
590
+ if ($[0] !== t0) {
591
+ let { size: t2, ...t3 } = t0;
592
+ props = t3;
593
+ let { className, style: t4, icon: Component, ...t5 } = getProps({
594
+ size: t2 === void 0 ? 2 : t2,
595
+ ...props
596
+ }, iconProps);
597
+ style = t4, rest = t5, T0 = Component, t1 = clsx(iconClassName, className), $[0] = t0, $[1] = T0, $[2] = props, $[3] = rest, $[4] = style, $[5] = t1;
598
+ } else T0 = $[1], props = $[2], rest = $[3], style = $[4], t1 = $[5];
599
+ let t2 = !props["aria-label"] || void 0, t3;
600
+ return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, {
601
+ className: t1,
602
+ "data-ui": "Icon",
603
+ style,
604
+ "aria-hidden": t2,
605
+ ...rest
606
+ }), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
552
607
  }
553
- const spinnerProps = {
554
- size: {
555
- type: "union",
556
- className: "icon-body",
557
- values: ICON_SIZE
558
- }
559
- }, spinnerClassName = suffixClassName("sui-Spinner");
608
+ const spinnerProps = { size: {
609
+ type: "union",
610
+ className: "icon-body",
611
+ values: ICON_SIZE
612
+ } }, spinnerClassName = suffixClassName("sui-Spinner");
613
+ /** @public */
560
614
  function Spinner(t0) {
561
- const $ = c(12);
562
- let T0, rest, style, t1, t2;
563
- if ($[0] !== t0) {
564
- const {
565
- size: t32,
566
- ...props
567
- } = t0, size = t32 === void 0 ? 2 : t32, {
568
- className,
569
- style: t4,
570
- ...t5
571
- } = getProps({
572
- size,
573
- ...props
574
- }, spinnerProps);
575
- style = t4, rest = t5, T0 = Icon, t1 = SpinnerIcon, t2 = clsx(spinnerClassName, className), $[0] = t0, $[1] = T0, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2;
576
- } else
577
- T0 = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5];
578
- let t3;
579
- return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { icon: t1, className: t2, style, "data-ui": "Spinner", role: "status", "aria-label": "Loading...", ...rest }), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
615
+ let $ = c(12), T0, rest, style, t1, t2;
616
+ if ($[0] !== t0) {
617
+ let { size: t3, ...props } = t0, { className, style: t4, ...t5 } = getProps({
618
+ size: t3 === void 0 ? 2 : t3,
619
+ ...props
620
+ }, spinnerProps);
621
+ style = t4, rest = t5, T0 = Icon, t1 = SpinnerIcon, t2 = clsx(spinnerClassName, className), $[0] = t0, $[1] = T0, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2;
622
+ } else T0 = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5];
623
+ let t3;
624
+ return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, {
625
+ icon: t1,
626
+ className: t2,
627
+ style,
628
+ "data-ui": "Spinner",
629
+ role: "status",
630
+ "aria-label": "Loading...",
631
+ ...rest
632
+ }), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
580
633
  }
581
- const TEXT_SIZE = [0, 1, 2, 3, 4], textProps = {
582
- as: {
583
- type: "string"
584
- },
585
- size: {
586
- type: "union",
587
- className: "text-body",
588
- values: TEXT_SIZE
589
- },
590
- ...typographyProps
634
+ const textProps = {
635
+ as: { type: "string" },
636
+ size: {
637
+ type: "union",
638
+ className: "text-body",
639
+ values: [
640
+ 0,
641
+ 1,
642
+ 2,
643
+ 3,
644
+ 4
645
+ ]
646
+ },
647
+ ...typographyProps
591
648
  }, textClassName = suffixClassName("sui-Text");
649
+ /** @public */
592
650
  function Text(t0) {
593
- const $ = c(15);
594
- let T0, children, rest, style, t1, t2;
595
- if ($[0] !== t0) {
596
- t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
597
- bb0: {
598
- const {
599
- size: t32,
600
- ...props
601
- } = t0, size = t32 === void 0 ? 2 : t32, {
602
- as,
603
- children: t4,
604
- className,
605
- style: t5,
606
- ...t6
607
- } = getProps({
608
- size,
609
- ...props
610
- }, textProps);
611
- children = t4, style = t5, rest = t6;
612
- const Component = as || "span";
613
- if (props.truncate && props.trim) {
614
- const t7 = clsx(textClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t8 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
615
- let t9;
616
- $[7] !== t8 ? (t9 = clsx("sui-overflow-hidden", t8), $[7] = t8, $[8] = t9) : t9 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t7, style, "data-ui": "Text", ...rest, children: /* @__PURE__ */ jsx("span", { className: t9, children }) });
617
- break bb0;
618
- }
619
- T0 = Component, t1 = clsx(textClassName, props.truncate && "sui-overflow-hidden", className);
620
- }
621
- $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
622
- } else
623
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
624
- if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
625
- return t2;
626
- let t3;
627
- return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Text", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
651
+ let $ = c(15), T0, children, rest, style, t1, t2;
652
+ if ($[0] !== t0) {
653
+ t2 = Symbol.for("react.early_return_sentinel");
654
+ bb0: {
655
+ let { size: t3, ...props } = t0, { as, children: t4, className, style: t5, ...t6 } = getProps({
656
+ size: t3 === void 0 ? 2 : t3,
657
+ ...props
658
+ }, textProps);
659
+ children = t4, style = t5, rest = t6;
660
+ let Component = as || "span";
661
+ if (props.truncate && props.trim) {
662
+ let t7 = clsx(textClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t8 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp", t9;
663
+ $[7] === t8 ? t9 = $[8] : (t9 = clsx("sui-overflow-hidden", t8), $[7] = t8, $[8] = t9), t2 = /* @__PURE__ */ jsx(Component, {
664
+ className: t7,
665
+ style,
666
+ "data-ui": "Text",
667
+ ...rest,
668
+ children: /* @__PURE__ */ jsx("span", {
669
+ className: t9,
670
+ children
671
+ })
672
+ });
673
+ break bb0;
674
+ }
675
+ T0 = Component, t1 = clsx(textClassName, props.truncate && "sui-overflow-hidden", className);
676
+ }
677
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
678
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
679
+ if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
680
+ let t3;
681
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, {
682
+ className: t1,
683
+ style,
684
+ "data-ui": "Text",
685
+ ...rest,
686
+ children
687
+ }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
628
688
  }
629
- const BUTTON_DENSITY = ["regular", "loose"], BUTTON_LEVEL = ["primary", "secondary", "tertiary"], BUTTON_TONE = ["neutral", "critical"], buttonProps = {
630
- as: {
631
- type: "string"
632
- },
633
- density: {
634
- type: "composite",
635
- values: BUTTON_DENSITY,
636
- composition: {
637
- gap: {
638
- propDef: gapProps.gap,
639
- mapping: {
640
- regular: 2,
641
- loose: 3
642
- }
643
- },
644
- padding: {
645
- propDef: paddingProps.padding,
646
- mapping: {
647
- regular: 2,
648
- loose: 3
649
- }
650
- },
651
- minHeight: {
652
- propDef: heightProps.minHeight,
653
- mapping: {
654
- regular: "25px",
655
- loose: "33px"
656
- }
657
- },
658
- minWidth: {
659
- propDef: widthProps.minWidth,
660
- mapping: {
661
- regular: "25px",
662
- loose: "33px"
663
- }
664
- }
665
- }
666
- },
667
- fullWidth: {
668
- type: "boolean",
669
- className: "width-full",
670
- inverseClassName: "width-auto"
671
- },
672
- iconStart: {
673
- type: "string"
674
- },
675
- iconEnd: {
676
- type: "string"
677
- },
678
- level: {
679
- type: "union",
680
- className: "button-level",
681
- values: BUTTON_LEVEL
682
- },
683
- loading: {
684
- type: "boolean"
685
- },
686
- text: {
687
- type: "string"
688
- },
689
- tone: {
690
- type: "union",
691
- className: "tone",
692
- values: BUTTON_TONE
693
- }
689
+ const buttonProps = {
690
+ as: { type: "string" },
691
+ density: {
692
+ type: "composite",
693
+ values: ["regular", "loose"],
694
+ composition: {
695
+ gap: {
696
+ propDef: gapProps.gap,
697
+ mapping: {
698
+ regular: 2,
699
+ loose: 3
700
+ }
701
+ },
702
+ padding: {
703
+ propDef: paddingProps.padding,
704
+ mapping: {
705
+ regular: 2,
706
+ loose: 3
707
+ }
708
+ },
709
+ minHeight: {
710
+ propDef: heightProps.minHeight,
711
+ mapping: {
712
+ regular: "25px",
713
+ loose: "33px"
714
+ }
715
+ },
716
+ minWidth: {
717
+ propDef: widthProps.minWidth,
718
+ mapping: {
719
+ regular: "25px",
720
+ loose: "33px"
721
+ }
722
+ }
723
+ }
724
+ },
725
+ fullWidth: {
726
+ type: "boolean",
727
+ className: "width-full",
728
+ inverseClassName: "width-auto"
729
+ },
730
+ iconStart: { type: "string" },
731
+ iconEnd: { type: "string" },
732
+ level: {
733
+ type: "union",
734
+ className: "button-level",
735
+ values: [
736
+ "primary",
737
+ "secondary",
738
+ "tertiary"
739
+ ]
740
+ },
741
+ loading: { type: "boolean" },
742
+ text: { type: "string" },
743
+ tone: {
744
+ type: "union",
745
+ className: "tone",
746
+ values: ["neutral", "critical"]
747
+ }
694
748
  }, buttonClassName = suffixClassName("sui-Button");
749
+ /** @public */
695
750
  function Button(t0) {
696
- const $ = c(26);
697
- let T0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9;
698
- if ($[0] !== t0) {
699
- const {
700
- density: t122,
701
- level: t13,
702
- tone: t14,
703
- ...props
704
- } = t0, density = t122 === void 0 ? "regular" : t122, level = t13 === void 0 ? "primary" : t13, tone = t14 === void 0 ? "neutral" : t14, {
705
- as,
706
- children,
707
- className,
708
- disabled,
709
- style,
710
- iconStart: IconStart,
711
- iconEnd: IconEnd,
712
- loading,
713
- text,
714
- ...rest
715
- } = getProps({
716
- density,
717
- level,
718
- tone,
719
- ...props
720
- }, buttonProps);
721
- T0 = as || "button", t1 = clsx(buttonClassName, "sui-display-inline-flex sui-align-items-center sui-justify-content-center sui-radius2 sui-position-relative sui-overflow-hidden", className), t2 = style, t3 = "Button", t4 = disabled || loading, t5 = loading ? !0 : void 0, t6 = rest, t7 = loading && /* @__PURE__ */ jsx(Flex, { position: "absolute", inset: 0, alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ jsx(Spinner, {}) }), t8 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, { icon: IconStart, marginX: -1, marginY: -2, size: 1 })), t9 = text && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", trim: !0, children: text }), t10 = children, t11 = IconEnd && (isValidElement(IconEnd) ? IconEnd : /* @__PURE__ */ jsx(Icon, { icon: IconEnd, marginX: -1, marginY: -2, size: 1 })), $[0] = t0, $[1] = T0, $[2] = t1, $[3] = t10, $[4] = t11, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5, $[9] = t6, $[10] = t7, $[11] = t8, $[12] = t9;
722
- } else
723
- T0 = $[1], t1 = $[2], t10 = $[3], t11 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8], t6 = $[9], t7 = $[10], t8 = $[11], t9 = $[12];
724
- let t12;
725
- return $[13] !== T0 || $[14] !== t1 || $[15] !== t10 || $[16] !== t11 || $[17] !== t2 || $[18] !== t3 || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9 ? (t12 = /* @__PURE__ */ jsxs(T0, { className: t1, style: t2, "data-ui": t3, disabled: t4, "aria-busy": t5, ...t6, children: [
726
- t7,
727
- t8,
728
- t9,
729
- t10,
730
- t11
731
- ] }), $[13] = T0, $[14] = t1, $[15] = t10, $[16] = t11, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = t8, $[24] = t9, $[25] = t12) : t12 = $[25], t12;
751
+ let $ = c(26), T0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9;
752
+ if ($[0] !== t0) {
753
+ let { density: t12, level: t13, tone: t14, ...props } = t0, { as, children, className, disabled, style, iconStart: IconStart, iconEnd: IconEnd, loading, text, ...rest } = getProps({
754
+ density: t12 === void 0 ? "regular" : t12,
755
+ level: t13 === void 0 ? "primary" : t13,
756
+ tone: t14 === void 0 ? "neutral" : t14,
757
+ ...props
758
+ }, buttonProps);
759
+ T0 = as || "button", t1 = clsx(buttonClassName, "sui-display-inline-flex sui-align-items-center sui-justify-content-center sui-radius2 sui-position-relative sui-overflow-hidden", className), t2 = style, t3 = "Button", t4 = disabled || loading, t5 = loading ? !0 : void 0, t6 = rest, t7 = loading && /* @__PURE__ */ jsx(Flex, {
760
+ position: "absolute",
761
+ inset: 0,
762
+ alignItems: "center",
763
+ justifyContent: "center",
764
+ children: /* @__PURE__ */ jsx(Spinner, {})
765
+ }), t8 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, {
766
+ icon: IconStart,
767
+ marginX: -1,
768
+ marginY: -2,
769
+ size: 1
770
+ })), t9 = text && /* @__PURE__ */ jsx(Text, {
771
+ size: 1,
772
+ weight: "medium",
773
+ trim: !0,
774
+ children: text
775
+ }), t10 = children, t11 = IconEnd && (isValidElement(IconEnd) ? IconEnd : /* @__PURE__ */ jsx(Icon, {
776
+ icon: IconEnd,
777
+ marginX: -1,
778
+ marginY: -2,
779
+ size: 1
780
+ })), $[0] = t0, $[1] = T0, $[2] = t1, $[3] = t10, $[4] = t11, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5, $[9] = t6, $[10] = t7, $[11] = t8, $[12] = t9;
781
+ } else T0 = $[1], t1 = $[2], t10 = $[3], t11 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8], t6 = $[9], t7 = $[10], t8 = $[11], t9 = $[12];
782
+ let t12;
783
+ return $[13] !== T0 || $[14] !== t1 || $[15] !== t10 || $[16] !== t11 || $[17] !== t2 || $[18] !== t3 || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9 ? (t12 = /* @__PURE__ */ jsxs(T0, {
784
+ className: t1,
785
+ style: t2,
786
+ "data-ui": t3,
787
+ disabled: t4,
788
+ "aria-busy": t5,
789
+ ...t6,
790
+ children: [
791
+ t7,
792
+ t8,
793
+ t9,
794
+ t10,
795
+ t11
796
+ ]
797
+ }), $[13] = T0, $[14] = t1, $[15] = t10, $[16] = t11, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = t8, $[24] = t9, $[25] = t12) : t12 = $[25], t12;
732
798
  }
733
- const DENSITY = ["compact", "regular", "loose"], cardProps = {
734
- as: {
735
- type: "string"
736
- },
737
- density: {
738
- type: "composite",
739
- values: DENSITY,
740
- composition: {
741
- gap: {
742
- propDef: gapProps.gap,
743
- mapping: {
744
- compact: 2,
745
- regular: 3,
746
- loose: 4
747
- }
748
- },
749
- padding: {
750
- propDef: paddingProps.padding,
751
- mapping: {
752
- compact: 3,
753
- regular: 4,
754
- loose: 5
755
- }
756
- },
757
- radius: {
758
- propDef: borderProps.radius,
759
- mapping: {
760
- compact: 2,
761
- regular: 3,
762
- loose: 4
763
- }
764
- }
765
- }
766
- },
767
- ...toneProps,
768
- ...marginProps
799
+ const DENSITY = [
800
+ "compact",
801
+ "regular",
802
+ "loose"
803
+ ], cardProps = {
804
+ as: { type: "string" },
805
+ density: {
806
+ type: "composite",
807
+ values: DENSITY,
808
+ composition: {
809
+ gap: {
810
+ propDef: gapProps.gap,
811
+ mapping: {
812
+ compact: 2,
813
+ regular: 3,
814
+ loose: 4
815
+ }
816
+ },
817
+ padding: {
818
+ propDef: paddingProps.padding,
819
+ mapping: {
820
+ compact: 3,
821
+ regular: 4,
822
+ loose: 5
823
+ }
824
+ },
825
+ radius: {
826
+ propDef: borderProps.radius,
827
+ mapping: {
828
+ compact: 2,
829
+ regular: 3,
830
+ loose: 4
831
+ }
832
+ }
833
+ }
834
+ },
835
+ ...toneProps,
836
+ ...marginProps
769
837
  }, cardClassName = suffixClassName("sui-Card");
838
+ /** @public */
770
839
  function Card(t0) {
771
- const $ = c(12);
772
- let T0, children, rest, style, t1;
773
- if ($[0] !== t0) {
774
- const {
775
- density: t22,
776
- tone: t3,
777
- ...props
778
- } = t0, density = t22 === void 0 ? "regular" : t22, tone = t3 === void 0 ? "neutral" : t3, {
779
- as,
780
- children: t4,
781
- className,
782
- style: t5,
783
- ...t6
784
- } = getProps({
785
- density,
786
- tone,
787
- ...props
788
- }, cardProps);
789
- children = t4, style = t5, rest = t6, T0 = as || "div", t1 = clsx(cardClassName, "sui-border", className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
790
- } else
791
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
792
- let t2;
793
- return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Card", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
840
+ let $ = c(12), T0, children, rest, style, t1;
841
+ if ($[0] !== t0) {
842
+ let { density: t2, tone: t3, ...props } = t0, { as, children: t4, className, style: t5, ...t6 } = getProps({
843
+ density: t2 === void 0 ? "regular" : t2,
844
+ tone: t3 === void 0 ? "neutral" : t3,
845
+ ...props
846
+ }, cardProps);
847
+ children = t4, style = t5, rest = t6, T0 = as || "div", t1 = clsx(cardClassName, "sui-border", className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
848
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
849
+ let t2;
850
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
851
+ className: t1,
852
+ style,
853
+ "data-ui": "Card",
854
+ ...rest,
855
+ children
856
+ }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
794
857
  }
795
858
  const labelProps = {
796
- disabled: {
797
- type: "boolean"
798
- },
799
- error: {
800
- type: "boolean"
801
- },
802
- ...marginProps
859
+ disabled: { type: "boolean" },
860
+ error: { type: "boolean" },
861
+ ...marginProps
803
862
  }, labelClassName = suffixClassName("sui-Label");
863
+ /** @beta */
804
864
  function Label(props) {
805
- const $ = c(18);
806
- let T0, children, rest, style, t0, t1, t2, t3;
807
- if ($[0] !== props) {
808
- const {
809
- children: t42,
810
- className,
811
- style: t5,
812
- disabled,
813
- error,
814
- ...t6
815
- } = getProps(props, labelProps);
816
- children = t42, style = t5, rest = t6, T0 = Text, t0 = "label", t1 = 1, t2 = disabled, t3 = clsx(labelClassName, "sui-display-flex sui-align-items-center sui-gap2", error && "sui-error", className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1, $[7] = t2, $[8] = t3;
817
- } else
818
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6], t2 = $[7], t3 = $[8];
819
- let t4;
820
- return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t0 || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, { as: t0, size: t1, muted: t2, className: t3, style, "data-ui": "Label", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
865
+ let $ = c(18), T0, children, rest, style, t0, t1, t2, t3;
866
+ if ($[0] !== props) {
867
+ let { children: t4, className, style: t5, disabled, error, ...t6 } = getProps(props, labelProps);
868
+ children = t4, style = t5, rest = t6, T0 = Text, t0 = "label", t1 = 1, t2 = disabled, t3 = clsx(labelClassName, "sui-display-flex sui-align-items-center sui-gap2", error && "sui-error", className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1, $[7] = t2, $[8] = t3;
869
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6], t2 = $[7], t3 = $[8];
870
+ let t4;
871
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t0 || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, {
872
+ as: t0,
873
+ size: t1,
874
+ muted: t2,
875
+ className: t3,
876
+ style,
877
+ "data-ui": "Label",
878
+ ...rest,
879
+ children
880
+ }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
821
881
  }
822
882
  const visuallyHiddenProps = {
823
- as: {
824
- type: "string"
825
- },
826
- visibleOnFocus: {
827
- type: "boolean",
828
- className: "sui-visually-hidden-visible"
829
- }
883
+ as: { type: "string" },
884
+ visibleOnFocus: {
885
+ type: "boolean",
886
+ className: "sui-visually-hidden-visible"
887
+ }
830
888
  }, visuallyHiddenClassName = suffixClassName("sui-VisuallyHidden");
889
+ /** @public */
831
890
  function VisuallyHidden(props) {
832
- const $ = c(12);
833
- let T0, children, rest, style, t0;
834
- if ($[0] !== props) {
835
- const {
836
- as,
837
- children: t12,
838
- className,
839
- style: t2,
840
- ...t3
841
- } = getProps(props, visuallyHiddenProps);
842
- children = t12, style = t2, rest = t3, T0 = as || "span", t0 = clsx(visuallyHiddenClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
843
- } else
844
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
845
- let t1;
846
- return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, { className: t0, style, "data-ui": "VisuallyHidden", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
891
+ let $ = c(12), T0, children, rest, style, t0;
892
+ if ($[0] !== props) {
893
+ let { as, children: t1, className, style: t2, ...t3 } = getProps(props, visuallyHiddenProps);
894
+ children = t1, style = t2, rest = t3, T0 = as || "span", t0 = clsx(visuallyHiddenClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
895
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
896
+ let t1;
897
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, {
898
+ className: t0,
899
+ style,
900
+ "data-ui": "VisuallyHidden",
901
+ ...rest,
902
+ children
903
+ }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
847
904
  }
848
905
  const checkboxProps = {
849
- error: {
850
- type: "boolean"
851
- },
852
- indeterminate: {
853
- type: "boolean"
854
- },
855
- label: {
856
- type: "string"
857
- },
858
- ...marginProps
906
+ error: { type: "boolean" },
907
+ indeterminate: { type: "boolean" },
908
+ label: { type: "string" },
909
+ ...marginProps
859
910
  }, checkboxClassName = suffixClassName("sui-Checkbox"), checkboxInputClassName = suffixClassName("sui-CheckboxInput"), checkboxMarkClassName = suffixClassName("sui-CheckboxMark");
911
+ /** @beta */
860
912
  function Checkbox(props) {
861
- const $ = c(6), inputRef = useRef(null), {
862
- className,
863
- style,
864
- disabled,
865
- error,
866
- indeterminate,
867
- label,
868
- ...rest
869
- } = getProps(props, checkboxProps);
870
- useEffect(() => {
871
- inputRef.current && (inputRef.current.indeterminate = indeterminate);
872
- }, [indeterminate]);
873
- const t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t1 = "span", t2 = clsx(checkboxMarkClassName, error && "sui-error");
874
- let t3;
875
- $[0] !== indeterminate ? (t3 = indeterminate ? /* @__PURE__ */ jsx(RemoveIcon, {}) : /* @__PURE__ */ jsx(CheckmarkIcon, {}), $[0] = indeterminate, $[1] = t3) : t3 = $[1];
876
- let t4;
877
- return $[2] !== T0 || $[3] !== t2 || $[4] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, { as: t1, className: t2, position: "relative", radius: 2, width: "17px", height: "17px", children: t3 }), $[2] = T0, $[3] = t2, $[4] = t3, $[5] = t4) : t4 = $[5], /* @__PURE__ */ jsxs(Label, { className: t0, style, "data-ui": "Checkbox", disabled, error, children: [
878
- /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "checkbox", className: checkboxInputClassName, ref: inputRef, disabled, ...rest }),
879
- t4,
880
- label
881
- ] });
913
+ let $ = c(6), inputRef = useRef(null), { className, style, disabled, error, indeterminate, label, ...rest } = getProps(props, checkboxProps);
914
+ useEffect(() => {
915
+ inputRef.current && (inputRef.current.indeterminate = indeterminate);
916
+ }, [indeterminate, inputRef]);
917
+ let t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t2 = clsx(checkboxMarkClassName, error && "sui-error"), t3;
918
+ $[0] === indeterminate ? t3 = $[1] : (t3 = jsx(indeterminate ? RemoveIcon : CheckmarkIcon, {}), $[0] = indeterminate, $[1] = t3);
919
+ let t4;
920
+ return $[2] !== T0 || $[3] !== t2 || $[4] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, {
921
+ as: "span",
922
+ className: t2,
923
+ position: "relative",
924
+ radius: 2,
925
+ width: "17px",
926
+ height: "17px",
927
+ children: t3
928
+ }), $[2] = T0, $[3] = t2, $[4] = t3, $[5] = t4) : t4 = $[5], /* @__PURE__ */ jsxs(Label, {
929
+ className: t0,
930
+ style,
931
+ "data-ui": "Checkbox",
932
+ disabled,
933
+ error,
934
+ children: [
935
+ /* @__PURE__ */ jsx(VisuallyHidden, {
936
+ as: "input",
937
+ type: "checkbox",
938
+ className: checkboxInputClassName,
939
+ ref: inputRef,
940
+ disabled,
941
+ ...rest
942
+ }),
943
+ t4,
944
+ label
945
+ ]
946
+ });
882
947
  }
883
- const CODE_TAG = ["pre", "span"], CODE_SIZE = [0, 1, 2, 3, 4], codeProps = {
884
- as: {
885
- type: "union",
886
- values: CODE_TAG
887
- },
888
- language: {
889
- type: "string"
890
- },
891
- size: {
892
- type: "union",
893
- className: "text-code",
894
- values: CODE_SIZE
895
- },
896
- muted: typographyProps.muted,
897
- trim: typographyProps.trim,
898
- weight: typographyProps.weight,
899
- ...marginProps
900
- }, LazyRefractor = lazy(() => import("./_chunks-es/LazyRefractor.js")), codeClassName = suffixClassName("sui-Code");
948
+ const codeProps = {
949
+ as: {
950
+ type: "union",
951
+ values: ["pre", "span"]
952
+ },
953
+ language: { type: "string" },
954
+ size: {
955
+ type: "union",
956
+ className: "text-code",
957
+ values: [
958
+ 0,
959
+ 1,
960
+ 2,
961
+ 3,
962
+ 4
963
+ ]
964
+ },
965
+ muted: typographyProps.muted,
966
+ trim: typographyProps.trim,
967
+ weight: typographyProps.weight,
968
+ ...marginProps
969
+ }, LazyRefractor = lazy(() => import("./LazyRefractor-CQ22IeXB.js")), codeClassName = suffixClassName("sui-Code");
970
+ /** @public */
901
971
  function Code(t0) {
902
- const $ = c(22);
903
- let T0, children, language, rest, style, t1, t2;
904
- if ($[0] !== t0) {
905
- t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
906
- bb0: {
907
- const {
908
- size: t32,
909
- ...props
910
- } = t0, size = t32 === void 0 ? 2 : t32, {
911
- as,
912
- children: t42,
913
- className,
914
- language: t52,
915
- style: t62,
916
- ...t7
917
- } = getProps({
918
- size,
919
- ...props
920
- }, codeProps);
921
- children = t42, language = t52, style = t62, rest = t7;
922
- const Component = as || "pre";
923
- if (!language) {
924
- t2 = /* @__PURE__ */ jsx(Component, { className: clsx(codeClassName, className), style, "data-ui": "Code", ...rest, children: /* @__PURE__ */ jsx("code", { children }) });
925
- break bb0;
926
- }
927
- T0 = Component, t1 = clsx(codeClassName, className);
928
- }
929
- $[0] = t0, $[1] = T0, $[2] = children, $[3] = language, $[4] = rest, $[5] = style, $[6] = t1, $[7] = t2;
930
- } else
931
- T0 = $[1], children = $[2], language = $[3], rest = $[4], style = $[5], t1 = $[6], t2 = $[7];
932
- if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
933
- return t2;
934
- let t3;
935
- $[8] !== children ? (t3 = /* @__PURE__ */ jsx("code", { children }), $[8] = children, $[9] = t3) : t3 = $[9];
936
- let t4;
937
- $[10] !== children || $[11] !== language ? (t4 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[10] = children, $[11] = language, $[12] = t4) : t4 = $[12];
938
- let t5;
939
- $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsx(Suspense, { fallback: t3, children: t4 }), $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15];
940
- let t6;
941
- return $[16] !== T0 || $[17] !== rest || $[18] !== style || $[19] !== t1 || $[20] !== t5 ? (t6 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Code", ...rest, children: t5 }), $[16] = T0, $[17] = rest, $[18] = style, $[19] = t1, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
972
+ let $ = c(22), T0, children, language, rest, style, t1, t2;
973
+ if ($[0] !== t0) {
974
+ t2 = Symbol.for("react.early_return_sentinel");
975
+ bb0: {
976
+ let { size: t3, ...props } = t0, { as, children: t4, className, language: t5, style: t6, ...t7 } = getProps({
977
+ size: t3 === void 0 ? 2 : t3,
978
+ ...props
979
+ }, codeProps);
980
+ children = t4, language = t5, style = t6, rest = t7;
981
+ let Component = as || "pre";
982
+ if (!language) {
983
+ t2 = /* @__PURE__ */ jsx(Component, {
984
+ className: clsx(codeClassName, className),
985
+ style,
986
+ "data-ui": "Code",
987
+ ...rest,
988
+ children: /* @__PURE__ */ jsx("code", { children })
989
+ });
990
+ break bb0;
991
+ }
992
+ T0 = Component, t1 = clsx(codeClassName, className);
993
+ }
994
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = language, $[4] = rest, $[5] = style, $[6] = t1, $[7] = t2;
995
+ } else T0 = $[1], children = $[2], language = $[3], rest = $[4], style = $[5], t1 = $[6], t2 = $[7];
996
+ if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
997
+ let t3;
998
+ $[8] === children ? t3 = $[9] : (t3 = /* @__PURE__ */ jsx("code", { children }), $[8] = children, $[9] = t3);
999
+ let t4;
1000
+ $[10] !== children || $[11] !== language ? (t4 = /* @__PURE__ */ jsx(LazyRefractor, {
1001
+ language,
1002
+ value: children
1003
+ }), $[10] = children, $[11] = language, $[12] = t4) : t4 = $[12];
1004
+ let t5;
1005
+ $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsx(Suspense, {
1006
+ fallback: t3,
1007
+ children: t4
1008
+ }), $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15];
1009
+ let t6;
1010
+ return $[16] !== T0 || $[17] !== rest || $[18] !== style || $[19] !== t1 || $[20] !== t5 ? (t6 = /* @__PURE__ */ jsx(T0, {
1011
+ className: t1,
1012
+ style,
1013
+ "data-ui": "Code",
1014
+ ...rest,
1015
+ children: t5
1016
+ }), $[16] = T0, $[17] = rest, $[18] = style, $[19] = t1, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
942
1017
  }
943
- const CONTAINER_SIZE = [0, 1, 2, 3, 4, 5], containerProps = {
944
- as: {
945
- type: "string"
946
- },
947
- size: {
948
- type: "union",
949
- className: "container",
950
- values: CONTAINER_SIZE
951
- },
952
- ...layoutProps
1018
+ const CONTAINER_SIZE = [
1019
+ 0,
1020
+ 1,
1021
+ 2,
1022
+ 3,
1023
+ 4,
1024
+ 5
1025
+ ], containerProps = {
1026
+ as: { type: "string" },
1027
+ size: {
1028
+ type: "union",
1029
+ className: "container",
1030
+ values: CONTAINER_SIZE
1031
+ },
1032
+ ...layoutProps
953
1033
  }, containerClassName = suffixClassName("sui-Container");
1034
+ /** @public */
954
1035
  function Container(t0) {
955
- const $ = c(12);
956
- let T0, children, rest, style, t1;
957
- if ($[0] !== t0) {
958
- const {
959
- marginX: t22,
960
- ...props
961
- } = t0, marginX = t22 === void 0 ? "auto" : t22, {
962
- as,
963
- children: t3,
964
- className,
965
- style: t4,
966
- ...t5
967
- } = getProps({
968
- marginX,
969
- ...props
970
- }, containerProps);
971
- children = t3, style = t4, rest = t5, T0 = as || "div", t1 = clsx(containerClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
972
- } else
973
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
974
- let t2;
975
- return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Container", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1036
+ let $ = c(12), T0, children, rest, style, t1;
1037
+ if ($[0] !== t0) {
1038
+ let { marginX: t2, size: t3, ...props } = t0, { as, children: t4, className, style: t5, ...t6 } = getProps({
1039
+ marginX: t2 === void 0 ? "auto" : t2,
1040
+ size: t3 === void 0 ? 2 : t3,
1041
+ ...props
1042
+ }, containerProps);
1043
+ children = t4, style = t5, rest = t6, T0 = as || "div", t1 = clsx(containerClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
1044
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
1045
+ let t2;
1046
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
1047
+ className: t1,
1048
+ style,
1049
+ "data-ui": "Container",
1050
+ ...rest,
1051
+ children
1052
+ }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
976
1053
  }
977
- const HEADING_TAG = ["h1", "h2", "h3", "h4", "h5", "h6"], HEADING_SIZE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], headingProps = {
978
- as: {
979
- type: "union",
980
- values: HEADING_TAG
981
- },
982
- size: {
983
- type: "union",
984
- className: "text-heading",
985
- values: HEADING_SIZE
986
- },
987
- ...typographyProps
1054
+ const headingProps = {
1055
+ as: {
1056
+ type: "union",
1057
+ values: [
1058
+ "h1",
1059
+ "h2",
1060
+ "h3",
1061
+ "h4",
1062
+ "h5",
1063
+ "h6"
1064
+ ]
1065
+ },
1066
+ size: {
1067
+ type: "union",
1068
+ className: "text-heading",
1069
+ values: [
1070
+ 0,
1071
+ 1,
1072
+ 2,
1073
+ 3,
1074
+ 4,
1075
+ 5,
1076
+ 6,
1077
+ 7,
1078
+ 8,
1079
+ 9
1080
+ ]
1081
+ },
1082
+ ...typographyProps
988
1083
  }, headingClassName = suffixClassName("sui-Heading");
1084
+ /** @public */
989
1085
  function Heading(t0) {
990
- const $ = c(15);
991
- let T0, children, rest, style, t1, t2;
992
- if ($[0] !== t0) {
993
- t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
994
- bb0: {
995
- const {
996
- size: t32,
997
- weight: t4,
998
- ...props
999
- } = t0, size = t32 === void 0 ? 2 : t32, weight = t4 === void 0 ? "bold" : t4, {
1000
- as,
1001
- children: t5,
1002
- className,
1003
- style: t6,
1004
- ...t7
1005
- } = getProps({
1006
- size,
1007
- weight,
1008
- ...props
1009
- }, headingProps);
1010
- children = t5, style = t6, rest = t7;
1011
- const Component = as || "h2";
1012
- if (props.truncate && props.trim) {
1013
- const t8 = clsx(headingClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
1014
- let t10;
1015
- $[7] !== t9 ? (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10) : t10 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t8, style, "data-ui": "Heading", ...rest, children: /* @__PURE__ */ jsx("span", { className: t10, children }) });
1016
- break bb0;
1017
- }
1018
- T0 = Component, t1 = clsx(headingClassName, props.truncate && "sui-overflow-hidden", className);
1019
- }
1020
- $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
1021
- } else
1022
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
1023
- if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1024
- return t2;
1025
- let t3;
1026
- return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Heading", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
1086
+ let $ = c(15), T0, children, rest, style, t1, t2;
1087
+ if ($[0] !== t0) {
1088
+ t2 = Symbol.for("react.early_return_sentinel");
1089
+ bb0: {
1090
+ let { size: t3, weight: t4, ...props } = t0, { as, children: t5, className, style: t6, ...t7 } = getProps({
1091
+ size: t3 === void 0 ? 2 : t3,
1092
+ weight: t4 === void 0 ? "bold" : t4,
1093
+ ...props
1094
+ }, headingProps);
1095
+ children = t5, style = t6, rest = t7;
1096
+ let Component = as || "h2";
1097
+ if (props.truncate && props.trim) {
1098
+ let t8 = clsx(headingClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp", t10;
1099
+ $[7] === t9 ? t10 = $[8] : (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10), t2 = /* @__PURE__ */ jsx(Component, {
1100
+ className: t8,
1101
+ style,
1102
+ "data-ui": "Heading",
1103
+ ...rest,
1104
+ children: /* @__PURE__ */ jsx("span", {
1105
+ className: t10,
1106
+ children
1107
+ })
1108
+ });
1109
+ break bb0;
1110
+ }
1111
+ T0 = Component, t1 = clsx(headingClassName, props.truncate && "sui-overflow-hidden", className);
1112
+ }
1113
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
1114
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
1115
+ if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
1116
+ let t3;
1117
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, {
1118
+ className: t1,
1119
+ style,
1120
+ "data-ui": "Heading",
1121
+ ...rest,
1122
+ children
1123
+ }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
1027
1124
  }
1028
1125
  const iconButtonProps = {
1029
- "aria-label": {
1030
- type: "string"
1031
- },
1032
- as: buttonProps.as,
1033
- icon: {
1034
- type: "string"
1035
- }
1126
+ "aria-label": { type: "string" },
1127
+ as: buttonProps.as,
1128
+ icon: { type: "string" }
1036
1129
  }, iconButtonClassName = suffixClassName("sui-IconButton");
1130
+ /** @public */
1037
1131
  function IconButton(props) {
1038
- const $ = c(16);
1039
- let IconProp, T0, rest, style, t0, t1;
1040
- if ($[0] !== props) {
1041
- const {
1042
- as,
1043
- className,
1044
- style: t22,
1045
- icon: t32,
1046
- ...t4
1047
- } = getProps(props, iconButtonProps);
1048
- style = t22, IconProp = t32, rest = t4;
1049
- const Component = as || "button";
1050
- T0 = Button, t0 = Component, t1 = clsx(iconButtonClassName, className), $[0] = props, $[1] = IconProp, $[2] = T0, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1051
- } else
1052
- IconProp = $[1], T0 = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1053
- let t2;
1054
- $[7] !== IconProp ? (t2 = /* @__PURE__ */ jsx(Icon, { icon: IconProp, margin: -2, size: 1 }), $[7] = IconProp, $[8] = t2) : t2 = $[8];
1055
- let t3;
1056
- return $[9] !== T0 || $[10] !== rest || $[11] !== style || $[12] !== t0 || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "IconButton", ...rest, children: t2 }), $[9] = T0, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1132
+ let $ = c(16), IconProp, T0, rest, style, t0, t1;
1133
+ if ($[0] !== props) {
1134
+ let { as, className, style: t2, icon: t3, ...t4 } = getProps(props, iconButtonProps);
1135
+ style = t2, IconProp = t3, rest = t4;
1136
+ let Component = as || "button";
1137
+ T0 = Button, t0 = Component, t1 = clsx(iconButtonClassName, className), $[0] = props, $[1] = IconProp, $[2] = T0, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1138
+ } else IconProp = $[1], T0 = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1139
+ let t2;
1140
+ $[7] === IconProp ? t2 = $[8] : (t2 = /* @__PURE__ */ jsx(Icon, {
1141
+ icon: IconProp,
1142
+ margin: -2,
1143
+ size: 1
1144
+ }), $[7] = IconProp, $[8] = t2);
1145
+ let t3;
1146
+ return $[9] !== T0 || $[10] !== rest || $[11] !== style || $[12] !== t0 || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, {
1147
+ as: t0,
1148
+ className: t1,
1149
+ style,
1150
+ "data-ui": "IconButton",
1151
+ ...rest,
1152
+ children: t2
1153
+ }), $[9] = T0, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1057
1154
  }
1058
1155
  const dialogProps = {
1059
- header: {
1060
- type: "string"
1061
- },
1062
- open: {
1063
- type: "boolean"
1064
- },
1065
- size: {
1066
- type: "union",
1067
- className: "container",
1068
- values: CONTAINER_SIZE
1069
- },
1070
- topAnchor: {
1071
- type: "string",
1072
- className: "top-anchor",
1073
- variable: "--top-anchor"
1074
- }
1156
+ header: { type: "string" },
1157
+ open: { type: "boolean" },
1158
+ size: {
1159
+ type: "union",
1160
+ className: "container",
1161
+ values: CONTAINER_SIZE
1162
+ },
1163
+ topAnchor: {
1164
+ type: "string",
1165
+ className: "top-anchor",
1166
+ variable: "--top-anchor"
1167
+ }
1075
1168
  }, dialogClassName = suffixClassName("sui-Dialog"), dialogContentClassName = suffixClassName("sui-DialogContent"), dialogFooterClassName = suffixClassName("sui-DialogFooter");
1076
1169
  function DialogRoot(t0) {
1077
- const $ = c(17), {
1078
- open: t1,
1079
- size: t2,
1080
- ...props
1081
- } = t0, open = t1 === void 0 ? !1 : t1, size = t2 === void 0 ? 0 : t2, {
1082
- children,
1083
- className,
1084
- style,
1085
- header,
1086
- onClose,
1087
- ...rest
1088
- } = getProps({
1089
- size,
1090
- ...props
1091
- }, dialogProps), dialogRef = useRef(null), headerId = useId(), dialogClasses = clsx(dialogClassName, `${props.topAnchor ? "sui-mx-auto" : "sui-m-auto"} sui-radius5 sui-shadow3 sui-p4 sui-flex-direction-column sui-gap4 sui-overflow-y-auto`);
1092
- let t3, t4;
1093
- $[0] !== open ? (t3 = () => {
1094
- const dialogElement = dialogRef.current;
1095
- if (dialogElement)
1096
- return open ? dialogElement.open || dialogElement.showModal() : dialogElement.open && dialogElement.close(), () => {
1097
- dialogElement.close();
1098
- };
1099
- }, t4 = [open], $[0] = open, $[1] = t3, $[2] = t4) : (t3 = $[1], t4 = $[2]), useEffect(t3, t4);
1100
- const t5 = "any", t6 = header ? headerId : void 0, t7 = clsx(dialogClasses, className);
1101
- let t8;
1102
- $[3] !== header || $[4] !== headerId ? (t8 = header ? /* @__PURE__ */ jsx(Heading, { trim: !0, size: 1, id: headerId, children: header }) : /* @__PURE__ */ jsx("div", {}), $[3] = header, $[4] = headerId, $[5] = t8) : t8 = $[5];
1103
- let t9;
1104
- $[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx(IconButton, { "aria-label": "Close", level: "tertiary", icon: CloseIcon, onClick: () => dialogRef.current?.close() }), $[6] = t9) : t9 = $[6];
1105
- let t10;
1106
- $[7] !== t8 ? (t10 = /* @__PURE__ */ jsxs(Flex, { flexShrink: 0, justifyContent: "space-between", alignItems: "center", children: [
1107
- t8,
1108
- t9
1109
- ] }), $[7] = t8, $[8] = t10) : t10 = $[8];
1110
- let t11;
1111
- return $[9] !== children || $[10] !== onClose || $[11] !== rest || $[12] !== style || $[13] !== t10 || $[14] !== t6 || $[15] !== t7 ? (t11 = /* @__PURE__ */ jsxs("dialog", { ...rest, ref: dialogRef, closedby: t5, "aria-labelledby": t6, onClose, className: t7, style, "data-ui": "Dialog", children: [
1112
- t10,
1113
- children
1114
- ] }), $[9] = children, $[10] = onClose, $[11] = rest, $[12] = style, $[13] = t10, $[14] = t6, $[15] = t7, $[16] = t11) : t11 = $[16], t11;
1170
+ let $ = c(17), { open: t1, size: t2, ...props } = t0, open = t1 !== void 0 && t1, { children, className, style, header, onClose, ...rest } = getProps({
1171
+ size: t2 === void 0 ? 0 : t2,
1172
+ ...props
1173
+ }, dialogProps), dialogRef = useRef(null), headerId = useId(), dialogClasses = clsx(dialogClassName, `${props.topAnchor ? "sui-mx-auto" : "sui-m-auto"} sui-radius5 sui-shadow3 sui-p4 sui-flex-direction-column sui-gap4 sui-overflow-y-auto`), t3, t4;
1174
+ $[0] === open ? (t3 = $[1], t4 = $[2]) : (t3 = () => {
1175
+ let dialogElement = dialogRef.current;
1176
+ if (dialogElement) return open ? dialogElement.open || dialogElement.showModal() : dialogElement.open && dialogElement.close(), () => {
1177
+ dialogElement.close();
1178
+ };
1179
+ }, t4 = [open], $[0] = open, $[1] = t3, $[2] = t4), useEffect(t3, t4);
1180
+ let t6 = header ? headerId : void 0, t7 = clsx(dialogClasses, className), t8;
1181
+ $[3] !== header || $[4] !== headerId ? (t8 = header ? /* @__PURE__ */ jsx(Heading, {
1182
+ trim: !0,
1183
+ size: 1,
1184
+ id: headerId,
1185
+ children: header
1186
+ }) : /* @__PURE__ */ jsx("div", {}), $[3] = header, $[4] = headerId, $[5] = t8) : t8 = $[5];
1187
+ let t9;
1188
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx(IconButton, {
1189
+ "aria-label": "Close",
1190
+ level: "tertiary",
1191
+ icon: CloseIcon,
1192
+ onClick: () => dialogRef.current?.close()
1193
+ }), $[6] = t9) : t9 = $[6];
1194
+ let t10;
1195
+ $[7] === t8 ? t10 = $[8] : (t10 = /* @__PURE__ */ jsxs(Flex, {
1196
+ flexShrink: 0,
1197
+ justifyContent: "space-between",
1198
+ alignItems: "center",
1199
+ children: [t8, t9]
1200
+ }), $[7] = t8, $[8] = t10);
1201
+ let t11;
1202
+ return $[9] !== children || $[10] !== onClose || $[11] !== rest || $[12] !== style || $[13] !== t10 || $[14] !== t6 || $[15] !== t7 ? (t11 = /* @__PURE__ */ jsxs("dialog", {
1203
+ ...rest,
1204
+ ref: dialogRef,
1205
+ closedby: "any",
1206
+ "aria-labelledby": t6,
1207
+ onClose,
1208
+ className: t7,
1209
+ style,
1210
+ "data-ui": "Dialog",
1211
+ children: [t10, children]
1212
+ }), $[9] = children, $[10] = onClose, $[11] = rest, $[12] = style, $[13] = t10, $[14] = t6, $[15] = t7, $[16] = t11) : t11 = $[16], t11;
1115
1213
  }
1116
1214
  function DialogContent(props) {
1117
- const $ = c(12);
1118
- let T0, children, style, t0, t1;
1119
- if ($[0] !== props) {
1120
- const {
1121
- children: t22,
1122
- className,
1123
- style: t3,
1124
- ...rest
1125
- } = getProps(props, {});
1126
- children = t22, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogContentClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
1127
- } else
1128
- T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
1129
- let t2;
1130
- return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { ...t0, className: t1, style, "data-ui": "DialogContent", flexGrow: 1, overflowY: "auto", children }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1215
+ let $ = c(12), T0, children, style, t0, t1;
1216
+ if ($[0] !== props) {
1217
+ let { children: t2, className, style: t3, ...rest } = getProps(props, {});
1218
+ children = t2, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogContentClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
1219
+ } else T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
1220
+ let t2;
1221
+ return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
1222
+ ...t0,
1223
+ className: t1,
1224
+ style,
1225
+ "data-ui": "DialogContent",
1226
+ flexGrow: 1,
1227
+ overflowY: "auto",
1228
+ children
1229
+ }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1131
1230
  }
1132
1231
  function DialogFooter(props) {
1133
- const $ = c(12);
1134
- let T0, children, style, t0, t1;
1135
- if ($[0] !== props) {
1136
- const {
1137
- children: t22,
1138
- className,
1139
- style: t3,
1140
- ...rest
1141
- } = getProps(props, {});
1142
- children = t22, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogFooterClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
1143
- } else
1144
- T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
1145
- let t2;
1146
- return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { ...t0, className: t1, style, "data-ui": "DialogFooter", flexShrink: 0, children }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1232
+ let $ = c(12), T0, children, style, t0, t1;
1233
+ if ($[0] !== props) {
1234
+ let { children: t2, className, style: t3, ...rest } = getProps(props, {});
1235
+ children = t2, style = t3, T0 = Box, t0 = rest, t1 = clsx(dialogFooterClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = style, $[4] = t0, $[5] = t1;
1236
+ } else T0 = $[1], children = $[2], style = $[3], t0 = $[4], t1 = $[5];
1237
+ let t2;
1238
+ return $[6] !== T0 || $[7] !== children || $[8] !== style || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
1239
+ ...t0,
1240
+ className: t1,
1241
+ style,
1242
+ "data-ui": "DialogFooter",
1243
+ flexShrink: 0,
1244
+ children
1245
+ }), $[6] = T0, $[7] = children, $[8] = style, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1147
1246
  }
1148
1247
  DialogRoot.displayName = "Dialog";
1248
+ /**
1249
+ * @beta
1250
+ *
1251
+ * Renders a modal dialog element — should not be used for nonmodal dialogs.
1252
+ * Modal dialogs make their containing documents inert, and render on the topmost
1253
+ * layer within that containing document; they must be dimissed before the containing
1254
+ * document and its contents become unblocked. They also trap focus within the bounds
1255
+ * of the dialog element and its descendants.
1256
+ *
1257
+ * For more on dialogs and modality, refer to the HTML specification for the dialog element:
1258
+ * https://html.spec.whatwg.org/dev/interactive-elements.html#the-dialog-element
1259
+ */
1149
1260
  const Dialog = DialogRoot;
1150
- DialogRoot.Content = DialogContent;
1151
- DialogRoot.Footer = DialogFooter;
1152
- const dividerProps = {
1153
- ...marginProps
1154
- }, dividerClassName = suffixClassName("sui-Divider");
1261
+ DialogRoot.Content = DialogContent, DialogRoot.Footer = DialogFooter;
1262
+ const dividerProps = { ...marginProps }, dividerClassName = suffixClassName("sui-Divider");
1263
+ /** @public */
1155
1264
  function Divider(props) {
1156
- const $ = c(8);
1157
- let rest, style, t0;
1158
- if ($[0] !== props) {
1159
- const {
1160
- className,
1161
- style: t12,
1162
- ...t2
1163
- } = getProps(props, dividerProps);
1164
- style = t12, rest = t2, t0 = clsx(dividerClassName, "sui-border-none sui-border-top", className), $[0] = props, $[1] = rest, $[2] = style, $[3] = t0;
1165
- } else
1166
- rest = $[1], style = $[2], t0 = $[3];
1167
- let t1;
1168
- return $[4] !== rest || $[5] !== style || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsx("hr", { className: t0, style, "data-ui": "Divider", ...rest }), $[4] = rest, $[5] = style, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
1265
+ let $ = c(8), rest, style, t0;
1266
+ if ($[0] !== props) {
1267
+ let { className, style: t1, ...t2 } = getProps(props, dividerProps);
1268
+ style = t1, rest = t2, t0 = clsx(dividerClassName, "sui-border-none sui-border-top", className), $[0] = props, $[1] = rest, $[2] = style, $[3] = t0;
1269
+ } else rest = $[1], style = $[2], t0 = $[3];
1270
+ let t1;
1271
+ return $[4] !== rest || $[5] !== style || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsx("hr", {
1272
+ className: t0,
1273
+ style,
1274
+ "data-ui": "Divider",
1275
+ ...rest
1276
+ }), $[4] = rest, $[5] = style, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
1169
1277
  }
1170
- const EYEBROW_SIZE = [0, 1, 2, 3, 4], eyebrowProps = {
1171
- as: {
1172
- type: "string"
1173
- },
1174
- size: {
1175
- type: "union",
1176
- className: "text-eyebrow",
1177
- values: EYEBROW_SIZE
1178
- },
1179
- ...typographyProps
1278
+ const eyebrowProps = {
1279
+ as: { type: "string" },
1280
+ size: {
1281
+ type: "union",
1282
+ className: "text-eyebrow",
1283
+ values: [
1284
+ 0,
1285
+ 1,
1286
+ 2,
1287
+ 3,
1288
+ 4
1289
+ ]
1290
+ },
1291
+ ...typographyProps
1180
1292
  }, eyebrowClassName = suffixClassName("sui-Eyebrow");
1293
+ /** @public */
1181
1294
  function Eyebrow(t0) {
1182
- const $ = c(15);
1183
- let T0, children, rest, style, t1, t2;
1184
- if ($[0] !== t0) {
1185
- t2 = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1186
- bb0: {
1187
- const {
1188
- size: t32,
1189
- weight: t4,
1190
- ...props
1191
- } = t0, size = t32 === void 0 ? 2 : t32, weight = t4 === void 0 ? "semibold" : t4, {
1192
- as,
1193
- children: t5,
1194
- className,
1195
- style: t6,
1196
- ...t7
1197
- } = getProps({
1198
- size,
1199
- weight,
1200
- ...props
1201
- }, eyebrowProps);
1202
- children = t5, style = t6, rest = t7;
1203
- const Component = as || "span";
1204
- if (props.truncate && props.trim) {
1205
- const t8 = clsx(eyebrowClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp";
1206
- let t10;
1207
- $[7] !== t9 ? (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10) : t10 = $[8], t2 = /* @__PURE__ */ jsx(Component, { className: t8, style, "data-ui": "Eyebrow", ...rest, children: /* @__PURE__ */ jsx("span", { className: t10, children }) });
1208
- break bb0;
1209
- }
1210
- T0 = Component, t1 = clsx(eyebrowClassName, props.truncate && "sui-overflow-hidden", className);
1211
- }
1212
- $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
1213
- } else
1214
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
1215
- if (t2 !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1216
- return t2;
1217
- let t3;
1218
- return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Eyebrow", ...rest, children }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
1295
+ let $ = c(15), T0, children, rest, style, t1, t2;
1296
+ if ($[0] !== t0) {
1297
+ t2 = Symbol.for("react.early_return_sentinel");
1298
+ bb0: {
1299
+ let { size: t3, weight: t4, ...props } = t0, { as, children: t5, className, style: t6, ...t7 } = getProps({
1300
+ size: t3 === void 0 ? 2 : t3,
1301
+ weight: t4 === void 0 ? "semibold" : t4,
1302
+ ...props
1303
+ }, eyebrowProps);
1304
+ children = t5, style = t6, rest = t7;
1305
+ let Component = as || "span";
1306
+ if (props.truncate && props.trim) {
1307
+ let t8 = clsx(eyebrowClassName, className?.replace("sui-line-clamp", "").replace("sui-text-overflow", "")), t9 = props.truncate === 1 ? "sui-text-overflow" : "sui-line-clamp", t10;
1308
+ $[7] === t9 ? t10 = $[8] : (t10 = clsx("sui-overflow-hidden", t9), $[7] = t9, $[8] = t10), t2 = /* @__PURE__ */ jsx(Component, {
1309
+ className: t8,
1310
+ style,
1311
+ "data-ui": "Eyebrow",
1312
+ ...rest,
1313
+ children: /* @__PURE__ */ jsx("span", {
1314
+ className: t10,
1315
+ children
1316
+ })
1317
+ });
1318
+ break bb0;
1319
+ }
1320
+ T0 = Component, t1 = clsx(eyebrowClassName, props.truncate && "sui-overflow-hidden", className);
1321
+ }
1322
+ $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1, $[6] = t2;
1323
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5], t2 = $[6];
1324
+ if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
1325
+ let t3;
1326
+ return $[9] !== T0 || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 ? (t3 = /* @__PURE__ */ jsx(T0, {
1327
+ className: t1,
1328
+ style,
1329
+ "data-ui": "Eyebrow",
1330
+ ...rest,
1331
+ children
1332
+ }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
1219
1333
  }
1220
- const GRID_AUTO_FLOW = ["row", "column", "row dense", "column dense", "dense"], gridParentProps = {
1221
- gridAutoFlow: {
1222
- type: "union",
1223
- className: "grid-auto-flow",
1224
- values: GRID_AUTO_FLOW
1225
- },
1226
- gridAutoColumns: {
1227
- type: "string",
1228
- className: "grid-auto-columns",
1229
- variable: "--grid-auto-columns"
1230
- },
1231
- gridAutoRows: {
1232
- type: "string",
1233
- className: "grid-auto-rows",
1234
- variable: "--grid-auto-rows"
1235
- },
1236
- gridTemplateColumns: {
1237
- type: "string",
1238
- className: "grid-template-columns",
1239
- variable: "--grid-template-columns"
1240
- },
1241
- gridTemplateRows: {
1242
- type: "string",
1243
- className: "grid-template-rows",
1244
- variable: "--grid-template-rows"
1245
- }
1246
- }, gridProps = {
1247
- as: {
1248
- type: "string"
1249
- },
1250
- display: {
1251
- type: "union",
1252
- className: "display",
1253
- values: DISPLAY_GRID
1254
- },
1255
- ...gridParentProps,
1256
- ...gapProps,
1257
- ...layoutProps
1334
+ const gridProps = {
1335
+ as: { type: "string" },
1336
+ display: {
1337
+ type: "union",
1338
+ className: "display",
1339
+ values: DISPLAY_GRID
1340
+ },
1341
+ gridAutoFlow: {
1342
+ type: "union",
1343
+ className: "grid-auto-flow",
1344
+ values: [
1345
+ "row",
1346
+ "column",
1347
+ "row dense",
1348
+ "column dense",
1349
+ "dense"
1350
+ ]
1351
+ },
1352
+ gridAutoColumns: {
1353
+ type: "string",
1354
+ className: "grid-auto-columns",
1355
+ variable: "--grid-auto-columns"
1356
+ },
1357
+ gridAutoRows: {
1358
+ type: "string",
1359
+ className: "grid-auto-rows",
1360
+ variable: "--grid-auto-rows"
1361
+ },
1362
+ gridTemplateColumns: {
1363
+ type: "string",
1364
+ className: "grid-template-columns",
1365
+ variable: "--grid-template-columns"
1366
+ },
1367
+ gridTemplateRows: {
1368
+ type: "string",
1369
+ className: "grid-template-rows",
1370
+ variable: "--grid-template-rows"
1371
+ },
1372
+ ...gapProps,
1373
+ ...layoutProps
1258
1374
  }, gridClassName = suffixClassName("sui-Grid");
1375
+ /** @public */
1259
1376
  function Grid(t0) {
1260
- const $ = c(12);
1261
- let T0, children, rest, style, t1;
1262
- if ($[0] !== t0) {
1263
- const {
1264
- display: t22,
1265
- minHeight: t3,
1266
- minWidth: t4,
1267
- ...props
1268
- } = t0, display = t22 === void 0 ? "grid" : t22, minHeight = t3 === void 0 ? "0" : t3, minWidth = t4 === void 0 ? "0" : t4, {
1269
- as,
1270
- children: t5,
1271
- className,
1272
- style: t6,
1273
- ...t7
1274
- } = getProps({
1275
- display,
1276
- minHeight,
1277
- minWidth,
1278
- ...props
1279
- }, gridProps);
1280
- children = t5, style = t6, rest = t7, T0 = as || "div", t1 = clsx(gridClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
1281
- } else
1282
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
1283
- let t2;
1284
- return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { className: t1, style, "data-ui": "Grid", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1377
+ let $ = c(12), T0, children, rest, style, t1;
1378
+ if ($[0] !== t0) {
1379
+ let { display: t2, ...props } = t0, { as, children: t3, className, style: t4, ...t5 } = getProps({
1380
+ display: t2 === void 0 ? "grid" : t2,
1381
+ ...props
1382
+ }, gridProps);
1383
+ children = t3, style = t4, rest = t5, T0 = as || "div", t1 = clsx(gridClassName, className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t1;
1384
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t1 = $[5];
1385
+ let t2;
1386
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
1387
+ className: t1,
1388
+ style,
1389
+ "data-ui": "Grid",
1390
+ ...rest,
1391
+ children
1392
+ }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
1285
1393
  }
1286
- const hStackProps = {
1287
- as: {
1288
- type: "string"
1289
- },
1290
- gap: gapProps.gap
1291
- }, hStackClassName = suffixClassName("sui-HStack");
1292
- function HStack(props) {
1293
- const $ = c(14);
1294
- let T0, children, rest, style, t0, t1;
1295
- if ($[0] !== props) {
1296
- const {
1297
- as,
1298
- children: t22,
1299
- className,
1300
- style: t3,
1301
- ...t4
1302
- } = getProps(props, hStackProps);
1303
- children = t22, style = t3, rest = t4;
1304
- const Component = as || "div";
1305
- T0 = Flex, t0 = Component, t1 = clsx(hStackClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1306
- } else
1307
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1308
- let t2;
1309
- return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "HStack", display: "inline-flex", alignItems: "center", flexWrap: "wrap", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1394
+ const hStackClassName = suffixClassName("sui-HStack");
1395
+ /** @public */
1396
+ function HStack(t0) {
1397
+ let $ = c(8), className, props;
1398
+ $[0] === t0 ? (className = $[1], props = $[2]) : ({className, ...props} = t0, $[0] = t0, $[1] = className, $[2] = props);
1399
+ let t1;
1400
+ $[3] === className ? t1 = $[4] : (t1 = clsx(hStackClassName, className), $[3] = className, $[4] = t1);
1401
+ let t2 = props, t3;
1402
+ return $[5] !== t1 || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsx(Flex, {
1403
+ className: t1,
1404
+ "data-ui": "HStack",
1405
+ display: "inline-flex",
1406
+ alignItems: "center",
1407
+ flexWrap: "wrap",
1408
+ ...t2
1409
+ }), $[5] = t1, $[6] = t2, $[7] = t3) : t3 = $[7], t3;
1310
1410
  }
1311
1411
  const indicatorProps = {
1312
- as: {
1313
- type: "string"
1314
- },
1315
- label: {
1316
- type: "string"
1317
- },
1318
- ...toneProps
1412
+ as: { type: "string" },
1413
+ label: { type: "string" },
1414
+ ...toneProps
1319
1415
  }, indicatorClassName = suffixClassName("sui-Indicator");
1416
+ /** @beta */
1320
1417
  function Indicator(t0) {
1321
- const $ = c(18);
1322
- let T0, ariaLabel, children, rest, style, t1, t2;
1323
- if ($[0] !== t0) {
1324
- const {
1325
- tone: t32,
1326
- ...props
1327
- } = t0, tone = t32 === void 0 ? "neutral" : t32, {
1328
- as,
1329
- children: t42,
1330
- className,
1331
- style: t52,
1332
- label,
1333
- ...t6
1334
- } = getProps({
1335
- tone,
1336
- ...props
1337
- }, indicatorProps);
1338
- children = t42, style = t52, rest = t6;
1339
- const Component = as || "span";
1340
- ariaLabel = label || rest["aria-label"], T0 = Box, t1 = Component, t2 = clsx(indicatorClassName, className), $[0] = t0, $[1] = T0, $[2] = ariaLabel, $[3] = children, $[4] = rest, $[5] = style, $[6] = t1, $[7] = t2;
1341
- } else
1342
- T0 = $[1], ariaLabel = $[2], children = $[3], rest = $[4], style = $[5], t1 = $[6], t2 = $[7];
1343
- const t3 = ariaLabel ? void 0 : !0, t4 = ariaLabel ? "img" : void 0;
1344
- let t5;
1345
- return $[8] !== T0 || $[9] !== ariaLabel || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 ? (t5 = /* @__PURE__ */ jsx(T0, { as: t1, className: t2, style, "data-ui": "Indicator", width: "5px", height: "5px", radius: "full", "aria-label": ariaLabel, "aria-hidden": t3, role: t4, ...rest, children }), $[8] = T0, $[9] = ariaLabel, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5) : t5 = $[17], t5;
1418
+ let $ = c(18), T0, ariaLabel, children, rest, style, t1, t2;
1419
+ if ($[0] !== t0) {
1420
+ let { tone: t3, ...props } = t0, { as, children: t4, className, style: t5, label, ...t6 } = getProps({
1421
+ tone: t3 === void 0 ? "neutral" : t3,
1422
+ ...props
1423
+ }, indicatorProps);
1424
+ children = t4, style = t5, rest = t6;
1425
+ let Component = as || "span";
1426
+ ariaLabel = label || rest["aria-label"], T0 = Box, t1 = Component, t2 = clsx(indicatorClassName, className), $[0] = t0, $[1] = T0, $[2] = ariaLabel, $[3] = children, $[4] = rest, $[5] = style, $[6] = t1, $[7] = t2;
1427
+ } else T0 = $[1], ariaLabel = $[2], children = $[3], rest = $[4], style = $[5], t1 = $[6], t2 = $[7];
1428
+ let t3 = !ariaLabel || void 0, t4 = ariaLabel ? "img" : void 0, t5;
1429
+ return $[8] !== T0 || $[9] !== ariaLabel || $[10] !== children || $[11] !== rest || $[12] !== style || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 ? (t5 = /* @__PURE__ */ jsx(T0, {
1430
+ as: t1,
1431
+ className: t2,
1432
+ style,
1433
+ "data-ui": "Indicator",
1434
+ width: "5px",
1435
+ height: "5px",
1436
+ radius: "full",
1437
+ "aria-label": ariaLabel,
1438
+ "aria-hidden": t3,
1439
+ role: t4,
1440
+ ...rest,
1441
+ children
1442
+ }), $[8] = T0, $[9] = ariaLabel, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5) : t5 = $[17], t5;
1346
1443
  }
1347
- const indicatorStackProps = {
1348
- as: {
1349
- type: "string"
1350
- }
1351
- }, indicatorStackClassName = suffixClassName("sui-IndicatorStack");
1444
+ const indicatorStackProps = { as: { type: "string" } }, indicatorStackClassName = suffixClassName("sui-IndicatorStack");
1445
+ /** @public */
1352
1446
  function IndicatorStack(props) {
1353
- const $ = c(14);
1354
- let T0, children, rest, style, t0, t1;
1355
- if ($[0] !== props) {
1356
- const {
1357
- as,
1358
- children: t22,
1359
- className,
1360
- style: t3,
1361
- ...t4
1362
- } = getProps(props, indicatorStackProps);
1363
- children = t22, style = t3, rest = t4;
1364
- const Component = as || "div";
1365
- T0 = HStack, t0 = Component, t1 = clsx(indicatorStackClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1366
- } else
1367
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1368
- let t2;
1369
- return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "IndicatorStack", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1447
+ let $ = c(14), T0, children, rest, style, t0, t1;
1448
+ if ($[0] !== props) {
1449
+ let { as, children: t2, className, style: t3, ...t4 } = getProps(props, indicatorStackProps);
1450
+ children = t2, style = t3, rest = t4;
1451
+ let Component = as || "div";
1452
+ T0 = HStack, t0 = Component, t1 = clsx(indicatorStackClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1453
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1454
+ let t2;
1455
+ return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
1456
+ as: t0,
1457
+ className: t1,
1458
+ style,
1459
+ "data-ui": "IndicatorStack",
1460
+ ...rest,
1461
+ children
1462
+ }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1370
1463
  }
1371
1464
  const inlineProps = {
1372
- as: {
1373
- type: "string"
1374
- },
1375
- gap: {
1376
- type: "composite",
1377
- values: SPACE,
1378
- composition: {
1379
- marginTop: {
1380
- propDef: marginProps.marginTop,
1381
- mapping: {
1382
- 0: 0,
1383
- 1: -1,
1384
- 2: -2,
1385
- 3: -3,
1386
- 4: -4,
1387
- 5: -5,
1388
- 6: -6,
1389
- 7: -7,
1390
- 8: -8,
1391
- 9: -9
1392
- }
1393
- },
1394
- marginLeft: {
1395
- propDef: marginProps.marginLeft,
1396
- mapping: {
1397
- 0: 0,
1398
- 1: -1,
1399
- 2: -2,
1400
- 3: -3,
1401
- 4: -4,
1402
- 5: -5,
1403
- 6: -6,
1404
- 7: -7,
1405
- 8: -8,
1406
- 9: -9
1407
- }
1408
- }
1409
- }
1410
- },
1411
- ...paddingProps
1412
- }, inlineChildrenProps = {
1413
- gap: {
1414
- type: "composite",
1415
- values: SPACE,
1416
- composition: {
1417
- paddingTop: {
1418
- propDef: paddingProps.paddingTop,
1419
- mapping: {
1420
- 0: 0,
1421
- 1: 1,
1422
- 2: 2,
1423
- 3: 3,
1424
- 4: 4,
1425
- 5: 5,
1426
- 6: 6,
1427
- 7: 7,
1428
- 8: 8,
1429
- 9: 9
1430
- }
1431
- },
1432
- paddingLeft: {
1433
- propDef: paddingProps.paddingLeft,
1434
- mapping: {
1435
- 0: 0,
1436
- 1: 1,
1437
- 2: 2,
1438
- 3: 3,
1439
- 4: 4,
1440
- 5: 5,
1441
- 6: 6,
1442
- 7: 7,
1443
- 8: 8,
1444
- 9: 9
1445
- }
1446
- }
1447
- }
1448
- }
1449
- }, inlineClassName = suffixClassName("sui-Inline");
1465
+ as: { type: "string" },
1466
+ gap: {
1467
+ type: "composite",
1468
+ values: SPACE,
1469
+ composition: {
1470
+ marginTop: {
1471
+ propDef: marginProps.marginTop,
1472
+ mapping: {
1473
+ 0: 0,
1474
+ 1: -1,
1475
+ 2: -2,
1476
+ 3: -3,
1477
+ 4: -4,
1478
+ 5: -5,
1479
+ 6: -6,
1480
+ 7: -7,
1481
+ 8: -8,
1482
+ 9: -9
1483
+ }
1484
+ },
1485
+ marginLeft: {
1486
+ propDef: marginProps.marginLeft,
1487
+ mapping: {
1488
+ 0: 0,
1489
+ 1: -1,
1490
+ 2: -2,
1491
+ 3: -3,
1492
+ 4: -4,
1493
+ 5: -5,
1494
+ 6: -6,
1495
+ 7: -7,
1496
+ 8: -8,
1497
+ 9: -9
1498
+ }
1499
+ }
1500
+ }
1501
+ },
1502
+ ...paddingProps
1503
+ }, inlineChildrenProps = { gap: {
1504
+ type: "composite",
1505
+ values: SPACE,
1506
+ composition: {
1507
+ paddingTop: {
1508
+ propDef: paddingProps.paddingTop,
1509
+ mapping: {
1510
+ 0: 0,
1511
+ 1: 1,
1512
+ 2: 2,
1513
+ 3: 3,
1514
+ 4: 4,
1515
+ 5: 5,
1516
+ 6: 6,
1517
+ 7: 7,
1518
+ 8: 8,
1519
+ 9: 9
1520
+ }
1521
+ },
1522
+ paddingLeft: {
1523
+ propDef: paddingProps.paddingLeft,
1524
+ mapping: {
1525
+ 0: 0,
1526
+ 1: 1,
1527
+ 2: 2,
1528
+ 3: 3,
1529
+ 4: 4,
1530
+ 5: 5,
1531
+ 6: 6,
1532
+ 7: 7,
1533
+ 8: 8,
1534
+ 9: 9
1535
+ }
1536
+ }
1537
+ }
1538
+ } }, inlineClassName = suffixClassName("sui-Inline");
1539
+ /** @deprecated Use HStack component instead */
1540
+ /** @public */
1450
1541
  function Inline(props) {
1451
- const $ = c(14);
1452
- let T0, children, rest, style, t0;
1453
- if ($[0] !== props) {
1454
- const {
1455
- as,
1456
- children: childrenProp,
1457
- className,
1458
- style: t12,
1459
- ...t2
1460
- } = getProps(props, inlineProps);
1461
- style = t12, rest = t2;
1462
- const {
1463
- className: childrenClassName
1464
- } = getProps(props, inlineChildrenProps), Component = as || "div";
1465
- let t3;
1466
- $[6] !== childrenClassName ? (t3 = (child) => child && /* @__PURE__ */ jsx("div", { className: childrenClassName, children: child }), $[6] = childrenClassName, $[7] = t3) : t3 = $[7], children = Children.map(childrenProp, t3), T0 = Component, t0 = clsx(inlineClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
1467
- } else
1468
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
1469
- let t1;
1470
- return $[8] !== T0 || $[9] !== children || $[10] !== rest || $[11] !== style || $[12] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, { className: t0, style, "data-ui": "Inline", ...rest, children }), $[8] = T0, $[9] = children, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1) : t1 = $[13], t1;
1542
+ let $ = c(14), T0, children, rest, style, t0;
1543
+ if ($[0] !== props) {
1544
+ let { as, children: childrenProp, className, style: t1, ...t2 } = getProps(props, inlineProps);
1545
+ style = t1, rest = t2;
1546
+ let { className: childrenClassName } = getProps(props, inlineChildrenProps), Component = as || "div", t3;
1547
+ $[6] === childrenClassName ? t3 = $[7] : (t3 = (child) => child && /* @__PURE__ */ jsx("div", {
1548
+ className: childrenClassName,
1549
+ children: child
1550
+ }), $[6] = childrenClassName, $[7] = t3), children = Children.map(childrenProp, t3), T0 = Component, t0 = clsx(inlineClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
1551
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
1552
+ let t1;
1553
+ return $[8] !== T0 || $[9] !== children || $[10] !== rest || $[11] !== style || $[12] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, {
1554
+ className: t0,
1555
+ style,
1556
+ "data-ui": "Inline",
1557
+ ...rest,
1558
+ children
1559
+ }), $[8] = T0, $[9] = children, $[10] = rest, $[11] = style, $[12] = t0, $[13] = t1) : t1 = $[13], t1;
1471
1560
  }
1472
1561
  const linkProps = {
1473
- openInNewTab: {
1474
- type: "boolean"
1475
- },
1476
- underlined: {
1477
- type: "boolean",
1478
- className: "underlined"
1479
- }
1562
+ openInNewTab: { type: "boolean" },
1563
+ underlined: {
1564
+ type: "boolean",
1565
+ className: "underlined"
1566
+ }
1480
1567
  }, linkClassName = suffixClassName("sui-Link");
1568
+ /** @beta */
1481
1569
  function Link(t0) {
1482
- const $ = c(14);
1483
- let children, openInNewTab, rest, style, t1;
1484
- if ($[0] !== t0) {
1485
- const {
1486
- underlined: t22,
1487
- ...props
1488
- } = t0, underlined = t22 === void 0 ? !0 : t22, {
1489
- children: t32,
1490
- className,
1491
- style: t4,
1492
- openInNewTab: t5,
1493
- ...t6
1494
- } = getProps({
1495
- underlined,
1496
- ...props
1497
- }, linkProps);
1498
- children = t32, style = t4, openInNewTab = t5, rest = t6, t1 = clsx(linkClassName, className), $[0] = t0, $[1] = children, $[2] = openInNewTab, $[3] = rest, $[4] = style, $[5] = t1;
1499
- } else
1500
- children = $[1], openInNewTab = $[2], rest = $[3], style = $[4], t1 = $[5];
1501
- let t2;
1502
- $[6] !== openInNewTab ? (t2 = openInNewTab ? {
1503
- target: "_blank",
1504
- rel: "noopener noreferrer"
1505
- } : {}, $[6] = openInNewTab, $[7] = t2) : t2 = $[7];
1506
- let t3;
1507
- return $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t1 || $[12] !== t2 ? (t3 = /* @__PURE__ */ jsx("a", { className: t1, style, "data-ui": "Link", ...t2, ...rest, children }), $[8] = children, $[9] = rest, $[10] = style, $[11] = t1, $[12] = t2, $[13] = t3) : t3 = $[13], t3;
1570
+ let $ = c(14), children, openInNewTab, rest, style, t1;
1571
+ if ($[0] !== t0) {
1572
+ let { underlined: t2, ...props } = t0, { children: t3, className, style: t4, openInNewTab: t5, ...t6 } = getProps({
1573
+ underlined: t2 === void 0 || t2,
1574
+ ...props
1575
+ }, linkProps);
1576
+ children = t3, style = t4, openInNewTab = t5, rest = t6, t1 = clsx(linkClassName, className), $[0] = t0, $[1] = children, $[2] = openInNewTab, $[3] = rest, $[4] = style, $[5] = t1;
1577
+ } else children = $[1], openInNewTab = $[2], rest = $[3], style = $[4], t1 = $[5];
1578
+ let t2;
1579
+ $[6] === openInNewTab ? t2 = $[7] : (t2 = openInNewTab ? {
1580
+ target: "_blank",
1581
+ rel: "noopener noreferrer"
1582
+ } : {}, $[6] = openInNewTab, $[7] = t2);
1583
+ let t3;
1584
+ return $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t1 || $[12] !== t2 ? (t3 = /* @__PURE__ */ jsx("a", {
1585
+ className: t1,
1586
+ style,
1587
+ "data-ui": "Link",
1588
+ ...t2,
1589
+ ...rest,
1590
+ children
1591
+ }), $[8] = children, $[9] = rest, $[10] = style, $[11] = t1, $[12] = t2, $[13] = t3) : t3 = $[13], t3;
1508
1592
  }
1509
- const pressAreaProps = {
1510
- as: {
1511
- type: "string"
1512
- }
1513
- }, pressAreaClassName = suffixClassName("sui-PressArea");
1593
+ const pressAreaProps = { as: { type: "string" } }, pressAreaClassName = suffixClassName("sui-PressArea");
1594
+ /** @public */
1514
1595
  function PressArea(props) {
1515
- const $ = c(12);
1516
- let T0, children, rest, style, t0;
1517
- if ($[0] !== props) {
1518
- const {
1519
- as,
1520
- children: t12,
1521
- className,
1522
- style: t2,
1523
- ...t3
1524
- } = getProps(props, pressAreaProps);
1525
- children = t12, style = t2, rest = t3, T0 = as || "button", t0 = clsx(pressAreaClassName, "sui-width-full", className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
1526
- } else
1527
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
1528
- let t1;
1529
- return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, { className: t0, style, "data-ui": "PressArea", ...rest, children }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
1596
+ let $ = c(12), T0, children, rest, style, t0;
1597
+ if ($[0] !== props) {
1598
+ let { as, children: t1, className, style: t2, ...t3 } = getProps(props, pressAreaProps);
1599
+ children = t1, style = t2, rest = t3, T0 = as || "button", t0 = clsx(pressAreaClassName, "sui-width-full", className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0;
1600
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5];
1601
+ let t1;
1602
+ return $[6] !== T0 || $[7] !== children || $[8] !== rest || $[9] !== style || $[10] !== t0 ? (t1 = /* @__PURE__ */ jsx(T0, {
1603
+ className: t0,
1604
+ style,
1605
+ "data-ui": "PressArea",
1606
+ ...rest,
1607
+ children
1608
+ }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
1530
1609
  }
1531
- const vStackProps = {
1532
- as: {
1533
- type: "string"
1534
- },
1535
- gap: gapProps.gap
1536
- }, vStackClassName = suffixClassName("sui-VStack");
1537
- function VStack(props) {
1538
- const $ = c(14);
1539
- let T0, children, rest, style, t0, t1;
1540
- if ($[0] !== props) {
1541
- const {
1542
- as,
1543
- children: t22,
1544
- className,
1545
- style: t3,
1546
- ...t4
1547
- } = getProps(props, vStackProps);
1548
- children = t22, style = t3, rest = t4;
1549
- const Component = as || "div";
1550
- T0 = Flex, t0 = Component, t1 = clsx(vStackClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1551
- } else
1552
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1553
- let t2;
1554
- return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "VStack", flexDirection: "column", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1610
+ const vStackClassName = suffixClassName("sui-VStack");
1611
+ /** @public */
1612
+ function VStack(t0) {
1613
+ let $ = c(8), className, props;
1614
+ $[0] === t0 ? (className = $[1], props = $[2]) : ({className, ...props} = t0, $[0] = t0, $[1] = className, $[2] = props);
1615
+ let t1;
1616
+ $[3] === className ? t1 = $[4] : (t1 = clsx(vStackClassName, className), $[3] = className, $[4] = t1);
1617
+ let t2 = props, t3;
1618
+ return $[5] !== t1 || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsx(Flex, {
1619
+ className: t1,
1620
+ "data-ui": "VStack",
1621
+ flexDirection: "column",
1622
+ ...t2
1623
+ }), $[5] = t1, $[6] = t2, $[7] = t3) : t3 = $[7], t3;
1555
1624
  }
1556
1625
  const listProps = {
1557
- as: {
1558
- type: "string"
1559
- },
1560
- gap: gapProps.gap
1626
+ as: { type: "string" },
1627
+ gap: gapProps.gap
1561
1628
  }, listItemProps = {
1562
- density: {
1563
- type: "composite",
1564
- values: DENSITY,
1565
- composition: {
1566
- gap: {
1567
- propDef: gapProps.gap,
1568
- mapping: {
1569
- compact: 2,
1570
- regular: 2,
1571
- loose: 3
1572
- }
1573
- },
1574
- minHeight: {
1575
- propDef: heightProps.minHeight,
1576
- mapping: {
1577
- compact: "33px",
1578
- regular: "37px",
1579
- loose: "45px"
1580
- }
1581
- },
1582
- paddingX: {
1583
- propDef: paddingProps.padding,
1584
- mapping: {
1585
- compact: 1,
1586
- regular: 2,
1587
- loose: 3
1588
- }
1589
- }
1590
- }
1591
- },
1592
- end: {
1593
- type: "string"
1594
- },
1595
- start: {
1596
- type: "string"
1597
- }
1629
+ density: {
1630
+ type: "composite",
1631
+ values: DENSITY,
1632
+ composition: {
1633
+ gap: {
1634
+ propDef: gapProps.gap,
1635
+ mapping: {
1636
+ compact: 2,
1637
+ regular: 2,
1638
+ loose: 3
1639
+ }
1640
+ },
1641
+ minHeight: {
1642
+ propDef: heightProps.minHeight,
1643
+ mapping: {
1644
+ compact: "33px",
1645
+ regular: "37px",
1646
+ loose: "45px"
1647
+ }
1648
+ },
1649
+ paddingX: {
1650
+ propDef: paddingProps.padding,
1651
+ mapping: {
1652
+ compact: 1,
1653
+ regular: 2,
1654
+ loose: 3
1655
+ }
1656
+ }
1657
+ }
1658
+ },
1659
+ end: { type: "string" },
1660
+ start: { type: "string" }
1598
1661
  }, listButtonItemProps = {
1599
- as: {
1600
- type: "string"
1601
- },
1602
- selected: {
1603
- type: "boolean"
1604
- },
1605
- ...listItemProps
1662
+ as: { type: "string" },
1663
+ selected: { type: "boolean" },
1664
+ ...listItemProps
1606
1665
  }, listItemTextProps = {
1607
- as: {
1608
- type: "string"
1609
- },
1610
- title: {
1611
- type: "string"
1612
- },
1613
- subtitle: {
1614
- type: "string"
1615
- }
1666
+ as: { type: "string" },
1667
+ title: { type: "string" },
1668
+ subtitle: { type: "string" }
1616
1669
  }, listClassName = suffixClassName("sui-List"), listItemClassName = suffixClassName("sui-ListItem"), listButtonItemClassName = suffixClassName("sui-ListButtonItem"), listItemTextClassName = suffixClassName("sui-ListItemText"), listItemImageClassName = suffixClassName("sui-ListItemImage");
1617
1670
  function ListRoot(props) {
1618
- const $ = c(14);
1619
- let T0, children, rest, style, t0, t1;
1620
- if ($[0] !== props) {
1621
- const {
1622
- as,
1623
- children: t22,
1624
- className,
1625
- style: t3,
1626
- ...t4
1627
- } = getProps(props, listProps);
1628
- children = t22, style = t3, rest = t4;
1629
- const Component = as || "ul";
1630
- T0 = VStack, t0 = Component, t1 = clsx(listClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1631
- } else
1632
- T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1633
- let t2;
1634
- return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, style, "data-ui": "List", ...rest, children }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1671
+ let $ = c(14), T0, children, rest, style, t0, t1;
1672
+ if ($[0] !== props) {
1673
+ let { as, children: t2, className, style: t3, ...t4 } = getProps(props, listProps);
1674
+ children = t2, style = t3, rest = t4;
1675
+ let Component = as || "ul";
1676
+ T0 = VStack, t0 = Component, t1 = clsx(listClassName, className), $[0] = props, $[1] = T0, $[2] = children, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1;
1677
+ } else T0 = $[1], children = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6];
1678
+ let t2;
1679
+ return $[7] !== T0 || $[8] !== children || $[9] !== rest || $[10] !== style || $[11] !== t0 || $[12] !== t1 ? (t2 = /* @__PURE__ */ jsx(T0, {
1680
+ as: t0,
1681
+ className: t1,
1682
+ style,
1683
+ "data-ui": "List",
1684
+ ...rest,
1685
+ children
1686
+ }), $[7] = T0, $[8] = children, $[9] = rest, $[10] = style, $[11] = t0, $[12] = t1, $[13] = t2) : t2 = $[13], t2;
1635
1687
  }
1636
1688
  function ListItem(t0) {
1637
- const $ = c(16);
1638
- let children, end, rest, start, style, t1;
1639
- if ($[0] !== t0) {
1640
- const {
1641
- density: t22,
1642
- ...props
1643
- } = t0, density = t22 === void 0 ? "regular" : t22, {
1644
- children: t32,
1645
- className,
1646
- style: t4,
1647
- end: t5,
1648
- start: t6,
1649
- ...t7
1650
- } = getProps({
1651
- density,
1652
- ...props
1653
- }, listItemProps);
1654
- children = t32, style = t4, end = t5, start = t6, rest = t7, t1 = clsx(listItemClassName, "sui-width-full sui-display-flex sui-align-items-center", className), $[0] = t0, $[1] = children, $[2] = end, $[3] = rest, $[4] = start, $[5] = style, $[6] = t1;
1655
- } else
1656
- children = $[1], end = $[2], rest = $[3], start = $[4], style = $[5], t1 = $[6];
1657
- let t2;
1658
- $[7] !== children ? (t2 = /* @__PURE__ */ jsx(Flex, { flexGrow: 1, gap: "inherit", children }), $[7] = children, $[8] = t2) : t2 = $[8];
1659
- let t3;
1660
- return $[9] !== end || $[10] !== rest || $[11] !== start || $[12] !== style || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsxs("li", { className: t1, style, "data-ui": "ListItem", ...rest, children: [
1661
- start,
1662
- t2,
1663
- end
1664
- ] }), $[9] = end, $[10] = rest, $[11] = start, $[12] = style, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1689
+ let $ = c(16), children, end, rest, start, style, t1;
1690
+ if ($[0] !== t0) {
1691
+ let { density: t2, ...props } = t0, { children: t3, className, style: t4, end: t5, start: t6, ...t7 } = getProps({
1692
+ density: t2 === void 0 ? "regular" : t2,
1693
+ ...props
1694
+ }, listItemProps);
1695
+ children = t3, style = t4, end = t5, start = t6, rest = t7, t1 = clsx(listItemClassName, "sui-width-full sui-display-flex sui-align-items-center", className), $[0] = t0, $[1] = children, $[2] = end, $[3] = rest, $[4] = start, $[5] = style, $[6] = t1;
1696
+ } else children = $[1], end = $[2], rest = $[3], start = $[4], style = $[5], t1 = $[6];
1697
+ let t2;
1698
+ $[7] === children ? t2 = $[8] : (t2 = /* @__PURE__ */ jsx(Flex, {
1699
+ flexGrow: 1,
1700
+ gap: "inherit",
1701
+ children
1702
+ }), $[7] = children, $[8] = t2);
1703
+ let t3;
1704
+ return $[9] !== end || $[10] !== rest || $[11] !== start || $[12] !== style || $[13] !== t1 || $[14] !== t2 ? (t3 = /* @__PURE__ */ jsxs("li", {
1705
+ className: t1,
1706
+ style,
1707
+ "data-ui": "ListItem",
1708
+ ...rest,
1709
+ children: [
1710
+ start,
1711
+ t2,
1712
+ end
1713
+ ]
1714
+ }), $[9] = end, $[10] = rest, $[11] = start, $[12] = style, $[13] = t1, $[14] = t2, $[15] = t3) : t3 = $[15], t3;
1665
1715
  }
1666
1716
  function ListButtonItem(t0) {
1667
- const $ = c(22);
1668
- let T0, children, end, rest, selected, start, style, t1, t2;
1669
- if ($[0] !== t0) {
1670
- const {
1671
- density: t32,
1672
- ...props
1673
- } = t0, density = t32 === void 0 ? "regular" : t32, {
1674
- as,
1675
- children: t42,
1676
- className,
1677
- style: t5,
1678
- end: t6,
1679
- start: t7,
1680
- selected: t8,
1681
- ...t9
1682
- } = getProps({
1683
- density,
1684
- ...props
1685
- }, listButtonItemProps);
1686
- children = t42, style = t5, end = t6, start = t7, selected = t8, rest = t9;
1687
- const Component = as || "button";
1688
- T0 = PressArea, t1 = Component, t2 = clsx(listButtonItemClassName, "sui-width-full sui-display-flex sui-align-items-center sui-radius2", className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = end, $[4] = rest, $[5] = selected, $[6] = start, $[7] = style, $[8] = t1, $[9] = t2;
1689
- } else
1690
- T0 = $[1], children = $[2], end = $[3], rest = $[4], selected = $[5], start = $[6], style = $[7], t1 = $[8], t2 = $[9];
1691
- let t3;
1692
- $[10] !== children ? (t3 = /* @__PURE__ */ jsx(Flex, { flexGrow: 1, gap: "inherit", children }), $[10] = children, $[11] = t3) : t3 = $[11];
1693
- let t4;
1694
- return $[12] !== T0 || $[13] !== end || $[14] !== rest || $[15] !== selected || $[16] !== start || $[17] !== style || $[18] !== t1 || $[19] !== t2 || $[20] !== t3 ? (t4 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(T0, { as: t1, className: t2, style, "data-ui": "ListButtonItem", "data-selected": selected, ...rest, children: [
1695
- start,
1696
- t3,
1697
- end
1698
- ] }) }), $[12] = T0, $[13] = end, $[14] = rest, $[15] = selected, $[16] = start, $[17] = style, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4) : t4 = $[21], t4;
1717
+ let $ = c(22), T0, children, end, rest, selected, start, style, t1, t2;
1718
+ if ($[0] !== t0) {
1719
+ let { density: t3, ...props } = t0, { as, children: t4, className, style: t5, end: t6, start: t7, selected: t8, ...t9 } = getProps({
1720
+ density: t3 === void 0 ? "regular" : t3,
1721
+ ...props
1722
+ }, listButtonItemProps);
1723
+ children = t4, style = t5, end = t6, start = t7, selected = t8, rest = t9;
1724
+ let Component = as || "button";
1725
+ T0 = PressArea, t1 = Component, t2 = clsx(listButtonItemClassName, "sui-width-full sui-display-flex sui-align-items-center sui-radius2", className), $[0] = t0, $[1] = T0, $[2] = children, $[3] = end, $[4] = rest, $[5] = selected, $[6] = start, $[7] = style, $[8] = t1, $[9] = t2;
1726
+ } else T0 = $[1], children = $[2], end = $[3], rest = $[4], selected = $[5], start = $[6], style = $[7], t1 = $[8], t2 = $[9];
1727
+ let t3;
1728
+ $[10] === children ? t3 = $[11] : (t3 = /* @__PURE__ */ jsx(Flex, {
1729
+ flexGrow: 1,
1730
+ gap: "inherit",
1731
+ children
1732
+ }), $[10] = children, $[11] = t3);
1733
+ let t4;
1734
+ return $[12] !== T0 || $[13] !== end || $[14] !== rest || $[15] !== selected || $[16] !== start || $[17] !== style || $[18] !== t1 || $[19] !== t2 || $[20] !== t3 ? (t4 = /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(T0, {
1735
+ as: t1,
1736
+ className: t2,
1737
+ style,
1738
+ "data-ui": "ListButtonItem",
1739
+ "data-selected": selected,
1740
+ ...rest,
1741
+ children: [
1742
+ start,
1743
+ t3,
1744
+ end
1745
+ ]
1746
+ }) }), $[12] = T0, $[13] = end, $[14] = rest, $[15] = selected, $[16] = start, $[17] = style, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4) : t4 = $[21], t4;
1699
1747
  }
1700
1748
  function ListItemText(props) {
1701
- const $ = c(20);
1702
- let T0, rest, style, subtitle, t0, t1, title;
1703
- if ($[0] !== props) {
1704
- const {
1705
- as,
1706
- className,
1707
- style: t22,
1708
- title: t32,
1709
- subtitle: t42,
1710
- ...t5
1711
- } = getProps(props, listItemTextProps);
1712
- style = t22, title = t32, subtitle = t42, rest = t5;
1713
- const Component = as || "div";
1714
- T0 = Flex, t0 = Component, t1 = clsx(listItemTextClassName, className), $[0] = props, $[1] = T0, $[2] = rest, $[3] = style, $[4] = subtitle, $[5] = t0, $[6] = t1, $[7] = title;
1715
- } else
1716
- T0 = $[1], rest = $[2], style = $[3], subtitle = $[4], t0 = $[5], t1 = $[6], title = $[7];
1717
- let t2;
1718
- $[8] !== title ? (t2 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", trim: !0, truncate: 1, children: title }), $[8] = title, $[9] = t2) : t2 = $[9];
1719
- let t3;
1720
- $[10] !== subtitle ? (t3 = subtitle && /* @__PURE__ */ jsx(Text, { size: 1, muted: !0, trim: !0, truncate: 1, children: subtitle }), $[10] = subtitle, $[11] = t3) : t3 = $[11];
1721
- let t4;
1722
- return $[12] !== T0 || $[13] !== rest || $[14] !== style || $[15] !== t0 || $[16] !== t1 || $[17] !== t2 || $[18] !== t3 ? (t4 = /* @__PURE__ */ jsxs(T0, { as: t0, className: t1, style, "data-ui": "ListItemText", flexDirection: "column", justifyContent: "center", gap: 2, flexGrow: 1, ...rest, children: [
1723
- t2,
1724
- t3
1725
- ] }), $[12] = T0, $[13] = rest, $[14] = style, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4) : t4 = $[19], t4;
1749
+ let $ = c(20), T0, rest, style, subtitle, t0, t1, title;
1750
+ if ($[0] !== props) {
1751
+ let { as, className, style: t2, title: t3, subtitle: t4, ...t5 } = getProps(props, listItemTextProps);
1752
+ style = t2, title = t3, subtitle = t4, rest = t5;
1753
+ let Component = as || "div";
1754
+ T0 = Flex, t0 = Component, t1 = clsx(listItemTextClassName, className), $[0] = props, $[1] = T0, $[2] = rest, $[3] = style, $[4] = subtitle, $[5] = t0, $[6] = t1, $[7] = title;
1755
+ } else T0 = $[1], rest = $[2], style = $[3], subtitle = $[4], t0 = $[5], t1 = $[6], title = $[7];
1756
+ let t2;
1757
+ $[8] === title ? t2 = $[9] : (t2 = title && /* @__PURE__ */ jsx(Text, {
1758
+ size: 1,
1759
+ weight: "medium",
1760
+ trim: !0,
1761
+ truncate: 1,
1762
+ children: title
1763
+ }), $[8] = title, $[9] = t2);
1764
+ let t3;
1765
+ $[10] === subtitle ? t3 = $[11] : (t3 = subtitle && /* @__PURE__ */ jsx(Text, {
1766
+ size: 1,
1767
+ muted: !0,
1768
+ trim: !0,
1769
+ truncate: 1,
1770
+ children: subtitle
1771
+ }), $[10] = subtitle, $[11] = t3);
1772
+ let t4;
1773
+ return $[12] !== T0 || $[13] !== rest || $[14] !== style || $[15] !== t0 || $[16] !== t1 || $[17] !== t2 || $[18] !== t3 ? (t4 = /* @__PURE__ */ jsxs(T0, {
1774
+ as: t0,
1775
+ className: t1,
1776
+ style,
1777
+ "data-ui": "ListItemText",
1778
+ flexDirection: "column",
1779
+ justifyContent: "center",
1780
+ gap: 2,
1781
+ flexGrow: 1,
1782
+ ...rest,
1783
+ children: [t2, t3]
1784
+ }), $[12] = T0, $[13] = rest, $[14] = style, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4) : t4 = $[19], t4;
1726
1785
  }
1727
1786
  function ListItemImage(props) {
1728
- const $ = c(8);
1729
- let rest, style, t0;
1730
- if ($[0] !== props) {
1731
- const {
1732
- className,
1733
- style: t12,
1734
- ...t2
1735
- } = getProps(props, {});
1736
- style = t12, rest = t2, t0 = clsx(listItemImageClassName, "sui-radius2", className), $[0] = props, $[1] = rest, $[2] = style, $[3] = t0;
1737
- } else
1738
- rest = $[1], style = $[2], t0 = $[3];
1739
- let t1;
1740
- return $[4] !== rest || $[5] !== style || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsx("img", { className: t0, style, "data-ui": "ListItemImage", ...rest }), $[4] = rest, $[5] = style, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
1787
+ let $ = c(8), rest, style, t0;
1788
+ if ($[0] !== props) {
1789
+ let { className, style: t1, ...t2 } = getProps(props, {});
1790
+ style = t1, rest = t2, t0 = clsx(listItemImageClassName, "sui-radius2", className), $[0] = props, $[1] = rest, $[2] = style, $[3] = t0;
1791
+ } else rest = $[1], style = $[2], t0 = $[3];
1792
+ let t1;
1793
+ return $[4] !== rest || $[5] !== style || $[6] !== t0 ? (t1 = /* @__PURE__ */ jsx("img", {
1794
+ className: t0,
1795
+ style,
1796
+ "data-ui": "ListItemImage",
1797
+ ...rest
1798
+ }), $[4] = rest, $[5] = style, $[6] = t0, $[7] = t1) : t1 = $[7], t1;
1741
1799
  }
1742
1800
  ListRoot.displayName = "List";
1801
+ /** @beta */
1743
1802
  const List = ListRoot;
1744
- ListRoot.Item = ListItem;
1745
- ListRoot.ButtonItem = ListButtonItem;
1746
- ListRoot.ItemText = ListItemText;
1747
- ListRoot.ItemImage = ListItemImage;
1803
+ ListRoot.Item = ListItem, ListRoot.ButtonItem = ListButtonItem, ListRoot.ItemText = ListItemText, ListRoot.ItemImage = ListItemImage;
1804
+ /** @public */
1748
1805
  function useIsClient() {
1749
- return useSyncExternalStore(_temp2, _temp3, _temp4);
1806
+ return useSyncExternalStore(_temp2, _temp3, _temp4);
1750
1807
  }
1751
1808
  function _temp4() {
1752
- return !1;
1809
+ return !1;
1753
1810
  }
1754
1811
  function _temp3() {
1755
- return !0;
1812
+ return !0;
1756
1813
  }
1757
1814
  function _temp2() {
1758
- return _temp;
1759
- }
1760
- function _temp() {
1815
+ return _temp;
1761
1816
  }
1817
+ function _temp() {}
1762
1818
  function isReactEventHandler(key, value) {
1763
- return /^on[A-Z]/.test(key) && typeof value == "function";
1819
+ return /^on[A-Z]/.test(key) && typeof value == "function";
1764
1820
  }
1765
1821
  function chainEventHandlers(...handlers) {
1766
- const defined = handlers.filter(Boolean);
1767
- if (defined.length !== 0)
1768
- return defined.length === 1 ? defined[0] : (e) => {
1769
- for (const handler of defined)
1770
- handler(e);
1771
- };
1822
+ let defined = handlers.filter(Boolean);
1823
+ if (defined.length !== 0) return defined.length === 1 ? defined[0] : (e) => {
1824
+ for (let handler of defined) handler(e);
1825
+ };
1772
1826
  }
1773
1827
  function mergeTriggerProps(childProps, forwardedProps, ownProps) {
1774
- const result = {};
1775
- for (const source of [forwardedProps, ownProps])
1776
- if (source) {
1777
- for (const [key, value] of Object.entries(source))
1778
- if (key !== "style") {
1779
- if (isReactEventHandler(key, value)) {
1780
- result[key] = chainEventHandlers(result[key], value);
1781
- continue;
1782
- }
1783
- value !== void 0 && (result[key] = value);
1784
- }
1785
- }
1786
- result.style = {
1787
- ...childProps.style,
1788
- ...forwardedProps?.style,
1789
- ...ownProps?.style
1790
- };
1791
- for (const [key, value] of Object.entries(childProps))
1792
- isReactEventHandler(key, value) && (result[key] = chainEventHandlers(result[key], value));
1793
- return result;
1828
+ let result = {};
1829
+ for (let source of [forwardedProps, ownProps]) if (source) {
1830
+ for (let [key, value] of Object.entries(source)) if (key !== "style") {
1831
+ if (isReactEventHandler(key, value)) {
1832
+ result[key] = chainEventHandlers(result[key], value);
1833
+ continue;
1834
+ }
1835
+ value !== void 0 && (result[key] = value);
1836
+ }
1837
+ }
1838
+ result.style = {
1839
+ ...childProps.style,
1840
+ ...forwardedProps?.style,
1841
+ ...ownProps?.style
1842
+ };
1843
+ for (let [key, value] of Object.entries(childProps)) isReactEventHandler(key, value) && (result[key] = chainEventHandlers(result[key], value));
1844
+ return result;
1794
1845
  }
1795
1846
  function renderPortal(node, mounted, portal) {
1796
- return portal ? mounted ? createPortal(node, document.body) : null : node;
1847
+ return portal ? mounted ? createPortal(node, document.body) : null : node;
1797
1848
  }
1798
- const PLACEMENT = ["top", "top-start", "top-end", "right", "right-start", "right-end", "bottom", "bottom-start", "bottom-end", "left", "left-start", "left-end"], placementProps = {
1799
- placement: {
1800
- type: "union",
1801
- className: "placement",
1802
- values: PLACEMENT
1803
- }
1804
- }, popoverProps = {
1805
- anchorName: {
1806
- type: "string"
1807
- },
1808
- content: {
1809
- type: "string"
1810
- },
1811
- portal: {
1812
- type: "boolean"
1813
- },
1814
- ...placementProps
1849
+ const placementProps = { placement: {
1850
+ type: "union",
1851
+ className: "placement",
1852
+ values: [
1853
+ "top",
1854
+ "top-start",
1855
+ "top-end",
1856
+ "right",
1857
+ "right-start",
1858
+ "right-end",
1859
+ "bottom",
1860
+ "bottom-start",
1861
+ "bottom-end",
1862
+ "left",
1863
+ "left-start",
1864
+ "left-end"
1865
+ ]
1866
+ } }, popoverProps = {
1867
+ anchorName: { type: "string" },
1868
+ content: { type: "string" },
1869
+ portal: { type: "boolean" },
1870
+ ...placementProps
1815
1871
  }, popoverClassName = suffixClassName("sui-PopoverContent");
1816
1872
  function PopoverRoot(t0) {
1817
- const $ = c(4), {
1818
- placement: t1,
1819
- ...props
1820
- } = t0, placement = t1 === void 0 ? "bottom" : t1, {
1821
- children,
1822
- className,
1823
- style,
1824
- id: idProp,
1825
- anchorName,
1826
- content,
1827
- portal,
1828
- triggerProps: forwardedTriggerProps,
1829
- ...rest
1830
- } = getProps({
1831
- placement,
1832
- ...props
1833
- }, popoverProps), reactId = useId(), id = idProp || reactId, [open, setOpen] = useState(!1), isClient = useIsClient();
1834
- let t2;
1835
- $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = (e) => {
1836
- setOpen(e.newState === "open");
1837
- }, $[0] = t2) : t2 = $[0];
1838
- const handleToggle = t2, triggerProps = {
1839
- popoverTarget: id,
1840
- style: {
1841
- anchorName: `--anchor-${anchorName || id}`
1842
- }
1843
- }, trigger = children.type.forwardsTriggerProps ? cloneElement(children, {
1844
- triggerProps
1845
- }) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps)), t3 = renderPortal(/* @__PURE__ */ jsx(Activity, { mode: open ? "visible" : "hidden", children: /* @__PURE__ */ jsx("div", { className: clsx(popoverClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className), style: {
1846
- ...style,
1847
- positionAnchor: `--anchor-${anchorName || id}`
1848
- }, "data-ui": "Popover", popover: "auto", id, onToggle: handleToggle, ...rest, children: content }) }), isClient, portal);
1849
- let t4;
1850
- return $[1] !== t3 || $[2] !== trigger ? (t4 = /* @__PURE__ */ jsxs(Fragment, { children: [
1851
- trigger,
1852
- t3
1853
- ] }), $[1] = t3, $[2] = trigger, $[3] = t4) : t4 = $[3], t4;
1873
+ let $ = c(4), { placement: t1, ...props } = t0, { children, className, style, id: idProp, anchorName, content, portal, triggerProps: forwardedTriggerProps, ...rest } = getProps({
1874
+ placement: t1 === void 0 ? "bottom" : t1,
1875
+ ...props
1876
+ }, popoverProps), reactId = useId(), id = idProp || reactId, [open, setOpen] = useState(!1), isClient = useIsClient(), t2;
1877
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = (e) => {
1878
+ setOpen(e.newState === "open");
1879
+ }, $[0] = t2) : t2 = $[0];
1880
+ let handleToggle = t2, triggerProps = {
1881
+ popoverTarget: id,
1882
+ style: { anchorName: `--anchor-${anchorName || id}` }
1883
+ }, trigger = children.type.forwardsTriggerProps ? cloneElement(children, { triggerProps }) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps)), t3 = renderPortal(/* @__PURE__ */ jsx(Activity, {
1884
+ mode: open ? "visible" : "hidden",
1885
+ children: /* @__PURE__ */ jsx("div", {
1886
+ className: clsx(popoverClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className),
1887
+ style: {
1888
+ ...style,
1889
+ positionAnchor: `--anchor-${anchorName || id}`
1890
+ },
1891
+ "data-ui": "Popover",
1892
+ popover: "auto",
1893
+ id,
1894
+ onToggle: handleToggle,
1895
+ ...rest,
1896
+ children: content
1897
+ })
1898
+ }), isClient, portal), t4;
1899
+ return $[1] !== t3 || $[2] !== trigger ? (t4 = /* @__PURE__ */ jsxs(Fragment, { children: [trigger, t3] }), $[1] = t3, $[2] = trigger, $[3] = t4) : t4 = $[3], t4;
1854
1900
  }
1855
- const Popover = Object.assign(PopoverRoot, {
1856
- forwardsTriggerProps: !0
1857
- }), radioProps = {
1858
- error: {
1859
- type: "boolean"
1860
- },
1861
- label: {
1862
- type: "string"
1863
- },
1864
- ...marginProps
1901
+ /** @beta */
1902
+ const Popover = Object.assign(PopoverRoot, { forwardsTriggerProps: !0 }), radioProps = {
1903
+ error: { type: "boolean" },
1904
+ label: { type: "string" },
1905
+ ...marginProps
1865
1906
  }, radioClassName = suffixClassName("sui-Radio"), radioInputClassName = suffixClassName("sui-RadioInput"), radioMarkClassName = suffixClassName("sui-RadioMark");
1907
+ /** @beta */
1866
1908
  function Radio(props) {
1867
- const $ = c(26);
1868
- let T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
1869
- if ($[0] !== props) {
1870
- const {
1871
- className,
1872
- style,
1873
- label: t82,
1874
- disabled,
1875
- error,
1876
- ...rest
1877
- } = getProps(props, radioProps);
1878
- label = t82, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "radio", className: radioInputClassName, disabled, ...rest }), T0 = Box, t0 = "span", t1 = clsx(radioMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
1879
- } else
1880
- T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
1881
- let t8;
1882
- $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, position: "relative", radius: "full", width: "17px", height: "17px" }), $[12] = T0, $[13] = t0, $[14] = t1, $[15] = t8) : t8 = $[15];
1883
- let t9;
1884
- return $[16] !== T1 || $[17] !== label || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T1, { className: t2, style: t3, "data-ui": t4, disabled: t5, error: t6, children: [
1885
- t7,
1886
- t8,
1887
- label
1888
- ] }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
1909
+ let $ = c(26), T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
1910
+ if ($[0] !== props) {
1911
+ let { className, style, label: t8, disabled, error, ...rest } = getProps(props, radioProps);
1912
+ label = t8, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
1913
+ as: "input",
1914
+ type: "radio",
1915
+ className: radioInputClassName,
1916
+ disabled,
1917
+ ...rest
1918
+ }), T0 = Box, t0 = "span", t1 = clsx(radioMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
1919
+ } else T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
1920
+ let t8;
1921
+ $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, {
1922
+ as: t0,
1923
+ className: t1,
1924
+ position: "relative",
1925
+ radius: "full",
1926
+ width: "17px",
1927
+ height: "17px"
1928
+ }), $[12] = T0, $[13] = t0, $[14] = t1, $[15] = t8) : t8 = $[15];
1929
+ let t9;
1930
+ return $[16] !== T1 || $[17] !== label || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T1, {
1931
+ className: t2,
1932
+ style: t3,
1933
+ "data-ui": t4,
1934
+ disabled: t5,
1935
+ error: t6,
1936
+ children: [
1937
+ t7,
1938
+ t8,
1939
+ label
1940
+ ]
1941
+ }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
1942
+ }
1943
+ const selectProps = {
1944
+ disabled: { type: "boolean" },
1945
+ hasError: { type: "boolean" },
1946
+ density: {
1947
+ type: "composite",
1948
+ values: ["regular", "loose"],
1949
+ composition: {
1950
+ paddingX: {
1951
+ propDef: paddingProps.paddingX,
1952
+ mapping: {
1953
+ regular: 2,
1954
+ loose: 3
1955
+ }
1956
+ },
1957
+ paddingY: {
1958
+ propDef: paddingProps.paddingY,
1959
+ mapping: {
1960
+ regular: 1,
1961
+ loose: 2
1962
+ }
1963
+ }
1964
+ }
1965
+ }
1966
+ }, selectClassName = suffixClassName("sui-Select");
1967
+ /** @public */
1968
+ function Select(t0) {
1969
+ let $ = c(17), { density: t1, hasError: t2, ...props } = t0, density = t1 === void 0 ? "regular" : t1, hasError = t2 !== void 0 && t2, { children, className, style, ...rest } = getProps({
1970
+ density,
1971
+ ...props
1972
+ }, selectProps), anchorName = `--anchor-${useId()}`, selectClasses = clsx(selectClassName, hasError && "sui-error", "sui-radius2", "sui-width-full", className), t3;
1973
+ $[0] !== anchorName || $[1] !== style ? (t3 = {
1974
+ ...style,
1975
+ anchorName
1976
+ }, $[0] = anchorName, $[1] = style, $[2] = t3) : t3 = $[2];
1977
+ let t4 = hasError || void 0, t5;
1978
+ $[3] !== children || $[4] !== rest || $[5] !== selectClasses || $[6] !== t3 || $[7] !== t4 ? (t5 = /* @__PURE__ */ jsx("select", {
1979
+ "data-ui": "Select",
1980
+ className: selectClasses,
1981
+ style: t3,
1982
+ ...rest,
1983
+ "aria-invalid": t4,
1984
+ children
1985
+ }), $[3] = children, $[4] = rest, $[5] = selectClasses, $[6] = t3, $[7] = t4, $[8] = t5) : t5 = $[8];
1986
+ let t6;
1987
+ $[9] === anchorName ? t6 = $[10] : (t6 = { positionAnchor: anchorName }, $[9] = anchorName, $[10] = t6);
1988
+ let t7;
1989
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Icon, {
1990
+ icon: SelectIcon,
1991
+ size: 1
1992
+ }), $[11] = t7) : t7 = $[11];
1993
+ let t8;
1994
+ $[12] === t6 ? t8 = $[13] : (t8 = /* @__PURE__ */ jsx("div", {
1995
+ className: "sui-position-absolute sui-display-flex sui-align-items-center sui-px1",
1996
+ "data-ui": "Select-icon",
1997
+ style: t6,
1998
+ children: t7
1999
+ }), $[12] = t6, $[13] = t8);
2000
+ let t9;
2001
+ return $[14] !== t5 || $[15] !== t8 ? (t9 = /* @__PURE__ */ jsxs(Fragment, { children: [t5, t8] }), $[14] = t5, $[15] = t8, $[16] = t9) : t9 = $[16], t9;
1889
2002
  }
1890
- const skipToContentProps = {
1891
- label: {
1892
- type: "string"
1893
- }
1894
- }, skipToContentClassName = suffixClassName("sui-SkipToContent");
2003
+ const skipToContentProps = { label: { type: "string" } }, skipToContentClassName = suffixClassName("sui-SkipToContent");
2004
+ /** @beta */
1895
2005
  function SkipToContent(props) {
1896
- const $ = c(18);
1897
- let T0, label, rest, style, t0, t1, t2;
1898
- if ($[0] !== props) {
1899
- const {
1900
- className,
1901
- label: t32,
1902
- style: t42,
1903
- ...t5
1904
- } = getProps(props, skipToContentProps);
1905
- label = t32, style = t42, rest = t5, T0 = VisuallyHidden, t0 = Link, t1 = !1, t2 = clsx(skipToContentClassName, "sui-position-absolute sui-top2 sui-left2 sui-display-inline-block sui-z-index sui-py2 sui-px3 sui-radius2 sui-text-body1", className), $[0] = props, $[1] = T0, $[2] = label, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1, $[7] = t2;
1906
- } else
1907
- T0 = $[1], label = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6], t2 = $[7];
1908
- let t3;
1909
- $[8] !== label ? (t3 = /* @__PURE__ */ jsx(Text, { size: 1, children: label }), $[8] = label, $[9] = t3) : t3 = $[9];
1910
- let t4;
1911
- return $[10] !== T0 || $[11] !== rest || $[12] !== style || $[13] !== t0 || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, { as: t0, underlined: t1, className: t2, style, "data-ui": "SkipToContent", visibleOnFocus: !0, ...rest, children: t3 }), $[10] = T0, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
2006
+ let $ = c(18), T0, label, rest, style, t0, t1, t2;
2007
+ if ($[0] !== props) {
2008
+ let { className, label: t3, style: t4, ...t5 } = getProps(props, skipToContentProps);
2009
+ label = t3, style = t4, rest = t5, T0 = VisuallyHidden, t0 = Link, t1 = !1, t2 = clsx(skipToContentClassName, "sui-position-absolute sui-top2 sui-left2 sui-display-inline-block sui-z-index sui-py2 sui-px3 sui-radius2 sui-text-body1", className), $[0] = props, $[1] = T0, $[2] = label, $[3] = rest, $[4] = style, $[5] = t0, $[6] = t1, $[7] = t2;
2010
+ } else T0 = $[1], label = $[2], rest = $[3], style = $[4], t0 = $[5], t1 = $[6], t2 = $[7];
2011
+ let t3;
2012
+ $[8] === label ? t3 = $[9] : (t3 = /* @__PURE__ */ jsx(Text, {
2013
+ size: 1,
2014
+ children: label
2015
+ }), $[8] = label, $[9] = t3);
2016
+ let t4;
2017
+ return $[10] !== T0 || $[11] !== rest || $[12] !== style || $[13] !== t0 || $[14] !== t1 || $[15] !== t2 || $[16] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, {
2018
+ as: t0,
2019
+ underlined: t1,
2020
+ className: t2,
2021
+ style,
2022
+ "data-ui": "SkipToContent",
2023
+ visibleOnFocus: !0,
2024
+ ...rest,
2025
+ children: t3
2026
+ }), $[10] = T0, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
1912
2027
  }
1913
2028
  const switchProps = {
1914
- error: {
1915
- type: "boolean"
1916
- },
1917
- label: {
1918
- type: "string"
1919
- },
1920
- ...marginProps
2029
+ error: { type: "boolean" },
2030
+ label: { type: "string" },
2031
+ ...marginProps
1921
2032
  }, switchClassName = suffixClassName("sui-Switch"), switchInputClassName = suffixClassName("sui-SwitchInput"), switchMarkClassName = suffixClassName("sui-SwitchMark");
2033
+ /** @beta */
1922
2034
  function Switch(props) {
1923
- const $ = c(26);
1924
- let T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
1925
- if ($[0] !== props) {
1926
- const {
1927
- className,
1928
- style,
1929
- disabled,
1930
- error,
1931
- label: t82,
1932
- ...rest
1933
- } = getProps(props, switchProps);
1934
- label = t82, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, { as: "input", type: "checkbox", role: "switch", className: switchInputClassName, disabled, ...rest }), T0 = Flex, t0 = "span", t1 = clsx(switchMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
1935
- } else
1936
- T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
1937
- let t8;
1938
- $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, { as: t0, className: t1, alignItems: "center", radius: 6, "aria-hidden": "true" }), $[12] = T0, $[13] = t0, $[14] = t1, $[15] = t8) : t8 = $[15];
1939
- let t9;
1940
- return $[16] !== T1 || $[17] !== label || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T1, { className: t2, style: t3, "data-ui": t4, disabled: t5, error: t6, children: [
1941
- t7,
1942
- t8,
1943
- label
1944
- ] }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
2035
+ let $ = c(26), T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
2036
+ if ($[0] !== props) {
2037
+ let { className, style, disabled, error, label: t8, ...rest } = getProps(props, switchProps);
2038
+ label = t8, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
2039
+ as: "input",
2040
+ type: "checkbox",
2041
+ role: "switch",
2042
+ className: switchInputClassName,
2043
+ disabled,
2044
+ ...rest
2045
+ }), T0 = Flex, t0 = "span", t1 = clsx(switchMarkClassName, error && "sui-error"), $[0] = props, $[1] = T0, $[2] = T1, $[3] = label, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5, $[10] = t6, $[11] = t7;
2046
+ } else T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
2047
+ let t8;
2048
+ $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, {
2049
+ as: t0,
2050
+ className: t1,
2051
+ alignItems: "center",
2052
+ radius: 6,
2053
+ "aria-hidden": "true"
2054
+ }), $[12] = T0, $[13] = t0, $[14] = t1, $[15] = t8) : t8 = $[15];
2055
+ let t9;
2056
+ return $[16] !== T1 || $[17] !== label || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T1, {
2057
+ className: t2,
2058
+ style: t3,
2059
+ "data-ui": t4,
2060
+ disabled: t5,
2061
+ error: t6,
2062
+ children: [
2063
+ t7,
2064
+ t8,
2065
+ label
2066
+ ]
2067
+ }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
1945
2068
  }
1946
2069
  const tooltipProps = {
1947
- anchorName: {
1948
- type: "string"
1949
- },
1950
- content: {
1951
- type: "string"
1952
- },
1953
- portal: {
1954
- type: "boolean"
1955
- },
1956
- ...placementProps
2070
+ anchorName: { type: "string" },
2071
+ content: { type: "string" },
2072
+ portal: { type: "boolean" },
2073
+ ...placementProps
1957
2074
  }, tooltipClassName = suffixClassName("sui-Tooltip");
1958
2075
  function TooltipRoot(t0) {
1959
- const $ = c(7), {
1960
- placement: t1,
1961
- ...props
1962
- } = t0, placement = t1 === void 0 ? "bottom" : t1, {
1963
- children,
1964
- className,
1965
- style,
1966
- id: idProp,
1967
- anchorName,
1968
- content,
1969
- portal,
1970
- triggerProps: forwardedTriggerProps,
1971
- ...rest
1972
- } = getProps({
1973
- placement,
1974
- ...props
1975
- }, tooltipProps), reactId = useId(), id = idProp || reactId, [dismissed, setDismissed] = useState(!1), isClient = useIsClient();
1976
- let t2, t3;
1977
- $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
1978
- setDismissed(!1);
1979
- }, t3 = () => {
1980
- setDismissed(!1);
1981
- }, $[0] = t2, $[1] = t3) : (t2 = $[0], t3 = $[1]);
1982
- const triggerProps = {
1983
- "aria-describedby": id,
1984
- interestfor: id,
1985
- style: {
1986
- anchorName: `--anchor-${anchorName || id}`
1987
- },
1988
- onMouseLeave: t2,
1989
- onBlur: t3,
1990
- onClick: () => {
1991
- setDismissed(!0), document.getElementById(id)?.hidePopover();
1992
- }
1993
- }, trigger = children.type.forwardsTriggerProps ? cloneElement(children, {
1994
- triggerProps
1995
- }) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps));
1996
- let t4;
1997
- $[2] !== dismissed ? (t4 = (e) => {
1998
- e.newState === "open" && dismissed && e.preventDefault();
1999
- }, $[2] = dismissed, $[3] = t4) : t4 = $[3];
2000
- const handleBeforeToggle = t4, t5 = renderPortal(/* @__PURE__ */ jsx("div", { className: clsx(tooltipClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className), style: {
2001
- ...style,
2002
- positionAnchor: `--anchor-${anchorName || id}`
2003
- }, "data-ui": "Tooltip", role: "tooltip", popover: "hint", id, onBeforeToggle: handleBeforeToggle, ...rest, children: content }), isClient, portal);
2004
- let t6;
2005
- return $[4] !== t5 || $[5] !== trigger ? (t6 = /* @__PURE__ */ jsxs(Fragment, { children: [
2006
- trigger,
2007
- t5
2008
- ] }), $[4] = t5, $[5] = trigger, $[6] = t6) : t6 = $[6], t6;
2076
+ let $ = c(7), { placement: t1, ...props } = t0, { children, className, style, id: idProp, anchorName, content, portal, triggerProps: forwardedTriggerProps, ...rest } = getProps({
2077
+ placement: t1 === void 0 ? "bottom" : t1,
2078
+ ...props
2079
+ }, tooltipProps), reactId = useId(), id = idProp || reactId, [dismissed, setDismissed] = useState(!1), isClient = useIsClient(), t2, t3;
2080
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
2081
+ setDismissed(!1);
2082
+ }, t3 = () => {
2083
+ setDismissed(!1);
2084
+ }, $[0] = t2, $[1] = t3) : (t2 = $[0], t3 = $[1]);
2085
+ let triggerProps = {
2086
+ "aria-describedby": id,
2087
+ interestfor: id,
2088
+ style: { anchorName: `--anchor-${anchorName || id}` },
2089
+ onMouseLeave: t2,
2090
+ onBlur: t3,
2091
+ onClick: () => {
2092
+ setDismissed(!0), document.getElementById(id)?.hidePopover();
2093
+ }
2094
+ }, trigger = children.type.forwardsTriggerProps ? cloneElement(children, { triggerProps }) : cloneElement(children, mergeTriggerProps(children.props, forwardedTriggerProps, triggerProps)), t4;
2095
+ $[2] === dismissed ? t4 = $[3] : (t4 = (e) => {
2096
+ e.newState === "open" && dismissed && e.preventDefault();
2097
+ }, $[2] = dismissed, $[3] = t4);
2098
+ let handleBeforeToggle = t4, t5 = renderPortal(/* @__PURE__ */ jsx("div", {
2099
+ className: clsx(tooltipClassName, "sui-px2 sui-py1 sui-radius2 sui-position-fixed sui-shadow2", className),
2100
+ style: {
2101
+ ...style,
2102
+ positionAnchor: `--anchor-${anchorName || id}`
2103
+ },
2104
+ "data-ui": "Tooltip",
2105
+ role: "tooltip",
2106
+ popover: "hint",
2107
+ id,
2108
+ onBeforeToggle: handleBeforeToggle,
2109
+ ...rest,
2110
+ children: content
2111
+ }), isClient, portal), t6;
2112
+ return $[4] !== t5 || $[5] !== trigger ? (t6 = /* @__PURE__ */ jsxs(Fragment, { children: [trigger, t5] }), $[4] = t5, $[5] = trigger, $[6] = t6) : t6 = $[6], t6;
2009
2113
  }
2010
- const Tooltip = Object.assign(TooltipRoot, {
2011
- forwardsTriggerProps: !0
2012
- }), tooltipGroupProps = {
2013
- as: {
2014
- type: "string"
2015
- }
2016
- }, tooltipGroupClassName = suffixClassName("sui-TooltipGroup");
2114
+ /** @beta */
2115
+ const Tooltip = Object.assign(TooltipRoot, { forwardsTriggerProps: !0 }), tooltipGroupProps = { as: { type: "string" } }, tooltipGroupClassName = suffixClassName("sui-TooltipGroup");
2116
+ /** @public */
2017
2117
  function TooltipGroup(props) {
2018
- const $ = c(17), {
2019
- as,
2020
- children,
2021
- className,
2022
- style,
2023
- ...rest
2024
- } = getProps(props, tooltipGroupProps), Component = as || "div", ref = useRef(null), [isActive, setIsActive] = useState(!1);
2025
- let t0;
2026
- $[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t0 = (e) => {
2027
- const tooltip = e.target.closest('[data-ui="Tooltip"]');
2028
- tooltip && e.propertyName === "opacity" && window.getComputedStyle(tooltip).opacity !== "0" && setIsActive(!0);
2029
- }, $[0] = t0) : t0 = $[0];
2030
- const handleTransitionEnd = t0;
2031
- let t1;
2032
- $[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
2033
- setIsActive(!1);
2034
- }, $[1] = t1) : t1 = $[1];
2035
- const handleMouseLeave = t1;
2036
- let t2;
2037
- $[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = (e_0) => {
2038
- ref.current && ref.current.contains(e_0.relatedTarget) || setIsActive(!1);
2039
- }, $[2] = t2) : t2 = $[2];
2040
- const handleBlur = t2, t3 = clsx(tooltipGroupClassName, className);
2041
- let t4;
2042
- $[3] !== isActive ? (t4 = isActive && {
2043
- "--tooltip-delay-group": "0ms"
2044
- }, $[3] = isActive, $[4] = t4) : t4 = $[4];
2045
- let t5;
2046
- $[5] !== style || $[6] !== t4 ? (t5 = {
2047
- ...style,
2048
- ...t4
2049
- }, $[5] = style, $[6] = t4, $[7] = t5) : t5 = $[7];
2050
- let t6;
2051
- return $[8] !== Component || $[9] !== children || $[10] !== handleBlur || $[11] !== handleMouseLeave || $[12] !== handleTransitionEnd || $[13] !== rest || $[14] !== t3 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Component, { className: t3, style: t5, "data-ui": "TooltipGroup", ref, onTransitionEnd: handleTransitionEnd, onMouseLeave: handleMouseLeave, onBlur: handleBlur, ...rest, children }), $[8] = Component, $[9] = children, $[10] = handleBlur, $[11] = handleMouseLeave, $[12] = handleTransitionEnd, $[13] = rest, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
2118
+ let $ = c(17), { as, children, className, style, ...rest } = getProps(props, tooltipGroupProps), Component = as || "div", ref = useRef(null), [isActive, setIsActive] = useState(!1), t0;
2119
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (e) => {
2120
+ let tooltip = e.target.closest("[data-ui=\"Tooltip\"]");
2121
+ tooltip && e.propertyName === "opacity" && window.getComputedStyle(tooltip).opacity !== "0" && setIsActive(!0);
2122
+ }, $[0] = t0) : t0 = $[0];
2123
+ let handleTransitionEnd = t0, t1;
2124
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
2125
+ setIsActive(!1);
2126
+ }, $[1] = t1) : t1 = $[1];
2127
+ let handleMouseLeave = t1, t2;
2128
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = (e_0) => {
2129
+ ref.current && ref.current.contains(e_0.relatedTarget) || setIsActive(!1);
2130
+ }, $[2] = t2) : t2 = $[2];
2131
+ let handleBlur = t2, t3 = clsx(tooltipGroupClassName, className), t4;
2132
+ $[3] === isActive ? t4 = $[4] : (t4 = isActive && { "--tooltip-delay-group": "0ms" }, $[3] = isActive, $[4] = t4);
2133
+ let t5;
2134
+ $[5] !== style || $[6] !== t4 ? (t5 = {
2135
+ ...style,
2136
+ ...t4
2137
+ }, $[5] = style, $[6] = t4, $[7] = t5) : t5 = $[7];
2138
+ let t6;
2139
+ return $[8] !== Component || $[9] !== children || $[10] !== handleBlur || $[11] !== handleMouseLeave || $[12] !== handleTransitionEnd || $[13] !== rest || $[14] !== t3 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Component, {
2140
+ className: t3,
2141
+ style: t5,
2142
+ "data-ui": "TooltipGroup",
2143
+ ref,
2144
+ onTransitionEnd: handleTransitionEnd,
2145
+ onMouseLeave: handleMouseLeave,
2146
+ onBlur: handleBlur,
2147
+ ...rest,
2148
+ children
2149
+ }), $[8] = Component, $[9] = children, $[10] = handleBlur, $[11] = handleMouseLeave, $[12] = handleTransitionEnd, $[13] = rest, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
2052
2150
  }
2053
2151
  const badgeProps = {
2054
- as: {
2055
- type: "string"
2056
- },
2057
- iconStart: {
2058
- type: "string"
2059
- },
2060
- text: {
2061
- type: "string"
2062
- },
2063
- ...toneProps
2152
+ as: { type: "string" },
2153
+ iconStart: { type: "string" },
2154
+ text: { type: "string" },
2155
+ ...toneProps
2064
2156
  }, badgeClassName = suffixClassName("sui-Badge");
2157
+ /** @public */
2065
2158
  function Badge(t0) {
2066
- const $ = c(20);
2067
- let T0, children, t1, t2, t3, t4, t5, text;
2068
- if ($[0] !== t0) {
2069
- const {
2070
- tone: t62,
2071
- ...props
2072
- } = t0, tone = t62 === void 0 ? "neutral" : t62, {
2073
- as,
2074
- children: t72,
2075
- className,
2076
- style,
2077
- iconStart: IconStart,
2078
- text: t8,
2079
- ...rest
2080
- } = getProps({
2081
- tone,
2082
- ...props
2083
- }, badgeProps);
2084
- children = t72, text = t8;
2085
- const Component = as || "span", badgeClasses = clsx(badgeClassName, `${IconStart ? "sui-p1" : "sui-px2 sui-py1"} sui-radius-full sui-display-inline-flex sui-align-items-center sui-gap1`);
2086
- T0 = Component, t1 = clsx(badgeClasses, className), t2 = style, t3 = "Badge", t4 = rest, t5 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, { icon: IconStart, marginX: -1, marginY: -2, size: 0 })), $[0] = t0, $[1] = T0, $[2] = children, $[3] = t1, $[4] = t2, $[5] = t3, $[6] = t4, $[7] = t5, $[8] = text;
2087
- } else
2088
- T0 = $[1], children = $[2], t1 = $[3], t2 = $[4], t3 = $[5], t4 = $[6], t5 = $[7], text = $[8];
2089
- let t6;
2090
- $[9] !== text ? (t6 = text && /* @__PURE__ */ jsx(Text, { size: 1, trim: !0, children: text }), $[9] = text, $[10] = t6) : t6 = $[10];
2091
- let t7;
2092
- return $[11] !== T0 || $[12] !== children || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, { className: t1, style: t2, "data-ui": t3, ...t4, children: [
2093
- t5,
2094
- t6,
2095
- children
2096
- ] }), $[11] = T0, $[12] = children, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
2159
+ let $ = c(20), T0, children, t1, t2, t3, t4, t5, text;
2160
+ if ($[0] !== t0) {
2161
+ let { tone: t6, ...props } = t0, { as, children: t7, className, style, iconStart: IconStart, text: t8, ...rest } = getProps({
2162
+ tone: t6 === void 0 ? "neutral" : t6,
2163
+ ...props
2164
+ }, badgeProps);
2165
+ children = t7, text = t8;
2166
+ let Component = as || "span", badgeClasses = clsx(badgeClassName, `${IconStart ? "sui-p1" : "sui-px2 sui-py1"} sui-radius-full sui-display-inline-flex sui-align-items-center sui-gap1`);
2167
+ T0 = Component, t1 = clsx(badgeClasses, className), t2 = style, t3 = "Badge", t4 = rest, t5 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, {
2168
+ icon: IconStart,
2169
+ marginX: -1,
2170
+ marginY: -2,
2171
+ size: 0
2172
+ })), $[0] = t0, $[1] = T0, $[2] = children, $[3] = t1, $[4] = t2, $[5] = t3, $[6] = t4, $[7] = t5, $[8] = text;
2173
+ } else T0 = $[1], children = $[2], t1 = $[3], t2 = $[4], t3 = $[5], t4 = $[6], t5 = $[7], text = $[8];
2174
+ let t6;
2175
+ $[9] === text ? t6 = $[10] : (t6 = text && /* @__PURE__ */ jsx(Text, {
2176
+ size: 1,
2177
+ trim: !0,
2178
+ children: text
2179
+ }), $[9] = text, $[10] = t6);
2180
+ let t7;
2181
+ return $[11] !== T0 || $[12] !== children || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, {
2182
+ className: t1,
2183
+ style: t2,
2184
+ "data-ui": t3,
2185
+ ...t4,
2186
+ children: [
2187
+ t5,
2188
+ t6,
2189
+ children
2190
+ ]
2191
+ }), $[11] = T0, $[12] = children, $[13] = t1, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
2097
2192
  }
2098
- export {
2099
- Badge,
2100
- Box,
2101
- Button,
2102
- Card,
2103
- Checkbox,
2104
- Code,
2105
- Container,
2106
- Dialog,
2107
- Divider,
2108
- Eyebrow,
2109
- Flex,
2110
- Grid,
2111
- HStack,
2112
- Heading,
2113
- Icon,
2114
- IconButton,
2115
- Indicator,
2116
- IndicatorStack,
2117
- Inline,
2118
- Label,
2119
- Link,
2120
- List,
2121
- Popover,
2122
- PressArea,
2123
- Radio,
2124
- SkipToContent,
2125
- Spinner,
2126
- Switch,
2127
- Text,
2128
- Tooltip,
2129
- TooltipGroup,
2130
- VStack,
2131
- VisuallyHidden,
2132
- useIsClient
2133
- };
2134
- //# sourceMappingURL=index.js.map
2193
+ export { Badge, Box, Button, Card, Checkbox, Code, Container, Dialog, Divider, Eyebrow, Flex, Grid, HStack, Heading, Icon, IconButton, Indicator, IndicatorStack, Inline, Label, Link, List, Popover, PressArea, Radio, Select, SkipToContent, Spinner, Switch, Text, Tooltip, TooltipGroup, VStack, VisuallyHidden, useIsClient };
2194
+
2195
+ //# sourceMappingURL=index.js.map