mcr-design-systems 1.0.11 → 1.0.14
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/Icon/generated/RefreshCw01Icon.d.ts +38 -0
- package/dist/components/Icon/generated/RefreshCw01Icon.js +54 -0
- package/dist/components/Icon/generated/RefreshCw01SolidIcon.d.ts +38 -0
- package/dist/components/Icon/generated/RefreshCw01SolidIcon.js +54 -0
- package/dist/components/Icon/generated/RefreshCw_01Icon.d.ts +38 -0
- package/dist/components/Icon/generated/RefreshCw_01SolidIcon.d.ts +38 -0
- package/dist/components/Icon/helper/index.d.ts +1 -1
- package/dist/components/Icon/helper/mapicon.js +3 -1
- package/dist/components/InputBase/index.js +85 -79
- package/dist/components/InputPassword/index.js +23 -23
- package/dist/components/PIN/index.js +83 -83
- package/dist/components/PhoneInput/helper/variants.d.ts +9 -0
- package/dist/components/PhoneInput/helper/variants.js +10 -7
- package/dist/components/PhoneInput/index.js +43 -43
- package/dist/components/TextField/HelperText.js +45 -39
- package/dist/components/TextField/index.js +22 -22
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RefreshCw01IconProps {
|
|
3
|
+
/**
|
|
4
|
+
* Icon size in pixels
|
|
5
|
+
* @default 24
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Icon color - CSS color value
|
|
10
|
+
* @default 'currentColor'
|
|
11
|
+
*/
|
|
12
|
+
color?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class names
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Custom styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/**
|
|
22
|
+
* Click handler
|
|
23
|
+
*/
|
|
24
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* ARIA label for accessibility
|
|
27
|
+
*/
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Title attribute for tooltip
|
|
31
|
+
*/
|
|
32
|
+
title?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* RefreshCw01 icon component
|
|
36
|
+
*/
|
|
37
|
+
export declare const RefreshCw01Icon: React.FC<RefreshCw01IconProps>;
|
|
38
|
+
export default RefreshCw01Icon;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
const A = ({
|
|
4
|
+
size: i = 24,
|
|
5
|
+
color: s = "currentColor",
|
|
6
|
+
className: r,
|
|
7
|
+
style: o,
|
|
8
|
+
onClick: g,
|
|
9
|
+
"aria-label": c,
|
|
10
|
+
title: a
|
|
11
|
+
}) => {
|
|
12
|
+
const C = u.useMemo(() => {
|
|
13
|
+
const t = new DOMParser().parseFromString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
14
|
+
<path d="M2 12C2 6.47715 6.47715 2 12 2C14.7624 2 17.2645 3.12166 19.0732 4.93164C19.7128 5.5716 20.3982 6.3619 21 7.09375V4C21 3.44772 21.4477 3 22 3C22.5523 3 23 3.44772 23 4V10C23 10.5523 22.5523 11 22 11H16C15.4477 11 15 10.5523 15 10C15 9.44772 15.4477 9 16 9H19.9678C19.2756 8.13143 18.4167 7.10277 17.6592 6.34473C16.2102 4.89477 14.2104 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20C15.6457 20 18.7244 17.5604 19.6875 14.2227C19.8407 13.6921 20.3952 13.386 20.9258 13.5391C21.4563 13.6923 21.7625 14.2468 21.6094 14.7773C20.4058 18.9482 16.5605 22 12 22C6.47715 22 2 17.5228 2 12Z" fill="black"/>
|
|
15
|
+
</svg>
|
|
16
|
+
`, "image/svg+xml").querySelector("svg");
|
|
17
|
+
if (!t) return "";
|
|
18
|
+
if (t.setAttribute("width", i.toString()), t.setAttribute("height", i.toString()), t.querySelectorAll(
|
|
19
|
+
"path, circle, rect, polygon, polyline, line, ellipse"
|
|
20
|
+
).forEach((e) => {
|
|
21
|
+
const n = e.getAttribute("fill"), l = e.getAttribute("stroke");
|
|
22
|
+
n && n !== "none" && e.setAttribute("fill", s), l && l !== "none" && e.setAttribute("stroke", s);
|
|
23
|
+
}), r) {
|
|
24
|
+
const e = t.getAttribute("class") || "";
|
|
25
|
+
t.setAttribute(
|
|
26
|
+
"class",
|
|
27
|
+
`${e} ${r}`.trim()
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return new XMLSerializer().serializeToString(t);
|
|
31
|
+
}, [i, s, r]);
|
|
32
|
+
return /* @__PURE__ */ f(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: r,
|
|
36
|
+
style: {
|
|
37
|
+
display: "inline-flex",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
justifyContent: "center",
|
|
40
|
+
flexShrink: 0,
|
|
41
|
+
lineHeight: 0,
|
|
42
|
+
...o
|
|
43
|
+
},
|
|
44
|
+
onClick: g,
|
|
45
|
+
"aria-label": c || "refresh-cw-01 icon",
|
|
46
|
+
title: a,
|
|
47
|
+
dangerouslySetInnerHTML: { __html: C }
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
A as RefreshCw01Icon,
|
|
53
|
+
A as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RefreshCw01SolidIconProps {
|
|
3
|
+
/**
|
|
4
|
+
* Icon size in pixels
|
|
5
|
+
* @default 24
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Icon color - CSS color value
|
|
10
|
+
* @default 'currentColor'
|
|
11
|
+
*/
|
|
12
|
+
color?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class names
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Custom styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/**
|
|
22
|
+
* Click handler
|
|
23
|
+
*/
|
|
24
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* ARIA label for accessibility
|
|
27
|
+
*/
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Title attribute for tooltip
|
|
31
|
+
*/
|
|
32
|
+
title?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* RefreshCw01Solid icon component
|
|
36
|
+
*/
|
|
37
|
+
export declare const RefreshCw01SolidIcon: React.FC<RefreshCw01SolidIconProps>;
|
|
38
|
+
export default RefreshCw01SolidIcon;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import u from "react";
|
|
3
|
+
const A = ({
|
|
4
|
+
size: i = 24,
|
|
5
|
+
color: s = "currentColor",
|
|
6
|
+
className: r,
|
|
7
|
+
style: o,
|
|
8
|
+
onClick: g,
|
|
9
|
+
"aria-label": c,
|
|
10
|
+
title: a
|
|
11
|
+
}) => {
|
|
12
|
+
const C = u.useMemo(() => {
|
|
13
|
+
const t = new DOMParser().parseFromString(`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
14
|
+
<path d="M17.6589 6.34511C16.21 4.89514 14.2105 4 12.0001 4C7.58183 4 4.0001 7.58172 4.0001 12C4.0001 16.4183 7.58183 20 12.0001 20C15.6458 20 18.7244 17.5605 19.6875 14.2227C19.8407 13.6921 20.395 13.3861 20.9256 13.5392C21.4562 13.6923 21.7623 14.2466 21.6091 14.7773C20.4056 18.9481 16.5606 22 12.0001 22C6.47726 22 2.0001 17.5228 2.0001 12C2.0001 6.47715 6.47726 2 12.0001 2C14.7625 2 17.2649 3.12139 19.0736 4.93138C19.7097 5.56789 20.3942 6.35772 21 7.09434V4C21 3.44772 21.4477 3 22 3C22.5523 3 23 3.44772 23 4V10C23 10.5523 22.5523 11 22 11H16C15.4477 11 15 10.5523 15 10C15 9.44772 15.4477 9 16 9H19.9693C19.2852 8.14144 18.4232 7.10987 17.6589 6.34511Z" fill="black"/>
|
|
15
|
+
</svg>
|
|
16
|
+
`, "image/svg+xml").querySelector("svg");
|
|
17
|
+
if (!t) return "";
|
|
18
|
+
if (t.setAttribute("width", i.toString()), t.setAttribute("height", i.toString()), t.querySelectorAll(
|
|
19
|
+
"path, circle, rect, polygon, polyline, line, ellipse"
|
|
20
|
+
).forEach((e) => {
|
|
21
|
+
const n = e.getAttribute("fill"), l = e.getAttribute("stroke");
|
|
22
|
+
n && n !== "none" && e.setAttribute("fill", s), l && l !== "none" && e.setAttribute("stroke", s);
|
|
23
|
+
}), r) {
|
|
24
|
+
const e = t.getAttribute("class") || "";
|
|
25
|
+
t.setAttribute(
|
|
26
|
+
"class",
|
|
27
|
+
`${e} ${r}`.trim()
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return new XMLSerializer().serializeToString(t);
|
|
31
|
+
}, [i, s, r]);
|
|
32
|
+
return /* @__PURE__ */ f(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: r,
|
|
36
|
+
style: {
|
|
37
|
+
display: "inline-flex",
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
justifyContent: "center",
|
|
40
|
+
flexShrink: 0,
|
|
41
|
+
lineHeight: 0,
|
|
42
|
+
...o
|
|
43
|
+
},
|
|
44
|
+
onClick: g,
|
|
45
|
+
"aria-label": c || "refresh-cw-01 icon",
|
|
46
|
+
title: a,
|
|
47
|
+
dangerouslySetInnerHTML: { __html: C }
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
A as RefreshCw01SolidIcon,
|
|
53
|
+
A as default
|
|
54
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RefreshCw_01IconProps {
|
|
3
|
+
/**
|
|
4
|
+
* Icon size in pixels
|
|
5
|
+
* @default 24
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Icon color - CSS color value
|
|
10
|
+
* @default 'currentColor'
|
|
11
|
+
*/
|
|
12
|
+
color?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class names
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Custom styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/**
|
|
22
|
+
* Click handler
|
|
23
|
+
*/
|
|
24
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* ARIA label for accessibility
|
|
27
|
+
*/
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Title attribute for tooltip
|
|
31
|
+
*/
|
|
32
|
+
title?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* RefreshCw_01 icon component
|
|
36
|
+
*/
|
|
37
|
+
export declare const RefreshCw_01Icon: React.FC<RefreshCw_01IconProps>;
|
|
38
|
+
export default RefreshCw_01Icon;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RefreshCw_01SolidIconProps {
|
|
3
|
+
/**
|
|
4
|
+
* Icon size in pixels
|
|
5
|
+
* @default 24
|
|
6
|
+
*/
|
|
7
|
+
size?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Icon color - CSS color value
|
|
10
|
+
* @default 'currentColor'
|
|
11
|
+
*/
|
|
12
|
+
color?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional CSS class names
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Custom styles
|
|
19
|
+
*/
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/**
|
|
22
|
+
* Click handler
|
|
23
|
+
*/
|
|
24
|
+
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
25
|
+
/**
|
|
26
|
+
* ARIA label for accessibility
|
|
27
|
+
*/
|
|
28
|
+
'aria-label'?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Title attribute for tooltip
|
|
31
|
+
*/
|
|
32
|
+
title?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* RefreshCw_01Solid icon component
|
|
36
|
+
*/
|
|
37
|
+
export declare const RefreshCw_01SolidIcon: React.FC<RefreshCw_01SolidIconProps>;
|
|
38
|
+
export default RefreshCw_01SolidIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type IconName = 'activity' | 'activity-heart' | 'alarm-clock' | 'alarm-clock-check' | 'alert-circle' | 'alert-octagon' | 'alert-triangle' | 'align-left' | 'align-right' | 'bell-01' | 'calendar' | 'camera-01' | 'check' | 'check-circle' | 'chevron-down' | 'chevron-left' | 'chevron-left-double' | 'chevron-right' | 'chevron-right-double' | 'chevron-up' | 'circle' | 'download-01' | 'eye' | 'eye-off' | 'filter-funnel-01' | 'help-circle' | 'info-circle' | 'loading-01' | 'minus' | 'plus' | 'search-lg' | 'search-md' | 'user-03' | 'x-circle' | 'x-close';
|
|
1
|
+
export type IconName = 'activity' | 'activity-heart' | 'alarm-clock' | 'alarm-clock-check' | 'alert-circle' | 'alert-octagon' | 'alert-triangle' | 'align-left' | 'align-right' | 'bell-01' | 'calendar' | 'camera-01' | 'check' | 'check-circle' | 'chevron-down' | 'chevron-left' | 'chevron-left-double' | 'chevron-right' | 'chevron-right-double' | 'chevron-up' | 'circle' | 'download-01' | 'eye' | 'eye-off' | 'filter-funnel-01' | 'help-circle' | 'info-circle' | 'loading-01' | 'minus' | 'plus' | 'refresh-cw-01' | 'search-lg' | 'search-md' | 'user-03' | 'x-circle' | 'x-close';
|
|
@@ -68,7 +68,9 @@ const i = {
|
|
|
68
68
|
"chevron-left-double-solid": () => import("../generated/ChevronLeftDoubleSolidIcon.js"),
|
|
69
69
|
"chevron-left-solid": () => import("../generated/ChevronLeftSolidIcon.js"),
|
|
70
70
|
"circle-solid": () => import("../generated/CircleSolidIcon.js"),
|
|
71
|
-
"user-03-solid": () => import("../generated/User03SolidIcon.js")
|
|
71
|
+
"user-03-solid": () => import("../generated/User03SolidIcon.js"),
|
|
72
|
+
"refresh-cw-01": () => import("../generated/RefreshCw01Icon.js"),
|
|
73
|
+
"refresh-cw-01-solid": () => import("../generated/RefreshCw01SolidIcon.js")
|
|
72
74
|
};
|
|
73
75
|
export {
|
|
74
76
|
i as MAP_ICON
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { inputBaseVariants as
|
|
4
|
-
import
|
|
5
|
-
import { cn as
|
|
6
|
-
import { dataTestId as
|
|
7
|
-
const
|
|
1
|
+
import { jsxs as I, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import r, { forwardRef as D, useState as H, useMemo as B, useEffect as R, memo as _ } from "react";
|
|
3
|
+
import { inputBaseVariants as F, textAreaVariants as K } from "./variants.js";
|
|
4
|
+
import W from "../Icon/Icon.js";
|
|
5
|
+
import { cn as f } from "../../shared/utils/cn.js";
|
|
6
|
+
import { dataTestId as q } from "../../shared/utils/dataTestId.js";
|
|
7
|
+
const A = (n) => {
|
|
8
8
|
switch (n) {
|
|
9
9
|
case "sm":
|
|
10
10
|
return 16;
|
|
@@ -15,127 +15,134 @@ const q = (n) => {
|
|
|
15
15
|
default:
|
|
16
16
|
return 20;
|
|
17
17
|
}
|
|
18
|
-
}, N =
|
|
18
|
+
}, N = D(
|
|
19
19
|
({
|
|
20
20
|
disabled: n,
|
|
21
21
|
readOnly: a,
|
|
22
|
-
endAdornment:
|
|
23
|
-
className:
|
|
24
|
-
color:
|
|
25
|
-
sizeVariant:
|
|
26
|
-
startAdornment:
|
|
27
|
-
InputComponent:
|
|
22
|
+
endAdornment: l,
|
|
23
|
+
className: V,
|
|
24
|
+
color: w,
|
|
25
|
+
sizeVariant: v = "md",
|
|
26
|
+
startAdornment: b,
|
|
27
|
+
InputComponent: y,
|
|
28
28
|
containerProps: z,
|
|
29
|
-
containerRef:
|
|
30
|
-
width:
|
|
31
|
-
iconsSize:
|
|
29
|
+
containerRef: T,
|
|
30
|
+
width: C,
|
|
31
|
+
iconsSize: S,
|
|
32
32
|
error: j,
|
|
33
33
|
clearText: M,
|
|
34
34
|
optionalProps: h,
|
|
35
35
|
// inputSize,
|
|
36
36
|
...e
|
|
37
37
|
}, k) => {
|
|
38
|
-
const [L,
|
|
38
|
+
const [L, g] = H(!1), o = S || A(v), m = B(
|
|
39
39
|
() => `inputbase-input-${Math.random().toString(36).substring(2, 9)}`,
|
|
40
40
|
[]
|
|
41
|
-
),
|
|
41
|
+
), p = B(
|
|
42
42
|
() => `inputbase-textarea-${Math.random().toString(36).substring(2, 9)}`,
|
|
43
43
|
[]
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
R(() => {
|
|
46
46
|
const t = e.value;
|
|
47
47
|
if (t !== void 0) {
|
|
48
|
-
|
|
48
|
+
g(String(t).length > 0);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
|
|
51
|
+
const i = () => {
|
|
52
|
+
const c = e.type === "textarea" ? document.getElementById(p) : document.getElementById(m);
|
|
53
|
+
if (c) {
|
|
54
|
+
const x = () => {
|
|
55
|
+
g(c.value.length > 0);
|
|
56
56
|
};
|
|
57
|
-
return
|
|
58
|
-
|
|
57
|
+
return x(), c.addEventListener("input", x), () => {
|
|
58
|
+
c.removeEventListener("input", x);
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
},
|
|
62
|
-
if (!
|
|
63
|
-
const
|
|
64
|
-
|
|
61
|
+
}, d = i();
|
|
62
|
+
if (!d) {
|
|
63
|
+
const c = setTimeout(() => {
|
|
64
|
+
i();
|
|
65
65
|
}, 100);
|
|
66
|
-
return () => clearTimeout(
|
|
66
|
+
return () => clearTimeout(c);
|
|
67
67
|
}
|
|
68
|
-
return
|
|
69
|
-
}, [e.type, e.value,
|
|
70
|
-
const
|
|
71
|
-
|
|
68
|
+
return d;
|
|
69
|
+
}, [e.type, e.value, m, p]);
|
|
70
|
+
const E = M && L ? /* @__PURE__ */ u(
|
|
71
|
+
W,
|
|
72
72
|
{
|
|
73
73
|
name: "x-circle",
|
|
74
74
|
variant: "solid",
|
|
75
|
-
size:
|
|
76
|
-
className: "cursor-pointer
|
|
75
|
+
size: o,
|
|
76
|
+
className: "cursor-pointer text-fg-neutral-subtle",
|
|
77
77
|
onClick: () => {
|
|
78
|
-
|
|
79
|
-
const t = e.type === "textarea" ? document.getElementById(
|
|
80
|
-
if (t)
|
|
78
|
+
g(!1);
|
|
79
|
+
const t = e.type === "textarea" ? document.getElementById(p) : document.getElementById(m);
|
|
80
|
+
if (t) {
|
|
81
81
|
if (t.value = "", e.onChange) {
|
|
82
|
-
const
|
|
82
|
+
const i = {
|
|
83
83
|
target: t,
|
|
84
84
|
currentTarget: t,
|
|
85
85
|
type: "change",
|
|
86
86
|
bubbles: !0
|
|
87
87
|
};
|
|
88
|
-
e.onChange(
|
|
88
|
+
e.onChange(i);
|
|
89
89
|
} else {
|
|
90
|
-
const
|
|
91
|
-
t.dispatchEvent(
|
|
90
|
+
const i = new Event("input", { bubbles: !0 }), d = new Event("change", { bubbles: !0 });
|
|
91
|
+
t.dispatchEvent(i), t.dispatchEvent(d);
|
|
92
92
|
}
|
|
93
|
+
t?.focus();
|
|
94
|
+
}
|
|
93
95
|
},
|
|
94
96
|
"aria-label": "Clear text"
|
|
95
97
|
}
|
|
96
|
-
) : null,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
) : null, s = E && l ? /* @__PURE__ */ I("div", { className: "flex items-center gap-2", children: [
|
|
99
|
+
E,
|
|
100
|
+
r.isValidElement(l) ? r.cloneElement(
|
|
101
|
+
l,
|
|
102
|
+
{
|
|
103
|
+
size: o
|
|
104
|
+
}
|
|
105
|
+
) : l
|
|
106
|
+
] }) : E || l, $ = {
|
|
100
107
|
sm: "h-4",
|
|
101
108
|
md: "h-5",
|
|
102
109
|
lg: "h-6"
|
|
103
110
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ u("div", { className: "relative justify-center items-center", children: /* @__PURE__ */ I(
|
|
105
112
|
"div",
|
|
106
113
|
{
|
|
107
|
-
...
|
|
108
|
-
ref:
|
|
114
|
+
...q("InputBase"),
|
|
115
|
+
ref: T,
|
|
109
116
|
...z,
|
|
110
|
-
className:
|
|
117
|
+
className: F({
|
|
111
118
|
disabled: !!n,
|
|
112
|
-
className:
|
|
113
|
-
color:
|
|
114
|
-
size: e?.type === "textarea" ? void 0 :
|
|
119
|
+
className: V,
|
|
120
|
+
color: w,
|
|
121
|
+
size: e?.type === "textarea" ? void 0 : v,
|
|
115
122
|
readOnly: !!a,
|
|
116
123
|
error: !!j
|
|
117
124
|
}),
|
|
118
|
-
style: { minWidth:
|
|
125
|
+
style: { minWidth: C ?? "100%" },
|
|
119
126
|
children: [
|
|
120
|
-
|
|
127
|
+
b && /* @__PURE__ */ u(
|
|
121
128
|
"div",
|
|
122
129
|
{
|
|
123
|
-
className:
|
|
130
|
+
className: f("flex cursor-pointer items-center justify-center", {
|
|
124
131
|
"color-icon-disabled": n || a,
|
|
125
132
|
"cursor-pointer": !n || a
|
|
126
133
|
}),
|
|
127
|
-
children:
|
|
134
|
+
children: r.cloneElement(b, {
|
|
128
135
|
// color: disabled || readOnly ? 'disabled' : 'currentColor',
|
|
129
|
-
size:
|
|
136
|
+
size: o
|
|
130
137
|
})
|
|
131
138
|
}
|
|
132
139
|
),
|
|
133
|
-
|
|
134
|
-
|
|
140
|
+
y ? r.cloneElement(
|
|
141
|
+
y,
|
|
135
142
|
{
|
|
136
|
-
id: e?.type === "textarea" ?
|
|
137
|
-
className:
|
|
138
|
-
e?.type === "textarea" ?
|
|
143
|
+
id: e?.type === "textarea" ? p : void 0,
|
|
144
|
+
className: f(
|
|
145
|
+
e?.type === "textarea" ? K({
|
|
139
146
|
size: h?.sizeTextArea,
|
|
140
147
|
disabled: !!n,
|
|
141
148
|
readOnly: !!a
|
|
@@ -147,13 +154,13 @@ const q = (n) => {
|
|
|
147
154
|
...e
|
|
148
155
|
},
|
|
149
156
|
null
|
|
150
|
-
) : /* @__PURE__ */
|
|
157
|
+
) : /* @__PURE__ */ u(
|
|
151
158
|
"input",
|
|
152
159
|
{
|
|
153
|
-
id: e.type === "textarea" ? void 0 :
|
|
154
|
-
className:
|
|
160
|
+
id: e.type === "textarea" ? void 0 : m,
|
|
161
|
+
className: f(
|
|
155
162
|
"w-full appearance-none bg-transparent font-sans outline-none",
|
|
156
|
-
$[
|
|
163
|
+
$[v || "md"]
|
|
157
164
|
),
|
|
158
165
|
ref: k,
|
|
159
166
|
disabled: n || a,
|
|
@@ -163,20 +170,19 @@ const q = (n) => {
|
|
|
163
170
|
}
|
|
164
171
|
}
|
|
165
172
|
),
|
|
166
|
-
|
|
173
|
+
s && /* @__PURE__ */ u(
|
|
167
174
|
"div",
|
|
168
175
|
{
|
|
169
|
-
className:
|
|
176
|
+
className: f("max-h flex items-center justify-center", {
|
|
170
177
|
"color-icon-disabled": n || a,
|
|
171
178
|
"cursor-pointer": !n || a
|
|
172
179
|
}),
|
|
173
|
-
children:
|
|
174
|
-
|
|
180
|
+
children: r.isValidElement(s) && s.type === "div" ? s : r.isValidElement(s) ? r.cloneElement(
|
|
181
|
+
s,
|
|
175
182
|
{
|
|
176
|
-
|
|
177
|
-
size: g
|
|
183
|
+
size: o
|
|
178
184
|
}
|
|
179
|
-
) :
|
|
185
|
+
) : s
|
|
180
186
|
}
|
|
181
187
|
)
|
|
182
188
|
]
|
|
@@ -185,7 +191,7 @@ const q = (n) => {
|
|
|
185
191
|
}
|
|
186
192
|
);
|
|
187
193
|
N.displayName = "InputBase";
|
|
188
|
-
const P =
|
|
194
|
+
const P = _(N);
|
|
189
195
|
export {
|
|
190
196
|
P as default
|
|
191
197
|
};
|
|
@@ -5,49 +5,49 @@ import I from "../TextField/HelperText.js";
|
|
|
5
5
|
import v from "../Icon/Icon.js";
|
|
6
6
|
const N = y(
|
|
7
7
|
({
|
|
8
|
-
helperText:
|
|
9
|
-
error:
|
|
10
|
-
showHelperIcon:
|
|
8
|
+
helperText: r,
|
|
9
|
+
error: a = !1,
|
|
10
|
+
showHelperIcon: n = !0,
|
|
11
11
|
helperIconCustom: l,
|
|
12
12
|
helperTextClassName: d,
|
|
13
13
|
defaultVisible: m = !1,
|
|
14
|
-
visible:
|
|
14
|
+
visible: t,
|
|
15
15
|
onVisibilityChange: c,
|
|
16
|
-
className:
|
|
17
|
-
...
|
|
18
|
-
},
|
|
19
|
-
const [p, w] = g(m),
|
|
20
|
-
if (
|
|
16
|
+
className: u,
|
|
17
|
+
...s
|
|
18
|
+
}, f) => {
|
|
19
|
+
const [p, w] = g(m), o = t !== void 0 ? t : p, b = () => {
|
|
20
|
+
if (s.disabled)
|
|
21
21
|
return;
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const i = !o;
|
|
23
|
+
t === void 0 && w(i), c?.(i);
|
|
24
24
|
};
|
|
25
25
|
return /* @__PURE__ */ x("div", { className: "w-full [&_input[type='password']::-ms-reveal]:hidden [&_input[type='password']::-ms-clear]:hidden", children: [
|
|
26
26
|
/* @__PURE__ */ e(
|
|
27
27
|
h,
|
|
28
28
|
{
|
|
29
|
-
...
|
|
30
|
-
ref:
|
|
31
|
-
type:
|
|
32
|
-
error:
|
|
33
|
-
className:
|
|
29
|
+
...s,
|
|
30
|
+
ref: f,
|
|
31
|
+
type: o ? "text" : "password",
|
|
32
|
+
error: a,
|
|
33
|
+
className: u,
|
|
34
|
+
clearText: !0,
|
|
34
35
|
endAdornment: /* @__PURE__ */ e(
|
|
35
36
|
v,
|
|
36
37
|
{
|
|
37
|
-
name:
|
|
38
|
-
|
|
39
|
-
className: `transition-colors ${t.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-rest"}`,
|
|
38
|
+
name: o ? "eye" : "eye-off",
|
|
39
|
+
className: `transition-colors ${s.disabled ? "bg-bg-input-disabled cursor-not-allowed" : "cursor-pointer hover:text-fg-neutral-rest text-fg-neutral-rest"}`,
|
|
40
40
|
onClick: b
|
|
41
41
|
}
|
|
42
42
|
)
|
|
43
43
|
}
|
|
44
44
|
),
|
|
45
|
-
|
|
45
|
+
r && /* @__PURE__ */ e("div", { className: "mt-1", children: /* @__PURE__ */ e(
|
|
46
46
|
I,
|
|
47
47
|
{
|
|
48
|
-
text:
|
|
49
|
-
error:
|
|
50
|
-
haveIcon:
|
|
48
|
+
text: r,
|
|
49
|
+
error: a,
|
|
50
|
+
haveIcon: n,
|
|
51
51
|
iconsCustom: l,
|
|
52
52
|
className: d
|
|
53
53
|
}
|