@primer/components 0.0.0-2021983515 → 0.0.0-2022530194733
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +105 -492
- package/README.md +16 -16
- package/codemods/lib/modifyProps.js +7 -9
- package/codemods/lib/prettify.js +1 -1
- package/codemods/lib/replaceImportSource.js +5 -5
- package/dist/browser.esm.js +889 -1279
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +839 -1234
- package/dist/browser.umd.js.map +1 -1
- package/index.d.ts +940 -0
- package/lib/AvatarPair.js +5 -6
- package/lib/AvatarStack.js +10 -10
- package/lib/BaseStyles.js +19 -18
- package/lib/BorderBox.js +5 -4
- package/lib/Box.js +2 -2
- package/lib/BranchName.js +1 -1
- package/lib/{Breadcrumbs.js → Breadcrumb.js} +23 -33
- package/lib/Button/Button.js +3 -3
- package/lib/Button/ButtonClose.js +4 -4
- package/lib/Button/ButtonDanger.js +2 -2
- package/lib/Button/ButtonInvisible.js +3 -3
- package/lib/Button/ButtonOutline.js +2 -2
- package/lib/Button/ButtonPrimary.js +2 -2
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleOcticon.js +7 -9
- package/lib/CounterLabel.js +2 -2
- package/lib/Dialog.js +14 -13
- package/lib/Dropdown.js +2 -2
- package/lib/DropdownStyles.js +6 -6
- package/lib/FilterList.js +1 -1
- package/lib/Flash.js +1 -1
- package/lib/Flex.js +0 -3
- package/lib/Grid.js +3 -4
- package/lib/Header.js +2 -3
- package/lib/Label.js +4 -4
- package/lib/Link.js +12 -1
- package/lib/Overlay.js +36 -126
- package/lib/Pagehead.js +1 -1
- package/lib/Pagination/Pagination.js +2 -3
- package/lib/Popover.js +3 -3
- package/lib/Portal/Portal.js +12 -20
- package/lib/Position.js +27 -46
- package/lib/ProgressBar.js +1 -1
- package/lib/SelectMenu/SelectMenu.js +4 -4
- package/lib/SelectMenu/SelectMenuContext.js +1 -1
- package/lib/SelectMenu/SelectMenuDivider.js +3 -3
- package/lib/SelectMenu/SelectMenuFilter.js +6 -6
- package/lib/SelectMenu/SelectMenuFooter.js +3 -3
- package/lib/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib/SelectMenu/SelectMenuItem.js +4 -4
- package/lib/SelectMenu/SelectMenuList.js +3 -3
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +15 -4
- package/lib/SelectMenu/SelectMenuModal.js +7 -7
- package/lib/SelectMenu/SelectMenuTab.js +3 -3
- package/lib/SelectMenu/SelectMenuTabPanel.js +3 -3
- package/lib/SelectMenu/SelectMenuTabs.js +2 -2
- package/lib/SelectMenu/hooks/useKeyboardNav.js +0 -2
- package/lib/SideNav.js +12 -20
- package/lib/StateLabel.js +4 -4
- package/lib/SubNav.js +3 -5
- package/lib/TabNav.js +3 -3
- package/lib/TextInput.js +59 -22
- package/lib/ThemeProvider.js +15 -32
- package/lib/Timeline.js +29 -24
- package/lib/Tooltip.js +1 -2
- package/lib/UnderlineNav.js +2 -2
- package/lib/behaviors/anchoredPosition.js +9 -17
- package/lib/behaviors/focusTrap.js +14 -32
- package/lib/behaviors/focusZone.js +148 -218
- package/lib/constants.js +2 -3
- package/lib/hooks/index.js +1 -9
- package/lib/hooks/useAnchoredPosition.js +4 -11
- package/lib/hooks/useDialog.js +1 -1
- package/lib/hooks/useFocusTrap.js +8 -26
- package/lib/hooks/useFocusZone.js +7 -7
- package/lib/hooks/useMouseIntent.js +58 -0
- package/lib/hooks/useOnEscapePress.js +10 -53
- package/lib/hooks/useOnOutsideClick.js +35 -62
- package/lib/hooks/useOpenAndCloseFocus.js +3 -8
- package/lib/hooks/useOverlay.js +19 -9
- package/lib/hooks/useSafeTimeout.js +0 -1
- package/lib/index.js +12 -112
- package/lib/polyfills/eventListenerSignal.js +1 -6
- package/lib/stories/Button.stories.js +114 -0
- package/lib/stories/Overlay.stories.js +102 -0
- package/lib/stories/Portal.stories.js +108 -0
- package/lib/stories/ThemeProvider.stories.js +95 -0
- package/lib/stories/useAnchoredPosition.stories.js +349 -0
- package/lib/stories/useFocusTrap.stories.js +278 -0
- package/lib/stories/useFocusZone.stories.js +490 -0
- package/lib/theme-preval.js +2057 -5148
- package/lib/utils/deprecate.js +2 -3
- package/lib/utils/isNumeric.js +0 -1
- package/lib/utils/iterateFocusableElements.js +1 -1
- package/lib/utils/test-deprecations.js +0 -1
- package/lib/utils/test-matchers.js +12 -3
- package/lib/utils/testing.js +4 -4
- package/lib/utils/theme.js +1 -1
- package/lib/utils/{types/AriaRole.js → types.js} +0 -0
- package/lib/utils/uniqueId.js +0 -1
- package/lib-esm/AvatarPair.js +5 -6
- package/lib-esm/AvatarStack.js +11 -11
- package/lib-esm/BaseStyles.js +16 -16
- package/lib-esm/BorderBox.js +3 -5
- package/lib-esm/Box.js +2 -2
- package/lib-esm/BranchName.js +1 -1
- package/lib-esm/{Breadcrumbs.js → Breadcrumb.js} +22 -32
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Button/ButtonTableList.js +1 -1
- package/lib-esm/CircleBadge.js +1 -1
- package/lib-esm/CircleOcticon.js +6 -9
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog.js +12 -10
- package/lib-esm/Dropdown.js +2 -2
- package/lib-esm/DropdownStyles.js +6 -6
- package/lib-esm/FilterList.js +1 -1
- package/lib-esm/Flash.js +1 -1
- package/lib-esm/Flex.js +0 -4
- package/lib-esm/Grid.js +2 -5
- package/lib-esm/Header.js +0 -1
- package/lib-esm/Label.js +2 -2
- package/lib-esm/Link.js +12 -1
- package/lib-esm/Overlay.js +38 -119
- package/lib-esm/Pagehead.js +1 -1
- package/lib-esm/Pagination/Pagination.js +2 -3
- package/lib-esm/Popover.js +3 -3
- package/lib-esm/Portal/Portal.js +12 -19
- package/lib-esm/Portal/index.js +1 -1
- package/lib-esm/Position.js +20 -45
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/SelectMenu/SelectMenu.js +3 -3
- package/lib-esm/SelectMenu/SelectMenuContext.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.js +4 -4
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuList.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +10 -5
- package/lib-esm/SelectMenu/SelectMenuModal.js +5 -5
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib-esm/SelectMenu/hooks/useKeyboardNav.js +0 -2
- package/lib-esm/SideNav.js +7 -16
- package/lib-esm/StateLabel.js +4 -4
- package/lib-esm/SubNav.js +4 -7
- package/lib-esm/TabNav.js +4 -5
- package/lib-esm/TextInput.js +49 -22
- package/lib-esm/ThemeProvider.js +16 -31
- package/lib-esm/Timeline.js +24 -19
- package/lib-esm/Tooltip.js +1 -2
- package/lib-esm/UnderlineNav.js +3 -4
- package/lib-esm/behaviors/anchoredPosition.js +9 -17
- package/lib-esm/behaviors/focusTrap.js +14 -32
- package/lib-esm/behaviors/focusZone.js +148 -213
- package/lib-esm/constants.js +1 -2
- package/lib-esm/hooks/index.js +1 -2
- package/lib-esm/hooks/useAnchoredPosition.js +5 -10
- package/lib-esm/hooks/useDialog.js +1 -1
- package/lib-esm/hooks/useFocusTrap.js +8 -25
- package/lib-esm/hooks/useFocusZone.js +5 -5
- package/lib-esm/hooks/useMouseIntent.js +50 -0
- package/lib-esm/hooks/useOnEscapePress.js +10 -53
- package/lib-esm/hooks/useOnOutsideClick.js +37 -62
- package/lib-esm/hooks/useOpenAndCloseFocus.js +3 -8
- package/lib-esm/hooks/useOverlay.js +18 -9
- package/lib-esm/hooks/useSafeTimeout.js +0 -1
- package/lib-esm/index.js +10 -22
- package/lib-esm/polyfills/eventListenerSignal.js +1 -6
- package/lib-esm/stories/Button.stories.js +79 -0
- package/lib-esm/stories/Overlay.stories.js +80 -0
- package/lib-esm/stories/Portal.stories.js +72 -0
- package/lib-esm/stories/ThemeProvider.stories.js +76 -0
- package/lib-esm/stories/useAnchoredPosition.stories.js +311 -0
- package/lib-esm/stories/useFocusTrap.stories.js +234 -0
- package/lib-esm/stories/useFocusZone.stories.js +445 -0
- package/lib-esm/theme-preval.js +2057 -5148
- package/lib-esm/utils/deprecate.js +2 -3
- package/lib-esm/utils/isNumeric.js +0 -1
- package/lib-esm/utils/iterateFocusableElements.js +1 -1
- package/lib-esm/utils/test-deprecations.js +1 -1
- package/lib-esm/utils/test-matchers.js +11 -3
- package/lib-esm/utils/testing.js +6 -6
- package/lib-esm/utils/theme.js +1 -1
- package/lib-esm/utils/{test-helpers.d.ts → types.js} +0 -0
- package/lib-esm/utils/uniqueId.js +0 -1
- package/package.json +95 -103
- package/codemods/__tests__/deprecateUtilityComponents.js +0 -200
- package/codemods/__tests__/removeSystemProps.js +0 -225
- package/codemods/deprecateUtilityComponents.js +0 -111
- package/codemods/removeSystemProps.js +0 -312
- package/lib/ActionList/Divider.d.ts +0 -9
- package/lib/ActionList/Divider.js +0 -40
- package/lib/ActionList/Group.d.ts +0 -28
- package/lib/ActionList/Group.js +0 -35
- package/lib/ActionList/Header.d.ts +0 -29
- package/lib/ActionList/Header.js +0 -51
- package/lib/ActionList/Item.d.ts +0 -92
- package/lib/ActionList/Item.js +0 -288
- package/lib/ActionList/List.d.ts +0 -88
- package/lib/ActionList/List.js +0 -199
- package/lib/ActionList/index.d.ts +0 -17
- package/lib/ActionList/index.js +0 -29
- package/lib/ActionMenu.d.ts +0 -40
- package/lib/ActionMenu.js +0 -103
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +0 -62
- package/lib/AnchoredOverlay/AnchoredOverlay.js +0 -124
- package/lib/AnchoredOverlay/index.d.ts +0 -2
- package/lib/AnchoredOverlay/index.js +0 -13
- package/lib/Autocomplete/Autocomplete.d.ts +0 -40
- package/lib/Autocomplete/Autocomplete.js +0 -68
- package/lib/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib/Autocomplete/AutocompleteContext.js +0 -11
- package/lib/Autocomplete/AutocompleteInput.d.ts +0 -9
- package/lib/Autocomplete/AutocompleteInput.js +0 -150
- package/lib/Autocomplete/AutocompleteMenu.d.ts +0 -71
- package/lib/Autocomplete/AutocompleteMenu.js +0 -223
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +0 -17
- package/lib/Autocomplete/AutocompleteOverlay.js +0 -69
- package/lib/Autocomplete/index.d.ts +0 -2
- package/lib/Autocomplete/index.js +0 -15
- package/lib/Avatar.d.ts +0 -15
- package/lib/AvatarPair.d.ts +0 -8
- package/lib/AvatarStack.d.ts +0 -8
- package/lib/BaseStyles.d.ts +0 -14
- package/lib/BorderBox.d.ts +0 -7
- package/lib/Box.d.ts +0 -6
- package/lib/BranchName.d.ts +0 -6
- package/lib/Breadcrumbs.d.ts +0 -40
- package/lib/Button/Button.d.ts +0 -284
- package/lib/Button/ButtonBase.d.ts +0 -12
- package/lib/Button/ButtonClose.d.ts +0 -321
- package/lib/Button/ButtonDanger.d.ts +0 -284
- package/lib/Button/ButtonGroup.d.ts +0 -4
- package/lib/Button/ButtonInvisible.d.ts +0 -284
- package/lib/Button/ButtonOutline.d.ts +0 -284
- package/lib/Button/ButtonPrimary.d.ts +0 -284
- package/lib/Button/ButtonStyles.d.ts +0 -2
- package/lib/Button/ButtonTableList.d.ts +0 -6
- package/lib/Button/index.d.ts +0 -16
- package/lib/Caret.d.ts +0 -21
- package/lib/CircleBadge.d.ts +0 -25
- package/lib/CircleOcticon.d.ts +0 -391
- package/lib/CounterLabel.d.ts +0 -8
- package/lib/Details.d.ts +0 -6
- package/lib/Dialog/ConfirmationDialog.d.ts +0 -44
- package/lib/Dialog/ConfirmationDialog.js +0 -191
- package/lib/Dialog/Dialog.d.ts +0 -167
- package/lib/Dialog/Dialog.js +0 -304
- package/lib/Dialog.d.ts +0 -406
- package/lib/Dropdown.d.ts +0 -1262
- package/lib/DropdownMenu/DropdownButton.d.ts +0 -323
- package/lib/DropdownMenu/DropdownButton.js +0 -31
- package/lib/DropdownMenu/DropdownMenu.d.ts +0 -43
- package/lib/DropdownMenu/DropdownMenu.js +0 -94
- package/lib/DropdownMenu/index.d.ts +0 -4
- package/lib/DropdownMenu/index.js +0 -21
- package/lib/DropdownStyles.d.ts +0 -3
- package/lib/FilterList.d.ts +0 -321
- package/lib/FilteredActionList/FilteredActionList.d.ts +0 -16
- package/lib/FilteredActionList/FilteredActionList.js +0 -137
- package/lib/FilteredActionList/index.d.ts +0 -2
- package/lib/FilteredActionList/index.js +0 -13
- package/lib/FilteredSearch.d.ts +0 -6
- package/lib/Flash.d.ts +0 -9
- package/lib/Flex.d.ts +0 -7
- package/lib/FormGroup.d.ts +0 -12
- package/lib/Grid.d.ts +0 -7
- package/lib/Header.d.ts +0 -24
- package/lib/Heading.d.ts +0 -6
- package/lib/Label.d.ts +0 -11
- package/lib/LabelGroup.d.ts +0 -6
- package/lib/Link.d.ts +0 -10
- package/lib/Overlay.d.ts +0 -63
- package/lib/Pagehead.d.ts +0 -6
- package/lib/Pagination/Pagination.d.ts +0 -24
- package/lib/Pagination/index.d.ts +0 -3
- package/lib/Pagination/model.d.ts +0 -26
- package/lib/PointerBox.d.ts +0 -11
- package/lib/Popover.d.ts +0 -21
- package/lib/Portal/Portal.d.ts +0 -25
- package/lib/Portal/index.d.ts +0 -4
- package/lib/Position.d.ts +0 -34
- package/lib/ProgressBar.d.ts +0 -21
- package/lib/SelectMenu/SelectMenu.d.ts +0 -1832
- package/lib/SelectMenu/SelectMenuContext.d.ts +0 -8
- package/lib/SelectMenu/SelectMenuDivider.d.ts +0 -6
- package/lib/SelectMenu/SelectMenuFilter.d.ts +0 -9
- package/lib/SelectMenu/SelectMenuFooter.d.ts +0 -6
- package/lib/SelectMenu/SelectMenuHeader.d.ts +0 -11
- package/lib/SelectMenu/SelectMenuItem.d.ts +0 -15
- package/lib/SelectMenu/SelectMenuList.d.ts +0 -6
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +0 -7
- package/lib/SelectMenu/SelectMenuModal.d.ts +0 -15
- package/lib/SelectMenu/SelectMenuTab.d.ts +0 -14
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +0 -13
- package/lib/SelectMenu/SelectMenuTabs.d.ts +0 -11
- package/lib/SelectMenu/hooks/useKeyboardNav.d.ts +0 -2
- package/lib/SelectMenu/index.d.ts +0 -2
- package/lib/SelectPanel/SelectPanel.d.ts +0 -25
- package/lib/SelectPanel/SelectPanel.js +0 -147
- package/lib/SelectPanel/index.d.ts +0 -2
- package/lib/SelectPanel/index.js +0 -13
- package/lib/SideNav.d.ts +0 -31
- package/lib/Spinner.d.ts +0 -17
- package/lib/Spinner.js +0 -60
- package/lib/StateLabel.d.ts +0 -16
- package/lib/StyledOcticon.d.ts +0 -12
- package/lib/SubNav.d.ts +0 -32
- package/lib/TabNav.d.ts +0 -20
- package/lib/Text.d.ts +0 -6
- package/lib/TextInput.d.ts +0 -14
- package/lib/TextInputWithTokens.d.ts +0 -323
- package/lib/TextInputWithTokens.js +0 -244
- package/lib/ThemeProvider.d.ts +0 -26
- package/lib/Timeline.d.ts +0 -407
- package/lib/Token/IssueLabelToken.d.ts +0 -14
- package/lib/Token/IssueLabelToken.js +0 -144
- package/lib/Token/ProfileToken.d.ts +0 -7
- package/lib/Token/ProfileToken.js +0 -53
- package/lib/Token/Token.d.ts +0 -15
- package/lib/Token/Token.js +0 -94
- package/lib/Token/TokenBase.d.ts +0 -17
- package/lib/Token/TokenBase.js +0 -108
- package/lib/Token/_RemoveTokenButton.d.ts +0 -12
- package/lib/Token/_RemoveTokenButton.js +0 -77
- package/lib/Token/_TokenTextContainer.d.ts +0 -3
- package/lib/Token/_TokenTextContainer.js +0 -28
- package/lib/Token/index.d.ts +0 -3
- package/lib/Token/index.js +0 -31
- package/lib/Tooltip.d.ts +0 -18
- package/lib/Truncate.d.ts +0 -11
- package/lib/UnderlineNav.d.ts +0 -25
- package/lib/_TextInputWrapper.d.ts +0 -10
- package/lib/_TextInputWrapper.js +0 -51
- package/lib/_UnstyledTextInput.d.ts +0 -2
- package/lib/_UnstyledTextInput.js +0 -20
- package/lib/behaviors/anchoredPosition.d.ts +0 -89
- package/lib/behaviors/focusTrap.d.ts +0 -12
- package/lib/behaviors/focusZone.d.ts +0 -137
- package/lib/constants.d.ts +0 -20
- package/lib/hooks/index.d.ts +0 -11
- package/lib/hooks/useAnchoredPosition.d.ts +0 -20
- package/lib/hooks/useCombinedRefs.d.ts +0 -10
- package/lib/hooks/useCombinedRefs.js +0 -49
- package/lib/hooks/useDetails.d.ts +0 -17
- package/lib/hooks/useDialog.d.ts +0 -16
- package/lib/hooks/useFocusTrap.d.ts +0 -32
- package/lib/hooks/useFocusZone.d.ts +0 -23
- package/lib/hooks/useOnEscapePress.d.ts +0 -23
- package/lib/hooks/useOnOutsideClick.d.ts +0 -8
- package/lib/hooks/useOpenAndCloseFocus.d.ts +0 -8
- package/lib/hooks/useOverlay.d.ts +0 -15
- package/lib/hooks/useProvidedRefOrCreate.d.ts +0 -10
- package/lib/hooks/useProvidedStateOrCreate.d.ts +0 -10
- package/lib/hooks/useProvidedStateOrCreate.js +0 -27
- package/lib/hooks/useRenderForcingRef.d.ts +0 -8
- package/lib/hooks/useRenderForcingRef.js +0 -25
- package/lib/hooks/useResizeObserver.d.ts +0 -1
- package/lib/hooks/useResizeObserver.js +0 -20
- package/lib/hooks/useSafeTimeout.d.ts +0 -12
- package/lib/hooks/useScrollFlash.d.ts +0 -6
- package/lib/hooks/useScrollFlash.js +0 -29
- package/lib/index.d.ts +0 -114
- package/lib/polyfills/eventListenerSignal.d.ts +0 -6
- package/lib/sx.d.ts +0 -6
- package/lib/theme-preval.d.ts +0 -49
- package/lib/theme.d.ts +0 -2
- package/lib/utils/deprecate.d.ts +0 -18
- package/lib/utils/isNumeric.d.ts +0 -1
- package/lib/utils/iterateFocusableElements.d.ts +0 -42
- package/lib/utils/scrollIntoViewingArea.d.ts +0 -1
- package/lib/utils/scrollIntoViewingArea.js +0 -39
- package/lib/utils/ssr.d.ts +0 -1
- package/lib/utils/ssr.js +0 -19
- package/lib/utils/test-deprecations.d.ts +0 -1
- package/lib/utils/test-helpers.d.ts +0 -0
- package/lib/utils/test-helpers.js +0 -9
- package/lib/utils/test-matchers.d.ts +0 -1
- package/lib/utils/testing.d.ts +0 -1028
- package/lib/utils/theme.d.ts +0 -9
- package/lib/utils/types/AriaRole.d.ts +0 -4
- package/lib/utils/types/ComponentProps.d.ts +0 -9
- package/lib/utils/types/ComponentProps.js +0 -1
- package/lib/utils/types/Flatten.d.ts +0 -4
- package/lib/utils/types/Flatten.js +0 -1
- package/lib/utils/types/Merge.d.ts +0 -19
- package/lib/utils/types/Merge.js +0 -1
- package/lib/utils/types/index.d.ts +0 -4
- package/lib/utils/types/index.js +0 -57
- package/lib/utils/uniqueId.d.ts +0 -1
- package/lib/utils/userAgent.d.ts +0 -1
- package/lib-esm/ActionList/Divider.d.ts +0 -9
- package/lib-esm/ActionList/Divider.js +0 -23
- package/lib-esm/ActionList/Group.d.ts +0 -28
- package/lib-esm/ActionList/Group.js +0 -24
- package/lib-esm/ActionList/Header.d.ts +0 -29
- package/lib-esm/ActionList/Header.js +0 -33
- package/lib-esm/ActionList/Item.d.ts +0 -92
- package/lib-esm/ActionList/Item.js +0 -253
- package/lib-esm/ActionList/List.d.ts +0 -88
- package/lib-esm/ActionList/List.js +0 -181
- package/lib-esm/ActionList/index.d.ts +0 -17
- package/lib-esm/ActionList/index.js +0 -18
- package/lib-esm/ActionMenu.d.ts +0 -40
- package/lib-esm/ActionMenu.js +0 -82
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +0 -62
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +0 -104
- package/lib-esm/AnchoredOverlay/index.d.ts +0 -2
- package/lib-esm/AnchoredOverlay/index.js +0 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +0 -40
- package/lib-esm/Autocomplete/Autocomplete.js +0 -47
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/lib-esm/Autocomplete/AutocompleteContext.js +0 -2
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +0 -9
- package/lib-esm/Autocomplete/AutocompleteInput.js +0 -131
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +0 -71
- package/lib-esm/Autocomplete/AutocompleteMenu.js +0 -204
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +0 -17
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +0 -51
- package/lib-esm/Autocomplete/index.d.ts +0 -2
- package/lib-esm/Autocomplete/index.js +0 -1
- package/lib-esm/Avatar.d.ts +0 -15
- package/lib-esm/AvatarPair.d.ts +0 -8
- package/lib-esm/AvatarStack.d.ts +0 -8
- package/lib-esm/BaseStyles.d.ts +0 -14
- package/lib-esm/BorderBox.d.ts +0 -7
- package/lib-esm/Box.d.ts +0 -6
- package/lib-esm/BranchName.d.ts +0 -6
- package/lib-esm/Breadcrumbs.d.ts +0 -40
- package/lib-esm/Button/Button.d.ts +0 -284
- package/lib-esm/Button/ButtonBase.d.ts +0 -12
- package/lib-esm/Button/ButtonClose.d.ts +0 -321
- package/lib-esm/Button/ButtonDanger.d.ts +0 -284
- package/lib-esm/Button/ButtonGroup.d.ts +0 -4
- package/lib-esm/Button/ButtonInvisible.d.ts +0 -284
- package/lib-esm/Button/ButtonOutline.d.ts +0 -284
- package/lib-esm/Button/ButtonPrimary.d.ts +0 -284
- package/lib-esm/Button/ButtonStyles.d.ts +0 -2
- package/lib-esm/Button/ButtonTableList.d.ts +0 -6
- package/lib-esm/Button/index.d.ts +0 -16
- package/lib-esm/Caret.d.ts +0 -21
- package/lib-esm/CircleBadge.d.ts +0 -25
- package/lib-esm/CircleOcticon.d.ts +0 -391
- package/lib-esm/CounterLabel.d.ts +0 -8
- package/lib-esm/Details.d.ts +0 -6
- package/lib-esm/Dialog/ConfirmationDialog.d.ts +0 -44
- package/lib-esm/Dialog/ConfirmationDialog.js +0 -169
- package/lib-esm/Dialog/Dialog.d.ts +0 -167
- package/lib-esm/Dialog/Dialog.js +0 -274
- package/lib-esm/Dialog.d.ts +0 -406
- package/lib-esm/Dropdown.d.ts +0 -1262
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +0 -323
- package/lib-esm/DropdownMenu/DropdownButton.js +0 -16
- package/lib-esm/DropdownMenu/DropdownMenu.d.ts +0 -43
- package/lib-esm/DropdownMenu/DropdownMenu.js +0 -77
- package/lib-esm/DropdownMenu/index.d.ts +0 -4
- package/lib-esm/DropdownMenu/index.js +0 -2
- package/lib-esm/DropdownStyles.d.ts +0 -3
- package/lib-esm/FilterList.d.ts +0 -321
- package/lib-esm/FilteredActionList/FilteredActionList.d.ts +0 -16
- package/lib-esm/FilteredActionList/FilteredActionList.js +0 -109
- package/lib-esm/FilteredActionList/index.d.ts +0 -2
- package/lib-esm/FilteredActionList/index.js +0 -1
- package/lib-esm/FilteredSearch.d.ts +0 -6
- package/lib-esm/Flash.d.ts +0 -9
- package/lib-esm/Flex.d.ts +0 -7
- package/lib-esm/FormGroup.d.ts +0 -12
- package/lib-esm/Grid.d.ts +0 -7
- package/lib-esm/Header.d.ts +0 -24
- package/lib-esm/Heading.d.ts +0 -6
- package/lib-esm/Label.d.ts +0 -11
- package/lib-esm/LabelGroup.d.ts +0 -6
- package/lib-esm/Link.d.ts +0 -10
- package/lib-esm/Overlay.d.ts +0 -63
- package/lib-esm/Pagehead.d.ts +0 -6
- package/lib-esm/Pagination/Pagination.d.ts +0 -24
- package/lib-esm/Pagination/index.d.ts +0 -3
- package/lib-esm/Pagination/model.d.ts +0 -26
- package/lib-esm/PointerBox.d.ts +0 -11
- package/lib-esm/Popover.d.ts +0 -21
- package/lib-esm/Portal/Portal.d.ts +0 -25
- package/lib-esm/Portal/index.d.ts +0 -4
- package/lib-esm/Position.d.ts +0 -34
- package/lib-esm/ProgressBar.d.ts +0 -21
- package/lib-esm/SelectMenu/SelectMenu.d.ts +0 -1832
- package/lib-esm/SelectMenu/SelectMenuContext.d.ts +0 -8
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +0 -6
- package/lib-esm/SelectMenu/SelectMenuFilter.d.ts +0 -9
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +0 -6
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +0 -11
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +0 -15
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +0 -6
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +0 -7
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +0 -15
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +0 -14
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +0 -13
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +0 -11
- package/lib-esm/SelectMenu/hooks/useKeyboardNav.d.ts +0 -2
- package/lib-esm/SelectMenu/index.d.ts +0 -2
- package/lib-esm/SelectPanel/SelectPanel.d.ts +0 -25
- package/lib-esm/SelectPanel/SelectPanel.js +0 -127
- package/lib-esm/SelectPanel/index.d.ts +0 -2
- package/lib-esm/SelectPanel/index.js +0 -1
- package/lib-esm/SideNav.d.ts +0 -31
- package/lib-esm/Spinner.d.ts +0 -17
- package/lib-esm/Spinner.js +0 -46
- package/lib-esm/StateLabel.d.ts +0 -16
- package/lib-esm/StyledOcticon.d.ts +0 -12
- package/lib-esm/SubNav.d.ts +0 -32
- package/lib-esm/TabNav.d.ts +0 -20
- package/lib-esm/Text.d.ts +0 -6
- package/lib-esm/TextInput.d.ts +0 -14
- package/lib-esm/TextInputWithTokens.d.ts +0 -323
- package/lib-esm/TextInputWithTokens.js +0 -219
- package/lib-esm/ThemeProvider.d.ts +0 -26
- package/lib-esm/Timeline.d.ts +0 -407
- package/lib-esm/Token/IssueLabelToken.d.ts +0 -14
- package/lib-esm/Token/IssueLabelToken.js +0 -124
- package/lib-esm/Token/ProfileToken.d.ts +0 -7
- package/lib-esm/Token/ProfileToken.js +0 -33
- package/lib-esm/Token/Token.d.ts +0 -15
- package/lib-esm/Token/Token.js +0 -73
- package/lib-esm/Token/TokenBase.d.ts +0 -17
- package/lib-esm/Token/TokenBase.js +0 -87
- package/lib-esm/Token/_RemoveTokenButton.d.ts +0 -12
- package/lib-esm/Token/_RemoveTokenButton.js +0 -60
- package/lib-esm/Token/_TokenTextContainer.d.ts +0 -3
- package/lib-esm/Token/_TokenTextContainer.js +0 -15
- package/lib-esm/Token/index.d.ts +0 -3
- package/lib-esm/Token/index.js +0 -3
- package/lib-esm/Tooltip.d.ts +0 -18
- package/lib-esm/Truncate.d.ts +0 -11
- package/lib-esm/UnderlineNav.d.ts +0 -25
- package/lib-esm/_TextInputWrapper.d.ts +0 -10
- package/lib-esm/_TextInputWrapper.js +0 -31
- package/lib-esm/_UnstyledTextInput.d.ts +0 -2
- package/lib-esm/_UnstyledTextInput.js +0 -7
- package/lib-esm/behaviors/anchoredPosition.d.ts +0 -89
- package/lib-esm/behaviors/focusTrap.d.ts +0 -12
- package/lib-esm/behaviors/focusZone.d.ts +0 -137
- package/lib-esm/constants.d.ts +0 -20
- package/lib-esm/hooks/index.d.ts +0 -11
- package/lib-esm/hooks/useAnchoredPosition.d.ts +0 -20
- package/lib-esm/hooks/useCombinedRefs.d.ts +0 -10
- package/lib-esm/hooks/useCombinedRefs.js +0 -36
- package/lib-esm/hooks/useDetails.d.ts +0 -17
- package/lib-esm/hooks/useDialog.d.ts +0 -16
- package/lib-esm/hooks/useFocusTrap.d.ts +0 -32
- package/lib-esm/hooks/useFocusZone.d.ts +0 -23
- package/lib-esm/hooks/useOnEscapePress.d.ts +0 -23
- package/lib-esm/hooks/useOnOutsideClick.d.ts +0 -8
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +0 -8
- package/lib-esm/hooks/useOverlay.d.ts +0 -15
- package/lib-esm/hooks/useProvidedRefOrCreate.d.ts +0 -10
- package/lib-esm/hooks/useProvidedStateOrCreate.d.ts +0 -10
- package/lib-esm/hooks/useProvidedStateOrCreate.js +0 -20
- package/lib-esm/hooks/useRenderForcingRef.d.ts +0 -8
- package/lib-esm/hooks/useRenderForcingRef.js +0 -18
- package/lib-esm/hooks/useResizeObserver.d.ts +0 -1
- package/lib-esm/hooks/useResizeObserver.js +0 -10
- package/lib-esm/hooks/useSafeTimeout.d.ts +0 -12
- package/lib-esm/hooks/useScrollFlash.d.ts +0 -6
- package/lib-esm/hooks/useScrollFlash.js +0 -22
- package/lib-esm/index.d.ts +0 -114
- package/lib-esm/polyfills/eventListenerSignal.d.ts +0 -6
- package/lib-esm/sx.d.ts +0 -6
- package/lib-esm/theme-preval.d.ts +0 -49
- package/lib-esm/theme.d.ts +0 -2
- package/lib-esm/utils/deprecate.d.ts +0 -18
- package/lib-esm/utils/isNumeric.d.ts +0 -1
- package/lib-esm/utils/iterateFocusableElements.d.ts +0 -42
- package/lib-esm/utils/scrollIntoViewingArea.d.ts +0 -1
- package/lib-esm/utils/scrollIntoViewingArea.js +0 -30
- package/lib-esm/utils/ssr.d.ts +0 -1
- package/lib-esm/utils/ssr.js +0 -1
- package/lib-esm/utils/test-deprecations.d.ts +0 -1
- package/lib-esm/utils/test-helpers.js +0 -7
- package/lib-esm/utils/test-matchers.d.ts +0 -1
- package/lib-esm/utils/testing.d.ts +0 -1028
- package/lib-esm/utils/theme.d.ts +0 -9
- package/lib-esm/utils/types/AriaRole.d.ts +0 -4
- package/lib-esm/utils/types/AriaRole.js +0 -1
- package/lib-esm/utils/types/ComponentProps.d.ts +0 -9
- package/lib-esm/utils/types/ComponentProps.js +0 -1
- package/lib-esm/utils/types/Flatten.d.ts +0 -4
- package/lib-esm/utils/types/Flatten.js +0 -1
- package/lib-esm/utils/types/Merge.d.ts +0 -19
- package/lib-esm/utils/types/Merge.js +0 -1
- package/lib-esm/utils/types/index.d.ts +0 -4
- package/lib-esm/utils/types/index.js +0 -4
- package/lib-esm/utils/uniqueId.d.ts +0 -1
- package/lib-esm/utils/userAgent.d.ts +0 -1
package/lib/Dropdown.js
CHANGED
@@ -67,12 +67,12 @@ const DropdownCaret = _styledComponents.default.div.withConfig({
|
|
67
67
|
const DropdownMenu = _styledComponents.default.ul.withConfig({
|
68
68
|
displayName: "Dropdown__DropdownMenu",
|
69
69
|
componentId: "sc-16yoecj-2"
|
70
|
-
})(["background-clip:padding-box;background-color:", ";border:1px solid ", ";border-radius:", ";box-shadow:", ";left:0;list-style:none;margin-top:2px;padding:5px 0 5px 0 !important;position:absolute;top:100%;width:160px;z-index:100;&::before{position:absolute;display:inline-block;content:'';}&::after{position:absolute;display:inline-block;content:'';}&::before{border:8px solid transparent;border-bottom-color:", ";}&::after{border:7px solid transparent;border-bottom-color:", ";}> ul{list-style:none;}", ";", ";", ";"], (0, _constants.get)('colors.
|
70
|
+
})(["background-clip:padding-box;background-color:", ";border:1px solid ", ";border-radius:", ";box-shadow:", ";left:0;list-style:none;margin-top:2px;padding:5px 0 5px 0 !important;position:absolute;top:100%;width:160px;z-index:100;&::before{position:absolute;display:inline-block;content:'';}&::after{position:absolute;display:inline-block;content:'';}&::before{border:8px solid transparent;border-bottom-color:", ";}&::after{border:7px solid transparent;border-bottom-color:", ";}> ul{list-style:none;}", ";", ";", ";"], (0, _constants.get)('colors.bg.overlay'), (0, _constants.get)('colors.border.overlay'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.dropdown.shadow'), (0, _constants.get)('colors.bg.overlay'), (0, _constants.get)('colors.bg.overlay'), props => props.direction ? (0, _DropdownStyles.default)(props.theme, props.direction) : '', _constants.COMMON, _sx.default);
|
71
71
|
|
72
72
|
const DropdownItem = _styledComponents.default.li.withConfig({
|
73
73
|
displayName: "Dropdown__DropdownItem",
|
74
74
|
componentId: "sc-16yoecj-3"
|
75
|
-
})(["display:block;padding:", " 10px ", " 15px;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;a{color:", ";text-decoration:none;display:block;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;}&:focus,a:focus{color:", ";text-decoration:none;background-color:", ";}&:hover,&:hover a{color:", ";text-decoration:none;background-color:", ";outline:none;}", ";", ";"], (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.
|
75
|
+
})(["display:block;padding:", " 10px ", " 15px;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;a{color:", ";text-decoration:none;display:block;overflow:hidden;color:", ";text-overflow:ellipsis;white-space:nowrap;}&:focus,a:focus{color:", ";text-decoration:none;background-color:", ";}&:hover,&:hover a{color:", ";text-decoration:none;background-color:", ";outline:none;}", ";", ";"], (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.state.hover.primaryText'), (0, _constants.get)('colors.state.hover.primaryBg'), (0, _constants.get)('colors.state.hover.primaryText'), (0, _constants.get)('colors.state.hover.primaryBg'), _constants.COMMON, _sx.default);
|
76
76
|
|
77
77
|
DropdownMenu.defaultProps = {
|
78
78
|
direction: 'sw'
|
package/lib/DropdownStyles.js
CHANGED
@@ -22,7 +22,7 @@ const getDirectionStyles = (theme, direction) => {
|
|
22
22
|
right: -16px;
|
23
23
|
left: auto;
|
24
24
|
border-color: transparent;
|
25
|
-
border-left-color: ${(0, _constants.get)('colors.border.
|
25
|
+
border-left-color: ${(0, _constants.get)('colors.border.overlay')(theme)};
|
26
26
|
}
|
27
27
|
|
28
28
|
&::after {
|
@@ -30,7 +30,7 @@ const getDirectionStyles = (theme, direction) => {
|
|
30
30
|
right: -14px;
|
31
31
|
left: auto;
|
32
32
|
border-color: transparent;
|
33
|
-
border-left-color: ${(0, _constants.get)('colors.border.
|
33
|
+
border-left-color: ${(0, _constants.get)('colors.border.overlay')(theme)};
|
34
34
|
}
|
35
35
|
`,
|
36
36
|
e: `
|
@@ -44,14 +44,14 @@ const getDirectionStyles = (theme, direction) => {
|
|
44
44
|
top: 10px;
|
45
45
|
left: -16px;
|
46
46
|
border-color: transparent;
|
47
|
-
border-right-color: ${(0, _constants.get)('colors.border.
|
47
|
+
border-right-color: ${(0, _constants.get)('colors.border.overlay')(theme)};
|
48
48
|
}
|
49
49
|
|
50
50
|
&::after {
|
51
51
|
top: 11px;
|
52
52
|
left: -14px;
|
53
53
|
border-color: transparent;
|
54
|
-
border-right-color: ${(0, _constants.get)('colors.border.
|
54
|
+
border-right-color: ${(0, _constants.get)('colors.border.overlay')(theme)};
|
55
55
|
}
|
56
56
|
`,
|
57
57
|
ne: `
|
@@ -69,7 +69,7 @@ const getDirectionStyles = (theme, direction) => {
|
|
69
69
|
&::before {
|
70
70
|
bottom: -8px;
|
71
71
|
left: 9px;
|
72
|
-
border-top: 8px solid ${(0, _constants.get)('colors.border.
|
72
|
+
border-top: 8px solid ${(0, _constants.get)('colors.border.overlay')(theme)};
|
73
73
|
border-bottom: 0;
|
74
74
|
border-left: 8px solid transparent;
|
75
75
|
}
|
@@ -77,7 +77,7 @@ const getDirectionStyles = (theme, direction) => {
|
|
77
77
|
&::after {
|
78
78
|
bottom: -7px;
|
79
79
|
left: 10px;
|
80
|
-
border-top: 7px solid ${(0, _constants.get)('colors.border.
|
80
|
+
border-top: 7px solid ${(0, _constants.get)('colors.border.overlay')(theme)};
|
81
81
|
border-right: 7px solid transparent;
|
82
82
|
border-bottom: 0;
|
83
83
|
border-left: 7px solid transparent;
|
package/lib/FilterList.js
CHANGED
@@ -36,7 +36,7 @@ FilterList.displayName = "FilterList";
|
|
36
36
|
const FilterListItemBase = _styledComponents.default.a.withConfig({
|
37
37
|
displayName: "FilterList__FilterListItemBase",
|
38
38
|
componentId: "sc-1l4pxmz-1"
|
39
|
-
})(["position:relative;display:block;padding:", ";margin:", ";overflow:hidden;font-size:", ";color:", ";background-color:", "!important;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-radius:", ";&:hover{text-decoration:none;background-color:", ";}&:active{color:", ";background-color:", ";}.count{float:right;font-weight:", ";}", ";", ";"], props => props.small ? `${(0, _constants.get)('space.1')(props)} 10px` : `${(0, _constants.get)('space.2')(props)} 11px`, props => props.small ? '0 0 2px' : '0 0 5px 0', (0, _constants.get)('fontSizes.1'), props => props.selected ? (0, _constants.get)('colors.
|
39
|
+
})(["position:relative;display:block;padding:", ";margin:", ";overflow:hidden;font-size:", ";color:", ";background-color:", "!important;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;cursor:pointer;border-radius:", ";&:hover{text-decoration:none;background-color:", ";}&:active{color:", ";background-color:", ";}.count{float:right;font-weight:", ";}", ";", ";"], props => props.small ? `${(0, _constants.get)('space.1')(props)} 10px` : `${(0, _constants.get)('space.2')(props)} 11px`, props => props.small ? '0 0 2px' : '0 0 5px 0', (0, _constants.get)('fontSizes.1'), props => props.selected ? (0, _constants.get)('colors.state.selected.primaryText') : (0, _constants.get)('colors.text.secondary'), props => props.selected ? (0, _constants.get)('colors.state.selected.primaryBg') : '', (0, _constants.get)('radii.1'), (0, _constants.get)('colors.bg.tertiary'), (0, _constants.get)('colors.state.selected.primaryText'), (0, _constants.get)('colors.state.selected.primaryBg'), (0, _constants.get)('fontWeights.bold'), _constants.COMMON, _sx.default);
|
40
40
|
|
41
41
|
function FilterListItem({
|
42
42
|
children,
|
package/lib/Flash.js
CHANGED
@@ -55,7 +55,7 @@ const variants = (0, _styledSystem.variant)({
|
|
55
55
|
const Flash = _styledComponents.default.div.withConfig({
|
56
56
|
displayName: "Flash",
|
57
57
|
componentId: "sc-4y90bn-0"
|
58
|
-
})(["position:relative;color:", ";padding:", ";border-style:solid;border-width:", ";border-radius:", ";margin-top:", ";p:last-child{margin-bottom:0;}svg{margin-right:", ";}", ";", ";", ";"], (0, _constants.get)('colors.
|
58
|
+
})(["position:relative;color:", ";padding:", ";border-style:solid;border-width:", ";border-radius:", ";margin-top:", ";p:last-child{margin-bottom:0;}svg{margin-right:", ";}", ";", ";", ";"], (0, _constants.get)('colors.text.primary'), (0, _constants.get)('space.3'), props => props.full ? '1px 0px' : '1px', props => props.full ? '0' : (0, _constants.get)('radii.2'), props => props.full ? '-1px' : '0', (0, _constants.get)('space.2'), _constants.COMMON, variants, _sx.default);
|
59
59
|
|
60
60
|
Flash.defaultProps = {
|
61
61
|
variant: 'default'
|
package/lib/Flex.js
CHANGED
@@ -11,9 +11,6 @@ var _Box = _interopRequireDefault(require("./Box"));
|
|
11
11
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
|
14
|
-
/**
|
15
|
-
* @deprecated Use the Box component instead (i.e. <Flex> → <Box display="flex">)
|
16
|
-
*/
|
17
14
|
const Flex = (0, _styledComponents.default)(_Box.default).withConfig({
|
18
15
|
displayName: "Flex",
|
19
16
|
componentId: "arghxi-0"
|
package/lib/Grid.js
CHANGED
@@ -9,15 +9,14 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
|
10
10
|
var _Box = _interopRequireDefault(require("./Box"));
|
11
11
|
|
12
|
+
var _constants = require("./constants");
|
13
|
+
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
15
|
|
14
|
-
/**
|
15
|
-
* @deprecated Use the Box component instead (i.e. <Grid> → <Box display="grid">)
|
16
|
-
*/
|
17
16
|
const Grid = (0, _styledComponents.default)(_Box.default).withConfig({
|
18
17
|
displayName: "Grid",
|
19
18
|
componentId: "sc-1i6s5ye-0"
|
20
|
-
})([""]);
|
19
|
+
})(["", ";"], _constants.GRID);
|
21
20
|
Grid.defaultProps = {
|
22
21
|
display: 'grid'
|
23
22
|
};
|
package/lib/Header.js
CHANGED
@@ -13,11 +13,10 @@ var _sx = _interopRequireDefault(require("./sx"));
|
|
13
13
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
15
|
|
16
|
-
function _getRequireWildcardCache(
|
16
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
17
17
|
|
18
|
-
function _interopRequireWildcard(obj
|
18
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
19
19
|
|
20
|
-
// eslint-disable-next-line import/no-namespace
|
21
20
|
const Header = _styledComponents.default.div.withConfig({
|
22
21
|
displayName: "Header",
|
23
22
|
componentId: "sc-217i47-0"
|
package/lib/Label.js
CHANGED
@@ -15,11 +15,11 @@ var _sx = _interopRequireDefault(require("./sx"));
|
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
17
|
|
18
|
-
function _getRequireWildcardCache(
|
18
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
19
19
|
|
20
|
-
function _interopRequireWildcard(obj
|
20
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
21
21
|
|
22
|
-
const outlineStyles = (0, _styledComponents.css)(["margin-top:-1px;margin-bottom:-1px;color:", ";border:", " solid ", ";box-shadow:none;", ";", ";background-color:transparent;"], (0, _constants.get)('colors.
|
22
|
+
const outlineStyles = (0, _styledComponents.css)(["margin-top:-1px;margin-bottom:-1px;color:", ";border:", " solid ", ";box-shadow:none;", ";", ";background-color:transparent;"], (0, _constants.get)('colors.label.secondary.text'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.label.border'), _styledSystem.borderColor, _constants.COMMON);
|
23
23
|
const sizeVariant = (0, _styledSystem.variant)({
|
24
24
|
variants: {
|
25
25
|
small: {
|
@@ -49,7 +49,7 @@ const sizeVariant = (0, _styledSystem.variant)({
|
|
49
49
|
const Label = _styledComponents.default.span.withConfig({
|
50
50
|
displayName: "Label",
|
51
51
|
componentId: "sc-1t3ykp0-0"
|
52
|
-
})(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";&:hover{text-decoration:none;}", " ", " ", " ", " ", ""], (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('colors.
|
52
|
+
})(["display:inline-block;font-weight:", ";color:", ";border-radius:", ";&:hover{text-decoration:none;}", " ", " ", " ", " ", ""], (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('colors.text.inverse'), (0, _constants.get)('radii.3'), sizeVariant, _constants.COMMON, props => props.dropshadow ? 'box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)' : '', props => props.outline ? outlineStyles : '', _sx.default);
|
53
53
|
|
54
54
|
Label.defaultProps = {
|
55
55
|
bg: 'label.primary.border',
|
package/lib/Link.js
CHANGED
@@ -15,6 +15,17 @@ var _sx = _interopRequireDefault(require("./sx"));
|
|
15
15
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
17
|
|
18
|
+
const buttonStyles = `
|
19
|
+
display: inline-block;
|
20
|
+
padding: 0;
|
21
|
+
font-size: inherit;
|
22
|
+
white-space: nowrap;
|
23
|
+
cursor: pointer;
|
24
|
+
user-select: none;
|
25
|
+
background-color: transparent;
|
26
|
+
border: 0;
|
27
|
+
appearance: none;
|
28
|
+
`;
|
18
29
|
const hoverColor = (0, _styledSystem.system)({
|
19
30
|
hoverColor: {
|
20
31
|
property: 'color',
|
@@ -25,7 +36,7 @@ const hoverColor = (0, _styledSystem.system)({
|
|
25
36
|
const Link = _styledComponents.default.a.withConfig({
|
26
37
|
displayName: "Link",
|
27
38
|
componentId: "sc-1brdqhf-0"
|
28
|
-
})(["color:", ";text-decoration:", ";&:hover{text-decoration:", ";", ";}&:is(button){display:inline-block;padding:0;font-size:inherit;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;}", ";", ";", ";"], props => props.muted ? (0, _constants.get)('colors.
|
39
|
+
})(["color:", ";text-decoration:", ";&:hover{text-decoration:", ";", ";}&:is(button){display:inline-block;padding:0;font-size:inherit;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;}", ";", ";", ";"], props => props.muted ? (0, _constants.get)('colors.text.secondary')(props) : (0, _constants.get)('colors.text.link')(props), props => props.underline ? 'underline' : 'none', props => props.muted ? 'none' : 'underline', props => props.hoverColor ? hoverColor : props.muted ? `color: ${(0, _constants.get)('colors.text.link')(props)}` : '', _constants.TYPOGRAPHY, _constants.COMMON, _sx.default);
|
29
40
|
|
30
41
|
var _default = Link;
|
31
42
|
exports.default = _default;
|
package/lib/Overlay.js
CHANGED
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
9
9
|
|
10
|
-
var _react =
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
11
|
|
12
12
|
var _constants = require("./constants");
|
13
13
|
|
@@ -17,167 +17,77 @@ var _Portal = _interopRequireDefault(require("./Portal"));
|
|
17
17
|
|
18
18
|
var _sx = _interopRequireDefault(require("./sx"));
|
19
19
|
|
20
|
-
var _useCombinedRefs = require("./hooks/useCombinedRefs");
|
21
|
-
|
22
|
-
var _ThemeProvider = require("./ThemeProvider");
|
23
|
-
|
24
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
25
|
-
|
26
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
|
-
|
28
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
21
|
|
30
22
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
31
23
|
|
32
24
|
const heightMap = {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
large: '432px',
|
37
|
-
xlarge: '600px',
|
38
|
-
auto: 'auto',
|
39
|
-
initial: 'auto' // Passing 'initial' initially applies 'auto'
|
40
|
-
|
25
|
+
sm: '480px',
|
26
|
+
md: '640px',
|
27
|
+
auto: 'auto'
|
41
28
|
};
|
42
29
|
const widthMap = {
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
xxlarge: '960px',
|
30
|
+
sm: '256px',
|
31
|
+
md: '320px',
|
32
|
+
lg: '480px',
|
33
|
+
xl: '640px',
|
48
34
|
auto: 'auto'
|
49
35
|
};
|
50
|
-
|
51
|
-
|
52
|
-
function getSlideAnimationStartingVector(anchorSide) {
|
53
|
-
if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('bottom')) {
|
54
|
-
return {
|
55
|
-
x: 0,
|
56
|
-
y: -1
|
57
|
-
};
|
58
|
-
} else if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('top')) {
|
59
|
-
return {
|
60
|
-
x: 0,
|
61
|
-
y: 1
|
62
|
-
};
|
63
|
-
} else if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('right')) {
|
64
|
-
return {
|
65
|
-
x: -1,
|
66
|
-
y: 0
|
67
|
-
};
|
68
|
-
} else if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('left')) {
|
69
|
-
return {
|
70
|
-
x: 1,
|
71
|
-
y: 0
|
72
|
-
};
|
73
|
-
}
|
74
|
-
|
75
|
-
return {
|
76
|
-
x: 0,
|
77
|
-
y: 0
|
78
|
-
};
|
79
|
-
}
|
36
|
+
/*TODO replace with shadow functional color variable when it's shipped to primer/primitives*/
|
80
37
|
|
81
38
|
const StyledOverlay = _styledComponents.default.div.withConfig({
|
82
39
|
displayName: "Overlay__StyledOverlay",
|
83
40
|
componentId: "jhwkzw-0"
|
84
|
-
})(["background-color:", ";box-shadow:
|
41
|
+
})(["background-color:", ";box-shadow:0px 1px 3px rgba(0,0,0,0.12),0px 8px 24px rgba(149,157,165,0.2);position:absolute;min-width:192px;max-width:640px;height:", ";width:", ";border-radius:12px;overflow:hidden;animation:overlay-appear 200ms ", ";@keyframes overlay-appear{0%{opacity:0;transform:translateY(", ");}100%{opacity:1;}}visibility:", ";", ";", ";", ";"], (0, _constants.get)('colors.bg.overlay'), props => heightMap[props.height || 'auto'], props => widthMap[props.width || 'auto'], (0, _constants.get)('animation.easeOutCubic'), (0, _constants.get)('space.2'), props => props.visibility, _constants.COMMON, _constants.POSITION, _sx.default);
|
85
42
|
|
86
43
|
/**
|
87
44
|
* An `Overlay` is a flexible floating surface, used to display transient content such as menus,
|
88
45
|
* selection options, dialogs, and more. Overlays use shadows to express elevation. The `Overlay`
|
89
46
|
* component handles all behaviors needed by overlay UIs as well as the common styles that all overlays * should have.
|
47
|
+
* @param positionSettings Settings for calculating the anchored position.
|
48
|
+
* @param positionDeps Dependencies to determine when to re-calculate the position of the overlay.
|
90
49
|
* @param ignoreClickRefs Optional. An array of ref objects to ignore clicks on in the `onOutsideClick` behavior. This is often used to ignore clicking on the element that toggles the open/closed state for the `Overlay` to prevent the `Overlay` from being toggled twice.
|
91
50
|
* @param initialFocusRef Optional. Ref for the element to focus when the `Overlay` is opened. If nothing is provided, the first focusable element in the `Overlay` body is focused.
|
51
|
+
* @param anchorRef Required. Element the `Overlay` should be anchored to.
|
92
52
|
* @param returnFocusRef Required. Ref for the element to focus when the `Overlay` is closed.
|
93
|
-
* @param onClickOutside Required. Function to call when clicking outside of the `Overlay`. Typically this function
|
94
|
-
* @param onEscape Required. Function to call when user presses `Escape`. Typically this function
|
95
|
-
* @param width Sets the width of the `Overlay`, pick from our set list of widths, or pass `auto` to automatically set the width based on the content of the `Overlay`. `
|
96
|
-
* @param height Sets the height of the `Overlay`, pick from our set list of heights, or pass `auto` to automatically set the height based on the content of the `Overlay
|
97
|
-
* @param maxHeight Sets the maximum height of the `Overlay`, pick from our set list of heights. `xsmall` corresponds to `192px`, `small` corresponds to `256px`, `medium` corresponds to `320px`, `large` corresponds to `432px`, `xlarge` corresponds to `600px`.
|
98
|
-
* @param anchorSide If provided, the Overlay will slide into position from the side of the anchor with a brief animation
|
99
|
-
* @param top Optional. Vertical position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
|
100
|
-
* @param left Optional. Horizontal position of the overlay, relative to its closest positioned ancestor (often its `Portal`).
|
101
|
-
* @param portalContainerName Optional. The name of the portal container to render the Overlay into.
|
53
|
+
* @param onClickOutside Required. Function to call when clicking outside of the `Overlay`. Typically this function sets the `Overlay` visibility state to `false`.
|
54
|
+
* @param onEscape Required. Function to call when user presses `Escape`. Typically this function sets the `Overlay` visibility state to `false`.
|
55
|
+
* @param width Sets the width of the `Overlay`, pick from our set list of widths, or pass `auto` to automatically set the width based on the content of the `Overlay`. `sm` corresponds to `256px`, `md` corresponds to `320px`, `lg` corresponds to `480px`, and `xl` corresponds to `640px`.
|
56
|
+
* @param height Sets the height of the `Overlay`, pick from our set list of heights, or pass `auto` to automatically set the height based on the content of the `Overlay`. `sm` corresponds to `480px` and `md` corresponds to `640px`.
|
102
57
|
*/
|
103
|
-
const Overlay =
|
58
|
+
const Overlay = ({
|
104
59
|
onClickOutside,
|
105
|
-
role = '
|
60
|
+
role = 'dialog',
|
61
|
+
positionSettings,
|
62
|
+
positionDeps,
|
63
|
+
anchorRef,
|
106
64
|
initialFocusRef,
|
107
65
|
returnFocusRef,
|
108
66
|
ignoreClickRefs,
|
109
67
|
onEscape,
|
110
|
-
visibility = 'visible',
|
111
|
-
height,
|
112
|
-
top,
|
113
|
-
left,
|
114
|
-
anchorSide,
|
115
|
-
portalContainerName,
|
116
|
-
preventFocusOnOpen,
|
117
68
|
...rest
|
118
|
-
}
|
119
|
-
const overlayRef = (0, _react.useRef)(null);
|
120
|
-
const combinedRef = (0, _useCombinedRefs.useCombinedRefs)(overlayRef, forwardedRef);
|
69
|
+
}) => {
|
121
70
|
const {
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
71
|
+
position,
|
72
|
+
...overlayRest
|
73
|
+
} = (0, _hooks.useOverlay)({
|
74
|
+
anchorRef,
|
75
|
+
positionSettings,
|
76
|
+
positionDeps,
|
128
77
|
returnFocusRef,
|
129
78
|
onEscape,
|
130
79
|
ignoreClickRefs,
|
131
80
|
onClickOutside,
|
132
|
-
initialFocusRef
|
133
|
-
preventFocusOnOpen
|
81
|
+
initialFocusRef
|
134
82
|
});
|
135
|
-
(
|
136
|
-
|
137
|
-
|
138
|
-
if (height === 'initial' && (_combinedRef$current = combinedRef.current) !== null && _combinedRef$current !== void 0 && _combinedRef$current.clientHeight) {
|
139
|
-
combinedRef.current.style.height = `${combinedRef.current.clientHeight}px`;
|
140
|
-
}
|
141
|
-
}, [height, combinedRef]);
|
142
|
-
(0, _react.useLayoutEffect)(() => {
|
143
|
-
var _overlayRef$current;
|
144
|
-
|
145
|
-
const {
|
146
|
-
x,
|
147
|
-
y
|
148
|
-
} = getSlideAnimationStartingVector(anchorSide);
|
149
|
-
|
150
|
-
if (!x && !y || !((_overlayRef$current = overlayRef.current) !== null && _overlayRef$current !== void 0 && _overlayRef$current.animate) || visibility === 'hidden') {
|
151
|
-
return;
|
152
|
-
} // JS animation is required because Safari does not allow css animations to start paused and then run
|
153
|
-
|
154
|
-
|
155
|
-
overlayRef.current.animate({
|
156
|
-
transform: [`translate(${slideAnimationDistance * x}px, ${slideAnimationDistance * y}px)`, `translate(0, 0)`]
|
157
|
-
}, {
|
158
|
-
duration: animationDuration,
|
159
|
-
easing: slideAnimationEasing
|
160
|
-
});
|
161
|
-
}, [anchorSide, slideAnimationDistance, slideAnimationEasing, visibility]);
|
162
|
-
|
163
|
-
const styledOverlay = /*#__PURE__*/_react.default.createElement(StyledOverlay, _extends({
|
164
|
-
height: height,
|
83
|
+
return /*#__PURE__*/_react.default.createElement(_Portal.default, null, /*#__PURE__*/_react.default.createElement(StyledOverlay, _extends({}, overlayRest, position, {
|
84
|
+
visibility: position ? 'visible' : 'hidden',
|
85
|
+
"aria-modal": "true",
|
165
86
|
role: role
|
166
|
-
}, rest
|
167
|
-
|
168
|
-
style: {
|
169
|
-
top: `${top || 0}px`,
|
170
|
-
left: `${left || 0}px`,
|
171
|
-
...rest.style,
|
172
|
-
'--styled-overlay-visibility': visibility
|
173
|
-
}
|
174
|
-
}));
|
175
|
-
|
176
|
-
return /*#__PURE__*/_react.default.createElement(_Portal.default, {
|
177
|
-
containerName: portalContainerName
|
178
|
-
}, styledOverlay);
|
179
|
-
});
|
87
|
+
}, rest)));
|
88
|
+
};
|
180
89
|
|
90
|
+
Overlay.displayName = "Overlay";
|
181
91
|
Overlay.defaultProps = {
|
182
92
|
height: 'auto',
|
183
93
|
width: 'auto'
|
package/lib/Pagehead.js
CHANGED
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
16
16
|
const Pagehead = _styledComponents.default.div.withConfig({
|
17
17
|
displayName: "Pagehead",
|
18
18
|
componentId: "sc-1ntn78e-0"
|
19
|
-
})(["position:relative;padding-top:", ";padding-bottom:", ";margin-bottom:", ";border-bottom:1px solid ", ";", ";", ";"], (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.border.
|
19
|
+
})(["position:relative;padding-top:", ";padding-bottom:", ";margin-bottom:", ";border-bottom:1px solid ", ";", ";", ";"], (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.border.primary'), _constants.COMMON, _sx.default);
|
20
20
|
|
21
21
|
var _default = Pagehead;
|
22
22
|
exports.default = _default;
|
@@ -24,7 +24,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
24
24
|
const Page = _styledComponents.default.a.withConfig({
|
25
25
|
displayName: "Pagination__Page",
|
26
26
|
componentId: "b80nss-0"
|
27
|
-
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}", ";"], (0, _constants.get)('colors.
|
27
|
+
})(["display:inline-block;min-width:32px;padding:5px 10px;font-style:normal;line-height:20px;color:", ";text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;user-select:none;text-decoration:none;margin-right:", ";&:last-child{margin-right:0;}border:", " solid transparent;border-radius:", ";transition:border-color 0.2s cubic-bezier(0.3,0,0.5,1);&:hover,&:focus{text-decoration:none;border-color:", ";outline:0;transition-duration:0.1s;}&:active{border-color:", ";}&[rel='prev'],&[rel='next']{color:", ";}&[aria-current],&[aria-current]:hover{color:", ";background-color:", ";border-color:transparent;}&[aria-disabled],&[aria-disabled]:hover{color:", ";cursor:default;border-color:transparent;}@supports (clip-path:polygon(50% 0,100% 50%,50% 100%)){&[rel='prev']::before,&[rel='next']::after{display:inline-block;width:16px;height:16px;vertical-align:text-bottom;content:'';background-color:currentColor;}&[rel='prev']::before{margin-right:", ";clip-path:polygon( 9.8px 12.8px,8.7px 12.8px,4.5px 8.5px,4.5px 7.5px,8.7px 3.2px,9.8px 4.3px,6.1px 8px,9.8px 11.7px,9.8px 12.8px );}&[rel='next']::after{margin-left:", ";clip-path:polygon( 6.2px 3.2px,7.3px 3.2px,11.5px 7.5px,11.5px 8.5px,7.3px 12.8px,6.2px 11.7px,9.9px 8px,6.2px 4.3px,6.2px 3.2px );}}", ";"], (0, _constants.get)('colors.text.primary'), (0, _constants.get)('space.1'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.primary'), (0, _constants.get)('colors.border.secondary'), (0, _constants.get)('colors.text.link'), (0, _constants.get)('colors.state.selected.primaryText'), (0, _constants.get)('colors.state.selected.primaryBg'), (0, _constants.get)('colors.text.disabled'), (0, _constants.get)('space.1'), (0, _constants.get)('space.1'), _constants.COMMON);
|
28
28
|
|
29
29
|
function usePaginationPages({
|
30
30
|
theme,
|
@@ -99,8 +99,7 @@ Pagination.displayName = "Pagination";
|
|
99
99
|
|
100
100
|
function defaultHrefBuilder(pageNum) {
|
101
101
|
return `#${pageNum}`;
|
102
|
-
}
|
103
|
-
|
102
|
+
}
|
104
103
|
|
105
104
|
function noop() {}
|
106
105
|
|
package/lib/Popover.js
CHANGED
@@ -9,7 +9,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
9
9
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
11
11
|
|
12
|
-
var
|
12
|
+
var _BorderBox = _interopRequireDefault(require("./BorderBox"));
|
13
13
|
|
14
14
|
var _constants = require("./constants");
|
15
15
|
|
@@ -29,10 +29,10 @@ const Popover = _styledComponents.default.div.attrs(({
|
|
29
29
|
componentId: "sc-1nxygy2-0"
|
30
30
|
})(["position:", ";z-index:100;display:", ";", ";", ";", ";", ";"], props => props.relative ? 'relative' : 'absolute', props => props.open ? 'block' : 'none', _constants.COMMON, _constants.LAYOUT, _constants.POSITION, _sx.default);
|
31
31
|
|
32
|
-
const PopoverContent = (0, _styledComponents.default)(
|
32
|
+
const PopoverContent = (0, _styledComponents.default)(_BorderBox.default).withConfig({
|
33
33
|
displayName: "Popover__PopoverContent",
|
34
34
|
componentId: "sc-1nxygy2-1"
|
35
|
-
})(["
|
35
|
+
})(["position:relative;width:232px;margin-right:auto;margin-left:auto;padding:", ";background-color:", ";", ";", ";&::before,&::after{position:absolute;left:50%;display:inline-block;content:'';}&::before{top:-", ";margin-left:-9px;border:", " solid transparent;border-bottom-color:", ";}&::after{top:-14px;margin-left:-", ";border:7px solid transparent;border-bottom-color:", ";}", ".caret-pos--bottom &,", ".caret-pos--bottom-right &,", ".caret-pos--bottom-left &{&::before,&::after{top:auto;border-bottom-color:transparent;}&::before{bottom:-", ";border-top-color:", ";}&::after{bottom:-14px;border-top-color:", ";}}", ".caret-pos--top-right &,", ".caret-pos--bottom-right &{right:-9px;margin-right:0;&::before,&::after{left:auto;margin-left:0;}&::before{right:20px;}&::after{right:21px;}}", ".caret-pos--top-left &,", ".caret-pos--bottom-left &{left:-9px;margin-left:0;&::before,&::after{left:", ";margin-left:0;}&::after{left:calc(", " + 1px);}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &,", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before,&::after{top:50%;left:auto;margin-left:0;border-bottom-color:transparent;}&::before{margin-top:calc((", " + 1px) * -1);}&::after{margin-top:-", ";}}", ".caret-pos--right &,", ".caret-pos--right-top &,", ".caret-pos--right-bottom &{&::before{right:-", ";border-left-color:", ";}&::after{right:-14px;border-left-color:", ";}}", ".caret-pos--left &,", ".caret-pos--left-top &,", ".caret-pos--left-bottom &{&::before{left:-", ";border-right-color:", ";}&::after{left:-14px;border-right-color:", ";}}", ".caret-pos--right-top &,", ".caret-pos--left-top &{&::before,&::after{top:", ";}}", ".caret-pos--right-bottom &,", ".caret-pos--left-bottom &{&::before,&::after{top:auto;}&::before{bottom:", ";}&::after{bottom:calc(", " + 1px);}}", ";"], (0, _constants.get)('space.4'), (0, _constants.get)('colors.bg.overlay'), _constants.COMMON, _constants.LAYOUT, (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.border.overlay'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.bg.overlay'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.overlay'), (0, _constants.get)('colors.bg.overlay'), Popover, Popover, Popover, Popover, (0, _constants.get)('space.4'), (0, _constants.get)('space.4'), Popover, Popover, Popover, Popover, Popover, Popover, (0, _constants.get)('space.2'), (0, _constants.get)('space.2'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.overlay'), (0, _constants.get)('colors.bg.overlay'), Popover, Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.overlay'), (0, _constants.get)('colors.bg.overlay'), Popover, Popover, (0, _constants.get)('space.4'), Popover, Popover, (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), _sx.default);
|
36
36
|
Popover.defaultProps = {
|
37
37
|
caret: 'top'
|
38
38
|
};
|
package/lib/Portal/Portal.js
CHANGED
@@ -22,25 +22,24 @@ const portalRootRegistry = {};
|
|
22
22
|
* If name is not specified, registers the default portal root.
|
23
23
|
*/
|
24
24
|
|
25
|
-
function registerPortalRoot(root, name
|
26
|
-
|
25
|
+
function registerPortalRoot(root, name) {
|
26
|
+
if (root instanceof Element) {
|
27
|
+
portalRootRegistry[name !== null && name !== void 0 ? name : DEFAULT_PORTAL_CONTAINER_NAME] = root;
|
28
|
+
} else {
|
29
|
+
delete portalRootRegistry[name !== null && name !== void 0 ? name : DEFAULT_PORTAL_CONTAINER_NAME];
|
30
|
+
}
|
27
31
|
} // Ensures that a default portal root exists and is registered. If a DOM element exists
|
28
|
-
// with id __primerPortalRoot__, allow that element to serve as the default
|
32
|
+
// with id __primerPortalRoot__, allow that element to serve as the default portl root.
|
29
33
|
// Otherwise, create that element and attach it to the end of document.body.
|
30
34
|
|
31
35
|
|
32
36
|
function ensureDefaultPortal() {
|
33
|
-
|
34
|
-
|
35
|
-
if (!existingDefaultPortalContainer || !document.body.contains(existingDefaultPortalContainer)) {
|
37
|
+
if (!(DEFAULT_PORTAL_CONTAINER_NAME in portalRootRegistry)) {
|
36
38
|
let defaultPortalContainer = document.getElementById(PRIMER_PORTAL_ROOT_ID);
|
37
39
|
|
38
40
|
if (!(defaultPortalContainer instanceof Element)) {
|
39
41
|
defaultPortalContainer = document.createElement('div');
|
40
42
|
defaultPortalContainer.setAttribute('id', PRIMER_PORTAL_ROOT_ID);
|
41
|
-
defaultPortalContainer.style.position = 'absolute';
|
42
|
-
defaultPortalContainer.style.top = '0';
|
43
|
-
defaultPortalContainer.style.left = '0';
|
44
43
|
const suitablePortalRoot = document.querySelector('[data-portal-root]');
|
45
44
|
|
46
45
|
if (suitablePortalRoot) {
|
@@ -50,7 +49,7 @@ function ensureDefaultPortal() {
|
|
50
49
|
}
|
51
50
|
}
|
52
51
|
|
53
|
-
|
52
|
+
portalRootRegistry[DEFAULT_PORTAL_CONTAINER_NAME] = defaultPortalContainer;
|
54
53
|
}
|
55
54
|
}
|
56
55
|
|
@@ -63,19 +62,12 @@ const Portal = ({
|
|
63
62
|
onMount,
|
64
63
|
containerName: _containerName
|
65
64
|
}) => {
|
66
|
-
const
|
67
|
-
// with each other in unexpected ways. One should never find themselves tempted
|
68
|
-
// to change the zIndex to a value other than "1".
|
69
|
-
|
70
|
-
hostElement.style.position = 'relative';
|
71
|
-
hostElement.style.zIndex = '1';
|
72
|
-
|
73
|
-
const elementRef = _react.default.useRef(hostElement);
|
65
|
+
const elementRef = _react.default.useRef(document.createElement('div'));
|
74
66
|
|
75
67
|
_react.default.useLayoutEffect(() => {
|
76
68
|
let containerName = _containerName;
|
77
69
|
|
78
|
-
if (containerName
|
70
|
+
if (containerName == undefined) {
|
79
71
|
containerName = DEFAULT_PORTAL_CONTAINER_NAME;
|
80
72
|
ensureDefaultPortal();
|
81
73
|
}
|
@@ -94,7 +86,7 @@ const Portal = ({
|
|
94
86
|
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
95
87
|
}, [elementRef]);
|
96
88
|
|
97
|
-
return
|
89
|
+
return (0, _reactDom.createPortal)(children, elementRef.current);
|
98
90
|
};
|
99
91
|
|
100
92
|
exports.Portal = Portal;
|