@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,384 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { t as n } from "./focus-ring-BK5W5_NY.js";
4
+ import { t as r } from "./use-controlled-state-DpeVQZNR.js";
5
+ import { t as i } from "./visually-hidden-BJdvqqvn.js";
6
+ import { t as a } from "./renderable-DzcIj1Lo.js";
7
+ import { n as o, t as s } from "./surface-DZ4d-2aL.js";
8
+ import { t as c } from "./trigger-style-B1KVC8O1.js";
9
+ import { t as l } from "./overlay-layer-SeUyyEPD.js";
10
+ import { i as u, r as d, t as f } from "./use-native-dialog-DWpIUVO1.js";
11
+ import { n as p } from "./listbox-style-WX-RASp1.js";
12
+ import { a as m, r as h, t as g } from "./collection-registry-k6JcD3Jr.js";
13
+ import { createContext as _, useCallback as v, useContext as y, useId as b, useMemo as x, useRef as S, useState as C } from "react";
14
+ import { vars as w } from "@jfrader/tokens/vars";
15
+ import { jsx as T, jsxs as E } from "@emotion/react/jsx-runtime";
16
+ import { FloatingList as D, useFloatingRootContext as O, useInteractions as ee, useListNavigation as te, useMergeRefs as k } from "@floating-ui/react";
17
+ //#region src/components/command-palette/command-palette.styles.ts
18
+ var A = e({
19
+ ...s,
20
+ marginBlockStart: w.space[12]
21
+ }), j = e({
22
+ ...o,
23
+ display: "flex",
24
+ flexDirection: "column",
25
+ borderRadius: w.radius.lg,
26
+ boxShadow: w.shadow.floating,
27
+ inlineSize: "min(560px, calc(100vw - 32px))"
28
+ }), M = e({
29
+ boxSizing: "border-box",
30
+ inlineSize: "100%",
31
+ blockSize: "48px",
32
+ margin: 0,
33
+ border: 0,
34
+ borderBlockEnd: `1px solid ${w.color.borderControl}`,
35
+ borderStartStartRadius: w.radius.lg,
36
+ borderStartEndRadius: w.radius.lg,
37
+ backgroundColor: "transparent",
38
+ paddingInline: w.space[4],
39
+ font: "inherit",
40
+ fontSize: w.textSize.md,
41
+ color: w.color.text,
42
+ "&::placeholder": { color: w.color.textSubtle },
43
+ "&:focus-visible": { ...n }
44
+ }), N = e({
45
+ boxSizing: "border-box",
46
+ display: "flex",
47
+ flexDirection: "column",
48
+ maxBlockSize: "320px",
49
+ overflow: "auto",
50
+ padding: w.space[1],
51
+ "&[hidden]": { display: "none" }
52
+ }), P = e({
53
+ display: "flex",
54
+ flexDirection: "column",
55
+ "&[hidden]": { display: "none" }
56
+ }), F = e({
57
+ paddingBlock: w.space[1],
58
+ paddingInline: w.space[2],
59
+ fontSize: w.textSize.xs,
60
+ fontWeight: w.fontWeight.medium,
61
+ color: w.color.textMuted
62
+ }), I = e({
63
+ "&:hover, &[data-active]": { backgroundColor: w.color.surfaceHover },
64
+ "&[hidden]": { display: "none" }
65
+ }), L = e({
66
+ paddingBlock: w.space[6],
67
+ paddingInline: w.space[4],
68
+ textAlign: "center",
69
+ fontSize: w.textSize.sm,
70
+ color: w.color.textMuted
71
+ }), ne = "Command palette", re = "No results", R = new Intl.PluralRules("en"), ie = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), ae = (e) => `${e} ${R.select(e) === "one" ? "result" : "results"}`, z = _(null), B = _(null);
72
+ function V(e) {
73
+ let t = y(z);
74
+ if (!t) throw Error(`CommandPalette.${e} must be rendered inside <CommandPalette>.`);
75
+ return t;
76
+ }
77
+ var H = (e) => {
78
+ e?.setAttribute("autofocus", "");
79
+ };
80
+ function U({ open: e, defaultOpen: t = !1, onOpenChange: n, label: i = ne, filter: a = ie, emptyMessage: o = re, formatResultCount: s = ae, children: c }) {
81
+ let l = b(), [d = !1, f] = r(e, t, n), { dialogElementRef: p, setDialogElement: h, setOpen: g, requestClose: _, repairToken: y } = u(d, f), [w, E] = C(""), [D, k] = C(!1), [A, j] = C(null), [M, N] = m(), [P, F] = C(null), [I, L] = C(null), [R, B] = C(d), V = S([]);
82
+ d !== R && (B(d), d && (E(""), k(!1), j(null)));
83
+ let H = v(() => {
84
+ g(!(d && p.current?.open));
85
+ }, [
86
+ d,
87
+ g,
88
+ p
89
+ ]), { matchedValues: U, matchedIndices: W, visibleGroupIds: G } = x(() => {
90
+ let e = /* @__PURE__ */ new Set(), t = [], n = /* @__PURE__ */ new Set();
91
+ return M.forEach((r, i) => {
92
+ r.index !== -1 && (w === "" || a(r.label, w) || r.keywords !== void 0 && a(r.keywords, w)) && (e.add(i), t.push(r.index), r.groupId !== null && n.add(r.groupId));
93
+ }), t.sort((e, t) => e - t), {
94
+ matchedValues: e,
95
+ matchedIndices: t,
96
+ visibleGroupIds: n
97
+ };
98
+ }, [
99
+ M,
100
+ w,
101
+ a
102
+ ]), K = x(() => new Set(W), [W]), q = A !== null && K.has(A) ? A : W[0] ?? null, J = O({
103
+ open: d,
104
+ onOpenChange: (e) => g(e),
105
+ elements: {
106
+ reference: P,
107
+ floating: I
108
+ }
109
+ }), Y = te(J, {
110
+ listRef: V,
111
+ activeIndex: q,
112
+ onNavigate: (e) => {
113
+ e !== null && j(e);
114
+ },
115
+ virtual: !0,
116
+ loop: !0,
117
+ focusItemOnOpen: !1,
118
+ disabledIndices: (e) => !K.has(e)
119
+ }), { getReferenceProps: X, getFloatingProps: Z, getItemProps: Q } = ee([Y]), $ = W.length, oe = D ? s($) : "", se = x(() => ({
120
+ open: d,
121
+ setOpen: g,
122
+ toggleOpen: H,
123
+ requestClose: _,
124
+ repairToken: y,
125
+ setDialogElement: h,
126
+ label: i,
127
+ emptyMessage: o,
128
+ baseId: l,
129
+ listId: `${l}-list`,
130
+ query: w,
131
+ announcement: oe,
132
+ matchCount: $,
133
+ matchedValues: U,
134
+ visibleGroupIds: G,
135
+ activeIndex: q,
136
+ elementsRef: V,
137
+ setInputElement: F,
138
+ setListElement: L,
139
+ getReferenceProps: X,
140
+ getFloatingProps: Z,
141
+ getItemProps: Q,
142
+ changeQuery: (e) => {
143
+ E(e), k(!0), j(null);
144
+ },
145
+ moveToEdge: (e) => {
146
+ let t = e === "first" ? W[0] : W[W.length - 1];
147
+ t !== void 0 && j(t);
148
+ },
149
+ registration: N
150
+ }), [
151
+ d,
152
+ g,
153
+ H,
154
+ _,
155
+ y,
156
+ h,
157
+ i,
158
+ o,
159
+ l,
160
+ w,
161
+ oe,
162
+ $,
163
+ U,
164
+ W,
165
+ G,
166
+ q,
167
+ X,
168
+ Z,
169
+ Q,
170
+ N
171
+ ]);
172
+ return /* @__PURE__ */ T(z.Provider, {
173
+ value: se,
174
+ children: c
175
+ });
176
+ }
177
+ function W(e) {
178
+ return /* @__PURE__ */ T(l, { children: /* @__PURE__ */ T(U, { ...e }) });
179
+ }
180
+ W.displayName = "CommandPalette";
181
+ function G({ ref: e, onClick: n, className: r, sx: i, ...a }) {
182
+ let { open: o, toggleOpen: s } = V("Trigger"), l = (e) => {
183
+ n?.(e), e.defaultPrevented || s();
184
+ };
185
+ return /* @__PURE__ */ T(t, {
186
+ className: r,
187
+ styles: c,
188
+ sx: i,
189
+ children: (t) => /* @__PURE__ */ T("button", {
190
+ type: "button",
191
+ ...a,
192
+ ref: e,
193
+ "data-ui": "command-palette-trigger",
194
+ "aria-haspopup": "dialog",
195
+ "aria-expanded": o,
196
+ onClick: l,
197
+ className: t
198
+ })
199
+ });
200
+ }
201
+ G.displayName = "CommandPalette.Trigger";
202
+ function K({ ref: e, className: n, sx: r, ...a }) {
203
+ let { children: o, onCancel: s, onClick: c, onClose: l, ...u } = f(a), p = V("Content"), { label: m, announcement: h } = p, g = d(p, {
204
+ onCancel: s,
205
+ onClick: c,
206
+ onClose: l
207
+ }, e);
208
+ return /* @__PURE__ */ T(t, {
209
+ className: n,
210
+ styles: A,
211
+ sx: r,
212
+ children: (e) => /* @__PURE__ */ T("dialog", {
213
+ "aria-label": m,
214
+ ...u,
215
+ ...g,
216
+ "data-ui": "command-palette",
217
+ "aria-modal": "true",
218
+ className: e,
219
+ children: /* @__PURE__ */ E("div", {
220
+ css: j,
221
+ children: [o, /* @__PURE__ */ T("div", {
222
+ role: "status",
223
+ "aria-live": "polite",
224
+ "aria-atomic": "true",
225
+ css: i,
226
+ children: h
227
+ })]
228
+ })
229
+ })
230
+ });
231
+ }
232
+ K.displayName = "CommandPalette.Content";
233
+ function q({ ref: e, onChange: n, onKeyDown: r, className: i, sx: a, ...o }) {
234
+ let { label: s, listId: c, query: l, matchCount: u, activeIndex: d, elementsRef: f, requestClose: p, setInputElement: m, getReferenceProps: h, changeQuery: g, moveToEdge: _ } = V("Input"), v = k([
235
+ m,
236
+ H,
237
+ e
238
+ ]), y = (e) => {
239
+ n?.(e), g(e.currentTarget.value);
240
+ }, b = (e) => {
241
+ r?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing) && (e.key === "Escape" ? (e.preventDefault(), p()) : (e.key === "Home" || e.key === "End") && !e.shiftKey && !e.ctrlKey && !e.metaKey && !e.altKey ? (e.preventDefault(), _(e.key === "Home" ? "first" : "last")) : e.key === "Enter" && d !== null && (e.preventDefault(), f.current[d]?.click()));
242
+ };
243
+ return /* @__PURE__ */ T(t, {
244
+ className: i,
245
+ styles: M,
246
+ sx: a,
247
+ children: (e) => /* @__PURE__ */ T("input", {
248
+ "aria-label": s,
249
+ autoComplete: "off",
250
+ spellCheck: !1,
251
+ ...h({
252
+ ...o,
253
+ onChange: y,
254
+ onKeyDown: b
255
+ }),
256
+ ref: v,
257
+ type: "text",
258
+ value: l,
259
+ role: "combobox",
260
+ "aria-autocomplete": "list",
261
+ "aria-expanded": u > 0,
262
+ "aria-controls": c,
263
+ "data-ui": "command-palette-input",
264
+ className: e
265
+ })
266
+ });
267
+ }
268
+ q.displayName = "CommandPalette.Input";
269
+ function J({ ref: e, onMouseDown: n, children: r, className: i, sx: a, ...o }) {
270
+ let { label: s, listId: c, matchCount: l, elementsRef: u, setListElement: d, getFloatingProps: f } = V("List"), p = k([d, e]), m = (e) => {
271
+ n?.(e), e.preventDefault();
272
+ };
273
+ return /* @__PURE__ */ T(t, {
274
+ className: i,
275
+ styles: N,
276
+ sx: a,
277
+ children: (e) => /* @__PURE__ */ T("div", {
278
+ "aria-label": s,
279
+ ...f({
280
+ ...o,
281
+ onMouseDown: m
282
+ }),
283
+ ref: p,
284
+ id: c,
285
+ role: "listbox",
286
+ hidden: l === 0,
287
+ "data-ui": "command-palette-list",
288
+ className: e,
289
+ children: /* @__PURE__ */ T(D, {
290
+ elementsRef: u,
291
+ children: r
292
+ })
293
+ })
294
+ });
295
+ }
296
+ J.displayName = "CommandPalette.List";
297
+ function Y({ ref: e, children: n, className: r, sx: i, ...o }) {
298
+ let { matchCount: s, emptyMessage: c } = V("Empty");
299
+ return s > 0 ? null : /* @__PURE__ */ T(t, {
300
+ className: r,
301
+ styles: L,
302
+ sx: i,
303
+ children: (t) => /* @__PURE__ */ T("div", {
304
+ ...o,
305
+ ref: e,
306
+ "data-ui": "command-palette-empty",
307
+ className: t,
308
+ children: a(n) ? n : c
309
+ })
310
+ });
311
+ }
312
+ Y.displayName = "CommandPalette.Empty";
313
+ function X({ ref: e, label: n, children: r, "aria-labelledby": i, className: a, sx: o, ...s }) {
314
+ let { visibleGroupIds: c } = V("Group"), l = b(), u = `${l}-heading`;
315
+ return /* @__PURE__ */ T(t, {
316
+ className: a,
317
+ styles: P,
318
+ sx: o,
319
+ children: (t) => /* @__PURE__ */ E("div", {
320
+ ...s,
321
+ ref: e,
322
+ role: "group",
323
+ "aria-labelledby": [i, u].filter(Boolean).join(" "),
324
+ hidden: !c.has(l),
325
+ "data-ui": "command-palette-group",
326
+ className: t,
327
+ children: [/* @__PURE__ */ T("div", {
328
+ id: u,
329
+ css: F,
330
+ children: n
331
+ }), /* @__PURE__ */ T(B.Provider, {
332
+ value: l,
333
+ children: r
334
+ })]
335
+ })
336
+ });
337
+ }
338
+ X.displayName = "CommandPalette.Group";
339
+ function Z({ ref: e, value: n, onSelect: r, keywords: i, onClick: a, children: o, className: s, sx: c, ...l }) {
340
+ let { baseId: u, activeIndex: d, matchedValues: f, getItemProps: m, setOpen: _, registration: v } = V("Item"), b = y(B), x = S(null), { ref: C, index: w } = h(n, v, x, (e, t) => ({
341
+ index: e,
342
+ label: t,
343
+ keywords: i,
344
+ groupId: b
345
+ })), E = k([
346
+ C,
347
+ x,
348
+ e
349
+ ]), D = w !== -1 && d === w, O = (e) => {
350
+ a?.(e), !e.defaultPrevented && (r?.(), _(!1));
351
+ };
352
+ return /* @__PURE__ */ T(t, {
353
+ className: s,
354
+ styles: [p, I],
355
+ sx: c,
356
+ children: (e) => /* @__PURE__ */ T("div", {
357
+ ...m({
358
+ id: g(u, n),
359
+ ...l,
360
+ onClick: O
361
+ }),
362
+ ref: E,
363
+ role: "option",
364
+ "aria-selected": D,
365
+ hidden: !f.has(n),
366
+ "data-active": D || void 0,
367
+ "data-ui": "command-palette-item",
368
+ className: e,
369
+ children: o
370
+ })
371
+ });
372
+ }
373
+ Z.displayName = "CommandPalette.Item";
374
+ var Q = Object.assign(W, {
375
+ Trigger: G,
376
+ Content: K,
377
+ Input: q,
378
+ List: J,
379
+ Empty: Y,
380
+ Group: X,
381
+ Item: Z
382
+ });
383
+ //#endregion
384
+ export { Q as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as CommandPalette } from "./command-palette-V_2pEay7.js";
2
+ export { t as CommandPalette } from "./command-palette-BQ5LleGb.js";
@@ -0,0 +1,252 @@
1
+ 'use client';
2
+ import { r as e } from "./sx-Dx9JUKp5.js";
3
+ import { n as t, r as n } from "./media-8yrN85VT.js";
4
+ import { t as r } from "./use-controlled-state-DpeVQZNR.js";
5
+ import { t as i } from "./visually-hidden-BJdvqqvn.js";
6
+ import { t as a } from "./renderable-DzcIj1Lo.js";
7
+ import { t as o } from "./loading-ring-B8-30Dl1.js";
8
+ import { t as ee } from "./button-C92uYFJW.js";
9
+ import { useEffect as s, useRef as c, useState as l } from "react";
10
+ import { vars as u } from "@jfrader/tokens/vars";
11
+ import { Fragment as d, jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
12
+ import { flushSync as te } from "react-dom";
13
+ //#region src/components/copy-button/copy-button.tsx
14
+ var m = 1900, h = [
15
+ "idle",
16
+ "pending",
17
+ "copied",
18
+ "error"
19
+ ], ne = e({
20
+ label: "copy-button",
21
+ position: "relative",
22
+ maxInlineSize: "100%"
23
+ }), re = e({
24
+ whiteSpace: "normal",
25
+ blockSize: "auto",
26
+ paddingBlock: u.space[1]
27
+ }), g = {
28
+ sm: e({ minBlockSize: u.space[8] }),
29
+ md: e({ minBlockSize: u.space[10] }),
30
+ lg: e({ minBlockSize: u.space[12] })
31
+ }, ie = {
32
+ sm: e({
33
+ inlineSize: u.space[8],
34
+ paddingInline: 0
35
+ }),
36
+ md: e({
37
+ inlineSize: u.space[10],
38
+ paddingInline: 0
39
+ }),
40
+ lg: e({
41
+ inlineSize: u.space[12],
42
+ paddingInline: 0
43
+ })
44
+ }, _ = e({
45
+ display: "grid",
46
+ minInlineSize: 0
47
+ }), v = e({
48
+ flexShrink: 0,
49
+ inlineSize: u.space[4],
50
+ blockSize: u.space[4]
51
+ }), y = e({ textAlign: "start" }), b = e({
52
+ gridArea: "1 / 1",
53
+ minInlineSize: 0,
54
+ opacity: 0,
55
+ transitionProperty: "opacity",
56
+ transitionDuration: u.motion.duration.base,
57
+ transitionTimingFunction: u.motion.easeStandard,
58
+ "&[data-active]": { opacity: 1 },
59
+ [n]: { transitionDuration: "0s" }
60
+ }), ae = e({ overflowWrap: "anywhere" }), oe = e({
61
+ display: "inline-flex",
62
+ alignItems: "center",
63
+ justifyContent: "center",
64
+ "& svg": {
65
+ inlineSize: "100%",
66
+ blockSize: "100%"
67
+ }
68
+ }), x = {
69
+ copied: e({
70
+ color: u.color.success,
71
+ [t]: { color: "ButtonText" }
72
+ }),
73
+ error: e({
74
+ color: u.color.dangerText,
75
+ [t]: { color: "ButtonText" }
76
+ })
77
+ }, se = {
78
+ solid: {},
79
+ soft: x,
80
+ outline: x,
81
+ ghost: x
82
+ }, S = e({
83
+ ...o,
84
+ boxSizing: "border-box",
85
+ inlineSize: "100%",
86
+ blockSize: "100%",
87
+ [n]: { animation: "none" }
88
+ }), C = {
89
+ viewBox: "0 0 16 16",
90
+ fill: "none",
91
+ stroke: "currentColor",
92
+ strokeWidth: 1.5,
93
+ strokeLinecap: "round",
94
+ strokeLinejoin: "round"
95
+ }, ce = {
96
+ idle: /* @__PURE__ */ p("svg", {
97
+ ...C,
98
+ children: [/* @__PURE__ */ f("rect", {
99
+ x: "5.5",
100
+ y: "5.5",
101
+ width: "8",
102
+ height: "8",
103
+ rx: "1.5"
104
+ }), /* @__PURE__ */ f("path", { d: "M10.5 3.5v-.5a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h.5" })]
105
+ }),
106
+ pending: /* @__PURE__ */ f("span", { css: S }),
107
+ copied: /* @__PURE__ */ f("svg", {
108
+ ...C,
109
+ children: /* @__PURE__ */ f("path", { d: "M3 8.5l3.25 3.25L13 5" })
110
+ }),
111
+ error: /* @__PURE__ */ f("svg", {
112
+ ...C,
113
+ children: /* @__PURE__ */ f("path", { d: "M4.5 4.5l7 7M11.5 4.5l-7 7" })
114
+ })
115
+ }, w = (e) => e === "copied" || e === "error", T = (e) => e === !0 || e === "true";
116
+ function E({ ref: e, text: t, label: n, pendingLabel: o, copiedLabel: u, errorLabel: x, iconOnly: S = !1, icons: C, value: E, defaultValue: le = "idle", onValueChange: ue, onCopied: D, onCopyError: O, resetAfterMs: k = m, variant: A = "outline", tone: j = "neutral", size: M = "sm", slotProps: N, disabled: P, onClick: F, className: I, css: L, sx: R, ...z }) {
117
+ let [B, V] = r(E, le, ue), H = B ?? "idle", U = c(null), [W, G] = l(!1), K = c(!1), q = c(V), J = c({
118
+ onCopied: D,
119
+ onCopyError: O
120
+ });
121
+ s(() => {
122
+ q.current = V, J.current = {
123
+ onCopied: D,
124
+ onCopyError: O
125
+ };
126
+ }), s(() => (K.current = !0, () => {
127
+ K.current = !1, U.current = null;
128
+ }), []);
129
+ let Y = Number.isFinite(k) && k > 0 ? k : 0;
130
+ s(() => {
131
+ if (W || !w(H) || Y === 0) return;
132
+ let e = setTimeout(() => q.current("idle"), Y);
133
+ return () => clearTimeout(e);
134
+ }, [
135
+ H,
136
+ W,
137
+ Y
138
+ ]);
139
+ let X = (e, t) => {
140
+ K.current && U.current === e && (U.current = null, G(!1), t.ok ? (q.current("copied"), J.current.onCopied?.(t.text)) : (q.current("error"), J.current.onCopyError?.(t.error)));
141
+ }, de = (e) => {
142
+ if (U.current || (F?.(e), e.defaultPrevented)) return;
143
+ let n = t, r = e.currentTarget.ownerDocument.defaultView?.navigator.clipboard, i = {};
144
+ if (U.current = i, te(() => {
145
+ G(!0), V("pending");
146
+ }), typeof r?.writeText != "function") {
147
+ X(i, {
148
+ ok: !1,
149
+ error: /* @__PURE__ */ Error("Clipboard API is unavailable")
150
+ });
151
+ return;
152
+ }
153
+ let a;
154
+ try {
155
+ a = r.writeText(n);
156
+ } catch (e) {
157
+ X(i, {
158
+ ok: !1,
159
+ error: e
160
+ });
161
+ return;
162
+ }
163
+ Promise.resolve(a).then(() => X(i, {
164
+ ok: !0,
165
+ text: n
166
+ }), (e) => X(i, {
167
+ ok: !1,
168
+ error: e
169
+ }));
170
+ }, Z = H === "pending", Q = {
171
+ idle: n,
172
+ pending: o,
173
+ copied: u,
174
+ error: x
175
+ }, $ = h.map((e) => C?.[e] === void 0 ? ce[e] : C[e]), fe = $.some(a), { css: pe, ...me } = N?.icon ?? {}, { css: he, ...ge } = N?.label ?? {}, { css: _e, ...ve } = N?.status ?? {};
176
+ return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ p(ee, {
177
+ ...z,
178
+ ref: e,
179
+ type: "button",
180
+ variant: A,
181
+ tone: j,
182
+ size: M,
183
+ "data-ui": "copy-button",
184
+ "data-state": H,
185
+ "aria-busy": Z ? !0 : z["aria-busy"],
186
+ "aria-disabled": Z || T(z["aria-disabled"]) ? !0 : z["aria-disabled"],
187
+ onClick: de,
188
+ className: I,
189
+ css: [
190
+ ne,
191
+ S ? ie[M] : [re, g[M]],
192
+ L
193
+ ],
194
+ sx: R,
195
+ render: (e) => /* @__PURE__ */ f("button", {
196
+ ...e,
197
+ type: "button",
198
+ disabled: P
199
+ }),
200
+ children: [
201
+ /* @__PURE__ */ f("span", {
202
+ css: i,
203
+ children: n
204
+ }),
205
+ fe && /* @__PURE__ */ f("span", {
206
+ ...me,
207
+ "aria-hidden": "true",
208
+ "data-ui": "copy-button-icon",
209
+ css: [
210
+ _,
211
+ v,
212
+ pe
213
+ ],
214
+ children: h.map((e, t) => /* @__PURE__ */ f("span", {
215
+ "data-active": e === H || void 0,
216
+ css: [
217
+ b,
218
+ oe,
219
+ se[A][e]
220
+ ],
221
+ children: $[t]
222
+ }, e))
223
+ }),
224
+ !S && /* @__PURE__ */ f("span", {
225
+ ...ge,
226
+ "aria-hidden": "true",
227
+ "data-ui": "copy-button-label",
228
+ css: [
229
+ _,
230
+ y,
231
+ he
232
+ ],
233
+ children: h.map((e) => /* @__PURE__ */ f("span", {
234
+ "data-active": e === H || void 0,
235
+ css: [b, ae],
236
+ children: Q[e]
237
+ }, e))
238
+ })
239
+ ]
240
+ }), /* @__PURE__ */ f("span", {
241
+ ...ve,
242
+ role: "status",
243
+ "aria-live": "polite",
244
+ "aria-atomic": "true",
245
+ "data-ui": "copy-button-status",
246
+ css: [i, _e],
247
+ children: H === "idle" ? "" : Q[H]
248
+ })] });
249
+ }
250
+ E.displayName = "CopyButton";
251
+ //#endregion
252
+ export { E as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as CopyButton } from "./copy-button-ByiA6D3R.js";