@jfrader/ui 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/accordion-Bd-j04hW.js +198 -0
- package/dist/accordion.js +1 -1
- package/dist/{alert-CA9ZlIZp.js → alert-BBqaKI4k.js} +57 -52
- package/dist/alert.js +1 -1
- package/dist/{avatar-IUW4yJl0.js → avatar-BahDVO9t.js} +40 -33
- package/dist/avatar.js +1 -1
- package/dist/{badge-Bru30HEn.js → badge-B_sLygxU.js} +32 -27
- package/dist/badge.js +1 -1
- package/dist/breadcrumbs-DVAOxfvL.js +141 -0
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-Cmixur4Q.js → button-P2e7_44z.js} +65 -53
- package/dist/button.js +1 -1
- package/dist/calendar-C9Yad_-w.js +394 -0
- package/dist/calendar.js +1 -1
- package/dist/card-D-aI2QHx.js +158 -0
- package/dist/card.js +1 -1
- package/dist/checkbox-COYG6L7d.js +140 -0
- package/dist/checkbox.js +1 -1
- package/dist/{choice-control-ByFogYcT.js → choice-control-5kJkLXgv.js} +1 -1
- package/dist/{collection-registry-1l9f3XJZ.js → collection-registry-BTYi6zGh.js} +1 -1
- package/dist/combobox-DrmjBbo7.js +327 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-V_2pEay7.js +379 -0
- package/dist/command-palette.js +1 -1
- package/dist/container-BOaSptJa.js +41 -0
- package/dist/container.js +1 -1
- package/dist/{date-picker-DrHJMt2p.js → date-picker-ClUYBIBh.js} +69 -59
- package/dist/date-picker.js +1 -1
- package/dist/dialog-xaydbXl2.js +218 -0
- package/dist/dialog.js +1 -1
- package/dist/divider-DYoJf0I_.js +84 -0
- package/dist/divider.js +1 -1
- package/dist/field-anatomy-D2ToMeRa.js +109 -0
- package/dist/flex-Dh-_J5-U.js +28 -0
- package/dist/flex.js +1 -1
- package/dist/{icon-wrapper-CFWzew5m.js → icon-wrapper-stN8sD7R.js} +1 -1
- package/dist/index.js +38 -37
- package/dist/{kbd-B03_qIwQ.js → kbd-C3ACoMoE.js} +36 -21
- package/dist/kbd.js +1 -1
- package/dist/{layout-style-7ZTOiWGR.js → layout-style-Cbd1Vilw.js} +1 -1
- package/dist/{loading-ring-BpdB0aFi.js → loading-ring-B8-30Dl1.js} +1 -1
- package/dist/menu-DU60SMdt.js +216 -0
- package/dist/menu.js +1 -1
- package/dist/navigation-DhnKriOp.js +197 -0
- package/dist/navigation.js +1 -1
- package/dist/pagination-DYdwsxwe.js +156 -0
- package/dist/pagination.js +1 -1
- package/dist/{pill-CrVqffKM.js → pill-DO2gHzMb.js} +16 -10
- package/dist/pill.js +1 -1
- package/dist/popover-BtN_0ejj.js +113 -0
- package/dist/popover.js +1 -1
- package/dist/progress-BpJswTG4.js +90 -0
- package/dist/progress.js +1 -1
- package/dist/radio-group-Ce0_IWQr.js +145 -0
- package/dist/radio-group.js +1 -1
- package/dist/select-BCS0-LVW.js +286 -0
- package/dist/select.js +1 -1
- package/dist/{skeleton-gJ4ImO5u.js → skeleton-OoFlOEXO.js} +24 -18
- package/dist/skeleton.js +1 -1
- package/dist/spinner-C2YDoiMn.js +56 -0
- package/dist/spinner.js +1 -1
- package/dist/stack-DC3IbtWk.js +27 -0
- package/dist/stack.js +1 -1
- package/dist/{switch-2hm2WnWt.js → switch-Dr-qjmT4.js} +63 -57
- package/dist/switch.js +1 -1
- package/dist/sx-Dx9JUKp5.js +23 -0
- package/dist/tabs-CK_g1RKa.js +203 -0
- package/dist/tabs.js +1 -1
- package/dist/text-field-D60ok14S.js +76 -0
- package/dist/text-field.js +1 -1
- package/dist/textarea-DyfjtP0A.js +86 -0
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BiXXvQvr.js +42 -0
- package/dist/theme-root.js +1 -1
- package/dist/{toast-D3Y6OAsg.js → toast-iqelR-r0.js} +41 -30
- package/dist/toast.js +1 -1
- package/dist/toggle-group-CI0e7hFm.js +166 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CB-HC1js.js +108 -0
- package/dist/tooltip.js +1 -1
- package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
- package/dist/types/components/accordion/accordion.d.ts +14 -9
- package/dist/types/components/alert/alert.d.ts +7 -3
- package/dist/types/components/avatar/avatar.d.ts +7 -3
- package/dist/types/components/badge/badge.d.ts +7 -3
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +9 -5
- package/dist/types/components/button/button.d.ts +7 -3
- package/dist/types/components/calendar/calendar.d.ts +12 -7
- package/dist/types/components/card/card.d.ts +21 -13
- package/dist/types/components/checkbox/checkbox.d.ts +7 -3
- package/dist/types/components/combobox/combobox.d.ts +13 -8
- package/dist/types/components/command-palette/command-palette.d.ts +23 -15
- package/dist/types/components/container/container.d.ts +7 -3
- package/dist/types/components/date-picker/date-picker.d.ts +7 -4
- package/dist/types/components/dialog/dialog.d.ts +17 -11
- package/dist/types/components/divider/divider.d.ts +7 -3
- package/dist/types/components/field/field-anatomy.d.ts +3 -2
- package/dist/types/components/flex/flex.d.ts +7 -3
- package/dist/types/components/kbd/kbd.d.ts +9 -5
- package/dist/types/components/menu/menu.d.ts +14 -9
- package/dist/types/components/navigation/navigation.d.ts +12 -7
- package/dist/types/components/pagination/pagination.d.ts +7 -3
- package/dist/types/components/pill/pill.d.ts +7 -3
- package/dist/types/components/popover/popover.d.ts +8 -5
- package/dist/types/components/progress/progress.d.ts +7 -3
- package/dist/types/components/radio-group/radio-group.d.ts +9 -5
- package/dist/types/components/select/select.d.ts +14 -9
- package/dist/types/components/skeleton/skeleton.d.ts +7 -3
- package/dist/types/components/spinner/spinner.d.ts +7 -3
- package/dist/types/components/stack/stack.d.ts +4 -1
- package/dist/types/components/switch/switch.d.ts +7 -3
- package/dist/types/components/tabs/tabs.d.ts +15 -9
- package/dist/types/components/text-field/text-field.d.ts +7 -3
- package/dist/types/components/textarea/textarea.d.ts +7 -3
- package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
- package/dist/types/components/theme-root/theme-root.d.ts +7 -3
- package/dist/types/components/toast/toast.d.ts +7 -4
- package/dist/types/components/toggle-group/toggle-group.d.ts +8 -5
- package/dist/types/components/tooltip/tooltip.d.ts +8 -5
- package/dist/types/index.d.ts +4 -0
- package/dist/types/overlay/use-native-dialog.d.ts +2 -2
- package/dist/types/styling/css.d.ts +3 -2
- package/dist/types/styling/styled.d.ts +1 -0
- package/dist/types/styling/sx.d.ts +16 -0
- package/dist/types/styling/theme.d.ts +98 -0
- package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
- package/package.json +5 -4
- package/dist/accordion-C3YbYFBi.js +0 -169
- package/dist/breadcrumbs-CQaviWRc.js +0 -126
- package/dist/calendar-DUgS0xmp.js +0 -373
- package/dist/card-D9CHtouU.js +0 -121
- package/dist/checkbox-DKa5BCdy.js +0 -135
- package/dist/combobox-Dq3V88Zt.js +0 -302
- package/dist/command-palette-6c158eH1.js +0 -329
- package/dist/container-xUEIoZzj.js +0 -35
- package/dist/css-Cgj6sCHn.js +0 -2
- package/dist/dialog-C2NSOOP-.js +0 -176
- package/dist/divider-yF5EmhhT.js +0 -77
- package/dist/field-anatomy-BzGw1Ch9.js +0 -105
- package/dist/flex-5-NI5SSy.js +0 -22
- package/dist/menu-bvKRJOhJ.js +0 -187
- package/dist/navigation-xPoqh_Iz.js +0 -175
- package/dist/pagination-BIKYsxK1.js +0 -149
- package/dist/popover-CVAZ_C1a.js +0 -98
- package/dist/progress-C8bgujFI.js +0 -84
- package/dist/radio-group-CvQ4x8ii.js +0 -131
- package/dist/select-CNNiUhKB.js +0 -257
- package/dist/spinner-CSFiP0Oi.js +0 -50
- package/dist/stack-mEAryjKz.js +0 -21
- package/dist/tabs-GBppQabg.js +0 -174
- package/dist/text-field-DDPqQu29.js +0 -74
- package/dist/textarea-OP8_3IUR.js +0 -84
- package/dist/theme-root-eLka0ZP1.js +0 -21
- package/dist/toggle-group-BxzJ-6Cp.js +0 -151
- package/dist/tooltip-CVl8HS4S.js +0 -93
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { n } from "./media-D_eA_I-e.js";
|
|
4
|
-
import { forwardRef as r } from "react";
|
|
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";
|
|
5
4
|
import { vars as i } from "@jfrader/tokens/vars";
|
|
6
5
|
import { jsx as a } from "@emotion/react/jsx-runtime";
|
|
7
6
|
//#region src/components/skeleton/skeleton.tsx
|
|
@@ -20,7 +19,7 @@ var o = e({
|
|
|
20
19
|
backgroundRepeat: "no-repeat",
|
|
21
20
|
animation: `${o} 1.6s ease-in-out infinite`,
|
|
22
21
|
"&:dir(rtl)": { animationDirection: "reverse" },
|
|
23
|
-
[
|
|
22
|
+
[r]: {
|
|
24
23
|
animation: "none",
|
|
25
24
|
backgroundImage: "none"
|
|
26
25
|
}
|
|
@@ -29,20 +28,27 @@ var o = e({
|
|
|
29
28
|
blockSize: "auto",
|
|
30
29
|
aspectRatio: "1",
|
|
31
30
|
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
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";
|
|
47
53
|
//#endregion
|
|
48
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-
|
|
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-
|
|
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-
|
|
2
|
+
export { t as Stack } from "./stack-DC3IbtWk.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { n
|
|
4
|
-
import { t as
|
|
5
|
-
import { i
|
|
6
|
-
import {
|
|
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
7
|
import { vars as l } from "@jfrader/tokens/vars";
|
|
8
8
|
import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
|
|
9
9
|
//#region src/components/switch/switch.tsx
|
|
@@ -32,7 +32,7 @@ var f = {
|
|
|
32
32
|
transitionDuration: l.motion.duration.fast,
|
|
33
33
|
transitionTimingFunction: l.motion.easeStandard
|
|
34
34
|
},
|
|
35
|
-
[
|
|
35
|
+
[n]: {
|
|
36
36
|
transitionDuration: "0s",
|
|
37
37
|
"&::after": { transitionDuration: "0s" }
|
|
38
38
|
}
|
|
@@ -77,60 +77,66 @@ var f = {
|
|
|
77
77
|
}), v = {
|
|
78
78
|
sm: e({ marginInlineStart: `calc(${f.sm} + ${l.space[2]})` }),
|
|
79
79
|
md: e({ marginInlineStart: `calc(${f.md} + ${l.space[2]})` })
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
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);
|
|
83
84
|
};
|
|
84
|
-
return /* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
css: [
|
|
85
|
+
return /* @__PURE__ */ u(t, {
|
|
86
|
+
className: F,
|
|
87
|
+
styles: [
|
|
88
|
+
o,
|
|
89
89
|
a,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
y?.root?.css
|
|
90
|
+
h[f],
|
|
91
|
+
x?.root?.css
|
|
93
92
|
],
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
+
})
|
|
133
138
|
});
|
|
134
|
-
}
|
|
139
|
+
}
|
|
140
|
+
y.displayName = "Switch";
|
|
135
141
|
//#endregion
|
|
136
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-
|
|
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-
|
|
2
|
+
export { t as Tabs } from "./tabs-CK_g1RKa.js";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';
|
|
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
|
+
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: _, sx: v, required: y, id: b, "aria-describedby": x, "aria-invalid": S, ...C }) {
|
|
25
|
+
let w = t({
|
|
26
|
+
id: b,
|
|
27
|
+
description: d,
|
|
28
|
+
error: f,
|
|
29
|
+
"aria-describedby": x,
|
|
30
|
+
"aria-invalid": S
|
|
31
|
+
}), T = (e) => {
|
|
32
|
+
m?.(e), h?.(e.currentTarget.value);
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ l(n, {
|
|
35
|
+
"data-ui": "text-field",
|
|
36
|
+
className: _,
|
|
37
|
+
sx: v,
|
|
38
|
+
part: g?.root,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ c(a, {
|
|
41
|
+
htmlFor: w.id,
|
|
42
|
+
required: y,
|
|
43
|
+
part: g?.label,
|
|
44
|
+
children: s
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ c("input", {
|
|
47
|
+
...C,
|
|
48
|
+
ref: e,
|
|
49
|
+
id: w.id,
|
|
50
|
+
required: y,
|
|
51
|
+
"aria-describedby": w.describedBy,
|
|
52
|
+
"aria-invalid": w.ariaInvalid,
|
|
53
|
+
onChange: T,
|
|
54
|
+
className: g?.control?.className,
|
|
55
|
+
css: [
|
|
56
|
+
i,
|
|
57
|
+
u[p],
|
|
58
|
+
g?.control?.css
|
|
59
|
+
]
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ c(o, {
|
|
62
|
+
id: w.descriptionId,
|
|
63
|
+
part: g?.description,
|
|
64
|
+
children: d
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ c(r, {
|
|
67
|
+
id: w.errorId,
|
|
68
|
+
part: g?.error,
|
|
69
|
+
children: f
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
d.displayName = "TextField";
|
|
75
|
+
//#endregion
|
|
76
|
+
export { d as t };
|
package/dist/text-field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as TextField } from "./text-field-
|
|
2
|
+
export { t as TextField } from "./text-field-D60ok14S.js";
|