react-artasys-ui 0.1.27 → 0.1.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +6 -0
  2. package/dist/index.js +3 -0
  3. package/dist/index.js.LICENSE.txt +9 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/styles.css +80 -0
  6. package/dist/styles.css.map +1 -0
  7. package/lib/src/Button/Button.d.ts +12 -0
  8. package/lib/src/Button/index.d.ts +3 -0
  9. package/lib/src/Checkbox/Checkbox.d.ts +7 -0
  10. package/lib/src/Checkbox/index.d.ts +2 -0
  11. package/lib/src/Components/Arrow/Arrow.d.ts +6 -0
  12. package/lib/src/Components/Arrow/index.d.ts +2 -0
  13. package/lib/src/Dropdown/Dropdown.d.ts +18 -0
  14. package/lib/src/Dropdown/Item.d.ts +11 -0
  15. package/lib/src/Dropdown/Items.d.ts +6 -0
  16. package/lib/src/Dropdown/index.d.ts +9 -0
  17. package/lib/src/File/File.d.ts +18 -0
  18. package/lib/src/File/index.d.ts +3 -0
  19. package/lib/src/FileInput/FileInput.d.ts +14 -0
  20. package/lib/src/FileInput/index.d.ts +3 -0
  21. package/lib/src/Form/Element/Element.d.ts +16 -0
  22. package/lib/src/Form/Element/index.d.ts +3 -0
  23. package/lib/src/Form/Form.d.ts +10 -0
  24. package/lib/src/Form/index.d.ts +5 -0
  25. package/lib/src/Form/types.d.ts +11 -0
  26. package/lib/src/Form/useForm.d.ts +17 -0
  27. package/lib/src/Input/Input.d.ts +12 -0
  28. package/lib/src/Input/index.d.ts +2 -0
  29. package/lib/src/Loading/Loading.d.ts +6 -0
  30. package/lib/src/Loading/index.d.ts +3 -0
  31. package/lib/src/Progress/Progress.d.ts +7 -0
  32. package/lib/src/Progress/index.d.ts +2 -0
  33. package/lib/src/Provider/Provider.d.ts +7 -0
  34. package/lib/src/Provider/ProviderContext.d.ts +1 -0
  35. package/lib/src/Provider/index.d.ts +2 -0
  36. package/lib/src/Select/Optgroup.d.ts +7 -0
  37. package/lib/src/Select/Option.d.ts +8 -0
  38. package/lib/src/Select/Select.d.ts +18 -0
  39. package/lib/src/Select/index.d.ts +11 -0
  40. package/lib/src/Spinner/Spinner.d.ts +8 -0
  41. package/lib/src/Spinner/index.d.ts +3 -0
  42. package/lib/src/TextArea/TextArea.d.ts +9 -0
  43. package/lib/src/TextArea/index.d.ts +2 -0
  44. package/lib/src/UploadImages/Image.d.ts +16 -0
  45. package/lib/src/UploadImages/UploadImages.d.ts +9 -0
  46. package/lib/src/UploadImages/index.d.ts +5 -0
  47. package/lib/src/index.d.ts +20 -0
  48. package/lib/src/ui-types.d.ts +3 -0
  49. package/lib/stories/Button.stories.d.ts +6 -0
  50. package/lib/stories/Checkbox.stories.d.ts +6 -0
  51. package/lib/stories/Dropdown/Dropdown.stories.d.ts +6 -0
  52. package/lib/stories/Dropdown/Item.stories.d.ts +6 -0
  53. package/lib/stories/Dropdown/Items.stories.d.ts +6 -0
  54. package/lib/stories/File.stories.d.ts +6 -0
  55. package/lib/stories/FileInput.stories.d.ts +9 -0
  56. package/lib/stories/Form/Element/Element.stories.d.ts +6 -0
  57. package/lib/stories/Form/Form.stories.d.ts +6 -0
  58. package/lib/stories/Input.stories.d.ts +6 -0
  59. package/lib/stories/Loading.stories.d.ts +6 -0
  60. package/lib/stories/Progress.stories.d.ts +6 -0
  61. package/lib/stories/Select/Select.stories.d.ts +6 -0
  62. package/lib/stories/Spinner.stories.d.ts +6 -0
  63. package/lib/stories/TextArea.stories.d.ts +6 -0
  64. package/package.json +7 -2
package/README.md CHANGED
@@ -1 +1,7 @@
1
1
  ## React Arta System UI
