asterui 0.12.62 → 0.12.64

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.
Files changed (127) hide show
  1. package/dist/components/Anchor.d.ts +2 -0
  2. package/dist/components/Anchor.js +79 -75
  3. package/dist/components/Anchor.js.map +1 -1
  4. package/dist/components/Autocomplete.d.ts +1 -0
  5. package/dist/components/Autocomplete.js +115 -110
  6. package/dist/components/Autocomplete.js.map +1 -1
  7. package/dist/components/Breadcrumb.d.ts +4 -2
  8. package/dist/components/Breadcrumb.js +54 -29
  9. package/dist/components/Breadcrumb.js.map +1 -1
  10. package/dist/components/Button.d.ts +5 -1
  11. package/dist/components/Button.js +117 -107
  12. package/dist/components/Button.js.map +1 -1
  13. package/dist/components/Chart.d.ts +1 -0
  14. package/dist/components/Chart.js +31 -30
  15. package/dist/components/Chart.js.map +1 -1
  16. package/dist/components/Chat.d.ts +1 -0
  17. package/dist/components/Chat.js +32 -30
  18. package/dist/components/Chat.js.map +1 -1
  19. package/dist/components/Collapse.js +58 -56
  20. package/dist/components/Collapse.js.map +1 -1
  21. package/dist/components/Command.d.ts +5 -2
  22. package/dist/components/Command.js +262 -233
  23. package/dist/components/Command.js.map +1 -1
  24. package/dist/components/ContextMenu.d.ts +4 -0
  25. package/dist/components/ContextMenu.js +149 -130
  26. package/dist/components/ContextMenu.js.map +1 -1
  27. package/dist/components/DatePicker.d.ts +19 -1
  28. package/dist/components/DatePicker.js +266 -87
  29. package/dist/components/DatePicker.js.map +1 -1
  30. package/dist/components/Dock.d.ts +2 -0
  31. package/dist/components/Dock.js +70 -46
  32. package/dist/components/Dock.js.map +1 -1
  33. package/dist/components/FileInput.d.ts +1 -0
  34. package/dist/components/FileInput.js +26 -26
  35. package/dist/components/FileInput.js.map +1 -1
  36. package/dist/components/Filter.d.ts +1 -0
  37. package/dist/components/Filter.js +43 -40
  38. package/dist/components/Filter.js.map +1 -1
  39. package/dist/components/Flex.d.ts +1 -0
  40. package/dist/components/Flex.js +43 -42
  41. package/dist/components/Flex.js.map +1 -1
  42. package/dist/components/FloatButton.d.ts +3 -0
  43. package/dist/components/FloatButton.js +178 -127
  44. package/dist/components/FloatButton.js.map +1 -1
  45. package/dist/components/Input.d.ts +1 -0
  46. package/dist/components/Input.js +201 -184
  47. package/dist/components/Input.js.map +1 -1
  48. package/dist/components/Loading.d.ts +1 -0
  49. package/dist/components/Loading.js +40 -37
  50. package/dist/components/Loading.js.map +1 -1
  51. package/dist/components/Masonry.d.ts +1 -0
  52. package/dist/components/Masonry.js +45 -42
  53. package/dist/components/Masonry.js.map +1 -1
  54. package/dist/components/Mention.d.ts +1 -0
  55. package/dist/components/Mention.js +95 -91
  56. package/dist/components/Mention.js.map +1 -1
  57. package/dist/components/Menu.d.ts +1 -1
  58. package/dist/components/Menu.js +99 -93
  59. package/dist/components/Menu.js.map +1 -1
  60. package/dist/components/Modal.js +26 -17
  61. package/dist/components/Modal.js.map +1 -1
  62. package/dist/components/MonthCalendar.d.ts +1 -0
  63. package/dist/components/MonthCalendar.js +104 -97
  64. package/dist/components/MonthCalendar.js.map +1 -1
  65. package/dist/components/Notification.js +53 -45
  66. package/dist/components/Notification.js.map +1 -1
  67. package/dist/components/QRCode.d.ts +1 -0
  68. package/dist/components/QRCode.js +84 -55
  69. package/dist/components/QRCode.js.map +1 -1
  70. package/dist/components/RadialProgress.d.ts +1 -0
  71. package/dist/components/RadialProgress.js +19 -17
  72. package/dist/components/RadialProgress.js.map +1 -1
  73. package/dist/components/Range.d.ts +1 -0
  74. package/dist/components/Range.js +45 -43
  75. package/dist/components/Range.js.map +1 -1
  76. package/dist/components/Rating.d.ts +4 -2
  77. package/dist/components/Rating.js +83 -79
  78. package/dist/components/Rating.js.map +1 -1
  79. package/dist/components/Responsive.d.ts +4 -2
  80. package/dist/components/Responsive.js +10 -9
  81. package/dist/components/Responsive.js.map +1 -1
  82. package/dist/components/Result.d.ts +1 -0
  83. package/dist/components/Result.js +24 -22
  84. package/dist/components/Result.js.map +1 -1
  85. package/dist/components/Select.d.ts +1 -0
  86. package/dist/components/Select.js +72 -62
  87. package/dist/components/Select.js.map +1 -1
  88. package/dist/components/Splitter.d.ts +2 -0
  89. package/dist/components/Splitter.js +137 -131
  90. package/dist/components/Splitter.js.map +1 -1
  91. package/dist/components/Stat.d.ts +4 -2
  92. package/dist/components/Stat.js +19 -18
  93. package/dist/components/Stat.js.map +1 -1
  94. package/dist/components/Steps.d.ts +4 -2
  95. package/dist/components/Steps.js +56 -52
  96. package/dist/components/Steps.js.map +1 -1
  97. package/dist/components/Tabs.js +69 -57
  98. package/dist/components/Tabs.js.map +1 -1
  99. package/dist/components/TextRotate.d.ts +1 -0
  100. package/dist/components/TextRotate.js +14 -12
  101. package/dist/components/TextRotate.js.map +1 -1
  102. package/dist/components/Textarea.d.ts +1 -0
  103. package/dist/components/Textarea.js +31 -30
  104. package/dist/components/Textarea.js.map +1 -1
  105. package/dist/components/ThemeController.d.ts +6 -3
  106. package/dist/components/ThemeController.js +101 -92
  107. package/dist/components/ThemeController.js.map +1 -1
  108. package/dist/components/Tooltip.js +38 -35
  109. package/dist/components/Tooltip.js.map +1 -1
  110. package/dist/components/Transfer.js +130 -121
  111. package/dist/components/Transfer.js.map +1 -1
  112. package/dist/components/TreeSelect.js +49 -48
  113. package/dist/components/TreeSelect.js.map +1 -1
  114. package/dist/components/Typography.d.ts +10 -5
  115. package/dist/components/Typography.js +84 -81
  116. package/dist/components/Typography.js.map +1 -1
  117. package/dist/components/VirtualList.d.ts +2 -1
  118. package/dist/components/VirtualList.js +40 -36
  119. package/dist/components/VirtualList.js.map +1 -1
  120. package/dist/components/Watermark.d.ts +1 -0
  121. package/dist/components/Watermark.js +74 -71
  122. package/dist/components/Watermark.js.map +1 -1
  123. package/dist/components/WeekCalendar.d.ts +1 -0
  124. package/dist/components/WeekCalendar.js +91 -76
  125. package/dist/components/WeekCalendar.js.map +1 -1
  126. package/dist/index.d.ts +1 -1
  127. package/package.json +1 -1
