@primer/react 38.0.0-rc.5 → 38.0.0-rc.7
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/CHANGELOG.md +53 -0
- package/dist/ActionBar/ActionBar.d.ts +15 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +381 -217
- package/dist/ActionBar/index.d.ts +1 -1
- package/dist/ActionList/Description.d.ts +4 -3
- package/dist/ActionList/Description.d.ts.map +1 -1
- package/dist/ActionList/Description.js +5 -5
- package/dist/ActionList/Divider.d.ts +5 -4
- package/dist/ActionList/Divider.d.ts.map +1 -1
- package/dist/ActionList/Divider.js +6 -7
- package/dist/ActionList/Group.d.ts +4 -5
- package/dist/ActionList/Group.d.ts.map +1 -1
- package/dist/ActionList/Group.js +9 -16
- package/dist/ActionList/Heading.d.ts +3 -2
- package/dist/ActionList/Heading.d.ts.map +1 -1
- package/dist/ActionList/Heading.js +1 -0
- package/dist/ActionList/Item.d.ts +5 -2
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +4 -8
- package/dist/ActionList/LinkItem.d.ts +1 -1
- package/dist/ActionList/LinkItem.d.ts.map +1 -1
- package/dist/ActionList/LinkItem.js +1 -2
- package/dist/ActionList/List.d.ts +1 -1
- package/dist/ActionList/List.d.ts.map +1 -1
- package/dist/ActionList/List.js +1 -3
- package/dist/ActionList/TrailingAction.d.ts +1 -0
- package/dist/ActionList/TrailingAction.d.ts.map +1 -1
- package/dist/ActionList/TrailingAction.js +3 -0
- package/dist/ActionList/Visuals.d.ts +4 -4
- package/dist/ActionList/Visuals.d.ts.map +1 -1
- package/dist/ActionList/Visuals.js +3 -3
- package/dist/ActionList/index.d.ts +12 -9
- package/dist/ActionList/index.d.ts.map +1 -1
- package/dist/ActionList/shared.d.ts +2 -3
- package/dist/ActionList/shared.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.d.ts +6 -5
- package/dist/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/ActionMenu/ActionMenu.js +11 -6
- package/dist/Autocomplete/Autocomplete.d.ts +6 -4
- package/dist/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/Autocomplete/Autocomplete.js +1 -0
- package/dist/Autocomplete/AutocompleteInput.js +1 -0
- package/dist/Autocomplete/AutocompleteMenu.d.ts +1 -0
- package/dist/Autocomplete/AutocompleteMenu.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteMenu.js +1 -0
- package/dist/Autocomplete/AutocompleteOverlay.d.ts +1 -0
- package/dist/Autocomplete/AutocompleteOverlay.d.ts.map +1 -1
- package/dist/Autocomplete/AutocompleteOverlay.js +1 -0
- package/dist/AvatarStack/AvatarStack.d.ts.map +1 -1
- package/dist/AvatarStack/AvatarStack.js +1 -3
- package/dist/BranchName/BranchName.d.ts +9 -10
- package/dist/BranchName/BranchName.d.ts.map +1 -1
- package/dist/BranchName/BranchName.js +1 -8
- package/dist/Button/Button.d.ts +1 -5
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +2 -85
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +8 -93
- package/dist/Button/IconButton.d.ts.map +1 -1
- package/dist/Button/IconButton.js +0 -16
- package/dist/Button/LinkButton.d.ts +1 -1
- package/dist/Button/LinkButton.d.ts.map +1 -1
- package/dist/Button/types.d.ts +1 -3
- package/dist/Button/types.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.d.ts +3 -1
- package/dist/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox/Checkbox.js +1 -0
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +8 -7
- package/dist/CheckboxGroup/CheckboxGroup.d.ts.map +1 -1
- package/dist/CheckboxGroup/CheckboxGroup.js +4 -2
- package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css +2 -0
- package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css.map +1 -0
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.js +4 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.module.css.js +1 -1
- package/dist/DataTable/Table.d.ts +3 -3
- package/dist/DataTable/Table.d.ts.map +1 -1
- package/dist/DataTable/Table.js +24 -19
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +1 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.js +2 -1
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css +2 -0
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
- package/dist/FilteredActionList/FilteredActionList.js +2 -7
- package/dist/FilteredActionList/FilteredActionList.module.css.js +2 -2
- package/dist/FilteredActionList/types.d.ts +5 -2
- package/dist/FilteredActionList/types.d.ts.map +1 -1
- package/dist/FormControl/FormControl.d.ts +8 -36
- package/dist/FormControl/FormControl.d.ts.map +1 -1
- package/dist/FormControl/FormControl.js +64 -66
- package/dist/FormControl/FormControlCaption.d.ts +6 -4
- package/dist/FormControl/FormControlCaption.d.ts.map +1 -1
- package/dist/FormControl/FormControlCaption.js +9 -13
- package/dist/FormControl/FormControlLabel.d.ts +3 -3
- package/dist/FormControl/FormControlLabel.d.ts.map +1 -1
- package/dist/FormControl/FormControlLabel.js +25 -31
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css +2 -0
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css.map +1 -0
- package/dist/FormControl/FormControlLeadingVisual.d.ts +2 -2
- package/dist/FormControl/FormControlLeadingVisual.d.ts.map +1 -1
- package/dist/FormControl/FormControlLeadingVisual.js +10 -17
- package/dist/FormControl/FormControlLeadingVisual.module.css.js +5 -0
- package/dist/FormControl/_FormControlContext.js +1 -1
- package/dist/FormControl/_FormControlValidation.d.ts +3 -3
- package/dist/FormControl/_FormControlValidation.d.ts.map +1 -1
- package/dist/FormControl/_FormControlValidation.js +7 -9
- package/dist/FormControl/index.d.ts +4 -0
- package/dist/FormControl/index.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Chord-d4edcc89.css +2 -0
- package/dist/KeybindingHint/components/Chord-d4edcc89.css.map +1 -0
- package/dist/KeybindingHint/components/Chord.module.css.js +1 -1
- package/dist/LabelGroup/LabelGroup-7d19205a.css +2 -0
- package/dist/LabelGroup/LabelGroup-7d19205a.css.map +1 -0
- package/dist/LabelGroup/LabelGroup.d.ts.map +1 -1
- package/dist/LabelGroup/LabelGroup.js +14 -27
- package/dist/LabelGroup/LabelGroup.module.css.js +2 -2
- package/dist/NavList/NavList.d.ts +3 -3
- package/dist/NavList/NavList.d.ts.map +1 -1
- package/dist/NavList/NavList.js +2 -1
- package/dist/Octicon/Octicon.d.ts +7 -6
- package/dist/Octicon/Octicon.d.ts.map +1 -1
- package/dist/Octicon/Octicon.js +4 -23
- package/dist/Overlay/Overlay.d.ts.map +1 -1
- package/dist/Overlay/Overlay.js +63 -85
- package/dist/PageHeader/PageHeader.d.ts +3 -3
- package/dist/PageHeader/PageHeader.d.ts.map +1 -1
- package/dist/PageHeader/PageHeader.js +5 -2
- package/dist/PageLayout/{PageLayout-8a294e74.css → PageLayout-a276fa3b.css} +2 -2
- package/dist/PageLayout/PageLayout-a276fa3b.css.map +1 -0
- package/dist/PageLayout/PageLayout.d.ts +14 -58
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +216 -245
- package/dist/PageLayout/PageLayout.module.css.js +2 -2
- package/dist/Radio/Radio.d.ts +3 -1
- package/dist/Radio/Radio.d.ts.map +1 -1
- package/dist/Radio/Radio.js +1 -0
- package/dist/RadioGroup/RadioGroup.d.ts +6 -5
- package/dist/RadioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup/RadioGroup.js +1 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +3 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControl.js +11 -14
- package/dist/SegmentedControl/SegmentedControlButton.d.ts +2 -1
- package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlButton.js +1 -0
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts +2 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +1 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.js +1 -0
- package/dist/Select/Select.d.ts +1 -0
- package/dist/Select/Select.d.ts.map +1 -1
- package/dist/Select/Select.js +1 -0
- package/dist/SelectPanel/SelectPanel.d.ts +2 -1
- package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
- package/dist/SelectPanel/SelectPanel.js +1 -0
- package/dist/Skeleton/SkeletonBox.d.ts.map +1 -1
- package/dist/Skeleton/SkeletonBox.js +26 -20
- package/dist/SkeletonAvatar/SkeletonAvatar.d.ts.map +1 -1
- package/dist/SkeletonAvatar/SkeletonAvatar.js +53 -62
- package/dist/StateLabel/{StateLabel-aaa1d148.css → StateLabel-b586b0bc.css} +2 -2
- package/dist/StateLabel/StateLabel-b586b0bc.css.map +1 -0
- package/dist/StateLabel/StateLabel.d.ts.map +1 -1
- package/dist/StateLabel/StateLabel.js +28 -39
- package/dist/StateLabel/StateLabel.module.css.js +1 -1
- package/dist/SubNav/SubNav.d.ts +4 -1
- package/dist/SubNav/SubNav.d.ts.map +1 -1
- package/dist/SubNav/SubNav.js +3 -1
- package/dist/Text/Text.d.ts +16 -8
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +34 -31
- package/dist/TextInput/TextInput.d.ts +3 -2
- package/dist/TextInput/TextInput.d.ts.map +1 -1
- package/dist/TextInput/TextInput.js +2 -3
- package/dist/TextInput/index.d.ts +1 -0
- package/dist/TextInput/index.d.ts.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts +3 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.js +205 -211
- package/dist/Textarea/Textarea.d.ts +5 -4
- package/dist/Textarea/Textarea.d.ts.map +1 -1
- package/dist/Textarea/Textarea.js +40 -45
- package/dist/Tooltip/Tooltip-fffa9948.css +2 -0
- package/dist/Tooltip/Tooltip-fffa9948.css.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +6 -8
- package/dist/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip/Tooltip.js +44 -118
- package/dist/Tooltip/Tooltip.module.css.js +5 -0
- package/dist/TooltipV2/Tooltip.d.ts +3 -16
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +1 -0
- package/dist/TreeView/TreeView.d.ts +4 -1
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +42 -9
- package/dist/Truncate/Truncate.d.ts +2 -2
- package/dist/Truncate/Truncate.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +0 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNav.js +45 -17
- package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +0 -2
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
- package/dist/UnderlineNav/UnderlineNavContext.js +0 -1
- package/dist/UnderlineNav/styles.d.ts +1 -23
- package/dist/UnderlineNav/styles.d.ts.map +1 -1
- package/dist/UnderlineNav/styles.js +4 -59
- package/dist/constants.js +3 -3
- package/dist/deprecated/ActionList/Divider-7c6b656a.css +2 -0
- package/dist/deprecated/ActionList/Divider-7c6b656a.css.map +1 -0
- package/dist/deprecated/ActionList/Divider.d.ts +1 -2
- package/dist/deprecated/ActionList/Divider.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Divider.js +6 -12
- package/dist/deprecated/ActionList/Divider.module.css.js +5 -0
- package/dist/deprecated/ActionList/Group.d.ts +1 -2
- package/dist/deprecated/ActionList/Group.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Group.js +1 -8
- package/dist/deprecated/ActionList/Header-493b1d76.css +2 -0
- package/dist/deprecated/ActionList/Header-493b1d76.css.map +1 -0
- package/dist/deprecated/ActionList/Header.d.ts +2 -6
- package/dist/deprecated/ActionList/Header.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Header.js +46 -37
- package/dist/deprecated/ActionList/Header.module.css.js +5 -0
- package/dist/deprecated/ActionList/Item-cf87f98a.css +3 -0
- package/dist/deprecated/ActionList/Item-cf87f98a.css.map +1 -0
- package/dist/deprecated/ActionList/Item.d.ts +1 -5
- package/dist/deprecated/ActionList/Item.d.ts.map +1 -1
- package/dist/deprecated/ActionList/Item.js +182 -271
- package/dist/deprecated/ActionList/Item.module.css.js +5 -0
- package/dist/deprecated/ActionList/List-1ec9d6d9.css +2 -0
- package/dist/deprecated/ActionList/List-1ec9d6d9.css.map +1 -0
- package/dist/deprecated/ActionList/List.d.ts +1 -0
- package/dist/deprecated/ActionList/List.d.ts.map +1 -1
- package/dist/deprecated/ActionList/List.js +92 -82
- package/dist/deprecated/ActionList/List.module.css.js +5 -0
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css +2 -0
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css.map +1 -0
- package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts +6 -8
- package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts.map +1 -1
- package/dist/deprecated/UnderlineNav/UnderlineNav.js +90 -49
- package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +5 -0
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts +11 -7
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
- package/dist/experimental/SelectPanel2/SelectPanel.js +6 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts +6 -6
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +1 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +8 -4
- package/dist/hooks/useSlots.d.ts.map +1 -1
- package/dist/hooks/useSlots.js +3 -2
- package/dist/hooks/useSyncedState.js +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +6 -7
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +7 -9
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts +4 -4
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts +2 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +1 -0
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts +3 -3
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +2 -3
- package/dist/internal/components/InputLabel.d.ts +2 -3
- package/dist/internal/components/InputLabel.d.ts.map +1 -1
- package/dist/internal/components/InputLabel.js +29 -36
- package/dist/internal/components/InputValidation.d.ts +1 -2
- package/dist/internal/components/InputValidation.d.ts.map +1 -1
- package/dist/internal/components/TextInputInnerAction.d.ts +16 -2
- package/dist/internal/components/TextInputInnerAction.d.ts.map +1 -1
- package/dist/internal/components/TextInputInnerAction.js +46 -60
- package/dist/internal/components/TextInputWrapper.d.ts +10 -32
- package/dist/internal/components/TextInputWrapper.d.ts.map +1 -1
- package/dist/internal/components/TextInputWrapper.js +87 -58
- package/dist/internal/components/UnstyledTextInput.d.ts +1 -2
- package/dist/internal/components/UnstyledTextInput.d.ts.map +1 -1
- package/dist/internal/components/UnstyledTextInput.js +1 -3
- package/dist/internal/components/ValidationAnimationContainer-04125429.css +2 -0
- package/dist/internal/components/ValidationAnimationContainer-04125429.css.map +1 -0
- package/dist/internal/components/ValidationAnimationContainer.d.ts.map +1 -1
- package/dist/internal/components/ValidationAnimationContainer.js +4 -9
- package/dist/internal/components/ValidationAnimationContainer.module.css.js +5 -0
- package/dist/utils/form-story-helpers.d.ts.map +1 -1
- package/dist/utils/is-slot.d.ts +6 -0
- package/dist/utils/is-slot.d.ts.map +1 -0
- package/dist/utils/is-slot.js +15 -0
- package/dist/utils/polymorphic.d.ts +2 -1
- package/dist/utils/polymorphic.d.ts.map +1 -1
- package/dist/utils/types/Slots.d.ts +7 -0
- package/dist/utils/types/Slots.d.ts.map +1 -0
- package/dist/utils/types/index.d.ts +1 -0
- package/dist/utils/types/index.d.ts.map +1 -1
- package/generated/components.json +21 -119
- package/package.json +2 -1
- package/dist/Button/styles.d.ts +0 -431
- package/dist/Button/styles.d.ts.map +0 -1
- package/dist/Button/styles.js +0 -5
- package/dist/ConfirmationDialog/ConfirmationDialog-de0401ff.css +0 -2
- package/dist/ConfirmationDialog/ConfirmationDialog-de0401ff.css.map +0 -1
- package/dist/FilteredActionList/FilteredActionList-e1eb1b75.css +0 -2
- package/dist/FilteredActionList/FilteredActionList-e1eb1b75.css.map +0 -1
- package/dist/KeybindingHint/components/Chord-81099645.css +0 -2
- package/dist/KeybindingHint/components/Chord-81099645.css.map +0 -1
- package/dist/LabelGroup/LabelGroup-eda75c0f.css +0 -2
- package/dist/LabelGroup/LabelGroup-eda75c0f.css.map +0 -1
- package/dist/PageLayout/PageLayout-8a294e74.css.map +0 -1
- package/dist/StateLabel/StateLabel-aaa1d148.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-78db938f.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-78db938f.css.map +0 -1
- package/dist/internal/components/BoxWithFallback.d.ts +0 -6
- package/dist/internal/components/BoxWithFallback.d.ts.map +0 -1
- package/dist/internal/components/BoxWithFallback.js +0 -70
- package/dist/internal/utils/getGlobalFocusStyles.d.ts +0 -4
- package/dist/internal/utils/getGlobalFocusStyles.d.ts.map +0 -1
- package/dist/internal/utils/getGlobalFocusStyles.js +0 -7
- package/dist/internal/utils/sharedCheckboxAndRadioStyles.d.ts +0 -2
- package/dist/internal/utils/sharedCheckboxAndRadioStyles.d.ts.map +0 -1
- package/dist/utils/defaultSxProp.d.ts +0 -3
- package/dist/utils/defaultSxProp.d.ts.map +0 -1
- package/dist/utils/defaultSxProp.js +0 -3
- package/dist/utils/includeSystemProps.d.ts +0 -7
- package/dist/utils/includeSystemProps.d.ts.map +0 -1
- package/dist/utils/includeSystemProps.js +0 -14
|
@@ -4,6 +4,7 @@ import type { OverlayProps } from '../Overlay';
|
|
|
4
4
|
import type { ButtonProps } from '../Button';
|
|
5
5
|
import type { AnchorPosition } from '@primer/behaviors';
|
|
6
6
|
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
|
|
7
|
+
import type { FCWithSlotMarker, WithSlotMarker } from '../utils/types/Slots';
|
|
7
8
|
export type MenuCloseHandler = (gesture: 'anchor-click' | 'click-outside' | 'escape' | 'tab' | 'item-select' | 'arrow-left' | 'close') => void;
|
|
8
9
|
export type MenuContextProps = Pick<AnchoredOverlayProps, 'anchorRef' | 'renderAnchor' | 'open' | 'onOpen' | 'anchorId'> & {
|
|
9
10
|
onClose?: MenuCloseHandler;
|
|
@@ -38,14 +39,14 @@ type MenuOverlayProps = Partial<OverlayProps> & Pick<AnchoredOverlayProps, 'alig
|
|
|
38
39
|
position: AnchorPosition;
|
|
39
40
|
}) => void;
|
|
40
41
|
};
|
|
41
|
-
export declare const ActionMenu: React.FC<React.PropsWithChildren<ActionMenuProps>> & {
|
|
42
|
+
export declare const ActionMenu: React.FC<React.PropsWithChildren<ActionMenuProps>> & import("..").SlotMarker & {
|
|
42
43
|
Button: PolymorphicForwardRefComponent<"button", ButtonProps>;
|
|
43
|
-
Anchor: React.ForwardRefExoticComponent<{
|
|
44
|
+
Anchor: WithSlotMarker<React.ForwardRefExoticComponent<{
|
|
44
45
|
children: React.ReactElement;
|
|
45
46
|
id?: string;
|
|
46
|
-
} & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement
|
|
47
|
-
Overlay:
|
|
48
|
-
Divider:
|
|
47
|
+
} & React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>>;
|
|
48
|
+
Overlay: FCWithSlotMarker<React.PropsWithChildren<MenuOverlayProps>>;
|
|
49
|
+
Divider: FCWithSlotMarker<React.PropsWithChildren<import("..").ActionListDividerProps>>;
|
|
49
50
|
};
|
|
50
51
|
export {};
|
|
51
52
|
//# sourceMappingURL=ActionMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionMenu.d.ts","sourceRoot":"","sources":["../../src/ActionMenu/ActionMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8D,MAAM,OAAO,CAAA;AAElF,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAA;AAE5D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAI5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAA;AAIrD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AA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@@ -6,6 +6,7 @@ import { useId } from '../hooks/useId.js';
|
|
|
6
6
|
import { Tooltip } from '../TooltipV2/Tooltip.js';
|
|
7
7
|
import styles from './ActionMenu.module.css.js';
|
|
8
8
|
import { useResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
9
|
+
import { isSlot } from '../utils/is-slot.js';
|
|
9
10
|
import { jsx } from 'react/jsx-runtime';
|
|
10
11
|
import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
|
|
11
12
|
import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
|
|
@@ -67,7 +68,7 @@ const Menu = ({
|
|
|
67
68
|
(_parentMenuContext$on = parentMenuContext.onClose) === null || _parentMenuContext$on === void 0 ? void 0 : _parentMenuContext$on.call(parentMenuContext, gesture);
|
|
68
69
|
}
|
|
69
70
|
}, [setCombinedOpenState, parentMenuContext, open, isNarrow]);
|
|
70
|
-
const menuButtonChild = React.Children.toArray(children).find(child => /*#__PURE__*/React.isValidElement(child) && (child.type === MenuButton || child.type === Anchor));
|
|
71
|
+
const menuButtonChild = React.Children.toArray(children).find(child => /*#__PURE__*/React.isValidElement(child) && (child.type === MenuButton || child.type === Anchor || isSlot(child, Anchor) || isSlot(child, MenuButton)));
|
|
71
72
|
const menuButtonChildId = /*#__PURE__*/React.isValidElement(menuButtonChild) ? menuButtonChild.props.id : undefined;
|
|
72
73
|
const anchorRef = useProvidedRefOrCreate(externalAnchorRef);
|
|
73
74
|
const anchorId = useId(menuButtonChildId);
|
|
@@ -78,10 +79,10 @@ const Menu = ({
|
|
|
78
79
|
// 🚨 Accounting for Tooltip wrapping ActionMenu.Button or being a direct child of ActionMenu.Anchor.
|
|
79
80
|
const contents = React.Children.map(children, child => {
|
|
80
81
|
// Is ActionMenu.Button wrapped with Tooltip? If this is the case, our anchor is the tooltip's trigger (ActionMenu.Button's grandchild)
|
|
81
|
-
if (child.type === Tooltip) {
|
|
82
|
+
if (child.type === Tooltip || isSlot(child, Tooltip)) {
|
|
82
83
|
// tooltip trigger
|
|
83
84
|
const anchorChildren = child.props.children;
|
|
84
|
-
if (anchorChildren.type === MenuButton) {
|
|
85
|
+
if (anchorChildren.type === MenuButton || isSlot(anchorChildren, MenuButton)) {
|
|
85
86
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
86
87
|
renderAnchor = anchorProps => {
|
|
87
88
|
// We need to attach the anchor props to the tooltip trigger (ActionMenu.Button's grandchild) not the tooltip itself.
|
|
@@ -95,9 +96,9 @@ const Menu = ({
|
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
98
|
return null;
|
|
98
|
-
} else if (child.type === Anchor) {
|
|
99
|
+
} else if (child.type === Anchor || isSlot(child, Anchor)) {
|
|
99
100
|
const anchorChildren = child.props.children;
|
|
100
|
-
const isWrappedWithTooltip = anchorChildren !== undefined ? anchorChildren.type === Tooltip : false;
|
|
101
|
+
const isWrappedWithTooltip = anchorChildren !== undefined ? anchorChildren.type === Tooltip || isSlot(anchorChildren, Tooltip) : false;
|
|
101
102
|
if (isWrappedWithTooltip) {
|
|
102
103
|
if (anchorChildren.props.children !== null) {
|
|
103
104
|
renderAnchor = anchorProps => {
|
|
@@ -120,7 +121,7 @@ const Menu = ({
|
|
|
120
121
|
renderAnchor = anchorProps => /*#__PURE__*/React.cloneElement(child, anchorProps);
|
|
121
122
|
}
|
|
122
123
|
return null;
|
|
123
|
-
} else if (child.type === MenuButton) {
|
|
124
|
+
} else if (child.type === MenuButton || isSlot(child, MenuButton)) {
|
|
124
125
|
renderAnchor = anchorProps => /*#__PURE__*/React.cloneElement(child, mergeAnchorHandlers(anchorProps, child.props));
|
|
125
126
|
return null;
|
|
126
127
|
} else {
|
|
@@ -284,6 +285,10 @@ const Overlay = ({
|
|
|
284
285
|
};
|
|
285
286
|
Overlay.displayName = "Overlay";
|
|
286
287
|
Menu.displayName = 'ActionMenu';
|
|
288
|
+
Menu.__SLOT__ = Symbol('ActionMenu');
|
|
289
|
+
MenuButton.__SLOT__ = Symbol('ActionMenu.Button');
|
|
290
|
+
Anchor.__SLOT__ = Symbol('ActionMenu.Anchor');
|
|
291
|
+
Overlay.__SLOT__ = Symbol('ActionMenu.Overlay');
|
|
287
292
|
const ActionMenu = Object.assign(Menu, {
|
|
288
293
|
Button: MenuButton,
|
|
289
294
|
Anchor,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { ComponentProps } from '../utils/types';
|
|
2
|
+
import type { ComponentProps, FCWithSlotMarker } from '../utils/types';
|
|
3
3
|
import AutocompleteMenu from './AutocompleteMenu';
|
|
4
4
|
import AutocompleteOverlay from './AutocompleteOverlay';
|
|
5
|
-
declare const Autocomplete:
|
|
5
|
+
declare const Autocomplete: FCWithSlotMarker<React.PropsWithChildren<{
|
|
6
6
|
id?: string;
|
|
7
7
|
}>>;
|
|
8
8
|
export type AutocompleteProps = ComponentProps<typeof Autocomplete>;
|
|
@@ -11,7 +11,8 @@ export type { AutocompleteMenuProps } from './AutocompleteMenu';
|
|
|
11
11
|
export type { AutocompleteOverlayProps } from './AutocompleteOverlay';
|
|
12
12
|
declare const _default: React.FC<React.PropsWithChildren<{
|
|
13
13
|
id?: string;
|
|
14
|
-
}>> & {
|
|
14
|
+
}>> & import("..").SlotMarker & {
|
|
15
|
+
__SLOT__: symbol;
|
|
15
16
|
Context: React.Context<{
|
|
16
17
|
activeDescendantRef: React.MutableRefObject<HTMLElement | null>;
|
|
17
18
|
autocompleteSuggestion: string;
|
|
@@ -29,13 +30,14 @@ declare const _default: React.FC<React.PropsWithChildren<{
|
|
|
29
30
|
showMenu: boolean;
|
|
30
31
|
} | null>;
|
|
31
32
|
Input: import("../utils/polymorphic").ForwardRefComponent<import("../utils/polymorphic").ForwardRefComponent<"input", import("..").TextInputProps> & {
|
|
33
|
+
__SLOT__: symbol;
|
|
32
34
|
Action: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "aria-label" | "size" | "tooltipDirection"> & {
|
|
33
35
|
children?: React.ReactNode;
|
|
34
36
|
"aria-label"?: string;
|
|
35
37
|
tooltipDirection?: "n" | "ne" | "e" | "se" | "s" | "sw" | "w" | "nw";
|
|
36
38
|
icon?: React.FunctionComponent<React.PropsWithChildren<import("@primer/octicons-react").IconProps>>;
|
|
37
39
|
variant?: import("..").ButtonProps["variant"];
|
|
38
|
-
} &
|
|
40
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
39
41
|
}, {
|
|
40
42
|
as?: React.ComponentType<React.PropsWithChildren<any>>;
|
|
41
43
|
openOnFocus?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAGpE,OAAO,gBAAgB,MAAM,oBAAoB,CAAA;AACjD,OAAO,mBAAmB,MAAM,uBAAuB,CAAA;AA0CvD,QAAA,MAAM,YAAY,EAAE,gBAAgB,CAAC,KAAK,CAAC,iBAAiB,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CA6C1E,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAAC,OAAO,YAAY,CAAC,CAAA;AACnE,YAAY,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAA;AAC/D,YAAY,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAC7D,YAAY,EAAC,wBAAwB,EAAC,MAAM,uBAAuB,CAAA;;SAlDA,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDzE,wBAME"}
|
|
@@ -69,6 +69,7 @@ export type AutocompleteMenuInternalProps<T extends AutocompleteItemProps> = {
|
|
|
69
69
|
declare function AutocompleteMenu<T extends AutocompleteItemProps>(props: AutocompleteMenuInternalProps<T>): React.JSX.Element;
|
|
70
70
|
declare namespace AutocompleteMenu {
|
|
71
71
|
var displayName: string;
|
|
72
|
+
var __SLOT__: symbol;
|
|
72
73
|
}
|
|
73
74
|
export type AutocompleteMenuProps = ComponentProps<typeof AutocompleteMenu>;
|
|
74
75
|
export default AutocompleteMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteMenu.d.ts","sourceRoot":"","sources":["../../src/Autocomplete/AutocompleteMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAK7E,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,eAAe,CAAA;AAGtD,OAAO,KAAK,EAAC,cAAc,EAAE,YAAY,EAAW,MAAM,gBAAgB,CAAA;AAI1E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAOrD,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI,CAAA;AAClD,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAAG;IAC3E,aAAa,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAA;IAChG,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,YAAY,CAAA;CAClG,CAAA;A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E,CAAA;IAED;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,GAAG,IAAI,CAAA;IAE/C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAA;IAE1C;;;OAGG;IACH,KAAK,EAAE,CAAC,EAAE,CAAA;IAEV;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;OAEG;IAEH,eAAe,EAAE,MAAM,EAAE,CAAA;IAEzB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAA;IAE5D;;OAEG;IACH,gBAAgB,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAExC;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAEtC;;OAEG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;IAEtC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IAErE,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAUD,iBAAS,gBAAgB,CAAC,CAAC,SAAS,qBAAqB,EAAE,KAAK,EAAE,6BAA6B,CAAC,CAAC,CAAC,qBAgRjG;kBAhRQ,gBAAgB;;;;AAoRzB,MAAM,MAAM,qBAAqB,GAAG,cAAc,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAC3E,eAAe,gBAAgB,CAAA"}
|
|
@@ -241,5 +241,6 @@ function AutocompleteMenu(props) {
|
|
|
241
241
|
}
|
|
242
242
|
AutocompleteMenu.displayName = "AutocompleteMenu";
|
|
243
243
|
AutocompleteMenu.displayName = 'AutocompleteMenu';
|
|
244
|
+
AutocompleteMenu.__SLOT__ = Symbol('Autocomplete.Menu');
|
|
244
245
|
|
|
245
246
|
export { AutocompleteMenu as default };
|
|
@@ -15,6 +15,7 @@ type AutocompleteOverlayInternalProps = {
|
|
|
15
15
|
declare function AutocompleteOverlay({ menuAnchorRef, overlayProps: oldOverlayProps, children, ...newOverlayProps }: AutocompleteOverlayInternalProps): React.JSX.Element | null;
|
|
16
16
|
declare namespace AutocompleteOverlay {
|
|
17
17
|
var displayName: string;
|
|
18
|
+
var __SLOT__: symbol;
|
|
18
19
|
}
|
|
19
20
|
export type AutocompleteOverlayProps = ComponentProps<typeof AutocompleteOverlay>;
|
|
20
21
|
export default AutocompleteOverlay;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteOverlay.d.ts","sourceRoot":"","sources":["../../src/Autocomplete/AutocompleteOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAOlD,KAAK,gCAAgC,GAAG;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,GAAG,OAAO,CAAC,YAAY,CAAC,GACvB,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;AAE/C,iBAAS,mBAAmB,CAAC,EAC3B,aAAa,EACb,YAAY,EAAE,eAAe,EAC7B,QAAQ,EACR,GAAG,eAAe,EACnB,EAAE,gCAAgC,4BA6ClC;kBAlDQ,mBAAmB
|
|
1
|
+
{"version":3,"file":"AutocompleteOverlay.d.ts","sourceRoot":"","sources":["../../src/Autocomplete/AutocompleteOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAA;AAOlD,KAAK,gCAAgC,GAAG;IACtC;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IAC5C;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IACpC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,GAAG,OAAO,CAAC,YAAY,CAAC,GACvB,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;AAE/C,iBAAS,mBAAmB,CAAC,EAC3B,aAAa,EACb,YAAY,EAAE,eAAe,EAC7B,QAAQ,EACR,GAAG,eAAe,EACnB,EAAE,gCAAgC,4BA6ClC;kBAlDQ,mBAAmB;;;;AAsD5B,MAAM,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAA;AACjF,eAAe,mBAAmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarStack.d.ts","sourceRoot":"","sources":["../../src/AvatarStack/AvatarStack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAGxD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"AvatarStack.d.ts","sourceRoot":"","sources":["../../src/AvatarStack/AvatarStack.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAA;AAGxD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAiBhE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAA;IAC7B,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;IACvC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,CAAA;AA8BD,QAAA,MAAM,WAAW,GAAI,kFASlB,gBAAgB,sBAwHlB,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -4,7 +4,6 @@ import { DEFAULT_AVATAR_SIZE } from '../Avatar/Avatar.js';
|
|
|
4
4
|
import { isResponsiveValue } from '../hooks/useResponsiveValue.js';
|
|
5
5
|
import classes from './AvatarStack.module.css.js';
|
|
6
6
|
import { hasInteractiveNodes } from '../internal/utils/hasInteractiveNodes.js';
|
|
7
|
-
import { BoxWithFallback } from '../internal/components/BoxWithFallback.js';
|
|
8
7
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
8
|
|
|
10
9
|
const transformChildren = (children, shape) => {
|
|
@@ -118,8 +117,7 @@ const AvatarStack = ({
|
|
|
118
117
|
'--avatar-stack-size': `${size}px`
|
|
119
118
|
};
|
|
120
119
|
};
|
|
121
|
-
return /*#__PURE__*/jsx(
|
|
122
|
-
as: "span",
|
|
120
|
+
return /*#__PURE__*/jsx("span", {
|
|
123
121
|
"data-variant": variant,
|
|
124
122
|
"data-shape": shape,
|
|
125
123
|
"data-avatar-count": count > 3 ? '3+' : count,
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
} & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? 'a' : As>, 'as'> & {
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import { type PolymorphicProps } from '../utils/modern-polymorphic';
|
|
3
|
+
export type BranchNameProps<As extends React.ElementType> = PolymorphicProps<As, 'a', {
|
|
5
4
|
className?: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
as?: As | undefined;
|
|
11
|
-
} & DistributiveOmit<React.ComponentPropsWithRef<React.ElementType<any, keyof React.JSX.IntrinsicElements> extends As ? "a" : As>, "as"> & {
|
|
5
|
+
}>;
|
|
6
|
+
declare const _default: <As extends React.ElementType>(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
7
|
+
className?: string;
|
|
8
|
+
} extends infer T ? T extends React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & {
|
|
12
9
|
className?: string;
|
|
10
|
+
} ? T extends unknown ? Omit<T, "as"> : never : never : never) & {
|
|
11
|
+
as?: As | undefined;
|
|
13
12
|
} & React.RefAttributes<any>) => React.ReactNode;
|
|
14
13
|
export default _default;
|
|
15
14
|
//# sourceMappingURL=BranchName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchName.d.ts","sourceRoot":"","sources":["../../src/BranchName/BranchName.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BranchName.d.ts","sourceRoot":"","sources":["../../src/BranchName/BranchName.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAkB,KAAK,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAElF,MAAM,MAAM,eAAe,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI,gBAAgB,CAC1E,EAAE,EACF,GAAG,EACH;IACE,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CACF,CAAA;yBAGmB,EAAE,SAAS,KAAK,CAAC,WAAW;gBALhC,MAAM;;gBAAN,MAAM;;;;AAgBtB,wBAA0C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { clsx } from 'clsx';
|
|
4
3
|
import classes from './BranchName.module.css.js';
|
|
4
|
+
import { fixedForwardRef } from '../utils/modern-polymorphic.js';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -57,13 +57,6 @@ function BranchName(props, ref) {
|
|
|
57
57
|
}
|
|
58
58
|
return t2;
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
62
|
-
|
|
63
|
-
const fixedForwardRef = React.forwardRef;
|
|
64
|
-
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
|
-
|
|
67
60
|
BranchName.displayName = 'BranchName';
|
|
68
61
|
var BranchName$1 = fixedForwardRef(BranchName);
|
|
69
62
|
|
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { ButtonProps } from './types';
|
|
2
2
|
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
|
|
3
|
-
import type { BetterSystemStyleObject } from '../sx';
|
|
4
3
|
declare const ButtonComponent: PolymorphicForwardRefComponent<"button", ButtonProps>;
|
|
5
|
-
export
|
|
6
|
-
[key: string]: BetterSystemStyleObject;
|
|
7
|
-
};
|
|
8
|
-
export { ButtonComponent };
|
|
4
|
+
export { ButtonComponent, type ButtonProps };
|
|
9
5
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/Button/Button.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAE/F,QAAA,MAAM,eAAe,EAMf,8BAA8B,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAA;AAI3D,OAAO,EAAC,eAAe,EAAE,KAAK,WAAW,EAAC,CAAA"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -1,103 +1,20 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import { ButtonBase } from './ButtonBase.js';
|
|
3
|
-
import { defaultSxProp } from '../utils/defaultSxProp.js';
|
|
4
3
|
import { jsx } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
5
|
const ButtonComponent = /*#__PURE__*/forwardRef(({
|
|
7
6
|
children,
|
|
8
|
-
sx: sxProp = defaultSxProp,
|
|
9
7
|
...props
|
|
10
8
|
}, forwardedRef) => {
|
|
11
|
-
const {
|
|
12
|
-
block,
|
|
13
|
-
size = 'medium',
|
|
14
|
-
leadingVisual,
|
|
15
|
-
trailingVisual,
|
|
16
|
-
trailingAction
|
|
17
|
-
} = props;
|
|
18
|
-
let sxStyles = sxProp;
|
|
19
|
-
const style = {};
|
|
20
|
-
if (sxProp !== null && Object.keys(sxProp).length > 0) {
|
|
21
|
-
sxStyles = generateCustomSxProp({
|
|
22
|
-
block,
|
|
23
|
-
size,
|
|
24
|
-
leadingVisual,
|
|
25
|
-
trailingVisual,
|
|
26
|
-
trailingAction
|
|
27
|
-
}, sxProp);
|
|
28
|
-
|
|
29
|
-
// @ts-ignore sxProp can have color attribute
|
|
30
|
-
const {
|
|
31
|
-
color
|
|
32
|
-
} = sxProp;
|
|
33
|
-
if (color) style['--button-color'] = color;
|
|
34
|
-
}
|
|
35
9
|
return /*#__PURE__*/jsx(ButtonBase, {
|
|
36
10
|
ref: forwardedRef,
|
|
37
11
|
as: "button",
|
|
38
|
-
sx: sxStyles,
|
|
39
|
-
style: style,
|
|
40
12
|
type: "button",
|
|
41
13
|
...props,
|
|
42
14
|
children: children
|
|
43
15
|
});
|
|
44
16
|
});
|
|
45
|
-
|
|
46
|
-
// This function is used to generate a custom cssSelector for the sxProp
|
|
47
|
-
|
|
48
|
-
// The usual sx prop can like this:
|
|
49
|
-
// sx={{
|
|
50
|
-
// [`@media (max-width: 768px)`]: {
|
|
51
|
-
// '& > ul': {
|
|
52
|
-
// backgroundColor: 'deeppink',
|
|
53
|
-
// },
|
|
54
|
-
// '&:hover': {
|
|
55
|
-
// backgroundColor: 'yellow',
|
|
56
|
-
// },
|
|
57
|
-
// },
|
|
58
|
-
// '&:hover': {
|
|
59
|
-
// backgroundColor: 'yellow',
|
|
60
|
-
// },
|
|
61
|
-
// '&': {
|
|
62
|
-
// width : 320px
|
|
63
|
-
// }
|
|
64
|
-
// }}
|
|
65
|
-
//*
|
|
66
|
-
/* What we want for Button styles is this:
|
|
67
|
-
sx={{
|
|
68
|
-
// [`@media (max-width: 768px)`]: {
|
|
69
|
-
// '&[data-attribute="something"] > ul': {
|
|
70
|
-
// backgroundColor: 'deeppink',
|
|
71
|
-
// },
|
|
72
|
-
// '&[data-attribute="something"]:hover': {
|
|
73
|
-
// backgroundColor: 'yellow',
|
|
74
|
-
// },
|
|
75
|
-
// },
|
|
76
|
-
// '&[data-attribute="something"]:hover': {
|
|
77
|
-
// backgroundColor: 'yellow',
|
|
78
|
-
// },
|
|
79
|
-
// '&[data-attribute="something"]': {
|
|
80
|
-
// width : 320px
|
|
81
|
-
// }
|
|
82
|
-
// }}
|
|
83
|
-
|
|
84
|
-
// We need to make sure we append the customCSSSelector to the original class selector. i.e & - > &[data-attribute="Icon"][data-size="small"]
|
|
85
|
-
*/
|
|
86
|
-
function generateCustomSxProp(props, providedSx) {
|
|
87
|
-
// Possible data attributes: data-size, data-block, data-no-visuals
|
|
88
|
-
const size = `[data-size="${props.size}"]`;
|
|
89
|
-
const block = props.block ? `[data-block="block"]` : '';
|
|
90
|
-
const noVisuals = props.leadingVisual || props.trailingVisual || props.trailingAction ? '' : '[data-no-visuals]';
|
|
91
|
-
|
|
92
|
-
// this is a custom selector. We need to make sure we add the data attributes to the base css class (& -> &[data-attributename="value"]])
|
|
93
|
-
const cssSelector = `&${size}${block}${noVisuals}`; // &[data-size="small"][data-block="block"][data-no-visuals]
|
|
94
|
-
|
|
95
|
-
const customSxProp = {};
|
|
96
|
-
if (!providedSx) return customSxProp;else {
|
|
97
|
-
customSxProp[cssSelector] = providedSx;
|
|
98
|
-
return customSxProp;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
17
|
ButtonComponent.displayName = 'Button';
|
|
18
|
+
ButtonComponent.__SLOT__ = Symbol('Button');
|
|
102
19
|
|
|
103
|
-
export { ButtonComponent
|
|
20
|
+
export { ButtonComponent };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"ButtonBase.d.ts","sourceRoot":"","sources":["../../src/Button/ButtonBase.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAC/F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAA;AA0BxC,QAAA,MAAM,UAAU,EAkKV,8BAA8B,CAAC,QAAQ,GAAG,GAAG,EAAE,WAAW,CAAC,CAAA;AAEjE,OAAO,EAAC,UAAU,EAAC,CAAA"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import sx from '../sx.js';
|
|
4
|
-
import { getAlignContentSize } from './styles.js';
|
|
5
2
|
import { useRefObjectAsForwardedRef } from '../hooks/useRefObjectAsForwardedRef.js';
|
|
6
|
-
import { defaultSxProp } from '../utils/defaultSxProp.js';
|
|
7
3
|
import { ConditionalWrapper } from '../internal/components/ConditionalWrapper.js';
|
|
8
4
|
import { clsx } from 'clsx';
|
|
9
5
|
import classes from './ButtonBase.module.css.js';
|
|
@@ -15,10 +11,6 @@ import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
|
15
11
|
import { AriaStatus } from '../live-region/AriaStatus.js';
|
|
16
12
|
import CounterLabel from '../CounterLabel/CounterLabel.js';
|
|
17
13
|
|
|
18
|
-
const BoxTemporaryWorkaround = styled.span.withConfig({
|
|
19
|
-
displayName: "ButtonBase__BoxTemporaryWorkaround",
|
|
20
|
-
componentId: "sc-107cqdy-0"
|
|
21
|
-
})(["", ";"], sx);
|
|
22
14
|
const renderModuleVisual = (Visual, loading, visualName, counterLabel) => /*#__PURE__*/jsx("span", {
|
|
23
15
|
"data-component": visualName,
|
|
24
16
|
className: clsx(!counterLabel && classes.Visual, loading ? classes.LoadingSpinner : classes.VisualWrap),
|
|
@@ -30,7 +22,6 @@ renderModuleVisual.displayName = "renderModuleVisual";
|
|
|
30
22
|
const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
31
23
|
children,
|
|
32
24
|
as: Component = 'button',
|
|
33
|
-
sx: sxProp = defaultSxProp,
|
|
34
25
|
...props
|
|
35
26
|
}, forwardedRef) => {
|
|
36
27
|
const {
|
|
@@ -74,82 +65,6 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
74
65
|
}
|
|
75
66
|
}, [innerRef]);
|
|
76
67
|
}
|
|
77
|
-
if (sxProp !== defaultSxProp) {
|
|
78
|
-
return /*#__PURE__*/jsxs(ConditionalWrapper
|
|
79
|
-
// If anything is passed to `loading`, we need the wrapper:
|
|
80
|
-
// If we just checked for `loading` as a boolean, the wrapper wouldn't be rendered
|
|
81
|
-
// when `loading` is `false`.
|
|
82
|
-
// Then, the component re-renders in a way that the button will lose focus when switching between loading states.
|
|
83
|
-
, {
|
|
84
|
-
if: typeof loading !== 'undefined',
|
|
85
|
-
className: block ? classes.ConditionalWrapper : undefined,
|
|
86
|
-
"data-loading-wrapper": true,
|
|
87
|
-
children: [/*#__PURE__*/jsx(BoxTemporaryWorkaround, {
|
|
88
|
-
as: Component,
|
|
89
|
-
sx: sxProp,
|
|
90
|
-
"aria-disabled": loading ? true : undefined,
|
|
91
|
-
...rest,
|
|
92
|
-
ref: innerRef,
|
|
93
|
-
className: clsx(classes.ButtonBase, className),
|
|
94
|
-
"data-block": block ? 'block' : null,
|
|
95
|
-
"data-inactive": inactive ? true : undefined,
|
|
96
|
-
"data-loading": Boolean(loading),
|
|
97
|
-
"data-no-visuals": !LeadingVisual && !TrailingVisual && !TrailingAction ? true : undefined,
|
|
98
|
-
"data-size": size,
|
|
99
|
-
"data-variant": variant,
|
|
100
|
-
"data-label-wrap": labelWrap,
|
|
101
|
-
"data-has-count": count !== undefined ? true : undefined,
|
|
102
|
-
"aria-describedby": [loadingAnnouncementID, ariaDescribedBy].filter(descriptionID => Boolean(descriptionID)).join(' ')
|
|
103
|
-
// aria-labelledby is needed because the accessible name becomes unset when the button is in a loading state.
|
|
104
|
-
// We only set it when the button is in a loading state because it will supersede the aria-label when the screen
|
|
105
|
-
// reader announces the button name.
|
|
106
|
-
,
|
|
107
|
-
"aria-labelledby": loading ? [`${uuid}-label`, ariaLabelledBy].filter(labelID => Boolean(labelID)).join(' ') : ariaLabelledBy,
|
|
108
|
-
id: id,
|
|
109
|
-
onClick: loading ? undefined : onClick,
|
|
110
|
-
children: Icon ? loading ? /*#__PURE__*/jsx(Spinner, {
|
|
111
|
-
size: "small"
|
|
112
|
-
}) : isElement(Icon) ? Icon : /*#__PURE__*/jsx(Icon, {}) : /*#__PURE__*/jsxs(Fragment, {
|
|
113
|
-
children: [/*#__PURE__*/jsxs(BoxTemporaryWorkaround, {
|
|
114
|
-
"data-component": "buttonContent",
|
|
115
|
-
sx: getAlignContentSize(alignContent),
|
|
116
|
-
className: classes.ButtonContent,
|
|
117
|
-
children: [
|
|
118
|
-
/* If there are no leading/trailing visuals/actions to replace with a loading spinner,
|
|
119
|
-
render a loading spiner in place of the button content. */
|
|
120
|
-
loading && !LeadingVisual && !TrailingVisual && !TrailingAction && count === undefined && renderModuleVisual(Spinner, loading, 'loadingSpinner', false),
|
|
121
|
-
/* Render a leading visual unless the button is in a loading state.
|
|
122
|
-
Then replace the leading visual with a loading spinner. */
|
|
123
|
-
LeadingVisual && renderModuleVisual(LeadingVisual, Boolean(loading), 'leadingVisual', false), children && /*#__PURE__*/jsx("span", {
|
|
124
|
-
"data-component": "text",
|
|
125
|
-
className: classes.Label,
|
|
126
|
-
id: loading ? `${uuid}-label` : undefined,
|
|
127
|
-
children: children
|
|
128
|
-
}),
|
|
129
|
-
/* If there is a count, render a counter label unless there is a trailing visual.
|
|
130
|
-
Then render the counter label as a trailing visual.
|
|
131
|
-
Replace the counter label or the trailing visual with a loading spinner if:
|
|
132
|
-
- the button is in a loading state
|
|
133
|
-
- there is no leading visual to replace with a loading spinner
|
|
134
|
-
*/
|
|
135
|
-
count !== undefined && !TrailingVisual ? renderModuleVisual(() => /*#__PURE__*/jsx(CounterLabel, {
|
|
136
|
-
className: classes.CounterLabel,
|
|
137
|
-
"data-component": "ButtonCounter",
|
|
138
|
-
children: count
|
|
139
|
-
}), Boolean(loading) && !LeadingVisual, 'trailingVisual', true) : TrailingVisual ? renderModuleVisual(TrailingVisual, Boolean(loading) && !LeadingVisual, 'trailingVisual', false) : null]
|
|
140
|
-
}),
|
|
141
|
-
/* If there is a trailing action, render it unless the button is in a loading state
|
|
142
|
-
and there is no leading or trailing visual to replace with a loading spinner. */
|
|
143
|
-
TrailingAction && renderModuleVisual(TrailingAction, Boolean(loading) && !LeadingVisual && !TrailingVisual, 'trailingAction', false)]
|
|
144
|
-
})
|
|
145
|
-
}), loading && /*#__PURE__*/jsx(VisuallyHidden, {
|
|
146
|
-
children: /*#__PURE__*/jsx(AriaStatus, {
|
|
147
|
-
id: loadingAnnouncementID,
|
|
148
|
-
children: loadingAnnouncement
|
|
149
|
-
})
|
|
150
|
-
})]
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
68
|
return /*#__PURE__*/jsxs(ConditionalWrapper
|
|
154
69
|
// If anything is passed to `loading`, we need the wrapper:
|
|
155
70
|
// If we just checked for `loading` as a boolean, the wrapper wouldn't be rendered
|
|
@@ -192,10 +107,10 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
192
107
|
className: classes.ButtonContent,
|
|
193
108
|
children: [
|
|
194
109
|
/* If there are no leading/trailing visuals/actions to replace with a loading spinner,
|
|
195
|
-
|
|
110
|
+
render a loading spiner in place of the button content. */
|
|
196
111
|
loading && !LeadingVisual && !TrailingVisual && !TrailingAction && count === undefined && renderModuleVisual(Spinner, loading, 'loadingSpinner', false),
|
|
197
112
|
/* Render a leading visual unless the button is in a loading state.
|
|
198
|
-
|
|
113
|
+
Then replace the leading visual with a loading spinner. */
|
|
199
114
|
LeadingVisual && renderModuleVisual(LeadingVisual, Boolean(loading), 'leadingVisual', false), children && /*#__PURE__*/jsx("span", {
|
|
200
115
|
"data-component": "text",
|
|
201
116
|
className: classes.Label,
|
|
@@ -203,11 +118,11 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
203
118
|
children: children
|
|
204
119
|
}),
|
|
205
120
|
/* If there is a count, render a counter label unless there is a trailing visual.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
121
|
+
Then render the counter label as a trailing visual.
|
|
122
|
+
Replace the counter label or the trailing visual with a loading spinner if:
|
|
123
|
+
- the button is in a loading state
|
|
124
|
+
- there is no leading visual to replace with a loading spinner
|
|
125
|
+
*/
|
|
211
126
|
count !== undefined && !TrailingVisual ? renderModuleVisual(() => /*#__PURE__*/jsx(CounterLabel, {
|
|
212
127
|
className: classes.CounterLabel,
|
|
213
128
|
"data-component": "ButtonCounter",
|
|
@@ -215,7 +130,7 @@ const ButtonBase = /*#__PURE__*/forwardRef(({
|
|
|
215
130
|
}), Boolean(loading) && !LeadingVisual, 'trailingVisual', true) : TrailingVisual ? renderModuleVisual(TrailingVisual, Boolean(loading) && !LeadingVisual, 'trailingVisual', false) : null]
|
|
216
131
|
}),
|
|
217
132
|
/* If there is a trailing action, render it unless the button is in a loading state
|
|
218
|
-
|
|
133
|
+
and there is no leading or trailing visual to replace with a loading spinner. */
|
|
219
134
|
TrailingAction && renderModuleVisual(TrailingAction, Boolean(loading) && !LeadingVisual && !TrailingVisual, 'trailingAction', false)]
|
|
220
135
|
})
|
|
221
136
|
}), loading && /*#__PURE__*/jsx(VisuallyHidden, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/Button/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/Button/IconButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAO/F,QAAA,MAAM,UAAU,EA+DX,8BAA8B,CAAC,QAAQ,GAAG,GAAG,EAAE,eAAe,CAAC,CAAA;AAEpE,OAAO,EAAC,UAAU,EAAC,CAAA"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { ButtonBase } from './ButtonBase.js';
|
|
3
|
-
import { defaultSxProp } from '../utils/defaultSxProp.js';
|
|
4
|
-
import { generateCustomSxProp } from './Button.js';
|
|
5
3
|
import { TooltipContext, Tooltip } from '../TooltipV2/Tooltip.js';
|
|
6
4
|
import { TooltipContext as TooltipContext$1 } from '../Tooltip/Tooltip.js';
|
|
7
5
|
import classes from './ButtonBase.module.css.js';
|
|
@@ -9,7 +7,6 @@ import { clsx } from 'clsx';
|
|
|
9
7
|
import { jsx } from 'react/jsx-runtime';
|
|
10
8
|
|
|
11
9
|
const IconButton = /*#__PURE__*/forwardRef(({
|
|
12
|
-
sx: sxProp = defaultSxProp,
|
|
13
10
|
icon: Icon,
|
|
14
11
|
'aria-label': ariaLabel,
|
|
15
12
|
description,
|
|
@@ -22,17 +19,6 @@ const IconButton = /*#__PURE__*/forwardRef(({
|
|
|
22
19
|
className,
|
|
23
20
|
...props
|
|
24
21
|
}, forwardedRef) => {
|
|
25
|
-
let sxStyles = sxProp;
|
|
26
|
-
// grap the button props that have associated data attributes in the styles
|
|
27
|
-
const {
|
|
28
|
-
size = 'medium'
|
|
29
|
-
} = props;
|
|
30
|
-
if (sxProp !== null && Object.keys(sxProp).length > 0) {
|
|
31
|
-
sxStyles = generateCustomSxProp({
|
|
32
|
-
size
|
|
33
|
-
}, sxProp);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
22
|
// If the icon button is already wrapped in a tooltip, do not add one.
|
|
37
23
|
const {
|
|
38
24
|
tooltipId
|
|
@@ -48,7 +34,6 @@ const IconButton = /*#__PURE__*/forwardRef(({
|
|
|
48
34
|
icon: Icon,
|
|
49
35
|
className: clsx(className, classes.IconButton),
|
|
50
36
|
"data-component": "IconButton",
|
|
51
|
-
sx: sxStyles,
|
|
52
37
|
type: "button",
|
|
53
38
|
"aria-label": ariaLabel,
|
|
54
39
|
disabled: disabled,
|
|
@@ -68,7 +53,6 @@ const IconButton = /*#__PURE__*/forwardRef(({
|
|
|
68
53
|
icon: Icon,
|
|
69
54
|
className: clsx(className, classes.IconButton),
|
|
70
55
|
"data-component": "IconButton",
|
|
71
|
-
sx: sxStyles,
|
|
72
56
|
type: "button",
|
|
73
57
|
"aria-keyshortcuts": keyshortcuts !== null && keyshortcuts !== void 0 ? keyshortcuts : undefined
|
|
74
58
|
// If description is provided, we will use the tooltip to describe the button, so we need to keep the aria-label to label the button.
|