@primer/react 38.0.0-rc.6 → 38.0.0-rc.8
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 +79 -0
- package/dist/ActionBar/ActionBar-3069d5f1.css +2 -0
- package/dist/ActionBar/ActionBar-3069d5f1.css.map +1 -0
- package/dist/ActionBar/ActionBar.d.ts +21 -1
- package/dist/ActionBar/ActionBar.d.ts.map +1 -1
- package/dist/ActionBar/ActionBar.js +409 -219
- package/dist/ActionBar/ActionBar.module.css.js +1 -1
- 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/AnchoredOverlay/AnchoredOverlay.d.ts +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +1 -1
- 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-0a7871f4.css → ButtonBase-4c44bb02.css} +2 -2
- package/dist/Button/ButtonBase-4c44bb02.css.map +1 -0
- package/dist/Button/ButtonBase.d.ts.map +1 -1
- package/dist/Button/ButtonBase.js +8 -93
- package/dist/Button/ButtonBase.module.css.js +1 -1
- 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-edc5dc3e.css +2 -0
- package/dist/Checkbox/{Checkbox-2aef6693.css.map → Checkbox-edc5dc3e.css.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/Checkbox/Checkbox.module.css.js +1 -1
- 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 +12 -25
- 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/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 +3 -2
- 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/Pagination/Pagination-16a5b4c6.css +2 -0
- package/dist/Pagination/Pagination-16a5b4c6.css.map +1 -0
- package/dist/Pagination/Pagination.d.ts.map +1 -1
- package/dist/Pagination/Pagination.js +16 -3
- package/dist/Pagination/Pagination.module.css.js +1 -1
- 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/ToggleSwitch/{ToggleSwitch-4b23d166.css → ToggleSwitch-d5c8dc81.css} +2 -2
- package/dist/ToggleSwitch/ToggleSwitch-d5c8dc81.css.map +1 -0
- package/dist/ToggleSwitch/ToggleSwitch.module.css.js +1 -1
- package/dist/Token/IssueLabelToken-a5fe569e.css +2 -0
- package/dist/Token/IssueLabelToken-a5fe569e.css.map +1 -0
- package/dist/Token/IssueLabelToken.d.ts.map +1 -1
- package/dist/Token/IssueLabelToken.js +0 -5
- package/dist/Token/IssueLabelToken.module.css.js +1 -1
- package/dist/Token/TokenBase-57c65c47.css +2 -0
- package/dist/Token/TokenBase-57c65c47.css.map +1 -0
- package/dist/Token/TokenBase.js +1 -7
- package/dist/Token/TokenBase.module.css.js +1 -1
- package/dist/Token/_RemoveTokenButton-c205593b.css +2 -0
- package/dist/Token/_RemoveTokenButton-c205593b.css.map +1 -0
- package/dist/Token/_RemoveTokenButton.d.ts.map +1 -1
- package/dist/Token/_RemoveTokenButton.js +3 -4
- package/dist/Token/_RemoveTokenButton.module.css.js +1 -1
- 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/IssueLabel/{IssueLabel-6581d1bd.css → IssueLabel-d9c2c5cf.css} +2 -2
- package/dist/experimental/IssueLabel/IssueLabel-d9c2c5cf.css.map +1 -0
- package/dist/experimental/IssueLabel/IssueLabel.d.ts.map +1 -1
- package/dist/experimental/IssueLabel/IssueLabel.js +52 -70
- package/dist/experimental/IssueLabel/IssueLabel.module.css.js +1 -1
- package/dist/experimental/IssueLabel/getColorFromHex.d.ts +1 -3
- package/dist/experimental/IssueLabel/getColorFromHex.d.ts.map +1 -1
- package/dist/experimental/IssueLabel/getColorFromHex.js +58 -26
- 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 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- 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 +110 -120
- package/package.json +7 -6
- package/dist/ActionBar/ActionBar-e6a5d54e.css +0 -2
- package/dist/ActionBar/ActionBar-e6a5d54e.css.map +0 -1
- package/dist/Box/Box.js +0 -15
- package/dist/Button/ButtonBase-0a7871f4.css.map +0 -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/Checkbox/Checkbox-2aef6693.css +0 -2
- 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/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/Pagination/Pagination-1845feaa.css +0 -2
- package/dist/Pagination/Pagination-1845feaa.css.map +0 -1
- package/dist/StateLabel/StateLabel-aaa1d148.css.map +0 -1
- package/dist/ToggleSwitch/ToggleSwitch-4b23d166.css.map +0 -1
- package/dist/Token/IssueLabelToken-0dbbbcdf.css +0 -2
- package/dist/Token/IssueLabelToken-0dbbbcdf.css.map +0 -1
- package/dist/Token/TokenBase-0386597b.css +0 -2
- package/dist/Token/TokenBase-0386597b.css.map +0 -1
- package/dist/Token/_RemoveTokenButton-d7f5985b.css +0 -2
- package/dist/Token/_RemoveTokenButton-d7f5985b.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-78db938f.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-78db938f.css.map +0 -1
- package/dist/experimental/IssueLabel/IssueLabel-6581d1bd.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,12 +1,11 @@
|
|
|
1
1
|
import { c } from 'react-compiler-runtime';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import { useTheme } from '../../ThemeProvider.js';
|
|
4
3
|
import { getColorsFromHex } from './getColorFromHex.js';
|
|
5
4
|
import classes from './IssueLabel.module.css.js';
|
|
6
5
|
import { jsx } from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
function IssueLabel(t0) {
|
|
9
|
-
const $ = c(
|
|
8
|
+
const $ = c(36);
|
|
10
9
|
let children;
|
|
11
10
|
let className;
|
|
12
11
|
let fillColor;
|
|
@@ -38,139 +37,122 @@ function IssueLabel(t0) {
|
|
|
38
37
|
t1 = $[6];
|
|
39
38
|
}
|
|
40
39
|
const variant = t1 === undefined ? "gray" : t1;
|
|
41
|
-
const {
|
|
42
|
-
resolvedColorScheme
|
|
43
|
-
} = useTheme();
|
|
44
|
-
const mode = resolvedColorScheme !== null && resolvedColorScheme !== void 0 && resolvedColorScheme.startsWith("dark") ? "dark" : "light";
|
|
45
40
|
let t2;
|
|
46
|
-
|
|
41
|
+
if ($[7] !== className) {
|
|
42
|
+
t2 = clsx(className, classes.IssueLabel);
|
|
43
|
+
$[7] = className;
|
|
44
|
+
$[8] = t2;
|
|
45
|
+
} else {
|
|
46
|
+
t2 = $[8];
|
|
47
|
+
}
|
|
48
|
+
const t3 = fillColor ? undefined : variant;
|
|
47
49
|
let t4;
|
|
48
|
-
if ($[
|
|
49
|
-
const bgColors = {
|
|
50
|
-
light: "#ffffff",
|
|
51
|
-
dark: "#0d1117"
|
|
52
|
-
};
|
|
53
|
-
if ($[16] !== className) {
|
|
54
|
-
t2 = clsx(className, classes.IssueLabel);
|
|
55
|
-
$[16] = className;
|
|
56
|
-
$[17] = t2;
|
|
57
|
-
} else {
|
|
58
|
-
t2 = $[17];
|
|
59
|
-
}
|
|
60
|
-
t3 = fillColor ? undefined : variant;
|
|
50
|
+
if ($[9] !== fillColor || $[10] !== style) {
|
|
61
51
|
t4 = fillColor ? {
|
|
62
52
|
...style,
|
|
63
|
-
...getColorsFromHex(fillColor
|
|
53
|
+
...getColorsFromHex(fillColor)
|
|
64
54
|
} : style;
|
|
65
|
-
$[
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[10] = resolvedColorScheme;
|
|
69
|
-
$[11] = style;
|
|
70
|
-
$[12] = variant;
|
|
71
|
-
$[13] = t2;
|
|
72
|
-
$[14] = t3;
|
|
73
|
-
$[15] = t4;
|
|
55
|
+
$[9] = fillColor;
|
|
56
|
+
$[10] = style;
|
|
57
|
+
$[11] = t4;
|
|
74
58
|
} else {
|
|
75
|
-
|
|
76
|
-
t3 = $[14];
|
|
77
|
-
t4 = $[15];
|
|
59
|
+
t4 = $[11];
|
|
78
60
|
}
|
|
79
61
|
let t5;
|
|
80
|
-
if ($[
|
|
62
|
+
if ($[12] !== t2 || $[13] !== t3 || $[14] !== t4) {
|
|
81
63
|
t5 = {
|
|
82
64
|
className: t2,
|
|
83
65
|
"data-variant": t3,
|
|
84
66
|
style: t4
|
|
85
67
|
};
|
|
86
|
-
$[
|
|
87
|
-
$[
|
|
88
|
-
$[
|
|
89
|
-
$[
|
|
68
|
+
$[12] = t2;
|
|
69
|
+
$[13] = t3;
|
|
70
|
+
$[14] = t4;
|
|
71
|
+
$[15] = t5;
|
|
90
72
|
} else {
|
|
91
|
-
t5 = $[
|
|
73
|
+
t5 = $[15];
|
|
92
74
|
}
|
|
93
75
|
const sharedProps = t5;
|
|
94
76
|
if ("as" in props && props.as) {
|
|
95
77
|
let BaseComponent;
|
|
96
78
|
let rest;
|
|
97
|
-
if ($[
|
|
79
|
+
if ($[16] !== props) {
|
|
98
80
|
({
|
|
99
81
|
as: BaseComponent,
|
|
100
82
|
...rest
|
|
101
83
|
} = props);
|
|
102
|
-
$[
|
|
103
|
-
$[
|
|
104
|
-
$[
|
|
84
|
+
$[16] = props;
|
|
85
|
+
$[17] = BaseComponent;
|
|
86
|
+
$[18] = rest;
|
|
105
87
|
} else {
|
|
106
|
-
BaseComponent = $[
|
|
107
|
-
rest = $[
|
|
88
|
+
BaseComponent = $[17];
|
|
89
|
+
rest = $[18];
|
|
108
90
|
}
|
|
109
91
|
let t6;
|
|
110
|
-
if ($[
|
|
92
|
+
if ($[19] !== BaseComponent || $[20] !== children || $[21] !== rest || $[22] !== sharedProps) {
|
|
111
93
|
t6 = /*#__PURE__*/jsx(BaseComponent, {
|
|
112
94
|
...rest,
|
|
113
95
|
...sharedProps,
|
|
114
96
|
children: children
|
|
115
97
|
});
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
98
|
+
$[19] = BaseComponent;
|
|
99
|
+
$[20] = children;
|
|
100
|
+
$[21] = rest;
|
|
101
|
+
$[22] = sharedProps;
|
|
102
|
+
$[23] = t6;
|
|
121
103
|
} else {
|
|
122
|
-
t6 = $[
|
|
104
|
+
t6 = $[23];
|
|
123
105
|
}
|
|
124
106
|
return t6;
|
|
125
107
|
}
|
|
126
108
|
if ("href" in props) {
|
|
127
109
|
let t6;
|
|
128
|
-
if ($[
|
|
110
|
+
if ($[24] !== children || $[25] !== props || $[26] !== sharedProps) {
|
|
129
111
|
t6 = /*#__PURE__*/jsx("a", {
|
|
130
112
|
...props,
|
|
131
113
|
...sharedProps,
|
|
132
114
|
children: children
|
|
133
115
|
});
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
116
|
+
$[24] = children;
|
|
117
|
+
$[25] = props;
|
|
118
|
+
$[26] = sharedProps;
|
|
119
|
+
$[27] = t6;
|
|
138
120
|
} else {
|
|
139
|
-
t6 = $[
|
|
121
|
+
t6 = $[27];
|
|
140
122
|
}
|
|
141
123
|
return t6;
|
|
142
124
|
}
|
|
143
125
|
if ("onClick" in props) {
|
|
144
126
|
let t6;
|
|
145
|
-
if ($[
|
|
127
|
+
if ($[28] !== children || $[29] !== props || $[30] !== sharedProps) {
|
|
146
128
|
t6 = /*#__PURE__*/jsx("button", {
|
|
147
129
|
type: "button",
|
|
148
130
|
...props,
|
|
149
131
|
...sharedProps,
|
|
150
132
|
children: children
|
|
151
133
|
});
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
134
|
+
$[28] = children;
|
|
135
|
+
$[29] = props;
|
|
136
|
+
$[30] = sharedProps;
|
|
137
|
+
$[31] = t6;
|
|
156
138
|
} else {
|
|
157
|
-
t6 = $[
|
|
139
|
+
t6 = $[31];
|
|
158
140
|
}
|
|
159
141
|
return t6;
|
|
160
142
|
}
|
|
161
143
|
let t6;
|
|
162
|
-
if ($[
|
|
144
|
+
if ($[32] !== children || $[33] !== props || $[34] !== sharedProps) {
|
|
163
145
|
t6 = /*#__PURE__*/jsx("span", {
|
|
164
146
|
...props,
|
|
165
147
|
...sharedProps,
|
|
166
148
|
children: children
|
|
167
149
|
});
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
150
|
+
$[32] = children;
|
|
151
|
+
$[33] = props;
|
|
152
|
+
$[34] = sharedProps;
|
|
153
|
+
$[35] = t6;
|
|
172
154
|
} else {
|
|
173
|
-
t6 = $[
|
|
155
|
+
t6 = $[35];
|
|
174
156
|
}
|
|
175
157
|
return t6;
|
|
176
158
|
}
|
|
@@ -2,9 +2,7 @@ import type { Hex } from './IssueLabel';
|
|
|
2
2
|
/**
|
|
3
3
|
* transforms a hex color provided by the user into a color object with background and text colors
|
|
4
4
|
* @param colorHex — the hex color provided by the user
|
|
5
|
-
* @param colorScheme — the color scheme the user has currently set
|
|
6
|
-
* @param bgColor — the background color from the selected theme, needed to calc the contrast for the colors
|
|
7
5
|
* @returns
|
|
8
6
|
*/
|
|
9
|
-
export declare const getColorsFromHex: (colorHex: Hex
|
|
7
|
+
export declare const getColorsFromHex: (colorHex: Hex) => React.CSSProperties | undefined;
|
|
10
8
|
//# sourceMappingURL=getColorFromHex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getColorFromHex.d.ts","sourceRoot":"","sources":["../../../src/experimental/IssueLabel/getColorFromHex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,cAAc,CAAA;AAErC
|
|
1
|
+
{"version":3,"file":"getColorFromHex.d.ts","sourceRoot":"","sources":["../../../src/experimental/IssueLabel/getColorFromHex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,cAAc,CAAA;AAErC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,UAAU,GAAG,KAAG,KAAK,CAAC,aAAa,GAAG,SA+EtE,CAAA"}
|
|
@@ -4,21 +4,16 @@ import { Hsluv } from 'hsluv';
|
|
|
4
4
|
/**
|
|
5
5
|
* transforms a hex color provided by the user into a color object with background and text colors
|
|
6
6
|
* @param colorHex — the hex color provided by the user
|
|
7
|
-
* @param colorScheme — the color scheme the user has currently set
|
|
8
|
-
* @param bgColor — the background color from the selected theme, needed to calc the contrast for the colors
|
|
9
7
|
* @returns
|
|
10
8
|
*/
|
|
11
|
-
const getColorsFromHex =
|
|
9
|
+
const getColorsFromHex = colorHex => {
|
|
12
10
|
// start values for light mode
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
lightnessIncrement = 1;
|
|
20
|
-
ratio = 5.5;
|
|
21
|
-
}
|
|
11
|
+
const lightBgLightness = 96;
|
|
12
|
+
const lightLightnessIncrement = -1;
|
|
13
|
+
const lightRatio = 4.5;
|
|
14
|
+
const darkBgLightness = 16;
|
|
15
|
+
const darkLightnessIncrement = 1;
|
|
16
|
+
const darkRatio = 5.5;
|
|
22
17
|
|
|
23
18
|
// get hue and saturation value from hex color
|
|
24
19
|
// eslint-disable-next-line prefer-const
|
|
@@ -41,13 +36,29 @@ const getColorsFromHex = (colorHex, colorScheme = 'light', bgColor) => {
|
|
|
41
36
|
* creating a background color from the provided hex color
|
|
42
37
|
*/
|
|
43
38
|
const {
|
|
44
|
-
colorHex:
|
|
45
|
-
lightness:
|
|
39
|
+
colorHex: darkBackgroundColor,
|
|
40
|
+
lightness: darkCurrentBgLightness
|
|
41
|
+
} = getColorWithContrast(hsluvToHex({
|
|
42
|
+
h,
|
|
43
|
+
s,
|
|
44
|
+
l: darkBgLightness
|
|
45
|
+
}), '#0d1117',
|
|
46
|
+
// dark mode background color
|
|
47
|
+
1.2, darkLightnessIncrement);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* creating a background color from the provided hex color
|
|
51
|
+
*/
|
|
52
|
+
const {
|
|
53
|
+
colorHex: lightBackgroundColor,
|
|
54
|
+
lightness: lightCurrentBgLightness
|
|
46
55
|
} = getColorWithContrast(hsluvToHex({
|
|
47
56
|
h,
|
|
48
57
|
s,
|
|
49
|
-
l:
|
|
50
|
-
}),
|
|
58
|
+
l: lightBgLightness
|
|
59
|
+
}), '#ffffff',
|
|
60
|
+
// light mode background color
|
|
61
|
+
1.2, lightLightnessIncrement);
|
|
51
62
|
|
|
52
63
|
// avoid intense bright colors
|
|
53
64
|
if (h >= 58 && h <= 316 && s > 80) {
|
|
@@ -57,27 +68,48 @@ const getColorsFromHex = (colorHex, colorScheme = 'light', bgColor) => {
|
|
|
57
68
|
* creating a text color from with a contrast ratio of at least 4.5 to the generated background color
|
|
58
69
|
*/
|
|
59
70
|
const {
|
|
60
|
-
colorHex:
|
|
71
|
+
colorHex: darkTextColor
|
|
72
|
+
} = getColorWithContrast(hsluvToHex({
|
|
73
|
+
h,
|
|
74
|
+
s,
|
|
75
|
+
l: 50
|
|
76
|
+
}), darkBackgroundColor, darkRatio, darkLightnessIncrement);
|
|
77
|
+
const {
|
|
78
|
+
colorHex: lightTextColor
|
|
61
79
|
} = getColorWithContrast(hsluvToHex({
|
|
62
80
|
h,
|
|
63
81
|
s,
|
|
64
82
|
l: 50
|
|
65
|
-
}),
|
|
83
|
+
}), lightBackgroundColor, lightRatio, lightLightnessIncrement);
|
|
66
84
|
return {
|
|
67
|
-
'--label-bgColor-rest':
|
|
68
|
-
'--label-bgColor-hover': hsluvToHex({
|
|
85
|
+
'--label-bgColor-light-rest': lightBackgroundColor,
|
|
86
|
+
'--label-bgColor-light-hover': hsluvToHex({
|
|
87
|
+
h,
|
|
88
|
+
s,
|
|
89
|
+
l: lightCurrentBgLightness + 4 * lightLightnessIncrement
|
|
90
|
+
}),
|
|
91
|
+
'--label-bgColor-light-active': hsluvToHex({
|
|
92
|
+
h,
|
|
93
|
+
s,
|
|
94
|
+
l: lightCurrentBgLightness + 8 * lightLightnessIncrement
|
|
95
|
+
}),
|
|
96
|
+
'--label-fgColor-light': lightTextColor,
|
|
97
|
+
'--label-fgColor-light-hover': lightTextColor,
|
|
98
|
+
'--label-fgColor-light-active': lightTextColor,
|
|
99
|
+
'--label-bgColor-dark-rest': darkBackgroundColor,
|
|
100
|
+
'--label-bgColor-dark-hover': hsluvToHex({
|
|
69
101
|
h,
|
|
70
102
|
s,
|
|
71
|
-
l:
|
|
103
|
+
l: darkCurrentBgLightness + 4 * darkLightnessIncrement
|
|
72
104
|
}),
|
|
73
|
-
'--label-bgColor-active': hsluvToHex({
|
|
105
|
+
'--label-bgColor-dark-active': hsluvToHex({
|
|
74
106
|
h,
|
|
75
107
|
s,
|
|
76
|
-
l:
|
|
108
|
+
l: darkCurrentBgLightness + 8 * darkLightnessIncrement
|
|
77
109
|
}),
|
|
78
|
-
'--label-fgColor':
|
|
79
|
-
'--label-fgColor-hover':
|
|
80
|
-
'--label-fgColor-active':
|
|
110
|
+
'--label-fgColor-dark': darkTextColor,
|
|
111
|
+
'--label-fgColor-dark-hover': darkTextColor,
|
|
112
|
+
'--label-fgColor-dark-active': darkTextColor
|
|
81
113
|
};
|
|
82
114
|
};
|
|
83
115
|
/**
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnderlinePanels.d.ts","sourceRoot":"","sources":["../../../src/experimental/UnderlinePanels/UnderlinePanels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,KAAK,EAAE,EACP,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"UnderlinePanels.d.ts","sourceRoot":"","sources":["../../../src/experimental/UnderlinePanels/UnderlinePanels.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAMZ,KAAK,EAAE,EACP,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAerD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AAEvD,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IACjD;;OAEG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAC3D;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC;IACvC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAA;IACxG;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAA;CACrB,CAAC,CAAA;AAEF,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;;;;;AA8J7D,wBAA2D"}
|
|
@@ -8,6 +8,7 @@ import { useResizeObserver } from '../../hooks/useResizeObserver.js';
|
|
|
8
8
|
import useIsomorphicLayoutEffect from '../../utils/useIsomorphicLayoutEffect.js';
|
|
9
9
|
import classes from './UnderlinePanels.module.css.js';
|
|
10
10
|
import { clsx } from 'clsx';
|
|
11
|
+
import { isSlot } from '../../utils/is-slot.js';
|
|
11
12
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
12
13
|
import { useId } from '../../hooks/useId.js';
|
|
13
14
|
|
|
@@ -36,14 +37,14 @@ const UnderlinePanels = ({
|
|
|
36
37
|
let tabIndex = 0;
|
|
37
38
|
let panelIndex = 0;
|
|
38
39
|
const childrenWithProps = Children.map(children, child => {
|
|
39
|
-
if (/*#__PURE__*/isValidElement(child) && child.type === Tab) {
|
|
40
|
+
if (/*#__PURE__*/isValidElement(child) && (child.type === Tab || isSlot(child, Tab))) {
|
|
40
41
|
return /*#__PURE__*/cloneElement(child, {
|
|
41
42
|
id: `${parentId}-tab-${tabIndex++}`,
|
|
42
43
|
loadingCounters,
|
|
43
44
|
iconsVisible
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
if (/*#__PURE__*/isValidElement(child) && child.type === Panel) {
|
|
47
|
+
if (/*#__PURE__*/isValidElement(child) && (child.type === Panel || isSlot(child, Panel))) {
|
|
47
48
|
const childPanel = child;
|
|
48
49
|
return /*#__PURE__*/cloneElement(childPanel, {
|
|
49
50
|
'aria-labelledby': `${parentId}-tab-${panelIndex++}`
|
|
@@ -52,9 +53,9 @@ const UnderlinePanels = ({
|
|
|
52
53
|
return child;
|
|
53
54
|
});
|
|
54
55
|
const newTabs = Children.toArray(childrenWithProps).filter(child_0 => {
|
|
55
|
-
return /*#__PURE__*/isValidElement(child_0) && child_0.type === Tab;
|
|
56
|
+
return /*#__PURE__*/isValidElement(child_0) && (child_0.type === Tab || isSlot(child_0, Tab));
|
|
56
57
|
});
|
|
57
|
-
const newTabPanels = Children.toArray(childrenWithProps).filter(child_1 => /*#__PURE__*/isValidElement(child_1) && child_1.type === Panel);
|
|
58
|
+
const newTabPanels = Children.toArray(childrenWithProps).filter(child_1 => /*#__PURE__*/isValidElement(child_1) && (child_1.type === Panel || isSlot(child_1, Panel)));
|
|
58
59
|
setTabs(newTabs);
|
|
59
60
|
setTabPanels(newTabPanels);
|
|
60
61
|
}, [children, parentId, loadingCounters, iconsVisible]);
|
|
@@ -212,5 +213,8 @@ var UnderlinePanels$1 = Object.assign(UnderlinePanels, {
|
|
|
212
213
|
Panel,
|
|
213
214
|
Tab
|
|
214
215
|
});
|
|
216
|
+
UnderlinePanels.__SLOT__ = Symbol('UnderlinePanels');
|
|
217
|
+
Tab.__SLOT__ = Symbol('UnderlinePanels.Tab');
|
|
218
|
+
Panel.__SLOT__ = Symbol('UnderlinePanels.Panel');
|
|
215
219
|
|
|
216
220
|
export { UnderlinePanels$1 as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSlots.d.ts","sourceRoot":"","sources":["../../src/hooks/useSlots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useSlots.d.ts","sourceRoot":"","sources":["../../src/hooks/useSlots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,KAAK,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAEhD,KAAK,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,CAAA;AAE7E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,wBAAwB,CAAC,CAAA;AAIpF,KAAK,KAAK,GAAG,GAAG,CAAA;AAEhB,KAAK,YAAY,CAAC,MAAM,SAAS,UAAU,IAAI;KAC5C,QAAQ,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC;CACxD,CAAA;AAED,KAAK,SAAS,CAAC,MAAM,EAAE,QAAQ,SAAS,MAAM,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK,CAAC,WAAW,GAC9F,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,GACtF,MAAM,CAAC,QAAQ,CAAC,SAAS,SAAS;IAC9B,MAAM,WAAW,SAAS,KAAK,CAAC,WAAW;IAE3C,MAAM,OAAO;CACd,GACD,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,GAC5E,KAAK,CAAA;AAEX;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAS,UAAU,EAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,MAAM,EAAE,MAAM,GACb,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CA8CpD"}
|
package/dist/hooks/useSlots.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { warning } from '../utils/warning.js';
|
|
3
|
+
import { isSlot } from '../utils/is-slot.js';
|
|
3
4
|
|
|
4
5
|
// slot config allows 2 options:
|
|
5
6
|
// 1. Component to match, example: { leadingVisual: LeadingVisual }
|
|
@@ -34,9 +35,9 @@ function useSlots(children, config) {
|
|
|
34
35
|
const index = values.findIndex(value => {
|
|
35
36
|
if (Array.isArray(value)) {
|
|
36
37
|
const [component, testFn] = value;
|
|
37
|
-
return child.type === component && testFn(child.props);
|
|
38
|
+
return (child.type === component || isSlot(child, component)) && testFn(child.props);
|
|
38
39
|
} else {
|
|
39
|
-
return child.type === value;
|
|
40
|
+
return child.type === value || isSlot(child, value);
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
|
|
@@ -17,7 +17,7 @@ const useSyncedState = (initialValue, t0) => {
|
|
|
17
17
|
const {
|
|
18
18
|
isPropUpdateDisabled: t1,
|
|
19
19
|
isEqual: t2
|
|
20
|
-
} = {} ;
|
|
20
|
+
} = t0 === undefined ? {} : t0;
|
|
21
21
|
const isPropUpdateDisabled = t1 === undefined ? false : t1;
|
|
22
22
|
const isEqual = t2 === undefined ? Object.is : t2;
|
|
23
23
|
const [state, setState] = useState(initialValue);
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,6 @@ export { default as BaseStyles } from './BaseStyles';
|
|
|
4
4
|
export type { BaseStylesProps } from './BaseStyles';
|
|
5
5
|
export { default as ThemeProvider, useTheme, useColorSchemeVar } from './ThemeProvider';
|
|
6
6
|
export type { ThemeProviderProps } from './ThemeProvider';
|
|
7
|
-
export { default as Box } from './Box';
|
|
8
|
-
export type { BoxProps } from './Box';
|
|
9
7
|
export * from './Button';
|
|
10
8
|
export { PageLayout } from './PageLayout';
|
|
11
9
|
export type { PageLayoutProps, PageLayoutHeaderProps, PageLayoutContentProps, PageLayoutPaneProps, PageLayoutFooterProps, } from './PageLayout';
|
|
@@ -28,7 +26,10 @@ export { useResizeObserver } from './hooks/useResizeObserver';
|
|
|
28
26
|
export { useResponsiveValue, type ResponsiveValue } from './hooks/useResponsiveValue';
|
|
29
27
|
export { default as useIsomorphicLayoutEffect } from './utils/useIsomorphicLayoutEffect';
|
|
30
28
|
export { useProvidedRefOrCreate } from './hooks/useProvidedRefOrCreate';
|
|
29
|
+
export { useId } from './hooks/useId';
|
|
30
|
+
export { useSyncedState } from './hooks/useSyncedState';
|
|
31
31
|
export { createComponent } from './utils/create-component';
|
|
32
|
+
export type { SlotMarker } from './utils/types';
|
|
32
33
|
export { default as Radio } from './Radio';
|
|
33
34
|
export type { RadioProps } from './Radio';
|
|
34
35
|
export { ActionList } from './ActionList';
|
|
@@ -66,6 +67,7 @@ export { ConfirmationDialog } from './ConfirmationDialog/ConfirmationDialog';
|
|
|
66
67
|
export { default as Flash } from './Flash';
|
|
67
68
|
export type { FlashProps } from './Flash';
|
|
68
69
|
export { default as FormControl } from './FormControl';
|
|
70
|
+
export type { FormControlProps, FormControlCaptionProps, FormControlLabelProps, FormControlValidationProps, } from './FormControl';
|
|
69
71
|
export { useFormControlForwardedProps } from './FormControl';
|
|
70
72
|
export { default as Header } from './Header';
|
|
71
73
|
export type { HeaderProps, HeaderItemProps, HeaderLinkProps } from './Header';
|
|
@@ -110,7 +112,7 @@ export type { SubNavProps, SubNavLinkProps, SubNavLinksProps } from './SubNav';
|
|
|
110
112
|
export { default as ToggleSwitch } from './ToggleSwitch';
|
|
111
113
|
export type { ToggleSwitchProps } from './ToggleSwitch';
|
|
112
114
|
export { default as TextInput } from './TextInput';
|
|
113
|
-
export type { TextInputProps } from './TextInput';
|
|
115
|
+
export type { TextInputProps, TextInputActionProps } from './TextInput';
|
|
114
116
|
export { default as TextInputWithTokens } from './TextInputWithTokens';
|
|
115
117
|
export type { TextInputWithTokensProps } from './TextInputWithTokens';
|
|
116
118
|
export { default as Text } from './Text';
|