@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
package/dist/skeleton.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Skeleton } from "./skeleton-gJ4ImO5u.js";
2
+ export { t as Skeleton } from "./skeleton-DitdP-yz.js";
@@ -3,48 +3,49 @@ import { t as e } from "./css-Cgj6sCHn.js";
3
3
  import { n as t } from "./media-D_eA_I-e.js";
4
4
  import { t as n } from "./visually-hidden-DCWhf0Cb.js";
5
5
  import { n as r, t as i } from "./loading-ring-BpdB0aFi.js";
6
- import { forwardRef as a } from "react";
7
- import { vars as o } from "@jfrader/tokens/vars";
8
- import { jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
6
+ import { vars as a } from "@jfrader/tokens/vars";
7
+ import { jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
9
8
  //#region src/components/spinner/spinner.tsx
10
- var l = e({
9
+ var c = e({
11
10
  position: "relative",
12
11
  display: "inline-flex",
13
12
  verticalAlign: "middle"
14
- }), u = e({
13
+ }), l = e({
15
14
  ...i,
16
15
  flexShrink: 0,
17
16
  boxSizing: "border-box",
18
17
  [t]: { animation: `${r} 1.6s ease-in-out infinite alternate` }
19
- }), d = {
18
+ }), u = {
20
19
  sm: e({
21
- inlineSize: o.space[4],
22
- blockSize: o.space[4]
20
+ inlineSize: a.space[4],
21
+ blockSize: a.space[4]
23
22
  }),
24
23
  md: e({
25
- inlineSize: o.space[5],
26
- blockSize: o.space[5]
24
+ inlineSize: a.space[5],
25
+ blockSize: a.space[5]
27
26
  }),
28
27
  lg: e({
29
- inlineSize: o.space[6],
30
- blockSize: o.space[6]
28
+ inlineSize: a.space[6],
29
+ blockSize: a.space[6]
31
30
  })
32
- }, f = a(function({ size: e = "md", label: t = "Loading", ...r }, i) {
33
- return /* @__PURE__ */ c("span", {
34
- ...r,
35
- ref: i,
31
+ };
32
+ function d({ ref: e, size: t = "md", label: r = "Loading", ...i }) {
33
+ return /* @__PURE__ */ s("span", {
34
+ ...i,
35
+ ref: e,
36
36
  role: "status",
37
37
  "data-ui": "spinner",
38
- css: l,
39
- children: [/* @__PURE__ */ s("span", {
38
+ css: c,
39
+ children: [/* @__PURE__ */ o("span", {
40
40
  "aria-hidden": "true",
41
41
  "data-ui": "spinner-indicator",
42
- css: [u, d[e]]
43
- }), /* @__PURE__ */ s("span", {
42
+ css: [l, u[t]]
43
+ }), /* @__PURE__ */ o("span", {
44
44
  css: n,
45
- children: t
45
+ children: r
46
46
  })]
47
47
  });
48
- });
48
+ }
49
+ d.displayName = "Spinner";
49
50
  //#endregion
50
- export { f as t };
51
+ export { d as t };
package/dist/spinner.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Spinner } from "./spinner-CSFiP0Oi.js";
2
+ export { t as Spinner } from "./spinner-CFq5HPoo.js";
@@ -0,0 +1,21 @@
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 };
package/dist/stack.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Stack } from "./stack-mEAryjKz.js";
2
+ export { t as Stack } from "./stack-D_g6NJzo.js";
@@ -0,0 +1,138 @@
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 };
package/dist/switch.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Switch } from "./switch-2hm2WnWt.js";
2
+ export { t as Switch } from "./switch-B5TTU-oJ.js";
@@ -0,0 +1,183 @@
1
+ 'use client';
2
+ import { t as e } from "./css-Cgj6sCHn.js";
3
+ import { n as t, t as n } from "./focus-ring-BK5W5_NY.js";
4
+ import { n as r } from "./media-D_eA_I-e.js";
5
+ import { n as i, r as a, t as o } from "./roving-focus-CYlo_Kf8.js";
6
+ import { t as s } from "./use-controlled-state-CVXDa-qM.js";
7
+ import { t as c } from "./part-id-D0zksy32.js";
8
+ import { createContext as l, useContext as u, useEffect as d, useId as f, useImperativeHandle as p, useMemo as m, useRef as h, useState as g } from "react";
9
+ import { vars as _ } from "@jfrader/tokens/vars";
10
+ import { jsx as v } from "@emotion/react/jsx-runtime";
11
+ //#region src/components/tabs/tabs.tsx
12
+ var y = l(null);
13
+ function b(e) {
14
+ let t = u(y);
15
+ if (!t) throw Error(`Tabs.${e} must be rendered inside <Tabs>.`);
16
+ return t;
17
+ }
18
+ var x = {
19
+ itemSelector: "[role=\"tab\"]:not([disabled])",
20
+ ownerSelector: "[role=\"tablist\"]"
21
+ }, S = e({ "&[data-orientation=\"vertical\"]": {
22
+ display: "flex",
23
+ alignItems: "flex-start",
24
+ gap: _.space[4]
25
+ } }), C = {
26
+ horizontal: e({
27
+ display: "inline-flex",
28
+ gap: _.space[1],
29
+ borderBlockEnd: `1px solid ${_.color.border}`
30
+ }),
31
+ vertical: e({
32
+ display: "inline-flex",
33
+ flexDirection: "column",
34
+ alignItems: "stretch",
35
+ borderInlineEnd: `1px solid ${_.color.border}`
36
+ })
37
+ }, w = e({
38
+ appearance: "none",
39
+ border: 0,
40
+ background: "transparent",
41
+ cursor: "pointer",
42
+ paddingBlock: _.space[2],
43
+ paddingInline: _.space[3],
44
+ font: "inherit",
45
+ fontSize: _.textSize.sm,
46
+ fontWeight: _.fontWeight.medium,
47
+ color: _.color.textMuted,
48
+ transitionProperty: "color, border-color",
49
+ transitionDuration: _.motion.duration.fast,
50
+ transitionTimingFunction: _.motion.easeStandard,
51
+ "&:hover:not(:disabled):not([aria-selected=\"true\"])": { color: _.color.text },
52
+ "&[aria-selected=\"true\"]": {
53
+ color: _.color.text,
54
+ borderColor: _.color.accent
55
+ },
56
+ "&:disabled": {
57
+ opacity: .55,
58
+ cursor: "not-allowed"
59
+ },
60
+ "&:focus-visible": { ...n },
61
+ [r]: { transitionDuration: "0s" }
62
+ }), T = {
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
+ }, E = e({
73
+ color: _.color.text,
74
+ outline: "none",
75
+ "&:focus-visible": { ...t },
76
+ "&[hidden]": { display: "none" }
77
+ }), D = e({ paddingBlockStart: _.space[3] });
78
+ function O({ ref: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", activation: a = "auto", ...o }) {
79
+ let c = f(), [l, u] = s(t, n, r), [d, p] = g(null), h = m(() => ({
80
+ value: l,
81
+ setValue: u,
82
+ focused: d,
83
+ setFocused: p,
84
+ orientation: i,
85
+ activation: a,
86
+ baseId: c
87
+ }), [
88
+ l,
89
+ u,
90
+ d,
91
+ i,
92
+ a,
93
+ c
94
+ ]);
95
+ return /* @__PURE__ */ v(y.Provider, {
96
+ value: h,
97
+ children: /* @__PURE__ */ v("div", {
98
+ ...o,
99
+ ref: e,
100
+ "data-ui": "tabs-root",
101
+ "data-orientation": i,
102
+ css: S
103
+ })
104
+ });
105
+ }
106
+ O.displayName = "Tabs";
107
+ function k({ ref: e, onKeyDown: t, ...n }) {
108
+ let { orientation: r, value: s, focused: c, setFocused: l } = b("List"), u = h(null);
109
+ p(e, () => u.current, []), d(() => {
110
+ let e = u.current;
111
+ if (!e) return;
112
+ let t = a(e, x);
113
+ t.length !== 0 && (t.some((e) => e.tabIndex === 0) || l((o(t, s) ?? o(t, c) ?? t[0])?.dataset.value ?? null));
114
+ });
115
+ let f = (e) => {
116
+ t?.(e);
117
+ let n = u.current;
118
+ !e.defaultPrevented && n && i(e, n, r, x);
119
+ };
120
+ return /* @__PURE__ */ v("div", {
121
+ ...n,
122
+ ref: u,
123
+ role: "tablist",
124
+ "aria-orientation": r,
125
+ "data-ui": "tabs-list",
126
+ "data-orientation": r,
127
+ "data-roving": c ?? "",
128
+ "data-selected": s ?? "",
129
+ onKeyDown: f,
130
+ css: C[r]
131
+ });
132
+ }
133
+ k.displayName = "Tabs.List";
134
+ function A({ ref: e, value: t, disabled: n, onClick: r, onFocus: i, ...a }) {
135
+ let { value: o, setValue: s, focused: l, setFocused: u, activation: d, baseId: f, orientation: p } = b("Tab"), m = o === t, g = !n && (l === null ? m : l === t), _ = h(!1), y = (e) => {
136
+ if (r?.(e), e.defaultPrevented) return;
137
+ let n = _.current;
138
+ _.current = !1, !(d === "auto" && n) && s(t);
139
+ }, x = (e) => {
140
+ i?.(e), !e.defaultPrevented && (_.current = !0, u(t), d === "auto" && s(t));
141
+ };
142
+ return /* @__PURE__ */ v("button", {
143
+ ...a,
144
+ ref: e,
145
+ type: "button",
146
+ role: "tab",
147
+ id: c(f, "tab", t),
148
+ "data-ui": "tabs-tab",
149
+ "data-value": t,
150
+ "data-state": m ? "active" : "inactive",
151
+ "aria-selected": m,
152
+ "aria-controls": c(f, "panel", t),
153
+ tabIndex: g ? 0 : -1,
154
+ disabled: n,
155
+ onClick: y,
156
+ onFocus: x,
157
+ css: [w, T[p]]
158
+ });
159
+ }
160
+ A.displayName = "Tabs.Tab";
161
+ function j({ ref: e, value: t, tabIndex: n = 0, "aria-labelledby": r, ...i }) {
162
+ let { value: a, baseId: o, orientation: s } = b("Panel"), l = a === t, u = [r, c(o, "tab", t)].filter(Boolean).join(" ") || void 0;
163
+ return /* @__PURE__ */ v("div", {
164
+ ...i,
165
+ ref: e,
166
+ role: "tabpanel",
167
+ id: c(o, "panel", t),
168
+ "aria-labelledby": u,
169
+ tabIndex: n,
170
+ hidden: !l,
171
+ "data-ui": "tabs-panel",
172
+ "data-state": l ? "active" : "inactive",
173
+ css: [E, s === "horizontal" && D]
174
+ });
175
+ }
176
+ j.displayName = "Tabs.Panel";
177
+ var M = Object.assign(O, {
178
+ List: k,
179
+ Tab: A,
180
+ Panel: j
181
+ });
182
+ //#endregion
183
+ export { M as t };
package/dist/tabs.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Tabs } from "./tabs-GBppQabg.js";
2
+ export { t as Tabs } from "./tabs-C26PWl2c.js";
@@ -0,0 +1,75 @@
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";
4
+ import { vars as s } from "@jfrader/tokens/vars";
5
+ import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
6
+ //#region src/components/text-field/text-field.tsx
7
+ var u = {
8
+ sm: e({
9
+ blockSize: "32px",
10
+ paddingInline: s.space[3],
11
+ fontSize: s.textSize.sm
12
+ }),
13
+ md: e({
14
+ blockSize: "40px",
15
+ paddingInline: s.space[4],
16
+ fontSize: s.textSize.sm
17
+ }),
18
+ lg: e({
19
+ blockSize: "48px",
20
+ paddingInline: s.space[4],
21
+ fontSize: s.textSize.md
22
+ })
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,
27
+ description: d,
28
+ error: f,
29
+ "aria-describedby": b,
30
+ "aria-invalid": x
31
+ }), w = (e) => {
32
+ m?.(e), h?.(e.currentTarget.value);
33
+ };
34
+ return /* @__PURE__ */ l(n, {
35
+ "data-ui": "text-field",
36
+ className: _,
37
+ part: g?.root,
38
+ children: [
39
+ /* @__PURE__ */ c(a, {
40
+ htmlFor: C.id,
41
+ required: v,
42
+ part: g?.label,
43
+ children: s
44
+ }),
45
+ /* @__PURE__ */ c("input", {
46
+ ...S,
47
+ ref: e,
48
+ id: C.id,
49
+ required: v,
50
+ "aria-describedby": C.describedBy,
51
+ "aria-invalid": C.ariaInvalid,
52
+ onChange: w,
53
+ className: g?.control?.className,
54
+ css: [
55
+ i,
56
+ u[p],
57
+ g?.control?.css
58
+ ]
59
+ }),
60
+ /* @__PURE__ */ c(o, {
61
+ id: C.descriptionId,
62
+ part: g?.description,
63
+ children: d
64
+ }),
65
+ /* @__PURE__ */ c(r, {
66
+ id: C.errorId,
67
+ part: g?.error,
68
+ children: f
69
+ })
70
+ ]
71
+ });
72
+ }
73
+ d.displayName = "TextField";
74
+ //#endregion
75
+ export { d as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as TextField } from "./text-field-DDPqQu29.js";
2
+ export { t as TextField } from "./text-field-8PQAqRpM.js";
@@ -0,0 +1,85 @@
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";
4
+ import { vars as s } from "@jfrader/tokens/vars";
5
+ import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
6
+ //#region src/components/textarea/textarea.tsx
7
+ var u = e({
8
+ paddingBlock: s.space[2],
9
+ lineHeight: s.lineHeight.base
10
+ }), d = {
11
+ sm: e({
12
+ minBlockSize: "64px",
13
+ paddingInline: s.space[3],
14
+ fontSize: s.textSize.sm
15
+ }),
16
+ md: e({
17
+ minBlockSize: "80px",
18
+ paddingInline: s.space[4],
19
+ fontSize: s.textSize.sm
20
+ }),
21
+ lg: e({
22
+ minBlockSize: "96px",
23
+ paddingInline: s.space[4],
24
+ fontSize: s.textSize.md
25
+ })
26
+ }, f = {
27
+ none: e({ resize: "none" }),
28
+ vertical: e({ resize: "vertical" })
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,
33
+ description: m,
34
+ error: h,
35
+ "aria-describedby": E,
36
+ "aria-invalid": D
37
+ }), A = (e) => {
38
+ b?.(e), x?.(e.currentTarget.value);
39
+ };
40
+ return /* @__PURE__ */ l(n, {
41
+ "data-ui": "textarea",
42
+ className: C,
43
+ part: S?.root,
44
+ children: [
45
+ /* @__PURE__ */ c(a, {
46
+ htmlFor: k.id,
47
+ required: w,
48
+ part: S?.label,
49
+ children: s
50
+ }),
51
+ /* @__PURE__ */ c("textarea", {
52
+ ...O,
53
+ ref: e,
54
+ id: k.id,
55
+ rows: y,
56
+ required: w,
57
+ "aria-describedby": k.describedBy,
58
+ "aria-invalid": k.ariaInvalid,
59
+ onChange: A,
60
+ className: S?.control?.className,
61
+ css: [
62
+ i,
63
+ u,
64
+ d[g],
65
+ f[_],
66
+ v && p,
67
+ S?.control?.css
68
+ ]
69
+ }),
70
+ /* @__PURE__ */ c(o, {
71
+ id: k.descriptionId,
72
+ part: S?.description,
73
+ children: m
74
+ }),
75
+ /* @__PURE__ */ c(r, {
76
+ id: k.errorId,
77
+ part: S?.error,
78
+ children: h
79
+ })
80
+ ]
81
+ });
82
+ }
83
+ m.displayName = "Textarea";
84
+ //#endregion
85
+ export { m as t };
package/dist/textarea.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Textarea } from "./textarea-OP8_3IUR.js";
2
+ export { t as Textarea } from "./textarea-CcGWuntL.js";
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+ import { t as e } from "./css-Cgj6sCHn.js";
3
+ import { vars as t } from "@jfrader/tokens/vars";
4
+ import { jsx as n } from "@emotion/react/jsx-runtime";
5
+ //#region src/components/theme-root/theme-root.tsx
6
+ var r = e({
7
+ color: t.color.text,
8
+ colorScheme: "dark",
9
+ "&[data-theme=\"light\"]": { colorScheme: "light" }
10
+ });
11
+ function i({ ref: e, theme: t, ...i }) {
12
+ return /* @__PURE__ */ n("div", {
13
+ "data-ui": "theme-root",
14
+ "data-theme": t ?? "dark",
15
+ ...i,
16
+ ref: e,
17
+ css: r
18
+ });
19
+ }
20
+ i.displayName = "ThemeRoot";
21
+ //#endregion
22
+ export { i as t };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as ThemeRoot } from "./theme-root-eLka0ZP1.js";
2
+ export { t as ThemeRoot } from "./theme-root-BRLIA4eb.js";