@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/StateLabel.js
CHANGED
@@ -85,19 +85,19 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
85
85
|
const StateLabelBase = _styledComponents.default.span.withConfig({
|
86
86
|
displayName: "StateLabel__StateLabelBase",
|
87
87
|
componentId: "k4pd9e-0"
|
88
|
-
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";border-width:1px;border-style:solid;", ";", ";", ";", ";"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('colors.
|
88
|
+
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";border-width:1px;border-style:solid;", ";", ";", ";", ";"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('colors.bg.primary'), (0, _constants.get)('radii.3'), colorVariants, sizeVariants, _constants.COMMON, _sx.default);
|
89
89
|
|
90
90
|
function StateLabel({
|
91
91
|
children,
|
92
92
|
status,
|
93
|
-
variant
|
93
|
+
variant,
|
94
94
|
...rest
|
95
95
|
}) {
|
96
|
-
const octiconProps =
|
96
|
+
const octiconProps = variant === 'small' ? {
|
97
97
|
width: '1em'
|
98
98
|
} : {};
|
99
99
|
return /*#__PURE__*/_react.default.createElement(StateLabelBase, _extends({}, rest, {
|
100
|
-
variant:
|
100
|
+
variant: variant,
|
101
101
|
status: status
|
102
102
|
}), status && /*#__PURE__*/_react.default.createElement(_StyledOcticon.default, _extends({
|
103
103
|
mr: 1
|
package/lib/SubNav.js
CHANGED
@@ -13,7 +13,7 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
14
14
|
var _constants = require("./constants");
|
15
15
|
|
16
|
-
var
|
16
|
+
var _Flex = _interopRequireDefault(require("./Flex"));
|
17
17
|
|
18
18
|
var _sx = _interopRequireDefault(require("./sx"));
|
19
19
|
|
@@ -50,9 +50,7 @@ function SubNav({
|
|
50
50
|
SubNav.displayName = "SubNav";
|
51
51
|
|
52
52
|
function SubNavLinks(props) {
|
53
|
-
return /*#__PURE__*/_react.default.createElement(
|
54
|
-
display: "flex"
|
55
|
-
}, props));
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_Flex.default, props);
|
56
54
|
}
|
57
55
|
|
58
56
|
SubNavLinks.displayName = "SubNavLinks";
|
@@ -63,7 +61,7 @@ const SubNavLink = _styledComponents.default.a.attrs(props => ({
|
|
63
61
|
})).withConfig({
|
64
62
|
displayName: "SubNav__SubNavLink",
|
65
63
|
componentId: "f7w0xa-1"
|
66
|
-
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.
|
64
|
+
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.border.primary'), (0, _constants.get)('colors.border.primary'), (0, _constants.get)('colors.border.primary'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.primary'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.bg.tertiary'), (0, _constants.get)('colors.icon.secondary'), (0, _constants.get)('colors.state.selected.primaryText'), (0, _constants.get)('colors.state.selected.primaryBg'), (0, _constants.get)('colors.state.selected.primaryBorder'), (0, _constants.get)('colors.state.selected.primaryText'), _constants.COMMON, _sx.default);
|
67
65
|
|
68
66
|
SubNavLink.displayName = 'SubNav.Link';
|
69
67
|
SubNavLinks.displayName = 'SubNav.Links';
|
package/lib/TabNav.js
CHANGED
@@ -23,7 +23,7 @@ const SELECTED_CLASS = 'selected';
|
|
23
23
|
const TabNavBase = _styledComponents.default.div.withConfig({
|
24
24
|
displayName: "TabNav__TabNavBase",
|
25
25
|
componentId: "sc-1xod0ow-0"
|
26
|
-
})(["margin-top:0;border-bottom:1px solid ", ";", " ", ""], (0, _constants.get)('colors.border.
|
26
|
+
})(["margin-top:0;border-bottom:1px solid ", ";", " ", ""], (0, _constants.get)('colors.border.primary'), _constants.COMMON, _sx.default);
|
27
27
|
|
28
28
|
const TabNavBody = _styledComponents.default.nav.withConfig({
|
29
29
|
displayName: "TabNav__TabNavBody",
|
@@ -32,7 +32,7 @@ const TabNavBody = _styledComponents.default.nav.withConfig({
|
|
32
32
|
|
33
33
|
function TabNav({
|
34
34
|
children,
|
35
|
-
|
35
|
+
"aria-label": ariaLabel,
|
36
36
|
...rest
|
37
37
|
}) {
|
38
38
|
return /*#__PURE__*/_react.default.createElement(TabNavBase, rest, /*#__PURE__*/_react.default.createElement(TabNavBody, {
|
@@ -48,7 +48,7 @@ const TabNavLink = _styledComponents.default.a.attrs(props => ({
|
|
48
48
|
})).withConfig({
|
49
49
|
displayName: "TabNav__TabNavLink",
|
50
50
|
componentId: "sc-1xod0ow-2"
|
51
|
-
})(["padding:8px 12px;font-size:", ";line-height:20px;color:", ";text-decoration:none;background-color:transparent;border:1px solid transparent;border-bottom:0;&:hover,&:focus{color:", ";text-decoration:none;}&.selected{color:", ";border-color:", ";border-top-right-radius:", ";border-top-left-radius:", ";background-color:", ";}", ";", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.
|
51
|
+
})(["padding:8px 12px;font-size:", ";line-height:20px;color:", ";text-decoration:none;background-color:transparent;border:1px solid transparent;border-bottom:0;&:hover,&:focus{color:", ";text-decoration:none;}&.selected{color:", ";border-color:", ";border-top-right-radius:", ";border-top-left-radius:", ";background-color:", ";}", ";", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.border.primary'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.bg.canvas'), _constants.COMMON, _sx.default);
|
52
52
|
|
53
53
|
TabNavLink.displayName = 'TabNav.Link';
|
54
54
|
|
package/lib/TextInput.js
CHANGED
@@ -5,50 +5,87 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
+
var _props = require("@styled-system/props");
|
9
|
+
|
8
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
9
11
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
11
13
|
|
12
|
-
var
|
14
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
15
|
+
|
16
|
+
var _styledSystem = require("styled-system");
|
17
|
+
|
18
|
+
var _constants = require("./constants");
|
19
|
+
|
20
|
+
var _sx = _interopRequireDefault(require("./sx"));
|
21
|
+
|
22
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
13
23
|
|
14
|
-
|
24
|
+
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; }
|
15
25
|
|
16
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
27
|
|
18
28
|
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); }
|
19
29
|
|
30
|
+
const sizeVariants = (0, _styledSystem.variant)({
|
31
|
+
variants: {
|
32
|
+
small: {
|
33
|
+
minHeight: '28px',
|
34
|
+
px: 2,
|
35
|
+
py: '3px',
|
36
|
+
fontSize: 0,
|
37
|
+
lineHeight: '20px'
|
38
|
+
},
|
39
|
+
large: {
|
40
|
+
px: 2,
|
41
|
+
py: '10px',
|
42
|
+
fontSize: 3
|
43
|
+
}
|
44
|
+
}
|
45
|
+
});
|
46
|
+
|
47
|
+
const Input = _styledComponents.default.input.withConfig({
|
48
|
+
displayName: "TextInput__Input",
|
49
|
+
componentId: "sc-1apmpmt-0"
|
50
|
+
})(["border:0;font-size:inherit;font-family:inherit;background-color:transparent;-webkit-appearance:none;color:inherit;width:100%;&:focus{outline:0;}"]);
|
51
|
+
|
52
|
+
const Wrapper = _styledComponents.default.span.withConfig({
|
53
|
+
displayName: "TextInput__Wrapper",
|
54
|
+
componentId: "sc-1apmpmt-1"
|
55
|
+
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.text.primary'), (0, _constants.get)('colors.input.border'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.shadow.inset'), props => {
|
56
|
+
if (props.hasIcon) {
|
57
|
+
return (0, _styledComponents.css)(["padding:0;"]);
|
58
|
+
} else {
|
59
|
+
return (0, _styledComponents.css)(["padding:6px 12px;"]);
|
60
|
+
}
|
61
|
+
}, (0, _constants.get)('colors.icon.tertiary'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.state.focus.border'), (0, _constants.get)('shadows.state.focus.shadow'), props => props.contrast && (0, _styledComponents.css)(["background-color:", ";"], (0, _constants.get)('colors.input.contrastBg')), props => props.disabled && (0, _styledComponents.css)(["color:", ";background-color:", ";border-color:", ";"], (0, _constants.get)('colors.text.secondary'), (0, _constants.get)('colors.input.disabledBg'), (0, _constants.get)('colors.input.disabledBorder')), props => props.block && (0, _styledComponents.css)(["display:block;width:100%;"]), (0, _constants.get)('breakpoints.1'), (0, _constants.get)('fontSizes.1'), _constants.COMMON, _styledSystem.width, _styledSystem.minWidth, _styledSystem.maxWidth, sizeVariants, _sx.default);
|
62
|
+
|
20
63
|
// using forwardRef is important so that other components (ex. SelectMenu) can autofocus the input
|
21
|
-
const TextInput =
|
64
|
+
const TextInput = _react.default.forwardRef(({
|
22
65
|
icon: IconComponent,
|
23
|
-
block,
|
24
|
-
className,
|
25
66
|
contrast,
|
67
|
+
className,
|
68
|
+
block,
|
26
69
|
disabled,
|
27
|
-
sx: sxProp,
|
28
70
|
theme,
|
29
|
-
|
30
|
-
|
31
|
-
maxWidth: maxWidthProp,
|
32
|
-
variant: variantProp,
|
33
|
-
...inputProps
|
71
|
+
sx,
|
72
|
+
...rest
|
34
73
|
}, ref) => {
|
35
74
|
// this class is necessary to style FilterSearch, plz no touchy!
|
36
75
|
const wrapperClasses = (0, _classnames.default)(className, 'TextInput-wrapper');
|
37
|
-
|
38
|
-
|
76
|
+
const wrapperProps = (0, _props.pick)(rest);
|
77
|
+
const inputProps = (0, _props.omit)(rest);
|
78
|
+
return /*#__PURE__*/_react.default.createElement(Wrapper, _extends({
|
39
79
|
className: wrapperClasses,
|
40
|
-
contrast: contrast,
|
41
|
-
disabled: disabled,
|
42
80
|
hasIcon: !!IconComponent,
|
43
|
-
|
81
|
+
block: block,
|
44
82
|
theme: theme,
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}, IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, {
|
83
|
+
disabled: disabled,
|
84
|
+
contrast: contrast,
|
85
|
+
sx: sx
|
86
|
+
}, wrapperProps), IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, {
|
50
87
|
className: "TextInput-icon"
|
51
|
-
}), /*#__PURE__*/_react.default.createElement(
|
88
|
+
}), /*#__PURE__*/_react.default.createElement(Input, _extends({
|
52
89
|
ref: ref,
|
53
90
|
disabled: disabled
|
54
91
|
}, inputProps)));
|
package/lib/ThemeProvider.js
CHANGED
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.useTheme = useTheme;
|
7
7
|
exports.useColorSchemeVar = useColorSchemeVar;
|
8
|
-
exports.default =
|
8
|
+
exports.default = void 0;
|
9
9
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
11
11
|
|
@@ -19,18 +19,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
19
19
|
|
20
20
|
const defaultColorMode = 'day';
|
21
21
|
const defaultDayScheme = 'light';
|
22
|
-
const defaultNightScheme = 'dark';
|
22
|
+
const defaultNightScheme = 'dark';
|
23
23
|
|
24
|
-
const ThemeContext =
|
24
|
+
const ThemeContext = _react.default.createContext({
|
25
25
|
setColorMode: () => null,
|
26
26
|
setDayScheme: () => null,
|
27
27
|
setNightScheme: () => null
|
28
28
|
});
|
29
29
|
|
30
|
-
|
30
|
+
function ThemeProvider({
|
31
31
|
children,
|
32
32
|
...props
|
33
|
-
})
|
33
|
+
}) {
|
34
34
|
var _ref, _props$theme, _ref2, _props$colorMode, _ref3, _props$dayScheme, _ref4, _props$nightScheme;
|
35
35
|
|
36
36
|
// Get fallback values from parent ThemeProvider (if exists)
|
@@ -89,9 +89,8 @@ const ThemeProvider = ({
|
|
89
89
|
}, /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
|
90
90
|
theme: resolvedTheme
|
91
91
|
}, children));
|
92
|
-
}
|
92
|
+
}
|
93
93
|
|
94
|
-
exports.ThemeProvider = ThemeProvider;
|
95
94
|
ThemeProvider.displayName = "ThemeProvider";
|
96
95
|
|
97
96
|
function useTheme() {
|
@@ -113,30 +112,18 @@ function useSystemColorMode() {
|
|
113
112
|
_react.default.useEffect(() => {
|
114
113
|
var _window, _window$matchMedia;
|
115
114
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
117
115
|
const media = (_window = window) === null || _window === void 0 ? void 0 : (_window$matchMedia = _window.matchMedia) === null || _window$matchMedia === void 0 ? void 0 : _window$matchMedia.call(_window, '(prefers-color-scheme: dark)');
|
118
116
|
|
119
117
|
function handleChange(event) {
|
120
118
|
const isNight = event.matches;
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
if (media) {
|
126
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
127
|
-
if (media.addEventListener !== undefined) {
|
128
|
-
media.addEventListener('change', handleChange);
|
129
|
-
return function cleanup() {
|
130
|
-
media.removeEventListener('change', handleChange);
|
131
|
-
};
|
132
|
-
} // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
133
|
-
else if (media.addListener !== undefined) {
|
134
|
-
media.addListener(handleChange);
|
135
|
-
return function cleanup() {
|
136
|
-
media.removeListener(handleChange);
|
137
|
-
};
|
138
|
-
}
|
119
|
+
const systemColorMode = isNight ? 'night' : 'day';
|
120
|
+
setSystemColorMode(systemColorMode);
|
139
121
|
}
|
122
|
+
|
123
|
+
media === null || media === void 0 ? void 0 : media.addEventListener('change', handleChange);
|
124
|
+
return function cleanup() {
|
125
|
+
media === null || media === void 0 ? void 0 : media.removeEventListener('change', handleChange);
|
126
|
+
};
|
140
127
|
}, []);
|
141
128
|
|
142
129
|
return systemColorMode;
|
@@ -145,7 +132,6 @@ function useSystemColorMode() {
|
|
145
132
|
function getSystemColorMode() {
|
146
133
|
var _window$matchMedia2, _window2, _window$matchMedia2$c;
|
147
134
|
|
148
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
149
135
|
if (typeof window !== 'undefined' && (_window$matchMedia2 = (_window2 = window).matchMedia) !== null && _window$matchMedia2 !== void 0 && (_window$matchMedia2$c = _window$matchMedia2.call(_window2, '(prefers-color-scheme: dark)')) !== null && _window$matchMedia2$c !== void 0 && _window$matchMedia2$c.matches) {
|
150
136
|
return 'night';
|
151
137
|
}
|
@@ -179,11 +165,8 @@ function applyColorScheme(theme, colorScheme) {
|
|
179
165
|
}
|
180
166
|
|
181
167
|
if (!theme.colorSchemes[colorScheme]) {
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
const defaultColorScheme = Object.keys(theme.colorSchemes)[0];
|
186
|
-
return (0, _deepmerge.default)(theme, theme.colorSchemes[defaultColorScheme]);
|
168
|
+
console.error(`\`${colorScheme}\` scheme not defined in \`theme.colorSchemes\``);
|
169
|
+
return theme;
|
187
170
|
}
|
188
171
|
|
189
172
|
return (0, _deepmerge.default)(theme, theme.colorSchemes[colorScheme]);
|
package/lib/Timeline.js
CHANGED
@@ -5,51 +5,54 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.default = void 0;
|
7
7
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
9
|
+
|
8
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
9
11
|
|
10
12
|
var _react = _interopRequireDefault(require("react"));
|
11
13
|
|
12
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
13
|
-
|
14
14
|
var _Box = _interopRequireDefault(require("./Box"));
|
15
15
|
|
16
16
|
var _constants = require("./constants");
|
17
17
|
|
18
|
-
var
|
18
|
+
var _Flex = _interopRequireDefault(require("./Flex"));
|
19
19
|
|
20
|
-
|
20
|
+
var _Position = require("./Position");
|
21
21
|
|
22
|
-
|
22
|
+
var _sx = _interopRequireDefault(require("./sx"));
|
23
23
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
25
25
|
|
26
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
27
|
+
|
28
|
+
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; }
|
29
|
+
|
26
30
|
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); }
|
27
31
|
|
28
|
-
const Timeline = (0, _styledComponents.default)(
|
32
|
+
const Timeline = (0, _styledComponents.default)(_Flex.default).withConfig({
|
29
33
|
displayName: "Timeline",
|
30
34
|
componentId: "c4dq2e-0"
|
31
|
-
})(["
|
32
|
-
const TimelineItem = (0, _styledComponents.default)(
|
35
|
+
})(["flex-direction:column;", " ", ";"], props => props.clipSidebar && (0, _styledComponents.css)([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"]), _sx.default);
|
36
|
+
const TimelineItem = (0, _styledComponents.default)(_Flex.default).attrs(props => ({
|
33
37
|
className: (0, _classnames.default)('Timeline-Item', props.className)
|
34
38
|
})).withConfig({
|
35
39
|
displayName: "Timeline__TimelineItem",
|
36
40
|
componentId: "c4dq2e-1"
|
37
|
-
})(["
|
41
|
+
})(["position:relative;padding:", " 0;margin-left:", ";&::before{position:absolute;top:0;bottom:0;left:0;display:block;width:2px;content:'';background-color:", ";}", " ", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('colors.border.secondary'), props => props.condensed && (0, _styledComponents.css)(["padding-top:", ";padding-bottom:0;&:last-child{padding-bottom:", ";}.TimelineItem-Badge{height:16px;margin-top:", ";margin-bottom:", ";color:", ";background-color:", ";border:0;}"], (0, _constants.get)('space.1'), (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('space.2'), (0, _constants.get)('colors.icon.tertiary'), (0, _constants.get)('colors.bg.canvas')), _constants.COMMON, _sx.default);
|
42
|
+
|
43
|
+
var _StyledFlex = (0, _styledComponents.default)(_Flex.default).withConfig({
|
44
|
+
displayName: "Timeline___StyledFlex",
|
45
|
+
componentId: "c4dq2e-2"
|
46
|
+
})(["border-radius:50%;border:2px solid ", ";"], p => p._css);
|
38
47
|
|
39
48
|
const TimelineBadge = props => {
|
40
|
-
return /*#__PURE__*/_react.default.createElement(
|
41
|
-
position: "relative",
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_Position.Relative, {
|
42
50
|
zIndex: 1
|
43
|
-
}, /*#__PURE__*/_react.default.createElement(
|
44
|
-
display: "flex",
|
51
|
+
}, /*#__PURE__*/_react.default.createElement(_StyledFlex, _extends({
|
45
52
|
className: (0, _classnames.default)(props.className, 'TimelineItem-Badge'),
|
46
53
|
flexShrink: 0,
|
47
|
-
borderRadius: "50%",
|
48
|
-
borderWidth: "2px",
|
49
|
-
borderStyle: "solid",
|
50
|
-
borderColor: "canvas.default",
|
51
54
|
overflow: "hidden",
|
52
|
-
color: "
|
55
|
+
color: "icon.secondary",
|
53
56
|
bg: "timeline.badgeBg",
|
54
57
|
width: "32px",
|
55
58
|
height: "32px",
|
@@ -57,18 +60,20 @@ const TimelineBadge = props => {
|
|
57
60
|
ml: "-15px",
|
58
61
|
alignItems: "center",
|
59
62
|
justifyContent: "center"
|
60
|
-
}, props
|
63
|
+
}, props, {
|
64
|
+
_css: (0, _constants.get)('colors.bg.canvas')
|
65
|
+
}), props.children));
|
61
66
|
};
|
62
67
|
|
63
68
|
TimelineBadge.displayName = "TimelineBadge";
|
64
69
|
const TimelineBody = (0, _styledComponents.default)(_Box.default).withConfig({
|
65
70
|
displayName: "Timeline__TimelineBody",
|
66
|
-
componentId: "c4dq2e-2"
|
67
|
-
})(["min-width:0;max-width:100%;margin-top:", ";color:", ";flex:auto;font-size:", ";", ";"], (0, _constants.get)('space.1'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('fontSizes.1'), _sx.default);
|
68
|
-
const TimelineBreak = (0, _styledComponents.default)(_Box.default).withConfig({
|
69
|
-
displayName: "Timeline__TimelineBreak",
|
70
71
|
componentId: "c4dq2e-3"
|
71
|
-
})(["
|
72
|
+
})(["min-width:0;max-width:100%;margin-top:", ";color:", ";flex:auto;font-size:", ";", ";"], (0, _constants.get)('space.1'), (0, _constants.get)('colors.timeline.text'), (0, _constants.get)('fontSizes.1'), _sx.default);
|
73
|
+
const TimelineBreak = (0, _styledComponents.default)(_Position.Relative).withConfig({
|
74
|
+
displayName: "Timeline__TimelineBreak",
|
75
|
+
componentId: "c4dq2e-4"
|
76
|
+
})(["z-index:1;height:24px;margin:0;margin-bottom:-", ";margin-left:0;background-color:", ";border:0;border-top:", " solid ", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('colors.bg.canvas'), (0, _constants.get)('space.1'), (0, _constants.get)('colors.border.primary'), _sx.default);
|
72
77
|
TimelineItem.displayName = 'Timeline.Item';
|
73
78
|
TimelineBadge.displayName = 'Timeline.Badge';
|
74
79
|
TimelineBody.displayName = 'Timeline.Body';
|
package/lib/Tooltip.js
CHANGED
@@ -22,7 +22,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
22
22
|
const TooltipBase = _styledComponents.default.span.withConfig({
|
23
23
|
displayName: "Tooltip__TooltipBase",
|
24
24
|
componentId: "kp39nc-0"
|
25
|
-
})(["position:relative;&::before{position:absolute;z-index:1000001;display:none;width:0px;height:0px;color:", ";pointer-events:none;content:'';border:6px solid transparent;opacity:0;}&::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 ", ";-webkit-font-smoothing:subpixel-antialiased;color:", ";text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:", ";border-radius:", ";opacity:0;}@keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}&:hover,&:active,&:focus{&::before,&::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:0.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:0.4s;}}&.tooltipped-no-delay:hover,&.tooltipped-no-delay:active,&.tooltipped-no-delay:focus{&::before,&::after{animation-delay:0s;}}&.tooltipped-multiline:hover,&.tooltipped-multiline:active,&.tooltipped-multiline:focus{&::after{display:table-cell;}}&.tooltipped-s,&.tooltipped-se,&.tooltipped-sw{&::after{top:100%;right:50%;margin-top:6px;}&::before{top:auto;right:50%;bottom:-7px;margin-right:-6px;border-bottom-color:", ";}}&.tooltipped-se{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-sw::after{margin-right:-", ";}&.tooltipped-n,&.tooltipped-ne,&.tooltipped-nw{&::after{right:50%;bottom:100%;margin-bottom:6px;}&::before{top:-7px;right:50%;bottom:auto;margin-right:-6px;border-top-color:", ";}}&.tooltipped-ne{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-nw::after{margin-right:-", ";}&.tooltipped-s::after,&.tooltipped-n::after{transform:translateX(50%);}&.tooltipped-w{&::after{right:100%;bottom:50%;margin-right:6px;transform:translateY(50%);}&::before{top:50%;bottom:50%;left:-7px;margin-top:-6px;border-left-color:", ";}}&.tooltipped-e{&::after{bottom:50%;left:100%;margin-left:6px;transform:translateY(50%);}&::before{top:50%;right:-7px;bottom:50%;margin-top:-6px;border-right-color:", ";}}&.tooltipped-multiline{&::after{width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}&.tooltipped-s::after,&.tooltipped-n::after{right:auto;left:50%;transform:translateX(-50%);}&.tooltipped-w::after,&.tooltipped-e::after{right:100%;}}&.tooltipped-align-right-2::after{right:0;margin-right:0;}&.tooltipped-align-right-2::before{right:15px;}&.tooltipped-align-left-2::after{left:0;margin-left:0;}&.tooltipped-align-left-2::before{left:10px;}", ";", ";"], (0, _constants.get)('colors.
|
25
|
+
})(["position:relative;&::before{position:absolute;z-index:1000001;display:none;width:0px;height:0px;color:", ";pointer-events:none;content:'';border:6px solid transparent;opacity:0;}&::after{position:absolute;z-index:1000000;display:none;padding:0.5em 0.75em;font:normal normal 11px/1.5 ", ";-webkit-font-smoothing:subpixel-antialiased;color:", ";text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;pointer-events:none;content:attr(aria-label);background:", ";border-radius:", ";opacity:0;}@keyframes tooltip-appear{from{opacity:0;}to{opacity:1;}}&:hover,&:active,&:focus{&::before,&::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:0.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:0.4s;}}&.tooltipped-no-delay:hover,&.tooltipped-no-delay:active,&.tooltipped-no-delay:focus{&::before,&::after{animation-delay:0s;}}&.tooltipped-multiline:hover,&.tooltipped-multiline:active,&.tooltipped-multiline:focus{&::after{display:table-cell;}}&.tooltipped-s,&.tooltipped-se,&.tooltipped-sw{&::after{top:100%;right:50%;margin-top:6px;}&::before{top:auto;right:50%;bottom:-7px;margin-right:-6px;border-bottom-color:", ";}}&.tooltipped-se{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-sw::after{margin-right:-", ";}&.tooltipped-n,&.tooltipped-ne,&.tooltipped-nw{&::after{right:50%;bottom:100%;margin-bottom:6px;}&::before{top:-7px;right:50%;bottom:auto;margin-right:-6px;border-top-color:", ";}}&.tooltipped-ne{&::after{right:auto;left:50%;margin-left:-", ";}}&.tooltipped-nw::after{margin-right:-", ";}&.tooltipped-s::after,&.tooltipped-n::after{transform:translateX(50%);}&.tooltipped-w{&::after{right:100%;bottom:50%;margin-right:6px;transform:translateY(50%);}&::before{top:50%;bottom:50%;left:-7px;margin-top:-6px;border-left-color:", ";}}&.tooltipped-e{&::after{bottom:50%;left:100%;margin-left:6px;transform:translateY(50%);}&::before{top:50%;right:-7px;bottom:50%;margin-top:-6px;border-right-color:", ";}}&.tooltipped-multiline{&::after{width:max-content;max-width:250px;word-wrap:break-word;white-space:pre-line;border-collapse:separate;}&.tooltipped-s::after,&.tooltipped-n::after{right:auto;left:50%;transform:translateX(-50%);}&.tooltipped-w::after,&.tooltipped-e::after{right:100%;}}&.tooltipped-align-right-2::after{right:0;margin-right:0;}&.tooltipped-align-right-2::before{right:15px;}&.tooltipped-align-left-2::after{left:0;margin-left:0;}&.tooltipped-align-left-2::before{left:10px;}", ";", ";"], (0, _constants.get)('colors.tooltip.bg'), (0, _constants.get)('fonts.normal'), (0, _constants.get)('colors.tooltip.text'), (0, _constants.get)('colors.tooltip.bg'), (0, _constants.get)('radii.1'), (0, _constants.get)('colors.tooltip.bg'), (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('colors.tooltip.bg'), (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('colors.tooltip.bg'), (0, _constants.get)('colors.tooltip.bg'), _constants.COMMON, _sx.default);
|
26
26
|
|
27
27
|
function Tooltip({
|
28
28
|
direction = 'n',
|
@@ -36,7 +36,6 @@ function Tooltip({
|
|
36
36
|
}) {
|
37
37
|
const classes = (0, _classnames.default)(className, `tooltipped-${direction}`, align && `tooltipped-align-${align}-2`, noDelay && 'tooltipped-no-delay', wrap && 'tooltipped-multiline');
|
38
38
|
return /*#__PURE__*/_react.default.createElement(TooltipBase, _extends({
|
39
|
-
role: "tooltip",
|
40
39
|
"aria-label": text
|
41
40
|
}, rest, {
|
42
41
|
className: classes
|
package/lib/UnderlineNav.js
CHANGED
@@ -25,7 +25,7 @@ const SELECTED_CLASS = 'selected';
|
|
25
25
|
const UnderlineNavBase = _styledComponents.default.nav.withConfig({
|
26
26
|
displayName: "UnderlineNav__UnderlineNavBase",
|
27
27
|
componentId: "zrnxqt-0"
|
28
|
-
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";", ";"], (0, _constants.get)('colors.border.
|
28
|
+
})(["display:flex;justify-content:space-between;border-bottom:1px solid ", ";&.UnderlineNav--right{justify-content:flex-end;.UnderlineNav-item{margin-right:0;margin-left:", ";}.UnderlineNav-actions{flex:1 1 auto;}}&.UnderlineNav--full{display:block;}.UnderlineNav-body{display:flex;margin-bottom:-1px;}.UnderlineNav-actions{align-self:center;}", ";", ";"], (0, _constants.get)('colors.border.secondary'), (0, _constants.get)('space.3'), _constants.COMMON, _sx.default);
|
29
29
|
|
30
30
|
function UnderlineNav({
|
31
31
|
actions,
|
@@ -57,7 +57,7 @@ const UnderlineNavLink = _styledComponents.default.a.attrs(props => ({
|
|
57
57
|
})).withConfig({
|
58
58
|
displayName: "UnderlineNav__UnderlineNavLink",
|
59
59
|
componentId: "zrnxqt-1"
|
60
|
-
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('space.3'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('lineHeights.default'), (0, _constants.get)('colors.
|
60
|
+
})(["padding:", " ", ";margin-right:", ";font-size:", ";line-height:", ";color:", ";text-align:center;border-bottom:2px solid transparent;text-decoration:none;&:hover,&:focus{color:", ";text-decoration:none;border-bottom-color:", ";transition:0.2s ease;.UnderlineNav-octicon{color:", ";}}&.selected{color:", ";border-bottom-color:", ";.UnderlineNav-octicon{color:", ";}}", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.2'), (0, _constants.get)('space.3'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('lineHeights.default'), (0, _constants.get)('colors.underlinenav.text'), (0, _constants.get)('colors.underlinenav.textHover'), (0, _constants.get)('colors.border.tertiary'), (0, _constants.get)('colors.text.tertiary'), (0, _constants.get)('colors.underlinenav.textActive'), (0, _constants.get)('colors.underlinenav.borderActive'), (0, _constants.get)('colors.underlinenav.iconActive'), _constants.COMMON, _sx.default);
|
61
61
|
|
62
62
|
UnderlineNavLink.displayName = 'UnderlineNav.Link';
|
63
63
|
|
@@ -52,7 +52,7 @@ function getAnchoredPosition(floatingElement, anchorElement, settings = {}) {
|
|
52
52
|
function getPositionedParent(element) {
|
53
53
|
let parentNode = element.parentNode;
|
54
54
|
|
55
|
-
while (parentNode
|
55
|
+
while (parentNode != undefined) {
|
56
56
|
if (parentNode instanceof HTMLElement && getComputedStyle(parentNode).position !== 'static') {
|
57
57
|
return parentNode;
|
58
58
|
}
|
@@ -65,15 +65,15 @@ function getPositionedParent(element) {
|
|
65
65
|
/**
|
66
66
|
* Returns the rectangle (relative to the window) that will clip the given element
|
67
67
|
* if it is rendered outside of its bounds.
|
68
|
-
* @param element
|
69
|
-
* @returns
|
68
|
+
* @param element
|
69
|
+
* @returns
|
70
70
|
*/
|
71
71
|
|
72
72
|
|
73
73
|
function getClippingRect(element) {
|
74
74
|
let parentNode = element;
|
75
75
|
|
76
|
-
while (parentNode
|
76
|
+
while (parentNode != undefined) {
|
77
77
|
if (parentNode === document.body) {
|
78
78
|
break;
|
79
79
|
}
|
@@ -159,7 +159,6 @@ function pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingR
|
|
159
159
|
height: viewportRect.height
|
160
160
|
};
|
161
161
|
let pos = calculatePosition(floatingRect, anchorRect, side, align, anchorOffset, alignmentOffset);
|
162
|
-
let anchorSide = side;
|
163
162
|
pos.top -= relativePosition.top;
|
164
163
|
pos.left -= relativePosition.left; // Handle screen overflow
|
165
164
|
|
@@ -177,7 +176,6 @@ function pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingR
|
|
177
176
|
pos = calculatePosition(floatingRect, anchorRect, nextSide, align, anchorOffset, alignmentOffset);
|
178
177
|
pos.top -= relativePosition.top;
|
179
178
|
pos.left -= relativePosition.left;
|
180
|
-
anchorSide = nextSide;
|
181
179
|
}
|
182
180
|
} // At this point we've flipped the position if applicable. Now just nudge until it's on-screen.
|
183
181
|
|
@@ -204,9 +202,7 @@ function pureCalculateAnchoredPosition(viewportRect, relativePosition, floatingR
|
|
204
202
|
}
|
205
203
|
}
|
206
204
|
|
207
|
-
return
|
208
|
-
anchorSide
|
209
|
-
};
|
205
|
+
return pos;
|
210
206
|
}
|
211
207
|
/**
|
212
208
|
* Given a floating element and an anchor element, return coordinates for the
|
@@ -244,8 +240,7 @@ function calculatePosition(elementDimensions, anchorPosition, side, align, ancho
|
|
244
240
|
left = anchorPosition.left + alignmentOffset;
|
245
241
|
} else if (align === 'center') {
|
246
242
|
left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;
|
247
|
-
} else {
|
248
|
-
// end
|
243
|
+
} else if (align === 'end') {
|
249
244
|
left = anchorRight - elementDimensions.width - alignmentOffset;
|
250
245
|
}
|
251
246
|
}
|
@@ -255,8 +250,7 @@ function calculatePosition(elementDimensions, anchorPosition, side, align, ancho
|
|
255
250
|
top = anchorPosition.top + alignmentOffset;
|
256
251
|
} else if (align === 'center') {
|
257
252
|
top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;
|
258
|
-
} else {
|
259
|
-
// end
|
253
|
+
} else if (align === 'end') {
|
260
254
|
top = anchorBottom - elementDimensions.height - alignmentOffset;
|
261
255
|
}
|
262
256
|
}
|
@@ -278,8 +272,7 @@ function calculatePosition(elementDimensions, anchorPosition, side, align, ancho
|
|
278
272
|
left = anchorPosition.left + alignmentOffset;
|
279
273
|
} else if (align === 'center') {
|
280
274
|
left = anchorPosition.left - (elementDimensions.width - anchorPosition.width) / 2 + alignmentOffset;
|
281
|
-
} else {
|
282
|
-
// end
|
275
|
+
} else if (align === 'end') {
|
283
276
|
left = anchorRight - elementDimensions.width - alignmentOffset;
|
284
277
|
}
|
285
278
|
} else if (side === 'inside-left' || side === 'inside-right' || side === 'inside-center') {
|
@@ -287,8 +280,7 @@ function calculatePosition(elementDimensions, anchorPosition, side, align, ancho
|
|
287
280
|
top = anchorPosition.top + alignmentOffset;
|
288
281
|
} else if (align === 'center') {
|
289
282
|
top = anchorPosition.top - (elementDimensions.height - anchorPosition.height) / 2 + alignmentOffset;
|
290
|
-
} else {
|
291
|
-
// end
|
283
|
+
} else if (align === 'end') {
|
292
284
|
top = anchorBottom - elementDimensions.height - alignmentOffset;
|
293
285
|
}
|
294
286
|
}
|
@@ -60,10 +60,11 @@ function focusTrap(container, initialFocus, abortSignal) {
|
|
60
60
|
let lastFocusedChild = undefined; // Ensure focus remains in the trap zone by checking that a given recently-focused
|
61
61
|
// element is inside the trap zone. If it isn't, redirect focus to a suitable
|
62
62
|
// element within the trap zone. If need to redirect focus and a suitable element
|
63
|
-
// is not found, focus the
|
63
|
+
// is not found, blur the recently-focused element so that focus doesn't leave the
|
64
|
+
// trap zone.
|
64
65
|
|
65
66
|
function ensureTrapZoneHasFocus(focusedElement) {
|
66
|
-
if (focusedElement instanceof HTMLElement
|
67
|
+
if (focusedElement instanceof HTMLElement) {
|
67
68
|
if (container.contains(focusedElement)) {
|
68
69
|
// If a child of the trap zone was focused, remember it
|
69
70
|
lastFocusedChild = focusedElement;
|
@@ -72,33 +73,16 @@ function focusTrap(container, initialFocus, abortSignal) {
|
|
72
73
|
if (lastFocusedChild && (0, _iterateFocusableElements.isTabbable)(lastFocusedChild) && container.contains(lastFocusedChild)) {
|
73
74
|
lastFocusedChild.focus();
|
74
75
|
return;
|
75
|
-
} else if (initialFocus && container.contains(initialFocus)) {
|
76
|
-
initialFocus.focus();
|
77
|
-
return;
|
78
76
|
} else {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
container.focus(); // If a temporary `tabIndex` was provided, remove it.
|
90
|
-
|
91
|
-
if (containerNeedsTemporaryTabIndex) {
|
92
|
-
// Once focus has moved from the container to a child within the FocusTrap,
|
93
|
-
// the container can be made un-refocusable by removing `tabIndex`.
|
94
|
-
container.addEventListener('blur', () => container.removeAttribute('tabindex'), {
|
95
|
-
once: true
|
96
|
-
}); // NB: If `tabIndex` was removed *before* `blur`, then certain browsers (e.g. Chrome)
|
97
|
-
// would consider `body` the `activeElement`, and as a result, keyboard navigation
|
98
|
-
// between children would break, since `body` is outside the `FocusTrap`.
|
77
|
+
const toFocus = initialFocus && container.contains(initialFocus) ? initialFocus : getFocusableChild(container);
|
78
|
+
|
79
|
+
if (toFocus) {
|
80
|
+
toFocus.focus();
|
81
|
+
return;
|
82
|
+
} else {
|
83
|
+
// no element focusable within trap, blur the external element instead
|
84
|
+
focusedElement.blur();
|
99
85
|
}
|
100
|
-
|
101
|
-
return;
|
102
86
|
}
|
103
87
|
}
|
104
88
|
}
|
@@ -150,12 +134,10 @@ function focusTrap(container, initialFocus, abortSignal) {
|
|
150
134
|
tryReactivate();
|
151
135
|
}); // Prevent focus leaving the trap container
|
152
136
|
|
153
|
-
document.addEventListener('
|
137
|
+
document.addEventListener('focusin', event => {
|
154
138
|
ensureTrapZoneHasFocus(event.target);
|
155
|
-
},
|
156
|
-
|
157
|
-
signal: wrappingController.signal,
|
158
|
-
capture: true
|
139
|
+
}, {
|
140
|
+
signal: wrappingController.signal
|
159
141
|
}); // focus the first element
|
160
142
|
|
161
143
|
ensureTrapZoneHasFocus(document.activeElement);
|