@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.
Files changed (152) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +58 -22
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +94 -56
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +199 -40
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +305 -105
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +260 -74
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +135 -27
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +52 -469
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +57 -111
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +101 -20
  19. package/dist/index18.cjs +1 -1
  20. package/dist/index18.js +76 -21
  21. package/dist/index19.cjs +1 -1
  22. package/dist/index19.js +25 -29
  23. package/dist/index2.cjs +1 -1
  24. package/dist/index2.js +6 -4
  25. package/dist/index20.cjs +1 -1
  26. package/dist/index20.js +468 -31
  27. package/dist/index21.cjs +1 -1
  28. package/dist/index21.js +155 -41
  29. package/dist/index22.cjs +1 -1
  30. package/dist/index22.js +42 -12
  31. package/dist/index23.cjs +1 -0
  32. package/dist/index23.js +38 -0
  33. package/dist/index24.cjs +1 -1
  34. package/dist/index24.js +32 -287
  35. package/dist/index25.cjs +1 -1
  36. package/dist/index25.js +115 -13
  37. package/dist/index26.cjs +1 -0
  38. package/dist/index26.js +55 -0
  39. package/dist/index27.cjs +1 -0
  40. package/dist/index27.js +45 -0
  41. package/dist/index28.cjs +1 -0
  42. package/dist/index28.js +53 -0
  43. package/dist/index29.cjs +1 -0
  44. package/dist/index29.js +55 -0
  45. package/dist/index3.cjs +1 -1
  46. package/dist/index3.js +33 -33
  47. package/dist/index30.cjs +1 -0
  48. package/dist/index30.js +72 -0
  49. package/dist/index31.cjs +1 -0
  50. package/dist/index31.js +14 -0
  51. package/dist/index32.cjs +1 -0
  52. package/dist/index32.js +332 -0
  53. package/dist/index36.cjs +1 -0
  54. package/dist/index36.js +386 -0
  55. package/dist/index37.cjs +1 -0
  56. package/dist/index37.js +16 -0
  57. package/dist/index4.cjs +1 -1
  58. package/dist/index4.js +59 -11
  59. package/dist/index5.cjs +1 -1
  60. package/dist/index5.js +19 -35
  61. package/dist/index6.cjs +1 -1
  62. package/dist/index6.js +11 -101
  63. package/dist/index62.cjs +1 -0
  64. package/dist/index62.js +502 -0
  65. package/dist/index64.cjs +1 -0
  66. package/dist/index64.js +11 -0
  67. package/dist/index65.cjs +1 -0
  68. package/dist/index65.js +39 -0
  69. package/dist/index66.cjs +1 -0
  70. package/dist/index66.js +64 -0
  71. package/dist/index67.cjs +1 -0
  72. package/dist/index67.js +212 -0
  73. package/dist/index68.cjs +1 -0
  74. package/dist/index68.js +14 -0
  75. package/dist/index69.cjs +1 -0
  76. package/dist/index69.js +293 -0
  77. package/dist/index7.cjs +1 -1
  78. package/dist/index7.js +46 -97
  79. package/dist/index70.cjs +1 -0
  80. package/dist/index70.js +18 -0
  81. package/dist/index71.cjs +1 -0
  82. package/dist/index71.js +129 -0
  83. package/dist/index72.cjs +1 -0
  84. package/dist/index72.js +43 -0
  85. package/dist/index73.cjs +1 -0
  86. package/dist/index73.js +99 -0
  87. package/dist/index74.cjs +1 -0
  88. package/dist/index74.js +71 -0
  89. package/dist/index75.cjs +1 -0
  90. package/dist/index75.js +36 -0
  91. package/dist/index76.cjs +1 -0
  92. package/dist/index76.js +14 -0
  93. package/dist/index77.cjs +1 -0
  94. package/dist/index77.js +17 -0
  95. package/dist/index78.cjs +1 -0
  96. package/dist/index78.js +6 -0
  97. package/dist/index79.cjs +1 -0
  98. package/dist/index79.js +297 -0
  99. package/dist/index8.cjs +1 -1
  100. package/dist/index8.js +97 -88
  101. package/dist/index80.cjs +1 -0
  102. package/dist/index80.js +25 -0
  103. package/dist/index81.cjs +1 -0
  104. package/dist/index81.js +39 -0
  105. package/dist/index82.cjs +1 -0
  106. package/dist/index82.js +625 -0
  107. package/dist/index83.cjs +1 -0
  108. package/dist/index83.js +721 -0
  109. package/dist/index84.cjs +1 -0
  110. package/dist/index84.js +154 -0
  111. package/dist/index85.cjs +1 -0
  112. package/dist/index85.js +173 -0
  113. package/dist/index9.cjs +1 -1
  114. package/dist/index9.js +55 -197
  115. package/dist/src/components/core/button/Button.component.d.ts +13 -7
  116. package/dist/src/components/core/button/Button.component.d.ts.map +1 -1
  117. package/dist/src/components/core/icon/Icon.component.d.ts +1 -1
  118. package/dist/src/components/core/icon/Icon.component.d.ts.map +1 -1
  119. package/dist/src/components/core/icon-button/IconButton.component.d.ts +36 -0
  120. package/dist/src/components/core/icon-button/IconButton.component.d.ts.map +1 -0
  121. package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts +79 -0
  122. package/dist/src/components/core/menu-icon-button/MenuIconButton.component.d.ts.map +1 -0
  123. package/dist/src/components/feedback/spinner/Spinner.component.d.ts +62 -0
  124. package/dist/src/components/feedback/spinner/Spinner.component.d.ts.map +1 -0
  125. package/dist/src/components/forms/input/Input.component.d.ts +5 -0
  126. package/dist/src/components/forms/input/Input.component.d.ts.map +1 -1
  127. package/dist/src/components/forms/otp-input/OTPInput.component.d.ts +82 -0
  128. package/dist/src/components/forms/otp-input/OTPInput.component.d.ts.map +1 -0
  129. package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts +96 -0
  130. package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -0
  131. package/dist/src/components/forms/phone-input/countries.d.ts +93 -0
  132. package/dist/src/components/forms/phone-input/countries.d.ts.map +1 -0
  133. package/dist/src/components/forms/select/Select.component.d.ts +5 -1
  134. package/dist/src/components/forms/select/Select.component.d.ts.map +1 -1
  135. package/dist/src/components/forms/toggle/Toggle.component.d.ts +80 -0
  136. package/dist/src/components/forms/toggle/Toggle.component.d.ts.map +1 -0
  137. package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts +86 -0
  138. package/dist/src/components/layout/auth-layout/AuthLayout.component.d.ts.map +1 -0
  139. package/dist/src/components/overlays/dialog/Dialog.component.d.ts +36 -2
  140. package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -1
  141. package/dist/src/components/typography/heading/Heading.component.d.ts +92 -0
  142. package/dist/src/components/typography/heading/Heading.component.d.ts.map +1 -0
  143. package/dist/src/components/typography/link/Link.component.d.ts +80 -0
  144. package/dist/src/components/typography/link/Link.component.d.ts.map +1 -0
  145. package/dist/src/index.d.ts +24 -5
  146. package/dist/src/index.d.ts.map +1 -1
  147. package/dist/style.css +1 -1
  148. package/package.json +2 -1
  149. /package/dist/{index35.cjs → index50.cjs} +0 -0
  150. /package/dist/{index35.js → index50.js} +0 -0
  151. /package/dist/{index42.cjs → index61.cjs} +0 -0
  152. /package/dist/{index42.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"),a=require("./index8.cjs"),p=require("./index9.cjs"),x=require("./index10.cjs"),n=require("./index11.cjs"),l=require("./index12.cjs"),c=require("./index13.cjs"),d=require("./index14.cjs"),u=require("./index15.cjs"),g=require("./index16.cjs"),C=require("./index17.cjs"),D=require("./index18.cjs"),j=require("./index19.cjs"),T=require("./index20.cjs"),b=require("./index21.cjs"),q=require("./index22.cjs"),S=require("@adam-milo/icons");exports.Button=e.Button,exports.EmailInput=r.EmailInput,exports.PasswordInput=t.PasswordInput,exports.NumericInput=o.NumericInput,exports.AlphanumericInput=i.AlphanumericInput,exports.Checkbox=s.Checkbox,exports.Radio=a.Radio,exports.Select=p.Select,exports.SelectContent=p.SelectContent,exports.SelectGroup=p.SelectGroup,exports.SelectItem=p.SelectItem,exports.SelectLabel=p.SelectLabel,exports.SelectSeparator=p.SelectSeparator,exports.SelectTrigger=p.SelectTrigger,exports.SelectValue=p.SelectValue,exports.Tabs=x.Tabs,exports.TabsContent=x.TabsContent,exports.TabsList=x.TabsList,exports.TabsTrigger=x.TabsTrigger,exports.Alert=n.Alert,exports.Card=l.Card,exports.CardContent=l.CardContent,exports.CardDescription=l.CardDescription,exports.CardFooter=l.CardFooter,exports.CardHeader=l.CardHeader,exports.CardTitle=l.CardTitle,exports.DataTable=c.DataTable,exports.Chip=d.Chip,exports.ChipGroup=u.ChipGroup,exports.Dialog=g.Dialog,exports.DialogClose=g.DialogClose,exports.DialogContent=g.DialogContent,exports.DialogDescription=g.DialogDescription,exports.DialogFooter=g.DialogFooter,exports.DialogHeader=g.DialogHeader,exports.DialogOverlay=g.DialogOverlay,exports.DialogPortal=g.DialogPortal,exports.DialogTitle=g.DialogTitle,exports.DialogTrigger=g.DialogTrigger,exports.Stack=C.Stack,exports.Container=D.Container,exports.Divider=j.Divider,exports.Text=T.Text,exports.Grid=b.Grid,exports.cn=q.cn,exports.generateId=q.generateId,Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>S.Icon}),Object.defineProperty(exports,"availableIcons",{enumerable:!0,get:()=>S.availableIcons});
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,28 +1,39 @@
1
1
  import { Button } from "./index2.js";
2
- import { EmailInput } from "./index3.js";
3
- import { PasswordInput } from "./index4.js";
4
- import { NumericInput } from "./index5.js";
5
- import { AlphanumericInput } from "./index6.js";
6
- import { Checkbox } from "./index7.js";
7
- import { Radio } from "./index8.js";
8
- import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "./index9.js";
9
- import { Tabs, TabsContent, TabsList, TabsTrigger } from "./index10.js";
10
- import { Alert } from "./index11.js";
11
- import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./index12.js";
12
- import { DataTable } from "./index13.js";
13
- import { Chip } from "./index14.js";
14
- import { ChipGroup } from "./index15.js";
15
- import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from "./index16.js";
16
- import { Stack } from "./index17.js";
17
- import { Container } from "./index18.js";
18
- import { Divider } from "./index19.js";
19
- import { Text } from "./index20.js";
20
- import { Grid } from "./index21.js";
21
- import { cn, generateId } from "./index22.js";
22
- import { Icon, availableIcons } from "@adam-milo/icons";
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";
23
33
  export {
24
34
  Alert,
25
35
  AlphanumericInput,
36
+ AuthLayout,
26
37
  Button,
27
38
  Card,
28
39
  CardContent,
@@ -37,10 +48,12 @@ export {
37
48
  DataTable,
38
49
  Dialog,
39
50
  DialogClose,
51
+ DialogCloseButton,
40
52
  DialogContent,
41
53
  DialogDescription,
42
54
  DialogFooter,
43
55
  DialogHeader,
56
+ DialogIcon,
44
57
  DialogOverlay,
45
58
  DialogPortal,
46
59
  DialogTitle,
@@ -48,9 +61,15 @@ export {
48
61
  Divider,
49
62
  EmailInput,
50
63
  Grid,
64
+ Heading,
51
65
  Icon,
66
+ IconButton,
67
+ Link,
68
+ MenuIconButton,
52
69
  NumericInput,
70
+ OTPInput,
53
71
  PasswordInput,
72
+ PhoneInput,
54
73
  Radio,
55
74
  Select,
56
75
  SelectContent,
@@ -60,13 +79,30 @@ export {
60
79
  SelectSeparator,
61
80
  SelectTrigger,
62
81
  SelectValue,
82
+ Spinner,
63
83
  Stack,
64
84
  Tabs,
65
85
  TabsContent,
66
86
  TabsList,
67
87
  TabsTrigger,
68
88
  Text,
89
+ Toggle,
90
+ allCountries,
69
91
  availableIcons,
70
92
  cn,
71
- generateId
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
72
108
  };
package/dist/index10.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),e=require("react"),a=require("@radix-ui/react-tabs"),s=require("./index22.cjs");function r(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const a in t)if("default"!==a){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>t[a]})}return e.default=t,Object.freeze(e)};/* empty css */const i=r(a),n=i.Root,c=e.forwardRef(({className:e,"data-cy":a,"data-testid":r,...n},c)=>{const o=a||"tabs-list",d=r||"tabs-list";return t.jsx(i.List,{ref:c,className:s.cn("tabs-list",e),"data-cy":o,"data-testid":d,...n})});c.displayName=i.List.displayName;const o=e.forwardRef(({className:e,value:a,"data-cy":r,"data-testid":n,...c},o)=>{const d=r||(a?`tabs-trigger-${a}`:"tabs-trigger"),l=n||(a?`tabs-trigger-${a}`:"tabs-trigger");return t.jsx(i.Trigger,{ref:o,className:s.cn("tabs-trigger",e),value:a,"data-cy":d,"data-testid":l,...c})});o.displayName=i.Trigger.displayName;const d=e.forwardRef(({className:e,value:a,"data-cy":r,"data-testid":n,...c},o)=>{const d=r||(a?`tabs-content-${a}`:"tabs-content"),l=n||(a?`tabs-content-${a}`:"tabs-content");return t.jsx(i.Content,{ref:o,className:s.cn("tabs-content",e),value:a,"data-cy":d,"data-testid":l,...c})});d.displayName=i.Content.displayName,exports.Tabs=n,exports.TabsContent=d,exports.TabsList=c,exports.TabsTrigger=o;
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 * as TabsPrimitive from "@radix-ui/react-tabs";
4
- import { cn } from "./index22.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 Tabs = TabsPrimitive.Root;
7
- const TabsList = forwardRef(
8
- ({ className, "data-cy": dataCy, "data-testid": dataTestId, ...props }, ref) => {
9
- const finalDataCy = dataCy || "tabs-list";
10
- const finalTestId = dataTestId || "tabs-list";
11
- return /* @__PURE__ */ jsx(
12
- TabsPrimitive.List,
13
- {
14
- ref,
15
- className: cn("tabs-list", className),
16
- "data-cy": finalDataCy,
17
- "data-testid": finalTestId,
18
- ...props
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
- TabsList.displayName = TabsPrimitive.List.displayName;
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
- ref,
50
- className: cn("tabs-content", className),
51
- value,
52
- "data-cy": finalDataCy,
53
- "data-testid": finalTestId,
54
- ...props
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
- TabsContent.displayName = TabsPrimitive.Content.displayName;
100
+ Radio.displayName = "Radio";
60
101
  export {
61
- Tabs,
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 t=require("react/jsx-runtime"),e=require("react"),a=require("./index22.cjs");;/* empty css */const r=e.forwardRef(({variant:e="info",title:r,icon:s,className:i,children:c,"data-cy":d,"data-testid":l,...n},o)=>{const u=d||`alert-${e}`,$=l||`alert-${e}`;return t.jsxs("div",{ref:o,role:{info:"status",success:"status",warning:"alert",error:"alert"}[e],className:a.cn("alert",`alert--${e}`,i),"data-cy":u,"data-testid":$,...n,children:[s&&t.jsx("div",{className:"alert__icon","data-cy":`${u}-icon`,"data-testid":`${$}-icon`,children:s}),t.jsxs("div",{className:"alert__content","data-cy":`${u}-content`,"data-testid":`${$}-content`,children:[r&&t.jsx("div",{className:"alert__title","data-cy":`${u}-title`,"data-testid":`${$}-title`,children:r}),t.jsx("div",{"data-cy":`${u}-message`,"data-testid":`${$}-message`,children:c})]})]})});r.displayName="Alert",exports.Alert=r;
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 { cn } from "./index22.js";
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 Alert = forwardRef(
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 roleMap = {
17
- info: "status",
18
- success: "status",
19
- warning: "alert",
20
- error: "alert"
21
- };
22
- const finalDataCy = dataCy || `alert-${variant}`;
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
- ref,
28
- role: roleMap[variant],
29
- className: cn("alert", `alert--${variant}`, className),
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
- icon && /* @__PURE__ */ jsx(
35
- "div",
38
+ label && /* @__PURE__ */ jsx(
39
+ "label",
36
40
  {
37
- className: "alert__icon",
38
- "data-cy": `${finalDataCy}-icon`,
39
- "data-testid": `${finalTestId}-icon`,
40
- children: icon
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
- "div",
54
+ SelectPrimitive.Trigger,
45
55
  {
46
- className: "alert__content",
47
- "data-cy": `${finalDataCy}-content`,
48
- "data-testid": `${finalTestId}-content`,
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
- title && /* @__PURE__ */ jsx(
51
- "div",
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: "alert__title",
54
- "data-cy": `${finalDataCy}-title`,
55
- "data-testid": `${finalTestId}-title`,
56
- children: title
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
- Alert.displayName = "Alert";
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
- Alert
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 a=require("react/jsx-runtime"),t=require("react"),e=require("./index22.cjs");;/* empty css */const r=t.forwardRef(({variant:t="default",className:r,children:d,"data-cy":c,"data-testid":s,...i},o)=>{const n=c||`card-${t}`,l=s||`card-${t}`;return a.jsx("div",{ref:o,className:e.cn("card",`card--${t}`,r),"data-cy":n,"data-testid":l,...i,children:d})});r.displayName="Card";const d=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-header",o=d||"card-header";return a.jsx("div",{ref:s,className:e.cn("card-header",t),"data-cy":i,"data-testid":o,...c})});d.displayName="CardHeader";const c=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-title",o=d||"card-title";return a.jsx("h3",{ref:s,className:e.cn("card-title",t),"data-cy":i,"data-testid":o,...c})});c.displayName="CardTitle";const s=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-description",o=d||"card-description";return a.jsx("p",{ref:s,className:e.cn("card-description",t),"data-cy":i,"data-testid":o,...c})});s.displayName="CardDescription";const i=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-content",o=d||"card-content";return a.jsx("div",{ref:s,className:e.cn("card-content",t),"data-cy":i,"data-testid":o,...c})});i.displayName="CardContent";const o=t.forwardRef(({className:t,"data-cy":r,"data-testid":d,...c},s)=>{const i=r||"card-footer",o=d||"card-footer";return a.jsx("div",{ref:s,className:e.cn("card-footer",t),"data-cy":i,"data-testid":o,...c})});o.displayName="CardFooter",exports.Card=r,exports.CardContent=i,exports.CardDescription=s,exports.CardFooter=o,exports.CardHeader=d,exports.CardTitle=c;
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;