@sanity/ui 5.0.0-alpha.15 → 5.0.0-alpha.17

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 (54) hide show
  1. package/dist/index.d.ts +103 -22
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +366 -103
  4. package/dist/index.js.map +1 -1
  5. package/dist/styles.css +1 -1
  6. package/package.json +1 -1
  7. package/src/components/avatar/Avatar.tsx +50 -0
  8. package/src/components/avatar/avatar.css +51 -0
  9. package/src/components/avatar/avatar.props.ts +57 -0
  10. package/src/components/avatar-counter/AvatarCounter.tsx +38 -0
  11. package/src/components/avatar-counter/avatar-counter.css +8 -0
  12. package/src/components/avatar-counter/avatarCounter.props.ts +44 -0
  13. package/src/components/avatar-stack/AvatarStack.tsx +60 -0
  14. package/src/components/avatar-stack/avatar-stack.css +16 -0
  15. package/src/components/avatar-stack/avatarStack.props.ts +20 -0
  16. package/src/components/button/Button.tsx +7 -1
  17. package/src/components/button/button.css +37 -25
  18. package/src/components/card/Card.tsx +1 -1
  19. package/src/components/card/card.props.ts +4 -3
  20. package/src/components/checkbox/Checkbox.tsx +3 -3
  21. package/src/components/checkbox/checkbox.props.ts +2 -2
  22. package/src/components/hotkeys/Hotkeys.tsx +29 -0
  23. package/src/components/hotkeys/hotkeys.css +3 -0
  24. package/src/components/hotkeys/hotkeys.props.ts +15 -0
  25. package/src/components/index.css +6 -0
  26. package/src/components/indicator/indicator.css +1 -1
  27. package/src/components/kbd/KBD.tsx +33 -0
  28. package/src/components/kbd/kbd.css +6 -0
  29. package/src/components/kbd/kbd.props.ts +20 -0
  30. package/src/components/radio/Radio.tsx +3 -3
  31. package/src/components/radio/radio.props.ts +2 -2
  32. package/src/components/select/select.props.ts +1 -0
  33. package/src/components/spinner/Spinner.tsx +1 -0
  34. package/src/components/switch/Switch.tsx +3 -3
  35. package/src/components/switch/switch.props.ts +2 -2
  36. package/src/components/text-area/TextArea.tsx +32 -0
  37. package/src/components/text-area/text-area.css +56 -0
  38. package/src/components/text-area/textArea.props.ts +35 -0
  39. package/src/components/text-input/TextInput.tsx +1 -1
  40. package/src/components/text-input/text-input.css +9 -3
  41. package/src/components/text-input/textInput.props.ts +1 -0
  42. package/src/css/classes/dynamic/height.css +2 -0
  43. package/src/css/classes/local/field-sizing.css +3 -0
  44. package/src/css/classes/local/index.css +1 -1
  45. package/src/css/tokens/semantic.css +2 -5
  46. package/src/css/tokens/surface.css +76 -12
  47. package/src/index.ts +7 -1
  48. package/src/props/layout.ts +3 -3
  49. package/src/props/tone.ts +13 -2
  50. package/src/types/Avatar.ts +14 -0
  51. package/src/types/Eyebrow.ts +1 -1
  52. package/src/types/Tone.ts +2 -0
  53. package/src/version.ts +2 -2
  54. package/src/css/classes/local/tone.css +0 -75
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}-29dcdf`;
84
+ return `${className}-1271ff`;
85
85
  }
86
- const SPACE = [
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,
@@ -142,26 +152,25 @@ const SPACE = [
142
152
  className: "ml",
143
153
  values: SPACE_AUTO_NEGATIVE
144
154
  }
145
- }, toneProps = { tone: {
155
+ }, TONE = [
156
+ "neutral",
157
+ "positive",
158
+ "suggest",
159
+ "caution",
160
+ "critical"
161
+ ], TONE_WITH_DEFAULT = ["default", ...TONE], toneProps = { tone: {
146
162
  type: "union",
147
163
  className: "tone",
148
- values: [
149
- "neutral",
150
- "positive",
151
- "suggest",
152
- "caution",
153
- "critical"
154
- ]
164
+ values: TONE
165
+ } }, toneWithDefaultProps = { tone: {
166
+ type: "union",
167
+ className: "tone",
168
+ values: TONE_WITH_DEFAULT
155
169
  } }, typographyProps = {
156
170
  align: {
157
171
  type: "union",
158
172
  className: "text",
159
- values: [
160
- "left",
161
- "center",
162
- "right",
163
- "justify"
164
- ]
173
+ values: TEXT_ALIGN
165
174
  },
166
175
  muted: {
167
176
  type: "boolean",
@@ -187,61 +196,22 @@ const SPACE = [
187
196
  weight: {
188
197
  type: "union",
189
198
  className: "weight",
190
- values: [
191
- "regular",
192
- "medium",
193
- "semibold",
194
- "bold"
195
- ]
199
+ values: FONT_WEIGHT
196
200
  },
197
201
  ...marginProps,
198
202
  ...toneProps
199
- }, ICON_SIZE = [
203
+ }, TEXT_SIZE = [
200
204
  0,
201
205
  1,
202
206
  2,
203
207
  3,
204
208
  4
205
- ], iconProps = {
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, "sui-display-block", 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 = {
209
+ ], textProps = {
234
210
  as: { type: "string" },
235
211
  size: {
236
212
  type: "union",
237
213
  className: "text-body",
238
- values: [
239
- 0,
240
- 1,
241
- 2,
242
- 3,
243
- 4
244
- ]
214
+ values: TEXT_SIZE
245
215
  },
246
216
  ...typographyProps
247
217
  }, textClassName = suffixClassName("sui-Text");
@@ -285,6 +255,220 @@ function Text(t0) {
285
255
  children
286
256
  }), $[9] = T0, $[10] = children, $[11] = rest, $[12] = style, $[13] = t1, $[14] = t3) : t3 = $[14], t3;
287
257
  }
258
+ const heightProps = {
259
+ height: {
260
+ type: "string",
261
+ className: "height",
262
+ variable: "--height"
263
+ },
264
+ minHeight: {
265
+ type: "string",
266
+ className: "min-height",
267
+ variable: "--min-height"
268
+ },
269
+ maxHeight: {
270
+ type: "string",
271
+ className: "max-height",
272
+ variable: "--max-height"
273
+ }
274
+ }, AVATAR_SIZE = [
275
+ 0,
276
+ 1,
277
+ 2
278
+ ], avatarProps = {
279
+ color: {
280
+ type: "union",
281
+ className: "avatar",
282
+ values: [
283
+ "gray",
284
+ "purple",
285
+ "magenta",
286
+ "red",
287
+ "orange",
288
+ "yellow",
289
+ "green",
290
+ "cyan"
291
+ ]
292
+ },
293
+ name: { type: "string" },
294
+ size: {
295
+ type: "composite",
296
+ values: AVATAR_SIZE,
297
+ composition: {
298
+ size: {
299
+ propDef: {
300
+ type: "union",
301
+ className: "text-body",
302
+ values: TEXT_SIZE
303
+ },
304
+ mapping: {
305
+ 0: 0,
306
+ 1: 1,
307
+ 2: 2
308
+ }
309
+ },
310
+ height: {
311
+ propDef: heightProps.height,
312
+ mapping: {
313
+ 0: "19px",
314
+ 1: "25px",
315
+ 2: "33px"
316
+ }
317
+ }
318
+ }
319
+ },
320
+ src: { type: "string" }
321
+ }, avatarClassName = suffixClassName("sui-Avatar");
322
+ /** @public */
323
+ function Avatar(t0) {
324
+ let $ = c(5), { color: t1, size: t2, ...props } = t0, { className, style, "aria-label": ariaLabel, name, src, ...rest } = getProps({
325
+ color: t1 === void 0 ? "gray" : t1,
326
+ size: t2 === void 0 ? 1 : t2,
327
+ ...props
328
+ }, 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", {
329
+ className: "sui-radius-full sui-width-full sui-height-full",
330
+ src,
331
+ alt: ariaLabel || name,
332
+ onError: () => setError(!0)
333
+ }) : /* @__PURE__ */ jsx(Text, {
334
+ role: "img",
335
+ weight: "semibold",
336
+ "aria-label": ariaLabel || name,
337
+ children: name.slice(0, 1)
338
+ }), t6;
339
+ return $[0] !== rest || $[1] !== style || $[2] !== t3 || $[3] !== t5 ? (t6 = /* @__PURE__ */ jsx("figure", {
340
+ className: t3,
341
+ style,
342
+ "data-ui": "Avatar",
343
+ ...rest,
344
+ children: t5
345
+ }), $[0] = rest, $[1] = style, $[2] = t3, $[3] = t5, $[4] = t6) : t6 = $[4], t6;
346
+ }
347
+ const avatarCounterProps = {
348
+ count: { type: "number" },
349
+ size: {
350
+ type: "composite",
351
+ values: AVATAR_SIZE,
352
+ composition: {
353
+ size: {
354
+ propDef: {
355
+ type: "union",
356
+ className: "text-body",
357
+ values: TEXT_SIZE
358
+ },
359
+ mapping: {
360
+ 0: 0,
361
+ 1: 1,
362
+ 2: 2
363
+ }
364
+ },
365
+ height: {
366
+ propDef: heightProps.height,
367
+ mapping: {
368
+ 0: "19px",
369
+ 1: "25px",
370
+ 2: "33px"
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }, avatarCounterClassName = suffixClassName("sui-AvatarCounter");
376
+ /** @public */
377
+ function AvatarCounter(t0) {
378
+ let $ = c(14), ariaLabel, count, rest, style, t1;
379
+ if ($[0] !== t0) {
380
+ let { size: t2, ...props } = t0, { className, style: t3, "aria-label": t4, count: t5, ...t6 } = getProps({
381
+ size: t2 === void 0 ? 1 : t2,
382
+ ...props
383
+ }, avatarCounterProps);
384
+ 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;
385
+ } else ariaLabel = $[1], count = $[2], rest = $[3], style = $[4], t1 = $[5];
386
+ let t2 = ariaLabel || `+ ${count} more`, t3;
387
+ $[6] !== count || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsx(Text, {
388
+ role: "img",
389
+ weight: "semibold",
390
+ "aria-label": t2,
391
+ children: count
392
+ }), $[6] = count, $[7] = t2, $[8] = t3) : t3 = $[8];
393
+ let t4;
394
+ return $[9] !== rest || $[10] !== style || $[11] !== t1 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx("figure", {
395
+ className: t1,
396
+ style,
397
+ "data-ui": "AvatarCounter",
398
+ ...rest,
399
+ children: t3
400
+ }), $[9] = rest, $[10] = style, $[11] = t1, $[12] = t3, $[13] = t4) : t4 = $[13], t4;
401
+ }
402
+ const avatarStackProps = {
403
+ maxLength: { type: "number" },
404
+ size: {
405
+ type: "union",
406
+ values: AVATAR_SIZE
407
+ }
408
+ }, avatarStackClassName = suffixClassName("sui-AvatarStack");
409
+ /** @public */
410
+ function AvatarStack(t0) {
411
+ let $ = c(14), t1, t2, t3, t4, t5, t6;
412
+ if ($[0] !== t0) {
413
+ let { size: t7, ...props } = t0, { children, className, style, maxLength: maxLengthProp, size: sizeProp, ...rest } = getProps({
414
+ size: t7 === void 0 ? 1 : t7,
415
+ ...props
416
+ }, avatarStackProps), childArray = Children.toArray(children).filter(isValidElement), length = childArray.length, maxLength = maxLengthProp ?? length, visibleAvatars = length > maxLength ? childArray.slice(length - maxLength, length) : childArray;
417
+ t1 = clsx(avatarStackClassName, "sui-display-flex", className), t2 = style, t3 = "AvatarStack", t4 = rest, t5 = (!length || length > maxLength) && /* @__PURE__ */ jsx("li", {
418
+ className: "sui-display-flex",
419
+ children: /* @__PURE__ */ jsx(AvatarCounter, {
420
+ count: length ? length - maxLength : 0,
421
+ size: sizeProp,
422
+ "aria-label": length ? `+ ${length - maxLength} more user${length - maxLength > 1 ? "s" : ""}` : "No users"
423
+ })
424
+ }), t6 = visibleAvatars.map((child) => /* @__PURE__ */ jsx("li", {
425
+ className: "sui-display-flex",
426
+ children: cloneElement(child, { size: sizeProp })
427
+ }, child.key)), $[0] = t0, $[1] = t1, $[2] = t2, $[3] = t3, $[4] = t4, $[5] = t5, $[6] = t6;
428
+ } else t1 = $[1], t2 = $[2], t3 = $[3], t4 = $[4], t5 = $[5], t6 = $[6];
429
+ let t7;
430
+ return $[7] !== t1 || $[8] !== t2 || $[9] !== t3 || $[10] !== t4 || $[11] !== t5 || $[12] !== t6 ? (t7 = /* @__PURE__ */ jsxs("ul", {
431
+ className: t1,
432
+ style: t2,
433
+ "data-ui": t3,
434
+ ...t4,
435
+ children: [t5, t6]
436
+ }), $[7] = t1, $[8] = t2, $[9] = t3, $[10] = t4, $[11] = t5, $[12] = t6, $[13] = t7) : t7 = $[13], t7;
437
+ }
438
+ const ICON_SIZE = [
439
+ 0,
440
+ 1,
441
+ 2,
442
+ 3,
443
+ 4
444
+ ], iconProps = {
445
+ icon: { type: "string" },
446
+ size: {
447
+ type: "union",
448
+ className: "icon-body",
449
+ values: ICON_SIZE
450
+ },
451
+ muted: typographyProps.muted,
452
+ ...toneProps,
453
+ ...marginProps
454
+ }, iconClassName = suffixClassName("sui-Icon");
455
+ /** @public */
456
+ function Icon({ icon, size = 2, ...props }) {
457
+ let { className, style, ...rest } = getProps({
458
+ size,
459
+ ...props
460
+ }, iconProps), iconElement = isValidElement(icon) ? icon : null, ariaLabel = props["aria-label"] || (iconElement ? iconElement.props["aria-label"] : void 0), svgProps = {
461
+ className: clsx(iconClassName, "sui-display-block", className, iconElement ? iconElement.props.className : void 0),
462
+ style: iconElement ? {
463
+ ...iconElement.props.style,
464
+ ...style
465
+ } : style,
466
+ "data-ui": "Icon",
467
+ "aria-hidden": !ariaLabel || void 0,
468
+ ...rest
469
+ };
470
+ return iconElement ? cloneElement(iconElement, svgProps) : createElement(icon, svgProps);
471
+ }
288
472
  const badgeProps = {
289
473
  as: { type: "string" },
290
474
  iconStart: { type: "string" },
@@ -414,22 +598,6 @@ const borderProps = {
414
598
  className: "grid-row-end",
415
599
  variable: "--grid-row-end"
416
600
  }
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
601
  }, OVERFLOW = [
434
602
  "visible",
435
603
  "hidden",
@@ -557,7 +725,7 @@ const borderProps = {
557
725
  className: "z-index",
558
726
  variable: "--z-index"
559
727
  } }, layoutProps = {
560
- ...toneProps,
728
+ ...toneWithDefaultProps,
561
729
  ...widthProps,
562
730
  ...heightProps,
563
731
  ...marginProps,
@@ -705,24 +873,25 @@ const spinnerProps = { size: {
705
873
  } }, spinnerClassName = suffixClassName("sui-Spinner");
706
874
  /** @public */
707
875
  function Spinner(t0) {
708
- let $ = c(12), T0, rest, style, t1, t2;
876
+ let $ = c(14), T0, rest, style, t1, t2, t3;
709
877
  if ($[0] !== t0) {
710
- let { size: t3, ...props } = t0, { className, style: t4, ...t5 } = getProps({
711
- size: t3 === void 0 ? 2 : t3,
878
+ let { size: t4, ...props } = t0, size = t4 === void 0 ? 2 : t4, { className, style: t5, ...t6 } = getProps({
879
+ size,
712
880
  ...props
713
881
  }, spinnerProps);
714
- style = t4, rest = t5, T0 = Icon, t1 = SpinnerIcon, t2 = clsx(spinnerClassName, className), $[0] = t0, $[1] = T0, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2;
715
- } else T0 = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5];
716
- let t3;
717
- return $[6] !== T0 || $[7] !== rest || $[8] !== style || $[9] !== t1 || $[10] !== t2 ? (t3 = /* @__PURE__ */ jsx(T0, {
882
+ style = t5, rest = t6, T0 = Icon, t1 = SpinnerIcon, t2 = size, t3 = clsx(spinnerClassName, className), $[0] = t0, $[1] = T0, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2, $[6] = t3;
883
+ } else T0 = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
884
+ let t4;
885
+ return $[7] !== T0 || $[8] !== rest || $[9] !== style || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, {
718
886
  icon: t1,
719
- className: t2,
887
+ size: t2,
888
+ className: t3,
720
889
  style,
721
890
  "data-ui": "Spinner",
722
891
  role: "status",
723
892
  "aria-label": "Loading...",
724
893
  ...rest
725
- }), $[6] = T0, $[7] = rest, $[8] = style, $[9] = t1, $[10] = t2, $[11] = t3) : t3 = $[11], t3;
894
+ }), $[7] = T0, $[8] = rest, $[9] = style, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13], t4;
726
895
  }
727
896
  const buttonProps = {
728
897
  as: { type: "string" },
@@ -799,6 +968,7 @@ function Button(t0) {
799
968
  inset: 0,
800
969
  alignItems: "center",
801
970
  justifyContent: "center",
971
+ "data-ui": "Button-Spinner",
802
972
  children: /* @__PURE__ */ jsx(Spinner, {})
803
973
  }), t8 = IconStart && (isValidElement(IconStart) ? IconStart : /* @__PURE__ */ jsx(Icon, {
804
974
  icon: IconStart,
@@ -870,7 +1040,7 @@ const DENSITY = [
870
1040
  }
871
1041
  }
872
1042
  },
873
- ...toneProps,
1043
+ ...toneWithDefaultProps,
874
1044
  ...marginProps
875
1045
  }, cardClassName = suffixClassName("sui-Card");
876
1046
  /** @public */
@@ -879,7 +1049,7 @@ function Card(t0) {
879
1049
  if ($[0] !== t0) {
880
1050
  let { density: t2, tone: t3, ...props } = t0, { as, children: t4, className, style: t5, ...t6 } = getProps({
881
1051
  density: t2 === void 0 ? "regular" : t2,
882
- tone: t3 === void 0 ? "neutral" : t3,
1052
+ tone: t3 === void 0 ? "default" : t3,
883
1053
  ...props
884
1054
  }, cardProps);
885
1055
  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;
@@ -941,18 +1111,18 @@ function VisuallyHidden(props) {
941
1111
  }), $[6] = T0, $[7] = children, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1) : t1 = $[11], t1;
942
1112
  }
943
1113
  const checkboxProps = {
944
- error: { type: "boolean" },
1114
+ hasError: { type: "boolean" },
945
1115
  indeterminate: { type: "boolean" },
946
1116
  label: { type: "string" },
947
1117
  ...marginProps
948
1118
  }, checkboxClassName = suffixClassName("sui-Checkbox"), checkboxInputClassName = suffixClassName("sui-CheckboxInput"), checkboxMarkClassName = suffixClassName("sui-CheckboxMark");
949
1119
  /** @beta */
950
1120
  function Checkbox(props) {
951
- let $ = c(6), inputRef = useRef(null), { className, style, disabled, error, indeterminate, label, ...rest } = getProps(props, checkboxProps);
1121
+ let $ = c(6), inputRef = useRef(null), { className, style, disabled, hasError, indeterminate, label, ...rest } = getProps(props, checkboxProps);
952
1122
  useEffect(() => {
953
1123
  inputRef.current && (inputRef.current.indeterminate = indeterminate);
954
1124
  }, [indeterminate, inputRef]);
955
- let t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t2 = clsx(checkboxMarkClassName, error && "sui-error"), t3;
1125
+ let t0 = clsx(checkboxClassName, "sui-position-relative", className), T0 = Box, t2 = clsx(checkboxMarkClassName, hasError && "sui-error"), t3;
956
1126
  $[0] === indeterminate ? t3 = $[1] : (t3 = jsx(indeterminate ? RemoveIcon : CheckmarkIcon, {}), $[0] = indeterminate, $[1] = t3);
957
1127
  let t4;
958
1128
  return $[2] !== T0 || $[3] !== t2 || $[4] !== t3 ? (t4 = /* @__PURE__ */ jsx(T0, {
@@ -968,7 +1138,7 @@ function Checkbox(props) {
968
1138
  style,
969
1139
  "data-ui": "Checkbox",
970
1140
  disabled,
971
- error,
1141
+ error: hasError,
972
1142
  children: [
973
1143
  /* @__PURE__ */ jsx(VisuallyHidden, {
974
1144
  as: "input",
@@ -1319,7 +1489,8 @@ const eyebrowProps = {
1319
1489
  1,
1320
1490
  2,
1321
1491
  3,
1322
- 4
1492
+ 4,
1493
+ 5
1323
1494
  ]
1324
1495
  },
1325
1496
  ...typographyProps
@@ -1444,6 +1615,64 @@ function HStack(t0) {
1444
1615
  ...t2
1445
1616
  }), $[5] = t1, $[6] = t2, $[7] = t3) : t3 = $[7], t3;
1446
1617
  }
1618
+ const kbdProps = { text: { type: "string" } }, kbdClassName = suffixClassName("sui-KBD");
1619
+ /** @alpha */
1620
+ function KBD(props) {
1621
+ let $ = c(14), T0, rest, style, t0, t1, text;
1622
+ if ($[0] !== props) {
1623
+ let { className, style: t2, text: t3, ...t4 } = getProps(props, kbdProps);
1624
+ style = t2, text = t3, rest = t4;
1625
+ let kbdClasses = clsx(kbdClassName, "sui-p1 sui-radius2 sui-display-inline-block");
1626
+ T0 = Text, t0 = "kbd", t1 = clsx(kbdClasses, className), $[0] = props, $[1] = T0, $[2] = rest, $[3] = style, $[4] = t0, $[5] = t1, $[6] = text;
1627
+ } else T0 = $[1], rest = $[2], style = $[3], t0 = $[4], t1 = $[5], text = $[6];
1628
+ let t2;
1629
+ return $[7] !== T0 || $[8] !== rest || $[9] !== style || $[10] !== t0 || $[11] !== t1 || $[12] !== text ? (t2 = /* @__PURE__ */ jsx(T0, {
1630
+ as: t0,
1631
+ className: t1,
1632
+ style,
1633
+ "data-ui": "KBD",
1634
+ size: 0,
1635
+ weight: "semibold",
1636
+ muted: !0,
1637
+ trim: !0,
1638
+ ...rest,
1639
+ children: text
1640
+ }), $[7] = T0, $[8] = rest, $[9] = style, $[10] = t0, $[11] = t1, $[12] = text, $[13] = t2) : t2 = $[13], t2;
1641
+ }
1642
+ const hotkeysProps = { keys: { type: "string" } }, hotkeysClassName = suffixClassName("sui-Hotkeys");
1643
+ /** @alpha */
1644
+ function Hotkeys(t0) {
1645
+ let $ = c(13), keys, rest, style, t1, t2;
1646
+ if ($[0] !== t0) {
1647
+ t2 = Symbol.for("react.early_return_sentinel");
1648
+ bb0: {
1649
+ let { keys: t3, ...props } = t0;
1650
+ keys = t3;
1651
+ let { className, style: t4, ...t5 } = getProps(props, hotkeysProps);
1652
+ if (style = t4, rest = t5, !keys || keys.length === 0) {
1653
+ t2 = null;
1654
+ break bb0;
1655
+ }
1656
+ let hotkeysClasses = clsx(hotkeysClassName, "sui-display-inline-flex");
1657
+ t1 = clsx(hotkeysClasses, className);
1658
+ }
1659
+ $[0] = t0, $[1] = keys, $[2] = rest, $[3] = style, $[4] = t1, $[5] = t2;
1660
+ } else keys = $[1], rest = $[2], style = $[3], t1 = $[4], t2 = $[5];
1661
+ if (t2 !== Symbol.for("react.early_return_sentinel")) return t2;
1662
+ let t3;
1663
+ $[6] === keys ? t3 = $[7] : (t3 = keys.map(_temp$1), $[6] = keys, $[7] = t3);
1664
+ let t4;
1665
+ return $[8] !== rest || $[9] !== style || $[10] !== t1 || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsx("kbd", {
1666
+ className: t1,
1667
+ style,
1668
+ "data-ui": "Hotkeys",
1669
+ ...rest,
1670
+ children: t3
1671
+ }), $[8] = rest, $[9] = style, $[10] = t1, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
1672
+ }
1673
+ function _temp$1(key) {
1674
+ return /* @__PURE__ */ jsx(KBD, { text: key }, key);
1675
+ }
1447
1676
  const indicatorProps = {
1448
1677
  as: { type: "string" },
1449
1678
  label: { type: "string" },
@@ -1936,7 +2165,7 @@ function PopoverRoot(t0) {
1936
2165
  }
1937
2166
  /** @beta */
1938
2167
  const Popover = Object.assign(PopoverRoot, { forwardsTriggerProps: !0 }), radioProps = {
1939
- error: { type: "boolean" },
2168
+ hasError: { type: "boolean" },
1940
2169
  label: { type: "string" },
1941
2170
  ...marginProps
1942
2171
  }, radioClassName = suffixClassName("sui-Radio"), radioInputClassName = suffixClassName("sui-RadioInput"), radioMarkClassName = suffixClassName("sui-RadioMark");
@@ -1944,14 +2173,14 @@ const Popover = Object.assign(PopoverRoot, { forwardsTriggerProps: !0 }), radioP
1944
2173
  function Radio(props) {
1945
2174
  let $ = c(26), T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
1946
2175
  if ($[0] !== props) {
1947
- let { className, style, label: t8, disabled, error, ...rest } = getProps(props, radioProps);
1948
- label = t8, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
2176
+ let { className, style, label: t8, disabled, hasError, ...rest } = getProps(props, radioProps);
2177
+ label = t8, T1 = Label, t2 = clsx(radioClassName, "sui-position-relative", className), t3 = style, t4 = "Radio", t5 = disabled, t6 = hasError, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
1949
2178
  as: "input",
1950
2179
  type: "radio",
1951
2180
  className: radioInputClassName,
1952
2181
  disabled,
1953
2182
  ...rest
1954
- }), 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;
2183
+ }), 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;
1955
2184
  } else T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
1956
2185
  let t8;
1957
2186
  $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, {
@@ -2061,7 +2290,7 @@ function SkipToContent(props) {
2061
2290
  }), $[10] = T0, $[11] = rest, $[12] = style, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3, $[17] = t4) : t4 = $[17], t4;
2062
2291
  }
2063
2292
  const switchProps = {
2064
- error: { type: "boolean" },
2293
+ hasError: { type: "boolean" },
2065
2294
  label: { type: "string" },
2066
2295
  ...marginProps
2067
2296
  }, switchClassName = suffixClassName("sui-Switch"), switchInputClassName = suffixClassName("sui-SwitchInput"), switchMarkClassName = suffixClassName("sui-SwitchMark");
@@ -2069,15 +2298,15 @@ const switchProps = {
2069
2298
  function Switch(props) {
2070
2299
  let $ = c(26), T0, T1, label, t0, t1, t2, t3, t4, t5, t6, t7;
2071
2300
  if ($[0] !== props) {
2072
- let { className, style, disabled, error, label: t8, ...rest } = getProps(props, switchProps);
2073
- label = t8, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = error, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
2301
+ let { className, style, disabled, hasError, label: t8, ...rest } = getProps(props, switchProps);
2302
+ label = t8, T1 = Label, t2 = clsx(switchClassName, "sui-position-relative", className), t3 = style, t4 = "Switch", t5 = props.disabled, t6 = hasError, t7 = /* @__PURE__ */ jsx(VisuallyHidden, {
2074
2303
  as: "input",
2075
2304
  type: "checkbox",
2076
2305
  role: "switch",
2077
2306
  className: switchInputClassName,
2078
2307
  disabled,
2079
2308
  ...rest
2080
- }), 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;
2309
+ }), 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;
2081
2310
  } else T0 = $[1], T1 = $[2], label = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], t5 = $[9], t6 = $[10], t7 = $[11];
2082
2311
  let t8;
2083
2312
  $[12] !== T0 || $[13] !== t0 || $[14] !== t1 ? (t8 = /* @__PURE__ */ jsx(T0, {
@@ -2101,6 +2330,38 @@ function Switch(props) {
2101
2330
  ]
2102
2331
  }), $[16] = T1, $[17] = label, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
2103
2332
  }
2333
+ const textAreaProps = {
2334
+ autoResize: {
2335
+ type: "boolean",
2336
+ className: "field-sizing-content"
2337
+ },
2338
+ hasError: { type: "boolean" },
2339
+ maxHeight: heightProps.maxHeight,
2340
+ ...formElementDensityProps
2341
+ }, textAreaClassName = suffixClassName("sui-TextArea");
2342
+ /** @public */
2343
+ function TextArea(t0) {
2344
+ let $ = c(10), hasError, rest, style, t1;
2345
+ if ($[0] !== t0) {
2346
+ let { autoResize, density: t2, hasError: t3, rows: t4, ...props } = t0;
2347
+ hasError = t3;
2348
+ let { className, style: t5, ...t6 } = getProps({
2349
+ autoResize,
2350
+ density: t2 === void 0 ? "regular" : t2,
2351
+ rows: t4 === void 0 ? 5 : t4,
2352
+ ...props
2353
+ }, textAreaProps);
2354
+ style = t5, rest = t6, t1 = clsx(textAreaClassName, "sui-radius2", "sui-width-full", className), $[0] = t0, $[1] = hasError, $[2] = rest, $[3] = style, $[4] = t1;
2355
+ } else hasError = $[1], rest = $[2], style = $[3], t1 = $[4];
2356
+ let textAreaClasses = t1, t2 = hasError || void 0, t3;
2357
+ return $[5] !== rest || $[6] !== style || $[7] !== t2 || $[8] !== textAreaClasses ? (t3 = /* @__PURE__ */ jsx("textarea", {
2358
+ className: textAreaClasses,
2359
+ style,
2360
+ "data-ui": "TextArea",
2361
+ ...rest,
2362
+ "aria-invalid": t2
2363
+ }), $[5] = rest, $[6] = style, $[7] = t2, $[8] = textAreaClasses, $[9] = t3) : t3 = $[9], t3;
2364
+ }
2104
2365
  const textInputProps = {
2105
2366
  hasError: { type: "boolean" },
2106
2367
  ...formElementDensityProps
@@ -2109,8 +2370,10 @@ const textInputProps = {
2109
2370
  function TextInput(t0) {
2110
2371
  let $ = c(12), hasError, rest, style, t1, type;
2111
2372
  if ($[0] !== t0) {
2112
- let { density: t2, hasError: t3, type: t4, ...props } = t0, density = t2 === void 0 ? "regular" : t2;
2113
- hasError = t3 !== void 0 && t3, type = t4 === void 0 ? "text" : t4;
2373
+ let { density: t2, hasError: t3, type: t4, ...props } = t0;
2374
+ hasError = t3;
2375
+ let density = t2 === void 0 ? "regular" : t2;
2376
+ type = t4 === void 0 ? "text" : t4;
2114
2377
  let { className, style: t5, ...t6 } = getProps({
2115
2378
  density,
2116
2379
  ...props
@@ -2209,6 +2472,6 @@ function TooltipGroup(props) {
2209
2472
  children
2210
2473
  }), $[8] = Component, $[9] = children, $[10] = handleBlur, $[11] = handleMouseLeave, $[12] = handleTransitionEnd, $[13] = rest, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
2211
2474
  }
2212
- 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 };
2475
+ 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 };
2213
2476
 
2214
2477
  //# sourceMappingURL=index.js.map