@sanity/ui 5.0.0-alpha.14 → 5.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +97 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +342 -83
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
- package/src/components/avatar/Avatar.tsx +50 -0
- package/src/components/avatar/avatar.css +51 -0
- package/src/components/avatar/avatar.props.ts +57 -0
- package/src/components/avatar-counter/AvatarCounter.tsx +38 -0
- package/src/components/avatar-counter/avatar-counter.css +8 -0
- package/src/components/avatar-counter/avatarCounter.props.ts +44 -0
- package/src/components/avatar-stack/AvatarStack.tsx +60 -0
- package/src/components/avatar-stack/avatar-stack.css +16 -0
- package/src/components/avatar-stack/avatarStack.props.ts +20 -0
- package/src/components/button/button.css +2 -2
- package/src/components/checkbox/Checkbox.tsx +3 -3
- package/src/components/checkbox/checkbox.props.ts +2 -2
- package/src/components/grid/grid.props.ts +8 -1
- package/src/components/hotkeys/Hotkeys.tsx +29 -0
- package/src/components/hotkeys/hotkeys.css +3 -0
- package/src/components/hotkeys/hotkeys.props.ts +15 -0
- package/src/components/icon/Icon.tsx +1 -0
- package/src/components/index.css +6 -0
- package/src/components/kbd/KBD.tsx +33 -0
- package/src/components/kbd/kbd.css +6 -0
- package/src/components/kbd/kbd.props.ts +20 -0
- package/src/components/radio/Radio.tsx +3 -3
- package/src/components/radio/radio.props.ts +2 -2
- package/src/components/select/select.props.ts +1 -0
- package/src/components/switch/Switch.tsx +3 -3
- package/src/components/switch/switch.props.ts +2 -2
- package/src/components/text-area/TextArea.tsx +32 -0
- package/src/components/text-area/text-area.css +56 -0
- package/src/components/text-area/textArea.props.ts +35 -0
- package/src/components/text-input/TextInput.tsx +1 -1
- package/src/components/text-input/text-input.css +9 -3
- package/src/components/text-input/textInput.props.ts +1 -0
- package/src/css/classes/dynamic/height.css +2 -0
- package/src/css/classes/local/field-sizing.css +3 -0
- package/src/css/classes/local/index.css +1 -0
- package/src/index.ts +7 -1
- package/src/types/Avatar.ts +14 -0
- package/src/types/Eyebrow.ts +1 -1
- package/src/version.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -81,9 +81,19 @@ function getCompositeValue(propValue, propDef, key) {
|
|
|
81
81
|
return compositeValue;
|
|
82
82
|
}
|
|
83
83
|
function suffixClassName(className) {
|
|
84
|
-
return `${className}-
|
|
84
|
+
return `${className}-d73bbc`;
|
|
85
85
|
}
|
|
86
|
-
const
|
|
86
|
+
const FONT_WEIGHT = [
|
|
87
|
+
"regular",
|
|
88
|
+
"medium",
|
|
89
|
+
"semibold",
|
|
90
|
+
"bold"
|
|
91
|
+
], TEXT_ALIGN = [
|
|
92
|
+
"left",
|
|
93
|
+
"center",
|
|
94
|
+
"right",
|
|
95
|
+
"justify"
|
|
96
|
+
], SPACE = [
|
|
87
97
|
0,
|
|
88
98
|
1,
|
|
89
99
|
2,
|
|
@@ -156,12 +166,7 @@ const SPACE = [
|
|
|
156
166
|
align: {
|
|
157
167
|
type: "union",
|
|
158
168
|
className: "text",
|
|
159
|
-
values:
|
|
160
|
-
"left",
|
|
161
|
-
"center",
|
|
162
|
-
"right",
|
|
163
|
-
"justify"
|
|
164
|
-
]
|
|
169
|
+
values: TEXT_ALIGN
|
|
165
170
|
},
|
|
166
171
|
muted: {
|
|
167
172
|
type: "boolean",
|
|
@@ -187,61 +192,22 @@ const SPACE = [
|
|
|
187
192
|
weight: {
|
|
188
193
|
type: "union",
|
|
189
194
|
className: "weight",
|
|
190
|
-
values:
|
|
191
|
-
"regular",
|
|
192
|
-
"medium",
|
|
193
|
-
"semibold",
|
|
194
|
-
"bold"
|
|
195
|
-
]
|
|
195
|
+
values: FONT_WEIGHT
|
|
196
196
|
},
|
|
197
197
|
...marginProps,
|
|
198
198
|
...toneProps
|
|
199
|
-
},
|
|
199
|
+
}, TEXT_SIZE = [
|
|
200
200
|
0,
|
|
201
201
|
1,
|
|
202
202
|
2,
|
|
203
203
|
3,
|
|
204
204
|
4
|
|
205
|
-
],
|
|
206
|
-
icon: { type: "string" },
|
|
207
|
-
size: {
|
|
208
|
-
type: "union",
|
|
209
|
-
className: "icon-body",
|
|
210
|
-
values: ICON_SIZE
|
|
211
|
-
},
|
|
212
|
-
muted: typographyProps.muted,
|
|
213
|
-
...toneProps,
|
|
214
|
-
...marginProps
|
|
215
|
-
}, iconClassName = suffixClassName("sui-Icon");
|
|
216
|
-
/** @public */
|
|
217
|
-
function Icon({ icon, size = 2, ...props }) {
|
|
218
|
-
let { className, style, ...rest } = getProps({
|
|
219
|
-
size,
|
|
220
|
-
...props
|
|
221
|
-
}, iconProps), iconElement = isValidElement(icon) ? icon : null, ariaLabel = props["aria-label"] || (iconElement ? iconElement.props["aria-label"] : void 0), svgProps = {
|
|
222
|
-
className: clsx(iconClassName, className, iconElement ? iconElement.props.className : void 0),
|
|
223
|
-
style: iconElement ? {
|
|
224
|
-
...iconElement.props.style,
|
|
225
|
-
...style
|
|
226
|
-
} : style,
|
|
227
|
-
"data-ui": "Icon",
|
|
228
|
-
"aria-hidden": !ariaLabel || void 0,
|
|
229
|
-
...rest
|
|
230
|
-
};
|
|
231
|
-
return iconElement ? cloneElement(iconElement, svgProps) : createElement(icon, svgProps);
|
|
232
|
-
}
|
|
233
|
-
const textProps = {
|
|
205
|
+
], textProps = {
|
|
234
206
|
as: { type: "string" },
|
|
235
207
|
size: {
|
|
236
208
|
type: "union",
|
|
237
209
|
className: "text-body",
|
|
238
|
-
values:
|
|
239
|
-
0,
|
|
240
|
-
1,
|
|
241
|
-
2,
|
|
242
|
-
3,
|
|
243
|
-
4
|
|
244
|
-
]
|
|
210
|
+
values: TEXT_SIZE
|
|
245
211
|
},
|
|
246
212
|
...typographyProps
|
|
247
213
|
}, textClassName = suffixClassName("sui-Text");
|
|
@@ -285,6 +251,220 @@ function Text(t0) {
|
|
|
285
251
|
children
|
|
286
252
|
}), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
|
|
287
253
|
}
|
|
254
|
+
const heightProps = {
|
|
255
|
+
height: {
|
|
256
|
+
type: "string",
|
|
257
|
+
className: "height",
|
|
258
|
+
variable: "--height"
|
|
259
|
+
},
|
|
260
|
+
minHeight: {
|
|
261
|
+
type: "string",
|
|
262
|
+
className: "min-height",
|
|
263
|
+
variable: "--min-height"
|
|
264
|
+
},
|
|
265
|
+
maxHeight: {
|
|
266
|
+
type: "string",
|
|
267
|
+
className: "max-height",
|
|
268
|
+
variable: "--max-height"
|
|
269
|
+
}
|
|
270
|
+
}, AVATAR_SIZE = [
|
|
271
|
+
0,
|
|
272
|
+
1,
|
|
273
|
+
2
|
|
274
|
+
], avatarProps = {
|
|
275
|
+
color: {
|
|
276
|
+
type: "union",
|
|
277
|
+
className: "avatar",
|
|
278
|
+
values: [
|
|
279
|
+
"gray",
|
|
280
|
+
"purple",
|
|
281
|
+
"magenta",
|
|
282
|
+
"red",
|
|
283
|
+
"orange",
|
|
284
|
+
"yellow",
|
|
285
|
+
"green",
|
|
286
|
+
"cyan"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
name: { type: "string" },
|
|
290
|
+
size: {
|
|
291
|
+
type: "composite",
|
|
292
|
+
values: AVATAR_SIZE,
|
|
293
|
+
composition: {
|
|
294
|
+
size: {
|
|
295
|
+
propDef: {
|
|
296
|
+
type: "union",
|
|
297
|
+
className: "text-body",
|
|
298
|
+
values: TEXT_SIZE
|
|
299
|
+
},
|
|
300
|
+
mapping: {
|
|
301
|
+
0: 0,
|
|
302
|
+
1: 1,
|
|
303
|
+
2: 2
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
height: {
|
|
307
|
+
propDef: heightProps.height,
|
|
308
|
+
mapping: {
|
|
309
|
+
0: "19px",
|
|
310
|
+
1: "25px",
|
|
311
|
+
2: "33px"
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
src: { type: "string" }
|
|
317
|
+
}, avatarClassName = suffixClassName("sui-Avatar");
|
|
318
|
+
/** @public */
|
|
319
|
+
function Avatar(t0) {
|
|
320
|
+
let $ = c(5), { color: t1, size: t2, ...props } = t0, { className, style, "aria-label": ariaLabel, name, src, ...rest } = getProps({
|
|
321
|
+
color: t1 === void 0 ? "gray" : t1,
|
|
322
|
+
size: t2 === void 0 ? 1 : t2,
|
|
323
|
+
...props
|
|
324
|
+
}, avatarProps), [error, setError] = useState(!1), t3 = clsx(avatarClassName, "sui-display-inline-flex sui-align-items-center sui-justify-content-center sui-radius-full sui-position-relative", className), t5 = src && !error ? /* @__PURE__ */ jsx("img", {
|
|
325
|
+
className: "sui-radius-full sui-width-full sui-height-full",
|
|
326
|
+
src,
|
|
327
|
+
alt: ariaLabel || name,
|
|
328
|
+
onError: () => setError(!0)
|
|
329
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
330
|
+
role: "img",
|
|
331
|
+
weight: "semibold",
|
|
332
|
+
"aria-label": ariaLabel || name,
|
|
333
|
+
children: name.slice(0, 1)
|
|
334
|
+
}), t6;
|
|
335
|
+
return $[0] !== rest || $[1] !== style || $[2] !== t3 || $[3] !== t5 ? (t6 = /* @__PURE__ */ jsx("figure", {
|
|
336
|
+
className: t3,
|
|
337
|
+
style,
|
|
338
|
+
"data-ui": "Avatar",
|
|
339
|
+
...rest,
|
|
340
|
+
children: t5
|
|
341
|
+
}), $[0] = rest, $[1] = style, $[2] = t3, $[3] = t5, $[4] = t6) : t6 = $[4], t6;
|
|
342
|
+
}
|
|
343
|
+
const avatarCounterProps = {
|
|
344
|
+
count: { type: "number" },
|
|
345
|
+
size: {
|
|
346
|
+
type: "composite",
|
|
347
|
+
values: AVATAR_SIZE,
|
|
348
|
+
composition: {
|
|
349
|
+
size: {
|
|
350
|
+
propDef: {
|
|
351
|
+
type: "union",
|
|
352
|
+
className: "text-body",
|
|
353
|
+
values: TEXT_SIZE
|
|
354
|
+
},
|
|
355
|
+
mapping: {
|
|
356
|
+
0: 0,
|
|
357
|
+
1: 1,
|
|
358
|
+
2: 2
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
height: {
|
|
362
|
+
propDef: heightProps.height,
|
|
363
|
+
mapping: {
|
|
364
|
+
0: "19px",
|
|
365
|
+
1: "25px",
|
|
366
|
+
2: "33px"
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}, avatarCounterClassName = suffixClassName("sui-AvatarCounter");
|
|
372
|
+
/** @public */
|
|
373
|
+
function AvatarCounter(t0) {
|
|
374
|
+
let $ = c(14), ariaLabel, count, rest, style, t1;
|
|
375
|
+
if ($[0] !== t0) {
|
|
376
|
+
let { size: t2, ...props } = t0, { className, style: t3, "aria-label": t4, count: t5, ...t6 } = getProps({
|
|
377
|
+
size: t2 === void 0 ? 1 : t2,
|
|
378
|
+
...props
|
|
379
|
+
}, avatarCounterProps);
|
|
380
|
+
style = t3, ariaLabel = t4, count = t5, rest = t6, t1 = clsx(avatarCounterClassName, "sui-display-inline-flex sui-align-items-center sui-justify-content-center sui-radius-full sui-border", className), $[0] = t0, $[1] = ariaLabel, $[2] = count, $[3] = rest, $[4] = style, $[5] = t1;
|
|
381
|
+
} else ariaLabel = $[1], count = $[2], rest = $[3], style = $[4], t1 = $[5];
|
|
382
|
+
let t2 = ariaLabel || `+ ${count} more`, t3;
|
|
383
|
+
$[6] !== count || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsx(Text, {
|
|
384
|
+
role: "img",
|
|
385
|
+
weight: "semibold",
|
|
386
|
+
"aria-label": t2,
|
|
387
|
+
children: count
|
|
388
|
+
}), $[6] = count, $[7] = t2, $[8] = t3) : t3 = $[8];
|
|
389
|
+
let t4;
|
|
390
|
+
return $[9] !== rest || $[10] !== style || $[11] !== t1 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx("figure", {
|
|
391
|
+
className: t1,
|
|
392
|
+
style,
|
|
393
|
+
"data-ui": "AvatarCounter",
|
|
394
|
+
...rest,
|
|
395
|
+
children: t3
|
|
396
|
+
}), $[9] = rest, $[10] = style, $[11] = t1, $[12] = t3, $[13] = t4) : t4 = $[13], t4;
|
|
397
|
+
}
|
|
398
|
+
const avatarStackProps = {
|
|
399
|
+
maxLength: { type: "number" },
|
|
400
|
+
size: {
|
|
401
|
+
type: "union",
|
|
402
|
+
values: AVATAR_SIZE
|
|
403
|
+
}
|
|
404
|
+
}, avatarStackClassName = suffixClassName("sui-AvatarStack");
|
|
405
|
+
/** @public */
|
|
406
|
+
function AvatarStack(t0) {
|
|
407
|
+
let $ = c(14), t1, t2, t3, t4, t5, t6;
|
|
408
|
+
if ($[0] !== t0) {
|
|
409
|
+
let { size: t7, ...props } = t0, { children, className, style, maxLength: maxLengthProp, size: sizeProp, ...rest } = getProps({
|
|
410
|
+
size: t7 === void 0 ? 1 : t7,
|
|
411
|
+
...props
|
|
412
|
+
}, avatarStackProps), childArray = Children.toArray(children).filter(isValidElement), length = childArray.length, maxLength = maxLengthProp ?? length, visibleAvatars = length > maxLength ? childArray.slice(length - maxLength, length) : childArray;
|
|
413
|
+
t1 = clsx(avatarStackClassName, "sui-display-flex", className), t2 = style, t3 = "AvatarStack", t4 = rest, t5 = (!length || length > maxLength) && /* @__PURE__ */ jsx("li", {
|
|
414
|
+
className: "sui-display-flex",
|
|
415
|
+
children: /* @__PURE__ */ jsx(AvatarCounter, {
|
|
416
|
+
count: length ? length - maxLength : 0,
|
|
417
|
+
size: sizeProp,
|
|
418
|
+
"aria-label": length ? `+ ${length - maxLength} more user${length - maxLength > 1 ? "s" : ""}` : "No users"
|
|
419
|
+
})
|
|
420
|
+
}), t6 = visibleAvatars.map((child) => /* @__PURE__ */ jsx("li", {
|
|
421
|
+
className: "sui-display-flex",
|
|
422
|
+
children: cloneElement(child, { size: sizeProp })
|
|
423
|
+
}, child.key)), $[0] = t0, $[1] = t1, $[2] = t2, $[3] = t3, $[4] = t4, $[5] = t5, $[6] = t6;
|
|
424
|
+
} else t1 = $[1], t2 = $[2], t3 = $[3], t4 = $[4], t5 = $[5], t6 = $[6];
|
|
425
|
+
let t7;
|
|
426
|
+
return $[7] !== t1 || $[8] !== t2 || $[9] !== t3 || $[10] !== t4 || $[11] !== t5 || $[12] !== t6 ? (t7 = /* @__PURE__ */ jsxs("ul", {
|
|
427
|
+
className: t1,
|
|
428
|
+
style: t2,
|
|
429
|
+
"data-ui": t3,
|
|
430
|
+
...t4,
|
|
431
|
+
children: [t5, t6]
|
|
432
|
+
}), $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6, $[13] = t7) : t7 = $[13], t7;
|
|
433
|
+
}
|
|
434
|
+
const ICON_SIZE = [
|
|
435
|
+
0,
|
|
436
|
+
1,
|
|
437
|
+
2,
|
|
438
|
+
3,
|
|
439
|
+
4
|
|
440
|
+
], iconProps = {
|
|
441
|
+
icon: { type: "string" },
|
|
442
|
+
size: {
|
|
443
|
+
type: "union",
|
|
444
|
+
className: "icon-body",
|
|
445
|
+
values: ICON_SIZE
|
|
446
|
+
},
|
|
447
|
+
muted: typographyProps.muted,
|
|
448
|
+
...toneProps,
|
|
449
|
+
...marginProps
|
|
450
|
+
}, iconClassName = suffixClassName("sui-Icon");
|
|
451
|
+
/** @public */
|
|
452
|
+
function Icon({ icon, size = 2, ...props }) {
|
|
453
|
+
let { className, style, ...rest } = getProps({
|
|
454
|
+
size,
|
|
455
|
+
...props
|
|
456
|
+
}, iconProps), iconElement = isValidElement(icon) ? icon : null, ariaLabel = props["aria-label"] || (iconElement ? iconElement.props["aria-label"] : void 0), svgProps = {
|
|
457
|
+
className: clsx(iconClassName, "sui-display-block", className, iconElement ? iconElement.props.className : void 0),
|
|
458
|
+
style: iconElement ? {
|
|
459
|
+
...iconElement.props.style,
|
|
460
|
+
...style
|
|
461
|
+
} : style,
|
|
462
|
+
"data-ui": "Icon",
|
|
463
|
+
"aria-hidden": !ariaLabel || void 0,
|
|
464
|
+
...rest
|
|
465
|
+
};
|
|
466
|
+
return iconElement ? cloneElement(iconElement, svgProps) : createElement(icon, svgProps);
|
|
467
|
+
}
|
|
288
468
|
const badgeProps = {
|
|
289
469
|
as: { type: "string" },
|
|
290
470
|
iconStart: { type: "string" },
|
|
@@ -414,22 +594,6 @@ const borderProps = {
|
|
|
414
594
|
className: "grid-row-end",
|
|
415
595
|
variable: "--grid-row-end"
|
|
416
596
|
}
|
|
417
|
-
}, heightProps = {
|
|
418
|
-
height: {
|
|
419
|
-
type: "string",
|
|
420
|
-
className: "height",
|
|
421
|
-
variable: "--height"
|
|
422
|
-
},
|
|
423
|
-
minHeight: {
|
|
424
|
-
type: "string",
|
|
425
|
-
className: "min-height",
|
|
426
|
-
variable: "--min-height"
|
|
427
|
-
},
|
|
428
|
-
maxHeight: {
|
|
429
|
-
type: "string",
|
|
430
|
-
className: "max-height",
|
|
431
|
-
variable: "--max-height"
|
|
432
|
-
}
|
|
433
597
|
}, OVERFLOW = [
|
|
434
598
|
"visible",
|
|
435
599
|
"hidden",
|
|
@@ -941,18 +1105,18 @@ function VisuallyHidden(props) {
|
|
|
941
1105
|
}), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
|
|
942
1106
|
}
|
|
943
1107
|
const checkboxProps = {
|
|
944
|
-
|
|
1108
|
+
hasError: { type: "boolean" },
|
|
945
1109
|
indeterminate: { type: "boolean" },
|
|
946
1110
|
label: { type: "string" },
|
|
947
1111
|
...marginProps
|
|
948
1112
|
}, checkboxClassName = suffixClassName("sui-Checkbox"), checkboxInputClassName = suffixClassName("sui-CheckboxInput"), checkboxMarkClassName = suffixClassName("sui-CheckboxMark");
|
|
949
1113
|
/** @beta */
|
|
950
1114
|
function Checkbox(props) {
|
|
951
|
-
let $ = c(6), inputRef = useRef(null), { className, style, disabled,
|
|
1115
|
+
let $ = c(6), inputRef = useRef(null), { className, style, disabled, hasError, indeterminate, label, ...rest } = getProps(props, checkboxProps);
|
|
952
1116
|
useEffect(() => {
|
|
953
1117
|
inputRef.current && (inputRef.current.indeterminate = indeterminate);
|
|
954
1118
|
}, [indeterminate, inputRef]);
|
|
955
|
-
let t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t2 = clsx(checkboxMarkClassName,
|
|
1119
|
+
let t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t2 = clsx(checkboxMarkClassName, hasError && "sui-error"), t3;
|
|
956
1120
|
$[0] === indeterminate ? t3 = $[1] : (t3 = jsx(indeterminate ? RemoveIcon : CheckmarkIcon, {}), $[0] = indeterminate, $[1] = t3);
|
|
957
1121
|
let t4;
|
|
958
1122
|
return $[2] !== T0 || $[3] !== t2 || $[4] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, {
|
|
@@ -968,7 +1132,7 @@ function Checkbox(props) {
|
|
|
968
1132
|
style,
|
|
969
1133
|
"data-ui": "Checkbox",
|
|
970
1134
|
disabled,
|
|
971
|
-
error,
|
|
1135
|
+
error: hasError,
|
|
972
1136
|
children: [
|
|
973
1137
|
/* @__PURE__ */ jsx(VisuallyHidden, {
|
|
974
1138
|
as: "input",
|
|
@@ -1319,7 +1483,8 @@ const eyebrowProps = {
|
|
|
1319
1483
|
1,
|
|
1320
1484
|
2,
|
|
1321
1485
|
3,
|
|
1322
|
-
4
|
|
1486
|
+
4,
|
|
1487
|
+
5
|
|
1323
1488
|
]
|
|
1324
1489
|
},
|
|
1325
1490
|
...typographyProps
|
|
@@ -1372,6 +1537,8 @@ const gridProps = {
|
|
|
1372
1537
|
className: "display",
|
|
1373
1538
|
values: DISPLAY_GRID
|
|
1374
1539
|
},
|
|
1540
|
+
alignItems: flexParentProps.alignItems,
|
|
1541
|
+
justifyContent: flexParentProps.justifyContent,
|
|
1375
1542
|
gridAutoFlow: {
|
|
1376
1543
|
type: "union",
|
|
1377
1544
|
className: "grid-auto-flow",
|
|
@@ -1442,6 +1609,64 @@ function HStack(t0) {
|
|
|
1442
1609
|
...t2
|
|
1443
1610
|
}), $[5] = t1, $[6] = t2, $[7] = t3) : t3 = $[7], t3;
|
|
1444
1611
|
}
|
|
1612
|
+
const kbdProps = { text: { type: "string" } }, kbdClassName = suffixClassName("sui-KBD");
|
|
1613
|
+
/** @alpha */
|
|
1614
|
+
function KBD(props) {
|
|
1615
|
+
let $ = c(14), T0, rest, style, t0, t1, text;
|
|
1616
|
+
if ($[0] !== props) {
|
|
1617
|
+
let { className, style: t2, text: t3, ...t4 } = getProps(props, kbdProps);
|
|
1618
|
+
style = t2, text = t3, rest = t4;
|
|
1619
|
+
let kbdClasses = clsx(kbdClassName, "sui-p1 sui-radius2 sui-display-inline-block");
|
|
1620
|
+
T0 = Text, t0 = "kbd", t1 = clsx(kbdClasses, className), $[0] = props, $[1] = T0, $[2] = rest, $[3] = style, $[4] = t0, $[5] = t1, $[6] = text;
|
|
1621
|
+
} else T0 = $[1], rest = $[2], style = $[3], t0 = $[4], t1 = $[5], text = $[6];
|
|
1622
|
+
let t2;
|
|
1623
|
+
return $[7] !== T0 || $[8] !== rest || $[9] !== style || $[10] !== t0 || $[11] !== t1 || $[12] !== text ? (t2 = /* @__PURE__ */ jsx(T0, {
|
|
1624
|
+
as: t0,
|
|
1625
|
+
className: t1,
|
|
1626
|
+
style,
|
|
1627
|
+
"data-ui": "KBD",
|
|
1628
|
+
size: 0,
|
|
1629
|
+
weight: "semibold",
|
|
1630
|
+
muted: !0,
|
|
1631
|
+
trim: !0,
|
|
1632
|
+
...rest,
|
|
1633
|
+
children: text
|
|
1634
|
+
}), $[7] = T0, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1, $[12] = text, $[13] = t2) : t2 = $[13], t2;
|
|
1635
|
+
}
|
|
1636
|
+
const hotkeysProps = { keys: { type: "string" } }, hotkeysClassName = suffixClassName("sui-Hotkeys");
|
|
1637
|
+
/** @alpha */
|
|
1638
|
+
function Hotkeys(t0) {
|
|
1639
|
+
let $ = c(13), keys, rest, style, t1, t2;
|
|
1640
|
+
if ($[0] !== t0) {
|
|
1641
|
+
t2 = Symbol.for("react.early_return_sentinel");
|
|
1642
|
+
bb0: {
|
|
1643
|
+
let { keys: t3, ...props } = t0;
|
|
1644
|
+
keys = t3;
|
|
1645
|
+
let { className, style: t4, ...t5 } = getProps(props, hotkeysProps);
|
|
1646
|
+
if (style = t4, rest = t5, !keys || keys.length === 0) {
|
|
1647
|
+
t2 = null;
|
|
1648
|
+
break bb0;
|
|
1649
|
+
}
|
|
1650
|
+
let hotkeysClasses = clsx(hotkeysClassName, "sui-display-inline-flex");
|
|
1651
|
+
t1 = clsx(hotkeysClasses, className);
|
|
1652
|
+
}
|
|
1653
|
+
$[0] = t0, $[1] = keys, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2;
|
|
1654
|
+
} else keys = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5];
|
|
1655
|
+
if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
|
|
1656
|
+
let t3;
|
|
1657
|
+
$[6] === keys ? t3 = $[7] : (t3 = keys.map(_temp$1), $[6] = keys, $[7] = t3);
|
|
1658
|
+
let t4;
|
|
1659
|
+
return $[8] !== rest || $[9] !== style || $[10] !== t1 || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsx("kbd", {
|
|
1660
|
+
className: t1,
|
|
1661
|
+
style,
|
|
1662
|
+
"data-ui": "Hotkeys",
|
|
1663
|
+
...rest,
|
|
1664
|
+
children: t3
|
|
1665
|
+
}), $[8] = rest, $[9] = style, $[10] = t1, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
|
|
1666
|
+
}
|
|
1667
|
+
function _temp$1(key) {
|
|
1668
|
+
return /* @__PURE__ */ jsx(KBD, { text: key }, key);
|
|
1669
|
+
}
|
|
1445
1670
|
const indicatorProps = {
|
|
1446
1671
|
as: { type: "string" },
|
|
1447
1672
|
label: { type: "string" },
|
|
@@ -1934,7 +2159,7 @@ function PopoverRoot(t0) {
|
|
|
1934
2159
|
}
|
|
1935
2160
|
/** @beta */
|
|
1936
2161
|
const Popover = Object.assign(PopoverRoot, { forwardsTriggerProps: !0 }), radioProps = {
|
|
1937
|
-
|
|
2162
|
+
hasError: { type: "boolean" },
|
|
1938
2163
|
label: { type: "string" },
|
|
1939
2164
|
...marginProps
|
|
1940
2165
|
}, radioClassName = suffixClassName("sui-Radio"), radioInputClassName = suffixClassName("sui-RadioInput"), radioMarkClassName = suffixClassName("sui-RadioMark");
|
|
@@ -1942,14 +2167,14 @@ const Popover = Object.assign(PopoverRoot, { forwardsTriggerProps: !0 }), radioP
|
|
|
1942
2167
|
function Radio(props) {
|
|
1943
2168
|
let $ = c(26), T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
|
|
1944
2169
|
if ($[0] !== props) {
|
|
1945
|
-
let { className, style, label: t8, disabled,
|
|
1946
|
-
label = t8, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 =
|
|
2170
|
+
let { className, style, label: t8, disabled, hasError, ...rest } = getProps(props, radioProps);
|
|
2171
|
+
label = t8, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 = hasError, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
1947
2172
|
as: "input",
|
|
1948
2173
|
type: "radio",
|
|
1949
2174
|
className: radioInputClassName,
|
|
1950
2175
|
disabled,
|
|
1951
2176
|
...rest
|
|
1952
|
-
}), T0 = Box, t0 = "span", t1 = clsx(radioMarkClassName,
|
|
2177
|
+
}), T0 = Box, t0 = "span", t1 = clsx(radioMarkClassName, hasError && "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;
|
|
1953
2178
|
} else T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
|
|
1954
2179
|
let t8;
|
|
1955
2180
|
$[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, {
|
|
@@ -2059,7 +2284,7 @@ function SkipToContent(props) {
|
|
|
2059
2284
|
}), $[10] = T0, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
|
|
2060
2285
|
}
|
|
2061
2286
|
const switchProps = {
|
|
2062
|
-
|
|
2287
|
+
hasError: { type: "boolean" },
|
|
2063
2288
|
label: { type: "string" },
|
|
2064
2289
|
...marginProps
|
|
2065
2290
|
}, switchClassName = suffixClassName("sui-Switch"), switchInputClassName = suffixClassName("sui-SwitchInput"), switchMarkClassName = suffixClassName("sui-SwitchMark");
|
|
@@ -2067,15 +2292,15 @@ const switchProps = {
|
|
|
2067
2292
|
function Switch(props) {
|
|
2068
2293
|
let $ = c(26), T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
|
|
2069
2294
|
if ($[0] !== props) {
|
|
2070
|
-
let { className, style, disabled,
|
|
2071
|
-
label = t8, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 =
|
|
2295
|
+
let { className, style, disabled, hasError, label: t8, ...rest } = getProps(props, switchProps);
|
|
2296
|
+
label = t8, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = hasError, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
|
|
2072
2297
|
as: "input",
|
|
2073
2298
|
type: "checkbox",
|
|
2074
2299
|
role: "switch",
|
|
2075
2300
|
className: switchInputClassName,
|
|
2076
2301
|
disabled,
|
|
2077
2302
|
...rest
|
|
2078
|
-
}), T0 = Flex, t0 = "span", t1 = clsx(switchMarkClassName,
|
|
2303
|
+
}), T0 = Flex, t0 = "span", t1 = clsx(switchMarkClassName, hasError && "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;
|
|
2079
2304
|
} else T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
|
|
2080
2305
|
let t8;
|
|
2081
2306
|
$[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, {
|
|
@@ -2099,6 +2324,38 @@ function Switch(props) {
|
|
|
2099
2324
|
]
|
|
2100
2325
|
}), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
|
|
2101
2326
|
}
|
|
2327
|
+
const textAreaProps = {
|
|
2328
|
+
autoResize: {
|
|
2329
|
+
type: "boolean",
|
|
2330
|
+
className: "field-sizing-content"
|
|
2331
|
+
},
|
|
2332
|
+
hasError: { type: "boolean" },
|
|
2333
|
+
maxHeight: heightProps.maxHeight,
|
|
2334
|
+
...formElementDensityProps
|
|
2335
|
+
}, textAreaClassName = suffixClassName("sui-TextArea");
|
|
2336
|
+
/** @public */
|
|
2337
|
+
function TextArea(t0) {
|
|
2338
|
+
let $ = c(10), hasError, rest, style, t1;
|
|
2339
|
+
if ($[0] !== t0) {
|
|
2340
|
+
let { autoResize, density: t2, hasError: t3, rows: t4, ...props } = t0;
|
|
2341
|
+
hasError = t3;
|
|
2342
|
+
let { className, style: t5, ...t6 } = getProps({
|
|
2343
|
+
autoResize,
|
|
2344
|
+
density: t2 === void 0 ? "regular" : t2,
|
|
2345
|
+
rows: t4 === void 0 ? 5 : t4,
|
|
2346
|
+
...props
|
|
2347
|
+
}, textAreaProps);
|
|
2348
|
+
style = t5, rest = t6, t1 = clsx(textAreaClassName, "sui-radius2", "sui-width-full", className), $[0] = t0, $[1] = hasError, $[2] = rest, $[3] = style, $[4] = t1;
|
|
2349
|
+
} else hasError = $[1], rest = $[2], style = $[3], t1 = $[4];
|
|
2350
|
+
let textAreaClasses = t1, t2 = hasError || void 0, t3;
|
|
2351
|
+
return $[5] !== rest || $[6] !== style || $[7] !== t2 || $[8] !== textAreaClasses ? (t3 = /* @__PURE__ */ jsx("textarea", {
|
|
2352
|
+
className: textAreaClasses,
|
|
2353
|
+
style,
|
|
2354
|
+
"data-ui": "TextArea",
|
|
2355
|
+
...rest,
|
|
2356
|
+
"aria-invalid": t2
|
|
2357
|
+
}), $[5] = rest, $[6] = style, $[7] = t2, $[8] = textAreaClasses, $[9] = t3) : t3 = $[9], t3;
|
|
2358
|
+
}
|
|
2102
2359
|
const textInputProps = {
|
|
2103
2360
|
hasError: { type: "boolean" },
|
|
2104
2361
|
...formElementDensityProps
|
|
@@ -2107,8 +2364,10 @@ const textInputProps = {
|
|
|
2107
2364
|
function TextInput(t0) {
|
|
2108
2365
|
let $ = c(12), hasError, rest, style, t1, type;
|
|
2109
2366
|
if ($[0] !== t0) {
|
|
2110
|
-
let { density: t2, hasError: t3, type: t4, ...props } = t0
|
|
2111
|
-
hasError = t3
|
|
2367
|
+
let { density: t2, hasError: t3, type: t4, ...props } = t0;
|
|
2368
|
+
hasError = t3;
|
|
2369
|
+
let density = t2 === void 0 ? "regular" : t2;
|
|
2370
|
+
type = t4 === void 0 ? "text" : t4;
|
|
2112
2371
|
let { className, style: t5, ...t6 } = getProps({
|
|
2113
2372
|
density,
|
|
2114
2373
|
...props
|
|
@@ -2207,6 +2466,6 @@ function TooltipGroup(props) {
|
|
|
2207
2466
|
children
|
|
2208
2467
|
}), $[8] = Component, $[9] = children, $[10] = handleBlur, $[11] = handleMouseLeave, $[12] = handleTransitionEnd, $[13] = rest, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
|
|
2209
2468
|
}
|
|
2210
|
-
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, TextInput, Tooltip, TooltipGroup, VStack, VisuallyHidden, useIsClient };
|
|
2469
|
+
export { Avatar, AvatarCounter, AvatarStack, Badge, Box, Button, Card, Checkbox, Code, Container, Dialog, Divider, Eyebrow, Flex, Grid, HStack, Heading, Hotkeys, Icon, IconButton, Indicator, IndicatorStack, Inline, KBD, Label, Link, List, Popover, PressArea, Radio, Select, SkipToContent, Spinner, Switch, Text, TextArea, TextInput, Tooltip, TooltipGroup, VStack, VisuallyHidden, useIsClient };
|
|
2211
2470
|
|
|
2212
2471
|
//# sourceMappingURL=index.js.map
|