@jfrader/ui 0.2.0 → 0.4.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/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-DiMC2g_u.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-C29Uo4Tx.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-CGPTNRnF.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-CdRXjQqI.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-BgG7WgSh.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-BbTBuLMQ.js +46 -0
  74. package/dist/theme-root.js +1 -1
  75. package/dist/theme-scope-t7nAKc2c.js +27 -0
  76. package/dist/toast-CjmELMZZ.js +283 -0
  77. package/dist/toast.js +1 -1
  78. package/dist/toggle-group-CI0e7hFm.js +166 -0
  79. package/dist/toggle-group.js +1 -1
  80. package/dist/tooltip-CaL3rKbV.js +108 -0
  81. package/dist/tooltip.js +1 -1
  82. package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
  83. package/dist/types/components/accordion/accordion.d.ts +9 -8
  84. package/dist/types/components/alert/alert.d.ts +3 -2
  85. package/dist/types/components/avatar/avatar.d.ts +3 -2
  86. package/dist/types/components/badge/badge.d.ts +3 -2
  87. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -4
  88. package/dist/types/components/button/button.d.ts +3 -2
  89. package/dist/types/components/calendar/calendar.d.ts +7 -6
  90. package/dist/types/components/card/card.d.ts +13 -12
  91. package/dist/types/components/checkbox/checkbox.d.ts +3 -2
  92. package/dist/types/components/combobox/combobox.d.ts +8 -7
  93. package/dist/types/components/command-palette/command-palette.d.ts +15 -14
  94. package/dist/types/components/container/container.d.ts +3 -2
  95. package/dist/types/components/date-picker/date-picker.d.ts +3 -2
  96. package/dist/types/components/dialog/dialog.d.ts +11 -10
  97. package/dist/types/components/divider/divider.d.ts +3 -2
  98. package/dist/types/components/field/field-anatomy.d.ts +3 -2
  99. package/dist/types/components/flex/flex.d.ts +3 -2
  100. package/dist/types/components/kbd/kbd.d.ts +5 -4
  101. package/dist/types/components/menu/menu.d.ts +9 -8
  102. package/dist/types/components/navigation/navigation.d.ts +7 -6
  103. package/dist/types/components/pagination/pagination.d.ts +3 -2
  104. package/dist/types/components/pill/pill.d.ts +3 -2
  105. package/dist/types/components/popover/popover.d.ts +5 -4
  106. package/dist/types/components/progress/progress.d.ts +3 -2
  107. package/dist/types/components/radio-group/radio-group.d.ts +5 -4
  108. package/dist/types/components/select/select.d.ts +9 -8
  109. package/dist/types/components/skeleton/skeleton.d.ts +3 -2
  110. package/dist/types/components/spinner/spinner.d.ts +3 -2
  111. package/dist/types/components/stack/stack.d.ts +1 -1
  112. package/dist/types/components/switch/switch.d.ts +3 -2
  113. package/dist/types/components/tabs/tabs.d.ts +9 -8
  114. package/dist/types/components/text-field/text-field.d.ts +3 -2
  115. package/dist/types/components/textarea/textarea.d.ts +3 -2
  116. package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
  117. package/dist/types/components/theme-root/theme-root.d.ts +11 -4
  118. package/dist/types/components/toast/toast.d.ts +3 -2
  119. package/dist/types/components/toggle-group/toggle-group.d.ts +5 -4
  120. package/dist/types/components/tooltip/tooltip.d.ts +5 -4
  121. package/dist/types/index.d.ts +4 -0
  122. package/dist/types/overlay/overlay-portal.d.ts +7 -0
  123. package/dist/types/styling/css.d.ts +3 -2
  124. package/dist/types/styling/styled.d.ts +1 -0
  125. package/dist/types/styling/sx.d.ts +16 -0
  126. package/dist/types/styling/theme-scope.d.ts +19 -0
  127. package/dist/types/styling/theme.d.ts +98 -0
  128. package/dist/use-overlay-floating-Bit-f0FU.js +31 -0
  129. package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
  130. package/package.json +3 -2
  131. package/dist/accordion-CkOZ-tvs.js +0 -178
  132. package/dist/alert-Dsjx14UW.js +0 -131
  133. package/dist/avatar-BRGKkoSr.js +0 -127
  134. package/dist/badge-DLxUMsCx.js +0 -104
  135. package/dist/breadcrumbs-694hF_hm.js +0 -131
  136. package/dist/button-CoaIcykB.js +0 -190
  137. package/dist/calendar-Doj7PTdG.js +0 -379
  138. package/dist/card-2IM71XZj.js +0 -134
  139. package/dist/checkbox-B7xGNFzp.js +0 -136
  140. package/dist/combobox-Bjhxv5U3.js +0 -311
  141. package/dist/command-palette-BhJwm6cS.js +0 -344
  142. package/dist/container-BhnrGPu-.js +0 -36
  143. package/dist/css-Cgj6sCHn.js +0 -2
  144. package/dist/date-picker-Jk8SpoiO.js +0 -245
  145. package/dist/dialog-fhS07G41.js +0 -187
  146. package/dist/divider-v_78HYF5.js +0 -79
  147. package/dist/field-anatomy-BzGw1Ch9.js +0 -105
  148. package/dist/flex-COZzFqI8.js +0 -22
  149. package/dist/kbd-CeP8Kfvp.js +0 -61
  150. package/dist/menu-B6KCbLCr.js +0 -196
  151. package/dist/navigation-BDht6S2-.js +0 -182
  152. package/dist/pagination-B50PCaDU.js +0 -151
  153. package/dist/pill-2_XzBdkD.js +0 -51
  154. package/dist/popover-DRHbeIVq.js +0 -103
  155. package/dist/progress-CpsskKTD.js +0 -85
  156. package/dist/radio-group-DPI5KUCj.js +0 -136
  157. package/dist/select-C1xGrOhT.js +0 -266
  158. package/dist/skeleton-DitdP-yz.js +0 -49
  159. package/dist/spinner-CFq5HPoo.js +0 -51
  160. package/dist/stack-D_g6NJzo.js +0 -21
  161. package/dist/switch-B5TTU-oJ.js +0 -138
  162. package/dist/tabs-C26PWl2c.js +0 -183
  163. package/dist/theme-root-BRLIA4eb.js +0 -22
  164. package/dist/toast-B1PXuwZ4.js +0 -277
  165. package/dist/toggle-group-N_owicT0.js +0 -156
  166. package/dist/tooltip-BJPisf60.js +0 -98
  167. package/dist/use-overlay-floating-efeqppiw.js +0 -19
