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