@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
package/lib/StateLabel.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
+
import { SystemCommonProps } from './constants';
|
2
3
|
import { SxProp } from './sx';
|
3
4
|
import { ComponentProps } from './utils/types';
|
4
5
|
declare const StateLabelBase: import("styled-components").StyledComponent<"span", any, {
|
5
6
|
variant?: "small" | "normal" | undefined;
|
6
7
|
status?: "issueClosed" | "pullClosed" | "pullMerged" | "issueOpened" | "pullOpened" | "draft" | "issueDraft" | undefined;
|
7
|
-
} & SxProp, never>;
|
8
|
+
} & SystemCommonProps & SxProp, never>;
|
8
9
|
export declare type StateLabelProps = ComponentProps<typeof StateLabelBase>;
|
9
10
|
declare function StateLabel({ children, status, variant: variantProp, ...rest }: StateLabelProps): JSX.Element;
|
10
11
|
declare namespace StateLabel {
|
package/lib/StateLabel.js
CHANGED
@@ -83,8 +83,8 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
83
83
|
|
84
84
|
const StateLabelBase = _styledComponents.default.span.withConfig({
|
85
85
|
displayName: "StateLabel__StateLabelBase",
|
86
|
-
componentId: "
|
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);
|
86
|
+
componentId: "k4pd9e-0"
|
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, _constants.COMMON, _sx.default);
|
88
88
|
|
89
89
|
function StateLabel({
|
90
90
|
children,
|
@@ -98,11 +98,10 @@ 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
|
-
|
105
|
-
}
|
101
|
+
}), status && /*#__PURE__*/_react.default.createElement(_StyledOcticon.default, _extends({
|
102
|
+
mr: 1
|
103
|
+
}, octiconProps, {
|
104
|
+
icon: octiconMap[status] || _octiconsReact.QuestionIcon
|
106
105
|
})), children);
|
107
106
|
}
|
108
107
|
|
@@ -0,0 +1,94 @@
|
|
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 octicons_react_1 = require("@primer/octicons-react");
|
7
|
+
const react_1 = __importDefault(require("react"));
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
9
|
+
const styled_system_1 = require("styled-system");
|
10
|
+
const constants_1 = require("./constants");
|
11
|
+
const StyledOcticon_1 = __importDefault(require("./StyledOcticon"));
|
12
|
+
const sx_1 = __importDefault(require("./sx"));
|
13
|
+
const octiconMap = {
|
14
|
+
issueOpened: octicons_react_1.IssueOpenedIcon,
|
15
|
+
pullOpened: octicons_react_1.GitPullRequestIcon,
|
16
|
+
issueClosed: octicons_react_1.IssueClosedIcon,
|
17
|
+
pullClosed: octicons_react_1.GitPullRequestIcon,
|
18
|
+
pullMerged: octicons_react_1.GitMergeIcon,
|
19
|
+
draft: octicons_react_1.GitPullRequestIcon,
|
20
|
+
issueDraft: octicons_react_1.IssueDraftIcon
|
21
|
+
};
|
22
|
+
const colorVariants = styled_system_1.variant({
|
23
|
+
prop: 'status',
|
24
|
+
variants: {
|
25
|
+
issueClosed: {
|
26
|
+
backgroundColor: 'danger.emphasis',
|
27
|
+
color: 'fg.onEmphasis'
|
28
|
+
},
|
29
|
+
pullClosed: {
|
30
|
+
backgroundColor: 'danger.emphasis',
|
31
|
+
color: 'fg.onEmphasis'
|
32
|
+
},
|
33
|
+
pullMerged: {
|
34
|
+
backgroundColor: 'done.emphasis',
|
35
|
+
color: 'fg.onEmphasis'
|
36
|
+
},
|
37
|
+
issueOpened: {
|
38
|
+
backgroundColor: 'success.emphasis',
|
39
|
+
color: 'fg.onEmphasis'
|
40
|
+
},
|
41
|
+
pullOpened: {
|
42
|
+
backgroundColor: 'success.emphasis',
|
43
|
+
color: 'fg.onEmphasis'
|
44
|
+
},
|
45
|
+
draft: {
|
46
|
+
backgroundColor: 'neutral.emphasis',
|
47
|
+
color: 'fg.onEmphasis'
|
48
|
+
},
|
49
|
+
issueDraft: {
|
50
|
+
backgroundColor: 'neutral.emphasis',
|
51
|
+
color: 'fg.onEmphasis'
|
52
|
+
}
|
53
|
+
}
|
54
|
+
});
|
55
|
+
const sizeVariants = styled_system_1.variant({
|
56
|
+
prop: 'variant',
|
57
|
+
variants: {
|
58
|
+
small: {
|
59
|
+
paddingX: 2,
|
60
|
+
paddingY: 1,
|
61
|
+
fontSize: 0
|
62
|
+
},
|
63
|
+
normal: {
|
64
|
+
paddingX: '12px',
|
65
|
+
paddingY: 2,
|
66
|
+
fontSize: 1
|
67
|
+
}
|
68
|
+
}
|
69
|
+
});
|
70
|
+
const StateLabelBase = styled_components_1.default.span `
|
71
|
+
display: inline-flex;
|
72
|
+
align-items: center;
|
73
|
+
font-weight: ${constants_1.get('fontWeights.bold')};
|
74
|
+
line-height: 16px;
|
75
|
+
color: ${constants_1.get('colors.canvas.default')};
|
76
|
+
text-align: center;
|
77
|
+
border-radius: ${constants_1.get('radii.3')};
|
78
|
+
${colorVariants};
|
79
|
+
${sizeVariants};
|
80
|
+
${constants_1.COMMON};
|
81
|
+
${sx_1.default};
|
82
|
+
`;
|
83
|
+
function StateLabel({ children, status, variant: variantProp, ...rest }) {
|
84
|
+
const octiconProps = variantProp === 'small' ? { width: '1em' } : {};
|
85
|
+
return (<StateLabelBase {...rest} variant={variantProp} status={status}>
|
86
|
+
{/* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */}
|
87
|
+
{status && <StyledOcticon_1.default mr={1} {...octiconProps} icon={octiconMap[status] || octicons_react_1.QuestionIcon}/>}
|
88
|
+
{children}
|
89
|
+
</StateLabelBase>);
|
90
|
+
}
|
91
|
+
StateLabel.defaultProps = {
|
92
|
+
variant: 'normal'
|
93
|
+
};
|
94
|
+
exports.default = StateLabel;
|
package/lib/StyledOcticon.d.ts
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import { IconProps } from '@primer/octicons-react';
|
2
2
|
import React from 'react';
|
3
|
+
import { SystemCommonProps } from './constants';
|
3
4
|
import { SxProp } from './sx';
|
4
5
|
import { ComponentProps } from './utils/types';
|
5
6
|
declare type OcticonProps = {
|
6
7
|
icon: React.ElementType;
|
7
8
|
} & IconProps;
|
8
9
|
declare function Octicon({ icon: IconComponent, ...rest }: OcticonProps): JSX.Element;
|
9
|
-
declare const StyledOcticon: import("styled-components").StyledComponent<typeof Octicon, any, SxProp, never>;
|
10
|
+
declare const StyledOcticon: import("styled-components").StyledComponent<typeof Octicon, any, SystemCommonProps & SxProp, never>;
|
10
11
|
export declare type StyledOcticonProps = ComponentProps<typeof StyledOcticon>;
|
11
12
|
export default StyledOcticon;
|
package/lib/StyledOcticon.js
CHANGED
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
11
11
|
|
12
|
+
var _constants = require("./constants");
|
13
|
+
|
12
14
|
var _sx = _interopRequireDefault(require("./sx"));
|
13
15
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -23,8 +25,8 @@ function Octicon({
|
|
23
25
|
Octicon.displayName = "Octicon";
|
24
26
|
const StyledOcticon = (0, _styledComponents.default)(Octicon).withConfig({
|
25
27
|
displayName: "StyledOcticon",
|
26
|
-
componentId: "
|
27
|
-
})(["", ""], _sx.default);
|
28
|
+
componentId: "uhnt7w-0"
|
29
|
+
})(["", " ", ""], _constants.COMMON, _sx.default);
|
28
30
|
StyledOcticon.defaultProps = {
|
29
31
|
size: 16
|
30
32
|
};
|
@@ -0,0 +1,20 @@
|
|
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
|
+
function Octicon({ icon: IconComponent, ...rest }) {
|
11
|
+
return <IconComponent {...rest}/>;
|
12
|
+
}
|
13
|
+
const StyledOcticon = styled_components_1.default(Octicon) `
|
14
|
+
${constants_1.COMMON}
|
15
|
+
${sx_1.default}
|
16
|
+
`;
|
17
|
+
StyledOcticon.defaultProps = {
|
18
|
+
size: 16
|
19
|
+
};
|
20
|
+
exports.default = StyledOcticon;
|
package/lib/SubNav.d.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
import * as History from 'history';
|
2
2
|
import React from 'react';
|
3
|
+
import { SystemBorderProps, SystemCommonProps, SystemFlexProps } from './constants';
|
4
|
+
import { BoxProps } from './Box';
|
3
5
|
import { SxProp } from './sx';
|
4
6
|
import { ComponentProps } from './utils/types';
|
5
|
-
declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SxProp, never>;
|
7
|
+
declare const SubNavBase: import("styled-components").StyledComponent<"nav", any, SystemFlexProps & SystemCommonProps & SxProp, never>;
|
6
8
|
export declare type SubNavProps = {
|
7
9
|
actions?: React.ReactNode;
|
8
10
|
align?: 'right';
|
@@ -10,17 +12,21 @@ export declare type SubNavProps = {
|
|
10
12
|
label?: string;
|
11
13
|
} & ComponentProps<typeof SubNavBase>;
|
12
14
|
declare function SubNav({ actions, className, children, label, ...rest }: SubNavProps): JSX.Element;
|
13
|
-
export declare type SubNavLinksProps =
|
15
|
+
export declare type SubNavLinksProps = BoxProps;
|
16
|
+
declare function SubNavLinks(props: SubNavLinksProps): JSX.Element;
|
17
|
+
declare namespace SubNavLinks {
|
18
|
+
var displayName: string;
|
19
|
+
}
|
14
20
|
declare const SubNavLink: import("styled-components").StyledComponent<"a", any, {
|
15
21
|
to?: History.LocationDescriptor<unknown> | undefined;
|
16
22
|
selected?: boolean | undefined;
|
17
|
-
} & SxProp, never>;
|
23
|
+
} & SystemCommonProps & SxProp & SystemBorderProps, never>;
|
18
24
|
export declare type SubNavLinkProps = ComponentProps<typeof SubNavLink>;
|
19
25
|
declare const _default: typeof SubNav & {
|
20
26
|
Link: import("styled-components").StyledComponent<"a", any, {
|
21
27
|
to?: History.LocationDescriptor<unknown> | undefined;
|
22
28
|
selected?: boolean | undefined;
|
23
|
-
} & SxProp, never>;
|
24
|
-
Links:
|
29
|
+
} & SystemCommonProps & SxProp & SystemBorderProps, never>;
|
30
|
+
Links: typeof SubNavLinks;
|
25
31
|
};
|
26
32
|
export default _default;
|
package/lib/SubNav.js
CHANGED
@@ -13,6 +13,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
13
|
|
14
14
|
var _constants = require("./constants");
|
15
15
|
|
16
|
+
var _Box = _interopRequireDefault(require("./Box"));
|
17
|
+
|
16
18
|
var _sx = _interopRequireDefault(require("./sx"));
|
17
19
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -24,8 +26,8 @@ const SELECTED_CLASS = 'selected';
|
|
24
26
|
|
25
27
|
const SubNavBase = _styledComponents.default.nav.withConfig({
|
26
28
|
displayName: "SubNav__SubNavBase",
|
27
|
-
componentId: "
|
28
|
-
})(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";"], (0, _constants.get)('space.2'), _sx.default);
|
29
|
+
componentId: "f7w0xa-0"
|
30
|
+
})(["display:flex;justify-content:space-between;.SubNav-body{display:flex;margin-bottom:-1px;> *{margin-left:", ";}> *:first-child{margin-left:0;}}.SubNav-actions{align-self:center;}", ";", ";", ";"], (0, _constants.get)('space.2'), _constants.COMMON, _constants.FLEX, _sx.default);
|
29
31
|
|
30
32
|
function SubNav({
|
31
33
|
actions,
|
@@ -47,18 +49,21 @@ function SubNav({
|
|
47
49
|
|
48
50
|
SubNav.displayName = "SubNav";
|
49
51
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}
|
52
|
+
function SubNavLinks(props) {
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_Box.default, _extends({
|
54
|
+
display: "flex"
|
55
|
+
}, props));
|
56
|
+
}
|
57
|
+
|
58
|
+
SubNavLinks.displayName = "SubNavLinks";
|
54
59
|
|
55
60
|
const SubNavLink = _styledComponents.default.a.attrs(props => ({
|
56
61
|
activeClassName: typeof props.to === 'string' ? 'selected' : '',
|
57
62
|
className: (0, _classnames.default)(ITEM_CLASS, props.selected && SELECTED_CLASS, props.className)
|
58
63
|
})).withConfig({
|
59
64
|
displayName: "SubNav__SubNavLink",
|
60
|
-
componentId: "
|
61
|
-
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.canvas.subtle'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.onEmphasis'), _sx.default);
|
65
|
+
componentId: "f7w0xa-1"
|
66
|
+
})(["padding-left:", ";padding-right:", ";font-weight:", ";font-size:", ";line-height:20px;min-height:34px;color:", ";text-align:center;text-decoration:none;border-top:1px solid ", ";border-bottom:1px solid ", ";border-right:1px solid ", ";display:flex;align-items:center;&:first-of-type{border-top-left-radius:", ";border-bottom-left-radius:", ";border-left:1px solid ", ";}&:last-of-type{border-top-right-radius:", ";border-bottom-right-radius:", ";}&:hover,&:focus{text-decoration:none;background-color:", ";transition:0.2s ease;.SubNav-octicon{color:", ";}}&.selected{color:", ";background-color:", ";border-color:", ";.SubNav-octicon{color:", ";}}", ";", ";"], (0, _constants.get)('space.3'), (0, _constants.get)('space.3'), (0, _constants.get)('fontWeights.semibold'), (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.canvas.subtle'), (0, _constants.get)('colors.fg.muted'), (0, _constants.get)('colors.fg.onEmphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.accent.emphasis'), (0, _constants.get)('colors.fg.onEmphasis'), _constants.COMMON, _sx.default);
|
62
67
|
|
63
68
|
SubNavLink.displayName = 'SubNav.Link';
|
64
69
|
SubNavLinks.displayName = 'SubNav.Links';
|
package/lib/SubNav.jsx
ADDED
@@ -0,0 +1,104 @@
|
|
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 classnames_1 = __importDefault(require("classnames"));
|
7
|
+
const react_1 = __importDefault(require("react"));
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
9
|
+
const constants_1 = require("./constants");
|
10
|
+
const Box_1 = __importDefault(require("./Box"));
|
11
|
+
const sx_1 = __importDefault(require("./sx"));
|
12
|
+
const ITEM_CLASS = 'SubNav-item';
|
13
|
+
const SELECTED_CLASS = 'selected';
|
14
|
+
const SubNavBase = styled_components_1.default.nav `
|
15
|
+
display: flex;
|
16
|
+
justify-content: space-between;
|
17
|
+
|
18
|
+
.SubNav-body {
|
19
|
+
display: flex;
|
20
|
+
margin-bottom: -1px;
|
21
|
+
|
22
|
+
> * {
|
23
|
+
margin-left: ${constants_1.get('space.2')};
|
24
|
+
}
|
25
|
+
|
26
|
+
> *:first-child {
|
27
|
+
margin-left: 0;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
.SubNav-actions {
|
32
|
+
align-self: center;
|
33
|
+
}
|
34
|
+
|
35
|
+
${constants_1.COMMON};
|
36
|
+
${constants_1.FLEX};
|
37
|
+
${sx_1.default};
|
38
|
+
`;
|
39
|
+
function SubNav({ actions, className, children, label, ...rest }) {
|
40
|
+
const classes = classnames_1.default(className, 'SubNav');
|
41
|
+
return (<SubNavBase className={classes} aria-label={label} {...rest}>
|
42
|
+
<div className="SubNav-body">{children}</div>
|
43
|
+
{actions && <div className="SubNav-actions">{actions}</div>}
|
44
|
+
</SubNavBase>);
|
45
|
+
}
|
46
|
+
function SubNavLinks(props) {
|
47
|
+
return <Box_1.default display="flex" {...props}/>;
|
48
|
+
}
|
49
|
+
const SubNavLink = styled_components_1.default.a.attrs(props => ({
|
50
|
+
activeClassName: typeof props.to === 'string' ? 'selected' : '',
|
51
|
+
className: classnames_1.default(ITEM_CLASS, props.selected && SELECTED_CLASS, props.className)
|
52
|
+
})) `
|
53
|
+
padding-left: ${constants_1.get('space.3')};
|
54
|
+
padding-right: ${constants_1.get('space.3')};
|
55
|
+
font-weight: ${constants_1.get('fontWeights.semibold')};
|
56
|
+
font-size: ${constants_1.get('fontSizes.1')};
|
57
|
+
line-height: 20px; //custom value for SubNav
|
58
|
+
min-height: 34px; //custom value for SubNav
|
59
|
+
color: ${constants_1.get('colors.fg.default')};
|
60
|
+
text-align: center;
|
61
|
+
text-decoration: none;
|
62
|
+
border-top: 1px solid ${constants_1.get('colors.border.default')};
|
63
|
+
border-bottom: 1px solid ${constants_1.get('colors.border.default')};
|
64
|
+
border-right: 1px solid ${constants_1.get('colors.border.default')};
|
65
|
+
display: flex;
|
66
|
+
align-items: center;
|
67
|
+
|
68
|
+
&:first-of-type {
|
69
|
+
border-top-left-radius: ${constants_1.get('radii.2')};
|
70
|
+
border-bottom-left-radius: ${constants_1.get('radii.2')};
|
71
|
+
border-left: 1px solid ${constants_1.get('colors.border.default')};
|
72
|
+
}
|
73
|
+
|
74
|
+
&:last-of-type {
|
75
|
+
border-top-right-radius: ${constants_1.get('radii.2')};
|
76
|
+
border-bottom-right-radius: ${constants_1.get('radii.2')};
|
77
|
+
}
|
78
|
+
|
79
|
+
&:hover,
|
80
|
+
&:focus {
|
81
|
+
text-decoration: none;
|
82
|
+
background-color: ${constants_1.get('colors.canvas.subtle')};
|
83
|
+
transition: 0.2s ease;
|
84
|
+
|
85
|
+
.SubNav-octicon {
|
86
|
+
color: ${constants_1.get('colors.fg.muted')};
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
&.selected {
|
91
|
+
color: ${constants_1.get('colors.fg.onEmphasis')};
|
92
|
+
background-color: ${constants_1.get('colors.accent.emphasis')};
|
93
|
+
border-color: ${constants_1.get('colors.accent.emphasis')};
|
94
|
+
.SubNav-octicon {
|
95
|
+
color: ${constants_1.get('colors.fg.onEmphasis')};
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
${constants_1.COMMON};
|
100
|
+
${sx_1.default};
|
101
|
+
`;
|
102
|
+
SubNavLink.displayName = 'SubNav.Link';
|
103
|
+
SubNavLinks.displayName = 'SubNav.Links';
|
104
|
+
exports.default = Object.assign(SubNav, { Link: SubNavLink, Links: SubNavLinks });
|
package/lib/TabNav.d.ts
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import * as History from 'history';
|
3
|
+
import { SystemCommonProps, SystemTypographyProps } from './constants';
|
3
4
|
import { SxProp } from './sx';
|
4
5
|
import { ComponentProps } from './utils/types';
|
5
|
-
declare const TabNavBase: import("styled-components").StyledComponent<"div", any, SxProp, never>;
|
6
|
+
declare const TabNavBase: import("styled-components").StyledComponent<"div", any, SystemCommonProps & SxProp, never>;
|
6
7
|
export declare type TabNavProps = ComponentProps<typeof TabNavBase>;
|
7
8
|
declare function TabNav({ children, 'aria-label': ariaLabel, ...rest }: TabNavProps): JSX.Element;
|
8
9
|
declare const TabNavLink: import("styled-components").StyledComponent<"a", any, {
|
9
10
|
to?: History.LocationDescriptor<unknown> | undefined;
|
10
11
|
selected?: boolean | undefined;
|
11
|
-
} & SxProp, never>;
|
12
|
+
} & SystemCommonProps & SxProp & SystemTypographyProps, never>;
|
12
13
|
export declare type TabNavLinkProps = ComponentProps<typeof TabNavLink>;
|
13
14
|
declare const _default: typeof TabNav & {
|
14
15
|
Link: import("styled-components").StyledComponent<"a", any, {
|
15
16
|
to?: History.LocationDescriptor<unknown> | undefined;
|
16
17
|
selected?: boolean | undefined;
|
17
|
-
} & SxProp, never>;
|
18
|
+
} & SystemCommonProps & SxProp & SystemTypographyProps, never>;
|
18
19
|
};
|
19
20
|
export default _default;
|
package/lib/TabNav.js
CHANGED
@@ -23,7 +23,7 @@ const SELECTED_CLASS = 'selected';
|
|
23
23
|
const TabNavBase = _styledComponents.default.div.withConfig({
|
24
24
|
displayName: "TabNav__TabNavBase",
|
25
25
|
componentId: "sc-1xod0ow-0"
|
26
|
-
})(["margin-top:0;border-bottom:1px solid ", ";", ""], (0, _constants.get)('colors.border.default'), _sx.default);
|
26
|
+
})(["margin-top:0;border-bottom:1px solid ", ";", " ", ""], (0, _constants.get)('colors.border.default'), _constants.COMMON, _sx.default);
|
27
27
|
|
28
28
|
const TabNavBody = _styledComponents.default.nav.withConfig({
|
29
29
|
displayName: "TabNav__TabNavBody",
|
@@ -48,7 +48,7 @@ const TabNavLink = _styledComponents.default.a.attrs(props => ({
|
|
48
48
|
})).withConfig({
|
49
49
|
displayName: "TabNav__TabNavLink",
|
50
50
|
componentId: "sc-1xod0ow-2"
|
51
|
-
})(["padding:8px 12px;font-size:", ";line-height:20px;color:", ";text-decoration:none;background-color:transparent;border:1px solid transparent;border-bottom:0;&:hover,&:focus{color:", ";text-decoration:none;}&.selected{color:", ";border-color:", ";border-top-right-radius:", ";border-top-left-radius:", ";background-color:", ";}", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.canvas.default'), _sx.default);
|
51
|
+
})(["padding:8px 12px;font-size:", ";line-height:20px;color:", ";text-decoration:none;background-color:transparent;border:1px solid transparent;border-bottom:0;&:hover,&:focus{color:", ";text-decoration:none;}&.selected{color:", ";border-color:", ";border-top-right-radius:", ";border-top-left-radius:", ";background-color:", ";}", ";", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('radii.2'), (0, _constants.get)('colors.canvas.default'), _constants.COMMON, _sx.default);
|
52
52
|
|
53
53
|
TabNavLink.displayName = 'TabNav.Link';
|
54
54
|
|
package/lib/TabNav.jsx
ADDED
@@ -0,0 +1,60 @@
|
|
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 classnames_1 = __importDefault(require("classnames"));
|
7
|
+
const react_1 = __importDefault(require("react"));
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
9
|
+
const constants_1 = require("./constants");
|
10
|
+
const sx_1 = __importDefault(require("./sx"));
|
11
|
+
const ITEM_CLASS = 'TabNav-item';
|
12
|
+
const SELECTED_CLASS = 'selected';
|
13
|
+
const TabNavBase = styled_components_1.default.div `
|
14
|
+
margin-top: 0;
|
15
|
+
border-bottom: 1px solid ${constants_1.get('colors.border.default')};
|
16
|
+
${constants_1.COMMON}
|
17
|
+
${sx_1.default}
|
18
|
+
`;
|
19
|
+
const TabNavBody = styled_components_1.default.nav `
|
20
|
+
display: flex;
|
21
|
+
margin-bottom: -1px;
|
22
|
+
overflow: auto;
|
23
|
+
`;
|
24
|
+
function TabNav({ children, 'aria-label': ariaLabel, ...rest }) {
|
25
|
+
return (<TabNavBase {...rest}>
|
26
|
+
<TabNavBody aria-label={ariaLabel}>{children}</TabNavBody>
|
27
|
+
</TabNavBase>);
|
28
|
+
}
|
29
|
+
const TabNavLink = styled_components_1.default.a.attrs(props => ({
|
30
|
+
activeClassName: typeof props.to === 'string' ? 'selected' : '',
|
31
|
+
className: classnames_1.default(ITEM_CLASS, props.selected && SELECTED_CLASS, props.className)
|
32
|
+
})) `
|
33
|
+
padding: 8px 12px;
|
34
|
+
font-size: ${constants_1.get('fontSizes.1')};
|
35
|
+
line-height: 20px;
|
36
|
+
color: ${constants_1.get('colors.fg.default')};
|
37
|
+
text-decoration: none;
|
38
|
+
background-color: transparent;
|
39
|
+
border: 1px solid transparent;
|
40
|
+
border-bottom: 0;
|
41
|
+
|
42
|
+
&:hover,
|
43
|
+
&:focus {
|
44
|
+
color: ${constants_1.get('colors.fg.default')};
|
45
|
+
text-decoration: none;
|
46
|
+
}
|
47
|
+
|
48
|
+
&.selected {
|
49
|
+
color: ${constants_1.get('colors.fg.default')};
|
50
|
+
border-color: ${constants_1.get('colors.border.default')};
|
51
|
+
border-top-right-radius: ${constants_1.get('radii.2')};
|
52
|
+
border-top-left-radius: ${constants_1.get('radii.2')};
|
53
|
+
background-color: ${constants_1.get('colors.canvas.default')};
|
54
|
+
}
|
55
|
+
|
56
|
+
${constants_1.COMMON};
|
57
|
+
${sx_1.default};
|
58
|
+
`;
|
59
|
+
TabNavLink.displayName = 'TabNav.Link';
|
60
|
+
exports.default = Object.assign(TabNav, { Link: TabNavLink });
|
package/lib/Text.jsx
ADDED
@@ -0,0 +1,14 @@
|
|
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 styled_components_1 = __importDefault(require("styled-components"));
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const sx_1 = __importDefault(require("./sx"));
|
9
|
+
const Text = styled_components_1.default.span `
|
10
|
+
${constants_1.TYPOGRAPHY};
|
11
|
+
${constants_1.COMMON};
|
12
|
+
${sx_1.default};
|
13
|
+
`;
|
14
|
+
exports.default = Text;
|
@@ -0,0 +1,23 @@
|
|
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 classnames_1 = __importDefault(require("classnames"));
|
7
|
+
const react_1 = __importDefault(require("react"));
|
8
|
+
const _UnstyledTextInput_1 = __importDefault(require("./_UnstyledTextInput"));
|
9
|
+
const _TextInputWrapper_1 = __importDefault(require("./_TextInputWrapper"));
|
10
|
+
// using forwardRef is important so that other components (ex. SelectMenu) can autofocus the input
|
11
|
+
const TextInput = react_1.default.forwardRef(({ icon: IconComponent, block, className, contrast, disabled, sx: sxProp, theme, width: widthProp, minWidth: minWidthProp, maxWidth: maxWidthProp, variant: variantProp, ...inputProps }, ref) => {
|
12
|
+
// this class is necessary to style FilterSearch, plz no touchy!
|
13
|
+
const wrapperClasses = classnames_1.default(className, 'TextInput-wrapper');
|
14
|
+
return (<_TextInputWrapper_1.default block={block} className={wrapperClasses} contrast={contrast} disabled={disabled} hasIcon={!!IconComponent} sx={sxProp} theme={theme} width={widthProp} minWidth={minWidthProp} maxWidth={maxWidthProp} variant={variantProp}>
|
15
|
+
{IconComponent && <IconComponent className="TextInput-icon"/>}
|
16
|
+
<_UnstyledTextInput_1.default ref={ref} disabled={disabled} {...inputProps}/>
|
17
|
+
</_TextInputWrapper_1.default>);
|
18
|
+
});
|
19
|
+
TextInput.defaultProps = {
|
20
|
+
type: 'text'
|
21
|
+
};
|
22
|
+
TextInput.displayName = 'TextInput';
|
23
|
+
exports.default = TextInput;
|
@@ -39,20 +39,18 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
|
|
39
39
|
} & Pick<Omit<Pick<{
|
40
40
|
[x: string]: any;
|
41
41
|
[x: number]: any;
|
42
|
-
[x: symbol]: any;
|
43
42
|
} & {
|
44
43
|
theme?: any;
|
45
44
|
} & {
|
46
45
|
as?: string | React.ComponentType<any> | undefined;
|
47
46
|
forwardedAs?: string | React.ComponentType<any> | undefined;
|
48
|
-
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "
|
47
|
+
}, string | number | symbol>, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "icon" | "sx" | "variant" | "className" | "disabled" | "contrast"> & {
|
49
48
|
className?: string | undefined;
|
50
49
|
icon?: React.ComponentType<{
|
51
50
|
className?: string | undefined;
|
52
51
|
}> | undefined;
|
53
52
|
} & Pick<{
|
54
53
|
color?: string | undefined;
|
55
|
-
property?: string | undefined;
|
56
54
|
maxWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MaxWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
57
55
|
minWidth?: import("styled-system").ResponsiveValue<import("csstype").Property.MinWidth<import("styled-system").TLengthStyledSystem>, Required<import("styled-system").Theme<import("styled-system").TLengthStyledSystem>>> | undefined;
|
58
56
|
translate?: "yes" | "no" | undefined;
|
@@ -64,9 +62,9 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
|
|
64
62
|
style?: React.CSSProperties | undefined;
|
65
63
|
title?: string | undefined;
|
66
64
|
block?: boolean | undefined;
|
65
|
+
sx?: import("./sx").BetterSystemStyleObject | undefined;
|
67
66
|
variant?: "small" | "large" | undefined;
|
68
67
|
role?: React.AriaRole | undefined;
|
69
|
-
sx?: import("./sx").BetterSystemStyleObject | undefined;
|
70
68
|
key?: React.Key | null | undefined;
|
71
69
|
defaultChecked?: boolean | undefined;
|
72
70
|
defaultValue?: string | number | readonly string[] | undefined;
|
@@ -88,6 +86,7 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
|
|
88
86
|
datatype?: string | undefined;
|
89
87
|
inlist?: any;
|
90
88
|
prefix?: string | undefined;
|
89
|
+
property?: string | undefined;
|
91
90
|
resource?: string | undefined;
|
92
91
|
typeof?: string | undefined;
|
93
92
|
vocab?: string | undefined;
|
@@ -315,13 +314,12 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
|
|
315
314
|
onAnimationIterationCapture?: React.AnimationEventHandler<HTMLSpanElement> | undefined;
|
316
315
|
onTransitionEnd?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
317
316
|
onTransitionEndCapture?: React.TransitionEventHandler<HTMLSpanElement> | undefined;
|
318
|
-
css?: import("@emotion/core").InterpolationWithTheme<any>;
|
319
317
|
disabled?: boolean | undefined;
|
320
318
|
hasIcon?: boolean | undefined;
|
321
319
|
contrast?: boolean | undefined;
|
322
320
|
} & {
|
323
321
|
theme?: any;
|
324
|
-
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "
|
322
|
+
}, "maxWidth" | "minWidth" | "width" | "theme" | "block" | "sx" | "variant" | "disabled" | "contrast">, string | number | symbol> & React.RefAttributes<HTMLInputElement> & {
|
325
323
|
selectedTokenIndex: number | undefined;
|
326
324
|
setSelectedTokenIndex: React.Dispatch<React.SetStateAction<number | undefined>>;
|
327
325
|
}, string | number | symbol> & React.RefAttributes<HTMLInputElement>>;
|