@jfrader/ui 0.1.2 → 0.2.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 (144) hide show
  1. package/README.md +1 -1
  2. package/dist/accordion-CkOZ-tvs.js +178 -0
  3. package/dist/accordion.js +1 -1
  4. package/dist/alert-Dsjx14UW.js +131 -0
  5. package/dist/alert.js +1 -1
  6. package/dist/avatar-BRGKkoSr.js +127 -0
  7. package/dist/avatar.js +1 -1
  8. package/dist/badge-DLxUMsCx.js +104 -0
  9. package/dist/badge.js +1 -1
  10. package/dist/breadcrumbs-694hF_hm.js +131 -0
  11. package/dist/breadcrumbs.js +1 -1
  12. package/dist/button-CoaIcykB.js +190 -0
  13. package/dist/button.js +1 -1
  14. package/dist/calendar-Doj7PTdG.js +379 -0
  15. package/dist/calendar.js +1 -1
  16. package/dist/card-2IM71XZj.js +134 -0
  17. package/dist/card.js +1 -1
  18. package/dist/checkbox-B7xGNFzp.js +136 -0
  19. package/dist/checkbox.js +1 -1
  20. package/dist/combobox-Bjhxv5U3.js +311 -0
  21. package/dist/combobox.js +1 -1
  22. package/dist/{command-palette-6c158eH1.js → command-palette-BhJwm6cS.js} +144 -129
  23. package/dist/command-palette.js +1 -1
  24. package/dist/container-BhnrGPu-.js +36 -0
  25. package/dist/container.js +1 -1
  26. package/dist/date-picker-Jk8SpoiO.js +245 -0
  27. package/dist/date-picker.js +1 -1
  28. package/dist/dialog-fhS07G41.js +187 -0
  29. package/dist/dialog.js +1 -1
  30. package/dist/divider-v_78HYF5.js +79 -0
  31. package/dist/divider.js +1 -1
  32. package/dist/flex-COZzFqI8.js +22 -0
  33. package/dist/flex.js +1 -1
  34. package/dist/index.js +36 -36
  35. package/dist/kbd-CeP8Kfvp.js +61 -0
  36. package/dist/kbd.js +1 -1
  37. package/dist/menu-B6KCbLCr.js +196 -0
  38. package/dist/menu.js +1 -1
  39. package/dist/navigation-BDht6S2-.js +182 -0
  40. package/dist/navigation.js +1 -1
  41. package/dist/{pagination-BIKYsxK1.js → pagination-B50PCaDU.js} +58 -56
  42. package/dist/pagination.js +1 -1
  43. package/dist/pill-2_XzBdkD.js +51 -0
  44. package/dist/pill.js +1 -1
  45. package/dist/popover-DRHbeIVq.js +103 -0
  46. package/dist/popover.js +1 -1
  47. package/dist/{progress-C8bgujFI.js → progress-CpsskKTD.js} +37 -36
  48. package/dist/progress.js +1 -1
  49. package/dist/radio-group-DPI5KUCj.js +136 -0
  50. package/dist/radio-group.js +1 -1
  51. package/dist/select-C1xGrOhT.js +266 -0
  52. package/dist/select.js +1 -1
  53. package/dist/skeleton-DitdP-yz.js +49 -0
  54. package/dist/skeleton.js +1 -1
  55. package/dist/{spinner-CSFiP0Oi.js → spinner-CFq5HPoo.js} +24 -23
  56. package/dist/spinner.js +1 -1
  57. package/dist/stack-D_g6NJzo.js +21 -0
  58. package/dist/stack.js +1 -1
  59. package/dist/switch-B5TTU-oJ.js +138 -0
  60. package/dist/switch.js +1 -1
  61. package/dist/tabs-C26PWl2c.js +183 -0
  62. package/dist/tabs.js +1 -1
  63. package/dist/text-field-8PQAqRpM.js +75 -0
  64. package/dist/text-field.js +1 -1
  65. package/dist/textarea-CcGWuntL.js +85 -0
  66. package/dist/textarea.js +1 -1
  67. package/dist/theme-root-BRLIA4eb.js +22 -0
  68. package/dist/theme-root.js +1 -1
  69. package/dist/toast-B1PXuwZ4.js +277 -0
  70. package/dist/toast.js +1 -1
  71. package/dist/toggle-group-N_owicT0.js +156 -0
  72. package/dist/toggle-group.js +1 -1
  73. package/dist/tooltip-BJPisf60.js +98 -0
  74. package/dist/tooltip.js +1 -1
  75. package/dist/types/components/accordion/accordion.d.ts +13 -9
  76. package/dist/types/components/alert/alert.d.ts +6 -3
  77. package/dist/types/components/avatar/avatar.d.ts +6 -3
  78. package/dist/types/components/badge/badge.d.ts +6 -3
  79. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +8 -5
  80. package/dist/types/components/button/button.d.ts +6 -3
  81. package/dist/types/components/calendar/calendar.d.ts +11 -7
  82. package/dist/types/components/card/card.d.ts +20 -13
  83. package/dist/types/components/checkbox/checkbox.d.ts +6 -3
  84. package/dist/types/components/combobox/combobox.d.ts +12 -8
  85. package/dist/types/components/command-palette/command-palette.d.ts +22 -15
  86. package/dist/types/components/container/container.d.ts +6 -3
  87. package/dist/types/components/date-picker/date-picker.d.ts +6 -4
  88. package/dist/types/components/dialog/dialog.d.ts +16 -11
  89. package/dist/types/components/divider/divider.d.ts +6 -3
  90. package/dist/types/components/flex/flex.d.ts +6 -3
  91. package/dist/types/components/kbd/kbd.d.ts +8 -5
  92. package/dist/types/components/menu/menu.d.ts +13 -9
  93. package/dist/types/components/navigation/navigation.d.ts +11 -7
  94. package/dist/types/components/pagination/pagination.d.ts +6 -3
  95. package/dist/types/components/pill/pill.d.ts +6 -3
  96. package/dist/types/components/popover/popover.d.ts +7 -5
  97. package/dist/types/components/progress/progress.d.ts +6 -3
  98. package/dist/types/components/radio-group/radio-group.d.ts +8 -5
  99. package/dist/types/components/select/select.d.ts +13 -9
  100. package/dist/types/components/skeleton/skeleton.d.ts +6 -3
  101. package/dist/types/components/spinner/spinner.d.ts +6 -3
  102. package/dist/types/components/stack/stack.d.ts +4 -1
  103. package/dist/types/components/switch/switch.d.ts +6 -3
  104. package/dist/types/components/tabs/tabs.d.ts +14 -9
  105. package/dist/types/components/text-field/text-field.d.ts +6 -3
  106. package/dist/types/components/textarea/textarea.d.ts +6 -3
  107. package/dist/types/components/theme-root/theme-root.d.ts +6 -3
  108. package/dist/types/components/toast/toast.d.ts +6 -4
  109. package/dist/types/components/toggle-group/toggle-group.d.ts +7 -5
  110. package/dist/types/components/tooltip/tooltip.d.ts +7 -5
  111. package/dist/types/overlay/use-native-dialog.d.ts +2 -2
  112. package/package.json +4 -4
  113. package/dist/accordion-C3YbYFBi.js +0 -169
  114. package/dist/alert-CA9ZlIZp.js +0 -130
  115. package/dist/avatar-IUW4yJl0.js +0 -125
  116. package/dist/badge-Bru30HEn.js +0 -103
  117. package/dist/breadcrumbs-CQaviWRc.js +0 -126
  118. package/dist/button-Cmixur4Q.js +0 -188
  119. package/dist/calendar-DUgS0xmp.js +0 -373
  120. package/dist/card-D9CHtouU.js +0 -121
  121. package/dist/checkbox-DKa5BCdy.js +0 -135
  122. package/dist/combobox-Dq3V88Zt.js +0 -302
  123. package/dist/container-xUEIoZzj.js +0 -35
  124. package/dist/date-picker-DrHJMt2p.js +0 -240
  125. package/dist/dialog-C2NSOOP-.js +0 -176
  126. package/dist/divider-yF5EmhhT.js +0 -77
  127. package/dist/flex-5-NI5SSy.js +0 -22
  128. package/dist/kbd-B03_qIwQ.js +0 -56
  129. package/dist/menu-bvKRJOhJ.js +0 -187
  130. package/dist/navigation-xPoqh_Iz.js +0 -175
  131. package/dist/pill-CrVqffKM.js +0 -50
  132. package/dist/popover-CVAZ_C1a.js +0 -98
  133. package/dist/radio-group-CvQ4x8ii.js +0 -131
  134. package/dist/select-CNNiUhKB.js +0 -257
  135. package/dist/skeleton-gJ4ImO5u.js +0 -48
  136. package/dist/stack-mEAryjKz.js +0 -21
  137. package/dist/switch-2hm2WnWt.js +0 -136
  138. package/dist/tabs-GBppQabg.js +0 -174
  139. package/dist/text-field-DDPqQu29.js +0 -74
  140. package/dist/textarea-OP8_3IUR.js +0 -84
  141. package/dist/theme-root-eLka0ZP1.js +0 -21
  142. package/dist/toast-D3Y6OAsg.js +0 -271
  143. package/dist/toggle-group-BxzJ-6Cp.js +0 -151
  144. package/dist/tooltip-CVl8HS4S.js +0 -93
