@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/utils/deprecate.js
CHANGED
@@ -7,7 +7,7 @@ exports.Deprecations = exports.useDeprecation = exports.deprecate = void 0;
|
|
7
7
|
|
8
8
|
var _react = require("react");
|
9
9
|
|
10
|
-
|
10
|
+
/* eslint-disable no-console */
|
11
11
|
const noop = () => {}; // eslint-disable-next-line import/no-mutable-exports
|
12
12
|
|
13
13
|
|
@@ -77,8 +77,7 @@ class Deprecations {
|
|
77
77
|
message,
|
78
78
|
version
|
79
79
|
}) {
|
80
|
-
const msg = `WARNING! ${name} is deprecated and will be removed in version ${version}. ${message}`;
|
81
|
-
|
80
|
+
const msg = `WARNING! ${name} is deprecated and will be removed in version ${version}. ${message}`;
|
82
81
|
console.warn(msg);
|
83
82
|
this.get().deprecations.push({
|
84
83
|
name,
|
package/lib/utils/isNumeric.js
CHANGED
@@ -109,5 +109,5 @@ function isFocusable(elem, strict = false) {
|
|
109
109
|
|
110
110
|
|
111
111
|
function isTabbable(elem, strict = false) {
|
112
|
-
return isFocusable(elem, strict) && elem.getAttribute(
|
112
|
+
return isFocusable(elem, strict) && elem.getAttribute("tabindex") !== "-1";
|
113
113
|
}
|
@@ -6,7 +6,6 @@ var _deprecate = require("./deprecate");
|
|
6
6
|
|
7
7
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
8
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
10
9
|
const ourVersion = require('../../package.json').version;
|
11
10
|
|
12
11
|
beforeEach(() => {
|
@@ -13,7 +13,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
13
13
|
expect.addSnapshotSerializer(_serializer.styleSheetSerializer);
|
14
14
|
|
15
15
|
const stringify = d => JSON.stringify(d, null, ' ');
|
16
|
+
/**
|
17
|
+
* These are props that styled-system aliases for backwards compatibility.
|
18
|
+
* For some reason, they don't show up in our toImplementSystemProps() matcher,
|
19
|
+
* so we skip over them.
|
20
|
+
*/
|
16
21
|
|
22
|
+
|
23
|
+
const ALIAS_PROP_TYPES = ['w', 'align', 'justify', 'wrap'];
|
17
24
|
expect.extend({
|
18
25
|
toMatchKeys(obj, values) {
|
19
26
|
return {
|
@@ -48,12 +55,14 @@ expect.extend({
|
|
48
55
|
}
|
49
56
|
};
|
50
57
|
|
51
|
-
const elem =
|
58
|
+
const elem = _react.default.cloneElement(element, {
|
52
59
|
sx: sxPropValue
|
53
60
|
});
|
54
61
|
|
62
|
+
const rendered = (0, _testing.render)(elem);
|
63
|
+
|
55
64
|
function checkStylesDeep(rendered) {
|
56
|
-
const className = rendered.props.className;
|
65
|
+
const className = rendered !== null && rendered !== void 0 && rendered.props ? rendered.props.className : '';
|
57
66
|
const styles = (0, _testing.getComputedStyles)(className);
|
58
67
|
const mediaStyles = styles[mediaKey];
|
59
68
|
|
@@ -67,7 +76,7 @@ expect.extend({
|
|
67
76
|
}
|
68
77
|
|
69
78
|
return {
|
70
|
-
pass: checkStylesDeep(
|
79
|
+
pass: checkStylesDeep(rendered),
|
71
80
|
message: () => 'sx prop values did not change styles of component nor of any sub-components'
|
72
81
|
};
|
73
82
|
},
|
package/lib/utils/testing.js
CHANGED
@@ -226,6 +226,7 @@ function unloadCSS(path) {
|
|
226
226
|
|
227
227
|
function behavesAsComponent({
|
228
228
|
Component,
|
229
|
+
systemPropArray,
|
229
230
|
toRender,
|
230
231
|
options
|
231
232
|
}) {
|
@@ -241,12 +242,12 @@ function behavesAsComponent({
|
|
241
242
|
|
242
243
|
if (!options.skipAs) {
|
243
244
|
it('respects the as prop', () => {
|
244
|
-
const As =
|
245
|
+
const As = _react.default.forwardRef((_props, ref) => /*#__PURE__*/_react.default.createElement("div", {
|
245
246
|
className: "as-component",
|
246
247
|
ref: ref
|
247
248
|
}));
|
248
249
|
|
249
|
-
const elem =
|
250
|
+
const elem = _react.default.cloneElement(getElement(), {
|
250
251
|
as: As
|
251
252
|
});
|
252
253
|
|
@@ -260,8 +261,7 @@ function behavesAsComponent({
|
|
260
261
|
it('renders consistently', () => {
|
261
262
|
expect(render(getElement())).toMatchSnapshot();
|
262
263
|
});
|
263
|
-
}
|
264
|
-
|
264
|
+
}
|
265
265
|
|
266
266
|
function checkExports(path, exports) {
|
267
267
|
it('has declared exports', () => {
|
package/lib/utils/theme.js
CHANGED
@@ -16,7 +16,7 @@ function fontStack(fonts) {
|
|
16
16
|
|
17
17
|
|
18
18
|
function isShadowValue(value) {
|
19
|
-
return typeof value === 'string' && /(inset\s|)([0-9.]+
|
19
|
+
return typeof value === 'string' && /(inset\s|)([0-9.empx\s]+){1,4}rgb[a]?\(.*\)/.test(value);
|
20
20
|
}
|
21
21
|
|
22
22
|
function isColorValue(value) {
|
File without changes
|
package/lib/utils/uniqueId.js
CHANGED
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.uniqueId = uniqueId;
|
7
|
-
// Note: uniqueId may be unsafe in SSR contexts if it is used create DOM IDs or otherwise cause a hydration warning. Use useSSRSafeId instead.
|
8
7
|
let idSeed = 10000;
|
9
8
|
|
10
9
|
function uniqueId() {
|
package/lib-esm/AvatarPair.js
CHANGED
@@ -4,7 +4,7 @@ import React from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import Avatar from './Avatar';
|
6
6
|
import { get } from './constants';
|
7
|
-
import {
|
7
|
+
import { Relative } from './Position';
|
8
8
|
const ChildAvatar = styled(Avatar).withConfig({
|
9
9
|
displayName: "AvatarPair__ChildAvatar",
|
10
10
|
componentId: "sc-1jbk273-0"
|
@@ -15,17 +15,16 @@ const AvatarPair = ({
|
|
15
15
|
...rest
|
16
16
|
}) => {
|
17
17
|
const avatars = React.Children.map(children, (child, i) => {
|
18
|
-
if (!
|
19
|
-
return i === 0 ?
|
18
|
+
if (!React.isValidElement(child)) return child;
|
19
|
+
return i === 0 ? React.cloneElement(child, {
|
20
20
|
size: 40
|
21
21
|
}) : /*#__PURE__*/React.createElement(ChildAvatar, _extends({
|
22
|
-
bg: "canvas
|
22
|
+
bg: "bg.canvas"
|
23
23
|
}, child.props, {
|
24
24
|
size: 20
|
25
25
|
}));
|
26
26
|
});
|
27
|
-
return /*#__PURE__*/React.createElement(
|
28
|
-
position: "relative",
|
27
|
+
return /*#__PURE__*/React.createElement(Relative, _extends({
|
29
28
|
display: "inline-flex"
|
30
29
|
}, rest), avatars);
|
31
30
|
};
|
package/lib-esm/AvatarStack.js
CHANGED
@@ -1,18 +1,20 @@
|
|
1
|
+
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); }
|
2
|
+
|
1
3
|
import classnames from 'classnames';
|
2
4
|
import React from 'react';
|
3
5
|
import styled from 'styled-components';
|
4
|
-
import { get } from './constants';
|
5
|
-
import {
|
6
|
+
import { COMMON, get } from './constants';
|
7
|
+
import { Absolute } from './Position';
|
6
8
|
import sx from './sx';
|
7
9
|
const AvatarStackWrapper = styled.span.withConfig({
|
8
10
|
displayName: "AvatarStack__AvatarStackWrapper",
|
9
11
|
componentId: "sc-1qgzd2v-0"
|
10
|
-
})(["display:flex;position:relative;height:20px;min-width:", ";.pc-AvatarItem{flex-shrink:0;height:20px;width:20px;box-shadow:0 0 0 1px ", ";margin-left:-11px;position:relative;overflow:hidden;transition:margin 0.2s ease-in-out,opacity 0.2s ease-in-out,visibility 0.2s ease-in-out,box-shadow 0.1s ease-in-out;&:first-child{margin-left:0;}&:nth-child(n + 4){display:none;}}&.pc-AvatarStack--two{min-width:30px;.pc-AvatarItem{&:nth-child(n + 3){display:none;}}}&.pc-AvatarStack--three-plus{min-width:38px;.pc-AvatarItem{&:nth-child(3){opacity:", "%;margin-left:-17px;}&:nth-child(4){opacity:", "%;margin-left:-17px;}&:nth-child(5){opacity:", "%;margin-left:-17px;}&:nth-child(n + 4){display:block;}&:nth-child(n + 6){opacity:0;visibility:hidden;}}}&.pc-AvatarStack--right{justify-content:flex-end;.pc-AvatarItem{margin-left:0 !important;margin-right:-11px;&:first-child{margin-right:0;}}.pc-AvatarStackBody{flex-direction:row-reverse;&:hover{.pc-AvatarItem{margin-right:", "!important;margin-left:0 !important;&:first-child{margin-right:0 !important;}}}}}&.pc-AvatarStack--three-plus.pc-AvatarStack--right{.pc-AvatarItem{&:nth-child(3){margin-right:-17px;}&:nth-child(4){margin-right:-17px;}&:nth-child(5){margin-right:-17px;}}}.pc-AvatarStackBody:hover{width:auto;.pc-AvatarItem{margin-left:", ";opacity:100%;visibility:visible;box-shadow:0 0 0 4px ", ";&:first-child{margin-left:0;}}}", ";"], props => props.count === 1 ? '20px' : props.count === 2 ? '30px' : '38px', get('colors.canvas
|
12
|
+
})(["display:flex;position:relative;height:20px;min-width:", ";.pc-AvatarItem{flex-shrink:0;height:20px;width:20px;box-shadow:0 0 0 1px ", ";margin-left:-11px;position:relative;overflow:hidden;transition:margin 0.2s ease-in-out,opacity 0.2s ease-in-out,visibility 0.2s ease-in-out,box-shadow 0.1s ease-in-out;&:first-child{margin-left:0;}&:nth-child(n + 4){display:none;}}&.pc-AvatarStack--two{min-width:30px;.pc-AvatarItem{&:nth-child(n + 3){display:none;}}}&.pc-AvatarStack--three-plus{min-width:38px;.pc-AvatarItem{&:nth-child(3){opacity:", "%;margin-left:-17px;}&:nth-child(4){opacity:", "%;margin-left:-17px;}&:nth-child(5){opacity:", "%;margin-left:-17px;}&:nth-child(n + 4){display:block;}&:nth-child(n + 6){opacity:0;visibility:hidden;}}}&.pc-AvatarStack--right{justify-content:flex-end;.pc-AvatarItem{margin-left:0 !important;margin-right:-11px;&:first-child{margin-right:0;}}.pc-AvatarStackBody{flex-direction:row-reverse;&:hover{.pc-AvatarItem{margin-right:", "!important;margin-left:0 !important;&:first-child{margin-right:0 !important;}}}}}&.pc-AvatarStack--three-plus.pc-AvatarStack--right{.pc-AvatarItem{&:nth-child(3){margin-right:-17px;}&:nth-child(4){margin-right:-17px;}&:nth-child(5){margin-right:-17px;}}}.pc-AvatarStackBody:hover{width:auto;.pc-AvatarItem{margin-left:", ";opacity:100%;visibility:visible;box-shadow:0 0 0 4px ", ";&:first-child{margin-left:0;}}}", " ", ";"], props => props.count === 1 ? '20px' : props.count === 2 ? '30px' : '38px', get('colors.bg.canvas'), 100 - 3 * 15, 100 - 4 * 15, 100 - 5 * 15, get('space.1'), get('space.1'), get('colors.bg.canvas'), COMMON, sx);
|
11
13
|
|
12
14
|
const transformChildren = children => {
|
13
15
|
return React.Children.map(children, (child, index) => {
|
14
|
-
if (!
|
15
|
-
return
|
16
|
+
if (!React.isValidElement(child)) return child;
|
17
|
+
return React.cloneElement(child, {
|
16
18
|
className: classnames(child.props.className, 'pc-AvatarItem'),
|
17
19
|
sx: {
|
18
20
|
zIndex: 10 - index,
|
@@ -25,7 +27,7 @@ const transformChildren = children => {
|
|
25
27
|
const AvatarStack = ({
|
26
28
|
children,
|
27
29
|
alignRight,
|
28
|
-
|
30
|
+
...rest
|
29
31
|
}) => {
|
30
32
|
const count = React.Children.count(children);
|
31
33
|
const wrapperClassNames = classnames({
|
@@ -33,12 +35,10 @@ const AvatarStack = ({
|
|
33
35
|
'pc-AvatarStack--three-plus': count > 2,
|
34
36
|
'pc-AvatarStack--right': alignRight
|
35
37
|
});
|
36
|
-
return /*#__PURE__*/React.createElement(AvatarStackWrapper, {
|
38
|
+
return /*#__PURE__*/React.createElement(AvatarStackWrapper, _extends({
|
37
39
|
count: count,
|
38
|
-
className: wrapperClassNames
|
39
|
-
|
40
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
41
|
-
position: "absolute",
|
40
|
+
className: wrapperClassNames
|
41
|
+
}, rest), /*#__PURE__*/React.createElement(Absolute, {
|
42
42
|
display: "flex",
|
43
43
|
width: "38px",
|
44
44
|
className: "pc-AvatarStackBody"
|
package/lib-esm/BaseStyles.js
CHANGED
@@ -3,23 +3,25 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
3
3
|
import React from 'react';
|
4
4
|
import styled, { createGlobalStyle } from 'styled-components';
|
5
5
|
import { COMMON, TYPOGRAPHY } from './constants';
|
6
|
+
import useMouseIntent from './hooks/useMouseIntent';
|
6
7
|
const GlobalStyle = createGlobalStyle`
|
7
8
|
* { box-sizing: border-box; }
|
8
9
|
body { margin: 0; }
|
9
10
|
table { border-collapse: collapse; }
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
11
|
+
body.intent-mouse {
|
12
|
+
[role="button"]:focus,
|
13
|
+
[role="tabpanel"][tabindex="0"]:focus,
|
14
|
+
button:focus,
|
15
|
+
summary:focus,
|
16
|
+
a:focus {
|
17
|
+
outline: none;
|
18
|
+
box-shadow: none;
|
19
|
+
}
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
[tabindex="0"]:focus,
|
22
|
+
details-dialog:focus {
|
23
|
+
outline: none;
|
24
|
+
}
|
23
25
|
}
|
24
26
|
`;
|
25
27
|
const Base = styled.div.withConfig({
|
@@ -31,10 +33,8 @@ function BaseStyles(props) {
|
|
31
33
|
const {
|
32
34
|
children,
|
33
35
|
...rest
|
34
|
-
} = props;
|
35
|
-
|
36
|
-
require('focus-visible');
|
37
|
-
|
36
|
+
} = props;
|
37
|
+
useMouseIntent();
|
38
38
|
return /*#__PURE__*/React.createElement(Base, _extends({}, rest, {
|
39
39
|
"data-portal-root": true
|
40
40
|
}), /*#__PURE__*/React.createElement(GlobalStyle, null), children);
|
package/lib-esm/BorderBox.js
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
2
|
import Box from './Box';
|
3
|
-
|
4
|
-
|
5
|
-
* @deprecated Use the Box component instead (i.e. <BorderBox> → <Box borderWidth='1px' borderStyle='solid' borderColor='border.primary' borderRadius={2}>)
|
6
|
-
*/
|
3
|
+
import { BORDER } from './constants';
|
4
|
+
import sx from './sx';
|
7
5
|
const BorderBox = styled(Box).withConfig({
|
8
6
|
displayName: "BorderBox",
|
9
7
|
componentId: "oreju5-0"
|
10
|
-
})([""]);
|
8
|
+
})(["", ";", ";"], BORDER, sx);
|
11
9
|
BorderBox.defaultProps = {
|
12
10
|
borderWidth: '1px',
|
13
11
|
borderStyle: 'solid',
|
package/lib-esm/Box.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import styled from 'styled-components';
|
2
|
-
import {
|
2
|
+
import { COMMON, FLEX, LAYOUT } from './constants';
|
3
3
|
import sx from './sx';
|
4
4
|
const Box = styled.div.withConfig({
|
5
5
|
displayName: "Box",
|
6
6
|
componentId: "nv15kw-0"
|
7
|
-
})(
|
7
|
+
})(["", " ", " ", " ", ";"], COMMON, FLEX, LAYOUT, sx);
|
8
8
|
export default Box;
|
package/lib-esm/BranchName.js
CHANGED
@@ -4,5 +4,5 @@ import sx from './sx';
|
|
4
4
|
const BranchName = styled.a.withConfig({
|
5
5
|
displayName: "BranchName",
|
6
6
|
componentId: "sc-167ouzm-0"
|
7
|
-
})(["display:inline-block;padding:2px 6px;font-size:", ";font-family:", ";color:", ";background-color:", ";border-radius:", ";", ";", ";"], get('fontSizes.0'), get('fonts.mono'), get('colors.
|
7
|
+
})(["display:inline-block;padding:2px 6px;font-size:", ";font-family:", ";color:", ";background-color:", ";border-radius:", ";", ";", ";"], get('fontSizes.0'), get('fonts.mono'), get('colors.branchName.text'), get('colors.branchName.bg'), get('radii.2'), COMMON, sx);
|
8
8
|
export default BranchName;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
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); }
|
2
2
|
|
3
|
-
import classnames from 'classnames';
|
4
|
-
|
3
|
+
import classnames from 'classnames';
|
5
4
|
import React from 'react';
|
6
5
|
import styled from 'styled-components';
|
7
6
|
import Box from './Box';
|
@@ -9,26 +8,27 @@ import { COMMON, FLEX, get } from './constants';
|
|
9
8
|
import sx from './sx';
|
10
9
|
const SELECTED_CLASS = 'selected';
|
11
10
|
const Wrapper = styled.li.withConfig({
|
12
|
-
displayName: "
|
13
|
-
componentId: "
|
14
|
-
})(["display:inline-block;white-space:nowrap;list-style:none;&::after{padding-right:0.5em;padding-left:0.5em;color:", ";font-size:", ";content:'/';}&:first-child{margin-left:0;}&:last-child{&::after{content:none;}}"], get('colors.
|
15
|
-
const
|
16
|
-
displayName: "
|
17
|
-
componentId: "
|
11
|
+
displayName: "Breadcrumb__Wrapper",
|
12
|
+
componentId: "c1r3ff-0"
|
13
|
+
})(["display:inline-block;white-space:nowrap;list-style:none;&::after{padding-right:0.5em;padding-left:0.5em;color:", ";font-size:", ";content:'/';}&:first-child{margin-left:0;}&:last-child{&::after{content:none;}}"], get('colors.text.disabled'), get('fontSizes.1'));
|
14
|
+
const BreadcrumbBase = styled.nav.withConfig({
|
15
|
+
displayName: "Breadcrumb__BreadcrumbBase",
|
16
|
+
componentId: "c1r3ff-1"
|
18
17
|
})(["display:flex;justify-content:space-between;", ";", ";", ";"], COMMON, FLEX, sx);
|
19
18
|
|
20
|
-
function
|
19
|
+
function Breadcrumb({
|
21
20
|
className,
|
22
21
|
children,
|
23
22
|
theme,
|
24
23
|
...rest
|
25
24
|
}) {
|
25
|
+
const classes = classnames(className, 'Breadcrumb');
|
26
26
|
const wrappedChildren = React.Children.map(children, child => /*#__PURE__*/React.createElement(Wrapper, {
|
27
27
|
theme: theme
|
28
28
|
}, child));
|
29
|
-
return /*#__PURE__*/React.createElement(
|
30
|
-
className:
|
31
|
-
"aria-label": "
|
29
|
+
return /*#__PURE__*/React.createElement(BreadcrumbBase, _extends({
|
30
|
+
className: classes,
|
31
|
+
"aria-label": "breadcrumb",
|
32
32
|
theme: theme
|
33
33
|
}, rest), /*#__PURE__*/React.createElement(Box, {
|
34
34
|
as: "ol",
|
@@ -37,27 +37,17 @@ function Breadcrumbs({
|
|
37
37
|
}, wrappedChildren));
|
38
38
|
}
|
39
39
|
|
40
|
-
|
41
|
-
const
|
40
|
+
Breadcrumb.displayName = "Breadcrumb";
|
41
|
+
const BreadcrumbItem = styled.a.attrs(props => ({
|
42
42
|
activeClassName: typeof props.to === 'string' ? 'selected' : '',
|
43
43
|
className: classnames(props.selected && SELECTED_CLASS, props.className),
|
44
44
|
'aria-current': props.selected ? 'page' : null
|
45
45
|
})).withConfig({
|
46
|
-
displayName: "
|
47
|
-
componentId: "
|
48
|
-
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", " ", ";"], get('colors.
|
49
|
-
|
50
|
-
|
51
|
-
export default Object.assign(
|
52
|
-
Item:
|
53
|
-
});
|
54
|
-
/**
|
55
|
-
* @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`)
|
56
|
-
*/
|
57
|
-
|
58
|
-
export const Breadcrumb = Object.assign(Breadcrumbs, {
|
59
|
-
Item: BreadcrumbsItem
|
60
|
-
});
|
61
|
-
/**
|
62
|
-
* @deprecated Use the `BreadcrumbsProps` type instead
|
63
|
-
*/
|
46
|
+
displayName: "Breadcrumb__BreadcrumbItem",
|
47
|
+
componentId: "c1r3ff-2"
|
48
|
+
})(["color:", ";display:inline-block;font-size:", ";text-decoration:none;&:hover{text-decoration:underline;}&.selected{color:", ";pointer-events:none;}", " ", ";"], get('colors.text.link'), get('fontSizes.1'), get('colors.text.primary'), COMMON, sx);
|
49
|
+
Breadcrumb.displayName = 'Breadcrumb';
|
50
|
+
BreadcrumbItem.displayName = 'Breadcrumb.Item';
|
51
|
+
export default Object.assign(Breadcrumb, {
|
52
|
+
Item: BreadcrumbItem
|
53
|
+
});
|
package/lib-esm/Button/Button.js
CHANGED
@@ -5,5 +5,5 @@ import ButtonBase, { buttonSystemProps } from './ButtonBase';
|
|
5
5
|
const Button = styled(ButtonBase).withConfig({
|
6
6
|
displayName: "Button",
|
7
7
|
componentId: "xjtz72-0"
|
8
|
-
})(["color:", ";background-color:", ";border:1px solid ", ";box-shadow:", ",", "};&:hover{background-color:", ";border-color:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";", ";"], get('colors.btn.text'), get('colors.btn.bg'), get('colors.btn.border'), get('shadows.btn.shadow'), get('shadows.btn.insetShadow'), get('colors.btn.hoverBg'), get('colors.btn.hoverBorder'), get('colors.btn.focusBorder'), get('shadows.btn.focusShadow'), get('colors.btn.selectedBg'), get('shadows.btn.shadowActive'), get('colors.
|
8
|
+
})(["color:", ";background-color:", ";border:1px solid ", ";box-shadow:", ",", "};&:hover{background-color:", ";border-color:", ";}&:focus{border-color:", ";box-shadow:", ";}&:active{background-color:", ";box-shadow:", ";}&:disabled{color:", ";background-color:", ";border-color:", ";}", ";", ";"], get('colors.btn.text'), get('colors.btn.bg'), get('colors.btn.border'), get('shadows.btn.shadow'), get('shadows.btn.insetShadow'), get('colors.btn.hoverBg'), get('colors.btn.hoverBorder'), get('colors.btn.focusBorder'), get('shadows.btn.focusShadow'), get('colors.btn.selectedBg'), get('shadows.btn.shadowActive'), get('colors.text.disabled'), get('colors.btn.bg'), get('colors.btn.border'), buttonSystemProps, sx);
|
9
9
|
export default Button;
|
@@ -8,8 +8,8 @@ import sx from '../sx';
|
|
8
8
|
const StyledButton = styled.button.withConfig({
|
9
9
|
displayName: "ButtonClose__StyledButton",
|
10
10
|
componentId: "sc-13mzqph-0"
|
11
|
-
})(["border:none;padding:0;background:transparent;outline:none;cursor:pointer;border-radius:", ";color:", ";&:focus{box-shadow:", ";}&:hover{color:", ";}", ";", ";", ";"], get('radii.2'), get('colors.
|
12
|
-
const ButtonClose =
|
11
|
+
})(["border:none;padding:0;background:transparent;outline:none;cursor:pointer;border-radius:", ";color:", ";&:focus{box-shadow:", ";}&:hover{color:", ";}", ";", ";", ";"], get('radii.2'), get('colors.text.secondary'), get('shadows.btn.focusShadow'), get('colors.text.link'), COMMON, LAYOUT, sx);
|
12
|
+
const ButtonClose = forwardRef((props, ref) => {
|
13
13
|
return /*#__PURE__*/React.createElement(StyledButton, _extends({
|
14
14
|
ref: ref,
|
15
15
|
"aria-label": "Close"
|
@@ -5,5 +5,5 @@ import ButtonBase, { buttonSystemProps } from './ButtonBase';
|
|
5
5
|
const ButtonInvisible = styled(ButtonBase).withConfig({
|
6
6
|
displayName: "ButtonInvisible",
|
7
7
|
componentId: "sc-1195tpn-0"
|
8
|
-
})(["color:", ";background-color:transparent;border:0;border-radius:", ";box-shadow:none;&:disabled{color:", ";}&:focus{box-shadow:", ";}", ";", ""], get('colors.
|
8
|
+
})(["color:", ";background-color:transparent;border:0;border-radius:", ";box-shadow:none;&:disabled{color:", ";}&:focus{box-shadow:", ";}", ";", ""], get('colors.text.link'), get('radii.2'), get('colors.text.disabled'), get('shadows.btn.focusShadow'), buttonSystemProps, sx);
|
9
9
|
export default ButtonInvisible;
|
@@ -4,5 +4,5 @@ import sx from '../sx';
|
|
4
4
|
const ButtonTableList = styled.summary.withConfig({
|
5
5
|
displayName: "ButtonTableList",
|
6
6
|
componentId: "sc-1m4q8ia-0"
|
7
|
-
})(["display:inline-block;padding:0;font-size:", ";color:", ";text-decoration:none;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;&:hover{text-decoration:underline;}&:disabled{&,&:hover{color:rgba(", ",0.5);cursor:default;}}&:after{display:inline-block;margin-left:", ";width:0;height:0;vertical-align:-2px;content:'';border:4px solid transparent;border-top-color:currentcolor;}", " ", " ", " ", ";"], get('fontSizes.1'), get('colors.
|
7
|
+
})(["display:inline-block;padding:0;font-size:", ";color:", ";text-decoration:none;white-space:nowrap;cursor:pointer;user-select:none;background-color:transparent;border:0;appearance:none;&:hover{text-decoration:underline;}&:disabled{&,&:hover{color:rgba(", ",0.5);cursor:default;}}&:after{display:inline-block;margin-left:", ";width:0;height:0;vertical-align:-2px;content:'';border:4px solid transparent;border-top-color:currentcolor;}", " ", " ", " ", ";"], get('fontSizes.1'), get('colors.text.secondary'), get('colors.text.secondary'), get('space.1'), COMMON, TYPOGRAPHY, LAYOUT, sx);
|
8
8
|
export default ButtonTableList;
|
package/lib-esm/CircleBadge.js
CHANGED
@@ -23,7 +23,7 @@ const sizeStyles = ({
|
|
23
23
|
const CircleBadge = styled.div.withConfig({
|
24
24
|
displayName: "CircleBadge",
|
25
25
|
componentId: "sc-1lho816-0"
|
26
|
-
})(["display:", ";align-items:center;justify-content:center;background-color:", ";border-radius:50%;box-shadow:", ";", ";", ";", ";"], props => props.inline ? 'inline-flex' : 'flex', get('colors.canvas
|
26
|
+
})(["display:", ";align-items:center;justify-content:center;background-color:", ";border-radius:50%;box-shadow:", ";", ";", ";", ";"], props => props.inline ? 'inline-flex' : 'flex', get('colors.bg.canvas'), get('shadows.shadow.medium'), COMMON, sizeStyles, sx);
|
27
27
|
const CircleBadgeIcon = styled(StyledOcticon).withConfig({
|
28
28
|
displayName: "CircleBadge__CircleBadgeIcon",
|
29
29
|
componentId: "sc-1lho816-1"
|
package/lib-esm/CircleOcticon.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
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); }
|
2
2
|
|
3
3
|
import React from 'react';
|
4
|
-
import
|
4
|
+
import BorderBox from './BorderBox';
|
5
|
+
import Flex from './Flex';
|
5
6
|
|
6
7
|
function CircleOcticon(props) {
|
7
8
|
const {
|
@@ -13,18 +14,14 @@ function CircleOcticon(props) {
|
|
13
14
|
bg,
|
14
15
|
...rest
|
15
16
|
} = props;
|
16
|
-
return /*#__PURE__*/React.createElement(
|
17
|
+
return /*#__PURE__*/React.createElement(BorderBox, {
|
17
18
|
as: as,
|
18
19
|
bg: bg,
|
19
20
|
overflow: "hidden",
|
20
21
|
borderWidth: 0,
|
21
22
|
size: size,
|
22
|
-
borderRadius: "50%"
|
23
|
-
|
24
|
-
borderColor: "border.default"
|
25
|
-
}, /*#__PURE__*/React.createElement(Box, _extends({
|
26
|
-
display: "flex"
|
27
|
-
}, rest, {
|
23
|
+
borderRadius: "50%"
|
24
|
+
}, /*#__PURE__*/React.createElement(Flex, _extends({}, rest, {
|
28
25
|
alignItems: "center",
|
29
26
|
justifyContent: "center"
|
30
27
|
}), /*#__PURE__*/React.createElement(IconComponent, {
|
@@ -33,7 +30,7 @@ function CircleOcticon(props) {
|
|
33
30
|
}
|
34
31
|
|
35
32
|
CircleOcticon.displayName = "CircleOcticon";
|
36
|
-
CircleOcticon.defaultProps = { ...
|
33
|
+
CircleOcticon.defaultProps = { ...Flex.defaultProps,
|
37
34
|
size: 32
|
38
35
|
};
|
39
36
|
export default CircleOcticon;
|
package/lib-esm/CounterLabel.js
CHANGED
@@ -7,7 +7,7 @@ const colorStyles = ({
|
|
7
7
|
...props
|
8
8
|
}) => {
|
9
9
|
return {
|
10
|
-
color: scheme === 'secondary' ? get('colors.
|
10
|
+
color: scheme === 'secondary' ? get('colors.counter.text')(props) : scheme === 'primary' ? get('colors.counter.primary.text')(props) : get('colors.counter.text')(props)
|
11
11
|
};
|
12
12
|
};
|
13
13
|
|
@@ -16,7 +16,7 @@ const bgStyles = ({
|
|
16
16
|
...props
|
17
17
|
}) => {
|
18
18
|
return {
|
19
|
-
backgroundColor: scheme === 'secondary' ? get('colors.
|
19
|
+
backgroundColor: scheme === 'secondary' ? get('colors.counter.bg')(props) : scheme === 'primary' ? get('colors.counter.primary.bg')(props) : get('colors.counter.bg')(props)
|
20
20
|
};
|
21
21
|
};
|
22
22
|
|
package/lib-esm/Dialog.js
CHANGED
@@ -4,22 +4,21 @@ import React, { forwardRef, useRef } from 'react';
|
|
4
4
|
import styled from 'styled-components';
|
5
5
|
import ButtonClose from './Button/ButtonClose';
|
6
6
|
import { COMMON, get, LAYOUT } from './constants';
|
7
|
-
import
|
7
|
+
import Flex from './Flex';
|
8
8
|
import useDialog from './hooks/useDialog';
|
9
9
|
import sx from './sx';
|
10
10
|
import Text from './Text';
|
11
|
-
import { useCombinedRefs } from './hooks/useCombinedRefs';
|
12
11
|
|
13
12
|
const noop = () => null;
|
14
13
|
|
15
14
|
const DialogBase = styled.div.withConfig({
|
16
15
|
displayName: "Dialog__DialogBase",
|
17
16
|
componentId: "sc-1vcjhsg-0"
|
18
|
-
})(["box-shadow:", ";border-radius:", ";position:fixed;top:0;left:50%;transform:translateX(-50%);max-height:80vh;z-index:999;margin:10vh auto;background-color:", ";width:", ";outline:none;@media screen and (max-width:750px){width:100vw;margin:0;border-radius:0;height:100vh;}", ";", ";", ";"], get('shadows.shadow.large'), get('radii.2'), get('colors.
|
19
|
-
const DialogHeaderBase = styled(
|
17
|
+
})(["box-shadow:", ";border-radius:", ";position:fixed;top:0;left:50%;transform:translateX(-50%);max-height:80vh;z-index:999;margin:10vh auto;background-color:", ";width:", ";outline:none;@media screen and (max-width:750px){width:100vw;margin:0;border-radius:0;height:100vh;}", ";", ";", ";"], get('shadows.shadow.large'), get('radii.2'), get('colors.bg.primary'), props => props.narrow ? '320px' : props.wide ? '640px' : '440px', LAYOUT, COMMON, sx);
|
18
|
+
const DialogHeaderBase = styled(Flex).withConfig({
|
20
19
|
displayName: "Dialog__DialogHeaderBase",
|
21
20
|
componentId: "sc-1vcjhsg-1"
|
22
|
-
})(["border-radius:", " ", " 0px 0px;border-bottom:1px solid ", "
|
21
|
+
})(["border-radius:", " ", " 0px 0px;border-bottom:1px solid ", ";@media screen and (max-width:750px){border-radius:0px;}", ";"], get('radii.2'), get('radii.2'), get('colors.border.primary'), sx);
|
23
22
|
|
24
23
|
function DialogHeader({
|
25
24
|
theme,
|
@@ -30,7 +29,7 @@ function DialogHeader({
|
|
30
29
|
if (React.Children.toArray(children).every(ch => typeof ch === 'string')) {
|
31
30
|
children = /*#__PURE__*/React.createElement(Text, {
|
32
31
|
theme: theme,
|
33
|
-
color: "
|
32
|
+
color: "text.primary",
|
34
33
|
fontSize: 1,
|
35
34
|
fontWeight: "bold",
|
36
35
|
fontFamily: "sans-serif"
|
@@ -48,8 +47,8 @@ DialogHeader.displayName = "DialogHeader";
|
|
48
47
|
const Overlay = styled.span.withConfig({
|
49
48
|
displayName: "Dialog__Overlay",
|
50
49
|
componentId: "sc-1vcjhsg-2"
|
51
|
-
})(["&:before{position:fixed;top:0;right:0;bottom:0;left:0;display:block;cursor:default;content:' ';background:transparent;z-index:99;background:", ";}"], get('colors.
|
52
|
-
const Dialog =
|
50
|
+
})(["&:before{position:fixed;top:0;right:0;bottom:0;left:0;z-index:80;display:block;cursor:default;content:' ';background:transparent;z-index:99;background:", ";}"], get('colors.fade.black50'));
|
51
|
+
const Dialog = forwardRef(({
|
53
52
|
children,
|
54
53
|
onDismiss = noop,
|
55
54
|
isOpen,
|
@@ -57,8 +56,11 @@ const Dialog = /*#__PURE__*/forwardRef(({
|
|
57
56
|
returnFocusRef,
|
58
57
|
...props
|
59
58
|
}, forwardedRef) => {
|
59
|
+
var _ref;
|
60
|
+
|
61
|
+
const backupRef = useRef(null);
|
60
62
|
const overlayRef = useRef(null);
|
61
|
-
const modalRef =
|
63
|
+
const modalRef = (_ref = forwardedRef) !== null && _ref !== void 0 ? _ref : backupRef;
|
62
64
|
const closeButtonRef = useRef(null);
|
63
65
|
|
64
66
|
const onCloseClick = () => {
|
@@ -100,7 +102,7 @@ const Dialog = /*#__PURE__*/forwardRef(({
|
|
100
102
|
DialogHeader.defaultProps = {
|
101
103
|
backgroundColor: 'bg.tertiary'
|
102
104
|
};
|
103
|
-
DialogHeader.propTypes = { ...
|
105
|
+
DialogHeader.propTypes = { ...Flex.propTypes
|
104
106
|
};
|
105
107
|
DialogHeader.displayName = 'Dialog.Header';
|
106
108
|
Dialog.displayName = 'Dialog';
|
package/lib-esm/Dropdown.js
CHANGED
@@ -48,11 +48,11 @@ const DropdownCaret = styled.div.withConfig({
|
|
48
48
|
const DropdownMenu = styled.ul.withConfig({
|
49
49
|
displayName: "Dropdown__DropdownMenu",
|
50
50
|
componentId: "sc-16yoecj-2"
|
51
|
-
})(["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;}", ";", ";", ";"], get('colors.
|
51
|
+
})(["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;}", ";", ";", ";"], get('colors.bg.overlay'), get('colors.border.overlay'), get('radii.2'), get('shadows.dropdown.shadow'), get('colors.bg.overlay'), get('colors.bg.overlay'), props => props.direction ? getDirectionStyles(props.theme, props.direction) : '', COMMON, sx);
|
52
52
|
const DropdownItem = styled.li.withConfig({
|
53
53
|
displayName: "Dropdown__DropdownItem",
|
54
54
|
componentId: "sc-16yoecj-3"
|
55
|
-
})(["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;}", ";", ";"], get('space.1'), get('space.1'), get('colors.
|
55
|
+
})(["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;}", ";", ";"], get('space.1'), get('space.1'), get('colors.text.primary'), get('colors.text.primary'), get('colors.text.primary'), get('colors.state.hover.primaryText'), get('colors.state.hover.primaryBg'), get('colors.state.hover.primaryText'), get('colors.state.hover.primaryBg'), COMMON, sx);
|
56
56
|
DropdownMenu.defaultProps = {
|
57
57
|
direction: 'sw'
|
58
58
|
};
|