@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
@@ -1,250 +0,0 @@
1
- 'use client';
2
- import { r as e, t } from "./sx-Dx9JUKp5.js";
3
- import { t as n } from "./use-controlled-state-CVXDa-qM.js";
4
- import { t as r } from "./renderable-DzcIj1Lo.js";
5
- import { t as i } from "./calendar-C9Yad_-w.js";
6
- import { n as a } from "./surface-DZ4d-2aL.js";
7
- import { t as o } from "./use-overlay-floating-efeqppiw.js";
8
- import { t as s } from "./text-field-D60ok14S.js";
9
- import { createContext as c, useContext as l, useEffect as u, useId as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
10
- import { vars as g } from "@jfrader/tokens/vars";
11
- import { jsx as _, jsxs as v } from "@emotion/react/jsx-runtime";
12
- import { FloatingFocusManager as y, FloatingPortal as b, useClick as x, useDismiss as S, useInteractions as C, useMergeRefs as w, useRole as T } from "@floating-ui/react";
13
- //#region src/components/date-picker/date-picker.tsx
14
- var E = "bottom-start", D = /* @__PURE__ */ new Set(["Enter", "ArrowDown"]), O = " ", k = "[data-ui=\"calendar-day\"][tabindex=\"0\"]", A = "[data-ui=\"calendar-day\"]", j = /^\d{4}-\d{2}-\d{2}$/, M = {
15
- calendar: "gregory",
16
- timeZone: "UTC",
17
- dateStyle: "medium"
18
- }, N = c(null);
19
- function P(e) {
20
- let t = l(N);
21
- if (!t) throw Error(`DatePicker.${e} must be rendered inside <DatePicker>.`);
22
- return t;
23
- }
24
- var F = (e, t) => String(e).padStart(t, "0"), I = (e, t, n) => `${F(e, 4)}-${F(t, 2)}-${F(n, 2)}`;
25
- function L(e) {
26
- if (e === void 0 || !j.test(e)) return;
27
- let [t = NaN, n = NaN, r = NaN] = e.split("-").map(Number), i = new Date(Date.UTC(0, 0, 1));
28
- return i.setUTCFullYear(t, n - 1, r), I(i.getUTCFullYear(), i.getUTCMonth() + 1, i.getUTCDate()) === e ? i : void 0;
29
- }
30
- var R = (e) => L(e) ? e : void 0;
31
- function ee(e, t, n) {
32
- return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
33
- }
34
- function te() {
35
- let e = /* @__PURE__ */ new Date();
36
- return I(e.getFullYear(), e.getMonth() + 1, e.getDate());
37
- }
38
- var ne = () => typeof navigator > "u" ? void 0 : navigator.language;
39
- function re(e, t) {
40
- let n = new Intl.DisplayNames(t, { type: "dateTimeField" });
41
- return e.formatToParts(/* @__PURE__ */ new Date(0)).map((e) => e.type === "literal" ? e.value : n.of(e.type) ?? e.value).join("");
42
- }
43
- function z(e) {
44
- let t = e?.querySelector(k) ?? null;
45
- return t?.focus({ preventScroll: !0 }), t;
46
- }
47
- var B = e({
48
- cursor: "pointer",
49
- "&:disabled": { cursor: "not-allowed" }
50
- }), V = e({
51
- ...a,
52
- borderRadius: g.radius.md,
53
- boxShadow: g.shadow.overlay,
54
- padding: g.space[3]
55
- });
56
- function H({ value: e, defaultValue: t, onValueChange: r, open: i, defaultOpen: a = !1, onOpenChange: s, min: c, max: l, locale: d, firstDayOfWeek: f, disabled: g = !1, name: y, placeholder: b, children: w }) {
57
- let [D, O] = n(e, t, r), [k = !1, A] = n(i, a, s), [j, P] = h(!1), F = g || j, I = k && !F, [z, B] = h(null), V = m(null), H = m(!1), U = p(() => new Intl.DateTimeFormat(d ?? ne()).resolvedOptions().locale, [d]), W = p(() => new Intl.DateTimeFormat(U, M), [U]), G = p(() => re(W, U), [W, U]), K = L(D), q = K ? W.format(K) : "", J = R(c), Y = R(l), X = ee(R(D) ?? te(), J, Y).slice(0, 7), { refs: Z, floatingStyles: Q, context: $ } = o({
58
- open: I,
59
- placement: E,
60
- onOpenChange: (e, t, n) => {
61
- F && e || (e || (H.current = n === "escape-key"), A(e));
62
- }
63
- });
64
- u(() => {
65
- F && (H.current = !1, k && A(!1));
66
- }, [
67
- F,
68
- k,
69
- A
70
- ]), u(() => {
71
- !F && !I && H.current && (H.current = !1, Z.domReference.current?.focus());
72
- }, [
73
- F,
74
- I,
75
- Z
76
- ]);
77
- let ie = x($, {
78
- enabled: !F,
79
- keyboardHandlers: !1
80
- }), ae = S($, {
81
- escapeKey: !0,
82
- outsidePress: !0
83
- }), oe = T($, { role: "dialog" }), { getReferenceProps: se, getFloatingProps: ce } = C([
84
- ie,
85
- ae,
86
- oe
87
- ]), le = p(() => ({
88
- open: I,
89
- disabled: F,
90
- value: D,
91
- displayValue: q,
92
- placeholder: b ?? G,
93
- initialMonth: X,
94
- min: J,
95
- max: Y,
96
- locale: U,
97
- firstDayOfWeek: f,
98
- inputLabelling: z,
99
- gridRef: V,
100
- refs: Z,
101
- floatingContext: $,
102
- floatingStyles: Q,
103
- getReferenceProps: se,
104
- getFloatingProps: ce,
105
- requestOpenChange: (e) => {
106
- F && e || A(e);
107
- },
108
- selectDate: (e) => {
109
- F || (O(e), H.current = !0, A(!1));
110
- },
111
- setInputLabelling: B,
112
- setInputDisabled: P
113
- }), [
114
- I,
115
- F,
116
- D,
117
- q,
118
- b,
119
- G,
120
- X,
121
- J,
122
- Y,
123
- U,
124
- f,
125
- z,
126
- Z,
127
- $,
128
- Q,
129
- se,
130
- ce,
131
- A,
132
- O
133
- ]);
134
- return /* @__PURE__ */ v(N.Provider, {
135
- value: le,
136
- children: [w, y !== void 0 && /* @__PURE__ */ _("input", {
137
- type: "hidden",
138
- name: y,
139
- value: D ?? "",
140
- disabled: F
141
- })]
142
- });
143
- }
144
- H.displayName = "DatePicker";
145
- function U({ ref: e, label: t, id: n, disabled: i, slotProps: a, onKeyDown: o, onKeyUp: c, ...l }) {
146
- let { open: u, disabled: p, displayValue: m, placeholder: h, gridRef: g, refs: v, getReferenceProps: y, requestOpenChange: b, setInputLabelling: x, setInputDisabled: S } = P("Input"), C = w([v.setReference, e]), T = d(), E = n ?? T, k = `${E}-label`, A = r(t), j = l["aria-labelledby"], M = l["aria-label"], N = M ?? (typeof t == "string" ? t : void 0), F = p || i === !0;
147
- f(() => (S(i === !0), () => S(!1)), [i, S]), f(() => (x(j === void 0 ? M === void 0 ? typeof t == "string" ? { label: t } : { labelledBy: A ? k : void 0 } : { label: M } : { labelledBy: j }), () => x(null)), [
148
- j,
149
- M,
150
- t,
151
- A,
152
- k,
153
- x
154
- ]);
155
- let I = () => {
156
- F || (u ? z(g.current) : b(!0));
157
- }, L = (e) => {
158
- o?.(e), !(e.defaultPrevented || F) && (e.key === O ? e.preventDefault() : D.has(e.key) && (e.preventDefault(), I()));
159
- }, R = (e) => {
160
- c?.(e), !(e.defaultPrevented || F || e.key !== O) && I();
161
- };
162
- return /* @__PURE__ */ _(s, {
163
- ...y({
164
- ...l,
165
- onKeyDown: L,
166
- onKeyUp: R
167
- }),
168
- ref: C,
169
- id: E,
170
- label: A ? /* @__PURE__ */ _("span", {
171
- id: k,
172
- children: t
173
- }) : t,
174
- slotProps: {
175
- ...a,
176
- control: {
177
- ...a?.control,
178
- css: [B, a?.control?.css]
179
- }
180
- },
181
- value: m,
182
- placeholder: h,
183
- disabled: F,
184
- readOnly: !0,
185
- role: "combobox",
186
- "aria-label": N,
187
- "aria-autocomplete": "none",
188
- "data-state": u ? "open" : "closed",
189
- "data-ui": "date-picker-input"
190
- });
191
- }
192
- U.displayName = "DatePicker.Input";
193
- function W({ ref: e, style: n, className: r, sx: a, ...o }) {
194
- let { open: s, value: c, initialMonth: l, min: u, max: d, locale: f, firstDayOfWeek: p, inputLabelling: h, gridRef: g, refs: x, floatingContext: S, floatingStyles: C, getFloatingProps: T, selectDate: E } = P("Popup"), D = w([x.setFloating, e]), O = m(null), k = w([(e) => {
195
- g.current = e, O.current = z(e);
196
- }]);
197
- if (!s) return null;
198
- let j = o["aria-labelledby"] !== void 0 || o["aria-label"] !== void 0 ? {} : h?.labelledBy === void 0 ? { "aria-label": h?.label } : { "aria-labelledby": h.labelledBy }, M = (e) => {
199
- let t = e.target.closest(A);
200
- if (t?.disabled) return;
201
- let n = t?.dataset.date;
202
- n !== void 0 && E(n);
203
- }, N = (e) => {
204
- e.target.closest(A)?.disabled && e.preventDefault();
205
- };
206
- return /* @__PURE__ */ _(b, { children: /* @__PURE__ */ _(y, {
207
- context: S,
208
- modal: !1,
209
- initialFocus: O,
210
- returnFocus: !1,
211
- children: /* @__PURE__ */ _(t, {
212
- className: r,
213
- styles: V,
214
- sx: a,
215
- children: (e) => /* @__PURE__ */ _("div", {
216
- ...T({
217
- ...j,
218
- ...o
219
- }),
220
- ref: D,
221
- "data-ui": "date-picker-popup",
222
- style: {
223
- ...n,
224
- ...C
225
- },
226
- className: e,
227
- children: /* @__PURE__ */ v(i, {
228
- value: c ?? "",
229
- defaultVisibleMonth: l,
230
- min: u,
231
- max: d,
232
- locale: f,
233
- firstDayOfWeek: p,
234
- children: [/* @__PURE__ */ _(i.Header, {}), /* @__PURE__ */ _(i.Grid, {
235
- ref: k,
236
- onClick: M,
237
- onPointerDownCapture: N
238
- })]
239
- })
240
- })
241
- })
242
- }) });
243
- }
244
- W.displayName = "DatePicker.Popup";
245
- var G = Object.assign(H, {
246
- Input: U,
247
- Popup: W
248
- });
249
- //#endregion
250
- export { G as t };
@@ -1,109 +0,0 @@
1
- 'use client';
2
- import { r as e, t } from "./sx-Dx9JUKp5.js";
3
- import { n } from "./media-D_eA_I-e.js";
4
- import { t as r } from "./renderable-DzcIj1Lo.js";
5
- import { useId as i } from "react";
6
- import { vars as a } from "@jfrader/tokens/vars";
7
- import { jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
8
- //#region src/styling/input-control.ts
9
- var c = e({
10
- display: "block",
11
- inlineSize: "100%",
12
- boxSizing: "border-box",
13
- margin: 0,
14
- backgroundColor: a.color.surfaceRaised,
15
- border: `1px solid ${a.color.borderControl}`,
16
- borderRadius: a.radius.md,
17
- color: a.color.text,
18
- fontFamily: a.font.sans,
19
- transitionProperty: "border-color",
20
- transitionDuration: a.motion.duration.fast,
21
- transitionTimingFunction: a.motion.easeStandard,
22
- "&::placeholder": { color: a.color.textSubtle },
23
- "&:hover:not(:disabled):not(:focus-visible)": { borderColor: a.color.textSubtle },
24
- "&:focus-visible": {
25
- outline: `2px solid ${a.color.focusRing}`,
26
- outlineOffset: "2px",
27
- borderColor: a.color.focusRing
28
- },
29
- "&:disabled": {
30
- opacity: .55,
31
- cursor: "not-allowed"
32
- },
33
- "&[aria-invalid=\"true\"]:not(:focus-visible)": { borderColor: a.color.dangerBorder },
34
- [n]: { transitionDuration: "0s" }
35
- }), l = e({
36
- display: "grid",
37
- gap: a.space[1],
38
- inlineSize: "100%"
39
- }), u = e({
40
- display: "inline-flex",
41
- gap: a.space[1],
42
- fontSize: a.textSize.sm,
43
- fontWeight: a.fontWeight.medium,
44
- color: a.color.text
45
- }), d = e({ color: a.color.dangerText }), f = e({
46
- fontSize: a.textSize.sm,
47
- color: a.color.textMuted
48
- }), p = e({
49
- fontSize: a.textSize.sm,
50
- color: a.color.dangerText
51
- });
52
- function m({ id: e, description: t, error: n, "aria-describedby": a, "aria-invalid": o }) {
53
- let s = i(), c = e ?? s, l = `${c}-description`, u = `${c}-error`, d = r(t), f = r(n);
54
- return {
55
- id: c,
56
- descriptionId: l,
57
- errorId: u,
58
- describedBy: [
59
- a,
60
- d && l,
61
- f && u
62
- ].filter(Boolean).join(" ") || void 0,
63
- ariaInvalid: f ? !0 : o
64
- };
65
- }
66
- function h({ "data-ui": e, className: n, sx: r, part: i, children: a }) {
67
- let s = [n, i?.className].filter(Boolean).join(" ") || void 0;
68
- return /* @__PURE__ */ o(t, {
69
- className: s,
70
- styles: [l, i?.css],
71
- sx: r,
72
- children: (t) => /* @__PURE__ */ o("div", {
73
- "data-ui": e,
74
- className: t,
75
- children: a
76
- })
77
- });
78
- }
79
- function g({ htmlFor: e, required: t, part: n, children: i }) {
80
- return r(i) ? /* @__PURE__ */ s("label", {
81
- htmlFor: e,
82
- className: n?.className,
83
- css: [u, n?.css],
84
- children: [i, t && /* @__PURE__ */ o("span", {
85
- "aria-hidden": !0,
86
- css: d,
87
- children: " *"
88
- })]
89
- }) : null;
90
- }
91
- function _({ id: e, part: t, children: n }) {
92
- return r(n) ? /* @__PURE__ */ o("span", {
93
- id: e,
94
- className: t?.className,
95
- css: [f, t?.css],
96
- children: n
97
- }) : null;
98
- }
99
- function v({ id: e, part: t, children: n }) {
100
- return r(n) ? /* @__PURE__ */ o("span", {
101
- id: e,
102
- role: "alert",
103
- className: t?.className,
104
- css: [p, t?.css],
105
- children: n
106
- }) : null;
107
- }
108
- //#endregion
109
- export { m as a, h as i, v as n, c as o, g as r, _ as t };
@@ -1,216 +0,0 @@
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 { n as r } from "./media-D_eA_I-e.js";
5
- import { t as i } from "./use-controlled-state-CVXDa-qM.js";
6
- import { f as a, i as o, n as s, o as c } from "./collection-registry-BTYi6zGh.js";
7
- import { t as l } from "./trigger-style-B1KVC8O1.js";
8
- import { t as u } from "./use-overlay-floating-efeqppiw.js";
9
- import { createContext as d, useContext as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
10
- import { vars as _ } from "@jfrader/tokens/vars";
11
- import { jsx as v } from "@emotion/react/jsx-runtime";
12
- import { FloatingFocusManager as y, FloatingList as b, FloatingPortal as x, useClick as S, useDismiss as C, useInteractions as w, useListNavigation as T, useMergeRefs as E, useRole as D, useTypeahead as O } from "@floating-ui/react";
13
- //#region src/components/menu/menu.tsx
14
- var k = 500, A = d(null), j = d(!1);
15
- function M(e) {
16
- let t = f(A);
17
- if (!t) throw Error(`Menu.${e} must be rendered inside <Menu>.`);
18
- return t;
19
- }
20
- function N() {
21
- let e = M("Item");
22
- if (!f(j)) throw Error("Menu.Item must be rendered inside <Menu.Content>.");
23
- return e;
24
- }
25
- var P = e({
26
- appearance: "none",
27
- boxSizing: "border-box",
28
- display: "flex",
29
- alignItems: "center",
30
- inlineSize: "100%",
31
- minBlockSize: "32px",
32
- border: 0,
33
- borderRadius: _.radius.sm,
34
- backgroundColor: "transparent",
35
- paddingBlock: _.space[1],
36
- paddingInline: _.space[2],
37
- font: "inherit",
38
- fontSize: _.textSize.sm,
39
- color: _.color.text,
40
- textAlign: "start",
41
- cursor: "pointer",
42
- transitionProperty: "background-color",
43
- transitionDuration: _.motion.duration.fast,
44
- transitionTimingFunction: _.motion.easeStandard,
45
- "&:focus-visible": { ...n },
46
- [r]: { transitionDuration: "0s" }
47
- }), F = e({
48
- blockSize: "1px",
49
- marginBlock: _.space[1],
50
- backgroundColor: _.color.border
51
- });
52
- function I({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: r = "bottom-start", children: a }) {
53
- let [o = !1, s] = i(e, t, n), [c, l] = g(null), d = h([]), f = h([]), _ = h(/* @__PURE__ */ new Set()), y = h(!1), { refs: b, floatingStyles: x, context: E } = u({
54
- open: o,
55
- placement: r,
56
- onOpenChange: (e, t, n) => {
57
- e || (y.current = n === "escape-key"), s(e);
58
- }
59
- });
60
- p(() => {
61
- !o && y.current && (y.current = !1, b.domReference.current?.focus());
62
- }, [o, b]);
63
- let j = S(E), M = D(E, { role: "menu" }), N = C(E, {
64
- escapeKey: !0,
65
- outsidePress: !0
66
- }), P = T(E, {
67
- listRef: d,
68
- activeIndex: c,
69
- onNavigate: l,
70
- loop: !0,
71
- orientation: "vertical",
72
- disabledIndices: (e) => _.current.has(e),
73
- focusItemOnOpen: !0
74
- }), F = O(E, {
75
- listRef: f,
76
- activeIndex: c,
77
- onMatch: o ? l : void 0,
78
- resetMs: k
79
- }), { getReferenceProps: I, getFloatingProps: L, getItemProps: R } = w([
80
- j,
81
- M,
82
- N,
83
- P,
84
- F
85
- ]), z = m(() => ({
86
- open: o,
87
- requestClose: (e = !1) => {
88
- e && (y.current = !0), s(!1);
89
- },
90
- activeIndex: c,
91
- refs: b,
92
- floatingContext: E,
93
- floatingStyles: x,
94
- elementsRef: d,
95
- labelsRef: f,
96
- disabledIndices: _.current,
97
- getReferenceProps: I,
98
- getFloatingProps: L,
99
- getItemProps: R
100
- }), [
101
- o,
102
- s,
103
- c,
104
- b,
105
- E,
106
- x,
107
- I,
108
- L,
109
- R
110
- ]);
111
- return /* @__PURE__ */ v(A.Provider, {
112
- value: z,
113
- children: a
114
- });
115
- }
116
- I.displayName = "Menu";
117
- function L({ ref: e, className: n, sx: r, ...i }) {
118
- let { refs: a, getReferenceProps: o } = M("Trigger"), s = E([a.setReference, e]);
119
- return /* @__PURE__ */ v(t, {
120
- className: n,
121
- styles: l,
122
- sx: r,
123
- children: (e) => /* @__PURE__ */ v("button", {
124
- type: "button",
125
- ...o(i),
126
- ref: s,
127
- "data-ui": "menu-trigger",
128
- className: e
129
- })
130
- });
131
- }
132
- L.displayName = "Menu.Trigger";
133
- function R({ ref: e, style: n, children: r, className: i, sx: o, ...s }) {
134
- let { open: c, refs: l, floatingContext: u, floatingStyles: d, elementsRef: f, labelsRef: p, getFloatingProps: m } = M("Content"), h = E([l.setFloating, e]);
135
- return c ? /* @__PURE__ */ v(x, { children: /* @__PURE__ */ v(y, {
136
- context: u,
137
- modal: !1,
138
- initialFocus: -1,
139
- returnFocus: !1,
140
- restoreFocus: !0,
141
- children: /* @__PURE__ */ v(t, {
142
- className: i,
143
- styles: a,
144
- sx: o,
145
- children: (e) => /* @__PURE__ */ v("div", {
146
- ...m(s),
147
- ref: h,
148
- "data-ui": "menu",
149
- style: {
150
- ...n,
151
- ...d
152
- },
153
- className: e,
154
- children: /* @__PURE__ */ v(b, {
155
- elementsRef: f,
156
- labelsRef: p,
157
- children: /* @__PURE__ */ v(j.Provider, {
158
- value: !0,
159
- children: r
160
- })
161
- })
162
- })
163
- })
164
- }) }) : null;
165
- }
166
- R.displayName = "Menu.Content";
167
- function z({ ref: e, onSelect: n, disabled: r = !1, onClick: i, className: a, sx: l, ...u }) {
168
- let { activeIndex: d, requestClose: f, disabledIndices: p, getItemProps: m } = N(), { ref: h, index: g } = o({ label: r ? null : void 0 }), _ = E([h, e]), y = g !== -1 && d === g;
169
- s(g, r, p);
170
- let b = (e) => {
171
- r || (i?.(e), n?.(), e.defaultPrevented || f(!0));
172
- };
173
- return /* @__PURE__ */ v(t, {
174
- className: a,
175
- styles: [P, c],
176
- sx: l,
177
- children: (e) => /* @__PURE__ */ v("button", {
178
- type: "button",
179
- ...m({
180
- ...u,
181
- onClick: b
182
- }),
183
- ref: _,
184
- role: "menuitem",
185
- tabIndex: y ? 0 : -1,
186
- "aria-disabled": r || void 0,
187
- "data-active": y || void 0,
188
- "data-ui": "menu-item",
189
- className: e
190
- })
191
- });
192
- }
193
- z.displayName = "Menu.Item";
194
- function B({ ref: e, className: n, sx: r, ...i }) {
195
- return /* @__PURE__ */ v(t, {
196
- className: n,
197
- styles: F,
198
- sx: r,
199
- children: (t) => /* @__PURE__ */ v("div", {
200
- ...i,
201
- ref: e,
202
- role: "separator",
203
- "data-ui": "menu-separator",
204
- className: t
205
- })
206
- });
207
- }
208
- B.displayName = "Menu.Separator";
209
- var V = Object.assign(I, {
210
- Trigger: L,
211
- Content: R,
212
- Item: z,
213
- Separator: B
214
- });
215
- //#endregion
216
- export { V as t };
@@ -1,113 +0,0 @@
1
- 'use client';
2
- import { r as e, t } from "./sx-Dx9JUKp5.js";
3
- import { t as n } from "./use-controlled-state-CVXDa-qM.js";
4
- import { t as r } from "./trigger-style-B1KVC8O1.js";
5
- import { n as i } from "./surface-DZ4d-2aL.js";
6
- import { t as a } from "./use-overlay-floating-efeqppiw.js";
7
- import { createContext as o, useContext as s, useEffect as c, useMemo as l, useRef as u } from "react";
8
- import { vars as d } from "@jfrader/tokens/vars";
9
- import { jsx as f } from "@emotion/react/jsx-runtime";
10
- import { FloatingFocusManager as p, FloatingPortal as m, useClick as h, useDismiss as g, useInteractions as _, useMergeRefs as v, useRole as y } from "@floating-ui/react";
11
- //#region src/components/popover/popover.tsx
12
- var b = o(null);
13
- function x(e) {
14
- let t = s(b);
15
- if (!t) throw Error(`Popover.${e} must be rendered inside <Popover>.`);
16
- return t;
17
- }
18
- var S = e({
19
- ...i,
20
- borderRadius: d.radius.lg,
21
- boxShadow: d.shadow.overlay,
22
- padding: d.space[4],
23
- minInlineSize: "200px",
24
- maxInlineSize: "min(360px, calc(100vw - 32px))",
25
- fontSize: d.textSize.sm
26
- });
27
- function C({ open: e, defaultOpen: t = !1, onOpenChange: r, placement: i = "bottom", children: o }) {
28
- let [s = !1, d] = n(e, t, r), p = u(!1), { refs: m, floatingStyles: v, context: x } = a({
29
- open: s,
30
- placement: i,
31
- onOpenChange: (e, t, n) => {
32
- e || (p.current = n === "escape-key"), d(e);
33
- }
34
- });
35
- c(() => {
36
- !s && p.current && (p.current = !1, m.domReference.current?.focus());
37
- }, [s, m]);
38
- let S = h(x), C = g(x, {
39
- escapeKey: !0,
40
- outsidePress: !0
41
- }), w = y(x, { role: "dialog" }), { getReferenceProps: T, getFloatingProps: E } = _([
42
- S,
43
- C,
44
- w
45
- ]), D = l(() => ({
46
- open: s,
47
- refs: m,
48
- floatingContext: x,
49
- floatingStyles: v,
50
- getReferenceProps: T,
51
- getFloatingProps: E
52
- }), [
53
- s,
54
- m,
55
- x,
56
- v,
57
- T,
58
- E
59
- ]);
60
- return /* @__PURE__ */ f(b.Provider, {
61
- value: D,
62
- children: o
63
- });
64
- }
65
- C.displayName = "Popover";
66
- function w({ ref: e, className: n, sx: i, ...a }) {
67
- let { refs: o, getReferenceProps: s } = x("Trigger"), c = v([o.setReference, e]);
68
- return /* @__PURE__ */ f(t, {
69
- className: n,
70
- styles: r,
71
- sx: i,
72
- children: (e) => /* @__PURE__ */ f("button", {
73
- type: "button",
74
- ...s(a),
75
- ref: c,
76
- "data-ui": "popover-trigger",
77
- className: e
78
- })
79
- });
80
- }
81
- w.displayName = "Popover.Trigger";
82
- function T({ ref: e, style: n, className: r, sx: i, ...a }) {
83
- let { open: o, refs: s, floatingContext: c, floatingStyles: l, getFloatingProps: u } = x("Content"), d = v([s.setFloating, e]);
84
- return o ? /* @__PURE__ */ f(m, { children: /* @__PURE__ */ f(p, {
85
- context: c,
86
- modal: !1,
87
- initialFocus: -1,
88
- returnFocus: !1,
89
- closeOnFocusOut: !1,
90
- children: /* @__PURE__ */ f(t, {
91
- className: r,
92
- styles: S,
93
- sx: i,
94
- children: (e) => /* @__PURE__ */ f("div", {
95
- ...u(a),
96
- ref: d,
97
- "data-ui": "popover",
98
- style: {
99
- ...n,
100
- ...l
101
- },
102
- className: e
103
- })
104
- })
105
- }) }) : null;
106
- }
107
- T.displayName = "Popover.Content";
108
- var E = Object.assign(C, {
109
- Trigger: w,
110
- Content: T
111
- });
112
- //#endregion
113
- export { E as t };