@42-central/ui-react 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/dist/{chunk-FUNTJZX7.js → chunk-2CL3FKEY.js} +3 -3
  2. package/dist/{chunk-FUNTJZX7.js.map → chunk-2CL3FKEY.js.map} +1 -1
  3. package/dist/{chunk-OZMSXYBX.js → chunk-36NWC4GV.js} +3 -3
  4. package/dist/{chunk-OZMSXYBX.js.map → chunk-36NWC4GV.js.map} +1 -1
  5. package/dist/{chunk-4FEOMQYR.js → chunk-54W6VAI3.js} +5 -5
  6. package/dist/{chunk-4FEOMQYR.js.map → chunk-54W6VAI3.js.map} +1 -1
  7. package/dist/{chunk-SZEOTXRZ.js → chunk-6II2DVYR.js} +5 -5
  8. package/dist/{chunk-SZEOTXRZ.js.map → chunk-6II2DVYR.js.map} +1 -1
  9. package/dist/{chunk-DJLNGWMM.js → chunk-6IRMKF5T.js} +3 -3
  10. package/dist/{chunk-DJLNGWMM.js.map → chunk-6IRMKF5T.js.map} +1 -1
  11. package/dist/{chunk-YPFSRZ3T.js → chunk-6UIQJJNJ.js} +3 -3
  12. package/dist/{chunk-YPFSRZ3T.js.map → chunk-6UIQJJNJ.js.map} +1 -1
  13. package/dist/{chunk-DT6LKNZF.js → chunk-7247WBTV.js} +5 -4
  14. package/dist/chunk-7247WBTV.js.map +1 -0
  15. package/dist/{chunk-6VYGK3Q3.js → chunk-7E7JNWOC.js} +16 -21
  16. package/dist/chunk-7E7JNWOC.js.map +1 -0
  17. package/dist/{chunk-C4NFRSOR.js → chunk-7HZBD4YZ.js} +4 -4
  18. package/dist/{chunk-C4NFRSOR.js.map → chunk-7HZBD4YZ.js.map} +1 -1
  19. package/dist/{chunk-JVG5ISPT.js → chunk-AHKMN3YQ.js} +3 -3
  20. package/dist/{chunk-JVG5ISPT.js.map → chunk-AHKMN3YQ.js.map} +1 -1
  21. package/dist/{chunk-UAYENYS2.js → chunk-AKXALCUN.js} +3 -3
  22. package/dist/{chunk-UAYENYS2.js.map → chunk-AKXALCUN.js.map} +1 -1
  23. package/dist/{chunk-BE2LWUHY.js → chunk-BMEJBY6H.js} +5 -3
  24. package/dist/chunk-BMEJBY6H.js.map +1 -0
  25. package/dist/{chunk-MXAACRWE.js → chunk-E52Z2FKU.js} +5 -5
  26. package/dist/{chunk-MXAACRWE.js.map → chunk-E52Z2FKU.js.map} +1 -1
  27. package/dist/chunk-F374BNL4.js +129 -0
  28. package/dist/chunk-F374BNL4.js.map +1 -0
  29. package/dist/{chunk-MRAJ45IM.js → chunk-FZSLSUSX.js} +4 -4
  30. package/dist/{chunk-MRAJ45IM.js.map → chunk-FZSLSUSX.js.map} +1 -1
  31. package/dist/{chunk-3L5GLI67.js → chunk-I4B3N3UX.js} +3 -3
  32. package/dist/{chunk-3L5GLI67.js.map → chunk-I4B3N3UX.js.map} +1 -1
  33. package/dist/{chunk-IPYHTCFL.js → chunk-IUK7OJXZ.js} +3 -3
  34. package/dist/{chunk-IPYHTCFL.js.map → chunk-IUK7OJXZ.js.map} +1 -1
  35. package/dist/{chunk-2MXWEIMD.js → chunk-KKLCHLCZ.js} +12 -11
  36. package/dist/chunk-KKLCHLCZ.js.map +1 -0
  37. package/dist/{chunk-YWTOW7PZ.js → chunk-LHUWOA2U.js} +8 -8
  38. package/dist/{chunk-YWTOW7PZ.js.map → chunk-LHUWOA2U.js.map} +1 -1
  39. package/dist/{chunk-6N6J2DOE.js → chunk-LIZWCWED.js} +3 -3
  40. package/dist/{chunk-6N6J2DOE.js.map → chunk-LIZWCWED.js.map} +1 -1
  41. package/dist/{chunk-O7LS6OZR.js → chunk-LMCUGYHT.js} +3 -3
  42. package/dist/{chunk-O7LS6OZR.js.map → chunk-LMCUGYHT.js.map} +1 -1
  43. package/dist/{chunk-DHJB4UJD.js → chunk-N5M4PDBK.js} +4 -4
  44. package/dist/{chunk-DHJB4UJD.js.map → chunk-N5M4PDBK.js.map} +1 -1
  45. package/dist/{chunk-DA4QII2N.js → chunk-NLSJ6T7V.js} +4 -4
  46. package/dist/{chunk-DA4QII2N.js.map → chunk-NLSJ6T7V.js.map} +1 -1
  47. package/dist/{chunk-UT3TOV2Q.js → chunk-OVT2KZHY.js} +3 -3
  48. package/dist/{chunk-UT3TOV2Q.js.map → chunk-OVT2KZHY.js.map} +1 -1
  49. package/dist/{chunk-SVKN5ZHX.js → chunk-PEHFWGTT.js} +16 -13
  50. package/dist/chunk-PEHFWGTT.js.map +1 -0
  51. package/dist/{chunk-J44FJ7PH.js → chunk-PFZMB3US.js} +4 -4
  52. package/dist/{chunk-J44FJ7PH.js.map → chunk-PFZMB3US.js.map} +1 -1
  53. package/dist/{chunk-IRNF274I.js → chunk-PI7X5YFJ.js} +3 -3
  54. package/dist/{chunk-IRNF274I.js.map → chunk-PI7X5YFJ.js.map} +1 -1
  55. package/dist/{chunk-F2FSHVO5.js → chunk-QZ4N5LYG.js} +7 -7
  56. package/dist/{chunk-F2FSHVO5.js.map → chunk-QZ4N5LYG.js.map} +1 -1
  57. package/dist/{chunk-E5H3YWZV.js → chunk-SAXWCGWR.js} +3 -3
  58. package/dist/{chunk-E5H3YWZV.js.map → chunk-SAXWCGWR.js.map} +1 -1
  59. package/dist/{chunk-SWVUXEBT.js → chunk-SCXXJDKQ.js} +3 -3
  60. package/dist/{chunk-SWVUXEBT.js.map → chunk-SCXXJDKQ.js.map} +1 -1
  61. package/dist/{chunk-D3JYDAUZ.js → chunk-T44RW5DW.js} +4 -4
  62. package/dist/{chunk-D3JYDAUZ.js.map → chunk-T44RW5DW.js.map} +1 -1
  63. package/dist/{chunk-FB2G4LNH.js → chunk-UDCCOUWR.js} +5 -5
  64. package/dist/{chunk-FB2G4LNH.js.map → chunk-UDCCOUWR.js.map} +1 -1
  65. package/dist/{chunk-TCFB23JT.js → chunk-WERJ44ZN.js} +3 -3
  66. package/dist/{chunk-TCFB23JT.js.map → chunk-WERJ44ZN.js.map} +1 -1
  67. package/dist/{chunk-QNKD2SQM.js → chunk-X3YIHN2U.js} +5 -5
  68. package/dist/{chunk-QNKD2SQM.js.map → chunk-X3YIHN2U.js.map} +1 -1
  69. package/dist/{chunk-VD6PB3VA.js → chunk-X6DESK37.js} +12 -3
  70. package/dist/chunk-X6DESK37.js.map +1 -0
  71. package/dist/{chunk-7AQ4MN4M.js → chunk-XUFCI262.js} +4 -4
  72. package/dist/{chunk-7AQ4MN4M.js.map → chunk-XUFCI262.js.map} +1 -1
  73. package/dist/{chunk-47LEAR6G.js → chunk-Y2G47ARQ.js} +6 -6
  74. package/dist/{chunk-47LEAR6G.js.map → chunk-Y2G47ARQ.js.map} +1 -1
  75. package/dist/{chunk-F342ZT7O.js → chunk-ZVECQBGG.js} +13 -7
  76. package/dist/chunk-ZVECQBGG.js.map +1 -0
  77. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  78. package/dist/components/action-icon/index.js +1 -1
  79. package/dist/components/alert/index.js +1 -1
  80. package/dist/components/ambient-background/index.js +5 -3
  81. package/dist/components/ambient-background/index.js.map +1 -1
  82. package/dist/components/ambient-background/starfield.d.ts.map +1 -1
  83. package/dist/components/app-shell/index.js +4 -4
  84. package/dist/components/autocomplete/index.js +3 -3
  85. package/dist/components/avatar/index.js +2 -2
  86. package/dist/components/badge/badge.d.ts.map +1 -1
  87. package/dist/components/badge/index.js +1 -1
  88. package/dist/components/button/index.js +1 -1
  89. package/dist/components/button-multi-select/index.js +3 -3
  90. package/dist/components/button-select/index.js +3 -3
  91. package/dist/components/calendar/index.js +4 -4
  92. package/dist/components/calendar-heatmap/index.js +2 -2
  93. package/dist/components/camera/index.js +10 -10
  94. package/dist/components/card/card.d.ts.map +1 -1
  95. package/dist/components/card/index.js +1 -1
  96. package/dist/components/carousel/index.js +2 -2
  97. package/dist/components/checkbox/checkbox.d.ts +3 -2
  98. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  99. package/dist/components/checkbox/index.js +2 -2
  100. package/dist/components/choice-card-group/index.js +2 -2
  101. package/dist/components/choice-card-group/index.js.map +1 -1
  102. package/dist/components/clipboard/index.js +3 -3
  103. package/dist/components/code-block/code-block.d.ts +6 -3
  104. package/dist/components/code-block/code-block.d.ts.map +1 -1
  105. package/dist/components/code-block/highlighter.d.ts +16 -15
  106. package/dist/components/code-block/highlighter.d.ts.map +1 -1
  107. package/dist/components/code-block/index.d.ts +2 -1
  108. package/dist/components/code-block/index.d.ts.map +1 -1
  109. package/dist/components/code-block/index.js +81 -10
  110. package/dist/components/code-block/index.js.map +1 -1
  111. package/dist/components/code-block/languages.d.ts +61 -0
  112. package/dist/components/code-block/languages.d.ts.map +1 -0
  113. package/dist/components/code-block/static.d.ts +2 -1
  114. package/dist/components/code-block/static.d.ts.map +1 -1
  115. package/dist/components/code-block/static.js +99 -10
  116. package/dist/components/code-block/static.js.map +1 -1
  117. package/dist/components/combobox/index.js +3 -3
  118. package/dist/components/combobox-list/index.js +5 -5
  119. package/dist/components/compare/index.js +2 -2
  120. package/dist/components/data-table/index.js +30 -30
  121. package/dist/components/data-table/index.js.map +1 -1
  122. package/dist/components/date-picker/index.js +12 -12
  123. package/dist/components/download-button/index.js +2 -2
  124. package/dist/components/drawer/index.js +4 -4
  125. package/dist/components/field/field.d.ts +3 -0
  126. package/dist/components/field/field.d.ts.map +1 -1
  127. package/dist/components/field/index.js +1 -1
  128. package/dist/components/file-item/index.js +5 -5
  129. package/dist/components/file-preview/index.js +5 -5
  130. package/dist/components/file-trigger/index.js +2 -2
  131. package/dist/components/file-upload/index.js +6 -6
  132. package/dist/components/gallery/index.js +2 -2
  133. package/dist/components/geodesic/a11y.d.ts +3 -3
  134. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  135. package/dist/components/image-cropper/index.js +7 -7
  136. package/dist/components/indicator/index.js +1 -1
  137. package/dist/components/input/index.js +2 -2
  138. package/dist/components/kbd/index.js +3 -3
  139. package/dist/components/kbd/kbd.d.ts.map +1 -1
  140. package/dist/components/lightbox/index.js +7 -7
  141. package/dist/components/menu/index.js +2 -2
  142. package/dist/components/modal/index.js +4 -4
  143. package/dist/components/multi-combobox-list/index.js +5 -5
  144. package/dist/components/multi-select/index.js +6 -6
  145. package/dist/components/number-input/index.js +3 -3
  146. package/dist/components/overlays/index.js +6 -6
  147. package/dist/components/password-input/index.js +3 -3
  148. package/dist/components/photo-capture/index.js +14 -14
  149. package/dist/components/pills-input/index.js +5 -5
  150. package/dist/components/pin-input/index.js +2 -2
  151. package/dist/components/radio-group/index.js +1 -1
  152. package/dist/components/rating/index.js +1 -1
  153. package/dist/components/schedule/index.js +5 -5
  154. package/dist/components/segment-group/index.js +4 -4
  155. package/dist/components/select/index.js +4 -4
  156. package/dist/components/slider/index.js +2 -2
  157. package/dist/components/spotlight/index.js +9 -9
  158. package/dist/components/switch/index.js +14 -19
  159. package/dist/components/switch/index.js.map +1 -1
  160. package/dist/components/switch/switch.d.ts +1 -0
  161. package/dist/components/switch/switch.d.ts.map +1 -1
  162. package/dist/components/table/index.js +1 -1
  163. package/dist/components/table/table.d.ts.map +1 -1
  164. package/dist/components/tabs/index.js +3 -3
  165. package/dist/components/tags-input/index.js +5 -5
  166. package/dist/components/text-input/index.js +2 -2
  167. package/dist/components/textarea/index.js +2 -2
  168. package/dist/components/theme-icon/index.js +1 -1
  169. package/dist/components/theme-icon/theme-icon.d.ts.map +1 -1
  170. package/dist/components/time-input/index.js +7 -7
  171. package/dist/components/tree-multi-select/index.js +6 -6
  172. package/dist/components/tree-select/index.js +3 -3
  173. package/dist/index.js +4 -4
  174. package/dist/theme.css +28 -23
  175. package/package.json +1 -1
  176. package/src/components/action-icon/action-icon.tsx +3 -1
  177. package/src/components/ambient-background/starfield.tsx +4 -2
  178. package/src/components/badge/badge.tsx +11 -6
  179. package/src/components/button/button.tsx +1 -1
  180. package/src/components/card/card.tsx +10 -9
  181. package/src/components/checkbox/checkbox.test.tsx +17 -9
  182. package/src/components/checkbox/checkbox.tsx +26 -27
  183. package/src/components/choice-card-group/choice-card-group.tsx +3 -3
  184. package/src/components/code-block/code-block.tsx +7 -4
  185. package/src/components/code-block/highlighter.test.ts +79 -1
  186. package/src/components/code-block/highlighter.ts +76 -30
  187. package/src/components/code-block/index.ts +2 -0
  188. package/src/components/code-block/languages.ts +63 -0
  189. package/src/components/code-block/static.tsx +2 -1
  190. package/src/components/data-table/data-table-pagination.tsx +5 -5
  191. package/src/components/data-table/data-table-stack.tsx +2 -2
  192. package/src/components/field/field.tsx +14 -0
  193. package/src/components/kbd/kbd.tsx +2 -1
  194. package/src/components/switch/switch.test.tsx +15 -0
  195. package/src/components/switch/switch.tsx +27 -27
  196. package/src/components/table/table.test.tsx +1 -1
  197. package/src/components/table/table.tsx +14 -11
  198. package/src/components/theme-icon/theme-icon.tsx +46 -12
  199. package/src/theme.css +28 -23
  200. package/dist/chunk-2MXWEIMD.js.map +0 -1
  201. package/dist/chunk-6VYGK3Q3.js.map +0 -1
  202. package/dist/chunk-7CNDZZZ6.js +0 -95
  203. package/dist/chunk-7CNDZZZ6.js.map +0 -1
  204. package/dist/chunk-BE2LWUHY.js.map +0 -1
  205. package/dist/chunk-DT6LKNZF.js.map +0 -1
  206. package/dist/chunk-F342ZT7O.js.map +0 -1
  207. package/dist/chunk-SVKN5ZHX.js.map +0 -1
  208. package/dist/chunk-VD6PB3VA.js.map +0 -1
