asterui 0.12.62 → 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/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/Breadcrumb.d.ts +4 -2
- package/dist/components/Breadcrumb.js +54 -29
- package/dist/components/Breadcrumb.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 +32 -30
- package/dist/components/Chat.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/ContextMenu.d.ts +4 -0
- package/dist/components/ContextMenu.js +149 -130
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Dock.d.ts +2 -0
- package/dist/components/Dock.js +70 -46
- package/dist/components/Dock.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 +3 -0
- package/dist/components/FloatButton.js +178 -127
- package/dist/components/FloatButton.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/Loading.d.ts +1 -0
- package/dist/components/Loading.js +40 -37
- package/dist/components/Loading.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/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/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/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/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/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/package.json +1 -1
package/dist/components/Flex.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
const y = ({
|
|
3
|
-
direction:
|
|
3
|
+
direction: l,
|
|
4
4
|
justify: r,
|
|
5
5
|
align: s,
|
|
6
|
-
wrap:
|
|
6
|
+
wrap: a,
|
|
7
7
|
gap: e,
|
|
8
|
-
flex:
|
|
9
|
-
inline:
|
|
10
|
-
minHeight:
|
|
11
|
-
minWidth:
|
|
8
|
+
flex: m,
|
|
9
|
+
inline: f = !1,
|
|
10
|
+
minHeight: n,
|
|
11
|
+
minWidth: o,
|
|
12
12
|
className: x = "",
|
|
13
|
-
style:
|
|
14
|
-
children:
|
|
15
|
-
|
|
13
|
+
style: i,
|
|
14
|
+
children: c,
|
|
15
|
+
"data-testid": u,
|
|
16
|
+
...w
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const t = typeof e == "number", p = [
|
|
19
|
+
f ? "inline-flex" : "flex",
|
|
20
|
+
l === "row" && "flex-row",
|
|
21
|
+
l === "column" && "flex-col",
|
|
22
|
+
l === "row-reverse" && "flex-row-reverse",
|
|
23
|
+
l === "column-reverse" && "flex-col-reverse",
|
|
23
24
|
r === "start" && "justify-start",
|
|
24
25
|
r === "end" && "justify-end",
|
|
25
26
|
r === "center" && "justify-center",
|
|
@@ -31,34 +32,34 @@ const y = ({
|
|
|
31
32
|
s === "center" && "items-center",
|
|
32
33
|
s === "baseline" && "items-baseline",
|
|
33
34
|
s === "stretch" && "items-stretch",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
!
|
|
39
|
-
!
|
|
40
|
-
!
|
|
41
|
-
!
|
|
42
|
-
!
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
a === !0 && "flex-wrap",
|
|
36
|
+
a === "wrap" && "flex-wrap",
|
|
37
|
+
a === "nowrap" && "flex-nowrap",
|
|
38
|
+
a === "wrap-reverse" && "flex-wrap-reverse",
|
|
39
|
+
!t && e === "xs" && "gap-1",
|
|
40
|
+
!t && e === "sm" && "gap-2",
|
|
41
|
+
!t && e === "md" && "gap-4",
|
|
42
|
+
!t && e === "lg" && "gap-6",
|
|
43
|
+
!t && e === "xl" && "gap-8",
|
|
44
|
+
m === "1" && "flex-1",
|
|
45
|
+
m === "auto" && "flex-auto",
|
|
46
|
+
m === "initial" && "flex-initial",
|
|
47
|
+
m === "none" && "flex-none",
|
|
48
|
+
n === "screen" && "min-h-screen",
|
|
49
|
+
n === "full" && "min-h-full",
|
|
50
|
+
n === "fit" && "min-h-fit",
|
|
51
|
+
n === "min" && "min-h-min",
|
|
52
|
+
n === "max" && "min-h-max",
|
|
53
|
+
o === "full" && "min-w-full",
|
|
54
|
+
o === "fit" && "min-w-fit",
|
|
55
|
+
o === "min" && "min-w-min",
|
|
56
|
+
o === "max" && "min-w-max",
|
|
56
57
|
x
|
|
57
|
-
].filter(Boolean).join(" "),
|
|
58
|
-
...
|
|
59
|
-
...
|
|
58
|
+
].filter(Boolean).join(" "), v = {
|
|
59
|
+
...i,
|
|
60
|
+
...t ? { gap: `${e}px` } : {}
|
|
60
61
|
};
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ d("div", { className: p, style: v, "data-testid": u, ...w, children: c });
|
|
62
63
|
};
|
|
63
64
|
export {
|
|
64
65
|
y as Flex
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse'\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n flex?: '1' | 'auto' | 'initial' | 'none'\n inline?: boolean\n minHeight?: 'screen' | 'full' | 'fit' | 'min' | 'max'\n minWidth?: 'full' | 'fit' | 'min' | 'max'\n children?: React.ReactNode\n}\n\nexport const Flex: React.FC<FlexProps> = ({\n direction,\n justify,\n align,\n wrap,\n gap,\n flex,\n inline = false,\n minHeight,\n minWidth,\n className = '',\n style,\n children,\n ...rest\n}) => {\n const isNumericGap = typeof gap === 'number'\n\n const classes = [\n inline ? 'inline-flex' : 'flex',\n direction === 'row' && 'flex-row',\n direction === 'column' && 'flex-col',\n direction === 'row-reverse' && 'flex-row-reverse',\n direction === 'column-reverse' && 'flex-col-reverse',\n justify === 'start' && 'justify-start',\n justify === 'end' && 'justify-end',\n justify === 'center' && 'justify-center',\n justify === 'between' && 'justify-between',\n justify === 'around' && 'justify-around',\n justify === 'evenly' && 'justify-evenly',\n align === 'start' && 'items-start',\n align === 'end' && 'items-end',\n align === 'center' && 'items-center',\n align === 'baseline' && 'items-baseline',\n align === 'stretch' && 'items-stretch',\n wrap === true && 'flex-wrap',\n wrap === 'wrap' && 'flex-wrap',\n wrap === 'nowrap' && 'flex-nowrap',\n wrap === 'wrap-reverse' && 'flex-wrap-reverse',\n !isNumericGap && gap === 'xs' && 'gap-1',\n !isNumericGap && gap === 'sm' && 'gap-2',\n !isNumericGap && gap === 'md' && 'gap-4',\n !isNumericGap && gap === 'lg' && 'gap-6',\n !isNumericGap && gap === 'xl' && 'gap-8',\n flex === '1' && 'flex-1',\n flex === 'auto' && 'flex-auto',\n flex === 'initial' && 'flex-initial',\n flex === 'none' && 'flex-none',\n minHeight === 'screen' && 'min-h-screen',\n minHeight === 'full' && 'min-h-full',\n minHeight === 'fit' && 'min-h-fit',\n minHeight === 'min' && 'min-h-min',\n minHeight === 'max' && 'min-h-max',\n minWidth === 'full' && 'min-w-full',\n minWidth === 'fit' && 'min-w-fit',\n minWidth === 'min' && 'min-w-min',\n minWidth === 'max' && 'min-w-max',\n className,\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericGap ? { gap: `${gap}px` } : {}),\n }\n\n return (\n <div className={classes} style={combinedStyle} {...rest}>\n {children}\n </div>\n )\n}\n"],"names":["Flex","direction","justify","align","wrap","gap","flex","inline","minHeight","minWidth","className","style","children","rest","isNumericGap","classes","combinedStyle","jsx"],"mappings":";
|
|
1
|
+
{"version":3,"file":"Flex.js","sources":["../../src/components/Flex.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {\n direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'\n align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'\n wrap?: boolean | 'wrap' | 'nowrap' | 'wrap-reverse'\n gap?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number\n flex?: '1' | 'auto' | 'initial' | 'none'\n inline?: boolean\n minHeight?: 'screen' | 'full' | 'fit' | 'min' | 'max'\n minWidth?: 'full' | 'fit' | 'min' | 'max'\n children?: React.ReactNode\n 'data-testid'?: string\n}\n\nexport const Flex: React.FC<FlexProps> = ({\n direction,\n justify,\n align,\n wrap,\n gap,\n flex,\n inline = false,\n minHeight,\n minWidth,\n className = '',\n style,\n children,\n 'data-testid': testId,\n ...rest\n}) => {\n const isNumericGap = typeof gap === 'number'\n\n const classes = [\n inline ? 'inline-flex' : 'flex',\n direction === 'row' && 'flex-row',\n direction === 'column' && 'flex-col',\n direction === 'row-reverse' && 'flex-row-reverse',\n direction === 'column-reverse' && 'flex-col-reverse',\n justify === 'start' && 'justify-start',\n justify === 'end' && 'justify-end',\n justify === 'center' && 'justify-center',\n justify === 'between' && 'justify-between',\n justify === 'around' && 'justify-around',\n justify === 'evenly' && 'justify-evenly',\n align === 'start' && 'items-start',\n align === 'end' && 'items-end',\n align === 'center' && 'items-center',\n align === 'baseline' && 'items-baseline',\n align === 'stretch' && 'items-stretch',\n wrap === true && 'flex-wrap',\n wrap === 'wrap' && 'flex-wrap',\n wrap === 'nowrap' && 'flex-nowrap',\n wrap === 'wrap-reverse' && 'flex-wrap-reverse',\n !isNumericGap && gap === 'xs' && 'gap-1',\n !isNumericGap && gap === 'sm' && 'gap-2',\n !isNumericGap && gap === 'md' && 'gap-4',\n !isNumericGap && gap === 'lg' && 'gap-6',\n !isNumericGap && gap === 'xl' && 'gap-8',\n flex === '1' && 'flex-1',\n flex === 'auto' && 'flex-auto',\n flex === 'initial' && 'flex-initial',\n flex === 'none' && 'flex-none',\n minHeight === 'screen' && 'min-h-screen',\n minHeight === 'full' && 'min-h-full',\n minHeight === 'fit' && 'min-h-fit',\n minHeight === 'min' && 'min-h-min',\n minHeight === 'max' && 'min-h-max',\n minWidth === 'full' && 'min-w-full',\n minWidth === 'fit' && 'min-w-fit',\n minWidth === 'min' && 'min-w-min',\n minWidth === 'max' && 'min-w-max',\n className,\n ].filter(Boolean).join(' ')\n\n const combinedStyle: React.CSSProperties = {\n ...style,\n ...(isNumericGap ? { gap: `${gap}px` } : {}),\n }\n\n return (\n <div className={classes} style={combinedStyle} data-testid={testId} {...rest}>\n {children}\n </div>\n )\n}\n"],"names":["Flex","direction","justify","align","wrap","gap","flex","inline","minHeight","minWidth","className","style","children","testId","rest","isNumericGap","classes","combinedStyle","jsx"],"mappings":";AAgBO,MAAMA,IAA4B,CAAC;AAAA,EACxC,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,KAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAeC;AAAA,EACf,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAe,OAAOV,KAAQ,UAE9BW,IAAU;AAAA,IACdT,IAAS,gBAAgB;AAAA,IACzBN,MAAc,SAAS;AAAA,IACvBA,MAAc,YAAY;AAAA,IAC1BA,MAAc,iBAAiB;AAAA,IAC/BA,MAAc,oBAAoB;AAAA,IAClCC,MAAY,WAAW;AAAA,IACvBA,MAAY,SAAS;AAAA,IACrBA,MAAY,YAAY;AAAA,IACxBA,MAAY,aAAa;AAAA,IACzBA,MAAY,YAAY;AAAA,IACxBA,MAAY,YAAY;AAAA,IACxBC,MAAU,WAAW;AAAA,IACrBA,MAAU,SAAS;AAAA,IACnBA,MAAU,YAAY;AAAA,IACtBA,MAAU,cAAc;AAAA,IACxBA,MAAU,aAAa;AAAA,IACvBC,MAAS,MAAQ;AAAA,IACjBA,MAAS,UAAU;AAAA,IACnBA,MAAS,YAAY;AAAA,IACrBA,MAAS,kBAAkB;AAAA,IAC3B,CAACW,KAAgBV,MAAQ,QAAQ;AAAA,IACjC,CAACU,KAAgBV,MAAQ,QAAQ;AAAA,IACjC,CAACU,KAAgBV,MAAQ,QAAQ;AAAA,IACjC,CAACU,KAAgBV,MAAQ,QAAQ;AAAA,IACjC,CAACU,KAAgBV,MAAQ,QAAQ;AAAA,IACjCC,MAAS,OAAO;AAAA,IAChBA,MAAS,UAAU;AAAA,IACnBA,MAAS,aAAa;AAAA,IACtBA,MAAS,UAAU;AAAA,IACnBE,MAAc,YAAY;AAAA,IAC1BA,MAAc,UAAU;AAAA,IACxBA,MAAc,SAAS;AAAA,IACvBA,MAAc,SAAS;AAAA,IACvBA,MAAc,SAAS;AAAA,IACvBC,MAAa,UAAU;AAAA,IACvBA,MAAa,SAAS;AAAA,IACtBA,MAAa,SAAS;AAAA,IACtBA,MAAa,SAAS;AAAA,IACtBC;AAAA,EAAA,EACA,OAAO,OAAO,EAAE,KAAK,GAAG,GAEpBO,IAAqC;AAAA,IACzC,GAAGN;AAAA,IACH,GAAII,IAAe,EAAE,KAAK,GAAGV,CAAG,SAAS,CAAA;AAAA,EAAC;AAG5C,SACE,gBAAAa,EAAC,OAAA,EAAI,WAAWF,GAAS,OAAOC,GAAe,eAAaJ,GAAS,GAAGC,GACrE,UAAAF,EAAA,CACH;AAEJ;"}
|
|
@@ -20,6 +20,7 @@ export interface FloatButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLBu
|
|
|
20
20
|
target?: string;
|
|
21
21
|
/** @deprecated Use icon prop instead */
|
|
22
22
|
children?: React.ReactNode;
|
|
23
|
+
'data-testid'?: string;
|
|
23
24
|
}
|
|
24
25
|
export interface FloatButtonGroupProps {
|
|
25
26
|
/** Child FloatButton components */
|
|
@@ -52,6 +53,7 @@ export interface FloatButtonGroupProps {
|
|
|
52
53
|
className?: string;
|
|
53
54
|
/** Custom styles */
|
|
54
55
|
style?: React.CSSProperties;
|
|
56
|
+
'data-testid'?: string;
|
|
55
57
|
}
|
|
56
58
|
export interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'> {
|
|
57
59
|
/** Scroll threshold to show button (pixels) */
|
|
@@ -70,6 +72,7 @@ export interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButton
|
|
|
70
72
|
offset?: number;
|
|
71
73
|
/** @deprecated Use icon prop instead */
|
|
72
74
|
children?: React.ReactNode;
|
|
75
|
+
'data-testid'?: string;
|
|
73
76
|
}
|
|
74
77
|
interface FloatButtonComponent extends React.FC<FloatButtonProps> {
|
|
75
78
|
Group: React.FC<FloatButtonGroupProps>;
|
|
@@ -1,211 +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
17
|
onClick: n,
|
|
18
|
-
type:
|
|
19
|
-
shape:
|
|
20
|
-
className:
|
|
18
|
+
type: v = "default",
|
|
19
|
+
shape: w = "circle",
|
|
20
|
+
className: B = "",
|
|
21
21
|
tooltip: r,
|
|
22
|
-
tooltipPlacement:
|
|
23
|
-
badge:
|
|
24
|
-
href:
|
|
25
|
-
target:
|
|
26
|
-
children:
|
|
22
|
+
tooltipPlacement: N = "left",
|
|
23
|
+
badge: h,
|
|
24
|
+
href: a,
|
|
25
|
+
target: u,
|
|
26
|
+
children: g,
|
|
27
27
|
style: c,
|
|
28
|
+
"data-testid": e,
|
|
28
29
|
...s
|
|
29
30
|
}) => {
|
|
30
|
-
const
|
|
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(" "),
|
|
38
|
-
|
|
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: [
|
|
39
|
+
b,
|
|
39
40
|
/* @__PURE__ */ t("span", { className: "text-xs mt-1", children: l })
|
|
40
|
-
] }) :
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
41
|
+
] }) : b });
|
|
42
|
+
if (p.inGroup)
|
|
43
|
+
return a ? /* @__PURE__ */ t(
|
|
43
44
|
"a",
|
|
44
45
|
{
|
|
45
|
-
href:
|
|
46
|
-
target:
|
|
46
|
+
href: a,
|
|
47
|
+
target: u,
|
|
47
48
|
className: o,
|
|
48
49
|
title: r,
|
|
49
50
|
onClick: n,
|
|
51
|
+
"data-testid": e,
|
|
50
52
|
...s,
|
|
51
|
-
children:
|
|
53
|
+
children: i
|
|
52
54
|
}
|
|
53
|
-
) : /* @__PURE__ */ t("button", { className: o, title: r, onClick: n, ...s, children:
|
|
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
|
+
href: a,
|
|
60
|
+
target: u,
|
|
59
61
|
className: o,
|
|
60
62
|
style: c,
|
|
61
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: o, onClick: n, ...s, children: a }) : /* @__PURE__ */ t("button", { className: o, onClick: n, ...s, children: a })
|
|
68
|
-
] }) : E;
|
|
69
|
-
return r ? /* @__PURE__ */ t("div", { className: `${V} ${ot[B]}`, "data-tip": r, style: c, children: u !== void 0 ? /* @__PURE__ */ g("div", { className: y, children: [
|
|
70
|
-
/* @__PURE__ */ t("span", { className: `${T} ${$} ${L}`, children: u }),
|
|
71
|
-
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: o, onClick: n, ...s, children: a }) : /* @__PURE__ */ t("button", { className: o, onClick: n, ...s, children: a })
|
|
72
|
-
] }) : e ? /* @__PURE__ */ t("a", { href: e, target: i, className: o, onClick: n, ...s, children: a }) : /* @__PURE__ */ t("button", { className: o, onClick: n, ...s, children: a }) }) : P;
|
|
73
|
-
}, W = (d) => {
|
|
117
|
+
) : A;
|
|
118
|
+
}, q = (m) => {
|
|
74
119
|
const {
|
|
75
120
|
style: l,
|
|
76
121
|
...n
|
|
77
|
-
} =
|
|
78
|
-
if (
|
|
79
|
-
return /* @__PURE__ */ t(
|
|
80
|
-
const
|
|
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
136
|
shape: n = "circle",
|
|
92
|
-
icon:
|
|
93
|
-
triggerLabel:
|
|
94
|
-
mainAction:
|
|
137
|
+
icon: v,
|
|
138
|
+
triggerLabel: w = "Open menu",
|
|
139
|
+
mainAction: B,
|
|
95
140
|
mainActionLabel: r,
|
|
96
|
-
onMainAction:
|
|
97
|
-
showClose:
|
|
98
|
-
closeLabel:
|
|
99
|
-
type:
|
|
100
|
-
position:
|
|
141
|
+
onMainAction: N,
|
|
142
|
+
showClose: h = !1,
|
|
143
|
+
closeLabel: a = "Close menu",
|
|
144
|
+
type: u = "default",
|
|
145
|
+
position: g = "bottom-right",
|
|
101
146
|
offset: c = 24,
|
|
102
|
-
className:
|
|
103
|
-
style:
|
|
147
|
+
className: e = "",
|
|
148
|
+
style: s,
|
|
149
|
+
"data-testid": p
|
|
104
150
|
}) => {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
l ?
|
|
108
|
-
|
|
151
|
+
const f = [
|
|
152
|
+
_,
|
|
153
|
+
l ? I : "",
|
|
154
|
+
e
|
|
109
155
|
].filter(Boolean).join(" "), o = [
|
|
110
|
-
|
|
111
|
-
|
|
156
|
+
T,
|
|
157
|
+
$,
|
|
112
158
|
"shadow-lg",
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
].filter(Boolean).join(" "),
|
|
116
|
-
...
|
|
117
|
-
...
|
|
118
|
-
...
|
|
119
|
-
};
|
|
120
|
-
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: [
|
|
121
167
|
/* @__PURE__ */ t(
|
|
122
168
|
"button",
|
|
123
169
|
{
|
|
124
170
|
type: "button",
|
|
125
171
|
className: o,
|
|
126
|
-
"aria-label":
|
|
172
|
+
"aria-label": w,
|
|
127
173
|
"aria-haspopup": "true",
|
|
128
|
-
|
|
174
|
+
"data-testid": d("trigger"),
|
|
175
|
+
children: v || /* @__PURE__ */ t(W, {})
|
|
129
176
|
}
|
|
130
177
|
),
|
|
131
|
-
|
|
178
|
+
B && /* @__PURE__ */ t(
|
|
132
179
|
"button",
|
|
133
180
|
{
|
|
134
181
|
type: "button",
|
|
135
|
-
className: `${o} ${
|
|
136
|
-
onClick:
|
|
182
|
+
className: `${o} ${tt}`,
|
|
183
|
+
onClick: N,
|
|
137
184
|
"aria-label": r,
|
|
138
|
-
|
|
185
|
+
"data-testid": d("main-action"),
|
|
186
|
+
children: B
|
|
139
187
|
}
|
|
140
188
|
),
|
|
141
|
-
|
|
189
|
+
h && /* @__PURE__ */ t(
|
|
142
190
|
"button",
|
|
143
191
|
{
|
|
144
192
|
type: "button",
|
|
145
|
-
className: `${o} ${
|
|
146
|
-
"aria-label":
|
|
147
|
-
|
|
193
|
+
className: `${o} ${ot}`,
|
|
194
|
+
"aria-label": a,
|
|
195
|
+
"data-testid": d("close"),
|
|
196
|
+
children: /* @__PURE__ */ t(et, {})
|
|
148
197
|
}
|
|
149
198
|
),
|
|
150
|
-
/* @__PURE__ */ t(C.Provider, { value: { inGroup: !0, shape: n }, children:
|
|
199
|
+
/* @__PURE__ */ t(C.Provider, { value: { inGroup: !0, shape: n }, children: m })
|
|
151
200
|
] });
|
|
152
|
-
},
|
|
153
|
-
visibilityHeight:
|
|
201
|
+
}, lt = ({
|
|
202
|
+
visibilityHeight: m = 400,
|
|
154
203
|
target: l,
|
|
155
204
|
onClick: n,
|
|
156
|
-
icon:
|
|
157
|
-
duration:
|
|
158
|
-
position:
|
|
205
|
+
icon: v,
|
|
206
|
+
duration: w = 450,
|
|
207
|
+
position: B = "bottom-right",
|
|
159
208
|
offset: r = 24,
|
|
160
|
-
className:
|
|
161
|
-
children:
|
|
162
|
-
style:
|
|
163
|
-
|
|
209
|
+
className: N = "",
|
|
210
|
+
children: h,
|
|
211
|
+
style: a,
|
|
212
|
+
"data-testid": u,
|
|
213
|
+
...g
|
|
164
214
|
}) => {
|
|
165
|
-
const [
|
|
166
|
-
|
|
167
|
-
const o = l ? l() : window,
|
|
168
|
-
const
|
|
169
|
-
|
|
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);
|
|
170
220
|
};
|
|
171
|
-
return o.addEventListener("scroll",
|
|
172
|
-
}, [l,
|
|
221
|
+
return o.addEventListener("scroll", b), b(), () => o.removeEventListener("scroll", b);
|
|
222
|
+
}, [l, m]);
|
|
173
223
|
const s = () => {
|
|
174
224
|
n?.();
|
|
175
225
|
const o = l ? l() : window;
|
|
176
226
|
o instanceof Window ? window.scrollTo({ top: 0, behavior: "smooth" }) : o.scrollTo({ top: 0, behavior: "smooth" });
|
|
177
227
|
};
|
|
178
|
-
if (!
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
228
|
+
if (!c) return null;
|
|
229
|
+
const p = [
|
|
230
|
+
T,
|
|
231
|
+
$,
|
|
232
|
+
S,
|
|
233
|
+
M,
|
|
184
234
|
"shadow-lg",
|
|
185
235
|
"transition-opacity",
|
|
186
|
-
|
|
187
|
-
].filter(Boolean).join(" "),
|
|
236
|
+
N
|
|
237
|
+
].filter(Boolean).join(" "), f = {
|
|
188
238
|
position: "fixed",
|
|
189
239
|
zIndex: 1e3,
|
|
190
240
|
bottom: r,
|
|
191
|
-
...
|
|
192
|
-
...
|
|
241
|
+
...B.includes("right") ? { right: r } : { left: r },
|
|
242
|
+
...a
|
|
193
243
|
};
|
|
194
244
|
return /* @__PURE__ */ t(
|
|
195
245
|
"button",
|
|
196
246
|
{
|
|
197
|
-
className:
|
|
247
|
+
className: p,
|
|
198
248
|
onClick: s,
|
|
199
|
-
style:
|
|
200
|
-
"aria-label":
|
|
201
|
-
|
|
202
|
-
|
|
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, {})
|
|
203
254
|
}
|
|
204
255
|
);
|
|
205
256
|
};
|
|
206
|
-
|
|
207
|
-
|
|
257
|
+
q.Group = st;
|
|
258
|
+
q.BackTop = lt;
|
|
208
259
|
export {
|
|
209
|
-
|
|
260
|
+
q as FloatButton
|
|
210
261
|
};
|
|
211
262
|
//# sourceMappingURL=FloatButton.js.map
|