@tempots/beatui 0.63.0 → 0.65.0
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/auth/index.cjs.js +1 -1
- package/dist/auth/index.es.js +2 -2
- package/dist/beatui.css +10 -7
- package/dist/beatui.tailwind.css +10 -7
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +2 -2
- package/dist/{modal-CaEq5S47.cjs → modal-BFmCVPI6.cjs} +1 -1
- package/dist/{modal-D137b7S7.js → modal-D9LzHK9g.js} +1 -1
- package/dist/notice-BuSRMaZb.cjs +2 -0
- package/dist/{notice-DUpqtjgC.js → notice-CTONCH2t.js} +219 -230
- package/dist/{utils-Lx2CyUUf.js → utils-BbvrUmvw.js} +1 -1
- package/dist/{utils-_FbKFtEZ.cjs → utils-CIHYei1q.cjs} +1 -1
- package/package.json +1 -1
- package/dist/notice-CDDmL_KD.cjs +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Use as q, coalesce as
|
|
2
|
-
import { a as z, B as oe, I as B, b as W, c as ce, C as
|
|
1
|
+
import { Use as q, coalesce as Q, aria as x, attr as c, html as f, on as D, Value as S, Empty as C, computedOf as w, When as V, dataAttr as R, input as ne, emitValue as F, prop as I, Fragment as N, TextNode as re, emitValueAsNumber as ie, Unless as ae, Ensure as le } from "@tempots/dom";
|
|
2
|
+
import { a as z, B as oe, I as B, b as W, c as ce, C as X } from "./translations-BUTBIDsS.js";
|
|
3
3
|
const K = /* @__PURE__ */ new Map();
|
|
4
4
|
function H(e) {
|
|
5
5
|
const s = K.get(e) ?? 0;
|
|
6
6
|
return K.set(e, s + 1), `${e}-${s}`;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const y = {
|
|
9
9
|
/**
|
|
10
10
|
* Creates a loading state.
|
|
11
11
|
* @param previousValue - The previous value.
|
|
@@ -84,7 +84,7 @@ const w = {
|
|
|
84
84
|
* @public
|
|
85
85
|
*/
|
|
86
86
|
getOrElse(e, s) {
|
|
87
|
-
return
|
|
87
|
+
return y.isSuccess(e) ? e.value : s;
|
|
88
88
|
},
|
|
89
89
|
/**
|
|
90
90
|
* Gets the value if the result is a success; otherwise, returns the value from the alternative function.
|
|
@@ -95,7 +95,7 @@ const w = {
|
|
|
95
95
|
* function.
|
|
96
96
|
*/
|
|
97
97
|
getOrElseLazy(e, s) {
|
|
98
|
-
return
|
|
98
|
+
return y.isSuccess(e) ? e.value : s();
|
|
99
99
|
},
|
|
100
100
|
/**
|
|
101
101
|
* Gets the value if the result is a success; otherwise, returns `null`.
|
|
@@ -104,7 +104,7 @@ const w = {
|
|
|
104
104
|
* @public
|
|
105
105
|
*/
|
|
106
106
|
getOrNull(e) {
|
|
107
|
-
return
|
|
107
|
+
return y.isSuccess(e) ? e.value : null;
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
110
110
|
* Gets the value if the result is a success; otherwise, returns `undefined`.
|
|
@@ -113,7 +113,7 @@ const w = {
|
|
|
113
113
|
* @public
|
|
114
114
|
*/
|
|
115
115
|
getOrUndefined(e) {
|
|
116
|
-
return
|
|
116
|
+
return y.isSuccess(e) ? e.value : void 0;
|
|
117
117
|
},
|
|
118
118
|
/**
|
|
119
119
|
* Gets the value of a `AsyncResult` if it is a `Success`, otherwise it throws the error contained in the `Failure`.
|
|
@@ -121,9 +121,9 @@ const w = {
|
|
|
121
121
|
* @returns The value of the `AsyncResult` if it is a `Success`.
|
|
122
122
|
*/
|
|
123
123
|
getUnsafe: (e) => {
|
|
124
|
-
if (
|
|
124
|
+
if (y.isSuccess(e))
|
|
125
125
|
return e.value;
|
|
126
|
-
throw
|
|
126
|
+
throw y.isFailure(e) ? e.error : new Error("Cannot get value from a not-asked or loading result");
|
|
127
127
|
},
|
|
128
128
|
/**
|
|
129
129
|
* Based on the state of the result, it picks the appropriate function to call and returns the result.
|
|
@@ -139,7 +139,7 @@ const w = {
|
|
|
139
139
|
failure: t,
|
|
140
140
|
loading: n,
|
|
141
141
|
notAsked: r = n
|
|
142
|
-
}) =>
|
|
142
|
+
}) => y.isSuccess(e) ? s(e.value) : y.isFailure(e) ? t(e.error) : y.isNotAsked(e) ? r() : n(e.previousValue),
|
|
143
143
|
/**
|
|
144
144
|
* When the result is a success, it applies the function to the value.
|
|
145
145
|
*
|
|
@@ -148,7 +148,7 @@ const w = {
|
|
|
148
148
|
* @returns The result that was passed in.
|
|
149
149
|
* @public
|
|
150
150
|
*/
|
|
151
|
-
whenSuccess: (e, s) => (
|
|
151
|
+
whenSuccess: (e, s) => (y.isSuccess(e) && s(e.value), e),
|
|
152
152
|
/**
|
|
153
153
|
* When the result is a failure, it applies the function to the error.
|
|
154
154
|
*
|
|
@@ -157,7 +157,7 @@ const w = {
|
|
|
157
157
|
* @returns The result that was passed in.
|
|
158
158
|
* @public
|
|
159
159
|
*/
|
|
160
|
-
whenFailure: (e, s) => (
|
|
160
|
+
whenFailure: (e, s) => (y.isFailure(e) && s(e.error), e),
|
|
161
161
|
/**
|
|
162
162
|
* Compares two results for equality.
|
|
163
163
|
* @param r1 - The first result.
|
|
@@ -177,11 +177,11 @@ const w = {
|
|
|
177
177
|
all: (e) => {
|
|
178
178
|
const s = [];
|
|
179
179
|
for (const t of e)
|
|
180
|
-
if (
|
|
180
|
+
if (y.isSuccess(t))
|
|
181
181
|
s.push(t.value);
|
|
182
182
|
else
|
|
183
183
|
return t;
|
|
184
|
-
return
|
|
184
|
+
return y.success(s);
|
|
185
185
|
},
|
|
186
186
|
/**
|
|
187
187
|
* Converts a Promise to an AsyncResult.
|
|
@@ -191,12 +191,12 @@ const w = {
|
|
|
191
191
|
ofPromise: async (e) => {
|
|
192
192
|
try {
|
|
193
193
|
const s = await e;
|
|
194
|
-
return
|
|
194
|
+
return y.success(s);
|
|
195
195
|
} catch (s) {
|
|
196
|
-
return
|
|
196
|
+
return y.failure(s instanceof Error ? s : new Error(String(s)));
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
}, $ = (e, s) => e === s || e !== e && s !== s,
|
|
199
|
+
}, $ = (e, s) => e === s || e !== e && s !== s, _ = {
|
|
200
200
|
/**
|
|
201
201
|
* Creates a valid `Validation`.
|
|
202
202
|
* @returns A `Validation` that is `Valid`.
|
|
@@ -234,14 +234,14 @@ const w = {
|
|
|
234
234
|
* @param invalid - The mapping function for an invalid value.
|
|
235
235
|
* @returns The mapped value.
|
|
236
236
|
*/
|
|
237
|
-
match: (e, s, t) =>
|
|
237
|
+
match: (e, s, t) => _.isValid(e) ? s() : t(e.error),
|
|
238
238
|
/**
|
|
239
239
|
* Maps the value of a `Validation` to a new `Validation`.
|
|
240
240
|
* @param validation - The `Validation` to map.
|
|
241
241
|
* @param value - The value to map.
|
|
242
242
|
* @returns A new `Validation` with the mapped value.
|
|
243
243
|
*/
|
|
244
|
-
toResult: (e, s) =>
|
|
244
|
+
toResult: (e, s) => _.match(
|
|
245
245
|
e,
|
|
246
246
|
() => m.success(s),
|
|
247
247
|
(t) => m.failure(t)
|
|
@@ -253,7 +253,7 @@ const w = {
|
|
|
253
253
|
* @param apply - The function to execute when the `Validation` is valid.
|
|
254
254
|
* @returns The `Validation` object.
|
|
255
255
|
*/
|
|
256
|
-
whenValid: (e, s) => (
|
|
256
|
+
whenValid: (e, s) => (_.isValid(e) && s(), e),
|
|
257
257
|
/**
|
|
258
258
|
* Execute a function when the `Validation` is invalid.
|
|
259
259
|
*
|
|
@@ -261,7 +261,7 @@ const w = {
|
|
|
261
261
|
* @param apply - The function to execute when the `Validation` is invalid.
|
|
262
262
|
* @returns The `Validation` object.
|
|
263
263
|
*/
|
|
264
|
-
whenInvalid: (e, s) => (
|
|
264
|
+
whenInvalid: (e, s) => (_.isInvalid(e) && s(e.error), e)
|
|
265
265
|
}, m = {
|
|
266
266
|
/**
|
|
267
267
|
* Creates a successful `Result`.
|
|
@@ -308,8 +308,8 @@ const w = {
|
|
|
308
308
|
toAsync(e) {
|
|
309
309
|
return m.match(
|
|
310
310
|
e,
|
|
311
|
-
(s) =>
|
|
312
|
-
(s) =>
|
|
311
|
+
(s) => y.success(s),
|
|
312
|
+
(s) => y.failure(s)
|
|
313
313
|
);
|
|
314
314
|
},
|
|
315
315
|
/**
|
|
@@ -321,8 +321,8 @@ const w = {
|
|
|
321
321
|
toValidation(e) {
|
|
322
322
|
return m.match(
|
|
323
323
|
e,
|
|
324
|
-
() =>
|
|
325
|
-
(s) =>
|
|
324
|
+
() => _.valid,
|
|
325
|
+
(s) => _.invalid(s)
|
|
326
326
|
);
|
|
327
327
|
},
|
|
328
328
|
/**
|
|
@@ -466,7 +466,7 @@ function ue({
|
|
|
466
466
|
label: l
|
|
467
467
|
}, ...a) {
|
|
468
468
|
return q(z, (o) => {
|
|
469
|
-
const p =
|
|
469
|
+
const p = Q(l, o.$.closeModal);
|
|
470
470
|
return oe(
|
|
471
471
|
{
|
|
472
472
|
variant: "text",
|
|
@@ -486,7 +486,7 @@ function ue({
|
|
|
486
486
|
function U(e) {
|
|
487
487
|
return `bc-label bc-label--${e}`;
|
|
488
488
|
}
|
|
489
|
-
const
|
|
489
|
+
const Oe = (...e) => f.span(c.class(U("emphasis")), ...e), he = (...e) => f.span(c.class(U("default")), ...e), de = (...e) => f.span(c.class(U("muted")), ...e), Me = (...e) => f.span(c.class(U("danger")), ...e), Fe = (e) => {
|
|
490
490
|
const {
|
|
491
491
|
value: s,
|
|
492
492
|
onBlur: t,
|
|
@@ -497,12 +497,12 @@ const Ve = (...e) => f.span(c.class(U("emphasis")), ...e), he = (...e) => f.span
|
|
|
497
497
|
checkedIcon: a,
|
|
498
498
|
uncheckedIcon: o,
|
|
499
499
|
iconSize: p = "lg"
|
|
500
|
-
} = e, h = l ?? H("checkbox"), b = `${h}-label`,
|
|
501
|
-
if (
|
|
502
|
-
const u =
|
|
500
|
+
} = e, h = l ?? H("checkbox"), b = `${h}-label`, k = () => {
|
|
501
|
+
if (S.get(i ?? !1)) return;
|
|
502
|
+
const u = S.get(s);
|
|
503
503
|
n?.(!u);
|
|
504
|
-
},
|
|
505
|
-
|
|
504
|
+
}, g = (u) => {
|
|
505
|
+
S.get(i ?? !1) || (u.key === " " || u.key === "Enter") && (u.preventDefault(), k());
|
|
506
506
|
};
|
|
507
507
|
return W(
|
|
508
508
|
{
|
|
@@ -514,13 +514,13 @@ const Ve = (...e) => f.span(c.class(U("emphasis")), ...e), he = (...e) => f.span
|
|
|
514
514
|
f.span(
|
|
515
515
|
c.class("bc-checkbox-input__checkbox"),
|
|
516
516
|
c.class(
|
|
517
|
-
|
|
517
|
+
S.map(
|
|
518
518
|
s,
|
|
519
519
|
(u) => u ? "bc-checkbox-input__checkbox--checked" : "bc-checkbox-input__checkbox--unchecked"
|
|
520
520
|
)
|
|
521
521
|
),
|
|
522
522
|
c.class(
|
|
523
|
-
|
|
523
|
+
S.map(
|
|
524
524
|
i ?? !1,
|
|
525
525
|
(u) => u ? "bc-checkbox-input__checkbox--disabled" : ""
|
|
526
526
|
)
|
|
@@ -528,23 +528,23 @@ const Ve = (...e) => f.span(c.class(U("emphasis")), ...e), he = (...e) => f.span
|
|
|
528
528
|
c.id(h),
|
|
529
529
|
c.role("checkbox"),
|
|
530
530
|
c.tabindex(
|
|
531
|
-
|
|
531
|
+
S.map(
|
|
532
532
|
i ?? !1,
|
|
533
533
|
(u) => u ? -1 : 0
|
|
534
534
|
)
|
|
535
535
|
),
|
|
536
536
|
x.checked(s),
|
|
537
537
|
x.disabled(i),
|
|
538
|
-
r != null ? x.labelledby(b) :
|
|
539
|
-
|
|
540
|
-
t != null ?
|
|
538
|
+
r != null ? x.labelledby(b) : C,
|
|
539
|
+
D.keydown(g),
|
|
540
|
+
t != null ? D.blur(t) : C,
|
|
541
541
|
B({
|
|
542
|
-
icon:
|
|
542
|
+
icon: w(
|
|
543
543
|
s,
|
|
544
544
|
a,
|
|
545
545
|
o
|
|
546
546
|
)(
|
|
547
|
-
(u, d,
|
|
547
|
+
(u, d, v) => u ? d ?? "akar-icons/check-box-fill" : v ?? "akar-icons/box"
|
|
548
548
|
),
|
|
549
549
|
accessibility: "decorative",
|
|
550
550
|
size: p
|
|
@@ -555,10 +555,10 @@ const Ve = (...e) => f.span(c.class(U("emphasis")), ...e), he = (...e) => f.span
|
|
|
555
555
|
c.id(b),
|
|
556
556
|
c.for(h),
|
|
557
557
|
de(r)
|
|
558
|
-
) :
|
|
558
|
+
) : C
|
|
559
559
|
)
|
|
560
560
|
},
|
|
561
|
-
|
|
561
|
+
D.click(k)
|
|
562
562
|
);
|
|
563
563
|
}, pe = f.span(
|
|
564
564
|
c.class("bc-input-wrapper__required"),
|
|
@@ -572,11 +572,11 @@ function be(e, s) {
|
|
|
572
572
|
const t = ["bc-input-wrapper__label-text"];
|
|
573
573
|
return e ? t.push("bc-input-wrapper__label-text--error") : s ? t.push("bc-input-wrapper__label-text--disabled") : t.push("bc-input-wrapper__label-text--default"), t.join(" ");
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function me(e, s) {
|
|
576
576
|
if (e === "horizontal-fixed" && s != null)
|
|
577
577
|
return `--input-wrapper-label-width: ${s}`;
|
|
578
578
|
}
|
|
579
|
-
const
|
|
579
|
+
const Y = ({
|
|
580
580
|
fullWidth: e = !1,
|
|
581
581
|
required: s,
|
|
582
582
|
label: t,
|
|
@@ -589,61 +589,50 @@ const Z = ({
|
|
|
589
589
|
hasError: p,
|
|
590
590
|
disabled: h,
|
|
591
591
|
layout: b,
|
|
592
|
-
labelWidth:
|
|
593
|
-
}, ...
|
|
594
|
-
const u = p ?? a != null, d = h ?? !1,
|
|
592
|
+
labelWidth: k
|
|
593
|
+
}, ...g) => {
|
|
594
|
+
const u = p ?? a != null, d = h ?? !1, v = b ?? "vertical", T = H("input-wrapper"), A = i ? `${T}-description` : void 0, P = a != null ? `${T}-error` : void 0, L = w(v)((E) => E !== "vertical"), te = w(
|
|
595
|
+
v,
|
|
596
|
+
k ?? void 0
|
|
597
|
+
)((E, M) => me(E, M));
|
|
595
598
|
return f.div(
|
|
596
|
-
c.class(
|
|
599
|
+
c.class(S.map(v, (E) => fe(E))),
|
|
597
600
|
c.class(
|
|
598
|
-
|
|
601
|
+
S.map(
|
|
599
602
|
e,
|
|
600
|
-
(
|
|
601
|
-
)
|
|
602
|
-
),
|
|
603
|
-
O(
|
|
604
|
-
k(
|
|
605
|
-
g,
|
|
606
|
-
S ?? void 0
|
|
607
|
-
)((y, V) => G(y, V) != null),
|
|
608
|
-
() => c.style(
|
|
609
|
-
C.map(
|
|
610
|
-
k(
|
|
611
|
-
g,
|
|
612
|
-
S ?? void 0
|
|
613
|
-
)((y, V) => G(y, V)),
|
|
614
|
-
(y) => y
|
|
615
|
-
)
|
|
603
|
+
(E) => E ? "bc-input-wrapper--full-width" : ""
|
|
616
604
|
)
|
|
617
605
|
),
|
|
606
|
+
c.style(te),
|
|
618
607
|
t != null || r != null ? f.div(
|
|
619
608
|
c.class("bc-input-wrapper__header"),
|
|
620
609
|
f.div(
|
|
621
610
|
c.class("bc-input-wrapper__label-section"),
|
|
622
611
|
f.label(
|
|
623
612
|
c.class("bc-input-wrapper__label"),
|
|
624
|
-
o != null ? c.for(o) :
|
|
613
|
+
o != null ? c.for(o) : C,
|
|
625
614
|
f.span(
|
|
626
615
|
c.class(
|
|
627
|
-
|
|
616
|
+
w(
|
|
628
617
|
u,
|
|
629
618
|
d
|
|
630
619
|
)(
|
|
631
|
-
(
|
|
632
|
-
|
|
633
|
-
|
|
620
|
+
(E, M) => be(
|
|
621
|
+
E ?? !1,
|
|
622
|
+
M ?? !1
|
|
634
623
|
)
|
|
635
624
|
)
|
|
636
625
|
),
|
|
637
626
|
t
|
|
638
627
|
),
|
|
639
|
-
t != null && s ? pe :
|
|
628
|
+
t != null && s ? pe : C
|
|
640
629
|
),
|
|
641
630
|
// Show description under label when horizontal
|
|
642
|
-
|
|
643
|
-
|
|
631
|
+
V(
|
|
632
|
+
w(
|
|
644
633
|
L,
|
|
645
634
|
i
|
|
646
|
-
)((
|
|
635
|
+
)((E, M) => E && M != null),
|
|
647
636
|
() => f.div(
|
|
648
637
|
c.class(
|
|
649
638
|
"bc-input-wrapper__description bc-input-wrapper__description--under-label"
|
|
@@ -653,29 +642,29 @@ const Z = ({
|
|
|
653
642
|
)
|
|
654
643
|
)
|
|
655
644
|
),
|
|
656
|
-
r != null ? he(r) :
|
|
645
|
+
r != null ? he(r) : C,
|
|
657
646
|
n
|
|
658
|
-
) :
|
|
647
|
+
) : C,
|
|
659
648
|
f.div(
|
|
660
649
|
c.class("bc-input-wrapper__content"),
|
|
661
650
|
// Add data attributes to help inputs inherit accessibility information
|
|
662
651
|
[A, P].filter(Boolean).length > 0 ? R.describedby(
|
|
663
652
|
[A, P].filter(Boolean).join(" ")
|
|
664
|
-
) :
|
|
665
|
-
s ? R.required("true") :
|
|
666
|
-
|
|
653
|
+
) : C,
|
|
654
|
+
s ? R.required("true") : C,
|
|
655
|
+
V(u, () => R.invalid("true")),
|
|
667
656
|
l
|
|
668
657
|
),
|
|
669
658
|
// Show description at bottom only when not horizontal
|
|
670
|
-
|
|
671
|
-
|
|
659
|
+
V(
|
|
660
|
+
w(L, i)((E, M) => !E && M != null),
|
|
672
661
|
() => f.div(
|
|
673
662
|
c.class("bc-input-wrapper__description"),
|
|
674
663
|
c.id(A),
|
|
675
664
|
i
|
|
676
665
|
)
|
|
677
666
|
),
|
|
678
|
-
|
|
667
|
+
V(
|
|
679
668
|
u,
|
|
680
669
|
() => f.div(
|
|
681
670
|
c.class("bc-input-wrapper__error"),
|
|
@@ -687,13 +676,13 @@ const Z = ({
|
|
|
687
676
|
a
|
|
688
677
|
)
|
|
689
678
|
),
|
|
690
|
-
...
|
|
679
|
+
...g
|
|
691
680
|
);
|
|
692
681
|
};
|
|
693
|
-
function
|
|
682
|
+
function $e(...e) {
|
|
694
683
|
return f.div(c.class("bc-stack"), ...e);
|
|
695
684
|
}
|
|
696
|
-
const
|
|
685
|
+
const xe = (e) => {
|
|
697
686
|
const s = {
|
|
698
687
|
name: "email",
|
|
699
688
|
autocomplete: "email",
|
|
@@ -716,17 +705,17 @@ const $e = (e) => {
|
|
|
716
705
|
...e,
|
|
717
706
|
before: o,
|
|
718
707
|
input: ne.email(
|
|
719
|
-
|
|
720
|
-
c.placeholder(
|
|
708
|
+
X(s),
|
|
709
|
+
c.placeholder(Q(a, p.$.emailPlaceholderText)),
|
|
721
710
|
c.value(t),
|
|
722
711
|
c.class("bc-input"),
|
|
723
|
-
r != null ?
|
|
724
|
-
i != null ?
|
|
725
|
-
l != null ?
|
|
712
|
+
r != null ? D.blur(F(r)) : C,
|
|
713
|
+
i != null ? D.change(F(i)) : C,
|
|
714
|
+
l != null ? D.input(F(l)) : C
|
|
726
715
|
)
|
|
727
716
|
})
|
|
728
717
|
);
|
|
729
|
-
},
|
|
718
|
+
}, Ne = (e) => {
|
|
730
719
|
const {
|
|
731
720
|
value: s,
|
|
732
721
|
onBlur: t,
|
|
@@ -739,26 +728,26 @@ const $e = (e) => {
|
|
|
739
728
|
autocomplete: p,
|
|
740
729
|
placeholder: h,
|
|
741
730
|
...b
|
|
742
|
-
} = e,
|
|
731
|
+
} = e, k = {
|
|
743
732
|
name: "password",
|
|
744
733
|
disabled: o,
|
|
745
734
|
...b
|
|
746
|
-
},
|
|
747
|
-
|
|
735
|
+
}, g = I(!0), u = w(
|
|
736
|
+
g,
|
|
748
737
|
p
|
|
749
|
-
)((d,
|
|
738
|
+
)((d, v) => d ? v ?? "current-password" : "off");
|
|
750
739
|
return q(z, (d) => {
|
|
751
|
-
const
|
|
740
|
+
const v = w(
|
|
752
741
|
d.$.passwordPlaceholderText,
|
|
753
|
-
|
|
742
|
+
g,
|
|
754
743
|
h
|
|
755
744
|
)((A, P, L) => P ? "•••••••••••••••" : L ?? A), T = f.button(
|
|
756
745
|
c.type("button"),
|
|
757
746
|
c.class("bc-input-container__password-toggle"),
|
|
758
747
|
x.label(d.$.togglePasswordVisibility),
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
748
|
+
D.click(() => g.update((A) => !A)),
|
|
749
|
+
V(
|
|
750
|
+
g,
|
|
762
751
|
() => B({ icon: "line-md:watch" }),
|
|
763
752
|
() => B({ icon: "line-md:watch-off" })
|
|
764
753
|
)
|
|
@@ -768,34 +757,34 @@ const $e = (e) => {
|
|
|
768
757
|
disabled: o,
|
|
769
758
|
hasError: a,
|
|
770
759
|
input: f.input(
|
|
771
|
-
|
|
772
|
-
...
|
|
760
|
+
X({
|
|
761
|
+
...k,
|
|
773
762
|
autocomplete: u,
|
|
774
|
-
placeholder:
|
|
763
|
+
placeholder: v
|
|
775
764
|
}),
|
|
776
|
-
|
|
777
|
-
|
|
765
|
+
V(
|
|
766
|
+
g,
|
|
778
767
|
() => N(c.type("password")),
|
|
779
768
|
() => N(c.type("text"))
|
|
780
769
|
),
|
|
781
770
|
c.class("bc-input"),
|
|
782
771
|
c.value(s),
|
|
783
|
-
t != null ?
|
|
784
|
-
n != null ?
|
|
785
|
-
r != null ?
|
|
772
|
+
t != null ? D.blur(F(t)) : C,
|
|
773
|
+
n != null ? D.change(F(n)) : C,
|
|
774
|
+
r != null ? D.input(F(r)) : C
|
|
786
775
|
),
|
|
787
776
|
after: l != null ? N(T, l) : T
|
|
788
777
|
});
|
|
789
778
|
});
|
|
790
|
-
},
|
|
779
|
+
}, ge = (
|
|
791
780
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
792
781
|
(e, s) => () => {
|
|
793
782
|
e.markTouched(), s?.();
|
|
794
783
|
}
|
|
795
|
-
),
|
|
784
|
+
), G = (e, s) => (t) => {
|
|
796
785
|
e.change(t), s?.(t);
|
|
797
786
|
};
|
|
798
|
-
function
|
|
787
|
+
function Z(e, s) {
|
|
799
788
|
const { controller: t, onBlur: n, onChange: r, id: i, triggerOn: l, ...a } = s;
|
|
800
789
|
return e({
|
|
801
790
|
id: i ?? t.name,
|
|
@@ -804,20 +793,20 @@ function ee(e, s) {
|
|
|
804
793
|
hasError: t.errorVisible,
|
|
805
794
|
name: t.name,
|
|
806
795
|
...a,
|
|
807
|
-
onInput: l === "input" ?
|
|
808
|
-
onChange: l !== "input" ?
|
|
809
|
-
onBlur:
|
|
796
|
+
onInput: l === "input" ? G(t, r) : void 0,
|
|
797
|
+
onChange: l !== "input" ? G(t, r) : void 0,
|
|
798
|
+
onBlur: ge(t, n)
|
|
810
799
|
});
|
|
811
800
|
}
|
|
812
|
-
function
|
|
801
|
+
function Pe(e, { id: s, labelFor: t, ...n }, ...r) {
|
|
813
802
|
const i = s ?? n.controller.name ?? H("control"), l = t ?? i;
|
|
814
|
-
return
|
|
803
|
+
return Y(
|
|
815
804
|
{
|
|
816
805
|
...n,
|
|
817
806
|
hasError: n.controller.errorVisible,
|
|
818
807
|
error: re(n.controller.error.map((a) => a ?? "")),
|
|
819
808
|
labelFor: l,
|
|
820
|
-
content:
|
|
809
|
+
content: Z(
|
|
821
810
|
(a) => e({ ...a, id: i }),
|
|
822
811
|
n
|
|
823
812
|
)
|
|
@@ -825,24 +814,24 @@ function Ne(e, { id: s, labelFor: t, ...n }, ...r) {
|
|
|
825
814
|
...r
|
|
826
815
|
);
|
|
827
816
|
}
|
|
828
|
-
function
|
|
817
|
+
function ve(e, s) {
|
|
829
818
|
const { toInput: t, fromInput: n, controller: r, ...i } = s, l = r.transform(t, n);
|
|
830
|
-
return
|
|
819
|
+
return Z(e, {
|
|
831
820
|
...i,
|
|
832
821
|
controller: l
|
|
833
822
|
});
|
|
834
823
|
}
|
|
835
|
-
function
|
|
824
|
+
function Be(e, {
|
|
836
825
|
id: s,
|
|
837
826
|
labelFor: t,
|
|
838
827
|
...n
|
|
839
828
|
}, ...r) {
|
|
840
829
|
const i = s ?? n.controller.name ?? H("control");
|
|
841
|
-
return
|
|
830
|
+
return Y(
|
|
842
831
|
{
|
|
843
832
|
...n,
|
|
844
833
|
labelFor: t ?? i,
|
|
845
|
-
content:
|
|
834
|
+
content: ve(e, {
|
|
846
835
|
...n,
|
|
847
836
|
id: i
|
|
848
837
|
})
|
|
@@ -850,21 +839,21 @@ function Pe(e, {
|
|
|
850
839
|
...r
|
|
851
840
|
);
|
|
852
841
|
}
|
|
853
|
-
function
|
|
842
|
+
function Le(e) {
|
|
854
843
|
return e.split(".").map((t) => {
|
|
855
844
|
const n = t.match(/^\[(\d+)\]$/);
|
|
856
845
|
return n ? Number(n[1]) : t;
|
|
857
846
|
});
|
|
858
847
|
}
|
|
859
|
-
function
|
|
848
|
+
function ye(e) {
|
|
860
849
|
return typeof e == "number" ? `[${e}]` : `.${e}`;
|
|
861
850
|
}
|
|
862
|
-
function
|
|
851
|
+
function we(e) {
|
|
863
852
|
if (e.length === 0) return "";
|
|
864
853
|
const [s, ...t] = e;
|
|
865
854
|
return [
|
|
866
855
|
typeof s == "number" ? `[${s}]` : s,
|
|
867
|
-
...t.map(
|
|
856
|
+
...t.map(ye)
|
|
868
857
|
].join("");
|
|
869
858
|
}
|
|
870
859
|
function j(e) {
|
|
@@ -872,11 +861,11 @@ function j(e) {
|
|
|
872
861
|
if (t.type === "valid") return t;
|
|
873
862
|
let n = t.error;
|
|
874
863
|
for (const r of e)
|
|
875
|
-
if (n = n?.dependencies?.[r], n == null) return
|
|
876
|
-
return
|
|
864
|
+
if (n = n?.dependencies?.[r], n == null) return _.valid;
|
|
865
|
+
return _.invalid(n);
|
|
877
866
|
};
|
|
878
867
|
}
|
|
879
|
-
class
|
|
868
|
+
class O {
|
|
880
869
|
path;
|
|
881
870
|
change;
|
|
882
871
|
signal;
|
|
@@ -900,22 +889,22 @@ class M {
|
|
|
900
889
|
constructor(s, t, n, r, i, l = $) {
|
|
901
890
|
this.path = s, this.change = t, this.signal = n, this.status = r, this.#t = l, this.#s.set(n.value), this.error = r.map(
|
|
902
891
|
(a) => a?.type === "invalid" ? a.error?.message : void 0
|
|
903
|
-
), this.hasError = this.error.map((a) => a != null), this.touched = this.#e.touched, i.validationMode ? this.errorVisible =
|
|
892
|
+
), this.hasError = this.error.map((a) => a != null), this.touched = this.#e.touched, i.validationMode ? this.errorVisible = w(
|
|
904
893
|
this.hasError,
|
|
905
894
|
this.touched,
|
|
906
895
|
i.validationMode
|
|
907
|
-
)((a, o, p) => p === "continuous" ? !!a : !!a && !!o) : this.errorVisible =
|
|
896
|
+
)((a, o, p) => p === "continuous" ? !!a : !!a && !!o) : this.errorVisible = w(
|
|
908
897
|
this.hasError,
|
|
909
898
|
this.touched
|
|
910
|
-
)((a, o) => !!a && !!o), this.dirty =
|
|
899
|
+
)((a, o) => !!a && !!o), this.dirty = w(
|
|
911
900
|
this.signal,
|
|
912
901
|
this.#s
|
|
913
902
|
)((a, o) => !this.#t(a, o)), this.dependencyErrors = r.map(
|
|
914
903
|
(a) => a?.type === "invalid" ? a.error?.dependencies : void 0
|
|
915
|
-
), this.parent = i, this.disabled =
|
|
904
|
+
), this.parent = i, this.disabled = w(
|
|
916
905
|
this.#e.disabled,
|
|
917
906
|
i.disabled
|
|
918
|
-
)((a, o) => a || o), this.disabledOrHasErrors =
|
|
907
|
+
)((a, o) => a || o), this.disabledOrHasErrors = w(
|
|
919
908
|
this.disabled,
|
|
920
909
|
this.hasError
|
|
921
910
|
)((a, o) => a || o), this.onDispose(() => {
|
|
@@ -923,7 +912,7 @@ class M {
|
|
|
923
912
|
});
|
|
924
913
|
}
|
|
925
914
|
get name() {
|
|
926
|
-
return
|
|
915
|
+
return we(this.path);
|
|
927
916
|
}
|
|
928
917
|
onDispose = (s) => {
|
|
929
918
|
this.#n.push(s);
|
|
@@ -954,7 +943,7 @@ class M {
|
|
|
954
943
|
reset = () => {
|
|
955
944
|
this.change(this.#s.value);
|
|
956
945
|
};
|
|
957
|
-
array = (s = $) => new
|
|
946
|
+
array = (s = $) => new Se(
|
|
958
947
|
this.path,
|
|
959
948
|
this.change,
|
|
960
949
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -963,7 +952,7 @@ class M {
|
|
|
963
952
|
this.parent,
|
|
964
953
|
s
|
|
965
954
|
);
|
|
966
|
-
object = (s = $) => new
|
|
955
|
+
object = (s = $) => new ke(
|
|
967
956
|
this.path,
|
|
968
957
|
this.change,
|
|
969
958
|
this.signal,
|
|
@@ -971,7 +960,7 @@ class M {
|
|
|
971
960
|
this.parent,
|
|
972
961
|
s
|
|
973
962
|
);
|
|
974
|
-
transform = (s, t, n = [], r = $) => new
|
|
963
|
+
transform = (s, t, n = [], r = $) => new O(
|
|
975
964
|
[...this.path, ...n],
|
|
976
965
|
(i) => this.change(t(i)),
|
|
977
966
|
this.signal.map(s, r),
|
|
@@ -979,7 +968,7 @@ class M {
|
|
|
979
968
|
this.parent,
|
|
980
969
|
r
|
|
981
970
|
);
|
|
982
|
-
asyncTransform = (s, t, n, r = [], i = $) => new
|
|
971
|
+
asyncTransform = (s, t, n, r = [], i = $) => new O(
|
|
983
972
|
[...this.path, ...r],
|
|
984
973
|
(l) => {
|
|
985
974
|
t(l).then((a) => this.change(a));
|
|
@@ -990,7 +979,7 @@ class M {
|
|
|
990
979
|
i
|
|
991
980
|
);
|
|
992
981
|
}
|
|
993
|
-
class
|
|
982
|
+
class ke extends O {
|
|
994
983
|
#e = /* @__PURE__ */ new Map();
|
|
995
984
|
#t = /* @__PURE__ */ new Map();
|
|
996
985
|
#s = /* @__PURE__ */ new Map();
|
|
@@ -1043,7 +1032,7 @@ class we extends M {
|
|
|
1043
1032
|
...this.signal.value,
|
|
1044
1033
|
[s]: l
|
|
1045
1034
|
});
|
|
1046
|
-
}, n = new
|
|
1035
|
+
}, n = new O(
|
|
1047
1036
|
[...this.path, s],
|
|
1048
1037
|
t,
|
|
1049
1038
|
this.signal.map((l) => l[s]),
|
|
@@ -1090,7 +1079,7 @@ class we extends M {
|
|
|
1090
1079
|
this.#l.set(this.dirty.value || s);
|
|
1091
1080
|
};
|
|
1092
1081
|
}
|
|
1093
|
-
class
|
|
1082
|
+
class Se extends O {
|
|
1094
1083
|
#e = new Array();
|
|
1095
1084
|
length;
|
|
1096
1085
|
#t = /* @__PURE__ */ new Map();
|
|
@@ -1117,9 +1106,9 @@ class ke extends M {
|
|
|
1117
1106
|
super(s, t, a, r, i, l);
|
|
1118
1107
|
const o = a.on((h) => {
|
|
1119
1108
|
const b = this.#e.length - h.length;
|
|
1120
|
-
b > 0 && (this.#e.splice(h.length, b).forEach((
|
|
1121
|
-
const u = h.length +
|
|
1122
|
-
|
|
1109
|
+
b > 0 && (this.#e.splice(h.length, b).forEach((k, g) => {
|
|
1110
|
+
const u = h.length + g;
|
|
1111
|
+
k.dispose(), this.#s.get(u)?.(), this.#s.delete(u), this.#t.delete(u), this.#r.get(u)?.(), this.#r.delete(u), this.#i.delete(u);
|
|
1123
1112
|
}), this.#o(), this.#a());
|
|
1124
1113
|
});
|
|
1125
1114
|
this.length = a.map((h) => h.length), this.#c = this.touched.on(() => {
|
|
@@ -1144,7 +1133,7 @@ class ke extends M {
|
|
|
1144
1133
|
const t = async (l) => {
|
|
1145
1134
|
const a = this.signal.value.slice();
|
|
1146
1135
|
a[s] = l, this.change(a);
|
|
1147
|
-
}, n = new
|
|
1136
|
+
}, n = new O(
|
|
1148
1137
|
[...this.path, s],
|
|
1149
1138
|
t,
|
|
1150
1139
|
this.signal.map((l) => l[s]),
|
|
@@ -1210,7 +1199,7 @@ class ke extends M {
|
|
|
1210
1199
|
this.#l.set(this.dirty.value || s);
|
|
1211
1200
|
};
|
|
1212
1201
|
}
|
|
1213
|
-
function
|
|
1202
|
+
function Ce(e) {
|
|
1214
1203
|
function s(t) {
|
|
1215
1204
|
return typeof t == "number" ? t : t.toString();
|
|
1216
1205
|
}
|
|
@@ -1218,9 +1207,9 @@ function Se(e) {
|
|
|
1218
1207
|
(t) => typeof t == "object" && t.key != null ? s(t.key) : s(t)
|
|
1219
1208
|
);
|
|
1220
1209
|
}
|
|
1221
|
-
function
|
|
1210
|
+
function _e(e) {
|
|
1222
1211
|
const s = e.filter((r) => r.path == null || r.path.length === 0).map((r) => r.message), t = e.filter((r) => r.path != null && r.path.length > 0).reduce((r, i) => {
|
|
1223
|
-
const l =
|
|
1212
|
+
const l = Ce(i.path), a = l.pop();
|
|
1224
1213
|
let o = r;
|
|
1225
1214
|
for (const p of l)
|
|
1226
1215
|
o.dependencies == null && (o.dependencies = {}), o.dependencies[p] == null && (o.dependencies[p] = {}), o = o.dependencies[p];
|
|
@@ -1232,7 +1221,7 @@ function Ce(e) {
|
|
|
1232
1221
|
message: n != "" ? n : void 0
|
|
1233
1222
|
};
|
|
1234
1223
|
}
|
|
1235
|
-
function
|
|
1224
|
+
function De({
|
|
1236
1225
|
initialValue: e,
|
|
1237
1226
|
onChange: s,
|
|
1238
1227
|
validate: t,
|
|
@@ -1240,29 +1229,29 @@ function _e({
|
|
|
1240
1229
|
validationMode: r,
|
|
1241
1230
|
validateDebounceMs: i
|
|
1242
1231
|
}) {
|
|
1243
|
-
const l =
|
|
1232
|
+
const l = S.deriveProp(e), a = I(_.valid), o = I(!1), p = I(r ?? "touchedOrSubmit"), h = (d) => {
|
|
1244
1233
|
a.set(d);
|
|
1245
1234
|
};
|
|
1246
1235
|
let b;
|
|
1247
|
-
const
|
|
1236
|
+
const k = async (d) => {
|
|
1248
1237
|
if (t != null) {
|
|
1249
|
-
const
|
|
1250
|
-
h(
|
|
1238
|
+
const v = await t(d);
|
|
1239
|
+
h(v);
|
|
1251
1240
|
}
|
|
1252
|
-
},
|
|
1241
|
+
}, g = async (d) => {
|
|
1253
1242
|
l.set(d), s?.(d);
|
|
1254
|
-
const
|
|
1243
|
+
const v = p.value;
|
|
1255
1244
|
if (t != null) {
|
|
1256
|
-
if (
|
|
1245
|
+
if (v === "onSubmit")
|
|
1257
1246
|
return;
|
|
1258
1247
|
const T = i ?? 0;
|
|
1259
1248
|
T > 0 ? (b && clearTimeout(b), b = setTimeout(() => {
|
|
1260
|
-
|
|
1261
|
-
}, T)) : await
|
|
1249
|
+
k(d);
|
|
1250
|
+
}, T)) : await k(d);
|
|
1262
1251
|
}
|
|
1263
|
-
}, u = new
|
|
1252
|
+
}, u = new O(
|
|
1264
1253
|
[],
|
|
1265
|
-
|
|
1254
|
+
g,
|
|
1266
1255
|
l,
|
|
1267
1256
|
a,
|
|
1268
1257
|
{
|
|
@@ -1275,33 +1264,33 @@ function _e({
|
|
|
1275
1264
|
o.dispose(), l.dispose(), a.dispose(), p.dispose(), b && clearTimeout(b);
|
|
1276
1265
|
}), { controller: u, setStatus: h };
|
|
1277
1266
|
}
|
|
1278
|
-
function
|
|
1267
|
+
function ee(e) {
|
|
1279
1268
|
return N(c.disabled(e.disabled), c.name(e.name));
|
|
1280
1269
|
}
|
|
1281
|
-
function
|
|
1270
|
+
function je(e, {
|
|
1282
1271
|
triggerOn: s = "change"
|
|
1283
1272
|
} = {}) {
|
|
1284
1273
|
return N(
|
|
1285
|
-
|
|
1274
|
+
ee(e),
|
|
1286
1275
|
c.value(e.signal),
|
|
1287
|
-
(s === "input" ?
|
|
1276
|
+
(s === "input" ? D.input : D.change)(F(e.change))
|
|
1288
1277
|
);
|
|
1289
1278
|
}
|
|
1290
|
-
function
|
|
1279
|
+
function qe(e, {
|
|
1291
1280
|
triggerOn: s = "change"
|
|
1292
1281
|
} = {}) {
|
|
1293
1282
|
return N(
|
|
1294
|
-
|
|
1283
|
+
ee(e),
|
|
1295
1284
|
c.valueAsNumber(e.signal),
|
|
1296
|
-
(s === "input" ?
|
|
1285
|
+
(s === "input" ? D.input : D.change)(
|
|
1297
1286
|
ie(e.change)
|
|
1298
1287
|
)
|
|
1299
1288
|
);
|
|
1300
1289
|
}
|
|
1301
|
-
function
|
|
1302
|
-
return e.issues != null ?
|
|
1290
|
+
function J(e) {
|
|
1291
|
+
return e.issues != null ? _.invalid(_e(e.issues)) : _.valid;
|
|
1303
1292
|
}
|
|
1304
|
-
async function
|
|
1293
|
+
async function ze({
|
|
1305
1294
|
task: e,
|
|
1306
1295
|
errorMessage: s,
|
|
1307
1296
|
errorPath: t = ["root"],
|
|
@@ -1309,17 +1298,17 @@ async function qe({
|
|
|
1309
1298
|
}) {
|
|
1310
1299
|
try {
|
|
1311
1300
|
const r = await e();
|
|
1312
|
-
return n != null ? n(r) :
|
|
1301
|
+
return n != null ? n(r) : _.valid;
|
|
1313
1302
|
} catch (r) {
|
|
1314
1303
|
const i = s ?? (r instanceof Error ? r.message : "Operation failed");
|
|
1315
|
-
return t.length === 1 && t[0] === "root" ?
|
|
1304
|
+
return t.length === 1 && t[0] === "root" ? _.invalid({
|
|
1316
1305
|
message: i
|
|
1317
|
-
}) :
|
|
1318
|
-
dependencies:
|
|
1306
|
+
}) : _.invalid({
|
|
1307
|
+
dependencies: se(t, i)
|
|
1319
1308
|
});
|
|
1320
1309
|
}
|
|
1321
1310
|
}
|
|
1322
|
-
function
|
|
1311
|
+
function se(e, s) {
|
|
1323
1312
|
if (e.length === 1)
|
|
1324
1313
|
return {
|
|
1325
1314
|
[e[0]]: { message: s }
|
|
@@ -1327,22 +1316,22 @@ function te(e, s) {
|
|
|
1327
1316
|
const [t, ...n] = e;
|
|
1328
1317
|
return {
|
|
1329
1318
|
[t]: {
|
|
1330
|
-
dependencies:
|
|
1319
|
+
dependencies: se(n, s)
|
|
1331
1320
|
}
|
|
1332
1321
|
};
|
|
1333
1322
|
}
|
|
1334
|
-
function
|
|
1323
|
+
function He({
|
|
1335
1324
|
initialValue: e = {},
|
|
1336
1325
|
schema: s,
|
|
1337
|
-
onSubmit: t = async () =>
|
|
1326
|
+
onSubmit: t = async () => _.valid,
|
|
1338
1327
|
validationMode: n,
|
|
1339
1328
|
validateDebounceMs: r
|
|
1340
1329
|
}) {
|
|
1341
|
-
const { controller: i, setStatus: l } =
|
|
1330
|
+
const { controller: i, setStatus: l } = De({
|
|
1342
1331
|
initialValue: e,
|
|
1343
1332
|
validationMode: n ?? "touchedOrSubmit",
|
|
1344
1333
|
validateDebounceMs: r,
|
|
1345
|
-
validate: (n ?? "touchedOrSubmit") === "onSubmit" || s == null ? void 0 : async (h) =>
|
|
1334
|
+
validate: (n ?? "touchedOrSubmit") === "onSubmit" || s == null ? void 0 : async (h) => J(
|
|
1346
1335
|
await s["~standard"].validate(h)
|
|
1347
1336
|
)
|
|
1348
1337
|
}), a = I(!1), o = i.object();
|
|
@@ -1351,12 +1340,12 @@ function ze({
|
|
|
1351
1340
|
setStatus: l,
|
|
1352
1341
|
submit: async (h) => {
|
|
1353
1342
|
if (a.set(!0), h?.preventDefault(), o.markAllTouched(), (n ?? "touchedOrSubmit") === "onSubmit") {
|
|
1354
|
-
const
|
|
1355
|
-
if (
|
|
1343
|
+
const k = o.signal.value, g = s?.["~standard"].validate;
|
|
1344
|
+
if (g == null) {
|
|
1356
1345
|
a.set(!1);
|
|
1357
1346
|
return;
|
|
1358
1347
|
}
|
|
1359
|
-
const u =
|
|
1348
|
+
const u = J(await g(k));
|
|
1360
1349
|
if (l(u), u.type === "invalid") {
|
|
1361
1350
|
a.set(!1);
|
|
1362
1351
|
return;
|
|
@@ -1368,7 +1357,7 @@ function ze({
|
|
|
1368
1357
|
submitting: a
|
|
1369
1358
|
};
|
|
1370
1359
|
}
|
|
1371
|
-
function
|
|
1360
|
+
function Ee(e) {
|
|
1372
1361
|
switch (e) {
|
|
1373
1362
|
case "success":
|
|
1374
1363
|
return "material-symbols:check-circle-outline";
|
|
@@ -1381,7 +1370,7 @@ function De(e) {
|
|
|
1381
1370
|
return "material-symbols:info-outline";
|
|
1382
1371
|
}
|
|
1383
1372
|
}
|
|
1384
|
-
function
|
|
1373
|
+
function Ie(e) {
|
|
1385
1374
|
switch (e) {
|
|
1386
1375
|
case "success":
|
|
1387
1376
|
return "success";
|
|
@@ -1394,7 +1383,7 @@ function Ee(e) {
|
|
|
1394
1383
|
return "info";
|
|
1395
1384
|
}
|
|
1396
1385
|
}
|
|
1397
|
-
function
|
|
1386
|
+
function Te(e, s, t, n) {
|
|
1398
1387
|
const r = [
|
|
1399
1388
|
"bc-notice",
|
|
1400
1389
|
`bc-notice--${e}`,
|
|
@@ -1402,7 +1391,7 @@ function Ie(e, s, t, n) {
|
|
|
1402
1391
|
];
|
|
1403
1392
|
return t && r.push("bc-notice--dismissible"), n && n.length > 0 && r.push(n), r.join(" ");
|
|
1404
1393
|
}
|
|
1405
|
-
function
|
|
1394
|
+
function Ue({
|
|
1406
1395
|
variant: e = "info",
|
|
1407
1396
|
tone: s = "subtle",
|
|
1408
1397
|
role: t,
|
|
@@ -1413,11 +1402,11 @@ function He({
|
|
|
1413
1402
|
class: a
|
|
1414
1403
|
}, ...o) {
|
|
1415
1404
|
const p = I(!0);
|
|
1416
|
-
return
|
|
1417
|
-
const h =
|
|
1405
|
+
return V(p, () => {
|
|
1406
|
+
const h = S.map(
|
|
1418
1407
|
i,
|
|
1419
1408
|
(u) => !!u || l != null
|
|
1420
|
-
), b =
|
|
1409
|
+
), b = S.map(e, (u) => u ?? "info"), k = S.map(s, (u) => u ?? "subtle"), g = w(
|
|
1421
1410
|
t,
|
|
1422
1411
|
b
|
|
1423
1412
|
)(
|
|
@@ -1427,28 +1416,28 @@ function He({
|
|
|
1427
1416
|
z,
|
|
1428
1417
|
(u) => f.div(
|
|
1429
1418
|
c.class(
|
|
1430
|
-
|
|
1419
|
+
w(
|
|
1431
1420
|
b,
|
|
1432
|
-
|
|
1421
|
+
k,
|
|
1433
1422
|
h,
|
|
1434
1423
|
a
|
|
1435
|
-
)((d,
|
|
1424
|
+
)((d, v, T, A) => Te(d, v, T, A))
|
|
1436
1425
|
),
|
|
1437
1426
|
// Accessibility role mapping (always defined)
|
|
1438
|
-
c.role(
|
|
1427
|
+
c.role(S.map(g, (d) => d)),
|
|
1439
1428
|
ae(
|
|
1440
|
-
|
|
1429
|
+
S.map(r, (d) => d === !1),
|
|
1441
1430
|
() => f.div(
|
|
1442
1431
|
c.class("bc-notice__icon"),
|
|
1443
1432
|
B({
|
|
1444
|
-
icon:
|
|
1433
|
+
icon: w(
|
|
1445
1434
|
r,
|
|
1446
1435
|
b
|
|
1447
1436
|
)(
|
|
1448
|
-
(d,
|
|
1437
|
+
(d, v) => d === void 0 ? Ee(v) : String(d)
|
|
1449
1438
|
),
|
|
1450
1439
|
size: "md",
|
|
1451
|
-
color:
|
|
1440
|
+
color: S.map(b, Ie)
|
|
1452
1441
|
})
|
|
1453
1442
|
)
|
|
1454
1443
|
),
|
|
@@ -1460,7 +1449,7 @@ function He({
|
|
|
1460
1449
|
),
|
|
1461
1450
|
f.div(c.class("bc-notice__content"), ...o)
|
|
1462
1451
|
),
|
|
1463
|
-
|
|
1452
|
+
V(
|
|
1464
1453
|
h,
|
|
1465
1454
|
() => ue({
|
|
1466
1455
|
size: "xs",
|
|
@@ -1475,41 +1464,41 @@ function He({
|
|
|
1475
1464
|
});
|
|
1476
1465
|
}
|
|
1477
1466
|
export {
|
|
1478
|
-
|
|
1479
|
-
|
|
1467
|
+
Se as A,
|
|
1468
|
+
Z as B,
|
|
1480
1469
|
ue as C,
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1470
|
+
Me as D,
|
|
1471
|
+
xe as E,
|
|
1472
|
+
Y as I,
|
|
1484
1473
|
he as L,
|
|
1485
|
-
|
|
1486
|
-
|
|
1474
|
+
Be as M,
|
|
1475
|
+
Ue as N,
|
|
1487
1476
|
$ as O,
|
|
1488
|
-
|
|
1477
|
+
Ne as P,
|
|
1489
1478
|
pe as R,
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1479
|
+
$e as S,
|
|
1480
|
+
_ as a,
|
|
1481
|
+
Fe as b,
|
|
1482
|
+
Pe as c,
|
|
1483
|
+
G as d,
|
|
1484
|
+
O as e,
|
|
1496
1485
|
j as f,
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1486
|
+
ve as g,
|
|
1487
|
+
we as h,
|
|
1488
|
+
ke as i,
|
|
1489
|
+
Ce as j,
|
|
1490
|
+
_e as k,
|
|
1491
|
+
De as l,
|
|
1492
|
+
ge as m,
|
|
1493
|
+
ee as n,
|
|
1494
|
+
je as o,
|
|
1495
|
+
Le as p,
|
|
1496
|
+
qe as q,
|
|
1497
|
+
J as r,
|
|
1509
1498
|
H as s,
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1499
|
+
ze as t,
|
|
1500
|
+
He as u,
|
|
1501
|
+
Oe as v,
|
|
1502
|
+
ye as w,
|
|
1514
1503
|
de as x
|
|
1515
1504
|
};
|