@borisj74/bv-ds 0.1.0 → 0.1.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.
- package/dist/index.cjs +153 -31
- package/dist/index.d.cts +49 -2
- package/dist/index.d.ts +49 -2
- package/dist/index.js +153 -33
- package/package.json +1 -1
- package/src/components/Modal/Modal.tsx +111 -0
- package/src/components/Modal/index.ts +2 -0
- package/src/components/ModalHeader/ModalHeader.tsx +4 -1
- package/src/components/SlideoutMenu/SlideoutMenu.tsx +86 -0
- package/src/components/SlideoutMenu/index.ts +2 -0
- package/src/index.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -3843,7 +3843,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
3843
3843
|
function emptyFunctionThatReturnsNull() {
|
|
3844
3844
|
return null;
|
|
3845
3845
|
}
|
|
3846
|
-
module.exports = function(
|
|
3846
|
+
module.exports = function(isValidElement12, throwOnDirectAccess) {
|
|
3847
3847
|
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
3848
3848
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
3849
3849
|
function getIteratorFn(maybeIterable) {
|
|
@@ -3971,7 +3971,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
3971
3971
|
function createElementTypeChecker() {
|
|
3972
3972
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3973
3973
|
var propValue = props[propName];
|
|
3974
|
-
if (!
|
|
3974
|
+
if (!isValidElement12(propValue)) {
|
|
3975
3975
|
var propType = getPropType(propValue);
|
|
3976
3976
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
3977
3977
|
}
|
|
@@ -4159,7 +4159,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
4159
4159
|
if (Array.isArray(propValue)) {
|
|
4160
4160
|
return propValue.every(isNode);
|
|
4161
4161
|
}
|
|
4162
|
-
if (propValue === null ||
|
|
4162
|
+
if (propValue === null || isValidElement12(propValue)) {
|
|
4163
4163
|
return true;
|
|
4164
4164
|
}
|
|
4165
4165
|
var iteratorFn = getIteratorFn(propValue);
|
|
@@ -31418,33 +31418,6 @@ function MetricItem({
|
|
|
31418
31418
|
}
|
|
31419
31419
|
);
|
|
31420
31420
|
}
|
|
31421
|
-
function ModalActions({
|
|
31422
|
-
type = "horizontal-fill",
|
|
31423
|
-
divider = true,
|
|
31424
|
-
leading,
|
|
31425
|
-
children,
|
|
31426
|
-
className,
|
|
31427
|
-
...rest
|
|
31428
|
-
}) {
|
|
31429
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx_default("flex w-full flex-col", className), ...rest, children: [
|
|
31430
|
-
divider && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4xl border-t border-border-secondary" }),
|
|
31431
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31432
|
-
"div",
|
|
31433
|
-
{
|
|
31434
|
-
className: clsx_default(
|
|
31435
|
-
"flex px-3xl pb-3xl pt-3xl",
|
|
31436
|
-
type === "horizontal-fill" && "gap-lg [&>*]:flex-1",
|
|
31437
|
-
type === "vertical-fill" && "flex-col gap-lg [&>*]:w-full",
|
|
31438
|
-
type === "right-aligned" && "items-center gap-lg"
|
|
31439
|
-
),
|
|
31440
|
-
children: type === "right-aligned" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31441
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 items-center gap-lg", children: leading }),
|
|
31442
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-lg", children })
|
|
31443
|
-
] }) : children
|
|
31444
|
-
}
|
|
31445
|
-
)
|
|
31446
|
-
] });
|
|
31447
|
-
}
|
|
31448
31421
|
var FeaturedIcon = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-md border border-border-primary text-fg-secondary shadow-xs", children });
|
|
31449
31422
|
var XClose2 = () => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 20 20", fill: "none", className: "size-5", "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 5 5 15M5 5l10 10", stroke: "currentColor", strokeWidth: "1.67", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
31450
31423
|
function ModalHeader({
|
|
@@ -31454,6 +31427,7 @@ function ModalHeader({
|
|
|
31454
31427
|
type = "left",
|
|
31455
31428
|
divider = true,
|
|
31456
31429
|
onClose,
|
|
31430
|
+
titleId,
|
|
31457
31431
|
className,
|
|
31458
31432
|
...rest
|
|
31459
31433
|
}) {
|
|
@@ -31488,7 +31462,7 @@ function ModalHeader({
|
|
|
31488
31462
|
isCenter && "items-center text-center"
|
|
31489
31463
|
),
|
|
31490
31464
|
children: [
|
|
31491
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "w-full text-md font-semibold text-text-primary", children: title }),
|
|
31465
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { id: titleId, className: "w-full text-md font-semibold text-text-primary", children: title }),
|
|
31492
31466
|
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "w-full text-sm text-text-tertiary", children: description })
|
|
31493
31467
|
]
|
|
31494
31468
|
}
|
|
@@ -31511,6 +31485,99 @@ function ModalHeader({
|
|
|
31511
31485
|
}
|
|
31512
31486
|
);
|
|
31513
31487
|
}
|
|
31488
|
+
var sizeMaxWidth = {
|
|
31489
|
+
sm: "max-w-[400px]",
|
|
31490
|
+
md: "max-w-[560px]",
|
|
31491
|
+
lg: "max-w-[720px]",
|
|
31492
|
+
xl: "max-w-[960px]"
|
|
31493
|
+
};
|
|
31494
|
+
function Modal({
|
|
31495
|
+
open,
|
|
31496
|
+
onClose,
|
|
31497
|
+
size = "md",
|
|
31498
|
+
children,
|
|
31499
|
+
className,
|
|
31500
|
+
...rest
|
|
31501
|
+
}) {
|
|
31502
|
+
const panelRef = React28.useRef(null);
|
|
31503
|
+
const previousFocusRef = React28.useRef(null);
|
|
31504
|
+
const titleId = React28.useId();
|
|
31505
|
+
React28.useEffect(() => {
|
|
31506
|
+
if (!open) return;
|
|
31507
|
+
previousFocusRef.current = document.activeElement;
|
|
31508
|
+
panelRef.current?.focus();
|
|
31509
|
+
const handleKeyDown = (e) => {
|
|
31510
|
+
if (e.key === "Escape") onClose();
|
|
31511
|
+
};
|
|
31512
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
31513
|
+
return () => {
|
|
31514
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
31515
|
+
previousFocusRef.current?.focus();
|
|
31516
|
+
};
|
|
31517
|
+
}, [open, onClose]);
|
|
31518
|
+
if (!open) return null;
|
|
31519
|
+
const handlePanelClick = (e) => e.stopPropagation();
|
|
31520
|
+
let hasLabelledHeader = false;
|
|
31521
|
+
const labelledChildren = React28.Children.map(children, (child) => {
|
|
31522
|
+
if (React28.isValidElement(child) && child.type === ModalHeader) {
|
|
31523
|
+
hasLabelledHeader = true;
|
|
31524
|
+
return React28.cloneElement(child, { titleId });
|
|
31525
|
+
}
|
|
31526
|
+
return child;
|
|
31527
|
+
});
|
|
31528
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31529
|
+
"div",
|
|
31530
|
+
{
|
|
31531
|
+
onClick: onClose,
|
|
31532
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay/70 backdrop-blur-sm",
|
|
31533
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
31534
|
+
"div",
|
|
31535
|
+
{
|
|
31536
|
+
ref: panelRef,
|
|
31537
|
+
role: "dialog",
|
|
31538
|
+
"aria-modal": "true",
|
|
31539
|
+
"aria-labelledby": hasLabelledHeader ? titleId : void 0,
|
|
31540
|
+
tabIndex: -1,
|
|
31541
|
+
onClick: handlePanelClick,
|
|
31542
|
+
className: clsx_default(
|
|
31543
|
+
"mx-4 flex w-full flex-col overflow-hidden rounded-2xl bg-bg-primary shadow-xl outline-none sm:mx-0",
|
|
31544
|
+
sizeMaxWidth[size],
|
|
31545
|
+
className
|
|
31546
|
+
),
|
|
31547
|
+
...rest,
|
|
31548
|
+
children: labelledChildren
|
|
31549
|
+
}
|
|
31550
|
+
)
|
|
31551
|
+
}
|
|
31552
|
+
);
|
|
31553
|
+
}
|
|
31554
|
+
function ModalActions({
|
|
31555
|
+
type = "horizontal-fill",
|
|
31556
|
+
divider = true,
|
|
31557
|
+
leading,
|
|
31558
|
+
children,
|
|
31559
|
+
className,
|
|
31560
|
+
...rest
|
|
31561
|
+
}) {
|
|
31562
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx_default("flex w-full flex-col", className), ...rest, children: [
|
|
31563
|
+
divider && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4xl border-t border-border-secondary" }),
|
|
31564
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
31565
|
+
"div",
|
|
31566
|
+
{
|
|
31567
|
+
className: clsx_default(
|
|
31568
|
+
"flex px-3xl pb-3xl pt-3xl",
|
|
31569
|
+
type === "horizontal-fill" && "gap-lg [&>*]:flex-1",
|
|
31570
|
+
type === "vertical-fill" && "flex-col gap-lg [&>*]:w-full",
|
|
31571
|
+
type === "right-aligned" && "items-center gap-lg"
|
|
31572
|
+
),
|
|
31573
|
+
children: type === "right-aligned" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
31574
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 items-center gap-lg", children: leading }),
|
|
31575
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-lg", children })
|
|
31576
|
+
] }) : children
|
|
31577
|
+
}
|
|
31578
|
+
)
|
|
31579
|
+
] });
|
|
31580
|
+
}
|
|
31514
31581
|
function CheckboxBox({ selected, big }) {
|
|
31515
31582
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31516
31583
|
"span",
|
|
@@ -32924,6 +32991,59 @@ function SlideOutMenuHeader({
|
|
|
32924
32991
|
}
|
|
32925
32992
|
);
|
|
32926
32993
|
}
|
|
32994
|
+
var sizeWidth = {
|
|
32995
|
+
sm: "sm:w-[360px]",
|
|
32996
|
+
md: "sm:w-[480px]",
|
|
32997
|
+
lg: "sm:w-[600px]"
|
|
32998
|
+
};
|
|
32999
|
+
function SlideoutMenu({
|
|
33000
|
+
open,
|
|
33001
|
+
onClose,
|
|
33002
|
+
side = "right",
|
|
33003
|
+
size = "md",
|
|
33004
|
+
children,
|
|
33005
|
+
className,
|
|
33006
|
+
...rest
|
|
33007
|
+
}) {
|
|
33008
|
+
React28.useEffect(() => {
|
|
33009
|
+
if (!open) return;
|
|
33010
|
+
const handleKeyDown = (e) => {
|
|
33011
|
+
if (e.key === "Escape") onClose();
|
|
33012
|
+
};
|
|
33013
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
33014
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
33015
|
+
}, [open, onClose]);
|
|
33016
|
+
const handlePanelClick = (e) => e.stopPropagation();
|
|
33017
|
+
const closedTransform = side === "right" ? "translate-x-full" : "-translate-x-full";
|
|
33018
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
33019
|
+
"div",
|
|
33020
|
+
{
|
|
33021
|
+
onClick: onClose,
|
|
33022
|
+
"aria-hidden": !open,
|
|
33023
|
+
className: clsx_default(
|
|
33024
|
+
"fixed inset-0 z-50 bg-bg-overlay/70 backdrop-blur-sm transition-opacity duration-300",
|
|
33025
|
+
open ? "opacity-100" : "pointer-events-none opacity-0"
|
|
33026
|
+
),
|
|
33027
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33028
|
+
"div",
|
|
33029
|
+
{
|
|
33030
|
+
role: "dialog",
|
|
33031
|
+
"aria-modal": "true",
|
|
33032
|
+
onClick: handlePanelClick,
|
|
33033
|
+
className: clsx_default(
|
|
33034
|
+
"fixed bottom-0 top-0 flex w-full flex-col bg-bg-primary shadow-xl transition-transform duration-300 ease-in-out",
|
|
33035
|
+
side === "right" ? "right-0" : "left-0",
|
|
33036
|
+
sizeWidth[size],
|
|
33037
|
+
open ? "translate-x-0" : closedTransform,
|
|
33038
|
+
className
|
|
33039
|
+
),
|
|
33040
|
+
...rest,
|
|
33041
|
+
children
|
|
33042
|
+
}
|
|
33043
|
+
)
|
|
33044
|
+
}
|
|
33045
|
+
);
|
|
33046
|
+
}
|
|
32927
33047
|
var clampStep = (v, min3, max3, step) => {
|
|
32928
33048
|
const snapped = Math.round((v - min3) / step) * step + min3;
|
|
32929
33049
|
return Math.min(max3, Math.max(min3, snapped));
|
|
@@ -33821,6 +33941,7 @@ exports.MessageActionPanel = MessageActionPanel;
|
|
|
33821
33941
|
exports.MessageReaction = MessageReaction;
|
|
33822
33942
|
exports.MessageStatusIcon = MessageStatusIcon;
|
|
33823
33943
|
exports.MetricItem = MetricItem;
|
|
33944
|
+
exports.Modal = Modal;
|
|
33824
33945
|
exports.ModalActions = ModalActions;
|
|
33825
33946
|
exports.ModalHeader = ModalHeader;
|
|
33826
33947
|
exports.ModernBadge = ModernBadge;
|
|
@@ -33856,6 +33977,7 @@ exports.Select = Select;
|
|
|
33856
33977
|
exports.SelectMenuItem = SelectMenuItem;
|
|
33857
33978
|
exports.SidebarNavigation = SidebarNavigation;
|
|
33858
33979
|
exports.SlideOutMenuHeader = SlideOutMenuHeader;
|
|
33980
|
+
exports.SlideoutMenu = SlideoutMenu;
|
|
33859
33981
|
exports.Slider = Slider;
|
|
33860
33982
|
exports.SocialButton = SocialButton;
|
|
33861
33983
|
exports.StatusIcon = StatusIcon;
|
package/dist/index.d.cts
CHANGED
|
@@ -1589,6 +1589,28 @@ interface MetricItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
1589
1589
|
*/
|
|
1590
1590
|
declare function MetricItem({ label, value, change, changeText, icon, chart, action, onMenuClick, className, ...rest }: MetricItemProps): react.JSX.Element;
|
|
1591
1591
|
|
|
1592
|
+
type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
1593
|
+
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1594
|
+
/** Controls visibility — renders nothing when false. */
|
|
1595
|
+
open: boolean;
|
|
1596
|
+
/** Fired on backdrop click-outside, Escape, or the header's x-close. */
|
|
1597
|
+
onClose: () => void;
|
|
1598
|
+
/** Panel max-width: sm=400 / md=560 / lg=720 / xl=960 px. Full width on mobile. */
|
|
1599
|
+
size?: ModalSize;
|
|
1600
|
+
/** Modal contents — compose `ModalHeader`, a body, and `ModalActions` here. */
|
|
1601
|
+
children: ReactNode;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Modal shell — fixed backdrop + centred panel. Layout/overlay only: it does NOT
|
|
1605
|
+
* render a header or footer, those are composed as children (`ModalHeader` /
|
|
1606
|
+
* `ModalActions`). Backdrop click-outside and Escape both call `onClose`; clicks
|
|
1607
|
+
* inside the panel are stopped from bubbling. On open, focus moves into the panel
|
|
1608
|
+
* and is restored to the previously-focused element on close. If a direct
|
|
1609
|
+
* `ModalHeader` child is present its title is wired to `aria-labelledby`.
|
|
1610
|
+
* Renders `null` while `open` is false.
|
|
1611
|
+
*/
|
|
1612
|
+
declare function Modal({ open, onClose, size, children, className, ...rest }: ModalProps): react.JSX.Element | null;
|
|
1613
|
+
|
|
1592
1614
|
type ModalActionsType = "horizontal-fill" | "vertical-fill" | "right-aligned";
|
|
1593
1615
|
interface ModalActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1594
1616
|
/**
|
|
@@ -1628,13 +1650,15 @@ interface ModalHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">
|
|
|
1628
1650
|
divider?: boolean;
|
|
1629
1651
|
/** Renders an x-close button top-right when provided. */
|
|
1630
1652
|
onClose?: () => void;
|
|
1653
|
+
/** id placed on the title element so a parent `Modal` can wire `aria-labelledby`. */
|
|
1654
|
+
titleId?: string;
|
|
1631
1655
|
}
|
|
1632
1656
|
/**
|
|
1633
1657
|
* Modal header — featured-icon badge + title + supporting text, with an optional
|
|
1634
1658
|
* x-close button and bottom divider. `type` controls alignment (left / centred /
|
|
1635
1659
|
* icon-beside-text). The `icon` is a slot; consumer supplies the glyph.
|
|
1636
1660
|
*/
|
|
1637
|
-
declare function ModalHeader({ title, description, icon, type, divider, onClose, className, ...rest }: ModalHeaderProps): react.JSX.Element;
|
|
1661
|
+
declare function ModalHeader({ title, description, icon, type, divider, onClose, titleId, className, ...rest }: ModalHeaderProps): react.JSX.Element;
|
|
1638
1662
|
|
|
1639
1663
|
interface MultiSelectOption {
|
|
1640
1664
|
value: string;
|
|
@@ -2297,6 +2321,29 @@ interface SlideOutMenuHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "
|
|
|
2297
2321
|
*/
|
|
2298
2322
|
declare function SlideOutMenuHeader({ icon, title, supportingText, tabs, onClose, className, ...rest }: SlideOutMenuHeaderProps): react.JSX.Element;
|
|
2299
2323
|
|
|
2324
|
+
type SlideoutMenuSide = "right" | "left";
|
|
2325
|
+
type SlideoutMenuSize = "sm" | "md" | "lg";
|
|
2326
|
+
interface SlideoutMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2327
|
+
/** Controls visibility. The panel stays mounted to animate the slide in/out. */
|
|
2328
|
+
open: boolean;
|
|
2329
|
+
/** Fired on backdrop click-outside, Escape, or the header's x-close. */
|
|
2330
|
+
onClose: () => void;
|
|
2331
|
+
/** Edge the panel docks to and slides in from. */
|
|
2332
|
+
side?: SlideoutMenuSide;
|
|
2333
|
+
/** Panel width: sm=360 / md=480 / lg=600 px. Full width on mobile. */
|
|
2334
|
+
size?: SlideoutMenuSize;
|
|
2335
|
+
/** Drawer contents — compose `SlideOutMenuHeader`, a body, and a footer here. */
|
|
2336
|
+
children: ReactNode;
|
|
2337
|
+
}
|
|
2338
|
+
/**
|
|
2339
|
+
* Slide-out / drawer shell — fixed backdrop + edge-docked panel that slides in
|
|
2340
|
+
* from `side` via a `translate-x` transition. Layout/overlay only: the header is
|
|
2341
|
+
* composed as a child (`SlideOutMenuHeader`), not reimplemented. Backdrop
|
|
2342
|
+
* click-outside and Escape both call `onClose`. The panel stays mounted (toggled
|
|
2343
|
+
* via transform + the backdrop's pointer-events) so both enter and exit animate.
|
|
2344
|
+
*/
|
|
2345
|
+
declare function SlideoutMenu({ open, onClose, side, size, children, className, ...rest }: SlideoutMenuProps): react.JSX.Element;
|
|
2346
|
+
|
|
2300
2347
|
type SliderLabel = "none" | "bottom" | "topFloating";
|
|
2301
2348
|
interface SliderProps {
|
|
2302
2349
|
min?: number;
|
|
@@ -2712,4 +2759,4 @@ declare namespace index {
|
|
|
2712
2759
|
export { index_BoxIllustration as BoxIllustration, index_CloudIllustration as CloudIllustration, index_CreditCardIllustration as CreditCardIllustration, index_DocumentsIllustration as DocumentsIllustration };
|
|
2713
2760
|
}
|
|
2714
2761
|
|
|
2715
|
-
export { ActivityFeed, type ActivityFeedDivider, type ActivityFeedProps, ActivityGauge, type ActivityGaugeLegend, type ActivityGaugeProps, type ActivityGaugeSeries, type ActivityGaugeSize, AdvancedFilterBar, type AdvancedFilterBarProps, Alert, type AlertAction, type AlertColor, type AlertProps, type AlertSize, Avatar, AvatarAddButton, type AvatarAddButtonProps, type AvatarAddButtonSize, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarGroupSize, AvatarLabelGroup, type AvatarLabelGroupProps, type AvatarLabelGroupSize, AvatarProfilePhoto, type AvatarProfilePhotoProps, type AvatarProfilePhotoSize, type AvatarProps, type AvatarSize, BadgeCloseX, type BadgeCloseXProps, type BadgeCloseXShape, type BadgeColor, type BadgeCommonProps, BadgeGroup, type BadgeGroupBadgePosition, type BadgeGroupProps, type BadgeGroupSize, type BadgeGroupType, type BadgeSize, BreadcrumbButtonBase, type BreadcrumbButtonBaseProps, type BreadcrumbButtonType, Breadcrumbs, type BreadcrumbsDivider, type BreadcrumbsProps, Button, ButtonCloseX, type ButtonCloseXProps, type ButtonCloseXSize, ButtonDestructive, type ButtonDestructiveHierarchy, type ButtonDestructiveProps, type ButtonDestructiveSize, ButtonGroup, type ButtonGroupProps, ButtonGroupSegment, type ButtonGroupSegmentProps, type ButtonGroupSegmentSize, type ButtonProps, ButtonUtility, type ButtonUtilityProps, type ButtonUtilitySize, type ButtonUtilityVariant, CalendarCell, CalendarCellDayWeekView, type CalendarCellDayWeekViewProps, type CalendarCellProps, CalendarColumnHeader, type CalendarColumnHeaderOrientation, type CalendarColumnHeaderProps, CalendarDateIcon, type CalendarDateIconProps, CalendarEvent, type CalendarEventColor, CalendarEventDayWeekView, type CalendarEventDayWeekViewProps, type CalendarEventProps, CalendarHeader, type CalendarHeaderProps, CalendarRowLabel, type CalendarRowLabelProps, CalendarTimemarker, type CalendarTimemarkerAlign, type CalendarTimemarkerProps, type CalendarView, CalendarViewDropdown, type CalendarViewDropdownProps, type CalendarViewOption, CardHeader, type CardHeaderProps, CarouselArrow, type CarouselArrowDirection, type CarouselArrowProps, type CarouselArrowSize, CarouselImage, type CarouselImageProps, Change, type ChangeProps, type ChangeTrend, type ChangeType, ChartLegend, type ChartLegendItem, type ChartLegendPosition, type ChartLegendProps, ChartMarker, type ChartMarkerLine, type ChartMarkerProps, ChartMini, type ChartMiniDatum, type ChartMiniProps, type ChartMiniTrend, type ChartSeries, type ChartStyle, ChartTooltip, type ChartTooltipPayloadItem, type ChartTooltipProps, type CheckControlSize, Checkbox, type CheckboxProps, CodeSnippet, type CodeSnippetProps, CodeSnippetTabs, type CodeSnippetTabsProps, ColorBadge, type ColorBadgeProps, CommandBar, CommandBarFooter, type CommandBarFooterHint, type CommandBarFooterProps, CommandBarMenuSection, type CommandBarMenuSectionProps, CommandBarNavigationIcon, type CommandBarNavigationIconProps, type CommandBarProps, CommandDropdownMenuItem, type CommandDropdownMenuItemProps, CommandInput, type CommandInputProps, CommandShortcut, type CommandShortcutProps, ContentDivider, type ContentDividerProps, type ContentDividerStyle, type ContentDividerType, ContentFeatureText, type ContentFeatureTextProps, type ContentFeatureTextSize, ContentHeading, type ContentHeadingProps, type ContentHeadingSize, ContentParagraph, type ContentParagraphProps, type ContentParagraphSize, ContentQuote, type ContentQuoteAlign, type ContentQuoteProps, type ContentQuoteSize, ContentRule, type ContentRuleProps, type ContentRuleSize, ContextMenu, type ContextMenuProps, type ContextMenuState, DatePickerCell, type DatePickerCellProps, type DatePickerCellType, DatePickerListItem, type DatePickerListItemProps, DatePickerMenu, type DatePickerMenuProps, DropdownAccountListItem, type DropdownAccountListItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, type DropdownMenuFooterType, DropdownMenuHeader, type DropdownMenuHeaderProps, type DropdownMenuHeaderType, DropdownMenuItemInsetIcon, type DropdownMenuItemInsetIconProps, type DropdownMenuItemInsetIconType, DropdownMenuListItem, type DropdownMenuListItemProps, EmptyState, type EmptyStateProps, type EmptyStateSize, FeedItemBase, type FeedItemBaseProps, type FeedItemSize, FileUpload, FileUploadBase, type FileUploadBaseProps, FileUploadItemBase, type FileUploadItemBaseProps, type FileUploadItemIconType, type FileUploadItemStatus, type FileUploadItemType, type FileUploadProps, FilterBar, type FilterBarProps, FilterTabs, type FilterTabsProps, FiltersDropdownMenu, type FiltersDropdownMenuProps, FiltersSlideoutMenu, type FiltersSlideoutMenuProps, type HeaderNavItem, HeaderNavigation, type HeaderNavigationProps, type HeaderNavigationType, HelpIcon, type HelpIconProps, InputField, type InputFieldProps, type InputFieldSize, type InputFieldType, LeadingInputField, type LeadingInputFieldProps, LineAndBarChart, type LineAndBarChartProps, LinkMessage, type LinkMessageProps, type LinkMessageType, LoadingIndicator, type LoadingIndicatorProps, type LoadingIndicatorSize, type LoadingIndicatorStyle, MediaMessage, type MediaMessageProps, type MediaMessageType, MegaInputFieldBase, type MegaInputFieldBaseProps, type MegaInputFieldBaseSize, Message, MessageAction, MessageActionButton, type MessageActionButtonProps, MessageActionPanel, type MessageActionPanelProps, type MessageActionProps, type MessageActionType, type MessageBubbleTone, type MessageProps, MessageReaction, type MessageReactionProps, type MessageStatus, MessageStatusIcon, type MessageStatusIconProps, type MessageType, MetricItem, type MetricItemProps, ModalActions, type ModalActionsProps, type ModalActionsType, ModalHeader, type ModalHeaderProps, type ModalHeaderType, ModernBadge, type ModernBadgeProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NavAccountCard, NavAccountCardMenuItem, type NavAccountCardMenuItemProps, type NavAccountCardMenuItemType, type NavAccountCardProps, type NavAccountCardVariant, NavButton, type NavButtonProps, NavFeaturedCard, type NavFeaturedCardProps, NavItemBase, type NavItemBaseProps, NavItemDropdownBase, type NavItemDropdownBaseProps, NavMenuButton, type NavMenuButtonProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputLayout, type NumberInputProps, PageHeader, type PageHeaderProps, type PageHeaderStyle, Pagination, PaginationButtonGroupBase, type PaginationButtonGroupBaseProps, type PaginationButtonGroupType, PaginationCards, type PaginationCardsProps, type PaginationCardsVariant, PaginationDotGroup, type PaginationDotGroupProps, PaginationDotIndicator, type PaginationDotIndicatorProps, type PaginationDotSize, type PaginationDotVariant, PaginationNumberBase, type PaginationNumberBaseProps, type PaginationNumberShape, type PaginationProps, type PaginationType, PieChart, type PieChartProps, type PieChartSize, type PieSlice, PillBadge, type PillBadgeProps, ProgressBar, type ProgressBarLabel, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, type ProgressCircleShape, type ProgressCircleSize, RadarChart, type RadarChartProps, type RadarLegendPosition, Radio, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupItemSize, type RadioGroupItemType, type RadioGroupProps, type RadioProps, SectionFooter, type SectionFooterProps, type SectionFooterType, SectionHeader, type SectionHeaderProps, SectionLabel, type SectionLabelProps, type SectionLabelSize, Select, SelectMenuItem, type SelectMenuItemProps, type SelectMenuItemSize, type SelectProps, type SelectSize, type SelectType, SidebarNavigation, type SidebarNavigationProps, type SidebarNavigationType, SlideOutMenuHeader, type SlideOutMenuHeaderProps, Slider, type SliderLabel, type SliderProps, type SocialBrand, SocialButton, type SocialButtonProps, type SocialButtonSize, type SocialButtonTheme, StatusIcon, type StatusIconProps, type StatusIconType, StepBase, type StepBaseProps, StepIconBase, type StepIconBaseProps, type StepIconSize, type StepIconType, type StepOrientation, type StepStatus, TabButtonBase, type TabButtonBaseProps, type TabButtonSize, type TabButtonType, type TabItem, TableCell, type TableCellProps, type TableCellSize, TableHeaderCell, type TableHeaderCellProps, type TableHeaderCellSize, TableHeaderLabel, type TableHeaderLabelArrow, type TableHeaderLabelProps, Tabs, type TabsOrientation, type TabsProps, Tag, type TagProps, type TagSize, TagsInputField, type TagsInputFieldProps, type TagsInputVariant, TextEditorToolbar, TextEditorToolbarDivider, type TextEditorToolbarProps, TextEditorTooltip, type TextEditorTooltipProps, TextareaInputField, type TextareaInputFieldProps, Toggle, type ToggleProps, type ToggleSize, type ToggleType, Tooltip, type TooltipArrow, type TooltipProps, TrailingInputField, type TrailingInputFieldProps, type TreeNode, TreeView, TreeViewConnector, type TreeViewConnectorProps, type TreeViewConnectorSize, type TreeViewConnectorType, TreeViewItem, type TreeViewItemProps, type TreeViewItemSize, type TreeViewProps, type UseContextMenuReturn, type VerificationCodeDigits, VerificationCodeInput, type VerificationCodeInputProps, type VerificationCodeSize, index as illustrations, useContextMenu };
|
|
2762
|
+
export { ActivityFeed, type ActivityFeedDivider, type ActivityFeedProps, ActivityGauge, type ActivityGaugeLegend, type ActivityGaugeProps, type ActivityGaugeSeries, type ActivityGaugeSize, AdvancedFilterBar, type AdvancedFilterBarProps, Alert, type AlertAction, type AlertColor, type AlertProps, type AlertSize, Avatar, AvatarAddButton, type AvatarAddButtonProps, type AvatarAddButtonSize, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarGroupSize, AvatarLabelGroup, type AvatarLabelGroupProps, type AvatarLabelGroupSize, AvatarProfilePhoto, type AvatarProfilePhotoProps, type AvatarProfilePhotoSize, type AvatarProps, type AvatarSize, BadgeCloseX, type BadgeCloseXProps, type BadgeCloseXShape, type BadgeColor, type BadgeCommonProps, BadgeGroup, type BadgeGroupBadgePosition, type BadgeGroupProps, type BadgeGroupSize, type BadgeGroupType, type BadgeSize, BreadcrumbButtonBase, type BreadcrumbButtonBaseProps, type BreadcrumbButtonType, Breadcrumbs, type BreadcrumbsDivider, type BreadcrumbsProps, Button, ButtonCloseX, type ButtonCloseXProps, type ButtonCloseXSize, ButtonDestructive, type ButtonDestructiveHierarchy, type ButtonDestructiveProps, type ButtonDestructiveSize, ButtonGroup, type ButtonGroupProps, ButtonGroupSegment, type ButtonGroupSegmentProps, type ButtonGroupSegmentSize, type ButtonProps, ButtonUtility, type ButtonUtilityProps, type ButtonUtilitySize, type ButtonUtilityVariant, CalendarCell, CalendarCellDayWeekView, type CalendarCellDayWeekViewProps, type CalendarCellProps, CalendarColumnHeader, type CalendarColumnHeaderOrientation, type CalendarColumnHeaderProps, CalendarDateIcon, type CalendarDateIconProps, CalendarEvent, type CalendarEventColor, CalendarEventDayWeekView, type CalendarEventDayWeekViewProps, type CalendarEventProps, CalendarHeader, type CalendarHeaderProps, CalendarRowLabel, type CalendarRowLabelProps, CalendarTimemarker, type CalendarTimemarkerAlign, type CalendarTimemarkerProps, type CalendarView, CalendarViewDropdown, type CalendarViewDropdownProps, type CalendarViewOption, CardHeader, type CardHeaderProps, CarouselArrow, type CarouselArrowDirection, type CarouselArrowProps, type CarouselArrowSize, CarouselImage, type CarouselImageProps, Change, type ChangeProps, type ChangeTrend, type ChangeType, ChartLegend, type ChartLegendItem, type ChartLegendPosition, type ChartLegendProps, ChartMarker, type ChartMarkerLine, type ChartMarkerProps, ChartMini, type ChartMiniDatum, type ChartMiniProps, type ChartMiniTrend, type ChartSeries, type ChartStyle, ChartTooltip, type ChartTooltipPayloadItem, type ChartTooltipProps, type CheckControlSize, Checkbox, type CheckboxProps, CodeSnippet, type CodeSnippetProps, CodeSnippetTabs, type CodeSnippetTabsProps, ColorBadge, type ColorBadgeProps, CommandBar, CommandBarFooter, type CommandBarFooterHint, type CommandBarFooterProps, CommandBarMenuSection, type CommandBarMenuSectionProps, CommandBarNavigationIcon, type CommandBarNavigationIconProps, type CommandBarProps, CommandDropdownMenuItem, type CommandDropdownMenuItemProps, CommandInput, type CommandInputProps, CommandShortcut, type CommandShortcutProps, ContentDivider, type ContentDividerProps, type ContentDividerStyle, type ContentDividerType, ContentFeatureText, type ContentFeatureTextProps, type ContentFeatureTextSize, ContentHeading, type ContentHeadingProps, type ContentHeadingSize, ContentParagraph, type ContentParagraphProps, type ContentParagraphSize, ContentQuote, type ContentQuoteAlign, type ContentQuoteProps, type ContentQuoteSize, ContentRule, type ContentRuleProps, type ContentRuleSize, ContextMenu, type ContextMenuProps, type ContextMenuState, DatePickerCell, type DatePickerCellProps, type DatePickerCellType, DatePickerListItem, type DatePickerListItemProps, DatePickerMenu, type DatePickerMenuProps, DropdownAccountListItem, type DropdownAccountListItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, type DropdownMenuFooterType, DropdownMenuHeader, type DropdownMenuHeaderProps, type DropdownMenuHeaderType, DropdownMenuItemInsetIcon, type DropdownMenuItemInsetIconProps, type DropdownMenuItemInsetIconType, DropdownMenuListItem, type DropdownMenuListItemProps, EmptyState, type EmptyStateProps, type EmptyStateSize, FeedItemBase, type FeedItemBaseProps, type FeedItemSize, FileUpload, FileUploadBase, type FileUploadBaseProps, FileUploadItemBase, type FileUploadItemBaseProps, type FileUploadItemIconType, type FileUploadItemStatus, type FileUploadItemType, type FileUploadProps, FilterBar, type FilterBarProps, FilterTabs, type FilterTabsProps, FiltersDropdownMenu, type FiltersDropdownMenuProps, FiltersSlideoutMenu, type FiltersSlideoutMenuProps, type HeaderNavItem, HeaderNavigation, type HeaderNavigationProps, type HeaderNavigationType, HelpIcon, type HelpIconProps, InputField, type InputFieldProps, type InputFieldSize, type InputFieldType, LeadingInputField, type LeadingInputFieldProps, LineAndBarChart, type LineAndBarChartProps, LinkMessage, type LinkMessageProps, type LinkMessageType, LoadingIndicator, type LoadingIndicatorProps, type LoadingIndicatorSize, type LoadingIndicatorStyle, MediaMessage, type MediaMessageProps, type MediaMessageType, MegaInputFieldBase, type MegaInputFieldBaseProps, type MegaInputFieldBaseSize, Message, MessageAction, MessageActionButton, type MessageActionButtonProps, MessageActionPanel, type MessageActionPanelProps, type MessageActionProps, type MessageActionType, type MessageBubbleTone, type MessageProps, MessageReaction, type MessageReactionProps, type MessageStatus, MessageStatusIcon, type MessageStatusIconProps, type MessageType, MetricItem, type MetricItemProps, Modal, ModalActions, type ModalActionsProps, type ModalActionsType, ModalHeader, type ModalHeaderProps, type ModalHeaderType, type ModalProps, type ModalSize, ModernBadge, type ModernBadgeProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NavAccountCard, NavAccountCardMenuItem, type NavAccountCardMenuItemProps, type NavAccountCardMenuItemType, type NavAccountCardProps, type NavAccountCardVariant, NavButton, type NavButtonProps, NavFeaturedCard, type NavFeaturedCardProps, NavItemBase, type NavItemBaseProps, NavItemDropdownBase, type NavItemDropdownBaseProps, NavMenuButton, type NavMenuButtonProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputLayout, type NumberInputProps, PageHeader, type PageHeaderProps, type PageHeaderStyle, Pagination, PaginationButtonGroupBase, type PaginationButtonGroupBaseProps, type PaginationButtonGroupType, PaginationCards, type PaginationCardsProps, type PaginationCardsVariant, PaginationDotGroup, type PaginationDotGroupProps, PaginationDotIndicator, type PaginationDotIndicatorProps, type PaginationDotSize, type PaginationDotVariant, PaginationNumberBase, type PaginationNumberBaseProps, type PaginationNumberShape, type PaginationProps, type PaginationType, PieChart, type PieChartProps, type PieChartSize, type PieSlice, PillBadge, type PillBadgeProps, ProgressBar, type ProgressBarLabel, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, type ProgressCircleShape, type ProgressCircleSize, RadarChart, type RadarChartProps, type RadarLegendPosition, Radio, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupItemSize, type RadioGroupItemType, type RadioGroupProps, type RadioProps, SectionFooter, type SectionFooterProps, type SectionFooterType, SectionHeader, type SectionHeaderProps, SectionLabel, type SectionLabelProps, type SectionLabelSize, Select, SelectMenuItem, type SelectMenuItemProps, type SelectMenuItemSize, type SelectProps, type SelectSize, type SelectType, SidebarNavigation, type SidebarNavigationProps, type SidebarNavigationType, SlideOutMenuHeader, type SlideOutMenuHeaderProps, SlideoutMenu, type SlideoutMenuProps, type SlideoutMenuSide, type SlideoutMenuSize, Slider, type SliderLabel, type SliderProps, type SocialBrand, SocialButton, type SocialButtonProps, type SocialButtonSize, type SocialButtonTheme, StatusIcon, type StatusIconProps, type StatusIconType, StepBase, type StepBaseProps, StepIconBase, type StepIconBaseProps, type StepIconSize, type StepIconType, type StepOrientation, type StepStatus, TabButtonBase, type TabButtonBaseProps, type TabButtonSize, type TabButtonType, type TabItem, TableCell, type TableCellProps, type TableCellSize, TableHeaderCell, type TableHeaderCellProps, type TableHeaderCellSize, TableHeaderLabel, type TableHeaderLabelArrow, type TableHeaderLabelProps, Tabs, type TabsOrientation, type TabsProps, Tag, type TagProps, type TagSize, TagsInputField, type TagsInputFieldProps, type TagsInputVariant, TextEditorToolbar, TextEditorToolbarDivider, type TextEditorToolbarProps, TextEditorTooltip, type TextEditorTooltipProps, TextareaInputField, type TextareaInputFieldProps, Toggle, type ToggleProps, type ToggleSize, type ToggleType, Tooltip, type TooltipArrow, type TooltipProps, TrailingInputField, type TrailingInputFieldProps, type TreeNode, TreeView, TreeViewConnector, type TreeViewConnectorProps, type TreeViewConnectorSize, type TreeViewConnectorType, TreeViewItem, type TreeViewItemProps, type TreeViewItemSize, type TreeViewProps, type UseContextMenuReturn, type VerificationCodeDigits, VerificationCodeInput, type VerificationCodeInputProps, type VerificationCodeSize, index as illustrations, useContextMenu };
|
package/dist/index.d.ts
CHANGED
|
@@ -1589,6 +1589,28 @@ interface MetricItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
1589
1589
|
*/
|
|
1590
1590
|
declare function MetricItem({ label, value, change, changeText, icon, chart, action, onMenuClick, className, ...rest }: MetricItemProps): react.JSX.Element;
|
|
1591
1591
|
|
|
1592
|
+
type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
1593
|
+
interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
1594
|
+
/** Controls visibility — renders nothing when false. */
|
|
1595
|
+
open: boolean;
|
|
1596
|
+
/** Fired on backdrop click-outside, Escape, or the header's x-close. */
|
|
1597
|
+
onClose: () => void;
|
|
1598
|
+
/** Panel max-width: sm=400 / md=560 / lg=720 / xl=960 px. Full width on mobile. */
|
|
1599
|
+
size?: ModalSize;
|
|
1600
|
+
/** Modal contents — compose `ModalHeader`, a body, and `ModalActions` here. */
|
|
1601
|
+
children: ReactNode;
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1604
|
+
* Modal shell — fixed backdrop + centred panel. Layout/overlay only: it does NOT
|
|
1605
|
+
* render a header or footer, those are composed as children (`ModalHeader` /
|
|
1606
|
+
* `ModalActions`). Backdrop click-outside and Escape both call `onClose`; clicks
|
|
1607
|
+
* inside the panel are stopped from bubbling. On open, focus moves into the panel
|
|
1608
|
+
* and is restored to the previously-focused element on close. If a direct
|
|
1609
|
+
* `ModalHeader` child is present its title is wired to `aria-labelledby`.
|
|
1610
|
+
* Renders `null` while `open` is false.
|
|
1611
|
+
*/
|
|
1612
|
+
declare function Modal({ open, onClose, size, children, className, ...rest }: ModalProps): react.JSX.Element | null;
|
|
1613
|
+
|
|
1592
1614
|
type ModalActionsType = "horizontal-fill" | "vertical-fill" | "right-aligned";
|
|
1593
1615
|
interface ModalActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
1594
1616
|
/**
|
|
@@ -1628,13 +1650,15 @@ interface ModalHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">
|
|
|
1628
1650
|
divider?: boolean;
|
|
1629
1651
|
/** Renders an x-close button top-right when provided. */
|
|
1630
1652
|
onClose?: () => void;
|
|
1653
|
+
/** id placed on the title element so a parent `Modal` can wire `aria-labelledby`. */
|
|
1654
|
+
titleId?: string;
|
|
1631
1655
|
}
|
|
1632
1656
|
/**
|
|
1633
1657
|
* Modal header — featured-icon badge + title + supporting text, with an optional
|
|
1634
1658
|
* x-close button and bottom divider. `type` controls alignment (left / centred /
|
|
1635
1659
|
* icon-beside-text). The `icon` is a slot; consumer supplies the glyph.
|
|
1636
1660
|
*/
|
|
1637
|
-
declare function ModalHeader({ title, description, icon, type, divider, onClose, className, ...rest }: ModalHeaderProps): react.JSX.Element;
|
|
1661
|
+
declare function ModalHeader({ title, description, icon, type, divider, onClose, titleId, className, ...rest }: ModalHeaderProps): react.JSX.Element;
|
|
1638
1662
|
|
|
1639
1663
|
interface MultiSelectOption {
|
|
1640
1664
|
value: string;
|
|
@@ -2297,6 +2321,29 @@ interface SlideOutMenuHeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, "
|
|
|
2297
2321
|
*/
|
|
2298
2322
|
declare function SlideOutMenuHeader({ icon, title, supportingText, tabs, onClose, className, ...rest }: SlideOutMenuHeaderProps): react.JSX.Element;
|
|
2299
2323
|
|
|
2324
|
+
type SlideoutMenuSide = "right" | "left";
|
|
2325
|
+
type SlideoutMenuSize = "sm" | "md" | "lg";
|
|
2326
|
+
interface SlideoutMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
2327
|
+
/** Controls visibility. The panel stays mounted to animate the slide in/out. */
|
|
2328
|
+
open: boolean;
|
|
2329
|
+
/** Fired on backdrop click-outside, Escape, or the header's x-close. */
|
|
2330
|
+
onClose: () => void;
|
|
2331
|
+
/** Edge the panel docks to and slides in from. */
|
|
2332
|
+
side?: SlideoutMenuSide;
|
|
2333
|
+
/** Panel width: sm=360 / md=480 / lg=600 px. Full width on mobile. */
|
|
2334
|
+
size?: SlideoutMenuSize;
|
|
2335
|
+
/** Drawer contents — compose `SlideOutMenuHeader`, a body, and a footer here. */
|
|
2336
|
+
children: ReactNode;
|
|
2337
|
+
}
|
|
2338
|
+
/**
|
|
2339
|
+
* Slide-out / drawer shell — fixed backdrop + edge-docked panel that slides in
|
|
2340
|
+
* from `side` via a `translate-x` transition. Layout/overlay only: the header is
|
|
2341
|
+
* composed as a child (`SlideOutMenuHeader`), not reimplemented. Backdrop
|
|
2342
|
+
* click-outside and Escape both call `onClose`. The panel stays mounted (toggled
|
|
2343
|
+
* via transform + the backdrop's pointer-events) so both enter and exit animate.
|
|
2344
|
+
*/
|
|
2345
|
+
declare function SlideoutMenu({ open, onClose, side, size, children, className, ...rest }: SlideoutMenuProps): react.JSX.Element;
|
|
2346
|
+
|
|
2300
2347
|
type SliderLabel = "none" | "bottom" | "topFloating";
|
|
2301
2348
|
interface SliderProps {
|
|
2302
2349
|
min?: number;
|
|
@@ -2712,4 +2759,4 @@ declare namespace index {
|
|
|
2712
2759
|
export { index_BoxIllustration as BoxIllustration, index_CloudIllustration as CloudIllustration, index_CreditCardIllustration as CreditCardIllustration, index_DocumentsIllustration as DocumentsIllustration };
|
|
2713
2760
|
}
|
|
2714
2761
|
|
|
2715
|
-
export { ActivityFeed, type ActivityFeedDivider, type ActivityFeedProps, ActivityGauge, type ActivityGaugeLegend, type ActivityGaugeProps, type ActivityGaugeSeries, type ActivityGaugeSize, AdvancedFilterBar, type AdvancedFilterBarProps, Alert, type AlertAction, type AlertColor, type AlertProps, type AlertSize, Avatar, AvatarAddButton, type AvatarAddButtonProps, type AvatarAddButtonSize, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarGroupSize, AvatarLabelGroup, type AvatarLabelGroupProps, type AvatarLabelGroupSize, AvatarProfilePhoto, type AvatarProfilePhotoProps, type AvatarProfilePhotoSize, type AvatarProps, type AvatarSize, BadgeCloseX, type BadgeCloseXProps, type BadgeCloseXShape, type BadgeColor, type BadgeCommonProps, BadgeGroup, type BadgeGroupBadgePosition, type BadgeGroupProps, type BadgeGroupSize, type BadgeGroupType, type BadgeSize, BreadcrumbButtonBase, type BreadcrumbButtonBaseProps, type BreadcrumbButtonType, Breadcrumbs, type BreadcrumbsDivider, type BreadcrumbsProps, Button, ButtonCloseX, type ButtonCloseXProps, type ButtonCloseXSize, ButtonDestructive, type ButtonDestructiveHierarchy, type ButtonDestructiveProps, type ButtonDestructiveSize, ButtonGroup, type ButtonGroupProps, ButtonGroupSegment, type ButtonGroupSegmentProps, type ButtonGroupSegmentSize, type ButtonProps, ButtonUtility, type ButtonUtilityProps, type ButtonUtilitySize, type ButtonUtilityVariant, CalendarCell, CalendarCellDayWeekView, type CalendarCellDayWeekViewProps, type CalendarCellProps, CalendarColumnHeader, type CalendarColumnHeaderOrientation, type CalendarColumnHeaderProps, CalendarDateIcon, type CalendarDateIconProps, CalendarEvent, type CalendarEventColor, CalendarEventDayWeekView, type CalendarEventDayWeekViewProps, type CalendarEventProps, CalendarHeader, type CalendarHeaderProps, CalendarRowLabel, type CalendarRowLabelProps, CalendarTimemarker, type CalendarTimemarkerAlign, type CalendarTimemarkerProps, type CalendarView, CalendarViewDropdown, type CalendarViewDropdownProps, type CalendarViewOption, CardHeader, type CardHeaderProps, CarouselArrow, type CarouselArrowDirection, type CarouselArrowProps, type CarouselArrowSize, CarouselImage, type CarouselImageProps, Change, type ChangeProps, type ChangeTrend, type ChangeType, ChartLegend, type ChartLegendItem, type ChartLegendPosition, type ChartLegendProps, ChartMarker, type ChartMarkerLine, type ChartMarkerProps, ChartMini, type ChartMiniDatum, type ChartMiniProps, type ChartMiniTrend, type ChartSeries, type ChartStyle, ChartTooltip, type ChartTooltipPayloadItem, type ChartTooltipProps, type CheckControlSize, Checkbox, type CheckboxProps, CodeSnippet, type CodeSnippetProps, CodeSnippetTabs, type CodeSnippetTabsProps, ColorBadge, type ColorBadgeProps, CommandBar, CommandBarFooter, type CommandBarFooterHint, type CommandBarFooterProps, CommandBarMenuSection, type CommandBarMenuSectionProps, CommandBarNavigationIcon, type CommandBarNavigationIconProps, type CommandBarProps, CommandDropdownMenuItem, type CommandDropdownMenuItemProps, CommandInput, type CommandInputProps, CommandShortcut, type CommandShortcutProps, ContentDivider, type ContentDividerProps, type ContentDividerStyle, type ContentDividerType, ContentFeatureText, type ContentFeatureTextProps, type ContentFeatureTextSize, ContentHeading, type ContentHeadingProps, type ContentHeadingSize, ContentParagraph, type ContentParagraphProps, type ContentParagraphSize, ContentQuote, type ContentQuoteAlign, type ContentQuoteProps, type ContentQuoteSize, ContentRule, type ContentRuleProps, type ContentRuleSize, ContextMenu, type ContextMenuProps, type ContextMenuState, DatePickerCell, type DatePickerCellProps, type DatePickerCellType, DatePickerListItem, type DatePickerListItemProps, DatePickerMenu, type DatePickerMenuProps, DropdownAccountListItem, type DropdownAccountListItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, type DropdownMenuFooterType, DropdownMenuHeader, type DropdownMenuHeaderProps, type DropdownMenuHeaderType, DropdownMenuItemInsetIcon, type DropdownMenuItemInsetIconProps, type DropdownMenuItemInsetIconType, DropdownMenuListItem, type DropdownMenuListItemProps, EmptyState, type EmptyStateProps, type EmptyStateSize, FeedItemBase, type FeedItemBaseProps, type FeedItemSize, FileUpload, FileUploadBase, type FileUploadBaseProps, FileUploadItemBase, type FileUploadItemBaseProps, type FileUploadItemIconType, type FileUploadItemStatus, type FileUploadItemType, type FileUploadProps, FilterBar, type FilterBarProps, FilterTabs, type FilterTabsProps, FiltersDropdownMenu, type FiltersDropdownMenuProps, FiltersSlideoutMenu, type FiltersSlideoutMenuProps, type HeaderNavItem, HeaderNavigation, type HeaderNavigationProps, type HeaderNavigationType, HelpIcon, type HelpIconProps, InputField, type InputFieldProps, type InputFieldSize, type InputFieldType, LeadingInputField, type LeadingInputFieldProps, LineAndBarChart, type LineAndBarChartProps, LinkMessage, type LinkMessageProps, type LinkMessageType, LoadingIndicator, type LoadingIndicatorProps, type LoadingIndicatorSize, type LoadingIndicatorStyle, MediaMessage, type MediaMessageProps, type MediaMessageType, MegaInputFieldBase, type MegaInputFieldBaseProps, type MegaInputFieldBaseSize, Message, MessageAction, MessageActionButton, type MessageActionButtonProps, MessageActionPanel, type MessageActionPanelProps, type MessageActionProps, type MessageActionType, type MessageBubbleTone, type MessageProps, MessageReaction, type MessageReactionProps, type MessageStatus, MessageStatusIcon, type MessageStatusIconProps, type MessageType, MetricItem, type MetricItemProps, ModalActions, type ModalActionsProps, type ModalActionsType, ModalHeader, type ModalHeaderProps, type ModalHeaderType, ModernBadge, type ModernBadgeProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NavAccountCard, NavAccountCardMenuItem, type NavAccountCardMenuItemProps, type NavAccountCardMenuItemType, type NavAccountCardProps, type NavAccountCardVariant, NavButton, type NavButtonProps, NavFeaturedCard, type NavFeaturedCardProps, NavItemBase, type NavItemBaseProps, NavItemDropdownBase, type NavItemDropdownBaseProps, NavMenuButton, type NavMenuButtonProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputLayout, type NumberInputProps, PageHeader, type PageHeaderProps, type PageHeaderStyle, Pagination, PaginationButtonGroupBase, type PaginationButtonGroupBaseProps, type PaginationButtonGroupType, PaginationCards, type PaginationCardsProps, type PaginationCardsVariant, PaginationDotGroup, type PaginationDotGroupProps, PaginationDotIndicator, type PaginationDotIndicatorProps, type PaginationDotSize, type PaginationDotVariant, PaginationNumberBase, type PaginationNumberBaseProps, type PaginationNumberShape, type PaginationProps, type PaginationType, PieChart, type PieChartProps, type PieChartSize, type PieSlice, PillBadge, type PillBadgeProps, ProgressBar, type ProgressBarLabel, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, type ProgressCircleShape, type ProgressCircleSize, RadarChart, type RadarChartProps, type RadarLegendPosition, Radio, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupItemSize, type RadioGroupItemType, type RadioGroupProps, type RadioProps, SectionFooter, type SectionFooterProps, type SectionFooterType, SectionHeader, type SectionHeaderProps, SectionLabel, type SectionLabelProps, type SectionLabelSize, Select, SelectMenuItem, type SelectMenuItemProps, type SelectMenuItemSize, type SelectProps, type SelectSize, type SelectType, SidebarNavigation, type SidebarNavigationProps, type SidebarNavigationType, SlideOutMenuHeader, type SlideOutMenuHeaderProps, Slider, type SliderLabel, type SliderProps, type SocialBrand, SocialButton, type SocialButtonProps, type SocialButtonSize, type SocialButtonTheme, StatusIcon, type StatusIconProps, type StatusIconType, StepBase, type StepBaseProps, StepIconBase, type StepIconBaseProps, type StepIconSize, type StepIconType, type StepOrientation, type StepStatus, TabButtonBase, type TabButtonBaseProps, type TabButtonSize, type TabButtonType, type TabItem, TableCell, type TableCellProps, type TableCellSize, TableHeaderCell, type TableHeaderCellProps, type TableHeaderCellSize, TableHeaderLabel, type TableHeaderLabelArrow, type TableHeaderLabelProps, Tabs, type TabsOrientation, type TabsProps, Tag, type TagProps, type TagSize, TagsInputField, type TagsInputFieldProps, type TagsInputVariant, TextEditorToolbar, TextEditorToolbarDivider, type TextEditorToolbarProps, TextEditorTooltip, type TextEditorTooltipProps, TextareaInputField, type TextareaInputFieldProps, Toggle, type ToggleProps, type ToggleSize, type ToggleType, Tooltip, type TooltipArrow, type TooltipProps, TrailingInputField, type TrailingInputFieldProps, type TreeNode, TreeView, TreeViewConnector, type TreeViewConnectorProps, type TreeViewConnectorSize, type TreeViewConnectorType, TreeViewItem, type TreeViewItemProps, type TreeViewItemSize, type TreeViewProps, type UseContextMenuReturn, type VerificationCodeDigits, VerificationCodeInput, type VerificationCodeInputProps, type VerificationCodeSize, index as illustrations, useContextMenu };
|
|
2762
|
+
export { ActivityFeed, type ActivityFeedDivider, type ActivityFeedProps, ActivityGauge, type ActivityGaugeLegend, type ActivityGaugeProps, type ActivityGaugeSeries, type ActivityGaugeSize, AdvancedFilterBar, type AdvancedFilterBarProps, Alert, type AlertAction, type AlertColor, type AlertProps, type AlertSize, Avatar, AvatarAddButton, type AvatarAddButtonProps, type AvatarAddButtonSize, AvatarGroup, type AvatarGroupItem, type AvatarGroupProps, type AvatarGroupSize, AvatarLabelGroup, type AvatarLabelGroupProps, type AvatarLabelGroupSize, AvatarProfilePhoto, type AvatarProfilePhotoProps, type AvatarProfilePhotoSize, type AvatarProps, type AvatarSize, BadgeCloseX, type BadgeCloseXProps, type BadgeCloseXShape, type BadgeColor, type BadgeCommonProps, BadgeGroup, type BadgeGroupBadgePosition, type BadgeGroupProps, type BadgeGroupSize, type BadgeGroupType, type BadgeSize, BreadcrumbButtonBase, type BreadcrumbButtonBaseProps, type BreadcrumbButtonType, Breadcrumbs, type BreadcrumbsDivider, type BreadcrumbsProps, Button, ButtonCloseX, type ButtonCloseXProps, type ButtonCloseXSize, ButtonDestructive, type ButtonDestructiveHierarchy, type ButtonDestructiveProps, type ButtonDestructiveSize, ButtonGroup, type ButtonGroupProps, ButtonGroupSegment, type ButtonGroupSegmentProps, type ButtonGroupSegmentSize, type ButtonProps, ButtonUtility, type ButtonUtilityProps, type ButtonUtilitySize, type ButtonUtilityVariant, CalendarCell, CalendarCellDayWeekView, type CalendarCellDayWeekViewProps, type CalendarCellProps, CalendarColumnHeader, type CalendarColumnHeaderOrientation, type CalendarColumnHeaderProps, CalendarDateIcon, type CalendarDateIconProps, CalendarEvent, type CalendarEventColor, CalendarEventDayWeekView, type CalendarEventDayWeekViewProps, type CalendarEventProps, CalendarHeader, type CalendarHeaderProps, CalendarRowLabel, type CalendarRowLabelProps, CalendarTimemarker, type CalendarTimemarkerAlign, type CalendarTimemarkerProps, type CalendarView, CalendarViewDropdown, type CalendarViewDropdownProps, type CalendarViewOption, CardHeader, type CardHeaderProps, CarouselArrow, type CarouselArrowDirection, type CarouselArrowProps, type CarouselArrowSize, CarouselImage, type CarouselImageProps, Change, type ChangeProps, type ChangeTrend, type ChangeType, ChartLegend, type ChartLegendItem, type ChartLegendPosition, type ChartLegendProps, ChartMarker, type ChartMarkerLine, type ChartMarkerProps, ChartMini, type ChartMiniDatum, type ChartMiniProps, type ChartMiniTrend, type ChartSeries, type ChartStyle, ChartTooltip, type ChartTooltipPayloadItem, type ChartTooltipProps, type CheckControlSize, Checkbox, type CheckboxProps, CodeSnippet, type CodeSnippetProps, CodeSnippetTabs, type CodeSnippetTabsProps, ColorBadge, type ColorBadgeProps, CommandBar, CommandBarFooter, type CommandBarFooterHint, type CommandBarFooterProps, CommandBarMenuSection, type CommandBarMenuSectionProps, CommandBarNavigationIcon, type CommandBarNavigationIconProps, type CommandBarProps, CommandDropdownMenuItem, type CommandDropdownMenuItemProps, CommandInput, type CommandInputProps, CommandShortcut, type CommandShortcutProps, ContentDivider, type ContentDividerProps, type ContentDividerStyle, type ContentDividerType, ContentFeatureText, type ContentFeatureTextProps, type ContentFeatureTextSize, ContentHeading, type ContentHeadingProps, type ContentHeadingSize, ContentParagraph, type ContentParagraphProps, type ContentParagraphSize, ContentQuote, type ContentQuoteAlign, type ContentQuoteProps, type ContentQuoteSize, ContentRule, type ContentRuleProps, type ContentRuleSize, ContextMenu, type ContextMenuProps, type ContextMenuState, DatePickerCell, type DatePickerCellProps, type DatePickerCellType, DatePickerListItem, type DatePickerListItemProps, DatePickerMenu, type DatePickerMenuProps, DropdownAccountListItem, type DropdownAccountListItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, type DropdownMenuFooterType, DropdownMenuHeader, type DropdownMenuHeaderProps, type DropdownMenuHeaderType, DropdownMenuItemInsetIcon, type DropdownMenuItemInsetIconProps, type DropdownMenuItemInsetIconType, DropdownMenuListItem, type DropdownMenuListItemProps, EmptyState, type EmptyStateProps, type EmptyStateSize, FeedItemBase, type FeedItemBaseProps, type FeedItemSize, FileUpload, FileUploadBase, type FileUploadBaseProps, FileUploadItemBase, type FileUploadItemBaseProps, type FileUploadItemIconType, type FileUploadItemStatus, type FileUploadItemType, type FileUploadProps, FilterBar, type FilterBarProps, FilterTabs, type FilterTabsProps, FiltersDropdownMenu, type FiltersDropdownMenuProps, FiltersSlideoutMenu, type FiltersSlideoutMenuProps, type HeaderNavItem, HeaderNavigation, type HeaderNavigationProps, type HeaderNavigationType, HelpIcon, type HelpIconProps, InputField, type InputFieldProps, type InputFieldSize, type InputFieldType, LeadingInputField, type LeadingInputFieldProps, LineAndBarChart, type LineAndBarChartProps, LinkMessage, type LinkMessageProps, type LinkMessageType, LoadingIndicator, type LoadingIndicatorProps, type LoadingIndicatorSize, type LoadingIndicatorStyle, MediaMessage, type MediaMessageProps, type MediaMessageType, MegaInputFieldBase, type MegaInputFieldBaseProps, type MegaInputFieldBaseSize, Message, MessageAction, MessageActionButton, type MessageActionButtonProps, MessageActionPanel, type MessageActionPanelProps, type MessageActionProps, type MessageActionType, type MessageBubbleTone, type MessageProps, MessageReaction, type MessageReactionProps, type MessageStatus, MessageStatusIcon, type MessageStatusIconProps, type MessageType, MetricItem, type MetricItemProps, Modal, ModalActions, type ModalActionsProps, type ModalActionsType, ModalHeader, type ModalHeaderProps, type ModalHeaderType, type ModalProps, type ModalSize, ModernBadge, type ModernBadgeProps, MultiSelect, type MultiSelectOption, type MultiSelectProps, NavAccountCard, NavAccountCardMenuItem, type NavAccountCardMenuItemProps, type NavAccountCardMenuItemType, type NavAccountCardProps, type NavAccountCardVariant, NavButton, type NavButtonProps, NavFeaturedCard, type NavFeaturedCardProps, NavItemBase, type NavItemBaseProps, NavItemDropdownBase, type NavItemDropdownBaseProps, NavMenuButton, type NavMenuButtonProps, Notification, type NotificationProps, type NotificationVariant, NumberInput, type NumberInputLayout, type NumberInputProps, PageHeader, type PageHeaderProps, type PageHeaderStyle, Pagination, PaginationButtonGroupBase, type PaginationButtonGroupBaseProps, type PaginationButtonGroupType, PaginationCards, type PaginationCardsProps, type PaginationCardsVariant, PaginationDotGroup, type PaginationDotGroupProps, PaginationDotIndicator, type PaginationDotIndicatorProps, type PaginationDotSize, type PaginationDotVariant, PaginationNumberBase, type PaginationNumberBaseProps, type PaginationNumberShape, type PaginationProps, type PaginationType, PieChart, type PieChartProps, type PieChartSize, type PieSlice, PillBadge, type PillBadgeProps, ProgressBar, type ProgressBarLabel, type ProgressBarProps, ProgressCircle, type ProgressCircleProps, type ProgressCircleShape, type ProgressCircleSize, RadarChart, type RadarChartProps, type RadarLegendPosition, Radio, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupItemSize, type RadioGroupItemType, type RadioGroupProps, type RadioProps, SectionFooter, type SectionFooterProps, type SectionFooterType, SectionHeader, type SectionHeaderProps, SectionLabel, type SectionLabelProps, type SectionLabelSize, Select, SelectMenuItem, type SelectMenuItemProps, type SelectMenuItemSize, type SelectProps, type SelectSize, type SelectType, SidebarNavigation, type SidebarNavigationProps, type SidebarNavigationType, SlideOutMenuHeader, type SlideOutMenuHeaderProps, SlideoutMenu, type SlideoutMenuProps, type SlideoutMenuSide, type SlideoutMenuSize, Slider, type SliderLabel, type SliderProps, type SocialBrand, SocialButton, type SocialButtonProps, type SocialButtonSize, type SocialButtonTheme, StatusIcon, type StatusIconProps, type StatusIconType, StepBase, type StepBaseProps, StepIconBase, type StepIconBaseProps, type StepIconSize, type StepIconType, type StepOrientation, type StepStatus, TabButtonBase, type TabButtonBaseProps, type TabButtonSize, type TabButtonType, type TabItem, TableCell, type TableCellProps, type TableCellSize, TableHeaderCell, type TableHeaderCellProps, type TableHeaderCellSize, TableHeaderLabel, type TableHeaderLabelArrow, type TableHeaderLabelProps, Tabs, type TabsOrientation, type TabsProps, Tag, type TagProps, type TagSize, TagsInputField, type TagsInputFieldProps, type TagsInputVariant, TextEditorToolbar, TextEditorToolbarDivider, type TextEditorToolbarProps, TextEditorTooltip, type TextEditorTooltipProps, TextareaInputField, type TextareaInputFieldProps, Toggle, type ToggleProps, type ToggleSize, type ToggleType, Tooltip, type TooltipArrow, type TooltipProps, TrailingInputField, type TrailingInputFieldProps, type TreeNode, TreeView, TreeViewConnector, type TreeViewConnectorProps, type TreeViewConnectorSize, type TreeViewConnectorType, TreeViewItem, type TreeViewItemProps, type TreeViewItemSize, type TreeViewProps, type UseContextMenuReturn, type VerificationCodeDigits, VerificationCodeInput, type VerificationCodeInputProps, type VerificationCodeSize, index as illustrations, useContextMenu };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React28 from 'react';
|
|
2
|
-
import React28__default, { forwardRef, isValidElement, cloneElement, Children, useContext, useMemo, createContext, Fragment, useState, PureComponent, createElement, Component, useRef, useEffect, useCallback, useImperativeHandle } from 'react';
|
|
2
|
+
import React28__default, { forwardRef, isValidElement, cloneElement, Children, useContext, useMemo, createContext, Fragment, useState, PureComponent, createElement, Component, useRef, useEffect, useCallback, useId, useImperativeHandle } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var __create = Object.create;
|
|
@@ -3822,7 +3822,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
3822
3822
|
function emptyFunctionThatReturnsNull() {
|
|
3823
3823
|
return null;
|
|
3824
3824
|
}
|
|
3825
|
-
module.exports = function(
|
|
3825
|
+
module.exports = function(isValidElement12, throwOnDirectAccess) {
|
|
3826
3826
|
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
3827
3827
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
3828
3828
|
function getIteratorFn(maybeIterable) {
|
|
@@ -3950,7 +3950,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
3950
3950
|
function createElementTypeChecker() {
|
|
3951
3951
|
function validate(props, propName, componentName, location, propFullName) {
|
|
3952
3952
|
var propValue = props[propName];
|
|
3953
|
-
if (!
|
|
3953
|
+
if (!isValidElement12(propValue)) {
|
|
3954
3954
|
var propType = getPropType(propValue);
|
|
3955
3955
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
3956
3956
|
}
|
|
@@ -4138,7 +4138,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
4138
4138
|
if (Array.isArray(propValue)) {
|
|
4139
4139
|
return propValue.every(isNode);
|
|
4140
4140
|
}
|
|
4141
|
-
if (propValue === null ||
|
|
4141
|
+
if (propValue === null || isValidElement12(propValue)) {
|
|
4142
4142
|
return true;
|
|
4143
4143
|
}
|
|
4144
4144
|
var iteratorFn = getIteratorFn(propValue);
|
|
@@ -31397,33 +31397,6 @@ function MetricItem({
|
|
|
31397
31397
|
}
|
|
31398
31398
|
);
|
|
31399
31399
|
}
|
|
31400
|
-
function ModalActions({
|
|
31401
|
-
type = "horizontal-fill",
|
|
31402
|
-
divider = true,
|
|
31403
|
-
leading,
|
|
31404
|
-
children,
|
|
31405
|
-
className,
|
|
31406
|
-
...rest
|
|
31407
|
-
}) {
|
|
31408
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx_default("flex w-full flex-col", className), ...rest, children: [
|
|
31409
|
-
divider && /* @__PURE__ */ jsx("div", { className: "mt-4xl border-t border-border-secondary" }),
|
|
31410
|
-
/* @__PURE__ */ jsx(
|
|
31411
|
-
"div",
|
|
31412
|
-
{
|
|
31413
|
-
className: clsx_default(
|
|
31414
|
-
"flex px-3xl pb-3xl pt-3xl",
|
|
31415
|
-
type === "horizontal-fill" && "gap-lg [&>*]:flex-1",
|
|
31416
|
-
type === "vertical-fill" && "flex-col gap-lg [&>*]:w-full",
|
|
31417
|
-
type === "right-aligned" && "items-center gap-lg"
|
|
31418
|
-
),
|
|
31419
|
-
children: type === "right-aligned" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
31420
|
-
/* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center gap-lg", children: leading }),
|
|
31421
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-lg", children })
|
|
31422
|
-
] }) : children
|
|
31423
|
-
}
|
|
31424
|
-
)
|
|
31425
|
-
] });
|
|
31426
|
-
}
|
|
31427
31400
|
var FeaturedIcon = ({ children }) => /* @__PURE__ */ jsx("div", { className: "flex size-10 shrink-0 items-center justify-center rounded-md border border-border-primary text-fg-secondary shadow-xs", children });
|
|
31428
31401
|
var XClose2 = () => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", fill: "none", className: "size-5", "aria-hidden": true, children: /* @__PURE__ */ jsx("path", { d: "M15 5 5 15M5 5l10 10", stroke: "currentColor", strokeWidth: "1.67", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
31429
31402
|
function ModalHeader({
|
|
@@ -31433,6 +31406,7 @@ function ModalHeader({
|
|
|
31433
31406
|
type = "left",
|
|
31434
31407
|
divider = true,
|
|
31435
31408
|
onClose,
|
|
31409
|
+
titleId,
|
|
31436
31410
|
className,
|
|
31437
31411
|
...rest
|
|
31438
31412
|
}) {
|
|
@@ -31467,7 +31441,7 @@ function ModalHeader({
|
|
|
31467
31441
|
isCenter && "items-center text-center"
|
|
31468
31442
|
),
|
|
31469
31443
|
children: [
|
|
31470
|
-
/* @__PURE__ */ jsx("p", { className: "w-full text-md font-semibold text-text-primary", children: title }),
|
|
31444
|
+
/* @__PURE__ */ jsx("p", { id: titleId, className: "w-full text-md font-semibold text-text-primary", children: title }),
|
|
31471
31445
|
description && /* @__PURE__ */ jsx("p", { className: "w-full text-sm text-text-tertiary", children: description })
|
|
31472
31446
|
]
|
|
31473
31447
|
}
|
|
@@ -31490,6 +31464,99 @@ function ModalHeader({
|
|
|
31490
31464
|
}
|
|
31491
31465
|
);
|
|
31492
31466
|
}
|
|
31467
|
+
var sizeMaxWidth = {
|
|
31468
|
+
sm: "max-w-[400px]",
|
|
31469
|
+
md: "max-w-[560px]",
|
|
31470
|
+
lg: "max-w-[720px]",
|
|
31471
|
+
xl: "max-w-[960px]"
|
|
31472
|
+
};
|
|
31473
|
+
function Modal({
|
|
31474
|
+
open,
|
|
31475
|
+
onClose,
|
|
31476
|
+
size = "md",
|
|
31477
|
+
children,
|
|
31478
|
+
className,
|
|
31479
|
+
...rest
|
|
31480
|
+
}) {
|
|
31481
|
+
const panelRef = useRef(null);
|
|
31482
|
+
const previousFocusRef = useRef(null);
|
|
31483
|
+
const titleId = useId();
|
|
31484
|
+
useEffect(() => {
|
|
31485
|
+
if (!open) return;
|
|
31486
|
+
previousFocusRef.current = document.activeElement;
|
|
31487
|
+
panelRef.current?.focus();
|
|
31488
|
+
const handleKeyDown = (e) => {
|
|
31489
|
+
if (e.key === "Escape") onClose();
|
|
31490
|
+
};
|
|
31491
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
31492
|
+
return () => {
|
|
31493
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
31494
|
+
previousFocusRef.current?.focus();
|
|
31495
|
+
};
|
|
31496
|
+
}, [open, onClose]);
|
|
31497
|
+
if (!open) return null;
|
|
31498
|
+
const handlePanelClick = (e) => e.stopPropagation();
|
|
31499
|
+
let hasLabelledHeader = false;
|
|
31500
|
+
const labelledChildren = Children.map(children, (child) => {
|
|
31501
|
+
if (isValidElement(child) && child.type === ModalHeader) {
|
|
31502
|
+
hasLabelledHeader = true;
|
|
31503
|
+
return cloneElement(child, { titleId });
|
|
31504
|
+
}
|
|
31505
|
+
return child;
|
|
31506
|
+
});
|
|
31507
|
+
return /* @__PURE__ */ jsx(
|
|
31508
|
+
"div",
|
|
31509
|
+
{
|
|
31510
|
+
onClick: onClose,
|
|
31511
|
+
className: "fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay/70 backdrop-blur-sm",
|
|
31512
|
+
children: /* @__PURE__ */ jsx(
|
|
31513
|
+
"div",
|
|
31514
|
+
{
|
|
31515
|
+
ref: panelRef,
|
|
31516
|
+
role: "dialog",
|
|
31517
|
+
"aria-modal": "true",
|
|
31518
|
+
"aria-labelledby": hasLabelledHeader ? titleId : void 0,
|
|
31519
|
+
tabIndex: -1,
|
|
31520
|
+
onClick: handlePanelClick,
|
|
31521
|
+
className: clsx_default(
|
|
31522
|
+
"mx-4 flex w-full flex-col overflow-hidden rounded-2xl bg-bg-primary shadow-xl outline-none sm:mx-0",
|
|
31523
|
+
sizeMaxWidth[size],
|
|
31524
|
+
className
|
|
31525
|
+
),
|
|
31526
|
+
...rest,
|
|
31527
|
+
children: labelledChildren
|
|
31528
|
+
}
|
|
31529
|
+
)
|
|
31530
|
+
}
|
|
31531
|
+
);
|
|
31532
|
+
}
|
|
31533
|
+
function ModalActions({
|
|
31534
|
+
type = "horizontal-fill",
|
|
31535
|
+
divider = true,
|
|
31536
|
+
leading,
|
|
31537
|
+
children,
|
|
31538
|
+
className,
|
|
31539
|
+
...rest
|
|
31540
|
+
}) {
|
|
31541
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx_default("flex w-full flex-col", className), ...rest, children: [
|
|
31542
|
+
divider && /* @__PURE__ */ jsx("div", { className: "mt-4xl border-t border-border-secondary" }),
|
|
31543
|
+
/* @__PURE__ */ jsx(
|
|
31544
|
+
"div",
|
|
31545
|
+
{
|
|
31546
|
+
className: clsx_default(
|
|
31547
|
+
"flex px-3xl pb-3xl pt-3xl",
|
|
31548
|
+
type === "horizontal-fill" && "gap-lg [&>*]:flex-1",
|
|
31549
|
+
type === "vertical-fill" && "flex-col gap-lg [&>*]:w-full",
|
|
31550
|
+
type === "right-aligned" && "items-center gap-lg"
|
|
31551
|
+
),
|
|
31552
|
+
children: type === "right-aligned" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
31553
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center gap-lg", children: leading }),
|
|
31554
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center gap-lg", children })
|
|
31555
|
+
] }) : children
|
|
31556
|
+
}
|
|
31557
|
+
)
|
|
31558
|
+
] });
|
|
31559
|
+
}
|
|
31493
31560
|
function CheckboxBox({ selected, big }) {
|
|
31494
31561
|
return /* @__PURE__ */ jsx(
|
|
31495
31562
|
"span",
|
|
@@ -32903,6 +32970,59 @@ function SlideOutMenuHeader({
|
|
|
32903
32970
|
}
|
|
32904
32971
|
);
|
|
32905
32972
|
}
|
|
32973
|
+
var sizeWidth = {
|
|
32974
|
+
sm: "sm:w-[360px]",
|
|
32975
|
+
md: "sm:w-[480px]",
|
|
32976
|
+
lg: "sm:w-[600px]"
|
|
32977
|
+
};
|
|
32978
|
+
function SlideoutMenu({
|
|
32979
|
+
open,
|
|
32980
|
+
onClose,
|
|
32981
|
+
side = "right",
|
|
32982
|
+
size = "md",
|
|
32983
|
+
children,
|
|
32984
|
+
className,
|
|
32985
|
+
...rest
|
|
32986
|
+
}) {
|
|
32987
|
+
useEffect(() => {
|
|
32988
|
+
if (!open) return;
|
|
32989
|
+
const handleKeyDown = (e) => {
|
|
32990
|
+
if (e.key === "Escape") onClose();
|
|
32991
|
+
};
|
|
32992
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
32993
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
32994
|
+
}, [open, onClose]);
|
|
32995
|
+
const handlePanelClick = (e) => e.stopPropagation();
|
|
32996
|
+
const closedTransform = side === "right" ? "translate-x-full" : "-translate-x-full";
|
|
32997
|
+
return /* @__PURE__ */ jsx(
|
|
32998
|
+
"div",
|
|
32999
|
+
{
|
|
33000
|
+
onClick: onClose,
|
|
33001
|
+
"aria-hidden": !open,
|
|
33002
|
+
className: clsx_default(
|
|
33003
|
+
"fixed inset-0 z-50 bg-bg-overlay/70 backdrop-blur-sm transition-opacity duration-300",
|
|
33004
|
+
open ? "opacity-100" : "pointer-events-none opacity-0"
|
|
33005
|
+
),
|
|
33006
|
+
children: /* @__PURE__ */ jsx(
|
|
33007
|
+
"div",
|
|
33008
|
+
{
|
|
33009
|
+
role: "dialog",
|
|
33010
|
+
"aria-modal": "true",
|
|
33011
|
+
onClick: handlePanelClick,
|
|
33012
|
+
className: clsx_default(
|
|
33013
|
+
"fixed bottom-0 top-0 flex w-full flex-col bg-bg-primary shadow-xl transition-transform duration-300 ease-in-out",
|
|
33014
|
+
side === "right" ? "right-0" : "left-0",
|
|
33015
|
+
sizeWidth[size],
|
|
33016
|
+
open ? "translate-x-0" : closedTransform,
|
|
33017
|
+
className
|
|
33018
|
+
),
|
|
33019
|
+
...rest,
|
|
33020
|
+
children
|
|
33021
|
+
}
|
|
33022
|
+
)
|
|
33023
|
+
}
|
|
33024
|
+
);
|
|
33025
|
+
}
|
|
32906
33026
|
var clampStep = (v, min3, max3, step) => {
|
|
32907
33027
|
const snapped = Math.round((v - min3) / step) * step + min3;
|
|
32908
33028
|
return Math.min(max3, Math.max(min3, snapped));
|
|
@@ -33712,6 +33832,6 @@ object-assign/index.js:
|
|
|
33712
33832
|
*)
|
|
33713
33833
|
*/
|
|
33714
33834
|
|
|
33715
|
-
export { ActivityFeed, ActivityGauge, AdvancedFilterBar, Alert, Avatar, AvatarAddButton, AvatarGroup, AvatarLabelGroup, AvatarProfilePhoto, BadgeCloseX, BadgeGroup, BreadcrumbButtonBase, Breadcrumbs, Button, ButtonCloseX, ButtonDestructive, ButtonGroup, ButtonGroupSegment, ButtonUtility, CalendarCell, CalendarCellDayWeekView, CalendarColumnHeader, CalendarDateIcon, CalendarEvent, CalendarEventDayWeekView, CalendarHeader, CalendarRowLabel, CalendarTimemarker, CalendarViewDropdown, CardHeader, CarouselArrow, CarouselImage, Change, ChartLegend, ChartMarker, ChartMini, ChartTooltip, Checkbox, CodeSnippet, CodeSnippetTabs, ColorBadge, CommandBar, CommandBarFooter, CommandBarMenuSection, CommandBarNavigationIcon, CommandDropdownMenuItem, CommandInput, CommandShortcut, ContentDivider, ContentFeatureText, ContentHeading, ContentParagraph, ContentQuote, ContentRule, ContextMenu, DatePickerCell, DatePickerListItem, DatePickerMenu, DropdownAccountListItem, DropdownMenuFooter, DropdownMenuHeader, DropdownMenuItemInsetIcon, DropdownMenuListItem, EmptyState, FeedItemBase, FileUpload, FileUploadBase, FileUploadItemBase, FilterBar, FilterTabs, FiltersDropdownMenu, FiltersSlideoutMenu, HeaderNavigation, HelpIcon2 as HelpIcon, InputField, LeadingInputField, LineAndBarChart, LinkMessage, LoadingIndicator, MediaMessage, MegaInputFieldBase, Message, MessageAction, MessageActionButton, MessageActionPanel, MessageReaction, MessageStatusIcon, MetricItem, ModalActions, ModalHeader, ModernBadge, MultiSelect, NavAccountCard, NavAccountCardMenuItem, NavButton2 as NavButton, NavFeaturedCard, NavItemBase, NavItemDropdownBase, NavMenuButton, Notification, NumberInput, PageHeader, Pagination, PaginationButtonGroupBase, PaginationCards, PaginationDotGroup, PaginationDotIndicator, PaginationNumberBase, PieChart2 as PieChart, PillBadge, ProgressBar, ProgressCircle, RadarChart2 as RadarChart, Radio, RadioGroup, RadioGroupItem, SectionFooter, SectionHeader, SectionLabel, Select, SelectMenuItem, SidebarNavigation, SlideOutMenuHeader, Slider, SocialButton, StatusIcon, StepBase, StepIconBase, TabButtonBase, TableCell, TableHeaderCell, TableHeaderLabel, Tabs, Tag, TagsInputField, TextEditorToolbar, TextEditorToolbarDivider, TextEditorTooltip, TextareaInputField, Toggle, Tooltip2 as Tooltip, TrailingInputField, TreeView, TreeViewConnector, TreeViewItem, VerificationCodeInput, illustrations_exports as illustrations, useContextMenu };
|
|
33835
|
+
export { ActivityFeed, ActivityGauge, AdvancedFilterBar, Alert, Avatar, AvatarAddButton, AvatarGroup, AvatarLabelGroup, AvatarProfilePhoto, BadgeCloseX, BadgeGroup, BreadcrumbButtonBase, Breadcrumbs, Button, ButtonCloseX, ButtonDestructive, ButtonGroup, ButtonGroupSegment, ButtonUtility, CalendarCell, CalendarCellDayWeekView, CalendarColumnHeader, CalendarDateIcon, CalendarEvent, CalendarEventDayWeekView, CalendarHeader, CalendarRowLabel, CalendarTimemarker, CalendarViewDropdown, CardHeader, CarouselArrow, CarouselImage, Change, ChartLegend, ChartMarker, ChartMini, ChartTooltip, Checkbox, CodeSnippet, CodeSnippetTabs, ColorBadge, CommandBar, CommandBarFooter, CommandBarMenuSection, CommandBarNavigationIcon, CommandDropdownMenuItem, CommandInput, CommandShortcut, ContentDivider, ContentFeatureText, ContentHeading, ContentParagraph, ContentQuote, ContentRule, ContextMenu, DatePickerCell, DatePickerListItem, DatePickerMenu, DropdownAccountListItem, DropdownMenuFooter, DropdownMenuHeader, DropdownMenuItemInsetIcon, DropdownMenuListItem, EmptyState, FeedItemBase, FileUpload, FileUploadBase, FileUploadItemBase, FilterBar, FilterTabs, FiltersDropdownMenu, FiltersSlideoutMenu, HeaderNavigation, HelpIcon2 as HelpIcon, InputField, LeadingInputField, LineAndBarChart, LinkMessage, LoadingIndicator, MediaMessage, MegaInputFieldBase, Message, MessageAction, MessageActionButton, MessageActionPanel, MessageReaction, MessageStatusIcon, MetricItem, Modal, ModalActions, ModalHeader, ModernBadge, MultiSelect, NavAccountCard, NavAccountCardMenuItem, NavButton2 as NavButton, NavFeaturedCard, NavItemBase, NavItemDropdownBase, NavMenuButton, Notification, NumberInput, PageHeader, Pagination, PaginationButtonGroupBase, PaginationCards, PaginationDotGroup, PaginationDotIndicator, PaginationNumberBase, PieChart2 as PieChart, PillBadge, ProgressBar, ProgressCircle, RadarChart2 as RadarChart, Radio, RadioGroup, RadioGroupItem, SectionFooter, SectionHeader, SectionLabel, Select, SelectMenuItem, SidebarNavigation, SlideOutMenuHeader, SlideoutMenu, Slider, SocialButton, StatusIcon, StepBase, StepIconBase, TabButtonBase, TableCell, TableHeaderCell, TableHeaderLabel, Tabs, Tag, TagsInputField, TextEditorToolbar, TextEditorToolbarDivider, TextEditorTooltip, TextareaInputField, Toggle, Tooltip2 as Tooltip, TrailingInputField, TreeView, TreeViewConnector, TreeViewItem, VerificationCodeInput, illustrations_exports as illustrations, useContextMenu };
|
|
33716
33836
|
//# sourceMappingURL=index.js.map
|
|
33717
33837
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Children,
|
|
3
|
+
cloneElement,
|
|
4
|
+
isValidElement,
|
|
5
|
+
useEffect,
|
|
6
|
+
useId,
|
|
7
|
+
useRef,
|
|
8
|
+
type HTMLAttributes,
|
|
9
|
+
type MouseEvent,
|
|
10
|
+
type ReactNode,
|
|
11
|
+
} from "react";
|
|
12
|
+
import clsx from "clsx";
|
|
13
|
+
import { ModalHeader } from "../ModalHeader";
|
|
14
|
+
|
|
15
|
+
export type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
16
|
+
|
|
17
|
+
export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
18
|
+
/** Controls visibility — renders nothing when false. */
|
|
19
|
+
open: boolean;
|
|
20
|
+
/** Fired on backdrop click-outside, Escape, or the header's x-close. */
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
/** Panel max-width: sm=400 / md=560 / lg=720 / xl=960 px. Full width on mobile. */
|
|
23
|
+
size?: ModalSize;
|
|
24
|
+
/** Modal contents — compose `ModalHeader`, a body, and `ModalActions` here. */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const sizeMaxWidth: Record<ModalSize, string> = {
|
|
29
|
+
sm: "max-w-[400px]",
|
|
30
|
+
md: "max-w-[560px]",
|
|
31
|
+
lg: "max-w-[720px]",
|
|
32
|
+
xl: "max-w-[960px]",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Modal shell — fixed backdrop + centred panel. Layout/overlay only: it does NOT
|
|
37
|
+
* render a header or footer, those are composed as children (`ModalHeader` /
|
|
38
|
+
* `ModalActions`). Backdrop click-outside and Escape both call `onClose`; clicks
|
|
39
|
+
* inside the panel are stopped from bubbling. On open, focus moves into the panel
|
|
40
|
+
* and is restored to the previously-focused element on close. If a direct
|
|
41
|
+
* `ModalHeader` child is present its title is wired to `aria-labelledby`.
|
|
42
|
+
* Renders `null` while `open` is false.
|
|
43
|
+
*/
|
|
44
|
+
export function Modal({
|
|
45
|
+
open,
|
|
46
|
+
onClose,
|
|
47
|
+
size = "md",
|
|
48
|
+
children,
|
|
49
|
+
className,
|
|
50
|
+
...rest
|
|
51
|
+
}: ModalProps) {
|
|
52
|
+
const panelRef = useRef<HTMLDivElement>(null);
|
|
53
|
+
const previousFocusRef = useRef<HTMLElement | null>(null);
|
|
54
|
+
const titleId = useId();
|
|
55
|
+
|
|
56
|
+
// Escape-to-close + focus management. Hooks run before the early return below.
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!open) return;
|
|
59
|
+
|
|
60
|
+
previousFocusRef.current = document.activeElement as HTMLElement | null;
|
|
61
|
+
panelRef.current?.focus();
|
|
62
|
+
|
|
63
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
64
|
+
if (e.key === "Escape") onClose();
|
|
65
|
+
};
|
|
66
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
67
|
+
|
|
68
|
+
return () => {
|
|
69
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
70
|
+
previousFocusRef.current?.focus();
|
|
71
|
+
};
|
|
72
|
+
}, [open, onClose]);
|
|
73
|
+
|
|
74
|
+
if (!open) return null;
|
|
75
|
+
|
|
76
|
+
const handlePanelClick = (e: MouseEvent<HTMLDivElement>) => e.stopPropagation();
|
|
77
|
+
|
|
78
|
+
// Wire aria-labelledby to a ModalHeader title if one is a direct child.
|
|
79
|
+
let hasLabelledHeader = false;
|
|
80
|
+
const labelledChildren = Children.map(children, (child) => {
|
|
81
|
+
if (isValidElement(child) && child.type === ModalHeader) {
|
|
82
|
+
hasLabelledHeader = true;
|
|
83
|
+
return cloneElement(child as React.ReactElement<{ titleId?: string }>, { titleId });
|
|
84
|
+
}
|
|
85
|
+
return child;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div
|
|
90
|
+
onClick={onClose}
|
|
91
|
+
className="fixed inset-0 z-50 flex items-center justify-center bg-bg-overlay/70 backdrop-blur-sm"
|
|
92
|
+
>
|
|
93
|
+
<div
|
|
94
|
+
ref={panelRef}
|
|
95
|
+
role="dialog"
|
|
96
|
+
aria-modal="true"
|
|
97
|
+
aria-labelledby={hasLabelledHeader ? titleId : undefined}
|
|
98
|
+
tabIndex={-1}
|
|
99
|
+
onClick={handlePanelClick}
|
|
100
|
+
className={clsx(
|
|
101
|
+
"mx-4 flex w-full flex-col overflow-hidden rounded-2xl bg-bg-primary shadow-xl outline-none sm:mx-0",
|
|
102
|
+
sizeMaxWidth[size],
|
|
103
|
+
className,
|
|
104
|
+
)}
|
|
105
|
+
{...rest}
|
|
106
|
+
>
|
|
107
|
+
{labelledChildren}
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -19,6 +19,8 @@ export interface ModalHeaderProps
|
|
|
19
19
|
divider?: boolean;
|
|
20
20
|
/** Renders an x-close button top-right when provided. */
|
|
21
21
|
onClose?: () => void;
|
|
22
|
+
/** id placed on the title element so a parent `Modal` can wire `aria-labelledby`. */
|
|
23
|
+
titleId?: string;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
const FeaturedIcon = ({ children }: { children: ReactNode }) => (
|
|
@@ -45,6 +47,7 @@ export function ModalHeader({
|
|
|
45
47
|
type = "left",
|
|
46
48
|
divider = true,
|
|
47
49
|
onClose,
|
|
50
|
+
titleId,
|
|
48
51
|
className,
|
|
49
52
|
...rest
|
|
50
53
|
}: ModalHeaderProps) {
|
|
@@ -75,7 +78,7 @@ export function ModalHeader({
|
|
|
75
78
|
isCenter && "items-center text-center",
|
|
76
79
|
)}
|
|
77
80
|
>
|
|
78
|
-
<p className="w-full text-md font-semibold text-text-primary">{title}</p>
|
|
81
|
+
<p id={titleId} className="w-full text-md font-semibold text-text-primary">{title}</p>
|
|
79
82
|
{description && (
|
|
80
83
|
<p className="w-full text-sm text-text-tertiary">{description}</p>
|
|
81
84
|
)}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useEffect,
|
|
3
|
+
type HTMLAttributes,
|
|
4
|
+
type MouseEvent,
|
|
5
|
+
type ReactNode,
|
|
6
|
+
} from "react";
|
|
7
|
+
import clsx from "clsx";
|
|
8
|
+
|
|
9
|
+
export type SlideoutMenuSide = "right" | "left";
|
|
10
|
+
export type SlideoutMenuSize = "sm" | "md" | "lg";
|
|
11
|
+
|
|
12
|
+
export interface SlideoutMenuProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
13
|
+
/** Controls visibility. The panel stays mounted to animate the slide in/out. */
|
|
14
|
+
open: boolean;
|
|
15
|
+
/** Fired on backdrop click-outside, Escape, or the header's x-close. */
|
|
16
|
+
onClose: () => void;
|
|
17
|
+
/** Edge the panel docks to and slides in from. */
|
|
18
|
+
side?: SlideoutMenuSide;
|
|
19
|
+
/** Panel width: sm=360 / md=480 / lg=600 px. Full width on mobile. */
|
|
20
|
+
size?: SlideoutMenuSize;
|
|
21
|
+
/** Drawer contents — compose `SlideOutMenuHeader`, a body, and a footer here. */
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const sizeWidth: Record<SlideoutMenuSize, string> = {
|
|
26
|
+
sm: "sm:w-[360px]",
|
|
27
|
+
md: "sm:w-[480px]",
|
|
28
|
+
lg: "sm:w-[600px]",
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Slide-out / drawer shell — fixed backdrop + edge-docked panel that slides in
|
|
33
|
+
* from `side` via a `translate-x` transition. Layout/overlay only: the header is
|
|
34
|
+
* composed as a child (`SlideOutMenuHeader`), not reimplemented. Backdrop
|
|
35
|
+
* click-outside and Escape both call `onClose`. The panel stays mounted (toggled
|
|
36
|
+
* via transform + the backdrop's pointer-events) so both enter and exit animate.
|
|
37
|
+
*/
|
|
38
|
+
export function SlideoutMenu({
|
|
39
|
+
open,
|
|
40
|
+
onClose,
|
|
41
|
+
side = "right",
|
|
42
|
+
size = "md",
|
|
43
|
+
children,
|
|
44
|
+
className,
|
|
45
|
+
...rest
|
|
46
|
+
}: SlideoutMenuProps) {
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!open) return;
|
|
49
|
+
const handleKeyDown = (e: KeyboardEvent) => {
|
|
50
|
+
if (e.key === "Escape") onClose();
|
|
51
|
+
};
|
|
52
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
53
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
54
|
+
}, [open, onClose]);
|
|
55
|
+
|
|
56
|
+
const handlePanelClick = (e: MouseEvent<HTMLDivElement>) => e.stopPropagation();
|
|
57
|
+
|
|
58
|
+
const closedTransform = side === "right" ? "translate-x-full" : "-translate-x-full";
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
onClick={onClose}
|
|
63
|
+
aria-hidden={!open}
|
|
64
|
+
className={clsx(
|
|
65
|
+
"fixed inset-0 z-50 bg-bg-overlay/70 backdrop-blur-sm transition-opacity duration-300",
|
|
66
|
+
open ? "opacity-100" : "pointer-events-none opacity-0",
|
|
67
|
+
)}
|
|
68
|
+
>
|
|
69
|
+
<div
|
|
70
|
+
role="dialog"
|
|
71
|
+
aria-modal="true"
|
|
72
|
+
onClick={handlePanelClick}
|
|
73
|
+
className={clsx(
|
|
74
|
+
"fixed bottom-0 top-0 flex w-full flex-col bg-bg-primary shadow-xl transition-transform duration-300 ease-in-out",
|
|
75
|
+
side === "right" ? "right-0" : "left-0",
|
|
76
|
+
sizeWidth[size],
|
|
77
|
+
open ? "translate-x-0" : closedTransform,
|
|
78
|
+
className,
|
|
79
|
+
)}
|
|
80
|
+
{...rest}
|
|
81
|
+
>
|
|
82
|
+
{children}
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -86,6 +86,7 @@ export * from "./components/MessageActionPanel";
|
|
|
86
86
|
export * from "./components/MessageReaction";
|
|
87
87
|
export * from "./components/MessageStatusIcon";
|
|
88
88
|
export * from "./components/MetricItem";
|
|
89
|
+
export * from "./components/Modal";
|
|
89
90
|
export * from "./components/ModalActions";
|
|
90
91
|
export * from "./components/ModalHeader";
|
|
91
92
|
export * from "./components/MultiSelect";
|
|
@@ -121,6 +122,7 @@ export * from "./components/Select";
|
|
|
121
122
|
export * from "./components/SelectMenuItem";
|
|
122
123
|
export * from "./components/SidebarNavigation";
|
|
123
124
|
export * from "./components/SlideOutMenuHeader";
|
|
125
|
+
export * from "./components/SlideoutMenu";
|
|
124
126
|
export * from "./components/Slider";
|
|
125
127
|
export * from "./components/SocialButton";
|
|
126
128
|
export * from "./components/StatusIcon";
|