@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.
- package/README.md +3 -1
- package/dist/accordion-CkOZ-tvs.js +178 -0
- package/dist/accordion.js +2 -1
- package/dist/alert-Dsjx14UW.js +131 -0
- package/dist/alert.js +2 -1
- package/dist/avatar-BRGKkoSr.js +127 -0
- package/dist/avatar.js +2 -1
- package/dist/badge-DLxUMsCx.js +104 -0
- package/dist/badge.js +2 -1
- package/dist/breadcrumbs-694hF_hm.js +131 -0
- package/dist/breadcrumbs.js +2 -1
- package/dist/button-CoaIcykB.js +190 -0
- package/dist/button.js +2 -1
- package/dist/calendar-Doj7PTdG.js +379 -0
- package/dist/calendar.js +2 -1
- package/dist/card-2IM71XZj.js +134 -0
- package/dist/card.js +2 -1
- package/dist/checkbox-B7xGNFzp.js +136 -0
- package/dist/checkbox.js +2 -1
- package/dist/{choice-control-DCyQ_hVw.js → choice-control-ByFogYcT.js} +2 -1
- package/dist/{collection-registry-C2jnQa7X.js → collection-registry-1l9f3XJZ.js} +3 -2
- package/dist/combobox-Bjhxv5U3.js +311 -0
- package/dist/combobox.js +2 -1
- package/dist/command-palette-BhJwm6cS.js +344 -0
- package/dist/command-palette.js +2 -1
- package/dist/container-BhnrGPu-.js +36 -0
- package/dist/container.js +2 -1
- package/dist/{css-CW_HG55W.js → css-Cgj6sCHn.js} +1 -0
- package/dist/date-picker-Jk8SpoiO.js +245 -0
- package/dist/date-picker.js +2 -1
- package/dist/dialog-fhS07G41.js +187 -0
- package/dist/dialog.js +2 -1
- package/dist/{disclosure-caret-BC6P8AsM.js → disclosure-caret-C5T3fcl6.js} +1 -0
- package/dist/divider-v_78HYF5.js +79 -0
- package/dist/divider.js +2 -1
- package/dist/{field-anatomy-DKkB268x.js → field-anatomy-BzGw1Ch9.js} +4 -3
- package/dist/flex-COZzFqI8.js +22 -0
- package/dist/flex.js +2 -1
- package/dist/{focus-ring-qOS3rPlM.js → focus-ring-BK5W5_NY.js} +1 -0
- package/dist/{icon-wrapper-BKo4FI-O.js → icon-wrapper-CFWzew5m.js} +2 -1
- package/dist/index.js +37 -36
- package/dist/kbd-CeP8Kfvp.js +61 -0
- package/dist/kbd.js +2 -1
- package/dist/{layout-style-B_6YHQ6Q.js → layout-style-7ZTOiWGR.js} +2 -1
- package/dist/{loading-ring-CTpT-IrT.js → loading-ring-BpdB0aFi.js} +2 -1
- package/dist/{media-8K3xDAxM.js → media-D_eA_I-e.js} +1 -0
- package/dist/menu-B6KCbLCr.js +196 -0
- package/dist/menu.js +2 -1
- package/dist/navigation-BDht6S2-.js +182 -0
- package/dist/navigation.js +2 -1
- package/dist/pagination-B50PCaDU.js +151 -0
- package/dist/pagination.js +2 -1
- package/dist/{part-id-Bg1LSlk7.js → part-id-D0zksy32.js} +1 -0
- package/dist/pill-2_XzBdkD.js +51 -0
- package/dist/pill.js +2 -1
- package/dist/popover-DRHbeIVq.js +103 -0
- package/dist/popover.js +2 -1
- package/dist/progress-CpsskKTD.js +85 -0
- package/dist/progress.js +2 -1
- package/dist/radio-group-DPI5KUCj.js +136 -0
- package/dist/radio-group.js +2 -1
- package/dist/{renderable-DwPvt1I8.js → renderable-DzcIj1Lo.js} +1 -0
- package/dist/{roving-focus-DeEZ55-T.js → roving-focus-CYlo_Kf8.js} +1 -0
- package/dist/select-C1xGrOhT.js +266 -0
- package/dist/select.js +2 -1
- package/dist/skeleton-DitdP-yz.js +49 -0
- package/dist/skeleton.js +2 -1
- package/dist/spinner-CFq5HPoo.js +51 -0
- package/dist/spinner.js +2 -1
- package/dist/stack-D_g6NJzo.js +21 -0
- package/dist/stack.js +2 -1
- package/dist/{surface-Bo_aSQOb.js → surface-DZ4d-2aL.js} +1 -0
- package/dist/switch-B5TTU-oJ.js +138 -0
- package/dist/switch.js +2 -1
- package/dist/tabs-C26PWl2c.js +183 -0
- package/dist/tabs.js +2 -1
- package/dist/text-field-8PQAqRpM.js +75 -0
- package/dist/text-field.js +2 -1
- package/dist/textarea-CcGWuntL.js +85 -0
- package/dist/textarea.js +2 -1
- package/dist/theme-root-BRLIA4eb.js +22 -0
- package/dist/theme-root.js +2 -1
- package/dist/toast-B1PXuwZ4.js +277 -0
- package/dist/toast.js +2 -1
- package/dist/toggle-group-N_owicT0.js +156 -0
- package/dist/toggle-group.js +2 -1
- package/dist/tooltip-BJPisf60.js +98 -0
- package/dist/tooltip.js +2 -1
- package/dist/{trigger-style-f54idgjT.js → trigger-style-B1GFmH7M.js} +2 -1
- package/dist/types/components/accordion/accordion.d.ts +13 -9
- package/dist/types/components/alert/alert.d.ts +6 -3
- package/dist/types/components/avatar/avatar.d.ts +6 -3
- package/dist/types/components/badge/badge.d.ts +6 -3
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +8 -5
- package/dist/types/components/button/button.d.ts +6 -3
- package/dist/types/components/calendar/calendar.d.ts +11 -7
- package/dist/types/components/card/card.d.ts +20 -13
- package/dist/types/components/checkbox/checkbox.d.ts +6 -3
- package/dist/types/components/combobox/combobox.d.ts +12 -8
- package/dist/types/components/command-palette/command-palette.d.ts +22 -15
- package/dist/types/components/container/container.d.ts +6 -3
- package/dist/types/components/date-picker/date-picker.d.ts +6 -4
- package/dist/types/components/dialog/dialog.d.ts +16 -11
- package/dist/types/components/divider/divider.d.ts +6 -3
- package/dist/types/components/flex/flex.d.ts +6 -3
- package/dist/types/components/kbd/kbd.d.ts +8 -5
- package/dist/types/components/menu/menu.d.ts +13 -9
- package/dist/types/components/navigation/navigation.d.ts +11 -7
- package/dist/types/components/pagination/pagination.d.ts +6 -3
- package/dist/types/components/pill/pill.d.ts +6 -3
- package/dist/types/components/popover/popover.d.ts +7 -5
- package/dist/types/components/progress/progress.d.ts +6 -3
- package/dist/types/components/radio-group/radio-group.d.ts +8 -5
- package/dist/types/components/select/select.d.ts +13 -9
- package/dist/types/components/skeleton/skeleton.d.ts +6 -3
- package/dist/types/components/spinner/spinner.d.ts +6 -3
- package/dist/types/components/stack/stack.d.ts +4 -1
- package/dist/types/components/switch/switch.d.ts +6 -3
- package/dist/types/components/tabs/tabs.d.ts +14 -9
- package/dist/types/components/text-field/text-field.d.ts +6 -3
- package/dist/types/components/textarea/textarea.d.ts +6 -3
- package/dist/types/components/theme-root/theme-root.d.ts +6 -3
- package/dist/types/components/toast/toast.d.ts +6 -4
- package/dist/types/components/toggle-group/toggle-group.d.ts +7 -5
- package/dist/types/components/tooltip/tooltip.d.ts +7 -5
- package/dist/types/overlay/use-native-dialog.d.ts +2 -2
- package/dist/{use-controlled-state-DQXkiTQI.js → use-controlled-state-CVXDa-qM.js} +1 -0
- package/dist/{use-native-dialog-BCp1chwO.js → use-native-dialog-DWpIUVO1.js} +1 -0
- package/dist/{use-overlay-floating-CsZd3qxa.js → use-overlay-floating-efeqppiw.js} +1 -0
- package/dist/{visually-hidden-BXVyhj0y.js → visually-hidden-DCWhf0Cb.js} +2 -1
- package/package.json +4 -4
- package/dist/accordion-Dl-kvgPQ.js +0 -168
- package/dist/alert-BzntPa_5.js +0 -129
- package/dist/avatar-Dk2ES3ru.js +0 -124
- package/dist/badge-DZefC7rm.js +0 -102
- package/dist/breadcrumbs-5MCZ_Jr3.js +0 -125
- package/dist/button-qy-50NPd.js +0 -187
- package/dist/calendar-DcCAiN3b.js +0 -372
- package/dist/card-L-Z_1vZN.js +0 -120
- package/dist/checkbox-B7em7B-6.js +0 -134
- package/dist/combobox-DQcXR94r.js +0 -301
- package/dist/command-palette-BRJ8A5De.js +0 -328
- package/dist/container-COHiEjI8.js +0 -34
- package/dist/date-picker-D1GwiRB9.js +0 -239
- package/dist/dialog-CYf9fCZO.js +0 -175
- package/dist/divider-bi7OgCI5.js +0 -76
- package/dist/flex-CDFDDaiu.js +0 -21
- package/dist/kbd-DpiJgDJ2.js +0 -55
- package/dist/menu-A9fZUaAG.js +0 -186
- package/dist/navigation-Cemnmc_J.js +0 -174
- package/dist/pagination-orCjUsn_.js +0 -148
- package/dist/pill-Dg2JJHHW.js +0 -49
- package/dist/popover-D_YU34WS.js +0 -97
- package/dist/progress-XdvBG0Vv.js +0 -83
- package/dist/radio-group-CxMJ2Vq7.js +0 -130
- package/dist/select-mwFbmzsn.js +0 -256
- package/dist/skeleton-qas9ZKK9.js +0 -47
- package/dist/spinner-ros2CfIf.js +0 -49
- package/dist/stack-Hs8THnIL.js +0 -20
- package/dist/switch-E375Bz4X.js +0 -135
- package/dist/tabs-CBwRiuul.js +0 -173
- package/dist/text-field-BlP8qGn_.js +0 -73
- package/dist/textarea-CUG26CH2.js +0 -83
- package/dist/theme-root-CrdzwfSo.js +0 -20
- package/dist/toast-D_dnqnn-.js +0 -270
- package/dist/toggle-group-B7gXCea8.js +0 -150
- package/dist/tooltip-BJ2hLV1b.js +0 -92
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
+
import { t } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
+
import { t as n } from "./trigger-style-B1GFmH7M.js";
|
|
5
|
+
import { n as r } from "./surface-DZ4d-2aL.js";
|
|
6
|
+
import { t as i } from "./use-overlay-floating-efeqppiw.js";
|
|
7
|
+
import { createContext as a, useContext as o, useEffect as s, useMemo as c, useRef as l } from "react";
|
|
8
|
+
import { vars as u } from "@jfrader/tokens/vars";
|
|
9
|
+
import { jsx as d } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { FloatingFocusManager as f, FloatingPortal as p, useClick as m, useDismiss as h, useInteractions as g, useMergeRefs as _, useRole as v } from "@floating-ui/react";
|
|
11
|
+
//#region src/components/popover/popover.tsx
|
|
12
|
+
var y = a(null);
|
|
13
|
+
function b(e) {
|
|
14
|
+
let t = o(y);
|
|
15
|
+
if (!t) throw Error(`Popover.${e} must be rendered inside <Popover>.`);
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
var x = e({
|
|
19
|
+
...r,
|
|
20
|
+
borderRadius: u.radius.lg,
|
|
21
|
+
boxShadow: u.shadow.overlay,
|
|
22
|
+
padding: u.space[4],
|
|
23
|
+
minInlineSize: "200px",
|
|
24
|
+
maxInlineSize: "min(360px, calc(100vw - 32px))",
|
|
25
|
+
fontSize: u.textSize.sm
|
|
26
|
+
});
|
|
27
|
+
function S({ open: e, defaultOpen: n = !1, onOpenChange: r, placement: a = "bottom", children: o }) {
|
|
28
|
+
let [u = !1, f] = t(e, n, r), p = l(!1), { refs: _, floatingStyles: b, context: x } = i({
|
|
29
|
+
open: u,
|
|
30
|
+
placement: a,
|
|
31
|
+
onOpenChange: (e, t, n) => {
|
|
32
|
+
e || (p.current = n === "escape-key"), f(e);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
s(() => {
|
|
36
|
+
!u && p.current && (p.current = !1, _.domReference.current?.focus());
|
|
37
|
+
}, [u, _]);
|
|
38
|
+
let S = m(x), C = h(x, {
|
|
39
|
+
escapeKey: !0,
|
|
40
|
+
outsidePress: !0
|
|
41
|
+
}), w = v(x, { role: "dialog" }), { getReferenceProps: T, getFloatingProps: E } = g([
|
|
42
|
+
S,
|
|
43
|
+
C,
|
|
44
|
+
w
|
|
45
|
+
]), D = c(() => ({
|
|
46
|
+
open: u,
|
|
47
|
+
refs: _,
|
|
48
|
+
floatingContext: x,
|
|
49
|
+
floatingStyles: b,
|
|
50
|
+
getReferenceProps: T,
|
|
51
|
+
getFloatingProps: E
|
|
52
|
+
}), [
|
|
53
|
+
u,
|
|
54
|
+
_,
|
|
55
|
+
x,
|
|
56
|
+
b,
|
|
57
|
+
T,
|
|
58
|
+
E
|
|
59
|
+
]);
|
|
60
|
+
return /* @__PURE__ */ d(y.Provider, {
|
|
61
|
+
value: D,
|
|
62
|
+
children: o
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
S.displayName = "Popover";
|
|
66
|
+
function C({ ref: e, ...t }) {
|
|
67
|
+
let { refs: r, getReferenceProps: i } = b("Trigger"), a = _([r.setReference, e]);
|
|
68
|
+
return /* @__PURE__ */ d("button", {
|
|
69
|
+
type: "button",
|
|
70
|
+
...i(t),
|
|
71
|
+
ref: a,
|
|
72
|
+
"data-ui": "popover-trigger",
|
|
73
|
+
css: n
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
C.displayName = "Popover.Trigger";
|
|
77
|
+
function w({ ref: e, style: t, ...n }) {
|
|
78
|
+
let { open: r, refs: i, floatingContext: a, floatingStyles: o, getFloatingProps: s } = b("Content"), c = _([i.setFloating, e]);
|
|
79
|
+
return r ? /* @__PURE__ */ d(p, { children: /* @__PURE__ */ d(f, {
|
|
80
|
+
context: a,
|
|
81
|
+
modal: !1,
|
|
82
|
+
initialFocus: -1,
|
|
83
|
+
returnFocus: !1,
|
|
84
|
+
closeOnFocusOut: !1,
|
|
85
|
+
children: /* @__PURE__ */ d("div", {
|
|
86
|
+
...s(n),
|
|
87
|
+
ref: c,
|
|
88
|
+
"data-ui": "popover",
|
|
89
|
+
style: {
|
|
90
|
+
...t,
|
|
91
|
+
...o
|
|
92
|
+
},
|
|
93
|
+
css: x
|
|
94
|
+
})
|
|
95
|
+
}) }) : null;
|
|
96
|
+
}
|
|
97
|
+
w.displayName = "Popover.Content";
|
|
98
|
+
var T = Object.assign(S, {
|
|
99
|
+
Trigger: C,
|
|
100
|
+
Content: w
|
|
101
|
+
});
|
|
102
|
+
//#endregion
|
|
103
|
+
export { T as t };
|
package/dist/popover.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
export { t as Popover } from "./popover-DRHbeIVq.js";
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { n as e, t } from "./css-Cgj6sCHn.js";
|
|
3
|
+
import { n, t as r } from "./media-D_eA_I-e.js";
|
|
4
|
+
import { t as i } from "./visually-hidden-DCWhf0Cb.js";
|
|
5
|
+
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
6
|
+
import { useId as o } from "react";
|
|
7
|
+
import { vars as s } from "@jfrader/tokens/vars";
|
|
8
|
+
import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
9
|
+
//#region src/components/progress/progress.tsx
|
|
10
|
+
var u = "40%", d = "1.4s ease-in-out infinite", f = 100, p = e({
|
|
11
|
+
from: { transform: "translateX(-100%)" },
|
|
12
|
+
to: { transform: "translateX(250%)" }
|
|
13
|
+
}), m = e({
|
|
14
|
+
from: { transform: "translateX(100%)" },
|
|
15
|
+
to: { transform: "translateX(-250%)" }
|
|
16
|
+
}), h = t({
|
|
17
|
+
position: "relative",
|
|
18
|
+
display: "block",
|
|
19
|
+
boxSizing: "border-box",
|
|
20
|
+
blockSize: "4px",
|
|
21
|
+
overflow: "hidden",
|
|
22
|
+
backgroundColor: s.color.surfaceHover,
|
|
23
|
+
border: `1px solid ${s.color.borderSubtle}`,
|
|
24
|
+
borderRadius: s.radius.full
|
|
25
|
+
}), g = t({
|
|
26
|
+
blockSize: "100%",
|
|
27
|
+
backgroundColor: s.color.accent,
|
|
28
|
+
borderRadius: s.radius.full,
|
|
29
|
+
transitionProperty: "width",
|
|
30
|
+
transitionDuration: s.motion.duration.base,
|
|
31
|
+
transitionTimingFunction: s.motion.easeStandard,
|
|
32
|
+
[n]: { transitionDuration: "0s" },
|
|
33
|
+
[r]: {
|
|
34
|
+
forcedColorAdjust: "none",
|
|
35
|
+
backgroundColor: "Highlight"
|
|
36
|
+
}
|
|
37
|
+
}), _ = t({
|
|
38
|
+
inlineSize: u,
|
|
39
|
+
animation: `${p} ${d}`,
|
|
40
|
+
"&:dir(rtl)": { animation: `${m} ${d}` },
|
|
41
|
+
[n]: {
|
|
42
|
+
"&, &:dir(rtl)": { animation: "none" },
|
|
43
|
+
opacity: .7
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
function v(e, t) {
|
|
47
|
+
let n = Number.isFinite(t) && t > 0 ? t : f;
|
|
48
|
+
return {
|
|
49
|
+
value: e === void 0 ? void 0 : Math.min(Math.max(Number.isFinite(e) ? e : 0, 0), n),
|
|
50
|
+
max: n
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function y({ ref: e, value: t, max: n = f, label: r, getValueLabel: s, slotProps: u, "aria-labelledby": d, ...p }) {
|
|
54
|
+
let m = `${o()}-label`, y = a(r), b = [d, y && m].filter(Boolean).join(" ") || void 0, { value: x, max: S } = v(t, n), C = x === void 0, w = x === void 0 ? 0 : x / S * 100;
|
|
55
|
+
return /* @__PURE__ */ l("div", {
|
|
56
|
+
...p,
|
|
57
|
+
ref: e,
|
|
58
|
+
role: "progressbar",
|
|
59
|
+
"data-ui": "progress",
|
|
60
|
+
"data-state": C ? "indeterminate" : "determinate",
|
|
61
|
+
"aria-labelledby": b,
|
|
62
|
+
"aria-valuemin": 0,
|
|
63
|
+
"aria-valuemax": S,
|
|
64
|
+
"aria-valuenow": x,
|
|
65
|
+
"aria-valuetext": x === void 0 ? void 0 : s?.(x, S),
|
|
66
|
+
css: h,
|
|
67
|
+
children: [y && /* @__PURE__ */ c("span", {
|
|
68
|
+
id: m,
|
|
69
|
+
css: i,
|
|
70
|
+
children: r
|
|
71
|
+
}), /* @__PURE__ */ c("div", {
|
|
72
|
+
"data-ui": "progress-indicator",
|
|
73
|
+
className: u?.indicator?.className,
|
|
74
|
+
style: C ? void 0 : { width: `${w}%` },
|
|
75
|
+
css: [
|
|
76
|
+
g,
|
|
77
|
+
C && _,
|
|
78
|
+
u?.indicator?.css
|
|
79
|
+
]
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
y.displayName = "Progress";
|
|
84
|
+
//#endregion
|
|
85
|
+
export { y as t };
|
package/dist/progress.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
export { t as Progress } from "./progress-CpsskKTD.js";
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
+
import { n as t, t as n } from "./media-D_eA_I-e.js";
|
|
4
|
+
import { t as r } from "./use-controlled-state-CVXDa-qM.js";
|
|
5
|
+
import { t as i } from "./renderable-DzcIj1Lo.js";
|
|
6
|
+
import { i as a, n as o, r as s, t as c } from "./choice-control-ByFogYcT.js";
|
|
7
|
+
import { createContext as l, useContext as u, useId as d, useMemo as f } from "react";
|
|
8
|
+
import { vars as p } from "@jfrader/tokens/vars";
|
|
9
|
+
import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
|
10
|
+
//#region src/components/radio-group/radio-group.tsx
|
|
11
|
+
var g = l(null);
|
|
12
|
+
function _(e) {
|
|
13
|
+
let t = u(g);
|
|
14
|
+
if (!t) throw Error(`RadioGroup.${e} must be rendered inside <RadioGroup>.`);
|
|
15
|
+
return t;
|
|
16
|
+
}
|
|
17
|
+
var v = "16px", y = {
|
|
18
|
+
vertical: e({
|
|
19
|
+
display: "grid",
|
|
20
|
+
justifyItems: "start",
|
|
21
|
+
gap: p.space[3]
|
|
22
|
+
}),
|
|
23
|
+
horizontal: e({
|
|
24
|
+
display: "flex",
|
|
25
|
+
flexWrap: "wrap",
|
|
26
|
+
alignItems: "flex-start",
|
|
27
|
+
gap: p.space[4]
|
|
28
|
+
})
|
|
29
|
+
}, b = e({ "input:checked + span::after": { opacity: 1 } }), x = e({ minBlockSize: "32px" }), S = e({
|
|
30
|
+
display: "inline-flex",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
flexShrink: 0,
|
|
34
|
+
boxSizing: "border-box",
|
|
35
|
+
inlineSize: v,
|
|
36
|
+
blockSize: v,
|
|
37
|
+
border: `1px solid ${p.color.borderControl}`,
|
|
38
|
+
borderRadius: p.radius.full,
|
|
39
|
+
backgroundColor: p.color.surfaceRaised,
|
|
40
|
+
transitionProperty: "background-color, border-color",
|
|
41
|
+
transitionDuration: p.motion.duration.fast,
|
|
42
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
43
|
+
"&::after": {
|
|
44
|
+
content: "\"\"",
|
|
45
|
+
inlineSize: "40%",
|
|
46
|
+
blockSize: "40%",
|
|
47
|
+
borderRadius: p.radius.full,
|
|
48
|
+
backgroundColor: p.color.accentContrast,
|
|
49
|
+
opacity: 0
|
|
50
|
+
},
|
|
51
|
+
[t]: { transitionDuration: "0s" },
|
|
52
|
+
[n]: { "&::after": { backgroundColor: "CanvasText" } }
|
|
53
|
+
}), C = e({ fontSize: p.textSize.sm }), w = e({
|
|
54
|
+
marginInlineStart: `calc(${v} + ${p.space[2]})`,
|
|
55
|
+
fontSize: p.textSize.sm,
|
|
56
|
+
color: p.color.textMuted
|
|
57
|
+
});
|
|
58
|
+
function T({ ref: e, value: t, defaultValue: n, onValueChange: i, name: a, disabled: o = !1, orientation: s = "vertical", ...c }) {
|
|
59
|
+
let l = d(), u = a ?? l, [p, h] = r(t, n, i), _ = f(() => ({
|
|
60
|
+
value: p,
|
|
61
|
+
setValue: h,
|
|
62
|
+
name: u,
|
|
63
|
+
disabled: o
|
|
64
|
+
}), [
|
|
65
|
+
p,
|
|
66
|
+
h,
|
|
67
|
+
u,
|
|
68
|
+
o
|
|
69
|
+
]);
|
|
70
|
+
return /* @__PURE__ */ m(g.Provider, {
|
|
71
|
+
value: _,
|
|
72
|
+
children: /* @__PURE__ */ m("div", {
|
|
73
|
+
...c,
|
|
74
|
+
ref: e,
|
|
75
|
+
role: "radiogroup",
|
|
76
|
+
"aria-orientation": s,
|
|
77
|
+
"data-ui": "radio-group-root",
|
|
78
|
+
"data-orientation": s,
|
|
79
|
+
css: y[s]
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
T.displayName = "RadioGroup";
|
|
84
|
+
function E({ ref: e, value: t, label: n, description: r, disabled: l, onChange: u, slotProps: f, className: p, "aria-labelledby": g, "aria-describedby": v, ...y }) {
|
|
85
|
+
let { value: T, setValue: E, name: D, disabled: O } = _("Radio"), k = O || l, A = d(), j = `${A}-label`, M = `${A}-description`, N = i(n), P = i(r), F = [g, N && j].filter(Boolean).join(" ") || void 0, I = [v, P && M].filter(Boolean).join(" ") || void 0, L = [p, f?.root?.className].filter(Boolean).join(" ") || void 0, R = (e) => {
|
|
86
|
+
u?.(e), e.currentTarget.checked && E(t);
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ h("label", {
|
|
89
|
+
"data-ui": "radio-group-radio",
|
|
90
|
+
className: L,
|
|
91
|
+
css: [
|
|
92
|
+
s,
|
|
93
|
+
b,
|
|
94
|
+
o,
|
|
95
|
+
f?.root?.css
|
|
96
|
+
],
|
|
97
|
+
children: [/* @__PURE__ */ h("span", {
|
|
98
|
+
css: [a, x],
|
|
99
|
+
children: [
|
|
100
|
+
/* @__PURE__ */ m("input", {
|
|
101
|
+
...y,
|
|
102
|
+
ref: e,
|
|
103
|
+
type: "radio",
|
|
104
|
+
name: D,
|
|
105
|
+
value: t,
|
|
106
|
+
checked: T === t,
|
|
107
|
+
disabled: k,
|
|
108
|
+
"aria-labelledby": F,
|
|
109
|
+
"aria-describedby": I,
|
|
110
|
+
onChange: R,
|
|
111
|
+
css: c
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ m("span", {
|
|
114
|
+
"aria-hidden": "true",
|
|
115
|
+
className: f?.control?.className,
|
|
116
|
+
css: [S, f?.control?.css]
|
|
117
|
+
}),
|
|
118
|
+
N && /* @__PURE__ */ m("span", {
|
|
119
|
+
id: j,
|
|
120
|
+
className: f?.label?.className,
|
|
121
|
+
css: [C, f?.label?.css],
|
|
122
|
+
children: n
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
}), P && /* @__PURE__ */ m("span", {
|
|
126
|
+
id: M,
|
|
127
|
+
className: f?.description?.className,
|
|
128
|
+
css: [w, f?.description?.css],
|
|
129
|
+
children: r
|
|
130
|
+
})]
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
E.displayName = "RadioGroup.Radio";
|
|
134
|
+
var D = Object.assign(T, { Radio: E });
|
|
135
|
+
//#endregion
|
|
136
|
+
export { D as t };
|
package/dist/radio-group.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
export { t as RadioGroup } from "./radio-group-DPI5KUCj.js";
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
+
import { t } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
+
import { a as n, c as r, d as i, f as a, l as o, o as s, r as c, s as l, t as u, u as d } from "./collection-registry-1l9f3XJZ.js";
|
|
5
|
+
import { t as f } from "./trigger-style-B1GFmH7M.js";
|
|
6
|
+
import { t as p } from "./use-overlay-floating-efeqppiw.js";
|
|
7
|
+
import { createContext as m, useContext as h, useId as g, useLayoutEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
8
|
+
import { vars as x } from "@jfrader/tokens/vars";
|
|
9
|
+
import { jsx as S, jsxs as C } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { FloatingList as w, FloatingPortal as T, useClick as E, useDismiss as D, useInteractions as O, useListNavigation as k, useMergeRefs as A, useRole as j } from "@floating-ui/react";
|
|
11
|
+
//#region src/components/select/select.tsx
|
|
12
|
+
var M = 500, N = new Intl.Collator(void 0, {
|
|
13
|
+
usage: "search",
|
|
14
|
+
sensitivity: "base"
|
|
15
|
+
}), P = "✓", F = m(null), I = m(!1);
|
|
16
|
+
function L(e) {
|
|
17
|
+
let t = h(F);
|
|
18
|
+
if (!t) throw Error(`Select.${e} must be rendered inside <Select>.`);
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
function R() {
|
|
22
|
+
let e = L("Item");
|
|
23
|
+
if (!h(I)) throw Error("Select.Item must be rendered inside <Select.Content>.");
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
var z = e({
|
|
27
|
+
justifyContent: "flex-start",
|
|
28
|
+
minInlineSize: "180px",
|
|
29
|
+
"&[aria-expanded=\"true\"]": { backgroundColor: x.color.surfaceHover }
|
|
30
|
+
}), B = e({
|
|
31
|
+
overflow: "hidden",
|
|
32
|
+
textOverflow: "ellipsis",
|
|
33
|
+
whiteSpace: "nowrap",
|
|
34
|
+
"&[data-placeholder]": { color: x.color.textMuted }
|
|
35
|
+
});
|
|
36
|
+
function V({ value: e, defaultValue: r, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, placement: c = "bottom-start", disabled: l = !1, name: u, children: d }) {
|
|
37
|
+
let f = g(), [m, h] = t(e, r, i), [_ = !1, x] = t(a, o, s), [w, T] = b(null), [A, M] = b(!1), [P, I] = n(), [L, R] = b(null), z = y([]), B = y([]), V = y(null);
|
|
38
|
+
!_ && A && (M(!1), T(null));
|
|
39
|
+
let { valuesByIndex: H, disabledIndices: U } = v(() => {
|
|
40
|
+
let e = [], t = /* @__PURE__ */ new Set();
|
|
41
|
+
return P.forEach((n, r) => {
|
|
42
|
+
n.index !== -1 && (e[n.index] = r, n.disabled && t.add(n.index));
|
|
43
|
+
}), {
|
|
44
|
+
valuesByIndex: e,
|
|
45
|
+
disabledIndices: t
|
|
46
|
+
};
|
|
47
|
+
}, [P]), W = m === void 0 ? void 0 : P.get(m), G = W && W.index !== -1 ? W.index : null, { refs: K, floatingStyles: q, context: J } = p({
|
|
48
|
+
open: _,
|
|
49
|
+
placement: c,
|
|
50
|
+
onOpenChange: (e) => x(e)
|
|
51
|
+
}), Y = E(J), X = j(J, { role: "listbox" }), ee = D(J, {
|
|
52
|
+
escapeKey: !0,
|
|
53
|
+
outsidePress: !0
|
|
54
|
+
}), te = k(J, {
|
|
55
|
+
listRef: z,
|
|
56
|
+
activeIndex: w,
|
|
57
|
+
onNavigate: T,
|
|
58
|
+
virtual: !0,
|
|
59
|
+
virtualItemRef: V,
|
|
60
|
+
loop: !0,
|
|
61
|
+
focusItemOnOpen: !0,
|
|
62
|
+
selectedIndex: A ? null : G,
|
|
63
|
+
disabledIndices: (e) => U.has(e)
|
|
64
|
+
}), { getReferenceProps: Z, getFloatingProps: Q, getItemProps: $ } = O([
|
|
65
|
+
Y,
|
|
66
|
+
X,
|
|
67
|
+
ee,
|
|
68
|
+
te
|
|
69
|
+
]), ne = v(() => {
|
|
70
|
+
let e = (e) => {
|
|
71
|
+
h(e), x(!1);
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
baseId: f,
|
|
75
|
+
open: _,
|
|
76
|
+
disabled: l,
|
|
77
|
+
selectedValue: m,
|
|
78
|
+
activeIndex: w,
|
|
79
|
+
options: P,
|
|
80
|
+
triggerLabelling: L,
|
|
81
|
+
refs: K,
|
|
82
|
+
floatingStyles: q,
|
|
83
|
+
elementsRef: z,
|
|
84
|
+
labelsRef: B,
|
|
85
|
+
getReferenceProps: Z,
|
|
86
|
+
getFloatingProps: Q,
|
|
87
|
+
getItemProps: $,
|
|
88
|
+
selectValue: e,
|
|
89
|
+
matchTypeahead: (e) => {
|
|
90
|
+
let t = B.current, n = w ?? -1;
|
|
91
|
+
for (let r = 1; r <= t.length; r += 1) {
|
|
92
|
+
let i = (n + r) % t.length, a = t[i];
|
|
93
|
+
if (!(a == null || U.has(i)) && N.compare(a.slice(0, e.length), e) === 0) {
|
|
94
|
+
T(i), _ || (M(!0), x(!0));
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
selectIndex: (t) => {
|
|
100
|
+
let n = H[t];
|
|
101
|
+
n === void 0 || U.has(t) || e(n);
|
|
102
|
+
},
|
|
103
|
+
requestOpenChange: x,
|
|
104
|
+
registration: I,
|
|
105
|
+
setTriggerLabelling: R
|
|
106
|
+
};
|
|
107
|
+
}, [
|
|
108
|
+
f,
|
|
109
|
+
_,
|
|
110
|
+
l,
|
|
111
|
+
m,
|
|
112
|
+
w,
|
|
113
|
+
P,
|
|
114
|
+
L,
|
|
115
|
+
K,
|
|
116
|
+
q,
|
|
117
|
+
Z,
|
|
118
|
+
Q,
|
|
119
|
+
$,
|
|
120
|
+
H,
|
|
121
|
+
U,
|
|
122
|
+
h,
|
|
123
|
+
x,
|
|
124
|
+
I
|
|
125
|
+
]);
|
|
126
|
+
return /* @__PURE__ */ C(F.Provider, {
|
|
127
|
+
value: ne,
|
|
128
|
+
children: [d, u !== void 0 && /* @__PURE__ */ S("input", {
|
|
129
|
+
type: "hidden",
|
|
130
|
+
name: u,
|
|
131
|
+
value: m ?? "",
|
|
132
|
+
disabled: l
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
V.displayName = "Select";
|
|
137
|
+
function H({ ref: e, id: t, disabled: n, onKeyDown: r, ...i }) {
|
|
138
|
+
let { baseId: a, open: o, disabled: s, activeIndex: c, refs: l, getReferenceProps: u, selectIndex: d, matchTypeahead: p, requestOpenChange: m, setTriggerLabelling: h } = L("Trigger"), g = A([l.setReference, e]), v = y({
|
|
139
|
+
search: "",
|
|
140
|
+
lastKeyAt: 0
|
|
141
|
+
}), b = t ?? `${a}-trigger`, x = i["aria-labelledby"], C = i["aria-label"];
|
|
142
|
+
_(() => (h({
|
|
143
|
+
id: b,
|
|
144
|
+
labelledBy: x,
|
|
145
|
+
label: C
|
|
146
|
+
}), () => h(null)), [
|
|
147
|
+
b,
|
|
148
|
+
x,
|
|
149
|
+
C,
|
|
150
|
+
h
|
|
151
|
+
]);
|
|
152
|
+
let w = (e) => {
|
|
153
|
+
if (r?.(e), !(e.defaultPrevented || s || n)) {
|
|
154
|
+
if (e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
|
155
|
+
let t = performance.now(), n = v.current, r = (t - n.lastKeyAt > M ? "" : n.search) + e.key;
|
|
156
|
+
v.current = {
|
|
157
|
+
search: r,
|
|
158
|
+
lastKeyAt: t
|
|
159
|
+
}, p(r);
|
|
160
|
+
} else o && (e.key === "Tab" ? m(!1) : (e.key === "Enter" || e.key === " ") && c !== null && (e.preventDefault(), d(c)));
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
return /* @__PURE__ */ S("button", {
|
|
164
|
+
type: "button",
|
|
165
|
+
...u({
|
|
166
|
+
...i,
|
|
167
|
+
id: b,
|
|
168
|
+
disabled: s || n,
|
|
169
|
+
onKeyDown: w
|
|
170
|
+
}),
|
|
171
|
+
ref: g,
|
|
172
|
+
"data-state": o ? "open" : "closed",
|
|
173
|
+
"data-ui": "select-trigger",
|
|
174
|
+
css: [f, z]
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
H.displayName = "Select.Trigger";
|
|
178
|
+
function U({ ref: e, placeholder: t, ...n }) {
|
|
179
|
+
let { selectedValue: r, options: i } = L("Value"), a = r === void 0 ? void 0 : i.get(r)?.label, o = a === void 0;
|
|
180
|
+
return /* @__PURE__ */ S("span", {
|
|
181
|
+
...n,
|
|
182
|
+
ref: e,
|
|
183
|
+
"data-placeholder": o || void 0,
|
|
184
|
+
"data-ui": "select-value",
|
|
185
|
+
css: B,
|
|
186
|
+
children: o ? t : a
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
U.displayName = "Select.Value";
|
|
190
|
+
function W({ ref: e, style: t, onMouseDown: n, children: r, ...o }) {
|
|
191
|
+
let { open: s, triggerLabelling: c, refs: l, floatingStyles: u, elementsRef: d, getFloatingProps: f } = L("Content"), p = A([s ? l.setFloating : null, e]), m = o["aria-labelledby"] !== void 0 || o["aria-label"] !== void 0 ? {} : c?.labelledBy === void 0 ? c?.label === void 0 ? { "aria-labelledby": c?.id } : { "aria-label": c.label } : { "aria-labelledby": c.labelledBy }, h = (e) => {
|
|
192
|
+
n?.(e), e.preventDefault();
|
|
193
|
+
};
|
|
194
|
+
return /* @__PURE__ */ S(T, { children: /* @__PURE__ */ S("div", {
|
|
195
|
+
...f({
|
|
196
|
+
...m,
|
|
197
|
+
...o,
|
|
198
|
+
onMouseDown: h
|
|
199
|
+
}),
|
|
200
|
+
ref: p,
|
|
201
|
+
hidden: !s,
|
|
202
|
+
"data-state": s ? "open" : "closed",
|
|
203
|
+
"data-ui": "select-listbox",
|
|
204
|
+
style: {
|
|
205
|
+
...t,
|
|
206
|
+
...u
|
|
207
|
+
},
|
|
208
|
+
css: [a, i],
|
|
209
|
+
children: /* @__PURE__ */ S(w, {
|
|
210
|
+
elementsRef: d,
|
|
211
|
+
children: /* @__PURE__ */ S(I.Provider, {
|
|
212
|
+
value: !0,
|
|
213
|
+
children: r
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
}) });
|
|
217
|
+
}
|
|
218
|
+
W.displayName = "Select.Content";
|
|
219
|
+
function G({ ref: e, value: t, disabled: n = !1, onClick: i, children: a, ...f }) {
|
|
220
|
+
let { baseId: p, selectedValue: m, activeIndex: h, labelsRef: g, getItemProps: _, selectValue: v, registration: b } = R(), x = y(null), { ref: w, index: T } = c(t, b, x, (e, t) => ({
|
|
221
|
+
index: e,
|
|
222
|
+
label: t,
|
|
223
|
+
disabled: n
|
|
224
|
+
}), {
|
|
225
|
+
labelsRef: g,
|
|
226
|
+
include: !n
|
|
227
|
+
}), E = A([w, e]), D = T !== -1 && h === T, O = m === t, k = (e) => {
|
|
228
|
+
i?.(e), !(n || e.defaultPrevented) && v(t);
|
|
229
|
+
};
|
|
230
|
+
return /* @__PURE__ */ C("div", {
|
|
231
|
+
..._({
|
|
232
|
+
id: u(p, t),
|
|
233
|
+
...f,
|
|
234
|
+
onClick: k
|
|
235
|
+
}),
|
|
236
|
+
ref: E,
|
|
237
|
+
role: "option",
|
|
238
|
+
"aria-selected": O,
|
|
239
|
+
"aria-disabled": n || void 0,
|
|
240
|
+
"data-active": D || void 0,
|
|
241
|
+
"data-ui": "select-item",
|
|
242
|
+
css: [
|
|
243
|
+
l,
|
|
244
|
+
s,
|
|
245
|
+
o
|
|
246
|
+
],
|
|
247
|
+
children: [/* @__PURE__ */ S("span", {
|
|
248
|
+
ref: x,
|
|
249
|
+
css: d,
|
|
250
|
+
children: a
|
|
251
|
+
}), O && /* @__PURE__ */ S("span", {
|
|
252
|
+
"aria-hidden": "true",
|
|
253
|
+
css: r,
|
|
254
|
+
children: P
|
|
255
|
+
})]
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
G.displayName = "Select.Item";
|
|
259
|
+
var K = Object.assign(V, {
|
|
260
|
+
Trigger: H,
|
|
261
|
+
Value: U,
|
|
262
|
+
Content: W,
|
|
263
|
+
Item: G
|
|
264
|
+
});
|
|
265
|
+
//#endregion
|
|
266
|
+
export { K as t };
|
package/dist/select.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
export { t as Select } from "./select-C1xGrOhT.js";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { n as e, t } from "./css-Cgj6sCHn.js";
|
|
3
|
+
import { n } from "./media-D_eA_I-e.js";
|
|
4
|
+
import { vars as r } from "@jfrader/tokens/vars";
|
|
5
|
+
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
6
|
+
//#region src/components/skeleton/skeleton.tsx
|
|
7
|
+
var a = e({
|
|
8
|
+
from: { backgroundPosition: "200% 0" },
|
|
9
|
+
to: { backgroundPosition: "-100% 0" }
|
|
10
|
+
}), o = t({
|
|
11
|
+
display: "block",
|
|
12
|
+
inlineSize: "100%",
|
|
13
|
+
blockSize: "1em",
|
|
14
|
+
flexShrink: 0,
|
|
15
|
+
borderRadius: r.radius.sm,
|
|
16
|
+
backgroundColor: r.color.surfaceHover,
|
|
17
|
+
backgroundImage: `linear-gradient(90deg, transparent, ${r.color.border}, transparent)`,
|
|
18
|
+
backgroundSize: "200% 100%",
|
|
19
|
+
backgroundRepeat: "no-repeat",
|
|
20
|
+
animation: `${a} 1.6s ease-in-out infinite`,
|
|
21
|
+
"&:dir(rtl)": { animationDirection: "reverse" },
|
|
22
|
+
[n]: {
|
|
23
|
+
animation: "none",
|
|
24
|
+
backgroundImage: "none"
|
|
25
|
+
}
|
|
26
|
+
}), s = t({
|
|
27
|
+
inlineSize: r.space[10],
|
|
28
|
+
blockSize: "auto",
|
|
29
|
+
aspectRatio: "1",
|
|
30
|
+
borderRadius: r.radius.full
|
|
31
|
+
});
|
|
32
|
+
function c({ ref: e, width: t, height: n, circle: r = !1, radius: a, style: c, ...l }) {
|
|
33
|
+
return /* @__PURE__ */ i("div", {
|
|
34
|
+
...l,
|
|
35
|
+
ref: e,
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
"data-ui": "skeleton",
|
|
38
|
+
style: {
|
|
39
|
+
inlineSize: t,
|
|
40
|
+
blockSize: n,
|
|
41
|
+
borderRadius: r ? void 0 : a,
|
|
42
|
+
...c
|
|
43
|
+
},
|
|
44
|
+
css: [o, r && s]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
c.displayName = "Skeleton";
|
|
48
|
+
//#endregion
|
|
49
|
+
export { c as t };
|
package/dist/skeleton.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
export { t as Skeleton } from "./skeleton-DitdP-yz.js";
|