@jfrader/ui 0.4.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 (257) 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/time-picker-Db8D49cP.js +305 -0
  128. package/dist/time-picker.js +2 -0
  129. package/dist/timeline-k3nURuCP.js +618 -0
  130. package/dist/timeline.js +2 -0
  131. package/dist/toast-BHxI32ZA.js +352 -0
  132. package/dist/toast-stack-DqrAzdg5.js +183 -0
  133. package/dist/toast-stack.js +2 -0
  134. package/dist/toast.js +1 -1
  135. package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
  136. package/dist/toggle-group.js +1 -1
  137. package/dist/tooltip-CkeiW9C1.js +113 -0
  138. package/dist/tooltip.js +1 -1
  139. package/dist/tree-view-C2liIxqy.js +360 -0
  140. package/dist/tree-view.js +2 -0
  141. package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
  142. package/dist/types/components/announcement-bar/index.d.ts +2 -0
  143. package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
  144. package/dist/types/components/avatar-group/index.d.ts +2 -0
  145. package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
  146. package/dist/types/components/bottom-sheet/index.d.ts +2 -0
  147. package/dist/types/components/calendar/calendar.d.ts +25 -1
  148. package/dist/types/components/calendar/index.d.ts +1 -1
  149. package/dist/types/components/carousel/carousel.d.ts +73 -0
  150. package/dist/types/components/carousel/index.d.ts +2 -0
  151. package/dist/types/components/chip-group/chip-group.d.ts +54 -0
  152. package/dist/types/components/chip-group/index.d.ts +1 -0
  153. package/dist/types/components/code-block/code-block.d.ts +58 -0
  154. package/dist/types/components/code-block/index.d.ts +1 -0
  155. package/dist/types/components/code-block/shiki.d.ts +3 -0
  156. package/dist/types/components/combobox/combobox.d.ts +1 -1
  157. package/dist/types/components/command-palette/command-palette.d.ts +1 -1
  158. package/dist/types/components/copy-button/copy-button.d.ts +49 -0
  159. package/dist/types/components/copy-button/index.d.ts +2 -0
  160. package/dist/types/components/countdown/countdown.d.ts +37 -0
  161. package/dist/types/components/countdown/index.d.ts +1 -0
  162. package/dist/types/components/date-picker/date-picker.d.ts +1 -1
  163. package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
  164. package/dist/types/components/date-range-picker/index.d.ts +2 -0
  165. package/dist/types/components/drawer/drawer.d.ts +59 -0
  166. package/dist/types/components/drawer/index.d.ts +2 -0
  167. package/dist/types/components/empty-state/empty-state.d.ts +36 -0
  168. package/dist/types/components/empty-state/index.d.ts +2 -0
  169. package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
  170. package/dist/types/components/expandable-card/index.d.ts +2 -0
  171. package/dist/types/components/field/field-anatomy.d.ts +4 -2
  172. package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
  173. package/dist/types/components/file-dropzone/index.d.ts +2 -0
  174. package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
  175. package/dist/types/components/filter-toolbar/index.d.ts +1 -0
  176. package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
  177. package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
  178. package/dist/types/components/hover-card/hover-card.d.ts +97 -0
  179. package/dist/types/components/hover-card/index.d.ts +2 -0
  180. package/dist/types/components/image-compare/image-compare.d.ts +54 -0
  181. package/dist/types/components/image-compare/index.d.ts +1 -0
  182. package/dist/types/components/inline-edit/index.d.ts +2 -0
  183. package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
  184. package/dist/types/components/json-viewer/index.d.ts +2 -0
  185. package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
  186. package/dist/types/components/mention-input/index.d.ts +2 -0
  187. package/dist/types/components/mention-input/mention-input.d.ts +87 -0
  188. package/dist/types/components/menu/menu.d.ts +23 -5
  189. package/dist/types/components/metric-card/index.d.ts +1 -0
  190. package/dist/types/components/metric-card/metric-card.d.ts +37 -0
  191. package/dist/types/components/multi-select/index.d.ts +2 -0
  192. package/dist/types/components/multi-select/multi-select.d.ts +73 -0
  193. package/dist/types/components/password-field/index.d.ts +2 -0
  194. package/dist/types/components/password-field/password-field.d.ts +34 -0
  195. package/dist/types/components/popover/popover.d.ts +1 -1
  196. package/dist/types/components/radio-cards/index.d.ts +1 -0
  197. package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
  198. package/dist/types/components/resizable-panels/index.d.ts +2 -0
  199. package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
  200. package/dist/types/components/scroll-area/index.d.ts +2 -0
  201. package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
  202. package/dist/types/components/search-field/index.d.ts +1 -0
  203. package/dist/types/components/search-field/search-field.d.ts +31 -0
  204. package/dist/types/components/segmented-control/index.d.ts +2 -0
  205. package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
  206. package/dist/types/components/select/select.d.ts +1 -1
  207. package/dist/types/components/signature-pad/index.d.ts +2 -0
  208. package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
  209. package/dist/types/components/slider/index.d.ts +1 -0
  210. package/dist/types/components/slider/slider.d.ts +70 -0
  211. package/dist/types/components/sortable-data-table/index.d.ts +1 -0
  212. package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
  213. package/dist/types/components/split-button/index.d.ts +2 -0
  214. package/dist/types/components/split-button/split-button.d.ts +55 -0
  215. package/dist/types/components/stepper/index.d.ts +2 -0
  216. package/dist/types/components/stepper/stepper.d.ts +85 -0
  217. package/dist/types/components/swipe-actions/index.d.ts +2 -0
  218. package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
  219. package/dist/types/components/tag-input/index.d.ts +2 -0
  220. package/dist/types/components/tag-input/tag-input.d.ts +66 -0
  221. package/dist/types/components/time-picker/index.d.ts +2 -0
  222. package/dist/types/components/time-picker/time-picker.d.ts +48 -0
  223. package/dist/types/components/timeline/index.d.ts +2 -0
  224. package/dist/types/components/timeline/timeline.d.ts +66 -0
  225. package/dist/types/components/toast/toast.d.ts +37 -2
  226. package/dist/types/components/toast-stack/index.d.ts +2 -0
  227. package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
  228. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  229. package/dist/types/components/tree-view/index.d.ts +1 -0
  230. package/dist/types/components/tree-view/tree-view.d.ts +47 -0
  231. package/dist/types/components/usage-meter/index.d.ts +2 -0
  232. package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
  233. package/dist/types/index.d.ts +40 -0
  234. package/dist/types/overlay/overlay-layer.d.ts +33 -0
  235. package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
  236. package/dist/types/styling/media.d.ts +1 -0
  237. package/dist/types/styling/theme.d.ts +12 -0
  238. package/dist/types/utils/use-controlled-state.d.ts +2 -1
  239. package/dist/usage-meter-qyQ3rYVv.js +463 -0
  240. package/dist/usage-meter.js +2 -0
  241. package/dist/use-controlled-state-DpeVQZNR.js +20 -0
  242. package/dist/use-latest-callback-cj1OOQL6.js +11 -0
  243. package/dist/use-overlay-floating-DvJifLpF.js +31 -0
  244. package/package.json +175 -3
  245. package/dist/calendar-C9Yad_-w.js +0 -394
  246. package/dist/collection-registry-BTYi6zGh.js +0 -98
  247. package/dist/combobox-DiMC2g_u.js +0 -327
  248. package/dist/command-palette-V_2pEay7.js +0 -379
  249. package/dist/date-picker-C29Uo4Tx.js +0 -250
  250. package/dist/field-anatomy-D2ToMeRa.js +0 -109
  251. package/dist/menu-CGPTNRnF.js +0 -216
  252. package/dist/popover-CdRXjQqI.js +0 -113
  253. package/dist/select-BgG7WgSh.js +0 -286
  254. package/dist/toast-CjmELMZZ.js +0 -283
  255. package/dist/tooltip-CaL3rKbV.js +0 -108
  256. package/dist/use-controlled-state-CVXDa-qM.js +0 -21
  257. package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
