@jfrader/ui 0.3.0 → 0.5.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 (264) hide show
  1. package/README.md +2 -0
  2. package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
  3. package/dist/accordion.js +1 -1
  4. package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/announcement-bar-B58xempt.js +382 -0
  7. package/dist/announcement-bar.js +2 -0
  8. package/dist/avatar-group-DOQQuV51.js +138 -0
  9. package/dist/avatar-group.js +2 -0
  10. package/dist/bottom-sheet-DPJBFkie.js +673 -0
  11. package/dist/bottom-sheet.js +2 -0
  12. package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
  13. package/dist/breadcrumbs.js +1 -1
  14. package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
  15. package/dist/button.js +1 -1
  16. package/dist/calendar-B3Svu0X2.js +447 -0
  17. package/dist/calendar.js +1 -1
  18. package/dist/carousel-IvPqN-oM.js +472 -0
  19. package/dist/carousel.js +2 -0
  20. package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
  21. package/dist/checkbox.js +1 -1
  22. package/dist/chip-group-DTQd_M-G.js +289 -0
  23. package/dist/chip-group.js +2 -0
  24. package/dist/code-block/shiki.js +147 -0
  25. package/dist/code-block-ahnRi-g8.js +292 -0
  26. package/dist/code-block.js +2 -0
  27. package/dist/collection-registry-k6JcD3Jr.js +44 -0
  28. package/dist/combobox-Bhzvu9ma.js +334 -0
  29. package/dist/combobox.js +1 -1
  30. package/dist/command-palette-BQ5LleGb.js +384 -0
  31. package/dist/command-palette.js +1 -1
  32. package/dist/copy-button-ByiA6D3R.js +252 -0
  33. package/dist/copy-button.js +2 -0
  34. package/dist/countdown-Dp_TD1VP.js +293 -0
  35. package/dist/countdown.js +2 -0
  36. package/dist/date-picker-5zKSSuFF.js +255 -0
  37. package/dist/date-picker.js +1 -1
  38. package/dist/date-range-picker-B5uFWsm-.js +562 -0
  39. package/dist/date-range-picker.js +2 -0
  40. package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
  41. package/dist/dialog.js +1 -1
  42. package/dist/drawer-DsASTiP-.js +553 -0
  43. package/dist/drawer.js +2 -0
  44. package/dist/empty-state-CDgrjPPf.js +142 -0
  45. package/dist/empty-state.js +2 -0
  46. package/dist/expandable-card-C-qJcZ14.js +340 -0
  47. package/dist/expandable-card.js +2 -0
  48. package/dist/field-anatomy-COVdNpf5.js +84 -0
  49. package/dist/file-dropzone-pR4v7owg.js +457 -0
  50. package/dist/file-dropzone.js +2 -0
  51. package/dist/filter-toolbar-D5KEKTSe.js +312 -0
  52. package/dist/filter-toolbar.js +2 -0
  53. package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
  54. package/dist/hold-to-confirm.js +2 -0
  55. package/dist/hover-card-B-nrCIy2.js +347 -0
  56. package/dist/hover-card.js +2 -0
  57. package/dist/image-compare-ciuhPtQZ.js +415 -0
  58. package/dist/image-compare.js +2 -0
  59. package/dist/index.js +79 -38
  60. package/dist/inline-edit-C0eeml65.js +535 -0
  61. package/dist/inline-edit.js +2 -0
  62. package/dist/input-control-DmMuAuPS.js +34 -0
  63. package/dist/json-viewer-BcySQfjZ.js +798 -0
  64. package/dist/json-viewer.js +2 -0
  65. package/dist/listbox-style-WX-RASp1.js +59 -0
  66. package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
  67. package/dist/mention-input-BcQKX2EJ.js +599 -0
  68. package/dist/mention-input.js +2 -0
  69. package/dist/menu-xwOOUtWP.js +275 -0
  70. package/dist/menu.js +1 -1
  71. package/dist/metric-card-Bh9K4fZs.js +118 -0
  72. package/dist/metric-card.js +2 -0
  73. package/dist/multi-select-Pce_IYnz.js +590 -0
  74. package/dist/multi-select.js +2 -0
  75. package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
  76. package/dist/navigation.js +1 -1
  77. package/dist/overlay-layer-SeUyyEPD.js +64 -0
  78. package/dist/overlay-portal-C4JZFq2M.js +15 -0
  79. package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
  80. package/dist/pagination.js +1 -1
  81. package/dist/password-field-03pWRkuY.js +250 -0
  82. package/dist/password-field.js +2 -0
  83. package/dist/popover-QHcEvf9c.js +119 -0
  84. package/dist/popover.js +1 -1
  85. package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
  86. package/dist/progress.js +1 -1
  87. package/dist/radio-cards-D2QZENI_.js +455 -0
  88. package/dist/radio-cards.js +2 -0
  89. package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
  90. package/dist/radio-group.js +1 -1
  91. package/dist/resizable-panels-BhjUVXZZ.js +519 -0
  92. package/dist/resizable-panels.js +2 -0
  93. package/dist/scroll-area-CcZyiSOQ.js +371 -0
  94. package/dist/scroll-area.js +2 -0
  95. package/dist/search-field-IxF0IJXm.js +274 -0
  96. package/dist/search-field.js +2 -0
  97. package/dist/segmented-control-yO1K1nbi.js +326 -0
  98. package/dist/segmented-control.js +2 -0
  99. package/dist/select-n_H52W1Z.js +292 -0
  100. package/dist/select.js +1 -1
  101. package/dist/signature-pad-q2SAsrdD.js +640 -0
  102. package/dist/signature-pad.js +2 -0
  103. package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
  104. package/dist/skeleton.js +1 -1
  105. package/dist/slider-t0B5cecO.js +477 -0
  106. package/dist/slider.js +2 -0
  107. package/dist/sortable-data-table-tirqlLY2.js +365 -0
  108. package/dist/sortable-data-table.js +2 -0
  109. package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
  110. package/dist/spinner.js +1 -1
  111. package/dist/split-button-Cb3EHs64.js +268 -0
  112. package/dist/split-button.js +2 -0
  113. package/dist/stepper-CruHbXxX.js +480 -0
  114. package/dist/stepper.js +2 -0
  115. package/dist/swipe-actions-DiZC57-3.js +418 -0
  116. package/dist/swipe-actions.js +2 -0
  117. package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
  118. package/dist/switch.js +1 -1
  119. package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
  120. package/dist/tabs.js +1 -1
  121. package/dist/tag-input-DSRCyrX2.js +418 -0
  122. package/dist/tag-input.js +2 -0
  123. package/dist/{text-field-D60ok14S.js → text-field-C8TWG-tY.js} +6 -5
  124. package/dist/text-field.js +1 -1
  125. package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
  126. package/dist/textarea.js +1 -1
  127. package/dist/theme-root-BbTBuLMQ.js +46 -0
  128. package/dist/theme-root.js +1 -1
  129. package/dist/theme-scope-t7nAKc2c.js +27 -0
  130. package/dist/time-picker-Db8D49cP.js +305 -0
  131. package/dist/time-picker.js +2 -0
  132. package/dist/timeline-k3nURuCP.js +618 -0
  133. package/dist/timeline.js +2 -0
  134. package/dist/toast-BHxI32ZA.js +352 -0
  135. package/dist/toast-stack-DqrAzdg5.js +183 -0
  136. package/dist/toast-stack.js +2 -0
  137. package/dist/toast.js +1 -1
  138. package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
  139. package/dist/toggle-group.js +1 -1
  140. package/dist/tooltip-CkeiW9C1.js +113 -0
  141. package/dist/tooltip.js +1 -1
  142. package/dist/tree-view-C2liIxqy.js +360 -0
  143. package/dist/tree-view.js +2 -0
  144. package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
  145. package/dist/types/components/announcement-bar/index.d.ts +2 -0
  146. package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
  147. package/dist/types/components/avatar-group/index.d.ts +2 -0
  148. package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
  149. package/dist/types/components/bottom-sheet/index.d.ts +2 -0
  150. package/dist/types/components/calendar/calendar.d.ts +25 -1
  151. package/dist/types/components/calendar/index.d.ts +1 -1
  152. package/dist/types/components/carousel/carousel.d.ts +73 -0
  153. package/dist/types/components/carousel/index.d.ts +2 -0
  154. package/dist/types/components/chip-group/chip-group.d.ts +54 -0
  155. package/dist/types/components/chip-group/index.d.ts +1 -0
  156. package/dist/types/components/code-block/code-block.d.ts +58 -0
  157. package/dist/types/components/code-block/index.d.ts +1 -0
  158. package/dist/types/components/code-block/shiki.d.ts +3 -0
  159. package/dist/types/components/combobox/combobox.d.ts +1 -1
  160. package/dist/types/components/command-palette/command-palette.d.ts +1 -1
  161. package/dist/types/components/copy-button/copy-button.d.ts +49 -0
  162. package/dist/types/components/copy-button/index.d.ts +2 -0
  163. package/dist/types/components/countdown/countdown.d.ts +37 -0
  164. package/dist/types/components/countdown/index.d.ts +1 -0
  165. package/dist/types/components/date-picker/date-picker.d.ts +1 -1
  166. package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
  167. package/dist/types/components/date-range-picker/index.d.ts +2 -0
  168. package/dist/types/components/drawer/drawer.d.ts +59 -0
  169. package/dist/types/components/drawer/index.d.ts +2 -0
  170. package/dist/types/components/empty-state/empty-state.d.ts +36 -0
  171. package/dist/types/components/empty-state/index.d.ts +2 -0
  172. package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
  173. package/dist/types/components/expandable-card/index.d.ts +2 -0
  174. package/dist/types/components/field/field-anatomy.d.ts +4 -2
  175. package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
  176. package/dist/types/components/file-dropzone/index.d.ts +2 -0
  177. package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
  178. package/dist/types/components/filter-toolbar/index.d.ts +1 -0
  179. package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
  180. package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
  181. package/dist/types/components/hover-card/hover-card.d.ts +97 -0
  182. package/dist/types/components/hover-card/index.d.ts +2 -0
  183. package/dist/types/components/image-compare/image-compare.d.ts +54 -0
  184. package/dist/types/components/image-compare/index.d.ts +1 -0
  185. package/dist/types/components/inline-edit/index.d.ts +2 -0
  186. package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
  187. package/dist/types/components/json-viewer/index.d.ts +2 -0
  188. package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
  189. package/dist/types/components/mention-input/index.d.ts +2 -0
  190. package/dist/types/components/mention-input/mention-input.d.ts +87 -0
  191. package/dist/types/components/menu/menu.d.ts +23 -5
  192. package/dist/types/components/metric-card/index.d.ts +1 -0
  193. package/dist/types/components/metric-card/metric-card.d.ts +37 -0
  194. package/dist/types/components/multi-select/index.d.ts +2 -0
  195. package/dist/types/components/multi-select/multi-select.d.ts +73 -0
  196. package/dist/types/components/password-field/index.d.ts +2 -0
  197. package/dist/types/components/password-field/password-field.d.ts +34 -0
  198. package/dist/types/components/popover/popover.d.ts +1 -1
  199. package/dist/types/components/radio-cards/index.d.ts +1 -0
  200. package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
  201. package/dist/types/components/resizable-panels/index.d.ts +2 -0
  202. package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
  203. package/dist/types/components/scroll-area/index.d.ts +2 -0
  204. package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
  205. package/dist/types/components/search-field/index.d.ts +1 -0
  206. package/dist/types/components/search-field/search-field.d.ts +31 -0
  207. package/dist/types/components/segmented-control/index.d.ts +2 -0
  208. package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
  209. package/dist/types/components/select/select.d.ts +1 -1
  210. package/dist/types/components/signature-pad/index.d.ts +2 -0
  211. package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
  212. package/dist/types/components/slider/index.d.ts +1 -0
  213. package/dist/types/components/slider/slider.d.ts +70 -0
  214. package/dist/types/components/sortable-data-table/index.d.ts +1 -0
  215. package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
  216. package/dist/types/components/split-button/index.d.ts +2 -0
  217. package/dist/types/components/split-button/split-button.d.ts +55 -0
  218. package/dist/types/components/stepper/index.d.ts +2 -0
  219. package/dist/types/components/stepper/stepper.d.ts +85 -0
  220. package/dist/types/components/swipe-actions/index.d.ts +2 -0
  221. package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
  222. package/dist/types/components/tag-input/index.d.ts +2 -0
  223. package/dist/types/components/tag-input/tag-input.d.ts +66 -0
  224. package/dist/types/components/theme-root/theme-root.d.ts +9 -3
  225. package/dist/types/components/time-picker/index.d.ts +2 -0
  226. package/dist/types/components/time-picker/time-picker.d.ts +48 -0
  227. package/dist/types/components/timeline/index.d.ts +2 -0
  228. package/dist/types/components/timeline/timeline.d.ts +66 -0
  229. package/dist/types/components/toast/toast.d.ts +37 -2
  230. package/dist/types/components/toast-stack/index.d.ts +2 -0
  231. package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
  232. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  233. package/dist/types/components/tree-view/index.d.ts +1 -0
  234. package/dist/types/components/tree-view/tree-view.d.ts +47 -0
  235. package/dist/types/components/usage-meter/index.d.ts +2 -0
  236. package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
  237. package/dist/types/index.d.ts +40 -0
  238. package/dist/types/overlay/overlay-layer.d.ts +33 -0
  239. package/dist/types/overlay/overlay-portal.d.ts +7 -0
  240. package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
  241. package/dist/types/styling/media.d.ts +1 -0
  242. package/dist/types/styling/theme-scope.d.ts +19 -0
  243. package/dist/types/styling/theme.d.ts +12 -0
  244. package/dist/types/utils/use-controlled-state.d.ts +2 -1
  245. package/dist/usage-meter-qyQ3rYVv.js +463 -0
  246. package/dist/usage-meter.js +2 -0
  247. package/dist/use-controlled-state-DpeVQZNR.js +20 -0
  248. package/dist/use-latest-callback-cj1OOQL6.js +11 -0
  249. package/dist/use-overlay-floating-DvJifLpF.js +31 -0
  250. package/package.json +175 -3
  251. package/dist/calendar-C9Yad_-w.js +0 -394
  252. package/dist/collection-registry-BTYi6zGh.js +0 -98
  253. package/dist/combobox-DrmjBbo7.js +0 -327
  254. package/dist/command-palette-V_2pEay7.js +0 -379
  255. package/dist/date-picker-ClUYBIBh.js +0 -250
  256. package/dist/field-anatomy-D2ToMeRa.js +0 -109
  257. package/dist/menu-DU60SMdt.js +0 -216
  258. package/dist/popover-BtN_0ejj.js +0 -113
  259. package/dist/select-BCS0-LVW.js +0 -286
  260. package/dist/theme-root-BiXXvQvr.js +0 -42
  261. package/dist/toast-iqelR-r0.js +0 -282
  262. package/dist/tooltip-CB-HC1js.js +0 -108
  263. package/dist/use-controlled-state-CVXDa-qM.js +0 -21
  264. package/dist/use-overlay-floating-efeqppiw.js +0 -19
