@jfrader/ui 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion-Bd-j04hW.js +198 -0
- package/dist/accordion.js +1 -1
- package/dist/alert-BBqaKI4k.js +135 -0
- package/dist/alert.js +1 -1
- package/dist/avatar-BahDVO9t.js +132 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-B_sLygxU.js +108 -0
- package/dist/badge.js +1 -1
- package/dist/breadcrumbs-DVAOxfvL.js +141 -0
- package/dist/breadcrumbs.js +1 -1
- package/dist/button-P2e7_44z.js +200 -0
- package/dist/button.js +1 -1
- package/dist/calendar-C9Yad_-w.js +394 -0
- package/dist/calendar.js +1 -1
- package/dist/card-D-aI2QHx.js +158 -0
- package/dist/card.js +1 -1
- package/dist/checkbox-COYG6L7d.js +140 -0
- package/dist/checkbox.js +1 -1
- package/dist/{choice-control-ByFogYcT.js → choice-control-5kJkLXgv.js} +1 -1
- package/dist/{collection-registry-1l9f3XJZ.js → collection-registry-BTYi6zGh.js} +1 -1
- package/dist/combobox-DrmjBbo7.js +327 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-V_2pEay7.js +379 -0
- package/dist/command-palette.js +1 -1
- package/dist/container-BOaSptJa.js +41 -0
- package/dist/container.js +1 -1
- package/dist/date-picker-ClUYBIBh.js +250 -0
- package/dist/date-picker.js +1 -1
- package/dist/dialog-xaydbXl2.js +218 -0
- package/dist/dialog.js +1 -1
- package/dist/divider-DYoJf0I_.js +84 -0
- package/dist/divider.js +1 -1
- package/dist/field-anatomy-D2ToMeRa.js +109 -0
- package/dist/flex-Dh-_J5-U.js +28 -0
- package/dist/flex.js +1 -1
- package/dist/{icon-wrapper-CFWzew5m.js → icon-wrapper-stN8sD7R.js} +1 -1
- package/dist/index.js +38 -37
- package/dist/kbd-C3ACoMoE.js +71 -0
- package/dist/kbd.js +1 -1
- package/dist/{layout-style-7ZTOiWGR.js → layout-style-Cbd1Vilw.js} +1 -1
- package/dist/{loading-ring-BpdB0aFi.js → loading-ring-B8-30Dl1.js} +1 -1
- package/dist/menu-DU60SMdt.js +216 -0
- package/dist/menu.js +1 -1
- package/dist/navigation-DhnKriOp.js +197 -0
- package/dist/navigation.js +1 -1
- package/dist/pagination-DYdwsxwe.js +156 -0
- package/dist/pagination.js +1 -1
- package/dist/pill-DO2gHzMb.js +56 -0
- package/dist/pill.js +1 -1
- package/dist/popover-BtN_0ejj.js +113 -0
- package/dist/popover.js +1 -1
- package/dist/progress-BpJswTG4.js +90 -0
- package/dist/progress.js +1 -1
- package/dist/radio-group-Ce0_IWQr.js +145 -0
- package/dist/radio-group.js +1 -1
- package/dist/select-BCS0-LVW.js +286 -0
- package/dist/select.js +1 -1
- package/dist/skeleton-OoFlOEXO.js +54 -0
- package/dist/skeleton.js +1 -1
- package/dist/spinner-C2YDoiMn.js +56 -0
- package/dist/spinner.js +1 -1
- package/dist/stack-DC3IbtWk.js +27 -0
- package/dist/stack.js +1 -1
- package/dist/switch-Dr-qjmT4.js +142 -0
- package/dist/switch.js +1 -1
- package/dist/sx-Dx9JUKp5.js +23 -0
- package/dist/tabs-CK_g1RKa.js +203 -0
- package/dist/tabs.js +1 -1
- package/dist/{text-field-8PQAqRpM.js → text-field-D60ok14S.js} +19 -18
- package/dist/text-field.js +1 -1
- package/dist/{textarea-CcGWuntL.js → textarea-DyfjtP0A.js} +19 -18
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BiXXvQvr.js +42 -0
- package/dist/theme-root.js +1 -1
- package/dist/toast-iqelR-r0.js +282 -0
- package/dist/toast.js +1 -1
- package/dist/toggle-group-CI0e7hFm.js +166 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CB-HC1js.js +108 -0
- package/dist/tooltip.js +1 -1
- package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
- package/dist/types/components/accordion/accordion.d.ts +9 -8
- package/dist/types/components/alert/alert.d.ts +3 -2
- package/dist/types/components/avatar/avatar.d.ts +3 -2
- package/dist/types/components/badge/badge.d.ts +3 -2
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -4
- package/dist/types/components/button/button.d.ts +3 -2
- package/dist/types/components/calendar/calendar.d.ts +7 -6
- package/dist/types/components/card/card.d.ts +13 -12
- package/dist/types/components/checkbox/checkbox.d.ts +3 -2
- package/dist/types/components/combobox/combobox.d.ts +8 -7
- package/dist/types/components/command-palette/command-palette.d.ts +15 -14
- package/dist/types/components/container/container.d.ts +3 -2
- package/dist/types/components/date-picker/date-picker.d.ts +3 -2
- package/dist/types/components/dialog/dialog.d.ts +11 -10
- package/dist/types/components/divider/divider.d.ts +3 -2
- package/dist/types/components/field/field-anatomy.d.ts +3 -2
- package/dist/types/components/flex/flex.d.ts +3 -2
- package/dist/types/components/kbd/kbd.d.ts +5 -4
- package/dist/types/components/menu/menu.d.ts +9 -8
- package/dist/types/components/navigation/navigation.d.ts +7 -6
- package/dist/types/components/pagination/pagination.d.ts +3 -2
- package/dist/types/components/pill/pill.d.ts +3 -2
- package/dist/types/components/popover/popover.d.ts +5 -4
- package/dist/types/components/progress/progress.d.ts +3 -2
- package/dist/types/components/radio-group/radio-group.d.ts +5 -4
- package/dist/types/components/select/select.d.ts +9 -8
- package/dist/types/components/skeleton/skeleton.d.ts +3 -2
- package/dist/types/components/spinner/spinner.d.ts +3 -2
- package/dist/types/components/stack/stack.d.ts +1 -1
- package/dist/types/components/switch/switch.d.ts +3 -2
- package/dist/types/components/tabs/tabs.d.ts +9 -8
- package/dist/types/components/text-field/text-field.d.ts +3 -2
- package/dist/types/components/textarea/textarea.d.ts +3 -2
- package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
- package/dist/types/components/theme-root/theme-root.d.ts +3 -2
- package/dist/types/components/toast/toast.d.ts +3 -2
- package/dist/types/components/toggle-group/toggle-group.d.ts +5 -4
- package/dist/types/components/tooltip/tooltip.d.ts +5 -4
- package/dist/types/index.d.ts +4 -0
- package/dist/types/styling/css.d.ts +3 -2
- package/dist/types/styling/styled.d.ts +1 -0
- package/dist/types/styling/sx.d.ts +16 -0
- package/dist/types/styling/theme.d.ts +98 -0
- package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
- package/package.json +3 -2
- package/dist/accordion-CkOZ-tvs.js +0 -178
- package/dist/alert-Dsjx14UW.js +0 -131
- package/dist/avatar-BRGKkoSr.js +0 -127
- package/dist/badge-DLxUMsCx.js +0 -104
- package/dist/breadcrumbs-694hF_hm.js +0 -131
- package/dist/button-CoaIcykB.js +0 -190
- package/dist/calendar-Doj7PTdG.js +0 -379
- package/dist/card-2IM71XZj.js +0 -134
- package/dist/checkbox-B7xGNFzp.js +0 -136
- package/dist/combobox-Bjhxv5U3.js +0 -311
- package/dist/command-palette-BhJwm6cS.js +0 -344
- package/dist/container-BhnrGPu-.js +0 -36
- package/dist/css-Cgj6sCHn.js +0 -2
- package/dist/date-picker-Jk8SpoiO.js +0 -245
- package/dist/dialog-fhS07G41.js +0 -187
- package/dist/divider-v_78HYF5.js +0 -79
- package/dist/field-anatomy-BzGw1Ch9.js +0 -105
- package/dist/flex-COZzFqI8.js +0 -22
- package/dist/kbd-CeP8Kfvp.js +0 -61
- package/dist/menu-B6KCbLCr.js +0 -196
- package/dist/navigation-BDht6S2-.js +0 -182
- package/dist/pagination-B50PCaDU.js +0 -151
- package/dist/pill-2_XzBdkD.js +0 -51
- package/dist/popover-DRHbeIVq.js +0 -103
- package/dist/progress-CpsskKTD.js +0 -85
- package/dist/radio-group-DPI5KUCj.js +0 -136
- package/dist/select-C1xGrOhT.js +0 -266
- package/dist/skeleton-DitdP-yz.js +0 -49
- package/dist/spinner-CFq5HPoo.js +0 -51
- package/dist/stack-D_g6NJzo.js +0 -21
- package/dist/switch-B5TTU-oJ.js +0 -138
- package/dist/tabs-C26PWl2c.js +0 -183
- package/dist/theme-root-BRLIA4eb.js +0 -22
- package/dist/toast-B1PXuwZ4.js +0 -277
- package/dist/toggle-group-N_owicT0.js +0 -156
- package/dist/tooltip-BJPisf60.js +0 -98
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
-
import { t } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
-
import { t as n } from "./use-controlled-state-CVXDa-qM.js";
|
|
5
|
-
import { t as r } from "./visually-hidden-DCWhf0Cb.js";
|
|
6
|
-
import { t as i } from "./renderable-DzcIj1Lo.js";
|
|
7
|
-
import { a, r as o, s, t as c } from "./collection-registry-1l9f3XJZ.js";
|
|
8
|
-
import { t as l } from "./trigger-style-B1GFmH7M.js";
|
|
9
|
-
import { i as u, r as d, t as f } from "./use-native-dialog-DWpIUVO1.js";
|
|
10
|
-
import { n as p, t as m } from "./surface-DZ4d-2aL.js";
|
|
11
|
-
import { createContext as h, useCallback as g, useContext as _, useId as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
12
|
-
import { vars as S } from "@jfrader/tokens/vars";
|
|
13
|
-
import { jsx as C, jsxs as w } from "@emotion/react/jsx-runtime";
|
|
14
|
-
import { FloatingList as T, useFloatingRootContext as ee, useInteractions as te, useListNavigation as ne, useMergeRefs as E } from "@floating-ui/react";
|
|
15
|
-
//#region src/components/command-palette/command-palette.styles.ts
|
|
16
|
-
var D = e({
|
|
17
|
-
...m,
|
|
18
|
-
marginBlockStart: S.space[12]
|
|
19
|
-
}), O = e({
|
|
20
|
-
...p,
|
|
21
|
-
display: "flex",
|
|
22
|
-
flexDirection: "column",
|
|
23
|
-
borderRadius: S.radius.lg,
|
|
24
|
-
boxShadow: S.shadow.floating,
|
|
25
|
-
inlineSize: "min(560px, calc(100vw - 32px))"
|
|
26
|
-
}), k = e({
|
|
27
|
-
boxSizing: "border-box",
|
|
28
|
-
inlineSize: "100%",
|
|
29
|
-
blockSize: "48px",
|
|
30
|
-
margin: 0,
|
|
31
|
-
border: 0,
|
|
32
|
-
borderBlockEnd: `1px solid ${S.color.borderControl}`,
|
|
33
|
-
borderStartStartRadius: S.radius.lg,
|
|
34
|
-
borderStartEndRadius: S.radius.lg,
|
|
35
|
-
backgroundColor: "transparent",
|
|
36
|
-
paddingInline: S.space[4],
|
|
37
|
-
font: "inherit",
|
|
38
|
-
fontSize: S.textSize.md,
|
|
39
|
-
color: S.color.text,
|
|
40
|
-
"&::placeholder": { color: S.color.textSubtle },
|
|
41
|
-
"&:focus-visible": { ...t }
|
|
42
|
-
}), A = e({
|
|
43
|
-
boxSizing: "border-box",
|
|
44
|
-
display: "flex",
|
|
45
|
-
flexDirection: "column",
|
|
46
|
-
maxBlockSize: "320px",
|
|
47
|
-
overflow: "auto",
|
|
48
|
-
padding: S.space[1],
|
|
49
|
-
"&[hidden]": { display: "none" }
|
|
50
|
-
}), j = e({
|
|
51
|
-
display: "flex",
|
|
52
|
-
flexDirection: "column",
|
|
53
|
-
"&[hidden]": { display: "none" }
|
|
54
|
-
}), M = e({
|
|
55
|
-
paddingBlock: S.space[1],
|
|
56
|
-
paddingInline: S.space[2],
|
|
57
|
-
fontSize: S.textSize.xs,
|
|
58
|
-
fontWeight: S.fontWeight.medium,
|
|
59
|
-
color: S.color.textMuted
|
|
60
|
-
}), N = e({
|
|
61
|
-
"&:hover, &[data-active]": { backgroundColor: S.color.surfaceHover },
|
|
62
|
-
"&[hidden]": { display: "none" }
|
|
63
|
-
}), P = e({
|
|
64
|
-
paddingBlock: S.space[6],
|
|
65
|
-
paddingInline: S.space[4],
|
|
66
|
-
textAlign: "center",
|
|
67
|
-
fontSize: S.textSize.sm,
|
|
68
|
-
color: S.color.textMuted
|
|
69
|
-
}), re = "Command palette", ie = "No results", F = new Intl.PluralRules("en"), ae = (e, t) => e.toLocaleLowerCase().includes(t.toLocaleLowerCase()), oe = (e) => `${e} ${F.select(e) === "one" ? "result" : "results"}`, I = h(null), L = h(null);
|
|
70
|
-
function R(e) {
|
|
71
|
-
let t = _(I);
|
|
72
|
-
if (!t) throw Error(`CommandPalette.${e} must be rendered inside <CommandPalette>.`);
|
|
73
|
-
return t;
|
|
74
|
-
}
|
|
75
|
-
var z = (e) => {
|
|
76
|
-
e?.setAttribute("autofocus", "");
|
|
77
|
-
};
|
|
78
|
-
function B({ open: e, defaultOpen: t = !1, onOpenChange: r, label: i = re, filter: o = ae, emptyMessage: s = ie, formatResultCount: c = oe, children: l }) {
|
|
79
|
-
let d = v(), [f = !1, p] = n(e, t, r), { dialogElementRef: m, setDialogElement: h, setOpen: _, requestClose: S, repairToken: w } = u(f, p), [T, E] = x(""), [D, O] = x(!1), [k, A] = x(null), [j, M] = a(), [N, P] = x(null), [F, L] = x(null), [R, z] = x(f), B = b([]);
|
|
80
|
-
f !== R && (z(f), f && (E(""), O(!1), A(null)));
|
|
81
|
-
let V = g(() => {
|
|
82
|
-
_(!(f && m.current?.open));
|
|
83
|
-
}, [
|
|
84
|
-
f,
|
|
85
|
-
_,
|
|
86
|
-
m
|
|
87
|
-
]), { matchedValues: H, matchedIndices: U, visibleGroupIds: W } = y(() => {
|
|
88
|
-
let e = /* @__PURE__ */ new Set(), t = [], n = /* @__PURE__ */ new Set();
|
|
89
|
-
return j.forEach((r, i) => {
|
|
90
|
-
r.index !== -1 && (T === "" || o(r.label, T) || r.keywords !== void 0 && o(r.keywords, T)) && (e.add(i), t.push(r.index), r.groupId !== null && n.add(r.groupId));
|
|
91
|
-
}), t.sort((e, t) => e - t), {
|
|
92
|
-
matchedValues: e,
|
|
93
|
-
matchedIndices: t,
|
|
94
|
-
visibleGroupIds: n
|
|
95
|
-
};
|
|
96
|
-
}, [
|
|
97
|
-
j,
|
|
98
|
-
T,
|
|
99
|
-
o
|
|
100
|
-
]), G = y(() => new Set(U), [U]), K = k !== null && G.has(k) ? k : U[0] ?? null, q = ee({
|
|
101
|
-
open: f,
|
|
102
|
-
onOpenChange: (e) => _(e),
|
|
103
|
-
elements: {
|
|
104
|
-
reference: N,
|
|
105
|
-
floating: F
|
|
106
|
-
}
|
|
107
|
-
}), J = ne(q, {
|
|
108
|
-
listRef: B,
|
|
109
|
-
activeIndex: K,
|
|
110
|
-
onNavigate: (e) => {
|
|
111
|
-
e !== null && A(e);
|
|
112
|
-
},
|
|
113
|
-
virtual: !0,
|
|
114
|
-
loop: !0,
|
|
115
|
-
focusItemOnOpen: !1,
|
|
116
|
-
disabledIndices: (e) => !G.has(e)
|
|
117
|
-
}), { getReferenceProps: Y, getFloatingProps: X, getItemProps: Z } = te([J]), Q = U.length, $ = D ? c(Q) : "", se = y(() => ({
|
|
118
|
-
open: f,
|
|
119
|
-
setOpen: _,
|
|
120
|
-
toggleOpen: V,
|
|
121
|
-
requestClose: S,
|
|
122
|
-
repairToken: w,
|
|
123
|
-
setDialogElement: h,
|
|
124
|
-
label: i,
|
|
125
|
-
emptyMessage: s,
|
|
126
|
-
baseId: d,
|
|
127
|
-
listId: `${d}-list`,
|
|
128
|
-
query: T,
|
|
129
|
-
announcement: $,
|
|
130
|
-
matchCount: Q,
|
|
131
|
-
matchedValues: H,
|
|
132
|
-
visibleGroupIds: W,
|
|
133
|
-
activeIndex: K,
|
|
134
|
-
elementsRef: B,
|
|
135
|
-
setInputElement: P,
|
|
136
|
-
setListElement: L,
|
|
137
|
-
getReferenceProps: Y,
|
|
138
|
-
getFloatingProps: X,
|
|
139
|
-
getItemProps: Z,
|
|
140
|
-
changeQuery: (e) => {
|
|
141
|
-
E(e), O(!0), A(null);
|
|
142
|
-
},
|
|
143
|
-
moveToEdge: (e) => {
|
|
144
|
-
let t = e === "first" ? U[0] : U[U.length - 1];
|
|
145
|
-
t !== void 0 && A(t);
|
|
146
|
-
},
|
|
147
|
-
registration: M
|
|
148
|
-
}), [
|
|
149
|
-
f,
|
|
150
|
-
_,
|
|
151
|
-
V,
|
|
152
|
-
S,
|
|
153
|
-
w,
|
|
154
|
-
h,
|
|
155
|
-
i,
|
|
156
|
-
s,
|
|
157
|
-
d,
|
|
158
|
-
T,
|
|
159
|
-
$,
|
|
160
|
-
Q,
|
|
161
|
-
H,
|
|
162
|
-
U,
|
|
163
|
-
W,
|
|
164
|
-
K,
|
|
165
|
-
Y,
|
|
166
|
-
X,
|
|
167
|
-
Z,
|
|
168
|
-
M
|
|
169
|
-
]);
|
|
170
|
-
return /* @__PURE__ */ C(I.Provider, {
|
|
171
|
-
value: se,
|
|
172
|
-
children: l
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
B.displayName = "CommandPalette";
|
|
176
|
-
function V({ ref: e, onClick: t, ...n }) {
|
|
177
|
-
let { open: r, toggleOpen: i } = R("Trigger"), a = (e) => {
|
|
178
|
-
t?.(e), e.defaultPrevented || i();
|
|
179
|
-
};
|
|
180
|
-
return /* @__PURE__ */ C("button", {
|
|
181
|
-
type: "button",
|
|
182
|
-
...n,
|
|
183
|
-
ref: e,
|
|
184
|
-
"data-ui": "command-palette-trigger",
|
|
185
|
-
"aria-haspopup": "dialog",
|
|
186
|
-
"aria-expanded": r,
|
|
187
|
-
onClick: a,
|
|
188
|
-
css: l
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
V.displayName = "CommandPalette.Trigger";
|
|
192
|
-
function H({ ref: e, ...t }) {
|
|
193
|
-
let { children: n, onCancel: i, onClick: a, onClose: o, ...s } = f(t), c = R("Content"), { label: l, announcement: u } = c, p = d(c, {
|
|
194
|
-
onCancel: i,
|
|
195
|
-
onClick: a,
|
|
196
|
-
onClose: o
|
|
197
|
-
}, e);
|
|
198
|
-
return /* @__PURE__ */ C("dialog", {
|
|
199
|
-
"aria-label": l,
|
|
200
|
-
...s,
|
|
201
|
-
...p,
|
|
202
|
-
"data-ui": "command-palette",
|
|
203
|
-
"aria-modal": "true",
|
|
204
|
-
css: D,
|
|
205
|
-
children: /* @__PURE__ */ w("div", {
|
|
206
|
-
css: O,
|
|
207
|
-
children: [n, /* @__PURE__ */ C("div", {
|
|
208
|
-
role: "status",
|
|
209
|
-
"aria-live": "polite",
|
|
210
|
-
"aria-atomic": "true",
|
|
211
|
-
css: r,
|
|
212
|
-
children: u
|
|
213
|
-
})]
|
|
214
|
-
})
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
H.displayName = "CommandPalette.Content";
|
|
218
|
-
function U({ ref: e, onChange: t, onKeyDown: n, ...r }) {
|
|
219
|
-
let { label: i, listId: a, query: o, matchCount: s, activeIndex: c, elementsRef: l, requestClose: u, setInputElement: d, getReferenceProps: f, changeQuery: p, moveToEdge: m } = R("Input"), h = E([
|
|
220
|
-
d,
|
|
221
|
-
z,
|
|
222
|
-
e
|
|
223
|
-
]), g = (e) => {
|
|
224
|
-
t?.(e), p(e.currentTarget.value);
|
|
225
|
-
}, _ = (e) => {
|
|
226
|
-
n?.(e), !(e.defaultPrevented || e.nativeEvent.isComposing) && (e.key === "Escape" ? (e.preventDefault(), u()) : (e.key === "Home" || e.key === "End") && !e.shiftKey && !e.ctrlKey && !e.metaKey && !e.altKey ? (e.preventDefault(), m(e.key === "Home" ? "first" : "last")) : e.key === "Enter" && c !== null && (e.preventDefault(), l.current[c]?.click()));
|
|
227
|
-
};
|
|
228
|
-
return /* @__PURE__ */ C("input", {
|
|
229
|
-
"aria-label": i,
|
|
230
|
-
autoComplete: "off",
|
|
231
|
-
spellCheck: !1,
|
|
232
|
-
...f({
|
|
233
|
-
...r,
|
|
234
|
-
onChange: g,
|
|
235
|
-
onKeyDown: _
|
|
236
|
-
}),
|
|
237
|
-
ref: h,
|
|
238
|
-
type: "text",
|
|
239
|
-
value: o,
|
|
240
|
-
role: "combobox",
|
|
241
|
-
"aria-autocomplete": "list",
|
|
242
|
-
"aria-expanded": s > 0,
|
|
243
|
-
"aria-controls": a,
|
|
244
|
-
"data-ui": "command-palette-input",
|
|
245
|
-
css: k
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
U.displayName = "CommandPalette.Input";
|
|
249
|
-
function W({ ref: e, onMouseDown: t, children: n, ...r }) {
|
|
250
|
-
let { label: i, listId: a, matchCount: o, elementsRef: s, setListElement: c, getFloatingProps: l } = R("List"), u = E([c, e]), d = (e) => {
|
|
251
|
-
t?.(e), e.preventDefault();
|
|
252
|
-
};
|
|
253
|
-
return /* @__PURE__ */ C("div", {
|
|
254
|
-
"aria-label": i,
|
|
255
|
-
...l({
|
|
256
|
-
...r,
|
|
257
|
-
onMouseDown: d
|
|
258
|
-
}),
|
|
259
|
-
ref: u,
|
|
260
|
-
id: a,
|
|
261
|
-
role: "listbox",
|
|
262
|
-
hidden: o === 0,
|
|
263
|
-
"data-ui": "command-palette-list",
|
|
264
|
-
css: A,
|
|
265
|
-
children: /* @__PURE__ */ C(T, {
|
|
266
|
-
elementsRef: s,
|
|
267
|
-
children: n
|
|
268
|
-
})
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
W.displayName = "CommandPalette.List";
|
|
272
|
-
function G({ ref: e, children: t, ...n }) {
|
|
273
|
-
let { matchCount: r, emptyMessage: a } = R("Empty");
|
|
274
|
-
return r > 0 ? null : /* @__PURE__ */ C("div", {
|
|
275
|
-
...n,
|
|
276
|
-
ref: e,
|
|
277
|
-
"data-ui": "command-palette-empty",
|
|
278
|
-
css: P,
|
|
279
|
-
children: i(t) ? t : a
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
G.displayName = "CommandPalette.Empty";
|
|
283
|
-
function K({ ref: e, label: t, children: n, "aria-labelledby": r, ...i }) {
|
|
284
|
-
let { visibleGroupIds: a } = R("Group"), o = v(), s = `${o}-heading`;
|
|
285
|
-
return /* @__PURE__ */ w("div", {
|
|
286
|
-
...i,
|
|
287
|
-
ref: e,
|
|
288
|
-
role: "group",
|
|
289
|
-
"aria-labelledby": [r, s].filter(Boolean).join(" "),
|
|
290
|
-
hidden: !a.has(o),
|
|
291
|
-
"data-ui": "command-palette-group",
|
|
292
|
-
css: j,
|
|
293
|
-
children: [/* @__PURE__ */ C("div", {
|
|
294
|
-
id: s,
|
|
295
|
-
css: M,
|
|
296
|
-
children: t
|
|
297
|
-
}), /* @__PURE__ */ C(L.Provider, {
|
|
298
|
-
value: o,
|
|
299
|
-
children: n
|
|
300
|
-
})]
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
K.displayName = "CommandPalette.Group";
|
|
304
|
-
function q({ ref: e, value: t, onSelect: n, keywords: r, onClick: i, children: a, ...l }) {
|
|
305
|
-
let { baseId: u, activeIndex: d, matchedValues: f, getItemProps: p, setOpen: m, registration: h } = R("Item"), g = _(L), v = b(null), { ref: y, index: x } = o(t, h, v, (e, t) => ({
|
|
306
|
-
index: e,
|
|
307
|
-
label: t,
|
|
308
|
-
keywords: r,
|
|
309
|
-
groupId: g
|
|
310
|
-
})), S = E([
|
|
311
|
-
y,
|
|
312
|
-
v,
|
|
313
|
-
e
|
|
314
|
-
]), w = x !== -1 && d === x, T = (e) => {
|
|
315
|
-
i?.(e), !e.defaultPrevented && (n?.(), m(!1));
|
|
316
|
-
};
|
|
317
|
-
return /* @__PURE__ */ C("div", {
|
|
318
|
-
...p({
|
|
319
|
-
id: c(u, t),
|
|
320
|
-
...l,
|
|
321
|
-
onClick: T
|
|
322
|
-
}),
|
|
323
|
-
ref: S,
|
|
324
|
-
role: "option",
|
|
325
|
-
"aria-selected": w,
|
|
326
|
-
hidden: !f.has(t),
|
|
327
|
-
"data-active": w || void 0,
|
|
328
|
-
"data-ui": "command-palette-item",
|
|
329
|
-
css: [s, N],
|
|
330
|
-
children: a
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
q.displayName = "CommandPalette.Item";
|
|
334
|
-
var J = Object.assign(B, {
|
|
335
|
-
Trigger: V,
|
|
336
|
-
Content: H,
|
|
337
|
-
Input: U,
|
|
338
|
-
List: W,
|
|
339
|
-
Empty: G,
|
|
340
|
-
Group: K,
|
|
341
|
-
Item: q
|
|
342
|
-
});
|
|
343
|
-
//#endregion
|
|
344
|
-
export { J as t };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
-
import { n as t } from "./layout-style-7ZTOiWGR.js";
|
|
4
|
-
import { jsx as n } from "@emotion/react/jsx-runtime";
|
|
5
|
-
//#region src/components/container/container.tsx
|
|
6
|
-
var r = {
|
|
7
|
-
sm: "640px",
|
|
8
|
-
md: "768px",
|
|
9
|
-
lg: "1024px",
|
|
10
|
-
xl: "1280px"
|
|
11
|
-
}, i = e({
|
|
12
|
-
boxSizing: "border-box",
|
|
13
|
-
inlineSize: "100%",
|
|
14
|
-
marginInline: "auto"
|
|
15
|
-
}), a = {
|
|
16
|
-
sm: e({ maxInlineSize: r.sm }),
|
|
17
|
-
md: e({ maxInlineSize: r.md }),
|
|
18
|
-
lg: e({ maxInlineSize: r.lg }),
|
|
19
|
-
xl: e({ maxInlineSize: r.xl })
|
|
20
|
-
}, o = t("paddingInline");
|
|
21
|
-
function s({ ref: e, size: t = "lg", paddingInline: r = "md", ...s }) {
|
|
22
|
-
return /* @__PURE__ */ n("div", {
|
|
23
|
-
...s,
|
|
24
|
-
ref: e,
|
|
25
|
-
"data-ui": "container",
|
|
26
|
-
"data-size": t,
|
|
27
|
-
css: [
|
|
28
|
-
i,
|
|
29
|
-
a[t],
|
|
30
|
-
o[r]
|
|
31
|
-
]
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
s.displayName = "Container";
|
|
35
|
-
//#endregion
|
|
36
|
-
export { s as t };
|
package/dist/css-Cgj6sCHn.js
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
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 "./renderable-DzcIj1Lo.js";
|
|
5
|
-
import { t as r } from "./calendar-Doj7PTdG.js";
|
|
6
|
-
import { n as i } from "./surface-DZ4d-2aL.js";
|
|
7
|
-
import { t as a } from "./use-overlay-floating-efeqppiw.js";
|
|
8
|
-
import { t as o } from "./text-field-8PQAqRpM.js";
|
|
9
|
-
import { createContext as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
10
|
-
import { vars as h } from "@jfrader/tokens/vars";
|
|
11
|
-
import { jsx as g, jsxs as _ } from "@emotion/react/jsx-runtime";
|
|
12
|
-
import { FloatingFocusManager as v, FloatingPortal as y, useClick as b, useDismiss as x, useInteractions as S, useMergeRefs as C, useRole as w } from "@floating-ui/react";
|
|
13
|
-
//#region src/components/date-picker/date-picker.tsx
|
|
14
|
-
var T = "bottom-start", E = /* @__PURE__ */ new Set(["Enter", "ArrowDown"]), D = " ", O = "[data-ui=\"calendar-day\"][tabindex=\"0\"]", k = "[data-ui=\"calendar-day\"]", A = /^\d{4}-\d{2}-\d{2}$/, j = {
|
|
15
|
-
calendar: "gregory",
|
|
16
|
-
timeZone: "UTC",
|
|
17
|
-
dateStyle: "medium"
|
|
18
|
-
}, M = s(null);
|
|
19
|
-
function N(e) {
|
|
20
|
-
let t = c(M);
|
|
21
|
-
if (!t) throw Error(`DatePicker.${e} must be rendered inside <DatePicker>.`);
|
|
22
|
-
return t;
|
|
23
|
-
}
|
|
24
|
-
var P = (e, t) => String(e).padStart(t, "0"), F = (e, t, n) => `${P(e, 4)}-${P(t, 2)}-${P(n, 2)}`;
|
|
25
|
-
function I(e) {
|
|
26
|
-
if (e === void 0 || !A.test(e)) return;
|
|
27
|
-
let [t = NaN, n = NaN, r = NaN] = e.split("-").map(Number), i = new Date(Date.UTC(0, 0, 1));
|
|
28
|
-
return i.setUTCFullYear(t, n - 1, r), F(i.getUTCFullYear(), i.getUTCMonth() + 1, i.getUTCDate()) === e ? i : void 0;
|
|
29
|
-
}
|
|
30
|
-
var L = (e) => I(e) ? e : void 0;
|
|
31
|
-
function R(e, t, n) {
|
|
32
|
-
return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
|
|
33
|
-
}
|
|
34
|
-
function ee() {
|
|
35
|
-
let e = /* @__PURE__ */ new Date();
|
|
36
|
-
return F(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
37
|
-
}
|
|
38
|
-
var te = () => typeof navigator > "u" ? void 0 : navigator.language;
|
|
39
|
-
function ne(e, t) {
|
|
40
|
-
let n = new Intl.DisplayNames(t, { type: "dateTimeField" });
|
|
41
|
-
return e.formatToParts(/* @__PURE__ */ new Date(0)).map((e) => e.type === "literal" ? e.value : n.of(e.type) ?? e.value).join("");
|
|
42
|
-
}
|
|
43
|
-
function z(e) {
|
|
44
|
-
let t = e?.querySelector(O) ?? null;
|
|
45
|
-
return t?.focus({ preventScroll: !0 }), t;
|
|
46
|
-
}
|
|
47
|
-
var B = e({
|
|
48
|
-
cursor: "pointer",
|
|
49
|
-
"&:disabled": { cursor: "not-allowed" }
|
|
50
|
-
}), V = e({
|
|
51
|
-
...i,
|
|
52
|
-
borderRadius: h.radius.md,
|
|
53
|
-
boxShadow: h.shadow.overlay,
|
|
54
|
-
padding: h.space[3]
|
|
55
|
-
});
|
|
56
|
-
function H({ value: e, defaultValue: n, onValueChange: r, open: i, defaultOpen: o = !1, onOpenChange: s, min: c, max: u, locale: d, firstDayOfWeek: h, disabled: v = !1, name: y, placeholder: C, children: E }) {
|
|
57
|
-
let [D, O] = t(e, n, r), [k = !1, A] = t(i, o, s), [N, P] = m(!1), F = v || N, z = k && !F, [B, V] = m(null), H = p(null), U = p(!1), W = f(() => new Intl.DateTimeFormat(d ?? te()).resolvedOptions().locale, [d]), G = f(() => new Intl.DateTimeFormat(W, j), [W]), K = f(() => ne(G, W), [G, W]), q = I(D), J = q ? G.format(q) : "", Y = L(c), X = L(u), Z = R(L(D) ?? ee(), Y, X).slice(0, 7), { refs: Q, floatingStyles: re, context: $ } = a({
|
|
58
|
-
open: z,
|
|
59
|
-
placement: T,
|
|
60
|
-
onOpenChange: (e, t, n) => {
|
|
61
|
-
F && e || (e || (U.current = n === "escape-key"), A(e));
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
l(() => {
|
|
65
|
-
F && (U.current = !1, k && A(!1));
|
|
66
|
-
}, [
|
|
67
|
-
F,
|
|
68
|
-
k,
|
|
69
|
-
A
|
|
70
|
-
]), l(() => {
|
|
71
|
-
!F && !z && U.current && (U.current = !1, Q.domReference.current?.focus());
|
|
72
|
-
}, [
|
|
73
|
-
F,
|
|
74
|
-
z,
|
|
75
|
-
Q
|
|
76
|
-
]);
|
|
77
|
-
let ie = b($, {
|
|
78
|
-
enabled: !F,
|
|
79
|
-
keyboardHandlers: !1
|
|
80
|
-
}), ae = x($, {
|
|
81
|
-
escapeKey: !0,
|
|
82
|
-
outsidePress: !0
|
|
83
|
-
}), oe = w($, { role: "dialog" }), { getReferenceProps: se, getFloatingProps: ce } = S([
|
|
84
|
-
ie,
|
|
85
|
-
ae,
|
|
86
|
-
oe
|
|
87
|
-
]), le = f(() => ({
|
|
88
|
-
open: z,
|
|
89
|
-
disabled: F,
|
|
90
|
-
value: D,
|
|
91
|
-
displayValue: J,
|
|
92
|
-
placeholder: C ?? K,
|
|
93
|
-
initialMonth: Z,
|
|
94
|
-
min: Y,
|
|
95
|
-
max: X,
|
|
96
|
-
locale: W,
|
|
97
|
-
firstDayOfWeek: h,
|
|
98
|
-
inputLabelling: B,
|
|
99
|
-
gridRef: H,
|
|
100
|
-
refs: Q,
|
|
101
|
-
floatingContext: $,
|
|
102
|
-
floatingStyles: re,
|
|
103
|
-
getReferenceProps: se,
|
|
104
|
-
getFloatingProps: ce,
|
|
105
|
-
requestOpenChange: (e) => {
|
|
106
|
-
F && e || A(e);
|
|
107
|
-
},
|
|
108
|
-
selectDate: (e) => {
|
|
109
|
-
F || (O(e), U.current = !0, A(!1));
|
|
110
|
-
},
|
|
111
|
-
setInputLabelling: V,
|
|
112
|
-
setInputDisabled: P
|
|
113
|
-
}), [
|
|
114
|
-
z,
|
|
115
|
-
F,
|
|
116
|
-
D,
|
|
117
|
-
J,
|
|
118
|
-
C,
|
|
119
|
-
K,
|
|
120
|
-
Z,
|
|
121
|
-
Y,
|
|
122
|
-
X,
|
|
123
|
-
W,
|
|
124
|
-
h,
|
|
125
|
-
B,
|
|
126
|
-
Q,
|
|
127
|
-
$,
|
|
128
|
-
re,
|
|
129
|
-
se,
|
|
130
|
-
ce,
|
|
131
|
-
A,
|
|
132
|
-
O
|
|
133
|
-
]);
|
|
134
|
-
return /* @__PURE__ */ _(M.Provider, {
|
|
135
|
-
value: le,
|
|
136
|
-
children: [E, y !== void 0 && /* @__PURE__ */ g("input", {
|
|
137
|
-
type: "hidden",
|
|
138
|
-
name: y,
|
|
139
|
-
value: D ?? "",
|
|
140
|
-
disabled: F
|
|
141
|
-
})]
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
H.displayName = "DatePicker";
|
|
145
|
-
function U({ ref: e, label: t, id: r, disabled: i, slotProps: a, onKeyDown: s, onKeyUp: c, ...l }) {
|
|
146
|
-
let { open: f, disabled: p, displayValue: m, placeholder: h, gridRef: _, refs: v, getReferenceProps: y, requestOpenChange: b, setInputLabelling: x, setInputDisabled: S } = N("Input"), w = C([v.setReference, e]), T = u(), O = r ?? T, k = `${O}-label`, A = n(t), j = l["aria-labelledby"], M = l["aria-label"], P = M ?? (typeof t == "string" ? t : void 0), F = p || i === !0;
|
|
147
|
-
d(() => (S(i === !0), () => S(!1)), [i, S]), d(() => (x(j === void 0 ? M === void 0 ? typeof t == "string" ? { label: t } : { labelledBy: A ? k : void 0 } : { label: M } : { labelledBy: j }), () => x(null)), [
|
|
148
|
-
j,
|
|
149
|
-
M,
|
|
150
|
-
t,
|
|
151
|
-
A,
|
|
152
|
-
k,
|
|
153
|
-
x
|
|
154
|
-
]);
|
|
155
|
-
let I = () => {
|
|
156
|
-
F || (f ? z(_.current) : b(!0));
|
|
157
|
-
}, L = (e) => {
|
|
158
|
-
s?.(e), !(e.defaultPrevented || F) && (e.key === D ? e.preventDefault() : E.has(e.key) && (e.preventDefault(), I()));
|
|
159
|
-
}, R = (e) => {
|
|
160
|
-
c?.(e), !(e.defaultPrevented || F || e.key !== D) && I();
|
|
161
|
-
};
|
|
162
|
-
return /* @__PURE__ */ g(o, {
|
|
163
|
-
...y({
|
|
164
|
-
...l,
|
|
165
|
-
onKeyDown: L,
|
|
166
|
-
onKeyUp: R
|
|
167
|
-
}),
|
|
168
|
-
ref: w,
|
|
169
|
-
id: O,
|
|
170
|
-
label: A ? /* @__PURE__ */ g("span", {
|
|
171
|
-
id: k,
|
|
172
|
-
children: t
|
|
173
|
-
}) : t,
|
|
174
|
-
slotProps: {
|
|
175
|
-
...a,
|
|
176
|
-
control: {
|
|
177
|
-
...a?.control,
|
|
178
|
-
css: [B, a?.control?.css]
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
value: m,
|
|
182
|
-
placeholder: h,
|
|
183
|
-
disabled: F,
|
|
184
|
-
readOnly: !0,
|
|
185
|
-
role: "combobox",
|
|
186
|
-
"aria-label": P,
|
|
187
|
-
"aria-autocomplete": "none",
|
|
188
|
-
"data-state": f ? "open" : "closed",
|
|
189
|
-
"data-ui": "date-picker-input"
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
U.displayName = "DatePicker.Input";
|
|
193
|
-
function W({ ref: e, style: t, ...n }) {
|
|
194
|
-
let { open: i, value: a, initialMonth: o, min: s, max: c, locale: l, firstDayOfWeek: u, inputLabelling: d, gridRef: f, refs: m, floatingContext: h, floatingStyles: b, getFloatingProps: x, selectDate: S } = N("Popup"), w = C([m.setFloating, e]), T = p(null), E = C([(e) => {
|
|
195
|
-
f.current = e, T.current = z(e);
|
|
196
|
-
}]);
|
|
197
|
-
if (!i) return null;
|
|
198
|
-
let D = n["aria-labelledby"] !== void 0 || n["aria-label"] !== void 0 ? {} : d?.labelledBy === void 0 ? { "aria-label": d?.label } : { "aria-labelledby": d.labelledBy }, O = (e) => {
|
|
199
|
-
let t = e.target.closest(k);
|
|
200
|
-
if (t?.disabled) return;
|
|
201
|
-
let n = t?.dataset.date;
|
|
202
|
-
n !== void 0 && S(n);
|
|
203
|
-
}, A = (e) => {
|
|
204
|
-
e.target.closest(k)?.disabled && e.preventDefault();
|
|
205
|
-
};
|
|
206
|
-
return /* @__PURE__ */ g(y, { children: /* @__PURE__ */ g(v, {
|
|
207
|
-
context: h,
|
|
208
|
-
modal: !1,
|
|
209
|
-
initialFocus: T,
|
|
210
|
-
returnFocus: !1,
|
|
211
|
-
children: /* @__PURE__ */ g("div", {
|
|
212
|
-
...x({
|
|
213
|
-
...D,
|
|
214
|
-
...n
|
|
215
|
-
}),
|
|
216
|
-
ref: w,
|
|
217
|
-
"data-ui": "date-picker-popup",
|
|
218
|
-
style: {
|
|
219
|
-
...t,
|
|
220
|
-
...b
|
|
221
|
-
},
|
|
222
|
-
css: V,
|
|
223
|
-
children: /* @__PURE__ */ _(r, {
|
|
224
|
-
value: a ?? "",
|
|
225
|
-
defaultVisibleMonth: o,
|
|
226
|
-
min: s,
|
|
227
|
-
max: c,
|
|
228
|
-
locale: l,
|
|
229
|
-
firstDayOfWeek: u,
|
|
230
|
-
children: [/* @__PURE__ */ g(r.Header, {}), /* @__PURE__ */ g(r.Grid, {
|
|
231
|
-
ref: E,
|
|
232
|
-
onClick: O,
|
|
233
|
-
onPointerDownCapture: A
|
|
234
|
-
})]
|
|
235
|
-
})
|
|
236
|
-
})
|
|
237
|
-
}) });
|
|
238
|
-
}
|
|
239
|
-
W.displayName = "DatePicker.Popup";
|
|
240
|
-
var G = Object.assign(H, {
|
|
241
|
-
Input: U,
|
|
242
|
-
Popup: W
|
|
243
|
-
});
|
|
244
|
-
//#endregion
|
|
245
|
-
export { G as t };
|