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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stat.js","sources":["../../src/components/Stat.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dStats = 'stats'\nconst dStatsHorizontal = 'stats-horizontal'\nconst dStatsVertical = 'stats-vertical'\nconst dStat = 'stat'\nconst dStatFigure = 'stat-figure'\nconst dStatTitle = 'stat-title'\nconst dStatValue = 'stat-value'\nconst dStatDesc = 'stat-desc'\nconst dStatActions = 'stat-actions'\n\nexport interface StatsProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n vertical?: boolean\n}\n\nexport interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: React.ReactNode\n value?: React.ReactNode\n desc?: React.ReactNode\n figure?: React.ReactNode\n actions?: React.ReactNode\n}\n\nfunction StatsRoot({ children, className = '', vertical = false, ...rest }: StatsProps) {\n const classes = [\n dStats,\n vertical ? dStatsVertical : dStatsHorizontal,\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} {...rest}>{children}</div>\n}\n\nfunction StatItem({ title, value, desc, figure, actions, className = '', ...rest }: StatProps) {\n return (\n <div className={`${dStat} ${className}`} {...rest}>\n {figure && <div className={dStatFigure}>{figure}</div>}\n {title && <div className={dStatTitle}>{title}</div>}\n {value && <div className={dStatValue}>{value}</div>}\n {desc && <div className={dStatDesc}>{desc}</div>}\n {actions && <div className={dStatActions}>{actions}</div>}\n </div>\n )\n}\n\nexport const Stats = Object.assign(StatsRoot, {\n Stat: StatItem,\n})\n"],"names":["dStats","dStatsHorizontal","dStatsVertical","dStat","dStatFigure","dStatTitle","dStatValue","dStatDesc","dStatActions","StatsRoot","children","className","vertical","rest","classes","StatItem","title","value","desc","figure","actions","
|
|
1
|
+
{"version":3,"file":"Stat.js","sources":["../../src/components/Stat.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dStats = 'stats'\nconst dStatsHorizontal = 'stats-horizontal'\nconst dStatsVertical = 'stats-vertical'\nconst dStat = 'stat'\nconst dStatFigure = 'stat-figure'\nconst dStatTitle = 'stat-title'\nconst dStatValue = 'stat-value'\nconst dStatDesc = 'stat-desc'\nconst dStatActions = 'stat-actions'\n\nexport interface StatsProps extends React.HTMLAttributes<HTMLDivElement> {\n children: React.ReactNode\n vertical?: boolean\n 'data-testid'?: string\n}\n\nexport interface StatProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: React.ReactNode\n value?: React.ReactNode\n desc?: React.ReactNode\n figure?: React.ReactNode\n actions?: React.ReactNode\n 'data-testid'?: string\n}\n\nfunction StatsRoot({ children, className = '', vertical = false, 'data-testid': testId, ...rest }: StatsProps) {\n const classes = [\n dStats,\n vertical ? dStatsVertical : dStatsHorizontal,\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <div className={classes} data-testid={testId} {...rest}>{children}</div>\n}\n\nfunction StatItem({ title, value, desc, figure, actions, className = '', 'data-testid': testId, ...rest }: StatProps) {\n const getTestId = (suffix: string) => (testId ? `${testId}-${suffix}` : undefined)\n return (\n <div className={`${dStat} ${className}`} data-testid={testId} {...rest}>\n {figure && <div className={dStatFigure} data-testid={getTestId('figure')}>{figure}</div>}\n {title && <div className={dStatTitle} data-testid={getTestId('title')}>{title}</div>}\n {value && <div className={dStatValue} data-testid={getTestId('value')}>{value}</div>}\n {desc && <div className={dStatDesc} data-testid={getTestId('desc')}>{desc}</div>}\n {actions && <div className={dStatActions} data-testid={getTestId('actions')}>{actions}</div>}\n </div>\n )\n}\n\nexport const Stats = Object.assign(StatsRoot, {\n Stat: StatItem,\n})\n"],"names":["dStats","dStatsHorizontal","dStatsVertical","dStat","dStatFigure","dStatTitle","dStatValue","dStatDesc","dStatActions","StatsRoot","children","className","vertical","testId","rest","classes","jsx","StatItem","title","value","desc","figure","actions","getTestId","suffix","jsxs","Stats"],"mappings":";AAGA,MAAMA,IAAS,SACTC,IAAmB,oBACnBC,IAAiB,kBACjBC,IAAQ,QACRC,IAAc,eACdC,IAAa,cACbC,IAAa,cACbC,IAAY,aACZC,IAAe;AAiBrB,SAASC,EAAU,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,UAAAC,IAAW,IAAO,eAAeC,GAAQ,GAAGC,KAAoB;AAC7G,QAAMC,IAAU;AAAA,IACdf;AAAA,IACAY,IAAWV,IAAiBD;AAAA,IAC5BU;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SAAO,gBAAAK,EAAC,SAAI,WAAWD,GAAS,eAAaF,GAAS,GAAGC,GAAO,UAAAJ,GAAS;AAC3E;AAEA,SAASO,EAAS,EAAE,OAAAC,GAAO,OAAAC,GAAO,MAAAC,GAAM,QAAAC,GAAQ,SAAAC,GAAS,WAAAX,IAAY,IAAI,eAAeE,GAAQ,GAAGC,KAAmB;AACpH,QAAMS,IAAY,CAACC,MAAoBX,IAAS,GAAGA,CAAM,IAAIW,CAAM,KAAK;AACxE,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAW,GAAGtB,CAAK,IAAIQ,CAAS,IAAI,eAAaE,GAAS,GAAGC,GAC/D,UAAA;AAAA,IAAAO,KAAU,gBAAAL,EAAC,SAAI,WAAWZ,GAAa,eAAamB,EAAU,QAAQ,GAAI,UAAAF,EAAA,CAAO;AAAA,IACjFH,uBAAU,OAAA,EAAI,WAAWb,GAAY,eAAakB,EAAU,OAAO,GAAI,UAAAL,EAAA,CAAM;AAAA,IAC7EC,uBAAU,OAAA,EAAI,WAAWb,GAAY,eAAaiB,EAAU,OAAO,GAAI,UAAAJ,EAAA,CAAM;AAAA,IAC7EC,uBAAS,OAAA,EAAI,WAAWb,GAAW,eAAagB,EAAU,MAAM,GAAI,UAAAH,EAAA,CAAK;AAAA,IACzEE,uBAAY,OAAA,EAAI,WAAWd,GAAc,eAAae,EAAU,SAAS,GAAI,UAAAD,EAAA,CAAQ;AAAA,EAAA,GACxF;AAEJ;AAEO,MAAMI,IAAQ,OAAO,OAAOjB,GAAW;AAAA,EAC5C,MAAMQ;AACR,CAAC;"}
|
|
@@ -21,6 +21,7 @@ export interface StepsProps extends Omit<React.HTMLAttributes<HTMLUListElement>,
|
|
|
21
21
|
vertical?: boolean;
|
|
22
22
|
/** Callback when step is clicked */
|
|
23
23
|
onChange?: (current: number) => void;
|
|
24
|
+
'data-testid'?: string;
|
|
24
25
|
}
|
|
25
26
|
export interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'color' | 'title'> {
|
|
26
27
|
/** Step title/label */
|
|
@@ -43,9 +44,10 @@ export interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, '
|
|
|
43
44
|
_clickable?: boolean;
|
|
44
45
|
/** Internal: click handler */
|
|
45
46
|
_onClick?: (index: number) => void;
|
|
47
|
+
'data-testid'?: string;
|
|
46
48
|
}
|
|
47
|
-
declare function StepsRoot({ children, items, current, direction, vertical, onChange, className, ...rest }: StepsProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
-
declare function Step({ children, title, description, icon, color, dataContent, disabled, className, _index, _clickable, _onClick, ...rest }: StepProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
declare function StepsRoot({ children, items, current, direction, vertical, onChange, className, 'data-testid': testId, ...rest }: StepsProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare function Step({ children, title, description, icon, color, dataContent, disabled, className, _index, _clickable, _onClick, 'data-testid': testId, ...rest }: StepProps): import("react/jsx-runtime").JSX.Element;
|
|
49
51
|
export declare const Steps: typeof StepsRoot & {
|
|
50
52
|
Step: typeof Step;
|
|
51
53
|
};
|
package/dist/components/Steps.js
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
neutral:
|
|
5
|
-
primary:
|
|
6
|
-
secondary:
|
|
7
|
-
accent:
|
|
8
|
-
info:
|
|
9
|
-
success:
|
|
10
|
-
warning:
|
|
11
|
-
error:
|
|
1
|
+
import { jsx as p, jsxs as N } from "react/jsx-runtime";
|
|
2
|
+
import k from "react";
|
|
3
|
+
const j = "steps", V = "steps-vertical", g = "step", h = "step-neutral", E = "step-primary", _ = "step-secondary", $ = "step-accent", w = "step-info", B = "step-success", R = "step-warning", A = "step-error", D = "step-disabled", O = {
|
|
4
|
+
neutral: h,
|
|
5
|
+
primary: E,
|
|
6
|
+
secondary: _,
|
|
7
|
+
accent: $,
|
|
8
|
+
info: w,
|
|
9
|
+
success: B,
|
|
10
|
+
warning: R,
|
|
11
|
+
error: A
|
|
12
12
|
};
|
|
13
|
-
function
|
|
14
|
-
children:
|
|
13
|
+
function P({
|
|
14
|
+
children: d,
|
|
15
15
|
items: n,
|
|
16
16
|
current: t,
|
|
17
|
-
direction:
|
|
18
|
-
vertical:
|
|
17
|
+
direction: S,
|
|
18
|
+
vertical: u = !1,
|
|
19
19
|
onChange: o,
|
|
20
|
-
className:
|
|
21
|
-
|
|
20
|
+
className: a = "",
|
|
21
|
+
"data-testid": c,
|
|
22
|
+
...r
|
|
22
23
|
}) {
|
|
23
|
-
const
|
|
24
|
+
const i = [j, (S === "vertical" || u) && V, a].filter(Boolean).join(" "), v = (s) => c ? `${c}-${s}` : void 0;
|
|
24
25
|
if (n && n.length > 0)
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
const f = t !== void 0 && e < t,
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
26
|
+
return /* @__PURE__ */ p("ul", { className: i, "data-testid": c, ...r, children: n.map((s, e) => {
|
|
27
|
+
const f = t !== void 0 && e < t, l = t !== void 0 && e === t, m = s.color || (f || l ? "primary" : void 0);
|
|
28
|
+
return /* @__PURE__ */ p(
|
|
29
|
+
b,
|
|
29
30
|
{
|
|
30
31
|
color: m,
|
|
31
32
|
icon: s.icon,
|
|
@@ -35,63 +36,66 @@ function D({
|
|
|
35
36
|
_index: e,
|
|
36
37
|
_clickable: !!o && !s.disabled,
|
|
37
38
|
_onClick: o,
|
|
38
|
-
"aria-current":
|
|
39
|
+
"aria-current": l ? "step" : void 0,
|
|
40
|
+
"data-testid": v(`step-${s.key ?? e}`)
|
|
39
41
|
},
|
|
40
42
|
s.key ?? e
|
|
41
43
|
);
|
|
42
44
|
}) });
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
const f = e < t,
|
|
46
|
-
return
|
|
45
|
+
const C = t !== void 0 ? k.Children.map(d, (s, e) => {
|
|
46
|
+
if (k.isValidElement(s)) {
|
|
47
|
+
const f = e < t, l = e === t, m = s.props.color || (f || l ? "primary" : void 0);
|
|
48
|
+
return k.cloneElement(s, {
|
|
47
49
|
color: m,
|
|
48
50
|
_index: e,
|
|
49
51
|
_clickable: !!o && !s.props.disabled,
|
|
50
52
|
_onClick: o,
|
|
51
|
-
"aria-current":
|
|
53
|
+
"aria-current": l ? "step" : void 0
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
return s;
|
|
55
|
-
}) :
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
+
}) : d;
|
|
58
|
+
return /* @__PURE__ */ p("ul", { className: i, "data-testid": c, ...r, children: C });
|
|
57
59
|
}
|
|
58
|
-
function
|
|
59
|
-
children:
|
|
60
|
+
function b({
|
|
61
|
+
children: d,
|
|
60
62
|
title: n,
|
|
61
63
|
description: t,
|
|
62
|
-
icon:
|
|
63
|
-
color:
|
|
64
|
+
icon: S,
|
|
65
|
+
color: u,
|
|
64
66
|
dataContent: o,
|
|
65
|
-
disabled:
|
|
66
|
-
className:
|
|
67
|
-
_index:
|
|
68
|
-
_clickable:
|
|
69
|
-
_onClick:
|
|
70
|
-
|
|
67
|
+
disabled: a = !1,
|
|
68
|
+
className: c = "",
|
|
69
|
+
_index: r,
|
|
70
|
+
_clickable: y,
|
|
71
|
+
_onClick: i,
|
|
72
|
+
"data-testid": v,
|
|
73
|
+
...C
|
|
71
74
|
}) {
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */
|
|
75
|
+
const s = [g, u && O[u], a && D, c].filter(Boolean).join(" ");
|
|
76
|
+
return /* @__PURE__ */ N(
|
|
74
77
|
"li",
|
|
75
78
|
{
|
|
76
|
-
className:
|
|
79
|
+
className: s,
|
|
77
80
|
"data-content": o,
|
|
78
81
|
onClick: () => {
|
|
79
|
-
|
|
82
|
+
y && i && r !== void 0 && !a && i(r);
|
|
80
83
|
},
|
|
81
|
-
style:
|
|
82
|
-
|
|
84
|
+
style: y && !a ? { cursor: "pointer" } : void 0,
|
|
85
|
+
"data-testid": v,
|
|
86
|
+
...C,
|
|
83
87
|
children: [
|
|
84
|
-
|
|
85
|
-
n ??
|
|
86
|
-
t && /* @__PURE__ */
|
|
88
|
+
S && /* @__PURE__ */ p("span", { className: "step-icon", children: S }),
|
|
89
|
+
n ?? d,
|
|
90
|
+
t && /* @__PURE__ */ p("span", { className: "text-xs opacity-70 block", children: t })
|
|
87
91
|
]
|
|
88
92
|
}
|
|
89
93
|
);
|
|
90
94
|
}
|
|
91
|
-
const
|
|
92
|
-
Step:
|
|
95
|
+
const q = Object.assign(P, {
|
|
96
|
+
Step: b
|
|
93
97
|
});
|
|
94
98
|
export {
|
|
95
|
-
|
|
99
|
+
q as Steps
|
|
96
100
|
};
|
|
97
101
|
//# sourceMappingURL=Steps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Steps.js","sources":["../../src/components/Steps.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dSteps = 'steps'\nconst dStepsVertical = 'steps-vertical'\nconst dStep = 'step'\nconst dStepNeutral = 'step-neutral'\nconst dStepPrimary = 'step-primary'\nconst dStepSecondary = 'step-secondary'\nconst dStepAccent = 'step-accent'\nconst dStepInfo = 'step-info'\nconst dStepSuccess = 'step-success'\nconst dStepWarning = 'step-warning'\nconst dStepError = 'step-error'\nconst dStepDisabled = 'step-disabled'\n\nexport type StepsDirection = 'horizontal' | 'vertical'\n\nexport interface StepItem {\n key?: string\n title: React.ReactNode\n description?: React.ReactNode\n icon?: React.ReactNode\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n disabled?: boolean\n}\n\nexport interface StepsProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {\n /** Step items (compound pattern) */\n children?: React.ReactNode\n /** Step items (data-driven pattern) */\n items?: StepItem[]\n /** Current step index (0-based) */\n current?: number\n /** Layout direction */\n direction?: StepsDirection\n /** @deprecated Use direction=\"vertical\" instead */\n vertical?: boolean\n /** Callback when step is clicked */\n onChange?: (current: number) => void\n}\n\nexport interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'color' | 'title'> {\n /** Step title/label */\n children?: React.ReactNode\n /** Step title (alternative to children) */\n title?: React.ReactNode\n /** Step description */\n description?: React.ReactNode\n /** Step icon */\n icon?: React.ReactNode\n /** Step color */\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n /** Custom content for step indicator */\n dataContent?: string\n /** Whether step is disabled */\n disabled?: boolean\n /** Internal: step index */\n _index?: number\n /** Internal: whether step is clickable */\n _clickable?: boolean\n /** Internal: click handler */\n _onClick?: (index: number) => void\n}\n\nconst colorClasses: Record<string, string> = {\n neutral: dStepNeutral,\n primary: dStepPrimary,\n secondary: dStepSecondary,\n accent: dStepAccent,\n info: dStepInfo,\n success: dStepSuccess,\n warning: dStepWarning,\n error: dStepError,\n}\n\nfunction StepsRoot({\n children,\n items,\n current,\n direction,\n vertical = false,\n onChange,\n className = '',\n ...rest\n}: StepsProps) {\n const isVertical = direction === 'vertical' || vertical\n\n const classes = [dSteps, isVertical && dStepsVertical, className]\n .filter(Boolean)\n .join(' ')\n\n // Render data-driven items if provided\n if (items && items.length > 0) {\n return (\n <ul className={classes} {...rest}>\n {items.map((item, index) => {\n const isCompleted = current !== undefined && index < current\n const isCurrent = current !== undefined && index === current\n const stepColor = item.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return (\n <Step\n key={item.key ?? index}\n color={stepColor}\n icon={item.icon}\n title={item.title}\n description={item.description}\n disabled={item.disabled}\n _index={index}\n _clickable={!!onChange && !item.disabled}\n _onClick={onChange}\n aria-current={isCurrent ? 'step' : undefined}\n />\n )\n })}\n </ul>\n )\n }\n\n // For compound pattern, inject props into children if current is provided\n const processedChildren =\n current !== undefined\n ? React.Children.map(children, (child, index) => {\n if (React.isValidElement<StepProps>(child)) {\n const isCompleted = index < current\n const isCurrent = index === current\n const childColor = child.props.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return React.cloneElement(child, {\n color: childColor,\n _index: index,\n _clickable: !!onChange && !child.props.disabled,\n _onClick: onChange,\n 'aria-current': isCurrent ? 'step' : undefined,\n } as Partial<StepProps>)\n }\n return child\n })\n : children\n\n return (\n <ul className={classes} {...rest}>\n {processedChildren}\n </ul>\n )\n}\n\nfunction Step({\n children,\n title,\n description,\n icon,\n color,\n dataContent,\n disabled = false,\n className = '',\n _index,\n _clickable,\n _onClick,\n ...rest\n}: StepProps) {\n const classes = [dStep, color && colorClasses[color], disabled && dStepDisabled, className]\n .filter(Boolean)\n .join(' ')\n\n const handleClick = () => {\n if (_clickable && _onClick && _index !== undefined && !disabled) {\n _onClick(_index)\n }\n }\n\n const displayContent = title ?? children\n\n return (\n <li\n className={classes}\n data-content={dataContent}\n onClick={handleClick}\n style={_clickable && !disabled ? { cursor: 'pointer' } : undefined}\n {...rest}\n >\n {icon && <span className=\"step-icon\">{icon}</span>}\n {displayContent}\n {description && <span className=\"text-xs opacity-70 block\">{description}</span>}\n </li>\n )\n}\n\nexport const Steps = Object.assign(StepsRoot, {\n Step,\n})\n"],"names":["dSteps","dStepsVertical","dStep","dStepNeutral","dStepPrimary","dStepSecondary","dStepAccent","dStepInfo","dStepSuccess","dStepWarning","dStepError","dStepDisabled","colorClasses","StepsRoot","children","items","current","direction","vertical","onChange","className","rest","classes","jsx","item","index","isCompleted","isCurrent","stepColor","Step","processedChildren","React","child","childColor","title","description","icon","color","dataContent","disabled","_index","_clickable","_onClick","jsxs","Steps"],"mappings":";;AAGA,MAAMA,IAAS,SACTC,IAAiB,kBACjBC,IAAQ,QACRC,IAAe,gBACfC,IAAe,gBACfC,IAAiB,kBACjBC,IAAc,eACdC,IAAY,aACZC,IAAe,gBACfC,IAAe,gBACfC,IAAa,cACbC,IAAgB,
|
|
1
|
+
{"version":3,"file":"Steps.js","sources":["../../src/components/Steps.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dSteps = 'steps'\nconst dStepsVertical = 'steps-vertical'\nconst dStep = 'step'\nconst dStepNeutral = 'step-neutral'\nconst dStepPrimary = 'step-primary'\nconst dStepSecondary = 'step-secondary'\nconst dStepAccent = 'step-accent'\nconst dStepInfo = 'step-info'\nconst dStepSuccess = 'step-success'\nconst dStepWarning = 'step-warning'\nconst dStepError = 'step-error'\nconst dStepDisabled = 'step-disabled'\n\nexport type StepsDirection = 'horizontal' | 'vertical'\n\nexport interface StepItem {\n key?: string\n title: React.ReactNode\n description?: React.ReactNode\n icon?: React.ReactNode\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n disabled?: boolean\n}\n\nexport interface StepsProps extends Omit<React.HTMLAttributes<HTMLUListElement>, 'onChange'> {\n /** Step items (compound pattern) */\n children?: React.ReactNode\n /** Step items (data-driven pattern) */\n items?: StepItem[]\n /** Current step index (0-based) */\n current?: number\n /** Layout direction */\n direction?: StepsDirection\n /** @deprecated Use direction=\"vertical\" instead */\n vertical?: boolean\n /** Callback when step is clicked */\n onChange?: (current: number) => void\n 'data-testid'?: string\n}\n\nexport interface StepProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'color' | 'title'> {\n /** Step title/label */\n children?: React.ReactNode\n /** Step title (alternative to children) */\n title?: React.ReactNode\n /** Step description */\n description?: React.ReactNode\n /** Step icon */\n icon?: React.ReactNode\n /** Step color */\n color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error'\n /** Custom content for step indicator */\n dataContent?: string\n /** Whether step is disabled */\n disabled?: boolean\n /** Internal: step index */\n _index?: number\n /** Internal: whether step is clickable */\n _clickable?: boolean\n /** Internal: click handler */\n _onClick?: (index: number) => void\n 'data-testid'?: string\n}\n\nconst colorClasses: Record<string, string> = {\n neutral: dStepNeutral,\n primary: dStepPrimary,\n secondary: dStepSecondary,\n accent: dStepAccent,\n info: dStepInfo,\n success: dStepSuccess,\n warning: dStepWarning,\n error: dStepError,\n}\n\nfunction StepsRoot({\n children,\n items,\n current,\n direction,\n vertical = false,\n onChange,\n className = '',\n 'data-testid': testId,\n ...rest\n}: StepsProps) {\n const isVertical = direction === 'vertical' || vertical\n\n const classes = [dSteps, isVertical && dStepsVertical, className]\n .filter(Boolean)\n .join(' ')\n\n const getTestId = (suffix: string) => (testId ? `${testId}-${suffix}` : undefined)\n\n // Render data-driven items if provided\n if (items && items.length > 0) {\n return (\n <ul className={classes} data-testid={testId} {...rest}>\n {items.map((item, index) => {\n const isCompleted = current !== undefined && index < current\n const isCurrent = current !== undefined && index === current\n const stepColor = item.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return (\n <Step\n key={item.key ?? index}\n color={stepColor}\n icon={item.icon}\n title={item.title}\n description={item.description}\n disabled={item.disabled}\n _index={index}\n _clickable={!!onChange && !item.disabled}\n _onClick={onChange}\n aria-current={isCurrent ? 'step' : undefined}\n data-testid={getTestId(`step-${item.key ?? index}`)}\n />\n )\n })}\n </ul>\n )\n }\n\n // For compound pattern, inject props into children if current is provided\n const processedChildren =\n current !== undefined\n ? React.Children.map(children, (child, index) => {\n if (React.isValidElement<StepProps>(child)) {\n const isCompleted = index < current\n const isCurrent = index === current\n const childColor = child.props.color || ((isCompleted || isCurrent) ? 'primary' : undefined)\n\n return React.cloneElement(child, {\n color: childColor,\n _index: index,\n _clickable: !!onChange && !child.props.disabled,\n _onClick: onChange,\n 'aria-current': isCurrent ? 'step' : undefined,\n } as Partial<StepProps>)\n }\n return child\n })\n : children\n\n return (\n <ul className={classes} data-testid={testId} {...rest}>\n {processedChildren}\n </ul>\n )\n}\n\nfunction Step({\n children,\n title,\n description,\n icon,\n color,\n dataContent,\n disabled = false,\n className = '',\n _index,\n _clickable,\n _onClick,\n 'data-testid': testId,\n ...rest\n}: StepProps) {\n const classes = [dStep, color && colorClasses[color], disabled && dStepDisabled, className]\n .filter(Boolean)\n .join(' ')\n\n const handleClick = () => {\n if (_clickable && _onClick && _index !== undefined && !disabled) {\n _onClick(_index)\n }\n }\n\n const displayContent = title ?? children\n\n return (\n <li\n className={classes}\n data-content={dataContent}\n onClick={handleClick}\n style={_clickable && !disabled ? { cursor: 'pointer' } : undefined}\n data-testid={testId}\n {...rest}\n >\n {icon && <span className=\"step-icon\">{icon}</span>}\n {displayContent}\n {description && <span className=\"text-xs opacity-70 block\">{description}</span>}\n </li>\n )\n}\n\nexport const Steps = Object.assign(StepsRoot, {\n Step,\n})\n"],"names":["dSteps","dStepsVertical","dStep","dStepNeutral","dStepPrimary","dStepSecondary","dStepAccent","dStepInfo","dStepSuccess","dStepWarning","dStepError","dStepDisabled","colorClasses","StepsRoot","children","items","current","direction","vertical","onChange","className","testId","rest","classes","getTestId","suffix","jsx","item","index","isCompleted","isCurrent","stepColor","Step","processedChildren","React","child","childColor","title","description","icon","color","dataContent","disabled","_index","_clickable","_onClick","jsxs","Steps"],"mappings":"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"}
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
const
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
const l = "text-rotate", u = {
|
|
3
3
|
6e3: "duration-6000",
|
|
4
4
|
9e3: "duration-9000",
|
|
5
5
|
12e3: "duration-12000",
|
|
6
6
|
15e3: "duration-15000",
|
|
7
7
|
18e3: "duration-18000"
|
|
8
|
-
},
|
|
9
|
-
items:
|
|
10
|
-
duration:
|
|
11
|
-
centered:
|
|
12
|
-
className:
|
|
8
|
+
}, $ = ({
|
|
9
|
+
items: n,
|
|
10
|
+
duration: s,
|
|
11
|
+
centered: o = !1,
|
|
12
|
+
className: r = "",
|
|
13
|
+
"data-testid": t
|
|
13
14
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return /* @__PURE__ */
|
|
15
|
+
const d = s ? u[s] : "", c = (e) => t ? `${t}-${e}` : void 0;
|
|
16
|
+
return /* @__PURE__ */ a(
|
|
16
17
|
"span",
|
|
17
18
|
{
|
|
18
|
-
className: `${
|
|
19
|
-
|
|
19
|
+
className: `${l} ${d} ${o ? "justify-items-center" : ""} ${r}`.trim(),
|
|
20
|
+
"data-testid": t,
|
|
21
|
+
children: /* @__PURE__ */ a("span", { children: n.slice(0, 6).map((e, i) => /* @__PURE__ */ a("span", { "data-testid": c(`item-${i}`), children: e }, i)) })
|
|
20
22
|
}
|
|
21
23
|
);
|
|
22
24
|
};
|
|
23
25
|
export {
|
|
24
|
-
|
|
26
|
+
$ as TextRotate
|
|
25
27
|
};
|
|
26
28
|
//# sourceMappingURL=TextRotate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextRotate.js","sources":["../../src/components/TextRotate.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dTextRotate = 'text-rotate'\n\nexport type TextRotateDuration = 6000 | 9000 | 12000 | 15000 | 18000\n\nconst durationClasses: Record<TextRotateDuration, string> = {\n 6000: 'duration-6000',\n 9000: 'duration-9000',\n 12000: 'duration-12000',\n 15000: 'duration-15000',\n 18000: 'duration-18000',\n}\n\nexport interface TextRotateProps {\n /** Text items to rotate through (max 6) */\n items: React.ReactNode[]\n /** Animation duration in ms (default 10000) */\n duration?: TextRotateDuration\n /** Center text horizontally */\n centered?: boolean\n /** Additional CSS classes */\n className?: string\n}\n\nexport const TextRotate: React.FC<TextRotateProps> = ({\n items,\n duration,\n centered = false,\n className = '',\n}) => {\n const durationClass = duration ? durationClasses[duration] : ''\n\n return (\n <span\n className={`${dTextRotate} ${durationClass} ${centered ? 'justify-items-center' : ''} ${className}`.trim()}\n >\n <span>\n {items.slice(0, 6).map((item, index) => (\n <span key={index}>{item}</span>\n ))}\n </span>\n </span>\n )\n}\n"],"names":["dTextRotate","durationClasses","TextRotate","items","duration","centered","className","durationClass","jsx","item","index"],"mappings":";AAGA,MAAMA,IAAc,eAIdC,IAAsD;AAAA,EAC1D,KAAM;AAAA,EACN,KAAM;AAAA,EACN,MAAO;AAAA,EACP,MAAO;AAAA,EACP,MAAO;AACT,
|
|
1
|
+
{"version":3,"file":"TextRotate.js","sources":["../../src/components/TextRotate.tsx"],"sourcesContent":["import React from 'react'\n\n// DaisyUI classes\nconst dTextRotate = 'text-rotate'\n\nexport type TextRotateDuration = 6000 | 9000 | 12000 | 15000 | 18000\n\nconst durationClasses: Record<TextRotateDuration, string> = {\n 6000: 'duration-6000',\n 9000: 'duration-9000',\n 12000: 'duration-12000',\n 15000: 'duration-15000',\n 18000: 'duration-18000',\n}\n\nexport interface TextRotateProps {\n /** Text items to rotate through (max 6) */\n items: React.ReactNode[]\n /** Animation duration in ms (default 10000) */\n duration?: TextRotateDuration\n /** Center text horizontally */\n centered?: boolean\n /** Additional CSS classes */\n className?: string\n 'data-testid'?: string\n}\n\nexport const TextRotate: React.FC<TextRotateProps> = ({\n items,\n duration,\n centered = false,\n className = '',\n 'data-testid': testId,\n}) => {\n const durationClass = duration ? durationClasses[duration] : ''\n const getTestId = (suffix: string) => (testId ? `${testId}-${suffix}` : undefined)\n\n return (\n <span\n className={`${dTextRotate} ${durationClass} ${centered ? 'justify-items-center' : ''} ${className}`.trim()}\n data-testid={testId}\n >\n <span>\n {items.slice(0, 6).map((item, index) => (\n <span key={index} data-testid={getTestId(`item-${index}`)}>{item}</span>\n ))}\n </span>\n </span>\n )\n}\n"],"names":["dTextRotate","durationClasses","TextRotate","items","duration","centered","className","testId","durationClass","getTestId","suffix","jsx","item","index"],"mappings":";AAGA,MAAMA,IAAc,eAIdC,IAAsD;AAAA,EAC1D,KAAM;AAAA,EACN,KAAM;AAAA,EACN,MAAO;AAAA,EACP,MAAO;AAAA,EACP,MAAO;AACT,GAcaC,IAAwC,CAAC;AAAA,EACpD,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC,IAAY;AAAA,EACZ,eAAeC;AACjB,MAAM;AACJ,QAAMC,IAAgBJ,IAAWH,EAAgBG,CAAQ,IAAI,IACvDK,IAAY,CAACC,MAAoBH,IAAS,GAAGA,CAAM,IAAIG,CAAM,KAAK;AAExE,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,GAAGX,CAAW,IAAIQ,CAAa,IAAIH,IAAW,yBAAyB,EAAE,IAAIC,CAAS,GAAG,KAAA;AAAA,MACpG,eAAaC;AAAA,MAEb,UAAA,gBAAAI,EAAC,UACE,UAAAR,EAAM,MAAM,GAAG,CAAC,EAAE,IAAI,CAACS,GAAMC,wBAC3B,QAAA,EAAiB,eAAaJ,EAAU,QAAQI,CAAK,EAAE,GAAI,UAAAD,KAAjDC,CAAsD,CAClE,EAAA,CACH;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -5,5 +5,6 @@ export interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTex
|
|
|
5
5
|
ghost?: boolean;
|
|
6
6
|
bordered?: boolean;
|
|
7
7
|
className?: string;
|
|
8
|
+
'data-testid'?: string;
|
|
8
9
|
}
|
|
9
10
|
export declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as f } from "react";
|
|
3
|
+
import { useConfig as u } from "../providers/ConfigProvider.js";
|
|
4
|
+
const g = "textarea", p = "textarea-bordered", y = "textarea-ghost", S = "textarea-xs", w = "textarea-sm", C = "textarea-md", z = "textarea-lg", N = "textarea-xl", h = "textarea-neutral", j = "textarea-primary", B = "textarea-secondary", X = "textarea-accent", b = "textarea-info", v = "textarea-success", A = "textarea-warning", E = "textarea-error", G = f(
|
|
5
5
|
({
|
|
6
6
|
size: t,
|
|
7
7
|
color: e,
|
|
8
8
|
ghost: r = !1,
|
|
9
9
|
bordered: s = !0,
|
|
10
10
|
className: o = "",
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
"data-testid": n,
|
|
12
|
+
...x
|
|
13
|
+
}, c) => {
|
|
14
|
+
const { componentSize: d } = u(), a = t ?? d ?? "md", i = {
|
|
15
|
+
xs: S,
|
|
16
|
+
sm: w,
|
|
17
|
+
md: C,
|
|
18
|
+
lg: z,
|
|
19
|
+
xl: N
|
|
20
|
+
}, l = {
|
|
21
|
+
neutral: h,
|
|
22
|
+
primary: j,
|
|
23
|
+
secondary: B,
|
|
24
|
+
accent: X,
|
|
25
|
+
info: b,
|
|
26
|
+
success: v,
|
|
27
|
+
warning: A,
|
|
28
|
+
error: E
|
|
29
|
+
}, m = [
|
|
30
|
+
g,
|
|
30
31
|
"w-full",
|
|
31
|
-
s &&
|
|
32
|
-
r &&
|
|
33
|
-
a &&
|
|
34
|
-
e &&
|
|
32
|
+
s && p,
|
|
33
|
+
r && y,
|
|
34
|
+
a && i[a],
|
|
35
|
+
e && l[e],
|
|
35
36
|
o
|
|
36
37
|
].filter(Boolean).join(" ");
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ T("textarea", { ref: c, className: m, "data-testid": n, ...x });
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
|
-
|
|
41
|
+
G.displayName = "Textarea";
|
|
41
42
|
export {
|
|
42
|
-
|
|
43
|
+
G as Textarea
|
|
43
44
|
};
|
|
44
45
|
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sources":["../../src/components/Textarea.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { useConfig } from '../providers/ConfigProvider'\n\n// DaisyUI classes\nconst dTextarea = 'textarea'\nconst dTextareaBordered = 'textarea-bordered'\nconst dTextareaGhost = 'textarea-ghost'\nconst dTextareaXs = 'textarea-xs'\nconst dTextareaSm = 'textarea-sm'\nconst dTextareaMd = 'textarea-md'\nconst dTextareaLg = 'textarea-lg'\nconst dTextareaXl = 'textarea-xl'\nconst dTextareaNeutral = 'textarea-neutral'\nconst dTextareaPrimary = 'textarea-primary'\nconst dTextareaSecondary = 'textarea-secondary'\nconst dTextareaAccent = 'textarea-accent'\nconst dTextareaInfo = 'textarea-info'\nconst dTextareaSuccess = 'textarea-success'\nconst dTextareaWarning = 'textarea-warning'\nconst dTextareaError = 'textarea-error'\n\nexport interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {\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 Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n size,\n color,\n ghost = false,\n bordered = true,\n className = '',\n ...props\n },\n ref\n ) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const sizeClasses = {\n xs: dTextareaXs,\n sm: dTextareaSm,\n md: dTextareaMd,\n lg: dTextareaLg,\n xl: dTextareaXl,\n }\n\n const colorClasses = {\n neutral: dTextareaNeutral,\n primary: dTextareaPrimary,\n secondary: dTextareaSecondary,\n accent: dTextareaAccent,\n info: dTextareaInfo,\n success: dTextareaSuccess,\n warning: dTextareaWarning,\n error: dTextareaError,\n }\n\n const textareaClasses = [\n dTextarea,\n 'w-full',\n bordered && dTextareaBordered,\n ghost && dTextareaGhost,\n effectiveSize && sizeClasses[effectiveSize],\n color && colorClasses[color],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <textarea ref={ref} className={textareaClasses} {...props} />\n }\n)\n\nTextarea.displayName = 'Textarea'\n"],"names":["dTextarea","dTextareaBordered","dTextareaGhost","dTextareaXs","dTextareaSm","dTextareaMd","dTextareaLg","dTextareaXl","dTextareaNeutral","dTextareaPrimary","dTextareaSecondary","dTextareaAccent","dTextareaInfo","dTextareaSuccess","dTextareaWarning","dTextareaError","Textarea","forwardRef","size","color","ghost","bordered","className","props","ref","componentSize","useConfig","effectiveSize","sizeClasses","colorClasses","textareaClasses"],"mappings":";;;AAIA,MAAMA,IAAY,YACZC,IAAoB,qBACpBC,IAAiB,kBACjBC,IAAc,eACdC,IAAc,eACdC,IAAc,eACdC,IAAc,eACdC,IAAc,eACdC,IAAmB,oBACnBC,IAAmB,oBACnBC,IAAqB,sBACrBC,IAAkB,mBAClBC,IAAgB,iBAChBC,IAAmB,oBACnBC,IAAmB,oBACnBC,IAAiB,
|
|
1
|
+
{"version":3,"file":"Textarea.js","sources":["../../src/components/Textarea.tsx"],"sourcesContent":["import React, { forwardRef } from 'react'\nimport { useConfig } from '../providers/ConfigProvider'\n\n// DaisyUI classes\nconst dTextarea = 'textarea'\nconst dTextareaBordered = 'textarea-bordered'\nconst dTextareaGhost = 'textarea-ghost'\nconst dTextareaXs = 'textarea-xs'\nconst dTextareaSm = 'textarea-sm'\nconst dTextareaMd = 'textarea-md'\nconst dTextareaLg = 'textarea-lg'\nconst dTextareaXl = 'textarea-xl'\nconst dTextareaNeutral = 'textarea-neutral'\nconst dTextareaPrimary = 'textarea-primary'\nconst dTextareaSecondary = 'textarea-secondary'\nconst dTextareaAccent = 'textarea-accent'\nconst dTextareaInfo = 'textarea-info'\nconst dTextareaSuccess = 'textarea-success'\nconst dTextareaWarning = 'textarea-warning'\nconst dTextareaError = 'textarea-error'\n\nexport interface TextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> {\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 Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(\n (\n {\n size,\n color,\n ghost = false,\n bordered = true,\n className = '',\n 'data-testid': testId,\n ...props\n },\n ref\n ) => {\n const { componentSize } = useConfig()\n const effectiveSize = size ?? componentSize ?? 'md'\n\n const sizeClasses = {\n xs: dTextareaXs,\n sm: dTextareaSm,\n md: dTextareaMd,\n lg: dTextareaLg,\n xl: dTextareaXl,\n }\n\n const colorClasses = {\n neutral: dTextareaNeutral,\n primary: dTextareaPrimary,\n secondary: dTextareaSecondary,\n accent: dTextareaAccent,\n info: dTextareaInfo,\n success: dTextareaSuccess,\n warning: dTextareaWarning,\n error: dTextareaError,\n }\n\n const textareaClasses = [\n dTextarea,\n 'w-full',\n bordered && dTextareaBordered,\n ghost && dTextareaGhost,\n effectiveSize && sizeClasses[effectiveSize],\n color && colorClasses[color],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <textarea ref={ref} className={textareaClasses} data-testid={testId} {...props} />\n }\n)\n\nTextarea.displayName = 'Textarea'\n"],"names":["dTextarea","dTextareaBordered","dTextareaGhost","dTextareaXs","dTextareaSm","dTextareaMd","dTextareaLg","dTextareaXl","dTextareaNeutral","dTextareaPrimary","dTextareaSecondary","dTextareaAccent","dTextareaInfo","dTextareaSuccess","dTextareaWarning","dTextareaError","Textarea","forwardRef","size","color","ghost","bordered","className","testId","props","ref","componentSize","useConfig","effectiveSize","sizeClasses","colorClasses","textareaClasses","jsx"],"mappings":";;;AAIA,MAAMA,IAAY,YACZC,IAAoB,qBACpBC,IAAiB,kBACjBC,IAAc,eACdC,IAAc,eACdC,IAAc,eACdC,IAAc,eACdC,IAAc,eACdC,IAAmB,oBACnBC,IAAmB,oBACnBC,IAAqB,sBACrBC,IAAkB,mBAClBC,IAAgB,iBAChBC,IAAmB,oBACnBC,IAAmB,oBACnBC,IAAiB,kBAWVC,IAAWC;AAAA,EACtB,CACE;AAAA,IACE,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA,IACR,UAAAC,IAAW;AAAA,IACX,WAAAC,IAAY;AAAA,IACZ,eAAeC;AAAA,IACf,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAM,EAAE,eAAAC,EAAA,IAAkBC,EAAA,GACpBC,IAAgBV,KAAQQ,KAAiB,MAEzCG,IAAc;AAAA,MAClB,IAAI1B;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,MACJ,IAAIC;AAAA,IAAA,GAGAuB,IAAe;AAAA,MACnB,SAAStB;AAAA,MACT,SAASC;AAAA,MACT,WAAWC;AAAA,MACX,QAAQC;AAAA,MACR,MAAMC;AAAA,MACN,SAASC;AAAA,MACT,SAASC;AAAA,MACT,OAAOC;AAAA,IAAA,GAGHgB,IAAkB;AAAA,MACtB/B;AAAA,MACA;AAAA,MACAqB,KAAYpB;AAAA,MACZmB,KAASlB;AAAA,MACT0B,KAAiBC,EAAYD,CAAa;AAAA,MAC1CT,KAASW,EAAaX,CAAK;AAAA,MAC3BG;AAAA,IAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,WAAO,gBAAAU,EAAC,cAAS,KAAAP,GAAU,WAAWM,GAAiB,eAAaR,GAAS,GAAGC,GAAO;AAAA,EACzF;AACF;AAEAR,EAAS,cAAc;"}
|
|
@@ -3,12 +3,14 @@ export interface ThemeControllerSwapProps {
|
|
|
3
3
|
darkTheme?: string;
|
|
4
4
|
onChange?: (theme: string) => void;
|
|
5
5
|
className?: string;
|
|
6
|
+
'data-testid'?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface ThemeControllerDropdownProps {
|
|
8
9
|
themes: string[];
|
|
9
10
|
defaultTheme?: string;
|
|
10
11
|
onChange?: (theme: string) => void;
|
|
11
12
|
className?: string;
|
|
13
|
+
'data-testid'?: string;
|
|
12
14
|
}
|
|
13
15
|
export interface ThemeControllerToggleProps {
|
|
14
16
|
lightTheme?: string;
|
|
@@ -16,10 +18,11 @@ export interface ThemeControllerToggleProps {
|
|
|
16
18
|
onChange?: (theme: string) => void;
|
|
17
19
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
18
20
|
className?: string;
|
|
21
|
+
'data-testid'?: string;
|
|
19
22
|
}
|
|
20
|
-
declare function ThemeControllerSwap({ lightTheme, darkTheme, onChange, className, }: ThemeControllerSwapProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
-
declare function ThemeControllerDropdown({ themes, defaultTheme, onChange, className, }: ThemeControllerDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
declare function ThemeControllerToggle({ lightTheme, darkTheme, onChange, size, className, }: ThemeControllerToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function ThemeControllerSwap({ lightTheme, darkTheme, onChange, className, 'data-testid': testId, }: ThemeControllerSwapProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function ThemeControllerDropdown({ themes, defaultTheme, onChange, className, 'data-testid': testId, }: ThemeControllerDropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function ThemeControllerToggle({ lightTheme, darkTheme, onChange, size, className, 'data-testid': testId, }: ThemeControllerToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
23
26
|
export declare const ThemeController: {
|
|
24
27
|
Swap: typeof ThemeControllerSwap;
|
|
25
28
|
Dropdown: typeof ThemeControllerDropdown;
|