@obosbbl/grunnmuren-react 1.14.0-beta.2 → 1.14.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Form/MultiStep/FormStepContext.d.ts +6 -0
- package/dist/grunnmuren.mjs +269 -251
- package/package.json +15 -15
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export type FieldValues = Record<string, unknown>;
|
|
3
|
+
export declare function useFormContext(): {
|
|
4
|
+
activeStep: number;
|
|
5
|
+
formData: any;
|
|
6
|
+
};
|
|
3
7
|
export declare function useFormStepContext<FormStepData extends FieldValues>(formStep: number): {
|
|
4
8
|
isActive: boolean;
|
|
5
9
|
activeStep: number;
|
|
6
10
|
setActiveStep: (step: number) => void;
|
|
7
11
|
previousFormStep: () => Promise<void>;
|
|
12
|
+
nextFormStep: () => void;
|
|
8
13
|
submitAndNextFormStep: (formValues: FormStepData) => void;
|
|
14
|
+
setFormData: (formValues: FormStepData) => void;
|
|
9
15
|
formData: any;
|
|
10
16
|
};
|
|
11
17
|
export declare function FormStepProvider({ children }: {
|
package/dist/grunnmuren.mjs
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as o, jsxs as f, Fragment as O } from "react/jsx-runtime";
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { ChevronDown as
|
|
3
|
+
import { createContext as w, useContext as A, useState as q, useCallback as N, useEffect as fe, useId as $, forwardRef as h, Children as Z, isValidElement as ee, cloneElement as W, useRef as E, useMemo as C, useReducer as ge } from "react";
|
|
4
|
+
import { ChevronDown as te, Warning as re, InfoCircle as ne, LoadingSpinner as he, CheckCircle as pe, MenuAlt as Ae, Close as xe, ChevronRight as ve, ChevronLeft as Ne } from "@obosbbl/grunnmuren-icons";
|
|
5
5
|
import { useCollapse as we } from "react-collapsed";
|
|
6
6
|
import l from "clsx";
|
|
7
|
-
import { useMediaQuery as
|
|
8
|
-
import K from "
|
|
9
|
-
const
|
|
7
|
+
import { useMediaQuery as ae, useUpdateEffect as ye } from "@react-hookz/web";
|
|
8
|
+
import { mergeRefs as K } from "react-merge-refs";
|
|
9
|
+
const I = () => {
|
|
10
10
|
}, Ie = 300, Ce = "duration-300", X = (e) => {
|
|
11
11
|
const { className: r, ...t } = e;
|
|
12
12
|
return /* @__PURE__ */ o("div", { className: l(r, "flex flex-col gap-2"), ...t });
|
|
13
|
-
}, Y =
|
|
13
|
+
}, Y = w({
|
|
14
14
|
isExpanded: !1,
|
|
15
|
-
setExpanded:
|
|
15
|
+
setExpanded: I,
|
|
16
16
|
// @ts-expect-error noop
|
|
17
|
-
getCollapseProps:
|
|
17
|
+
getCollapseProps: I,
|
|
18
18
|
// @ts-expect-error noop
|
|
19
|
-
getToggleProps:
|
|
20
|
-
onChange:
|
|
19
|
+
getToggleProps: I,
|
|
20
|
+
onChange: I
|
|
21
21
|
}), Ee = (e) => {
|
|
22
|
-
const { className: r, defaultOpen: t, onChange: n =
|
|
22
|
+
const { className: r, defaultOpen: t, onChange: n = I, open: a, ...s } = e, i = we({
|
|
23
23
|
defaultExpanded: t,
|
|
24
24
|
isExpanded: a,
|
|
25
25
|
duration: Ie,
|
|
@@ -37,7 +37,7 @@ const y = () => {
|
|
|
37
37
|
}
|
|
38
38
|
) });
|
|
39
39
|
}, Re = (e) => {
|
|
40
|
-
const { children: r, className: t, as: n = "h3", ...a } = e, { getToggleProps: s, onChange: i, isExpanded:
|
|
40
|
+
const { children: r, className: t, as: n = "h3", ...a } = e, { getToggleProps: s, onChange: i, isExpanded: d } = A(Y), m = s({ onClick: () => i(!d) });
|
|
41
41
|
return /* @__PURE__ */ o(n, { children: /* @__PURE__ */ f(
|
|
42
42
|
"button",
|
|
43
43
|
{
|
|
@@ -47,11 +47,11 @@ const y = () => {
|
|
|
47
47
|
),
|
|
48
48
|
...a,
|
|
49
49
|
...m,
|
|
50
|
-
id:
|
|
50
|
+
id: oe(m["aria-controls"]),
|
|
51
51
|
children: [
|
|
52
52
|
r,
|
|
53
53
|
/* @__PURE__ */ o(
|
|
54
|
-
|
|
54
|
+
te,
|
|
55
55
|
{
|
|
56
56
|
className: `shrink-0 text-sm ${Ce} group-aria-expanded:rotate-180`
|
|
57
57
|
}
|
|
@@ -61,12 +61,12 @@ const y = () => {
|
|
|
61
61
|
) });
|
|
62
62
|
}, ke = (e) => {
|
|
63
63
|
const { getCollapseProps: r } = A(Y), { className: t, ...n } = e, a = r();
|
|
64
|
-
return /* @__PURE__ */ o("div", { ...a, "aria-labelledby":
|
|
65
|
-
},
|
|
64
|
+
return /* @__PURE__ */ o("div", { ...a, "aria-labelledby": oe(a.id), children: /* @__PURE__ */ o("div", { className: l(t, "p-5 pb-10"), ...n }) });
|
|
65
|
+
}, oe = (e) => e + "toggle";
|
|
66
66
|
X.Item = Ee;
|
|
67
67
|
X.Header = Re;
|
|
68
68
|
X.Content = ke;
|
|
69
|
-
const
|
|
69
|
+
const ct = (e) => {
|
|
70
70
|
const { className: r, children: t, heading: n, severity: a = "alert", ...s } = e;
|
|
71
71
|
return /* @__PURE__ */ o(
|
|
72
72
|
"section",
|
|
@@ -92,8 +92,8 @@ const dt = (e) => {
|
|
|
92
92
|
] })
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
|
-
}, Se = ({ severity: e, className: r }) => e === "alert" ? /* @__PURE__ */ o(
|
|
96
|
-
function
|
|
95
|
+
}, Se = ({ severity: e, className: r }) => e === "alert" ? /* @__PURE__ */ o(re, { className: l(r, "text-red") }) : /* @__PURE__ */ o(ne, { className: l(r, "text-orange") }), qe = "(prefers-reduced-motion: reduce)", dt = (e = !1) => ae(qe, { initializeWithValue: e });
|
|
96
|
+
function se(e) {
|
|
97
97
|
switch (e) {
|
|
98
98
|
case "gray":
|
|
99
99
|
return "bg-gray-lightest";
|
|
@@ -107,31 +107,31 @@ function oe(e) {
|
|
|
107
107
|
return "bg-sky-light";
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
const Le = (e) =>
|
|
110
|
+
const Le = (e) => ae("(max-width: 767.9px)", { initializeWithValue: e });
|
|
111
111
|
function L(e, r = !0) {
|
|
112
|
-
const [t, n] = q("indeterminate"), [a, s] = q(), i =
|
|
113
|
-
|
|
114
|
-
}, []),
|
|
115
|
-
(
|
|
116
|
-
t !== "indeterminate" &&
|
|
112
|
+
const [t, n] = q("indeterminate"), [a, s] = q(), i = N((c) => {
|
|
113
|
+
c.target.checkValidity() && (n("valid"), s(void 0));
|
|
114
|
+
}, []), d = N(
|
|
115
|
+
(c) => {
|
|
116
|
+
t !== "indeterminate" && c.target.checkValidity() && (n("valid"), s(void 0));
|
|
117
117
|
},
|
|
118
118
|
[t]
|
|
119
|
-
), m =
|
|
120
|
-
|
|
121
|
-
const u =
|
|
119
|
+
), m = N((c) => {
|
|
120
|
+
c.preventDefault();
|
|
121
|
+
const u = c.target.validationMessage;
|
|
122
122
|
s(u), n("invalid");
|
|
123
123
|
}, []);
|
|
124
124
|
return fe(() => {
|
|
125
125
|
var u;
|
|
126
|
-
const { current:
|
|
126
|
+
const { current: c } = e;
|
|
127
127
|
return r && // @ts-expect-error respect the <form noValidate> attribute if we are rendered inside a form
|
|
128
|
-
((u =
|
|
129
|
-
|
|
128
|
+
((u = c == null ? void 0 : c.form) == null ? void 0 : u.noValidate) !== !0 && (c == null || c.addEventListener("blur", i), c == null || c.addEventListener("input", d), c == null || c.addEventListener("invalid", m)), () => {
|
|
129
|
+
c == null || c.removeEventListener("blur", i), c == null || c.removeEventListener("input", d), c == null || c.removeEventListener("invalid", m);
|
|
130
130
|
};
|
|
131
|
-
}, [r,
|
|
131
|
+
}, [r, d]), { validity: t, validationMessage: a };
|
|
132
132
|
}
|
|
133
133
|
function R(e) {
|
|
134
|
-
const r =
|
|
134
|
+
const r = $();
|
|
135
135
|
return e ?? r;
|
|
136
136
|
}
|
|
137
137
|
const mt = (e) => {
|
|
@@ -142,8 +142,8 @@ const mt = (e) => {
|
|
|
142
142
|
heading: a,
|
|
143
143
|
image: s,
|
|
144
144
|
...i
|
|
145
|
-
} = e,
|
|
146
|
-
return /* @__PURE__ */ o("article", { className: l(t,
|
|
145
|
+
} = e, d = se(r);
|
|
146
|
+
return /* @__PURE__ */ o("article", { className: l(t, d, "px-4 py-8 md:py-14"), ...i, children: /* @__PURE__ */ f("div", { className: "container flex flex-col justify-center gap-4 md:flex-row md:gap-12", children: [
|
|
147
147
|
s,
|
|
148
148
|
/* @__PURE__ */ f("div", { className: "max-w-prose", children: [
|
|
149
149
|
a && /* @__PURE__ */ o("h2", { className: "h3 mb-4", children: a }),
|
|
@@ -158,7 +158,7 @@ const mt = (e) => {
|
|
|
158
158
|
className: "w-20 flex-none self-center md:w-32 md:self-start",
|
|
159
159
|
...e
|
|
160
160
|
}
|
|
161
|
-
),
|
|
161
|
+
), Pe = {
|
|
162
162
|
"standard-primary": "bg-green border-green text-white",
|
|
163
163
|
"standard-secondary": "bg-white border-green text-black",
|
|
164
164
|
"mint-primary": "bg-mint border-mint text-black",
|
|
@@ -167,22 +167,22 @@ const mt = (e) => {
|
|
|
167
167
|
"white-secondary": "bg-transparent border-white text-white",
|
|
168
168
|
"light-green-primary": "bg-green-light border-green-light text-black",
|
|
169
169
|
"light-green-secondary": "bg-transparent border-green-light text-green-light"
|
|
170
|
-
}, bt =
|
|
170
|
+
}, bt = h((e, r) => {
|
|
171
171
|
const {
|
|
172
172
|
children: t,
|
|
173
173
|
className: n,
|
|
174
174
|
color: a,
|
|
175
175
|
href: s,
|
|
176
176
|
loading: i,
|
|
177
|
-
type:
|
|
177
|
+
type: d = "button",
|
|
178
178
|
variant: m = "primary",
|
|
179
|
-
...
|
|
180
|
-
} = e, u = A(
|
|
179
|
+
...c
|
|
180
|
+
} = e, u = A(P), b = Pe[`${a ?? u}-${m}`], p = l(n, b, "button"), v = i ? /* @__PURE__ */ o(Me, { children: t }) : t;
|
|
181
181
|
return /* @__PURE__ */ o(O, { children: s ? /* @__PURE__ */ o(
|
|
182
182
|
"a",
|
|
183
183
|
{
|
|
184
184
|
"aria-busy": i ? !0 : void 0,
|
|
185
|
-
...
|
|
185
|
+
...c,
|
|
186
186
|
href: s,
|
|
187
187
|
ref: r,
|
|
188
188
|
className: p,
|
|
@@ -192,45 +192,45 @@ const mt = (e) => {
|
|
|
192
192
|
"button",
|
|
193
193
|
{
|
|
194
194
|
"aria-busy": i ? !0 : void 0,
|
|
195
|
-
...
|
|
196
|
-
type:
|
|
195
|
+
...c,
|
|
196
|
+
type: d,
|
|
197
197
|
ref: r,
|
|
198
198
|
className: p,
|
|
199
199
|
children: v
|
|
200
200
|
}
|
|
201
201
|
) });
|
|
202
|
-
}),
|
|
203
|
-
|
|
202
|
+
}), Me = (e) => /* @__PURE__ */ f(O, { children: [
|
|
203
|
+
ie(e.children),
|
|
204
204
|
/* @__PURE__ */ o(
|
|
205
205
|
"span",
|
|
206
206
|
{
|
|
207
207
|
className: "!visible absolute bottom-1 left-1 right-1 top-1 grid place-items-center overflow-hidden bg-inherit",
|
|
208
208
|
"aria-hidden": !0,
|
|
209
|
-
children: /* @__PURE__ */ o(
|
|
209
|
+
children: /* @__PURE__ */ o(he, { className: "animate-spin" })
|
|
210
210
|
}
|
|
211
211
|
)
|
|
212
212
|
] });
|
|
213
|
-
function
|
|
213
|
+
function ie(e) {
|
|
214
214
|
return Z.map(e, (r) => {
|
|
215
|
-
if (
|
|
215
|
+
if (!ee(r))
|
|
216
216
|
return typeof r == "string" ? /* @__PURE__ */ o("span", { children: r }) : r;
|
|
217
217
|
if (r.props.children) {
|
|
218
218
|
const t = {
|
|
219
|
-
children:
|
|
219
|
+
children: ie(r.props.children)
|
|
220
220
|
};
|
|
221
221
|
r = W(r, t);
|
|
222
222
|
}
|
|
223
223
|
return r;
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const P = w("standard"), le = w(!0), ze = (e, r) => {
|
|
227
227
|
const {
|
|
228
228
|
as: t = "div",
|
|
229
229
|
body: n,
|
|
230
230
|
className: a,
|
|
231
231
|
image: s,
|
|
232
232
|
rightAlignBody: i = !0,
|
|
233
|
-
...
|
|
233
|
+
...d
|
|
234
234
|
} = e;
|
|
235
235
|
return /* @__PURE__ */ f(
|
|
236
236
|
t,
|
|
@@ -239,15 +239,15 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
239
239
|
a,
|
|
240
240
|
"grid gap-8 md:grid-flow-col md:grid-cols-[50%,50%] md:gap-0"
|
|
241
241
|
),
|
|
242
|
-
...
|
|
242
|
+
...d,
|
|
243
243
|
ref: r,
|
|
244
244
|
children: [
|
|
245
|
-
/* @__PURE__ */ o(
|
|
245
|
+
/* @__PURE__ */ o(le.Provider, { value: i, children: s }),
|
|
246
246
|
n
|
|
247
247
|
]
|
|
248
248
|
}
|
|
249
249
|
);
|
|
250
|
-
}, Ve =
|
|
250
|
+
}, Ve = h(ze), Te = h(
|
|
251
251
|
(e, r) => {
|
|
252
252
|
const { className: t, ...n } = e;
|
|
253
253
|
return /* @__PURE__ */ o(
|
|
@@ -259,16 +259,16 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
261
|
}
|
|
262
|
-
), Fe =
|
|
262
|
+
), Fe = h(
|
|
263
263
|
(e, r) => {
|
|
264
|
-
const { className: t, children: n, ...a } = e, s = A(
|
|
264
|
+
const { className: t, children: n, ...a } = e, s = A(le), i = l(
|
|
265
265
|
t,
|
|
266
266
|
"max-md:rounded-b-3xl w-full",
|
|
267
267
|
s ? "md:rounded-r-3xl" : "md:rounded-l-3xl md:order-1"
|
|
268
268
|
);
|
|
269
|
-
if (
|
|
270
|
-
const
|
|
271
|
-
return W(
|
|
269
|
+
if (ee(n)) {
|
|
270
|
+
const d = Z.only(n);
|
|
271
|
+
return W(d, {
|
|
272
272
|
// @ts-expect-error assume className prop is allowed
|
|
273
273
|
className: i,
|
|
274
274
|
ref: r,
|
|
@@ -298,7 +298,7 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
298
298
|
ref: r
|
|
299
299
|
}
|
|
300
300
|
);
|
|
301
|
-
},
|
|
301
|
+
}, gt = h(Je), ht = h(
|
|
302
302
|
(e, r) => {
|
|
303
303
|
const { className: t, ...n } = e;
|
|
304
304
|
return /* @__PURE__ */ o(
|
|
@@ -311,9 +311,9 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
311
311
|
}
|
|
312
312
|
);
|
|
313
313
|
}
|
|
314
|
-
), pt =
|
|
314
|
+
), pt = h(
|
|
315
315
|
(e, r) => {
|
|
316
|
-
const { bgColor: t, className: n, ...a } = e, s =
|
|
316
|
+
const { bgColor: t, className: n, ...a } = e, s = se(t);
|
|
317
317
|
return /* @__PURE__ */ o("div", { className: l(s, n), children: /* @__PURE__ */ o(
|
|
318
318
|
"div",
|
|
319
319
|
{
|
|
@@ -323,12 +323,12 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
323
323
|
}
|
|
324
324
|
) });
|
|
325
325
|
}
|
|
326
|
-
), At =
|
|
326
|
+
), At = h(
|
|
327
327
|
(e, r) => {
|
|
328
328
|
const { className: t, ...n } = e;
|
|
329
329
|
return /* @__PURE__ */ o("div", { className: l(t, "p-8 md:px-10"), ...n, ref: r });
|
|
330
330
|
}
|
|
331
|
-
), xt =
|
|
331
|
+
), xt = h((e, r) => {
|
|
332
332
|
const { className: t, ...n } = e;
|
|
333
333
|
return /* @__PURE__ */ o(
|
|
334
334
|
"a",
|
|
@@ -341,7 +341,7 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
341
341
|
...n
|
|
342
342
|
}
|
|
343
343
|
);
|
|
344
|
-
}), vt =
|
|
344
|
+
}), vt = h(
|
|
345
345
|
(e, r) => {
|
|
346
346
|
const {
|
|
347
347
|
children: t,
|
|
@@ -349,17 +349,17 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
349
349
|
error: a,
|
|
350
350
|
id: s,
|
|
351
351
|
disableValidation: i = !1,
|
|
352
|
-
...
|
|
353
|
-
} = e, m = E(null), { validity:
|
|
352
|
+
...d
|
|
353
|
+
} = e, m = E(null), { validity: c, validationMessage: u } = L(
|
|
354
354
|
m,
|
|
355
355
|
!i
|
|
356
|
-
),
|
|
356
|
+
), g = R(s), b = g + "err", p = a || u;
|
|
357
357
|
return /* @__PURE__ */ f("div", { className: "grid gap-2", children: [
|
|
358
358
|
/* @__PURE__ */ f("label", { className: l(n, "flex cursor-pointer gap-2.5"), children: [
|
|
359
359
|
/* @__PURE__ */ o(
|
|
360
360
|
"input",
|
|
361
361
|
{
|
|
362
|
-
id:
|
|
362
|
+
id: g,
|
|
363
363
|
className: l(
|
|
364
364
|
"checkbox checked:bg-green checked:border-green grid h-[1.25em] w-[1.25em] flex-none translate-y-[0.1em] cursor-pointer appearance-none place-content-center rounded border-2 border-solid bg-white text-white focus:outline-none focus:ring-2",
|
|
365
365
|
{
|
|
@@ -369,9 +369,9 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
369
369
|
),
|
|
370
370
|
ref: r,
|
|
371
371
|
type: "checkbox",
|
|
372
|
-
...
|
|
372
|
+
...d,
|
|
373
373
|
"aria-describedby": p ? b : void 0,
|
|
374
|
-
"aria-invalid": !!a ||
|
|
374
|
+
"aria-invalid": !!a || c === "invalid"
|
|
375
375
|
}
|
|
376
376
|
),
|
|
377
377
|
t
|
|
@@ -394,7 +394,7 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
394
394
|
"green-light": "text-green",
|
|
395
395
|
"blue-light": "text-blue-dark"
|
|
396
396
|
}, Nt = (e) => {
|
|
397
|
-
const { className: r, color: t, icon: n, children: a, variant: s = "filled" } = e, i = t && je[t],
|
|
397
|
+
const { className: r, color: t, icon: n, children: a, variant: s = "filled" } = e, i = t && je[t], d = t && Oe[t];
|
|
398
398
|
return /* @__PURE__ */ f(
|
|
399
399
|
"div",
|
|
400
400
|
{
|
|
@@ -404,7 +404,7 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
404
404
|
r
|
|
405
405
|
),
|
|
406
406
|
children: [
|
|
407
|
-
n && /* @__PURE__ */ o("div", { className: l("px-3 py-2",
|
|
407
|
+
n && /* @__PURE__ */ o("div", { className: l("px-3 py-2", d), children: n }),
|
|
408
408
|
/* @__PURE__ */ o(
|
|
409
409
|
"div",
|
|
410
410
|
{
|
|
@@ -419,7 +419,7 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
419
419
|
);
|
|
420
420
|
}, wt = (e) => {
|
|
421
421
|
const { className: r, children: t, ...n } = e;
|
|
422
|
-
return /* @__PURE__ */ o(
|
|
422
|
+
return /* @__PURE__ */ o(P.Provider, { value: "white", children: /* @__PURE__ */ o(
|
|
423
423
|
"footer",
|
|
424
424
|
{
|
|
425
425
|
className: l(
|
|
@@ -485,12 +485,12 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
485
485
|
"aria-live": "polite",
|
|
486
486
|
...n,
|
|
487
487
|
children: [
|
|
488
|
-
/* @__PURE__ */ o(
|
|
488
|
+
/* @__PURE__ */ o(re, { className: "text-red flex-shrink-0" }),
|
|
489
489
|
r
|
|
490
490
|
]
|
|
491
491
|
}
|
|
492
492
|
);
|
|
493
|
-
},
|
|
493
|
+
}, M = (e) => {
|
|
494
494
|
const { className: r, children: t, ...n } = e;
|
|
495
495
|
return /* @__PURE__ */ o("div", { className: l(r, "text-gray-dark text-sm"), ...n, children: t });
|
|
496
496
|
}, z = (e) => {
|
|
@@ -549,11 +549,17 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
549
549
|
type: "button",
|
|
550
550
|
"aria-disabled": t,
|
|
551
551
|
onClick: a,
|
|
552
|
-
className: l(
|
|
553
|
-
|
|
554
|
-
"border-
|
|
555
|
-
|
|
556
|
-
|
|
552
|
+
className: l(
|
|
553
|
+
r,
|
|
554
|
+
"border-blue-dark w-full rounded-t-lg border-2 py-4 pl-4 md:py-8 ",
|
|
555
|
+
{
|
|
556
|
+
"bg-blue-dark": !t,
|
|
557
|
+
"border-black bg-white": t && i !== "completed",
|
|
558
|
+
"border-green bg-green text-white": t && i === "completed",
|
|
559
|
+
"rounded-t-2xl md:rounded-t-3xl": n === 1,
|
|
560
|
+
"rounded-lg": t
|
|
561
|
+
}
|
|
562
|
+
),
|
|
557
563
|
children: /* @__PURE__ */ o(
|
|
558
564
|
Ke,
|
|
559
565
|
{
|
|
@@ -622,7 +628,7 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
622
628
|
]
|
|
623
629
|
}
|
|
624
630
|
);
|
|
625
|
-
},
|
|
631
|
+
}, Q = w([
|
|
626
632
|
{
|
|
627
633
|
activeStep: 1,
|
|
628
634
|
formData: {}
|
|
@@ -630,25 +636,41 @@ const M = N("standard"), ie = N(!0), ze = (e, r) => {
|
|
|
630
636
|
() => {
|
|
631
637
|
}
|
|
632
638
|
]);
|
|
639
|
+
function Et() {
|
|
640
|
+
const [e] = A(Q);
|
|
641
|
+
return {
|
|
642
|
+
activeStep: e.activeStep,
|
|
643
|
+
formData: e.formData
|
|
644
|
+
};
|
|
645
|
+
}
|
|
633
646
|
function Xe(e) {
|
|
634
|
-
const [r, t] = A(
|
|
647
|
+
const [r, t] = A(Q), n = N(async () => {
|
|
635
648
|
t({ type: "PREV_STEP" });
|
|
636
|
-
}, [t]), a =
|
|
637
|
-
(
|
|
649
|
+
}, [t]), a = N(
|
|
650
|
+
(d) => {
|
|
638
651
|
t({
|
|
639
652
|
type: "SET_FORM_STEP_DATA",
|
|
640
653
|
formId: `form${e}`,
|
|
641
|
-
formValues:
|
|
642
|
-
})
|
|
654
|
+
formValues: d
|
|
655
|
+
});
|
|
643
656
|
},
|
|
644
657
|
[t, e]
|
|
658
|
+
), s = N(() => {
|
|
659
|
+
t({ type: "NEXT_STEP" });
|
|
660
|
+
}, [t]), i = N(
|
|
661
|
+
(d) => {
|
|
662
|
+
a(d), s();
|
|
663
|
+
},
|
|
664
|
+
[s, a]
|
|
645
665
|
);
|
|
646
666
|
return {
|
|
647
667
|
isActive: r.activeStep === e,
|
|
648
668
|
activeStep: r.activeStep,
|
|
649
|
-
setActiveStep: (
|
|
669
|
+
setActiveStep: (d) => t({ type: "SET_STEP", step: d }),
|
|
650
670
|
previousFormStep: n,
|
|
651
|
-
|
|
671
|
+
nextFormStep: s,
|
|
672
|
+
submitAndNextFormStep: i,
|
|
673
|
+
setFormData: a,
|
|
652
674
|
formData: r.formData
|
|
653
675
|
};
|
|
654
676
|
}
|
|
@@ -679,14 +701,14 @@ function Ye(e, r) {
|
|
|
679
701
|
};
|
|
680
702
|
}
|
|
681
703
|
}
|
|
682
|
-
function
|
|
683
|
-
const [r, t] =
|
|
704
|
+
function Rt({ children: e }) {
|
|
705
|
+
const [r, t] = ge(Ye, {
|
|
684
706
|
activeStep: 1,
|
|
685
707
|
formData: {}
|
|
686
708
|
}), n = C(() => [r, t], [r, t]);
|
|
687
|
-
return /* @__PURE__ */ o(
|
|
709
|
+
return /* @__PURE__ */ o(Q.Provider, { value: n, children: e });
|
|
688
710
|
}
|
|
689
|
-
const
|
|
711
|
+
const kt = (e) => {
|
|
690
712
|
const {
|
|
691
713
|
children: r,
|
|
692
714
|
heading: t,
|
|
@@ -694,27 +716,22 @@ const Rt = (e) => {
|
|
|
694
716
|
formStatus: a = "blank",
|
|
695
717
|
onSubmit: s,
|
|
696
718
|
className: i,
|
|
697
|
-
...
|
|
698
|
-
} = e, { isActive: m, setActiveStep:
|
|
699
|
-
n < u &&
|
|
700
|
-
}, [u, n,
|
|
719
|
+
...d
|
|
720
|
+
} = e, { isActive: m, setActiveStep: c, activeStep: u } = Xe(n), g = E(null), b = N(() => {
|
|
721
|
+
n < u && c(n);
|
|
722
|
+
}, [u, n, c]);
|
|
701
723
|
return ye(() => {
|
|
702
724
|
var p;
|
|
703
|
-
m && ((p =
|
|
725
|
+
m && ((p = g.current) == null || p.scrollIntoView({ behavior: "smooth" }));
|
|
704
726
|
}, [m]), /* @__PURE__ */ f(
|
|
705
727
|
"form",
|
|
706
728
|
{
|
|
707
|
-
className: l(
|
|
708
|
-
"border-
|
|
709
|
-
|
|
710
|
-
{
|
|
711
|
-
"rounded-t-2xl md:rounded-t-3xl": n === 1,
|
|
712
|
-
"border-none": a === "completed" && !m
|
|
713
|
-
}
|
|
714
|
-
),
|
|
729
|
+
className: l("block", i, {
|
|
730
|
+
"border-none": a === "completed" && !m
|
|
731
|
+
}),
|
|
715
732
|
onSubmit: s,
|
|
716
|
-
ref:
|
|
717
|
-
...
|
|
733
|
+
ref: g,
|
|
734
|
+
...d,
|
|
718
735
|
children: [
|
|
719
736
|
/* @__PURE__ */ o(
|
|
720
737
|
We,
|
|
@@ -726,32 +743,32 @@ const Rt = (e) => {
|
|
|
726
743
|
children: t
|
|
727
744
|
}
|
|
728
745
|
),
|
|
729
|
-
m && /* @__PURE__ */ o("div", { className: "p-6 md:p-10", children: r })
|
|
746
|
+
m && /* @__PURE__ */ o("div", { className: "border-blue-dark relative rounded-b-lg border-2 p-6 md:p-10", children: r })
|
|
730
747
|
]
|
|
731
748
|
}
|
|
732
749
|
);
|
|
733
750
|
};
|
|
734
|
-
function
|
|
751
|
+
function ce(e) {
|
|
735
752
|
return e !== "vertical-split" && e !== "below-center" && e !== "below-left";
|
|
736
753
|
}
|
|
737
|
-
const V =
|
|
754
|
+
const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 }), St = h((e, r) => {
|
|
738
755
|
const {
|
|
739
756
|
bgColor: t = "white",
|
|
740
757
|
children: n,
|
|
741
758
|
className: a,
|
|
742
759
|
contentPosition: s = "below-center",
|
|
743
760
|
image: i,
|
|
744
|
-
...
|
|
745
|
-
} = e, m = i != null,
|
|
761
|
+
...d
|
|
762
|
+
} = e, m = i != null, c = m ? s : "below-center", u = C(
|
|
746
763
|
() => ({
|
|
747
764
|
bgColor: t,
|
|
748
|
-
contentPosition:
|
|
765
|
+
contentPosition: c,
|
|
749
766
|
hasImage: m
|
|
750
767
|
}),
|
|
751
|
-
[t,
|
|
768
|
+
[t, c, m]
|
|
752
769
|
);
|
|
753
770
|
return /* @__PURE__ */ o(
|
|
754
|
-
|
|
771
|
+
P.Provider,
|
|
755
772
|
{
|
|
756
773
|
value: t === "white" ? "standard" : "mint",
|
|
757
774
|
children: /* @__PURE__ */ o(V.Provider, { value: u, children: /* @__PURE__ */ f(
|
|
@@ -762,11 +779,11 @@ const V = N({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
762
779
|
// disable padding on small screens so the hero image is flush with the screen edges
|
|
763
780
|
"container px-0 md:grid lg:px-4",
|
|
764
781
|
{
|
|
765
|
-
"md:grid-cols-[50%,50%]":
|
|
782
|
+
"md:grid-cols-[50%,50%]": c === "vertical-split"
|
|
766
783
|
}
|
|
767
784
|
),
|
|
768
|
-
style:
|
|
769
|
-
...
|
|
785
|
+
style: ce(c) ? { gridTemplateAreas: '"hero"' } : void 0,
|
|
786
|
+
...d,
|
|
770
787
|
ref: r,
|
|
771
788
|
children: [
|
|
772
789
|
i,
|
|
@@ -776,7 +793,7 @@ const V = N({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
776
793
|
) })
|
|
777
794
|
}
|
|
778
795
|
);
|
|
779
|
-
}),
|
|
796
|
+
}), qt = h(
|
|
780
797
|
(e, r) => {
|
|
781
798
|
const { contentPosition: t } = A(V);
|
|
782
799
|
return /* @__PURE__ */ f(
|
|
@@ -804,9 +821,9 @@ const V = N({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
804
821
|
}
|
|
805
822
|
);
|
|
806
823
|
}
|
|
807
|
-
),
|
|
824
|
+
), Lt = h(
|
|
808
825
|
(e, r) => {
|
|
809
|
-
const { bgColor: t, contentPosition: n, hasImage: a } = A(V), { children: s, className: i, heading:
|
|
826
|
+
const { bgColor: t, contentPosition: n, hasImage: a } = A(V), { children: s, className: i, heading: d, description: m, ...c } = e, u = ce(n);
|
|
810
827
|
return /* @__PURE__ */ f(
|
|
811
828
|
"div",
|
|
812
829
|
{
|
|
@@ -837,18 +854,18 @@ const V = N({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
837
854
|
"self-center justify-self-center": n === "center"
|
|
838
855
|
}
|
|
839
856
|
),
|
|
840
|
-
...
|
|
857
|
+
...c,
|
|
841
858
|
style: u ? { gridArea: "hero" } : void 0,
|
|
842
859
|
ref: r,
|
|
843
860
|
children: [
|
|
844
|
-
/* @__PURE__ */ o("h1", { children:
|
|
861
|
+
/* @__PURE__ */ o("h1", { children: d }),
|
|
845
862
|
m && /* @__PURE__ */ o("p", { className: "text-lg font-semibold md:text-xl", children: m }),
|
|
846
863
|
s
|
|
847
864
|
]
|
|
848
865
|
}
|
|
849
866
|
);
|
|
850
867
|
}
|
|
851
|
-
),
|
|
868
|
+
), Pt = h(
|
|
852
869
|
(e, r) => {
|
|
853
870
|
const { className: t, ...n } = e, { contentPosition: a } = A(V);
|
|
854
871
|
return /* @__PURE__ */ o(
|
|
@@ -867,17 +884,17 @@ const V = N({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
867
884
|
}
|
|
868
885
|
);
|
|
869
886
|
}
|
|
870
|
-
),
|
|
887
|
+
), de = h((e, r) => {
|
|
871
888
|
const {
|
|
872
889
|
className: t,
|
|
873
890
|
isInvalid: n,
|
|
874
891
|
size: a,
|
|
875
892
|
as: s,
|
|
876
893
|
type: i,
|
|
877
|
-
rightAddon:
|
|
894
|
+
rightAddon: d,
|
|
878
895
|
leftAddon: m,
|
|
879
|
-
...
|
|
880
|
-
} = e, u = s ?? "input",
|
|
896
|
+
...c
|
|
897
|
+
} = e, u = s ?? "input", g = Qe(u, i);
|
|
881
898
|
return /* @__PURE__ */ f(
|
|
882
899
|
"div",
|
|
883
900
|
{
|
|
@@ -890,7 +907,7 @@ const V = N({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
890
907
|
"w-fit": a != null,
|
|
891
908
|
"w-full": a == null,
|
|
892
909
|
"pl-4": m,
|
|
893
|
-
"pr-4":
|
|
910
|
+
"pr-4": d
|
|
894
911
|
}
|
|
895
912
|
),
|
|
896
913
|
children: [
|
|
@@ -902,11 +919,11 @@ const V = N({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
902
919
|
ref: r,
|
|
903
920
|
className: "focus:none placeholder-gray w-full rounded-lg border-none px-4 py-3.5 focus:outline-none",
|
|
904
921
|
size: a,
|
|
905
|
-
type:
|
|
906
|
-
...
|
|
922
|
+
type: g,
|
|
923
|
+
...c
|
|
907
924
|
}
|
|
908
925
|
),
|
|
909
|
-
|
|
926
|
+
d
|
|
910
927
|
]
|
|
911
928
|
}
|
|
912
929
|
);
|
|
@@ -923,16 +940,16 @@ const Mt = (e) => {
|
|
|
923
940
|
e.icon,
|
|
924
941
|
e.children
|
|
925
942
|
] });
|
|
926
|
-
}, S =
|
|
927
|
-
setIsExpanded:
|
|
943
|
+
}, S = w({
|
|
944
|
+
setIsExpanded: I,
|
|
928
945
|
isExpanded: !1,
|
|
929
946
|
collapsibleId: ""
|
|
930
|
-
}),
|
|
931
|
-
const { className: r, children: t, ...n } = e, a =
|
|
947
|
+
}), zt = (e) => {
|
|
948
|
+
const { className: r, children: t, ...n } = e, a = $(), [s, i] = q(!1), d = C(
|
|
932
949
|
() => ({ isExpanded: s, setIsExpanded: i, collapsibleId: a }),
|
|
933
950
|
[s, a]
|
|
934
951
|
);
|
|
935
|
-
return /* @__PURE__ */ o(
|
|
952
|
+
return /* @__PURE__ */ o(P.Provider, { value: "white", children: /* @__PURE__ */ o(S.Provider, { value: d, children: /* @__PURE__ */ o(
|
|
936
953
|
"div",
|
|
937
954
|
{
|
|
938
955
|
className: l(
|
|
@@ -943,7 +960,7 @@ const Mt = (e) => {
|
|
|
943
960
|
children: /* @__PURE__ */ o("div", { className: "container", children: t })
|
|
944
961
|
}
|
|
945
962
|
) }) });
|
|
946
|
-
},
|
|
963
|
+
}, Vt = (e) => {
|
|
947
964
|
const { className: r, children: t, ...n } = e, { isExpanded: a } = A(S);
|
|
948
965
|
return /* @__PURE__ */ o(
|
|
949
966
|
"nav",
|
|
@@ -959,7 +976,7 @@ const Mt = (e) => {
|
|
|
959
976
|
children: t
|
|
960
977
|
}
|
|
961
978
|
);
|
|
962
|
-
},
|
|
979
|
+
}, Tt = h(
|
|
963
980
|
(e, r) => {
|
|
964
981
|
const { active: t, className: n, children: a, ...s } = e;
|
|
965
982
|
return /* @__PURE__ */ o(
|
|
@@ -996,7 +1013,7 @@ const Mt = (e) => {
|
|
|
996
1013
|
]
|
|
997
1014
|
}
|
|
998
1015
|
);
|
|
999
|
-
},
|
|
1016
|
+
}, Ft = (e) => {
|
|
1000
1017
|
const { className: r, children: t, logo: n, ...a } = e;
|
|
1001
1018
|
return /* @__PURE__ */ f(
|
|
1002
1019
|
"div",
|
|
@@ -1010,7 +1027,7 @@ const Mt = (e) => {
|
|
|
1010
1027
|
]
|
|
1011
1028
|
}
|
|
1012
1029
|
);
|
|
1013
|
-
},
|
|
1030
|
+
}, Jt = (e) => {
|
|
1014
1031
|
const { className: r, children: t, ...n } = e, { collapsibleId: a, isExpanded: s } = A(S);
|
|
1015
1032
|
return /* @__PURE__ */ o(
|
|
1016
1033
|
"div",
|
|
@@ -1024,10 +1041,10 @@ const Mt = (e) => {
|
|
|
1024
1041
|
children: t
|
|
1025
1042
|
}
|
|
1026
1043
|
);
|
|
1027
|
-
},
|
|
1044
|
+
}, jt = (e) => {
|
|
1028
1045
|
const { isExpanded: r } = A(S), t = Le(!1);
|
|
1029
1046
|
return !r || !t ? null : /* @__PURE__ */ o(O, { children: e.children });
|
|
1030
|
-
},
|
|
1047
|
+
}, y = 2, T = w({ currentPage: 0, pageCount: 0 }), Ot = (e) => {
|
|
1031
1048
|
const {
|
|
1032
1049
|
className: r,
|
|
1033
1050
|
page: t,
|
|
@@ -1035,30 +1052,30 @@ const Mt = (e) => {
|
|
|
1035
1052
|
onChange: a,
|
|
1036
1053
|
getItemHref: s,
|
|
1037
1054
|
getItemAriaLabel: i,
|
|
1038
|
-
nextPageAriaLabel:
|
|
1055
|
+
nextPageAriaLabel: d,
|
|
1039
1056
|
prevPageAriaLabel: m,
|
|
1040
|
-
...
|
|
1057
|
+
...c
|
|
1041
1058
|
} = e, u = C(
|
|
1042
1059
|
() => ({
|
|
1043
1060
|
currentPage: Math.max(1, Math.min(t, n)),
|
|
1044
1061
|
pageCount: Math.max(1, n)
|
|
1045
1062
|
}),
|
|
1046
1063
|
[t, n]
|
|
1047
|
-
),
|
|
1064
|
+
), g = (b) => (p) => {
|
|
1048
1065
|
a && (p.preventDefault(), a(b));
|
|
1049
1066
|
};
|
|
1050
1067
|
return /* @__PURE__ */ o(T.Provider, { value: u, children: /* @__PURE__ */ f(
|
|
1051
1068
|
"nav",
|
|
1052
1069
|
{
|
|
1053
1070
|
className: l("flex justify-center gap-2 sm:gap-4", r),
|
|
1054
|
-
...
|
|
1071
|
+
...c,
|
|
1055
1072
|
children: [
|
|
1056
1073
|
/* @__PURE__ */ o(
|
|
1057
1074
|
He,
|
|
1058
1075
|
{
|
|
1059
1076
|
"aria-label": m,
|
|
1060
1077
|
href: s(t - 1),
|
|
1061
|
-
onClick:
|
|
1078
|
+
onClick: g(t - 1)
|
|
1062
1079
|
}
|
|
1063
1080
|
),
|
|
1064
1081
|
/* @__PURE__ */ o(
|
|
@@ -1066,17 +1083,17 @@ const Mt = (e) => {
|
|
|
1066
1083
|
{
|
|
1067
1084
|
page: 1,
|
|
1068
1085
|
href: s(1),
|
|
1069
|
-
onClick:
|
|
1086
|
+
onClick: g(1),
|
|
1070
1087
|
"aria-label": i(1),
|
|
1071
1088
|
selected: t === 1
|
|
1072
1089
|
}
|
|
1073
1090
|
),
|
|
1074
|
-
n > 2 +
|
|
1075
|
-
/* @__PURE__ */ o(
|
|
1091
|
+
n > 2 + y * 2 && t > y + 2 && /* @__PURE__ */ o(De, {}),
|
|
1092
|
+
/* @__PURE__ */ o(Ge, { children: (b) => /* @__PURE__ */ o(
|
|
1076
1093
|
G,
|
|
1077
1094
|
{
|
|
1078
1095
|
href: s(b),
|
|
1079
|
-
onClick:
|
|
1096
|
+
onClick: g(b),
|
|
1080
1097
|
"aria-label": i(b),
|
|
1081
1098
|
page: b,
|
|
1082
1099
|
selected: b === t
|
|
@@ -1086,18 +1103,18 @@ const Mt = (e) => {
|
|
|
1086
1103
|
/* @__PURE__ */ o(
|
|
1087
1104
|
Be,
|
|
1088
1105
|
{
|
|
1089
|
-
"aria-label":
|
|
1106
|
+
"aria-label": d,
|
|
1090
1107
|
href: s(t + 1),
|
|
1091
|
-
onClick:
|
|
1108
|
+
onClick: g(t + 1)
|
|
1092
1109
|
}
|
|
1093
1110
|
)
|
|
1094
1111
|
]
|
|
1095
1112
|
}
|
|
1096
1113
|
) });
|
|
1097
|
-
}, Be =
|
|
1114
|
+
}, Be = h((e, r) => {
|
|
1098
1115
|
const { currentPage: t, pageCount: n } = A(T), a = t >= n;
|
|
1099
1116
|
return /* @__PURE__ */ o(
|
|
1100
|
-
|
|
1117
|
+
U,
|
|
1101
1118
|
{
|
|
1102
1119
|
"aria-hidden": a,
|
|
1103
1120
|
className: a ? "invisible" : void 0,
|
|
@@ -1107,10 +1124,10 @@ const Mt = (e) => {
|
|
|
1107
1124
|
children: /* @__PURE__ */ o(ve, {})
|
|
1108
1125
|
}
|
|
1109
1126
|
);
|
|
1110
|
-
}), He =
|
|
1127
|
+
}), He = h((e, r) => {
|
|
1111
1128
|
const { currentPage: t } = A(T), n = t <= 1;
|
|
1112
1129
|
return /* @__PURE__ */ o(
|
|
1113
|
-
|
|
1130
|
+
U,
|
|
1114
1131
|
{
|
|
1115
1132
|
"aria-hidden": n,
|
|
1116
1133
|
className: n ? "invisible" : void 0,
|
|
@@ -1120,7 +1137,7 @@ const Mt = (e) => {
|
|
|
1120
1137
|
children: /* @__PURE__ */ o(Ne, {})
|
|
1121
1138
|
}
|
|
1122
1139
|
);
|
|
1123
|
-
}),
|
|
1140
|
+
}), U = h((e, r) => {
|
|
1124
1141
|
const { className: t, ...n } = e;
|
|
1125
1142
|
return /* @__PURE__ */ o(
|
|
1126
1143
|
"a",
|
|
@@ -1133,39 +1150,39 @@ const Mt = (e) => {
|
|
|
1133
1150
|
...n
|
|
1134
1151
|
}
|
|
1135
1152
|
);
|
|
1136
|
-
}),
|
|
1153
|
+
}), De = () => /* @__PURE__ */ o("span", { className: "flex h-9 w-9 cursor-default items-center justify-center border-2 border-transparent sm:h-10 sm:w-10", children: "..." }), Ge = ({ children: e }) => {
|
|
1137
1154
|
const { currentPage: r, pageCount: t } = A(T), n = Math.min(
|
|
1138
|
-
Math.max(2 +
|
|
1155
|
+
Math.max(2 + y * 2, r + y),
|
|
1139
1156
|
t
|
|
1140
1157
|
);
|
|
1141
1158
|
let a = Math.max(
|
|
1142
|
-
Math.min(r -
|
|
1159
|
+
Math.min(r - y, n - y * 2),
|
|
1143
1160
|
1
|
|
1144
1161
|
);
|
|
1145
|
-
return a -
|
|
1146
|
-
}, G =
|
|
1162
|
+
return a - y === 0 && (a = a - 1), Array.from({ length: n - a }, (i, d) => a + d + 1).map((i) => e(i));
|
|
1163
|
+
}, G = h((e, r) => {
|
|
1147
1164
|
const { page: t, selected: n, ...a } = e;
|
|
1148
|
-
return /* @__PURE__ */ o(
|
|
1149
|
-
}), me =
|
|
1165
|
+
return /* @__PURE__ */ o(U, { "aria-current": n ? "page" : void 0, ref: r, ...a, children: t });
|
|
1166
|
+
}), me = w({
|
|
1150
1167
|
defaultValue: void 0,
|
|
1151
1168
|
isControlled: !1,
|
|
1152
1169
|
name: void 0,
|
|
1153
|
-
onChange:
|
|
1170
|
+
onChange: I,
|
|
1154
1171
|
required: !1,
|
|
1155
1172
|
value: void 0,
|
|
1156
1173
|
error: !1
|
|
1157
|
-
}),
|
|
1158
|
-
const { children: t, className: n, ...a } = e, { defaultValue: s, isControlled: i, name:
|
|
1174
|
+
}), Zt = h((e, r) => {
|
|
1175
|
+
const { children: t, className: n, ...a } = e, { defaultValue: s, isControlled: i, name: d, onChange: m, required: c, value: u, error: g } = A(me);
|
|
1159
1176
|
return /* @__PURE__ */ f("label", { className: l(n, "flex cursor-pointer gap-2.5"), children: [
|
|
1160
1177
|
/* @__PURE__ */ o(
|
|
1161
1178
|
"input",
|
|
1162
1179
|
{
|
|
1163
|
-
className: l("radio",
|
|
1180
|
+
className: l("radio", g && "border-red"),
|
|
1164
1181
|
defaultChecked: i ? void 0 : a.value === s,
|
|
1165
1182
|
checked: i ? a.value === u : void 0,
|
|
1166
|
-
name:
|
|
1183
|
+
name: d,
|
|
1167
1184
|
onChange: i ? m : void 0,
|
|
1168
|
-
required:
|
|
1185
|
+
required: c,
|
|
1169
1186
|
type: "radio",
|
|
1170
1187
|
ref: r,
|
|
1171
1188
|
...a
|
|
@@ -1173,27 +1190,27 @@ const Mt = (e) => {
|
|
|
1173
1190
|
),
|
|
1174
1191
|
t
|
|
1175
1192
|
] });
|
|
1176
|
-
}),
|
|
1193
|
+
}), Wt = h(
|
|
1177
1194
|
(e, r) => {
|
|
1178
1195
|
const t = "value" in e, {
|
|
1179
1196
|
className: n,
|
|
1180
1197
|
defaultValue: a,
|
|
1181
1198
|
description: s,
|
|
1182
1199
|
error: i,
|
|
1183
|
-
id:
|
|
1200
|
+
id: d,
|
|
1184
1201
|
children: m,
|
|
1185
|
-
label:
|
|
1202
|
+
label: c,
|
|
1186
1203
|
name: u,
|
|
1187
|
-
onChange:
|
|
1204
|
+
onChange: g,
|
|
1188
1205
|
required: b,
|
|
1189
1206
|
value: p,
|
|
1190
1207
|
...v
|
|
1191
|
-
} = e, x =
|
|
1208
|
+
} = e, x = N(
|
|
1192
1209
|
(ue) => {
|
|
1193
1210
|
const be = ue.target.value;
|
|
1194
|
-
|
|
1211
|
+
g == null || g(be);
|
|
1195
1212
|
},
|
|
1196
|
-
[
|
|
1213
|
+
[g]
|
|
1197
1214
|
), F = C(
|
|
1198
1215
|
() => ({
|
|
1199
1216
|
defaultValue: a,
|
|
@@ -1205,33 +1222,33 @@ const Mt = (e) => {
|
|
|
1205
1222
|
error: !!i
|
|
1206
1223
|
}),
|
|
1207
1224
|
[a, t, u, x, b, p, i]
|
|
1208
|
-
), J = R(
|
|
1225
|
+
), J = R(d), B = `${J}:label`, H = `${J}:help`, D = J + "err", j = i;
|
|
1209
1226
|
return /* @__PURE__ */ o(me.Provider, { value: F, children: /* @__PURE__ */ f(
|
|
1210
1227
|
"div",
|
|
1211
1228
|
{
|
|
1212
1229
|
"aria-describedby": l({
|
|
1213
|
-
[
|
|
1214
|
-
[
|
|
1230
|
+
[D]: j,
|
|
1231
|
+
[H]: s
|
|
1215
1232
|
}) || void 0,
|
|
1216
1233
|
"aria-invalid": !!i,
|
|
1217
|
-
"aria-labelledby":
|
|
1234
|
+
"aria-labelledby": c ? B : void 0,
|
|
1218
1235
|
className: l(n, "flex flex-col gap-4"),
|
|
1219
1236
|
role: "radiogroup",
|
|
1220
1237
|
ref: r,
|
|
1221
1238
|
...v,
|
|
1222
1239
|
children: [
|
|
1223
|
-
|
|
1224
|
-
s && /* @__PURE__ */ o(
|
|
1240
|
+
c && /* @__PURE__ */ o(z, { id: B, isRequired: b, isInvalid: !!i, children: c }),
|
|
1241
|
+
s && /* @__PURE__ */ o(M, { id: H, children: s }),
|
|
1225
1242
|
m,
|
|
1226
|
-
j && /* @__PURE__ */ o(k, { id:
|
|
1243
|
+
j && /* @__PURE__ */ o(k, { id: D, children: j })
|
|
1227
1244
|
]
|
|
1228
1245
|
}
|
|
1229
1246
|
) });
|
|
1230
1247
|
}
|
|
1231
|
-
), _e =
|
|
1248
|
+
), _e = h(
|
|
1232
1249
|
(e, r) => {
|
|
1233
|
-
const { children: t, className: n, isInvalid: a, size: s, ...i } = e,
|
|
1234
|
-
return /* @__PURE__ */ f("div", { className: l(n, "relative",
|
|
1250
|
+
const { children: t, className: n, isInvalid: a, size: s, ...i } = e, d = s === "small";
|
|
1251
|
+
return /* @__PURE__ */ f("div", { className: l(n, "relative", d && "text-sm"), children: [
|
|
1235
1252
|
/* @__PURE__ */ o(
|
|
1236
1253
|
"select",
|
|
1237
1254
|
{
|
|
@@ -1239,7 +1256,7 @@ const Mt = (e) => {
|
|
|
1239
1256
|
...i,
|
|
1240
1257
|
className: l(
|
|
1241
1258
|
"w-full cursor-pointer appearance-none border border-b-[3px] bg-white focus:-ml-0.5 focus:-mt-0.5 focus:border-[3px] focus:shadow focus:outline-none",
|
|
1242
|
-
|
|
1259
|
+
d ? "rounded px-3.5 py-2" : "rounded-lg px-4 py-3.5",
|
|
1243
1260
|
a ? "border-red focus:border-red" : "focus:border-blue-dark border-black"
|
|
1244
1261
|
),
|
|
1245
1262
|
ref: r,
|
|
@@ -1247,17 +1264,17 @@ const Mt = (e) => {
|
|
|
1247
1264
|
}
|
|
1248
1265
|
),
|
|
1249
1266
|
/* @__PURE__ */ o(
|
|
1250
|
-
|
|
1267
|
+
te,
|
|
1251
1268
|
{
|
|
1252
1269
|
className: l(
|
|
1253
1270
|
"pointer-events-none absolute bottom-0 top-0 my-auto",
|
|
1254
|
-
|
|
1271
|
+
d ? "right-3.5" : "right-4"
|
|
1255
1272
|
)
|
|
1256
1273
|
}
|
|
1257
1274
|
)
|
|
1258
1275
|
] });
|
|
1259
1276
|
}
|
|
1260
|
-
),
|
|
1277
|
+
), Kt = h(
|
|
1261
1278
|
(e, r) => {
|
|
1262
1279
|
const {
|
|
1263
1280
|
description: t,
|
|
@@ -1265,11 +1282,11 @@ const Mt = (e) => {
|
|
|
1265
1282
|
id: a,
|
|
1266
1283
|
label: s,
|
|
1267
1284
|
disableValidation: i = !1,
|
|
1268
|
-
...
|
|
1269
|
-
} = e, m = E(null),
|
|
1285
|
+
...d
|
|
1286
|
+
} = e, m = E(null), c = K([m, r]), { validity: u, validationMessage: g } = L(
|
|
1270
1287
|
m,
|
|
1271
1288
|
!i
|
|
1272
|
-
), b = R(a), p = b + "help", v = b + "err", x = n ||
|
|
1289
|
+
), b = R(a), p = b + "help", v = b + "err", x = n || g;
|
|
1273
1290
|
return /* @__PURE__ */ f("div", { className: "grid gap-2", children: [
|
|
1274
1291
|
/* @__PURE__ */ o(
|
|
1275
1292
|
z,
|
|
@@ -1280,13 +1297,13 @@ const Mt = (e) => {
|
|
|
1280
1297
|
children: s
|
|
1281
1298
|
}
|
|
1282
1299
|
),
|
|
1283
|
-
t && /* @__PURE__ */ o(
|
|
1300
|
+
t && /* @__PURE__ */ o(M, { id: p, children: t }),
|
|
1284
1301
|
/* @__PURE__ */ o(
|
|
1285
1302
|
_e,
|
|
1286
1303
|
{
|
|
1287
1304
|
id: b,
|
|
1288
|
-
ref:
|
|
1289
|
-
...
|
|
1305
|
+
ref: c,
|
|
1306
|
+
...d,
|
|
1290
1307
|
isInvalid: !!n || u === "invalid",
|
|
1291
1308
|
"aria-describedby": l({
|
|
1292
1309
|
[v]: x,
|
|
@@ -1297,10 +1314,10 @@ const Mt = (e) => {
|
|
|
1297
1314
|
x && /* @__PURE__ */ o(k, { id: v, children: x })
|
|
1298
1315
|
] });
|
|
1299
1316
|
}
|
|
1300
|
-
),
|
|
1317
|
+
), Xt = (e) => {
|
|
1301
1318
|
const { heading: r, children: t, closeSnackbar: n } = e, [a, s] = q(!1);
|
|
1302
1319
|
return /* @__PURE__ */ o("div", { className: "container max-w-[59rem]", children: /* @__PURE__ */ o("div", { className: "bg-orange-light px-8 py-4 max-md:p-4", children: /* @__PURE__ */ f("div", { className: "snackbar grid items-center", children: [
|
|
1303
|
-
/* @__PURE__ */ o(
|
|
1320
|
+
/* @__PURE__ */ o(ne, { className: "text-orange snackbar-icon mr-4 self-start md:mr-8 md:text-2xl" }),
|
|
1304
1321
|
/* @__PURE__ */ o(
|
|
1305
1322
|
"h3",
|
|
1306
1323
|
{
|
|
@@ -1315,18 +1332,18 @@ const Mt = (e) => {
|
|
|
1315
1332
|
),
|
|
1316
1333
|
/* @__PURE__ */ f("div", { className: "snackbar-actions flex justify-end gap-4 max-md:mt-3 md:ml-4", children: [
|
|
1317
1334
|
/* @__PURE__ */ o(
|
|
1318
|
-
|
|
1335
|
+
_,
|
|
1319
1336
|
{
|
|
1320
1337
|
"aria-expanded": a,
|
|
1321
1338
|
onClick: () => s(!a),
|
|
1322
1339
|
children: a ? "Les mindre" : "Les mer"
|
|
1323
1340
|
}
|
|
1324
1341
|
),
|
|
1325
|
-
/* @__PURE__ */ o(
|
|
1342
|
+
/* @__PURE__ */ o(_, { onClick: n, children: "Ok" })
|
|
1326
1343
|
] }),
|
|
1327
1344
|
a && t
|
|
1328
1345
|
] }) }) });
|
|
1329
|
-
},
|
|
1346
|
+
}, _ = (e) => /* @__PURE__ */ o(
|
|
1330
1347
|
"button",
|
|
1331
1348
|
{
|
|
1332
1349
|
className: l(
|
|
@@ -1336,7 +1353,7 @@ const Mt = (e) => {
|
|
|
1336
1353
|
...e,
|
|
1337
1354
|
children: e.children
|
|
1338
1355
|
}
|
|
1339
|
-
),
|
|
1356
|
+
), Yt = (e) => /* @__PURE__ */ o(
|
|
1340
1357
|
"div",
|
|
1341
1358
|
{
|
|
1342
1359
|
className: "snackbar-content my-4 max-h-[50vh] max-w-prose overflow-y-auto",
|
|
@@ -1380,7 +1397,7 @@ const Mt = (e) => {
|
|
|
1380
1397
|
}
|
|
1381
1398
|
);
|
|
1382
1399
|
$e.Item = et;
|
|
1383
|
-
const
|
|
1400
|
+
const Qt = h(
|
|
1384
1401
|
(e, r) => {
|
|
1385
1402
|
const {
|
|
1386
1403
|
description: t,
|
|
@@ -1388,11 +1405,11 @@ const Yt = g(
|
|
|
1388
1405
|
id: a,
|
|
1389
1406
|
label: s,
|
|
1390
1407
|
disableValidation: i = !1,
|
|
1391
|
-
...
|
|
1392
|
-
} = e, m = E(null),
|
|
1408
|
+
...d
|
|
1409
|
+
} = e, m = E(null), c = K([m, r]), { validity: u, validationMessage: g } = L(
|
|
1393
1410
|
m,
|
|
1394
1411
|
!i
|
|
1395
|
-
), b = R(a), p = b + "help", v = b + "err", x = n ||
|
|
1412
|
+
), b = R(a), p = b + "help", v = b + "err", x = n || g;
|
|
1396
1413
|
return /* @__PURE__ */ f("div", { className: "grid gap-2", children: [
|
|
1397
1414
|
/* @__PURE__ */ o(
|
|
1398
1415
|
z,
|
|
@@ -1403,14 +1420,14 @@ const Yt = g(
|
|
|
1403
1420
|
children: s
|
|
1404
1421
|
}
|
|
1405
1422
|
),
|
|
1406
|
-
t && /* @__PURE__ */ o(
|
|
1423
|
+
t && /* @__PURE__ */ o(M, { id: p, children: t }),
|
|
1407
1424
|
/* @__PURE__ */ o(
|
|
1408
|
-
|
|
1425
|
+
de,
|
|
1409
1426
|
{
|
|
1410
1427
|
as: "textarea",
|
|
1411
|
-
ref:
|
|
1428
|
+
ref: c,
|
|
1412
1429
|
id: b,
|
|
1413
|
-
...
|
|
1430
|
+
...d,
|
|
1414
1431
|
isInvalid: !!n || u === "invalid",
|
|
1415
1432
|
"aria-describedby": l({
|
|
1416
1433
|
[v]: x,
|
|
@@ -1421,7 +1438,7 @@ const Yt = g(
|
|
|
1421
1438
|
x && /* @__PURE__ */ o(k, { id: v, children: x })
|
|
1422
1439
|
] });
|
|
1423
1440
|
}
|
|
1424
|
-
),
|
|
1441
|
+
), Ut = h(
|
|
1425
1442
|
(e, r) => {
|
|
1426
1443
|
const {
|
|
1427
1444
|
description: t,
|
|
@@ -1429,12 +1446,12 @@ const Yt = g(
|
|
|
1429
1446
|
id: a,
|
|
1430
1447
|
label: s,
|
|
1431
1448
|
type: i = "text",
|
|
1432
|
-
disableValidation:
|
|
1449
|
+
disableValidation: d = !1,
|
|
1433
1450
|
...m
|
|
1434
|
-
} = e,
|
|
1435
|
-
|
|
1436
|
-
!
|
|
1437
|
-
), b = R(a), p = b + "help", v = b + "err", x = n ||
|
|
1451
|
+
} = e, c = E(null), { validity: u, validationMessage: g } = L(
|
|
1452
|
+
c,
|
|
1453
|
+
!d
|
|
1454
|
+
), b = R(a), p = b + "help", v = b + "err", x = n || g, F = K([c, r]);
|
|
1438
1455
|
return /* @__PURE__ */ f("div", { className: "grid gap-2", children: [
|
|
1439
1456
|
/* @__PURE__ */ o(
|
|
1440
1457
|
z,
|
|
@@ -1445,9 +1462,9 @@ const Yt = g(
|
|
|
1445
1462
|
children: s
|
|
1446
1463
|
}
|
|
1447
1464
|
),
|
|
1448
|
-
t && /* @__PURE__ */ o(
|
|
1465
|
+
t && /* @__PURE__ */ o(M, { id: p, children: t }),
|
|
1449
1466
|
/* @__PURE__ */ o(
|
|
1450
|
-
|
|
1467
|
+
de,
|
|
1451
1468
|
{
|
|
1452
1469
|
id: b,
|
|
1453
1470
|
ref: F,
|
|
@@ -1469,15 +1486,15 @@ export {
|
|
|
1469
1486
|
ke as AccordionContent,
|
|
1470
1487
|
Re as AccordionHeader,
|
|
1471
1488
|
Ee as AccordionItem,
|
|
1472
|
-
|
|
1489
|
+
ct as Alert,
|
|
1473
1490
|
mt as Banner,
|
|
1474
1491
|
ut as BannerImage,
|
|
1475
1492
|
bt as Button,
|
|
1476
|
-
|
|
1493
|
+
P as ButtonColorContext,
|
|
1477
1494
|
ft as Campaign,
|
|
1478
|
-
|
|
1495
|
+
gt as Card,
|
|
1479
1496
|
At as CardContent,
|
|
1480
|
-
|
|
1497
|
+
ht as CardImage,
|
|
1481
1498
|
xt as CardLinkOverlay,
|
|
1482
1499
|
pt as CardList,
|
|
1483
1500
|
vt as Checkbox,
|
|
@@ -1487,41 +1504,42 @@ export {
|
|
|
1487
1504
|
It as FormError,
|
|
1488
1505
|
k as FormErrorMessage,
|
|
1489
1506
|
Ze as FormHeading,
|
|
1490
|
-
|
|
1507
|
+
M as FormHelperText,
|
|
1491
1508
|
z as FormLabel,
|
|
1492
|
-
|
|
1509
|
+
kt as FormStep,
|
|
1493
1510
|
We as FormStepHeader,
|
|
1494
1511
|
Ke as FormStepHeaderContent,
|
|
1495
|
-
|
|
1512
|
+
Rt as FormStepProvider,
|
|
1496
1513
|
Ct as FormSuccess,
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1514
|
+
St as Hero,
|
|
1515
|
+
Pt as HeroActions,
|
|
1516
|
+
Lt as HeroContent,
|
|
1500
1517
|
V as HeroContext,
|
|
1501
|
-
|
|
1502
|
-
|
|
1518
|
+
qt as HeroImage,
|
|
1519
|
+
de as Input,
|
|
1503
1520
|
Mt as Link,
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1521
|
+
zt as Navbar,
|
|
1522
|
+
Jt as NavbarCollapsible,
|
|
1523
|
+
Ft as NavbarContent,
|
|
1524
|
+
jt as NavbarExpandedMobileContent,
|
|
1525
|
+
Tt as NavbarItem,
|
|
1526
|
+
Vt as NavbarItems,
|
|
1527
|
+
Ot as Pagination,
|
|
1528
|
+
Zt as Radio,
|
|
1529
|
+
Wt as RadioGroup,
|
|
1530
|
+
Kt as Select,
|
|
1531
|
+
Xt as Snackbar,
|
|
1532
|
+
_ as SnackbarButton,
|
|
1533
|
+
Yt as SnackbarContent,
|
|
1517
1534
|
$e as StepList,
|
|
1518
1535
|
et as StepListItem,
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1536
|
+
Qt as TextArea,
|
|
1537
|
+
Ut as TextField,
|
|
1538
|
+
se as useBlockBackgroundColor,
|
|
1522
1539
|
R as useFallbackId,
|
|
1540
|
+
Et as useFormContext,
|
|
1523
1541
|
L as useFormControlValidity,
|
|
1524
1542
|
Xe as useFormStepContext,
|
|
1525
|
-
|
|
1543
|
+
dt as usePrefersReducedMotion,
|
|
1526
1544
|
Le as useScreenMaxWidthMd
|
|
1527
1545
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@obosbbl/grunnmuren-react",
|
|
3
|
-
"version": "1.14.0-beta.
|
|
3
|
+
"version": "1.14.0-beta.4",
|
|
4
4
|
"description": "OBOS Grunnmuren design system React components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,32 +17,32 @@
|
|
|
17
17
|
],
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@storybook/addon-
|
|
22
|
-
"@storybook/addon-
|
|
23
|
-
"@storybook/
|
|
24
|
-
"@storybook/
|
|
25
|
-
"@storybook/react": "7.0.
|
|
26
|
-
"@
|
|
27
|
-
"@types/react": "18.2.
|
|
28
|
-
"@types/react-dom": "18.2.4",
|
|
20
|
+
"@storybook/addon-controls": "7.0.22",
|
|
21
|
+
"@storybook/addon-docs": "7.0.22",
|
|
22
|
+
"@storybook/addon-styling": "1.3.0",
|
|
23
|
+
"@storybook/builder-vite": "7.0.22",
|
|
24
|
+
"@storybook/react": "7.0.22",
|
|
25
|
+
"@storybook/react-vite": "7.0.22",
|
|
26
|
+
"@types/react": "18.2.12",
|
|
27
|
+
"@types/react-dom": "18.2.5",
|
|
29
28
|
"@vitejs/plugin-react": "4.0.0",
|
|
30
29
|
"autoprefixer": "10.4.14",
|
|
31
|
-
"postcss": "8.4.
|
|
30
|
+
"postcss": "8.4.24",
|
|
32
31
|
"react": "18.2.0",
|
|
33
32
|
"react-dom": "18.2.0",
|
|
34
33
|
"require-from-string": "2.0.2",
|
|
35
34
|
"rimraf": "5.0.1",
|
|
36
|
-
"storybook": "7.0.
|
|
35
|
+
"storybook": "7.0.22",
|
|
37
36
|
"tailwindcss": "3.3.2",
|
|
38
|
-
"type-fest": "3.
|
|
39
|
-
"vite": "4.3.
|
|
37
|
+
"type-fest": "3.12.0",
|
|
38
|
+
"vite": "4.3.9",
|
|
40
39
|
"@obosbbl/grunnmuren-tailwind": "0.9.1"
|
|
41
40
|
},
|
|
42
41
|
"dependencies": {
|
|
43
|
-
"@react-
|
|
42
|
+
"@react-hookz/web": "23.0.0",
|
|
44
43
|
"clsx": "1.2.1",
|
|
45
44
|
"react-collapsed": "4.0.2",
|
|
45
|
+
"react-merge-refs": "2.0.2",
|
|
46
46
|
"@obosbbl/grunnmuren-icons": "^0.6.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|