@@ -0,0 +1,418 @@
1
+ 'use client';
2
+ import { r as e } from "./sx-Dx9JUKp5.js";
3
+ import { t } from "./focus-ring-BK5W5_NY.js";
4
+ import { n, r, t as i } from "./media-8yrN85VT.js";
5
+ import { t as a } from "./use-controlled-state-DpeVQZNR.js";
6
+ import { t as ee } from "./visually-hidden-BJdvqqvn.js";
7
+ import { t as te } from "./renderable-DzcIj1Lo.js";
8
+ import { t as ne } from "./icon-wrapper-stN8sD7R.js";
9
+ import { t as re } from "./input-control-DmMuAuPS.js";
10
+ import { a as ie, i as ae, n as oe, r as se, t as ce } from "./field-anatomy-COVdNpf5.js";
11
+ import { useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
12
+ import { vars as u } from "@jfrader/tokens/vars";
13
+ import { jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
14
+ import { useMergeRefs as le } from "@floating-ui/react";
15
+ //#region src/components/tag-input/tag-input.tsx
16
+ var ue = ["Enter", ","], de = [], fe = "8ch", pe = (e) => e.trim(), me = (e, t, n) => e.filter((r, i) => r === "" || t(r) !== r || e.findIndex((e) => n.compare(e, r) === 0) !== i);
17
+ function he(e) {
18
+ let t = new Intl.NumberFormat(e);
19
+ return {
20
+ listLabel: "Tags",
21
+ remove: (e) => `Remove ${e}`,
22
+ added: (e) => `Added ${e}`,
23
+ removed: (e) => `Removed ${e}`,
24
+ picked: (e) => `${e} selected. Press Backspace to remove it.`,
25
+ duplicate: (e) => `${e} is already added`,
26
+ limit: (e) => `Tag limit reached: ${t.format(e)}`,
27
+ required: "Add at least one tag."
28
+ };
29
+ }
30
+ var ge = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), _e = e({
31
+ display: "flex",
32
+ flexWrap: "wrap",
33
+ alignItems: "center",
34
+ gap: u.space[1],
35
+ minInlineSize: 0,
36
+ borderRadius: u.radius.sm,
37
+ cursor: "text",
38
+ "&[data-invalid]:not(:has(> input:focus-visible))": { borderColor: u.color.dangerBorder },
39
+ "&[data-disabled]": {
40
+ opacity: .55,
41
+ cursor: "not-allowed"
42
+ },
43
+ [n]: { borderColor: "CanvasText" }
44
+ }), ve = {
45
+ sm: e({
46
+ minBlockSize: u.space[8],
47
+ paddingBlock: `calc(${u.space[1]} / 2)`,
48
+ paddingInline: u.space[1],
49
+ fontSize: u.textSize.sm
50
+ }),
51
+ md: e({
52
+ minBlockSize: u.space[10],
53
+ paddingBlock: u.space[1],
54
+ paddingInline: u.space[2],
55
+ fontSize: u.textSize.sm
56
+ }),
57
+ lg: e({
58
+ minBlockSize: u.space[12],
59
+ paddingBlock: u.space[2],
60
+ paddingInline: u.space[2],
61
+ fontSize: u.textSize.md
62
+ })
63
+ }, ye = e({
64
+ display: "contents",
65
+ margin: 0,
66
+ padding: 0,
67
+ listStyle: "none"
68
+ }), be = e({
69
+ display: "inline-flex",
70
+ alignItems: "center",
71
+ gap: u.space[1],
72
+ maxInlineSize: "100%",
73
+ minInlineSize: 0,
74
+ minBlockSize: u.space[6],
75
+ paddingInlineStart: u.space[2],
76
+ border: `1px solid ${u.color.border}`,
77
+ borderRadius: u.radius.full,
78
+ backgroundColor: u.color.surfaceHover,
79
+ color: u.color.text,
80
+ fontSize: u.textSize.xs,
81
+ fontWeight: u.fontWeight.medium,
82
+ lineHeight: u.lineHeight.base,
83
+ cursor: "default",
84
+ transitionProperty: "opacity, background-color, border-color",
85
+ transitionDuration: u.motion.duration.fast,
86
+ transitionTimingFunction: u.motion.easeStandard,
87
+ "&[data-enter]": { "@starting-style": { opacity: 0 } },
88
+ "&[data-duplicate]": {
89
+ borderColor: u.color.accentText,
90
+ backgroundColor: u.color.accentSoft
91
+ },
92
+ "&[data-picked]": {
93
+ outline: `2px solid ${u.color.focusRing}`,
94
+ outlineOffset: "1px",
95
+ backgroundColor: u.color.accentSoft
96
+ },
97
+ "&[data-readonly]": { paddingInlineEnd: u.space[2] },
98
+ [r]: {
99
+ transitionDuration: "0s",
100
+ "&[data-enter]": { "@starting-style": { opacity: 1 } }
101
+ },
102
+ [n]: {
103
+ borderColor: "CanvasText",
104
+ "&[data-picked]": { outlineColor: "Highlight" },
105
+ "&[data-duplicate]": { borderStyle: "dashed" }
106
+ }
107
+ }), xe = {
108
+ sm: e({ fontSize: u.textSize.xs }),
109
+ md: e({ fontSize: u.textSize.sm }),
110
+ lg: e({ fontSize: u.textSize.sm })
111
+ }, Se = e({
112
+ minInlineSize: 0,
113
+ overflow: "hidden",
114
+ textOverflow: "ellipsis",
115
+ whiteSpace: "nowrap"
116
+ }), Ce = e({
117
+ display: "inline-grid",
118
+ placeItems: "center",
119
+ flexShrink: 0,
120
+ inlineSize: u.space[6],
121
+ blockSize: u.space[6],
122
+ padding: 0,
123
+ border: 0,
124
+ borderRadius: u.radius.full,
125
+ backgroundColor: "transparent",
126
+ color: u.color.textMuted,
127
+ fontSize: u.textSize.sm,
128
+ cursor: "pointer",
129
+ transitionProperty: "background-color, color",
130
+ transitionDuration: u.motion.duration.fast,
131
+ transitionTimingFunction: u.motion.easeStandard,
132
+ "&:hover:not(:disabled)": {
133
+ backgroundColor: u.color.surfaceInset,
134
+ color: u.color.text
135
+ },
136
+ "&:focus-visible": t,
137
+ "&:disabled": { cursor: "not-allowed" },
138
+ [r]: { transitionDuration: "0s" },
139
+ [n]: { color: "ButtonText" }
140
+ }), we = e({
141
+ flex: "1 1 0%",
142
+ minInlineSize: fe,
143
+ blockSize: u.space[6],
144
+ margin: 0,
145
+ paddingBlock: 0,
146
+ paddingInline: u.space[1],
147
+ border: 0,
148
+ outline: "none",
149
+ backgroundColor: "transparent",
150
+ color: u.color.text,
151
+ fontFamily: u.font.sans,
152
+ fontSize: "inherit",
153
+ lineHeight: u.lineHeight.base,
154
+ "&::placeholder": { color: u.color.textMuted },
155
+ "&:disabled": { cursor: "not-allowed" },
156
+ [i]: { fontSize: u.textSize.md }
157
+ }), Te = e({
158
+ fontSize: u.textSize.sm,
159
+ color: u.color.textMuted
160
+ }), Ee = /* @__PURE__ */ d("svg", {
161
+ viewBox: "0 0 24 24",
162
+ fill: "none",
163
+ stroke: "currentColor",
164
+ strokeWidth: 2,
165
+ strokeLinecap: "round",
166
+ children: /* @__PURE__ */ d("path", { d: "m7 7 10 10M17 7 7 17" })
167
+ }), De = (e) => e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229;
168
+ function p({ ref: e, value: t, defaultValue: n, onValueChange: r, inputValue: i, defaultInputValue: u, onInputChange: fe, label: p, description: m, error: h, size: g = "md", separators: Oe = ue, commitOnBlur: ke = !0, normalize: _ = pe, validateToken: Ae, maxTokens: v, locale: y, messages: je, removeIcon: Me = Ee, slotProps: b, className: Ne, sx: Pe, dir: x, name: S, form: C, disabled: w = !1, readOnly: T = !1, required: E = !1, onChange: Fe, onKeyDown: Ie, onBlur: Le, onCompositionStart: Re, onCompositionEnd: ze, id: Be, "aria-labelledby": D, "aria-describedby": Ve, "aria-invalid": He, ...Ue }) {
169
+ let O = ie({
170
+ id: Be,
171
+ description: m,
172
+ error: h,
173
+ "aria-describedby": Ve,
174
+ "aria-invalid": He
175
+ }), k = `${O.id}-label`, A = `${O.id}-picked`, j = {
176
+ ...s(() => he(y), [y]),
177
+ ...je
178
+ }, M = s(() => new Intl.Collator(y, {
179
+ usage: "search",
180
+ sensitivity: "accent"
181
+ }), [y]), We = c(n ?? de), N = c(u ?? ""), [Ge, Ke, P] = a(t, We.current, (e) => r?.([...e])), F = Ge ?? de, [qe, I, L] = a(i, N.current, fe), R = qe ?? "", [z, B] = l(null), [V, H] = l(null);
182
+ z !== null && !F.includes(z) && B(null), V !== null && !F.includes(V) && H(null);
183
+ let [U, W] = l({
184
+ text: "",
185
+ rejection: !1
186
+ }), [G, K] = l(null), q = c(null), Je = le([q, e]), Ye = c(!1);
187
+ o(() => {
188
+ Ye.current = !0;
189
+ }, []);
190
+ let J = c(!1), Xe = c(null);
191
+ o(() => {
192
+ if (process.env.NODE_ENV === "production") return;
193
+ let e = me(F, _, M), t = e.length > 0 ? `TagInput: tokens must be unique, nonempty and normalized; invalid entries: ${JSON.stringify(e)}` : null;
194
+ t !== null && t !== Xe.current && console.warn(t), Xe.current = t;
195
+ }, [
196
+ F,
197
+ _,
198
+ M
199
+ ]);
200
+ let Ze = (e) => {
201
+ ge(e, F) || Ke(e);
202
+ }, Y = (e, t = !1) => W((n) => ({
203
+ text: n.text === e ? `${e} ` : e,
204
+ rejection: t
205
+ }));
206
+ o(() => {
207
+ if (!G) return;
208
+ let e = F.includes(G.token);
209
+ (G.kind === "added" ? !e : e) || (Y(G.kind === "added" ? j.added(G.token) : j.removed(G.token)), K(null));
210
+ }, [G, F]);
211
+ let Qe = E && F.length === 0;
212
+ o(() => {
213
+ q.current?.setCustomValidity(Qe ? j.required : "");
214
+ }, [Qe, j.required]);
215
+ let $e = c({
216
+ inputValue: i,
217
+ draft: R
218
+ });
219
+ $e.current = {
220
+ inputValue: i,
221
+ draft: R
222
+ }, o(() => {
223
+ let e = q.current, t = e?.form;
224
+ if (!e || !t) return;
225
+ let n = !0, r = (t) => {
226
+ queueMicrotask(() => {
227
+ if (!n || t.defaultPrevented) return;
228
+ let r = $e.current;
229
+ P(), L(), B(null), H(null), K(null), W({
230
+ text: "",
231
+ rejection: !1
232
+ }), e.value = r.inputValue === void 0 ? N.current : r.draft;
233
+ });
234
+ };
235
+ return t.addEventListener("reset", r), () => {
236
+ n = !1, t.removeEventListener("reset", r);
237
+ };
238
+ }, [
239
+ C,
240
+ P,
241
+ L
242
+ ]);
243
+ let X = !w && !T, Z = () => {
244
+ H(null), U.rejection && W({
245
+ text: "",
246
+ rejection: !1
247
+ });
248
+ }, et = () => {
249
+ let e = _(R);
250
+ if (e === "") return;
251
+ let t = F.find((t) => M.compare(t, e) === 0);
252
+ if (t !== void 0) {
253
+ H(t), Y(j.duplicate(t), !0);
254
+ return;
255
+ }
256
+ if (v !== void 0 && F.length >= v) {
257
+ Y(j.limit(v), !0);
258
+ return;
259
+ }
260
+ let n = Ae?.(e) ?? null;
261
+ n === null ? (B(null), H(null), Ze([...F, e]), I(""), K({
262
+ kind: "added",
263
+ token: e
264
+ })) : Y(n, !0);
265
+ }, Q = (e) => {
266
+ B(null), Z(), Ze(F.filter((t) => t !== e)), K({
267
+ kind: "removed",
268
+ token: e
269
+ });
270
+ }, $ = (e) => {
271
+ B(e), e !== null && Y(j.picked(e));
272
+ }, tt = (e) => {
273
+ Fe?.(e), X && (B(null), Z(), I(e.currentTarget.value));
274
+ }, nt = (e) => {
275
+ if (Ie?.(e), e.defaultPrevented || J.current || De(e) || !X || e.altKey || e.ctrlKey || e.metaKey) return;
276
+ let { key: t, currentTarget: n } = e, r = n.selectionStart === 0 && n.selectionEnd === 0, i = z === null ? -1 : F.indexOf(z);
277
+ if (Oe.includes(t)) {
278
+ if (R === "") return;
279
+ e.preventDefault(), et();
280
+ } else if (t === "Backspace" || t === "Delete") z === null ? t === "Backspace" && r && F.length > 0 && (e.preventDefault(), e.repeat || $(F[F.length - 1])) : (e.preventDefault(), e.repeat || Q(z));
281
+ else if (!e.shiftKey) {
282
+ if (t === "ArrowLeft" && (z !== null || r && F.length > 0)) {
283
+ e.preventDefault();
284
+ let t = z === null ? F[F.length - 1] : F[Math.max(i - 1, 0)];
285
+ t !== z && $(t);
286
+ } else if (t === "ArrowRight" && z !== null) {
287
+ e.preventDefault();
288
+ let t = F[i + 1];
289
+ t === void 0 ? (B(null), n.setSelectionRange(0, 0)) : $(t);
290
+ } else t === "Escape" && z !== null && (e.preventDefault(), B(null), n.setSelectionRange(0, 0));
291
+ }
292
+ }, rt = (e) => {
293
+ let t = e.relatedTarget;
294
+ t instanceof Node && e.currentTarget.contains(t) || (B(null), ke && X && !J.current && et());
295
+ }, it = (e) => {
296
+ J.current = !0, Re?.(e);
297
+ }, at = (e) => {
298
+ J.current = !1, ze?.(e);
299
+ }, ot = (e) => {
300
+ q.current?.focus(), Q(e);
301
+ }, st = D === void 0 ? void 0 : [te(p) && k, D].filter(Boolean).join(" "), ct = [O.describedBy, z !== null && A].filter(Boolean).join(" ") || void 0;
302
+ return /* @__PURE__ */ f(ae, {
303
+ "data-ui": "tag-input",
304
+ dir: x,
305
+ className: Ne,
306
+ sx: Pe,
307
+ part: b?.root,
308
+ children: [
309
+ /* @__PURE__ */ d(se, {
310
+ id: k,
311
+ htmlFor: O.id,
312
+ required: E,
313
+ part: b?.label,
314
+ children: p
315
+ }),
316
+ /* @__PURE__ */ f("div", {
317
+ "data-invalid": O.ariaInvalid === !0 || O.ariaInvalid === "true" ? "" : void 0,
318
+ "data-disabled": w ? "" : void 0,
319
+ onBlur: rt,
320
+ onMouseDown: (e) => {
321
+ w || e.target === q.current || (e.preventDefault(), e.target.closest("button") || q.current?.focus());
322
+ },
323
+ className: b?.control?.className,
324
+ css: [
325
+ re,
326
+ _e,
327
+ ve[g],
328
+ b?.control?.css
329
+ ],
330
+ children: [F.length > 0 && /* @__PURE__ */ d("ul", {
331
+ role: "list",
332
+ "aria-label": j.listLabel,
333
+ className: b?.list?.className,
334
+ css: [ye, b?.list?.css],
335
+ children: F.map((e) => /* @__PURE__ */ f("li", {
336
+ "data-picked": e === z ? "" : void 0,
337
+ "data-duplicate": e === V ? "" : void 0,
338
+ "data-readonly": T ? "" : void 0,
339
+ "data-enter": Ye.current ? "" : void 0,
340
+ className: b?.token?.className,
341
+ css: [
342
+ be,
343
+ xe[g],
344
+ b?.token?.css
345
+ ],
346
+ children: [/* @__PURE__ */ d("span", {
347
+ id: e === z ? A : void 0,
348
+ css: Se,
349
+ children: e
350
+ }), !T && /* @__PURE__ */ d("button", {
351
+ type: "button",
352
+ disabled: w,
353
+ "aria-label": j.remove(e),
354
+ onClick: () => ot(e),
355
+ className: b?.remove?.className,
356
+ css: [Ce, b?.remove?.css],
357
+ children: /* @__PURE__ */ d("span", {
358
+ "aria-hidden": !0,
359
+ css: ne,
360
+ children: Me
361
+ })
362
+ })]
363
+ }, e))
364
+ }), /* @__PURE__ */ d("input", {
365
+ autoComplete: "off",
366
+ ...Ue,
367
+ ref: Je,
368
+ type: "text",
369
+ id: O.id,
370
+ dir: x,
371
+ form: C,
372
+ value: R,
373
+ disabled: w,
374
+ readOnly: T,
375
+ "aria-required": E || void 0,
376
+ "aria-labelledby": st,
377
+ "aria-describedby": ct,
378
+ "aria-invalid": O.ariaInvalid,
379
+ onChange: tt,
380
+ onKeyDown: nt,
381
+ onCompositionStart: it,
382
+ onCompositionEnd: at,
383
+ onBlur: Le,
384
+ className: b?.input?.className,
385
+ css: [we, b?.input?.css]
386
+ })]
387
+ }),
388
+ /* @__PURE__ */ d(ce, {
389
+ id: O.descriptionId,
390
+ part: b?.description,
391
+ children: m
392
+ }),
393
+ /* @__PURE__ */ d(oe, {
394
+ id: O.errorId,
395
+ part: b?.error,
396
+ children: h
397
+ }),
398
+ /* @__PURE__ */ d("span", {
399
+ role: "status",
400
+ "aria-live": "polite",
401
+ "aria-atomic": "true",
402
+ "data-rejection": U.rejection ? "" : void 0,
403
+ className: b?.status?.className,
404
+ css: [U.rejection ? Te : ee, b?.status?.css],
405
+ children: U.text
406
+ }),
407
+ S !== void 0 && !w && F.map((e) => /* @__PURE__ */ d("input", {
408
+ type: "hidden",
409
+ name: S,
410
+ form: C,
411
+ value: e
412
+ }, e))
413
+ ]
414
+ });
415
+ }
416
+ p.displayName = "TagInput";
417
+ //#endregion
418
+ export { p as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as TagInput } from "./tag-input-DSRCyrX2.js";
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
  import { r as e } from "./sx-Dx9JUKp5.js";
3
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-D2ToMeRa.js";
3
+ import { t } from "./input-control-DmMuAuPS.js";
4
+ import { a as n, i as r, n as i, r as a, t as o } from "./field-anatomy-COVdNpf5.js";
4
5
  import { vars as s } from "@jfrader/tokens/vars";
5
6
  import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
6
7
  //#region src/components/text-field/text-field.tsx
@@ -22,7 +23,7 @@ var u = {
22
23
  })
