@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { MaxWidthProps } from 'styled-system';
|
|
3
2
|
import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
|
|
4
3
|
type TruncateProps = React.HTMLAttributes<HTMLElement> & {
|
|
5
4
|
title: string;
|
|
6
5
|
inline?: boolean;
|
|
7
6
|
expandable?: boolean;
|
|
8
|
-
|
|
7
|
+
maxWidth?: number | string;
|
|
8
|
+
};
|
|
9
9
|
declare const Truncate: PolymorphicForwardRefComponent<"div", TruncateProps>;
|
|
10
10
|
export type { TruncateProps };
|
|
11
11
|
export default Truncate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Truncate.d.ts","sourceRoot":"","sources":["../../src/Truncate/Truncate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"Truncate.d.ts","sourceRoot":"","sources":["../../src/Truncate/Truncate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAG/F,KAAK,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG;IACvD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,QAAA,MAAM,QAAQ,EAuBR,8BAA8B,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;AAM1D,YAAY,EAAC,aAAa,EAAC,CAAA;AAC3B,eAAe,QAAQ,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-UnderlineNav-MenuItemContent-k4WNL{align-items:center;display:flex;justify-content:space-between}.prc-UnderlineNav-MoreButton-smema{background:transparent;border:0;box-shadow:none;font-weight:var(--base-text-weight-normal,400);margin:0;padding:var(--base-size-4,.25rem) var(--base-size-8,.5rem)}.prc-UnderlineNav-MoreButton-smema>[data-component=trailingVisual]{margin-left:0}
|
|
2
|
+
/*# sourceMappingURL=UnderlineNav-4344d9b0.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/UnderlineNav/UnderlineNav.module.css"],"names":[],"mappings":"AAAA,wCAEE,kBAAmB,CADnB,YAAa,CAEb,6BACF,CAGA,mCAGE,sBAAuB,CADvB,QAAS,CAGT,eAAgB,CADhB,8CAA2C,CAH3C,QAAS,CAQT,0DAKF,CAHE,mEACE,aACF","file":"UnderlineNav-4344d9b0.css","sourcesContent":[".MenuItemContent {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n/* More button styles migrated from styles.ts (was moreBtnStyles) */\n.MoreButton {\n margin: 0; /* reset Safari extra margin */\n border: 0;\n background: transparent;\n font-weight: var(--base-text-weight-normal);\n box-shadow: none;\n padding-top: var(--base-size-4);\n padding-bottom: var(--base-size-4);\n padding-left: var(--base-size-8);\n padding-right: var(--base-size-8);\n\n & > [data-component='trailingVisual'] {\n margin-left: 0;\n }\n}\n"]}
|
|
@@ -16,7 +16,6 @@ export type UnderlineNavProps = {
|
|
|
16
16
|
variant?: 'inset' | 'flush';
|
|
17
17
|
};
|
|
18
18
|
export declare const MORE_BTN_WIDTH = 86;
|
|
19
|
-
export declare const MoreMenuListItem: import("styled-components").StyledComponent<"li", any, {}, never>;
|
|
20
19
|
export declare const getValidChildren: (children: React.ReactNode) => React.ReactElement[];
|
|
21
20
|
export declare const UnderlineNav: React.ForwardRefExoticComponent<UnderlineNavProps & React.RefAttributes<unknown>>;
|
|
22
21
|
//# sourceMappingURL=UnderlineNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6D,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6D,MAAM,OAAO,CAAA;AAmBjF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,cAAc,KAAK,CAAA;AAoEhC,eAAO,MAAM,gBAAgB,GAAI,UAAU,KAAK,CAAC,SAAS,KACgC,KAAK,CAAC,YAAY,EAC3G,CAAA;AAgCD,eAAO,MAAM,YAAY,mFA8RxB,CAAA"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef, useRef, useState, useEffect, useCallback } from 'react';
|
|
2
2
|
import { UnderlineNavContext } from './UnderlineNavContext.js';
|
|
3
3
|
import { useResizeObserver } from '../hooks/useResizeObserver.js';
|
|
4
|
-
import { useTheme } from '../ThemeProvider.js';
|
|
5
4
|
import VisuallyHidden from '../_VisuallyHidden.js';
|
|
6
|
-
import {
|
|
5
|
+
import { dividerStyles, baseMenuMinWidth, menuItemStyles } from './styles.js';
|
|
7
6
|
import { UnderlineWrapper, UnderlineItemList, LoadingCounter, GAP } from '../internal/components/UnderlineTabbedInterface.js';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
7
|
import { TriangleDownIcon } from '@primer/octicons-react';
|
|
10
8
|
import { useOnEscapePress } from '../hooks/useOnEscapePress.js';
|
|
11
9
|
import { useOnOutsideClick } from '../hooks/useOnOutsideClick.js';
|
|
@@ -13,6 +11,7 @@ import { useId } from '../hooks/useId.js';
|
|
|
13
11
|
import { ActionList } from '../ActionList/index.js';
|
|
14
12
|
import { invariant } from '../utils/invariant.js';
|
|
15
13
|
import classes from './UnderlineNav.module.css.js';
|
|
14
|
+
import { getAnchoredPosition } from '@primer/behaviors';
|
|
16
15
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
17
16
|
import { ButtonComponent } from '../Button/Button.js';
|
|
18
17
|
import CounterLabel from '../CounterLabel/CounterLabel.js';
|
|
@@ -22,10 +21,6 @@ import CounterLabel from '../CounterLabel/CounterLabel.js';
|
|
|
22
21
|
const MORE_BTN_WIDTH = 86;
|
|
23
22
|
// The height is needed to make sure we don't have a layout shift when the more button is the only item in the nav.
|
|
24
23
|
const MORE_BTN_HEIGHT = 45;
|
|
25
|
-
const MoreMenuListItem = styled.li.withConfig({
|
|
26
|
-
displayName: "UnderlineNav__MoreMenuListItem",
|
|
27
|
-
componentId: "sc-1jfr31k-0"
|
|
28
|
-
})(["display:flex;align-items:center;height:", "px;"], MORE_BTN_HEIGHT);
|
|
29
24
|
const overflowEffect = (navWidth, moreMenuWidth, childArray, childWidthArray, noIconChildWidthArray, updateListAndMenu) => {
|
|
30
25
|
let iconsVisible = true;
|
|
31
26
|
if (childWidthArray.length === 0) {
|
|
@@ -101,6 +96,20 @@ const calculatePossibleItems = (childWidthArray, navWidth, moreMenuWidth = 0) =>
|
|
|
101
96
|
}
|
|
102
97
|
return breakpoint;
|
|
103
98
|
};
|
|
99
|
+
|
|
100
|
+
// Inline styles converted from baseMenuStyles for use as CSSProperties
|
|
101
|
+
const baseMenuInlineStyles = {
|
|
102
|
+
position: 'absolute',
|
|
103
|
+
zIndex: 1,
|
|
104
|
+
top: '90%',
|
|
105
|
+
boxShadow: '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)',
|
|
106
|
+
borderRadius: 12,
|
|
107
|
+
background: 'var(--overlay-bgColor)',
|
|
108
|
+
listStyle: 'none',
|
|
109
|
+
minWidth: `${baseMenuMinWidth}px`,
|
|
110
|
+
maxWidth: '640px',
|
|
111
|
+
right: 0
|
|
112
|
+
};
|
|
104
113
|
const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
105
114
|
as = 'nav',
|
|
106
115
|
'aria-label': ariaLabel,
|
|
@@ -117,9 +126,6 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
117
126
|
const moreMenuBtnRef = useRef(null);
|
|
118
127
|
const containerRef = React.useRef(null);
|
|
119
128
|
const disclosureWidgetId = useId();
|
|
120
|
-
const {
|
|
121
|
-
theme
|
|
122
|
-
} = useTheme();
|
|
123
129
|
const [isWidgetOpen, setIsWidgetOpen] = useState(false);
|
|
124
130
|
const [iconsVisible, setIconsVisible] = useState(true);
|
|
125
131
|
const [childWidthArray, setChildWidthArray] = useState([]);
|
|
@@ -246,9 +252,26 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
246
252
|
const moreMenuWidth = (_moreMenuRef$current$ = (_moreMenuRef$current = moreMenuRef.current) === null || _moreMenuRef$current === void 0 ? void 0 : _moreMenuRef$current.getBoundingClientRect().width) !== null && _moreMenuRef$current$ !== void 0 ? _moreMenuRef$current$ : 0;
|
|
247
253
|
navWidth !== 0 && overflowEffect(navWidth, moreMenuWidth, validChildren, childWidthArray, noIconChildWidthArray, updateListAndMenu);
|
|
248
254
|
}, navRef);
|
|
255
|
+
|
|
256
|
+
// Compute menuInlineStyles if needed
|
|
257
|
+
let menuInlineStyles = {
|
|
258
|
+
...baseMenuInlineStyles
|
|
259
|
+
};
|
|
260
|
+
if (containerRef.current && listRef.current) {
|
|
261
|
+
const {
|
|
262
|
+
left
|
|
263
|
+
} = getAnchoredPosition(containerRef.current, listRef.current, {
|
|
264
|
+
align: 'start',
|
|
265
|
+
side: 'outside-bottom'
|
|
266
|
+
});
|
|
267
|
+
menuInlineStyles = {
|
|
268
|
+
...baseMenuInlineStyles,
|
|
269
|
+
right: undefined,
|
|
270
|
+
left
|
|
271
|
+
};
|
|
272
|
+
}
|
|
249
273
|
return /*#__PURE__*/jsxs(UnderlineNavContext.Provider, {
|
|
250
274
|
value: {
|
|
251
|
-
theme,
|
|
252
275
|
setChildrenWidth,
|
|
253
276
|
setNoIconChildrenWidth,
|
|
254
277
|
loadingCounters,
|
|
@@ -266,13 +289,18 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
266
289
|
children: /*#__PURE__*/jsxs(UnderlineItemList, {
|
|
267
290
|
ref: listRef,
|
|
268
291
|
role: "list",
|
|
269
|
-
children: [listItems, menuItems.length > 0 && /*#__PURE__*/jsxs(
|
|
292
|
+
children: [listItems, menuItems.length > 0 && /*#__PURE__*/jsxs("li", {
|
|
270
293
|
ref: moreMenuRef,
|
|
294
|
+
style: {
|
|
295
|
+
display: 'flex',
|
|
296
|
+
alignItems: 'center',
|
|
297
|
+
height: `${MORE_BTN_HEIGHT}px`
|
|
298
|
+
},
|
|
271
299
|
children: [!onlyMenuVisible && /*#__PURE__*/jsx("div", {
|
|
272
|
-
style:
|
|
300
|
+
style: dividerStyles
|
|
273
301
|
}), /*#__PURE__*/jsx(ButtonComponent, {
|
|
274
302
|
ref: moreMenuBtnRef,
|
|
275
|
-
|
|
303
|
+
className: classes.MoreButton,
|
|
276
304
|
"aria-controls": disclosureWidgetId,
|
|
277
305
|
"aria-expanded": isWidgetOpen,
|
|
278
306
|
onClick: onAnchorClick,
|
|
@@ -294,8 +322,8 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
294
322
|
selectionVariant: "single",
|
|
295
323
|
ref: containerRef,
|
|
296
324
|
id: disclosureWidgetId,
|
|
297
|
-
sx: (_listRef$current2 = listRef.current) !== null && _listRef$current2 !== void 0 && _listRef$current2.clientWidth && listRef.current.clientWidth >= baseMenuMinWidth ? baseMenuStyles : menuStyles(containerRef.current, listRef.current),
|
|
298
325
|
style: {
|
|
326
|
+
...((_listRef$current2 = listRef.current) !== null && _listRef$current2 !== void 0 && _listRef$current2.clientWidth && listRef.current.clientWidth >= baseMenuMinWidth ? baseMenuInlineStyles : menuInlineStyles),
|
|
299
327
|
display: isWidgetOpen ? 'block' : 'none'
|
|
300
328
|
},
|
|
301
329
|
children: menuItems.map((menuItem, index) => {
|
|
@@ -315,7 +343,7 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
315
343
|
event, updateListAndMenu);
|
|
316
344
|
}
|
|
317
345
|
return /*#__PURE__*/jsx(ActionList.LinkItem, {
|
|
318
|
-
|
|
346
|
+
style: menuItemStyles,
|
|
319
347
|
onClick: event => {
|
|
320
348
|
// When there are no items in the list, do not run the swap function as we want to keep everything in the menu.
|
|
321
349
|
!onlyMenuVisible && swapMenuItemWithListItem(menuItem, index, event, updateListAndMenu);
|
|
@@ -344,4 +372,4 @@ const UnderlineNav = /*#__PURE__*/forwardRef(({
|
|
|
344
372
|
});
|
|
345
373
|
UnderlineNav.displayName = 'UnderlineNav';
|
|
346
374
|
|
|
347
|
-
export { MORE_BTN_WIDTH,
|
|
375
|
+
export { MORE_BTN_WIDTH, UnderlineNav, getValidChildren };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import './UnderlineNav-
|
|
1
|
+
import './UnderlineNav-4344d9b0.css';
|
|
2
2
|
|
|
3
|
-
var classes = {"MenuItemContent":"prc-UnderlineNav-MenuItemContent-k4WNL"};
|
|
3
|
+
var classes = {"MenuItemContent":"prc-UnderlineNav-MenuItemContent-k4WNL","MoreButton":"prc-UnderlineNav-MoreButton-smema"};
|
|
4
4
|
|
|
5
5
|
export { classes as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"UnderlineNavContext.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/UnderlineNavContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,eAAO,MAAM,mBAAmB;sBACZ,KAAK,CAAC,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;4BACvC,KAAK,CAAC,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;qBACpD,OAAO;kBACV,OAAO;EAMrB,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import type { BetterSystemStyleObject } from '../sx';
|
|
3
|
-
export declare const getDividerStyle: (theme?: Theme) => {
|
|
1
|
+
export declare const dividerStyles: {
|
|
4
2
|
display: string;
|
|
5
3
|
borderLeft: string;
|
|
6
4
|
width: string;
|
|
@@ -8,18 +6,6 @@ export declare const getDividerStyle: (theme?: Theme) => {
|
|
|
8
6
|
marginRight: string;
|
|
9
7
|
height: string;
|
|
10
8
|
};
|
|
11
|
-
export declare const moreBtnStyles: {
|
|
12
|
-
margin: number;
|
|
13
|
-
border: number;
|
|
14
|
-
background: string;
|
|
15
|
-
fontWeight: string;
|
|
16
|
-
boxShadow: string;
|
|
17
|
-
paddingY: number;
|
|
18
|
-
paddingX: number;
|
|
19
|
-
'& > span[data-component="trailingVisual"]': {
|
|
20
|
-
marginLeft: number;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
9
|
export declare const menuItemStyles: {
|
|
24
10
|
'& > span': {
|
|
25
11
|
display: string;
|
|
@@ -27,12 +13,4 @@ export declare const menuItemStyles: {
|
|
|
27
13
|
textDecoration: string;
|
|
28
14
|
};
|
|
29
15
|
export declare const baseMenuMinWidth = 192;
|
|
30
|
-
export declare const baseMenuStyles: BetterSystemStyleObject;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @param containerRef The Menu List Container Reference.
|
|
34
|
-
* @param listRef The Underline Nav Container Reference.
|
|
35
|
-
* @description This calculates the position of the menu
|
|
36
|
-
*/
|
|
37
|
-
export declare const menuStyles: (containerRef: Element | null, listRef: Element | null) => BetterSystemStyleObject;
|
|
38
16
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/styles.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/UnderlineNav/styles.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;CAOzB,CAAA;AAED,eAAO,MAAM,cAAc;;;;;CAO1B,CAAA;AAED,eAAO,MAAM,gBAAgB,MAAM,CAAA"}
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const getDividerStyle = theme => ({
|
|
1
|
+
const dividerStyles = {
|
|
4
2
|
display: 'inline-block',
|
|
5
3
|
borderLeft: '1px solid',
|
|
6
4
|
width: '1px',
|
|
7
|
-
borderLeftColor:
|
|
8
|
-
marginRight: '
|
|
5
|
+
borderLeftColor: 'var(--borderColor-muted)',
|
|
6
|
+
marginRight: 'var(--base-size-4)',
|
|
9
7
|
height: '24px' // The height of the divider - reference from Figma
|
|
10
|
-
});
|
|
11
|
-
const moreBtnStyles = {
|
|
12
|
-
//set margin 0 here because safari puts extra margin around the button, rest is to reset style to make it look like a list element
|
|
13
|
-
margin: 0,
|
|
14
|
-
border: 0,
|
|
15
|
-
background: 'transparent',
|
|
16
|
-
fontWeight: 'normal',
|
|
17
|
-
boxShadow: 'none',
|
|
18
|
-
paddingY: 1,
|
|
19
|
-
paddingX: 2,
|
|
20
|
-
'& > span[data-component="trailingVisual"]': {
|
|
21
|
-
marginLeft: 0
|
|
22
|
-
}
|
|
23
8
|
};
|
|
24
9
|
const menuItemStyles = {
|
|
25
10
|
// This is needed to hide the selected check icon on the menu item. https://github.com/primer/react/tree/main/packages/react/src/ActionList/Selection.tsx#L32
|
|
@@ -30,45 +15,5 @@ const menuItemStyles = {
|
|
|
30
15
|
textDecoration: 'none'
|
|
31
16
|
};
|
|
32
17
|
const baseMenuMinWidth = 192;
|
|
33
|
-
const baseMenuStyles = {
|
|
34
|
-
position: 'absolute',
|
|
35
|
-
zIndex: 1,
|
|
36
|
-
top: '90%',
|
|
37
|
-
boxShadow: '0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24)',
|
|
38
|
-
borderRadius: '12px',
|
|
39
|
-
backgroundColor: 'canvas.overlay',
|
|
40
|
-
listStyle: 'none',
|
|
41
|
-
// Values are from ActionMenu
|
|
42
|
-
minWidth: `${baseMenuMinWidth}px`,
|
|
43
|
-
maxWidth: '640px',
|
|
44
|
-
right: '0'
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @param containerRef The Menu List Container Reference.
|
|
50
|
-
* @param listRef The Underline Nav Container Reference.
|
|
51
|
-
* @description This calculates the position of the menu
|
|
52
|
-
*/
|
|
53
|
-
const menuStyles = (containerRef, listRef) => {
|
|
54
|
-
if (containerRef && listRef) {
|
|
55
|
-
const {
|
|
56
|
-
left
|
|
57
|
-
} = getAnchoredPosition(containerRef, listRef, {
|
|
58
|
-
align: 'start',
|
|
59
|
-
side: 'outside-bottom'
|
|
60
|
-
});
|
|
61
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
|
-
const {
|
|
63
|
-
right,
|
|
64
|
-
...rest
|
|
65
|
-
} = baseMenuStyles;
|
|
66
|
-
return {
|
|
67
|
-
...rest,
|
|
68
|
-
left
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return baseMenuStyles;
|
|
72
|
-
};
|
|
73
18
|
|
|
74
|
-
export { baseMenuMinWidth,
|
|
19
|
+
export { baseMenuMinWidth, dividerStyles, menuItemStyles };
|
package/dist/constants.js
CHANGED
|
@@ -11,7 +11,7 @@ const get = key => themeGet(key, getKey(theme, key));
|
|
|
11
11
|
|
|
12
12
|
// Common props
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
compose(styledSystem.space, styledSystem.color, styledSystem.display);
|
|
15
15
|
// Typography props
|
|
16
16
|
|
|
17
17
|
const whiteSpace = system({
|
|
@@ -20,9 +20,9 @@ const whiteSpace = system({
|
|
|
20
20
|
// cssProperty: 'whiteSpace',
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
|
|
23
|
+
compose(styledSystem.typography, whiteSpace);
|
|
24
24
|
// Border props
|
|
25
25
|
|
|
26
26
|
compose(styledSystem.border, styledSystem.shadow);
|
|
27
27
|
|
|
28
|
-
export {
|
|
28
|
+
export { get };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/deprecated/ActionList/Divider.module.css"],"names":[],"mappings":"AAAA,8BAGE,6DAAoC,CAFpC,uCAA+B,CAK/B,sCAAiC,CADjC,+CAEF","file":"Divider-7c6b656a.css","sourcesContent":[".Divider {\n height: var(--borderWidth-thin);\n /* stylelint-disable-next-line primer/colors */\n background: var(--borderColor-muted);\n /* stylelint-disable-next-line primer/spacing */\n margin-top: calc(var(--base-size-8) - 1px);\n margin-bottom: var(--base-size-8);\n}\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export declare const StyledDivider: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
1
|
/**
|
|
3
|
-
* Visually separates `
|
|
2
|
+
* Visually separates `Items or `Groups in an `ActionList`.
|
|
4
3
|
*/
|
|
5
4
|
export declare function Divider(): JSX.Element;
|
|
6
5
|
export declare namespace Divider {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/deprecated/ActionList/Divider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/deprecated/ActionList/Divider.tsx"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,OAAO,IAAI,GAAG,CAAC,OAAO,CAErC;yBAFe,OAAO"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import
|
|
3
|
-
import { get } from '../../constants.js';
|
|
2
|
+
import classes from './Divider.module.css.js';
|
|
4
3
|
import { jsx } from 'react/jsx-runtime';
|
|
5
4
|
|
|
6
|
-
const StyledDivider = styled.div.withConfig({
|
|
7
|
-
displayName: "Divider__StyledDivider",
|
|
8
|
-
componentId: "sc-1s7tlfq-0"
|
|
9
|
-
})(["height:1px;background:", ";margin-top:calc(", " - 1px);margin-bottom:", ";"], get('colors.border.muted'), get('space.2'), get('space.2'));
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Visually separates `Item`s or `Group`s in an `ActionList`.
|
|
13
|
-
*/
|
|
14
5
|
function Divider() {
|
|
15
6
|
const $ = c(1);
|
|
16
7
|
let t0;
|
|
17
8
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
18
|
-
t0 = /*#__PURE__*/jsx(
|
|
9
|
+
t0 = /*#__PURE__*/jsx("div", {
|
|
10
|
+
"data-component": "ActionList.Divider",
|
|
11
|
+
className: classes.Divider
|
|
12
|
+
});
|
|
19
13
|
$[0] = t0;
|
|
20
14
|
} else {
|
|
21
15
|
t0 = $[0];
|
|
@@ -31,4 +25,4 @@ function Divider() {
|
|
|
31
25
|
*/
|
|
32
26
|
Divider.renderItem = Divider;
|
|
33
27
|
|
|
34
|
-
export { Divider
|
|
28
|
+
export { Divider };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { SxProp } from '../../sx';
|
|
3
2
|
import type { HeaderProps } from './Header';
|
|
4
3
|
/**
|
|
5
4
|
* Contract for props passed to the `Group` component.
|
|
6
5
|
*/
|
|
7
|
-
export interface GroupProps extends React.ComponentPropsWithoutRef<'div'
|
|
6
|
+
export interface GroupProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
8
7
|
/**
|
|
9
8
|
* Props for a `Header` to render in the `Group`.
|
|
10
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/deprecated/ActionList/Group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../src/deprecated/ActionList/Group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAA;AAGzC;;GAEG;AACH,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACvE;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,EAAE,CAAA;IAErB;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAC,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,EAAC,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAOxE"}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import sx from '../../sx.js';
|
|
4
2
|
import { Header } from './Header.js';
|
|
5
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
4
|
|
|
7
|
-
const StyledGroup = styled.div.withConfig({
|
|
8
|
-
displayName: "Group__StyledGroup",
|
|
9
|
-
componentId: "sc-1s2aw76-0"
|
|
10
|
-
})(["", ""], sx);
|
|
11
|
-
|
|
12
5
|
/**
|
|
13
6
|
* Collects related `Items` in an `ActionList`.
|
|
14
7
|
*/
|
|
@@ -44,7 +37,7 @@ function Group(t0) {
|
|
|
44
37
|
}
|
|
45
38
|
let t2;
|
|
46
39
|
if ($[6] !== items || $[7] !== props || $[8] !== t1) {
|
|
47
|
-
t2 = /*#__PURE__*/jsxs(
|
|
40
|
+
t2 = /*#__PURE__*/jsxs("div", {
|
|
48
41
|
...props,
|
|
49
42
|
children: [t1, items]
|
|
50
43
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-ActionList-Header-tbTgu{color:var(--fgColor-muted,var(--color-fg-muted));font-size:var(--text-body-size-small,.75rem);font-weight:var(--text-title-weight-large,600);padding:6px var(--base-size-16,1rem)}.prc-ActionList-Header-tbTgu:where([data-filled]){background:var(--bgColor-muted,var(--color-canvas-subtle));border-bottom:var(--borderWidth-thin,.0625rem) solid var(--bgColor-neutral-muted,var(--color-neutral-subtle));border-top:var(--borderWidth-thin,.0625rem) solid var(--bgColor-neutral-muted,var(--color-neutral-subtle));margin:var(--base-size-8,.5rem) 0}.prc-ActionList-Header-tbTgu:where([data-filled]):first-child{margin-top:0}
|
|
2
|
+
/*# sourceMappingURL=Header-493b1d76.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/deprecated/ActionList/Header.module.css"],"names":[],"mappings":"AAAA,6BAUE,gDAA2B,CAF3B,4CAAsC,CACtC,8CAA2C,CAF3C,oCAiBF,CAZE,kDACE,0DAAgC,CAKhC,6GAAyE,CAFzE,0GAAsE,CAFtE,iCASF,CAHE,8DACE,YACF","file":"Header-493b1d76.css","sourcesContent":[".Header {\n /* 6px vertical padding + 20px line height = 32px total height\n *\n * TODO: When rem-based spacing on a 4px scale lands, replace\n * hardcoded '6px' with 'calc((${get('space.s32')} - ${get('space.20')}) / 2)'.\n */\n /* stylelint-disable-next-line primer/spacing */\n padding: 6px var(--base-size-16);\n font-size: var(--text-body-size-small);\n font-weight: var(--text-title-weight-large);\n color: var(--fgColor-muted);\n\n &:where([data-filled]) {\n background: var(--bgColor-muted);\n margin: var(--base-size-8) 0;\n /* stylelint-disable-next-line primer/colors */\n border-top: var(--borderWidth-thin) solid var(--bgColor-neutral-muted);\n /* stylelint-disable-next-line primer/colors */\n border-bottom: var(--borderWidth-thin) solid var(--bgColor-neutral-muted);\n\n &:first-child {\n margin-top: 0;\n }\n }\n}\n"]}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { SxProp } from '../../sx';
|
|
3
2
|
/**
|
|
4
3
|
* Contract for props passed to the `Header` component.
|
|
5
4
|
*/
|
|
6
|
-
export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'
|
|
5
|
+
export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
7
6
|
/**
|
|
8
7
|
* Style variations. Usage is discretionary.
|
|
9
8
|
*
|
|
@@ -20,11 +19,8 @@ export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'>, SxPr
|
|
|
20
19
|
*/
|
|
21
20
|
auxiliaryText?: string;
|
|
22
21
|
}
|
|
23
|
-
export declare const StyledHeader: import("styled-components").StyledComponent<"div", any, {
|
|
24
|
-
variant: HeaderProps["variant"];
|
|
25
|
-
} & SxProp, never>;
|
|
26
22
|
/**
|
|
27
23
|
* Displays the name and description of a `Group`.
|
|
28
24
|
*/
|
|
29
|
-
export declare function Header({ variant, title, auxiliaryText, children: _children, ...props }: HeaderProps): JSX.Element;
|
|
25
|
+
export declare function Header({ variant, title, auxiliaryText, children: _children, className, ...props }: HeaderProps): JSX.Element;
|
|
30
26
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/deprecated/ActionList/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/deprecated/ActionList/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC;IACxE;;;;;OAKG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IAE7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAkB,EAClB,KAAK,EACL,aAAa,EACb,QAAQ,EAAE,SAAS,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAa3B"}
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import sx from '../../sx.js';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import classes from './Header.module.css.js';
|
|
5
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
|
-
const StyledHeader = styled.div.withConfig({
|
|
8
|
-
displayName: "Header__StyledHeader",
|
|
9
|
-
componentId: "sc-cjezay-0"
|
|
10
|
-
})(["{}padding:6px ", ";font-size:", ";font-weight:", ";color:", ";", " ", ""], get('space.3'), get('fontSizes.0'), get('fontWeights.bold'), get('colors.fg.muted'), ({
|
|
11
|
-
variant
|
|
12
|
-
}) => variant === 'filled' && css(["background:", ";margin:", " 0;border-top:1px solid ", ";border-bottom:1px solid ", ";&:first-child{margin-top:0;}"], get('colors.canvas.subtle'), get('space.2'), get('colors.neutral.muted'), get('colors.neutral.muted')), sx);
|
|
13
|
-
|
|
14
6
|
/**
|
|
15
7
|
* Displays the name and description of a `Group`.
|
|
16
8
|
*/
|
|
17
9
|
function Header(t0) {
|
|
18
|
-
const $ = c(
|
|
10
|
+
const $ = c(16);
|
|
19
11
|
let auxiliaryText;
|
|
12
|
+
let className;
|
|
20
13
|
let props;
|
|
21
14
|
let t1;
|
|
22
15
|
let title;
|
|
@@ -26,51 +19,67 @@ function Header(t0) {
|
|
|
26
19
|
title: t3,
|
|
27
20
|
auxiliaryText: t4,
|
|
28
21
|
children: _children,
|
|
29
|
-
|
|
22
|
+
className: t5,
|
|
23
|
+
...t6
|
|
30
24
|
} = t0;
|
|
31
25
|
t1 = t2;
|
|
32
26
|
title = t3;
|
|
33
27
|
auxiliaryText = t4;
|
|
34
|
-
|
|
28
|
+
className = t5;
|
|
29
|
+
props = t6;
|
|
35
30
|
$[0] = t0;
|
|
36
31
|
$[1] = auxiliaryText;
|
|
37
|
-
$[2] =
|
|
38
|
-
$[3] =
|
|
39
|
-
$[4] =
|
|
32
|
+
$[2] = className;
|
|
33
|
+
$[3] = props;
|
|
34
|
+
$[4] = t1;
|
|
35
|
+
$[5] = title;
|
|
40
36
|
} else {
|
|
41
37
|
auxiliaryText = $[1];
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
className = $[2];
|
|
39
|
+
props = $[3];
|
|
40
|
+
t1 = $[4];
|
|
41
|
+
title = $[5];
|
|
45
42
|
}
|
|
46
43
|
const variant = t1 === undefined ? "subtle" : t1;
|
|
47
44
|
let t2;
|
|
48
|
-
if ($[
|
|
49
|
-
t2 =
|
|
45
|
+
if ($[6] !== className) {
|
|
46
|
+
t2 = clsx(className, classes.Header);
|
|
47
|
+
$[6] = className;
|
|
48
|
+
$[7] = t2;
|
|
49
|
+
} else {
|
|
50
|
+
t2 = $[7];
|
|
51
|
+
}
|
|
52
|
+
const t3 = variant === "filled" ? "" : undefined;
|
|
53
|
+
let t4;
|
|
54
|
+
if ($[8] !== auxiliaryText) {
|
|
55
|
+
t4 = auxiliaryText && /*#__PURE__*/jsx("span", {
|
|
50
56
|
children: auxiliaryText
|
|
51
57
|
});
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
58
|
+
$[8] = auxiliaryText;
|
|
59
|
+
$[9] = t4;
|
|
54
60
|
} else {
|
|
55
|
-
|
|
61
|
+
t4 = $[9];
|
|
56
62
|
}
|
|
57
|
-
let
|
|
58
|
-
if ($[
|
|
59
|
-
|
|
63
|
+
let t5;
|
|
64
|
+
if ($[10] !== props || $[11] !== t2 || $[12] !== t3 || $[13] !== t4 || $[14] !== title) {
|
|
65
|
+
t5 = /*#__PURE__*/jsxs("div", {
|
|
60
66
|
role: "heading",
|
|
61
|
-
|
|
67
|
+
className: t2,
|
|
68
|
+
"data-filled": t3,
|
|
69
|
+
"data-component": "ActionList.Header",
|
|
62
70
|
...props,
|
|
63
|
-
children: [title,
|
|
71
|
+
children: [title, t4]
|
|
64
72
|
});
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
73
|
+
$[10] = props;
|
|
74
|
+
$[11] = t2;
|
|
75
|
+
$[12] = t3;
|
|
76
|
+
$[13] = t4;
|
|
77
|
+
$[14] = title;
|
|
78
|
+
$[15] = t5;
|
|
70
79
|
} else {
|
|
71
|
-
|
|
80
|
+
t5 = $[15];
|
|
72
81
|
}
|
|
73
|
-
return
|
|
82
|
+
return t5;
|
|
74
83
|
}
|
|
75
84
|
|
|
76
|
-
export { Header
|
|
85
|
+
export { Header };
|