@primer/components 0.0.0-2021111171525 → 0.0.0-20211111716
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 +940 -41
- package/README.md +16 -16
- package/codemods/__tests__/deprecateUtilityComponents.js +200 -0
- package/codemods/__tests__/removeSystemProps.js +225 -0
- package/codemods/deprecateUtilityComponents.js +111 -0
- package/codemods/lib/modifyProps.js +9 -7
- package/codemods/lib/prettify.js +1 -1
- package/codemods/lib/replaceImportSource.js +5 -5
- package/codemods/removeSystemProps.js +312 -0
- package/dist/browser.esm.js +1267 -853
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +1304 -890
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Divider.d.ts +9 -0
- package/lib/ActionList/Divider.js +40 -0
- package/lib/ActionList/Group.d.ts +28 -0
- package/lib/ActionList/Group.js +35 -0
- package/lib/ActionList/Header.d.ts +29 -0
- package/lib/ActionList/Header.js +51 -0
- package/lib/ActionList/Item.d.ts +98 -0
- package/lib/ActionList/Item.js +276 -0
- package/lib/ActionList/List.d.ts +88 -0
- package/lib/ActionList/List.js +199 -0
- package/lib/ActionList/index.d.ts +17 -0
- package/lib/ActionList/index.js +29 -0
- package/lib/ActionList2/Description.d.ts +12 -0
- package/lib/ActionList2/Description.js +57 -0
- package/lib/ActionList2/Divider.d.ts +5 -0
- package/lib/ActionList2/Divider.js +35 -0
- package/lib/ActionList2/Group.d.ts +37 -0
- package/lib/ActionList2/Group.js +106 -0
- package/lib/ActionList2/Item.d.ts +63 -0
- package/lib/ActionList2/Item.js +244 -0
- package/lib/ActionList2/LinkItem.d.ts +17 -0
- package/lib/ActionList2/LinkItem.js +57 -0
- package/lib/ActionList2/List.d.ts +26 -0
- package/lib/ActionList2/List.js +58 -0
- package/lib/ActionList2/Selection.d.ts +5 -0
- package/lib/ActionList2/Selection.js +86 -0
- package/lib/ActionList2/Visuals.d.ts +9 -0
- package/lib/ActionList2/Visuals.js +90 -0
- package/lib/ActionList2/index.d.ts +36 -0
- package/lib/ActionList2/index.js +47 -0
- package/lib/ActionMenu.d.ts +40 -0
- package/lib/ActionMenu.js +103 -0
- package/lib/AnchoredOverlay/AnchoredOverlay.d.ts +62 -0
- package/lib/AnchoredOverlay/AnchoredOverlay.js +124 -0
- package/lib/AnchoredOverlay/index.d.ts +2 -0
- package/lib/AnchoredOverlay/index.js +13 -0
- package/lib/Autocomplete/Autocomplete.d.ts +305 -0
- package/lib/Autocomplete/Autocomplete.js +145 -0
- package/lib/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib/Autocomplete/AutocompleteContext.js +11 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +293 -0
- package/lib/Autocomplete/AutocompleteInput.js +157 -0
- package/lib/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib/Autocomplete/AutocompleteMenu.js +224 -0
- package/lib/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib/Autocomplete/AutocompleteOverlay.js +80 -0
- package/lib/Autocomplete/index.d.ts +2 -0
- package/lib/Autocomplete/index.js +15 -0
- package/lib/Avatar.d.ts +14 -0
- package/lib/Avatar.js +1 -12
- package/lib/AvatarPair.d.ts +8 -0
- package/lib/AvatarPair.js +9 -16
- package/lib/AvatarStack.d.ts +8 -0
- package/lib/AvatarStack.js +12 -23
- package/lib/BaseStyles.d.ts +14 -0
- package/lib/BaseStyles.js +25 -31
- package/lib/BorderBox.d.ts +7 -0
- package/lib/BorderBox.js +5 -16
- package/lib/Box.d.ts +6 -0
- package/lib/Box.js +2 -15
- package/lib/BranchName.d.ts +5 -0
- package/lib/BranchName.js +1 -14
- package/lib/Breadcrumbs.d.ts +41 -0
- package/lib/Breadcrumbs.js +82 -0
- package/lib/Button/Button.d.ts +284 -0
- package/lib/Button/Button.js +3 -15
- package/lib/Button/ButtonBase.d.ts +9 -0
- package/lib/Button/ButtonBase.js +2 -25
- package/lib/Button/ButtonClose.d.ts +279 -0
- package/lib/Button/ButtonClose.js +9 -26
- package/lib/Button/ButtonDanger.d.ts +284 -0
- package/lib/Button/ButtonDanger.js +2 -14
- package/lib/Button/ButtonGroup.d.ts +4 -0
- package/lib/Button/ButtonGroup.js +2 -8
- package/lib/Button/ButtonInvisible.d.ts +284 -0
- package/lib/Button/ButtonInvisible.js +3 -15
- package/lib/Button/ButtonOutline.d.ts +284 -0
- package/lib/Button/ButtonOutline.js +2 -14
- package/lib/Button/ButtonPrimary.d.ts +284 -0
- package/lib/Button/ButtonPrimary.js +2 -14
- package/lib/Button/ButtonStyles.d.ts +2 -0
- package/lib/Button/ButtonTableList.d.ts +5 -0
- package/lib/Button/ButtonTableList.js +1 -15
- package/lib/Button/index.d.ts +16 -0
- package/lib/Button/index.js +9 -59
- package/lib/Caret.d.ts +21 -0
- package/lib/Caret.js +14 -17
- package/lib/Checkbox.d.ts +29 -0
- package/lib/Checkbox.js +64 -0
- package/lib/CircleBadge.d.ts +24 -0
- package/lib/CircleBadge.js +2 -20
- package/lib/CircleOcticon.d.ts +392 -0
- package/lib/CircleOcticon.js +9 -18
- package/lib/CounterLabel.d.ts +7 -0
- package/lib/CounterLabel.js +3 -17
- package/lib/Details.d.ts +5 -0
- package/lib/Details.js +1 -11
- package/lib/Dialog/ConfirmationDialog.d.ts +44 -0
- package/lib/Dialog/ConfirmationDialog.js +191 -0
- package/lib/Dialog/Dialog.d.ts +163 -0
- package/lib/Dialog/Dialog.js +311 -0
- package/lib/Dialog.d.ts +406 -0
- package/lib/Dialog.js +34 -49
- package/lib/Dropdown.d.ts +1113 -0
- package/lib/Dropdown.js +45 -60
- package/lib/DropdownMenu/DropdownButton.d.ts +280 -0
- package/lib/DropdownMenu/DropdownButton.js +33 -0
- package/lib/DropdownMenu/DropdownMenu.d.ts +43 -0
- package/lib/DropdownMenu/DropdownMenu.js +94 -0
- package/lib/DropdownMenu/index.d.ts +4 -0
- package/lib/DropdownMenu/index.js +21 -0
- package/lib/DropdownStyles.d.ts +3 -0
- package/lib/DropdownStyles.js +6 -6
- package/lib/FilterList.d.ts +283 -0
- package/lib/FilterList.js +2 -30
- package/lib/FilteredActionList/FilteredActionList.d.ts +16 -0
- package/lib/FilteredActionList/FilteredActionList.js +137 -0
- package/lib/FilteredActionList/index.d.ts +2 -0
- package/lib/FilteredActionList/index.js +13 -0
- package/lib/FilteredSearch.d.ts +5 -0
- package/lib/FilteredSearch.js +1 -12
- package/lib/Flash.d.ts +8 -0
- package/lib/Flash.js +35 -14
- package/lib/Flex.d.ts +7 -0
- package/lib/Flex.js +3 -5
- package/lib/FormGroup.d.ts +11 -0
- package/lib/FormGroup.js +2 -22
- package/lib/Grid.d.ts +7 -0
- package/lib/Grid.js +4 -9
- package/lib/Header.d.ts +23 -0
- package/lib/Header.js +7 -37
- package/lib/Heading.d.ts +5 -0
- package/lib/Heading.js +1 -13
- package/lib/Label.d.ts +10 -0
- package/lib/Label.js +5 -19
- package/lib/LabelGroup.d.ts +5 -0
- package/lib/LabelGroup.js +1 -9
- package/lib/Link.d.ts +9 -0
- package/lib/Link.js +2 -30
- package/lib/NewButton/button-counter.d.ts +6 -0
- package/lib/NewButton/button-counter.js +31 -0
- package/lib/NewButton/button.d.ts +13 -0
- package/lib/NewButton/button.js +308 -0
- package/lib/NewButton/index.d.ts +14 -0
- package/lib/NewButton/index.js +15 -0
- package/lib/NewButton/types.d.ts +32 -0
- package/lib/{utils → NewButton}/types.js +0 -0
- package/lib/Overlay.d.ts +66 -0
- package/lib/Overlay.js +184 -0
- package/lib/Pagehead.d.ts +5 -0
- package/lib/Pagehead.js +1 -13
- package/lib/Pagination/Pagination.d.ts +24 -0
- package/lib/Pagination/Pagination.js +14 -29
- package/lib/Pagination/index.d.ts +3 -0
- package/lib/Pagination/model.d.ts +26 -0
- package/lib/Pagination/model.js +1 -1
- package/lib/PointerBox.d.ts +11 -0
- package/lib/PointerBox.js +4 -13
- package/lib/Popover.d.ts +20 -0
- package/lib/Popover.js +5 -29
- package/lib/Portal/Portal.d.ts +25 -0
- package/lib/Portal/Portal.js +101 -0
- package/lib/Portal/index.d.ts +4 -0
- package/lib/Portal/index.js +17 -0
- package/lib/Position.d.ts +34 -0
- package/lib/Position.js +46 -46
- package/lib/ProgressBar.d.ts +26 -0
- package/lib/ProgressBar.js +8 -27
- package/lib/SelectMenu/SelectMenu.d.ts +1670 -0
- package/lib/SelectMenu/SelectMenu.js +32 -44
- package/lib/SelectMenu/SelectMenuContext.d.ts +8 -0
- package/lib/SelectMenu/SelectMenuContext.js +1 -1
- package/lib/SelectMenu/SelectMenuDivider.d.ts +5 -0
- package/lib/SelectMenu/SelectMenuDivider.js +6 -14
- package/lib/SelectMenu/SelectMenuFilter.d.ts +9 -0
- package/lib/SelectMenu/SelectMenuFilter.js +13 -21
- package/lib/SelectMenu/SelectMenuFooter.d.ts +5 -0
- package/lib/SelectMenu/SelectMenuFooter.js +6 -14
- package/lib/SelectMenu/SelectMenuHeader.d.ts +10 -0
- package/lib/SelectMenu/SelectMenuHeader.js +4 -17
- package/lib/SelectMenu/SelectMenuItem.d.ts +14 -0
- package/lib/SelectMenu/SelectMenuItem.js +13 -21
- package/lib/SelectMenu/SelectMenuList.d.ts +5 -0
- package/lib/SelectMenu/SelectMenuList.js +6 -14
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +7 -0
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +6 -17
- package/lib/SelectMenu/SelectMenuModal.d.ts +14 -0
- package/lib/SelectMenu/SelectMenuModal.js +11 -23
- package/lib/SelectMenu/SelectMenuTab.d.ts +13 -0
- package/lib/SelectMenu/SelectMenuTab.js +16 -26
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +12 -0
- package/lib/SelectMenu/SelectMenuTabPanel.js +14 -25
- package/lib/SelectMenu/SelectMenuTabs.d.ts +10 -0
- package/lib/SelectMenu/SelectMenuTabs.js +10 -17
- package/lib/SelectMenu/hooks/useKeyboardNav.d.ts +2 -0
- package/lib/SelectMenu/hooks/useKeyboardNav.js +2 -0
- package/lib/SelectMenu/index.d.ts +2 -0
- package/lib/SelectMenu/index.js +7 -5
- package/lib/SelectPanel/SelectPanel.d.ts +25 -0
- package/lib/SelectPanel/SelectPanel.js +147 -0
- package/lib/SelectPanel/index.d.ts +2 -0
- package/lib/SelectPanel/index.js +13 -0
- package/lib/SideNav.d.ts +34 -0
- package/lib/SideNav.js +23 -41
- package/lib/Spinner.d.ts +16 -0
- package/lib/Spinner.js +58 -0
- package/lib/StateLabel.d.ts +15 -0
- package/lib/StateLabel.js +53 -23
- package/lib/StyledOcticon.d.ts +11 -0
- package/lib/StyledOcticon.js +1 -15
- package/lib/SubNav.d.ts +26 -0
- package/lib/SubNav.js +27 -49
- package/lib/TabNav.d.ts +19 -0
- package/lib/TabNav.js +15 -37
- package/lib/Text.d.ts +6 -0
- package/lib/Text.js +0 -12
- package/lib/TextInput.d.ts +14 -0
- package/lib/TextInput.js +25 -76
- package/lib/TextInputWithTokens.d.ts +328 -0
- package/lib/TextInputWithTokens.js +318 -0
- package/lib/ThemeProvider.d.ts +26 -0
- package/lib/ThemeProvider.js +193 -0
- package/lib/Timeline.d.ts +33 -0
- package/lib/Timeline.js +34 -87
- package/lib/Token/AvatarToken.d.ts +7 -0
- package/lib/Token/AvatarToken.js +64 -0
- package/lib/Token/IssueLabelToken.d.ts +14 -0
- package/lib/Token/IssueLabelToken.js +144 -0
- package/lib/Token/Token.d.ts +15 -0
- package/lib/Token/Token.js +105 -0
- package/lib/Token/TokenBase.d.ts +31 -0
- package/lib/Token/TokenBase.js +104 -0
- package/lib/Token/_RemoveTokenButton.d.ts +12 -0
- package/lib/Token/_RemoveTokenButton.js +90 -0
- package/lib/Token/_TokenTextContainer.d.ts +3 -0
- package/lib/Token/_TokenTextContainer.js +17 -0
- package/lib/Token/index.d.ts +3 -0
- package/lib/Token/index.js +31 -0
- package/lib/Tooltip.d.ts +17 -0
- package/lib/Tooltip.js +4 -21
- package/lib/Truncate.d.ts +10 -0
- package/lib/Truncate.js +2 -18
- package/lib/UnderlineNav.d.ts +24 -0
- package/lib/UnderlineNav.js +3 -29
- package/lib/_TextInputWrapper.d.ts +10 -0
- package/lib/_TextInputWrapper.js +51 -0
- package/lib/_UnstyledTextInput.d.ts +2 -0
- package/lib/_UnstyledTextInput.js +20 -0
- package/lib/behaviors/anchoredPosition.d.ts +89 -0
- package/lib/behaviors/anchoredPosition.js +316 -0
- package/lib/behaviors/focusTrap.d.ts +12 -0
- package/lib/behaviors/focusTrap.js +179 -0
- package/lib/behaviors/focusZone.d.ts +137 -0
- package/lib/behaviors/focusZone.js +578 -0
- package/lib/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib/behaviors/scrollIntoViewingArea.js +39 -0
- package/lib/constants.d.ts +20 -0
- package/lib/constants.js +11 -27
- package/lib/drafts.d.ts +8 -0
- package/lib/drafts.js +31 -0
- package/lib/hooks/index.d.ts +11 -0
- package/lib/hooks/index.js +61 -0
- package/lib/hooks/useAnchoredPosition.d.ts +20 -0
- package/lib/hooks/useAnchoredPosition.js +51 -0
- package/lib/hooks/useCombinedRefs.d.ts +10 -0
- package/lib/hooks/useCombinedRefs.js +47 -0
- package/lib/hooks/useDetails.d.ts +17 -0
- package/lib/hooks/useDialog.d.ts +16 -0
- package/lib/hooks/useDialog.js +21 -6
- package/lib/hooks/useFocusTrap.d.ts +32 -0
- package/lib/hooks/useFocusTrap.js +69 -0
- package/lib/hooks/useFocusZone.d.ts +23 -0
- package/lib/hooks/useFocusZone.js +53 -0
- package/lib/hooks/useOnEscapePress.d.ts +23 -0
- package/lib/hooks/useOnEscapePress.js +69 -0
- package/lib/hooks/useOnOutsideClick.d.ts +8 -0
- package/lib/hooks/useOnOutsideClick.js +90 -0
- package/lib/hooks/useOpenAndCloseFocus.d.ts +8 -0
- package/lib/hooks/useOpenAndCloseFocus.js +36 -0
- package/lib/hooks/useOverlay.d.ts +15 -0
- package/lib/hooks/useOverlay.js +43 -0
- package/lib/hooks/useProvidedRefOrCreate.d.ts +10 -0
- package/lib/hooks/useProvidedRefOrCreate.js +24 -0
- package/lib/hooks/useProvidedStateOrCreate.d.ts +10 -0
- package/lib/hooks/useProvidedStateOrCreate.js +27 -0
- package/lib/hooks/useRenderForcingRef.d.ts +8 -0
- package/lib/hooks/useRenderForcingRef.js +25 -0
- package/lib/hooks/useResizeObserver.d.ts +1 -0
- package/lib/hooks/useResizeObserver.js +20 -0
- package/lib/hooks/useSafeTimeout.d.ts +12 -0
- package/lib/hooks/useSafeTimeout.js +38 -0
- package/lib/hooks/useScrollFlash.d.ts +6 -0
- package/lib/hooks/useScrollFlash.js +29 -0
- package/lib/index.d.ts +120 -0
- package/lib/index.js +191 -7
- package/lib/polyfills/eventListenerSignal.d.ts +6 -0
- package/lib/polyfills/eventListenerSignal.js +64 -0
- package/lib/sx.d.ts +14 -0
- package/lib/sx.js +8 -5
- package/lib/theme-preval.d.ts +49 -0
- package/lib/theme-preval.js +3119 -357
- package/lib/theme.d.ts +80 -0
- package/lib/theme.js +5 -8
- package/lib/utils/create-slots.d.ts +17 -0
- package/lib/utils/create-slots.js +105 -0
- package/lib/utils/deprecate.d.ts +18 -0
- package/lib/utils/deprecate.js +6 -5
- package/lib/utils/isNumeric.d.ts +1 -0
- package/lib/utils/isNumeric.js +1 -0
- package/lib/utils/iterateFocusableElements.d.ts +42 -0
- package/lib/utils/iterateFocusableElements.js +113 -0
- package/lib/utils/ssr.d.ts +1 -0
- package/lib/utils/ssr.js +19 -0
- package/lib/utils/test-deprecations.d.ts +1 -0
- package/lib/utils/test-deprecations.js +2 -1
- package/lib/utils/test-helpers.d.ts +0 -0
- package/lib/utils/test-helpers.js +9 -0
- package/lib/utils/test-matchers.d.ts +1 -0
- package/lib/utils/test-matchers.js +6 -50
- package/lib/utils/testing.d.ts +545 -0
- package/lib/utils/testing.js +65 -49
- package/lib/utils/theme.d.ts +9 -0
- package/lib/utils/theme.js +68 -0
- package/lib/utils/types/AriaRole.d.ts +1 -0
- package/lib/utils/types/AriaRole.js +1 -0
- package/lib/utils/types/ComponentProps.d.ts +9 -0
- package/lib/utils/types/ComponentProps.js +1 -0
- package/lib/utils/types/Flatten.d.ts +4 -0
- package/lib/utils/types/Flatten.js +1 -0
- package/lib/utils/types/KeyPaths.d.ts +3 -0
- package/lib/utils/types/KeyPaths.js +1 -0
- package/lib/utils/types/MandateProps.d.ts +3 -0
- package/lib/utils/types/MandateProps.js +1 -0
- package/lib/utils/types/Merge.d.ts +19 -0
- package/lib/utils/types/Merge.js +1 -0
- package/lib/utils/types/index.d.ts +5 -0
- package/lib/utils/types/index.js +70 -0
- package/lib/utils/uniqueId.d.ts +1 -0
- package/lib/utils/uniqueId.js +12 -0
- package/lib/utils/use-force-update.d.ts +1 -0
- package/lib/utils/use-force-update.js +19 -0
- package/lib/utils/useIsomorphicLayoutEffect.d.ts +3 -0
- package/lib/utils/useIsomorphicLayoutEffect.js +12 -0
- package/lib/utils/userAgent.d.ts +1 -0
- package/lib/utils/userAgent.js +15 -0
- package/lib-esm/ActionList/Divider.d.ts +9 -0
- package/lib-esm/ActionList/Divider.js +23 -0
- package/lib-esm/ActionList/Group.d.ts +28 -0
- package/lib-esm/ActionList/Group.js +24 -0
- package/lib-esm/ActionList/Header.d.ts +29 -0
- package/lib-esm/ActionList/Header.js +33 -0
- package/lib-esm/ActionList/Item.d.ts +98 -0
- package/lib-esm/ActionList/Item.js +241 -0
- package/lib-esm/ActionList/List.d.ts +88 -0
- package/lib-esm/ActionList/List.js +181 -0
- package/lib-esm/ActionList/index.d.ts +17 -0
- package/lib-esm/ActionList/index.js +18 -0
- package/lib-esm/ActionList2/Description.d.ts +12 -0
- package/lib-esm/ActionList2/Description.js +41 -0
- package/lib-esm/ActionList2/Divider.d.ts +5 -0
- package/lib-esm/ActionList2/Divider.js +23 -0
- package/lib-esm/ActionList2/Group.d.ts +37 -0
- package/lib-esm/ActionList2/Group.js +87 -0
- package/lib-esm/ActionList2/Item.d.ts +63 -0
- package/lib-esm/ActionList2/Item.js +210 -0
- package/lib-esm/ActionList2/LinkItem.d.ts +17 -0
- package/lib-esm/ActionList2/LinkItem.js +43 -0
- package/lib-esm/ActionList2/List.d.ts +26 -0
- package/lib-esm/ActionList2/List.js +36 -0
- package/lib-esm/ActionList2/Selection.d.ts +5 -0
- package/lib-esm/ActionList2/Selection.js +68 -0
- package/lib-esm/ActionList2/Visuals.d.ts +9 -0
- package/lib-esm/ActionList2/Visuals.js +68 -0
- package/lib-esm/ActionList2/index.d.ts +36 -0
- package/lib-esm/ActionList2/index.js +33 -0
- package/lib-esm/ActionMenu.d.ts +40 -0
- package/lib-esm/ActionMenu.js +82 -0
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.d.ts +62 -0
- package/lib-esm/AnchoredOverlay/AnchoredOverlay.js +104 -0
- package/lib-esm/AnchoredOverlay/index.d.ts +2 -0
- package/lib-esm/AnchoredOverlay/index.js +1 -0
- package/lib-esm/Autocomplete/Autocomplete.d.ts +305 -0
- package/lib-esm/Autocomplete/Autocomplete.js +123 -0
- package/lib-esm/Autocomplete/AutocompleteContext.d.ts +17 -0
- package/lib-esm/Autocomplete/AutocompleteContext.js +2 -0
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +293 -0
- package/lib-esm/Autocomplete/AutocompleteInput.js +138 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.d.ts +72 -0
- package/lib-esm/Autocomplete/AutocompleteMenu.js +205 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.d.ts +20 -0
- package/lib-esm/Autocomplete/AutocompleteOverlay.js +62 -0
- package/lib-esm/Autocomplete/index.d.ts +2 -0
- package/lib-esm/Autocomplete/index.js +1 -0
- package/lib-esm/Avatar.d.ts +14 -0
- package/lib-esm/Avatar.js +2 -11
- package/lib-esm/AvatarPair.d.ts +8 -0
- package/lib-esm/AvatarPair.js +8 -14
- package/lib-esm/AvatarStack.d.ts +8 -0
- package/lib-esm/AvatarStack.js +12 -21
- package/lib-esm/BaseStyles.d.ts +14 -0
- package/lib-esm/BaseStyles.js +23 -26
- package/lib-esm/BorderBox.d.ts +7 -0
- package/lib-esm/BorderBox.js +6 -12
- package/lib-esm/Box.d.ts +6 -0
- package/lib-esm/Box.js +2 -13
- package/lib-esm/BranchName.d.ts +5 -0
- package/lib-esm/BranchName.js +2 -13
- package/lib-esm/Breadcrumbs.d.ts +41 -0
- package/lib-esm/Breadcrumbs.js +58 -0
- package/lib-esm/Button/Button.d.ts +284 -0
- package/lib-esm/Button/Button.js +3 -10
- package/lib-esm/Button/ButtonBase.d.ts +9 -0
- package/lib-esm/Button/ButtonBase.js +1 -19
- package/lib-esm/Button/ButtonClose.d.ts +279 -0
- package/lib-esm/Button/ButtonClose.js +5 -20
- package/lib-esm/Button/ButtonDanger.d.ts +284 -0
- package/lib-esm/Button/ButtonDanger.js +2 -9
- package/lib-esm/Button/ButtonGroup.d.ts +4 -0
- package/lib-esm/Button/ButtonGroup.js +2 -7
- package/lib-esm/Button/ButtonInvisible.d.ts +284 -0
- package/lib-esm/Button/ButtonInvisible.js +3 -10
- package/lib-esm/Button/ButtonOutline.d.ts +284 -0
- package/lib-esm/Button/ButtonOutline.js +2 -9
- package/lib-esm/Button/ButtonPrimary.d.ts +284 -0
- package/lib-esm/Button/ButtonPrimary.js +2 -9
- package/lib-esm/Button/ButtonStyles.d.ts +2 -0
- package/lib-esm/Button/ButtonTableList.d.ts +5 -0
- package/lib-esm/Button/ButtonTableList.js +2 -14
- package/lib-esm/Button/index.d.ts +16 -0
- package/lib-esm/Button/index.js +8 -8
- package/lib-esm/Caret.d.ts +21 -0
- package/lib-esm/Caret.js +13 -16
- package/lib-esm/Checkbox.d.ts +29 -0
- package/lib-esm/Checkbox.js +44 -0
- package/lib-esm/CircleBadge.d.ts +24 -0
- package/lib-esm/CircleBadge.js +3 -19
- package/lib-esm/CircleOcticon.d.ts +392 -0
- package/lib-esm/CircleOcticon.js +9 -15
- package/lib-esm/CounterLabel.d.ts +7 -0
- package/lib-esm/CounterLabel.js +4 -16
- package/lib-esm/Details.d.ts +5 -0
- package/lib-esm/Details.js +1 -9
- package/lib-esm/Dialog/ConfirmationDialog.d.ts +44 -0
- package/lib-esm/Dialog/ConfirmationDialog.js +169 -0
- package/lib-esm/Dialog/Dialog.d.ts +163 -0
- package/lib-esm/Dialog/Dialog.js +275 -0
- package/lib-esm/Dialog.d.ts +406 -0
- package/lib-esm/Dialog.js +31 -46
- package/lib-esm/Dropdown.d.ts +1113 -0
- package/lib-esm/Dropdown.js +38 -58
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +280 -0
- package/lib-esm/DropdownMenu/DropdownButton.js +18 -0
- package/lib-esm/DropdownMenu/DropdownMenu.d.ts +43 -0
- package/lib-esm/DropdownMenu/DropdownMenu.js +77 -0
- package/lib-esm/DropdownMenu/index.d.ts +4 -0
- package/lib-esm/DropdownMenu/index.js +2 -0
- package/lib-esm/DropdownStyles.d.ts +3 -0
- package/lib-esm/DropdownStyles.js +6 -6
- package/lib-esm/FilterList.d.ts +283 -0
- package/lib-esm/FilterList.js +3 -29
- package/lib-esm/FilteredActionList/FilteredActionList.d.ts +16 -0
- package/lib-esm/FilteredActionList/FilteredActionList.js +109 -0
- package/lib-esm/FilteredActionList/index.d.ts +2 -0
- package/lib-esm/FilteredActionList/index.js +1 -0
- package/lib-esm/FilteredSearch.d.ts +5 -0
- package/lib-esm/FilteredSearch.js +2 -11
- package/lib-esm/Flash.d.ts +8 -0
- package/lib-esm/Flash.js +36 -13
- package/lib-esm/Flex.d.ts +7 -0
- package/lib-esm/Flex.js +4 -4
- package/lib-esm/FormGroup.d.ts +11 -0
- package/lib-esm/FormGroup.js +3 -20
- package/lib-esm/Grid.d.ts +7 -0
- package/lib-esm/Grid.js +5 -7
- package/lib-esm/Header.d.ts +23 -0
- package/lib-esm/Header.js +6 -34
- package/lib-esm/Heading.d.ts +5 -0
- package/lib-esm/Heading.js +2 -12
- package/lib-esm/Label.d.ts +10 -0
- package/lib-esm/Label.js +3 -15
- package/lib-esm/LabelGroup.d.ts +5 -0
- package/lib-esm/LabelGroup.js +2 -9
- package/lib-esm/Link.d.ts +9 -0
- package/lib-esm/Link.js +2 -28
- package/lib-esm/NewButton/button-counter.d.ts +6 -0
- package/lib-esm/NewButton/button-counter.js +18 -0
- package/lib-esm/NewButton/button.d.ts +13 -0
- package/lib-esm/NewButton/button.js +287 -0
- package/lib-esm/NewButton/index.d.ts +14 -0
- package/lib-esm/NewButton/index.js +5 -0
- package/lib-esm/NewButton/types.d.ts +32 -0
- package/lib-esm/NewButton/types.js +1 -0
- package/lib-esm/Overlay.d.ts +66 -0
- package/lib-esm/Overlay.js +160 -0
- package/lib-esm/Pagehead.d.ts +5 -0
- package/lib-esm/Pagehead.js +2 -12
- package/lib-esm/Pagination/Pagination.d.ts +24 -0
- package/lib-esm/Pagination/Pagination.js +15 -28
- package/lib-esm/Pagination/index.d.ts +3 -0
- package/lib-esm/Pagination/model.d.ts +26 -0
- package/lib-esm/Pagination/model.js +1 -1
- package/lib-esm/PointerBox.d.ts +11 -0
- package/lib-esm/PointerBox.js +4 -11
- package/lib-esm/Popover.d.ts +20 -0
- package/lib-esm/Popover.js +5 -27
- package/lib-esm/Portal/Portal.d.ts +25 -0
- package/lib-esm/Portal/Portal.js +83 -0
- package/lib-esm/Portal/index.d.ts +4 -0
- package/lib-esm/Portal/index.js +3 -0
- package/lib-esm/Position.d.ts +34 -0
- package/lib-esm/Position.js +42 -37
- package/lib-esm/ProgressBar.d.ts +26 -0
- package/lib-esm/ProgressBar.js +9 -25
- package/lib-esm/SelectMenu/SelectMenu.d.ts +1670 -0
- package/lib-esm/SelectMenu/SelectMenu.js +27 -38
- package/lib-esm/SelectMenu/SelectMenuContext.d.ts +8 -0
- package/lib-esm/SelectMenu/SelectMenuContext.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +5 -0
- package/lib-esm/SelectMenu/SelectMenuDivider.js +4 -11
- package/lib-esm/SelectMenu/SelectMenuFilter.d.ts +9 -0
- package/lib-esm/SelectMenu/SelectMenuFilter.js +13 -19
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +5 -0
- package/lib-esm/SelectMenu/SelectMenuFooter.js +4 -11
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +10 -0
- package/lib-esm/SelectMenu/SelectMenuHeader.js +7 -18
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +14 -0
- package/lib-esm/SelectMenu/SelectMenuItem.js +11 -17
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +5 -0
- package/lib-esm/SelectMenu/SelectMenuList.js +4 -11
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +7 -0
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +7 -13
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +14 -0
- package/lib-esm/SelectMenu/SelectMenuModal.js +10 -20
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +13 -0
- package/lib-esm/SelectMenu/SelectMenuTab.js +13 -21
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +12 -0
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +9 -19
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +10 -0
- package/lib-esm/SelectMenu/SelectMenuTabs.js +8 -15
- package/lib-esm/SelectMenu/hooks/useKeyboardNav.d.ts +2 -0
- package/lib-esm/SelectMenu/hooks/useKeyboardNav.js +2 -0
- package/lib-esm/SelectMenu/index.d.ts +2 -0
- package/lib-esm/SelectMenu/index.js +1 -2
- package/lib-esm/SelectPanel/SelectPanel.d.ts +25 -0
- package/lib-esm/SelectPanel/SelectPanel.js +127 -0
- package/lib-esm/SelectPanel/index.d.ts +2 -0
- package/lib-esm/SelectPanel/index.js +1 -0
- package/lib-esm/SideNav.d.ts +34 -0
- package/lib-esm/SideNav.js +20 -36
- package/lib-esm/Spinner.d.ts +16 -0
- package/lib-esm/Spinner.js +45 -0
- package/lib-esm/StateLabel.d.ts +15 -0
- package/lib-esm/StateLabel.js +55 -23
- package/lib-esm/StyledOcticon.d.ts +11 -0
- package/lib-esm/StyledOcticon.js +1 -12
- package/lib-esm/SubNav.d.ts +26 -0
- package/lib-esm/SubNav.js +24 -48
- package/lib-esm/TabNav.d.ts +19 -0
- package/lib-esm/TabNav.js +13 -33
- package/lib-esm/Text.d.ts +6 -0
- package/lib-esm/Text.js +0 -10
- package/lib-esm/TextInput.d.ts +14 -0
- package/lib-esm/TextInput.js +24 -62
- package/lib-esm/TextInputWithTokens.d.ts +328 -0
- package/lib-esm/TextInputWithTokens.js +291 -0
- package/lib-esm/ThemeProvider.d.ts +26 -0
- package/lib-esm/ThemeProvider.js +161 -0
- package/lib-esm/Timeline.d.ts +33 -0
- package/lib-esm/Timeline.js +26 -81
- package/lib-esm/Token/AvatarToken.d.ts +7 -0
- package/lib-esm/Token/AvatarToken.js +43 -0
- package/lib-esm/Token/IssueLabelToken.d.ts +14 -0
- package/lib-esm/Token/IssueLabelToken.js +124 -0
- package/lib-esm/Token/Token.d.ts +15 -0
- package/lib-esm/Token/Token.js +84 -0
- package/lib-esm/Token/TokenBase.d.ts +31 -0
- package/lib-esm/Token/TokenBase.js +83 -0
- package/lib-esm/Token/_RemoveTokenButton.d.ts +12 -0
- package/lib-esm/Token/_RemoveTokenButton.js +69 -0
- package/lib-esm/Token/_TokenTextContainer.d.ts +3 -0
- package/lib-esm/Token/_TokenTextContainer.js +6 -0
- package/lib-esm/Token/index.d.ts +3 -0
- package/lib-esm/Token/index.js +3 -0
- package/lib-esm/Tooltip.d.ts +17 -0
- package/lib-esm/Tooltip.js +4 -19
- package/lib-esm/Truncate.d.ts +10 -0
- package/lib-esm/Truncate.js +2 -15
- package/lib-esm/UnderlineNav.d.ts +24 -0
- package/lib-esm/UnderlineNav.js +5 -28
- package/lib-esm/_TextInputWrapper.d.ts +10 -0
- package/lib-esm/_TextInputWrapper.js +31 -0
- package/lib-esm/_UnstyledTextInput.d.ts +2 -0
- package/lib-esm/_UnstyledTextInput.js +7 -0
- package/lib-esm/behaviors/anchoredPosition.d.ts +89 -0
- package/lib-esm/behaviors/anchoredPosition.js +309 -0
- package/lib-esm/behaviors/focusTrap.d.ts +12 -0
- package/lib-esm/behaviors/focusTrap.js +170 -0
- package/lib-esm/behaviors/focusZone.d.ts +137 -0
- package/lib-esm/behaviors/focusZone.js +560 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.d.ts +1 -0
- package/lib-esm/behaviors/scrollIntoViewingArea.js +30 -0
- package/lib-esm/constants.d.ts +20 -0
- package/lib-esm/constants.js +9 -23
- package/lib-esm/drafts.d.ts +8 -0
- package/lib-esm/drafts.js +9 -0
- package/lib-esm/hooks/index.d.ts +11 -0
- package/lib-esm/hooks/index.js +7 -0
- package/lib-esm/hooks/useAnchoredPosition.d.ts +20 -0
- package/lib-esm/hooks/useAnchoredPosition.js +35 -0
- package/lib-esm/hooks/useCombinedRefs.d.ts +10 -0
- package/lib-esm/hooks/useCombinedRefs.js +37 -0
- package/lib-esm/hooks/useDetails.d.ts +17 -0
- package/lib-esm/hooks/useDialog.d.ts +16 -0
- package/lib-esm/hooks/useDialog.js +21 -6
- package/lib-esm/hooks/useFocusTrap.d.ts +32 -0
- package/lib-esm/hooks/useFocusTrap.js +54 -0
- package/lib-esm/hooks/useFocusZone.d.ts +23 -0
- package/lib-esm/hooks/useFocusZone.js +37 -0
- package/lib-esm/hooks/useOnEscapePress.d.ts +23 -0
- package/lib-esm/hooks/useOnEscapePress.js +59 -0
- package/lib-esm/hooks/useOnOutsideClick.d.ts +8 -0
- package/lib-esm/hooks/useOnOutsideClick.js +79 -0
- package/lib-esm/hooks/useOpenAndCloseFocus.d.ts +8 -0
- package/lib-esm/hooks/useOpenAndCloseFocus.js +27 -0
- package/lib-esm/hooks/useOverlay.d.ts +15 -0
- package/lib-esm/hooks/useOverlay.js +30 -0
- package/lib-esm/hooks/useProvidedRefOrCreate.d.ts +10 -0
- package/lib-esm/hooks/useProvidedRefOrCreate.js +14 -0
- package/lib-esm/hooks/useProvidedStateOrCreate.d.ts +10 -0
- package/lib-esm/hooks/useProvidedStateOrCreate.js +20 -0
- package/lib-esm/hooks/useRenderForcingRef.d.ts +8 -0
- package/lib-esm/hooks/useRenderForcingRef.js +18 -0
- package/lib-esm/hooks/useResizeObserver.d.ts +1 -0
- package/lib-esm/hooks/useResizeObserver.js +10 -0
- package/lib-esm/hooks/useSafeTimeout.d.ts +12 -0
- package/lib-esm/hooks/useSafeTimeout.js +31 -0
- package/lib-esm/hooks/useScrollFlash.d.ts +6 -0
- package/lib-esm/hooks/useScrollFlash.js +22 -0
- package/lib-esm/index.d.ts +120 -0
- package/lib-esm/index.js +29 -7
- package/lib-esm/polyfills/eventListenerSignal.d.ts +6 -0
- package/lib-esm/polyfills/eventListenerSignal.js +57 -0
- package/lib-esm/sx.d.ts +14 -0
- package/lib-esm/sx.js +3 -5
- package/lib-esm/theme-preval.d.ts +49 -0
- package/lib-esm/theme-preval.js +3119 -357
- package/lib-esm/theme.d.ts +80 -0
- package/lib-esm/theme.js +3 -8
- package/lib-esm/utils/create-slots.d.ts +17 -0
- package/lib-esm/utils/create-slots.js +84 -0
- package/lib-esm/utils/deprecate.d.ts +18 -0
- package/lib-esm/utils/deprecate.js +6 -5
- package/lib-esm/utils/isNumeric.d.ts +1 -0
- package/lib-esm/utils/isNumeric.js +1 -0
- package/lib-esm/utils/iterateFocusableElements.d.ts +42 -0
- package/lib-esm/utils/iterateFocusableElements.js +102 -0
- package/lib-esm/utils/ssr.d.ts +1 -0
- package/lib-esm/utils/ssr.js +1 -0
- package/lib-esm/utils/test-deprecations.d.ts +1 -0
- package/lib-esm/utils/test-deprecations.js +1 -1
- package/lib-esm/utils/{types.js → test-helpers.d.ts} +0 -0
- package/lib-esm/utils/test-helpers.js +7 -0
- package/lib-esm/utils/test-matchers.d.ts +1 -0
- package/lib-esm/utils/test-matchers.js +7 -49
- package/lib-esm/utils/testing.d.ts +545 -0
- package/lib-esm/utils/testing.js +60 -46
- package/lib-esm/utils/theme.d.ts +9 -0
- package/lib-esm/utils/theme.js +66 -0
- package/lib-esm/utils/types/AriaRole.d.ts +1 -0
- package/lib-esm/utils/types/AriaRole.js +1 -0
- package/lib-esm/utils/types/ComponentProps.d.ts +9 -0
- package/lib-esm/utils/types/ComponentProps.js +1 -0
- package/lib-esm/utils/types/Flatten.d.ts +4 -0
- package/lib-esm/utils/types/Flatten.js +1 -0
- package/lib-esm/utils/types/KeyPaths.d.ts +3 -0
- package/lib-esm/utils/types/KeyPaths.js +1 -0
- package/lib-esm/utils/types/MandateProps.d.ts +3 -0
- package/lib-esm/utils/types/MandateProps.js +1 -0
- package/lib-esm/utils/types/Merge.d.ts +19 -0
- package/lib-esm/utils/types/Merge.js +1 -0
- package/lib-esm/utils/types/index.d.ts +5 -0
- package/lib-esm/utils/types/index.js +5 -0
- package/lib-esm/utils/uniqueId.d.ts +1 -0
- package/lib-esm/utils/uniqueId.js +5 -0
- package/lib-esm/utils/use-force-update.d.ts +1 -0
- package/lib-esm/utils/use-force-update.js +6 -0
- package/lib-esm/utils/useIsomorphicLayoutEffect.d.ts +3 -0
- package/lib-esm/utils/useIsomorphicLayoutEffect.js +3 -0
- package/lib-esm/utils/userAgent.d.ts +1 -0
- package/lib-esm/utils/userAgent.js +8 -0
- package/package.json +116 -93
- package/index.d.ts +0 -828
- package/lib/Breadcrumb.js +0 -96
- package/lib/hooks/useMouseIntent.js +0 -58
- package/lib/stories/Button.stories.js +0 -100
- package/lib-esm/Breadcrumb.js +0 -70
- package/lib-esm/hooks/useMouseIntent.js +0 -50
- package/lib-esm/stories/Button.stories.js +0 -65
@@ -0,0 +1,318 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
9
|
+
|
10
|
+
var _props = require("@styled-system/props");
|
11
|
+
|
12
|
+
var _focusZone = require("./behaviors/focusZone");
|
13
|
+
|
14
|
+
var _useCombinedRefs = require("./hooks/useCombinedRefs");
|
15
|
+
|
16
|
+
var _useFocusZone = require("./hooks/useFocusZone");
|
17
|
+
|
18
|
+
var _Token = _interopRequireDefault(require("./Token/Token"));
|
19
|
+
|
20
|
+
var _hooks = require("./hooks");
|
21
|
+
|
22
|
+
var _UnstyledTextInput = _interopRequireDefault(require("./_UnstyledTextInput"));
|
23
|
+
|
24
|
+
var _TextInputWrapper = _interopRequireDefault(require("./_TextInputWrapper"));
|
25
|
+
|
26
|
+
var _Box = _interopRequireDefault(require("./Box"));
|
27
|
+
|
28
|
+
var _Text = _interopRequireDefault(require("./Text"));
|
29
|
+
|
30
|
+
var _iterateFocusableElements = require("./utils/iterateFocusableElements");
|
31
|
+
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
33
|
+
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
35
|
+
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
37
|
+
|
38
|
+
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); }
|
39
|
+
|
40
|
+
const overflowCountFontSizeMap = {
|
41
|
+
small: 0,
|
42
|
+
medium: 1,
|
43
|
+
large: 1,
|
44
|
+
extralarge: 2
|
45
|
+
}; // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
46
|
+
|
47
|
+
function TextInputWithTokensInnerComponent({
|
48
|
+
icon: IconComponent,
|
49
|
+
contrast,
|
50
|
+
className,
|
51
|
+
block,
|
52
|
+
disabled,
|
53
|
+
theme,
|
54
|
+
sx: sxProp,
|
55
|
+
tokens,
|
56
|
+
onTokenRemove,
|
57
|
+
tokenComponent: TokenComponent,
|
58
|
+
preventTokenWrapping,
|
59
|
+
size,
|
60
|
+
hideTokenRemoveButtons,
|
61
|
+
maxHeight,
|
62
|
+
width: widthProp,
|
63
|
+
minWidth: minWidthProp,
|
64
|
+
maxWidth: maxWidthProp,
|
65
|
+
variant: variantProp,
|
66
|
+
visibleTokenCount,
|
67
|
+
...rest
|
68
|
+
}, externalRef) {
|
69
|
+
const {
|
70
|
+
onBlur,
|
71
|
+
onFocus,
|
72
|
+
onKeyDown,
|
73
|
+
...inputPropsRest
|
74
|
+
} = (0, _props.omit)(rest);
|
75
|
+
const ref = (0, _hooks.useProvidedRefOrCreate)(externalRef);
|
76
|
+
const localInputRef = (0, _react.useRef)(null);
|
77
|
+
const combinedInputRef = (0, _useCombinedRefs.useCombinedRefs)(localInputRef, ref);
|
78
|
+
const [selectedTokenIndex, setSelectedTokenIndex] = (0, _react.useState)();
|
79
|
+
const [tokensAreTruncated, setTokensAreTruncated] = (0, _react.useState)(Boolean(visibleTokenCount));
|
80
|
+
const {
|
81
|
+
containerRef
|
82
|
+
} = (0, _useFocusZone.useFocusZone)({
|
83
|
+
focusOutBehavior: 'wrap',
|
84
|
+
bindKeys: _focusZone.FocusKeys.ArrowHorizontal | _focusZone.FocusKeys.HomeAndEnd,
|
85
|
+
focusableElementFilter: element => {
|
86
|
+
return !element.getAttributeNames().includes('aria-hidden');
|
87
|
+
},
|
88
|
+
getNextFocusable: direction => {
|
89
|
+
var _containerRef$current;
|
90
|
+
|
91
|
+
if (!selectedTokenIndex && selectedTokenIndex !== 0) {
|
92
|
+
return undefined;
|
93
|
+
}
|
94
|
+
|
95
|
+
let nextIndex = selectedTokenIndex + 1; // "+ 1" accounts for the first element: the text input
|
96
|
+
|
97
|
+
if (direction === 'next') {
|
98
|
+
nextIndex += 1;
|
99
|
+
}
|
100
|
+
|
101
|
+
if (direction === 'previous') {
|
102
|
+
nextIndex -= 1;
|
103
|
+
}
|
104
|
+
|
105
|
+
if (nextIndex > tokens.length || nextIndex < 1) {
|
106
|
+
return combinedInputRef.current || undefined;
|
107
|
+
}
|
108
|
+
|
109
|
+
return (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.children[nextIndex];
|
110
|
+
}
|
111
|
+
}, [selectedTokenIndex]);
|
112
|
+
|
113
|
+
const handleTokenRemove = tokenId => {
|
114
|
+
onTokenRemove(tokenId); // HACK: wait a tick for the the token node to be removed from the DOM
|
115
|
+
|
116
|
+
setTimeout(() => {
|
117
|
+
var _containerRef$current2, _containerRef$current3;
|
118
|
+
|
119
|
+
const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0]; // when removing the first token by keying "Backspace" or "Delete",
|
120
|
+
// `nextFocusableElement` is the div that wraps the input
|
121
|
+
|
122
|
+
const firstFocusable = nextElementToFocus && (0, _iterateFocusableElements.isFocusable)(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(el => (0, _iterateFocusableElements.isFocusable)(el));
|
123
|
+
|
124
|
+
if (firstFocusable) {
|
125
|
+
firstFocusable.focus();
|
126
|
+
} else {
|
127
|
+
var _ref$current;
|
128
|
+
|
129
|
+
// if there are no tokens left, focus the input
|
130
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
131
|
+
}
|
132
|
+
}, 0);
|
133
|
+
};
|
134
|
+
|
135
|
+
const handleTokenFocus = tokenIndex => () => {
|
136
|
+
setSelectedTokenIndex(tokenIndex);
|
137
|
+
};
|
138
|
+
|
139
|
+
const handleTokenBlur = () => {
|
140
|
+
setSelectedTokenIndex(undefined); // HACK: wait a tick and check the focused element before hiding truncated tokens
|
141
|
+
// this prevents the tokens from hiding when the user is moving focus between tokens,
|
142
|
+
// but still hides the tokens when the user blurs the token by tabbing out or clicking somewhere else on the page
|
143
|
+
|
144
|
+
setTimeout(() => {
|
145
|
+
var _containerRef$current4;
|
146
|
+
|
147
|
+
if (!((_containerRef$current4 = containerRef.current) !== null && _containerRef$current4 !== void 0 && _containerRef$current4.contains(document.activeElement)) && visibleTokenCount) {
|
148
|
+
setTokensAreTruncated(true);
|
149
|
+
}
|
150
|
+
}, 0);
|
151
|
+
};
|
152
|
+
|
153
|
+
const handleTokenKeyUp = event => {
|
154
|
+
if (event.key === 'Escape') {
|
155
|
+
var _ref$current2;
|
156
|
+
|
157
|
+
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
158
|
+
}
|
159
|
+
};
|
160
|
+
|
161
|
+
const handleInputFocus = event => {
|
162
|
+
onFocus && onFocus(event);
|
163
|
+
setSelectedTokenIndex(undefined);
|
164
|
+
visibleTokenCount && setTokensAreTruncated(false);
|
165
|
+
};
|
166
|
+
|
167
|
+
const handleInputBlur = event => {
|
168
|
+
onBlur && onBlur(event); // HACK: wait a tick and check the focused element before hiding truncated tokens
|
169
|
+
// this prevents the tokens from hiding when the user is moving focus from the input to a token,
|
170
|
+
// but still hides the tokens when the user blurs the input by tabbing out or clicking somewhere else on the page
|
171
|
+
|
172
|
+
setTimeout(() => {
|
173
|
+
var _containerRef$current5;
|
174
|
+
|
175
|
+
if (!((_containerRef$current5 = containerRef.current) !== null && _containerRef$current5 !== void 0 && _containerRef$current5.contains(document.activeElement)) && visibleTokenCount) {
|
176
|
+
setTokensAreTruncated(true);
|
177
|
+
}
|
178
|
+
}, 0);
|
179
|
+
};
|
180
|
+
|
181
|
+
const handleInputKeyDown = e => {
|
182
|
+
var _ref$current3;
|
183
|
+
|
184
|
+
if (onKeyDown) {
|
185
|
+
onKeyDown(e);
|
186
|
+
}
|
187
|
+
|
188
|
+
if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
|
189
|
+
return;
|
190
|
+
}
|
191
|
+
|
192
|
+
const lastToken = tokens[tokens.length - 1];
|
193
|
+
|
194
|
+
if (e.key === 'Backspace' && lastToken) {
|
195
|
+
handleTokenRemove(lastToken.id);
|
196
|
+
|
197
|
+
if (ref.current) {
|
198
|
+
// TODO: eliminate the first hack by making changes to the Autocomplete component
|
199
|
+
//
|
200
|
+
// HACKS:
|
201
|
+
// 1. Directly setting `ref.current.value` instead of updating state because the autocomplete
|
202
|
+
// highlight behavior doesn't work correctly if we update the value with a setState action in onChange
|
203
|
+
// 2. Adding an extra space so that when I backspace, it doesn't delete the last letter
|
204
|
+
ref.current.value = `${lastToken.text} `;
|
205
|
+
} // HACK: for some reason we need to wait a tick for `.select()` to work
|
206
|
+
|
207
|
+
|
208
|
+
setTimeout(() => {
|
209
|
+
var _ref$current4;
|
210
|
+
|
211
|
+
(_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
|
212
|
+
}, 0);
|
213
|
+
}
|
214
|
+
};
|
215
|
+
|
216
|
+
const focusInput = () => {
|
217
|
+
var _combinedInputRef$cur;
|
218
|
+
|
219
|
+
(_combinedInputRef$cur = combinedInputRef.current) === null || _combinedInputRef$cur === void 0 ? void 0 : _combinedInputRef$cur.focus();
|
220
|
+
};
|
221
|
+
|
222
|
+
const preventTokenClickPropagation = event => {
|
223
|
+
event.stopPropagation();
|
224
|
+
};
|
225
|
+
|
226
|
+
const visibleTokens = tokensAreTruncated ? tokens.slice(0, visibleTokenCount) : tokens;
|
227
|
+
return /*#__PURE__*/_react.default.createElement(_TextInputWrapper.default, {
|
228
|
+
block: block,
|
229
|
+
className: className,
|
230
|
+
contrast: contrast,
|
231
|
+
disabled: disabled,
|
232
|
+
hasIcon: !!IconComponent,
|
233
|
+
theme: theme,
|
234
|
+
width: widthProp,
|
235
|
+
minWidth: minWidthProp,
|
236
|
+
maxWidth: maxWidthProp,
|
237
|
+
variant: variantProp,
|
238
|
+
onClick: focusInput,
|
239
|
+
sx: { ...(block ? {
|
240
|
+
display: 'flex',
|
241
|
+
width: '100%'
|
242
|
+
} : {}),
|
243
|
+
...(maxHeight ? {
|
244
|
+
maxHeight,
|
245
|
+
overflow: 'auto'
|
246
|
+
} : {}),
|
247
|
+
...(preventTokenWrapping ? {
|
248
|
+
overflow: 'auto'
|
249
|
+
} : {}),
|
250
|
+
...sxProp
|
251
|
+
}
|
252
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
253
|
+
ref: containerRef,
|
254
|
+
display: "flex",
|
255
|
+
sx: {
|
256
|
+
alignItems: 'center',
|
257
|
+
flexWrap: preventTokenWrapping ? 'nowrap' : 'wrap',
|
258
|
+
marginLeft: '-0.25rem',
|
259
|
+
marginBottom: '-0.25rem',
|
260
|
+
flexGrow: 1,
|
261
|
+
'> *': {
|
262
|
+
flexShrink: 0,
|
263
|
+
marginLeft: '0.25rem',
|
264
|
+
marginBottom: '0.25rem'
|
265
|
+
}
|
266
|
+
}
|
267
|
+
}, /*#__PURE__*/_react.default.createElement(_Box.default, {
|
268
|
+
sx: {
|
269
|
+
order: 1,
|
270
|
+
flexGrow: 1
|
271
|
+
}
|
272
|
+
}, IconComponent && /*#__PURE__*/_react.default.createElement(IconComponent, {
|
273
|
+
className: "TextInput-icon"
|
274
|
+
}), /*#__PURE__*/_react.default.createElement(_UnstyledTextInput.default, _extends({
|
275
|
+
ref: combinedInputRef,
|
276
|
+
disabled: disabled,
|
277
|
+
onFocus: handleInputFocus,
|
278
|
+
onBlur: handleInputBlur,
|
279
|
+
onKeyDown: handleInputKeyDown,
|
280
|
+
type: "text",
|
281
|
+
sx: {
|
282
|
+
height: '100%'
|
283
|
+
}
|
284
|
+
}, inputPropsRest))), TokenComponent ? visibleTokens.map(({
|
285
|
+
id,
|
286
|
+
...tokenRest
|
287
|
+
}, i) => /*#__PURE__*/_react.default.createElement(TokenComponent, _extends({
|
288
|
+
key: id,
|
289
|
+
onFocus: handleTokenFocus(i),
|
290
|
+
onBlur: handleTokenBlur,
|
291
|
+
onKeyUp: handleTokenKeyUp,
|
292
|
+
onClick: preventTokenClickPropagation,
|
293
|
+
isSelected: selectedTokenIndex === i,
|
294
|
+
onRemove: () => {
|
295
|
+
handleTokenRemove(id);
|
296
|
+
},
|
297
|
+
hideRemoveButton: hideTokenRemoveButtons,
|
298
|
+
size: size,
|
299
|
+
tabIndex: 0
|
300
|
+
}, tokenRest))) : null, tokensAreTruncated ? /*#__PURE__*/_react.default.createElement(_Text.default, {
|
301
|
+
color: "fg.muted",
|
302
|
+
fontSize: size && overflowCountFontSizeMap[size]
|
303
|
+
}, "+", tokens.length - visibleTokens.length) : null));
|
304
|
+
}
|
305
|
+
|
306
|
+
TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";
|
307
|
+
|
308
|
+
const TextInputWithTokens = /*#__PURE__*/_react.default.forwardRef(TextInputWithTokensInnerComponent);
|
309
|
+
|
310
|
+
TextInputWithTokens.defaultProps = {
|
311
|
+
tokenComponent: _Token.default,
|
312
|
+
size: 'extralarge',
|
313
|
+
hideTokenRemoveButtons: false,
|
314
|
+
preventTokenWrapping: false
|
315
|
+
};
|
316
|
+
TextInputWithTokens.displayName = 'TextInputWithTokens';
|
317
|
+
var _default = TextInputWithTokens;
|
318
|
+
exports.default = _default;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export declare type Theme = {
|
3
|
+
[key: string]: any;
|
4
|
+
};
|
5
|
+
declare type ColorMode = 'day' | 'night';
|
6
|
+
declare type ColorModeWithAuto = ColorMode | 'auto';
|
7
|
+
export declare type ThemeProviderProps = {
|
8
|
+
theme?: Theme;
|
9
|
+
colorMode?: ColorModeWithAuto;
|
10
|
+
dayScheme?: string;
|
11
|
+
nightScheme?: string;
|
12
|
+
};
|
13
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
14
|
+
export declare function useTheme(): {
|
15
|
+
theme?: Theme | undefined;
|
16
|
+
colorScheme?: string | undefined;
|
17
|
+
colorMode?: ColorModeWithAuto | undefined;
|
18
|
+
resolvedColorMode?: ColorMode | undefined;
|
19
|
+
dayScheme?: string | undefined;
|
20
|
+
nightScheme?: string | undefined;
|
21
|
+
setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
|
22
|
+
setDayScheme: React.Dispatch<React.SetStateAction<string>>;
|
23
|
+
setNightScheme: React.Dispatch<React.SetStateAction<string>>;
|
24
|
+
};
|
25
|
+
export declare function useColorSchemeVar(values: Partial<Record<string, string>>, fallback: string): string;
|
26
|
+
export default ThemeProvider;
|
@@ -0,0 +1,193 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useTheme = useTheme;
|
7
|
+
exports.useColorSchemeVar = useColorSchemeVar;
|
8
|
+
exports.default = exports.ThemeProvider = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _styledComponents = require("styled-components");
|
13
|
+
|
14
|
+
var _theme = _interopRequireDefault(require("./theme"));
|
15
|
+
|
16
|
+
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
17
|
+
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
|
+
|
20
|
+
const defaultColorMode = 'day';
|
21
|
+
const defaultDayScheme = 'light';
|
22
|
+
const defaultNightScheme = 'dark'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
23
|
+
|
24
|
+
const ThemeContext = /*#__PURE__*/_react.default.createContext({
|
25
|
+
setColorMode: () => null,
|
26
|
+
setDayScheme: () => null,
|
27
|
+
setNightScheme: () => null
|
28
|
+
});
|
29
|
+
|
30
|
+
const ThemeProvider = ({
|
31
|
+
children,
|
32
|
+
...props
|
33
|
+
}) => {
|
34
|
+
var _ref, _props$theme, _ref2, _props$colorMode, _ref3, _props$dayScheme, _ref4, _props$nightScheme;
|
35
|
+
|
36
|
+
// Get fallback values from parent ThemeProvider (if exists)
|
37
|
+
const {
|
38
|
+
theme: fallbackTheme,
|
39
|
+
colorMode: fallbackColorMode,
|
40
|
+
dayScheme: fallbackDayScheme,
|
41
|
+
nightScheme: fallbackNightScheme
|
42
|
+
} = useTheme(); // Initialize state
|
43
|
+
|
44
|
+
const theme = (_ref = (_props$theme = props.theme) !== null && _props$theme !== void 0 ? _props$theme : fallbackTheme) !== null && _ref !== void 0 ? _ref : _theme.default;
|
45
|
+
|
46
|
+
const [colorMode, setColorMode] = _react.default.useState((_ref2 = (_props$colorMode = props.colorMode) !== null && _props$colorMode !== void 0 ? _props$colorMode : fallbackColorMode) !== null && _ref2 !== void 0 ? _ref2 : defaultColorMode);
|
47
|
+
|
48
|
+
const [dayScheme, setDayScheme] = _react.default.useState((_ref3 = (_props$dayScheme = props.dayScheme) !== null && _props$dayScheme !== void 0 ? _props$dayScheme : fallbackDayScheme) !== null && _ref3 !== void 0 ? _ref3 : defaultDayScheme);
|
49
|
+
|
50
|
+
const [nightScheme, setNightScheme] = _react.default.useState((_ref4 = (_props$nightScheme = props.nightScheme) !== null && _props$nightScheme !== void 0 ? _props$nightScheme : fallbackNightScheme) !== null && _ref4 !== void 0 ? _ref4 : defaultNightScheme);
|
51
|
+
|
52
|
+
const systemColorMode = useSystemColorMode();
|
53
|
+
const resolvedColorMode = resolveColorMode(colorMode, systemColorMode);
|
54
|
+
const colorScheme = chooseColorScheme(resolvedColorMode, dayScheme, nightScheme);
|
55
|
+
|
56
|
+
const resolvedTheme = _react.default.useMemo(() => applyColorScheme(theme, colorScheme), [theme, colorScheme]); // Update state if props change
|
57
|
+
|
58
|
+
|
59
|
+
_react.default.useEffect(() => {
|
60
|
+
var _ref5, _props$colorMode2;
|
61
|
+
|
62
|
+
setColorMode((_ref5 = (_props$colorMode2 = props.colorMode) !== null && _props$colorMode2 !== void 0 ? _props$colorMode2 : fallbackColorMode) !== null && _ref5 !== void 0 ? _ref5 : defaultColorMode);
|
63
|
+
}, [props.colorMode, fallbackColorMode]);
|
64
|
+
|
65
|
+
_react.default.useEffect(() => {
|
66
|
+
var _ref6, _props$dayScheme2;
|
67
|
+
|
68
|
+
setDayScheme((_ref6 = (_props$dayScheme2 = props.dayScheme) !== null && _props$dayScheme2 !== void 0 ? _props$dayScheme2 : fallbackDayScheme) !== null && _ref6 !== void 0 ? _ref6 : defaultDayScheme);
|
69
|
+
}, [props.dayScheme, fallbackDayScheme]);
|
70
|
+
|
71
|
+
_react.default.useEffect(() => {
|
72
|
+
var _ref7, _props$nightScheme2;
|
73
|
+
|
74
|
+
setNightScheme((_ref7 = (_props$nightScheme2 = props.nightScheme) !== null && _props$nightScheme2 !== void 0 ? _props$nightScheme2 : fallbackNightScheme) !== null && _ref7 !== void 0 ? _ref7 : defaultNightScheme);
|
75
|
+
}, [props.nightScheme, fallbackNightScheme]);
|
76
|
+
|
77
|
+
return /*#__PURE__*/_react.default.createElement(ThemeContext.Provider, {
|
78
|
+
value: {
|
79
|
+
theme: resolvedTheme,
|
80
|
+
colorScheme,
|
81
|
+
colorMode,
|
82
|
+
resolvedColorMode,
|
83
|
+
dayScheme,
|
84
|
+
nightScheme,
|
85
|
+
setColorMode,
|
86
|
+
setDayScheme,
|
87
|
+
setNightScheme
|
88
|
+
}
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_styledComponents.ThemeProvider, {
|
90
|
+
theme: resolvedTheme
|
91
|
+
}, children));
|
92
|
+
};
|
93
|
+
|
94
|
+
exports.ThemeProvider = ThemeProvider;
|
95
|
+
ThemeProvider.displayName = "ThemeProvider";
|
96
|
+
|
97
|
+
function useTheme() {
|
98
|
+
return _react.default.useContext(ThemeContext);
|
99
|
+
}
|
100
|
+
|
101
|
+
function useColorSchemeVar(values, fallback) {
|
102
|
+
var _values$colorScheme;
|
103
|
+
|
104
|
+
const {
|
105
|
+
colorScheme = ''
|
106
|
+
} = useTheme();
|
107
|
+
return (_values$colorScheme = values[colorScheme]) !== null && _values$colorScheme !== void 0 ? _values$colorScheme : fallback;
|
108
|
+
}
|
109
|
+
|
110
|
+
function useSystemColorMode() {
|
111
|
+
const [systemColorMode, setSystemColorMode] = _react.default.useState(getSystemColorMode);
|
112
|
+
|
113
|
+
_react.default.useEffect(() => {
|
114
|
+
var _window, _window$matchMedia;
|
115
|
+
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
117
|
+
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
|
+
|
119
|
+
function handleChange(event) {
|
120
|
+
const isNight = event.matches;
|
121
|
+
setSystemColorMode(isNight ? 'night' : 'day');
|
122
|
+
} // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
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
|
+
}
|
139
|
+
}
|
140
|
+
}, []);
|
141
|
+
|
142
|
+
return systemColorMode;
|
143
|
+
}
|
144
|
+
|
145
|
+
function getSystemColorMode() {
|
146
|
+
var _window$matchMedia2, _window2, _window$matchMedia2$c;
|
147
|
+
|
148
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
149
|
+
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
|
+
return 'night';
|
151
|
+
}
|
152
|
+
|
153
|
+
return 'day';
|
154
|
+
}
|
155
|
+
|
156
|
+
function resolveColorMode(colorMode, systemColorMode) {
|
157
|
+
switch (colorMode) {
|
158
|
+
case 'auto':
|
159
|
+
return systemColorMode;
|
160
|
+
|
161
|
+
default:
|
162
|
+
return colorMode;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
|
166
|
+
function chooseColorScheme(colorMode, dayScheme, nightScheme) {
|
167
|
+
switch (colorMode) {
|
168
|
+
case 'day':
|
169
|
+
return dayScheme;
|
170
|
+
|
171
|
+
case 'night':
|
172
|
+
return nightScheme;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
function applyColorScheme(theme, colorScheme) {
|
177
|
+
if (!theme.colorSchemes) {
|
178
|
+
return theme;
|
179
|
+
}
|
180
|
+
|
181
|
+
if (!theme.colorSchemes[colorScheme]) {
|
182
|
+
// eslint-disable-next-line no-console
|
183
|
+
console.error(`\`${colorScheme}\` scheme not defined in \`theme.colorSchemes\``); // Apply the first defined color scheme
|
184
|
+
|
185
|
+
const defaultColorScheme = Object.keys(theme.colorSchemes)[0];
|
186
|
+
return (0, _deepmerge.default)(theme, theme.colorSchemes[defaultColorScheme]);
|
187
|
+
}
|
188
|
+
|
189
|
+
return (0, _deepmerge.default)(theme, theme.colorSchemes[colorScheme]);
|
190
|
+
}
|
191
|
+
|
192
|
+
var _default = ThemeProvider;
|
193
|
+
exports.default = _default;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/// <reference types="hoist-non-react-statics" />
|
2
|
+
import React from 'react';
|
3
|
+
import { SxProp } from './sx';
|
4
|
+
import { ComponentProps } from './utils/types';
|
5
|
+
declare const Timeline: import("styled-components").StyledComponent<"div", any, {
|
6
|
+
clipSidebar?: boolean | undefined;
|
7
|
+
} & SxProp, never>;
|
8
|
+
declare const TimelineItem: import("styled-components").StyledComponent<"div", any, {
|
9
|
+
condensed?: boolean | undefined;
|
10
|
+
} & SxProp, never>;
|
11
|
+
export declare type TimelineBadgeProps = {
|
12
|
+
children?: React.ReactNode;
|
13
|
+
} & SxProp;
|
14
|
+
declare const TimelineBody: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
15
|
+
declare const TimelineBreak: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
16
|
+
export declare type TimelineProps = ComponentProps<typeof Timeline>;
|
17
|
+
export declare type TimelineItemsProps = ComponentProps<typeof TimelineItem>;
|
18
|
+
export declare type TimelineBodyProps = ComponentProps<typeof TimelineBody>;
|
19
|
+
export declare type TimelineBreakProps = ComponentProps<typeof TimelineBreak>;
|
20
|
+
declare const _default: string & import("styled-components").StyledComponentBase<"div", any, {
|
21
|
+
clipSidebar?: boolean | undefined;
|
22
|
+
} & SxProp, never> & import("hoist-non-react-statics").NonReactStatics<never, {}> & {
|
23
|
+
Item: import("styled-components").StyledComponent<"div", any, {
|
24
|
+
condensed?: boolean | undefined;
|
25
|
+
} & SxProp, never>;
|
26
|
+
Badge: {
|
27
|
+
(props: TimelineBadgeProps): JSX.Element;
|
28
|
+
displayName: string;
|
29
|
+
};
|
30
|
+
Body: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
31
|
+
Break: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
32
|
+
};
|
33
|
+
export default _default;
|