@primer/components 31.2.1-rc.f73a0f8c → 32.0.1-rc.c4c2c50a
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/release.yml +0 -1
- package/.github/workflows/release_canary.yml +0 -1
- package/CHANGELOG.md +72 -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/ActionList2/Group.d.ts +28 -2
- package/lib/ActionList2/Group.js +55 -6
- package/lib/ActionList2/Group.jsx +33 -4
- package/lib/ActionList2/List.d.ts +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +3 -3
- package/lib/Autocomplete/AutocompleteInput.d.ts +3 -3
- package/lib/Breadcrumbs.d.ts +8 -7
- package/lib/Breadcrumbs.js +7 -12
- package/lib/Breadcrumbs.jsx +3 -6
- package/lib/Button/Button.d.ts +2 -3
- package/lib/Button/Button.js +2 -6
- package/lib/Button/Button.jsx +1 -21
- package/lib/Button/ButtonBase.d.ts +5 -8
- package/lib/Button/ButtonBase.js +1 -5
- package/lib/Button/ButtonBase.jsx +0 -3
- package/lib/Button/ButtonClose.d.ts +3 -46
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonClose.jsx +0 -2
- package/lib/Button/ButtonDanger.d.ts +2 -3
- package/lib/Button/ButtonDanger.js +2 -6
- package/lib/Button/ButtonDanger.jsx +1 -21
- package/lib/Button/ButtonInvisible.d.ts +2 -3
- package/lib/Button/ButtonInvisible.js +2 -6
- package/lib/Button/ButtonInvisible.jsx +1 -21
- package/lib/Button/ButtonOutline.d.ts +2 -3
- package/lib/Button/ButtonOutline.js +2 -6
- package/lib/Button/ButtonOutline.jsx +1 -21
- package/lib/Button/ButtonPrimary.d.ts +2 -3
- package/lib/Button/ButtonPrimary.js +2 -6
- package/lib/Button/ButtonPrimary.jsx +1 -21
- package/lib/Button/ButtonTableList.d.ts +1 -2
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Button/ButtonTableList.jsx +0 -3
- package/lib/CircleBadge.d.ts +4 -5
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleBadge.jsx +0 -1
- package/lib/CircleOcticon.d.ts +1 -1
- package/lib/CounterLabel.d.ts +1 -2
- package/lib/CounterLabel.js +1 -1
- package/lib/CounterLabel.jsx +0 -1
- package/lib/Dialog/Dialog.d.ts +5 -9
- package/lib/Dialog/Dialog.js +17 -11
- package/lib/Dialog/Dialog.jsx +13 -7
- package/lib/Dialog.d.ts +4 -5
- package/lib/Dialog.js +1 -1
- package/lib/Dialog.jsx +0 -2
- package/lib/Dropdown.d.ts +10 -99
- package/lib/Dropdown.js +3 -3
- package/lib/Dropdown.jsx +0 -3
- package/lib/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib/DropdownMenu/DropdownButton.js +3 -1
- package/lib/DropdownMenu/DropdownButton.jsx +1 -1
- package/lib/FilterList.d.ts +264 -303
- package/lib/FilterList.js +2 -6
- package/lib/FilterList.jsx +2 -6
- package/lib/FilteredSearch.d.ts +1 -2
- package/lib/FilteredSearch.js +1 -1
- package/lib/FilteredSearch.jsx +0 -1
- package/lib/Flash.d.ts +1 -2
- package/lib/Flash.js +1 -1
- package/lib/Flash.jsx +0 -1
- package/lib/FormGroup.d.ts +4 -5
- package/lib/FormGroup.js +2 -2
- package/lib/FormGroup.jsx +0 -3
- package/lib/Header.d.ts +6 -7
- package/lib/Header.js +4 -4
- package/lib/Header.jsx +0 -7
- package/lib/Label.d.ts +1 -2
- package/lib/Label.js +2 -3
- package/lib/Label.jsx +1 -3
- package/lib/LabelGroup.d.ts +1 -2
- package/lib/LabelGroup.js +1 -1
- package/lib/LabelGroup.jsx +0 -1
- package/lib/Link.d.ts +1 -2
- package/lib/Link.js +1 -1
- package/lib/Link.jsx +0 -2
- package/lib/NewButton/button.js +34 -42
- package/lib/NewButton/button.jsx +24 -23
- package/lib/Overlay.d.ts +11 -10
- package/lib/Overlay.js +3 -4
- package/lib/Overlay.jsx +1 -3
- package/lib/Pagehead.d.ts +1 -2
- package/lib/Pagehead.js +1 -1
- package/lib/Pagehead.jsx +0 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Pagination/Pagination.jsx +0 -2
- package/lib/Popover.d.ts +4 -5
- package/lib/Popover.js +4 -5
- package/lib/Popover.jsx +1 -9
- 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/SelectMenu.jsx +0 -2
- package/lib/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuDivider.jsx +0 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.jsx +0 -1
- package/lib/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.jsx +0 -1
- package/lib/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuHeader.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.jsx +0 -2
- package/lib/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.jsx +0 -1
- package/lib/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuList.jsx +0 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +3 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +2 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuModal.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTab.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.jsx +0 -1
- package/lib/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.jsx +0 -1
- package/lib/SideNav.d.ts +11 -8
- package/lib/SideNav.js +8 -15
- package/lib/SideNav.jsx +2 -6
- package/lib/StateLabel.d.ts +1 -2
- package/lib/StateLabel.js +6 -5
- package/lib/StateLabel.jsx +1 -2
- package/lib/StyledOcticon.d.ts +1 -2
- package/lib/StyledOcticon.js +1 -3
- package/lib/StyledOcticon.jsx +0 -2
- package/lib/SubNav.d.ts +5 -11
- package/lib/SubNav.js +7 -12
- package/lib/SubNav.jsx +4 -7
- package/lib/TabNav.d.ts +3 -4
- package/lib/TabNav.js +2 -2
- package/lib/TabNav.jsx +0 -2
- package/lib/TextInputWithTokens.d.ts +3 -3
- package/lib/Timeline.d.ts +19 -393
- package/lib/Timeline.js +16 -13
- package/lib/Timeline.jsx +9 -10
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Tooltip.d.ts +1 -2
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.jsx +1 -1
- package/lib/Truncate.d.ts +1 -2
- package/lib/Truncate.js +1 -3
- package/lib/Truncate.jsx +0 -3
- package/lib/UnderlineNav.d.ts +2 -3
- package/lib/UnderlineNav.js +2 -2
- package/lib/UnderlineNav.jsx +0 -2
- package/lib/__tests__/Breadcrumbs.test.js +4 -1
- package/lib/__tests__/Breadcrumbs.test.jsx +1 -1
- package/lib/__tests__/Breadcrumbs.types.test.d.ts +3 -0
- package/lib/__tests__/Breadcrumbs.types.test.js +25 -0
- package/lib/__tests__/Breadcrumbs.types.test.jsx +24 -0
- package/lib/__tests__/Button.test.js +6 -2
- package/lib/__tests__/Button.test.jsx +2 -2
- package/lib/__tests__/CircleBadge.types.test.d.ts +3 -0
- package/lib/__tests__/CircleBadge.types.test.js +28 -0
- package/lib/__tests__/CircleBadge.types.test.jsx +17 -0
- package/lib/__tests__/CounterLabel.types.test.d.ts +3 -0
- package/lib/__tests__/CounterLabel.types.test.js +28 -0
- package/lib/__tests__/CounterLabel.types.test.jsx +17 -0
- package/lib/__tests__/Dialog.types.test.d.ts +3 -0
- package/lib/__tests__/Dialog.types.test.js +28 -0
- package/lib/__tests__/Dialog.types.test.jsx +17 -0
- package/lib/__tests__/Dialog2.types.test.d.ts +3 -0
- package/lib/__tests__/Dialog2.types.test.js +31 -0
- package/lib/__tests__/Dialog2.types.test.jsx +17 -0
- package/lib/__tests__/Dropdown.types.test.d.ts +3 -0
- package/lib/__tests__/Dropdown.types.test.js +31 -0
- package/lib/__tests__/Dropdown.types.test.jsx +25 -0
- package/lib/__tests__/FilterList.types.test.d.ts +3 -0
- package/lib/__tests__/FilterList.types.test.js +27 -0
- package/lib/__tests__/FilterList.types.test.jsx +21 -0
- package/lib/__tests__/FilteredSearch.types.test.d.ts +3 -0
- package/lib/__tests__/FilteredSearch.types.test.js +28 -0
- package/lib/__tests__/FilteredSearch.types.test.jsx +17 -0
- package/lib/__tests__/Flash.types.test.d.ts +3 -0
- package/lib/__tests__/Flash.types.test.js +28 -0
- package/lib/__tests__/Flash.types.test.jsx +17 -0
- package/lib/__tests__/FormGroup.types.test.d.ts +3 -0
- package/lib/__tests__/FormGroup.types.test.js +28 -0
- package/lib/__tests__/FormGroup.types.test.jsx +17 -0
- package/lib/__tests__/Header.types.test.d.ts +3 -0
- package/lib/__tests__/Header.types.test.js +29 -0
- package/lib/__tests__/Header.types.test.jsx +23 -0
- package/lib/__tests__/Label.types.test.d.ts +3 -0
- package/lib/__tests__/Label.types.test.js +28 -0
- package/lib/__tests__/Label.types.test.jsx +17 -0
- package/lib/__tests__/LabelGroup.types.test.d.ts +3 -0
- package/lib/__tests__/LabelGroup.types.test.js +28 -0
- package/lib/__tests__/LabelGroup.types.test.jsx +17 -0
- package/lib/__tests__/Link.test.js +11 -5
- package/lib/__tests__/Link.test.jsx +5 -5
- package/lib/__tests__/Link.types.test.d.ts +3 -0
- package/lib/__tests__/Link.types.test.js +28 -0
- package/lib/__tests__/Link.types.test.jsx +17 -0
- package/lib/__tests__/Overlay.types.test.d.ts +3 -0
- package/lib/__tests__/Overlay.types.test.js +35 -0
- package/lib/__tests__/Overlay.types.test.jsx +18 -0
- package/lib/__tests__/Pagehead.types.test.d.ts +3 -0
- package/lib/__tests__/Pagehead.types.test.js +28 -0
- package/lib/__tests__/Pagehead.types.test.jsx +17 -0
- package/lib/__tests__/Pagination.types.test.d.ts +3 -0
- package/lib/__tests__/Pagination.types.test.js +33 -0
- package/lib/__tests__/Pagination.types.test.jsx +17 -0
- package/lib/__tests__/Popover.types.test.d.ts +3 -0
- package/lib/__tests__/Popover.types.test.js +27 -0
- package/lib/__tests__/Popover.types.test.jsx +21 -0
- package/lib/__tests__/SelectMenu.types.test.d.ts +3 -0
- package/lib/__tests__/SelectMenu.types.test.js +47 -0
- package/lib/__tests__/SelectMenu.types.test.jsx +41 -0
- package/lib/__tests__/SideNav.types.test.d.ts +3 -0
- package/lib/__tests__/SideNav.types.test.js +28 -0
- package/lib/__tests__/SideNav.types.test.jsx +17 -0
- package/lib/__tests__/StateLabel.types.test.d.ts +3 -0
- package/lib/__tests__/StateLabel.types.test.js +28 -0
- package/lib/__tests__/StateLabel.types.test.jsx +17 -0
- package/lib/__tests__/StyledOcticon.types.test.d.ts +3 -0
- package/lib/__tests__/StyledOcticon.types.test.js +32 -0
- package/lib/__tests__/StyledOcticon.types.test.jsx +18 -0
- package/lib/__tests__/SubNav.types.test.d.ts +3 -0
- package/lib/__tests__/SubNav.types.test.js +27 -0
- package/lib/__tests__/SubNav.types.test.jsx +27 -0
- package/lib/__tests__/TabNav.types.test.d.ts +3 -0
- package/lib/__tests__/TabNav.types.test.js +25 -0
- package/lib/__tests__/TabNav.types.test.jsx +24 -0
- package/lib/__tests__/Timeline.types.test.d.ts +3 -0
- package/lib/__tests__/Timeline.types.test.js +31 -0
- package/lib/__tests__/Timeline.types.test.jsx +33 -0
- package/lib/__tests__/Tooltip.types.test.d.ts +3 -0
- package/lib/__tests__/Tooltip.types.test.js +28 -0
- package/lib/__tests__/Tooltip.types.test.jsx +17 -0
- package/lib/__tests__/Truncate.types.test.d.ts +3 -0
- package/lib/__tests__/Truncate.types.test.js +31 -0
- package/lib/__tests__/Truncate.types.test.jsx +17 -0
- package/lib/__tests__/UnderlineNav.types.test.d.ts +3 -0
- package/lib/__tests__/UnderlineNav.types.test.js +25 -0
- package/lib/__tests__/UnderlineNav.types.test.jsx +24 -0
- 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/utils/testing.d.ts +1 -1
- 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 +3 -3
- 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/src/Label.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import styled, {css} from 'styled-components'
|
2
2
|
import {borderColor, BorderColorProps, 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
|
|
@@ -11,7 +11,6 @@ const outlineStyles = css`
|
|
11
11
|
border: ${get('borderWidths.1')} solid ${get('colors.border.default')};
|
12
12
|
box-shadow: none;
|
13
13
|
${borderColor};
|
14
|
-
${COMMON};
|
15
14
|
background-color: transparent;
|
16
15
|
`
|
17
16
|
|
@@ -47,27 +46,25 @@ const Label = styled.span<
|
|
47
46
|
dropshadow?: boolean
|
48
47
|
outline?: boolean
|
49
48
|
} & BorderColorProps &
|
50
|
-
SystemCommonProps &
|
51
49
|
SxProp
|
52
50
|
>`
|
53
51
|
display: inline-block;
|
54
52
|
font-weight: ${get('fontWeights.semibold')};
|
55
53
|
color: ${get('colors.fg.onEmphasis')};
|
56
54
|
border-radius: ${get('radii.3')};
|
55
|
+
background-color: ${get('colors.neutral.emphasis')};
|
57
56
|
|
58
57
|
&:hover {
|
59
58
|
text-decoration: none;
|
60
59
|
}
|
61
60
|
|
62
61
|
${sizeVariant}
|
63
|
-
${COMMON}
|
64
62
|
${props => (props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '')}
|
65
63
|
${props => (props.outline ? outlineStyles : '')} // must be last to override other values
|
66
64
|
${sx}
|
67
65
|
`
|
68
66
|
|
69
67
|
Label.defaultProps = {
|
70
|
-
bg: 'neutral.emphasis',
|
71
68
|
variant: 'medium'
|
72
69
|
}
|
73
70
|
|
package/src/LabelGroup.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 LabelGroup = styled.span<
|
7
|
-
${COMMON}
|
6
|
+
const LabelGroup = styled.span<SxProp>`
|
8
7
|
& * {
|
9
8
|
margin-right: ${get('space.1')};
|
10
9
|
}
|
package/src/Link.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
2
|
import {system} 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
|
|
@@ -8,9 +8,7 @@ type StyledLinkProps = {
|
|
8
8
|
hoverColor?: string
|
9
9
|
muted?: boolean
|
10
10
|
underline?: boolean
|
11
|
-
} &
|
12
|
-
SxProp &
|
13
|
-
SystemTypographyProps
|
11
|
+
} & SxProp
|
14
12
|
|
15
13
|
const hoverColor = system({
|
16
14
|
hoverColor: {
|
@@ -37,8 +35,6 @@ const Link = styled.a<StyledLinkProps>`
|
|
37
35
|
border: 0;
|
38
36
|
appearance: none;
|
39
37
|
}
|
40
|
-
${TYPOGRAPHY};
|
41
|
-
${COMMON};
|
42
38
|
${sx};
|
43
39
|
`
|
44
40
|
|
package/src/NewButton/button.tsx
CHANGED
@@ -5,6 +5,8 @@ import sx, {merge, SxProp} from '../sx'
|
|
5
5
|
import {useTheme, Theme} from '../ThemeProvider'
|
6
6
|
import {VariantType, ButtonProps} from './types'
|
7
7
|
|
8
|
+
const TEXT_ROW_HEIGHT = '20px' // custom value off the scale
|
9
|
+
|
8
10
|
const getVariantStyles = (variant: VariantType = 'default', theme?: Theme) => {
|
9
11
|
const style = {
|
10
12
|
default: {
|
@@ -130,7 +132,7 @@ const getVariantStyles = (variant: VariantType = 'default', theme?: Theme) => {
|
|
130
132
|
boxShadow: `${theme?.shadows.btn.outline.focusShadow}`
|
131
133
|
},
|
132
134
|
|
133
|
-
'&:active': {
|
135
|
+
'&:active:not([disabled])': {
|
134
136
|
color: 'btn.outline.selectedText',
|
135
137
|
backgroundColor: 'btn.outline.selectedBg',
|
136
138
|
boxShadow: `${theme?.shadows.btn.outline.selectedShadow}`,
|
@@ -191,86 +193,88 @@ const getSizeStyles = (size = 'medium', variant: VariantType = 'default', iconOn
|
|
191
193
|
|
192
194
|
const ButtonBase = styled.button<SxProp>(sx)
|
193
195
|
|
194
|
-
const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
const {theme} = useTheme()
|
196
|
+
const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
197
|
+
({children, sx: sxProp = {}, ...props}, forwardedRef): JSX.Element => {
|
198
|
+
const {
|
199
|
+
icon: Icon,
|
200
|
+
leadingIcon: LeadingIcon,
|
201
|
+
trailingIcon: TrailingIcon,
|
202
|
+
variant = 'default',
|
203
|
+
size = 'medium'
|
204
|
+
} = props
|
205
|
+
const iconOnly = !!Icon
|
206
|
+
const {theme} = useTheme()
|
206
207
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
208
|
+
const styles = {
|
209
|
+
borderRadius: '2',
|
210
|
+
border: '1px solid',
|
211
|
+
borderColor: theme?.colors.btn.border,
|
212
|
+
display: 'grid',
|
213
|
+
gridTemplateAreas: '"leadingIcon text trailingIcon"',
|
214
|
+
fontWeight: 'bold',
|
215
|
+
lineHeight: TEXT_ROW_HEIGHT,
|
216
|
+
whiteSpace: 'nowrap',
|
217
|
+
verticalAlign: 'middle',
|
218
|
+
cursor: 'pointer',
|
219
|
+
appearance: 'none',
|
220
|
+
userSelect: 'none',
|
221
|
+
textDecoration: 'none',
|
222
|
+
textAlign: 'center',
|
223
|
+
'& > :not(:last-child)': {
|
224
|
+
mr: '2'
|
225
|
+
},
|
226
|
+
'&:focus': {
|
227
|
+
outline: 'none'
|
228
|
+
},
|
229
|
+
'&:disabled': {
|
230
|
+
cursor: 'default'
|
231
|
+
},
|
232
|
+
'&:disabled svg': {
|
233
|
+
opacity: '0.6'
|
234
|
+
},
|
235
|
+
'[data-component="leadingIcon"]': {
|
236
|
+
gridArea: 'leadingIcon'
|
237
|
+
},
|
238
|
+
'[data-component="text"]': {
|
239
|
+
gridArea: 'text'
|
240
|
+
},
|
241
|
+
'[data-component="trailingIcon"]': {
|
242
|
+
gridArea: 'trailingIcon'
|
243
|
+
}
|
242
244
|
}
|
245
|
+
const iconWrapStyles = {
|
246
|
+
display: 'inline-block'
|
247
|
+
}
|
248
|
+
const sxStyles = merge.all([
|
249
|
+
styles,
|
250
|
+
getSizeStyles(size, variant, iconOnly),
|
251
|
+
getVariantStyles(variant, theme),
|
252
|
+
sxProp as SxProp
|
253
|
+
])
|
254
|
+
return (
|
255
|
+
<ButtonBase sx={sxStyles} ref={forwardedRef} {...props}>
|
256
|
+
{LeadingIcon && (
|
257
|
+
<Box as="span" data-component="leadingIcon" sx={iconWrapStyles} aria-hidden={!iconOnly}>
|
258
|
+
<LeadingIcon />
|
259
|
+
</Box>
|
260
|
+
)}
|
261
|
+
<span data-component="text" hidden={Icon ? true : false}>
|
262
|
+
{children}
|
263
|
+
</span>
|
264
|
+
{Icon && (
|
265
|
+
<Box data-component="icon-only" as="span" sx={{display: 'inline-block'}} aria-hidden={!iconOnly}>
|
266
|
+
<Icon />
|
267
|
+
</Box>
|
268
|
+
)}
|
269
|
+
{TrailingIcon && (
|
270
|
+
<Box as="span" data-component="trailingIcon" sx={{...iconWrapStyles, ml: 2}} aria-hidden={!iconOnly}>
|
271
|
+
<TrailingIcon />
|
272
|
+
</Box>
|
273
|
+
)}
|
274
|
+
</ButtonBase>
|
275
|
+
)
|
243
276
|
}
|
244
|
-
|
245
|
-
const componentStyles = {...styles, ...variableStyles}
|
246
|
-
const iconWrapStyles = {
|
247
|
-
display: 'inline-block'
|
248
|
-
}
|
249
|
-
return (
|
250
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
251
|
-
// @ts-ignore Why wont it accept the sx prop?
|
252
|
-
<ButtonBase sx={merge(componentStyles, sxProp as SxProp)} ref={forwardedRef} {...props}>
|
253
|
-
{LeadingIcon && (
|
254
|
-
<Box as="span" data-component="leadingIcon" sx={iconWrapStyles} aria-hidden={!iconOnly}>
|
255
|
-
<LeadingIcon />
|
256
|
-
</Box>
|
257
|
-
)}
|
258
|
-
<span data-component="text" hidden={Icon ? true : undefined}>
|
259
|
-
{children}
|
260
|
-
</span>
|
261
|
-
{Icon && (
|
262
|
-
<Box data-component="icon-only" as="span" sx={{display: 'inline-block'}} aria-hidden={!iconOnly}>
|
263
|
-
<Icon />
|
264
|
-
</Box>
|
265
|
-
)}
|
266
|
-
{TrailingIcon && (
|
267
|
-
<Box as="span" data-component="trailingIcon" sx={{...iconWrapStyles, ml: 2}} aria-hidden={!iconOnly}>
|
268
|
-
<TrailingIcon />
|
269
|
-
</Box>
|
270
|
-
)}
|
271
|
-
</ButtonBase>
|
272
|
-
)
|
273
|
-
})
|
277
|
+
)
|
274
278
|
|
275
279
|
Button.displayName = 'Button'
|
276
280
|
|
package/src/Overlay.tsx
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import styled from 'styled-components'
|
2
2
|
import React, {ReactElement, useEffect, useRef} from 'react'
|
3
|
-
import {get, COMMON, SystemPositionProps, SystemCommonProps} from './constants'
|
4
|
-
import {ComponentProps} from './utils/types'
|
5
3
|
import useLayoutEffect from './utils/useIsomorphicLayoutEffect'
|
4
|
+
import {get} from './constants'
|
5
|
+
import {AriaRole, Merge} from './utils/types'
|
6
6
|
import {useOverlay, TouchOrMouseEvent} from './hooks'
|
7
7
|
import Portal from './Portal'
|
8
8
|
import sx, {SxProp} from './sx'
|
@@ -16,7 +16,7 @@ type StyledOverlayProps = {
|
|
16
16
|
maxHeight?: keyof Omit<typeof heightMap, 'auto' | 'initial'>
|
17
17
|
visibility?: 'visible' | 'hidden'
|
18
18
|
anchorSide?: AnchorSide
|
19
|
-
}
|
19
|
+
} & SxProp
|
20
20
|
|
21
21
|
const heightMap = {
|
22
22
|
xsmall: '192px',
|
@@ -52,7 +52,7 @@ function getSlideAnimationStartingVector(anchorSide?: AnchorSide): {x: number; y
|
|
52
52
|
return {x: 0, y: 0}
|
53
53
|
}
|
54
54
|
|
55
|
-
const StyledOverlay = styled.div<StyledOverlayProps
|
55
|
+
const StyledOverlay = styled.div<StyledOverlayProps>`
|
56
56
|
background-color: ${get('colors.canvas.overlay')};
|
57
57
|
box-shadow: ${get('shadows.overlay.shadow')};
|
58
58
|
position: absolute;
|
@@ -77,22 +77,25 @@ const StyledOverlay = styled.div<StyledOverlayProps & SystemCommonProps & SxProp
|
|
77
77
|
:focus {
|
78
78
|
outline: none;
|
79
79
|
}
|
80
|
-
${COMMON};
|
81
80
|
${sx};
|
82
81
|
`
|
83
|
-
|
82
|
+
type BaseOverlayProps = {
|
84
83
|
ignoreClickRefs?: React.RefObject<HTMLElement>[]
|
85
84
|
initialFocusRef?: React.RefObject<HTMLElement>
|
86
85
|
returnFocusRef: React.RefObject<HTMLElement>
|
87
86
|
onClickOutside: (e: TouchOrMouseEvent) => void
|
88
87
|
onEscape: (e: KeyboardEvent) => void
|
89
88
|
visibility?: 'visible' | 'hidden'
|
90
|
-
|
91
|
-
top
|
92
|
-
left
|
89
|
+
'data-test-id'?: unknown
|
90
|
+
top?: number
|
91
|
+
left?: number
|
93
92
|
portalContainerName?: string
|
94
93
|
preventFocusOnOpen?: boolean
|
95
|
-
|
94
|
+
role?: AriaRole
|
95
|
+
children?: React.ReactNode
|
96
|
+
}
|
97
|
+
|
98
|
+
export type OverlayProps = Merge<StyledOverlayProps, BaseOverlayProps>
|
96
99
|
|
97
100
|
/**
|
98
101
|
* An `Overlay` is a flexible floating surface, used to display transient content such as menus,
|
@@ -180,7 +183,6 @@ const Overlay = React.forwardRef<HTMLDivElement, OverlayProps>(
|
|
180
183
|
{
|
181
184
|
top: `${top || 0}px`,
|
182
185
|
left: `${left || 0}px`,
|
183
|
-
...rest.style,
|
184
186
|
'--styled-overlay-visibility': visibility
|
185
187
|
} as React.CSSProperties
|
186
188
|
}
|
package/src/Pagehead.tsx
CHANGED
@@ -1,15 +1,14 @@
|
|
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 Pagehead = styled.div<
|
6
|
+
const Pagehead = styled.div<SxProp>`
|
7
7
|
position: relative;
|
8
8
|
padding-top: ${get('space.4')};
|
9
9
|
padding-bottom: ${get('space.4')};
|
10
10
|
margin-bottom: ${get('space.4')};
|
11
11
|
border-bottom: 1px solid ${get('colors.border.default')};
|
12
|
-
${COMMON};
|
13
12
|
${sx};
|
14
13
|
`
|
15
14
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import styled from 'styled-components'
|
3
3
|
import Box from '../Box'
|
4
|
-
import {
|
5
|
-
import sx from '../sx'
|
4
|
+
import {get} from '../constants'
|
5
|
+
import sx, {SxProp} from '../sx'
|
6
6
|
import {buildComponentData, buildPaginationModel} from './model'
|
7
7
|
|
8
8
|
const Page = styled.a`
|
@@ -103,8 +103,6 @@ const Page = styled.a`
|
|
103
103
|
);
|
104
104
|
}
|
105
105
|
}
|
106
|
-
|
107
|
-
${COMMON};
|
108
106
|
`
|
109
107
|
|
110
108
|
type UsePaginationPagesParameters = {
|
@@ -148,7 +146,7 @@ function usePaginationPages({
|
|
148
146
|
return children
|
149
147
|
}
|
150
148
|
|
151
|
-
const PaginationContainer = styled.nav
|
149
|
+
const PaginationContainer = styled.nav<SxProp>`
|
152
150
|
margin-top: 20px;
|
153
151
|
margin-bottom: 15px;
|
154
152
|
text-align: center;
|
package/src/Popover.tsx
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import classnames from 'classnames'
|
2
2
|
import styled from 'styled-components'
|
3
|
-
import
|
4
|
-
import {COMMON, get, LAYOUT, POSITION, SystemCommonProps, SystemLayoutProps, SystemPositionProps} from './constants'
|
3
|
+
import {get} from './constants'
|
5
4
|
import sx, {SxProp} from './sx'
|
6
5
|
import {ComponentProps} from './utils/types'
|
7
6
|
|
@@ -23,10 +22,7 @@ type StyledPopoverProps = {
|
|
23
22
|
caret?: CaretPosition
|
24
23
|
relative?: boolean
|
25
24
|
open?: boolean
|
26
|
-
} &
|
27
|
-
SystemLayoutProps &
|
28
|
-
SystemPositionProps &
|
29
|
-
SxProp
|
25
|
+
} & SxProp
|
30
26
|
|
31
27
|
const Popover = styled.div.attrs<StyledPopoverProps>(({className, caret}) => {
|
32
28
|
return {
|
@@ -36,14 +32,10 @@ const Popover = styled.div.attrs<StyledPopoverProps>(({className, caret}) => {
|
|
36
32
|
position: ${props => (props.relative ? 'relative' : 'absolute')};
|
37
33
|
z-index: 100;
|
38
34
|
display: ${props => (props.open ? 'block' : 'none')};
|
39
|
-
|
40
|
-
${COMMON};
|
41
|
-
${LAYOUT};
|
42
|
-
${POSITION};
|
43
35
|
${sx};
|
44
36
|
`
|
45
37
|
|
46
|
-
const PopoverContent = styled
|
38
|
+
const PopoverContent = styled.div<SxProp>`
|
47
39
|
border: 1px solid ${get('colors.border.default')};
|
48
40
|
border-radius: ${get('radii.2')};
|
49
41
|
position: relative;
|
@@ -53,9 +45,6 @@ const PopoverContent = styled(Box)`
|
|
53
45
|
padding: ${get('space.4')};
|
54
46
|
background-color: ${get('colors.canvas.overlay')};
|
55
47
|
|
56
|
-
${COMMON};
|
57
|
-
${LAYOUT};
|
58
|
-
|
59
48
|
// Carets
|
60
49
|
&::before,
|
61
50
|
&::after {
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, {useCallback, useEffect, useRef, useState} from 'react'
|
2
2
|
import styled from 'styled-components'
|
3
|
-
import {COMMON, SystemCommonProps} from '../constants'
|
4
3
|
import sx, {SxProp} from '../sx'
|
5
4
|
import {ComponentProps} from '../utils/types'
|
6
5
|
import useKeyboardNav from './hooks/useKeyboardNav'
|
@@ -32,9 +31,8 @@ const wrapperStyles = `
|
|
32
31
|
}
|
33
32
|
`
|
34
33
|
|
35
|
-
const StyledSelectMenu = styled.details<
|
34
|
+
const StyledSelectMenu = styled.details<SxProp>`
|
36
35
|
${wrapperStyles}
|
37
|
-
${COMMON}
|
38
36
|
${sx};
|
39
37
|
`
|
40
38
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import styled, {css} 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
|
|
@@ -13,9 +13,8 @@ const dividerStyles = css`
|
|
13
13
|
border-bottom: ${get('borderWidths.1')} solid ${get('colors.border.muted')};
|
14
14
|
`
|
15
15
|
|
16
|
-
const SelectMenuDivider = styled.div<
|
16
|
+
const SelectMenuDivider = styled.div<SxProp>`
|
17
17
|
${dividerStyles}
|
18
|
-
${COMMON}
|
19
18
|
${sx};
|
20
19
|
`
|
21
20
|
|
@@ -1,17 +1,16 @@
|
|
1
1
|
import React, {forwardRef, useContext, useEffect, useRef} 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 TextInput, {TextInputProps} from '../TextInput'
|
6
6
|
import {ComponentProps} from '../utils/types'
|
7
7
|
import {MenuContext} from './SelectMenuContext'
|
8
8
|
|
9
|
-
const StyledForm = styled.form<
|
9
|
+
const StyledForm = styled.form<SxProp>`
|
10
10
|
padding: ${get('space.3')};
|
11
11
|
margin: 0;
|
12
12
|
border-bottom: ${get('borderWidths.1')} solid ${get('colors.border.muted')};
|
13
13
|
background-color: ${get('colors.canvas.overlay')};
|
14
|
-
${COMMON};
|
15
14
|
|
16
15
|
@media (min-width: ${get('breakpoints.0')}) {
|
17
16
|
padding: ${get('space.2')};
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import styled, {css} 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
|
|
@@ -16,9 +16,8 @@ const footerStyles = css`
|
|
16
16
|
}
|
17
17
|
`
|
18
18
|
|
19
|
-
const SelectMenuFooter = styled.footer<
|
19
|
+
const SelectMenuFooter = styled.footer<SxProp>`
|
20
20
|
${footerStyles}
|
21
|
-
${COMMON}
|
22
21
|
${sx};
|
23
22
|
`
|
24
23
|
|
@@ -1,6 +1,6 @@
|
|
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
|
|
@@ -19,13 +19,11 @@ const SelectMenuTitle = styled.h3`
|
|
19
19
|
}
|
20
20
|
`
|
21
21
|
|
22
|
-
const StyledHeader = styled.header<
|
22
|
+
const StyledHeader = styled.header<SxProp>`
|
23
23
|
display: flex;
|
24
24
|
flex: none; // fixes header from getting squeezed in Safari iOS
|
25
25
|
padding: ${get('space.3')};
|
26
26
|
border-bottom: ${get('borderWidths')} solid ${get('colors.border.muted')};
|
27
|
-
${COMMON}
|
28
|
-
${TYPOGRAPHY}
|
29
27
|
|
30
28
|
@media (min-width: ${get('breakpoints.0')}) {
|
31
29
|
padding-top: ${get('space.2')};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import {CheckIcon} from '@primer/octicons-react'
|
2
2
|
import React, {forwardRef, useContext, useRef} from 'react'
|
3
3
|
import styled, {css} from 'styled-components'
|
4
|
-
import {
|
4
|
+
import {get} from '../constants'
|
5
5
|
import StyledOcticon from '../StyledOcticon'
|
6
6
|
import sx, {SxProp} from '../sx'
|
7
7
|
import {ComponentProps} from '../utils/types'
|
@@ -92,9 +92,8 @@ export const listItemStyles = css`
|
|
92
92
|
|
93
93
|
const StyledItem = styled.a.attrs(() => ({
|
94
94
|
role: 'menuitemcheckbox'
|
95
|
-
}))<
|
95
|
+
}))<SxProp>`
|
96
96
|
${listItemStyles}
|
97
|
-
${COMMON}
|
98
97
|
${sx};
|
99
98
|
`
|
100
99
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import styled, {css} 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
|
|
@@ -30,9 +30,8 @@ const listStyles = css`
|
|
30
30
|
}
|
31
31
|
`
|
32
32
|
|
33
|
-
const SelectMenuList = styled.div<
|
33
|
+
const SelectMenuList = styled.div<SxProp>`
|
34
34
|
${listStyles}
|
35
|
-
${COMMON}
|
36
35
|
${sx};
|
37
36
|
`
|
38
37
|
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import styled from 'styled-components'
|
3
|
-
import {
|
3
|
+
import {get} from '../constants'
|
4
4
|
import Spinner from '../Spinner'
|
5
|
+
import sx, {SxProp} from '../sx'
|
5
6
|
import {ComponentProps} from '../utils/types'
|
6
7
|
|
7
|
-
const Animation = styled.div<
|
8
|
+
const Animation = styled.div<SxProp>`
|
8
9
|
padding: ${get('space.6')} ${get('space.4')};
|
9
10
|
text-align: center;
|
10
11
|
background-color: ${get('colors.canvas.overlay')};
|
11
|
-
${
|
12
|
+
${sx}
|
12
13
|
`
|
13
14
|
|
14
15
|
export type SelectMenuLoadingAnimationProps = ComponentProps<typeof Animation>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import styled, {css, keyframes} from 'styled-components'
|
3
3
|
import {width, WidthProps} from 'styled-system'
|
4
|
-
import {
|
4
|
+
import {get} from '../constants'
|
5
5
|
import sx, {SxProp} from '../sx'
|
6
6
|
import {ComponentProps} from '../utils/types'
|
7
7
|
|
@@ -11,8 +11,7 @@ type StyledModalProps = {
|
|
11
11
|
|
12
12
|
type StyledModalWrapperProps = {
|
13
13
|
align?: 'left' | 'right'
|
14
|
-
} &
|
15
|
-
SxProp
|
14
|
+
} & SxProp
|
16
15
|
|
17
16
|
const animateModal = keyframes`
|
18
17
|
0% {
|
@@ -92,7 +91,6 @@ const Modal = styled.div<StyledModalProps>`
|
|
92
91
|
|
93
92
|
const ModalWrapper = styled.div<StyledModalWrapperProps>`
|
94
93
|
${modalWrapperStyles}
|
95
|
-
${COMMON}
|
96
94
|
${sx};
|
97
95
|
`
|
98
96
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import classnames from 'classnames'
|
2
2
|
import React, {useContext, useEffect} from 'react'
|
3
3
|
import styled, {css} 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
|
import {MenuContext} from './SelectMenuContext'
|
@@ -43,9 +43,8 @@ const tabStyles = css`
|
|
43
43
|
}
|
44
44
|
`
|
45
45
|
|
46
|
-
const StyledTab = styled.button<
|
46
|
+
const StyledTab = styled.button<SxProp>`
|
47
47
|
${tabStyles}
|
48
|
-
${COMMON}
|
49
48
|
${sx};
|
50
49
|
`
|
51
50
|
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import React, {useContext} 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
|
import {MenuContext} from './SelectMenuContext'
|
7
7
|
import SelectMenuList from './SelectMenuList'
|
8
8
|
|
9
|
-
const TabPanelBase = styled.div<
|
9
|
+
const TabPanelBase = styled.div<SxProp>`
|
10
10
|
border-top: ${get('borderWidths.1')} solid ${get('colors.border.muted')};
|
11
|
-
${COMMON}
|
12
11
|
${sx};
|
13
12
|
`
|
14
13
|
|