@jfrader/ui 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/README.md +3 -1
  2. package/dist/accordion-CkOZ-tvs.js +178 -0
  3. package/dist/accordion.js +2 -1
  4. package/dist/alert-Dsjx14UW.js +131 -0
  5. package/dist/alert.js +2 -1
  6. package/dist/avatar-BRGKkoSr.js +127 -0
  7. package/dist/avatar.js +2 -1
  8. package/dist/badge-DLxUMsCx.js +104 -0
  9. package/dist/badge.js +2 -1
  10. package/dist/breadcrumbs-694hF_hm.js +131 -0
  11. package/dist/breadcrumbs.js +2 -1
  12. package/dist/button-CoaIcykB.js +190 -0
  13. package/dist/button.js +2 -1
  14. package/dist/calendar-Doj7PTdG.js +379 -0
  15. package/dist/calendar.js +2 -1
  16. package/dist/card-2IM71XZj.js +134 -0
  17. package/dist/card.js +2 -1
  18. package/dist/checkbox-B7xGNFzp.js +136 -0
  19. package/dist/checkbox.js +2 -1
  20. package/dist/{choice-control-DCyQ_hVw.js → choice-control-ByFogYcT.js} +2 -1
  21. package/dist/{collection-registry-C2jnQa7X.js → collection-registry-1l9f3XJZ.js} +3 -2
  22. package/dist/combobox-Bjhxv5U3.js +311 -0
  23. package/dist/combobox.js +2 -1
  24. package/dist/command-palette-BhJwm6cS.js +344 -0
  25. package/dist/command-palette.js +2 -1
  26. package/dist/container-BhnrGPu-.js +36 -0
  27. package/dist/container.js +2 -1
  28. package/dist/{css-CW_HG55W.js → css-Cgj6sCHn.js} +1 -0
  29. package/dist/date-picker-Jk8SpoiO.js +245 -0
  30. package/dist/date-picker.js +2 -1
  31. package/dist/dialog-fhS07G41.js +187 -0
  32. package/dist/dialog.js +2 -1
  33. package/dist/{disclosure-caret-BC6P8AsM.js → disclosure-caret-C5T3fcl6.js} +1 -0
  34. package/dist/divider-v_78HYF5.js +79 -0
  35. package/dist/divider.js +2 -1
  36. package/dist/{field-anatomy-DKkB268x.js → field-anatomy-BzGw1Ch9.js} +4 -3
  37. package/dist/flex-COZzFqI8.js +22 -0
  38. package/dist/flex.js +2 -1
  39. package/dist/{focus-ring-qOS3rPlM.js → focus-ring-BK5W5_NY.js} +1 -0
  40. package/dist/{icon-wrapper-BKo4FI-O.js → icon-wrapper-CFWzew5m.js} +2 -1
  41. package/dist/index.js +37 -36
  42. package/dist/kbd-CeP8Kfvp.js +61 -0
  43. package/dist/kbd.js +2 -1
  44. package/dist/{layout-style-B_6YHQ6Q.js → layout-style-7ZTOiWGR.js} +2 -1
  45. package/dist/{loading-ring-CTpT-IrT.js → loading-ring-BpdB0aFi.js} +2 -1
  46. package/dist/{media-8K3xDAxM.js → media-D_eA_I-e.js} +1 -0
  47. package/dist/menu-B6KCbLCr.js +196 -0
  48. package/dist/menu.js +2 -1
  49. package/dist/navigation-BDht6S2-.js +182 -0
  50. package/dist/navigation.js +2 -1
  51. package/dist/pagination-B50PCaDU.js +151 -0
  52. package/dist/pagination.js +2 -1
  53. package/dist/{part-id-Bg1LSlk7.js → part-id-D0zksy32.js} +1 -0
  54. package/dist/pill-2_XzBdkD.js +51 -0
  55. package/dist/pill.js +2 -1
  56. package/dist/popover-DRHbeIVq.js +103 -0
  57. package/dist/popover.js +2 -1
  58. package/dist/progress-CpsskKTD.js +85 -0
  59. package/dist/progress.js +2 -1
  60. package/dist/radio-group-DPI5KUCj.js +136 -0
  61. package/dist/radio-group.js +2 -1
  62. package/dist/{renderable-DwPvt1I8.js → renderable-DzcIj1Lo.js} +1 -0
  63. package/dist/{roving-focus-DeEZ55-T.js → roving-focus-CYlo_Kf8.js} +1 -0
  64. package/dist/select-C1xGrOhT.js +266 -0
  65. package/dist/select.js +2 -1
  66. package/dist/skeleton-DitdP-yz.js +49 -0
  67. package/dist/skeleton.js +2 -1
  68. package/dist/spinner-CFq5HPoo.js +51 -0
  69. package/dist/spinner.js +2 -1
  70. package/dist/stack-D_g6NJzo.js +21 -0
  71. package/dist/stack.js +2 -1
  72. package/dist/{surface-Bo_aSQOb.js → surface-DZ4d-2aL.js} +1 -0
  73. package/dist/switch-B5TTU-oJ.js +138 -0
  74. package/dist/switch.js +2 -1
  75. package/dist/tabs-C26PWl2c.js +183 -0
  76. package/dist/tabs.js +2 -1
  77. package/dist/text-field-8PQAqRpM.js +75 -0
  78. package/dist/text-field.js +2 -1
  79. package/dist/textarea-CcGWuntL.js +85 -0
  80. package/dist/textarea.js +2 -1
  81. package/dist/theme-root-BRLIA4eb.js +22 -0
  82. package/dist/theme-root.js +2 -1
  83. package/dist/toast-B1PXuwZ4.js +277 -0
  84. package/dist/toast.js +2 -1
  85. package/dist/toggle-group-N_owicT0.js +156 -0
  86. package/dist/toggle-group.js +2 -1
  87. package/dist/tooltip-BJPisf60.js +98 -0
  88. package/dist/tooltip.js +2 -1
  89. package/dist/{trigger-style-f54idgjT.js → trigger-style-B1GFmH7M.js} +2 -1
  90. package/dist/types/components/accordion/accordion.d.ts +13 -9
  91. package/dist/types/components/alert/alert.d.ts +6 -3
  92. package/dist/types/components/avatar/avatar.d.ts +6 -3
  93. package/dist/types/components/badge/badge.d.ts +6 -3
  94. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +8 -5
  95. package/dist/types/components/button/button.d.ts +6 -3
  96. package/dist/types/components/calendar/calendar.d.ts +11 -7
  97. package/dist/types/components/card/card.d.ts +20 -13
  98. package/dist/types/components/checkbox/checkbox.d.ts +6 -3
  99. package/dist/types/components/combobox/combobox.d.ts +12 -8
  100. package/dist/types/components/command-palette/command-palette.d.ts +22 -15
  101. package/dist/types/components/container/container.d.ts +6 -3
  102. package/dist/types/components/date-picker/date-picker.d.ts +6 -4
  103. package/dist/types/components/dialog/dialog.d.ts +16 -11
  104. package/dist/types/components/divider/divider.d.ts +6 -3
  105. package/dist/types/components/flex/flex.d.ts +6 -3
  106. package/dist/types/components/kbd/kbd.d.ts +8 -5
  107. package/dist/types/components/menu/menu.d.ts +13 -9
  108. package/dist/types/components/navigation/navigation.d.ts +11 -7
  109. package/dist/types/components/pagination/pagination.d.ts +6 -3
  110. package/dist/types/components/pill/pill.d.ts +6 -3
  111. package/dist/types/components/popover/popover.d.ts +7 -5
  112. package/dist/types/components/progress/progress.d.ts +6 -3
  113. package/dist/types/components/radio-group/radio-group.d.ts +8 -5
  114. package/dist/types/components/select/select.d.ts +13 -9
  115. package/dist/types/components/skeleton/skeleton.d.ts +6 -3
  116. package/dist/types/components/spinner/spinner.d.ts +6 -3
  117. package/dist/types/components/stack/stack.d.ts +4 -1
  118. package/dist/types/components/switch/switch.d.ts +6 -3
  119. package/dist/types/components/tabs/tabs.d.ts +14 -9
  120. package/dist/types/components/text-field/text-field.d.ts +6 -3
  121. package/dist/types/components/textarea/textarea.d.ts +6 -3
  122. package/dist/types/components/theme-root/theme-root.d.ts +6 -3
  123. package/dist/types/components/toast/toast.d.ts +6 -4
  124. package/dist/types/components/toggle-group/toggle-group.d.ts +7 -5
  125. package/dist/types/components/tooltip/tooltip.d.ts +7 -5
  126. package/dist/types/overlay/use-native-dialog.d.ts +2 -2
  127. package/dist/{use-controlled-state-DQXkiTQI.js → use-controlled-state-CVXDa-qM.js} +1 -0
  128. package/dist/{use-native-dialog-BCp1chwO.js → use-native-dialog-DWpIUVO1.js} +1 -0
  129. package/dist/{use-overlay-floating-CsZd3qxa.js → use-overlay-floating-efeqppiw.js} +1 -0
  130. package/dist/{visually-hidden-BXVyhj0y.js → visually-hidden-DCWhf0Cb.js} +2 -1
  131. package/package.json +4 -4
  132. package/dist/accordion-Dl-kvgPQ.js +0 -168
  133. package/dist/alert-BzntPa_5.js +0 -129
  134. package/dist/avatar-Dk2ES3ru.js +0 -124
  135. package/dist/badge-DZefC7rm.js +0 -102
  136. package/dist/breadcrumbs-5MCZ_Jr3.js +0 -125
  137. package/dist/button-qy-50NPd.js +0 -187
  138. package/dist/calendar-DcCAiN3b.js +0 -372
  139. package/dist/card-L-Z_1vZN.js +0 -120
  140. package/dist/checkbox-B7em7B-6.js +0 -134
  141. package/dist/combobox-DQcXR94r.js +0 -301
  142. package/dist/command-palette-BRJ8A5De.js +0 -328
  143. package/dist/container-COHiEjI8.js +0 -34
  144. package/dist/date-picker-D1GwiRB9.js +0 -239
  145. package/dist/dialog-CYf9fCZO.js +0 -175
  146. package/dist/divider-bi7OgCI5.js +0 -76
  147. package/dist/flex-CDFDDaiu.js +0 -21
  148. package/dist/kbd-DpiJgDJ2.js +0 -55
  149. package/dist/menu-A9fZUaAG.js +0 -186
  150. package/dist/navigation-Cemnmc_J.js +0 -174
  151. package/dist/pagination-orCjUsn_.js +0 -148
  152. package/dist/pill-Dg2JJHHW.js +0 -49
  153. package/dist/popover-D_YU34WS.js +0 -97
  154. package/dist/progress-XdvBG0Vv.js +0 -83
  155. package/dist/radio-group-CxMJ2Vq7.js +0 -130
  156. package/dist/select-mwFbmzsn.js +0 -256
  157. package/dist/skeleton-qas9ZKK9.js +0 -47
  158. package/dist/spinner-ros2CfIf.js +0 -49
  159. package/dist/stack-Hs8THnIL.js +0 -20
  160. package/dist/switch-E375Bz4X.js +0 -135
  161. package/dist/tabs-CBwRiuul.js +0 -173
  162. package/dist/text-field-BlP8qGn_.js +0 -73
  163. package/dist/textarea-CUG26CH2.js +0 -83
  164. package/dist/theme-root-CrdzwfSo.js +0 -20
  165. package/dist/toast-D_dnqnn-.js +0 -270
  166. package/dist/toggle-group-B7gXCea8.js +0 -150
  167. package/dist/tooltip-BJ2hLV1b.js +0 -92
