@primer/components 0.0.0-202110303104 → 0.0.0-2021103082237
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 +90 -4
- package/dist/browser.esm.js +738 -779
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +736 -777
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList/Item.js +27 -52
- package/lib/ActionList/index.js +23 -12
- package/lib/ActionList2/Group.d.ts +28 -2
- package/lib/ActionList2/Group.js +55 -6
- package/lib/ActionList2/List.d.ts +1 -1
- package/lib/ActionList2/List.js +1 -2
- package/lib/ActionList2/index.js +41 -23
- package/lib/AnchoredOverlay/index.js +12 -4
- package/lib/Autocomplete/Autocomplete.d.ts +11 -3
- package/lib/Autocomplete/AutocompleteInput.d.ts +11 -3
- package/lib/Autocomplete/index.js +14 -7
- package/lib/Breadcrumbs.d.ts +8 -7
- package/lib/Breadcrumbs.js +7 -12
- package/lib/Button/Button.d.ts +2 -3
- package/lib/Button/Button.js +2 -6
- package/lib/Button/ButtonBase.d.ts +5 -8
- package/lib/Button/ButtonBase.js +1 -5
- package/lib/Button/ButtonClose.d.ts +3 -46
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonDanger.d.ts +2 -3
- package/lib/Button/ButtonDanger.js +2 -6
- package/lib/Button/ButtonInvisible.d.ts +2 -3
- package/lib/Button/ButtonInvisible.js +2 -6
- package/lib/Button/ButtonOutline.d.ts +2 -3
- package/lib/Button/ButtonOutline.js +2 -6
- package/lib/Button/ButtonPrimary.d.ts +2 -3
- package/lib/Button/ButtonPrimary.js +2 -6
- package/lib/Button/ButtonTableList.d.ts +1 -2
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/Button/index.js +70 -21
- package/lib/Checkbox.d.ts +29 -0
- package/lib/Checkbox.js +64 -0
- package/lib/CircleBadge.d.ts +4 -5
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleOcticon.d.ts +1 -1
- package/lib/CounterLabel.d.ts +1 -2
- package/lib/CounterLabel.js +1 -1
- package/lib/Dialog/Dialog.d.ts +5 -9
- package/lib/Dialog/Dialog.js +17 -11
- package/lib/Dialog.d.ts +4 -5
- package/lib/Dialog.js +1 -1
- package/lib/Dropdown.d.ts +10 -99
- package/lib/Dropdown.js +3 -3
- package/lib/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib/DropdownMenu/DropdownButton.js +3 -1
- package/lib/DropdownMenu/index.js +20 -6
- package/lib/DropdownStyles.js +26 -18
- package/lib/FilterList.d.ts +264 -303
- package/lib/FilterList.js +2 -6
- package/lib/FilteredActionList/index.js +12 -4
- package/lib/FilteredSearch.d.ts +1 -2
- package/lib/FilteredSearch.js +1 -1
- package/lib/Flash.d.ts +1 -2
- package/lib/Flash.js +1 -1
- package/lib/FormGroup.d.ts +4 -5
- package/lib/FormGroup.js +2 -2
- package/lib/Header.d.ts +6 -7
- package/lib/Header.js +4 -4
- package/lib/Label.d.ts +1 -2
- package/lib/Label.js +2 -3
- package/lib/LabelGroup.d.ts +1 -2
- package/lib/LabelGroup.js +1 -1
- package/lib/Link.d.ts +1 -2
- package/lib/Link.js +1 -1
- package/lib/NewButton/button.js +34 -42
- package/lib/NewButton/index.js +12 -5
- package/lib/NewButton/types.js +1 -2
- package/lib/Overlay.d.ts +14 -11
- package/lib/Overlay.js +3 -4
- package/lib/Pagehead.d.ts +1 -2
- package/lib/Pagehead.js +1 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Pagination/index.js +12 -6
- package/lib/Popover.d.ts +4 -5
- package/lib/Popover.js +4 -5
- package/lib/Portal/index.js +16 -5
- package/lib/Position.d.ts +4 -4
- package/lib/SelectMenu/SelectMenu.d.ts +29 -189
- package/lib/SelectMenu/SelectMenu.js +1 -3
- package/lib/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuHeader.js +1 -1
- package/lib/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +3 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib/SelectMenu/SelectMenuModal.js +1 -1
- package/lib/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib/SelectMenu/SelectMenuTabs.js +1 -1
- package/lib/SelectMenu/hooks/useKeyboardNav.js +96 -80
- package/lib/SelectMenu/index.js +14 -7
- package/lib/SelectPanel/index.js +12 -4
- package/lib/SideNav.d.ts +11 -8
- package/lib/SideNav.js +8 -15
- package/lib/StateLabel.d.ts +1 -2
- package/lib/StateLabel.js +6 -5
- package/lib/StyledOcticon.d.ts +1 -2
- package/lib/StyledOcticon.js +1 -3
- package/lib/SubNav.d.ts +5 -11
- package/lib/SubNav.js +7 -12
- package/lib/TabNav.d.ts +3 -4
- package/lib/TabNav.js +2 -2
- package/lib/TextInput.d.ts +8 -1
- package/lib/TextInput.js +17 -5
- package/lib/TextInputWithTokens.d.ts +11 -3
- package/lib/Timeline.d.ts +19 -393
- package/lib/Timeline.js +16 -13
- package/lib/Token/Token.d.ts +1 -1
- package/lib/Token/index.js +30 -11
- package/lib/Tooltip.d.ts +1 -2
- package/lib/Tooltip.js +1 -1
- package/lib/Truncate.d.ts +1 -2
- package/lib/Truncate.js +1 -3
- package/lib/UnderlineNav.d.ts +2 -3
- package/lib/UnderlineNav.js +2 -2
- package/lib/_TextInputWrapper.d.ts +3 -0
- package/lib/_TextInputWrapper.js +18 -7
- package/lib/behaviors/anchoredPosition.js +234 -205
- package/lib/behaviors/focusTrap.js +157 -121
- package/lib/behaviors/focusZone.js +509 -434
- package/lib/behaviors/scrollIntoViewingArea.js +35 -18
- package/lib/constants.js +43 -39
- package/lib/drafts.js +30 -20
- package/lib/hooks/index.js +60 -16
- package/lib/hooks/useAnchoredPosition.js +40 -32
- package/lib/hooks/useCombinedRefs.js +36 -32
- package/lib/hooks/useDialog.js +96 -72
- package/lib/hooks/useFocusTrap.js +60 -43
- package/lib/hooks/useFocusZone.js +50 -54
- package/lib/hooks/useOnEscapePress.js +36 -25
- package/lib/hooks/useOpenAndCloseFocus.js +34 -22
- package/lib/hooks/useProvidedRefOrCreate.js +14 -10
- package/lib/hooks/useProvidedStateOrCreate.js +16 -13
- package/lib/hooks/useRenderForcingRef.js +17 -13
- package/lib/hooks/useResizeObserver.js +18 -15
- package/lib/hooks/useSafeTimeout.js +30 -22
- package/lib/hooks/useScrollFlash.js +23 -16
- package/lib/index.d.ts +2 -2
- package/lib/index.js +652 -165
- package/lib/polyfills/eventListenerSignal.js +45 -37
- package/lib/sx.js +22 -10
- package/lib/theme-preval.js +3169 -64
- package/lib/theme.js +12 -3
- package/lib/utils/iterateFocusableElements.js +85 -63
- package/lib/utils/testing.d.ts +28 -61
- package/lib/utils/testing.js +29 -0
- package/lib/utils/theme.js +47 -33
- package/lib/utils/types/AriaRole.js +1 -2
- package/lib/utils/types/ComponentProps.js +1 -2
- package/lib/utils/types/Flatten.js +1 -2
- package/lib/utils/types/KeyPaths.js +1 -2
- package/lib/utils/types/MandateProps.js +1 -16
- package/lib/utils/types/Merge.js +1 -2
- package/lib/utils/types/index.js +69 -16
- package/lib/utils/uniqueId.js +8 -5
- package/lib/utils/use-force-update.js +14 -8
- package/lib/utils/useIsomorphicLayoutEffect.js +11 -8
- package/lib/utils/userAgent.js +12 -8
- package/lib-esm/ActionList/Item.js +28 -53
- package/lib-esm/ActionList2/Group.d.ts +28 -2
- package/lib-esm/ActionList2/Group.js +52 -5
- package/lib-esm/ActionList2/List.d.ts +1 -1
- package/lib-esm/ActionList2/List.js +1 -2
- package/lib-esm/Autocomplete/Autocomplete.d.ts +11 -3
- package/lib-esm/Autocomplete/AutocompleteInput.d.ts +11 -3
- package/lib-esm/Breadcrumbs.d.ts +8 -7
- package/lib-esm/Breadcrumbs.js +8 -13
- package/lib-esm/Button/Button.d.ts +2 -3
- package/lib-esm/Button/Button.js +2 -2
- package/lib-esm/Button/ButtonBase.d.ts +5 -8
- package/lib-esm/Button/ButtonBase.js +1 -3
- package/lib-esm/Button/ButtonClose.d.ts +3 -46
- package/lib-esm/Button/ButtonClose.js +2 -2
- package/lib-esm/Button/ButtonDanger.d.ts +2 -3
- package/lib-esm/Button/ButtonDanger.js +2 -2
- package/lib-esm/Button/ButtonInvisible.d.ts +2 -3
- package/lib-esm/Button/ButtonInvisible.js +2 -2
- package/lib-esm/Button/ButtonOutline.d.ts +2 -3
- package/lib-esm/Button/ButtonOutline.js +2 -2
- package/lib-esm/Button/ButtonPrimary.d.ts +2 -3
- package/lib-esm/Button/ButtonPrimary.js +2 -2
- package/lib-esm/Button/ButtonTableList.d.ts +1 -2
- package/lib-esm/Button/ButtonTableList.js +2 -2
- package/lib-esm/Checkbox.d.ts +29 -0
- package/lib-esm/Checkbox.js +44 -0
- package/lib-esm/CircleBadge.d.ts +4 -5
- package/lib-esm/CircleBadge.js +2 -2
- package/lib-esm/CircleOcticon.d.ts +1 -1
- package/lib-esm/CounterLabel.d.ts +1 -2
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/Dialog.d.ts +5 -9
- package/lib-esm/Dialog/Dialog.js +12 -12
- package/lib-esm/Dialog.d.ts +4 -5
- package/lib-esm/Dialog.js +2 -2
- package/lib-esm/Dropdown.d.ts +10 -99
- package/lib-esm/Dropdown.js +4 -4
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +3 -47
- package/lib-esm/DropdownMenu/DropdownButton.js +3 -1
- package/lib-esm/FilterList.d.ts +264 -303
- package/lib-esm/FilterList.js +3 -7
- package/lib-esm/FilteredSearch.d.ts +1 -2
- package/lib-esm/FilteredSearch.js +2 -2
- package/lib-esm/Flash.d.ts +1 -2
- package/lib-esm/Flash.js +2 -2
- package/lib-esm/FormGroup.d.ts +4 -5
- package/lib-esm/FormGroup.js +3 -3
- package/lib-esm/Header.d.ts +6 -7
- package/lib-esm/Header.js +5 -5
- package/lib-esm/Label.d.ts +1 -2
- package/lib-esm/Label.js +3 -4
- package/lib-esm/LabelGroup.d.ts +1 -2
- package/lib-esm/LabelGroup.js +2 -2
- package/lib-esm/Link.d.ts +1 -2
- package/lib-esm/Link.js +2 -2
- package/lib-esm/NewButton/button.js +31 -42
- package/lib-esm/Overlay.d.ts +14 -11
- package/lib-esm/Overlay.js +2 -3
- package/lib-esm/Pagehead.d.ts +1 -2
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/Pagination/Pagination.js +2 -2
- package/lib-esm/Popover.d.ts +4 -5
- package/lib-esm/Popover.js +4 -5
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/SelectMenu/SelectMenu.d.ts +29 -189
- package/lib-esm/SelectMenu/SelectMenu.js +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuDivider.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFilter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuFooter.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuItem.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuList.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuList.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.d.ts +2 -2
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +3 -2
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +2 -3
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTab.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.d.ts +1 -2
- package/lib-esm/SelectMenu/SelectMenuTabs.js +2 -2
- package/lib-esm/SideNav.d.ts +11 -8
- package/lib-esm/SideNav.js +8 -16
- package/lib-esm/StateLabel.d.ts +1 -2
- package/lib-esm/StateLabel.js +7 -6
- package/lib-esm/StyledOcticon.d.ts +1 -2
- package/lib-esm/StyledOcticon.js +1 -2
- package/lib-esm/SubNav.d.ts +5 -11
- package/lib-esm/SubNav.js +8 -13
- package/lib-esm/TabNav.d.ts +3 -4
- package/lib-esm/TabNav.js +3 -3
- package/lib-esm/TextInput.d.ts +8 -1
- package/lib-esm/TextInput.js +17 -5
- package/lib-esm/TextInputWithTokens.d.ts +11 -3
- package/lib-esm/Timeline.d.ts +19 -393
- package/lib-esm/Timeline.js +12 -13
- package/lib-esm/Token/Token.d.ts +1 -1
- package/lib-esm/Tooltip.d.ts +1 -2
- package/lib-esm/Tooltip.js +2 -2
- package/lib-esm/Truncate.d.ts +1 -2
- package/lib-esm/Truncate.js +1 -2
- package/lib-esm/UnderlineNav.d.ts +2 -3
- package/lib-esm/UnderlineNav.js +3 -3
- package/lib-esm/_TextInputWrapper.d.ts +3 -0
- package/lib-esm/_TextInputWrapper.js +18 -7
- package/lib-esm/index.d.ts +2 -2
- package/lib-esm/index.js +1 -1
- package/lib-esm/theme-preval.js +512 -366
- package/lib-esm/utils/testing.d.ts +28 -61
- package/lib-esm/utils/testing.js +24 -0
- package/package.json +5 -6
- package/lib/ActionList/Divider.jsx +0 -29
- package/lib/ActionList/Group.jsx +0 -23
- package/lib/ActionList/Header.jsx +0 -66
- package/lib/ActionList/Item.jsx +0 -311
- package/lib/ActionList/List.jsx +0 -138
- package/lib/ActionList2/Description.jsx +0 -29
- package/lib/ActionList2/Divider.jsx +0 -22
- package/lib/ActionList2/Group.jsx +0 -25
- package/lib/ActionList2/Header.jsx +0 -36
- package/lib/ActionList2/Item.jsx +0 -174
- package/lib/ActionList2/LinkItem.jsx +0 -28
- package/lib/ActionList2/List.jsx +0 -41
- package/lib/ActionList2/Selection.jsx +0 -50
- package/lib/ActionList2/Visuals.jsx +0 -48
- package/lib/ActionMenu.jsx +0 -73
- package/lib/AnchoredOverlay/AnchoredOverlay.jsx +0 -100
- package/lib/Autocomplete/Autocomplete.jsx +0 -100
- package/lib/Autocomplete/AutocompleteContext.jsx +0 -5
- package/lib/Autocomplete/AutocompleteInput.jsx +0 -113
- package/lib/Autocomplete/AutocompleteMenu.jsx +0 -190
- package/lib/Autocomplete/AutocompleteOverlay.jsx +0 -55
- package/lib/Avatar.jsx +0 -34
- package/lib/AvatarPair.jsx +0 -29
- package/lib/AvatarStack.jsx +0 -151
- package/lib/BaseStyles.jsx +0 -65
- package/lib/BorderBox.jsx +0 -18
- package/lib/Box.jsx +0 -10
- package/lib/BranchName.jsx +0 -20
- package/lib/Breadcrumbs.jsx +0 -74
- package/lib/Button/Button.jsx +0 -60
- package/lib/Button/ButtonBase.jsx +0 -36
- package/lib/Button/ButtonClose.jsx +0 -55
- package/lib/Button/ButtonDanger.jsx +0 -63
- package/lib/Button/ButtonGroup.jsx +0 -55
- package/lib/Button/ButtonInvisible.jsx +0 -52
- package/lib/Button/ButtonOutline.jsx +0 -63
- package/lib/Button/ButtonPrimary.jsx +0 -62
- package/lib/Button/ButtonStyles.jsx +0 -37
- package/lib/Button/ButtonTableList.jsx +0 -49
- package/lib/Caret.jsx +0 -93
- package/lib/CircleBadge.jsx +0 -43
- package/lib/CircleOcticon.jsx +0 -21
- package/lib/CounterLabel.jsx +0 -44
- package/lib/Details.jsx +0 -21
- package/lib/Dialog/ConfirmationDialog.jsx +0 -146
- package/lib/Dialog/Dialog.jsx +0 -273
- package/lib/Dialog.jsx +0 -131
- package/lib/Dropdown.jsx +0 -134
- package/lib/DropdownMenu/DropdownButton.jsx +0 -14
- package/lib/DropdownMenu/DropdownMenu.jsx +0 -70
- package/lib/EmojiPicker/EmojiPicker.d.ts +0 -15
- package/lib/EmojiPicker/EmojiPicker.js +0 -205
- package/lib/EmojiPicker/EmojiPicker.jsx +0 -125
- package/lib/EmojiPicker/EmojiPickerAnchor.d.ts +0 -0
- package/lib/EmojiPicker/EmojiPickerAnchor.js +0 -1
- package/lib/EmojiPicker/EmojiPickerAnchor.jsx +0 -1
- package/lib/EmojiPicker/EmojiPickerPanel.d.ts +0 -3
- package/lib/EmojiPicker/EmojiPickerPanel.js +0 -18
- package/lib/EmojiPicker/EmojiPickerPanel.jsx +0 -10
- package/lib/EmojiPicker/data.d.ts +0 -9
- package/lib/EmojiPicker/data.js +0 -7254
- package/lib/EmojiPicker/index.d.ts +0 -2
- package/lib/EmojiPicker/index.js +0 -8
- package/lib/FilterList.jsx +0 -63
- package/lib/FilteredActionList/FilteredActionList.jsx +0 -100
- package/lib/FilteredSearch.jsx +0 -29
- package/lib/Flash.jsx +0 -70
- package/lib/Flex.jsx +0 -15
- package/lib/FormGroup.jsx +0 -25
- package/lib/Grid.jsx +0 -15
- package/lib/Header.jsx +0 -90
- package/lib/Heading.jsx +0 -21
- package/lib/Label.jsx +0 -84
- package/lib/LabelGroup.jsx +0 -19
- package/lib/Link.jsx +0 -38
- package/lib/NewButton/button-counter.jsx +0 -14
- package/lib/NewButton/button.jsx +0 -278
- package/lib/Overlay.jsx +0 -156
- package/lib/Pagehead.jsx +0 -18
- package/lib/Pagination/Pagination.jsx +0 -163
- package/lib/Pagination/model.jsx +0 -174
- package/lib/PointerBox.jsx +0 -25
- package/lib/Popover.jsx +0 -210
- package/lib/Portal/Portal.jsx +0 -79
- package/lib/Position.jsx +0 -46
- package/lib/ProgressBar.jsx +0 -39
- package/lib/SelectMenu/SelectMenu.jsx +0 -114
- package/lib/SelectMenu/SelectMenuContext.jsx +0 -5
- package/lib/SelectMenu/SelectMenuDivider.jsx +0 -43
- package/lib/SelectMenu/SelectMenuFilter.jsx +0 -59
- package/lib/SelectMenu/SelectMenuFooter.jsx +0 -46
- package/lib/SelectMenu/SelectMenuHeader.jsx +0 -44
- package/lib/SelectMenu/SelectMenuItem.jsx +0 -143
- package/lib/SelectMenu/SelectMenuList.jsx +0 -60
- package/lib/SelectMenu/SelectMenuLoadingAnimation.jsx +0 -21
- package/lib/SelectMenu/SelectMenuModal.jsx +0 -119
- package/lib/SelectMenu/SelectMenuTab.jsx +0 -93
- package/lib/SelectMenu/SelectMenuTabPanel.jsx +0 -43
- package/lib/SelectMenu/SelectMenuTabs.jsx +0 -58
- package/lib/SelectPanel/SelectPanel.jsx +0 -105
- package/lib/SideNav.jsx +0 -177
- package/lib/Spinner.jsx +0 -35
- package/lib/StateLabel.jsx +0 -94
- package/lib/StyledOcticon.jsx +0 -20
- package/lib/SubNav.jsx +0 -104
- package/lib/TabNav.jsx +0 -60
- package/lib/Text.jsx +0 -14
- package/lib/TextInput.jsx +0 -23
- package/lib/TextInputWithTokens.jsx +0 -218
- package/lib/ThemeProvider.jsx +0 -130
- package/lib/Timeline.jsx +0 -124
- package/lib/Token/AvatarToken.jsx +0 -54
- package/lib/Token/IssueLabelToken.jsx +0 -125
- package/lib/Token/Token.jsx +0 -103
- package/lib/Token/TokenBase.jsx +0 -88
- package/lib/Token/_RemoveTokenButton.jsx +0 -108
- package/lib/Token/_TokenTextContainer.jsx +0 -49
- package/lib/Tooltip.jsx +0 -246
- package/lib/Truncate.jsx +0 -27
- package/lib/UnderlineNav.jsx +0 -90
- package/lib/_TextInputWrapper.jsx +0 -120
- package/lib/_UnstyledTextInput.jsx +0 -22
- package/lib/hooks/useDetails.jsx +0 -39
- package/lib/hooks/useOnOutsideClick.jsx +0 -61
- package/lib/hooks/useOverlay.jsx +0 -15
- package/lib/utils/create-slots.jsx +0 -65
- package/lib/utils/deprecate.jsx +0 -59
- package/lib/utils/isNumeric.jsx +0 -7
- package/lib/utils/ssr.jsx +0 -6
- package/lib/utils/test-deprecations.jsx +0 -20
- package/lib/utils/test-helpers.jsx +0 -8
- package/lib/utils/test-matchers.jsx +0 -100
- package/lib/utils/testing.jsx +0 -206
- package/lib-esm/EmojiPicker/EmojiPicker.d.ts +0 -15
- package/lib-esm/EmojiPicker/EmojiPicker.js +0 -184
- package/lib-esm/EmojiPicker/EmojiPickerAnchor.d.ts +0 -0
- package/lib-esm/EmojiPicker/EmojiPickerAnchor.js +0 -0
- package/lib-esm/EmojiPicker/EmojiPickerPanel.d.ts +0 -3
- package/lib-esm/EmojiPicker/EmojiPickerPanel.js +0 -8
- package/lib-esm/EmojiPicker/data.d.ts +0 -9
- package/lib-esm/EmojiPicker/data.js +0 -5434
- package/lib-esm/EmojiPicker/index.d.ts +0 -2
- package/lib-esm/EmojiPicker/index.js +0 -1
@@ -1,8 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { SystemCommonProps, SystemTypographyProps } from '../constants';
|
3
2
|
import { SxProp } from '../sx';
|
4
3
|
import { ComponentProps } from '../utils/types';
|
5
|
-
declare const StyledHeader: import("styled-components").StyledComponent<"header", any,
|
4
|
+
declare const StyledHeader: import("styled-components").StyledComponent<"header", any, SxProp, never>;
|
6
5
|
export declare type SelectMenuHeaderProps = ComponentProps<typeof StyledHeader>;
|
7
6
|
declare const SelectMenuHeader: {
|
8
7
|
({ 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'), (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,
|
@@ -1,15 +1,14 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { SystemCommonProps } from '../constants';
|
3
2
|
import { SxProp } from '../sx';
|
4
3
|
import { ComponentProps } from '../utils/types';
|
5
4
|
export declare const listItemStyles: import("styled-components").FlattenInterpolation<import("styled-components").ThemeProps<any>>;
|
6
5
|
declare const StyledItem: import("styled-components").StyledComponent<"a", any, {
|
7
6
|
role: "menuitemcheckbox";
|
8
|
-
} &
|
7
|
+
} & SxProp, "role">;
|
9
8
|
declare type SelectMenuItemInteralProps = {
|
10
9
|
as?: React.ElementType;
|
11
10
|
selected?: boolean;
|
12
11
|
} & ComponentProps<typeof StyledItem>;
|
13
|
-
declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<SelectMenuItemInteralProps, "translate" | "hidden" | "children" | "theme" | "slot" | "style" | "title" | "
|
12
|
+
declare const SelectMenuItem: React.ForwardRefExoticComponent<Pick<SelectMenuItemInteralProps, "color" | "translate" | "hidden" | "children" | "theme" | "slot" | "style" | "title" | "role" | "sx" | "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"> & React.RefAttributes<HTMLAnchorElement>>;
|
14
13
|
export declare type SelectMenuItemProps = ComponentProps<typeof SelectMenuItem>;
|
15
14
|
export default SelectMenuItem;
|
@@ -35,7 +35,7 @@ const StyledItem = _styledComponents.default.a.attrs(() => ({
|
|
35
35
|
})).withConfig({
|
36
36
|
displayName: "SelectMenuItem__StyledItem",
|
37
37
|
componentId: "gjymba-0"
|
38
|
-
})(["", " ", "
|
38
|
+
})(["", " ", ";"], listItemStyles, _sx.default);
|
39
39
|
|
40
40
|
const SelectMenuItem = /*#__PURE__*/(0, _react.forwardRef)(({
|
41
41
|
children,
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { SystemCommonProps } from '../constants';
|
2
1
|
import { SxProp } from '../sx';
|
3
2
|
import { ComponentProps } from '../utils/types';
|
4
|
-
declare const SelectMenuList: import("styled-components").StyledComponent<"div", any,
|
3
|
+
declare const SelectMenuList: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
5
4
|
export declare type SelectMenuListProps = ComponentProps<typeof SelectMenuList>;
|
6
5
|
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
|
-
})(["", " ", "
|
25
|
+
})(["", " ", ";"], listStyles, _sx.default);
|
26
26
|
|
27
27
|
SelectMenuList.displayName = 'SelectMenu.List';
|
28
28
|
var _default = SelectMenuList;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import {
|
2
|
+
import { SxProp } from '../sx';
|
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, SxProp, 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,12 +13,14 @@ var _constants = require("../constants");
|
|
13
13
|
|
14
14
|
var _Spinner = _interopRequireDefault(require("../Spinner"));
|
15
15
|
|
16
|
+
var _sx = _interopRequireDefault(require("../sx"));
|
17
|
+
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
19
|
|
18
20
|
const Animation = _styledComponents.default.div.withConfig({
|
19
21
|
displayName: "SelectMenuLoadingAnimation__Animation",
|
20
22
|
componentId: "sc-17k54td-0"
|
21
|
-
})(["padding:", " ", ";text-align:center;background-color:", ";", ""], (0, _constants.get)('space.6'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'),
|
23
|
+
})(["padding:", " ", ";text-align:center;background-color:", ";", ""], (0, _constants.get)('space.6'), (0, _constants.get)('space.4'), (0, _constants.get)('colors.canvas.overlay'), _sx.default);
|
22
24
|
|
23
25
|
const SelectMenuLoadingAnimation = props => {
|
24
26
|
return /*#__PURE__*/_react.default.createElement(Animation, props, /*#__PURE__*/_react.default.createElement(_Spinner.default, null));
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { WidthProps } from 'styled-system';
|
3
|
-
import { SystemCommonProps } from '../constants';
|
4
3
|
import { SxProp } from '../sx';
|
5
4
|
import { ComponentProps } from '../utils/types';
|
6
5
|
declare type StyledModalProps = {
|
@@ -8,8 +7,8 @@ declare type StyledModalProps = {
|
|
8
7
|
} & WidthProps;
|
9
8
|
declare const ModalWrapper: import("styled-components").StyledComponent<"div", any, {
|
10
9
|
align?: "left" | "right" | undefined;
|
11
|
-
} &
|
10
|
+
} & SxProp, never>;
|
12
11
|
declare type SelectMenuModalInternalProps = Pick<StyledModalProps, 'width'> & ComponentProps<typeof ModalWrapper>;
|
13
|
-
declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "
|
12
|
+
declare const SelectMenuModal: React.ForwardRefExoticComponent<Pick<SelectMenuModalInternalProps, "color" | "translate" | "width" | "hidden" | "children" | "theme" | "slot" | "style" | "title" | "role" | "sx" | "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>>;
|
14
13
|
export declare type SelectMenuModalProps = ComponentProps<typeof SelectMenuModal>;
|
15
14
|
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
|
-
})(["", " ", "
|
38
|
+
})(["", " ", ";"], modalWrapperStyles, _sx.default);
|
39
39
|
|
40
40
|
const SelectMenuModal = /*#__PURE__*/_react.default.forwardRef(({
|
41
41
|
children,
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { SystemCommonProps } from '../constants';
|
3
2
|
import { SxProp } from '../sx';
|
4
3
|
import { ComponentProps } from '../utils/types';
|
5
|
-
declare const StyledTab: import("styled-components").StyledComponent<"button", any,
|
4
|
+
declare const StyledTab: import("styled-components").StyledComponent<"button", any, SxProp, never>;
|
6
5
|
export declare type SelectMenuTabProps = {
|
7
6
|
tabName?: string;
|
8
7
|
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
|
-
})(["", " ", "
|
33
|
+
})(["", " ", ";"], tabStyles, _sx.default);
|
34
34
|
|
35
35
|
const SelectMenuTab = ({
|
36
36
|
tabName = '',
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { SystemCommonProps } from '../constants';
|
3
2
|
import { SxProp } from '../sx';
|
4
3
|
import { ComponentProps } from '../utils/types';
|
5
|
-
declare const TabPanelBase: import("styled-components").StyledComponent<"div", any,
|
4
|
+
declare const TabPanelBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
6
5
|
export declare type SelectMenuTabPanelProps = {
|
7
6
|
tabName?: string;
|
8
7
|
} & 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 ", ";", "
|
31
|
+
})(["border-top:", " solid ", ";", ";"], (0, _constants.get)('borderWidths.1'), (0, _constants.get)('colors.border.muted'), _sx.default);
|
32
32
|
|
33
33
|
const TabPanel = ({
|
34
34
|
tabName,
|
@@ -1,8 +1,7 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { SystemCommonProps } from '../constants';
|
3
2
|
import { SxProp } from '../sx';
|
4
3
|
import { ComponentProps } from '../utils/types';
|
5
|
-
declare const SelectMenuTabsBase: import("styled-components").StyledComponent<"div", any,
|
4
|
+
declare const SelectMenuTabsBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
6
5
|
export declare type SelectMenuTabsProps = ComponentProps<typeof SelectMenuTabsBase>;
|
7
6
|
declare const SelectMenuTabs: {
|
8
7
|
({ 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
|
-
})(["", " ", "
|
29
|
+
})(["", " ", ";"], tabWrapperStyles, _sx.default);
|
30
30
|
|
31
31
|
const SelectMenuTabs = ({
|
32
32
|
children,
|
@@ -1,85 +1,101 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = require("react");
|
9
|
+
|
4
10
|
// adapted from details-menu web component https://github.com/github/details-menu-element
|
5
11
|
function useKeyboardNav(details, open, setOpen) {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
{
|
41
|
-
if (isSummaryFocused && !open) {
|
42
|
-
openDetails(details);
|
43
|
-
}
|
44
|
-
const target = focusItem(true);
|
45
|
-
if (target)
|
46
|
-
target.focus();
|
47
|
-
event.preventDefault();
|
48
|
-
}
|
49
|
-
break;
|
50
|
-
case 'ArrowUp':
|
51
|
-
{
|
52
|
-
if (isSummaryFocused && !open) {
|
53
|
-
openDetails();
|
54
|
-
}
|
55
|
-
const target = focusItem(false);
|
56
|
-
if (target)
|
57
|
-
target.focus();
|
58
|
-
event.preventDefault();
|
59
|
-
}
|
60
|
-
break;
|
61
|
-
case ' ':
|
62
|
-
case 'Enter':
|
63
|
-
{
|
64
|
-
const selected = document.activeElement;
|
65
|
-
if (selected && isMenuItem(selected) && selected.closest('details') === details) {
|
66
|
-
event.preventDefault();
|
67
|
-
event.stopPropagation();
|
68
|
-
selected.click();
|
69
|
-
}
|
70
|
-
}
|
71
|
-
break;
|
72
|
-
default:
|
12
|
+
const handleKeyDown = (0, _react.useCallback)(event => {
|
13
|
+
const closeDetails = () => {
|
14
|
+
setOpen(false);
|
15
|
+
const summary = details.current.querySelector('summary');
|
16
|
+
if (summary) summary.focus();
|
17
|
+
};
|
18
|
+
|
19
|
+
const openDetails = () => {
|
20
|
+
setOpen(true);
|
21
|
+
};
|
22
|
+
|
23
|
+
const focusItem = next => {
|
24
|
+
const options = Array.from(details.current.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])'));
|
25
|
+
const selected = document.activeElement;
|
26
|
+
const index = options.indexOf(selected);
|
27
|
+
const found = next ? options[index + 1] : options[index - 1];
|
28
|
+
const def = next ? options[0] : options[options.length - 1];
|
29
|
+
return found || def;
|
30
|
+
};
|
31
|
+
|
32
|
+
const isMenuItem = el => {
|
33
|
+
const role = el.getAttribute('role');
|
34
|
+
return role === 'menuitem' || role === 'menuitemcheckbox' || role === 'menuitemradio';
|
35
|
+
};
|
36
|
+
|
37
|
+
if (!(event instanceof KeyboardEvent)) return;
|
38
|
+
const isSummaryFocused = event.target instanceof Element && event.target.tagName === 'SUMMARY';
|
39
|
+
|
40
|
+
switch (event.key) {
|
41
|
+
case 'Escape':
|
42
|
+
if (open) {
|
43
|
+
closeDetails(details);
|
44
|
+
event.preventDefault();
|
45
|
+
event.stopPropagation();
|
73
46
|
}
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
47
|
+
|
48
|
+
break;
|
49
|
+
|
50
|
+
case 'ArrowDown':
|
51
|
+
{
|
52
|
+
if (isSummaryFocused && !open) {
|
53
|
+
openDetails(details);
|
54
|
+
}
|
55
|
+
|
56
|
+
const target = focusItem(true);
|
57
|
+
if (target) target.focus();
|
58
|
+
event.preventDefault();
|
59
|
+
}
|
60
|
+
break;
|
61
|
+
|
62
|
+
case 'ArrowUp':
|
63
|
+
{
|
64
|
+
if (isSummaryFocused && !open) {
|
65
|
+
openDetails();
|
66
|
+
}
|
67
|
+
|
68
|
+
const target = focusItem(false);
|
69
|
+
if (target) target.focus();
|
70
|
+
event.preventDefault();
|
71
|
+
}
|
72
|
+
break;
|
73
|
+
|
74
|
+
case ' ':
|
75
|
+
case 'Enter':
|
76
|
+
{
|
77
|
+
const selected = document.activeElement;
|
78
|
+
|
79
|
+
if (selected && isMenuItem(selected) && selected.closest('details') === details) {
|
80
|
+
event.preventDefault();
|
81
|
+
event.stopPropagation();
|
82
|
+
selected.click();
|
83
|
+
}
|
84
|
+
}
|
85
|
+
break;
|
86
|
+
|
87
|
+
default:
|
88
|
+
}
|
89
|
+
}, [details, open, setOpen]);
|
90
|
+
(0, _react.useEffect)(() => {
|
91
|
+
const current = details.current;
|
92
|
+
if (!current) return;
|
93
|
+
current.addEventListener('keydown', handleKeyDown);
|
94
|
+
return () => {
|
95
|
+
current.removeEventListener('keydown', handleKeyDown);
|
96
|
+
};
|
97
|
+
}, [details, handleKeyDown]);
|
84
98
|
}
|
85
|
-
|
99
|
+
|
100
|
+
var _default = useKeyboardNav;
|
101
|
+
exports.default = _default;
|
package/lib/SelectMenu/index.js
CHANGED
@@ -1,8 +1,15 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
exports
|
7
|
-
|
8
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "default", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _SelectMenu.default;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
|
13
|
+
var _SelectMenu = _interopRequireDefault(require("./SelectMenu"));
|
14
|
+
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/SelectPanel/index.js
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
exports
|
4
|
-
|
5
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "SelectPanel", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function () {
|
9
|
+
return _SelectPanel.SelectPanel;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
|
13
|
+
var _SelectPanel = require("./SelectPanel");
|
package/lib/SideNav.d.ts
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
/// <reference types="hoist-non-react-statics" />
|
2
|
-
/// <reference types="react" />
|
3
2
|
import * as History from 'history';
|
4
|
-
import Box from './Box';
|
5
3
|
import { ComponentProps } from './utils/types';
|
4
|
+
import React from 'react';
|
5
|
+
import { SxProp } from './sx';
|
6
6
|
declare type SideNavBaseProps = {
|
7
7
|
variant?: 'lightweight' | 'normal';
|
8
8
|
bordered?: boolean;
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
className?: string;
|
10
|
+
children?: React.ReactNode;
|
11
|
+
'aria-label'?: string;
|
12
|
+
};
|
13
|
+
declare function SideNavBase({ variant, className, bordered, children, 'aria-label': ariaLabel }: SideNavBaseProps): JSX.Element;
|
14
|
+
declare const SideNav: import("styled-components").StyledComponent<typeof SideNavBase, any, SxProp, never>;
|
12
15
|
declare type StyledSideNavLinkProps = {
|
13
16
|
to?: History.LocationDescriptor;
|
14
17
|
selected?: boolean;
|
@@ -18,14 +21,14 @@ declare const SideNavLink: import("styled-components").StyledComponent<"a", any,
|
|
18
21
|
hoverColor?: string | undefined;
|
19
22
|
muted?: boolean | undefined;
|
20
23
|
underline?: boolean | undefined;
|
21
|
-
} &
|
24
|
+
} & SxProp & StyledSideNavLinkProps, never>;
|
22
25
|
export declare type SideNavProps = ComponentProps<typeof SideNav>;
|
23
26
|
export declare type SideNavLinkProps = ComponentProps<typeof SideNavLink>;
|
24
|
-
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any,
|
27
|
+
declare const _default: string & import("styled-components").StyledComponentBase<typeof SideNavBase, any, SxProp, never> & import("hoist-non-react-statics").NonReactStatics<typeof SideNavBase, {}> & {
|
25
28
|
Link: import("styled-components").StyledComponent<"a", any, {
|
26
29
|
hoverColor?: string | undefined;
|
27
30
|
muted?: boolean | undefined;
|
28
31
|
underline?: boolean | undefined;
|
29
|
-
} &
|
32
|
+
} & SxProp & StyledSideNavLinkProps, never>;
|
30
33
|
};
|
31
34
|
export default _default;
|
package/lib/SideNav.js
CHANGED
@@ -25,39 +25,32 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
25
25
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
// eslint-disable-next-line import/no-namespace
|
30
29
|
function SideNavBase({
|
31
30
|
variant,
|
32
31
|
className,
|
33
32
|
bordered,
|
34
33
|
children,
|
35
|
-
|
34
|
+
'aria-label': ariaLabel
|
36
35
|
}) {
|
37
36
|
const variantClassName = variant === 'lightweight' ? 'lightweight' : 'normal';
|
38
37
|
const newClassName = (0, _classnames.default)(className, `variant-${variantClassName}`);
|
39
|
-
|
40
|
-
|
41
|
-
props = { ...props,
|
42
|
-
borderWidth: 0
|
43
|
-
};
|
44
|
-
}
|
45
|
-
|
46
|
-
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
47
|
-
borderWidth: "1px",
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, {
|
39
|
+
borderWidth: bordered ? '1px' : 0,
|
48
40
|
borderStyle: "solid",
|
49
41
|
borderColor: "border.default",
|
50
42
|
borderRadius: 2,
|
51
43
|
as: "nav",
|
52
|
-
className: newClassName
|
53
|
-
|
44
|
+
className: newClassName,
|
45
|
+
"aria-label": ariaLabel
|
46
|
+
}, children);
|
54
47
|
}
|
55
48
|
|
56
49
|
SideNavBase.displayName = "SideNavBase";
|
57
50
|
const SideNav = (0, _styledComponents.default)(SideNavBase).withConfig({
|
58
51
|
displayName: "SideNav",
|
59
52
|
componentId: "sc-15k667c-0"
|
60
|
-
})(["background-color:", ";", " ", ";"
|
53
|
+
})(["background-color:", ";", " ", ";"], (0, _constants.get)('colors.canvas.subtle'), props => props.bordered && (0, _styledComponents.css)(["& > &{border-left:0;border-right:0;border-bottom:0;}"]), _sx.default);
|
61
54
|
// used for variant normal hover, focus pseudo selectors
|
62
55
|
const CommonAccessibilityVariantNormalStyles = (0, _styledComponents.css)(["background-color:", ";outline:none;text-decoration:none;"], (0, _constants.get)('colors.neutral.subtle')); // used for light weight hover, focus pseudo selectors
|
63
56
|
|
package/lib/StateLabel.d.ts
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { SystemCommonProps } from './constants';
|
3
2
|
import { SxProp } from './sx';
|
4
3
|
import { ComponentProps } from './utils/types';
|
5
4
|
declare const StateLabelBase: import("styled-components").StyledComponent<"span", any, {
|
6
5
|
variant?: "small" | "normal" | undefined;
|
7
6
|
status?: "issueClosed" | "pullClosed" | "pullMerged" | "issueOpened" | "pullOpened" | "draft" | "issueDraft" | undefined;
|
8
|
-
} &
|
7
|
+
} & SxProp, never>;
|
9
8
|
export declare type StateLabelProps = ComponentProps<typeof StateLabelBase>;
|
10
9
|
declare function StateLabel({ children, status, variant: variantProp, ...rest }: StateLabelProps): JSX.Element;
|
11
10
|
declare namespace StateLabel {
|
package/lib/StateLabel.js
CHANGED
@@ -84,7 +84,7 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
84
84
|
const StateLabelBase = _styledComponents.default.span.withConfig({
|
85
85
|
displayName: "StateLabel__StateLabelBase",
|
86
86
|
componentId: "k4pd9e-0"
|
87
|
-
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";", ";", ";", ";"
|
87
|
+
})(["display:inline-flex;align-items:center;font-weight:", ";line-height:16px;color:", ";text-align:center;border-radius:", ";", ";", ";", ";"], (0, _constants.get)('fontWeights.bold'), (0, _constants.get)('colors.canvas.default'), (0, _constants.get)('radii.3'), colorVariants, sizeVariants, _sx.default);
|
88
88
|
|
89
89
|
function StateLabel({
|
90
90
|
children,
|
@@ -98,10 +98,11 @@ function StateLabel({
|
|
98
98
|
return /*#__PURE__*/_react.default.createElement(StateLabelBase, _extends({}, rest, {
|
99
99
|
variant: variantProp,
|
100
100
|
status: status
|
101
|
-
}), status && /*#__PURE__*/_react.default.createElement(_StyledOcticon.default, _extends({
|
102
|
-
|
103
|
-
|
104
|
-
|
101
|
+
}), status && /*#__PURE__*/_react.default.createElement(_StyledOcticon.default, _extends({}, octiconProps, {
|
102
|
+
icon: octiconMap[status] || _octiconsReact.QuestionIcon,
|
103
|
+
sx: {
|
104
|
+
mr: 1
|
105
|
+
}
|
105
106
|
})), children);
|
106
107
|
}
|
107
108
|
|