@jfrader/ui 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion-Bd-j04hW.js +198 -0
- package/dist/accordion.js +1 -1
- package/dist/alert-BBqaKI4k.js +135 -0
- package/dist/alert.js +1 -1
- package/dist/avatar-BahDVO9t.js +132 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-B_sLygxU.js +108 -0
- package/dist/badge.js +1 -1
- package/dist/breadcrumbs-DVAOxfvL.js +141 -0
- package/dist/breadcrumbs.js +1 -1
- package/dist/button-P2e7_44z.js +200 -0
- package/dist/button.js +1 -1
- package/dist/calendar-C9Yad_-w.js +394 -0
- package/dist/calendar.js +1 -1
- package/dist/card-D-aI2QHx.js +158 -0
- package/dist/card.js +1 -1
- package/dist/checkbox-COYG6L7d.js +140 -0
- package/dist/checkbox.js +1 -1
- package/dist/{choice-control-ByFogYcT.js → choice-control-5kJkLXgv.js} +1 -1
- package/dist/{collection-registry-1l9f3XJZ.js → collection-registry-BTYi6zGh.js} +1 -1
- package/dist/combobox-DiMC2g_u.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-C29Uo4Tx.js +250 -0
- package/dist/date-picker.js +1 -1
- package/dist/dialog-xaydbXl2.js +218 -0
- package/dist/dialog.js +1 -1
- package/dist/divider-DYoJf0I_.js +84 -0
- package/dist/divider.js +1 -1
- package/dist/field-anatomy-D2ToMeRa.js +109 -0
- package/dist/flex-Dh-_J5-U.js +28 -0
- package/dist/flex.js +1 -1
- package/dist/{icon-wrapper-CFWzew5m.js → icon-wrapper-stN8sD7R.js} +1 -1
- package/dist/index.js +38 -37
- package/dist/kbd-C3ACoMoE.js +71 -0
- package/dist/kbd.js +1 -1
- package/dist/{layout-style-7ZTOiWGR.js → layout-style-Cbd1Vilw.js} +1 -1
- package/dist/{loading-ring-BpdB0aFi.js → loading-ring-B8-30Dl1.js} +1 -1
- package/dist/menu-CGPTNRnF.js +216 -0
- package/dist/menu.js +1 -1
- package/dist/navigation-DhnKriOp.js +197 -0
- package/dist/navigation.js +1 -1
- package/dist/pagination-DYdwsxwe.js +156 -0
- package/dist/pagination.js +1 -1
- package/dist/pill-DO2gHzMb.js +56 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CdRXjQqI.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-BgG7WgSh.js +286 -0
- package/dist/select.js +1 -1
- package/dist/skeleton-OoFlOEXO.js +54 -0
- package/dist/skeleton.js +1 -1
- package/dist/spinner-C2YDoiMn.js +56 -0
- package/dist/spinner.js +1 -1
- package/dist/stack-DC3IbtWk.js +27 -0
- package/dist/stack.js +1 -1
- package/dist/switch-Dr-qjmT4.js +142 -0
- package/dist/switch.js +1 -1
- package/dist/sx-Dx9JUKp5.js +23 -0
- package/dist/tabs-CK_g1RKa.js +203 -0
- package/dist/tabs.js +1 -1
- package/dist/{text-field-8PQAqRpM.js → text-field-D60ok14S.js} +19 -18
- package/dist/text-field.js +1 -1
- package/dist/{textarea-CcGWuntL.js → textarea-DyfjtP0A.js} +19 -18
- package/dist/textarea.js +1 -1
- package/dist/theme-root-BbTBuLMQ.js +46 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-t7nAKc2c.js +27 -0
- package/dist/toast-CjmELMZZ.js +283 -0
- package/dist/toast.js +1 -1
- package/dist/toggle-group-CI0e7hFm.js +166 -0
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CaL3rKbV.js +108 -0
- package/dist/tooltip.js +1 -1
- package/dist/{trigger-style-B1GFmH7M.js → trigger-style-B1KVC8O1.js} +1 -1
- package/dist/types/components/accordion/accordion.d.ts +9 -8
- package/dist/types/components/alert/alert.d.ts +3 -2
- package/dist/types/components/avatar/avatar.d.ts +3 -2
- package/dist/types/components/badge/badge.d.ts +3 -2
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +5 -4
- package/dist/types/components/button/button.d.ts +3 -2
- package/dist/types/components/calendar/calendar.d.ts +7 -6
- package/dist/types/components/card/card.d.ts +13 -12
- package/dist/types/components/checkbox/checkbox.d.ts +3 -2
- package/dist/types/components/combobox/combobox.d.ts +8 -7
- package/dist/types/components/command-palette/command-palette.d.ts +15 -14
- package/dist/types/components/container/container.d.ts +3 -2
- package/dist/types/components/date-picker/date-picker.d.ts +3 -2
- package/dist/types/components/dialog/dialog.d.ts +11 -10
- package/dist/types/components/divider/divider.d.ts +3 -2
- package/dist/types/components/field/field-anatomy.d.ts +3 -2
- package/dist/types/components/flex/flex.d.ts +3 -2
- package/dist/types/components/kbd/kbd.d.ts +5 -4
- package/dist/types/components/menu/menu.d.ts +9 -8
- package/dist/types/components/navigation/navigation.d.ts +7 -6
- package/dist/types/components/pagination/pagination.d.ts +3 -2
- package/dist/types/components/pill/pill.d.ts +3 -2
- package/dist/types/components/popover/popover.d.ts +5 -4
- package/dist/types/components/progress/progress.d.ts +3 -2
- package/dist/types/components/radio-group/radio-group.d.ts +5 -4
- package/dist/types/components/select/select.d.ts +9 -8
- package/dist/types/components/skeleton/skeleton.d.ts +3 -2
- package/dist/types/components/spinner/spinner.d.ts +3 -2
- package/dist/types/components/stack/stack.d.ts +1 -1
- package/dist/types/components/switch/switch.d.ts +3 -2
- package/dist/types/components/tabs/tabs.d.ts +9 -8
- package/dist/types/components/text-field/text-field.d.ts +3 -2
- package/dist/types/components/textarea/textarea.d.ts +3 -2
- package/dist/types/components/theme-provider/theme-provider.d.ts +11 -0
- package/dist/types/components/theme-root/theme-root.d.ts +11 -4
- package/dist/types/components/toast/toast.d.ts +3 -2
- package/dist/types/components/toggle-group/toggle-group.d.ts +5 -4
- package/dist/types/components/tooltip/tooltip.d.ts +5 -4
- package/dist/types/index.d.ts +4 -0
- package/dist/types/overlay/overlay-portal.d.ts +7 -0
- package/dist/types/styling/css.d.ts +3 -2
- package/dist/types/styling/styled.d.ts +1 -0
- package/dist/types/styling/sx.d.ts +16 -0
- package/dist/types/styling/theme-scope.d.ts +19 -0
- package/dist/types/styling/theme.d.ts +98 -0
- package/dist/use-overlay-floating-Bit-f0FU.js +31 -0
- package/dist/{visually-hidden-DCWhf0Cb.js → visually-hidden-BJdvqqvn.js} +1 -1
- package/package.json +3 -2
- package/dist/accordion-CkOZ-tvs.js +0 -178
- package/dist/alert-Dsjx14UW.js +0 -131
- package/dist/avatar-BRGKkoSr.js +0 -127
- package/dist/badge-DLxUMsCx.js +0 -104
- package/dist/breadcrumbs-694hF_hm.js +0 -131
- package/dist/button-CoaIcykB.js +0 -190
- package/dist/calendar-Doj7PTdG.js +0 -379
- package/dist/card-2IM71XZj.js +0 -134
- package/dist/checkbox-B7xGNFzp.js +0 -136
- package/dist/combobox-Bjhxv5U3.js +0 -311
- package/dist/command-palette-BhJwm6cS.js +0 -344
- package/dist/container-BhnrGPu-.js +0 -36
- package/dist/css-Cgj6sCHn.js +0 -2
- package/dist/date-picker-Jk8SpoiO.js +0 -245
- package/dist/dialog-fhS07G41.js +0 -187
- package/dist/divider-v_78HYF5.js +0 -79
- package/dist/field-anatomy-BzGw1Ch9.js +0 -105
- package/dist/flex-COZzFqI8.js +0 -22
- package/dist/kbd-CeP8Kfvp.js +0 -61
- package/dist/menu-B6KCbLCr.js +0 -196
- package/dist/navigation-BDht6S2-.js +0 -182
- package/dist/pagination-B50PCaDU.js +0 -151
- package/dist/pill-2_XzBdkD.js +0 -51
- package/dist/popover-DRHbeIVq.js +0 -103
- package/dist/progress-CpsskKTD.js +0 -85
- package/dist/radio-group-DPI5KUCj.js +0 -136
- package/dist/select-C1xGrOhT.js +0 -266
- package/dist/skeleton-DitdP-yz.js +0 -49
- package/dist/spinner-CFq5HPoo.js +0 -51
- package/dist/stack-D_g6NJzo.js +0 -21
- package/dist/switch-B5TTU-oJ.js +0 -138
- package/dist/tabs-C26PWl2c.js +0 -183
- package/dist/theme-root-BRLIA4eb.js +0 -22
- package/dist/toast-B1PXuwZ4.js +0 -277
- package/dist/toggle-group-N_owicT0.js +0 -156
- package/dist/tooltip-BJPisf60.js +0 -98
- package/dist/use-overlay-floating-efeqppiw.js +0 -19
|
@@ -0,0 +1,198 @@
|
|
|
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 } from "./media-D_eA_I-e.js";
|
|
6
|
+
import { n as a } from "./roving-focus-CYlo_Kf8.js";
|
|
7
|
+
import { t as o } from "./use-controlled-state-CVXDa-qM.js";
|
|
8
|
+
import { createContext as s, useContext as c, useId as l, useMemo as u } from "react";
|
|
9
|
+
import { vars as d } from "@jfrader/tokens/vars";
|
|
10
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
11
|
+
//#region src/components/accordion/accordion.tsx
|
|
12
|
+
var p = s(null), m = s(null);
|
|
13
|
+
function h(e) {
|
|
14
|
+
let t = c(p);
|
|
15
|
+
if (!t) throw Error(`Accordion.${e} must be rendered inside <Accordion>.`);
|
|
16
|
+
return t;
|
|
17
|
+
}
|
|
18
|
+
function g(e) {
|
|
19
|
+
let t = c(m);
|
|
20
|
+
if (!t) throw Error(`Accordion.${e} must be rendered inside <Accordion.Item>.`);
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
var _ = "", v = {
|
|
24
|
+
itemSelector: "[data-ui=\"accordion-trigger\"]:not([disabled])",
|
|
25
|
+
ownerSelector: "[data-ui=\"accordion\"]"
|
|
26
|
+
}, y = (e, t) => {
|
|
27
|
+
if (t === "multiple" && Array.isArray(e)) return e;
|
|
28
|
+
let n = Array.isArray(e) ? e[0] : e;
|
|
29
|
+
return n === void 0 || n === _ ? [] : [n];
|
|
30
|
+
}, b = e({
|
|
31
|
+
borderBlockEnd: `1px solid ${d.color.border}`,
|
|
32
|
+
"&:first-of-type": { borderBlockStart: `1px solid ${d.color.border}` }
|
|
33
|
+
}), x = e({
|
|
34
|
+
margin: 0,
|
|
35
|
+
font: "inherit"
|
|
36
|
+
}), S = e({
|
|
37
|
+
appearance: "none",
|
|
38
|
+
display: "flex",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
justifyContent: "space-between",
|
|
41
|
+
gap: d.space[3],
|
|
42
|
+
inlineSize: "100%",
|
|
43
|
+
border: 0,
|
|
44
|
+
background: "transparent",
|
|
45
|
+
cursor: "pointer",
|
|
46
|
+
paddingBlock: d.space[3],
|
|
47
|
+
paddingInline: d.space[4],
|
|
48
|
+
font: "inherit",
|
|
49
|
+
fontSize: d.textSize.sm,
|
|
50
|
+
fontWeight: d.fontWeight.medium,
|
|
51
|
+
color: d.color.text,
|
|
52
|
+
textAlign: "start",
|
|
53
|
+
transitionProperty: "background-color",
|
|
54
|
+
transitionDuration: d.motion.duration.fast,
|
|
55
|
+
transitionTimingFunction: d.motion.easeStandard,
|
|
56
|
+
"&::after": { ...n },
|
|
57
|
+
"&[aria-expanded=\"true\"]::after": { transform: "rotate(90deg)" },
|
|
58
|
+
"&[aria-expanded=\"true\"]:dir(rtl)::after": { transform: "rotate(-90deg)" },
|
|
59
|
+
"&:hover:not(:disabled):not([aria-disabled=\"true\"])": { backgroundColor: d.color.surfaceHover },
|
|
60
|
+
"&[aria-disabled=\"true\"]": { cursor: "default" },
|
|
61
|
+
"&:disabled": {
|
|
62
|
+
opacity: .55,
|
|
63
|
+
cursor: "not-allowed"
|
|
64
|
+
},
|
|
65
|
+
"&:focus-visible": { ...r },
|
|
66
|
+
[i]: {
|
|
67
|
+
transitionDuration: "0s",
|
|
68
|
+
"&::after": { transitionDuration: "0s" }
|
|
69
|
+
}
|
|
70
|
+
}), C = e({
|
|
71
|
+
paddingBlock: d.space[3],
|
|
72
|
+
paddingInline: d.space[4],
|
|
73
|
+
color: d.color.textMuted,
|
|
74
|
+
lineHeight: d.lineHeight.relaxed,
|
|
75
|
+
"&[hidden]": { display: "none" }
|
|
76
|
+
});
|
|
77
|
+
function w({ ref: e, value: n, defaultValue: r, onValueChange: i, type: s = "single", collapsible: c = !0, onKeyDown: l, className: d, sx: m, ...h }) {
|
|
78
|
+
let [g, b] = o(n, r, i), x = u(() => {
|
|
79
|
+
let e = y(g, s), t = c || e.length > 1;
|
|
80
|
+
return {
|
|
81
|
+
openValues: e,
|
|
82
|
+
toggle: (n) => {
|
|
83
|
+
let r = e.includes(n);
|
|
84
|
+
(!r || t) && b(s === "multiple" ? r ? e.filter((e) => e !== n) : [...e, n] : r ? _ : n);
|
|
85
|
+
},
|
|
86
|
+
canCollapse: t
|
|
87
|
+
};
|
|
88
|
+
}, [
|
|
89
|
+
g,
|
|
90
|
+
b,
|
|
91
|
+
s,
|
|
92
|
+
c
|
|
93
|
+
]), S = (e) => {
|
|
94
|
+
l?.(e), !e.defaultPrevented && a(e, e.currentTarget, "vertical", v);
|
|
95
|
+
};
|
|
96
|
+
return /* @__PURE__ */ f(p.Provider, {
|
|
97
|
+
value: x,
|
|
98
|
+
children: /* @__PURE__ */ f(t, {
|
|
99
|
+
className: d,
|
|
100
|
+
sx: m,
|
|
101
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
102
|
+
...h,
|
|
103
|
+
ref: e,
|
|
104
|
+
"data-ui": "accordion",
|
|
105
|
+
onKeyDown: S,
|
|
106
|
+
className: t
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
w.displayName = "Accordion";
|
|
112
|
+
function T({ ref: e, value: n, disabled: r = !1, className: i, sx: a, ...o }) {
|
|
113
|
+
let { openValues: s } = h("Item"), c = l(), d = s.includes(n), p = u(() => ({
|
|
114
|
+
value: n,
|
|
115
|
+
disabled: r,
|
|
116
|
+
expanded: d,
|
|
117
|
+
triggerId: `${c}-trigger`,
|
|
118
|
+
panelId: `${c}-panel`
|
|
119
|
+
}), [
|
|
120
|
+
n,
|
|
121
|
+
r,
|
|
122
|
+
d,
|
|
123
|
+
c
|
|
124
|
+
]);
|
|
125
|
+
return /* @__PURE__ */ f(m.Provider, {
|
|
126
|
+
value: p,
|
|
127
|
+
children: /* @__PURE__ */ f(t, {
|
|
128
|
+
className: i,
|
|
129
|
+
styles: b,
|
|
130
|
+
sx: a,
|
|
131
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
132
|
+
...o,
|
|
133
|
+
ref: e,
|
|
134
|
+
"data-ui": "accordion-item",
|
|
135
|
+
"data-state": d ? "open" : "closed",
|
|
136
|
+
"data-disabled": r ? "" : void 0,
|
|
137
|
+
className: t
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
T.displayName = "Accordion.Item";
|
|
143
|
+
function E({ ref: e, onClick: n, disabled: r, className: i, sx: a, ...o }) {
|
|
144
|
+
let { toggle: s, canCollapse: c } = h("Trigger"), { value: l, disabled: u, expanded: d, triggerId: p, panelId: m } = g("Trigger"), _ = d && !c, v = (e) => {
|
|
145
|
+
n?.(e), !e.defaultPrevented && s(l);
|
|
146
|
+
};
|
|
147
|
+
return /* @__PURE__ */ f("h3", {
|
|
148
|
+
"data-ui": "accordion-heading",
|
|
149
|
+
css: x,
|
|
150
|
+
children: /* @__PURE__ */ f(t, {
|
|
151
|
+
className: i,
|
|
152
|
+
styles: S,
|
|
153
|
+
sx: a,
|
|
154
|
+
children: (t) => /* @__PURE__ */ f("button", {
|
|
155
|
+
...o,
|
|
156
|
+
ref: e,
|
|
157
|
+
type: "button",
|
|
158
|
+
id: p,
|
|
159
|
+
"data-ui": "accordion-trigger",
|
|
160
|
+
"data-state": d ? "open" : "closed",
|
|
161
|
+
"aria-expanded": d,
|
|
162
|
+
"aria-controls": m,
|
|
163
|
+
"aria-disabled": _ || void 0,
|
|
164
|
+
disabled: u || r,
|
|
165
|
+
onClick: v,
|
|
166
|
+
className: t
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
E.displayName = "Accordion.Trigger";
|
|
172
|
+
function D({ ref: e, "aria-labelledby": n, className: r, sx: i, ...a }) {
|
|
173
|
+
let { expanded: o, triggerId: s, panelId: c } = g("Panel"), l = [n, s].filter(Boolean).join(" ");
|
|
174
|
+
return /* @__PURE__ */ f(t, {
|
|
175
|
+
className: r,
|
|
176
|
+
styles: C,
|
|
177
|
+
sx: i,
|
|
178
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
179
|
+
...a,
|
|
180
|
+
ref: e,
|
|
181
|
+
role: "region",
|
|
182
|
+
id: c,
|
|
183
|
+
"aria-labelledby": l,
|
|
184
|
+
hidden: !o,
|
|
185
|
+
"data-ui": "accordion-panel",
|
|
186
|
+
"data-state": o ? "open" : "closed",
|
|
187
|
+
className: t
|
|
188
|
+
})
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
D.displayName = "Accordion.Panel";
|
|
192
|
+
var O = Object.assign(w, {
|
|
193
|
+
Item: T,
|
|
194
|
+
Trigger: E,
|
|
195
|
+
Panel: D
|
|
196
|
+
});
|
|
197
|
+
//#endregion
|
|
198
|
+
export { O as t };
|
package/dist/accordion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Accordion } from "./accordion-
|
|
2
|
+
export { t as Accordion } from "./accordion-Bd-j04hW.js";
|
|
@@ -0,0 +1,135 @@
|
|
|
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 { t as a } from "./renderable-DzcIj1Lo.js";
|
|
7
|
+
import { vars as o } from "@jfrader/tokens/vars";
|
|
8
|
+
import { jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
|
|
9
|
+
//#region src/components/alert/alert.tsx
|
|
10
|
+
var l = {
|
|
11
|
+
info: "Information",
|
|
12
|
+
success: "Success",
|
|
13
|
+
warning: "Warning",
|
|
14
|
+
danger: "Error"
|
|
15
|
+
}, u = e({
|
|
16
|
+
display: "grid",
|
|
17
|
+
gap: o.space[1],
|
|
18
|
+
boxSizing: "border-box",
|
|
19
|
+
backgroundColor: o.color.surfaceRaised,
|
|
20
|
+
border: `1px solid ${o.color.border}`,
|
|
21
|
+
borderInlineStartWidth: "3px",
|
|
22
|
+
borderInlineStartStyle: "solid",
|
|
23
|
+
borderRadius: o.radius.md,
|
|
24
|
+
paddingBlock: o.space[3],
|
|
25
|
+
paddingInline: o.space[4],
|
|
26
|
+
fontFamily: o.font.sans,
|
|
27
|
+
lineHeight: o.lineHeight.base
|
|
28
|
+
}), d = e({
|
|
29
|
+
gridTemplateColumns: "minmax(0, 1fr) auto",
|
|
30
|
+
columnGap: o.space[3]
|
|
31
|
+
}), f = e({
|
|
32
|
+
display: "grid",
|
|
33
|
+
gap: o.space[1],
|
|
34
|
+
minInlineSize: 0,
|
|
35
|
+
gridColumn: 1,
|
|
36
|
+
gridRow: 1
|
|
37
|
+
}), p = {
|
|
38
|
+
info: e({ borderInlineStartColor: o.color.info }),
|
|
39
|
+
success: e({ borderInlineStartColor: o.color.success }),
|
|
40
|
+
warning: e({ borderInlineStartColor: o.color.warning }),
|
|
41
|
+
danger: e({ borderInlineStartColor: o.color.dangerText })
|
|
42
|
+
}, m = e({
|
|
43
|
+
gridColumn: 1,
|
|
44
|
+
fontSize: o.textSize.sm,
|
|
45
|
+
fontWeight: o.fontWeight.semibold,
|
|
46
|
+
color: o.color.text
|
|
47
|
+
}), h = e({
|
|
48
|
+
gridColumn: 1,
|
|
49
|
+
fontSize: o.textSize.sm,
|
|
50
|
+
color: o.color.textMuted
|
|
51
|
+
}), g = e({
|
|
52
|
+
gridColumn: 2,
|
|
53
|
+
gridRow: 1,
|
|
54
|
+
alignSelf: "start",
|
|
55
|
+
appearance: "none",
|
|
56
|
+
display: "inline-flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "center",
|
|
59
|
+
minInlineSize: "24px",
|
|
60
|
+
minBlockSize: "24px",
|
|
61
|
+
margin: 0,
|
|
62
|
+
padding: 0,
|
|
63
|
+
border: "1px solid transparent",
|
|
64
|
+
borderRadius: o.radius.sm,
|
|
65
|
+
backgroundColor: "transparent",
|
|
66
|
+
fontFamily: "inherit",
|
|
67
|
+
fontSize: o.textSize.md,
|
|
68
|
+
lineHeight: 1,
|
|
69
|
+
color: o.color.textMuted,
|
|
70
|
+
cursor: "pointer",
|
|
71
|
+
transitionProperty: "background-color, color",
|
|
72
|
+
transitionDuration: o.motion.duration.fast,
|
|
73
|
+
transitionTimingFunction: o.motion.easeStandard,
|
|
74
|
+
"&:hover": {
|
|
75
|
+
backgroundColor: o.color.surfaceHover,
|
|
76
|
+
color: o.color.text
|
|
77
|
+
},
|
|
78
|
+
"&:focus-visible": { ...n },
|
|
79
|
+
[r]: { transitionDuration: "0s" }
|
|
80
|
+
});
|
|
81
|
+
function _({ ref: e, tone: n = "info", toneLabel: r = l[n], title: o, children: _, onDismiss: v, dismissLabel: y = "Dismiss", slotProps: b, className: x, sx: S, ...C }) {
|
|
82
|
+
let w = v !== void 0;
|
|
83
|
+
return /* @__PURE__ */ s(t, {
|
|
84
|
+
className: [x, b?.root?.className].filter(Boolean).join(" ") || void 0,
|
|
85
|
+
styles: [
|
|
86
|
+
u,
|
|
87
|
+
p[n],
|
|
88
|
+
w && d,
|
|
89
|
+
b?.root?.css
|
|
90
|
+
],
|
|
91
|
+
sx: S,
|
|
92
|
+
children: (t) => /* @__PURE__ */ c("div", {
|
|
93
|
+
...C,
|
|
94
|
+
ref: e,
|
|
95
|
+
"data-ui": "alert",
|
|
96
|
+
"data-tone": n,
|
|
97
|
+
className: t,
|
|
98
|
+
children: [/* @__PURE__ */ c("div", {
|
|
99
|
+
role: n === "danger" ? "alert" : "status",
|
|
100
|
+
"aria-atomic": "true",
|
|
101
|
+
css: f,
|
|
102
|
+
children: [
|
|
103
|
+
/* @__PURE__ */ s("span", {
|
|
104
|
+
css: i,
|
|
105
|
+
children: r
|
|
106
|
+
}),
|
|
107
|
+
a(o) && /* @__PURE__ */ s("div", {
|
|
108
|
+
className: b?.title?.className,
|
|
109
|
+
css: [m, b?.title?.css],
|
|
110
|
+
children: o
|
|
111
|
+
}),
|
|
112
|
+
a(_) && /* @__PURE__ */ s("div", {
|
|
113
|
+
className: b?.body?.className,
|
|
114
|
+
css: [h, b?.body?.css],
|
|
115
|
+
children: _
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}), w && /* @__PURE__ */ s("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
"data-ui": "alert-dismiss",
|
|
121
|
+
"aria-label": y,
|
|
122
|
+
onClick: () => v?.(),
|
|
123
|
+
className: b?.dismiss?.className,
|
|
124
|
+
css: [g, b?.dismiss?.css],
|
|
125
|
+
children: /* @__PURE__ */ s("span", {
|
|
126
|
+
"aria-hidden": !0,
|
|
127
|
+
children: "×"
|
|
128
|
+
})
|
|
129
|
+
})]
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
_.displayName = "Alert";
|
|
134
|
+
//#endregion
|
|
135
|
+
export { _ as t };
|
package/dist/alert.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Alert } from "./alert-
|
|
2
|
+
export { t as Alert } from "./alert-BBqaKI4k.js";
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { useState as n } from "react";
|
|
4
|
+
import { vars as r } from "@jfrader/tokens/vars";
|
|
5
|
+
import { jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
|
|
6
|
+
//#region src/components/avatar/avatar.tsx
|
|
7
|
+
var o = 2, s = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
8
|
+
function c(e) {
|
|
9
|
+
let t = Array.from(s.segment(e), ({ segment: e }) => e), n = t[0] ?? "";
|
|
10
|
+
if (!/\p{Extended_Pictographic}/u.test(n)) return n;
|
|
11
|
+
let r = "";
|
|
12
|
+
for (let e of t) {
|
|
13
|
+
if (!/\p{Extended_Pictographic}/u.test(e)) break;
|
|
14
|
+
r += e;
|
|
15
|
+
}
|
|
16
|
+
return r;
|
|
17
|
+
}
|
|
18
|
+
function l(e) {
|
|
19
|
+
return e.trim().split(/\s+/).filter(Boolean).slice(0, o).map(c).join("").toLocaleUpperCase();
|
|
20
|
+
}
|
|
21
|
+
var u = e({
|
|
22
|
+
position: "relative",
|
|
23
|
+
display: "inline-flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
flexShrink: 0,
|
|
27
|
+
boxSizing: "border-box",
|
|
28
|
+
borderRadius: r.radius.full,
|
|
29
|
+
backgroundColor: r.color.surfaceHover,
|
|
30
|
+
color: r.color.text,
|
|
31
|
+
fontWeight: r.fontWeight.medium,
|
|
32
|
+
lineHeight: 1,
|
|
33
|
+
userSelect: "none",
|
|
34
|
+
verticalAlign: "middle"
|
|
35
|
+
}), d = {
|
|
36
|
+
sm: e({
|
|
37
|
+
inlineSize: r.space[6],
|
|
38
|
+
blockSize: r.space[6],
|
|
39
|
+
fontSize: r.textSize.xs
|
|
40
|
+
}),
|
|
41
|
+
md: e({
|
|
42
|
+
inlineSize: r.space[8],
|
|
43
|
+
blockSize: r.space[8],
|
|
44
|
+
fontSize: r.textSize.sm
|
|
45
|
+
}),
|
|
46
|
+
lg: e({
|
|
47
|
+
inlineSize: r.space[10],
|
|
48
|
+
blockSize: r.space[10],
|
|
49
|
+
fontSize: r.textSize.md
|
|
50
|
+
})
|
|
51
|
+
}, f = e({
|
|
52
|
+
display: "block",
|
|
53
|
+
inlineSize: "100%",
|
|
54
|
+
blockSize: "100%",
|
|
55
|
+
borderRadius: r.radius.full,
|
|
56
|
+
objectFit: "cover"
|
|
57
|
+
}), p = e({
|
|
58
|
+
position: "absolute",
|
|
59
|
+
insetBlockEnd: 0,
|
|
60
|
+
insetInlineEnd: 0,
|
|
61
|
+
inlineSize: "25%",
|
|
62
|
+
blockSize: "25%",
|
|
63
|
+
"&::before": {
|
|
64
|
+
content: "\"\"",
|
|
65
|
+
position: "absolute",
|
|
66
|
+
insetBlockStart: 0,
|
|
67
|
+
insetInlineStart: 0,
|
|
68
|
+
inlineSize: "100%",
|
|
69
|
+
blockSize: "100%",
|
|
70
|
+
boxSizing: "border-box",
|
|
71
|
+
borderRadius: r.radius.full,
|
|
72
|
+
boxShadow: `0 0 0 2px ${r.color.bg}`
|
|
73
|
+
}
|
|
74
|
+
}), m = {
|
|
75
|
+
online: e({ "&::before": { backgroundColor: r.color.success } }),
|
|
76
|
+
away: e({ "&::before": {
|
|
77
|
+
border: `2px solid ${r.color.warning}`,
|
|
78
|
+
backgroundColor: "transparent"
|
|
79
|
+
} }),
|
|
80
|
+
busy: e({ "&::before": {
|
|
81
|
+
backgroundColor: r.color.danger,
|
|
82
|
+
blockSize: "30%",
|
|
83
|
+
insetBlockStart: "35%"
|
|
84
|
+
} }),
|
|
85
|
+
offline: e({ "&::before": {
|
|
86
|
+
backgroundColor: r.color.textSubtle,
|
|
87
|
+
inlineSize: "60%",
|
|
88
|
+
blockSize: "60%",
|
|
89
|
+
insetBlockStart: "20%",
|
|
90
|
+
insetInlineStart: "20%"
|
|
91
|
+
} })
|
|
92
|
+
};
|
|
93
|
+
function h({ ref: e, name: r, src: o, size: s = "md", status: c, statusLabel: h, slotProps: g, className: _, sx: v, ...y }) {
|
|
94
|
+
let [b, x] = n(), S = o !== void 0 && o !== "" && o !== b, C = c === void 0 ? r : `${r}, ${h ?? c}`;
|
|
95
|
+
return /* @__PURE__ */ i(t, {
|
|
96
|
+
className: _,
|
|
97
|
+
styles: [u, d[s]],
|
|
98
|
+
sx: v,
|
|
99
|
+
children: (t) => /* @__PURE__ */ a("span", {
|
|
100
|
+
...y,
|
|
101
|
+
ref: e,
|
|
102
|
+
"data-ui": "avatar",
|
|
103
|
+
role: "img",
|
|
104
|
+
"aria-label": C,
|
|
105
|
+
className: t,
|
|
106
|
+
children: [S ? /* @__PURE__ */ i("img", {
|
|
107
|
+
src: o,
|
|
108
|
+
alt: "",
|
|
109
|
+
onError: () => x(o),
|
|
110
|
+
className: g?.image?.className,
|
|
111
|
+
css: [f, g?.image?.css]
|
|
112
|
+
}) : /* @__PURE__ */ i("span", {
|
|
113
|
+
"aria-hidden": "true",
|
|
114
|
+
className: g?.fallback?.className,
|
|
115
|
+
css: g?.fallback?.css,
|
|
116
|
+
children: l(r)
|
|
117
|
+
}), c !== void 0 && /* @__PURE__ */ i("span", {
|
|
118
|
+
"aria-hidden": "true",
|
|
119
|
+
"data-status": c,
|
|
120
|
+
className: g?.status?.className,
|
|
121
|
+
css: [
|
|
122
|
+
p,
|
|
123
|
+
m[c],
|
|
124
|
+
g?.status?.css
|
|
125
|
+
]
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
h.displayName = "Avatar";
|
|
131
|
+
//#endregion
|
|
132
|
+
export { h as t };
|
package/dist/avatar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Avatar } from "./avatar-
|
|
2
|
+
export { t as Avatar } from "./avatar-BahDVO9t.js";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { vars as n } from "@jfrader/tokens/vars";
|
|
4
|
+
import { jsx as r, jsxs as i } from "@emotion/react/jsx-runtime";
|
|
5
|
+
//#region src/components/badge/badge.tsx
|
|
6
|
+
var a = 99, o = e({
|
|
7
|
+
position: "relative",
|
|
8
|
+
display: "inline-flex",
|
|
9
|
+
flexShrink: 0,
|
|
10
|
+
verticalAlign: "middle"
|
|
11
|
+
}), s = e({
|
|
12
|
+
position: "absolute",
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
boxSizing: "border-box",
|
|
17
|
+
boxShadow: `0 0 0 2px ${n.color.bg}`,
|
|
18
|
+
fontWeight: n.fontWeight.medium,
|
|
19
|
+
lineHeight: 1,
|
|
20
|
+
whiteSpace: "nowrap",
|
|
21
|
+
pointerEvents: "none"
|
|
22
|
+
}), c = {
|
|
23
|
+
standard: e({
|
|
24
|
+
blockSize: n.space[5],
|
|
25
|
+
minInlineSize: n.space[5],
|
|
26
|
+
paddingInline: n.space[1],
|
|
27
|
+
fontSize: n.textSize.xs
|
|
28
|
+
}),
|
|
29
|
+
dot: e({
|
|
30
|
+
blockSize: n.space[2],
|
|
31
|
+
inlineSize: n.space[2],
|
|
32
|
+
borderRadius: n.radius.full
|
|
33
|
+
})
|
|
34
|
+
}, l = {
|
|
35
|
+
rectangular: e({ borderRadius: n.radius.sm }),
|
|
36
|
+
circular: e({ borderRadius: n.radius.full })
|
|
37
|
+
}, u = {
|
|
38
|
+
"top-start": e({
|
|
39
|
+
insetBlockStart: 0,
|
|
40
|
+
insetInlineStart: 0,
|
|
41
|
+
transform: "translate(-50%, -50%)",
|
|
42
|
+
"&:dir(rtl)": { transform: "translate(50%, -50%)" }
|
|
43
|
+
}),
|
|
44
|
+
"top-end": e({
|
|
45
|
+
insetBlockStart: 0,
|
|
46
|
+
insetInlineEnd: 0,
|
|
47
|
+
transform: "translate(50%, -50%)",
|
|
48
|
+
"&:dir(rtl)": { transform: "translate(-50%, -50%)" }
|
|
49
|
+
}),
|
|
50
|
+
"bottom-start": e({
|
|
51
|
+
insetBlockEnd: 0,
|
|
52
|
+
insetInlineStart: 0,
|
|
53
|
+
transform: "translate(-50%, 50%)",
|
|
54
|
+
"&:dir(rtl)": { transform: "translate(50%, 50%)" }
|
|
55
|
+
}),
|
|
56
|
+
"bottom-end": e({
|
|
57
|
+
insetBlockEnd: 0,
|
|
58
|
+
insetInlineEnd: 0,
|
|
59
|
+
transform: "translate(50%, 50%)",
|
|
60
|
+
"&:dir(rtl)": { transform: "translate(-50%, 50%)" }
|
|
61
|
+
})
|
|
62
|
+
}, d = {
|
|
63
|
+
accent: e({
|
|
64
|
+
backgroundColor: n.color.accent,
|
|
65
|
+
color: n.color.accentContrast
|
|
66
|
+
}),
|
|
67
|
+
danger: e({
|
|
68
|
+
backgroundColor: n.color.danger,
|
|
69
|
+
color: n.color.dangerContrast
|
|
70
|
+
}),
|
|
71
|
+
neutral: e({
|
|
72
|
+
backgroundColor: n.color.textMuted,
|
|
73
|
+
color: n.color.bg
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
function f({ ref: e, children: n, badgeContent: f, max: p = a, showZero: m = !1, invisible: h = !1, variant: g = "standard", tone: _ = "accent", anchor: v, overlap: y = "rectangular", slotProps: b, className: x, sx: S, ...C }) {
|
|
77
|
+
let w = g === "dot", T = h || g !== "dot" && (f == null || f === !1 || f === 0 && !m), E = typeof f == "number" && f > p ? `${p}+` : f, D = `${v?.vertical ?? "top"}-${v?.horizontal ?? "end"}`, O = [x, b?.root?.className].filter(Boolean).join(" ") || void 0;
|
|
78
|
+
return /* @__PURE__ */ r(t, {
|
|
79
|
+
className: O,
|
|
80
|
+
styles: [o, b?.root?.css],
|
|
81
|
+
sx: S,
|
|
82
|
+
children: (t) => /* @__PURE__ */ i("span", {
|
|
83
|
+
...C,
|
|
84
|
+
ref: e,
|
|
85
|
+
"data-ui": "badge",
|
|
86
|
+
className: t,
|
|
87
|
+
children: [n, !T && /* @__PURE__ */ r("span", {
|
|
88
|
+
"data-ui": "badge-marker",
|
|
89
|
+
"data-variant": g,
|
|
90
|
+
"data-tone": _,
|
|
91
|
+
"aria-hidden": w ? "true" : void 0,
|
|
92
|
+
className: b?.badge?.className,
|
|
93
|
+
css: [
|
|
94
|
+
s,
|
|
95
|
+
c[g],
|
|
96
|
+
!w && l[y],
|
|
97
|
+
u[D],
|
|
98
|
+
d[_],
|
|
99
|
+
b?.badge?.css
|
|
100
|
+
],
|
|
101
|
+
children: w ? null : E
|
|
102
|
+
})]
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
f.displayName = "Badge";
|
|
107
|
+
//#endregion
|
|
108
|
+
export { f as t };
|
package/dist/badge.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Badge } from "./badge-
|
|
2
|
+
export { t as Badge } from "./badge-B_sLygxU.js";
|