@jfrader/ui 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +123 -2
- package/dist/accordion-Dl-kvgPQ.js +168 -0
- package/dist/accordion.js +1 -0
- package/dist/alert-BzntPa_5.js +129 -0
- package/dist/alert.js +1 -0
- package/dist/avatar-Dk2ES3ru.js +124 -0
- package/dist/avatar.js +1 -0
- package/dist/badge-DZefC7rm.js +102 -0
- package/dist/badge.js +1 -0
- package/dist/breadcrumbs-5MCZ_Jr3.js +125 -0
- package/dist/breadcrumbs.js +1 -0
- package/dist/button-qy-50NPd.js +187 -0
- package/dist/button.js +1 -0
- package/dist/calendar-DcCAiN3b.js +372 -0
- package/dist/calendar.js +1 -0
- package/dist/card-L-Z_1vZN.js +120 -0
- package/dist/card.js +1 -0
- package/dist/checkbox-B7em7B-6.js +134 -0
- package/dist/checkbox.js +1 -0
- package/dist/choice-control-DCyQ_hVw.js +35 -0
- package/dist/collection-registry-C2jnQa7X.js +97 -0
- package/dist/combobox-DQcXR94r.js +301 -0
- package/dist/combobox.js +1 -0
- package/dist/command-palette-BRJ8A5De.js +328 -0
- package/dist/command-palette.js +1 -0
- package/dist/container-COHiEjI8.js +34 -0
- package/dist/container.js +1 -0
- package/dist/css-CW_HG55W.js +1 -0
- package/dist/date-picker-D1GwiRB9.js +239 -0
- package/dist/date-picker.js +1 -0
- package/dist/dialog-CYf9fCZO.js +175 -0
- package/dist/dialog.js +1 -0
- package/dist/disclosure-caret-BC6P8AsM.js +13 -0
- package/dist/divider-bi7OgCI5.js +76 -0
- package/dist/divider.js +1 -0
- package/dist/field-anatomy-DKkB268x.js +104 -0
- package/dist/flex-CDFDDaiu.js +21 -0
- package/dist/flex.js +1 -0
- package/dist/focus-ring-qOS3rPlM.js +11 -0
- package/dist/icon-wrapper-BKo4FI-O.js +12 -0
- package/dist/index.js +37 -0
- package/dist/kbd-DpiJgDJ2.js +55 -0
- package/dist/kbd.js +1 -0
- package/dist/layout-style-B_6YHQ6Q.js +56 -0
- package/dist/loading-ring-CTpT-IrT.js +18 -0
- package/dist/media-8K3xDAxM.js +4 -0
- package/dist/menu-A9fZUaAG.js +186 -0
- package/dist/menu.js +1 -0
- package/dist/navigation-Cemnmc_J.js +174 -0
- package/dist/navigation.js +1 -0
- package/dist/pagination-orCjUsn_.js +148 -0
- package/dist/pagination.js +1 -0
- package/dist/part-id-Bg1LSlk7.js +4 -0
- package/dist/pill-Dg2JJHHW.js +49 -0
- package/dist/pill.js +1 -0
- package/dist/popover-D_YU34WS.js +97 -0
- package/dist/popover.js +1 -0
- package/dist/progress-XdvBG0Vv.js +83 -0
- package/dist/progress.js +1 -0
- package/dist/radio-group-CxMJ2Vq7.js +130 -0
- package/dist/radio-group.js +1 -0
- package/dist/renderable-DwPvt1I8.js +6 -0
- package/dist/roving-focus-DeEZ55-T.js +35 -0
- package/dist/select-mwFbmzsn.js +256 -0
- package/dist/select.js +1 -0
- package/dist/skeleton-qas9ZKK9.js +47 -0
- package/dist/skeleton.js +1 -0
- package/dist/spinner-ros2CfIf.js +49 -0
- package/dist/spinner.js +1 -0
- package/dist/stack-Hs8THnIL.js +20 -0
- package/dist/stack.js +1 -0
- package/dist/surface-Bo_aSQOb.js +18 -0
- package/dist/switch-E375Bz4X.js +135 -0
- package/dist/switch.js +1 -0
- package/dist/tabs-CBwRiuul.js +173 -0
- package/dist/tabs.js +1 -0
- package/dist/text-field-BlP8qGn_.js +73 -0
- package/dist/text-field.js +1 -0
- package/dist/textarea-CUG26CH2.js +83 -0
- package/dist/textarea.js +1 -0
- package/dist/theme-root-CrdzwfSo.js +20 -0
- package/dist/theme-root.js +1 -0
- package/dist/toast-D_dnqnn-.js +270 -0
- package/dist/toast.js +1 -0
- package/dist/toggle-group-B7gXCea8.js +150 -0
- package/dist/toggle-group.js +1 -0
- package/dist/tooltip-BJ2hLV1b.js +92 -0
- package/dist/tooltip.js +1 -0
- package/dist/trigger-style-f54idgjT.js +35 -0
- package/dist/types/components/accordion/accordion.d.ts +33 -0
- package/dist/types/components/accordion/index.d.ts +2 -0
- package/dist/types/components/alert/alert.d.ts +23 -0
- package/dist/types/components/alert/index.d.ts +2 -0
- package/dist/types/components/avatar/avatar.d.ts +23 -0
- package/dist/types/components/avatar/index.d.ts +2 -0
- package/dist/types/components/badge/badge.d.ts +36 -0
- package/dist/types/components/badge/index.d.ts +2 -0
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +15 -0
- package/dist/types/components/breadcrumbs/index.d.ts +2 -0
- package/dist/types/components/button/button.d.ts +34 -0
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +28 -0
- package/dist/types/components/calendar/calendar.styles.d.ts +9 -0
- package/dist/types/components/calendar/calendar.utils.d.ts +37 -0
- package/dist/types/components/calendar/index.d.ts +2 -0
- package/dist/types/components/card/card.d.ts +34 -0
- package/dist/types/components/card/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +21 -0
- package/dist/types/components/checkbox/index.d.ts +2 -0
- package/dist/types/components/combobox/combobox.d.ts +44 -0
- package/dist/types/components/combobox/index.d.ts +2 -0
- package/dist/types/components/command-palette/command-palette.d.ts +47 -0
- package/dist/types/components/command-palette/command-palette.styles.d.ts +8 -0
- package/dist/types/components/command-palette/index.d.ts +2 -0
- package/dist/types/components/container/container.d.ts +14 -0
- package/dist/types/components/container/index.d.ts +3 -0
- package/dist/types/components/date-picker/date-picker.d.ts +39 -0
- package/dist/types/components/date-picker/index.d.ts +2 -0
- package/dist/types/components/dialog/dialog.d.ts +61 -0
- package/dist/types/components/dialog/index.d.ts +2 -0
- package/dist/types/components/divider/divider.d.ts +14 -0
- package/dist/types/components/divider/index.d.ts +2 -0
- package/dist/types/components/field/field-anatomy.d.ts +49 -0
- package/dist/types/components/flex/flex.d.ts +4 -0
- package/dist/types/components/flex/index.d.ts +3 -0
- package/dist/types/components/kbd/index.d.ts +2 -0
- package/dist/types/components/kbd/kbd.d.ts +6 -0
- package/dist/types/components/menu/index.d.ts +2 -0
- package/dist/types/components/menu/menu.d.ts +29 -0
- package/dist/types/components/navigation/index.d.ts +2 -0
- package/dist/types/components/navigation/navigation.d.ts +24 -0
- package/dist/types/components/pagination/index.d.ts +2 -0
- package/dist/types/components/pagination/pagination.d.ts +14 -0
- package/dist/types/components/pill/index.d.ts +2 -0
- package/dist/types/components/pill/pill.d.ts +6 -0
- package/dist/types/components/popover/index.d.ts +2 -0
- package/dist/types/components/popover/popover.d.ts +19 -0
- package/dist/types/components/progress/index.d.ts +2 -0
- package/dist/types/components/progress/progress.d.ts +19 -0
- package/dist/types/components/radio-group/index.d.ts +2 -0
- package/dist/types/components/radio-group/radio-group.d.ts +29 -0
- package/dist/types/components/select/index.d.ts +2 -0
- package/dist/types/components/select/select.d.ts +38 -0
- package/dist/types/components/skeleton/index.d.ts +2 -0
- package/dist/types/components/skeleton/skeleton.d.ts +11 -0
- package/dist/types/components/spinner/index.d.ts +2 -0
- package/dist/types/components/spinner/spinner.d.ts +8 -0
- package/dist/types/components/stack/index.d.ts +3 -0
- package/dist/types/components/stack/stack.d.ts +7 -0
- package/dist/types/components/switch/index.d.ts +2 -0
- package/dist/types/components/switch/switch.d.ts +20 -0
- package/dist/types/components/tabs/index.d.ts +2 -0
- package/dist/types/components/tabs/tabs.d.ts +22 -0
- package/dist/types/components/text-field/index.d.ts +2 -0
- package/dist/types/components/text-field/text-field.d.ts +14 -0
- package/dist/types/components/textarea/index.d.ts +2 -0
- package/dist/types/components/textarea/textarea.d.ts +17 -0
- package/dist/types/components/theme-root/index.d.ts +2 -0
- package/dist/types/components/theme-root/theme-root.d.ts +7 -0
- package/dist/types/components/toast/index.d.ts +2 -0
- package/dist/types/components/toast/toast.d.ts +37 -0
- package/dist/types/components/toggle-group/index.d.ts +2 -0
- package/dist/types/components/toggle-group/toggle-group.d.ts +29 -0
- package/dist/types/components/tooltip/index.d.ts +2 -0
- package/dist/types/components/tooltip/tooltip.d.ts +23 -0
- package/dist/types/index.d.ts +36 -0
- package/dist/types/overlay/use-native-dialog.d.ts +39 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -0
- package/dist/types/overlay/use-scroll-lock.d.ts +5 -0
- package/dist/types/styling/choice-control.d.ts +8 -0
- package/dist/types/styling/css.d.ts +2 -0
- package/dist/types/styling/disclosure-caret.d.ts +9 -0
- package/dist/types/styling/focus-ring.d.ts +10 -0
- package/dist/types/styling/icon-wrapper.d.ts +1 -0
- package/dist/types/styling/input-control.d.ts +1 -0
- package/dist/types/styling/layout-style.d.ts +26 -0
- package/dist/types/styling/listbox-style.d.ts +12 -0
- package/dist/types/styling/loading-ring.d.ts +14 -0
- package/dist/types/styling/media.d.ts +2 -0
- package/dist/types/styling/surface.d.ts +19 -0
- package/dist/types/styling/trigger-style.d.ts +1 -0
- package/dist/types/styling/visually-hidden.d.ts +1 -0
- package/dist/types/utils/collection-registry.d.ts +41 -0
- package/dist/types/utils/part-id.d.ts +2 -0
- package/dist/types/utils/renderable.d.ts +3 -0
- package/dist/types/utils/roving-focus.d.ts +18 -0
- package/dist/types/utils/use-controlled-state.d.ts +7 -0
- package/dist/types/utils/use-latest-callback.d.ts +10 -0
- package/dist/use-controlled-state-DQXkiTQI.js +20 -0
- package/dist/use-native-dialog-BCp1chwO.js +83 -0
- package/dist/use-overlay-floating-CsZd3qxa.js +18 -0
- package/dist/visually-hidden-BXVyhj0y.js +16 -0
- package/package.json +198 -3
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { n as t } from "./media-8K3xDAxM.js";
|
|
3
|
+
import { t as n } from "./renderable-DwPvt1I8.js";
|
|
4
|
+
import { i as r, n as i, r as a, t as o } from "./choice-control-DCyQ_hVw.js";
|
|
5
|
+
import { forwardRef as s, useId as c } from "react";
|
|
6
|
+
import { vars as l } from "@jfrader/tokens/vars";
|
|
7
|
+
import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
|
|
8
|
+
//#region src/components/switch/switch.tsx
|
|
9
|
+
var f = {
|
|
10
|
+
sm: "36px",
|
|
11
|
+
md: "44px"
|
|
12
|
+
}, p = e({
|
|
13
|
+
position: "relative",
|
|
14
|
+
display: "inline-block",
|
|
15
|
+
flexShrink: 0,
|
|
16
|
+
boxSizing: "border-box",
|
|
17
|
+
border: `1px solid ${l.color.borderControl}`,
|
|
18
|
+
borderRadius: l.radius.full,
|
|
19
|
+
backgroundColor: l.color.surfaceHover,
|
|
20
|
+
transitionProperty: "background-color, border-color",
|
|
21
|
+
transitionDuration: l.motion.duration.fast,
|
|
22
|
+
transitionTimingFunction: l.motion.easeStandard,
|
|
23
|
+
"&::after": {
|
|
24
|
+
content: "\"\"",
|
|
25
|
+
position: "absolute",
|
|
26
|
+
insetBlockStart: "2px",
|
|
27
|
+
insetInlineStart: "2px",
|
|
28
|
+
borderRadius: l.radius.full,
|
|
29
|
+
backgroundColor: l.color.text,
|
|
30
|
+
transitionProperty: "transform, background-color",
|
|
31
|
+
transitionDuration: l.motion.duration.fast,
|
|
32
|
+
transitionTimingFunction: l.motion.easeStandard
|
|
33
|
+
},
|
|
34
|
+
[t]: {
|
|
35
|
+
transitionDuration: "0s",
|
|
36
|
+
"&::after": { transitionDuration: "0s" }
|
|
37
|
+
}
|
|
38
|
+
}), m = {
|
|
39
|
+
sm: e({
|
|
40
|
+
inlineSize: f.sm,
|
|
41
|
+
blockSize: "20px",
|
|
42
|
+
"&::after": {
|
|
43
|
+
inlineSize: "14px",
|
|
44
|
+
blockSize: "14px"
|
|
45
|
+
}
|
|
46
|
+
}),
|
|
47
|
+
md: e({
|
|
48
|
+
inlineSize: f.md,
|
|
49
|
+
blockSize: "24px",
|
|
50
|
+
"&::after": {
|
|
51
|
+
inlineSize: "18px",
|
|
52
|
+
blockSize: "18px"
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}, h = {
|
|
56
|
+
sm: e({
|
|
57
|
+
"input:checked + span::after": {
|
|
58
|
+
transform: "translateX(16px)",
|
|
59
|
+
backgroundColor: l.color.accentContrast
|
|
60
|
+
},
|
|
61
|
+
"&:dir(rtl) input:checked + span::after": { transform: "translateX(-16px)" }
|
|
62
|
+
}),
|
|
63
|
+
md: e({
|
|
64
|
+
"input:checked + span::after": {
|
|
65
|
+
transform: "translateX(20px)",
|
|
66
|
+
backgroundColor: l.color.accentContrast
|
|
67
|
+
},
|
|
68
|
+
"&:dir(rtl) input:checked + span::after": { transform: "translateX(-20px)" }
|
|
69
|
+
})
|
|
70
|
+
}, g = {
|
|
71
|
+
sm: e({ fontSize: l.textSize.sm }),
|
|
72
|
+
md: e({ fontSize: l.textSize.md })
|
|
73
|
+
}, _ = e({
|
|
74
|
+
fontSize: l.textSize.sm,
|
|
75
|
+
color: l.color.textMuted
|
|
76
|
+
}), v = {
|
|
77
|
+
sm: e({ marginInlineStart: `calc(${f.sm} + ${l.space[2]})` }),
|
|
78
|
+
md: e({ marginInlineStart: `calc(${f.md} + ${l.space[2]})` })
|
|
79
|
+
}, y = s(function({ label: e, description: t, size: s = "md", onChange: l, onCheckedChange: f, slotProps: y, className: b, dir: x, "aria-labelledby": S, "aria-describedby": C, ...w }, T) {
|
|
80
|
+
let E = c(), D = `${E}-label`, O = `${E}-description`, k = n(e), A = n(t), j = [S, k && D].filter(Boolean).join(" ") || void 0, M = [C, A && O].filter(Boolean).join(" ") || void 0, N = [b, y?.root?.className].filter(Boolean).join(" ") || void 0, P = (e) => {
|
|
81
|
+
l?.(e), f?.(e.currentTarget.checked);
|
|
82
|
+
};
|
|
83
|
+
return /* @__PURE__ */ d("label", {
|
|
84
|
+
"data-ui": "switch",
|
|
85
|
+
dir: x,
|
|
86
|
+
className: N,
|
|
87
|
+
css: [
|
|
88
|
+
a,
|
|
89
|
+
i,
|
|
90
|
+
h[s],
|
|
91
|
+
y?.root?.css
|
|
92
|
+
],
|
|
93
|
+
children: [/* @__PURE__ */ d("span", {
|
|
94
|
+
css: r,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ u("input", {
|
|
97
|
+
...w,
|
|
98
|
+
ref: T,
|
|
99
|
+
type: "checkbox",
|
|
100
|
+
role: "switch",
|
|
101
|
+
"aria-labelledby": j,
|
|
102
|
+
"aria-describedby": M,
|
|
103
|
+
onChange: P,
|
|
104
|
+
css: o
|
|
105
|
+
}),
|
|
106
|
+
/* @__PURE__ */ u("span", {
|
|
107
|
+
"aria-hidden": "true",
|
|
108
|
+
className: y?.control?.className,
|
|
109
|
+
css: [
|
|
110
|
+
p,
|
|
111
|
+
m[s],
|
|
112
|
+
y?.control?.css
|
|
113
|
+
]
|
|
114
|
+
}),
|
|
115
|
+
k && /* @__PURE__ */ u("span", {
|
|
116
|
+
id: D,
|
|
117
|
+
className: y?.label?.className,
|
|
118
|
+
css: [g[s], y?.label?.css],
|
|
119
|
+
children: e
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
}), A && /* @__PURE__ */ u("span", {
|
|
123
|
+
id: O,
|
|
124
|
+
className: y?.description?.className,
|
|
125
|
+
css: [
|
|
126
|
+
_,
|
|
127
|
+
v[s],
|
|
128
|
+
y?.description?.css
|
|
129
|
+
],
|
|
130
|
+
children: t
|
|
131
|
+
})]
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
//#endregion
|
|
135
|
+
export { y as t };
|
package/dist/switch.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Switch } from "./switch-E375Bz4X.js";
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { n as t, t as n } from "./focus-ring-qOS3rPlM.js";
|
|
3
|
+
import { n as r } from "./media-8K3xDAxM.js";
|
|
4
|
+
import { n as i, r as a, t as o } from "./roving-focus-DeEZ55-T.js";
|
|
5
|
+
import { t as s } from "./use-controlled-state-DQXkiTQI.js";
|
|
6
|
+
import { t as c } from "./part-id-Bg1LSlk7.js";
|
|
7
|
+
import { createContext as l, forwardRef as u, useContext as d, useEffect as f, useId as p, useImperativeHandle as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
8
|
+
import { vars as v } from "@jfrader/tokens/vars";
|
|
9
|
+
import { jsx as y } from "@emotion/react/jsx-runtime";
|
|
10
|
+
//#region src/components/tabs/tabs.tsx
|
|
11
|
+
var b = l(null);
|
|
12
|
+
function x(e) {
|
|
13
|
+
let t = d(b);
|
|
14
|
+
if (!t) throw Error(`Tabs.${e} must be rendered inside <Tabs>.`);
|
|
15
|
+
return t;
|
|
16
|
+
}
|
|
17
|
+
var S = {
|
|
18
|
+
itemSelector: "[role=\"tab\"]:not([disabled])",
|
|
19
|
+
ownerSelector: "[role=\"tablist\"]"
|
|
20
|
+
}, C = e({ "&[data-orientation=\"vertical\"]": {
|
|
21
|
+
display: "flex",
|
|
22
|
+
alignItems: "flex-start",
|
|
23
|
+
gap: v.space[4]
|
|
24
|
+
} }), w = {
|
|
25
|
+
horizontal: e({
|
|
26
|
+
display: "inline-flex",
|
|
27
|
+
gap: v.space[1],
|
|
28
|
+
borderBlockEnd: `1px solid ${v.color.border}`
|
|
29
|
+
}),
|
|
30
|
+
vertical: e({
|
|
31
|
+
display: "inline-flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
alignItems: "stretch",
|
|
34
|
+
borderInlineEnd: `1px solid ${v.color.border}`
|
|
35
|
+
})
|
|
36
|
+
}, T = e({
|
|
37
|
+
appearance: "none",
|
|
38
|
+
border: 0,
|
|
39
|
+
background: "transparent",
|
|
40
|
+
cursor: "pointer",
|
|
41
|
+
paddingBlock: v.space[2],
|
|
42
|
+
paddingInline: v.space[3],
|
|
43
|
+
font: "inherit",
|
|
44
|
+
fontSize: v.textSize.sm,
|
|
45
|
+
fontWeight: v.fontWeight.medium,
|
|
46
|
+
color: v.color.textMuted,
|
|
47
|
+
transitionProperty: "color, border-color",
|
|
48
|
+
transitionDuration: v.motion.duration.fast,
|
|
49
|
+
transitionTimingFunction: v.motion.easeStandard,
|
|
50
|
+
"&:hover:not(:disabled):not([aria-selected=\"true\"])": { color: v.color.text },
|
|
51
|
+
"&[aria-selected=\"true\"]": {
|
|
52
|
+
color: v.color.text,
|
|
53
|
+
borderColor: v.color.accent
|
|
54
|
+
},
|
|
55
|
+
"&:disabled": {
|
|
56
|
+
opacity: .55,
|
|
57
|
+
cursor: "not-allowed"
|
|
58
|
+
},
|
|
59
|
+
"&:focus-visible": { ...n },
|
|
60
|
+
[r]: { transitionDuration: "0s" }
|
|
61
|
+
}), E = {
|
|
62
|
+
horizontal: e({
|
|
63
|
+
borderBlockEnd: "2px solid transparent",
|
|
64
|
+
marginBlockEnd: "-1px"
|
|
65
|
+
}),
|
|
66
|
+
vertical: e({
|
|
67
|
+
borderInlineEnd: "2px solid transparent",
|
|
68
|
+
marginInlineEnd: "-1px",
|
|
69
|
+
textAlign: "start"
|
|
70
|
+
})
|
|
71
|
+
}, D = e({
|
|
72
|
+
color: v.color.text,
|
|
73
|
+
outline: "none",
|
|
74
|
+
"&:focus-visible": { ...t },
|
|
75
|
+
"&[hidden]": { display: "none" }
|
|
76
|
+
}), O = e({ paddingBlockStart: v.space[3] }), k = u(function({ value: e, defaultValue: t, onValueChange: n, orientation: r = "horizontal", activation: i = "auto", ...a }, o) {
|
|
77
|
+
let c = p(), [l, u] = s(e, t, n), [d, f] = _(null), m = h(() => ({
|
|
78
|
+
value: l,
|
|
79
|
+
setValue: u,
|
|
80
|
+
focused: d,
|
|
81
|
+
setFocused: f,
|
|
82
|
+
orientation: r,
|
|
83
|
+
activation: i,
|
|
84
|
+
baseId: c
|
|
85
|
+
}), [
|
|
86
|
+
l,
|
|
87
|
+
u,
|
|
88
|
+
d,
|
|
89
|
+
r,
|
|
90
|
+
i,
|
|
91
|
+
c
|
|
92
|
+
]);
|
|
93
|
+
return /* @__PURE__ */ y(b.Provider, {
|
|
94
|
+
value: m,
|
|
95
|
+
children: /* @__PURE__ */ y("div", {
|
|
96
|
+
...a,
|
|
97
|
+
ref: o,
|
|
98
|
+
"data-ui": "tabs-root",
|
|
99
|
+
"data-orientation": r,
|
|
100
|
+
css: C
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
}), A = u(function({ onKeyDown: e, ...t }, n) {
|
|
104
|
+
let { orientation: r, value: s, focused: c, setFocused: l } = x("List"), u = g(null);
|
|
105
|
+
m(n, () => u.current, []), f(() => {
|
|
106
|
+
let e = u.current;
|
|
107
|
+
if (!e) return;
|
|
108
|
+
let t = a(e, S);
|
|
109
|
+
t.length !== 0 && (t.some((e) => e.tabIndex === 0) || l((o(t, s) ?? o(t, c) ?? t[0])?.dataset.value ?? null));
|
|
110
|
+
});
|
|
111
|
+
let d = (t) => {
|
|
112
|
+
e?.(t);
|
|
113
|
+
let n = u.current;
|
|
114
|
+
!t.defaultPrevented && n && i(t, n, r, S);
|
|
115
|
+
};
|
|
116
|
+
return /* @__PURE__ */ y("div", {
|
|
117
|
+
...t,
|
|
118
|
+
ref: u,
|
|
119
|
+
role: "tablist",
|
|
120
|
+
"aria-orientation": r,
|
|
121
|
+
"data-ui": "tabs-list",
|
|
122
|
+
"data-orientation": r,
|
|
123
|
+
"data-roving": c ?? "",
|
|
124
|
+
"data-selected": s ?? "",
|
|
125
|
+
onKeyDown: d,
|
|
126
|
+
css: w[r]
|
|
127
|
+
});
|
|
128
|
+
}), j = u(function({ value: e, disabled: t, onClick: n, onFocus: r, ...i }, a) {
|
|
129
|
+
let { value: o, setValue: s, focused: l, setFocused: u, activation: d, baseId: f, orientation: p } = x("Tab"), m = o === e, h = !t && (l === null ? m : l === e), _ = g(!1), v = (t) => {
|
|
130
|
+
if (n?.(t), t.defaultPrevented) return;
|
|
131
|
+
let r = _.current;
|
|
132
|
+
_.current = !1, !(d === "auto" && r) && s(e);
|
|
133
|
+
}, b = (t) => {
|
|
134
|
+
r?.(t), !t.defaultPrevented && (_.current = !0, u(e), d === "auto" && s(e));
|
|
135
|
+
};
|
|
136
|
+
return /* @__PURE__ */ y("button", {
|
|
137
|
+
...i,
|
|
138
|
+
ref: a,
|
|
139
|
+
type: "button",
|
|
140
|
+
role: "tab",
|
|
141
|
+
id: c(f, "tab", e),
|
|
142
|
+
"data-ui": "tabs-tab",
|
|
143
|
+
"data-value": e,
|
|
144
|
+
"data-state": m ? "active" : "inactive",
|
|
145
|
+
"aria-selected": m,
|
|
146
|
+
"aria-controls": c(f, "panel", e),
|
|
147
|
+
tabIndex: h ? 0 : -1,
|
|
148
|
+
disabled: t,
|
|
149
|
+
onClick: v,
|
|
150
|
+
onFocus: b,
|
|
151
|
+
css: [T, E[p]]
|
|
152
|
+
});
|
|
153
|
+
}), M = u(function({ value: e, tabIndex: t = 0, "aria-labelledby": n, ...r }, i) {
|
|
154
|
+
let { value: a, baseId: o, orientation: s } = x("Panel"), l = a === e, u = [n, c(o, "tab", e)].filter(Boolean).join(" ") || void 0;
|
|
155
|
+
return /* @__PURE__ */ y("div", {
|
|
156
|
+
...r,
|
|
157
|
+
ref: i,
|
|
158
|
+
role: "tabpanel",
|
|
159
|
+
id: c(o, "panel", e),
|
|
160
|
+
"aria-labelledby": u,
|
|
161
|
+
tabIndex: t,
|
|
162
|
+
hidden: !l,
|
|
163
|
+
"data-ui": "tabs-panel",
|
|
164
|
+
"data-state": l ? "active" : "inactive",
|
|
165
|
+
css: [D, s === "horizontal" && O]
|
|
166
|
+
});
|
|
167
|
+
}), N = Object.assign(k, {
|
|
168
|
+
List: A,
|
|
169
|
+
Tab: j,
|
|
170
|
+
Panel: M
|
|
171
|
+
});
|
|
172
|
+
//#endregion
|
|
173
|
+
export { N as t };
|
package/dist/tabs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Tabs } from "./tabs-CBwRiuul.js";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-DKkB268x.js";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { vars as c } from "@jfrader/tokens/vars";
|
|
5
|
+
import { jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
|
|
6
|
+
//#region src/components/text-field/text-field.tsx
|
|
7
|
+
var d = {
|
|
8
|
+
sm: e({
|
|
9
|
+
blockSize: "32px",
|
|
10
|
+
paddingInline: c.space[3],
|
|
11
|
+
fontSize: c.textSize.sm
|
|
12
|
+
}),
|
|
13
|
+
md: e({
|
|
14
|
+
blockSize: "40px",
|
|
15
|
+
paddingInline: c.space[4],
|
|
16
|
+
fontSize: c.textSize.sm
|
|
17
|
+
}),
|
|
18
|
+
lg: e({
|
|
19
|
+
blockSize: "48px",
|
|
20
|
+
paddingInline: c.space[4],
|
|
21
|
+
fontSize: c.textSize.md
|
|
22
|
+
})
|
|
23
|
+
}, f = s(function({ label: e, description: s, error: c, size: f = "md", onChange: p, onValueChange: m, slotProps: h, className: g, required: _, id: v, "aria-describedby": y, "aria-invalid": b, ...x }, S) {
|
|
24
|
+
let C = t({
|
|
25
|
+
id: v,
|
|
26
|
+
description: s,
|
|
27
|
+
error: c,
|
|
28
|
+
"aria-describedby": y,
|
|
29
|
+
"aria-invalid": b
|
|
30
|
+
}), w = (e) => {
|
|
31
|
+
p?.(e), m?.(e.currentTarget.value);
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ u(n, {
|
|
34
|
+
"data-ui": "text-field",
|
|
35
|
+
className: g,
|
|
36
|
+
part: h?.root,
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ l(a, {
|
|
39
|
+
htmlFor: C.id,
|
|
40
|
+
required: _,
|
|
41
|
+
part: h?.label,
|
|
42
|
+
children: e
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ l("input", {
|
|
45
|
+
...x,
|
|
46
|
+
ref: S,
|
|
47
|
+
id: C.id,
|
|
48
|
+
required: _,
|
|
49
|
+
"aria-describedby": C.describedBy,
|
|
50
|
+
"aria-invalid": C.ariaInvalid,
|
|
51
|
+
onChange: w,
|
|
52
|
+
className: h?.control?.className,
|
|
53
|
+
css: [
|
|
54
|
+
i,
|
|
55
|
+
d[f],
|
|
56
|
+
h?.control?.css
|
|
57
|
+
]
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ l(o, {
|
|
60
|
+
id: C.descriptionId,
|
|
61
|
+
part: h?.description,
|
|
62
|
+
children: s
|
|
63
|
+
}),
|
|
64
|
+
/* @__PURE__ */ l(r, {
|
|
65
|
+
id: C.errorId,
|
|
66
|
+
part: h?.error,
|
|
67
|
+
children: c
|
|
68
|
+
})
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
//#endregion
|
|
73
|
+
export { f as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as TextField } from "./text-field-BlP8qGn_.js";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { a as t, i as n, n as r, o as i, r as a, t as o } from "./field-anatomy-DKkB268x.js";
|
|
3
|
+
import { forwardRef as s } from "react";
|
|
4
|
+
import { vars as c } from "@jfrader/tokens/vars";
|
|
5
|
+
import { jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
|
|
6
|
+
//#region src/components/textarea/textarea.tsx
|
|
7
|
+
var d = e({
|
|
8
|
+
paddingBlock: c.space[2],
|
|
9
|
+
lineHeight: c.lineHeight.base
|
|
10
|
+
}), f = {
|
|
11
|
+
sm: e({
|
|
12
|
+
minBlockSize: "64px",
|
|
13
|
+
paddingInline: c.space[3],
|
|
14
|
+
fontSize: c.textSize.sm
|
|
15
|
+
}),
|
|
16
|
+
md: e({
|
|
17
|
+
minBlockSize: "80px",
|
|
18
|
+
paddingInline: c.space[4],
|
|
19
|
+
fontSize: c.textSize.sm
|
|
20
|
+
}),
|
|
21
|
+
lg: e({
|
|
22
|
+
minBlockSize: "96px",
|
|
23
|
+
paddingInline: c.space[4],
|
|
24
|
+
fontSize: c.textSize.md
|
|
25
|
+
})
|
|
26
|
+
}, p = {
|
|
27
|
+
none: e({ resize: "none" }),
|
|
28
|
+
vertical: e({ resize: "vertical" })
|
|
29
|
+
}, m = e({ fieldSizing: "content" }), h = s(function({ label: e, description: s, error: c, size: h = "md", resize: g = "vertical", autoResize: _ = !1, rows: v = 3, onChange: y, onValueChange: b, slotProps: x, className: S, required: C, id: w, "aria-describedby": T, "aria-invalid": E, ...D }, O) {
|
|
30
|
+
let k = t({
|
|
31
|
+
id: w,
|
|
32
|
+
description: s,
|
|
33
|
+
error: c,
|
|
34
|
+
"aria-describedby": T,
|
|
35
|
+
"aria-invalid": E
|
|
36
|
+
}), A = (e) => {
|
|
37
|
+
y?.(e), b?.(e.currentTarget.value);
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ u(n, {
|
|
40
|
+
"data-ui": "textarea",
|
|
41
|
+
className: S,
|
|
42
|
+
part: x?.root,
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ l(a, {
|
|
45
|
+
htmlFor: k.id,
|
|
46
|
+
required: C,
|
|
47
|
+
part: x?.label,
|
|
48
|
+
children: e
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ l("textarea", {
|
|
51
|
+
...D,
|
|
52
|
+
ref: O,
|
|
53
|
+
id: k.id,
|
|
54
|
+
rows: v,
|
|
55
|
+
required: C,
|
|
56
|
+
"aria-describedby": k.describedBy,
|
|
57
|
+
"aria-invalid": k.ariaInvalid,
|
|
58
|
+
onChange: A,
|
|
59
|
+
className: x?.control?.className,
|
|
60
|
+
css: [
|
|
61
|
+
i,
|
|
62
|
+
d,
|
|
63
|
+
f[h],
|
|
64
|
+
p[g],
|
|
65
|
+
_ && m,
|
|
66
|
+
x?.control?.css
|
|
67
|
+
]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ l(o, {
|
|
70
|
+
id: k.descriptionId,
|
|
71
|
+
part: x?.description,
|
|
72
|
+
children: s
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ l(r, {
|
|
75
|
+
id: k.errorId,
|
|
76
|
+
part: x?.error,
|
|
77
|
+
children: c
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
//#endregion
|
|
83
|
+
export { h as t };
|
package/dist/textarea.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Textarea } from "./textarea-CUG26CH2.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { vars as n } from "@jfrader/tokens/vars";
|
|
4
|
+
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
5
|
+
//#region src/components/theme-root/theme-root.tsx
|
|
6
|
+
var i = e({
|
|
7
|
+
color: n.color.text,
|
|
8
|
+
colorScheme: "dark",
|
|
9
|
+
"&[data-theme=\"light\"]": { colorScheme: "light" }
|
|
10
|
+
}), a = t(function({ theme: e, ...t }, n) {
|
|
11
|
+
return /* @__PURE__ */ r("div", {
|
|
12
|
+
"data-ui": "theme-root",
|
|
13
|
+
"data-theme": e ?? "dark",
|
|
14
|
+
...t,
|
|
15
|
+
ref: n,
|
|
16
|
+
css: i
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
//#endregion
|
|
20
|
+
export { a as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as ThemeRoot } from "./theme-root-CrdzwfSo.js";
|