@primer/components 0.0.0-2021113144816 → 0.0.0-2021113174023
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 +892 -0
- package/dist/browser.esm.js +2272 -2
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +2272 -2
- 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.js +1 -1
- package/lib/ActionList/Header.jsx +66 -0
- package/lib/ActionList/Item.js +65 -40
- package/lib/ActionList/Item.jsx +311 -0
- package/lib/ActionList/List.js +1 -1
- 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.d.ts +2 -3
- package/lib/ActionList2/Divider.js +5 -10
- 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 +7 -25
- 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 -11
- package/lib/ActionList2/List.jsx +41 -0
- package/lib/ActionList2/Selection.js +1 -14
- package/lib/ActionList2/Selection.jsx +50 -0
- package/lib/ActionList2/Visuals.jsx +48 -0
- package/lib/ActionList2/index.d.ts +2 -1
- 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 +4 -6
- package/lib/Autocomplete/Autocomplete.jsx +100 -0
- package/lib/Autocomplete/AutocompleteContext.jsx +5 -0
- package/lib/Autocomplete/AutocompleteInput.d.ts +4 -6
- 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.d.ts +2 -1
- package/lib/Avatar.js +1 -1
- package/lib/Avatar.jsx +34 -0
- package/lib/AvatarPair.jsx +29 -0
- package/lib/AvatarStack.jsx +151 -0
- package/lib/BaseStyles.js +20 -2
- package/lib/BaseStyles.jsx +65 -0
- package/lib/BorderBox.js +1 -1
- package/lib/BorderBox.jsx +18 -0
- package/lib/Box.js +1 -1
- package/lib/Box.jsx +10 -0
- package/lib/BranchName.d.ts +2 -1
- package/lib/BranchName.js +1 -1
- package/lib/BranchName.jsx +20 -0
- package/lib/Breadcrumbs.d.ts +7 -8
- package/lib/Breadcrumbs.js +15 -10
- package/lib/Breadcrumbs.jsx +74 -0
- package/lib/Button/Button.d.ts +5 -5
- package/lib/Button/Button.js +7 -3
- 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 +47 -5
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonClose.jsx +55 -0
- package/lib/Button/ButtonDanger.d.ts +5 -5
- package/lib/Button/ButtonDanger.js +6 -2
- package/lib/Button/ButtonDanger.jsx +63 -0
- package/lib/Button/ButtonGroup.js +1 -1
- package/lib/Button/ButtonGroup.jsx +55 -0
- package/lib/Button/ButtonInvisible.d.ts +5 -5
- package/lib/Button/ButtonInvisible.js +6 -2
- package/lib/Button/ButtonInvisible.jsx +52 -0
- package/lib/Button/ButtonOutline.d.ts +5 -5
- package/lib/Button/ButtonOutline.js +6 -2
- package/lib/Button/ButtonOutline.jsx +63 -0
- package/lib/Button/ButtonPrimary.d.ts +5 -5
- 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 +36 -37
- 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.d.ts +2 -1
- package/lib/Details.js +4 -2
- 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 +40 -40
- package/lib/Dialog.js +1 -1
- package/lib/Dialog.jsx +131 -0
- package/lib/Dropdown.d.ts +171 -22
- package/lib/Dropdown.js +3 -3
- package/lib/Dropdown.jsx +134 -0
- package/lib/DropdownMenu/DropdownButton.d.ts +49 -9
- 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 +17 -0
- package/lib/EmojiPicker/EmojiPicker.js +202 -0
- package/lib/EmojiPicker/EmojiPicker.jsx +132 -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.js +1 -1
- 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.js +1 -1
- 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.d.ts +2 -1
- package/lib/Heading.js +6 -1
- 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 +2 -2
- 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 +5 -4
- 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 +3 -3
- 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.js +1 -1
- package/lib/Position.jsx +46 -0
- package/lib/ProgressBar.d.ts +11 -16
- package/lib/ProgressBar.js +10 -6
- package/lib/ProgressBar.jsx +39 -0
- package/lib/SelectMenu/SelectMenu.d.ts +195 -34
- package/lib/SelectMenu/SelectMenu.js +4 -2
- 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 +2 -2
- package/lib/SelectMenu/SelectMenuFilter.jsx +59 -0
- package/lib/SelectMenu/SelectMenuFooter.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuFooter.js +2 -2
- 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 +2 -2
- 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 +2 -2
- package/lib/SelectMenu/SelectMenuTab.jsx +93 -0
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuTabPanel.js +2 -2
- package/lib/SelectMenu/SelectMenuTabPanel.jsx +43 -0
- package/lib/SelectMenu/SelectMenuTabs.d.ts +2 -1
- package/lib/SelectMenu/SelectMenuTabs.js +2 -2
- 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.d.ts +2 -1
- package/lib/Spinner.js +3 -1
- package/lib/Spinner.jsx +35 -0
- package/lib/StateLabel.d.ts +2 -1
- package/lib/StateLabel.js +6 -7
- package/lib/StateLabel.jsx +94 -0
- package/lib/StyledOcticon.d.ts +2 -1
- package/lib/StyledOcticon.js +4 -2
- package/lib/StyledOcticon.jsx +20 -0
- package/lib/SubNav.d.ts +11 -5
- package/lib/SubNav.js +13 -8
- 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 +4 -6
- package/lib/TextInputWithTokens.jsx +218 -0
- package/lib/ThemeProvider.d.ts +0 -1
- package/lib/ThemeProvider.js +4 -17
- package/lib/ThemeProvider.jsx +130 -0
- package/lib/Timeline.d.ts +393 -19
- package/lib/Timeline.js +17 -20
- package/lib/Timeline.jsx +124 -0
- package/lib/Token/AvatarToken.d.ts +1 -1
- package/lib/Token/AvatarToken.js +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.js +1 -1
- 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 +2 -2
- 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 +4 -4
- 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.d.ts +0 -1
- package/lib/drafts.js +20 -43
- 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/Header.js +1 -1
- package/lib-esm/ActionList/Item.js +66 -41
- package/lib-esm/ActionList/List.js +1 -1
- package/lib-esm/ActionList2/Divider.d.ts +2 -3
- package/lib-esm/ActionList2/Divider.js +5 -8
- 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 +7 -23
- package/lib-esm/ActionList2/List.d.ts +1 -1
- package/lib-esm/ActionList2/List.js +2 -9
- package/lib-esm/ActionList2/Selection.js +1 -12
- package/lib-esm/ActionList2/index.d.ts +2 -1
- package/lib-esm/Autocomplete/Autocomplete.d.ts +4 -6
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +4 -6
- package/lib-esm/Avatar.d.ts +2 -1
- package/lib-esm/Avatar.js +2 -2
- package/lib-esm/BaseStyles.js +20 -2
- package/lib-esm/BorderBox.js +1 -1
- package/lib-esm/Box.js +1 -1
- package/lib-esm/BranchName.d.ts +2 -1
- package/lib-esm/BranchName.js +2 -2
- package/lib-esm/Breadcrumbs.d.ts +7 -8
- package/lib-esm/Breadcrumbs.js +16 -11
- package/lib-esm/Button/Button.d.ts +5 -5
- package/lib-esm/Button/Button.js +3 -3
- package/lib-esm/Button/ButtonBase.d.ts +8 -5
- package/lib-esm/Button/ButtonBase.js +3 -1
- package/lib-esm/Button/ButtonClose.d.ts +47 -5
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +5 -5
- package/lib-esm/Button/ButtonDanger.js +2 -2
- package/lib-esm/Button/ButtonGroup.js +1 -1
- package/lib-esm/Button/ButtonInvisible.d.ts +5 -5
- package/lib-esm/Button/ButtonInvisible.js +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +5 -5
- package/lib-esm/Button/ButtonOutline.js +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +5 -5
- 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 +36 -37
- package/lib-esm/CounterLabel.d.ts +2 -1
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Details.d.ts +2 -1
- package/lib-esm/Details.js +3 -2
- package/lib-esm/Dialog/Dialog.d.ts +9 -5
- package/lib-esm/Dialog/Dialog.js +12 -12
- package/lib-esm/Dialog.d.ts +40 -40
- package/lib-esm/Dialog.js +2 -2
- package/lib-esm/Dropdown.d.ts +171 -22
- package/lib-esm/Dropdown.js +4 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +49 -9
- package/lib-esm/DropdownMenu/DropdownButton.js +1 -3
- package/lib-esm/EmojiPicker/EmojiPicker.d.ts +17 -0
- package/lib-esm/EmojiPicker/EmojiPicker.js +181 -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/FilteredActionList/FilteredActionList.js +1 -1
- 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/Flex.js +1 -1
- 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/Heading.d.ts +2 -1
- package/lib-esm/Heading.js +6 -2
- 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 +3 -3
- 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 +4 -3
- package/lib-esm/Pagehead.d.ts +2 -1
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/Pagination/Pagination.js +4 -4
- 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/Position.js +1 -1
- package/lib-esm/ProgressBar.d.ts +11 -16
- package/lib-esm/ProgressBar.js +11 -7
- package/lib-esm/SelectMenu/SelectMenu.d.ts +195 -34
- package/lib-esm/SelectMenu/SelectMenu.js +3 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFilter.js +3 -3
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +3 -3
- 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 +3 -3
- 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 +3 -3
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +3 -3
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +2 -1
- package/lib-esm/SelectMenu/SelectMenuTabs.js +3 -3
- package/lib-esm/SideNav.d.ts +8 -11
- package/lib-esm/SideNav.js +16 -8
- package/lib-esm/Spinner.d.ts +2 -1
- package/lib-esm/Spinner.js +2 -1
- package/lib-esm/StateLabel.d.ts +2 -1
- package/lib-esm/StateLabel.js +7 -8
- package/lib-esm/StyledOcticon.d.ts +2 -1
- package/lib-esm/StyledOcticon.js +3 -2
- package/lib-esm/SubNav.d.ts +11 -5
- package/lib-esm/SubNav.js +14 -9
- package/lib-esm/TabNav.d.ts +4 -3
- package/lib-esm/TabNav.js +3 -3
- package/lib-esm/TextInputWithTokens.d.ts +4 -6
- package/lib-esm/ThemeProvider.d.ts +0 -1
- package/lib-esm/ThemeProvider.js +4 -17
- package/lib-esm/Timeline.d.ts +393 -19
- package/lib-esm/Timeline.js +17 -16
- package/lib-esm/Token/AvatarToken.d.ts +1 -1
- package/lib-esm/Token/AvatarToken.js +1 -1
- package/lib-esm/Token/IssueLabelToken.d.ts +1 -1
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Token/TokenBase.js +1 -1
- package/lib-esm/Tooltip.d.ts +2 -1
- package/lib-esm/Tooltip.js +3 -3
- 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 +5 -5
- package/lib-esm/drafts.d.ts +0 -1
- package/lib-esm/drafts.js +1 -2
- 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 +13 -20
- package/lib/ActionList2/MenuContext.d.ts +0 -10
- package/lib/ActionList2/MenuContext.js +0 -15
- package/lib/ActionMenu2.d.ts +0 -313
- package/lib/ActionMenu2.js +0 -91
- package/lib/Checkbox.d.ts +0 -29
- package/lib/Checkbox.js +0 -64
- package/lib-esm/ActionList2/MenuContext.d.ts +0 -10
- package/lib-esm/ActionList2/MenuContext.js +0 -3
- package/lib-esm/ActionMenu2.d.ts +0 -313
- package/lib-esm/ActionMenu2.js +0 -67
- package/lib-esm/Checkbox.d.ts +0 -29
- package/lib-esm/Checkbox.js +0 -44
@@ -0,0 +1,114 @@
|
|
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 useKeyboardNav_1 = __importDefault(require("./hooks/useKeyboardNav"));
|
30
|
+
const SelectMenuContext_1 = require("./SelectMenuContext");
|
31
|
+
const SelectMenuDivider_1 = __importDefault(require("./SelectMenuDivider"));
|
32
|
+
const SelectMenuFilter_1 = __importDefault(require("./SelectMenuFilter"));
|
33
|
+
const SelectMenuFooter_1 = __importDefault(require("./SelectMenuFooter"));
|
34
|
+
const SelectMenuHeader_1 = __importDefault(require("./SelectMenuHeader"));
|
35
|
+
const SelectMenuItem_1 = __importDefault(require("./SelectMenuItem"));
|
36
|
+
const SelectMenuList_1 = __importDefault(require("./SelectMenuList"));
|
37
|
+
const SelectMenuLoadingAnimation_1 = __importDefault(require("./SelectMenuLoadingAnimation"));
|
38
|
+
const SelectMenuModal_1 = __importDefault(require("./SelectMenuModal"));
|
39
|
+
const SelectMenuTab_1 = __importDefault(require("./SelectMenuTab"));
|
40
|
+
const SelectMenuTabPanel_1 = __importDefault(require("./SelectMenuTabPanel"));
|
41
|
+
const SelectMenuTabs_1 = __importDefault(require("./SelectMenuTabs"));
|
42
|
+
const wrapperStyles = `
|
43
|
+
// Remove marker added by the display: list-item browser default
|
44
|
+
> summary {
|
45
|
+
list-style: none;
|
46
|
+
}
|
47
|
+
// Remove marker added by details polyfill
|
48
|
+
> summary::before {
|
49
|
+
display: none;
|
50
|
+
}
|
51
|
+
// Remove marker added by Chrome
|
52
|
+
> summary::-webkit-details-marker {
|
53
|
+
display: none;
|
54
|
+
}
|
55
|
+
`;
|
56
|
+
const StyledSelectMenu = styled_components_1.default.details `
|
57
|
+
${wrapperStyles}
|
58
|
+
${constants_1.COMMON}
|
59
|
+
${sx_1.default};
|
60
|
+
`;
|
61
|
+
// 'as' is spread out because we don't want users to be able to change the tag.
|
62
|
+
const SelectMenu = react_1.default.forwardRef(({ children, initialTab = '', as: _ignoredAs, ...rest }, forwardedRef) => {
|
63
|
+
const backupRef = react_1.useRef(null);
|
64
|
+
const ref = forwardedRef ?? backupRef;
|
65
|
+
const [selectedTab, setSelectedTab] = react_1.useState(initialTab);
|
66
|
+
const [open, setOpen] = react_1.useState(false);
|
67
|
+
const menuProviderValues = {
|
68
|
+
selectedTab,
|
69
|
+
setSelectedTab,
|
70
|
+
setOpen,
|
71
|
+
open,
|
72
|
+
initialTab
|
73
|
+
};
|
74
|
+
const onClickOutside = react_1.useCallback(event => {
|
75
|
+
if ('current' in ref && ref.current && !ref.current.contains(event.target)) {
|
76
|
+
if (!event.defaultPrevented) {
|
77
|
+
setOpen(false);
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}, [ref, setOpen]);
|
81
|
+
// handles the overlay behavior - closing the menu when clicking outside of it
|
82
|
+
react_1.useEffect(() => {
|
83
|
+
if (open) {
|
84
|
+
document.addEventListener('click', onClickOutside);
|
85
|
+
return () => {
|
86
|
+
document.removeEventListener('click', onClickOutside);
|
87
|
+
};
|
88
|
+
}
|
89
|
+
}, [open, onClickOutside]);
|
90
|
+
function toggle(event) {
|
91
|
+
setOpen(event.target.open);
|
92
|
+
}
|
93
|
+
useKeyboardNav_1.default(ref, open, setOpen);
|
94
|
+
return (<SelectMenuContext_1.MenuContext.Provider value={menuProviderValues}>
|
95
|
+
<StyledSelectMenu ref={ref} {...rest} open={open} onToggle={toggle}>
|
96
|
+
{children}
|
97
|
+
</StyledSelectMenu>
|
98
|
+
</SelectMenuContext_1.MenuContext.Provider>);
|
99
|
+
});
|
100
|
+
SelectMenu.displayName = 'SelectMenu';
|
101
|
+
exports.default = Object.assign(SelectMenu, {
|
102
|
+
MenuContext: SelectMenuContext_1.MenuContext,
|
103
|
+
List: SelectMenuList_1.default,
|
104
|
+
Divider: SelectMenuDivider_1.default,
|
105
|
+
Filter: SelectMenuFilter_1.default,
|
106
|
+
Footer: SelectMenuFooter_1.default,
|
107
|
+
Item: SelectMenuItem_1.default,
|
108
|
+
Modal: SelectMenuModal_1.default,
|
109
|
+
Tabs: SelectMenuTabs_1.default,
|
110
|
+
Tab: SelectMenuTab_1.default,
|
111
|
+
TabPanel: SelectMenuTabPanel_1.default,
|
112
|
+
Header: SelectMenuHeader_1.default,
|
113
|
+
LoadingAnimation: SelectMenuLoadingAnimation_1.default
|
114
|
+
});
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { SystemCommonProps } from '../constants';
|
1
2
|
import { SxProp } from '../sx';
|
2
3
|
import { ComponentProps } from '../utils/types';
|
3
|
-
declare const SelectMenuDivider: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
4
|
+
declare const SelectMenuDivider: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
4
5
|
export declare type SelectMenuDividerProps = ComponentProps<typeof SelectMenuDivider>;
|
5
6
|
export default SelectMenuDivider;
|
@@ -22,7 +22,7 @@ const dividerStyles = (0, _styledComponents.css)(["padding:", " ", ";margin:0;fo
|
|
22
22
|
const SelectMenuDivider = _styledComponents.default.div.withConfig({
|
23
23
|
displayName: "SelectMenuDivider",
|
24
24
|
componentId: "sc-2p0bwt-0"
|
25
|
-
})(["", " ", ";"], dividerStyles, _sx.default);
|
25
|
+
})(["", " ", " ", ";"], dividerStyles, _constants.COMMON, _sx.default);
|
26
26
|
|
27
27
|
SelectMenuDivider.displayName = 'SelectMenu.Divider';
|
28
28
|
var _default = SelectMenuDivider;
|
@@ -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 styled_components_1 = __importStar(require("styled-components"));
|
26
|
+
const constants_1 = require("../constants");
|
27
|
+
const sx_1 = __importDefault(require("../sx"));
|
28
|
+
const dividerStyles = styled_components_1.css `
|
29
|
+
padding: ${constants_1.get('space.1')} ${constants_1.get('space.3')};
|
30
|
+
margin: 0;
|
31
|
+
font-size: ${constants_1.get('fontSizes.0')};
|
32
|
+
font-weight: ${constants_1.get('fontWeights.bold')};
|
33
|
+
color: ${constants_1.get('colors.fg.muted')};
|
34
|
+
background-color: ${constants_1.get('colors.canvas.subtle')};
|
35
|
+
border-bottom: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.muted')};
|
36
|
+
`;
|
37
|
+
const SelectMenuDivider = styled_components_1.default.div `
|
38
|
+
${dividerStyles}
|
39
|
+
${constants_1.COMMON}
|
40
|
+
${sx_1.default};
|
41
|
+
`;
|
42
|
+
SelectMenuDivider.displayName = 'SelectMenu.Divider';
|
43
|
+
exports.default = SelectMenuDivider;
|
@@ -27,8 +27,8 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
27
27
|
|
28
28
|
const StyledForm = _styledComponents.default.form.withConfig({
|
29
29
|
displayName: "SelectMenuFilter__StyledForm",
|
30
|
-
componentId: "
|
31
|
-
})(["padding:", ";margin:0;border-bottom:", " solid ", ";background-color:", ";@media (min-width:", "){padding:", ";}", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.muted'), (0, _constants.get)('colors.canvas.overlay'), (0, _constants.get)('breakpoints.0'), (0, _constants.get)('space.2'), _sx.default);
|
30
|
+
componentId: "s7ktlh-0"
|
31
|
+
})(["padding:", ";margin:0;border-bottom:", " solid ", ";background-color:", ";", ";@media (min-width:", "){padding:", ";}", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.muted'), (0, _constants.get)('colors.canvas.overlay'), _constants.COMMON, (0, _constants.get)('breakpoints.0'), (0, _constants.get)('space.2'), _sx.default);
|
32
32
|
|
33
33
|
const SelectMenuFilter = /*#__PURE__*/(0, _react.forwardRef)(({
|
34
34
|
theme,
|
@@ -0,0 +1,59 @@
|
|
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 TextInput_1 = __importDefault(require("../TextInput"));
|
30
|
+
const SelectMenuContext_1 = require("./SelectMenuContext");
|
31
|
+
const StyledForm = styled_components_1.default.form `
|
32
|
+
padding: ${constants_1.get('space.3')};
|
33
|
+
margin: 0;
|
34
|
+
border-bottom: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.muted')};
|
35
|
+
background-color: ${constants_1.get('colors.canvas.overlay')};
|
36
|
+
${constants_1.COMMON};
|
37
|
+
|
38
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
39
|
+
padding: ${constants_1.get('space.2')};
|
40
|
+
}
|
41
|
+
|
42
|
+
${sx_1.default};
|
43
|
+
`;
|
44
|
+
const SelectMenuFilter = react_1.forwardRef(({ theme, value, sx: sxProp, ...rest }, forwardedRef) => {
|
45
|
+
const inputRef = react_1.useRef(null);
|
46
|
+
const ref = forwardedRef ?? inputRef;
|
47
|
+
const { open } = react_1.useContext(SelectMenuContext_1.MenuContext);
|
48
|
+
// puts focus on the filter input when the menu is opened
|
49
|
+
react_1.useEffect(() => {
|
50
|
+
if (open) {
|
51
|
+
inputRef.current?.focus();
|
52
|
+
}
|
53
|
+
}, [open]);
|
54
|
+
return (<StyledForm theme={theme} sx={sxProp}>
|
55
|
+
<TextInput_1.default theme={theme} ref={ref} width="100%" block value={value} contrast {...rest}/>
|
56
|
+
</StyledForm>);
|
57
|
+
});
|
58
|
+
SelectMenuFilter.displayName = 'SelectMenu.Filter';
|
59
|
+
exports.default = SelectMenuFilter;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { SystemCommonProps } from '../constants';
|
1
2
|
import { SxProp } from '../sx';
|
2
3
|
import { ComponentProps } from '../utils/types';
|
3
|
-
declare const SelectMenuFooter: import("styled-components").StyledComponent<"footer", any, SxProp, never>;
|
4
|
+
declare const SelectMenuFooter: import("styled-components").StyledComponent<"footer", any, SystemCommonProps & SxProp, never>;
|
4
5
|
export declare type SelectMenuFooterProps = ComponentProps<typeof SelectMenuFooter>;
|
5
6
|
export default SelectMenuFooter;
|
@@ -21,8 +21,8 @@ const footerStyles = (0, _styledComponents.css)(["margin-top:-1px;padding:", " "
|
|
21
21
|
|
22
22
|
const SelectMenuFooter = _styledComponents.default.footer.withConfig({
|
23
23
|
displayName: "SelectMenuFooter",
|
24
|
-
componentId: "
|
25
|
-
})(["", " ", ";"], footerStyles, _sx.default);
|
24
|
+
componentId: "rkvco1-0"
|
25
|
+
})(["", " ", " ", ";"], footerStyles, _constants.COMMON, _sx.default);
|
26
26
|
|
27
27
|
SelectMenuFooter.displayName = 'SelectMenu.Footer';
|
28
28
|
var _default = SelectMenuFooter;
|
@@ -0,0 +1,46 @@
|
|
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 footerStyles = styled_components_1.css `
|
29
|
+
margin-top: -1px;
|
30
|
+
padding: ${constants_1.get('space.2')} ${constants_1.get('space.3')};
|
31
|
+
font-size: ${constants_1.get('fontSizes.0')};
|
32
|
+
color: ${constants_1.get('colors.fg.muted')};
|
33
|
+
text-align: center;
|
34
|
+
border-top: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.muted')};
|
35
|
+
|
36
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
37
|
+
padding: ${constants_1.get('space.1')} ${constants_1.get('space.2')};
|
38
|
+
}
|
39
|
+
`;
|
40
|
+
const SelectMenuFooter = styled_components_1.default.footer `
|
41
|
+
${footerStyles}
|
42
|
+
${constants_1.COMMON}
|
43
|
+
${sx_1.default};
|
44
|
+
`;
|
45
|
+
SelectMenuFooter.displayName = 'SelectMenu.Footer';
|
46
|
+
exports.default = SelectMenuFooter;
|
@@ -1,7 +1,8 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SystemCommonProps, SystemTypographyProps } from '../constants';
|
2
3
|
import { SxProp } from '../sx';
|
3
4
|
import { ComponentProps } from '../utils/types';
|
4
|
-
declare const StyledHeader: import("styled-components").StyledComponent<"header", any, SxProp, never>;
|
5
|
+
declare const StyledHeader: import("styled-components").StyledComponent<"header", any, SystemTypographyProps & SystemCommonProps & SxProp, never>;
|
5
6
|
export declare type SelectMenuHeaderProps = ComponentProps<typeof StyledHeader>;
|
6
7
|
declare const SelectMenuHeader: {
|
7
8
|
({ children, theme, ...rest }: SelectMenuHeaderProps): JSX.Element;
|
@@ -27,7 +27,7 @@ const SelectMenuTitle = _styledComponents.default.h3.withConfig({
|
|
27
27
|
const StyledHeader = _styledComponents.default.header.withConfig({
|
28
28
|
displayName: "SelectMenuHeader__StyledHeader",
|
29
29
|
componentId: "sc-1pwppzc-1"
|
30
|
-
})(["display:flex;flex:none;padding:", ";border-bottom:", " solid ", "
|
30
|
+
})(["display:flex;flex:none;padding:", ";border-bottom:", " solid ", ";", " ", " @media (min-width:", "){padding-top:", ";padding-bottom:", ";}", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('borderWidths'), (0, _constants.get)('colors.border.muted'), _constants.COMMON, _constants.TYPOGRAPHY, (0, _constants.get)('breakpoints.0'), (0, _constants.get)('space.2'), (0, _constants.get)('space.2'), _sx.default);
|
31
31
|
|
32
32
|
const SelectMenuHeader = ({
|
33
33
|
children,
|
@@ -0,0 +1,44 @@
|
|
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 sx_1 = __importDefault(require("../sx"));
|
10
|
+
// SelectMenu.Header is intentionally not exported, it's an internal component used in
|
11
|
+
// SelectMenu.Modal
|
12
|
+
const SelectMenuTitle = styled_components_1.default.h3 `
|
13
|
+
color: ${constants_1.get('colors.fg.default')};
|
14
|
+
flex: auto;
|
15
|
+
font-size: ${constants_1.get('fontSizes.1')};
|
16
|
+
font-weight: ${constants_1.get('fontWeights.bold')};
|
17
|
+
margin: 0;
|
18
|
+
|
19
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
20
|
+
font-size: inherit;
|
21
|
+
}
|
22
|
+
`;
|
23
|
+
const StyledHeader = styled_components_1.default.header `
|
24
|
+
display: flex;
|
25
|
+
flex: none; // fixes header from getting squeezed in Safari iOS
|
26
|
+
padding: ${constants_1.get('space.3')};
|
27
|
+
border-bottom: ${constants_1.get('borderWidths')} solid ${constants_1.get('colors.border.muted')};
|
28
|
+
${constants_1.COMMON}
|
29
|
+
${constants_1.TYPOGRAPHY}
|
30
|
+
|
31
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
32
|
+
padding-top: ${constants_1.get('space.2')};
|
33
|
+
padding-bottom: ${constants_1.get('space.2')};
|
34
|
+
}
|
35
|
+
|
36
|
+
${sx_1.default};
|
37
|
+
`;
|
38
|
+
const SelectMenuHeader = ({ children, theme, ...rest }) => {
|
39
|
+
return (<StyledHeader theme={theme} {...rest}>
|
40
|
+
<SelectMenuTitle theme={theme}>{children}</SelectMenuTitle>
|
41
|
+
</StyledHeader>);
|
42
|
+
};
|
43
|
+
SelectMenuHeader.displayName = 'SelectMenu.Header';
|
44
|
+
exports.default = SelectMenuHeader;
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import { SystemCommonProps } from '../constants';
|
2
3
|
import { SxProp } from '../sx';
|
3
4
|
import { ComponentProps } from '../utils/types';
|
4
5
|
export declare const listItemStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
5
6
|
declare const StyledItem: import("styled-components").StyledComponent<"a", any, {
|
6
7
|
role: "menuitemcheckbox";
|
7
|
-
} & SxProp, "role">;
|
8
|
+
} & SystemCommonProps & SxProp, "role">;
|
8
9
|
declare type SelectMenuItemInteralProps = {
|
9
10
|
as?: React.ElementType;
|
10
11
|
selected?: boolean;
|
11
12
|
} & ComponentProps<typeof StyledItem>;
|
12
|
-
declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<SelectMenuItemInteralProps, "
|
13
|
+
declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<SelectMenuItemInteralProps, "translate" | "hidden" | "children" | "theme" | "slot" | "style" | "title" | "sx" | "role" | "type" | "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" | "as" | "selected" | "download" | "href" | "hrefLang" | "media" | "ping" | "rel" | "target" | "referrerPolicy" | keyof SystemCommonProps> & React.RefAttributes<HTMLAnchorElement>>;
|
13
14
|
export declare type SelectMenuItemProps = ComponentProps<typeof SelectMenuItem>;
|
14
15
|
export default SelectMenuItem;
|
@@ -34,8 +34,8 @@ const StyledItem = _styledComponents.default.a.attrs(() => ({
|
|
34
34
|
role: 'menuitemcheckbox'
|
35
35
|
})).withConfig({
|
36
36
|
displayName: "SelectMenuItem__StyledItem",
|
37
|
-
componentId: "
|
38
|
-
})(["", " ", ";"], listItemStyles, _sx.default);
|
37
|
+
componentId: "gjymba-0"
|
38
|
+
})(["", " ", " ", ";"], listItemStyles, _constants.COMMON, _sx.default);
|
39
39
|
|
40
40
|
const SelectMenuItem = /*#__PURE__*/(0, _react.forwardRef)(({
|
41
41
|
children,
|
@@ -0,0 +1,143 @@
|
|
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
|
+
exports.listItemStyles = void 0;
|
26
|
+
const octicons_react_1 = require("@primer/octicons-react");
|
27
|
+
const react_1 = __importStar(require("react"));
|
28
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
29
|
+
const constants_1 = require("../constants");
|
30
|
+
const StyledOcticon_1 = __importDefault(require("../StyledOcticon"));
|
31
|
+
const sx_1 = __importDefault(require("../sx"));
|
32
|
+
const SelectMenuContext_1 = require("./SelectMenuContext");
|
33
|
+
exports.listItemStyles = styled_components_1.css `
|
34
|
+
display: flex;
|
35
|
+
align-items: center;
|
36
|
+
padding: ${constants_1.get('space.3')};
|
37
|
+
overflow: hidden;
|
38
|
+
text-align: left;
|
39
|
+
cursor: pointer;
|
40
|
+
background-color: ${constants_1.get('colors.canvas.overlay')};
|
41
|
+
border: 0;
|
42
|
+
border-bottom: ${constants_1.get('borderWidths.1')} solid ${constants_1.get('colors.border.muted')};
|
43
|
+
color: ${constants_1.get('colors.fg.muted')};
|
44
|
+
text-decoration: none;
|
45
|
+
font-size: ${constants_1.get('fontSizes.0')};
|
46
|
+
font-family: inherit; // needed if user uses a "button" tag
|
47
|
+
width: 100%;
|
48
|
+
|
49
|
+
&:hover {
|
50
|
+
text-decoration: none;
|
51
|
+
}
|
52
|
+
&:focus {
|
53
|
+
outline: none;
|
54
|
+
}
|
55
|
+
|
56
|
+
&[hidden] {
|
57
|
+
display: none !important;
|
58
|
+
}
|
59
|
+
|
60
|
+
@media (min-width: ${constants_1.get('breakpoints.0')}) {
|
61
|
+
padding-top: ${constants_1.get('space.2')};
|
62
|
+
padding-bottom: ${constants_1.get('space.2')};
|
63
|
+
}
|
64
|
+
|
65
|
+
.SelectMenu-icon {
|
66
|
+
width: ${constants_1.get('space.3')};
|
67
|
+
margin-right: ${constants_1.get('space.2')};
|
68
|
+
flex-shrink: 0;
|
69
|
+
}
|
70
|
+
|
71
|
+
.SelectMenu-selected-icon {
|
72
|
+
visibility: hidden;
|
73
|
+
transition: transform 0.12s cubic-bezier(0.5, 0.1, 1, 0.5), visibility 0s 0.12s linear;
|
74
|
+
transform: scale(0);
|
75
|
+
}
|
76
|
+
|
77
|
+
// selected items
|
78
|
+
&[aria-checked='true'] {
|
79
|
+
font-weight: 500;
|
80
|
+
color: ${constants_1.get('colors.fg.default')};
|
81
|
+
|
82
|
+
.SelectMenu-selected-icon {
|
83
|
+
visibility: visible;
|
84
|
+
transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1), visibility 0s linear;
|
85
|
+
transform: scale(1);
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
// can hover states
|
90
|
+
@media (hover: hover) {
|
91
|
+
&:hover,
|
92
|
+
&:active,
|
93
|
+
&:focus {
|
94
|
+
background-color: ${constants_1.get('colors.neutral.subtle')};
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
// Can not hover states
|
99
|
+
//
|
100
|
+
// For touch input
|
101
|
+
|
102
|
+
@media (hover: none) {
|
103
|
+
// Android
|
104
|
+
&:focus,
|
105
|
+
&:active {
|
106
|
+
background-color: ${constants_1.get('colors.canvas.subtle')};
|
107
|
+
}
|
108
|
+
|
109
|
+
// iOS Safari
|
110
|
+
// :active would work if ontouchstart is added to the button
|
111
|
+
// Instead this tweaks the "native" highlight color
|
112
|
+
-webkit-tap-highlight-color: ${constants_1.get('colors.selectMenu.tapHighlight')};
|
113
|
+
}
|
114
|
+
`;
|
115
|
+
const StyledItem = styled_components_1.default.a.attrs(() => ({
|
116
|
+
role: 'menuitemcheckbox'
|
117
|
+
})) `
|
118
|
+
${exports.listItemStyles}
|
119
|
+
${constants_1.COMMON}
|
120
|
+
${sx_1.default};
|
121
|
+
`;
|
122
|
+
const SelectMenuItem = react_1.forwardRef(({ children, selected, theme, onClick, ...rest }, forwardedRef) => {
|
123
|
+
const menuContext = react_1.useContext(SelectMenuContext_1.MenuContext);
|
124
|
+
const backupRef = react_1.useRef(null);
|
125
|
+
const itemRef = forwardedRef ?? backupRef;
|
126
|
+
// close the menu when an item is clicked
|
127
|
+
// this can be overriden if the user provides a `onClick` prop and prevents default in it
|
128
|
+
const handleClick = (e) => {
|
129
|
+
onClick && onClick(e);
|
130
|
+
if (!e.defaultPrevented) {
|
131
|
+
menuContext.setOpen?.(false);
|
132
|
+
}
|
133
|
+
};
|
134
|
+
return (<StyledItem ref={itemRef} {...rest} theme={theme} onClick={handleClick} aria-checked={selected}>
|
135
|
+
<StyledOcticon_1.default theme={theme} className="SelectMenu-icon SelectMenu-selected-icon" icon={octicons_react_1.CheckIcon}/>
|
136
|
+
{children}
|
137
|
+
</StyledItem>);
|
138
|
+
});
|
139
|
+
SelectMenuItem.defaultProps = {
|
140
|
+
selected: false
|
141
|
+
};
|
142
|
+
SelectMenuItem.displayName = 'SelectMenu.Item';
|
143
|
+
exports.default = SelectMenuItem;
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { SystemCommonProps } from '../constants';
|
1
2
|
import { SxProp } from '../sx';
|
2
3
|
import { ComponentProps } from '../utils/types';
|
3
|
-
declare const SelectMenuList: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
4
|
+
declare const SelectMenuList: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
4
5
|
export declare type SelectMenuListProps = ComponentProps<typeof SelectMenuList>;
|
5
6
|
export default SelectMenuList;
|
@@ -22,7 +22,7 @@ const listStyles = (0, _styledComponents.css)(["position:relative;padding:0;marg
|
|
22
22
|
const SelectMenuList = _styledComponents.default.div.withConfig({
|
23
23
|
displayName: "SelectMenuList",
|
24
24
|
componentId: "sc-1opbpf6-0"
|
25
|
-
})(["", " ", ";"], listStyles, _sx.default);
|
25
|
+
})(["", " ", " ", ";"], listStyles, _constants.COMMON, _sx.default);
|
26
26
|
|
27
27
|
SelectMenuList.displayName = 'SelectMenu.List';
|
28
28
|
var _default = SelectMenuList;
|