@@ -1,25 +1,26 @@
1
- import { jsx as v } from "react/jsx-runtime";
1
+ import { jsx as d } from "react/jsx-runtime";
2
2
  const y = ({
3
- direction: t,
3
+ direction: l,
4
4
  justify: r,
5
5
  align: s,
6
- wrap: m,
6
+ wrap: a,
7
7
  gap: e,
8
- flex: o,
9
- inline: a = !1,
10
- minHeight: l,
11
- minWidth: f,
8
+ flex: m,
9
+ inline: f = !1,
10
+ minHeight: n,
11
+ minWidth: o,
12
12
  className: x = "",
13
- style: c,
14
- children: i,
15
- ...u
13
+ style: i,
14
+ children: c,
15
+ "data-testid": u,
16
+ ...w
16
17
  }) => {
17
- const n = typeof e == "number", w = [
18
- a ? "inline-flex" : "flex",
19
- t === "row" && "flex-row",
20
- t === "column" && "flex-col",
21
- t === "row-reverse" && "flex-row-reverse",
22
- t === "column-reverse" && "flex-col-reverse",
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
- m === !0 && "flex-wrap",
35
- m === "wrap" && "flex-wrap",
36
- m === "nowrap" && "flex-nowrap",
37
- m === "wrap-reverse" && "flex-wrap-reverse",
38
- !n && e === "xs" && "gap-1",
39
- !n && e === "sm" && "gap-2",
40
- !n && e === "md" && "gap-4",
41
- !n && e === "lg" && "gap-6",
42
- !n && e === "xl" && "gap-8",
43
- o === "1" && "flex-1",
44
- o === "auto" && "flex-auto",
45
- o === "initial" && "flex-initial",
46
- o === "none" && "flex-none",
47
- l === "screen" && "min-h-screen",
48
- l === "full" && "min-h-full",
49
- l === "fit" && "min-h-fit",
50
- l === "min" && "min-h-min",
51
- l === "max" && "min-h-max",
52
- f === "full" && "min-w-full",
53
- f === "fit" && "min-w-fit",
54
- f === "min" && "min-w-min",
55
- f === "max" && "min-w-max",
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(" "), p = {
58
- ...c,
59
- ...n ? { gap: `${e}px` } : {}
58
+ ].filter(Boolean).join(" "), v = {
59
+ ...i,
60
+ ...t ? { gap: `${e}px` } : {}
60
61
  };
61
- return /* @__PURE__ */ v("div", { className: w, style: p, ...u, children: i });
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":";AAeO,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,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAe,OAAOT,KAAQ,UAE9BU,IAAU;AAAA,IACdR,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,CAACU,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,MAAQ,QAAQ;AAAA,IACjC,CAACS,KAAgBT,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,GAEpBM,IAAqC;AAAA,IACzC,GAAGL;AAAA,IACH,GAAIG,IAAe,EAAE,KAAK,GAAGT,CAAG,SAAS,CAAA;AAAA,EAAC;AAG5C,SACE,gBAAAY,EAAC,SAAI,WAAWF,GAAS,OAAOC,GAAgB,GAAGH,GAChD,UAAAD,GACH;AAEJ;"}
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 g, Fragment as q } from "react/jsx-runtime";
2
- import { useContext as j, createContext as z, useState as A, useEffect as O } from "react";
3
- const f = "btn", x = "btn-lg", k = "btn-circle", R = "btn-square", G = "btn-neutral", U = "btn-primary", V = "tooltip", Y = "tooltip-left", D = "tooltip-right", H = "tooltip-top", J = "tooltip-bottom", y = "indicator", T = "indicator-item", $ = "badge", L = "badge-secondary", K = "fab", Q = "fab-flower", X = "fab-main-action", Z = "fab-close", I = () => /* @__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: Y,
5
- right: D,
6
- top: H,
7
- bottom: J
8
- }, S = {
9
- default: G,
10
- primary: U
11
- }, M = {
12
- circle: k,
13
- square: R
14
- }, F = ({
15
- icon: d,
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: b = "default",
19
- shape: m = "circle",
20
- className: w = "",
18
+ type: v = "default",
19
+ shape: w = "circle",
20
+ className: B = "",
21
21
  tooltip: r,
22
- tooltipPlacement: B = "left",
23
- badge: u,
24
- href: e,
25
- target: i,
26
- children: v,
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 h = j(C), N = h.inGroup && h.shape || m, o = [
31
- f,
32
- x,
31
+ const p = G(C), f = p.inGroup && p.shape || w, o = [
32
+ T,
33
+ $,
33
34
  "shadow-lg",
34
- M[N],
35
- S[b],
36
- w
37
- ].filter(Boolean).join(" "), p = d || v || /* @__PURE__ */ t(I, {}), a = /* @__PURE__ */ t(q, { children: l ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center", children: [
38
- p,
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
- ] }) : p });
41
- if (h.inGroup)
42
- return e ? /* @__PURE__ */ t(
41
+ ] }) : b });
42
+ if (p.inGroup)
43
+ return a ? /* @__PURE__ */ t(
43
44
  "a",
44
45
  {
45
- href: e,
46
- target: i,
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: a
53
+ children: i
52
54
  }
53
- ) : /* @__PURE__ */ t("button", { className: o, title: r, onClick: n, ...s, children: a });
54
- const E = e ? /* @__PURE__ */ t(
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: e,
58
- target: i,
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: a
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
- ) : /* @__PURE__ */ t("button", { className: o, onClick: n, style: c, ...s, children: a }), P = u !== void 0 ? /* @__PURE__ */ g("div", { className: y, style: c, children: [
66
- /* @__PURE__ */ t("span", { className: `${T} ${$} ${L}`, children: u }),
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
- } = d;
78
- if (j(C).inGroup)
79
- return /* @__PURE__ */ t(F, { ...n });
80
- const m = {
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(F, { ...n, style: m });
88
- }, nt = ({
89
- children: d,
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: b,
93
- triggerLabel: m = "Open menu",
94
- mainAction: w,
137
+ icon: v,
138
+ triggerLabel: w = "Open menu",
139
+ mainAction: B,
95
140
  mainActionLabel: r,
96
- onMainAction: B,
97
- showClose: u = !1,
98
- closeLabel: e = "Close menu",
99
- type: i = "default",
100
- position: v = "bottom-right",
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: s = "",
103
- style: h
147
+ className: e = "",
148
+ style: s,
149
+ "data-testid": p
104
150
  }) => {
105
- const N = [
106
- K,
107
- l ? Q : "",
108
- s
151
+ const f = [
152
+ _,
153
+ l ? I : "",
154
+ e
109
155
  ].filter(Boolean).join(" "), o = [
110
- f,
111
- x,
156
+ T,
157
+ $,
112
158
  "shadow-lg",
113
- M[n],
114
- S[i]
115
- ].filter(Boolean).join(" "), p = {
116
- ...v.includes("bottom") ? { bottom: c } : { top: c },
117
- ...v.includes("right") ? { right: c } : { left: c },
118
- ...h
119
- };
120
- return /* @__PURE__ */ g("div", { className: N, style: p, children: [
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": m,
172
+ "aria-label": w,
127
173
  "aria-haspopup": "true",
128
- children: b || /* @__PURE__ */ t(I, {})
174
+ "data-testid": d("trigger"),
175
+ children: v || /* @__PURE__ */ t(W, {})
129
176
  }
130
177
  ),
131
- w && /* @__PURE__ */ t(
178
+ B && /* @__PURE__ */ t(
132
179
  "button",
133
180
  {
134
181
  type: "button",
135
- className: `${o} ${X}`,
136
- onClick: B,
182
+ className: `${o} ${tt}`,
183
+ onClick: N,
137
184
  "aria-label": r,
138
- children: w
185
+ "data-testid": d("main-action"),
186
+ children: B
139
187
  }
140
188
  ),
141
- u && /* @__PURE__ */ t(
189
+ h && /* @__PURE__ */ t(
142
190
  "button",
143
191
  {
144
192
  type: "button",
145
- className: `${o} ${Z}`,
146
- "aria-label": e,
147
- children: /* @__PURE__ */ t(tt, {})
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: d })
199
+ /* @__PURE__ */ t(C.Provider, { value: { inGroup: !0, shape: n }, children: m })
151
200
  ] });
152
- }, et = ({
153
- visibilityHeight: d = 400,
201
+ }, lt = ({
202
+ visibilityHeight: m = 400,
154
203
  target: l,
155
204
  onClick: n,
156
- icon: b,
157
- duration: m = 450,
158
- position: w = "bottom-right",
205
+ icon: v,
206
+ duration: w = 450,
207
+ position: B = "bottom-right",
159
208
  offset: r = 24,
160
- className: B = "",
161
- children: u,
162
- style: e,
163
- ...i
209
+ className: N = "",
210
+ children: h,
211
+ style: a,
212
+ "data-testid": u,
213
+ ...g
164
214
  }) => {
165
- const [v, c] = A(!1);
166
- O(() => {
167
- const o = l ? l() : window, p = () => {
168
- const a = o instanceof Window ? window.scrollY : o.scrollTop;
169
- c(a >= d);
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", p), p(), () => o.removeEventListener("scroll", p);
172
- }, [l, d]);
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 (!v) return null;
179
- const h = [
180
- f,
181
- x,
182
- k,
183
- G,
228
+ if (!c) return null;
229
+ const p = [
230
+ T,
231
+ $,
232
+ S,
233
+ M,
184
234
  "shadow-lg",
185
235
  "transition-opacity",
186
- B
187
- ].filter(Boolean).join(" "), N = {
236
+ N
237
+ ].filter(Boolean).join(" "), f = {
188
238
  position: "fixed",
189
239
  zIndex: 1e3,
190
240
  bottom: r,
191
- ...w.includes("right") ? { right: r } : { left: r },
192
- ...e
241
+ ...B.includes("right") ? { right: r } : { left: r },
242
+ ...a
193
243
  };
194
244
  return /* @__PURE__ */ t(
195
245
  "button",
196
246
  {
197
- className: h,
247
+ className: p,
198
248
  onClick: s,
199
- style: N,
200
- "aria-label": i["aria-label"] || "Back to top",
201
- ...i,
202
- children: b || u || /* @__PURE__ */ t(_, {})
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
- W.Group = nt;
207
- W.BackTop = et;
257
+ q.Group = st;
258
+ q.BackTop = lt;
208
259
  export {
209
- W as FloatButton
260
+ q as FloatButton
210
261
  };
211
262
  //# sourceMappingURL=FloatButton.js.map