@jfrader/ui 0.1.2 → 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 +1 -1
- package/dist/accordion-CkOZ-tvs.js +178 -0
- package/dist/accordion.js +1 -1
- package/dist/alert-Dsjx14UW.js +131 -0
- package/dist/alert.js +1 -1
- package/dist/avatar-BRGKkoSr.js +127 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-DLxUMsCx.js +104 -0
- package/dist/badge.js +1 -1
- package/dist/breadcrumbs-694hF_hm.js +131 -0
- package/dist/breadcrumbs.js +1 -1
- package/dist/button-CoaIcykB.js +190 -0
- package/dist/button.js +1 -1
- package/dist/calendar-Doj7PTdG.js +379 -0
- package/dist/calendar.js +1 -1
- package/dist/card-2IM71XZj.js +134 -0
- package/dist/card.js +1 -1
- package/dist/checkbox-B7xGNFzp.js +136 -0
- package/dist/checkbox.js +1 -1
- package/dist/combobox-Bjhxv5U3.js +311 -0
- package/dist/combobox.js +1 -1
- package/dist/{command-palette-6c158eH1.js → command-palette-BhJwm6cS.js} +144 -129
- package/dist/command-palette.js +1 -1
- package/dist/container-BhnrGPu-.js +36 -0
- package/dist/container.js +1 -1
- package/dist/date-picker-Jk8SpoiO.js +245 -0
- package/dist/date-picker.js +1 -1
- package/dist/dialog-fhS07G41.js +187 -0
- package/dist/dialog.js +1 -1
- package/dist/divider-v_78HYF5.js +79 -0
- package/dist/divider.js +1 -1
- package/dist/flex-COZzFqI8.js +22 -0
- package/dist/flex.js +1 -1
- package/dist/index.js +36 -36
- package/dist/kbd-CeP8Kfvp.js +61 -0
- package/dist/kbd.js +1 -1
- package/dist/menu-B6KCbLCr.js +196 -0
- package/dist/menu.js +1 -1
- package/dist/navigation-BDht6S2-.js +182 -0
- package/dist/navigation.js +1 -1
- package/dist/{pagination-BIKYsxK1.js → pagination-B50PCaDU.js} +58 -56
- package/dist/pagination.js +1 -1
- package/dist/pill-2_XzBdkD.js +51 -0
- package/dist/pill.js +1 -1
- package/dist/popover-DRHbeIVq.js +103 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-C8bgujFI.js → progress-CpsskKTD.js} +37 -36
- package/dist/progress.js +1 -1
- package/dist/radio-group-DPI5KUCj.js +136 -0
- package/dist/radio-group.js +1 -1
- package/dist/select-C1xGrOhT.js +266 -0
- package/dist/select.js +1 -1
- package/dist/skeleton-DitdP-yz.js +49 -0
- package/dist/skeleton.js +1 -1
- package/dist/{spinner-CSFiP0Oi.js → spinner-CFq5HPoo.js} +24 -23
- package/dist/spinner.js +1 -1
- package/dist/stack-D_g6NJzo.js +21 -0
- package/dist/stack.js +1 -1
- package/dist/switch-B5TTU-oJ.js +138 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-C26PWl2c.js +183 -0
- package/dist/tabs.js +1 -1
- package/dist/text-field-8PQAqRpM.js +75 -0
- package/dist/text-field.js +1 -1
- package/dist/textarea-CcGWuntL.js +85 -0
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BRLIA4eb.js +22 -0
- package/dist/theme-root.js +1 -1
- package/dist/toast-B1PXuwZ4.js +277 -0
- package/dist/toast.js +1 -1
- package/dist/toggle-group-N_owicT0.js +156 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BJPisf60.js +98 -0
- package/dist/tooltip.js +1 -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/package.json +4 -4
- package/dist/accordion-C3YbYFBi.js +0 -169
- package/dist/alert-CA9ZlIZp.js +0 -130
- package/dist/avatar-IUW4yJl0.js +0 -125
- package/dist/badge-Bru30HEn.js +0 -103
- package/dist/breadcrumbs-CQaviWRc.js +0 -126
- package/dist/button-Cmixur4Q.js +0 -188
- package/dist/calendar-DUgS0xmp.js +0 -373
- package/dist/card-D9CHtouU.js +0 -121
- package/dist/checkbox-DKa5BCdy.js +0 -135
- package/dist/combobox-Dq3V88Zt.js +0 -302
- package/dist/container-xUEIoZzj.js +0 -35
- package/dist/date-picker-DrHJMt2p.js +0 -240
- package/dist/dialog-C2NSOOP-.js +0 -176
- package/dist/divider-yF5EmhhT.js +0 -77
- package/dist/flex-5-NI5SSy.js +0 -22
- package/dist/kbd-B03_qIwQ.js +0 -56
- package/dist/menu-bvKRJOhJ.js +0 -187
- package/dist/navigation-xPoqh_Iz.js +0 -175
- package/dist/pill-CrVqffKM.js +0 -50
- package/dist/popover-CVAZ_C1a.js +0 -98
- package/dist/radio-group-CvQ4x8ii.js +0 -131
- package/dist/select-CNNiUhKB.js +0 -257
- package/dist/skeleton-gJ4ImO5u.js +0 -48
- package/dist/stack-mEAryjKz.js +0 -21
- package/dist/switch-2hm2WnWt.js +0 -136
- package/dist/tabs-GBppQabg.js +0 -174
- package/dist/text-field-DDPqQu29.js +0 -74
- package/dist/textarea-OP8_3IUR.js +0 -84
- package/dist/theme-root-eLka0ZP1.js +0 -21
- package/dist/toast-D3Y6OAsg.js +0 -271
- package/dist/toggle-group-BxzJ-6Cp.js +0 -151
- package/dist/tooltip-CVl8HS4S.js +0 -93
|
@@ -8,83 +8,83 @@ import { a, r as o, s, t as c } from "./collection-registry-1l9f3XJZ.js";
|
|
|
8
8
|
import { t as l } from "./trigger-style-B1GFmH7M.js";
|
|
9
9
|
import { i as u, r as d, t as f } from "./use-native-dialog-DWpIUVO1.js";
|
|
10
10
|
import { n as p, t as m } from "./surface-DZ4d-2aL.js";
|
|
11
|
-
import { createContext as h,
|
|
12
|
-
import { vars as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { FloatingList as
|
|
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
15
|
//#region src/components/command-palette/command-palette.styles.ts
|
|
16
|
-
var
|
|
16
|
+
var D = e({
|
|
17
17
|
...m,
|
|
18
|
-
marginBlockStart:
|
|
19
|
-
}),
|
|
18
|
+
marginBlockStart: S.space[12]
|
|
19
|
+
}), O = e({
|
|
20
20
|
...p,
|
|
21
21
|
display: "flex",
|
|
22
22
|
flexDirection: "column",
|
|
23
|
-
borderRadius:
|
|
24
|
-
boxShadow:
|
|
23
|
+
borderRadius: S.radius.lg,
|
|
24
|
+
boxShadow: S.shadow.floating,
|
|
25
25
|
inlineSize: "min(560px, calc(100vw - 32px))"
|
|
26
|
-
}),
|
|
26
|
+
}), k = e({
|
|
27
27
|
boxSizing: "border-box",
|
|
28
28
|
inlineSize: "100%",
|
|
29
29
|
blockSize: "48px",
|
|
30
30
|
margin: 0,
|
|
31
31
|
border: 0,
|
|
32
|
-
borderBlockEnd: `1px solid ${
|
|
33
|
-
borderStartStartRadius:
|
|
34
|
-
borderStartEndRadius:
|
|
32
|
+
borderBlockEnd: `1px solid ${S.color.borderControl}`,
|
|
33
|
+
borderStartStartRadius: S.radius.lg,
|
|
34
|
+
borderStartEndRadius: S.radius.lg,
|
|
35
35
|
backgroundColor: "transparent",
|
|
36
|
-
paddingInline:
|
|
36
|
+
paddingInline: S.space[4],
|
|
37
37
|
font: "inherit",
|
|
38
|
-
fontSize:
|
|
39
|
-
color:
|
|
40
|
-
"&::placeholder": { color:
|
|
38
|
+
fontSize: S.textSize.md,
|
|
39
|
+
color: S.color.text,
|
|
40
|
+
"&::placeholder": { color: S.color.textSubtle },
|
|
41
41
|
"&:focus-visible": { ...t }
|
|
42
|
-
}),
|
|
42
|
+
}), A = e({
|
|
43
43
|
boxSizing: "border-box",
|
|
44
44
|
display: "flex",
|
|
45
45
|
flexDirection: "column",
|
|
46
46
|
maxBlockSize: "320px",
|
|
47
47
|
overflow: "auto",
|
|
48
|
-
padding:
|
|
48
|
+
padding: S.space[1],
|
|
49
49
|
"&[hidden]": { display: "none" }
|
|
50
|
-
}),
|
|
50
|
+
}), j = e({
|
|
51
51
|
display: "flex",
|
|
52
52
|
flexDirection: "column",
|
|
53
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
|
|
54
60
|
}), N = e({
|
|
55
|
-
|
|
56
|
-
paddingInline: C.space[2],
|
|
57
|
-
fontSize: C.textSize.xs,
|
|
58
|
-
fontWeight: C.fontWeight.medium,
|
|
59
|
-
color: C.color.textMuted
|
|
60
|
-
}), P = e({
|
|
61
|
-
"&:hover, &[data-active]": { backgroundColor: C.color.surfaceHover },
|
|
61
|
+
"&:hover, &[data-active]": { backgroundColor: S.color.surfaceHover },
|
|
62
62
|
"&[hidden]": { display: "none" }
|
|
63
|
-
}),
|
|
64
|
-
paddingBlock:
|
|
65
|
-
paddingInline:
|
|
63
|
+
}), P = e({
|
|
64
|
+
paddingBlock: S.space[6],
|
|
65
|
+
paddingInline: S.space[4],
|
|
66
66
|
textAlign: "center",
|
|
67
|
-
fontSize:
|
|
68
|
-
color:
|
|
69
|
-
}), re = "Command palette", ie = "No results",
|
|
70
|
-
function
|
|
71
|
-
let t =
|
|
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
72
|
if (!t) throw Error(`CommandPalette.${e} must be rendered inside <CommandPalette>.`);
|
|
73
73
|
return t;
|
|
74
74
|
}
|
|
75
|
-
var
|
|
75
|
+
var z = (e) => {
|
|
76
76
|
e?.setAttribute("autofocus", "");
|
|
77
77
|
};
|
|
78
|
-
function
|
|
79
|
-
let d =
|
|
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
80
|
f !== R && (z(f), f && (E(""), O(!1), A(null)));
|
|
81
|
-
let V =
|
|
82
|
-
|
|
81
|
+
let V = g(() => {
|
|
82
|
+
_(!(f && m.current?.open));
|
|
83
83
|
}, [
|
|
84
84
|
f,
|
|
85
|
-
|
|
85
|
+
_,
|
|
86
86
|
m
|
|
87
|
-
]), { matchedValues: H, matchedIndices: U, visibleGroupIds: W } =
|
|
87
|
+
]), { matchedValues: H, matchedIndices: U, visibleGroupIds: W } = y(() => {
|
|
88
88
|
let e = /* @__PURE__ */ new Set(), t = [], n = /* @__PURE__ */ new Set();
|
|
89
89
|
return j.forEach((r, i) => {
|
|
90
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));
|
|
@@ -97,9 +97,9 @@ function V({ open: e, defaultOpen: t = !1, onOpenChange: r, label: i = re, filte
|
|
|
97
97
|
j,
|
|
98
98
|
T,
|
|
99
99
|
o
|
|
100
|
-
]), G =
|
|
100
|
+
]), G = y(() => new Set(U), [U]), K = k !== null && G.has(k) ? k : U[0] ?? null, q = ee({
|
|
101
101
|
open: f,
|
|
102
|
-
onOpenChange: (e) =>
|
|
102
|
+
onOpenChange: (e) => _(e),
|
|
103
103
|
elements: {
|
|
104
104
|
reference: N,
|
|
105
105
|
floating: F
|
|
@@ -114,12 +114,12 @@ function V({ open: e, defaultOpen: t = !1, onOpenChange: r, label: i = re, filte
|
|
|
114
114
|
loop: !0,
|
|
115
115
|
focusItemOnOpen: !1,
|
|
116
116
|
disabledIndices: (e) => !G.has(e)
|
|
117
|
-
}), { getReferenceProps: Y, getFloatingProps: X, getItemProps: Z } = te([J]), Q = U.length, $ = D ? c(Q) : "", se =
|
|
117
|
+
}), { getReferenceProps: Y, getFloatingProps: X, getItemProps: Z } = te([J]), Q = U.length, $ = D ? c(Q) : "", se = y(() => ({
|
|
118
118
|
open: f,
|
|
119
|
-
setOpen:
|
|
119
|
+
setOpen: _,
|
|
120
120
|
toggleOpen: V,
|
|
121
|
-
requestClose:
|
|
122
|
-
repairToken:
|
|
121
|
+
requestClose: S,
|
|
122
|
+
repairToken: w,
|
|
123
123
|
setDialogElement: h,
|
|
124
124
|
label: i,
|
|
125
125
|
emptyMessage: s,
|
|
@@ -133,7 +133,7 @@ function V({ open: e, defaultOpen: t = !1, onOpenChange: r, label: i = re, filte
|
|
|
133
133
|
activeIndex: K,
|
|
134
134
|
elementsRef: B,
|
|
135
135
|
setInputElement: P,
|
|
136
|
-
setListElement:
|
|
136
|
+
setListElement: L,
|
|
137
137
|
getReferenceProps: Y,
|
|
138
138
|
getFloatingProps: X,
|
|
139
139
|
getItemProps: Z,
|
|
@@ -147,10 +147,10 @@ function V({ open: e, defaultOpen: t = !1, onOpenChange: r, label: i = re, filte
|
|
|
147
147
|
registration: M
|
|
148
148
|
}), [
|
|
149
149
|
f,
|
|
150
|
-
|
|
150
|
+
_,
|
|
151
151
|
V,
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
S,
|
|
153
|
+
w,
|
|
154
154
|
h,
|
|
155
155
|
i,
|
|
156
156
|
s,
|
|
@@ -167,41 +167,44 @@ function V({ open: e, defaultOpen: t = !1, onOpenChange: r, label: i = re, filte
|
|
|
167
167
|
Z,
|
|
168
168
|
M
|
|
169
169
|
]);
|
|
170
|
-
return /* @__PURE__ */
|
|
170
|
+
return /* @__PURE__ */ C(I.Provider, {
|
|
171
171
|
value: se,
|
|
172
172
|
children: l
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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();
|
|
178
179
|
};
|
|
179
|
-
return /* @__PURE__ */
|
|
180
|
+
return /* @__PURE__ */ C("button", {
|
|
180
181
|
type: "button",
|
|
181
|
-
...
|
|
182
|
-
ref:
|
|
182
|
+
...n,
|
|
183
|
+
ref: e,
|
|
183
184
|
"data-ui": "command-palette-trigger",
|
|
184
185
|
"aria-haspopup": "dialog",
|
|
185
186
|
"aria-expanded": r,
|
|
186
187
|
onClick: a,
|
|
187
188
|
css: l
|
|
188
189
|
});
|
|
189
|
-
}
|
|
190
|
-
|
|
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, {
|
|
191
194
|
onCancel: i,
|
|
192
195
|
onClick: a,
|
|
193
196
|
onClose: o
|
|
194
|
-
},
|
|
195
|
-
return /* @__PURE__ */
|
|
197
|
+
}, e);
|
|
198
|
+
return /* @__PURE__ */ C("dialog", {
|
|
196
199
|
"aria-label": l,
|
|
197
200
|
...s,
|
|
198
201
|
...p,
|
|
199
202
|
"data-ui": "command-palette",
|
|
200
203
|
"aria-modal": "true",
|
|
201
|
-
css:
|
|
202
|
-
children: /* @__PURE__ */
|
|
203
|
-
css:
|
|
204
|
-
children: [n, /* @__PURE__ */
|
|
204
|
+
css: D,
|
|
205
|
+
children: /* @__PURE__ */ w("div", {
|
|
206
|
+
css: O,
|
|
207
|
+
children: [n, /* @__PURE__ */ C("div", {
|
|
205
208
|
role: "status",
|
|
206
209
|
"aria-live": "polite",
|
|
207
210
|
"aria-atomic": "true",
|
|
@@ -210,22 +213,24 @@ var H = g(function({ onClick: e, ...t }, n) {
|
|
|
210
213
|
})]
|
|
211
214
|
})
|
|
212
215
|
});
|
|
213
|
-
}
|
|
214
|
-
|
|
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([
|
|
215
220
|
d,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
]), g = (
|
|
219
|
-
|
|
221
|
+
z,
|
|
222
|
+
e
|
|
223
|
+
]), g = (e) => {
|
|
224
|
+
t?.(e), p(e.currentTarget.value);
|
|
220
225
|
}, _ = (e) => {
|
|
221
|
-
|
|
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()));
|
|
222
227
|
};
|
|
223
|
-
return /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ C("input", {
|
|
224
229
|
"aria-label": i,
|
|
225
230
|
autoComplete: "off",
|
|
226
231
|
spellCheck: !1,
|
|
227
232
|
...f({
|
|
228
|
-
...
|
|
233
|
+
...r,
|
|
229
234
|
onChange: g,
|
|
230
235
|
onKeyDown: _
|
|
231
236
|
}),
|
|
@@ -237,16 +242,18 @@ var H = g(function({ onClick: e, ...t }, n) {
|
|
|
237
242
|
"aria-expanded": s > 0,
|
|
238
243
|
"aria-controls": a,
|
|
239
244
|
"data-ui": "command-palette-input",
|
|
240
|
-
css:
|
|
245
|
+
css: k
|
|
241
246
|
});
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
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();
|
|
245
252
|
};
|
|
246
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ C("div", {
|
|
247
254
|
"aria-label": i,
|
|
248
255
|
...l({
|
|
249
|
-
...
|
|
256
|
+
...r,
|
|
250
257
|
onMouseDown: d
|
|
251
258
|
}),
|
|
252
259
|
ref: u,
|
|
@@ -254,76 +261,84 @@ var H = g(function({ onClick: e, ...t }, n) {
|
|
|
254
261
|
role: "listbox",
|
|
255
262
|
hidden: o === 0,
|
|
256
263
|
"data-ui": "command-palette-list",
|
|
257
|
-
css:
|
|
258
|
-
children: /* @__PURE__ */
|
|
264
|
+
css: A,
|
|
265
|
+
children: /* @__PURE__ */ C(T, {
|
|
259
266
|
elementsRef: s,
|
|
260
|
-
children:
|
|
267
|
+
children: n
|
|
261
268
|
})
|
|
262
269
|
});
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
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,
|
|
268
277
|
"data-ui": "command-palette-empty",
|
|
269
|
-
css:
|
|
270
|
-
children: i(
|
|
278
|
+
css: P,
|
|
279
|
+
children: i(t) ? t : a
|
|
271
280
|
});
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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,
|
|
277
288
|
role: "group",
|
|
278
|
-
"aria-labelledby": [
|
|
289
|
+
"aria-labelledby": [r, s].filter(Boolean).join(" "),
|
|
279
290
|
hidden: !a.has(o),
|
|
280
291
|
"data-ui": "command-palette-group",
|
|
281
|
-
css:
|
|
282
|
-
children: [/* @__PURE__ */
|
|
292
|
+
css: j,
|
|
293
|
+
children: [/* @__PURE__ */ C("div", {
|
|
283
294
|
id: s,
|
|
284
|
-
css:
|
|
285
|
-
children: e
|
|
286
|
-
}), /* @__PURE__ */ w(R.Provider, {
|
|
287
|
-
value: o,
|
|
295
|
+
css: M,
|
|
288
296
|
children: t
|
|
297
|
+
}), /* @__PURE__ */ C(L.Provider, {
|
|
298
|
+
value: o,
|
|
299
|
+
children: n
|
|
289
300
|
})]
|
|
290
301
|
});
|
|
291
|
-
}
|
|
292
|
-
|
|
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) => ({
|
|
293
306
|
index: e,
|
|
294
307
|
label: t,
|
|
295
|
-
keywords:
|
|
308
|
+
keywords: r,
|
|
296
309
|
groupId: g
|
|
297
|
-
})), S =
|
|
310
|
+
})), S = E([
|
|
298
311
|
y,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
]),
|
|
302
|
-
|
|
312
|
+
v,
|
|
313
|
+
e
|
|
314
|
+
]), w = x !== -1 && d === x, T = (e) => {
|
|
315
|
+
i?.(e), !e.defaultPrevented && (n?.(), m(!1));
|
|
303
316
|
};
|
|
304
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ C("div", {
|
|
305
318
|
...p({
|
|
306
|
-
id: c(u,
|
|
307
|
-
...
|
|
319
|
+
id: c(u, t),
|
|
320
|
+
...l,
|
|
308
321
|
onClick: T
|
|
309
322
|
}),
|
|
310
323
|
ref: S,
|
|
311
324
|
role: "option",
|
|
312
|
-
"aria-selected":
|
|
313
|
-
hidden: !f.has(
|
|
314
|
-
"data-active":
|
|
325
|
+
"aria-selected": w,
|
|
326
|
+
hidden: !f.has(t),
|
|
327
|
+
"data-active": w || void 0,
|
|
315
328
|
"data-ui": "command-palette-item",
|
|
316
|
-
css: [s,
|
|
317
|
-
children:
|
|
329
|
+
css: [s, N],
|
|
330
|
+
children: a
|
|
318
331
|
});
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
|
327
342
|
});
|
|
328
343
|
//#endregion
|
|
329
|
-
export {
|
|
344
|
+
export { J as t };
|
package/dist/command-palette.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as CommandPalette } from "./command-palette-
|
|
2
|
+
export { t as CommandPalette } from "./command-palette-BhJwm6cS.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
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/container.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Container } from "./container-
|
|
2
|
+
export { t as Container } from "./container-BhnrGPu-.js";
|