@primer/components 31.0.2-rc.1e80de40 → 31.1.0
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 +8 -2
- package/dist/browser.esm.js +11 -10
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +31 -30
- package/dist/browser.umd.js.map +1 -1
- package/lib/TextInputWithTokens.d.ts +4 -0
- package/lib/TextInputWithTokens.js +86 -20
- package/lib/_TextInputWrapper.js +1 -1
- package/lib-esm/TextInputWithTokens.d.ts +4 -0
- package/lib-esm/TextInputWithTokens.js +85 -21
- package/lib-esm/_TextInputWrapper.js +1 -1
- package/package.json +1 -1
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -10
- package/.devcontainer/devcontainer.json +0 -8
- package/.eslintrc.json +0 -137
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- package/.github/ISSUE_TEMPLATE/new_component_proposal_template.md +0 -41
- package/.github/dependabot.yml +0 -18
- package/.github/pull_request_template.md +0 -18
- package/.github/workflows/check_for_changeset.yml +0 -25
- package/.github/workflows/ci.yml +0 -31
- package/.github/workflows/deploy_preview.yml +0 -47
- package/.github/workflows/deploy_production.yml +0 -70
- package/.github/workflows/release.yml +0 -35
- package/.github/workflows/release_canary.yml +0 -70
- package/.github/workflows/release_candidate.yml +0 -60
- package/.github/workflows/size.yml +0 -13
- package/.github/workflows/stale.yml +0 -26
- package/.gitignore +0 -10
- package/.npmrc +0 -4
- package/.nvmrc +0 -1
- package/.storybook/main.js +0 -11
- package/.storybook/preview.js +0 -113
- package/.vscode/launch.json +0 -21
- package/.vscode/settings.json +0 -13
- package/@types/@styled-system/index.d.ts +0 -0
- package/@types/@styled-system/prop-types/index.d.ts +0 -1
- package/@types/@styled-system/props/index.d.ts +0 -1
- package/@types/jest-styled-components/index.d.ts +0 -1
- package/CODEOWNERS +0 -2
- package/babel-defines.js +0 -13
- package/babel.config.js +0 -39
- package/contributor-docs/CODE_OF_CONDUCT.md +0 -76
- package/contributor-docs/CONTRIBUTING.md +0 -274
- package/contributor-docs/adrs/adr-001-typescript.md +0 -23
- package/contributor-docs/adrs/adr-002-behavior-isolation.md +0 -108
- package/contributor-docs/adrs/adr-003-prop-norms.md +0 -72
- package/contributor-docs/behaviors.md +0 -132
- package/contributor-docs/component-contents-api-patterns.md +0 -316
- package/contributor-docs/principles.md +0 -39
- package/docs/.eslintrc +0 -0
- package/docs/.gitignore +0 -91
- package/docs/components/PropsList.js +0 -5
- package/docs/components/State.js +0 -9
- package/docs/components/constants.js +0 -34
- package/docs/components/index.js +0 -2
- package/docs/content/ActionList.mdx +0 -99
- package/docs/content/ActionMenu.mdx +0 -80
- package/docs/content/AnchoredOverlay.mdx +0 -37
- package/docs/content/Autocomplete.mdx +0 -657
- package/docs/content/Avatar.mdx +0 -33
- package/docs/content/AvatarStack.mdx +0 -37
- package/docs/content/BorderBox.md +0 -46
- package/docs/content/Box.md +0 -74
- package/docs/content/BranchName.md +0 -18
- package/docs/content/Breadcrumbs.md +0 -52
- package/docs/content/Buttons.md +0 -56
- package/docs/content/CircleBadge.md +0 -45
- package/docs/content/CircleOcticon.md +0 -18
- package/docs/content/CounterLabel.md +0 -32
- package/docs/content/Details.md +0 -105
- package/docs/content/Dialog.md +0 -108
- package/docs/content/Dialog2.mdx +0 -179
- package/docs/content/Dropdown.md +0 -72
- package/docs/content/DropdownMenu.mdx +0 -49
- package/docs/content/FilterList.md +0 -44
- package/docs/content/FilteredSearch.md +0 -39
- package/docs/content/Flash.md +0 -44
- package/docs/content/Flex.md +0 -58
- package/docs/content/FormGroup.md +0 -46
- package/docs/content/Grid.md +0 -59
- package/docs/content/Header.md +0 -79
- package/docs/content/Heading.md +0 -22
- package/docs/content/Label.md +0 -42
- package/docs/content/LabelGroup.md +0 -31
- package/docs/content/Link.md +0 -37
- package/docs/content/Overlay.mdx +0 -94
- package/docs/content/Pagehead.md +0 -27
- package/docs/content/Pagination.md +0 -187
- package/docs/content/PointerBox.md +0 -81
- package/docs/content/Popover.md +0 -137
- package/docs/content/Portal.mdx +0 -78
- package/docs/content/Position.md +0 -100
- package/docs/content/ProgressBar.mdx +0 -29
- package/docs/content/SelectMenu.md +0 -435
- package/docs/content/SelectPanel.mdx +0 -67
- package/docs/content/SideNav.md +0 -179
- package/docs/content/Spinner.mdx +0 -32
- package/docs/content/StateLabel.md +0 -35
- package/docs/content/StyledOcticon.md +0 -36
- package/docs/content/SubNav.md +0 -102
- package/docs/content/TabNav.md +0 -50
- package/docs/content/Text.md +0 -31
- package/docs/content/TextInput.md +0 -34
- package/docs/content/TextInputTokens.mdx +0 -89
- package/docs/content/TextInputWithTokens.mdx +0 -97
- package/docs/content/Timeline.md +0 -138
- package/docs/content/Token.mdx +0 -381
- package/docs/content/Tooltip.md +0 -41
- package/docs/content/Truncate.md +0 -64
- package/docs/content/UnderlineNav.md +0 -53
- package/docs/content/anchoredPosition.mdx +0 -163
- package/docs/content/core-concepts.md +0 -70
- package/docs/content/focusTrap.mdx +0 -103
- package/docs/content/focusZone.mdx +0 -145
- package/docs/content/getting-started.md +0 -138
- package/docs/content/index.md +0 -33
- package/docs/content/linting.md +0 -35
- package/docs/content/overriding-styles.mdx +0 -82
- package/docs/content/philosophy.md +0 -23
- package/docs/content/primer-theme.md +0 -89
- package/docs/content/ssr.mdx +0 -43
- package/docs/content/system-props.mdx +0 -37
- package/docs/content/theme-reference.md +0 -16
- package/docs/content/theming.md +0 -249
- package/docs/content/useOnEscapePress.mdx +0 -56
- package/docs/content/useOnOutsideClick.mdx +0 -57
- package/docs/content/useOpenAndCloseFocus.mdx +0 -49
- package/docs/content/useOverlay.mdx +0 -62
- package/docs/content/useSafeTimeout.mdx +0 -32
- package/docs/gatsby-config.js +0 -30
- package/docs/gatsby-node.js +0 -101
- package/docs/package-lock.json +0 -20756
- package/docs/package.json +0 -36
- package/docs/src/@primer/gatsby-theme-doctocat/components/hero.js +0 -23
- package/docs/src/@primer/gatsby-theme-doctocat/components/live-preview-wrapper.js +0 -41
- package/docs/src/@primer/gatsby-theme-doctocat/live-code-scope.js +0 -56
- package/docs/src/@primer/gatsby-theme-doctocat/nav.yml +0 -133
- package/docs/src/@primer/gatsby-theme-doctocat/primer-components-hero.svg +0 -1411
- package/docs/src/props.js +0 -77
- package/jest.config.js +0 -13
- package/lib/__tests__/ActionList.test.d.ts +0 -1
- package/lib/__tests__/ActionList.test.js +0 -69
- package/lib/__tests__/ActionList.types.test.d.ts +0 -6
- package/lib/__tests__/ActionList.types.test.js +0 -69
- package/lib/__tests__/ActionMenu.test.d.ts +0 -1
- package/lib/__tests__/ActionMenu.test.js +0 -151
- package/lib/__tests__/AnchoredOverlay.test.d.ts +0 -1
- package/lib/__tests__/AnchoredOverlay.test.js +0 -160
- package/lib/__tests__/Autocomplete.test.d.ts +0 -1
- package/lib/__tests__/Autocomplete.test.js +0 -528
- package/lib/__tests__/Avatar.test.d.ts +0 -1
- package/lib/__tests__/Avatar.test.js +0 -67
- package/lib/__tests__/AvatarStack.test.d.ts +0 -1
- package/lib/__tests__/AvatarStack.test.js +0 -71
- package/lib/__tests__/BorderBox.test.d.ts +0 -1
- package/lib/__tests__/BorderBox.test.js +0 -58
- package/lib/__tests__/Box.test.d.ts +0 -1
- package/lib/__tests__/Box.test.js +0 -78
- package/lib/__tests__/BranchName.test.d.ts +0 -1
- package/lib/__tests__/BranchName.test.js +0 -36
- package/lib/__tests__/Breadcrumbs.test.d.ts +0 -1
- package/lib/__tests__/Breadcrumbs.test.js +0 -37
- package/lib/__tests__/BreadcrumbsItem.test.d.ts +0 -1
- package/lib/__tests__/BreadcrumbsItem.test.js +0 -49
- package/lib/__tests__/Button.test.d.ts +0 -1
- package/lib/__tests__/Button.test.js +0 -143
- package/lib/__tests__/Caret.test.d.ts +0 -1
- package/lib/__tests__/Caret.test.js +0 -52
- package/lib/__tests__/CircleBadge.test.d.ts +0 -1
- package/lib/__tests__/CircleBadge.test.js +0 -83
- package/lib/__tests__/CircleOcticon.test.d.ts +0 -1
- package/lib/__tests__/CircleOcticon.test.js +0 -71
- package/lib/__tests__/ConfirmationDialog.test.d.ts +0 -1
- package/lib/__tests__/ConfirmationDialog.test.js +0 -134
- package/lib/__tests__/CounterLabel.test.d.ts +0 -1
- package/lib/__tests__/CounterLabel.test.js +0 -58
- package/lib/__tests__/Details.test.d.ts +0 -1
- package/lib/__tests__/Details.test.js +0 -117
- package/lib/__tests__/Dialog.test.d.ts +0 -1
- package/lib/__tests__/Dialog.test.js +0 -184
- package/lib/__tests__/Dropdown.test.d.ts +0 -1
- package/lib/__tests__/Dropdown.test.js +0 -63
- package/lib/__tests__/DropdownMenu.test.d.ts +0 -1
- package/lib/__tests__/DropdownMenu.test.js +0 -150
- package/lib/__tests__/FilterList.test.d.ts +0 -1
- package/lib/__tests__/FilterList.test.js +0 -36
- package/lib/__tests__/FilterListItem.test.d.ts +0 -1
- package/lib/__tests__/FilterListItem.test.js +0 -46
- package/lib/__tests__/FilteredSearch.test.d.ts +0 -1
- package/lib/__tests__/FilteredSearch.test.js +0 -36
- package/lib/__tests__/Flash.test.d.ts +0 -1
- package/lib/__tests__/Flash.test.js +0 -62
- package/lib/__tests__/Flex.test.d.ts +0 -1
- package/lib/__tests__/Flex.test.js +0 -74
- package/lib/__tests__/FormGroup.test.d.ts +0 -1
- package/lib/__tests__/FormGroup.test.js +0 -54
- package/lib/__tests__/Grid.test.d.ts +0 -1
- package/lib/__tests__/Grid.test.js +0 -104
- package/lib/__tests__/Header.test.d.ts +0 -1
- package/lib/__tests__/Header.test.js +0 -58
- package/lib/__tests__/Heading.test.d.ts +0 -1
- package/lib/__tests__/Heading.test.js +0 -109
- package/lib/__tests__/Label.test.d.ts +0 -1
- package/lib/__tests__/Label.test.js +0 -46
- package/lib/__tests__/LabelGroup.test.d.ts +0 -1
- package/lib/__tests__/LabelGroup.test.js +0 -38
- package/lib/__tests__/Link.test.d.ts +0 -1
- package/lib/__tests__/Link.test.js +0 -70
- package/lib/__tests__/Merge.types.test.d.ts +0 -30
- package/lib/__tests__/Merge.types.test.js +0 -27
- package/lib/__tests__/Overlay.test.d.ts +0 -1
- package/lib/__tests__/Overlay.test.js +0 -145
- package/lib/__tests__/Pagehead.test.d.ts +0 -1
- package/lib/__tests__/Pagehead.test.js +0 -37
- package/lib/__tests__/Pagination/Pagination.test.d.ts +0 -1
- package/lib/__tests__/Pagination/Pagination.test.js +0 -47
- package/lib/__tests__/Pagination/PaginationModel.test.d.ts +0 -1
- package/lib/__tests__/Pagination/PaginationModel.test.js +0 -186
- package/lib/__tests__/PointerBox.test.d.ts +0 -1
- package/lib/__tests__/PointerBox.test.js +0 -46
- package/lib/__tests__/Popover.test.d.ts +0 -1
- package/lib/__tests__/Popover.test.js +0 -66
- package/lib/__tests__/Portal.test.d.ts +0 -1
- package/lib/__tests__/Portal.test.js +0 -124
- package/lib/__tests__/Position.test.d.ts +0 -1
- package/lib/__tests__/Position.test.js +0 -143
- package/lib/__tests__/ProgressBar.test.d.ts +0 -1
- package/lib/__tests__/ProgressBar.test.js +0 -68
- package/lib/__tests__/SelectMenu.test.d.ts +0 -1
- package/lib/__tests__/SelectMenu.test.js +0 -155
- package/lib/__tests__/SelectPanel.test.d.ts +0 -1
- package/lib/__tests__/SelectPanel.test.js +0 -80
- package/lib/__tests__/SideNav.test.d.ts +0 -1
- package/lib/__tests__/SideNav.test.js +0 -71
- package/lib/__tests__/Spinner.test.d.ts +0 -1
- package/lib/__tests__/Spinner.test.js +0 -53
- package/lib/__tests__/StateLabel.test.d.ts +0 -1
- package/lib/__tests__/StateLabel.test.js +0 -71
- package/lib/__tests__/StyledOcticon.test.d.ts +0 -1
- package/lib/__tests__/StyledOcticon.test.js +0 -40
- package/lib/__tests__/SubNav.test.d.ts +0 -1
- package/lib/__tests__/SubNav.test.js +0 -62
- package/lib/__tests__/SubNavLink.test.d.ts +0 -1
- package/lib/__tests__/SubNavLink.test.js +0 -49
- package/lib/__tests__/TabNav.test.d.ts +0 -1
- package/lib/__tests__/TabNav.test.js +0 -49
- package/lib/__tests__/Text.test.d.ts +0 -1
- package/lib/__tests__/Text.test.js +0 -105
- package/lib/__tests__/TextInput.test.d.ts +0 -1
- package/lib/__tests__/TextInput.test.js +0 -78
- package/lib/__tests__/TextInputWithTokens.test.d.ts +0 -1
- package/lib/__tests__/TextInputWithTokens.test.js +0 -389
- package/lib/__tests__/ThemeProvider.test.d.ts +0 -1
- package/lib/__tests__/ThemeProvider.test.js +0 -444
- package/lib/__tests__/Timeline.test.d.ts +0 -1
- package/lib/__tests__/Timeline.test.js +0 -75
- package/lib/__tests__/Token.test.d.ts +0 -1
- package/lib/__tests__/Token.test.js +0 -180
- package/lib/__tests__/Tooltip.test.d.ts +0 -1
- package/lib/__tests__/Tooltip.test.js +0 -69
- package/lib/__tests__/Truncate.test.d.ts +0 -1
- package/lib/__tests__/Truncate.test.js +0 -63
- package/lib/__tests__/UnderlineNav.test.d.ts +0 -1
- package/lib/__tests__/UnderlineNav.test.js +0 -72
- package/lib/__tests__/UnderlineNavLink.test.d.ts +0 -1
- package/lib/__tests__/UnderlineNavLink.test.js +0 -51
- package/lib/__tests__/behaviors/anchoredPosition.test.d.ts +0 -1
- package/lib/__tests__/behaviors/anchoredPosition.test.js +0 -390
- package/lib/__tests__/behaviors/focusTrap.test.d.ts +0 -1
- package/lib/__tests__/behaviors/focusTrap.test.js +0 -234
- package/lib/__tests__/behaviors/focusZone.test.d.ts +0 -1
- package/lib/__tests__/behaviors/focusZone.test.js +0 -570
- package/lib/__tests__/behaviors/iterateFocusableElements.test.d.ts +0 -1
- package/lib/__tests__/behaviors/iterateFocusableElements.test.js +0 -55
- package/lib/__tests__/behaviors/scrollIntoViewingArea.test.d.ts +0 -1
- package/lib/__tests__/behaviors/scrollIntoViewingArea.test.js +0 -226
- package/lib/__tests__/filterObject.test.d.ts +0 -1
- package/lib/__tests__/filterObject.test.js +0 -30
- package/lib/__tests__/hooks/useAnchoredPosition.test.d.ts +0 -1
- package/lib/__tests__/hooks/useAnchoredPosition.test.js +0 -54
- package/lib/__tests__/hooks/useOnEscapePress.test.d.ts +0 -1
- package/lib/__tests__/hooks/useOnEscapePress.test.js +0 -32
- package/lib/__tests__/hooks/useOnOutsideClick.test.d.ts +0 -1
- package/lib/__tests__/hooks/useOnOutsideClick.test.js +0 -87
- package/lib/__tests__/hooks/useOpenAndCloseFocus.test.d.ts +0 -1
- package/lib/__tests__/hooks/useOpenAndCloseFocus.test.js +0 -60
- package/lib/__tests__/hooks/useProvidedStateOrCreate.test.d.ts +0 -1
- package/lib/__tests__/hooks/useProvidedStateOrCreate.test.js +0 -45
- package/lib/__tests__/theme.test.d.ts +0 -1
- package/lib/__tests__/theme.test.js +0 -36
- package/lib/__tests__/themeGet.test.d.ts +0 -1
- package/lib/__tests__/themeGet.test.js +0 -25
- package/lib/__tests__/useSafeTimeout.test.d.ts +0 -1
- package/lib/__tests__/useSafeTimeout.test.js +0 -45
- package/lib/stories/ActionList.stories.js +0 -454
- package/lib/stories/ActionMenu.stories.js +0 -350
- package/lib/stories/AnchoredOverlay.stories.js +0 -127
- package/lib/stories/Autocomplete.stories.js +0 -619
- package/lib/stories/AvatarStack.stories.js +0 -49
- package/lib/stories/Button.stories.js +0 -125
- package/lib/stories/ConfirmationDialog.stories.js +0 -111
- package/lib/stories/Dialog.stories.js +0 -265
- package/lib/stories/DropdownMenu.stories.js +0 -122
- package/lib/stories/IssueLabelToken.stories.js +0 -165
- package/lib/stories/Overlay.stories.js +0 -204
- package/lib/stories/Portal.stories.js +0 -104
- package/lib/stories/ProfileToken.stories.js +0 -162
- package/lib/stories/SelectPanel.stories.js +0 -399
- package/lib/stories/TextInputWithTokens.stories.js +0 -235
- package/lib/stories/ThemeProvider.stories.js +0 -102
- package/lib/stories/Token.stories.js +0 -159
- package/lib/stories/useAnchoredPosition.stories.js +0 -351
- package/lib/stories/useFocusTrap.stories.js +0 -356
- package/lib/stories/useFocusZone.stories.js +0 -599
- package/lib-esm/__tests__/ActionList.test.d.ts +0 -1
- package/lib-esm/__tests__/ActionList.test.js +0 -57
- package/lib-esm/__tests__/ActionList.types.test.d.ts +0 -6
- package/lib-esm/__tests__/ActionList.types.test.js +0 -45
- package/lib-esm/__tests__/ActionMenu.test.d.ts +0 -1
- package/lib-esm/__tests__/ActionMenu.test.js +0 -139
- package/lib-esm/__tests__/AnchoredOverlay.test.d.ts +0 -1
- package/lib-esm/__tests__/AnchoredOverlay.test.js +0 -134
- package/lib-esm/__tests__/Autocomplete.test.d.ts +0 -1
- package/lib-esm/__tests__/Autocomplete.test.js +0 -494
- package/lib-esm/__tests__/Avatar.test.d.ts +0 -1
- package/lib-esm/__tests__/Avatar.test.js +0 -56
- package/lib-esm/__tests__/AvatarStack.test.d.ts +0 -1
- package/lib-esm/__tests__/AvatarStack.test.js +0 -58
- package/lib-esm/__tests__/BorderBox.test.d.ts +0 -1
- package/lib-esm/__tests__/BorderBox.test.js +0 -47
- package/lib-esm/__tests__/Box.test.d.ts +0 -1
- package/lib-esm/__tests__/Box.test.js +0 -67
- package/lib-esm/__tests__/BranchName.test.d.ts +0 -1
- package/lib-esm/__tests__/BranchName.test.js +0 -26
- package/lib-esm/__tests__/Breadcrumbs.test.d.ts +0 -1
- package/lib-esm/__tests__/Breadcrumbs.test.js +0 -27
- package/lib-esm/__tests__/BreadcrumbsItem.test.d.ts +0 -1
- package/lib-esm/__tests__/BreadcrumbsItem.test.js +0 -39
- package/lib-esm/__tests__/Button.test.d.ts +0 -1
- package/lib-esm/__tests__/Button.test.js +0 -133
- package/lib-esm/__tests__/Caret.test.d.ts +0 -1
- package/lib-esm/__tests__/Caret.test.js +0 -42
- package/lib-esm/__tests__/CircleBadge.test.d.ts +0 -1
- package/lib-esm/__tests__/CircleBadge.test.js +0 -70
- package/lib-esm/__tests__/CircleOcticon.test.d.ts +0 -1
- package/lib-esm/__tests__/CircleOcticon.test.js +0 -59
- package/lib-esm/__tests__/ConfirmationDialog.test.d.ts +0 -1
- package/lib-esm/__tests__/ConfirmationDialog.test.js +0 -113
- package/lib-esm/__tests__/CounterLabel.test.d.ts +0 -1
- package/lib-esm/__tests__/CounterLabel.test.js +0 -47
- package/lib-esm/__tests__/Details.test.d.ts +0 -1
- package/lib-esm/__tests__/Details.test.js +0 -107
- package/lib-esm/__tests__/Dialog.test.d.ts +0 -1
- package/lib-esm/__tests__/Dialog.test.js +0 -171
- package/lib-esm/__tests__/Dropdown.test.d.ts +0 -1
- package/lib-esm/__tests__/Dropdown.test.js +0 -53
- package/lib-esm/__tests__/DropdownMenu.test.d.ts +0 -1
- package/lib-esm/__tests__/DropdownMenu.test.js +0 -137
- package/lib-esm/__tests__/FilterList.test.d.ts +0 -1
- package/lib-esm/__tests__/FilterList.test.js +0 -26
- package/lib-esm/__tests__/FilterListItem.test.d.ts +0 -1
- package/lib-esm/__tests__/FilterListItem.test.js +0 -36
- package/lib-esm/__tests__/FilteredSearch.test.d.ts +0 -1
- package/lib-esm/__tests__/FilteredSearch.test.js +0 -26
- package/lib-esm/__tests__/Flash.test.d.ts +0 -1
- package/lib-esm/__tests__/Flash.test.js +0 -51
- package/lib-esm/__tests__/Flex.test.d.ts +0 -1
- package/lib-esm/__tests__/Flex.test.js +0 -64
- package/lib-esm/__tests__/FormGroup.test.d.ts +0 -1
- package/lib-esm/__tests__/FormGroup.test.js +0 -44
- package/lib-esm/__tests__/Grid.test.d.ts +0 -1
- package/lib-esm/__tests__/Grid.test.js +0 -94
- package/lib-esm/__tests__/Header.test.d.ts +0 -1
- package/lib-esm/__tests__/Header.test.js +0 -48
- package/lib-esm/__tests__/Heading.test.d.ts +0 -1
- package/lib-esm/__tests__/Heading.test.js +0 -99
- package/lib-esm/__tests__/Label.test.d.ts +0 -1
- package/lib-esm/__tests__/Label.test.js +0 -36
- package/lib-esm/__tests__/LabelGroup.test.d.ts +0 -1
- package/lib-esm/__tests__/LabelGroup.test.js +0 -26
- package/lib-esm/__tests__/Link.test.d.ts +0 -1
- package/lib-esm/__tests__/Link.test.js +0 -60
- package/lib-esm/__tests__/Merge.types.test.d.ts +0 -30
- package/lib-esm/__tests__/Merge.types.test.js +0 -14
- package/lib-esm/__tests__/Overlay.test.d.ts +0 -1
- package/lib-esm/__tests__/Overlay.test.js +0 -123
- package/lib-esm/__tests__/Pagehead.test.d.ts +0 -1
- package/lib-esm/__tests__/Pagehead.test.js +0 -26
- package/lib-esm/__tests__/Pagination/Pagination.test.d.ts +0 -1
- package/lib-esm/__tests__/Pagination/Pagination.test.js +0 -35
- package/lib-esm/__tests__/Pagination/PaginationModel.test.d.ts +0 -1
- package/lib-esm/__tests__/Pagination/PaginationModel.test.js +0 -182
- package/lib-esm/__tests__/PointerBox.test.d.ts +0 -1
- package/lib-esm/__tests__/PointerBox.test.js +0 -36
- package/lib-esm/__tests__/Popover.test.d.ts +0 -1
- package/lib-esm/__tests__/Popover.test.js +0 -53
- package/lib-esm/__tests__/Portal.test.d.ts +0 -1
- package/lib-esm/__tests__/Portal.test.js +0 -104
- package/lib-esm/__tests__/Position.test.d.ts +0 -1
- package/lib-esm/__tests__/Position.test.js +0 -133
- package/lib-esm/__tests__/ProgressBar.test.d.ts +0 -1
- package/lib-esm/__tests__/ProgressBar.test.js +0 -58
- package/lib-esm/__tests__/SelectMenu.test.d.ts +0 -1
- package/lib-esm/__tests__/SelectMenu.test.js +0 -145
- package/lib-esm/__tests__/SelectPanel.test.d.ts +0 -1
- package/lib-esm/__tests__/SelectPanel.test.js +0 -65
- package/lib-esm/__tests__/SideNav.test.d.ts +0 -1
- package/lib-esm/__tests__/SideNav.test.js +0 -60
- package/lib-esm/__tests__/Spinner.test.d.ts +0 -1
- package/lib-esm/__tests__/Spinner.test.js +0 -43
- package/lib-esm/__tests__/StateLabel.test.d.ts +0 -1
- package/lib-esm/__tests__/StateLabel.test.js +0 -61
- package/lib-esm/__tests__/StyledOcticon.test.d.ts +0 -1
- package/lib-esm/__tests__/StyledOcticon.test.js +0 -29
- package/lib-esm/__tests__/SubNav.test.d.ts +0 -1
- package/lib-esm/__tests__/SubNav.test.js +0 -50
- package/lib-esm/__tests__/SubNavLink.test.d.ts +0 -1
- package/lib-esm/__tests__/SubNavLink.test.js +0 -39
- package/lib-esm/__tests__/TabNav.test.d.ts +0 -1
- package/lib-esm/__tests__/TabNav.test.js +0 -39
- package/lib-esm/__tests__/Text.test.d.ts +0 -1
- package/lib-esm/__tests__/Text.test.js +0 -93
- package/lib-esm/__tests__/TextInput.test.d.ts +0 -1
- package/lib-esm/__tests__/TextInput.test.js +0 -68
- package/lib-esm/__tests__/TextInputWithTokens.test.d.ts +0 -1
- package/lib-esm/__tests__/TextInputWithTokens.test.js +0 -341
- package/lib-esm/__tests__/ThemeProvider.test.d.ts +0 -1
- package/lib-esm/__tests__/ThemeProvider.test.js +0 -408
- package/lib-esm/__tests__/Timeline.test.d.ts +0 -1
- package/lib-esm/__tests__/Timeline.test.js +0 -65
- package/lib-esm/__tests__/Token.test.d.ts +0 -1
- package/lib-esm/__tests__/Token.test.js +0 -166
- package/lib-esm/__tests__/Tooltip.test.d.ts +0 -1
- package/lib-esm/__tests__/Tooltip.test.js +0 -59
- package/lib-esm/__tests__/Truncate.test.d.ts +0 -1
- package/lib-esm/__tests__/Truncate.test.js +0 -53
- package/lib-esm/__tests__/UnderlineNav.test.d.ts +0 -1
- package/lib-esm/__tests__/UnderlineNav.test.js +0 -60
- package/lib-esm/__tests__/UnderlineNavLink.test.d.ts +0 -1
- package/lib-esm/__tests__/UnderlineNavLink.test.js +0 -41
- package/lib-esm/__tests__/behaviors/anchoredPosition.test.d.ts +0 -1
- package/lib-esm/__tests__/behaviors/anchoredPosition.test.js +0 -388
- package/lib-esm/__tests__/behaviors/focusTrap.test.d.ts +0 -1
- package/lib-esm/__tests__/behaviors/focusTrap.test.js +0 -227
- package/lib-esm/__tests__/behaviors/focusZone.test.d.ts +0 -1
- package/lib-esm/__tests__/behaviors/focusZone.test.js +0 -487
- package/lib-esm/__tests__/behaviors/iterateFocusableElements.test.d.ts +0 -1
- package/lib-esm/__tests__/behaviors/iterateFocusableElements.test.js +0 -48
- package/lib-esm/__tests__/behaviors/scrollIntoViewingArea.test.d.ts +0 -1
- package/lib-esm/__tests__/behaviors/scrollIntoViewingArea.test.js +0 -224
- package/lib-esm/__tests__/filterObject.test.d.ts +0 -1
- package/lib-esm/__tests__/filterObject.test.js +0 -27
- package/lib-esm/__tests__/hooks/useAnchoredPosition.test.d.ts +0 -1
- package/lib-esm/__tests__/hooks/useAnchoredPosition.test.js +0 -46
- package/lib-esm/__tests__/hooks/useOnEscapePress.test.d.ts +0 -1
- package/lib-esm/__tests__/hooks/useOnEscapePress.test.js +0 -23
- package/lib-esm/__tests__/hooks/useOnOutsideClick.test.d.ts +0 -1
- package/lib-esm/__tests__/hooks/useOnOutsideClick.test.js +0 -68
- package/lib-esm/__tests__/hooks/useOpenAndCloseFocus.test.d.ts +0 -1
- package/lib-esm/__tests__/hooks/useOpenAndCloseFocus.test.js +0 -52
- package/lib-esm/__tests__/hooks/useProvidedStateOrCreate.test.d.ts +0 -1
- package/lib-esm/__tests__/hooks/useProvidedStateOrCreate.test.js +0 -36
- package/lib-esm/__tests__/theme.test.d.ts +0 -1
- package/lib-esm/__tests__/theme.test.js +0 -33
- package/lib-esm/__tests__/themeGet.test.d.ts +0 -1
- package/lib-esm/__tests__/themeGet.test.js +0 -22
- package/lib-esm/__tests__/useSafeTimeout.test.d.ts +0 -1
- package/lib-esm/__tests__/useSafeTimeout.test.js +0 -39
- package/lib-esm/stories/ActionList.stories.js +0 -395
- package/lib-esm/stories/ActionMenu.stories.js +0 -305
- package/lib-esm/stories/AnchoredOverlay.stories.js +0 -101
- package/lib-esm/stories/Autocomplete.stories.js +0 -560
- package/lib-esm/stories/AvatarStack.stories.js +0 -32
- package/lib-esm/stories/Button.stories.js +0 -86
- package/lib-esm/stories/ConfirmationDialog.stories.js +0 -86
- package/lib-esm/stories/Dialog.stories.js +0 -240
- package/lib-esm/stories/DropdownMenu.stories.js +0 -94
- package/lib-esm/stories/IssueLabelToken.stories.js +0 -139
- package/lib-esm/stories/Overlay.stories.js +0 -173
- package/lib-esm/stories/Portal.stories.js +0 -68
- package/lib-esm/stories/ProfileToken.stories.js +0 -136
- package/lib-esm/stories/SelectPanel.stories.js +0 -334
- package/lib-esm/stories/TextInputWithTokens.stories.js +0 -196
- package/lib-esm/stories/ThemeProvider.stories.js +0 -83
- package/lib-esm/stories/Token.stories.js +0 -133
- package/lib-esm/stories/useAnchoredPosition.stories.js +0 -313
- package/lib-esm/stories/useFocusTrap.stories.js +0 -309
- package/lib-esm/stories/useFocusZone.stories.js +0 -554
- package/migrating.md +0 -250
- package/now.json +0 -17
- package/package-lock.json +0 -28456
- package/rollup.config.js +0 -36
- package/script/build +0 -19
- package/script/build-storybook +0 -10
- package/script/setup +0 -12
- package/src/ActionList/Divider.tsx +0 -25
- package/src/ActionList/Group.tsx +0 -45
- package/src/ActionList/Header.tsx +0 -74
- package/src/ActionList/Item.tsx +0 -496
- package/src/ActionList/List.tsx +0 -258
- package/src/ActionList/index.ts +0 -21
- package/src/ActionMenu.tsx +0 -106
- package/src/AnchoredOverlay/AnchoredOverlay.tsx +0 -191
- package/src/AnchoredOverlay/index.ts +0 -2
- package/src/Autocomplete/Autocomplete.tsx +0 -103
- package/src/Autocomplete/AutocompleteContext.tsx +0 -19
- package/src/Autocomplete/AutocompleteInput.tsx +0 -179
- package/src/Autocomplete/AutocompleteMenu.tsx +0 -341
- package/src/Autocomplete/AutocompleteOverlay.tsx +0 -68
- package/src/Autocomplete/index.ts +0 -2
- package/src/Avatar.tsx +0 -46
- package/src/AvatarPair.tsx +0 -35
- package/src/AvatarStack.tsx +0 -159
- package/src/BaseStyles.tsx +0 -53
- package/src/BorderBox.tsx +0 -18
- package/src/Box.tsx +0 -54
- package/src/BranchName.tsx +0 -19
- package/src/Breadcrumbs.tsx +0 -101
- package/src/Button/Button.tsx +0 -40
- package/src/Button/ButtonBase.tsx +0 -43
- package/src/Button/ButtonClose.tsx +0 -40
- package/src/Button/ButtonDanger.tsx +0 -43
- package/src/Button/ButtonGroup.tsx +0 -55
- package/src/Button/ButtonInvisible.tsx +0 -32
- package/src/Button/ButtonOutline.tsx +0 -43
- package/src/Button/ButtonPrimary.tsx +0 -41
- package/src/Button/ButtonStyles.tsx +0 -36
- package/src/Button/ButtonTableList.tsx +0 -58
- package/src/Button/index.ts +0 -16
- package/src/Caret.tsx +0 -133
- package/src/CircleBadge.tsx +0 -55
- package/src/CircleOcticon.tsx +0 -37
- package/src/CounterLabel.tsx +0 -52
- package/src/Details.tsx +0 -23
- package/src/Dialog/ConfirmationDialog.tsx +0 -184
- package/src/Dialog/Dialog.tsx +0 -432
- package/src/Dialog.tsx +0 -149
- package/src/Dropdown.tsx +0 -158
- package/src/DropdownMenu/DropdownButton.tsx +0 -15
- package/src/DropdownMenu/DropdownMenu.tsx +0 -115
- package/src/DropdownMenu/index.ts +0 -4
- package/src/DropdownStyles.ts +0 -128
- package/src/FilterList.tsx +0 -81
- package/src/FilteredActionList/FilteredActionList.tsx +0 -142
- package/src/FilteredActionList/index.ts +0 -2
- package/src/FilteredSearch.tsx +0 -28
- package/src/Flash.tsx +0 -77
- package/src/Flex.tsx +0 -15
- package/src/FormGroup.tsx +0 -27
- package/src/Grid.tsx +0 -15
- package/src/Header.tsx +0 -84
- package/src/Heading.tsx +0 -21
- package/src/Label.tsx +0 -75
- package/src/LabelGroup.tsx +0 -18
- package/src/Link.tsx +0 -46
- package/src/Overlay.tsx +0 -197
- package/src/Pagehead.tsx +0 -17
- package/src/Pagination/Pagination.tsx +0 -214
- package/src/Pagination/index.ts +0 -4
- package/src/Pagination/model.tsx +0 -187
- package/src/PointerBox.tsx +0 -31
- package/src/Popover.tsx +0 -236
- package/src/Portal/Portal.tsx +0 -96
- package/src/Portal/index.ts +0 -5
- package/src/Position.tsx +0 -63
- package/src/ProgressBar.tsx +0 -52
- package/src/SelectMenu/SelectMenu.tsx +0 -125
- package/src/SelectMenu/SelectMenuContext.tsx +0 -9
- package/src/SelectMenu/SelectMenuDivider.tsx +0 -25
- package/src/SelectMenu/SelectMenuFilter.tsx +0 -51
- package/src/SelectMenu/SelectMenuFooter.tsx +0 -28
- package/src/SelectMenu/SelectMenuHeader.tsx +0 -50
- package/src/SelectMenu/SelectMenuItem.tsx +0 -137
- package/src/SelectMenu/SelectMenuList.tsx +0 -42
- package/src/SelectMenu/SelectMenuLoadingAnimation.tsx +0 -24
- package/src/SelectMenu/SelectMenuModal.tsx +0 -121
- package/src/SelectMenu/SelectMenuTab.tsx +0 -88
- package/src/SelectMenu/SelectMenuTabPanel.tsx +0 -30
- package/src/SelectMenu/SelectMenuTabs.tsx +0 -44
- package/src/SelectMenu/hooks/useKeyboardNav.js +0 -90
- package/src/SelectMenu/index.ts +0 -15
- package/src/SelectPanel/SelectPanel.tsx +0 -173
- package/src/SelectPanel/index.ts +0 -2
- package/src/SideNav.tsx +0 -193
- package/src/Spinner.tsx +0 -59
- package/src/StateLabel.tsx +0 -102
- package/src/StyledOcticon.tsx +0 -24
- package/src/SubNav.tsx +0 -129
- package/src/TabNav.tsx +0 -77
- package/src/Text.tsx +0 -13
- package/src/TextInput.tsx +0 -68
- package/src/TextInputWithTokens.tsx +0 -280
- package/src/ThemeProvider.tsx +0 -176
- package/src/Timeline.tsx +0 -141
- package/src/Token/AvatarToken.tsx +0 -54
- package/src/Token/IssueLabelToken.tsx +0 -150
- package/src/Token/Token.tsx +0 -126
- package/src/Token/TokenBase.tsx +0 -129
- package/src/Token/_RemoveTokenButton.tsx +0 -111
- package/src/Token/_TokenTextContainer.tsx +0 -47
- package/src/Token/index.ts +0 -3
- package/src/Tooltip.tsx +0 -263
- package/src/Truncate.tsx +0 -36
- package/src/UnderlineNav.tsx +0 -110
- package/src/_TextInputWrapper.tsx +0 -105
- package/src/_UnstyledTextInput.tsx +0 -19
- package/src/__tests__/.eslintrc.json +0 -11
- package/src/__tests__/ActionList.test.tsx +0 -53
- package/src/__tests__/ActionList.types.test.tsx +0 -51
- package/src/__tests__/ActionMenu.test.tsx +0 -136
- package/src/__tests__/AnchoredOverlay.test.tsx +0 -150
- package/src/__tests__/Autocomplete.test.tsx +0 -444
- package/src/__tests__/Avatar.test.tsx +0 -44
- package/src/__tests__/AvatarStack.test.tsx +0 -48
- package/src/__tests__/BorderBox.test.tsx +0 -43
- package/src/__tests__/Box.test.tsx +0 -42
- package/src/__tests__/BranchName.test.tsx +0 -26
- package/src/__tests__/Breadcrumbs.test.tsx +0 -27
- package/src/__tests__/BreadcrumbsItem.test.tsx +0 -31
- package/src/__tests__/Button.test.tsx +0 -128
- package/src/__tests__/Caret.test.tsx +0 -36
- package/src/__tests__/CircleBadge.test.tsx +0 -66
- package/src/__tests__/CircleOcticon.test.tsx +0 -50
- package/src/__tests__/ConfirmationDialog.test.tsx +0 -120
- package/src/__tests__/CounterLabel.test.tsx +0 -50
- package/src/__tests__/Details.test.tsx +0 -115
- package/src/__tests__/Dialog.test.tsx +0 -155
- package/src/__tests__/Dropdown.test.tsx +0 -53
- package/src/__tests__/DropdownMenu.test.tsx +0 -136
- package/src/__tests__/FilterList.test.tsx +0 -26
- package/src/__tests__/FilterListItem.test.tsx +0 -31
- package/src/__tests__/FilteredSearch.test.tsx +0 -26
- package/src/__tests__/Flash.test.tsx +0 -45
- package/src/__tests__/Flex.test.tsx +0 -58
- package/src/__tests__/FormGroup.test.tsx +0 -38
- package/src/__tests__/Grid.test.tsx +0 -82
- package/src/__tests__/Header.test.tsx +0 -49
- package/src/__tests__/Heading.test.tsx +0 -91
- package/src/__tests__/Label.test.tsx +0 -34
- package/src/__tests__/LabelGroup.test.tsx +0 -30
- package/src/__tests__/Link.test.tsx +0 -47
- package/src/__tests__/Merge.types.test.ts +0 -39
- package/src/__tests__/Overlay.test.tsx +0 -103
- package/src/__tests__/Pagehead.test.tsx +0 -23
- package/src/__tests__/Pagination/Pagination.test.tsx +0 -30
- package/src/__tests__/Pagination/PaginationModel.test.tsx +0 -133
- package/src/__tests__/Pagination/__snapshots__/Pagination.test.tsx.snap +0 -184
- package/src/__tests__/PointerBox.test.tsx +0 -34
- package/src/__tests__/Popover.test.tsx +0 -68
- package/src/__tests__/Portal.test.tsx +0 -103
- package/src/__tests__/Position.test.tsx +0 -117
- package/src/__tests__/ProgressBar.test.tsx +0 -40
- package/src/__tests__/SelectMenu.test.tsx +0 -142
- package/src/__tests__/SelectPanel.test.tsx +0 -63
- package/src/__tests__/SideNav.test.tsx +0 -62
- package/src/__tests__/Spinner.test.tsx +0 -42
- package/src/__tests__/StateLabel.test.tsx +0 -48
- package/src/__tests__/StyledOcticon.test.tsx +0 -26
- package/src/__tests__/SubNav.test.tsx +0 -50
- package/src/__tests__/SubNavLink.test.tsx +0 -31
- package/src/__tests__/TabNav.test.tsx +0 -32
- package/src/__tests__/Text.test.tsx +0 -78
- package/src/__tests__/TextInput.test.tsx +0 -49
- package/src/__tests__/TextInputWithTokens.test.tsx +0 -262
- package/src/__tests__/ThemeProvider.test.tsx +0 -441
- package/src/__tests__/Timeline.test.tsx +0 -58
- package/src/__tests__/Token.test.tsx +0 -118
- package/src/__tests__/Tooltip.test.tsx +0 -52
- package/src/__tests__/Truncate.test.tsx +0 -43
- package/src/__tests__/UnderlineNav.test.tsx +0 -58
- package/src/__tests__/UnderlineNavLink.test.tsx +0 -31
- package/src/__tests__/__snapshots__/ActionList.test.tsx.snap +0 -223
- package/src/__tests__/__snapshots__/ActionMenu.test.tsx.snap +0 -80
- package/src/__tests__/__snapshots__/AnchoredOverlay.test.tsx.snap +0 -332
- package/src/__tests__/__snapshots__/Autocomplete.test.tsx.snap +0 -3414
- package/src/__tests__/__snapshots__/Avatar.test.tsx.snap +0 -19
- package/src/__tests__/__snapshots__/AvatarStack.test.tsx.snap +0 -377
- package/src/__tests__/__snapshots__/BorderBox.test.tsx.snap +0 -14
- package/src/__tests__/__snapshots__/Box.test.tsx.snap +0 -201
- package/src/__tests__/__snapshots__/BranchName.test.tsx.snap +0 -17
- package/src/__tests__/__snapshots__/Breadcrumbs.test.tsx.snap +0 -29
- package/src/__tests__/__snapshots__/BreadcrumbsItem.test.tsx.snap +0 -79
- package/src/__tests__/__snapshots__/Button.test.tsx.snap +0 -840
- package/src/__tests__/__snapshots__/Caret.test.tsx.snap +0 -373
- package/src/__tests__/__snapshots__/CircleBadge.test.tsx.snap +0 -141
- package/src/__tests__/__snapshots__/CircleOcticon.test.tsx.snap +0 -64
- package/src/__tests__/__snapshots__/ConfirmationDialog.test.tsx.snap +0 -89
- package/src/__tests__/__snapshots__/CounterLabel.test.tsx.snap +0 -22
- package/src/__tests__/__snapshots__/Details.test.tsx.snap +0 -15
- package/src/__tests__/__snapshots__/Dialog.test.tsx.snap +0 -200
- package/src/__tests__/__snapshots__/Dropdown.test.tsx.snap +0 -249
- package/src/__tests__/__snapshots__/DropdownMenu.test.tsx.snap +0 -106
- package/src/__tests__/__snapshots__/FilterList.test.tsx.snap +0 -13
- package/src/__tests__/__snapshots__/FilterListItem.test.tsx.snap +0 -80
- package/src/__tests__/__snapshots__/FilteredSearch.test.tsx.snap +0 -32
- package/src/__tests__/__snapshots__/Flash.test.tsx.snap +0 -32
- package/src/__tests__/__snapshots__/Flex.test.tsx.snap +0 -130
- package/src/__tests__/__snapshots__/FormGroup.test.tsx.snap +0 -25
- package/src/__tests__/__snapshots__/Grid.test.tsx.snap +0 -178
- package/src/__tests__/__snapshots__/Header.test.tsx.snap +0 -79
- package/src/__tests__/__snapshots__/Heading.test.tsx.snap +0 -13
- package/src/__tests__/__snapshots__/Label.test.tsx.snap +0 -74
- package/src/__tests__/__snapshots__/LabelGroup.test.tsx.snap +0 -15
- package/src/__tests__/__snapshots__/Link.test.tsx.snap +0 -213
- package/src/__tests__/__snapshots__/Pagehead.test.tsx.snap +0 -15
- package/src/__tests__/__snapshots__/PointerBox.test.tsx.snap +0 -174
- package/src/__tests__/__snapshots__/Popover.test.tsx.snap +0 -4687
- package/src/__tests__/__snapshots__/Position.test.tsx.snap +0 -44
- package/src/__tests__/__snapshots__/ProgressBar.test.tsx.snap +0 -53
- package/src/__tests__/__snapshots__/SelectMenu.test.tsx.snap +0 -469
- package/src/__tests__/__snapshots__/SelectPanel.test.tsx.snap +0 -123
- package/src/__tests__/__snapshots__/SideNav.test.tsx.snap +0 -143
- package/src/__tests__/__snapshots__/Spinner.test.tsx.snap +0 -33
- package/src/__tests__/__snapshots__/StateLabel.test.tsx.snap +0 -388
- package/src/__tests__/__snapshots__/StyledOcticon.test.tsx.snap +0 -25
- package/src/__tests__/__snapshots__/SubNav.test.tsx.snap +0 -44
- package/src/__tests__/__snapshots__/SubNavLink.test.tsx.snap +0 -199
- package/src/__tests__/__snapshots__/TabNav.test.tsx.snap +0 -58
- package/src/__tests__/__snapshots__/Text.test.tsx.snap +0 -7
- package/src/__tests__/__snapshots__/TextInput.test.tsx.snap +0 -440
- package/src/__tests__/__snapshots__/TextInputWithTokens.test.tsx.snap +0 -5516
- package/src/__tests__/__snapshots__/ThemeProvider.test.tsx.snap +0 -15
- package/src/__tests__/__snapshots__/Timeline.test.tsx.snap +0 -159
- package/src/__tests__/__snapshots__/Token.test.tsx.snap +0 -3794
- package/src/__tests__/__snapshots__/Tooltip.test.tsx.snap +0 -227
- package/src/__tests__/__snapshots__/Truncate.test.tsx.snap +0 -17
- package/src/__tests__/__snapshots__/UnderlineNav.test.tsx.snap +0 -59
- package/src/__tests__/__snapshots__/UnderlineNavLink.test.tsx.snap +0 -130
- package/src/__tests__/behaviors/anchoredPosition.test.ts +0 -295
- package/src/__tests__/behaviors/focusTrap.test.tsx +0 -236
- package/src/__tests__/behaviors/focusZone.test.tsx +0 -549
- package/src/__tests__/behaviors/iterateFocusableElements.test.tsx +0 -61
- package/src/__tests__/behaviors/scrollIntoViewingArea.test.ts +0 -195
- package/src/__tests__/filterObject.test.ts +0 -54
- package/src/__tests__/hooks/useAnchoredPosition.test.tsx +0 -31
- package/src/__tests__/hooks/useOnEscapePress.test.tsx +0 -16
- package/src/__tests__/hooks/useOnOutsideClick.test.tsx +0 -48
- package/src/__tests__/hooks/useOpenAndCloseFocus.test.tsx +0 -48
- package/src/__tests__/hooks/useProvidedStateOrCreate.test.tsx +0 -39
- package/src/__tests__/theme.test.ts +0 -41
- package/src/__tests__/themeGet.test.ts +0 -15
- package/src/__tests__/useSafeTimeout.test.tsx +0 -36
- package/src/behaviors/anchoredPosition.ts +0 -442
- package/src/behaviors/focusTrap.ts +0 -184
- package/src/behaviors/focusZone.ts +0 -713
- package/src/behaviors/scrollIntoViewingArea.ts +0 -27
- package/src/constants.ts +0 -62
- package/src/hooks/index.ts +0 -11
- package/src/hooks/useAnchoredPosition.ts +0 -53
- package/src/hooks/useCombinedRefs.ts +0 -40
- package/src/hooks/useDetails.tsx +0 -54
- package/src/hooks/useDialog.ts +0 -121
- package/src/hooks/useFocusTrap.ts +0 -80
- package/src/hooks/useFocusZone.ts +0 -64
- package/src/hooks/useOnEscapePress.ts +0 -63
- package/src/hooks/useOnOutsideClick.tsx +0 -82
- package/src/hooks/useOpenAndCloseFocus.ts +0 -32
- package/src/hooks/useOverlay.tsx +0 -34
- package/src/hooks/useProvidedRefOrCreate.ts +0 -14
- package/src/hooks/useProvidedStateOrCreate.ts +0 -27
- package/src/hooks/useRenderForcingRef.ts +0 -22
- package/src/hooks/useResizeObserver.ts +0 -11
- package/src/hooks/useSafeTimeout.ts +0 -38
- package/src/hooks/useScrollFlash.ts +0 -21
- package/src/index.ts +0 -170
- package/src/polyfills/eventListenerSignal.ts +0 -66
- package/src/stories/ActionList.stories.tsx +0 -436
- package/src/stories/ActionMenu.stories.tsx +0 -334
- package/src/stories/AnchoredOverlay.stories.tsx +0 -117
- package/src/stories/Autocomplete.stories.tsx +0 -655
- package/src/stories/AvatarStack.stories.tsx +0 -37
- package/src/stories/Button.stories.tsx +0 -92
- package/src/stories/ConfirmationDialog.stories.tsx +0 -105
- package/src/stories/Dialog.stories.tsx +0 -240
- package/src/stories/DropdownMenu.stories.tsx +0 -84
- package/src/stories/IssueLabelToken.stories.tsx +0 -138
- package/src/stories/Overlay.stories.tsx +0 -213
- package/src/stories/Portal.stories.tsx +0 -109
- package/src/stories/ProfileToken.stories.tsx +0 -129
- package/src/stories/SelectPanel.stories.tsx +0 -353
- package/src/stories/TextInputWithTokens.stories.tsx +0 -146
- package/src/stories/ThemeProvider.stories.tsx +0 -104
- package/src/stories/Token.stories.tsx +0 -126
- package/src/stories/useAnchoredPosition.stories.tsx +0 -332
- package/src/stories/useFocusTrap.stories.tsx +0 -400
- package/src/stories/useFocusZone.stories.tsx +0 -663
- package/src/sx.ts +0 -9
- package/src/theme-preval.js +0 -79
- package/src/theme.ts +0 -3
- package/src/utils/deprecate.tsx +0 -73
- package/src/utils/isNumeric.tsx +0 -4
- package/src/utils/iterateFocusableElements.ts +0 -121
- package/src/utils/ssr.tsx +0 -1
- package/src/utils/test-deprecations.tsx +0 -19
- package/src/utils/test-helpers.tsx +0 -7
- package/src/utils/test-matchers.tsx +0 -109
- package/src/utils/testing.tsx +0 -242
- package/src/utils/theme.js +0 -64
- package/src/utils/types/AriaRole.ts +0 -71
- package/src/utils/types/ComponentProps.ts +0 -13
- package/src/utils/types/Flatten.ts +0 -4
- package/src/utils/types/MandateProps.ts +0 -19
- package/src/utils/types/Merge.ts +0 -20
- package/src/utils/types/index.ts +0 -5
- package/src/utils/uniqueId.ts +0 -6
- package/src/utils/userAgent.ts +0 -7
- package/stats.html +0 -3279
- package/tsconfig.build.json +0 -7
- package/tsconfig.json +0 -20
@@ -32,6 +32,10 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
|
|
32
32
|
* Whether the remove buttons should be rendered in the tokens
|
33
33
|
*/
|
34
34
|
hideTokenRemoveButtons?: boolean | undefined;
|
35
|
+
/**
|
36
|
+
* The number of tokens to display before truncating
|
37
|
+
*/
|
38
|
+
visibleTokenCount?: number | undefined;
|
35
39
|
} & Pick<Omit<Pick<{
|
36
40
|
[x: string]: any;
|
37
41
|
[x: number]: any;
|
@@ -25,6 +25,10 @@ var _TextInputWrapper = _interopRequireDefault(require("./_TextInputWrapper"));
|
|
25
25
|
|
26
26
|
var _Box = _interopRequireDefault(require("./Box"));
|
27
27
|
|
28
|
+
var _Text = _interopRequireDefault(require("./Text"));
|
29
|
+
|
30
|
+
var _iterateFocusableElements = require("./utils/iterateFocusableElements");
|
31
|
+
|
28
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
29
33
|
|
30
34
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
@@ -33,7 +37,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
33
37
|
|
34
38
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
35
39
|
|
36
|
-
|
40
|
+
const overflowCountFontSizeMap = {
|
41
|
+
small: 0,
|
42
|
+
medium: 1,
|
43
|
+
large: 1,
|
44
|
+
extralarge: 2
|
45
|
+
}; // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
46
|
+
|
37
47
|
function TextInputWithTokensInnerComponent({
|
38
48
|
icon: IconComponent,
|
39
49
|
contrast,
|
@@ -53,9 +63,11 @@ function TextInputWithTokensInnerComponent({
|
|
53
63
|
minWidth: minWidthProp,
|
54
64
|
maxWidth: maxWidthProp,
|
55
65
|
variant: variantProp,
|
66
|
+
visibleTokenCount,
|
56
67
|
...rest
|
57
68
|
}, externalRef) {
|
58
69
|
const {
|
70
|
+
onBlur,
|
59
71
|
onFocus,
|
60
72
|
onKeyDown,
|
61
73
|
...inputPropsRest
|
@@ -64,6 +76,7 @@ function TextInputWithTokensInnerComponent({
|
|
64
76
|
const localInputRef = (0, _react.useRef)(null);
|
65
77
|
const combinedInputRef = (0, _useCombinedRefs.useCombinedRefs)(localInputRef, ref);
|
66
78
|
const [selectedTokenIndex, setSelectedTokenIndex] = (0, _react.useState)();
|
79
|
+
const [tokensAreTruncated, setTokensAreTruncated] = (0, _react.useState)(Boolean(visibleTokenCount));
|
67
80
|
const {
|
68
81
|
containerRef
|
69
82
|
} = (0, _useFocusZone.useFocusZone)({
|
@@ -98,14 +111,25 @@ function TextInputWithTokensInnerComponent({
|
|
98
111
|
}, [selectedTokenIndex]);
|
99
112
|
|
100
113
|
const handleTokenRemove = tokenId => {
|
101
|
-
onTokenRemove(tokenId);
|
114
|
+
onTokenRemove(tokenId); // HACK: wait a tick for the the token node to be removed from the DOM
|
102
115
|
|
103
|
-
|
104
|
-
var _containerRef$current2;
|
116
|
+
setTimeout(() => {
|
117
|
+
var _containerRef$current2, _containerRef$current3;
|
105
118
|
|
106
|
-
const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex];
|
107
|
-
|
108
|
-
|
119
|
+
const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0]; // when removing the first token by keying "Backspace" or "Delete",
|
120
|
+
// `nextFocusableElement` is the div that wraps the input
|
121
|
+
|
122
|
+
const firstFocusable = nextElementToFocus && (0, _iterateFocusableElements.isFocusable)(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(el => (0, _iterateFocusableElements.isFocusable)(el));
|
123
|
+
|
124
|
+
if (firstFocusable) {
|
125
|
+
firstFocusable.focus();
|
126
|
+
} else {
|
127
|
+
var _ref$current;
|
128
|
+
|
129
|
+
// if there are no tokens left, focus the input
|
130
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
131
|
+
}
|
132
|
+
}, 0);
|
109
133
|
};
|
110
134
|
|
111
135
|
const handleTokenFocus = tokenIndex => () => {
|
@@ -113,30 +137,55 @@ function TextInputWithTokensInnerComponent({
|
|
113
137
|
};
|
114
138
|
|
115
139
|
const handleTokenBlur = () => {
|
116
|
-
setSelectedTokenIndex(undefined);
|
140
|
+
setSelectedTokenIndex(undefined); // HACK: wait a tick and check the focused element before hiding truncated tokens
|
141
|
+
// this prevents the tokens from hiding when the user is moving focus between tokens,
|
142
|
+
// but still hides the tokens when the user blurs the token by tabbing out or clicking somewhere else on the page
|
143
|
+
|
144
|
+
setTimeout(() => {
|
145
|
+
var _containerRef$current4;
|
146
|
+
|
147
|
+
if (!((_containerRef$current4 = containerRef.current) !== null && _containerRef$current4 !== void 0 && _containerRef$current4.contains(document.activeElement)) && visibleTokenCount) {
|
148
|
+
setTokensAreTruncated(true);
|
149
|
+
}
|
150
|
+
}, 0);
|
117
151
|
};
|
118
152
|
|
119
|
-
const handleTokenKeyUp =
|
120
|
-
if (
|
121
|
-
var _ref$
|
153
|
+
const handleTokenKeyUp = event => {
|
154
|
+
if (event.key === 'Escape') {
|
155
|
+
var _ref$current2;
|
122
156
|
|
123
|
-
(_ref$
|
157
|
+
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
124
158
|
}
|
125
159
|
};
|
126
160
|
|
127
|
-
const handleInputFocus =
|
128
|
-
onFocus && onFocus(
|
161
|
+
const handleInputFocus = event => {
|
162
|
+
onFocus && onFocus(event);
|
129
163
|
setSelectedTokenIndex(undefined);
|
164
|
+
visibleTokenCount && setTokensAreTruncated(false);
|
165
|
+
};
|
166
|
+
|
167
|
+
const handleInputBlur = event => {
|
168
|
+
onBlur && onBlur(event); // HACK: wait a tick and check the focused element before hiding truncated tokens
|
169
|
+
// this prevents the tokens from hiding when the user is moving focus from the input to a token,
|
170
|
+
// but still hides the tokens when the user blurs the input by tabbing out or clicking somewhere else on the page
|
171
|
+
|
172
|
+
setTimeout(() => {
|
173
|
+
var _containerRef$current5;
|
174
|
+
|
175
|
+
if (!((_containerRef$current5 = containerRef.current) !== null && _containerRef$current5 !== void 0 && _containerRef$current5.contains(document.activeElement)) && visibleTokenCount) {
|
176
|
+
setTokensAreTruncated(true);
|
177
|
+
}
|
178
|
+
}, 0);
|
130
179
|
};
|
131
180
|
|
132
181
|
const handleInputKeyDown = e => {
|
133
|
-
var _ref$
|
182
|
+
var _ref$current3;
|
134
183
|
|
135
184
|
if (onKeyDown) {
|
136
185
|
onKeyDown(e);
|
137
186
|
}
|
138
187
|
|
139
|
-
if ((_ref$
|
188
|
+
if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
|
140
189
|
return;
|
141
190
|
}
|
142
191
|
|
@@ -157,13 +206,24 @@ function TextInputWithTokensInnerComponent({
|
|
157
206
|
|
158
207
|
|
159
208
|
setTimeout(() => {
|
160
|
-
var _ref$
|
209
|
+
var _ref$current4;
|
161
210
|
|
162
|
-
(_ref$
|
211
|
+
(_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
|
163
212
|
}, 0);
|
164
213
|
}
|
165
214
|
};
|
166
215
|
|
216
|
+
const focusInput = () => {
|
217
|
+
var _combinedInputRef$cur;
|
218
|
+
|
219
|
+
(_combinedInputRef$cur = combinedInputRef.current) === null || _combinedInputRef$cur === void 0 ? void 0 : _combinedInputRef$cur.focus();
|
220
|
+
};
|
221
|
+
|
222
|
+
const preventTokenClickPropagation = event => {
|
223
|
+
event.stopPropagation();
|
224
|
+
};
|
225
|
+
|
226
|
+
const visibleTokens = tokensAreTruncated ? tokens.slice(0, visibleTokenCount) : tokens;
|
167
227
|
return /*#__PURE__*/_react.default.createElement(_TextInputWrapper.default, {
|
168
228
|
block: block,
|
169
229
|
className: className,
|
@@ -175,6 +235,7 @@ function TextInputWithTokensInnerComponent({
|
|
175
235
|
minWidth: minWidthProp,
|
176
236
|
maxWidth: maxWidthProp,
|
177
237
|
variant: variantProp,
|
238
|
+
onClick: focusInput,
|
178
239
|
sx: { ...(block ? {
|
179
240
|
display: 'flex',
|
180
241
|
width: '100%'
|
@@ -214,12 +275,13 @@ function TextInputWithTokensInnerComponent({
|
|
214
275
|
ref: combinedInputRef,
|
215
276
|
disabled: disabled,
|
216
277
|
onFocus: handleInputFocus,
|
278
|
+
onBlur: handleInputBlur,
|
217
279
|
onKeyDown: handleInputKeyDown,
|
218
280
|
type: "text",
|
219
281
|
sx: {
|
220
282
|
height: '100%'
|
221
283
|
}
|
222
|
-
}, inputPropsRest))),
|
284
|
+
}, inputPropsRest))), TokenComponent ? visibleTokens.map(({
|
223
285
|
id,
|
224
286
|
...tokenRest
|
225
287
|
}, i) => /*#__PURE__*/_react.default.createElement(TokenComponent, _extends({
|
@@ -227,6 +289,7 @@ function TextInputWithTokensInnerComponent({
|
|
227
289
|
onFocus: handleTokenFocus(i),
|
228
290
|
onBlur: handleTokenBlur,
|
229
291
|
onKeyUp: handleTokenKeyUp,
|
292
|
+
onClick: preventTokenClickPropagation,
|
230
293
|
isSelected: selectedTokenIndex === i,
|
231
294
|
onRemove: () => {
|
232
295
|
handleTokenRemove(id);
|
@@ -234,7 +297,10 @@ function TextInputWithTokensInnerComponent({
|
|
234
297
|
hideRemoveButton: hideTokenRemoveButtons,
|
235
298
|
size: size,
|
236
299
|
tabIndex: 0
|
237
|
-
}, tokenRest))) : null
|
300
|
+
}, tokenRest))) : null, tokensAreTruncated ? /*#__PURE__*/_react.default.createElement(_Text.default, {
|
301
|
+
color: "fg.muted",
|
302
|
+
fontSize: size && overflowCountFontSizeMap[size]
|
303
|
+
}, "+", tokens.length - visibleTokens.length) : null));
|
238
304
|
}
|
239
305
|
|
240
306
|
TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";
|
package/lib/_TextInputWrapper.js
CHANGED
@@ -39,7 +39,7 @@ const sizeVariants = (0, _styledSystem.variant)({
|
|
39
39
|
const TextInputWrapper = _styledComponents.default.span.withConfig({
|
40
40
|
displayName: "_TextInputWrapper__TextInputWrapper",
|
41
41
|
componentId: "sc-5vfcis-0"
|
42
|
-
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
42
|
+
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";cursor:text;", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], (0, _constants.get)('fontSizes.1'), (0, _constants.get)('colors.fg.default'), (0, _constants.get)('colors.border.default'), (0, _constants.get)('radii.2'), (0, _constants.get)('shadows.primer.shadow.inset'), props => {
|
43
43
|
if (props.hasIcon) {
|
44
44
|
return (0, _styledComponents.css)(["padding:0;"]);
|
45
45
|
} else {
|
@@ -32,6 +32,10 @@ declare const TextInputWithTokens: React.ForwardRefExoticComponent<Pick<{
|
|
32
32
|
* Whether the remove buttons should be rendered in the tokens
|
33
33
|
*/
|
34
34
|
hideTokenRemoveButtons?: boolean | undefined;
|
35
|
+
/**
|
36
|
+
* The number of tokens to display before truncating
|
37
|
+
*/
|
38
|
+
visibleTokenCount?: number | undefined;
|
35
39
|
} & Pick<Omit<Pick<{
|
36
40
|
[x: string]: any;
|
37
41
|
[x: number]: any;
|
@@ -9,9 +9,17 @@ import Token from './Token/Token';
|
|
9
9
|
import { useProvidedRefOrCreate } from './hooks';
|
10
10
|
import UnstyledTextInput from './_UnstyledTextInput';
|
11
11
|
import TextInputWrapper from './_TextInputWrapper';
|
12
|
-
import Box from './Box';
|
12
|
+
import Box from './Box';
|
13
|
+
import Text from './Text';
|
14
|
+
import { isFocusable } from './utils/iterateFocusableElements'; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
15
|
+
|
16
|
+
const overflowCountFontSizeMap = {
|
17
|
+
small: 0,
|
18
|
+
medium: 1,
|
19
|
+
large: 1,
|
20
|
+
extralarge: 2
|
21
|
+
}; // using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
13
22
|
|
14
|
-
// using forwardRef is important so that other components (ex. Autocomplete) can use the ref
|
15
23
|
function TextInputWithTokensInnerComponent({
|
16
24
|
icon: IconComponent,
|
17
25
|
contrast,
|
@@ -31,9 +39,11 @@ function TextInputWithTokensInnerComponent({
|
|
31
39
|
minWidth: minWidthProp,
|
32
40
|
maxWidth: maxWidthProp,
|
33
41
|
variant: variantProp,
|
42
|
+
visibleTokenCount,
|
34
43
|
...rest
|
35
44
|
}, externalRef) {
|
36
45
|
const {
|
46
|
+
onBlur,
|
37
47
|
onFocus,
|
38
48
|
onKeyDown,
|
39
49
|
...inputPropsRest
|
@@ -42,6 +52,7 @@ function TextInputWithTokensInnerComponent({
|
|
42
52
|
const localInputRef = useRef(null);
|
43
53
|
const combinedInputRef = useCombinedRefs(localInputRef, ref);
|
44
54
|
const [selectedTokenIndex, setSelectedTokenIndex] = useState();
|
55
|
+
const [tokensAreTruncated, setTokensAreTruncated] = useState(Boolean(visibleTokenCount));
|
45
56
|
const {
|
46
57
|
containerRef
|
47
58
|
} = useFocusZone({
|
@@ -76,14 +87,25 @@ function TextInputWithTokensInnerComponent({
|
|
76
87
|
}, [selectedTokenIndex]);
|
77
88
|
|
78
89
|
const handleTokenRemove = tokenId => {
|
79
|
-
onTokenRemove(tokenId);
|
90
|
+
onTokenRemove(tokenId); // HACK: wait a tick for the the token node to be removed from the DOM
|
80
91
|
|
81
|
-
|
82
|
-
var _containerRef$current2;
|
92
|
+
setTimeout(() => {
|
93
|
+
var _containerRef$current2, _containerRef$current3;
|
83
94
|
|
84
|
-
const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex];
|
85
|
-
|
86
|
-
|
95
|
+
const nextElementToFocus = (_containerRef$current2 = containerRef.current) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.children[selectedTokenIndex || 0]; // when removing the first token by keying "Backspace" or "Delete",
|
96
|
+
// `nextFocusableElement` is the div that wraps the input
|
97
|
+
|
98
|
+
const firstFocusable = nextElementToFocus && isFocusable(nextElementToFocus) ? nextElementToFocus : Array.from(((_containerRef$current3 = containerRef.current) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.children) || []).find(el => isFocusable(el));
|
99
|
+
|
100
|
+
if (firstFocusable) {
|
101
|
+
firstFocusable.focus();
|
102
|
+
} else {
|
103
|
+
var _ref$current;
|
104
|
+
|
105
|
+
// if there are no tokens left, focus the input
|
106
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
107
|
+
}
|
108
|
+
}, 0);
|
87
109
|
};
|
88
110
|
|
89
111
|
const handleTokenFocus = tokenIndex => () => {
|
@@ -91,30 +113,55 @@ function TextInputWithTokensInnerComponent({
|
|
91
113
|
};
|
92
114
|
|
93
115
|
const handleTokenBlur = () => {
|
94
|
-
setSelectedTokenIndex(undefined);
|
116
|
+
setSelectedTokenIndex(undefined); // HACK: wait a tick and check the focused element before hiding truncated tokens
|
117
|
+
// this prevents the tokens from hiding when the user is moving focus between tokens,
|
118
|
+
// but still hides the tokens when the user blurs the token by tabbing out or clicking somewhere else on the page
|
119
|
+
|
120
|
+
setTimeout(() => {
|
121
|
+
var _containerRef$current4;
|
122
|
+
|
123
|
+
if (!((_containerRef$current4 = containerRef.current) !== null && _containerRef$current4 !== void 0 && _containerRef$current4.contains(document.activeElement)) && visibleTokenCount) {
|
124
|
+
setTokensAreTruncated(true);
|
125
|
+
}
|
126
|
+
}, 0);
|
95
127
|
};
|
96
128
|
|
97
|
-
const handleTokenKeyUp =
|
98
|
-
if (
|
99
|
-
var _ref$
|
129
|
+
const handleTokenKeyUp = event => {
|
130
|
+
if (event.key === 'Escape') {
|
131
|
+
var _ref$current2;
|
100
132
|
|
101
|
-
(_ref$
|
133
|
+
(_ref$current2 = ref.current) === null || _ref$current2 === void 0 ? void 0 : _ref$current2.focus();
|
102
134
|
}
|
103
135
|
};
|
104
136
|
|
105
|
-
const handleInputFocus =
|
106
|
-
onFocus && onFocus(
|
137
|
+
const handleInputFocus = event => {
|
138
|
+
onFocus && onFocus(event);
|
107
139
|
setSelectedTokenIndex(undefined);
|
140
|
+
visibleTokenCount && setTokensAreTruncated(false);
|
141
|
+
};
|
142
|
+
|
143
|
+
const handleInputBlur = event => {
|
144
|
+
onBlur && onBlur(event); // HACK: wait a tick and check the focused element before hiding truncated tokens
|
145
|
+
// this prevents the tokens from hiding when the user is moving focus from the input to a token,
|
146
|
+
// but still hides the tokens when the user blurs the input by tabbing out or clicking somewhere else on the page
|
147
|
+
|
148
|
+
setTimeout(() => {
|
149
|
+
var _containerRef$current5;
|
150
|
+
|
151
|
+
if (!((_containerRef$current5 = containerRef.current) !== null && _containerRef$current5 !== void 0 && _containerRef$current5.contains(document.activeElement)) && visibleTokenCount) {
|
152
|
+
setTokensAreTruncated(true);
|
153
|
+
}
|
154
|
+
}, 0);
|
108
155
|
};
|
109
156
|
|
110
157
|
const handleInputKeyDown = e => {
|
111
|
-
var _ref$
|
158
|
+
var _ref$current3;
|
112
159
|
|
113
160
|
if (onKeyDown) {
|
114
161
|
onKeyDown(e);
|
115
162
|
}
|
116
163
|
|
117
|
-
if ((_ref$
|
164
|
+
if ((_ref$current3 = ref.current) !== null && _ref$current3 !== void 0 && _ref$current3.value) {
|
118
165
|
return;
|
119
166
|
}
|
120
167
|
|
@@ -135,13 +182,24 @@ function TextInputWithTokensInnerComponent({
|
|
135
182
|
|
136
183
|
|
137
184
|
setTimeout(() => {
|
138
|
-
var _ref$
|
185
|
+
var _ref$current4;
|
139
186
|
|
140
|
-
(_ref$
|
187
|
+
(_ref$current4 = ref.current) === null || _ref$current4 === void 0 ? void 0 : _ref$current4.select();
|
141
188
|
}, 0);
|
142
189
|
}
|
143
190
|
};
|
144
191
|
|
192
|
+
const focusInput = () => {
|
193
|
+
var _combinedInputRef$cur;
|
194
|
+
|
195
|
+
(_combinedInputRef$cur = combinedInputRef.current) === null || _combinedInputRef$cur === void 0 ? void 0 : _combinedInputRef$cur.focus();
|
196
|
+
};
|
197
|
+
|
198
|
+
const preventTokenClickPropagation = event => {
|
199
|
+
event.stopPropagation();
|
200
|
+
};
|
201
|
+
|
202
|
+
const visibleTokens = tokensAreTruncated ? tokens.slice(0, visibleTokenCount) : tokens;
|
145
203
|
return /*#__PURE__*/React.createElement(TextInputWrapper, {
|
146
204
|
block: block,
|
147
205
|
className: className,
|
@@ -153,6 +211,7 @@ function TextInputWithTokensInnerComponent({
|
|
153
211
|
minWidth: minWidthProp,
|
154
212
|
maxWidth: maxWidthProp,
|
155
213
|
variant: variantProp,
|
214
|
+
onClick: focusInput,
|
156
215
|
sx: { ...(block ? {
|
157
216
|
display: 'flex',
|
158
217
|
width: '100%'
|
@@ -192,12 +251,13 @@ function TextInputWithTokensInnerComponent({
|
|
192
251
|
ref: combinedInputRef,
|
193
252
|
disabled: disabled,
|
194
253
|
onFocus: handleInputFocus,
|
254
|
+
onBlur: handleInputBlur,
|
195
255
|
onKeyDown: handleInputKeyDown,
|
196
256
|
type: "text",
|
197
257
|
sx: {
|
198
258
|
height: '100%'
|
199
259
|
}
|
200
|
-
}, inputPropsRest))),
|
260
|
+
}, inputPropsRest))), TokenComponent ? visibleTokens.map(({
|
201
261
|
id,
|
202
262
|
...tokenRest
|
203
263
|
}, i) => /*#__PURE__*/React.createElement(TokenComponent, _extends({
|
@@ -205,6 +265,7 @@ function TextInputWithTokensInnerComponent({
|
|
205
265
|
onFocus: handleTokenFocus(i),
|
206
266
|
onBlur: handleTokenBlur,
|
207
267
|
onKeyUp: handleTokenKeyUp,
|
268
|
+
onClick: preventTokenClickPropagation,
|
208
269
|
isSelected: selectedTokenIndex === i,
|
209
270
|
onRemove: () => {
|
210
271
|
handleTokenRemove(id);
|
@@ -212,7 +273,10 @@ function TextInputWithTokensInnerComponent({
|
|
212
273
|
hideRemoveButton: hideTokenRemoveButtons,
|
213
274
|
size: size,
|
214
275
|
tabIndex: 0
|
215
|
-
}, tokenRest))) : null
|
276
|
+
}, tokenRest))) : null, tokensAreTruncated ? /*#__PURE__*/React.createElement(Text, {
|
277
|
+
color: "fg.muted",
|
278
|
+
fontSize: size && overflowCountFontSizeMap[size]
|
279
|
+
}, "+", tokens.length - visibleTokens.length) : null));
|
216
280
|
}
|
217
281
|
|
218
282
|
TextInputWithTokensInnerComponent.displayName = "TextInputWithTokensInnerComponent";
|
@@ -21,7 +21,7 @@ const sizeVariants = variant({
|
|
21
21
|
const TextInputWrapper = styled.span.withConfig({
|
22
22
|
displayName: "_TextInputWrapper__TextInputWrapper",
|
23
23
|
componentId: "sc-5vfcis-0"
|
24
|
-
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('radii.2'), get('shadows.primer.shadow.inset'), props => {
|
24
|
+
})(["display:inline-flex;align-items:stretch;min-height:34px;font-size:", ";line-height:20px;color:", ";vertical-align:middle;background-repeat:no-repeat;background-position:right 8px center;border:1px solid ", ";border-radius:", ";outline:none;box-shadow:", ";cursor:text;", " .TextInput-icon{align-self:center;color:", ";margin:0 ", ";flex-shrink:0;}&:focus-within{border-color:", ";box-shadow:", ";}", " ", " ", " @media (min-width:", "){font-size:", ";}", " ", " ", " ", " ", ";"], get('fontSizes.1'), get('colors.fg.default'), get('colors.border.default'), get('radii.2'), get('shadows.primer.shadow.inset'), props => {
|
25
25
|
if (props.hasIcon) {
|
26
26
|
return css(["padding:0;"]);
|
27
27
|
} else {
|
package/package.json
CHANGED
package/.changeset/README.md
DELETED
@@ -1,8 +0,0 @@
|
|
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)
|
package/.changeset/config.json
DELETED
@@ -1,10 +0,0 @@
|
|
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
|
-
}
|
@@ -1,8 +0,0 @@
|
|
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
DELETED
@@ -1,137 +0,0 @@
|
|
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": ["dark_dimmed"]
|
57
|
-
}
|
58
|
-
],
|
59
|
-
"primer-react/no-deprecated-colors": ["warn", {"checkAllStrings": true}]
|
60
|
-
},
|
61
|
-
"overrides": [
|
62
|
-
// rules which apply only to JS
|
63
|
-
{
|
64
|
-
"files": ["**/*.{js,jsx}"],
|
65
|
-
"rules": {
|
66
|
-
"eslint-comments/no-use": 0,
|
67
|
-
"import/no-namespace": 0,
|
68
|
-
"no-shadow": 0,
|
69
|
-
"no-unused-vars": [
|
70
|
-
"error",
|
71
|
-
{
|
72
|
-
"ignoreRestSiblings": true
|
73
|
-
}
|
74
|
-
]
|
75
|
-
}
|
76
|
-
},
|
77
|
-
// rules which apply only to TS
|
78
|
-
{
|
79
|
-
"parserOptions": {
|
80
|
-
"project": "tsconfig.json"
|
81
|
-
},
|
82
|
-
"files": ["**/*.{ts,tsx}"],
|
83
|
-
"extends": ["plugin:@typescript-eslint/recommended"],
|
84
|
-
"rules": {
|
85
|
-
"@typescript-eslint/no-explicit-any": 2,
|
86
|
-
"@typescript-eslint/no-unnecessary-condition": 2,
|
87
|
-
"@typescript-eslint/explicit-module-boundary-types": 0,
|
88
|
-
"@typescript-eslint/no-unused-vars": [
|
89
|
-
"error",
|
90
|
-
{
|
91
|
-
"argsIgnorePattern": "^_"
|
92
|
-
}
|
93
|
-
]
|
94
|
-
}
|
95
|
-
},
|
96
|
-
// rules which apply only to Markdown
|
97
|
-
{
|
98
|
-
"files": ["**/*.{md,mdx}"],
|
99
|
-
"extends": ["plugin:mdx/recommended"],
|
100
|
-
"settings": {
|
101
|
-
"mdx/code-blocks": true
|
102
|
-
},
|
103
|
-
"rules": {
|
104
|
-
"prettier/prettier": 0
|
105
|
-
}
|
106
|
-
},
|
107
|
-
// rules which apply only to Markdown code blocks
|
108
|
-
{
|
109
|
-
"files": ["**/*.{md,mdx}/**"],
|
110
|
-
"parserOptions": {
|
111
|
-
"project": false
|
112
|
-
},
|
113
|
-
"rules": {
|
114
|
-
"camelcase": 0,
|
115
|
-
"no-constant-condition": 0,
|
116
|
-
"no-console": 0,
|
117
|
-
"no-empty-pattern": 0,
|
118
|
-
"no-unused-vars": 0,
|
119
|
-
"no-undef": 0,
|
120
|
-
"react/no-unescaped-entities": 0,
|
121
|
-
"react/react-in-jsx-scope": 0,
|
122
|
-
"react/jsx-no-undef": 0,
|
123
|
-
"react/jsx-key": 0,
|
124
|
-
"react/jsx-no-comment-textnodes": 0,
|
125
|
-
"import/no-anonymous-default-export": 0,
|
126
|
-
"prettier/prettier": 0,
|
127
|
-
// These a11y rules should eventually be re-enabled
|
128
|
-
"jsx-a11y/anchor-is-valid": 0,
|
129
|
-
"jsx-a11y/accessible-emoji": 0,
|
130
|
-
"jsx-a11y/label-has-for": 0,
|
131
|
-
"@typescript-eslint/no-unnecessary-condition": 0,
|
132
|
-
"@typescript-eslint/no-unused-vars": 0,
|
133
|
-
"primer-react/no-deprecated-colors": ["error", {"skipImportCheck": true}]
|
134
|
-
}
|
135
|
-
}
|
136
|
-
]
|
137
|
-
}
|