@primer/components 0.0.0-2021102918546 → 0.0.0-202110303104
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 +4 -90
- package/dist/browser.esm.js +774 -718
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +772 -716
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Divider.jsx +29 -0
- package/lib/ActionList/Group.jsx +23 -0
- package/lib/ActionList/Header.jsx +66 -0
- package/lib/ActionList/Item.js +52 -27
- package/lib/ActionList/Item.jsx +311 -0
- package/lib/ActionList/List.jsx +138 -0
- package/lib/ActionList/index.js +12 -23
- package/lib/ActionList2/Description.jsx +29 -0
- package/lib/ActionList2/Divider.jsx +22 -0
- package/lib/ActionList2/Group.d.ts +2 -28
- package/lib/ActionList2/Group.js +6 -55
- package/lib/ActionList2/Group.jsx +25 -0
- package/lib/ActionList2/Header.d.ts +26 -0
- package/lib/ActionList2/Header.js +55 -0
- package/lib/ActionList2/Header.jsx +36 -0
- package/lib/ActionList2/Item.js +1 -2
- package/lib/ActionList2/Item.jsx +174 -0
- package/lib/ActionList2/LinkItem.jsx +28 -0
- package/lib/ActionList2/List.d.ts +1 -1
- package/lib/ActionList2/List.js +2 -1
- package/lib/ActionList2/List.jsx +41 -0
- package/lib/ActionList2/Selection.jsx +50 -0
- package/lib/ActionList2/Visuals.jsx +48 -0
- package/lib/ActionList2/index.js +23 -41
- package/lib/ActionMenu.jsx +73 -0
- package/lib/AnchoredOverlay/AnchoredOverlay.jsx +100 -0
- package/lib/AnchoredOverlay/index.js +4 -12
- package/lib/Autocomplete/Autocomplete.d.ts +3 -4
- package/lib/Autocomplete/Autocomplete.jsx +100 -0
- package/lib/Autocomplete/AutocompleteContext.jsx +5 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +3 -4
- package/lib/Autocomplete/AutocompleteInput.jsx +113 -0
- package/lib/Autocomplete/AutocompleteMenu.jsx +190 -0
- package/lib/Autocomplete/AutocompleteOverlay.jsx +55 -0
- package/lib/Autocomplete/index.js +7 -14
- package/lib/Avatar.jsx +34 -0
- package/lib/AvatarPair.jsx +29 -0
- package/lib/AvatarStack.jsx +151 -0
- package/lib/BaseStyles.jsx +65 -0
- package/lib/BorderBox.jsx +18 -0
- package/lib/Box.jsx +10 -0
- package/lib/BranchName.jsx +20 -0
- package/lib/Breadcrumbs.d.ts +7 -8
- package/lib/Breadcrumbs.js +12 -7
- package/lib/Breadcrumbs.jsx +74 -0
- package/lib/Button/Button.d.ts +3 -3
- package/lib/Button/Button.js +6 -2
- package/lib/Button/Button.jsx +60 -0
- package/lib/Button/ButtonBase.d.ts +8 -5
- package/lib/Button/ButtonBase.js +5 -1
- package/lib/Button/ButtonBase.jsx +36 -0
- package/lib/Button/ButtonClose.d.ts +46 -4
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonClose.jsx +55 -0
- package/lib/Button/ButtonDanger.d.ts +3 -3
- package/lib/Button/ButtonDanger.js +6 -2
- package/lib/Button/ButtonDanger.jsx +63 -0
- package/lib/Button/ButtonGroup.jsx +55 -0
- package/lib/Button/ButtonInvisible.d.ts +3 -3
- package/lib/Button/ButtonInvisible.js +6 -2
- package/lib/Button/ButtonInvisible.jsx +52 -0
- package/lib/Button/ButtonOutline.d.ts +3 -3
- package/lib/Button/ButtonOutline.js +6 -2
- package/lib/Button/ButtonOutline.jsx +63 -0
- package/lib/Button/ButtonPrimary.d.ts +3 -3
- package/lib/Button/ButtonPrimary.js +6 -2
- package/lib/Button/ButtonPrimary.jsx +62 -0
- package/lib/Button/ButtonStyles.jsx +37 -0
- package/lib/Button/ButtonTableList.d.ts +2 -1
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Button/ButtonTableList.jsx +49 -0
- package/lib/Button/index.js +21 -70
- package/lib/Caret.jsx +93 -0
- package/lib/CircleBadge.d.ts +5 -4
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleBadge.jsx +43 -0
- package/lib/CircleOcticon.d.ts +1 -2
- package/lib/CircleOcticon.jsx +21 -0
- package/lib/CounterLabel.d.ts +2 -1
- package/lib/CounterLabel.js +1 -1
- package/lib/CounterLabel.jsx +44 -0
- package/lib/Details.jsx +21 -0
- package/lib/Dialog/ConfirmationDialog.jsx +146 -0
- package/lib/Dialog/Dialog.d.ts +9 -5
- package/lib/Dialog/Dialog.js +11 -17
- package/lib/Dialog/Dialog.jsx +273 -0
- package/lib/Dialog.d.ts +5 -5
- package/lib/Dialog.js +1 -1
- package/lib/Dialog.jsx +131 -0
- package/lib/Dropdown.d.ts +99 -14
- package/lib/Dropdown.js +3 -3
- package/lib/Dropdown.jsx +134 -0
- package/lib/DropdownMenu/DropdownButton.d.ts +47 -4
- package/lib/DropdownMenu/DropdownButton.js +1 -3
- package/lib/DropdownMenu/DropdownButton.jsx +14 -0
- package/lib/DropdownMenu/DropdownMenu.jsx +70 -0
- package/lib/DropdownMenu/index.js +6 -20
- package/lib/DropdownStyles.js +18 -26
- package/lib/EmojiPicker/EmojiPicker.d.ts +15 -0
- package/lib/EmojiPicker/EmojiPicker.js +205 -0
- package/lib/EmojiPicker/EmojiPicker.jsx +125 -0
- package/lib/EmojiPicker/EmojiPickerAnchor.d.ts +0 -0
- package/lib/EmojiPicker/EmojiPickerAnchor.js +1 -0
- package/lib/EmojiPicker/EmojiPickerAnchor.jsx +1 -0
- package/lib/EmojiPicker/EmojiPickerPanel.d.ts +3 -0
- package/lib/EmojiPicker/EmojiPickerPanel.js +18 -0
- package/lib/EmojiPicker/EmojiPickerPanel.jsx +10 -0
- package/lib/EmojiPicker/data.d.ts +9 -0
- package/lib/EmojiPicker/data.js +7254 -0
- package/lib/EmojiPicker/index.d.ts +2 -0
- package/lib/EmojiPicker/index.js +8 -0
- package/lib/FilterList.d.ts +303 -265
- package/lib/FilterList.js +6 -2
- package/lib/FilterList.jsx +63 -0
- package/lib/FilteredActionList/FilteredActionList.jsx +100 -0
- package/lib/FilteredActionList/index.js +4 -12
- package/lib/FilteredSearch.d.ts +2 -1
- package/lib/FilteredSearch.js +1 -1
- package/lib/FilteredSearch.jsx +29 -0
- package/lib/Flash.d.ts +2 -1
- package/lib/Flash.js +1 -1
- package/lib/Flash.jsx +70 -0
- package/lib/Flex.jsx +15 -0
- package/lib/FormGroup.d.ts +5 -4
- package/lib/FormGroup.js +2 -2
- package/lib/FormGroup.jsx +25 -0
- package/lib/Grid.jsx +15 -0
- package/lib/Header.d.ts +7 -6
- package/lib/Header.js +4 -4
- package/lib/Header.jsx +90 -0
- package/lib/Heading.jsx +21 -0
- package/lib/Label.d.ts +2 -1
- package/lib/Label.js +3 -2
- package/lib/Label.jsx +84 -0
- package/lib/LabelGroup.d.ts +2 -1
- package/lib/LabelGroup.js +1 -1
- package/lib/LabelGroup.jsx +19 -0
- package/lib/Link.d.ts +2 -1
- package/lib/Link.js +1 -1
- package/lib/Link.jsx +38 -0
- package/lib/NewButton/button-counter.jsx +14 -0
- package/lib/NewButton/button.js +42 -34
- package/lib/NewButton/button.jsx +278 -0
- package/lib/NewButton/index.js +5 -12
- package/lib/NewButton/types.js +2 -1
- package/lib/Overlay.d.ts +11 -14
- package/lib/Overlay.js +4 -3
- package/lib/Overlay.jsx +156 -0
- package/lib/Pagehead.d.ts +2 -1
- package/lib/Pagehead.js +1 -1
- package/lib/Pagehead.jsx +18 -0
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Pagination/Pagination.jsx +163 -0
- package/lib/Pagination/index.js +6 -12
- package/lib/Pagination/model.jsx +174 -0
- package/lib/PointerBox.jsx +25 -0
- package/lib/Popover.d.ts +5 -4
- package/lib/Popover.js +5 -4
- package/lib/Popover.jsx +210 -0
- package/lib/Portal/Portal.jsx +79 -0
- package/lib/Portal/index.js +5 -16
- package/lib/Position.d.ts +4 -4
- package/lib/Position.jsx +46 -0
- package/lib/ProgressBar.jsx +39 -0
- package/lib/SelectMenu/SelectMenu.d.ts +189 -27
- package/lib/SelectMenu/SelectMenu.js +3 -1
- package/lib/SelectMenu/SelectMenu.jsx +114 -0
- package/lib/SelectMenu/SelectMenuContext.jsx +5 -0
- package/lib/SelectMenu/SelectMenuDivider.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuDivider.jsx +43 -0
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.jsx +59 -0
- package/lib/SelectMenu/SelectMenuFooter.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.jsx +46 -0
- package/lib/SelectMenu/SelectMenuHeader.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuHeader.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.jsx +44 -0
- package/lib/SelectMenu/SelectMenuItem.d.ts +3 -2
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.jsx +143 -0
- package/lib/SelectMenu/SelectMenuList.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuList.jsx +60 -0
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +1 -3
- package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +21 -0
- package/lib/SelectMenu/SelectMenuModal.d.ts +3 -2
- package/lib/SelectMenu/SelectMenuModal.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.jsx +119 -0
- package/lib/SelectMenu/SelectMenuTab.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTab.jsx +93 -0
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.jsx +43 -0
- package/lib/SelectMenu/SelectMenuTabs.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.jsx +58 -0
- package/lib/SelectMenu/hooks/useKeyboardNav.js +80 -96
- package/lib/SelectMenu/index.js +7 -14
- package/lib/SelectPanel/SelectPanel.jsx +105 -0
- package/lib/SelectPanel/index.js +4 -12
- package/lib/SideNav.d.ts +8 -11
- package/lib/SideNav.js +15 -8
- package/lib/SideNav.jsx +177 -0
- package/lib/Spinner.jsx +35 -0
- package/lib/StateLabel.d.ts +2 -1
- package/lib/StateLabel.js +5 -6
- package/lib/StateLabel.jsx +94 -0
- package/lib/StyledOcticon.d.ts +2 -1
- package/lib/StyledOcticon.js +3 -1
- package/lib/StyledOcticon.jsx +20 -0
- package/lib/SubNav.d.ts +11 -5
- package/lib/SubNav.js +12 -7
- package/lib/SubNav.jsx +104 -0
- package/lib/TabNav.d.ts +4 -3
- package/lib/TabNav.js +2 -2
- package/lib/TabNav.jsx +60 -0
- package/lib/Text.jsx +14 -0
- package/lib/TextInput.jsx +23 -0
- package/lib/TextInputWithTokens.d.ts +3 -4
- package/lib/TextInputWithTokens.jsx +218 -0
- package/lib/ThemeProvider.jsx +130 -0
- package/lib/Timeline.d.ts +393 -19
- package/lib/Timeline.js +13 -16
- package/lib/Timeline.jsx +124 -0
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/AvatarToken.jsx +54 -0
- package/lib/Token/IssueLabelToken.d.ts +1 -1
- package/lib/Token/IssueLabelToken.jsx +125 -0
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/Token.jsx +103 -0
- package/lib/Token/TokenBase.jsx +88 -0
- package/lib/Token/_RemoveTokenButton.jsx +108 -0
- package/lib/Token/_TokenTextContainer.jsx +49 -0
- package/lib/Token/index.js +11 -30
- package/lib/Tooltip.d.ts +2 -1
- package/lib/Tooltip.js +1 -1
- package/lib/Tooltip.jsx +246 -0
- package/lib/Truncate.d.ts +2 -1
- package/lib/Truncate.js +3 -1
- package/lib/Truncate.jsx +27 -0
- package/lib/UnderlineNav.d.ts +3 -2
- package/lib/UnderlineNav.js +2 -2
- package/lib/UnderlineNav.jsx +90 -0
- package/lib/_TextInputWrapper.jsx +120 -0
- package/lib/_UnstyledTextInput.jsx +22 -0
- package/lib/behaviors/anchoredPosition.js +205 -234
- package/lib/behaviors/focusTrap.js +121 -157
- package/lib/behaviors/focusZone.js +434 -509
- package/lib/behaviors/scrollIntoViewingArea.js +18 -35
- package/lib/constants.js +39 -43
- package/lib/drafts.js +20 -30
- package/lib/hooks/index.js +16 -60
- package/lib/hooks/useAnchoredPosition.js +32 -40
- package/lib/hooks/useCombinedRefs.js +32 -36
- package/lib/hooks/useDetails.jsx +39 -0
- package/lib/hooks/useDialog.js +72 -96
- package/lib/hooks/useFocusTrap.js +43 -60
- package/lib/hooks/useFocusZone.js +54 -50
- package/lib/hooks/useOnEscapePress.js +25 -36
- package/lib/hooks/useOnOutsideClick.jsx +61 -0
- package/lib/hooks/useOpenAndCloseFocus.js +22 -34
- package/lib/hooks/useOverlay.jsx +15 -0
- package/lib/hooks/useProvidedRefOrCreate.js +10 -14
- package/lib/hooks/useProvidedStateOrCreate.js +13 -16
- package/lib/hooks/useRenderForcingRef.js +13 -17
- package/lib/hooks/useResizeObserver.js +15 -18
- package/lib/hooks/useSafeTimeout.js +22 -30
- package/lib/hooks/useScrollFlash.js +16 -23
- package/lib/index.d.ts +2 -2
- package/lib/index.js +165 -652
- package/lib/polyfills/eventListenerSignal.js +37 -45
- package/lib/sx.js +10 -22
- package/lib/theme-preval.js +64 -3169
- package/lib/theme.js +3 -12
- package/lib/utils/create-slots.jsx +65 -0
- package/lib/utils/deprecate.jsx +59 -0
- package/lib/utils/isNumeric.jsx +7 -0
- package/lib/utils/iterateFocusableElements.js +63 -85
- package/lib/utils/ssr.jsx +6 -0
- package/lib/utils/test-deprecations.jsx +20 -0
- package/lib/utils/test-helpers.jsx +8 -0
- package/lib/utils/test-matchers.jsx +100 -0
- package/lib/utils/testing.d.ts +61 -8
- package/lib/utils/testing.js +0 -29
- package/lib/utils/testing.jsx +206 -0
- package/lib/utils/theme.js +33 -47
- package/lib/utils/types/AriaRole.js +2 -1
- package/lib/utils/types/ComponentProps.js +2 -1
- package/lib/utils/types/Flatten.js +2 -1
- package/lib/utils/types/KeyPaths.js +2 -1
- package/lib/utils/types/MandateProps.js +16 -1
- package/lib/utils/types/Merge.js +2 -1
- package/lib/utils/types/index.js +16 -69
- package/lib/utils/uniqueId.js +5 -8
- package/lib/utils/use-force-update.js +8 -14
- package/lib/utils/useIsomorphicLayoutEffect.js +8 -11
- package/lib/utils/userAgent.js +8 -12
- package/lib-esm/ActionList/Item.js +53 -28
- package/lib-esm/ActionList2/Group.d.ts +2 -28
- package/lib-esm/ActionList2/Group.js +5 -52
- package/lib-esm/ActionList2/Header.d.ts +26 -0
- package/lib-esm/ActionList2/Header.js +44 -0
- package/lib-esm/ActionList2/Item.js +1 -2
- package/lib-esm/ActionList2/List.d.ts +1 -1
- package/lib-esm/ActionList2/List.js +2 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +3 -4
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +3 -4
- package/lib-esm/Breadcrumbs.d.ts +7 -8
- package/lib-esm/Breadcrumbs.js +13 -8
- package/lib-esm/Button/Button.d.ts +3 -3
- package/lib-esm/Button/Button.js +2 -2
- package/lib-esm/Button/ButtonBase.d.ts +8 -5
- package/lib-esm/Button/ButtonBase.js +3 -1
- package/lib-esm/Button/ButtonClose.d.ts +46 -4
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +3 -3
- package/lib-esm/Button/ButtonDanger.js +2 -2
- package/lib-esm/Button/ButtonInvisible.d.ts +3 -3
- package/lib-esm/Button/ButtonInvisible.js +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +3 -3
- package/lib-esm/Button/ButtonOutline.js +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +3 -3
- package/lib-esm/Button/ButtonPrimary.js +2 -2
- package/lib-esm/Button/ButtonTableList.d.ts +2 -1
- package/lib-esm/Button/ButtonTableList.js +2 -2
- package/lib-esm/CircleBadge.d.ts +5 -4
- package/lib-esm/CircleBadge.js +2 -2
- package/lib-esm/CircleOcticon.d.ts +1 -2
- package/lib-esm/CounterLabel.d.ts +2 -1
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/Dialog.d.ts +9 -5
- package/lib-esm/Dialog/Dialog.js +12 -12
- package/lib-esm/Dialog.d.ts +5 -5
- package/lib-esm/Dialog.js +2 -2
- package/lib-esm/Dropdown.d.ts +99 -14
- package/lib-esm/Dropdown.js +4 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +47 -4
- package/lib-esm/DropdownMenu/DropdownButton.js +1 -3
- package/lib-esm/EmojiPicker/EmojiPicker.d.ts +15 -0
- package/lib-esm/EmojiPicker/EmojiPicker.js +184 -0
- package/lib-esm/EmojiPicker/EmojiPickerAnchor.d.ts +0 -0
- package/lib-esm/EmojiPicker/EmojiPickerAnchor.js +0 -0
- package/lib-esm/EmojiPicker/EmojiPickerPanel.d.ts +3 -0
- package/lib-esm/EmojiPicker/EmojiPickerPanel.js +8 -0
- package/lib-esm/EmojiPicker/data.d.ts +9 -0
- package/lib-esm/EmojiPicker/data.js +5434 -0
- package/lib-esm/EmojiPicker/index.d.ts +2 -0
- package/lib-esm/EmojiPicker/index.js +1 -0
- package/lib-esm/FilterList.d.ts +303 -265
- package/lib-esm/FilterList.js +7 -3
- package/lib-esm/FilteredSearch.d.ts +2 -1
- package/lib-esm/FilteredSearch.js +2 -2
- package/lib-esm/Flash.d.ts +2 -1
- package/lib-esm/Flash.js +2 -2
- package/lib-esm/FormGroup.d.ts +5 -4
- package/lib-esm/FormGroup.js +3 -3
- package/lib-esm/Header.d.ts +7 -6
- package/lib-esm/Header.js +5 -5
- package/lib-esm/Label.d.ts +2 -1
- package/lib-esm/Label.js +4 -3
- package/lib-esm/LabelGroup.d.ts +2 -1
- package/lib-esm/LabelGroup.js +2 -2
- package/lib-esm/Link.d.ts +2 -1
- package/lib-esm/Link.js +2 -2
- package/lib-esm/NewButton/button.js +42 -31
- package/lib-esm/Overlay.d.ts +11 -14
- package/lib-esm/Overlay.js +3 -2
- package/lib-esm/Pagehead.d.ts +2 -1
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/lib-esm/Popover.d.ts +5 -4
- package/lib-esm/Popover.js +5 -4
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +189 -27
- package/lib-esm/SelectMenu/SelectMenu.js +2 -1
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFilter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +3 -2
- package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuList.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +2 -3
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +3 -2
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuTab.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuTabs.js +2 -2
- package/lib-esm/SideNav.d.ts +8 -11
- package/lib-esm/SideNav.js +16 -8
- package/lib-esm/StateLabel.d.ts +2 -1
- package/lib-esm/StateLabel.js +6 -7
- package/lib-esm/StyledOcticon.d.ts +2 -1
- package/lib-esm/StyledOcticon.js +2 -1
- package/lib-esm/SubNav.d.ts +11 -5
- package/lib-esm/SubNav.js +13 -8
- package/lib-esm/TabNav.d.ts +4 -3
- package/lib-esm/TabNav.js +3 -3
- package/lib-esm/TextInputWithTokens.d.ts +3 -4
- package/lib-esm/Timeline.d.ts +393 -19
- package/lib-esm/Timeline.js +13 -12
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Tooltip.d.ts +2 -1
- package/lib-esm/Tooltip.js +2 -2
- package/lib-esm/Truncate.d.ts +2 -1
- package/lib-esm/Truncate.js +2 -1
- package/lib-esm/UnderlineNav.d.ts +3 -2
- package/lib-esm/UnderlineNav.js +3 -3
- package/lib-esm/index.d.ts +2 -2
- package/lib-esm/index.js +1 -1
- package/lib-esm/theme-preval.js +366 -512
- package/lib-esm/utils/testing.d.ts +61 -8
- package/lib-esm/utils/testing.js +0 -24
- package/package.json +5 -4
- package/lib/Checkbox.d.ts +0 -29
- package/lib/Checkbox.js +0 -64
- package/lib-esm/Checkbox.d.ts +0 -29
- package/lib-esm/Checkbox.js +0 -44
@@ -0,0 +1,60 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
26
|
+
const constants_1 = require("../constants");
|
27
|
+
const sx_1 = __importDefault(require("../sx"));
|
28
|
+
const listStyles = styled_components_1.css `
|
29
|
+
position: relative;
|
30
|
+
padding: 0;
|
31
|
+
margin: 0;
|
32
|
+
flex: auto;
|
33
|
+
overflow-x: hidden;
|
34
|
+
overflow-y: auto;
|
35
|
+
background-color: ${constants_1.get('colors.canvas.overlay')};
|
36
|
+
-webkit-overflow-scrolling: touch; // Adds momentum + bouncy scrolling
|
37
|
+
|
38
|
+
@media (hover: hover) {
|
39
|
+
.SelectMenuTab:focus {
|
40
|
+
background-color: ${constants_1.get('colors.selectMenu.tapFocusBg')};
|
41
|
+
}
|
42
|
+
|
43
|
+
.SelectMenuTab:not([aria-checked='true']):hover {
|
44
|
+
color: ${constants_1.get('colors.fg.default')};
|
45
|
+
background-color: ${constants_1.get('colors.canvas.subtle')};
|
46
|
+
}
|
47
|
+
|
48
|
+
.SelectMenuTab:not([aria-checked='true']):active {
|
49
|
+
color: ${constants_1.get('colors.fg.default')};
|
50
|
+
background-color: ${constants_1.get('colors.canvas.subtle')};
|
51
|
+
}
|
52
|
+
}
|
53
|
+
`;
|
54
|
+
const SelectMenuList = styled_components_1.default.div `
|
55
|
+
${listStyles}
|
56
|
+
${constants_1.COMMON}
|
57
|
+
${sx_1.default};
|
58
|
+
`;
|
59
|
+
SelectMenuList.displayName = 'SelectMenu.List';
|
60
|
+
exports.default = SelectMenuList;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { SystemCommonProps } from '../constants';
|
3
3
|
import { ComponentProps } from '../utils/types';
|
4
|
-
declare const Animation: import("styled-components").StyledComponent<"div", any,
|
4
|
+
declare const Animation: import("styled-components").StyledComponent<"div", any, SystemCommonProps, never>;
|
5
5
|
export declare type SelectMenuLoadingAnimationProps = ComponentProps<typeof Animation>;
|
6
6
|
declare const SelectMenuLoadingAnimation: (props: SelectMenuLoadingAnimationProps) => JSX.Element;
|
7
7
|
export default SelectMenuLoadingAnimation;
|
@@ -13,14 +13,12 @@ var _constants = require("../constants");
|
|
13
13
|
|
14
14
|
var _Spinner = _interopRequireDefault(require("../Spinner"));
|
15
15
|
|
16
|
-
var _sx = _interopRequireDefault(require("../sx"));
|
17
|
-
|
18
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
19
17
|
|
20
18
|
const Animation = _styledComponents.default.div.withConfig({
|
21
19
|
displayName: "SelectMenuLoadingAnimation__Animation",
|
22
20
|
componentId: "sc-17k54td-0"
|
23
|
-
})(["padding:", " ", ";text-align:center;background-color:", ";", ""], (0, _constants.get)('space.6'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'),
|
21
|
+
})(["padding:", " ", ";text-align:center;background-color:", ";", ""], (0, _constants.get)('space.6'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'), _constants.COMMON);
|
24
22
|
|
25
23
|
const SelectMenuLoadingAnimation = props => {
|
26
24
|
return /*#__PURE__*/_react.default.createElement(Animation, props, /*#__PURE__*/_react.default.createElement(_Spinner.default, null));
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const react_1 = __importDefault(require("react"));
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
8
|
+
const constants_1 = require("../constants");
|
9
|
+
const Spinner_1 = __importDefault(require("../Spinner"));
|
10
|
+
const Animation = styled_components_1.default.div `
|
11
|
+
padding: ${constants_1.get('space.6')} ${constants_1.get('space.4')};
|
12
|
+
text-align: center;
|
13
|
+
background-color: ${constants_1.get('colors.canvas.overlay')};
|
14
|
+
${constants_1.COMMON}
|
15
|
+
`;
|
16
|
+
const SelectMenuLoadingAnimation = (props) => {
|
17
|
+
return (<Animation {...props}>
|
18
|
+
<Spinner_1.default />
|
19
|
+
</Animation>);
|
20
|
+
};
|
21
|
+
exports.default = SelectMenuLoadingAnimation;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { WidthProps } from 'styled-system';
|
3
|
+
import { SystemCommonProps } from '../constants';
|
3
4
|
import { SxProp } from '../sx';
|
4
5
|
import { ComponentProps } from '../utils/types';
|
5
6
|
declare type StyledModalProps = {
|
@@ -7,8 +8,8 @@ declare type StyledModalProps = {
|
|
7
8
|
} & WidthProps;
|
8
9
|
declare const ModalWrapper: import("styled-components").StyledComponent<"div", any, {
|
9
10
|
align?: "left" | "right" | undefined;
|
10
|
-
} & SxProp, never>;
|
11
|
+
} & SystemCommonProps & SxProp, never>;
|
11
12
|
declare type SelectMenuModalInternalProps = Pick<StyledModalProps, 'width'> & ComponentProps<typeof ModalWrapper>;
|
12
|
-
declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "color" | "translate" | "width" | "hidden" | "children" | "theme" | "slot" | "style" | "title" | "
|
13
|
+
declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "backgroundColor" | "color" | "display" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "opacity" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "translate" | "width" | "margin" | "padding" | "hidden" | "children" | "theme" | "p" | "slot" | "style" | "title" | "bg" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "sx" | "role" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "align"> & React.RefAttributes<HTMLDivElement>>;
|
13
14
|
export declare type SelectMenuModalProps = ComponentProps<typeof SelectMenuModal>;
|
14
15
|
export default SelectMenuModal;
|
@@ -35,7 +35,7 @@ const Modal = _styledComponents.default.div.withConfig({
|
|
35
35
|
const ModalWrapper = _styledComponents.default.div.withConfig({
|
36
36
|
displayName: "SelectMenuModal__ModalWrapper",
|
37
37
|
componentId: "sc-1m5qo55-1"
|
38
|
-
})(["", " ", ";"], modalWrapperStyles, _sx.default);
|
38
|
+
})(["", " ", " ", ";"], modalWrapperStyles, _constants.COMMON, _sx.default);
|
39
39
|
|
40
40
|
const SelectMenuModal = /*#__PURE__*/_react.default.forwardRef(({
|
41
41
|
children,
|
@@ -0,0 +1,119 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const react_1 = __importDefault(require("react"));
|
26
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
27
|
+
const styled_system_1 = require("styled-system");
|
28
|
+
const constants_1 = require("../constants");
|
29
|
+
const sx_1 = __importDefault(require("../sx"));
|
30
|
+
const animateModal = styled_components_1.keyframes `
|
31
|
+
0% {
|
32
|
+
opacity: 0;
|
33
|
+
transform: scale(0.9);
|
34
|
+
}
|
35
|
+
`;
|
36
|
+
const modalStyles = styled_components_1.css `
|
37
|
+
position: relative;
|
38
|
+
z-index: 99; // Needs to be higher than .details-overlay's z-index: 80.
|
39
|
+
display: flex;
|
40
|
+
${props => (props.filter ? 'height: 80%' : '')};
|
41
|
+
max-height: ${props => (props.filter ? 'none' : '66%')};
|
42
|
+
margin: auto 0;
|
43
|
+
${props => (props.filter ? 'margin-top: 0' : '')};
|
44
|
+
overflow: hidden; // Enables border radius on scrollable child elements
|
45
|
+
pointer-events: auto;
|
46
|
+
flex-direction: column;
|
47
|
+
background-color: ${constants_1.get('colors.canvas.overlay')};
|
48
|
+
border-radius: ${constants_1.get('radii.2')};
|
49
|
+
box-shadow: ${constants_1.get('shadows.shadow.small')};
|
50
|
+
animation: ${animateModal} 0.12s cubic-bezier(0, 0.1, 0.1, 1) backwards;
|
51
|
+
|
52
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
53
|
+
height: auto;
|
54
|
+
max-height: 350px;
|
55
|
+
margin: ${constants_1.get('space.1')} 0 ${constants_1.get('space.3')} 0;
|
56
|
+
font-size: ${constants_1.get('fontSizes.0')};
|
57
|
+
border: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.default')};
|
58
|
+
border-radius: ${constants_1.get('radii.2')};
|
59
|
+
box-shadow: ${constants_1.get('shadows.shadow.small')};
|
60
|
+
}
|
61
|
+
`;
|
62
|
+
const modalWrapperStyles = styled_components_1.css `
|
63
|
+
position: fixed;
|
64
|
+
top: 0;
|
65
|
+
right: 0;
|
66
|
+
bottom: 0;
|
67
|
+
left: 0;
|
68
|
+
z-index: 99;
|
69
|
+
display: flex;
|
70
|
+
padding: ${constants_1.get('space.3')};
|
71
|
+
pointer-events: none;
|
72
|
+
flex-direction: column;
|
73
|
+
|
74
|
+
&::before {
|
75
|
+
position: absolute;
|
76
|
+
top: 0;
|
77
|
+
right: 0;
|
78
|
+
bottom: 0;
|
79
|
+
left: 0;
|
80
|
+
pointer-events: none;
|
81
|
+
content: '';
|
82
|
+
background-color: ${constants_1.get('colors.primer.canvas.backdrop')};
|
83
|
+
|
84
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
85
|
+
display: none;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
90
|
+
position: absolute;
|
91
|
+
top: auto;
|
92
|
+
right: ${props => (props.align === 'right' ? '0' : 'auto')};
|
93
|
+
bottom: auto;
|
94
|
+
left: auto;
|
95
|
+
padding: 0;
|
96
|
+
}
|
97
|
+
`;
|
98
|
+
const Modal = styled_components_1.default.div `
|
99
|
+
${modalStyles}
|
100
|
+
${styled_system_1.width}
|
101
|
+
`;
|
102
|
+
const ModalWrapper = styled_components_1.default.div `
|
103
|
+
${modalWrapperStyles}
|
104
|
+
${constants_1.COMMON}
|
105
|
+
${sx_1.default};
|
106
|
+
`;
|
107
|
+
const SelectMenuModal = react_1.default.forwardRef(({ children, theme, width: widthProp, ...rest }, forwardedRef) => {
|
108
|
+
return (<ModalWrapper theme={theme} {...rest} role="menu" ref={forwardedRef}>
|
109
|
+
<Modal theme={theme} width={widthProp}>
|
110
|
+
{children}
|
111
|
+
</Modal>
|
112
|
+
</ModalWrapper>);
|
113
|
+
});
|
114
|
+
SelectMenuModal.defaultProps = {
|
115
|
+
align: 'left',
|
116
|
+
width: '300px'
|
117
|
+
};
|
118
|
+
SelectMenuModal.displayName = 'SelectMenu.Modal';
|
119
|
+
exports.default = SelectMenuModal;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SystemCommonProps } from '../constants';
|
2
3
|
import { SxProp } from '../sx';
|
3
4
|
import { ComponentProps } from '../utils/types';
|
4
|
-
declare const StyledTab: import("styled-components").StyledComponent<"button", any, SxProp, never>;
|
5
|
+
declare const StyledTab: import("styled-components").StyledComponent<"button", any, SystemCommonProps & SxProp, never>;
|
5
6
|
export declare type SelectMenuTabProps = {
|
6
7
|
tabName?: string;
|
7
8
|
index?: number;
|
@@ -30,7 +30,7 @@ const tabStyles = (0, _styledComponents.css)(["flex:1;padding:", " ", ";font-siz
|
|
30
30
|
const StyledTab = _styledComponents.default.button.withConfig({
|
31
31
|
displayName: "SelectMenuTab__StyledTab",
|
32
32
|
componentId: "ga32sz-0"
|
33
|
-
})(["", " ", ";"], tabStyles, _sx.default);
|
33
|
+
})(["", " ", " ", ";"], tabStyles, _constants.COMMON, _sx.default);
|
34
34
|
|
35
35
|
const SelectMenuTab = ({
|
36
36
|
tabName = '',
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const classnames_1 = __importDefault(require("classnames"));
|
26
|
+
const react_1 = __importStar(require("react"));
|
27
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
28
|
+
const constants_1 = require("../constants");
|
29
|
+
const sx_1 = __importDefault(require("../sx"));
|
30
|
+
const SelectMenuContext_1 = require("./SelectMenuContext");
|
31
|
+
const tabStyles = styled_components_1.css `
|
32
|
+
flex: 1;
|
33
|
+
padding: ${constants_1.get('space.2')} ${constants_1.get('space.3')};
|
34
|
+
font-size: ${constants_1.get('fontSizes.0')};
|
35
|
+
font-weight: 500;
|
36
|
+
color: ${constants_1.get('colors.fg.muted')};
|
37
|
+
text-align: center;
|
38
|
+
background-color: transparent;
|
39
|
+
border: 0;
|
40
|
+
box-shadow: inset 0 -1px 0 ${constants_1.get('colors.border.muted')};
|
41
|
+
|
42
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
43
|
+
flex: none;
|
44
|
+
padding: ${constants_1.get('space.1')} ${constants_1.get('space.3')};
|
45
|
+
border: ${constants_1.get('borderWidths.1')} solid transparent;
|
46
|
+
border-bottom-width: 0;
|
47
|
+
border-top-left-radius: ${constants_1.get('radii.2')};
|
48
|
+
border-top-right-radius: ${constants_1.get('radii.2')};
|
49
|
+
}
|
50
|
+
|
51
|
+
&[aria-selected='true'] {
|
52
|
+
z-index: 1; // Keeps box-shadow visible when hovering
|
53
|
+
color: ${constants_1.get('colors.text-primary')};
|
54
|
+
background-color: ${constants_1.get('colors.canvas.overlay')};
|
55
|
+
box-shadow: 0 0 0 1px ${constants_1.get('colors.border.muted')};
|
56
|
+
|
57
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
58
|
+
border-color: ${constants_1.get('colors.border.muted')};
|
59
|
+
box-shadow: none;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
&:focus {
|
64
|
+
background-color: ${constants_1.get('colors.neutral.subtle')};
|
65
|
+
}
|
66
|
+
`;
|
67
|
+
const StyledTab = styled_components_1.default.button `
|
68
|
+
${tabStyles}
|
69
|
+
${constants_1.COMMON}
|
70
|
+
${sx_1.default};
|
71
|
+
`;
|
72
|
+
const SelectMenuTab = ({ tabName = '', index, className, onClick, ...rest }) => {
|
73
|
+
const menuContext = react_1.useContext(SelectMenuContext_1.MenuContext);
|
74
|
+
const handleClick = (e) => {
|
75
|
+
// if consumer has attached an onClick event, call it
|
76
|
+
onClick && onClick(e);
|
77
|
+
if (!e.defaultPrevented) {
|
78
|
+
menuContext.setSelectedTab?.(tabName);
|
79
|
+
}
|
80
|
+
};
|
81
|
+
// if no tab is selected when the component renders, show the first tab
|
82
|
+
react_1.useEffect(() => {
|
83
|
+
if (!menuContext.selectedTab && index === 0) {
|
84
|
+
menuContext.setSelectedTab?.(tabName);
|
85
|
+
}
|
86
|
+
}, [index, menuContext, tabName]);
|
87
|
+
const isSelected = menuContext.selectedTab === tabName;
|
88
|
+
return (<StyledTab role="tab" className={classnames_1.default('SelectMenuTab', className)} aria-selected={isSelected} onClick={handleClick} {...rest}>
|
89
|
+
{tabName}
|
90
|
+
</StyledTab>);
|
91
|
+
};
|
92
|
+
SelectMenuTab.displayName = 'SelectMenu.Tab';
|
93
|
+
exports.default = SelectMenuTab;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SystemCommonProps } from '../constants';
|
2
3
|
import { SxProp } from '../sx';
|
3
4
|
import { ComponentProps } from '../utils/types';
|
4
|
-
declare const TabPanelBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
5
|
+
declare const TabPanelBase: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
5
6
|
export declare type SelectMenuTabPanelProps = {
|
6
7
|
tabName?: string;
|
7
8
|
} & ComponentProps<typeof TabPanelBase>;
|
@@ -28,7 +28,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
28
28
|
const TabPanelBase = _styledComponents.default.div.withConfig({
|
29
29
|
displayName: "SelectMenuTabPanel__TabPanelBase",
|
30
30
|
componentId: "ck0ipe-0"
|
31
|
-
})(["border-top:", " solid ", ";", ";"], (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.muted'), _sx.default);
|
31
|
+
})(["border-top:", " solid ", ";", " ", ";"], (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.muted'), _constants.COMMON, _sx.default);
|
32
32
|
|
33
33
|
const TabPanel = ({
|
34
34
|
tabName,
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const react_1 = __importStar(require("react"));
|
26
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
27
|
+
const constants_1 = require("../constants");
|
28
|
+
const sx_1 = __importDefault(require("../sx"));
|
29
|
+
const SelectMenuContext_1 = require("./SelectMenuContext");
|
30
|
+
const SelectMenuList_1 = __importDefault(require("./SelectMenuList"));
|
31
|
+
const TabPanelBase = styled_components_1.default.div `
|
32
|
+
border-top: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.muted')};
|
33
|
+
${constants_1.COMMON}
|
34
|
+
${sx_1.default};
|
35
|
+
`;
|
36
|
+
const TabPanel = ({ tabName, className, children, ...rest }) => {
|
37
|
+
const menuContext = react_1.useContext(SelectMenuContext_1.MenuContext);
|
38
|
+
return (<TabPanelBase role="tabpanel" className={className} hidden={menuContext.selectedTab !== tabName} {...rest}>
|
39
|
+
<SelectMenuList_1.default>{children}</SelectMenuList_1.default>
|
40
|
+
</TabPanelBase>);
|
41
|
+
};
|
42
|
+
TabPanel.displayName = 'SelectMenu.TabPanel';
|
43
|
+
exports.default = TabPanel;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SystemCommonProps } from '../constants';
|
2
3
|
import { SxProp } from '../sx';
|
3
4
|
import { ComponentProps } from '../utils/types';
|
4
|
-
declare const SelectMenuTabsBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
5
|
+
declare const SelectMenuTabsBase: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
5
6
|
export declare type SelectMenuTabsProps = ComponentProps<typeof SelectMenuTabsBase>;
|
6
7
|
declare const SelectMenuTabs: {
|
7
8
|
({ children, ...rest }: SelectMenuTabsProps): JSX.Element;
|
@@ -26,7 +26,7 @@ const tabWrapperStyles = (0, _styledComponents.css)(["display:flex;flex-shrink:0
|
|
26
26
|
const SelectMenuTabsBase = _styledComponents.default.div.withConfig({
|
27
27
|
displayName: "SelectMenuTabs__SelectMenuTabsBase",
|
28
28
|
componentId: "kgg21o-0"
|
29
|
-
})(["", " ", ";"], tabWrapperStyles, _sx.default);
|
29
|
+
})(["", " ", " ", ";"], tabWrapperStyles, _constants.COMMON, _sx.default);
|
30
30
|
|
31
31
|
const SelectMenuTabs = ({
|
32
32
|
children,
|
@@ -0,0 +1,58 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
5
|
+
}) : (function(o, m, k, k2) {
|
6
|
+
if (k2 === undefined) k2 = k;
|
7
|
+
o[k2] = m[k];
|
8
|
+
}));
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
11
|
+
}) : function(o, v) {
|
12
|
+
o["default"] = v;
|
13
|
+
});
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
15
|
+
if (mod && mod.__esModule) return mod;
|
16
|
+
var result = {};
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
18
|
+
__setModuleDefault(result, mod);
|
19
|
+
return result;
|
20
|
+
};
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
23
|
+
};
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
25
|
+
const react_1 = __importDefault(require("react"));
|
26
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
27
|
+
const constants_1 = require("../constants");
|
28
|
+
const sx_1 = __importDefault(require("../sx"));
|
29
|
+
const tabWrapperStyles = styled_components_1.css `
|
30
|
+
display: flex;
|
31
|
+
flex-shrink: 0;
|
32
|
+
margin-bottom: -1px; // hide border of element below
|
33
|
+
-webkit-overflow-scrolling: touch;
|
34
|
+
overflow-x: auto;
|
35
|
+
overflow-y: hidden;
|
36
|
+
|
37
|
+
// Hide scrollbar so it doesn't cover the text
|
38
|
+
&::-webkit-scrollbar {
|
39
|
+
display: none;
|
40
|
+
}
|
41
|
+
|
42
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
43
|
+
padding: 0 ${constants_1.get('space.2')};
|
44
|
+
margin-top: ${constants_1.get('space.3')};
|
45
|
+
}
|
46
|
+
`;
|
47
|
+
const SelectMenuTabsBase = styled_components_1.default.div `
|
48
|
+
${tabWrapperStyles}
|
49
|
+
${constants_1.COMMON}
|
50
|
+
${sx_1.default};
|
51
|
+
`;
|
52
|
+
const SelectMenuTabs = ({ children, ...rest }) => {
|
53
|
+
return (<SelectMenuTabsBase role="tablist" {...rest}>
|
54
|
+
{children}
|
55
|
+
</SelectMenuTabsBase>);
|
56
|
+
};
|
57
|
+
SelectMenuTabs.displayName = 'SelectMenu.Tabs';
|
58
|
+
exports.default = SelectMenuTabs;
|