@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,141 @@
|
|
|
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 { createContext as i, useCallback as a, useContext as o, useId as s, useImperativeHandle as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
6
|
+
import { vars as p } from "@jfrader/tokens/vars";
|
|
7
|
+
import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
|
8
|
+
//#region src/components/breadcrumbs/breadcrumbs.tsx
|
|
9
|
+
var g = i(null);
|
|
10
|
+
function _(e) {
|
|
11
|
+
let t = o(g);
|
|
12
|
+
if (!t) throw Error(`Breadcrumbs.${e} must be rendered inside <Breadcrumbs>.`);
|
|
13
|
+
return t;
|
|
14
|
+
}
|
|
15
|
+
var v = ([, e], [, t]) => e.node.compareDocumentPosition(t.node) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1, y = e({
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexWrap: "wrap",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
gap: p.space[2],
|
|
20
|
+
margin: 0,
|
|
21
|
+
padding: 0,
|
|
22
|
+
listStyle: "none",
|
|
23
|
+
fontFamily: p.font.sans,
|
|
24
|
+
fontSize: p.textSize.sm,
|
|
25
|
+
lineHeight: p.lineHeight.tight
|
|
26
|
+
}), b = e({
|
|
27
|
+
display: "inline-flex",
|
|
28
|
+
alignItems: "center",
|
|
29
|
+
gap: p.space[2],
|
|
30
|
+
color: p.color.textMuted,
|
|
31
|
+
"&:first-of-type > [data-ui=\"breadcrumbs-separator\"]": { display: "none" }
|
|
32
|
+
}), x = e({ display: "inline-flex" }), S = e({
|
|
33
|
+
display: "inline-flex",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
gap: p.space[1],
|
|
36
|
+
minBlockSize: "24px",
|
|
37
|
+
borderRadius: p.radius.sm,
|
|
38
|
+
color: "inherit",
|
|
39
|
+
"& svg": {
|
|
40
|
+
inlineSize: "1em",
|
|
41
|
+
blockSize: "1em",
|
|
42
|
+
flexShrink: 0
|
|
43
|
+
},
|
|
44
|
+
"&[aria-current=\"page\"]": {
|
|
45
|
+
color: p.color.text,
|
|
46
|
+
fontWeight: p.fontWeight.medium
|
|
47
|
+
}
|
|
48
|
+
}), C = e({
|
|
49
|
+
textDecoration: "underline",
|
|
50
|
+
textDecorationColor: "transparent",
|
|
51
|
+
textUnderlineOffset: "0.2em",
|
|
52
|
+
transitionProperty: "color, text-decoration-color",
|
|
53
|
+
transitionDuration: p.motion.duration.fast,
|
|
54
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
55
|
+
"&:hover": {
|
|
56
|
+
color: p.color.text,
|
|
57
|
+
textDecorationColor: "currentColor"
|
|
58
|
+
},
|
|
59
|
+
"&:focus-visible": { ...n },
|
|
60
|
+
[r]: { transitionDuration: "0s" }
|
|
61
|
+
});
|
|
62
|
+
function w({ ref: e, label: n = "Breadcrumb", separator: r = "/", children: i, className: o, sx: s, ...c }) {
|
|
63
|
+
let l = d(/* @__PURE__ */ new Map()), [p, h] = f(null), _ = d(null), b = a(() => {
|
|
64
|
+
let e = Array.from(l.current).sort(v), t = e.some(([, e]) => e.current === !0) ? null : e.at(-1)?.[0] ?? null;
|
|
65
|
+
_.current !== t && (_.current = t, h(t));
|
|
66
|
+
}, []), x = a((e, t) => {
|
|
67
|
+
l.current.set(e, t), b();
|
|
68
|
+
}, [b]), S = a((e) => {
|
|
69
|
+
l.current.delete(e), b();
|
|
70
|
+
}, [b]), C = u(() => ({
|
|
71
|
+
separator: r,
|
|
72
|
+
autoCurrentId: p,
|
|
73
|
+
register: x,
|
|
74
|
+
unregister: S
|
|
75
|
+
}), [
|
|
76
|
+
r,
|
|
77
|
+
p,
|
|
78
|
+
x,
|
|
79
|
+
S
|
|
80
|
+
]);
|
|
81
|
+
return /* @__PURE__ */ m(g.Provider, {
|
|
82
|
+
value: C,
|
|
83
|
+
children: /* @__PURE__ */ m(t, {
|
|
84
|
+
className: o,
|
|
85
|
+
sx: s,
|
|
86
|
+
children: (t) => /* @__PURE__ */ m("nav", {
|
|
87
|
+
...c,
|
|
88
|
+
ref: e,
|
|
89
|
+
"aria-label": n,
|
|
90
|
+
"data-ui": "breadcrumbs",
|
|
91
|
+
className: t,
|
|
92
|
+
children: /* @__PURE__ */ m("ol", {
|
|
93
|
+
css: y,
|
|
94
|
+
children: i
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
w.displayName = "Breadcrumbs";
|
|
101
|
+
function T({ ref: e, href: n, current: r, children: i, className: a, sx: o, ...u }) {
|
|
102
|
+
let { separator: f, autoCurrentId: p, register: g, unregister: v } = _("Item"), y = s(), w = d(null);
|
|
103
|
+
c(e, () => w.current, []), l(() => {
|
|
104
|
+
let e = w.current;
|
|
105
|
+
e && g(y, {
|
|
106
|
+
node: e,
|
|
107
|
+
current: r
|
|
108
|
+
});
|
|
109
|
+
}), l(() => () => v(y), [y, v]);
|
|
110
|
+
let T = r ?? p === y ? "page" : void 0;
|
|
111
|
+
return /* @__PURE__ */ m(t, {
|
|
112
|
+
className: a,
|
|
113
|
+
styles: b,
|
|
114
|
+
sx: o,
|
|
115
|
+
children: (e) => /* @__PURE__ */ h("li", {
|
|
116
|
+
...u,
|
|
117
|
+
ref: w,
|
|
118
|
+
"data-ui": "breadcrumbs-item",
|
|
119
|
+
className: e,
|
|
120
|
+
children: [/* @__PURE__ */ m("span", {
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
"data-ui": "breadcrumbs-separator",
|
|
123
|
+
css: x,
|
|
124
|
+
children: f
|
|
125
|
+
}), n === void 0 ? /* @__PURE__ */ m("span", {
|
|
126
|
+
"aria-current": T,
|
|
127
|
+
css: S,
|
|
128
|
+
children: i
|
|
129
|
+
}) : /* @__PURE__ */ m("a", {
|
|
130
|
+
href: n,
|
|
131
|
+
"aria-current": T,
|
|
132
|
+
css: [S, C],
|
|
133
|
+
children: i
|
|
134
|
+
})]
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
T.displayName = "Breadcrumbs.Item";
|
|
139
|
+
var E = Object.assign(w, { Item: T });
|
|
140
|
+
//#endregion
|
|
141
|
+
export { E as t };
|
package/dist/breadcrumbs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Breadcrumbs } from "./breadcrumbs-
|
|
2
|
+
export { t as Breadcrumbs } from "./breadcrumbs-DVAOxfvL.js";
|
|
@@ -0,0 +1,200 @@
|
|
|
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 "./icon-wrapper-stN8sD7R.js";
|
|
6
|
+
import { n as a, t as o } from "./loading-ring-B8-30Dl1.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import { vars as s } from "@jfrader/tokens/vars";
|
|
9
|
+
import { Fragment as c, jsx as l, jsxs as u } from "@emotion/react/jsx-runtime";
|
|
10
|
+
import { useMergeRefs as d } from "@floating-ui/react";
|
|
11
|
+
//#region src/components/button/button.tsx
|
|
12
|
+
var f = "&:hover:not(:disabled):not([aria-disabled=\"true\"])", p = e({
|
|
13
|
+
display: "inline-flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
gap: s.space[2],
|
|
17
|
+
border: "1px solid transparent",
|
|
18
|
+
borderRadius: s.radius.md,
|
|
19
|
+
fontFamily: s.font.sans,
|
|
20
|
+
fontWeight: s.fontWeight.medium,
|
|
21
|
+
lineHeight: s.lineHeight.tight,
|
|
22
|
+
letterSpacing: "-0.011em",
|
|
23
|
+
whiteSpace: "nowrap",
|
|
24
|
+
cursor: "pointer",
|
|
25
|
+
transitionProperty: "background-color, border-color, color",
|
|
26
|
+
transitionDuration: s.motion.duration.fast,
|
|
27
|
+
transitionTimingFunction: s.motion.easeStandard,
|
|
28
|
+
"&:focus-visible": { ...n },
|
|
29
|
+
"&:disabled, &[aria-disabled=\"true\"]": {
|
|
30
|
+
cursor: "not-allowed",
|
|
31
|
+
opacity: .55
|
|
32
|
+
},
|
|
33
|
+
[r]: { transitionDuration: "0s" }
|
|
34
|
+
}), m = {
|
|
35
|
+
sm: e({
|
|
36
|
+
blockSize: "32px",
|
|
37
|
+
paddingInline: s.space[3],
|
|
38
|
+
fontSize: s.textSize.sm
|
|
39
|
+
}),
|
|
40
|
+
md: e({
|
|
41
|
+
blockSize: "40px",
|
|
42
|
+
paddingInline: s.space[4],
|
|
43
|
+
fontSize: s.textSize.sm
|
|
44
|
+
}),
|
|
45
|
+
lg: e({
|
|
46
|
+
blockSize: "48px",
|
|
47
|
+
paddingInline: s.space[5],
|
|
48
|
+
fontSize: s.textSize.md
|
|
49
|
+
})
|
|
50
|
+
}, h = {
|
|
51
|
+
solid: {
|
|
52
|
+
accent: e({
|
|
53
|
+
backgroundColor: s.color.accent,
|
|
54
|
+
color: s.color.accentContrast,
|
|
55
|
+
[f]: { backgroundColor: s.color.accentHover }
|
|
56
|
+
}),
|
|
57
|
+
danger: e({
|
|
58
|
+
backgroundColor: s.color.danger,
|
|
59
|
+
color: s.color.dangerContrast,
|
|
60
|
+
[f]: { backgroundColor: s.color.dangerHover }
|
|
61
|
+
}),
|
|
62
|
+
neutral: e({
|
|
63
|
+
backgroundColor: s.color.surfaceRaised,
|
|
64
|
+
color: s.color.text,
|
|
65
|
+
borderColor: s.color.border,
|
|
66
|
+
[f]: { backgroundColor: s.color.surfaceHover }
|
|
67
|
+
})
|
|
68
|
+
},
|
|
69
|
+
soft: {
|
|
70
|
+
accent: e({
|
|
71
|
+
backgroundColor: s.color.accentSoft,
|
|
72
|
+
color: s.color.accentText,
|
|
73
|
+
[f]: { backgroundColor: s.color.accentSoftHover }
|
|
74
|
+
}),
|
|
75
|
+
danger: e({
|
|
76
|
+
backgroundColor: s.color.dangerSoft,
|
|
77
|
+
color: s.color.dangerText,
|
|
78
|
+
[f]: { backgroundColor: s.color.dangerSoftHover }
|
|
79
|
+
}),
|
|
80
|
+
neutral: e({
|
|
81
|
+
backgroundColor: s.color.surfaceHover,
|
|
82
|
+
color: s.color.text,
|
|
83
|
+
[f]: { backgroundColor: s.color.surfaceRaised }
|
|
84
|
+
})
|
|
85
|
+
},
|
|
86
|
+
outline: {
|
|
87
|
+
accent: e({
|
|
88
|
+
backgroundColor: "transparent",
|
|
89
|
+
borderColor: s.color.accentBorder,
|
|
90
|
+
color: s.color.accentText,
|
|
91
|
+
[f]: { backgroundColor: s.color.accentSoft }
|
|
92
|
+
}),
|
|
93
|
+
danger: e({
|
|
94
|
+
backgroundColor: "transparent",
|
|
95
|
+
borderColor: s.color.dangerBorder,
|
|
96
|
+
color: s.color.dangerText,
|
|
97
|
+
[f]: { backgroundColor: s.color.dangerSoft }
|
|
98
|
+
}),
|
|
99
|
+
neutral: e({
|
|
100
|
+
backgroundColor: "transparent",
|
|
101
|
+
borderColor: s.color.borderStrong,
|
|
102
|
+
color: s.color.text,
|
|
103
|
+
[f]: { backgroundColor: s.color.surfaceHover }
|
|
104
|
+
})
|
|
105
|
+
},
|
|
106
|
+
ghost: {
|
|
107
|
+
accent: e({
|
|
108
|
+
backgroundColor: "transparent",
|
|
109
|
+
color: s.color.accentText,
|
|
110
|
+
[f]: { backgroundColor: s.color.accentSoft }
|
|
111
|
+
}),
|
|
112
|
+
danger: e({
|
|
113
|
+
backgroundColor: "transparent",
|
|
114
|
+
color: s.color.dangerText,
|
|
115
|
+
[f]: { backgroundColor: s.color.dangerSoft }
|
|
116
|
+
}),
|
|
117
|
+
neutral: e({
|
|
118
|
+
backgroundColor: "transparent",
|
|
119
|
+
color: s.color.textMuted,
|
|
120
|
+
[f]: {
|
|
121
|
+
backgroundColor: s.color.surfaceHover,
|
|
122
|
+
color: s.color.text
|
|
123
|
+
}
|
|
124
|
+
})
|
|
125
|
+
}
|
|
126
|
+
}, g = e({
|
|
127
|
+
boxSizing: "border-box",
|
|
128
|
+
textDecoration: "none"
|
|
129
|
+
}), _ = e({
|
|
130
|
+
...o,
|
|
131
|
+
inlineSize: "1em",
|
|
132
|
+
blockSize: "1em",
|
|
133
|
+
[r]: { animation: `${a} 1.2s ease-in-out infinite alternate` }
|
|
134
|
+
});
|
|
135
|
+
function v({ ref: e, variant: n = "solid", tone: r = "neutral", size: a = "md", loading: o = !1, startIcon: s, endIcon: f, type: v, children: y, onClick: b, className: x, css: S, sx: C, render: w, ...T }) {
|
|
136
|
+
let { "data-ui": E, ...D } = T, O = w && E !== void 0 ? `${E} button` : "button", k = d([e]), A = D["aria-disabled"], j = o || A === !0 || A === "true" || w !== void 0 && D.disabled === !0, M = b, N = (e) => {
|
|
137
|
+
j ? e.preventDefault() : M?.(e);
|
|
138
|
+
}, P = o ? /* @__PURE__ */ l("span", { css: _ }) : s, F = /* @__PURE__ */ u(c, { children: [
|
|
139
|
+
P != null && /* @__PURE__ */ l("span", {
|
|
140
|
+
css: i,
|
|
141
|
+
"aria-hidden": !0,
|
|
142
|
+
children: P
|
|
143
|
+
}),
|
|
144
|
+
y,
|
|
145
|
+
f != null && /* @__PURE__ */ l("span", {
|
|
146
|
+
css: i,
|
|
147
|
+
"aria-hidden": !0,
|
|
148
|
+
children: f
|
|
149
|
+
})
|
|
150
|
+
] });
|
|
151
|
+
if (w) {
|
|
152
|
+
let { disabled: e, ...i } = D;
|
|
153
|
+
return /* @__PURE__ */ l(t, {
|
|
154
|
+
className: x,
|
|
155
|
+
sx: C,
|
|
156
|
+
children: (e) => w({
|
|
157
|
+
...i,
|
|
158
|
+
className: e,
|
|
159
|
+
ref: k,
|
|
160
|
+
type: v,
|
|
161
|
+
"data-ui": O,
|
|
162
|
+
"aria-busy": o ? !0 : D["aria-busy"],
|
|
163
|
+
"aria-disabled": j ? !0 : A,
|
|
164
|
+
onClick: N,
|
|
165
|
+
css: [
|
|
166
|
+
p,
|
|
167
|
+
g,
|
|
168
|
+
m[a],
|
|
169
|
+
h[n][r],
|
|
170
|
+
S
|
|
171
|
+
],
|
|
172
|
+
children: F
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
return /* @__PURE__ */ l(t, {
|
|
177
|
+
className: x,
|
|
178
|
+
styles: [
|
|
179
|
+
p,
|
|
180
|
+
m[a],
|
|
181
|
+
h[n][r],
|
|
182
|
+
S
|
|
183
|
+
],
|
|
184
|
+
sx: C,
|
|
185
|
+
children: (t) => /* @__PURE__ */ l("button", {
|
|
186
|
+
...D,
|
|
187
|
+
ref: e,
|
|
188
|
+
type: v ?? "button",
|
|
189
|
+
"data-ui": O,
|
|
190
|
+
"aria-busy": o ? !0 : D["aria-busy"],
|
|
191
|
+
"aria-disabled": j ? !0 : A,
|
|
192
|
+
onClick: N,
|
|
193
|
+
className: t,
|
|
194
|
+
children: F
|
|
195
|
+
})
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
v.displayName = "Button";
|
|
199
|
+
//#endregion
|
|
200
|
+
export { v as t };
|
package/dist/button.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Button } from "./button-
|
|
2
|
+
export { t as Button } from "./button-P2e7_44z.js";
|