@primer/components 29.0.0 → 29.1.1-rc.cea79543
Sign up to get free protection for your applications and to get access to all the features.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +10 -0
- package/.devcontainer/devcontainer.json +8 -0
- package/.eslintrc.json +106 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
- package/.github/ISSUE_TEMPLATE/new_component_proposal_template.md +41 -0
- package/.github/dependabot.yml +18 -0
- package/.github/pull_request_template.md +18 -0
- package/.github/workflows/ci.yml +31 -0
- package/.github/workflows/deploy_preview.yml +47 -0
- package/.github/workflows/deploy_production.yml +70 -0
- package/.github/workflows/release.yml +35 -0
- package/.github/workflows/release_canary.yml +70 -0
- package/.github/workflows/release_candidate.yml +60 -0
- package/.github/workflows/size.yml +13 -0
- package/.github/workflows/stale.yml +26 -0
- package/.gitignore +10 -0
- package/.npmrc +4 -0
- package/.nvmrc +1 -0
- package/.storybook/main.js +11 -0
- package/.storybook/preview.js +69 -0
- package/.vscode/launch.json +21 -0
- package/.vscode/settings.json +13 -0
- package/@types/@styled-system/index.d.ts +0 -0
- package/@types/@styled-system/prop-types/index.d.ts +1 -0
- package/@types/@styled-system/props/index.d.ts +1 -0
- package/@types/jest-styled-components/index.d.ts +1 -0
- package/CHANGELOG.md +16 -0
- package/CODEOWNERS +2 -0
- package/babel-defines.js +13 -0
- package/babel.config.js +39 -0
- package/contributor-docs/CODE_OF_CONDUCT.md +76 -0
- package/contributor-docs/CONTRIBUTING.md +274 -0
- package/contributor-docs/adrs/adr-001-typescript.md +23 -0
- package/contributor-docs/adrs/adr-002-behavior-isolation.md +106 -0
- package/contributor-docs/behaviors.md +132 -0
- package/contributor-docs/component-contents-api-patterns.md +315 -0
- package/contributor-docs/principles.md +39 -0
- package/dist/browser.esm.js +195 -195
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +301 -301
- package/dist/browser.umd.js.map +1 -1
- package/docs/.eslintrc +0 -0
- package/docs/.gitignore +91 -0
- package/docs/components/PropsList.js +5 -0
- package/docs/components/State.js +9 -0
- package/docs/components/constants.js +34 -0
- package/docs/components/index.js +2 -0
- package/docs/content/ActionList.mdx +72 -0
- package/docs/content/ActionMenu.mdx +80 -0
- package/docs/content/AnchoredOverlay.mdx +37 -0
- package/docs/content/Avatar.mdx +33 -0
- package/docs/content/AvatarStack.mdx +43 -0
- package/docs/content/BorderBox.md +46 -0
- package/docs/content/Box.md +74 -0
- package/docs/content/BranchName.md +18 -0
- package/docs/content/Breadcrumbs.md +52 -0
- package/docs/content/Buttons.md +54 -0
- package/docs/content/CircleBadge.md +45 -0
- package/docs/content/CircleOcticon.md +18 -0
- package/docs/content/CounterLabel.md +30 -0
- package/docs/content/Details.md +105 -0
- package/docs/content/Dialog.md +108 -0
- package/docs/content/Dialog2.mdx +179 -0
- package/docs/content/Dropdown.md +72 -0
- package/docs/content/DropdownMenu.mdx +49 -0
- package/docs/content/FilterList.md +44 -0
- package/docs/content/FilteredSearch.md +39 -0
- package/docs/content/Flash.md +42 -0
- package/docs/content/Flex.md +58 -0
- package/docs/content/FormGroup.md +44 -0
- package/docs/content/Grid.md +59 -0
- package/docs/content/Header.md +79 -0
- package/docs/content/Heading.md +22 -0
- package/docs/content/Label.md +40 -0
- package/docs/content/LabelGroup.md +31 -0
- package/docs/content/Link.md +37 -0
- package/docs/content/Overlay.mdx +94 -0
- package/docs/content/Pagehead.md +27 -0
- package/docs/content/Pagination.md +187 -0
- package/docs/content/PointerBox.md +81 -0
- package/docs/content/Popover.md +137 -0
- package/docs/content/Portal.mdx +73 -0
- package/docs/content/Position.md +97 -0
- package/docs/content/ProgressBar.mdx +29 -0
- package/docs/content/SelectMenu.md +433 -0
- package/docs/content/SelectPanel.mdx +67 -0
- package/docs/content/SideNav.md +179 -0
- package/docs/content/Spinner.mdx +32 -0
- package/docs/content/StateLabel.md +33 -0
- package/docs/content/StyledOcticon.md +34 -0
- package/docs/content/SubNav.md +102 -0
- package/docs/content/TabNav.md +50 -0
- package/docs/content/Text.md +29 -0
- package/docs/content/TextInput.md +32 -0
- package/docs/content/Timeline.md +138 -0
- package/docs/content/Tooltip.md +41 -0
- package/docs/content/Truncate.md +65 -0
- package/docs/content/UnderlineNav.md +53 -0
- package/docs/content/anchoredPosition.mdx +163 -0
- package/docs/content/core-concepts.md +70 -0
- package/docs/content/focusTrap.mdx +103 -0
- package/docs/content/focusZone.mdx +145 -0
- package/docs/content/getting-started.md +134 -0
- package/docs/content/index.md +33 -0
- package/docs/content/linting.md +35 -0
- package/docs/content/overriding-styles.mdx +79 -0
- package/docs/content/philosophy.md +23 -0
- package/docs/content/primer-theme.md +89 -0
- package/docs/content/ssr.mdx +43 -0
- package/docs/content/system-props.mdx +37 -0
- package/docs/content/theme-reference.md +16 -0
- package/docs/content/theming.md +249 -0
- package/docs/content/useOnEscapePress.mdx +56 -0
- package/docs/content/useOnOutsideClick.mdx +57 -0
- package/docs/content/useOpenAndCloseFocus.mdx +49 -0
- package/docs/content/useOverlay.mdx +62 -0
- package/docs/content/useSafeTimeout.mdx +32 -0
- package/docs/gatsby-config.js +30 -0
- package/docs/gatsby-node.js +101 -0
- package/docs/package-lock.json +20979 -0
- package/docs/package.json +35 -0
- package/docs/src/@primer/gatsby-theme-doctocat/components/hero.js +21 -0
- package/docs/src/@primer/gatsby-theme-doctocat/components/live-code.js +84 -0
- package/docs/src/@primer/gatsby-theme-doctocat/components/live-preview-wrapper.js +39 -0
- package/docs/src/@primer/gatsby-theme-doctocat/components/nav-dropdown.js +48 -0
- package/docs/src/@primer/gatsby-theme-doctocat/components/wrap-page-element.js +25 -0
- package/docs/src/@primer/gatsby-theme-doctocat/live-code-scope.js +54 -0
- package/docs/src/@primer/gatsby-theme-doctocat/nav.yml +127 -0
- package/docs/src/@primer/gatsby-theme-doctocat/primer-components-hero.svg +1411 -0
- package/docs/src/props.js +77 -0
- package/jest.config.js +13 -0
- package/lib/ActionList/Divider.js +1 -1
- package/lib/ActionList/Header.js +2 -2
- package/lib/ActionList/Item.js +10 -10
- package/lib/ActionList/List.js +1 -1
- package/lib/AvatarPair.js +1 -1
- package/lib/AvatarStack.js +1 -1
- package/lib/BranchName.js +1 -1
- package/lib/Breadcrumb.js +2 -2
- package/lib/Button/Button.d.ts +0 -1
- package/lib/Button/Button.js +1 -1
- package/lib/Button/ButtonClose.d.ts +1 -2
- package/lib/Button/ButtonClose.js +1 -1
- package/lib/Button/ButtonDanger.d.ts +0 -1
- package/lib/Button/ButtonInvisible.d.ts +0 -1
- package/lib/Button/ButtonInvisible.js +1 -1
- package/lib/Button/ButtonOutline.d.ts +0 -1
- package/lib/Button/ButtonPrimary.d.ts +0 -1
- package/lib/Button/ButtonTableList.js +1 -1
- package/lib/CircleBadge.js +1 -1
- package/lib/CircleOcticon.d.ts +0 -1
- package/lib/CircleOcticon.js +1 -1
- package/lib/CounterLabel.js +2 -2
- package/lib/Dialog/ConfirmationDialog.js +1 -1
- package/lib/Dialog/Dialog.js +5 -5
- package/lib/Dialog.d.ts +2 -3
- package/lib/Dialog.js +4 -4
- package/lib/Dropdown.d.ts +0 -4
- package/lib/Dropdown.js +2 -2
- package/lib/DropdownMenu/DropdownButton.d.ts +1 -2
- package/lib/DropdownStyles.js +6 -6
- package/lib/FilterList.d.ts +0 -1
- package/lib/FilterList.js +1 -1
- package/lib/FilteredActionList/FilteredActionList.js +2 -2
- package/lib/Flash.js +1 -1
- package/lib/Label.js +2 -2
- package/lib/Link.js +1 -1
- package/lib/Overlay.js +1 -1
- package/lib/Pagehead.js +1 -1
- package/lib/Pagination/Pagination.js +1 -1
- package/lib/Popover.js +1 -1
- package/lib/Position.d.ts +4 -4
- package/lib/ProgressBar.js +1 -1
- package/lib/SelectMenu/SelectMenu.d.ts +4 -10
- package/lib/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuItem.js +1 -1
- package/lib/SelectMenu/SelectMenuList.js +1 -1
- package/lib/SelectMenu/SelectMenuLoadingAnimation.js +1 -1
- package/lib/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib/SelectMenu/SelectMenuModal.js +2 -2
- package/lib/SelectMenu/SelectMenuTab.js +1 -1
- package/lib/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib/SideNav.js +5 -5
- package/lib/StateLabel.js +1 -1
- package/lib/SubNav.js +1 -1
- package/lib/TabNav.js +2 -2
- package/lib/TextInput.js +2 -2
- package/lib/Timeline.d.ts +0 -1
- package/lib/Timeline.js +5 -5
- package/lib/Tooltip.js +1 -1
- package/lib/UnderlineNav.js +2 -2
- package/lib/__tests__/ActionList.d.ts +1 -0
- package/lib/__tests__/ActionList.js +67 -0
- package/lib/__tests__/ActionMenu.d.ts +1 -0
- package/lib/__tests__/ActionMenu.js +154 -0
- package/lib/__tests__/AnchoredOverlay.d.ts +1 -0
- package/lib/__tests__/AnchoredOverlay.js +161 -0
- package/lib/__tests__/Avatar.d.ts +1 -0
- package/lib/__tests__/Avatar.js +70 -0
- package/lib/__tests__/AvatarStack.d.ts +1 -0
- package/lib/__tests__/AvatarStack.js +71 -0
- package/lib/__tests__/BorderBox.d.ts +1 -0
- package/lib/__tests__/BorderBox.js +61 -0
- package/lib/__tests__/Box.d.ts +1 -0
- package/lib/__tests__/Box.js +81 -0
- package/lib/__tests__/BranchName.d.ts +1 -0
- package/lib/__tests__/BranchName.js +39 -0
- package/lib/__tests__/Breadcrumb.d.ts +1 -0
- package/lib/__tests__/Breadcrumb.js +42 -0
- package/lib/__tests__/BreadcrumbItem.d.ts +1 -0
- package/lib/__tests__/BreadcrumbItem.js +52 -0
- package/lib/__tests__/Button.d.ts +1 -0
- package/lib/__tests__/Button.js +152 -0
- package/lib/__tests__/Caret.d.ts +1 -0
- package/lib/__tests__/Caret.js +52 -0
- package/lib/__tests__/CircleBadge.d.ts +1 -0
- package/lib/__tests__/CircleBadge.js +87 -0
- package/lib/__tests__/CircleOcticon.d.ts +1 -0
- package/lib/__tests__/CircleOcticon.js +74 -0
- package/lib/__tests__/CounterLabel.d.ts +1 -0
- package/lib/__tests__/CounterLabel.js +61 -0
- package/lib/__tests__/Details.d.ts +1 -0
- package/lib/__tests__/Details.js +120 -0
- package/lib/__tests__/Dialog.d.ts +1 -0
- package/lib/__tests__/Dialog.js +188 -0
- package/lib/__tests__/Dropdown.d.ts +1 -0
- package/lib/__tests__/Dropdown.js +70 -0
- package/lib/__tests__/DropdownMenu.d.ts +1 -0
- package/lib/__tests__/DropdownMenu.js +153 -0
- package/lib/__tests__/FilterList.d.ts +1 -0
- package/lib/__tests__/FilterList.js +39 -0
- package/lib/__tests__/FilterListItem.d.ts +1 -0
- package/lib/__tests__/FilterListItem.js +49 -0
- package/lib/__tests__/FilteredSearch.d.ts +1 -0
- package/lib/__tests__/FilteredSearch.js +39 -0
- package/lib/__tests__/Flash.d.ts +1 -0
- package/lib/__tests__/Flash.js +65 -0
- package/lib/__tests__/Flex.d.ts +1 -0
- package/lib/__tests__/Flex.js +77 -0
- package/lib/__tests__/FormGroup.d.ts +1 -0
- package/lib/__tests__/FormGroup.js +58 -0
- package/lib/__tests__/Grid.d.ts +1 -0
- package/lib/__tests__/Grid.js +107 -0
- package/lib/__tests__/Header.d.ts +1 -0
- package/lib/__tests__/Header.js +63 -0
- package/lib/__tests__/Heading.d.ts +1 -0
- package/lib/__tests__/Heading.js +112 -0
- package/lib/__tests__/Label.d.ts +1 -0
- package/lib/__tests__/Label.js +49 -0
- package/lib/__tests__/LabelGroup.d.ts +1 -0
- package/lib/__tests__/LabelGroup.js +41 -0
- package/lib/__tests__/Link.d.ts +1 -0
- package/lib/__tests__/Link.js +73 -0
- package/lib/__tests__/Overlay.d.ts +1 -0
- package/lib/__tests__/Overlay.js +145 -0
- package/lib/__tests__/Pagehead.d.ts +1 -0
- package/lib/__tests__/Pagehead.js +40 -0
- package/lib/__tests__/Pagination/Pagination.d.ts +1 -0
- package/lib/__tests__/Pagination/Pagination.js +50 -0
- package/lib/__tests__/Pagination/PaginationModel.d.ts +1 -0
- package/lib/__tests__/Pagination/PaginationModel.js +186 -0
- package/lib/__tests__/PointerBox.d.ts +1 -0
- package/lib/__tests__/PointerBox.js +49 -0
- package/lib/__tests__/Popover.d.ts +1 -0
- package/lib/__tests__/Popover.js +70 -0
- package/lib/__tests__/Portal.d.ts +1 -0
- package/lib/__tests__/Portal.js +124 -0
- package/lib/__tests__/Position.d.ts +1 -0
- package/lib/__tests__/Position.js +149 -0
- package/lib/__tests__/ProgressBar.d.ts +1 -0
- package/lib/__tests__/ProgressBar.js +71 -0
- package/lib/__tests__/SelectMenu.d.ts +1 -0
- package/lib/__tests__/SelectMenu.js +155 -0
- package/lib/__tests__/SelectPanel.d.ts +1 -0
- package/lib/__tests__/SelectPanel.js +83 -0
- package/lib/__tests__/SideNav.d.ts +1 -0
- package/lib/__tests__/SideNav.js +75 -0
- package/lib/__tests__/Spinner.d.ts +1 -0
- package/lib/__tests__/Spinner.js +56 -0
- package/lib/__tests__/StateLabel.d.ts +1 -0
- package/lib/__tests__/StateLabel.js +74 -0
- package/lib/__tests__/StyledOcticon.d.ts +1 -0
- package/lib/__tests__/StyledOcticon.js +43 -0
- package/lib/__tests__/SubNav.d.ts +1 -0
- package/lib/__tests__/SubNav.js +65 -0
- package/lib/__tests__/SubNavLink.d.ts +1 -0
- package/lib/__tests__/SubNavLink.js +52 -0
- package/lib/__tests__/TabNav.d.ts +1 -0
- package/lib/__tests__/TabNav.js +53 -0
- package/lib/__tests__/Text.d.ts +1 -0
- package/lib/__tests__/Text.js +108 -0
- package/lib/__tests__/TextInput.d.ts +1 -0
- package/lib/__tests__/TextInput.js +81 -0
- package/lib/__tests__/ThemeProvider.d.ts +1 -0
- package/lib/__tests__/ThemeProvider.js +444 -0
- package/lib/__tests__/Timeline.d.ts +1 -0
- package/lib/__tests__/Timeline.js +80 -0
- package/lib/__tests__/Tooltip.d.ts +1 -0
- package/lib/__tests__/Tooltip.js +72 -0
- package/lib/__tests__/Truncate.d.ts +1 -0
- package/lib/__tests__/Truncate.js +66 -0
- package/lib/__tests__/UnderlineNav.d.ts +1 -0
- package/lib/__tests__/UnderlineNav.js +75 -0
- package/lib/__tests__/UnderlineNavLink.d.ts +1 -0
- package/lib/__tests__/UnderlineNavLink.js +54 -0
- package/lib/__tests__/behaviors/anchoredPosition.d.ts +1 -0
- package/lib/__tests__/behaviors/anchoredPosition.js +390 -0
- package/lib/__tests__/behaviors/focusTrap.d.ts +1 -0
- package/lib/__tests__/behaviors/focusTrap.js +234 -0
- package/lib/__tests__/behaviors/focusZone.d.ts +1 -0
- package/lib/__tests__/behaviors/focusZone.js +570 -0
- package/lib/__tests__/behaviors/iterateFocusableElements.d.ts +1 -0
- package/lib/__tests__/behaviors/iterateFocusableElements.js +55 -0
- package/lib/__tests__/filterObject.d.ts +1 -0
- package/lib/__tests__/filterObject.js +30 -0
- package/lib/__tests__/hooks/useAnchoredPosition.d.ts +1 -0
- package/lib/__tests__/hooks/useAnchoredPosition.js +54 -0
- package/lib/__tests__/hooks/useOnEscapePress.d.ts +1 -0
- package/lib/__tests__/hooks/useOnEscapePress.js +32 -0
- package/lib/__tests__/hooks/useOnOutsideClick.d.ts +1 -0
- package/lib/__tests__/hooks/useOnOutsideClick.js +87 -0
- package/lib/__tests__/hooks/useOpenAndCloseFocus.d.ts +1 -0
- package/lib/__tests__/hooks/useOpenAndCloseFocus.js +60 -0
- package/lib/__tests__/hooks/useProvidedStateOrCreate.d.ts +1 -0
- package/lib/__tests__/hooks/useProvidedStateOrCreate.js +45 -0
- package/lib/__tests__/theme.d.ts +1 -0
- package/lib/__tests__/theme.js +36 -0
- package/lib/__tests__/themeGet.d.ts +1 -0
- package/lib/__tests__/themeGet.js +25 -0
- package/lib/__tests__/useSafeTimeout.d.ts +1 -0
- package/lib/__tests__/useSafeTimeout.js +45 -0
- package/lib/stories/ActionList.stories.js +382 -0
- package/lib/stories/ActionMenu.stories.js +338 -0
- package/lib/stories/AnchoredOverlay.stories.js +127 -0
- package/lib/stories/AvatarStack.stories.js +49 -0
- package/lib/stories/Button.stories.js +114 -0
- package/lib/stories/ConfirmationDialog.stories.js +111 -0
- package/lib/stories/Dialog.stories.js +265 -0
- package/lib/stories/DropdownMenu.stories.js +122 -0
- package/lib/stories/Overlay.stories.js +185 -0
- package/lib/stories/Portal.stories.js +104 -0
- package/lib/stories/SelectPanel.stories.js +342 -0
- package/lib/stories/ThemeProvider.stories.js +102 -0
- package/lib/stories/useAnchoredPosition.stories.js +351 -0
- package/lib/stories/useFocusTrap.stories.js +356 -0
- package/lib/stories/useFocusZone.stories.js +599 -0
- package/lib/theme-preval.d.ts +12 -6
- package/lib/theme-preval.js +2930 -1738
- package/lib/utils/testing.d.ts +4707 -2355
- package/lib-esm/ActionList/Divider.js +1 -1
- package/lib-esm/ActionList/Header.js +2 -2
- package/lib-esm/ActionList/Item.js +10 -10
- package/lib-esm/ActionList/List.js +1 -1
- package/lib-esm/AvatarPair.js +1 -1
- package/lib-esm/AvatarStack.js +1 -1
- package/lib-esm/BranchName.js +1 -1
- package/lib-esm/Breadcrumb.js +2 -2
- package/lib-esm/Button/Button.d.ts +0 -1
- package/lib-esm/Button/Button.js +1 -1
- package/lib-esm/Button/ButtonClose.d.ts +1 -2
- package/lib-esm/Button/ButtonClose.js +1 -1
- package/lib-esm/Button/ButtonDanger.d.ts +0 -1
- package/lib-esm/Button/ButtonInvisible.d.ts +0 -1
- package/lib-esm/Button/ButtonInvisible.js +1 -1
- package/lib-esm/Button/ButtonOutline.d.ts +0 -1
- package/lib-esm/Button/ButtonPrimary.d.ts +0 -1
- package/lib-esm/Button/ButtonTableList.js +1 -1
- package/lib-esm/CircleBadge.js +1 -1
- package/lib-esm/CircleOcticon.d.ts +0 -1
- package/lib-esm/CircleOcticon.js +1 -1
- package/lib-esm/CounterLabel.js +2 -2
- package/lib-esm/Dialog/ConfirmationDialog.js +1 -1
- package/lib-esm/Dialog/Dialog.js +5 -5
- package/lib-esm/Dialog.d.ts +2 -3
- package/lib-esm/Dialog.js +4 -4
- package/lib-esm/Dropdown.d.ts +0 -4
- package/lib-esm/Dropdown.js +2 -2
- package/lib-esm/DropdownMenu/DropdownButton.d.ts +1 -2
- package/lib-esm/DropdownStyles.js +6 -6
- package/lib-esm/FilterList.d.ts +0 -1
- package/lib-esm/FilterList.js +1 -1
- package/lib-esm/FilteredActionList/FilteredActionList.js +2 -2
- package/lib-esm/Flash.js +1 -1
- package/lib-esm/Label.js +2 -2
- package/lib-esm/Link.js +1 -1
- package/lib-esm/Overlay.js +1 -1
- package/lib-esm/Pagehead.js +1 -1
- package/lib-esm/Pagination/Pagination.js +1 -1
- package/lib-esm/Popover.js +1 -1
- package/lib-esm/Position.d.ts +4 -4
- package/lib-esm/ProgressBar.js +1 -1
- package/lib-esm/SelectMenu/SelectMenu.d.ts +4 -10
- package/lib-esm/SelectMenu/SelectMenuDivider.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFilter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuFooter.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuHeader.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuItem.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuItem.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuList.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuLoadingAnimation.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.d.ts +1 -1
- package/lib-esm/SelectMenu/SelectMenuModal.js +2 -2
- package/lib-esm/SelectMenu/SelectMenuTab.js +1 -1
- package/lib-esm/SelectMenu/SelectMenuTabPanel.js +1 -1
- package/lib-esm/SideNav.js +5 -5
- package/lib-esm/StateLabel.js +1 -1
- package/lib-esm/SubNav.js +1 -1
- package/lib-esm/TabNav.js +2 -2
- package/lib-esm/TextInput.js +2 -2
- package/lib-esm/Timeline.d.ts +0 -1
- package/lib-esm/Timeline.js +5 -5
- package/lib-esm/Tooltip.js +1 -1
- package/lib-esm/UnderlineNav.js +2 -2
- package/lib-esm/__tests__/ActionList.d.ts +1 -0
- package/lib-esm/__tests__/ActionList.js +54 -0
- package/lib-esm/__tests__/ActionMenu.d.ts +1 -0
- package/lib-esm/__tests__/ActionMenu.js +141 -0
- package/lib-esm/__tests__/AnchoredOverlay.d.ts +1 -0
- package/lib-esm/__tests__/AnchoredOverlay.js +135 -0
- package/lib-esm/__tests__/Avatar.d.ts +1 -0
- package/lib-esm/__tests__/Avatar.js +58 -0
- package/lib-esm/__tests__/AvatarStack.d.ts +1 -0
- package/lib-esm/__tests__/AvatarStack.js +57 -0
- package/lib-esm/__tests__/BorderBox.d.ts +1 -0
- package/lib-esm/__tests__/BorderBox.js +49 -0
- package/lib-esm/__tests__/Box.d.ts +1 -0
- package/lib-esm/__tests__/Box.js +69 -0
- package/lib-esm/__tests__/BranchName.d.ts +1 -0
- package/lib-esm/__tests__/BranchName.js +28 -0
- package/lib-esm/__tests__/Breadcrumb.d.ts +1 -0
- package/lib-esm/__tests__/Breadcrumb.js +31 -0
- package/lib-esm/__tests__/BreadcrumbItem.d.ts +1 -0
- package/lib-esm/__tests__/BreadcrumbItem.js +41 -0
- package/lib-esm/__tests__/Button.d.ts +1 -0
- package/lib-esm/__tests__/Button.js +141 -0
- package/lib-esm/__tests__/Caret.d.ts +1 -0
- package/lib-esm/__tests__/Caret.js +42 -0
- package/lib-esm/__tests__/CircleBadge.d.ts +1 -0
- package/lib-esm/__tests__/CircleBadge.js +73 -0
- package/lib-esm/__tests__/CircleOcticon.d.ts +1 -0
- package/lib-esm/__tests__/CircleOcticon.js +61 -0
- package/lib-esm/__tests__/CounterLabel.d.ts +1 -0
- package/lib-esm/__tests__/CounterLabel.js +49 -0
- package/lib-esm/__tests__/Details.d.ts +1 -0
- package/lib-esm/__tests__/Details.js +109 -0
- package/lib-esm/__tests__/Dialog.d.ts +1 -0
- package/lib-esm/__tests__/Dialog.js +174 -0
- package/lib-esm/__tests__/Dropdown.d.ts +1 -0
- package/lib-esm/__tests__/Dropdown.js +59 -0
- package/lib-esm/__tests__/DropdownMenu.d.ts +1 -0
- package/lib-esm/__tests__/DropdownMenu.js +139 -0
- package/lib-esm/__tests__/FilterList.d.ts +1 -0
- package/lib-esm/__tests__/FilterList.js +28 -0
- package/lib-esm/__tests__/FilterListItem.d.ts +1 -0
- package/lib-esm/__tests__/FilterListItem.js +38 -0
- package/lib-esm/__tests__/FilteredSearch.d.ts +1 -0
- package/lib-esm/__tests__/FilteredSearch.js +28 -0
- package/lib-esm/__tests__/Flash.d.ts +1 -0
- package/lib-esm/__tests__/Flash.js +53 -0
- package/lib-esm/__tests__/Flex.d.ts +1 -0
- package/lib-esm/__tests__/Flex.js +66 -0
- package/lib-esm/__tests__/FormGroup.d.ts +1 -0
- package/lib-esm/__tests__/FormGroup.js +47 -0
- package/lib-esm/__tests__/Grid.d.ts +1 -0
- package/lib-esm/__tests__/Grid.js +96 -0
- package/lib-esm/__tests__/Header.d.ts +1 -0
- package/lib-esm/__tests__/Header.js +52 -0
- package/lib-esm/__tests__/Heading.d.ts +1 -0
- package/lib-esm/__tests__/Heading.js +101 -0
- package/lib-esm/__tests__/Label.d.ts +1 -0
- package/lib-esm/__tests__/Label.js +38 -0
- package/lib-esm/__tests__/LabelGroup.d.ts +1 -0
- package/lib-esm/__tests__/LabelGroup.js +28 -0
- package/lib-esm/__tests__/Link.d.ts +1 -0
- package/lib-esm/__tests__/Link.js +62 -0
- package/lib-esm/__tests__/Overlay.d.ts +1 -0
- package/lib-esm/__tests__/Overlay.js +123 -0
- package/lib-esm/__tests__/Pagehead.d.ts +1 -0
- package/lib-esm/__tests__/Pagehead.js +28 -0
- package/lib-esm/__tests__/Pagination/Pagination.d.ts +1 -0
- package/lib-esm/__tests__/Pagination/Pagination.js +37 -0
- package/lib-esm/__tests__/Pagination/PaginationModel.d.ts +1 -0
- package/lib-esm/__tests__/Pagination/PaginationModel.js +182 -0
- package/lib-esm/__tests__/PointerBox.d.ts +1 -0
- package/lib-esm/__tests__/PointerBox.js +38 -0
- package/lib-esm/__tests__/Popover.d.ts +1 -0
- package/lib-esm/__tests__/Popover.js +56 -0
- package/lib-esm/__tests__/Portal.d.ts +1 -0
- package/lib-esm/__tests__/Portal.js +104 -0
- package/lib-esm/__tests__/Position.d.ts +1 -0
- package/lib-esm/__tests__/Position.js +138 -0
- package/lib-esm/__tests__/ProgressBar.d.ts +1 -0
- package/lib-esm/__tests__/ProgressBar.js +60 -0
- package/lib-esm/__tests__/SelectMenu.d.ts +1 -0
- package/lib-esm/__tests__/SelectMenu.js +145 -0
- package/lib-esm/__tests__/SelectPanel.d.ts +1 -0
- package/lib-esm/__tests__/SelectPanel.js +67 -0
- package/lib-esm/__tests__/SideNav.d.ts +1 -0
- package/lib-esm/__tests__/SideNav.js +63 -0
- package/lib-esm/__tests__/Spinner.d.ts +1 -0
- package/lib-esm/__tests__/Spinner.js +45 -0
- package/lib-esm/__tests__/StateLabel.d.ts +1 -0
- package/lib-esm/__tests__/StateLabel.js +63 -0
- package/lib-esm/__tests__/StyledOcticon.d.ts +1 -0
- package/lib-esm/__tests__/StyledOcticon.js +31 -0
- package/lib-esm/__tests__/SubNav.d.ts +1 -0
- package/lib-esm/__tests__/SubNav.js +52 -0
- package/lib-esm/__tests__/SubNavLink.d.ts +1 -0
- package/lib-esm/__tests__/SubNavLink.js +41 -0
- package/lib-esm/__tests__/TabNav.d.ts +1 -0
- package/lib-esm/__tests__/TabNav.js +42 -0
- package/lib-esm/__tests__/Text.d.ts +1 -0
- package/lib-esm/__tests__/Text.js +95 -0
- package/lib-esm/__tests__/TextInput.d.ts +1 -0
- package/lib-esm/__tests__/TextInput.js +70 -0
- package/lib-esm/__tests__/ThemeProvider.d.ts +1 -0
- package/lib-esm/__tests__/ThemeProvider.js +408 -0
- package/lib-esm/__tests__/Timeline.d.ts +1 -0
- package/lib-esm/__tests__/Timeline.js +69 -0
- package/lib-esm/__tests__/Tooltip.d.ts +1 -0
- package/lib-esm/__tests__/Tooltip.js +61 -0
- package/lib-esm/__tests__/Truncate.d.ts +1 -0
- package/lib-esm/__tests__/Truncate.js +55 -0
- package/lib-esm/__tests__/UnderlineNav.d.ts +1 -0
- package/lib-esm/__tests__/UnderlineNav.js +62 -0
- package/lib-esm/__tests__/UnderlineNavLink.d.ts +1 -0
- package/lib-esm/__tests__/UnderlineNavLink.js +43 -0
- package/lib-esm/__tests__/behaviors/anchoredPosition.d.ts +1 -0
- package/lib-esm/__tests__/behaviors/anchoredPosition.js +388 -0
- package/lib-esm/__tests__/behaviors/focusTrap.d.ts +1 -0
- package/lib-esm/__tests__/behaviors/focusTrap.js +227 -0
- package/lib-esm/__tests__/behaviors/focusZone.d.ts +1 -0
- package/lib-esm/__tests__/behaviors/focusZone.js +487 -0
- package/lib-esm/__tests__/behaviors/iterateFocusableElements.d.ts +1 -0
- package/lib-esm/__tests__/behaviors/iterateFocusableElements.js +48 -0
- package/lib-esm/__tests__/filterObject.d.ts +1 -0
- package/lib-esm/__tests__/filterObject.js +27 -0
- package/lib-esm/__tests__/hooks/useAnchoredPosition.d.ts +1 -0
- package/lib-esm/__tests__/hooks/useAnchoredPosition.js +46 -0
- package/lib-esm/__tests__/hooks/useOnEscapePress.d.ts +1 -0
- package/lib-esm/__tests__/hooks/useOnEscapePress.js +23 -0
- package/lib-esm/__tests__/hooks/useOnOutsideClick.d.ts +1 -0
- package/lib-esm/__tests__/hooks/useOnOutsideClick.js +68 -0
- package/lib-esm/__tests__/hooks/useOpenAndCloseFocus.d.ts +1 -0
- package/lib-esm/__tests__/hooks/useOpenAndCloseFocus.js +52 -0
- package/lib-esm/__tests__/hooks/useProvidedStateOrCreate.d.ts +1 -0
- package/lib-esm/__tests__/hooks/useProvidedStateOrCreate.js +36 -0
- package/lib-esm/__tests__/theme.d.ts +1 -0
- package/lib-esm/__tests__/theme.js +33 -0
- package/lib-esm/__tests__/themeGet.d.ts +1 -0
- package/lib-esm/__tests__/themeGet.js +22 -0
- package/lib-esm/__tests__/useSafeTimeout.d.ts +1 -0
- package/lib-esm/__tests__/useSafeTimeout.js +39 -0
- package/lib-esm/stories/ActionList.stories.js +334 -0
- package/lib-esm/stories/ActionMenu.stories.js +293 -0
- package/lib-esm/stories/AnchoredOverlay.stories.js +101 -0
- package/lib-esm/stories/AvatarStack.stories.js +32 -0
- package/lib-esm/stories/Button.stories.js +78 -0
- package/lib-esm/stories/ConfirmationDialog.stories.js +86 -0
- package/lib-esm/stories/Dialog.stories.js +240 -0
- package/lib-esm/stories/DropdownMenu.stories.js +94 -0
- package/lib-esm/stories/Overlay.stories.js +154 -0
- package/lib-esm/stories/Portal.stories.js +68 -0
- package/lib-esm/stories/SelectPanel.stories.js +284 -0
- package/lib-esm/stories/ThemeProvider.stories.js +83 -0
- package/lib-esm/stories/useAnchoredPosition.stories.js +313 -0
- package/lib-esm/stories/useFocusTrap.stories.js +309 -0
- package/lib-esm/stories/useFocusZone.stories.js +554 -0
- package/lib-esm/theme-preval.d.ts +12 -6
- package/lib-esm/theme-preval.js +2930 -1738
- package/lib-esm/utils/testing.d.ts +4707 -2355
- package/migrating.md +250 -0
- package/now.json +17 -0
- package/package-lock.json +28661 -0
- package/package.json +4 -3
- package/rollup.config.js +36 -0
- package/script/build +19 -0
- package/script/setup +12 -0
- package/src/ActionList/Divider.tsx +25 -0
- package/src/ActionList/Group.tsx +45 -0
- package/src/ActionList/Header.tsx +74 -0
- package/src/ActionList/Item.tsx +460 -0
- package/src/ActionList/List.tsx +253 -0
- package/src/ActionList/index.ts +21 -0
- package/src/ActionMenu.tsx +106 -0
- package/src/AnchoredOverlay/AnchoredOverlay.tsx +180 -0
- package/src/AnchoredOverlay/index.ts +2 -0
- package/src/Avatar.tsx +46 -0
- package/src/AvatarPair.tsx +35 -0
- package/src/AvatarStack.tsx +161 -0
- package/src/BaseStyles.tsx +53 -0
- package/src/BorderBox.tsx +18 -0
- package/src/Box.tsx +54 -0
- package/src/BranchName.tsx +19 -0
- package/src/Breadcrumb.tsx +87 -0
- package/src/Button/Button.tsx +40 -0
- package/src/Button/ButtonBase.tsx +43 -0
- package/src/Button/ButtonClose.tsx +40 -0
- package/src/Button/ButtonDanger.tsx +43 -0
- package/src/Button/ButtonGroup.tsx +55 -0
- package/src/Button/ButtonInvisible.tsx +27 -0
- package/src/Button/ButtonOutline.tsx +43 -0
- package/src/Button/ButtonPrimary.tsx +41 -0
- package/src/Button/ButtonStyles.tsx +36 -0
- package/src/Button/ButtonTableList.tsx +58 -0
- package/src/Button/index.ts +16 -0
- package/src/Caret.tsx +133 -0
- package/src/CircleBadge.tsx +55 -0
- package/src/CircleOcticon.tsx +37 -0
- package/src/CounterLabel.tsx +52 -0
- package/src/Details.tsx +23 -0
- package/src/Dialog/ConfirmationDialog.tsx +184 -0
- package/src/Dialog/Dialog.tsx +419 -0
- package/src/Dialog.tsx +149 -0
- package/src/Dropdown.tsx +158 -0
- package/src/DropdownMenu/DropdownButton.tsx +15 -0
- package/src/DropdownMenu/DropdownMenu.tsx +115 -0
- package/src/DropdownMenu/index.ts +4 -0
- package/src/DropdownStyles.ts +128 -0
- package/src/FilterList.tsx +81 -0
- package/src/FilteredActionList/FilteredActionList.tsx +152 -0
- package/src/FilteredActionList/index.ts +2 -0
- package/src/FilteredSearch.tsx +28 -0
- package/src/Flash.tsx +77 -0
- package/src/Flex.tsx +15 -0
- package/src/FormGroup.tsx +27 -0
- package/src/Grid.tsx +15 -0
- package/src/Header.tsx +84 -0
- package/src/Heading.tsx +21 -0
- package/src/Label.tsx +75 -0
- package/src/LabelGroup.tsx +18 -0
- package/src/Link.tsx +46 -0
- package/src/Overlay.tsx +194 -0
- package/src/Pagehead.tsx +17 -0
- package/src/Pagination/Pagination.tsx +214 -0
- package/src/Pagination/index.ts +4 -0
- package/src/Pagination/model.tsx +187 -0
- package/src/PointerBox.tsx +31 -0
- package/src/Popover.tsx +236 -0
- package/src/Portal/Portal.tsx +96 -0
- package/src/Portal/index.ts +5 -0
- package/src/Position.tsx +63 -0
- package/src/ProgressBar.tsx +52 -0
- package/src/SelectMenu/SelectMenu.tsx +125 -0
- package/src/SelectMenu/SelectMenuContext.tsx +9 -0
- package/src/SelectMenu/SelectMenuDivider.tsx +25 -0
- package/src/SelectMenu/SelectMenuFilter.tsx +51 -0
- package/src/SelectMenu/SelectMenuFooter.tsx +28 -0
- package/src/SelectMenu/SelectMenuHeader.tsx +50 -0
- package/src/SelectMenu/SelectMenuItem.tsx +137 -0
- package/src/SelectMenu/SelectMenuList.tsx +42 -0
- package/src/SelectMenu/SelectMenuLoadingAnimation.tsx +24 -0
- package/src/SelectMenu/SelectMenuModal.tsx +121 -0
- package/src/SelectMenu/SelectMenuTab.tsx +88 -0
- package/src/SelectMenu/SelectMenuTabPanel.tsx +30 -0
- package/src/SelectMenu/SelectMenuTabs.tsx +44 -0
- package/src/SelectMenu/hooks/useKeyboardNav.js +90 -0
- package/src/SelectMenu/index.ts +15 -0
- package/src/SelectPanel/SelectPanel.tsx +173 -0
- package/src/SelectPanel/index.ts +2 -0
- package/src/SideNav.tsx +193 -0
- package/src/Spinner.tsx +59 -0
- package/src/StateLabel.tsx +110 -0
- package/src/StyledOcticon.tsx +24 -0
- package/src/SubNav.tsx +129 -0
- package/src/TabNav.tsx +77 -0
- package/src/Text.tsx +13 -0
- package/src/TextInput.tsx +183 -0
- package/src/ThemeProvider.tsx +176 -0
- package/src/Timeline.tsx +141 -0
- package/src/Tooltip.tsx +263 -0
- package/src/Truncate.tsx +36 -0
- package/src/UnderlineNav.tsx +110 -0
- package/src/__tests__/.eslintrc.json +11 -0
- package/src/__tests__/ActionList.tsx +49 -0
- package/src/__tests__/ActionMenu.tsx +138 -0
- package/src/__tests__/AnchoredOverlay.tsx +151 -0
- package/src/__tests__/Avatar.tsx +45 -0
- package/src/__tests__/AvatarStack.tsx +45 -0
- package/src/__tests__/BorderBox.tsx +44 -0
- package/src/__tests__/Box.tsx +43 -0
- package/src/__tests__/BranchName.tsx +27 -0
- package/src/__tests__/Breadcrumb.tsx +31 -0
- package/src/__tests__/BreadcrumbItem.tsx +32 -0
- package/src/__tests__/Button.tsx +129 -0
- package/src/__tests__/Caret.tsx +36 -0
- package/src/__tests__/CircleBadge.tsx +69 -0
- package/src/__tests__/CircleOcticon.tsx +52 -0
- package/src/__tests__/CounterLabel.tsx +51 -0
- package/src/__tests__/Details.tsx +116 -0
- package/src/__tests__/Dialog.tsx +157 -0
- package/src/__tests__/Dropdown.tsx +57 -0
- package/src/__tests__/DropdownMenu.tsx +138 -0
- package/src/__tests__/FilterList.tsx +27 -0
- package/src/__tests__/FilterListItem.tsx +32 -0
- package/src/__tests__/FilteredSearch.tsx +27 -0
- package/src/__tests__/Flash.tsx +46 -0
- package/src/__tests__/Flex.tsx +59 -0
- package/src/__tests__/FormGroup.tsx +39 -0
- package/src/__tests__/Grid.tsx +83 -0
- package/src/__tests__/Header.tsx +50 -0
- package/src/__tests__/Heading.tsx +92 -0
- package/src/__tests__/Label.tsx +35 -0
- package/src/__tests__/LabelGroup.tsx +31 -0
- package/src/__tests__/Link.tsx +48 -0
- package/src/__tests__/Overlay.tsx +103 -0
- package/src/__tests__/Pagehead.tsx +24 -0
- package/src/__tests__/Pagination/Pagination.tsx +31 -0
- package/src/__tests__/Pagination/PaginationModel.tsx +133 -0
- package/src/__tests__/Pagination/__snapshots__/Pagination.tsx.snap +184 -0
- package/src/__tests__/PointerBox.tsx +35 -0
- package/src/__tests__/Popover.tsx +69 -0
- package/src/__tests__/Portal.tsx +103 -0
- package/src/__tests__/Position.tsx +118 -0
- package/src/__tests__/ProgressBar.tsx +41 -0
- package/src/__tests__/SelectMenu.tsx +142 -0
- package/src/__tests__/SelectPanel.tsx +65 -0
- package/src/__tests__/SideNav.tsx +63 -0
- package/src/__tests__/Spinner.tsx +44 -0
- package/src/__tests__/StateLabel.tsx +50 -0
- package/src/__tests__/StyledOcticon.tsx +28 -0
- package/src/__tests__/SubNav.tsx +51 -0
- package/src/__tests__/SubNavLink.tsx +32 -0
- package/src/__tests__/TabNav.tsx +33 -0
- package/src/__tests__/Text.tsx +79 -0
- package/src/__tests__/TextInput.tsx +50 -0
- package/src/__tests__/ThemeProvider.tsx +441 -0
- package/src/__tests__/Timeline.tsx +59 -0
- package/src/__tests__/Tooltip.tsx +53 -0
- package/src/__tests__/Truncate.tsx +45 -0
- package/src/__tests__/UnderlineNav.tsx +59 -0
- package/src/__tests__/UnderlineNavLink.tsx +32 -0
- package/src/__tests__/__snapshots__/ActionList.tsx.snap +27 -0
- package/src/__tests__/__snapshots__/ActionMenu.tsx.snap +80 -0
- package/src/__tests__/__snapshots__/AnchoredOverlay.tsx.snap +332 -0
- package/src/__tests__/__snapshots__/Avatar.tsx.snap +19 -0
- package/src/__tests__/__snapshots__/AvatarStack.tsx.snap +377 -0
- package/src/__tests__/__snapshots__/BorderBox.tsx.snap +14 -0
- package/src/__tests__/__snapshots__/Box.tsx.snap +201 -0
- package/src/__tests__/__snapshots__/BranchName.tsx.snap +17 -0
- package/src/__tests__/__snapshots__/Breadcrumb.tsx.snap +29 -0
- package/src/__tests__/__snapshots__/BreadcrumbItem.tsx.snap +79 -0
- package/src/__tests__/__snapshots__/Button.tsx.snap +832 -0
- package/src/__tests__/__snapshots__/Caret.tsx.snap +373 -0
- package/src/__tests__/__snapshots__/CircleBadge.tsx.snap +141 -0
- package/src/__tests__/__snapshots__/CircleOcticon.tsx.snap +64 -0
- package/src/__tests__/__snapshots__/CounterLabel.tsx.snap +22 -0
- package/src/__tests__/__snapshots__/Details.tsx.snap +15 -0
- package/src/__tests__/__snapshots__/Dialog.tsx.snap +200 -0
- package/src/__tests__/__snapshots__/Dropdown.tsx.snap +249 -0
- package/src/__tests__/__snapshots__/DropdownMenu.tsx.snap +106 -0
- package/src/__tests__/__snapshots__/FilterList.tsx.snap +13 -0
- package/src/__tests__/__snapshots__/FilterListItem.tsx.snap +80 -0
- package/src/__tests__/__snapshots__/FilteredSearch.tsx.snap +32 -0
- package/src/__tests__/__snapshots__/Flash.tsx.snap +32 -0
- package/src/__tests__/__snapshots__/Flex.tsx.snap +130 -0
- package/src/__tests__/__snapshots__/FormGroup.tsx.snap +25 -0
- package/src/__tests__/__snapshots__/Grid.tsx.snap +178 -0
- package/src/__tests__/__snapshots__/Header.tsx.snap +79 -0
- package/src/__tests__/__snapshots__/Heading.tsx.snap +13 -0
- package/src/__tests__/__snapshots__/Label.tsx.snap +74 -0
- package/src/__tests__/__snapshots__/LabelGroup.tsx.snap +15 -0
- package/src/__tests__/__snapshots__/Link.tsx.snap +213 -0
- package/src/__tests__/__snapshots__/Pagehead.tsx.snap +15 -0
- package/src/__tests__/__snapshots__/PointerBox.tsx.snap +174 -0
- package/src/__tests__/__snapshots__/Popover.tsx.snap +4687 -0
- package/src/__tests__/__snapshots__/Position.tsx.snap +44 -0
- package/src/__tests__/__snapshots__/ProgressBar.tsx.snap +53 -0
- package/src/__tests__/__snapshots__/SelectMenu.tsx.snap +469 -0
- package/src/__tests__/__snapshots__/SelectPanel.tsx.snap +123 -0
- package/src/__tests__/__snapshots__/SideNav.tsx.snap +143 -0
- package/src/__tests__/__snapshots__/Spinner.tsx.snap +33 -0
- package/src/__tests__/__snapshots__/StateLabel.tsx.snap +409 -0
- package/src/__tests__/__snapshots__/StyledOcticon.tsx.snap +25 -0
- package/src/__tests__/__snapshots__/SubNav.tsx.snap +44 -0
- package/src/__tests__/__snapshots__/SubNavLink.tsx.snap +199 -0
- package/src/__tests__/__snapshots__/TabNav.tsx.snap +58 -0
- package/src/__tests__/__snapshots__/Text.tsx.snap +7 -0
- package/src/__tests__/__snapshots__/TextInput.tsx.snap +440 -0
- package/src/__tests__/__snapshots__/ThemeProvider.tsx.snap +15 -0
- package/src/__tests__/__snapshots__/Timeline.tsx.snap +159 -0
- package/src/__tests__/__snapshots__/Tooltip.tsx.snap +227 -0
- package/src/__tests__/__snapshots__/Truncate.tsx.snap +17 -0
- package/src/__tests__/__snapshots__/UnderlineNav.tsx.snap +59 -0
- package/src/__tests__/__snapshots__/UnderlineNavLink.tsx.snap +130 -0
- package/src/__tests__/behaviors/anchoredPosition.ts +295 -0
- package/src/__tests__/behaviors/focusTrap.tsx +236 -0
- package/src/__tests__/behaviors/focusZone.tsx +549 -0
- package/src/__tests__/behaviors/iterateFocusableElements.tsx +61 -0
- package/src/__tests__/filterObject.ts +54 -0
- package/src/__tests__/hooks/useAnchoredPosition.tsx +31 -0
- package/src/__tests__/hooks/useOnEscapePress.tsx +16 -0
- package/src/__tests__/hooks/useOnOutsideClick.tsx +48 -0
- package/src/__tests__/hooks/useOpenAndCloseFocus.tsx +48 -0
- package/src/__tests__/hooks/useProvidedStateOrCreate.tsx +39 -0
- package/src/__tests__/theme.ts +41 -0
- package/src/__tests__/themeGet.ts +15 -0
- package/src/__tests__/useSafeTimeout.tsx +36 -0
- package/src/behaviors/anchoredPosition.ts +442 -0
- package/src/behaviors/focusTrap.ts +184 -0
- package/src/behaviors/focusZone.ts +713 -0
- package/src/constants.ts +62 -0
- package/src/hooks/index.ts +11 -0
- package/src/hooks/useAnchoredPosition.ts +53 -0
- package/src/hooks/useCombinedRefs.ts +40 -0
- package/src/hooks/useDetails.tsx +54 -0
- package/src/hooks/useDialog.ts +121 -0
- package/src/hooks/useFocusTrap.ts +80 -0
- package/src/hooks/useFocusZone.ts +64 -0
- package/src/hooks/useOnEscapePress.ts +63 -0
- package/src/hooks/useOnOutsideClick.tsx +82 -0
- package/src/hooks/useOpenAndCloseFocus.ts +27 -0
- package/src/hooks/useOverlay.tsx +32 -0
- package/src/hooks/useProvidedRefOrCreate.ts +14 -0
- package/src/hooks/useProvidedStateOrCreate.ts +27 -0
- package/src/hooks/useRenderForcingRef.ts +22 -0
- package/src/hooks/useResizeObserver.ts +11 -0
- package/src/hooks/useSafeTimeout.ts +38 -0
- package/src/hooks/useScrollFlash.ts +21 -0
- package/src/index.ts +165 -0
- package/src/polyfills/eventListenerSignal.ts +66 -0
- package/src/stories/ActionList.stories.tsx +364 -0
- package/src/stories/ActionMenu.stories.tsx +322 -0
- package/src/stories/AnchoredOverlay.stories.tsx +117 -0
- package/src/stories/AvatarStack.stories.tsx +37 -0
- package/src/stories/Button.stories.tsx +88 -0
- package/src/stories/ConfirmationDialog.stories.tsx +105 -0
- package/src/stories/Dialog.stories.tsx +240 -0
- package/src/stories/DropdownMenu.stories.tsx +84 -0
- package/src/stories/Overlay.stories.tsx +186 -0
- package/src/stories/Portal.stories.tsx +109 -0
- package/src/stories/SelectPanel.stories.tsx +300 -0
- package/src/stories/ThemeProvider.stories.tsx +104 -0
- package/src/stories/useAnchoredPosition.stories.tsx +320 -0
- package/src/stories/useFocusTrap.stories.tsx +400 -0
- package/src/stories/useFocusZone.stories.tsx +663 -0
- package/src/sx.ts +9 -0
- package/src/theme-preval.js +136 -0
- package/src/theme.ts +3 -0
- package/src/utils/deprecate.tsx +73 -0
- package/src/utils/isNumeric.tsx +4 -0
- package/src/utils/iterateFocusableElements.ts +121 -0
- package/src/utils/ssr.tsx +1 -0
- package/src/utils/test-deprecations.tsx +19 -0
- package/src/utils/test-helpers.tsx +7 -0
- package/src/utils/test-matchers.tsx +109 -0
- package/src/utils/testing.tsx +243 -0
- package/src/utils/theme.js +64 -0
- package/src/utils/types.ts +90 -0
- package/src/utils/uniqueId.ts +6 -0
- package/src/utils/userAgent.ts +7 -0
- package/stats.html +3279 -0
- package/tsconfig.build.json +7 -0
- package/tsconfig.json +20 -0
@@ -0,0 +1,8 @@
|
|
1
|
+
# Changesets
|
2
|
+
|
3
|
+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
4
|
+
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
5
|
+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
|
6
|
+
|
7
|
+
We have a quick list of common questions to get you started engaging with this project in
|
8
|
+
[our documentation](https://github.com/changesets/changesets/blob/master/docs/common-questions.md)
|
@@ -0,0 +1,10 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@1.4.0/schema.json",
|
3
|
+
"changelog": ["@changesets/changelog-github", {"repo": "primer/react"}],
|
4
|
+
"commit": false,
|
5
|
+
"linked": [],
|
6
|
+
"access": "public",
|
7
|
+
"baseBranch": "main",
|
8
|
+
"updateInternalDependencies": "patch",
|
9
|
+
"ignore": []
|
10
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
{
|
2
|
+
"name": "Primer Components",
|
3
|
+
"image": "mcr.microsoft.com/vscode/devcontainers/typescript-node:14",
|
4
|
+
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"],
|
5
|
+
"forwardPorts": [8000],
|
6
|
+
"postCreateCommand": ["/bin/bash", "-c", "pushd docs && npm install && popd && npm install"],
|
7
|
+
"remoteUser": "node"
|
8
|
+
}
|
package/.eslintrc.json
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
{
|
2
|
+
"parser": "@typescript-eslint/parser",
|
3
|
+
"parserOptions": {
|
4
|
+
"ecmaFeatures": {
|
5
|
+
"jsx": true
|
6
|
+
}
|
7
|
+
},
|
8
|
+
"extends": [
|
9
|
+
"plugin:react/recommended",
|
10
|
+
"plugin:jsx-a11y/recommended",
|
11
|
+
"plugin:react-hooks/recommended",
|
12
|
+
"plugin:prettier/recommended",
|
13
|
+
"plugin:github/recommended",
|
14
|
+
"plugin:github/browser",
|
15
|
+
"plugin:primer-react/recommended"
|
16
|
+
],
|
17
|
+
"ignorePatterns": [
|
18
|
+
"node_modules",
|
19
|
+
".cache",
|
20
|
+
"coverage/**/*",
|
21
|
+
"docs/public/**/*",
|
22
|
+
"dist/**/*",
|
23
|
+
"lib/**/*",
|
24
|
+
"lib-*/**/*",
|
25
|
+
"types/**/*"
|
26
|
+
],
|
27
|
+
"globals": {
|
28
|
+
"__DEV__": "readonly"
|
29
|
+
},
|
30
|
+
"env": {
|
31
|
+
"browser": true,
|
32
|
+
"commonjs": true,
|
33
|
+
"es6": true,
|
34
|
+
"jest": true,
|
35
|
+
"node": true
|
36
|
+
},
|
37
|
+
"settings": {
|
38
|
+
"react": {
|
39
|
+
"version": "detect"
|
40
|
+
}
|
41
|
+
},
|
42
|
+
// rules which apply to JS, TS, etc.
|
43
|
+
"rules": {
|
44
|
+
"react/prop-types": 0,
|
45
|
+
"react/display-name": 0,
|
46
|
+
"react-hooks/exhaustive-deps": "error",
|
47
|
+
"jsx-a11y/label-has-for": [
|
48
|
+
2,
|
49
|
+
{
|
50
|
+
"components": []
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"camelcase": [
|
54
|
+
"error",
|
55
|
+
{
|
56
|
+
"allow": [
|
57
|
+
"dark_dimmed"
|
58
|
+
]
|
59
|
+
}
|
60
|
+
]
|
61
|
+
},
|
62
|
+
"overrides": [
|
63
|
+
// rules which apply only to JS
|
64
|
+
{
|
65
|
+
"files": [
|
66
|
+
"**/*.js",
|
67
|
+
"**/*.jsx"
|
68
|
+
],
|
69
|
+
"rules": {
|
70
|
+
"eslint-comments/no-use": 0,
|
71
|
+
"import/no-namespace": 0,
|
72
|
+
"no-shadow": 0,
|
73
|
+
"no-unused-vars": [
|
74
|
+
"error",
|
75
|
+
{
|
76
|
+
"ignoreRestSiblings": true
|
77
|
+
}
|
78
|
+
]
|
79
|
+
}
|
80
|
+
},
|
81
|
+
// rules which apply only to TS
|
82
|
+
{
|
83
|
+
"parserOptions": {
|
84
|
+
"project": "tsconfig.json"
|
85
|
+
},
|
86
|
+
"files": [
|
87
|
+
"**/*.ts",
|
88
|
+
"**/*.tsx"
|
89
|
+
],
|
90
|
+
"extends": [
|
91
|
+
"plugin:@typescript-eslint/recommended"
|
92
|
+
],
|
93
|
+
"rules": {
|
94
|
+
"@typescript-eslint/no-explicit-any": 2,
|
95
|
+
"@typescript-eslint/no-unnecessary-condition": 2,
|
96
|
+
"@typescript-eslint/explicit-module-boundary-types": 0,
|
97
|
+
"@typescript-eslint/no-unused-vars": [
|
98
|
+
"error",
|
99
|
+
{
|
100
|
+
"argsIgnorePattern": "^_"
|
101
|
+
}
|
102
|
+
]
|
103
|
+
}
|
104
|
+
}
|
105
|
+
]
|
106
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve Primer React Components
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
**Describe the bug**
|
8
|
+
A clear and concise description of what the bug is.
|
9
|
+
|
10
|
+
**Note:** As this is a public repo, please be careful not to include details or screenshots from unreleased GitHub products or features. In most cases, a good bug report should be able to describe the new component without including business logic or feature details, but if you must discuss context relating to an unreleased feature, please open an issue in the private [Design Systems repo](https://github.com/github/design-systems/issues/new/choose) and link to it here.
|
11
|
+
|
12
|
+
|
13
|
+
**To Reproduce**
|
14
|
+
Steps to reproduce the behavior:
|
15
|
+
1. Go to '...'
|
16
|
+
2. Click on '....'
|
17
|
+
3. Scroll down to '....'
|
18
|
+
4. See error
|
19
|
+
|
20
|
+
**Expected behavior**
|
21
|
+
A clear and concise description of what you expected to happen.
|
22
|
+
|
23
|
+
**Screenshots**
|
24
|
+
If applicable, add screenshots to help explain your problem.
|
25
|
+
|
26
|
+
**Desktop (please complete the following information):**
|
27
|
+
- OS: [e.g. iOS]
|
28
|
+
- Browser [e.g. chrome, safari]
|
29
|
+
- Version [e.g. 22]
|
30
|
+
|
31
|
+
**Smartphone (please complete the following information):**
|
32
|
+
- Device: [e.g. iPhone6]
|
33
|
+
- OS: [e.g. iOS8.1]
|
34
|
+
- Browser [e.g. stock browser, safari]
|
35
|
+
- Version [e.g. 22]
|
36
|
+
|
37
|
+
**Additional context**
|
38
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
name: Component Proposal
|
3
|
+
about: Propose a new component
|
4
|
+
---
|
5
|
+
|
6
|
+
## Description
|
7
|
+
|
8
|
+
Please describe the proposed component as thoroughly as possible - including Figma links for design, screenshots, historical context, any required functionality, optional/nice to have functionality, proposed component API design, etc. The more detail the better!
|
9
|
+
|
10
|
+
**Note:** As this is a public repo, please be careful not to include details about GitHub products or features that have not been released. In most cases, a good component proposal should be able to describe the new component without including business logic or feature details, but if you must discuss context relating to an unreleased feature, please open an issue in the private [Design Systems repo](https://github.com/github/design-systems/issues/new/choose) and link to it here.
|
11
|
+
|
12
|
+
### Design
|
13
|
+
|
14
|
+
- [ ] Design is finalized. Link to mockups/prototypes:
|
15
|
+
- [ ] Design is being finalized by feature team. Link to any in progress mockups:
|
16
|
+
- [ ] Assistance requested in finalizing design
|
17
|
+
|
18
|
+
### Component API
|
19
|
+
|
20
|
+
Optional: If you have an idea of the intended component structure, please describe here. This can include what props will be available, if there will be any nested components or subcomponents, how this component might interact with other components, any behavior Hooks that will need to be built, etc.
|
21
|
+
|
22
|
+
### Usage
|
23
|
+
|
24
|
+
Describe how the component should be used, and/or link to usage guidelines.
|
25
|
+
|
26
|
+
## Implementation
|
27
|
+
|
28
|
+
Please describe how you would like this component to be built. Design systems is happy to help with the implementation of new components (as time/roadmap allows) but also recognizes that sometimes feature teams prefer to implement components themselves.
|
29
|
+
|
30
|
+
- [ ] Feature team would like to implement this component
|
31
|
+
- [ ] Feature team would like the Design Systems team to implement this component
|
32
|
+
- [ ] This component is already built, feature team requests assistance moving it to Primer React Components from outside application
|
33
|
+
- [ ] Other: (please describe below)
|
34
|
+
|
35
|
+
## Timeline
|
36
|
+
|
37
|
+
Please describe any deadlines or context around prioritization that would be helpful for us to use when building our roadmap.
|
38
|
+
|
39
|
+
#### What to expect next
|
40
|
+
|
41
|
+
A Design Systems engineer will read through your component proposal and get in touch! We'll gather any additional information needed and set up a Zoom call only if necessary. Once we have all relevant information, we'll add the component to our [Primer React Components Roadmap](https://github.com/primer/react/projects/3). If you opt to build the component yourself, we are happy to help with pairing, brainstorming, etc. Generally, component work requested from internal feature teams receives higher priority over general (non-requested) improvements to the library.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: 'npm'
|
9
|
+
directory: '/'
|
10
|
+
schedule:
|
11
|
+
interval: 'daily'
|
12
|
+
|
13
|
+
- package-ecosystem: 'npm'
|
14
|
+
directory: '/docs'
|
15
|
+
schedule:
|
16
|
+
interval: 'daily'
|
17
|
+
allow:
|
18
|
+
- dependency-name: '@primer/gatsby-theme-doctocat'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Describe your changes here.
|
2
|
+
|
3
|
+
Closes # (type the issue number after # if applicable; otherwise remove this line)
|
4
|
+
|
5
|
+
### Screenshots
|
6
|
+
|
7
|
+
Please provide before/after screenshots for any visual changes
|
8
|
+
|
9
|
+
### Merge checklist
|
10
|
+
|
11
|
+
- [ ] Added/updated tests
|
12
|
+
- [ ] Added/updated documentation
|
13
|
+
- [ ] Tested in Chrome
|
14
|
+
- [ ] Tested in Firefox
|
15
|
+
- [ ] Tested in Safari
|
16
|
+
- [ ] Tested in Edge
|
17
|
+
|
18
|
+
Take a look at the [What we look for in reviews](https://github.com/primer/react/blob/main/contributor-docs/CONTRIBUTING.md#what-we-look-for-in-reviews) section of the contributing guidelines for more information on how we review PRs.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
name: CI
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
pull_request:
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
ci:
|
10
|
+
name: CI
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- name: Checkout repository
|
14
|
+
uses: actions/checkout@v2
|
15
|
+
|
16
|
+
- name: Set up Node.js
|
17
|
+
uses: actions/setup-node@v2
|
18
|
+
with:
|
19
|
+
node-version: 14
|
20
|
+
|
21
|
+
- name: Install dependencies
|
22
|
+
run: npm ci
|
23
|
+
|
24
|
+
- name: Lint
|
25
|
+
run: npm run lint
|
26
|
+
|
27
|
+
- name: Build
|
28
|
+
run: npm run build
|
29
|
+
|
30
|
+
- name: Test
|
31
|
+
run: npm run test
|
@@ -0,0 +1,47 @@
|
|
1
|
+
name: Deploy
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches-ignore:
|
5
|
+
- 'main'
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
deploy-preview:
|
9
|
+
if: ${{ github.repository == 'primer/react' }}
|
10
|
+
name: Preview
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
|
15
|
+
- name: Create GitHub deployment
|
16
|
+
uses: chrnorm/deployment-action@v1.2.0
|
17
|
+
id: deployment
|
18
|
+
with:
|
19
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
20
|
+
environment: Preview
|
21
|
+
|
22
|
+
- name: Deploy with Vercel
|
23
|
+
uses: amondnet/vercel-action@v20
|
24
|
+
id: vercel-action
|
25
|
+
with:
|
26
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
27
|
+
vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }}
|
28
|
+
github-comment: false
|
29
|
+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }}
|
30
|
+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
31
|
+
|
32
|
+
- name: Update deployment status (success)
|
33
|
+
if: success()
|
34
|
+
uses: chrnorm/deployment-status@v1.0.0
|
35
|
+
with:
|
36
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
37
|
+
environment_url: ${{ steps.vercel-action.outputs.preview-url }}
|
38
|
+
state: 'success'
|
39
|
+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
|
40
|
+
|
41
|
+
- name: Update deployment status (failure)
|
42
|
+
if: failure()
|
43
|
+
uses: chrnorm/deployment-status@v1.0.0
|
44
|
+
with:
|
45
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
46
|
+
state: 'failure'
|
47
|
+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
name: Deploy
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- 'main'
|
6
|
+
jobs:
|
7
|
+
guard:
|
8
|
+
name: Guard
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
outputs:
|
11
|
+
# To avoid deploying documentation for unrelease changes, we check the number of changeset files.
|
12
|
+
# If it's 0, we deploy.
|
13
|
+
should_deploy: ${{ steps.changeset-count.outputs.change_count == 0 }}
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v2
|
16
|
+
|
17
|
+
- id: changeset-count
|
18
|
+
run: echo "::set-output name=change_count::$(ls .changeset/*.md | grep -v README | wc -l | xargs)"
|
19
|
+
|
20
|
+
# Log changeset count for debugging purposes
|
21
|
+
- name: Log changeset count
|
22
|
+
run: echo ${{ steps.changeset-count.outputs.change_count }}
|
23
|
+
|
24
|
+
deploy:
|
25
|
+
name: Production
|
26
|
+
needs: [guard]
|
27
|
+
#if: ${{ needs.guard.outputs.should_deploy == true }}
|
28
|
+
runs-on: ubuntu-latest
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v2
|
31
|
+
|
32
|
+
# Log guard output for debugging purposes
|
33
|
+
- name: Log guard output
|
34
|
+
run: echo ${{ needs.guard.outputs.should_deploy }}
|
35
|
+
|
36
|
+
- name: Create GitHub deployment
|
37
|
+
uses: chrnorm/deployment-action@v1.2.0
|
38
|
+
id: deployment
|
39
|
+
with:
|
40
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
41
|
+
environment: Production
|
42
|
+
|
43
|
+
- name: Deploy with Vercel
|
44
|
+
if: ${{ steps.changeset-count.outputs.CHANGE_COUNT == 0 }}
|
45
|
+
uses: amondnet/vercel-action@v20
|
46
|
+
id: vercel-action
|
47
|
+
with:
|
48
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
49
|
+
vercel-token: ${{ secrets.VERCEL_TOKEN_SHARED }}
|
50
|
+
vercel-args: '--prod'
|
51
|
+
github-comment: false
|
52
|
+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID_SHARED }}
|
53
|
+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
|
54
|
+
|
55
|
+
- name: Update deployment status (success)
|
56
|
+
if: success()
|
57
|
+
uses: chrnorm/deployment-status@v1.0.0
|
58
|
+
with:
|
59
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
60
|
+
environment_url: ${{ steps.vercel-action.outputs.preview-url }}
|
61
|
+
state: 'success'
|
62
|
+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
|
63
|
+
|
64
|
+
- name: Update deployment status (failure)
|
65
|
+
if: failure()
|
66
|
+
uses: chrnorm/deployment-status@v1.0.0
|
67
|
+
with:
|
68
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
69
|
+
state: 'failure'
|
70
|
+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: Release
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- main
|
6
|
+
jobs:
|
7
|
+
release:
|
8
|
+
name: Release
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- name: Checkout repository
|
12
|
+
uses: actions/checkout@v2
|
13
|
+
with:
|
14
|
+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
15
|
+
fetch-depth: 0
|
16
|
+
persist-credentials: false
|
17
|
+
|
18
|
+
- name: Set up Node.js
|
19
|
+
uses: actions/setup-node@v2
|
20
|
+
with:
|
21
|
+
node-version: 14
|
22
|
+
|
23
|
+
- name: Install dependencies
|
24
|
+
run: npm ci
|
25
|
+
|
26
|
+
- name: Create release pull request or publish to npm
|
27
|
+
id: changesets
|
28
|
+
uses: changesets/action@master
|
29
|
+
with:
|
30
|
+
title: Release Tracking
|
31
|
+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
|
32
|
+
publish: npm run release
|
33
|
+
env:
|
34
|
+
GITHUB_TOKEN: ${{ secrets.GPR_AUTH_TOKEN_SHARED }}
|
35
|
+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
name: Release
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches-ignore:
|
5
|
+
- 'main'
|
6
|
+
- 'changeset-release/main'
|
7
|
+
# To avoid unnecessary noise, we don't create canary releases when these paths change:
|
8
|
+
paths-ignore:
|
9
|
+
- '.changeset/**'
|
10
|
+
- '.devcontainer/**'
|
11
|
+
- '.github/**'
|
12
|
+
- '.storybook/**'
|
13
|
+
- '.vscode/**'
|
14
|
+
- 'docs/**'
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
release-canary:
|
18
|
+
name: Canary
|
19
|
+
if: ${{ github.repository == 'primer/react' }}
|
20
|
+
|
21
|
+
runs-on: ubuntu-latest
|
22
|
+
steps:
|
23
|
+
- name: Checkout repository
|
24
|
+
uses: actions/checkout@v2
|
25
|
+
with:
|
26
|
+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
27
|
+
fetch-depth: 0
|
28
|
+
|
29
|
+
- name: Set up Node.js
|
30
|
+
uses: actions/setup-node@v2
|
31
|
+
with:
|
32
|
+
node-version: 14.x
|
33
|
+
|
34
|
+
- name: Install dependencies
|
35
|
+
run: npm ci
|
36
|
+
|
37
|
+
- name: Build
|
38
|
+
run: npm run build
|
39
|
+
|
40
|
+
- name: Create .npmrc
|
41
|
+
run: |
|
42
|
+
cat << EOF > "$HOME/.npmrc"
|
43
|
+
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
44
|
+
EOF
|
45
|
+
env:
|
46
|
+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
|
47
|
+
|
48
|
+
- name: Publish canary version
|
49
|
+
run: |
|
50
|
+
echo "$( jq '.version = "0.0.0"' package.json )" > package.json
|
51
|
+
echo -e "---\n'@primer/components': patch\n---\n\nFake entry to force publishing" > .changeset/force-snapshot-release.md
|
52
|
+
yarn changeset version --snapshot
|
53
|
+
yarn changeset publish --tag canary
|
54
|
+
env:
|
55
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
56
|
+
|
57
|
+
- name: Output canary version number
|
58
|
+
uses: actions/github-script@v4.0.2
|
59
|
+
with:
|
60
|
+
script: |
|
61
|
+
const package = require(`${process.env.GITHUB_WORKSPACE}/package.json`)
|
62
|
+
github.repos.createCommitStatus({
|
63
|
+
owner: context.repo.owner,
|
64
|
+
repo: context.repo.repo,
|
65
|
+
sha: context.sha,
|
66
|
+
state: 'success',
|
67
|
+
context: `Published ${package.name}`,
|
68
|
+
description: package.version,
|
69
|
+
target_url: `https://unpkg.com/${package.name}@${package.version}/`
|
70
|
+
})
|
@@ -0,0 +1,60 @@
|
|
1
|
+
name: Release
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- 'changeset-release/main'
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
release-candidate:
|
9
|
+
name: Candidate
|
10
|
+
if: ${{ github.repository == 'primer/react' }}
|
11
|
+
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- name: Checkout repository
|
15
|
+
uses: actions/checkout@v2
|
16
|
+
with:
|
17
|
+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
|
18
|
+
fetch-depth: 0
|
19
|
+
|
20
|
+
- name: Set up Node.js
|
21
|
+
uses: actions/setup-node@v2
|
22
|
+
with:
|
23
|
+
node-version: 14.x
|
24
|
+
|
25
|
+
- name: Install dependencies
|
26
|
+
run: npm ci
|
27
|
+
|
28
|
+
- name: Build
|
29
|
+
run: npm run build
|
30
|
+
|
31
|
+
- name: Create .npmrc
|
32
|
+
run: |
|
33
|
+
cat << EOF > "$HOME/.npmrc"
|
34
|
+
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
35
|
+
EOF
|
36
|
+
env:
|
37
|
+
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN_SHARED }}
|
38
|
+
|
39
|
+
- name: Publish release candidate
|
40
|
+
run: |
|
41
|
+
version=$(jq -r .version package.json)
|
42
|
+
echo "$( jq ".version = \"$(echo $version)-rc.$(git rev-parse --short HEAD)\"" package.json )" > package.json
|
43
|
+
yarn publish --tag next
|
44
|
+
env:
|
45
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
46
|
+
|
47
|
+
- name: Output release candidate version number
|
48
|
+
uses: actions/github-script@v4.0.2
|
49
|
+
with:
|
50
|
+
script: |
|
51
|
+
const package = require(`${process.env.GITHUB_WORKSPACE}/package.json`)
|
52
|
+
github.repos.createCommitStatus({
|
53
|
+
owner: context.repo.owner,
|
54
|
+
repo: context.repo.repo,
|
55
|
+
sha: context.sha,
|
56
|
+
state: 'success',
|
57
|
+
context: `Published ${package.name}`,
|
58
|
+
description: package.version,
|
59
|
+
target_url: `https://unpkg.com/${package.name}@${package.version}/`
|
60
|
+
})
|
@@ -0,0 +1,26 @@
|
|
1
|
+
name: Stale
|
2
|
+
on:
|
3
|
+
schedule:
|
4
|
+
- cron: '0 * * * *'
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
stale:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
steps:
|
10
|
+
- uses: actions/stale@v4
|
11
|
+
with:
|
12
|
+
|
13
|
+
# General settings
|
14
|
+
days-before-stale: 60
|
15
|
+
days-before-close: 7
|
16
|
+
enable-statistics: true
|
17
|
+
operations-per-run: 100
|
18
|
+
remove-stale-when-updated: true
|
19
|
+
|
20
|
+
# PR specific settings
|
21
|
+
delete-branch: true
|
22
|
+
stale-pr-message: "Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days."
|
23
|
+
|
24
|
+
# Issue specific settings
|
25
|
+
days-before-issue-stale: 180
|
26
|
+
stale-issue-message: "Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days."
|
package/.gitignore
ADDED
package/.npmrc
ADDED
package/.nvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
v14
|