digital-rabbit-cl 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.Button-module__button___2ZuB7{border-style:solid;cursor:pointer;font-weight:700;line-height:1.25;outline:none}.Button-module__button___2ZuB7:disabled{cursor:default}.Button-module__sizeSmall___DRT8P{padding:var(--button-padding-small)}.Button-module__sizeLarge___yeZSH{padding:var(--button-padding-large)}.Checkbox-module__container___aV9qz{display:flex;align-items:center;line-height:1.2}.Checkbox-module__svg___kkluC{flex-shrink:0}.Checkbox-module__label___cwRtI{font-weight:700;margin-left:.25em;-webkit-user-select:none;user-select:none}.FormLabel-module__label___0M-fo{display:inline-block;font-weight:700;padding-bottom:var(--form-label-padding-bottom)}.FormLabel-module__label___0M-fo.FormLabel-module__disabled___ktIFp{opacity:.5;cursor:not-allowed}.FormLabel-module__label___0M-fo:not(.FormLabel-module__disabled___ktIFp){cursor:default}:root{--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--font-size: 16px;--line-height: 1.5;--font-weight-header: 700;--primary-color: #000;--background-color: #fff;--accent-color: #0066cc;--font-size-h1: 2.5rem;--font-size-h2: 1.75rem;--font-size-h3: 1.38316rem;--font-size-h4: 1rem;--font-size-h5: .85028rem;--font-size-h6: .78405rem;--breakpoint-xs: 350px;--breakpoint-sm: 475px;--breakpoint-md: 769px;--breakpoint-lg: 1025px;--layout-max-width: 1280px;--layout-wrapper-padding-sm: .5rem;--layout-wrapper-padding: 1rem}html{line-height:var(--line-height);-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:var(--font-size);font-family:var(--font-family);box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}body{margin:0;font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);color:var(--primary-color);background-color:var(--background-color);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:var(--font-weight-header)}h1{font-size:var(--font-size-h1)}h2{font-size:var(--font-size-h2)}h3{font-size:var(--font-size-h3)}h4{font-size:var(--font-size-h4)}h5{font-size:var(--font-size-h5)}h6{font-size:var(--font-size-h6)}hr{box-sizing:content-box;height:0;overflow:visible;border:0;border-top:1px solid rgba(0,0,0,.1);margin:1em 0}pre{font-family:monospace,monospace;font-size:1em;overflow:auto}a{background-color:transparent;text-decoration:none}a:link{color:var(--accent-color)}a:hover{text-decoration:underline}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none;max-width:100%;height:auto;vertical-align:middle}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--line-height);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;cursor:pointer}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto;resize:vertical}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item;cursor:pointer}template,[hidden]{display:none}table{border-collapse:collapse;width:100%}ul,ol{padding-left:1.5em}p{margin-top:0;margin-bottom:1em}.FormError-module__formError___kaUBn{font-size:.875em;margin-top:var(--form-error-margin-top);font-weight:400}.FormGroup-module__formGroup___aVI-B{display:flex;flex-direction:column;margin-bottom:var(--form-group-margin-bottom)}.FormGroup-module__inputWrapper___429QE{display:flex;flex-direction:column;gap:.5em}.FormGroup-module__indented___t61iz{padding-left:.5em}.FormGroup-module__formGroup___aVI-B.FormGroup-module__disabled___W-tJ0{opacity:.6;pointer-events:none}.FormGroup-module__required___mO3xA{color:inherit;margin-left:.125em}.FormGroup-module__errorMessage___SHzl3{font-size:.875em;margin-top:.25rem;font-weight:400}.Input-module__input___WjT81{background-color:transparent;border-style:solid;box-sizing:border-box;display:block;font-weight:700;line-height:1.25;outline:none;width:100%}.Input-module__input___WjT81::placeholder{color:inherit;opacity:var(--placeholder-opacity, .3)}.Input-module__input___WjT81:disabled{opacity:.3}.Input-module__sizeSmall___NFvsi{padding:var(--input-padding-small)}.Input-module__sizeLarge___4Boj3{padding:var(--input-padding-large)}.Textarea-module__textarea___Z-y6g{background-color:transparent;border-style:solid;box-sizing:border-box;display:block;font-weight:700;line-height:1.25;outline:none;width:100%}.Textarea-module__textarea___Z-y6g::placeholder{color:inherit;opacity:var(--placeholder-opacity, .3)}.Textarea-module__textarea___Z-y6g:disabled{opacity:.3}.Textarea-module__sizeSmall___HHFEM{padding:var(--textarea-padding-small)}.Textarea-module__sizeLarge___5a3sf{padding:var(--textarea-padding-large)}.Select-module__select___cjdcr{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:right center;background-repeat:no-repeat;background-size:auto 85%;border-style:solid;box-sizing:border-box;display:block;font-weight:700;line-height:1.25;outline:none;width:100%}.Select-module__select___cjdcr:disabled{cursor:default;opacity:.3}.Select-module__select___cjdcr:not(:disabled){cursor:pointer}.Select-module__sizeSmall___i1quj{padding:var(--select-padding-small)}.Select-module__sizeLarge___eBA1T{padding:var(--select-padding-large)}.Radio-module__container___AQxhk{display:flex;align-items:center;line-height:1.25}.Radio-module__svg___zl5kF{flex-shrink:0}.Radio-module__label___vAFIP{font-weight:700;margin-left:.25em;-webkit-user-select:none;user-select:none}.Hamburger-module__hamburger___Tf4-t{background:transparent;border:none;cursor:pointer;display:none;flex-direction:column;justify-content:space-around;height:2em;outline:none;padding:0;position:relative;width:2em;z-index:11}.Hamburger-module__line___gybZM{background:currentColor;border-radius:var(--hamburger-border-radius, 10px);height:12.5%;position:relative;transform-origin:1px;transition:all .3s linear;width:100%}.Hamburger-module__line___gybZM:first-child{transform:rotate(0)}.Hamburger-module__line___gybZM:nth-child(2){opacity:1;transform:translate(0)}.Hamburger-module__line___gybZM:nth-child(3){transform:rotate(0)}.Hamburger-module__hamburger___Tf4-t.Hamburger-module__open___gRswh .Hamburger-module__line___gybZM:first-child{transform:rotate(45deg)}.Hamburger-module__hamburger___Tf4-t.Hamburger-module__open___gRswh .Hamburger-module__line___gybZM:nth-child(2){opacity:0;transform:translate(20px)}.Hamburger-module__hamburger___Tf4-t.Hamburger-module__open___gRswh .Hamburger-module__line___gybZM:nth-child(3){transform:rotate(-45deg)}.Header-module__header___RUooH{width:100%}.Header-module__container___t68M9{display:flex;align-items:center;justify-content:space-between;margin:0 auto;font-size:var(--header-font-size);max-width:var(--header-max-width);padding:var(--header-padding);position:relative}.ResponsiveNav-module__nav___xOfv5{display:flex}.ResponsiveNav-module__nav___xOfv5>*,.ResponsiveNav-module__nav___xOfv5>a{color:inherit;font-weight:700;text-decoration:none}.ResponsiveNav-module__navMobile___h795P{flex-direction:column;font-size:2rem;height:100vh;position:fixed;top:0;right:0;text-align:left;text-transform:uppercase;transition:transform .3s ease-in-out;width:100%;z-index:10;transform:translate(100%);overflow-y:auto;overflow-x:hidden;padding-top:3.5em}.ResponsiveNav-module__navHeader___Me8bB{position:fixed;top:0;left:0;right:0;height:3.5em;background:inherit;z-index:11}.ResponsiveNav-module__navMobile___h795P.ResponsiveNav-module__compact___UhuAE{padding-top:3em}.ResponsiveNav-module__navMobile___h795P.ResponsiveNav-module__compact___UhuAE .ResponsiveNav-module__navHeader___Me8bB{height:3em}.ResponsiveNav-module__navMobile___h795P.ResponsiveNav-module__open___WDCAf{transform:translate(0)}.ResponsiveNav-module__navMobile___h795P>a{padding:.35em 2em;text-align:center;width:100%}.ResponsiveNav-module__navMobile___h795P.ResponsiveNav-module__compact___UhuAE>a{padding:.25em 1.5em}.ResponsiveNav-module__navMobile___h795P>a.active{background:var(--mobile-active-bg);color:var(--mobile-active-color)}.ResponsiveNav-module__navMobile___h795P>button{align-self:center;margin:.5em 1.4em}.ResponsiveNav-module__navMobile___h795P.ResponsiveNav-module__compact___UhuAE>button{margin:.35em 1em}.ResponsiveNav-module__navDesktop___9wscZ{align-items:center;flex-direction:row;height:auto}.ResponsiveNav-module__navDesktop___9wscZ>*{margin-left:1.25rem}.ResponsiveNav-module__navDesktop___9wscZ>a.active,.ResponsiveNav-module__navDesktop___9wscZ>a:hover{opacity:var(--desktop-hover-opacity)}.Modal-module__backdrop___GVUh4{position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;z-index:1000;padding:1em}.Modal-module__modal___aD7aP{padding:1em;position:relative;display:flex;flex-direction:column;gap:1em;max-height:90vh;box-shadow:0 10px 40px #0003;outline:none}.Modal-module__header___ILG9i{display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.Modal-module__title___A5OeE{margin:0;font-size:1.5rem;font-weight:600;flex:1}.Modal-module__closeButton___3LpSf{background:none;border:none;cursor:pointer;padding:0;width:1.75em;height:1.75em;display:flex;align-items:center;justify-content:center;color:inherit;margin-left:auto;opacity:.6;transition:opacity .2s,transform .2s;flex-shrink:0}.Modal-module__closeButton___3LpSf svg{display:block;flex-shrink:0}.Modal-module__content___dWO-B{overflow-y:auto;flex:1}.Modal-module__actions___hY6zi{flex-shrink:0}@media (max-width: calc(var(--breakpoint-md) - 1px)){.Modal-module__backdrop___GVUh4{padding:.5em}.Modal-module__header___ILG9i,.Modal-module__content___dWO-B,.Modal-module__actions___hY6zi{padding:1rem}.Modal-module__title___A5OeE{font-size:1.25em}}.Stack-module__stack___yUU-B{display:flex;gap:.5em}.Stack-module__vertical___sKTyQ{flex-direction:column;margin-bottom:.5em}.Stack-module__horizontal___YsvtV{flex-direction:row;align-items:center}.ResponsiveSection-module__section___gBESK{width:100%;padding:0}.ResponsiveSection-module__innerDiv___r1bky{max-width:var(--max-width);margin:0 auto;padding:var(--section-padding)}.Hero-module__hero___IB2tg{padding:var(--hero-padding, 3rem 0)}.Hero-module__content___rkkfQ h1{font-size:var(--hero-h1-font-size, 2rem);margin-bottom:var(--hero-h1-margin-bottom)}.Hero-module__content___rkkfQ p{font-size:var(--hero-p-font-size, 1.125rem);line-height:1.6}.Footer-module__footer___A76NF{width:100%;margin-top:auto}.Footer-module__container___QneNs{display:flex;align-items:center;justify-content:space-between;margin:0 auto}.FeatureCard-module__card___XQt66{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--feature-card-padding)}.FeatureCard-module__icon___dXJ92{font-size:var(--feature-icon-font-size, 2.5rem);margin-bottom:var(--feature-icon-margin-bottom);color:var(--feature-icon-color, var(--primary-color))}.FeatureCard-module__title___KxXyA{font-size:var(--feature-title-font-size, 1.25rem);font-weight:600;margin-bottom:var(--feature-title-margin-bottom);color:var(--feature-title-color, inherit)}.FeatureCard-module__content___68xkw{font-size:1rem;line-height:1.6;color:var(--feature-content-color, var(--primary-color))}.FeatureGridSection-module__section___wZrbC{padding:var(--section-padding-vertical) 0}.FeatureGridSection-module__grid___iwPJv{display:grid;gap:2rem;grid-template-columns:var(--grid-template-columns, 1fr)}.PageLayout-module__layoutContainer___diLdT{display:flex;flex-direction:column;min-height:100vh}.PageLayout-module__content___h2mBr{flex:1 0 auto;display:flex;flex-direction:column}.PageLayout-module__main___Sw7Pv{flex:1}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
import { jsx as S, jsxs as G, Fragment as ke } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import F, { createContext as Zt, useContext as Qt, useState as Me, useLayoutEffect as Ar, useSyncExternalStore as Nr, useMemo as He, useRef as Pe, useEffect as xe } from "react";
|
|
4
4
|
import { createPortal as Br } from "react-dom";
|
|
5
5
|
const Pr = "Button-module__button___2ZuB7", Rr = "Button-module__sizeSmall___DRT8P", Lr = "Button-module__sizeLarge___yeZSH", $e = {
|
|
6
6
|
button: Pr,
|
|
@@ -135,7 +135,7 @@ const Ge = {
|
|
|
135
135
|
onClick: d,
|
|
136
136
|
children: h
|
|
137
137
|
}) => {
|
|
138
|
-
const m = H(), [z, x] = Me(!1),
|
|
138
|
+
const m = H(), [z, x] = Me(!1), w = {
|
|
139
139
|
...Dr({
|
|
140
140
|
isActive: z,
|
|
141
141
|
disabled: s,
|
|
@@ -152,7 +152,7 @@ const Ge = {
|
|
|
152
152
|
"--button-padding-large": `calc(${m.fonts.rhythm} * ${m.sizes.large.paddingVertical}) calc(${m.fonts.rhythm} * ${m.buttons.paddingHorizontal})`,
|
|
153
153
|
...f
|
|
154
154
|
// Top-level style overrides
|
|
155
|
-
},
|
|
155
|
+
}, k = [
|
|
156
156
|
$e.button,
|
|
157
157
|
o === "small" ? $e.sizeSmall : $e.sizeLarge,
|
|
158
158
|
n ? $e.outline : "",
|
|
@@ -162,13 +162,13 @@ const Ge = {
|
|
|
162
162
|
"button",
|
|
163
163
|
{
|
|
164
164
|
...u,
|
|
165
|
-
className:
|
|
165
|
+
className: k,
|
|
166
166
|
disabled: s,
|
|
167
167
|
onClick: d,
|
|
168
168
|
onMouseEnter: () => x(!0),
|
|
169
169
|
onMouseLeave: () => x(!1),
|
|
170
170
|
type: a,
|
|
171
|
-
style:
|
|
171
|
+
style: w,
|
|
172
172
|
children: h
|
|
173
173
|
}
|
|
174
174
|
);
|
|
@@ -275,8 +275,8 @@ const jr = "Checkbox-module__container___aV9qz", Ir = "Checkbox-module__svg___kk
|
|
|
275
275
|
// Element-specific props
|
|
276
276
|
divProps: z
|
|
277
277
|
}) => {
|
|
278
|
-
const x = H(), g = l || Xt(),
|
|
279
|
-
color:
|
|
278
|
+
const x = H(), g = l || Xt(), w = x.colors.error, k = n ? w : e || x.colors.primary, b = Wr({
|
|
279
|
+
color: k,
|
|
280
280
|
checkmarkColor: r,
|
|
281
281
|
disabled: o,
|
|
282
282
|
inverted: s
|
|
@@ -405,9 +405,9 @@ const Re = {
|
|
|
405
405
|
pattern: "pattern",
|
|
406
406
|
required: "required",
|
|
407
407
|
validate: "validate"
|
|
408
|
-
}, sr =
|
|
408
|
+
}, sr = F.createContext(null);
|
|
409
409
|
sr.displayName = "HookFormContext";
|
|
410
|
-
const dt = () =>
|
|
410
|
+
const dt = () => F.useContext(sr);
|
|
411
411
|
var or = (e, r, t, s = !0) => {
|
|
412
412
|
const o = {
|
|
413
413
|
defaultValues: r._defaultValues
|
|
@@ -421,9 +421,9 @@ var or = (e, r, t, s = !0) => {
|
|
|
421
421
|
});
|
|
422
422
|
return o;
|
|
423
423
|
};
|
|
424
|
-
const ft = typeof window < "u" ?
|
|
424
|
+
const ft = typeof window < "u" ? F.useLayoutEffect : F.useEffect;
|
|
425
425
|
function Yr(e) {
|
|
426
|
-
const r = dt(), { control: t = r.control, disabled: s, name: o, exact: n } = e || {}, [a, l] =
|
|
426
|
+
const r = dt(), { control: t = r.control, disabled: s, name: o, exact: n } = e || {}, [a, l] = F.useState(t._formState), f = F.useRef({
|
|
427
427
|
isDirty: !1,
|
|
428
428
|
isLoading: !1,
|
|
429
429
|
dirtyFields: !1,
|
|
@@ -443,9 +443,9 @@ function Yr(e) {
|
|
|
443
443
|
...u
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
|
-
}), [o, s, n]),
|
|
446
|
+
}), [o, s, n]), F.useEffect(() => {
|
|
447
447
|
f.current.isValid && t._setValid(!0);
|
|
448
|
-
}, [t]),
|
|
448
|
+
}, [t]), F.useMemo(() => or(a, t, f.current, !1), [a, t]);
|
|
449
449
|
}
|
|
450
450
|
var te = (e) => typeof e == "string", st = (e, r, t, s, o) => te(e) ? (s && r.watch.add(e), v(t, e, o)) : Array.isArray(e) ? e.map((n) => (s && r.watch.add(n), v(t, n))) : (s && (r.watchAll = !0), t), ot = (e) => K(e) || !er(e);
|
|
451
451
|
function oe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
@@ -472,15 +472,15 @@ function oe(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
|
472
472
|
return !0;
|
|
473
473
|
}
|
|
474
474
|
function Jr(e) {
|
|
475
|
-
const r = dt(), { control: t = r.control, name: s, defaultValue: o, disabled: n, exact: a, compute: l } = e || {}, f =
|
|
475
|
+
const r = dt(), { control: t = r.control, name: s, defaultValue: o, disabled: n, exact: a, compute: l } = e || {}, f = F.useRef(o), u = F.useRef(l), d = F.useRef(void 0), h = F.useRef(t), m = F.useRef(s);
|
|
476
476
|
u.current = l;
|
|
477
|
-
const [z, x] =
|
|
477
|
+
const [z, x] = F.useState(() => {
|
|
478
478
|
const $ = t._getWatch(s, f.current);
|
|
479
479
|
return u.current ? u.current($) : $;
|
|
480
|
-
}), g =
|
|
480
|
+
}), g = F.useCallback(($) => {
|
|
481
481
|
const A = st(s, t._names, $ || t._formValues, !1, f.current);
|
|
482
482
|
return u.current ? u.current(A) : A;
|
|
483
|
-
}, [t._formValues, t._names, s]),
|
|
483
|
+
}, [t._formValues, t._names, s]), w = F.useCallback(($) => {
|
|
484
484
|
if (!n) {
|
|
485
485
|
const A = st(s, t._names, $ || t._formValues, !1, f.current);
|
|
486
486
|
if (u.current) {
|
|
@@ -490,26 +490,26 @@ function Jr(e) {
|
|
|
490
490
|
x(A);
|
|
491
491
|
}
|
|
492
492
|
}, [t._formValues, t._names, n, s]);
|
|
493
|
-
ft(() => ((h.current !== t || !oe(m.current, s)) && (h.current = t, m.current = s,
|
|
493
|
+
ft(() => ((h.current !== t || !oe(m.current, s)) && (h.current = t, m.current = s, w()), t._subscribe({
|
|
494
494
|
name: s,
|
|
495
495
|
formState: {
|
|
496
496
|
values: !0
|
|
497
497
|
},
|
|
498
498
|
exact: a,
|
|
499
499
|
callback: ($) => {
|
|
500
|
-
|
|
500
|
+
w($.values);
|
|
501
501
|
}
|
|
502
|
-
})), [t, a, s,
|
|
503
|
-
const
|
|
502
|
+
})), [t, a, s, w]), F.useEffect(() => t._removeUnmounted());
|
|
503
|
+
const k = h.current !== t, b = m.current, E = F.useMemo(() => {
|
|
504
504
|
if (n)
|
|
505
505
|
return null;
|
|
506
|
-
const $ = !
|
|
507
|
-
return
|
|
508
|
-
}, [n,
|
|
506
|
+
const $ = !k && !oe(b, s);
|
|
507
|
+
return k || $ ? g() : null;
|
|
508
|
+
}, [n, k, s, b, g]);
|
|
509
509
|
return E !== null ? E : z;
|
|
510
510
|
}
|
|
511
511
|
function Xr(e) {
|
|
512
|
-
const r = dt(), { name: t, disabled: s, control: o = r.control, shouldUnregister: n, defaultValue: a } = e, l = rr(o._names.array, t), f =
|
|
512
|
+
const r = dt(), { name: t, disabled: s, control: o = r.control, shouldUnregister: n, defaultValue: a } = e, l = rr(o._names.array, t), f = F.useMemo(() => v(o._formValues, t, v(o._defaultValues, t, a)), [o, t, a]), u = Jr({
|
|
513
513
|
control: o,
|
|
514
514
|
name: t,
|
|
515
515
|
defaultValue: f,
|
|
@@ -518,13 +518,13 @@ function Xr(e) {
|
|
|
518
518
|
control: o,
|
|
519
519
|
name: t,
|
|
520
520
|
exact: !0
|
|
521
|
-
}), h =
|
|
521
|
+
}), h = F.useRef(e), m = F.useRef(void 0), z = F.useRef(o.register(t, {
|
|
522
522
|
...e.rules,
|
|
523
523
|
value: u,
|
|
524
524
|
...ee(e.disabled) ? { disabled: e.disabled } : {}
|
|
525
525
|
}));
|
|
526
526
|
h.current = e;
|
|
527
|
-
const x =
|
|
527
|
+
const x = F.useMemo(() => Object.defineProperties({}, {
|
|
528
528
|
invalid: {
|
|
529
529
|
enumerable: !0,
|
|
530
530
|
get: () => !!v(d.errors, t)
|
|
@@ -545,19 +545,19 @@ function Xr(e) {
|
|
|
545
545
|
enumerable: !0,
|
|
546
546
|
get: () => v(d.errors, t)
|
|
547
547
|
}
|
|
548
|
-
}), [d, t]), g =
|
|
548
|
+
}), [d, t]), g = F.useCallback((E) => z.current.onChange({
|
|
549
549
|
target: {
|
|
550
550
|
value: tr(E),
|
|
551
551
|
name: t
|
|
552
552
|
},
|
|
553
553
|
type: Re.CHANGE
|
|
554
|
-
}), [t]),
|
|
554
|
+
}), [t]), w = F.useCallback(() => z.current.onBlur({
|
|
555
555
|
target: {
|
|
556
556
|
value: v(o._formValues, t),
|
|
557
557
|
name: t
|
|
558
558
|
},
|
|
559
559
|
type: Re.BLUR
|
|
560
|
-
}), [t, o._formValues]),
|
|
560
|
+
}), [t, o._formValues]), k = F.useCallback((E) => {
|
|
561
561
|
const $ = v(o._fields, t);
|
|
562
562
|
$ && E && ($._f.ref = {
|
|
563
563
|
focus: () => E.focus && E.focus(),
|
|
@@ -565,15 +565,15 @@ function Xr(e) {
|
|
|
565
565
|
setCustomValidity: (A) => E.setCustomValidity(A),
|
|
566
566
|
reportValidity: () => E.reportValidity()
|
|
567
567
|
});
|
|
568
|
-
}, [o._fields, t]), b =
|
|
568
|
+
}, [o._fields, t]), b = F.useMemo(() => ({
|
|
569
569
|
name: t,
|
|
570
570
|
value: u,
|
|
571
571
|
...ee(s) || d.disabled ? { disabled: d.disabled || s } : {},
|
|
572
572
|
onChange: g,
|
|
573
|
-
onBlur:
|
|
574
|
-
ref:
|
|
575
|
-
}), [t, s, d.disabled, g,
|
|
576
|
-
return
|
|
573
|
+
onBlur: w,
|
|
574
|
+
ref: k
|
|
575
|
+
}), [t, s, d.disabled, g, w, k, u]);
|
|
576
|
+
return F.useEffect(() => {
|
|
577
577
|
const E = o._options.shouldUnregister || n, $ = m.current;
|
|
578
578
|
$ && $ !== t && !l && o.unregister($), o.register(t, {
|
|
579
579
|
...h.current.rules,
|
|
@@ -590,12 +590,12 @@ function Xr(e) {
|
|
|
590
590
|
return !l && o.register(t), m.current = t, () => {
|
|
591
591
|
(l ? E && !o._state.action : E) ? o.unregister(t) : A(t, !1);
|
|
592
592
|
};
|
|
593
|
-
}, [t, o, l, n]),
|
|
593
|
+
}, [t, o, l, n]), F.useEffect(() => {
|
|
594
594
|
o._setDisabledField({
|
|
595
595
|
disabled: s,
|
|
596
596
|
name: t
|
|
597
597
|
});
|
|
598
|
-
}, [s, t, o]),
|
|
598
|
+
}, [s, t, o]), F.useMemo(() => ({
|
|
599
599
|
field: b,
|
|
600
600
|
formState: d,
|
|
601
601
|
fieldState: x
|
|
@@ -797,12 +797,12 @@ var me = (e) => U(e) && !De(e) ? e : {
|
|
|
797
797
|
value: e,
|
|
798
798
|
message: ""
|
|
799
799
|
}, Mt = async (e, r, t, s, o, n) => {
|
|
800
|
-
const { ref: a, refs: l, required: f, maxLength: u, minLength: d, min: h, max: m, pattern: z, validate: x, name: g, valueAsNumber:
|
|
801
|
-
if (!
|
|
800
|
+
const { ref: a, refs: l, required: f, maxLength: u, minLength: d, min: h, max: m, pattern: z, validate: x, name: g, valueAsNumber: w, mount: k } = e._f, b = v(t, g);
|
|
801
|
+
if (!k || r.has(g))
|
|
802
802
|
return {};
|
|
803
803
|
const E = l ? l[0] : a, $ = (N) => {
|
|
804
804
|
o && E.reportValidity && (E.setCustomValidity(ee(N) ? "" : N || ""), E.reportValidity());
|
|
805
|
-
}, A = {}, M = ht(a), O = Fe(a), Y = M || O, B = (
|
|
805
|
+
}, A = {}, M = ht(a), O = Fe(a), Y = M || O, B = (w || mt(a)) && T(a.value) && T(b) || Le(a) && a.value === "" || b === "" || Array.isArray(b) && !b.length, J = yt.bind(null, g, s, A), X = (N, P, j, q = le.maxLength, Q = le.minLength) => {
|
|
806
806
|
const ie = N ? P : j;
|
|
807
807
|
A[g] = {
|
|
808
808
|
type: N ? q : Q,
|
|
@@ -936,26 +936,26 @@ function ys(e = {}) {
|
|
|
936
936
|
isValid: c
|
|
937
937
|
});
|
|
938
938
|
}
|
|
939
|
-
},
|
|
939
|
+
}, w = (i, c) => {
|
|
940
940
|
!r.disabled && (d.isValidating || d.validatingFields || h.isValidating || h.validatingFields) && ((i || Array.from(l.mount)).forEach((y) => {
|
|
941
941
|
y && (c ? L(t.validatingFields, y, c) : I(t.validatingFields, y));
|
|
942
942
|
}), m.state.next({
|
|
943
943
|
validatingFields: t.validatingFields,
|
|
944
944
|
isValidating: !Z(t.validatingFields)
|
|
945
945
|
}));
|
|
946
|
-
},
|
|
946
|
+
}, k = (i, c = [], y, C, p = !0, _ = !0) => {
|
|
947
947
|
if (C && y && !r.disabled) {
|
|
948
948
|
if (a.action = !0, _ && Array.isArray(v(s, i))) {
|
|
949
|
-
const
|
|
950
|
-
p && L(s, i,
|
|
949
|
+
const V = y(v(s, i), C.argA, C.argB);
|
|
950
|
+
p && L(s, i, V);
|
|
951
951
|
}
|
|
952
952
|
if (_ && Array.isArray(v(t.errors, i))) {
|
|
953
|
-
const
|
|
954
|
-
p && L(t.errors, i,
|
|
953
|
+
const V = y(v(t.errors, i), C.argA, C.argB);
|
|
954
|
+
p && L(t.errors, i, V), us(t.errors, i);
|
|
955
955
|
}
|
|
956
956
|
if ((d.touchedFields || h.touchedFields) && _ && Array.isArray(v(t.touchedFields, i))) {
|
|
957
|
-
const
|
|
958
|
-
p && L(t.touchedFields, i,
|
|
957
|
+
const V = y(v(t.touchedFields, i), C.argA, C.argB);
|
|
958
|
+
p && L(t.touchedFields, i, V);
|
|
959
959
|
}
|
|
960
960
|
(d.dirtyFields || h.dirtyFields) && (t.dirtyFields = _e(o, n)), m.state.next({
|
|
961
961
|
name: i,
|
|
@@ -982,15 +982,15 @@ function ys(e = {}) {
|
|
|
982
982
|
T(_) || C && C.defaultChecked || c ? L(n, i, c ? _ : Nt(p._f)) : j(i, _), a.mount && g();
|
|
983
983
|
}
|
|
984
984
|
}, A = (i, c, y, C, p) => {
|
|
985
|
-
let _ = !1,
|
|
985
|
+
let _ = !1, V = !1;
|
|
986
986
|
const R = {
|
|
987
987
|
name: i
|
|
988
988
|
};
|
|
989
989
|
if (!r.disabled) {
|
|
990
990
|
if (!y || C) {
|
|
991
|
-
(d.isDirty || h.isDirty) && (
|
|
991
|
+
(d.isDirty || h.isDirty) && (V = t.isDirty, t.isDirty = R.isDirty = X(), _ = V !== R.isDirty);
|
|
992
992
|
const D = oe(v(o, i), c);
|
|
993
|
-
|
|
993
|
+
V = !!v(t.dirtyFields, i), D ? I(t.dirtyFields, i) : L(t.dirtyFields, i, !0), R.dirtyFields = t.dirtyFields, _ = _ || (d.dirtyFields || h.dirtyFields) && V !== !D;
|
|
994
994
|
}
|
|
995
995
|
if (y) {
|
|
996
996
|
const D = v(t.touchedFields, i);
|
|
@@ -1002,7 +1002,7 @@ function ys(e = {}) {
|
|
|
1002
1002
|
}, M = (i, c, y, C) => {
|
|
1003
1003
|
const p = v(t.errors, i), _ = (d.isValid || h.isValid) && ee(c) && t.isValid !== c;
|
|
1004
1004
|
if (r.delayError && y ? (f = x(() => b(i, y)), f(r.delayError)) : (clearTimeout(u), f = null, y ? L(t.errors, i, y) : I(t.errors, i)), (y ? !oe(p, y) : p) || !Z(C) || _) {
|
|
1005
|
-
const
|
|
1005
|
+
const V = {
|
|
1006
1006
|
...C,
|
|
1007
1007
|
..._ && ee(c) ? { isValid: c } : {},
|
|
1008
1008
|
errors: t.errors,
|
|
@@ -1010,13 +1010,13 @@ function ys(e = {}) {
|
|
|
1010
1010
|
};
|
|
1011
1011
|
t = {
|
|
1012
1012
|
...t,
|
|
1013
|
-
...
|
|
1014
|
-
}, m.state.next(
|
|
1013
|
+
...V
|
|
1014
|
+
}, m.state.next(V);
|
|
1015
1015
|
}
|
|
1016
1016
|
}, O = async (i) => {
|
|
1017
|
-
|
|
1017
|
+
w(i, !0);
|
|
1018
1018
|
const c = await r.resolver(n, r.context, os(i || l.mount, s, r.criteriaMode, r.shouldUseNativeValidation));
|
|
1019
|
-
return
|
|
1019
|
+
return w(i), c;
|
|
1020
1020
|
}, Y = async (i) => {
|
|
1021
1021
|
const { errors: c } = await O(i);
|
|
1022
1022
|
if (i)
|
|
@@ -1033,16 +1033,16 @@ function ys(e = {}) {
|
|
|
1033
1033
|
for (const C in i) {
|
|
1034
1034
|
const p = i[C];
|
|
1035
1035
|
if (p) {
|
|
1036
|
-
const { _f: _, ...
|
|
1036
|
+
const { _f: _, ...V } = p;
|
|
1037
1037
|
if (_) {
|
|
1038
1038
|
const R = l.array.has(_.name), D = p._f && ns(p._f);
|
|
1039
|
-
D && d.validatingFields &&
|
|
1039
|
+
D && d.validatingFields && w([_.name], !0);
|
|
1040
1040
|
const re = await Mt(p, l.disabled, n, z, r.shouldUseNativeValidation && !c, R);
|
|
1041
|
-
if (D && d.validatingFields &&
|
|
1041
|
+
if (D && d.validatingFields && w([_.name]), re[_.name] && (y.valid = !1, c))
|
|
1042
1042
|
break;
|
|
1043
1043
|
!c && (v(re, _.name) ? R ? ds(t.errors, re, _.name) : L(t.errors, _.name, re[_.name]) : I(t.errors, _.name));
|
|
1044
1044
|
}
|
|
1045
|
-
!Z(
|
|
1045
|
+
!Z(V) && await B(V, c, y);
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
return y.valid;
|
|
@@ -1059,9 +1059,9 @@ function ys(e = {}) {
|
|
|
1059
1059
|
let p = c;
|
|
1060
1060
|
if (C) {
|
|
1061
1061
|
const _ = C._f;
|
|
1062
|
-
_ && (!_.disabled && L(n, i, cr(c, _)), p = Le(_.ref) && K(c) ? "" : c, ar(_.ref) ? [..._.ref.options].forEach((
|
|
1063
|
-
(!
|
|
1064
|
-
}) : _.refs.forEach((
|
|
1062
|
+
_ && (!_.disabled && L(n, i, cr(c, _)), p = Le(_.ref) && K(c) ? "" : c, ar(_.ref) ? [..._.ref.options].forEach((V) => V.selected = p.includes(V.value)) : _.refs ? Fe(_.ref) ? _.refs.forEach((V) => {
|
|
1063
|
+
(!V.defaultChecked || !V.disabled) && (Array.isArray(p) ? V.checked = !!p.find((R) => R === V.value) : V.checked = p === V.value || !!p);
|
|
1064
|
+
}) : _.refs.forEach((V) => V.checked = V.value === p) : mt(_.ref) ? _.ref.value = "" : (_.ref.value = p, _.ref.type || m.state.next({
|
|
1065
1065
|
name: i,
|
|
1066
1066
|
values: W(n)
|
|
1067
1067
|
})));
|
|
@@ -1071,8 +1071,8 @@ function ys(e = {}) {
|
|
|
1071
1071
|
for (const C in c) {
|
|
1072
1072
|
if (!c.hasOwnProperty(C))
|
|
1073
1073
|
return;
|
|
1074
|
-
const p = c[C], _ = i + "." + C,
|
|
1075
|
-
(l.array.has(i) || U(p) ||
|
|
1074
|
+
const p = c[C], _ = i + "." + C, V = v(s, _);
|
|
1075
|
+
(l.array.has(i) || U(p) || V && !V._f) && !de(p) ? q(_, p, y) : j(_, p, y);
|
|
1076
1076
|
}
|
|
1077
1077
|
}, Q = (i, c, y = {}) => {
|
|
1078
1078
|
const C = v(s, i), p = l.array.has(i), _ = W(c);
|
|
@@ -1093,10 +1093,10 @@ function ys(e = {}) {
|
|
|
1093
1093
|
let y = c.name, C = !0;
|
|
1094
1094
|
const p = v(s, y), _ = (D) => {
|
|
1095
1095
|
C = Number.isNaN(D) || de(D) && isNaN(D.getTime()) || oe(D, v(n, y, D));
|
|
1096
|
-
},
|
|
1096
|
+
}, V = Bt(r.mode), R = Bt(r.reValidateMode);
|
|
1097
1097
|
if (p) {
|
|
1098
1098
|
let D, re;
|
|
1099
|
-
const ze = c.type ? Nt(p._f) : tr(i), ce = i.type === Re.BLUR || i.type === Re.FOCUS_OUT, zr = !as(p._f) && !r.resolver && !v(t.errors, y) && !p._f.deps || cs(ce, v(t.touchedFields, y), t.isSubmitted, R,
|
|
1099
|
+
const ze = c.type ? Nt(p._f) : tr(i), ce = i.type === Re.BLUR || i.type === Re.FOCUS_OUT, zr = !as(p._f) && !r.resolver && !v(t.errors, y) && !p._f.deps || cs(ce, v(t.touchedFields, y), t.isSubmitted, R, V), Ue = Rt(y, l, ce);
|
|
1100
1100
|
L(n, y, ze), ce ? (!c || !c.readOnly) && (p._f.onBlur && p._f.onBlur(i), f && f(0)) : p._f.onChange && p._f.onChange(i);
|
|
1101
1101
|
const We = A(y, ze, ce), $r = !Z(We) || Ue;
|
|
1102
1102
|
if (!ce && m.state.next({
|
|
@@ -1112,7 +1112,7 @@ function ys(e = {}) {
|
|
|
1112
1112
|
D = kt.error, y = kt.name, re = Z(wt);
|
|
1113
1113
|
}
|
|
1114
1114
|
} else
|
|
1115
|
-
|
|
1115
|
+
w([y], !0), D = (await Mt(p, l.disabled, n, z, r.shouldUseNativeValidation))[y], w([y]), _(ze), C && (D ? re = !1 : (d.isValid || h.isValid) && (re = await B(s, !0)));
|
|
1116
1116
|
C && (p._f.deps && (!Array.isArray(p._f.deps) || p._f.deps.length > 0) && ye(p._f.deps), M(y, re, D, We));
|
|
1117
1117
|
}
|
|
1118
1118
|
}, pe = (i, c) => {
|
|
@@ -1123,10 +1123,10 @@ function ys(e = {}) {
|
|
|
1123
1123
|
const p = Se(i);
|
|
1124
1124
|
if (r.resolver) {
|
|
1125
1125
|
const _ = await Y(T(i) ? i : p);
|
|
1126
|
-
y = Z(_), C = i ? !p.some((
|
|
1126
|
+
y = Z(_), C = i ? !p.some((V) => v(_, V)) : y;
|
|
1127
1127
|
} else i ? (C = (await Promise.all(p.map(async (_) => {
|
|
1128
|
-
const
|
|
1129
|
-
return await B(
|
|
1128
|
+
const V = v(s, _);
|
|
1129
|
+
return await B(V && V._f ? { [_]: V } : V);
|
|
1130
1130
|
}))).every(Boolean), !(!C && !t.isValid) && g()) : C = y = await B(s);
|
|
1131
1131
|
return m.state.next({
|
|
1132
1132
|
...!te(i) || (d.isValid || h.isValid) && y !== t.isValid ? {} : { name: i },
|
|
@@ -1149,7 +1149,7 @@ function ys(e = {}) {
|
|
|
1149
1149
|
errors: i ? t.errors : {}
|
|
1150
1150
|
});
|
|
1151
1151
|
}, _t = (i, c, y) => {
|
|
1152
|
-
const C = (v(s, i, { _f: {} })._f || {}).ref, p = v(t.errors, i) || {}, { ref: _, message:
|
|
1152
|
+
const C = (v(s, i, { _f: {} })._f || {}).ref, p = v(t.errors, i) || {}, { ref: _, message: V, type: R, ...D } = p;
|
|
1153
1153
|
L(t.errors, i, {
|
|
1154
1154
|
...D,
|
|
1155
1155
|
...c,
|
|
@@ -1217,13 +1217,13 @@ function ys(e = {}) {
|
|
|
1217
1217
|
ref: (p) => {
|
|
1218
1218
|
if (p) {
|
|
1219
1219
|
je(i, c), y = v(s, i);
|
|
1220
|
-
const _ = T(p.value) && p.querySelectorAll && p.querySelectorAll("input,select,textarea")[0] || p,
|
|
1221
|
-
if (
|
|
1220
|
+
const _ = T(p.value) && p.querySelectorAll && p.querySelectorAll("input,select,textarea")[0] || p, V = es(_), R = y._f.refs || [];
|
|
1221
|
+
if (V ? R.find((D) => D === _) : _ === y._f.ref)
|
|
1222
1222
|
return;
|
|
1223
1223
|
L(s, i, {
|
|
1224
1224
|
_f: {
|
|
1225
1225
|
...y._f,
|
|
1226
|
-
...
|
|
1226
|
+
...V ? {
|
|
1227
1227
|
refs: [
|
|
1228
1228
|
...R.filter(Ze),
|
|
1229
1229
|
_,
|
|
@@ -1251,8 +1251,8 @@ function ys(e = {}) {
|
|
|
1251
1251
|
if (m.state.next({
|
|
1252
1252
|
isSubmitting: !0
|
|
1253
1253
|
}), r.resolver) {
|
|
1254
|
-
const { errors: _, values:
|
|
1255
|
-
t.errors = _, p = W(
|
|
1254
|
+
const { errors: _, values: V } = await O();
|
|
1255
|
+
t.errors = _, p = W(V);
|
|
1256
1256
|
} else
|
|
1257
1257
|
await B(s);
|
|
1258
1258
|
if (l.disabled.size)
|
|
@@ -1283,16 +1283,16 @@ function ys(e = {}) {
|
|
|
1283
1283
|
const y = i ? W(i) : o, C = W(y), p = Z(i), _ = p ? o : C;
|
|
1284
1284
|
if (c.keepDefaultValues || (o = y), !c.keepValues) {
|
|
1285
1285
|
if (c.keepDirtyValues) {
|
|
1286
|
-
const
|
|
1286
|
+
const V = /* @__PURE__ */ new Set([
|
|
1287
1287
|
...l.mount,
|
|
1288
1288
|
...Object.keys(_e(o, n))
|
|
1289
1289
|
]);
|
|
1290
|
-
for (const R of Array.from(
|
|
1290
|
+
for (const R of Array.from(V))
|
|
1291
1291
|
v(t.dirtyFields, R) ? L(_, R, v(n, R)) : Q(R, v(_, R));
|
|
1292
1292
|
} else {
|
|
1293
1293
|
if (lt && T(i))
|
|
1294
|
-
for (const
|
|
1295
|
-
const R = v(s,
|
|
1294
|
+
for (const V of l.mount) {
|
|
1295
|
+
const R = v(s, V);
|
|
1296
1296
|
if (R && R._f) {
|
|
1297
1297
|
const D = Array.isArray(R._f.refs) ? R._f.refs[0] : R._f.ref;
|
|
1298
1298
|
if (Le(D)) {
|
|
@@ -1305,8 +1305,8 @@ function ys(e = {}) {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
1307
|
if (c.keepFieldsRef)
|
|
1308
|
-
for (const
|
|
1309
|
-
Q(
|
|
1308
|
+
for (const V of l.mount)
|
|
1309
|
+
Q(V, v(_, V));
|
|
1310
1310
|
else
|
|
1311
1311
|
s = {};
|
|
1312
1312
|
}
|
|
@@ -1359,7 +1359,7 @@ function ys(e = {}) {
|
|
|
1359
1359
|
_getWatch: N,
|
|
1360
1360
|
_getDirty: X,
|
|
1361
1361
|
_setValid: g,
|
|
1362
|
-
_setFieldArray:
|
|
1362
|
+
_setFieldArray: k,
|
|
1363
1363
|
_setDisabledField: vt,
|
|
1364
1364
|
_setErrors: E,
|
|
1365
1365
|
_getFieldArray: P,
|
|
@@ -1428,7 +1428,7 @@ function ys(e = {}) {
|
|
|
1428
1428
|
};
|
|
1429
1429
|
}
|
|
1430
1430
|
function ms(e = {}) {
|
|
1431
|
-
const r =
|
|
1431
|
+
const r = F.useRef(void 0), t = F.useRef(void 0), [s, o] = F.useState({
|
|
1432
1432
|
isDirty: !1,
|
|
1433
1433
|
isValidating: !1,
|
|
1434
1434
|
isLoading: ne(e.defaultValues),
|
|
@@ -1469,27 +1469,27 @@ function ms(e = {}) {
|
|
|
1469
1469
|
...l,
|
|
1470
1470
|
isReady: !0
|
|
1471
1471
|
})), n._formState.isReady = !0, a;
|
|
1472
|
-
}, [n]),
|
|
1472
|
+
}, [n]), F.useEffect(() => n._disableForm(e.disabled), [n, e.disabled]), F.useEffect(() => {
|
|
1473
1473
|
e.mode && (n._options.mode = e.mode), e.reValidateMode && (n._options.reValidateMode = e.reValidateMode);
|
|
1474
|
-
}, [n, e.mode, e.reValidateMode]),
|
|
1474
|
+
}, [n, e.mode, e.reValidateMode]), F.useEffect(() => {
|
|
1475
1475
|
e.errors && (n._setErrors(e.errors), n._focusError());
|
|
1476
|
-
}, [n, e.errors]),
|
|
1476
|
+
}, [n, e.errors]), F.useEffect(() => {
|
|
1477
1477
|
e.shouldUnregister && n._subjects.state.next({
|
|
1478
1478
|
values: n._getWatch()
|
|
1479
1479
|
});
|
|
1480
|
-
}, [n, e.shouldUnregister]),
|
|
1480
|
+
}, [n, e.shouldUnregister]), F.useEffect(() => {
|
|
1481
1481
|
if (n._proxyFormState.isDirty) {
|
|
1482
1482
|
const a = n._getDirty();
|
|
1483
1483
|
a !== s.isDirty && n._subjects.state.next({
|
|
1484
1484
|
isDirty: a
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
|
-
}, [n, s.isDirty]),
|
|
1487
|
+
}, [n, s.isDirty]), F.useEffect(() => {
|
|
1488
1488
|
e.values && !oe(e.values, t.current) ? (n._reset(e.values, {
|
|
1489
1489
|
keepFieldsRef: !0,
|
|
1490
1490
|
...n._options.resetOptions
|
|
1491
1491
|
}), t.current = e.values, o((a) => ({ ...a }))) : n._resetDefaultValues();
|
|
1492
|
-
}, [n, e.values]),
|
|
1492
|
+
}, [n, e.values]), F.useEffect(() => {
|
|
1493
1493
|
n._state.mount || (n._setValid(), n._state.mount = !0), n._state.watch && (n._state.watch = !1, n._subjects.state.next({ ...n._formState })), n._removeUnmounted();
|
|
1494
1494
|
}), r.current.formState = or(s, n), r.current;
|
|
1495
1495
|
}
|
|
@@ -1691,9 +1691,9 @@ function Fs(e, r, t) {
|
|
|
1691
1691
|
};
|
|
1692
1692
|
throw new Error("Invalid input: not a Zod schema");
|
|
1693
1693
|
}
|
|
1694
|
-
const _r =
|
|
1694
|
+
const _r = F.createContext(null);
|
|
1695
1695
|
function Vs() {
|
|
1696
|
-
const e =
|
|
1696
|
+
const e = F.useContext(_r);
|
|
1697
1697
|
if (!e)
|
|
1698
1698
|
throw new Error("useFormContext must be used within a Form component");
|
|
1699
1699
|
return e;
|
|
@@ -1771,13 +1771,13 @@ const nn = zs, $s = "FormError-module__formError___kaUBn", Es = {
|
|
|
1771
1771
|
].filter(Boolean).join(" "), x = {
|
|
1772
1772
|
"--form-group-margin-bottom": `calc(${m.fonts.rhythm} * 0.35)`,
|
|
1773
1773
|
...d
|
|
1774
|
-
}, g =
|
|
1775
|
-
if (
|
|
1776
|
-
const
|
|
1777
|
-
if (e &&
|
|
1778
|
-
return
|
|
1774
|
+
}, g = F.Children.map(f, (w) => {
|
|
1775
|
+
if (F.isValidElement(w)) {
|
|
1776
|
+
const k = {};
|
|
1777
|
+
if (e && w.props.disabled === void 0 && (k.disabled = !0), r && w.props.error === void 0 && (k.error = !0), o && w.props.id === void 0 && w.type !== F.Fragment && (k.id = o), Object.keys(k).length > 0)
|
|
1778
|
+
return F.cloneElement(w, k);
|
|
1779
1779
|
}
|
|
1780
|
-
return
|
|
1780
|
+
return w;
|
|
1781
1781
|
});
|
|
1782
1782
|
return /* @__PURE__ */ G("div", { ...h, className: z, style: x, children: [
|
|
1783
1783
|
n && /* @__PURE__ */ G(it, { htmlFor: o, disabled: e, error: r, ...l, children: [
|
|
@@ -1874,8 +1874,8 @@ const Ms = "Input-module__input___WjT81", Hs = "Input-module__sizeSmall___NFvsi"
|
|
|
1874
1874
|
// Element-specific props
|
|
1875
1875
|
inputProps: x
|
|
1876
1876
|
}) => {
|
|
1877
|
-
const g = H(),
|
|
1878
|
-
color:
|
|
1877
|
+
const g = H(), w = g.colors.error, k = r ? w : t || g.colors.primary, b = Ts({
|
|
1878
|
+
color: k,
|
|
1879
1879
|
disabled: e,
|
|
1880
1880
|
fontSize: g.fonts.size,
|
|
1881
1881
|
placeholderOpacity: l
|
|
@@ -1984,8 +1984,8 @@ const Is = "Textarea-module__textarea___Z-y6g", Us = "Textarea-module__sizeSmall
|
|
|
1984
1984
|
// Element-specific props
|
|
1985
1985
|
textareaProps: x
|
|
1986
1986
|
}) => {
|
|
1987
|
-
const g = H(),
|
|
1988
|
-
color:
|
|
1987
|
+
const g = H(), w = g.colors.error, k = r ? w : t || g.colors.primary, b = Gs({
|
|
1988
|
+
color: k,
|
|
1989
1989
|
disabled: e,
|
|
1990
1990
|
placeholderOpacity: l
|
|
1991
1991
|
}), E = {
|
|
@@ -2110,24 +2110,24 @@ const Zs = "Select-module__select___cjdcr", Qs = "Select-module__sizeSmall___i1q
|
|
|
2110
2110
|
// Element-specific props
|
|
2111
2111
|
selectProps: z
|
|
2112
2112
|
}) => {
|
|
2113
|
-
const x = H(), g = x.colors.error,
|
|
2114
|
-
color:
|
|
2113
|
+
const x = H(), g = x.colors.error, w = r ? g : t || x.colors.primary, k = Ys({
|
|
2114
|
+
color: w,
|
|
2115
2115
|
disabled: e
|
|
2116
2116
|
}), b = {
|
|
2117
2117
|
"--select-padding-small": `calc(${x.fonts.rhythm} * ${x.sizes.small.paddingVertical}) calc(${x.fonts.rhythm} * 1.2) calc(${x.fonts.rhythm} * ${x.sizes.small.paddingVertical}) calc(${x.fonts.rhythm} * ${x.inputs.paddingHorizontal})`,
|
|
2118
2118
|
"--select-padding-large": `calc(${x.fonts.rhythm} * ${x.sizes.large.paddingVertical}) calc(${x.fonts.rhythm} * 1.4) calc(${x.fonts.rhythm} * ${x.sizes.large.paddingVertical}) calc(${x.fonts.rhythm} * ${x.inputs.paddingHorizontal})`,
|
|
2119
|
-
backgroundImage:
|
|
2119
|
+
backgroundImage: k.backgroundImage,
|
|
2120
2120
|
backgroundPosition: "right center",
|
|
2121
2121
|
backgroundRepeat: "no-repeat",
|
|
2122
2122
|
backgroundSize: "auto 85%",
|
|
2123
2123
|
backgroundColor: "transparent",
|
|
2124
|
-
borderColor:
|
|
2124
|
+
borderColor: k.borderColor,
|
|
2125
2125
|
borderWidth: x.border.width,
|
|
2126
2126
|
borderRadius: x.border.radius,
|
|
2127
|
-
color:
|
|
2128
|
-
cursor:
|
|
2127
|
+
color: k.color,
|
|
2128
|
+
cursor: k.cursor,
|
|
2129
2129
|
fontSize: x.fonts.size,
|
|
2130
|
-
opacity:
|
|
2130
|
+
opacity: k.opacity,
|
|
2131
2131
|
...m
|
|
2132
2132
|
// Top level style overrides
|
|
2133
2133
|
}, E = [
|
|
@@ -2251,15 +2251,15 @@ const Xs = "Radio-module__container___AQxhk", eo = "Radio-module__svg___zl5kF",
|
|
|
2251
2251
|
// Element-specific props
|
|
2252
2252
|
divProps: h
|
|
2253
2253
|
}) => {
|
|
2254
|
-
const m = H(), z = n || Xt(), x = m.colors.error, g = s ? x : e || m.colors.primary,
|
|
2254
|
+
const m = H(), z = n || Xt(), x = m.colors.error, g = s ? x : e || m.colors.primary, w = ro({
|
|
2255
2255
|
color: g,
|
|
2256
2256
|
disabled: t
|
|
2257
|
-
}),
|
|
2257
|
+
}), k = (O) => {
|
|
2258
2258
|
t || a(O);
|
|
2259
2259
|
}, b = {
|
|
2260
|
-
cursor:
|
|
2260
|
+
cursor: w.cursor,
|
|
2261
2261
|
fontSize: m.fonts.size,
|
|
2262
|
-
opacity:
|
|
2262
|
+
opacity: w.opacity,
|
|
2263
2263
|
...d
|
|
2264
2264
|
// Top level style overrides
|
|
2265
2265
|
}, E = {
|
|
@@ -2267,9 +2267,9 @@ const Xs = "Radio-module__container___AQxhk", eo = "Radio-module__svg___zl5kF",
|
|
|
2267
2267
|
}, $ = {
|
|
2268
2268
|
fill: "transparent",
|
|
2269
2269
|
strokeWidth: "12.5",
|
|
2270
|
-
stroke:
|
|
2270
|
+
stroke: w.radioColor
|
|
2271
2271
|
}, A = {
|
|
2272
|
-
fill:
|
|
2272
|
+
fill: w.radioColor
|
|
2273
2273
|
}, M = [Je.container, u].filter(Boolean).join(" ");
|
|
2274
2274
|
return /* @__PURE__ */ G("div", { ...h, className: M, style: b, children: [
|
|
2275
2275
|
/* @__PURE__ */ S(
|
|
@@ -2279,7 +2279,7 @@ const Xs = "Radio-module__container___AQxhk", eo = "Radio-module__svg___zl5kF",
|
|
|
2279
2279
|
checked: r,
|
|
2280
2280
|
disabled: t,
|
|
2281
2281
|
name: o,
|
|
2282
|
-
onChange: (O) =>
|
|
2282
|
+
onChange: (O) => k({ target: { checked: O.target.checked, name: o, type: "radio" } }),
|
|
2283
2283
|
style: { display: "none" },
|
|
2284
2284
|
type: "radio"
|
|
2285
2285
|
}
|
|
@@ -2289,7 +2289,7 @@ const Xs = "Radio-module__container___AQxhk", eo = "Radio-module__svg___zl5kF",
|
|
|
2289
2289
|
{
|
|
2290
2290
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2291
2291
|
viewBox: "0 0 100 100",
|
|
2292
|
-
onClick: () =>
|
|
2292
|
+
onClick: () => k({ target: { checked: !r, name: o, type: "radio" } }),
|
|
2293
2293
|
className: Je.svg,
|
|
2294
2294
|
style: E,
|
|
2295
2295
|
children: [
|
|
@@ -2304,7 +2304,7 @@ const Xs = "Radio-module__container___AQxhk", eo = "Radio-module__svg___zl5kF",
|
|
|
2304
2304
|
htmlFor: z,
|
|
2305
2305
|
className: Je.label,
|
|
2306
2306
|
style: { paddingBottom: 0, ...f },
|
|
2307
|
-
color:
|
|
2307
|
+
color: w.radioColor,
|
|
2308
2308
|
disabled: t,
|
|
2309
2309
|
error: s,
|
|
2310
2310
|
children: l
|
|
@@ -2413,27 +2413,27 @@ function yn({
|
|
|
2413
2413
|
}
|
|
2414
2414
|
},
|
|
2415
2415
|
children: ({ value: u, onChange: d, name: h, error: m }) => {
|
|
2416
|
-
const z = Array.isArray(u) ? u : [], x = (g,
|
|
2417
|
-
d(
|
|
2416
|
+
const z = Array.isArray(u) ? u : [], x = (g, w) => {
|
|
2417
|
+
d(w ? [...z, g] : z.filter((k) => k !== g));
|
|
2418
2418
|
};
|
|
2419
2419
|
return /* @__PURE__ */ S(ke, { children: s ? s.map((g) => /* @__PURE__ */ S(
|
|
2420
2420
|
rt,
|
|
2421
2421
|
{
|
|
2422
2422
|
name: `${h}[]`,
|
|
2423
2423
|
checked: z.includes(g.value),
|
|
2424
|
-
onChange: (
|
|
2424
|
+
onChange: (w) => x(g.value, w.target.checked),
|
|
2425
2425
|
label: g.label,
|
|
2426
2426
|
disabled: n || g.disabled,
|
|
2427
2427
|
error: m
|
|
2428
2428
|
},
|
|
2429
2429
|
g.value
|
|
2430
|
-
)) :
|
|
2431
|
-
if (
|
|
2432
|
-
const
|
|
2433
|
-
return
|
|
2430
|
+
)) : F.Children.map(o, (g) => {
|
|
2431
|
+
if (F.isValidElement(g) && g.type === rt) {
|
|
2432
|
+
const w = g.props.value || g.props.name;
|
|
2433
|
+
return F.cloneElement(g, {
|
|
2434
2434
|
name: `${h}[]`,
|
|
2435
|
-
checked: z.includes(
|
|
2436
|
-
onChange: (
|
|
2435
|
+
checked: z.includes(w),
|
|
2436
|
+
onChange: (k) => x(w, k.target.checked),
|
|
2437
2437
|
error: m || g.props.error,
|
|
2438
2438
|
disabled: n || g.props.disabled
|
|
2439
2439
|
});
|
|
@@ -2559,7 +2559,7 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2559
2559
|
// Element-specific props
|
|
2560
2560
|
headerProps: g
|
|
2561
2561
|
}) => {
|
|
2562
|
-
const
|
|
2562
|
+
const w = H(), k = d || w.breakpoints.sm, { maxWidth: b, unit: E } = we(k), $ = ae(`(max-width: ${b}${E})`), A = uo({
|
|
2563
2563
|
isSmallScreen: $,
|
|
2564
2564
|
maxWidth: t,
|
|
2565
2565
|
minWidth: s,
|
|
@@ -2641,8 +2641,8 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2641
2641
|
navProps: a
|
|
2642
2642
|
}) => {
|
|
2643
2643
|
var X;
|
|
2644
|
-
const [l, f] = Me(!1), u = Pe(null), d = Pe(null), h = H(), m = { ...h.breakpoints, ...t }, { maxWidth: z, unit: x } = we(m.md), { maxWidth: g, unit:
|
|
2645
|
-
isMobile:
|
|
2644
|
+
const [l, f] = Me(!1), u = Pe(null), d = Pe(null), h = H(), m = { ...h.breakpoints, ...t }, { maxWidth: z, unit: x } = we(m.md), { maxWidth: g, unit: w } = we(m.sm), k = ae(`(max-width: ${z}${x})`), b = ae(`(max-width: ${g}${w})`), { navStyles: E, linkActiveStyles: $, linkHoverStyles: A } = vo({
|
|
2645
|
+
isMobile: k,
|
|
2646
2646
|
isCompact: b,
|
|
2647
2647
|
mobile: e,
|
|
2648
2648
|
desktop: r
|
|
@@ -2659,13 +2659,13 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2659
2659
|
}
|
|
2660
2660
|
};
|
|
2661
2661
|
xe(() => {
|
|
2662
|
-
if (
|
|
2662
|
+
if (k && l) {
|
|
2663
2663
|
const N = window.scrollY;
|
|
2664
2664
|
return document.body.style.position = "fixed", document.body.style.top = `-${N}px`, document.body.style.width = "100%", () => {
|
|
2665
2665
|
document.body.style.position = "", document.body.style.top = "", document.body.style.width = "", window.scrollTo(0, N);
|
|
2666
2666
|
};
|
|
2667
2667
|
}
|
|
2668
|
-
}, [
|
|
2668
|
+
}, [k, l]), xe(() => {
|
|
2669
2669
|
const N = (P) => {
|
|
2670
2670
|
!d.current || d.current.contains(P.target) || u.current && u.current.contains(P.target) || f(!1);
|
|
2671
2671
|
};
|
|
@@ -2675,20 +2675,20 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2675
2675
|
}, [u, d, f]);
|
|
2676
2676
|
const O = [
|
|
2677
2677
|
ge.nav,
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2678
|
+
k ? ge.navMobile : ge.navDesktop,
|
|
2679
|
+
k && l ? ge.open : "",
|
|
2680
|
+
k && (b || e != null && e.compact) ? ge.compact : "",
|
|
2681
2681
|
o
|
|
2682
2682
|
].filter(Boolean).join(" "), Y = (N) => {
|
|
2683
|
-
if (!
|
|
2683
|
+
if (!k) return;
|
|
2684
2684
|
N.target.closest("a, button") && f(!1);
|
|
2685
|
-
}, B =
|
|
2685
|
+
}, B = k ? (e == null ? void 0 : e.content) || s : (r == null ? void 0 : r.content) || s, J = l ? (e == null ? void 0 : e.hamburgerColor) || (e == null ? void 0 : e.color) || h.colors.secondary : (X = e == null ? void 0 : e.hamburgerProps) == null ? void 0 : X.color;
|
|
2686
2686
|
return /* @__PURE__ */ G(ke, { children: [
|
|
2687
2687
|
/* @__PURE__ */ S(
|
|
2688
2688
|
io,
|
|
2689
2689
|
{
|
|
2690
2690
|
hamburgerRef: u,
|
|
2691
|
-
visible:
|
|
2691
|
+
visible: k,
|
|
2692
2692
|
compact: b,
|
|
2693
2693
|
open: l,
|
|
2694
2694
|
setOpen: f,
|
|
@@ -2705,7 +2705,7 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2705
2705
|
style: { ...M, ...n },
|
|
2706
2706
|
onClickCapture: Y,
|
|
2707
2707
|
children: [
|
|
2708
|
-
|
|
2708
|
+
k && l && /* @__PURE__ */ S("div", { className: ge.navHeader }),
|
|
2709
2709
|
typeof B == "function" ? B({ setOpen: f }) : B
|
|
2710
2710
|
]
|
|
2711
2711
|
}
|
|
@@ -2822,10 +2822,10 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2822
2822
|
style: x,
|
|
2823
2823
|
divProps: g
|
|
2824
2824
|
}) => {
|
|
2825
|
-
const
|
|
2825
|
+
const w = H(), k = Pe(null), b = Pe(null), { maxWidth: E } = we(w.breakpoints.md), $ = ae(`(max-width: ${E - 1}px)`);
|
|
2826
2826
|
xe(() => {
|
|
2827
2827
|
if (e)
|
|
2828
|
-
return b.current = document.activeElement, document.body.style.overflow = "hidden",
|
|
2828
|
+
return b.current = document.activeElement, document.body.style.overflow = "hidden", k.current && k.current.focus(), () => {
|
|
2829
2829
|
document.body.style.overflow = "", b.current && b.current.focus();
|
|
2830
2830
|
};
|
|
2831
2831
|
}, [e]), xe(() => {
|
|
@@ -2842,8 +2842,8 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2842
2842
|
const M = {
|
|
2843
2843
|
width: u,
|
|
2844
2844
|
maxWidth: d,
|
|
2845
|
-
backgroundColor: h ||
|
|
2846
|
-
borderRadius:
|
|
2845
|
+
backgroundColor: h || w.colors.secondary,
|
|
2846
|
+
borderRadius: w.border.radius,
|
|
2847
2847
|
...x
|
|
2848
2848
|
}, O = {
|
|
2849
2849
|
backgroundColor: m
|
|
@@ -2857,7 +2857,7 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2857
2857
|
children: /* @__PURE__ */ G(
|
|
2858
2858
|
"div",
|
|
2859
2859
|
{
|
|
2860
|
-
ref:
|
|
2860
|
+
ref: k,
|
|
2861
2861
|
className: [ue.modal, z].filter(Boolean).join(" "),
|
|
2862
2862
|
style: M,
|
|
2863
2863
|
role: "dialog",
|
|
@@ -2920,7 +2920,7 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2920
2920
|
);
|
|
2921
2921
|
return Br(Y, document.body);
|
|
2922
2922
|
}, vr = Zt(null), gn = ({ children: e }) => {
|
|
2923
|
-
const [r, t] = Me(null), s =
|
|
2923
|
+
const [r, t] = Me(null), s = F.useCallback((u) => new Promise((d, h) => {
|
|
2924
2924
|
const m = Math.random().toString(36).substr(2, 9);
|
|
2925
2925
|
t({
|
|
2926
2926
|
id: m,
|
|
@@ -2931,9 +2931,9 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2931
2931
|
resolve: d,
|
|
2932
2932
|
reject: h
|
|
2933
2933
|
});
|
|
2934
|
-
}), []), o =
|
|
2934
|
+
}), []), o = F.useCallback((u) => {
|
|
2935
2935
|
t((d) => (d && d.resolve(u), null));
|
|
2936
|
-
}, []), n =
|
|
2936
|
+
}, []), n = F.useCallback(
|
|
2937
2937
|
(u) => s({
|
|
2938
2938
|
title: u.title || "Confirm",
|
|
2939
2939
|
content: u.message,
|
|
@@ -2952,7 +2952,7 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2952
2952
|
options: u.options
|
|
2953
2953
|
}),
|
|
2954
2954
|
[s]
|
|
2955
|
-
), a =
|
|
2955
|
+
), a = F.useCallback(
|
|
2956
2956
|
(u) => s({
|
|
2957
2957
|
title: u.title || "Alert",
|
|
2958
2958
|
content: u.message,
|
|
@@ -2966,9 +2966,9 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
2966
2966
|
options: u.options
|
|
2967
2967
|
}),
|
|
2968
2968
|
[s]
|
|
2969
|
-
), l =
|
|
2969
|
+
), l = F.useCallback(() => {
|
|
2970
2970
|
o();
|
|
2971
|
-
}, [o]), f =
|
|
2971
|
+
}, [o]), f = F.useMemo(
|
|
2972
2972
|
() => ({
|
|
2973
2973
|
show: s,
|
|
2974
2974
|
resolve: o,
|
|
@@ -3022,13 +3022,13 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
3022
3022
|
// Element-specific props
|
|
3023
3023
|
sectionProps: x
|
|
3024
3024
|
}) => {
|
|
3025
|
-
const g = H(),
|
|
3025
|
+
const g = H(), w = ae(`(min-width: ${g.breakpoints.sm})`), k = {
|
|
3026
3026
|
backgroundColor: e,
|
|
3027
3027
|
color: r || g.fonts.color,
|
|
3028
3028
|
margin: f,
|
|
3029
3029
|
...z
|
|
3030
3030
|
// Top level style prop overrides
|
|
3031
|
-
}, b = `calc(${g.fonts.rhythm} * ${d})`, E =
|
|
3031
|
+
}, b = `calc(${g.fonts.rhythm} * ${d})`, E = w ? a || g.layout.padding : l || g.layout.paddingSm, $ = {
|
|
3032
3032
|
"--max-width": t || g.layout.maxWidth,
|
|
3033
3033
|
"--min-width": s,
|
|
3034
3034
|
"--width": o,
|
|
@@ -3036,7 +3036,7 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
3036
3036
|
"--section-padding": `${b} ${E}`,
|
|
3037
3037
|
"--gap": u
|
|
3038
3038
|
}, A = [Ut.section, m].filter(Boolean).join(" ");
|
|
3039
|
-
return /* @__PURE__ */ S("section", { ...x, className: A, style:
|
|
3039
|
+
return /* @__PURE__ */ S("section", { ...x, className: A, style: k, children: /* @__PURE__ */ S("div", { className: Ut.innerDiv, style: $, children: h }) });
|
|
3040
3040
|
}, Ro = "Hero-module__hero___IB2tg", Lo = "Hero-module__content___rkkfQ", Wt = {
|
|
3041
3041
|
hero: Ro,
|
|
3042
3042
|
content: Lo
|
|
@@ -3126,7 +3126,7 @@ const so = "Hamburger-module__hamburger___Tf4-t", oo = "Hamburger-module__line__
|
|
|
3126
3126
|
// Element-specific props
|
|
3127
3127
|
footerProps: x
|
|
3128
3128
|
}) => {
|
|
3129
|
-
const g = H(),
|
|
3129
|
+
const g = H(), w = d || g.breakpoints.sm, { maxWidth: k, unit: b } = we(w), E = ae(`(max-width: ${k}${b})`), $ = Oo({
|
|
3130
3130
|
isSmallScreen: E,
|
|
3131
3131
|
maxWidth: t,
|
|
3132
3132
|
minWidth: s,
|