@banzamel/mineralui 0.1.0 → 0.2.1

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/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # MineralUI
2
+
3
+ Modern React UI component library with a unique **mineral dark aesthetic** — glassmorphism effects, cyan accents, and dark backgrounds. Zero runtime dependencies.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @banzamel/mineralui
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```tsx
14
+ import {MineralThemeProvider, Input, Select, DatePicker} from '@banzamel/mineralui';
15
+ import '@banzamel/mineralui/styles.css';
16
+
17
+ function App() {
18
+ return (
19
+ <MineralThemeProvider>
20
+ <Input label="Name" variant="outlined" />
21
+ <Select
22
+ label="Country"
23
+ options={[
24
+ {value: 'pl', label: 'Poland'},
25
+ {value: 'de', label: 'Germany'},
26
+ ]}
27
+ />
28
+ <DatePicker label="Birth date" locale="pl" />
29
+ </MineralThemeProvider>
30
+ );
31
+ }
32
+ ```
33
+
34
+ ## Components
35
+
36
+ ### Inputs
37
+ | Component | Description |
38
+ |-----------|-------------|
39
+ | `Input` | Base input — variants, sizes, colors, icons, loading, clearable |
40
+ | `Textarea` | Multiline with autoResize, minRows/maxRows |
41
+ | `InputPassword` | Show/hide toggle, strength indicator |
42
+ | `InputNumber` | Stepper buttons, min/max/step, long-press |
43
+ | `InputSearch` | Debounced search with instant Enter |
44
+ | `InputEmail` | RFC email validation |
45
+ | `InputPhone` | Country code prefix, digit formatting |
46
+ | `InputName` | Auto-capitalize, strip special chars |
47
+ | `InputIBAN` | MOD-97 checksum, country-aware formatting |
48
+ | `InputTaxId` | NIP/PESEL/REGON with weighted checksum |
49
+ | `InputCurrency` | Symbol, thousand separators, precision |
50
+
51
+ ### Controls
52
+ | Component | Description |
53
+ |-----------|-------------|
54
+ | `Checkbox` | Custom visual, indeterminate state, colors |
55
+ | `Radio` / `RadioGroup` | Context-based group, arrow key navigation |
56
+ | `Toggle` | Switch on/off with sliding knob |
57
+
58
+ ### Dropdowns
59
+ | Component | Description |
60
+ |-----------|-------------|
61
+ | `Select` | Single/multi (chips), searchable, grouped, keyboard nav |
62
+ | `Autocomplete` | Generic\<T\>, freeSolo, async loading, multiple tags |
63
+ | `DatePicker` | Calendar grid, month/year nav, min/max, locale pl/en |
64
+ | `TimePicker` | Scrollable columns, minuteStep, 12h/24h format |
65
+
66
+ ### Form
67
+ | Component | Description |
68
+ |-----------|-------------|
69
+ | `Form` | FormContext provider, validation modes, submit handling |
70
+ | `useFormField` | Hook for field registration and validation |
71
+
72
+ ### Primitives
73
+ `Portal`, `Popover` (auto-flip positioning, glassmorphism)
74
+
75
+ ## Theming
76
+
77
+ MineralUI uses CSS Custom Properties for full customization:
78
+
79
+ ```css
80
+ :root {
81
+ --mineral-primary: #00A5DE;
82
+ --mineral-dark: #0f172a;
83
+ --mineral-surface: #1a1a2e;
84
+ --mineral-text: #e2e8f0;
85
+ }
86
+ ```
87
+
88
+ **4 levels of customization:** CSS Variables → Props → className → ThemeProvider
89
+
90
+ ## Built-in Utilities
91
+
92
+ ```tsx
93
+ // Validators (zero dependencies)
94
+ import {validateIBAN, validateNIP, validatePESEL, validateEmail} from '@banzamel/mineralui';
95
+
96
+ // Formatters
97
+ import {formatIBAN, formatCurrency, formatPhone} from '@banzamel/mineralui';
98
+
99
+ // Hooks
100
+ import {useDebounce, useClickOutside, useKeyboardNav} from '@banzamel/mineralui';
101
+ ```
102
+
103
+ ## Key Features
104
+
105
+ - **Zero dependencies** — only React 18+ as peer dependency
106
+ - **TypeScript-first** — complete types, full IDE autocomplete
107
+ - **CSS Modules** — isolated styles, no global collisions
108
+ - **API-friendly props** — `loading`, `debounceMs`, `validateOnBlur`, `onValueChange`
109
+ - **Keyboard navigation** — full ARIA support, focus management
110
+ - **Polish validators** — IBAN MOD-97, NIP/PESEL/REGON checksum built-in
111
+
112
+ ## License
113
+
114
+ MIT — [Rafal Polak](https://bitbucket.org/polaczq/mineralui)
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),q=n.createContext({}),tr={primary:"--mineral-primary",primaryDark:"--mineral-primary-dark",primaryLight:"--mineral-primary-light",dark:"--mineral-dark",darkLight:"--mineral-dark-light",surface:"--mineral-surface",text:"--mineral-text",textSecondary:"--mineral-text-secondary",textHeading:"--mineral-text-heading",border:"--mineral-border",borderHover:"--mineral-border-hover",borderFocus:"--mineral-border-focus",success:"--mineral-success",error:"--mineral-error",warning:"--mineral-warning",info:"--mineral-info",fontFamily:"--mineral-font-family",radiusSm:"--mineral-radius-sm",radiusMd:"--mineral-radius-md",radiusLg:"--mineral-radius-lg"};function sr({theme:a,children:x}){const t=n.useRef(null);return n.useEffect(()=>{if(!t.current)return;const c=t.current;for(const[g,s]of Object.entries(a)){const _=tr[g];_&&s&&c.style.setProperty(_,s)}},[a]),e.jsx(q.Provider,{value:a,children:e.jsx("div",{ref:t,children:x})})}function or(){return n.useContext(q)}function l(...a){return a.filter(Boolean).join(" ")}const ar="_wrapper_1tprv_2",cr="_fullWidth_1tprv_10",ir="_label_1tprv_15",lr="_focused_1tprv_22",dr="_labelError_1tprv_26",ur="_labelSuccess_1tprv_30",_r="_required_1tprv_34",pr="_inputContainer_1tprv_40",mr="_outlined_1tprv_50",vr="_disabled_1tprv_56",fr="_filled_1tprv_66",hr="_underlined_1tprv_82",br="_inputError_1tprv_98",xr="_inputSuccess_1tprv_106",gr="_colorWarning_1tprv_115",jr="_colorInfo_1tprv_120",yr="_sm_1tprv_126",Sr="_md_1tprv_132",Ir="_lg_1tprv_138",Cr="_rounded_1tprv_145",Nr="_input_1tprv_40",kr="_startIcon_1tprv_178",wr="_endIcon_1tprv_186",Er="_clearBtn_1tprv_195",Mr="_spinner_1tprv_214",Rr="_spin_1tprv_214",Wr="_helperText_1tprv_232",Tr="_errorTextMsg_1tprv_238",Or="_charCount_1tprv_245",qr="_charCountOver_1tprv_252",Pr="_bottomRow_1tprv_257",r={wrapper:ar,fullWidth:cr,label:ir,focused:lr,labelError:dr,labelSuccess:ur,required:_r,inputContainer:pr,outlined:mr,disabled:vr,filled:fr,underlined:hr,inputError:br,inputSuccess:xr,colorWarning:gr,colorInfo:jr,sm:yr,md:Sr,lg:Ir,rounded:Cr,input:Nr,startIcon:kr,endIcon:wr,clearBtn:Er,spinner:Mr,spin:Rr,helperText:Wr,errorTextMsg:Tr,charCount:Or,charCountOver:qr,bottomRow:Pr},$r=n.forwardRef(function({type:x="text",value:t,defaultValue:c,name:g,id:s,placeholder:_,disabled:j=!1,readOnly:P=!1,required:I=!1,autoFocus:$=!1,autoComplete:B,variant:H="outlined",size:D="md",color:C,fullWidth:F=!1,rounded:z=!1,label:N,helperText:p,errorText:i,startIcon:k,endIcon:w,clearable:A=!1,error:G=!1,success:E=!1,maxLength:m,showCharCount:M=!1,onChange:v,onFocus:f,onBlur:h,onKeyDown:J,onClear:b,loading:y=!1,className:K,style:L,inputClassName:Q,labelClassName:U},d){const[R,W]=n.useState(!1),[V,T]=n.useState((c==null?void 0:c.toString())??""),O=n.useRef(null),S=t!==void 0?t.toString():V,u=G||!!i,X=S.length>0,Y=n.useCallback(o=>{W(!0),f==null||f(o)},[f]),Z=n.useCallback(o=>{W(!1),h==null||h(o)},[h]),rr=n.useCallback(o=>{t===void 0&&T(o.target.value),v==null||v(o)},[v,t]),er=n.useCallback(()=>{t===void 0&&T(""),b==null||b();const o=(d==null?void 0:d.current)??O.current;o==null||o.focus()},[b,d]),nr=l(r.inputContainer,r[H],r[D],R&&r.focused,u&&r.inputError,E&&!u&&r.inputSuccess,C==="warning"&&r.colorWarning,C==="info"&&r.colorInfo,j&&r.disabled,z&&r.rounded);return e.jsxs("div",{className:l(r.wrapper,F&&r.fullWidth,K),style:L,children:[N&&e.jsx("label",{htmlFor:s,className:l(r.label,R&&r.focused,u&&r.labelError,E&&!u&&r.labelSuccess,I&&r.required,U),children:N}),e.jsxs("div",{className:nr,children:[k&&e.jsx("span",{className:r.startIcon,children:k}),e.jsx("input",{ref:d??O,type:x,value:t,defaultValue:t===void 0?c:void 0,name:g,id:s,placeholder:_,disabled:j,readOnly:P,required:I,autoFocus:$,autoComplete:B,maxLength:m,className:l(r.input,Q),onChange:rr,onFocus:Y,onBlur:Z,onKeyDown:J,"aria-invalid":u||void 0,"aria-describedby":i?`${s}-error`:p?`${s}-helper`:void 0}),y&&e.jsx("span",{className:r.spinner}),A&&X&&!y&&!j&&e.jsx("button",{type:"button",className:r.clearBtn,onClick:er,tabIndex:-1,"aria-label":"Clear input",children:"✕"}),w&&!y&&e.jsx("span",{className:r.endIcon,children:w})]}),(i||p||M)&&e.jsxs("div",{className:r.bottomRow,children:[e.jsxs("span",{children:[i&&e.jsx("span",{id:s?`${s}-error`:void 0,className:r.errorTextMsg,role:"alert",children:i}),!i&&p&&e.jsx("span",{id:s?`${s}-helper`:void 0,className:r.helperText,children:p})]}),M&&m&&e.jsxs("span",{className:l(r.charCount,S.length>m&&r.charCountOver),children:[S.length,"/",m]})]})]})});exports.Input=$r;exports.MineralThemeProvider=sr;exports.cn=l;exports.useTheme=or;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),s=require("react/jsx-runtime"),xt=require("react-dom"),Ue=n.createContext({}),vt={primary:"--mineral-primary",primaryDark:"--mineral-primary-dark",primaryLight:"--mineral-primary-light",dark:"--mineral-dark",darkLight:"--mineral-dark-light",surface:"--mineral-surface",text:"--mineral-text",textSecondary:"--mineral-text-secondary",textHeading:"--mineral-text-heading",border:"--mineral-border",borderHover:"--mineral-border-hover",borderFocus:"--mineral-border-focus",success:"--mineral-success",error:"--mineral-error",warning:"--mineral-warning",info:"--mineral-info",fontFamily:"--mineral-font-family",radiusSm:"--mineral-radius-sm",radiusMd:"--mineral-radius-md",radiusLg:"--mineral-radius-lg"};function gt({theme:r,children:e}){const t=n.useRef(null);return n.useEffect(()=>{if(!t.current)return;const c=t.current;for(const[o,l]of Object.entries(r)){const i=vt[o];i&&l&&c.style.setProperty(i,l)}},[r]),s.jsx(Ue.Provider,{value:r,children:s.jsx("div",{ref:t,children:e})})}function yt(){return n.useContext(Ue)}function A(...r){return r.filter(Boolean).join(" ")}const le={valid:!0},V=r=>({valid:!1,error:r});function Ye(r){return r.trim().length>0?le:V("This field is required")}function wt(r){return e=>e.length>=r?le:V(`Minimum ${r} characters`)}function Nt(r){return e=>e.length<=r?le:V(`Maximum ${r} characters`)}function jt(r,e){return t=>r.test(t)?le:V(e??"Invalid format")}function kt(r,e){return t=>{const c=parseFloat(t);return isNaN(c)?V("Must be a number"):r!==void 0&&c<r?V(`Minimum value is ${r}`):e!==void 0&&c>e?V(`Maximum value is ${e}`):le}}const $t=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;function Ze(r){return r?$t.test(r)?le:V("Invalid email address"):le}const It={PL:9,DE:10,US:10,GB:10,FR:9,CZ:9,SK:9};function Ke(r,e){if(!r)return le;const t=r.replace(/\D/g,"");if(t.length<7)return V("Phone number too short");if(t.length>15)return V("Phone number too long");if(e){const c=It[e.toUpperCase()];if(c&&t.length!==c)return V(`Phone number should have ${c} digits`)}return le}const Et={AL:28,AD:24,AT:20,AZ:28,BH:22,BY:28,BE:16,BA:20,BR:29,BG:22,CR:22,HR:21,CY:28,CZ:24,DK:18,DO:28,EG:29,SV:28,EE:20,FO:18,FI:18,FR:27,GE:22,DE:22,GI:23,GR:27,GL:18,GT:28,HU:28,IS:26,IQ:23,IE:22,IL:23,IT:27,JO:30,KZ:20,XK:20,KW:30,LV:21,LB:28,LI:21,LT:20,LU:20,MT:31,MR:27,MU:30,MD:24,MC:27,ME:22,NL:18,MK:19,NO:15,PK:24,PS:29,PL:28,PT:25,QA:29,RO:24,LC:32,SM:27,SA:24,RS:22,SC:31,SK:24,SI:19,ES:24,SE:24,CH:21,TL:23,TN:24,TR:26,UA:29,AE:23,GB:22,VA:22,VG:24};function St(r){let e=0;for(let t=0;t<r.length;t++)e=(e*10+parseInt(r[t],10))%97;return e}function Je(r){if(!r)return le;const e=r.replace(/\s/g,"").toUpperCase();if(e.length<2)return V("IBAN too short");const t=e.slice(0,2),c=Et[t];if(!c)return V("Unknown IBAN country code");if(e.length!==c)return V(`IBAN for ${t} should have ${c} characters`);const l=(e.slice(4)+e.slice(0,4)).replace(/[A-Z]/g,i=>String(i.charCodeAt(0)-55));return St(l)===1?le:V("Invalid IBAN checksum")}const Mt=[6,5,7,2,3,4,5,6,7];function Xe(r){if(!r)return le;const e=r.replace(/\D/g,"");if(e.length!==10)return V("NIP must have 10 digits");let t=0;for(let o=0;o<9;o++)t+=parseInt(e[o],10)*Mt[o];const c=t%11;return c===10?V("Invalid NIP"):c===parseInt(e[9],10)?le:V("Invalid NIP checksum")}const zt=[1,3,7,9,1,3,7,9,1,3];function Ce(r){if(!r)return le;const e=r.replace(/\D/g,"");if(e.length!==11)return V("PESEL must have 11 digits");let t=0;for(let o=0;o<10;o++)t+=parseInt(e[o],10)*zt[o];return(10-t%10)%10===parseInt(e[10],10)?le:V("Invalid PESEL checksum")}const Tt=[8,9,2,3,4,5,6,7],Lt=[2,4,8,5,0,9,7,3,6,1,2,4,8];function Qe(r){if(!r)return le;const e=r.replace(/\D/g,"");if(e.length!==9&&e.length!==14)return V("REGON must have 9 or 14 digits");const t=e.length===9?Tt:Lt;let c=0;for(let i=0;i<t.length;i++)c+=parseInt(e[i],10)*t[i];const o=c%11===10?0:c%11,l=parseInt(e[e.length-1],10);return o===l?le:V("Invalid REGON checksum")}function Rt(...r){return e=>{for(const t of r){const c=t(e);if(!c.valid)return c}return le}}function ye(r){return r.replace(/\D/g,"")}function Dt(r){return r.replace(/[^a-zA-Z0-9]/g,"")}function Ve(r){return r.replace(/\b\w/g,e=>e.toUpperCase())}function et(r){return r.replace(/\s/g,"").toUpperCase().replace(/(.{4})/g,"$1 ").trim()}function tt(r){return r.replace(/\s/g,"").toUpperCase()}const Ge={PL:[3,3,3],DE:[3,4,3],US:[3,3,4],GB:[4,3,3],FR:[2,2,2,2,2],DEFAULT:[3,3,3]};function rt(r,e={}){var i;const t=ye(r);if(!t)return"";const c=e.groupPattern??Ge[((i=e.countryCode)==null?void 0:i.toUpperCase())??""]??Ge.DEFAULT,o=[];let l=0;for(const a of c){if(l>=t.length)break;o.push(t.slice(l,l+a)),l+=a}return l<t.length&&o.push(t.slice(l)),o.join(" ")}function st(r){const e=ye(r);return e.length<=3?e:e.length<=6?`${e.slice(0,3)}-${e.slice(3)}`:e.length<=8?`${e.slice(0,3)}-${e.slice(3,6)}-${e.slice(6)}`:`${e.slice(0,3)}-${e.slice(3,6)}-${e.slice(6,8)}-${e.slice(8,10)}`}function Re(r,e={}){const{decimalSeparator:t=",",thousandSeparator:c=" ",precision:o=2}=e;let l=r.replace(/[^\d.,-]/g,"");l=l.replace(",",".");const i=l.split(".");let a=i[0]||"0",m=i.length>1?i[1]:"";const _=a.startsWith("-");_&&(a=a.slice(1)),a=a.replace(/^0+/,"")||"0",c&&(a=a.replace(/\B(?=(\d{3})+(?!\d))/g,c)),m=m.slice(0,o);const f=m?`${a}${t}${m}`:a;return _?`-${f}`:f}function De(r,e=" ",t=","){let c=r;e&&(c=c.split(e).join("")),c=c.replace(t,"."),c=c.replace(/[^\d.-]/g,"");const o=parseFloat(c);return isNaN(o)?null:o}function At(r,e,t){let c=0;for(let l=0;l<t&&l<r.length;l++)r[l]!==" "&&r[l]!=="-"&&c++;let o=0;for(let l=0;l<e.length;l++)if(e[l]!==" "&&e[l]!=="-"&&o++,o===c)return l+1;return e.length}function Se(r,e){return new Date(r,e+1,0).getDate()}function nt(r,e){return new Date(r,e,1).getDay()}function Ee(r,e){return r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()&&r.getDate()===e.getDate()}function ct(r,e,t){return!(e&&r<$e(e)||t&&r>$e(t))}function $e(r){return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function Ae(r,e){const t=new Date(r);return t.setMonth(t.getMonth()+e),t}function Ft(r,e){const t=new Date(r);return t.setFullYear(t.getFullYear()+e),t}const ke=r=>r.toString().padStart(2,"0");function ot(r,e="dd.MM.yyyy"){const t=ke(r.getDate()),c=ke(r.getMonth()+1),o=r.getFullYear().toString();return e.replace("dd",t).replace("MM",c).replace("yyyy",o)}function lt(r,e="dd.MM.yyyy"){const t=e.indexOf("dd"),c=e.indexOf("MM"),o=e.indexOf("yyyy");if(t===-1||c===-1||o===-1)return null;const l=parseInt(r.slice(t,t+2),10),i=parseInt(r.slice(c,c+2),10),a=parseInt(r.slice(o,o+4),10);return isNaN(l)||isNaN(i)||isNaN(a)||i<1||i>12||l<1||l>Se(a,i-1)?null:new Date(a,i-1,l)}const Pt=["Pn","Wt","Śr","Cz","Pt","So","Nd"],Bt=["Mo","Tu","We","Th","Fr","Sa","Su"],Wt=["Styczeń","Luty","Marzec","Kwiecień","Maj","Czerwiec","Lipiec","Sierpień","Wrzesień","Październik","Listopad","Grudzień"],Ht=["January","February","March","April","May","June","July","August","September","October","November","December"];function it(r="pl"){return r==="pl"?Pt:Bt}function at(r="pl"){return r==="pl"?Wt:Ht}function Fe(r){const e=r.split(":");if(e.length<2)return null;const t=parseInt(e[0],10),c=parseInt(e[1],10),o=e.length>2?parseInt(e[2],10):0;return isNaN(t)||isNaN(c)||isNaN(o)||t<0||t>23||c<0||c>59||o<0||o>59?null:{hours:t,minutes:c,seconds:o}}function Pe(r,e,t,c=!1){const o=`${ke(r)}:${ke(e)}`;return c?`${o}:${ke(t??0)}`:o}function Gt(r,e){const[t,c]=n.useState(r);return n.useEffect(()=>{const o=setTimeout(()=>c(r),e);return()=>clearTimeout(o)},[r,e]),t}function Be(r,e){const t=n.useRef(r);t.current=r;const c=n.useRef();return n.useCallback(((...o)=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>t.current(...o),e)}),[e])}function Ot(r,e){n.useEffect(()=>{const t=c=>{!r.current||r.current.contains(c.target)||e()};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[r,e])}function We({itemCount:r,onSelect:e,onClose:t,isOpen:c,loop:o=!0}){const[l,i]=n.useState(-1),a=n.useCallback(()=>i(-1),[]),m=n.useCallback(_=>{if(!(!c||r===0))switch(_.key){case"ArrowDown":{_.preventDefault(),i(f=>f>=r-1?o?0:f:f+1);break}case"ArrowUp":{_.preventDefault(),i(f=>f<=0?o?r-1:0:f-1);break}case"Enter":{_.preventDefault(),l>=0&&l<r&&e(l);break}case"Escape":{_.preventDefault(),t();break}case"Home":{_.preventDefault(),i(0);break}case"End":{_.preventDefault(),i(r-1);break}}},[c,r,l,e,t,o]);return{activeIndex:l,setActiveIndex:i,resetIndex:a,onKeyDown:m}}function dt({children:r,container:e}){const t=e??(typeof document<"u"?document.body:null);return t?xt.createPortal(r,t):null}const qt="_popover_6bjrn_2",Ut="_normal_6bjrn_17",Yt="_flipped_6bjrn_22",ze={popover:qt,normal:Ut,flipped:Yt};function Ie({open:r,anchorRef:e,onClose:t,placement:c="bottom-start",matchWidth:o=!1,offset:l=4,children:i,className:a,style:m}){const _=n.useRef(null),[f,v]=n.useState({top:0,left:0}),[j,$]=n.useState(!1),w=n.useCallback(()=>{if(!e.current||!_.current)return;const h=e.current.getBoundingClientRect(),y=_.current.getBoundingClientRect(),N={width:window.innerWidth,height:window.innerHeight},I=c.startsWith("top"),g=c.endsWith("end"),b=N.height-h.bottom-l,M=h.top-l,k=I?M<y.height&&b>M:b<y.height&&M>b;$(k);const z=I?!k:k;let W;z?W=h.top-y.height-l+window.scrollY:W=h.bottom+l+window.scrollY;let P;g?P=h.right-y.width+window.scrollX:P=h.left+window.scrollX,P=Math.max(8,Math.min(P,N.width-y.width-8)),W=Math.max(8+window.scrollY,W),v({top:W,left:P,width:o?h.width:void 0})},[e,c,l,o]);return n.useEffect(()=>{if(r)return requestAnimationFrame(w),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",w,{passive:!0}),()=>{window.removeEventListener("scroll",w),window.removeEventListener("resize",w)}},[r,w]),n.useEffect(()=>{if(!r)return;const h=y=>{y.key==="Escape"&&t()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[r,t]),n.useEffect(()=>{if(!r)return;const h=y=>{_.current&&!_.current.contains(y.target)&&e.current&&!e.current.contains(y.target)&&t()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[r,t,e]),r?s.jsx(dt,{children:s.jsx("div",{ref:_,className:A(ze.popover,j?ze.flipped:ze.normal,a),style:{position:"absolute",top:f.top,left:f.left,width:f.width,...m},role:"listbox",children:i})}):null}const Zt="_wrapper_veyo2_1",Kt="_label_veyo2_8",Jt="_labelLeft_veyo2_16",Xt="_disabled_veyo2_20",Ct="_sm_veyo2_26",Qt="_box_veyo2_26",Vt="_md_veyo2_32",er="_lg_veyo2_38",tr="_labelText_veyo2_44",rr="_boxError_veyo2_66",sr="_input_veyo2_71",nr="_checkmark_veyo2_81",cr="_checkPath_veyo2_88",or="_indeterminateMark_veyo2_93",lr="_errorText_veyo2_181",ue={wrapper:Zt,label:Kt,labelLeft:Jt,disabled:Xt,sm:Ct,box:Qt,md:Vt,lg:er,labelText:tr,boxError:rr,input:sr,checkmark:nr,checkPath:cr,indeterminateMark:or,"color-primary":"_color-primary_veyo2_122","color-success":"_color-success_veyo2_142","color-error":"_color-error_veyo2_148","color-warning":"_color-warning_veyo2_154","color-info":"_color-info_veyo2_160",errorText:lr},ir=n.forwardRef(function({checked:e,defaultChecked:t,indeterminate:c=!1,name:o,id:l,value:i,disabled:a=!1,size:m="md",color:_="primary",label:f,labelPosition:v="right",error:j=!1,errorText:$,onChange:w,className:h,style:y},N){const I=n.useRef(null),g=N??I;n.useEffect(()=>{g.current&&(g.current.indeterminate=c)},[c,g]);const b=j||!!$;return s.jsxs("div",{className:A(ue.wrapper,h),style:y,children:[s.jsxs("label",{className:A(ue.label,ue[m],v==="left"&&ue.labelLeft,a&&ue.disabled),children:[s.jsxs("span",{className:A(ue.box,ue[`color-${_}`],b&&ue.boxError),children:[s.jsx("input",{ref:g,type:"checkbox",checked:e,defaultChecked:t,name:o,id:l,value:i,disabled:a,onChange:w,className:ue.input,"aria-invalid":b||void 0}),s.jsx("svg",{className:ue.checkmark,viewBox:"0 0 16 16",fill:"none",children:s.jsx("path",{className:ue.checkPath,d:"M3.5 8L6.5 11L12.5 5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),s.jsx("span",{className:ue.indeterminateMark})]}),f&&s.jsx("span",{className:ue.labelText,children:f})]}),$&&s.jsx("span",{className:ue.errorText,role:"alert",children:$})]})}),ut=n.createContext(null);function ar(){return n.useContext(ut)}const dr="_label_1h6wb_2",ur="_labelLeft_1h6wb_11",_r="_disabled_1h6wb_15",pr="_sm_1h6wb_21",fr="_circle_1h6wb_21",hr="_md_1h6wb_22",mr="_lg_1h6wb_23",br="_labelText_1h6wb_25",xr="_dot_1h6wb_29",vr="_input_1h6wb_53",gr="_group_1h6wb_94",yr="_vertical_1h6wb_101",wr="_horizontal_1h6wb_106",Nr="_groupLabel_1h6wb_111",jr="_groupLabelError_1h6wb_118",kr="_errorText_1h6wb_122",_e={label:dr,labelLeft:ur,disabled:_r,sm:pr,circle:fr,md:hr,lg:mr,labelText:br,dot:xr,input:vr,"color-primary":"_color-primary_1h6wb_77","color-success":"_color-success_1h6wb_78","color-error":"_color-error_1h6wb_79","color-warning":"_color-warning_1h6wb_80","color-info":"_color-info_1h6wb_81",group:gr,vertical:yr,horizontal:wr,groupLabel:Nr,groupLabelError:jr,errorText:kr},$r=n.forwardRef(function({checked:e,defaultChecked:t,name:c,id:o,value:l,disabled:i=!1,size:a="md",color:m="primary",label:_,labelPosition:f="right",onChange:v,className:j,style:$},w){const h=ar(),y=(h==null?void 0:h.name)??c,N=(h==null?void 0:h.disabled)??i,I=(h==null?void 0:h.size)??a,g=(h==null?void 0:h.color)??m,b=h?h.value===l:e,M=n.useCallback(k=>{v==null||v(k),h!=null&&h.onChange&&l&&h.onChange(l)},[v,h,l]);return s.jsxs("label",{className:A(_e.label,_e[I],f==="left"&&_e.labelLeft,N&&_e.disabled,j),style:$,children:[s.jsxs("span",{className:A(_e.circle,_e[`color-${g}`]),children:[s.jsx("input",{ref:w,type:"radio",name:y,id:o,value:l,checked:b,defaultChecked:h?void 0:t,disabled:N,onChange:M,className:_e.input}),s.jsx("span",{className:_e.dot})]}),_&&s.jsx("span",{className:_e.labelText,children:_})]})});function Ir({name:r,value:e,defaultValue:t,onChange:c,direction:o="vertical",children:l,disabled:i=!1,size:a="md",color:m="primary",error:_=!1,errorText:f,label:v,className:j,style:$}){const[w,h]=n.useState(t),y=e!==void 0?e:w,N=n.useCallback(g=>{e===void 0&&h(g),c==null||c(g)},[c,e]),I=n.useMemo(()=>({name:r,value:y,disabled:i,size:a,color:m,onChange:N}),[r,y,i,a,m,N]);return s.jsx(ut.Provider,{value:I,children:s.jsxs("fieldset",{className:A(_e.group,_e[o],j),style:$,role:"radiogroup",children:[v&&s.jsx("legend",{className:A(_e.groupLabel,_&&_e.groupLabelError),children:v}),l,f&&s.jsx("span",{className:_e.errorText,role:"alert",children:f})]})})}const Er="_label_1g70g_1",Sr="_labelLeft_1g70g_10",Mr="_disabled_1g70g_14",zr="_track_1g70g_20",Tr="_sm_1g70g_32",Lr="_md_1g70g_33",Rr="_lg_1g70g_34",Dr="_knob_1g70g_36",Ar="_labelText_1g70g_40",Fr="_input_1g70g_45",xe={label:Er,labelLeft:Sr,disabled:Mr,track:zr,sm:Tr,md:Lr,lg:Rr,knob:Dr,labelText:Ar,input:Fr,"color-primary":"_color-primary_1g70g_70","color-success":"_color-success_1g70g_71","color-error":"_color-error_1g70g_72","color-warning":"_color-warning_1g70g_73","color-info":"_color-info_1g70g_74"},Pr=n.forwardRef(function({checked:e,defaultChecked:t,name:c,id:o,disabled:l=!1,size:i="md",color:a="primary",label:m,labelPosition:_="right",onChange:f,className:v,style:j},$){return s.jsxs("label",{className:A(xe.label,xe[i],_==="left"&&xe.labelLeft,l&&xe.disabled,v),style:j,children:[s.jsxs("span",{className:A(xe.track,xe[`color-${a}`]),children:[s.jsx("input",{ref:$,type:"checkbox",checked:e,defaultChecked:t,name:c,id:o,disabled:l,onChange:f,className:xe.input,role:"switch","aria-checked":e}),s.jsx("span",{className:xe.knob})]}),m&&s.jsx("span",{className:xe.labelText,children:m})]})}),Br="_wrapper_1tprv_2",Wr="_fullWidth_1tprv_10",Hr="_label_1tprv_15",Gr="_focused_1tprv_22",Or="_labelError_1tprv_26",qr="_labelSuccess_1tprv_30",Ur="_required_1tprv_34",Yr="_inputContainer_1tprv_40",Zr="_outlined_1tprv_50",Kr="_disabled_1tprv_56",Jr="_filled_1tprv_66",Xr="_underlined_1tprv_82",Cr="_inputError_1tprv_98",Qr="_inputSuccess_1tprv_106",Vr="_colorWarning_1tprv_115",es="_colorInfo_1tprv_120",ts="_sm_1tprv_126",rs="_md_1tprv_132",ss="_lg_1tprv_138",ns="_rounded_1tprv_145",cs="_input_1tprv_40",os="_startIcon_1tprv_178",ls="_endIcon_1tprv_186",is="_clearBtn_1tprv_195",as="_spinner_1tprv_214",ds="_spin_1tprv_214",us="_helperText_1tprv_232",_s="_errorTextMsg_1tprv_238",ps="_charCount_1tprv_245",fs="_charCountOver_1tprv_252",hs="_bottomRow_1tprv_257",J={wrapper:Br,fullWidth:Wr,label:Hr,focused:Gr,labelError:Or,labelSuccess:qr,required:Ur,inputContainer:Yr,outlined:Zr,disabled:Kr,filled:Jr,underlined:Xr,inputError:Cr,inputSuccess:Qr,colorWarning:Vr,colorInfo:es,sm:ts,md:rs,lg:ss,rounded:ns,input:cs,startIcon:os,endIcon:ls,clearBtn:is,spinner:as,spin:ds,helperText:us,errorTextMsg:_s,charCount:ps,charCountOver:fs,bottomRow:hs},be=n.forwardRef(function({type:e="text",value:t,defaultValue:c,name:o,id:l,placeholder:i,disabled:a=!1,readOnly:m=!1,required:_=!1,autoFocus:f=!1,autoComplete:v,inputMode:j,variant:$="outlined",size:w="md",color:h,fullWidth:y=!1,rounded:N=!1,label:I,helperText:g,errorText:b,startIcon:M,endIcon:k,clearable:z=!1,error:W=!1,success:P=!1,maxLength:G,showCharCount:T=!1,onChange:u,onFocus:x,onBlur:p,onKeyDown:d,onClear:L,loading:E=!1,className:U,style:se,inputClassName:ne,labelClassName:ee},H){const[re,R]=n.useState(!1),[O,ie]=n.useState((c==null?void 0:c.toString())??""),te=n.useRef(null),ae=t!==void 0?t.toString():O,ce=W||!!b,pe=ae.length>0,C=n.useCallback(K=>{R(!0),x==null||x(K)},[x]),me=n.useCallback(K=>{R(!1),p==null||p(K)},[p]),Y=n.useCallback(K=>{t===void 0&&ie(K.target.value),u==null||u(K)},[u,t]),S=n.useCallback(()=>{t===void 0&&ie(""),L==null||L();const K=(H==null?void 0:H.current)??te.current;K==null||K.focus()},[L,H]),F=A(J.inputContainer,J[$],J[w],re&&J.focused,ce&&J.inputError,P&&!ce&&J.inputSuccess,h==="warning"&&J.colorWarning,h==="info"&&J.colorInfo,a&&J.disabled,N&&J.rounded);return s.jsxs("div",{className:A(J.wrapper,y&&J.fullWidth,U),style:se,children:[I&&s.jsx("label",{htmlFor:l,className:A(J.label,re&&J.focused,ce&&J.labelError,P&&!ce&&J.labelSuccess,_&&J.required,ee),children:I}),s.jsxs("div",{className:F,children:[M&&s.jsx("span",{className:J.startIcon,children:M}),s.jsx("input",{ref:H??te,type:e,value:t,defaultValue:t===void 0?c:void 0,name:o,id:l,placeholder:i,disabled:a,readOnly:m,required:_,autoFocus:f,autoComplete:v,inputMode:j,maxLength:G,className:A(J.input,ne),onChange:Y,onFocus:C,onBlur:me,onKeyDown:d,"aria-invalid":ce||void 0,"aria-describedby":b?`${l}-error`:g?`${l}-helper`:void 0}),E&&s.jsx("span",{className:J.spinner}),z&&pe&&!E&&!a&&s.jsx("button",{type:"button",className:J.clearBtn,onClick:S,tabIndex:-1,"aria-label":"Clear input",children:"✕"}),k&&!E&&s.jsx("span",{className:J.endIcon,children:k})]}),(b||g||T)&&s.jsxs("div",{className:J.bottomRow,children:[s.jsxs("span",{children:[b&&s.jsx("span",{id:l?`${l}-error`:void 0,className:J.errorTextMsg,role:"alert",children:b}),!b&&g&&s.jsx("span",{id:l?`${l}-helper`:void 0,className:J.helperText,children:g})]}),T&&G&&s.jsxs("span",{className:A(J.charCount,ae.length>G&&J.charCountOver),children:[ae.length,"/",G]})]})]})}),ms="_wrapper_1bxd6_2",bs="_fullWidth_1bxd6_10",xs="_label_1bxd6_15",vs="_labelFocused_1bxd6_22",gs="_labelError_1bxd6_26",ys="_labelSuccess_1bxd6_30",ws="_required_1bxd6_34",Ns="_container_1bxd6_40",js="_outlined_1bxd6_49",ks="_disabled_1bxd6_55",$s="_focused_1bxd6_59",Is="_filled_1bxd6_65",Es="_underlined_1bxd6_81",Ss="_containerError_1bxd6_97",Ms="_containerSuccess_1bxd6_105",zs="_colorWarning_1bxd6_113",Ts="_colorInfo_1bxd6_118",Ls="_sm_1bxd6_124",Rs="_textarea_1bxd6_128",Ds="_md_1bxd6_132",As="_lg_1bxd6_140",Fs="_spinner_1bxd6_180",Ps="_spin_1bxd6_180",Bs="_bottomRow_1bxd6_200",Ws="_helperText_1bxd6_207",Hs="_errorTextMsg_1bxd6_213",Gs="_charCount_1bxd6_219",Os="_charCountOver_1bxd6_226",Q={wrapper:ms,fullWidth:bs,label:xs,labelFocused:vs,labelError:gs,labelSuccess:ys,required:ws,container:Ns,outlined:js,disabled:ks,focused:$s,filled:Is,underlined:Es,containerError:Ss,containerSuccess:Ms,colorWarning:zs,colorInfo:Ts,sm:Ls,textarea:Rs,md:Ds,lg:As,spinner:Fs,spin:Ps,bottomRow:Bs,helperText:Ws,errorTextMsg:Hs,charCount:Gs,charCountOver:Os},qs=n.forwardRef(function({value:e,defaultValue:t,name:c,id:o,placeholder:l,disabled:i=!1,readOnly:a=!1,required:m=!1,autoFocus:_=!1,rows:f=3,autoResize:v=!1,minRows:j,maxRows:$,variant:w="outlined",size:h="md",color:y,fullWidth:N=!1,label:I,helperText:g,errorText:b,error:M=!1,success:k=!1,maxLength:z,showCharCount:W=!1,loading:P=!1,onChange:G,onFocus:T,onBlur:u,className:x,style:p,textareaClassName:d,labelClassName:L},E){const[U,se]=n.useState(!1),[ne,ee]=n.useState(t??""),H=n.useRef(null),re=e!==void 0?e:ne,R=M||!!b,O=E??H,ie=n.useCallback(()=>{const C=typeof O=="function"?null:O==null?void 0:O.current;if(!C||!v)return;C.style.height="auto";const me=parseFloat(getComputedStyle(C).lineHeight)||20,Y=j?j*me:0,S=$?$*me:1/0,F=Math.min(Math.max(C.scrollHeight,Y),S);C.style.height=`${F}px`,C.style.overflowY=C.scrollHeight>F?"auto":"hidden"},[v,j,$,O]);n.useEffect(()=>{ie()},[re,ie]);const te=n.useCallback(C=>{se(!0),T==null||T(C)},[T]),ae=n.useCallback(C=>{se(!1),u==null||u(C)},[u]),ce=n.useCallback(C=>{e===void 0&&ee(C.target.value),G==null||G(C)},[G,e]),pe=A(Q.container,Q[w],Q[h],U&&Q.focused,R&&Q.containerError,k&&!R&&Q.containerSuccess,y==="warning"&&Q.colorWarning,y==="info"&&Q.colorInfo,i&&Q.disabled);return s.jsxs("div",{className:A(Q.wrapper,N&&Q.fullWidth,x),style:p,children:[I&&s.jsx("label",{htmlFor:o,className:A(Q.label,U&&Q.labelFocused,R&&Q.labelError,k&&!R&&Q.labelSuccess,m&&Q.required,L),children:I}),s.jsxs("div",{className:pe,children:[s.jsx("textarea",{ref:O,name:c,id:o,placeholder:l,disabled:i,readOnly:a,required:m,autoFocus:_,rows:v?j??f:f,maxLength:z,value:e,defaultValue:e===void 0?t:void 0,className:A(Q.textarea,d),onChange:ce,onFocus:te,onBlur:ae,"aria-invalid":R||void 0,"aria-describedby":b?`${o}-error`:g?`${o}-helper`:void 0}),P&&s.jsx("span",{className:Q.spinner})]}),(b||g||W)&&s.jsxs("div",{className:Q.bottomRow,children:[s.jsxs("span",{children:[b&&s.jsx("span",{id:o?`${o}-error`:void 0,className:Q.errorTextMsg,role:"alert",children:b}),!b&&g&&s.jsx("span",{id:o?`${o}-helper`:void 0,className:Q.helperText,children:g})]}),W&&z&&s.jsxs("span",{className:A(Q.charCount,re.length>z&&Q.charCountOver),children:[re.length,"/",z]})]})]})}),Us="_wrapper_128h5_1",Ys="_toggleBtn_128h5_7",Zs="_strengthRow_128h5_26",Ks="_strengthBar_128h5_32",Js="_strengthSegment_128h5_39",Xs="_strengthLabel_128h5_47",ve={wrapper:Us,toggleBtn:Ys,strengthRow:Zs,strengthBar:Ks,strengthSegment:Js,strengthLabel:Xs,"strength-weak":"_strength-weak_128h5_53","strength-fair":"_strength-fair_128h5_54","strength-good":"_strength-good_128h5_55","strength-strong":"_strength-strong_128h5_56"};function Cs(r){let e=0;return r.length>=8&&e++,r.length>=12&&e++,/[a-z]/.test(r)&&/[A-Z]/.test(r)&&e++,/\d/.test(r)&&e++,/[^a-zA-Z0-9]/.test(r)&&e++,e<=1?"weak":e<=2?"fair":e<=3?"good":"strong"}const Qs={weak:"Weak",fair:"Fair",good:"Good",strong:"Strong"},Vs=n.forwardRef(function({showToggle:e=!0,showStrength:t=!1,onStrengthChange:c,value:o,defaultValue:l,onChange:i,...a},m){const[_,f]=n.useState(!1),[v,j]=n.useState((l==null?void 0:l.toString())??""),$=o!==void 0?o.toString():v,w=Cs($);n.useEffect(()=>{c==null||c(w)},[w,c]);const h=n.useCallback(N=>{o===void 0&&j(N.target.value),i==null||i(N)},[i,o]),y=e?s.jsx("button",{type:"button",className:ve.toggleBtn,onClick:()=>f(N=>!N),tabIndex:-1,"aria-label":_?"Hide password":"Show password",children:_?"◠":"◉"}):void 0;return s.jsxs("div",{className:ve.wrapper,children:[s.jsx(be,{...a,ref:m,type:_?"text":"password",value:o,defaultValue:l,onChange:h,endIcon:y}),t&&$.length>0&&s.jsxs("div",{className:ve.strengthRow,children:[s.jsx("div",{className:ve.strengthBar,children:[0,1,2,3].map(N=>s.jsx("div",{className:A(ve.strengthSegment,N<["weak","fair","good","strong"].indexOf(w)+1&&ve[`strength-${w}`])},N))}),s.jsx("span",{className:A(ve.strengthLabel,ve[`strength-${w}`]),children:Qs[w]})]})]})}),en="_stepper_sau6l_1",tn="_stepBtn_sau6l_8",Te={stepper:en,stepBtn:tn};function Oe(r,e,t){return e!==void 0&&r<e?e:t!==void 0&&r>t?t:r}function qe(r,e){const t=Math.pow(10,e);return Math.round(r*t)/t}const rn=n.forwardRef(function({min:e,max:t,step:c=1,showStepper:o=!0,precision:l=0,allowNegative:i=!0,onValueChange:a,value:m,defaultValue:_,onChange:f,onKeyDown:v,onBlur:j,disabled:$=!1,...w},h){const[y,N]=n.useState((_==null?void 0:_.toString())??""),I=m!==void 0?m.toString():y,g=n.useRef(),b=n.useCallback(u=>{m===void 0&&N(u);const x=parseFloat(u);a==null||a(isNaN(x)?null:x)},[m,a]),M=n.useCallback(u=>{const x=parseFloat(I)||0,p=qe(Oe(x+c*u,e,t),l);b(p.toString())},[I,c,e,t,l,b]),k=n.useCallback(u=>{M(u),g.current=setInterval(()=>M(u),150)},[M]),z=n.useCallback(()=>{g.current&&(clearInterval(g.current),g.current=void 0)},[]);n.useEffect(()=>z,[z]);const W=n.useCallback(u=>{const p=u.target.value.replace(i?/[^\d.,-]/g:/[^\d.,]/g,"");b(p),f==null||f(u)},[f,i,b]),P=n.useCallback(u=>{const x=parseFloat(I);if(!isNaN(x)){const p=qe(Oe(x,e,t),l);b(p.toString())}j==null||j(u)},[I,e,t,l,b,j]),G=n.useCallback(u=>{u.key==="ArrowUp"?(u.preventDefault(),M(1)):u.key==="ArrowDown"&&(u.preventDefault(),M(-1)),v==null||v(u)},[M,v]),T=o&&!$?s.jsxs("div",{className:Te.stepper,children:[s.jsx("button",{type:"button",className:Te.stepBtn,onMouseDown:()=>k(1),onMouseUp:z,onMouseLeave:z,tabIndex:-1,"aria-label":"Increment",children:"▲"}),s.jsx("button",{type:"button",className:Te.stepBtn,onMouseDown:()=>k(-1),onMouseUp:z,onMouseLeave:z,tabIndex:-1,"aria-label":"Decrement",children:"▼"})]}):void 0;return s.jsx(be,{...w,ref:h,type:"text",inputMode:"decimal",value:m!==void 0?I:void 0,defaultValue:m!==void 0?void 0:_,onChange:W,onBlur:P,onKeyDown:G,endIcon:T,disabled:$})}),sn=n.forwardRef(function({debounceMs:e=300,onSearch:t,value:c,defaultValue:o,onChange:l,onKeyDown:i,onClear:a,clearable:m=!0,placeholder:_="Search...",...f},v){const[j,$]=n.useState((o==null?void 0:o.toString())??""),w=c!==void 0?c.toString():j,h=Be(b=>t==null?void 0:t(b),e),y=n.useCallback(b=>{c===void 0&&$(b.target.value),h(b.target.value),l==null||l(b)},[l,c,h]),N=n.useCallback(b=>{b.key==="Enter"&&(t==null||t(w)),i==null||i(b)},[w,t,i]),I=n.useCallback(()=>{c===void 0&&$(""),t==null||t(""),a==null||a()},[c,t,a]),g=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s.jsx("circle",{cx:"6.5",cy:"6.5",r:"5"}),s.jsx("line",{x1:"10",y1:"10",x2:"14.5",y2:"14.5"})]});return s.jsx(be,{...f,ref:v,type:"search",value:c,defaultValue:c!==void 0?void 0:o,onChange:y,onKeyDown:N,onClear:I,clearable:m,placeholder:_,startIcon:g})}),nn=n.forwardRef(function({validateOnBlur:e=!0,validateOnChange:t=!1,showValidIcon:c=!0,onValidationChange:o,value:l,defaultValue:i,onChange:a,onBlur:m,error:_,errorText:f,success:v,placeholder:j="email@example.com",...$},w){const[h,y]=n.useState((i==null?void 0:i.toString())??""),[N,I]=n.useState({valid:!0}),[g,b]=n.useState(!1),M=l!==void 0?l.toString():h,k=n.useCallback(p=>{const d=Ze(p);return I(d),o==null||o(d),d},[o]),z=n.useCallback(p=>{l===void 0&&y(p.target.value),t&&g&&k(p.target.value),a==null||a(p)},[a,l,t,g,k]),W=n.useCallback(p=>{b(!0),e&&p.target.value&&k(p.target.value),m==null||m(p)},[m,e,k]),P=_||g&&!N.valid,G=f||(g&&!N.valid?N.error:void 0),T=!P&&v!==void 0?v:g&&N.valid&&M.length>0,u=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("rect",{x:"1",y:"3",width:"14",height:"10",rx:"2"}),s.jsx("path",{d:"M1 5L8 9L15 5"})]}),x=c&&T?s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--mineral-success)",strokeWidth:"2",children:s.jsx("path",{d:"M3 8L6.5 11.5L13 4.5"})}):void 0;return s.jsx(be,{...$,ref:w,type:"email",value:l,defaultValue:l!==void 0?void 0:i,onChange:z,onBlur:W,error:P,errorText:G,success:T,placeholder:j,startIcon:u,endIcon:x})}),cn="_prefix_35ls9_1",on={prefix:cn},ln=n.forwardRef(function({countryCode:e="PL",showCountryCode:t=!0,formatOnChange:c=!0,validateOnBlur:o=!0,onValidationChange:l,onValueChange:i,value:a,defaultValue:m,onChange:_,onBlur:f,error:v,errorText:j,placeholder:$="123 456 789",...w},h){const[y,N]=n.useState((m==null?void 0:m.toString())??""),[I,g]=n.useState({valid:!0}),[b,M]=n.useState(!1),k=a!==void 0?a.toString():y,z=n.useCallback(p=>{const d=ye(p.target.value),L=c?rt(d,{countryCode:e}):d;a===void 0&&N(L),i==null||i(d,L),_==null||_(p)},[_,a,c,e,i]),W=n.useCallback(p=>{if(M(!0),o&&k){const d=Ke(ye(k),e);g(d),l==null||l(d)}f==null||f(p)},[f,o,k,e,l]),P={PL:"+48",DE:"+49",US:"+1",GB:"+44",FR:"+33",CZ:"+420",SK:"+421"},G=t?s.jsx("span",{className:on.prefix,children:P[e.toUpperCase()]??`+${e}`}):void 0,T=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("path",{d:"M3 1.5h10a1 1 0 011 1v11a1 1 0 01-1 1H3a1 1 0 01-1-1v-11a1 1 0 011-1z"}),s.jsx("line",{x1:"5",y1:"12",x2:"11",y2:"12"})]}),u=v||b&&!I.valid,x=j||(b&&!I.valid?I.error:void 0);return s.jsx(be,{...w,ref:h,type:"tel",value:a!==void 0?k:void 0,defaultValue:a!==void 0?void 0:m,onChange:z,onBlur:W,error:u,errorText:x,placeholder:$,startIcon:t?G:T})}),an=n.forwardRef(function({autoCapitalize:e=!0,allowNumbers:t=!1,allowSpecialChars:c=!1,minWords:o,validateOnBlur:l=!0,onValidationChange:i,value:a,defaultValue:m,onChange:_,onBlur:f,error:v,errorText:j,placeholder:$="Jan Kowalski",...w},h){const[y,N]=n.useState((m==null?void 0:m.toString())??""),[I,g]=n.useState({valid:!0}),[b,M]=n.useState(!1),k=a!==void 0?a.toString():y,z=n.useCallback(x=>{let p=x;return t||(p=p.replace(/\d/g,"")),c||(p=p.replace(/[^a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ\s'-]/g,"")),e&&(p=Ve(p)),p},[t,c,e]),W=n.useCallback(x=>{const p=z(x.target.value);a===void 0&&N(p),_==null||_(x)},[_,a,z]),P=n.useCallback(x=>{if(M(!0),l&&k){const p=k.trim().split(/\s+/).filter(Boolean);if(o&&p.length<o){const d={valid:!1,error:`Enter at least ${o} word${o>1?"s":""}`};g(d),i==null||i(d)}else{const d={valid:!0};g(d),i==null||i(d)}}f==null||f(x)},[f,l,k,o,i]),G=v||b&&!I.valid,T=j||(b&&!I.valid?I.error:void 0),u=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("circle",{cx:"8",cy:"5",r:"3"}),s.jsx("path",{d:"M2 14c0-3 2.5-5 6-5s6 2 6 5"})]});return s.jsx(be,{...w,ref:h,type:"text",value:a!==void 0?k:void 0,defaultValue:a!==void 0?void 0:m,onChange:W,onBlur:P,error:G,errorText:T,placeholder:$,startIcon:u})}),dn=n.forwardRef(function({formatOnChange:e=!0,validateOnBlur:t=!0,showValidIcon:c=!0,onValidationChange:o,onValueChange:l,value:i,defaultValue:a,onChange:m,onBlur:_,error:f,errorText:v,success:j,placeholder:$="PL00 0000 0000 0000 0000 0000 0000",...w},h){const[y,N]=n.useState((a==null?void 0:a.toString())??""),[I,g]=n.useState({valid:!0}),[b,M]=n.useState(!1),k=i!==void 0?i.toString():y,z=n.useCallback(p=>{const L=p.target.value.replace(/[^a-zA-Z0-9\s]/g,"").toUpperCase().replace(/\s/g,""),E=e?et(L):L;i===void 0&&N(E),l==null||l(L,E),m==null||m(p)},[m,i,e,l]),W=n.useCallback(p=>{if(M(!0),t&&k){const d=Je(tt(k));g(d),o==null||o(d)}_==null||_(p)},[_,t,k,o]),P=f||b&&!I.valid,G=v||(b&&!I.valid?I.error:void 0),T=!P&&(j!==void 0?j:b&&I.valid&&k.length>0),u=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("path",{d:"M1 14h14"}),s.jsx("path",{d:"M2 6h12"}),s.jsx("path",{d:"M8 2L1 6h14L8 2z"}),s.jsx("path",{d:"M3 6v8M6 6v8M10 6v8M13 6v8"})]}),x=c&&T?s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--mineral-success)",strokeWidth:"2",children:s.jsx("path",{d:"M3 8L6.5 11.5L13 4.5"})}):void 0;return s.jsx(be,{...w,ref:h,type:"text",value:i!==void 0?k:void 0,defaultValue:i!==void 0?void 0:a,onChange:z,onBlur:W,error:P,errorText:G,success:T,placeholder:$,startIcon:u,endIcon:x,maxLength:42})}),un={NIP:Xe,PESEL:Ce,REGON:Qe},_n={NIP:13,PESEL:11,REGON:14},pn={NIP:"123-456-78-19",PESEL:"00000000000",REGON:"000000000"},fn=n.forwardRef(function({taxIdType:e,formatOnChange:t=!0,validateOnBlur:c=!0,showValidIcon:o=!0,onValidationChange:l,onValueChange:i,value:a,defaultValue:m,onChange:_,onBlur:f,error:v,errorText:j,success:$,placeholder:w,...h},y){const[N,I]=n.useState((m==null?void 0:m.toString())??""),[g,b]=n.useState({valid:!0}),[M,k]=n.useState(!1),z=a!==void 0?a.toString():N,W=n.useCallback(d=>{const L=ye(d.target.value),E=t&&e==="NIP"?st(L):L;a===void 0&&I(E),i==null||i(L),_==null||_(d)},[_,a,t,e,i]),P=n.useCallback(d=>{if(k(!0),c&&z){const L=un[e],E=L(ye(z));b(E),l==null||l(E)}f==null||f(d)},[f,c,z,e,l]),G=v||M&&!g.valid,T=j||(M&&!g.valid?g.error:void 0),u=!G&&($!==void 0?$:M&&g.valid&&z.length>0),x=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("rect",{x:"1",y:"3",width:"14",height:"10",rx:"2"}),s.jsx("line",{x1:"4",y1:"7",x2:"8",y2:"7"}),s.jsx("line",{x1:"4",y1:"10",x2:"12",y2:"10"})]}),p=o&&u?s.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"var(--mineral-success)",strokeWidth:"2",children:s.jsx("path",{d:"M3 8L6.5 11.5L13 4.5"})}):void 0;return s.jsx(be,{...h,ref:y,type:"text",inputMode:"numeric",value:a!==void 0?z:void 0,defaultValue:a!==void 0?void 0:m,onChange:W,onBlur:P,error:G,errorText:T,success:u,placeholder:w??pn[e],startIcon:x,endIcon:p,maxLength:_n[e]})}),hn="_symbol_57l8s_1",mn={symbol:hn},bn=n.forwardRef(function({currency:e,currencySymbol:t,currencyPosition:c="end",decimalSeparator:o=",",thousandSeparator:l=" ",precision:i=2,min:a,max:m,allowNegative:_=!1,onValueChange:f,value:v,defaultValue:j,onChange:$,onBlur:w,placeholder:h="0,00",startIcon:y,endIcon:N,...I},g){const[b,M]=n.useState((j==null?void 0:j.toString())??""),k=v!==void 0?v.toString():b,z=t??e??"",W=n.useCallback(T=>{const u=T.target.value;let x="",p=!1;for(const E of u)E>="0"&&E<="9"?x+=E:(E===","||E===".")&&!p?(x+=o,p=!0):E==="-"&&_&&x.length===0&&(x+="-");const d=Re(x,{decimalSeparator:o,thousandSeparator:l,precision:i});v===void 0&&M(d);const L=De(d,l,o);f==null||f(L),$==null||$(T)},[$,v,o,l,i,_,f]),P=n.useCallback(T=>{let u=De(k,l,o);if(u!==null){a!==void 0&&u<a&&(u=a),m!==void 0&&u>m&&(u=m);const x=u.toFixed(i).replace(".",o),p=Re(x,{decimalSeparator:o,thousandSeparator:l,precision:i});v===void 0&&M(p),f==null||f(u)}w==null||w(T)},[k,a,m,i,o,l,v,f,w]),G=z?s.jsx("span",{className:mn.symbol,children:z}):void 0;return s.jsx(be,{...I,ref:g,type:"text",inputMode:"decimal",value:v!==void 0?k:void 0,defaultValue:v!==void 0?void 0:j,onChange:W,onBlur:P,placeholder:h,startIcon:c==="start"?G:y,endIcon:c==="end"?G:N})}),xn="_wrapper_1xcc1_1",vn="_fullWidth_1xcc1_9",gn="_label_1xcc1_12",yn="_labelFocused_1xcc1_19",wn="_labelError_1xcc1_20",Nn="_required_1xcc1_21",jn="_trigger_1xcc1_24",kn="_outlined_1xcc1_36",$n="_disabled_1xcc1_41",In="_focused_1xcc1_42",En="_filled_1xcc1_44",Sn="_underlined_1xcc1_53",Mn="_sm_1xcc1_63",zn="_md_1xcc1_64",Tn="_lg_1xcc1_65",Ln="_triggerError_1xcc1_67",Rn="_value_1xcc1_73",Dn="_placeholder_1xcc1_82",An="_tags_1xcc1_85",Fn="_tag_1xcc1_85",Pn="_arrow_1xcc1_104",Bn="_arrowOpen_1xcc1_111",Wn="_clearBtn_1xcc1_114",Hn="_spinner_1xcc1_133",Gn="_spin_1xcc1_133",On="_dropdown_1xcc1_147",qn="_searchBox_1xcc1_152",Un="_searchInput_1xcc1_157",Yn="_optionsList_1xcc1_172",Zn="_option_1xcc1_172",Kn="_optionActive_1xcc1_185",Jn="_optionSelected_1xcc1_186",Xn="_optionDisabled_1xcc1_187",Cn="_checkbox_1xcc1_190",Qn="_checkboxChecked_1xcc1_204",Vn="_groupHeader_1xcc1_210",ec="_noOptions_1xcc1_220",tc="_bottomRow_1xcc1_228",rc="_helperText_1xcc1_233",sc="_errorTextMsg_1xcc1_234",q={wrapper:xn,fullWidth:vn,label:gn,labelFocused:yn,labelError:wn,required:Nn,trigger:jn,outlined:kn,disabled:$n,focused:In,filled:En,underlined:Sn,sm:Mn,md:zn,lg:Tn,triggerError:Ln,value:Rn,placeholder:Dn,tags:An,tag:Fn,arrow:Pn,arrowOpen:Bn,clearBtn:Wn,spinner:Hn,spin:Gn,dropdown:On,searchBox:qn,searchInput:Un,optionsList:Yn,option:Zn,optionActive:Kn,optionSelected:Jn,optionDisabled:Xn,checkbox:Cn,checkboxChecked:Qn,groupHeader:Vn,noOptions:ec,bottomRow:tc,helperText:rc,errorTextMsg:sc};function nc({options:r,value:e,defaultValue:t,onChange:c,multiple:o=!1,searchable:l=!1,placeholder:i="Select...",disabled:a=!1,name:m,id:_,variant:f="outlined",size:v="md",color:j,fullWidth:$=!1,label:w,helperText:h,errorText:y,error:N=!1,required:I=!1,loading:g=!1,clearable:b=!1,maxHeight:M=300,noOptionsText:k="No options",renderOption:z,renderValue:W,className:P,style:G}){const[T,u]=n.useState(!1),[x,p]=n.useState(t??(o?[]:"")),[d,L]=n.useState(""),E=n.useRef(null),U=e!==void 0?e:x,se=N||!!y,ne=n.useMemo(()=>Array.isArray(U)?U:U?[U]:[],[U]),ee=n.useMemo(()=>r.filter(Y=>ne.includes(Y.value)),[r,ne]),H=n.useMemo(()=>{if(!l||!d)return r;const Y=d.toLowerCase();return r.filter(S=>S.label.toLowerCase().includes(Y))},[r,l,d]),re=n.useMemo(()=>{const Y=new Map;for(const S of H){const F=S.group??"";Y.has(F)||Y.set(F,[]),Y.get(F).push(S)}return Y},[H]),R=H,O=n.useCallback(Y=>{const S=R[Y];if(!(!S||S.disabled))if(o){const F=Array.isArray(U)?U:[],K=F.includes(S.value)?F.filter(de=>de!==S.value):[...F,S.value];e===void 0&&p(K),c==null||c(K)}else e===void 0&&p(S.value),c==null||c(S.value),u(!1),L("")},[R,o,U,e,c]),{activeIndex:ie,setActiveIndex:te,resetIndex:ae,onKeyDown:ce}=We({itemCount:R.length,onSelect:O,onClose:()=>{u(!1),L("")},isOpen:T}),pe=n.useCallback(()=>{a||(u(Y=>!Y),ae())},[a,ae]),C=n.useCallback(Y=>{Y.stopPropagation();const S=o?[]:"";e===void 0&&p(S),c==null||c(S)},[o,e,c]),me=n.useMemo(()=>W&&ee.length>0?W(o?ee:ee[0]):o&&ee.length>0?s.jsx("span",{className:q.tags,children:ee.map(Y=>s.jsx("span",{className:q.tag,children:Y.label},Y.value))}):!o&&ee.length>0?ee[0].label:s.jsx("span",{className:q.placeholder,children:i}),[ee,o,W,i]);return s.jsxs("div",{className:A(q.wrapper,$&&q.fullWidth,P),style:G,children:[w&&s.jsx("label",{htmlFor:_,className:A(q.label,T&&q.labelFocused,se&&q.labelError,I&&q.required),children:w}),s.jsxs("div",{ref:E,className:A(q.trigger,q[f],q[v],T&&q.focused,se&&q.triggerError,a&&q.disabled),onClick:pe,onKeyDown:ce,tabIndex:a?-1:0,role:"combobox","aria-expanded":T,"aria-haspopup":"listbox","aria-invalid":se||void 0,id:_,children:[s.jsx("span",{className:q.value,children:me}),g&&s.jsx("span",{className:q.spinner}),b&&ne.length>0&&!g&&!a&&s.jsx("button",{type:"button",className:q.clearBtn,onClick:C,tabIndex:-1,"aria-label":"Clear selection",children:"✕"}),s.jsx("span",{className:A(q.arrow,T&&q.arrowOpen),children:"▾"})]}),m&&s.jsx("input",{type:"hidden",name:m,value:Array.isArray(U)?U.join(","):U}),s.jsx(Ie,{open:T,anchorRef:E,onClose:()=>{u(!1),L("")},matchWidth:!0,placement:"bottom-start",children:s.jsxs("div",{style:{maxHeight:M},className:q.dropdown,children:[l&&s.jsx("div",{className:q.searchBox,children:s.jsx("input",{type:"text",className:q.searchInput,placeholder:"Search...",value:d,onChange:Y=>{L(Y.target.value),te(0)},onKeyDown:ce,autoFocus:!0})}),R.length===0?s.jsx("div",{className:q.noOptions,children:k}):s.jsx("div",{className:q.optionsList,role:"listbox",children:[...re.entries()].map(([Y,S])=>s.jsxs("div",{children:[Y&&s.jsx("div",{className:q.groupHeader,children:Y}),S.map(F=>{const K=R.indexOf(F),de=K===ie,fe=ne.includes(F.value);return s.jsxs("div",{className:A(q.option,de&&q.optionActive,fe&&q.optionSelected,F.disabled&&q.optionDisabled),onClick:()=>!F.disabled&&O(K),onMouseEnter:()=>te(K),role:"option","aria-selected":fe,"aria-disabled":F.disabled,children:[o&&s.jsx("span",{className:A(q.checkbox,fe&&q.checkboxChecked),children:fe&&"✓"}),z?z(F,de,fe):F.label]},F.value)})]},Y))})]})}),(y||h)&&s.jsx("div",{className:q.bottomRow,children:y?s.jsx("span",{className:q.errorTextMsg,role:"alert",children:y}):s.jsx("span",{className:q.helperText,children:h})})]})}const cc="_wrapper_m0r1z_1",oc="_fullWidth_m0r1z_9",lc="_label_m0r1z_11",ic="_labelFocused_m0r1z_18",ac="_labelError_m0r1z_19",dc="_required_m0r1z_20",uc="_inputWrapper_m0r1z_23",_c="_outlined_m0r1z_34",pc="_disabled_m0r1z_35",fc="_focused_m0r1z_36",hc="_filled_m0r1z_38",mc="_underlined_m0r1z_45",bc="_sm_m0r1z_49",xc="_md_m0r1z_50",vc="_lg_m0r1z_51",gc="_inputError_m0r1z_53",yc="_input_m0r1z_23",wc="_tags_m0r1z_71",Nc="_tag_m0r1z_71",jc="_tagRemove_m0r1z_85",kc="_spinner_m0r1z_100",$c="_spin_m0r1z_100",Ic="_clearBtn_m0r1z_112",Ec="_dropdown_m0r1z_124",Sc="_optionsList_m0r1z_126",Mc="_option_m0r1z_126",zc="_optionActive_m0r1z_136",Tc="_optionSelected_m0r1z_137",Lc="_noOptions_m0r1z_139",Rc="_loadingMsg_m0r1z_139",Dc="_bottomRow_m0r1z_146",Ac="_helperText_m0r1z_147",Fc="_errorTextMsg_m0r1z_148",Z={wrapper:cc,fullWidth:oc,label:lc,labelFocused:ic,labelError:ac,required:dc,inputWrapper:uc,outlined:_c,disabled:pc,focused:fc,filled:hc,underlined:mc,sm:bc,md:xc,lg:vc,inputError:gc,input:yc,tags:wc,tag:Nc,tagRemove:jc,spinner:kc,spin:$c,clearBtn:Ic,dropdown:Ec,optionsList:Sc,option:Mc,optionActive:zc,optionSelected:Tc,noOptions:Lc,loadingMsg:Rc,bottomRow:Dc,helperText:Ac,errorTextMsg:Fc};function Pc(r){return typeof r=="string"?r:String(r)}function Bc(r){return typeof r=="string"?r:String(r)}function Wc(r,e,t){if(!e)return r;const c=e.toLowerCase();return r.filter(o=>t(o).toLowerCase().includes(c))}function Hc({options:r,value:e,onChange:t,getOptionLabel:c=Pc,getOptionValue:o=Bc,filterOptions:l,multiple:i=!1,freeSolo:a=!1,debounceMs:m=0,onInputChange:_,loading:f=!1,loadingText:v="Loading...",noOptionsText:j="No options",placeholder:$="Type to search...",disabled:w=!1,name:h,id:y,variant:N="outlined",size:I="md",fullWidth:g=!1,label:b,helperText:M,errorText:k,error:z=!1,required:W=!1,clearable:P=!1,maxHeight:G=300,renderOption:T,renderTags:u,className:x,style:p}){const[d,L]=n.useState(!1),[E,U]=n.useState(""),se=n.useRef(null),ne=n.useRef(null),ee=z||!!k,H=n.useMemo(()=>e===void 0?[]:Array.isArray(e)?e:[e],[e]),re=n.useMemo(()=>l?l(r,E):Wc(r,E,c),[r,E,l,c]),R=Be(S=>_==null?void 0:_(S),m),O=n.useCallback(S=>{U(S.target.value),R(S.target.value),d||L(!0)},[d,R]),ie=n.useCallback(S=>{var K;const F=re[S];if(F){if(i){const de=[...H],fe=o(F),D=de.findIndex(oe=>o(oe)===fe);D>=0?de.splice(D,1):de.push(F),t==null||t(de),U("")}else t==null||t(F),U(c(F)),L(!1);(K=ne.current)==null||K.focus()}},[re,i,H,o,c,t]),te=n.useCallback(S=>{const F=[...H];F.splice(S,1),t==null||t(i?F:F[0]??"")},[H,t,i]),{activeIndex:ae,setActiveIndex:ce,resetIndex:pe,onKeyDown:C}=We({itemCount:re.length,onSelect:ie,onClose:()=>L(!1),isOpen:d}),me=n.useCallback(S=>{if(S.key==="Enter"&&a&&ae<0&&E){t==null||t(E),L(!1);return}if(S.key==="Backspace"&&i&&!E&&H.length>0){te(H.length-1);return}C(S)},[a,ae,E,i,H,t,C,te]),Y=n.useCallback(S=>{var F;S.stopPropagation(),U(""),t==null||t(i?[]:""),(F=ne.current)==null||F.focus()},[i,t]);return s.jsxs("div",{className:A(Z.wrapper,g&&Z.fullWidth,x),style:p,children:[b&&s.jsx("label",{htmlFor:y,className:A(Z.label,d&&Z.labelFocused,ee&&Z.labelError,W&&Z.required),children:b}),s.jsxs("div",{ref:se,className:A(Z.inputWrapper,Z[N],Z[I],d&&Z.focused,ee&&Z.inputError,w&&Z.disabled),onClick:()=>{var S;return(S=ne.current)==null?void 0:S.focus()},children:[i&&H.length>0&&(u?u(H,te):s.jsx("span",{className:Z.tags,children:H.map((S,F)=>s.jsxs("span",{className:Z.tag,children:[c(S),s.jsx("button",{type:"button",className:Z.tagRemove,onClick:K=>{K.stopPropagation(),te(F)},tabIndex:-1,children:"✕"})]},o(S)))})),s.jsx("input",{ref:ne,type:"text",className:Z.input,value:E,onChange:O,onFocus:()=>{L(!0),pe()},onKeyDown:me,placeholder:H.length>0?"":$,disabled:w,id:y,"aria-expanded":d,"aria-haspopup":"listbox","aria-invalid":ee||void 0,autoComplete:"off"}),f&&s.jsx("span",{className:Z.spinner}),P&&(H.length>0||E)&&!f&&!w&&s.jsx("button",{type:"button",className:Z.clearBtn,onClick:Y,tabIndex:-1,children:"✕"})]}),h&&s.jsx("input",{type:"hidden",name:h,value:H.map(o).join(",")}),s.jsx(Ie,{open:d&&(re.length>0||f),anchorRef:se,onClose:()=>L(!1),matchWidth:!0,placement:"bottom-start",children:s.jsx("div",{style:{maxHeight:G},className:Z.dropdown,children:f?s.jsx("div",{className:Z.loadingMsg,children:v}):re.length===0?s.jsx("div",{className:Z.noOptions,children:j}):s.jsx("div",{className:Z.optionsList,role:"listbox",children:re.map((S,F)=>{const K=F===ae,de=H.some(fe=>o(fe)===o(S));return s.jsx("div",{className:A(Z.option,K&&Z.optionActive,de&&Z.optionSelected),onClick:()=>ie(F),onMouseEnter:()=>ce(F),role:"option","aria-selected":de,children:T?T(S,K):c(S)},o(S))})})})}),(k||M)&&s.jsx("div",{className:Z.bottomRow,children:k?s.jsx("span",{className:Z.errorTextMsg,role:"alert",children:k}):s.jsx("span",{className:Z.helperText,children:M})})]})}const Gc="_wrapper_1hzpa_1",Oc="_fullWidth_1hzpa_9",qc="_label_1hzpa_11",Uc="_labelFocused_1hzpa_18",Yc="_labelError_1hzpa_19",Zc="_required_1hzpa_20",Kc="_trigger_1hzpa_23",Jc="_outlined_1hzpa_31",Xc="_disabled_1hzpa_32",Cc="_focused_1hzpa_33",Qc="_filled_1hzpa_35",Vc="_underlined_1hzpa_42",eo="_sm_1hzpa_45",to="_md_1hzpa_46",ro="_lg_1hzpa_47",so="_triggerError_1hzpa_49",no="_icon_1hzpa_52",co="_input_1hzpa_60",oo="_clearBtn_1hzpa_74",lo="_calendar_1hzpa_84",io="_calendarHeader_1hzpa_90",ao="_navBtn_1hzpa_97",uo="_headerTitle_1hzpa_114",_o="_dayNames_1hzpa_130",po="_dayName_1hzpa_130",fo="_dayGrid_1hzpa_146",ho="_day_1hzpa_130",mo="_dayDisabled_1hzpa_168",bo="_daySelected_1hzpa_168",xo="_dayOtherMonth_1hzpa_172",vo="_dayToday_1hzpa_174",go="_monthGrid_1hzpa_187",yo="_monthCell_1hzpa_193",wo="_monthSelected_1hzpa_206",No="_footer_1hzpa_209",jo="_todayBtn_1hzpa_217",ko="_bottomRow_1hzpa_233",$o="_helperText_1hzpa_234",Io="_errorTextMsg_1hzpa_235",B={wrapper:Gc,fullWidth:Oc,label:qc,labelFocused:Uc,labelError:Yc,required:Zc,trigger:Kc,outlined:Jc,disabled:Xc,focused:Cc,filled:Qc,underlined:Vc,sm:eo,md:to,lg:ro,triggerError:so,icon:no,input:co,clearBtn:oo,calendar:lo,calendarHeader:io,navBtn:ao,headerTitle:uo,dayNames:_o,dayName:po,dayGrid:fo,day:ho,dayDisabled:mo,daySelected:bo,dayOtherMonth:xo,dayToday:vo,monthGrid:go,monthCell:yo,monthSelected:wo,footer:No,todayBtn:jo,bottomRow:ko,helperText:$o,errorTextMsg:Io};function Ne(r){if(!r)return null;if(r instanceof Date)return r;const e=new Date(r);return isNaN(e.getTime())?null:e}function Eo({value:r,defaultValue:e,onChange:t,format:c="dd.MM.yyyy",locale:o="pl",min:l,max:i,disabledDates:a,placeholder:m,disabled:_=!1,readOnly:f=!1,name:v,id:j,variant:$="outlined",size:w="md",label:h,helperText:y,errorText:N,error:I=!1,required:g=!1,clearable:b=!1,inline:M=!1,showTodayButton:k=!0,firstDayOfWeek:z=1,fullWidth:W=!1,className:P,style:G}){const[T,u]=n.useState(!1),[x,p]=n.useState(Ne(e)),[d,L]=n.useState(""),[E,U]=n.useState(()=>{const D=Ne(r)??Ne(e)??new Date;return new Date(D.getFullYear(),D.getMonth(),1)}),[se,ne]=n.useState("days"),ee=n.useRef(null),H=Ne(r)??x,re=Ne(l),R=Ne(i),O=I||!!N,ie=n.useMemo(()=>d||(H?ot(H,c):""),[H,c,d]),te=it(o),ae=at(o),ce=n.useCallback(D=>ct(D,re,R)?Array.isArray(a)?a.some(oe=>Ee(oe,D)):typeof a=="function"?a(D):!1:!0,[re,R,a]),pe=n.useCallback(D=>{ce(D)||(r===void 0&&p(D),L(""),t==null||t(D),M||u(!1))},[r,t,M,ce]),C=n.useCallback(D=>{L(D.target.value)},[]),me=n.useCallback(()=>{if(d){const D=lt(d,c);D&&!ce(D)&&pe(D),L("")}},[d,c,ce,pe]),Y=n.useCallback(D=>{D.stopPropagation(),r===void 0&&p(null),L(""),t==null||t(null)},[r,t]),S=n.useCallback(()=>{const D=$e(new Date);pe(D),U(new Date(D.getFullYear(),D.getMonth(),1))},[pe]),F=n.useMemo(()=>{const D=E.getFullYear(),oe=E.getMonth(),Me=Se(D,oe);let we=nt(D,oe);z===1&&(we=we===0?6:we-1);const ge=[],je=oe===0?11:oe-1,He=oe===0?D-1:D,ft=Se(He,je);for(let he=we-1;he>=0;he--)ge.push({date:new Date(He,je,ft-he),currentMonth:!1});for(let he=1;he<=Me;he++)ge.push({date:new Date(D,oe,he),currentMonth:!0});const ht=42-ge.length,mt=oe===11?0:oe+1,bt=oe===11?D+1:D;for(let he=1;he<=ht;he++)ge.push({date:new Date(bt,mt,he),currentMonth:!1});return ge},[E,z]),K=$e(new Date),de=()=>s.jsxs("div",{className:B.calendar,children:[s.jsxs("div",{className:B.calendarHeader,children:[s.jsx("button",{type:"button",className:B.navBtn,onClick:()=>U(Ae(E,-1)),"aria-label":"Previous month",children:"‹"}),s.jsxs("button",{type:"button",className:B.headerTitle,onClick:()=>ne(se==="days"?"months":"days"),children:[ae[E.getMonth()]," ",E.getFullYear()]}),s.jsx("button",{type:"button",className:B.navBtn,onClick:()=>U(Ae(E,1)),"aria-label":"Next month",children:"›"})]}),se==="days"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:B.dayNames,children:te.map(D=>s.jsx("span",{className:B.dayName,children:D},D))}),s.jsx("div",{className:B.dayGrid,children:F.map(({date:D,currentMonth:oe},Me)=>{const we=H&&Ee(D,H),ge=Ee(D,K),je=ce(D);return s.jsx("button",{type:"button",className:A(B.day,!oe&&B.dayOtherMonth,ge&&B.dayToday,we&&B.daySelected,je&&B.dayDisabled),onClick:()=>pe(D),disabled:je,tabIndex:-1,children:D.getDate()},Me)})})]}),se==="months"&&s.jsx("div",{className:B.monthGrid,children:ae.map((D,oe)=>s.jsx("button",{type:"button",className:A(B.monthCell,E.getMonth()===oe&&B.monthSelected),onClick:()=>{U(new Date(E.getFullYear(),oe,1)),ne("days")},children:D.slice(0,3)},D))}),k&&s.jsx("div",{className:B.footer,children:s.jsx("button",{type:"button",className:B.todayBtn,onClick:S,children:"Today"})})]}),fe=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("rect",{x:"1",y:"3",width:"14",height:"12",rx:"2"}),s.jsx("line",{x1:"1",y1:"7",x2:"15",y2:"7"}),s.jsx("line",{x1:"5",y1:"1",x2:"5",y2:"4"}),s.jsx("line",{x1:"11",y1:"1",x2:"11",y2:"4"})]});return M?s.jsxs("div",{className:A(B.wrapper,W&&B.fullWidth,P),style:G,children:[h&&s.jsx("label",{className:A(B.label,O&&B.labelError,g&&B.required),children:h}),de()]}):s.jsxs("div",{className:A(B.wrapper,W&&B.fullWidth,P),style:G,children:[h&&s.jsx("label",{htmlFor:j,className:A(B.label,T&&B.labelFocused,O&&B.labelError,g&&B.required),children:h}),s.jsxs("div",{ref:ee,className:A(B.trigger,B[$],B[w],T&&B.focused,O&&B.triggerError,_&&B.disabled),onClick:()=>!_&&!f&&u(!0),children:[s.jsx("span",{className:B.icon,children:fe}),s.jsx("input",{type:"text",className:B.input,value:ie,onChange:C,onBlur:me,placeholder:m??c.toLowerCase(),disabled:_,readOnly:f,id:j,"aria-invalid":O||void 0}),b&&H&&!_&&s.jsx("button",{type:"button",className:B.clearBtn,onClick:Y,tabIndex:-1,children:"✕"})]}),v&&H&&s.jsx("input",{type:"hidden",name:v,value:H.toISOString().split("T")[0]}),s.jsx(Ie,{open:T,anchorRef:ee,onClose:()=>u(!1),placement:"bottom-start",children:de()}),(N||y)&&s.jsx("div",{className:B.bottomRow,children:N?s.jsx("span",{className:B.errorTextMsg,role:"alert",children:N}):s.jsx("span",{className:B.helperText,children:y})})]})}const So="_wrapper_t0rzi_1",Mo="_fullWidth_t0rzi_9",zo="_label_t0rzi_11",To="_labelFocused_t0rzi_18",Lo="_labelError_t0rzi_19",Ro="_required_t0rzi_20",Do="_trigger_t0rzi_23",Ao="_outlined_t0rzi_30",Fo="_disabled_t0rzi_31",Po="_focused_t0rzi_32",Bo="_filled_t0rzi_34",Wo="_underlined_t0rzi_41",Ho="_sm_t0rzi_44",Go="_md_t0rzi_45",Oo="_lg_t0rzi_46",qo="_triggerError_t0rzi_48",Uo="_icon_t0rzi_51",Yo="_input_t0rzi_59",Zo="_clearBtn_t0rzi_71",Ko="_columns_t0rzi_81",Jo="_column_t0rzi_81",Xo="_columnLabel_t0rzi_94",Co="_columnList_t0rzi_104",Qo="_columnItem_t0rzi_111",Vo="_columnItemSelected_t0rzi_129",el="_bottomRow_t0rzi_136",tl="_helperText_t0rzi_137",rl="_errorTextMsg_t0rzi_138",X={wrapper:So,fullWidth:Mo,label:zo,labelFocused:To,labelError:Lo,required:Ro,trigger:Do,outlined:Ao,disabled:Fo,focused:Po,filled:Bo,underlined:Wo,sm:Ho,md:Go,lg:Oo,triggerError:qo,icon:Uo,input:Yo,clearBtn:Zo,columns:Ko,column:Jo,columnLabel:Xo,columnList:Co,columnItem:Qo,columnItemSelected:Vo,bottomRow:el,helperText:tl,errorTextMsg:rl};function sl({value:r,defaultValue:e,onChange:t,format:c="24h",showSeconds:o=!1,minuteStep:l=1,min:i,max:a,placeholder:m,disabled:_=!1,readOnly:f=!1,name:v,id:j,variant:$="outlined",size:w="md",label:h,helperText:y,errorText:N,error:I=!1,required:g=!1,clearable:b=!1,fullWidth:M=!1,className:k,style:z}){const[W,P]=n.useState(!1),[G,T]=n.useState(e??""),u=n.useRef(null),x=r!==void 0?r:G,p=I||!!N,d=Fe(x),L=n.useMemo(()=>{const R=[],O=c==="12h"?12:23,ie=c==="12h"?1:0;for(let te=ie;te<=O;te++)R.push(te);return R},[c]),E=n.useMemo(()=>{const R=[];for(let O=0;O<60;O+=l)R.push(O);return R},[l]),U=n.useMemo(()=>{if(!o)return[];const R=[];for(let O=0;O<60;O++)R.push(O);return R},[o]),se=n.useCallback((R,O,ie=0)=>{const te=Pe(R,O,ie,o);r===void 0&&T(te),t==null||t(te)},[r,t,o]),ne=n.useCallback(R=>{const O=R.target.value;r===void 0&&T(O)},[r]),ee=n.useCallback(()=>{const R=Fe(x);if(R){const O=Pe(R.hours,R.minutes,R.seconds,o);r===void 0&&T(O),t==null||t(O)}},[x,o,r,t]),H=n.useCallback(R=>{R.stopPropagation(),r===void 0&&T(""),t==null||t("")},[r,t]),re=s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:[s.jsx("circle",{cx:"8",cy:"8",r:"7"}),s.jsx("line",{x1:"8",y1:"4",x2:"8",y2:"8"}),s.jsx("line",{x1:"8",y1:"8",x2:"11",y2:"10"})]});return s.jsxs("div",{className:A(X.wrapper,M&&X.fullWidth,k),style:z,children:[h&&s.jsx("label",{htmlFor:j,className:A(X.label,W&&X.labelFocused,p&&X.labelError,g&&X.required),children:h}),s.jsxs("div",{ref:u,className:A(X.trigger,X[$],X[w],W&&X.focused,p&&X.triggerError,_&&X.disabled),onClick:()=>!_&&!f&&P(!0),children:[s.jsx("span",{className:X.icon,children:re}),s.jsx("input",{type:"text",className:X.input,value:x,onChange:ne,onBlur:ee,placeholder:m??(o?"HH:MM:SS":"HH:MM"),disabled:_,readOnly:f,id:j,"aria-invalid":p||void 0}),b&&x&&!_&&s.jsx("button",{type:"button",className:X.clearBtn,onClick:H,tabIndex:-1,children:"✕"})]}),v&&s.jsx("input",{type:"hidden",name:v,value:x}),s.jsx(Ie,{open:W,anchorRef:u,onClose:()=>P(!1),placement:"bottom-start",children:s.jsxs("div",{className:X.columns,children:[s.jsx(Le,{items:L,selected:d==null?void 0:d.hours,onSelect:R=>se(R,(d==null?void 0:d.minutes)??0,(d==null?void 0:d.seconds)??0),label:"Hr"}),s.jsx(Le,{items:E,selected:d==null?void 0:d.minutes,onSelect:R=>se((d==null?void 0:d.hours)??0,R,(d==null?void 0:d.seconds)??0),label:"Min"}),o&&s.jsx(Le,{items:U,selected:d==null?void 0:d.seconds,onSelect:R=>se((d==null?void 0:d.hours)??0,(d==null?void 0:d.minutes)??0,R),label:"Sec"})]})}),(N||y)&&s.jsx("div",{className:X.bottomRow,children:N?s.jsx("span",{className:X.errorTextMsg,role:"alert",children:N}):s.jsx("span",{className:X.helperText,children:y})})]})}function Le({items:r,selected:e,onSelect:t,label:c}){const o=n.useRef(null);n.useEffect(()=>{if(e!==void 0&&o.current){const i=o.current.querySelector(`[data-value="${e}"]`);i&&i.scrollIntoView({block:"center",behavior:"instant"})}},[e]);const l=i=>i.toString().padStart(2,"0");return s.jsxs("div",{className:X.column,children:[s.jsx("div",{className:X.columnLabel,children:c}),s.jsx("div",{ref:o,className:X.columnList,children:r.map(i=>s.jsx("button",{type:"button","data-value":i,className:A(X.columnItem,i===e&&X.columnItemSelected),onClick:()=>t(i),children:l(i)},i))})]})}const _t=n.createContext(null);function pt(){return n.useContext(_t)}function nl({initialValues:r={},onSubmit:e,onChange:t,validationMode:c="onBlur",children:o,className:l,style:i,noValidate:a=!0}){const[m,_]=n.useState({...r}),[f,v]=n.useState({}),[j,$]=n.useState({}),[w,h]=n.useState(!1),y=n.useRef(new Map),N=n.useCallback(u=>{y.current.set(u.name,u)},[]),I=n.useCallback(u=>{y.current.delete(u)},[]),g=n.useCallback((u,x)=>{const p=y.current.get(u);if(!p)return{valid:!0};const d=x!==void 0?x:m[u],L=d!=null?String(d):"";if(p.required){const E=Ye(L);if(!E.valid)return E}if(p.validate)for(const E of p.validate){const U=E(L);if(!U.valid)return U}return{valid:!0}},[m]),b=n.useCallback(u=>{const x=g(u);return v(p=>{if(x.valid){const d={...p};return delete d[u],d}return{...p,[u]:x.error}}),x},[g]),M=n.useCallback(()=>{let u=!0;const x={};for(const[d]of y.current){const L=g(d);L.valid||(u=!1,x[d]=L.error)}v(x);const p={};for(const[d]of y.current)p[d]=!0;return $(p),u},[g]),k=n.useCallback((u,x)=>{_(p=>{const d={...p,[u]:x};return t==null||t(d),d}),c==="onChange"&&j[u]&&setTimeout(()=>b(u),0)},[t,c,j,b]),z=n.useCallback((u,x)=>{v(p=>({...p,[u]:x}))},[]),W=n.useCallback((u,x)=>{$(p=>({...p,[u]:x})),c==="onBlur"&&x&&b(u)},[c,b]),P=n.useCallback(()=>{_({...r}),v({}),$({}),h(!1)},[r]),G=n.useCallback(async u=>{if(u.preventDefault(),w||!M())return;h(!0);const p={setSubmitting:h,resetForm:P,setFieldError:z};try{await(e==null?void 0:e(m,p))}finally{h(!1)}},[w,M,m,e,P,z]),T=n.useMemo(()=>({values:m,errors:f,touched:j,registerField:N,unregisterField:I,setFieldValue:k,setFieldError:z,setFieldTouched:W,validateField:b,validateAll:M,resetForm:P,isSubmitting:w}),[m,f,j,N,I,k,z,W,b,M,P,w]);return s.jsx(_t.Provider,{value:T,children:s.jsx("form",{onSubmit:G,noValidate:a,className:l,style:i,children:typeof o=="function"?o(T):o})})}function cl(r,e){const t=pt();n.useEffect(()=>{if(t)return t.registerField({name:r,validate:e==null?void 0:e.validate,required:e==null?void 0:e.required}),()=>t.unregisterField(r)},[t,r,e==null?void 0:e.validate,e==null?void 0:e.required]);const c=n.useCallback(l=>{t==null||t.setFieldValue(r,l)},[t,r]),o=n.useCallback(()=>{t==null||t.setFieldTouched(r,!0)},[t,r]);return{value:(t==null?void 0:t.values[r])??"",error:t==null?void 0:t.errors[r],touched:(t==null?void 0:t.touched[r])??!1,onChange:c,onBlur:o}}exports.Autocomplete=Hc;exports.Checkbox=ir;exports.DatePicker=Eo;exports.Form=nl;exports.Input=be;exports.InputCurrency=bn;exports.InputEmail=nn;exports.InputIBAN=dn;exports.InputName=an;exports.InputNumber=rn;exports.InputPassword=Vs;exports.InputPhone=ln;exports.InputSearch=sn;exports.InputTaxId=fn;exports.MineralThemeProvider=gt;exports.Popover=Ie;exports.Portal=dt;exports.Radio=$r;exports.RadioGroup=Ir;exports.Select=nc;exports.Textarea=qs;exports.TimePicker=sl;exports.Toggle=Pr;exports.addMonths=Ae;exports.addYears=Ft;exports.adjustCursorAfterFormat=At;exports.capitalizeWords=Ve;exports.cn=A;exports.composeValidators=Rt;exports.daysInMonth=Se;exports.firstDayOfMonth=nt;exports.formatCurrency=Re;exports.formatDate=ot;exports.formatIBAN=et;exports.formatNIP=st;exports.formatPhone=rt;exports.formatTime=Pe;exports.getDayNames=it;exports.getMonthNames=at;exports.isDateInRange=ct;exports.isSameDay=Ee;exports.parseCurrencyToNumber=De;exports.parseDate=lt;exports.parseTime=Fe;exports.stripNonAlphanumeric=Dt;exports.stripNonDigits=ye;exports.stripTime=$e;exports.unformatIBAN=tt;exports.useClickOutside=Ot;exports.useDebounce=Gt;exports.useDebouncedCallback=Be;exports.useFormContext=pt;exports.useFormField=cl;exports.useKeyboardNav=We;exports.useTheme=yt;exports.validateEmail=Ze;exports.validateIBAN=Je;exports.validateMaxLength=Nt;exports.validateMinLength=wt;exports.validateNIP=Xe;exports.validatePESEL=Ce;exports.validatePattern=jt;exports.validatePhone=Ke;exports.validateREGON=Qe;exports.validateRange=kt;exports.validateRequired=Ye;
2
2
  //# sourceMappingURL=index.cjs.map