@adam-milo/ui 1.0.57 → 1.0.59
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 +2 -4
- 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 -2
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +1 -1
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +2 -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 +4 -4
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +1 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +1 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +4 -9
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +9 -11
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +12 -2
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -5
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +5 -2
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +2 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +2 -2
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +2 -2
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +2 -2
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +2 -2
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +2 -2
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +2 -2
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +2 -2
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +2 -2
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +2 -4
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +4 -4
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +4 -8
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +1 -1
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +8 -2
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +2 -4
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +4 -8
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +8 -4
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +4 -2
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +2 -5
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +5 -2
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +2 -10
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +10 -2
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +2 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +2 -2
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +2 -6
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +6 -3
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +3 -2
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +2 -2
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +2 -2
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +2 -2
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +2 -10
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +10 -11
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +11 -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 +1 -1
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +1 -1
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +1 -1
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +1 -15
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +15 -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/index60.cjs +1 -1
- package/dist/index60.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/index68.cjs +1 -1
- package/dist/index68.js +1 -1
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +1 -1
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +3 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.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 -1
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +1 -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 -1
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +4 -2
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +1 -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 -1
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +1 -5
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +1 -1
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +5 -1
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +1 -1
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -2
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +1 -2
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +1 -1
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +2 -1
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +1 -4
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +1 -1
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +4 -1
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +1 -1
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +1 -3
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +1 -1
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +3 -1
- package/dist/src/components/data-display/card/Card.styles.d.ts +1 -1
- package/dist/src/components/data-display/card/Card.styles.d.ts.map +1 -1
- package/dist/src/components/forms/password-checklist/PasswordChecklist.component.d.ts +22 -0
- package/dist/src/components/forms/password-checklist/PasswordChecklist.component.d.ts.map +1 -0
- package/dist/src/components/forms/password-checklist/PasswordChecklist.styles.d.ts +7 -0
- package/dist/src/components/forms/password-checklist/PasswordChecklist.styles.d.ts.map +1 -0
- package/dist/src/components/forms/password-checklist/PasswordChecklist.types.d.ts +44 -0
- package/dist/src/components/forms/password-checklist/PasswordChecklist.types.d.ts.map +1 -0
- package/dist/src/components/forms/password-input/PasswordInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/password-input/PasswordInput.types.d.ts +7 -0
- package/dist/src/components/forms/password-input/PasswordInput.types.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.component.d.ts.map +1 -1
- package/dist/src/components/forms/phone-input/PhoneInput.styles.d.ts +4 -2
- package/dist/src/components/forms/phone-input/PhoneInput.styles.d.ts.map +1 -1
- package/dist/src/components/forms/select/Select.styles.d.ts +1 -0
- package/dist/src/components/forms/select/Select.styles.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index11.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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index50.cjs"),t=require("./index59.cjs"),s=r.forwardRef(({label:s,error:d,helperText:c,indeterminate:i=!1,className:l,id:n,required:o,disabled:u,checked:p,"data-cy":b,"data-testid":y,...h},x)=>{const m=r.useId(),k=n||m,S=`${k}-error`,$=`${k}-helper`,f=b||"checkbox",j=y||"checkbox",N=r.useRef(null),q=r.useCallback(e=>{N.current=e,x&&("function"==typeof x?x(e):"current"in x&&(x.current=e))},[x]);r.useEffect(()=>{N.current&&(N.current.indeterminate=i)},[i]);const v=s&&o&&!s.includes("*")?`${s} *`:s;return e.jsxs("div",{className:a.cn(t.wrapperStyles,u&&t.wrapperDisabledStyles),"data-cy":`${f}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("div",{className:t.containerStyles,children:[e.jsx("input",{ref:q,id:k,type:"checkbox",checked:p,className:a.cn(t.inputBaseStyles,d&&t.inputErrorStyles,"checkbox-checkmark",l),"aria-invalid":d?"true":"false","aria-required":o?"true":void 0,"aria-describedby":d?S:c?$:void 0,"data-cy":f,"data-testid":j,"data-indeterminate":i?"true":void 0,disabled:u,required:o,...h}),s&&e.jsx("label",{htmlFor:k,className:a.cn(t.labelStyles,u&&t.labelDisabledStyles),"data-cy":`${f}-label`,"data-testid":`${j}-label`,children:v})]}),d&&e.jsx("span",{id:S,className:t.errorMsgStyles,role:"alert","data-cy":`${f}-error`,"data-testid":`${j}-error`,children:d}),c&&!d&&e.jsx("span",{id:$,className:t.helperMsgStyles,"data-cy":`${f}-helper`,"data-testid":`${j}-helper`,children:c})]})});s.displayName="Checkbox",exports.Checkbox=s;
|
package/dist/index11.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
2
|
-
return e("div",{className:l($,j&&
|
|
3
|
-
/* @__PURE__ */e("div",{className:
|
|
4
|
-
/* @__PURE__ */
|
|
1
|
+
import{jsxs as e,jsx as r}from"react/jsx-runtime";import{forwardRef as a,useId as t,useRef as d,useCallback as i,useEffect as c}from"react";import{cn as l}from"./index50.js";import{containerStyles as s,errorMsgStyles as n,helperMsgStyles as o,inputErrorStyles as m,inputBaseStyles as p,labelDisabledStyles as h,labelStyles as u,wrapperDisabledStyles as b,wrapperStyles as $}from"./index59.js";const x=a(({label:a,error:x,helperText:y,indeterminate:k=!1,className:f,id:N,required:v,disabled:j,checked:q,"data-cy":w,"data-testid":C,...F},T)=>{const g=t(),z=N||g,A=`${z}-error`,B=`${z}-helper`,D=w||"checkbox",E=C||"checkbox",G=d(null),H=i(e=>{G.current=e,T&&("function"==typeof T?T(e):"current"in T&&(T.current=e))},[T]);c(()=>{G.current&&(G.current.indeterminate=k)},[k]);const I=a&&v&&!a.includes("*")?`${a} *`:a;/* @__PURE__ */
|
|
2
|
+
return e("div",{className:l($,j&&b),"data-cy":`${D}-wrapper`,"data-testid":`${E}-wrapper`,children:[
|
|
3
|
+
/* @__PURE__ */e("div",{className:s,children:[
|
|
4
|
+
/* @__PURE__ */r("input",{ref:H,id:z,type:"checkbox",checked:q,className:l(p,x&&m,"checkbox-checkmark",f),"aria-invalid":x?"true":"false","aria-required":v?"true":void 0,"aria-describedby":x?A:y?B:void 0,"data-cy":D,"data-testid":E,"data-indeterminate":k?"true":void 0,disabled:j,required:v,...F}),a&&/* @__PURE__ */r("label",{htmlFor:z,className:l(u,j&&h),"data-cy":`${D}-label`,"data-testid":`${E}-label`,children:I})]}),x&&/* @__PURE__ */r("span",{id:A,className:n,role:"alert","data-cy":`${D}-error`,"data-testid":`${E}-error`,children:x}),y&&!x&&/* @__PURE__ */r("span",{id:B,className:o,"data-cy":`${D}-helper`,"data-testid":`${E}-helper`,children:y})]})});x.displayName="Checkbox";export{x as Checkbox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=Math.min,e=Math.max,o=Math.round,n=Math.floor,r={left:"right",right:"left",bottom:"top",top:"bottom"},i={start:"end",end:"start"};function s(t){return t.split("-")[0]}function p(t){return t.split("-")[1]}function c(t){return"x"===t?"y":"x"}function u(t){return"y"===t?"height":"width"}const x=new Set(["top","bottom"]);function a(t){return x.has(s(t))?"y":"x"}function g(t){return c(a(t))}function f(t){return t.replace(/start|end/g,t=>i[t])}const l=["left","right"],m=["right","left"],h=["top","bottom"],d=["bottom","top"];function b(t){return t.replace(/left|right|bottom|top/g,t=>r[t])}function y(t){return{top:0,right:0,bottom:0,left:0,...t}}exports.clamp=function(o,n,r){return e(o,t(n,r))},exports.createCoords=t=>({x:t,y:t}),exports.evaluate=function(t,e){return"function"==typeof t?t(e):t},exports.expandPaddingObject=y,exports.floor=n,exports.getAlignment=p,exports.getAlignmentAxis=g,exports.getAlignmentSides=function(t,e,o){void 0===o&&(o=!1);const n=p(t),r=g(t),i=u(r);let s="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=b(s)),[s,b(s)]},exports.getAxisLength=u,exports.getExpandedPlacements=function(t){const e=b(t);return[f(t),e,f(e)]},exports.getOppositeAlignmentPlacement=f,exports.getOppositeAxis=c,exports.getOppositeAxisPlacements=function(t,e,o,n){const r=p(t);let i=function(t,e,o){switch(t){case"top":case"bottom":return o?e?m:l:e?l:m;case"left":case"right":return e?h:d;default:return[]}}(s(t),"start"===o,n);return r&&(i=i.map(t=>t+"-"+r),e&&(i=i.concat(i.map(f)))),i},exports.getOppositePlacement=b,exports.getPaddingObject=function(t){return"number"!=typeof t?y(t):{top:t,right:t,bottom:t,left:t}},exports.getSide=s,exports.getSideAxis=a,exports.max=e,exports.min=t,exports.rectToClientRect=function(t){const{x:e,y:o,width:n,height:r}=t;return{width:n,height:r,top:o,left:e,right:e+n,bottom:o+r,x:e,y:o}},exports.round=o,exports.sides=["top","right","bottom","left"];
|
package/dist/index110.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=["top","right","bottom","left"],n=Math.min,o=Math.max,r=Math.round,e=Math.floor,i=t=>({x:t,y:t}),u={left:"right",right:"left",bottom:"top",top:"bottom"},c={start:"end",end:"start"};function f(t,r,e){return o(t,n(r,e))}function h(t,n){return"function"==typeof t?t(n):t}function a(t){return t.split("-")[0]}function p(t){return t.split("-")[1]}function s(t){return"x"===t?"y":"x"}function l(t){return"y"===t?"height":"width"}const g=/* @__PURE__ */new Set(["top","bottom"]);function m(t){return g.has(a(t))?"y":"x"}function b(t){return s(m(t))}function d(t,n,o){void 0===o&&(o=!1);const r=p(t),e=b(t),i=l(e);let u="x"===e?r===(o?"end":"start")?"right":"left":"start"===r?"bottom":"top";return n.reference[i]>n.floating[i]&&(u=k(u)),[u,k(u)]}function x(t){const n=k(t);return[y(t),n,y(n)]}function y(t){return t.replace(/start|end/g,t=>c[t])}const w=["left","right"],M=["right","left"],v=["top","bottom"],S=["bottom","top"];function j(t,n,o,r){const e=p(t);let i=function(t,n,o){switch(t){case"top":case"bottom":return o?n?M:w:n?w:M;case"left":case"right":return n?v:S;default:return[]}}(a(t),"start"===o,r);return e&&(i=i.map(t=>t+"-"+e),n&&(i=i.concat(i.map(y)))),i}function k(t){return t.replace(/left|right|bottom|top/g,t=>u[t])}function q(t){return{top:0,right:0,bottom:0,left:0,...t}}function z(t){return"number"!=typeof t?q(t):{top:t,right:t,bottom:t,left:t}}function A(t){const{x:n,y:o,width:r,height:e}=t;return{width:r,height:e,top:o,left:n,right:n+r,bottom:o+e,x:n,y:o}}export{f as clamp,i as createCoords,h as evaluate,q as expandPaddingObject,e as floor,p as getAlignment,b as getAlignmentAxis,d as getAlignmentSides,l as getAxisLength,x as getExpandedPlacements,y as getOppositeAlignmentPlacement,s as getOppositeAxis,j as getOppositeAxisPlacements,k as getOppositePlacement,z as getPaddingObject,a as getSide,m as getSideAxis,o as max,n as min,A as rectToClientRect,r as round,t as sides};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(){return"undefined"!=typeof window}function t(e){return r(e)?(e.nodeName||"").toLowerCase():"#document"}function n(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function o(e){var t;return null==(t=(r(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function r(t){return!!e()&&(t instanceof Node||t instanceof n(t).Node)}function s(t){return!!e()&&(t instanceof Element||t instanceof n(t).Element)}function c(t){return!!e()&&(t instanceof HTMLElement||t instanceof n(t).HTMLElement)}function i(t){return!(!e()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof n(t).ShadowRoot)}Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=new Set(["inline","contents"]);function u(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=g(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!l.has(r)}const a=new Set(["table","td","th"]);const f=[":popover-open",":modal"];function p(e){return f.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const d=["transform","translate","scale","rotate","perspective"],m=["transform","translate","scale","rotate","perspective","filter"],w=["paint","layout","strict","content"];function v(e){const t=x(),n=s(e)?g(e):e;return d.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||m.some(e=>(n.willChange||"").includes(e))||w.some(e=>(n.contain||"").includes(e))}function x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const y=new Set(["html","body","#document"]);function S(e){return y.has(t(e))}function g(e){return n(e).getComputedStyle(e)}function h(e){if("html"===t(e))return e;const n=e.assignedSlot||e.parentNode||i(e)&&e.host||o(e);return i(n)?n.host:n}function b(e){const t=h(e);return S(t)?e.ownerDocument?e.ownerDocument.body:e.body:c(t)&&u(t)?t:b(t)}function E(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}exports.getComputedStyle=g,exports.getContainingBlock=function(e){let t=h(e);for(;c(t)&&!S(t);){if(v(t))return t;if(p(t))return null;t=h(t)}return null},exports.getDocumentElement=o,exports.getFrameElement=E,exports.getNearestOverflowAncestor=b,exports.getNodeName=t,exports.getNodeScroll=function(e){return s(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}},exports.getOverflowAncestors=function e(t,o,r){var s;void 0===o&&(o=[]),void 0===r&&(r=!0);const c=b(t),i=c===(null==(s=t.ownerDocument)?void 0:s.body),l=n(c);if(i){const t=E(l);return o.concat(l,l.visualViewport||[],u(c)?c:[],t&&r?e(t):[])}return o.concat(c,e(c,[],r))},exports.getParentNode=h,exports.getWindow=n,exports.isContainingBlock=v,exports.isElement=s,exports.isHTMLElement=c,exports.isLastTraversableNode=S,exports.isNode=r,exports.isOverflowElement=u,exports.isShadowRoot=i,exports.isTableElement=function(e){return a.has(t(e))},exports.isTopLayer=p,exports.isWebKit=x;
|
package/dist/index111.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function n(){return"undefined"!=typeof window}function t(n){return r(n)?(n.nodeName||"").toLowerCase():"#document"}function e(n){var t;return(null==n||null==(t=n.ownerDocument)?void 0:t.defaultView)||window}function o(n){var t;return null==(t=(r(n)?n.ownerDocument:n.document)||window.document)?void 0:t.documentElement}function r(t){return!!n()&&(t instanceof Node||t instanceof e(t).Node)}function c(t){return!!n()&&(t instanceof Element||t instanceof e(t).Element)}function u(t){return!!n()&&(t instanceof HTMLElement||t instanceof e(t).HTMLElement)}function i(t){return!(!n()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof e(t).ShadowRoot)}const l=/* @__PURE__ */new Set(["inline","contents"]);function s(n){const{overflow:t,overflowX:e,overflowY:o,display:r}=C(n);return/auto|scroll|overlay|hidden|clip/.test(t+o+e)&&!l.has(r)}const a=/* @__PURE__ */new Set(["table","td","th"]);function f(n){return a.has(t(n))}const d=[":popover-open",":modal"];function p(n){return d.some(t=>{try{return n.matches(t)}catch(e){return!1}})}const m=["transform","translate","scale","rotate","perspective"],w=["transform","translate","scale","rotate","perspective","filter"],v=["paint","layout","strict","content"];function h(n){const t=S(),e=c(n)?C(n):n;return m.some(n=>!!e[n]&&"none"!==e[n])||!!e.containerType&&"normal"!==e.containerType||!t&&!!e.backdropFilter&&"none"!==e.backdropFilter||!t&&!!e.filter&&"none"!==e.filter||w.some(n=>(e.willChange||"").includes(n))||v.some(n=>(e.contain||"").includes(n))}function y(n){let t=L(n);for(;u(t)&&!T(t);){if(h(t))return t;if(p(t))return null;t=L(t)}return null}function S(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const b=/* @__PURE__ */new Set(["html","body","#document"]);function T(n){return b.has(t(n))}function C(n){return e(n).getComputedStyle(n)}function E(n){return c(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function L(n){if("html"===t(n))return n;const e=n.assignedSlot||n.parentNode||i(n)&&n.host||o(n);return i(e)?e.host:e}function D(n){const t=L(n);return T(t)?n.ownerDocument?n.ownerDocument.body:n.body:u(t)&&s(t)?t:D(t)}function g(n,t,o){var r;void 0===t&&(t=[]),void 0===o&&(o=!0);const c=D(n),u=c===(null==(r=n.ownerDocument)?void 0:r.body),i=e(c);if(u){const n=k(i);return t.concat(i,i.visualViewport||[],s(c)?c:[],n&&o?g(n):[])}return t.concat(c,g(c,[],o))}function k(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}export{C as getComputedStyle,y as getContainingBlock,o as getDocumentElement,k as getFrameElement,D as getNearestOverflowAncestor,t as getNodeName,E as getNodeScroll,g as getOverflowAncestors,L as getParentNode,e as getWindow,h as isContainingBlock,c as isElement,u as isHTMLElement,T as isLastTraversableNode,r as isNode,s as isOverflowElement,i as isShadowRoot,f as isTableElement,p as isTopLayer,S as isWebKit};
|
package/dist/index12.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index50.cjs"),s=require("./index60.cjs"),t=r.forwardRef(({label:t,error:d,helperText:l,className:i,id:c,required:n,disabled:o,checked:p,"data-cy":u,"data-testid":y,...b},h)=>{const x=r.useId(),m=c||x,S=`${m}-error`,$=`${m}-helper`,j=u||"radio",N=y||"radio",f=r.useRef(null),q=r.useCallback(e=>{f.current=e,h&&("function"==typeof h?h(e):"current"in h&&(h.current=e))},[h]),w=t&&n&&!t.includes("*")?`${t} *`:t;return e.jsxs("div",{className:a.cn(s.wrapperStyles,o&&s.wrapperDisabledStyles),"data-cy":`${j}-wrapper`,"data-testid":`${N}-wrapper`,children:[e.jsxs("div",{className:s.containerStyles,children:[e.jsx("input",{ref:q,id:m,type:"radio",checked:p,className:a.cn(s.inputBaseStyles,d&&s.inputErrorStyles,i),"aria-describedby":d?S:l?$:void 0,"data-cy":j,"data-testid":N,disabled:o,required:n,...b}),t&&e.jsx("label",{htmlFor:m,className:a.cn(s.labelStyles,o&&s.labelDisabledStyles),"data-cy":`${j}-label`,"data-testid":`${N}-label`,children:w})]}),d&&e.jsx("span",{id:S,className:s.errorMsgStyles,role:"alert","data-cy":`${j}-error`,"data-testid":`${N}-error`,children:d}),l&&!d&&e.jsx("span",{id:$,className:s.helperMsgStyles,"data-cy":`${j}-helper`,"data-testid":`${N}-helper`,children:l})]})});t.displayName="Radio",exports.Radio=t;
|
package/dist/index12.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */e(d.Icon,{className:c,"data-cy":`${M}-icon`,"data-testid":`${O}-icon`,children:/* @__PURE__ */e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:/* @__PURE__ */e("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),g&&/* @__PURE__ */e("span",{id:F,className:o,role:"alert","data-cy":`${M}-error`,"data-testid":`${O}-error`,children:g}),v&&!g&&/* @__PURE__ */e("span",{id:G,className:n,"data-cy":`${M}-helper`,"data-testid":`${O}-helper`,children:v})]})});S.displayName="SelectTrigger";const L=d.Value,j=t(({className:a,children:t,position:r="popper","data-cy":i,"data-testid":c,...o},n)=>{const m=i||"select-content",p=c||"select-content";/* @__PURE__ */
|
|
6
|
-
return e(d.Portal,{children:/* @__PURE__ */e(d.Content,{ref:n,className:l(f,a),position:r,sideOffset:4,"data-cy":m,"data-testid":p,...o,children:/* @__PURE__ */e(d.Viewport,{className:s,children:t})})})});j.displayName="SelectContent";const k=t(({className:a,children:t,value:r,"data-cy":s,"data-testid":i,...c},o)=>{const n=s||`select-item-${r}`,m=i||`select-item-${r}`;/* @__PURE__ */
|
|
7
|
-
return e(d.Item,{ref:o,className:l(g,a),value:r,"data-cy":n,"data-testid":m,...c,children:/* @__PURE__ */e(d.ItemText,{children:t})})});k.displayName="SelectItem";const I=d.Group,T=t(({className:a,"data-cy":t,"data-testid":r,...s},i)=>{const c=t||"select-label",o=r||"select-label";/* @__PURE__ */
|
|
8
|
-
return e(d.Label,{ref:i,className:l(v,a),"data-cy":c,"data-testid":o,...s})});T.displayName="SelectLabel";const C=t(({className:a,"data-cy":t,"data-testid":r,...s},i)=>{const c=t||"select-separator",o=r||"select-separator";/* @__PURE__ */
|
|
9
|
-
return e(d.Separator,{ref:i,className:l(w,a),"data-cy":c,"data-testid":o,...s})});C.displayName="SelectSeparator";export{x as Select,j as SelectContent,I as SelectGroup,k as SelectItem,T as SelectLabel,C as SelectSeparator,S as SelectTrigger,L as SelectValue};
|
|
1
|
+
import{jsxs as e,jsx as a}from"react/jsx-runtime";import{forwardRef as r,useId as d,useRef as t,useCallback as i}from"react";import{cn as l}from"./index50.js";import{containerStyles as c,errorMsgStyles as s,helperMsgStyles as o,inputErrorStyles as n,inputBaseStyles as p,labelDisabledStyles as m,labelStyles as h,wrapperDisabledStyles as u,wrapperStyles as $}from"./index60.js";const y=r(({label:r,error:y,helperText:b,className:N,id:f,required:x,disabled:j,checked:v,"data-cy":k,"data-testid":q,...w},F)=>{const R=d(),T=f||R,g=`${T}-error`,z=`${T}-helper`,A=k||"radio",B=q||"radio",C=t(null),D=i(e=>{C.current=e,F&&("function"==typeof F?F(e):"current"in F&&(F.current=e))},[F]),E=r&&x&&!r.includes("*")?`${r} *`:r;/* @__PURE__ */
|
|
2
|
+
return e("div",{className:l($,j&&u),"data-cy":`${A}-wrapper`,"data-testid":`${B}-wrapper`,children:[
|
|
3
|
+
/* @__PURE__ */e("div",{className:c,children:[
|
|
4
|
+
/* @__PURE__ */a("input",{ref:D,id:T,type:"radio",checked:v,className:l(p,y&&n,N),"aria-describedby":y?g:b?z:void 0,"data-cy":A,"data-testid":B,disabled:j,required:x,...w}),r&&/* @__PURE__ */a("label",{htmlFor:T,className:l(h,j&&m),"data-cy":`${A}-label`,"data-testid":`${B}-label`,children:E})]}),y&&/* @__PURE__ */a("span",{id:g,className:s,role:"alert","data-cy":`${A}-error`,"data-testid":`${B}-error`,children:y}),b&&!y&&/* @__PURE__ */a("span",{id:z,className:o,"data-cy":`${A}-helper`,"data-testid":`${B}-helper`,children:b})]})});y.displayName="Radio";export{y as Radio};
|
package/dist/index13.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),r=require("@radix-ui/react-select"),a=require("./index50.cjs"),s=require("./index61.cjs");function l(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const c=l(r),i=c.Root,d=t.forwardRef(({className:r,children:l,label:i,error:d,helperText:o,fullWidth:n=!1,hasValue:p=!1,placeholder:g,id:u,"data-cy":y,"data-testid":S,disabled:h,required:m,...x},b)=>{const f=t.useId(),j=u||f,N=`${j}-label`,$=`${j}-error`,w=`${j}-helper`,v=y||"select-trigger",L=S||"select-trigger";return e.jsxs("div",{className:a.cn(s.triggerWrapperStyles,n&&s.triggerWrapperFullWidthStyles),"data-cy":`${v}-wrapper`,"data-testid":`${L}-wrapper`,children:[i&&e.jsx("label",{id:N,htmlFor:j,className:a.cn(s.triggerLabelStyles,d&&s.triggerLabelErrorStyles,h&&s.triggerLabelDisabledStyles),"data-cy":`${v}-label`,"data-testid":`${L}-label`,children:i}),e.jsxs(c.Trigger,{ref:b,id:j,className:a.cn(s.triggerButtonStyles,d&&s.triggerButtonErrorStyles,!p&&s.triggerButtonPlaceholderStyles,r),"aria-invalid":d?"true":"false","aria-describedby":d?$:o?w:void 0,"aria-labelledby":i?N:void 0,"aria-required":m?"true":void 0,"data-cy":v,"data-testid":L,disabled:h,...x,children:[e.jsx("span",{className:s.triggerValueStyles,children:p?l:e.jsx("span",{"data-cy":`${v}-placeholder`,"data-testid":`${L}-placeholder`,children:g||i})}),e.jsx(c.Icon,{className:s.triggerIconStyles,"data-cy":`${v}-icon`,"data-testid":`${L}-icon`,children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e.jsx("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d&&e.jsx("span",{id:$,className:s.triggerErrorStyles,role:"alert","data-cy":`${v}-error`,"data-testid":`${L}-error`,children:d}),o&&!d&&e.jsx("span",{id:w,className:s.triggerHelperStyles,"data-cy":`${v}-helper`,"data-testid":`${L}-helper`,children:o})]})});d.displayName="SelectTrigger";const o=c.Value,n=t.forwardRef(({className:t,children:r,position:l="popper","data-cy":i,"data-testid":d,...o},n)=>{const p=i||"select-content",g=d||"select-content";return e.jsx(c.Portal,{children:e.jsx(c.Content,{ref:n,className:a.cn(s.contentStyles,t),position:l,sideOffset:0,"data-cy":p,"data-testid":g,...o,children:e.jsx(c.Viewport,{className:s.viewportStyles,children:r})})})});n.displayName="SelectContent";const p=t.forwardRef(({className:t,children:r,value:l,"data-cy":i,"data-testid":d,...o},n)=>{const p=i||`select-item-${l}`,g=d||`select-item-${l}`;return e.jsx(c.Item,{ref:n,className:a.cn(s.itemStyles,t),value:l,"data-cy":p,"data-testid":g,...o,children:e.jsx(c.ItemText,{children:r})})});p.displayName="SelectItem";const g=c.Group,u=t.forwardRef(({className:t,"data-cy":r,"data-testid":l,...i},d)=>{const o=r||"select-label",n=l||"select-label";return e.jsx(c.Label,{ref:d,className:a.cn(s.labelStyles,t),"data-cy":o,"data-testid":n,...i})});u.displayName="SelectLabel";const y=t.forwardRef(({className:t,"data-cy":r,"data-testid":l,...i},d)=>{const o=r||"select-separator",n=l||"select-separator";return e.jsx(c.Separator,{ref:d,className:a.cn(s.separatorStyles,t),"data-cy":o,"data-testid":n,...i})});y.displayName="SelectSeparator",exports.Select=i,exports.SelectContent=n,exports.SelectGroup=g,exports.SelectItem=p,exports.SelectLabel=u,exports.SelectSeparator=y,exports.SelectTrigger=d,exports.SelectValue=o;
|
package/dist/index13.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */e("
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/* @__PURE__ */a("span",{className:j,children:t.name}),
|
|
11
|
-
/* @__PURE__ */a("span",{className:I,children:t.dialCode})]},t.code))}),h&&/* @__PURE__ */a("span",{id:ue,className:S,role:"alert","data-cy":`${$e}-error`,"data-testid":`${be}-error`,children:h}),y&&!h&&/* @__PURE__ */a("span",{id:pe,className:A,"data-cy":`${$e}-helper`,"data-testid":`${be}-helper`,children:y})]})});H.displayName="PhoneInput";export{H as PhoneInput,h as allCountries,s as commonCountries,y as defaultCountries,f as defaultPhoneMask,m as formatPhoneNumber,$ as getCountriesByDialCode,b as getCountryByCode,g as getCountryByDialCode,p as getPhoneDigits,u as getPhoneMask,v as isValidPhoneLength,x as phoneMasks,w as searchCountries};
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{forwardRef as t,useId as r}from"react";import*as d from"@radix-ui/react-select";import{cn as l}from"./index50.js";import{viewportStyles as s,triggerValueStyles as i,triggerIconStyles as c,triggerErrorStyles as o,triggerHelperStyles as n,triggerLabelDisabledStyles as m,triggerLabelErrorStyles as p,triggerLabelStyles as h,triggerButtonPlaceholderStyles as y,triggerButtonErrorStyles as N,triggerButtonStyles as u,triggerWrapperFullWidthStyles as $,triggerWrapperStyles as b,contentStyles as f,itemStyles as g,labelStyles as v,separatorStyles as w}from"./index61.js";const x=d.Root,S=t(({className:t,children:s,label:f,error:g,helperText:v,fullWidth:w=!1,hasValue:x=!1,placeholder:S,id:L,"data-cy":j,"data-testid":k,disabled:I,required:T,...C},V)=>{const q=r(),W=L||q,B=`${W}-label`,F=`${W}-error`,G=`${W}-helper`,M=j||"select-trigger",O=k||"select-trigger";/* @__PURE__ */
|
|
2
|
+
return a("div",{className:l(b,w&&$),"data-cy":`${M}-wrapper`,"data-testid":`${O}-wrapper`,children:[f&&/* @__PURE__ */e("label",{id:B,htmlFor:W,className:l(h,g&&p,I&&m),"data-cy":`${M}-label`,"data-testid":`${O}-label`,children:f}),
|
|
3
|
+
/* @__PURE__ */a(d.Trigger,{ref:V,id:W,className:l(u,g&&N,!x&&y,t),"aria-invalid":g?"true":"false","aria-describedby":g?F:v?G:void 0,"aria-labelledby":f?B:void 0,"aria-required":T?"true":void 0,"data-cy":M,"data-testid":O,disabled:I,...C,children:[
|
|
4
|
+
/* @__PURE__ */e("span",{className:i,children:x?s:/* @__PURE__ */e("span",{"data-cy":`${M}-placeholder`,"data-testid":`${O}-placeholder`,children:S||f})}),
|
|
5
|
+
/* @__PURE__ */e(d.Icon,{className:c,"data-cy":`${M}-icon`,"data-testid":`${O}-icon`,children:/* @__PURE__ */e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:/* @__PURE__ */e("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),g&&/* @__PURE__ */e("span",{id:F,className:o,role:"alert","data-cy":`${M}-error`,"data-testid":`${O}-error`,children:g}),v&&!g&&/* @__PURE__ */e("span",{id:G,className:n,"data-cy":`${M}-helper`,"data-testid":`${O}-helper`,children:v})]})});S.displayName="SelectTrigger";const L=d.Value,j=t(({className:a,children:t,position:r="popper","data-cy":i,"data-testid":c,...o},n)=>{const m=i||"select-content",p=c||"select-content";/* @__PURE__ */
|
|
6
|
+
return e(d.Portal,{children:/* @__PURE__ */e(d.Content,{ref:n,className:l(f,a),position:r,sideOffset:0,"data-cy":m,"data-testid":p,...o,children:/* @__PURE__ */e(d.Viewport,{className:s,children:t})})})});j.displayName="SelectContent";const k=t(({className:a,children:t,value:r,"data-cy":s,"data-testid":i,...c},o)=>{const n=s||`select-item-${r}`,m=i||`select-item-${r}`;/* @__PURE__ */
|
|
7
|
+
return e(d.Item,{ref:o,className:l(g,a),value:r,"data-cy":n,"data-testid":m,...c,children:/* @__PURE__ */e(d.ItemText,{children:t})})});k.displayName="SelectItem";const I=d.Group,T=t(({className:a,"data-cy":t,"data-testid":r,...s},i)=>{const c=t||"select-label",o=r||"select-label";/* @__PURE__ */
|
|
8
|
+
return e(d.Label,{ref:i,className:l(v,a),"data-cy":c,"data-testid":o,...s})});T.displayName="SelectLabel";const C=t(({className:a,"data-cy":t,"data-testid":r,...s},i)=>{const c=t||"select-separator",o=r||"select-separator";/* @__PURE__ */
|
|
9
|
+
return e(d.Separator,{ref:i,className:l(w,a),"data-cy":c,"data-testid":o,...s})});C.displayName="SelectSeparator";export{x as Select,j as SelectContent,I as SelectGroup,k as SelectItem,T as SelectLabel,C as SelectSeparator,S as SelectTrigger,L as SelectValue};
|
package/dist/index14.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("./
|
|
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("./index50.cjs"),o=require("@adam-milo/icons"),n=require("./index51.cjs"),s=require("./index62.cjs"),l=t.forwardRef(({label:l,error:i,helperText:d,fullWidth:c=!0,value:u="",onChange:p,countryCode:h="US",onCountryChange:y,countries:m=n.commonCountries,enableFormatting:f=!0,onValidationChange:g,disabled:x,required:C,placeholder:b,id:w,"data-cy":S,"data-testid":v,className:$,onFocus:k,onBlur:j,...D},N)=>{const[P,E]=t.useState(!1),[L,M]=t.useState(!1),[q,B]=t.useState(0),[I,F]=t.useState({top:0,left:0,width:0}),R=t.useId(),T=w||R,V=`${T}-error`,W=`${T}-helper`,z=`${T}-listbox`,A=t.useRef(null),K=t.useRef(null),U=t.useRef(null),H=t.useRef(null),O=S||"phone-input",G=v||"phone-input",J=m.find(e=>e.code===h)||m[0],Q=n.getPhoneMask(h),X=b||Q.placeholder,Y=l&&C&&!l.includes("*")?`${l}*`:l;t.useLayoutEffect(()=>{if(!P||!K.current)return;const e=()=>{if(K.current){const e=K.current.getBoundingClientRect();F({top:e.bottom+12,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)}},[P]),t.useEffect(()=>{const e=e=>{const t=e.target,a=A.current?.contains(t),r=U.current?.contains(t);a||r||E(!1)};return P&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[P]);const Z=t.useCallback(e=>{y?.(e),E(!1),setTimeout(()=>{const e=A.current?.querySelector("input");e?.focus()},0)},[y]),_=t.useCallback(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),B(e=>Math.min(e+1,m.length-1));break;case"ArrowUp":e.preventDefault(),B(e=>Math.max(e-1,0));break;case"Enter":case" ":e.preventDefault(),Z(m[q]);break;case"Escape":e.preventDefault(),E(!1),H.current?.focus();break;case"Tab":E(!1)}},[m,q,Z]),ee=x?"disabled":i?"error":L||P?"focus":"idle";return e.jsxs("div",{ref:A,className:r.cn(s.wrapperStyles,c&&s.wrapperFullWidthStyles),"data-cy":`${O}-wrapper`,"data-testid":`${G}-wrapper`,children:[l&&e.jsx("label",{htmlFor:T,className:s.labelStyles,"data-cy":`${O}-label`,"data-testid":`${G}-label`,children:Y}),e.jsxs("div",{ref:K,className:r.cn(s.containerBaseStyles,c&&s.containerFullWidthStyles,"focus"===ee&&s.containerFocusStyles,"error"===ee&&s.containerErrorStyles,"disabled"===ee&&s.containerDisabledStyles,"idle"===ee&&s.containerIdleStyles),"data-state":ee,"data-cy":`${O}-container`,"data-testid":`${G}-container`,children:[e.jsxs("button",{ref:H,type:"button",className:s.triggerStyles,onClick:()=>!x&&E(!P),onKeyDown:e=>{if("Enter"===e.key||" "===e.key||"ArrowDown"===e.key){e.preventDefault(),E(!0);const t=m.findIndex(e=>e.code===h);B(-1===t?0:t)}},disabled:x,"aria-haspopup":"listbox","aria-expanded":P,"aria-controls":z,"aria-label":`Select country. Current: ${J.name}`,"data-cy":`${O}-country-trigger`,"data-testid":`${G}-country-trigger`,children:[e.jsx("span",{className:s.flagStyles,"data-cy":`${O}-flag`,"data-testid":`${G}-flag`,children:J.flag}),e.jsx(o.Icon,{name:"ChevronDownIcon",size:"sm",color:L||P?"clickable":"text",decorative:!0,"data-cy":`${O}-chevron`})]}),e.jsx("span",{className:s.dialCodeStyles,"data-cy":`${O}-dial-code`,"data-testid":`${G}-dial-code`,children:J.dialCode}),e.jsx("input",{ref:N,id:T,type:"tel",inputMode:"numeric",value:u,onChange:e=>{const t=e.target.value;if(f){const e=n.getPhoneDigits(t).slice(0,Q.maxLength),a=n.formatPhoneNumber(e,h);p?.(a);const r=e.length===Q.maxLength;g?.(r)}else{const e=t.replace(/[^0-9]/g,"");p?.(e);const a=e.length===Q.maxLength;g?.(a)}},onFocus:e=>{M(!0),k?.(e)},onBlur:e=>{M(!1),j?.(e)},placeholder:X,disabled:x,required:C,className:r.cn(s.inputStyles,$),"aria-invalid":i?"true":"false","aria-required":C?"true":void 0,"aria-describedby":i?V:d?W:void 0,"data-cy":O,"data-testid":G,...D})]}),P&&a.createPortal(e.jsx("div",{ref:U,id:z,role:"listbox","aria-label":"Select country",className:s.dropdownStyles,style:{top:I.top,left:I.left,width:I.width,minWidth:"20rem"},tabIndex:-1,onKeyDown:_,"data-cy":`${O}-dropdown`,"data-testid":`${G}-dropdown`,children:e.jsx("div",{className:s.dropdownViewportStyles,children:m.map((t,a)=>e.jsxs("div",{role:"option","aria-selected":t.code===h,className:r.cn(s.optionBaseStyles,a===q&&s.optionHighlightedStyles,t.code===h&&s.optionSelectedStyles),onClick:()=>Z(t),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Z(t))},onMouseEnter:()=>B(a),tabIndex:a===q?0:-1,"data-cy":`${O}-option-${t.code.toLowerCase()}`,"data-testid":`${G}-option-${t.code.toLowerCase()}`,children:[e.jsx("span",{className:s.optionFlagStyles,children:t.flag}),e.jsx("span",{className:s.optionNameStyles,children:t.name}),e.jsx("span",{className:s.optionDialCodeStyles,children:t.dialCode})]},t.code))})}),document.body),i&&e.jsx("span",{id:V,className:s.errorStyles,role:"alert","data-cy":`${O}-error`,"data-testid":`${G}-error`,children:i}),d&&!i&&e.jsx("span",{id:W,className:s.helperStyles,"data-cy":`${O}-helper`,"data-testid":`${G}-helper`,children:d})]})});l.displayName="PhoneInput",exports.allCountries=n.allCountries,exports.commonCountries=n.commonCountries,exports.defaultCountries=n.defaultCountries,exports.defaultPhoneMask=n.defaultPhoneMask,exports.formatPhoneNumber=n.formatPhoneNumber,exports.getCountriesByDialCode=n.getCountriesByDialCode,exports.getCountryByCode=n.getCountryByCode,exports.getCountryByDialCode=n.getCountryByDialCode,exports.getPhoneDigits=n.getPhoneDigits,exports.getPhoneMask=n.getPhoneMask,exports.isValidPhoneLength=n.isValidPhoneLength,exports.phoneMasks=n.phoneMasks,exports.searchCountries=n.searchCountries,exports.PhoneInput=l;
|
package/dist/index14.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,
|
|
2
|
-
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useState as r,useId as n,useRef as o,useLayoutEffect as d,useEffect as i,useCallback as l}from"react";import{createPortal as c}from"react-dom";import{cn as s}from"./index50.js";import{Icon as u}from"@adam-milo/icons";import{commonCountries as p,getPhoneMask as m,getPhoneDigits as h,formatPhoneNumber as f}from"./index51.js";import{allCountries as y,defaultCountries as w,defaultPhoneMask as b,getCountriesByDialCode as v,getCountryByCode as $,getCountryByDialCode as g,isValidPhoneLength as x,phoneMasks as N,searchCountries as C}from"./index51.js";import{labelStyles as k,triggerStyles as D,flagStyles as E,dialCodeStyles as L,dropdownStyles as j,dropdownViewportStyles as I,optionFlagStyles as M,optionNameStyles as q,optionDialCodeStyles as F,optionSelectedStyles as S,optionHighlightedStyles as z,optionBaseStyles as A,errorStyles as B,helperStyles as K,inputStyles as T,containerIdleStyles as U,containerDisabledStyles as W,containerErrorStyles as P,containerFocusStyles as R,containerFullWidthStyles as V,containerBaseStyles as G,wrapperFullWidthStyles as H,wrapperStyles as J}from"./index62.js";const O=a(({label:a,error:y,helperText:w,fullWidth:b=!0,value:v="",onChange:$,countryCode:g="US",onCountryChange:x,countries:N=p,enableFormatting:C=!0,onValidationChange:O,disabled:Q,required:X,placeholder:Y,id:Z,"data-cy":_,"data-testid":ee,className:te,onFocus:ae,onBlur:re,...ne},oe)=>{const[de,ie]=r(!1),[le,ce]=r(!1),[se,ue]=r(0),[pe,me]=r({top:0,left:0,width:0}),he=n(),fe=Z||he,ye=`${fe}-error`,we=`${fe}-helper`,be=`${fe}-listbox`,ve=o(null),$e=o(null),ge=o(null),xe=o(null),Ne=_||"phone-input",Ce=ee||"phone-input",ke=N.find(e=>e.code===g)||N[0],De=m(g),Ee=Y||De.placeholder,Le=a&&X&&!a.includes("*")?`${a}*`:a;d(()=>{if(!de||!$e.current)return;const e=()=>{if($e.current){const e=$e.current.getBoundingClientRect();me({top:e.bottom+12,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)}},[de]),i(()=>{const e=e=>{const t=e.target,a=ve.current?.contains(t),r=ge.current?.contains(t);a||r||ie(!1)};return de&&document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[de]);const je=l(e=>{x?.(e),ie(!1),setTimeout(()=>{const e=ve.current?.querySelector("input");e?.focus()},0)},[x]),Ie=l(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),ue(e=>Math.min(e+1,N.length-1));break;case"ArrowUp":e.preventDefault(),ue(e=>Math.max(e-1,0));break;case"Enter":case" ":e.preventDefault(),je(N[se]);break;case"Escape":e.preventDefault(),ie(!1),xe.current?.focus();break;case"Tab":ie(!1)}},[N,se,je]),Me=Q?"disabled":y?"error":le||de?"focus":"idle";/* @__PURE__ */
|
|
2
|
+
return e("div",{ref:ve,className:s(J,b&&H),"data-cy":`${Ne}-wrapper`,"data-testid":`${Ce}-wrapper`,children:[a&&/* @__PURE__ */t("label",{htmlFor:fe,className:k,"data-cy":`${Ne}-label`,"data-testid":`${Ce}-label`,children:Le}),
|
|
3
|
+
/* @__PURE__ */e("div",{ref:$e,className:s(G,b&&V,"focus"===Me&&R,"error"===Me&&P,"disabled"===Me&&W,"idle"===Me&&U),"data-state":Me,"data-cy":`${Ne}-container`,"data-testid":`${Ce}-container`,children:[
|
|
4
|
+
/* @__PURE__ */e("button",{ref:xe,type:"button",className:D,onClick:()=>!Q&&ie(!de),onKeyDown:e=>{if("Enter"===e.key||" "===e.key||"ArrowDown"===e.key){e.preventDefault(),ie(!0);const t=N.findIndex(e=>e.code===g);ue(-1===t?0:t)}},disabled:Q,"aria-haspopup":"listbox","aria-expanded":de,"aria-controls":be,"aria-label":`Select country. Current: ${ke.name}`,"data-cy":`${Ne}-country-trigger`,"data-testid":`${Ce}-country-trigger`,children:[
|
|
5
|
+
/* @__PURE__ */t("span",{className:E,"data-cy":`${Ne}-flag`,"data-testid":`${Ce}-flag`,children:ke.flag}),
|
|
6
|
+
/* @__PURE__ */t(u,{name:"ChevronDownIcon",size:"sm",color:le||de?"clickable":"text",decorative:!0,"data-cy":`${Ne}-chevron`})]}),
|
|
7
|
+
/* @__PURE__ */t("span",{className:L,"data-cy":`${Ne}-dial-code`,"data-testid":`${Ce}-dial-code`,children:ke.dialCode}),
|
|
8
|
+
/* @__PURE__ */t("input",{ref:oe,id:fe,type:"tel",inputMode:"numeric",value:v,onChange:e=>{const t=e.target.value;if(C){const e=h(t).slice(0,De.maxLength),a=f(e,g);$?.(a);const r=e.length===De.maxLength;O?.(r)}else{const e=t.replace(/[^0-9]/g,"");$?.(e);const a=e.length===De.maxLength;O?.(a)}},onFocus:e=>{ce(!0),ae?.(e)},onBlur:e=>{ce(!1),re?.(e)},placeholder:Ee,disabled:Q,required:X,className:s(T,te),"aria-invalid":y?"true":"false","aria-required":X?"true":void 0,"aria-describedby":y?ye:w?we:void 0,"data-cy":Ne,"data-testid":Ce,...ne})]}),de&&c(
|
|
9
|
+
/* @__PURE__ */t("div",{ref:ge,id:be,role:"listbox","aria-label":"Select country",className:j,style:{top:pe.top,left:pe.left,width:pe.width,minWidth:"20rem"},tabIndex:-1,onKeyDown:Ie,"data-cy":`${Ne}-dropdown`,"data-testid":`${Ce}-dropdown`,children:/* @__PURE__ */t("div",{className:I,children:N.map((a,r)=>/* @__PURE__ */e("div",{role:"option","aria-selected":a.code===g,className:s(A,r===se&&z,a.code===g&&S),onClick:()=>je(a),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),je(a))},onMouseEnter:()=>ue(r),tabIndex:r===se?0:-1,"data-cy":`${Ne}-option-${a.code.toLowerCase()}`,"data-testid":`${Ce}-option-${a.code.toLowerCase()}`,children:[
|
|
10
|
+
/* @__PURE__ */t("span",{className:M,children:a.flag}),
|
|
11
|
+
/* @__PURE__ */t("span",{className:q,children:a.name}),
|
|
12
|
+
/* @__PURE__ */t("span",{className:F,children:a.dialCode})]},a.code))})}),document.body),y&&/* @__PURE__ */t("span",{id:ye,className:B,role:"alert","data-cy":`${Ne}-error`,"data-testid":`${Ce}-error`,children:y}),w&&!y&&/* @__PURE__ */t("span",{id:we,className:K,"data-cy":`${Ne}-helper`,"data-testid":`${Ce}-helper`,children:w})]})});O.displayName="PhoneInput";export{O as PhoneInput,y as allCountries,p as commonCountries,w as defaultCountries,b as defaultPhoneMask,f as formatPhoneNumber,v as getCountriesByDialCode,$ as getCountryByCode,g as getCountryByDialCode,h as getPhoneDigits,m as getPhoneMask,x as isValidPhoneLength,N as phoneMasks,C as searchCountries};
|
package/dist/index15.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index50.cjs"),r=require("./index63.cjs"),l=t.forwardRef(({length:l=4,label:s,value:i="",onChange:n,onComplete:c,error:o,helperText:d,disabled:u=!1,autoFocus:p=!1,fullWidth:f=!1,centered:y=!1,type:b="numeric",size:g="lg",required:h=!1,"data-cy":m,"data-testid":$},x)=>{const S=t.useId(),k=`${S}-error`,v=`${S}-helper`,D=m||"otp-input",j=$||"otp-input",C="sm"===g?r.digitSizeSmStyles:r.digitSizeLgStyles,w=t.useRef([]),[A,I]=t.useState(()=>i.split("").slice(0,l).concat(Array(l).fill("")).slice(0,l));t.useEffect(()=>{const e=i.split("").slice(0,l).concat(Array(l).fill("")).slice(0,l);I(e)},[i,l]);const E=t.useCallback(e=>"numeric"===b?/^\d$/.test(e):/^[a-zA-Z0-9]$/.test(e),[b]),N=t.useCallback(e=>{I(e);const t=e.join("");n?.(t),e.every(e=>""!==e)&&e.length===l&&c?.(t)},[n,c,l]),q=t.useCallback(e=>{const t=w.current[e];t&&(t.focus(),t.select())},[]),z=t.useCallback((e,t)=>{const a=t.target.value;if(1===a.length&&E(a)){const t=[...A];t[e]=a,N(t),e<l-1&&q(e+1)}else if(a.length>1){const t=a.split("").filter(E),r=[...A];t.forEach((t,a)=>{e+a<l&&(r[e+a]=t)}),N(r);const s=r.findIndex(e=>""===e);q(-1===s?l-1:s)}},[A,l,E,N,q]),P=t.useCallback((e,t)=>{switch(t.key){case"Backspace":if(t.preventDefault(),A[e]){const t=[...A];t[e]="",N(t)}else if(e>0){const t=[...A];t[e-1]="",N(t),q(e-1)}break;case"Delete":if(t.preventDefault(),A[e]){const t=[...A];t[e]="",N(t)}break;case"ArrowLeft":t.preventDefault(),e>0&&q(e-1);break;case"ArrowRight":t.preventDefault(),e<l-1&&q(e+1);break;case"Home":t.preventDefault(),q(0);break;case"End":t.preventDefault(),q(l-1);break;default:if(1===t.key.length&&E(t.key)){t.preventDefault();const a=[...A];a[e]=t.key,N(a),e<l-1&&q(e+1)}}},[A,l,E,N,q]),T=t.useCallback((e,t)=>{t.preventDefault();const a=t.clipboardData.getData("text").split("").filter(E);if(0===a.length)return;const r=[...A];a.forEach((t,a)=>{e+a<l&&(r[e+a]=t)}),N(r);const s=r.findIndex(e=>""===e);q(-1===s?l-1:s)},[A,l,E,N,q]),B=t.useCallback(e=>{e.target.select()},[]);return t.useImperativeHandle(x,()=>({focus:()=>{const e=A.findIndex(e=>""===e);q(-1===e?l-1:e)},clear:()=>{const e=Array(l).fill("");N(e),q(0)},getValue:()=>A.join("")}),[A,l,q,N]),t.useEffect(()=>{p&&!u&&q(0)},[p,u,q]),e.jsxs("div",{className:a.cn(r.wrapperStyles,f&&r.wrapperFullWidthStyles),"data-cy":`${D}-wrapper`,"data-testid":`${j}-wrapper`,children:[s&&e.jsx("label",{className:a.cn(r.labelBaseStyles,o&&r.labelErrorStyles,u&&r.labelDisabledStyles),"data-cy":`${D}-label`,"data-testid":`${j}-label`,children:s}),e.jsx("div",{className:a.cn(r.containerBaseStyles,y&&r.containerCenteredStyles),role:"group","aria-label":s||"OTP Input","data-cy":`${D}-container`,"data-testid":`${j}-container`,children:Array.from({length:l},(t,s)=>e.jsx("input",{ref:e=>{w.current[s]=e},type:"text",inputMode:"numeric"===b?"numeric":"text",pattern:"numeric"===b?"[0-9]*":"[a-zA-Z0-9]*",maxLength:1,value:A[s]||"",onChange:e=>z(s,e),onKeyDown:e=>P(s,e),onPaste:e=>T(s,e),onFocus:B,disabled:u,required:h,"aria-label":`Digit ${s+1} of ${l}`,"aria-invalid":o?"true":"false","aria-describedby":o?k:d?v:void 0,className:a.cn(r.digitBaseStyles,C,o&&r.digitErrorStyles),"data-otp-digit":!0,"data-cy":`${D}-digit-${s}`,"data-testid":`${j}-digit-${s}`,autoComplete:"one-time-code"},s))}),o&&e.jsx("span",{id:k,className:r.errorStyles,role:"alert","data-cy":`${D}-error`,"data-testid":`${j}-error`,children:o}),d&&!o&&e.jsx("span",{id:v,className:r.helperStyles,"data-cy":`${D}-helper`,"data-testid":`${j}-helper`,children:d})]})});l.displayName="OTPInput",exports.OTPInput=l;
|
package/dist/index15.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as
|
|
2
|
-
|
|
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
|
-
/* @__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}),
|
|
5
|
-
/* @__PURE__ */a("span",{className:c(y,$[j],H&&!M&&u,H&&!M&&b),"data-cy":`${D}-track`,"data-testid":`${G}-track`,"aria-hidden":"true",children:/* @__PURE__ */a("span",{className:c(h,m[j],H&&!M&&p),"data-cy":`${D}-knob`,"data-testid":`${G}-knob`})}),t&&"end"===x&&/* @__PURE__ */a("span",{className:i,"data-cy":`${D}-label`,"data-testid":`${G}-label`,children:t})]}),w&&/* @__PURE__ */a("span",{id:B,className:n,"data-cy":`${D}-helper`,"data-testid":`${G}-helper`,children:w})]})});x.displayName="Toggle";export{x as Toggle};
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{forwardRef as a,useId as r,useRef as n,useState as i,useEffect as l,useCallback as c,useImperativeHandle as s}from"react";import{cn as o}from"./index50.js";import{errorStyles as d,helperStyles as p,labelDisabledStyles as u,labelErrorStyles as f,labelBaseStyles as m,digitErrorStyles as h,digitSizeSmStyles as g,digitSizeLgStyles as y,digitBaseStyles as $,containerCenteredStyles as b,containerBaseStyles as v,wrapperFullWidthStyles as D,wrapperStyles as x}from"./index63.js";const k=a(({length:a=4,label:k,value:A="",onChange:N,onComplete:w,error:j,helperText:I,disabled:C=!1,autoFocus:z=!1,fullWidth:E=!1,centered:P=!1,type:T="numeric",size:q="lg",required:F=!1,"data-cy":L,"data-testid":O},Z)=>{const B=r(),H=`${B}-error`,K=`${B}-helper`,M=L||"otp-input",R=O||"otp-input",V="sm"===q?g:y,W=n([]),[G,J]=i(()=>A.split("").slice(0,a).concat(Array(a).fill("")).slice(0,a));l(()=>{const e=A.split("").slice(0,a).concat(Array(a).fill("")).slice(0,a);J(e)},[A,a]);const Q=c(e=>"numeric"===T?/^\d$/.test(e):/^[a-zA-Z0-9]$/.test(e),[T]),S=c(e=>{J(e);const t=e.join("");N?.(t),e.every(e=>""!==e)&&e.length===a&&w?.(t)},[N,w,a]),U=c(e=>{const t=W.current[e];t&&(t.focus(),t.select())},[]),X=c((e,t)=>{const r=t.target.value;if(1===r.length&&Q(r)){const t=[...G];t[e]=r,S(t),e<a-1&&U(e+1)}else if(r.length>1){const t=r.split("").filter(Q),n=[...G];t.forEach((t,r)=>{e+r<a&&(n[e+r]=t)}),S(n);const i=n.findIndex(e=>""===e);U(-1===i?a-1:i)}},[G,a,Q,S,U]),Y=c((e,t)=>{switch(t.key){case"Backspace":if(t.preventDefault(),G[e]){const t=[...G];t[e]="",S(t)}else if(e>0){const t=[...G];t[e-1]="",S(t),U(e-1)}break;case"Delete":if(t.preventDefault(),G[e]){const t=[...G];t[e]="",S(t)}break;case"ArrowLeft":t.preventDefault(),e>0&&U(e-1);break;case"ArrowRight":t.preventDefault(),e<a-1&&U(e+1);break;case"Home":t.preventDefault(),U(0);break;case"End":t.preventDefault(),U(a-1);break;default:if(1===t.key.length&&Q(t.key)){t.preventDefault();const r=[...G];r[e]=t.key,S(r),e<a-1&&U(e+1)}}},[G,a,Q,S,U]),_=c((e,t)=>{t.preventDefault();const r=t.clipboardData.getData("text").split("").filter(Q);if(0===r.length)return;const n=[...G];r.forEach((t,r)=>{e+r<a&&(n[e+r]=t)}),S(n);const i=n.findIndex(e=>""===e);U(-1===i?a-1:i)},[G,a,Q,S,U]),ee=c(e=>{e.target.select()},[]);return s(Z,()=>({focus:()=>{const e=G.findIndex(e=>""===e);U(-1===e?a-1:e)},clear:()=>{const e=Array(a).fill("");S(e),U(0)},getValue:()=>G.join("")}),[G,a,U,S]),l(()=>{z&&!C&&U(0)},[z,C,U]),/* @__PURE__ */e("div",{className:o(x,E&&D),"data-cy":`${M}-wrapper`,"data-testid":`${R}-wrapper`,children:[k&&/* @__PURE__ */t("label",{className:o(m,j&&f,C&&u),"data-cy":`${M}-label`,"data-testid":`${R}-label`,children:k}),
|
|
2
|
+
/* @__PURE__ */t("div",{className:o(v,P&&b),role:"group","aria-label":k||"OTP Input","data-cy":`${M}-container`,"data-testid":`${R}-container`,children:Array.from({length:a},(e,r)=>/* @__PURE__ */t("input",{ref:e=>{W.current[r]=e},type:"text",inputMode:"numeric"===T?"numeric":"text",pattern:"numeric"===T?"[0-9]*":"[a-zA-Z0-9]*",maxLength:1,value:G[r]||"",onChange:e=>X(r,e),onKeyDown:e=>Y(r,e),onPaste:e=>_(r,e),onFocus:ee,disabled:C,required:F,"aria-label":`Digit ${r+1} of ${a}`,"aria-invalid":j?"true":"false","aria-describedby":j?H:I?K:void 0,className:o($,V,j&&h),"data-otp-digit":!0,"data-cy":`${M}-digit-${r}`,"data-testid":`${R}-digit-${r}`,autoComplete:"one-time-code"},r))}),j&&/* @__PURE__ */t("span",{id:H,className:d,role:"alert","data-cy":`${M}-error`,"data-testid":`${R}-error`,children:j}),I&&!j&&/* @__PURE__ */t("span",{id:K,className:p,"data-cy":`${M}-helper`,"data-testid":`${R}-helper`,children:I})]})});k.displayName="OTPInput";export{k as OTPInput};
|
package/dist/index16.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),t=require("./index50.cjs"),s=require("./index64.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/index16.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return
|
|
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"./index50.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"./index64.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
|
+
return e("div",{className:c(g,M&&k),"data-cy":`${D}-wrapper`,"data-testid":`${G}-wrapper`,children:[
|
|
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
|
+
/* @__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}),
|
|
5
|
+
/* @__PURE__ */a("span",{className:c(y,$[j],H&&!M&&u,H&&!M&&b),"data-cy":`${D}-track`,"data-testid":`${G}-track`,"aria-hidden":"true",children:/* @__PURE__ */a("span",{className:c(h,m[j],H&&!M&&p),"data-cy":`${D}-knob`,"data-testid":`${G}-knob`})}),t&&"end"===x&&/* @__PURE__ */a("span",{className:i,"data-cy":`${D}-label`,"data-testid":`${G}-label`,children:t})]}),w&&/* @__PURE__ */a("span",{id:B,className:n,"data-cy":`${D}-helper`,"data-testid":`${G}-helper`,children:w})]})});x.displayName="Toggle";export{x as Toggle};
|
package/dist/index17.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime");function e({methods:e,onSubmit:r,onError:o,children:a,"data-cy":i,"data-testid":d,...n}){return t.jsx("form",{onSubmit:e.handleSubmit(r,o),"data-cy":i??"form","data-testid":d??"form",noValidate:!0,...n,children:a})}e.displayName="Form",exports.Form=e;
|
package/dist/index17.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";function r({methods:r,onSubmit:a,onError:o,children:d,"data-cy":e,"data-testid":i,...m}){/* @__PURE__ */
|
|
2
|
+
return t("form",{onSubmit:r.handleSubmit(a,o),"data-cy":e??"form","data-testid":i??"form",noValidate:!0,...m,children:d})}r.displayName="Form";export{r as Form};
|
package/dist/index18.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index65.cjs");function t({control:t,name:n,rules:a,children:o,"data-cy":l,"data-testid":s}){return e.jsx(r.Controller,{control:t,name:n,rules:a,render:({field:r,fieldState:t})=>e.jsx("div",{className:"contents","data-cy":l,"data-testid":s,children:o({value:r.value,onChange:r.onChange,onBlur:r.onBlur,ref:r.ref,error:t.error?.message,name:r.name})})})}t.displayName="FormField",exports.FormField=t;
|
package/dist/index18.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{
|
|
2
|
-
return e(r,{control:a,name:
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Controller as r}from"./index65.js";function a({control:a,name:n,rules:t,children:o,"data-cy":d,"data-testid":l}){/* @__PURE__ */
|
|
2
|
+
return e(r,{control:a,name:n,rules:t,render:({field:r,fieldState:a})=>/* @__PURE__ */e("div",{className:"contents","data-cy":d,"data-testid":l,children:o({value:r.value,onChange:r.onChange,onBlur:r.onBlur,ref:r.ref,error:a.error?.message,name:r.name})})})}a.displayName="FormField";export{a as FormField};
|
package/dist/index19.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index18.cjs"),r=require("./index6.cjs");function a({control:a,name:n,rules:l,"data-cy":o,"data-testid":i,...u}){return e.jsx(t.FormField,{control:a,name:n,rules:l,"data-cy":o,"data-testid":i,children:({value:t,onChange:a,onBlur:n,ref:l,error:d})=>e.jsx(r.EmailInput,{value:t??"",onChange:e=>a(e.target.value),onBlur:n,ref:l,error:d,"data-cy":o??"controlled-email-input","data-testid":i??"controlled-email-input",...u})})}a.displayName="ControlledEmailInput",exports.ControlledEmailInput=a;
|
package/dist/index19.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return r
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{FormField as r}from"./index18.js";import{EmailInput as t}from"./index6.js";function a({control:a,name:o,rules:n,"data-cy":l,"data-testid":i,...d}){/* @__PURE__ */
|
|
2
|
+
return e(r,{control:a,name:o,rules:n,"data-cy":l,"data-testid":i,children:({value:r,onChange:a,onBlur:o,ref:n,error:m})=>/* @__PURE__ */e(t,{value:r??"",onChange:e=>a(e.target.value),onBlur:o,ref:n,error:m,"data-cy":l??"controlled-email-input","data-testid":i??"controlled-email-input",...d})})}a.displayName="ControlledEmailInput";export{a as ControlledEmailInput};
|
package/dist/index20.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index18.cjs"),t=require("./index7.cjs");function o({control:o,name:a,rules:n,"data-cy":s,"data-testid":d,...l}){return e.jsx(r.FormField,{control:o,name:a,rules:n,"data-cy":s,"data-testid":d,children:({value:r,onChange:o,onBlur:a,ref:n,error:u})=>e.jsx(t.PasswordInput,{value:r??"",onChange:e=>o(e.target.value),onBlur:a,ref:n,error:u,"data-cy":s??"controlled-password-input","data-testid":d??"controlled-password-input",...l})})}o.displayName="ControlledPasswordInput",exports.ControlledPasswordInput=o;
|
package/dist/index20.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{FormField as t}from"./index18.js";import{PasswordInput as e}from"./index7.js";function o({control:o,name:a,rules:n,"data-cy":d,"data-testid":l,...s}){/* @__PURE__ */
|
|
2
|
+
return r(t,{control:o,name:a,rules:n,"data-cy":d,"data-testid":l,children:({value:t,onChange:o,onBlur:a,ref:n,error:i})=>/* @__PURE__ */r(e,{value:t??"",onChange:r=>o(r.target.value),onBlur:a,ref:n,error:i,"data-cy":d??"controlled-password-input","data-testid":l??"controlled-password-input",...s})})}o.displayName="ControlledPasswordInput";export{o as ControlledPasswordInput};
|
package/dist/index21.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index18.cjs"),t=require("./index11.cjs");function o({control:o,name:c,rules:n,"data-cy":a,"data-testid":d,...l}){return e.jsx(r.FormField,{control:o,name:c,rules:n,"data-cy":a,"data-testid":d,children:({value:r,onChange:o,onBlur:c,ref:n,error:i})=>e.jsx(t.Checkbox,{checked:!!r,onChange:e=>o(e.target.checked),onBlur:c,ref:n,error:i,"data-cy":a??"controlled-checkbox","data-testid":d??"controlled-checkbox",...l})})}o.displayName="ControlledCheckbox",exports.ControlledCheckbox=o;
|
package/dist/index21.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return r
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{FormField as r}from"./index18.js";import{Checkbox as o}from"./index11.js";function t({control:t,name:a,rules:n,"data-cy":c,"data-testid":d,...l}){/* @__PURE__ */
|
|
2
|
+
return e(r,{control:t,name:a,rules:n,"data-cy":c,"data-testid":d,children:({value:r,onChange:t,onBlur:a,ref:n,error:i})=>/* @__PURE__ */e(o,{checked:!!r,onChange:e=>t(e.target.checked),onBlur:a,ref:n,error:i,"data-cy":c??"controlled-checkbox","data-testid":d??"controlled-checkbox",...l})})}t.displayName="ControlledCheckbox";export{t as ControlledCheckbox};
|
package/dist/index22.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index18.cjs"),o=require("./index12.cjs");function t({control:t,name:a,value:d,rules:n,"data-cy":l,"data-testid":i,...c}){return e.jsx(r.FormField,{control:t,name:a,rules:n,"data-cy":l,"data-testid":i,children:({value:r,onChange:t,onBlur:a,ref:n,error:s})=>e.jsx(o.Radio,{value:d,checked:r===d,onChange:()=>t(d),onBlur:a,ref:n,error:s,"data-cy":l??"controlled-radio","data-testid":i??"controlled-radio",...c})})}t.displayName="ControlledRadio",exports.ControlledRadio=t;
|
package/dist/index22.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return e
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{FormField as e}from"./index18.js";import{Radio as o}from"./index12.js";function a({control:a,name:t,value:d,rules:n,"data-cy":l,"data-testid":i,...c}){/* @__PURE__ */
|
|
2
|
+
return r(e,{control:a,name:t,rules:n,"data-cy":l,"data-testid":i,children:({value:e,onChange:a,onBlur:t,ref:n,error:m})=>/* @__PURE__ */r(o,{value:d,checked:e===d,onChange:()=>a(d),onBlur:t,ref:n,error:m,"data-cy":l??"controlled-radio","data-testid":i??"controlled-radio",...c})})}a.displayName="ControlledRadio";export{a as ControlledRadio};
|
package/dist/index23.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("./index18.cjs"),r=require("./index16.cjs");function o({control:o,name:l,rules:n,"data-cy":a,"data-testid":d,...c}){return e.jsx(t.FormField,{control:o,name:l,rules:n,"data-cy":a,"data-testid":d,children:({value:t,onChange:o,onBlur:l,ref:n})=>e.jsx(r.Toggle,{checked:!!t,onChange:e=>o(e.target.checked),onBlur:l,ref:n,"data-cy":a??"controlled-toggle","data-testid":d??"controlled-toggle",...c})})}o.displayName="ControlledToggle",exports.ControlledToggle=o;
|
package/dist/index23.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
2
|
-
return
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{FormField as t}from"./index18.js";import{Toggle as o}from"./index16.js";function r({control:r,name:a,rules:n,"data-cy":d,"data-testid":l,...c}){/* @__PURE__ */
|
|
2
|
+
return e(t,{control:r,name:a,rules:n,"data-cy":d,"data-testid":l,children:({value:t,onChange:r,onBlur:a,ref:n})=>/* @__PURE__ */e(o,{checked:!!t,onChange:e=>r(e.target.checked),onBlur:a,ref:n,"data-cy":d??"controlled-toggle","data-testid":l??"controlled-toggle",...c})})}r.displayName="ControlledToggle";export{r as ControlledToggle};
|
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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index18.cjs"),t=require("./index9.cjs");function n({control:n,name:o,rules:u,"data-cy":a,"data-testid":i,...l}){return e.jsx(r.FormField,{control:n,name:o,rules:u,"data-cy":a,"data-testid":i,children:({value:r,onChange:n,onBlur:o,ref:u,error:c})=>e.jsx(t.NumericInput,{value:r??"",onChange:e=>n(e.target.value),onBlur:o,ref:u,error:c,"data-cy":a??"controlled-numeric-input","data-testid":i??"controlled-numeric-input",...l})})}n.displayName="ControlledNumericInput",exports.ControlledNumericInput=n;
|
package/dist/index24.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r}from"react/jsx-runtime";import{FormField as e}from"./
|
|
2
|
-
return r(e,{control:
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{FormField as e}from"./index18.js";import{NumericInput as t}from"./index9.js";function n({control:n,name:o,rules:a,"data-cy":i,"data-testid":l,...d}){/* @__PURE__ */
|
|
2
|
+
return r(e,{control:n,name:o,rules:a,"data-cy":i,"data-testid":l,children:({value:e,onChange:n,onBlur:o,ref:a,error:u})=>/* @__PURE__ */r(t,{value:e??"",onChange:r=>n(r.target.value),onBlur:o,ref:a,error:u,"data-cy":i??"controlled-numeric-input","data-testid":l??"controlled-numeric-input",...d})})}n.displayName="ControlledNumericInput";export{n as ControlledNumericInput};
|
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("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("./index18.cjs"),t=require("./index10.cjs");function n({control:n,name:a,rules:l,"data-cy":o,"data-testid":u,...i}){return e.jsx(r.FormField,{control:n,name:a,rules:l,"data-cy":o,"data-testid":u,children:({value:r,onChange:n,onBlur:a,ref:l,error:c})=>e.jsx(t.AlphanumericInput,{value:r??"",onChange:e=>n(e.target.value),onBlur:a,ref:l,error:c,"data-cy":o??"controlled-alphanumeric-input","data-testid":u??"controlled-alphanumeric-input",...i})})}n.displayName="ControlledAlphanumericInput",exports.ControlledAlphanumericInput=n;
|