@@ -0,0 +1,54 @@
1
+ 'use client';
2
+ import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
3
+ import { n as r } from "./media-D_eA_I-e.js";
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
+ [r]: {
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
+ });
32
+ function l({ ref: e, width: t, height: r, circle: i = !1, radius: o, style: l, className: u, sx: d, ...f }) {
33
+ return /* @__PURE__ */ a(n, {
34
+ className: u,
35
+ styles: [s, i && c],
36
+ sx: d,
37
+ children: (n) => /* @__PURE__ */ a("div", {
38
+ ...f,
39
+ ref: e,
40
+ "aria-hidden": "true",
41
+ "data-ui": "skeleton",
42
+ style: {
43
+ inlineSize: t,
44
+ blockSize: r,
45
+ borderRadius: i ? void 0 : o,
46
+ ...l
47
+ },
48
+ className: n
49
+ })
50
+ });
51
+ }
52
+ l.displayName = "Skeleton";
53
+ //#endregion
54
+ export { l as t };
package/dist/skeleton.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Skeleton } from "./skeleton-DitdP-yz.js";
2
+ export { t as Skeleton } from "./skeleton-OoFlOEXO.js";
@@ -0,0 +1,56 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { n } from "./media-D_eA_I-e.js";
4
+ import { t as r } from "./visually-hidden-BJdvqqvn.js";
5
+ import { n as i, t as a } from "./loading-ring-B8-30Dl1.js";
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
+ ...a,
15
+ flexShrink: 0,
16
+ boxSizing: "border-box",
17
+ [n]: { animation: `${i} 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
+ };
32
+ function f({ ref: e, size: n = "md", label: i = "Loading", className: a, sx: o, ...f }) {
33
+ return /* @__PURE__ */ s(t, {
34
+ className: a,
35
+ styles: l,
36
+ sx: o,
37
+ children: (t) => /* @__PURE__ */ c("span", {
38
+ ...f,
39
+ ref: e,
40
+ role: "status",
41
+ "data-ui": "spinner",
42
+ className: t,
43
+ children: [/* @__PURE__ */ s("span", {
44
+ "aria-hidden": "true",
45
+ "data-ui": "spinner-indicator",
46
+ css: [u, d[n]]
47
+ }), /* @__PURE__ */ s("span", {
48
+ css: r,
49
+ children: i
50
+ })]
51
+ })
52
+ });
53
+ }
54
+ f.displayName = "Spinner";
55
+ //#endregion
56
+ export { f as t };
package/dist/spinner.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Spinner } from "./spinner-CFq5HPoo.js";
2
+ export { t as Spinner } from "./spinner-C2YDoiMn.js";
@@ -0,0 +1,27 @@
1
+ 'use client';
2
+ import { t as e } from "./sx-Dx9JUKp5.js";
3
+ import { t } from "./layout-style-Cbd1Vilw.js";
4
+ import { jsx as n } from "@emotion/react/jsx-runtime";
5
+ //#region src/components/stack/stack.tsx
6
+ function r({ ref: r, gap: i = "md", align: a, justify: o, wrap: s, className: c, sx: l, ...u }) {
7
+ return /* @__PURE__ */ n(e, {
8
+ className: c,
9
+ styles: t({
10
+ direction: "column",
11
+ gap: i,
12
+ align: a,
13
+ justify: o,
14
+ wrap: s
15
+ }),
16
+ sx: l,
17
+ children: (e) => /* @__PURE__ */ n("div", {
18
+ ...u,
19
+ ref: r,
20
+ "data-ui": "stack",
21
+ className: e
22
+ })
23
+ });
24
+ }
25
+ r.displayName = "Stack";
26
+ //#endregion
27
+ export { r as t };
package/dist/stack.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Stack } from "./stack-D_g6NJzo.js";
2
+ export { t as Stack } from "./stack-DC3IbtWk.js";
@@ -0,0 +1,142 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { n } from "./media-D_eA_I-e.js";
4
+ import { t as r } from "./renderable-DzcIj1Lo.js";
5
+ import { i, n as a, r as o, t as s } from "./choice-control-5kJkLXgv.js";
6
+ import { useId as c } from "react";
7
+ import { vars as l } from "@jfrader/tokens/vars";
8
+ import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
9
+ //#region src/components/switch/switch.tsx
10
+ var f = {
11
+ sm: "36px",
12
+ md: "44px"
13
+ }, p = e({
14
+ position: "relative",
15
+ display: "inline-block",
16
+ flexShrink: 0,
17
+ boxSizing: "border-box",
18
+ border: `1px solid ${l.color.borderControl}`,
19
+ borderRadius: l.radius.full,
20
+ backgroundColor: l.color.surfaceHover,
21
+ transitionProperty: "background-color, border-color",
22
+ transitionDuration: l.motion.duration.fast,
23
+ transitionTimingFunction: l.motion.easeStandard,
24
+ "&::after": {
25
+ content: "\"\"",
26
+ position: "absolute",
27
+ insetBlockStart: "2px",
28
+ insetInlineStart: "2px",
29
+ borderRadius: l.radius.full,
30
+ backgroundColor: l.color.text,
31
+ transitionProperty: "transform, background-color",
32
+ transitionDuration: l.motion.duration.fast,
33
+ transitionTimingFunction: l.motion.easeStandard
34
+ },
35
+ [n]: {
36
+ transitionDuration: "0s",
37
+ "&::after": { transitionDuration: "0s" }
38
+ }
39
+ }), m = {
40
+ sm: e({
41
+ inlineSize: f.sm,
42
+ blockSize: "20px",
43
+ "&::after": {
44
+ inlineSize: "14px",
45
+ blockSize: "14px"
46
+ }
47
+ }),
48
+ md: e({
49
+ inlineSize: f.md,
50
+ blockSize: "24px",
51
+ "&::after": {
52
+ inlineSize: "18px",
53
+ blockSize: "18px"
54
+ }
55
+ })
56
+ }, h = {
57
+ sm: e({
58
+ "input:checked + span::after": {
59
+ transform: "translateX(16px)",
60
+ backgroundColor: l.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: l.color.accentContrast
68
+ },
69
+ "&:dir(rtl) input:checked + span::after": { transform: "translateX(-20px)" }
70
+ })
71
+ }, g = {
72
+ sm: e({ fontSize: l.textSize.sm }),
73
+ md: e({ fontSize: l.textSize.md })
74
+ }, _ = e({
75
+ fontSize: l.textSize.sm,
76
+ color: l.color.textMuted
77
+ }), v = {
78
+ sm: e({ marginInlineStart: `calc(${f.sm} + ${l.space[2]})` }),
79
+ md: e({ marginInlineStart: `calc(${f.md} + ${l.space[2]})` })
80
+ };
81
+ function y({ ref: e, label: n, description: l, size: f = "md", onChange: y, onCheckedChange: b, slotProps: x, className: S, sx: C, dir: w, "aria-labelledby": T, "aria-describedby": E, ...D }) {
82
+ let O = c(), k = `${O}-label`, A = `${O}-description`, j = r(n), M = r(l), N = [T, j && k].filter(Boolean).join(" ") || void 0, P = [E, M && A].filter(Boolean).join(" ") || void 0, F = [S, x?.root?.className].filter(Boolean).join(" ") || void 0, I = (e) => {
83
+ y?.(e), b?.(e.currentTarget.checked);
84
+ };
85
+ return /* @__PURE__ */ u(t, {
86
+ className: F,
87
+ styles: [
88
+ o,
89
+ a,
90
+ h[f],
91
+ x?.root?.css
92
+ ],
93
+ sx: C,
94
+ children: (t) => /* @__PURE__ */ d("label", {
95
+ "data-ui": "switch",
96
+ dir: w,
97
+ className: t,
98
+ children: [/* @__PURE__ */ d("span", {
99
+ css: i,
100
+ children: [
101
+ /* @__PURE__ */ u("input", {
102
+ ...D,
103
+ ref: e,
104
+ type: "checkbox",
105
+ role: "switch",
106
+ "aria-labelledby": N,
107
+ "aria-describedby": P,
108
+ onChange: I,
109
+ css: s
110
+ }),
111
+ /* @__PURE__ */ u("span", {
112
+ "aria-hidden": "true",
113
+ className: x?.control?.className,
114
+ css: [
115
+ p,
116
+ m[f],
117
+ x?.control?.css
118
+ ]
119
+ }),
120
+ j && /* @__PURE__ */ u("span", {
121
+ id: k,
122
+ className: x?.label?.className,
123
+ css: [g[f], x?.label?.css],
124
+ children: n
125
+ })
126
+ ]
127
+ }), M && /* @__PURE__ */ u("span", {
128
+ id: A,
129
+ className: x?.description?.className,
130
+ css: [
131
+ _,
132
+ v[f],
133
+ x?.description?.css
134
+ ],
135
+ children: l
136
+ })]
137
+ })
138
+ });
139
+ }
140
+ y.displayName = "Switch";
141
+ //#endregion
142
+ export { y as t };
package/dist/switch.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Switch } from "./switch-B5TTU-oJ.js";
2
+ export { t as Switch } from "./switch-Dr-qjmT4.js";
@@ -0,0 +1,23 @@
1
+ 'use client';
2
+ import { ClassNames as e, ThemeProvider as t, css as n, keyframes as r, useTheme as i } from "@emotion/react";
3
+ import { jsx as a } from "@emotion/react/jsx-runtime";
4
+ //#region src/styling/sx.tsx
5
+ var o = (e) => Array.isArray(e);
6
+ function s(e, t) {
7
+ return typeof e == "function" ? s(e(t), t) : o(e) ? e.map((e) => s(e, t)) : e;
8
+ }
9
+ function c({ className: t, styles: n, children: r }) {
10
+ return /* @__PURE__ */ a(e, { children: ({ css: e, cx: i, theme: a }) => r(n === void 0 ? t : i(e(s(n, a)), t)) });
11
+ }
12
+ function l({ className: e, styles: t, sx: n, children: r }) {
13
+ return /* @__PURE__ */ a(c, {
14
+ styles: n,
15
+ children: (i) => /* @__PURE__ */ a(c, {
16
+ className: n === void 0 ? e : [e, i].filter(Boolean).join(" "),
17
+ styles: t,
18
+ children: r
19
+ })
20
+ });
21
+ }
22
+ //#endregion
23
+ export { i as a, r as i, t as n, n as r, l as t };
@@ -0,0 +1,203 @@
1
+ 'use client';
2
+ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
+ import { n, t as r } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as i } from "./media-D_eA_I-e.js";
5
+ import { n as a, r as o, t as s } from "./roving-focus-CYlo_Kf8.js";
6
+ import { t as c } from "./use-controlled-state-CVXDa-qM.js";
7
+ import { t as l } from "./part-id-D0zksy32.js";
8
+ import { createContext as u, useContext as d, useEffect as f, useId as p, useImperativeHandle as m, useMemo as h, useRef as g, useState as _ } from "react";
9
+ import { vars as v } from "@jfrader/tokens/vars";
10
+ import { jsx as y } from "@emotion/react/jsx-runtime";
11
+ //#region src/components/tabs/tabs.tsx
12
+ var b = u(null);
13
+ function x(e) {
14
+ let t = d(b);
15
+ if (!t) throw Error(`Tabs.${e} must be rendered inside <Tabs>.`);
16
+ return t;
17
+ }
18
+ var S = {
19
+ itemSelector: "[role=\"tab\"]:not([disabled])",
20
+ ownerSelector: "[role=\"tablist\"]"
21
+ }, C = e({ "&[data-orientation=\"vertical\"]": {
22
+ display: "flex",
23
+ alignItems: "flex-start",
24
+ gap: v.space[4]
25
+ } }), w = {
26
+ horizontal: e({
27
+ display: "inline-flex",
28
+ gap: v.space[1],
29
+ borderBlockEnd: `1px solid ${v.color.border}`
30
+ }),
31
+ vertical: e({
32
+ display: "inline-flex",
33
+ flexDirection: "column",
34
+ alignItems: "stretch",
35
+ borderInlineEnd: `1px solid ${v.color.border}`
36
+ })
37
+ }, T = e({
38
+ appearance: "none",
39
+ border: 0,
40
+ background: "transparent",
41
+ cursor: "pointer",
42
+ paddingBlock: v.space[2],
43
+ paddingInline: v.space[3],
44
+ font: "inherit",
45
+ fontSize: v.textSize.sm,
46
+ fontWeight: v.fontWeight.medium,
47
+ color: v.color.textMuted,
48
+ transitionProperty: "color, border-color",
49
+ transitionDuration: v.motion.duration.fast,
50
+ transitionTimingFunction: v.motion.easeStandard,
51
+ "&:hover:not(:disabled):not([aria-selected=\"true\"])": { color: v.color.text },
52
+ "&[aria-selected=\"true\"]": {
53
+ color: v.color.text,
54
+ borderColor: v.color.accent
55
+ },
56
+ "&:disabled": {
57
+ opacity: .55,
58
+ cursor: "not-allowed"
59
+ },
60
+ "&:focus-visible": { ...r },
61
+ [i]: { transitionDuration: "0s" }
62
+ }), E = {
63
+ horizontal: e({
64
+ borderBlockEnd: "2px solid transparent",
65
+ marginBlockEnd: "-1px"
66
+ }),
67
+ vertical: e({
68
+ borderInlineEnd: "2px solid transparent",
69
+ marginInlineEnd: "-1px",
70
+ textAlign: "start"
71
+ })
72
+ }, D = e({
73
+ color: v.color.text,
74
+ outline: "none",
75
+ "&:focus-visible": { ...n },
76
+ "&[hidden]": { display: "none" }
77
+ }), O = e({ paddingBlockStart: v.space[3] });
78
+ function k({ ref: e, value: n, defaultValue: r, onValueChange: i, orientation: a = "horizontal", activation: o = "auto", className: s, sx: l, ...u }) {
79
+ let d = p(), [f, m] = c(n, r, i), [g, v] = _(null), x = h(() => ({
80
+ value: f,
81
+ setValue: m,
82
+ focused: g,
83
+ setFocused: v,
84
+ orientation: a,
85
+ activation: o,
86
+ baseId: d
87
+ }), [
88
+ f,
89
+ m,
90
+ g,
91
+ a,
92
+ o,
93
+ d
94
+ ]);
95
+ return /* @__PURE__ */ y(b.Provider, {
96
+ value: x,
97
+ children: /* @__PURE__ */ y(t, {
98
+ className: s,
99
+ styles: C,
100
+ sx: l,
101
+ children: (t) => /* @__PURE__ */ y("div", {
102
+ ...u,
103
+ ref: e,
104
+ "data-ui": "tabs-root",
105
+ "data-orientation": a,
106
+ className: t
107
+ })
108
+ })
109
+ });
110
+ }
111
+ k.displayName = "Tabs";
112
+ function A({ ref: e, onKeyDown: n, className: r, sx: i, ...c }) {
113
+ let { orientation: l, value: u, focused: d, setFocused: p } = x("List"), h = g(null);
114
+ m(e, () => h.current, []), f(() => {
115
+ let e = h.current;
116
+ if (!e) return;
117
+ let t = o(e, S);
118
+ t.length !== 0 && (t.some((e) => e.tabIndex === 0) || p((s(t, u) ?? s(t, d) ?? t[0])?.dataset.value ?? null));
119
+ });
120
+ let _ = (e) => {
121
+ n?.(e);
122
+ let t = h.current;
123
+ !e.defaultPrevented && t && a(e, t, l, S);
124
+ };
125
+ return /* @__PURE__ */ y(t, {
126
+ className: r,
127
+ styles: w[l],
128
+ sx: i,
129
+ children: (e) => /* @__PURE__ */ y("div", {
130
+ ...c,
131
+ ref: h,
132
+ role: "tablist",
133
+ "aria-orientation": l,
134
+ "data-ui": "tabs-list",
135
+ "data-orientation": l,
136
+ "data-roving": d ?? "",
137
+ "data-selected": u ?? "",
138
+ onKeyDown: _,
139
+ className: e
140
+ })
141
+ });
142
+ }
143
+ A.displayName = "Tabs.List";
144
+ function j({ ref: e, value: n, disabled: r, onClick: i, onFocus: a, className: o, sx: s, ...c }) {
145
+ let { value: u, setValue: d, focused: f, setFocused: p, activation: m, baseId: h, orientation: _ } = x("Tab"), v = u === n, b = !r && (f === null ? v : f === n), S = g(!1), C = (e) => {
146
+ if (i?.(e), e.defaultPrevented) return;
147
+ let t = S.current;
148
+ S.current = !1, !(m === "auto" && t) && d(n);
149
+ }, w = (e) => {
150
+ a?.(e), !e.defaultPrevented && (S.current = !0, p(n), m === "auto" && d(n));
151
+ };
152
+ return /* @__PURE__ */ y(t, {
153
+ className: o,
154
+ styles: [T, E[_]],
155
+ sx: s,
156
+ children: (t) => /* @__PURE__ */ y("button", {
157
+ ...c,
158
+ ref: e,
159
+ type: "button",
160
+ role: "tab",
161
+ id: l(h, "tab", n),
162
+ "data-ui": "tabs-tab",
163
+ "data-value": n,
164
+ "data-state": v ? "active" : "inactive",
165
+ "aria-selected": v,
166
+ "aria-controls": l(h, "panel", n),
167
+ tabIndex: b ? 0 : -1,
168
+ disabled: r,
169
+ onClick: C,
170
+ onFocus: w,
171
+ className: t
172
+ })
173
+ });
174
+ }
175
+ j.displayName = "Tabs.Tab";
176
+ function M({ ref: e, value: n, tabIndex: r = 0, "aria-labelledby": i, className: a, sx: o, ...s }) {
177
+ let { value: c, baseId: u, orientation: d } = x("Panel"), f = c === n, p = [i, l(u, "tab", n)].filter(Boolean).join(" ") || void 0;
178
+ return /* @__PURE__ */ y(t, {
179
+ className: a,
180
+ styles: [D, d === "horizontal" && O],
181
+ sx: o,
182
+ children: (t) => /* @__PURE__ */ y("div", {
183
+ ...s,
184
+ ref: e,
185
+ role: "tabpanel",
186
+ id: l(u, "panel", n),
187
+ "aria-labelledby": p,
188
+ tabIndex: r,
189
+ hidden: !f,
190
+ "data-ui": "tabs-panel",
191
+ "data-state": f ? "active" : "inactive",
192
+ className: t
193
+ })
194
+ });
195
+ }
196
+ M.displayName = "Tabs.Panel";
197
+ var N = Object.assign(k, {
198
+ List: A,
199
+ Tab: j,
200
+ Panel: M
201
+ });
202
+ //#endregion
203
+ export { N as t };
package/dist/tabs.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Tabs } from "./tabs-C26PWl2c.js";
2
+ export { t as Tabs } from "./tabs-CK_g1RKa.js";
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-BzGw1Ch9.js";
2
+ import { r as e } from "./sx-Dx9JUKp5.js";
3
+ import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-D2ToMeRa.js";
4
4
  import { vars as s } from "@jfrader/tokens/vars";
5
5
  import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
6
6
  //#region src/components/text-field/text-field.tsx
@@ -21,35 +21,36 @@ var u = {
21
21
  fontSize: s.textSize.md
22
22
  })
23
23
  };
24
- function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChange: m, onValueChange: h, slotProps: g, className: _, required: v, id: y, "aria-describedby": b, "aria-invalid": x, ...S }) {
25
- let C = t({
26
- id: y,
24
+ function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChange: m, onValueChange: h, slotProps: g, className: _, sx: v, required: y, id: b, "aria-describedby": x, "aria-invalid": S, ...C }) {
25
+ let w = t({
26
+ id: b,
27
27
  description: d,
28
28
  error: f,
29
- "aria-describedby": b,
30
- "aria-invalid": x
31
- }), w = (e) => {
29
+ "aria-describedby": x,
30
+ "aria-invalid": S
31
+ }), T = (e) => {
32
32
  m?.(e), h?.(e.currentTarget.value);
33
33
  };
34
34
  return /* @__PURE__ */ l(n, {
35
35
  "data-ui": "text-field",
36
36
  className: _,
37
+ sx: v,
37
38
  part: g?.root,
38
39
  children: [
39
40
  /* @__PURE__ */ c(a, {
40
- htmlFor: C.id,
41
- required: v,
41
+ htmlFor: w.id,
42
+ required: y,
42
43
  part: g?.label,
43
44
  children: s
44
45
  }),
45
46
  /* @__PURE__ */ c("input", {
46
- ...S,
47
+ ...C,
47
48
  ref: e,
48
- id: C.id,
49
- required: v,
50
- "aria-describedby": C.describedBy,
51
- "aria-invalid": C.ariaInvalid,
52
- onChange: w,
49
+ id: w.id,
50
+ required: y,
51
+ "aria-describedby": w.describedBy,
52
+ "aria-invalid": w.ariaInvalid,
53
+ onChange: T,
53
54
  className: g?.control?.className,
54
55
  css: [
55
56
  i,
@@ -58,12 +59,12 @@ function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChang
58
59
  ]
59
60
  }),
60
61
  /* @__PURE__ */ c(o, {
61
- id: C.descriptionId,
62
+ id: w.descriptionId,
62
63
  part: g?.description,
63
64
  children: d
64
65
  }),
65
66
  /* @__PURE__ */ c(r, {
66
- id: C.errorId,
67
+ id: w.errorId,
67
68
  part: g?.error,
68
69
  children: f
69
70
  })
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as TextField } from "./text-field-8PQAqRpM.js";
2
+ export { t as TextField } from "./text-field-D60ok14S.js";
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { t as e } from "./css-Cgj6sCHn.js";
3
- import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-BzGw1Ch9.js";
2
+ import { r as e } from "./sx-Dx9JUKp5.js";
3
+ import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-D2ToMeRa.js";
4
4
  import { vars as s } from "@jfrader/tokens/vars";
5
5
  import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
6
6
  //#region src/components/textarea/textarea.tsx
@@ -27,36 +27,37 @@ var u = e({
27
27
  none: e({ resize: "none" }),
28
28
  vertical: e({ resize: "vertical" })
29
29
  }, p = e({ fieldSizing: "content" });
30
- function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize: _ = "vertical", autoResize: v = !1, rows: y = 3, onChange: b, onValueChange: x, slotProps: S, className: C, required: w, id: T, "aria-describedby": E, "aria-invalid": D, ...O }) {
31
- let k = t({
32
- id: T,
30
+ function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize: _ = "vertical", autoResize: v = !1, rows: y = 3, onChange: b, onValueChange: x, slotProps: S, className: C, sx: w, required: T, id: E, "aria-describedby": D, "aria-invalid": O, ...k }) {
31
+ let A = t({
32
+ id: E,
33
33
  description: m,
34
34
  error: h,
35
- "aria-describedby": E,
36
- "aria-invalid": D
37
- }), A = (e) => {
35
+ "aria-describedby": D,
36
+ "aria-invalid": O
37
+ }), j = (e) => {
38
38
  b?.(e), x?.(e.currentTarget.value);
39
39
  };
40
40
  return /* @__PURE__ */ l(n, {
41
41
  "data-ui": "textarea",
42
42
  className: C,
43
+ sx: w,
43
44
  part: S?.root,
44
45
  children: [
45
46
  /* @__PURE__ */ c(a, {
46
- htmlFor: k.id,
47
- required: w,
47
+ htmlFor: A.id,
48
+ required: T,
48
49
  part: S?.label,
49
50
  children: s
50
51
  }),
51
52
  /* @__PURE__ */ c("textarea", {
52
- ...O,
53
+ ...k,
53
54
  ref: e,
54
- id: k.id,
55
+ id: A.id,
55
56
  rows: y,
56
- required: w,
57
- "aria-describedby": k.describedBy,
58
- "aria-invalid": k.ariaInvalid,
59
- onChange: A,
57
+ required: T,
58
+ "aria-describedby": A.describedBy,
59
+ "aria-invalid": A.ariaInvalid,
60
+ onChange: j,
60
61
  className: S?.control?.className,
61
62
  css: [
62
63
  i,
@@ -68,12 +69,12 @@ function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize:
68
69
  ]
69
70
  }),
70
71
  /* @__PURE__ */ c(o, {
71
- id: k.descriptionId,
72
+ id: A.descriptionId,
72
73
  part: S?.description,
73
74
  children: m
74
75
  }),
75
76
  /* @__PURE__ */ c(r, {
76
- id: k.errorId,
77
+ id: A.errorId,
77
78
  part: S?.error,
78
79
  children: h
79
80
  })