@jfrader/ui 0.1.2 → 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/README.md +1 -1
- package/dist/accordion-Bd-j04hW.js +198 -0
- package/dist/accordion.js +1 -1
- package/dist/{alert-CA9ZlIZp.js → alert-BBqaKI4k.js} +57 -52
- package/dist/alert.js +1 -1
- package/dist/{avatar-IUW4yJl0.js → avatar-BahDVO9t.js} +40 -33
- package/dist/avatar.js +1 -1
- package/dist/{badge-Bru30HEn.js → badge-B_sLygxU.js} +32 -27
- package/dist/badge.js +1 -1
- package/dist/breadcrumbs-DVAOxfvL.js +141 -0
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-Cmixur4Q.js → button-P2e7_44z.js} +65 -53
- 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-DrHJMt2p.js → date-picker-ClUYBIBh.js} +69 -59
- 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-B03_qIwQ.js → kbd-C3ACoMoE.js} +36 -21
- 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-CrVqffKM.js → pill-DO2gHzMb.js} +16 -10
- 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-gJ4ImO5u.js → skeleton-OoFlOEXO.js} +24 -18
- 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-2hm2WnWt.js → switch-Dr-qjmT4.js} +63 -57
- 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-D60ok14S.js +76 -0
- package/dist/text-field.js +1 -1
- package/dist/textarea-DyfjtP0A.js +86 -0
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BiXXvQvr.js +42 -0
- package/dist/theme-root.js +1 -1
- package/dist/{toast-D3Y6OAsg.js → toast-iqelR-r0.js} +41 -30
- 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 +14 -9
- package/dist/types/components/alert/alert.d.ts +7 -3
- package/dist/types/components/avatar/avatar.d.ts +7 -3
- package/dist/types/components/badge/badge.d.ts +7 -3
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +9 -5
- package/dist/types/components/button/button.d.ts +7 -3
- package/dist/types/components/calendar/calendar.d.ts +12 -7
- package/dist/types/components/card/card.d.ts +21 -13
- package/dist/types/components/checkbox/checkbox.d.ts +7 -3
- package/dist/types/components/combobox/combobox.d.ts +13 -8
- package/dist/types/components/command-palette/command-palette.d.ts +23 -15
- package/dist/types/components/container/container.d.ts +7 -3
- package/dist/types/components/date-picker/date-picker.d.ts +7 -4
- package/dist/types/components/dialog/dialog.d.ts +17 -11
- package/dist/types/components/divider/divider.d.ts +7 -3
- package/dist/types/components/field/field-anatomy.d.ts +3 -2
- package/dist/types/components/flex/flex.d.ts +7 -3
- package/dist/types/components/kbd/kbd.d.ts +9 -5
- package/dist/types/components/menu/menu.d.ts +14 -9
- package/dist/types/components/navigation/navigation.d.ts +12 -7
- package/dist/types/components/pagination/pagination.d.ts +7 -3
- package/dist/types/components/pill/pill.d.ts +7 -3
- package/dist/types/components/popover/popover.d.ts +8 -5
- package/dist/types/components/progress/progress.d.ts +7 -3
- package/dist/types/components/radio-group/radio-group.d.ts +9 -5
- package/dist/types/components/select/select.d.ts +14 -9
- package/dist/types/components/skeleton/skeleton.d.ts +7 -3
- package/dist/types/components/spinner/spinner.d.ts +7 -3
- package/dist/types/components/stack/stack.d.ts +4 -1
- package/dist/types/components/switch/switch.d.ts +7 -3
- package/dist/types/components/tabs/tabs.d.ts +15 -9
- package/dist/types/components/text-field/text-field.d.ts +7 -3
- package/dist/types/components/textarea/textarea.d.ts +7 -3
- package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
- package/dist/types/components/theme-root/theme-root.d.ts +7 -3
- package/dist/types/components/toast/toast.d.ts +7 -4
- package/dist/types/components/toggle-group/toggle-group.d.ts +8 -5
- package/dist/types/components/tooltip/tooltip.d.ts +8 -5
- package/dist/types/index.d.ts +4 -0
- package/dist/types/overlay/use-native-dialog.d.ts +2 -2
- 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 +5 -4
- package/dist/accordion-C3YbYFBi.js +0 -169
- package/dist/breadcrumbs-CQaviWRc.js +0 -126
- 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/command-palette-6c158eH1.js +0 -329
- package/dist/container-xUEIoZzj.js +0 -35
- package/dist/css-Cgj6sCHn.js +0 -2
- package/dist/dialog-C2NSOOP-.js +0 -176
- package/dist/divider-yF5EmhhT.js +0 -77
- package/dist/field-anatomy-BzGw1Ch9.js +0 -105
- package/dist/flex-5-NI5SSy.js +0 -22
- package/dist/menu-bvKRJOhJ.js +0 -187
- package/dist/navigation-xPoqh_Iz.js +0 -175
- package/dist/pagination-BIKYsxK1.js +0 -149
- package/dist/popover-CVAZ_C1a.js +0 -98
- package/dist/progress-C8bgujFI.js +0 -84
- package/dist/radio-group-CvQ4x8ii.js +0 -131
- package/dist/select-CNNiUhKB.js +0 -257
- package/dist/spinner-CSFiP0Oi.js +0 -50
- package/dist/stack-mEAryjKz.js +0 -21
- 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/toggle-group-BxzJ-6Cp.js +0 -151
- package/dist/tooltip-CVl8HS4S.js +0 -93
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r } from "./media-D_eA_I-e.js";
|
|
5
|
+
import { t as i } from "./use-controlled-state-CVXDa-qM.js";
|
|
6
|
+
import { f as a, i as o, n as s, o as c } from "./collection-registry-BTYi6zGh.js";
|
|
7
|
+
import { t as l } from "./trigger-style-B1KVC8O1.js";
|
|
8
|
+
import { t as u } from "./use-overlay-floating-efeqppiw.js";
|
|
9
|
+
import { createContext as d, useContext as f, useEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
10
|
+
import { vars as _ } from "@jfrader/tokens/vars";
|
|
11
|
+
import { jsx as v } from "@emotion/react/jsx-runtime";
|
|
12
|
+
import { FloatingFocusManager as y, FloatingList as b, FloatingPortal as x, useClick as S, useDismiss as C, useInteractions as w, useListNavigation as T, useMergeRefs as E, useRole as D, useTypeahead as O } from "@floating-ui/react";
|
|
13
|
+
//#region src/components/menu/menu.tsx
|
|
14
|
+
var k = 500, A = d(null), j = d(!1);
|
|
15
|
+
function M(e) {
|
|
16
|
+
let t = f(A);
|
|
17
|
+
if (!t) throw Error(`Menu.${e} must be rendered inside <Menu>.`);
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
function N() {
|
|
21
|
+
let e = M("Item");
|
|
22
|
+
if (!f(j)) throw Error("Menu.Item must be rendered inside <Menu.Content>.");
|
|
23
|
+
return e;
|
|
24
|
+
}
|
|
25
|
+
var P = e({
|
|
26
|
+
appearance: "none",
|
|
27
|
+
boxSizing: "border-box",
|
|
28
|
+
display: "flex",
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
inlineSize: "100%",
|
|
31
|
+
minBlockSize: "32px",
|
|
32
|
+
border: 0,
|
|
33
|
+
borderRadius: _.radius.sm,
|
|
34
|
+
backgroundColor: "transparent",
|
|
35
|
+
paddingBlock: _.space[1],
|
|
36
|
+
paddingInline: _.space[2],
|
|
37
|
+
font: "inherit",
|
|
38
|
+
fontSize: _.textSize.sm,
|
|
39
|
+
color: _.color.text,
|
|
40
|
+
textAlign: "start",
|
|
41
|
+
cursor: "pointer",
|
|
42
|
+
transitionProperty: "background-color",
|
|
43
|
+
transitionDuration: _.motion.duration.fast,
|
|
44
|
+
transitionTimingFunction: _.motion.easeStandard,
|
|
45
|
+
"&:focus-visible": { ...n },
|
|
46
|
+
[r]: { transitionDuration: "0s" }
|
|
47
|
+
}), F = e({
|
|
48
|
+
blockSize: "1px",
|
|
49
|
+
marginBlock: _.space[1],
|
|
50
|
+
backgroundColor: _.color.border
|
|
51
|
+
});
|
|
52
|
+
function I({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: r = "bottom-start", children: a }) {
|
|
53
|
+
let [o = !1, s] = i(e, t, n), [c, l] = g(null), d = h([]), f = h([]), _ = h(/* @__PURE__ */ new Set()), y = h(!1), { refs: b, floatingStyles: x, context: E } = u({
|
|
54
|
+
open: o,
|
|
55
|
+
placement: r,
|
|
56
|
+
onOpenChange: (e, t, n) => {
|
|
57
|
+
e || (y.current = n === "escape-key"), s(e);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
p(() => {
|
|
61
|
+
!o && y.current && (y.current = !1, b.domReference.current?.focus());
|
|
62
|
+
}, [o, b]);
|
|
63
|
+
let j = S(E), M = D(E, { role: "menu" }), N = C(E, {
|
|
64
|
+
escapeKey: !0,
|
|
65
|
+
outsidePress: !0
|
|
66
|
+
}), P = T(E, {
|
|
67
|
+
listRef: d,
|
|
68
|
+
activeIndex: c,
|
|
69
|
+
onNavigate: l,
|
|
70
|
+
loop: !0,
|
|
71
|
+
orientation: "vertical",
|
|
72
|
+
disabledIndices: (e) => _.current.has(e),
|
|
73
|
+
focusItemOnOpen: !0
|
|
74
|
+
}), F = O(E, {
|
|
75
|
+
listRef: f,
|
|
76
|
+
activeIndex: c,
|
|
77
|
+
onMatch: o ? l : void 0,
|
|
78
|
+
resetMs: k
|
|
79
|
+
}), { getReferenceProps: I, getFloatingProps: L, getItemProps: R } = w([
|
|
80
|
+
j,
|
|
81
|
+
M,
|
|
82
|
+
N,
|
|
83
|
+
P,
|
|
84
|
+
F
|
|
85
|
+
]), z = m(() => ({
|
|
86
|
+
open: o,
|
|
87
|
+
requestClose: (e = !1) => {
|
|
88
|
+
e && (y.current = !0), s(!1);
|
|
89
|
+
},
|
|
90
|
+
activeIndex: c,
|
|
91
|
+
refs: b,
|
|
92
|
+
floatingContext: E,
|
|
93
|
+
floatingStyles: x,
|
|
94
|
+
elementsRef: d,
|
|
95
|
+
labelsRef: f,
|
|
96
|
+
disabledIndices: _.current,
|
|
97
|
+
getReferenceProps: I,
|
|
98
|
+
getFloatingProps: L,
|
|
99
|
+
getItemProps: R
|
|
100
|
+
}), [
|
|
101
|
+
o,
|
|
102
|
+
s,
|
|
103
|
+
c,
|
|
104
|
+
b,
|
|
105
|
+
E,
|
|
106
|
+
x,
|
|
107
|
+
I,
|
|
108
|
+
L,
|
|
109
|
+
R
|
|
110
|
+
]);
|
|
111
|
+
return /* @__PURE__ */ v(A.Provider, {
|
|
112
|
+
value: z,
|
|
113
|
+
children: a
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
I.displayName = "Menu";
|
|
117
|
+
function L({ ref: e, className: n, sx: r, ...i }) {
|
|
118
|
+
let { refs: a, getReferenceProps: o } = M("Trigger"), s = E([a.setReference, e]);
|
|
119
|
+
return /* @__PURE__ */ v(t, {
|
|
120
|
+
className: n,
|
|
121
|
+
styles: l,
|
|
122
|
+
sx: r,
|
|
123
|
+
children: (e) => /* @__PURE__ */ v("button", {
|
|
124
|
+
type: "button",
|
|
125
|
+
...o(i),
|
|
126
|
+
ref: s,
|
|
127
|
+
"data-ui": "menu-trigger",
|
|
128
|
+
className: e
|
|
129
|
+
})
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
L.displayName = "Menu.Trigger";
|
|
133
|
+
function R({ ref: e, style: n, children: r, className: i, sx: o, ...s }) {
|
|
134
|
+
let { open: c, refs: l, floatingContext: u, floatingStyles: d, elementsRef: f, labelsRef: p, getFloatingProps: m } = M("Content"), h = E([l.setFloating, e]);
|
|
135
|
+
return c ? /* @__PURE__ */ v(x, { children: /* @__PURE__ */ v(y, {
|
|
136
|
+
context: u,
|
|
137
|
+
modal: !1,
|
|
138
|
+
initialFocus: -1,
|
|
139
|
+
returnFocus: !1,
|
|
140
|
+
restoreFocus: !0,
|
|
141
|
+
children: /* @__PURE__ */ v(t, {
|
|
142
|
+
className: i,
|
|
143
|
+
styles: a,
|
|
144
|
+
sx: o,
|
|
145
|
+
children: (e) => /* @__PURE__ */ v("div", {
|
|
146
|
+
...m(s),
|
|
147
|
+
ref: h,
|
|
148
|
+
"data-ui": "menu",
|
|
149
|
+
style: {
|
|
150
|
+
...n,
|
|
151
|
+
...d
|
|
152
|
+
},
|
|
153
|
+
className: e,
|
|
154
|
+
children: /* @__PURE__ */ v(b, {
|
|
155
|
+
elementsRef: f,
|
|
156
|
+
labelsRef: p,
|
|
157
|
+
children: /* @__PURE__ */ v(j.Provider, {
|
|
158
|
+
value: !0,
|
|
159
|
+
children: r
|
|
160
|
+
})
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
})
|
|
164
|
+
}) }) : null;
|
|
165
|
+
}
|
|
166
|
+
R.displayName = "Menu.Content";
|
|
167
|
+
function z({ ref: e, onSelect: n, disabled: r = !1, onClick: i, className: a, sx: l, ...u }) {
|
|
168
|
+
let { activeIndex: d, requestClose: f, disabledIndices: p, getItemProps: m } = N(), { ref: h, index: g } = o({ label: r ? null : void 0 }), _ = E([h, e]), y = g !== -1 && d === g;
|
|
169
|
+
s(g, r, p);
|
|
170
|
+
let b = (e) => {
|
|
171
|
+
r || (i?.(e), n?.(), e.defaultPrevented || f(!0));
|
|
172
|
+
};
|
|
173
|
+
return /* @__PURE__ */ v(t, {
|
|
174
|
+
className: a,
|
|
175
|
+
styles: [P, c],
|
|
176
|
+
sx: l,
|
|
177
|
+
children: (e) => /* @__PURE__ */ v("button", {
|
|
178
|
+
type: "button",
|
|
179
|
+
...m({
|
|
180
|
+
...u,
|
|
181
|
+
onClick: b
|
|
182
|
+
}),
|
|
183
|
+
ref: _,
|
|
184
|
+
role: "menuitem",
|
|
185
|
+
tabIndex: y ? 0 : -1,
|
|
186
|
+
"aria-disabled": r || void 0,
|
|
187
|
+
"data-active": y || void 0,
|
|
188
|
+
"data-ui": "menu-item",
|
|
189
|
+
className: e
|
|
190
|
+
})
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
z.displayName = "Menu.Item";
|
|
194
|
+
function B({ ref: e, className: n, sx: r, ...i }) {
|
|
195
|
+
return /* @__PURE__ */ v(t, {
|
|
196
|
+
className: n,
|
|
197
|
+
styles: F,
|
|
198
|
+
sx: r,
|
|
199
|
+
children: (t) => /* @__PURE__ */ v("div", {
|
|
200
|
+
...i,
|
|
201
|
+
ref: e,
|
|
202
|
+
role: "separator",
|
|
203
|
+
"data-ui": "menu-separator",
|
|
204
|
+
className: t
|
|
205
|
+
})
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
B.displayName = "Menu.Separator";
|
|
209
|
+
var V = Object.assign(I, {
|
|
210
|
+
Trigger: L,
|
|
211
|
+
Content: R,
|
|
212
|
+
Item: z,
|
|
213
|
+
Separator: B
|
|
214
|
+
});
|
|
215
|
+
//#endregion
|
|
216
|
+
export { V as t };
|
package/dist/menu.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Menu } from "./menu-
|
|
2
|
+
export { t as Menu } from "./menu-DU60SMdt.js";
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./disclosure-caret-C5T3fcl6.js";
|
|
4
|
+
import { t as r } from "./focus-ring-BK5W5_NY.js";
|
|
5
|
+
import { n as i, t as a } from "./media-D_eA_I-e.js";
|
|
6
|
+
import { t as o } from "./renderable-DzcIj1Lo.js";
|
|
7
|
+
import { t as s } from "./icon-wrapper-stN8sD7R.js";
|
|
8
|
+
import { useId as c } from "react";
|
|
9
|
+
import { vars as l } from "@jfrader/tokens/vars";
|
|
10
|
+
import { Fragment as u, jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
|
|
11
|
+
//#region src/components/navigation/navigation.tsx
|
|
12
|
+
var p = l.space[8], m = "0.06em", h = e({
|
|
13
|
+
display: "grid",
|
|
14
|
+
gap: l.space[4],
|
|
15
|
+
fontFamily: l.font.sans
|
|
16
|
+
}), g = e({
|
|
17
|
+
display: "grid",
|
|
18
|
+
gap: l.space[1],
|
|
19
|
+
"&[open] > summary::after": { transform: "rotate(90deg)" },
|
|
20
|
+
"&[open]:dir(rtl) > summary::after": { transform: "rotate(-90deg)" }
|
|
21
|
+
}), _ = e({
|
|
22
|
+
margin: 0,
|
|
23
|
+
paddingBlock: l.space[1],
|
|
24
|
+
paddingInline: l.space[3],
|
|
25
|
+
fontSize: l.textSize.xs,
|
|
26
|
+
fontWeight: l.fontWeight.medium,
|
|
27
|
+
lineHeight: l.lineHeight.tight,
|
|
28
|
+
letterSpacing: m,
|
|
29
|
+
textTransform: "uppercase",
|
|
30
|
+
color: l.color.textMuted
|
|
31
|
+
}), v = e({
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
justifyContent: "space-between",
|
|
35
|
+
gap: l.space[2],
|
|
36
|
+
inlineSize: "100%",
|
|
37
|
+
boxSizing: "border-box",
|
|
38
|
+
minBlockSize: p,
|
|
39
|
+
borderRadius: l.radius.sm,
|
|
40
|
+
cursor: "pointer",
|
|
41
|
+
listStyle: "none",
|
|
42
|
+
transitionProperty: "background-color, color",
|
|
43
|
+
transitionDuration: l.motion.duration.fast,
|
|
44
|
+
transitionTimingFunction: l.motion.easeStandard,
|
|
45
|
+
"&::-webkit-details-marker": { display: "none" },
|
|
46
|
+
"&::after": { ...n },
|
|
47
|
+
"&:hover": {
|
|
48
|
+
backgroundColor: l.color.surfaceHover,
|
|
49
|
+
color: l.color.text
|
|
50
|
+
},
|
|
51
|
+
"&:focus-visible": { ...r },
|
|
52
|
+
[i]: {
|
|
53
|
+
transitionDuration: "0s",
|
|
54
|
+
"&::after": { transitionDuration: "0s" }
|
|
55
|
+
}
|
|
56
|
+
}), y = e({
|
|
57
|
+
display: "grid",
|
|
58
|
+
gap: l.space[1],
|
|
59
|
+
margin: 0,
|
|
60
|
+
padding: 0,
|
|
61
|
+
listStyle: "none"
|
|
62
|
+
}), b = e({
|
|
63
|
+
display: "flex",
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
gap: l.space[2],
|
|
66
|
+
minBlockSize: p,
|
|
67
|
+
paddingInline: l.space[3],
|
|
68
|
+
borderRadius: l.radius.sm,
|
|
69
|
+
fontSize: l.textSize.sm,
|
|
70
|
+
lineHeight: l.lineHeight.tight,
|
|
71
|
+
color: l.color.textMuted,
|
|
72
|
+
textDecoration: "none",
|
|
73
|
+
transitionProperty: "background-color, color",
|
|
74
|
+
transitionDuration: l.motion.duration.fast,
|
|
75
|
+
transitionTimingFunction: l.motion.easeStandard,
|
|
76
|
+
"&:hover:not([aria-current=\"page\"])": {
|
|
77
|
+
backgroundColor: l.color.surfaceHover,
|
|
78
|
+
color: l.color.text
|
|
79
|
+
},
|
|
80
|
+
"&[aria-current=\"page\"]": {
|
|
81
|
+
backgroundColor: l.color.accentSoft,
|
|
82
|
+
color: l.color.accentText,
|
|
83
|
+
fontWeight: l.fontWeight.medium
|
|
84
|
+
},
|
|
85
|
+
"&[aria-disabled=\"true\"]": {
|
|
86
|
+
opacity: .55,
|
|
87
|
+
pointerEvents: "none"
|
|
88
|
+
},
|
|
89
|
+
"&:focus-visible": { ...r },
|
|
90
|
+
[i]: { transitionDuration: "0s" },
|
|
91
|
+
[a]: { "&[aria-current=\"page\"]": {
|
|
92
|
+
forcedColorAdjust: "none",
|
|
93
|
+
backgroundColor: "SelectedItem",
|
|
94
|
+
color: "SelectedItemText"
|
|
95
|
+
} }
|
|
96
|
+
});
|
|
97
|
+
function x({ ref: e, label: n = "Main", className: r, sx: i, ...a }) {
|
|
98
|
+
return /* @__PURE__ */ d(t, {
|
|
99
|
+
className: r,
|
|
100
|
+
styles: h,
|
|
101
|
+
sx: i,
|
|
102
|
+
children: (t) => /* @__PURE__ */ d("nav", {
|
|
103
|
+
...a,
|
|
104
|
+
ref: e,
|
|
105
|
+
"aria-label": n,
|
|
106
|
+
"data-ui": "navigation",
|
|
107
|
+
className: t
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
x.displayName = "Navigation";
|
|
112
|
+
function S({ ref: e, label: n, collapsible: r = !1, defaultOpen: i, children: a, className: s, sx: l, ...u }) {
|
|
113
|
+
let p = c(), m = o(n);
|
|
114
|
+
if (r && !m) throw Error("Navigation.Group requires a renderable label when collapsible is true.");
|
|
115
|
+
let h = /* @__PURE__ */ d("ul", {
|
|
116
|
+
"aria-labelledby": m ? p : void 0,
|
|
117
|
+
css: y,
|
|
118
|
+
children: a
|
|
119
|
+
});
|
|
120
|
+
return /* @__PURE__ */ d(t, {
|
|
121
|
+
className: s,
|
|
122
|
+
styles: g,
|
|
123
|
+
sx: l,
|
|
124
|
+
children: (t) => r ? /* @__PURE__ */ f("details", {
|
|
125
|
+
...u,
|
|
126
|
+
ref: e,
|
|
127
|
+
open: i,
|
|
128
|
+
"data-ui": "navigation-group",
|
|
129
|
+
className: t,
|
|
130
|
+
children: [/* @__PURE__ */ d("summary", {
|
|
131
|
+
id: p,
|
|
132
|
+
"data-ui": "navigation-group-summary",
|
|
133
|
+
css: [_, v],
|
|
134
|
+
children: n
|
|
135
|
+
}), h]
|
|
136
|
+
}) : /* @__PURE__ */ f("section", {
|
|
137
|
+
...u,
|
|
138
|
+
ref: e,
|
|
139
|
+
"data-ui": "navigation-group",
|
|
140
|
+
className: t,
|
|
141
|
+
children: [m && /* @__PURE__ */ d("h2", {
|
|
142
|
+
id: p,
|
|
143
|
+
"data-ui": "navigation-group-label",
|
|
144
|
+
css: _,
|
|
145
|
+
children: n
|
|
146
|
+
}), h]
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
S.displayName = "Navigation.Group";
|
|
151
|
+
function C({ ref: e, href: n, active: r = !1, disabled: i = !1, icon: a, children: c, className: l, sx: p, ...m }) {
|
|
152
|
+
let h = /* @__PURE__ */ f(u, { children: [o(a) && /* @__PURE__ */ d("span", {
|
|
153
|
+
"aria-hidden": "true",
|
|
154
|
+
"data-ui": "navigation-item-icon",
|
|
155
|
+
css: s,
|
|
156
|
+
children: a
|
|
157
|
+
}), c] }), g = {
|
|
158
|
+
"aria-current": r ? "page" : void 0,
|
|
159
|
+
"aria-disabled": i || void 0,
|
|
160
|
+
tabIndex: i ? -1 : m.tabIndex,
|
|
161
|
+
onClick: i ? (e) => {
|
|
162
|
+
e.preventDefault();
|
|
163
|
+
} : m.onClick
|
|
164
|
+
};
|
|
165
|
+
return /* @__PURE__ */ d("li", {
|
|
166
|
+
"data-ui": "navigation-list-item",
|
|
167
|
+
children: /* @__PURE__ */ d(t, {
|
|
168
|
+
className: l,
|
|
169
|
+
styles: b,
|
|
170
|
+
sx: p,
|
|
171
|
+
children: (t) => n === void 0 ? /* @__PURE__ */ d("span", {
|
|
172
|
+
...m,
|
|
173
|
+
...g,
|
|
174
|
+
ref: e,
|
|
175
|
+
"data-ui": "navigation-item",
|
|
176
|
+
className: t,
|
|
177
|
+
children: h
|
|
178
|
+
}) : /* @__PURE__ */ d("a", {
|
|
179
|
+
...m,
|
|
180
|
+
...g,
|
|
181
|
+
ref: e,
|
|
182
|
+
href: i ? void 0 : n,
|
|
183
|
+
role: i ? "link" : void 0,
|
|
184
|
+
"data-ui": "navigation-item",
|
|
185
|
+
className: t,
|
|
186
|
+
children: h
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
C.displayName = "Navigation.Item";
|
|
192
|
+
var w = Object.assign(x, {
|
|
193
|
+
Group: S,
|
|
194
|
+
Item: C
|
|
195
|
+
});
|
|
196
|
+
//#endregion
|
|
197
|
+
export { w as t };
|
package/dist/navigation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Navigation } from "./navigation-
|
|
2
|
+
export { t as Navigation } from "./navigation-DhnKriOp.js";
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r } from "./media-D_eA_I-e.js";
|
|
5
|
+
import { t as i } from "./visually-hidden-BJdvqqvn.js";
|
|
6
|
+
import { useImperativeHandle as a, useLayoutEffect as o, useMemo as s, useRef as c } from "react";
|
|
7
|
+
import { vars as l } from "@jfrader/tokens/vars";
|
|
8
|
+
import { jsx as u, jsxs as d } from "@emotion/react/jsx-runtime";
|
|
9
|
+
//#region src/components/pagination/pagination.tsx
|
|
10
|
+
var f = 50, p = 105, m = (e) => Math.max(0, Math.floor(Number.isFinite(e) ? e : 0)), h = (e, t) => Array.from({ length: Math.min(p, Math.max(0, t - e + 1)) }, (t, n) => e + n);
|
|
11
|
+
function g(e, t, n) {
|
|
12
|
+
let r = n * 2 + 5;
|
|
13
|
+
if (t <= r) return h(1, t);
|
|
14
|
+
let i = Math.max(e - n, 1), a = Math.min(e + n, t), o = i > 3, s = a < t - 2, c = r - 2;
|
|
15
|
+
return o ? s ? [
|
|
16
|
+
1,
|
|
17
|
+
"start-ellipsis",
|
|
18
|
+
...h(i, a),
|
|
19
|
+
"end-ellipsis",
|
|
20
|
+
t
|
|
21
|
+
] : [
|
|
22
|
+
1,
|
|
23
|
+
"start-ellipsis",
|
|
24
|
+
...h(t - c + 1, t)
|
|
25
|
+
] : [
|
|
26
|
+
...h(1, c),
|
|
27
|
+
"end-ellipsis",
|
|
28
|
+
t
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
var _ = e({
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexWrap: "wrap",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
gap: l.space[1],
|
|
36
|
+
margin: 0,
|
|
37
|
+
padding: 0,
|
|
38
|
+
listStyle: "none",
|
|
39
|
+
fontFamily: l.font.sans,
|
|
40
|
+
fontSize: l.textSize.sm,
|
|
41
|
+
lineHeight: l.lineHeight.tight
|
|
42
|
+
}), v = e({
|
|
43
|
+
display: "inline-flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
minInlineSize: "32px",
|
|
47
|
+
blockSize: "32px"
|
|
48
|
+
}), y = e({
|
|
49
|
+
position: "relative",
|
|
50
|
+
appearance: "none",
|
|
51
|
+
paddingInline: l.space[2],
|
|
52
|
+
border: "1px solid transparent",
|
|
53
|
+
borderRadius: l.radius.md,
|
|
54
|
+
background: "transparent",
|
|
55
|
+
color: l.color.text,
|
|
56
|
+
font: "inherit",
|
|
57
|
+
fontVariantNumeric: "tabular-nums",
|
|
58
|
+
cursor: "pointer",
|
|
59
|
+
transitionProperty: "background-color, border-color, color",
|
|
60
|
+
transitionDuration: l.motion.duration.fast,
|
|
61
|
+
transitionTimingFunction: l.motion.easeStandard,
|
|
62
|
+
"&:hover:not(:disabled):not([aria-current=\"page\"])": { backgroundColor: l.color.surfaceHover },
|
|
63
|
+
"&[aria-current=\"page\"]": {
|
|
64
|
+
backgroundColor: l.color.accentSoft,
|
|
65
|
+
borderColor: l.color.accentBorder,
|
|
66
|
+
color: l.color.accentText,
|
|
67
|
+
fontWeight: l.fontWeight.semibold
|
|
68
|
+
},
|
|
69
|
+
"&:disabled": {
|
|
70
|
+
cursor: "not-allowed",
|
|
71
|
+
opacity: .55
|
|
72
|
+
},
|
|
73
|
+
"&:focus-visible": { ...n },
|
|
74
|
+
[r]: { transitionDuration: "0s" }
|
|
75
|
+
}), b = e({ color: l.color.textMuted }), x = e({
|
|
76
|
+
display: "inline-block",
|
|
77
|
+
"&:dir(rtl)": { transform: "scaleX(-1)" }
|
|
78
|
+
});
|
|
79
|
+
function S({ ref: e, page: n, totalPages: r, onPageChange: l, siblingCount: p = 1, label: h = "Pagination", previousLabel: S = "Previous page", nextLabel: C = "Next page", locale: w = typeof navigator > "u" ? void 0 : navigator.language, className: T, sx: E, ...D }) {
|
|
80
|
+
let O = m(r), k = Math.min(Math.max(m(n), 1), Math.max(O, 1)), A = g(k, O, Math.min(m(p), f)), j = s(() => new Intl.NumberFormat(w), [w]), M = c(null);
|
|
81
|
+
a(e, () => M.current, []);
|
|
82
|
+
let N = c(!1);
|
|
83
|
+
o(() => {
|
|
84
|
+
let e = M.current;
|
|
85
|
+
if (!N.current || !e) return;
|
|
86
|
+
N.current = !1;
|
|
87
|
+
let t = e.ownerDocument.activeElement;
|
|
88
|
+
(t === e.ownerDocument.body || t && e.contains(t) && t.matches(":disabled")) && e.querySelector("[aria-current=\"page\"]")?.focus();
|
|
89
|
+
}, [k]);
|
|
90
|
+
let P = (e, t = !1) => {
|
|
91
|
+
N.current = t && (e <= 1 || e >= O), e !== k && l?.(e);
|
|
92
|
+
};
|
|
93
|
+
return /* @__PURE__ */ u(t, {
|
|
94
|
+
className: T,
|
|
95
|
+
sx: E,
|
|
96
|
+
children: (e) => /* @__PURE__ */ u("nav", {
|
|
97
|
+
...D,
|
|
98
|
+
ref: M,
|
|
99
|
+
"aria-label": h,
|
|
100
|
+
"data-ui": "pagination",
|
|
101
|
+
className: e,
|
|
102
|
+
children: /* @__PURE__ */ d("ul", {
|
|
103
|
+
css: _,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
|
|
106
|
+
type: "button",
|
|
107
|
+
disabled: k <= 1,
|
|
108
|
+
onClick: () => P(k - 1, !0),
|
|
109
|
+
"data-ui": "pagination-previous",
|
|
110
|
+
css: [v, y],
|
|
111
|
+
children: [/* @__PURE__ */ u("span", {
|
|
112
|
+
"aria-hidden": "true",
|
|
113
|
+
css: x,
|
|
114
|
+
children: "‹"
|
|
115
|
+
}), /* @__PURE__ */ u("span", {
|
|
116
|
+
css: i,
|
|
117
|
+
children: S
|
|
118
|
+
})]
|
|
119
|
+
}) }),
|
|
120
|
+
A.map((e) => typeof e == "number" ? /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("button", {
|
|
121
|
+
type: "button",
|
|
122
|
+
"aria-current": e === k ? "page" : void 0,
|
|
123
|
+
"aria-label": j.format(e),
|
|
124
|
+
onClick: () => P(e),
|
|
125
|
+
"data-ui": "pagination-page",
|
|
126
|
+
css: [v, y],
|
|
127
|
+
children: j.format(e)
|
|
128
|
+
}) }, e) : /* @__PURE__ */ u("li", { children: /* @__PURE__ */ u("span", {
|
|
129
|
+
"aria-hidden": "true",
|
|
130
|
+
"data-ui": "pagination-ellipsis",
|
|
131
|
+
css: [v, b],
|
|
132
|
+
children: "…"
|
|
133
|
+
}) }, e)),
|
|
134
|
+
/* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("button", {
|
|
135
|
+
type: "button",
|
|
136
|
+
disabled: k >= O,
|
|
137
|
+
onClick: () => P(k + 1, !0),
|
|
138
|
+
"data-ui": "pagination-next",
|
|
139
|
+
css: [v, y],
|
|
140
|
+
children: [/* @__PURE__ */ u("span", {
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
css: x,
|
|
143
|
+
children: "›"
|
|
144
|
+
}), /* @__PURE__ */ u("span", {
|
|
145
|
+
css: i,
|
|
146
|
+
children: C
|
|
147
|
+
})]
|
|
148
|
+
}) })
|
|
149
|
+
]
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
S.displayName = "Pagination";
|
|
155
|
+
//#endregion
|
|
156
|
+
export { S as t };
|
package/dist/pagination.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Pagination } from "./pagination-
|
|
2
|
+
export { t as Pagination } from "./pagination-DYdwsxwe.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef as t } from "react";
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
4
3
|
import { vars as n } from "@jfrader/tokens/vars";
|
|
5
4
|
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
6
5
|
//#region src/components/pill/pill.tsx
|
|
@@ -37,14 +36,21 @@ var i = e({
|
|
|
37
36
|
backgroundColor: n.color.dangerSoft,
|
|
38
37
|
color: n.color.dangerText
|
|
39
38
|
})
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
};
|
|
40
|
+
function o({ ref: e, tone: n = "neutral", className: o, sx: s, ...c }) {
|
|
41
|
+
return /* @__PURE__ */ r(t, {
|
|
42
|
+
className: o,
|
|
43
|
+
styles: [i, a[n]],
|
|
44
|
+
sx: s,
|
|
45
|
+
children: (t) => /* @__PURE__ */ r("span", {
|
|
46
|
+
...c,
|
|
47
|
+
ref: e,
|
|
48
|
+
"data-ui": "pill",
|
|
49
|
+
"data-tone": n,
|
|
50
|
+
className: t
|
|
51
|
+
})
|
|
47
52
|
});
|
|
48
|
-
}
|
|
53
|
+
}
|
|
54
|
+
o.displayName = "Pill";
|
|
49
55
|
//#endregion
|
|
50
56
|
export { o as t };
|
package/dist/pill.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Pill } from "./pill-
|
|
2
|
+
export { t as Pill } from "./pill-DO2gHzMb.js";
|