asterui 0.12.61 → 0.12.63
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/components/Affix.d.ts +2 -0
- package/dist/components/Affix.js.map +1 -1
- package/dist/components/Alert.d.ts +2 -0
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/Anchor.d.ts +2 -0
- package/dist/components/Anchor.js +79 -75
- package/dist/components/Anchor.js.map +1 -1
- package/dist/components/Autocomplete.d.ts +1 -0
- package/dist/components/Autocomplete.js +115 -110
- package/dist/components/Autocomplete.js.map +1 -1
- package/dist/components/Avatar.d.ts +4 -0
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Breadcrumb.d.ts +4 -2
- package/dist/components/Breadcrumb.js +54 -29
- package/dist/components/Breadcrumb.js.map +1 -1
- package/dist/components/Browser.d.ts +2 -0
- package/dist/components/Browser.js.map +1 -1
- package/dist/components/Button.d.ts +5 -1
- package/dist/components/Button.js +117 -107
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Chart.d.ts +1 -0
- package/dist/components/Chart.js +31 -30
- package/dist/components/Chart.js.map +1 -1
- package/dist/components/Chat.d.ts +1 -0
- package/dist/components/Chat.js +39 -28
- package/dist/components/Chat.js.map +1 -1
- package/dist/components/Code.d.ts +2 -0
- package/dist/components/Code.js.map +1 -1
- package/dist/components/Command.d.ts +5 -2
- package/dist/components/Command.js +262 -233
- package/dist/components/Command.js.map +1 -1
- package/dist/components/Container.d.ts +2 -0
- package/dist/components/Container.js.map +1 -1
- package/dist/components/ContextMenu.d.ts +4 -0
- package/dist/components/ContextMenu.js +157 -122
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/CopyButton.d.ts +2 -0
- package/dist/components/CopyButton.js +9 -8
- package/dist/components/CopyButton.js.map +1 -1
- package/dist/components/Countdown.d.ts +3 -3
- package/dist/components/Countdown.js +49 -47
- package/dist/components/Countdown.js.map +1 -1
- package/dist/components/Diff.d.ts +3 -3
- package/dist/components/Diff.js +14 -10
- package/dist/components/Diff.js.map +1 -1
- package/dist/components/Divider.d.ts +2 -0
- package/dist/components/Divider.js.map +1 -1
- package/dist/components/Dock.d.ts +6 -0
- package/dist/components/Dock.js +75 -38
- package/dist/components/Dock.js.map +1 -1
- package/dist/components/Dropdown.js +110 -110
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Fieldset.d.ts +2 -0
- package/dist/components/Fieldset.js.map +1 -1
- package/dist/components/FileInput.d.ts +1 -0
- package/dist/components/FileInput.js +26 -26
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Filter.d.ts +1 -0
- package/dist/components/Filter.js +43 -40
- package/dist/components/Filter.js.map +1 -1
- package/dist/components/Flex.d.ts +1 -0
- package/dist/components/Flex.js +43 -42
- package/dist/components/Flex.js.map +1 -1
- package/dist/components/FloatButton.d.ts +9 -0
- package/dist/components/FloatButton.js +211 -136
- package/dist/components/FloatButton.js.map +1 -1
- package/dist/components/Footer.d.ts +2 -0
- package/dist/components/Footer.js.map +1 -1
- package/dist/components/Grid.d.ts +4 -0
- package/dist/components/Grid.js.map +1 -1
- package/dist/components/Hero.d.ts +2 -0
- package/dist/components/Hero.js.map +1 -1
- package/dist/components/HoverGallery.d.ts +3 -3
- package/dist/components/HoverGallery.js +12 -10
- package/dist/components/HoverGallery.js.map +1 -1
- package/dist/components/Input.d.ts +1 -0
- package/dist/components/Input.js +201 -184
- package/dist/components/Input.js.map +1 -1
- package/dist/components/Join.d.ts +2 -0
- package/dist/components/Join.js.map +1 -1
- package/dist/components/Kbd.d.ts +2 -0
- package/dist/components/Kbd.js.map +1 -1
- package/dist/components/Loading.d.ts +3 -0
- package/dist/components/Loading.js +58 -35
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/Mask.d.ts +2 -2
- package/dist/components/Mask.js.map +1 -1
- package/dist/components/Masonry.d.ts +1 -0
- package/dist/components/Masonry.js +45 -42
- package/dist/components/Masonry.js.map +1 -1
- package/dist/components/Mention.d.ts +1 -0
- package/dist/components/Mention.js +95 -91
- package/dist/components/Mention.js.map +1 -1
- package/dist/components/MonthCalendar.d.ts +1 -0
- package/dist/components/MonthCalendar.js +104 -97
- package/dist/components/MonthCalendar.js.map +1 -1
- package/dist/components/Navbar.d.ts +2 -0
- package/dist/components/Navbar.js.map +1 -1
- package/dist/components/Notification.js +32 -18
- package/dist/components/Notification.js.map +1 -1
- package/dist/components/Phone.d.ts +3 -2
- package/dist/components/Phone.js +10 -8
- package/dist/components/Phone.js.map +1 -1
- package/dist/components/Popconfirm.js +110 -92
- package/dist/components/Popconfirm.js.map +1 -1
- package/dist/components/Popover.d.ts +2 -0
- package/dist/components/Popover.js.map +1 -1
- package/dist/components/Progress.d.ts +2 -0
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/QRCode.d.ts +1 -0
- package/dist/components/QRCode.js +84 -55
- package/dist/components/QRCode.js.map +1 -1
- package/dist/components/RadialProgress.d.ts +1 -0
- package/dist/components/RadialProgress.js +19 -17
- package/dist/components/RadialProgress.js.map +1 -1
- package/dist/components/Radio.d.ts +6 -3
- package/dist/components/Radio.js +9 -9
- package/dist/components/Radio.js.map +1 -1
- package/dist/components/Range.d.ts +1 -0
- package/dist/components/Range.js +45 -43
- package/dist/components/Range.js.map +1 -1
- package/dist/components/Rating.d.ts +4 -2
- package/dist/components/Rating.js +83 -79
- package/dist/components/Rating.js.map +1 -1
- package/dist/components/Responsive.d.ts +4 -2
- package/dist/components/Responsive.js +10 -9
- package/dist/components/Responsive.js.map +1 -1
- package/dist/components/Result.d.ts +1 -0
- package/dist/components/Result.js +24 -22
- package/dist/components/Result.js.map +1 -1
- package/dist/components/Select.d.ts +1 -0
- package/dist/components/Select.js +72 -62
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Skeleton.d.ts +2 -0
- package/dist/components/Skeleton.js.map +1 -1
- package/dist/components/Space.d.ts +2 -0
- package/dist/components/Space.js.map +1 -1
- package/dist/components/Splitter.d.ts +2 -0
- package/dist/components/Splitter.js +137 -131
- package/dist/components/Splitter.js.map +1 -1
- package/dist/components/Stat.d.ts +4 -2
- package/dist/components/Stat.js +19 -18
- package/dist/components/Stat.js.map +1 -1
- package/dist/components/Status.d.ts +3 -3
- package/dist/components/Status.js +27 -25
- package/dist/components/Status.js.map +1 -1
- package/dist/components/Steps.d.ts +4 -2
- package/dist/components/Steps.js +56 -52
- package/dist/components/Steps.js.map +1 -1
- package/dist/components/TextRotate.d.ts +1 -0
- package/dist/components/TextRotate.js +14 -12
- package/dist/components/TextRotate.js.map +1 -1
- package/dist/components/Textarea.d.ts +1 -0
- package/dist/components/Textarea.js +31 -30
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/ThemeController.d.ts +6 -3
- package/dist/components/ThemeController.js +101 -92
- package/dist/components/ThemeController.js.map +1 -1
- package/dist/components/Toggle.d.ts +2 -0
- package/dist/components/Toggle.js.map +1 -1
- package/dist/components/Tooltip.d.ts +2 -0
- package/dist/components/Tooltip.js +38 -32
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Typography.d.ts +10 -5
- package/dist/components/Typography.js +84 -81
- package/dist/components/Typography.js.map +1 -1
- package/dist/components/VirtualList.d.ts +2 -1
- package/dist/components/VirtualList.js +40 -36
- package/dist/components/VirtualList.js.map +1 -1
- package/dist/components/Watermark.d.ts +1 -0
- package/dist/components/Watermark.js +74 -71
- package/dist/components/Watermark.js.map +1 -1
- package/dist/components/WeekCalendar.d.ts +1 -0
- package/dist/components/WeekCalendar.js +91 -76
- package/dist/components/WeekCalendar.js.map +1 -1
- package/dist/components/Window.d.ts +3 -2
- package/dist/components/Window.js +9 -7
- package/dist/components/Window.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,187 +1,262 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
const
|
|
4
|
-
left:
|
|
5
|
-
right:
|
|
6
|
-
top:
|
|
7
|
-
bottom:
|
|
8
|
-
},
|
|
9
|
-
default:
|
|
10
|
-
primary:
|
|
11
|
-
},
|
|
12
|
-
circle:
|
|
13
|
-
square:
|
|
14
|
-
},
|
|
15
|
-
icon:
|
|
1
|
+
import { jsx as t, jsxs as x, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as G, createContext as U, useState as V, useEffect as Y } from "react";
|
|
3
|
+
const T = "btn", $ = "btn-lg", S = "btn-circle", D = "btn-square", M = "btn-neutral", H = "btn-primary", J = "tooltip", K = "tooltip-left", Q = "tooltip-right", X = "tooltip-top", Z = "tooltip-bottom", y = "indicator", L = "indicator-item", F = "badge", j = "badge-secondary", _ = "fab", I = "fab-flower", tt = "fab-main-action", ot = "fab-close", W = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), nt = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }), et = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }), C = U({ inGroup: !1 }), at = {
|
|
4
|
+
left: K,
|
|
5
|
+
right: Q,
|
|
6
|
+
top: X,
|
|
7
|
+
bottom: Z
|
|
8
|
+
}, E = {
|
|
9
|
+
default: M,
|
|
10
|
+
primary: H
|
|
11
|
+
}, P = {
|
|
12
|
+
circle: S,
|
|
13
|
+
square: D
|
|
14
|
+
}, k = ({
|
|
15
|
+
icon: m,
|
|
16
16
|
description: l,
|
|
17
|
-
onClick:
|
|
18
|
-
type:
|
|
19
|
-
shape:
|
|
20
|
-
className:
|
|
21
|
-
tooltip:
|
|
22
|
-
tooltipPlacement:
|
|
23
|
-
badge:
|
|
24
|
-
href:
|
|
25
|
-
target:
|
|
26
|
-
children:
|
|
27
|
-
style:
|
|
17
|
+
onClick: n,
|
|
18
|
+
type: v = "default",
|
|
19
|
+
shape: w = "circle",
|
|
20
|
+
className: B = "",
|
|
21
|
+
tooltip: r,
|
|
22
|
+
tooltipPlacement: N = "left",
|
|
23
|
+
badge: h,
|
|
24
|
+
href: a,
|
|
25
|
+
target: u,
|
|
26
|
+
children: g,
|
|
27
|
+
style: c,
|
|
28
|
+
"data-testid": e,
|
|
28
29
|
...s
|
|
29
30
|
}) => {
|
|
30
|
-
const p =
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
const p = G(C), f = p.inGroup && p.shape || w, o = [
|
|
32
|
+
T,
|
|
33
|
+
$,
|
|
33
34
|
"shadow-lg",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
].filter(Boolean).join(" "), b =
|
|
35
|
+
P[f],
|
|
36
|
+
E[v],
|
|
37
|
+
B
|
|
38
|
+
].filter(Boolean).join(" "), b = m || g || /* @__PURE__ */ t(W, {}), d = (O) => e ? `${e}-${O}` : void 0, i = /* @__PURE__ */ t(R, { children: l ? /* @__PURE__ */ x("div", { className: "flex flex-col items-center", children: [
|
|
38
39
|
b,
|
|
39
40
|
/* @__PURE__ */ t("span", { className: "text-xs mt-1", children: l })
|
|
40
41
|
] }) : b });
|
|
41
42
|
if (p.inGroup)
|
|
42
|
-
return
|
|
43
|
+
return a ? /* @__PURE__ */ t(
|
|
43
44
|
"a",
|
|
44
45
|
{
|
|
45
|
-
href:
|
|
46
|
-
target:
|
|
47
|
-
className:
|
|
48
|
-
title:
|
|
49
|
-
onClick:
|
|
46
|
+
href: a,
|
|
47
|
+
target: u,
|
|
48
|
+
className: o,
|
|
49
|
+
title: r,
|
|
50
|
+
onClick: n,
|
|
51
|
+
"data-testid": e,
|
|
50
52
|
...s,
|
|
51
|
-
children:
|
|
53
|
+
children: i
|
|
52
54
|
}
|
|
53
|
-
) : /* @__PURE__ */ t("button", { className:
|
|
54
|
-
const
|
|
55
|
+
) : /* @__PURE__ */ t("button", { className: o, title: r, onClick: n, "data-testid": e, ...s, children: i });
|
|
56
|
+
const z = a ? /* @__PURE__ */ t(
|
|
55
57
|
"a",
|
|
56
58
|
{
|
|
57
|
-
href:
|
|
58
|
-
target:
|
|
59
|
-
className:
|
|
60
|
-
style:
|
|
61
|
-
onClick:
|
|
59
|
+
href: a,
|
|
60
|
+
target: u,
|
|
61
|
+
className: o,
|
|
62
|
+
style: c,
|
|
63
|
+
onClick: n,
|
|
64
|
+
"data-testid": e,
|
|
62
65
|
...s,
|
|
63
|
-
children:
|
|
66
|
+
children: i
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ t("button", { className: o, onClick: n, style: c, "data-testid": e, ...s, children: i }), A = h !== void 0 ? /* @__PURE__ */ x("div", { className: y, style: c, "data-testid": d("indicator"), children: [
|
|
69
|
+
/* @__PURE__ */ t("span", { className: `${L} ${F} ${j}`, "data-testid": d("badge"), children: h }),
|
|
70
|
+
a ? /* @__PURE__ */ t(
|
|
71
|
+
"a",
|
|
72
|
+
{
|
|
73
|
+
href: a,
|
|
74
|
+
target: u,
|
|
75
|
+
className: o,
|
|
76
|
+
onClick: n,
|
|
77
|
+
"data-testid": e,
|
|
78
|
+
...s,
|
|
79
|
+
children: i
|
|
80
|
+
}
|
|
81
|
+
) : /* @__PURE__ */ t("button", { className: o, onClick: n, "data-testid": e, ...s, children: i })
|
|
82
|
+
] }) : z;
|
|
83
|
+
return r ? /* @__PURE__ */ t(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: `${J} ${at[N]}`,
|
|
87
|
+
"data-tip": r,
|
|
88
|
+
style: c,
|
|
89
|
+
"data-testid": d("tooltip"),
|
|
90
|
+
children: h !== void 0 ? /* @__PURE__ */ x("div", { className: y, children: [
|
|
91
|
+
/* @__PURE__ */ t("span", { className: `${L} ${F} ${j}`, "data-testid": d("badge"), children: h }),
|
|
92
|
+
a ? /* @__PURE__ */ t(
|
|
93
|
+
"a",
|
|
94
|
+
{
|
|
95
|
+
href: a,
|
|
96
|
+
target: u,
|
|
97
|
+
className: o,
|
|
98
|
+
onClick: n,
|
|
99
|
+
"data-testid": e,
|
|
100
|
+
...s,
|
|
101
|
+
children: i
|
|
102
|
+
}
|
|
103
|
+
) : /* @__PURE__ */ t("button", { className: o, onClick: n, "data-testid": e, ...s, children: i })
|
|
104
|
+
] }) : a ? /* @__PURE__ */ t(
|
|
105
|
+
"a",
|
|
106
|
+
{
|
|
107
|
+
href: a,
|
|
108
|
+
target: u,
|
|
109
|
+
className: o,
|
|
110
|
+
onClick: n,
|
|
111
|
+
"data-testid": e,
|
|
112
|
+
...s,
|
|
113
|
+
children: i
|
|
114
|
+
}
|
|
115
|
+
) : /* @__PURE__ */ t("button", { className: o, onClick: n, "data-testid": e, ...s, children: i })
|
|
64
116
|
}
|
|
65
|
-
) :
|
|
66
|
-
|
|
67
|
-
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: c }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: c })
|
|
68
|
-
] }) : E;
|
|
69
|
-
return a ? /* @__PURE__ */ t("div", { className: `${Y} ${ot[v]}`, "data-tip": a, style: m, children: r !== void 0 ? /* @__PURE__ */ g("div", { className: T, children: [
|
|
70
|
-
/* @__PURE__ */ t("span", { className: `${$} ${y} ${L}`, children: r }),
|
|
71
|
-
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: c }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: c })
|
|
72
|
-
] }) : e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: c }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: c }) }) : P;
|
|
73
|
-
}, W = (d) => {
|
|
117
|
+
) : A;
|
|
118
|
+
}, q = (m) => {
|
|
74
119
|
const {
|
|
75
120
|
style: l,
|
|
76
|
-
...
|
|
77
|
-
} =
|
|
78
|
-
if (
|
|
79
|
-
return /* @__PURE__ */ t(
|
|
80
|
-
const
|
|
121
|
+
...n
|
|
122
|
+
} = m;
|
|
123
|
+
if (G(C).inGroup)
|
|
124
|
+
return /* @__PURE__ */ t(k, { ...n });
|
|
125
|
+
const w = {
|
|
81
126
|
position: "fixed",
|
|
82
127
|
zIndex: 1e3,
|
|
83
128
|
bottom: 24,
|
|
84
129
|
right: 24,
|
|
85
130
|
...l
|
|
86
131
|
};
|
|
87
|
-
return /* @__PURE__ */ t(
|
|
88
|
-
},
|
|
89
|
-
children:
|
|
132
|
+
return /* @__PURE__ */ t(k, { ...n, style: w });
|
|
133
|
+
}, st = ({
|
|
134
|
+
children: m,
|
|
90
135
|
flower: l = !1,
|
|
91
|
-
shape:
|
|
92
|
-
icon:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
136
|
+
shape: n = "circle",
|
|
137
|
+
icon: v,
|
|
138
|
+
triggerLabel: w = "Open menu",
|
|
139
|
+
mainAction: B,
|
|
140
|
+
mainActionLabel: r,
|
|
141
|
+
onMainAction: N,
|
|
142
|
+
showClose: h = !1,
|
|
143
|
+
closeLabel: a = "Close menu",
|
|
144
|
+
type: u = "default",
|
|
145
|
+
position: g = "bottom-right",
|
|
146
|
+
offset: c = 24,
|
|
147
|
+
className: e = "",
|
|
148
|
+
style: s,
|
|
149
|
+
"data-testid": p
|
|
101
150
|
}) => {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
l ?
|
|
105
|
-
|
|
106
|
-
].filter(Boolean).join(" "),
|
|
107
|
-
|
|
108
|
-
|
|
151
|
+
const f = [
|
|
152
|
+
_,
|
|
153
|
+
l ? I : "",
|
|
154
|
+
e
|
|
155
|
+
].filter(Boolean).join(" "), o = [
|
|
156
|
+
T,
|
|
157
|
+
$,
|
|
109
158
|
"shadow-lg",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
].filter(Boolean).join(" "),
|
|
113
|
-
...
|
|
114
|
-
...
|
|
115
|
-
...
|
|
116
|
-
};
|
|
117
|
-
return /* @__PURE__ */
|
|
159
|
+
P[n],
|
|
160
|
+
E[u]
|
|
161
|
+
].filter(Boolean).join(" "), b = {
|
|
162
|
+
...g.includes("bottom") ? { bottom: c } : { top: c },
|
|
163
|
+
...g.includes("right") ? { right: c } : { left: c },
|
|
164
|
+
...s
|
|
165
|
+
}, d = (i) => p ? `${p}-${i}` : void 0;
|
|
166
|
+
return /* @__PURE__ */ x("div", { className: f, style: b, "data-testid": p, children: [
|
|
118
167
|
/* @__PURE__ */ t(
|
|
119
|
-
"
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
type: "button",
|
|
171
|
+
className: o,
|
|
172
|
+
"aria-label": w,
|
|
173
|
+
"aria-haspopup": "true",
|
|
174
|
+
"data-testid": d("trigger"),
|
|
175
|
+
children: v || /* @__PURE__ */ t(W, {})
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
B && /* @__PURE__ */ t(
|
|
179
|
+
"button",
|
|
120
180
|
{
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
181
|
+
type: "button",
|
|
182
|
+
className: `${o} ${tt}`,
|
|
183
|
+
onClick: N,
|
|
184
|
+
"aria-label": r,
|
|
185
|
+
"data-testid": d("main-action"),
|
|
186
|
+
children: B
|
|
125
187
|
}
|
|
126
188
|
),
|
|
127
|
-
|
|
189
|
+
h && /* @__PURE__ */ t(
|
|
128
190
|
"button",
|
|
129
191
|
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
192
|
+
type: "button",
|
|
193
|
+
className: `${o} ${ot}`,
|
|
194
|
+
"aria-label": a,
|
|
195
|
+
"data-testid": d("close"),
|
|
196
|
+
children: /* @__PURE__ */ t(et, {})
|
|
133
197
|
}
|
|
134
198
|
),
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */ t(C.Provider, { value: { inGroup: !0, shape: o }, children: d })
|
|
199
|
+
/* @__PURE__ */ t(C.Provider, { value: { inGroup: !0, shape: n }, children: m })
|
|
137
200
|
] });
|
|
138
|
-
},
|
|
139
|
-
visibilityHeight:
|
|
201
|
+
}, lt = ({
|
|
202
|
+
visibilityHeight: m = 400,
|
|
140
203
|
target: l,
|
|
141
|
-
onClick:
|
|
142
|
-
icon:
|
|
143
|
-
duration:
|
|
144
|
-
position:
|
|
145
|
-
offset:
|
|
146
|
-
className:
|
|
147
|
-
children:
|
|
148
|
-
style:
|
|
149
|
-
|
|
204
|
+
onClick: n,
|
|
205
|
+
icon: v,
|
|
206
|
+
duration: w = 450,
|
|
207
|
+
position: B = "bottom-right",
|
|
208
|
+
offset: r = 24,
|
|
209
|
+
className: N = "",
|
|
210
|
+
children: h,
|
|
211
|
+
style: a,
|
|
212
|
+
"data-testid": u,
|
|
213
|
+
...g
|
|
150
214
|
}) => {
|
|
151
|
-
const [
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
const
|
|
155
|
-
|
|
215
|
+
const [c, e] = V(!1);
|
|
216
|
+
Y(() => {
|
|
217
|
+
const o = l ? l() : window, b = () => {
|
|
218
|
+
const d = o instanceof Window ? window.scrollY : o.scrollTop;
|
|
219
|
+
e(d >= m);
|
|
156
220
|
};
|
|
157
|
-
return
|
|
158
|
-
}, [l,
|
|
221
|
+
return o.addEventListener("scroll", b), b(), () => o.removeEventListener("scroll", b);
|
|
222
|
+
}, [l, m]);
|
|
159
223
|
const s = () => {
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
|
|
224
|
+
n?.();
|
|
225
|
+
const o = l ? l() : window;
|
|
226
|
+
o instanceof Window ? window.scrollTo({ top: 0, behavior: "smooth" }) : o.scrollTo({ top: 0, behavior: "smooth" });
|
|
163
227
|
};
|
|
164
|
-
if (!
|
|
228
|
+
if (!c) return null;
|
|
165
229
|
const p = [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
230
|
+
T,
|
|
231
|
+
$,
|
|
232
|
+
S,
|
|
233
|
+
M,
|
|
170
234
|
"shadow-lg",
|
|
171
235
|
"transition-opacity",
|
|
172
|
-
|
|
173
|
-
].filter(Boolean).join(" "),
|
|
236
|
+
N
|
|
237
|
+
].filter(Boolean).join(" "), f = {
|
|
174
238
|
position: "fixed",
|
|
175
239
|
zIndex: 1e3,
|
|
176
|
-
bottom:
|
|
177
|
-
...
|
|
178
|
-
...
|
|
240
|
+
bottom: r,
|
|
241
|
+
...B.includes("right") ? { right: r } : { left: r },
|
|
242
|
+
...a
|
|
179
243
|
};
|
|
180
|
-
return /* @__PURE__ */ t(
|
|
244
|
+
return /* @__PURE__ */ t(
|
|
245
|
+
"button",
|
|
246
|
+
{
|
|
247
|
+
className: p,
|
|
248
|
+
onClick: s,
|
|
249
|
+
style: f,
|
|
250
|
+
"aria-label": g["aria-label"] || "Back to top",
|
|
251
|
+
"data-testid": u,
|
|
252
|
+
...g,
|
|
253
|
+
children: v || h || /* @__PURE__ */ t(nt, {})
|
|
254
|
+
}
|
|
255
|
+
);
|
|
181
256
|
};
|
|
182
|
-
|
|
183
|
-
|
|
257
|
+
q.Group = st;
|
|
258
|
+
q.BackTop = lt;
|
|
184
259
|
export {
|
|
185
|
-
|
|
260
|
+
q as FloatButton
|
|
186
261
|
};
|
|
187
262
|
//# sourceMappingURL=FloatButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatButton.js","sources":["../../src/components/FloatButton.tsx"],"sourcesContent":["import React, { useState, useEffect, createContext, useContext } from 'react'\n\n// DaisyUI classes\nconst dBtn = 'btn'\nconst dBtnLg = 'btn-lg'\nconst dBtnCircle = 'btn-circle'\nconst dBtnSquare = 'btn-square'\nconst dBtnNeutral = 'btn-neutral'\nconst dBtnPrimary = 'btn-primary'\nconst dTooltip = 'tooltip'\nconst dTooltipLeft = 'tooltip-left'\nconst dTooltipRight = 'tooltip-right'\nconst dTooltipTop = 'tooltip-top'\nconst dTooltipBottom = 'tooltip-bottom'\nconst dIndicator = 'indicator'\nconst dIndicatorItem = 'indicator-item'\nconst dBadge = 'badge'\nconst dBadgeSecondary = 'badge-secondary'\nconst dFab = 'fab'\nconst dFabFlower = 'fab-flower'\nconst dFabMainAction = 'fab-main-action'\nconst dFabClose = 'fab-close'\n\n// Default icons\nconst PlusIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 4v16m8-8H4\" />\n </svg>\n)\n\nconst ArrowUpIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 10l7-7m0 0l7 7m-7-7v18\" />\n </svg>\n)\n\nconst CloseIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n)\n\nexport interface FloatButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Icon to display */\n icon?: React.ReactNode\n /** Description text below icon */\n description?: React.ReactNode\n /** Button type/color */\n type?: 'default' | 'primary'\n /** Button shape */\n shape?: 'circle' | 'square'\n /** Tooltip text */\n tooltip?: string\n /** Tooltip placement */\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom'\n /** Badge content */\n badge?: number | React.ReactNode\n /** Link URL (renders as anchor) */\n href?: string\n /** Link target */\n target?: string\n /** @deprecated Use icon prop instead */\n children?: React.ReactNode\n}\n\nexport interface FloatButtonGroupProps {\n /** Child FloatButton components */\n children: React.ReactNode\n /** Arrange buttons in a quarter-circle (radial) layout */\n flower?: boolean\n /** Button shape for children */\n shape?: 'circle' | 'square'\n /** Main trigger button icon */\n icon?: React.ReactNode\n /** Main action button that replaces trigger when open (fab-main-action) */\n mainAction?: React.ReactNode\n /** Click handler for main action button */\n onMainAction?: () => void\n /** Show close button when open (fab-close) */\n showClose?: boolean\n /** Button type/color */\n type?: 'default' | 'primary'\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n /** Distance from edge */\n offset?: number\n /** Additional CSS classes */\n className?: string\n /** Custom styles */\n style?: React.CSSProperties\n}\n\nexport interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'> {\n /** Scroll threshold to show button (pixels) */\n visibilityHeight?: number\n /** Scroll target (default: window) */\n target?: () => HTMLElement | Window\n /** Click handler (called before scrolling) */\n onClick?: () => void\n /** Custom icon */\n icon?: React.ReactNode\n /** Duration of scroll animation in ms */\n duration?: number\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left'\n /** Distance from edge in pixels */\n offset?: number\n /** @deprecated Use icon prop instead */\n children?: React.ReactNode\n}\n\n// Context for group\ninterface FloatButtonGroupContextValue {\n inGroup: boolean\n shape?: 'circle' | 'square'\n}\n\nconst FloatButtonGroupContext = createContext<FloatButtonGroupContextValue>({ inGroup: false })\n\nconst tooltipPlacementClasses: Record<string, string> = {\n left: dTooltipLeft,\n right: dTooltipRight,\n top: dTooltipTop,\n bottom: dTooltipBottom,\n}\n\nconst typeClasses: Record<string, string> = {\n default: dBtnNeutral,\n primary: dBtnPrimary,\n}\n\nconst shapeClasses: Record<string, string> = {\n circle: dBtnCircle,\n square: dBtnSquare,\n}\n\ninterface FloatButtonComponent extends React.FC<FloatButtonProps> {\n Group: React.FC<FloatButtonGroupProps>\n BackTop: React.FC<BackTopProps>\n}\n\nconst FloatButtonBase: React.FC<FloatButtonProps & { style?: React.CSSProperties }> = ({\n icon,\n description,\n onClick,\n type = 'default',\n shape = 'circle',\n className = '',\n tooltip,\n tooltipPlacement = 'left',\n badge,\n href,\n target,\n children,\n style,\n ...rest\n}) => {\n const groupContext = useContext(FloatButtonGroupContext)\n const effectiveShape = groupContext.inGroup ? (groupContext.shape || shape) : shape\n\n const buttonClasses = [\n dBtn,\n dBtnLg,\n 'shadow-lg',\n shapeClasses[effectiveShape],\n typeClasses[type],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const content = icon || children || <PlusIcon />\n\n const buttonContent = (\n <>\n {description ? (\n <div className=\"flex flex-col items-center\">\n {content}\n <span className=\"text-xs mt-1\">{description}</span>\n </div>\n ) : (\n content\n )}\n </>\n )\n\n // When inside a group, render simple button without wrapper divs\n // DaisyUI's fab CSS requires direct button children\n if (groupContext.inGroup) {\n return href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n title={tooltip}\n onClick={onClick as any}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} title={tooltip} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )\n }\n\n const buttonElement = href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n style={style}\n onClick={onClick as any}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} style={style} {...rest}>\n {buttonContent}\n </button>\n )\n\n const withBadge = badge !== undefined ? (\n <div className={dIndicator} style={style}>\n <span className={`${dIndicatorItem} ${dBadge} ${dBadgeSecondary}`}>\n {badge}\n </span>\n {href ? (\n <a href={href} target={target} className={buttonClasses} onClick={onClick as any} {...(rest as any)}>\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n ) : buttonElement\n\n if (tooltip) {\n return (\n <div className={`${dTooltip} ${tooltipPlacementClasses[tooltipPlacement]}`} data-tip={tooltip} style={style}>\n {badge !== undefined ? (\n <div className={dIndicator}>\n <span className={`${dIndicatorItem} ${dBadge} ${dBadgeSecondary}`}>{badge}</span>\n {href ? (\n <a href={href} target={target} className={buttonClasses} onClick={onClick as any} {...(rest as any)}>\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n ) : href ? (\n <a href={href} target={target} className={buttonClasses} onClick={onClick as any} {...(rest as any)}>\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n )\n }\n\n return withBadge\n}\n\nexport const FloatButton: FloatButtonComponent = (props) => {\n const {\n style: propStyle,\n ...rest\n } = props\n\n const groupContext = useContext(FloatButtonGroupContext)\n\n // If in group, don't apply fixed positioning\n if (groupContext.inGroup) {\n return <FloatButtonBase {...rest} />\n }\n\n // Standalone button with fixed positioning\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n bottom: 24,\n right: 24,\n ...propStyle,\n }\n\n return <FloatButtonBase {...rest} style={style} />\n}\n\nconst FloatButtonGroup: React.FC<FloatButtonGroupProps> = ({\n children,\n flower = false,\n shape = 'circle',\n icon,\n mainAction,\n onMainAction,\n showClose = false,\n type = 'default',\n position = 'bottom-right',\n offset = 24,\n className = '',\n style: propStyle,\n}) => {\n const fabClasses = [\n dFab,\n flower ? dFabFlower : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const triggerButtonClasses = [\n dBtn,\n dBtnLg,\n 'shadow-lg',\n shapeClasses[shape],\n typeClasses[type],\n ]\n .filter(Boolean)\n .join(' ')\n\n const containerStyle: React.CSSProperties = {\n ...(position.includes('bottom') ? { bottom: offset } : { top: offset }),\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n ...propStyle,\n }\n\n return (\n <div className={fabClasses} style={containerStyle}>\n {/* Trigger button - shown when closed */}\n <div\n tabIndex={0}\n role=\"button\"\n className={triggerButtonClasses}\n >\n {icon || <PlusIcon />}\n </div>\n\n {/* Main action button - shown when open (replaces trigger in flower mode) */}\n {mainAction && (\n <button\n className={`${triggerButtonClasses} ${dFabMainAction}`}\n onClick={onMainAction}\n >\n {mainAction}\n </button>\n )}\n\n {/* Close button - shown when open */}\n {showClose && (\n <button className={`${triggerButtonClasses} ${dFabClose}`}>\n <CloseIcon />\n </button>\n )}\n\n <FloatButtonGroupContext.Provider value={{ inGroup: true, shape }}>\n {children}\n </FloatButtonGroupContext.Provider>\n </div>\n )\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n visibilityHeight = 400,\n target,\n onClick,\n icon,\n duration = 450,\n position = 'bottom-right',\n offset = 24,\n className = '',\n children,\n style: propStyle,\n ...rest\n}) => {\n const [visible, setVisible] = useState(false)\n\n useEffect(() => {\n const scrollTarget = target ? target() : window\n\n const handleScroll = () => {\n const scrollTop =\n scrollTarget instanceof Window\n ? window.scrollY\n : (scrollTarget as HTMLElement).scrollTop\n\n setVisible(scrollTop >= visibilityHeight)\n }\n\n scrollTarget.addEventListener('scroll', handleScroll)\n handleScroll()\n\n return () => scrollTarget.removeEventListener('scroll', handleScroll)\n }, [target, visibilityHeight])\n\n const handleClick = () => {\n onClick?.()\n const scrollTarget = target ? target() : window\n if (scrollTarget instanceof Window) {\n window.scrollTo({ top: 0, behavior: 'smooth' })\n } else {\n (scrollTarget as HTMLElement).scrollTo({ top: 0, behavior: 'smooth' })\n }\n }\n\n if (!visible) return null\n\n const buttonClasses = [\n dBtn,\n dBtnLg,\n dBtnCircle,\n dBtnNeutral,\n 'shadow-lg',\n 'transition-opacity',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n bottom: offset,\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n ...propStyle,\n }\n\n return (\n <button className={buttonClasses} onClick={handleClick} style={style} {...rest}>\n {icon || children || <ArrowUpIcon />}\n </button>\n )\n}\n\nFloatButton.Group = FloatButtonGroup\nFloatButton.BackTop = BackTop\n"],"names":["dBtn","dBtnLg","dBtnCircle","dBtnSquare","dBtnNeutral","dBtnPrimary","dTooltip","dTooltipLeft","dTooltipRight","dTooltipTop","dTooltipBottom","dIndicator","dIndicatorItem","dBadge","dBadgeSecondary","dFab","dFabFlower","dFabMainAction","dFabClose","PlusIcon","jsx","ArrowUpIcon","CloseIcon","FloatButtonGroupContext","createContext","tooltipPlacementClasses","typeClasses","shapeClasses","FloatButtonBase","icon","description","onClick","type","shape","className","tooltip","tooltipPlacement","badge","href","target","children","style","rest","groupContext","useContext","effectiveShape","buttonClasses","content","buttonContent","Fragment","jsxs","buttonElement","withBadge","FloatButton","props","propStyle","FloatButtonGroup","flower","mainAction","onMainAction","showClose","position","offset","fabClasses","triggerButtonClasses","containerStyle","BackTop","visibilityHeight","duration","visible","setVisible","useState","useEffect","scrollTarget","handleScroll","scrollTop","handleClick"],"mappings":";;AAGA,MAAMA,IAAO,OACPC,IAAS,UACTC,IAAa,cACbC,IAAa,cACbC,IAAc,eACdC,IAAc,eACdC,IAAW,WACXC,IAAe,gBACfC,IAAgB,iBAChBC,IAAc,eACdC,IAAiB,kBACjBC,IAAa,aACbC,IAAiB,kBACjBC,IAAS,SACTC,IAAkB,mBAClBC,IAAO,OACPC,IAAa,cACbC,IAAiB,mBACjBC,IAAY,aAGZC,IAAW,MACf,gBAAAC,EAAC,OAAA,EAAI,OAAM,8BAA6B,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACjG,UAAA,gBAAAA,EAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,iBAAA,CAAiB,EAAA,CACxF,GAGIC,IAAc,MAClB,gBAAAD,EAAC,OAAA,EAAI,OAAM,8BAA6B,WA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E;AAAA,IACA;AAAA,IACA;AAAA,IACA8B;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELO,IAA6B;AAAA,IACjC,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQqB;AAAA,IACR,GAAID,EAAS,SAAS,OAAO,IAAI,EAAE,OAAOC,EAAA,IAAW,EAAE,MAAMA,EAAA;AAAA,IAC7D,GAAGP;AAAA,EAAA;AAGL,SACE,gBAAAnC,EAAC,UAAA,EAAO,WAAW0B,GAAe,SAAS8B,GAAa,OAAAnC,GAAe,GAAGC,GACvE,UAAAb,KAAQW,KAAY,gBAAApB,EAACC,KAAY,GACpC;AAEJ;AAEAgC,EAAY,QAAQG;AACpBH,EAAY,UAAUa;"}
|
|
1
|
+
{"version":3,"file":"FloatButton.js","sources":["../../src/components/FloatButton.tsx"],"sourcesContent":["import React, { useState, useEffect, createContext, useContext } from 'react'\n\n// DaisyUI classes\nconst dBtn = 'btn'\nconst dBtnLg = 'btn-lg'\nconst dBtnCircle = 'btn-circle'\nconst dBtnSquare = 'btn-square'\nconst dBtnNeutral = 'btn-neutral'\nconst dBtnPrimary = 'btn-primary'\nconst dTooltip = 'tooltip'\nconst dTooltipLeft = 'tooltip-left'\nconst dTooltipRight = 'tooltip-right'\nconst dTooltipTop = 'tooltip-top'\nconst dTooltipBottom = 'tooltip-bottom'\nconst dIndicator = 'indicator'\nconst dIndicatorItem = 'indicator-item'\nconst dBadge = 'badge'\nconst dBadgeSecondary = 'badge-secondary'\nconst dFab = 'fab'\nconst dFabFlower = 'fab-flower'\nconst dFabMainAction = 'fab-main-action'\nconst dFabClose = 'fab-close'\n\n// Default icons\nconst PlusIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 4v16m8-8H4\" />\n </svg>\n)\n\nconst ArrowUpIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 10l7-7m0 0l7 7m-7-7v18\" />\n </svg>\n)\n\nconst CloseIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n)\n\nexport interface FloatButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Icon to display */\n icon?: React.ReactNode\n /** Description text below icon */\n description?: React.ReactNode\n /** Button type/color */\n type?: 'default' | 'primary'\n /** Button shape */\n shape?: 'circle' | 'square'\n /** Tooltip text */\n tooltip?: string\n /** Tooltip placement */\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom'\n /** Badge content */\n badge?: number | React.ReactNode\n /** Link URL (renders as anchor) */\n href?: string\n /** Link target */\n target?: string\n /** @deprecated Use icon prop instead */\n children?: React.ReactNode\n 'data-testid'?: string\n}\n\nexport interface FloatButtonGroupProps {\n /** Child FloatButton components */\n children: React.ReactNode\n /** Arrange buttons in a quarter-circle (radial) layout */\n flower?: boolean\n /** Button shape for children */\n shape?: 'circle' | 'square'\n /** Main trigger button icon */\n icon?: React.ReactNode\n /** Accessible label for trigger button (required for icon-only buttons) */\n triggerLabel?: string\n /** Main action button that replaces trigger when open (fab-main-action) */\n mainAction?: React.ReactNode\n /** Accessible label for main action button */\n mainActionLabel?: string\n /** Click handler for main action button */\n onMainAction?: () => void\n /** Show close button when open (fab-close) */\n showClose?: boolean\n /** Accessible label for close button */\n closeLabel?: string\n /** Button type/color */\n type?: 'default' | 'primary'\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n /** Distance from edge */\n offset?: number\n /** Additional CSS classes */\n className?: string\n /** Custom styles */\n style?: React.CSSProperties\n 'data-testid'?: string\n}\n\nexport interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'> {\n /** Scroll threshold to show button (pixels) */\n visibilityHeight?: number\n /** Scroll target (default: window) */\n target?: () => HTMLElement | Window\n /** Click handler (called before scrolling) */\n onClick?: () => void\n /** Custom icon */\n icon?: React.ReactNode\n /** Duration of scroll animation in ms */\n duration?: number\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left'\n /** Distance from edge in pixels */\n offset?: number\n /** @deprecated Use icon prop instead */\n children?: React.ReactNode\n 'data-testid'?: string\n}\n\n// Context for group\ninterface FloatButtonGroupContextValue {\n inGroup: boolean\n shape?: 'circle' | 'square'\n}\n\nconst FloatButtonGroupContext = createContext<FloatButtonGroupContextValue>({ inGroup: false })\n\nconst tooltipPlacementClasses: Record<string, string> = {\n left: dTooltipLeft,\n right: dTooltipRight,\n top: dTooltipTop,\n bottom: dTooltipBottom,\n}\n\nconst typeClasses: Record<string, string> = {\n default: dBtnNeutral,\n primary: dBtnPrimary,\n}\n\nconst shapeClasses: Record<string, string> = {\n circle: dBtnCircle,\n square: dBtnSquare,\n}\n\ninterface FloatButtonComponent extends React.FC<FloatButtonProps> {\n Group: React.FC<FloatButtonGroupProps>\n BackTop: React.FC<BackTopProps>\n}\n\nconst FloatButtonBase: React.FC<FloatButtonProps & { style?: React.CSSProperties }> = ({\n icon,\n description,\n onClick,\n type = 'default',\n shape = 'circle',\n className = '',\n tooltip,\n tooltipPlacement = 'left',\n badge,\n href,\n target,\n children,\n style,\n 'data-testid': testId,\n ...rest\n}) => {\n const groupContext = useContext(FloatButtonGroupContext)\n const effectiveShape = groupContext.inGroup ? (groupContext.shape || shape) : shape\n\n const buttonClasses = [\n dBtn,\n dBtnLg,\n 'shadow-lg',\n shapeClasses[effectiveShape],\n typeClasses[type],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const content = icon || children || <PlusIcon />\n const getTestId = (suffix: string) => (testId ? `${testId}-${suffix}` : undefined)\n\n const buttonContent = (\n <>\n {description ? (\n <div className=\"flex flex-col items-center\">\n {content}\n <span className=\"text-xs mt-1\">{description}</span>\n </div>\n ) : (\n content\n )}\n </>\n )\n\n // When inside a group, render simple button without wrapper divs\n // DaisyUI's fab CSS requires direct button children\n if (groupContext.inGroup) {\n return href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n title={tooltip}\n onClick={onClick as any}\n data-testid={testId}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} title={tooltip} onClick={onClick} data-testid={testId} {...rest}>\n {buttonContent}\n </button>\n )\n }\n\n const buttonElement = href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n style={style}\n onClick={onClick as any}\n data-testid={testId}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} style={style} data-testid={testId} {...rest}>\n {buttonContent}\n </button>\n )\n\n const withBadge = badge !== undefined ? (\n <div className={dIndicator} style={style} data-testid={getTestId('indicator')}>\n <span className={`${dIndicatorItem} ${dBadge} ${dBadgeSecondary}`} data-testid={getTestId('badge')}>\n {badge}\n </span>\n {href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n onClick={onClick as any}\n data-testid={testId}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} data-testid={testId} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n ) : buttonElement\n\n if (tooltip) {\n return (\n <div\n className={`${dTooltip} ${tooltipPlacementClasses[tooltipPlacement]}`}\n data-tip={tooltip}\n style={style}\n data-testid={getTestId('tooltip')}\n >\n {badge !== undefined ? (\n <div className={dIndicator}>\n <span className={`${dIndicatorItem} ${dBadge} ${dBadgeSecondary}`} data-testid={getTestId('badge')}>{badge}</span>\n {href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n onClick={onClick as any}\n data-testid={testId}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} data-testid={testId} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n ) : href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n onClick={onClick as any}\n data-testid={testId}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} data-testid={testId} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n )\n }\n\n return withBadge\n}\n\nexport const FloatButton: FloatButtonComponent = (props) => {\n const {\n style: propStyle,\n ...rest\n } = props\n\n const groupContext = useContext(FloatButtonGroupContext)\n\n // If in group, don't apply fixed positioning\n if (groupContext.inGroup) {\n return <FloatButtonBase {...rest} />\n }\n\n // Standalone button with fixed positioning\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n bottom: 24,\n right: 24,\n ...propStyle,\n }\n\n return <FloatButtonBase {...rest} style={style} />\n}\n\nconst FloatButtonGroup: React.FC<FloatButtonGroupProps> = ({\n children,\n flower = false,\n shape = 'circle',\n icon,\n triggerLabel = 'Open menu',\n mainAction,\n mainActionLabel,\n onMainAction,\n showClose = false,\n closeLabel = 'Close menu',\n type = 'default',\n position = 'bottom-right',\n offset = 24,\n className = '',\n style: propStyle,\n 'data-testid': testId,\n}) => {\n const fabClasses = [\n dFab,\n flower ? dFabFlower : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const triggerButtonClasses = [\n dBtn,\n dBtnLg,\n 'shadow-lg',\n shapeClasses[shape],\n typeClasses[type],\n ]\n .filter(Boolean)\n .join(' ')\n\n const containerStyle: React.CSSProperties = {\n ...(position.includes('bottom') ? { bottom: offset } : { top: offset }),\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n ...propStyle,\n }\n\n const getTestId = (suffix: string) => (testId ? `${testId}-${suffix}` : undefined)\n\n return (\n <div className={fabClasses} style={containerStyle} data-testid={testId}>\n {/* Trigger button - shown when closed */}\n <button\n type=\"button\"\n className={triggerButtonClasses}\n aria-label={triggerLabel}\n aria-haspopup=\"true\"\n data-testid={getTestId('trigger')}\n >\n {icon || <PlusIcon />}\n </button>\n\n {/* Main action button - shown when open (replaces trigger in flower mode) */}\n {mainAction && (\n <button\n type=\"button\"\n className={`${triggerButtonClasses} ${dFabMainAction}`}\n onClick={onMainAction}\n aria-label={mainActionLabel}\n data-testid={getTestId('main-action')}\n >\n {mainAction}\n </button>\n )}\n\n {/* Close button - shown when open */}\n {showClose && (\n <button\n type=\"button\"\n className={`${triggerButtonClasses} ${dFabClose}`}\n aria-label={closeLabel}\n data-testid={getTestId('close')}\n >\n <CloseIcon />\n </button>\n )}\n\n <FloatButtonGroupContext.Provider value={{ inGroup: true, shape }}>\n {children}\n </FloatButtonGroupContext.Provider>\n </div>\n )\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n visibilityHeight = 400,\n target,\n onClick,\n icon,\n duration = 450,\n position = 'bottom-right',\n offset = 24,\n className = '',\n children,\n style: propStyle,\n 'data-testid': testId,\n ...rest\n}) => {\n const [visible, setVisible] = useState(false)\n\n useEffect(() => {\n const scrollTarget = target ? target() : window\n\n const handleScroll = () => {\n const scrollTop =\n scrollTarget instanceof Window\n ? window.scrollY\n : (scrollTarget as HTMLElement).scrollTop\n\n setVisible(scrollTop >= visibilityHeight)\n }\n\n scrollTarget.addEventListener('scroll', handleScroll)\n handleScroll()\n\n return () => scrollTarget.removeEventListener('scroll', handleScroll)\n }, [target, visibilityHeight])\n\n const handleClick = () => {\n onClick?.()\n const scrollTarget = target ? target() : window\n if (scrollTarget instanceof Window) {\n window.scrollTo({ top: 0, behavior: 'smooth' })\n } else {\n (scrollTarget as HTMLElement).scrollTo({ top: 0, behavior: 'smooth' })\n }\n }\n\n if (!visible) return null\n\n const buttonClasses = [\n dBtn,\n dBtnLg,\n dBtnCircle,\n dBtnNeutral,\n 'shadow-lg',\n 'transition-opacity',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n bottom: offset,\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n ...propStyle,\n }\n\n return (\n <button\n className={buttonClasses}\n onClick={handleClick}\n style={style}\n aria-label={rest['aria-label'] || 'Back to top'}\n data-testid={testId}\n {...rest}\n >\n {icon || children || <ArrowUpIcon />}\n </button>\n )\n}\n\nFloatButton.Group = FloatButtonGroup\nFloatButton.BackTop = BackTop\n"],"names":["dBtn","dBtnLg","dBtnCircle","dBtnSquare","dBtnNeutral","dBtnPrimary","dTooltip","dTooltipLeft","dTooltipRight","dTooltipTop","dTooltipBottom","dIndicator","dIndicatorItem","dBadge","dBadgeSecondary","dFab","dFabFlower","dFabMainAction","dFabClose","PlusIcon","jsx","ArrowUpIcon","CloseIcon","FloatButtonGroupContext","createContext","tooltipPlacementClasses","typeClasses","shapeClasses","FloatButtonBase","icon","description","onClick","type","shape","className","tooltip","tooltipPlacement","badge","href","target","children","style","testId","rest","groupContext","useContext","effectiveShape","buttonClasses","content","getTestId","suffix","buttonContent","Fragment","jsxs","buttonElement","withBadge","FloatButton","props","propStyle","FloatButtonGroup","flower","triggerLabel","mainAction","mainActionLabel","onMainAction","showClose","closeLabel","position","offset","fabClasses","triggerButtonClasses","containerStyle","BackTop","visibilityHeight","duration","visible","setVisible","useState","useEffect","scrollTarget","handleScroll","scrollTop","handleClick"],"mappings":";;AAGA,MAAMA,IAAO,OACPC,IAAS,UACTC,IAAa,cACbC,IAAa,cACbC,IAAc,eACdC,IAAc,eACdC,IAAW,WACXC,IAAe,gBACfC,IAAgB,iBAChBC,IAAc,eACdC,IAAiB,kBACjBC,IAAa,aACbC,IAAiB,kBACjBC,IAAS,SACTC,IAAkB,mBAClBC,IAAO,OACPC,IAAa,cACbC,KAAiB,mBACjBC,KAAY,aAGZC,IAAW,MACf,gBAAAC,EAAC,OAAA,EAAI,OAAM,8BAA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AAM5B,IAAgB;AAAA,IACpB/C;AAAA,IACAC;AAAA,IACAC;AAAA,IACAE;AAAA,IACA;AAAA,IACA;AAAA,IACA8B;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELO,IAA6B;AAAA,IACjC,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQ2B;AAAA,IACR,GAAID,EAAS,SAAS,OAAO,IAAI,EAAE,OAAOC,EAAA,IAAW,EAAE,MAAMA,EAAA;AAAA,IAC7D,GAAGV;AAAA,EAAA;AAGL,SACE,gBAAAtC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW2B;AAAA,MACX,SAASmC;AAAA,MACT,OAAAzC;AAAA,MACA,cAAYE,EAAK,YAAY,KAAK;AAAA,MAClC,eAAaD;AAAA,MACZ,GAAGC;AAAA,MAEH,UAAAd,KAAQW,KAAY,gBAAApB,EAACC,IAAA,CAAA,CAAY;AAAA,IAAA;AAAA,EAAA;AAGxC;AAEAmC,EAAY,QAAQG;AACpBH,EAAY,UAAUgB;"}
|
|
@@ -4,6 +4,8 @@ export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
4
4
|
center?: boolean;
|
|
5
5
|
horizontal?: boolean;
|
|
6
6
|
vertical?: boolean;
|
|
7
|
+
/** Test ID for testing */
|
|
8
|
+
'data-testid'?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface FooterTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
9
11
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sources":["../../src/components/Footer.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dFooter = 'footer'\nconst dFooterCenter = 'footer-center'\nconst dFooterHorizontal = 'footer-horizontal'\nconst dFooterVertical = 'footer-vertical'\nconst dFooterTitle = 'footer-title'\n\nexport interface FooterProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode\n center?: boolean\n horizontal?: boolean\n vertical?: boolean\n}\n\nexport interface FooterTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n children: React.ReactNode\n}\n\nfunction FooterRoot({ children, className = '', center = false, horizontal = false, vertical = false, ...rest }: FooterProps) {\n const classes = [\n dFooter,\n center && dFooterCenter,\n horizontal && dFooterHorizontal,\n vertical && dFooterVertical,\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <footer className={classes} {...rest}>{children}</footer>\n}\n\nfunction FooterTitle({ children, className = '', ...rest }: FooterTitleProps) {\n return <h6 className={`${dFooterTitle} ${className}`} {...rest}>{children}</h6>\n}\n\nexport const Footer = Object.assign(FooterRoot, {\n Title: FooterTitle,\n})\n"],"names":["dFooter","dFooterCenter","dFooterHorizontal","dFooterVertical","dFooterTitle","FooterRoot","children","className","center","horizontal","vertical","rest","classes","FooterTitle","jsx","Footer"],"mappings":";AAGA,MAAMA,IAAU,UACVC,IAAgB,iBAChBC,IAAoB,qBACpBC,IAAkB,mBAClBC,IAAe;
|
|
1
|
+
{"version":3,"file":"Footer.js","sources":["../../src/components/Footer.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dFooter = 'footer'\nconst dFooterCenter = 'footer-center'\nconst dFooterHorizontal = 'footer-horizontal'\nconst dFooterVertical = 'footer-vertical'\nconst dFooterTitle = 'footer-title'\n\nexport interface FooterProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode\n center?: boolean\n horizontal?: boolean\n vertical?: boolean\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nexport interface FooterTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n children: React.ReactNode\n}\n\nfunction FooterRoot({ children, className = '', center = false, horizontal = false, vertical = false, ...rest }: FooterProps) {\n const classes = [\n dFooter,\n center && dFooterCenter,\n horizontal && dFooterHorizontal,\n vertical && dFooterVertical,\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <footer className={classes} {...rest}>{children}</footer>\n}\n\nfunction FooterTitle({ children, className = '', ...rest }: FooterTitleProps) {\n return <h6 className={`${dFooterTitle} ${className}`} {...rest}>{children}</h6>\n}\n\nexport const Footer = Object.assign(FooterRoot, {\n Title: FooterTitle,\n})\n"],"names":["dFooter","dFooterCenter","dFooterHorizontal","dFooterVertical","dFooterTitle","FooterRoot","children","className","center","horizontal","vertical","rest","classes","FooterTitle","jsx","Footer"],"mappings":";AAGA,MAAMA,IAAU,UACVC,IAAgB,iBAChBC,IAAoB,qBACpBC,IAAkB,mBAClBC,IAAe;AAerB,SAASC,EAAW,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,QAAAC,IAAS,IAAO,YAAAC,IAAa,IAAO,UAAAC,IAAW,IAAO,GAAGC,KAAqB;AAC5H,QAAMC,IAAU;AAAA,IACdZ;AAAA,IACAQ,KAAUP;AAAA,IACVQ,KAAcP;AAAA,IACdQ,KAAYP;AAAA,IACZI;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,UAAA,EAAO,WAAWK,GAAU,GAAGD,GAAO,UAAAL,GAAS;AACzD;AAEA,SAASO,EAAY,EAAE,UAAAP,GAAU,WAAAC,IAAY,IAAI,GAAGI,KAA0B;AAC5E,SAAO,gBAAAG,EAAC,MAAA,EAAG,WAAW,GAAGV,CAAY,IAAIG,CAAS,IAAK,GAAGI,GAAO,UAAAL,EAAA,CAAS;AAC5E;AAEO,MAAMS,IAAS,OAAO,OAAOV,GAAY;AAAA,EAC9C,OAAOQ;AACT,CAAC;"}
|
|
@@ -5,6 +5,8 @@ export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
gutter?: number | [number, number];
|
|
6
6
|
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly';
|
|
7
7
|
align?: 'start' | 'end' | 'center' | 'stretch' | 'baseline';
|
|
8
|
+
/** Test ID for testing */
|
|
9
|
+
'data-testid'?: string;
|
|
8
10
|
}
|
|
9
11
|
export interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
10
12
|
children: React.ReactNode;
|
|
@@ -17,6 +19,8 @@ export interface ColProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
17
19
|
lg?: number;
|
|
18
20
|
xl?: number;
|
|
19
21
|
xxl?: number;
|
|
22
|
+
/** Test ID for testing */
|
|
23
|
+
'data-testid'?: string;
|
|
20
24
|
}
|
|
21
25
|
export declare function Row({ children, cols, gutter, justify, align, className, style: userStyle, ...rest }: RowProps): import("react/jsx-runtime").JSX.Element;
|
|
22
26
|
export declare function Col({ children, span, offset, order, xs, sm, md, lg, xl, xxl, className, style: userStyle, ...rest }: ColProps): import("react/jsx-runtime").JSX.Element;
|