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