@adam-milo/ui 1.0.33 → 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 +57 -23
- 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 -39
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +16 -27
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +36 -12
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +46 -0
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +80 -263
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +52 -13
- 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 -1
- package/dist/index36.js +383 -6
- 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/index50.cjs +1 -0
- package/dist/index50.js +9 -0
- 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 +3 -2
- package/dist/src/components/typography/heading/Heading.component.d.ts.map +1 -1
- 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 +22 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
- /package/dist/{index44.cjs → index61.cjs} +0 -0
- /package/dist/{index44.js → index61.js} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs"),r=require("./index3.cjs"),t=require("./index4.cjs"),o=require("./index5.cjs"),i=require("./index6.cjs"),s=require("./index7.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index2.cjs"),r=require("./index3.cjs"),t=require("./index4.cjs"),o=require("./index5.cjs"),i=require("./index6.cjs"),s=require("./index7.cjs"),n=require("./index8.cjs"),a=require("./index9.cjs"),p=require("./index10.cjs"),x=require("./index11.cjs"),u=require("./index12.cjs"),l=require("./index13.cjs"),c=require("./index14.cjs"),d=require("./index15.cjs"),g=require("./index16.cjs"),C=require("./index17.cjs"),D=require("./index18.cjs"),j=require("./index19.cjs"),q=require("./index20.cjs"),I=require("./index21.cjs"),b=require("./index22.cjs"),h=require("./index23.cjs"),m=require("./index24.cjs"),T=require("./index25.cjs"),S=require("./index26.cjs"),P=require("./index27.cjs"),y=require("./index28.cjs"),B=require("./index29.cjs"),f=require("./index30.cjs"),k=require("./index31.cjs"),M=require("@adam-milo/icons"),L=require("./index32.cjs");exports.Button=e.Button,exports.IconButton=r.IconButton,exports.MenuIconButton=t.MenuIconButton,exports.EmailInput=o.EmailInput,exports.PasswordInput=i.PasswordInput,exports.NumericInput=s.NumericInput,exports.AlphanumericInput=n.AlphanumericInput,exports.Checkbox=a.Checkbox,exports.Radio=p.Radio,exports.Select=x.Select,exports.SelectContent=x.SelectContent,exports.SelectGroup=x.SelectGroup,exports.SelectItem=x.SelectItem,exports.SelectLabel=x.SelectLabel,exports.SelectSeparator=x.SelectSeparator,exports.SelectTrigger=x.SelectTrigger,exports.SelectValue=x.SelectValue,exports.PhoneInput=u.PhoneInput,exports.OTPInput=l.OTPInput,exports.Toggle=c.Toggle,exports.Tabs=d.Tabs,exports.TabsContent=d.TabsContent,exports.TabsList=d.TabsList,exports.TabsTrigger=d.TabsTrigger,exports.Alert=g.Alert,exports.Card=C.Card,exports.CardContent=C.CardContent,exports.CardDescription=C.CardDescription,exports.CardFooter=C.CardFooter,exports.CardHeader=C.CardHeader,exports.CardTitle=C.CardTitle,exports.DataTable=D.DataTable,exports.Chip=j.Chip,exports.ChipGroup=q.ChipGroup,exports.Dialog=I.Dialog,exports.DialogClose=I.DialogClose,exports.DialogCloseButton=I.DialogCloseButton,exports.DialogContent=I.DialogContent,exports.DialogDescription=I.DialogDescription,exports.DialogFooter=I.DialogFooter,exports.DialogHeader=I.DialogHeader,exports.DialogIcon=I.DialogIcon,exports.DialogOverlay=I.DialogOverlay,exports.DialogPortal=I.DialogPortal,exports.DialogTitle=I.DialogTitle,exports.DialogTrigger=I.DialogTrigger,exports.Stack=b.Stack,exports.Container=h.Container,exports.Divider=m.Divider,exports.AuthLayout=T.AuthLayout,exports.Grid=S.Grid,exports.Text=P.Text,exports.Heading=y.Heading,exports.Link=B.Link,exports.Spinner=f.Spinner,exports.cn=k.cn,exports.generateId=k.generateId,Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>M.Icon}),Object.defineProperty(exports,"availableIcons",{enumerable:!0,get:()=>M.availableIcons}),Object.defineProperty(exports,"figmaIconMapping",{enumerable:!0,get:()=>M.figmaIconMapping}),Object.defineProperty(exports,"getRadixIconName",{enumerable:!0,get:()=>M.getRadixIconName}),exports.allCountries=L.allCountries,exports.commonCountries=L.commonCountries,exports.defaultCountries=L.defaultCountries,exports.defaultPhoneMask=L.defaultPhoneMask,exports.formatPhoneNumber=L.formatPhoneNumber,exports.getCountriesByDialCode=L.getCountriesByDialCode,exports.getCountryByCode=L.getCountryByCode,exports.getCountryByDialCode=L.getCountryByDialCode,exports.getPhoneDigits=L.getPhoneDigits,exports.getPhoneMask=L.getPhoneMask,exports.isValidPhoneLength=L.isValidPhoneLength,exports.phoneMasks=L.phoneMasks,exports.searchCountries=L.searchCountries;
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
import { Button } from "./index2.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
2
|
+
import { IconButton } from "./index3.js";
|
|
3
|
+
import { MenuIconButton } from "./index4.js";
|
|
4
|
+
import { EmailInput } from "./index5.js";
|
|
5
|
+
import { PasswordInput } from "./index6.js";
|
|
6
|
+
import { NumericInput } from "./index7.js";
|
|
7
|
+
import { AlphanumericInput } from "./index8.js";
|
|
8
|
+
import { Checkbox } from "./index9.js";
|
|
9
|
+
import { Radio } from "./index10.js";
|
|
10
|
+
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "./index11.js";
|
|
11
|
+
import { PhoneInput } from "./index12.js";
|
|
12
|
+
import { OTPInput } from "./index13.js";
|
|
13
|
+
import { Toggle } from "./index14.js";
|
|
14
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./index15.js";
|
|
15
|
+
import { Alert } from "./index16.js";
|
|
16
|
+
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./index17.js";
|
|
17
|
+
import { DataTable } from "./index18.js";
|
|
18
|
+
import { Chip } from "./index19.js";
|
|
19
|
+
import { ChipGroup } from "./index20.js";
|
|
20
|
+
import { Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./index21.js";
|
|
21
|
+
import { Stack } from "./index22.js";
|
|
22
|
+
import { Container } from "./index23.js";
|
|
23
|
+
import { Divider } from "./index24.js";
|
|
24
|
+
import { AuthLayout } from "./index25.js";
|
|
25
|
+
import { Grid } from "./index26.js";
|
|
26
|
+
import { Text } from "./index27.js";
|
|
27
|
+
import { Heading } from "./index28.js";
|
|
28
|
+
import { Link } from "./index29.js";
|
|
29
|
+
import { Spinner } from "./index30.js";
|
|
30
|
+
import { cn, generateId } from "./index31.js";
|
|
31
|
+
import { Icon, availableIcons, figmaIconMapping, getRadixIconName } from "@adam-milo/icons";
|
|
32
|
+
import { allCountries, commonCountries, defaultCountries, defaultPhoneMask, formatPhoneNumber, getCountriesByDialCode, getCountryByCode, getCountryByDialCode, getPhoneDigits, getPhoneMask, isValidPhoneLength, phoneMasks, searchCountries } from "./index32.js";
|
|
24
33
|
export {
|
|
25
34
|
Alert,
|
|
26
35
|
AlphanumericInput,
|
|
36
|
+
AuthLayout,
|
|
27
37
|
Button,
|
|
28
38
|
Card,
|
|
29
39
|
CardContent,
|
|
@@ -38,10 +48,12 @@ export {
|
|
|
38
48
|
DataTable,
|
|
39
49
|
Dialog,
|
|
40
50
|
DialogClose,
|
|
51
|
+
DialogCloseButton,
|
|
41
52
|
DialogContent,
|
|
42
53
|
DialogDescription,
|
|
43
54
|
DialogFooter,
|
|
44
55
|
DialogHeader,
|
|
56
|
+
DialogIcon,
|
|
45
57
|
DialogOverlay,
|
|
46
58
|
DialogPortal,
|
|
47
59
|
DialogTitle,
|
|
@@ -51,8 +63,13 @@ export {
|
|
|
51
63
|
Grid,
|
|
52
64
|
Heading,
|
|
53
65
|
Icon,
|
|
66
|
+
IconButton,
|
|
67
|
+
Link,
|
|
68
|
+
MenuIconButton,
|
|
54
69
|
NumericInput,
|
|
70
|
+
OTPInput,
|
|
55
71
|
PasswordInput,
|
|
72
|
+
PhoneInput,
|
|
56
73
|
Radio,
|
|
57
74
|
Select,
|
|
58
75
|
SelectContent,
|
|
@@ -62,13 +79,30 @@ export {
|
|
|
62
79
|
SelectSeparator,
|
|
63
80
|
SelectTrigger,
|
|
64
81
|
SelectValue,
|
|
82
|
+
Spinner,
|
|
65
83
|
Stack,
|
|
66
84
|
Tabs,
|
|
67
85
|
TabsContent,
|
|
68
86
|
TabsList,
|
|
69
87
|
TabsTrigger,
|
|
70
88
|
Text,
|
|
89
|
+
Toggle,
|
|
90
|
+
allCountries,
|
|
71
91
|
availableIcons,
|
|
72
92
|
cn,
|
|
73
|
-
|
|
93
|
+
commonCountries,
|
|
94
|
+
defaultCountries,
|
|
95
|
+
defaultPhoneMask,
|
|
96
|
+
figmaIconMapping,
|
|
97
|
+
formatPhoneNumber,
|
|
98
|
+
generateId,
|
|
99
|
+
getCountriesByDialCode,
|
|
100
|
+
getCountryByCode,
|
|
101
|
+
getCountryByDialCode,
|
|
102
|
+
getPhoneDigits,
|
|
103
|
+
getPhoneMask,
|
|
104
|
+
getRadixIconName,
|
|
105
|
+
isValidPhoneLength,
|
|
106
|
+
phoneMasks,
|
|
107
|
+
searchCountries
|
|
74
108
|
};
|
package/dist/index10.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 e=require("react/jsx-runtime"),r=require("react"),a=require("./index31.cjs");;/* empty css */const d=r.forwardRef(({label:d,error:i,helperText:t,className:s,id:l,required:c,disabled:o,checked:n,"data-cy":p,"data-testid":u,...b},h)=>{const x=r.useId(),y=l||x,_=`${y}-error`,m=`${y}-helper`,$=p||"radio",j=u||"radio",N=r.useRef(null),f=r.useCallback(e=>{N.current=e,h&&("function"==typeof h?h(e):"current"in h&&(h.current=e))},[h]),q=d&&c&&!d.includes("*")?`${d} *`:d;return e.jsxs("div",{className:a.cn("radio-wrapper",o&&"radio-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("div",{className:"radio__container",children:[e.jsx("input",{ref:f,id:y,type:"radio",checked:n,className:a.cn("radio__input",i&&"radio__input--error",s),"aria-describedby":i?_:t?m:void 0,"data-cy":$,"data-testid":j,disabled:o,required:c,...b}),d&&e.jsx("label",{htmlFor:y,className:"radio__label","data-cy":`${$}-label`,"data-testid":`${j}-label`,children:q})]}),i&&e.jsx("span",{id:_,className:"radio__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${j}-error`,children:i}),t&&!i&&e.jsx("span",{id:m,className:"radio__helper","data-cy":`${$}-helper`,"data-testid":`${j}-helper`,children:t})]})});d.displayName="Radio",exports.Radio=d;
|
package/dist/index10.js
CHANGED
|
@@ -1,65 +1,103 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import
|
|
4
|
-
import { cn } from "./index23.js";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId, useRef, useCallback } from "react";
|
|
3
|
+
import { cn } from "./index31.js";
|
|
5
4
|
/* empty css */
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
const Radio = forwardRef(
|
|
6
|
+
({
|
|
7
|
+
label,
|
|
8
|
+
error,
|
|
9
|
+
helperText,
|
|
10
|
+
className,
|
|
11
|
+
id: providedId,
|
|
12
|
+
required,
|
|
13
|
+
disabled,
|
|
14
|
+
checked,
|
|
15
|
+
"data-cy": dataCy,
|
|
16
|
+
"data-testid": dataTestId,
|
|
17
|
+
...props
|
|
18
|
+
}, ref) => {
|
|
19
|
+
const generatedId = useId();
|
|
20
|
+
const id = providedId || generatedId;
|
|
21
|
+
const errorId = `${id}-error`;
|
|
22
|
+
const helperId = `${id}-helper`;
|
|
23
|
+
const finalDataCy = dataCy || "radio";
|
|
24
|
+
const finalTestId = dataTestId || "radio";
|
|
25
|
+
const internalRef = useRef(null);
|
|
26
|
+
const combinedRef = useCallback(
|
|
27
|
+
(element) => {
|
|
28
|
+
internalRef.current = element;
|
|
29
|
+
if (!ref) return;
|
|
30
|
+
if (typeof ref === "function") {
|
|
31
|
+
ref(element);
|
|
32
|
+
} else if ("current" in ref) {
|
|
33
|
+
ref.current = element;
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
[ref]
|
|
20
37
|
);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const TabsTrigger = forwardRef(
|
|
25
|
-
({ className, value, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
26
|
-
const finalDataCy = dataCy || (value ? `tabs-trigger-${value}` : "tabs-trigger");
|
|
27
|
-
const finalTestId = dataTestId || (value ? `tabs-trigger-${value}` : "tabs-trigger");
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
TabsPrimitive.Trigger,
|
|
30
|
-
{
|
|
31
|
-
ref,
|
|
32
|
-
className: cn("tabs-trigger", className),
|
|
33
|
-
value,
|
|
34
|
-
"data-cy": finalDataCy,
|
|
35
|
-
"data-testid": finalTestId,
|
|
36
|
-
...props
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
);
|
|
41
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
42
|
-
const TabsContent = forwardRef(
|
|
43
|
-
({ className, value, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
44
|
-
const finalDataCy = dataCy || (value ? `tabs-content-${value}` : "tabs-content");
|
|
45
|
-
const finalTestId = dataTestId || (value ? `tabs-content-${value}` : "tabs-content");
|
|
46
|
-
return /* @__PURE__ */ jsx(
|
|
47
|
-
TabsPrimitive.Content,
|
|
38
|
+
const displayLabel = label && required && !label.includes("*") ? `${label} *` : label;
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
|
+
"div",
|
|
48
41
|
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
className: cn("radio-wrapper", disabled && "radio-wrapper--disabled"),
|
|
43
|
+
"data-cy": `${finalDataCy}-wrapper`,
|
|
44
|
+
"data-testid": `${finalTestId}-wrapper`,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsxs("div", { className: "radio__container", children: [
|
|
47
|
+
/* @__PURE__ */ jsx(
|
|
48
|
+
"input",
|
|
49
|
+
{
|
|
50
|
+
ref: combinedRef,
|
|
51
|
+
id,
|
|
52
|
+
type: "radio",
|
|
53
|
+
checked,
|
|
54
|
+
className: cn("radio__input", error && "radio__input--error", className),
|
|
55
|
+
"aria-describedby": error ? errorId : helperText ? helperId : void 0,
|
|
56
|
+
"data-cy": finalDataCy,
|
|
57
|
+
"data-testid": finalTestId,
|
|
58
|
+
disabled,
|
|
59
|
+
required,
|
|
60
|
+
...props
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
label && /* @__PURE__ */ jsx(
|
|
64
|
+
"label",
|
|
65
|
+
{
|
|
66
|
+
htmlFor: id,
|
|
67
|
+
className: "radio__label",
|
|
68
|
+
"data-cy": `${finalDataCy}-label`,
|
|
69
|
+
"data-testid": `${finalTestId}-label`,
|
|
70
|
+
children: displayLabel
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }),
|
|
74
|
+
error && /* @__PURE__ */ jsx(
|
|
75
|
+
"span",
|
|
76
|
+
{
|
|
77
|
+
id: errorId,
|
|
78
|
+
className: "radio__error",
|
|
79
|
+
role: "alert",
|
|
80
|
+
"data-cy": `${finalDataCy}-error`,
|
|
81
|
+
"data-testid": `${finalTestId}-error`,
|
|
82
|
+
children: error
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
helperText && !error && /* @__PURE__ */ jsx(
|
|
86
|
+
"span",
|
|
87
|
+
{
|
|
88
|
+
id: helperId,
|
|
89
|
+
className: "radio__helper",
|
|
90
|
+
"data-cy": `${finalDataCy}-helper`,
|
|
91
|
+
"data-testid": `${finalTestId}-helper`,
|
|
92
|
+
children: helperText
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
]
|
|
55
96
|
}
|
|
56
97
|
);
|
|
57
98
|
}
|
|
58
99
|
);
|
|
59
|
-
|
|
100
|
+
Radio.displayName = "Radio";
|
|
60
101
|
export {
|
|
61
|
-
|
|
62
|
-
TabsContent,
|
|
63
|
-
TabsList,
|
|
64
|
-
TabsTrigger
|
|
102
|
+
Radio
|
|
65
103
|
};
|
package/dist/index11.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 e=require("react/jsx-runtime"),t=require("react"),a=require("@radix-ui/react-select"),r=require("./index31.cjs");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const a in e)if("default"!==a){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}return t.default=e,Object.freeze(t)};/* empty css */const s=l(a),c=s.Root,d=t.forwardRef(({className:a,children:l,label:c,error:d,helperText:i,fullWidth:o=!1,hasValue:n=!1,placeholder:p,id:u,"data-cy":h,"data-testid":m,disabled:g,required:x,...f},b)=>{const y=t.useId(),j=u||y,N=`${j}-label`,w=`${j}-error`,S=`${j}-helper`,$=h||"select-trigger",v=m||"select-trigger";return e.jsxs("div",{className:r.cn("select-wrapper",o&&"select-wrapper--full-width"),"data-cy":`${$}-wrapper`,"data-testid":`${v}-wrapper`,children:[c&&e.jsx("label",{id:N,htmlFor:j,className:r.cn("select__label",d&&"select__label--error",g&&"select__label--disabled"),"data-cy":`${$}-label`,"data-testid":`${v}-label`,children:c}),e.jsxs(s.Trigger,{ref:b,id:j,className:r.cn("select-trigger",d&&"select-trigger--error",o&&"select-trigger--full-width",!n&&"select-trigger--placeholder",a),"aria-invalid":d?"true":"false","aria-describedby":d?w:i?S:void 0,"aria-labelledby":c?N:void 0,"aria-required":x?"true":void 0,"data-cy":$,"data-testid":v,disabled:g,...f,children:[e.jsx("span",{className:"select-trigger__value",children:n?l:e.jsx("span",{"data-cy":`${$}-placeholder`,"data-testid":`${v}-placeholder`,children:p||c})}),e.jsx(s.Icon,{className:"select-trigger__icon","data-cy":`${$}-icon`,"data-testid":`${v}-icon`,children:e.jsx("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:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d&&e.jsx("span",{id:w,className:"select__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${v}-error`,children:d}),i&&!d&&e.jsx("span",{id:S,className:"select__helper","data-cy":`${$}-helper`,"data-testid":`${v}-helper`,children:i})]})});d.displayName="SelectTrigger";const i=s.Value,o=t.forwardRef(({className:t,children:a,position:l="popper","data-cy":c,"data-testid":d,...i},o)=>{const n=c||"select-content",p=d||"select-content";return e.jsx(s.Portal,{children:e.jsx(s.Content,{ref:o,className:r.cn("select-content",t),position:l,sideOffset:4,"data-cy":n,"data-testid":p,...i,children:e.jsx(s.Viewport,{className:"select-viewport",children:a})})})});o.displayName="SelectContent";const n=t.forwardRef(({className:t,children:a,value:l,"data-cy":c,"data-testid":d,...i},o)=>{const n=c||`select-item-${l}`,p=d||`select-item-${l}`;return e.jsx(s.Item,{ref:o,className:r.cn("select-item",t),value:l,"data-cy":n,"data-testid":p,...i,children:e.jsx(s.ItemText,{children:a})})});n.displayName="SelectItem";const p=s.Group,u=t.forwardRef(({className:t,"data-cy":a,"data-testid":l,...c},d)=>{const i=a||"select-label",o=l||"select-label";return e.jsx(s.Label,{ref:d,className:r.cn("select-group-label",t),"data-cy":i,"data-testid":o,...c})});u.displayName="SelectLabel";const h=t.forwardRef(({className:t,"data-cy":a,"data-testid":l,...c},d)=>{const i=a||"select-separator",o=l||"select-separator";return e.jsx(s.Separator,{ref:d,className:r.cn("select-separator",t),"data-cy":i,"data-testid":o,...c})});h.displayName="SelectSeparator",exports.Select=c,exports.SelectContent=o,exports.SelectGroup=p,exports.SelectItem=n,exports.SelectLabel=u,exports.SelectSeparator=h,exports.SelectTrigger=d,exports.SelectValue=i;
|
package/dist/index11.js
CHANGED
|
@@ -1,71 +1,230 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import
|
|
2
|
+
import { forwardRef, useId } from "react";
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
import { cn } from "./index31.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
const
|
|
6
|
+
const Select = SelectPrimitive.Root;
|
|
7
|
+
const SelectTrigger = forwardRef(
|
|
6
8
|
({
|
|
7
|
-
variant = "info",
|
|
8
|
-
title,
|
|
9
|
-
icon,
|
|
10
9
|
className,
|
|
11
10
|
children,
|
|
11
|
+
label,
|
|
12
|
+
error,
|
|
13
|
+
helperText,
|
|
14
|
+
fullWidth = false,
|
|
15
|
+
hasValue = false,
|
|
16
|
+
placeholder,
|
|
17
|
+
id: providedId,
|
|
12
18
|
"data-cy": dataCy,
|
|
13
19
|
"data-testid": dataTestId,
|
|
20
|
+
disabled,
|
|
21
|
+
required,
|
|
14
22
|
...props
|
|
15
23
|
}, ref) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
const finalTestId = dataTestId || `alert-${variant}`;
|
|
24
|
+
const generatedId = useId();
|
|
25
|
+
const id = providedId || generatedId;
|
|
26
|
+
const labelId = `${id}-label`;
|
|
27
|
+
const errorId = `${id}-error`;
|
|
28
|
+
const helperId = `${id}-helper`;
|
|
29
|
+
const finalDataCy = dataCy || "select-trigger";
|
|
30
|
+
const finalTestId = dataTestId || "select-trigger";
|
|
24
31
|
return /* @__PURE__ */ jsxs(
|
|
25
32
|
"div",
|
|
26
33
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"data-cy": finalDataCy,
|
|
31
|
-
"data-testid": finalTestId,
|
|
32
|
-
...props,
|
|
34
|
+
className: cn("select-wrapper", fullWidth && "select-wrapper--full-width"),
|
|
35
|
+
"data-cy": `${finalDataCy}-wrapper`,
|
|
36
|
+
"data-testid": `${finalTestId}-wrapper`,
|
|
33
37
|
children: [
|
|
34
|
-
|
|
35
|
-
"
|
|
38
|
+
label && /* @__PURE__ */ jsx(
|
|
39
|
+
"label",
|
|
36
40
|
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
id: labelId,
|
|
42
|
+
htmlFor: id,
|
|
43
|
+
className: cn(
|
|
44
|
+
"select__label",
|
|
45
|
+
error && "select__label--error",
|
|
46
|
+
disabled && "select__label--disabled"
|
|
47
|
+
),
|
|
48
|
+
"data-cy": `${finalDataCy}-label`,
|
|
49
|
+
"data-testid": `${finalTestId}-label`,
|
|
50
|
+
children: label
|
|
41
51
|
}
|
|
42
52
|
),
|
|
43
53
|
/* @__PURE__ */ jsxs(
|
|
44
|
-
|
|
54
|
+
SelectPrimitive.Trigger,
|
|
45
55
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
ref,
|
|
57
|
+
id,
|
|
58
|
+
className: cn(
|
|
59
|
+
"select-trigger",
|
|
60
|
+
error && "select-trigger--error",
|
|
61
|
+
fullWidth && "select-trigger--full-width",
|
|
62
|
+
!hasValue && "select-trigger--placeholder",
|
|
63
|
+
className
|
|
64
|
+
),
|
|
65
|
+
"aria-invalid": error ? "true" : "false",
|
|
66
|
+
"aria-describedby": error ? errorId : helperText ? helperId : void 0,
|
|
67
|
+
"aria-labelledby": label ? labelId : void 0,
|
|
68
|
+
"aria-required": required ? "true" : void 0,
|
|
69
|
+
"data-cy": finalDataCy,
|
|
70
|
+
"data-testid": finalTestId,
|
|
71
|
+
disabled,
|
|
72
|
+
...props,
|
|
49
73
|
children: [
|
|
50
|
-
|
|
51
|
-
"
|
|
74
|
+
/* @__PURE__ */ jsx("span", { className: "select-trigger__value", children: hasValue ? children : /* @__PURE__ */ jsx(
|
|
75
|
+
"span",
|
|
76
|
+
{
|
|
77
|
+
"data-cy": `${finalDataCy}-placeholder`,
|
|
78
|
+
"data-testid": `${finalTestId}-placeholder`,
|
|
79
|
+
children: placeholder || label
|
|
80
|
+
}
|
|
81
|
+
) }),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
SelectPrimitive.Icon,
|
|
52
84
|
{
|
|
53
|
-
className: "
|
|
54
|
-
"data-cy": `${finalDataCy}-
|
|
55
|
-
"data-testid": `${finalTestId}-
|
|
56
|
-
children:
|
|
85
|
+
className: "select-trigger__icon",
|
|
86
|
+
"data-cy": `${finalDataCy}-icon`,
|
|
87
|
+
"data-testid": `${finalTestId}-icon`,
|
|
88
|
+
children: /* @__PURE__ */ jsx(
|
|
89
|
+
"svg",
|
|
90
|
+
{
|
|
91
|
+
width: "20",
|
|
92
|
+
height: "20",
|
|
93
|
+
viewBox: "0 0 20 20",
|
|
94
|
+
fill: "none",
|
|
95
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
96
|
+
"aria-hidden": "true",
|
|
97
|
+
children: /* @__PURE__ */ jsx(
|
|
98
|
+
"path",
|
|
99
|
+
{
|
|
100
|
+
d: "M5 7.5L10 12.5L15 7.5",
|
|
101
|
+
stroke: "currentColor",
|
|
102
|
+
strokeWidth: "1.5",
|
|
103
|
+
strokeLinecap: "round",
|
|
104
|
+
strokeLinejoin: "round"
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
)
|
|
57
109
|
}
|
|
58
|
-
)
|
|
59
|
-
/* @__PURE__ */ jsx("div", { "data-cy": `${finalDataCy}-message`, "data-testid": `${finalTestId}-message`, children })
|
|
110
|
+
)
|
|
60
111
|
]
|
|
61
112
|
}
|
|
113
|
+
),
|
|
114
|
+
error && /* @__PURE__ */ jsx(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
id: errorId,
|
|
118
|
+
className: "select__error",
|
|
119
|
+
role: "alert",
|
|
120
|
+
"data-cy": `${finalDataCy}-error`,
|
|
121
|
+
"data-testid": `${finalTestId}-error`,
|
|
122
|
+
children: error
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
helperText && !error && /* @__PURE__ */ jsx(
|
|
126
|
+
"span",
|
|
127
|
+
{
|
|
128
|
+
id: helperId,
|
|
129
|
+
className: "select__helper",
|
|
130
|
+
"data-cy": `${finalDataCy}-helper`,
|
|
131
|
+
"data-testid": `${finalTestId}-helper`,
|
|
132
|
+
children: helperText
|
|
133
|
+
}
|
|
62
134
|
)
|
|
63
135
|
]
|
|
64
136
|
}
|
|
65
137
|
);
|
|
66
138
|
}
|
|
67
139
|
);
|
|
68
|
-
|
|
140
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
141
|
+
const SelectValue = SelectPrimitive.Value;
|
|
142
|
+
const SelectContent = forwardRef(
|
|
143
|
+
({
|
|
144
|
+
className,
|
|
145
|
+
children,
|
|
146
|
+
position = "popper",
|
|
147
|
+
"data-cy": dataCy,
|
|
148
|
+
"data-testid": dataTestId,
|
|
149
|
+
...props
|
|
150
|
+
}, ref) => {
|
|
151
|
+
const finalDataCy = dataCy || "select-content";
|
|
152
|
+
const finalTestId = dataTestId || "select-content";
|
|
153
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
154
|
+
SelectPrimitive.Content,
|
|
155
|
+
{
|
|
156
|
+
ref,
|
|
157
|
+
className: cn("select-content", className),
|
|
158
|
+
position,
|
|
159
|
+
sideOffset: 4,
|
|
160
|
+
"data-cy": finalDataCy,
|
|
161
|
+
"data-testid": finalTestId,
|
|
162
|
+
...props,
|
|
163
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: "select-viewport", children })
|
|
164
|
+
}
|
|
165
|
+
) });
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
SelectContent.displayName = "SelectContent";
|
|
169
|
+
const SelectItem = forwardRef(
|
|
170
|
+
({ className, children, value, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
171
|
+
const finalDataCy = dataCy || `select-item-${value}`;
|
|
172
|
+
const finalTestId = dataTestId || `select-item-${value}`;
|
|
173
|
+
return /* @__PURE__ */ jsx(
|
|
174
|
+
SelectPrimitive.Item,
|
|
175
|
+
{
|
|
176
|
+
ref,
|
|
177
|
+
className: cn("select-item", className),
|
|
178
|
+
value,
|
|
179
|
+
"data-cy": finalDataCy,
|
|
180
|
+
"data-testid": finalTestId,
|
|
181
|
+
...props,
|
|
182
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
SelectItem.displayName = "SelectItem";
|
|
188
|
+
const SelectGroup = SelectPrimitive.Group;
|
|
189
|
+
const SelectLabel = forwardRef(
|
|
190
|
+
({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
191
|
+
const finalDataCy = dataCy || "select-label";
|
|
192
|
+
const finalTestId = dataTestId || "select-label";
|
|
193
|
+
return /* @__PURE__ */ jsx(
|
|
194
|
+
SelectPrimitive.Label,
|
|
195
|
+
{
|
|
196
|
+
ref,
|
|
197
|
+
className: cn("select-group-label", className),
|
|
198
|
+
"data-cy": finalDataCy,
|
|
199
|
+
"data-testid": finalTestId,
|
|
200
|
+
...props
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
SelectLabel.displayName = "SelectLabel";
|
|
206
|
+
const SelectSeparator = forwardRef(({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
|
|
207
|
+
const finalDataCy = dataCy || "select-separator";
|
|
208
|
+
const finalTestId = dataTestId || "select-separator";
|
|
209
|
+
return /* @__PURE__ */ jsx(
|
|
210
|
+
SelectPrimitive.Separator,
|
|
211
|
+
{
|
|
212
|
+
ref,
|
|
213
|
+
className: cn("select-separator", className),
|
|
214
|
+
"data-cy": finalDataCy,
|
|
215
|
+
"data-testid": finalTestId,
|
|
216
|
+
...props
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
});
|
|
220
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
69
221
|
export {
|
|
70
|
-
|
|
222
|
+
Select,
|
|
223
|
+
SelectContent,
|
|
224
|
+
SelectGroup,
|
|
225
|
+
SelectItem,
|
|
226
|
+
SelectLabel,
|
|
227
|
+
SelectSeparator,
|
|
228
|
+
SelectTrigger,
|
|
229
|
+
SelectValue
|
|
71
230
|
};
|
package/dist/index12.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 e=require("react/jsx-runtime"),t=require("react"),n=require("./index31.cjs"),a=require("@adam-milo/icons"),o=require("./index32.cjs");;/* empty css */const r=t.forwardRef(({label:r,error:s,helperText:i,fullWidth:l=!0,value:d="",onChange:c,countryCode:u="US",onCountryChange:p,countries:h=o.commonCountries,enableFormatting:m=!0,onValidationChange:g,disabled:x,required:y,placeholder:f,id:C,"data-cy":b,"data-testid":_,className:$,onFocus:v,onBlur:w,...k},j)=>{const[D,N]=t.useState(!1),[P,M]=t.useState(!1),[q,L]=t.useState(0),S=t.useId(),B=C||S,E=`${B}-error`,I=`${B}-helper`,F=`${B}-listbox`,R=t.useRef(null),T=t.useRef(null),A=t.useRef(null),K=b||"phone-input",V=_||"phone-input",U=h.find(e=>e.code===u)||h[0],z=o.getPhoneMask(u),O=f||z.placeholder,W=r&&y&&!r.includes("*")?`${r}*`:r;t.useEffect(()=>{const e=e=>{R.current&&!R.current.contains(e.target)&&N(!1)};return D&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[D]);const G=t.useCallback(e=>{null==p||p(e),N(!1),setTimeout(()=>{var e;const t=null==(e=R.current)?void 0:e.querySelector("input");null==t||t.focus()},0)},[p]),H=t.useCallback(e=>{var t;switch(e.key){case"ArrowDown":e.preventDefault(),L(e=>Math.min(e+1,h.length-1));break;case"ArrowUp":e.preventDefault(),L(e=>Math.max(e-1,0));break;case"Enter":case" ":e.preventDefault(),G(h[q]);break;case"Escape":e.preventDefault(),N(!1),null==(t=A.current)||t.focus();break;case"Tab":N(!1)}},[h,q,G]),J=x?"disabled":s?"error":P||D?"focus":"idle";return e.jsxs("div",{ref:R,className:n.cn("phone-input-wrapper",l&&"phone-input-wrapper--full-width"),"data-cy":`${K}-wrapper`,"data-testid":`${V}-wrapper`,children:[r&&e.jsx("label",{htmlFor:B,className:"phone-input__label","data-cy":`${K}-label`,"data-testid":`${V}-label`,children:W}),e.jsxs("div",{className:n.cn("phone-input__container","focus"===J&&"phone-input__container--focus","error"===J&&"phone-input__container--error","disabled"===J&&"phone-input__container--disabled"),"data-state":J,"data-cy":`${K}-container`,"data-testid":`${V}-container`,children:[e.jsxs("button",{ref:A,type:"button",className:"phone-input__country-trigger",onClick:()=>!x&&N(!D),onKeyDown:e=>{if("Enter"===e.key||" "===e.key||"ArrowDown"===e.key){e.preventDefault(),N(!0);const t=h.findIndex(e=>e.code===u);L(-1===t?0:t)}},disabled:x,"aria-haspopup":"listbox","aria-expanded":D,"aria-controls":F,"aria-label":`Select country. Current: ${U.name}`,"data-cy":`${K}-country-trigger`,"data-testid":`${V}-country-trigger`,children:[e.jsx("span",{className:"phone-input__flag","data-cy":`${K}-flag`,"data-testid":`${V}-flag`,children:U.flag}),e.jsx(a.Icon,{name:"ChevronDownIcon",size:"sm",color:P||D?"clickable":"text",decorative:!0,"data-cy":`${K}-chevron`})]}),e.jsx("span",{className:"phone-input__dial-code","data-cy":`${K}-dial-code`,"data-testid":`${V}-dial-code`,children:U.dialCode}),e.jsx("input",{ref:j,id:B,type:"tel",inputMode:"numeric",value:d,onChange:e=>{const t=e.target.value;if(m){const e=o.getPhoneDigits(t).slice(0,z.maxLength),n=o.formatPhoneNumber(e,u);null==c||c(n);const a=e.length===z.maxLength;null==g||g(a)}else{const e=t.replace(/[^0-9]/g,"");null==c||c(e);const n=e.length===z.maxLength;null==g||g(n)}},onFocus:e=>{M(!0),null==v||v(e)},onBlur:e=>{M(!1),null==w||w(e)},placeholder:O,disabled:x,required:y,className:n.cn("phone-input__input",$),"aria-invalid":s?"true":"false","aria-required":y?"true":void 0,"aria-describedby":s?E:i?I:void 0,"data-cy":K,"data-testid":V,...k})]}),D&&e.jsx("div",{ref:T,id:F,role:"listbox","aria-label":"Select country",className:"phone-input__dropdown",tabIndex:-1,onKeyDown:H,"data-cy":`${K}-dropdown`,"data-testid":`${V}-dropdown`,children:h.map((t,a)=>e.jsxs("div",{role:"option","aria-selected":t.code===u,className:n.cn("phone-input__option",t.code===u&&"phone-input__option--selected",a===q&&"phone-input__option--highlighted"),onClick:()=>G(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),G(t))},onMouseEnter:()=>L(a),tabIndex:a===q?0:-1,"data-cy":`${K}-option-${t.code.toLowerCase()}`,"data-testid":`${V}-option-${t.code.toLowerCase()}`,children:[e.jsx("span",{className:"phone-input__option-flag",children:t.flag}),e.jsx("span",{className:"phone-input__option-name",children:t.name}),e.jsx("span",{className:"phone-input__option-dial-code",children:t.dialCode})]},t.code))}),s&&e.jsx("span",{id:E,className:"phone-input__error",role:"alert","data-cy":`${K}-error`,"data-testid":`${V}-error`,children:s}),i&&!s&&e.jsx("span",{id:I,className:"phone-input__helper","data-cy":`${K}-helper`,"data-testid":`${V}-helper`,children:i})]})});r.displayName="PhoneInput",exports.allCountries=o.allCountries,exports.commonCountries=o.commonCountries,exports.defaultCountries=o.defaultCountries,exports.defaultPhoneMask=o.defaultPhoneMask,exports.formatPhoneNumber=o.formatPhoneNumber,exports.getCountriesByDialCode=o.getCountriesByDialCode,exports.getCountryByCode=o.getCountryByCode,exports.getCountryByDialCode=o.getCountryByDialCode,exports.getPhoneDigits=o.getPhoneDigits,exports.getPhoneMask=o.getPhoneMask,exports.isValidPhoneLength=o.isValidPhoneLength,exports.phoneMasks=o.phoneMasks,exports.searchCountries=o.searchCountries,exports.PhoneInput=r;
|