@obosbbl/grunnmuren-react 1.14.0-beta.3 → 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/grunnmuren.mjs +114 -114
- package/package.json +14 -14
package/dist/grunnmuren.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { ChevronDown as te, Warning as re, InfoCircle as ne, LoadingSpinner as h
|
|
|
5
5
|
import { useCollapse as we } from "react-collapsed";
|
|
6
6
|
import l from "clsx";
|
|
7
7
|
import { useMediaQuery as ae, useUpdateEffect as ye } from "@react-hookz/web";
|
|
8
|
-
import K from "
|
|
8
|
+
import { mergeRefs as K } from "react-merge-refs";
|
|
9
9
|
const I = () => {
|
|
10
10
|
}, Ie = 300, Ce = "duration-300", X = (e) => {
|
|
11
11
|
const { className: r, ...t } = e;
|
|
@@ -37,7 +37,7 @@ const I = () => {
|
|
|
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
|
{
|
|
@@ -66,7 +66,7 @@ const I = () => {
|
|
|
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,7 +92,7 @@ const dt = (e) => {
|
|
|
92
92
|
] })
|
|
93
93
|
}
|
|
94
94
|
);
|
|
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)",
|
|
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
96
|
function se(e) {
|
|
97
97
|
switch (e) {
|
|
98
98
|
case "gray":
|
|
@@ -109,26 +109,26 @@ function se(e) {
|
|
|
109
109
|
}
|
|
110
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 = N((
|
|
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 = N((
|
|
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
134
|
const r = $();
|
|
@@ -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",
|
|
@@ -174,15 +174,15 @@ const mt = (e) => {
|
|
|
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,14 +192,14 @@ 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
|
-
}),
|
|
202
|
+
}), Me = (e) => /* @__PURE__ */ f(O, { children: [
|
|
203
203
|
ie(e.children),
|
|
204
204
|
/* @__PURE__ */ o(
|
|
205
205
|
"span",
|
|
@@ -223,14 +223,14 @@ function ie(e) {
|
|
|
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,7 +239,7 @@ const M = w("standard"), le = w(!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
245
|
/* @__PURE__ */ o(le.Provider, { value: i, children: s }),
|
|
@@ -267,8 +267,8 @@ const M = w("standard"), le = w(!0), ze = (e, r) => {
|
|
|
267
267
|
s ? "md:rounded-r-3xl" : "md:rounded-l-3xl md:order-1"
|
|
268
268
|
);
|
|
269
269
|
if (ee(n)) {
|
|
270
|
-
const
|
|
271
|
-
return W(
|
|
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,
|
|
@@ -349,8 +349,8 @@ const M = w("standard"), le = w(!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;
|
|
@@ -369,9 +369,9 @@ const M = w("standard"), le = w(!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 = w("standard"), le = w(!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 = w("standard"), le = w(!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 = w("standard"), le = w(!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(
|
|
@@ -490,7 +490,7 @@ const M = w("standard"), le = w(!0), ze = (e, 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) => {
|
|
@@ -647,26 +647,26 @@ function Xe(e) {
|
|
|
647
647
|
const [r, t] = A(Q), n = N(async () => {
|
|
648
648
|
t({ type: "PREV_STEP" });
|
|
649
649
|
}, [t]), a = N(
|
|
650
|
-
(
|
|
650
|
+
(d) => {
|
|
651
651
|
t({
|
|
652
652
|
type: "SET_FORM_STEP_DATA",
|
|
653
653
|
formId: `form${e}`,
|
|
654
|
-
formValues:
|
|
654
|
+
formValues: d
|
|
655
655
|
});
|
|
656
656
|
},
|
|
657
657
|
[t, e]
|
|
658
658
|
), s = N(() => {
|
|
659
659
|
t({ type: "NEXT_STEP" });
|
|
660
660
|
}, [t]), i = N(
|
|
661
|
-
(
|
|
662
|
-
a(
|
|
661
|
+
(d) => {
|
|
662
|
+
a(d), s();
|
|
663
663
|
},
|
|
664
664
|
[s, a]
|
|
665
665
|
);
|
|
666
666
|
return {
|
|
667
667
|
isActive: r.activeStep === e,
|
|
668
668
|
activeStep: r.activeStep,
|
|
669
|
-
setActiveStep: (
|
|
669
|
+
setActiveStep: (d) => t({ type: "SET_STEP", step: d }),
|
|
670
670
|
previousFormStep: n,
|
|
671
671
|
nextFormStep: s,
|
|
672
672
|
submitAndNextFormStep: i,
|
|
@@ -716,10 +716,10 @@ const kt = (e) => {
|
|
|
716
716
|
formStatus: a = "blank",
|
|
717
717
|
onSubmit: s,
|
|
718
718
|
className: i,
|
|
719
|
-
...
|
|
720
|
-
} = e, { isActive: m, setActiveStep:
|
|
721
|
-
n < u &&
|
|
722
|
-
}, [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]);
|
|
723
723
|
return ye(() => {
|
|
724
724
|
var p;
|
|
725
725
|
m && ((p = g.current) == null || p.scrollIntoView({ behavior: "smooth" }));
|
|
@@ -731,7 +731,7 @@ const kt = (e) => {
|
|
|
731
731
|
}),
|
|
732
732
|
onSubmit: s,
|
|
733
733
|
ref: g,
|
|
734
|
-
...
|
|
734
|
+
...d,
|
|
735
735
|
children: [
|
|
736
736
|
/* @__PURE__ */ o(
|
|
737
737
|
We,
|
|
@@ -748,7 +748,7 @@ const kt = (e) => {
|
|
|
748
748
|
}
|
|
749
749
|
);
|
|
750
750
|
};
|
|
751
|
-
function
|
|
751
|
+
function ce(e) {
|
|
752
752
|
return e !== "vertical-split" && e !== "below-center" && e !== "below-left";
|
|
753
753
|
}
|
|
754
754
|
const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 }), St = h((e, r) => {
|
|
@@ -758,17 +758,17 @@ const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
758
758
|
className: a,
|
|
759
759
|
contentPosition: s = "below-center",
|
|
760
760
|
image: i,
|
|
761
|
-
...
|
|
762
|
-
} = e, m = i != null,
|
|
761
|
+
...d
|
|
762
|
+
} = e, m = i != null, c = m ? s : "below-center", u = C(
|
|
763
763
|
() => ({
|
|
764
764
|
bgColor: t,
|
|
765
|
-
contentPosition:
|
|
765
|
+
contentPosition: c,
|
|
766
766
|
hasImage: m
|
|
767
767
|
}),
|
|
768
|
-
[t,
|
|
768
|
+
[t, c, m]
|
|
769
769
|
);
|
|
770
770
|
return /* @__PURE__ */ o(
|
|
771
|
-
|
|
771
|
+
P.Provider,
|
|
772
772
|
{
|
|
773
773
|
value: t === "white" ? "standard" : "mint",
|
|
774
774
|
children: /* @__PURE__ */ o(V.Provider, { value: u, children: /* @__PURE__ */ f(
|
|
@@ -779,11 +779,11 @@ const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
779
779
|
// disable padding on small screens so the hero image is flush with the screen edges
|
|
780
780
|
"container px-0 md:grid lg:px-4",
|
|
781
781
|
{
|
|
782
|
-
"md:grid-cols-[50%,50%]":
|
|
782
|
+
"md:grid-cols-[50%,50%]": c === "vertical-split"
|
|
783
783
|
}
|
|
784
784
|
),
|
|
785
|
-
style:
|
|
786
|
-
...
|
|
785
|
+
style: ce(c) ? { gridTemplateAreas: '"hero"' } : void 0,
|
|
786
|
+
...d,
|
|
787
787
|
ref: r,
|
|
788
788
|
children: [
|
|
789
789
|
i,
|
|
@@ -823,7 +823,7 @@ const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
823
823
|
}
|
|
824
824
|
), Lt = h(
|
|
825
825
|
(e, r) => {
|
|
826
|
-
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);
|
|
827
827
|
return /* @__PURE__ */ f(
|
|
828
828
|
"div",
|
|
829
829
|
{
|
|
@@ -854,18 +854,18 @@ const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
854
854
|
"self-center justify-self-center": n === "center"
|
|
855
855
|
}
|
|
856
856
|
),
|
|
857
|
-
...
|
|
857
|
+
...c,
|
|
858
858
|
style: u ? { gridArea: "hero" } : void 0,
|
|
859
859
|
ref: r,
|
|
860
860
|
children: [
|
|
861
|
-
/* @__PURE__ */ o("h1", { children:
|
|
861
|
+
/* @__PURE__ */ o("h1", { children: d }),
|
|
862
862
|
m && /* @__PURE__ */ o("p", { className: "text-lg font-semibold md:text-xl", children: m }),
|
|
863
863
|
s
|
|
864
864
|
]
|
|
865
865
|
}
|
|
866
866
|
);
|
|
867
867
|
}
|
|
868
|
-
),
|
|
868
|
+
), Pt = h(
|
|
869
869
|
(e, r) => {
|
|
870
870
|
const { className: t, ...n } = e, { contentPosition: a } = A(V);
|
|
871
871
|
return /* @__PURE__ */ o(
|
|
@@ -884,16 +884,16 @@ const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
884
884
|
}
|
|
885
885
|
);
|
|
886
886
|
}
|
|
887
|
-
),
|
|
887
|
+
), de = h((e, r) => {
|
|
888
888
|
const {
|
|
889
889
|
className: t,
|
|
890
890
|
isInvalid: n,
|
|
891
891
|
size: a,
|
|
892
892
|
as: s,
|
|
893
893
|
type: i,
|
|
894
|
-
rightAddon:
|
|
894
|
+
rightAddon: d,
|
|
895
895
|
leftAddon: m,
|
|
896
|
-
...
|
|
896
|
+
...c
|
|
897
897
|
} = e, u = s ?? "input", g = Qe(u, i);
|
|
898
898
|
return /* @__PURE__ */ f(
|
|
899
899
|
"div",
|
|
@@ -907,7 +907,7 @@ const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
907
907
|
"w-fit": a != null,
|
|
908
908
|
"w-full": a == null,
|
|
909
909
|
"pl-4": m,
|
|
910
|
-
"pr-4":
|
|
910
|
+
"pr-4": d
|
|
911
911
|
}
|
|
912
912
|
),
|
|
913
913
|
children: [
|
|
@@ -920,10 +920,10 @@ const V = w({ bgColor: "white", contentPosition: "below-center", hasImage: !1 })
|
|
|
920
920
|
className: "focus:none placeholder-gray w-full rounded-lg border-none px-4 py-3.5 focus:outline-none",
|
|
921
921
|
size: a,
|
|
922
922
|
type: g,
|
|
923
|
-
...
|
|
923
|
+
...c
|
|
924
924
|
}
|
|
925
925
|
),
|
|
926
|
-
|
|
926
|
+
d
|
|
927
927
|
]
|
|
928
928
|
}
|
|
929
929
|
);
|
|
@@ -934,7 +934,7 @@ function Qe(e, r) {
|
|
|
934
934
|
if (e === "input")
|
|
935
935
|
return "text";
|
|
936
936
|
}
|
|
937
|
-
const
|
|
937
|
+
const Mt = (e) => {
|
|
938
938
|
let r = "";
|
|
939
939
|
return e.icon && (r = "inline-flex items-center gap-2"), /* @__PURE__ */ f("a", { className: r, href: e.href, children: [
|
|
940
940
|
e.icon,
|
|
@@ -945,11 +945,11 @@ const Pt = (e) => {
|
|
|
945
945
|
isExpanded: !1,
|
|
946
946
|
collapsibleId: ""
|
|
947
947
|
}), zt = (e) => {
|
|
948
|
-
const { className: r, children: t, ...n } = e, a = $(), [s, i] = q(!1),
|
|
948
|
+
const { className: r, children: t, ...n } = e, a = $(), [s, i] = q(!1), d = C(
|
|
949
949
|
() => ({ isExpanded: s, setIsExpanded: i, collapsibleId: a }),
|
|
950
950
|
[s, a]
|
|
951
951
|
);
|
|
952
|
-
return /* @__PURE__ */ o(
|
|
952
|
+
return /* @__PURE__ */ o(P.Provider, { value: "white", children: /* @__PURE__ */ o(S.Provider, { value: d, children: /* @__PURE__ */ o(
|
|
953
953
|
"div",
|
|
954
954
|
{
|
|
955
955
|
className: l(
|
|
@@ -1052,9 +1052,9 @@ const Pt = (e) => {
|
|
|
1052
1052
|
onChange: a,
|
|
1053
1053
|
getItemHref: s,
|
|
1054
1054
|
getItemAriaLabel: i,
|
|
1055
|
-
nextPageAriaLabel:
|
|
1055
|
+
nextPageAriaLabel: d,
|
|
1056
1056
|
prevPageAriaLabel: m,
|
|
1057
|
-
...
|
|
1057
|
+
...c
|
|
1058
1058
|
} = e, u = C(
|
|
1059
1059
|
() => ({
|
|
1060
1060
|
currentPage: Math.max(1, Math.min(t, n)),
|
|
@@ -1068,7 +1068,7 @@ const Pt = (e) => {
|
|
|
1068
1068
|
"nav",
|
|
1069
1069
|
{
|
|
1070
1070
|
className: l("flex justify-center gap-2 sm:gap-4", r),
|
|
1071
|
-
...
|
|
1071
|
+
...c,
|
|
1072
1072
|
children: [
|
|
1073
1073
|
/* @__PURE__ */ o(
|
|
1074
1074
|
He,
|
|
@@ -1103,7 +1103,7 @@ const Pt = (e) => {
|
|
|
1103
1103
|
/* @__PURE__ */ o(
|
|
1104
1104
|
Be,
|
|
1105
1105
|
{
|
|
1106
|
-
"aria-label":
|
|
1106
|
+
"aria-label": d,
|
|
1107
1107
|
href: s(t + 1),
|
|
1108
1108
|
onClick: g(t + 1)
|
|
1109
1109
|
}
|
|
@@ -1159,7 +1159,7 @@ const Pt = (e) => {
|
|
|
1159
1159
|
Math.min(r - y, n - y * 2),
|
|
1160
1160
|
1
|
|
1161
1161
|
);
|
|
1162
|
-
return a - y === 0 && (a = a - 1), Array.from({ length: n - a }, (i,
|
|
1162
|
+
return a - y === 0 && (a = a - 1), Array.from({ length: n - a }, (i, d) => a + d + 1).map((i) => e(i));
|
|
1163
1163
|
}, G = h((e, r) => {
|
|
1164
1164
|
const { page: t, selected: n, ...a } = e;
|
|
1165
1165
|
return /* @__PURE__ */ o(U, { "aria-current": n ? "page" : void 0, ref: r, ...a, children: t });
|
|
@@ -1172,7 +1172,7 @@ const Pt = (e) => {
|
|
|
1172
1172
|
value: void 0,
|
|
1173
1173
|
error: !1
|
|
1174
1174
|
}), Zt = h((e, r) => {
|
|
1175
|
-
const { children: t, className: n, ...a } = e, { defaultValue: s, isControlled: i, name:
|
|
1175
|
+
const { children: t, className: n, ...a } = e, { defaultValue: s, isControlled: i, name: d, onChange: m, required: c, value: u, error: g } = A(me);
|
|
1176
1176
|
return /* @__PURE__ */ f("label", { className: l(n, "flex cursor-pointer gap-2.5"), children: [
|
|
1177
1177
|
/* @__PURE__ */ o(
|
|
1178
1178
|
"input",
|
|
@@ -1180,9 +1180,9 @@ const Pt = (e) => {
|
|
|
1180
1180
|
className: l("radio", g && "border-red"),
|
|
1181
1181
|
defaultChecked: i ? void 0 : a.value === s,
|
|
1182
1182
|
checked: i ? a.value === u : void 0,
|
|
1183
|
-
name:
|
|
1183
|
+
name: d,
|
|
1184
1184
|
onChange: i ? m : void 0,
|
|
1185
|
-
required:
|
|
1185
|
+
required: c,
|
|
1186
1186
|
type: "radio",
|
|
1187
1187
|
ref: r,
|
|
1188
1188
|
...a
|
|
@@ -1197,9 +1197,9 @@ const Pt = (e) => {
|
|
|
1197
1197
|
defaultValue: a,
|
|
1198
1198
|
description: s,
|
|
1199
1199
|
error: i,
|
|
1200
|
-
id:
|
|
1200
|
+
id: d,
|
|
1201
1201
|
children: m,
|
|
1202
|
-
label:
|
|
1202
|
+
label: c,
|
|
1203
1203
|
name: u,
|
|
1204
1204
|
onChange: g,
|
|
1205
1205
|
required: b,
|
|
@@ -1222,7 +1222,7 @@ const Pt = (e) => {
|
|
|
1222
1222
|
error: !!i
|
|
1223
1223
|
}),
|
|
1224
1224
|
[a, t, u, x, b, p, i]
|
|
1225
|
-
), J = R(
|
|
1225
|
+
), J = R(d), B = `${J}:label`, H = `${J}:help`, D = J + "err", j = i;
|
|
1226
1226
|
return /* @__PURE__ */ o(me.Provider, { value: F, children: /* @__PURE__ */ f(
|
|
1227
1227
|
"div",
|
|
1228
1228
|
{
|
|
@@ -1231,14 +1231,14 @@ const Pt = (e) => {
|
|
|
1231
1231
|
[H]: s
|
|
1232
1232
|
}) || void 0,
|
|
1233
1233
|
"aria-invalid": !!i,
|
|
1234
|
-
"aria-labelledby":
|
|
1234
|
+
"aria-labelledby": c ? B : void 0,
|
|
1235
1235
|
className: l(n, "flex flex-col gap-4"),
|
|
1236
1236
|
role: "radiogroup",
|
|
1237
1237
|
ref: r,
|
|
1238
1238
|
...v,
|
|
1239
1239
|
children: [
|
|
1240
|
-
|
|
1241
|
-
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 }),
|
|
1242
1242
|
m,
|
|
1243
1243
|
j && /* @__PURE__ */ o(k, { id: D, children: j })
|
|
1244
1244
|
]
|
|
@@ -1247,8 +1247,8 @@ const Pt = (e) => {
|
|
|
1247
1247
|
}
|
|
1248
1248
|
), _e = h(
|
|
1249
1249
|
(e, r) => {
|
|
1250
|
-
const { children: t, className: n, isInvalid: a, size: s, ...i } = e,
|
|
1251
|
-
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: [
|
|
1252
1252
|
/* @__PURE__ */ o(
|
|
1253
1253
|
"select",
|
|
1254
1254
|
{
|
|
@@ -1256,7 +1256,7 @@ const Pt = (e) => {
|
|
|
1256
1256
|
...i,
|
|
1257
1257
|
className: l(
|
|
1258
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",
|
|
1259
|
-
|
|
1259
|
+
d ? "rounded px-3.5 py-2" : "rounded-lg px-4 py-3.5",
|
|
1260
1260
|
a ? "border-red focus:border-red" : "focus:border-blue-dark border-black"
|
|
1261
1261
|
),
|
|
1262
1262
|
ref: r,
|
|
@@ -1268,7 +1268,7 @@ const Pt = (e) => {
|
|
|
1268
1268
|
{
|
|
1269
1269
|
className: l(
|
|
1270
1270
|
"pointer-events-none absolute bottom-0 top-0 my-auto",
|
|
1271
|
-
|
|
1271
|
+
d ? "right-3.5" : "right-4"
|
|
1272
1272
|
)
|
|
1273
1273
|
}
|
|
1274
1274
|
)
|
|
@@ -1282,8 +1282,8 @@ const Pt = (e) => {
|
|
|
1282
1282
|
id: a,
|
|
1283
1283
|
label: s,
|
|
1284
1284
|
disableValidation: i = !1,
|
|
1285
|
-
...
|
|
1286
|
-
} = e, m = E(null),
|
|
1285
|
+
...d
|
|
1286
|
+
} = e, m = E(null), c = K([m, r]), { validity: u, validationMessage: g } = L(
|
|
1287
1287
|
m,
|
|
1288
1288
|
!i
|
|
1289
1289
|
), b = R(a), p = b + "help", v = b + "err", x = n || g;
|
|
@@ -1297,13 +1297,13 @@ const Pt = (e) => {
|
|
|
1297
1297
|
children: s
|
|
1298
1298
|
}
|
|
1299
1299
|
),
|
|
1300
|
-
t && /* @__PURE__ */ o(
|
|
1300
|
+
t && /* @__PURE__ */ o(M, { id: p, children: t }),
|
|
1301
1301
|
/* @__PURE__ */ o(
|
|
1302
1302
|
_e,
|
|
1303
1303
|
{
|
|
1304
1304
|
id: b,
|
|
1305
|
-
ref:
|
|
1306
|
-
...
|
|
1305
|
+
ref: c,
|
|
1306
|
+
...d,
|
|
1307
1307
|
isInvalid: !!n || u === "invalid",
|
|
1308
1308
|
"aria-describedby": l({
|
|
1309
1309
|
[v]: x,
|
|
@@ -1405,8 +1405,8 @@ const Qt = h(
|
|
|
1405
1405
|
id: a,
|
|
1406
1406
|
label: s,
|
|
1407
1407
|
disableValidation: i = !1,
|
|
1408
|
-
...
|
|
1409
|
-
} = e, m = E(null),
|
|
1408
|
+
...d
|
|
1409
|
+
} = e, m = E(null), c = K([m, r]), { validity: u, validationMessage: g } = L(
|
|
1410
1410
|
m,
|
|
1411
1411
|
!i
|
|
1412
1412
|
), b = R(a), p = b + "help", v = b + "err", x = n || g;
|
|
@@ -1420,14 +1420,14 @@ const Qt = h(
|
|
|
1420
1420
|
children: s
|
|
1421
1421
|
}
|
|
1422
1422
|
),
|
|
1423
|
-
t && /* @__PURE__ */ o(
|
|
1423
|
+
t && /* @__PURE__ */ o(M, { id: p, children: t }),
|
|
1424
1424
|
/* @__PURE__ */ o(
|
|
1425
|
-
|
|
1425
|
+
de,
|
|
1426
1426
|
{
|
|
1427
1427
|
as: "textarea",
|
|
1428
|
-
ref:
|
|
1428
|
+
ref: c,
|
|
1429
1429
|
id: b,
|
|
1430
|
-
...
|
|
1430
|
+
...d,
|
|
1431
1431
|
isInvalid: !!n || u === "invalid",
|
|
1432
1432
|
"aria-describedby": l({
|
|
1433
1433
|
[v]: x,
|
|
@@ -1446,12 +1446,12 @@ const Qt = h(
|
|
|
1446
1446
|
id: a,
|
|
1447
1447
|
label: s,
|
|
1448
1448
|
type: i = "text",
|
|
1449
|
-
disableValidation:
|
|
1449
|
+
disableValidation: d = !1,
|
|
1450
1450
|
...m
|
|
1451
|
-
} = e,
|
|
1452
|
-
|
|
1453
|
-
!
|
|
1454
|
-
), b = R(a), p = b + "help", v = b + "err", x = n || g, F = K(
|
|
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]);
|
|
1455
1455
|
return /* @__PURE__ */ f("div", { className: "grid gap-2", children: [
|
|
1456
1456
|
/* @__PURE__ */ o(
|
|
1457
1457
|
z,
|
|
@@ -1462,9 +1462,9 @@ const Qt = h(
|
|
|
1462
1462
|
children: s
|
|
1463
1463
|
}
|
|
1464
1464
|
),
|
|
1465
|
-
t && /* @__PURE__ */ o(
|
|
1465
|
+
t && /* @__PURE__ */ o(M, { id: p, children: t }),
|
|
1466
1466
|
/* @__PURE__ */ o(
|
|
1467
|
-
|
|
1467
|
+
de,
|
|
1468
1468
|
{
|
|
1469
1469
|
id: b,
|
|
1470
1470
|
ref: F,
|
|
@@ -1486,11 +1486,11 @@ export {
|
|
|
1486
1486
|
ke as AccordionContent,
|
|
1487
1487
|
Re as AccordionHeader,
|
|
1488
1488
|
Ee as AccordionItem,
|
|
1489
|
-
|
|
1489
|
+
ct as Alert,
|
|
1490
1490
|
mt as Banner,
|
|
1491
1491
|
ut as BannerImage,
|
|
1492
1492
|
bt as Button,
|
|
1493
|
-
|
|
1493
|
+
P as ButtonColorContext,
|
|
1494
1494
|
ft as Campaign,
|
|
1495
1495
|
gt as Card,
|
|
1496
1496
|
At as CardContent,
|
|
@@ -1504,7 +1504,7 @@ export {
|
|
|
1504
1504
|
It as FormError,
|
|
1505
1505
|
k as FormErrorMessage,
|
|
1506
1506
|
Ze as FormHeading,
|
|
1507
|
-
|
|
1507
|
+
M as FormHelperText,
|
|
1508
1508
|
z as FormLabel,
|
|
1509
1509
|
kt as FormStep,
|
|
1510
1510
|
We as FormStepHeader,
|
|
@@ -1512,12 +1512,12 @@ export {
|
|
|
1512
1512
|
Rt as FormStepProvider,
|
|
1513
1513
|
Ct as FormSuccess,
|
|
1514
1514
|
St as Hero,
|
|
1515
|
-
|
|
1515
|
+
Pt as HeroActions,
|
|
1516
1516
|
Lt as HeroContent,
|
|
1517
1517
|
V as HeroContext,
|
|
1518
1518
|
qt as HeroImage,
|
|
1519
|
-
|
|
1520
|
-
|
|
1519
|
+
de as Input,
|
|
1520
|
+
Mt as Link,
|
|
1521
1521
|
zt as Navbar,
|
|
1522
1522
|
Jt as NavbarCollapsible,
|
|
1523
1523
|
Ft as NavbarContent,
|
|
@@ -1540,6 +1540,6 @@ export {
|
|
|
1540
1540
|
Et as useFormContext,
|
|
1541
1541
|
L as useFormControlValidity,
|
|
1542
1542
|
Xe as useFormStepContext,
|
|
1543
|
-
|
|
1543
|
+
dt as usePrefersReducedMotion,
|
|
1544
1544
|
Le as useScreenMaxWidthMd
|
|
1545
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
|
-
"@storybook/addon-controls": "7.0.
|
|
21
|
-
"@storybook/addon-docs": "7.0.
|
|
22
|
-
"@storybook/addon-styling": "1.0
|
|
23
|
-
"@storybook/builder-vite": "7.0.
|
|
24
|
-
"@storybook/react": "7.0.
|
|
25
|
-
"@storybook/react-vite": "7.0.
|
|
26
|
-
"@types/react": "18.2.
|
|
27
|
-
"@types/react-dom": "18.2.
|
|
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",
|
|
28
28
|
"@vitejs/plugin-react": "4.0.0",
|
|
29
29
|
"autoprefixer": "10.4.14",
|
|
30
|
-
"postcss": "8.4.
|
|
30
|
+
"postcss": "8.4.24",
|
|
31
31
|
"react": "18.2.0",
|
|
32
32
|
"react-dom": "18.2.0",
|
|
33
33
|
"require-from-string": "2.0.2",
|
|
34
34
|
"rimraf": "5.0.1",
|
|
35
|
-
"storybook": "7.0.
|
|
35
|
+
"storybook": "7.0.22",
|
|
36
36
|
"tailwindcss": "3.3.2",
|
|
37
|
-
"type-fest": "3.
|
|
38
|
-
"vite": "4.3.
|
|
37
|
+
"type-fest": "3.12.0",
|
|
38
|
+
"vite": "4.3.9",
|
|
39
39
|
"@obosbbl/grunnmuren-tailwind": "0.9.1"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@react-hook/merged-ref": "1.3.2",
|
|
43
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": {
|