@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
@@ -1,50 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { forwardRef as t } from "react";
4
- import { vars as n } from "@jfrader/tokens/vars";
5
- import { jsx as r } from "@emotion/react/jsx-runtime";
6
- //#region src/components/pill/pill.tsx
7
- var i = e({
8
- display: "inline-flex",
9
- alignItems: "center",
10
- boxSizing: "border-box",
11
- blockSize: n.space[5],
12
- paddingInline: n.space[2],
13
- borderRadius: n.radius.full,
14
- fontSize: n.textSize.xs,
15
- fontWeight: n.fontWeight.medium,
16
- lineHeight: 1,
17
- whiteSpace: "nowrap",
18
- verticalAlign: "middle"
19
- }), a = {
20
- neutral: e({
21
- backgroundColor: n.color.surfaceHover,
22
- color: n.color.textMuted
23
- }),
24
- accent: e({
25
- backgroundColor: n.color.accentSoft,
26
- color: n.color.accentText
27
- }),
28
- success: e({
29
- backgroundColor: n.color.successSoft,
30
- color: n.color.success
31
- }),
32
- warning: e({
33
- backgroundColor: n.color.warningSoft,
34
- color: n.color.warning
35
- }),
36
- danger: e({
37
- backgroundColor: n.color.dangerSoft,
38
- color: n.color.dangerText
39
- })
40
- }, o = t(function({ tone: e = "neutral", ...t }, n) {
41
- return /* @__PURE__ */ r("span", {
42
- ...t,
43
- ref: n,
44
- "data-ui": "pill",
45
- "data-tone": e,
46
- css: [i, a[e]]
47
- });
48
- });
49
- //#endregion
50
- export { o as t };
@@ -1,98 +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 { 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, forwardRef as o, useContext as s, useEffect as c, useMemo as l, useRef as u } from "react";
8
- import { vars as d } from "@jfrader/tokens/vars";
9
- import { jsx as f } from "@emotion/react/jsx-runtime";
10
- import { FloatingFocusManager as p, FloatingPortal as m, useClick as h, useDismiss as g, useInteractions as _, useMergeRefs as v, useRole as y } from "@floating-ui/react";
11
- //#region src/components/popover/popover.tsx
12
- var b = a(null);
13
- function x(e) {
14
- let t = s(b);
15
- if (!t) throw Error(`Popover.${e} must be rendered inside <Popover>.`);
16
- return t;
17
- }
18
- var S = e({
19
- ...r,
20
- borderRadius: d.radius.lg,
21
- boxShadow: d.shadow.overlay,
22
- padding: d.space[4],
23
- minInlineSize: "200px",
24
- maxInlineSize: "min(360px, calc(100vw - 32px))",
25
- fontSize: d.textSize.sm
26
- });
27
- function C({ open: e, defaultOpen: n = !1, onOpenChange: r, placement: a = "bottom", children: o }) {
28
- let [s = !1, d] = t(e, n, r), p = u(!1), { refs: m, floatingStyles: v, context: x } = i({
29
- open: s,
30
- placement: a,
31
- onOpenChange: (e, t, n) => {
32
- e || (p.current = n === "escape-key"), d(e);
33
- }
34
- });
35
- c(() => {
36
- !s && p.current && (p.current = !1, m.domReference.current?.focus());
37
- }, [s, m]);
38
- let S = h(x), C = g(x, {
39
- escapeKey: !0,
40
- outsidePress: !0
41
- }), w = y(x, { role: "dialog" }), { getReferenceProps: T, getFloatingProps: E } = _([
42
- S,
43
- C,
44
- w
45
- ]), D = l(() => ({
46
- open: s,
47
- refs: m,
48
- floatingContext: x,
49
- floatingStyles: v,
50
- getReferenceProps: T,
51
- getFloatingProps: E
52
- }), [
53
- s,
54
- m,
55
- x,
56
- v,
57
- T,
58
- E
59
- ]);
60
- return /* @__PURE__ */ f(b.Provider, {
61
- value: D,
62
- children: o
63
- });
64
- }
65
- var w = o(function(e, t) {
66
- let { refs: r, getReferenceProps: i } = x("Trigger"), a = v([r.setReference, t]);
67
- return /* @__PURE__ */ f("button", {
68
- type: "button",
69
- ...i(e),
70
- ref: a,
71
- "data-ui": "popover-trigger",
72
- css: n
73
- });
74
- }), T = o(function({ style: e, ...t }, n) {
75
- let { open: r, refs: i, floatingContext: a, floatingStyles: o, getFloatingProps: s } = x("Content"), c = v([i.setFloating, n]);
76
- return r ? /* @__PURE__ */ f(m, { children: /* @__PURE__ */ f(p, {
77
- context: a,
78
- modal: !1,
79
- initialFocus: -1,
80
- returnFocus: !1,
81
- closeOnFocusOut: !1,
82
- children: /* @__PURE__ */ f("div", {
83
- ...s(t),
84
- ref: c,
85
- "data-ui": "popover",
86
- style: {
87
- ...e,
88
- ...o
89
- },
90
- css: S
91
- })
92
- }) }) : null;
93
- }), E = Object.assign(C, {
94
- Trigger: w,
95
- Content: T
96
- });
97
- //#endregion
98
- export { E as t };
@@ -1,131 +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, forwardRef as u, useContext as d, useId as f, useMemo as p } from "react";
8
- import { vars as m } from "@jfrader/tokens/vars";
9
- import { jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
10
- //#region src/components/radio-group/radio-group.tsx
11
- var _ = l(null);
12
- function v(e) {
13
- let t = d(_);
14
- if (!t) throw Error(`RadioGroup.${e} must be rendered inside <RadioGroup>.`);
15
- return t;
16
- }
17
- var y = "16px", b = {
18
- vertical: e({
19
- display: "grid",
20
- justifyItems: "start",
21
- gap: m.space[3]
22
- }),
23
- horizontal: e({
24
- display: "flex",
25
- flexWrap: "wrap",
26
- alignItems: "flex-start",
27
- gap: m.space[4]
28
- })
29
- }, x = e({ "input:checked + span::after": { opacity: 1 } }), S = e({ minBlockSize: "32px" }), C = e({
30
- display: "inline-flex",
31
- alignItems: "center",
32
- justifyContent: "center",
33
- flexShrink: 0,
34
- boxSizing: "border-box",
35
- inlineSize: y,
36
- blockSize: y,
37
- border: `1px solid ${m.color.borderControl}`,
38
- borderRadius: m.radius.full,
39
- backgroundColor: m.color.surfaceRaised,
40
- transitionProperty: "background-color, border-color",
41
- transitionDuration: m.motion.duration.fast,
42
- transitionTimingFunction: m.motion.easeStandard,
43
- "&::after": {
44
- content: "\"\"",
45
- inlineSize: "40%",
46
- blockSize: "40%",
47
- borderRadius: m.radius.full,
48
- backgroundColor: m.color.accentContrast,
49
- opacity: 0
50
- },
51
- [t]: { transitionDuration: "0s" },
52
- [n]: { "&::after": { backgroundColor: "CanvasText" } }
53
- }), w = e({ fontSize: m.textSize.sm }), T = e({
54
- marginInlineStart: `calc(${y} + ${m.space[2]})`,
55
- fontSize: m.textSize.sm,
56
- color: m.color.textMuted
57
- }), E = u(function({ value: e, defaultValue: t, onValueChange: n, name: i, disabled: a = !1, orientation: o = "vertical", ...s }, c) {
58
- let l = f(), u = i ?? l, [d, m] = r(e, t, n), g = p(() => ({
59
- value: d,
60
- setValue: m,
61
- name: u,
62
- disabled: a
63
- }), [
64
- d,
65
- m,
66
- u,
67
- a
68
- ]);
69
- return /* @__PURE__ */ h(_.Provider, {
70
- value: g,
71
- children: /* @__PURE__ */ h("div", {
72
- ...s,
73
- ref: c,
74
- role: "radiogroup",
75
- "aria-orientation": o,
76
- "data-ui": "radio-group-root",
77
- "data-orientation": o,
78
- css: b[o]
79
- })
80
- });
81
- }), D = u(function({ value: e, label: t, description: n, disabled: r, onChange: l, slotProps: u, className: d, "aria-labelledby": p, "aria-describedby": m, ..._ }, y) {
82
- 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) => {
83
- l?.(t), t.currentTarget.checked && E(e);
84
- };
85
- return /* @__PURE__ */ g("label", {
86
- "data-ui": "radio-group-radio",
87
- className: L,
88
- css: [
89
- s,
90
- x,
91
- o,
92
- u?.root?.css
93
- ],
94
- children: [/* @__PURE__ */ g("span", {
95
- css: [a, S],
96
- children: [
97
- /* @__PURE__ */ h("input", {
98
- ..._,
99
- ref: y,
100
- type: "radio",
101
- name: D,
102
- value: e,
103
- checked: b === e,
104
- disabled: k,
105
- "aria-labelledby": F,
106
- "aria-describedby": I,
107
- onChange: R,
108
- css: c
109
- }),
110
- /* @__PURE__ */ h("span", {
111
- "aria-hidden": "true",
112
- className: u?.control?.className,
113
- css: [C, u?.control?.css]
114
- }),
115
- N && /* @__PURE__ */ h("span", {
116
- id: j,
117
- className: u?.label?.className,
118
- css: [w, u?.label?.css],
119
- children: t
120
- })
121
- ]
122
- }), P && /* @__PURE__ */ h("span", {
123
- id: M,
124
- className: u?.description?.className,
125
- css: [T, u?.description?.css],
126
- children: n
127
- })]
128
- });
129
- }), O = Object.assign(E, { Radio: D });
130
- //#endregion
131
- export { O as t };
@@ -1,257 +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, forwardRef as h, useContext as g, useId as _, useLayoutEffect as v, useMemo as y, useRef as b, useState as x } from "react";
8
- import { vars as S } from "@jfrader/tokens/vars";
9
- import { jsx as C, jsxs as w } from "@emotion/react/jsx-runtime";
10
- 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";
11
- //#region src/components/select/select.tsx
12
- var N = 500, P = new Intl.Collator(void 0, {
13
- usage: "search",
14
- sensitivity: "base"
15
- }), F = "✓", I = m(null), L = m(!1);
16
- function R(e) {
17
- let t = g(I);
18
- if (!t) throw Error(`Select.${e} must be rendered inside <Select>.`);
19
- return t;
20
- }
21
- function z() {
22
- let e = R("Item");
23
- if (!g(L)) throw Error("Select.Item must be rendered inside <Select.Content>.");
24
- return e;
25
- }
26
- var B = e({
27
- justifyContent: "flex-start",
28
- minInlineSize: "180px",
29
- "&[aria-expanded=\"true\"]": { backgroundColor: S.color.surfaceHover }
30
- }), V = e({
31
- overflow: "hidden",
32
- textOverflow: "ellipsis",
33
- whiteSpace: "nowrap",
34
- "&[data-placeholder]": { color: S.color.textMuted }
35
- });
36
- 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 }) {
37
- 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);
38
- !g && E && (j(!1), T(null));
39
- let { valuesByIndex: H, disabledIndices: U } = y(() => {
40
- let e = [], t = /* @__PURE__ */ new Set();
41
- return N.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
- }, [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({
48
- open: g,
49
- placement: c,
50
- onOpenChange: (e) => v(e)
51
- }), Y = D(J), X = M(J, { role: "listbox" }), ee = O(J, {
52
- escapeKey: !0,
53
- outsidePress: !0
54
- }), te = A(J, {
55
- listRef: z,
56
- activeIndex: S,
57
- onNavigate: T,
58
- virtual: !0,
59
- virtualItemRef: V,
60
- loop: !0,
61
- focusItemOnOpen: !0,
62
- selectedIndex: E ? null : G,
63
- disabledIndices: (e) => U.has(e)
64
- }), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = k([
65
- Y,
66
- X,
67
- ee,
68
- te
69
- ]), ne = y(() => {
70
- let e = (e) => {
71
- h(e), v(!1);
72
- };
73
- return {
74
- baseId: f,
75
- open: g,
76
- disabled: l,
77
- selectedValue: m,
78
- activeIndex: S,
79
- options: N,
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 = S ?? -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)) && P.compare(a.slice(0, e.length), e) === 0) {
94
- T(i), g || (j(!0), v(!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: v,
104
- registration: F,
105
- setTriggerLabelling: R
106
- };
107
- }, [
108
- f,
109
- g,
110
- l,
111
- m,
112
- S,
113
- N,
114
- L,
115
- K,
116
- q,
117
- Z,
118
- Q,
119
- $,
120
- H,
121
- U,
122
- h,
123
- v,
124
- F
125
- ]);
126
- return /* @__PURE__ */ w(I.Provider, {
127
- value: ne,
128
- children: [d, u !== void 0 && /* @__PURE__ */ C("input", {
129
- type: "hidden",
130
- name: u,
131
- value: m ?? "",
132
- disabled: l
133
- })]
134
- });
135
- }
136
- var U = h(function({ id: e, disabled: t, onKeyDown: n, ...r }, i) {
137
- 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({
138
- search: "",
139
- lastKeyAt: 0
140
- }), y = e ?? `${a}-trigger`, x = r["aria-labelledby"], S = r["aria-label"];
141
- v(() => (h({
142
- id: y,
143
- labelledBy: x,
144
- label: S
145
- }), () => h(null)), [
146
- y,
147
- x,
148
- S,
149
- h
150
- ]);
151
- let w = (e) => {
152
- if (n?.(e), !(e.defaultPrevented || s || t)) {
153
- if (e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.altKey && !e.metaKey) {
154
- let t = performance.now(), n = _.current, r = (t - n.lastKeyAt > N ? "" : n.search) + e.key;
155
- _.current = {
156
- search: r,
157
- lastKeyAt: t
158
- }, p(r);
159
- } else o && (e.key === "Tab" ? m(!1) : (e.key === "Enter" || e.key === " ") && c !== null && (e.preventDefault(), d(c)));
160
- }
161
- };
162
- return /* @__PURE__ */ C("button", {
163
- type: "button",
164
- ...u({
165
- ...r,
166
- id: y,
167
- disabled: s || t,
168
- onKeyDown: w
169
- }),
170
- ref: g,
171
- "data-state": o ? "open" : "closed",
172
- "data-ui": "select-trigger",
173
- css: [f, B]
174
- });
175
- }), W = h(function({ placeholder: e, ...t }, n) {
176
- let { selectedValue: r, options: i } = R("Value"), a = r === void 0 ? void 0 : i.get(r)?.label, o = a === void 0;
177
- return /* @__PURE__ */ C("span", {
178
- ...t,
179
- ref: n,
180
- "data-placeholder": o || void 0,
181
- "data-ui": "select-value",
182
- css: V,
183
- children: o ? e : a
184
- });
185
- }), G = h(function({ style: e, onMouseDown: t, children: n, ...r }, o) {
186
- 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) => {
187
- t?.(e), e.preventDefault();
188
- };
189
- return /* @__PURE__ */ C(E, { children: /* @__PURE__ */ C("div", {
190
- ...f({
191
- ...m,
192
- ...r,
193
- onMouseDown: h
194
- }),
195
- ref: p,
196
- hidden: !s,
197
- "data-state": s ? "open" : "closed",
198
- "data-ui": "select-listbox",
199
- style: {
200
- ...e,
201
- ...u
202
- },
203
- css: [a, i],
204
- children: /* @__PURE__ */ C(T, {
205
- elementsRef: d,
206
- children: /* @__PURE__ */ C(L.Provider, {
207
- value: !0,
208
- children: n
209
- })
210
- })
211
- }) });
212
- }), K = h(function({ value: e, disabled: t = !1, onClick: n, children: i, ...a }, f) {
213
- 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) => ({
214
- index: e,
215
- label: n,
216
- disabled: t
217
- }), {
218
- labelsRef: g,
219
- include: !t
220
- }), E = j([S, f]), D = T !== -1 && h === T, O = m === e, k = (r) => {
221
- n?.(r), !(t || r.defaultPrevented) && v(e);
222
- };
223
- return /* @__PURE__ */ w("div", {
224
- ..._({
225
- id: u(p, e),
226
- ...a,
227
- onClick: k
228
- }),
229
- ref: E,
230
- role: "option",
231
- "aria-selected": O,
232
- "aria-disabled": t || void 0,
233
- "data-active": D || void 0,
234
- "data-ui": "select-item",
235
- css: [
236
- l,
237
- s,
238
- o
239
- ],
240
- children: [/* @__PURE__ */ C("span", {
241
- ref: x,
242
- css: d,
243
- children: i
244
- }), O && /* @__PURE__ */ C("span", {
245
- "aria-hidden": "true",
246
- css: r,
247
- children: F
248
- })]
249
- });
250
- }), q = Object.assign(H, {
251
- Trigger: U,
252
- Value: W,
253
- Content: G,
254
- Item: K
255
- });
256
- //#endregion
257
- export { q as t };
@@ -1,48 +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 { forwardRef as r } from "react";
5
- import { vars as i } from "@jfrader/tokens/vars";
6
- import { jsx as a } from "@emotion/react/jsx-runtime";
7
- //#region src/components/skeleton/skeleton.tsx
8
- var o = e({
9
- from: { backgroundPosition: "200% 0" },
10
- to: { backgroundPosition: "-100% 0" }
11
- }), s = t({
12
- display: "block",
13
- inlineSize: "100%",
14
- blockSize: "1em",
15
- flexShrink: 0,
16
- borderRadius: i.radius.sm,
17
- backgroundColor: i.color.surfaceHover,
18
- backgroundImage: `linear-gradient(90deg, transparent, ${i.color.border}, transparent)`,
19
- backgroundSize: "200% 100%",
20
- backgroundRepeat: "no-repeat",
21
- animation: `${o} 1.6s ease-in-out infinite`,
22
- "&:dir(rtl)": { animationDirection: "reverse" },
23
- [n]: {
24
- animation: "none",
25
- backgroundImage: "none"
26
- }
27
- }), c = t({
28
- inlineSize: i.space[10],
29
- blockSize: "auto",
30
- aspectRatio: "1",
31
- borderRadius: i.radius.full
32
- }), l = r(function({ width: e, height: t, circle: n = !1, radius: r, style: i, ...o }, l) {
33
- return /* @__PURE__ */ a("div", {
34
- ...o,
35
- ref: l,
36
- "aria-hidden": "true",
37
- "data-ui": "skeleton",
38
- style: {
39
- inlineSize: e,
40
- blockSize: t,
41
- borderRadius: n ? void 0 : r,
42
- ...i
43
- },
44
- css: [s, n && c]
45
- });
46
- });
47
- //#endregion
48
- export { l as t };
@@ -1,21 +0,0 @@
1
- 'use client';
2
- import { t as e } from "./layout-style-7ZTOiWGR.js";
3
- import { forwardRef as t } from "react";
4
- import { jsx as n } from "@emotion/react/jsx-runtime";
5
- //#region src/components/stack/stack.tsx
6
- var r = t(function({ gap: t = "md", align: r, justify: i, wrap: a, ...o }, s) {
7
- return /* @__PURE__ */ n("div", {
8
- ...o,
9
- ref: s,
10
- "data-ui": "stack",
11
- css: e({
12
- direction: "column",
13
- gap: t,
14
- align: r,
15
- justify: i,
16
- wrap: a
17
- })
18
- });
19
- });
20
- //#endregion
21
- export { r as t };