@primer/react 38.47.0-rc.fcdf0c9da → 39.0.0-rc.00628b8df
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 +11 -1
- package/dist/ActionBar/ActionBar.d.ts +1 -2
- package/dist/ActionBar/ActionBar.js +8 -9
- package/dist/ActionBar/ActionBar.module.css.js +1 -2
- package/dist/ActionBar/index.d.ts +1 -3
- package/dist/ActionBar/index.js +1 -2
- package/dist/ActionList/ActionList.module.css.js +1 -2
- package/dist/ActionList/ActionListContainerContext.js +1 -2
- package/dist/ActionList/Description.d.ts +1 -2
- package/dist/ActionList/Description.js +2 -3
- package/dist/ActionList/Divider.d.ts +1 -2
- package/dist/ActionList/Divider.js +1 -2
- package/dist/ActionList/Group.d.ts +2 -3
- package/dist/ActionList/Group.js +3 -4
- package/dist/ActionList/Group.module.css.js +1 -2
- package/dist/ActionList/GroupContext.js +1 -2
- package/dist/ActionList/GroupHeadingTrailingAction.d.ts +1 -2
- package/dist/ActionList/GroupHeadingTrailingAction.js +1 -2
- package/dist/ActionList/Heading.d.ts +1 -2
- package/dist/ActionList/Heading.js +4 -5
- package/dist/ActionList/Heading.module.css.js +1 -2
- package/dist/ActionList/Item.js +11 -12
- package/dist/ActionList/LinkItem.d.ts +1 -2
- package/dist/ActionList/LinkItem.js +3 -4
- package/dist/ActionList/List.js +51 -59
- package/dist/ActionList/Selection.js +5 -6
- package/dist/ActionList/TrailingAction.d.ts +1 -2
- package/dist/ActionList/TrailingAction.js +2 -3
- package/dist/ActionList/Visuals.d.ts +1 -2
- package/dist/ActionList/Visuals.js +2 -3
- package/dist/ActionList/index.d.ts +7 -7
- package/dist/ActionList/index.js +7 -8
- package/dist/ActionList/shared.d.ts +1 -2
- package/dist/ActionList/shared.js +1 -2
- package/dist/ActionMenu/ActionMenu.d.ts +3 -4
- package/dist/ActionMenu/ActionMenu.js +8 -9
- package/dist/ActionMenu/ActionMenu.module.css.js +1 -2
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts +2 -3
- package/dist/AnchoredOverlay/AnchoredOverlay.js +8 -18
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +1 -2
- package/dist/Autocomplete/Autocomplete.d.ts +3 -4
- package/dist/Autocomplete/Autocomplete.js +2 -3
- package/dist/Autocomplete/AutocompleteContext.js +1 -2
- package/dist/Autocomplete/AutocompleteInput.d.ts +2 -3
- package/dist/Autocomplete/AutocompleteInput.js +3 -4
- package/dist/Autocomplete/AutocompleteMenu.d.ts +2 -3
- package/dist/Autocomplete/AutocompleteMenu.js +5 -6
- package/dist/Autocomplete/AutocompleteMenu.module.css.js +1 -2
- package/dist/Autocomplete/AutocompleteOverlay.d.ts +2 -3
- package/dist/Autocomplete/AutocompleteOverlay.js +3 -4
- package/dist/Autocomplete/AutocompleteOverlay.module.css.js +1 -2
- package/dist/Avatar/Avatar.d.ts +1 -2
- package/dist/Avatar/Avatar.js +0 -1
- package/dist/Avatar/Avatar.module.css.js +1 -2
- package/dist/AvatarStack/AvatarStack.d.ts +1 -2
- package/dist/AvatarStack/AvatarStack.js +1 -2
- package/dist/AvatarStack/AvatarStack.module.css.js +1 -2
- package/dist/Banner/Banner.d.ts +1 -2
- package/dist/Banner/Banner.js +5 -6
- package/dist/Banner/Banner.module.css.js +1 -2
- package/dist/Banner/index.d.ts +2 -3
- package/dist/Banner/index.js +1 -2
- package/dist/BaseStyles.d.ts +0 -2
- package/dist/BaseStyles.js +1 -2
- package/dist/BaseStyles.module.css.js +1 -2
- package/dist/Blankslate/Blankslate.d.ts +1 -2
- package/dist/Blankslate/Blankslate.js +2 -3
- package/dist/Blankslate/Blankslate.module.css.js +1 -2
- package/dist/Blankslate/BlankslateContext.js +1 -2
- package/dist/Blankslate/index.d.ts +1 -2
- package/dist/Blankslate/index.js +1 -2
- package/dist/BranchName/BranchName.d.ts +1 -2
- package/dist/BranchName/BranchName.js +2 -3
- package/dist/BranchName/BranchName.module.css.js +1 -2
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +1 -2
- package/dist/Breadcrumbs/Breadcrumbs.js +6 -7
- package/dist/Breadcrumbs/Breadcrumbs.module.css.js +1 -2
- package/dist/Button/Button.d.ts +2 -3
- package/dist/Button/Button.js +1 -2
- package/dist/Button/ButtonBase.d.ts +1 -2
- package/dist/Button/ButtonBase.js +3 -4
- package/dist/Button/ButtonBase.module.css.js +1 -2
- package/dist/Button/IconButton.d.ts +2 -3
- package/dist/Button/IconButton.js +3 -4
- package/dist/Button/LinkButton.d.ts +2 -3
- package/dist/Button/LinkButton.js +1 -2
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/types.d.ts +1 -2
- package/dist/ButtonGroup/ButtonGroup.d.ts +1 -2
- package/dist/ButtonGroup/ButtonGroup.js +23 -31
- package/dist/ButtonGroup/ButtonGroup.module.css.js +1 -2
- package/dist/Card/Card.d.ts +1 -2
- package/dist/Card/Card.js +3 -4
- package/dist/Card/Card.module.css.js +1 -2
- package/dist/Card/index.d.ts +1 -2
- package/dist/Card/index.js +1 -2
- package/dist/Checkbox/Checkbox.d.ts +2 -3
- package/dist/Checkbox/Checkbox.js +49 -64
- package/dist/Checkbox/Checkbox.module.css.js +1 -2
- package/dist/Checkbox/shared.module.css.js +1 -2
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +2 -3
- package/dist/CheckboxGroup/CheckboxGroup.js +6 -7
- package/dist/CheckboxGroup/CheckboxGroupContext.js +1 -2
- package/dist/CircleBadge/CircleBadge.d.ts +0 -2
- package/dist/CircleBadge/CircleBadge.js +1 -2
- package/dist/CircleBadge/CircleBadge.module.css.js +1 -2
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts +1 -2
- package/dist/ConfirmationDialog/ConfirmationDialog.js +1 -2
- package/dist/ConfirmationDialog/useConfirm.d.ts +1 -2
- package/dist/ConfirmationDialog/useConfirm.js +1 -2
- package/dist/CounterLabel/CounterLabel.d.ts +1 -2
- package/dist/CounterLabel/CounterLabel.js +1 -2
- package/dist/CounterLabel/CounterLabel.module.css.js +1 -2
- package/dist/DataTable/DataTable.d.ts +4 -5
- package/dist/DataTable/DataTable.js +3 -4
- package/dist/DataTable/ErrorDialog.d.ts +1 -2
- package/dist/DataTable/ErrorDialog.js +1 -2
- package/dist/DataTable/Pagination.d.ts +1 -2
- package/dist/DataTable/Pagination.js +2 -3
- package/dist/DataTable/Pagination.module.css.js +1 -2
- package/dist/DataTable/Table.d.ts +3 -4
- package/dist/DataTable/Table.js +4 -5
- package/dist/DataTable/Table.module.css.js +1 -2
- package/dist/DataTable/TableBulkActions.d.ts +1 -2
- package/dist/DataTable/TableBulkActions.js +2 -3
- package/dist/DataTable/TableBulkActions.module.css.js +1 -2
- package/dist/DataTable/TableGroup.d.ts +1 -2
- package/dist/DataTable/TableGroup.js +4 -5
- package/dist/DataTable/TableGroupContext.js +1 -2
- package/dist/DataTable/column.d.ts +1 -2
- package/dist/DataTable/column.js +1 -2
- package/dist/DataTable/index.d.ts +4 -5
- package/dist/DataTable/index.js +3 -4
- package/dist/DataTable/row.d.ts +0 -2
- package/dist/DataTable/sorting.d.ts +0 -2
- package/dist/DataTable/sorting.js +1 -2
- package/dist/DataTable/useTable.js +2 -3
- package/dist/DataTable/utils.d.ts +0 -2
- package/dist/Details/Details.d.ts +1 -2
- package/dist/Details/Details.js +2 -3
- package/dist/Details/Details.module.css.js +1 -2
- package/dist/Dialog/Dialog.d.ts +2 -3
- package/dist/Dialog/Dialog.js +10 -17
- package/dist/Dialog/Dialog.module.css.js +1 -2
- package/dist/Dialog/DialogContext.js +1 -2
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts +1 -2
- package/dist/FeatureFlags/DefaultFeatureFlags.js +1 -4
- package/dist/FeatureFlags/FeatureFlagContext.js +1 -2
- package/dist/FeatureFlags/FeatureFlagScope.d.ts +0 -2
- package/dist/FeatureFlags/FeatureFlagScope.js +1 -2
- package/dist/FeatureFlags/FeatureFlags.d.ts +1 -2
- package/dist/FeatureFlags/FeatureFlags.js +2 -3
- package/dist/FeatureFlags/useFeatureFlag.d.ts +0 -2
- package/dist/FeatureFlags/useFeatureFlag.js +1 -2
- package/dist/FilteredActionList/FilteredActionList.d.ts +1 -2
- package/dist/FilteredActionList/FilteredActionList.js +25 -45
- package/dist/FilteredActionList/FilteredActionList.module.css.js +1 -2
- package/dist/FilteredActionList/FilteredActionListInput.d.ts +1 -2
- package/dist/FilteredActionList/FilteredActionListInput.js +1 -2
- package/dist/FilteredActionList/FilteredActionListLoaders.d.ts +1 -2
- package/dist/FilteredActionList/FilteredActionListLoaders.js +1 -2
- package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +1 -2
- package/dist/FilteredActionList/constants.d.ts +0 -2
- package/dist/FilteredActionList/constants.js +1 -2
- package/dist/FilteredActionList/index.d.ts +2 -3
- package/dist/FilteredActionList/index.js +3 -4
- package/dist/FilteredActionList/types.d.ts +3 -4
- package/dist/FilteredActionList/useAnnouncements.js +1 -2
- package/dist/Flash/Flash.d.ts +1 -2
- package/dist/Flash/Flash.js +1 -2
- package/dist/Flash/Flash.module.css.js +1 -2
- package/dist/FormControl/FormControl.d.ts +1 -2
- package/dist/FormControl/FormControl.js +8 -9
- package/dist/FormControl/FormControl.module.css.js +1 -2
- package/dist/FormControl/FormControlCaption.d.ts +1 -2
- package/dist/FormControl/FormControlCaption.js +2 -3
- package/dist/FormControl/FormControlCaption.module.css.js +1 -2
- package/dist/FormControl/FormControlLabel.d.ts +1 -2
- package/dist/FormControl/FormControlLabel.js +1 -2
- package/dist/FormControl/FormControlLeadingVisual.js +1 -2
- package/dist/FormControl/FormControlLeadingVisual.module.css.js +1 -2
- package/dist/FormControl/_FormControlContext.d.ts +1 -2
- package/dist/FormControl/_FormControlContext.js +1 -2
- package/dist/FormControl/_FormControlContextProvider.js +1 -2
- package/dist/FormControl/_FormControlValidation.d.ts +1 -2
- package/dist/FormControl/_FormControlValidation.js +1 -2
- package/dist/FormControl/index.d.ts +3 -3
- package/dist/Header/Header.d.ts +1 -2
- package/dist/Header/Header.js +1 -2
- package/dist/Header/Header.module.css.js +1 -2
- package/dist/Heading/Heading.d.ts +1 -2
- package/dist/Heading/Heading.js +2 -3
- package/dist/Heading/Heading.module.css.js +1 -2
- package/dist/Hidden/Hidden.d.ts +1 -2
- package/dist/Hidden/Hidden.js +1 -2
- package/dist/Hidden/Hidden.module.css.js +1 -2
- package/dist/InlineMessage/InlineMessage.d.ts +1 -2
- package/dist/InlineMessage/InlineMessage.js +1 -2
- package/dist/InlineMessage/InlineMessage.module.css.js +1 -2
- package/dist/KeybindingHint/KeybindingHint.d.ts +1 -2
- package/dist/KeybindingHint/KeybindingHint.js +1 -2
- package/dist/KeybindingHint/KeybindingHint.module.css.js +1 -2
- package/dist/KeybindingHint/components/Chord.js +1 -2
- package/dist/KeybindingHint/components/Chord.module.css.js +1 -2
- package/dist/KeybindingHint/components/Key.js +1 -2
- package/dist/KeybindingHint/components/Sequence.js +1 -2
- package/dist/KeybindingHint/components/utils.js +1 -2
- package/dist/KeybindingHint/key-names.js +1 -2
- package/dist/KeybindingHint/platform.d.ts +0 -2
- package/dist/KeybindingHint/platform.js +1 -2
- package/dist/KeybindingHint/props.d.ts +0 -2
- package/dist/KeybindingHint/utils.d.ts +1 -2
- package/dist/KeybindingHint/utils.js +1 -2
- package/dist/Label/Label.d.ts +1 -2
- package/dist/Label/Label.js +1 -2
- package/dist/Label/Label.module.css.js +1 -2
- package/dist/Label/index.js +1 -2
- package/dist/LabelGroup/LabelGroup.d.ts +1 -2
- package/dist/LabelGroup/LabelGroup.js +3 -4
- package/dist/LabelGroup/LabelGroup.module.css.js +1 -2
- package/dist/Link/Link.d.ts +2 -3
- package/dist/Link/Link.js +3 -4
- package/dist/Link/Link.module.css.js +1 -2
- package/dist/NavList/NavList.d.ts +4 -5
- package/dist/NavList/NavList.js +8 -9
- package/dist/NavList/NavList.module.css.js +1 -2
- package/dist/Octicon/Octicon.d.ts +1 -2
- package/dist/Octicon/Octicon.js +1 -2
- package/dist/Overlay/Overlay.d.ts +2 -3
- package/dist/Overlay/Overlay.js +3 -4
- package/dist/Overlay/Overlay.module.css.js +1 -2
- package/dist/Overlay/constants.d.ts +0 -2
- package/dist/Overlay/constants.js +1 -2
- package/dist/PageHeader/PageHeader.d.ts +4 -5
- package/dist/PageHeader/PageHeader.js +36 -47
- package/dist/PageHeader/PageHeader.module.css.js +1 -2
- package/dist/PageLayout/DragHandle.d.ts +1 -2
- package/dist/PageLayout/DragHandle.js +1 -2
- package/dist/PageLayout/PageLayout.d.ts +2 -3
- package/dist/PageLayout/PageLayout.js +3 -4
- package/dist/PageLayout/PageLayout.module.css.js +1 -2
- package/dist/PageLayout/index.d.ts +1 -1
- package/dist/PageLayout/paneUtils.js +1 -2
- package/dist/PageLayout/usePaneWidth.d.ts +1 -2
- package/dist/PageLayout/usePaneWidth.js +28 -27
- package/dist/Pagehead/Pagehead.d.ts +1 -2
- package/dist/Pagehead/Pagehead.js +1 -2
- package/dist/Pagehead/Pagehead.module.css.js +1 -2
- package/dist/Pagination/Pagination.d.ts +2 -3
- package/dist/Pagination/Pagination.js +2 -3
- package/dist/Pagination/Pagination.module.css.js +1 -2
- package/dist/Pagination/index.js +1 -2
- package/dist/Pagination/model.d.ts +0 -2
- package/dist/Pagination/model.js +1 -2
- package/dist/Popover/Popover.d.ts +1 -2
- package/dist/Popover/Popover.js +3 -4
- package/dist/Popover/Popover.module.css.js +1 -2
- package/dist/Portal/Portal.d.ts +1 -2
- package/dist/Portal/Portal.js +1 -2
- package/dist/Portal/PortalContext.d.ts +1 -2
- package/dist/Portal/PortalContext.js +1 -2
- package/dist/Portal/index.js +1 -2
- package/dist/Portal/portalRoot.d.ts +0 -2
- package/dist/Portal/portalRoot.js +1 -2
- package/dist/ProgressBar/ProgressBar.d.ts +1 -2
- package/dist/ProgressBar/ProgressBar.js +1 -2
- package/dist/ProgressBar/ProgressBar.module.css.js +1 -2
- package/dist/ProgressBar/index.d.ts +1 -2
- package/dist/ProgressBar/index.js +1 -2
- package/dist/Radio/Radio.d.ts +1 -2
- package/dist/Radio/Radio.js +1 -2
- package/dist/Radio/Radio.module.css.js +1 -2
- package/dist/RadioGroup/RadioGroup.d.ts +2 -3
- package/dist/RadioGroup/RadioGroup.js +4 -5
- package/dist/RadioGroup/RadioGroupContext.js +1 -2
- package/dist/RelativeTime/RelativeTime.d.ts +1 -2
- package/dist/RelativeTime/RelativeTime.js +1 -2
- package/dist/ScrollableRegion/ScrollableRegion.d.ts +1 -2
- package/dist/ScrollableRegion/ScrollableRegion.js +1 -2
- package/dist/ScrollableRegion/ScrollableRegion.module.css.js +1 -2
- package/dist/SegmentedControl/SegmentedControl.d.ts +2 -3
- package/dist/SegmentedControl/SegmentedControl.js +9 -10
- package/dist/SegmentedControl/SegmentedControl.module.css.js +1 -2
- package/dist/SegmentedControl/SegmentedControlAction.d.ts +1 -2
- package/dist/SegmentedControl/SegmentedControlAction.js +2 -3
- package/dist/SegmentedControl/SegmentedControlActionContext.js +1 -2
- package/dist/SegmentedControl/SegmentedControlButton.d.ts +1 -2
- package/dist/SegmentedControl/SegmentedControlButton.js +2 -3
- package/dist/SegmentedControl/SegmentedControlDivider.d.ts +1 -2
- package/dist/SegmentedControl/SegmentedControlDivider.js +1 -2
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts +1 -2
- package/dist/SegmentedControl/SegmentedControlIconButton.js +2 -3
- package/dist/SegmentedControl/index.d.ts +3 -3
- package/dist/Select/Select.d.ts +2 -3
- package/dist/Select/Select.js +1 -2
- package/dist/Select/Select.module.css.js +1 -2
- package/dist/SelectPanel/SelectPanel.d.ts +2 -3
- package/dist/SelectPanel/SelectPanel.js +13 -14
- package/dist/SelectPanel/SelectPanel.module.css.js +1 -2
- package/dist/SelectPanel/SelectPanelMessage.d.ts +1 -2
- package/dist/SelectPanel/SelectPanelMessage.js +1 -2
- package/dist/SelectPanel/index.d.ts +1 -1
- package/dist/SideNav.d.ts +1 -2
- package/dist/SideNav.js +1 -2
- package/dist/SideNav.module.css.js +1 -2
- package/dist/Skeleton/SkeletonBox.d.ts +1 -2
- package/dist/Skeleton/SkeletonBox.js +1 -2
- package/dist/Skeleton/SkeletonBox.module.css.js +1 -2
- package/dist/Skeleton/skeleton.module.css.js +1 -2
- package/dist/SkeletonAvatar/SkeletonAvatar.d.ts +1 -2
- package/dist/SkeletonAvatar/SkeletonAvatar.js +2 -3
- package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +1 -2
- package/dist/SkeletonText/SkeletonText.d.ts +1 -2
- package/dist/SkeletonText/SkeletonText.js +2 -3
- package/dist/SkeletonText/SkeletonText.module.css.js +1 -2
- package/dist/Spinner/Spinner.d.ts +1 -2
- package/dist/Spinner/Spinner.js +1 -2
- package/dist/Spinner/Spinner.module.css.js +1 -2
- package/dist/SplitPageLayout/SplitPageLayout.d.ts +1 -2
- package/dist/SplitPageLayout/SplitPageLayout.js +1 -2
- package/dist/Stack/Stack.d.ts +1 -2
- package/dist/Stack/Stack.js +1 -2
- package/dist/Stack/Stack.module.css.js +1 -2
- package/dist/Stack/index.d.ts +2 -3
- package/dist/Stack/index.js +1 -2
- package/dist/StateLabel/StateLabel.d.ts +1 -2
- package/dist/StateLabel/StateLabel.js +1 -2
- package/dist/StateLabel/StateLabel.module.css.js +1 -2
- package/dist/SubNav/SubNav.d.ts +1 -2
- package/dist/SubNav/SubNav.js +1 -2
- package/dist/SubNav/SubNav.module.css.js +1 -2
- package/dist/TabNav/TabNav.d.ts +1 -2
- package/dist/TabNav/TabNav.js +1 -2
- package/dist/TabNav/TabNav.module.css.js +1 -2
- package/dist/Text/Text.d.ts +1 -2
- package/dist/Text/Text.js +1 -2
- package/dist/Text/Text.module.css.js +1 -2
- package/dist/TextInput/TextInput.d.ts +2 -3
- package/dist/TextInput/TextInput.js +113 -121
- package/dist/TextInput/TextInput.module.css.js +1 -2
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts +2 -3
- package/dist/TextInputWithTokens/TextInputWithTokens.js +4 -5
- package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +1 -2
- package/dist/Textarea/TextArea.module.css.js +1 -2
- package/dist/Textarea/Textarea.d.ts +2 -3
- package/dist/Textarea/Textarea.js +5 -6
- package/dist/ThemeContext.d.ts +1 -2
- package/dist/ThemeContext.js +1 -2
- package/dist/ThemeProvider.d.ts +1 -2
- package/dist/ThemeProvider.js +2 -3
- package/dist/Timeline/Timeline.d.ts +4 -5
- package/dist/Timeline/Timeline.js +62 -142
- package/dist/Timeline/Timeline.module.css.js +1 -2
- package/dist/Timeline/constants.d.ts +0 -2
- package/dist/ToggleSwitch/ToggleSwitch.d.ts +1 -2
- package/dist/ToggleSwitch/ToggleSwitch.js +3 -4
- package/dist/ToggleSwitch/ToggleSwitch.module.css.js +1 -2
- package/dist/Token/IssueLabelToken.d.ts +2 -3
- package/dist/Token/IssueLabelToken.js +2 -3
- package/dist/Token/IssueLabelToken.module.css.js +1 -2
- package/dist/Token/Token.d.ts +2 -3
- package/dist/Token/Token.js +3 -4
- package/dist/Token/Token.module.css.js +1 -2
- package/dist/Token/TokenBase.d.ts +1 -2
- package/dist/Token/TokenBase.js +1 -2
- package/dist/Token/TokenBase.module.css.js +1 -2
- package/dist/Token/_RemoveTokenButton.js +1 -2
- package/dist/Token/_RemoveTokenButton.module.css.js +1 -2
- package/dist/Token/_TokenTextContainer.js +1 -2
- package/dist/Token/_TokenTextContainer.module.css.js +1 -2
- package/dist/Token/constants.d.ts +0 -2
- package/dist/Token/constants.js +1 -2
- package/dist/Token/utils.js +1 -2
- package/dist/Tooltip/Tooltip.d.ts +1 -2
- package/dist/Tooltip/Tooltip.js +2 -3
- package/dist/Tooltip/Tooltip.module.css.js +1 -2
- package/dist/Tooltip/TooltipContext.js +1 -2
- package/dist/TooltipV2/Tooltip.d.ts +2 -3
- package/dist/TooltipV2/Tooltip.js +84 -96
- package/dist/TooltipV2/Tooltip.module.css.js +1 -2
- package/dist/TooltipV2/TooltipContext.js +1 -2
- package/dist/TopicTag/TopicTag.d.ts +1 -2
- package/dist/TopicTag/TopicTag.js +1 -2
- package/dist/TopicTag/TopicTag.module.css.js +1 -2
- package/dist/TopicTag/TopicTagGroup.d.ts +1 -2
- package/dist/TopicTag/TopicTagGroup.js +1 -2
- package/dist/TopicTag/TopicTagGroup.module.css.js +1 -2
- package/dist/TopicTag/index.d.ts +1 -2
- package/dist/TopicTag/index.js +1 -2
- package/dist/TreeView/TreeView.d.ts +1 -2
- package/dist/TreeView/TreeView.js +16 -17
- package/dist/TreeView/TreeView.module.css.js +1 -2
- package/dist/TreeView/shared.js +1 -2
- package/dist/TreeView/useRovingTabIndex.d.ts +1 -2
- package/dist/TreeView/useRovingTabIndex.js +1 -2
- package/dist/TreeView/useTreeItemCache.js +1 -2
- package/dist/TreeView/useTreeRovingTabIndex.js +12 -12
- package/dist/TreeView/useTypeahead.js +1 -2
- package/dist/Truncate/Truncate.d.ts +1 -2
- package/dist/Truncate/Truncate.js +1 -2
- package/dist/Truncate/Truncate.module.css.js +1 -2
- package/dist/UnderlineNav/UnderlineNav.d.ts +1 -2
- package/dist/UnderlineNav/UnderlineNav.js +5 -6
- package/dist/UnderlineNav/UnderlineNav.module.css.js +1 -2
- package/dist/UnderlineNav/UnderlineNavContext.js +1 -2
- package/dist/UnderlineNav/UnderlineNavItem.js +4 -5
- package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -2
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts +1 -2
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.js +1 -2
- package/dist/UnderlineNav/index.d.ts +1 -2
- package/dist/UnderlineNav/index.js +1 -2
- package/dist/UnderlineNav/utils.js +1 -2
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +1 -2
- package/dist/VisuallyHidden/VisuallyHidden.js +1 -2
- package/dist/VisuallyHidden/VisuallyHidden.module.css.js +1 -2
- package/dist/_VisuallyHidden.js +1 -2
- package/dist/_VisuallyHidden.module.css.js +1 -2
- package/dist/deprecated/ActionList/Divider.d.ts +1 -2
- package/dist/deprecated/ActionList/Divider.js +1 -2
- package/dist/deprecated/ActionList/Divider.module.css.js +1 -2
- package/dist/deprecated/ActionList/Group.d.ts +1 -2
- package/dist/deprecated/ActionList/Group.js +1 -2
- package/dist/deprecated/ActionList/Header.d.ts +1 -2
- package/dist/deprecated/ActionList/Header.js +1 -2
- package/dist/deprecated/ActionList/Header.module.css.js +1 -2
- package/dist/deprecated/ActionList/Item.d.ts +2 -3
- package/dist/deprecated/ActionList/Item.js +2 -3
- package/dist/deprecated/ActionList/Item.module.css.js +1 -2
- package/dist/deprecated/ActionList/List.d.ts +2 -3
- package/dist/deprecated/ActionList/List.js +1 -2
- package/dist/deprecated/ActionList/List.module.css.js +1 -2
- package/dist/deprecated/ActionList/index.d.ts +4 -5
- package/dist/deprecated/ActionList/index.js +2 -3
- package/dist/deprecated/ActionMenu.d.ts +3 -4
- package/dist/deprecated/ActionMenu.js +6 -7
- package/dist/deprecated/DialogV1/Dialog.d.ts +1 -2
- package/dist/deprecated/DialogV1/Dialog.js +2 -3
- package/dist/deprecated/DialogV1/Dialog.module.css.js +1 -2
- package/dist/deprecated/FilteredSearch/FilteredSearch.d.ts +0 -2
- package/dist/deprecated/FilteredSearch/FilteredSearch.js +1 -2
- package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +1 -2
- package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts +1 -2
- package/dist/deprecated/UnderlineNav/UnderlineNav.js +1 -2
- package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +1 -2
- package/dist/deprecated/index.d.ts +1 -1
- package/dist/deprecated/index.js +3 -4
- package/dist/experimental/IssueLabel/IssueLabel.d.ts +1 -2
- package/dist/experimental/IssueLabel/IssueLabel.js +1 -2
- package/dist/experimental/IssueLabel/IssueLabel.module.css.js +1 -2
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts +4 -5
- package/dist/experimental/SelectPanel2/SelectPanel.js +16 -17
- package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +1 -2
- package/dist/experimental/Tabs/Tabs.d.ts +1 -2
- package/dist/experimental/Tabs/Tabs.js +1 -2
- package/dist/experimental/Tabs/TabsContext.js +1 -2
- package/dist/experimental/Tabs/index.d.ts +1 -1
- package/dist/experimental/Tabs/types.d.ts +1 -2
- package/dist/experimental/Tabs/useTab.d.ts +1 -2
- package/dist/experimental/Tabs/useTab.js +1 -2
- package/dist/experimental/Tabs/useTabList.d.ts +1 -2
- package/dist/experimental/Tabs/useTabList.js +15 -23
- package/dist/experimental/Tabs/useTabPanel.d.ts +1 -2
- package/dist/experimental/Tabs/useTabPanel.js +1 -2
- package/dist/experimental/Tabs/useTabs.js +1 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts +1 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +53 -62
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -2
- package/dist/experimental/index.d.ts +6 -6
- package/dist/experimental/index.js +20 -21
- package/dist/hooks/MatchMediaContext.js +1 -2
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useAnchoredPosition.d.ts +1 -2
- package/dist/hooks/useAnchoredPosition.js +2 -3
- package/dist/hooks/useControllableState.js +1 -2
- package/dist/hooks/useDetails.d.ts +0 -2
- package/dist/hooks/useDetails.js +1 -2
- package/dist/hooks/useDialog.js +1 -2
- package/dist/hooks/useFocusTrap.d.ts +1 -2
- package/dist/hooks/useFocusTrap.js +2 -3
- package/dist/hooks/useFocusZone.d.ts +1 -2
- package/dist/hooks/useFocusZone.js +1 -2
- package/dist/hooks/useId.d.ts +0 -2
- package/dist/hooks/useId.js +1 -2
- package/dist/hooks/useMedia.js +1 -2
- package/dist/hooks/useMenuInitialFocus.js +1 -2
- package/dist/hooks/useMenuKeyboardNavigation.js +1 -2
- package/dist/hooks/useMergedRefs.d.ts +1 -2
- package/dist/hooks/useMergedRefs.js +1 -2
- package/dist/hooks/useMnemonics.js +1 -2
- package/dist/hooks/useOnEscapePress.d.ts +0 -2
- package/dist/hooks/useOnEscapePress.js +1 -2
- package/dist/hooks/useOnOutsideClick.d.ts +1 -2
- package/dist/hooks/useOnOutsideClick.js +1 -2
- package/dist/hooks/useOpenAndCloseFocus.d.ts +1 -2
- package/dist/hooks/useOpenAndCloseFocus.js +1 -2
- package/dist/hooks/useOverflow.d.ts +0 -2
- package/dist/hooks/useOverflow.js +1 -2
- package/dist/hooks/useOverlay.d.ts +1 -2
- package/dist/hooks/useOverlay.js +3 -4
- package/dist/hooks/useProvidedRefOrCreate.d.ts +1 -2
- package/dist/hooks/useProvidedRefOrCreate.js +1 -2
- package/dist/hooks/useProvidedStateOrCreate.js +1 -2
- package/dist/hooks/useRefObjectAsForwardedRef.d.ts +1 -2
- package/dist/hooks/useRefObjectAsForwardedRef.js +3 -4
- package/dist/hooks/useRenderForcingRef.js +1 -2
- package/dist/hooks/useResizeObserver.d.ts +1 -2
- package/dist/hooks/useResizeObserver.js +1 -2
- package/dist/hooks/useResponsiveValue.d.ts +0 -2
- package/dist/hooks/useResponsiveValue.js +1 -2
- package/dist/hooks/useSafeTimeout.d.ts +0 -2
- package/dist/hooks/useSafeTimeout.js +1 -2
- package/dist/hooks/useScrollFlash.js +1 -2
- package/dist/hooks/useSlots.d.ts +1 -2
- package/dist/hooks/useSlots.js +1 -2
- package/dist/hooks/useSyncedState.d.ts +0 -2
- package/dist/hooks/useSyncedState.js +16 -11
- package/dist/index.d.ts +22 -22
- package/dist/index.js +49 -49
- package/dist/internal/components/ButtonReset.js +1 -2
- package/dist/internal/components/ButtonReset.module.css.js +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +6 -7
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts +1 -2
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +2 -3
- package/dist/internal/components/ConditionalWrapper.js +1 -2
- package/dist/internal/components/InputLabel.d.ts +1 -2
- package/dist/internal/components/InputLabel.js +1 -2
- package/dist/internal/components/InputLabel.module.css.js +1 -2
- package/dist/internal/components/InputValidation.js +1 -2
- package/dist/internal/components/InputValidation.module.css.js +1 -2
- package/dist/internal/components/OverflowObserverProvider.js +1 -2
- package/dist/internal/components/TextInputInnerAction.d.ts +1 -2
- package/dist/internal/components/TextInputInnerAction.js +3 -4
- package/dist/internal/components/TextInputInnerAction.module.css.js +1 -2
- package/dist/internal/components/TextInputInnerVisualSlot.js +1 -2
- package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +1 -2
- package/dist/internal/components/TextInputWrapper.d.ts +1 -2
- package/dist/internal/components/TextInputWrapper.js +1 -2
- package/dist/internal/components/TextInputWrapper.module.css.js +1 -2
- package/dist/internal/components/ThemeProviderBase.js +1 -2
- package/dist/internal/components/UnderlineTabbedInterface.js +1 -2
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -2
- package/dist/internal/components/UnstyledTextInput.js +1 -2
- package/dist/internal/components/UnstyledTextInput.module.css.js +1 -2
- package/dist/internal/components/ValidationAnimationContainer.js +1 -2
- package/dist/internal/components/ValidationAnimationContainer.module.css.js +1 -2
- package/dist/internal/hooks/useDevOnlyEffect.js +1 -2
- package/dist/internal/hooks/useEffectCallback.js +1 -2
- package/dist/internal/hooks/useEffectOnce.js +1 -2
- package/dist/internal/hooks/useOverflowObserver.js +1 -2
- package/dist/internal/hooks/useThemeProvider.js +1 -2
- package/dist/internal/internal-types.d.ts +0 -2
- package/dist/internal/utils/getResponsiveAttributes.js +1 -2
- package/dist/internal/utils/hasInteractiveNodes.js +1 -2
- package/dist/legacy-theme/ts/color-schemes.js +0 -1
- package/dist/live-region/Announce.d.ts +1 -2
- package/dist/live-region/Announce.js +1 -2
- package/dist/live-region/AriaAlert.d.ts +1 -2
- package/dist/live-region/AriaAlert.js +1 -2
- package/dist/live-region/AriaStatus.d.ts +1 -2
- package/dist/live-region/AriaStatus.js +1 -2
- package/dist/next/ThemeProvider.d.ts +1 -2
- package/dist/next/ThemeProvider.js +1 -2
- package/dist/next/index.d.ts +2 -2
- package/dist/next/index.js +1 -1
- package/dist/test-helpers.d.ts +0 -2
- package/dist/test-helpers.js +1 -2
- package/dist/theme.d.ts +1 -2
- package/dist/theme.js +1 -2
- package/dist/useTheme.d.ts +1 -2
- package/dist/useTheme.js +1 -2
- package/dist/utils/as-slot.d.ts +1 -2
- package/dist/utils/as-slot.js +1 -2
- package/dist/utils/character-counter.js +1 -2
- package/dist/utils/create-component.d.ts +1 -2
- package/dist/utils/create-component.js +1 -2
- package/dist/utils/descendant-registry.js +1 -2
- package/dist/utils/environment.js +1 -2
- package/dist/utils/getBreakpointDeclarations.js +1 -2
- package/dist/utils/invariant.js +1 -2
- package/dist/utils/is-slot.d.ts +1 -2
- package/dist/utils/is-slot.js +1 -2
- package/dist/utils/isNumeric.js +1 -2
- package/dist/utils/modern-polymorphic.d.ts +1 -2
- package/dist/utils/modern-polymorphic.js +1 -2
- package/dist/utils/polymorphic.d.ts +1 -2
- package/dist/utils/react-compiler-runtime.js +1 -2
- package/dist/utils/scroll.js +1 -2
- package/dist/utils/theme.js +1 -2
- package/dist/utils/types/AriaRole.d.ts +0 -2
- package/dist/utils/types/ComponentProps.d.ts +0 -2
- package/dist/utils/types/FormValidationStatus.d.ts +0 -2
- package/dist/utils/types/KeyPaths.d.ts +0 -2
- package/dist/utils/types/MandateProps.d.ts +0 -2
- package/dist/utils/types/Merge.d.ts +0 -2
- package/dist/utils/types/Slots.d.ts +0 -2
- package/dist/utils/types/ViewportRangeKeys.d.ts +0 -2
- package/dist/utils/useIsomorphicLayoutEffect.d.ts +1 -2
- package/dist/utils/useIsomorphicLayoutEffect.js +1 -2
- package/dist/utils/warning.js +1 -2
- package/package.json +6 -7
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
|
-
import { reactMajorVersion } from "../utils/environment.js";
|
|
3
|
-
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
4
|
-
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
5
|
-
import { useOnEscapePress } from "../hooks/useOnEscapePress.js";
|
|
6
2
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { useOnEscapePress } from "../hooks/useOnEscapePress.js";
|
|
4
|
+
import { useMergedRefs } from "../hooks/useMergedRefs.js";
|
|
9
5
|
import { invariant } from "../utils/invariant.js";
|
|
6
|
+
import { warning } from "../utils/warning.js";
|
|
10
7
|
import Tooltip_module_css_default from "./Tooltip.module.css.js";
|
|
11
|
-
import VisuallyHidden from "../_VisuallyHidden.js";
|
|
12
|
-
import { usePlatform } from "../KeybindingHint/platform.js";
|
|
13
|
-
import { KeybindingHint } from "../KeybindingHint/KeybindingHint.js";
|
|
14
8
|
import { getAccessibleKeybindingHintString } from "../KeybindingHint/utils.js";
|
|
9
|
+
import { KeybindingHint } from "../KeybindingHint/KeybindingHint.js";
|
|
10
|
+
import { usePlatform } from "../KeybindingHint/platform.js";
|
|
11
|
+
import VisuallyHidden from "../_VisuallyHidden.js";
|
|
15
12
|
import useSafeTimeout from "../hooks/useSafeTimeout.js";
|
|
16
13
|
import { TooltipContext } from "./TooltipContext.js";
|
|
14
|
+
import { reactMajorVersion } from "../utils/environment.js";
|
|
17
15
|
import React, { Children, useEffect, useRef, useState } from "react";
|
|
18
16
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
19
17
|
import { clsx } from "clsx";
|
|
20
18
|
import { getAnchoredPosition } from "@primer/behaviors";
|
|
21
19
|
import { apply, isSupported } from "@oddbird/popover-polyfill/fn";
|
|
22
|
-
|
|
20
|
+
// src/TooltipV2/Tooltip.tsx
|
|
23
21
|
const directionToPosition = {
|
|
24
22
|
nw: {
|
|
25
23
|
side: "outside-top",
|
|
@@ -82,7 +80,7 @@ const isInteractive = (element) => {
|
|
|
82
80
|
};
|
|
83
81
|
const emptyKeybindingHints = [];
|
|
84
82
|
const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
85
|
-
const $ = c(
|
|
83
|
+
const $ = c(56);
|
|
86
84
|
let children;
|
|
87
85
|
let className;
|
|
88
86
|
let id;
|
|
@@ -129,24 +127,20 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
129
127
|
warning(isFragmentTrigger, "The `Tooltip` component does not support a React Fragment as its trigger. Pass a single interactive element instead.");
|
|
130
128
|
const elementChild = /*#__PURE__*/ React.isValidElement(child) ? child : void 0;
|
|
131
129
|
const childRef = reactMajorVersion > 18 ? elementChild === null || elementChild === void 0 ? void 0 : elementChild.props.ref : elementChild === null || elementChild === void 0 ? void 0 : elementChild.ref;
|
|
132
|
-
const mergedRefEnabled = useFeatureFlag("primer_react_merged_forwarded_refs");
|
|
133
130
|
const triggerRef = useRef(null);
|
|
134
131
|
const mergedTriggerRef = useMergedRefs(triggerRef, useMergedRefs(forwardedRef, childRef));
|
|
135
|
-
const providedOrCreatedRef = useProvidedRefOrCreate(forwardedRef !== null && forwardedRef !== void 0 ? forwardedRef : childRef);
|
|
136
|
-
const readTriggerRef = mergedRefEnabled ? triggerRef : providedOrCreatedRef;
|
|
137
|
-
const appliedTriggerRef = mergedRefEnabled ? mergedTriggerRef : providedOrCreatedRef;
|
|
138
132
|
const tooltipElRef = useRef(null);
|
|
139
133
|
const [calculatedDirection, setCalculatedDirection] = useState(direction);
|
|
140
134
|
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
|
|
141
135
|
const openTimeoutRef = React.useRef(null);
|
|
142
136
|
const { safeSetTimeout, safeClearTimeout } = useSafeTimeout();
|
|
143
137
|
let t6;
|
|
144
|
-
if ($[11] !== _privateDisableTooltip || $[12] !== direction
|
|
138
|
+
if ($[11] !== _privateDisableTooltip || $[12] !== direction) {
|
|
145
139
|
t6 = () => {
|
|
146
140
|
try {
|
|
147
|
-
if (tooltipElRef.current &&
|
|
141
|
+
if (tooltipElRef.current && triggerRef.current instanceof HTMLElement && tooltipElRef.current.hasAttribute("popover") && !tooltipElRef.current.matches(":popover-open") && !_privateDisableTooltip) {
|
|
148
142
|
const tooltip = tooltipElRef.current;
|
|
149
|
-
const trigger =
|
|
143
|
+
const trigger = triggerRef.current;
|
|
150
144
|
tooltip.showPopover();
|
|
151
145
|
setIsPopoverOpen(true);
|
|
152
146
|
const settings = {
|
|
@@ -166,19 +160,18 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
166
160
|
};
|
|
167
161
|
$[11] = _privateDisableTooltip;
|
|
168
162
|
$[12] = direction;
|
|
169
|
-
$[13] =
|
|
170
|
-
|
|
171
|
-
} else t6 = $[14];
|
|
163
|
+
$[13] = t6;
|
|
164
|
+
} else t6 = $[13];
|
|
172
165
|
const openTooltip = t6;
|
|
173
166
|
let t7;
|
|
174
|
-
if ($[
|
|
167
|
+
if ($[14] !== safeClearTimeout) {
|
|
175
168
|
t7 = () => {
|
|
176
169
|
if (openTimeoutRef.current) {
|
|
177
170
|
safeClearTimeout(openTimeoutRef.current);
|
|
178
171
|
openTimeoutRef.current = null;
|
|
179
172
|
}
|
|
180
173
|
try {
|
|
181
|
-
if (tooltipElRef.current &&
|
|
174
|
+
if (tooltipElRef.current && triggerRef.current && tooltipElRef.current.hasAttribute("popover") && tooltipElRef.current.matches(":popover-open")) {
|
|
182
175
|
tooltipElRef.current.hidePopover();
|
|
183
176
|
setIsPopoverOpen(false);
|
|
184
177
|
} else setIsPopoverOpen(false);
|
|
@@ -187,23 +180,22 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
187
180
|
if (error_0 && typeof error_0 === "object" && "message" in error_0 && typeof error_0.message === "string" && error_0.message.includes("not a valid selector")) {} else throw error_0;
|
|
188
181
|
}
|
|
189
182
|
};
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
|
|
193
|
-
} else t7 = $[17];
|
|
183
|
+
$[14] = safeClearTimeout;
|
|
184
|
+
$[15] = t7;
|
|
185
|
+
} else t7 = $[15];
|
|
194
186
|
const closeTooltip = t7;
|
|
195
187
|
let t8;
|
|
196
|
-
if ($[
|
|
188
|
+
if ($[16] !== tooltipId) {
|
|
197
189
|
t8 = { tooltipId };
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
} else t8 = $[
|
|
190
|
+
$[16] = tooltipId;
|
|
191
|
+
$[17] = t8;
|
|
192
|
+
} else t8 = $[17];
|
|
201
193
|
const value = t8;
|
|
202
194
|
let t9;
|
|
203
|
-
if ($[
|
|
195
|
+
if ($[18] !== type) {
|
|
204
196
|
t9 = () => {
|
|
205
|
-
if (!tooltipElRef.current || !
|
|
206
|
-
const trigger_0 =
|
|
197
|
+
if (!tooltipElRef.current || !triggerRef.current) return;
|
|
198
|
+
const trigger_0 = triggerRef.current;
|
|
207
199
|
const isInvalidTrigger = !(trigger_0 instanceof HTMLElement);
|
|
208
200
|
warning(isInvalidTrigger, "The `Tooltip` component expects its trigger ref to resolve to an HTML element. Ensure the trigger forwards its ref to a single interactive element instead of a React Fragment.");
|
|
209
201
|
if (isInvalidTrigger) return;
|
|
@@ -221,26 +213,23 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
221
213
|
}
|
|
222
214
|
tooltipElRef.current.setAttribute("popover", "auto");
|
|
223
215
|
};
|
|
224
|
-
$[
|
|
225
|
-
$[
|
|
226
|
-
|
|
227
|
-
} else t9 = $[22];
|
|
216
|
+
$[18] = type;
|
|
217
|
+
$[19] = t9;
|
|
218
|
+
} else t9 = $[19];
|
|
228
219
|
let t10;
|
|
229
|
-
if ($[
|
|
220
|
+
if ($[20] !== direction || $[21] !== type) {
|
|
230
221
|
t10 = [
|
|
231
222
|
tooltipElRef,
|
|
232
|
-
readTriggerRef,
|
|
233
223
|
direction,
|
|
234
224
|
type
|
|
235
225
|
];
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
|
|
240
|
-
} else t10 = $[26];
|
|
226
|
+
$[20] = direction;
|
|
227
|
+
$[21] = type;
|
|
228
|
+
$[22] = t10;
|
|
229
|
+
} else t10 = $[22];
|
|
241
230
|
useEffect(t9, t10);
|
|
242
231
|
let t11;
|
|
243
|
-
if ($[
|
|
232
|
+
if ($[23] !== _privateDisableTooltip || $[24] !== closeTooltip || $[25] !== isPopoverOpen) {
|
|
244
233
|
t11 = (event) => {
|
|
245
234
|
if (isPopoverOpen) {
|
|
246
235
|
if (!_privateDisableTooltip) {
|
|
@@ -250,32 +239,32 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
250
239
|
closeTooltip();
|
|
251
240
|
}
|
|
252
241
|
};
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
} else t11 = $[
|
|
242
|
+
$[23] = _privateDisableTooltip;
|
|
243
|
+
$[24] = closeTooltip;
|
|
244
|
+
$[25] = isPopoverOpen;
|
|
245
|
+
$[26] = t11;
|
|
246
|
+
} else t11 = $[26];
|
|
258
247
|
let t12;
|
|
259
|
-
if ($[
|
|
248
|
+
if ($[27] !== _privateDisableTooltip || $[28] !== isPopoverOpen) {
|
|
260
249
|
t12 = [isPopoverOpen, _privateDisableTooltip];
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
} else t12 = $[
|
|
250
|
+
$[27] = _privateDisableTooltip;
|
|
251
|
+
$[28] = isPopoverOpen;
|
|
252
|
+
$[29] = t12;
|
|
253
|
+
} else t12 = $[29];
|
|
265
254
|
useOnEscapePress(t11, t12);
|
|
266
255
|
const platform = usePlatform();
|
|
267
256
|
const hasAriaLabel_0 = "aria-label" in rest;
|
|
268
257
|
let t13;
|
|
269
|
-
if ($[
|
|
258
|
+
if ($[30] !== keybindingHint) {
|
|
270
259
|
t13 = Array.isArray(keybindingHint) ? keybindingHint : [keybindingHint];
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
} else t13 = $[
|
|
260
|
+
$[30] = keybindingHint;
|
|
261
|
+
$[31] = t13;
|
|
262
|
+
} else t13 = $[31];
|
|
274
263
|
const keybindingHints = t13;
|
|
275
264
|
if (isFragmentTrigger) return child;
|
|
276
265
|
const t14 = TooltipContext;
|
|
277
266
|
const t15 = /*#__PURE__*/ React.isValidElement(child) && /*#__PURE__*/ React.cloneElement(child, {
|
|
278
|
-
ref:
|
|
267
|
+
ref: mergedTriggerRef,
|
|
279
268
|
"aria-describedby": (() => {
|
|
280
269
|
if (type !== "description") return child.props["aria-describedby"];
|
|
281
270
|
const existingDescribedBy = child.props["aria-describedby"];
|
|
@@ -317,15 +306,15 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
317
306
|
}
|
|
318
307
|
});
|
|
319
308
|
let t17;
|
|
320
|
-
if ($[
|
|
309
|
+
if ($[32] !== className) {
|
|
321
310
|
t17 = clsx(className, Tooltip_module_css_default.Tooltip);
|
|
322
|
-
$[
|
|
323
|
-
$[
|
|
324
|
-
} else t17 = $[
|
|
311
|
+
$[32] = className;
|
|
312
|
+
$[33] = t17;
|
|
313
|
+
} else t17 = $[33];
|
|
325
314
|
const t18 = type === "description" ? "tooltip" : void 0;
|
|
326
315
|
const t19 = hasAriaLabel_0 || keybindingHints.length === 0 ? tooltipId : void 0;
|
|
327
316
|
let t20;
|
|
328
|
-
if ($[
|
|
317
|
+
if ($[34] !== hasAriaLabel_0 || $[35] !== keybindingHints || $[36] !== platform || $[37] !== text || $[38] !== tooltipId) {
|
|
329
318
|
t20 = keybindingHints.length > 0 ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("span", {
|
|
330
319
|
id: hasAriaLabel_0 ? void 0 : tooltipId,
|
|
331
320
|
children: [text, /* @__PURE__ */ jsxs(VisuallyHidden, { children: [
|
|
@@ -339,15 +328,15 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
339
328
|
"data-component": "Tooltip.KeybindingHintContainer",
|
|
340
329
|
children: keybindingHints.map(_temp4)
|
|
341
330
|
})] }) : text;
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
} else t20 = $[
|
|
331
|
+
$[34] = hasAriaLabel_0;
|
|
332
|
+
$[35] = keybindingHints;
|
|
333
|
+
$[36] = platform;
|
|
334
|
+
$[37] = text;
|
|
335
|
+
$[38] = tooltipId;
|
|
336
|
+
$[39] = t20;
|
|
337
|
+
} else t20 = $[39];
|
|
349
338
|
let t21;
|
|
350
|
-
if ($[
|
|
339
|
+
if ($[40] !== calculatedDirection || $[41] !== closeTooltip || $[42] !== openTooltip || $[43] !== rest || $[44] !== t17 || $[45] !== t18 || $[46] !== t19 || $[47] !== t20) {
|
|
351
340
|
t21 = /* @__PURE__ */ jsx("span", {
|
|
352
341
|
className: t17,
|
|
353
342
|
ref: tooltipElRef,
|
|
@@ -361,34 +350,34 @@ const Tooltip = /*#__PURE__*/ React.forwardRef((t0, forwardedRef) => {
|
|
|
361
350
|
id: t19,
|
|
362
351
|
children: t20
|
|
363
352
|
});
|
|
364
|
-
$[
|
|
365
|
-
$[
|
|
366
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
} else t21 = $[
|
|
353
|
+
$[40] = calculatedDirection;
|
|
354
|
+
$[41] = closeTooltip;
|
|
355
|
+
$[42] = openTooltip;
|
|
356
|
+
$[43] = rest;
|
|
357
|
+
$[44] = t17;
|
|
358
|
+
$[45] = t18;
|
|
359
|
+
$[46] = t19;
|
|
360
|
+
$[47] = t20;
|
|
361
|
+
$[48] = t21;
|
|
362
|
+
} else t21 = $[48];
|
|
374
363
|
let t22;
|
|
375
|
-
if ($[
|
|
364
|
+
if ($[49] !== t15 || $[50] !== t21) {
|
|
376
365
|
t22 = /* @__PURE__ */ jsxs(Fragment$1, { children: [t15, t21] });
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
} else t22 = $[
|
|
366
|
+
$[49] = t15;
|
|
367
|
+
$[50] = t21;
|
|
368
|
+
$[51] = t22;
|
|
369
|
+
} else t22 = $[51];
|
|
381
370
|
let t23;
|
|
382
|
-
if ($[
|
|
371
|
+
if ($[52] !== t14.Provider || $[53] !== t22 || $[54] !== value) {
|
|
383
372
|
t23 = /* @__PURE__ */ jsx(t14.Provider, {
|
|
384
373
|
value,
|
|
385
374
|
children: t22
|
|
386
375
|
});
|
|
387
|
-
$[
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
} else t23 = $[
|
|
376
|
+
$[52] = t14.Provider;
|
|
377
|
+
$[53] = t22;
|
|
378
|
+
$[54] = value;
|
|
379
|
+
$[55] = t23;
|
|
380
|
+
} else t23 = $[55];
|
|
392
381
|
return t23;
|
|
393
382
|
});
|
|
394
383
|
Tooltip.__SLOT__ = Symbol("Tooltip");
|
|
@@ -409,5 +398,4 @@ function _temp4(hint_0, i) {
|
|
|
409
398
|
size: "small"
|
|
410
399
|
})] }, `${i}-${hint_0}`);
|
|
411
400
|
}
|
|
412
|
-
//#endregion
|
|
413
401
|
export { Tooltip };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./Tooltip-dd983e5b.css";
|
|
2
|
-
|
|
2
|
+
// src/TooltipV2/Tooltip.module.css.js
|
|
3
3
|
var Tooltip_module_css_default = {
|
|
4
4
|
"Tooltip": "prc-TooltipV2-Tooltip-tLeuB",
|
|
5
5
|
"tooltip-appear": "prc-TooltipV2-tooltip-appear-xyBco",
|
|
@@ -7,5 +7,4 @@ var Tooltip_module_css_default = {
|
|
|
7
7
|
"HasTextBefore": "prc-TooltipV2-HasTextBefore-fdOXj",
|
|
8
8
|
"HasMultipleHints": "prc-TooltipV2-HasMultipleHints-9VYeg"
|
|
9
9
|
};
|
|
10
|
-
//#endregion
|
|
11
10
|
export { Tooltip_module_css_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementType } from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/TopicTag/TopicTag.d.ts
|
|
4
4
|
type TopicTagProps<As extends ElementType> = {
|
|
5
5
|
/**
|
|
6
6
|
* The HTML element or React component to render as the root element
|
|
@@ -17,5 +17,4 @@ declare function TopicTag<As extends ElementType = 'a'>({
|
|
|
17
17
|
className,
|
|
18
18
|
...rest
|
|
19
19
|
}: TopicTagProps<As>): import("react").JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
20
|
export { TopicTag, type TopicTagProps };
|
|
@@ -2,7 +2,7 @@ import { c } from "../utils/react-compiler-runtime.js";
|
|
|
2
2
|
import TopicTag_module_css_default from "./TopicTag.module.css.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
|
-
|
|
5
|
+
// src/TopicTag/TopicTag.tsx
|
|
6
6
|
function TopicTag(t0) {
|
|
7
7
|
const $ = c(12);
|
|
8
8
|
let as;
|
|
@@ -44,5 +44,4 @@ function TopicTag(t0) {
|
|
|
44
44
|
} else t2 = $[11];
|
|
45
45
|
return t2;
|
|
46
46
|
}
|
|
47
|
-
//#endregion
|
|
48
47
|
export { TopicTag };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "./TopicTag-b15f6cf1.css";
|
|
2
|
-
|
|
2
|
+
// src/TopicTag/TopicTag.module.css.js
|
|
3
3
|
var TopicTag_module_css_default = { "TopicTag": "prc-TopicTag-TopicTag-LS-jX" };
|
|
4
|
-
//#endregion
|
|
5
4
|
export { TopicTag_module_css_default as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/TopicTag/TopicTagGroup.d.ts
|
|
4
4
|
type TopicTagGroupProps = React.HTMLAttributes<HTMLElement>;
|
|
5
5
|
declare function TopicTagGroup({
|
|
6
6
|
children,
|
|
7
7
|
className,
|
|
8
8
|
...rest
|
|
9
9
|
}: TopicTagGroupProps): React.JSX.Element;
|
|
10
|
-
//#endregion
|
|
11
10
|
export { TopicTagGroup, type TopicTagGroupProps };
|
|
@@ -2,7 +2,7 @@ import { c } from "../utils/react-compiler-runtime.js";
|
|
|
2
2
|
import TopicTagGroup_module_css_default from "./TopicTagGroup.module.css.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { clsx } from "clsx";
|
|
5
|
-
|
|
5
|
+
// src/TopicTag/TopicTagGroup.tsx
|
|
6
6
|
function TopicTagGroup(t0) {
|
|
7
7
|
const $ = c(10);
|
|
8
8
|
let children;
|
|
@@ -39,5 +39,4 @@ function TopicTagGroup(t0) {
|
|
|
39
39
|
} else t2 = $[9];
|
|
40
40
|
return t2;
|
|
41
41
|
}
|
|
42
|
-
//#endregion
|
|
43
42
|
export { TopicTagGroup };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import "./TopicTagGroup-785f4d65.css";
|
|
2
|
-
|
|
2
|
+
// src/TopicTag/TopicTagGroup.module.css.js
|
|
3
3
|
var TopicTagGroup_module_css_default = { "TopicTagGroup": "prc-TopicTag-TopicTagGroup-CPva9" };
|
|
4
|
-
//#endregion
|
|
5
4
|
export { TopicTagGroup_module_css_default as default };
|
package/dist/TopicTag/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { TopicTag as TopicTag$1, TopicTagProps } from "./TopicTag.js";
|
|
2
2
|
import { TopicTagGroup, TopicTagGroupProps } from "./TopicTagGroup.js";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/TopicTag/index.d.ts
|
|
5
5
|
declare const TopicTag: typeof TopicTag$1 & {
|
|
6
6
|
Group: typeof TopicTagGroup;
|
|
7
7
|
};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { TopicTag, type TopicTagGroupProps, type TopicTagProps };
|
package/dist/TopicTag/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TopicTag as TopicTag$1 } from "./TopicTag.js";
|
|
2
2
|
import { TopicTagGroup } from "./TopicTagGroup.js";
|
|
3
|
-
|
|
3
|
+
// src/TopicTag/index.ts
|
|
4
4
|
const TopicTag = Object.assign(TopicTag$1, { Group: TopicTagGroup });
|
|
5
|
-
//#endregion
|
|
6
5
|
export { TopicTag };
|
|
@@ -3,7 +3,7 @@ import { DistributiveOmit } from "../utils/modern-polymorphic.js";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Icon } from "@primer/octicons-react";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/TreeView/TreeView.d.ts
|
|
7
7
|
type TreeViewProps = {
|
|
8
8
|
'aria-label'?: React.AriaAttributes['aria-label'];
|
|
9
9
|
'aria-labelledby'?: React.AriaAttributes['aria-labelledby'];
|
|
@@ -72,5 +72,4 @@ declare const TreeView: React.FC<TreeViewProps> & {
|
|
|
72
72
|
DirectoryIcon: () => React.JSX.Element;
|
|
73
73
|
ErrorDialog: React.FC<TreeViewErrorDialogProps>;
|
|
74
74
|
};
|
|
75
|
-
//#endregion
|
|
76
75
|
export { SubTreeState, TreeView, TreeViewErrorDialogProps, TreeViewItemProps, TreeViewProps, TreeViewSecondaryActions, TreeViewSubTreeProps, TreeViewVisualProps };
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { isSlot } from "../utils/is-slot.js";
|
|
4
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
1
|
+
import TreeView_module_css_default from "./TreeView.module.css.js";
|
|
2
|
+
import { ConfirmationDialog } from "../ConfirmationDialog/ConfirmationDialog.js";
|
|
5
3
|
import Spinner from "../Spinner/Spinner.js";
|
|
6
|
-
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
7
4
|
import Text_default from "../Text/Text.js";
|
|
8
5
|
import VisuallyHidden from "../_VisuallyHidden.js";
|
|
9
|
-
import { usePlatform } from "../KeybindingHint/platform.js";
|
|
10
|
-
import { getAccessibleKeybindingHintString } from "../KeybindingHint/utils.js";
|
|
11
|
-
import useSafeTimeout from "../hooks/useSafeTimeout.js";
|
|
12
|
-
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
13
|
-
import { IconButton } from "../Button/IconButton.js";
|
|
14
|
-
import { ButtonComponent } from "../Button/Button.js";
|
|
15
|
-
import { Dialog } from "../Dialog/Dialog.js";
|
|
16
|
-
import { ConfirmationDialog } from "../ConfirmationDialog/ConfirmationDialog.js";
|
|
17
|
-
import { ActionList } from "../ActionList/index.js";
|
|
18
|
-
import TreeView_module_css_default from "./TreeView.module.css.js";
|
|
19
6
|
import { useControllableState } from "../hooks/useControllableState.js";
|
|
7
|
+
import { useId as useId$1 } from "../hooks/useId.js";
|
|
8
|
+
import useSafeTimeout from "../hooks/useSafeTimeout.js";
|
|
9
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
20
10
|
import { getAccessibleName } from "./shared.js";
|
|
21
11
|
import { getFirstChildElement } from "./useRovingTabIndex.js";
|
|
22
12
|
import { useTreeRovingTabIndex } from "./useTreeRovingTabIndex.js";
|
|
23
13
|
import { useTypeahead } from "./useTypeahead.js";
|
|
24
14
|
import { SkeletonAvatar } from "../SkeletonAvatar/SkeletonAvatar.js";
|
|
25
15
|
import { SkeletonText } from "../SkeletonText/SkeletonText.js";
|
|
16
|
+
import { Dialog } from "../Dialog/Dialog.js";
|
|
17
|
+
import { ButtonComponent } from "../Button/Button.js";
|
|
18
|
+
import { IconButton } from "../Button/IconButton.js";
|
|
19
|
+
import { ActionList } from "../ActionList/index.js";
|
|
20
|
+
import { getAccessibleKeybindingHintString } from "../KeybindingHint/utils.js";
|
|
21
|
+
import { usePlatform } from "../KeybindingHint/platform.js";
|
|
22
|
+
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
23
|
+
import { isSlot } from "../utils/is-slot.js";
|
|
24
|
+
import { AriaStatus } from "../live-region/AriaStatus.js";
|
|
25
|
+
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
26
26
|
import React, { useCallback, useEffect } from "react";
|
|
27
27
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
28
28
|
import { clsx } from "clsx";
|
|
29
29
|
import { ChevronDownIcon, ChevronRightIcon, FileDirectoryFillIcon, FileDirectoryOpenFillIcon } from "@primer/octicons-react";
|
|
30
|
-
|
|
30
|
+
// src/TreeView/TreeView.tsx
|
|
31
31
|
const RootContext = /*#__PURE__*/ React.createContext({
|
|
32
32
|
isWithinTree: false,
|
|
33
33
|
announceUpdate: () => {},
|
|
@@ -654,5 +654,4 @@ const TreeView = Object.assign(Root, {
|
|
|
654
654
|
DirectoryIcon,
|
|
655
655
|
ErrorDialog
|
|
656
656
|
});
|
|
657
|
-
//#endregion
|
|
658
657
|
export { TreeView };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./TreeView-1bf45a33.css";
|
|
2
|
-
|
|
2
|
+
// src/TreeView/TreeView.module.css.js
|
|
3
3
|
var TreeView_module_css_default = {
|
|
4
4
|
"TreeViewRootUlStyles": "prc-TreeView-TreeViewRootUlStyles-Mzrmj",
|
|
5
5
|
"TreeViewItem": "prc-TreeView-TreeViewItem-Ter5f",
|
|
@@ -19,5 +19,4 @@ var TreeView_module_css_default = {
|
|
|
19
19
|
"TreeViewSkeletonItemContainerStyle": "prc-TreeView-TreeViewSkeletonItemContainerStyle-lKqwd",
|
|
20
20
|
"TreeItemSkeletonTextStyles": "prc-TreeView-TreeItemSkeletonTextStyles-8VJ-g"
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { TreeView_module_css_default as default };
|
package/dist/TreeView/shared.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/TreeView/shared.ts
|
|
2
2
|
/**
|
|
3
3
|
* Returns the accessible name of an element
|
|
4
4
|
*/
|
|
@@ -10,5 +10,4 @@ function getAccessibleName(element) {
|
|
|
10
10
|
if (labelledby) return (_document$getElementB = (_document$getElementB2 = document.getElementById(labelledby)) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.textContent) !== null && _document$getElementB !== void 0 ? _document$getElementB : "";
|
|
11
11
|
return element.textContent;
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { getAccessibleName };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/TreeView/useRovingTabIndex.d.ts
|
|
4
4
|
declare function useRovingTabIndex({
|
|
5
5
|
containerRef,
|
|
6
6
|
mouseDownRef,
|
|
@@ -10,5 +10,4 @@ declare function useRovingTabIndex({
|
|
|
10
10
|
mouseDownRef?: React.RefObject<boolean>;
|
|
11
11
|
preventScroll?: boolean;
|
|
12
12
|
}, dependencies?: React.DependencyList): void;
|
|
13
|
-
//#endregion
|
|
14
13
|
export { useRovingTabIndex };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
2
|
import { FocusKeys, useFocusZone } from "../hooks/useFocusZone.js";
|
|
3
3
|
import { getScrollContainer } from "../utils/scroll.js";
|
|
4
|
-
|
|
4
|
+
// src/TreeView/useRovingTabIndex.ts
|
|
5
5
|
function useRovingTabIndex(t0, t1) {
|
|
6
6
|
const $ = c(12);
|
|
7
7
|
const { containerRef, mouseDownRef, preventScroll: t2 } = t0;
|
|
@@ -167,5 +167,4 @@ function getPreviousPageElement(element) {
|
|
|
167
167
|
const offset = items.indexOf(element) - pageSize * page;
|
|
168
168
|
return items[Math.max(0, (page - 1) * pageSize + offset)];
|
|
169
169
|
}
|
|
170
|
-
//#endregion
|
|
171
170
|
export { getElementState, getFirstChildElement, getFirstElement, getLastElement, getNextFocusableElement, getParentElement, getVisibleElement, useRovingTabIndex };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
3
|
+
// src/TreeView/useTreeItemCache.ts
|
|
4
4
|
/**
|
|
5
5
|
* A hook that caches tree items to avoid expensive querySelectorAll calls on every keypress.
|
|
6
6
|
* The cache is invalidated when the tree structure changes (via MutationObserver).
|
|
@@ -66,5 +66,4 @@ function useTreeItemCache(containerRef) {
|
|
|
66
66
|
function _temp(mutation) {
|
|
67
67
|
return mutation.type === "childList" || mutation.type === "attributes" && mutation.attributeName === "role";
|
|
68
68
|
}
|
|
69
|
-
//#endregion
|
|
70
69
|
export { useTreeItemCache };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c } from "../utils/react-compiler-runtime.js";
|
|
2
2
|
import { getNextFocusableElement } from "./useRovingTabIndex.js";
|
|
3
|
-
import { useEffect } from "react";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
4
|
import { isEditableElement } from "@primer/behaviors/utils";
|
|
5
|
-
|
|
5
|
+
// src/TreeView/useTreeRovingTabIndex.ts
|
|
6
6
|
const TREE_ITEM = "[role=\"treeitem\"]";
|
|
7
7
|
const CURRENT_TREE_ITEM = `${TREE_ITEM}[aria-current]:not([aria-current="false"])`;
|
|
8
8
|
const TABBABLE_TREE_ITEM = `${TREE_ITEM}[tabindex="0"]`;
|
|
@@ -43,20 +43,21 @@ function useTreeRovingTabIndex(t0) {
|
|
|
43
43
|
const $ = c(5);
|
|
44
44
|
const { containerRef, mouseDownRef, preventScroll: t1 } = t0;
|
|
45
45
|
const preventScroll = t1 === void 0 ? true : t1;
|
|
46
|
+
const tabStopRef = useRef(null);
|
|
46
47
|
let t2;
|
|
47
48
|
let t3;
|
|
48
49
|
if ($[0] !== containerRef || $[1] !== mouseDownRef || $[2] !== preventScroll) {
|
|
49
50
|
t2 = () => {
|
|
51
|
+
tabStopRef.current = null;
|
|
50
52
|
const root = containerRef.current;
|
|
51
53
|
if (!root) return;
|
|
52
54
|
const container = root;
|
|
53
|
-
let tabStop = null;
|
|
54
55
|
const setTabStop = function setTabStop(element) {
|
|
55
|
-
var
|
|
56
|
-
if (element ===
|
|
57
|
-
(
|
|
56
|
+
var _tabStopRef$current;
|
|
57
|
+
if (element === tabStopRef.current) return;
|
|
58
|
+
(_tabStopRef$current = tabStopRef.current) === null || _tabStopRef$current === void 0 || _tabStopRef$current.setAttribute("tabindex", "-1");
|
|
58
59
|
element === null || element === void 0 || element.setAttribute("tabindex", "0");
|
|
59
|
-
|
|
60
|
+
tabStopRef.current = element;
|
|
60
61
|
};
|
|
61
62
|
const getPreferredItem = function getPreferredItem(t4) {
|
|
62
63
|
var _ref, _container$querySelec;
|
|
@@ -64,12 +65,12 @@ function useTreeRovingTabIndex(t0) {
|
|
|
64
65
|
return (_ref = (_container$querySelec = container.querySelector(CURRENT_TREE_ITEM)) !== null && _container$querySelec !== void 0 ? _container$querySelec : candidate) !== null && _ref !== void 0 ? _ref : container.querySelector(TREE_ITEM);
|
|
65
66
|
};
|
|
66
67
|
const removeElementFromTabOrder = function removeElementFromTabOrder(element_0) {
|
|
67
|
-
if (element_0.matches(NESTED_TABBABLE) || element_0 !==
|
|
68
|
+
if (element_0.matches(NESTED_TABBABLE) || element_0 !== tabStopRef.current && element_0.matches(TABBABLE_TREE_ITEM)) element_0.setAttribute("tabindex", "-1");
|
|
68
69
|
};
|
|
69
70
|
const removeFromTabOrder = function removeFromTabOrder(root_0) {
|
|
70
71
|
removeElementFromTabOrder(root_0);
|
|
71
72
|
for (const element_1 of root_0.querySelectorAll(NESTED_TABBABLE)) element_1.setAttribute("tabindex", "-1");
|
|
72
|
-
for (const element_2 of root_0.querySelectorAll(TABBABLE_TREE_ITEM)) if (element_2 !==
|
|
73
|
+
for (const element_2 of root_0.querySelectorAll(TABBABLE_TREE_ITEM)) if (element_2 !== tabStopRef.current) element_2.setAttribute("tabindex", "-1");
|
|
73
74
|
};
|
|
74
75
|
const activeElement = document.activeElement;
|
|
75
76
|
setTabStop(getPreferredItem(activeElement instanceof HTMLElement && container.contains(activeElement) && activeElement.getAttribute("role") === "treeitem" ? activeElement : null));
|
|
@@ -82,8 +83,8 @@ function useTreeRovingTabIndex(t0) {
|
|
|
82
83
|
}
|
|
83
84
|
for (const node of mutation.addedNodes) if (node instanceof Element) removeFromTabOrder(node);
|
|
84
85
|
}
|
|
85
|
-
if (!
|
|
86
|
-
|
|
86
|
+
if (!tabStopRef.current || !container.contains(tabStopRef.current)) {
|
|
87
|
+
tabStopRef.current = null;
|
|
87
88
|
setTabStop(getPreferredItem());
|
|
88
89
|
}
|
|
89
90
|
});
|
|
@@ -151,5 +152,4 @@ function useTreeRovingTabIndex(t0) {
|
|
|
151
152
|
}
|
|
152
153
|
useEffect(t2, t3);
|
|
153
154
|
}
|
|
154
|
-
//#endregion
|
|
155
155
|
export { useTreeRovingTabIndex };
|