2
+
3
+ ### To use it, import global styles in App.tsx
4
+
5
+ ```
6
+ import 'react-artasys-ui/dist/styles.css';
7
+ ```
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ /*! For license information please see index.js.LICENSE.txt */
2
+ import*as e from"react";var t={20:(e,t,r)=>{var s=r(649),n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,l=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var s,a={},u=null,d=null;for(s in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(d=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(a[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps)void 0===a[s]&&(a[s]=t[s]);return{$$typeof:n,type:e,key:u,ref:d,props:a,_owner:l.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},848:(e,t,r)=>{e.exports=r(20)},649:t=>{t.exports=e}},r={};function s(e){var n=r[e];if(void 0!==n)return n.exports;var a=r[e]={exports:{}};return t[e](a,a.exports,s),a.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n={};s.d(n,{$n:()=>ke,Sc:()=>Ce,ms:()=>qe,tJ:()=>ze,Hg:()=>be,ZH:()=>Ae,zp:()=>Se,lV:()=>xe,ZS:()=>be,pd:()=>we,Rh:()=>ge,ke:()=>d,Kq:()=>Xe,l6:()=>Ue,rf:()=>Me,OQ:()=>Te,y$:()=>o,fs:()=>je,qx:()=>Ne,Ay:()=>Ze,mN:()=>pe});var a=s(848);const i={container:"style-module__container___xfbzH","wait-indicator":"style-module__wait-indicator___G02CN",wait:"style-module__wait___W2hPp"},l={spinner:"style-module__spinner___rCh2u","button-spinner-border":"style-module__button-spinner-border___PgVuB","ui-spinner-contrast":"style-module__ui-spinner-contrast___DmoHd",small:"style-module__small___NzDCq",middle:"style-module__middle___irbH9",large:"style-module__large___g2a7L"},o=({size:e,contrast:t,...r})=>{const s=["ui-spinner"];return s.push(l.spinner),e&&s.push(l[e],"ui-spinner-"+e),t&&s.push(l["ui-spinner-contrast"]),r.className&&s.push(r.className),(0,a.jsx)("div",{...r,className:s.join(" ")})},u={container:"style-module__container___Rcvsm",radius:"style-module__radius___BGUfK",small:"style-module__small___aw7mI",middle:"style-module__middle___kHjkw",large:"style-module__large___oS6zL"},d=({value:e=0,size:t,radius:r=!1})=>{(e=Math.ceil(10*Number(e))/10)>100&&(e=100),e<0&&(e=0);const s=r?3.6*e+"deg":e+"%",n=["ui-progress"];return n.push(u.container),t&&n.push(u[t]),r&&n.push(u.radius),(0,a.jsx)("div",{className:n.join(" "),"data-progress":e,style:{"--progress":s}})};var c=s(649),f=e=>"checkbox"===e.type,_=e=>e instanceof Date,m=e=>null==e;const y=e=>"object"==typeof e;var p=e=>!m(e)&&!Array.isArray(e)&&y(e)&&!_(e),h="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function v(e){let t;const r=Array.isArray(e),s="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(h&&(e instanceof Blob||s)||!r&&!p(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return p(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=v(e[r]));else t=e}return t}var g=e=>Array.isArray(e)?e.filter(Boolean):[],b=e=>void 0===e,x=(e,t,r)=>{if(!t||!p(e))return r;const s=g(t.split(/[,[\].]+?/)).reduce(((e,t)=>m(e)?e:e[t]),e);return b(s)||s===e?b(e[t])?r:e[t]:s},w=e=>"boolean"==typeof e,j=e=>/^\w*$/.test(e),S=e=>g(e.replace(/["|']|\]/g,"").split(/\.|\[/)),A=(e,t,r)=>{let s=-1;const n=j(t)?[t]:S(t),a=n.length,i=a-1;for(;++s<a;){const t=n[s];let a=r;if(s!==i){const r=e[t];a=p(r)||Array.isArray(r)?r:isNaN(+n[s+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}return e};const V="onChange",k="onSubmit",F="all",N="pattern",C="required";c.default.createContext(null);var D=e=>p(e)&&!Object.keys(e).length,E=e=>Array.isArray(e)?e:[e];var O=e=>"string"==typeof e,I=(e,t,r,s,n)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[s]:n||!0}}:{},R=e=>({isOnSubmit:!e||e===k,isOnBlur:"onBlur"===e,isOnChange:e===V,isOnAll:e===F,isOnTouch:"onTouched"===e}),L=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const T=(e,t,r,s)=>{for(const n of r||Object.keys(e)){const r=x(e,n);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],n)&&!s)return!0;if(e.ref&&t(e.ref,e.name)&&!s)return!0;if(T(a,t))break}else if(p(a)&&T(a,t))break}}};var M=(e,t,r)=>{const s=E(x(e,r));return A(s,"root",t[r]),A(e,r,s),e},U=e=>"file"===e.type,B=e=>"function"==typeof e,P=e=>{if(!h)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},$=e=>O(e),H=e=>"radio"===e.type,z=e=>e instanceof RegExp;const q={value:!1,isValid:!1},W={value:!0,isValid:!0};var X=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!b(e[0].attributes.value)?b(e[0].value)||""===e[0].value?W:{value:e[0].value,isValid:!0}:W:q}return q};const Z={isValid:!1,value:null};var G=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Z):Z;function K(e,t,r="validate"){if($(e)||Array.isArray(e)&&e.every($)||w(e)&&!e)return{type:r,message:$(e)?e:"",ref:t}}var Q=e=>p(e)&&!z(e)?e:{value:e,message:""},J=async(e,t,r,s,n,a)=>{const{ref:i,refs:l,required:o,maxLength:u,minLength:d,min:c,max:_,pattern:y,validate:h,name:v,valueAsNumber:g,mount:j}=e._f,S=x(r,v);if(!j||t.has(v))return{};const A=l?l[0]:i,V=e=>{n&&A.reportValidity&&(A.setCustomValidity(w(e)?"":e||""),A.reportValidity())},k={},F=H(i),E=f(i),R=F||E,L=(g||U(i))&&b(i.value)&&b(S)||P(i)&&""===i.value||""===S||Array.isArray(S)&&!S.length,T=I.bind(null,v,s,k),M=(e,t,r,s="maxLength",n="minLength")=>{const a=e?t:r;k[v]={type:e?s:n,message:a,ref:i,...T(e?s:n,a)}};if(a?!Array.isArray(S)||!S.length:o&&(!R&&(L||m(S))||w(S)&&!S||E&&!X(l).isValid||F&&!G(l).isValid)){const{value:e,message:t}=$(o)?{value:!!o,message:o}:Q(o);if(e&&(k[v]={type:C,message:t,ref:A,...T(C,t)},!s))return V(t),k}if(!(L||m(c)&&m(_))){let e,t;const r=Q(_),n=Q(c);if(m(S)||isNaN(S)){const s=i.valueAsDate||new Date(S),a=e=>new Date((new Date).toDateString()+" "+e),l="time"==i.type,o="week"==i.type;O(r.value)&&S&&(e=l?a(S)>a(r.value):o?S>r.value:s>new Date(r.value)),O(n.value)&&S&&(t=l?a(S)<a(n.value):o?S<n.value:s<new Date(n.value))}else{const s=i.valueAsNumber||(S?+S:S);m(r.value)||(e=s>r.value),m(n.value)||(t=s<n.value)}if((e||t)&&(M(!!e,r.message,n.message,"max","min"),!s))return V(k[v].message),k}if((u||d)&&!L&&(O(S)||a&&Array.isArray(S))){const e=Q(u),t=Q(d),r=!m(e.value)&&S.length>+e.value,n=!m(t.value)&&S.length<+t.value;if((r||n)&&(M(r,e.message,t.message),!s))return V(k[v].message),k}if(y&&!L&&O(S)){const{value:e,message:t}=Q(y);if(z(e)&&!S.match(e)&&(k[v]={type:N,message:t,ref:i,...T(N,t)},!s))return V(t),k}if(h)if(B(h)){const e=K(await h(S,r),A);if(e&&(k[v]={...e,...T("validate",e.message)},!s))return V(e.message),k}else if(p(h)){let e={};for(const t in h){if(!D(e)&&!s)break;const n=K(await h[t](S,r),A,t);n&&(e={...n,...T(t,n.message)},V(n.message),s&&(k[v]=e))}if(!D(e)&&(k[v]={ref:A,...e},!s))return k}return V(!0),k};function Y(e,t){const r=Array.isArray(t)?t:j(t)?[t]:S(t),s=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let s=0;for(;s<r;)e=b(e)?s++:e[t[s++]];return e}(e,r),n=r.length-1,a=r[n];return s&&delete s[a],0!==n&&(p(s)&&D(s)||Array.isArray(s)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!b(e[t]))return!1;return!0}(s))&&Y(e,r.slice(0,-1)),e}var ee=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},te=e=>m(e)||!y(e);function re(e,t){if(te(e)||te(t))return e===t;if(_(e)&&_(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(const n of r){const r=e[n];if(!s.includes(n))return!1;if("ref"!==n){const e=t[n];if(_(r)&&_(e)||p(r)&&p(e)||Array.isArray(r)&&Array.isArray(e)?!re(r,e):r!==e)return!1}}return!0}var se=e=>"select-multiple"===e.type,ne=e=>P(e)&&e.isConnected,ae=e=>{for(const t in e)if(B(e[t]))return!0;return!1};function ie(e,t={}){const r=Array.isArray(e);if(p(e)||r)for(const r in e)Array.isArray(e[r])||p(e[r])&&!ae(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ie(e[r],t[r])):m(e[r])||(t[r]=!0);return t}function le(e,t,r){const s=Array.isArray(e);if(p(e)||s)for(const s in e)Array.isArray(e[s])||p(e[s])&&!ae(e[s])?b(t)||te(r[s])?r[s]=Array.isArray(e[s])?ie(e[s],[]):{...ie(e[s])}:le(e[s],m(t)?{}:t[s],r[s]):r[s]=!re(e[s],t[s]);return r}var oe=(e,t)=>le(e,t,ie(t)),ue=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:s})=>b(e)?e:t?""===e?NaN:e?+e:e:r&&O(e)?new Date(e):s?s(e):e;function de(e){const t=e.ref;return U(t)?t.files:H(t)?G(e.refs).value:se(t)?[...t.selectedOptions].map((({value:e})=>e)):f(t)?X(e.refs).value:ue(b(t.value)?e.ref.value:t.value,e)}var ce=e=>b(e)?e:z(e)?e.source:p(e)?z(e.value)?e.value.source:e.value:e;const fe="AsyncFunction";function _e(e,t,r){const s=x(e,r);if(s||j(r))return{error:s,name:r};const n=r.split(".");for(;n.length;){const s=n.join("."),a=x(t,s),i=x(e,s);if(a&&!Array.isArray(a)&&r!==s)return{name:r};if(i&&i.type)return{name:s,error:i};n.pop()}return{name:r}}const me={mode:k,reValidateMode:V,shouldFocusError:!0};function ye(e={}){let t,r={...me,...e},s={submitCount:0,isDirty:!1,isLoading:B(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},n={},a=(p(r.defaultValues)||p(r.values))&&v(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:v(a),l={action:!1,mount:!1,watch:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},c={values:ee(),array:ee(),state:ee()},y=R(r.mode),j=R(r.reValidateMode),S=r.criteriaMode===F,V=async e=>{if(!r.disabled&&(d.isValid||e)){const e=r.resolver?D((await I()).errors):await $(n,!0);e!==s.isValid&&c.state.next({isValid:e})}},k=(e,t)=>{r.disabled||!d.isValidating&&!d.validatingFields||((e||Array.from(o.mount)).forEach((e=>{e&&(t?A(s.validatingFields,e,t):Y(s.validatingFields,e))})),c.state.next({validatingFields:s.validatingFields,isValidating:!D(s.validatingFields)}))},N=(e,t,r,s)=>{const o=x(n,e);if(o){const n=x(i,e,b(r)?x(a,e):r);b(n)||s&&s.defaultChecked||t?A(i,e,t?n:de(o._f)):W(e,n),l.mount&&V()}},C=(e,t,i,l,o)=>{let u=!1,f=!1;const _={name:e};if(!r.disabled){const r=!!(x(n,e)&&x(n,e)._f&&x(n,e)._f.disabled);if(!i||l){d.isDirty&&(f=s.isDirty,s.isDirty=_.isDirty=z(),u=f!==_.isDirty);const n=r||re(x(a,e),t);f=!(r||!x(s.dirtyFields,e)),n||r?Y(s.dirtyFields,e):A(s.dirtyFields,e,!0),_.dirtyFields=s.dirtyFields,u=u||d.dirtyFields&&f!==!n}if(i){const t=x(s.touchedFields,e);t||(A(s.touchedFields,e,i),_.touchedFields=s.touchedFields,u=u||d.touchedFields&&t!==i)}u&&o&&c.state.next(_)}return u?_:{}},I=async e=>{k(e,!0);const t=await r.resolver(i,r.context,((e,t,r,s)=>{const n={};for(const r of e){const e=x(t,r);e&&A(n,r,e._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:s}})(e||o.mount,n,r.criteriaMode,r.shouldUseNativeValidation));return k(e),t},$=async(e,t,n={valid:!0})=>{for(const l in e){const u=e[l];if(u){const{_f:e,...c}=u;if(e){const c=o.array.has(e.name),f=u._f&&!!(a=u._f)&&!!a.validate&&!!(B(a.validate)&&a.validate.constructor.name===fe||p(a.validate)&&Object.values(a.validate).find((e=>e.constructor.name===fe)));f&&d.validatingFields&&k([l],!0);const _=await J(u,o.disabled,i,S,r.shouldUseNativeValidation&&!t,c);if(f&&d.validatingFields&&k([l]),_[e.name]&&(n.valid=!1,t))break;!t&&(x(_,e.name)?c?M(s.errors,_,e.name):A(s.errors,e.name,_[e.name]):Y(s.errors,e.name))}!D(c)&&await $(c,t,n)}}var a;return n.valid},z=(e,t)=>!r.disabled&&(e&&t&&A(i,e,t),!re(te(),a)),q=(e,t,r)=>((e,t,r,s,n)=>O(e)?(s&&t.watch.add(e),x(r,e,n)):Array.isArray(e)?e.map((e=>(s&&t.watch.add(e),x(r,e)))):(s&&(t.watchAll=!0),r))(e,o,{...l.mount?i:b(t)?a:O(e)?{[e]:t}:t},r,t),W=(e,t,r={})=>{const s=x(n,e);let a=t;if(s){const r=s._f;r&&(!r.disabled&&A(i,e,ue(t,r)),a=P(r.ref)&&m(t)?"":t,se(r.ref)?[...r.ref.options].forEach((e=>e.selected=a.includes(e.value))):r.refs?f(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(a)?!!a.find((t=>t===e.value)):a===e.value))):r.refs[0]&&(r.refs[0].checked=!!a):r.refs.forEach((e=>e.checked=e.value===a)):U(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||c.values.next({name:e,values:{...i}})))}(r.shouldDirty||r.shouldTouch)&&C(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&Q(e)},X=(e,t,r)=>{for(const s in t){const a=t[s],i=`${e}.${s}`,l=x(n,i);(o.array.has(e)||p(a)||l&&!l._f)&&!_(a)?X(i,a,r):W(i,a,r)}},Z=(e,t,r={})=>{const u=x(n,e),f=o.array.has(e),_=v(t);A(i,e,_),f?(c.array.next({name:e,values:{...i}}),(d.isDirty||d.dirtyFields)&&r.shouldDirty&&c.state.next({name:e,dirtyFields:oe(a,i),isDirty:z(e,_)})):!u||u._f||m(_)?W(e,_,r):X(e,_,r),L(e,o)&&c.state.next({...s}),c.values.next({name:l.mount?e:void 0,values:{...i}})},G=async e=>{l.mount=!0;const a=e.target;let m=a.name,h=!0;const v=x(n,m),g=e=>{h=Number.isNaN(e)||_(e)&&isNaN(e.getTime())||re(e,x(i,m,e))};if(v){let l,_;const F=a.type?de(v._f):(e=>p(e)&&e.target?f(e.target)?e.target.checked:e.target.value:e)(e),N="blur"===e.type||"focusout"===e.type,E=!((b=v._f).mount&&(b.required||b.min||b.max||b.maxLength||b.minLength||b.pattern||b.validate)||r.resolver||x(s.errors,m)||v._f.deps)||((e,t,r,s,n)=>!n.isOnAll&&(!r&&n.isOnTouch?!(t||e):(r?s.isOnBlur:n.isOnBlur)?!e:!(r?s.isOnChange:n.isOnChange)||e))(N,x(s.touchedFields,m),s.isSubmitted,j,y),O=L(m,o,N);A(i,m,F),N?(v._f.onBlur&&v._f.onBlur(e),t&&t(0)):v._f.onChange&&v._f.onChange(e);const R=C(m,F,N,!1),T=!D(R)||O;if(!N&&c.values.next({name:m,type:e.type,values:{...i}}),E)return d.isValid&&("onBlur"===r.mode&&N?V():N||V()),T&&c.state.next({name:m,...O?{}:R});if(!N&&O&&c.state.next({...s}),r.resolver){const{errors:e}=await I([m]);if(g(F),h){const t=_e(s.errors,n,m),r=_e(e,n,t.name||m);l=r.error,m=r.name,_=D(e)}}else k([m],!0),l=(await J(v,o.disabled,i,S,r.shouldUseNativeValidation))[m],k([m]),g(F),h&&(l?_=!1:d.isValid&&(_=await $(n,!0)));h&&(v._f.deps&&Q(v._f.deps),((e,n,a,i)=>{const l=x(s.errors,e),o=d.isValid&&w(n)&&s.isValid!==n;var f;if(r.delayError&&a?(f=()=>((e,t)=>{A(s.errors,e,t),c.state.next({errors:s.errors})})(e,a),t=e=>{clearTimeout(u),u=setTimeout(f,e)},t(r.delayError)):(clearTimeout(u),t=null,a?A(s.errors,e,a):Y(s.errors,e)),(a?!re(l,a):l)||!D(i)||o){const t={...i,...o&&w(n)?{isValid:n}:{},errors:s.errors,name:e};s={...s,...t},c.state.next(t)}})(m,_,l,R))}var b},K=(e,t)=>{if(x(s.errors,t)&&e.focus)return e.focus(),1},Q=async(e,t={})=>{let a,i;const l=E(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await I(e);if(e)for(const r of e){const e=x(t,r);e?A(s.errors,r,e):Y(s.errors,r)}else s.errors=t;return t})(b(e)?e:l);a=D(t),i=e?!l.some((e=>x(t,e))):a}else e?(i=(await Promise.all(l.map((async e=>{const t=x(n,e);return await $(t&&t._f?{[e]:t}:t)})))).every(Boolean),(i||s.isValid)&&V()):i=a=await $(n);return c.state.next({...!O(e)||d.isValid&&a!==s.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:s.errors}),t.shouldFocus&&!i&&T(n,K,e?l:o.mount),i},te=e=>{const t={...l.mount?i:a};return b(e)?t:O(e)?x(t,e):e.map((e=>x(t,e)))},ae=(e,t)=>({invalid:!!x((t||s).errors,e),isDirty:!!x((t||s).dirtyFields,e),error:x((t||s).errors,e),isValidating:!!x(s.validatingFields,e),isTouched:!!x((t||s).touchedFields,e)}),ie=(e,t,r)=>{const a=(x(n,e,{_f:{}})._f||{}).ref,i=x(s.errors,e)||{},{ref:l,message:o,type:u,...d}=i;A(s.errors,e,{...d,...t,ref:a}),c.state.next({name:e,errors:s.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},le=(e,t={})=>{for(const l of e?E(e):o.mount)o.mount.delete(l),o.array.delete(l),t.keepValue||(Y(n,l),Y(i,l)),!t.keepError&&Y(s.errors,l),!t.keepDirty&&Y(s.dirtyFields,l),!t.keepTouched&&Y(s.touchedFields,l),!t.keepIsValidating&&Y(s.validatingFields,l),!r.shouldUnregister&&!t.keepDefaultValue&&Y(a,l);c.values.next({values:{...i}}),c.state.next({...s,...t.keepDirty?{isDirty:z()}:{}}),!t.keepIsValid&&V()},ye=({disabled:e,name:t,field:r,fields:s})=>{(w(e)&&l.mount||e||o.disabled.has(t))&&(e?o.disabled.add(t):o.disabled.delete(t),C(t,de(r?r._f:x(s,t)._f),!1,!1,!0))},pe=(e,t={})=>{let s=x(n,e);const i=w(t.disabled)||w(r.disabled);return A(n,e,{...s||{},_f:{...s&&s._f?s._f:{ref:{name:e}},name:e,mount:!0,...t}}),o.mount.add(e),s?ye({field:s,disabled:w(t.disabled)?t.disabled:r.disabled,name:e}):N(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:ce(t.min),max:ce(t.max),minLength:ce(t.minLength),maxLength:ce(t.maxLength),pattern:ce(t.pattern)}:{},name:e,onChange:G,onBlur:G,ref:i=>{if(i){pe(e,t),s=x(n,e);const r=b(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,l=(e=>H(e)||f(e))(r),o=s._f.refs||[];if(l?o.find((e=>e===r)):r===s._f.ref)return;A(n,e,{_f:{...s._f,...l?{refs:[...o.filter(ne),r,...Array.isArray(x(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),N(e,!1,void 0,r)}else s=x(n,e,{}),s._f&&(s._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(o.array,e)||!l.action)&&o.unMount.add(e)}}},he=()=>r.shouldFocusError&&T(n,K,o.mount),ve=(e,t)=>async a=>{let l;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let u=v(i);if(o.disabled.size)for(const e of o.disabled)A(u,e,void 0);if(c.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await I();s.errors=e,u=t}else await $(n);if(Y(s.errors,"root"),D(s.errors)){c.state.next({errors:{}});try{await e(u,a)}catch(e){l=e}}else t&&await t({...s.errors},a),he(),setTimeout(he);if(c.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:D(s.errors)&&!l,submitCount:s.submitCount+1,errors:s.errors}),l)throw l},ge=(e,t={})=>{const u=e?v(e):a,f=v(u),_=D(e),m=_?a:f;if(t.keepDefaultValues||(a=u),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...o.mount,...Object.keys(oe(a,i))]);for(const t of Array.from(e))x(s.dirtyFields,t)?A(m,t,x(i,t)):Z(t,x(m,t))}else{if(h&&b(e))for(const e of o.mount){const t=x(n,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(P(e)){const t=e.closest("form");if(t){t.reset();break}}}}n={}}i=r.shouldUnregister?t.keepDefaultValues?v(a):{}:v(m),c.array.next({values:{...m}}),c.values.next({values:{...m}})}o={mount:t.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues,l.watch=!!r.shouldUnregister,c.state.next({submitCount:t.keepSubmitCount?s.submitCount:0,isDirty:!_&&(t.keepDirty?s.isDirty:!(!t.keepDefaultValues||re(e,a))),isSubmitted:!!t.keepIsSubmitted&&s.isSubmitted,dirtyFields:_?{}:t.keepDirtyValues?t.keepDefaultValues&&i?oe(a,i):s.dirtyFields:t.keepDefaultValues&&e?oe(a,e):t.keepDirty?s.dirtyFields:{},touchedFields:t.keepTouched?s.touchedFields:{},errors:t.keepErrors?s.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&s.isSubmitSuccessful,isSubmitting:!1})},be=(e,t)=>ge(B(e)?e(i):e,t);return{control:{register:pe,unregister:le,getFieldState:ae,handleSubmit:ve,setError:ie,_executeSchema:I,_getWatch:q,_getDirty:z,_updateValid:V,_removeUnmounted:()=>{for(const e of o.unMount){const t=x(n,e);t&&(t._f.refs?t._f.refs.every((e=>!ne(e))):!ne(t._f.ref))&&le(e)}o.unMount=new Set},_updateFieldArray:(e,t=[],o,u,f=!0,_=!0)=>{if(u&&o&&!r.disabled){if(l.action=!0,_&&Array.isArray(x(n,e))){const t=o(x(n,e),u.argA,u.argB);f&&A(n,e,t)}if(_&&Array.isArray(x(s.errors,e))){const t=o(x(s.errors,e),u.argA,u.argB);f&&A(s.errors,e,t),((e,t)=>{!g(x(e,t)).length&&Y(e,t)})(s.errors,e)}if(d.touchedFields&&_&&Array.isArray(x(s.touchedFields,e))){const t=o(x(s.touchedFields,e),u.argA,u.argB);f&&A(s.touchedFields,e,t)}d.dirtyFields&&(s.dirtyFields=oe(a,i)),c.state.next({name:e,isDirty:z(e,t),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else A(i,e,t)},_updateDisabledField:ye,_getFieldArray:e=>g(x(l.mount?i:a,e,r.shouldUnregister?x(a,e,[]):[])),_reset:ge,_resetDefaultValues:()=>B(r.defaultValues)&&r.defaultValues().then((e=>{be(e,r.resetOptions),c.state.next({isLoading:!1})})),_updateFormState:e=>{s={...s,...e}},_disableForm:e=>{w(e)&&(c.state.next({disabled:e}),T(n,((t,r)=>{const s=x(n,r);s&&(t.disabled=s._f.disabled||e,Array.isArray(s._f.refs)&&s._f.refs.forEach((t=>{t.disabled=s._f.disabled||e})))}),0,!1))},_subjects:c,_proxyFormState:d,_setErrors:e=>{s.errors=e,c.state.next({errors:s.errors,isValid:!1})},get _fields(){return n},get _formValues(){return i},get _state(){return l},set _state(e){l=e},get _defaultValues(){return a},get _names(){return o},set _names(e){o=e},get _formState(){return s},set _formState(e){s=e},get _options(){return r},set _options(e){r={...r,...e}}},trigger:Q,register:pe,handleSubmit:ve,watch:(e,t)=>B(e)?c.values.subscribe({next:r=>e(q(void 0,t),r)}):q(e,t,!0),setValue:Z,getValues:te,reset:be,resetField:(e,t={})=>{x(n,e)&&(b(t.defaultValue)?Z(e,v(x(a,e))):(Z(e,t.defaultValue),A(a,e,v(t.defaultValue))),t.keepTouched||Y(s.touchedFields,e),t.keepDirty||(Y(s.dirtyFields,e),s.isDirty=t.defaultValue?z(e,v(x(a,e))):z()),t.keepError||(Y(s.errors,e),d.isValid&&V()),c.state.next({...s}))},clearErrors:e=>{e&&E(e).forEach((e=>Y(s.errors,e))),c.state.next({errors:e?s.errors:{}})},unregister:le,setError:ie,setFocus:(e,t={})=>{const r=x(n,e),s=r&&r._f;if(s){const e=s.refs?s.refs[0]:s.ref;e.focus&&(e.focus(),t.shouldSelect&&B(e.select)&&e.select())}},getFieldState:ae}}const pe=()=>{const[e,t]=(0,c.useState)(),r=function(e={}){const t=c.default.useRef(void 0),r=c.default.useRef(void 0),[s,n]=c.default.useState({isDirty:!1,isValidating:!1,isLoading:B(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:B(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...ye(e),formState:s});const a=t.current.control;return a._options=e,function(e){const t=c.default.useRef(e);t.current=e,c.default.useEffect((()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}}),[e.disabled])}({subject:a._subjects.state,next:e=>{((e,t,r,s)=>{r(e);const{name:n,...a}=e;return D(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find((e=>t[e]===(!s||F)))})(e,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),c.default.useEffect((()=>a._disableForm(e.disabled)),[a,e.disabled]),c.default.useEffect((()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==s.isDirty&&a._subjects.state.next({isDirty:e})}}),[a,s.isDirty]),c.default.useEffect((()=>{e.values&&!re(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values,n((e=>({...e})))):a._resetDefaultValues()}),[e.values,a]),c.default.useEffect((()=>{e.errors&&a._setErrors(e.errors)}),[e.errors,a]),c.default.useEffect((()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()})),c.default.useEffect((()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})}),[e.shouldUnregister,a]),t.current.formState=((e,t,r,s=!0)=>{const n={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(n,a,{get:()=>{const n=a;return t._proxyFormState[n]!==F&&(t._proxyFormState[n]=!s||F),r&&(r[n]=!0),e[n]}});return n})(s,a),t.current}({reValidateMode:"onChange"});return{...r,register:(e,s)=>{const n=r.register(e,s),a=r?.formState.errors,i=r.watch(e);return{...n,onChange:s=>(t(null),r.clearErrors(e),n.onChange(s)),formvalue:i,error:a?.[e]?.message?.toString()}},GlobalError:()=>(0,a.jsx)(a.Fragment,{children:e&&!e.errors&&(0,a.jsx)("div",{className:i["global-error"],children:e.message})}),setErrors:e=>{e.errors?Object.keys(e.errors).forEach((t=>r.setError(t,{message:e.errors?.[t]?.[0]}))):t(e)}}},he="style-module__error___a8h4v",ve={loading:"style-module__loading___b_SUA",dot:"style-module__dot___D9MUw",bounce:"style-module__bounce___rAPTh",light:"style-module__light___rrj2v",secondary:"style-module__secondary___AX6H5","secondary-light":"style-module__secondary-light___bvMdO"},ge=({color:e="primary",...t})=>{const r=["ui-loading"];return r.push(ve.loading),e&&r.push(ve[e],"ui-loading-"+e),(0,a.jsxs)("div",{...t,className:r.join(" "),children:[(0,a.jsx)("div",{className:ve.dot}),(0,a.jsx)("div",{className:ve.dot}),(0,a.jsx)("div",{className:ve.dot}),(0,a.jsx)("div",{className:ve.dot})]})},be=({children:e,beforeElement:t,afterElement:r,error:s,placeholder:n,styleContainer:i,classNameContainer:l,hiddenContainer:o,formvalue:u,wait:d,...f})=>{const[_,m]=(0,c.useState)("");(0,c.useEffect)((()=>{m(s??"")}),[s]);const y=["ui-form-element-container"];return y.push("style-module__container___wOnhU"),_&&y.push(he),f.disabled&&y.push("style-module__disabled___TbeBm"),o&&y.push("style-module__hidden___kIK86"),l&&y.push(l),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{className:y.join(" "),style:i,children:[t?(0,c.cloneElement)(t,{key:"ui-before-element"}):null,(0,a.jsxs)("div",{className:"ui-form-element style-module__element___hbwx_",children:["function"==typeof e?e(f):null,n&&d?"":(0,a.jsx)("span",{className:"ui-form-element-placeholder style-module__placeholder___bNqrp",children:n}),d&&(0,a.jsx)(ge,{})]}),r?(0,c.cloneElement)(r,{key:"ui-after-element"}):null]}),_&&(0,a.jsx)("div",{className:"ui-form-error "+he,children:_})]})},xe=({children:e,wait:t,progress:r,progressRadius:s=!0,className:n,onSubmit:l,...u})=>{const c=[];return c.push(i.container),t&&c.push(i.wait),n&&c.push(n),(0,a.jsxs)("form",{...u,onSubmit:e=>{e.preventDefault(),"function"==typeof l&&l(e)},className:c.join(" "),children:[e,(0,a.jsx)("div",{className:i["wait-indicator"],children:"number"==typeof r?(0,a.jsx)(d,{radius:s,value:r}):(0,a.jsx)(o,{})})]})},we=(0,c.forwardRef)((({onChange:e,onInput:t,onChangeText:r,wait:s,disabled:n,formvalue:i,children:l,...o},u)=>{const[d,f]=(0,c.useState)(""),_=t=>{"function"==typeof e&&e(t),"function"==typeof r&&r(t.target.value)},m=e=>{n||s||("function"==typeof t&&t(e),f(e.target.value))};return(0,c.useEffect)((()=>{const e=o.value??i;f(e?String(e):"")}),[o.value,i]),(0,a.jsx)(be,{...o,wait:s,children:e=>(0,a.jsx)("input",{...e,placeholder:"",onChange:_,disabled:n||s,value:s?"":d,onInput:m,ref:u})})})),je=(0,c.forwardRef)((({onChange:e,onInput:t,onChangeText:r,formvalue:s,wait:n,...i},l)=>{const o=(0,c.useRef)(null),[u,d]=(0,c.useState)(i.value??s??""),f=t=>{"function"==typeof e&&e(t),"function"==typeof r&&r(t.target.value)},_=e=>{"function"==typeof t&&t(e),d(e.target.value)};(0,c.useEffect)((()=>{const e=o.current;if(!e)return;const t=e.offsetHeight;e.style.height="auto";const r=e.scrollHeight,s=Math.max(r,50);e.style.height=`${Math.max(s,t)}px`}),[u]),(0,c.useEffect)((()=>{d(i.value??s??"")}),[i.value,s]),(0,c.useImperativeHandle)(l,(()=>o.current));const m=n?"":u;return(0,a.jsx)(be,{...i,wait:n,children:e=>(0,a.jsx)("textarea",{...e,disabled:n,placeholder:e.placeholder??"",value:m,onChange:f,onInput:_,ref:o})})})),Se=({onChange:e,onChangeFiles:t,accept:r,multiple:s,wait:n,children:i,className:l,icon:o,...u})=>{const d=(0,c.useRef)(null),f=`\n style-module__file-btn___q1o5j\n ${o&&!n?"style-module__icon___DmZ45":""}\n `.trim(),_=(0,c.useCallback)((r=>{const s=r.target.files;"function"==typeof e&&e(r),"function"==typeof t&&t(s)}),[e,t]);return(0,a.jsx)(be,{...u,wait:n,children:e=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"file",ref:d,onChange:_,accept:r,multiple:s,style:{display:"none"},...e}),(0,a.jsx)("div",{className:`ui-file-uploader ${f} ${l||""}`,children:!n&&(i||"Выбрать файл")})]})})},Ae=({onChange:e,children:t,multiple:r,accept:s,...n})=>{const i=(0,c.useRef)(null),l=t=>{const r=t.target;if(r.files)for(const t of r.files){const r=new FileReader;r.onload=r=>{const s=r.target?.result?.toString().split(";base64,"),n=s?.[0].replace("data:","")??"",a=s?.[1]??"";"function"==typeof e&&(i.current.value="",e({name:t.name,type:t.type,size:t.size,mime:n,data:a,base64:r.target?.result}))},r.readAsDataURL(t)}};return(0,c.useEffect)((()=>(i.current=(()=>{const e=document.createElement("input");return e.setAttribute("type","file"),e.onchange=l,s&&s.length>0&&e.setAttribute("accept",s.join(",")),r&&e.setAttribute("multiple","multiple"),e})(),()=>{i.current?.remove()})),[]),(0,a.jsx)("div",{...n,onClick:e=>{n.disabled||(i.current.click(),e.preventDefault())},children:t})},Ve={container:"style-module__container___xiW4D","wait-indicator":"style-module__wait-indicator___DXrE8",active:"style-module__active___rLGnX",btn:"style-module__btn___J72MV","icon-left":"style-module__icon-left___ewMhi","icon-right":"style-module__icon-right___HZEeb","icon-only":"style-module__icon-only___ku4SM","btn-light":"style-module__btn-light___VuPa2","btn-secondary":"style-module__btn-secondary___QGEwb","btn-secondary-light":"style-module__btn-secondary-light___zMIzX","btn-tertiary":"style-module__btn-tertiary___fanHi","normal-btn":"style-module__normal-btn___oO_oX","small-btn":"style-module__small-btn___fl6Ff","large-btn":"style-module__large-btn___gCRYc"},ke=({children:e,className:t,classNameContainer:r,styleContainer:s,wait:n=!1,variant:i,size:l="normal",icon:o,...u})=>{const d=`\n\t\t${Ve.btn}\n\t\t${i&&Ve[`btn-${i}`]}\n\t\t${l&&Ve[`${l}-btn`]}\n\t\t${o&&!n?Ve[`icon-${o}`]:""}\n\t\t${t||""}\n\t`.replace(/\s+/g," ").trim(),c=["ui-button-container"];return c.push(Ve.container),r&&c.push(r),(0,a.jsxs)("div",{className:c.join(" "),style:s,children:[(0,a.jsx)("button",{...u,className:d,children:!n&&e}),n&&(0,a.jsx)("div",{className:"ui-button-spinner "+Ve["wait-indicator"]+(n?" "+Ve.active:""),children:(0,a.jsx)(ge,{color:i})})]})},Fe=({onChange:e,onClick:t,onId:r,onRemove:s,...n})=>{const{base64:i,src:l}=n,[u,d]=(0,c.useState)(!0),f=(0,c.useRef)(!1),_=(0,c.useRef)(),m=e=>{_.current=e,"function"==typeof r&&r(e)};return(0,c.useEffect)((()=>{"function"!=typeof e||l||e({...n,setWait:d,setId:m,id:_.current})}),[]),(0,a.jsxs)("span",{className:"style-module__image___pE1xz",onClick:()=>{"function"==typeof t&&t({...n,setWait:d,setId:m,id:_.current})},children:[(0,a.jsx)("span",{className:"style-module__close___aMqtU",onClick:e=>{if(!e.target)return;const t=e.target;f.current&&(f.current=!1,t.blur(),"function"==typeof s&&s()),f.current=!0},onBlur:()=>{f.current=!1},tabIndex:1}),(0,a.jsx)("img",{src:l??i?.toString(),onLoad:()=>{d(!1)}}),u&&(0,a.jsx)("span",{className:"style-module__wait___OzAwQ",children:(0,a.jsx)(o,{})})]})},Ne=({imagesArray:e,onChange:t,onChangeArray:r,onClick:s})=>{const[n,i]=(0,c.useState)([]),l=e=>t=>{i((r=>r.map((r=>(e===r&&(r.id=t),r)))))},o=e=>()=>i((t=>t.filter((t=>t!==e))));return(0,c.useEffect)((()=>{"function"==typeof r&&r(n)}),[n]),(0,c.useEffect)((()=>{e&&i(e)}),[e]),(0,a.jsxs)("div",{className:"style-module__container___gZKjJ",children:[n.map(((e,r)=>(0,a.jsx)(Fe,{...e,onChange:t,onClick:s,onRemove:o(e),onId:l(e)},e.name+r))),(0,a.jsx)(Ae,{onChange:e=>{i((t=>[...t,{...e}]))},accept:["image/png"],className:"style-module__new___vOprg",multiple:!0})]})},Ce=(0,c.forwardRef)((({type:e="checkbox",hiddenContainer:t=!0,placeholder:r,...s},n)=>(0,a.jsx)(be,{...s,hiddenContainer:t,children:t=>(0,a.jsxs)("div",{className:"ui-checkbox-container style-module__container___I6rSI",children:[(0,a.jsx)("input",{...t,className:"ui-checkbox"+(t.className?" "+t.className:""),type:e,ref:n}),(0,a.jsx)("span",{className:"ui-checkbox-indicator style-module__indicator___pmILi"}),(0,a.jsx)("span",{className:"ui-checkbox-text style-module__text___MXgdI",children:r})]})}))),De={container:"style-module__container___cUgT_",down:"style-module__down___zGazf",up:"style-module__up___I2O45",left:"style-module__left___BhSAZ",right:"style-module__right___k7oS7"},Ee=({className:e,direction:t="down",...r})=>{const s=["ui-component-arrow"];return s.push(De.container),t&&s.push(De[t]),e&&s.push(e),(0,a.jsx)("div",{...r,className:s.join(" ")})},Oe="style-module__opened___nU6lR",Ie="style-module__hidden___jR8qZ",Re=(0,c.createContext)({selected:"",emptyValue:{current:{}},setSelect:e=>{},setSelected:e=>{},setTitle:e=>{}}),Le=(0,c.forwardRef)((({children:e,onChangeSelect:t,value:r,formvalue:s,...n},i)=>{const l=(0,c.useRef)(null),o=(0,c.useRef)(null),u=(0,c.useRef)(!1),[d,f]=(0,c.useState)(!1),[_,m]=(0,c.useState)(""),[y,p]=(0,c.useState)(),h=()=>{f(!1)},v=()=>{d?h():n.disabled||f(!0)},g=e=>{"function"==typeof t&&t(e),void 0===r&&m(e),h()},b=e=>{n.disabled||("function"==typeof n.onInput&&n.onInput(e),"function"==typeof n.onChange&&n.onChange(e),m(e.target.value))};(0,c.useEffect)((()=>{_&&(e=>{const t=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value")?.set;t?.call(o.current,e);const r=new Event("input",{bubbles:!0});o.current.dispatchEvent(r)})(_)}),[_]),(0,c.useEffect)((()=>{m(String(r??s))}),[r,s]),(0,c.useEffect)((()=>{const e=l.current,t=e.classList;d?(t.remove(Ie),requestAnimationFrame((()=>{t.add(Oe),e?.focus()}))):(t.contains(Oe)&&(e.ontransitionend=()=>{t.add(Ie),e.ontransitionend=null}),t.remove(Oe))}),[d]),(0,c.useImperativeHandle)(i,(()=>o.current),[]);const x=[""];return x.push("style-module__container___LSHO0",Ie),(0,a.jsx)(be,{...n,classNameContainer:"style-module__container-element___kJu6w",children:t=>(0,a.jsxs)(Re.Provider,{value:{selected:_,emptyValue:u,setSelect:g,setSelected:m,setTitle:p},children:[(0,a.jsx)("input",{...t,type:"hidden",value:_,onInput:b,ref:o}),(0,a.jsxs)("div",{className:x.join(" "),ref:l,tabIndex:1,onBlur:h,children:[(0,a.jsxs)("div",{className:"style-module__select___chAL1",onClick:v,children:[(0,a.jsx)("span",{className:"style-module__title___nDbQX",children:y}),(0,a.jsx)(Ee,{className:"style-module__arrow___dmLwx"})]}),(0,a.jsx)("ul",{className:"style-module__select-list___OOtGa",children:e})]})]})})})),Te=({children:e,value:t,disabled:r,hidden:s,onClick:n,...i})=>{const l=(0,c.useContext)(Re);if((0,c.useEffect)((()=>{!e||t!==l.selected&&l.emptyValue.current||(l.setTitle(e),!l.emptyValue.current&&t&&l.setSelected(t),l.emptyValue.current=!0)}),[l.selected]),s)return null;const o=["ui-select-option"];return o.push("style-module__option___isRro"),l.selected===t&&o.push("style-module__active___KsePh","active"),r&&o.push("style-module__disabled___zGNMv","disabled"),(0,a.jsx)("li",{...i,onClick:e=>{void 0===t||r||(l.setSelect(t),"function"==typeof n&&n(e))},className:o.join(" "),children:e})},Me=({children:e,label:t})=>(0,a.jsx)("li",{children:(0,a.jsxs)("ul",{className:"style-module__optgpoup___aHuEQ",children:[t&&(0,a.jsx)("li",{className:"style-module__label___UK2Xg",children:t}),e]})}),Ue={...(0,c.forwardRef)((({...e},t)=>(0,a.jsx)(Le,{...e,ref:t}))),Option:Te,Optgroup:Me},Be={container:"style-module__container___EyoJC",hide:"style-module__hide___zIkzn",down:"style-module__down___LfI15","dropdown-list":"style-module__dropdown-list___WixEd",up:"style-module__up___NgQd7",left:"style-module__left___IsOS2",right:"style-module__right___Am00v",opened:"style-module__opened___NnXhB",arrow:"style-module__arrow___BXOUC",item:"style-module__item___n0I4m"},Pe=({items:e,isOpen:t,enableRerenderItems:r,disabled:s})=>{const n=(0,c.useRef)(null),i=(0,c.useMemo)((()=>r?t?e:null:e),[r,e,t]);return(0,c.useEffect)((()=>{n.current&&(window.innerWidth,n.current.getBoundingClientRect().left)}),[t]),s?null:(0,a.jsx)("ul",{className:`${Be["dropdown-list"]} ui-dropdown-list`,children:i,ref:n})},$e=(0,c.createContext)({close:()=>{}}),He=({children:e,className:t,items:r,arrow:s=!0,direction:n="down",position:i="right",split:l=!1,disabled:o,hover:u=!1,enableRerenderItems:d=!0,onShow:f,onHide:_,...m})=>{const y=(0,c.useRef)(null),p=(0,c.useRef)(null),[h,v]=(0,c.useState)(!1),g=()=>{v(!1)},b=()=>{v((e=>!o&&!e))},x=()=>{b()};(0,c.useEffect)((()=>{const e=y.current,t=e?.classList;h?(t?.add(Be.opened),e?.focus(),"function"==typeof f&&f()):(t?.remove(Be.opened),"function"==typeof _&&_())}),[h]);const w=["ui-dropdown"];return w.push(Be.container),t&&w.push(t),n&&w.push(Be[n]),i&&w.push(Be[i]),(0,a.jsx)($e.Provider,{value:{close:g},children:(0,a.jsxs)("div",{...m,className:w.join(" "),ref:y,onMouseEnter:()=>{u&&!h&&(p.current=setTimeout(b,50))},onMouseLeave:()=>{p.current&&clearTimeout(p.current)},tabIndex:1,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||g()},children:["left"===i&&!o&&(0,a.jsx)(Ee,{className:Be.arrow,onClick:x}),(0,a.jsx)("div",{onClick:()=>{p.current||l&&!u||b()},className:"ui-dropdown-block"+(h?" "+Be.hide:""),children:e}),"right"===i&&!o&&s&&(0,a.jsx)(Ee,{className:Be.arrow,onClick:x}),(0,a.jsx)(Pe,{isOpen:h,disabled:o,enableRerenderItems:d,items:r})]})})},ze=({children:e,onClick:t,autoClose:r=!0,active:s,className:n,...i})=>{const l=(0,c.useContext)($e),o=["ui-dropdown-item"];return o.push(Be.item),s&&o.push(Be.active,"active"),n&&o.push(n),(0,a.jsx)("li",{...i,onClick:e=>{"function"==typeof t&&t(e),r&&l.close()},className:o.join(" "),children:"function"==typeof e?e(l):e})},qe={...(0,c.forwardRef)((({...e},t)=>(0,a.jsx)(He,{...e}))),Item:ze},We=(0,c.createContext)({}),Xe=({children:e})=>(0,a.jsx)(We.Provider,{value:{},children:e}),Ze={};var Ge=n.$n,Ke=n.Sc,Qe=n.ms,Je=n.tJ,Ye=n.Hg,et=n.ZH,tt=n.zp,rt=n.lV,st=n.ZS,nt=n.pd,at=n.Rh,it=n.ke,lt=n.Kq,ot=n.l6,ut=n.rf,dt=n.OQ,ct=n.y$,ft=n.fs,_t=n.qx,mt=n.Ay,yt=n.mN;export{Ge as Button,Ke as Checkbox,Qe as Dropdown,Je as DropdownItem,Ye as Element,et as File,tt as FileInput,rt as Form,st as FormElement,nt as Input,at as Loading,it as Progress,lt as Provider,ot as Select,ut as SelectOptgroup,dt as SelectOption,ct as Spinner,ft as TextArea,_t as UploadImages,mt as default,yt as useForm};
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */