@adam-milo/ui 1.0.23 → 1.0.25
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 +20 -9
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +53 -59
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +50 -104
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +108 -76
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +77 -26
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +22 -462
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +466 -109
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +111 -30
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +42 -12
- package/dist/index18.cjs +1 -0
- package/dist/index18.js +38 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +12 -20
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +20 -14
- package/dist/{index20.cjs → index22.cjs} +1 -1
- package/dist/{index20.js → index22.js} +3 -3
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +16 -0
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +1193 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +6 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +11 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +70 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +39 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +64 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +10 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +212 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +29 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +208 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +14 -0
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +293 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +18 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +43 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +89 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +14 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +71 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +6 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +14 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +34 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +122 -0
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +11 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +17 -0
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +297 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +25 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +39 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +625 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +39 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +38 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +7 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +10 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +5 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +35 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +180 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +21 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +721 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +154 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +173 -0
- package/dist/index77.cjs +1 -0
- package/dist/index77.js +47 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +13 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +19 -0
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +102 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +88 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +11 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +29 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +37 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +16 -0
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +48 -0
- package/dist/index87.cjs +1 -0
- package/dist/index87.js +9 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +224 -35
- package/dist/src/components/forms/select/Select.component.d.ts +100 -0
- package/dist/src/components/forms/select/Select.component.d.ts.map +1 -0
- package/dist/src/components/layout/container/Container.component.d.ts +26 -0
- package/dist/src/components/layout/container/Container.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
- /package/dist/{index30.cjs → index34.cjs} +0 -0
- /package/dist/{index30.js → index34.js} +0 -0
- /package/dist/{index33.cjs → index38.cjs} +0 -0
- /package/dist/{index33.js → index38.js} +0 -0
package/dist/index16.js
CHANGED
|
@@ -1,44 +1,125 @@
|
|
|
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 "./index19.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
const Dialog = DialogPrimitive.Root;
|
|
7
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
9
|
+
const DialogClose = DialogPrimitive.Close;
|
|
10
|
+
const DialogOverlay = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
11
|
+
const finalDataCy = dataCy || "dialog-overlay";
|
|
12
|
+
const finalTestId = dataTestId || "dialog-overlay";
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
DialogPrimitive.Overlay,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
className: cn("dialog-overlay", className),
|
|
18
|
+
"data-cy": finalDataCy,
|
|
19
|
+
"data-testid": finalTestId,
|
|
20
|
+
...props
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
25
|
+
const DialogContent = forwardRef(({ className, children, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
26
|
+
const finalDataCy = dataCy || "dialog-content";
|
|
27
|
+
const finalTestId = dataTestId || "dialog-content";
|
|
28
|
+
return /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(DialogOverlay, {}),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
DialogPrimitive.Content,
|
|
22
32
|
{
|
|
23
33
|
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
|
-
),
|
|
34
|
+
className: cn("dialog-content", className),
|
|
33
35
|
"data-cy": finalDataCy,
|
|
34
36
|
"data-testid": finalTestId,
|
|
35
37
|
...props,
|
|
36
38
|
children
|
|
37
39
|
}
|
|
40
|
+
)
|
|
41
|
+
] });
|
|
42
|
+
});
|
|
43
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
44
|
+
const DialogHeader = ({
|
|
45
|
+
className,
|
|
46
|
+
"data-cy": dataCy,
|
|
47
|
+
"data-testid": dataTestId,
|
|
48
|
+
...props
|
|
49
|
+
}) => {
|
|
50
|
+
const finalDataCy = dataCy || "dialog-header";
|
|
51
|
+
const finalTestId = dataTestId || "dialog-header";
|
|
52
|
+
return /* @__PURE__ */ jsx(
|
|
53
|
+
"div",
|
|
54
|
+
{
|
|
55
|
+
className: cn("dialog-header", className),
|
|
56
|
+
"data-cy": finalDataCy,
|
|
57
|
+
"data-testid": finalTestId,
|
|
58
|
+
...props
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
DialogHeader.displayName = "DialogHeader";
|
|
63
|
+
const DialogFooter = ({
|
|
64
|
+
className,
|
|
65
|
+
"data-cy": dataCy,
|
|
66
|
+
"data-testid": dataTestId,
|
|
67
|
+
...props
|
|
68
|
+
}) => {
|
|
69
|
+
const finalDataCy = dataCy || "dialog-footer";
|
|
70
|
+
const finalTestId = dataTestId || "dialog-footer";
|
|
71
|
+
return /* @__PURE__ */ jsx(
|
|
72
|
+
"div",
|
|
73
|
+
{
|
|
74
|
+
className: cn("dialog-footer", className),
|
|
75
|
+
"data-cy": finalDataCy,
|
|
76
|
+
"data-testid": finalTestId,
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
DialogFooter.displayName = "DialogFooter";
|
|
82
|
+
const DialogTitle = forwardRef(
|
|
83
|
+
({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
84
|
+
const finalDataCy = dataCy || "dialog-title";
|
|
85
|
+
const finalTestId = dataTestId || "dialog-title";
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
DialogPrimitive.Title,
|
|
88
|
+
{
|
|
89
|
+
ref,
|
|
90
|
+
className: cn("dialog-title", className),
|
|
91
|
+
"data-cy": finalDataCy,
|
|
92
|
+
"data-testid": finalTestId,
|
|
93
|
+
...props
|
|
94
|
+
}
|
|
38
95
|
);
|
|
39
96
|
}
|
|
40
97
|
);
|
|
41
|
-
|
|
98
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
99
|
+
const DialogDescription = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
100
|
+
const finalDataCy = dataCy || "dialog-description";
|
|
101
|
+
const finalTestId = dataTestId || "dialog-description";
|
|
102
|
+
return /* @__PURE__ */ jsx(
|
|
103
|
+
DialogPrimitive.Description,
|
|
104
|
+
{
|
|
105
|
+
ref,
|
|
106
|
+
className: cn("dialog-description", className),
|
|
107
|
+
"data-cy": finalDataCy,
|
|
108
|
+
"data-testid": finalTestId,
|
|
109
|
+
...props
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
42
114
|
export {
|
|
43
|
-
|
|
115
|
+
Dialog,
|
|
116
|
+
DialogClose,
|
|
117
|
+
DialogContent,
|
|
118
|
+
DialogDescription,
|
|
119
|
+
DialogFooter,
|
|
120
|
+
DialogHeader,
|
|
121
|
+
DialogOverlay,
|
|
122
|
+
DialogPortal,
|
|
123
|
+
DialogTitle,
|
|
124
|
+
DialogTrigger
|
|
44
125
|
};
|
package/dist/index17.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("./index19.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/index17.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 "./index19.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/index18.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("./index19.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/index18.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { cn } from "./index19.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/index19.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("clsx"),r=require("tailwind-merge");let t=0;exports.cn=function(...t){return r.twMerge(e.clsx(t))},exports.generateId=function(e="id"){return t+=1,`${e}-${t}`};
|
package/dist/index19.js
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (parts[0].length > 64)
|
|
12
|
-
return false;
|
|
13
|
-
var domainParts = parts[1].split(".");
|
|
14
|
-
if (domainParts.some(function(part) {
|
|
15
|
-
return part.length > 63;
|
|
16
|
-
}))
|
|
17
|
-
return false;
|
|
18
|
-
return true;
|
|
19
|
-
};
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
function cn(...inputs) {
|
|
4
|
+
return twMerge(clsx(inputs));
|
|
5
|
+
}
|
|
6
|
+
let idCounter = 0;
|
|
7
|
+
function generateId(prefix = "id") {
|
|
8
|
+
idCounter += 1;
|
|
9
|
+
return `${prefix}-${idCounter}`;
|
|
10
|
+
}
|
|
20
11
|
export {
|
|
21
|
-
|
|
12
|
+
cn,
|
|
13
|
+
generateId
|
|
22
14
|
};
|
package/dist/index2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),r=require("./index19.cjs");;/* empty css */const a=e.forwardRef(({variant:e="primary-workspace",fullWidth:a=!1,icon:n,className:s,children:i,disabled:c,"data-testid":d,"data-cy":o,...l},u)=>{const b=r.cn("btn",`btn--${e}`,a&&"btn--full-width",s);return t.jsxs("button",{ref:u,disabled:c,className:b,"data-testid":d||`button-${e}`,"data-cy":o||`button-${e}`,...l,children:[n&&t.jsx("span",{className:"btn__icon",children:n}),i]})});a.displayName="Button",exports.Button=a;
|
package/dist/index2.js
CHANGED
package/dist/index21.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;exports.validate=function(e){if(!e)return!1;if(e.length>254)return!1;if(!t.test(e))return!1;var r=e.split("@");return!(r[0].length>64)&&!r[1].split(".").some(function(t){return t.length>63})};
|
package/dist/index21.js
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
var tester = /^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;
|
|
2
|
+
var validate = function(email) {
|
|
3
|
+
if (!email)
|
|
4
|
+
return false;
|
|
5
|
+
if (email.length > 254)
|
|
6
|
+
return false;
|
|
7
|
+
var valid = tester.test(email);
|
|
8
|
+
if (!valid)
|
|
9
|
+
return false;
|
|
10
|
+
var parts = email.split("@");
|
|
11
|
+
if (parts[0].length > 64)
|
|
12
|
+
return false;
|
|
13
|
+
var domainParts = parts[1].split(".");
|
|
14
|
+
if (domainParts.some(function(part) {
|
|
15
|
+
return part.length > 63;
|
|
16
|
+
}))
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
14
20
|
export {
|
|
15
|
-
|
|
21
|
+
validate
|
|
16
22
|
};
|
|
@@ -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("./index19.cjs");;/* empty css */const a=require("./index23.cjs"),s=require("./index38.cjs"),n=r.forwardRef(({type:n="text",label:l,error:i,helperText:o,fullWidth:u=!1,showPasswordToggle:d=!0,showLastChar:c=!0,lastCharDelay:p=500,validate:h,onValidationChange:f,className:g,id:x,onChange:v,onBlur:w,required:j,value:m,"data-cy":y,"data-testid":k,...b},C)=>{const[$,N]=r.useState(!1),[_,q]=r.useState(),[M,S]=r.useState(!1),[L,R]=r.useState(!1),T=r.useRef(!1),[E,W]=r.useState(""),B=r.useRef(""),F=r.useRef(null),I=r.useRef(null),z=a.useMergedRef(C,I),D=r.useId(),O=x||D,P=`${O}-error`,V=`${O}-helper`,H=y||"input",A=k||"input",G="password"===n,J=G&&d,K=G&&c&&!$,Q=G&&($||K&&B.current.length>0)?"text":n,U=l&&j&&!l.includes("*")?`${l} *`:l,X=r.useMemo(()=>s.debounce(e=>{if(h&&T.current){const r=h(e);q(r),null==f||f(!r)}},300),[h,f]),Y=r.useRef(X);r.useEffect(()=>{Y.current=X},[X]),r.useEffect(()=>{process.env.NODE_ENV},[G,c,m]),r.useEffect(()=>()=>{F.current&&clearTimeout(F.current),Y.current.cancel()},[]);const Z=K&&void 0===m?E:$&&G&&void 0===m?B.current||"":m,ee=i||_,re=b.disabled?"disabled":ee?"error":M?"focus":L?"hover":"idle";return e.jsxs("div",{className:t.cn("input-wrapper",u&&"input-wrapper--full-width"),"data-cy":`${H}-wrapper`,"data-testid":`${A}-wrapper`,children:[l&&e.jsx("label",{htmlFor:O,className:"input__label","data-cy":`${H}-label`,"data-testid":`${A}-label`,children:U}),e.jsxs("div",{className:"input__field-container",children:[e.jsx("input",{ref:z,id:O,type:Q,value:Z,className:t.cn("input",ee&&"input--error",u&&"input--full-width",J&&"input--with-toggle",g),"aria-invalid":ee?"true":"false","aria-required":j?"true":void 0,"aria-describedby":ee?P:o?V:void 0,"data-cy":H,"data-testid":A,"data-state":re,onChange:e=>{null==v||v(e);let r=e.target.value;if(K){const t=e.target,a=t.value;B.current=a;const s=a?"•".repeat(a.length-1)+a.slice(-1):"";W(s),t.value=s,r=a,F.current&&clearTimeout(F.current),F.current=setTimeout(()=>{W("•".repeat(a.length))},p)}T.current&&X(r)},onFocus:e=>{var r;S(!0),null==(r=b.onFocus)||r.call(b,e)},onBlur:e=>{if(S(!1),T.current=!0,h){const r=K?B.current:e.target.value,t=h(r);q(t),null==f||f(!t)}null==w||w(e)},onMouseEnter:()=>{R(!0)},onMouseLeave:()=>{R(!1)},required:j,...b}),J&&e.jsx("button",{type:"button",className:"input__toggle",onClick:()=>{N(e=>!e),setTimeout(()=>{var e;return null==(e=I.current)?void 0:e.focus()},0)},"aria-label":$?"Hide password":"Show password","data-cy":`${H}-toggle`,"data-testid":`${A}-toggle`,children:$?e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"})]}):e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e.jsx("path",{d:"M10 4C5.5 4 2 10 2 10s3.5 6 8 6 8-6 8-6-3.5-6-8-6z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("circle",{cx:"10",cy:"10",r:"2.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),e.jsx("path",{d:"M3 3l14 14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})})]}),ee&&e.jsx("span",{id:P,className:"input__error",role:"alert","data-cy":`${H}-error`,"data-testid":`${A}-error`,children:ee}),o&&!ee&&e.jsx("span",{id:V,className:"input__helper","data-cy":`${H}-helper`,"data-testid":`${A}-helper`,children:o})]})});n.displayName="Input",exports.Input=n;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState, useRef, useId, useMemo, useEffect } from "react";
|
|
3
|
-
import { cn } from "./
|
|
3
|
+
import { cn } from "./index19.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { useMergedRef } from "./
|
|
6
|
-
import { debounce } from "./
|
|
5
|
+
import { useMergedRef } from "./index23.js";
|
|
6
|
+
import { debounce } from "./index38.js";
|
|
7
7
|
const Input = forwardRef(
|
|
8
8
|
({
|
|
9
9
|
type = "text",
|
package/dist/index23.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useMergedRef=function(...r){return e.useCallback(e=>{r.forEach(r=>{r&&("function"==typeof r?r(e):r.current=e)})},r)};
|
package/dist/index23.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
function useMergedRef(...refs) {
|
|
3
|
+
return useCallback((element) => {
|
|
4
|
+
refs.forEach((ref) => {
|
|
5
|
+
if (!ref) return;
|
|
6
|
+
if (typeof ref === "function") {
|
|
7
|
+
ref(element);
|
|
8
|
+
} else {
|
|
9
|
+
ref.current = element;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}, refs);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
useMergedRef
|
|
16
|
+
};
|
package/dist/index26.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),o=require("./index40.cjs"),r=require("./index41.cjs"),n=require("./index42.cjs"),l=require("./index43.cjs"),s=require("./index44.cjs"),i=require("./index45.cjs"),a=require("./index46.cjs"),c=require("./index47.cjs"),d=require("./index48.cjs"),u=require("./index49.cjs"),p=require("./index50.cjs"),f=require("./index51.cjs"),v=require("./index52.cjs"),m=require("./index53.cjs"),h=require("./index54.cjs"),x=require("./index55.cjs"),g=require("./index56.cjs"),w=require("./index57.cjs"),S=require("./index58.cjs"),y=require("./index59.cjs"),b=require("./index60.cjs"),C=require("react/jsx-runtime");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const o in e)if("default"!==o){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}return t.default=e,Object.freeze(t)}const P=j(e),E=j(t);var R=[" ","Enter","ArrowUp","ArrowDown"],I=[" ","Enter"],T="Select",[_,D,k]=n.createCollection(T),[H]=s.createContextScope(T,[k,p.createPopperScope]),L=p.createPopperScope(),[N,O]=H(T),[q,M]=H(T),A=e=>{const{__scopeSelect:t,children:o,open:r,defaultOpen:n,onOpenChange:l,value:s,defaultValue:a,onValueChange:c,dir:d,name:f,autoComplete:v,disabled:m,required:h,form:g}=e,w=L(t),[S,y]=P.useState(null),[b,j]=P.useState(null),[E,R]=P.useState(!1),I=i.useDirection(d),[D,k]=x.useControllableState({prop:r,defaultProp:n??!1,onChange:l,caller:T}),[H,O]=x.useControllableState({prop:s,defaultProp:a,onChange:c,caller:T}),M=P.useRef(null),A=!S||(g||!!S.closest("form")),[V,B]=P.useState(new Set),F=Array.from(V).map(e=>e.props.value).join(";");return C.jsx(p.Root,{...w,children:C.jsxs(N,{required:h,scope:t,trigger:S,onTriggerChange:y,valueNode:b,onValueNodeChange:j,valueNodeHasChildren:E,onValueNodeHasChildrenChange:R,contentId:u.useId(),value:H,onValueChange:O,open:D,onOpenChange:k,dir:I,triggerPointerDownPosRef:M,disabled:m,children:[C.jsx(_.Provider,{scope:t,children:C.jsx(q,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(e=>{B(t=>new Set(t).add(e))},[]),onNativeOptionRemove:P.useCallback(e=>{B(t=>{const o=new Set(t);return o.delete(e),o})},[]),children:o})}),A?C.jsxs(Re,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:v,value:H,onChange:e=>O(e.target.value),disabled:m,form:g,children:[void 0===H?C.jsx("option",{value:""}):null,Array.from(V)]},F):null]})})};A.displayName=T;var V="SelectTrigger",B=P.forwardRef((e,t)=>{const{__scopeSelect:o,disabled:n=!1,...s}=e,i=L(o),a=O(V,o),c=a.disabled||n,d=l.useComposedRefs(t,a.onTriggerChange),u=D(o),f=P.useRef("touch"),[m,h,x]=Te(e=>{const t=u().filter(e=>!e.disabled),o=t.find(e=>e.value===a.value),r=_e(t,e,o);void 0!==r&&a.onValueChange(r.value)}),g=e=>{c||(a.onOpenChange(!0),x()),e&&(a.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return C.jsx(p.Anchor,{asChild:!0,...i,children:C.jsx(v.Primitive.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":Ie(a.value)?"":void 0,...s,ref:d,onClick:r.composeEventHandlers(s.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&g(e)}),onPointerDown:r.composeEventHandlers(s.onPointerDown,e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:r.composeEventHandlers(s.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||R.includes(e.key)&&(g(),e.preventDefault())})})})});B.displayName=V;var F="SelectValue",K=P.forwardRef((e,t)=>{const{__scopeSelect:o,className:r,style:n,children:s,placeholder:i="",...a}=e,c=O(F,o),{onValueNodeHasChildrenChange:d}=c,u=void 0!==s,p=l.useComposedRefs(t,c.onValueNodeChange);return g.useLayoutEffect(()=>{d(u)},[d,u]),C.jsx(v.Primitive.span,{...a,ref:p,style:{pointerEvents:"none"},children:Ie(c.value)?C.jsx(C.Fragment,{children:i}):s})});K.displayName=F;var W=P.forwardRef((e,t)=>{const{__scopeSelect:o,children:r,...n}=e;return C.jsx(v.Primitive.span,{"aria-hidden":!0,...n,ref:t,children:r||"▼"})});W.displayName="SelectIcon";var U=e=>C.jsx(f.Portal,{asChild:!0,...e});U.displayName="SelectPortal";var z="SelectContent",G=P.forwardRef((e,t)=>{const o=O(z,e.__scopeSelect),[r,n]=P.useState();if(g.useLayoutEffect(()=>{n(new DocumentFragment)},[]),!o.open){const t=r;return t?E.createPortal(C.jsx(X,{scope:e.__scopeSelect,children:C.jsx(_.Slot,{scope:e.__scopeSelect,children:C.jsx("div",{children:e.children})})}),t):null}return C.jsx(J,{...e,ref:t})});G.displayName=z;var Y=10,[X,Z]=H(z),$=m.createSlot("SelectContent.RemoveScroll"),J=P.forwardRef((e,t)=>{const{__scopeSelect:o,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:u,side:p,sideOffset:f,align:v,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:g,sticky:w,hideWhenDetached:S,avoidCollisions:j,...E}=e,R=O(z,o),[I,T]=P.useState(null),[_,k]=P.useState(null),H=l.useComposedRefs(t,e=>T(e)),[L,N]=P.useState(null),[q,M]=P.useState(null),A=D(o),[V,B]=P.useState(!1),F=P.useRef(!1);P.useEffect(()=>{if(I)return y.hideOthers(I)},[I]),c.useFocusGuards();const K=P.useCallback(e=>{const[t,...o]=A().map(e=>e.ref.current),[r]=o.slice(-1),n=document.activeElement;for(const l of e){if(l===n)return;if(null==l||l.scrollIntoView({block:"nearest"}),l===t&&_&&(_.scrollTop=0),l===r&&_&&(_.scrollTop=_.scrollHeight),null==l||l.focus(),document.activeElement!==n)return}},[A,_]),W=P.useCallback(()=>K([L,I]),[K,L,I]);P.useEffect(()=>{V&&W()},[V,W]);const{onOpenChange:U,triggerPointerDownPosRef:G}=R;P.useEffect(()=>{if(I){let e={x:0,y:0};const t=t=>{var o,r;e={x:Math.abs(Math.round(t.pageX)-((null==(o=G.current)?void 0:o.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(r=G.current)?void 0:r.y)??0))}},o=o=>{e.x<=10&&e.y<=10?o.preventDefault():I.contains(o.target)||U(!1),document.removeEventListener("pointermove",t),G.current=null};return null!==G.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",o,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",o,{capture:!0})}}},[I,U,G]),P.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[Y,Z]=Te(e=>{const t=A().filter(e=>!e.disabled),o=t.find(e=>e.ref.current===document.activeElement),r=_e(t,e,o);r&&setTimeout(()=>r.ref.current.focus())}),J=P.useCallback((e,t,o)=>{const r=!F.current&&!o;(void 0!==R.value&&R.value===t||r)&&(N(e),r&&(F.current=!0))},[R.value]),te=P.useCallback(()=>null==I?void 0:I.focus(),[I]),oe=P.useCallback((e,t,o)=>{const r=!F.current&&!o;(void 0!==R.value&&R.value===t||r)&&M(e)},[R.value]),re="popper"===n?ee:Q,ne=re===ee?{side:p,sideOffset:f,align:v,alignOffset:m,arrowPadding:h,collisionBoundary:x,collisionPadding:g,sticky:w,hideWhenDetached:S,avoidCollisions:j}:{};return C.jsx(X,{scope:o,content:I,viewport:_,onViewportChange:k,itemRefCallback:J,selectedItem:L,onItemLeave:te,itemTextRefCallback:oe,focusSelectedItem:W,selectedItemText:q,position:n,isPositioned:V,searchRef:Y,children:C.jsx(b,{as:$,allowPinchZoom:!0,children:C.jsx(d.FocusScope,{asChild:!0,trapped:R.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:r.composeEventHandlers(s,e=>{var t;null==(t=R.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:C.jsx(a.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:u,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:C.jsx(re,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:e=>e.preventDefault(),...E,...ne,onPlaced:()=>B(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:r.composeEventHandlers(E.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const o=e.target,r=t.indexOf(o);t=t.slice(r+1)}setTimeout(()=>K(t)),e.preventDefault()}})})})})})})});J.displayName="SelectContentImpl";var Q=P.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,i=O(z,r),a=Z(z,r),[c,d]=P.useState(null),[u,p]=P.useState(null),f=l.useComposedRefs(t,e=>p(e)),m=D(r),h=P.useRef(!1),x=P.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:y,focusSelectedItem:b}=a,j=P.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&u&&w&&S&&y){const e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),l=y.getBoundingClientRect();if("rtl"!==i.dir){const n=l.left-t.left,s=r.left-n,i=e.left-s,a=e.width+i,d=Math.max(a,t.width),u=window.innerWidth-Y,p=o.clamp(s,[Y,Math.max(Y,u-d)]);c.style.minWidth=a+"px",c.style.left=p+"px"}else{const n=t.right-l.right,s=window.innerWidth-r.right-n,i=window.innerWidth-e.right-s,a=e.width+i,d=Math.max(a,t.width),u=window.innerWidth-Y,p=o.clamp(s,[Y,Math.max(Y,u-d)]);c.style.minWidth=a+"px",c.style.right=p+"px"}const s=m(),a=window.innerHeight-2*Y,d=w.scrollHeight,p=window.getComputedStyle(u),f=parseInt(p.borderTopWidth,10),v=parseInt(p.paddingTop,10),x=parseInt(p.borderBottomWidth,10),g=f+v+d+parseInt(p.paddingBottom,10)+x,b=Math.min(5*S.offsetHeight,g),C=window.getComputedStyle(w),j=parseInt(C.paddingTop,10),P=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,R=a-E,I=S.offsetHeight/2,T=f+v+(S.offsetTop+I),_=g-T;if(T<=E){const e=s.length>0&&S===s[s.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-w.offsetTop-w.offsetHeight,o=T+Math.max(R,I+(e?P:0)+t+x);c.style.height=o+"px"}else{const e=s.length>0&&S===s[0].ref.current;c.style.top="0px";const t=Math.max(E,f+w.offsetTop+(e?j:0)+I)+_;c.style.height=t+"px",w.scrollTop=T-E+w.offsetTop}c.style.margin=`${Y}px 0`,c.style.minHeight=b+"px",c.style.maxHeight=a+"px",null==n||n(),requestAnimationFrame(()=>h.current=!0)}},[m,i.trigger,i.valueNode,c,u,w,S,y,i.dir,n]);g.useLayoutEffect(()=>j(),[j]);const[E,R]=P.useState();g.useLayoutEffect(()=>{u&&R(window.getComputedStyle(u).zIndex)},[u]);const I=P.useCallback(e=>{e&&!0===x.current&&(j(),null==b||b(),x.current=!1)},[j,b]);return C.jsx(te,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:I,children:C.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:C.jsx(v.Primitive.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Q.displayName="SelectItemAlignedPosition";var ee=P.forwardRef((e,t)=>{const{__scopeSelect:o,align:r="start",collisionPadding:n=Y,...l}=e,s=L(o);return C.jsx(p.Content,{...s,...l,ref:t,align:r,collisionPadding:n,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ee.displayName="SelectPopperPosition";var[te,oe]=H(z,{}),re="SelectViewport",ne=P.forwardRef((e,t)=>{const{__scopeSelect:o,nonce:n,...s}=e,i=Z(re,o),a=oe(re,o),c=l.useComposedRefs(t,i.onViewportChange),d=P.useRef(0);return C.jsxs(C.Fragment,{children:[C.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),C.jsx(_.Slot,{scope:o,children:C.jsx(v.Primitive.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:r.composeEventHandlers(s.onScroll,e=>{const t=e.currentTarget,{contentWrapper:o,shouldExpandOnScrollRef:r}=a;if((null==r?void 0:r.current)&&o){const e=Math.abs(d.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Y,n=parseFloat(o.style.minHeight),l=parseFloat(o.style.height),s=Math.max(n,l);if(s<r){const n=s+e,l=Math.min(r,n),i=n-l;o.style.height=l+"px","0px"===o.style.bottom&&(t.scrollTop=i>0?i:0,o.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});ne.displayName=re;var le="SelectGroup",[se,ie]=H(le),ae=P.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,n=u.useId();return C.jsx(se,{scope:o,id:n,children:C.jsx(v.Primitive.div,{role:"group","aria-labelledby":n,...r,ref:t})})});ae.displayName=le;var ce="SelectLabel",de=P.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,n=ie(ce,o);return C.jsx(v.Primitive.div,{id:n.id,...r,ref:t})});de.displayName=ce;var ue="SelectItem",[pe,fe]=H(ue),ve=P.forwardRef((e,t)=>{const{__scopeSelect:o,value:n,disabled:s=!1,textValue:i,...a}=e,c=O(ue,o),d=Z(ue,o),p=c.value===n,[f,m]=P.useState(i??""),[h,x]=P.useState(!1),g=l.useComposedRefs(t,e=>{var t;return null==(t=d.itemRefCallback)?void 0:t.call(d,e,n,s)}),w=u.useId(),S=P.useRef("touch"),y=()=>{s||(c.onValueChange(n),c.onOpenChange(!1))};if(""===n)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return C.jsx(pe,{scope:o,value:n,disabled:s,textId:w,isSelected:p,onItemTextChange:P.useCallback(e=>{m(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:C.jsx(_.ItemSlot,{scope:o,value:n,disabled:s,textValue:f,children:C.jsx(v.Primitive.div,{role:"option","aria-labelledby":w,"data-highlighted":h?"":void 0,"aria-selected":p&&h,"data-state":p?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:g,onFocus:r.composeEventHandlers(a.onFocus,()=>x(!0)),onBlur:r.composeEventHandlers(a.onBlur,()=>x(!1)),onClick:r.composeEventHandlers(a.onClick,()=>{"mouse"!==S.current&&y()}),onPointerUp:r.composeEventHandlers(a.onPointerUp,()=>{"mouse"===S.current&&y()}),onPointerDown:r.composeEventHandlers(a.onPointerDown,e=>{S.current=e.pointerType}),onPointerMove:r.composeEventHandlers(a.onPointerMove,e=>{var t;S.current=e.pointerType,s?null==(t=d.onItemLeave)||t.call(d):"mouse"===S.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:r.composeEventHandlers(a.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=d.onItemLeave)||t.call(d))}),onKeyDown:r.composeEventHandlers(a.onKeyDown,e=>{var t;""!==(null==(t=d.searchRef)?void 0:t.current)&&" "===e.key||(I.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});ve.displayName=ue;var me="SelectItemText",he=P.forwardRef((e,t)=>{const{__scopeSelect:o,className:r,style:n,...s}=e,i=O(me,o),a=Z(me,o),c=fe(me,o),d=M(me,o),[u,p]=P.useState(null),f=l.useComposedRefs(t,e=>p(e),c.onItemTextChange,e=>{var t;return null==(t=a.itemTextRefCallback)?void 0:t.call(a,e,c.value,c.disabled)}),m=null==u?void 0:u.textContent,h=P.useMemo(()=>C.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:x,onNativeOptionRemove:w}=d;return g.useLayoutEffect(()=>(x(h),()=>w(h)),[x,w,h]),C.jsxs(C.Fragment,{children:[C.jsx(v.Primitive.span,{id:c.textId,...s,ref:f}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?E.createPortal(s.children,i.valueNode):null]})});he.displayName=me;var xe="SelectItemIndicator",ge=P.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return fe(xe,o).isSelected?C.jsx(v.Primitive.span,{"aria-hidden":!0,...r,ref:t}):null});ge.displayName=xe;var we="SelectScrollUpButton",Se=P.forwardRef((e,t)=>{const o=Z(we,e.__scopeSelect),r=oe(we,e.__scopeSelect),[n,s]=P.useState(!1),i=l.useComposedRefs(t,r.onScrollButtonChange);return g.useLayoutEffect(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),n?C.jsx(Ce,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Se.displayName=we;var ye="SelectScrollDownButton",be=P.forwardRef((e,t)=>{const o=Z(ye,e.__scopeSelect),r=oe(ye,e.__scopeSelect),[n,s]=P.useState(!1),i=l.useComposedRefs(t,r.onScrollButtonChange);return g.useLayoutEffect(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,o=Math.ceil(t.scrollTop)<e;s(o)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),n?C.jsx(Ce,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});be.displayName=ye;var Ce=P.forwardRef((e,t)=>{const{__scopeSelect:o,onAutoScroll:n,...l}=e,s=Z("SelectScrollButton",o),i=P.useRef(null),a=D(o),c=P.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return P.useEffect(()=>()=>c(),[c]),g.useLayoutEffect(()=>{var e;const t=a().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[a]),C.jsx(v.Primitive.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:r.composeEventHandlers(l.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(n,50))}),onPointerMove:r.composeEventHandlers(l.onPointerMove,()=>{var e;null==(e=s.onItemLeave)||e.call(s),null===i.current&&(i.current=window.setInterval(n,50))}),onPointerLeave:r.composeEventHandlers(l.onPointerLeave,()=>{c()})})}),je=P.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e;return C.jsx(v.Primitive.div,{"aria-hidden":!0,...r,ref:t})});je.displayName="SelectSeparator";var Pe="SelectArrow",Ee=P.forwardRef((e,t)=>{const{__scopeSelect:o,...r}=e,n=L(o),l=O(Pe,o),s=Z(Pe,o);return l.open&&"popper"===s.position?C.jsx(p.Arrow,{...n,...r,ref:t}):null});Ee.displayName=Pe;var Re=P.forwardRef(({__scopeSelect:e,value:t,...o},r)=>{const n=P.useRef(null),s=l.useComposedRefs(r,n),i=w.usePrevious(t);return P.useEffect(()=>{const e=n.current;if(!e)return;const o=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(o,"value").set;if(i!==t&&r){const o=new Event("change",{bubbles:!0});r.call(e,t),e.dispatchEvent(o)}},[i,t]),C.jsx(v.Primitive.select,{...o,style:{...S.VISUALLY_HIDDEN_STYLES,...o.style},ref:s,defaultValue:t})});function Ie(e){return""===e||void 0===e}function Te(e){const t=h.useCallbackRef(e),o=P.useRef(""),r=P.useRef(0),n=P.useCallback(e=>{const n=o.current+e;t(n),function e(t){o.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(n)},[t]),l=P.useCallback(()=>{o.current="",window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[o,n,l]}function _e(e,t,o){const r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,n=o?e.indexOf(o):-1;let l=(s=e,i=Math.max(n,0),s.map((e,t)=>s[(i+t)%s.length]));var s,i;1===r.length&&(l=l.filter(e=>e!==o));const a=l.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==o?a:void 0}Re.displayName="SelectBubbleInput";var De=A,ke=B,He=K,Le=W,Ne=U,Oe=G,qe=ne,Me=ae,Ae=de,Ve=ve,Be=he,Fe=je;exports.Content=Oe,exports.Group=Me,exports.Icon=Le,exports.Item=Ve,exports.ItemText=Be,exports.Label=Ae,exports.Portal=Ne,exports.Root=De,exports.Select=A,exports.SelectArrow=Ee,exports.SelectContent=G,exports.SelectGroup=ae,exports.SelectIcon=W,exports.SelectItem=ve,exports.SelectItemIndicator=ge,exports.SelectItemText=he,exports.SelectLabel=de,exports.SelectPortal=U,exports.SelectScrollDownButton=be,exports.SelectScrollUpButton=Se,exports.SelectSeparator=je,exports.SelectTrigger=B,exports.SelectValue=K,exports.SelectViewport=ne,exports.Separator=Fe,exports.Trigger=ke,exports.Value=He,exports.Viewport=qe;
|