asterui 0.12.61 → 0.12.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Affix.d.ts +2 -0
- package/dist/components/Affix.js.map +1 -1
- package/dist/components/Alert.d.ts +2 -0
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/Anchor.d.ts +2 -0
- package/dist/components/Anchor.js +79 -75
- package/dist/components/Anchor.js.map +1 -1
- package/dist/components/Autocomplete.d.ts +1 -0
- package/dist/components/Autocomplete.js +115 -110
- package/dist/components/Autocomplete.js.map +1 -1
- package/dist/components/Avatar.d.ts +4 -0
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Breadcrumb.d.ts +4 -2
- package/dist/components/Breadcrumb.js +54 -29
- package/dist/components/Breadcrumb.js.map +1 -1
- package/dist/components/Browser.d.ts +2 -0
- package/dist/components/Browser.js.map +1 -1
- package/dist/components/Button.d.ts +5 -1
- package/dist/components/Button.js +117 -107
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Chart.d.ts +1 -0
- package/dist/components/Chart.js +31 -30
- package/dist/components/Chart.js.map +1 -1
- package/dist/components/Chat.d.ts +1 -0
- package/dist/components/Chat.js +39 -28
- package/dist/components/Chat.js.map +1 -1
- package/dist/components/Code.d.ts +2 -0
- package/dist/components/Code.js.map +1 -1
- package/dist/components/Command.d.ts +5 -2
- package/dist/components/Command.js +262 -233
- package/dist/components/Command.js.map +1 -1
- package/dist/components/Container.d.ts +2 -0
- package/dist/components/Container.js.map +1 -1
- package/dist/components/ContextMenu.d.ts +4 -0
- package/dist/components/ContextMenu.js +157 -122
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/CopyButton.d.ts +2 -0
- package/dist/components/CopyButton.js +9 -8
- package/dist/components/CopyButton.js.map +1 -1
- package/dist/components/Countdown.d.ts +3 -3
- package/dist/components/Countdown.js +49 -47
- package/dist/components/Countdown.js.map +1 -1
- package/dist/components/Diff.d.ts +3 -3
- package/dist/components/Diff.js +14 -10
- package/dist/components/Diff.js.map +1 -1
- package/dist/components/Divider.d.ts +2 -0
- package/dist/components/Divider.js.map +1 -1
- package/dist/components/Dock.d.ts +6 -0
- package/dist/components/Dock.js +75 -38
- package/dist/components/Dock.js.map +1 -1
- package/dist/components/Dropdown.js +110 -110
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Fieldset.d.ts +2 -0
- package/dist/components/Fieldset.js.map +1 -1
- package/dist/components/FileInput.d.ts +1 -0
- package/dist/components/FileInput.js +26 -26
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Filter.d.ts +1 -0
- package/dist/components/Filter.js +43 -40
- package/dist/components/Filter.js.map +1 -1
- package/dist/components/Flex.d.ts +1 -0
- package/dist/components/Flex.js +43 -42
- package/dist/components/Flex.js.map +1 -1
- package/dist/components/FloatButton.d.ts +9 -0
- package/dist/components/FloatButton.js +211 -136
- package/dist/components/FloatButton.js.map +1 -1
- package/dist/components/Footer.d.ts +2 -0
- package/dist/components/Footer.js.map +1 -1
- package/dist/components/Grid.d.ts +4 -0
- package/dist/components/Grid.js.map +1 -1
- package/dist/components/Hero.d.ts +2 -0
- package/dist/components/Hero.js.map +1 -1
- package/dist/components/HoverGallery.d.ts +3 -3
- package/dist/components/HoverGallery.js +12 -10
- package/dist/components/HoverGallery.js.map +1 -1
- package/dist/components/Input.d.ts +1 -0
- package/dist/components/Input.js +201 -184
- package/dist/components/Input.js.map +1 -1
- package/dist/components/Join.d.ts +2 -0
- package/dist/components/Join.js.map +1 -1
- package/dist/components/Kbd.d.ts +2 -0
- package/dist/components/Kbd.js.map +1 -1
- package/dist/components/Loading.d.ts +3 -0
- package/dist/components/Loading.js +58 -35
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/Mask.d.ts +2 -2
- package/dist/components/Mask.js.map +1 -1
- package/dist/components/Masonry.d.ts +1 -0
- package/dist/components/Masonry.js +45 -42
- package/dist/components/Masonry.js.map +1 -1
- package/dist/components/Mention.d.ts +1 -0
- package/dist/components/Mention.js +95 -91
- package/dist/components/Mention.js.map +1 -1
- package/dist/components/MonthCalendar.d.ts +1 -0
- package/dist/components/MonthCalendar.js +104 -97
- package/dist/components/MonthCalendar.js.map +1 -1
- package/dist/components/Navbar.d.ts +2 -0
- package/dist/components/Navbar.js.map +1 -1
- package/dist/components/Notification.js +32 -18
- package/dist/components/Notification.js.map +1 -1
- package/dist/components/Phone.d.ts +3 -2
- package/dist/components/Phone.js +10 -8
- package/dist/components/Phone.js.map +1 -1
- package/dist/components/Popconfirm.js +110 -92
- package/dist/components/Popconfirm.js.map +1 -1
- package/dist/components/Popover.d.ts +2 -0
- package/dist/components/Popover.js.map +1 -1
- package/dist/components/Progress.d.ts +2 -0
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/QRCode.d.ts +1 -0
- package/dist/components/QRCode.js +84 -55
- package/dist/components/QRCode.js.map +1 -1
- package/dist/components/RadialProgress.d.ts +1 -0
- package/dist/components/RadialProgress.js +19 -17
- package/dist/components/RadialProgress.js.map +1 -1
- package/dist/components/Radio.d.ts +6 -3
- package/dist/components/Radio.js +9 -9
- package/dist/components/Radio.js.map +1 -1
- package/dist/components/Range.d.ts +1 -0
- package/dist/components/Range.js +45 -43
- package/dist/components/Range.js.map +1 -1
- package/dist/components/Rating.d.ts +4 -2
- package/dist/components/Rating.js +83 -79
- package/dist/components/Rating.js.map +1 -1
- package/dist/components/Responsive.d.ts +4 -2
- package/dist/components/Responsive.js +10 -9
- package/dist/components/Responsive.js.map +1 -1
- package/dist/components/Result.d.ts +1 -0
- package/dist/components/Result.js +24 -22
- package/dist/components/Result.js.map +1 -1
- package/dist/components/Select.d.ts +1 -0
- package/dist/components/Select.js +72 -62
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Skeleton.d.ts +2 -0
- package/dist/components/Skeleton.js.map +1 -1
- package/dist/components/Space.d.ts +2 -0
- package/dist/components/Space.js.map +1 -1
- package/dist/components/Splitter.d.ts +2 -0
- package/dist/components/Splitter.js +137 -131
- package/dist/components/Splitter.js.map +1 -1
- package/dist/components/Stat.d.ts +4 -2
- package/dist/components/Stat.js +19 -18
- package/dist/components/Stat.js.map +1 -1
- package/dist/components/Status.d.ts +3 -3
- package/dist/components/Status.js +27 -25
- package/dist/components/Status.js.map +1 -1
- package/dist/components/Steps.d.ts +4 -2
- package/dist/components/Steps.js +56 -52
- package/dist/components/Steps.js.map +1 -1
- package/dist/components/TextRotate.d.ts +1 -0
- package/dist/components/TextRotate.js +14 -12
- package/dist/components/TextRotate.js.map +1 -1
- package/dist/components/Textarea.d.ts +1 -0
- package/dist/components/Textarea.js +31 -30
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/ThemeController.d.ts +6 -3
- package/dist/components/ThemeController.js +101 -92
- package/dist/components/ThemeController.js.map +1 -1
- package/dist/components/Toggle.d.ts +2 -0
- package/dist/components/Toggle.js.map +1 -1
- package/dist/components/Tooltip.d.ts +2 -0
- package/dist/components/Tooltip.js +38 -32
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Typography.d.ts +10 -5
- package/dist/components/Typography.js +84 -81
- package/dist/components/Typography.js.map +1 -1
- package/dist/components/VirtualList.d.ts +2 -1
- package/dist/components/VirtualList.js +40 -36
- package/dist/components/VirtualList.js.map +1 -1
- package/dist/components/Watermark.d.ts +1 -0
- package/dist/components/Watermark.js +74 -71
- package/dist/components/Watermark.js.map +1 -1
- package/dist/components/WeekCalendar.d.ts +1 -0
- package/dist/components/WeekCalendar.js +91 -76
- package/dist/components/WeekCalendar.js.map +1 -1
- package/dist/components/Window.d.ts +3 -2
- package/dist/components/Window.js +9 -7
- package/dist/components/Window.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
const
|
|
5
|
-
({ size: i, color:
|
|
6
|
-
const { componentSize:
|
|
7
|
-
xs:
|
|
8
|
-
sm:
|
|
9
|
-
md:
|
|
10
|
-
lg:
|
|
11
|
-
xl:
|
|
12
|
-
},
|
|
13
|
-
neutral:
|
|
14
|
-
primary:
|
|
15
|
-
secondary:
|
|
16
|
-
accent:
|
|
17
|
-
info:
|
|
18
|
-
success:
|
|
19
|
-
warning:
|
|
20
|
-
error:
|
|
21
|
-
},
|
|
22
|
-
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { useConfig as F } from "../providers/ConfigProvider.js";
|
|
4
|
+
const g = "file-input", y = "file-input-xs", x = "file-input-sm", S = "file-input-md", w = "file-input-lg", C = "file-input-xl", z = "file-input-neutral", N = "file-input-primary", h = "file-input-secondary", j = "file-input-accent", X = "file-input-info", v = "file-input-success", A = "file-input-warning", B = "file-input-error", e = "file-input-ghost", E = m(
|
|
5
|
+
({ size: i, color: t, ghost: s = !1, bordered: l = !0, className: o = "", "data-testid": u, ...p }, c) => {
|
|
6
|
+
const { componentSize: r } = F(), n = i ?? r ?? "md", f = {
|
|
7
|
+
xs: y,
|
|
8
|
+
sm: x,
|
|
9
|
+
md: S,
|
|
10
|
+
lg: w,
|
|
11
|
+
xl: C
|
|
12
|
+
}, a = {
|
|
13
|
+
neutral: z,
|
|
14
|
+
primary: N,
|
|
15
|
+
secondary: h,
|
|
16
|
+
accent: j,
|
|
17
|
+
info: X,
|
|
18
|
+
success: v,
|
|
19
|
+
warning: A,
|
|
20
|
+
error: B
|
|
21
|
+
}, d = [
|
|
22
|
+
g,
|
|
23
23
|
"w-full",
|
|
24
24
|
// In DaisyUI 5, borders are on by default. Use ghost to remove them.
|
|
25
25
|
!l && e,
|
|
26
26
|
s && e,
|
|
27
|
-
t && r[t],
|
|
28
27
|
n && f[n],
|
|
28
|
+
t && a[t],
|
|
29
29
|
o
|
|
30
30
|
].filter(Boolean).join(" ");
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ I("input", { ref: c, type: "file", className: d, "data-testid": u, ...p });
|
|
32
32
|
}
|
|
33
33
|
);
|
|
34
|
-
|
|
34
|
+
E.displayName = "FileInput";
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
E as FileInput
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=FileInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.js","sources":["../../src/components/FileInput.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { useConfig } from '../providers/ConfigProvider'\n\n// DaisyUI classes\nconst dFileInput = 'file-input'\nconst dFileInputXs = 'file-input-xs'\nconst dFileInputSm = 'file-input-sm'\nconst dFileInputMd = 'file-input-md'\nconst dFileInputLg = 'file-input-lg'\nconst dFileInputXl = 'file-input-xl'\nconst dFileInputNeutral = 'file-input-neutral'\nconst dFileInputPrimary = 'file-input-primary'\nconst dFileInputSecondary = 'file-input-secondary'\nconst dFileInputAccent = 'file-input-accent'\nconst dFileInputInfo = 'file-input-info'\nconst dFileInputSuccess = 'file-input-success'\nconst dFileInputWarning = 'file-input-warning'\nconst dFileInputError = 'file-input-error'\nconst dFileInputGhost = 'file-input-ghost'\n\nexport interface FileInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n ghost?: boolean\n bordered?: boolean\n className?: string\n}\n\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(\n ({ size, color, ghost = false, bordered = true, className = '', ...props }, ref) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const sizeClasses = {\n xs: dFileInputXs,\n sm: dFileInputSm,\n md: dFileInputMd,\n lg: dFileInputLg,\n xl: dFileInputXl,\n }\n\n const colorClasses = {\n neutral: dFileInputNeutral,\n primary: dFileInputPrimary,\n secondary: dFileInputSecondary,\n accent: dFileInputAccent,\n info: dFileInputInfo,\n success: dFileInputSuccess,\n warning: dFileInputWarning,\n error: dFileInputError,\n }\n\n const fileInputClasses = [\n dFileInput,\n 'w-full',\n // In DaisyUI 5, borders are on by default. Use ghost to remove them.\n !bordered && dFileInputGhost,\n ghost && dFileInputGhost,\n effectiveSize && sizeClasses[effectiveSize],\n color && colorClasses[color],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <input ref={ref} type=\"file\" className={fileInputClasses} {...props} />\n }\n)\n\nFileInput.displayName = 'FileInput'\n"],"names":["dFileInput","dFileInputXs","dFileInputSm","dFileInputMd","dFileInputLg","dFileInputXl","dFileInputNeutral","dFileInputPrimary","dFileInputSecondary","dFileInputAccent","dFileInputInfo","dFileInputSuccess","dFileInputWarning","dFileInputError","dFileInputGhost","FileInput","forwardRef","size","color","ghost","bordered","className","props","ref","componentSize","useConfig","effectiveSize","sizeClasses","colorClasses","fileInputClasses","jsx"],"mappings":";;;AAIA,MAAMA,IAAa,cACbC,IAAe,iBACfC,IAAe,iBACfC,IAAe,iBACfC,IAAe,iBACfC,IAAe,iBACfC,IAAoB,sBACpBC,IAAoB,sBACpBC,IAAsB,wBACtBC,IAAmB,qBACnBC,IAAiB,mBACjBC,IAAoB,sBACpBC,IAAoB,sBACpBC,IAAkB,oBAClBC,IAAkB,
|
|
1
|
+
{"version":3,"file":"FileInput.js","sources":["../../src/components/FileInput.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { useConfig } from '../providers/ConfigProvider'\n\n// DaisyUI classes\nconst dFileInput = 'file-input'\nconst dFileInputXs = 'file-input-xs'\nconst dFileInputSm = 'file-input-sm'\nconst dFileInputMd = 'file-input-md'\nconst dFileInputLg = 'file-input-lg'\nconst dFileInputXl = 'file-input-xl'\nconst dFileInputNeutral = 'file-input-neutral'\nconst dFileInputPrimary = 'file-input-primary'\nconst dFileInputSecondary = 'file-input-secondary'\nconst dFileInputAccent = 'file-input-accent'\nconst dFileInputInfo = 'file-input-info'\nconst dFileInputSuccess = 'file-input-success'\nconst dFileInputWarning = 'file-input-warning'\nconst dFileInputError = 'file-input-error'\nconst dFileInputGhost = 'file-input-ghost'\n\nexport interface FileInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n ghost?: boolean\n bordered?: boolean\n className?: string\n 'data-testid'?: string\n}\n\nexport const FileInput = forwardRef<HTMLInputElement, FileInputProps>(\n ({ size, color, ghost = false, bordered = true, className = '', 'data-testid': testId, ...props }, ref) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const sizeClasses = {\n xs: dFileInputXs,\n sm: dFileInputSm,\n md: dFileInputMd,\n lg: dFileInputLg,\n xl: dFileInputXl,\n }\n\n const colorClasses = {\n neutral: dFileInputNeutral,\n primary: dFileInputPrimary,\n secondary: dFileInputSecondary,\n accent: dFileInputAccent,\n info: dFileInputInfo,\n success: dFileInputSuccess,\n warning: dFileInputWarning,\n error: dFileInputError,\n }\n\n const fileInputClasses = [\n dFileInput,\n 'w-full',\n // In DaisyUI 5, borders are on by default. Use ghost to remove them.\n !bordered && dFileInputGhost,\n ghost && dFileInputGhost,\n effectiveSize && sizeClasses[effectiveSize],\n color && colorClasses[color],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <input ref={ref} type=\"file\" className={fileInputClasses} data-testid={testId} {...props} />\n }\n)\n\nFileInput.displayName = 'FileInput'\n"],"names":["dFileInput","dFileInputXs","dFileInputSm","dFileInputMd","dFileInputLg","dFileInputXl","dFileInputNeutral","dFileInputPrimary","dFileInputSecondary","dFileInputAccent","dFileInputInfo","dFileInputSuccess","dFileInputWarning","dFileInputError","dFileInputGhost","FileInput","forwardRef","size","color","ghost","bordered","className","testId","props","ref","componentSize","useConfig","effectiveSize","sizeClasses","colorClasses","fileInputClasses","jsx"],"mappings":";;;AAIA,MAAMA,IAAa,cACbC,IAAe,iBACfC,IAAe,iBACfC,IAAe,iBACfC,IAAe,iBACfC,IAAe,iBACfC,IAAoB,sBACpBC,IAAoB,sBACpBC,IAAsB,wBACtBC,IAAmB,qBACnBC,IAAiB,mBACjBC,IAAoB,sBACpBC,IAAoB,sBACpBC,IAAkB,oBAClBC,IAAkB,oBAWXC,IAAYC;AAAA,EACvB,CAAC,EAAE,MAAAC,GAAM,OAAAC,GAAO,OAAAC,IAAQ,IAAO,UAAAC,IAAW,IAAM,WAAAC,IAAY,IAAI,eAAeC,GAAQ,GAAGC,EAAA,GAASC,MAAQ;AACzG,UAAM,EAAE,eAAAC,EAAA,IAAkBC,EAAA,GACpBC,IAAgBV,KAAQQ,KAAiB,MAEzCG,IAAc;AAAA,MAClB,IAAI3B;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,IAAA,GAGAwB,IAAe;AAAA,MACnB,SAASvB;AAAA,MACT,SAASC;AAAA,MACT,WAAWC;AAAA,MACX,QAAQC;AAAA,MACR,MAAMC;AAAA,MACN,SAASC;AAAA,MACT,SAASC;AAAA,MACT,OAAOC;AAAA,IAAA,GAGHiB,IAAmB;AAAA,MACvB9B;AAAA,MACA;AAAA;AAAA,MAEA,CAACoB,KAAYN;AAAA,MACbK,KAASL;AAAA,MACTa,KAAiBC,EAAYD,CAAa;AAAA,MAC1CT,KAASW,EAAaX,CAAK;AAAA,MAC3BG;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,WAAO,gBAAAU,EAAC,SAAA,EAAM,KAAAP,GAAU,MAAK,QAAO,WAAWM,GAAkB,eAAaR,GAAS,GAAGC,EAAA,CAAO;AAAA,EACnG;AACF;AAEAR,EAAU,cAAc;"}
|
|
@@ -1,57 +1,60 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
const
|
|
5
|
-
xs:
|
|
6
|
-
sm:
|
|
1
|
+
import { jsxs as R, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useId as q, useState as F } from "react";
|
|
3
|
+
import { useConfig as I } from "../providers/ConfigProvider.js";
|
|
4
|
+
const V = "filter", c = "btn", X = "btn-xs", k = "btn-sm", O = "btn-lg", T = "btn-xl", A = "btn-square", m = {
|
|
5
|
+
xs: X,
|
|
6
|
+
sm: k,
|
|
7
7
|
md: "",
|
|
8
|
-
lg:
|
|
9
|
-
xl:
|
|
10
|
-
},
|
|
11
|
-
options:
|
|
12
|
-
value:
|
|
13
|
-
defaultValue:
|
|
14
|
-
onChange:
|
|
15
|
-
name:
|
|
16
|
-
size:
|
|
17
|
-
showReset:
|
|
18
|
-
resetLabel:
|
|
19
|
-
className:
|
|
8
|
+
lg: O,
|
|
9
|
+
xl: T
|
|
10
|
+
}, H = ({
|
|
11
|
+
options: u,
|
|
12
|
+
value: e,
|
|
13
|
+
defaultValue: f,
|
|
14
|
+
onChange: n,
|
|
15
|
+
name: v,
|
|
16
|
+
size: b,
|
|
17
|
+
showReset: g = !0,
|
|
18
|
+
resetLabel: a = "×",
|
|
19
|
+
className: B = "",
|
|
20
|
+
"data-testid": s
|
|
20
21
|
}) => {
|
|
21
|
-
const { componentSize:
|
|
22
|
-
(
|
|
23
|
-
),
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
|
|
22
|
+
const { componentSize: p } = I(), l = b ?? p ?? "md", x = q(), C = v || `filter-${x}`, [$, o] = F(f), h = e !== void 0 ? e : $, i = e !== void 0, S = u.map(
|
|
23
|
+
(t) => typeof t == "string" ? { label: t, value: t } : t
|
|
24
|
+
), j = (t) => {
|
|
25
|
+
i || o(t), n?.(t);
|
|
26
|
+
}, y = () => {
|
|
27
|
+
i || o(void 0), n?.(void 0);
|
|
28
|
+
}, z = [c, m[l]].filter(Boolean).join(" "), N = [c, A, m[l]].filter(Boolean).join(" "), r = (t) => s ? `${s}-${t}` : void 0;
|
|
29
|
+
return /* @__PURE__ */ R("form", { className: `${V} ${B}`.trim(), onReset: y, "data-testid": s, children: [
|
|
30
|
+
g && /* @__PURE__ */ d(
|
|
30
31
|
"input",
|
|
31
32
|
{
|
|
32
|
-
className:
|
|
33
|
+
className: N,
|
|
33
34
|
type: "reset",
|
|
34
|
-
value: typeof
|
|
35
|
-
"aria-label": "Reset filter"
|
|
35
|
+
value: typeof a == "string" ? a : void 0,
|
|
36
|
+
"aria-label": "Reset filter",
|
|
37
|
+
"data-testid": r("reset")
|
|
36
38
|
}
|
|
37
39
|
),
|
|
38
|
-
|
|
40
|
+
S.map((t) => /* @__PURE__ */ d(
|
|
39
41
|
"input",
|
|
40
42
|
{
|
|
41
|
-
className:
|
|
43
|
+
className: z,
|
|
42
44
|
type: "radio",
|
|
43
|
-
name:
|
|
44
|
-
value:
|
|
45
|
-
"aria-label":
|
|
46
|
-
checked:
|
|
47
|
-
onChange: () =>
|
|
48
|
-
disabled:
|
|
45
|
+
name: C,
|
|
46
|
+
value: t.value,
|
|
47
|
+
"aria-label": t.label,
|
|
48
|
+
checked: h === t.value,
|
|
49
|
+
onChange: () => j(t.value),
|
|
50
|
+
disabled: t.disabled,
|
|
51
|
+
"data-testid": r(`option-${t.value}`)
|
|
49
52
|
},
|
|
50
|
-
|
|
53
|
+
t.value
|
|
51
54
|
))
|
|
52
55
|
] });
|
|
53
56
|
};
|
|
54
57
|
export {
|
|
55
|
-
|
|
58
|
+
H as Filter
|
|
56
59
|
};
|
|
57
60
|
//# sourceMappingURL=Filter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Filter.js","sources":["../../src/components/Filter.tsx"],"sourcesContent":["import React, { useState, useId } from 'react'\nimport { useConfig } from '../providers/ConfigProvider'\n\n// DaisyUI classes\nconst dFilter = 'filter'\nconst dBtn = 'btn'\nconst dBtnXs = 'btn-xs'\nconst dBtnSm = 'btn-sm'\nconst dBtnLg = 'btn-lg'\nconst dBtnXl = 'btn-xl'\nconst dBtnSquare = 'btn-square'\n\nexport interface FilterOption {\n label: string\n value: string\n disabled?: boolean\n}\n\nexport interface FilterProps {\n /** Filter options */\n options: (string | FilterOption)[]\n /** Controlled value */\n value?: string\n /** Default value for uncontrolled mode */\n defaultValue?: string\n /** Change handler */\n onChange?: (value: string | undefined) => void\n /** Radio group name (auto-generated if not provided) */\n name?: string\n /** Button size */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /** Show reset button */\n showReset?: boolean\n /** Reset button label */\n resetLabel?: React.ReactNode\n /** Additional CSS classes for container */\n className?: string\n}\n\nconst sizeClasses: Record<string, string> = {\n xs: dBtnXs,\n sm: dBtnSm,\n md: '',\n lg: dBtnLg,\n xl: dBtnXl,\n}\n\nexport const Filter: React.FC<FilterProps> = ({\n options,\n value,\n defaultValue,\n onChange,\n name,\n size,\n showReset = true,\n resetLabel = '×',\n className = '',\n}) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const autoId = useId()\n const groupName = name || `filter-${autoId}`\n\n const [internalValue, setInternalValue] = useState<string | undefined>(defaultValue)\n const currentValue = value !== undefined ? value : internalValue\n const isControlled = value !== undefined\n\n const normalizedOptions: FilterOption[] = options.map((opt) =>\n typeof opt === 'string' ? { label: opt, value: opt } : opt\n )\n\n const handleChange = (newValue: string) => {\n if (!isControlled) {\n setInternalValue(newValue)\n }\n onChange?.(newValue)\n }\n\n const handleReset = () => {\n if (!isControlled) {\n setInternalValue(undefined)\n }\n onChange?.(undefined)\n }\n\n const buttonClasses = [dBtn, sizeClasses[effectiveSize]].filter(Boolean).join(' ')\n const resetClasses = [dBtn, dBtnSquare, sizeClasses[effectiveSize]].filter(Boolean).join(' ')\n\n return (\n <form className={`${dFilter} ${className}`.trim()} onReset={handleReset}>\n {showReset && (\n <input\n className={resetClasses}\n type=\"reset\"\n value={typeof resetLabel === 'string' ? resetLabel : undefined}\n aria-label=\"Reset filter\"\n />\n )}\n {normalizedOptions.map((option) => (\n <input\n key={option.value}\n className={buttonClasses}\n type=\"radio\"\n name={groupName}\n value={option.value}\n aria-label={option.label}\n checked={currentValue === option.value}\n onChange={() => handleChange(option.value)}\n disabled={option.disabled}\n />\n ))}\n </form>\n )\n}\n"],"names":["dFilter","dBtn","dBtnXs","dBtnSm","dBtnLg","dBtnXl","dBtnSquare","sizeClasses","Filter","options","value","defaultValue","onChange","name","size","showReset","resetLabel","className","componentSize","useConfig","effectiveSize","autoId","useId","groupName","internalValue","setInternalValue","useState","currentValue","isControlled","normalizedOptions","opt","handleChange","newValue","handleReset","buttonClasses","resetClasses","jsxs","jsx","option"],"mappings":";;;AAIA,MAAMA,IAAU,UACVC,IAAO,OACPC,IAAS,UACTC,IAAS,UACTC,IAAS,UACTC,IAAS,UACTC,IAAa,
|
|
1
|
+
{"version":3,"file":"Filter.js","sources":["../../src/components/Filter.tsx"],"sourcesContent":["import React, { useState, useId } from 'react'\nimport { useConfig } from '../providers/ConfigProvider'\n\n// DaisyUI classes\nconst dFilter = 'filter'\nconst dBtn = 'btn'\nconst dBtnXs = 'btn-xs'\nconst dBtnSm = 'btn-sm'\nconst dBtnLg = 'btn-lg'\nconst dBtnXl = 'btn-xl'\nconst dBtnSquare = 'btn-square'\n\nexport interface FilterOption {\n label: string\n value: string\n disabled?: boolean\n}\n\nexport interface FilterProps {\n /** Filter options */\n options: (string | FilterOption)[]\n /** Controlled value */\n value?: string\n /** Default value for uncontrolled mode */\n defaultValue?: string\n /** Change handler */\n onChange?: (value: string | undefined) => void\n /** Radio group name (auto-generated if not provided) */\n name?: string\n /** Button size */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /** Show reset button */\n showReset?: boolean\n /** Reset button label */\n resetLabel?: React.ReactNode\n /** Additional CSS classes for container */\n className?: string\n 'data-testid'?: string\n}\n\nconst sizeClasses: Record<string, string> = {\n xs: dBtnXs,\n sm: dBtnSm,\n md: '',\n lg: dBtnLg,\n xl: dBtnXl,\n}\n\nexport const Filter: React.FC<FilterProps> = ({\n options,\n value,\n defaultValue,\n onChange,\n name,\n size,\n showReset = true,\n resetLabel = '×',\n className = '',\n 'data-testid': testId,\n}) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const autoId = useId()\n const groupName = name || `filter-${autoId}`\n\n const [internalValue, setInternalValue] = useState<string | undefined>(defaultValue)\n const currentValue = value !== undefined ? value : internalValue\n const isControlled = value !== undefined\n\n const normalizedOptions: FilterOption[] = options.map((opt) =>\n typeof opt === 'string' ? { label: opt, value: opt } : opt\n )\n\n const handleChange = (newValue: string) => {\n if (!isControlled) {\n setInternalValue(newValue)\n }\n onChange?.(newValue)\n }\n\n const handleReset = () => {\n if (!isControlled) {\n setInternalValue(undefined)\n }\n onChange?.(undefined)\n }\n\n const buttonClasses = [dBtn, sizeClasses[effectiveSize]].filter(Boolean).join(' ')\n const resetClasses = [dBtn, dBtnSquare, sizeClasses[effectiveSize]].filter(Boolean).join(' ')\n const getTestId = (suffix: string) => (testId ? `${testId}-${suffix}` : undefined)\n\n return (\n <form className={`${dFilter} ${className}`.trim()} onReset={handleReset} data-testid={testId}>\n {showReset && (\n <input\n className={resetClasses}\n type=\"reset\"\n value={typeof resetLabel === 'string' ? resetLabel : undefined}\n aria-label=\"Reset filter\"\n data-testid={getTestId('reset')}\n />\n )}\n {normalizedOptions.map((option) => (\n <input\n key={option.value}\n className={buttonClasses}\n type=\"radio\"\n name={groupName}\n value={option.value}\n aria-label={option.label}\n checked={currentValue === option.value}\n onChange={() => handleChange(option.value)}\n disabled={option.disabled}\n data-testid={getTestId(`option-${option.value}`)}\n />\n ))}\n </form>\n )\n}\n"],"names":["dFilter","dBtn","dBtnXs","dBtnSm","dBtnLg","dBtnXl","dBtnSquare","sizeClasses","Filter","options","value","defaultValue","onChange","name","size","showReset","resetLabel","className","testId","componentSize","useConfig","effectiveSize","autoId","useId","groupName","internalValue","setInternalValue","useState","currentValue","isControlled","normalizedOptions","opt","handleChange","newValue","handleReset","buttonClasses","resetClasses","getTestId","suffix","jsxs","jsx","option"],"mappings":";;;AAIA,MAAMA,IAAU,UACVC,IAAO,OACPC,IAAS,UACTC,IAAS,UACTC,IAAS,UACTC,IAAS,UACTC,IAAa,cA8BbC,IAAsC;AAAA,EAC1C,IAAIL;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAI;AAAA,EACJ,IAAIC;AAAA,EACJ,IAAIC;AACN,GAEaG,IAAgC,CAAC;AAAA,EAC5C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,WAAAC,IAAY;AAAA,EACZ,eAAeC;AACjB,MAAM;AACJ,QAAM,EAAE,eAAAC,EAAA,IAAkBC,EAAA,GACpBC,IAAgBP,KAAQK,KAAiB,MAEzCG,IAASC,EAAA,GACTC,IAAYX,KAAQ,UAAUS,CAAM,IAEpC,CAACG,GAAeC,CAAgB,IAAIC,EAA6BhB,CAAY,GAC7EiB,IAAelB,MAAU,SAAYA,IAAQe,GAC7CI,IAAenB,MAAU,QAEzBoB,IAAoCrB,EAAQ;AAAA,IAAI,CAACsB,MACrD,OAAOA,KAAQ,WAAW,EAAE,OAAOA,GAAK,OAAOA,MAAQA;AAAA,EAAA,GAGnDC,IAAe,CAACC,MAAqB;AACzC,IAAKJ,KACHH,EAAiBO,CAAQ,GAE3BrB,IAAWqB,CAAQ;AAAA,EACrB,GAEMC,IAAc,MAAM;AACxB,IAAKL,KACHH,EAAiB,MAAS,GAE5Bd,IAAW,MAAS;AAAA,EACtB,GAEMuB,IAAgB,CAAClC,GAAMM,EAAYc,CAAa,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAC3Ee,IAAe,CAACnC,GAAMK,GAAYC,EAAYc,CAAa,CAAC,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GACtFgB,IAAY,CAACC,MAAoBpB,IAAS,GAAGA,CAAM,IAAIoB,CAAM,KAAK;AAExE,SACE,gBAAAC,EAAC,QAAA,EAAK,WAAW,GAAGvC,CAAO,IAAIiB,CAAS,GAAG,KAAA,GAAQ,SAASiB,GAAa,eAAahB,GACnF,UAAA;AAAA,IAAAH,KACC,gBAAAyB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWJ;AAAA,QACX,MAAK;AAAA,QACL,OAAO,OAAOpB,KAAe,WAAWA,IAAa;AAAA,QACrD,cAAW;AAAA,QACX,eAAaqB,EAAU,OAAO;AAAA,MAAA;AAAA,IAAA;AAAA,IAGjCP,EAAkB,IAAI,CAACW,MACtB,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAWL;AAAA,QACX,MAAK;AAAA,QACL,MAAMX;AAAA,QACN,OAAOiB,EAAO;AAAA,QACd,cAAYA,EAAO;AAAA,QACnB,SAASb,MAAiBa,EAAO;AAAA,QACjC,UAAU,MAAMT,EAAaS,EAAO,KAAK;AAAA,QACzC,UAAUA,EAAO;AAAA,QACjB,eAAaJ,EAAU,UAAUI,EAAO,KAAK,EAAE;AAAA,MAAA;AAAA,MAT1CA,EAAO;AAAA,IAAA,CAWf;AAAA,EAAA,GACH;AAEJ;"}
|
|
@@ -10,5 +10,6 @@ export interface FlexProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
minHeight?: 'screen' | 'full' | 'fit' | 'min' | 'max';
|
|
11
11
|
minWidth?: 'full' | 'fit' | 'min' | 'max';
|
|
12
12
|
children?: React.ReactNode;
|
|
13
|
+
'data-testid'?: string;
|
|
13
14
|
}
|
|
14
15
|
export declare const Flex: React.FC<FlexProps>;
|
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 */
|
|
@@ -30,12 +31,18 @@ export interface FloatButtonGroupProps {
|
|
|
30
31
|
shape?: 'circle' | 'square';
|
|
31
32
|
/** Main trigger button icon */
|
|
32
33
|
icon?: React.ReactNode;
|
|
34
|
+
/** Accessible label for trigger button (required for icon-only buttons) */
|
|
35
|
+
triggerLabel?: string;
|
|
33
36
|
/** Main action button that replaces trigger when open (fab-main-action) */
|
|
34
37
|
mainAction?: React.ReactNode;
|
|
38
|
+
/** Accessible label for main action button */
|
|
39
|
+
mainActionLabel?: string;
|
|
35
40
|
/** Click handler for main action button */
|
|
36
41
|
onMainAction?: () => void;
|
|
37
42
|
/** Show close button when open (fab-close) */
|
|
38
43
|
showClose?: boolean;
|
|
44
|
+
/** Accessible label for close button */
|
|
45
|
+
closeLabel?: string;
|
|
39
46
|
/** Button type/color */
|
|
40
47
|
type?: 'default' | 'primary';
|
|
41
48
|
/** Position on screen */
|
|
@@ -46,6 +53,7 @@ export interface FloatButtonGroupProps {
|
|
|
46
53
|
className?: string;
|
|
47
54
|
/** Custom styles */
|
|
48
55
|
style?: React.CSSProperties;
|
|
56
|
+
'data-testid'?: string;
|
|
49
57
|
}
|
|
50
58
|
export interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'> {
|
|
51
59
|
/** Scroll threshold to show button (pixels) */
|
|
@@ -64,6 +72,7 @@ export interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButton
|
|
|
64
72
|
offset?: number;
|
|
65
73
|
/** @deprecated Use icon prop instead */
|
|
66
74
|
children?: React.ReactNode;
|
|
75
|
+
'data-testid'?: string;
|
|
67
76
|
}
|
|
68
77
|
interface FloatButtonComponent extends React.FC<FloatButtonProps> {
|
|
69
78
|
Group: React.FC<FloatButtonGroupProps>;
|