@adam-milo/ui 1.0.32 → 1.0.34
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/index.cjs +1 -1
- package/dist/index.js +58 -22
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +94 -56
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +199 -40
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +305 -105
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +260 -74
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +135 -27
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +52 -469
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +57 -111
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +101 -20
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +76 -21
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +25 -29
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +6 -4
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +468 -31
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +155 -41
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +42 -12
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +38 -0
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +32 -287
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +115 -13
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +55 -0
- package/dist/index27.cjs +1 -0
- package/dist/index27.js +45 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +53 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +55 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +33 -33
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +72 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +14 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +332 -0
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +386 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +16 -0
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +59 -11
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +19 -35
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +11 -101
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +502 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +11 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +39 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +64 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +212 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +14 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +293 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +46 -97
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +18 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +129 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +43 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +99 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +71 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +36 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +14 -0
- package/dist/index77.cjs +1 -0
- package/dist/index77.js +17 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +6 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +297 -0
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +97 -88
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +25 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +39 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +625 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +721 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +154 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +173 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +55 -197
- package/dist/src/components/core/button/Button.component.d.ts +13 -7
- package/dist/src/components/core/button/Button.component.d.ts.map +1 -1
- package/dist/src/components/core/icon/Icon.component.d.ts +1 -1
- package/dist/src/components/core/icon/Icon.component.d.ts.map +1 -1
- package/dist/src/components/core/icon-button/IconButton.component.d.ts +36 -0
- package/dist/src/components/core/icon-button/IconButton.component.d.ts.map +1 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts +79 -0
- package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts.map +1 -0
- package/dist/src/components/feedback/spinner/Spinner.component.d.ts +62 -0
- package/dist/src/components/feedback/spinner/Spinner.component.d.ts.map +1 -0
- package/dist/src/components/forms/input/Input.component.d.ts +5 -0
- package/dist/src/components/forms/input/Input.component.d.ts.map +1 -1
- package/dist/src/components/forms/otp-input/OTPInput.component.d.ts +82 -0
- package/dist/src/components/forms/otp-input/OTPInput.component.d.ts.map +1 -0
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts +96 -0
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -0
- package/dist/src/components/forms/phone-input/countries.d.ts +93 -0
- package/dist/src/components/forms/phone-input/countries.d.ts.map +1 -0
- package/dist/src/components/forms/select/Select.component.d.ts +5 -1
- package/dist/src/components/forms/select/Select.component.d.ts.map +1 -1
- package/dist/src/components/forms/toggle/Toggle.component.d.ts +80 -0
- package/dist/src/components/forms/toggle/Toggle.component.d.ts.map +1 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts +86 -0
- package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts.map +1 -0
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts +36 -2
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -1
- package/dist/src/components/typography/heading/Heading.component.d.ts +92 -0
- package/dist/src/components/typography/heading/Heading.component.d.ts.map +1 -0
- package/dist/src/components/typography/link/Link.component.d.ts +80 -0
- package/dist/src/components/typography/link/Link.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +24 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
- /package/dist/{index35.cjs → index50.cjs} +0 -0
- /package/dist/{index35.js → index50.js} +0 -0
- /package/dist/{index42.cjs → index61.cjs} +0 -0
- /package/dist/{index42.js → index61.js} +0 -0
package/dist/index21.js
CHANGED
|
@@ -1,55 +1,169 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import
|
|
3
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
4
|
+
import { cn } from "./index31.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
import { Icon } from "@adam-milo/icons";
|
|
7
|
+
const Dialog = DialogPrimitive.Root;
|
|
8
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
9
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
10
|
+
const DialogClose = DialogPrimitive.Close;
|
|
11
|
+
const DialogCloseButton = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
12
|
+
const finalDataCy = dataCy || "dialog-close-button";
|
|
13
|
+
const finalTestId = dataTestId || "dialog-close-button";
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
DialogPrimitive.Close,
|
|
16
|
+
{
|
|
17
|
+
ref,
|
|
18
|
+
className: cn("dialog-close-button", className),
|
|
19
|
+
"data-cy": finalDataCy,
|
|
20
|
+
"data-testid": finalTestId,
|
|
21
|
+
"aria-label": "Close dialog",
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ jsx(Icon, { name: "Cross2Icon", size: "sm", decorative: true })
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
DialogCloseButton.displayName = "DialogCloseButton";
|
|
28
|
+
const DialogIcon = ({
|
|
29
|
+
children,
|
|
30
|
+
variant = "default",
|
|
31
|
+
className,
|
|
32
|
+
"data-cy": dataCy,
|
|
33
|
+
"data-testid": dataTestId,
|
|
34
|
+
...props
|
|
35
|
+
}) => {
|
|
36
|
+
const finalDataCy = dataCy || "dialog-icon";
|
|
37
|
+
const finalTestId = dataTestId || "dialog-icon";
|
|
38
|
+
return /* @__PURE__ */ jsx(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: cn("dialog-icon", `dialog-icon--${variant}`, className),
|
|
42
|
+
"data-cy": finalDataCy,
|
|
43
|
+
"data-testid": finalTestId,
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
...props,
|
|
46
|
+
children
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
DialogIcon.displayName = "DialogIcon";
|
|
51
|
+
const DialogOverlay = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
52
|
+
const finalDataCy = dataCy || "dialog-overlay";
|
|
53
|
+
const finalTestId = dataTestId || "dialog-overlay";
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
DialogPrimitive.Overlay,
|
|
56
|
+
{
|
|
57
|
+
ref,
|
|
58
|
+
className: cn("dialog-overlay", className),
|
|
59
|
+
"data-cy": finalDataCy,
|
|
60
|
+
"data-testid": finalTestId,
|
|
61
|
+
...props
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
66
|
+
const DialogContent = forwardRef(({ className, children, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
67
|
+
const finalDataCy = dataCy || "dialog-content";
|
|
68
|
+
const finalTestId = dataTestId || "dialog-content";
|
|
69
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
DialogPrimitive.Content,
|
|
30
73
|
{
|
|
31
74
|
ref,
|
|
32
|
-
className: cn(
|
|
33
|
-
"grid",
|
|
34
|
-
`grid--columns-${columns}`,
|
|
35
|
-
rows && `grid--rows-${rows}`,
|
|
36
|
-
`grid--gap-${gap}`,
|
|
37
|
-
rowGap && `grid--row-gap-${rowGap}`,
|
|
38
|
-
columnGap && `grid--column-gap-${columnGap}`,
|
|
39
|
-
`grid--align-${align}`,
|
|
40
|
-
`grid--justify-${justify}`,
|
|
41
|
-
className
|
|
42
|
-
),
|
|
43
|
-
style: customStyle,
|
|
75
|
+
className: cn("dialog-content", className),
|
|
44
76
|
"data-cy": finalDataCy,
|
|
45
77
|
"data-testid": finalTestId,
|
|
46
78
|
...props,
|
|
47
79
|
children
|
|
48
80
|
}
|
|
81
|
+
)
|
|
82
|
+
] });
|
|
83
|
+
});
|
|
84
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
85
|
+
const DialogHeader = ({
|
|
86
|
+
centered = false,
|
|
87
|
+
className,
|
|
88
|
+
"data-cy": dataCy,
|
|
89
|
+
"data-testid": dataTestId,
|
|
90
|
+
...props
|
|
91
|
+
}) => {
|
|
92
|
+
const finalDataCy = dataCy || "dialog-header";
|
|
93
|
+
const finalTestId = dataTestId || "dialog-header";
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: cn("dialog-header", centered && "dialog-header--centered", className),
|
|
98
|
+
"data-cy": finalDataCy,
|
|
99
|
+
"data-testid": finalTestId,
|
|
100
|
+
...props
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
};
|
|
104
|
+
DialogHeader.displayName = "DialogHeader";
|
|
105
|
+
const DialogFooter = ({
|
|
106
|
+
className,
|
|
107
|
+
"data-cy": dataCy,
|
|
108
|
+
"data-testid": dataTestId,
|
|
109
|
+
...props
|
|
110
|
+
}) => {
|
|
111
|
+
const finalDataCy = dataCy || "dialog-footer";
|
|
112
|
+
const finalTestId = dataTestId || "dialog-footer";
|
|
113
|
+
return /* @__PURE__ */ jsx(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
className: cn("dialog-footer", className),
|
|
117
|
+
"data-cy": finalDataCy,
|
|
118
|
+
"data-testid": finalTestId,
|
|
119
|
+
...props
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
};
|
|
123
|
+
DialogFooter.displayName = "DialogFooter";
|
|
124
|
+
const DialogTitle = forwardRef(
|
|
125
|
+
({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
126
|
+
const finalDataCy = dataCy || "dialog-title";
|
|
127
|
+
const finalTestId = dataTestId || "dialog-title";
|
|
128
|
+
return /* @__PURE__ */ jsx(
|
|
129
|
+
DialogPrimitive.Title,
|
|
130
|
+
{
|
|
131
|
+
ref,
|
|
132
|
+
className: cn("dialog-title", className),
|
|
133
|
+
"data-cy": finalDataCy,
|
|
134
|
+
"data-testid": finalTestId,
|
|
135
|
+
...props
|
|
136
|
+
}
|
|
49
137
|
);
|
|
50
138
|
}
|
|
51
139
|
);
|
|
52
|
-
|
|
140
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
141
|
+
const DialogDescription = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
142
|
+
const finalDataCy = dataCy || "dialog-description";
|
|
143
|
+
const finalTestId = dataTestId || "dialog-description";
|
|
144
|
+
return /* @__PURE__ */ jsx(
|
|
145
|
+
DialogPrimitive.Description,
|
|
146
|
+
{
|
|
147
|
+
ref,
|
|
148
|
+
className: cn("dialog-description", className),
|
|
149
|
+
"data-cy": finalDataCy,
|
|
150
|
+
"data-testid": finalTestId,
|
|
151
|
+
...props
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
});
|
|
155
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
53
156
|
export {
|
|
54
|
-
|
|
157
|
+
Dialog,
|
|
158
|
+
DialogClose,
|
|
159
|
+
DialogCloseButton,
|
|
160
|
+
DialogContent,
|
|
161
|
+
DialogDescription,
|
|
162
|
+
DialogFooter,
|
|
163
|
+
DialogHeader,
|
|
164
|
+
DialogIcon,
|
|
165
|
+
DialogOverlay,
|
|
166
|
+
DialogPortal,
|
|
167
|
+
DialogTitle,
|
|
168
|
+
DialogTrigger
|
|
55
169
|
};
|
package/dist/index22.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),e=require("./index31.cjs");;/* empty css */const s=a.forwardRef(({direction:a="vertical",spacing:s="4",align:c="stretch",justify:r="start",wrap:i=!1,className:n,children:d,"data-cy":l,"data-testid":o,...u},k)=>{const p=l||`stack-${a}`,j=o||`stack-${a}`;return t.jsx("div",{ref:k,className:e.cn("stack",`stack--${a}`,`stack--spacing-${s}`,`stack--align-${c}`,`stack--justify-${r}`,i&&"stack--wrap",n),"data-cy":p,"data-testid":j,...u,children:d})});s.displayName="Stack",exports.Stack=s;
|
package/dist/index22.js
CHANGED
|
@@ -1,14 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "./index31.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const Stack = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
direction = "vertical",
|
|
8
|
+
spacing = "4",
|
|
9
|
+
align = "stretch",
|
|
10
|
+
justify = "start",
|
|
11
|
+
wrap = false,
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
"data-cy": dataCy,
|
|
15
|
+
"data-testid": dataTestId,
|
|
16
|
+
...props
|
|
17
|
+
}, ref) => {
|
|
18
|
+
const finalDataCy = dataCy || `stack-${direction}`;
|
|
19
|
+
const finalTestId = dataTestId || `stack-${direction}`;
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
"div",
|
|
22
|
+
{
|
|
23
|
+
ref,
|
|
24
|
+
className: cn(
|
|
25
|
+
"stack",
|
|
26
|
+
`stack--${direction}`,
|
|
27
|
+
`stack--spacing-${spacing}`,
|
|
28
|
+
`stack--align-${align}`,
|
|
29
|
+
`stack--justify-${justify}`,
|
|
30
|
+
wrap && "stack--wrap",
|
|
31
|
+
className
|
|
32
|
+
),
|
|
33
|
+
"data-cy": finalDataCy,
|
|
34
|
+
"data-testid": finalTestId,
|
|
35
|
+
...props,
|
|
36
|
+
children
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
Stack.displayName = "Stack";
|
|
11
42
|
export {
|
|
12
|
-
|
|
13
|
-
generateId
|
|
43
|
+
Stack
|
|
14
44
|
};
|
package/dist/index23.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("./index31.cjs");;/* empty css */const a=t.forwardRef(({className:t,maxWidth:a="lg",padding:n="md","data-cy":i,"data-testid":d,children:c,...s},o)=>{const l=i||"container",u=d||"container";return e.jsx("div",{ref:o,className:r.cn("container",`container--max-width-${a}`,`container--padding-${n}`,t),"data-cy":l,"data-testid":u,...s,children:c})});a.displayName="Container",exports.Container=a;
|
package/dist/index23.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "./index31.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const Container = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
className,
|
|
8
|
+
maxWidth = "lg",
|
|
9
|
+
padding = "md",
|
|
10
|
+
"data-cy": dataCy,
|
|
11
|
+
"data-testid": dataTestId,
|
|
12
|
+
children,
|
|
13
|
+
...props
|
|
14
|
+
}, ref) => {
|
|
15
|
+
const finalDataCy = dataCy || "container";
|
|
16
|
+
const finalTestId = dataTestId || "container";
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
ref,
|
|
21
|
+
className: cn(
|
|
22
|
+
"container",
|
|
23
|
+
`container--max-width-${maxWidth}`,
|
|
24
|
+
`container--padding-${padding}`,
|
|
25
|
+
className
|
|
26
|
+
),
|
|
27
|
+
"data-cy": finalDataCy,
|
|
28
|
+
"data-testid": finalTestId,
|
|
29
|
+
...props,
|
|
30
|
+
children
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
Container.displayName = "Container";
|
|
36
|
+
export {
|
|
37
|
+
Container
|
|
38
|
+
};
|
package/dist/index24.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("@radix-ui/react-separator"),i=require("./index31.cjs");function a(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)};/* empty css */const o=a(t),d=r.forwardRef(({orientation:r="horizontal",decorative:t=!0,spacing:a="0",color:d,className:c,style:n,"data-cy":s,"data-testid":u,...l},f)=>{const v=s||`divider-${r}`,g=u||`divider-${r}`;return e.jsx(o.Root,{ref:f,decorative:t,orientation:r,className:i.cn("divider",`divider--${r}`,`divider--spacing-${a}`,c),style:{...d&&{backgroundColor:d},...n},"data-cy":v,"data-testid":g,...l})});d.displayName="Divider",exports.Divider=d;
|
package/dist/index24.js
CHANGED
|
@@ -1,301 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
4
|
+
import { cn } from "./index31.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
|
|
6
|
-
import { debounce } from "./index42.js";
|
|
7
|
-
const Input = forwardRef(
|
|
6
|
+
const Divider = forwardRef(
|
|
8
7
|
({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
fullWidth = false,
|
|
14
|
-
showPasswordToggle = true,
|
|
15
|
-
showLastChar = true,
|
|
16
|
-
lastCharDelay = 500,
|
|
17
|
-
validate,
|
|
18
|
-
onValidationChange,
|
|
8
|
+
orientation = "horizontal",
|
|
9
|
+
decorative = true,
|
|
10
|
+
spacing = "0",
|
|
11
|
+
color,
|
|
19
12
|
className,
|
|
20
|
-
|
|
21
|
-
onChange,
|
|
22
|
-
onBlur,
|
|
23
|
-
required,
|
|
24
|
-
value: controlledValue,
|
|
13
|
+
style,
|
|
25
14
|
"data-cy": dataCy,
|
|
26
15
|
"data-testid": dataTestId,
|
|
27
16
|
...props
|
|
28
17
|
}, ref) => {
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const touchedRef = useRef(false);
|
|
34
|
-
const [displayPassword, setDisplayPassword] = useState("");
|
|
35
|
-
const actualPasswordRef = useRef("");
|
|
36
|
-
const timeoutRef = useRef(null);
|
|
37
|
-
const inputRef = useRef(null);
|
|
38
|
-
const mergedRef = useMergedRef(ref, inputRef);
|
|
39
|
-
const generatedId = useId();
|
|
40
|
-
const id = providedId || generatedId;
|
|
41
|
-
const errorId = `${id}-error`;
|
|
42
|
-
const helperId = `${id}-helper`;
|
|
43
|
-
const finalDataCy = dataCy || "input";
|
|
44
|
-
const finalTestId = dataTestId || "input";
|
|
45
|
-
const isPasswordType = type === "password";
|
|
46
|
-
const showToggle = isPasswordType && showPasswordToggle;
|
|
47
|
-
const shouldEnableLastCharPreview = isPasswordType && showLastChar && !isPasswordVisible;
|
|
48
|
-
const inputType = isPasswordType && (isPasswordVisible || shouldEnableLastCharPreview && actualPasswordRef.current.length > 0) ? "text" : type;
|
|
49
|
-
const displayLabel = label && required && !label.includes("*") ? `${label} *` : label;
|
|
50
|
-
const togglePasswordVisibility = () => {
|
|
51
|
-
setIsPasswordVisible((prev) => !prev);
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
var _a;
|
|
54
|
-
return (_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
55
|
-
}, 0);
|
|
56
|
-
};
|
|
57
|
-
const debouncedValidate = useMemo(
|
|
58
|
-
() => debounce((value) => {
|
|
59
|
-
if (validate && touchedRef.current) {
|
|
60
|
-
const validationError = validate(value);
|
|
61
|
-
setInternalError(validationError);
|
|
62
|
-
onValidationChange == null ? void 0 : onValidationChange(!validationError);
|
|
63
|
-
}
|
|
64
|
-
}, 300),
|
|
65
|
-
[validate, onValidationChange]
|
|
66
|
-
);
|
|
67
|
-
const debouncedValidateRef = useRef(debouncedValidate);
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
debouncedValidateRef.current = debouncedValidate;
|
|
70
|
-
}, [debouncedValidate]);
|
|
71
|
-
useEffect(() => {
|
|
72
|
-
if (process.env.NODE_ENV === "development") {
|
|
73
|
-
if (isPasswordType && showLastChar && controlledValue !== void 0) {
|
|
74
|
-
console.warn(
|
|
75
|
-
"[Input] Password last character preview (showLastChar) only works in uncontrolled mode. Remove the value prop to use this feature, or set showLastChar={false}."
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}, [isPasswordType, showLastChar, controlledValue]);
|
|
80
|
-
useEffect(() => {
|
|
81
|
-
return () => {
|
|
82
|
-
if (timeoutRef.current) {
|
|
83
|
-
clearTimeout(timeoutRef.current);
|
|
84
|
-
}
|
|
85
|
-
debouncedValidateRef.current.cancel();
|
|
86
|
-
};
|
|
87
|
-
}, []);
|
|
88
|
-
const inputValue = shouldEnableLastCharPreview && controlledValue === void 0 ? displayPassword : isPasswordVisible && isPasswordType && controlledValue === void 0 ? actualPasswordRef.current || "" : controlledValue;
|
|
89
|
-
const handleChange = (e) => {
|
|
90
|
-
onChange == null ? void 0 : onChange(e);
|
|
91
|
-
let value = e.target.value;
|
|
92
|
-
if (shouldEnableLastCharPreview) {
|
|
93
|
-
const input = e.target;
|
|
94
|
-
const newValue = input.value;
|
|
95
|
-
actualPasswordRef.current = newValue;
|
|
96
|
-
const masked = newValue ? "•".repeat(newValue.length - 1) + newValue.slice(-1) : "";
|
|
97
|
-
setDisplayPassword(masked);
|
|
98
|
-
input.value = masked;
|
|
99
|
-
value = newValue;
|
|
100
|
-
if (timeoutRef.current) {
|
|
101
|
-
clearTimeout(timeoutRef.current);
|
|
102
|
-
}
|
|
103
|
-
timeoutRef.current = setTimeout(() => {
|
|
104
|
-
setDisplayPassword("•".repeat(newValue.length));
|
|
105
|
-
}, lastCharDelay);
|
|
106
|
-
}
|
|
107
|
-
if (touchedRef.current) {
|
|
108
|
-
debouncedValidate(value);
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const handleFocus = (e) => {
|
|
112
|
-
var _a;
|
|
113
|
-
setIsFocused(true);
|
|
114
|
-
(_a = props.onFocus) == null ? void 0 : _a.call(props, e);
|
|
115
|
-
};
|
|
116
|
-
const handleBlur = (e) => {
|
|
117
|
-
setIsFocused(false);
|
|
118
|
-
touchedRef.current = true;
|
|
119
|
-
if (validate) {
|
|
120
|
-
const valueToValidate = shouldEnableLastCharPreview ? actualPasswordRef.current : e.target.value;
|
|
121
|
-
const validationError = validate(valueToValidate);
|
|
122
|
-
setInternalError(validationError);
|
|
123
|
-
onValidationChange == null ? void 0 : onValidationChange(!validationError);
|
|
124
|
-
}
|
|
125
|
-
onBlur == null ? void 0 : onBlur(e);
|
|
126
|
-
};
|
|
127
|
-
const handleMouseEnter = () => {
|
|
128
|
-
setIsHovered(true);
|
|
129
|
-
};
|
|
130
|
-
const handleMouseLeave = () => {
|
|
131
|
-
setIsHovered(false);
|
|
132
|
-
};
|
|
133
|
-
const displayError = externalError || internalError;
|
|
134
|
-
const inputState = props.disabled ? "disabled" : displayError ? "error" : isFocused ? "focus" : isHovered ? "hover" : "idle";
|
|
135
|
-
return /* @__PURE__ */ jsxs(
|
|
136
|
-
"div",
|
|
18
|
+
const finalDataCy = dataCy || `divider-${orientation}`;
|
|
19
|
+
const finalTestId = dataTestId || `divider-${orientation}`;
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
SeparatorPrimitive.Root,
|
|
137
22
|
{
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"input",
|
|
155
|
-
{
|
|
156
|
-
ref: mergedRef,
|
|
157
|
-
id,
|
|
158
|
-
type: inputType,
|
|
159
|
-
value: inputValue,
|
|
160
|
-
className: cn(
|
|
161
|
-
"input",
|
|
162
|
-
displayError && "input--error",
|
|
163
|
-
fullWidth && "input--full-width",
|
|
164
|
-
showToggle && "input--with-toggle",
|
|
165
|
-
className
|
|
166
|
-
),
|
|
167
|
-
"aria-invalid": displayError ? "true" : "false",
|
|
168
|
-
"aria-required": required ? "true" : void 0,
|
|
169
|
-
"aria-describedby": displayError ? errorId : helperText ? helperId : void 0,
|
|
170
|
-
"data-cy": finalDataCy,
|
|
171
|
-
"data-testid": finalTestId,
|
|
172
|
-
"data-state": inputState,
|
|
173
|
-
onChange: handleChange,
|
|
174
|
-
onFocus: handleFocus,
|
|
175
|
-
onBlur: handleBlur,
|
|
176
|
-
onMouseEnter: handleMouseEnter,
|
|
177
|
-
onMouseLeave: handleMouseLeave,
|
|
178
|
-
required,
|
|
179
|
-
...props
|
|
180
|
-
}
|
|
181
|
-
),
|
|
182
|
-
showToggle && /* @__PURE__ */ jsx(
|
|
183
|
-
"button",
|
|
184
|
-
{
|
|
185
|
-
type: "button",
|
|
186
|
-
className: "input__toggle",
|
|
187
|
-
onClick: togglePasswordVisibility,
|
|
188
|
-
"aria-label": isPasswordVisible ? "Hide password" : "Show password",
|
|
189
|
-
"data-cy": `${finalDataCy}-toggle`,
|
|
190
|
-
"data-testid": `${finalTestId}-toggle`,
|
|
191
|
-
children: isPasswordVisible ? /* @__PURE__ */ jsxs(
|
|
192
|
-
"svg",
|
|
193
|
-
{
|
|
194
|
-
width: "20",
|
|
195
|
-
height: "20",
|
|
196
|
-
viewBox: "0 0 20 20",
|
|
197
|
-
fill: "none",
|
|
198
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
199
|
-
"aria-hidden": "true",
|
|
200
|
-
children: [
|
|
201
|
-
/* @__PURE__ */ jsx(
|
|
202
|
-
"path",
|
|
203
|
-
{
|
|
204
|
-
d: "M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",
|
|
205
|
-
stroke: "currentColor",
|
|
206
|
-
strokeWidth: "1.5",
|
|
207
|
-
strokeLinecap: "round",
|
|
208
|
-
strokeLinejoin: "round",
|
|
209
|
-
fill: "none"
|
|
210
|
-
}
|
|
211
|
-
),
|
|
212
|
-
/* @__PURE__ */ jsx(
|
|
213
|
-
"circle",
|
|
214
|
-
{
|
|
215
|
-
cx: "10",
|
|
216
|
-
cy: "10",
|
|
217
|
-
r: "2.5",
|
|
218
|
-
stroke: "currentColor",
|
|
219
|
-
strokeWidth: "1.5",
|
|
220
|
-
fill: "none"
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
]
|
|
224
|
-
}
|
|
225
|
-
) : /* @__PURE__ */ jsxs(
|
|
226
|
-
"svg",
|
|
227
|
-
{
|
|
228
|
-
width: "20",
|
|
229
|
-
height: "20",
|
|
230
|
-
viewBox: "0 0 20 20",
|
|
231
|
-
fill: "none",
|
|
232
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
233
|
-
"aria-hidden": "true",
|
|
234
|
-
children: [
|
|
235
|
-
/* @__PURE__ */ jsx(
|
|
236
|
-
"path",
|
|
237
|
-
{
|
|
238
|
-
d: "M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",
|
|
239
|
-
stroke: "currentColor",
|
|
240
|
-
strokeWidth: "1.5",
|
|
241
|
-
strokeLinecap: "round",
|
|
242
|
-
strokeLinejoin: "round",
|
|
243
|
-
fill: "none"
|
|
244
|
-
}
|
|
245
|
-
),
|
|
246
|
-
/* @__PURE__ */ jsx(
|
|
247
|
-
"circle",
|
|
248
|
-
{
|
|
249
|
-
cx: "10",
|
|
250
|
-
cy: "10",
|
|
251
|
-
r: "2.5",
|
|
252
|
-
stroke: "currentColor",
|
|
253
|
-
strokeWidth: "1.5",
|
|
254
|
-
fill: "none"
|
|
255
|
-
}
|
|
256
|
-
),
|
|
257
|
-
/* @__PURE__ */ jsx(
|
|
258
|
-
"path",
|
|
259
|
-
{
|
|
260
|
-
d: "M3 3l14 14",
|
|
261
|
-
stroke: "currentColor",
|
|
262
|
-
strokeWidth: "1.5",
|
|
263
|
-
strokeLinecap: "round"
|
|
264
|
-
}
|
|
265
|
-
)
|
|
266
|
-
]
|
|
267
|
-
}
|
|
268
|
-
)
|
|
269
|
-
}
|
|
270
|
-
)
|
|
271
|
-
] }),
|
|
272
|
-
displayError && /* @__PURE__ */ jsx(
|
|
273
|
-
"span",
|
|
274
|
-
{
|
|
275
|
-
id: errorId,
|
|
276
|
-
className: "input__error",
|
|
277
|
-
role: "alert",
|
|
278
|
-
"data-cy": `${finalDataCy}-error`,
|
|
279
|
-
"data-testid": `${finalTestId}-error`,
|
|
280
|
-
children: displayError
|
|
281
|
-
}
|
|
282
|
-
),
|
|
283
|
-
helperText && !displayError && /* @__PURE__ */ jsx(
|
|
284
|
-
"span",
|
|
285
|
-
{
|
|
286
|
-
id: helperId,
|
|
287
|
-
className: "input__helper",
|
|
288
|
-
"data-cy": `${finalDataCy}-helper`,
|
|
289
|
-
"data-testid": `${finalTestId}-helper`,
|
|
290
|
-
children: helperText
|
|
291
|
-
}
|
|
292
|
-
)
|
|
293
|
-
]
|
|
23
|
+
ref,
|
|
24
|
+
decorative,
|
|
25
|
+
orientation,
|
|
26
|
+
className: cn(
|
|
27
|
+
"divider",
|
|
28
|
+
`divider--${orientation}`,
|
|
29
|
+
`divider--spacing-${spacing}`,
|
|
30
|
+
className
|
|
31
|
+
),
|
|
32
|
+
style: {
|
|
33
|
+
...color && { backgroundColor: color },
|
|
34
|
+
...style
|
|
35
|
+
},
|
|
36
|
+
"data-cy": finalDataCy,
|
|
37
|
+
"data-testid": finalTestId,
|
|
38
|
+
...props
|
|
294
39
|
}
|
|
295
40
|
);
|
|
296
41
|
}
|
|
297
42
|
);
|
|
298
|
-
|
|
43
|
+
Divider.displayName = "Divider";
|
|
299
44
|
export {
|
|
300
|
-
|
|
45
|
+
Divider
|
|
301
46
|
};
|