mainstack-design-system 1.3.8 → 1.3.9

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.
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),m=require("./index-4R9KShCu.cjs"),d=require("./mainstack-design-system566.cjs"),b=require("./mainstack-design-system567.cjs"),r=a.forwardRef(({...o},n)=>{const{isOptionOpen:t,onOptionOpenChange:i,activeCountry:s,isDisabled:u,isError:l,isSuccess:c}=d.usePhoneNumberContext();return e.jsx(m.PopoverTrigger,{asChild:!0,children:e.jsx(b.FormCountrySelect,{...o,"data-slot":"phone-number-flag-field",disabled:u,isOptionOpen:t,onOptionOpenChange:i,activeCountry:s,isError:l,isSuccess:c,ref:n})})});r.displayName="PhoneNumberFlagField";exports.PhoneNumberFlagField=r;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("./index-4R9KShCu.cjs"),b=require("./mainstack-design-system566.cjs"),p=require("./mainstack-design-system567.cjs"),r=m.forwardRef(({disabled:o,...n},t)=>{const{isOptionOpen:i,onOptionOpenChange:s,activeCountry:u,isDisabled:l,isError:c,isSuccess:a}=b.usePhoneNumberContext();return e.jsx(d.PopoverTrigger,{asChild:!0,children:e.jsx(p.FormCountrySelect,{...n,"data-slot":"phone-number-flag-field",disabled:o||l,isOptionOpen:i,onOptionOpenChange:s,activeCountry:u,isError:c,isSuccess:a,ref:t})})});r.displayName="PhoneNumberFlagField";exports.PhoneNumberFlagField=r;
@@ -1,36 +1,36 @@
1
1
  'use client';
2
2
  import { jsx as e } from "react/jsx-runtime";