@@ -0,0 +1,289 @@
1
+ 'use client';
2
+ import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
3
+ import { n as r } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as i, r as a } from "./media-8yrN85VT.js";
5
+ import { n as o, r as s } from "./roving-focus-CYlo_Kf8.js";
6
+ import { t as c } from "./use-controlled-state-DpeVQZNR.js";
7
+ import { t as l } from "./renderable-DzcIj1Lo.js";
8
+ import { useId as u, useImperativeHandle as d, useLayoutEffect as f, useRef as p, useState as m } from "react";
9
+ import { vars as h } from "@jfrader/tokens/vars";
10
+ import { jsx as g, jsxs as _ } from "@emotion/react/jsx-runtime";
11
+ import { MotionConfig as ee, animate as v, motion as y, useReducedMotion as b } from "motion/react";
12
+ import { base as x } from "@jfrader/tokens";
13
+ //#region src/components/chip-group/chip-group.tsx
14
+ var S = [], C = Symbol("overflow"), w = {
15
+ type: "spring",
16
+ stiffness: 380,
17
+ damping: 36
18
+ }, te = Number.parseFloat(x.motion.duration.slow), ne = Number.parseFloat(x.motion.duration.fast) / 4, T = {
19
+ ownerSelector: "[data-ui=\"chip-group\"]",
20
+ itemSelector: "[data-ui=\"chip-group-chip\"]:not(:disabled), [data-ui=\"chip-group-overflow\"]:not(:disabled)"
21
+ }, re = t({ minInlineSize: 0 }), ie = t({
22
+ display: "flex",
23
+ flexWrap: "wrap",
24
+ alignItems: "center",
25
+ gap: h.space[2],
26
+ minInlineSize: 0
27
+ }), E = t({
28
+ appearance: "none",
29
+ display: "inline-flex",
30
+ alignItems: "center",
31
+ justifyContent: "center",
32
+ boxSizing: "border-box",
33
+ minInlineSize: h.space[8],
34
+ maxInlineSize: "100%",
35
+ paddingInline: h.space[3],
36
+ paddingBlock: h.space[1],
37
+ border: `1px solid ${h.color.borderControl}`,
38
+ borderRadius: h.radius.full,
39
+ backgroundColor: h.color.surfaceRaised,
40
+ color: h.color.text,
41
+ fontFamily: h.font.sans,
42
+ fontWeight: h.fontWeight.medium,
43
+ lineHeight: h.lineHeight.base,
44
+ cursor: "pointer",
45
+ transitionProperty: "background-color, border-color, color",
46
+ transitionDuration: h.motion.duration.fast,
47
+ transitionTimingFunction: h.motion.easeStandard,
48
+ "&:hover:not(:disabled)": { backgroundColor: h.color.surfaceHover },
49
+ "&[aria-pressed=\"true\"]": {
50
+ backgroundColor: h.color.accentSoft,
51
+ borderColor: h.color.accent,
52
+ color: h.color.accentText
53
+ },
54
+ "&[aria-pressed=\"true\"]:hover:not(:disabled)": { backgroundColor: h.color.accentSoftHover },
55
+ "&:disabled": {
56
+ opacity: .55,
57
+ cursor: "not-allowed"
58
+ },
59
+ "&:focus-visible": r,
60
+ [a]: { transitionDuration: "0s" },
61
+ [i]: {
62
+ borderColor: "CanvasText",
63
+ "&[aria-pressed=\"true\"]": {
64
+ borderColor: "Highlight",
65
+ color: "Highlight"
66
+ }
67
+ }
68
+ }), D = {
69
+ sm: t({
70
+ minBlockSize: h.space[8],
71
+ fontSize: h.textSize.sm
72
+ }),
73
+ md: t({
74
+ minBlockSize: h.space[10],
75
+ fontSize: h.textSize.md
76
+ })
77
+ }, ae = t({
78
+ minInlineSize: 0,
79
+ overflow: "hidden",
80
+ textOverflow: "ellipsis",
81
+ whiteSpace: "nowrap"
82
+ }), O = t({
83
+ display: "inline-flex",
84
+ flexShrink: 0,
85
+ overflow: "hidden",
86
+ alignItems: "center"
87
+ }), k = t({
88
+ display: "inline-flex",
89
+ minInlineSize: 0,
90
+ maxInlineSize: "100%"
91
+ }), A = e({
92
+ from: { opacity: 0 },
93
+ to: { opacity: 1 }
94
+ }), oe = t({
95
+ animationName: A,
96
+ animationDuration: h.motion.duration.fast,
97
+ animationTimingFunction: h.motion.easeStandard,
98
+ animationFillMode: "backwards",
99
+ [a]: { animation: "none" }
100
+ }), j = t({
101
+ inlineSize: h.space[4],
102
+ blockSize: h.space[4],
103
+ flexShrink: 0
104
+ });
105
+ function M({ ref: e, options: t, type: r = "multiple", value: i, defaultValue: a, onValueChange: h, label: v, allowEmpty: b = !0, disabled: x = !1, size: O = "md", maxVisible: A, expanded: j, defaultExpanded: M = !1, onExpandedChange: le, locale: ue, moreLabel: N, lessLabel: P, slotProps: F, className: de, sx: fe, onKeyDown: pe, onBlur: me, "aria-label": he, "aria-labelledby": I, ...ge }) {
106
+ if (A !== void 0 && (!Number.isInteger(A) || A < 1 || !N || P === void 0)) throw Error("ChipGroup maxVisible requires a positive integer, moreLabel and lessLabel.");
107
+ let [L, R] = c(i, a ?? (r === "single" ? "" : S), h), [_e, ve] = c(j, M, le), z = _e ?? !1, B = typeof L == "string" ? L === "" ? S : [L] : L ?? S, [V, ye] = m(B), [be, xe] = m(z);
108
+ be !== z && (xe(z), z || ye(B));
109
+ let H = t.filter((e, t) => z || A === void 0 || t < A || B.includes(e.value) || V.includes(e.value)), U = t.filter((e, t) => A !== void 0 && t >= A && !B.includes(e.value) && (z || !V.includes(e.value))).length, W = U > 0, G = p(null), Se = p(null), K = p(null), q = p(null), J = p(!1), [Y, X] = m(null), Z = u();
110
+ d(e, () => G.current, []), d(F?.row?.ref, () => K.current, []);
111
+ let Q = H.filter((e) => !x && !e.disabled).map((e) => e.value), $ = typeof Y == "string" && Q.includes(Y) ? Y : Q.find((e) => B.includes(e)) ?? Q[0], Ce = !x && W && (Y === C || !$);
112
+ return f(() => {
113
+ let e = G.current, t = q.current;
114
+ if (!e || !t || !J.current) return;
115
+ let n = s(e, T);
116
+ if (n.includes(t)) return;
117
+ let r = e.ownerDocument.activeElement;
118
+ (r === e.ownerDocument.body || r === t) && (n.find((e) => e.dataset.ui === "chip-group-overflow") ?? n[0])?.focus();
119
+ }), /* @__PURE__ */ g(ee, {
120
+ reducedMotion: "user",
121
+ children: /* @__PURE__ */ g(n, {
122
+ className: de,
123
+ styles: re,
124
+ sx: fe,
125
+ children: (e) => /* @__PURE__ */ g("div", {
126
+ ...ge,
127
+ ref: G,
128
+ role: "group",
129
+ "aria-label": he ?? (I ? void 0 : v),
130
+ "aria-labelledby": I,
131
+ "aria-disabled": x || void 0,
132
+ "data-ui": "chip-group",
133
+ className: e,
134
+ onBlur: (e) => {
135
+ me?.(e), e.currentTarget.contains(e.relatedTarget) || (J.current = !1);
136
+ },
137
+ onKeyDown: (e) => {
138
+ pe?.(e), !e.defaultPrevented && o(e, e.currentTarget, e.key === "ArrowUp" || e.key === "ArrowDown" ? "vertical" : "horizontal", T);
139
+ },
140
+ children: /* @__PURE__ */ g(ce, {
141
+ frameRef: Se,
142
+ rowRef: K,
143
+ frameProps: F?.frame,
144
+ signature: JSON.stringify([z, B]),
145
+ children: /* @__PURE__ */ _("div", {
146
+ ...F?.row,
147
+ ref: K,
148
+ id: Z,
149
+ css: [ie, F?.row?.css],
150
+ children: [H.map((e, n) => {
151
+ let i = typeof F?.chip == "function" ? F.chip(e) : F?.chip, a = B.includes(e.value);
152
+ return /* @__PURE__ */ g(y.div, {
153
+ layout: !0,
154
+ transition: w,
155
+ css: [k, z && A !== void 0 && n >= A && !V.includes(e.value) && !a && oe],
156
+ style: { animationDelay: `${Math.min(n * ne, te)}ms` },
157
+ children: /* @__PURE__ */ _("button", {
158
+ ...i,
159
+ type: "button",
160
+ disabled: x || e.disabled,
161
+ "aria-pressed": a,
162
+ "data-ui": "chip-group-chip",
163
+ "data-value": e.value,
164
+ tabIndex: !x && !e.disabled && !Ce && $ === e.value ? 0 : -1,
165
+ css: [
166
+ E,
167
+ D[O],
168
+ i?.css
169
+ ],
170
+ onFocus: (t) => {
171
+ i?.onFocus?.(t), q.current = t.currentTarget, J.current = !0, X(e.value);
172
+ },
173
+ onClick: (n) => {
174
+ if (i?.onClick?.(n), !n.defaultPrevented) {
175
+ if (r === "single") a ? b && R("") : R(e.value);
176
+ else {
177
+ let n = t.filter((t) => t.value === e.value ? !a : B.includes(t.value)).map((e) => e.value);
178
+ (n.length !== B.length || n.some((e, t) => e !== B[t])) && R(n);
179
+ }
180
+ }
181
+ },
182
+ children: [/* @__PURE__ */ g(se, {
183
+ pressed: a,
184
+ slot: F?.check
185
+ }), l(e.label) && /* @__PURE__ */ g("span", {
186
+ ...F?.label,
187
+ css: [ae, F?.label?.css],
188
+ children: e.label
189
+ })]
190
+ })
191
+ }, e.value);
192
+ }), W && /* @__PURE__ */ g(y.div, {
193
+ layout: "position",
194
+ transition: w,
195
+ css: k,
196
+ children: /* @__PURE__ */ g("button", {
197
+ ...F?.overflow,
198
+ type: "button",
199
+ disabled: x,
200
+ "aria-expanded": z,
201
+ "aria-controls": Z,
202
+ "data-ui": "chip-group-overflow",
203
+ tabIndex: Ce ? 0 : -1,
204
+ css: [
205
+ E,
206
+ D[O],
207
+ F?.overflow?.css
208
+ ],
209
+ onFocus: (e) => {
210
+ F?.overflow?.onFocus?.(e), q.current = e.currentTarget, J.current = !0, X(C);
211
+ },
212
+ onClick: (e) => {
213
+ F?.overflow?.onClick?.(e), e.defaultPrevented || ve(!z);
214
+ },
215
+ children: z ? P : N(new Intl.NumberFormat(ue).format(U), U)
216
+ })
217
+ })]
218
+ })
219
+ })
220
+ })
221
+ })
222
+ });
223
+ }
224
+ M.displayName = "ChipGroup";
225
+ function se({ pressed: e, slot: t }) {
226
+ return /* @__PURE__ */ g("span", {
227
+ ...t,
228
+ "aria-hidden": "true",
229
+ css: [O, t?.css],
230
+ children: /* @__PURE__ */ g(y.span, {
231
+ css: O,
232
+ layout: !0,
233
+ style: {
234
+ width: e ? h.space[4] : 0,
235
+ marginInlineEnd: e ? h.space[2] : 0
236
+ },
237
+ transition: w,
238
+ children: /* @__PURE__ */ g("svg", {
239
+ css: j,
240
+ viewBox: "0 0 16 16",
241
+ fill: "none",
242
+ children: /* @__PURE__ */ g("path", {
243
+ d: "m3 8 3 3 7-7",
244
+ stroke: "currentColor",
245
+ strokeWidth: "2"
246
+ })
247
+ })
248
+ })
249
+ });
250
+ }
251
+ function ce({ frameRef: e, rowRef: t, frameProps: n, signature: r, children: i }) {
252
+ let a = b();
253
+ d(n?.ref, () => e.current, [e]);
254
+ let o = p(null);
255
+ return f(() => {
256
+ let n = e.current, r = t.current;
257
+ if (!n || !r) return;
258
+ let i = r.getBoundingClientRect().height, s = o.current;
259
+ o.current = i;
260
+ let c = s !== null && s !== i && !a ? v(s, i, {
261
+ ...w,
262
+ onUpdate: (e) => {
263
+ n.style.height = `${e}px`;
264
+ }
265
+ }) : void 0, l = !0;
266
+ c?.then(() => {
267
+ l && (n.style.height = "auto");
268
+ });
269
+ let u = new ResizeObserver(() => {
270
+ let e = r.getBoundingClientRect().height;
271
+ o.current = e, e !== i && (c?.stop(), n.style.height = "auto");
272
+ });
273
+ return u.observe(r), () => {
274
+ l = !1, c?.stop(), u.disconnect(), n.style.height = "auto";
275
+ };
276
+ }, [
277
+ r,
278
+ a,
279
+ e,
280
+ t
281
+ ]), /* @__PURE__ */ g("div", {
282
+ ...n,
283
+ ref: e,
284
+ css: n?.css,
285
+ children: i
286
+ });
287
+ }
288
+ //#endregion
289
+ export { M as t };
@@ -0,0 +1,2 @@
1
+ 'use client';
2
+ export { t as ChipGroup } from "./chip-group-DTQd_M-G.js";
@@ -0,0 +1,147 @@
1
+ 'use client';
2
+ import { vars as e } from "@jfrader/tokens/vars";
3
+ import { createHighlighterCore as t, getTokenStyleObject as n } from "shiki/core";
4
+ import { createJavaScriptRegexEngine as r } from "shiki/engine/javascript";
5
+ //#region src/components/code-block/shiki.ts
6
+ var i = "jfrader-ui", a = {
7
+ name: i,
8
+ colors: {
9
+ "editor.foreground": e.color.text,
10
+ "editor.background": e.color.surfaceInset
11
+ },
12
+ tokenColors: [
13
+ {
14
+ scope: [
15
+ "punctuation",
16
+ "meta.brace",
17
+ "keyword.operator"
18
+ ],
19
+ settings: { foreground: e.color.syntaxPunctuation }
20
+ },
21
+ {
22
+ scope: [
23
+ "keyword",
24
+ "storage",
25
+ "keyword.operator.new",
26
+ "keyword.operator.expression",
27
+ "variable.language"
28
+ ],
29
+ settings: { foreground: e.color.syntaxKeyword }
30
+ },
31
+ {
32
+ scope: [
33
+ "string",
34
+ "punctuation.definition.string",
35
+ "string.regexp"
36
+ ],
37
+ settings: { foreground: e.color.syntaxString }
38
+ },
39
+ {
40
+ scope: [
41
+ "constant",
42
+ "support.constant",
43
+ "keyword.other.unit"
44
+ ],
45
+ settings: { foreground: e.color.syntaxConstant }
46
+ },
47
+ {
48
+ scope: [
49
+ "entity.name.function",
50
+ "support.function",
51
+ "meta.function-call.generic"
52
+ ],
53
+ settings: { foreground: e.color.syntaxFunction }
54
+ },
55
+ {
56
+ scope: [
57
+ "entity.name.type",
58
+ "entity.name.class",
59
+ "support.type",
60
+ "support.class",
61
+ "entity.other.inherited-class"
62
+ ],
63
+ settings: { foreground: e.color.syntaxType }
64
+ },
65
+ {
66
+ scope: [
67
+ "entity.name.tag",
68
+ "entity.other.attribute-name.class.css",
69
+ "entity.other.attribute-name.id.css"
70
+ ],
71
+ settings: { foreground: e.color.syntaxTag }
72
+ },
73
+ {
74
+ scope: [
75
+ "entity.other.attribute-name",
76
+ "support.type.property-name",
77
+ "meta.object-literal.key",
78
+ "variable.other.property"
79
+ ],
80
+ settings: { foreground: e.color.syntaxProperty }
81
+ },
82
+ {
83
+ scope: ["comment", "punctuation.definition.comment"],
84
+ settings: {
85
+ foreground: e.color.syntaxComment,
86
+ fontStyle: "italic"
87
+ }
88
+ }
89
+ ]
90
+ }, o = {
91
+ javascript: () => import("shiki/langs/javascript.mjs"),
92
+ typescript: () => import("shiki/langs/typescript.mjs"),
93
+ json: () => import("shiki/langs/json.mjs"),
94
+ css: () => import("shiki/langs/css.mjs"),
95
+ shellscript: () => import("shiki/langs/shellscript.mjs"),
96
+ html: () => import("shiki/langs/html.mjs")
97
+ }, s = /* @__PURE__ */ new Map([
98
+ ["javascript", "javascript"],
99
+ ["js", "javascript"],
100
+ ["mjs", "javascript"],
101
+ ["cjs", "javascript"],
102
+ ["typescript", "typescript"],
103
+ ["ts", "typescript"],
104
+ ["mts", "typescript"],
105
+ ["cts", "typescript"],
106
+ ["json", "json"],
107
+ ["css", "css"],
108
+ ["bash", "shellscript"],
109
+ ["sh", "shellscript"],
110
+ ["shell", "shellscript"],
111
+ ["shellscript", "shellscript"],
112
+ ["zsh", "shellscript"],
113
+ ["html", "html"]
114
+ ]), c, l = /* @__PURE__ */ new Map();
115
+ function u() {
116
+ return c ??= t({
117
+ themes: [a],
118
+ langs: [],
119
+ engine: r()
120
+ }).catch((e) => {
121
+ throw c = void 0, e;
122
+ }), c;
123
+ }
124
+ function d(e, t) {
125
+ let n = l.get(t);
126
+ return n || (n = e.loadLanguage(o[t]()).catch((e) => {
127
+ throw l.delete(t), e;
128
+ }), l.set(t, n)), n;
129
+ }
130
+ var f = async ({ code: t, language: r }) => {
131
+ let a = r === void 0 ? void 0 : s.get(r.trim().toLowerCase());
132
+ if (!a) return null;
133
+ let o = await u();
134
+ return await d(o, a), o.codeToTokensBase(t, {
135
+ lang: a,
136
+ theme: i
137
+ }).map((t) => t.map((t) => {
138
+ let r = n(t);
139
+ return {
140
+ content: t.content,
141
+ color: r.color === e.color.text ? void 0 : r.color,
142
+ fontStyle: r["font-style"] === "italic" ? "italic" : void 0
143
+ };
144
+ }));
145
+ };
146
+ //#endregion
147
+ export { f as loadShikiHighlight };