@@ -0,0 +1,103 @@
1
+ 'use client';
2
+ import { t as e } from "./css-Cgj6sCHn.js";
3
+ import { t } from "./use-controlled-state-CVXDa-qM.js";
4
+ import { t as n } from "./trigger-style-B1GFmH7M.js";
5
+ import { n as r } from "./surface-DZ4d-2aL.js";
6
+ import { t as i } from "./use-overlay-floating-efeqppiw.js";
7
+ import { createContext as a, useContext as o, useEffect as s, useMemo as c, useRef as l } from "react";
8
+ import { vars as u } from "@jfrader/tokens/vars";
9
+ import { jsx as d } from "@emotion/react/jsx-runtime";
10
+ import { FloatingFocusManager as f, FloatingPortal as p, useClick as m, useDismiss as h, useInteractions as g, useMergeRefs as _, useRole as v } from "@floating-ui/react";
11
+ //#region src/components/popover/popover.tsx
12
+ var y = a(null);
13
+ function b(e) {
14
+ let t = o(y);
15
+ if (!t) throw Error(`Popover.${e} must be rendered inside <Popover>.`);
16
+ return t;
17
+ }
18
+ var x = e({
19
+ ...r,
20
+ borderRadius: u.radius.lg,
21
+ boxShadow: u.shadow.overlay,
22
+ padding: u.space[4],
23
+ minInlineSize: "200px",
24
+ maxInlineSize: "min(360px, calc(100vw - 32px))",
25
+ fontSize: u.textSize.sm
26
+ });
27
+ function S({ open: e, defaultOpen: n = !1, onOpenChange: r, placement: a = "bottom", children: o }) {
28
+ let [u = !1, f] = t(e, n, r), p = l(!1), { refs: _, floatingStyles: b, context: x } = i({
29
+ open: u,
30
+ placement: a,
31
+ onOpenChange: (e, t, n) => {
32
+ e || (p.current = n === "escape-key"), f(e);
33
+ }
34
+ });
35
+ s(() => {
36
+ !u && p.current && (p.current = !1, _.domReference.current?.focus());
37
+ }, [u, _]);
38
+ let S = m(x), C = h(x, {
39
+ escapeKey: !0,
40
+ outsidePress: !0
41
+ }), w = v(x, { role: "dialog" }), { getReferenceProps: T, getFloatingProps: E } = g([
42
+ S,
43
+ C,
44
+ w
45
+ ]), D = c(() => ({
46
+ open: u,
47
+ refs: _,
48
+ floatingContext: x,
49
+ floatingStyles: b,
50
+ getReferenceProps: T,
51
+ getFloatingProps: E
52
+ }), [
53
+ u,
54
+ _,
55
+ x,
56
+ b,
57
+ T,
58
+ E
59
+ ]);
60
+ return /* @__PURE__ */ d(y.Provider, {
61
+ value: D,
62
+ children: o
63
+ });
64
+ }
65
+ S.displayName = "Popover";
66
+ function C({ ref: e, ...t }) {
67
+ let { refs: r, getReferenceProps: i } = b("Trigger"), a = _([r.setReference, e]);
68
+ return /* @__PURE__ */ d("button", {
69
+ type: "button",
70
+ ...i(t),
71
+ ref: a,
72
+ "data-ui": "popover-trigger",
73
+ css: n
74
+ });
75
+ }
76
+ C.displayName = "Popover.Trigger";
77
+ function w({ ref: e, style: t, ...n }) {
78
+ let { open: r, refs: i, floatingContext: a, floatingStyles: o, getFloatingProps: s } = b("Content"), c = _([i.setFloating, e]);
79
+ return r ? /* @__PURE__ */ d(p, { children: /* @__PURE__ */ d(f, {
80
+ context: a,
81
+ modal: !1,
82
+ initialFocus: -1,
83
+ returnFocus: !1,
84
+ closeOnFocusOut: !1,
85
+ children: /* @__PURE__ */ d("div", {
86
+ ...s(n),
87
+ ref: c,
88
+ "data-ui": "popover",
89
+ style: {
90
+ ...t,
91
+ ...o
92
+ },
93
+ css: x
94
+ })
95
+ }) }) : null;
96
+ }
97
+ w.displayName = "Popover.Content";
98
+ var T = Object.assign(S, {
99
+ Trigger: C,
100
+ Content: w
101
+ });
102
+ //#endregion
103
+ export { T as t };
package/dist/popover.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Popover } from "./popover-CVAZ_C1a.js";
2
+ export { t as Popover } from "./popover-DRHbeIVq.js";
@@ -3,58 +3,58 @@ import { n as e, t } from "./css-Cgj6sCHn.js";
3
3
  import { n, t as r } from "./media-D_eA_I-e.js";
