@jfrader/ui 0.1.1 → 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 +3 -1
- package/dist/accordion-CkOZ-tvs.js +178 -0
- package/dist/accordion.js +2 -1
- package/dist/alert-Dsjx14UW.js +131 -0
- package/dist/alert.js +2 -1
- package/dist/avatar-BRGKkoSr.js +127 -0
- package/dist/avatar.js +2 -1
- package/dist/badge-DLxUMsCx.js +104 -0
- package/dist/badge.js +2 -1
- package/dist/breadcrumbs-694hF_hm.js +131 -0
- package/dist/breadcrumbs.js +2 -1
- package/dist/button-CoaIcykB.js +190 -0
- package/dist/button.js +2 -1
- package/dist/calendar-Doj7PTdG.js +379 -0
- package/dist/calendar.js +2 -1
- package/dist/card-2IM71XZj.js +134 -0
- package/dist/card.js +2 -1
- package/dist/checkbox-B7xGNFzp.js +136 -0
- package/dist/checkbox.js +2 -1
- package/dist/{choice-control-DCyQ_hVw.js → choice-control-ByFogYcT.js} +2 -1
- package/dist/{collection-registry-C2jnQa7X.js → collection-registry-1l9f3XJZ.js} +3 -2
- package/dist/combobox-Bjhxv5U3.js +311 -0
- package/dist/combobox.js +2 -1
- package/dist/command-palette-BhJwm6cS.js +344 -0
- package/dist/command-palette.js +2 -1
- package/dist/container-BhnrGPu-.js +36 -0
- package/dist/container.js +2 -1
- package/dist/{css-CW_HG55W.js → css-Cgj6sCHn.js} +1 -0
- package/dist/date-picker-Jk8SpoiO.js +245 -0
- package/dist/date-picker.js +2 -1
- package/dist/dialog-fhS07G41.js +187 -0
- package/dist/dialog.js +2 -1
- package/dist/{disclosure-caret-BC6P8AsM.js → disclosure-caret-C5T3fcl6.js} +1 -0
- package/dist/divider-v_78HYF5.js +79 -0
- package/dist/divider.js +2 -1
- package/dist/{field-anatomy-DKkB268x.js → field-anatomy-BzGw1Ch9.js} +4 -3
- package/dist/flex-COZzFqI8.js +22 -0
- package/dist/flex.js +2 -1
- package/dist/{focus-ring-qOS3rPlM.js → focus-ring-BK5W5_NY.js} +1 -0
- package/dist/{icon-wrapper-BKo4FI-O.js → icon-wrapper-CFWzew5m.js} +2 -1
- package/dist/index.js +37 -36
- package/dist/kbd-CeP8Kfvp.js +61 -0
- package/dist/kbd.js +2 -1
- package/dist/{layout-style-B_6YHQ6Q.js → layout-style-7ZTOiWGR.js} +2 -1
- package/dist/{loading-ring-CTpT-IrT.js → loading-ring-BpdB0aFi.js} +2 -1
- package/dist/{media-8K3xDAxM.js → media-D_eA_I-e.js} +1 -0
- package/dist/menu-B6KCbLCr.js +196 -0
- package/dist/menu.js +2 -1
- package/dist/navigation-BDht6S2-.js +182 -0
- package/dist/navigation.js +2 -1
- package/dist/pagination-B50PCaDU.js +151 -0
- package/dist/pagination.js +2 -1
- package/dist/{part-id-Bg1LSlk7.js → part-id-D0zksy32.js} +1 -0
- package/dist/pill-2_XzBdkD.js +51 -0
- package/dist/pill.js +2 -1
- package/dist/popover-DRHbeIVq.js +103 -0
- package/dist/popover.js +2 -1
- package/dist/progress-CpsskKTD.js +85 -0
- package/dist/progress.js +2 -1
- package/dist/radio-group-DPI5KUCj.js +136 -0
- package/dist/radio-group.js +2 -1
- package/dist/{renderable-DwPvt1I8.js → renderable-DzcIj1Lo.js} +1 -0
- package/dist/{roving-focus-DeEZ55-T.js → roving-focus-CYlo_Kf8.js} +1 -0
- package/dist/select-C1xGrOhT.js +266 -0
- package/dist/select.js +2 -1
- package/dist/skeleton-DitdP-yz.js +49 -0
- package/dist/skeleton.js +2 -1
- package/dist/spinner-CFq5HPoo.js +51 -0
- package/dist/spinner.js +2 -1
- package/dist/stack-D_g6NJzo.js +21 -0
- package/dist/stack.js +2 -1
- package/dist/{surface-Bo_aSQOb.js → surface-DZ4d-2aL.js} +1 -0
- package/dist/switch-B5TTU-oJ.js +138 -0
- package/dist/switch.js +2 -1
- package/dist/tabs-C26PWl2c.js +183 -0
- package/dist/tabs.js +2 -1
- package/dist/text-field-8PQAqRpM.js +75 -0
- package/dist/text-field.js +2 -1
- package/dist/textarea-CcGWuntL.js +85 -0
- package/dist/textarea.js +2 -1
- package/dist/theme-root-BRLIA4eb.js +22 -0
- package/dist/theme-root.js +2 -1
- package/dist/toast-B1PXuwZ4.js +277 -0
- package/dist/toast.js +2 -1
- package/dist/toggle-group-N_owicT0.js +156 -0
- package/dist/toggle-group.js +2 -1
- package/dist/tooltip-BJPisf60.js +98 -0
- package/dist/tooltip.js +2 -1
- package/dist/{trigger-style-f54idgjT.js → trigger-style-B1GFmH7M.js} +2 -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/dist/{use-controlled-state-DQXkiTQI.js → use-controlled-state-CVXDa-qM.js} +1 -0
- package/dist/{use-native-dialog-BCp1chwO.js → use-native-dialog-DWpIUVO1.js} +1 -0
- package/dist/{use-overlay-floating-CsZd3qxa.js → use-overlay-floating-efeqppiw.js} +1 -0
- package/dist/{visually-hidden-BXVyhj0y.js → visually-hidden-DCWhf0Cb.js} +2 -1
- package/package.json +4 -4
- package/dist/accordion-Dl-kvgPQ.js +0 -168
- package/dist/alert-BzntPa_5.js +0 -129
- package/dist/avatar-Dk2ES3ru.js +0 -124
- package/dist/badge-DZefC7rm.js +0 -102
- package/dist/breadcrumbs-5MCZ_Jr3.js +0 -125
- package/dist/button-qy-50NPd.js +0 -187
- package/dist/calendar-DcCAiN3b.js +0 -372
- package/dist/card-L-Z_1vZN.js +0 -120
- package/dist/checkbox-B7em7B-6.js +0 -134
- package/dist/combobox-DQcXR94r.js +0 -301
- package/dist/command-palette-BRJ8A5De.js +0 -328
- package/dist/container-COHiEjI8.js +0 -34
- package/dist/date-picker-D1GwiRB9.js +0 -239
- package/dist/dialog-CYf9fCZO.js +0 -175
- package/dist/divider-bi7OgCI5.js +0 -76
- package/dist/flex-CDFDDaiu.js +0 -21
- package/dist/kbd-DpiJgDJ2.js +0 -55
- package/dist/menu-A9fZUaAG.js +0 -186
- package/dist/navigation-Cemnmc_J.js +0 -174
- package/dist/pagination-orCjUsn_.js +0 -148
- package/dist/pill-Dg2JJHHW.js +0 -49
- package/dist/popover-D_YU34WS.js +0 -97
- package/dist/progress-XdvBG0Vv.js +0 -83
- package/dist/radio-group-CxMJ2Vq7.js +0 -130
- package/dist/select-mwFbmzsn.js +0 -256
- package/dist/skeleton-qas9ZKK9.js +0 -47
- package/dist/spinner-ros2CfIf.js +0 -49
- package/dist/stack-Hs8THnIL.js +0 -20
- package/dist/switch-E375Bz4X.js +0 -135
- package/dist/tabs-CBwRiuul.js +0 -173
- package/dist/text-field-BlP8qGn_.js +0 -73
- package/dist/textarea-CUG26CH2.js +0 -83
- package/dist/theme-root-CrdzwfSo.js +0 -20
- package/dist/toast-D_dnqnn-.js +0 -270
- package/dist/toggle-group-B7gXCea8.js +0 -150
- package/dist/tooltip-BJ2hLV1b.js +0 -92
|
@@ -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 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
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 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
export { t as Navigation } from "./navigation-BDht6S2-.js";
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./css-Cgj6sCHn.js";
|
|
3
|
+
import { n as t } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n } from "./media-D_eA_I-e.js";
|
|
5
|
+
import { t as r } from "./visually-hidden-DCWhf0Cb.js";
|
|
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
|
+
//#region src/components/pagination/pagination.tsx
|
|
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
|
+
let r = n * 2 + 5;
|
|
13
|
+
if (t <= r) return m(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
|
+
...m(i, a),
|
|
19
|
+
"end-ellipsis",
|
|
20
|
+
t
|
|
21
|
+
] : [
|
|
22
|
+
1,
|
|
23
|
+
"start-ellipsis",
|
|
24
|
+
...m(t - c + 1, t)
|
|
25
|
+
] : [
|
|
26
|
+
...m(1, c),
|
|
27
|
+
"end-ellipsis",
|
|
28
|
+
t
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
var g = e({
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexWrap: "wrap",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
gap: c.space[1],
|
|
36
|
+
margin: 0,
|
|
37
|
+
padding: 0,
|
|
38
|
+
listStyle: "none",
|
|
39
|
+
fontFamily: c.font.sans,
|
|
40
|
+
fontSize: c.textSize.sm,
|
|
41
|
+
lineHeight: c.lineHeight.tight
|
|
42
|
+
}), _ = e({
|
|
43
|
+
display: "inline-flex",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
justifyContent: "center",
|
|
46
|
+
minInlineSize: "32px",
|
|
47
|
+
blockSize: "32px"
|
|
48
|
+
}), v = e({
|
|
49
|
+
position: "relative",
|
|
50
|
+
appearance: "none",
|
|
51
|
+
paddingInline: c.space[2],
|
|
52
|
+
border: "1px solid transparent",
|
|
53
|
+
borderRadius: c.radius.md,
|
|
54
|
+
background: "transparent",
|
|
55
|
+
color: c.color.text,
|
|
56
|
+
font: "inherit",
|
|
57
|
+
fontVariantNumeric: "tabular-nums",
|
|
58
|
+
cursor: "pointer",
|
|
59
|
+
transitionProperty: "background-color, border-color, color",
|
|
60
|
+
transitionDuration: c.motion.duration.fast,
|
|
61
|
+
transitionTimingFunction: c.motion.easeStandard,
|
|
62
|
+
"&:hover:not(:disabled):not([aria-current=\"page\"])": { backgroundColor: c.color.surfaceHover },
|
|
63
|
+
"&[aria-current=\"page\"]": {
|
|
64
|
+
backgroundColor: c.color.accentSoft,
|
|
65
|
+
borderColor: c.color.accentBorder,
|
|
66
|
+
color: c.color.accentText,
|
|
67
|
+
fontWeight: c.fontWeight.semibold
|
|
68
|
+
},
|
|
69
|
+
"&:disabled": {
|
|
70
|
+
cursor: "not-allowed",
|
|
71
|
+
opacity: .55
|
|
72
|
+
},
|
|
73
|
+
"&:focus-visible": { ...t },
|
|
74
|
+
[n]: { transitionDuration: "0s" }
|
|
75
|
+
}), y = e({ color: c.color.textMuted }), b = e({
|
|
76
|
+
display: "inline-block",
|
|
77
|
+
"&:dir(rtl)": { transform: "scaleX(-1)" }
|
|
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(() => {
|
|
84
|
+
let e = k.current;
|
|
85
|
+
if (!A.current || !e) return;
|
|
86
|
+
A.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
|
+
}, [E]);
|
|
90
|
+
let j = (e, t = !1) => {
|
|
91
|
+
A.current = t && (e <= 1 || e >= T), e !== E && c?.(e);
|
|
92
|
+
};
|
|
93
|
+
return /* @__PURE__ */ l("nav", {
|
|
94
|
+
...w,
|
|
95
|
+
ref: k,
|
|
96
|
+
"aria-label": m,
|
|
97
|
+
"data-ui": "pagination",
|
|
98
|
+
children: /* @__PURE__ */ u("ul", {
|
|
99
|
+
css: g,
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ l("li", { children: /* @__PURE__ */ u("button", {
|
|
102
|
+
type: "button",
|
|
103
|
+
disabled: E <= 1,
|
|
104
|
+
onClick: () => j(E - 1, !0),
|
|
105
|
+
"data-ui": "pagination-previous",
|
|
106
|
+
css: [_, v],
|
|
107
|
+
children: [/* @__PURE__ */ l("span", {
|
|
108
|
+
"aria-hidden": "true",
|
|
109
|
+
css: b,
|
|
110
|
+
children: "‹"
|
|
111
|
+
}), /* @__PURE__ */ l("span", {
|
|
112
|
+
css: r,
|
|
113
|
+
children: x
|
|
114
|
+
})]
|
|
115
|
+
}) }),
|
|
116
|
+
D.map((e) => typeof e == "number" ? /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
"aria-current": e === E ? "page" : void 0,
|
|
119
|
+
"aria-label": O.format(e),
|
|
120
|
+
onClick: () => j(e),
|
|
121
|
+
"data-ui": "pagination-page",
|
|
122
|
+
css: [_, v],
|
|
123
|
+
children: O.format(e)
|
|
124
|
+
}) }, e) : /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l("span", {
|
|
125
|
+
"aria-hidden": "true",
|
|
126
|
+
"data-ui": "pagination-ellipsis",
|
|
127
|
+
css: [_, y],
|
|
128
|
+
children: "…"
|
|
129
|
+
}) }, e)),
|
|
130
|
+
/* @__PURE__ */ l("li", { children: /* @__PURE__ */ u("button", {
|
|
131
|
+
type: "button",
|
|
132
|
+
disabled: E >= T,
|
|
133
|
+
onClick: () => j(E + 1, !0),
|
|
134
|
+
"data-ui": "pagination-next",
|
|
135
|
+
css: [_, v],
|
|
136
|
+
children: [/* @__PURE__ */ l("span", {
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
css: b,
|
|
139
|
+
children: "›"
|
|
140
|
+
}), /* @__PURE__ */ l("span", {
|
|
141
|
+
css: r,
|
|
142
|
+
children: S
|
|
143
|
+
})]
|
|
144
|
+
}) })
|
|
145
|
+
]
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
x.displayName = "Pagination";
|
|
150
|
+
//#endregion
|
|
151
|
+
export { x as t };
|
package/dist/pagination.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
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 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
export { t as Pill } from "./pill-2_XzBdkD.js";
|