@jfrader/ui 0.2.0 → 0.3.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 (162) hide show
  1. package/dist/accordion-Bd-j04hW.js +198 -0
  2. package/dist/accordion.js +1 -1
  3. package/dist/alert-BBqaKI4k.js +135 -0
  4. package/dist/alert.js +1 -1
  5. package/dist/avatar-BahDVO9t.js +132 -0
  6. package/dist/avatar.js +1 -1
  7. package/dist/badge-B_sLygxU.js +108 -0
  8. package/dist/badge.js +1 -1
  9. package/dist/breadcrumbs-DVAOxfvL.js +141 -0
  10. package/dist/breadcrumbs.js +1 -1
  11. package/dist/button-P2e7_44z.js +200 -0
  12. package/dist/button.js +1 -1
  13. package/dist/calendar-C9Yad_-w.js +394 -0
  14. package/dist/calendar.js +1 -1
  15. package/dist/card-D-aI2QHx.js +158 -0
  16. package/dist/card.js +1 -1
  17. package/dist/checkbox-COYG6L7d.js +140 -0
  18. package/dist/checkbox.js +1 -1
  19. package/dist/{choice-control-ByFogYcT.js → choice-control-5kJkLXgv.js} +1 -1
  20. package/dist/{collection-registry-1l9f3XJZ.js → collection-registry-BTYi6zGh.js} +1 -1
  21. package/dist/combobox-DrmjBbo7.js +327 -0
  22. package/dist/combobox.js +1 -1
  23. package/dist/command-palette-V_2pEay7.js +379 -0
  24. package/dist/command-palette.js +1 -1
  25. package/dist/container-BOaSptJa.js +41 -0
  26. package/dist/container.js +1 -1
  27. package/dist/date-picker-ClUYBIBh.js +250 -0
  28. package/dist/date-picker.js +1 -1
  29. package/dist/dialog-xaydbXl2.js +218 -0
  30. package/dist/dialog.js +1 -1
  31. package/dist/divider-DYoJf0I_.js +84 -0
  32. package/dist/divider.js +1 -1
  33. package/dist/field-anatomy-D2ToMeRa.js +109 -0
  34. package/dist/flex-Dh-_J5-U.js +28 -0
  35. package/dist/flex.js +1 -1
  36. package/dist/{icon-wrapper-CFWzew5m.js → icon-wrapper-stN8sD7R.js} +1 -1
  37. package/dist/index.js +38 -37
  38. package/dist/kbd-C3ACoMoE.js +71 -0
  39. package/dist/kbd.js +1 -1
  40. package/dist/{layout-style-7ZTOiWGR.js → layout-style-Cbd1Vilw.js} +1 -1
  41. package/dist/{loading-ring-BpdB0aFi.js → loading-ring-B8-30Dl1.js} +1 -1
  42. package/dist/menu-DU60SMdt.js +216 -0
  43. package/dist/menu.js +1 -1
  44. package/dist/navigation-DhnKriOp.js +197 -0
  45. package/dist/navigation.js +1 -1
  46. package/dist/pagination-DYdwsxwe.js +156 -0
  47. package/dist/pagination.js +1 -1
  48. package/dist/pill-DO2gHzMb.js +56 -0
  49. package/dist/pill.js +1 -1
  50. package/dist/popover-BtN_0ejj.js +113 -0
  51. package/dist/popover.js +1 -1
  52. package/dist/progress-BpJswTG4.js +90 -0
  53. package/dist/progress.js +1 -1
  54. package/dist/radio-group-Ce0_IWQr.js +145 -0
  55. package/dist/radio-group.js +1 -1
  56. package/dist/select-BCS0-LVW.js +286 -0
  57. package/dist/select.js +1 -1
  58. package/dist/skeleton-OoFlOEXO.js +54 -0
  59. package/dist/skeleton.js +1 -1
  60. package/dist/spinner-C2YDoiMn.js +56 -0
  61. package/dist/spinner.js +1 -1
  62. package/dist/stack-DC3IbtWk.js +27 -0
  63. package/dist/stack.js +1 -1
  64. package/dist/switch-Dr-qjmT4.js +142 -0
  65. package/dist/switch.js +1 -1
  66. package/dist/sx-Dx9JUKp5.js +23 -0
  67. package/dist/tabs-CK_g1RKa.js +203 -0
  68. package/dist/tabs.js +1 -1
  69. package/dist/{text-field-8PQAqRpM.js → text-field-D60ok14S.js} +19 -18
  70. package/dist/text-field.js +1 -1
  71. package/dist/{textarea-CcGWuntL.js → textarea-DyfjtP0A.js} +19 -18
  72. package/dist/textarea.js +1 -1
  73. package/dist/theme-root-BiXXvQvr.js +42 -0
  74. package/dist/theme-root.js +1 -1
  75. package/dist/toast-iqelR-r0.js +282 -0
  76. package/dist/toast.js +1 -1
  77. package/dist/toggle-group-CI0e7hFm.js +166 -0
  78. package/dist/toggle-group.js +1 -1
  79. package/dist/tooltip-CB-HC1js.js +108 -0
  80. package/dist/tooltip.js +1 -1
  81. package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
  82. package/dist/types/components/accordion/accordion.d.ts +9 -8
  83. package/dist/types/components/alert/alert.d.ts +3 -2
  84. package/dist/types/components/avatar/avatar.d.ts +3 -2
  85. package/dist/types/components/badge/badge.d.ts +3 -2
  86. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -4
  87. package/dist/types/components/button/button.d.ts +3 -2
  88. package/dist/types/components/calendar/calendar.d.ts +7 -6
  89. package/dist/types/components/card/card.d.ts +13 -12
  90. package/dist/types/components/checkbox/checkbox.d.ts +3 -2
  91. package/dist/types/components/combobox/combobox.d.ts +8 -7
  92. package/dist/types/components/command-palette/command-palette.d.ts +15 -14
  93. package/dist/types/components/container/container.d.ts +3 -2
  94. package/dist/types/components/date-picker/date-picker.d.ts +3 -2
  95. package/dist/types/components/dialog/dialog.d.ts +11 -10
  96. package/dist/types/components/divider/divider.d.ts +3 -2
  97. package/dist/types/components/field/field-anatomy.d.ts +3 -2
  98. package/dist/types/components/flex/flex.d.ts +3 -2
  99. package/dist/types/components/kbd/kbd.d.ts +5 -4
  100. package/dist/types/components/menu/menu.d.ts +9 -8
  101. package/dist/types/components/navigation/navigation.d.ts +7 -6
  102. package/dist/types/components/pagination/pagination.d.ts +3 -2
  103. package/dist/types/components/pill/pill.d.ts +3 -2
  104. package/dist/types/components/popover/popover.d.ts +5 -4
  105. package/dist/types/components/progress/progress.d.ts +3 -2
  106. package/dist/types/components/radio-group/radio-group.d.ts +5 -4
  107. package/dist/types/components/select/select.d.ts +9 -8
  108. package/dist/types/components/skeleton/skeleton.d.ts +3 -2
  109. package/dist/types/components/spinner/spinner.d.ts +3 -2
  110. package/dist/types/components/stack/stack.d.ts +1 -1
  111. package/dist/types/components/switch/switch.d.ts +3 -2
  112. package/dist/types/components/tabs/tabs.d.ts +9 -8
  113. package/dist/types/components/text-field/text-field.d.ts +3 -2
  114. package/dist/types/components/textarea/textarea.d.ts +3 -2
  115. package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
  116. package/dist/types/components/theme-root/theme-root.d.ts +3 -2
  117. package/dist/types/components/toast/toast.d.ts +3 -2
  118. package/dist/types/components/toggle-group/toggle-group.d.ts +5 -4
  119. package/dist/types/components/tooltip/tooltip.d.ts +5 -4
  120. package/dist/types/index.d.ts +4 -0
  121. package/dist/types/styling/css.d.ts +3 -2
  122. package/dist/types/styling/styled.d.ts +1 -0
  123. package/dist/types/styling/sx.d.ts +16 -0
  124. package/dist/types/styling/theme.d.ts +98 -0
  125. package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
  126. package/package.json +3 -2
  127. package/dist/accordion-CkOZ-tvs.js +0 -178
  128. package/dist/alert-Dsjx14UW.js +0 -131
  129. package/dist/avatar-BRGKkoSr.js +0 -127
  130. package/dist/badge-DLxUMsCx.js +0 -104
  131. package/dist/breadcrumbs-694hF_hm.js +0 -131
  132. package/dist/button-CoaIcykB.js +0 -190
  133. package/dist/calendar-Doj7PTdG.js +0 -379
  134. package/dist/card-2IM71XZj.js +0 -134
  135. package/dist/checkbox-B7xGNFzp.js +0 -136
  136. package/dist/combobox-Bjhxv5U3.js +0 -311
  137. package/dist/command-palette-BhJwm6cS.js +0 -344
  138. package/dist/container-BhnrGPu-.js +0 -36
  139. package/dist/css-Cgj6sCHn.js +0 -2
  140. package/dist/date-picker-Jk8SpoiO.js +0 -245
  141. package/dist/dialog-fhS07G41.js +0 -187
  142. package/dist/divider-v_78HYF5.js +0 -79
  143. package/dist/field-anatomy-BzGw1Ch9.js +0 -105
  144. package/dist/flex-COZzFqI8.js +0 -22
  145. package/dist/kbd-CeP8Kfvp.js +0 -61
  146. package/dist/menu-B6KCbLCr.js +0 -196
  147. package/dist/navigation-BDht6S2-.js +0 -182
  148. package/dist/pagination-B50PCaDU.js +0 -151
  149. package/dist/pill-2_XzBdkD.js +0 -51
  150. package/dist/popover-DRHbeIVq.js +0 -103
  151. package/dist/progress-CpsskKTD.js +0 -85
  152. package/dist/radio-group-DPI5KUCj.js +0 -136
  153. package/dist/select-C1xGrOhT.js +0 -266
  154. package/dist/skeleton-DitdP-yz.js +0 -49
  155. package/dist/spinner-CFq5HPoo.js +0 -51
  156. package/dist/stack-D_g6NJzo.js +0 -21
  157. package/dist/switch-B5TTU-oJ.js +0 -138
  158. package/dist/tabs-C26PWl2c.js +0 -183
  159. package/dist/theme-root-BRLIA4eb.js +0 -22
  160. package/dist/toast-B1PXuwZ4.js +0 -277
  161. package/dist/toggle-group-N_owicT0.js +0 -156
  162. package/dist/tooltip-BJPisf60.js +0 -98
