@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
@@ -9,11 +9,11 @@ import { MenuContext } from './SelectMenuContext';
|
|
9
9
|
const StyledForm = styled.form.withConfig({
|
10
10
|
displayName: "SelectMenuFilter__StyledForm",
|
11
11
|
componentId: "s7ktlh-0"
|
12
|
-
})(["padding:", ";margin:0;border-bottom:", " solid ", ";background-color:", ";", ";@media (min-width:", "){padding:", ";}", ";"], get('space.3'), get('borderWidths.1'), get('colors.
|
13
|
-
const SelectMenuFilter =
|
12
|
+
})(["padding:", ";margin:0;border-bottom:", " solid ", ";background-color:", ";", ";@media (min-width:", "){padding:", ";}", ";"], get('space.3'), get('borderWidths.1'), get('colors.selectMenu.borderSecondary'), get('colors.bg.overlay'), COMMON, get('breakpoints.0'), get('space.2'), sx);
|
13
|
+
const SelectMenuFilter = forwardRef(({
|
14
14
|
theme,
|
15
15
|
value,
|
16
|
-
sx
|
16
|
+
sx,
|
17
17
|
...rest
|
18
18
|
}, forwardedRef) => {
|
19
19
|
const inputRef = useRef(null);
|
@@ -31,7 +31,7 @@ const SelectMenuFilter = /*#__PURE__*/forwardRef(({
|
|
31
31
|
}, [open]);
|
32
32
|
return /*#__PURE__*/React.createElement(StyledForm, {
|
33
33
|
theme: theme,
|
34
|
-
sx:
|
34
|
+
sx: sx
|
35
35
|
}, /*#__PURE__*/React.createElement(TextInput, _extends({
|
36
36
|
theme: theme,
|
37
37
|
ref: ref,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import styled, { css } from 'styled-components';
|
2
2
|
import { COMMON, get } from '../constants';
|
3
3
|
import sx from '../sx';
|
4
|
-
const footerStyles = css(["margin-top:-1px;padding:", " ", ";font-size:", ";color:", ";text-align:center;border-top:", " solid ", ";@media (min-width:", "){padding:", " ", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.
|
4
|
+
const footerStyles = css(["margin-top:-1px;padding:", " ", ";font-size:", ";color:", ";text-align:center;border-top:", " solid ", ";@media (min-width:", "){padding:", " ", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.text.tertiary'), get('borderWidths.1'), get('colors.selectMenu.borderSecondary'), get('breakpoints.0'), get('space.1'), get('space.2'));
|
5
5
|
const SelectMenuFooter = styled.footer.withConfig({
|
6
6
|
displayName: "SelectMenuFooter",
|
7
7
|
componentId: "rkvco1-0"
|
@@ -9,11 +9,11 @@ import sx from '../sx';
|
|
9
9
|
const SelectMenuTitle = styled.h3.withConfig({
|
10
10
|
displayName: "SelectMenuHeader__SelectMenuTitle",
|
11
11
|
componentId: "sc-1pwppzc-0"
|
12
|
-
})(["color:", ";flex:auto;font-size:", ";font-weight:", ";margin:0;@media (min-width:", "){font-size:inherit;}"], get('colors.
|
12
|
+
})(["color:", ";flex:auto;font-size:", ";font-weight:", ";margin:0;@media (min-width:", "){font-size:inherit;}"], get('colors.text.primary'), get('fontSizes.1'), get('fontWeights.bold'), get('breakpoints.0'));
|
13
13
|
const StyledHeader = styled.header.withConfig({
|
14
14
|
displayName: "SelectMenuHeader__StyledHeader",
|
15
15
|
componentId: "sc-1pwppzc-1"
|
16
|
-
})(["display:flex;flex:none;padding:", ";border-bottom:", " solid ", ";", " ", " @media (min-width:", "){padding-top:", ";padding-bottom:", ";}", ";"], get('space.3'), get('borderWidths'), get('colors.
|
16
|
+
})(["display:flex;flex:none;padding:", ";border-bottom:", " solid ", ";", " ", " @media (min-width:", "){padding-top:", ";padding-bottom:", ";}", ";"], get('space.3'), get('borderWidths'), get('colors.selectMenu.borderSecondary'), COMMON, TYPOGRAPHY, get('breakpoints.0'), get('space.2'), get('space.2'), sx);
|
17
17
|
|
18
18
|
const SelectMenuHeader = ({
|
19
19
|
children,
|
@@ -7,14 +7,14 @@ import { COMMON, get } from '../constants';
|
|
7
7
|
import StyledOcticon from '../StyledOcticon';
|
8
8
|
import sx from '../sx';
|
9
9
|
import { MenuContext } from './SelectMenuContext';
|
10
|
-
export const listItemStyles = css(["display:flex;align-items:center;padding:", ";overflow:hidden;text-align:left;cursor:pointer;background-color:", ";border:0;border-bottom:", " solid ", ";color:", ";text-decoration:none;font-size:", ";font-family:inherit;width:100%;&:hover{text-decoration:none;}&:focus{outline:none;}&[hidden]{display:none !important;}@media (min-width:", "){padding-top:", ";padding-bottom:", ";}.SelectMenu-icon{width:", ";margin-right:", ";flex-shrink:0;}.SelectMenu-selected-icon{visibility:hidden;transition:transform 0.12s cubic-bezier(0.5,0.1,1,0.5),visibility 0s 0.12s linear;transform:scale(0);}&[aria-checked='true']{font-weight:500;color:", ";.SelectMenu-selected-icon{visibility:visible;transition:transform 0.12s cubic-bezier(0,0,0.2,1),visibility 0s linear;transform:scale(1);}}@media (hover:hover){
|
10
|
+
export const listItemStyles = css(["display:flex;align-items:center;padding:", ";overflow:hidden;text-align:left;cursor:pointer;background-color:", ";border:0;border-bottom:", " solid ", ";color:", ";text-decoration:none;font-size:", ";font-family:inherit;width:100%;&:hover{text-decoration:none;}&:focus{outline:none;}&[hidden]{display:none !important;}@media (min-width:", "){padding-top:", ";padding-bottom:", ";}.SelectMenu-icon{width:", ";margin-right:", ";flex-shrink:0;}.SelectMenu-selected-icon{visibility:hidden;transition:transform 0.12s cubic-bezier(0.5,0.1,1,0.5),visibility 0s 0.12s linear;transform:scale(0);}&[aria-checked='true']{font-weight:500;color:", ";.SelectMenu-selected-icon{visibility:visible;transition:transform 0.12s cubic-bezier(0,0,0.2,1),visibility 0s linear;transform:scale(1);}}@media (hover:hover){body:not(.intent-mouse) .SelectMenu-item:focus,&:hover,&:active,&:focus{background-color:", ";}}@media (hover:none){&:focus,&:active{background-color:", ";}-webkit-tap-highlight-color:", ";}"], get('space.3'), get('colors.bg.overlay'), get('borderWidths.1'), get('colors.selectMenu.borderSecondary'), get('colors.text.secondary'), get('fontSizes.0'), get('breakpoints.0'), get('space.2'), get('space.2'), get('space.3'), get('space.2'), get('colors.text.primary'), get('colors.state.hover.secondaryBg'), get('colors.bg.secondary'), get('colors.selectMenu.tapHighlight'));
|
11
11
|
const StyledItem = styled.a.attrs(() => ({
|
12
12
|
role: 'menuitemcheckbox'
|
13
13
|
})).withConfig({
|
14
14
|
displayName: "SelectMenuItem__StyledItem",
|
15
15
|
componentId: "gjymba-0"
|
16
16
|
})(["", " ", " ", ";"], listItemStyles, COMMON, sx);
|
17
|
-
const SelectMenuItem =
|
17
|
+
const SelectMenuItem = forwardRef(({
|
18
18
|
children,
|
19
19
|
selected,
|
20
20
|
theme,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import styled, { css } from 'styled-components';
|
2
2
|
import { COMMON, get } from '../constants';
|
3
3
|
import sx from '../sx';
|
4
|
-
const listStyles = css(["position:relative;padding:0;margin:0;flex:auto;overflow-x:hidden;overflow-y:auto;background-color:", ";-webkit-overflow-scrolling:touch;@media (hover:hover){.SelectMenuTab:focus{background-color:", ";}.SelectMenuTab:not([aria-checked='true']):hover{color:", ";background-color:", ";}.SelectMenuTab:not([aria-checked='true']):active{color:", ";background-color:", ";}}"], get('colors.
|
4
|
+
const listStyles = css(["position:relative;padding:0;margin:0;flex:auto;overflow-x:hidden;overflow-y:auto;background-color:", ";-webkit-overflow-scrolling:touch;@media (hover:hover){.SelectMenuTab:focus{background-color:", ";}.SelectMenuTab:not([aria-checked='true']):hover{color:", ";background-color:", ";}.SelectMenuTab:not([aria-checked='true']):active{color:", ";background-color:", ";}}"], get('colors.bg.overlay'), get('colors.selectMenu.tapFocusBg'), get('colors.text.primary'), get('colors.bg.tertiary'), get('colors.text.primary'), get('colors.bg.tertiary'));
|
5
5
|
const SelectMenuList = styled.div.withConfig({
|
6
6
|
displayName: "SelectMenuList",
|
7
7
|
componentId: "sc-1opbpf6-0"
|
@@ -1,14 +1,19 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import styled from 'styled-components';
|
3
|
-
import
|
4
|
-
import
|
2
|
+
import styled, { keyframes } from 'styled-components';
|
3
|
+
import StyledOcticon from '../StyledOcticon';
|
4
|
+
import { OctofaceIcon } from '@primer/octicons-react';
|
5
|
+
import { get, COMMON } from '../constants';
|
6
|
+
const pulseKeyframes = keyframes(["0%{opacity:0.3;}10%{opacity:1;}100%{opacity:0.3;}"]);
|
5
7
|
const Animation = styled.div.withConfig({
|
6
8
|
displayName: "SelectMenuLoadingAnimation__Animation",
|
7
9
|
componentId: "sc-17k54td-0"
|
8
|
-
})(["padding:", " ", ";text-align:center;background-color:", ";", ""], get('space.6'), get('space.4'), get('colors.
|
10
|
+
})(["padding:", " ", ";text-align:center;background-color:", ";animation-name:", ";animation-duration:2s;animation-timing-function:linear;animation-iteration-count:infinite;", ""], get('space.6'), get('space.4'), get('colors.bg.overlay'), pulseKeyframes, COMMON);
|
9
11
|
|
10
12
|
const SelectMenuLoadingAnimation = props => {
|
11
|
-
return /*#__PURE__*/React.createElement(Animation, props, /*#__PURE__*/React.createElement(
|
13
|
+
return /*#__PURE__*/React.createElement(Animation, props, /*#__PURE__*/React.createElement(StyledOcticon, {
|
14
|
+
size: 32,
|
15
|
+
icon: OctofaceIcon
|
16
|
+
}));
|
12
17
|
};
|
13
18
|
|
14
19
|
SelectMenuLoadingAnimation.displayName = "SelectMenuLoadingAnimation";
|
@@ -6,8 +6,8 @@ import { width } from 'styled-system';
|
|
6
6
|
import { COMMON, get } from '../constants';
|
7
7
|
import sx from '../sx';
|
8
8
|
const animateModal = keyframes(["0%{opacity:0;transform:scale(0.9);}"]);
|
9
|
-
const modalStyles = css(["position:relative;z-index:99;display:flex;", ";max-height:", ";margin:auto 0;", ";overflow:hidden;pointer-events:auto;flex-direction:column;background-color:", ";border-radius:", ";box-shadow:", ";animation:", " 0.12s cubic-bezier(0,0.1,0.1,1) backwards;@media (min-width:", "){height:auto;max-height:350px;margin:", " 0 ", " 0;font-size:", ";border:", " solid ", ";border-radius:", ";box-shadow:", ";}"], props => props.filter ? 'height: 80%' : '', props => props.filter ? 'none' : '66%', props => props.filter ? 'margin-top: 0' : '', get('colors.
|
10
|
-
const modalWrapperStyles = css(["position:fixed;top:0;right:0;bottom:0;left:0;z-index:99;display:flex;padding:", ";pointer-events:none;flex-direction:column;&::before{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;content:'';background-color:", ";@media (min-width:", "){display:none;}}@media (min-width:", "){position:absolute;top:auto;right:", ";bottom:auto;left:auto;padding:0;}"], get('space.3'), get('colors.
|
9
|
+
const modalStyles = css(["position:relative;z-index:99;display:flex;", ";max-height:", ";margin:auto 0;", ";overflow:hidden;pointer-events:auto;flex-direction:column;background-color:", ";border-radius:", ";box-shadow:", ";animation:", " 0.12s cubic-bezier(0,0.1,0.1,1) backwards;@media (min-width:", "){height:auto;max-height:350px;margin:", " 0 ", " 0;font-size:", ";border:", " solid ", ";border-radius:", ";box-shadow:", ";}"], props => props.filter ? 'height: 80%' : '', props => props.filter ? 'none' : '66%', props => props.filter ? 'margin-top: 0' : '', get('colors.bg.overlay'), get('radii.2'), get('shadows.shadow.small'), animateModal, get('breakpoints.0'), get('space.1'), get('space.3'), get('fontSizes.0'), get('borderWidths.1'), get('colors.border.overlay'), get('radii.2'), get('shadows.shadow.small'));
|
10
|
+
const modalWrapperStyles = css(["position:fixed;top:0;right:0;bottom:0;left:0;z-index:99;display:flex;padding:", ";pointer-events:none;flex-direction:column;&::before{position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;content:'';background-color:", ";@media (min-width:", "){display:none;}}@media (min-width:", "){position:absolute;top:auto;right:", ";bottom:auto;left:auto;padding:0;}"], get('space.3'), get('colors.selectMenu.backdropBg'), get('breakpoints.0'), get('breakpoints.0'), props => props.align === 'right' ? '0' : 'auto');
|
11
11
|
const Modal = styled.div.withConfig({
|
12
12
|
displayName: "SelectMenuModal__Modal",
|
13
13
|
componentId: "sc-1m5qo55-0"
|
@@ -16,10 +16,10 @@ const ModalWrapper = styled.div.withConfig({
|
|
16
16
|
displayName: "SelectMenuModal__ModalWrapper",
|
17
17
|
componentId: "sc-1m5qo55-1"
|
18
18
|
})(["", " ", " ", ";"], modalWrapperStyles, COMMON, sx);
|
19
|
-
const SelectMenuModal =
|
19
|
+
const SelectMenuModal = React.forwardRef(({
|
20
20
|
children,
|
21
21
|
theme,
|
22
|
-
width
|
22
|
+
width,
|
23
23
|
...rest
|
24
24
|
}, forwardedRef) => {
|
25
25
|
return /*#__PURE__*/React.createElement(ModalWrapper, _extends({
|
@@ -29,7 +29,7 @@ const SelectMenuModal = /*#__PURE__*/React.forwardRef(({
|
|
29
29
|
ref: forwardedRef
|
30
30
|
}), /*#__PURE__*/React.createElement(Modal, {
|
31
31
|
theme: theme,
|
32
|
-
width:
|
32
|
+
width: width
|
33
33
|
}, children));
|
34
34
|
});
|
35
35
|
SelectMenuModal.defaultProps = {
|
@@ -6,7 +6,7 @@ import styled, { css } from 'styled-components';
|
|
6
6
|
import { COMMON, get } from '../constants';
|
7
7
|
import sx from '../sx';
|
8
8
|
import { MenuContext } from './SelectMenuContext';
|
9
|
-
const tabStyles = css(["flex:1;padding:", " ", ";font-size:", ";font-weight:500;color:", ";text-align:center;background-color:transparent;border:0;box-shadow:inset 0 -1px 0 ", ";@media (min-width:", "){flex:none;padding:", " ", ";border:", " solid transparent;border-bottom-width:0;border-top-left-radius:", ";border-top-right-radius:", ";}&[aria-selected='true']{z-index:1;color:", ";background-color:", ";box-shadow:0 0 0 1px ", ";@media (min-width:", "){border-color:", ";box-shadow:none;}}&:focus{background-color:", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.
|
9
|
+
const tabStyles = css(["flex:1;padding:", " ", ";font-size:", ";font-weight:500;color:", ";text-align:center;background-color:transparent;border:0;box-shadow:inset 0 -1px 0 ", ";@media (min-width:", "){flex:none;padding:", " ", ";border:", " solid transparent;border-bottom-width:0;border-top-left-radius:", ";border-top-right-radius:", ";}&[aria-selected='true']{z-index:1;color:", ";background-color:", ";box-shadow:0 0 0 1px ", ";@media (min-width:", "){border-color:", ";box-shadow:none;}}&:focus{background-color:", ";}"], get('space.2'), get('space.3'), get('fontSizes.0'), get('colors.text.tertiary'), get('colors.selectMenu.borderSecondary'), get('breakpoints.0'), get('space.1'), get('space.3'), get('borderWidths.1'), get('radii.2'), get('radii.2'), get('colors.text-primary'), get('colors.bg.overlay'), get('colors.selectMenu.borderSecondary'), get('breakpoints.0'), get('colors.selectMenu.borderSecondary'), get('colors.state.hover.secondaryBg'));
|
10
10
|
const StyledTab = styled.button.withConfig({
|
11
11
|
displayName: "SelectMenuTab__StyledTab",
|
12
12
|
componentId: "ga32sz-0"
|
@@ -9,7 +9,7 @@ import SelectMenuList from './SelectMenuList';
|
|
9
9
|
const TabPanelBase = styled.div.withConfig({
|
10
10
|
displayName: "SelectMenuTabPanel__TabPanelBase",
|
11
11
|
componentId: "ck0ipe-0"
|
12
|
-
})(["border-top:", " solid ", ";", " ", ";"], get('borderWidths.1'), get('colors.
|
12
|
+
})(["border-top:", " solid ", ";", " ", ";"], get('borderWidths.1'), get('colors.selectMenu.borderSecondary'), COMMON, sx);
|
13
13
|
|
14
14
|
const TabPanel = ({
|
15
15
|
tabName,
|
package/lib-esm/SideNav.js
CHANGED
@@ -1,12 +1,11 @@
|
|
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
|
-
|
4
|
-
import
|
3
|
+
import classnames from 'classnames';
|
4
|
+
import React from 'react';
|
5
5
|
import styled, { css } from 'styled-components';
|
6
|
-
import
|
6
|
+
import BorderBox from './BorderBox';
|
7
|
+
import { COMMON, get } from './constants';
|
7
8
|
import Link from './Link';
|
8
|
-
import React from 'react';
|
9
|
-
import classnames from 'classnames';
|
10
9
|
import sx from './sx';
|
11
10
|
|
12
11
|
function SideNavBase({
|
@@ -25,11 +24,7 @@ function SideNavBase({
|
|
25
24
|
};
|
26
25
|
}
|
27
26
|
|
28
|
-
return /*#__PURE__*/React.createElement(
|
29
|
-
borderWidth: "1px",
|
30
|
-
borderStyle: "solid",
|
31
|
-
borderColor: "border.default",
|
32
|
-
borderRadius: 2,
|
27
|
+
return /*#__PURE__*/React.createElement(BorderBox, _extends({
|
33
28
|
as: "nav",
|
34
29
|
className: newClassName
|
35
30
|
}, props), children);
|
@@ -39,11 +34,7 @@ SideNavBase.displayName = "SideNavBase";
|
|
39
34
|
const SideNav = styled(SideNavBase).withConfig({
|
40
35
|
displayName: "SideNav",
|
41
36
|
componentId: "sc-15k667c-0"
|
42
|
-
})(["background-color:", ";", " ", ";", ";"], get('colors.
|
43
|
-
// used for variant normal hover, focus pseudo selectors
|
44
|
-
const CommonAccessibilityVariantNormalStyles = css(["background-color:", ";outline:none;text-decoration:none;"], get('colors.neutral.subtle')); // used for light weight hover, focus pseudo selectors
|
45
|
-
|
46
|
-
const CommonAccessibilityVariantLightWeightStyles = css(["color:", ";text-decoration:none;outline:none;"], get('colors.fg.default'));
|
37
|
+
})(["background-color:", ";", " ", ";", ";"], get('colors.bg.secondary'), props => props.bordered && css(["& > &{border-left:0;border-right:0;border-bottom:0;}"]), COMMON, sx);
|
47
38
|
const SideNavLink = styled(Link).attrs(props => {
|
48
39
|
const isReactRouter = typeof props.to === 'string';
|
49
40
|
|
@@ -59,7 +50,7 @@ const SideNavLink = styled(Link).attrs(props => {
|
|
59
50
|
}).withConfig({
|
60
51
|
displayName: "SideNav__SideNavLink",
|
61
52
|
componentId: "sc-15k667c-1"
|
62
|
-
})(["position:relative;display:block;", " width:100%;text-align:left;font-size:", ";& > ", "{border-bottom:none;}
|
53
|
+
})(["position:relative;display:block;", " width:100%;text-align:left;font-size:", ";& > ", "{border-bottom:none;}&:first-child{border-top-right-radius:", ";border-top-left-radius:", ";}&:last-child{border-bottom-right-radius:", ";border-bottom-left-radius:", ";}", ".variant-normal > &{color:", ";padding:", ";border:0;border-top:", " solid ", ";&:first-child{border-top:0;}&::before{position:absolute;top:0;bottom:0;left:0;z-index:1;width:3px;pointer-events:none;content:'';}&:hover,&:focus{text-decoration:none;background-color:", ";outline:none;}&[aria-current='page'],&[aria-selected='true']{background-color:", ";&::before{background-color:", ";}}}", ".variant-lightweight > &{padding:", " 0;color:", ";&:hover,&:focus{color:", ";text-decoration:none;outline:none;}&[aria-current='page'],&[aria-selected='true']{color:", ";font-weight:", ";}}", ";"], props => props.variant === 'full' && css(["display:flex;align-items:center;justify-content:space-between;"]), get('fontSizes.1'), SideNav, get('radii.2'), get('radii.2'), get('radii.2'), get('radii.2'), SideNav, get('colors.text.primary'), get('space.3'), get('borderWidths.1'), get('colors.border.secondary'), get('colors.state.hover.secondaryBg'), get('colors.sidenav.selectedBg'), get('colors.sidenav.borderActive'), SideNav, get('space.1'), get('colors.text.link'), get('colors.text.primary'), get('colors.text.primary'), get('fontWeights.semibold'), sx);
|
63
54
|
SideNav.defaultProps = {
|
64
55
|
variant: 'normal'
|
65
56
|
};
|
package/lib-esm/StateLabel.js
CHANGED
@@ -68,19 +68,19 @@ const sizeVariants = variant({
|
|
68
68
|
const StateLabelBase = styled.span.withConfig({
|
69
69
|
displayName: "StateLabel__StateLabelBase",
|
70
70
|
componentId: "k4pd9e-0"
|
71
|
-
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";border-width:1px;border-style:solid;", ";", ";", ";", ";"], get('fontWeights.bold'), get('colors.
|
71
|
+
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";border-width:1px;border-style:solid;", ";", ";", ";", ";"], get('fontWeights.bold'), get('colors.bg.primary'), get('radii.3'), colorVariants, sizeVariants, COMMON, sx);
|
72
72
|
|
73
73
|
function StateLabel({
|
74
74
|
children,
|
75
75
|
status,
|
76
|
-
variant
|
76
|
+
variant,
|
77
77
|
...rest
|
78
78
|
}) {
|
79
|
-
const octiconProps =
|
79
|
+
const octiconProps = variant === 'small' ? {
|
80
80
|
width: '1em'
|
81
81
|
} : {};
|
82
82
|
return /*#__PURE__*/React.createElement(StateLabelBase, _extends({}, rest, {
|
83
|
-
variant:
|
83
|
+
variant: variant,
|
84
84
|
status: status
|
85
85
|
}), status && /*#__PURE__*/React.createElement(StyledOcticon, _extends({
|
86
86
|
mr: 1
|
package/lib-esm/SubNav.js
CHANGED
@@ -1,11 +1,10 @@
|
|
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 { COMMON, FLEX, get } from './constants';
|
8
|
-
import
|
7
|
+
import Flex from './Flex';
|
9
8
|
import sx from './sx';
|
10
9
|
const ITEM_CLASS = 'SubNav-item';
|
11
10
|
const SELECTED_CLASS = 'selected';
|
@@ -35,9 +34,7 @@ function SubNav({
|
|
35
34
|
SubNav.displayName = "SubNav";
|
36
35
|
|
37
36
|
function SubNavLinks(props) {
|
38
|
-
return /*#__PURE__*/React.createElement(
|
39
|
-
display: "flex"
|
40
|
-
}, props));
|
37
|
+
return /*#__PURE__*/React.createElement(Flex, props);
|
41
38
|
}
|
42
39
|
|
43
40
|
SubNavLinks.displayName = "SubNavLinks";
|
@@ -47,7 +44,7 @@ const SubNavLink = styled.a.attrs(props => ({
|
|
47
44
|
})).withConfig({
|
48
45
|
displayName: "SubNav__SubNavLink",
|
49
46
|
componentId: "f7w0xa-1"
|
50
|
-
})(["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:", ";}}", ";", ";"], get('space.3'), get('space.3'), get('fontWeights.semibold'), get('fontSizes.1'), get('colors.
|
47
|
+
})(["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:", ";}}", ";", ";"], get('space.3'), get('space.3'), get('fontWeights.semibold'), get('fontSizes.1'), get('colors.text.primary'), get('colors.border.primary'), get('colors.border.primary'), get('colors.border.primary'), get('radii.2'), get('radii.2'), get('colors.border.primary'), get('radii.2'), get('radii.2'), get('colors.bg.tertiary'), get('colors.icon.secondary'), get('colors.state.selected.primaryText'), get('colors.state.selected.primaryBg'), get('colors.state.selected.primaryBorder'), get('colors.state.selected.primaryText'), COMMON, sx);
|
51
48
|
SubNavLink.displayName = 'SubNav.Link';
|
52
49
|
SubNavLinks.displayName = 'SubNav.Links';
|
53
50
|
export default Object.assign(SubNav, {
|
package/lib-esm/TabNav.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
import classnames from 'classnames';
|
2
|
-
|
1
|
+
import classnames from 'classnames';
|
3
2
|
import React from 'react';
|
4
3
|
import styled from 'styled-components';
|
5
4
|
import { COMMON, get } from './constants';
|
@@ -9,7 +8,7 @@ const SELECTED_CLASS = 'selected';
|
|
9
8
|
const TabNavBase = styled.div.withConfig({
|
10
9
|
displayName: "TabNav__TabNavBase",
|
11
10
|
componentId: "sc-1xod0ow-0"
|
12
|
-
})(["margin-top:0;border-bottom:1px solid ", ";", " ", ""], get('colors.border.
|
11
|
+
})(["margin-top:0;border-bottom:1px solid ", ";", " ", ""], get('colors.border.primary'), COMMON, sx);
|
13
12
|
const TabNavBody = styled.nav.withConfig({
|
14
13
|
displayName: "TabNav__TabNavBody",
|
15
14
|
componentId: "sc-1xod0ow-1"
|
@@ -17,7 +16,7 @@ const TabNavBody = styled.nav.withConfig({
|
|
17
16
|
|
18
17
|
function TabNav({
|
19
18
|
children,
|
20
|
-
|
19
|
+
"aria-label": ariaLabel,
|
21
20
|
...rest
|
22
21
|
}) {
|
23
22
|
return /*#__PURE__*/React.createElement(TabNavBase, rest, /*#__PURE__*/React.createElement(TabNavBody, {
|
@@ -32,7 +31,7 @@ const TabNavLink = styled.a.attrs(props => ({
|
|
32
31
|
})).withConfig({
|
33
32
|
displayName: "TabNav__TabNavLink",
|
34
33
|
componentId: "sc-1xod0ow-2"
|
35
|
-
})(["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:", ";}", ";", ";"], get('fontSizes.1'), get('colors.
|
34
|
+
})(["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:", ";}", ";", ";"], get('fontSizes.1'), get('colors.text.primary'), get('colors.text.primary'), get('colors.text.primary'), get('colors.border.primary'), get('radii.2'), get('radii.2'), get('colors.bg.canvas'), COMMON, sx);
|
36
35
|
TabNavLink.displayName = 'TabNav.Link';
|
37
36
|
export default Object.assign(TabNav, {
|
38
37
|
Link: TabNavLink
|
package/lib-esm/TextInput.js
CHANGED
@@ -1,41 +1,68 @@
|
|
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 { omit, pick } from '@styled-system/props';
|
3
4
|
import classnames from 'classnames';
|
4
5
|
import React from 'react';
|
5
|
-
import
|
6
|
-
import
|
6
|
+
import styled, { css } from 'styled-components';
|
7
|
+
import { maxWidth, minWidth, variant, width } from 'styled-system';
|
8
|
+
import { COMMON, get } from './constants';
|
9
|
+
import sx from './sx';
|
10
|
+
const sizeVariants = variant({
|
11
|
+
variants: {
|
12
|
+
small: {
|
13
|
+
minHeight: '28px',
|
14
|
+
px: 2,
|
15
|
+
py: '3px',
|
16
|
+
fontSize: 0,
|
17
|
+
lineHeight: '20px'
|
18
|
+
},
|
19
|
+
large: {
|
20
|
+
px: 2,
|
21
|
+
py: '10px',
|
22
|
+
fontSize: 3
|
23
|
+
}
|
24
|
+
}
|
25
|
+
});
|
26
|
+
const Input = styled.input.withConfig({
|
27
|
+
displayName: "TextInput__Input",
|
28
|
+
componentId: "sc-1apmpmt-0"
|
29
|
+
})(["border:0;font-size:inherit;font-family:inherit;background-color:transparent;-webkit-appearance:none;color:inherit;width:100%;&:focus{outline:0;}"]);
|
30
|
+
const Wrapper = styled.span.withConfig({
|
31
|
+
displayName: "TextInput__Wrapper",
|
32
|
+
componentId: "sc-1apmpmt-1"
|
33
|
+
})(["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:", ";}", " ", " ", " ", " ", " ", ";"], get('fontSizes.1'), get('colors.text.primary'), get('colors.input.border'), get('radii.2'), get('shadows.shadow.inset'), props => {
|
34
|
+
if (props.hasIcon) {
|
35
|
+
return css(["padding:0;"]);
|
36
|
+
} else {
|
37
|
+
return css(["padding:6px 12px;"]);
|
38
|
+
}
|
39
|
+
}, get('colors.icon.tertiary'), get('space.2'), get('colors.state.focus.border'), get('shadows.state.focus.shadow'), props => props.contrast && css(["background-color:", ";"], get('colors.input.contrastBg')), props => props.disabled && css(["color:", ";background-color:", ";border-color:", ";"], get('colors.text.secondary'), get('colors.input.disabledBg'), get('colors.input.disabledBorder')), props => props.block && css(["display:block;width:100%;"]), get('breakpoints.1'), get('fontSizes.1'), COMMON, width, minWidth, maxWidth, sizeVariants, sx);
|
7
40
|
// using forwardRef is important so that other components (ex. SelectMenu) can autofocus the input
|
8
|
-
const TextInput =
|
41
|
+
const TextInput = React.forwardRef(({
|
9
42
|
icon: IconComponent,
|
10
|
-
block,
|
11
|
-
className,
|
12
43
|
contrast,
|
44
|
+
className,
|
45
|
+
block,
|
13
46
|
disabled,
|
14
|
-
sx: sxProp,
|
15
47
|
theme,
|
16
|
-
|
17
|
-
|
18
|
-
maxWidth: maxWidthProp,
|
19
|
-
variant: variantProp,
|
20
|
-
...inputProps
|
48
|
+
sx,
|
49
|
+
...rest
|
21
50
|
}, ref) => {
|
22
51
|
// this class is necessary to style FilterSearch, plz no touchy!
|
23
52
|
const wrapperClasses = classnames(className, 'TextInput-wrapper');
|
24
|
-
|
25
|
-
|
53
|
+
const wrapperProps = pick(rest);
|
54
|
+
const inputProps = omit(rest);
|
55
|
+
return /*#__PURE__*/React.createElement(Wrapper, _extends({
|
26
56
|
className: wrapperClasses,
|
27
|
-
contrast: contrast,
|
28
|
-
disabled: disabled,
|
29
57
|
hasIcon: !!IconComponent,
|
30
|
-
|
58
|
+
block: block,
|
31
59
|
theme: theme,
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}, IconComponent && /*#__PURE__*/React.createElement(IconComponent, {
|
60
|
+
disabled: disabled,
|
61
|
+
contrast: contrast,
|
62
|
+
sx: sx
|
63
|
+
}, wrapperProps), IconComponent && /*#__PURE__*/React.createElement(IconComponent, {
|
37
64
|
className: "TextInput-icon"
|
38
|
-
}), /*#__PURE__*/React.createElement(
|
65
|
+
}), /*#__PURE__*/React.createElement(Input, _extends({
|
39
66
|
ref: ref,
|
40
67
|
disabled: disabled
|
41
68
|
}, inputProps)));
|
package/lib-esm/ThemeProvider.js
CHANGED
@@ -4,17 +4,17 @@ import defaultTheme from './theme';
|
|
4
4
|
import deepmerge from 'deepmerge';
|
5
5
|
const defaultColorMode = 'day';
|
6
6
|
const defaultDayScheme = 'light';
|
7
|
-
const defaultNightScheme = 'dark';
|
8
|
-
|
9
|
-
const ThemeContext = /*#__PURE__*/React.createContext({
|
7
|
+
const defaultNightScheme = 'dark';
|
8
|
+
const ThemeContext = React.createContext({
|
10
9
|
setColorMode: () => null,
|
11
10
|
setDayScheme: () => null,
|
12
11
|
setNightScheme: () => null
|
13
12
|
});
|
14
|
-
|
13
|
+
|
14
|
+
function ThemeProvider({
|
15
15
|
children,
|
16
16
|
...props
|
17
|
-
})
|
17
|
+
}) {
|
18
18
|
var _ref, _props$theme, _ref2, _props$colorMode, _ref3, _props$dayScheme, _ref4, _props$nightScheme;
|
19
19
|
|
20
20
|
// Get fallback values from parent ThemeProvider (if exists)
|
@@ -64,7 +64,8 @@ export const ThemeProvider = ({
|
|
64
64
|
}, /*#__PURE__*/React.createElement(SCThemeProvider, {
|
65
65
|
theme: resolvedTheme
|
66
66
|
}, children));
|
67
|
-
}
|
67
|
+
}
|
68
|
+
|
68
69
|
ThemeProvider.displayName = "ThemeProvider";
|
69
70
|
export function useTheme() {
|
70
71
|
return React.useContext(ThemeContext);
|
@@ -83,30 +84,18 @@ function useSystemColorMode() {
|
|
83
84
|
React.useEffect(() => {
|
84
85
|
var _window, _window$matchMedia;
|
85
86
|
|
86
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
87
87
|
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)');
|
88
88
|
|
89
89
|
function handleChange(event) {
|
90
90
|
const isNight = event.matches;
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
if (media) {
|
96
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
97
|
-
if (media.addEventListener !== undefined) {
|
98
|
-
media.addEventListener('change', handleChange);
|
99
|
-
return function cleanup() {
|
100
|
-
media.removeEventListener('change', handleChange);
|
101
|
-
};
|
102
|
-
} // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
103
|
-
else if (media.addListener !== undefined) {
|
104
|
-
media.addListener(handleChange);
|
105
|
-
return function cleanup() {
|
106
|
-
media.removeListener(handleChange);
|
107
|
-
};
|
108
|
-
}
|
91
|
+
const systemColorMode = isNight ? 'night' : 'day';
|
92
|
+
setSystemColorMode(systemColorMode);
|
109
93
|
}
|
94
|
+
|
95
|
+
media === null || media === void 0 ? void 0 : media.addEventListener('change', handleChange);
|
96
|
+
return function cleanup() {
|
97
|
+
media === null || media === void 0 ? void 0 : media.removeEventListener('change', handleChange);
|
98
|
+
};
|
110
99
|
}, []);
|
111
100
|
return systemColorMode;
|
112
101
|
}
|
@@ -114,7 +103,6 @@ function useSystemColorMode() {
|
|
114
103
|
function getSystemColorMode() {
|
115
104
|
var _window$matchMedia2, _window2, _window$matchMedia2$c;
|
116
105
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
118
106
|
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) {
|
119
107
|
return 'night';
|
120
108
|
}
|
@@ -148,11 +136,8 @@ function applyColorScheme(theme, colorScheme) {
|
|
148
136
|
}
|
149
137
|
|
150
138
|
if (!theme.colorSchemes[colorScheme]) {
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
const defaultColorScheme = Object.keys(theme.colorSchemes)[0];
|
155
|
-
return deepmerge(theme, theme.colorSchemes[defaultColorScheme]);
|
139
|
+
console.error(`\`${colorScheme}\` scheme not defined in \`theme.colorSchemes\``);
|
140
|
+
return theme;
|
156
141
|
}
|
157
142
|
|
158
143
|
return deepmerge(theme, theme.colorSchemes[colorScheme]);
|
package/lib-esm/Timeline.js
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import _styled from "styled-components";
|
2
|
+
|
1
3
|
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
4
|
|
3
5
|
import classnames from 'classnames';
|
@@ -5,32 +7,33 @@ import React from 'react';
|
|
5
7
|
import styled, { css } from 'styled-components';
|
6
8
|
import Box from './Box';
|
7
9
|
import { COMMON, get } from './constants';
|
10
|
+
import Flex from './Flex';
|
11
|
+
import { Relative } from './Position';
|
8
12
|
import sx from './sx';
|
9
|
-
const Timeline = styled(
|
13
|
+
const Timeline = styled(Flex).withConfig({
|
10
14
|
displayName: "Timeline",
|
11
15
|
componentId: "c4dq2e-0"
|
12
|
-
})(["
|
13
|
-
const TimelineItem = styled(
|
16
|
+
})(["flex-direction:column;", " ", ";"], props => props.clipSidebar && css([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"]), sx);
|
17
|
+
const TimelineItem = styled(Flex).attrs(props => ({
|
14
18
|
className: classnames('Timeline-Item', props.className)
|
15
19
|
})).withConfig({
|
16
20
|
displayName: "Timeline__TimelineItem",
|
17
21
|
componentId: "c4dq2e-1"
|
18
|
-
})(["
|
22
|
+
})(["position:relative;padding:", " 0;margin-left:", ";&::before{position:absolute;top:0;bottom:0;left:0;display:block;width:2px;content:'';background-color:", ";}", " ", ";", ";"], get('space.3'), get('space.3'), get('colors.border.secondary'), props => props.condensed && css(["padding-top:", ";padding-bottom:0;&:last-child{padding-bottom:", ";}.TimelineItem-Badge{height:16px;margin-top:", ";margin-bottom:", ";color:", ";background-color:", ";border:0;}"], get('space.1'), get('space.3'), get('space.2'), get('space.2'), get('colors.icon.tertiary'), get('colors.bg.canvas')), COMMON, sx);
|
23
|
+
|
24
|
+
var _StyledFlex = styled(Flex).withConfig({
|
25
|
+
displayName: "Timeline___StyledFlex",
|
26
|
+
componentId: "c4dq2e-2"
|
27
|
+
})(["border-radius:50%;border:2px solid ", ";"], p => p._css);
|
19
28
|
|
20
29
|
const TimelineBadge = props => {
|
21
|
-
return /*#__PURE__*/React.createElement(
|
22
|
-
position: "relative",
|
30
|
+
return /*#__PURE__*/React.createElement(Relative, {
|
23
31
|
zIndex: 1
|
24
|
-
}, /*#__PURE__*/React.createElement(
|
25
|
-
display: "flex",
|
32
|
+
}, /*#__PURE__*/React.createElement(_StyledFlex, _extends({
|
26
33
|
className: classnames(props.className, 'TimelineItem-Badge'),
|
27
34
|
flexShrink: 0,
|
28
|
-
borderRadius: "50%",
|
29
|
-
borderWidth: "2px",
|
30
|
-
borderStyle: "solid",
|
31
|
-
borderColor: "canvas.default",
|
32
35
|
overflow: "hidden",
|
33
|
-
color: "
|
36
|
+
color: "icon.secondary",
|
34
37
|
bg: "timeline.badgeBg",
|
35
38
|
width: "32px",
|
36
39
|
height: "32px",
|
@@ -38,18 +41,20 @@ const TimelineBadge = props => {
|
|
38
41
|
ml: "-15px",
|
39
42
|
alignItems: "center",
|
40
43
|
justifyContent: "center"
|
41
|
-
}, props
|
44
|
+
}, props, {
|
45
|
+
_css: get('colors.bg.canvas')
|
46
|
+
}), props.children));
|
42
47
|
};
|
43
48
|
|
44
49
|
TimelineBadge.displayName = "TimelineBadge";
|
45
50
|
const TimelineBody = styled(Box).withConfig({
|
46
51
|
displayName: "Timeline__TimelineBody",
|
47
|
-
componentId: "c4dq2e-2"
|
48
|
-
})(["min-width:0;max-width:100%;margin-top:", ";color:", ";flex:auto;font-size:", ";", ";"], get('space.1'), get('colors.fg.muted'), get('fontSizes.1'), sx);
|
49
|
-
const TimelineBreak = styled(Box).withConfig({
|
50
|
-
displayName: "Timeline__TimelineBreak",
|
51
52
|
componentId: "c4dq2e-3"
|
52
|
-
})(["
|
53
|
+
})(["min-width:0;max-width:100%;margin-top:", ";color:", ";flex:auto;font-size:", ";", ";"], get('space.1'), get('colors.timeline.text'), get('fontSizes.1'), sx);
|
54
|
+
const TimelineBreak = styled(Relative).withConfig({
|
55
|
+
displayName: "Timeline__TimelineBreak",
|
56
|
+
componentId: "c4dq2e-4"
|
57
|
+
})(["z-index:1;height:24px;margin:0;margin-bottom:-", ";margin-left:0;background-color:", ";border:0;border-top:", " solid ", ";", ";"], get('space.3'), get('colors.bg.canvas'), get('space.1'), get('colors.border.primary'), sx);
|
53
58
|
TimelineItem.displayName = 'Timeline.Item';
|
54
59
|
TimelineBadge.displayName = 'Timeline.Badge';
|
55
60
|
TimelineBody.displayName = 'Timeline.Body';
|