23
24
  };
24
25
  function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChange: m, onValueChange: h, slotProps: g, className: _, sx: v, required: y, id: b, "aria-describedby": x, "aria-invalid": S, ...C }) {
25
- let w = t({
26
+ let w = n({
26
27
  id: b,
27
28
  description: d,
28
29
  error: f,
@@ -31,7 +32,7 @@ function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChang
31
32
  }), T = (e) => {
32
33
  m?.(e), h?.(e.currentTarget.value);
33
34
  };
34
- return /* @__PURE__ */ l(n, {
35
+ return /* @__PURE__ */ l(r, {
35
36
  "data-ui": "text-field",
36
37
  className: _,
37
38
  sx: v,
@@ -53,7 +54,7 @@ function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChang
53
54
  onChange: T,
54
55
  className: g?.control?.className,
55
56
  css: [
56
- i,
57
+ t,
57
58
  u[p],
58
59
  g?.control?.css
59
60
  ]
@@ -63,7 +64,7 @@ function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChang
63
64
  part: g?.description,
64
65
  children: d
65
66
  }),
66
- /* @__PURE__ */ c(r, {
67
+ /* @__PURE__ */ c(i, {
67
68
  id: w.errorId,
68
69
  part: g?.error,
69
70
  children: f
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as TextField } from "./text-field-D60ok14S.js";
2
+ export { t as TextField } from "./text-field-C8TWG-tY.js";
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
  import { r as e } from "./sx-Dx9JUKp5.js";
3
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-D2ToMeRa.js";
3
+ import { t } from "./input-control-DmMuAuPS.js";
4
+ import { a as n, i as r, n as i, r as a, t as o } from "./field-anatomy-COVdNpf5.js";
4
5
  import { vars as s } from "@jfrader/tokens/vars";
5
6
  import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
6
7
  //#region src/components/textarea/textarea.tsx
@@ -28,7 +29,7 @@ var u = e({
28
29
  vertical: e({ resize: "vertical" })
29
30
  }, p = e({ fieldSizing: "content" });
30
31
  function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize: _ = "vertical", autoResize: v = !1, rows: y = 3, onChange: b, onValueChange: x, slotProps: S, className: C, sx: w, required: T, id: E, "aria-describedby": D, "aria-invalid": O, ...k }) {
31
- let A = t({
32
+ let A = n({
32
33
  id: E,
33
34
  description: m,
34
35
  error: h,
@@ -37,7 +38,7 @@ function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize:
37
38
  }), j = (e) => {
38
39
  b?.(e), x?.(e.currentTarget.value);
39
40
  };
40
- return /* @__PURE__ */ l(n, {
41
+ return /* @__PURE__ */ l(r, {
41
42
  "data-ui": "textarea",
42
43
  className: C,
43
44
  sx: w,
@@ -60,7 +61,7 @@ function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize:
60
61
  onChange: j,
61
62
  className: S?.control?.className,
62
63
  css: [
63
- i,
64
+ t,
64
65
  u,
65
66
  d[g],
66
67
  f[_],
@@ -73,7 +74,7 @@ function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize:
73
74
  part: S?.description,
74
75
  children: m
75
76
  }),
76
- /* @__PURE__ */ c(r, {
77
+ /* @__PURE__ */ c(i, {
77
78
  id: A.errorId,
78
79
  part: S?.error,
79
80
  children: h
package/dist/textarea.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Textarea } from "./textarea-DyfjtP0A.js";
2
+ export { t as Textarea } from "./textarea-BrW0XcG_.js";
@@ -0,0 +1,46 @@
1
+ 'use client';
2
+ import { a as e, n as t, t as n } from "./sx-Dx9JUKp5.js";
3
+ import { n as r, r as i } from "./theme-scope-t7nAKc2c.js";
4
+ import { useContext as a, useMemo as o } from "react";
5
+ import { vars as s } from "@jfrader/tokens/vars";
6
+ import { jsx as c } from "@emotion/react/jsx-runtime";
7
+ //#region src/styling/theme.ts
8
+ var l = s;
9
+ //#endregion
10
+ //#region src/components/theme-provider/theme-provider.tsx
11
+ function u({ theme: e = l, children: n }) {
12
+ return /* @__PURE__ */ c(t, {
13
+ theme: e,
14
+ children: n
15
+ });
16
+ }
17
+ u.displayName = "ThemeProvider";
18
+ function d() {
19
+ return e();
20
+ }
21
+ //#endregion
22
+ //#region src/components/theme-root/theme-root.tsx
23
+ function f({ ref: e, theme: t = "dark", portalContainer: s, className: l, sx: d, ...f }) {
24
+ let p = a(r), m = s === void 0 ? p?.portalContainer : s, h = o(() => ({
25
+ theme: t,
26
+ portalContainer: m
27
+ }), [t, m]);
28
+ return /* @__PURE__ */ c(r.Provider, {
29
+ value: h,
30
+ children: /* @__PURE__ */ c(u, { children: /* @__PURE__ */ c(n, {
31
+ className: l,
32
+ styles: i,
33
+ sx: d,
34
+ children: (n) => /* @__PURE__ */ c("div", {
35
+ "data-ui": "theme-root",
36
+ "data-theme": t,
37
+ ...f,
38
+ ref: e,
39
+ className: n
40
+ })
41
+ }) })
42
+ });
43
+ }
44
+ f.displayName = "ThemeRoot";
45
+ //#endregion
46
+ export { l as i, u as n, d as r, f as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as ThemeRoot } from "./theme-root-BiXXvQvr.js";
2
+ export { t as ThemeRoot } from "./theme-root-BbTBuLMQ.js";
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ import { r as e } from "./sx-Dx9JUKp5.js";
3
+ import { createContext as t, useContext as n } from "react";
4
+ import { vars as r } from "@jfrader/tokens/vars";
5
+ import { jsx as i } from "@emotion/react/jsx-runtime";
6
+ //#region src/styling/theme-scope.tsx
7
+ var a = t(null);
8
+ function o() {
9
+ return n(a);
10
+ }
11
+ var s = e({
12
+ color: r.color.text,
13
+ colorScheme: "dark",
14
+ "&[data-theme=\"light\"]": { colorScheme: "light" }
15
+ }), c = e({ display: "contents" });
16
+ function l({ children: e }) {
17
+ let t = o();
18
+ return t ? /* @__PURE__ */ i("div", {
19
+ "data-ui": "theme-boundary",
20
+ "data-theme": t.theme,
21
+ css: [s, c],
22
+ children: e
23
+ }) : e;
24
+ }
25
+ l.displayName = "ThemeBoundary";
26
+ //#endregion
27
+ export { o as i, a as n, s as r, l as t };