@stenajs-webui/panels 18.8.0 → 18.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,5 +2,6 @@ import { CheckboxProps } from "@stenajs-webui/forms";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { CollapsibleProps } from "./Collapsible";
|
|
4
4
|
export interface CollapsibleWithCheckboxProps extends Omit<CollapsibleProps, "contentLeft" | "onChange">, Pick<CheckboxProps, "value" | "onValueChange" | "onChange" | "indeterminate"> {
|
|
5
|
+
checkboxDisabled: CheckboxProps["disabled"];
|
|
5
6
|
}
|
|
6
7
|
export declare const CollapsibleWithCheckbox: React.FC<CollapsibleWithCheckboxProps>;
|
package/dist/index.es.js
CHANGED
|
@@ -6,7 +6,7 @@ import { useBoolean as U, Column as L, Box as c, Row as p, Indent as g, Heading
|
|
|
6
6
|
import { Popover as T } from "@stenajs-webui/tooltip";
|
|
7
7
|
import { jsx as e, jsxs as i, Fragment as m } from "react/jsx-runtime";
|
|
8
8
|
import { Checkbox as se, TextInput as Se } from "@stenajs-webui/forms";
|
|
9
|
-
import
|
|
9
|
+
import u from "classnames";
|
|
10
10
|
import { cssColor as B } from "@stenajs-webui/theme";
|
|
11
11
|
import { faChevronDown as Ie } from "@fortawesome/free-solid-svg-icons";
|
|
12
12
|
import { faChevronUp as Le } from "@fortawesome/free-solid-svg-icons/faChevronUp";
|
|
@@ -19,7 +19,7 @@ const V = ({
|
|
|
19
19
|
rightIcon: a = ae,
|
|
20
20
|
portalTarget: o = "parent",
|
|
21
21
|
zIndex: s,
|
|
22
|
-
menuWidth:
|
|
22
|
+
menuWidth: l,
|
|
23
23
|
menuTop: h,
|
|
24
24
|
onClick: _,
|
|
25
25
|
disableArrow: v = !1,
|
|
@@ -64,7 +64,7 @@ const V = ({
|
|
|
64
64
|
placement: r,
|
|
65
65
|
content: C && /* @__PURE__ */ e(re, {
|
|
66
66
|
variant: "outlined",
|
|
67
|
-
width:
|
|
67
|
+
width: l,
|
|
68
68
|
top: h,
|
|
69
69
|
trapFocus: !0,
|
|
70
70
|
children: /* @__PURE__ */ e(me.Provider, {
|
|
@@ -150,7 +150,7 @@ const V = ({
|
|
|
150
150
|
onClick: r
|
|
151
151
|
}) => /* @__PURE__ */ e("button", {
|
|
152
152
|
onClick: r,
|
|
153
|
-
className:
|
|
153
|
+
className: u(Y.sidebarMenuButton, n),
|
|
154
154
|
children: /* @__PURE__ */ e(Te, {
|
|
155
155
|
className: Y.icon
|
|
156
156
|
})
|
|
@@ -165,11 +165,11 @@ const V = ({
|
|
|
165
165
|
menuButtonVisibility: a = "visible",
|
|
166
166
|
children: o,
|
|
167
167
|
right: s,
|
|
168
|
-
center:
|
|
168
|
+
center: l,
|
|
169
169
|
variant: h = "standard",
|
|
170
170
|
onClickMenuButton: _
|
|
171
171
|
}) => {
|
|
172
|
-
const v =
|
|
172
|
+
const v = l ? 1 : void 0, f = le(h);
|
|
173
173
|
return /* @__PURE__ */ i(p, {
|
|
174
174
|
height: f,
|
|
175
175
|
minHeight: f,
|
|
@@ -177,7 +177,7 @@ const V = ({
|
|
|
177
177
|
style: {
|
|
178
178
|
["--swui-nav-bar-height"]: f
|
|
179
179
|
},
|
|
180
|
-
className:
|
|
180
|
+
className: u($e.navBar, r),
|
|
181
181
|
children: [/* @__PURE__ */ i(p, {
|
|
182
182
|
flex: v,
|
|
183
183
|
justifyContent: "flex-start",
|
|
@@ -205,10 +205,10 @@ const V = ({
|
|
|
205
205
|
}))
|
|
206
206
|
})
|
|
207
207
|
})]
|
|
208
|
-
}),
|
|
208
|
+
}), l && /* @__PURE__ */ e(p, {
|
|
209
209
|
justifyContent: "center",
|
|
210
210
|
alignItems: "center",
|
|
211
|
-
children:
|
|
211
|
+
children: l
|
|
212
212
|
}), /* @__PURE__ */ i(p, {
|
|
213
213
|
justifyContent: "flex-end",
|
|
214
214
|
alignItems: "center",
|
|
@@ -227,7 +227,7 @@ const V = ({
|
|
|
227
227
|
...t
|
|
228
228
|
}) => /* @__PURE__ */ e($, {
|
|
229
229
|
...t,
|
|
230
|
-
className:
|
|
230
|
+
className: u(ee.navBarButton, n && ee.selected, r)
|
|
231
231
|
}), et = (n) => /* @__PURE__ */ e(Z, {
|
|
232
232
|
whiteSpace: "nowrap",
|
|
233
233
|
color: "#fff",
|
|
@@ -265,20 +265,20 @@ const V = ({
|
|
|
265
265
|
labelClassName: a,
|
|
266
266
|
iconClassName: o,
|
|
267
267
|
icon: s = fe,
|
|
268
|
-
...
|
|
268
|
+
...l
|
|
269
269
|
}) => {
|
|
270
270
|
const h = n > 0;
|
|
271
271
|
return /* @__PURE__ */ e($, {
|
|
272
|
-
...
|
|
272
|
+
...l,
|
|
273
273
|
leftIcon: s,
|
|
274
|
-
className:
|
|
274
|
+
className: u({
|
|
275
275
|
[R.unread]: r
|
|
276
276
|
}, {
|
|
277
277
|
[R.hasCount]: h
|
|
278
278
|
}, R.navBarNotificationButton, t),
|
|
279
279
|
label: h ? String(n) : void 0,
|
|
280
|
-
labelClassName:
|
|
281
|
-
iconClassName:
|
|
280
|
+
labelClassName: u(a, R.label),
|
|
281
|
+
iconClassName: u(o, R.icon)
|
|
282
282
|
});
|
|
283
283
|
}, Je = "_navBarSearchFieldInput_4knxd_1", Ke = "_navBarSearchField_4knxd_1", ne = {
|
|
284
284
|
navBarSearchFieldInput: Je,
|
|
@@ -289,8 +289,8 @@ const V = ({
|
|
|
289
289
|
wrapperClassName: t,
|
|
290
290
|
...a
|
|
291
291
|
}) => /* @__PURE__ */ e(Se, {
|
|
292
|
-
wrapperClassName:
|
|
293
|
-
className:
|
|
292
|
+
wrapperClassName: u(ne.navBarSearchField, t),
|
|
293
|
+
className: u(ne.navBarSearchFieldInput, r),
|
|
294
294
|
placeholder: n,
|
|
295
295
|
contentRight: /* @__PURE__ */ e(q, {
|
|
296
296
|
children: /* @__PURE__ */ e(A, {
|
|
@@ -310,7 +310,7 @@ const V = ({
|
|
|
310
310
|
...s
|
|
311
311
|
}) => /* @__PURE__ */ e(je, {
|
|
312
312
|
...s,
|
|
313
|
-
className:
|
|
313
|
+
className: u({
|
|
314
314
|
[te.initials]: t != null
|
|
315
315
|
}, te.navBarUserButton, n),
|
|
316
316
|
leftIcon: r != null ? a : void 0,
|
|
@@ -323,7 +323,7 @@ const V = ({
|
|
|
323
323
|
iconAriaLabel: a,
|
|
324
324
|
iconColor: o,
|
|
325
325
|
contentLeft: s,
|
|
326
|
-
contentRight:
|
|
326
|
+
contentRight: l,
|
|
327
327
|
onClose: h
|
|
328
328
|
}) => /* @__PURE__ */ i(p, {
|
|
329
329
|
alignItems: "flex-start",
|
|
@@ -357,7 +357,7 @@ const V = ({
|
|
|
357
357
|
color: B("--lhds-color-ui-600"),
|
|
358
358
|
children: r
|
|
359
359
|
})]
|
|
360
|
-
}),
|
|
360
|
+
}), l]
|
|
361
361
|
}), h && /* @__PURE__ */ e(c, {
|
|
362
362
|
flex: "none",
|
|
363
363
|
justifyContent: "center",
|
|
@@ -403,7 +403,7 @@ const V = ({
|
|
|
403
403
|
role: "alert",
|
|
404
404
|
position: "relative",
|
|
405
405
|
children: [/* @__PURE__ */ e(c, {
|
|
406
|
-
className:
|
|
406
|
+
className: u({
|
|
407
407
|
[O.nonClickable]: n
|
|
408
408
|
}),
|
|
409
409
|
children: /* @__PURE__ */ e(de, {
|
|
@@ -411,7 +411,7 @@ const V = ({
|
|
|
411
411
|
})
|
|
412
412
|
}), t && /* @__PURE__ */ i(c, {
|
|
413
413
|
indent: 3,
|
|
414
|
-
className:
|
|
414
|
+
className: u({
|
|
415
415
|
[O.nonClickable]: n
|
|
416
416
|
}),
|
|
417
417
|
children: [t, /* @__PURE__ */ e(k, {
|
|
@@ -422,7 +422,7 @@ const V = ({
|
|
|
422
422
|
className: O.clickable,
|
|
423
423
|
"aria-label": r
|
|
424
424
|
})]
|
|
425
|
-
}), nn = "_collapsible_1nroa_1", tn = "_header_1nroa_46", rn = "_indicator_1nroa_59", an = "_headerText_1nroa_103", on = "_label_1nroa_114", sn = "_contentLeft_1nroa_123", cn = "_contentRight_1nroa_124", ln = "_content_1nroa_123", dn = "_groupHeading_1nroa_155", un = "_contentEnter_1nroa_180", hn = "_contentEnterActive_1nroa_184", pn = "_contentExitDone_1nroa_189",
|
|
425
|
+
}), nn = "_collapsible_1nroa_1", tn = "_header_1nroa_46", rn = "_indicator_1nroa_59", an = "_headerText_1nroa_103", on = "_label_1nroa_114", sn = "_contentLeft_1nroa_123", cn = "_contentRight_1nroa_124", ln = "_content_1nroa_123", dn = "_groupHeading_1nroa_155", un = "_contentEnter_1nroa_180", hn = "_contentEnterActive_1nroa_184", pn = "_contentExitDone_1nroa_189", d = {
|
|
426
426
|
collapsible: nn,
|
|
427
427
|
header: tn,
|
|
428
428
|
indicator: rn,
|
|
@@ -455,13 +455,13 @@ const V = ({
|
|
|
455
455
|
children: a,
|
|
456
456
|
...o
|
|
457
457
|
}) => /* @__PURE__ */ i("div", {
|
|
458
|
-
className: d
|
|
458
|
+
className: u(d.content, t),
|
|
459
459
|
...o,
|
|
460
460
|
children: [n && /* @__PURE__ */ e("div", {
|
|
461
|
-
className:
|
|
461
|
+
className: d.contentLeft,
|
|
462
462
|
children: n
|
|
463
463
|
}), a != null ? a : /* @__PURE__ */ e(G, {}), r && /* @__PURE__ */ e("div", {
|
|
464
|
-
className:
|
|
464
|
+
className: d.contentRight,
|
|
465
465
|
children: r
|
|
466
466
|
})]
|
|
467
467
|
}), mn = (n) => {
|
|
@@ -480,7 +480,7 @@ const V = ({
|
|
|
480
480
|
contentRight: a,
|
|
481
481
|
collapsed: o = !1,
|
|
482
482
|
onClick: s,
|
|
483
|
-
className:
|
|
483
|
+
className: l,
|
|
484
484
|
disabled: h = !1,
|
|
485
485
|
unmountOnCollapse: _ = !1,
|
|
486
486
|
mountOnEnter: v = !0,
|
|
@@ -493,34 +493,34 @@ const V = ({
|
|
|
493
493
|
}, F) {
|
|
494
494
|
const w = I.useRef(null), j = w.current ? mn(getComputedStyle(w.current).getPropertyValue("--swui-collapsible-animation-time")) : void 0;
|
|
495
495
|
return /* @__PURE__ */ i("div", {
|
|
496
|
-
className: d
|
|
496
|
+
className: u(d.collapsible, l),
|
|
497
497
|
"aria-expanded": !o,
|
|
498
498
|
ref: w,
|
|
499
499
|
...N,
|
|
500
500
|
children: [/* @__PURE__ */ i(q, {
|
|
501
501
|
disableFocusHighlight: !0,
|
|
502
502
|
disableOpacityOnClick: !0,
|
|
503
|
-
className:
|
|
503
|
+
className: d.header,
|
|
504
504
|
onClick: s,
|
|
505
505
|
disabled: h,
|
|
506
506
|
autoFocus: E,
|
|
507
507
|
ref: F,
|
|
508
508
|
children: [t && /* @__PURE__ */ e("div", {
|
|
509
|
-
className:
|
|
509
|
+
className: d.contentLeft,
|
|
510
510
|
children: t
|
|
511
511
|
}), /* @__PURE__ */ e("div", {
|
|
512
|
-
className:
|
|
512
|
+
className: d.label,
|
|
513
513
|
children: /* @__PURE__ */ e(S, {
|
|
514
514
|
color: "var(--swui-collapsible-header-text-color)",
|
|
515
|
-
className:
|
|
515
|
+
className: d.headerText,
|
|
516
516
|
children: r
|
|
517
517
|
})
|
|
518
518
|
}), a && /* @__PURE__ */ e("div", {
|
|
519
|
-
className:
|
|
519
|
+
className: d.contentRight,
|
|
520
520
|
children: a
|
|
521
521
|
}), /* @__PURE__ */ e(A, {
|
|
522
522
|
icon: o ? C : f,
|
|
523
|
-
className:
|
|
523
|
+
className: d.indicator,
|
|
524
524
|
size: x,
|
|
525
525
|
fixedWidth: !0
|
|
526
526
|
})]
|
|
@@ -530,11 +530,11 @@ const V = ({
|
|
|
530
530
|
enter: j
|
|
531
531
|
},
|
|
532
532
|
classNames: {
|
|
533
|
-
enter:
|
|
534
|
-
enterActive:
|
|
535
|
-
exit:
|
|
536
|
-
exitActive:
|
|
537
|
-
exitDone:
|
|
533
|
+
enter: d.contentEnter,
|
|
534
|
+
enterActive: d.contentEnterActive,
|
|
535
|
+
exit: d.contentExit,
|
|
536
|
+
exitActive: d.contentExitActive,
|
|
537
|
+
exitDone: d.contentExitDone
|
|
538
538
|
},
|
|
539
539
|
mountOnEnter: v,
|
|
540
540
|
unmountOnExit: _,
|
|
@@ -551,16 +551,18 @@ const V = ({
|
|
|
551
551
|
onValueChange: r,
|
|
552
552
|
onChange: t,
|
|
553
553
|
indeterminate: a,
|
|
554
|
-
|
|
554
|
+
checkboxDisabled: o,
|
|
555
|
+
...s
|
|
555
556
|
}) => /* @__PURE__ */ e(ue, {
|
|
556
557
|
contentLeft: /* @__PURE__ */ e(se, {
|
|
557
558
|
value: n,
|
|
558
559
|
indeterminate: a,
|
|
559
560
|
onValueChange: r,
|
|
560
561
|
onChange: t,
|
|
561
|
-
|
|
562
|
+
disabled: o,
|
|
563
|
+
onClick: (l) => l.stopPropagation()
|
|
562
564
|
}),
|
|
563
|
-
...
|
|
565
|
+
...s
|
|
564
566
|
}), ct = ({
|
|
565
567
|
contentLeft: n,
|
|
566
568
|
contentRight: r,
|
|
@@ -571,21 +573,21 @@ const V = ({
|
|
|
571
573
|
}) => /* @__PURE__ */ i(q, {
|
|
572
574
|
disableFocusHighlight: !0,
|
|
573
575
|
disableOpacityOnClick: !0,
|
|
574
|
-
className: d
|
|
576
|
+
className: u(d.content, t),
|
|
575
577
|
onClick: a,
|
|
576
578
|
...s,
|
|
577
579
|
children: [n && /* @__PURE__ */ e("div", {
|
|
578
|
-
className:
|
|
580
|
+
className: d.contentLeft,
|
|
579
581
|
children: n
|
|
580
582
|
}), o != null ? o : /* @__PURE__ */ e(G, {}), r && /* @__PURE__ */ e("div", {
|
|
581
|
-
className:
|
|
583
|
+
className: d.contentRight,
|
|
582
584
|
children: r
|
|
583
585
|
})]
|
|
584
586
|
}), lt = ({
|
|
585
587
|
className: n,
|
|
586
588
|
...r
|
|
587
589
|
}) => /* @__PURE__ */ e(J, {
|
|
588
|
-
className: d
|
|
590
|
+
className: u(d.groupHeading, n),
|
|
589
591
|
...r
|
|
590
592
|
}), bn = ({
|
|
591
593
|
text: n = "Something unexpected happened."
|
|
@@ -694,7 +696,7 @@ const V = ({
|
|
|
694
696
|
onClick: r
|
|
695
697
|
}) => /* @__PURE__ */ e("button", {
|
|
696
698
|
onClick: r,
|
|
697
|
-
className:
|
|
699
|
+
className: u(z.sidebarMenuCloseButton, n),
|
|
698
700
|
children: /* @__PURE__ */ e(c, {
|
|
699
701
|
className: z.iconWrapper,
|
|
700
702
|
children: /* @__PURE__ */ e(Bn, {
|
|
@@ -711,17 +713,17 @@ const V = ({
|
|
|
711
713
|
collapsed: a = !1,
|
|
712
714
|
hideCloseButton: o = !1,
|
|
713
715
|
variant: s = "standard",
|
|
714
|
-
...
|
|
716
|
+
...l
|
|
715
717
|
}) => {
|
|
716
718
|
const h = le(s);
|
|
717
719
|
return /* @__PURE__ */ i(c, {
|
|
718
|
-
className:
|
|
720
|
+
className: u(W.sidebarMenu, a ? W.collapsed : null, n),
|
|
719
721
|
style: {
|
|
720
722
|
["--swui-sidebar-menu-item-height"]: h,
|
|
721
723
|
["--swui-nav-bar-height"]: h
|
|
722
724
|
},
|
|
723
725
|
"data-collapsed": a || void 0,
|
|
724
|
-
...
|
|
726
|
+
...l,
|
|
725
727
|
children: [!o && /* @__PURE__ */ i(m, {
|
|
726
728
|
children: [/* @__PURE__ */ e(Nn, {
|
|
727
729
|
onClick: t
|
|
@@ -769,7 +771,7 @@ const V = ({
|
|
|
769
771
|
indent: a,
|
|
770
772
|
label: o,
|
|
771
773
|
loading: s,
|
|
772
|
-
left:
|
|
774
|
+
left: l,
|
|
773
775
|
leftIcon: h,
|
|
774
776
|
right: _,
|
|
775
777
|
rightIcon: v,
|
|
@@ -779,7 +781,7 @@ const V = ({
|
|
|
779
781
|
style: b,
|
|
780
782
|
...E
|
|
781
783
|
}) => {
|
|
782
|
-
const N =
|
|
784
|
+
const N = l || h || s || f, F = u(y.button, t ? y.selected : void 0, n), w = {
|
|
783
785
|
...b,
|
|
784
786
|
width: C,
|
|
785
787
|
height: "var(--swui-sidebar-menu-item-height)"
|
|
@@ -792,14 +794,14 @@ const V = ({
|
|
|
792
794
|
}), /* @__PURE__ */ e(Ne, {
|
|
793
795
|
label: o,
|
|
794
796
|
loading: s,
|
|
795
|
-
left:
|
|
797
|
+
left: l,
|
|
796
798
|
leftIcon: h,
|
|
797
799
|
right: _,
|
|
798
800
|
rightIcon: v,
|
|
799
801
|
success: f,
|
|
800
802
|
labelClassName: y.label,
|
|
801
803
|
spinnerClassName: y.spinner,
|
|
802
|
-
iconClassName:
|
|
804
|
+
iconClassName: u(y.icon),
|
|
803
805
|
leftWrapperClassName: y.leftWrapper
|
|
804
806
|
})]
|
|
805
807
|
});
|
|
@@ -907,12 +909,12 @@ const V = ({
|
|
|
907
909
|
const {
|
|
908
910
|
type: o,
|
|
909
911
|
label: s,
|
|
910
|
-
...
|
|
912
|
+
...l
|
|
911
913
|
} = t;
|
|
912
914
|
return /* @__PURE__ */ e(D, {
|
|
913
915
|
title: s,
|
|
914
916
|
width: "var(--swui-sidebar-menu-item-height)",
|
|
915
|
-
...
|
|
917
|
+
...l
|
|
916
918
|
}, a);
|
|
917
919
|
}
|
|
918
920
|
case "grouped":
|