@@ -0,0 +1,51 @@
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 };
package/dist/spinner.js CHANGED
@@ -1 +1,2 @@
1
- export { t as Spinner } from "./spinner-ros2CfIf.js";
1
+ 'use client';
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 +1,2 @@
1
- export { t as Stack } from "./stack-Hs8THnIL.js";
1
+ 'use client';
2
+ export { t as Stack } from "./stack-D_g6NJzo.js";
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  import { vars as e } from "@jfrader/tokens/vars";
2
3
  //#region src/styling/surface.ts
3
4
  var t = {
@@ -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 +1,2 @@
1
- export { t as Switch } from "./switch-E375Bz4X.js";
1
+ 'use client';
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 +1,2 @@
1
- export { t as Tabs } from "./tabs-CBwRiuul.js";
1
+ 'use client';
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 +1,2 @@
1
- export { t as TextField } from "./text-field-BlP8qGn_.js";
1
+ 'use client';
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 +1,2 @@
1
- export { t as Textarea } from "./textarea-CUG26CH2.js";
1
+ 'use client';
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 +1,2 @@
1
- export { t as ThemeRoot } from "./theme-root-CrdzwfSo.js";
1
+ 'use client';
2
+ export { t as ThemeRoot } from "./theme-root-BRLIA4eb.js";