@adam-milo/ui 1.0.141 → 1.0.142
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 +1 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +1 -1
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +1 -1
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +1 -1
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +1 -1
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +1 -1
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +1 -1
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +1 -1
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +1 -1
- package/dist/index108.cjs +1 -1
- package/dist/index108.js +1 -1
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +1 -1
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +1 -1
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +1 -1
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +1 -1
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +1 -1
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +1 -1
- package/dist/index116.cjs +1 -1
- package/dist/index116.js +1 -1
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +1 -1
- package/dist/index118.cjs +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +1 -1
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +1 -1
- package/dist/index122.cjs +1 -1
- package/dist/index122.js +1 -1
- package/dist/index123.cjs +1 -1
- package/dist/index123.js +1 -1
- package/dist/index124.cjs +1 -1
- package/dist/index124.js +1 -1
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.cjs +1 -1
- package/dist/index126.js +1 -1
- package/dist/index127.cjs +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.cjs +1 -1
- package/dist/index128.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +1 -0
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +1 -1
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +1 -1
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +1 -1
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +1 -1
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +1 -1
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +1 -1
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +1 -1
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +1 -1
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +1 -1
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +1 -1
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +1 -1
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +1 -1
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +1 -1
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +1 -1
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +1 -1
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +1 -1
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +1 -1
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +1 -1
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +1 -1
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +1 -1
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +1 -1
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +1 -1
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +1 -1
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +1 -1
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +1 -1
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +1 -1
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +1 -1
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +10 -10
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +1 -1
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +9 -9
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +1 -1
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +1 -1
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +1 -1
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +1 -1
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +1 -1
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +1 -1
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +1 -1
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +1 -1
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +1 -1
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +1 -1
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +1 -1
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +1 -1
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +1 -1
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +1 -1
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +1 -1
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +1 -1
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +1 -9
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +9 -1
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +1 -1
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +1 -1
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +1 -1
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +1 -2
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +2 -1
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +1 -1
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +1 -1
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +1 -1
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +1 -1
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +1 -7
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +7 -1
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +1 -1
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +1 -1
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +1 -1
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +1 -1
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +1 -1
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +1 -1
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +1 -1
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +1 -1
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +1 -1
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +1 -2
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +2 -1
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +1 -1
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +1 -1
- package/dist/src/components/feedback/toast/Toast.component.d.ts +1 -0
- package/dist/src/components/feedback/toast/Toast.component.d.ts.map +1 -1
- package/dist/src/components/feedback/toast/Toast.styles.d.ts +4 -1
- package/dist/src/components/feedback/toast/Toast.styles.d.ts.map +1 -1
- package/dist/src/components/feedback/toast/isInsideToast.d.ts +17 -0
- package/dist/src/components/feedback/toast/isInsideToast.d.ts.map +1 -0
- package/dist/src/components/feedback/toast/isInsideToast.spec.d.ts +2 -0
- package/dist/src/components/feedback/toast/isInsideToast.spec.d.ts.map +1 -0
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts +1 -1
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -1
- package/dist/src/components/overlays/dialog/Dialog.types.d.ts +12 -0
- package/dist/src/components/overlays/dialog/Dialog.types.d.ts.map +1 -1
- package/dist/src/components/overlays/drawer/Drawer.component.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index15.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("react-dom"),r=require("./index67.cjs"),o=require("@adam-milo/icons"),s=require("./index69.cjs"),n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("react-dom"),r=require("./index67.cjs"),o=require("@adam-milo/icons"),s=require("./index69.cjs"),n=require("./index80.cjs"),l=require("./index82.cjs"),i={name:"United States",dialCode:"+1",flag:"🇺🇸",mask:s.defaultPhoneMask},c=(e,t)=>{const a=t.trim().toLocaleLowerCase();if(!a)return!0;const r=a.replace(/\D/g,""),o=e.dialCode.replace(/\D/g,"");return e.name.toLocaleLowerCase().includes(a)||e.code.toLocaleLowerCase().includes(a)||e.dialCode.toLocaleLowerCase().includes(a)||r.length>0&&o.includes(r)},d=t.forwardRef(({label:d,error:u,helperText:h,fullWidth:p=!0,value:y="",onChange:f,countryCode:m,initialCountryCode:g,onCountryChange:x,countries:S,countrySearchPlaceholder:v="Search countries",countrySearchNoResultsText:w="No countries found",enableFormatting:b=!0,maxNationalDigits:$=s.E164_MAX_NATIONAL_DIGITS,onValidationChange:C,disabled:N,required:j,placeholder:L,id:k,"data-cy":D,"data-testid":I,className:E,onFocus:M,onBlur:P,...A},T)=>{const[q,_]=t.useState(!1),[F,R]=t.useState(!1),[W,z]=t.useState(0),[B,G]=t.useState(""),[O,V]=t.useState({top:0,left:0,width:0}),[X,K]=t.useState(()=>m??g??"US"),U=m??X,H=t.useId(),J=k||H,Q=`${J}-error`,Y=`${J}-helper`,Z=`${J}-listbox`,ee=t.useRef(null),te=t.useRef(null),ae=t.useRef(null),re=t.useRef(null),oe=t.useRef(null),se=t.useRef([]),ne=D||"phone-input",le=I||"phone-input",ie=S.find(e=>e.code===U)||S[0]||i,ce=t.useMemo(()=>S.filter(e=>c(e,B)),[S,B]),de=ie.mask??s.defaultPhoneMask,ue=Number.isFinite($)?Math.max(Math.floor($),1):s.E164_MAX_NATIONAL_DIGITS,he=L??de.placeholder,pe=d&&j&&!d.includes("*")?`${d}*`:d,ye=ie.dialCode.replace(/\D/g,"").length,fe=s.getPhoneDigits(y),me=y.startsWith("+")?fe.slice(ye):fe,ge=b?s.formatWithMask(me,de,ue):me,xe=t.useCallback(()=>{if(N)return;G("");const e=S.findIndex(e=>e.code===U);z(0===S.length?-1:Math.max(0,e)),_(!0)},[S,U,N]),Se=t.useCallback(()=>{_(!1),G(""),z(0)},[]);t.useEffect(()=>{q&&oe.current?.focus()},[q]),t.useEffect(()=>{!q||W<0||se.current[W]?.scrollIntoView?.({block:"nearest"})},[W,q]),t.useLayoutEffect(()=>{if(!q||!te.current)return;const e=()=>{if(te.current){const e=te.current.getBoundingClientRect();V({top:e.bottom+8,left:e.left,width:Math.max(e.width,320)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[q]),t.useEffect(()=>{const e=e=>{const t=e.target,a=ee.current?.contains(t),r=ae.current?.contains(t);a||r||Se()};return q&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[Se,q]),t.useEffect(()=>{if(!q)return;const e=ae.current;if(!e)return;const t=e=>e.stopPropagation(),a={passive:!1};return e.addEventListener("touchmove",t,a),e.addEventListener("wheel",t,a),()=>{e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t)}},[q]);const ve=t.useCallback(e=>{void 0===m&&K(e.code),x?.(e);const t=s.getPhoneDigits(y),a=ie.dialCode.replace(/\D/g,"").length,r=y.startsWith("+")?t.slice(a):t;f?.(`${e.dialCode}${r}`),Se(),setTimeout(()=>{const e=ee.current?.querySelector("input");e?.focus()},0)},[Se,m,x,f,y,ie.dialCode]),we=t.useCallback(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),z(e=>0===ce.length?-1:Math.min(e+1,ce.length-1));break;case"ArrowUp":e.preventDefault(),z(e=>0===ce.length?-1:Math.max(e-1,0));break;case"Enter":W>=0&&ce[W]&&(e.preventDefault(),ve(ce[W]));break;case"Escape":e.preventDefault(),Se(),re.current?.focus();break;case"Tab":Se()}},[Se,ce,W,ve]),be=N?"disabled":u?"error":F||q?"focus":"idle";return e.jsxs("div",{ref:ee,className:r.cn(l.wrapperStyles,p&&l.wrapperFullWidthStyles),"data-cy":`${ne}-wrapper`,"data-testid":`${le}-wrapper`,children:[d&&e.jsx("label",{htmlFor:J,className:l.labelStyles,"data-cy":`${ne}-label`,"data-testid":`${le}-label`,children:pe}),e.jsxs("div",{ref:te,className:r.cn(l.containerBaseStyles,p&&l.containerFullWidthStyles,"focus"===be&&l.containerFocusStyles,"error"===be&&l.containerErrorStyles,"disabled"===be&&l.containerDisabledStyles,"idle"===be&&l.containerIdleStyles),"data-state":be,"data-cy":`${ne}-container`,"data-testid":`${le}-container`,children:[e.jsxs("button",{ref:re,type:"button",className:l.triggerStyles,onClick:()=>q?Se():xe(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),xe())},disabled:N,"aria-haspopup":"listbox","aria-expanded":q,"aria-controls":Z,"aria-label":`Select country. Current: ${ie.name}`,"data-cy":`${ne}-country-trigger`,"data-testid":`${le}-country-trigger`,children:[e.jsx(n.CountryFlag,{flag:ie.flag,className:l.flagStyles,"data-cy":`${ne}-flag`,"data-testid":`${le}-flag`}),e.jsx(o.Icon,{name:"ChevronDownIcon",size:"sm",color:F||q?"clickable":"text",decorative:!0,"data-cy":`${ne}-chevron`})]}),e.jsx("span",{className:l.dialCodeStyles,"data-cy":`${ne}-dial-code`,"data-testid":`${le}-dial-code`,children:ie.dialCode}),e.jsx("input",{ref:T,id:J,type:"tel",inputMode:"numeric",value:ge,onChange:e=>{const t=e.target.value,a=(b?s.getPhoneDigits(t):t.replace(/[^0-9]/g,"")).slice(0,ue);f?.(`${ie.dialCode}${a}`),C?.(a.length>0)},onFocus:e=>{R(!0),M?.(e)},onBlur:e=>{R(!1),P?.(e)},placeholder:he,disabled:N,required:j,className:r.cn(l.inputStyles,E),"aria-invalid":u?"true":"false","aria-required":j?"true":void 0,"aria-describedby":u?Q:h?Y:void 0,"data-cy":ne,"data-testid":le,...A})]}),q&&a.createPortal(e.jsxs("div",{ref:ae,className:l.dropdownStyles,style:{top:O.top,left:O.left,width:O.width,minWidth:"20rem"},"data-cy":`${ne}-dropdown`,"data-testid":`${le}-dropdown`,children:[e.jsxs("div",{className:l.searchWrapperStyles,children:[e.jsx("span",{className:l.searchIconStyles,children:e.jsx(o.Icon,{name:"MagnifyingGlassIcon",size:"sm",color:"icon-secondary",decorative:!0})}),e.jsx("input",{ref:oe,type:"text",role:"combobox",className:l.searchInputStyles,value:B,onChange:e=>{const t=e.target.value;G(t);const a=S.filter(e=>c(e,t));z(a.length>0?0:-1)},onKeyDown:we,placeholder:v,"aria-label":v,"aria-autocomplete":"list","aria-expanded":"true","aria-controls":Z,"aria-activedescendant":W>=0&&ce[W]?`${Z}-option-${ce[W].code.toLowerCase()}`:void 0,"data-cy":`${ne}-country-search`,"data-testid":`${le}-country-search`}),B&&e.jsx("button",{type:"button",className:l.clearSearchStyles,onClick:()=>{G(""),z(S.length>0?0:-1),oe.current?.focus()},"aria-label":"Clear search","data-cy":`${ne}-country-search-clear`,"data-testid":`${le}-country-search-clear`,children:e.jsx(o.Icon,{name:"Cross2Icon",size:"sm",color:"icon-secondary",decorative:!0})})]}),e.jsx("div",{id:Z,role:"listbox","aria-label":"Select country",className:l.dropdownViewportStyles,"data-cy":`${ne}-country-list`,"data-testid":`${le}-country-list`,children:0===ce.length?e.jsx("div",{role:"status","aria-live":"polite",className:l.noResultsStyles,"data-cy":`${ne}-country-no-results`,"data-testid":`${le}-country-no-results`,children:w}):ce.map((t,a)=>e.jsxs("div",{ref:e=>{se.current[a]=e},id:`${Z}-option-${t.code.toLowerCase()}`,role:"option",tabIndex:-1,"aria-selected":t.code===U,className:r.cn(l.optionBaseStyles,a===W&&l.optionHighlightedStyles,t.code===U&&l.optionSelectedStyles),onClick:()=>ve(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),ve(t))},onMouseEnter:()=>z(a),"data-cy":`${ne}-option-${t.code.toLowerCase()}`,"data-testid":`${le}-option-${t.code.toLowerCase()}`,children:[e.jsx(n.CountryFlag,{flag:t.flag,className:l.optionFlagStyles}),e.jsx("span",{className:l.optionNameStyles,children:t.name}),e.jsx("span",{className:l.optionDialCodeStyles,children:t.dialCode})]},t.code))})]}),document.body),u&&e.jsx("span",{id:Q,className:l.errorStyles,role:"alert","data-cy":`${ne}-error`,"data-testid":`${le}-error`,children:u}),h&&!u&&e.jsx("span",{id:Y,className:l.helperStyles,"data-cy":`${ne}-helper`,"data-testid":`${le}-helper`,children:h})]})});d.displayName="PhoneInput",exports.E164_MAX_NATIONAL_DIGITS=s.E164_MAX_NATIONAL_DIGITS,exports.defaultPhoneMask=s.defaultPhoneMask,exports.formatWithMask=s.formatWithMask,exports.getPhoneDigits=s.getPhoneDigits,exports.isValidPhoneLength=s.isValidPhoneLength,exports.PhoneInput=d;
|
package/dist/index15.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useState as r,useId as o,useRef as n,useMemo as i,useCallback as l,useEffect as c,useLayoutEffect as d}from"react";import{createPortal as s}from"react-dom";import{cn as u}from"./index67.js";import{Icon as m}from"@adam-milo/icons";import{defaultPhoneMask as p,getPhoneDigits as h,formatWithMask as f,E164_MAX_NATIONAL_DIGITS as y}from"./index69.js";import{isValidPhoneLength as v}from"./index69.js";import{CountryFlag as $}from"./
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useState as r,useId as o,useRef as n,useMemo as i,useCallback as l,useEffect as c,useLayoutEffect as d}from"react";import{createPortal as s}from"react-dom";import{cn as u}from"./index67.js";import{Icon as m}from"@adam-milo/icons";import{defaultPhoneMask as p,getPhoneDigits as h,formatWithMask as f,E164_MAX_NATIONAL_DIGITS as y}from"./index69.js";import{isValidPhoneLength as v}from"./index69.js";import{CountryFlag as $}from"./index80.js";import{labelStyles as g,triggerStyles as w,flagStyles as b,dialCodeStyles as C,dropdownStyles as N,searchWrapperStyles as x,searchIconStyles as L,searchInputStyles as k,clearSearchStyles as D,dropdownViewportStyles as E,noResultsStyles as M,optionFlagStyles as S,optionNameStyles as I,optionDialCodeStyles as j,optionSelectedStyles as z,optionHighlightedStyles as F,optionBaseStyles as q,errorStyles as T,helperStyles as W,inputStyles as A,containerIdleStyles as B,containerDisabledStyles as K,containerErrorStyles as P,containerFocusStyles as U,containerFullWidthStyles as R,containerBaseStyles as V,wrapperFullWidthStyles as G,wrapperStyles as H}from"./index82.js";const J={name:"United States",dialCode:"+1",flag:"🇺🇸",mask:p},O=(e,t)=>{const a=t.trim().toLocaleLowerCase();if(!a)return!0;const r=a.replace(/\D/g,""),o=e.dialCode.replace(/\D/g,"");return e.name.toLocaleLowerCase().includes(a)||e.code.toLocaleLowerCase().includes(a)||e.dialCode.toLocaleLowerCase().includes(a)||r.length>0&&o.includes(r)},Q=a(({label:a,error:v,helperText:Q,fullWidth:X=!0,value:Y="",onChange:Z,countryCode:_,initialCountryCode:ee,onCountryChange:te,countries:ae,countrySearchPlaceholder:re="Search countries",countrySearchNoResultsText:oe="No countries found",enableFormatting:ne=!0,maxNationalDigits:ie=y,onValidationChange:le,disabled:ce,required:de,placeholder:se,id:ue,"data-cy":me,"data-testid":pe,className:he,onFocus:fe,onBlur:ye,...ve},$e)=>{const[ge,we]=r(!1),[be,Ce]=r(!1),[Ne,xe]=r(0),[Le,ke]=r(""),[De,Ee]=r({top:0,left:0,width:0}),[Me,Se]=r(()=>_??ee??"US"),Ie=_??Me,je=o(),ze=ue||je,Fe=`${ze}-error`,qe=`${ze}-helper`,Te=`${ze}-listbox`,We=n(null),Ae=n(null),Be=n(null),Ke=n(null),Pe=n(null),Ue=n([]),Re=me||"phone-input",Ve=pe||"phone-input",Ge=ae.find(e=>e.code===Ie)||ae[0]||J,He=i(()=>ae.filter(e=>O(e,Le)),[ae,Le]),Je=Ge.mask??p,Oe=Number.isFinite(ie)?Math.max(Math.floor(ie),1):y,Qe=se??Je.placeholder,Xe=a&&de&&!a.includes("*")?`${a}*`:a,Ye=Ge.dialCode.replace(/\D/g,"").length,Ze=h(Y),_e=Y.startsWith("+")?Ze.slice(Ye):Ze,et=ne?f(_e,Je,Oe):_e,tt=l(()=>{if(ce)return;ke("");const e=ae.findIndex(e=>e.code===Ie);xe(0===ae.length?-1:Math.max(0,e)),we(!0)},[ae,Ie,ce]),at=l(()=>{we(!1),ke(""),xe(0)},[]);c(()=>{ge&&Pe.current?.focus()},[ge]),c(()=>{!ge||Ne<0||Ue.current[Ne]?.scrollIntoView?.({block:"nearest"})},[Ne,ge]),d(()=>{if(!ge||!Ae.current)return;const e=()=>{if(Ae.current){const e=Ae.current.getBoundingClientRect();Ee({top:e.bottom+8,left:e.left,width:Math.max(e.width,320)})}};return e(),window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[ge]),c(()=>{const e=e=>{const t=e.target,a=We.current?.contains(t),r=Be.current?.contains(t);a||r||at()};return ge&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[at,ge]),c(()=>{if(!ge)return;const e=Be.current;if(!e)return;const t=e=>e.stopPropagation(),a={passive:!1};return e.addEventListener("touchmove",t,a),e.addEventListener("wheel",t,a),()=>{e.removeEventListener("touchmove",t),e.removeEventListener("wheel",t)}},[ge]);const rt=l(e=>{void 0===_&&Se(e.code),te?.(e);const t=h(Y),a=Ge.dialCode.replace(/\D/g,"").length,r=Y.startsWith("+")?t.slice(a):t;Z?.(`${e.dialCode}${r}`),at(),setTimeout(()=>{const e=We.current?.querySelector("input");e?.focus()},0)},[at,_,te,Z,Y,Ge.dialCode]),ot=l(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),xe(e=>0===He.length?-1:Math.min(e+1,He.length-1));break;case"ArrowUp":e.preventDefault(),xe(e=>0===He.length?-1:Math.max(e-1,0));break;case"Enter":Ne>=0&&He[Ne]&&(e.preventDefault(),rt(He[Ne]));break;case"Escape":e.preventDefault(),at(),Ke.current?.focus();break;case"Tab":at()}},[at,He,Ne,rt]),nt=ce?"disabled":v?"error":be||ge?"focus":"idle";/* @__PURE__ */
|
|
2
2
|
return e("div",{ref:We,className:u(H,X&&G),"data-cy":`${Re}-wrapper`,"data-testid":`${Ve}-wrapper`,children:[a&&/* @__PURE__ */t("label",{htmlFor:ze,className:g,"data-cy":`${Re}-label`,"data-testid":`${Ve}-label`,children:Xe}),
|
|
3
3
|
/* @__PURE__ */e("div",{ref:Ae,className:u(V,X&&R,"focus"===nt&&U,"error"===nt&&P,"disabled"===nt&&K,"idle"===nt&&B),"data-state":nt,"data-cy":`${Re}-container`,"data-testid":`${Ve}-container`,children:[
|
|
4
4
|
/* @__PURE__ */e("button",{ref:Ke,type:"button",className:w,onClick:()=>ge?at():tt(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),tt())},disabled:ce,"aria-haspopup":"listbox","aria-expanded":ge,"aria-controls":Te,"aria-label":`Select country. Current: ${Ge.name}`,"data-cy":`${Re}-country-trigger`,"data-testid":`${Ve}-country-trigger`,children:[
|
package/dist/index16.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),l=require("./index83.cjs"),r=t.forwardRef(({length:r=4,label:s,value:i="",onChange:n,onComplete:c,error:d,helperText:o,disabled:u=!1,autoFocus:p=!1,fullWidth:f=!1,centered:y=!1,type:b="numeric",size:g="lg",required:h=!1,className:m,"data-cy":S,"data-testid":$},v)=>{const x=t.useId(),k=`${x}-label`,D=`${x}-error`,j=`${x}-helper`,C=S||"otp-input",w=$||"otp-input",A="sm"===g?l.digitSizeSmStyles:l.digitSizeLgStyles,I="sm"===g?l.digitFullWidthSmStyles:l.digitFullWidthLgStyles,N=t.useRef([]),[E,q]=t.useState(()=>i.split("").slice(0,r).concat(Array(r).fill("")).slice(0,r));t.useEffect(()=>{const e=i.split("").slice(0,r).concat(Array(r).fill("")).slice(0,r);q(e)},[i,r]);const F=t.useCallback(e=>"numeric"===b?/^\d$/.test(e):/^[a-zA-Z0-9]$/.test(e),[b]),z=t.useCallback(e=>{q(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&e.length===r&&c?.(t)},[n,c,r]),P=t.useCallback(e=>{const t=N.current[e];t&&(t.focus(),t.select())},[]),T=t.useCallback((e,t)=>{const a=t.target.value;if(1===a.length&&F(a)){const t=[...E];t[e]=a,z(t),e<r-1&&P(e+1)}else if(a.length>1){const t=a.split("").filter(F),l=[...E];t.forEach((t,a)=>{e+a<r&&(l[e+a]=t)}),z(l);const s=l.findIndex(e=>""===e);P(-1===s?r-1:s)}},[E,r,F,z,P]),W=t.useCallback((e,t)=>{switch(t.key){case"Backspace":if(t.preventDefault(),E[e]){const t=[...E];t[e]="",z(t)}else if(e>0){const t=[...E];t[e-1]="",z(t),P(e-1)}break;case"Delete":if(t.preventDefault(),E[e]){const t=[...E];t[e]="",z(t)}break;case"ArrowLeft":t.preventDefault(),e>0&&P(e-1);break;case"ArrowRight":t.preventDefault(),e<r-1&&P(e+1);break;case"Home":t.preventDefault(),P(0);break;case"End":t.preventDefault(),P(r-1);break;default:if(1===t.key.length&&F(t.key)){t.preventDefault();const a=[...E];a[e]=t.key,z(a),e<r-1&&P(e+1)}}},[E,r,F,z,P]),B=t.useCallback((e,t)=>{t.preventDefault();const a=t.clipboardData.getData("text").split("").filter(F);if(0===a.length)return;const l=[...E];a.forEach((t,a)=>{e+a<r&&(l[e+a]=t)}),z(l);const s=l.findIndex(e=>""===e);P(-1===s?r-1:s)},[E,r,F,z,P]),L=t.useCallback(e=>{e.target.select()},[]);return t.useImperativeHandle(v,()=>({focus:()=>{const e=E.findIndex(e=>""===e);P(-1===e?r-1:e)},clear:()=>{const e=Array(r).fill("");z(e),P(0)},getValue:()=>E.join("")}),[E,r,P,z]),t.useEffect(()=>{p&&!u&&P(0)},[p,u,P]),e.jsxs("div",{className:a.cn(l.wrapperStyles,f&&l.wrapperFullWidthStyles,m),"data-cy":`${C}-wrapper`,"data-testid":`${w}-wrapper`,children:[s&&e.jsx("label",{id:k,className:a.cn(l.labelBaseStyles,d&&l.labelErrorStyles,u&&l.labelDisabledStyles),"data-cy":`${C}-label`,"data-testid":`${w}-label`,children:s}),e.jsx("div",{className:a.cn(l.containerBaseStyles,f?l.containerFullWidthStyles:l.containerGapStyles,y&&l.containerCenteredStyles),role:"group","aria-labelledby":s?k:void 0,"aria-label":s?void 0:"OTP Input","data-cy":`${C}-container`,"data-testid":`${w}-container`,children:Array.from({length:r},(t,s)=>e.jsx("input",{ref:e=>{N.current[s]=e},type:"text",inputMode:"numeric"===b?"numeric":"text",pattern:"numeric"===b?"[0-9]*":"[a-zA-Z0-9]*",maxLength:1,value:E[s]||"",onChange:e=>T(s,e),onKeyDown:e=>W(s,e),onPaste:e=>B(s,e),onFocus:L,disabled:u,required:h,"aria-label":`Digit ${s+1} of ${r}`,"aria-invalid":d?"true":"false","aria-describedby":d?D:o?j:void 0,className:a.cn(l.digitBaseStyles,f?I:A,d&&l.digitErrorStyles),"data-otp-digit":!0,"data-cy":`${C}-digit-${s}`,"data-testid":`${w}-digit-${s}`,autoComplete:"one-time-code"},s))}),d&&e.jsx("span",{id:D,className:l.errorStyles,role:"alert","data-cy":`${C}-error`,"data-testid":`${w}-error`,children:d}),o&&!d&&e.jsx("span",{id:j,className:l.helperStyles,"data-cy":`${C}-helper`,"data-testid":`${w}-helper`,children:o})]})});r.displayName="OTPInput",exports.OTPInput=r;
|
package/dist/index16.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useId as r,useRef as i,useState as l,useEffect as n,useCallback as s,useImperativeHandle as c}from"react";import{cn as o}from"./index67.js";import{errorStyles as d,helperStyles as p,labelDisabledStyles as u,labelErrorStyles as f,labelBaseStyles as m,digitErrorStyles as h,digitFullWidthSmStyles as y,digitFullWidthLgStyles as g,digitSizeSmStyles as $,digitSizeLgStyles as b,digitBaseStyles as v,containerCenteredStyles as D,containerFullWidthStyles as x,containerGapStyles as k,containerBaseStyles as A,wrapperFullWidthStyles as N,wrapperStyles as w}from"./
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useId as r,useRef as i,useState as l,useEffect as n,useCallback as s,useImperativeHandle as c}from"react";import{cn as o}from"./index67.js";import{errorStyles as d,helperStyles as p,labelDisabledStyles as u,labelErrorStyles as f,labelBaseStyles as m,digitErrorStyles as h,digitFullWidthSmStyles as y,digitFullWidthLgStyles as g,digitSizeSmStyles as $,digitSizeLgStyles as b,digitBaseStyles as v,containerCenteredStyles as D,containerFullWidthStyles as x,containerGapStyles as k,containerBaseStyles as A,wrapperFullWidthStyles as N,wrapperStyles as w}from"./index83.js";const j=a(({length:a=4,label:j,value:I="",onChange:C,onComplete:z,error:E,helperText:P,disabled:T=!1,autoFocus:q=!1,fullWidth:F=!1,centered:L=!1,type:O="numeric",size:Z="lg",required:B=!1,className:H,"data-cy":K,"data-testid":M},R)=>{const V=r(),W=`${V}-label`,G=`${V}-error`,J=`${V}-helper`,Q=K||"otp-input",S=M||"otp-input",U="sm"===Z?$:b,X="sm"===Z?y:g,Y=i([]),[_,ee]=l(()=>I.split("").slice(0,a).concat(Array(a).fill("")).slice(0,a));n(()=>{const e=I.split("").slice(0,a).concat(Array(a).fill("")).slice(0,a);ee(e)},[I,a]);const te=s(e=>"numeric"===O?/^\d$/.test(e):/^[a-zA-Z0-9]$/.test(e),[O]),ae=s(e=>{ee(e);const t=e.join("");C?.(t),e.every(e=>""!==e)&&e.length===a&&z?.(t)},[C,z,a]),re=s(e=>{const t=Y.current[e];t&&(t.focus(),t.select())},[]),ie=s((e,t)=>{const r=t.target.value;if(1===r.length&&te(r)){const t=[..._];t[e]=r,ae(t),e<a-1&&re(e+1)}else if(r.length>1){const t=r.split("").filter(te),i=[..._];t.forEach((t,r)=>{e+r<a&&(i[e+r]=t)}),ae(i);const l=i.findIndex(e=>""===e);re(-1===l?a-1:l)}},[_,a,te,ae,re]),le=s((e,t)=>{switch(t.key){case"Backspace":if(t.preventDefault(),_[e]){const t=[..._];t[e]="",ae(t)}else if(e>0){const t=[..._];t[e-1]="",ae(t),re(e-1)}break;case"Delete":if(t.preventDefault(),_[e]){const t=[..._];t[e]="",ae(t)}break;case"ArrowLeft":t.preventDefault(),e>0&&re(e-1);break;case"ArrowRight":t.preventDefault(),e<a-1&&re(e+1);break;case"Home":t.preventDefault(),re(0);break;case"End":t.preventDefault(),re(a-1);break;default:if(1===t.key.length&&te(t.key)){t.preventDefault();const r=[..._];r[e]=t.key,ae(r),e<a-1&&re(e+1)}}},[_,a,te,ae,re]),ne=s((e,t)=>{t.preventDefault();const r=t.clipboardData.getData("text").split("").filter(te);if(0===r.length)return;const i=[..._];r.forEach((t,r)=>{e+r<a&&(i[e+r]=t)}),ae(i);const l=i.findIndex(e=>""===e);re(-1===l?a-1:l)},[_,a,te,ae,re]),se=s(e=>{e.target.select()},[]);return c(R,()=>({focus:()=>{const e=_.findIndex(e=>""===e);re(-1===e?a-1:e)},clear:()=>{const e=Array(a).fill("");ae(e),re(0)},getValue:()=>_.join("")}),[_,a,re,ae]),n(()=>{q&&!T&&re(0)},[q,T,re]),/* @__PURE__ */e("div",{className:o(w,F&&N,H),"data-cy":`${Q}-wrapper`,"data-testid":`${S}-wrapper`,children:[j&&/* @__PURE__ */t("label",{id:W,className:o(m,E&&f,T&&u),"data-cy":`${Q}-label`,"data-testid":`${S}-label`,children:j}),
|
|
2
2
|
/* @__PURE__ */t("div",{className:o(A,F?x:k,L&&D),role:"group","aria-labelledby":j?W:void 0,"aria-label":j?void 0:"OTP Input","data-cy":`${Q}-container`,"data-testid":`${S}-container`,children:Array.from({length:a},(e,r)=>/* @__PURE__ */t("input",{ref:e=>{Y.current[r]=e},type:"text",inputMode:"numeric"===O?"numeric":"text",pattern:"numeric"===O?"[0-9]*":"[a-zA-Z0-9]*",maxLength:1,value:_[r]||"",onChange:e=>ie(r,e),onKeyDown:e=>le(r,e),onPaste:e=>ne(r,e),onFocus:se,disabled:T,required:B,"aria-label":`Digit ${r+1} of ${a}`,"aria-invalid":E?"true":"false","aria-describedby":E?G:P?J:void 0,className:o(v,F?X:U,E&&h),"data-otp-digit":!0,"data-cy":`${Q}-digit-${r}`,"data-testid":`${S}-digit-${r}`,autoComplete:"one-time-code"},r))}),E&&/* @__PURE__ */t("span",{id:G,className:d,role:"alert","data-cy":`${Q}-error`,"data-testid":`${S}-error`,children:E}),P&&!E&&/* @__PURE__ */t("span",{id:J,className:p,"data-cy":`${Q}-helper`,"data-testid":`${S}-helper`,children:P})]})});j.displayName="OTPInput";export{j as OTPInput};
|
package/dist/index17.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("./index67.cjs"),s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("./index67.cjs"),s=require("./index84.cjs"),l=a.forwardRef(({label:l,labelPosition:r="end",helperText:d,size:c="md",className:n,id:i,disabled:o,checked:p,defaultChecked:y,"data-cy":u,"data-testid":b,...h},S)=>{const k=a.useId(),x=i||k,m=`${x}-helper`,$=u||"toggle",j=b||"toggle",[g,N]=a.useState(!1),f=a.useRef(null),v=a.useCallback(e=>{f.current=e,S&&("function"==typeof S?S(e):"current"in S&&(S.current=e))},[S]);return e.jsxs("div",{className:t.cn(s.wrapperStyles,o&&s.wrapperDisabledStyles),"data-cy":`${$}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("label",{className:t.cn(s.labelContainerStyles,o&&"cursor-not-allowed","start"===r&&s.labelContainerReversedStyles),htmlFor:x,onMouseEnter:()=>{o||N(!0)},onMouseLeave:()=>{N(!1)},children:[l&&"start"===r&&e.jsx("span",{className:s.labelTextStyles,"data-cy":`${$}-label`,"data-testid":`${j}-label`,children:l}),e.jsx("input",{ref:v,id:x,type:"checkbox",role:"switch",checked:p,defaultChecked:y,className:t.cn(s.inputSrOnlyStyles,n),"aria-describedby":d?m:void 0,"data-cy":$,"data-testid":j,disabled:o,...h}),e.jsx("span",{className:t.cn(s.trackBaseStyles,s.trackSizeMap[c],g&&!o&&s.trackHoverStyles,g&&!o&&s.trackHoverCheckedStyles),"data-cy":`${$}-track`,"data-testid":`${j}-track`,"aria-hidden":"true",children:e.jsx("span",{className:t.cn(s.knobBaseStyles,s.knobSizeMap[c],g&&!o&&s.knobHoverShadowStyles),"data-cy":`${$}-knob`,"data-testid":`${j}-knob`})}),l&&"end"===r&&e.jsx("span",{className:s.labelTextStyles,"data-cy":`${$}-label`,"data-testid":`${j}-label`,children:l})]}),d&&e.jsx("span",{id:m,className:s.helperStyles,"data-cy":`${$}-helper`,"data-testid":`${j}-helper`,children:d})]})});l.displayName="Toggle",exports.Toggle=l;
|
package/dist/index17.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{forwardRef as t,useId as d,useState as r,useRef as s,useCallback as l}from"react";import{cn as c}from"./index67.js";import{labelTextStyles as i,helperStyles as n,inputSrOnlyStyles as o,knobHoverShadowStyles as p,knobSizeMap as m,knobBaseStyles as h,trackHoverCheckedStyles as b,trackHoverStyles as u,trackSizeMap as $,trackBaseStyles as y,labelContainerReversedStyles as N,labelContainerStyles as f,wrapperDisabledStyles as k,wrapperStyles as g}from"./
|
|
1
|
+
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{forwardRef as t,useId as d,useState as r,useRef as s,useCallback as l}from"react";import{cn as c}from"./index67.js";import{labelTextStyles as i,helperStyles as n,inputSrOnlyStyles as o,knobHoverShadowStyles as p,knobSizeMap as m,knobBaseStyles as h,trackHoverCheckedStyles as b,trackHoverStyles as u,trackSizeMap as $,trackBaseStyles as y,labelContainerReversedStyles as N,labelContainerStyles as f,wrapperDisabledStyles as k,wrapperStyles as g}from"./index84.js";const x=t(({label:t,labelPosition:x="end",helperText:w,size:j="md",className:v,id:C,disabled:M,checked:T,defaultChecked:z,"data-cy":E,"data-testid":F,...L},P)=>{const q=d(),A=C||q,B=`${A}-helper`,D=E||"toggle",G=F||"toggle",[H,I]=r(!1),J=s(null),K=l(e=>{J.current=e,P&&("function"==typeof P?P(e):"current"in P&&(P.current=e))},[P]);/* @__PURE__ */
|
|
2
2
|
return e("div",{className:c(g,M&&k),"data-cy":`${D}-wrapper`,"data-testid":`${G}-wrapper`,children:[
|
|
3
3
|
/* @__PURE__ */e("label",{className:c(f,M&&"cursor-not-allowed","start"===x&&N),htmlFor:A,onMouseEnter:()=>{M||I(!0)},onMouseLeave:()=>{I(!1)},children:[t&&"start"===x&&/* @__PURE__ */a("span",{className:i,"data-cy":`${D}-label`,"data-testid":`${G}-label`,children:t}),
|
|
4
4
|
/* @__PURE__ */a("input",{ref:K,id:A,type:"checkbox",role:"switch",checked:T,defaultChecked:z,className:c(o,v),"aria-describedby":w?B:void 0,"data-cy":D,"data-testid":G,disabled:M,...L}),
|
package/dist/index18.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("@radix-ui/react-slider"),s=require("./index67.cjs"),l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("@radix-ui/react-slider"),s=require("./index67.cjs"),l=require("./index85.cjs");function r(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,s.get?s:{enumerable:!0,get:()=>e[t]})}return a.default=e,Object.freeze(a)}const d=r(t),i=e=>String(e),c=a.forwardRef((t,r)=>{const{min:c=0,max:n=100,step:m=1,label:u,helperText:o,error:h,disabled:b=!1,showValue:y=!1,showScaleLabels:x=!1,formatValue:$=i,"aria-label":p,"data-cy":j,"data-testid":S,className:v,id:g,...f}=t,N="range"===t.mode,w=a.useId(),C=g||w,T=`${C}-error`,V=`${C}-helper`,M=j||"slider",O=S||"slider",k=t.value,q=t.value,R=t.defaultValue,P=t.defaultValue,B=a.useMemo(()=>N?k:void 0===q?void 0:[q],[N,k,q]),F=a.useMemo(()=>N?R??[c,n]:[P??c],[N,R,P,c,n]),z=t.onChange,D=t.onChangeCommitted,I=a.useCallback(e=>{z&&z(N?[e[0],e[1]??e[0]]:e[0])},[z,N]),L=a.useCallback(e=>{D&&D(N?[e[0],e[1]??e[0]]:e[0])},[D,N]),{mode:A,value:E,defaultValue:G,onChange:H,onChangeCommitted:J,minStepsBetweenThumbs:K,dir:Q,...U}=f,W=B??F,X=N?`${$(W[0])} – ${$(W[1]??W[0])}`:$(W[0]);return e.jsxs("div",{className:l.wrapperStyles,"data-cy":`${M}-wrapper`,"data-testid":`${O}-wrapper`,children:[(u||y)&&e.jsxs("div",{className:l.headerStyles,children:[u&&e.jsx("label",{htmlFor:C,className:l.labelStyles,"data-cy":`${M}-label`,"data-testid":`${O}-label`,children:u}),y&&e.jsx("span",{className:l.valueStyles,"data-cy":`${M}-value`,"data-testid":`${O}-value`,"aria-live":"polite",children:X})]}),e.jsxs(d.Root,{ref:r,id:C,className:s.cn(l.rootStyles,v),min:c,max:n,step:m,disabled:b,value:B,defaultValue:void 0===B?F:void 0,onValueChange:I,onValueCommit:L,minStepsBetweenThumbs:N?K:void 0,"aria-label":p||("string"==typeof u?u:void 0),"aria-describedby":h?T:o?V:void 0,"aria-invalid":h?"true":void 0,"data-cy":M,"data-testid":O,...U,children:[e.jsx(d.Track,{className:l.trackStyles,"data-cy":`${M}-track`,children:e.jsx(d.Range,{className:l.rangeStyles,"data-cy":`${M}-range`})}),N?e.jsxs(e.Fragment,{children:[e.jsx(d.Thumb,{className:l.thumbStyles,"aria-label":p?`${p} minimum`:"Minimum","data-cy":`${M}-thumb-min`,"data-testid":`${O}-thumb-min`}),e.jsx(d.Thumb,{className:l.thumbStyles,"aria-label":p?`${p} maximum`:"Maximum","data-cy":`${M}-thumb-max`,"data-testid":`${O}-thumb-max`})]}):e.jsx(d.Thumb,{className:l.thumbStyles,"aria-label":p,"data-cy":`${M}-thumb`,"data-testid":`${O}-thumb`})]}),x&&e.jsxs("div",{className:l.scaleRowStyles,"aria-hidden":"true","data-cy":`${M}-scale`,"data-testid":`${O}-scale`,children:[e.jsx("span",{"data-cy":`${M}-scale-min`,"data-testid":`${O}-scale-min`,children:$(c)}),e.jsx("span",{"data-cy":`${M}-scale-max`,"data-testid":`${O}-scale-max`,children:$(n)})]}),h&&e.jsx("span",{id:T,role:"alert",className:l.errorStyles,"data-cy":`${M}-error`,"data-testid":`${O}-error`,children:h}),o&&!h&&e.jsx("span",{id:V,className:l.helperStyles,"data-cy":`${M}-helper`,"data-testid":`${O}-helper`,children:o})]})});c.displayName="Slider",exports.Slider=c;
|
package/dist/index18.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as a,jsx as e,Fragment as t}from"react/jsx-runtime";import{forwardRef as d,useId as i,useMemo as l,useCallback as r}from"react";import*as s from"@radix-ui/react-slider";import{cn as m}from"./index67.js";import{wrapperStyles as c,headerStyles as n,labelStyles as o,valueStyles as u,trackStyles as h,rangeStyles as $,thumbStyles as p,scaleRowStyles as b,errorStyles as v,helperStyles as y,rootStyles as N}from"./
|
|
1
|
+
import{jsxs as a,jsx as e,Fragment as t}from"react/jsx-runtime";import{forwardRef as d,useId as i,useMemo as l,useCallback as r}from"react";import*as s from"@radix-ui/react-slider";import{cn as m}from"./index67.js";import{wrapperStyles as c,headerStyles as n,labelStyles as o,valueStyles as u,trackStyles as h,rangeStyles as $,thumbStyles as p,scaleRowStyles as b,errorStyles as v,helperStyles as y,rootStyles as N}from"./index85.js";const x=a=>String(a),f=d((d,f)=>{const{min:g=0,max:C=100,step:V=1,label:T,helperText:w,error:S,disabled:j=!1,showValue:k=!1,showScaleLabels:B=!1,formatValue:M=x,"aria-label":R,"data-cy":F,"data-testid":L,className:q,id:z,...A}=d,D="range"===d.mode,E=i(),G=z||E,H=`${G}-error`,I=`${G}-helper`,J=F||"slider",K=L||"slider",O=d.value,P=d.value,Q=d.defaultValue,U=d.defaultValue,W=l(()=>D?O:void 0===P?void 0:[P],[D,O,P]),X=l(()=>D?Q??[g,C]:[U??g],[D,Q,U,g,C]),Y=d.onChange,Z=d.onChangeCommitted,_=r(a=>{Y&&Y(D?[a[0],a[1]??a[0]]:a[0])},[Y,D]),aa=r(a=>{Z&&Z(D?[a[0],a[1]??a[0]]:a[0])},[Z,D]),{mode:ea,value:ta,defaultValue:da,onChange:ia,onChangeCommitted:la,minStepsBetweenThumbs:ra,dir:sa,...ma}=A,ca=W??X,na=D?`${M(ca[0])} – ${M(ca[1]??ca[0])}`:M(ca[0]);/* @__PURE__ */
|
|
2
2
|
return a("div",{className:c,"data-cy":`${J}-wrapper`,"data-testid":`${K}-wrapper`,children:[(T||k)&&/* @__PURE__ */a("div",{className:n,children:[T&&/* @__PURE__ */e("label",{htmlFor:G,className:o,"data-cy":`${J}-label`,"data-testid":`${K}-label`,children:T}),k&&/* @__PURE__ */e("span",{className:u,"data-cy":`${J}-value`,"data-testid":`${K}-value`,"aria-live":"polite",children:na})]}),
|
|
3
3
|
/* @__PURE__ */a(s.Root,{ref:f,id:G,className:m(N,q),min:g,max:C,step:V,disabled:j,value:W,defaultValue:void 0===W?X:void 0,onValueChange:_,onValueCommit:aa,minStepsBetweenThumbs:D?ra:void 0,"aria-label":R||("string"==typeof T?T:void 0),"aria-describedby":S?H:w?I:void 0,"aria-invalid":S?"true":void 0,"data-cy":J,"data-testid":K,...ma,children:[
|
|
4
4
|
/* @__PURE__ */e(s.Track,{className:h,"data-cy":`${J}-track`,children:/* @__PURE__ */e(s.Range,{className:$,"data-cy":`${J}-range`})}),D?/* @__PURE__ */a(t,{children:[
|
package/dist/index19.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index67.cjs"),t=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index67.cjs"),t=require("./index86.cjs"),s=require("./index68.cjs"),o=require("./index87.cjs"),l=require("./index77.cjs"),i=require("./index70.cjs"),d=require("./index88.cjs"),n=r.forwardRef(({label:n,tooltip:c,error:u,helperText:x,fullWidth:h=!1,autoResize:v=!1,minRows:p=3,maxRows:g,showCharCount:y=!1,maxLength:m,validate:f=s.defaultValidation,onValidationChange:b,customHeader:w,customFooterActions:j,borderVariant:C,height:S,className:$,id:N,onChange:q,onBlur:M,required:R,value:E,"data-cy":B,"data-testid":I,...T},F)=>{const[L,k]=r.useState(),[z,V]=r.useState(!1),[_,H]=r.useState(!1),[P,A]=r.useState(0),G=r.useRef(!1),O=r.useRef(null),W=l.useMergedRef(F,O),D=r.useId(),J=N||D,K=`${J}-error`,Q=`${J}-helper`,U=B||"textarea",X=I||"textarea",Y=n&&R&&!n.includes("*")?`${n} *`:n,Z=i.useResponsiveValue(S),ee=void 0!==Z,re=r.useCallback(()=>{const e=O.current;if(!e||!v)return;e.style.height="auto";const r=window.getComputedStyle(e),a=parseInt(r.lineHeight)||22,t=parseInt(r.paddingTop)||0,s=parseInt(r.paddingBottom)||0,o=a*p+t+s,l=g?a*g+t+s:1/0,i=Math.min(Math.max(e.scrollHeight,o),l);e.style.height=`${i}px`},[v,p,g]);r.useEffect(()=>{re()},[E,re]);const ae=r.useMemo(()=>d.debounce(e=>{if(f&&G.current){const r=f(e);k(r),b?.(!r)}else null===f&&G.current&&(k(void 0),b?.(!0))},300),[f,b]),te=r.useRef(ae);r.useEffect(()=>{te.current=ae},[ae]),r.useEffect(()=>()=>{te.current.cancel()},[]),r.useEffect(()=>{A((E||"").length)},[E]);const se=e=>{const r=e.target.value;A(r.length),q?.(e),v&&re(),G.current&&ae(r)},oe=e=>{V(!0),T.onFocus?.(e)},le=e=>{if(V(!1),G.current=!0,f){const r=f(e.target.value);k(r),b?.(!r)}M?.(e)},ie=()=>H(!0),de=()=>H(!1),ne=u||L,ce=T.disabled?"disabled":ne?"error":z?"focus":_?"hover":"idle",ue=m&&P>m,xe=y||x&&!ne,he=(()=>{if(!C)return"";if("green-accent"===C){return`relative ${z||_?"shadow-[0_0.25rem_1rem_0_var(--shadow-color-sm)]":""}`}return""})(),ve="green-accent"===C?{background:"linear-gradient(var(--color-card), var(--color-card)) padding-box, var(--gradient-green-blue) border-box",border:z||_?"2px solid transparent":"1px solid transparent"}:{};return e.jsxs("div",{className:a.cn(o.wrapperStyles,$),"data-cy":`${U}-wrapper`,"data-testid":`${X}-wrapper`,children:[w?e.jsx("div",{className:"w-full","data-cy":`${U}-custom-header`,children:w}):(n||c)&&e.jsxs("div",{className:o.labelRowStyles,children:[n&&e.jsx("label",{htmlFor:J,className:o.labelStyles,"data-cy":`${U}-label`,"data-testid":`${X}-label`,children:Y}),c&&e.jsx(t.FormTooltip,{content:c,triggerClassName:o.tooltipTriggerStyles,contentClassName:o.tooltipContentStyles,dataCyPrefix:U,dataTestIdPrefix:X})]}),j?e.jsxs("div",{className:a.cn("w-full rounded-[var(--radius-md)] flex flex-col gap-[var(--spacing-3)] p-[0.875rem] transition-all duration-200",!ne&&he,ne&&"border border-[var(--color-error)] bg-[var(--color-card)]"),style:ne?void 0:ve,onMouseEnter:ie,onMouseLeave:de,children:[e.jsx("textarea",{ref:W,id:J,value:E,className:a.cn("w-full resize-none bg-transparent text-18 leading-22 outline-none border-none overflow-y-auto textarea-scrollbar","placeholder:text-[var(--color-system-text)]","disabled:cursor-not-allowed disabled:text-[var(--color-system-text)]",E?"text-[var(--color-text)]":"text-[var(--color-system-text)]"),style:Z?{height:Z}:void 0,"aria-invalid":ne?"true":"false","aria-required":R?"true":void 0,"aria-describedby":ne?K:x?Q:void 0,"data-cy":U,"data-testid":X,"data-state":ce,onChange:se,onFocus:oe,onBlur:le,required:R,maxLength:m,rows:ee?void 0:p,spellCheck:!0,autoCorrect:"on",autoCapitalize:"sentences",...T}),j]}):"green-accent"===C?e.jsx("div",{className:a.cn("w-full rounded-[var(--radius-md)] transition-all duration-200",!ne&&"p-[1px]",ne&&"border border-[var(--color-error)] bg-[var(--color-card)]",!ne&&he),style:ne?void 0:ve,onMouseEnter:ie,onMouseLeave:de,"data-cy":`${U}-gradient-wrapper`,"data-testid":`${X}-gradient-wrapper`,children:e.jsx("div",{className:ne?o.errorBorderInnerStyles:o.gradientBorderInnerStyles,children:e.jsx("textarea",{ref:W,id:J,value:E,className:a.cn(o.textareaInsideGradientStyles,!v&&"overflow-y-auto textarea-scrollbar"),style:Z?{height:Z}:void 0,"aria-invalid":ne?"true":"false","aria-required":R?"true":void 0,"aria-describedby":ne?K:x?Q:void 0,"data-cy":U,"data-testid":X,"data-state":ce,onChange:se,onFocus:oe,onBlur:le,required:R,maxLength:m,rows:ee||v?void 0:p,spellCheck:!0,autoCorrect:"on",autoCapitalize:"sentences",...T})})}):e.jsx("textarea",{ref:W,id:J,value:E,className:a.cn(o.textareaBaseStyles,ne&&o.textareaErrorStyles,!v&&"overflow-y-auto textarea-scrollbar",he),style:Z?{height:Z}:void 0,"aria-invalid":ne?"true":"false","aria-required":R?"true":void 0,"aria-describedby":ne?K:x?Q:void 0,"data-cy":U,"data-testid":X,"data-state":ce,onChange:se,onFocus:oe,onBlur:le,onMouseEnter:ie,onMouseLeave:de,required:R,maxLength:m,rows:ee||v?void 0:p,spellCheck:!0,autoCorrect:"on",autoCapitalize:"sentences",...T}),ne&&e.jsx("span",{id:K,className:o.errorStyles,role:"alert","data-cy":`${U}-error`,"data-testid":`${X}-error`,children:ne}),!j&&xe&&e.jsxs("div",{className:o.footerStyles,children:[x&&!ne&&e.jsx("span",{id:Q,className:o.helperStyles,"data-cy":`${U}-helper`,"data-testid":`${X}-helper`,children:x}),y&&e.jsxs("span",{"aria-live":"polite","aria-atomic":"true",className:a.cn(o.charCountStyles,ue&&o.charCountExceededStyles),"data-cy":`${U}-char-count`,"data-testid":`${X}-char-count`,children:[P,m&&` / ${m}`]})]})]})});n.displayName="Textarea",exports.Textarea=n;
|
package/dist/index19.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{forwardRef as r,useState as t,useRef as o,useId as i,useCallback as d,useEffect as n,useMemo as l}from"react";import{cn as s}from"./index67.js";import{FormTooltip as c}from"./
|
|
1
|
+
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{forwardRef as r,useState as t,useRef as o,useId as i,useCallback as d,useEffect as n,useMemo as l}from"react";import{cn as s}from"./index67.js";import{FormTooltip as c}from"./index86.js";import{defaultValidation as u}from"./index68.js";import{labelRowStyles as m,labelStyles as v,tooltipContentStyles as h,tooltipTriggerStyles as p,errorBorderInnerStyles as x,gradientBorderInnerStyles as g,errorStyles as f,footerStyles as b,helperStyles as y,textareaInsideGradientStyles as w,textareaErrorStyles as C,textareaBaseStyles as $,charCountExceededStyles as N,charCountStyles as j,wrapperStyles as M}from"./index87.js";import{useMergedRef as q}from"./index77.js";import{useResponsiveValue as L}from"./index70.js";import{debounce as F}from"./index88.js";const z=r(({label:r,tooltip:z,error:B,helperText:k,fullWidth:I=!1,autoResize:T=!1,minRows:_=3,maxRows:E,showCharCount:H=!1,maxLength:R,validate:P=u,onValidationChange:V,customHeader:A,customFooterActions:S,borderVariant:W,height:D,className:G,id:J,onChange:K,onBlur:O,required:Q,value:U,"data-cy":X,"data-testid":Y,...Z},ee)=>{const[ae,re]=t(),[te,oe]=t(!1),[ie,de]=t(!1),[ne,le]=t(0),se=o(!1),ce=o(null),ue=q(ee,ce),me=i(),ve=J||me,he=`${ve}-error`,pe=`${ve}-helper`,xe=X||"textarea",ge=Y||"textarea",fe=r&&Q&&!r.includes("*")?`${r} *`:r,be=L(D),ye=void 0!==be,we=d(()=>{const e=ce.current;if(!e||!T)return;e.style.height="auto";const a=window.getComputedStyle(e),r=parseInt(a.lineHeight)||22,t=parseInt(a.paddingTop)||0,o=parseInt(a.paddingBottom)||0,i=r*_+t+o,d=E?r*E+t+o:1/0,n=Math.min(Math.max(e.scrollHeight,i),d);e.style.height=`${n}px`},[T,_,E]);n(()=>{we()},[U,we]);const Ce=l(()=>F(e=>{if(P&&se.current){const a=P(e);re(a),V?.(!a)}else null===P&&se.current&&(re(void 0),V?.(!0))},300),[P,V]),$e=o(Ce);n(()=>{$e.current=Ce},[Ce]),n(()=>()=>{$e.current.cancel()},[]),n(()=>{le((U||"").length)},[U]);const Ne=e=>{const a=e.target.value;le(a.length),K?.(e),T&&we(),se.current&&Ce(a)},je=e=>{oe(!0),Z.onFocus?.(e)},Me=e=>{if(oe(!1),se.current=!0,P){const a=P(e.target.value);re(a),V?.(!a)}O?.(e)},qe=()=>de(!0),Le=()=>de(!1),Fe=B||ae,ze=Z.disabled?"disabled":Fe?"error":te?"focus":ie?"hover":"idle",Be=R&&ne>R,ke=H||k&&!Fe,Ie=(()=>{if(!W)return"";if("green-accent"===W){return`relative ${te||ie?"shadow-[0_0.25rem_1rem_0_var(--shadow-color-sm)]":""}`}return""})(),Te="green-accent"===W?{background:"linear-gradient(var(--color-card), var(--color-card)) padding-box, var(--gradient-green-blue) border-box",border:te||ie?"2px solid transparent":"1px solid transparent"}:{};/* @__PURE__ */
|
|
2
2
|
return e("div",{className:s(M,G),"data-cy":`${xe}-wrapper`,"data-testid":`${ge}-wrapper`,children:[A?/* @__PURE__ */a("div",{className:"w-full","data-cy":`${xe}-custom-header`,children:A}):(r||z)&&/* @__PURE__ */e("div",{className:m,children:[r&&/* @__PURE__ */a("label",{htmlFor:ve,className:v,"data-cy":`${xe}-label`,"data-testid":`${ge}-label`,children:fe}),z&&/* @__PURE__ */a(c,{content:z,triggerClassName:p,contentClassName:h,dataCyPrefix:xe,dataTestIdPrefix:ge})]}),S?/* @__PURE__ */e("div",{className:s("w-full rounded-[var(--radius-md)] flex flex-col gap-[var(--spacing-3)] p-[0.875rem] transition-all duration-200",!Fe&&Ie,Fe&&"border border-[var(--color-error)] bg-[var(--color-card)]"),style:Fe?void 0:Te,onMouseEnter:qe,onMouseLeave:Le,children:[
|
|
3
3
|
/* @__PURE__ */a("textarea",{ref:ue,id:ve,value:U,className:s("w-full resize-none bg-transparent text-18 leading-22 outline-none border-none overflow-y-auto textarea-scrollbar","placeholder:text-[var(--color-system-text)]","disabled:cursor-not-allowed disabled:text-[var(--color-system-text)]",U?"text-[var(--color-text)]":"text-[var(--color-system-text)]"),style:be?{height:be}:void 0,"aria-invalid":Fe?"true":"false","aria-required":Q?"true":void 0,"aria-describedby":Fe?he:k?pe:void 0,"data-cy":xe,"data-testid":ge,"data-state":ze,onChange:Ne,onFocus:je,onBlur:Me,required:Q,maxLength:R,rows:ye?void 0:_,spellCheck:!0,autoCorrect:"on",autoCapitalize:"sentences",...Z}),S]}):"green-accent"===W?/* @__PURE__ */a("div",{className:s("w-full rounded-[var(--radius-md)] transition-all duration-200",!Fe&&"p-[1px]",Fe&&"border border-[var(--color-error)] bg-[var(--color-card)]",!Fe&&Ie),style:Fe?void 0:Te,onMouseEnter:qe,onMouseLeave:Le,"data-cy":`${xe}-gradient-wrapper`,"data-testid":`${ge}-gradient-wrapper`,children:/* @__PURE__ */a("div",{className:Fe?x:g,children:/* @__PURE__ */a("textarea",{ref:ue,id:ve,value:U,className:s(w,!T&&"overflow-y-auto textarea-scrollbar"),style:be?{height:be}:void 0,"aria-invalid":Fe?"true":"false","aria-required":Q?"true":void 0,"aria-describedby":Fe?he:k?pe:void 0,"data-cy":xe,"data-testid":ge,"data-state":ze,onChange:Ne,onFocus:je,onBlur:Me,required:Q,maxLength:R,rows:ye||T?void 0:_,spellCheck:!0,autoCorrect:"on",autoCapitalize:"sentences",...Z})})}):/* @__PURE__ */a("textarea",{ref:ue,id:ve,value:U,className:s($,Fe&&C,!T&&"overflow-y-auto textarea-scrollbar",Ie),style:be?{height:be}:void 0,"aria-invalid":Fe?"true":"false","aria-required":Q?"true":void 0,"aria-describedby":Fe?he:k?pe:void 0,"data-cy":xe,"data-testid":ge,"data-state":ze,onChange:Ne,onFocus:je,onBlur:Me,onMouseEnter:qe,onMouseLeave:Le,required:Q,maxLength:R,rows:ye||T?void 0:_,spellCheck:!0,autoCorrect:"on",autoCapitalize:"sentences",...Z}),Fe&&/* @__PURE__ */a("span",{id:he,className:f,role:"alert","data-cy":`${xe}-error`,"data-testid":`${ge}-error`,children:Fe}),!S&&ke&&/* @__PURE__ */e("div",{className:b,children:[k&&!Fe&&/* @__PURE__ */a("span",{id:pe,className:y,"data-cy":`${xe}-helper`,"data-testid":`${ge}-helper`,children:k}),H&&/* @__PURE__ */e("span",{"aria-live":"polite","aria-atomic":"true",className:s(j,Be&&N),"data-cy":`${xe}-char-count`,"data-testid":`${ge}-char-count`,children:[ne,R&&` / ${R}`]})]})]})});z.displayName="Textarea";export{z as Textarea};
|
package/dist/index20.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),r=require("./index80.cjs"),l=require("./index89.cjs"),s=()=>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"})}),i=t.forwardRef(({value:i,onValueChange:n,options:d,label:o,placeholder:c,error:u,helperText:p,fullWidth:y=!1,required:f=!1,disabled:h=!1,noResultsText:b="No results found",renderOption:v,className:m,"data-cy":g,"data-testid":x},S)=>{const[$,w]=t.useState(!1),[j,k]=t.useState(""),[N,C]=t.useState(-1),D=t.useId(),q=`${D}-error`,E=`${D}-helper`,F=`${D}-listbox`,L=g||"autocomplete",R=x||"autocomplete",A=t.useRef(null),I=t.useRef(null),M=t.useRef([]),O=t.useRef(!1),T=d.find(e=>e.value===i),W=o&&f&&!o.includes("*")?`${o} *`:o,K=$&&j?d.filter(e=>e.label.toLowerCase().includes(j.toLowerCase())):d,P=t.useCallback(()=>{h||(w(!0),k(""),C(-1))},[h]),V=t.useCallback(()=>{w(!1),k(""),C(-1)},[]),B=t.useCallback(e=>{e.disabled||(n(e.value),V())},[n,V]);t.useEffect(()=>{const e=e=>{A.current&&!A.current.contains(e.target)&&V()};return $&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[$,V]);const H=e=>{M.current[e]?.scrollIntoView?.({block:"nearest"})},U=(e,t)=>{const a=K.length;if(0===a)return-1;let r=e+t;for(;r>=0&&r<a;){if(!K[r].disabled)return r;r+=t}if(-1===e&&1===t)for(let l=0;l<a;l++)if(!K[l].disabled)return l;return-1===e?-1:e},z=$?j:T?.label??"",G=t.useCallback(e=>{A.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]);return e.jsxs("div",{ref:G,className:a.cn(l.wrapperStyles,y&&l.wrapperFullWidthStyles,m),"data-cy":`${L}-wrapper`,"data-testid":`${R}-wrapper`,children:[o&&e.jsx("label",{htmlFor:`${D}-input`,className:a.cn(l.labelStyles,u&&l.labelErrorStyles),"data-cy":`${L}-label`,"data-testid":`${R}-label`,children:W}),e.jsxs("div",{className:a.cn(l.triggerStyles,$&&l.triggerOpenStyles,u&&l.triggerErrorStyles,h&&l.triggerDisabledStyles),onClick:()=>{$||P(),I.current?.focus()},"data-cy":L,"data-testid":R,children:[!$&&T?.flag&&e.jsx(r.CountryFlag,{flag:T.flag,className:l.flagStyles}),e.jsx("input",{ref:I,id:`${D}-input`,type:"text",role:"combobox",className:l.inputStyles,value:z,placeholder:c||o||"Select...","aria-expanded":$,"aria-haspopup":"listbox","aria-controls":$?F:void 0,"aria-autocomplete":"list","aria-activedescendant":N>=0?`${D}-option-${N}`:void 0,"aria-invalid":u?"true":"false","aria-required":f?"true":void 0,"aria-describedby":u?q:p?E:void 0,disabled:h,onChange:e=>{k(e.target.value),C(-1),$||P()},onFocus:()=>{$||O.current||P()},onKeyDown:e=>{switch(e.key){case"ArrowDown":{if(e.preventDefault(),!$)return void P();const t=U(N,1);-1!==t&&(C(t),H(t));break}case"ArrowUp":{if(e.preventDefault(),!$)return void P();const t=U(N,-1);-1!==t&&(C(t),H(t));break}case"Enter":e.preventDefault(),$&&N>=0&&K[N]&&B(K[N]);break;case"Escape":e.preventDefault(),V();break;case"Tab":$&&V()}},"data-cy":`${L}-input`,"data-testid":`${R}-input`}),e.jsx("span",{"aria-hidden":"true",className:a.cn(l.chevronStyles,$&&l.chevronOpenStyles),onMouseDown:e=>{e.preventDefault(),$?(O.current=!0,V(),I.current?.blur(),requestAnimationFrame(()=>{O.current=!1})):(P(),requestAnimationFrame(()=>I.current?.focus()))},onClick:e=>e.stopPropagation(),"data-cy":`${L}-chevron`,"data-testid":`${R}-chevron`,children:e.jsx(s,{})})]}),$&&e.jsx("div",{className:l.dropdownStyles,"data-cy":`${L}-dropdown`,"data-testid":`${R}-dropdown`,children:e.jsx("div",{id:F,role:"listbox",className:l.listStyles,"data-cy":`${L}-list`,"data-testid":`${R}-list`,children:0===K.length?e.jsx("div",{className:l.noResultsStyles,children:b}):K.map((t,s)=>{const n=t.value===i,d=s===N;return e.jsx("div",{ref:e=>{M.current[s]=e},id:`${D}-option-${s}`,role:"option",tabIndex:-1,"aria-selected":n,"aria-disabled":t.disabled||void 0,className:a.cn(l.itemStyles,v&&"w-full justify-between gap-4",d&&l.itemHighlightedStyles,n&&!d&&l.itemSelectedStyles,t.disabled&&(v?l.itemDisabledInteractiveStyles:l.itemDisabledStyles)),onClick:()=>B(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),B(t))},onMouseEnter:()=>C(t.disabled?-1:s),"data-cy":`${L}-item-${t.value}`,"data-testid":`${R}-item-${t.value}`,children:v?v(t,{selected:n,highlighted:d}):e.jsxs(e.Fragment,{children:[t.flag&&e.jsx(r.CountryFlag,{flag:t.flag,className:l.flagStyles}),t.label]})},t.value)})})}),u&&e.jsx("span",{id:q,className:l.errorStyles,role:"alert","data-cy":`${L}-error`,"data-testid":`${R}-error`,children:u}),p&&!u&&e.jsx("span",{id:E,className:l.helperStyles,"data-cy":`${L}-helper`,"data-testid":`${R}-helper`,children:p})]})});i.displayName="Autocomplete",exports.Autocomplete=i;
|
package/dist/index20.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{forwardRef as r,useState as i,useId as n,useRef as l,useCallback as o,useEffect as d}from"react";import{cn as s}from"./index67.js";import{CountryFlag as c}from"./
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{forwardRef as r,useState as i,useId as n,useRef as l,useCallback as o,useEffect as d}from"react";import{cn as s}from"./index67.js";import{CountryFlag as c}from"./index80.js";import{flagStyles as u,inputStyles as p,dropdownStyles as m,listStyles as f,noResultsStyles as h,itemDisabledInteractiveStyles as v,itemDisabledStyles as b,itemSelectedStyles as $,itemHighlightedStyles as w,itemStyles as y,errorStyles as g,helperStyles as x,labelErrorStyles as N,labelStyles as k,chevronOpenStyles as D,chevronStyles as C,triggerDisabledStyles as L,triggerErrorStyles as j,triggerOpenStyles as E,triggerStyles as A,wrapperFullWidthStyles as q,wrapperStyles as F}from"./index89.js";const M=()=>/* @__PURE__ */t("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:/* @__PURE__ */t("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),T=r(({value:r,onValueChange:T,options:I,label:K,placeholder:V,error:W,helperText:B,fullWidth:O=!1,required:P=!1,disabled:R=!1,noResultsText:S="No results found",renderOption:U,className:z,"data-cy":G,"data-testid":H},J)=>{const[Q,X]=i(!1),[Y,Z]=i(""),[_,ee]=i(-1),te=n(),ae=`${te}-error`,re=`${te}-helper`,ie=`${te}-listbox`,ne=G||"autocomplete",le=H||"autocomplete",oe=l(null),de=l(null),se=l([]),ce=l(!1),ue=I.find(e=>e.value===r),pe=K&&P&&!K.includes("*")?`${K} *`:K,me=Q&&Y?I.filter(e=>e.label.toLowerCase().includes(Y.toLowerCase())):I,fe=o(()=>{R||(X(!0),Z(""),ee(-1))},[R]),he=o(()=>{X(!1),Z(""),ee(-1)},[]),ve=o(e=>{e.disabled||(T(e.value),he())},[T,he]);d(()=>{const e=e=>{oe.current&&!oe.current.contains(e.target)&&he()};return Q&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[Q,he]);const be=e=>{se.current[e]?.scrollIntoView?.({block:"nearest"})},$e=(e,t)=>{const a=me.length;if(0===a)return-1;let r=e+t;for(;r>=0&&r<a;){if(!me[r].disabled)return r;r+=t}if(-1===e&&1===t)for(let i=0;i<a;i++)if(!me[i].disabled)return i;return-1===e?-1:e},we=Q?Y:ue?.label??"",ye=o(e=>{oe.current=e,"function"==typeof J?J(e):J&&(J.current=e)},[J]);/* @__PURE__ */
|
|
2
2
|
return e("div",{ref:ye,className:s(F,O&&q,z),"data-cy":`${ne}-wrapper`,"data-testid":`${le}-wrapper`,children:[K&&/* @__PURE__ */t("label",{htmlFor:`${te}-input`,className:s(k,W&&N),"data-cy":`${ne}-label`,"data-testid":`${le}-label`,children:pe}),
|
|
3
3
|
/* @__PURE__ */e("div",{className:s(A,Q&&E,W&&j,R&&L),onClick:()=>{Q||fe(),de.current?.focus()},"data-cy":ne,"data-testid":le,children:[!Q&&ue?.flag&&/* @__PURE__ */t(c,{flag:ue.flag,className:u}),
|
|
4
4
|
/* @__PURE__ */t("input",{ref:de,id:`${te}-input`,type:"text",role:"combobox",className:p,value:we,placeholder:V||K||"Select...","aria-expanded":Q,"aria-haspopup":"listbox","aria-controls":Q?ie:void 0,"aria-autocomplete":"list","aria-activedescendant":_>=0?`${te}-option-${_}`:void 0,"aria-invalid":W?"true":"false","aria-required":P?"true":void 0,"aria-describedby":W?ae:B?re:void 0,disabled:R,onChange:e=>{Z(e.target.value),ee(-1),Q||fe()},onFocus:()=>{Q||ce.current||fe()},onKeyDown:e=>{switch(e.key){case"ArrowDown":{if(e.preventDefault(),!Q)return void fe();const t=$e(_,1);-1!==t&&(ee(t),be(t));break}case"ArrowUp":{if(e.preventDefault(),!Q)return void fe();const t=$e(_,-1);-1!==t&&(ee(t),be(t));break}case"Enter":e.preventDefault(),Q&&_>=0&&me[_]&&ve(me[_]);break;case"Escape":e.preventDefault(),he();break;case"Tab":Q&&he()}},"data-cy":`${ne}-input`,"data-testid":`${le}-input`}),
|
package/dist/index23.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),a=require("./index6.cjs"),n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),a=require("./index6.cjs"),n=require("./index90.cjs");const o=r.forwardRef(function({control:r,name:o,rules:l,"data-cy":i,"data-testid":u,...d},s){return e.jsx(t.FormField,{control:r,name:o,rules:l,"data-cy":i,"data-testid":u,children:({value:r,onChange:t,onBlur:o,ref:l,error:c})=>e.jsx(a.EmailInput,{value:r??"",onChange:e=>t(e.target.value),onBlur:o,ref:n.mergeRefs(l,s),error:c,"data-cy":i??"controlled-email-input","data-testid":u??"controlled-email-input",...d})})});o.displayName="ControlledEmailInput",exports.ControlledEmailInput=o;
|
package/dist/index23.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as e}from"./index22.js";import{EmailInput as o}from"./index6.js";import{mergeRefs as a}from"./
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as e}from"./index22.js";import{EmailInput as o}from"./index6.js";import{mergeRefs as a}from"./index90.js";const n=t(function({control:t,name:n,rules:i,"data-cy":l,"data-testid":d,...m},u){/* @__PURE__ */
|
|
2
2
|
return r(e,{control:t,name:n,rules:i,"data-cy":l,"data-testid":d,children:({value:t,onChange:e,onBlur:n,ref:i,error:c})=>/* @__PURE__ */r(o,{value:t??"",onChange:r=>e(r.target.value),onBlur:n,ref:a(i,u),error:c,"data-cy":l??"controlled-email-input","data-testid":d??"controlled-email-input",...m})})});n.displayName="ControlledEmailInput";export{n as ControlledEmailInput};
|
package/dist/index24.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),o=require("./index8.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),o=require("./index8.cjs"),a=require("./index90.cjs");const n=r.forwardRef(function({control:r,name:n,rules:s,"data-cy":d,"data-testid":l,...u},i){return e.jsx(t.FormField,{control:r,name:n,rules:s,"data-cy":d,"data-testid":l,children:({value:r,onChange:t,onBlur:n,ref:s,error:c})=>e.jsx(o.PasswordInput,{value:r??"",onChange:e=>t(e.target.value),onBlur:n,ref:a.mergeRefs(s,i),error:c,"data-cy":d??"controlled-password-input","data-testid":l??"controlled-password-input",...u})})});n.displayName="ControlledPasswordInput",exports.ControlledPasswordInput=n;
|
package/dist/index24.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as o}from"./index22.js";import{PasswordInput as e}from"./index8.js";import{mergeRefs as a}from"./
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as o}from"./index22.js";import{PasswordInput as e}from"./index8.js";import{mergeRefs as a}from"./index90.js";const n=t(function({control:t,name:n,rules:d,"data-cy":i,"data-testid":l,...s},m){/* @__PURE__ */
|
|
2
2
|
return r(o,{control:t,name:n,rules:d,"data-cy":i,"data-testid":l,children:({value:t,onChange:o,onBlur:n,ref:d,error:u})=>/* @__PURE__ */r(e,{value:t??"",onChange:r=>o(r.target.value),onBlur:n,ref:a(d,m),error:u,"data-cy":i??"controlled-password-input","data-testid":l??"controlled-password-input",...s})})});n.displayName="ControlledPasswordInput";export{n as ControlledPasswordInput};
|
package/dist/index25.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),o=require("./index12.cjs"),c=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),o=require("./index12.cjs"),c=require("./index90.cjs");const n=r.forwardRef(function({control:r,name:n,rules:a,"data-cy":d,"data-testid":l,...i},s){return e.jsx(t.FormField,{control:r,name:n,rules:a,"data-cy":d,"data-testid":l,children:({value:r,onChange:t,onBlur:n,ref:a,error:u})=>e.jsx(o.Checkbox,{checked:!!r,onChange:e=>t(e.target.checked),onBlur:n,ref:c.mergeRefs(a,s),error:u,"data-cy":d??"controlled-checkbox","data-testid":l??"controlled-checkbox",...i})})});n.displayName="ControlledCheckbox",exports.ControlledCheckbox=n;
|
package/dist/index25.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{FormField as o}from"./index22.js";import{Checkbox as t}from"./index12.js";import{mergeRefs as a}from"./
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{FormField as o}from"./index22.js";import{Checkbox as t}from"./index12.js";import{mergeRefs as a}from"./index90.js";const n=r(function({control:r,name:n,rules:c,"data-cy":d,"data-testid":i,...l},m){/* @__PURE__ */
|
|
2
2
|
return e(o,{control:r,name:n,rules:c,"data-cy":d,"data-testid":i,children:({value:r,onChange:o,onBlur:n,ref:c,error:s})=>/* @__PURE__ */e(t,{checked:!!r,onChange:e=>o(e.target.checked),onBlur:n,ref:a(c,m),error:s,"data-cy":d??"controlled-checkbox","data-testid":i??"controlled-checkbox",...l})})});n.displayName="ControlledCheckbox";export{n as ControlledCheckbox};
|
package/dist/index26.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),o=require("./index22.cjs"),t=require("./index13.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),o=require("./index22.cjs"),t=require("./index13.cjs"),a=require("./index90.cjs");const d=r.forwardRef(function({control:r,name:d,value:n,rules:i,"data-cy":l,"data-testid":c,...s},u){return e.jsx(o.FormField,{control:r,name:d,rules:i,"data-cy":l,"data-testid":c,children:({value:r,onChange:o,onBlur:d,ref:i,error:x})=>e.jsx(t.Radio,{value:n,checked:r===n,onChange:()=>o(n),onBlur:d,ref:a.mergeRefs(i,u),error:x,"data-cy":l??"controlled-radio","data-testid":c??"controlled-radio",...s})})});d.displayName="ControlledRadio",exports.ControlledRadio=d;
|
package/dist/index26.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as o}from"react";import{FormField as e}from"./index22.js";import{Radio as t}from"./index13.js";import{mergeRefs as a}from"./
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as o}from"react";import{FormField as e}from"./index22.js";import{Radio as t}from"./index13.js";import{mergeRefs as a}from"./index90.js";const n=o(function({control:o,name:n,value:d,rules:i,"data-cy":l,"data-testid":c,...m},s){/* @__PURE__ */
|
|
2
2
|
return r(e,{control:o,name:n,rules:i,"data-cy":l,"data-testid":c,children:({value:o,onChange:e,onBlur:n,ref:i,error:u})=>/* @__PURE__ */r(t,{value:d,checked:o===d,onChange:()=>e(d),onBlur:n,ref:a(i,s),error:u,"data-cy":l??"controlled-radio","data-testid":c??"controlled-radio",...m})})});n.displayName="ControlledRadio";export{n as ControlledRadio};
|
package/dist/index27.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),o=require("./index17.cjs"),l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),o=require("./index17.cjs"),l=require("./index90.cjs");const n=r.forwardRef(function({control:r,name:n,rules:a,"data-cy":d,"data-testid":c,...i},s){return e.jsx(t.FormField,{control:r,name:n,rules:a,"data-cy":d,"data-testid":c,children:({value:r,onChange:t,onBlur:n,ref:a})=>e.jsx(o.Toggle,{checked:!!r,onChange:e=>t(e.target.checked),onBlur:n,ref:l.mergeRefs(a,s),"data-cy":d??"controlled-toggle","data-testid":c??"controlled-toggle",...i})})});n.displayName="ControlledToggle",exports.ControlledToggle=n;
|
package/dist/index27.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as o}from"./index22.js";import{Toggle as r}from"./index17.js";import{mergeRefs as a}from"./
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as o}from"./index22.js";import{Toggle as r}from"./index17.js";import{mergeRefs as a}from"./index90.js";const n=t(function({control:t,name:n,rules:d,"data-cy":l,"data-testid":c,...i},m){/* @__PURE__ */
|
|
2
2
|
return e(o,{control:t,name:n,rules:d,"data-cy":l,"data-testid":c,children:({value:t,onChange:o,onBlur:n,ref:d})=>/* @__PURE__ */e(r,{checked:!!t,onChange:e=>o(e.target.checked),onBlur:n,ref:a(d,m),"data-cy":l??"controlled-toggle","data-testid":c??"controlled-toggle",...i})})});n.displayName="ControlledToggle";export{n as ControlledToggle};
|
package/dist/index28.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),n=require("./index10.cjs"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),n=require("./index10.cjs"),o=require("./index90.cjs");const u=r.forwardRef(function({control:r,name:u,rules:a,"data-cy":i,"data-testid":c,...l},d){return e.jsx(t.FormField,{control:r,name:u,rules:a,"data-cy":i,"data-testid":c,children:({value:r,onChange:t,onBlur:u,ref:a,error:s})=>e.jsx(n.NumericInput,{value:r??"",onChange:e=>t(e.target.value),onBlur:u,ref:o.mergeRefs(a,d),error:s,"data-cy":i??"controlled-numeric-input","data-testid":c??"controlled-numeric-input",...l})})});u.displayName="ControlledNumericInput",exports.ControlledNumericInput=u;
|
package/dist/index28.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as e}from"./index22.js";import{NumericInput as o}from"./index10.js";import{mergeRefs as n}from"./
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as e}from"./index22.js";import{NumericInput as o}from"./index10.js";import{mergeRefs as n}from"./index90.js";const a=t(function({control:t,name:a,rules:i,"data-cy":d,"data-testid":l,...m},u){/* @__PURE__ */
|
|
2
2
|
return r(e,{control:t,name:a,rules:i,"data-cy":d,"data-testid":l,children:({value:t,onChange:e,onBlur:a,ref:i,error:c})=>/* @__PURE__ */r(o,{value:t??"",onChange:r=>e(r.target.value),onBlur:a,ref:n(i,u),error:c,"data-cy":d??"controlled-numeric-input","data-testid":l??"controlled-numeric-input",...m})})});a.displayName="ControlledNumericInput";export{a as ControlledNumericInput};
|
package/dist/index29.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),n=require("./index11.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),n=require("./index11.cjs"),a=require("./index90.cjs");const o=r.forwardRef(function({control:r,name:o,rules:l,"data-cy":u,"data-testid":i,...c},d){return e.jsx(t.FormField,{control:r,name:o,rules:l,"data-cy":u,"data-testid":i,children:({value:r,onChange:t,onBlur:o,ref:l,error:s})=>e.jsx(n.AlphanumericInput,{value:r??"",onChange:e=>t(e.target.value),onBlur:o,ref:a.mergeRefs(l,d),error:s,"data-cy":u??"controlled-alphanumeric-input","data-testid":i??"controlled-alphanumeric-input",...c})})});o.displayName="ControlledAlphanumericInput",exports.ControlledAlphanumericInput=o;
|
package/dist/index29.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as e}from"./index22.js";import{AlphanumericInput as a}from"./index11.js";import{mergeRefs as o}from"./
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as e}from"./index22.js";import{AlphanumericInput as a}from"./index11.js";import{mergeRefs as o}from"./index90.js";const n=t(function({control:t,name:n,rules:i,"data-cy":l,"data-testid":d,...m},u){/* @__PURE__ */
|
|
2
2
|
return r(e,{control:t,name:n,rules:i,"data-cy":l,"data-testid":d,children:({value:t,onChange:e,onBlur:n,ref:i,error:c})=>/* @__PURE__ */r(a,{value:t??"",onChange:r=>e(r.target.value),onBlur:n,ref:o(i,u),error:c,"data-cy":l??"controlled-alphanumeric-input","data-testid":d??"controlled-alphanumeric-input",...m})})});n.displayName="ControlledAlphanumericInput";export{n as ControlledAlphanumericInput};
|
package/dist/index3.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),n=require("./index72.cjs"),i=require("./index65.cjs"),s=t.forwardRef(({variant:t,fullWidth:s=!1,icon:o,iconPosition:r="left",loading:l=!1,className:c,children:d,disabled:u,"aria-busy":y,"data-testid":b,"data-cy":p,...f},h)=>{const x="unstyled"===t?a.cn(s&&"w-full",c):a.cn("no-underline hover:enabled:opacity-90 transition-opacity duration-200",t&&n.baseStyles,t&&n.variantStyles[t],s&&"w-full",c),S=t?n.spinnerColorByVariant[t]:"action",j=e.jsx("span",{className:n.iconSlotStyles,children:e.jsx(i.Spinner,{size:"sm",color:S,className:"w-full h-full","aria-hidden":!0,"data-cy":"button-spinner","data-testid":"button-spinner"})}),m=Boolean(o)&&"left"===r&&!l,N=Boolean(o)&&"right"===r&&!l,B=l&&Boolean(o)&&"right"===r,g=l&&!B;return e.jsxs("button",{ref:h,disabled:u||l,"aria-busy":l||y||void 0,className:x,"data-testid":b||(t?`button-${t}`:"button"),"data-cy":p||(t?`button-${t}`:"button"),...f,children:[g&&j,m&&e.jsx("span",{className:n.iconSlotStyles,children:o}),d,N&&e.jsx("span",{className:n.iconSlotStyles,children:o}),B&&j]})});s.displayName="Button",exports.Button=s;
|
package/dist/index3.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as t,jsx as a}from"react/jsx-runtime";import{forwardRef as n}from"react";import{cn as i}from"./index67.js";import{iconSlotStyles as o,spinnerColorByVariant as e,variantStyles as s,baseStyles as r}from"./
|
|
1
|
+
import{jsxs as t,jsx as a}from"react/jsx-runtime";import{forwardRef as n}from"react";import{cn as i}from"./index67.js";import{iconSlotStyles as o,spinnerColorByVariant as e,variantStyles as s,baseStyles as r}from"./index72.js";import{Spinner as l}from"./index65.js";const d=n(({variant:n,fullWidth:d=!1,icon:c,iconPosition:u="left",loading:m=!1,className:p,children:f,disabled:b,"aria-busy":h,"data-testid":y,"data-cy":N,...x},j)=>{const B="unstyled"===n?i(d&&"w-full",p):i("no-underline hover:enabled:opacity-90 transition-opacity duration-200",n&&r,n&&s[n],d&&"w-full",p),g=n?e[n]:"action",v=/* @__PURE__ */a("span",{className:o,children:/* @__PURE__ */a(l,{size:"sm",color:g,className:"w-full h-full","aria-hidden":!0,"data-cy":"button-spinner","data-testid":"button-spinner"})}),w=Boolean(c)&&"left"===u&&!m,$=Boolean(c)&&"right"===u&&!m,z=m&&Boolean(c)&&"right"===u;/* @__PURE__ */
|
|
2
2
|
return t("button",{ref:j,disabled:b||m,"aria-busy":m||h||void 0,className:B,"data-testid":y||(n?`button-${n}`:"button"),"data-cy":N||(n?`button-${n}`:"button"),...x,children:[m&&!z&&v,w&&/* @__PURE__ */a("span",{className:o,children:c}),f,$&&/* @__PURE__ */a("span",{className:o,children:c}),z&&v]})});d.displayName="Button";export{d as Button};
|
package/dist/index30.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),n=require("./index15.cjs"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),n=require("./index15.cjs"),o=require("./index90.cjs");const a=r.forwardRef(function({control:r,name:a,rules:d,"data-cy":l,"data-testid":u,...i},s){return e.jsx(t.FormField,{control:r,name:a,rules:d,"data-cy":l,"data-testid":u,children:({value:r,onChange:t,onBlur:a,ref:d,error:c})=>e.jsx(n.PhoneInput,{value:r??"",onChange:e=>t(e),onBlur:a,ref:o.mergeRefs(d,s),error:c,"data-cy":l??"controlled-phone-input","data-testid":u??"controlled-phone-input",...i})})});a.displayName="ControlledPhoneInput",exports.ControlledPhoneInput=a;
|
package/dist/index30.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{forwardRef as o}from"react";import{FormField as t}from"./index22.js";import{PhoneInput as e}from"./index15.js";import{mergeRefs as n}from"./
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{forwardRef as o}from"react";import{FormField as t}from"./index22.js";import{PhoneInput as e}from"./index15.js";import{mergeRefs as n}from"./index90.js";const a=o(function({control:o,name:a,rules:d,"data-cy":i,"data-testid":l,...m},c){/* @__PURE__ */
|
|
2
2
|
return r(t,{control:o,name:a,rules:d,"data-cy":i,"data-testid":l,children:({value:o,onChange:t,onBlur:a,ref:d,error:p})=>/* @__PURE__ */r(e,{value:o??"",onChange:r=>t(r),onBlur:a,ref:n(d,c),error:p,"data-cy":i??"controlled-phone-input","data-testid":l??"controlled-phone-input",...m})})});a.displayName="ControlledPhoneInput";export{a as ControlledPhoneInput};
|
package/dist/index34.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),a=require("./index19.cjs"),o=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),t=require("./index22.cjs"),a=require("./index19.cjs"),o=require("./index90.cjs");const l=r.forwardRef(function({control:r,name:l,rules:s,label:i,tooltip:d,placeholder:n,fullWidth:u=!1,required:c,disabled:h,helperText:m,autoResize:x,minRows:g,maxRows:p,rows:f,showCharCount:w,maxLength:b,validate:C,customHeader:R,customFooterActions:j,borderVariant:q,height:v,className:y,"data-cy":T,"data-testid":F},N){return e.jsx(t.FormField,{control:r,name:l,rules:s,"data-cy":T,"data-testid":F,children:({value:r,onChange:t,onBlur:l,ref:s,error:z})=>e.jsx(a.Textarea,{value:r??"",onChange:e=>t(e.target.value),onBlur:l,ref:o.mergeRefs(s,N),label:i,tooltip:d,placeholder:n,fullWidth:u,required:c,disabled:h,error:z,helperText:m,className:y,autoResize:x,minRows:g,maxRows:p,rows:f,showCharCount:w,maxLength:b,validate:C,customHeader:R,customFooterActions:j,borderVariant:q,height:v,"data-cy":T??"controlled-textarea","data-testid":F??"controlled-textarea"})})});l.displayName="ControlledTextarea",exports.ControlledTextarea=l;
|
package/dist/index34.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as r}from"./index22.js";import{Textarea as o}from"./index19.js";import{mergeRefs as a}from"./
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{forwardRef as t}from"react";import{FormField as r}from"./index22.js";import{Textarea as o}from"./index19.js";import{mergeRefs as a}from"./index90.js";const l=t(function({control:t,name:l,rules:i,label:d,tooltip:s,placeholder:n,fullWidth:m=!1,required:c,disabled:u,helperText:h,autoResize:x,minRows:p,maxRows:f,rows:w,showCharCount:g,maxLength:C,validate:b,customHeader:R,customFooterActions:v,borderVariant:j,height:y,className:N,"data-cy":T,"data-testid":q},z){/* @__PURE__ */
|
|
2
2
|
return e(r,{control:t,name:l,rules:i,"data-cy":T,"data-testid":q,children:({value:t,onChange:r,onBlur:l,ref:i,error:A})=>/* @__PURE__ */e(o,{value:t??"",onChange:e=>r(e.target.value),onBlur:l,ref:a(i,z),label:d,tooltip:s,placeholder:n,fullWidth:m,required:c,disabled:u,error:A,helperText:h,className:N,autoResize:x,minRows:p,maxRows:f,rows:w,showCharCount:g,maxLength:C,validate:b,customHeader:R,customFooterActions:v,borderVariant:j,height:y,"data-cy":T??"controlled-textarea","data-testid":q??"controlled-textarea"})})});l.displayName="ControlledTextarea";export{l as ControlledTextarea};
|
package/dist/index35.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("@radix-ui/react-tabs"),r=require("./index67.cjs"),s=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("@radix-ui/react-tabs"),r=require("./index67.cjs"),s=require("./index91.cjs");function i(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)}const n=i(a),l=n.Root,o=t.forwardRef(({className:a,fullWidth:i=!1,variant:l="default","data-cy":o,"data-testid":c,...d},u)=>{const b=o||"tabs-list",f=c||"tabs-list",g=t.useRef(null),[y,v]=t.useState({left:0,width:0}),[m,p]=t.useState(!1),w=t.useCallback(()=>{const e=g.current;if(!e)return;const t=e.querySelector('[data-state="active"]');if(!t)return void p(!1);const a=e.getBoundingClientRect(),r=t.getBoundingClientRect();v({left:r.left-a.left+e.scrollLeft,width:r.width}),p(!0)},[]);t.useEffect(()=>{const e=g.current;if(!e)return;const t="undefined"!=typeof ResizeObserver?new ResizeObserver(w):null,a=()=>{t&&(t.disconnect(),t.observe(e),e.querySelectorAll('[role="tab"]').forEach(e=>{t.observe(e)}))};w(),a();const r=new MutationObserver(e=>{e.some(e=>"childList"===e.type)&&a(),w()});return r.observe(e,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-state"]}),e.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w),()=>{r.disconnect(),t?.disconnect(),e.removeEventListener("scroll",w),window.removeEventListener("resize",w)}},[w]);const S="default"===l&&m;return e.jsxs(n.List,{ref:e=>{g.current=e,"function"==typeof u?u(e):u&&(u.current=e)},className:r.cn("relative","table"===l?s.listTableStyles:"mobile"===l?s.listMobileStyles:s.listStyles,i&&s.listFullWidthStyles,a),"data-cy":b,"data-testid":f,"data-full-width":i,"data-variant":l,...d,children:[d.children,S&&e.jsx("span",{className:"absolute bottom-0 h-[4px] bg-[var(--color-clickable)] rounded-t-sm transition-all duration-300 ease-in-out pointer-events-none",style:{left:y.left,width:y.width},"aria-hidden":"true"})]})});o.displayName=n.List.displayName;const c=t.forwardRef(({className:t,value:a,variant:i="default","data-cy":l,"data-testid":o,...c},d)=>{const u=l||(a?`tabs-trigger-${a}`:"tabs-trigger"),b=o||(a?`tabs-trigger-${a}`:"tabs-trigger");return e.jsx(n.Trigger,{ref:d,className:r.cn("table"===i?s.triggerTableStyles:"mobile"===i?s.triggerMobileStyles:s.triggerStyles,t),value:a,"data-cy":u,"data-testid":b,...c})});c.displayName=n.Trigger.displayName;const d=t.forwardRef(({className:t,value:a,"data-cy":i,"data-testid":l,...o},c)=>{const d=i||(a?`tabs-content-${a}`:"tabs-content"),u=l||(a?`tabs-content-${a}`:"tabs-content");return e.jsx(n.Content,{ref:c,tabIndex:-1,className:r.cn(s.contentStyles,t),value:a,"data-cy":d,"data-testid":u,...o})});d.displayName=n.Content.displayName,exports.Tabs=l,exports.TabsContent=d,exports.TabsList=o,exports.TabsTrigger=c;
|
package/dist/index35.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{forwardRef as a,useRef as r,useState as s,useCallback as i,useEffect as n}from"react";import*as o from"@radix-ui/react-tabs";import{cn as l}from"./index67.js";import{listFullWidthStyles as d,listTableStyles as c,listMobileStyles as u,listStyles as m,triggerTableStyles as b,triggerMobileStyles as f,triggerStyles as v,contentStyles as p}from"./
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{forwardRef as a,useRef as r,useState as s,useCallback as i,useEffect as n}from"react";import*as o from"@radix-ui/react-tabs";import{cn as l}from"./index67.js";import{listFullWidthStyles as d,listTableStyles as c,listMobileStyles as u,listStyles as m,triggerTableStyles as b,triggerMobileStyles as f,triggerStyles as v,contentStyles as p}from"./index91.js";const y=o.Root,g=a(({className:a,fullWidth:b=!1,variant:f="default","data-cy":v,"data-testid":p,...y},g)=>{const h=v||"tabs-list",N=p||"tabs-list",w=r(null),[L,x]=s({left:0,width:0}),[E,R]=s(!1),z=i(()=>{const t=w.current;if(!t)return;const e=t.querySelector('[data-state="active"]');if(!e)return void R(!1);const a=t.getBoundingClientRect(),r=e.getBoundingClientRect();x({left:r.left-a.left+t.scrollLeft,width:r.width}),R(!0)},[]);n(()=>{const t=w.current;if(!t)return;const e="undefined"!=typeof ResizeObserver?new ResizeObserver(z):null,a=()=>{e&&(e.disconnect(),e.observe(t),t.querySelectorAll('[role="tab"]').forEach(t=>{e.observe(t)}))};z(),a();const r=new MutationObserver(t=>{t.some(t=>"childList"===t.type)&&a(),z()});return r.observe(t,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["data-state"]}),t.addEventListener("scroll",z,{passive:!0}),window.addEventListener("resize",z),()=>{r.disconnect(),e?.disconnect(),t.removeEventListener("scroll",z),window.removeEventListener("resize",z)}},[z]);const C="default"===f&&E;/* @__PURE__ */
|
|
2
2
|
return e(o.List,{ref:t=>{w.current=t,"function"==typeof g?g(t):g&&(g.current=t)},className:l("relative","table"===f?c:"mobile"===f?u:m,b&&d,a),"data-cy":h,"data-testid":N,"data-full-width":b,"data-variant":f,...y,children:[y.children,C&&/* @__PURE__ */t("span",{className:"absolute bottom-0 h-[4px] bg-[var(--color-clickable)] rounded-t-sm transition-all duration-300 ease-in-out pointer-events-none",style:{left:L.left,width:L.width},"aria-hidden":"true"})]})});g.displayName=o.List.displayName;const h=a(({className:e,value:a,variant:r="default","data-cy":s,"data-testid":i,...n},d)=>{const c=s||(a?`tabs-trigger-${a}`:"tabs-trigger"),u=i||(a?`tabs-trigger-${a}`:"tabs-trigger");/* @__PURE__ */
|
|
3
3
|
return t(o.Trigger,{ref:d,className:l("table"===r?b:"mobile"===r?f:v,e),value:a,"data-cy":c,"data-testid":u,...n})});h.displayName=o.Trigger.displayName;const N=a(({className:e,value:a,"data-cy":r,"data-testid":s,...i},n)=>{const d=r||(a?`tabs-content-${a}`:"tabs-content"),c=s||(a?`tabs-content-${a}`:"tabs-content");/* @__PURE__ */
|
|
4
4
|
return t(o.Content,{ref:n,tabIndex:-1,className:l(p,e),value:a,"data-cy":d,"data-testid":c,...i})});N.displayName=o.Content.displayName;export{y as Tabs,N as TabsContent,g as TabsList,h as TabsTrigger};
|
package/dist/index36.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),s=require("./index67.cjs"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),s=require("./index67.cjs"),a=require("./index92.cjs"),l=t.forwardRef(({isCompleted:t=!1,size:l="large","data-cy":n,"data-testid":r},i)=>{const c=n||"stepper-connector",o=r||"stepper-connector";return e.jsx("div",{ref:i,className:s.cn(a.connectorContainerBaseStyles,"small"===l?a.connectorContainerSmallStyles:a.connectorContainerLargeStyles),"data-cy":`${c}-container`,"data-testid":`${o}-container`,children:e.jsx("div",{className:s.cn(a.connectorLineStyles,t?a.connectorActiveStyles:a.connectorInactiveStyles),"data-cy":c,"data-testid":o})})});l.displayName="StepConnector";const n=t.forwardRef(({stepNumber:l,label:n,isActive:r,isCompleted:i,isDisabled:c,isClickable:o,onClick:d,size:p="large","data-cy":y,"data-testid":m},S)=>{const[C,u]=t.useState(!1),b=y||`stepper-step-${l}`,f=m||`stepper-step-${l}`,v=(e=>"small"===e?a.stepCircleSmallStyles:a.stepCircleLargeStyles)(p);return e.jsxs("div",{ref:S,className:s.cn(a.stepItemContainerBaseStyles,"small"===p?a.stepItemContainerSmallStyles:a.stepItemContainerLargeStyles,o&&!c&&"cursor-pointer"),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:()=>{o&&!c&&d&&d()},onKeyDown:e=>{!o||c||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),d?.())},role:o?"button":void 0,tabIndex:o&&!c?0:-1,"aria-current":r?"step":void 0,"aria-disabled":c,"data-cy":b,"data-testid":f,children:[e.jsx("div",{className:c?s.cn(a.stepCircleBaseStyles,v,a.stepCircleDisabledStyles):r?C?s.cn(a.stepCircleBaseStyles,v,a.stepCircleSelectedHoverStyles):s.cn(a.stepCircleBaseStyles,v,a.stepCircleSelectedStyles):C&&o?s.cn(a.stepCircleBaseStyles,v,a.stepCircleHoverStyles):i?s.cn(a.stepCircleBaseStyles,v,a.stepCircleCompletedStyles):s.cn(a.stepCircleBaseStyles,v,a.stepCircleRestStyles),"data-cy":`${b}-circle`,"data-testid":`${f}-circle`,children:l}),e.jsx("p",{className:c?s.cn(a.stepLabelBaseStyles,a.stepLabelDisabledStyles):r?s.cn(a.stepLabelBaseStyles,a.stepLabelSelectedStyles):C&&o?s.cn(a.stepLabelBaseStyles,a.stepLabelHoverStyles):i?s.cn(a.stepLabelBaseStyles,a.stepLabelCompletedStyles):s.cn(a.stepLabelBaseStyles,a.stepLabelRestStyles),"data-cy":`${b}-label`,"data-testid":`${f}-label`,children:n})]})});n.displayName="StepItem";const r="(min-width: 1024px)";const i=t.forwardRef(({steps:i,currentStep:c,onChange:o,allowStepNavigation:d=!0,showConnector:p=!0,size:y,className:m,"data-cy":S,"data-testid":C,...u},b)=>{const f=S||"stepper",v=C||"stepper",h=function(){const[e,s]=t.useState(()=>"undefined"==typeof window||"function"!=typeof window.matchMedia||window.matchMedia(r).matches?"large":"small");return t.useEffect(()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const e=window.matchMedia(r),t=e=>s(e.matches?"large":"small");return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),e}(),g=y??h,x=Math.max(0,c-1),w="large"===g?"3.25rem":"2.5rem",L=i.flatMap((e,t)=>t<i.length-1?[w,"minmax(2rem, 1fr)"]:[w]).join(" "),{style:$,...j}=u;return e.jsx("div",{ref:b,className:s.cn(a.containerStyles,m),style:{...$,gridTemplateColumns:L},role:"navigation","aria-label":"Progress indicator","data-cy":f,"data-testid":v,...j,children:i.map((s,a)=>{const r=a===x,c=a<x,y=s.disabled??!1,m=d&&!y&&a!==x;return e.jsxs(t.Fragment,{children:[e.jsx(n,{stepNumber:a+1,label:s.label,isActive:r,isCompleted:c,isDisabled:y,isClickable:m,onClick:()=>((e,t)=>{d&&!t&&e!==x&&o?.(e+1)})(a,y),size:g,"data-cy":`${f}-step-${a+1}`,"data-testid":`${v}-step-${a+1}`}),a<i.length-1&&(p?e.jsx(l,{isCompleted:c,size:g,"data-cy":`${f}-connector-${a+1}`,"data-testid":`${v}-connector-${a+1}`}):e.jsx("div",{className:"flex-1","aria-hidden":"true"}))]},s.id)})})});i.displayName="Stepper",exports.Stepper=i;
|
package/dist/index36.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{forwardRef as a,Fragment as i,useState as s,useEffect as n}from"react";import{cn as r}from"./index67.js";import{stepItemContainerSmallStyles as d,stepItemContainerLargeStyles as o,stepItemContainerBaseStyles as c,connectorActiveStyles as l,connectorInactiveStyles as m,connectorLineStyles as p,connectorContainerSmallStyles as u,connectorContainerLargeStyles as y,connectorContainerBaseStyles as f,stepCircleDisabledStyles as h,stepCircleBaseStyles as v,stepCircleSelectedHoverStyles as b,stepCircleSelectedStyles as w,stepCircleHoverStyles as $,stepCircleCompletedStyles as g,stepCircleRestStyles as N,stepLabelDisabledStyles as C,stepLabelBaseStyles as x,stepLabelSelectedStyles as M,stepLabelHoverStyles as k,stepLabelCompletedStyles as z,stepLabelRestStyles as S,stepCircleSmallStyles as j,stepCircleLargeStyles as D,containerStyles as E}from"./
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{forwardRef as a,Fragment as i,useState as s,useEffect as n}from"react";import{cn as r}from"./index67.js";import{stepItemContainerSmallStyles as d,stepItemContainerLargeStyles as o,stepItemContainerBaseStyles as c,connectorActiveStyles as l,connectorInactiveStyles as m,connectorLineStyles as p,connectorContainerSmallStyles as u,connectorContainerLargeStyles as y,connectorContainerBaseStyles as f,stepCircleDisabledStyles as h,stepCircleBaseStyles as v,stepCircleSelectedHoverStyles as b,stepCircleSelectedStyles as w,stepCircleHoverStyles as $,stepCircleCompletedStyles as g,stepCircleRestStyles as N,stepLabelDisabledStyles as C,stepLabelBaseStyles as x,stepLabelSelectedStyles as M,stepLabelHoverStyles as k,stepLabelCompletedStyles as z,stepLabelRestStyles as S,stepCircleSmallStyles as j,stepCircleLargeStyles as D,containerStyles as E}from"./index92.js";const L=a(({isCompleted:t=!1,size:a="large","data-cy":i,"data-testid":s},n)=>{const d=i||"stepper-connector",o=s||"stepper-connector";/* @__PURE__ */
|
|
2
2
|
return e("div",{ref:n,className:r(f,"small"===a?u:y),"data-cy":`${d}-container`,"data-testid":`${o}-container`,children:/* @__PURE__ */e("div",{className:r(p,t?l:m),"data-cy":d,"data-testid":o})})});L.displayName="StepConnector";const A=a(({stepNumber:a,label:i,isActive:n,isCompleted:l,isDisabled:m,isClickable:p,onClick:u,size:y="large","data-cy":f,"data-testid":E},L)=>{const[A,I]=s(!1),K=f||`stepper-step-${a}`,P=E||`stepper-step-${a}`,T=(e=>"small"===e?j:D)(y);/* @__PURE__ */
|
|
3
3
|
return t("div",{ref:L,className:r(c,"small"===y?d:o,p&&!m&&"cursor-pointer"),onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),onClick:()=>{p&&!m&&u&&u()},onKeyDown:e=>{!p||m||"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u?.())},role:p?"button":void 0,tabIndex:p&&!m?0:-1,"aria-current":n?"step":void 0,"aria-disabled":m,"data-cy":K,"data-testid":P,children:[
|
|
4
4
|
/* @__PURE__ */e("div",{className:r(v,T,m?h:n?A?b:w:A&&p?$:l?g:N),"data-cy":`${K}-circle`,"data-testid":`${P}-circle`,children:a}),
|
package/dist/index37.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),i=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index67.cjs"),i=require("./index93.cjs"),n=t.forwardRef(({items:t,activeItemId:n,"data-testid":r,"data-cy":s,...c},d)=>{const l=s||"top-nav",o=r||"top-nav",m=e=>{e.onClick&&e.onClick()};return e.jsx("nav",{ref:d,className:i.navStyles,"aria-label":"Main navigation","data-testid":o,"data-cy":l,...c,children:e.jsx("div",{className:a.cn(i.menuWrapperStyles),"data-testid":`${o}-menu`,"data-cy":`${l}-menu`,children:t.map(t=>{const r=n===t.id,s=`${o}-item-${t.id}`,c=`${l}-item-${t.id}`;return t.href?e.jsx("a",{href:t.href,className:a.cn(i.menuItemBaseStyles,r&&i.menuItemActiveStyles),"aria-current":r?"page":void 0,"data-testid":s,"data-cy":c,onClick:e=>{t.onClick&&(e.preventDefault(),m(t))},children:t.label},t.id):e.jsx("button",{type:"button",className:a.cn(i.menuItemBaseStyles,r&&i.menuItemActiveStyles),"aria-current":r?"page":void 0,"data-testid":s,"data-cy":c,onClick:()=>m(t),children:t.label},t.id)})})})});n.displayName="TopNav",exports.TopNav=n;
|