asterui 0.12.48 → 0.12.50
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/Alert.js +18 -18
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/Anchor.js +53 -53
- package/dist/components/Anchor.js.map +1 -1
- package/dist/components/Autocomplete.js +115 -114
- package/dist/components/Autocomplete.js.map +1 -1
- package/dist/components/Avatar.js +33 -32
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Badge.js +99 -99
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/Breadcrumb.js +12 -11
- package/dist/components/Breadcrumb.js.map +1 -1
- package/dist/components/Browser.js +10 -10
- package/dist/components/Browser.js.map +1 -1
- package/dist/components/Button.js +80 -79
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +2 -0
- package/dist/components/Card.js +111 -110
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Carousel.js +59 -59
- package/dist/components/Carousel.js.map +1 -1
- package/dist/components/Cascader.js +175 -174
- package/dist/components/Cascader.js.map +1 -1
- package/dist/components/Chat.js +27 -27
- package/dist/components/Chat.js.map +1 -1
- package/dist/components/Checkbox.js +98 -97
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Code.js +11 -11
- package/dist/components/Code.js.map +1 -1
- package/dist/components/Collapse.js +46 -46
- package/dist/components/Collapse.js.map +1 -1
- package/dist/components/ColorPicker.d.ts +1 -1
- package/dist/components/ColorPicker.js +93 -91
- package/dist/components/ColorPicker.js.map +1 -1
- package/dist/components/Command.d.ts +65 -0
- package/dist/components/Command.js +422 -0
- package/dist/components/Command.js.map +1 -0
- package/dist/components/ConfigProvider.d.ts +1 -1
- package/dist/components/ConfigProvider.js +9 -9
- package/dist/components/ConfigProvider.js.map +1 -1
- package/dist/components/ContextMenu.js +33 -33
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/CopyButton.js +74 -73
- package/dist/components/CopyButton.js.map +1 -1
- package/dist/components/Countdown.js +60 -59
- package/dist/components/Countdown.js.map +1 -1
- package/dist/components/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker.js +54 -53
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/Diff.js +10 -10
- package/dist/components/Diff.js.map +1 -1
- package/dist/components/Divider.js +21 -20
- package/dist/components/Divider.js.map +1 -1
- package/dist/components/Dock.js +28 -27
- package/dist/components/Dock.js.map +1 -1
- package/dist/components/Drawer.js +43 -43
- package/dist/components/Drawer.js.map +1 -1
- package/dist/components/Dropdown.js +127 -127
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Empty.js +16 -15
- package/dist/components/Empty.js.map +1 -1
- package/dist/components/Fieldset.js +11 -10
- package/dist/components/Fieldset.js.map +1 -1
- package/dist/components/FileInput.js +30 -29
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Filter.d.ts +1 -1
- package/dist/components/Filter.js +32 -30
- package/dist/components/Filter.js.map +1 -1
- package/dist/components/FloatButton.js +83 -83
- package/dist/components/FloatButton.js.map +1 -1
- package/dist/components/Footer.js +14 -13
- package/dist/components/Footer.js.map +1 -1
- package/dist/components/Form.js +133 -132
- package/dist/components/Form.js.map +1 -1
- package/dist/components/Hero.js +12 -11
- package/dist/components/Hero.js.map +1 -1
- package/dist/components/HoverGallery.js +7 -7
- package/dist/components/HoverGallery.js.map +1 -1
- package/dist/components/Image.js +40 -40
- package/dist/components/Image.js.map +1 -1
- package/dist/components/Input.js +171 -169
- package/dist/components/Input.js.map +1 -1
- package/dist/components/InputNumber.js +84 -83
- package/dist/components/InputNumber.js.map +1 -1
- package/dist/components/Join.js +11 -10
- package/dist/components/Join.js.map +1 -1
- package/dist/components/Kbd.js +15 -15
- package/dist/components/Kbd.js.map +1 -1
- package/dist/components/Layout.js +66 -66
- package/dist/components/Layout.js.map +1 -1
- package/dist/components/List.d.ts +1 -1
- package/dist/components/List.js +75 -72
- package/dist/components/List.js.map +1 -1
- package/dist/components/Loading.d.ts +1 -1
- package/dist/components/Loading.js +31 -29
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/Mask.js +31 -31
- package/dist/components/Mask.js.map +1 -1
- package/dist/components/Mention.js +61 -61
- package/dist/components/Mention.js.map +1 -1
- package/dist/components/Menu.js +84 -84
- package/dist/components/Menu.js.map +1 -1
- package/dist/components/Message.js +30 -29
- package/dist/components/Message.js.map +1 -1
- package/dist/components/Modal.js +117 -116
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/MonthCalendar.d.ts +31 -0
- package/dist/components/MonthCalendar.js +205 -0
- package/dist/components/MonthCalendar.js.map +1 -0
- package/dist/components/Navbar.js +25 -25
- package/dist/components/Navbar.js.map +1 -1
- package/dist/components/Notification.js +56 -55
- package/dist/components/Notification.js.map +1 -1
- package/dist/components/OTPInput.js +69 -68
- package/dist/components/OTPInput.js.map +1 -1
- package/dist/components/Pagination.d.ts +1 -1
- package/dist/components/Pagination.js +60 -58
- package/dist/components/Pagination.js.map +1 -1
- package/dist/components/Phone.js +10 -10
- package/dist/components/Phone.js.map +1 -1
- package/dist/components/Popconfirm.js +60 -60
- package/dist/components/Popconfirm.js.map +1 -1
- package/dist/components/Progress.js +17 -17
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/QRCode.js +23 -23
- package/dist/components/QRCode.js.map +1 -1
- package/dist/components/RadialProgress.js +17 -17
- package/dist/components/RadialProgress.js.map +1 -1
- package/dist/components/Radio.js +41 -40
- package/dist/components/Radio.js.map +1 -1
- package/dist/components/Range.d.ts +1 -1
- package/dist/components/Range.js +39 -37
- package/dist/components/Range.js.map +1 -1
- package/dist/components/Rating.js +79 -78
- package/dist/components/Rating.js.map +1 -1
- package/dist/components/ResponsiveDrawer.js +27 -27
- package/dist/components/ResponsiveDrawer.js.map +1 -1
- package/dist/components/RichTextEditor.d.ts +32 -0
- package/dist/components/RichTextEditor.js +335 -0
- package/dist/components/RichTextEditor.js.map +1 -0
- package/dist/components/Segmented.d.ts +1 -1
- package/dist/components/Segmented.js +48 -46
- package/dist/components/Segmented.js.map +1 -1
- package/dist/components/Select.js +55 -54
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Skeleton.js +9 -9
- package/dist/components/Skeleton.js.map +1 -1
- package/dist/components/Splitter.js +93 -93
- package/dist/components/Splitter.js.map +1 -1
- package/dist/components/Stat.js +17 -16
- package/dist/components/Stat.js.map +1 -1
- package/dist/components/Status.js +29 -29
- package/dist/components/Status.js.map +1 -1
- package/dist/components/Steps.js +61 -61
- package/dist/components/Steps.js.map +1 -1
- package/dist/components/Table.js +256 -256
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tabs.js +65 -65
- package/dist/components/Tabs.js.map +1 -1
- package/dist/components/Tag.js +147 -147
- package/dist/components/Tag.js.map +1 -1
- package/dist/components/TextRotate.js +6 -6
- package/dist/components/TextRotate.js.map +1 -1
- package/dist/components/Textarea.js +35 -34
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/ThemeController.d.ts +1 -1
- package/dist/components/ThemeController.js +71 -68
- package/dist/components/ThemeController.js.map +1 -1
- package/dist/components/TimePicker.d.ts +1 -1
- package/dist/components/TimePicker.js +133 -129
- package/dist/components/TimePicker.js.map +1 -1
- package/dist/components/Timeline.js +79 -79
- package/dist/components/Timeline.js.map +1 -1
- package/dist/components/Toggle.js +33 -32
- package/dist/components/Toggle.js.map +1 -1
- package/dist/components/Tooltip.js +25 -25
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Tour.js +126 -126
- package/dist/components/Tour.js.map +1 -1
- package/dist/components/Transfer.js +93 -92
- package/dist/components/Transfer.js.map +1 -1
- package/dist/components/Tree.js +200 -200
- package/dist/components/Tree.js.map +1 -1
- package/dist/components/TreeSelect.js +255 -254
- package/dist/components/TreeSelect.js.map +1 -1
- package/dist/components/Typography.js +71 -70
- package/dist/components/Typography.js.map +1 -1
- package/dist/components/Upload.js +81 -81
- package/dist/components/Upload.js.map +1 -1
- package/dist/components/WeekCalendar.d.ts +35 -0
- package/dist/components/WeekCalendar.js +204 -0
- package/dist/components/WeekCalendar.js.map +1 -0
- package/dist/components/Window.js +7 -7
- package/dist/components/Window.js.map +1 -1
- package/dist/editor.d.ts +1 -0
- package/dist/editor.js +5 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +221 -215
- package/dist/index.js.map +1 -1
- package/package.json +30 -1
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useContext as
|
|
3
|
-
const y = () => /* @__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" }) }),
|
|
4
|
-
left:
|
|
5
|
-
right:
|
|
6
|
-
top:
|
|
7
|
-
bottom:
|
|
8
|
-
},
|
|
9
|
-
default:
|
|
10
|
-
primary:
|
|
11
|
-
},
|
|
12
|
-
circle:
|
|
13
|
-
square:
|
|
14
|
-
},
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as j, createContext as z, useState as A, useEffect as R } from "react";
|
|
3
|
+
const f = "btn", x = "btn-lg", I = "btn-circle", U = "btn-square", k = "btn-neutral", V = "btn-primary", Y = "tooltip", D = "tooltip-left", H = "tooltip-right", J = "tooltip-top", K = "tooltip-bottom", T = "indicator", $ = "indicator-item", y = "badge", L = "badge-secondary", O = "fab", Q = "fab-flower", X = "fab-main-action", Z = "fab-close", G = () => /* @__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" }) }), _ = () => /* @__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" }) }), tt = () => /* @__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 = z({ inGroup: !1 }), ot = {
|
|
4
|
+
left: D,
|
|
5
|
+
right: H,
|
|
6
|
+
top: J,
|
|
7
|
+
bottom: K
|
|
8
|
+
}, S = {
|
|
9
|
+
default: k,
|
|
10
|
+
primary: V
|
|
11
|
+
}, M = {
|
|
12
|
+
circle: I,
|
|
13
|
+
square: U
|
|
14
|
+
}, F = ({
|
|
15
15
|
icon: d,
|
|
16
16
|
description: l,
|
|
17
17
|
onClick: o,
|
|
18
|
-
type:
|
|
18
|
+
type: h = "default",
|
|
19
19
|
shape: u = "circle",
|
|
20
20
|
className: w = "",
|
|
21
|
-
tooltip:
|
|
21
|
+
tooltip: a,
|
|
22
22
|
tooltipPlacement: v = "left",
|
|
23
|
-
badge:
|
|
23
|
+
badge: r,
|
|
24
24
|
href: e,
|
|
25
25
|
target: i,
|
|
26
|
-
children:
|
|
26
|
+
children: N,
|
|
27
27
|
style: m,
|
|
28
28
|
...s
|
|
29
29
|
}) => {
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const p = j(C), B = p.inGroup && p.shape || u, n = [
|
|
31
|
+
f,
|
|
32
|
+
x,
|
|
33
33
|
"shadow-lg",
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
M[B],
|
|
35
|
+
S[h],
|
|
36
36
|
w
|
|
37
|
-
].filter(Boolean).join(" "), b = d ||
|
|
37
|
+
].filter(Boolean).join(" "), b = d || N || /* @__PURE__ */ t(G, {}), c = /* @__PURE__ */ t(q, { children: l ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center", children: [
|
|
38
38
|
b,
|
|
39
39
|
/* @__PURE__ */ t("span", { className: "text-xs mt-1", children: l })
|
|
40
40
|
] }) : b });
|
|
41
|
-
if (
|
|
41
|
+
if (p.inGroup)
|
|
42
42
|
return e ? /* @__PURE__ */ t(
|
|
43
43
|
"a",
|
|
44
44
|
{
|
|
45
45
|
href: e,
|
|
46
46
|
target: i,
|
|
47
47
|
className: n,
|
|
48
|
-
title:
|
|
48
|
+
title: a,
|
|
49
49
|
onClick: o,
|
|
50
50
|
...s,
|
|
51
|
-
children:
|
|
51
|
+
children: c
|
|
52
52
|
}
|
|
53
|
-
) : /* @__PURE__ */ t("button", { className: n, title:
|
|
54
|
-
const
|
|
53
|
+
) : /* @__PURE__ */ t("button", { className: n, title: a, onClick: o, ...s, children: c });
|
|
54
|
+
const E = e ? /* @__PURE__ */ t(
|
|
55
55
|
"a",
|
|
56
56
|
{
|
|
57
57
|
href: e,
|
|
@@ -60,23 +60,23 @@ const y = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
|
60
60
|
style: m,
|
|
61
61
|
onClick: o,
|
|
62
62
|
...s,
|
|
63
|
-
children:
|
|
63
|
+
children: c
|
|
64
64
|
}
|
|
65
|
-
) : /* @__PURE__ */ t("button", { className: n, onClick: o, style: m, ...s, children:
|
|
66
|
-
/* @__PURE__ */ t("span", { className:
|
|
67
|
-
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children:
|
|
68
|
-
] }) :
|
|
69
|
-
return
|
|
70
|
-
/* @__PURE__ */ t("span", { className:
|
|
71
|
-
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children:
|
|
72
|
-
] }) : e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children:
|
|
73
|
-
},
|
|
65
|
+
) : /* @__PURE__ */ t("button", { className: n, onClick: o, style: m, ...s, children: c }), P = r !== void 0 ? /* @__PURE__ */ g("div", { className: T, style: m, children: [
|
|
66
|
+
/* @__PURE__ */ t("span", { className: `${$} ${y} ${L}`, children: r }),
|
|
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) => {
|
|
74
74
|
const {
|
|
75
75
|
style: l,
|
|
76
76
|
...o
|
|
77
77
|
} = d;
|
|
78
|
-
if (C
|
|
79
|
-
return /* @__PURE__ */ t(
|
|
78
|
+
if (j(C).inGroup)
|
|
79
|
+
return /* @__PURE__ */ t(F, { ...o });
|
|
80
80
|
const u = {
|
|
81
81
|
position: "fixed",
|
|
82
82
|
zIndex: 1e3,
|
|
@@ -84,75 +84,75 @@ const y = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
|
84
84
|
right: 24,
|
|
85
85
|
...l
|
|
86
86
|
};
|
|
87
|
-
return /* @__PURE__ */ t(
|
|
88
|
-
},
|
|
87
|
+
return /* @__PURE__ */ t(F, { ...o, style: u });
|
|
88
|
+
}, nt = ({
|
|
89
89
|
children: d,
|
|
90
90
|
flower: l = !1,
|
|
91
91
|
shape: o = "circle",
|
|
92
|
-
icon:
|
|
92
|
+
icon: h,
|
|
93
93
|
mainAction: u,
|
|
94
94
|
onMainAction: w,
|
|
95
|
-
showClose:
|
|
95
|
+
showClose: a = !1,
|
|
96
96
|
type: v = "default",
|
|
97
|
-
position:
|
|
97
|
+
position: r = "bottom-right",
|
|
98
98
|
offset: e = 24,
|
|
99
99
|
className: i = "",
|
|
100
|
-
style:
|
|
100
|
+
style: N
|
|
101
101
|
}) => {
|
|
102
102
|
const m = [
|
|
103
|
-
|
|
104
|
-
l ?
|
|
103
|
+
O,
|
|
104
|
+
l ? Q : "",
|
|
105
105
|
i
|
|
106
106
|
].filter(Boolean).join(" "), s = [
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
f,
|
|
108
|
+
x,
|
|
109
109
|
"shadow-lg",
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
].filter(Boolean).join(" "),
|
|
113
|
-
...
|
|
114
|
-
...
|
|
115
|
-
...
|
|
110
|
+
M[o],
|
|
111
|
+
S[v]
|
|
112
|
+
].filter(Boolean).join(" "), p = {
|
|
113
|
+
...r.includes("bottom") ? { bottom: e } : { top: e },
|
|
114
|
+
...r.includes("right") ? { right: e } : { left: e },
|
|
115
|
+
...N
|
|
116
116
|
};
|
|
117
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ g("div", { className: m, style: p, children: [
|
|
118
118
|
/* @__PURE__ */ t(
|
|
119
119
|
"div",
|
|
120
120
|
{
|
|
121
121
|
tabIndex: 0,
|
|
122
122
|
role: "button",
|
|
123
123
|
className: s,
|
|
124
|
-
children:
|
|
124
|
+
children: h || /* @__PURE__ */ t(G, {})
|
|
125
125
|
}
|
|
126
126
|
),
|
|
127
127
|
u && /* @__PURE__ */ t(
|
|
128
128
|
"button",
|
|
129
129
|
{
|
|
130
|
-
className: `${s}
|
|
130
|
+
className: `${s} ${X}`,
|
|
131
131
|
onClick: w,
|
|
132
132
|
children: u
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
|
|
136
|
-
/* @__PURE__ */ t(
|
|
135
|
+
a && /* @__PURE__ */ t("button", { className: `${s} ${Z}`, children: /* @__PURE__ */ t(tt, {}) }),
|
|
136
|
+
/* @__PURE__ */ t(C.Provider, { value: { inGroup: !0, shape: o }, children: d })
|
|
137
137
|
] });
|
|
138
|
-
},
|
|
138
|
+
}, et = ({
|
|
139
139
|
visibilityHeight: d = 400,
|
|
140
140
|
target: l,
|
|
141
141
|
onClick: o,
|
|
142
|
-
icon:
|
|
142
|
+
icon: h,
|
|
143
143
|
duration: u = 450,
|
|
144
144
|
position: w = "bottom-right",
|
|
145
|
-
offset:
|
|
145
|
+
offset: a = 24,
|
|
146
146
|
className: v = "",
|
|
147
|
-
children:
|
|
147
|
+
children: r,
|
|
148
148
|
style: e,
|
|
149
149
|
...i
|
|
150
150
|
}) => {
|
|
151
|
-
const [
|
|
152
|
-
|
|
151
|
+
const [N, m] = A(!1);
|
|
152
|
+
R(() => {
|
|
153
153
|
const n = l ? l() : window, b = () => {
|
|
154
|
-
const
|
|
155
|
-
m(
|
|
154
|
+
const c = n instanceof Window ? window.scrollY : n.scrollTop;
|
|
155
|
+
m(c >= d);
|
|
156
156
|
};
|
|
157
157
|
return n.addEventListener("scroll", b), b(), () => n.removeEventListener("scroll", b);
|
|
158
158
|
}, [l, d]);
|
|
@@ -161,27 +161,27 @@ const y = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
|
161
161
|
const n = l ? l() : window;
|
|
162
162
|
n instanceof Window ? window.scrollTo({ top: 0, behavior: "smooth" }) : n.scrollTo({ top: 0, behavior: "smooth" });
|
|
163
163
|
};
|
|
164
|
-
if (!
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
if (!N) return null;
|
|
165
|
+
const p = [
|
|
166
|
+
f,
|
|
167
|
+
x,
|
|
168
|
+
I,
|
|
169
|
+
k,
|
|
170
170
|
"shadow-lg",
|
|
171
171
|
"transition-opacity",
|
|
172
172
|
v
|
|
173
|
-
].filter(Boolean).join(" "),
|
|
173
|
+
].filter(Boolean).join(" "), B = {
|
|
174
174
|
position: "fixed",
|
|
175
175
|
zIndex: 1e3,
|
|
176
|
-
bottom:
|
|
177
|
-
...w.includes("right") ? { right:
|
|
176
|
+
bottom: a,
|
|
177
|
+
...w.includes("right") ? { right: a } : { left: a },
|
|
178
178
|
...e
|
|
179
179
|
};
|
|
180
|
-
return /* @__PURE__ */ t("button", { className:
|
|
180
|
+
return /* @__PURE__ */ t("button", { className: p, onClick: s, style: B, ...i, children: h || r || /* @__PURE__ */ t(_, {}) });
|
|
181
181
|
};
|
|
182
|
-
|
|
183
|
-
|
|
182
|
+
W.Group = nt;
|
|
183
|
+
W.BackTop = et;
|
|
184
184
|
export {
|
|
185
|
-
|
|
185
|
+
W as FloatButton
|
|
186
186
|
};
|
|
187
187
|
//# 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// 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: 'tooltip-left',\n right: 'tooltip-right',\n top: 'tooltip-top',\n bottom: 'tooltip-bottom',\n}\n\nconst typeClasses: Record<string, string> = {\n default: 'btn-neutral',\n primary: 'btn-primary',\n}\n\nconst shapeClasses: Record<string, string> = {\n circle: 'btn-circle',\n square: 'btn-square',\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 'btn',\n 'btn-lg',\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=\"indicator\" style={style}>\n <span className=\"indicator-item badge badge-secondary\">\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={`tooltip ${tooltipPlacementClasses[tooltipPlacement]}`} data-tip={tooltip} style={style}>\n {badge !== undefined ? (\n <div className=\"indicator\">\n <span className=\"indicator-item badge badge-secondary\">{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 'fab',\n flower ? 'fab-flower' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const triggerButtonClasses = [\n 'btn',\n 'btn-lg',\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} fab-main-action`}\n onClick={onMainAction}\n >\n {mainAction}\n </button>\n )}\n\n {/* Close button - shown when open */}\n {showClose && (\n <button className={`${triggerButtonClasses} fab-close`}>\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 'btn',\n 'btn-lg',\n 'btn-circle',\n 'btn-neutral',\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":["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,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,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACjG,UAAA,gBAAAA,EAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,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,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}\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,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AAQ4B,CAAgB,CAAC;AAE7B,QAAMS,IAAc,MAAM;AACxB,IAAA7C,IAAA;AACA,UAAM0C,IAAelC,IAASA,EAAA,IAAW;AACzC,IAAIkC,aAAwB,SAC1B,OAAO,SAAS,EAAE,KAAK,GAAG,UAAU,UAAU,IAE7CA,EAA6B,SAAS,EAAE,KAAK,GAAG,UAAU,UAAU;AAAA,EAEzE;AAEA,MAAI,CAACJ,EAAS,QAAO;AAErB,QAAMvB,IAAgB;AAAA,IACpB9C;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,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,21 +1,22 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
const a = "footer", i = "footer-center", f = "footer-horizontal", F = "footer-vertical", d = "footer-title";
|
|
3
|
+
function m({ children: o, className: t = "", center: e = !1, horizontal: n = !1, vertical: s = !1, ...c }) {
|
|
4
|
+
const l = [
|
|
5
|
+
a,
|
|
6
|
+
e && i,
|
|
7
|
+
n && f,
|
|
8
|
+
s && F,
|
|
9
|
+
t
|
|
9
10
|
].filter(Boolean).join(" ");
|
|
10
|
-
return /* @__PURE__ */ r("footer", { className:
|
|
11
|
+
return /* @__PURE__ */ r("footer", { className: l, ...c, children: o });
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
-
return /* @__PURE__ */ r("h6", { className:
|
|
13
|
+
function u({ children: o, className: t = "", ...e }) {
|
|
14
|
+
return /* @__PURE__ */ r("h6", { className: `${d} ${t}`, ...e, children: o });
|
|
14
15
|
}
|
|
15
|
-
const
|
|
16
|
-
Title:
|
|
16
|
+
const T = Object.assign(m, {
|
|
17
|
+
Title: u
|
|
17
18
|
});
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
T as Footer
|
|
20
21
|
};
|
|
21
22
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.js","sources":["../../src/components/Footer.tsx"],"sourcesContent":["import React from 'react'\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
|
|
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;AAarB,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;"}
|