@jfrader/ui 0.0.0-stage → 0.1.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/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,125 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { n as t } from "./focus-ring-qOS3rPlM.js";
|
|
3
|
+
import { n } from "./media-8K3xDAxM.js";
|
|
4
|
+
import { createContext as r, forwardRef as i, useCallback as a, useContext as o, useId as s, useImperativeHandle as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
5
|
+
import { vars as p } from "@jfrader/tokens/vars";
|
|
6
|
+
import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
|
7
|
+
//#region src/components/breadcrumbs/breadcrumbs.tsx
|
|
8
|
+
var g = r(null);
|
|
9
|
+
function _(e) {
|
|
10
|
+
let t = o(g);
|
|
11
|
+
if (!t) throw Error(`Breadcrumbs.${e} must be rendered inside <Breadcrumbs>.`);
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
var v = ([, e], [, t]) => e.node.compareDocumentPosition(t.node) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1, y = e({
|
|
15
|
+
display: "flex",
|
|
16
|
+
flexWrap: "wrap",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
gap: p.space[2],
|
|
19
|
+
margin: 0,
|
|
20
|
+
padding: 0,
|
|
21
|
+
listStyle: "none",
|
|
22
|
+
fontFamily: p.font.sans,
|
|
23
|
+
fontSize: p.textSize.sm,
|
|
24
|
+
lineHeight: p.lineHeight.tight
|
|
25
|
+
}), b = e({
|
|
26
|
+
display: "inline-flex",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
gap: p.space[2],
|
|
29
|
+
color: p.color.textMuted,
|
|
30
|
+
"&:first-of-type > [data-ui=\"breadcrumbs-separator\"]": { display: "none" }
|
|
31
|
+
}), x = e({ display: "inline-flex" }), S = e({
|
|
32
|
+
display: "inline-flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
gap: p.space[1],
|
|
35
|
+
minBlockSize: "24px",
|
|
36
|
+
borderRadius: p.radius.sm,
|
|
37
|
+
color: "inherit",
|
|
38
|
+
"& svg": {
|
|
39
|
+
inlineSize: "1em",
|
|
40
|
+
blockSize: "1em",
|
|
41
|
+
flexShrink: 0
|
|
42
|
+
},
|
|
43
|
+
"&[aria-current=\"page\"]": {
|
|
44
|
+
color: p.color.text,
|
|
45
|
+
fontWeight: p.fontWeight.medium
|
|
46
|
+
}
|
|
47
|
+
}), C = e({
|
|
48
|
+
textDecoration: "underline",
|
|
49
|
+
textDecorationColor: "transparent",
|
|
50
|
+
textUnderlineOffset: "0.2em",
|
|
51
|
+
transitionProperty: "color, text-decoration-color",
|
|
52
|
+
transitionDuration: p.motion.duration.fast,
|
|
53
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
54
|
+
"&:hover": {
|
|
55
|
+
color: p.color.text,
|
|
56
|
+
textDecorationColor: "currentColor"
|
|
57
|
+
},
|
|
58
|
+
"&:focus-visible": { ...t },
|
|
59
|
+
[n]: { transitionDuration: "0s" }
|
|
60
|
+
}), w = i(function({ label: e = "Breadcrumb", separator: t = "/", children: n, ...r }, i) {
|
|
61
|
+
let o = d(/* @__PURE__ */ new Map()), [s, c] = f(null), l = d(null), p = a(() => {
|
|
62
|
+
let e = Array.from(o.current).sort(v), t = e.some(([, e]) => e.current === !0) ? null : e.at(-1)?.[0] ?? null;
|
|
63
|
+
l.current !== t && (l.current = t, c(t));
|
|
64
|
+
}, []), h = a((e, t) => {
|
|
65
|
+
o.current.set(e, t), p();
|
|
66
|
+
}, [p]), _ = a((e) => {
|
|
67
|
+
o.current.delete(e), p();
|
|
68
|
+
}, [p]), b = u(() => ({
|
|
69
|
+
separator: t,
|
|
70
|
+
autoCurrentId: s,
|
|
71
|
+
register: h,
|
|
72
|
+
unregister: _
|
|
73
|
+
}), [
|
|
74
|
+
t,
|
|
75
|
+
s,
|
|
76
|
+
h,
|
|
77
|
+
_
|
|
78
|
+
]);
|
|
79
|
+
return /* @__PURE__ */ m(g.Provider, {
|
|
80
|
+
value: b,
|
|
81
|
+
children: /* @__PURE__ */ m("nav", {
|
|
82
|
+
...r,
|
|
83
|
+
ref: i,
|
|
84
|
+
"aria-label": e,
|
|
85
|
+
"data-ui": "breadcrumbs",
|
|
86
|
+
children: /* @__PURE__ */ m("ol", {
|
|
87
|
+
css: y,
|
|
88
|
+
children: n
|
|
89
|
+
})
|
|
90
|
+
})
|
|
91
|
+
});
|
|
92
|
+
}), T = i(function({ href: e, current: t, children: n, ...r }, i) {
|
|
93
|
+
let { separator: a, autoCurrentId: o, register: u, unregister: f } = _("Item"), p = s(), g = d(null);
|
|
94
|
+
c(i, () => g.current, []), l(() => {
|
|
95
|
+
let e = g.current;
|
|
96
|
+
e && u(p, {
|
|
97
|
+
node: e,
|
|
98
|
+
current: t
|
|
99
|
+
});
|
|
100
|
+
}), l(() => () => f(p), [p, f]);
|
|
101
|
+
let v = t ?? o === p ? "page" : void 0;
|
|
102
|
+
return /* @__PURE__ */ h("li", {
|
|
103
|
+
...r,
|
|
104
|
+
ref: g,
|
|
105
|
+
"data-ui": "breadcrumbs-item",
|
|
106
|
+
css: b,
|
|
107
|
+
children: [/* @__PURE__ */ m("span", {
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
"data-ui": "breadcrumbs-separator",
|
|
110
|
+
css: x,
|
|
111
|
+
children: a
|
|
112
|
+
}), e === void 0 ? /* @__PURE__ */ m("span", {
|
|
113
|
+
"aria-current": v,
|
|
114
|
+
css: S,
|
|
115
|
+
children: n
|
|
116
|
+
}) : /* @__PURE__ */ m("a", {
|
|
117
|
+
href: e,
|
|
118
|
+
"aria-current": v,
|
|
119
|
+
css: [S, C],
|
|
120
|
+
children: n
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
}), E = Object.assign(w, { Item: T });
|
|
124
|
+
//#endregion
|
|
125
|
+
export { E as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Breadcrumbs } from "./breadcrumbs-5MCZ_Jr3.js";
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { n as t } from "./focus-ring-qOS3rPlM.js";
|
|
3
|
+
import { n } from "./media-8K3xDAxM.js";
|
|
4
|
+
import { t as r } from "./icon-wrapper-BKo4FI-O.js";
|
|
5
|
+
import { n as i, t as a } from "./loading-ring-CTpT-IrT.js";
|
|
6
|
+
import { forwardRef as o } from "react";
|
|
7
|
+
import { vars as s } from "@jfrader/tokens/vars";
|
|
8
|
+
import { Fragment as c, jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
|
|
9
|
+
import { useMergeRefs as d } from "@floating-ui/react";
|
|
10
|
+
//#region src/components/button/button.tsx
|
|
11
|
+
var f = "&:hover:not(:disabled):not([aria-disabled=\"true\"])", p = e({
|
|
12
|
+
display: "inline-flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
justifyContent: "center",
|
|
15
|
+
gap: s.space[2],
|
|
16
|
+
border: "1px solid transparent",
|
|
17
|
+
borderRadius: s.radius.md,
|
|
18
|
+
fontFamily: s.font.sans,
|
|
19
|
+
fontWeight: s.fontWeight.medium,
|
|
20
|
+
lineHeight: s.lineHeight.tight,
|
|
21
|
+
letterSpacing: "-0.011em",
|
|
22
|
+
whiteSpace: "nowrap",
|
|
23
|
+
cursor: "pointer",
|
|
24
|
+
transitionProperty: "background-color, border-color, color",
|
|
25
|
+
transitionDuration: s.motion.duration.fast,
|
|
26
|
+
transitionTimingFunction: s.motion.easeStandard,
|
|
27
|
+
"&:focus-visible": { ...t },
|
|
28
|
+
"&:disabled, &[aria-disabled=\"true\"]": {
|
|
29
|
+
cursor: "not-allowed",
|
|
30
|
+
opacity: .55
|
|
31
|
+
},
|
|
32
|
+
[n]: { transitionDuration: "0s" }
|
|
33
|
+
}), m = {
|
|
34
|
+
sm: e({
|
|
35
|
+
blockSize: "32px",
|
|
36
|
+
paddingInline: s.space[3],
|
|
37
|
+
fontSize: s.textSize.sm
|
|
38
|
+
}),
|
|
39
|
+
md: e({
|
|
40
|
+
blockSize: "40px",
|
|
41
|
+
paddingInline: s.space[4],
|
|
42
|
+
fontSize: s.textSize.sm
|
|
43
|
+
}),
|
|
44
|
+
lg: e({
|
|
45
|
+
blockSize: "48px",
|
|
46
|
+
paddingInline: s.space[5],
|
|
47
|
+
fontSize: s.textSize.md
|
|
48
|
+
})
|
|
49
|
+
}, h = {
|
|
50
|
+
solid: {
|
|
51
|
+
accent: e({
|
|
52
|
+
backgroundColor: s.color.accent,
|
|
53
|
+
color: s.color.accentContrast,
|
|
54
|
+
[f]: { backgroundColor: s.color.accentHover }
|
|
55
|
+
}),
|
|
56
|
+
danger: e({
|
|
57
|
+
backgroundColor: s.color.danger,
|
|
58
|
+
color: s.color.dangerContrast,
|
|
59
|
+
[f]: { backgroundColor: s.color.dangerHover }
|
|
60
|
+
}),
|
|
61
|
+
neutral: e({
|
|
62
|
+
backgroundColor: s.color.surfaceRaised,
|
|
63
|
+
color: s.color.text,
|
|
64
|
+
borderColor: s.color.border,
|
|
65
|
+
[f]: { backgroundColor: s.color.surfaceHover }
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
soft: {
|
|
69
|
+
accent: e({
|
|
70
|
+
backgroundColor: s.color.accentSoft,
|
|
71
|
+
color: s.color.accentText,
|
|
72
|
+
[f]: { backgroundColor: s.color.accentSoftHover }
|
|
73
|
+
}),
|
|
74
|
+
danger: e({
|
|
75
|
+
backgroundColor: s.color.dangerSoft,
|
|
76
|
+
color: s.color.dangerText,
|
|
77
|
+
[f]: { backgroundColor: s.color.dangerSoftHover }
|
|
78
|
+
}),
|
|
79
|
+
neutral: e({
|
|
80
|
+
backgroundColor: s.color.surfaceHover,
|
|
81
|
+
color: s.color.text,
|
|
82
|
+
[f]: { backgroundColor: s.color.surfaceRaised }
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
outline: {
|
|
86
|
+
accent: e({
|
|
87
|
+
backgroundColor: "transparent",
|
|
88
|
+
borderColor: s.color.accentBorder,
|
|
89
|
+
color: s.color.accentText,
|
|
90
|
+
[f]: { backgroundColor: s.color.accentSoft }
|
|
91
|
+
}),
|
|
92
|
+
danger: e({
|
|
93
|
+
backgroundColor: "transparent",
|
|
94
|
+
borderColor: s.color.dangerBorder,
|
|
95
|
+
color: s.color.dangerText,
|
|
96
|
+
[f]: { backgroundColor: s.color.dangerSoft }
|
|
97
|
+
}),
|
|
98
|
+
neutral: e({
|
|
99
|
+
backgroundColor: "transparent",
|
|
100
|
+
borderColor: s.color.borderStrong,
|
|
101
|
+
color: s.color.text,
|
|
102
|
+
[f]: { backgroundColor: s.color.surfaceHover }
|
|
103
|
+
})
|
|
104
|
+
},
|
|
105
|
+
ghost: {
|
|
106
|
+
accent: e({
|
|
107
|
+
backgroundColor: "transparent",
|
|
108
|
+
color: s.color.accentText,
|
|
109
|
+
[f]: { backgroundColor: s.color.accentSoft }
|
|
110
|
+
}),
|
|
111
|
+
danger: e({
|
|
112
|
+
backgroundColor: "transparent",
|
|
113
|
+
color: s.color.dangerText,
|
|
114
|
+
[f]: { backgroundColor: s.color.dangerSoft }
|
|
115
|
+
}),
|
|
116
|
+
neutral: e({
|
|
117
|
+
backgroundColor: "transparent",
|
|
118
|
+
color: s.color.textMuted,
|
|
119
|
+
[f]: {
|
|
120
|
+
backgroundColor: s.color.surfaceHover,
|
|
121
|
+
color: s.color.text
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
}
|
|
125
|
+
}, g = e({
|
|
126
|
+
boxSizing: "border-box",
|
|
127
|
+
textDecoration: "none"
|
|
128
|
+
}), _ = e({
|
|
129
|
+
...a,
|
|
130
|
+
inlineSize: "1em",
|
|
131
|
+
blockSize: "1em",
|
|
132
|
+
[n]: { animation: `${i} 1.2s ease-in-out infinite alternate` }
|
|
133
|
+
}), v = o(function({ variant: e = "solid", tone: t = "neutral", size: n = "md", loading: i = !1, startIcon: a, endIcon: o, type: s, children: f, onClick: v, css: y, render: b, ...x }, S) {
|
|
134
|
+
let { "data-ui": C, ...w } = x, T = b && C !== void 0 ? `${C} button` : "button", E = d([S]), D = w["aria-disabled"], O = i || D === !0 || D === "true" || b !== void 0 && w.disabled === !0, k = v, A = (e) => {
|
|
135
|
+
O ? e.preventDefault() : k?.(e);
|
|
136
|
+
}, j = i ? /* @__PURE__ */ l("span", { css: _ }) : a, M = /* @__PURE__ */ u(c, { children: [
|
|
137
|
+
j != null && /* @__PURE__ */ l("span", {
|
|
138
|
+
css: r,
|
|
139
|
+
"aria-hidden": !0,
|
|
140
|
+
children: j
|
|
141
|
+
}),
|
|
142
|
+
f,
|
|
143
|
+
o != null && /* @__PURE__ */ l("span", {
|
|
144
|
+
css: r,
|
|
145
|
+
"aria-hidden": !0,
|
|
146
|
+
children: o
|
|
147
|
+
})
|
|
148
|
+
] });
|
|
149
|
+
if (b) {
|
|
150
|
+
let { disabled: r, ...a } = w;
|
|
151
|
+
return b({
|
|
152
|
+
...a,
|
|
153
|
+
ref: E,
|
|
154
|
+
type: s,
|
|
155
|
+
"data-ui": T,
|
|
156
|
+
"aria-busy": i ? !0 : w["aria-busy"],
|
|
157
|
+
"aria-disabled": O ? !0 : D,
|
|
158
|
+
onClick: A,
|
|
159
|
+
css: [
|
|
160
|
+
p,
|
|
161
|
+
g,
|
|
162
|
+
m[n],
|
|
163
|
+
h[e][t],
|
|
164
|
+
y
|
|
165
|
+
],
|
|
166
|
+
children: M
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return /* @__PURE__ */ l("button", {
|
|
170
|
+
...w,
|
|
171
|
+
ref: S,
|
|
172
|
+
type: s ?? "button",
|
|
173
|
+
"data-ui": T,
|
|
174
|
+
"aria-busy": i ? !0 : w["aria-busy"],
|
|
175
|
+
"aria-disabled": O ? !0 : D,
|
|
176
|
+
onClick: A,
|
|
177
|
+
css: [
|
|
178
|
+
p,
|
|
179
|
+
m[n],
|
|
180
|
+
h[e][t],
|
|
181
|
+
y
|
|
182
|
+
],
|
|
183
|
+
children: M
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
//#endregion
|
|
187
|
+
export { v as t };
|
package/dist/button.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Button } from "./button-qy-50NPd.js";
|
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
import { n as t } from "./focus-ring-qOS3rPlM.js";
|
|
3
|
+
import { n, t as r } from "./media-8K3xDAxM.js";
|
|
4
|
+
import { t as i } from "./use-controlled-state-DQXkiTQI.js";
|
|
5
|
+
import { createContext as a, forwardRef as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
6
|
+
import { vars as h } from "@jfrader/tokens/vars";
|
|
7
|
+
import { jsx as g, jsxs as _ } from "@emotion/react/jsx-runtime";
|
|
8
|
+
//#region src/components/calendar/calendar.styles.ts
|
|
9
|
+
var v = e({
|
|
10
|
+
display: "inline-flex",
|
|
11
|
+
flexDirection: "column",
|
|
12
|
+
gap: h.space[2],
|
|
13
|
+
fontFamily: h.font.sans,
|
|
14
|
+
color: h.color.text
|
|
15
|
+
}), y = e({
|
|
16
|
+
display: "flex",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
gap: h.space[2]
|
|
19
|
+
}), b = e({
|
|
20
|
+
flex: 1,
|
|
21
|
+
textAlign: "center",
|
|
22
|
+
fontSize: h.textSize.sm,
|
|
23
|
+
fontWeight: h.fontWeight.semibold
|
|
24
|
+
}), x = {
|
|
25
|
+
transitionDuration: h.motion.duration.fast,
|
|
26
|
+
transitionTimingFunction: h.motion.easeStandard,
|
|
27
|
+
[n]: { transitionDuration: "0s" }
|
|
28
|
+
}, S = e({
|
|
29
|
+
appearance: "none",
|
|
30
|
+
display: "inline-flex",
|
|
31
|
+
alignItems: "center",
|
|
32
|
+
justifyContent: "center",
|
|
33
|
+
inlineSize: "32px",
|
|
34
|
+
blockSize: "32px",
|
|
35
|
+
padding: 0,
|
|
36
|
+
border: `1px solid ${h.color.borderControl}`,
|
|
37
|
+
borderRadius: h.radius.sm,
|
|
38
|
+
backgroundColor: "transparent",
|
|
39
|
+
font: "inherit",
|
|
40
|
+
fontSize: h.textSize.lg,
|
|
41
|
+
lineHeight: 1,
|
|
42
|
+
color: h.color.text,
|
|
43
|
+
cursor: "pointer",
|
|
44
|
+
transitionProperty: "background-color",
|
|
45
|
+
...x,
|
|
46
|
+
"&:hover:not([aria-disabled=\"true\"])": { backgroundColor: h.color.surfaceHover },
|
|
47
|
+
"&[aria-disabled=\"true\"]": {
|
|
48
|
+
opacity: .55,
|
|
49
|
+
cursor: "not-allowed"
|
|
50
|
+
},
|
|
51
|
+
"&:focus-visible": { ...t }
|
|
52
|
+
}), C = e({
|
|
53
|
+
display: "inline-block",
|
|
54
|
+
"&:dir(rtl)": { transform: "scaleX(-1)" }
|
|
55
|
+
}), w = e({
|
|
56
|
+
borderCollapse: "separate",
|
|
57
|
+
borderSpacing: h.space[1],
|
|
58
|
+
marginInline: `calc(-1 * ${h.space[1]})`
|
|
59
|
+
}), T = e({
|
|
60
|
+
paddingBlock: h.space[1],
|
|
61
|
+
fontSize: h.textSize.xs,
|
|
62
|
+
fontWeight: h.fontWeight.medium,
|
|
63
|
+
color: h.color.textMuted,
|
|
64
|
+
textAlign: "center"
|
|
65
|
+
}), E = e({ padding: 0 }), D = e({
|
|
66
|
+
appearance: "none",
|
|
67
|
+
display: "inline-flex",
|
|
68
|
+
alignItems: "center",
|
|
69
|
+
justifyContent: "center",
|
|
70
|
+
inlineSize: "36px",
|
|
71
|
+
blockSize: "36px",
|
|
72
|
+
padding: 0,
|
|
73
|
+
border: "1px solid transparent",
|
|
74
|
+
borderRadius: h.radius.sm,
|
|
75
|
+
backgroundColor: "transparent",
|
|
76
|
+
font: "inherit",
|
|
77
|
+
fontSize: h.textSize.sm,
|
|
78
|
+
fontVariantNumeric: "tabular-nums",
|
|
79
|
+
color: h.color.text,
|
|
80
|
+
cursor: "pointer",
|
|
81
|
+
transitionProperty: "background-color, border-color, color",
|
|
82
|
+
...x,
|
|
83
|
+
"&:hover:not(:disabled):not([data-selected])": { backgroundColor: h.color.surfaceHover },
|
|
84
|
+
"&[data-today]": {
|
|
85
|
+
borderColor: h.color.borderControl,
|
|
86
|
+
fontWeight: h.fontWeight.semibold
|
|
87
|
+
},
|
|
88
|
+
"&[data-selected]": {
|
|
89
|
+
backgroundColor: h.color.accent,
|
|
90
|
+
borderColor: h.color.accent,
|
|
91
|
+
color: h.color.accentContrast,
|
|
92
|
+
fontWeight: h.fontWeight.semibold
|
|
93
|
+
},
|
|
94
|
+
"&[data-selected]:hover": { backgroundColor: h.color.accentHover },
|
|
95
|
+
"&:disabled": {
|
|
96
|
+
opacity: .55,
|
|
97
|
+
cursor: "not-allowed",
|
|
98
|
+
textDecoration: "line-through"
|
|
99
|
+
},
|
|
100
|
+
"&:focus-visible": { ...t },
|
|
101
|
+
[r]: { "&[data-selected]": {
|
|
102
|
+
forcedColorAdjust: "none",
|
|
103
|
+
backgroundColor: "Highlight",
|
|
104
|
+
borderColor: "Highlight",
|
|
105
|
+
color: "HighlightText"
|
|
106
|
+
} }
|
|
107
|
+
}), O = /^\d{4}-\d{2}-\d{2}$/, k = /^\d{4}-\d{2}$/, A = 12, j = 0, M = "2026-01-04", N = (e, t) => String(e).padStart(t, "0");
|
|
108
|
+
function P(e, t, n) {
|
|
109
|
+
let r = new Date(Date.UTC(0, 0, 1));
|
|
110
|
+
return r.setUTCFullYear(e, t, n), r;
|
|
111
|
+
}
|
|
112
|
+
function F(e) {
|
|
113
|
+
let [t = NaN, n = NaN, r = 1] = e.split("-").map(Number);
|
|
114
|
+
return P(t, n - 1, r);
|
|
115
|
+
}
|
|
116
|
+
var I = (e) => `${N(e.getUTCFullYear(), 4)}-${N(e.getUTCMonth() + 1, 2)}-${N(e.getUTCDate(), 2)}`, L = (e) => e !== void 0 && O.test(e) && I(F(e)) === e, R = (e) => e !== void 0 && k.test(e) && L(`${e}-01`), z = (e) => e.slice(0, 7), B = (e) => `${e}-01`;
|
|
117
|
+
function V(e, t) {
|
|
118
|
+
let n = F(e);
|
|
119
|
+
return I(P(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + t));
|
|
120
|
+
}
|
|
121
|
+
function H(e, t) {
|
|
122
|
+
let n = F(e), r = P(n.getUTCFullYear(), n.getUTCMonth() + t, 1), i = P(r.getUTCFullYear(), r.getUTCMonth() + 1, 0).getUTCDate();
|
|
123
|
+
return I(P(r.getUTCFullYear(), r.getUTCMonth(), Math.min(n.getUTCDate(), i)));
|
|
124
|
+
}
|
|
125
|
+
var U = (e, t) => z(H(B(e), t)), W = (e) => V(B(U(e, 1)), -1), G = (e, t, n) => (t === void 0 || e >= t) && (n === void 0 || e <= n);
|
|
126
|
+
function ee(e, t, n) {
|
|
127
|
+
return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
|
|
128
|
+
}
|
|
129
|
+
var K = (e, t) => (F(e).getUTCDay() - t + 7) % 7;
|
|
130
|
+
function te(e) {
|
|
131
|
+
let t = new Intl.Locale(e), n = t.getWeekInfo?.() ?? t.weekInfo;
|
|
132
|
+
return n ? n.firstDay % 7 : j;
|
|
133
|
+
}
|
|
134
|
+
var q = {
|
|
135
|
+
calendar: "gregory",
|
|
136
|
+
timeZone: "UTC"
|
|
137
|
+
};
|
|
138
|
+
function ne(e) {
|
|
139
|
+
return {
|
|
140
|
+
month: new Intl.DateTimeFormat(e, {
|
|
141
|
+
...q,
|
|
142
|
+
month: "long",
|
|
143
|
+
year: "numeric"
|
|
144
|
+
}),
|
|
145
|
+
day: new Intl.DateTimeFormat(e, {
|
|
146
|
+
...q,
|
|
147
|
+
day: "numeric"
|
|
148
|
+
}),
|
|
149
|
+
date: new Intl.DateTimeFormat(e, {
|
|
150
|
+
...q,
|
|
151
|
+
dateStyle: "long"
|
|
152
|
+
}),
|
|
153
|
+
weekdayShort: new Intl.DateTimeFormat(e, {
|
|
154
|
+
...q,
|
|
155
|
+
weekday: "short"
|
|
156
|
+
}),
|
|
157
|
+
weekdayLong: new Intl.DateTimeFormat(e, {
|
|
158
|
+
...q,
|
|
159
|
+
weekday: "long"
|
|
160
|
+
})
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
var re = () => typeof navigator > "u" ? void 0 : navigator.language, J = (e) => (t) => V(t, e), Y = (e) => (t, { shiftKey: n }) => H(t, n ? e * A : e), X = {
|
|
164
|
+
ArrowDown: J(7),
|
|
165
|
+
ArrowUp: J(-7),
|
|
166
|
+
Home: (e, { firstDayOfWeek: t }) => V(e, -K(e, t)),
|
|
167
|
+
End: (e, { firstDayOfWeek: t }) => V(e, 6 - K(e, t)),
|
|
168
|
+
PageUp: Y(-1),
|
|
169
|
+
PageDown: Y(1)
|
|
170
|
+
}, ie = {
|
|
171
|
+
ltr: {
|
|
172
|
+
...X,
|
|
173
|
+
ArrowRight: J(1),
|
|
174
|
+
ArrowLeft: J(-1)
|
|
175
|
+
},
|
|
176
|
+
rtl: {
|
|
177
|
+
...X,
|
|
178
|
+
ArrowRight: J(-1),
|
|
179
|
+
ArrowLeft: J(1)
|
|
180
|
+
}
|
|
181
|
+
}, Z = a(null);
|
|
182
|
+
function Q(e) {
|
|
183
|
+
let t = s(Z);
|
|
184
|
+
if (!t) throw Error(`Calendar.${e} must be rendered inside <Calendar>.`);
|
|
185
|
+
return t;
|
|
186
|
+
}
|
|
187
|
+
var $ = "‹", ae = "›", oe = o(function({ value: e, defaultValue: t, onValueChange: n, visibleMonth: r, defaultVisibleMonth: a, onVisibleMonthChange: o, min: s, max: c, locale: u, firstDayOfWeek: d, ...p }, h) {
|
|
188
|
+
let _ = `${l()}-label`, y = /* @__PURE__ */ new Date(), b = I(P(y.getFullYear(), y.getMonth(), y.getDate())), x = f(() => new Intl.DateTimeFormat(u ?? re(), q).resolvedOptions().locale, [u]), S = f(() => ne(x), [x]), C = f(() => te(x), [x]), w = d ?? C, [T, E] = i(e, t, n), D = e ?? t, [O, k] = i(r, a ?? z(L(D) ? D : b), o), A = R(O) ? O : z(b), j = L(s) ? s : void 0, M = L(c) ? c : void 0, [N, F] = m(null), [B, V] = m(!1), H = f(() => ({
|
|
189
|
+
value: T,
|
|
190
|
+
visibleMonth: A,
|
|
191
|
+
today: b,
|
|
192
|
+
min: j,
|
|
193
|
+
max: M,
|
|
194
|
+
firstDayOfWeek: w,
|
|
195
|
+
formatters: S,
|
|
196
|
+
focus: N,
|
|
197
|
+
setFocus: F,
|
|
198
|
+
requestValue: E,
|
|
199
|
+
requestVisibleMonth: k,
|
|
200
|
+
labelId: _,
|
|
201
|
+
hasHeader: B,
|
|
202
|
+
setHasHeader: V
|
|
203
|
+
}), [
|
|
204
|
+
T,
|
|
205
|
+
A,
|
|
206
|
+
b,
|
|
207
|
+
j,
|
|
208
|
+
M,
|
|
209
|
+
w,
|
|
210
|
+
S,
|
|
211
|
+
N,
|
|
212
|
+
E,
|
|
213
|
+
k,
|
|
214
|
+
_,
|
|
215
|
+
B
|
|
216
|
+
]);
|
|
217
|
+
return /* @__PURE__ */ g(Z.Provider, {
|
|
218
|
+
value: H,
|
|
219
|
+
children: /* @__PURE__ */ g("div", {
|
|
220
|
+
...p,
|
|
221
|
+
ref: h,
|
|
222
|
+
"data-ui": "calendar",
|
|
223
|
+
css: v
|
|
224
|
+
})
|
|
225
|
+
});
|
|
226
|
+
}), se = o(function(e, t) {
|
|
227
|
+
let { visibleMonth: n, min: r, max: i, formatters: a, requestVisibleMonth: o, labelId: s, setHasHeader: c } = Q("Header");
|
|
228
|
+
d(() => (c(!0), () => c(!1)), [c]);
|
|
229
|
+
let l = U(n, -1), u = U(n, 1), f = r !== void 0 && W(l) < r, p = i !== void 0 && B(u) > i, m = (e) => a.month.format(F(B(e)));
|
|
230
|
+
return /* @__PURE__ */ _("div", {
|
|
231
|
+
...e,
|
|
232
|
+
ref: t,
|
|
233
|
+
"data-ui": "calendar-header",
|
|
234
|
+
css: y,
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ g("button", {
|
|
237
|
+
type: "button",
|
|
238
|
+
"data-ui": "calendar-previous",
|
|
239
|
+
"aria-label": m(l),
|
|
240
|
+
"aria-disabled": f || void 0,
|
|
241
|
+
onClick: () => {
|
|
242
|
+
f || o(l);
|
|
243
|
+
},
|
|
244
|
+
css: S,
|
|
245
|
+
children: /* @__PURE__ */ g("span", {
|
|
246
|
+
"aria-hidden": "true",
|
|
247
|
+
css: C,
|
|
248
|
+
children: $
|
|
249
|
+
})
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ g("span", {
|
|
252
|
+
id: s,
|
|
253
|
+
"aria-live": "polite",
|
|
254
|
+
"aria-atomic": "true",
|
|
255
|
+
"data-ui": "calendar-label",
|
|
256
|
+
css: b,
|
|
257
|
+
children: m(n)
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ g("button", {
|
|
260
|
+
type: "button",
|
|
261
|
+
"data-ui": "calendar-next",
|
|
262
|
+
"aria-label": m(u),
|
|
263
|
+
"aria-disabled": p || void 0,
|
|
264
|
+
onClick: () => {
|
|
265
|
+
p || o(u);
|
|
266
|
+
},
|
|
267
|
+
css: S,
|
|
268
|
+
children: /* @__PURE__ */ g("span", {
|
|
269
|
+
"aria-hidden": "true",
|
|
270
|
+
css: C,
|
|
271
|
+
children: ae
|
|
272
|
+
})
|
|
273
|
+
})
|
|
274
|
+
]
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
function ce({ date: e, isTabStop: t }) {
|
|
278
|
+
let { value: n, today: r, min: i, max: a, formatters: o, setFocus: s, requestValue: c } = Q("Grid"), l = n === e, u = r === e, d = F(e);
|
|
279
|
+
return /* @__PURE__ */ g("td", {
|
|
280
|
+
role: "gridcell",
|
|
281
|
+
"aria-selected": l || void 0,
|
|
282
|
+
css: E,
|
|
283
|
+
children: /* @__PURE__ */ g("button", {
|
|
284
|
+
type: "button",
|
|
285
|
+
"data-ui": "calendar-day",
|
|
286
|
+
"data-date": e,
|
|
287
|
+
"data-today": u || void 0,
|
|
288
|
+
"data-selected": l || void 0,
|
|
289
|
+
"aria-current": u ? "date" : void 0,
|
|
290
|
+
"aria-label": o.date.format(d),
|
|
291
|
+
tabIndex: t ? 0 : -1,
|
|
292
|
+
disabled: !G(e, i, a),
|
|
293
|
+
onFocus: () => s({
|
|
294
|
+
date: e,
|
|
295
|
+
fallback: e
|
|
296
|
+
}),
|
|
297
|
+
onClick: () => {
|
|
298
|
+
s({
|
|
299
|
+
date: e,
|
|
300
|
+
fallback: e
|
|
301
|
+
}), c(e);
|
|
302
|
+
},
|
|
303
|
+
css: D,
|
|
304
|
+
children: o.day.format(d)
|
|
305
|
+
})
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
var le = o(function({ onKeyDown: e, "aria-labelledby": t, "aria-label": n, ...r }, i) {
|
|
309
|
+
let { value: a, visibleMonth: o, today: s, min: l, max: d, firstDayOfWeek: f, formatters: m, focus: h, setFocus: v, requestVisibleMonth: y, labelId: b, hasHeader: x } = Q("Grid"), S = p(null);
|
|
310
|
+
u(i, () => S.current, []);
|
|
311
|
+
let C = p(!1), D = B(o), O = F(W(o)).getUTCDate(), k = Array.from({ length: O }, (e, t) => V(D, t)), A = (e) => e !== void 0 && k.includes(e) && G(e, l, d), j = [
|
|
312
|
+
h?.date,
|
|
313
|
+
h?.fallback,
|
|
314
|
+
a,
|
|
315
|
+
s
|
|
316
|
+
].find(A) ?? k.find((e) => G(e, l, d)), N = [...Array(K(D, f)).fill(null), ...k], P = Array.from({ length: Math.ceil(N.length / 7) }, (e, t) => Array.from({ length: 7 }, (e, n) => N[t * 7 + n] ?? null)), I = Array.from({ length: 7 }, (e, t) => F(V(M, (f + t) % 7)));
|
|
317
|
+
c(() => {
|
|
318
|
+
C.current && (C.current = !1, S.current?.querySelector(`[data-date="${j}"]`)?.focus());
|
|
319
|
+
});
|
|
320
|
+
let L = (t) => {
|
|
321
|
+
e?.(t);
|
|
322
|
+
let n = S.current;
|
|
323
|
+
if (t.defaultPrevented || !n) return;
|
|
324
|
+
let r = t.target.dataset.date;
|
|
325
|
+
if (!A(r)) return;
|
|
326
|
+
let i = ie[getComputedStyle(n).direction === "rtl" ? "rtl" : "ltr"][t.key];
|
|
327
|
+
if (!i) return;
|
|
328
|
+
t.preventDefault();
|
|
329
|
+
let a = ee(i(r, {
|
|
330
|
+
firstDayOfWeek: f,
|
|
331
|
+
shiftKey: t.shiftKey
|
|
332
|
+
}), l, d);
|
|
333
|
+
a !== r && (v({
|
|
334
|
+
date: a,
|
|
335
|
+
fallback: r
|
|
336
|
+
}), C.current = !0, z(a) !== o && y(z(a)));
|
|
337
|
+
}, R = [t, x ? b : void 0].filter(Boolean).join(" ") || void 0, H = m.month.format(F(D));
|
|
338
|
+
return /* @__PURE__ */ _("table", {
|
|
339
|
+
...r,
|
|
340
|
+
ref: S,
|
|
341
|
+
role: "grid",
|
|
342
|
+
"aria-labelledby": R,
|
|
343
|
+
"aria-label": R === void 0 ? n ?? H : n,
|
|
344
|
+
"data-ui": "calendar-grid",
|
|
345
|
+
onKeyDown: L,
|
|
346
|
+
css: w,
|
|
347
|
+
children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ g("tr", {
|
|
348
|
+
role: "row",
|
|
349
|
+
children: I.map((e) => /* @__PURE__ */ g("th", {
|
|
350
|
+
role: "columnheader",
|
|
351
|
+
scope: "col",
|
|
352
|
+
abbr: m.weekdayLong.format(e),
|
|
353
|
+
css: T,
|
|
354
|
+
children: m.weekdayShort.format(e)
|
|
355
|
+
}, e.getUTCDay()))
|
|
356
|
+
}) }), /* @__PURE__ */ g("tbody", { children: P.map((e, t) => /* @__PURE__ */ g("tr", {
|
|
357
|
+
role: "row",
|
|
358
|
+
children: e.map((e, t) => e === null ? /* @__PURE__ */ g("td", {
|
|
359
|
+
role: "gridcell",
|
|
360
|
+
css: E
|
|
361
|
+
}, `empty-${t}`) : /* @__PURE__ */ g(ce, {
|
|
362
|
+
date: e,
|
|
363
|
+
isTabStop: e === j
|
|
364
|
+
}, e))
|
|
365
|
+
}, t)) })]
|
|
366
|
+
});
|
|
367
|
+
}), ue = Object.assign(oe, {
|
|
368
|
+
Header: se,
|
|
369
|
+
Grid: le
|
|
370
|
+
});
|
|
371
|
+
//#endregion
|
|
372
|
+
export { ue as t };
|
package/dist/calendar.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Calendar } from "./calendar-DcCAiN3b.js";
|