3
- import { forwardRef as l } from "react";
4
- import { a as p } from "./index-RoCFhqzC.js";
5
- import { usePhoneNumberContext as d } from "./mainstack-design-system566.js";
6
- import { FormCountrySelect as u } from "./mainstack-design-system567.js";
7
- const f = l(
8
- ({ ...r }, o) => {
3
+ import { forwardRef as p } from "react";
4
+ import { a as d } from "./index-RoCFhqzC.js";
5
+ import { usePhoneNumberContext as u } from "./mainstack-design-system566.js";
6
+ import { FormCountrySelect as f } from "./mainstack-design-system567.js";
7
+ const c = p(
8
+ ({ disabled: r, ...o }, i) => {
9
9
  const {
10
- isOptionOpen: i,
11
- onOptionOpenChange: t,
12
- activeCountry: n,
13
- isDisabled: m,
14
- isError: s,
15
- isSuccess: a
16
- } = d();
17
- return /* @__PURE__ */ e(p, { asChild: !0, children: /* @__PURE__ */ e(
18
- u,
10
+ isOptionOpen: t,
11
+ onOptionOpenChange: n,
12
+ activeCountry: m,
13
+ isDisabled: s,
14
+ isError: a,
15
+ isSuccess: l
16
+ } = u();
17
+ return /* @__PURE__ */ e(d, { asChild: !0, children: /* @__PURE__ */ e(
18
+ f,
19
19
  {
20
- ...r,
20
+ ...o,
21
21
  "data-slot": "phone-number-flag-field",
22
- disabled: m,
23
- isOptionOpen: i,
24
- onOptionOpenChange: t,
25
- activeCountry: n,
26
- isError: s,
27
- isSuccess: a,
28
- ref: o
22
+ disabled: r || s,
23
+ isOptionOpen: t,
24
+ onOptionOpenChange: n,
25
+ activeCountry: m,
26
+ isError: a,
27
+ isSuccess: l,
28
+ ref: i
29
29
  }
30
30
  ) });
31
31
  }
32
32
  );
33
- f.displayName = "PhoneNumberFlagField";
33
+ c.displayName = "PhoneNumberFlagField";
34
34
  export {
35
- f as PhoneNumberFlagField
35
+ c as PhoneNumberFlagField
36
36
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),p=require("react"),g=require("./mainstack-design-system431.cjs"),m=require("./mainstack-design-system432.cjs");require("./mainstack-design-system430.cjs");const e=require("./utils-DRUMSl4z.cjs"),F=require("./mainstack-design-system571.cjs"),C=require("./mainstack-design-system560.cjs"),c=p.forwardRef(({placeholder:a="0.00",...l},s)=>{const{activeCountry:i,isDisabled:u,value:d,onValueChange:r}=F.usePriceFieldContext(),_=C.COUNTRIES_ISO2_CODE_TO_CURRENCY_CODE_MAP[i];return t.jsxs(g.InputRoot,{"data-slot":"price-field-digit-field",className:" has-disabled:opacity-50",children:[t.jsx("p",{className:e.cn("body-extrasmall-book"),children:_??""}),t.jsx(m.InputField,{...l,disabled:u,placeholder:a,value:e.formatPriceDigit(e.sanitizePriceInputValue(d)),onChange:n=>{const o=e.getPriceDigitMetadataValueObject({value:n.target.value,activeCountry:i});r&&(n.target.value=o.digit,r(o))},ref:s})]})});c.displayName="PriceFieldDigitField";exports.PriceFieldDigitField=c;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),g=require("react"),m=require("./mainstack-design-system431.cjs"),F=require("./mainstack-design-system432.cjs");require("./mainstack-design-system430.cjs");const e=require("./utils-DRUMSl4z.cjs"),C=require("./mainstack-design-system571.cjs"),P=require("./mainstack-design-system560.cjs"),c=g.forwardRef(({placeholder:a="0.00",disabled:l,...s},u)=>{const{activeCountry:i,isDisabled:d,value:_,onValueChange:r}=C.usePriceFieldContext(),p=P.COUNTRIES_ISO2_CODE_TO_CURRENCY_CODE_MAP[i];return t.jsxs(m.InputRoot,{"data-slot":"price-field-digit-field",className:" has-disabled:opacity-50",children:[t.jsx("p",{className:e.cn("body-extrasmall-book"),children:p??""}),t.jsx(F.InputField,{...s,disabled:l||d,placeholder:a,value:e.formatPriceDigit(e.sanitizePriceInputValue(_)),onChange:n=>{const o=e.getPriceDigitMetadataValueObject({value:n.target.value,activeCountry:i});r&&(n.target.value=o.digit,r(o))},ref:u})]})});c.displayName="PriceFieldDigitField";exports.PriceFieldDigitField=c;
@@ -1,37 +1,37 @@
1
1
  'use client';
2
- import { jsxs as n, jsx as r } from "react/jsx-runtime";
3
- import { forwardRef as p } from "react";
4
- import { InputRoot as u } from "./mainstack-design-system431.js";
5
- import { InputField as f } from "./mainstack-design-system432.js";
2
+ import { jsxs as p, jsx as r } from "react/jsx-runtime";
3
+ import { forwardRef as u } from "react";
4
+ import { InputRoot as f } from "./mainstack-design-system431.js";
5
+ import { InputField as g } from "./mainstack-design-system432.js";
6
6
  import "./mainstack-design-system430.js";
7
- import { c as g, f as C, e as _, b } from "./utils-CFdAYIby.js";
8
- import { usePriceFieldContext as v } from "./mainstack-design-system571.js";
9
- import { COUNTRIES_ISO2_CODE_TO_CURRENCY_CODE_MAP as D } from "./mainstack-design-system560.js";
10
- const P = p(
11
- ({ placeholder: o = "0.00", ...l }, c) => {
12
- const { activeCountry: e, isDisabled: d, value: s, onValueChange: i } = v(), m = D[e];
13
- return /* @__PURE__ */ n(
14
- u,
7
+ import { c as C, f as _, e as b, b as v } from "./utils-CFdAYIby.js";
8
+ import { usePriceFieldContext as D } from "./mainstack-design-system571.js";
9
+ import { COUNTRIES_ISO2_CODE_TO_CURRENCY_CODE_MAP as P } from "./mainstack-design-system560.js";
10
+ const y = u(
11
+ ({ placeholder: o = "0.00", disabled: l, ...c }, d) => {
12
+ const { activeCountry: e, isDisabled: s, value: m, onValueChange: i } = D(), n = P[e];
13
+ return /* @__PURE__ */ p(
14
+ f,
15
15
  {
16
16
  "data-slot": "price-field-digit-field",
17
17
  className: " has-disabled:opacity-50",
18
18
  children: [
19
- /* @__PURE__ */ r("p", { className: g("body-extrasmall-book"), children: m ?? "" }),
19
+ /* @__PURE__ */ r("p", { className: C("body-extrasmall-book"), children: n ?? "" }),
20
20
  /* @__PURE__ */ r(
21
- f,
21
+ g,
22
22
  {
23
- ...l,
24
- disabled: d,
23
+ ...c,
24
+ disabled: l || s,
25
25
  placeholder: o,
26
- value: C(b(s)),
26
+ value: _(v(m)),
27
27
  onChange: (t) => {
28
- const a = _({
28
+ const a = b({
29
29
  value: t.target.value,
30
30
  activeCountry: e
31
31
  });
32
32
  i && (t.target.value = a.digit, i(a));
33
33
  },
34
- ref: c
34
+ ref: d
35
35
  }
36
36
  )
37
37
  ]
@@ -39,7 +39,7 @@ const P = p(
39
39
  );
40
40
  }
41
41
  );
42
- P.displayName = "PriceFieldDigitField";
42
+ y.displayName = "PriceFieldDigitField";
43
43
  export {
44
- P as PriceFieldDigitField
44
+ y as PriceFieldDigitField
45
45
  };
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),u=require("./index-4R9KShCu.cjs"),F=require("./mainstack-design-system571.cjs"),p=require("./mainstack-design-system567.cjs"),i=a.forwardRef(({...r},t)=>{const{isOptionOpen:o,onOptionOpenChange:n,activeCountry:l,isDisabled:c,isError:s,isSuccess:d}=F.usePriceFieldContext();return e.jsx(u.PopoverTrigger,{asChild:!0,children:e.jsx(p.FormCountrySelect,{...r,"data-slot":"price-field-flag-field",disabled:c,isOptionOpen:o,onOptionOpenChange:n,activeCountry:l,isError:s,isSuccess:d,ref:t})})});i.displayName="PriceFieldFlagField";exports.PriceFieldFlagField=i;
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),F=require("./index-4R9KShCu.cjs"),p=require("./mainstack-design-system571.cjs"),g=require("./mainstack-design-system567.cjs"),i=u.forwardRef(({disabled:r,...t},o)=>{const{isOptionOpen:n,onOptionOpenChange:l,activeCountry:c,isDisabled:s,isError:d,isSuccess:a}=p.usePriceFieldContext();return e.jsx(F.PopoverTrigger,{asChild:!0,children:e.jsx(g.FormCountrySelect,{...t,"data-slot":"price-field-flag-field",disabled:r||s,isOptionOpen:n,onOptionOpenChange:l,activeCountry:c,isError:d,isSuccess:a,ref:o})})});i.displayName="PriceFieldFlagField";exports.PriceFieldFlagField=i;
@@ -1,36 +1,36 @@
1
1
  'use client';
2
2
  import { jsx as e } from "react/jsx-runtime";
3
- import { forwardRef as n } from "react";
4
- import { a as p } from "./index-RoCFhqzC.js";
5
- import { usePriceFieldContext as m } from "./mainstack-design-system571.js";
6
- import { FormCountrySelect as c } from "./mainstack-design-system567.js";
7
- const f = n(
8
- ({ ...r }, i) => {
3
+ import { forwardRef as p } from "react";
4
+ import { a as m } from "./index-RoCFhqzC.js";
5
+ import { usePriceFieldContext as c } from "./mainstack-design-system571.js";
6
+ import { FormCountrySelect as f } from "./mainstack-design-system567.js";
7
+ const F = p(
8
+ ({ disabled: r, ...i }, o) => {
9
9
  const {
10
- isOptionOpen: o,
11
- onOptionOpenChange: t,
12
- activeCountry: l,
13
- isDisabled: s,
14
- isError: a,
15
- isSuccess: d
16
- } = m();
17
- return /* @__PURE__ */ e(p, { asChild: !0, children: /* @__PURE__ */ e(
18
- c,
10
+ isOptionOpen: t,
11
+ onOptionOpenChange: l,
12
+ activeCountry: s,
13
+ isDisabled: a,
14
+ isError: d,
15
+ isSuccess: n
16
+ } = c();
17
+ return /* @__PURE__ */ e(m, { asChild: !0, children: /* @__PURE__ */ e(
18
+ f,
19
19
  {
20
- ...r,
20
+ ...i,
21
21
  "data-slot": "price-field-flag-field",
22
- disabled: s,
23
- isOptionOpen: o,
24
- onOptionOpenChange: t,
25
- activeCountry: l,
26
- isError: a,
27
- isSuccess: d,
28
- ref: i
22
+ disabled: r || a,
23
+ isOptionOpen: t,
24
+ onOptionOpenChange: l,
25
+ activeCountry: s,
26
+ isError: d,
27
+ isSuccess: n,
28
+ ref: o
29
29
  }
30
30
  ) });
31
31
  }
32
32
  );
33
- f.displayName = "PriceFieldFlagField";
33
+ F.displayName = "PriceFieldFlagField";
34
34
  export {
35
- f as PriceFieldFlagField
35
+ F as PriceFieldFlagField
36
36
  };
@@ -1,3 +1,3 @@
1
1
  'use client';
2
2
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react/jsx-runtime"),f=require("react"),tt=require("./mainstack-design-system431.cjs"),et=require("./mainstack-design-system432.cjs");require("./mainstack-design-system430.cjs");const u=require("./index-C7rXc8w3.cjs"),q=require("./utils-DRUMSl4z.cjs"),nt=require("./mainstack-design-system566.cjs");function T(t,n){return ut(t)||at(t,n)||ot(t,n)||rt()}function rt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ot(t,n){if(t){if(typeof t=="string")return M(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return M(t,n)}}function M(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function at(t,n){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var r,o,a,s,p=[],c=!0,i=!1;try{if(a=(e=e.call(t)).next,n!==0)for(;!(c=(r=a.call(e)).done)&&(p.push(r.value),p.length!==n);c=!0);}catch(d){i=!0,o=d}finally{try{if(!c&&e.return!=null&&(s=e.return(),Object(s)!==s))return}finally{if(i)throw o}}return p}}function ut(t){if(Array.isArray(t))return t}function it(t){var n=this,e=t.value,r=t.onChange,o=t.country,a=t.defaultCountry,s=t.international,p=t.withCountryCallingCode,c=t.useNationalFormatForDefaultCountryValue,i=t.metadata;typeof p=="boolean"&&!(o&&s)&&console.error("[react-phone-number-input] `withCountryCallingCode` property can only be used together with `country` and `international` properties"),o&&a&&console.error("[react-phone-number-input] When `country` property is passed, `defaultCountry` property has no effect and therefore shouldn't be passed"),typeof s=="boolean"&&!o&&console.error("[react-phone-number-input] `international` property can only be used together with `country` property");var d=st({international:s,country:o,defaultCountry:a,withCountryCallingCode:p}),m=f.useRef(),b=function(y,C,v){console.error("[react-phone-number-input] Expected phone number ".concat(y," to correspond to country ").concat(C," but ").concat(v?"in reality it corresponds to country "+v:"it doesn't",".")),m.current=!0},g=function(y){return e&&u.validateE164Number(e),lt(e,o,a,d,c,i,function(){y&&y.onCountryMismatch&&y.onCountryMismatch();for(var C=arguments.length,v=new Array(C),O=0;O<C;O++)v[O]=arguments[O];b.apply(n,v)})},w=f.useState(o),I=T(w,2),F=I[0],B=I[1],H=f.useState(a),E=T(H,2),z=E[0],G=E[1],J=f.useState(g()),_=T(J,2),K=_[0],h=_[1],Q=f.useState(e),L=T(Q,2),A=L[0],N=L[1],X=f.useState(),x=T(X,2);x[0];var $=x[1],D=f.useCallback(function(){return $({})},[$]);function V(l){if(l){d==="NATIONAL_PART_OF_INTERNATIONAL"&&(l="+".concat(u.getCountryCallingCode$1(o,i)).concat(l));var y=new u.AsYouType(o||a,i);return y.input(l),y.getNumberValue()}}f.useEffect(function(){e!==A&&(N(e),h(g()))},[e]),f.useEffect(function(){if(o!==F){B(o);var l,y=g({onCountryMismatch:function(){l=!0}});h(y),l&&N(V(y))}},[o]),f.useEffect(function(){a!==z&&(G(a),h(g()))},[a]),f.useEffect(function(){A!==e&&r(A)},[A]);var Z=f.useCallback(function(l){var y;if(o)if(d==="INTERNATIONAL"){var C=u.getInternationalPhoneNumberPrefix(o,i);if(l.indexOf(C)!==0){if(l&&l[0]!=="+")l=C+l;else if(!m.current)return h(C),N(void 0),D()}}else l&&l[0]==="+"&&(l=l.slice(1));else a||l&&l[0]!=="+"&&(l="+"+l);l&&(y=V(l)),h(l),N(y)},[o,d,a,i,h,N,D,m]);return{phoneDigits:K,setPhoneDigits:Z,inputFormat:d}}function lt(t,n,e,r,o,a,s){if(n&&r==="INTERNATIONAL"){var p=u.getInternationalPhoneNumberPrefix(n,a);return t?(t.indexOf(p)!==0&&s(t,n),t):p}if(!t)return"";if(!n&&!e)return t;var c=new u.AsYouType(void 0,a);c.input(t);var i=c.getNumber();if(i)if(n)switch(i.country&&i.country!==n?s(t,n,i.country):i.countryCallingCode!==u.getCountryCallingCode$1(n,a)&&s(t,n),r){case"NATIONAL":return u.parseDigits(i.formatNational());case"NATIONAL_PART_OF_INTERNATIONAL":return u.parseDigits(u.removePrefixFromFormattedPhoneNumber(i.formatInternational(),u.getInternationalPhoneNumberPrefix(n,a)));case"INTERNATIONAL":throw new Error('`inputFormat: "INTERNATIONAL"` case should\'ve already been handled earlier in the code');case"INTERNATIONAL_OR_NATIONAL":throw new Error('`inputFormat: "INTERNATIONAL_OR_NATIONAL"` is not possible when `country` is fixed');default:throw new Error("Unknown `inputFormat`: ".concat(r))}else return i.countryCallingCode&&i.countryCallingCode===u.getCountryCallingCode$1(e,a)&&o?u.parseDigits(i.formatNational()):t;else return""}function st(t){var n=t.international,e=t.country,r=t.defaultCountry,o=t.withCountryCallingCode;return e?n?o?"INTERNATIONAL":"NATIONAL_PART_OF_INTERNATIONAL":"NATIONAL":r?"INTERNATIONAL_OR_NATIONAL":"INTERNATIONAL"}var ct=["Component","country","defaultCountry","useNationalFormatForDefaultCountryValue","value","onChange","metadata","international","withCountryCallingCode"];function j(){return j=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},j.apply(this,arguments)}function ft(t,n){if(t==null)return{};var e=pt(t,n),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(e[r]=t[r])}return e}function pt(t,n){if(t==null)return{};var e={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(n.indexOf(o)>=0)&&(e[o]=t[o]);return e}function P(t,n){var e=t.Component,r=t.country,o=t.defaultCountry,a=t.useNationalFormatForDefaultCountryValue,s=a===void 0?!0:a,p=t.value,c=t.onChange,i=t.metadata,d=t.international,m=t.withCountryCallingCode,b=ft(t,ct),g=it({value:p,onChange:c,country:r,defaultCountry:o,international:d,withCountryCallingCode:m,useNationalFormatForDefaultCountryValue:s,metadata:i}),w=g.phoneDigits,I=g.setPhoneDigits,F=g.inputFormat;return f.createElement(e,j({},b,{ref:n,metadata:i,inputFormat:F,international:d,withCountryCallingCode:m,country:r||o,value:w,onChange:I}))}P=f.forwardRef(P);P.propTypes={value:u.PropTypes.string,onChange:u.PropTypes.func.isRequired,country:u.PropTypes.string,defaultCountry:u.PropTypes.string,international:u.PropTypes.bool,withCountryCallingCode:u.PropTypes.bool,Component:u.PropTypes.elementType.isRequired,useNationalFormatForDefaultCountryValue:u.PropTypes.bool,metadata:u.metadata};var yt=["type","autoComplete","smartCaret","metadata"];function S(){return S=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},S.apply(this,arguments)}function dt(t,n){if(t==null)return{};var e=Ct(t,n),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(o=0;o<a.length;o++)r=a[o],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(e[r]=t[r])}return e}function Ct(t,n){if(t==null)return{};var e={},r=Object.keys(t),o,a;for(a=0;a<r.length;a++)o=r[a],!(n.indexOf(o)>=0)&&(e[o]=t[o]);return e}function k(t){function n(e,r){var o=e.type,a=o===void 0?"tel":o,s=e.autoComplete,p=s===void 0?"tel":s,c=e.smartCaret,i=c===void 0?!0:c,d=e.metadata,m=d===void 0?t:d,b=dt(e,yt);return f.createElement(P,S({},b,{type:a,autoComplete:p,metadata:m,ref:r,Component:i?u.InputSmart:u.InputBasic}))}return n=f.forwardRef(n),n.propTypes={type:u.PropTypes.string,autoComplete:u.PropTypes.string,smartCaret:u.PropTypes.bool,metadata:u.PropTypes.object},n}k();function Y(t,n){var e=Array.prototype.slice.call(n);return e.push(u.metadata$1),t.apply(this,e)}k(u.metadata$1);function W(){return Y(u.getCountryCallingCode$1,arguments)}function mt(){return Y(u.isSupportedCountry$1,arguments)}const U=f.forwardRef(({placeholder:t="000 - 000 - 000",...n},e)=>{const{activeCountry:r,isDisabled:o,value:a,onValueChange:s}=nt.usePhoneNumberContext(),p=c=>{if(!c)return"";let i="";return r&&mt(r)&&(i=W(r)),c.replace(`+${i}`,"")};return R.jsxs(tt.InputRoot,{"data-slot":"phone-number-digit-field",className:" has-disabled:opacity-50",children:[R.jsxs("p",{className:q.cn("body-extrasmall-book"),children:["(+",W(r||"US"),")"]}),R.jsx(et.InputField,{...n,disabled:o,placeholder:t,value:p(a),onChange:c=>{const i=q.getPhoneNumberDigitMetadataValueObject({value:c.target.value,activeCountry:r});s&&(c.target.value=i.digit,s(i))},ref:e})]})});U.displayName="PhoneNumberDigitField";exports.PhoneNumberDigitField=U;
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ot(t,n){if(t){if(typeof t=="string")return M(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return M(t,n)}}function M(t,n){(n==null||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function at(t,n){var e=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(e!=null){var o,r,a,c,p=[],y=!0,i=!1;try{if(a=(e=e.call(t)).next,n!==0)for(;!(y=(o=a.call(e)).done)&&(p.push(o.value),p.length!==n);y=!0);}catch(s){i=!0,r=s}finally{try{if(!y&&e.return!=null&&(c=e.return(),Object(c)!==c))return}finally{if(i)throw r}}return p}}function ut(t){if(Array.isArray(t))return t}function it(t){var n=this,e=t.value,o=t.onChange,r=t.country,a=t.defaultCountry,c=t.international,p=t.withCountryCallingCode,y=t.useNationalFormatForDefaultCountryValue,i=t.metadata;typeof p=="boolean"&&!(r&&c)&&console.error("[react-phone-number-input] `withCountryCallingCode` property can only be used together with `country` and `international` properties"),r&&a&&console.error("[react-phone-number-input] When `country` property is passed, `defaultCountry` property has no effect and therefore shouldn't be passed"),typeof c=="boolean"&&!r&&console.error("[react-phone-number-input] `international` property can only be used together with `country` property");var s=st({international:c,country:r,defaultCountry:a,withCountryCallingCode:p}),m=f.useRef(),b=function(d,C,v){console.error("[react-phone-number-input] Expected phone number ".concat(d," to correspond to country ").concat(C," but ").concat(v?"in reality it corresponds to country "+v:"it doesn't",".")),m.current=!0},g=function(d){return e&&u.validateE164Number(e),lt(e,r,a,s,y,i,function(){d&&d.onCountryMismatch&&d.onCountryMismatch();for(var C=arguments.length,v=new Array(C),O=0;O<C;O++)v[O]=arguments[O];b.apply(n,v)})},w=f.useState(r),I=T(w,2),F=I[0],B=I[1],H=f.useState(a),E=T(H,2),z=E[0],G=E[1],J=f.useState(g()),_=T(J,2),K=_[0],h=_[1],Q=f.useState(e),L=T(Q,2),A=L[0],N=L[1],X=f.useState(),x=T(X,2);x[0];var $=x[1],D=f.useCallback(function(){return $({})},[$]);function V(l){if(l){s==="NATIONAL_PART_OF_INTERNATIONAL"&&(l="+".concat(u.getCountryCallingCode$1(r,i)).concat(l));var d=new u.AsYouType(r||a,i);return d.input(l),d.getNumberValue()}}f.useEffect(function(){e!==A&&(N(e),h(g()))},[e]),f.useEffect(function(){if(r!==F){B(r);var l,d=g({onCountryMismatch:function(){l=!0}});h(d),l&&N(V(d))}},[r]),f.useEffect(function(){a!==z&&(G(a),h(g()))},[a]),f.useEffect(function(){A!==e&&o(A)},[A]);var Z=f.useCallback(function(l){var d;if(r)if(s==="INTERNATIONAL"){var C=u.getInternationalPhoneNumberPrefix(r,i);if(l.indexOf(C)!==0){if(l&&l[0]!=="+")l=C+l;else if(!m.current)return h(C),N(void 0),D()}}else l&&l[0]==="+"&&(l=l.slice(1));else a||l&&l[0]!=="+"&&(l="+"+l);l&&(d=V(l)),h(l),N(d)},[r,s,a,i,h,N,D,m]);return{phoneDigits:K,setPhoneDigits:Z,inputFormat:s}}function lt(t,n,e,o,r,a,c){if(n&&o==="INTERNATIONAL"){var p=u.getInternationalPhoneNumberPrefix(n,a);return t?(t.indexOf(p)!==0&&c(t,n),t):p}if(!t)return"";if(!n&&!e)return t;var y=new u.AsYouType(void 0,a);y.input(t);var i=y.getNumber();if(i)if(n)switch(i.country&&i.country!==n?c(t,n,i.country):i.countryCallingCode!==u.getCountryCallingCode$1(n,a)&&c(t,n),o){case"NATIONAL":return u.parseDigits(i.formatNational());case"NATIONAL_PART_OF_INTERNATIONAL":return u.parseDigits(u.removePrefixFromFormattedPhoneNumber(i.formatInternational(),u.getInternationalPhoneNumberPrefix(n,a)));case"INTERNATIONAL":throw new Error('`inputFormat: "INTERNATIONAL"` case should\'ve already been handled earlier in the code');case"INTERNATIONAL_OR_NATIONAL":throw new Error('`inputFormat: "INTERNATIONAL_OR_NATIONAL"` is not possible when `country` is fixed');default:throw new Error("Unknown `inputFormat`: ".concat(o))}else return i.countryCallingCode&&i.countryCallingCode===u.getCountryCallingCode$1(e,a)&&r?u.parseDigits(i.formatNational()):t;else return""}function st(t){var n=t.international,e=t.country,o=t.defaultCountry,r=t.withCountryCallingCode;return e?n?r?"INTERNATIONAL":"NATIONAL_PART_OF_INTERNATIONAL":"NATIONAL":o?"INTERNATIONAL_OR_NATIONAL":"INTERNATIONAL"}var ct=["Component","country","defaultCountry","useNationalFormatForDefaultCountryValue","value","onChange","metadata","international","withCountryCallingCode"];function j(){return j=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},j.apply(this,arguments)}function ft(t,n){if(t==null)return{};var e=pt(t,n),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)o=a[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function pt(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,a;for(a=0;a<o.length;a++)r=o[a],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function P(t,n){var e=t.Component,o=t.country,r=t.defaultCountry,a=t.useNationalFormatForDefaultCountryValue,c=a===void 0?!0:a,p=t.value,y=t.onChange,i=t.metadata,s=t.international,m=t.withCountryCallingCode,b=ft(t,ct),g=it({value:p,onChange:y,country:o,defaultCountry:r,international:s,withCountryCallingCode:m,useNationalFormatForDefaultCountryValue:c,metadata:i}),w=g.phoneDigits,I=g.setPhoneDigits,F=g.inputFormat;return f.createElement(e,j({},b,{ref:n,metadata:i,inputFormat:F,international:s,withCountryCallingCode:m,country:o||r,value:w,onChange:I}))}P=f.forwardRef(P);P.propTypes={value:u.PropTypes.string,onChange:u.PropTypes.func.isRequired,country:u.PropTypes.string,defaultCountry:u.PropTypes.string,international:u.PropTypes.bool,withCountryCallingCode:u.PropTypes.bool,Component:u.PropTypes.elementType.isRequired,useNationalFormatForDefaultCountryValue:u.PropTypes.bool,metadata:u.metadata};var yt=["type","autoComplete","smartCaret","metadata"];function S(){return S=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},S.apply(this,arguments)}function dt(t,n){if(t==null)return{};var e=Ct(t,n),o,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r<a.length;r++)o=a[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function Ct(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,a;for(a=0;a<o.length;a++)r=o[a],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function k(t){function n(e,o){var r=e.type,a=r===void 0?"tel":r,c=e.autoComplete,p=c===void 0?"tel":c,y=e.smartCaret,i=y===void 0?!0:y,s=e.metadata,m=s===void 0?t:s,b=dt(e,yt);return f.createElement(P,S({},b,{type:a,autoComplete:p,metadata:m,ref:o,Component:i?u.InputSmart:u.InputBasic}))}return n=f.forwardRef(n),n.propTypes={type:u.PropTypes.string,autoComplete:u.PropTypes.string,smartCaret:u.PropTypes.bool,metadata:u.PropTypes.object},n}k();function Y(t,n){var e=Array.prototype.slice.call(n);return e.push(u.metadata$1),t.apply(this,e)}k(u.metadata$1);function W(){return Y(u.getCountryCallingCode$1,arguments)}function mt(){return Y(u.isSupportedCountry$1,arguments)}const U=f.forwardRef(({placeholder:t="000 - 000 - 000",disabled:n,...e},o)=>{const{activeCountry:r,isDisabled:a,value:c,onValueChange:p}=nt.usePhoneNumberContext(),y=i=>{if(!i)return"";let s="";return r&&mt(r)&&(s=W(r)),i.replace(`+${s}`,"")};return R.jsxs(tt.InputRoot,{"data-slot":"phone-number-digit-field",className:" has-disabled:opacity-50",children:[R.jsxs("p",{className:q.cn("body-extrasmall-book"),children:["(+",W(r||"US"),")"]}),R.jsx(et.InputField,{...e,disabled:n||a,placeholder:t,value:y(c),onChange:i=>{const s=q.getPhoneNumberDigitMetadataValueObject({value:i.target.value,activeCountry:r});p&&(i.target.value=s.digit,p(s))},ref:o})]})});U.displayName="PhoneNumberDigitField";exports.PhoneNumberDigitField=U;
@@ -24,22 +24,22 @@ function vt(t, n) {
24
24
  }
25
25
  function B(t, n) {
26
26
  (n == null || n > t.length) && (n = t.length);
27
- for (var e = 0, r = new Array(n); e < n; e++) r[e] = t[e];
28
- return r;
27
+ for (var e = 0, a = new Array(n); e < n; e++) a[e] = t[e];
28
+ return a;
29
29
  }
30
30
  function At(t, n) {
31
31
  var e = t == null ? null : typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
32
32
  if (e != null) {
33
- var r, a, o, l, f = [], s = !0, i = !1;
33
+ var a, r, o, s, f = [], c = !0, i = !1;
34
34
  try {
35
- if (o = (e = e.call(t)).next, n !== 0) for (; !(s = (r = o.call(e)).done) && (f.push(r.value), f.length !== n); s = !0) ;
36
- } catch (y) {
37
- i = !0, a = y;
35
+ if (o = (e = e.call(t)).next, n !== 0) for (; !(c = (a = o.call(e)).done) && (f.push(a.value), f.length !== n); c = !0) ;
36
+ } catch (l) {
37
+ i = !0, r = l;
38
38
  } finally {
39
39
  try {
40
- if (!s && e.return != null && (l = e.return(), Object(l) !== l)) return;
40
+ if (!c && e.return != null && (s = e.return(), Object(s) !== s)) return;
41
41
  } finally {
42
- if (i) throw a;
42
+ if (i) throw r;
43
43
  }
44
44
  }
45
45
  return f;
@@ -49,56 +49,56 @@ function Ot(t) {
49
49
  if (Array.isArray(t)) return t;
50
50
  }
51
51
  function It(t) {
52
- var n = this, e = t.value, r = t.onChange, a = t.country, o = t.defaultCountry, l = t.international, f = t.withCountryCallingCode, s = t.useNationalFormatForDefaultCountryValue, i = t.metadata;
53
- typeof f == "boolean" && !(a && l) && console.error("[react-phone-number-input] `withCountryCallingCode` property can only be used together with `country` and `international` properties"), a && o && console.error("[react-phone-number-input] When `country` property is passed, `defaultCountry` property has no effect and therefore shouldn't be passed"), typeof l == "boolean" && !a && console.error("[react-phone-number-input] `international` property can only be used together with `country` property");
54
- var y = Pt({
55
- international: l,
56
- country: a,
52
+ var n = this, e = t.value, a = t.onChange, r = t.country, o = t.defaultCountry, s = t.international, f = t.withCountryCallingCode, c = t.useNationalFormatForDefaultCountryValue, i = t.metadata;
53
+ typeof f == "boolean" && !(r && s) && console.error("[react-phone-number-input] `withCountryCallingCode` property can only be used together with `country` and `international` properties"), r && o && console.error("[react-phone-number-input] When `country` property is passed, `defaultCountry` property has no effect and therefore shouldn't be passed"), typeof s == "boolean" && !r && console.error("[react-phone-number-input] `international` property can only be used together with `country` property");
54
+ var l = Pt({
55
+ international: s,
56
+ country: r,
57
57
  defaultCountry: o,
58
58
  withCountryCallingCode: f
59
- }), m = ut(), h = function(c, d, b) {
60
- console.error("[react-phone-number-input] Expected phone number ".concat(c, " to correspond to country ").concat(d, " but ").concat(b ? "in reality it corresponds to country " + b : "it doesn't", ".")), m.current = !0;
61
- }, C = function(c) {
62
- return e && ct(e), Tt(e, a, o, y, s, i, function() {
63
- c && c.onCountryMismatch && c.onCountryMismatch();
59
+ }), m = ut(), h = function(y, d, b) {
60
+ console.error("[react-phone-number-input] Expected phone number ".concat(y, " to correspond to country ").concat(d, " but ").concat(b ? "in reality it corresponds to country " + b : "it doesn't", ".")), m.current = !0;
61
+ }, C = function(y) {
62
+ return e && ct(e), Tt(e, r, o, l, c, i, function() {
63
+ y && y.onCountryMismatch && y.onCountryMismatch();
64
64
  for (var d = arguments.length, b = new Array(d), T = 0; T < d; T++)
65
65
  b[T] = arguments[T];
66
66
  h.apply(n, b);
67
67
  });
68
- }, j = v(a), O = A(j, 2), E = O[0], Q = O[1], X = v(o), $ = A(X, 2), Z = $[0], tt = $[1], et = v(C()), V = A(et, 2), nt = V[0], g = V[1], rt = v(e), D = A(rt, 2), I = D[0], N = D[1], at = v(), M = A(at, 2);
68
+ }, j = v(r), O = A(j, 2), E = O[0], Q = O[1], X = v(o), $ = A(X, 2), Z = $[0], tt = $[1], et = v(C()), V = A(et, 2), nt = V[0], g = V[1], rt = v(e), D = A(rt, 2), I = D[0], N = D[1], at = v(), M = A(at, 2);
69
69
  M[0];
70
70
  var W = M[1], k = q(function() {
71
71
  return W({});
72
72
  }, [W]);
73
73
  function U(u) {
74
74
  if (u) {
75
- y === "NATIONAL_PART_OF_INTERNATIONAL" && (u = "+".concat(F(a, i)).concat(u));
76
- var c = new z(a || o, i);
77
- return c.input(u), c.getNumberValue();
75
+ l === "NATIONAL_PART_OF_INTERNATIONAL" && (u = "+".concat(F(r, i)).concat(u));
76
+ var y = new z(r || o, i);
77
+ return y.input(u), y.getNumberValue();
78
78
  }
79
79
  }
80
80
  P(function() {
81
81
  e !== I && (N(e), g(C()));
82
82
  }, [e]), P(function() {
83
- if (a !== E) {
84
- Q(a);
85
- var u, c = C({
83
+ if (r !== E) {
84
+ Q(r);
85
+ var u, y = C({
86
86
  onCountryMismatch: function() {
87
87
  u = !0;
88
88
  }
89
89
  });
90
- g(c), u && N(U(c));
90
+ g(y), u && N(U(y));
91
91
  }
92
- }, [a]), P(function() {
92
+ }, [r]), P(function() {
93
93
  o !== Z && (tt(o), g(C()));
94
94
  }, [o]), P(function() {
95
- I !== e && r(I);
95
+ I !== e && a(I);
96
96
  }, [I]);
97
97
  var ot = q(function(u) {
98
- var c;
99
- if (a)
100
- if (y === "INTERNATIONAL") {
101
- var d = S(a, i);
98
+ var y;
99
+ if (r)
100
+ if (l === "INTERNATIONAL") {
101
+ var d = S(r, i);
102
102
  if (u.indexOf(d) !== 0) {
103
103
  if (u && u[0] !== "+")
104
104
  u = d + u;
@@ -107,29 +107,29 @@ function It(t) {
107
107
  } else
108
108
  u && u[0] === "+" && (u = u.slice(1));
109
109
  else o || u && u[0] !== "+" && (u = "+" + u);
110
- u && (c = U(u)), g(u), N(c);
111
- }, [a, y, o, i, g, N, k, m]);
110
+ u && (y = U(u)), g(u), N(y);
111
+ }, [r, l, o, i, g, N, k, m]);
112
112
  return {
113
113
  phoneDigits: nt,
114
114
  setPhoneDigits: ot,
115
- inputFormat: y
115
+ inputFormat: l
116
116
  };
117
117
  }
118
- function Tt(t, n, e, r, a, o, l) {
119
- if (n && r === "INTERNATIONAL") {
118
+ function Tt(t, n, e, a, r, o, s) {
119
+ if (n && a === "INTERNATIONAL") {
120
120
  var f = S(n, o);
121
- return t ? (t.indexOf(f) !== 0 && l(t, n), t) : f;
121
+ return t ? (t.indexOf(f) !== 0 && s(t, n), t) : f;
122
122
  }
123
123
  if (!t)
124
124
  return "";
125
125
  if (!n && !e)
126
126
  return t;
127
- var s = new z(void 0, o);
128
- s.input(t);
129
- var i = s.getNumber();
127
+ var c = new z(void 0, o);
128
+ c.input(t);
129
+ var i = c.getNumber();
130
130
  if (i)
131
131
  if (n)
132
- switch (i.country && i.country !== n ? l(t, n, i.country) : i.countryCallingCode !== F(n, o) && l(t, n), r) {
132
+ switch (i.country && i.country !== n ? s(t, n, i.country) : i.countryCallingCode !== F(n, o) && s(t, n), a) {
133
133
  case "NATIONAL":
134
134
  return L(i.formatNational());
135
135
  case "NATIONAL_PART_OF_INTERNATIONAL":
@@ -139,63 +139,63 @@ function Tt(t, n, e, r, a, o, l) {
139
139
  case "INTERNATIONAL_OR_NATIONAL":
140
140
  throw new Error('`inputFormat: "INTERNATIONAL_OR_NATIONAL"` is not possible when `country` is fixed');
141
141
  default:
142
- throw new Error("Unknown `inputFormat`: ".concat(r));
142
+ throw new Error("Unknown `inputFormat`: ".concat(a));
143
143
  }
144
144
  else
145
- return i.countryCallingCode && i.countryCallingCode === F(e, o) && a ? L(i.formatNational()) : t;
145
+ return i.countryCallingCode && i.countryCallingCode === F(e, o) && r ? L(i.formatNational()) : t;
146
146
  else
147
147
  return "";
148
148
  }
149
149
  function Pt(t) {
150
- var n = t.international, e = t.country, r = t.defaultCountry, a = t.withCountryCallingCode;
151
- return e ? n ? a ? "INTERNATIONAL" : "NATIONAL_PART_OF_INTERNATIONAL" : "NATIONAL" : r ? "INTERNATIONAL_OR_NATIONAL" : "INTERNATIONAL";
150
+ var n = t.international, e = t.country, a = t.defaultCountry, r = t.withCountryCallingCode;
151
+ return e ? n ? r ? "INTERNATIONAL" : "NATIONAL_PART_OF_INTERNATIONAL" : "NATIONAL" : a ? "INTERNATIONAL_OR_NATIONAL" : "INTERNATIONAL";
152
152
  }
153
153
  var wt = ["Component", "country", "defaultCountry", "useNationalFormatForDefaultCountryValue", "value", "onChange", "metadata", "international", "withCountryCallingCode"];
154
154
  function _() {
155
155
  return _ = Object.assign ? Object.assign.bind() : function(t) {
156
156
  for (var n = 1; n < arguments.length; n++) {
157
157
  var e = arguments[n];
158
- for (var r in e)
159
- Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
158
+ for (var a in e)
159
+ Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
160
160
  }
161
161
  return t;
162
162
  }, _.apply(this, arguments);
163
163
  }
164
164
  function Ft(t, n) {
165
165
  if (t == null) return {};
166
- var e = Rt(t, n), r, a;
166
+ var e = Rt(t, n), a, r;
167
167
  if (Object.getOwnPropertySymbols) {
168
168
  var o = Object.getOwnPropertySymbols(t);
169
- for (a = 0; a < o.length; a++)
170
- r = o[a], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (e[r] = t[r]);
169
+ for (r = 0; r < o.length; r++)
170
+ a = o[r], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (e[a] = t[a]);
171
171
  }
172
172
  return e;
173
173
  }
174
174
  function Rt(t, n) {
175
175
  if (t == null) return {};
176
- var e = {}, r = Object.keys(t), a, o;
177
- for (o = 0; o < r.length; o++)
178
- a = r[o], !(n.indexOf(a) >= 0) && (e[a] = t[a]);
176
+ var e = {}, a = Object.keys(t), r, o;
177
+ for (o = 0; o < a.length; o++)
178
+ r = a[o], !(n.indexOf(r) >= 0) && (e[r] = t[r]);
179
179
  return e;
180
180
  }
181
181
  function R(t, n) {
182
- var e = t.Component, r = t.country, a = t.defaultCountry, o = t.useNationalFormatForDefaultCountryValue, l = o === void 0 ? !0 : o, f = t.value, s = t.onChange, i = t.metadata, y = t.international, m = t.withCountryCallingCode, h = Ft(t, wt), C = It({
182
+ var e = t.Component, a = t.country, r = t.defaultCountry, o = t.useNationalFormatForDefaultCountryValue, s = o === void 0 ? !0 : o, f = t.value, c = t.onChange, i = t.metadata, l = t.international, m = t.withCountryCallingCode, h = Ft(t, wt), C = It({
183
183
  value: f,
184
- onChange: s,
185
- country: r,
186
- defaultCountry: a,
187
- international: y,
184
+ onChange: c,
185
+ country: a,
186
+ defaultCountry: r,
187
+ international: l,
188
188
  withCountryCallingCode: m,
189
- useNationalFormatForDefaultCountryValue: l,
189
+ useNationalFormatForDefaultCountryValue: s,
190
190
  metadata: i
191
191
  }), j = C.phoneDigits, O = C.setPhoneDigits, E = C.inputFormat;
192
192
  return /* @__PURE__ */ w.createElement(e, _({}, h, {
193
193
  ref: n,
194
194
  metadata: i,
195
195
  inputFormat: E,
196
- international: y,
196
+ international: l,
197
197
  withCountryCallingCode: m,
198
- country: r || a,
198
+ country: a || r,
199
199
  value: j,
200
200
  onChange: O
201
201
  }));
@@ -273,37 +273,37 @@ function x() {
273
273
  return x = Object.assign ? Object.assign.bind() : function(t) {
274
274
  for (var n = 1; n < arguments.length; n++) {
275
275
  var e = arguments[n];
276
- for (var r in e)
277
- Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
276
+ for (var a in e)
277
+ Object.prototype.hasOwnProperty.call(e, a) && (t[a] = e[a]);
278
278
  }
279
279
  return t;
280
280
  }, x.apply(this, arguments);
281
281
  }
282
282
  function Et(t, n) {
283
283
  if (t == null) return {};
284
- var e = Lt(t, n), r, a;
284
+ var e = Lt(t, n), a, r;
285
285
  if (Object.getOwnPropertySymbols) {
286
286
  var o = Object.getOwnPropertySymbols(t);
287
- for (a = 0; a < o.length; a++)
288
- r = o[a], !(n.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(t, r) && (e[r] = t[r]);
287
+ for (r = 0; r < o.length; r++)
288
+ a = o[r], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(t, a) && (e[a] = t[a]);
289
289
  }
290
290
  return e;
291
291
  }
292
292
  function Lt(t, n) {
293
293
  if (t == null) return {};
294
- var e = {}, r = Object.keys(t), a, o;
295
- for (o = 0; o < r.length; o++)
296
- a = r[o], !(n.indexOf(a) >= 0) && (e[a] = t[a]);
294
+ var e = {}, a = Object.keys(t), r, o;
295
+ for (o = 0; o < a.length; o++)
296
+ r = a[o], !(n.indexOf(r) >= 0) && (e[r] = t[r]);
297
297
  return e;
298
298
  }
299
299
  function J(t) {
300
- function n(e, r) {
301
- var a = e.type, o = a === void 0 ? "tel" : a, l = e.autoComplete, f = l === void 0 ? "tel" : l, s = e.smartCaret, i = s === void 0 ? !0 : s, y = e.metadata, m = y === void 0 ? t : y, h = Et(e, jt);
300
+ function n(e, a) {
301
+ var r = e.type, o = r === void 0 ? "tel" : r, s = e.autoComplete, f = s === void 0 ? "tel" : s, c = e.smartCaret, i = c === void 0 ? !0 : c, l = e.metadata, m = l === void 0 ? t : l, h = Et(e, jt);
302
302
  return /* @__PURE__ */ w.createElement(R, x({}, h, {
303
303
  type: o,
304
304
  autoComplete: f,
305
305
  metadata: m,
306
- ref: r,
306
+ ref: a,
307
307
  Component: i ? dt : mt
308
308
  }));
309
309
  }
@@ -344,11 +344,15 @@ function St() {
344
344
  return K(Ct, arguments);
345
345
  }
346
346
  const _t = lt(
347
- ({ placeholder: t = "000 - 000 - 000", ...n }, e) => {
348
- const { activeCountry: r, isDisabled: a, value: o, onValueChange: l } = Nt(), f = (s) => {
349
- if (!s) return "";
350
- let i = "";
351
- return r && St(r) && (i = H(r)), s.replace(`+${i}`, "");
347
+ ({
348
+ placeholder: t = "000 - 000 - 000",
349
+ disabled: n,
350
+ ...e
351
+ }, a) => {
352
+ const { activeCountry: r, isDisabled: o, value: s, onValueChange: f } = Nt(), c = (i) => {
353
+ if (!i) return "";
354
+ let l = "";
355
+ return r && St(r) && (l = H(r)), i.replace(`+${l}`, "");
352
356
  };
353
357
  return /* @__PURE__ */ Y(
354
358
  st,
@@ -364,18 +368,18 @@ const _t = lt(
364
368
  /* @__PURE__ */ it(
365
369
  ft,
366
370
  {
367
- ...n,
368
- disabled: a,
371
+ ...e,
372
+ disabled: n || o,
369
373
  placeholder: t,
370
- value: f(o),
371
- onChange: (s) => {
372
- const i = ht({
373
- value: s.target.value,
374
+ value: c(s),
375
+ onChange: (i) => {
376
+ const l = ht({
377
+ value: i.target.value,
374
378
  activeCountry: r
375
379
  });
376
- l && (s.target.value = i.digit, l(i));
380
+ f && (i.target.value = l.digit, f(l));
377
381
  },
378
- ref: e
382
+ ref: a
379
383
  }
380
384
  )
381
385
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mainstack-design-system",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "type": "module",
5
5
  "main": "./dist/mainstack-design-system.cjs",
6
6
  "module": "./dist/mainstack-design-system.js",