@primer/components 31.2.1-rc.f73a0f8c → 32.0.1-rc.44e3df9b
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/.github/workflows/ci.yml +2 -5
- package/.github/workflows/release.yml +0 -1
- package/.github/workflows/release_canary.yml +0 -1
- package/CHANGELOG.md +74 -4
- package/dist/browser.esm.js +299 -361
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +294 -356
- package/dist/browser.umd.js.map +1 -1
- package/docs/content/ActionList2.mdx +8 -7
- package/docs/content/Breadcrumbs.md +11 -16
- package/docs/content/Buttons.md +7 -17
- package/docs/content/CircleBadge.md +0 -10
- package/docs/content/CounterLabel.md +0 -10
- package/docs/content/Dialog.md +15 -18
- package/docs/content/Dialog2.mdx +1 -0
- package/docs/content/Dropdown.md +11 -18
- package/docs/content/FilterList.md +10 -17
- package/docs/content/FilteredSearch.md +4 -11
- package/docs/content/Flash.md +5 -14
- package/docs/content/FormGroup.md +9 -17
- package/docs/content/Header.md +14 -16
- package/docs/content/Label.md +32 -25
- package/docs/content/LabelGroup.md +4 -14
- package/docs/content/Link.md +8 -17
- package/docs/content/Overlay.mdx +1 -10
- package/docs/content/Pagehead.md +4 -13
- package/docs/content/Pagination.md +10 -19
- package/docs/content/Popover.md +11 -19
- package/docs/content/SelectMenu.md +50 -114
- package/docs/content/SideNav.md +15 -23
- package/docs/content/StateLabel.md +5 -14
- package/docs/content/StyledOcticon.md +7 -16
- package/docs/content/SubNav.md +19 -21
- package/docs/content/TabNav.md +10 -18
- package/docs/content/Timeline.md +34 -24
- package/docs/content/Tooltip.md +8 -17
- package/docs/content/Truncate.md +7 -16
- package/docs/content/UnderlineNav.md +13 -21
- package/docs/package-lock.json +269 -158
- package/docs/package.json +1 -1
- package/lib/ActionList/index.js +23 -12
- package/lib/ActionList2/Group.d.ts +28 -2
- package/lib/ActionList2/Group.js +55 -6
- package/lib/ActionList2/List.d.ts +1 -1
- package/lib/ActionList2/index.js +41 -23
- package/lib/AnchoredOverlay/index.js +12 -4
- package/lib/Autocomplete/Autocomplete.d.ts +3 -3
- package/lib/Autocomplete/AutocompleteInput.d.ts +3 -3
- package/lib/Autocomplete/index.js +14 -7
- package/lib/Breadcrumbs.d.ts +8 -7
- package/lib/Breadcrumbs.js +7 -12
- package/lib/Button/Button.d.ts +2 -3
- package/lib/Button/Button.js +2 -6
- package/lib/Button/ButtonBase.d.ts +5 -8
- package/lib/Button/ButtonBase.js +1 -5
- package/lib/Button/ButtonClose.d.ts +3 -46
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonDanger.d.ts +2 -3
- package/lib/Button/ButtonDanger.js +2 -6
- package/lib/Button/ButtonInvisible.d.ts +2 -3
- package/lib/Button/ButtonInvisible.js +2 -6
- package/lib/Button/ButtonOutline.d.ts +2 -3
- package/lib/Button/ButtonOutline.js +2 -6
- package/lib/Button/ButtonPrimary.d.ts +2 -3
- package/lib/Button/ButtonPrimary.js +2 -6
- package/lib/Button/ButtonTableList.d.ts +1 -2
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Button/index.js +70 -21
- package/lib/CircleBadge.d.ts +4 -5
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleOcticon.d.ts +1 -1
- package/lib/CounterLabel.d.ts +1 -2
- package/lib/CounterLabel.js +1 -1
- package/lib/Dialog/Dialog.d.ts +5 -9
- package/lib/Dialog/Dialog.js +17 -11
- package/lib/Dialog.d.ts +4 -5
- package/lib/Dialog.js +1 -1
- package/lib/Dropdown.d.ts +10 -99
- package/lib/Dropdown.js +3 -3
- package/lib/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib/DropdownMenu/DropdownButton.js +3 -1
- package/lib/DropdownMenu/index.js +20 -6
- package/lib/DropdownStyles.js +26 -18
- package/lib/FilterList.d.ts +264 -303
- package/lib/FilterList.js +2 -6
- package/lib/FilteredActionList/index.js +12 -4
- package/lib/FilteredSearch.d.ts +1 -2
- package/lib/FilteredSearch.js +1 -1
- package/lib/Flash.d.ts +1 -2
- package/lib/Flash.js +1 -1
- package/lib/FormGroup.d.ts +4 -5
- package/lib/FormGroup.js +2 -2
- package/lib/Header.d.ts +6 -7
- package/lib/Header.js +4 -4
- package/lib/Label.d.ts +1 -2
- package/lib/Label.js +2 -3
- package/lib/LabelGroup.d.ts +1 -2
- package/lib/LabelGroup.js +1 -1
- package/lib/Link.d.ts +1 -2
- package/lib/Link.js +1 -1
- package/lib/NewButton/button.js +34 -42
- package/lib/NewButton/index.js +12 -5
- package/lib/NewButton/types.js +1 -2
- package/lib/Overlay.d.ts +11 -10
- package/lib/Overlay.js +3 -4
- package/lib/Pagehead.d.ts +1 -2
- package/lib/Pagehead.js +1 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Pagination/index.js +12 -6
- package/lib/Popover.d.ts +4 -5
- package/lib/Popover.js +4 -5
- package/lib/Portal/index.js +16 -5
- package/lib/Position.d.ts +4 -4
- package/lib/SelectMenu/SelectMenu.d.ts +21 -189
- package/lib/SelectMenu/SelectMenu.js +1 -3
- package/lib/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuHeader.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +3 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuModal.js +1 -1
- package/lib/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/SelectMenu/hooks/useKeyboardNav.js +96 -80
- package/lib/SelectMenu/index.js +14 -7
- package/lib/SelectPanel/index.js +12 -4
- package/lib/SideNav.d.ts +11 -8
- package/lib/SideNav.js +8 -15
- package/lib/StateLabel.d.ts +1 -2
- package/lib/StateLabel.js +6 -5
- package/lib/StyledOcticon.d.ts +1 -2
- package/lib/StyledOcticon.js +1 -3
- package/lib/SubNav.d.ts +5 -11
- package/lib/SubNav.js +7 -12
- package/lib/TabNav.d.ts +3 -4
- package/lib/TabNav.js +2 -2
- package/lib/TextInputWithTokens.d.ts +3 -3
- package/lib/Timeline.d.ts +19 -393
- package/lib/Timeline.js +16 -13
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/index.js +30 -11
- package/lib/Tooltip.d.ts +1 -2
- package/lib/Tooltip.js +1 -1
- package/lib/Truncate.d.ts +1 -2
- package/lib/Truncate.js +1 -3
- package/lib/UnderlineNav.d.ts +2 -3
- package/lib/UnderlineNav.js +2 -2
- package/lib/__tests__/Breadcrumbs.test.js +4 -1
- package/lib/__tests__/Breadcrumbs.types.test.d.ts +3 -0
- package/lib/__tests__/Breadcrumbs.types.test.js +25 -0
- package/lib/__tests__/Button.test.js +6 -2
- package/lib/__tests__/CircleBadge.types.test.d.ts +3 -0
- package/lib/__tests__/CircleBadge.types.test.js +28 -0
- package/lib/__tests__/CounterLabel.types.test.d.ts +3 -0
- package/lib/__tests__/CounterLabel.types.test.js +28 -0
- package/lib/__tests__/Dialog.types.test.d.ts +3 -0
- package/lib/__tests__/Dialog.types.test.js +28 -0
- package/lib/__tests__/Dialog2.types.test.d.ts +3 -0
- package/lib/__tests__/Dialog2.types.test.js +31 -0
- package/lib/__tests__/Dropdown.types.test.d.ts +3 -0
- package/lib/__tests__/Dropdown.types.test.js +31 -0
- package/lib/__tests__/FilterList.types.test.d.ts +3 -0
- package/lib/__tests__/FilterList.types.test.js +27 -0
- package/lib/__tests__/FilteredSearch.types.test.d.ts +3 -0
- package/lib/__tests__/FilteredSearch.types.test.js +28 -0
- package/lib/__tests__/Flash.types.test.d.ts +3 -0
- package/lib/__tests__/Flash.types.test.js +28 -0
- package/lib/__tests__/FormGroup.types.test.d.ts +3 -0
- package/lib/__tests__/FormGroup.types.test.js +28 -0
- package/lib/__tests__/Header.types.test.d.ts +3 -0
- package/lib/__tests__/Header.types.test.js +29 -0
- package/lib/__tests__/KeyPaths.types.test.js +8 -5
- package/lib/__tests__/Label.types.test.d.ts +3 -0
- package/lib/__tests__/Label.types.test.js +28 -0
- package/lib/__tests__/LabelGroup.types.test.d.ts +3 -0
- package/lib/__tests__/LabelGroup.types.test.js +28 -0
- package/lib/__tests__/Link.test.js +11 -5
- package/lib/__tests__/Link.types.test.d.ts +3 -0
- package/lib/__tests__/Link.types.test.js +28 -0
- package/lib/__tests__/Merge.types.test.js +19 -13
- package/lib/__tests__/Overlay.types.test.d.ts +3 -0
- package/lib/__tests__/Overlay.types.test.js +35 -0
- package/lib/__tests__/Pagehead.types.test.d.ts +3 -0
- package/lib/__tests__/Pagehead.types.test.js +28 -0
- package/lib/__tests__/Pagination.types.test.d.ts +3 -0
- package/lib/__tests__/Pagination.types.test.js +33 -0
- package/lib/__tests__/Popover.types.test.d.ts +3 -0
- package/lib/__tests__/Popover.types.test.js +27 -0
- package/lib/__tests__/SelectMenu.types.test.d.ts +3 -0
- package/lib/__tests__/SelectMenu.types.test.js +47 -0
- package/lib/__tests__/SideNav.types.test.d.ts +3 -0
- package/lib/__tests__/SideNav.types.test.js +28 -0
- package/lib/__tests__/StateLabel.types.test.d.ts +3 -0
- package/lib/__tests__/StateLabel.types.test.js +28 -0
- package/lib/__tests__/StyledOcticon.types.test.d.ts +3 -0
- package/lib/__tests__/StyledOcticon.types.test.js +32 -0
- package/lib/__tests__/SubNav.types.test.d.ts +3 -0
- package/lib/__tests__/SubNav.types.test.js +27 -0
- package/lib/__tests__/TabNav.types.test.d.ts +3 -0
- package/lib/__tests__/TabNav.types.test.js +25 -0
- package/lib/__tests__/Timeline.types.test.d.ts +3 -0
- package/lib/__tests__/Timeline.types.test.js +31 -0
- package/lib/__tests__/Tooltip.types.test.d.ts +3 -0
- package/lib/__tests__/Tooltip.types.test.js +28 -0
- package/lib/__tests__/Truncate.types.test.d.ts +3 -0
- package/lib/__tests__/Truncate.types.test.js +31 -0
- package/lib/__tests__/UnderlineNav.types.test.d.ts +3 -0
- package/lib/__tests__/UnderlineNav.types.test.js +25 -0
- package/lib/__tests__/behaviors/anchoredPosition.test.js +376 -229
- package/lib/__tests__/behaviors/scrollIntoViewingArea.test.js +216 -145
- package/lib/__tests__/filterObject.test.js +27 -48
- package/lib/__tests__/theme.test.js +34 -33
- package/lib/__tests__/themeGet.test.js +23 -12
- package/lib/behaviors/anchoredPosition.js +234 -205
- package/lib/behaviors/focusTrap.js +157 -121
- package/lib/behaviors/focusZone.js +509 -434
- package/lib/behaviors/scrollIntoViewingArea.js +35 -18
- package/lib/constants.js +43 -39
- package/lib/drafts.js +30 -20
- package/lib/hooks/index.js +60 -16
- package/lib/hooks/useAnchoredPosition.js +40 -32
- package/lib/hooks/useCombinedRefs.js +36 -32
- package/lib/hooks/useDialog.js +96 -72
- package/lib/hooks/useFocusTrap.js +60 -43
- package/lib/hooks/useFocusZone.js +50 -54
- package/lib/hooks/useOnEscapePress.js +36 -25
- package/lib/hooks/useOpenAndCloseFocus.js +34 -22
- package/lib/hooks/useProvidedRefOrCreate.js +14 -10
- package/lib/hooks/useProvidedStateOrCreate.js +16 -13
- package/lib/hooks/useRenderForcingRef.js +17 -13
- package/lib/hooks/useResizeObserver.js +18 -15
- package/lib/hooks/useSafeTimeout.js +30 -22
- package/lib/hooks/useScrollFlash.js +23 -16
- package/lib/index.js +644 -163
- package/lib/polyfills/eventListenerSignal.js +45 -37
- package/lib/stories/ActionList2.stories.js +4 -3
- package/lib/stories/ActionMenu.stories.js +1 -3
- package/lib/stories/ConfirmationDialog.stories.js +16 -8
- package/lib/stories/Dialog.stories.js +6 -2
- package/lib/stories/useFocusTrap.stories.js +6 -2
- package/lib/stories/useFocusZone.stories.js +13 -5
- package/lib/sx.js +22 -10
- package/lib/theme-preval.js +3169 -64
- package/lib/theme.js +12 -3
- package/lib/utils/iterateFocusableElements.js +85 -63
- package/lib/utils/testing.d.ts +1 -1
- package/lib/utils/theme.js +47 -33
- package/lib/utils/types/AriaRole.js +1 -2
- package/lib/utils/types/ComponentProps.js +1 -2
- package/lib/utils/types/Flatten.js +1 -2
- package/lib/utils/types/KeyPaths.js +1 -2
- package/lib/utils/types/MandateProps.js +1 -16
- package/lib/utils/types/Merge.js +1 -2
- package/lib/utils/types/index.js +69 -16
- package/lib/utils/uniqueId.js +8 -5
- package/lib/utils/use-force-update.js +14 -8
- package/lib/utils/useIsomorphicLayoutEffect.js +11 -8
- package/lib/utils/userAgent.js +12 -8
- package/lib-esm/ActionList2/Group.d.ts +28 -2
- package/lib-esm/ActionList2/Group.js +52 -5
- package/lib-esm/ActionList2/List.d.ts +1 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +3 -3
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +3 -3
- package/lib-esm/Breadcrumbs.d.ts +8 -7
- package/lib-esm/Breadcrumbs.js +8 -13
- package/lib-esm/Button/Button.d.ts +2 -3
- package/lib-esm/Button/Button.js +2 -2
- package/lib-esm/Button/ButtonBase.d.ts +5 -8
- package/lib-esm/Button/ButtonBase.js +1 -3
- package/lib-esm/Button/ButtonClose.d.ts +3 -46
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +2 -3
- package/lib-esm/Button/ButtonDanger.js +2 -2
- package/lib-esm/Button/ButtonInvisible.d.ts +2 -3
- package/lib-esm/Button/ButtonInvisible.js +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +2 -3
- package/lib-esm/Button/ButtonOutline.js +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +2 -3
- package/lib-esm/Button/ButtonPrimary.js +2 -2
- package/lib-esm/Button/ButtonTableList.d.ts +1 -2
- package/lib-esm/Button/ButtonTableList.js +2 -2
- package/lib-esm/CircleBadge.d.ts +4 -5
- package/lib-esm/CircleBadge.js +2 -2
- package/lib-esm/CircleOcticon.d.ts +1 -1
- package/lib-esm/CounterLabel.d.ts +1 -2
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/Dialog.d.ts +5 -9
- package/lib-esm/Dialog/Dialog.js +12 -12
- package/lib-esm/Dialog.d.ts +4 -5
- package/lib-esm/Dialog.js +2 -2
- package/lib-esm/Dropdown.d.ts +10 -99
- package/lib-esm/Dropdown.js +4 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib-esm/DropdownMenu/DropdownButton.js +3 -1
- package/lib-esm/FilterList.d.ts +264 -303
- package/lib-esm/FilterList.js +3 -7
- package/lib-esm/FilteredSearch.d.ts +1 -2
- package/lib-esm/FilteredSearch.js +2 -2
- package/lib-esm/Flash.d.ts +1 -2
- package/lib-esm/Flash.js +2 -2
- package/lib-esm/FormGroup.d.ts +4 -5
- package/lib-esm/FormGroup.js +3 -3
- package/lib-esm/Header.d.ts +6 -7
- package/lib-esm/Header.js +5 -5
- package/lib-esm/Label.d.ts +1 -2
- package/lib-esm/Label.js +3 -4
- package/lib-esm/LabelGroup.d.ts +1 -2
- package/lib-esm/LabelGroup.js +2 -2
- package/lib-esm/Link.d.ts +1 -2
- package/lib-esm/Link.js +2 -2
- package/lib-esm/NewButton/button.js +31 -42
- package/lib-esm/Overlay.d.ts +11 -10
- package/lib-esm/Overlay.js +2 -3
- package/lib-esm/Pagehead.d.ts +1 -2
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/lib-esm/Popover.d.ts +4 -5
- package/lib-esm/Popover.js +4 -5
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +21 -189
- package/lib-esm/SelectMenu/SelectMenu.js +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFilter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuList.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +3 -2
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTab.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.js +2 -2
- package/lib-esm/SideNav.d.ts +11 -8
- package/lib-esm/SideNav.js +8 -16
- package/lib-esm/StateLabel.d.ts +1 -2
- package/lib-esm/StateLabel.js +7 -6
- package/lib-esm/StyledOcticon.d.ts +1 -2
- package/lib-esm/StyledOcticon.js +1 -2
- package/lib-esm/SubNav.d.ts +5 -11
- package/lib-esm/SubNav.js +8 -13
- package/lib-esm/TabNav.d.ts +3 -4
- package/lib-esm/TabNav.js +3 -3
- package/lib-esm/TextInputWithTokens.d.ts +3 -3
- package/lib-esm/Timeline.d.ts +19 -393
- package/lib-esm/Timeline.js +12 -13
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Tooltip.d.ts +1 -2
- package/lib-esm/Tooltip.js +2 -2
- package/lib-esm/Truncate.d.ts +1 -2
- package/lib-esm/Truncate.js +1 -2
- package/lib-esm/UnderlineNav.d.ts +2 -3
- package/lib-esm/UnderlineNav.js +3 -3
- package/lib-esm/__tests__/Breadcrumbs.test.js +4 -1
- package/lib-esm/__tests__/Breadcrumbs.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Breadcrumbs.types.test.js +12 -0
- package/lib-esm/__tests__/Button.test.js +6 -2
- package/lib-esm/__tests__/CircleBadge.types.test.d.ts +3 -0
- package/lib-esm/__tests__/CircleBadge.types.test.js +13 -0
- package/lib-esm/__tests__/CounterLabel.types.test.d.ts +3 -0
- package/lib-esm/__tests__/CounterLabel.types.test.js +13 -0
- package/lib-esm/__tests__/Dialog.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Dialog.types.test.js +13 -0
- package/lib-esm/__tests__/Dialog2.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Dialog2.types.test.js +16 -0
- package/lib-esm/__tests__/Dropdown.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Dropdown.types.test.js +17 -0
- package/lib-esm/__tests__/FilterList.types.test.d.ts +3 -0
- package/lib-esm/__tests__/FilterList.types.test.js +13 -0
- package/lib-esm/__tests__/FilteredSearch.types.test.d.ts +3 -0
- package/lib-esm/__tests__/FilteredSearch.types.test.js +13 -0
- package/lib-esm/__tests__/Flash.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Flash.types.test.js +13 -0
- package/lib-esm/__tests__/FormGroup.types.test.d.ts +3 -0
- package/lib-esm/__tests__/FormGroup.types.test.js +13 -0
- package/lib-esm/__tests__/Header.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Header.types.test.js +15 -0
- package/lib-esm/__tests__/Label.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Label.types.test.js +13 -0
- package/lib-esm/__tests__/LabelGroup.types.test.d.ts +3 -0
- package/lib-esm/__tests__/LabelGroup.types.test.js +13 -0
- package/lib-esm/__tests__/Link.test.js +11 -5
- package/lib-esm/__tests__/Link.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Link.types.test.js +13 -0
- package/lib-esm/__tests__/Overlay.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Overlay.types.test.js +20 -0
- package/lib-esm/__tests__/Pagehead.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Pagehead.types.test.js +13 -0
- package/lib-esm/__tests__/Pagination.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Pagination.types.test.js +18 -0
- package/lib-esm/__tests__/Popover.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Popover.types.test.js +13 -0
- package/lib-esm/__tests__/SelectMenu.types.test.d.ts +3 -0
- package/lib-esm/__tests__/SelectMenu.types.test.js +33 -0
- package/lib-esm/__tests__/SideNav.types.test.d.ts +3 -0
- package/lib-esm/__tests__/SideNav.types.test.js +13 -0
- package/lib-esm/__tests__/StateLabel.types.test.d.ts +3 -0
- package/lib-esm/__tests__/StateLabel.types.test.js +13 -0
- package/lib-esm/__tests__/StyledOcticon.types.test.d.ts +3 -0
- package/lib-esm/__tests__/StyledOcticon.types.test.js +16 -0
- package/lib-esm/__tests__/SubNav.types.test.d.ts +3 -0
- package/lib-esm/__tests__/SubNav.types.test.js +14 -0
- package/lib-esm/__tests__/TabNav.types.test.d.ts +3 -0
- package/lib-esm/__tests__/TabNav.types.test.js +12 -0
- package/lib-esm/__tests__/Timeline.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Timeline.types.test.js +18 -0
- package/lib-esm/__tests__/Tooltip.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Tooltip.types.test.js +13 -0
- package/lib-esm/__tests__/Truncate.types.test.d.ts +3 -0
- package/lib-esm/__tests__/Truncate.types.test.js +16 -0
- package/lib-esm/__tests__/UnderlineNav.types.test.d.ts +3 -0
- package/lib-esm/__tests__/UnderlineNav.types.test.js +12 -0
- package/lib-esm/stories/ActionList2.stories.js +4 -3
- package/lib-esm/stories/ActionMenu.stories.js +1 -3
- package/lib-esm/stories/ConfirmationDialog.stories.js +16 -8
- package/lib-esm/stories/Dialog.stories.js +6 -2
- package/lib-esm/stories/useFocusTrap.stories.js +6 -2
- package/lib-esm/stories/useFocusZone.stories.js +13 -5
- package/lib-esm/theme-preval.js +446 -0
- package/lib-esm/utils/testing.d.ts +1 -1
- package/package-lock.json +16 -16
- package/package.json +4 -5
- package/script/build +1 -1
- package/src/ActionList2/Group.tsx +76 -7
- package/src/ActionList2/List.tsx +1 -1
- package/src/Breadcrumbs.tsx +11 -11
- package/src/Button/Button.tsx +2 -3
- package/src/Button/ButtonBase.tsx +2 -6
- package/src/Button/ButtonClose.tsx +2 -6
- package/src/Button/ButtonDanger.tsx +2 -3
- package/src/Button/ButtonInvisible.tsx +2 -3
- package/src/Button/ButtonOutline.tsx +2 -3
- package/src/Button/ButtonPrimary.tsx +2 -3
- package/src/Button/ButtonTableList.tsx +2 -15
- package/src/CircleBadge.tsx +2 -4
- package/src/CounterLabel.tsx +2 -4
- package/src/Dialog/Dialog.tsx +22 -11
- package/src/Dialog.tsx +2 -6
- package/src/Dropdown.tsx +3 -7
- package/src/DropdownMenu/DropdownButton.tsx +1 -1
- package/src/FilterList.tsx +5 -11
- package/src/FilteredSearch.tsx +2 -3
- package/src/Flash.tsx +2 -4
- package/src/FormGroup.tsx +3 -6
- package/src/Header.tsx +4 -14
- package/src/Label.tsx +2 -5
- package/src/LabelGroup.tsx +2 -3
- package/src/Link.tsx +2 -6
- package/src/NewButton/button.tsx +82 -78
- package/src/Overlay.tsx +13 -11
- package/src/Pagehead.tsx +2 -3
- package/src/Pagination/Pagination.tsx +3 -5
- package/src/Popover.tsx +3 -14
- package/src/SelectMenu/SelectMenu.tsx +1 -3
- package/src/SelectMenu/SelectMenuDivider.tsx +2 -3
- package/src/SelectMenu/SelectMenuFilter.tsx +2 -3
- package/src/SelectMenu/SelectMenuFooter.tsx +2 -3
- package/src/SelectMenu/SelectMenuHeader.tsx +2 -4
- package/src/SelectMenu/SelectMenuItem.tsx +2 -3
- package/src/SelectMenu/SelectMenuList.tsx +2 -3
- package/src/SelectMenu/SelectMenuLoadingAnimation.tsx +4 -3
- package/src/SelectMenu/SelectMenuModal.tsx +2 -4
- package/src/SelectMenu/SelectMenuTab.tsx +2 -3
- package/src/SelectMenu/SelectMenuTabPanel.tsx +2 -3
- package/src/SelectMenu/SelectMenuTabs.tsx +2 -3
- package/src/SideNav.tsx +11 -13
- package/src/StateLabel.tsx +3 -5
- package/src/StyledOcticon.tsx +1 -3
- package/src/SubNav.tsx +8 -13
- package/src/TabNav.tsx +3 -7
- package/src/Timeline.tsx +11 -12
- package/src/Tooltip.tsx +3 -3
- package/src/Truncate.tsx +0 -5
- package/src/UnderlineNav.tsx +3 -6
- package/src/__tests__/Breadcrumbs.test.tsx +1 -1
- package/src/__tests__/Breadcrumbs.types.test.tsx +22 -0
- package/src/__tests__/Button.test.tsx +2 -2
- package/src/__tests__/CircleBadge.types.test.tsx +11 -0
- package/src/__tests__/CounterLabel.types.test.tsx +11 -0
- package/src/__tests__/Dialog.types.test.tsx +11 -0
- package/src/__tests__/Dialog2.types.test.tsx +11 -0
- package/src/__tests__/Dropdown.types.test.tsx +21 -0
- package/src/__tests__/FilterList.types.test.tsx +17 -0
- package/src/__tests__/FilteredSearch.types.test.tsx +11 -0
- package/src/__tests__/Flash.types.test.tsx +11 -0
- package/src/__tests__/FormGroup.types.test.tsx +11 -0
- package/src/__tests__/Header.types.test.tsx +19 -0
- package/src/__tests__/Label.types.test.tsx +11 -0
- package/src/__tests__/LabelGroup.types.test.tsx +11 -0
- package/src/__tests__/Link.test.tsx +5 -5
- package/src/__tests__/Link.types.test.tsx +11 -0
- package/src/__tests__/Overlay.types.test.tsx +18 -0
- package/src/__tests__/Pagehead.types.test.tsx +11 -0
- package/src/__tests__/Pagination.types.test.tsx +11 -0
- package/src/__tests__/Popover.types.test.tsx +17 -0
- package/src/__tests__/SelectMenu.types.test.tsx +37 -0
- package/src/__tests__/SideNav.types.test.tsx +11 -0
- package/src/__tests__/StateLabel.types.test.tsx +11 -0
- package/src/__tests__/StyledOcticon.types.test.tsx +12 -0
- package/src/__tests__/SubNav.types.test.tsx +25 -0
- package/src/__tests__/TabNav.types.test.tsx +22 -0
- package/src/__tests__/Timeline.types.test.tsx +31 -0
- package/src/__tests__/Tooltip.types.test.tsx +11 -0
- package/src/__tests__/Truncate.types.test.tsx +11 -0
- package/src/__tests__/UnderlineNav.types.test.tsx +22 -0
- package/src/__tests__/__snapshots__/Label.test.tsx.snap +3 -4
- package/src/__tests__/__snapshots__/Link.test.tsx.snap +1 -2
- package/src/__tests__/__snapshots__/NewButton.test.tsx.snap +5 -0
- package/src/stories/ActionList2.stories.tsx +3 -3
- package/src/stories/ActionMenu.stories.tsx +1 -4
- package/src/stories/ConfirmationDialog.stories.tsx +4 -4
- package/src/stories/Dialog.stories.tsx +2 -2
- package/src/stories/useFocusTrap.stories.tsx +2 -2
- package/src/stories/useFocusZone.stories.tsx +4 -4
- package/stats.html +1 -1
- package/tsconfig.build.json +2 -2
- package/tsconfig.json +17 -4
- package/lib/ActionList/Divider.jsx +0 -29
- package/lib/ActionList/Group.jsx +0 -23
- package/lib/ActionList/Header.jsx +0 -66
- package/lib/ActionList/Item.jsx +0 -288
- package/lib/ActionList/List.jsx +0 -138
- package/lib/ActionList2/Description.jsx +0 -29
- package/lib/ActionList2/Divider.jsx +0 -22
- package/lib/ActionList2/Group.jsx +0 -25
- package/lib/ActionList2/Header.jsx +0 -36
- package/lib/ActionList2/Item.jsx +0 -174
- package/lib/ActionList2/LinkItem.jsx +0 -28
- package/lib/ActionList2/List.jsx +0 -41
- package/lib/ActionList2/Selection.jsx +0 -50
- package/lib/ActionList2/Visuals.jsx +0 -48
- package/lib/ActionMenu.jsx +0 -73
- package/lib/AnchoredOverlay/AnchoredOverlay.jsx +0 -100
- package/lib/Autocomplete/Autocomplete.jsx +0 -100
- package/lib/Autocomplete/AutocompleteContext.jsx +0 -5
- package/lib/Autocomplete/AutocompleteInput.jsx +0 -113
- package/lib/Autocomplete/AutocompleteMenu.jsx +0 -190
- package/lib/Autocomplete/AutocompleteOverlay.jsx +0 -55
- package/lib/Avatar.jsx +0 -34
- package/lib/AvatarPair.jsx +0 -29
- package/lib/AvatarStack.jsx +0 -151
- package/lib/BaseStyles.jsx +0 -65
- package/lib/BorderBox.jsx +0 -18
- package/lib/Box.jsx +0 -10
- package/lib/BranchName.jsx +0 -20
- package/lib/Breadcrumbs.jsx +0 -74
- package/lib/Button/Button.jsx +0 -60
- package/lib/Button/ButtonBase.jsx +0 -36
- package/lib/Button/ButtonClose.jsx +0 -55
- package/lib/Button/ButtonDanger.jsx +0 -63
- package/lib/Button/ButtonGroup.jsx +0 -55
- package/lib/Button/ButtonInvisible.jsx +0 -52
- package/lib/Button/ButtonOutline.jsx +0 -63
- package/lib/Button/ButtonPrimary.jsx +0 -62
- package/lib/Button/ButtonStyles.jsx +0 -37
- package/lib/Button/ButtonTableList.jsx +0 -49
- package/lib/Caret.jsx +0 -93
- package/lib/CircleBadge.jsx +0 -43
- package/lib/CircleOcticon.jsx +0 -21
- package/lib/CounterLabel.jsx +0 -44
- package/lib/Details.jsx +0 -21
- package/lib/Dialog/ConfirmationDialog.jsx +0 -146
- package/lib/Dialog/Dialog.jsx +0 -273
- package/lib/Dialog.jsx +0 -131
- package/lib/Dropdown.jsx +0 -134
- package/lib/DropdownMenu/DropdownButton.jsx +0 -14
- package/lib/DropdownMenu/DropdownMenu.jsx +0 -70
- package/lib/FilterList.jsx +0 -63
- package/lib/FilteredActionList/FilteredActionList.jsx +0 -100
- package/lib/FilteredSearch.jsx +0 -29
- package/lib/Flash.jsx +0 -70
- package/lib/Flex.jsx +0 -15
- package/lib/FormGroup.jsx +0 -25
- package/lib/Grid.jsx +0 -15
- package/lib/Header.jsx +0 -90
- package/lib/Heading.jsx +0 -21
- package/lib/Label.jsx +0 -84
- package/lib/LabelGroup.jsx +0 -19
- package/lib/Link.jsx +0 -38
- package/lib/NewButton/button-counter.jsx +0 -14
- package/lib/NewButton/button.jsx +0 -278
- package/lib/Overlay.jsx +0 -156
- package/lib/Pagehead.jsx +0 -18
- package/lib/Pagination/Pagination.jsx +0 -163
- package/lib/Pagination/model.jsx +0 -174
- package/lib/PointerBox.jsx +0 -25
- package/lib/Popover.jsx +0 -210
- package/lib/Portal/Portal.jsx +0 -79
- package/lib/Position.jsx +0 -46
- package/lib/ProgressBar.jsx +0 -39
- package/lib/SelectMenu/SelectMenu.jsx +0 -114
- package/lib/SelectMenu/SelectMenuContext.jsx +0 -5
- package/lib/SelectMenu/SelectMenuDivider.jsx +0 -43
- package/lib/SelectMenu/SelectMenuFilter.jsx +0 -59
- package/lib/SelectMenu/SelectMenuFooter.jsx +0 -46
- package/lib/SelectMenu/SelectMenuHeader.jsx +0 -44
- package/lib/SelectMenu/SelectMenuItem.jsx +0 -143
- package/lib/SelectMenu/SelectMenuList.jsx +0 -60
- package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +0 -21
- package/lib/SelectMenu/SelectMenuModal.jsx +0 -119
- package/lib/SelectMenu/SelectMenuTab.jsx +0 -93
- package/lib/SelectMenu/SelectMenuTabPanel.jsx +0 -43
- package/lib/SelectMenu/SelectMenuTabs.jsx +0 -58
- package/lib/SelectPanel/SelectPanel.jsx +0 -105
- package/lib/SideNav.jsx +0 -177
- package/lib/Spinner.jsx +0 -35
- package/lib/StateLabel.jsx +0 -94
- package/lib/StyledOcticon.jsx +0 -20
- package/lib/SubNav.jsx +0 -104
- package/lib/TabNav.jsx +0 -60
- package/lib/Text.jsx +0 -14
- package/lib/TextInput.jsx +0 -23
- package/lib/TextInputWithTokens.jsx +0 -218
- package/lib/ThemeProvider.jsx +0 -130
- package/lib/Timeline.jsx +0 -124
- package/lib/Token/AvatarToken.jsx +0 -54
- package/lib/Token/IssueLabelToken.jsx +0 -125
- package/lib/Token/Token.jsx +0 -103
- package/lib/Token/TokenBase.jsx +0 -88
- package/lib/Token/_RemoveTokenButton.jsx +0 -108
- package/lib/Token/_TokenTextContainer.jsx +0 -49
- package/lib/Tooltip.jsx +0 -246
- package/lib/Truncate.jsx +0 -27
- package/lib/UnderlineNav.jsx +0 -90
- package/lib/_TextInputWrapper.jsx +0 -120
- package/lib/_UnstyledTextInput.jsx +0 -22
- package/lib/__tests__/ActionList.test.jsx +0 -49
- package/lib/__tests__/ActionList.types.test.jsx +0 -45
- package/lib/__tests__/ActionList2.test.jsx +0 -46
- package/lib/__tests__/ActionMenu.test.jsx +0 -124
- package/lib/__tests__/AnchoredOverlay.test.jsx +0 -121
- package/lib/__tests__/Autocomplete.test.jsx +0 -299
- package/lib/__tests__/Avatar.test.jsx +0 -42
- package/lib/__tests__/AvatarStack.test.jsx +0 -43
- package/lib/__tests__/BorderBox.test.jsx +0 -36
- package/lib/__tests__/Box.test.jsx +0 -41
- package/lib/__tests__/BranchName.test.jsx +0 -27
- package/lib/__tests__/Breadcrumbs.test.jsx +0 -28
- package/lib/__tests__/BreadcrumbsItem.test.jsx +0 -31
- package/lib/__tests__/Button.test.jsx +0 -100
- package/lib/__tests__/Caret.test.jsx +0 -37
- package/lib/__tests__/CircleBadge.test.jsx +0 -55
- package/lib/__tests__/CircleOcticon.test.jsx +0 -45
- package/lib/__tests__/ConfirmationDialog.test.jsx +0 -119
- package/lib/__tests__/CounterLabel.test.jsx +0 -36
- package/lib/__tests__/Details.test.jsx +0 -85
- package/lib/__tests__/Dialog.test.jsx +0 -139
- package/lib/__tests__/Dropdown.test.jsx +0 -49
- package/lib/__tests__/DropdownMenu.test.jsx +0 -119
- package/lib/__tests__/FilterList.test.jsx +0 -27
- package/lib/__tests__/FilterListItem.test.jsx +0 -31
- package/lib/__tests__/FilteredSearch.test.jsx +0 -27
- package/lib/__tests__/Flash.test.jsx +0 -36
- package/lib/__tests__/Flex.test.jsx +0 -51
- package/lib/__tests__/FormGroup.test.jsx +0 -36
- package/lib/__tests__/Grid.test.jsx +0 -69
- package/lib/__tests__/Header.test.jsx +0 -45
- package/lib/__tests__/Heading.test.jsx +0 -71
- package/lib/__tests__/Label.test.jsx +0 -33
- package/lib/__tests__/LabelGroup.test.jsx +0 -29
- package/lib/__tests__/Link.test.jsx +0 -43
- package/lib/__tests__/NewButton.test.jsx +0 -61
- package/lib/__tests__/Overlay.test.jsx +0 -105
- package/lib/__tests__/Pagehead.test.jsx +0 -25
- package/lib/__tests__/Pagination/Pagination.test.jsx +0 -32
- package/lib/__tests__/Pagination/PaginationModel.test.jsx +0 -118
- package/lib/__tests__/PointerBox.test.jsx +0 -33
- package/lib/__tests__/Popover.test.jsx +0 -58
- package/lib/__tests__/Portal.test.jsx +0 -102
- package/lib/__tests__/Position.test.jsx +0 -96
- package/lib/__tests__/ProgressBar.test.jsx +0 -38
- package/lib/__tests__/SelectMenu.test.jsx +0 -120
- package/lib/__tests__/SelectPanel.test.jsx +0 -48
- package/lib/__tests__/SideNav.test.jsx +0 -55
- package/lib/__tests__/Spinner.test.jsx +0 -41
- package/lib/__tests__/StateLabel.test.jsx +0 -46
- package/lib/__tests__/StyledOcticon.test.jsx +0 -28
- package/lib/__tests__/SubNav.test.jsx +0 -47
- package/lib/__tests__/SubNavLink.test.jsx +0 -31
- package/lib/__tests__/TabNav.test.jsx +0 -32
- package/lib/__tests__/Text.test.jsx +0 -71
- package/lib/__tests__/TextInput.test.jsx +0 -45
- package/lib/__tests__/TextInputWithTokens.test.jsx +0 -302
- package/lib/__tests__/ThemeProvider.test.jsx +0 -314
- package/lib/__tests__/Timeline.test.jsx +0 -51
- package/lib/__tests__/Token.test.jsx +0 -93
- package/lib/__tests__/Tooltip.test.jsx +0 -46
- package/lib/__tests__/Truncate.test.jsx +0 -41
- package/lib/__tests__/UnderlineNav.test.jsx +0 -53
- package/lib/__tests__/UnderlineNavLink.test.jsx +0 -31
- package/lib/__tests__/behaviors/focusTrap.test.jsx +0 -184
- package/lib/__tests__/behaviors/focusZone.test.jsx +0 -406
- package/lib/__tests__/behaviors/iterateFocusableElements.test.jsx +0 -58
- package/lib/__tests__/hooks/useAnchoredPosition.test.jsx +0 -29
- package/lib/__tests__/hooks/useOnEscapePress.test.jsx +0 -19
- package/lib/__tests__/hooks/useOnOutsideClick.test.jsx +0 -63
- package/lib/__tests__/hooks/useOpenAndCloseFocus.test.jsx +0 -61
- package/lib/__tests__/hooks/useProvidedStateOrCreate.test.jsx +0 -56
- package/lib/__tests__/useSafeTimeout.test.jsx +0 -36
- package/lib/__tests__/utils/createSlots.test.jsx +0 -57
- package/lib/hooks/useDetails.jsx +0 -39
- package/lib/hooks/useOnOutsideClick.jsx +0 -61
- package/lib/hooks/useOverlay.jsx +0 -15
- package/lib/utils/create-slots.jsx +0 -65
- package/lib/utils/deprecate.jsx +0 -59
- package/lib/utils/isNumeric.jsx +0 -7
- package/lib/utils/ssr.jsx +0 -6
- package/lib/utils/test-deprecations.jsx +0 -20
- package/lib/utils/test-helpers.jsx +0 -8
- package/lib/utils/test-matchers.jsx +0 -100
- package/lib/utils/testing.jsx +0 -206
- package/tsconfig.base.json +0 -20
@@ -1,18 +1,51 @@
|
|
1
1
|
import React from 'react'
|
2
|
+
import {useSSRSafeId} from '@react-aria/ssr'
|
2
3
|
import Box from '../Box'
|
3
4
|
import {SxProp} from '../sx'
|
4
|
-
import {
|
5
|
-
import {
|
5
|
+
import {ListContext, ListProps} from './List'
|
6
|
+
import {AriaRole} from '../utils/types'
|
6
7
|
|
7
|
-
export type GroupProps =
|
8
|
-
|
8
|
+
export type GroupProps = {
|
9
|
+
/**
|
10
|
+
* Style variations. Usage is discretionary.
|
11
|
+
*
|
12
|
+
* - `"filled"` - Superimposed on a background, offset from nearby content
|
13
|
+
* - `"subtle"` - Relatively less offset from nearby content
|
14
|
+
*/
|
15
|
+
variant?: 'subtle' | 'filled'
|
16
|
+
/**
|
17
|
+
* Primary text which names a `Group`.
|
18
|
+
*/
|
19
|
+
title?: string
|
20
|
+
/**
|
21
|
+
* Secondary text which provides additional information about a `Group`.
|
22
|
+
*/
|
23
|
+
auxiliaryText?: string
|
24
|
+
/**
|
25
|
+
* The ARIA role describing the function of the list inside `Group` component. `listbox` or `menu` are a common values.
|
26
|
+
*/
|
27
|
+
role?: AriaRole
|
28
|
+
} & SxProp & {
|
29
|
+
/**
|
30
|
+
* Whether multiple Items or a single Item can be selected in the Group. Overrides value on ActionList root.
|
31
|
+
*/
|
9
32
|
selectionVariant?: ListProps['selectionVariant'] | false
|
10
33
|
}
|
11
34
|
|
12
35
|
type ContextProps = Pick<GroupProps, 'selectionVariant'>
|
13
36
|
export const GroupContext = React.createContext<ContextProps>({})
|
14
37
|
|
15
|
-
export const Group: React.FC<GroupProps> = ({
|
38
|
+
export const Group: React.FC<GroupProps> = ({
|
39
|
+
title,
|
40
|
+
variant = 'subtle',
|
41
|
+
auxiliaryText,
|
42
|
+
selectionVariant,
|
43
|
+
role,
|
44
|
+
sx = {},
|
45
|
+
...props
|
46
|
+
}) => {
|
47
|
+
const labelId = useSSRSafeId()
|
48
|
+
|
16
49
|
return (
|
17
50
|
<Box
|
18
51
|
as="li"
|
@@ -23,12 +56,48 @@ export const Group: React.FC<GroupProps> = ({title, variant, auxiliaryText, sele
|
|
23
56
|
}}
|
24
57
|
{...props}
|
25
58
|
>
|
26
|
-
{title && <Header title={title} variant={variant} auxiliaryText={auxiliaryText} />}
|
59
|
+
{title && <Header title={title} variant={variant} auxiliaryText={auxiliaryText} labelId={labelId} />}
|
27
60
|
<GroupContext.Provider value={{selectionVariant}}>
|
28
|
-
<Box as="ul" sx={{paddingInlineStart: 0}}>
|
61
|
+
<Box as="ul" sx={{paddingInlineStart: 0}} aria-labelledby={title ? labelId : undefined} role={role}>
|
29
62
|
{props.children}
|
30
63
|
</Box>
|
31
64
|
</GroupContext.Provider>
|
32
65
|
</Box>
|
33
66
|
)
|
34
67
|
}
|
68
|
+
|
69
|
+
export type HeaderProps = Pick<GroupProps, 'variant' | 'title' | 'auxiliaryText'> & {
|
70
|
+
labelId: string
|
71
|
+
}
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Displays the name and description of a `Group`.
|
75
|
+
*
|
76
|
+
* For visual presentation only. It's hidden from screen readers.
|
77
|
+
*/
|
78
|
+
const Header: React.FC<HeaderProps> = ({variant, title, auxiliaryText, labelId, ...props}) => {
|
79
|
+
const {variant: listVariant} = React.useContext(ListContext)
|
80
|
+
|
81
|
+
const styles = {
|
82
|
+
paddingY: '6px',
|
83
|
+
paddingX: listVariant === 'full' ? 2 : 3,
|
84
|
+
fontSize: 0,
|
85
|
+
fontWeight: 'bold',
|
86
|
+
color: 'fg.muted',
|
87
|
+
...(variant === 'filled' && {
|
88
|
+
backgroundColor: 'canvas.subtle',
|
89
|
+
marginX: 0,
|
90
|
+
marginBottom: 2,
|
91
|
+
borderTop: '1px solid',
|
92
|
+
borderBottom: '1px solid',
|
93
|
+
borderColor: 'neutral.muted'
|
94
|
+
})
|
95
|
+
}
|
96
|
+
|
97
|
+
return (
|
98
|
+
<Box sx={styles} role="presentation" aria-hidden="true" {...props}>
|
99
|
+
<span id={labelId}>{title}</span>
|
100
|
+
{auxiliaryText && <span>{auxiliaryText}</span>}
|
101
|
+
</Box>
|
102
|
+
)
|
103
|
+
}
|
package/src/ActionList2/List.tsx
CHANGED
@@ -23,7 +23,7 @@ export type ListProps = {
|
|
23
23
|
role?: AriaRole
|
24
24
|
} & SxProp
|
25
25
|
|
26
|
-
type ContextProps =
|
26
|
+
type ContextProps = Pick<ListProps, 'variant' | 'selectionVariant' | 'showDividers'>
|
27
27
|
export const ListContext = React.createContext<ContextProps>({})
|
28
28
|
|
29
29
|
const ListBox = styled.ul<SxProp>(sx)
|
package/src/Breadcrumbs.tsx
CHANGED
@@ -4,7 +4,7 @@ import * as History from 'history'
|
|
4
4
|
import React from 'react'
|
5
5
|
import styled from 'styled-components'
|
6
6
|
import Box from './Box'
|
7
|
-
import {
|
7
|
+
import {get} from './constants'
|
8
8
|
import sx, {SxProp} from './sx'
|
9
9
|
import {ComponentProps} from './utils/types'
|
10
10
|
|
@@ -31,20 +31,22 @@ const Wrapper = styled.li`
|
|
31
31
|
}
|
32
32
|
`
|
33
33
|
|
34
|
-
const BreadcrumbsBase = styled.nav<
|
34
|
+
const BreadcrumbsBase = styled.nav<SxProp>`
|
35
35
|
display: flex;
|
36
36
|
justify-content: space-between;
|
37
|
-
${COMMON};
|
38
|
-
${FLEX};
|
39
37
|
${sx};
|
40
38
|
`
|
41
39
|
|
42
|
-
export type BreadcrumbsProps =
|
40
|
+
export type BreadcrumbsProps = React.PropsWithChildren<
|
41
|
+
{
|
42
|
+
className?: string
|
43
|
+
} & SxProp
|
44
|
+
>
|
43
45
|
|
44
|
-
function Breadcrumbs({className, children,
|
45
|
-
const wrappedChildren = React.Children.map(children, child => <Wrapper
|
46
|
+
function Breadcrumbs({className, children, sx: sxProp}: React.PropsWithChildren<BreadcrumbsProps>) {
|
47
|
+
const wrappedChildren = React.Children.map(children, child => <Wrapper>{child}</Wrapper>)
|
46
48
|
return (
|
47
|
-
<BreadcrumbsBase className={className} aria-label="Breadcrumbs"
|
49
|
+
<BreadcrumbsBase className={className} aria-label="Breadcrumbs" sx={sxProp}>
|
48
50
|
<Box as="ol" my={0} pl={0}>
|
49
51
|
{wrappedChildren}
|
50
52
|
</Box>
|
@@ -55,8 +57,7 @@ function Breadcrumbs({className, children, theme, ...rest}: React.PropsWithChild
|
|
55
57
|
type StyledBreadcrumbsItemProps = {
|
56
58
|
to?: History.LocationDescriptor
|
57
59
|
selected?: boolean
|
58
|
-
} &
|
59
|
-
SxProp
|
60
|
+
} & SxProp
|
60
61
|
|
61
62
|
const BreadcrumbsItem = styled.a.attrs<StyledBreadcrumbsItemProps>(props => ({
|
62
63
|
activeClassName: typeof props.to === 'string' ? 'selected' : '',
|
@@ -74,7 +75,6 @@ const BreadcrumbsItem = styled.a.attrs<StyledBreadcrumbsItemProps>(props => ({
|
|
74
75
|
color: ${get('colors.fg.default')};
|
75
76
|
pointer-events: none;
|
76
77
|
}
|
77
|
-
${COMMON}
|
78
78
|
${sx};
|
79
79
|
`
|
80
80
|
|
package/src/Button/Button.tsx
CHANGED
@@ -2,9 +2,9 @@ import styled from 'styled-components'
|
|
2
2
|
import {get} from '../constants'
|
3
3
|
import sx, {SxProp} from '../sx'
|
4
4
|
import {ComponentProps} from '../utils/types'
|
5
|
-
import ButtonBase, {ButtonBaseProps
|
5
|
+
import ButtonBase, {ButtonBaseProps} from './ButtonBase'
|
6
6
|
|
7
|
-
const Button = styled(ButtonBase)<ButtonBaseProps &
|
7
|
+
const Button = styled(ButtonBase)<ButtonBaseProps & SxProp>`
|
8
8
|
color: ${get('colors.btn.text')};
|
9
9
|
background-color: ${get('colors.btn.bg')};
|
10
10
|
border: 1px solid ${get('colors.btn.border')};
|
@@ -32,7 +32,6 @@ const Button = styled(ButtonBase)<ButtonBaseProps & ButtonSystemProps & SxProp>`
|
|
32
32
|
border-color: ${get('colors.btn.border')};
|
33
33
|
}
|
34
34
|
|
35
|
-
${buttonSystemProps};
|
36
35
|
${sx};
|
37
36
|
`
|
38
37
|
|
@@ -1,12 +1,8 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
|
-
import {
|
3
|
-
import {COMMON, LAYOUT, SystemCommonProps, SystemLayoutProps} from '../constants'
|
2
|
+
import {variant} from 'styled-system'
|
4
3
|
import {ComponentProps} from '../utils/types'
|
5
4
|
import buttonBaseStyles from './ButtonStyles'
|
6
5
|
|
7
|
-
export const buttonSystemProps = compose(fontSize, COMMON, LAYOUT)
|
8
|
-
export type ButtonSystemProps = FontSizeProps & SystemCommonProps & SystemLayoutProps
|
9
|
-
|
10
6
|
const variants = variant({
|
11
7
|
variants: {
|
12
8
|
small: {
|
@@ -26,7 +22,7 @@ const variants = variant({
|
|
26
22
|
type StyledButtonBaseProps = {
|
27
23
|
as?: 'button' | 'a' | 'summary' | 'input' | string | React.ReactType
|
28
24
|
variant?: 'small' | 'medium' | 'large'
|
29
|
-
}
|
25
|
+
}
|
30
26
|
|
31
27
|
const ButtonBase = styled.button.attrs<StyledButtonBaseProps>(({disabled, onClick}) => ({
|
32
28
|
onClick: disabled ? undefined : onClick
|
@@ -1,13 +1,11 @@
|
|
1
1
|
import {XIcon} from '@primer/octicons-react'
|
2
2
|
import React, {forwardRef} from 'react'
|
3
3
|
import styled from 'styled-components'
|
4
|
-
import {
|
4
|
+
import {get} from '../constants'
|
5
5
|
import sx, {SxProp} from '../sx'
|
6
6
|
import {ComponentProps} from '../utils/types'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
const StyledButton = styled.button<StyledButtonProps>`
|
8
|
+
const StyledButton = styled.button<SxProp>`
|
11
9
|
border: none;
|
12
10
|
padding: 0;
|
13
11
|
background: transparent;
|
@@ -23,8 +21,6 @@ const StyledButton = styled.button<StyledButtonProps>`
|
|
23
21
|
&:hover {
|
24
22
|
color: ${get('colors.accent.fg')};
|
25
23
|
}
|
26
|
-
${COMMON};
|
27
|
-
${LAYOUT};
|
28
24
|
${sx};
|
29
25
|
`
|
30
26
|
|
@@ -2,9 +2,9 @@ import styled from 'styled-components'
|
|
2
2
|
import {get} from '../constants'
|
3
3
|
import sx, {SxProp} from '../sx'
|
4
4
|
import {ComponentProps} from '../utils/types'
|
5
|
-
import ButtonBase, {ButtonBaseProps
|
5
|
+
import ButtonBase, {ButtonBaseProps} from './ButtonBase'
|
6
6
|
|
7
|
-
const ButtonDanger = styled(ButtonBase)<ButtonBaseProps &
|
7
|
+
const ButtonDanger = styled(ButtonBase)<ButtonBaseProps & SxProp>`
|
8
8
|
color: ${get('colors.btn.danger.text')};
|
9
9
|
border: 1px solid ${get('colors.btn.border')};
|
10
10
|
background-color: ${get('colors.btn.bg')};
|
@@ -35,7 +35,6 @@ const ButtonDanger = styled(ButtonBase)<ButtonBaseProps & ButtonSystemProps & Sx
|
|
35
35
|
border-color: ${get('colors.btn.danger.disabledBorder')};
|
36
36
|
}
|
37
37
|
|
38
|
-
${buttonSystemProps};
|
39
38
|
${sx};
|
40
39
|
`
|
41
40
|
|
@@ -2,9 +2,9 @@ import styled from 'styled-components'
|
|
2
2
|
import {get} from '../constants'
|
3
3
|
import sx, {SxProp} from '../sx'
|
4
4
|
import {ComponentProps} from '../utils/types'
|
5
|
-
import ButtonBase, {ButtonBaseProps
|
5
|
+
import ButtonBase, {ButtonBaseProps} from './ButtonBase'
|
6
6
|
|
7
|
-
const ButtonInvisible = styled(ButtonBase)<ButtonBaseProps &
|
7
|
+
const ButtonInvisible = styled(ButtonBase)<ButtonBaseProps & SxProp>`
|
8
8
|
color: ${get('colors.accent.fg')};
|
9
9
|
background-color: transparent;
|
10
10
|
border: 0;
|
@@ -24,7 +24,6 @@ const ButtonInvisible = styled(ButtonBase)<ButtonBaseProps & ButtonSystemProps &
|
|
24
24
|
background-color: ${get('colors.btn.selectedBg')};
|
25
25
|
}
|
26
26
|
|
27
|
-
${buttonSystemProps};
|
28
27
|
${sx}
|
29
28
|
`
|
30
29
|
|
@@ -2,9 +2,9 @@ import styled from 'styled-components'
|
|
2
2
|
import {get} from '../constants'
|
3
3
|
import sx, {SxProp} from '../sx'
|
4
4
|
import {ComponentProps} from '../utils/types'
|
5
|
-
import ButtonBase, {ButtonBaseProps
|
5
|
+
import ButtonBase, {ButtonBaseProps} from './ButtonBase'
|
6
6
|
|
7
|
-
const ButtonOutline = styled(ButtonBase)<ButtonBaseProps &
|
7
|
+
const ButtonOutline = styled(ButtonBase)<ButtonBaseProps & SxProp>`
|
8
8
|
color: ${get('colors.btn.outline.text')};
|
9
9
|
border: 1px solid ${get('colors.btn.border')};
|
10
10
|
background-color: ${get('colors.btn.bg')};
|
@@ -35,7 +35,6 @@ const ButtonOutline = styled(ButtonBase)<ButtonBaseProps & ButtonSystemProps & S
|
|
35
35
|
border-color: ${get('colors.btn.border')};
|
36
36
|
}
|
37
37
|
|
38
|
-
${buttonSystemProps};
|
39
38
|
${sx};
|
40
39
|
`
|
41
40
|
|
@@ -2,9 +2,9 @@ import styled from 'styled-components'
|
|
2
2
|
import {get} from '../constants'
|
3
3
|
import sx, {SxProp} from '../sx'
|
4
4
|
import {ComponentProps} from '../utils/types'
|
5
|
-
import ButtonBase, {ButtonBaseProps
|
5
|
+
import ButtonBase, {ButtonBaseProps} from './ButtonBase'
|
6
6
|
|
7
|
-
export const ButtonPrimary = styled(ButtonBase)<ButtonBaseProps &
|
7
|
+
export const ButtonPrimary = styled(ButtonBase)<ButtonBaseProps & SxProp>`
|
8
8
|
color: ${get('colors.btn.primary.text')};
|
9
9
|
border: 1px solid ${get('colors.btn.primary.border')};
|
10
10
|
background-color: ${get('colors.btn.primary.bg')};
|
@@ -33,7 +33,6 @@ export const ButtonPrimary = styled(ButtonBase)<ButtonBaseProps & ButtonSystemPr
|
|
33
33
|
border-color: ${get('colors.btn.primary.disabledBorder')};
|
34
34
|
}
|
35
35
|
|
36
|
-
${buttonSystemProps};
|
37
36
|
${sx};
|
38
37
|
`
|
39
38
|
|
@@ -1,19 +1,9 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
|
-
import {
|
3
|
-
COMMON,
|
4
|
-
get,
|
5
|
-
LAYOUT,
|
6
|
-
SystemCommonProps,
|
7
|
-
SystemLayoutProps,
|
8
|
-
SystemTypographyProps,
|
9
|
-
TYPOGRAPHY
|
10
|
-
} from '../constants'
|
2
|
+
import {get} from '../constants'
|
11
3
|
import sx, {SxProp} from '../sx'
|
12
4
|
import {ComponentProps} from '../utils/types'
|
13
5
|
|
14
|
-
|
15
|
-
|
16
|
-
const ButtonTableList = styled.summary<StyledButtonTableListProps>`
|
6
|
+
const ButtonTableList = styled.summary<SxProp>`
|
17
7
|
display: inline-block;
|
18
8
|
padding: 0;
|
19
9
|
font-size: ${get('fontSizes.1')};
|
@@ -48,9 +38,6 @@ const ButtonTableList = styled.summary<StyledButtonTableListProps>`
|
|
48
38
|
border: 4px solid transparent;
|
49
39
|
border-top-color: currentcolor;
|
50
40
|
}
|
51
|
-
${COMMON}
|
52
|
-
${TYPOGRAPHY}
|
53
|
-
${LAYOUT}
|
54
41
|
${sx};
|
55
42
|
`
|
56
43
|
|
package/src/CircleBadge.tsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
|
-
import {
|
2
|
+
import {get} from './constants'
|
3
3
|
import StyledOcticon from './StyledOcticon'
|
4
4
|
import sx, {SxProp} from './sx'
|
5
5
|
import isNumeric from './utils/isNumeric'
|
@@ -15,8 +15,7 @@ type StyledCircleBadgeProps = {
|
|
15
15
|
inline?: boolean
|
16
16
|
variant?: keyof typeof variantSizes
|
17
17
|
size?: number
|
18
|
-
} &
|
19
|
-
SxProp
|
18
|
+
} & SxProp
|
20
19
|
|
21
20
|
const sizeStyles = ({size, variant = 'medium'}: StyledCircleBadgeProps) => {
|
22
21
|
const calc = isNumeric(size) ? size : variantSizes[variant]
|
@@ -33,7 +32,6 @@ const CircleBadge = styled.div<StyledCircleBadgeProps>`
|
|
33
32
|
background-color: ${get('colors.canvas.default')};
|
34
33
|
border-radius: 50%;
|
35
34
|
box-shadow: ${get('shadows.shadow.medium')};
|
36
|
-
${COMMON};
|
37
35
|
${sizeStyles};
|
38
36
|
${sx};
|
39
37
|
`
|
package/src/CounterLabel.tsx
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
|
-
import {
|
2
|
+
import {get} from './constants'
|
3
3
|
import sx, {SxProp} from './sx'
|
4
4
|
import {ComponentProps} from './utils/types'
|
5
5
|
|
6
6
|
type StyledCounterLabelProps = {
|
7
7
|
scheme?: 'primary' | 'secondary'
|
8
|
-
} &
|
9
|
-
SxProp
|
8
|
+
} & SxProp
|
10
9
|
|
11
10
|
const colorStyles = ({scheme, ...props}: StyledCounterLabelProps) => {
|
12
11
|
return {
|
@@ -39,7 +38,6 @@ const CounterLabel = styled.span<StyledCounterLabelProps>`
|
|
39
38
|
border-radius: 20px;
|
40
39
|
${colorStyles};
|
41
40
|
${bgStyles};
|
42
|
-
${COMMON};
|
43
41
|
|
44
42
|
&:empty {
|
45
43
|
display: none;
|
package/src/Dialog/Dialog.tsx
CHANGED
@@ -2,7 +2,7 @@ import React, {useCallback, useEffect, useRef, useState} from 'react'
|
|
2
2
|
import styled from 'styled-components'
|
3
3
|
import Button, {ButtonPrimary, ButtonDanger, ButtonProps} from '../Button'
|
4
4
|
import Box from '../Box'
|
5
|
-
import {get
|
5
|
+
import {get} from '../constants'
|
6
6
|
import {useOnEscapePress, useProvidedRefOrCreate} from '../hooks'
|
7
7
|
import {useFocusTrap} from '../hooks/useFocusTrap'
|
8
8
|
import sx, {SxProp} from '../sx'
|
@@ -180,12 +180,12 @@ const widthMap = {
|
|
180
180
|
export type DialogWidth = keyof typeof widthMap
|
181
181
|
export type DialogHeight = keyof typeof heightMap
|
182
182
|
|
183
|
-
|
183
|
+
type StyledDialogProps = {
|
184
184
|
width?: DialogWidth
|
185
185
|
height?: DialogHeight
|
186
|
-
}
|
186
|
+
} & SxProp
|
187
187
|
|
188
|
-
const StyledDialog = styled.div<StyledDialogProps
|
188
|
+
const StyledDialog = styled.div<StyledDialogProps>`
|
189
189
|
display: flex;
|
190
190
|
flex-direction: column;
|
191
191
|
background-color: ${get('colors.canvas.overlay')};
|
@@ -210,8 +210,6 @@ const StyledDialog = styled.div<StyledDialogProps & SystemCommonProps & SystemPo
|
|
210
210
|
}
|
211
211
|
}
|
212
212
|
|
213
|
-
${COMMON};
|
214
|
-
${POSITION};
|
215
213
|
${sx};
|
216
214
|
`
|
217
215
|
|
@@ -309,27 +307,37 @@ const _Dialog = React.forwardRef<HTMLDivElement, React.PropsWithChildren<DialogP
|
|
309
307
|
})
|
310
308
|
_Dialog.displayName = 'Dialog'
|
311
309
|
|
312
|
-
const Header = styled
|
310
|
+
const Header = styled.div.attrs<SxProp>({as: 'header'})`
|
313
311
|
box-shadow: 0 1px 0 ${get('colors.border.default')};
|
314
312
|
padding: ${get('space.2')};
|
315
313
|
z-index: 1;
|
316
314
|
flex-shrink: 0;
|
317
315
|
`
|
318
|
-
|
316
|
+
|
317
|
+
const Title = styled.div<SxProp>`
|
319
318
|
font-size: ${get('fontSizes.1')};
|
320
319
|
font-weight: ${get('fontWeights.bold')};
|
320
|
+
|
321
|
+
${sx};
|
321
322
|
`
|
322
|
-
|
323
|
+
|
324
|
+
const Subtitle = styled.div<SxProp>`
|
323
325
|
font-size: ${get('fontSizes.0')};
|
324
326
|
margin-top: ${get('space.1')};
|
325
327
|
color: ${get('colors.fg.muted')};
|
328
|
+
|
329
|
+
${sx};
|
326
330
|
`
|
327
|
-
|
331
|
+
|
332
|
+
const Body = styled.div<SxProp>`
|
328
333
|
flex-grow: 1;
|
329
334
|
overflow: auto;
|
330
335
|
padding: ${get('space.3')};
|
336
|
+
|
337
|
+
${sx};
|
331
338
|
`
|
332
|
-
|
339
|
+
|
340
|
+
const Footer = styled.div.attrs<SxProp>({as: 'footer'})`
|
333
341
|
box-shadow: 0 -1px 0 ${get('colors.border.default')};
|
334
342
|
padding: ${get('space.3')};
|
335
343
|
display: flex;
|
@@ -344,7 +352,10 @@ const Footer = styled(Box).attrs({as: 'footer'})`
|
|
344
352
|
margin-left: 0;
|
345
353
|
}
|
346
354
|
}
|
355
|
+
|
356
|
+
${sx};
|
347
357
|
`
|
358
|
+
|
348
359
|
const buttonTypes = {
|
349
360
|
normal: Button,
|
350
361
|
primary: ButtonPrimary,
|
package/src/Dialog.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, {forwardRef, useRef} from 'react'
|
2
2
|
import styled from 'styled-components'
|
3
3
|
import ButtonClose from './Button/ButtonClose'
|
4
|
-
import {
|
4
|
+
import {get} from './constants'
|
5
5
|
import Box from './Box'
|
6
6
|
import useDialog from './hooks/useDialog'
|
7
7
|
import sx, {SxProp} from './sx'
|
@@ -14,9 +14,7 @@ const noop = () => null
|
|
14
14
|
type StyledDialogBaseProps = {
|
15
15
|
narrow?: boolean
|
16
16
|
wide?: boolean
|
17
|
-
} &
|
18
|
-
SystemCommonProps &
|
19
|
-
SxProp
|
17
|
+
} & SxProp
|
20
18
|
|
21
19
|
const DialogBase = styled.div<StyledDialogBaseProps>`
|
22
20
|
box-shadow: ${get('shadows.shadow.large')};
|
@@ -39,8 +37,6 @@ const DialogBase = styled.div<StyledDialogBaseProps>`
|
|
39
37
|
height: 100vh;
|
40
38
|
}
|
41
39
|
|
42
|
-
${LAYOUT};
|
43
|
-
${COMMON};
|
44
40
|
${sx};
|
45
41
|
`
|
46
42
|
|
package/src/Dropdown.tsx
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import styled from 'styled-components'
|
3
3
|
import Button, {ButtonProps} from './Button'
|
4
|
-
import {
|
4
|
+
import {get} from './constants'
|
5
5
|
import Details, {DetailsProps} from './Details'
|
6
6
|
import getDirectionStyles from './DropdownStyles'
|
7
7
|
import useDetails from './hooks/useDetails'
|
@@ -35,7 +35,7 @@ const DropdownButton = ({children, ...rest}: DropdownButtonProps) => {
|
|
35
35
|
)
|
36
36
|
}
|
37
37
|
|
38
|
-
const DropdownCaret = styled.div<
|
38
|
+
const DropdownCaret = styled.div<SxProp>`
|
39
39
|
border: 4px solid transparent;
|
40
40
|
margin-left: 12px;
|
41
41
|
border-top-color: currentcolor;
|
@@ -45,14 +45,12 @@ const DropdownCaret = styled.div<SystemCommonProps & SxProp>`
|
|
45
45
|
height: 0;
|
46
46
|
vertical-align: middle;
|
47
47
|
width: 0;
|
48
|
-
${COMMON};
|
49
48
|
${sx};
|
50
49
|
`
|
51
50
|
|
52
51
|
type StyledDropdownMenuProps = {
|
53
52
|
direction?: 'ne' | 'e' | 'se' | 's' | 'sw' | 'w'
|
54
|
-
} &
|
55
|
-
SxProp
|
53
|
+
} & SxProp
|
56
54
|
|
57
55
|
const DropdownMenu = styled.ul<StyledDropdownMenuProps>`
|
58
56
|
background-clip: padding-box;
|
@@ -96,7 +94,6 @@ const DropdownMenu = styled.ul<StyledDropdownMenuProps>`
|
|
96
94
|
list-style: none;
|
97
95
|
}
|
98
96
|
${props => (props.direction ? getDirectionStyles(props.theme, props.direction) : '')};
|
99
|
-
${COMMON};
|
100
97
|
${sx};
|
101
98
|
`
|
102
99
|
|
@@ -131,7 +128,6 @@ const DropdownItem = styled.li`
|
|
131
128
|
background-color: ${get('colors.accent.emphasis')};
|
132
129
|
outline: none;
|
133
130
|
}
|
134
|
-
${COMMON};
|
135
131
|
${sx};
|
136
132
|
`
|
137
133
|
|
@@ -9,7 +9,7 @@ export const DropdownButton = React.forwardRef<HTMLElement, React.PropsWithChild
|
|
9
9
|
({children, ...props}: React.PropsWithChildren<DropdownButtonProps>, ref): JSX.Element => (
|
10
10
|
<Button ref={ref} type="button" {...props}>
|
11
11
|
{children}
|
12
|
-
<StyledOcticon icon={TriangleDownIcon}
|
12
|
+
<StyledOcticon icon={TriangleDownIcon} sx={{ml: 1}} />
|
13
13
|
</Button>
|
14
14
|
)
|
15
15
|
)
|
package/src/FilterList.tsx
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import styled from 'styled-components'
|
3
|
-
import {
|
3
|
+
import {get} from './constants'
|
4
4
|
import sx, {SxProp} from './sx'
|
5
5
|
import {ComponentProps} from './utils/types'
|
6
6
|
|
7
|
-
const FilterListBase = styled.ul<
|
7
|
+
const FilterListBase = styled.ul<SxProp>`
|
8
8
|
list-style-type: none;
|
9
|
-
|
9
|
+
margin: 0;
|
10
|
+
padding: 0;
|
10
11
|
${sx};
|
11
12
|
`
|
12
13
|
|
@@ -23,8 +24,7 @@ const FilterList = ({children, ...rest}: React.PropsWithChildren<FilterListProps
|
|
23
24
|
type StyledFilterListItemBaseProps = {
|
24
25
|
small?: boolean
|
25
26
|
selected?: boolean
|
26
|
-
} &
|
27
|
-
SxProp
|
27
|
+
} & SxProp
|
28
28
|
|
29
29
|
const FilterListItemBase = styled.a<StyledFilterListItemBaseProps>`
|
30
30
|
position: relative;
|
@@ -52,7 +52,6 @@ const FilterListItemBase = styled.a<StyledFilterListItemBaseProps>`
|
|
52
52
|
float: right;
|
53
53
|
font-weight: ${get('fontWeights.bold')};
|
54
54
|
}
|
55
|
-
${COMMON};
|
56
55
|
${sx};
|
57
56
|
`
|
58
57
|
|
@@ -71,11 +70,6 @@ function FilterListItem({children, count, ...rest}: React.PropsWithChildren<Filt
|
|
71
70
|
)
|
72
71
|
}
|
73
72
|
|
74
|
-
FilterList.defaultProps = {
|
75
|
-
m: 0,
|
76
|
-
p: 0
|
77
|
-
}
|
78
|
-
|
79
73
|
FilterListItem.displayName = 'FilterList.Item'
|
80
74
|
|
81
75
|
export default Object.assign(FilterList, {Item: FilterListItem})
|
package/src/FilteredSearch.tsx
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
|
-
import {
|
2
|
+
import {get} from './constants'
|
3
3
|
import sx, {SxProp} from './sx'
|
4
4
|
import {ComponentProps} from './utils/types'
|
5
5
|
|
6
|
-
const FilteredSearch = styled.div<
|
7
|
-
${COMMON};
|
6
|
+
const FilteredSearch = styled.div<SxProp>`
|
8
7
|
display: flex;
|
9
8
|
align-items: stretch;
|
10
9
|
|
package/src/Flash.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
2
|
import {variant} from 'styled-system'
|
3
|
-
import {
|
3
|
+
import {get} from './constants'
|
4
4
|
import sx, {SxProp} from './sx'
|
5
5
|
import {ComponentProps} from './utils/types'
|
6
6
|
|
@@ -45,8 +45,7 @@ const Flash = styled.div<
|
|
45
45
|
{
|
46
46
|
variant?: 'default' | 'warning' | 'success' | 'danger'
|
47
47
|
full?: boolean
|
48
|
-
} &
|
49
|
-
SxProp
|
48
|
+
} & SxProp
|
50
49
|
>`
|
51
50
|
position: relative;
|
52
51
|
color: ${get('colors.fg.default')};
|
@@ -64,7 +63,6 @@ const Flash = styled.div<
|
|
64
63
|
margin-right: ${get('space.2')};
|
65
64
|
}
|
66
65
|
|
67
|
-
${COMMON};
|
68
66
|
${variants};
|
69
67
|
${sx};
|
70
68
|
`
|