@primer/components 0.0.0-20219922627 → 0.0.0-2022530201059
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 +105 -492
- package/README.md +16 -16
- package/codemods/lib/modifyProps.js +7 -9
- package/codemods/lib/prettify.js +1 -1
- package/codemods/lib/replaceImportSource.js +5 -5
- package/dist/browser.esm.js +801 -1115
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +815 -1134
- package/dist/browser.umd.js.map +1 -1
- package/index.d.ts +940 -0
- package/lib/AvatarPair.js +5 -6
- package/lib/AvatarStack.js +10 -10
- package/lib/BaseStyles.js +19 -18
- package/lib/BorderBox.js +5 -4
- package/lib/Box.js +2 -2
- package/lib/BranchName.js +1 -1
- package/lib/{Breadcrumbs.js → Breadcrumb.js} +23 -33
- package/lib/Button/Button.js +3 -3
- package/lib/Button/ButtonClose.js +4 -4
- package/lib/Button/ButtonDanger.js +2 -2
- package/lib/Button/ButtonInvisible.js +3 -3
- package/lib/Button/ButtonOutline.js +2 -2
- package/lib/Button/ButtonPrimary.js +2 -2
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleOcticon.js +7 -9
- package/lib/CounterLabel.js +2 -2
- package/lib/Dialog.js +14 -13
- package/lib/Dropdown.js +2 -2
- package/lib/DropdownStyles.js +6 -6
- package/lib/FilterList.js +1 -1
- package/lib/Flash.js +1 -1
- package/lib/Flex.js +0 -3
- package/lib/Grid.js +3 -4
- package/lib/Header.js +2 -3
- package/lib/Label.js +4 -4
- package/lib/Link.js +12 -1
- package/lib/Overlay.js +35 -120
- package/lib/Pagehead.js +1 -1
- package/lib/Pagination/Pagination.js +2 -3
- package/lib/Popover.js +3 -3
- package/lib/Portal/Portal.js +12 -20
- package/lib/Position.js +27 -46
- package/lib/ProgressBar.js +1 -1
- package/lib/SelectMenu/SelectMenu.js +4 -4
- package/lib/SelectMenu/SelectMenuContext.js +1 -1
- package/lib/SelectMenu/SelectMenuDivider.js +3 -3
- package/lib/SelectMenu/SelectMenuFilter.js +6 -6
- package/lib/SelectMenu/SelectMenuFooter.js +3 -3
- package/lib/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib/SelectMenu/SelectMenuItem.js +4 -4
- package/lib/SelectMenu/SelectMenuList.js +3 -3
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +15 -4
- package/lib/SelectMenu/SelectMenuModal.js +7 -7
- package/lib/SelectMenu/SelectMenuTab.js +3 -3
- package/lib/SelectMenu/SelectMenuTabPanel.js +3 -3
- package/lib/SelectMenu/SelectMenuTabs.js +2 -2
- package/lib/SelectMenu/hooks/useKeyboardNav.js +0 -2
- package/lib/SideNav.js +12 -20
- package/lib/StateLabel.js +4 -4
- package/lib/SubNav.js +3 -5
- package/lib/TabNav.js +3 -3
- package/lib/TextInput.js +19 -24
- package/lib/ThemeProvider.js +15 -32
- package/lib/Timeline.js +29 -24
- package/lib/Tooltip.js +1 -2
- package/lib/UnderlineNav.js +2 -2
- package/lib/behaviors/anchoredPosition.js +9 -17
- package/lib/behaviors/focusTrap.js +14 -32
- package/lib/behaviors/focusZone.js +148 -218
- package/lib/constants.js +2 -3
- package/lib/hooks/index.js +1 -9
- package/lib/hooks/useAnchoredPosition.js +4 -11
- package/lib/hooks/useDialog.js +1 -1
- package/lib/hooks/useFocusTrap.js +8 -26
- package/lib/hooks/useFocusZone.js +7 -7
- package/lib/hooks/useMouseIntent.js +58 -0
- package/lib/hooks/useOnEscapePress.js +10 -53
- package/lib/hooks/useOnOutsideClick.js +35 -62
- package/lib/hooks/useOpenAndCloseFocus.js +1 -1
- package/lib/hooks/useOverlay.js +17 -5
- package/lib/hooks/useSafeTimeout.js +0 -1
- package/lib/index.js +12 -76
- package/lib/polyfills/eventListenerSignal.js +1 -6
- package/lib/stories/Button.stories.js +114 -0
- package/lib/stories/Overlay.stories.js +102 -0
- package/lib/stories/Portal.stories.js +108 -0
- package/lib/stories/ThemeProvider.stories.js +95 -0
- package/lib/stories/useAnchoredPosition.stories.js +349 -0
- package/lib/stories/useFocusTrap.stories.js +278 -0
- package/lib/stories/useFocusZone.stories.js +490 -0
- package/lib/theme-preval.js +2057 -5148
- package/lib/utils/deprecate.js +2 -3
- package/lib/utils/isNumeric.js +0 -1
- package/lib/utils/iterateFocusableElements.js +1 -1
- package/lib/utils/test-deprecations.js +0 -1
- package/lib/utils/test-matchers.js +12 -3
- package/lib/utils/testing.js +4 -4
- package/lib/utils/theme.js +1 -1
- package/lib/utils/uniqueId.js +0 -1
- package/lib-esm/AvatarPair.js +5 -6
- package/lib-esm/AvatarStack.js +11 -11
- package/lib-esm/BaseStyles.js +16 -16
- package/lib-esm/BorderBox.js +3 -5
- package/lib-esm/Box.js +2 -2
- package/lib-esm/BranchName.js +1 -1
- package/lib-esm/{Breadcrumbs.js → Breadcrumb.js} +22 -32
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Button/ButtonTableList.js +1 -1
- package/lib-esm/CircleBadge.js +1 -1
- package/lib-esm/CircleOcticon.js +6 -9
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog.js +12 -10
- package/lib-esm/Dropdown.js +2 -2
- package/lib-esm/DropdownStyles.js +6 -6
- package/lib-esm/FilterList.js +1 -1
- package/lib-esm/Flash.js +1 -1
- package/lib-esm/Flex.js +0 -4
- package/lib-esm/Grid.js +2 -5
- package/lib-esm/Header.js +0 -1
- package/lib-esm/Label.js +2 -2
- package/lib-esm/Link.js +12 -1
- package/lib-esm/Overlay.js +37 -115
- package/lib-esm/Pagehead.js +1 -1
- package/lib-esm/Pagination/Pagination.js +2 -3
- package/lib-esm/Popover.js +3 -3
- package/lib-esm/Portal/Portal.js +12 -19
- package/lib-esm/Portal/index.js +1 -1
- package/lib-esm/Position.js +20 -45
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/SelectMenu/SelectMenu.js +3 -3
- package/lib-esm/SelectMenu/SelectMenuContext.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.js +4 -4
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuList.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +10 -5
- package/lib-esm/SelectMenu/SelectMenuModal.js +5 -5
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib-esm/SelectMenu/hooks/useKeyboardNav.js +0 -2
- package/lib-esm/SideNav.js +7 -16
- package/lib-esm/StateLabel.js +4 -4
- package/lib-esm/SubNav.js +4 -7
- package/lib-esm/TabNav.js +4 -5
- package/lib-esm/TextInput.js +17 -23
- package/lib-esm/ThemeProvider.js +16 -31
- package/lib-esm/Timeline.js +24 -19
- package/lib-esm/Tooltip.js +1 -2
- package/lib-esm/UnderlineNav.js +3 -4
- package/lib-esm/behaviors/anchoredPosition.js +9 -17
- package/lib-esm/behaviors/focusTrap.js +14 -32
- package/lib-esm/behaviors/focusZone.js +148 -213
- package/lib-esm/constants.js +1 -2
- package/lib-esm/hooks/index.js +1 -2
- package/lib-esm/hooks/useAnchoredPosition.js +5 -10
- package/lib-esm/hooks/useDialog.js +1 -1
- package/lib-esm/hooks/useFocusTrap.js +8 -25
- package/lib-esm/hooks/useFocusZone.js +5 -5
- package/lib-esm/hooks/useMouseIntent.js +50 -0
- package/lib-esm/hooks/useOnEscapePress.js +10 -53
- package/lib-esm/hooks/useOnOutsideClick.js +37 -62
- package/lib-esm/hooks/useOpenAndCloseFocus.js +1 -1
- package/lib-esm/hooks/useOverlay.js +16 -5
- package/lib-esm/hooks/useSafeTimeout.js +0 -1
- package/lib-esm/index.js +10 -19
- package/lib-esm/polyfills/eventListenerSignal.js +1 -6
- package/lib-esm/stories/Button.stories.js +79 -0
- package/lib-esm/stories/Overlay.stories.js +80 -0
- package/lib-esm/stories/Portal.stories.js +72 -0
- package/lib-esm/stories/ThemeProvider.stories.js +76 -0
- package/lib-esm/stories/useAnchoredPosition.stories.js +311 -0
- package/lib-esm/stories/useFocusTrap.stories.js +234 -0
- package/lib-esm/stories/useFocusZone.stories.js +445 -0
- package/lib-esm/theme-preval.js +2057 -5148
- package/lib-esm/utils/deprecate.js +2 -3
- package/lib-esm/utils/isNumeric.js +0 -1
- package/lib-esm/utils/iterateFocusableElements.js +1 -1
- package/lib-esm/utils/test-deprecations.js +1 -1
- package/lib-esm/utils/test-matchers.js +11 -3
- package/lib-esm/utils/testing.js +6 -6
- package/lib-esm/utils/theme.js +1 -1
- package/lib-esm/utils/types.js +0 -1
- package/lib-esm/utils/uniqueId.js +0 -1
- package/package.json +95 -103
- package/codemods/__tests__/deprecateUtilityComponents.js +0 -200
- package/codemods/__tests__/removeSystemProps.js +0 -225
- package/codemods/deprecateUtilityComponents.js +0 -111
- package/codemods/removeSystemProps.js +0 -312
- package/lib/ActionList/Divider.d.ts +0 -9
- package/lib/ActionList/Divider.js +0 -40
- package/lib/ActionList/Group.d.ts +0 -28
- package/lib/ActionList/Group.js +0 -35
- package/lib/ActionList/Header.d.ts +0 -29
- package/lib/ActionList/Header.js +0 -51
- package/lib/ActionList/Item.d.ts +0 -92
- package/lib/ActionList/Item.js +0 -288
- package/lib/ActionList/List.d.ts +0 -87
- package/lib/ActionList/List.js +0 -199
- package/lib/ActionList/index.d.ts +0 -17
- package/lib/ActionList/index.js +0 -29
- package/lib/ActionMenu.d.ts +0 -40
- package/lib/ActionMenu.js +0 -103
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +0 -61
- package/lib/AnchoredOverlay/AnchoredOverlay.js +0 -116
- package/lib/AnchoredOverlay/index.d.ts +0 -2
- package/lib/AnchoredOverlay/index.js +0 -13
- package/lib/Avatar.d.ts +0 -15
- package/lib/AvatarPair.d.ts +0 -8
- package/lib/AvatarStack.d.ts +0 -8
- package/lib/BaseStyles.d.ts +0 -14
- package/lib/BorderBox.d.ts +0 -7
- package/lib/Box.d.ts +0 -6
- package/lib/BranchName.d.ts +0 -6
- package/lib/Breadcrumbs.d.ts +0 -40
- package/lib/Button/Button.d.ts +0 -284
- package/lib/Button/ButtonBase.d.ts +0 -12
- package/lib/Button/ButtonClose.d.ts +0 -321
- package/lib/Button/ButtonDanger.d.ts +0 -284
- package/lib/Button/ButtonGroup.d.ts +0 -4
- package/lib/Button/ButtonInvisible.d.ts +0 -284
- package/lib/Button/ButtonOutline.d.ts +0 -284
- package/lib/Button/ButtonPrimary.d.ts +0 -284
- package/lib/Button/ButtonStyles.d.ts +0 -2
- package/lib/Button/ButtonTableList.d.ts +0 -6
- package/lib/Button/index.d.ts +0 -16
- package/lib/Caret.d.ts +0 -21
- package/lib/CircleBadge.d.ts +0 -25
- package/lib/CircleOcticon.d.ts +0 -391
- package/lib/CounterLabel.d.ts +0 -8
- package/lib/DatePicker/DatePicker.d.ts +0 -35
- package/lib/DatePicker/DatePicker.js +0 -37
- package/lib/DatePicker/DatePickerPanel.d.ts +0 -0
- package/lib/DatePicker/DatePickerPanel.js +0 -1
- package/lib/DatePicker/Day.d.ts +0 -12
- package/lib/DatePicker/Day.js +0 -44
- package/lib/DatePicker/Month.d.ts +0 -10
- package/lib/DatePicker/Month.js +0 -28
- package/lib/DatePicker/index.d.ts +0 -2
- package/lib/DatePicker/index.js +0 -13
- package/lib/Details.d.ts +0 -6
- package/lib/Dialog/ConfirmationDialog.d.ts +0 -44
- package/lib/Dialog/ConfirmationDialog.js +0 -191
- package/lib/Dialog/Dialog.d.ts +0 -167
- package/lib/Dialog/Dialog.js +0 -304
- package/lib/Dialog.d.ts +0 -406
- package/lib/Dropdown.d.ts +0 -1262
- package/lib/DropdownMenu/DropdownButton.d.ts +0 -323
- package/lib/DropdownMenu/DropdownButton.js +0 -31
- package/lib/DropdownMenu/DropdownMenu.d.ts +0 -43
- package/lib/DropdownMenu/DropdownMenu.js +0 -94
- package/lib/DropdownMenu/index.d.ts +0 -4
- package/lib/DropdownMenu/index.js +0 -21
- package/lib/DropdownStyles.d.ts +0 -3
- package/lib/FilterList.d.ts +0 -321
- package/lib/FilteredActionList/FilteredActionList.d.ts +0 -16
- package/lib/FilteredActionList/FilteredActionList.js +0 -163
- package/lib/FilteredActionList/index.d.ts +0 -2
- package/lib/FilteredActionList/index.js +0 -13
- package/lib/FilteredSearch.d.ts +0 -6
- package/lib/Flash.d.ts +0 -9
- package/lib/Flex.d.ts +0 -7
- package/lib/FormGroup.d.ts +0 -12
- package/lib/Grid.d.ts +0 -7
- package/lib/Header.d.ts +0 -24
- package/lib/Heading.d.ts +0 -6
- package/lib/Label.d.ts +0 -11
- package/lib/LabelGroup.d.ts +0 -6
- package/lib/Link.d.ts +0 -10
- package/lib/Overlay.d.ts +0 -62
- package/lib/Pagehead.d.ts +0 -6
- package/lib/Pagination/Pagination.d.ts +0 -24
- package/lib/Pagination/index.d.ts +0 -3
- package/lib/Pagination/model.d.ts +0 -26
- package/lib/PointerBox.d.ts +0 -11
- package/lib/Popover.d.ts +0 -21
- package/lib/Portal/Portal.d.ts +0 -25
- package/lib/Portal/index.d.ts +0 -4
- package/lib/Position.d.ts +0 -34
- package/lib/ProgressBar.d.ts +0 -21
- package/lib/SelectMenu/SelectMenu.d.ts +0 -1832
- package/lib/SelectMenu/SelectMenuContext.d.ts +0 -8
- package/lib/SelectMenu/SelectMenuDivider.d.ts +0 -6
- package/lib/SelectMenu/SelectMenuFilter.d.ts +0 -9
- package/lib/SelectMenu/SelectMenuFooter.d.ts +0 -6
- package/lib/SelectMenu/SelectMenuHeader.d.ts +0 -11
- package/lib/SelectMenu/SelectMenuItem.d.ts +0 -15
- package/lib/SelectMenu/SelectMenuList.d.ts +0 -6
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +0 -7
- package/lib/SelectMenu/SelectMenuModal.d.ts +0 -15
- package/lib/SelectMenu/SelectMenuTab.d.ts +0 -14
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +0 -13
- package/lib/SelectMenu/SelectMenuTabs.d.ts +0 -11
- package/lib/SelectMenu/hooks/useKeyboardNav.d.ts +0 -2
- package/lib/SelectMenu/index.d.ts +0 -2
- package/lib/SelectPanel/SelectPanel.d.ts +0 -25
- package/lib/SelectPanel/SelectPanel.js +0 -147
- package/lib/SelectPanel/index.d.ts +0 -2
- package/lib/SelectPanel/index.js +0 -13
- package/lib/SideNav.d.ts +0 -31
- package/lib/Spinner.d.ts +0 -17
- package/lib/Spinner.js +0 -60
- package/lib/StateLabel.d.ts +0 -16
- package/lib/StyledOcticon.d.ts +0 -12
- package/lib/SubNav.d.ts +0 -32
- package/lib/TabNav.d.ts +0 -20
- package/lib/Text.d.ts +0 -6
- package/lib/TextInput.d.ts +0 -22
- package/lib/ThemeProvider.d.ts +0 -26
- package/lib/Timeline.d.ts +0 -407
- package/lib/Tooltip.d.ts +0 -18
- package/lib/Truncate.d.ts +0 -11
- package/lib/UnderlineNav.d.ts +0 -25
- package/lib/behaviors/anchoredPosition.d.ts +0 -89
- package/lib/behaviors/focusTrap.d.ts +0 -12
- package/lib/behaviors/focusZone.d.ts +0 -137
- package/lib/constants.d.ts +0 -20
- package/lib/hooks/index.d.ts +0 -11
- package/lib/hooks/useAnchoredPosition.d.ts +0 -20
- package/lib/hooks/useCombinedRefs.d.ts +0 -10
- package/lib/hooks/useCombinedRefs.js +0 -49
- package/lib/hooks/useDetails.d.ts +0 -17
- package/lib/hooks/useDialog.d.ts +0 -16
- package/lib/hooks/useFocusTrap.d.ts +0 -32
- package/lib/hooks/useFocusZone.d.ts +0 -23
- package/lib/hooks/useOnEscapePress.d.ts +0 -23
- package/lib/hooks/useOnOutsideClick.d.ts +0 -8
- package/lib/hooks/useOpenAndCloseFocus.d.ts +0 -7
- package/lib/hooks/useOverlay.d.ts +0 -14
- package/lib/hooks/useProvidedRefOrCreate.d.ts +0 -10
- package/lib/hooks/useProvidedStateOrCreate.d.ts +0 -10
- package/lib/hooks/useProvidedStateOrCreate.js +0 -27
- package/lib/hooks/useRenderForcingRef.d.ts +0 -8
- package/lib/hooks/useRenderForcingRef.js +0 -25
- package/lib/hooks/useResizeObserver.d.ts +0 -1
- package/lib/hooks/useResizeObserver.js +0 -20
- package/lib/hooks/useSafeTimeout.d.ts +0 -12
- package/lib/hooks/useScrollFlash.d.ts +0 -6
- package/lib/hooks/useScrollFlash.js +0 -29
- package/lib/index.d.ts +0 -111
- package/lib/polyfills/eventListenerSignal.d.ts +0 -6
- package/lib/sx.d.ts +0 -6
- package/lib/theme-preval.d.ts +0 -49
- package/lib/theme.d.ts +0 -2
- package/lib/utils/deprecate.d.ts +0 -18
- package/lib/utils/isNumeric.d.ts +0 -1
- package/lib/utils/iterateFocusableElements.d.ts +0 -42
- package/lib/utils/ssr.d.ts +0 -1
- package/lib/utils/ssr.js +0 -19
- package/lib/utils/test-deprecations.d.ts +0 -1
- package/lib/utils/test-helpers.d.ts +0 -0
- package/lib/utils/test-helpers.js +0 -9
- package/lib/utils/test-matchers.d.ts +0 -1
- package/lib/utils/testing.d.ts +0 -1028
- package/lib/utils/theme.d.ts +0 -9
- package/lib/utils/types.d.ts +0 -14
- package/lib/utils/uniqueId.d.ts +0 -1
- package/lib/utils/userAgent.d.ts +0 -1
- package/lib-esm/ActionList/Divider.d.ts +0 -9
- package/lib-esm/ActionList/Divider.js +0 -23
- package/lib-esm/ActionList/Group.d.ts +0 -28
- package/lib-esm/ActionList/Group.js +0 -24
- package/lib-esm/ActionList/Header.d.ts +0 -29
- package/lib-esm/ActionList/Header.js +0 -33
- package/lib-esm/ActionList/Item.d.ts +0 -92
- package/lib-esm/ActionList/Item.js +0 -253
- package/lib-esm/ActionList/List.d.ts +0 -87
- package/lib-esm/ActionList/List.js +0 -181
- package/lib-esm/ActionList/index.d.ts +0 -17
- package/lib-esm/ActionList/index.js +0 -18
- package/lib-esm/ActionMenu.d.ts +0 -40
- package/lib-esm/ActionMenu.js +0 -82
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +0 -61
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +0 -96
- package/lib-esm/AnchoredOverlay/index.d.ts +0 -2
- package/lib-esm/AnchoredOverlay/index.js +0 -1
- package/lib-esm/Avatar.d.ts +0 -15
- package/lib-esm/AvatarPair.d.ts +0 -8
- package/lib-esm/AvatarStack.d.ts +0 -8
- package/lib-esm/BaseStyles.d.ts +0 -14
- package/lib-esm/BorderBox.d.ts +0 -7
- package/lib-esm/Box.d.ts +0 -6
- package/lib-esm/BranchName.d.ts +0 -6
- package/lib-esm/Breadcrumbs.d.ts +0 -40
- package/lib-esm/Button/Button.d.ts +0 -284
- package/lib-esm/Button/ButtonBase.d.ts +0 -12
- package/lib-esm/Button/ButtonClose.d.ts +0 -321
- package/lib-esm/Button/ButtonDanger.d.ts +0 -284
- package/lib-esm/Button/ButtonGroup.d.ts +0 -4
- package/lib-esm/Button/ButtonInvisible.d.ts +0 -284
- package/lib-esm/Button/ButtonOutline.d.ts +0 -284
- package/lib-esm/Button/ButtonPrimary.d.ts +0 -284
- package/lib-esm/Button/ButtonStyles.d.ts +0 -2
- package/lib-esm/Button/ButtonTableList.d.ts +0 -6
- package/lib-esm/Button/index.d.ts +0 -16
- package/lib-esm/Caret.d.ts +0 -21
- package/lib-esm/CircleBadge.d.ts +0 -25
- package/lib-esm/CircleOcticon.d.ts +0 -391
- package/lib-esm/CounterLabel.d.ts +0 -8
- package/lib-esm/DatePicker/DatePicker.d.ts +0 -35
- package/lib-esm/DatePicker/DatePicker.js +0 -24
- package/lib-esm/DatePicker/DatePickerPanel.d.ts +0 -0
- package/lib-esm/DatePicker/DatePickerPanel.js +0 -0
- package/lib-esm/DatePicker/Day.d.ts +0 -12
- package/lib-esm/DatePicker/Day.js +0 -26
- package/lib-esm/DatePicker/Month.d.ts +0 -10
- package/lib-esm/DatePicker/Month.js +0 -13
- package/lib-esm/DatePicker/index.d.ts +0 -2
- package/lib-esm/DatePicker/index.js +0 -1
- package/lib-esm/Details.d.ts +0 -6
- package/lib-esm/Dialog/ConfirmationDialog.d.ts +0 -44
- package/lib-esm/Dialog/ConfirmationDialog.js +0 -169
- package/lib-esm/Dialog/Dialog.d.ts +0 -167
- package/lib-esm/Dialog/Dialog.js +0 -274
- package/lib-esm/Dialog.d.ts +0 -406
- package/lib-esm/Dropdown.d.ts +0 -1262
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +0 -323
- package/lib-esm/DropdownMenu/DropdownButton.js +0 -16
- package/lib-esm/DropdownMenu/DropdownMenu.d.ts +0 -43
- package/lib-esm/DropdownMenu/DropdownMenu.js +0 -77
- package/lib-esm/DropdownMenu/index.d.ts +0 -4
- package/lib-esm/DropdownMenu/index.js +0 -2
- package/lib-esm/DropdownStyles.d.ts +0 -3
- package/lib-esm/FilterList.d.ts +0 -321
- package/lib-esm/FilteredActionList/FilteredActionList.d.ts +0 -16
- package/lib-esm/FilteredActionList/FilteredActionList.js +0 -137
- package/lib-esm/FilteredActionList/index.d.ts +0 -2
- package/lib-esm/FilteredActionList/index.js +0 -1
- package/lib-esm/FilteredSearch.d.ts +0 -6
- package/lib-esm/Flash.d.ts +0 -9
- package/lib-esm/Flex.d.ts +0 -7
- package/lib-esm/FormGroup.d.ts +0 -12
- package/lib-esm/Grid.d.ts +0 -7
- package/lib-esm/Header.d.ts +0 -24
- package/lib-esm/Heading.d.ts +0 -6
- package/lib-esm/Label.d.ts +0 -11
- package/lib-esm/LabelGroup.d.ts +0 -6
- package/lib-esm/Link.d.ts +0 -10
- package/lib-esm/Overlay.d.ts +0 -62
- package/lib-esm/Pagehead.d.ts +0 -6
- package/lib-esm/Pagination/Pagination.d.ts +0 -24
- package/lib-esm/Pagination/index.d.ts +0 -3
- package/lib-esm/Pagination/model.d.ts +0 -26
- package/lib-esm/PointerBox.d.ts +0 -11
- package/lib-esm/Popover.d.ts +0 -21
- package/lib-esm/Portal/Portal.d.ts +0 -25
- package/lib-esm/Portal/index.d.ts +0 -4
- package/lib-esm/Position.d.ts +0 -34
- package/lib-esm/ProgressBar.d.ts +0 -21
- package/lib-esm/SelectMenu/SelectMenu.d.ts +0 -1832
- package/lib-esm/SelectMenu/SelectMenuContext.d.ts +0 -8
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +0 -6
- package/lib-esm/SelectMenu/SelectMenuFilter.d.ts +0 -9
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +0 -6
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +0 -11
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +0 -15
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +0 -6
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +0 -7
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +0 -15
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +0 -14
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +0 -13
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +0 -11
- package/lib-esm/SelectMenu/hooks/useKeyboardNav.d.ts +0 -2
- package/lib-esm/SelectMenu/index.d.ts +0 -2
- package/lib-esm/SelectPanel/SelectPanel.d.ts +0 -25
- package/lib-esm/SelectPanel/SelectPanel.js +0 -127
- package/lib-esm/SelectPanel/index.d.ts +0 -2
- package/lib-esm/SelectPanel/index.js +0 -1
- package/lib-esm/SideNav.d.ts +0 -31
- package/lib-esm/Spinner.d.ts +0 -17
- package/lib-esm/Spinner.js +0 -46
- package/lib-esm/StateLabel.d.ts +0 -16
- package/lib-esm/StyledOcticon.d.ts +0 -12
- package/lib-esm/SubNav.d.ts +0 -32
- package/lib-esm/TabNav.d.ts +0 -20
- package/lib-esm/Text.d.ts +0 -6
- package/lib-esm/TextInput.d.ts +0 -22
- package/lib-esm/ThemeProvider.d.ts +0 -26
- package/lib-esm/Timeline.d.ts +0 -407
- package/lib-esm/Tooltip.d.ts +0 -18
- package/lib-esm/Truncate.d.ts +0 -11
- package/lib-esm/UnderlineNav.d.ts +0 -25
- package/lib-esm/behaviors/anchoredPosition.d.ts +0 -89
- package/lib-esm/behaviors/focusTrap.d.ts +0 -12
- package/lib-esm/behaviors/focusZone.d.ts +0 -137
- package/lib-esm/constants.d.ts +0 -20
- package/lib-esm/hooks/index.d.ts +0 -11
- package/lib-esm/hooks/useAnchoredPosition.d.ts +0 -20
- package/lib-esm/hooks/useCombinedRefs.d.ts +0 -10
- package/lib-esm/hooks/useCombinedRefs.js +0 -36
- package/lib-esm/hooks/useDetails.d.ts +0 -17
- package/lib-esm/hooks/useDialog.d.ts +0 -16
- package/lib-esm/hooks/useFocusTrap.d.ts +0 -32
- package/lib-esm/hooks/useFocusZone.d.ts +0 -23
- package/lib-esm/hooks/useOnEscapePress.d.ts +0 -23
- package/lib-esm/hooks/useOnOutsideClick.d.ts +0 -8
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +0 -7
- package/lib-esm/hooks/useOverlay.d.ts +0 -14
- package/lib-esm/hooks/useProvidedRefOrCreate.d.ts +0 -10
- package/lib-esm/hooks/useProvidedStateOrCreate.d.ts +0 -10
- package/lib-esm/hooks/useProvidedStateOrCreate.js +0 -20
- package/lib-esm/hooks/useRenderForcingRef.d.ts +0 -8
- package/lib-esm/hooks/useRenderForcingRef.js +0 -18
- package/lib-esm/hooks/useResizeObserver.d.ts +0 -1
- package/lib-esm/hooks/useResizeObserver.js +0 -10
- package/lib-esm/hooks/useSafeTimeout.d.ts +0 -12
- package/lib-esm/hooks/useScrollFlash.d.ts +0 -6
- package/lib-esm/hooks/useScrollFlash.js +0 -22
- package/lib-esm/index.d.ts +0 -111
- package/lib-esm/polyfills/eventListenerSignal.d.ts +0 -6
- package/lib-esm/sx.d.ts +0 -6
- package/lib-esm/theme-preval.d.ts +0 -49
- package/lib-esm/theme.d.ts +0 -2
- package/lib-esm/utils/deprecate.d.ts +0 -18
- package/lib-esm/utils/isNumeric.d.ts +0 -1
- package/lib-esm/utils/iterateFocusableElements.d.ts +0 -42
- package/lib-esm/utils/ssr.d.ts +0 -1
- package/lib-esm/utils/ssr.js +0 -1
- package/lib-esm/utils/test-deprecations.d.ts +0 -1
- package/lib-esm/utils/test-helpers.d.ts +0 -0
- package/lib-esm/utils/test-helpers.js +0 -7
- package/lib-esm/utils/test-matchers.d.ts +0 -1
- package/lib-esm/utils/testing.d.ts +0 -1028
- package/lib-esm/utils/theme.d.ts +0 -9
- package/lib-esm/utils/types.d.ts +0 -14
- package/lib-esm/utils/uniqueId.d.ts +0 -1
- package/lib-esm/utils/userAgent.d.ts +0 -1
@@ -1,28 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { SxProp } from '../sx';
|
3
|
-
import { HeaderProps } from './Header';
|
4
|
-
/**
|
5
|
-
* Contract for props passed to the `Group` component.
|
6
|
-
*/
|
7
|
-
export interface GroupProps extends React.ComponentPropsWithoutRef<'div'>, SxProp {
|
8
|
-
/**
|
9
|
-
* Props for a `Header` to render in the `Group`.
|
10
|
-
*/
|
11
|
-
header?: HeaderProps;
|
12
|
-
/**
|
13
|
-
* The id of the group.
|
14
|
-
*/
|
15
|
-
groupId?: string;
|
16
|
-
/**
|
17
|
-
* `Items` to render in the `Group`.
|
18
|
-
*/
|
19
|
-
items?: JSX.Element[];
|
20
|
-
/**
|
21
|
-
* Whether to display a divider above each `Item` in this `Group` when it does not follow a `Header` or `Divider`.
|
22
|
-
*/
|
23
|
-
showItemDividers?: boolean;
|
24
|
-
}
|
25
|
-
/**
|
26
|
-
* Collects related `Items` in an `ActionList`.
|
27
|
-
*/
|
28
|
-
export declare function Group({ header, items, ...props }: GroupProps): JSX.Element;
|
package/lib/ActionList/Group.js
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Group = Group;
|
7
|
-
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
9
|
-
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
11
|
-
|
12
|
-
var _sx = _interopRequireDefault(require("../sx"));
|
13
|
-
|
14
|
-
var _Header = require("./Header");
|
15
|
-
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
-
|
18
|
-
const StyledGroup = _styledComponents.default.div.withConfig({
|
19
|
-
displayName: "Group__StyledGroup",
|
20
|
-
componentId: "sc-10w5bj9-0"
|
21
|
-
})(["", ""], _sx.default);
|
22
|
-
/**
|
23
|
-
* Collects related `Items` in an `ActionList`.
|
24
|
-
*/
|
25
|
-
|
26
|
-
|
27
|
-
function Group({
|
28
|
-
header,
|
29
|
-
items,
|
30
|
-
...props
|
31
|
-
}) {
|
32
|
-
return /*#__PURE__*/_react.default.createElement(StyledGroup, props, header && /*#__PURE__*/_react.default.createElement(_Header.Header, header), items);
|
33
|
-
}
|
34
|
-
|
35
|
-
Group.displayName = "Group";
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { SxProp } from '../sx';
|
3
|
-
/**
|
4
|
-
* Contract for props passed to the `Header` component.
|
5
|
-
*/
|
6
|
-
export interface HeaderProps extends React.ComponentPropsWithoutRef<'div'>, SxProp {
|
7
|
-
/**
|
8
|
-
* Style variations. Usage is discretionary.
|
9
|
-
*
|
10
|
-
* - `"filled"` - Superimposed on a background, offset from nearby content
|
11
|
-
* - `"subtle"` - Relatively less offset from nearby content
|
12
|
-
*/
|
13
|
-
variant?: 'subtle' | 'filled';
|
14
|
-
/**
|
15
|
-
* Primary text which names a `Group`.
|
16
|
-
*/
|
17
|
-
title: string;
|
18
|
-
/**
|
19
|
-
* Secondary text which provides additional information about a `Group`.
|
20
|
-
*/
|
21
|
-
auxiliaryText?: string;
|
22
|
-
}
|
23
|
-
export declare const StyledHeader: import("styled-components").StyledComponent<"div", any, {
|
24
|
-
variant: HeaderProps['variant'];
|
25
|
-
} & SxProp, never>;
|
26
|
-
/**
|
27
|
-
* Displays the name and description of a `Group`.
|
28
|
-
*/
|
29
|
-
export declare function Header({ variant, title, auxiliaryText, children: _children, ...props }: HeaderProps): JSX.Element;
|
package/lib/ActionList/Header.js
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Header = Header;
|
7
|
-
exports.StyledHeader = void 0;
|
8
|
-
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
10
|
-
|
11
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
12
|
-
|
13
|
-
var _constants = require("../constants");
|
14
|
-
|
15
|
-
var _sx = _interopRequireDefault(require("../sx"));
|
16
|
-
|
17
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
18
|
-
|
19
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
20
|
-
|
21
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
22
|
-
|
23
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
24
|
-
|
25
|
-
const StyledHeader = _styledComponents.default.div.withConfig({
|
26
|
-
displayName: "Header__StyledHeader",
|
27
|
-
componentId: "qmofje-0"
|
28
|
-
})(["{}padding:6px ", ";font-size:", ";font-weight:", ";color:", ";", " ", ""], (0, _constants.get)('space.3'), (0, _constants.get)('fontSizes.0'), (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('colors.fg.muted'), ({
|
29
|
-
variant
|
30
|
-
}) => variant === 'filled' && (0, _styledComponents.css)(["background:", ";margin:", " 0;border-top:1px solid ", ";border-bottom:1px solid ", ";&:first-child{margin-top:0;}"], (0, _constants.get)('colors.canvas.subtle'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.neutral.muted'), (0, _constants.get)('colors.neutral.muted')), _sx.default);
|
31
|
-
/**
|
32
|
-
* Displays the name and description of a `Group`.
|
33
|
-
*/
|
34
|
-
|
35
|
-
|
36
|
-
exports.StyledHeader = StyledHeader;
|
37
|
-
|
38
|
-
function Header({
|
39
|
-
variant = 'subtle',
|
40
|
-
title,
|
41
|
-
auxiliaryText,
|
42
|
-
children: _children,
|
43
|
-
...props
|
44
|
-
}) {
|
45
|
-
return /*#__PURE__*/_react.default.createElement(StyledHeader, _extends({
|
46
|
-
role: "heading",
|
47
|
-
variant: variant
|
48
|
-
}, props), title, auxiliaryText && /*#__PURE__*/_react.default.createElement("span", null, "auxiliaryText"));
|
49
|
-
}
|
50
|
-
|
51
|
-
Header.displayName = "Header";
|
package/lib/ActionList/Item.d.ts
DELETED
@@ -1,92 +0,0 @@
|
|
1
|
-
import { IconProps } from '@primer/octicons-react';
|
2
|
-
import React from 'react';
|
3
|
-
import { SxProp } from '../sx';
|
4
|
-
import { ItemInput } from './List';
|
5
|
-
import { ForwardRefComponent as PolymorphicForwardRefComponent } from '@radix-ui/react-polymorphic';
|
6
|
-
import { AriaRole } from '../utils/types';
|
7
|
-
/**
|
8
|
-
* Contract for props passed to the `Item` component.
|
9
|
-
*/
|
10
|
-
export interface ItemProps extends SxProp {
|
11
|
-
/**
|
12
|
-
* Primary text which names an `Item`.
|
13
|
-
*/
|
14
|
-
text?: string;
|
15
|
-
/**
|
16
|
-
* Secondary text which provides additional information about an `Item`.
|
17
|
-
*/
|
18
|
-
description?: string;
|
19
|
-
/**
|
20
|
-
* Secondary text style variations. Usage is discretionary.
|
21
|
-
*
|
22
|
-
* - `"inline"` - Secondary text is positioned beside primary text.
|
23
|
-
* - `"block"` - Secondary text is positioned below primary text.
|
24
|
-
*/
|
25
|
-
descriptionVariant?: 'inline' | 'block';
|
26
|
-
/**
|
27
|
-
* Icon (or similar) positioned before `Item` text.
|
28
|
-
*/
|
29
|
-
leadingVisual?: React.FunctionComponent<IconProps>;
|
30
|
-
/**
|
31
|
-
* Icon (or similar) positioned after `Item` text.
|
32
|
-
*/
|
33
|
-
trailingIcon?: React.FunctionComponent<IconProps>;
|
34
|
-
/**
|
35
|
-
* Text positioned after `Item` text and optional trailing icon.
|
36
|
-
*/
|
37
|
-
trailingText?: string;
|
38
|
-
/**
|
39
|
-
* Style variations associated with various `Item` types.
|
40
|
-
*
|
41
|
-
* - `"default"` - An action `Item`.
|
42
|
-
* - `"danger"` - A destructive action `Item`.
|
43
|
-
*/
|
44
|
-
variant?: 'default' | 'danger';
|
45
|
-
/**
|
46
|
-
* Whether to display a divider above the `Item` when it does not follow a `Header` or `Divider`.
|
47
|
-
*/
|
48
|
-
showDivider?: boolean;
|
49
|
-
/**
|
50
|
-
* For `Item`s which can be selected, whether the `Item` is currently selected.
|
51
|
-
*/
|
52
|
-
selected?: boolean;
|
53
|
-
/**
|
54
|
-
* For `Item`s which can be selected, whether `multiple` `Item`s or a `single` `Item` can be selected
|
55
|
-
*/
|
56
|
-
selectionVariant?: 'single' | 'multiple';
|
57
|
-
/**
|
58
|
-
* Designates the group that an item belongs to.
|
59
|
-
*/
|
60
|
-
groupId?: string;
|
61
|
-
/**
|
62
|
-
* Items that are disabled can not be clicked, selected, or navigated through.
|
63
|
-
*/
|
64
|
-
disabled?: boolean;
|
65
|
-
/**
|
66
|
-
* Callback that will trigger both on click selection and keyboard selection.
|
67
|
-
*/
|
68
|
-
onAction?: (item: ItemProps, event: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;
|
69
|
-
/**
|
70
|
-
* An id associated with this item. Should be unique between items
|
71
|
-
*/
|
72
|
-
id?: number | string;
|
73
|
-
/**
|
74
|
-
* Node to be included inside the item before the text.
|
75
|
-
*/
|
76
|
-
children?: React.ReactNode;
|
77
|
-
/**
|
78
|
-
* The ARIA role describing the function of `List` component. `option` is a common value.
|
79
|
-
*/
|
80
|
-
role?: AriaRole;
|
81
|
-
/**
|
82
|
-
* An item to pass back in the `onAction` callback, meant as
|
83
|
-
*/
|
84
|
-
item?: ItemInput;
|
85
|
-
}
|
86
|
-
export declare const TextContainer: import("styled-components").StyledComponent<"span", any, {
|
87
|
-
dangerouslySetInnerHtml?: React.DOMAttributes<HTMLDivElement>['dangerouslySetInnerHTML'];
|
88
|
-
}, never>;
|
89
|
-
/**
|
90
|
-
* An actionable or selectable `Item` with an optional icon and description.
|
91
|
-
*/
|
92
|
-
export declare const Item: PolymorphicForwardRefComponent<"div", ItemProps>;
|
package/lib/ActionList/Item.js
DELETED
@@ -1,288 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.Item = exports.TextContainer = void 0;
|
7
|
-
|
8
|
-
var _octiconsReact = require("@primer/octicons-react");
|
9
|
-
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
11
|
-
|
12
|
-
var _constants = require("../constants");
|
13
|
-
|
14
|
-
var _sx = _interopRequireDefault(require("../sx"));
|
15
|
-
|
16
|
-
var _Truncate = _interopRequireDefault(require("../Truncate"));
|
17
|
-
|
18
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
19
|
-
|
20
|
-
var _Header = require("./Header");
|
21
|
-
|
22
|
-
var _Divider = require("./Divider");
|
23
|
-
|
24
|
-
var _ThemeProvider = require("../ThemeProvider");
|
25
|
-
|
26
|
-
var _focusZone = require("../behaviors/focusZone");
|
27
|
-
|
28
|
-
var _ssr = require("@react-aria/ssr");
|
29
|
-
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
|
-
|
32
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
33
|
-
|
34
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
35
|
-
|
36
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
37
|
-
|
38
|
-
/**
|
39
|
-
* These colors are not yet in our default theme. Need to remove this once they are added.
|
40
|
-
*/
|
41
|
-
const customItemThemes = {
|
42
|
-
default: {
|
43
|
-
hover: {
|
44
|
-
light: 'rgba(46, 77, 108, 0.06)',
|
45
|
-
dark: 'rgba(201, 206, 212, 0.12)',
|
46
|
-
dark_dimmed: 'rgba(201, 206, 212, 0.12)'
|
47
|
-
},
|
48
|
-
focus: {
|
49
|
-
light: 'rgba(54, 77, 100, 0.16)',
|
50
|
-
dark: 'rgba(201, 206, 212, 0.24)',
|
51
|
-
dark_dimmed: 'rgba(201, 206, 212, 0.24)'
|
52
|
-
}
|
53
|
-
},
|
54
|
-
danger: {
|
55
|
-
hover: {
|
56
|
-
light: 'rgba(234, 74, 90, 0.08)',
|
57
|
-
dark: 'rgba(248, 81, 73, 0.16)',
|
58
|
-
dark_dimmed: 'rgba(248, 81, 73, 0.16)'
|
59
|
-
},
|
60
|
-
focus: {
|
61
|
-
light: 'rgba(234, 74, 90, 0.14)',
|
62
|
-
dark: 'rgba(248, 81, 73, 0.24)',
|
63
|
-
dark_dimmed: 'rgba(248, 81, 73, 0.24)'
|
64
|
-
}
|
65
|
-
}
|
66
|
-
};
|
67
|
-
/**
|
68
|
-
* Contract for props passed to the `Item` component.
|
69
|
-
*/
|
70
|
-
|
71
|
-
const getItemVariant = (variant = 'default', disabled) => {
|
72
|
-
if (disabled) {
|
73
|
-
return {
|
74
|
-
color: (0, _constants.get)('colors.fg.muted'),
|
75
|
-
iconColor: (0, _constants.get)('colors.fg.muted'),
|
76
|
-
annotationColor: (0, _constants.get)('colors.fg.muted'),
|
77
|
-
hoverCursor: 'default'
|
78
|
-
};
|
79
|
-
}
|
80
|
-
|
81
|
-
switch (variant) {
|
82
|
-
case 'danger':
|
83
|
-
return {
|
84
|
-
color: (0, _constants.get)('colors.danger.fg'),
|
85
|
-
iconColor: (0, _constants.get)('colors.danger.fg'),
|
86
|
-
annotationColor: (0, _constants.get)('colors.fg.muted'),
|
87
|
-
hoverCursor: 'pointer'
|
88
|
-
};
|
89
|
-
|
90
|
-
default:
|
91
|
-
return {
|
92
|
-
color: (0, _constants.get)('colors.fg.default'),
|
93
|
-
iconColor: (0, _constants.get)('colors.fg.muted'),
|
94
|
-
annotationColor: (0, _constants.get)('colors.fg.muted'),
|
95
|
-
hoverCursor: 'pointer'
|
96
|
-
};
|
97
|
-
}
|
98
|
-
};
|
99
|
-
|
100
|
-
const DividedContent = _styledComponents.default.div.withConfig({
|
101
|
-
displayName: "Item__DividedContent",
|
102
|
-
componentId: "jqpvy8-0"
|
103
|
-
})(["display:flex;min-width:0;position:relative;flex-grow:1;"]);
|
104
|
-
|
105
|
-
const MainContent = _styledComponents.default.div.withConfig({
|
106
|
-
displayName: "Item__MainContent",
|
107
|
-
componentId: "jqpvy8-1"
|
108
|
-
})(["align-items:baseline;display:flex;min-width:0;flex-direction:var(--main-content-flex-direction);flex-grow:1;"]);
|
109
|
-
|
110
|
-
const StyledItem = _styledComponents.default.div.withConfig({
|
111
|
-
displayName: "Item__StyledItem",
|
112
|
-
componentId: "jqpvy8-2"
|
113
|
-
})(["padding:6px ", ";display:flex;border-radius:", ";color:", ";transition:background 33.333ms linear;text-decoration:none;@media (hover:hover) and (pointer:fine){:hover{background:var(--item-hover-bg-override,", ");cursor:", ";}}:not(:first-of-type):not(", " + &):not(", " + &){margin-top:", ";", "::before{content:' ';display:block;position:absolute;width:100%;top:-7px;border:0 solid ", ";border-top-width:", ";}}&:hover ", "::before,:hover + * ", "::before{border-color:var(--item-hover-divider-border-color-override,transparent) !important;}&:focus ", "::before,:focus + * ", "::before,&[", "] ", "::before,[", "] + & ", "::before{border-color:transparent !important;}&[", "='", "']{background:", ";}&[", "='", "']{background:", ";}&:focus{background:", ";outline:none;}&:active{background:", ";}", ""], (0, _constants.get)('space.2'), (0, _constants.get)('radii.2'), ({
|
114
|
-
variant,
|
115
|
-
item
|
116
|
-
}) => getItemVariant(variant, item === null || item === void 0 ? void 0 : item.disabled).color, ({
|
117
|
-
hoverBackground
|
118
|
-
}) => hoverBackground, ({
|
119
|
-
variant,
|
120
|
-
item
|
121
|
-
}) => getItemVariant(variant, item === null || item === void 0 ? void 0 : item.disabled).hoverCursor, _Divider.StyledDivider, _Header.StyledHeader, ({
|
122
|
-
showDivider
|
123
|
-
}) => showDivider ? `1px` : '0', DividedContent, (0, _constants.get)('colors.border.muted'), ({
|
124
|
-
showDivider
|
125
|
-
}) => showDivider ? `1px` : '0', DividedContent, DividedContent, DividedContent, DividedContent, _focusZone.isActiveDescendantAttribute, DividedContent, _focusZone.isActiveDescendantAttribute, DividedContent, _focusZone.isActiveDescendantAttribute, _focusZone.activeDescendantActivatedDirectly, ({
|
126
|
-
focusBackground
|
127
|
-
}) => focusBackground, _focusZone.isActiveDescendantAttribute, _focusZone.activeDescendantActivatedIndirectly, ({
|
128
|
-
hoverBackground
|
129
|
-
}) => hoverBackground, ({
|
130
|
-
focusBackground
|
131
|
-
}) => focusBackground, ({
|
132
|
-
focusBackground
|
133
|
-
}) => focusBackground, _sx.default);
|
134
|
-
|
135
|
-
const TextContainer = _styledComponents.default.span.withConfig({
|
136
|
-
displayName: "Item__TextContainer",
|
137
|
-
componentId: "jqpvy8-3"
|
138
|
-
})([""]);
|
139
|
-
|
140
|
-
exports.TextContainer = TextContainer;
|
141
|
-
|
142
|
-
const BaseVisualContainer = _styledComponents.default.div.withConfig({
|
143
|
-
displayName: "Item__BaseVisualContainer",
|
144
|
-
componentId: "jqpvy8-4"
|
145
|
-
})(["height:20px;width:", ";margin-right:", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.2'));
|
146
|
-
|
147
|
-
const ColoredVisualContainer = (0, _styledComponents.default)(BaseVisualContainer).withConfig({
|
148
|
-
displayName: "Item__ColoredVisualContainer",
|
149
|
-
componentId: "jqpvy8-5"
|
150
|
-
})(["svg{fill:", ";font-size:", ";}"], ({
|
151
|
-
variant,
|
152
|
-
disabled
|
153
|
-
}) => getItemVariant(variant, disabled).iconColor, (0, _constants.get)('fontSizes.0'));
|
154
|
-
const LeadingVisualContainer = (0, _styledComponents.default)(ColoredVisualContainer).withConfig({
|
155
|
-
displayName: "Item__LeadingVisualContainer",
|
156
|
-
componentId: "jqpvy8-6"
|
157
|
-
})(["flex-shrink:0;display:flex;flex-direction:column;justify-content:center;"]);
|
158
|
-
const TrailingContent = (0, _styledComponents.default)(ColoredVisualContainer).withConfig({
|
159
|
-
displayName: "Item__TrailingContent",
|
160
|
-
componentId: "jqpvy8-7"
|
161
|
-
})(["color:", "};margin-left:", ";margin-right:0;width:auto;div:nth-child(2){margin-left:", ";}"], ({
|
162
|
-
variant,
|
163
|
-
disabled
|
164
|
-
}) => getItemVariant(variant, disabled).annotationColor, (0, _constants.get)('space.2'), (0, _constants.get)('space.2'));
|
165
|
-
|
166
|
-
const DescriptionContainer = _styledComponents.default.span.withConfig({
|
167
|
-
displayName: "Item__DescriptionContainer",
|
168
|
-
componentId: "jqpvy8-8"
|
169
|
-
})(["color:", ";font-size:", ";line-height:16px;margin-left:var(--description-container-margin-left);min-width:0;flex-grow:1;flex-basis:var(--description-container-flex-basis);"], (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('fontSizes.0'));
|
170
|
-
|
171
|
-
const MultiSelectInput = _styledComponents.default.input.withConfig({
|
172
|
-
displayName: "Item__MultiSelectInput",
|
173
|
-
componentId: "jqpvy8-9"
|
174
|
-
})(["pointer-events:none;"]);
|
175
|
-
/**
|
176
|
-
* An actionable or selectable `Item` with an optional icon and description.
|
177
|
-
*/
|
178
|
-
|
179
|
-
|
180
|
-
const Item = /*#__PURE__*/_react.default.forwardRef((itemProps, ref) => {
|
181
|
-
const {
|
182
|
-
as: Component,
|
183
|
-
text,
|
184
|
-
description,
|
185
|
-
descriptionVariant = 'inline',
|
186
|
-
selected,
|
187
|
-
selectionVariant,
|
188
|
-
leadingVisual: LeadingVisual,
|
189
|
-
trailingIcon: TrailingIcon,
|
190
|
-
trailingText,
|
191
|
-
variant = 'default',
|
192
|
-
showDivider,
|
193
|
-
disabled,
|
194
|
-
onAction,
|
195
|
-
onKeyPress,
|
196
|
-
children,
|
197
|
-
onClick,
|
198
|
-
id,
|
199
|
-
...props
|
200
|
-
} = itemProps;
|
201
|
-
const labelId = (0, _ssr.useSSRSafeId)();
|
202
|
-
const descriptionId = (0, _ssr.useSSRSafeId)();
|
203
|
-
const keyPressHandler = (0, _react.useCallback)(event => {
|
204
|
-
if (disabled) {
|
205
|
-
return;
|
206
|
-
}
|
207
|
-
|
208
|
-
onKeyPress === null || onKeyPress === void 0 ? void 0 : onKeyPress(event);
|
209
|
-
const isCheckbox = event.target instanceof HTMLInputElement && event.target.type === 'checkbox';
|
210
|
-
|
211
|
-
if (isCheckbox && event.key === ' ') {
|
212
|
-
// space key on a checkbox will also trigger a click event. Ignore the space key so we don't get double events
|
213
|
-
return;
|
214
|
-
}
|
215
|
-
|
216
|
-
if (!event.defaultPrevented && [' ', 'Enter'].includes(event.key)) {
|
217
|
-
onAction === null || onAction === void 0 ? void 0 : onAction(itemProps, event);
|
218
|
-
}
|
219
|
-
}, [onAction, disabled, itemProps, onKeyPress]);
|
220
|
-
const clickHandler = (0, _react.useCallback)(event => {
|
221
|
-
if (disabled) {
|
222
|
-
return;
|
223
|
-
}
|
224
|
-
|
225
|
-
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
226
|
-
|
227
|
-
if (!event.defaultPrevented) {
|
228
|
-
onAction === null || onAction === void 0 ? void 0 : onAction(itemProps, event);
|
229
|
-
}
|
230
|
-
}, [onAction, disabled, itemProps, onClick]);
|
231
|
-
const customItemTheme = customItemThemes[variant];
|
232
|
-
const hoverBackground = (0, _ThemeProvider.useColorSchemeVar)(customItemTheme.hover, 'inherit');
|
233
|
-
const focusBackground = (0, _ThemeProvider.useColorSchemeVar)(customItemTheme.focus, 'inherit');
|
234
|
-
const {
|
235
|
-
theme
|
236
|
-
} = (0, _ThemeProvider.useTheme)();
|
237
|
-
return /*#__PURE__*/_react.default.createElement(StyledItem, _extends({
|
238
|
-
ref: ref,
|
239
|
-
as: Component,
|
240
|
-
tabIndex: disabled ? undefined : -1,
|
241
|
-
variant: variant,
|
242
|
-
showDivider: showDivider,
|
243
|
-
"aria-selected": selected,
|
244
|
-
"aria-labelledby": text ? labelId : undefined,
|
245
|
-
"aria-describedby": description ? descriptionId : undefined
|
246
|
-
}, props, {
|
247
|
-
"data-id": id,
|
248
|
-
onKeyPress: keyPressHandler,
|
249
|
-
onClick: clickHandler,
|
250
|
-
hoverBackground: disabled ? 'inherit' : hoverBackground,
|
251
|
-
focusBackground: disabled ? 'inherit' : focusBackground
|
252
|
-
}), !!selected === selected && /*#__PURE__*/_react.default.createElement(BaseVisualContainer, null, selectionVariant === 'multiple' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(MultiSelectInput, {
|
253
|
-
disabled: disabled,
|
254
|
-
tabIndex: -1,
|
255
|
-
type: "checkbox",
|
256
|
-
checked: selected,
|
257
|
-
"aria-label": text,
|
258
|
-
readOnly: true,
|
259
|
-
"aria-readonly": "false"
|
260
|
-
})) : selected && /*#__PURE__*/_react.default.createElement(_octiconsReact.CheckIcon, {
|
261
|
-
fill: theme === null || theme === void 0 ? void 0 : theme.colors.text.primary
|
262
|
-
})), LeadingVisual && /*#__PURE__*/_react.default.createElement(LeadingVisualContainer, {
|
263
|
-
variant: variant,
|
264
|
-
disabled: disabled
|
265
|
-
}, /*#__PURE__*/_react.default.createElement(LeadingVisual, null)), /*#__PURE__*/_react.default.createElement(DividedContent, null, /*#__PURE__*/_react.default.createElement(MainContent, {
|
266
|
-
style: {
|
267
|
-
'--main-content-flex-direction': descriptionVariant === 'inline' ? 'row' : 'column'
|
268
|
-
}
|
269
|
-
}, children, text ? /*#__PURE__*/_react.default.createElement(TextContainer, {
|
270
|
-
id: labelId
|
271
|
-
}, text) : null, description ? /*#__PURE__*/_react.default.createElement(DescriptionContainer, {
|
272
|
-
id: descriptionId,
|
273
|
-
style: {
|
274
|
-
'--description-container-margin-left': descriptionVariant === 'inline' ? (0, _constants.get)('space.2')(theme) : 0,
|
275
|
-
'--description-container-flex-basis': descriptionVariant === 'inline' ? 0 : 'auto'
|
276
|
-
}
|
277
|
-
}, descriptionVariant === 'block' ? description : /*#__PURE__*/_react.default.createElement(_Truncate.default, {
|
278
|
-
title: description,
|
279
|
-
inline: true,
|
280
|
-
maxWidth: "100%"
|
281
|
-
}, description)) : null), TrailingIcon || trailingText ? /*#__PURE__*/_react.default.createElement(TrailingContent, {
|
282
|
-
variant: variant,
|
283
|
-
disabled: disabled
|
284
|
-
}, trailingText, TrailingIcon && /*#__PURE__*/_react.default.createElement(TrailingIcon, null)) : null));
|
285
|
-
});
|
286
|
-
|
287
|
-
exports.Item = Item;
|
288
|
-
Item.displayName = 'ActionList.Item';
|
package/lib/ActionList/List.d.ts
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
import React, { Key } from 'react';
|
2
|
-
import type { AriaRole } from '../utils/types';
|
3
|
-
import { Group, GroupProps } from './Group';
|
4
|
-
import { ItemProps } from './Item';
|
5
|
-
declare type RenderItemFn = (props: ItemProps) => React.ReactElement;
|
6
|
-
export declare type ItemInput = (ItemProps & Omit<React.ComponentPropsWithoutRef<'div'>, keyof ItemProps>) | ((Partial<ItemProps> & {
|
7
|
-
renderItem: RenderItemFn;
|
8
|
-
}) & {
|
9
|
-
key?: Key;
|
10
|
-
});
|
11
|
-
/**
|
12
|
-
* Contract for props passed to the `List` component.
|
13
|
-
*/
|
14
|
-
export interface ListPropsBase {
|
15
|
-
/**
|
16
|
-
* A collection of `Item` props and `Item`-level custom `Item` renderers.
|
17
|
-
*/
|
18
|
-
items: ItemInput[];
|
19
|
-
/**
|
20
|
-
* The ARIA role describing the function of `List` component. `listbox` is a common value.
|
21
|
-
*/
|
22
|
-
role?: AriaRole;
|
23
|
-
/**
|
24
|
-
* id to attach to the base DOM node of the list
|
25
|
-
*/
|
26
|
-
id?: string;
|
27
|
-
/**
|
28
|
-
* A `List`-level custom `Item` renderer. Every `Item` within this `List`
|
29
|
-
* without a `Group`-level or `Item`-level custom `Item` renderer will be
|
30
|
-
* rendered using this function component.
|
31
|
-
*/
|
32
|
-
renderItem?: RenderItemFn;
|
33
|
-
/**
|
34
|
-
* A `List`-level custom `Group` renderer. Every `Group` within this `List`
|
35
|
-
* without a `Group`-level custom `Item` renderer will be rendered using
|
36
|
-
* this function component.
|
37
|
-
*/
|
38
|
-
renderGroup?: typeof Group;
|
39
|
-
/**
|
40
|
-
* Style variations. Usage is discretionary.
|
41
|
-
*
|
42
|
-
* - `"inset"` - `List` children are offset (vertically and horizontally) from `List`’s edges
|
43
|
-
* - `"full"` - `List` children are flush (vertically and horizontally) with `List` edges
|
44
|
-
*/
|
45
|
-
variant?: 'inset' | 'full';
|
46
|
-
/**
|
47
|
-
* For `Item`s which can be selected, whether `multiple` `Item`s or a `single` `Item` can be selected
|
48
|
-
*/
|
49
|
-
selectionVariant?: 'single' | 'multiple';
|
50
|
-
/**
|
51
|
-
* Whether to display a divider above each `Item` in this `List` when it does not follow a `Header` or `Divider`.
|
52
|
-
*/
|
53
|
-
showItemDividers?: boolean;
|
54
|
-
}
|
55
|
-
/**
|
56
|
-
* Contract for props passed to the `List` component, when its `Item`s are collected in `Group`s.
|
57
|
-
*/
|
58
|
-
export interface GroupedListProps extends ListPropsBase {
|
59
|
-
/**
|
60
|
-
* A collection of `Group` props (except `items`), plus a unique group identifier
|
61
|
-
* and `Group`-level custom `Item` or `Group` renderers.
|
62
|
-
*/
|
63
|
-
groupMetadata: ((Omit<GroupProps, 'items'> | Omit<Partial<GroupProps> & {
|
64
|
-
renderItem?: RenderItemFn;
|
65
|
-
renderGroup?: typeof Group;
|
66
|
-
}, 'items'>) & {
|
67
|
-
groupId: string;
|
68
|
-
})[];
|
69
|
-
/**
|
70
|
-
* A collection of `Item` props, plus associated group identifiers
|
71
|
-
* and `Item`-level custom `Item` renderers.
|
72
|
-
*/
|
73
|
-
items: ((ItemProps | (Partial<ItemProps> & {
|
74
|
-
renderItem: RenderItemFn;
|
75
|
-
})) & {
|
76
|
-
groupId: string;
|
77
|
-
})[];
|
78
|
-
}
|
79
|
-
/**
|
80
|
-
* Contract for props passed to the `List` component.
|
81
|
-
*/
|
82
|
-
export declare type ListProps = ListPropsBase | GroupedListProps;
|
83
|
-
/**
|
84
|
-
* Lists `Item`s, either grouped or ungrouped, with a `Divider` between each `Group`.
|
85
|
-
*/
|
86
|
-
export declare const List: React.ForwardRefExoticComponent<ListProps & React.RefAttributes<HTMLDivElement>>;
|
87
|
-
export {};
|