@moderneinc/design-system-components 7.8.0 → 7.9.0-next.869ab7
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/SplitButton/SplitButton.d.ts +58 -0
- package/dist/index.d.ts +58 -2
- package/dist/index.esm.js +126 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +126 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type SxProps, type Theme } from '@mui/material/styles';
|
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
3
|
+
type SplitButtonVariant = 'primary' | 'secondary' | 'destructive';
|
|
4
|
+
export type ModSplitButtonOption<V extends string = string> = {
|
|
5
|
+
value: V;
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
};
|
|
10
|
+
type ModSplitButtonOwnProps<V extends string> = {
|
|
11
|
+
/**
|
|
12
|
+
* The actions the button offers. The main button runs the current one; the menu lists them all.
|
|
13
|
+
*/
|
|
14
|
+
options: ModSplitButtonOption<V>[];
|
|
15
|
+
/**
|
|
16
|
+
* The option the main button runs. Leave unset to let the button track the last option picked.
|
|
17
|
+
*/
|
|
18
|
+
value?: V;
|
|
19
|
+
/**
|
|
20
|
+
* The option the main button starts on when `value` is unset
|
|
21
|
+
* @default the first option
|
|
22
|
+
*/
|
|
23
|
+
defaultValue?: V;
|
|
24
|
+
/**
|
|
25
|
+
* Runs an option, from the main button or a menu pick
|
|
26
|
+
*/
|
|
27
|
+
onSelect: (value: V) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Called when a menu pick makes another option the main button's
|
|
30
|
+
*/
|
|
31
|
+
onValueChange?: (value: V) => void;
|
|
32
|
+
/**
|
|
33
|
+
* @default "primary"
|
|
34
|
+
*/
|
|
35
|
+
variant?: SplitButtonVariant;
|
|
36
|
+
/**
|
|
37
|
+
* @default "medium"
|
|
38
|
+
*/
|
|
39
|
+
size?: 'small' | 'medium';
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Accessible name of the menu toggle
|
|
43
|
+
* @default "More options"
|
|
44
|
+
*/
|
|
45
|
+
menuLabel?: string;
|
|
46
|
+
sx?: SxProps<Theme>;
|
|
47
|
+
};
|
|
48
|
+
/** Other props, such as `aria-label` naming the group, go to the group element. */
|
|
49
|
+
export type ModSplitButtonProps<V extends string = string> = ModSplitButtonOwnProps<V> & Omit<ComponentPropsWithoutRef<'div'>, keyof ModSplitButtonOwnProps<V>>;
|
|
50
|
+
/**
|
|
51
|
+
* ModSplitButton - A button that runs one of several actions, with a menu to pick another.
|
|
52
|
+
* Picking from the menu runs that action and makes it the main button's.
|
|
53
|
+
*/
|
|
54
|
+
export declare function ModSplitButton<V extends string = string>({ options, value, defaultValue, onSelect, onValueChange, variant, size, disabled, menuLabel, ...rest }: ModSplitButtonProps<V>): import("react").JSX.Element | null;
|
|
55
|
+
export declare namespace ModSplitButton {
|
|
56
|
+
var displayName: string;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -2746,6 +2746,62 @@ declare const ModSkeleton: {
|
|
|
2746
2746
|
displayName: string;
|
|
2747
2747
|
};
|
|
2748
2748
|
|
|
2749
|
+
type SplitButtonVariant = 'primary' | 'secondary' | 'destructive';
|
|
2750
|
+
type ModSplitButtonOption<V extends string = string> = {
|
|
2751
|
+
value: V;
|
|
2752
|
+
label: ReactNode;
|
|
2753
|
+
icon?: ReactNode;
|
|
2754
|
+
disabled?: boolean;
|
|
2755
|
+
};
|
|
2756
|
+
type ModSplitButtonOwnProps<V extends string> = {
|
|
2757
|
+
/**
|
|
2758
|
+
* The actions the button offers. The main button runs the current one; the menu lists them all.
|
|
2759
|
+
*/
|
|
2760
|
+
options: ModSplitButtonOption<V>[];
|
|
2761
|
+
/**
|
|
2762
|
+
* The option the main button runs. Leave unset to let the button track the last option picked.
|
|
2763
|
+
*/
|
|
2764
|
+
value?: V;
|
|
2765
|
+
/**
|
|
2766
|
+
* The option the main button starts on when `value` is unset
|
|
2767
|
+
* @default the first option
|
|
2768
|
+
*/
|
|
2769
|
+
defaultValue?: V;
|
|
2770
|
+
/**
|
|
2771
|
+
* Runs an option, from the main button or a menu pick
|
|
2772
|
+
*/
|
|
2773
|
+
onSelect: (value: V) => void;
|
|
2774
|
+
/**
|
|
2775
|
+
* Called when a menu pick makes another option the main button's
|
|
2776
|
+
*/
|
|
2777
|
+
onValueChange?: (value: V) => void;
|
|
2778
|
+
/**
|
|
2779
|
+
* @default "primary"
|
|
2780
|
+
*/
|
|
2781
|
+
variant?: SplitButtonVariant;
|
|
2782
|
+
/**
|
|
2783
|
+
* @default "medium"
|
|
2784
|
+
*/
|
|
2785
|
+
size?: 'small' | 'medium';
|
|
2786
|
+
disabled?: boolean;
|
|
2787
|
+
/**
|
|
2788
|
+
* Accessible name of the menu toggle
|
|
2789
|
+
* @default "More options"
|
|
2790
|
+
*/
|
|
2791
|
+
menuLabel?: string;
|
|
2792
|
+
sx?: SxProps<Theme>;
|
|
2793
|
+
};
|
|
2794
|
+
/** Other props, such as `aria-label` naming the group, go to the group element. */
|
|
2795
|
+
type ModSplitButtonProps<V extends string = string> = ModSplitButtonOwnProps<V> & Omit<ComponentPropsWithoutRef<'div'>, keyof ModSplitButtonOwnProps<V>>;
|
|
2796
|
+
/**
|
|
2797
|
+
* ModSplitButton - A button that runs one of several actions, with a menu to pick another.
|
|
2798
|
+
* Picking from the menu runs that action and makes it the main button's.
|
|
2799
|
+
*/
|
|
2800
|
+
declare function ModSplitButton<V extends string = string>({ options, value, defaultValue, onSelect, onValueChange, variant, size, disabled, menuLabel, ...rest }: ModSplitButtonProps<V>): react.JSX.Element | null;
|
|
2801
|
+
declare namespace ModSplitButton {
|
|
2802
|
+
var displayName: string;
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2749
2805
|
type TableSize = 'small' | 'medium';
|
|
2750
2806
|
type TableVariant = 'bordered' | 'plain';
|
|
2751
2807
|
type CellAlign = 'left' | 'center' | 'right';
|
|
@@ -3276,5 +3332,5 @@ declare module '@mui/x-data-grid-pro' {
|
|
|
3276
3332
|
|
|
3277
3333
|
declare const version: string
|
|
3278
3334
|
|
|
3279
|
-
export { ActivityScene, CIRCLE_RADIUS, ModActionsCell, ModActivityHeader, ModActivityIndicatorCell, ModAlert, ModAvatarCell, ModBadge, ModBanner, ModBreadcrumbLink, ModBreadcrumbs, ModButton, ModButtonTab, ModButtonTabGroup, ModCanceledIcon, ModCard, ModCheckbox, ModCheckboxWithText, ModCodeSnippet, ModDataGrid, ModDataGridCellContent, ModDataGridColumnsButton, ModDataGridColumnsPanel, ModDataGridFilterPanel, ModDataGridFilterPanelAddIcon, ModDataGridFilterPanelDeleteIcon, ModDataGridFilterPanelRemoveAllIcon, ModDataGridFiltersButton, ModDataGridHeaderLabel, ModDataGridSelect, ModDatePicker, ModDivider, ModDot, ModDownloadToast, ModSelect as ModDropdown, ModMenu as ModDropdownMenu, ModMenuItem as ModDropdownMenuItem, ModMenuItem as ModDropdownOption, ModFilledCanceled, ModFilledError, ModFilledInfo, ModFilledNeutral, ModFilledQueued, ModFilledSuccess, ModFilledWarning, ModFilterChip, ModFooter, ModGeneralAvatar, ModIconButton, ModIconCell, ModIconWrapper, ModInfiniteScrollGrid, ModInputField, ModListItem, ModListItemButton, ModLoadingSpinner, ModLogoCell, ModMenu, ModMenuItem, ModModal, ModModalContent, ModModalFooter, ModModalHeader, ModMultiBadgesCell, ModNavigationAvatar, ModNavigationItem, ModPageContent, ModPaginatedGrid, ModProgressCell, ModProgressbar, ModQuickFilter, ModRadio, ModRipplingDot, ModSearchChip, ModSelect, ModSelectField, ModMenuItem as ModSelectOption, ModSideNav, ModSkeleton, ModStatusBadgeCell, ModStatusCell, ModTab, ModTabPanel, ModTable, ModTabs, ModTag, ModToast, ModToastButton, ModToggle, ModToggleButton, ModToggleButtonGroup, ModToolbar, ModTooltip, ModTreeItem, ModTreeView, StyledToggleButton as ModTypologyButton, ModTypologyControl, ModUserAvatarCell, ModVibratingDot, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, focusRingStyles, getDataGridHeaderStyles, getDataGridRowStyles, modRowHeights, touchTarget, useIsCompact, version };
|
|
3280
|
-
export type { ActivityColor, ActivityEvent, ActivityHeaderSize, BreadcrumbItem, DataGridSize, IconWrapperSize, ModAction, ModActionsCellProps, ModActivityHeaderProps, ModActivityIndicatorCellProps, ModAlertProps, ModAvatarCellProps, ModBadgeProps, ModBannerProps, ModBreadcrumbLinkProps, ModBreadcrumbsProps, ModButtonProps, ModButtonTabGroupProps, ModButtonTabProps, ModCardLargeProps, ModCardProps, ModCardSize, ModCardSmallProps, ModCheckboxProps, ModCheckboxWithTextProps, ModCodeSnippetProps, ModDataGridCellContentProps, ModDataGridHeaderLabelProps, ModDataGridProps, ModDataGridSelectProps, ModDatePickerProps, ModDividerProps, ModDotProps, ModDownloadToastProps, ModMenuItemProps as ModDropdownMenuItemProps, ModMenuProps as ModDropdownMenuProps, ModSelectProps as ModDropdownProps, ModFilledStatusIconProps, ModFilterChipProps, ModFooterProps, ModGeneralAvatarProps, ModIconButtonProps, ModIconCellProps, ModIconWrapperProps, ModInfiniteScrollGridProps, ModInputFieldProps, ModListItemButtonProps, ModListItemProps, ModLoadingSpinnerProps, ModLogoCellProps, ModMenuItemProps, ModMenuProps, ModModalContentProps, ModModalFooterProps, ModModalHeaderProps, ModModalProps, ModMultiBadgesCellProps, ModNavigationAvatarProps, ModNavigationItemProps, ModPageContentProps, ModPaginatedGridProps, ModProgressCellProps, ModProgressbarProps, ModQuickFilterProps, ModRadioProps, ModRipplingDotProps, ModSearchChipProps, ModSelectFieldChangeEvent, ModSelectFieldOption, ModSelectFieldProps, ModSelectProps, ModSideNavProps, ModSkeletonProps, ModStatusBadgeCellProps, ModStatusCellProps, ModStatusCellVariant, ModTabPanelProps, ModTabProps, ModTableColumn, ModTableProps, ModTagProps, ModToastProps, ModToggleButtonGroupProps, ModToggleButtonProps, ModToggleProps, ModToolbarProps, ModTooltipProps, ModTreeItemData, ModTreeItemProps, ModTreeViewProps, ModTypologyControlProps, ModUserAvatarCellProps, ModVibratingDotProps };
|
|
3335
|
+
export { ActivityScene, CIRCLE_RADIUS, ModActionsCell, ModActivityHeader, ModActivityIndicatorCell, ModAlert, ModAvatarCell, ModBadge, ModBanner, ModBreadcrumbLink, ModBreadcrumbs, ModButton, ModButtonTab, ModButtonTabGroup, ModCanceledIcon, ModCard, ModCheckbox, ModCheckboxWithText, ModCodeSnippet, ModDataGrid, ModDataGridCellContent, ModDataGridColumnsButton, ModDataGridColumnsPanel, ModDataGridFilterPanel, ModDataGridFilterPanelAddIcon, ModDataGridFilterPanelDeleteIcon, ModDataGridFilterPanelRemoveAllIcon, ModDataGridFiltersButton, ModDataGridHeaderLabel, ModDataGridSelect, ModDatePicker, ModDivider, ModDot, ModDownloadToast, ModSelect as ModDropdown, ModMenu as ModDropdownMenu, ModMenuItem as ModDropdownMenuItem, ModMenuItem as ModDropdownOption, ModFilledCanceled, ModFilledError, ModFilledInfo, ModFilledNeutral, ModFilledQueued, ModFilledSuccess, ModFilledWarning, ModFilterChip, ModFooter, ModGeneralAvatar, ModIconButton, ModIconCell, ModIconWrapper, ModInfiniteScrollGrid, ModInputField, ModListItem, ModListItemButton, ModLoadingSpinner, ModLogoCell, ModMenu, ModMenuItem, ModModal, ModModalContent, ModModalFooter, ModModalHeader, ModMultiBadgesCell, ModNavigationAvatar, ModNavigationItem, ModPageContent, ModPaginatedGrid, ModProgressCell, ModProgressbar, ModQuickFilter, ModRadio, ModRipplingDot, ModSearchChip, ModSelect, ModSelectField, ModMenuItem as ModSelectOption, ModSideNav, ModSkeleton, ModSplitButton, ModStatusBadgeCell, ModStatusCell, ModTab, ModTabPanel, ModTable, ModTabs, ModTag, ModToast, ModToastButton, ModToggle, ModToggleButton, ModToggleButtonGroup, ModToolbar, ModTooltip, ModTreeItem, ModTreeView, StyledToggleButton as ModTypologyButton, ModTypologyControl, ModUserAvatarCell, ModVibratingDot, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, focusRingStyles, getDataGridHeaderStyles, getDataGridRowStyles, modRowHeights, touchTarget, useIsCompact, version };
|
|
3336
|
+
export type { ActivityColor, ActivityEvent, ActivityHeaderSize, BreadcrumbItem, DataGridSize, IconWrapperSize, ModAction, ModActionsCellProps, ModActivityHeaderProps, ModActivityIndicatorCellProps, ModAlertProps, ModAvatarCellProps, ModBadgeProps, ModBannerProps, ModBreadcrumbLinkProps, ModBreadcrumbsProps, ModButtonProps, ModButtonTabGroupProps, ModButtonTabProps, ModCardLargeProps, ModCardProps, ModCardSize, ModCardSmallProps, ModCheckboxProps, ModCheckboxWithTextProps, ModCodeSnippetProps, ModDataGridCellContentProps, ModDataGridHeaderLabelProps, ModDataGridProps, ModDataGridSelectProps, ModDatePickerProps, ModDividerProps, ModDotProps, ModDownloadToastProps, ModMenuItemProps as ModDropdownMenuItemProps, ModMenuProps as ModDropdownMenuProps, ModSelectProps as ModDropdownProps, ModFilledStatusIconProps, ModFilterChipProps, ModFooterProps, ModGeneralAvatarProps, ModIconButtonProps, ModIconCellProps, ModIconWrapperProps, ModInfiniteScrollGridProps, ModInputFieldProps, ModListItemButtonProps, ModListItemProps, ModLoadingSpinnerProps, ModLogoCellProps, ModMenuItemProps, ModMenuProps, ModModalContentProps, ModModalFooterProps, ModModalHeaderProps, ModModalProps, ModMultiBadgesCellProps, ModNavigationAvatarProps, ModNavigationItemProps, ModPageContentProps, ModPaginatedGridProps, ModProgressCellProps, ModProgressbarProps, ModQuickFilterProps, ModRadioProps, ModRipplingDotProps, ModSearchChipProps, ModSelectFieldChangeEvent, ModSelectFieldOption, ModSelectFieldProps, ModSelectProps, ModSideNavProps, ModSkeletonProps, ModSplitButtonOption, ModSplitButtonProps, ModStatusBadgeCellProps, ModStatusCellProps, ModStatusCellVariant, ModTabPanelProps, ModTabProps, ModTableColumn, ModTableProps, ModTagProps, ModToastProps, ModToggleButtonGroupProps, ModToggleButtonProps, ModToggleProps, ModToolbarProps, ModTooltipProps, ModTreeItemData, ModTreeItemProps, ModTreeViewProps, ModTypologyControlProps, ModUserAvatarCellProps, ModVibratingDotProps };
|
package/dist/index.esm.js
CHANGED
|
@@ -771,6 +771,7 @@ function ModBreadcrumbs({ children, className }) {
|
|
|
771
771
|
);
|
|
772
772
|
}
|
|
773
773
|
|
|
774
|
+
const LABEL_LINE_HEIGHT = 20;
|
|
774
775
|
const StyledButton = styled(Button, {
|
|
775
776
|
shouldForwardProp: (prop) => prop !== "buttonVariant" && prop !== "buttonSize"
|
|
776
777
|
})(({ theme, buttonVariant: variant, buttonSize: size }) => {
|
|
@@ -787,24 +788,30 @@ const StyledButton = styled(Button, {
|
|
|
787
788
|
}
|
|
788
789
|
};
|
|
789
790
|
const sizeStyles = sizeConfig[size];
|
|
791
|
+
const paddingY = (sizeStyles.height - LABEL_LINE_HEIGHT) / 2 - 1;
|
|
790
792
|
const paddingX = variant === "tertiary" ? 0 : sizeStyles.paddingX;
|
|
791
793
|
const spinnerSize = size === "small" ? iconSize.md : iconSize.xl;
|
|
792
794
|
const disabled = `&.${buttonClasses.disabled}:not(.${buttonClasses.loading})`;
|
|
793
795
|
const baseStyles = {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
+
// A label that wraps grows the button instead of spilling out of it; fit-content, not auto, so a
|
|
797
|
+
// flex row doesn't stretch it to the row's tallest item
|
|
798
|
+
minHeight: sizeStyles.height,
|
|
799
|
+
height: "fit-content",
|
|
800
|
+
padding: `${paddingY}px ${paddingX}px`,
|
|
796
801
|
fontFamily: "inherit",
|
|
797
802
|
fontSize: sizeStyles.fontSize,
|
|
798
803
|
fontWeight: typography.fontWeight.semiBold,
|
|
799
804
|
letterSpacing: "inherit",
|
|
800
805
|
lineHeight: "1.25rem",
|
|
806
|
+
textAlign: "center",
|
|
801
807
|
borderRadius: borderRadius.button,
|
|
802
808
|
textTransform: "none",
|
|
803
809
|
transition: theme.transitions.create(["background-color", "border-color", "color"], {
|
|
804
810
|
duration: theme.transitions.duration.short
|
|
805
811
|
}),
|
|
806
812
|
position: "relative",
|
|
807
|
-
|
|
813
|
+
// Shrinks in a tight row down to its longest word, then wraps
|
|
814
|
+
minWidth: "min-content",
|
|
808
815
|
gap: spacing.spacing_1,
|
|
809
816
|
...touchTarget(theme),
|
|
810
817
|
// `gap` spaces the icons; MUI's slot margins would add to it
|
|
@@ -6490,6 +6497,121 @@ const ModSkeleton = ({
|
|
|
6490
6497
|
};
|
|
6491
6498
|
ModSkeleton.displayName = "ModSkeleton";
|
|
6492
6499
|
|
|
6500
|
+
const Group = styled("div", {
|
|
6501
|
+
shouldForwardProp: (prop) => prop !== "splitVariant"
|
|
6502
|
+
})(({ theme, splitVariant }) => ({
|
|
6503
|
+
display: "inline-flex",
|
|
6504
|
+
// Both halves match the taller one when the label wraps
|
|
6505
|
+
[`& > .${buttonClasses.root}`]: {
|
|
6506
|
+
height: "auto"
|
|
6507
|
+
},
|
|
6508
|
+
[`& > .${buttonClasses.root}:first-of-type`]: {
|
|
6509
|
+
borderStartEndRadius: 0,
|
|
6510
|
+
borderEndEndRadius: 0
|
|
6511
|
+
},
|
|
6512
|
+
[`& > .${buttonClasses.root}:last-of-type`]: {
|
|
6513
|
+
borderStartStartRadius: 0,
|
|
6514
|
+
borderEndStartRadius: 0,
|
|
6515
|
+
paddingInline: spacing.spacing_1,
|
|
6516
|
+
...splitVariant === "secondary" ? { marginInlineStart: -1 } : (
|
|
6517
|
+
// The label's own colour, so the line reads on every fill, theme and disabled state
|
|
6518
|
+
{ borderInlineStart: "1px solid color-mix(in srgb, currentColor 40%, transparent)" }
|
|
6519
|
+
)
|
|
6520
|
+
},
|
|
6521
|
+
// The toggle is narrower than its 44px touch target; grow it away from the main button, not over it
|
|
6522
|
+
[`& > .${buttonClasses.root}:last-of-type::after`]: {
|
|
6523
|
+
[theme.breakpoints.down("md")]: {
|
|
6524
|
+
left: 0,
|
|
6525
|
+
transform: "translateY(-50%)"
|
|
6526
|
+
}
|
|
6527
|
+
},
|
|
6528
|
+
// The focus outline sits outside the button, so the other half would paint over it
|
|
6529
|
+
[`& > .${buttonClasses.focusVisible}`]: {
|
|
6530
|
+
zIndex: 1
|
|
6531
|
+
}
|
|
6532
|
+
}));
|
|
6533
|
+
function ModSplitButton({
|
|
6534
|
+
options,
|
|
6535
|
+
value,
|
|
6536
|
+
defaultValue,
|
|
6537
|
+
onSelect,
|
|
6538
|
+
onValueChange,
|
|
6539
|
+
variant = "primary",
|
|
6540
|
+
size = "medium",
|
|
6541
|
+
disabled,
|
|
6542
|
+
menuLabel = "More options",
|
|
6543
|
+
...rest
|
|
6544
|
+
}) {
|
|
6545
|
+
const groupRef = useRef(null);
|
|
6546
|
+
const menuId = useId();
|
|
6547
|
+
const [open, setOpen] = useState(false);
|
|
6548
|
+
const [internalValue, setInternalValue] = useState(defaultValue ?? options[0]?.value);
|
|
6549
|
+
const current = options.find((option) => option.value === (value ?? internalValue)) ?? options[0];
|
|
6550
|
+
if (!current) {
|
|
6551
|
+
return null;
|
|
6552
|
+
}
|
|
6553
|
+
const pick = (option) => {
|
|
6554
|
+
setOpen(false);
|
|
6555
|
+
if (option !== current.value) {
|
|
6556
|
+
setInternalValue(option);
|
|
6557
|
+
onValueChange?.(option);
|
|
6558
|
+
}
|
|
6559
|
+
onSelect(option);
|
|
6560
|
+
};
|
|
6561
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6562
|
+
/* @__PURE__ */ jsxs(Group, { role: "group", ...rest, ref: groupRef, splitVariant: variant, children: [
|
|
6563
|
+
/* @__PURE__ */ jsx(
|
|
6564
|
+
ModButton,
|
|
6565
|
+
{
|
|
6566
|
+
variant,
|
|
6567
|
+
size,
|
|
6568
|
+
disabled: disabled || current.disabled,
|
|
6569
|
+
startIcon: current.icon,
|
|
6570
|
+
onClick: () => onSelect(current.value),
|
|
6571
|
+
children: current.label
|
|
6572
|
+
}
|
|
6573
|
+
),
|
|
6574
|
+
/* @__PURE__ */ jsx(
|
|
6575
|
+
ModButton,
|
|
6576
|
+
{
|
|
6577
|
+
variant,
|
|
6578
|
+
size,
|
|
6579
|
+
disabled,
|
|
6580
|
+
"aria-label": menuLabel,
|
|
6581
|
+
"aria-haspopup": "menu",
|
|
6582
|
+
"aria-expanded": open || void 0,
|
|
6583
|
+
"aria-controls": open ? menuId : void 0,
|
|
6584
|
+
onClick: () => setOpen(true),
|
|
6585
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { size: iconSize.md })
|
|
6586
|
+
}
|
|
6587
|
+
)
|
|
6588
|
+
] }),
|
|
6589
|
+
/* @__PURE__ */ jsx(
|
|
6590
|
+
ModMenu,
|
|
6591
|
+
{
|
|
6592
|
+
id: menuId,
|
|
6593
|
+
open,
|
|
6594
|
+
anchorEl: groupRef.current,
|
|
6595
|
+
onClose: () => setOpen(false),
|
|
6596
|
+
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
6597
|
+
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
6598
|
+
children: options.map((option) => /* @__PURE__ */ jsx(
|
|
6599
|
+
ModMenuItem,
|
|
6600
|
+
{
|
|
6601
|
+
icon: option.icon,
|
|
6602
|
+
selected: option.value === current.value,
|
|
6603
|
+
disabled: option.disabled,
|
|
6604
|
+
onClick: () => pick(option.value),
|
|
6605
|
+
children: option.label
|
|
6606
|
+
},
|
|
6607
|
+
option.value
|
|
6608
|
+
))
|
|
6609
|
+
}
|
|
6610
|
+
)
|
|
6611
|
+
] });
|
|
6612
|
+
}
|
|
6613
|
+
ModSplitButton.displayName = "ModSplitButton";
|
|
6614
|
+
|
|
6493
6615
|
const sizePaddingY = {
|
|
6494
6616
|
small: spacing.spacing_3_4,
|
|
6495
6617
|
medium: spacing.spacing_1_1_2
|
|
@@ -7516,5 +7638,5 @@ ModVibratingDot.displayName = "ModVibratingDot";
|
|
|
7516
7638
|
|
|
7517
7639
|
const version = '0.0.0-development';
|
|
7518
7640
|
|
|
7519
|
-
export { ActivityScene, CIRCLE_RADIUS, ModActionsCell, ModActivityHeader, ModActivityIndicatorCell, ModAlert, ModAvatarCell, ModBadge, ModBanner, ModBreadcrumbLink, ModBreadcrumbs, ModButton, ModButtonTab, ModButtonTabGroup, ModCanceledIcon, ModCard, ModCheckbox, ModCheckboxWithText, ModCodeSnippet, ModDataGrid, ModDataGridCellContent, ModDataGridColumnsButton, ModDataGridColumnsPanel, ModDataGridFilterPanel, ModDataGridFilterPanelAddIcon, ModDataGridFilterPanelDeleteIcon, ModDataGridFilterPanelRemoveAllIcon, ModDataGridFiltersButton, ModDataGridHeaderLabel, ModDataGridSelect, ModDatePicker, ModDivider, ModDot, ModDownloadToast, ModSelect as ModDropdown, ModMenu as ModDropdownMenu, ModMenuItem as ModDropdownMenuItem, ModMenuItem as ModDropdownOption, ModFilledCanceled, ModFilledError, ModFilledInfo, ModFilledNeutral, ModFilledQueued, ModFilledSuccess, ModFilledWarning, ModFilterChip, ModFooter, ModGeneralAvatar, ModIconButton, ModIconCell, ModIconWrapper, ModInfiniteScrollGrid, ModInputField, ModListItem, ModListItemButton, ModLoadingSpinner, ModLogoCell, ModMenu, ModMenuItem, ModModal, ModModalContent, ModModalFooter, ModModalHeader, ModMultiBadgesCell, ModNavigationAvatar, ModNavigationItem, ModPageContent, ModPaginatedGrid, ModProgressCell, ModProgressbar, ModQuickFilter, ModRadio, ModRipplingDot, ModSearchChip, ModSelect, ModSelectField, ModMenuItem as ModSelectOption, ModSideNav, ModSkeleton, ModStatusBadgeCell, ModStatusCell, ModTab, ModTabPanel, ModTable, ModTabs, ModTag, ModToast, ModToastButton, ModToggle, ModToggleButton, ModToggleButtonGroup, ModToolbar, ModTooltip, ModTreeItem, ModTreeView, StyledToggleButton as ModTypologyButton, ModTypologyControl, ModUserAvatarCell, ModVibratingDot, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, focusRingStyles, getDataGridHeaderStyles, getDataGridRowStyles, modRowHeights, touchTarget, useIsCompact, version };
|
|
7641
|
+
export { ActivityScene, CIRCLE_RADIUS, ModActionsCell, ModActivityHeader, ModActivityIndicatorCell, ModAlert, ModAvatarCell, ModBadge, ModBanner, ModBreadcrumbLink, ModBreadcrumbs, ModButton, ModButtonTab, ModButtonTabGroup, ModCanceledIcon, ModCard, ModCheckbox, ModCheckboxWithText, ModCodeSnippet, ModDataGrid, ModDataGridCellContent, ModDataGridColumnsButton, ModDataGridColumnsPanel, ModDataGridFilterPanel, ModDataGridFilterPanelAddIcon, ModDataGridFilterPanelDeleteIcon, ModDataGridFilterPanelRemoveAllIcon, ModDataGridFiltersButton, ModDataGridHeaderLabel, ModDataGridSelect, ModDatePicker, ModDivider, ModDot, ModDownloadToast, ModSelect as ModDropdown, ModMenu as ModDropdownMenu, ModMenuItem as ModDropdownMenuItem, ModMenuItem as ModDropdownOption, ModFilledCanceled, ModFilledError, ModFilledInfo, ModFilledNeutral, ModFilledQueued, ModFilledSuccess, ModFilledWarning, ModFilterChip, ModFooter, ModGeneralAvatar, ModIconButton, ModIconCell, ModIconWrapper, ModInfiniteScrollGrid, ModInputField, ModListItem, ModListItemButton, ModLoadingSpinner, ModLogoCell, ModMenu, ModMenuItem, ModModal, ModModalContent, ModModalFooter, ModModalHeader, ModMultiBadgesCell, ModNavigationAvatar, ModNavigationItem, ModPageContent, ModPaginatedGrid, ModProgressCell, ModProgressbar, ModQuickFilter, ModRadio, ModRipplingDot, ModSearchChip, ModSelect, ModSelectField, ModMenuItem as ModSelectOption, ModSideNav, ModSkeleton, ModSplitButton, ModStatusBadgeCell, ModStatusCell, ModTab, ModTabPanel, ModTable, ModTabs, ModTag, ModToast, ModToastButton, ModToggle, ModToggleButton, ModToggleButtonGroup, ModToolbar, ModTooltip, ModTreeItem, ModTreeView, StyledToggleButton as ModTypologyButton, ModTypologyControl, ModUserAvatarCell, ModVibratingDot, SortedAscendingIcon, SortedDescendingIcon, UnsortedIcon, focusRingStyles, getDataGridHeaderStyles, getDataGridRowStyles, modRowHeights, touchTarget, useIsCompact, version };
|
|
7520
7642
|
//# sourceMappingURL=index.esm.js.map
|