@@ -10,7 +10,13 @@ import { focusStyles } from "../../lib/focus-styles"
10
10
  import { props } from "../../lib/props"
11
11
  import type { Size } from "../../lib/sizes"
12
12
  import type { WithTestId } from "../../lib/test-id"
13
- import { FieldShell, fieldA11yProps, fieldLabel, fieldRoot, requiredMark } from "../field/field"
13
+ import {
14
+ FieldShell,
15
+ fieldA11yProps,
16
+ fieldInlineStack,
17
+ fieldLabel,
18
+ requiredMark,
19
+ } from "../field/field"
14
20
 
15
21
  /**
16
22
  * Switch — a single boolean toggle on Ark UI's Switch machine, styled as a
@@ -18,8 +24,9 @@ import { FieldShell, fieldA11yProps, fieldLabel, fieldRoot, requiredMark } from
18
24
  * through the switch's own `Ark.Label` part (not `Field`'s) so it stays
19
25
  * correctly wired to the hidden input's `aria-labelledby` and carries no
20
26
  * layout footprint when visually hidden (e.g. `classNames.label: "sr-only"`).
21
- * `description` / `error` / `required` live below it via the shared `Field`
22
- * scaffold, so a `Switch` is accessible and complete on its own. Implements
27
+ * `description` / `error` / `required` live below the label via the shared
28
+ * `Field` scaffold, with the track centered on the label line, so a `Switch`
29
+ * is accessible and complete on its own. Implements
23
30
  * the kit's `FormControlProps` contract: the `ref` and `onBlur` land on the
24
31
  * submittable hidden `<input>`, and `name` wires it into native form
25
32
  * submission.
@@ -127,6 +134,7 @@ export type SwitchProps = WithTestId & {
127
134
  control?: string
128
135
  thumb?: string
129
136
  label?: string
137
+ /** The description / error field, under the label. */
130
138
  field?: string
131
139
  }
132
140
  }