4
4
  import { t as i } from "./visually-hidden-DCWhf0Cb.js";
5
5
  import { t as a } from "./renderable-DzcIj1Lo.js";
6
- import { forwardRef as o, useId as s } from "react";
7
- import { vars as c } from "@jfrader/tokens/vars";
8
- import { jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
6
+ import { useId as o } from "react";
7
+ import { vars as s } from "@jfrader/tokens/vars";
8
+ import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
9
9
  //#region src/components/progress/progress.tsx
10
- var d = "40%", f = "1.4s ease-in-out infinite", p = 100, m = e({
10
+ var u = "40%", d = "1.4s ease-in-out infinite", f = 100, p = e({
11
11
  from: { transform: "translateX(-100%)" },
12
12
  to: { transform: "translateX(250%)" }
13
- }), h = e({
13
+ }), m = e({
14
14
  from: { transform: "translateX(100%)" },
15
15
  to: { transform: "translateX(-250%)" }
16
- }), g = t({
16
+ }), h = t({
17
17
  position: "relative",
18
18
  display: "block",
19
19
  boxSizing: "border-box",
20
20
  blockSize: "4px",
21
21
  overflow: "hidden",
22
- backgroundColor: c.color.surfaceHover,
23
- border: `1px solid ${c.color.borderSubtle}`,
24
- borderRadius: c.radius.full
25
- }), _ = t({
22
+ backgroundColor: s.color.surfaceHover,
23
+ border: `1px solid ${s.color.borderSubtle}`,
24
+ borderRadius: s.radius.full
25
+ }), g = t({
26
26
  blockSize: "100%",
27
- backgroundColor: c.color.accent,
28
- borderRadius: c.radius.full,
27
+ backgroundColor: s.color.accent,
28
+ borderRadius: s.radius.full,
29
29
  transitionProperty: "width",
30
- transitionDuration: c.motion.duration.base,
31
- transitionTimingFunction: c.motion.easeStandard,
30
+ transitionDuration: s.motion.duration.base,
31
+ transitionTimingFunction: s.motion.easeStandard,
32
32
  [n]: { transitionDuration: "0s" },
33
33
  [r]: {
34
34
  forcedColorAdjust: "none",
35
35
  backgroundColor: "Highlight"
36
36
  }
37
- }), v = t({
38
- inlineSize: d,
39
- animation: `${m} ${f}`,
40
- "&:dir(rtl)": { animation: `${h} ${f}` },
37
+ }), _ = t({
38
+ inlineSize: u,
39
+ animation: `${p} ${d}`,
40
+ "&:dir(rtl)": { animation: `${m} ${d}` },
41
41
  [n]: {
42
42
  "&, &:dir(rtl)": { animation: "none" },
43
43
  opacity: .7
44
44
  }
45
45
  });
46
- function y(e, t) {
47
- let n = Number.isFinite(t) && t > 0 ? t : p;
46
+ function v(e, t) {
47
+ let n = Number.isFinite(t) && t > 0 ? t : f;
48
48
  return {
49
49
  value: e === void 0 ? void 0 : Math.min(Math.max(Number.isFinite(e) ? e : 0, 0), n),
50
50
  max: n
51
51
  };
52
52
  }
53
- var b = o(function({ value: e, max: t = p, label: n, getValueLabel: r, slotProps: o, "aria-labelledby": c, ...d }, f) {
54
- let m = `${s()}-label`, h = a(n), b = [c, h && m].filter(Boolean).join(" ") || void 0, { value: x, max: S } = y(e, t), C = x === void 0, w = x === void 0 ? 0 : x / S * 100;
55
- return /* @__PURE__ */ u("div", {
56
- ...d,
57
- ref: f,
53
+ function y({ ref: e, value: t, max: n = f, label: r, getValueLabel: s, slotProps: u, "aria-labelledby": d, ...p }) {
54
+ let m = `${o()}-label`, y = a(r), b = [d, y && m].filter(Boolean).join(" ") || void 0, { value: x, max: S } = v(t, n), C = x === void 0, w = x === void 0 ? 0 : x / S * 100;
55
+ return /* @__PURE__ */ l("div", {
56
+ ...p,
57
+ ref: e,
58
58
  role: "progressbar",
59
59
  "data-ui": "progress",
60
60
  "data-state": C ? "indeterminate" : "determinate",
@@ -62,23 +62,24 @@ var b = o(function({ value: e, max: t = p, label: n, getValueLabel: r, slotProps
62
62
  "aria-valuemin": 0,
63
63
  "aria-valuemax": S,
64
64
  "aria-valuenow": x,
65
- "aria-valuetext": x === void 0 ? void 0 : r?.(x, S),
66
- css: g,
67
- children: [h && /* @__PURE__ */ l("span", {
65
+ "aria-valuetext": x === void 0 ? void 0 : s?.(x, S),
66
+ css: h,
67
+ children: [y && /* @__PURE__ */ c("span", {
68
68
  id: m,
69
69
  css: i,
70
- children: n
71
- }), /* @__PURE__ */ l("div", {
70
+ children: r
71
+ }), /* @__PURE__ */ c("div", {
72
72
  "data-ui": "progress-indicator",
73
- className: o?.indicator?.className,
73
+ className: u?.indicator?.className,
74
74
  style: C ? void 0 : { width: `${w}%` },
75
75
  css: [
76
- _,
77
- C && v,
78
- o?.indicator?.css
76
+ g,
77
+ C && _,
78
+ u?.indicator?.css
79
79
  ]
80
80
  })]
81
81
  });
82
- });
82
+ }
83
+ y.displayName = "Progress";
83
84
  //#endregion
84
- export { b as t };
85
+ export { y as t };
package/dist/progress.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Progress } from "./progress-C8bgujFI.js";
2
+ export { t as Progress } from "./progress-CpsskKTD.js";
@@ -0,0 +1,136 @@
1
+ 'use client';
2
+ import { t as e } from "./css-Cgj6sCHn.js";
3
+ import { n as t, t as n } from "./media-D_eA_I-e.js";
4
+ import { t as r } from "./use-controlled-state-CVXDa-qM.js";
5
+ import { t as i } from "./renderable-DzcIj1Lo.js";
6
+ import { i as a, n as o, r as s, t as c } from "./choice-control-ByFogYcT.js";
7
+ import { createContext as l, useContext as u, useId as d, useMemo as f } from "react";
8
+ import { vars as p } from "@jfrader/tokens/vars";
9
+ import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
10
+ //#region src/components/radio-group/radio-group.tsx
11
+ var g = l(null);
12
+ function _(e) {
13
+ let t = u(g);
14
+ if (!t) throw Error(`RadioGroup.${e} must be rendered inside <RadioGroup>.`);
15
+ return t;
16
+ }
17
+ var v = "16px", y = {
18
+ vertical: e({
19
+ display: "grid",
20
+ justifyItems: "start",
21
+ gap: p.space[3]
22
+ }),
23
+ horizontal: e({
24
+ display: "flex",
25
+ flexWrap: "wrap",
26
+ alignItems: "flex-start",
27
+ gap: p.space[4]
28
+ })
29
+ }, b = e({ "input:checked + span::after": { opacity: 1 } }), x = e({ minBlockSize: "32px" }), S = e({
30
+ display: "inline-flex",
31
+ alignItems: "center",
32
+ justifyContent: "center",
33
+ flexShrink: 0,
34
+ boxSizing: "border-box",
35
+ inlineSize: v,
36
+ blockSize: v,
37
+ border: `1px solid ${p.color.borderControl}`,
38
+ borderRadius: p.radius.full,
39
+ backgroundColor: p.color.surfaceRaised,
40
+ transitionProperty: "background-color, border-color",
41
+ transitionDuration: p.motion.duration.fast,
42
+ transitionTimingFunction: p.motion.easeStandard,
43
+ "&::after": {
44
+ content: "\"\"",
45
+ inlineSize: "40%",
46
+ blockSize: "40%",
47
+ borderRadius: p.radius.full,
48
+ backgroundColor: p.color.accentContrast,
49
+ opacity: 0
50
+ },
51
+ [t]: { transitionDuration: "0s" },
52
+ [n]: { "&::after": { backgroundColor: "CanvasText" } }
53
+ }), C = e({ fontSize: p.textSize.sm }), w = e({
54
+ marginInlineStart: `calc(${v} + ${p.space[2]})`,
55
+ fontSize: p.textSize.sm,
56
+ color: p.color.textMuted
57
+ });
58
+ function T({ ref: e, value: t, defaultValue: n, onValueChange: i, name: a, disabled: o = !1, orientation: s = "vertical", ...c }) {
59
+ let l = d(), u = a ?? l, [p, h] = r(t, n, i), _ = f(() => ({
60
+ value: p,
61
+ setValue: h,
62
+ name: u,
63
+ disabled: o
64
+ }), [
65
+ p,
66
+ h,
67
+ u,
68
+ o
69
+ ]);
70
+ return /* @__PURE__ */ m(g.Provider, {
71
+ value: _,
72
+ children: /* @__PURE__ */ m("div", {
73
+ ...c,
74
+ ref: e,
75
+ role: "radiogroup",
76
+ "aria-orientation": s,
77
+ "data-ui": "radio-group-root",
78
+ "data-orientation": s,
79
+ css: y[s]
80
+ })
81
+ });
82
+ }
83
+ T.displayName = "RadioGroup";
84
+ function E({ ref: e, value: t, label: n, description: r, disabled: l, onChange: u, slotProps: f, className: p, "aria-labelledby": g, "aria-describedby": v, ...y }) {
85
+ let { value: T, setValue: E, name: D, disabled: O } = _("Radio"), k = O || l, A = d(), j = `${A}-label`, M = `${A}-description`, N = i(n), P = i(r), F = [g, N && j].filter(Boolean).join(" ") || void 0, I = [v, P && M].filter(Boolean).join(" ") || void 0, L = [p, f?.root?.className].filter(Boolean).join(" ") || void 0, R = (e) => {
86
+ u?.(e), e.currentTarget.checked && E(t);
87
+ };
88
+ return /* @__PURE__ */ h("label", {
89
+ "data-ui": "radio-group-radio",
90
+ className: L,
91
+ css: [
92
+ s,
93
+ b,
94
+ o,
95
+ f?.root?.css
96
+ ],
97
+ children: [/* @__PURE__ */ h("span", {
98
+ css: [a, x],
99
+ children: [
100
+ /* @__PURE__ */ m("input", {
101
+ ...y,
102
+ ref: e,
103
+ type: "radio",
104
+ name: D,
105
+ value: t,
106
+ checked: T === t,
107
+ disabled: k,
108
+ "aria-labelledby": F,
109
+ "aria-describedby": I,
110
+ onChange: R,
111
+ css: c
112
+ }),
113
+ /* @__PURE__ */ m("span", {
114
+ "aria-hidden": "true",
115
+ className: f?.control?.className,
116
+ css: [S, f?.control?.css]
117
+ }),
118
+ N && /* @__PURE__ */ m("span", {
119
+ id: j,
120
+ className: f?.label?.className,
121
+ css: [C, f?.label?.css],
122
+ children: n
123
+ })
124
+ ]
125
+ }), P && /* @__PURE__ */ m("span", {
126
+ id: M,
127
+ className: f?.description?.className,
128
+ css: [w, f?.description?.css],
129
+ children: r
130
+ })]
131
+ });
132
+ }
133
+ E.displayName = "RadioGroup.Radio";
134
+ var D = Object.assign(T, { Radio: E });
135
+ //#endregion
136
+ export { D as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as RadioGroup } from "./radio-group-CvQ4x8ii.js";
2
+ export { t as RadioGroup } from "./radio-group-DPI5KUCj.js";
@@ -0,0 +1,266 @@
1
+ 'use client';
2
+ import { t as e } from "./css-Cgj6sCHn.js";
3
+ import { t } from "./use-controlled-state-CVXDa-qM.js";
4
+ import { a as n, c as r, d as i, f as a, l as o, o as s, r as c, s as l, t as u, u as d } from "./collection-registry-1l9f3XJZ.js";
5
+ import { t as f } from "./trigger-style-B1GFmH7M.js";
6
+ import { t as p } from "./use-overlay-floating-efeqppiw.js";
7
+ import { createContext as m, useContext as h, useId as g, useLayoutEffect as _, useMemo as v, useRef as y, useState as b } from "react";
8
+ import { vars as x } from "@jfrader/tokens/vars";
9
+ import { jsx as S, jsxs as C } from "@emotion/react/jsx-runtime";
10
+ import { FloatingList as w, FloatingPortal as T, useClick as E, useDismiss as D, useInteractions as O, useListNavigation as k, useMergeRefs as A, useRole as j } from "@floating-ui/react";
11
+ //#region src/components/select/select.tsx
12
+ var M = 500, N = new Intl.Collator(void 0, {
13
+ usage: "search",
14
+ sensitivity: "base"
15
+ }), P = "✓", F = m(null), I = m(!1);
16
+ function L(e) {
17
+ let t = h(F);
18
+ if (!t) throw Error(`Select.${e} must be rendered inside <Select>.`);
19
+ return t;
20
+ }
21
+ function R() {
22
+ let e = L("Item");
23
+ if (!h(I)) throw Error("Select.Item must be rendered inside <Select.Content>.");
24
+ return e;
25
+ }
26
+ var z = e({
27
+ justifyContent: "flex-start",
28
+ minInlineSize: "180px",
29
+ "&[aria-expanded=\"true\"]": { backgroundColor: x.color.surfaceHover }
30
+ }), B = e({
31
+ overflow: "hidden",
32
+ textOverflow: "ellipsis",
33
+ whiteSpace: "nowrap",
34
+ "&[data-placeholder]": { color: x.color.textMuted }
35
+ });
36
+ function V({ value: e, defaultValue: r, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, placement: c = "bottom-start", disabled: l = !1, name: u, children: d }) {
37
+ let f = g(), [m, h] = t(e, r, i), [_ = !1, x] = t(a, o, s), [w, T] = b(null), [A, M] = b(!1), [P, I] = n(), [L, R] = b(null), z = y([]), B = y([]), V = y(null);
38
+ !_ && A && (M(!1), T(null));
39
+ let { valuesByIndex: H, disabledIndices: U } = v(() => {
40
+ let e = [], t = /* @__PURE__ */ new Set();
41
+ return P.forEach((n, r) => {
42
+ n.index !== -1 && (e[n.index] = r, n.disabled && t.add(n.index));
43
+ }), {
44
+ valuesByIndex: e,
45
+ disabledIndices: t
46
+ };
47
+ }, [P]), W = m === void 0 ? void 0 : P.get(m), G = W && W.index !== -1 ? W.index : null, { refs: K, floatingStyles: q, context: J } = p({
48
+ open: _,
49
+ placement: c,
50
+ onOpenChange: (e) => x(e)
51
+ }), Y = E(J), X = j(J, { role: "listbox" }), ee = D(J, {
52
+ escapeKey: !0,
53
+ outsidePress: !0
54
+ }), te = k(J, {
55
+ listRef: z,
56
+ activeIndex: w,
57
+ onNavigate: T,
58
+ virtual: !0,
59
+ virtualItemRef: V,
60
+ loop: !0,
61
+ focusItemOnOpen: !0,
62
+ selectedIndex: A ? null : G,
63
+ disabledIndices: (e) => U.has(e)
64
+ }), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = O([
65
+ Y,
66
+ X,
67
+ ee,
68
+ te
69
+ ]), ne = v(() => {
70
+ let e = (e) => {
71
+ h(e), x(!1);
72
+ };
73
+ return {
74
+ baseId: f,
75
+ open: _,
76
+ disabled: l,
77
+ selectedValue: m,
78
+ activeIndex: w,
79
+ options: P,
80
+ triggerLabelling: L,
81
+ refs: K,
82
+ floatingStyles: q,
83
+ elementsRef: z,
84
+ labelsRef: B,
85
+ getReferenceProps: Z,
86
+ getFloatingProps: Q,
87
+ getItemProps: $,
88
+ selectValue: e,
89
+ matchTypeahead: (e) => {
90
+ let t = B.current, n = w ?? -1;
91
+ for (let r = 1; r <= t.length; r += 1) {
92
+ let i = (n + r) % t.length, a = t[i];
93
+ if (!(a == null || U.has(i)) && N.compare(a.slice(0, e.length), e) === 0) {
94
+ T(i), _ || (M(!0), x(!0));
95
+ return;
96
+ }
97
+ }
98
+ },
99
+ selectIndex: (t) => {
100
+ let n = H[t];
101
+ n === void 0 || U.has(t) || e(n);
102
+ },
103
+ requestOpenChange: x,
104
+ registration: I,
105
+ setTriggerLabelling: R
106
+ };
107
+ }, [
108
+ f,
109
+ _,
110
+ l,
111
+ m,
112
+ w,
113
+ P,
114
+ L,
115
+ K,
116
+ q,
117
+ Z,
118
+ Q,
119
+ $,
120
+ H,
121
+ U,
122
+ h,
123
+ x,
124
+ I
125
+ ]);
126
+ return /* @__PURE__ */ C(F.Provider, {
127
+ value: ne,
128
+ children: [d, u !== void 0 && /* @__PURE__ */ S("input", {
129
+ type: "hidden",
130
+ name: u,
131
+ value: m ?? "",
132
+ disabled: l
133
+ })]
134
+ });
135
+ }
136
+ V.displayName = "Select";
137
+ function H({ ref: e, id: t, disabled: n, onKeyDown: r, ...i }) {
138
+ let { baseId: a, open: o, disabled: s, activeIndex: c, refs: l, getReferenceProps: u, selectIndex: d, matchTypeahead: p, requestOpenChange: m, setTriggerLabelling: h } = L("Trigger"), g = A([l.setReference, e]), v = y({
139
+ search: "",
140
+ lastKeyAt: 0
141
+ }), b = t ?? `${a}-trigger`, x = i["aria-labelledby"], C = i["aria-label"];
142
+ _(() => (h({
143
+ id: b,
144
+ labelledBy: x,
145
+ label: C
146
+ }), () => h(null)), [
147
+ b,
148
+ x,
149
+ C,
150
+ h
151
+ ]);
152
+ let w = (e) => {
153
+ if (r?.(e), !(e.defaultPrevented || s || n)) {
154
+ if (e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.altKey && !e.metaKey) {
155
+ let t = performance.now(), n = v.current, r = (t - n.lastKeyAt > M ? "" : n.search) + e.key;
156
+ v.current = {
157
+ search: r,
158
+ lastKeyAt: t
159
+ }, p(r);
160
+ } else o && (e.key === "Tab" ? m(!1) : (e.key === "Enter" || e.key === " ") && c !== null && (e.preventDefault(), d(c)));
161
+ }
162
+ };
163
+ return /* @__PURE__ */ S("button", {
164
+ type: "button",
165
+ ...u({
166
+ ...i,
167
+ id: b,
168
+ disabled: s || n,
169
+ onKeyDown: w
170
+ }),
171
+ ref: g,
172
+ "data-state": o ? "open" : "closed",
173
+ "data-ui": "select-trigger",
174
+ css: [f, z]
175
+ });
176
+ }
177
+ H.displayName = "Select.Trigger";
178
+ function U({ ref: e, placeholder: t, ...n }) {
179
+ let { selectedValue: r, options: i } = L("Value"), a = r === void 0 ? void 0 : i.get(r)?.label, o = a === void 0;
180
+ return /* @__PURE__ */ S("span", {
181
+ ...n,
182
+ ref: e,
183
+ "data-placeholder": o || void 0,
184
+ "data-ui": "select-value",
185
+ css: B,
186
+ children: o ? t : a
187
+ });
188
+ }
189
+ U.displayName = "Select.Value";
190
+ function W({ ref: e, style: t, onMouseDown: n, children: r, ...o }) {
191
+ let { open: s, triggerLabelling: c, refs: l, floatingStyles: u, elementsRef: d, getFloatingProps: f } = L("Content"), p = A([s ? l.setFloating : null, e]), m = o["aria-labelledby"] !== void 0 || o["aria-label"] !== void 0 ? {} : c?.labelledBy === void 0 ? c?.label === void 0 ? { "aria-labelledby": c?.id } : { "aria-label": c.label } : { "aria-labelledby": c.labelledBy }, h = (e) => {
192
+ n?.(e), e.preventDefault();
193
+ };
194
+ return /* @__PURE__ */ S(T, { children: /* @__PURE__ */ S("div", {
195
+ ...f({
196
+ ...m,
197
+ ...o,
198
+ onMouseDown: h
199
+ }),
200
+ ref: p,
201
+ hidden: !s,
202
+ "data-state": s ? "open" : "closed",
203
+ "data-ui": "select-listbox",
204
+ style: {
205
+ ...t,
206
+ ...u
207
+ },
208
+ css: [a, i],
209
+ children: /* @__PURE__ */ S(w, {
210
+ elementsRef: d,
211
+ children: /* @__PURE__ */ S(I.Provider, {
212
+ value: !0,
213
+ children: r
214
+ })
215
+ })
216
+ }) });
217
+ }
218
+ W.displayName = "Select.Content";
219
+ function G({ ref: e, value: t, disabled: n = !1, onClick: i, children: a, ...f }) {
220
+ let { baseId: p, selectedValue: m, activeIndex: h, labelsRef: g, getItemProps: _, selectValue: v, registration: b } = R(), x = y(null), { ref: w, index: T } = c(t, b, x, (e, t) => ({
221
+ index: e,
222
+ label: t,
223
+ disabled: n
224
+ }), {
225
+ labelsRef: g,
226
+ include: !n
227
+ }), E = A([w, e]), D = T !== -1 && h === T, O = m === t, k = (e) => {
228
+ i?.(e), !(n || e.defaultPrevented) && v(t);
229
+ };
230
+ return /* @__PURE__ */ C("div", {
231
+ ..._({
232
+ id: u(p, t),
233
+ ...f,
234
+ onClick: k
235
+ }),
236
+ ref: E,
237
+ role: "option",
238
+ "aria-selected": O,
239
+ "aria-disabled": n || void 0,
240
+ "data-active": D || void 0,
241
+ "data-ui": "select-item",
242
+ css: [
243
+ l,
244
+ s,
245
+ o
246
+ ],
247
+ children: [/* @__PURE__ */ S("span", {
248
+ ref: x,
249
+ css: d,
250
+ children: a
251
+ }), O && /* @__PURE__ */ S("span", {
252
+ "aria-hidden": "true",
253
+ css: r,
254
+ children: P
255
+ })]
256
+ });
257
+ }
258
+ G.displayName = "Select.Item";
259
+ var K = Object.assign(V, {
260
+ Trigger: H,
261
+ Value: U,
262
+ Content: W,
263
+ Item: G
264
+ });
265
+ //#endregion
266
+ export { K as t };
package/dist/select.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Select } from "./select-CNNiUhKB.js";
2
+ export { t as Select } from "./select-C1xGrOhT.js";
@@ -0,0 +1,49 @@
1
+ 'use client';
2
+ import { n as e, t } from "./css-Cgj6sCHn.js";
3
+ import { n } from "./media-D_eA_I-e.js";
4
+ import { vars as r } from "@jfrader/tokens/vars";
5
+ import { jsx as i } from "@emotion/react/jsx-runtime";
6
+ //#region src/components/skeleton/skeleton.tsx
7
+ var a = e({
8
+ from: { backgroundPosition: "200% 0" },
9
+ to: { backgroundPosition: "-100% 0" }
10
+ }), o = t({
11
+ display: "block",
12
+ inlineSize: "100%",
13
+ blockSize: "1em",
14
+ flexShrink: 0,
15
+ borderRadius: r.radius.sm,
16
+ backgroundColor: r.color.surfaceHover,
17
+ backgroundImage: `linear-gradient(90deg, transparent, ${r.color.border}, transparent)`,
18
+ backgroundSize: "200% 100%",
19
+ backgroundRepeat: "no-repeat",
20
+ animation: `${a} 1.6s ease-in-out infinite`,
21
+ "&:dir(rtl)": { animationDirection: "reverse" },
22
+ [n]: {
23
+ animation: "none",
24
+ backgroundImage: "none"
25
+ }
26
+ }), s = t({
27
+ inlineSize: r.space[10],
28
+ blockSize: "auto",
29
+ aspectRatio: "1",
30
+ borderRadius: r.radius.full
31
+ });
32
+ function c({ ref: e, width: t, height: n, circle: r = !1, radius: a, style: c, ...l }) {
33
+ return /* @__PURE__ */ i("div", {
34
+ ...l,
35
+ ref: e,
36
+ "aria-hidden": "true",
37
+ "data-ui": "skeleton",
38
+ style: {
39
+ inlineSize: t,
40
+ blockSize: n,
41
+ borderRadius: r ? void 0 : a,
42
+ ...c
43
+ },
44
+ css: [o, r && s]
45
+ });
46
+ }
47
+ c.displayName = "Skeleton";
48
+ //#endregion
49
+ export { c as t };