@@ -1,136 +0,0 @@
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,266 +0,0 @@
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 };
@@ -1,49 +0,0 @@
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 };
@@ -1,51 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { n as t } from "./media-D_eA_I-e.js";
4
- import { t as n } from "./visually-hidden-DCWhf0Cb.js";
5
- import { n as r, t as i } from "./loading-ring-BpdB0aFi.js";
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/components/spinner/spinner.tsx
9
- var c = e({
10
- position: "relative",
11
- display: "inline-flex",
12
- verticalAlign: "middle"
13
- }), l = e({
14
- ...i,
15
- flexShrink: 0,
16
- boxSizing: "border-box",
17
- [t]: { animation: `${r} 1.6s ease-in-out infinite alternate` }
18
- }), u = {
19
- sm: e({
20
- inlineSize: a.space[4],
21
- blockSize: a.space[4]
22
- }),
23
- md: e({
24
- inlineSize: a.space[5],
25
- blockSize: a.space[5]
26
- }),
27
- lg: e({
28
- inlineSize: a.space[6],
29
- blockSize: a.space[6]
30
- })
31
- };
32
- function d({ ref: e, size: t = "md", label: r = "Loading", ...i }) {
33
- return /* @__PURE__ */ s("span", {
34
- ...i,
35
- ref: e,
36
- role: "status",
37
- "data-ui": "spinner",
38
- css: c,
39
- children: [/* @__PURE__ */ o("span", {
40
- "aria-hidden": "true",
41
- "data-ui": "spinner-indicator",
42
- css: [l, u[t]]
43
- }), /* @__PURE__ */ o("span", {
44
- css: n,
45
- children: r
46
- })]
47
- });
48
- }
49
- d.displayName = "Spinner";
50
- //#endregion
51
- export { d as t };
@@ -1,21 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./layout-style-7ZTOiWGR.js";
3
- import { jsx as t } from "@emotion/react/jsx-runtime";
4
- //#region src/components/stack/stack.tsx
5
- function n({ ref: n, gap: r = "md", align: i, justify: a, wrap: o, ...s }) {
6
- return /* @__PURE__ */ t("div", {
7
- ...s,
8
- ref: n,
9
- "data-ui": "stack",
10
- css: e({
11
- direction: "column",
12
- gap: r,
13
- align: i,
14
- justify: a,
15
- wrap: o
16
- })
17
- });
18
- }
19
- n.displayName = "Stack";
20
- //#endregion
21
- export { n as t };
@@ -1,138 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { n as t } from "./media-D_eA_I-e.js";
4
- import { t as n } from "./renderable-DzcIj1Lo.js";
5
- import { i as r, n as i, r as a, t as o } from "./choice-control-ByFogYcT.js";
6
- import { 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";
9
- //#region src/components/switch/switch.tsx
10
- var d = {
11
- sm: "36px",
12
- md: "44px"
13
- }, f = e({
14
- position: "relative",
15
- display: "inline-block",
16
- flexShrink: 0,
17
- boxSizing: "border-box",
18
- border: `1px solid ${c.color.borderControl}`,
19
- borderRadius: c.radius.full,
20
- backgroundColor: c.color.surfaceHover,
21
- transitionProperty: "background-color, border-color",
22
- transitionDuration: c.motion.duration.fast,
23
- transitionTimingFunction: c.motion.easeStandard,
24
- "&::after": {
25
- content: "\"\"",
26
- position: "absolute",
27
- insetBlockStart: "2px",
28
- insetInlineStart: "2px",
29
- borderRadius: c.radius.full,
30
- backgroundColor: c.color.text,
31
- transitionProperty: "transform, background-color",
32
- transitionDuration: c.motion.duration.fast,
33
- transitionTimingFunction: c.motion.easeStandard
34
- },
35
- [t]: {
36
- transitionDuration: "0s",
37
- "&::after": { transitionDuration: "0s" }
38
- }
39
- }), p = {
40
- sm: e({
41
- inlineSize: d.sm,
42
- blockSize: "20px",
43
- "&::after": {
44
- inlineSize: "14px",
45
- blockSize: "14px"
46
- }
47
- }),
48
- md: e({
49
- inlineSize: d.md,
50
- blockSize: "24px",
51
- "&::after": {
52
- inlineSize: "18px",
53
- blockSize: "18px"
54
- }
55
- })
56
- }, m = {
57
- sm: e({
58
- "input:checked + span::after": {
59
- transform: "translateX(16px)",
60
- backgroundColor: c.color.accentContrast
61
- },
62
- "&:dir(rtl) input:checked + span::after": { transform: "translateX(-16px)" }
63
- }),
64
- md: e({
65
- "input:checked + span::after": {
66
- transform: "translateX(20px)",
67
- backgroundColor: c.color.accentContrast
68
- },
69
- "&:dir(rtl) input:checked + span::after": { transform: "translateX(-20px)" }
70
- })
71
- }, h = {
72
- sm: e({ fontSize: c.textSize.sm }),
73
- md: e({ fontSize: c.textSize.md })
74
- }, g = e({
75
- fontSize: c.textSize.sm,
76
- color: c.color.textMuted
77
- }), _ = {
78
- sm: e({ marginInlineStart: `calc(${d.sm} + ${c.space[2]})` }),
79
- md: e({ marginInlineStart: `calc(${d.md} + ${c.space[2]})` })
80
- };
81
- function v({ ref: e, label: t, description: c, size: d = "md", onChange: v, onCheckedChange: y, slotProps: b, className: x, dir: S, "aria-labelledby": C, "aria-describedby": w, ...T }) {
82
- let E = s(), D = `${E}-label`, O = `${E}-description`, k = n(t), A = n(c), j = [C, k && D].filter(Boolean).join(" ") || void 0, M = [w, A && O].filter(Boolean).join(" ") || void 0, N = [x, b?.root?.className].filter(Boolean).join(" ") || void 0, P = (e) => {
83
- v?.(e), y?.(e.currentTarget.checked);
84
- };
85
- return /* @__PURE__ */ u("label", {
86
- "data-ui": "switch",
87
- dir: S,
88
- className: N,
89
- css: [
90
- a,
91
- i,
92
- m[d],
93
- b?.root?.css
94
- ],
95
- children: [/* @__PURE__ */ u("span", {
96
- css: r,
97
- children: [
98
- /* @__PURE__ */ l("input", {
99
- ...T,
100
- ref: e,
101
- type: "checkbox",
102
- role: "switch",
103
- "aria-labelledby": j,
104
- "aria-describedby": M,
105
- onChange: P,
106
- css: o
107
- }),
108
- /* @__PURE__ */ l("span", {
109
- "aria-hidden": "true",
110
- className: b?.control?.className,
111
- css: [
112
- f,
113
- p[d],
114
- b?.control?.css
115
- ]
116
- }),
117
- k && /* @__PURE__ */ l("span", {
118
- id: D,
119
- className: b?.label?.className,
120
- css: [h[d], b?.label?.css],
121
- children: t
122
- })
123
- ]
124
- }), A && /* @__PURE__ */ l("span", {
125
- id: O,
126
- className: b?.description?.className,
127
- css: [
128
- g,
129
- _[d],
130
- b?.description?.css
131
- ],
132
- children: c
133
- })]
134
- });
135
- }
136
- v.displayName = "Switch";
137
- //#endregion
138
- export { v as t };