@@ -171,9 +179,10 @@ export const Switch = ({
171
179
  // library can flip it from `fieldState.invalid` (see FormControlProps).
172
180
  const isInvalid = invalid || error != null
173
181
 
174
- // A visible label above description/error needs the two grouped into one
175
- // flex-col item, or they'd land side by side in the root's row instead of
176
- // stacked. Label-only (incl. sr-only) never needs this extra wrapper.
182
+ // A visible label above description/error switches the root to a grid: the
183
+ // control centers on the label's row alone (not on the whole text stack),
184
+ // and the field hangs under the label in the second column. Label-only
185
+ // (incl. sr-only) stays a plain inline row.
177
186
  const hasStack = label != null && (description != null || error != null)
178
187
 
179
188
  const labelNode = label != null && (
@@ -206,7 +215,9 @@ export const Switch = ({
206
215
  // `relative` contains the absolutely positioned hidden input, which would
207
216
  // otherwise escape any scroller this control sits in.
208
217
  className={cn(
209
- "relative inline-flex items-center gap-2 select-none",
218
+ hasStack
219
+ ? fieldInlineStack({ size })
220
+ : "relative inline-flex items-center gap-2 select-none",
210
221
  className,
211
222
  classNames?.root,
212
223
  )}
@@ -215,26 +226,15 @@ export const Switch = ({
215
226
  <Ark.Thumb className={cn(switchThumb({ size }), classNames?.thumb)} />
216
227
  </Ark.Control>
217
228
 
218
- {hasStack ? (
219
- <div className={cn(fieldRoot({ size }), classNames?.field)}>
220
- {labelNode}
221
- <FieldShell description={description} error={error} size={size}>
222
- <SwitchHiddenInput ref={ref} onBlur={onBlur} />
223
- </FieldShell>
224
- </div>
225
- ) : (
226
- <>
227
- {labelNode}
228
- <FieldShell
229
- description={description}
230
- error={error}
231
- size={size}
232
- className={classNames?.field}
233
- >
234
- <SwitchHiddenInput ref={ref} onBlur={onBlur} />
235
- </FieldShell>
236
- </>
237
- )}
229
+ {labelNode}
230
+ <FieldShell
231
+ description={description}
232
+ error={error}
233
+ size={size}
234
+ className={cn(hasStack && "col-start-2", classNames?.field)}
235
+ >
236
+ <SwitchHiddenInput ref={ref} onBlur={onBlur} />
237
+ </FieldShell>
238
238
  </Ark.Root>
239
239
  )
240
240
  }
@@ -73,7 +73,7 @@ describe("Table", () => {
73
73
  const scroll = container.querySelector("table")?.parentElement as HTMLElement
74
74
  // Root container: bordered, rounded, and clipped so the rounding survives a scrollbar.
75
75
  expect(root.className).toContain("overflow-hidden")
76
- expect(root.className).toContain("rounded-sm")
76
+ expect(root.className).toContain("rounded-xl")
77
77
  expect(root.className).toContain("border")
78
78
  // The table sits inside the scrollable region.
79
79
  expect(scroll.className).toContain("overflow-auto")
@@ -31,9 +31,12 @@ import { TEXT_COLOR_CLASSES } from "../../lib/typography-size"
31
31
  */
32
32
  const tableContainer = cn(
33
33
  "flex w-full flex-col overflow-hidden contain-layout",
34
- // Brand-derived border, matching InputBase/Popover/Modal/Drawer's shell
35
- // (border-brand-900/20 dark:border-white/15) rather than a neutral gray.
36
- "rounded-sm border border-brand-900/20 dark:border-white/15",
34
+ // The table is a card: the same surface as Card's default — white 4%,
35
+ // edged white 8% (Figma's `bg-primary` / `border-primary`) — at the radius
36
+ // Figma draws for a table (12, node 22286-101476). One surface, laid once
37
+ // on the frame: the header, the rows and the pagination band are clear, so
38
+ // the pagination reads as part of the table, not as a darker strip.
39
+ "rounded-xl border border-brand-900/20 dark:border-white/8 dark:bg-white/4",
37
40
  )
38
41
 
39
42
  /**
@@ -52,19 +55,19 @@ const tableVariants = cva(
52
55
  [
53
56
  // Row separators — on cells, since separate-mode ignores <tr> borders.
54
57
  "[&_tbody_tr:not(:last-child)_td]:border-b",
55
- "[&_tbody_td]:border-brand-900/20 dark:[&_tbody_td]:border-white/15",
58
+ "[&_tbody_td]:border-brand-900/20 dark:[&_tbody_td]:border-white/8",
56
59
  // Cells
57
60
  "[&_td]:align-middle",
58
61
  "[&_th]:text-start [&_th]:align-middle [&_th]:font-medium [&_th]:text-brand-950 dark:[&_th]:text-white",
59
62
  // Header — subtle fill + a bottom separator that survives sticky. Same
60
63
  // brand-tinted fill Popover/Modal/Drawer use for their own surface, at
61
64
  // the same /90 light /85 dark opacity recipe.
62
- "[&_thead]:bg-brand-50/90 dark:[&_thead]:bg-brand-950/85",
63
- "[&_thead_th]:border-b [&_thead_th]:border-brand-900/20 dark:[&_thead_th]:border-white/15",
65
+ "[&_thead]:bg-brand-50/90 dark:[&_thead]:bg-transparent",
66
+ "[&_thead_th]:border-b [&_thead_th]:border-brand-900/20 dark:[&_thead_th]:border-white/8",
64
67
  // Footer — subtle fill + a top separator that survives sticky.
65
- "[&_tfoot]:bg-brand-50/90 dark:[&_tfoot]:bg-brand-950/85 [&_tfoot]:font-medium",
68
+ "[&_tfoot]:bg-brand-50/90 dark:[&_tfoot]:bg-transparent [&_tfoot]:font-medium",
66
69
  "[&_tfoot_th]:border-t [&_tfoot_td]:border-t",
67
- "[&_tfoot_th]:border-brand-900/20 [&_tfoot_td]:border-brand-900/20 dark:[&_tfoot_th]:border-white/15 dark:[&_tfoot_td]:border-white/15",
70
+ "[&_tfoot_th]:border-brand-900/20 [&_tfoot_td]:border-brand-900/20 dark:[&_tfoot_th]:border-white/8 dark:[&_tfoot_td]:border-white/8",
68
71
  // Excludes a `data-placeholder` row (an empty/error/loading state, e.g.
69
72
  // `DataTable`'s) — it has no row to hover, so it shouldn't tint like one.
70
73
  // Black/white wash, same convention as Popover/Menu/TreeSelect's own row
@@ -93,11 +96,11 @@ const tableVariants = cva(
93
96
  /** Pin the whole `<thead>` to the top of the scroll region; `backdrop-blur`
94
97
  * keeps scrolled body rows legible behind the translucent header fill. */
95
98
  const stickyHeaderClasses =
96
- "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10 [&_thead]:backdrop-blur-lg"
99
+ "[&_thead]:sticky [&_thead]:top-0 [&_thead]:z-10 [&_thead]:backdrop-blur-lg dark:[&_thead]:bg-brand-950/85"
97
100
 
98
101
  /** Pin the whole `<tfoot>` (e.g. a totals row) to the bottom of the scroll region. */
99
102
  const stickyFooterClasses =
100
- "[&_tfoot]:sticky [&_tfoot]:bottom-0 [&_tfoot]:z-10 [&_tfoot]:backdrop-blur-lg"
103
+ "[&_tfoot]:sticky [&_tfoot]:bottom-0 [&_tfoot]:z-10 [&_tfoot]:backdrop-blur-lg dark:[&_tfoot]:bg-brand-950/85"
101
104
 
102
105
  /** `Table`'s density scale — the kit's canonical `Size` (xs–xl). */
103
106
  export type TableSize = Size
@@ -182,7 +185,7 @@ const TableToolbar = ({ className, testId, ...rest }: TableToolbarProps) => (
182
185
  {...props({ "data-testid": testId })}
183
186
  {...rest}
184
187
  className={cn(
185
- "flex shrink-0 items-center justify-between gap-2 border-b border-brand-900/20 px-3 ps-5 py-3 dark:border-white/15",
188
+ "flex shrink-0 items-center justify-between gap-2 border-b border-brand-900/20 px-3 ps-5 py-3 dark:border-white/8",
186
189
  className,
187
190
  )}
188
191
  />
@@ -47,28 +47,62 @@ const themeIconVariants = cva(
47
47
  // intentionally not reused.
48
48
  filled:
49
49
  "bg-(--c-solid)/15 text-(--c-text) border-[color-mix(in_oklab,var(--c-solid)_35%,black_65%)]",
50
- light: "bg-(--c-soft) text-(--c-text) border-transparent",
51
- outline: "bg-transparent text-(--c-text) border-(--c-solid)",
52
- subtle: "bg-transparent text-(--c-text) border-transparent",
50
+ // `light`, `outline` and `subtle` paint through two local properties,
51
+ // `--theme-icon-fill` and `--theme-icon-glyph`, and only the
52
+ // properties change per theme and palette. The `bg-*`/`text-*` stay
53
+ // plain utilities, so a caller's `className` colour replaces them
54
+ // through `cn`: a `dark:` or `data-color` text class would outrank it.
55
+ //
56
+ // Figma tints a hued tile with its solid shade at 30%
57
+ // (`bg-<hue>-secondary`), as Badge's `light` does: `--c-soft` is the
58
+ // -50/-950 end of the scale and fades into the page in both themes.
59
+ // The dark glyph is that solid shade (`fg-<hue>-primary`); the light
60
+ // theme draws it in the palette's text step instead, as Badge does,
61
+ // since a -500 glyph on its own tint over white falls under 3:1 for
62
+ // yellow, orange and green. Neutral (also the no-`color` default,
63
+ // which resolves to the neutral mirror on :root) fills with the
64
+ // black/white-16 overlay its own `--c-soft` already is, and draws its
65
+ // glyph in the solid black/white.
66
+ light: [
67
+ "bg-(--theme-icon-fill) text-(--theme-icon-glyph) border-transparent",
68
+ "[--theme-icon-fill:color-mix(in_oklab,var(--c-solid)_30%,transparent)] [--theme-icon-glyph:var(--c-text)] dark:[--theme-icon-glyph:var(--c-solid)]",
69
+ "not-data-color:[--theme-icon-fill:var(--c-soft)] data-[color=neutral]:[--theme-icon-fill:var(--c-soft)] data-[color=gray]:[--theme-icon-fill:var(--c-soft)]",
70
+ "not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]",
71
+ ],
72
+ // A hued glyph takes the palette's text step (Figma `fg-<hue>-secondary`,
73
+ // the -300). Neutral's text step is the 80% secondary white, but Figma
74
+ // draws its glyph in `fg-primary` — full white, which is neutral's
75
+ // solid shade (black in the light theme).
76
+ outline: [
77
+ "bg-transparent text-(--theme-icon-glyph) border-(--c-solid) [--theme-icon-glyph:var(--c-text)]",
78
+ "not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]",
79
+ ],
80
+ subtle: [
81
+ "bg-transparent text-(--theme-icon-glyph) border-transparent [--theme-icon-glyph:var(--c-text)]",
82
+ "not-data-color:[--theme-icon-glyph:var(--c-solid)] data-[color=neutral]:[--theme-icon-glyph:var(--c-solid)] data-[color=gray]:[--theme-icon-glyph:var(--c-solid)]",
83
+ ],
53
84
  // Palette-independent neutral surface. Unlike ActionIcon's
54
85
  // high-contrast inverted `default` (a black/white button look),
55
86
  // this stays a muted card in both themes. It sits on the kit's
56
- // translucent surface recipe (the quiet `bg-black/3 dark:bg-white/4`
57
- // fill plus the hairline `border-brand-900/20 dark:border-white/15`,
58
- // as `Kbd` and `Card` do) rather than an opaque gray step, so the tile
87
+ // translucent surface (the quiet `bg-black/3 dark:bg-white/4` fill
88
+ // `Kbd` and `Card` share, edged with Figma's `border-secondary`,
89
+ // `dark:border-white/16`) rather than an opaque gray step, so the tile
59
90
  // reads on whatever surface hosts it. Light mode darkens because a
60
91
  // bare `bg-white/4` vanishes on a near-white page.
61
92
  default: [
62
93
  "bg-black/3 text-brand-900/70 border-brand-900/20",
63
- "dark:bg-white/4 dark:text-white/80 dark:border-white/15",
94
+ "dark:bg-white/4 dark:text-white/80 dark:border-white/16",
64
95
  ],
65
96
  },
97
+ // Figma (ThemeIcon, node 17583-16687): the glyph is 12/14/16/18/22px in
98
+ // a 28/32/36/40/48px tile — under half the tile, so the tile reads as a
99
+ // frame around the icon, not as the icon's own padding.
66
100
  size: {
67
- xs: "h-7 [&_svg]:size-5",
68
- sm: "h-8 [&_svg]:size-5.5",
69
- md: "h-9 [&_svg]:size-6",
70
- lg: "h-10 [&_svg]:size-7",
71
- xl: "h-12 [&_svg]:size-8",
101
+ xs: "h-7 [&_svg]:size-3",
102
+ sm: "h-8 [&_svg]:size-3.5",
103
+ md: "h-9 [&_svg]:size-4",
104
+ lg: "h-10 [&_svg]:size-4.5",
105
+ xl: "h-12 [&_svg]:size-5.5",
72
106
  },
73
107
  radius: {
74
108
  xs: "rounded-xs",
package/src/theme.css CHANGED
@@ -132,19 +132,19 @@
132
132
  --color-lime-900: #2b5314;
133
133
  --color-lime-950: #15290a;
134
134
 
135
- /* Green */
135
+ /* Green — Figma « _Primitives / Success » (42 UI Kit V3). */
136
136
  --color-green-25: #f6fef9;
137
- --color-green-50: #edfcf2;
138
- --color-green-100: #d3f8df;
139
- --color-green-200: #aaf0c4;
140
- --color-green-300: #73e2a3;
141
- --color-green-400: #3ccb7f;
137
+ --color-green-50: #ecfdf3;
138
+ --color-green-100: #dcfae6;
139
+ --color-green-200: #abefc6;
140
+ --color-green-300: #75e0a7;
141
+ --color-green-400: #47cd89;
142
142
  --color-green-500: #17b26a;
143
143
  --color-green-600: #079455;
144
144
  --color-green-700: #067647;
145
- --color-green-800: #095c37;
146
- --color-green-900: #084c2e;
147
- --color-green-950: #052e1c;
145
+ --color-green-800: #085d3a;
146
+ --color-green-900: #074d31;
147
+ --color-green-950: #053321;
148
148
 
149
149
  /* Teal */
150
150
  --color-teal-25: #f6fefc;
@@ -202,19 +202,20 @@
202
202
  --color-purple-900: #3e1c96;
203
203
  --color-purple-950: #27115f;
204
204
 
205
- /* Pink */
206
- --color-pink-25: #fef6fb;
207
- --color-pink-50: #fdf2fa;
208
- --color-pink-100: #fce7f6;
209
- --color-pink-200: #fcceee;
210
- --color-pink-300: #faa7e0;
211
- --color-pink-400: #f670c7;
212
- --color-pink-500: #ee46bc;
213
- --color-pink-600: #dd2590;
214
- --color-pink-700: #c11574;
215
- --color-pink-800: #9e165f;
216
- --color-pink-900: #851651;
217
- --color-pink-950: #4e0d30;
205
+ /* Pink — Figma « _Primitives / Pink » (42 UI Kit V3): a mauve, not the
206
+ Untitled UI fuchsia this ramp started from. */
207
+ --color-pink-25: #fcf8fb;
208
+ --color-pink-50: #fbf4f9;
209
+ --color-pink-100: #f7ecf5;
210
+ --color-pink-200: #f2d8ed;
211
+ --color-pink-300: #e7bade;
212
+ --color-pink-400: #d88ec9;
213
+ --color-pink-500: #c86cb6;
214
+ --color-pink-600: #b44e9f;
215
+ --color-pink-700: #9a3c87;
216
+ --color-pink-800: #7f3570;
217
+ --color-pink-900: #6c2f60;
218
+ --color-pink-950: #3f1c38;
218
219
 
219
220
  /* Rose */
220
221
  --color-rose-25: #fff5f6;
@@ -1417,7 +1418,11 @@ body {
1417
1418
  color-mix(in oklch, var(--color-brand-700) 13%, transparent),
1418
1419
  transparent 70%
1419
1420
  );
1420
- --ambient-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.4' numOctaves='2' stitchTiles='stitch' result='t'/%3E%3CfeColorMatrix in='t' type='matrix' values='0 0 0 0 0.573 0 0 0 0 0.69 0 0 0 0 0.98 0 0 0 1 0' result='c'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='gamma' amplitude='0.09' exponent='2' offset='0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
1421
+ /* The dark grain, tuned against Figma's « Background / Cosmos » (2026-10-29): fine
1422
+ (frequency 1, a pixel-sized grain like Figma's tiled noise) and lightly coloured — each
1423
+ channel swings with its own turbulence around the same light-blue tint (×2, ×2, ×1.6),
1424
+ where Figma's grain is speckled blue and violet. Same weight: one inline SVG, no image. */
1425
+ --ambient-noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1' numOctaves='2' stitchTiles='stitch' result='t'/%3E%3CfeColorMatrix in='t' type='matrix' values='2 0 0 0 -0.427 0 2 0 0 -0.31 0 0 1.6 0 0.18 0 0 0 1 0' result='c'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='gamma' amplitude='0.1' exponent='2' offset='0'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
1421
1426
  }
1422
1427
 
1423
1428
  /* The starfield's motion (`withStarfield`, see ambient-background/starfield.tsx).
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/card/card.tsx"],"names":[],"mappings":";;;;;;;;AAcA,IAAM,YAAA,GAAe,IAAI,mCAAA,EAAqC;AAAA,EAC5D,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAcP,OAAA,EAAS;AAAA,QACP,+CAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,MAAA,EAAQ,uDAAA;AAAA,MACR,KAAA,EAAO,iDAAA;AAAA,MACP,OAAA,EAAS,+CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAMT,QAAA,EAAU;AAAA,QACR,gDAAA;AAAA,QACA,kBAAA,CAAmB,OAAA;AAAA,QACnB,oFAAA;AAAA,QACA,uBAAA;AAAA,QACA,mEAAA;AAAA,QACA;AAAA;AACF,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA,EAAM,KAAA;AAAA,MACN,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI,KAAA;AAAA,MACJ,EAAA,EAAI;AAAA;AACN,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,SAAA;AAAA,IACT,OAAA,EAAS;AAAA;AAEb,CAAC,CAAA;AA0CD,IAAM,gBAAgB,CAAC;AAAA,EACrB,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,GAAG;AACL,CAAA,KAAiB;AACf,EAAA,MAAM,aAAa,OAAA,KAAY,UAAA;AAE/B,EAAA,uBACE,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AAA;AAAA,EACb,OAAA,EAAS,WAAA;AAAA,EACT,MAAA,EAAQ;AACV,CAAC","file":"chunk-2MXWEIMD.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport {\n buildGradientVars,\n GRADIENT_DIR_BEFORE_CLASS,\n type GradientDir,\n type GradientProps,\n} from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\nconst cardVariants = cva(\"flex flex-col rounded-card border\", {\n variants: {\n variant: {\n // Matches the 42 UI Kit Figma's card chrome — navy text in light\n // theme, white text in dark theme (a straight inversion, confirmed\n // against Figma's own light-mode test frame). The 4% white overlay\n // (Figma's own bg-primary token) is Figma's dark-theme elevation\n // tint — meant to sit on an already-dark page, lightening whatever's\n // behind it rather than imposing a flat hue — used here in both\n // themes for a consistently subtle surface.\n //\n // The border is the kit's hairline, `border-brand-900/20\n // dark:border-white/15` — the same pair `Input`'s shell,\n // `SegmentGroup` and `ChoiceCardGroup` draw. It used to sit at\n // /30 ÷ /10, brand-tinted but off by an opacity step from everything\n // else, left over from an earlier partial alignment pass.\n default: [\n \"bg-white/4 text-brand-950 border-brand-900/20\",\n \"dark:text-white dark:border-white/15\",\n ],\n filled: \"bg-(--c-solid) text-(--c-on-solid) border-(--c-solid)\",\n light: \"bg-(--c-soft) text-(--c-text) border-(--c-soft)\",\n outline: \"bg-white/4 text-(--c-text) border-(--c-solid)\",\n // from-(--card-gradient-from) / to-(--card-gradient-to) read CSS vars\n // cascaded from the card element's inline style via buildGradientVars().\n // The ring inherits the host's radius per corner, so a `className`\n // radius reshapes it too. `-inset-px` spans the transparent border, so\n // the ring covers the border box, the box that radius shapes.\n gradient: [\n \"relative isolate border-transparent bg-white/4\",\n TEXT_COLOR_CLASSES.primary,\n \"before:absolute before:-inset-px before:-z-10 before:rounded-[inherit] before:p-px\",\n \"before:bg-linear-to-r\",\n \"before:from-(--card-gradient-from) before:to-(--card-gradient-to)\",\n \"before:mask before:mask-exclude\",\n ],\n },\n padding: {\n none: \"p-0\",\n xs: \"p-2\",\n sm: \"p-3\",\n md: \"p-4\",\n lg: \"p-6\",\n xl: \"p-8\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n padding: \"md\",\n },\n})\n\nexport type CardVariant = NonNullable<VariantProps<typeof cardVariants>[\"variant\"]>\n\nexport type { GradientDir, GradientProps }\n\nexport type CardProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof cardVariants> &\n WithTestId & {\n color?: Color\n /**\n * Gradient config. Only applied when `variant=\"gradient\"`.\n * Mirrors Tailwind's from-* / to-* / via-* utilities via CSS vars so\n * the ::before pseudo-element gradient is fully controlled from props.\n * Unset fields fall back to purple-300 → pink-400, to-r.\n */\n gradient?: GradientProps\n }\n\n/**\n * Card — a bordered content surface. Combines a `variant` (shape) with a\n * `color` (palette) like the rest of the kit, and exposes its regions as\n * namespaced parts: `Card.Header`, `Card.Title`, `Card.Description`,\n * `Card.Content`, `Card.Footer`. Use `padding=\"none\"` when composing the parts\n * so they own the spacing.\n *\n * <Card variant=\"light\" color=\"green\" padding=\"none\">\n * <Card.Header>\n * <Card.Title>Title</Card.Title>\n * <Card.Description>Supporting text.</Card.Description>\n * </Card.Header>\n * <Card.Content>Body</Card.Content>\n * <Card.Footer><Button size=\"sm\">Action</Button></Card.Footer>\n * </Card>\n *\n * `Card.Header`, `Card.Description`, and `Card.Footer` each take a `withBorder`\n * boolean (default `false`) that draws a separator on the edge facing the\n * content — bottom for `Header`, top for `Description` / `Footer` — for when\n * a section needs visual separation from its neighbor. `Card.Content` has no\n * `withBorder`: it sits between the two, so `Header` / `Footer` already own\n * that edge.\n */\nconst CardComponent = ({\n className,\n variant,\n padding,\n color,\n gradient,\n style,\n testId,\n ...rest\n}: CardProps) => {\n const isGradient = variant === \"gradient\"\n\n return (\n <ark.div\n data-color={isGradient ? undefined : color}\n style={\n isGradient\n ? {\n ...buildGradientVars(gradient, {\n fromVar: \"--card-gradient-from\",\n toVar: \"--card-gradient-to\",\n viaVar: \"--card-gradient-via\",\n fromDefault: \"var(--color-purple-300)\",\n toDefault: \"var(--color-pink-400)\",\n }),\n ...style,\n }\n : style\n }\n className={cn(\n cardVariants({ variant, padding }),\n isGradient && gradient?.dir && GRADIENT_DIR_BEFORE_CLASS[gradient.dir],\n isGradient && gradient?.via && \"before:via-(--card-gradient-via)\",\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n\nexport type CardHeaderProps = HTMLArkProps<\"div\"> & WithTestId & { withBorder?: boolean }\n\nconst CardHeader = ({ className, withBorder, testId, ...rest }: CardHeaderProps) => (\n <ark.div\n className={cn(\n \"flex flex-col gap-1 px-4 py-3\",\n { \"border-b border-brand-900/20 dark:border-white/15\": withBorder },\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type CardTitleProps = HTMLArkProps<\"h3\"> & WithTestId\n\nconst CardTitle = ({ className, testId, ...rest }: CardTitleProps) => (\n <ark.h3\n className={cn(\"font-semibold tracking-normal\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type CardDescriptionProps = HTMLArkProps<\"p\"> & WithTestId & { withBorder?: boolean }\n\nconst CardDescription = ({ className, withBorder, testId, ...rest }: CardDescriptionProps) => (\n <ark.p\n className={cn(\n \"text-sm\",\n TEXT_COLOR_CLASSES.muted,\n { \"border-t border-brand-900/20 dark:border-white/15\": withBorder },\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type CardContentProps = HTMLArkProps<\"div\"> & WithTestId\n\nconst CardContent = ({ className, testId, ...rest }: CardContentProps) => (\n <ark.div\n className={cn(\"flex-1 px-4 py-3\", className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport type CardFooterProps = HTMLArkProps<\"div\"> & WithTestId & { withBorder?: boolean }\n\nconst CardFooter = ({ className, withBorder, testId, ...rest }: CardFooterProps) => (\n <ark.div\n className={cn(\n \"flex items-center justify-end gap-2 px-4 py-3\",\n { \"border-t border-brand-900/20 dark:border-white/15\": withBorder },\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n\nexport const Card = Object.assign(CardComponent, {\n Header: CardHeader,\n Title: CardTitle,\n Description: CardDescription,\n Content: CardContent,\n Footer: CardFooter,\n})\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/checkbox/checkbox.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;AA6CO,IAAM,aAAA,GAAqD;AAAA,EAChE,KAAA,sBAAQ,SAAA,EAAA,EAAU,CAAA;AAAA,EAClB,aAAA,kBAAe,GAAA,CAAC,KAAA,EAAA,EAAM,SAAA,EAAW,UAAA,EAAY;AAC/C,CAAA;AAwDA,IAAM,mBAAA,GAAsB,CAAC,EAAE,GAAA,EAAK,QAAO,KAA6C;AACtF,EAAA,MAAM,EAAE,mBAAmB,WAAA,EAAa,GAAG,WAAU,GAAI,cAAA,CAAe,iBAAiB,CAAA;AACzF,EAAA,2BAAQA,UAAA,CAAI,WAAA,EAAJ,EAAgB,GAAA,EAAU,MAAA,EAAiB,GAAG,SAAA,EAAW,CAAA;AACnE,CAAA;AAEO,IAAM,WAAW,CAAC;AAAA,EACvB,OAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,KAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA,IAAA,GAAO,IAAA;AAAA,EACP,OAAA;AAAA,EACA,KAAA;AAAA,EACA,IAAA;AAAA,EACA,KAAA;AAAA,EACA,EAAA;AAAA,EACA,GAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,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A;AAAA,wBAAA,IAAA,CAACA,UAAA,CAAI,OAAA,EAAJ,EAAY,SAAA,EAAW,EAAA,CAAG,gBAAA,CAAiB,EAAE,IAAA,EAAM,OAAA,EAAS,CAAA,EAAG,UAAA,EAAY,OAAO,CAAA,EACjF,QAAA,EAAA;AAAA,0BAAA,GAAA,CAACA,UAAA,CAAI,SAAA,EAAJ,EAAe,QAAA,EAAA,KAAA,CAAM,KAAA,EAAM,CAAA;AAAA,8BAC3BA,UAAA,CAAI,SAAA,EAAJ,EAAc,aAAA,EAAa,IAAA,EAAE,gBAAM,aAAA,EAAc;AAAA,SAAA,EACpD,CAAA;AAAA,QAEC,QAAA,mBACC,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,EAAA,CAAG,SAAA,CAAU,EAAE,IAAA,EAAM,CAAA,EAAG,UAAA,EAAY,KAAK,CAAA,EACtD,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA,CAAC,cAAW,WAAA,EAA0B,KAAA,EAAc,MAClD,QAAA,kBAAA,GAAA,CAAC,mBAAA,EAAA,EAAoB,GAAA,EAAU,MAAA,EAAgB,CAAA,EACjD;AAAA,SAAA,EACF,oBAEA,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,UAAA,SAAA;AAAA,0BACD,GAAA;AAAA,YAAC,UAAA;AAAA,YAAA;AAAA,cACC,WAAA;AAAA,cACA,KAAA;AAAA,cACA,IAAA;AAAA,cACA,WAAW,UAAA,EAAY,KAAA;AAAA,cAEvB,QAAA,kBAAA,GAAA,CAAC,mBAAA,EAAA,EAAoB,GAAA,EAAU,MAAA,EAAgB;AAAA;AAAA;AACjD,SAAA,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-6VYGK3Q3.js","sourcesContent":["\"use client\"\n\nimport { Checkbox as Ark } from \"@ark-ui/react/checkbox\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Minus } from \"lucide-react\"\nimport type { FocusEvent, ReactNode, Ref } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { Size } from \"../../lib/sizes\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { FieldShell, fieldA11yProps, fieldLabel, fieldRoot, requiredMark } from \"../field/field\"\nimport { CheckIcon } from \"../popover/icons\"\nimport { type ControlIndicatorVariant, controlIndicator } from \"./control\"\n\n/**\n * Checkbox — a single boolean (or tri-state) control on Ark UI's Checkbox\n * machine. The label sits inline beside the box, rendered through the\n * checkbox's own `Ark.Label` part (not `Field`'s) so it stays correctly\n * wired to the hidden input's `aria-labelledby` and — critically — carries no\n * layout footprint when it's visually hidden (e.g. `classNames.label:\n * \"sr-only\"`): an absolutely-positioned flex child isn't a flex item at all,\n * so it can't pick up the root's `gap-2`. `description` / `error` live below\n * it via the shared `Field` scaffold, so a `Checkbox` is accessible and\n * complete on its own. Implements the kit's `FormControlProps` contract: the\n * `ref` and `onBlur` land on the submittable hidden `<input>`, and `name`\n * wires it into native form submission.\n *\n * - The checked state is `boolean | \"indeterminate\"`; `onCheckedChange`\n * hands you that next value directly (the indeterminate state never sets\n * itself — drive it from the parent, e.g. a \"select all\" header).\n * - `invalid` is OR'd with `error != null`, matching the rest of the family,\n * so a form library can flip the red state independently of the message.\n *\n * Two `variant`s decide the checked fill: `default` is a neutral, monochrome\n * box (palette-independent), while `filled` tints the checked fill with the\n * active palette via `data-color` + the `--c-solid` slot var. The box is\n * palette-independent at rest, and the focus ring is always the brand ring.\n */\n\nexport type CheckboxIconSlot = \"check\" | \"indeterminate\"\nexport type CheckboxIcons = IconMap<CheckboxIconSlot>\n\n/** The default marks: a check, and a dash for the indeterminate state. */\nexport const DEFAULT_ICONS: Record<CheckboxIconSlot, ReactNode> = {\n check: <CheckIcon />,\n indeterminate: <Minus className={iconStroke} />,\n}\n\nexport type CheckboxProps = WithTestId & {\n /** Controlled checked state. `\"indeterminate\"` renders the partial mark. */\n checked?: boolean | \"indeterminate\"\n /** Uncontrolled initial checked state. */\n defaultChecked?: boolean | \"indeterminate\"\n /** Fires with the next checked state (a value, not a DOM event). */\n onCheckedChange?: (checked: boolean | \"indeterminate\") => void\n /** Inline label beside the box. */\n label?: ReactNode\n /** Helper text above the control. */\n description?: ReactNode\n /** Error message below the control; its presence sets the invalid state. */\n error?: ReactNode\n /** Required flag (and, with a label, the red asterisk). */\n required?: boolean\n /** Red invalid state, OR'd with `error != null`. */\n invalid?: boolean\n /** Dims and blocks interaction. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n size?: Size\n /** Checked-fill treatment: `default` (monochrome) or `filled` (palette-colored). */\n variant?: ControlIndicatorVariant\n color?: Color\n /** Field name for native form submission. */\n name?: string\n /** Submitted value when checked (defaults to `\"on\"`). */\n value?: string\n /** Explicit id for label association. */\n id?: string\n /** Lands on the hidden `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the hidden `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n /** Replaces the marks: `check` and `indeterminate`. A missing key keeps its default. */\n icons?: CheckboxIcons\n className?: string\n classNames?: {\n root?: string\n control?: string\n label?: string\n field?: string\n }\n}\n\n/**\n * The real, submittable hidden `<input>`, split out so it reads the `Field` context from *inside*\n * the wrapping `FieldShell` — `Checkbox` itself renders that shell, so calling `useFieldContext()`\n * at its own top level would run too early. Same pattern as `Switch`: `fieldA11yProps` points\n * `aria-describedby` at the error once invalid (Ark's own tracking doesn't reliably catch up) and\n * adds `aria-errormessage`. Its `aria-labelledby` is left out: this `Field` never renders a label\n * (the checkbox's own `Ark.Label` names the input), so it would point at nothing.\n */\nconst CheckboxHiddenInput = ({ ref, onBlur }: Pick<CheckboxProps, \"ref\" | \"onBlur\">) => {\n const { \"aria-labelledby\": _unrendered, ...described } = fieldA11yProps(useFieldContext())\n return <Ark.HiddenInput ref={ref} onBlur={onBlur} {...described} />\n}\n\nexport const Checkbox = ({\n checked,\n defaultChecked,\n onCheckedChange,\n label,\n description,\n error,\n required,\n invalid,\n disabled,\n readOnly,\n size = \"md\",\n variant,\n color,\n name,\n value,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n icons: iconsProp,\n}: CheckboxProps) => {\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n // Red state is driven independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n\n // A visible label above description/error needs the two grouped into one\n // flex-col item, or they'd land side by side in the root's row instead of\n // stacked. Label-only (incl. sr-only) never needs this extra wrapper.\n const hasStack = label != null && (description != null || error != null)\n\n const labelNode = label != null && (\n <Ark.Label\n className={cn(fieldLabel({ size }), !hasStack && \"min-w-0 flex-1\", classNames?.label)}\n >\n {label}\n {required && (\n <span aria-hidden=\"true\" {...requiredMark}>\n *\n </span>\n )}\n </Ark.Label>\n )\n\n return (\n <Ark.Root\n checked={checked}\n defaultChecked={defaultChecked}\n onCheckedChange={onCheckedChange ? (d) => onCheckedChange(d.checked) : undefined}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n name={name}\n value={value}\n id={id}\n data-color={color}\n {...props({ \"data-testid\": testId })}\n // `relative` contains the absolutely positioned hidden input, which would\n // otherwise escape any scroller this control sits in.\n className={cn(\n \"relative inline-flex items-center gap-2 select-none\",\n className,\n classNames?.root,\n )}\n >\n <Ark.Control className={cn(controlIndicator({ size, variant }), classNames?.control)}>\n <Ark.Indicator>{icons.check}</Ark.Indicator>\n <Ark.Indicator indeterminate>{icons.indeterminate}</Ark.Indicator>\n </Ark.Control>\n\n {hasStack ? (\n <div className={cn(fieldRoot({ size }), classNames?.field)}>\n {labelNode}\n <FieldShell description={description} error={error} size={size}>\n <CheckboxHiddenInput ref={ref} onBlur={onBlur} />\n </FieldShell>\n </div>\n ) : (\n <>\n {labelNode}\n <FieldShell\n description={description}\n error={error}\n size={size}\n className={classNames?.field}\n >\n <CheckboxHiddenInput ref={ref} onBlur={onBlur} />\n </FieldShell>\n </>\n )}\n </Ark.Root>\n )\n}\n"]}
@@ -1,95 +0,0 @@
1
- import { props } from './chunk-WYCMIIRR.js';
2
- import { focusStyles } from './chunk-C6NVU4F7.js';
3
- import { cn } from './chunk-4ASNIDV7.js';
4
- import { ark } from '@ark-ui/react';
5
- import { cva } from 'class-variance-authority';
6
- import { jsx } from 'react/jsx-runtime';
7
-
8
- var themeIconVariants = cva(
9
- [
10
- "inline-flex items-center justify-center",
11
- "aspect-square shrink-0 select-none",
12
- "rounded-lg border",
13
- "[&_svg]:shrink-0 [&_svg]:pointer-events-none",
14
- // Inert on the default non-focusable <div>; applies once `asChild`
15
- // renders ThemeIcon onto a real <a>/<button>. See `focusStyles`.
16
- focusStyles()
17
- ],
18
- {
19
- variants: {
20
- variant: {
21
- // A translucent wash of `--c-solid` (not the opaque token) so the
22
- // fill blends with whatever surface it sits on instead of reading
23
- // as a painted CTA block. The border mixes in black on top of that
24
- // same var — a fixed darkening, not another opacity step of it —
25
- // so it reads as a recessed edge in both themes; some colors (neutral
26
- // in particular) have a dark-mode `--c-solid` that's lighter than
27
- // its own soft/text steps, which would flip a same-var-opacity
28
- // border the wrong way. This is the ThemeIcon-specific reading of
29
- // "filled": raised, not loud. Button/Badge/ActionIcon's `filled`
30
- // (opaque bg-(--c-solid)) would look like a button here —
31
- // intentionally not reused.
32
- filled: "bg-(--c-solid)/15 text-(--c-text) border-[color-mix(in_oklab,var(--c-solid)_35%,black_65%)]",
33
- light: "bg-(--c-soft) text-(--c-text) border-transparent",
34
- outline: "bg-transparent text-(--c-text) border-(--c-solid)",
35
- subtle: "bg-transparent text-(--c-text) border-transparent",
36
- // Palette-independent neutral surface. Unlike ActionIcon's
37
- // high-contrast inverted `default` (a black/white button look),
38
- // this stays a muted card in both themes. It sits on the kit's
39
- // translucent surface recipe (the quiet `bg-black/3 dark:bg-white/4`
40
- // fill plus the hairline `border-brand-900/20 dark:border-white/15`,
41
- // as `Kbd` and `Card` do) rather than an opaque gray step, so the tile
42
- // reads on whatever surface hosts it. Light mode darkens because a
43
- // bare `bg-white/4` vanishes on a near-white page.
44
- default: [
45
- "bg-black/3 text-brand-900/70 border-brand-900/20",
46
- "dark:bg-white/4 dark:text-white/80 dark:border-white/15"
47
- ]
48
- },
49
- size: {
50
- xs: "h-7 [&_svg]:size-5",
51
- sm: "h-8 [&_svg]:size-5.5",
52
- md: "h-9 [&_svg]:size-6",
53
- lg: "h-10 [&_svg]:size-7",
54
- xl: "h-12 [&_svg]:size-8"
55
- },
56
- radius: {
57
- xs: "rounded-xs",
58
- sm: "rounded-sm",
59
- md: "rounded-md",
60
- lg: "rounded-lg",
61
- xl: "rounded-xl",
62
- full: "rounded-full"
63
- }
64
- },
65
- defaultVariants: {
66
- variant: "default",
67
- size: "md",
68
- radius: "md"
69
- }
70
- }
71
- );
72
- var ThemeIcon = ({
73
- className,
74
- variant,
75
- size,
76
- radius,
77
- color,
78
- asChild,
79
- testId,
80
- ...rest
81
- }) => /* @__PURE__ */ jsx(
82
- ark.div,
83
- {
84
- asChild,
85
- "data-color": color,
86
- "data-variant": variant ?? "default",
87
- className: cn(themeIconVariants({ variant, size, radius }), className),
88
- ...props({ "data-testid": testId }),
89
- ...rest
90
- }
91
- );
92
-
93
- export { ThemeIcon };
94
- //# sourceMappingURL=chunk-7CNDZZZ6.js.map
95
- //# sourceMappingURL=chunk-7CNDZZZ6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/theme-icon/theme-icon.tsx"],"names":[],"mappings":";;;;;;;AAuBA,IAAM,iBAAA,GAAoB,GAAA;AAAA,EACxB;AAAA,IACE,yCAAA;AAAA,IACA,oCAAA;AAAA,IACA,mBAAA;AAAA,IACA,8CAAA;AAAA;AAAA;AAAA,IAGA,WAAA;AAAY,GACd;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA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AAQ,CAAA,EAAG,SAAS,CAAA;AAAA,IACpE,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,IAClC,GAAG;AAAA;AACN","file":"chunk-7CNDZZZ6.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\n\n/**\n * ThemeIcon — square, non-interactive icon-display box. Visually related to\n * `ActionIcon` (same size/radius scales) but deliberately **not** its\n * (variant × color) look: every variant here is a muted, low-saturation\n * surface — just enough contrast to read as \"raised above the page,\" never\n * a vivid CTA-style fill. There's no hover state and no cursor affordance,\n * because this is a display, not a control.\n *\n * `asChild` renders the single child as the root, so it composes on top of\n * an interactive element (e.g. wrap a `Link`) when the icon itself needs to\n * be clickable. The kit's focus ring (`focusStyles`) rides along for that\n * case and stays inert on the default `<div>` — but reach for `ActionIcon`\n * when an interactive icon is the common case, since it also supplies the\n * `aria-label`, disabled and loading handling a real trigger needs.\n */\nconst themeIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"rounded-lg border\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // Inert on the default non-focusable <div>; applies once `asChild`\n // renders ThemeIcon onto a real <a>/<button>. See `focusStyles`.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n // A translucent wash of `--c-solid` (not the opaque token) so the\n // fill blends with whatever surface it sits on instead of reading\n // as a painted CTA block. The border mixes in black on top of that\n // same var — a fixed darkening, not another opacity step of it —\n // so it reads as a recessed edge in both themes; some colors (neutral\n // in particular) have a dark-mode `--c-solid` that's lighter than\n // its own soft/text steps, which would flip a same-var-opacity\n // border the wrong way. This is the ThemeIcon-specific reading of\n // \"filled\": raised, not loud. Button/Badge/ActionIcon's `filled`\n // (opaque bg-(--c-solid)) would look like a button here —\n // intentionally not reused.\n filled:\n \"bg-(--c-solid)/15 text-(--c-text) border-[color-mix(in_oklab,var(--c-solid)_35%,black_65%)]\",\n light: \"bg-(--c-soft) text-(--c-text) border-transparent\",\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)\",\n subtle: \"bg-transparent text-(--c-text) border-transparent\",\n // Palette-independent neutral surface. Unlike ActionIcon's\n // high-contrast inverted `default` (a black/white button look),\n // this stays a muted card in both themes. It sits on the kit's\n // translucent surface recipe (the quiet `bg-black/3 dark:bg-white/4`\n // fill plus the hairline `border-brand-900/20 dark:border-white/15`,\n // as `Kbd` and `Card` do) rather than an opaque gray step, so the tile\n // reads on whatever surface hosts it. Light mode darkens because a\n // bare `bg-white/4` vanishes on a near-white page.\n default: [\n \"bg-black/3 text-brand-900/70 border-brand-900/20\",\n \"dark:bg-white/4 dark:text-white/80 dark:border-white/15\",\n ],\n },\n size: {\n xs: \"h-7 [&_svg]:size-5\",\n sm: \"h-8 [&_svg]:size-5.5\",\n md: \"h-9 [&_svg]:size-6\",\n lg: \"h-10 [&_svg]:size-7\",\n xl: \"h-12 [&_svg]:size-8\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n radius: \"md\",\n },\n },\n)\n\nexport type ThemeIconVariant = NonNullable<VariantProps<typeof themeIconVariants>[\"variant\"]>\nexport type ThemeIconSize = NonNullable<VariantProps<typeof themeIconVariants>[\"size\"]>\nexport type ThemeIconRadius = NonNullable<VariantProps<typeof themeIconVariants>[\"radius\"]>\n\nexport type ThemeIconProps = HTMLArkProps<\"div\"> &\n VariantProps<typeof themeIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n }\n\nexport const ThemeIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n asChild,\n testId,\n ...rest\n}: ThemeIconProps) => (\n <ark.div\n asChild={asChild}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(themeIconVariants({ variant, size, radius }), className)}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n)\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/action-icon/action-icon.tsx"],"names":[],"mappings":";;;;;;;;;AAuCA,IAAM,kBAAA,GAAqB,GAAA;AAAA,EACzB;AAAA,IACE,yCAAA;AAAA,IACA,oCAAA;AAAA,IACA,qCAAA;AAAA,IACA,cAAA;AAAA,IACA,+CAAA;AAAA,IACA,0BAAA;AAAA,IACA,WAAA,EAAY;AAAA,IACZ,mEAAA;AAAA,IACA,4DAAA;AAAA,IACA,uCAAA;AAAA,IACA,sDAAA;AAAA,IACA;AAAA,GACF;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,MAAA,EAAQ;AAAA,UACN,oCAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,KAAA,EAAO;AAAA,UACL,uDAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,OAAA,EAAS;AAAA,UACP,mDAAA;AAAA,UACA;AAAA,SACF;AAAA,QACA,MAAA,EAAQ,CAAC,gCAAA,EAAkC,sCAAsC,CAAA;AAAA,QACjF,OAAA,EAAS;AAAA,UACP,8EAAA;AAAA,UACA;AAAA;AACF,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,4BAAA;AAAA,QACJ,EAAA,EAAI,8BAAA;AAAA,QACJ,EAAA,EAAI,4BAAA;AAAA,QACJ,EAAA,EAAI,6BAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACN;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,QACJ,EAAA,EAAI,YAAA;AAAA,Q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AAA,OAChB,CAAA;AAAA,MACA,GAAG,IAAA;AAAA,MAEH,QAAA,EAAA,OAAA,IAAW,UACV,kBAAA,CAAmB,QAAA,EAAU,sBAAM,GAAA,CAAC,OAAA,EAAA,EAAQ,KAAA,EAAO,IAAA,EAAM,CAAA,EAAI;AAAA,QAC3D,OAAA,EAAS;AAAA,OACV,CAAA,GACC,OAAA,uBACD,OAAA,EAAA,EAAQ,KAAA,EAAO,MAAM,CAAA,GAEtB;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-BE2LWUHY.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { MouseEvent } from \"react\"\nimport { withAsChildContent } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { Spinner } from \"../spinner/spinner\"\n\n/**\n * ActionIcon — square, icon-only sibling of `Button`.\n *\n * Same (variant × color) model as `Button`:\n * - `variant` picks the shape (filled / light / outline / subtle / default)\n * - `color` picks the palette (brand / gray / red / …)\n * - Color is delivered via `data-color` + the slot vars in `colors.css`,\n * so dark mode shade-shifts happen at the CSS layer.\n *\n * What's specific to ActionIcon:\n * - Forced 1:1 aspect ratio.\n * - Own `radius` scale (incl. `full` for circular FABs / like-buttons).\n * - Wider size scale (xs..xl) than Button — toolbar density matters here.\n *\n * The accessible name MUST come from `aria-label` (or `aria-labelledby`); the\n * icon children are decoration.\n *\n * `asChild` renders the single child with ActionIcon's styling. Ark's\n * factory clones exactly one element, so `loading`'s spinner replaces\n * *that* element's own children (`withAsChildContent`, `lib/as-child.ts`)\n * rather than the element itself. The `onClick` guard (`preventWhileLoading`)\n * goes on the same clone, since `disabled` doesn't do anything on an\n * arbitrary `asChild` element (e.g. an `<a>`) — same reason the `opacity-50`\n * dimming and `pointer-events-none` blocking are keyed off `data-loading`\n * rather than `:disabled` (see `Button`'s note on this).\n */\nconst actionIconVariants = cva(\n [\n \"inline-flex items-center justify-center\",\n \"aspect-square shrink-0 select-none\",\n \"font-medium uppercase tracking-wide\",\n \"no-underline\",\n \"rounded-action-icon border border-transparent\",\n \"transition-colors-radius\",\n focusStyles(),\n \"disabled:not-data-loading:pointer-events-none disabled:opacity-50\",\n \"data-disabled:pointer-events-none data-disabled:opacity-50\",\n \"not-data-loading:hover:cursor-pointer\",\n \"data-loading:cursor-progress data-loading:opacity-50\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n ],\n {\n variants: {\n variant: {\n filled: [\n \"bg-(--c-solid) text-(--c-on-solid)\",\n \"not-data-loading:hover:bg-(--c-solid-hover)\",\n ],\n light: [\n \"bg-(--c-soft) text-(--c-text) border-(--c-soft-hover)\",\n \"not-data-loading:hover:bg-(--c-soft-hover) not-data-loading:hover:border-(--c-solid)\",\n ],\n outline: [\n \"bg-transparent text-(--c-text) border-(--c-solid)\",\n \"not-data-loading:hover:bg-(--c-soft)\",\n ],\n subtle: [\"bg-transparent text-(--c-text)\", \"not-data-loading:hover:bg-(--c-soft)\"],\n default: [\n \"bg-brand-950 text-white border-brand-800 not-data-loading:hover:bg-brand-800\",\n \"dark:bg-white dark:text-brand-950 dark:border-white/80 dark:not-data-loading:hover:bg-white/80\",\n ],\n },\n size: {\n xs: \"h-7 text-xs [&_svg]:size-5\",\n sm: \"h-8 text-sm [&_svg]:size-5.5\",\n md: \"h-9 text-md [&_svg]:size-6\",\n lg: \"h-10 text-lg [&_svg]:size-7\",\n xl: \"h-12 text-xl [&_svg]:size-8\",\n },\n radius: {\n xs: \"rounded-xs\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type ActionIconVariant = NonNullable<VariantProps<typeof actionIconVariants>[\"variant\"]>\nexport type ActionIconSize = NonNullable<VariantProps<typeof actionIconVariants>[\"size\"]>\nexport type ActionIconRadius = NonNullable<VariantProps<typeof actionIconVariants>[\"radius\"]>\n\nexport type ActionIconProps = Omit<HTMLArkProps<\"button\">, \"color\"> &\n VariantProps<typeof actionIconVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Replace the icon with a spinner, mark the element as busy, and suppress\n * pointer interactions. Mirrors `Button`'s `loading`.\n */\n loading?: boolean\n }\n\n/** Mirrors `Button`'s `preventWhileLoading` — see the note there. */\nconst preventWhileLoading = (event: MouseEvent) => {\n event.preventDefault()\n event.stopPropagation()\n}\n\nexport const ActionIcon = ({\n className,\n variant,\n size,\n radius,\n color,\n loading = false,\n children,\n disabled,\n type,\n asChild,\n testId,\n onClick,\n ...rest\n}: ActionIconProps) => {\n const resolvedDisabled = disabled || loading\n const resolvedOnClick = loading ? preventWhileLoading : onClick\n\n return (\n <ark.button\n asChild={asChild}\n type={asChild ? type : (type ?? \"button\")}\n disabled={resolvedDisabled}\n data-color={color}\n data-variant={variant ?? \"default\"}\n className={cn(actionIconVariants({ variant, size, radius }), className)}\n onClick={resolvedOnClick}\n {...props({\n \"aria-busy\": loading,\n \"aria-disabled\": resolvedDisabled,\n \"data-loading\": loading,\n \"data-testid\": testId,\n })}\n {...rest}\n >\n {asChild && loading ? (\n withAsChildContent(children, () => <Spinner label={null} />, {\n onClick: preventWhileLoading,\n })\n ) : loading ? (\n <Spinner label={null} />\n ) : (\n children\n )}\n </ark.button>\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/kbd/kbd.tsx"],"names":[],"mappings":";;;;;;;;;AAmDA,IAAM,WAAA,GAAc,GAAA;AAAA,EAClB;AAAA,IACE,+CAAA;AAAA,IACA,+BAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKA,oCAAA;AAAA,IACA,sC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;AAAA,IACA,MAAA,EAAQ,OAAA;AAAA,IACR,YAAA,EAAc,aAAA;AAAA,IACd,GAAG;AAAA,GACL,GAAI,QAAA;AACJ,EAAA,uBACE,GAAA;AAAA,IAAC,GAAA,CAAI,GAAA;AAAA,IAAJ;AAAA,MACC,YAAA,EAAY,KAAA;AAAA,MACX,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG,IAAA;AAAA,MACJ,SAAA,EAAW,GAAG,WAAA,CAAY,EAAE,SAAS,IAAA,EAAM,GAAG,SAAS;AAAA;AAAA,GACzD;AAEJ","file":"chunk-DT6LKNZF.js","sourcesContent":["\"use client\"\n\nimport { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { ReactElement } from \"react\"\nimport { composeChildren } from \"../../lib/as-child\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { hotkeyCaps, type KbdTranslations, useApplePlatform } from \"../../lib/use-hotkey\"\n\n/**\n * Kbd — a keyboard-key / shortcut indicator (`<kbd>`).\n *\n * A client component only for `hotkey`, whose keys depend on the platform\n * (`[⌘] [K]` vs `[Ctrl] [K]`). It borrows Button's (variant × color) system so\n * a shortcut hint speaks the same accent language as the action it labels — but\n * unlike Button it is non-interactive: no hover treatment, no click handling,\n * just a key cap.\n *\n * The shape axis is the exact set Button exposes (filled / light / outline /\n * subtle / default), wired through the same `--c-*` slot vars — `color` routes\n * via a `data-color` attribute resolved in `colors.css`, so the cva matrix\n * enumerates variants only, never (variant × color) pairs. The default\n * treatment is the `default` variant: a neutral, bordered key-cap surface that\n * reads as a physical key regardless of `color` (pairing `default` with a color\n * is a no-op, mirroring Button/Badge).\n *\n * Sizing keeps single-character keys square via a per-size `min-w` equal to the\n * height, while wider labels (`Enter`, `Esc`, `⌘N`) grow horizontally. Padding\n * is symmetric, so a key reads the same in RTL.\n *\n * `asChild` (from `HTMLArkProps`) renders the single child as the root with\n * Kbd's styling merged in — e.g. `<Kbd asChild><a href=\"…\">⌘K</a></Kbd>`. The\n * kit's focus ring (`focusStyles`) comes along with it, so a Kbd composed onto\n * a real control is keyboard-visible without the caller restyling anything; on\n * a plain `<kbd>` those classes never match.\n *\n * `hotkey` draws a key combination the way the HTML spec marks one up: an\n * outer `<kbd>` for the whole combination holding one inner `<kbd>` per key,\n * with no `+` between them. The outer one is an unstyled inline-flex row;\n * each key is a full cap (`variant` / `size` / `color` apply to every cap),\n * so `\"mod+k\"` is two square caps. The rest of the props (`className`,\n * `testId`, `asChild`, `aria-*`, …) land on the outer `<kbd>`, which is the\n * element a layout positions; `color` is set there too and every cap reads\n * its slot vars from it. The words the caps show and speak (\"Ctrl\", \"Esc\",\n * \"Command\", \"Up Arrow\") are English unless `translations` replaces them, per\n * key (`KbdTranslations`); `formatHotkey` takes the same object.\n */\nconst kbdVariants = cva(\n [\n \"inline-flex items-center justify-center gap-1\",\n \"whitespace-nowrap select-none\",\n // Regular weight, not medium: the mono face (Kode Mono) has no ⌘ ⇧ ⌥ ↵\n // glyphs, so they fall back to a system font — and a 500 weight makes that\n // fallback resolve to its *bold* face (Menlo Bold), a heavy blot next to\n // the regular letters around it.\n \"font-mono font-normal leading-none\",\n \"rounded-md border border-transparent\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // A 1.5px stroke at every size: the icon is sized by CSS, so a stroke in\n // viewBox units would thin out at `size-3`. `non-scaling-stroke` keeps it in\n // screen pixels (lucide's `absoluteStrokeWidth` ignores CSS sizing).\n \"[&_svg]:stroke-[1.5] [&_svg_*]:[vector-effect:non-scaling-stroke]\",\n // A lone icon is narrower than the cap is tall, but the side padding\n // would push it past `min-w`: drop the padding so the cap stays square.\n \"has-[>svg:only-child]:px-0\",\n // Inert on the default non-focusable <kbd>; applies once `asChild`\n // renders Kbd onto a real <button>/<a>. See `focusStyles`.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) text-(--c-on-solid)\",\n light: \"bg-(--c-soft) text-(--c-text)\",\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)\",\n subtle: \"bg-transparent text-(--c-text)\",\n // The key cap sits on the kit's translucent surface recipe — a 3%/4%\n // overlay plus the hairline `border-brand-900/20 dark:border-white/15`,\n // the same pair `Input`'s default shell, `Card`, `Tabs` and\n // `ChoiceCardGroup` use. An opaque gray step can only ever be right on\n // the one background it was picked against, and a `Kbd` is most often\n // inlined into a Button, a Menu row or a tinted panel. Light mode\n // darkens (`bg-black/3`) because `bg-white/4` on a near-white page is\n // invisible; dark mode lightens. A 1px inset shade along the bottom\n // edge is the key-cap depth cue — the lip of a physical key — without\n // adding height. The label is the kit's secondary text, not full\n // contrast: a shortcut hint annotates the action, it is not the action.\n default: [\n \"bg-black/3 text-brand-900/70 border-brand-900/20\",\n \"shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.08)]\",\n \"dark:bg-white/4 dark:text-white/80 dark:border-white/15\",\n \"dark:shadow-[inset_0_-1px_0_0_rgb(0_0_0/0.35)]\",\n ],\n },\n // Type is one Tailwind step per size (12 / 14 / 16px), the scale of\n // the text a key sits beside — a 10px label left ⌘ and ↵ unreadable.\n //\n // A single character must fit `min-w` (= height) to stay square. Kode\n // Mono advances 0.6em per glyph, so glyph + 2 × padding + 2 × 1px border:\n // sm: 7.2 + 2 × 5 + 2 = 19.2 ≤ 20 (px-1.5 gave 21.2: one px too wide)\n // md: 8.4 + 2 × 6 + 2 = 22.4 ≤ 24\n // lg: 9.6 + 2 × 8 + 2 = 27.6 ≤ 28\n // Re-check these sums after a font, type step or padding change.\n size: {\n sm: \"h-5 min-w-5 px-1.25 text-xs [&_svg]:size-3\",\n md: \"h-6 min-w-6 px-1.5 text-sm [&_svg]:size-3.5\",\n lg: \"h-7 min-w-7 px-2 text-base [&_svg]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n)\n\nexport type KbdVariant = NonNullable<VariantProps<typeof kbdVariants>[\"variant\"]>\nexport type KbdSize = NonNullable<VariantProps<typeof kbdVariants>[\"size\"]>\n\n/** The outer `<kbd>` of a `hotkey` combination: a row of caps, unstyled itself.\n * `align-middle` sits it on the text it annotates the way a lone cap does. */\nconst kbdGroup = \"inline-flex items-center gap-0.5 align-middle\"\n\n/** With `hotkey`: the key words, merged per key onto `KBD_DEFAULT_TRANSLATIONS`. */\ntype KbdHotkeyTranslations = {\n /** The words the caps read as and are spoken by, merged per key onto the English\n * `KBD_DEFAULT_TRANSLATIONS`: `{ ctrl: \"Strg\", enter: \"Eingabe\" }`. Pass the same\n * object to `formatHotkey` / `hotkeyKeys` so plain text reads the same. */\n translations?: Partial<KbdTranslations>\n}\n\ntype KbdHotkeyProps =\n | { hotkey?: undefined; translations?: undefined }\n | (KbdHotkeyTranslations & {\n /** A `useHotkey` string to draw, one cap per key, the way the visitor's\n * platform writes it: `\"mod+k\"` is `[⌘] [K]` on Apple platforms and\n * `[Ctrl] [K]` elsewhere (see `hotkeyKeys`). A key with an icon (Shift,\n * Enter, Tab, the arrows, and ⌘ ⌥ ⌃ ⌫ on Apple) is drawn as one, with a\n * spoken name; Ctrl, Alt, Esc, Space (and Backspace off Apple) stay\n * words. Server-rendered as the non-Apple caps, then corrected on\n * hydration. The caps are the content, so it takes no children. */\n hotkey: string\n asChild?: false\n children?: never\n })\n | (KbdHotkeyTranslations & {\n hotkey: string\n /** With `hotkey`: the single child becomes the outer `<kbd>` of the\n * combination, the caps rendered inside it. */\n asChild: true\n children: ReactElement\n })\n\nexport type KbdProps = HTMLArkProps<\"kbd\"> &\n VariantProps<typeof kbdVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n } & KbdHotkeyProps\n\ntype KbdComboProps = KbdProps & { hotkey: string }\n\n/** `<Kbd hotkey>`: the combination's outer `<kbd>`, one cap per key inside. */\nconst KbdCombo = ({\n className,\n variant,\n size,\n color,\n testId,\n hotkey,\n translations,\n asChild,\n children,\n ...rest\n}: KbdComboProps) => {\n const apple = useApplePlatform()\n const caps = hotkeyCaps(hotkey, apple, translations).map(({ id, label, icon: Icon, name }) => (\n // A symbol is drawn (an icon, or the glyph where there is none) and its\n // name spoken: an svg says nothing, and `⌘` alone reads inconsistently.\n // `relative` holds the absolutely positioned `sr-only` inside the cap.\n // An icon cap drops its side padding to stay square, as a lone icon does\n // (the `sr-only` name beside the svg keeps `:only-child` from matching).\n <kbd\n key={id}\n className={cn(kbdVariants({ variant, size }), name && \"relative\", Icon && \"px-0\")}\n >\n {name ? (\n <>\n {Icon ? <Icon aria-hidden /> : <span aria-hidden>{label}</span>}\n <span className=\"sr-only\">{name}</span>\n </>\n ) : (\n label\n )}\n </kbd>\n ))\n return (\n <ark.kbd\n // A combination reads left to right in either direction, like the\n // single string it replaces.\n dir=\"ltr\"\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n asChild={asChild}\n className={cn(kbdGroup, className)}\n >\n {composeChildren(asChild, children, () => caps)}\n </ark.kbd>\n )\n}\n\nexport const Kbd = (allProps: KbdProps) => {\n if (allProps.hotkey !== undefined) return <KbdCombo {...allProps} />\n const {\n className,\n variant,\n size,\n color,\n testId,\n hotkey: _hotkey,\n translations: _translations,\n ...rest\n } = allProps\n return (\n <ark.kbd\n data-color={color}\n {...props({ \"data-testid\": testId })}\n {...rest}\n className={cn(kbdVariants({ variant, size }), className)}\n />\n )\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/badge/badge.tsx"],"names":[],"mappings":";;;;;;;;;AAsCA,IAAM,aAAA,GAAgB,GAAA;AAAA,EACpB;AAAA,IACE,0BAAA;AAAA,IACA,+BAAA;AAAA,IACA,uBAAA;AAAA,IACA,2BAAA;AAAA,IACA,8CAAA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AAAY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AC/E,SAAA,EAAW,EAAA;AAAA,QACT,aAAA,CAAc,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA;AAAA,QAC/B,UAAA,IAAc,QAAA,EAAU,GAAA,IAAO,kBAAA,CAAmB,SAAS,GAAG,CAAA;AAAA,QAC9D;AAAA,OACF;AAAA,MACC,GAAG,KAAA,CAAM,EAAE,aAAA,EAAe,QAAQ,CAAA;AAAA,MAClC,GAAG;AAAA;AAAA,GACN;AAEJ","file":"chunk-F342ZT7O.js","sourcesContent":["import { ark, type HTMLArkProps } from \"@ark-ui/react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"../../lib/cn\"\nimport type { Color } from \"../../lib/colors\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport {\n buildGradientVars,\n GRADIENT_DIR_CLASS,\n type GradientDir,\n type GradientProps,\n} from \"../../lib/gradient\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\n\n/**\n * Badge — compact inline label for a status, a count or a tag.\n *\n * Pure React Server Component. It borrows Button's (variant × color) system so\n * a chip and an action speak the same accent language, but it is a display\n * element: no hover treatment, no click handling, and it renders a `<span>`.\n *\n * `asChild` (from `HTMLArkProps`) renders the single child as the root with\n * Badge's styling merged in, which is how a badge becomes a real control —\n * either standalone or collapsed into another component's trigger:\n *\n * ```tsx\n * <HoverCard.Trigger asChild>\n * <Badge asChild variant=\"light\" aria-label=\"12 campuses\">\n * <button type=\"button\">12</button>\n * </Badge>\n * </HoverCard.Trigger>\n * ```\n *\n * That yields one DOM node that *is* the badge, keyboard-reachable, carrying\n * the kit's focus ring (`focusStyles`) and Badge's own radius — the caller\n * supplies no `className` for any of it.\n */\nconst badgeVariants = cva(\n [\n \"inline-flex items-center\",\n \"whitespace-nowrap select-none\",\n \"font-sans font-medium\",\n \"border border-transparent\",\n \"[&_svg]:shrink-0 [&_svg]:pointer-events-none\",\n // Inert on the default non-focusable <span> — `:focus-visible` never\n // matches it — and lights up as soon as `asChild` renders Badge onto a\n // real <button>/<a>, which is the composition the docs recommend.\n focusStyles(),\n ],\n {\n variants: {\n variant: {\n filled: \"bg-(--c-solid) text-(--c-on-solid)\",\n // Neutral by default; a `data-color` tint overrides it. Those rules\n // compile to `&[data-color]` (specificity 0,2,0), which beats both\n // the plain and the `dark:` neutral classes below (0,1,0 — `dark:`\n // is a `:where()` variant) regardless of source order.\n //\n // Figma (node 14950-143827) tints a hued badge with its solid shade\n // at 30% and borders it with the solid shade itself. `--c-soft` is\n // the wrong base for that: it is the -50/-950 end of the scale, so\n // at any opacity it fades into the page in both themes. Neutral is\n // the exception — Figma fills it with the translucent overlay that\n // neutral's own `--c-soft` already is (white/16 dark, black/16\n // light), so it takes that slot as-is.\n light: [\n \"bg-black/8 dark:bg-white/16\",\n TEXT_COLOR_CLASSES.primary,\n \"border-black/8 dark:border-white/15\",\n \"data-color:bg-(--c-solid)/30 data-color:text-(--c-text) data-color:border-(--c-solid)\",\n \"data-[color=neutral]:bg-(--c-soft)\",\n ],\n outline: \"bg-transparent text-(--c-text) border-(--c-solid)\",\n subtle: \"bg-transparent text-(--c-text)\",\n // from-*/to-* are the CSS defaults for --tw-gradient-from/to and the\n // --tw-gradient-stops composition chain. Props only override the individual\n // vars they provide — the chain resolves them lazily without JS defaults.\n gradient:\n \"bg-origin-border bg-linear-to-r from-purple-300 to-pink-400 text-black border-white/20\",\n },\n // Figma (node 14950-143827) defines sm/md/lg; xs/xl extrapolate one\n // step past either end. Radius follows Figma on every step\n // (`rounded-badge`, 4px), as do md's height and padding. The rest of\n // the scale departs from Figma on purpose (3b408c4c), so there the\n // design catches up to the kit, not the reverse: sm is 12px text, 3px gap, 22px tall\n // (Figma 10/4/20); md has a 6px gap (4); lg is 16px text, 8px gap,\n // 8px padding (14/4/10). Icon size ([&_svg]:size-*) isn't in the\n // Figma spec — scaled by eye to each step, same convention as\n // Button's own size variant.\n size: {\n xs: \"min-h-5 px-0.5 text-[10px] leading-2.5 gap-0.5 rounded-badge [&_svg]:size-2.5\",\n sm: \"min-h-5.5 px-1 text-xs gap-0.75 rounded-badge [&_svg]:size-3\",\n md: \"min-h-6 px-1.5 text-sm gap-1.5 rounded-badge [&_svg]:size-3\",\n lg: \"min-h-7 px-2 text-md gap-2 rounded-badge [&_svg]:size-3.5\",\n xl: \"min-h-8 px-2.5 text-lg gap-3.5 rounded-badge [&_svg]:size-4\",\n },\n },\n defaultVariants: {\n variant: \"light\",\n size: \"md\",\n },\n },\n)\n\nexport type BadgeVariant = NonNullable<VariantProps<typeof badgeVariants>[\"variant\"]>\nexport type BadgeSize = NonNullable<VariantProps<typeof badgeVariants>[\"size\"]>\n\nexport type { GradientDir, GradientProps }\n\nexport type BadgeProps = Omit<HTMLArkProps<\"span\">, \"color\"> &\n VariantProps<typeof badgeVariants> &\n WithTestId & {\n /** Accent palette. Re-exported as `Color` from `@42/ui-react`. */\n color?: Color\n /**\n * Gradient config. Only applied when `variant=\"gradient\"`.\n * Mirrors Tailwind's from-* / to-* / via-* utilities: sets the individual\n * CSS vars so the existing --tw-gradient-stops chain picks them up.\n * Unset fields fall back to the CVA defaults (purple-300 → pink-400, to-r).\n */\n gradient?: GradientProps\n }\n\nexport const Badge = ({\n className,\n variant,\n size,\n color,\n gradient,\n style,\n testId,\n ...rest\n}: BadgeProps) => {\n const isGradient = variant === \"gradient\"\n\n return (\n <ark.span\n data-color={!isGradient ? color : undefined}\n style={isGradient && gradient ? { ...buildGradientVars(gradient), ...style } : style}\n className={cn(\n badgeVariants({ variant, size }),\n isGradient && gradient?.dir && GRADIENT_DIR_CLASS[gradient.dir],\n className,\n )}\n {...props({ \"data-testid\": testId })}\n {...rest}\n />\n )\n}\n"]}