@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,10 +1,11 @@
|
|
|
1
|
+
import { c } from 'react-compiler-runtime';
|
|
1
2
|
import React, { createElement } from 'react';
|
|
2
3
|
import { Group } from './Group.js';
|
|
3
4
|
import { Item } from './Item.js';
|
|
4
5
|
import { Divider } from './Divider.js';
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
6
|
+
import { clsx } from 'clsx';
|
|
7
|
+
import classes from './List.module.css.js';
|
|
8
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Asserts that the given value fulfills the `GroupedListProps` contract.
|
|
@@ -62,87 +63,63 @@ function useListVariant(variant = 'inset') {
|
|
|
62
63
|
* Lists `Item`s, either grouped or ungrouped, with a `Divider` between each `Group`.
|
|
63
64
|
*/
|
|
64
65
|
const List = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
65
|
-
|
|
66
|
+
const $ = c(14);
|
|
66
67
|
const {
|
|
67
68
|
style,
|
|
68
69
|
...restProps
|
|
69
70
|
} = props;
|
|
70
|
-
// Get style objects for `List` children matching the given `List` style variation.
|
|
71
71
|
const {
|
|
72
72
|
firstGroupStyle,
|
|
73
73
|
lastGroupStyle,
|
|
74
74
|
headerStyle,
|
|
75
75
|
itemStyle
|
|
76
76
|
} = useListVariant(restProps.variant);
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Render a `Group` using the first of the following renderers that is defined:
|
|
80
|
-
* A `Group`-level or `List`-level custom `Group` renderer, or
|
|
81
|
-
* the default `Group` renderer.
|
|
82
|
-
*/
|
|
83
77
|
const renderGroup = groupProps => {
|
|
84
78
|
var _ref;
|
|
85
|
-
const GroupComponent = ((_ref =
|
|
79
|
+
const GroupComponent = ((_ref = "renderGroup" in groupProps && groupProps.renderGroup) !== null && _ref !== void 0 ? _ref : restProps.renderGroup) || Group;
|
|
86
80
|
return /*#__PURE__*/createElement(GroupComponent, {
|
|
87
81
|
...groupProps,
|
|
88
82
|
key: groupProps.groupId
|
|
89
83
|
});
|
|
90
84
|
};
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Render an `Item` using the first of the following renderers that is defined:
|
|
94
|
-
* An `Item`-level, `Group`-level, or `List`-level custom `Item` renderer,
|
|
95
|
-
* or the default `Item` renderer.
|
|
96
|
-
*/
|
|
97
85
|
const renderItem = (itemProps, item, itemIndex) => {
|
|
98
86
|
var _ref2, _ref3, _itemProps$id;
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
const key = (_ref2 = (_ref3 = 'key' in itemProps ? itemProps.key : undefined) !== null && _ref3 !== void 0 ? _ref3 : (_itemProps$id = itemProps.id) === null || _itemProps$id === void 0 ? void 0 : _itemProps$id.toString()) !== null && _ref2 !== void 0 ? _ref2 : itemIndex.toString();
|
|
87
|
+
const ItemComponent = "renderItem" in itemProps && itemProps.renderItem || restProps.renderItem || Item;
|
|
88
|
+
const key = (_ref2 = (_ref3 = "key" in itemProps ? itemProps.key : undefined) !== null && _ref3 !== void 0 ? _ref3 : (_itemProps$id = itemProps.id) === null || _itemProps$id === void 0 ? void 0 : _itemProps$id.toString()) !== null && _ref2 !== void 0 ? _ref2 : itemIndex.toString();
|
|
102
89
|
return /*#__PURE__*/createElement(ItemComponent, {
|
|
103
90
|
showDivider: restProps.showItemDividers,
|
|
104
91
|
selectionVariant: restProps.selectionVariant,
|
|
105
92
|
...itemProps,
|
|
106
93
|
key: key,
|
|
107
|
-
|
|
108
|
-
...itemStyle,
|
|
109
|
-
...itemProps.sx
|
|
110
|
-
},
|
|
94
|
+
style: itemStyle,
|
|
111
95
|
item: item
|
|
112
96
|
});
|
|
113
97
|
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* An array of `Group`s, each with an associated `Header` and with an array of `Item`s belonging to that `Group`.
|
|
117
|
-
*/
|
|
118
98
|
let groups = [];
|
|
119
|
-
|
|
120
|
-
// Collect rendered `Item`s into `Group`s, avoiding excess iteration over the lists of `items` and `groupMetadata`:
|
|
121
99
|
if (!isGroupedListProps(restProps)) {
|
|
122
|
-
|
|
100
|
+
let t0;
|
|
101
|
+
if ($[0] !== renderItem) {
|
|
102
|
+
t0 = (item_0, index) => renderItem(item_0, item_0, index);
|
|
103
|
+
$[0] = renderItem;
|
|
104
|
+
$[1] = t0;
|
|
105
|
+
} else {
|
|
106
|
+
t0 = $[1];
|
|
107
|
+
}
|
|
123
108
|
groups = [{
|
|
124
|
-
items: restProps.items.map(
|
|
125
|
-
groupId:
|
|
109
|
+
items: restProps.items.map(t0),
|
|
110
|
+
groupId: "0"
|
|
126
111
|
}];
|
|
127
112
|
} else {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* A map of group identifiers to `Group`s, each with an associated array of `Item`s belonging to that `Group`.
|
|
132
|
-
*/
|
|
133
|
-
const groupMap = restProps.groupMetadata.reduce((groupAccumulator, groupMetadata) => groupAccumulator.set(groupMetadata.groupId, groupMetadata), new Map());
|
|
113
|
+
const groupMap = restProps.groupMetadata.reduce(_temp, new Map());
|
|
134
114
|
for (const itemProps_0 of restProps.items) {
|
|
135
115
|
var _group$items$length, _group$items, _group$items2;
|
|
136
|
-
// Look up the group associated with the current item.
|
|
137
116
|
const group = groupMap.get(itemProps_0.groupId);
|
|
138
117
|
const itemIndex_0 = (_group$items$length = group === null || group === void 0 ? void 0 : (_group$items = group.items) === null || _group$items === void 0 ? void 0 : _group$items.length) !== null && _group$items$length !== void 0 ? _group$items$length : 0;
|
|
139
|
-
|
|
140
|
-
// Upsert the group to include the current item (rendered).
|
|
141
118
|
groupMap.set(itemProps_0.groupId, {
|
|
142
119
|
...group,
|
|
143
120
|
items: [...((_group$items2 = group === null || group === void 0 ? void 0 : group.items) !== null && _group$items2 !== void 0 ? _group$items2 : []), renderItem({
|
|
144
121
|
showDivider: group === null || group === void 0 ? void 0 : group.showItemDividers,
|
|
145
|
-
...(group &&
|
|
122
|
+
...(group && "renderItem" in group && {
|
|
146
123
|
renderItem: group.renderItem
|
|
147
124
|
}),
|
|
148
125
|
...itemProps_0
|
|
@@ -151,49 +128,82 @@ const List = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
|
|
|
151
128
|
}
|
|
152
129
|
groups = [...groupMap.values()];
|
|
153
130
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
131
|
+
let t0;
|
|
132
|
+
if ($[2] !== props.className) {
|
|
133
|
+
t0 = clsx(classes.List, props.className);
|
|
134
|
+
$[2] = props.className;
|
|
135
|
+
$[3] = t0;
|
|
136
|
+
} else {
|
|
137
|
+
t0 = $[3];
|
|
138
|
+
}
|
|
139
|
+
let t1;
|
|
140
|
+
if ($[4] !== style) {
|
|
141
|
+
t1 = style || {};
|
|
142
|
+
$[4] = style;
|
|
143
|
+
$[5] = t1;
|
|
144
|
+
} else {
|
|
145
|
+
t1 = $[5];
|
|
146
|
+
}
|
|
147
|
+
let t2;
|
|
148
|
+
if ($[6] !== t1) {
|
|
149
|
+
t2 = {
|
|
158
150
|
...listStyles,
|
|
159
|
-
...
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
151
|
+
...t1
|
|
152
|
+
};
|
|
153
|
+
$[6] = t1;
|
|
154
|
+
$[7] = t2;
|
|
155
|
+
} else {
|
|
156
|
+
t2 = $[7];
|
|
157
|
+
}
|
|
158
|
+
const t4 = groups.map((t3, index_0) => {
|
|
159
|
+
const {
|
|
168
160
|
header,
|
|
169
161
|
...groupProps_0
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
...groupProps_0
|
|
192
|
-
})]
|
|
193
|
-
}, groupProps_0.groupId);
|
|
194
|
-
})
|
|
162
|
+
} = t3;
|
|
163
|
+
const hasFilledHeader = (header === null || header === void 0 ? void 0 : header.variant) === "filled";
|
|
164
|
+
const shouldShowDivider = index_0 > 0 && !hasFilledHeader;
|
|
165
|
+
return /*#__PURE__*/jsxs(React.Fragment, {
|
|
166
|
+
children: [shouldShowDivider ? /*#__PURE__*/jsx(Divider, {}, `${groupProps_0.groupId}-divider`) : null, renderGroup({
|
|
167
|
+
style: {
|
|
168
|
+
...(index_0 === 0 && firstGroupStyle),
|
|
169
|
+
...(index_0 === groups.length - 1 && lastGroupStyle),
|
|
170
|
+
...(index_0 > 0 && !shouldShowDivider && {
|
|
171
|
+
marginTop: "var(--base-size-8, 8px)"
|
|
172
|
+
})
|
|
173
|
+
},
|
|
174
|
+
...(header && {
|
|
175
|
+
header: {
|
|
176
|
+
...header,
|
|
177
|
+
style: headerStyle
|
|
178
|
+
}
|
|
179
|
+
}),
|
|
180
|
+
...groupProps_0
|
|
181
|
+
})]
|
|
182
|
+
}, groupProps_0.groupId);
|
|
195
183
|
});
|
|
184
|
+
let t5;
|
|
185
|
+
if ($[8] !== forwardedRef || $[9] !== restProps || $[10] !== t0 || $[11] !== t2 || $[12] !== t4) {
|
|
186
|
+
t5 = /*#__PURE__*/jsx("div", {
|
|
187
|
+
...restProps,
|
|
188
|
+
ref: forwardedRef,
|
|
189
|
+
className: t0,
|
|
190
|
+
style: t2,
|
|
191
|
+
children: t4
|
|
192
|
+
});
|
|
193
|
+
$[8] = forwardedRef;
|
|
194
|
+
$[9] = restProps;
|
|
195
|
+
$[10] = t0;
|
|
196
|
+
$[11] = t2;
|
|
197
|
+
$[12] = t4;
|
|
198
|
+
$[13] = t5;
|
|
199
|
+
} else {
|
|
200
|
+
t5 = $[13];
|
|
201
|
+
}
|
|
202
|
+
return t5;
|
|
196
203
|
});
|
|
197
204
|
List.displayName = 'ActionList';
|
|
205
|
+
function _temp(groupAccumulator, groupMetadata) {
|
|
206
|
+
return groupAccumulator.set(groupMetadata.groupId, groupMetadata);
|
|
207
|
+
}
|
|
198
208
|
|
|
199
209
|
export { List };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
.prc-UnderlineNav-UnderlineNav-4E9Yr{border-bottom:var(--borderWidth-thin,.0625rem) solid var(--borderColor-muted,var(--color-border-muted));display:flex;justify-content:space-between}.prc-UnderlineNav-UnderlineNav-4E9Yr.prc-UnderlineNav-UnderlineNav--right-Trs9C{justify-content:flex-end}.prc-UnderlineNav-UnderlineNav-4E9Yr.prc-UnderlineNav-UnderlineNav--right-Trs9C .prc-UnderlineNav-UnderlineNavItem-nmHMS{margin-left:var(--base-size-16,1rem);margin-right:0}.prc-UnderlineNav-UnderlineNav-4E9Yr.prc-UnderlineNav-UnderlineNav--right-Trs9C .prc-UnderlineNav-UnderlineNavActions-onc2h{flex:1 1 auto}.prc-UnderlineNav-UnderlineNav-4E9Yr.prc-UnderlineNav-UnderlineNav--full-kE3kc{display:block}.prc-UnderlineNav-UnderlineNav-4E9Yr .prc-UnderlineNav-UnderlineNavBody-bh1JN{display:flex;margin-bottom:-1px}.prc-UnderlineNav-UnderlineNav-4E9Yr .prc-UnderlineNav-UnderlineNavActions-onc2h{align-self:center}.prc-UnderlineNav-UnderlineNavLink-7BXiO{border-bottom:2px solid transparent;color:var(--fgColor-default,var(--color-fg-default));font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-title-lineHeight-large,1.5);margin-right:var(--base-size-16,1rem);padding:var(--base-size-16,1rem) var(--base-size-8,.5rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}.prc-UnderlineNav-UnderlineNavLink-7BXiO:focus:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-8px}.prc-UnderlineNav-UnderlineNavLink-7BXiO:focus:not(:disabled):not(:focus-visible){outline:1px solid transparent}.prc-UnderlineNav-UnderlineNavLink-7BXiO:focus-visible:not(:disabled){box-shadow:none;outline:2px solid var(--fgColor-accent,var(--color-accent-fg));outline-offset:-8px}.prc-UnderlineNav-UnderlineNavLink-7BXiO:focus,.prc-UnderlineNav-UnderlineNavLink-7BXiO:hover{border-bottom-color:var(--borderColor-muted,var(--color-border-muted));color:var(--fgColor-default,var(--color-fg-default));-webkit-text-decoration:none;text-decoration:none;transition:border-bottom-color .2s ease}.prc-UnderlineNav-UnderlineNavLink-7BXiO:focus .prc-UnderlineNav-UnderlineNavOcticon-Rjr6t,.prc-UnderlineNav-UnderlineNavLink-7BXiO:hover .prc-UnderlineNav-UnderlineNavOcticon-Rjr6t{color:var(--fgColor-muted,var(--color-fg-muted))}.prc-UnderlineNav-UnderlineNavLink-7BXiO:where([data-selected]){border-bottom-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active));color:var(--fgColor-default,var(--color-fg-default))}.prc-UnderlineNav-UnderlineNavLink-7BXiO:where([data-selected]) .prc-UnderlineNav-UnderlineNavOcticon-Rjr6t{color:var(--fgColor-default,var(--color-fg-default))}
|
|
2
|
+
/*# sourceMappingURL=UnderlineNav-0c1e0dff.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/deprecated/UnderlineNav/UnderlineNav.module.css"],"names":[],"mappings":"AAAA,qCAGE,uGAAqE,CAFrE,YAAa,CACb,6BA6BF,CA1BE,gFACE,wBACF,CAEA,yHAEE,oCAAgC,CADhC,cAEF,CAEA,4HACE,aACF,CAEA,+EACE,aACF,CAEA,8EACE,YAAa,CAEb,kBACF,CAEA,iFACE,iBACF,CAGF,yCAQE,mCAAoC,CAHpC,oDAA6B,CAF7B,8CAAuC,CACvC,kDAA+C,CAF/C,qCAAiC,CADjC,yDAA+C,CAK/C,iBAAkB,CAGlB,4BAAqB,CAArB,oBAoBF,CAjBE,8DACE,eAAgB,CAChB,8DAAwC,CACxC,mBAMF,CAHE,kFACE,6BACF,CAIF,sEACE,eAAgB,CAChB,8DAAwC,CACxC,mBACF,CAGF,8FAIE,sEAA6C,CAF7C,oDAA6B,CAC7B,4BAAqB,CAArB,oBAAqB,CAErB,uCACF,CAEA,sLAEE,gDACF,CAEA,gEAEE,4FAA2D,CAD3D,oDAEF,CAEA,4GACE,oDACF","file":"UnderlineNav-0c1e0dff.css","sourcesContent":[".UnderlineNav {\n display: flex;\n justify-content: space-between;\n border-bottom: var(--borderWidth-thin) solid var(--borderColor-muted);\n\n &.UnderlineNav--right {\n justify-content: flex-end;\n }\n\n &.UnderlineNav--right .UnderlineNavItem {\n margin-right: 0;\n margin-left: var(--base-size-16);\n }\n\n &.UnderlineNav--right .UnderlineNavActions {\n flex: 1 1 auto;\n }\n\n &.UnderlineNav--full {\n display: block;\n }\n\n .UnderlineNavBody {\n display: flex;\n /* stylelint-disable-next-line primer/spacing */\n margin-bottom: -1px;\n }\n\n .UnderlineNavActions {\n align-self: center;\n }\n}\n\n.UnderlineNavLink {\n padding: var(--base-size-16) var(--base-size-8);\n margin-right: var(--base-size-16);\n font-size: var(--text-body-size-medium);\n line-height: var(--text-title-lineHeight-large);\n color: var(--fgColor-default);\n text-align: center;\n /* stylelint-disable-next-line primer/borders */\n border-bottom: 2px solid transparent;\n text-decoration: none;\n\n /* fallback :focus state */\n &:focus:not(:disabled) {\n box-shadow: none;\n outline: 2px solid var(--fgColor-accent);\n outline-offset: -8px;\n\n /* remove fallback :focus if :focus-visible is supported */\n &:not(:focus-visible) {\n outline: solid 1px transparent;\n }\n }\n\n /* default focus state */\n &:focus-visible:not(:disabled) {\n box-shadow: none;\n outline: 2px solid var(--fgColor-accent);\n outline-offset: -8px;\n }\n}\n\n.UnderlineNavLink:hover,\n.UnderlineNavLink:focus {\n color: var(--fgColor-default);\n text-decoration: none;\n border-bottom-color: var(--borderColor-muted);\n transition: border-bottom-color 0.2s ease;\n}\n\n.UnderlineNavLink:hover .UnderlineNavOcticon,\n.UnderlineNavLink:focus .UnderlineNavOcticon {\n color: var(--fgColor-muted);\n}\n\n.UnderlineNavLink:where([data-selected]) {\n color: var(--fgColor-default);\n border-bottom-color: var(--underlineNav-borderColor-active);\n}\n\n.UnderlineNavLink:where([data-selected]) .UnderlineNavOcticon {\n color: var(--fgColor-default);\n}\n"]}
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import type { To } from 'history';
|
|
2
|
-
import
|
|
3
|
-
import type { ComponentProps } from '../../utils/types';
|
|
4
|
-
declare const UnderlineNavBase: import("styled-components").StyledComponent<"nav", any, {}, never>;
|
|
2
|
+
import React from 'react';
|
|
5
3
|
export type UnderlineNavProps = {
|
|
6
4
|
actions?: React.ReactNode;
|
|
7
5
|
align?: 'right';
|
|
8
6
|
full?: boolean;
|
|
9
7
|
label?: string;
|
|
10
|
-
} & ComponentProps<
|
|
11
|
-
declare function UnderlineNav({ actions, className, align, children, full, label,
|
|
8
|
+
} & React.ComponentProps<'nav'>;
|
|
9
|
+
declare function UnderlineNav({ actions, className, align, children, full, label, ...rest }: UnderlineNavProps): React.JSX.Element;
|
|
12
10
|
type StyledUnderlineNavLinkProps = {
|
|
13
11
|
to?: To;
|
|
14
12
|
selected?: boolean;
|
|
15
13
|
};
|
|
16
|
-
|
|
17
|
-
export type UnderlineNavLinkProps
|
|
14
|
+
type UnderlineNavLinkProps = React.ComponentProps<'a'> & StyledUnderlineNavLinkProps;
|
|
15
|
+
export type { UnderlineNavLinkProps };
|
|
18
16
|
/**
|
|
19
17
|
* @deprecated UnderlineNav is deprecated and will be replaced by the draft `UnderlineNav` in the next major release. See https://primer.style/react/drafts/UnderlineNav2 for more details.
|
|
20
18
|
*/
|
|
21
19
|
declare const _default: typeof UnderlineNav & {
|
|
22
|
-
Link:
|
|
20
|
+
Link: React.ForwardRefExoticComponent<Omit<UnderlineNavLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
23
21
|
};
|
|
24
22
|
export default _default;
|
|
25
23
|
//# sourceMappingURL=UnderlineNav.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../../src/deprecated/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"UnderlineNav.d.ts","sourceRoot":"","sources":["../../../src/deprecated/UnderlineNav/UnderlineNav.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA;AAE/B,iBAAS,YAAY,CAAC,EAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAC,EAAE,iBAAiB,qBAanG;AAED,KAAK,2BAA2B,GAAG;IACjC,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,2BAA2B,CAAA;AAYpF,YAAY,EAAC,qBAAqB,EAAC,CAAA;AACnC;;GAEG;;;;AACH,wBAAoE"}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import classes from './UnderlineNav.module.css.js';
|
|
5
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
|
-
const ITEM_CLASS = 'PRC-UnderlineNav-item';
|
|
9
|
-
const SELECTED_CLASS = 'PRC-selected';
|
|
10
|
-
const UnderlineNavBase = styled.nav.withConfig({
|
|
11
|
-
displayName: "UnderlineNav__UnderlineNavBase",
|
|
12
|
-
componentId: "sc-11ejk33-0"
|
|
13
|
-
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.PRC-UnderlineNav--right{justify-content:flex-end;.PRC-UnderlineNav-item{margin-right:0;margin-left:", ";}.PRC-UnderlineNav-actions{flex:1 1 auto;}}&.PRC-UnderlineNav--full{display:block;}.PRC-UnderlineNav-body{display:flex;margin-bottom:-1px;}.PRC-UnderlineNav-actions{align-self:center;}"], get('colors.border.muted'), get('space.3'));
|
|
14
7
|
function UnderlineNav(t0) {
|
|
15
8
|
const $ = c(24);
|
|
16
9
|
let actions;
|
|
@@ -20,7 +13,6 @@ function UnderlineNav(t0) {
|
|
|
20
13
|
let full;
|
|
21
14
|
let label;
|
|
22
15
|
let rest;
|
|
23
|
-
let theme;
|
|
24
16
|
if ($[0] !== t0) {
|
|
25
17
|
({
|
|
26
18
|
actions,
|
|
@@ -29,7 +21,6 @@ function UnderlineNav(t0) {
|
|
|
29
21
|
children,
|
|
30
22
|
full,
|
|
31
23
|
label,
|
|
32
|
-
theme,
|
|
33
24
|
...rest
|
|
34
25
|
} = t0);
|
|
35
26
|
$[0] = t0;
|
|
@@ -40,7 +31,6 @@ function UnderlineNav(t0) {
|
|
|
40
31
|
$[5] = full;
|
|
41
32
|
$[6] = label;
|
|
42
33
|
$[7] = rest;
|
|
43
|
-
$[8] = theme;
|
|
44
34
|
} else {
|
|
45
35
|
actions = $[1];
|
|
46
36
|
align = $[2];
|
|
@@ -49,70 +39,121 @@ function UnderlineNav(t0) {
|
|
|
49
39
|
full = $[5];
|
|
50
40
|
label = $[6];
|
|
51
41
|
rest = $[7];
|
|
52
|
-
theme = $[8];
|
|
53
42
|
}
|
|
54
|
-
const t1 = align
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
const t1 = align === "right";
|
|
44
|
+
let t2;
|
|
45
|
+
if ($[8] !== align || $[9] !== className || $[10] !== full || $[11] !== t1) {
|
|
46
|
+
t2 = clsx(className, classes.UnderlineNav, "PRC-UnderlineNav", {
|
|
47
|
+
[classes["UnderlineNav--right"]]: t1,
|
|
48
|
+
[classes["UnderlineNav--full"]]: full,
|
|
49
|
+
"PRC-UnderlineNav--full": full,
|
|
50
|
+
"PRC-UnderlineNav--right": align
|
|
51
|
+
});
|
|
52
|
+
$[8] = align;
|
|
59
53
|
$[9] = className;
|
|
60
|
-
$[10] =
|
|
61
|
-
$[11] =
|
|
62
|
-
$[12] =
|
|
54
|
+
$[10] = full;
|
|
55
|
+
$[11] = t1;
|
|
56
|
+
$[12] = t2;
|
|
57
|
+
} else {
|
|
58
|
+
t2 = $[12];
|
|
59
|
+
}
|
|
60
|
+
const navClasses = t2;
|
|
61
|
+
let t3;
|
|
62
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
63
|
+
t3 = clsx(classes.UnderlineNavBody, "PRC-UnderlineNav-body");
|
|
64
|
+
$[13] = t3;
|
|
63
65
|
} else {
|
|
64
|
-
t3 = $[
|
|
66
|
+
t3 = $[13];
|
|
65
67
|
}
|
|
66
|
-
const classes = t3;
|
|
67
68
|
let t4;
|
|
68
|
-
if ($[
|
|
69
|
+
if ($[14] !== children) {
|
|
69
70
|
t4 = /*#__PURE__*/jsx("div", {
|
|
70
|
-
className:
|
|
71
|
+
className: t3,
|
|
71
72
|
children: children
|
|
72
73
|
});
|
|
73
|
-
$[
|
|
74
|
-
$[
|
|
74
|
+
$[14] = children;
|
|
75
|
+
$[15] = t4;
|
|
75
76
|
} else {
|
|
76
|
-
t4 = $[
|
|
77
|
+
t4 = $[15];
|
|
77
78
|
}
|
|
78
79
|
let t5;
|
|
79
|
-
if ($[
|
|
80
|
+
if ($[16] !== actions) {
|
|
80
81
|
t5 = actions && /*#__PURE__*/jsx("div", {
|
|
81
|
-
className: "PRC-UnderlineNav-actions",
|
|
82
|
+
className: clsx(classes.UnderlineNavActions, "PRC-UnderlineNav-actions"),
|
|
82
83
|
children: actions
|
|
83
84
|
});
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
85
|
+
$[16] = actions;
|
|
86
|
+
$[17] = t5;
|
|
86
87
|
} else {
|
|
87
|
-
t5 = $[
|
|
88
|
+
t5 = $[17];
|
|
88
89
|
}
|
|
89
90
|
let t6;
|
|
90
|
-
if ($[
|
|
91
|
-
t6 = /*#__PURE__*/jsxs(
|
|
92
|
-
className:
|
|
91
|
+
if ($[18] !== label || $[19] !== navClasses || $[20] !== rest || $[21] !== t4 || $[22] !== t5) {
|
|
92
|
+
t6 = /*#__PURE__*/jsxs("nav", {
|
|
93
|
+
className: navClasses,
|
|
93
94
|
"aria-label": label,
|
|
94
|
-
theme: theme,
|
|
95
95
|
...rest,
|
|
96
96
|
children: [t4, t5]
|
|
97
97
|
});
|
|
98
|
-
$[17] = classes;
|
|
99
98
|
$[18] = label;
|
|
100
|
-
$[19] =
|
|
101
|
-
$[20] =
|
|
102
|
-
$[21] =
|
|
103
|
-
$[22] =
|
|
99
|
+
$[19] = navClasses;
|
|
100
|
+
$[20] = rest;
|
|
101
|
+
$[21] = t4;
|
|
102
|
+
$[22] = t5;
|
|
104
103
|
$[23] = t6;
|
|
105
104
|
} else {
|
|
106
105
|
t6 = $[23];
|
|
107
106
|
}
|
|
108
107
|
return t6;
|
|
109
108
|
}
|
|
110
|
-
const UnderlineNavLink =
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
const UnderlineNavLink = /*#__PURE__*/React.forwardRef(function UnderlineNavLink(t0, forwardRef) {
|
|
110
|
+
const $ = c(11);
|
|
111
|
+
let className;
|
|
112
|
+
let props;
|
|
113
|
+
let selected;
|
|
114
|
+
if ($[0] !== t0) {
|
|
115
|
+
({
|
|
116
|
+
className,
|
|
117
|
+
selected,
|
|
118
|
+
...props
|
|
119
|
+
} = t0);
|
|
120
|
+
$[0] = t0;
|
|
121
|
+
$[1] = className;
|
|
122
|
+
$[2] = props;
|
|
123
|
+
$[3] = selected;
|
|
124
|
+
} else {
|
|
125
|
+
className = $[1];
|
|
126
|
+
props = $[2];
|
|
127
|
+
selected = $[3];
|
|
128
|
+
}
|
|
129
|
+
let t1;
|
|
130
|
+
if ($[4] !== className) {
|
|
131
|
+
t1 = clsx(classes.UnderlineNavItem, className, classes.UnderlineNavLink);
|
|
132
|
+
$[4] = className;
|
|
133
|
+
$[5] = t1;
|
|
134
|
+
} else {
|
|
135
|
+
t1 = $[5];
|
|
136
|
+
}
|
|
137
|
+
const linkClasses = t1;
|
|
138
|
+
const t2 = selected ? "" : undefined;
|
|
139
|
+
let t3;
|
|
140
|
+
if ($[6] !== forwardRef || $[7] !== linkClasses || $[8] !== props || $[9] !== t2) {
|
|
141
|
+
t3 = /*#__PURE__*/jsx("a", {
|
|
142
|
+
ref: forwardRef,
|
|
143
|
+
"data-selected": t2,
|
|
144
|
+
className: linkClasses,
|
|
145
|
+
...props
|
|
146
|
+
});
|
|
147
|
+
$[6] = forwardRef;
|
|
148
|
+
$[7] = linkClasses;
|
|
149
|
+
$[8] = props;
|
|
150
|
+
$[9] = t2;
|
|
151
|
+
$[10] = t3;
|
|
152
|
+
} else {
|
|
153
|
+
t3 = $[10];
|
|
154
|
+
}
|
|
155
|
+
return t3;
|
|
156
|
+
});
|
|
116
157
|
UnderlineNavLink.displayName = 'UnderlineNav.Link';
|
|
117
158
|
/**
|
|
118
159
|
* @deprecated UnderlineNav is deprecated and will be replaced by the draft `UnderlineNav` in the next major release. See https://primer.style/react/drafts/UnderlineNav2 for more details.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import './UnderlineNav-0c1e0dff.css';
|
|
2
|
+
|
|
3
|
+
var classes = {"UnderlineNav":"prc-UnderlineNav-UnderlineNav-4E9Yr","UnderlineNav--right":"prc-UnderlineNav-UnderlineNav--right-Trs9C","UnderlineNavItem":"prc-UnderlineNav-UnderlineNavItem-nmHMS","UnderlineNavActions":"prc-UnderlineNav-UnderlineNavActions-onc2h","UnderlineNav--full":"prc-UnderlineNav-UnderlineNav--full-kE3kc","UnderlineNavBody":"prc-UnderlineNav-UnderlineNavBody-bh1JN","UnderlineNavLink":"prc-UnderlineNav-UnderlineNavLink-7BXiO"};
|
|
4
|
+
|
|
5
|
+
export { classes as default };
|
|
@@ -3,6 +3,7 @@ import type { ButtonProps, TextInputProps, LinkProps, CheckboxProps } from '../.
|
|
|
3
3
|
import type { OverlayProps } from '../../Overlay/Overlay';
|
|
4
4
|
import type { ResponsiveValue } from '../../hooks/useResponsiveValue';
|
|
5
5
|
import type { PositionSettings } from '@primer/behaviors';
|
|
6
|
+
import type { FCWithSlotMarker, WithSlotMarker } from '../../utils/types';
|
|
6
7
|
export type SelectPanelProps = {
|
|
7
8
|
title: string;
|
|
8
9
|
description?: string;
|
|
@@ -44,7 +45,7 @@ export type SelectPanelMessageProps = {
|
|
|
44
45
|
variant: 'warning' | 'error';
|
|
45
46
|
});
|
|
46
47
|
export declare const SelectPanel: React.FC<SelectPanelProps> & {
|
|
47
|
-
Button: React.ForwardRefExoticComponent<{
|
|
48
|
+
Button: WithSlotMarker<React.ForwardRefExoticComponent<{
|
|
48
49
|
alignContent?: import("../../Button/types").AlignContent;
|
|
49
50
|
icon?: React.FunctionComponent<import("@primer/octicons-react").IconProps> | React.ElementType | React.ReactElement | null;
|
|
50
51
|
leadingVisual?: React.ElementType | React.ReactElement | null;
|
|
@@ -61,14 +62,17 @@ export declare const SelectPanel: React.FC<SelectPanelProps> & {
|
|
|
61
62
|
loadingAnnouncement?: string;
|
|
62
63
|
inactive?: boolean;
|
|
63
64
|
labelWrap?: boolean;
|
|
64
|
-
} &
|
|
65
|
-
Header:
|
|
65
|
+
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>>;
|
|
66
|
+
Header: FCWithSlotMarker<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
66
67
|
onBack?: () => void;
|
|
67
68
|
}>;
|
|
68
|
-
SearchInput:
|
|
69
|
-
Footer:
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
SearchInput: FCWithSlotMarker<TextInputProps>;
|
|
70
|
+
Footer: {
|
|
71
|
+
({ ...props }: {
|
|
72
|
+
[x: string]: any;
|
|
73
|
+
}): React.JSX.Element | null;
|
|
74
|
+
__SLOT__: symbol;
|
|
75
|
+
};
|
|
72
76
|
Loading: ({ children }: React.PropsWithChildren) => React.JSX.Element;
|
|
73
77
|
Message: React.FC<SelectPanelMessageProps>;
|
|
74
78
|
SecondaryAction: React.FC<SelectPanelSecondaryActionProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../../src/experimental/SelectPanel2/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAmB,SAAS,EAAE,aAAa,EAAC,MAAM,aAAa,CAAA;AAevG,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;AAMvD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAA;AAInE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"SelectPanel.d.ts","sourceRoot":"","sources":["../../../src/experimental/SelectPanel2/SelectPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAC,WAAW,EAAE,cAAc,EAAmB,SAAS,EAAE,aAAa,EAAC,MAAM,aAAa,CAAA;AAevG,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAA;AAMvD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAA;AAInE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAA;AA2BvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,eAAe,CAAC,UAAU,GAAG,OAAO,EAAE,aAAa,GAAG,cAAc,CAAC,CAAA;IACtG,gBAAgB,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;IACpD,EAAE,CAAC,EAAE,MAAM,CAAA;IAEX,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAA;IAC9C,wBAAwB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAEpD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,gBAAgB,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,IAAI,CAAC,CAAA;IAC3C,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAA;IAG7D,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAA;IAC7B,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,CAAA;IAExD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAqdD,MAAM,MAAM,+BAA+B,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,CACxE,CAAC;IAAC,OAAO,EAAE,QAAQ,CAAA;CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC,GAC7D,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,GACxC,CAAC;IAAC,OAAO,EAAE,UAAU,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,aAAa,CAAC,CACvD,CAAA;AAwBD,MAAM,MAAM,uBAAuB,GAAG;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAC,GAAG,CAChE;IACE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,SAAS,GAAG,OAAO,GAAG,OAAO,CAAA;CACvC,GACD;IACE,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,OAAO,EAAE,SAAS,GAAG,OAAO,CAAA;CAC7B,CACJ,CAAA;AAuCD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;iBAxRoE,MAAM,IAAI;;;;;;;;;4BA6NxC,KAAK,CAAC,iBAAiB;;;CAmEnF,CAAA"}
|
|
@@ -9,6 +9,7 @@ import { invariant } from '../../utils/invariant.js';
|
|
|
9
9
|
import { useResponsiveValue } from '../../hooks/useResponsiveValue.js';
|
|
10
10
|
import { clsx } from 'clsx';
|
|
11
11
|
import classes from './SelectPanel.module.css.js';
|
|
12
|
+
import { isSlot } from '../../utils/is-slot.js';
|
|
12
13
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
13
14
|
import { useProvidedRefOrCreate } from '../../hooks/useProvidedRefOrCreate.js';
|
|
14
15
|
import { useId } from '../../hooks/useId.js';
|
|
@@ -83,7 +84,7 @@ const Panel = ({
|
|
|
83
84
|
if (!internalOpen) setInternalOpen(true);else onInternalCancel();
|
|
84
85
|
};
|
|
85
86
|
const contents = React.Children.map(props.children, child => {
|
|
86
|
-
if (/*#__PURE__*/React.isValidElement(child) && child.type === SelectPanelButton) {
|
|
87
|
+
if (/*#__PURE__*/React.isValidElement(child) && (child.type === SelectPanelButton || isSlot(child, SelectPanelButton))) {
|
|
87
88
|
// eslint-disable-next-line react-compiler/react-compiler
|
|
88
89
|
Anchor = /*#__PURE__*/React.cloneElement(child, {
|
|
89
90
|
// @ts-ignore TODO
|
|
@@ -282,6 +283,7 @@ const SelectPanelButton = /*#__PURE__*/React.forwardRef((props, anchorRef) => {
|
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
});
|
|
286
|
+
SelectPanelButton.__SLOT__ = Symbol('SelectPanel.Button');
|
|
285
287
|
const SelectPanelHeader = t0 => {
|
|
286
288
|
const $ = c(42);
|
|
287
289
|
let children;
|
|
@@ -478,6 +480,7 @@ const SelectPanelHeader = t0 => {
|
|
|
478
480
|
}
|
|
479
481
|
return t17;
|
|
480
482
|
};
|
|
483
|
+
SelectPanelHeader.__SLOT__ = Symbol('SelectPanel.Header');
|
|
481
484
|
const SelectPanelSearchInput = t0 => {
|
|
482
485
|
const $ = c(22);
|
|
483
486
|
let className;
|
|
@@ -604,6 +607,7 @@ const SelectPanelSearchInput = t0 => {
|
|
|
604
607
|
}
|
|
605
608
|
return t6;
|
|
606
609
|
};
|
|
610
|
+
SelectPanelSearchInput.__SLOT__ = Symbol('SelectPanel.SearchInput');
|
|
607
611
|
const FooterContext = /*#__PURE__*/React.createContext(false);
|
|
608
612
|
const SelectPanelFooter = t0 => {
|
|
609
613
|
const $ = c(13);
|
|
@@ -683,6 +687,7 @@ const SelectPanelFooter = t0 => {
|
|
|
683
687
|
}
|
|
684
688
|
return t5;
|
|
685
689
|
};
|
|
690
|
+
SelectPanelFooter.__SLOT__ = Symbol('SelectPanel.Footer');
|
|
686
691
|
const SecondaryButton = props => {
|
|
687
692
|
const $ = c(3);
|
|
688
693
|
const size = useResponsiveValue(responsiveButtonSizes, "small");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type FC, type PropsWithChildren } from 'react';
|
|
2
2
|
import type { IconProps } from '@primer/octicons-react';
|
|
3
|
-
import {
|
|
3
|
+
import type { FCWithSlotMarker } from '../../utils/types';
|
|
4
4
|
export type UnderlinePanelsProps = {
|
|
5
5
|
/**
|
|
6
6
|
* Tabs (UnderlinePanels.Tab) and panels (UnderlinePanels.Panel) to render
|
|
@@ -26,7 +26,7 @@ export type UnderlinePanelsProps = {
|
|
|
26
26
|
* Class name for custom styling
|
|
27
27
|
*/
|
|
28
28
|
className?: string;
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
export type TabProps = PropsWithChildren<{
|
|
31
31
|
/**
|
|
32
32
|
* Whether this is the selected tab
|
|
@@ -44,11 +44,11 @@ export type TabProps = PropsWithChildren<{
|
|
|
44
44
|
* Icon rendered before the tab text label
|
|
45
45
|
*/
|
|
46
46
|
icon?: FC<IconProps>;
|
|
47
|
-
}
|
|
47
|
+
}>;
|
|
48
48
|
export type PanelProps = React.HTMLAttributes<HTMLDivElement>;
|
|
49
|
-
declare const _default: React.FC<UnderlinePanelsProps> & {
|
|
50
|
-
Panel:
|
|
51
|
-
Tab:
|
|
49
|
+
declare const _default: React.FC<UnderlinePanelsProps> & import("../..").SlotMarker & {
|
|
50
|
+
Panel: FCWithSlotMarker<PanelProps>;
|
|
51
|
+
Tab: FCWithSlotMarker<TabProps>;
|
|
52
52
|
};
|
|
53
53
|
export default _default;
|
|
54
54
|
//# sourceMappingURL=UnderlinePanels.d.ts.map
|