@mattermost/compass-ui 0.1.0-alpha.14 → 0.1.0-alpha.16
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/components/action-button/ActionButton.cjs +1 -1
- package/dist/components/action-button/ActionButton.cjs.map +1 -1
- package/dist/components/action-button/ActionButton.css +1 -1
- package/dist/components/action-button/ActionButton.d.ts +41 -5
- package/dist/components/action-button/ActionButton.d.ts.map +1 -1
- package/dist/components/action-button/ActionButton.js +68 -35
- package/dist/components/action-button/ActionButton.js.map +1 -1
- package/dist/components/action-button/ActionButton.module.scss.cjs +1 -1
- package/dist/components/action-button/ActionButton.module.scss.js +6 -5
- package/dist/components/action-button/ActionButton.module.scss.js.map +1 -1
- package/dist/components/action-button/index.d.ts +1 -1
- package/dist/components/action-button/index.d.ts.map +1 -1
- package/dist/components/admin-console-footer/AdminConsoleFooter.cjs +2 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.cjs.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.css +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.d.ts +27 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.d.ts.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.js +84 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.js.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.cjs +2 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.cjs.map +1 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.js +13 -0
- package/dist/components/admin-console-footer/AdminConsoleFooter.module.scss.js.map +1 -0
- package/dist/components/admin-console-footer/index.cjs +2 -0
- package/dist/components/admin-console-footer/index.cjs.map +1 -0
- package/dist/components/admin-console-footer/index.d.ts +3 -0
- package/dist/components/admin-console-footer/index.d.ts.map +1 -0
- package/dist/components/admin-console-footer/index.js +5 -0
- package/dist/components/admin-console-footer/index.js.map +1 -0
- package/dist/components/admin-panel/AdminPanel.cjs +1 -1
- package/dist/components/admin-panel/AdminPanel.cjs.map +1 -1
- package/dist/components/admin-panel/AdminPanel.d.ts +41 -9
- package/dist/components/admin-panel/AdminPanel.d.ts.map +1 -1
- package/dist/components/admin-panel/AdminPanel.js +91 -81
- package/dist/components/admin-panel/AdminPanel.js.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.cjs +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.cjs.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.css +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.d.ts +18 -21
- package/dist/components/admin-panel-footer/AdminPanelFooter.d.ts.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.js +24 -61
- package/dist/components/admin-panel-footer/AdminPanelFooter.js.map +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.module.scss.cjs +1 -1
- package/dist/components/admin-panel-footer/AdminPanelFooter.module.scss.js +7 -9
- package/dist/components/admin-panel-footer/AdminPanelFooter.module.scss.js.map +1 -1
- package/dist/components/admin-panel-footer/index.d.ts +1 -1
- package/dist/components/admin-panel-footer/index.d.ts.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.cjs.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.d.ts +3 -2
- package/dist/components/admin-panel-header/AdminPanelHeader.d.ts.map +1 -1
- package/dist/components/admin-panel-header/AdminPanelHeader.js.map +1 -1
- package/dist/components/button/Button.cjs +1 -1
- package/dist/components/button/Button.cjs.map +1 -1
- package/dist/components/button/Button.css +1 -1
- package/dist/components/button/Button.d.ts +37 -6
- package/dist/components/button/Button.d.ts.map +1 -1
- package/dist/components/button/Button.js +106 -44
- package/dist/components/button/Button.js.map +1 -1
- package/dist/components/button/Button.module.scss.cjs +1 -1
- package/dist/components/button/Button.module.scss.js +16 -15
- package/dist/components/button/Button.module.scss.js.map +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/channel-sidebar-item/ChannelSidebarItem.css +1 -1
- package/dist/components/channel-sidebar-item/ChannelSidebarItem.module.scss.cjs +1 -1
- package/dist/components/channel-sidebar-item/ChannelSidebarItem.module.scss.js +22 -22
- package/dist/components/checkbox/Checkbox.css +1 -1
- package/dist/components/checkbox/Checkbox.module.scss.cjs +1 -1
- package/dist/components/checkbox/Checkbox.module.scss.js +10 -10
- package/dist/components/chip/Chip.css +1 -1
- package/dist/components/chip/Chip.module.scss.cjs +1 -1
- package/dist/components/chip/Chip.module.scss.js +12 -12
- package/dist/components/combobox/Combobox.cjs +1 -1
- package/dist/components/combobox/Combobox.cjs.map +1 -1
- package/dist/components/combobox/Combobox.css +1 -1
- package/dist/components/combobox/Combobox.d.ts +14 -0
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.js +240 -224
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/combobox/Combobox.module.scss.cjs +1 -1
- package/dist/components/combobox/Combobox.module.scss.js +21 -21
- package/dist/components/icon-button/IconButton.cjs +1 -1
- package/dist/components/icon-button/IconButton.cjs.map +1 -1
- package/dist/components/icon-button/IconButton.css +1 -1
- package/dist/components/icon-button/IconButton.d.ts +48 -7
- package/dist/components/icon-button/IconButton.d.ts.map +1 -1
- package/dist/components/icon-button/IconButton.js +136 -62
- package/dist/components/icon-button/IconButton.js.map +1 -1
- package/dist/components/icon-button/IconButton.module.scss.cjs +1 -1
- package/dist/components/icon-button/IconButton.module.scss.js +16 -15
- package/dist/components/icon-button/IconButton.module.scss.js.map +1 -1
- package/dist/components/icon-button/index.d.ts +1 -1
- package/dist/components/icon-button/index.d.ts.map +1 -1
- package/dist/components/menu-item/MenuItem.cjs.map +1 -1
- package/dist/components/menu-item/MenuItem.css +1 -1
- package/dist/components/menu-item/MenuItem.d.ts +20 -0
- package/dist/components/menu-item/MenuItem.d.ts.map +1 -1
- package/dist/components/menu-item/MenuItem.js.map +1 -1
- package/dist/components/menu-item/MenuItem.module.scss.cjs +1 -1
- package/dist/components/menu-item/MenuItem.module.scss.js +16 -16
- package/dist/components/menu-item/index.d.ts +1 -1
- package/dist/components/menu-item/index.d.ts.map +1 -1
- package/dist/components/radio/Radio.css +1 -1
- package/dist/components/radio/Radio.module.scss.cjs +1 -1
- package/dist/components/radio/Radio.module.scss.js +12 -12
- package/dist/components/right-sidebar-header/RightSidebarHeader.cjs +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.cjs.map +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.d.ts +5 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.d.ts.map +1 -1
- package/dist/components/right-sidebar-header/RightSidebarHeader.js +60 -48
- package/dist/components/right-sidebar-header/RightSidebarHeader.js.map +1 -1
- package/dist/components/section-notice/SectionNotice.cjs +1 -1
- package/dist/components/section-notice/SectionNotice.cjs.map +1 -1
- package/dist/components/section-notice/SectionNotice.css +1 -1
- package/dist/components/section-notice/SectionNotice.js +17 -17
- package/dist/components/section-notice/SectionNotice.js.map +1 -1
- package/dist/components/section-notice/SectionNotice.module.scss.cjs +1 -1
- package/dist/components/section-notice/SectionNotice.module.scss.js +12 -12
- package/dist/components/select/Select.cjs +1 -1
- package/dist/components/select/Select.cjs.map +1 -1
- package/dist/components/select/Select.css +1 -1
- package/dist/components/select/Select.d.ts +16 -0
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +177 -157
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/select/Select.module.scss.cjs +1 -1
- package/dist/components/select/Select.module.scss.js +20 -20
- package/dist/components/switch/Switch.css +1 -1
- package/dist/components/switch/Switch.module.scss.cjs +1 -1
- package/dist/components/switch/Switch.module.scss.js +9 -9
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +168 -166
- package/dist/index.js.map +1 -1
- package/dist/utils/menuItemProps.cjs +2 -0
- package/dist/utils/menuItemProps.cjs.map +1 -0
- package/dist/utils/menuItemProps.d.ts +5 -0
- package/dist/utils/menuItemProps.d.ts.map +1 -0
- package/dist/utils/menuItemProps.js +12 -0
- package/dist/utils/menuItemProps.js.map +1 -0
- package/dist/utils/slot.cjs +2 -0
- package/dist/utils/slot.cjs.map +1 -0
- package/dist/utils/slot.d.ts +46 -0
- package/dist/utils/slot.d.ts.map +1 -0
- package/dist/utils/slot.js +88 -0
- package/dist/utils/slot.js.map +1 -0
- package/package.json +5 -1
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { ChangeEvent, HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import { AdminPanelExpandedState } from '../admin-panel-header/AdminPanelHeader';
|
|
3
3
|
export type { AdminPanelExpandedState };
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
children?: ReactNode;
|
|
4
|
+
/** Non-null content for required header/body slots (runtime still guards nullish escapes). */
|
|
5
|
+
type AdminPanelContent = NonNullable<ReactNode>;
|
|
6
|
+
type AdminPanelChromeProps = Omit<HTMLAttributes<HTMLElement>, 'title' | 'children'> & {
|
|
8
7
|
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional footer rail below the body — typically
|
|
10
|
+
* [`AdminPanelFooter`](/components/admin-panel-footer) with left/right action slots.
|
|
11
|
+
* Collapses with the body when the panel is expandable.
|
|
12
|
+
*/
|
|
13
|
+
footer?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
type AdminPanelHeaderSlotProps = {
|
|
16
|
+
title: AdminPanelContent;
|
|
17
|
+
subtitle?: ReactNode;
|
|
9
18
|
headerActions?: ReactNode;
|
|
10
19
|
iconLeft?: boolean;
|
|
11
|
-
/** Icon forwarded to `AdminPanelHeader`'s 44×44 circular pill. Pass `<Icon glyph={<SomeIcon />}
|
|
20
|
+
/** Icon forwarded to `AdminPanelHeader`'s 44×44 circular pill. Pass `<Icon glyph={<SomeIcon />} />`. */
|
|
12
21
|
leadingIcon?: ReactNode;
|
|
13
22
|
showBeta?: boolean;
|
|
14
23
|
/** Default: "Beta". Accepts translated nodes. */
|
|
@@ -34,10 +43,33 @@ export interface AdminPanelProps extends Omit<HTMLAttributes<HTMLElement>, 'titl
|
|
|
34
43
|
expandLabel?: string;
|
|
35
44
|
/** Accessible name for the expand button while expanded. Default: "Collapse section". */
|
|
36
45
|
collapseLabel?: string;
|
|
37
|
-
}
|
|
46
|
+
};
|
|
47
|
+
/** Panel with a header. Body and footer are optional. */
|
|
48
|
+
type AdminPanelWithHeaderProps = AdminPanelChromeProps & AdminPanelHeaderSlotProps & {
|
|
49
|
+
children?: ReactNode;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Header-less panel. `children` (body) are required — footer alone is not enough.
|
|
53
|
+
* Header chrome props (`subtitle`, `expandable`, …) are not accepted on this variant.
|
|
54
|
+
*/
|
|
55
|
+
type AdminPanelWithoutHeaderProps = AdminPanelChromeProps & {
|
|
56
|
+
title?: undefined;
|
|
57
|
+
children: AdminPanelContent;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* System Console admin settings panel. Provide a `title` (header), `children`
|
|
61
|
+
* (body), or both. Footer is always optional. Header-only and body-only panels
|
|
62
|
+
* are valid; footer-only is not.
|
|
63
|
+
*/
|
|
64
|
+
export type AdminPanelProps = AdminPanelWithHeaderProps | AdminPanelWithoutHeaderProps;
|
|
38
65
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
66
|
+
* Admin Panel is the bordered sheet used throughout System Console for a single
|
|
67
|
+
* settings section. It can include an
|
|
68
|
+
* [`Admin Panel Header`](/components/admin-panel-header), a body where grouped
|
|
69
|
+
* fields and help text live, and an optional
|
|
70
|
+
* [`Admin Panel Footer`](/components/admin-panel-footer) for sectional actions.
|
|
71
|
+
* Provide a header, a body, or both — footer alone is not enough. Expand/collapse
|
|
72
|
+
* state is owned here and passed to the header when present.
|
|
41
73
|
*/
|
|
42
|
-
export default function AdminPanel(
|
|
74
|
+
export default function AdminPanel(props: AdminPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
43
75
|
//# sourceMappingURL=AdminPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPanel.d.ts","sourceRoot":"","sources":["../../../src/components/admin-panel/AdminPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AdminPanel.d.ts","sourceRoot":"","sources":["../../../src/components/admin-panel/AdminPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAyB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,gDAAgD,CAAC;AAGxD,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC,8FAA8F;AAC9F,KAAK,iBAAiB,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAEhD,KAAK,qBAAqB,GAAG,IAAI,CAC/B,cAAc,CAAC,WAAW,CAAC,EAC3B,OAAO,GAAG,UAAU,CACrB,GAAG;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wGAAwG;IACxG,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uDAAuD;IACvD,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,UAAU,CAAC,EAAE,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
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { jsxs as s, jsx as i, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { useId as X, useState as Y, Children as Z } from "react";
|
|
3
|
+
import $ from "../admin-panel-header/AdminPanelHeader.js";
|
|
4
|
+
import a from "./AdminPanel.module.scss.js";
|
|
5
|
+
function de(b) {
|
|
6
|
+
const {
|
|
7
|
+
title: t,
|
|
8
|
+
children: c,
|
|
9
|
+
footer: l,
|
|
10
|
+
className: w = "",
|
|
11
|
+
...E
|
|
12
|
+
} = b, {
|
|
13
|
+
subtitle: v,
|
|
14
|
+
headerActions: S,
|
|
15
|
+
iconLeft: L = !1,
|
|
16
|
+
leadingIcon: _,
|
|
17
|
+
showBeta: g = !1,
|
|
18
|
+
betaLabel: B = "Beta",
|
|
19
|
+
showEnterpriseLabel: y = !1,
|
|
20
|
+
enterpriseLabel: C = "Enterprise",
|
|
21
|
+
showButton: N = !1,
|
|
22
|
+
buttonLabel: j = "Button",
|
|
23
|
+
onButtonClick: A,
|
|
24
|
+
showSwitch: k = !1,
|
|
25
|
+
switchLabel: D = "Off",
|
|
26
|
+
switchChecked: H,
|
|
27
|
+
defaultSwitchChecked: I,
|
|
28
|
+
onSwitchChange: P,
|
|
29
|
+
switchDisabled: F,
|
|
30
|
+
expandable: O = !1,
|
|
31
|
+
expandedState: r,
|
|
32
|
+
defaultExpandedState: R = "collapsed",
|
|
33
|
+
onExpandedStateChange: d,
|
|
34
|
+
expandLabel: T,
|
|
35
|
+
collapseLabel: U,
|
|
36
|
+
...q
|
|
37
|
+
} = E, p = X(), o = t != null && t !== !1 && t !== "", [z, G] = Y(R), e = o && O, h = e && r !== void 0, n = (e ? h ? r : z : "expanded") === "expanded", J = (u) => {
|
|
38
|
+
e && (h || G(u), d == null || d(u));
|
|
39
|
+
}, K = () => {
|
|
40
|
+
J(n ? "collapsed" : "expanded");
|
|
41
|
+
}, m = Z.toArray(c).length > 0, M = l != null, f = m || M, Q = f && (!e || n), x = m ? /* @__PURE__ */ i("div", { className: a["admin-panel__body"], children: c }) : null, V = f ? e ? /* @__PURE__ */ i(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: [
|
|
45
|
+
a["admin-panel__collapse"],
|
|
46
|
+
n ? a["admin-panel__collapse--expanded"] : ""
|
|
47
|
+
].filter(Boolean).join(" "),
|
|
48
|
+
"aria-hidden": !n,
|
|
49
|
+
inert: !n,
|
|
50
|
+
children: /* @__PURE__ */ s("div", { className: a["admin-panel__collapse-inner"], children: [
|
|
51
|
+
x,
|
|
52
|
+
l
|
|
53
|
+
] })
|
|
54
|
+
}
|
|
55
|
+
) : /* @__PURE__ */ s(W, { children: [
|
|
56
|
+
x,
|
|
57
|
+
l
|
|
58
|
+
] }) : null;
|
|
59
|
+
return /* @__PURE__ */ s(
|
|
40
60
|
"section",
|
|
41
61
|
{
|
|
42
|
-
...
|
|
43
|
-
className: [
|
|
44
|
-
"aria-labelledby":
|
|
62
|
+
...q,
|
|
63
|
+
className: [a["admin-panel"], w].join(" ").trim(),
|
|
64
|
+
"aria-labelledby": o ? p : void 0,
|
|
45
65
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
66
|
+
o ? /* @__PURE__ */ i(
|
|
67
|
+
$,
|
|
48
68
|
{
|
|
49
|
-
titleId:
|
|
50
|
-
title:
|
|
51
|
-
subtitle:
|
|
52
|
-
headerActions:
|
|
53
|
-
iconLeft:
|
|
54
|
-
leadingIcon:
|
|
55
|
-
showBeta:
|
|
56
|
-
betaLabel:
|
|
57
|
-
showEnterpriseLabel:
|
|
58
|
-
enterpriseLabel:
|
|
59
|
-
showButton:
|
|
60
|
-
buttonLabel:
|
|
61
|
-
onButtonClick:
|
|
62
|
-
showSwitch:
|
|
63
|
-
switchLabel:
|
|
64
|
-
switchChecked:
|
|
65
|
-
defaultSwitchChecked:
|
|
66
|
-
onSwitchChange:
|
|
67
|
-
switchDisabled:
|
|
69
|
+
titleId: p,
|
|
70
|
+
title: t,
|
|
71
|
+
subtitle: v,
|
|
72
|
+
headerActions: S,
|
|
73
|
+
iconLeft: L,
|
|
74
|
+
leadingIcon: _,
|
|
75
|
+
showBeta: g,
|
|
76
|
+
betaLabel: B,
|
|
77
|
+
showEnterpriseLabel: y,
|
|
78
|
+
enterpriseLabel: C,
|
|
79
|
+
showButton: N,
|
|
80
|
+
buttonLabel: j,
|
|
81
|
+
onButtonClick: A,
|
|
82
|
+
showSwitch: k,
|
|
83
|
+
switchLabel: D,
|
|
84
|
+
switchChecked: H,
|
|
85
|
+
defaultSwitchChecked: I,
|
|
86
|
+
onSwitchChange: P,
|
|
87
|
+
switchDisabled: F,
|
|
68
88
|
expandable: e,
|
|
69
|
-
isExpanded:
|
|
70
|
-
onToggleExpand:
|
|
71
|
-
expandLabel:
|
|
72
|
-
collapseLabel:
|
|
73
|
-
showDivider:
|
|
74
|
-
}
|
|
75
|
-
),
|
|
76
|
-
e ? /* @__PURE__ */ l(
|
|
77
|
-
"div",
|
|
78
|
-
{
|
|
79
|
-
className: [
|
|
80
|
-
s["admin-panel__collapse"],
|
|
81
|
-
d ? s["admin-panel__collapse--expanded"] : ""
|
|
82
|
-
].filter(Boolean).join(" "),
|
|
83
|
-
"aria-hidden": !d,
|
|
84
|
-
children: /* @__PURE__ */ l("div", { className: s["admin-panel__collapse-inner"], children: /* @__PURE__ */ l("div", { className: s["admin-panel__body"], children: n }) })
|
|
89
|
+
isExpanded: n,
|
|
90
|
+
onToggleExpand: K,
|
|
91
|
+
expandLabel: T,
|
|
92
|
+
collapseLabel: U,
|
|
93
|
+
showDivider: Q
|
|
85
94
|
}
|
|
86
|
-
) :
|
|
95
|
+
) : null,
|
|
96
|
+
V
|
|
87
97
|
]
|
|
88
98
|
}
|
|
89
99
|
);
|
|
90
100
|
}
|
|
91
101
|
export {
|
|
92
|
-
|
|
102
|
+
de as default
|
|
93
103
|
};
|
|
94
104
|
//# sourceMappingURL=AdminPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPanel.js","sources":["../../../src/components/admin-panel/AdminPanel.tsx"],"sourcesContent":["import {\n useId,\n useState,\n type ChangeEvent,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport AdminPanelHeader, {\n type AdminPanelExpandedState,\n} from '@/components/admin-panel-header/AdminPanelHeader';\nimport styles from './AdminPanel.module.scss';\n\nexport type { AdminPanelExpandedState };\n\nexport interface AdminPanelProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n title: ReactNode;\n subtitle?: ReactNode;\n children?: ReactNode;\n className?: string;\n headerActions?: ReactNode;\n iconLeft?: boolean;\n /** Icon forwarded to `AdminPanelHeader`'s 44×44 circular pill. Pass `<Icon glyph={<SomeIcon />} size=\"20\" />`. */\n leadingIcon?: ReactNode;\n showBeta?: boolean;\n /** Default: \"Beta\". Accepts translated nodes. */\n betaLabel?: ReactNode;\n showEnterpriseLabel?: boolean;\n /** Default: \"Enterprise\". Accepts translated nodes. */\n enterpriseLabel?: ReactNode;\n showButton?: boolean;\n /** Default: \"Button\". Accepts translated nodes. */\n buttonLabel?: ReactNode;\n onButtonClick?: () => void;\n showSwitch?: boolean;\n switchLabel?: ReactNode;\n switchChecked?: boolean;\n defaultSwitchChecked?: boolean;\n onSwitchChange?: (\n checked: boolean,\n event: ChangeEvent<HTMLInputElement>,\n ) => void;\n switchDisabled?: boolean;\n expandable?: boolean;\n expandedState?: AdminPanelExpandedState;\n defaultExpandedState?: AdminPanelExpandedState;\n onExpandedStateChange?: (state: AdminPanelExpandedState) => void;\n /** Accessible name for the expand button while collapsed. Default: \"Expand section\". */\n expandLabel?: string;\n /** Accessible name for the expand button while expanded. Default: \"Collapse section\". */\n collapseLabel?: string;\n}\n\n/**\n * System Console admin settings panel: `AdminPanelHeader` plus a body slot\n * for grouped fields. Expand/collapse state is owned here and passed to the header.\n */\nexport default function AdminPanel({\n title,\n subtitle,\n headerActions,\n children,\n className = '',\n iconLeft = false,\n leadingIcon,\n showBeta = false,\n betaLabel = 'Beta',\n showEnterpriseLabel = false,\n enterpriseLabel = 'Enterprise',\n showButton = false,\n buttonLabel = 'Button',\n onButtonClick,\n showSwitch = false,\n switchLabel = 'Off',\n switchChecked,\n defaultSwitchChecked,\n onSwitchChange,\n switchDisabled,\n expandable = false,\n expandedState: expandedStateProp,\n defaultExpandedState = 'collapsed',\n onExpandedStateChange,\n expandLabel,\n collapseLabel,\n ...rest\n}: AdminPanelProps) {\n const titleId = useId();\n\n const [uncontrolledExpanded, setUncontrolledExpanded] =\n useState<AdminPanelExpandedState>(defaultExpandedState);\n\n const isExpandControlled = expandable && expandedStateProp !== undefined;\n const resolvedExpandedState: AdminPanelExpandedState = !expandable\n ? 'expanded'\n : isExpandControlled\n ? expandedStateProp!\n : uncontrolledExpanded;\n\n const isExpanded = resolvedExpandedState === 'expanded';\n\n const setExpandedState = (next: AdminPanelExpandedState) => {\n if (!expandable) return;\n if (!isExpandControlled) {\n setUncontrolledExpanded(next);\n }\n onExpandedStateChange?.(next);\n };\n\n const toggleExpanded = () => {\n setExpandedState(isExpanded ? 'collapsed' : 'expanded');\n };\n\n const showHeaderDivider = !expandable || isExpanded;\n\n return (\n <section\n {...rest}\n className={[styles['admin-panel'], className].join(' ').trim()}\n aria-labelledby={titleId}\n >\n <AdminPanelHeader\n titleId={titleId}\n title={title}\n subtitle={subtitle}\n headerActions={headerActions}\n iconLeft={iconLeft}\n leadingIcon={leadingIcon}\n showBeta={showBeta}\n betaLabel={betaLabel}\n showEnterpriseLabel={showEnterpriseLabel}\n enterpriseLabel={enterpriseLabel}\n showButton={showButton}\n buttonLabel={buttonLabel}\n onButtonClick={onButtonClick}\n showSwitch={showSwitch}\n switchLabel={switchLabel}\n switchChecked={switchChecked}\n defaultSwitchChecked={defaultSwitchChecked}\n onSwitchChange={onSwitchChange}\n switchDisabled={switchDisabled}\n expandable={expandable}\n isExpanded={isExpanded}\n onToggleExpand={toggleExpanded}\n expandLabel={expandLabel}\n collapseLabel={collapseLabel}\n showDivider={showHeaderDivider}\n />\n {expandable ? (\n <div\n className={[\n styles['admin-panel__collapse'],\n isExpanded ? styles['admin-panel__collapse--expanded'] : '',\n ]\n .filter(Boolean)\n .join(' ')}\n aria-hidden={!isExpanded}\n >\n <div className={styles['admin-panel__collapse-inner']}>\n <div className={styles['admin-panel__body']}>{children}</div>\n </div>\n </div>\n ) : (\n <div className={styles['admin-panel__body']}>{children}</div>\n )}\n </section>\n );\n}\n"],"names":["AdminPanel","title","subtitle","headerActions","children","className","iconLeft","leadingIcon","showBeta","betaLabel","showEnterpriseLabel","enterpriseLabel","showButton","buttonLabel","onButtonClick","showSwitch","switchLabel","switchChecked","defaultSwitchChecked","onSwitchChange","switchDisabled","expandable","expandedStateProp","defaultExpandedState","onExpandedStateChange","expandLabel","collapseLabel","rest","titleId","useId","uncontrolledExpanded","setUncontrolledExpanded","useState","isExpandControlled","isExpanded","setExpandedState","next","toggleExpanded","showHeaderDivider","jsxs","styles","jsx","AdminPanelHeader"],"mappings":";;;;AA2DA,SAAwBA,EAAW;AAAA,EACjC,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,UAAAC,IAAW;AAAA,EACX,aAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,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A,aAAAC;AAAA,YACA,eAAAC;AAAA,YACA,YAAAC;AAAA,YACA,aAAAC;AAAA,YACA,eAAAC;AAAA,YACA,sBAAAC;AAAA,YACA,gBAAAC;AAAA,YACA,gBAAAC;AAAA,YACA,YAAAC;AAAA,YACA,YAAAa;AAAA,YACA,gBAAgBG;AAAA,YAChB,aAAAZ;AAAA,YACA,eAAAC;AAAA,YACA,aAAaY;AAAA,UAAA;AAAA,QAAA;AAAA,QAEdjB,IACC,gBAAAoB;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACTD,EAAO,uBAAuB;AAAA,cAC9BN,IAAaM,EAAO,iCAAiC,IAAI;AAAA,YAAA,EAExD,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,YACX,eAAa,CAACN;AAAA,YAEd,UAAA,gBAAAO,EAAC,OAAA,EAAI,WAAWD,EAAO,6BAA6B,GAClD,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWD,EAAO,mBAAmB,GAAI,UAAApC,GAAS,EAAA,CACzD;AAAA,UAAA;AAAA,QAAA,IAGF,gBAAAqC,EAAC,OAAA,EAAI,WAAWD,EAAO,mBAAmB,GAAI,UAAApC,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAI/D;"}
|
|
1
|
+
{"version":3,"file":"AdminPanel.js","sources":["../../../src/components/admin-panel/AdminPanel.tsx"],"sourcesContent":["import {\n Children,\n useId,\n useState,\n type ChangeEvent,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport AdminPanelHeader, {\n type AdminPanelExpandedState,\n} from '@/components/admin-panel-header/AdminPanelHeader';\nimport styles from './AdminPanel.module.scss';\n\nexport type { AdminPanelExpandedState };\n\n/** Non-null content for required header/body slots (runtime still guards nullish escapes). */\ntype AdminPanelContent = NonNullable<ReactNode>;\n\ntype AdminPanelChromeProps = Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> & {\n className?: string;\n /**\n * Optional footer rail below the body — typically\n * [`AdminPanelFooter`](/components/admin-panel-footer) with left/right action slots.\n * Collapses with the body when the panel is expandable.\n */\n footer?: ReactNode;\n};\n\ntype AdminPanelHeaderSlotProps = {\n title: AdminPanelContent;\n subtitle?: ReactNode;\n headerActions?: ReactNode;\n iconLeft?: boolean;\n /** Icon forwarded to `AdminPanelHeader`'s 44×44 circular pill. Pass `<Icon glyph={<SomeIcon />} />`. */\n leadingIcon?: ReactNode;\n showBeta?: boolean;\n /** Default: \"Beta\". Accepts translated nodes. */\n betaLabel?: ReactNode;\n showEnterpriseLabel?: boolean;\n /** Default: \"Enterprise\". Accepts translated nodes. */\n enterpriseLabel?: ReactNode;\n showButton?: boolean;\n /** Default: \"Button\". Accepts translated nodes. */\n buttonLabel?: ReactNode;\n onButtonClick?: () => void;\n showSwitch?: boolean;\n switchLabel?: ReactNode;\n switchChecked?: boolean;\n defaultSwitchChecked?: boolean;\n onSwitchChange?: (\n checked: boolean,\n event: ChangeEvent<HTMLInputElement>,\n ) => void;\n switchDisabled?: boolean;\n expandable?: boolean;\n expandedState?: AdminPanelExpandedState;\n defaultExpandedState?: AdminPanelExpandedState;\n onExpandedStateChange?: (state: AdminPanelExpandedState) => void;\n /** Accessible name for the expand button while collapsed. Default: \"Expand section\". */\n expandLabel?: string;\n /** Accessible name for the expand button while expanded. Default: \"Collapse section\". */\n collapseLabel?: string;\n};\n\n/** Panel with a header. Body and footer are optional. */\ntype AdminPanelWithHeaderProps = AdminPanelChromeProps &\n AdminPanelHeaderSlotProps & {\n children?: ReactNode;\n };\n\n/**\n * Header-less panel. `children` (body) are required — footer alone is not enough.\n * Header chrome props (`subtitle`, `expandable`, …) are not accepted on this variant.\n */\ntype AdminPanelWithoutHeaderProps = AdminPanelChromeProps & {\n title?: undefined;\n children: AdminPanelContent;\n};\n\n/**\n * System Console admin settings panel. Provide a `title` (header), `children`\n * (body), or both. Footer is always optional. Header-only and body-only panels\n * are valid; footer-only is not.\n */\nexport type AdminPanelProps =\n | AdminPanelWithHeaderProps\n | AdminPanelWithoutHeaderProps;\n\n/**\n * Admin Panel is the bordered sheet used throughout System Console for a single\n * settings section. It can include an\n * [`Admin Panel Header`](/components/admin-panel-header), a body where grouped\n * fields and help text live, and an optional\n * [`Admin Panel Footer`](/components/admin-panel-footer) for sectional actions.\n * Provide a header, a body, or both — footer alone is not enough. Expand/collapse\n * state is owned here and passed to the header when present.\n */\nexport default function AdminPanel(props: AdminPanelProps) {\n const {\n title,\n children,\n footer,\n className = '',\n ...rest\n } = props as AdminPanelWithHeaderProps;\n\n const {\n subtitle,\n headerActions,\n iconLeft = false,\n leadingIcon,\n showBeta = false,\n betaLabel = 'Beta',\n showEnterpriseLabel = false,\n enterpriseLabel = 'Enterprise',\n showButton = false,\n buttonLabel = 'Button',\n onButtonClick,\n showSwitch = false,\n switchLabel = 'Off',\n switchChecked,\n defaultSwitchChecked,\n onSwitchChange,\n switchDisabled,\n expandable = false,\n expandedState: expandedStateProp,\n defaultExpandedState = 'collapsed',\n onExpandedStateChange,\n expandLabel,\n collapseLabel,\n ...domRest\n } = rest;\n\n const titleId = useId();\n // Treat nullish / false / '' as no header so JS callers and type escapes stay safe.\n const hasHeader = title != null && title !== false && title !== '';\n\n const [uncontrolledExpanded, setUncontrolledExpanded] =\n useState<AdminPanelExpandedState>(defaultExpandedState);\n\n // Expand/collapse lives on the header; without one, content stays visible.\n const canExpand = hasHeader && expandable;\n const isExpandControlled = canExpand && expandedStateProp !== undefined;\n const resolvedExpandedState: AdminPanelExpandedState = !canExpand\n ? 'expanded'\n : isExpandControlled\n ? expandedStateProp!\n : uncontrolledExpanded;\n\n const isExpanded = resolvedExpandedState === 'expanded';\n\n const setExpandedState = (next: AdminPanelExpandedState) => {\n if (!canExpand) return;\n if (!isExpandControlled) {\n setUncontrolledExpanded(next);\n }\n onExpandedStateChange?.(next);\n };\n\n const toggleExpanded = () => {\n setExpandedState(isExpanded ? 'collapsed' : 'expanded');\n };\n\n const hasBody = Children.toArray(children).length > 0;\n const hasFooter = footer != null;\n const hasContent = hasBody || hasFooter;\n // Skip the header divider when there is no body/footer so header-only\n // panels don’t show an orphan rule above the card edge.\n const showHeaderDivider = hasContent && (!canExpand || isExpanded);\n\n const body = hasBody ? (\n <div className={styles['admin-panel__body']}>{children}</div>\n ) : null;\n\n const content = hasContent ? (\n canExpand ? (\n <div\n className={[\n styles['admin-panel__collapse'],\n isExpanded ? styles['admin-panel__collapse--expanded'] : '',\n ]\n .filter(Boolean)\n .join(' ')}\n aria-hidden={!isExpanded}\n inert={!isExpanded}\n >\n <div className={styles['admin-panel__collapse-inner']}>\n {body}\n {footer}\n </div>\n </div>\n ) : (\n <>\n {body}\n {footer}\n </>\n )\n ) : null;\n\n return (\n <section\n {...domRest}\n className={[styles['admin-panel'], className].join(' ').trim()}\n aria-labelledby={hasHeader ? titleId : undefined}\n >\n {hasHeader ? (\n <AdminPanelHeader\n titleId={titleId}\n title={title}\n subtitle={subtitle}\n headerActions={headerActions}\n iconLeft={iconLeft}\n leadingIcon={leadingIcon}\n showBeta={showBeta}\n betaLabel={betaLabel}\n showEnterpriseLabel={showEnterpriseLabel}\n enterpriseLabel={enterpriseLabel}\n showButton={showButton}\n buttonLabel={buttonLabel}\n onButtonClick={onButtonClick}\n showSwitch={showSwitch}\n switchLabel={switchLabel}\n switchChecked={switchChecked}\n defaultSwitchChecked={defaultSwitchChecked}\n onSwitchChange={onSwitchChange}\n switchDisabled={switchDisabled}\n expandable={canExpand}\n isExpanded={isExpanded}\n onToggleExpand={toggleExpanded}\n expandLabel={expandLabel}\n collapseLabel={collapseLabel}\n showDivider={showHeaderDivider}\n />\n ) : null}\n {content}\n </section>\n );\n}\n"],"names":["AdminPanel","props","title","children","footer","className","rest","subtitle","headerActions","iconLeft","leadingIcon","showBeta","betaLabel","showEnterpriseLabel","enterpriseLabel","showButton","buttonLabel","onButtonClick","showSwitch","switchLabel","switchChecked","defaultSwitchChecked","onSwitchChange","switchDisabled","expandable","expandedStateProp","defaultExpandedState","onExpandedStateChange","expandLabel","collapseLabel","domRest","titleId","useId","hasHeader","uncontrolledExpanded","setUncontrolledExpanded","useState","canExpand","isExpandControlled","isExpanded","setExpandedState","next","toggleExpanded","hasBody","Children","hasFooter","hasContent","showHeaderDivider","body","jsx","styles","content","jsxs","Fragment","AdminPanelHeader"],"mappings":";;;;AAoGA,SAAwBA,GAAWC,GAAwB;AACzD,QAAM;AAAA,IACJ,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,QAAAC;AAAA,IACA,WAAAC,IAAY;AAAA,IACZ,GAAGC;AAAA,EAAA,IACDL,GAEE;AAAA,IACJ,UAAAM;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,aAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,WAAAC,IAAY;AAAA,IACZ,qBAAAC,IAAsB;AAAA,IACtB,iBAAAC,IAAkB;AAAA,IAClB,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,eAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,aAAAC,IAAc;AAAA,IACd,eAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,eAAeC;AAAA,IACf,sBAAAC,IAAuB;AAAA,IACvB,uBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,eAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDxB,GAEEyB,IAAUC,EAAA,GAEVC,IAAY/B,KAAS,QAAQA,MAAU,MAASA,MAAU,IAE1D,CAACgC,GAAsBC,CAAuB,IAClDC,EAAkCV,CAAoB,GAGlDW,IAAYJ,KAAaT,GACzBc,IAAqBD,KAAaZ,MAAsB,QAOxDc,KANkDF,IAEpDC,IACEb,IACAS,IAHF,gBAKyC,YAEvCM,IAAmB,CAACC,MAAkC;AAC1D,IAAKJ,MACAC,KACHH,EAAwBM,CAAI,GAE9Bd,KAAA,QAAAA,EAAwBc;AAA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AAC;AAAA,YACA,YAAAC;AAAA,YACA,aAAAC;AAAA,YACA,eAAAC;AAAA,YACA,YAAAC;AAAA,YACA,aAAAC;AAAA,YACA,eAAAC;AAAA,YACA,sBAAAC;AAAA,YACA,gBAAAC;AAAA,YACA,gBAAAC;AAAA,YACA,YAAYc;AAAA,YACZ,YAAAE;AAAA,YACA,gBAAgBG;AAAA,YAChB,aAAAd;AAAA,YACA,eAAAC;AAAA,YACA,aAAakB;AAAA,UAAA;AAAA,QAAA,IAEb;AAAA,QACHI;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),u=require("../../utils/props.cjs"),e=require("./AdminPanelFooter.module.scss.cjs");function d({leftActions:t,rightActions:s,className:r,...o}){const n=t!=null,a=s!=null;if(!n&&!a)return null;const i=n!==a;return l.jsx("div",{...o,className:u.mergeClassNames(e.default["admin-panel-footer"],i&&e.default["admin-panel-footer--single"],r),children:l.jsxs("div",{className:e.default["admin-panel-footer__content"],children:[n?l.jsx("div",{className:e.default["admin-panel-footer__left"],children:t}):null,a?l.jsx("div",{className:e.default["admin-panel-footer__right"],children:s}):null]})})}exports.default=d;
|
|
2
2
|
//# sourceMappingURL=AdminPanelFooter.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPanelFooter.cjs","sources":["../../../src/components/admin-panel-footer/AdminPanelFooter.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"AdminPanelFooter.cjs","sources":["../../../src/components/admin-panel-footer/AdminPanelFooter.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport { mergeClassNames } from '@/utils/props';\nimport styles from './AdminPanelFooter.module.scss';\n\nexport interface AdminPanelFooterProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /**\n * Start-edge slot for panel actions — `Button`, `IconButton`, pagination\n * status, `PaginationDots`, or other controls. Prefer this slot for primary\n * action groups (primary button leftmost when used).\n */\n leftActions?: ReactNode;\n /**\n * End-edge slot for panel actions — secondary utilities, pagination\n * controls, or other trailing actions. When this is the only slot filled,\n * the group still aligns to the start edge.\n */\n rightActions?: ReactNode;\n}\n\n/**\n * Admin Panel Footer is the action rail at the bottom of an [`Admin\n * Panel`](/patterns/admin-panel). Compose it via the panel’s optional `footer` prop (the\n * panel still needs a header or a body). It provides start- and end-edge slots for `Button`,\n * `IconButton`, or pagination controls — layout and divider chrome only; the host owns\n * labels and handlers.\n */\nexport default function AdminPanelFooter({\n leftActions,\n rightActions,\n className,\n ...rest\n}: AdminPanelFooterProps) {\n const hasLeft = leftActions != null;\n const hasRight = rightActions != null;\n\n if (!hasLeft && !hasRight) {\n return null;\n }\n\n const singleGroup = hasLeft !== hasRight;\n\n return (\n <div\n {...rest}\n className={mergeClassNames(\n styles['admin-panel-footer'],\n singleGroup && styles['admin-panel-footer--single'],\n className,\n )}\n >\n <div className={styles['admin-panel-footer__content']}>\n {hasLeft ? (\n <div className={styles['admin-panel-footer__left']}>\n {leftActions}\n </div>\n ) : null}\n {hasRight ? (\n <div className={styles['admin-panel-footer__right']}>\n {rightActions}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["AdminPanelFooter","leftActions","rightActions","className","rest","hasLeft","hasRight","singleGroup","jsx","mergeClassNames","styles","jsxs"],"mappings":"oOA6BA,SAAwBA,EAAiB,CACvC,YAAAC,EACA,aAAAC,EACA,UAAAC,EACA,GAAGC,CACL,EAA0B,CACxB,MAAMC,EAAUJ,GAAe,KACzBK,EAAWJ,GAAgB,KAEjC,GAAI,CAACG,GAAW,CAACC,EACf,OAAO,KAGT,MAAMC,EAAcF,IAAYC,EAEhC,OACEE,EAAAA,IAAC,MAAA,CACE,GAAGJ,EACJ,UAAWK,EAAAA,gBACTC,EAAAA,QAAO,oBAAoB,EAC3BH,GAAeG,EAAAA,QAAO,4BAA4B,EAClDP,CAAA,EAGF,SAAAQ,EAAAA,KAAC,MAAA,CAAI,UAAWD,UAAO,6BAA6B,EACjD,SAAA,CAAAL,QACE,MAAA,CAAI,UAAWK,EAAAA,QAAO,0BAA0B,EAC9C,WACH,EACE,KACHJ,QACE,MAAA,CAAI,UAAWI,UAAO,2BAA2B,EAC/C,WACH,EACE,IAAA,CAAA,CACN,CAAA,CAAA,CAGN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._admin-panel-
|
|
1
|
+
._admin-panel-footer_13680_2{display:flex;flex-direction:column;flex-shrink:0;width:100%;box-sizing:border-box;background:var(--center-channel-bg);border-top:1px solid rgba(var(--center-channel-color-rgb),.12)}._admin-panel-footer__content_13680_11{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-m);width:100%;padding:var(--spacing-xxl);box-sizing:border-box}._admin-panel-footer__left_13680_20,._admin-panel-footer__right_13680_20{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-xs);min-width:0}._admin-panel-footer__left_13680_20{flex:1 1 auto;justify-content:flex-start}._admin-panel-footer__right_13680_20{flex-shrink:0;justify-content:flex-end}._admin-panel-footer--single_13680_35 ._admin-panel-footer__content_13680_11{justify-content:flex-start}._admin-panel-footer--single_13680_35 ._admin-panel-footer__left_13680_20,._admin-panel-footer--single_13680_35 ._admin-panel-footer__right_13680_20{flex:0 1 auto;justify-content:flex-start}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
export
|
|
3
|
-
export interface AdminPanelFooterProps {
|
|
4
|
-
/** Primary footer action label. Default: "Save". Accepts translated nodes. */
|
|
5
|
-
saveLabel?: ReactNode;
|
|
6
|
-
/** Default: "Cancel". Accepts translated nodes. */
|
|
7
|
-
cancelLabel?: ReactNode;
|
|
8
|
-
onSave?: () => void;
|
|
9
|
-
onCancel?: () => void;
|
|
10
|
-
/** When true, Save uses disabled styling until the sheet is actionable. */
|
|
11
|
-
saveDisabled?: boolean;
|
|
12
|
-
/** Optional validation summary beside the buttons. */
|
|
13
|
-
status?: AdminPanelFooterStatus;
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface AdminPanelFooterProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
14
3
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
4
|
+
* Start-edge slot for panel actions — `Button`, `IconButton`, pagination
|
|
5
|
+
* status, `PaginationDots`, or other controls. Prefer this slot for primary
|
|
6
|
+
* action groups (primary button leftmost when used).
|
|
17
7
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
leftActions?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* End-edge slot for panel actions — secondary utilities, pagination
|
|
11
|
+
* controls, or other trailing actions. When this is the only slot filled,
|
|
12
|
+
* the group still aligns to the start edge.
|
|
13
|
+
*/
|
|
14
|
+
rightActions?: ReactNode;
|
|
20
15
|
}
|
|
21
16
|
/**
|
|
22
|
-
* Admin Panel Footer
|
|
23
|
-
*
|
|
24
|
-
*
|
|
17
|
+
* Admin Panel Footer is the action rail at the bottom of an [`Admin
|
|
18
|
+
* Panel`](/patterns/admin-panel). Compose it via the panel’s optional `footer` prop (the
|
|
19
|
+
* panel still needs a header or a body). It provides start- and end-edge slots for `Button`,
|
|
20
|
+
* `IconButton`, or pagination controls — layout and divider chrome only; the host owns
|
|
21
|
+
* labels and handlers.
|
|
25
22
|
*/
|
|
26
|
-
export default function AdminPanelFooter({
|
|
23
|
+
export default function AdminPanelFooter({ leftActions, rightActions, className, ...rest }: AdminPanelFooterProps): import("react/jsx-runtime").JSX.Element | null;
|
|
27
24
|
//# sourceMappingURL=AdminPanelFooter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPanelFooter.d.ts","sourceRoot":"","sources":["../../../src/components/admin-panel-footer/AdminPanelFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AdminPanelFooter.d.ts","sourceRoot":"","sources":["../../../src/components/admin-panel-footer/AdminPanelFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CACjD,cAAc,CAAC,cAAc,CAAC,EAC9B,UAAU,CACX;IACC;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EACvC,WAAW,EACX,YAAY,EACZ,SAAS,EACT,GAAG,IAAI,EACR,EAAE,qBAAqB,kDAiCvB"}
|
|
@@ -1,70 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
cancelLabel: m = "Cancel",
|
|
10
|
-
onSave: d,
|
|
11
|
-
onCancel: p,
|
|
12
|
-
saveDisabled: f = !0,
|
|
13
|
-
status: r = "none",
|
|
14
|
-
statusMessage: t,
|
|
15
|
-
className: u = ""
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { mergeClassNames as d } from "../../utils/props.js";
|
|
3
|
+
import e from "./AdminPanelFooter.module.scss.js";
|
|
4
|
+
function u({
|
|
5
|
+
leftActions: o,
|
|
6
|
+
rightActions: r,
|
|
7
|
+
className: s,
|
|
8
|
+
...i
|
|
16
9
|
}) {
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
] });
|
|
24
|
-
}
|
|
25
|
-
if (r === "error") {
|
|
26
|
-
const a = t ?? v;
|
|
27
|
-
i = /* @__PURE__ */ o(l, { children: [
|
|
28
|
-
/* @__PURE__ */ e("span", { className: n["admin-panel-footer__status-icon"], "aria-hidden": !0, children: /* @__PURE__ */ e(_, { size: 12 }) }),
|
|
29
|
-
/* @__PURE__ */ e("span", { children: a })
|
|
30
|
-
] });
|
|
31
|
-
}
|
|
32
|
-
const h = r === "warning" ? n["admin-panel-footer--status-warning"] : r === "error" ? n["admin-panel-footer--status-error"] : "";
|
|
33
|
-
return /* @__PURE__ */ e(
|
|
34
|
-
"footer",
|
|
10
|
+
const n = o != null, l = r != null;
|
|
11
|
+
if (!n && !l)
|
|
12
|
+
return null;
|
|
13
|
+
const t = n !== l;
|
|
14
|
+
return /* @__PURE__ */ a(
|
|
15
|
+
"div",
|
|
35
16
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
emphasis: "primary",
|
|
46
|
-
disabled: f,
|
|
47
|
-
onClick: d,
|
|
48
|
-
children: c
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
/* @__PURE__ */ e(
|
|
52
|
-
s,
|
|
53
|
-
{
|
|
54
|
-
type: "button",
|
|
55
|
-
size: "medium",
|
|
56
|
-
emphasis: "tertiary",
|
|
57
|
-
onClick: p,
|
|
58
|
-
children: m
|
|
59
|
-
}
|
|
60
|
-
)
|
|
61
|
-
] }),
|
|
62
|
-
i != null ? /* @__PURE__ */ e("div", { className: n["admin-panel-footer__status"], role: "alert", children: i }) : null
|
|
17
|
+
...i,
|
|
18
|
+
className: d(
|
|
19
|
+
e["admin-panel-footer"],
|
|
20
|
+
t && e["admin-panel-footer--single"],
|
|
21
|
+
s
|
|
22
|
+
),
|
|
23
|
+
children: /* @__PURE__ */ m("div", { className: e["admin-panel-footer__content"], children: [
|
|
24
|
+
n ? /* @__PURE__ */ a("div", { className: e["admin-panel-footer__left"], children: o }) : null,
|
|
25
|
+
l ? /* @__PURE__ */ a("div", { className: e["admin-panel-footer__right"], children: r }) : null
|
|
63
26
|
] })
|
|
64
27
|
}
|
|
65
28
|
);
|
|
66
29
|
}
|
|
67
30
|
export {
|
|
68
|
-
|
|
31
|
+
u as default
|
|
69
32
|
};
|
|
70
33
|
//# sourceMappingURL=AdminPanelFooter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPanelFooter.js","sources":["../../../src/components/admin-panel-footer/AdminPanelFooter.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"AdminPanelFooter.js","sources":["../../../src/components/admin-panel-footer/AdminPanelFooter.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from 'react';\nimport { mergeClassNames } from '@/utils/props';\nimport styles from './AdminPanelFooter.module.scss';\n\nexport interface AdminPanelFooterProps extends Omit<\n HTMLAttributes<HTMLDivElement>,\n 'children'\n> {\n /**\n * Start-edge slot for panel actions — `Button`, `IconButton`, pagination\n * status, `PaginationDots`, or other controls. Prefer this slot for primary\n * action groups (primary button leftmost when used).\n */\n leftActions?: ReactNode;\n /**\n * End-edge slot for panel actions — secondary utilities, pagination\n * controls, or other trailing actions. When this is the only slot filled,\n * the group still aligns to the start edge.\n */\n rightActions?: ReactNode;\n}\n\n/**\n * Admin Panel Footer is the action rail at the bottom of an [`Admin\n * Panel`](/patterns/admin-panel). Compose it via the panel’s optional `footer` prop (the\n * panel still needs a header or a body). It provides start- and end-edge slots for `Button`,\n * `IconButton`, or pagination controls — layout and divider chrome only; the host owns\n * labels and handlers.\n */\nexport default function AdminPanelFooter({\n leftActions,\n rightActions,\n className,\n ...rest\n}: AdminPanelFooterProps) {\n const hasLeft = leftActions != null;\n const hasRight = rightActions != null;\n\n if (!hasLeft && !hasRight) {\n return null;\n }\n\n const singleGroup = hasLeft !== hasRight;\n\n return (\n <div\n {...rest}\n className={mergeClassNames(\n styles['admin-panel-footer'],\n singleGroup && styles['admin-panel-footer--single'],\n className,\n )}\n >\n <div className={styles['admin-panel-footer__content']}>\n {hasLeft ? (\n <div className={styles['admin-panel-footer__left']}>\n {leftActions}\n </div>\n ) : null}\n {hasRight ? (\n <div className={styles['admin-panel-footer__right']}>\n {rightActions}\n </div>\n ) : null}\n </div>\n </div>\n );\n}\n"],"names":["AdminPanelFooter","leftActions","rightActions","className","rest","hasLeft","hasRight","singleGroup","jsx","mergeClassNames","styles","jsxs"],"mappings":";;;AA6BA,SAAwBA,EAAiB;AAAA,EACvC,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACL,GAA0B;AACxB,QAAMC,IAAUJ,KAAe,MACzBK,IAAWJ,KAAgB;AAEjC,MAAI,CAACG,KAAW,CAACC;AACf,WAAO;AAGT,QAAMC,IAAcF,MAAYC;AAEhC,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGJ;AAAA,MACJ,WAAWK;AAAA,QACTC,EAAO,oBAAoB;AAAA,QAC3BH,KAAeG,EAAO,4BAA4B;AAAA,QAClDP;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAQ,EAAC,OAAA,EAAI,WAAWD,EAAO,6BAA6B,GACjD,UAAA;AAAA,QAAAL,sBACE,OAAA,EAAI,WAAWK,EAAO,0BAA0B,GAC9C,aACH,IACE;AAAA,QACHJ,sBACE,OAAA,EAAI,WAAWI,EAAO,2BAA2B,GAC/C,aACH,IACE;AAAA,MAAA,EAAA,CACN;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./AdminPanelFooter.css');const e={"admin-panel-footer":"_admin-panel-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./AdminPanelFooter.css');const e={"admin-panel-footer":"_admin-panel-footer_13680_2","admin-panel-footer__content":"_admin-panel-footer__content_13680_11","admin-panel-footer__left":"_admin-panel-footer__left_13680_20","admin-panel-footer__right":"_admin-panel-footer__right_13680_20","admin-panel-footer--single":"_admin-panel-footer--single_13680_35"};exports.default=e;
|
|
2
2
|
//# sourceMappingURL=AdminPanelFooter.module.scss.cjs.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import './AdminPanelFooter.css';const
|
|
2
|
-
"admin-panel-footer": "_admin-panel-
|
|
3
|
-
"admin-panel-
|
|
4
|
-
"admin-panel-
|
|
5
|
-
"admin-panel-
|
|
6
|
-
"admin-panel-
|
|
7
|
-
"admin-panel-footer--status-warning": "_admin-panel-footer--status-warning_1cvux_43",
|
|
8
|
-
"admin-panel-footer--status-error": "_admin-panel-footer--status-error_1cvux_46"
|
|
1
|
+
import './AdminPanelFooter.css';const e = {
|
|
2
|
+
"admin-panel-footer": "_admin-panel-footer_13680_2",
|
|
3
|
+
"admin-panel-footer__content": "_admin-panel-footer__content_13680_11",
|
|
4
|
+
"admin-panel-footer__left": "_admin-panel-footer__left_13680_20",
|
|
5
|
+
"admin-panel-footer__right": "_admin-panel-footer__right_13680_20",
|
|
6
|
+
"admin-panel-footer--single": "_admin-panel-footer--single_13680_35"
|
|
9
7
|
};
|
|
10
8
|
export {
|
|
11
|
-
|
|
9
|
+
e as default
|
|
12
10
|
};
|
|
13
11
|
//# sourceMappingURL=AdminPanelFooter.module.scss.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminPanelFooter.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdminPanelFooter.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|