@primer/react 39.0.0-rc.0aa873f54 → 39.0.0-rc.cb01b74bb
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 +1178 -1
- package/README.md +16 -11
- package/dist/ActionBar/ActionBar-3767d551.css +2 -0
- package/dist/ActionBar/ActionBar-3767d551.css.map +1 -0
- package/dist/ActionBar/ActionBar.d.ts +85 -40
- package/dist/ActionBar/ActionBar.js +569 -528
- package/dist/ActionBar/ActionBar.module.css.js +13 -5
- package/dist/ActionBar/index.d.ts +49 -10
- package/dist/ActionBar/index.js +7 -6
- package/dist/ActionList/ActionList-64885d7a.css +2 -0
- package/dist/ActionList/ActionList-64885d7a.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +31 -5
- package/dist/ActionList/ActionListContainerContext.js +3 -5
- package/dist/ActionList/Description.d.ts +18 -18
- package/dist/ActionList/Description.js +116 -52
- package/dist/ActionList/Divider.d.ts +7 -10
- package/dist/ActionList/Divider.js +30 -19
- package/dist/ActionList/Group-d89306a8.css +2 -0
- package/dist/ActionList/Group-d89306a8.css.map +1 -0
- package/dist/ActionList/Group.d.ts +33 -45
- package/dist/ActionList/Group.js +312 -173
- package/dist/ActionList/Group.module.css.js +10 -5
- package/dist/ActionList/GroupContext.js +7 -0
- package/dist/ActionList/GroupHeadingTrailingAction.d.ts +17 -0
- package/dist/ActionList/GroupHeadingTrailingAction.js +62 -0
- package/dist/ActionList/Heading-b9360636.css +1 -1
- package/dist/ActionList/Heading-b9360636.css.map +1 -1
- package/dist/ActionList/Heading.d.ts +10 -11
- package/dist/ActionList/Heading.js +78 -50
- package/dist/ActionList/Heading.module.css.js +4 -5
- package/dist/ActionList/Item.js +689 -274
- package/dist/ActionList/LinkItem.d.ts +16 -17
- package/dist/ActionList/LinkItem.js +112 -47
- package/dist/ActionList/List.js +175 -74
- package/dist/ActionList/Selection.js +82 -64
- package/dist/ActionList/TrailingAction.d.ts +21 -21
- package/dist/ActionList/TrailingAction.js +102 -51
- package/dist/ActionList/Visuals.d.ts +7 -18
- package/dist/ActionList/Visuals.js +144 -91
- package/dist/ActionList/index.d.ts +105 -96
- package/dist/ActionList/index.js +38 -33
- package/dist/ActionList/shared.d.ts +103 -117
- package/dist/ActionList/shared.js +4 -9
- package/dist/ActionMenu/ActionMenu-c4e2a589.css +2 -0
- package/dist/ActionMenu/ActionMenu-c4e2a589.css.map +1 -0
- package/dist/ActionMenu/ActionMenu.d.ts +46 -47
- package/dist/ActionMenu/ActionMenu.js +485 -293
- package/dist/ActionMenu/ActionMenu.module.css.js +4 -5
- package/dist/ActionMenu/index.d.ts +2 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-83281f45.css +2 -0
- package/dist/AnchoredOverlay/AnchoredOverlay-83281f45.css.map +1 -0
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts +117 -94
- package/dist/AnchoredOverlay/AnchoredOverlay.js +261 -159
- package/dist/AnchoredOverlay/AnchoredOverlay.module.css.js +8 -5
- package/dist/AnchoredOverlay/index.d.ts +2 -3
- package/dist/Autocomplete/Autocomplete.d.ts +41 -46
- package/dist/Autocomplete/Autocomplete.js +182 -179
- package/dist/Autocomplete/AutocompleteContext.js +21 -5
- package/dist/Autocomplete/AutocompleteInput.d.ts +15 -14
- package/dist/Autocomplete/AutocompleteInput.js +121 -144
- package/dist/Autocomplete/AutocompleteMenu-7f135c03.css +1 -1
- package/dist/Autocomplete/AutocompleteMenu-7f135c03.css.map +1 -1
- package/dist/Autocomplete/AutocompleteMenu.d.ts +70 -68
- package/dist/Autocomplete/AutocompleteMenu.js +371 -231
- package/dist/Autocomplete/AutocompleteMenu.module.css.js +7 -5
- package/dist/Autocomplete/AutocompleteOverlay-d99d778c.css +1 -1
- package/dist/Autocomplete/AutocompleteOverlay-d99d778c.css.map +1 -1
- package/dist/Autocomplete/AutocompleteOverlay.d.ts +25 -18
- package/dist/Autocomplete/AutocompleteOverlay.js +128 -134
- package/dist/Autocomplete/AutocompleteOverlay.module.css.js +4 -5
- package/dist/Autocomplete/index.d.ts +5 -3
- package/dist/Avatar/Avatar-61b19061.css +1 -1
- package/dist/Avatar/Avatar-61b19061.css.map +1 -1
- package/dist/Avatar/Avatar.d.ts +16 -26
- package/dist/Avatar/Avatar.js +105 -125
- package/dist/Avatar/Avatar.module.css.js +4 -5
- package/dist/Avatar/index.d.ts +2 -3
- package/dist/AvatarStack/AvatarStack-937ec7c1.css +2 -0
- package/dist/AvatarStack/AvatarStack-937ec7c1.css.map +1 -0
- package/dist/AvatarStack/AvatarStack.d.ts +24 -14
- package/dist/AvatarStack/AvatarStack.js +209 -143
- package/dist/AvatarStack/AvatarStack.module.css.js +8 -5
- package/dist/AvatarStack/index.d.ts +2 -3
- package/dist/Banner/Banner-41040ab7.css +2 -0
- package/dist/Banner/Banner-41040ab7.css.map +1 -0
- package/dist/Banner/Banner.d.ts +81 -130
- package/dist/Banner/Banner.js +449 -338
- package/dist/Banner/Banner.module.css.js +13 -5
- package/dist/Banner/index.d.ts +24 -21
- package/dist/Banner/index.js +6 -7
- package/dist/BaseStyles-fda34843.css +2 -0
- package/dist/BaseStyles-fda34843.css.map +1 -0
- package/dist/BaseStyles.d.ts +15 -11
- package/dist/BaseStyles.js +73 -90
- package/dist/BaseStyles.module.css.js +4 -5
- package/dist/Blankslate/Blankslate-670cf090.css +2 -0
- package/dist/Blankslate/Blankslate-670cf090.css.map +1 -0
- package/dist/Blankslate/Blankslate.d.ts +62 -34
- package/dist/Blankslate/Blankslate.js +280 -328
- package/dist/Blankslate/Blankslate.module.css.js +11 -5
- package/dist/Blankslate/BlankslateContext.js +6 -9
- package/dist/Blankslate/index.d.ts +9 -10
- package/dist/Blankslate/index.js +7 -8
- package/dist/BranchName/BranchName-2fad4f4b.css +1 -1
- package/dist/BranchName/BranchName-2fad4f4b.css.map +1 -1
- package/dist/BranchName/BranchName.d.ts +11 -12
- package/dist/BranchName/BranchName.js +51 -61
- package/dist/BranchName/BranchName.module.css.js +4 -5
- package/dist/BranchName/index.d.ts +2 -3
- package/dist/Breadcrumbs/Breadcrumbs-6c9aadcf.css +2 -0
- package/dist/Breadcrumbs/Breadcrumbs-6c9aadcf.css.map +1 -0
- package/dist/Breadcrumbs/Breadcrumbs.d.ts +57 -41
- package/dist/Breadcrumbs/Breadcrumbs.js +509 -480
- package/dist/Breadcrumbs/Breadcrumbs.module.css.js +14 -5
- package/dist/Breadcrumbs/index.d.ts +2 -3
- package/dist/Button/Button.d.ts +6 -5
- package/dist/Button/Button.js +35 -18
- package/dist/Button/ButtonBase-c8dab214.css +2 -0
- package/dist/Button/ButtonBase-c8dab214.css.map +1 -0
- package/dist/Button/ButtonBase.d.ts +9 -5
- package/dist/Button/ButtonBase.js +83 -142
- package/dist/Button/ButtonBase.module.css.js +17 -5
- package/dist/Button/IconButton.d.ts +6 -5
- package/dist/Button/IconButton.js +133 -65
- package/dist/Button/LinkButton.d.ts +7 -6
- package/dist/Button/LinkButton.js +38 -16
- package/dist/Button/index.d.ts +6 -8
- package/dist/Button/types.d.ts +99 -86
- package/dist/ButtonGroup/ButtonGroup-be1c1123.css +2 -0
- package/dist/ButtonGroup/ButtonGroup-be1c1123.css.map +1 -0
- package/dist/ButtonGroup/ButtonGroup.d.ts +9 -10
- package/dist/ButtonGroup/ButtonGroup.js +83 -98
- package/dist/ButtonGroup/ButtonGroup.module.css.js +7 -5
- package/dist/ButtonGroup/index.d.ts +2 -3
- package/dist/Card/Card-0e84ee3c.css +2 -0
- package/dist/Card/Card-0e84ee3c.css.map +1 -0
- package/dist/Card/Card.d.ts +113 -0
- package/dist/Card/Card.js +624 -0
- package/dist/Card/Card.module.css.js +18 -0
- package/dist/Card/index.d.ts +38 -0
- package/dist/Card/index.js +13 -0
- package/dist/Checkbox/Checkbox-7476a7ba.css +2 -0
- package/dist/Checkbox/Checkbox-7476a7ba.css.map +1 -0
- package/dist/Checkbox/Checkbox.d.ts +33 -31
- package/dist/Checkbox/Checkbox.js +153 -179
- package/dist/Checkbox/Checkbox.module.css.js +8 -5
- package/dist/Checkbox/index.d.ts +2 -3
- package/dist/Checkbox/shared-edc41e16.css +1 -1
- package/dist/Checkbox/shared-edc41e16.css.map +1 -1
- package/dist/Checkbox/shared.module.css.js +4 -5
- package/dist/CheckboxGroup/CheckboxGroup.d.ts +21 -21
- package/dist/CheckboxGroup/CheckboxGroup.js +111 -133
- package/dist/CheckboxGroup/CheckboxGroupContext.d.ts +1 -6
- package/dist/CheckboxGroup/CheckboxGroupContext.js +3 -4
- package/dist/CheckboxGroup/index.d.ts +2 -2
- package/dist/CircleBadge/CircleBadge-87549d20.css +1 -1
- package/dist/CircleBadge/CircleBadge-87549d20.css.map +1 -1
- package/dist/CircleBadge/CircleBadge.d.ts +24 -21
- package/dist/CircleBadge/CircleBadge.js +91 -91
- package/dist/CircleBadge/CircleBadge.module.css.js +7 -5
- package/dist/CircleBadge/index.d.ts +2 -3
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts +63 -70
- package/dist/ConfirmationDialog/ConfirmationDialog.js +103 -157
- package/dist/ConfirmationDialog/useConfirm.d.ts +14 -0
- package/dist/ConfirmationDialog/useConfirm.js +34 -0
- package/dist/CounterLabel/CounterLabel-8c6e8ee4.css +2 -0
- package/dist/CounterLabel/CounterLabel-8c6e8ee4.css.map +1 -0
- package/dist/CounterLabel/CounterLabel.d.ts +14 -10
- package/dist/CounterLabel/CounterLabel.js +88 -95
- package/dist/CounterLabel/CounterLabel.module.css.js +4 -5
- package/dist/CounterLabel/index.d.ts +2 -3
- package/dist/DataTable/DataTable.d.ts +129 -56
- package/dist/DataTable/DataTable.js +277 -141
- package/dist/DataTable/ErrorDialog.d.ts +24 -17
- package/dist/DataTable/ErrorDialog.js +32 -45
- package/dist/DataTable/Pagination-aebe86e8.css +2 -0
- package/dist/DataTable/Pagination-aebe86e8.css.map +1 -0
- package/dist/DataTable/Pagination.d.ts +49 -40
- package/dist/DataTable/Pagination.js +464 -383
- package/dist/DataTable/Pagination.module.css.js +12 -5
- package/dist/DataTable/Table-3916da1f.css +2 -0
- package/dist/DataTable/Table-3916da1f.css.map +1 -0
- package/dist/DataTable/Table.d.ts +224 -124
- package/dist/DataTable/Table.js +773 -699
- package/dist/DataTable/Table.module.css.js +35 -5
- package/dist/DataTable/TableBulkActions-aca5618a.css +2 -0
- package/dist/DataTable/TableBulkActions-aca5618a.css.map +1 -0
- package/dist/DataTable/TableBulkActions.d.ts +14 -0
- package/dist/DataTable/TableBulkActions.js +216 -0
- package/dist/DataTable/TableBulkActions.module.css.js +11 -0
- package/dist/DataTable/TableGroup.d.ts +72 -0
- package/dist/DataTable/TableGroup.js +292 -0
- package/dist/DataTable/TableGroupContext.js +4 -0
- package/dist/DataTable/column.d.ts +62 -60
- package/dist/DataTable/column.js +9 -11
- package/dist/DataTable/index.d.ts +32 -32
- package/dist/DataTable/index.js +27 -20
- package/dist/DataTable/row.d.ts +27 -3
- package/dist/DataTable/sorting.d.ts +12 -16
- package/dist/DataTable/sorting.js +63 -102
- package/dist/DataTable/useTable.js +503 -285
- package/dist/DataTable/utils.d.ts +6 -6
- package/dist/Details/Details-8093044f.css +1 -1
- package/dist/Details/Details-8093044f.css.map +1 -1
- package/dist/Details/Details.d.ts +23 -15
- package/dist/Details/Details.js +105 -123
- package/dist/Details/Details.module.css.js +4 -5
- package/dist/Details/index.d.ts +2 -3
- package/dist/Dialog/Dialog-b7da369a.css +2 -0
- package/dist/Dialog/Dialog-b7da369a.css.map +1 -0
- package/dist/Dialog/Dialog.d.ts +158 -143
- package/dist/Dialog/Dialog.js +292 -547
- package/dist/Dialog/Dialog.module.css.js +21 -5
- package/dist/Dialog/DialogContext.js +4 -0
- package/dist/Dialog/index.d.ts +2 -0
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts +5 -3
- package/dist/FeatureFlags/DefaultFeatureFlags.js +11 -11
- package/dist/FeatureFlags/FeatureFlagContext.js +4 -5
- package/dist/FeatureFlags/FeatureFlagScope.d.ts +20 -20
- package/dist/FeatureFlags/FeatureFlagScope.js +36 -44
- package/dist/FeatureFlags/FeatureFlags.d.ts +11 -6
- package/dist/FeatureFlags/FeatureFlags.js +28 -37
- package/dist/FeatureFlags/index.d.ts +4 -5
- package/dist/FeatureFlags/useFeatureFlag.d.ts +2 -2
- package/dist/FeatureFlags/useFeatureFlag.js +17 -19
- package/dist/FilteredActionList/FilteredActionList-6808e67a.css +2 -0
- package/dist/FilteredActionList/FilteredActionList-6808e67a.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionList.d.ts +141 -27
- package/dist/FilteredActionList/FilteredActionList.js +351 -452
- package/dist/FilteredActionList/FilteredActionList.module.css.js +14 -5
- package/dist/FilteredActionList/FilteredActionListInput.d.ts +34 -0
- package/dist/FilteredActionList/FilteredActionListInput.js +120 -0
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css +2 -0
- package/dist/FilteredActionList/FilteredActionListLoaders-bdda3d7e.css.map +1 -0
- package/dist/FilteredActionList/FilteredActionListLoaders.d.ts +11 -14
- package/dist/FilteredActionList/FilteredActionListLoaders.js +110 -151
- package/dist/FilteredActionList/FilteredActionListLoaders.module.css.js +9 -5
- package/dist/FilteredActionList/constants.d.ts +11 -0
- package/dist/FilteredActionList/constants.js +15 -0
- package/dist/FilteredActionList/index.d.ts +12 -4
- package/dist/FilteredActionList/index.js +10 -0
- package/dist/FilteredActionList/types.d.ts +153 -151
- package/dist/FilteredActionList/useAnnouncements.js +191 -186
- package/dist/Flash/Flash-a3596568.css +1 -1
- package/dist/Flash/Flash-a3596568.css.map +1 -1
- package/dist/Flash/Flash.d.ts +16 -9
- package/dist/Flash/Flash.js +60 -69
- package/dist/Flash/Flash.module.css.js +4 -5
- package/dist/Flash/index.d.ts +2 -3
- package/dist/FormControl/FormControl-fa33984d.css +1 -1
- package/dist/FormControl/FormControl-fa33984d.css.map +1 -1
- package/dist/FormControl/FormControl.d.ts +41 -36
- package/dist/FormControl/FormControl.js +189 -212
- package/dist/FormControl/FormControl.module.css.js +10 -5
- package/dist/FormControl/FormControlCaption-f58db5f7.css +1 -1
- package/dist/FormControl/FormControlCaption-f58db5f7.css.map +1 -1
- package/dist/FormControl/FormControlCaption.d.ts +15 -9
- package/dist/FormControl/FormControlCaption.js +37 -49
- package/dist/FormControl/FormControlCaption.module.css.js +4 -5
- package/dist/FormControl/FormControlLabel.d.ts +14 -18
- package/dist/FormControl/FormControlLabel.js +94 -110
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css +1 -1
- package/dist/FormControl/FormControlLeadingVisual-e217df71.css.map +1 -1
- package/dist/FormControl/FormControlLeadingVisual.js +29 -37
- package/dist/FormControl/FormControlLeadingVisual.module.css.js +4 -5
- package/dist/FormControl/_FormControlContext.d.ts +6 -15
- package/dist/FormControl/_FormControlContext.js +41 -50
- package/dist/FormControl/_FormControlContextProvider.js +4 -0
- package/dist/FormControl/_FormControlValidation.d.ts +10 -11
- package/dist/FormControl/_FormControlValidation.js +29 -39
- package/dist/FormControl/index.d.ts +6 -7
- package/dist/Header/Header-aff64597.css +1 -1
- package/dist/Header/Header-aff64597.css.map +1 -1
- package/dist/Header/Header.d.ts +16 -15
- package/dist/Header/Header.js +142 -167
- package/dist/Header/Header.module.css.js +8 -5
- package/dist/Header/index.d.ts +2 -3
- package/dist/Heading/Heading-26b4879b.css +1 -1
- package/dist/Heading/Heading-26b4879b.css.map +1 -1
- package/dist/Heading/Heading.d.ts +9 -8
- package/dist/Heading/Heading.js +68 -38
- package/dist/Heading/Heading.module.css.js +4 -5
- package/dist/Heading/index.d.ts +2 -3
- package/dist/Hidden/Hidden-b3896306.css +1 -1
- package/dist/Hidden/Hidden-b3896306.css.map +1 -1
- package/dist/Hidden/Hidden.d.ts +17 -12
- package/dist/Hidden/Hidden.js +54 -77
- package/dist/Hidden/Hidden.module.css.js +4 -5
- package/dist/Hidden/index.d.ts +2 -6
- package/dist/InlineMessage/InlineMessage-cd1e4c93.css +2 -0
- package/dist/InlineMessage/InlineMessage-cd1e4c93.css.map +1 -0
- package/dist/InlineMessage/InlineMessage.d.ts +25 -13
- package/dist/InlineMessage/InlineMessage.js +98 -92
- package/dist/InlineMessage/InlineMessage.module.css.js +7 -5
- package/dist/InlineMessage/index.d.ts +2 -3
- package/dist/KeybindingHint/KeybindingHint-0856c11b.css +1 -1
- package/dist/KeybindingHint/KeybindingHint-0856c11b.css.map +1 -1
- package/dist/KeybindingHint/KeybindingHint.d.ts +8 -12
- package/dist/KeybindingHint/KeybindingHint.js +64 -91
- package/dist/KeybindingHint/KeybindingHint.module.css.js +4 -5
- package/dist/KeybindingHint/components/Chord-d4edcc89.css +1 -1
- package/dist/KeybindingHint/components/Chord-d4edcc89.css.map +1 -1
- package/dist/KeybindingHint/components/Chord.js +65 -99
- package/dist/KeybindingHint/components/Chord.module.css.js +10 -5
- package/dist/KeybindingHint/components/Key.js +48 -66
- package/dist/KeybindingHint/components/Sequence.js +11 -26
- package/dist/KeybindingHint/components/utils.js +28 -0
- package/dist/KeybindingHint/key-names.js +102 -117
- package/dist/KeybindingHint/platform.d.ts +10 -0
- package/dist/KeybindingHint/platform.js +43 -0
- package/dist/KeybindingHint/props.d.ts +36 -36
- package/dist/KeybindingHint/utils.d.ts +17 -0
- package/dist/KeybindingHint/utils.js +16 -0
- package/dist/Label/Label-7904957c.css +1 -1
- package/dist/Label/Label-7904957c.css.map +1 -1
- package/dist/Label/Label.d.ts +9 -10
- package/dist/Label/Label.js +56 -66
- package/dist/Label/Label.module.css.js +4 -5
- package/dist/Label/index.d.ts +2 -4
- package/dist/Label/index.js +4 -5
- package/dist/LabelGroup/LabelGroup-db41f443.css +2 -0
- package/dist/LabelGroup/LabelGroup-db41f443.css.map +1 -0
- package/dist/LabelGroup/LabelGroup.d.ts +9 -11
- package/dist/LabelGroup/LabelGroup.js +234 -333
- package/dist/LabelGroup/LabelGroup.module.css.js +11 -5
- package/dist/LabelGroup/index.d.ts +2 -3
- package/dist/Link/Link-ba423096.css +2 -0
- package/dist/Link/Link-ba423096.css.map +1 -0
- package/dist/Link/Link.d.ts +14 -15
- package/dist/Link/Link.js +79 -46
- package/dist/Link/Link.module.css.js +4 -5
- package/dist/Link/index.d.ts +2 -3
- package/dist/NavList/NavList-b50d982b.css +2 -0
- package/dist/NavList/NavList-b50d982b.css.map +1 -0
- package/dist/NavList/NavList.d.ts +72 -46
- package/dist/NavList/NavList.js +628 -687
- package/dist/NavList/NavList.module.css.js +7 -5
- package/dist/NavList/index.d.ts +2 -2
- package/dist/Octicon/Octicon.d.ts +10 -9
- package/dist/Octicon/Octicon.js +31 -37
- package/dist/Octicon/index.d.ts +2 -3
- package/dist/Overlay/Overlay-214d10dd.css +2 -0
- package/dist/Overlay/Overlay-214d10dd.css.map +1 -0
- package/dist/Overlay/Overlay.d.ts +43 -56
- package/dist/Overlay/Overlay.js +364 -305
- package/dist/Overlay/Overlay.module.css.js +8 -5
- package/dist/Overlay/constants.d.ts +19 -0
- package/dist/Overlay/constants.js +20 -0
- package/dist/Overlay/index.d.ts +2 -3
- package/dist/PageHeader/PageHeader-b12247c8.css +2 -0
- package/dist/PageHeader/PageHeader-b12247c8.css.map +1 -0
- package/dist/PageHeader/PageHeader.d.ts +49 -43
- package/dist/PageHeader/PageHeader.js +654 -817
- package/dist/PageHeader/PageHeader.module.css.js +20 -5
- package/dist/PageHeader/index.d.ts +2 -2
- package/dist/PageLayout/DragHandle.d.ts +44 -0
- package/dist/PageLayout/DragHandle.js +223 -0
- package/dist/PageLayout/PageLayout-3444a142.css +2 -0
- package/dist/PageLayout/PageLayout-3444a142.css.map +1 -0
- package/dist/PageLayout/PageLayout.d.ts +283 -178
- package/dist/PageLayout/PageLayout.js +1267 -1204
- package/dist/PageLayout/PageLayout.module.css.js +30 -5
- package/dist/PageLayout/index.d.ts +4 -2
- package/dist/PageLayout/paneUtils.js +19 -0
- package/dist/PageLayout/usePaneWidth.d.ts +79 -0
- package/dist/PageLayout/usePaneWidth.js +372 -0
- package/dist/Pagehead/Pagehead-0744ffce.css +1 -1
- package/dist/Pagehead/Pagehead-0744ffce.css.map +1 -1
- package/dist/Pagehead/Pagehead.d.ts +11 -6
- package/dist/Pagehead/Pagehead.js +41 -15
- package/dist/Pagehead/Pagehead.module.css.js +4 -5
- package/dist/Pagehead/index.d.ts +2 -3
- package/dist/Pagination/Pagination-16a5b4c6.css +1 -1
- package/dist/Pagination/Pagination-16a5b4c6.css.map +1 -1
- package/dist/Pagination/Pagination.d.ts +34 -21
- package/dist/Pagination/Pagination.js +209 -107
- package/dist/Pagination/Pagination.module.css.js +8 -5
- package/dist/Pagination/index.d.ts +2 -4
- package/dist/Pagination/index.js +4 -5
- package/dist/Pagination/model.d.ts +15 -25
- package/dist/Pagination/model.js +117 -194
- package/dist/Popover/Popover-a93df39c.css +2 -0
- package/dist/Popover/Popover-a93df39c.css.map +1 -0
- package/dist/Popover/Popover.d.ts +18 -18
- package/dist/Popover/Popover.js +163 -152
- package/dist/Popover/Popover.module.css.js +7 -5
- package/dist/Popover/index.d.ts +2 -3
- package/dist/Portal/Portal.d.ts +16 -28
- package/dist/Portal/Portal.js +100 -89
- package/dist/Portal/PortalContext.d.ts +7 -0
- package/dist/Portal/PortalContext.js +4 -0
- package/dist/Portal/index.d.ts +4 -7
- package/dist/Portal/index.js +6 -6
- package/dist/Portal/portalRoot.d.ts +8 -0
- package/dist/Portal/portalRoot.js +35 -0
- package/dist/ProgressBar/ProgressBar-3d1db6c7.css +2 -0
- package/dist/ProgressBar/ProgressBar-3d1db6c7.css.map +1 -0
- package/dist/ProgressBar/ProgressBar.d.ts +16 -23
- package/dist/ProgressBar/ProgressBar.js +210 -255
- package/dist/ProgressBar/ProgressBar.module.css.js +8 -5
- package/dist/ProgressBar/index.d.ts +19 -17
- package/dist/ProgressBar/index.js +5 -8
- package/dist/Radio/Radio-4319e717.css +2 -0
- package/dist/Radio/Radio-4319e717.css.map +1 -0
- package/dist/Radio/Radio.d.ts +31 -31
- package/dist/Radio/Radio.js +97 -115
- package/dist/Radio/Radio.module.css.js +4 -5
- package/dist/Radio/index.d.ts +2 -3
- package/dist/RadioGroup/RadioGroup.d.ts +24 -27
- package/dist/RadioGroup/RadioGroup.js +99 -120
- package/dist/RadioGroup/RadioGroupContext.d.ts +1 -0
- package/dist/RadioGroup/RadioGroupContext.js +4 -0
- package/dist/RadioGroup/index.d.ts +2 -3
- package/dist/RelativeTime/RelativeTime.d.ts +13 -6
- package/dist/RelativeTime/RelativeTime.js +65 -76
- package/dist/RelativeTime/index.d.ts +2 -3
- package/dist/ScrollableRegion/ScrollableRegion-c1018dbe.css +1 -1
- package/dist/ScrollableRegion/ScrollableRegion-c1018dbe.css.map +1 -1
- package/dist/ScrollableRegion/ScrollableRegion.d.ts +15 -9
- package/dist/ScrollableRegion/ScrollableRegion.js +67 -79
- package/dist/ScrollableRegion/ScrollableRegion.module.css.js +4 -5
- package/dist/ScrollableRegion/index.d.ts +2 -3
- package/dist/SegmentedControl/SegmentedControl-99b8e34e.css +2 -0
- package/dist/SegmentedControl/SegmentedControl-99b8e34e.css.map +1 -0
- package/dist/SegmentedControl/SegmentedControl.d.ts +25 -23
- package/dist/SegmentedControl/SegmentedControl.js +282 -222
- package/dist/SegmentedControl/SegmentedControl.module.css.js +18 -5
- package/dist/SegmentedControl/SegmentedControlAction.d.ts +11 -0
- package/dist/SegmentedControl/SegmentedControlAction.js +110 -0
- package/dist/SegmentedControl/SegmentedControlActionContext.js +4 -0
- package/dist/SegmentedControl/SegmentedControlButton.d.ts +13 -20
- package/dist/SegmentedControl/SegmentedControlButton.js +155 -165
- package/dist/SegmentedControl/SegmentedControlDivider.d.ts +8 -0
- package/dist/SegmentedControl/SegmentedControlDivider.js +23 -0
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts +14 -20
- package/dist/SegmentedControl/SegmentedControlIconButton.js +132 -219
- package/dist/SegmentedControl/index.d.ts +6 -5
- package/dist/Select/Select-ab428dc7.css +1 -1
- package/dist/Select/Select-ab428dc7.css.map +1 -1
- package/dist/Select/Select.d.ts +14 -13
- package/dist/Select/Select.js +192 -234
- package/dist/Select/Select.module.css.js +9 -5
- package/dist/Select/index.d.ts +2 -3
- package/dist/SelectPanel/SelectPanel-00796bf3.css +2 -0
- package/dist/SelectPanel/SelectPanel-00796bf3.css.map +1 -0
- package/dist/SelectPanel/SelectPanel.d.ts +122 -76
- package/dist/SelectPanel/SelectPanel.js +677 -740
- package/dist/SelectPanel/SelectPanel.module.css.js +26 -5
- package/dist/SelectPanel/SelectPanelMessage.d.ts +22 -21
- package/dist/SelectPanel/SelectPanelMessage.js +80 -35
- package/dist/SelectPanel/index.d.ts +3 -4
- package/dist/SideNav-baa2364d.css +1 -1
- package/dist/SideNav-baa2364d.css.map +1 -1
- package/dist/SideNav.d.ts +46 -25
- package/dist/SideNav.js +93 -50
- package/dist/SideNav.module.css.js +11 -5
- package/dist/Skeleton/SkeletonBox-6305aba6.css +2 -0
- package/dist/Skeleton/SkeletonBox-6305aba6.css.map +1 -0
- package/dist/Skeleton/SkeletonBox.d.ts +11 -11
- package/dist/Skeleton/SkeletonBox.js +100 -83
- package/dist/Skeleton/SkeletonBox.module.css.js +4 -5
- package/dist/Skeleton/index.d.ts +2 -5
- package/dist/Skeleton/skeleton-bdbe6bf2.css +2 -0
- package/dist/Skeleton/skeleton-bdbe6bf2.css.map +1 -0
- package/dist/Skeleton/skeleton.module.css.js +7 -0
- package/dist/SkeletonAvatar/SkeletonAvatar-e00fff32.css +1 -1
- package/dist/SkeletonAvatar/SkeletonAvatar-e00fff32.css.map +1 -1
- package/dist/SkeletonAvatar/SkeletonAvatar.d.ts +19 -10
- package/dist/SkeletonAvatar/SkeletonAvatar.js +110 -112
- package/dist/SkeletonAvatar/SkeletonAvatar.module.css.js +4 -5
- package/dist/SkeletonAvatar/index.d.ts +2 -3
- package/dist/SkeletonText/SkeletonText-5cf908c1.css +1 -1
- package/dist/SkeletonText/SkeletonText-5cf908c1.css.map +1 -1
- package/dist/SkeletonText/SkeletonText.d.ts +23 -14
- package/dist/SkeletonText/SkeletonText.js +129 -137
- package/dist/SkeletonText/SkeletonText.module.css.js +7 -5
- package/dist/SkeletonText/index.d.ts +2 -3
- package/dist/Spinner/Spinner-2dbceeca.css +1 -1
- package/dist/Spinner/Spinner-2dbceeca.css.map +1 -1
- package/dist/Spinner/Spinner.d.ts +25 -18
- package/dist/Spinner/Spinner.js +185 -135
- package/dist/Spinner/Spinner.module.css.js +8 -5
- package/dist/Spinner/index.d.ts +2 -3
- package/dist/SplitPageLayout/SplitPageLayout.d.ts +17 -19
- package/dist/SplitPageLayout/SplitPageLayout.js +226 -225
- package/dist/SplitPageLayout/index.d.ts +2 -2
- package/dist/Stack/Stack-1790a166.css +2 -0
- package/dist/Stack/Stack-1790a166.css.map +1 -0
- package/dist/Stack/Stack.d.ts +67 -61
- package/dist/Stack/Stack.js +208 -227
- package/dist/Stack/Stack.module.css.js +7 -5
- package/dist/Stack/index.d.ts +7 -4
- package/dist/Stack/index.js +3 -6
- package/dist/StateLabel/StateLabel-cd51ae39.css +2 -0
- package/dist/StateLabel/StateLabel-cd51ae39.css.map +1 -0
- package/dist/StateLabel/StateLabel.d.ts +28 -20
- package/dist/StateLabel/StateLabel.js +110 -109
- package/dist/StateLabel/StateLabel.module.css.js +7 -5
- package/dist/StateLabel/index.d.ts +2 -3
- package/dist/SubNav/SubNav-88128e5c.css +1 -1
- package/dist/SubNav/SubNav-88128e5c.css.map +1 -1
- package/dist/SubNav/SubNav.d.ts +18 -17
- package/dist/SubNav/SubNav.js +163 -199
- package/dist/SubNav/SubNav.module.css.js +10 -5
- package/dist/SubNav/index.d.ts +2 -3
- package/dist/TabNav/TabNav-83c6145e.css +1 -1
- package/dist/TabNav/TabNav-83c6145e.css.map +1 -1
- package/dist/TabNav/TabNav.d.ts +20 -15
- package/dist/TabNav/TabNav.js +164 -201
- package/dist/TabNav/TabNav.module.css.js +9 -5
- package/dist/TabNav/index.d.ts +2 -3
- package/dist/Text/Text-d649cda5.css +2 -0
- package/dist/Text/Text-d649cda5.css.map +1 -0
- package/dist/Text/Text.d.ts +17 -18
- package/dist/Text/Text.js +61 -70
- package/dist/Text/Text.module.css.js +4 -5
- package/dist/Text/index.d.ts +2 -3
- package/dist/TextInput/TextInput-dff8f842.css +2 -0
- package/dist/TextInput/TextInput-dff8f842.css.map +1 -0
- package/dist/TextInput/TextInput.d.ts +52 -42
- package/dist/TextInput/TextInput.js +303 -116
- package/dist/TextInput/TextInput.module.css.js +7 -0
- package/dist/TextInput/index.d.ts +3 -4
- package/dist/TextInputWithTokens/TextInputWithTokens-946ead3e.css +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens-946ead3e.css.map +1 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts +84 -83
- package/dist/TextInputWithTokens/TextInputWithTokens.js +571 -604
- package/dist/TextInputWithTokens/TextInputWithTokens.module.css.js +13 -5
- package/dist/TextInputWithTokens/index.d.ts +2 -3
- package/dist/Textarea/TextArea-2dc51d35.css +2 -0
- package/dist/Textarea/TextArea-2dc51d35.css.map +1 -0
- package/dist/Textarea/TextArea.module.css.js +8 -5
- package/dist/Textarea/Textarea.d.ts +97 -82
- package/dist/Textarea/Textarea.js +239 -148
- package/dist/Textarea/index.d.ts +2 -3
- package/dist/ThemeContext.d.ts +19 -0
- package/dist/ThemeContext.js +8 -0
- package/dist/ThemeProvider.d.ts +25 -26
- package/dist/ThemeProvider.js +77 -217
- package/dist/Timeline/Timeline-b7e6685b.css +2 -0
- package/dist/Timeline/Timeline-b7e6685b.css.map +1 -0
- package/dist/Timeline/Timeline.d.ts +49 -33
- package/dist/Timeline/Timeline.js +277 -233
- package/dist/Timeline/Timeline.module.css.js +13 -5
- package/dist/Timeline/constants.d.ts +2 -0
- package/dist/Timeline/index.d.ts +2 -3
- package/dist/ToggleSwitch/ToggleSwitch-b5866af6.css +2 -0
- package/dist/ToggleSwitch/ToggleSwitch-b5866af6.css.map +1 -0
- package/dist/ToggleSwitch/ToggleSwitch.d.ts +42 -42
- package/dist/ToggleSwitch/ToggleSwitch.js +382 -471
- package/dist/ToggleSwitch/ToggleSwitch.module.css.js +15 -5
- package/dist/ToggleSwitch/index.d.ts +2 -3
- package/dist/Token/IssueLabelToken-10cfada5.css +2 -0
- package/dist/Token/IssueLabelToken-10cfada5.css.map +1 -0
- package/dist/Token/IssueLabelToken.d.ts +11 -10
- package/dist/Token/IssueLabelToken.js +257 -74
- package/dist/Token/IssueLabelToken.module.css.js +7 -5
- package/dist/Token/Token-b3c86dc0.css +2 -0
- package/dist/Token/Token-b3c86dc0.css.map +1 -0
- package/dist/Token/Token.d.ts +13 -11
- package/dist/Token/Token.js +233 -280
- package/dist/Token/Token.module.css.js +8 -5
- package/dist/Token/TokenBase-a805f182.css +2 -0
- package/dist/Token/TokenBase-a805f182.css.map +1 -0
- package/dist/Token/TokenBase.d.ts +35 -40
- package/dist/Token/TokenBase.js +97 -128
- package/dist/Token/TokenBase.module.css.js +4 -5
- package/dist/Token/_RemoveTokenButton-a0d2969b.css +2 -0
- package/dist/Token/_RemoveTokenButton-a0d2969b.css.map +1 -0
- package/dist/Token/_RemoveTokenButton.js +121 -48
- package/dist/Token/_RemoveTokenButton.module.css.js +4 -5
- package/dist/Token/_TokenTextContainer-55ce2de3.css +2 -0
- package/dist/Token/_TokenTextContainer-55ce2de3.css.map +1 -0
- package/dist/Token/_TokenTextContainer.js +53 -65
- package/dist/Token/_TokenTextContainer.module.css.js +7 -5
- package/dist/Token/constants.d.ts +2 -0
- package/dist/Token/constants.js +3 -0
- package/dist/Token/index.d.ts +4 -6
- package/dist/Token/utils.js +6 -0
- package/dist/Tooltip/Tooltip-dca4338d.css +2 -0
- package/dist/Tooltip/Tooltip-dca4338d.css.map +1 -0
- package/dist/Tooltip/Tooltip.d.ts +14 -16
- package/dist/Tooltip/Tooltip.js +127 -57
- package/dist/Tooltip/Tooltip.module.css.js +19 -5
- package/dist/Tooltip/TooltipContext.js +4 -0
- package/dist/TooltipV2/Tooltip-dd983e5b.css +2 -0
- package/dist/TooltipV2/Tooltip-dd983e5b.css.map +1 -0
- package/dist/TooltipV2/Tooltip.d.ts +30 -21
- package/dist/TooltipV2/Tooltip.js +393 -297
- package/dist/TooltipV2/Tooltip.module.css.js +10 -5
- package/dist/TooltipV2/TooltipContext.js +4 -0
- package/dist/TooltipV2/index.d.ts +2 -3
- package/dist/TopicTag/TopicTag-b15f6cf1.css +2 -0
- package/dist/TopicTag/TopicTag-b15f6cf1.css.map +1 -0
- package/dist/TopicTag/TopicTag.d.ts +20 -0
- package/dist/TopicTag/TopicTag.js +47 -0
- package/dist/TopicTag/TopicTag.module.css.js +4 -0
- package/dist/TopicTag/TopicTagGroup-785f4d65.css +2 -0
- package/dist/TopicTag/TopicTagGroup-785f4d65.css.map +1 -0
- package/dist/TopicTag/TopicTagGroup.d.ts +10 -0
- package/dist/TopicTag/TopicTagGroup.js +42 -0
- package/dist/TopicTag/TopicTagGroup.module.css.js +4 -0
- package/dist/TopicTag/index.d.ts +8 -0
- package/dist/TopicTag/index.js +5 -0
- package/dist/TreeView/TreeView-1bf45a33.css +2 -0
- package/dist/TreeView/TreeView-1bf45a33.css.map +1 -0
- package/dist/TreeView/TreeView.d.ts +67 -65
- package/dist/TreeView/TreeView.js +630 -1395
- package/dist/TreeView/TreeView.module.css.js +22 -5
- package/dist/TreeView/index.d.ts +2 -2
- package/dist/TreeView/shared.js +9 -9
- package/dist/TreeView/useRovingTabIndex.d.ts +13 -13
- package/dist/TreeView/useRovingTabIndex.js +145 -202
- package/dist/TreeView/useTreeItemCache.js +69 -0
- package/dist/TreeView/useTreeRovingTabIndex.js +155 -0
- package/dist/TreeView/useTypeahead.js +91 -109
- package/dist/Truncate/Truncate-030d5f52.css +1 -1
- package/dist/Truncate/Truncate-030d5f52.css.map +1 -1
- package/dist/Truncate/Truncate.d.ts +16 -11
- package/dist/Truncate/Truncate.js +97 -34
- package/dist/Truncate/Truncate.module.css.js +4 -5
- package/dist/Truncate/index.d.ts +2 -3
- package/dist/UnderlineNav/UnderlineNav-a06bbc74.css +2 -0
- package/dist/UnderlineNav/UnderlineNav-a06bbc74.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNav.d.ts +25 -20
- package/dist/UnderlineNav/UnderlineNav.js +252 -374
- package/dist/UnderlineNav/UnderlineNav.module.css.js +14 -5
- package/dist/UnderlineNav/UnderlineNavContext.js +3 -9
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css +2 -0
- package/dist/UnderlineNav/UnderlineNavItem-402cd41c.css.map +1 -0
- package/dist/UnderlineNav/UnderlineNavItem.js +121 -159
- package/dist/UnderlineNav/UnderlineNavItem.module.css.js +4 -5
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.d.ts +46 -0
- package/dist/UnderlineNav/UnderlineNavItemsRegistry.js +5 -0
- package/dist/UnderlineNav/index.d.ts +7 -6
- package/dist/UnderlineNav/index.js +4 -7
- package/dist/UnderlineNav/utils.js +7 -0
- package/dist/VisuallyHidden/VisuallyHidden-ce2a3270.css +1 -1
- package/dist/VisuallyHidden/VisuallyHidden-ce2a3270.css.map +1 -1
- package/dist/VisuallyHidden/VisuallyHidden.d.ts +12 -7
- package/dist/VisuallyHidden/VisuallyHidden.js +50 -49
- package/dist/VisuallyHidden/VisuallyHidden.module.css.js +4 -5
- package/dist/VisuallyHidden/index.d.ts +2 -3
- package/dist/_VisuallyHidden-1f156b61.css +2 -0
- package/dist/_VisuallyHidden-1f156b61.css.map +1 -0
- package/dist/_VisuallyHidden.js +49 -62
- package/dist/_VisuallyHidden.module.css.js +4 -5
- package/dist/deprecated/ActionList/Divider-7c6b656a.css +1 -1
- package/dist/deprecated/ActionList/Divider-7c6b656a.css.map +1 -1
- package/dist/deprecated/ActionList/Divider.d.ts +7 -4
- package/dist/deprecated/ActionList/Divider.js +22 -23
- package/dist/deprecated/ActionList/Divider.module.css.js +4 -5
- package/dist/deprecated/ActionList/Group.d.ts +28 -21
- package/dist/deprecated/ActionList/Group.js +42 -50
- package/dist/deprecated/ActionList/Header-493b1d76.css +1 -1
- package/dist/deprecated/ActionList/Header-493b1d76.css.map +1 -1
- package/dist/deprecated/ActionList/Header.d.ts +20 -22
- package/dist/deprecated/ActionList/Header.js +65 -81
- package/dist/deprecated/ActionList/Header.module.css.js +4 -5
- package/dist/deprecated/ActionList/Item-f48bd3ee.css +3 -0
- package/dist/deprecated/ActionList/Item-f48bd3ee.css.map +1 -0
- package/dist/deprecated/ActionList/Item.d.ts +87 -90
- package/dist/deprecated/ActionList/Item.js +304 -352
- package/dist/deprecated/ActionList/Item.module.css.js +17 -5
- package/dist/deprecated/ActionList/List-1ec9d6d9.css +1 -1
- package/dist/deprecated/ActionList/List-1ec9d6d9.css.map +1 -1
- package/dist/deprecated/ActionList/List.d.ts +78 -82
- package/dist/deprecated/ActionList/List.js +149 -197
- package/dist/deprecated/ActionList/List.module.css.js +4 -5
- package/dist/deprecated/ActionList/index.d.ts +12 -13
- package/dist/deprecated/ActionList/index.js +13 -14
- package/dist/deprecated/ActionMenu.d.ts +48 -37
- package/dist/deprecated/ActionMenu.js +157 -191
- package/dist/deprecated/DialogV1/Dialog-dce13989.css +1 -1
- package/dist/deprecated/DialogV1/Dialog-dce13989.css.map +1 -1
- package/dist/deprecated/DialogV1/Dialog.d.ts +29 -23
- package/dist/deprecated/DialogV1/Dialog.js +167 -201
- package/dist/deprecated/DialogV1/Dialog.module.css.js +10 -5
- package/dist/deprecated/DialogV1/index.d.ts +2 -3
- package/dist/deprecated/FilteredSearch/FilteredSearch-d30f5bbc.css +1 -1
- package/dist/deprecated/FilteredSearch/FilteredSearch-d30f5bbc.css.map +1 -1
- package/dist/deprecated/FilteredSearch/FilteredSearch.d.ts +6 -4
- package/dist/deprecated/FilteredSearch/FilteredSearch.js +42 -51
- package/dist/deprecated/FilteredSearch/FilteredSearch.module.css.js +4 -5
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css +1 -1
- package/dist/deprecated/UnderlineNav/UnderlineNav-0c1e0dff.css.map +1 -1
- package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts +22 -14
- package/dist/deprecated/UnderlineNav/UnderlineNav.js +132 -161
- package/dist/deprecated/UnderlineNav/UnderlineNav.module.css.js +13 -5
- package/dist/deprecated/UnderlineNav/index.d.ts +2 -3
- package/dist/deprecated/index.d.ts +14 -26
- package/dist/deprecated/index.js +19 -9
- package/dist/experimental/IssueLabel/IssueLabel-2007d7e7.css +2 -0
- package/dist/experimental/IssueLabel/IssueLabel-2007d7e7.css.map +1 -0
- package/dist/experimental/IssueLabel/IssueLabel.d.ts +15 -15
- package/dist/experimental/IssueLabel/IssueLabel.js +133 -157
- package/dist/experimental/IssueLabel/IssueLabel.module.css.js +4 -5
- package/dist/experimental/IssueLabel/index.d.ts +2 -3
- package/dist/experimental/SelectPanel2/SelectPanel-917fdaef.css +2 -0
- package/dist/experimental/SelectPanel2/SelectPanel-917fdaef.css.map +1 -0
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts +81 -71
- package/dist/experimental/SelectPanel2/SelectPanel.js +422 -953
- package/dist/experimental/SelectPanel2/SelectPanel.module.css.js +31 -5
- package/dist/experimental/SelectPanel2/index.d.ts +2 -2
- package/dist/experimental/Tabs/Tabs.d.ts +13 -0
- package/dist/experimental/Tabs/Tabs.js +90 -0
- package/dist/experimental/Tabs/TabsContext.js +4 -0
- package/dist/experimental/Tabs/index.d.ts +6 -0
- package/dist/experimental/Tabs/types.d.ts +115 -0
- package/dist/experimental/Tabs/useTab.d.ts +9 -0
- package/dist/experimental/Tabs/useTab.js +81 -0
- package/dist/experimental/Tabs/useTabList.d.ts +5 -0
- package/dist/experimental/Tabs/useTabList.js +73 -0
- package/dist/experimental/Tabs/useTabPanel.d.ts +6 -0
- package/dist/experimental/Tabs/useTabPanel.js +30 -0
- package/dist/experimental/Tabs/useTabs.js +9 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css +2 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels-162f9aed.css.map +1 -0
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts +93 -55
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +481 -216
- package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +4 -5
- package/dist/experimental/UnderlinePanels/index.d.ts +2 -4
- package/dist/experimental/hooks/index.d.ts +3 -3
- package/dist/experimental/index.d.ts +55 -48
- package/dist/experimental/index.js +47 -30
- package/dist/hooks/MatchMediaContext.js +4 -0
- package/dist/hooks/index.d.ts +11 -19
- package/dist/hooks/useAnchoredPosition.d.ts +15 -12
- package/dist/hooks/useAnchoredPosition.js +147 -83
- package/dist/hooks/useControllableState.js +84 -57
- package/dist/hooks/useDetails.d.ts +17 -13
- package/dist/hooks/useDetails.js +83 -99
- package/dist/hooks/useDialog.js +140 -178
- package/dist/hooks/useFocusTrap.d.ts +41 -33
- package/dist/hooks/useFocusTrap.js +58 -53
- package/dist/hooks/useFocusZone.d.ts +28 -24
- package/dist/hooks/useFocusZone.js +34 -39
- package/dist/hooks/useId.d.ts +2 -2
- package/dist/hooks/useId.js +13 -16
- package/dist/hooks/useMedia.js +66 -83
- package/dist/hooks/useMenuInitialFocus.d.ts +1 -3
- package/dist/hooks/useMenuInitialFocus.js +80 -63
- package/dist/hooks/useMenuKeyboardNavigation.d.ts +1 -11
- package/dist/hooks/useMenuKeyboardNavigation.js +128 -126
- package/dist/hooks/useMergedRefs.d.ts +52 -0
- package/dist/hooks/useMergedRefs.js +71 -0
- package/dist/hooks/useMnemonics.d.ts +1 -6
- package/dist/hooks/useMnemonics.js +76 -107
- package/dist/hooks/useOnEscapePress.d.ts +4 -2
- package/dist/hooks/useOnEscapePress.js +51 -57
- package/dist/hooks/useOnOutsideClick.d.ts +14 -8
- package/dist/hooks/useOnOutsideClick.js +59 -63
- package/dist/hooks/useOpenAndCloseFocus.d.ts +17 -8
- package/dist/hooks/useOpenAndCloseFocus.js +51 -43
- package/dist/hooks/useOverflow.d.ts +2 -2
- package/dist/hooks/useOverflow.js +31 -36
- package/dist/hooks/useOverlay.d.ts +25 -13
- package/dist/hooks/useOverlay.js +57 -75
- package/dist/hooks/useProvidedRefOrCreate.d.ts +14 -3
- package/dist/hooks/useProvidedRefOrCreate.js +20 -12
- package/dist/hooks/useProvidedStateOrCreate.js +32 -39
- package/dist/hooks/useRefObjectAsForwardedRef.d.ts +17 -3
- package/dist/hooks/useRefObjectAsForwardedRef.js +29 -20
- package/dist/hooks/useRenderForcingRef.d.ts +1 -9
- package/dist/hooks/useRenderForcingRef.js +41 -16
- package/dist/hooks/useResizeObserver.d.ts +8 -6
- package/dist/hooks/useResizeObserver.js +37 -45
- package/dist/hooks/useResponsiveValue.d.ts +9 -17
- package/dist/hooks/useResponsiveValue.js +32 -56
- package/dist/hooks/useSafeTimeout.d.ts +4 -5
- package/dist/hooks/useSafeTimeout.js +60 -30
- package/dist/hooks/useScrollFlash.js +30 -31
- package/dist/hooks/useSlots.d.ts +58 -18
- package/dist/hooks/useSlots.js +83 -68
- package/dist/hooks/useSyncedState.d.ts +7 -4
- package/dist/hooks/useSyncedState.js +36 -37
- package/dist/index.d.ts +126 -146
- package/dist/index.js +98 -84
- package/dist/internal/components/ButtonReset-904f2483.css +1 -1
- package/dist/internal/components/ButtonReset-904f2483.css.map +1 -1
- package/dist/internal/components/ButtonReset.js +44 -50
- package/dist/internal/components/ButtonReset.module.css.js +4 -5
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup-e38b5339.css +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup-e38b5339.css.map +1 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts +25 -33
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +191 -97
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.module.css.js +11 -5
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js +35 -22
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.d.ts +1 -9
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.js +3 -4
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts +10 -12
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js +58 -36
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts +7 -9
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js +28 -20
- package/dist/internal/components/CheckboxOrRadioGroup/index.d.ts +2 -4
- package/dist/internal/components/ConditionalWrapper.js +40 -51
- package/dist/internal/components/InputLabel-985ef80b.css +2 -0
- package/dist/internal/components/InputLabel-985ef80b.css.map +1 -0
- package/dist/internal/components/InputLabel.d.ts +17 -18
- package/dist/internal/components/InputLabel.js +90 -113
- package/dist/internal/components/InputLabel.module.css.js +7 -5
- package/dist/internal/components/InputValidation-dddeaafd.css +1 -1
- package/dist/internal/components/InputValidation-dddeaafd.css.map +1 -1
- package/dist/internal/components/InputValidation.js +95 -87
- package/dist/internal/components/InputValidation.module.css.js +8 -5
- package/dist/internal/components/OverflowObserverProvider.js +156 -0
- package/dist/internal/components/TextInputInnerAction-477e9b99.css +1 -1
- package/dist/internal/components/TextInputInnerAction-477e9b99.css.map +1 -1
- package/dist/internal/components/TextInputInnerAction.d.ts +16 -34
- package/dist/internal/components/TextInputInnerAction.js +132 -172
- package/dist/internal/components/TextInputInnerAction.module.css.js +8 -5
- package/dist/internal/components/TextInputInnerVisualSlot-4a14b955.css +1 -1
- package/dist/internal/components/TextInputInnerVisualSlot-4a14b955.css.map +1 -1
- package/dist/internal/components/TextInputInnerVisualSlot.js +88 -94
- package/dist/internal/components/TextInputInnerVisualSlot.module.css.js +10 -5
- package/dist/internal/components/TextInputWrapper-b2f7f9fa.css +2 -0
- package/dist/internal/components/TextInputWrapper-b2f7f9fa.css.map +1 -0
- package/dist/internal/components/TextInputWrapper.d.ts +29 -34
- package/dist/internal/components/TextInputWrapper.js +194 -228
- package/dist/internal/components/TextInputWrapper.module.css.js +7 -5
- package/dist/internal/components/ThemeProviderBase.js +49 -0
- package/dist/internal/components/UnderlineTabbedInterface-a5cd75c0.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-a5cd75c0.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.js +198 -216
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +10 -5
- package/dist/internal/components/UnstyledTextInput-8270f063.css +1 -1
- package/dist/internal/components/UnstyledTextInput-8270f063.css.map +1 -1
- package/dist/internal/components/UnstyledTextInput.js +39 -47
- package/dist/internal/components/UnstyledTextInput.module.css.js +4 -5
- package/dist/internal/components/ValidationAnimationContainer-04125429.css +1 -1
- package/dist/internal/components/ValidationAnimationContainer-04125429.css.map +1 -1
- package/dist/internal/components/ValidationAnimationContainer.js +60 -66
- package/dist/internal/components/ValidationAnimationContainer.module.css.js +7 -5
- package/dist/internal/hooks/useDevOnlyEffect.js +15 -0
- package/dist/internal/hooks/useEffectCallback.js +34 -38
- package/dist/internal/hooks/useEffectOnce.js +22 -25
- package/dist/internal/hooks/useOverflowObserver.js +55 -0
- package/dist/internal/hooks/useThemeProvider.js +70 -0
- package/dist/internal/internal-types.d.ts +3 -3
- package/dist/internal/utils/getResponsiveAttributes.js +22 -26
- package/dist/internal/utils/hasInteractiveNodes.js +33 -40
- package/dist/legacy-theme/ts/color-schemes.js +4249 -4732
- package/dist/live-region/Announce.d.ts +28 -26
- package/dist/live-region/Announce.js +153 -180
- package/dist/live-region/AriaAlert.d.ts +18 -17
- package/dist/live-region/AriaAlert.js +19 -22
- package/dist/live-region/AriaStatus.d.ts +22 -21
- package/dist/live-region/AriaStatus.js +19 -22
- package/dist/live-region/index.d.ts +4 -7
- package/dist/next/ThemeProvider.d.ts +6 -0
- package/dist/next/ThemeProvider.js +34 -0
- package/dist/next/index.d.ts +5 -3
- package/dist/next/index.js +4 -1
- package/dist/test-helpers.d.ts +2 -0
- package/dist/test-helpers.js +39 -62
- package/dist/theme.d.ts +1125 -1162
- package/dist/theme.js +82 -47
- package/dist/useTheme.d.ts +6 -0
- package/dist/useTheme.js +12 -0
- package/dist/utils/as-slot.d.ts +22 -0
- package/dist/utils/as-slot.js +25 -0
- package/dist/utils/character-counter.js +20 -0
- package/dist/utils/create-component.d.ts +5 -4
- package/dist/utils/create-component.js +14 -16
- package/dist/utils/descendant-registry.d.ts +1 -0
- package/dist/utils/descendant-registry.js +234 -0
- package/dist/utils/environment.js +11 -8
- package/dist/utils/getBreakpointDeclarations.js +8 -10
- package/dist/utils/invariant.js +16 -23
- package/dist/utils/is-slot.d.ts +5 -3
- package/dist/utils/is-slot.js +9 -11
- package/dist/utils/isNumeric.js +2 -3
- package/dist/utils/modern-polymorphic.d.ts +7 -13
- package/dist/utils/modern-polymorphic.js +4 -23
- package/dist/utils/polymorphic.d.ts +24 -33
- package/dist/utils/react-compiler-runtime.js +31 -0
- package/dist/utils/scroll.js +7 -11
- package/dist/utils/theme.js +4 -10
- package/dist/utils/types/AriaRole.d.ts +2 -2
- package/dist/utils/types/ComponentProps.d.ts +2 -2
- package/dist/utils/types/FormValidationStatus.d.ts +2 -2
- package/dist/utils/types/KeyPaths.d.ts +2 -4
- package/dist/utils/types/MandateProps.d.ts +2 -4
- package/dist/utils/types/Merge.d.ts +2 -2
- package/dist/utils/types/Slots.d.ts +6 -6
- package/dist/utils/types/ViewportRangeKeys.d.ts +3 -3
- package/dist/utils/useIsomorphicLayoutEffect.d.ts +5 -4
- package/dist/utils/useIsomorphicLayoutEffect.js +3 -9
- package/dist/utils/warning.js +13 -20
- package/generated/components.json +1675 -216
- package/generated/hooks.json +89 -8
- package/package.json +42 -48
- package/dist/ActionBar/ActionBar-8ed12fe7.css +0 -2
- package/dist/ActionBar/ActionBar-8ed12fe7.css.map +0 -1
- package/dist/ActionBar/ActionBar.d.ts.map +0 -1
- package/dist/ActionBar/disabled.ActionBar.Figma.d.ts +0 -2
- package/dist/ActionBar/disabled.ActionBar.Figma.d.ts.map +0 -1
- package/dist/ActionBar/index.d.ts.map +0 -1
- package/dist/ActionList/ActionList-167cf6c7.css +0 -2
- package/dist/ActionList/ActionList-167cf6c7.css.map +0 -1
- package/dist/ActionList/ActionListContainerContext.d.ts +0 -16
- package/dist/ActionList/ActionListContainerContext.d.ts.map +0 -1
- package/dist/ActionList/Description.d.ts.map +0 -1
- package/dist/ActionList/Divider.d.ts.map +0 -1
- package/dist/ActionList/Group-2c8b5711.css +0 -2
- package/dist/ActionList/Group-2c8b5711.css.map +0 -1
- package/dist/ActionList/Group.d.ts.map +0 -1
- package/dist/ActionList/Heading.d.ts.map +0 -1
- package/dist/ActionList/Item.d.ts +0 -56
- package/dist/ActionList/Item.d.ts.map +0 -1
- package/dist/ActionList/LinkItem.d.ts.map +0 -1
- package/dist/ActionList/List.d.ts +0 -24
- package/dist/ActionList/List.d.ts.map +0 -1
- package/dist/ActionList/Selection.d.ts +0 -6
- package/dist/ActionList/Selection.d.ts.map +0 -1
- package/dist/ActionList/TrailingAction.d.ts.map +0 -1
- package/dist/ActionList/Visuals.d.ts.map +0 -1
- package/dist/ActionList/index.d.ts.map +0 -1
- package/dist/ActionList/shared.d.ts.map +0 -1
- package/dist/ActionMenu/ActionMenu-bb42318d.css +0 -2
- package/dist/ActionMenu/ActionMenu-bb42318d.css.map +0 -1
- package/dist/ActionMenu/ActionMenu.d.ts.map +0 -1
- package/dist/ActionMenu/index.d.ts.map +0 -1
- package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css +0 -2
- package/dist/AnchoredOverlay/AnchoredOverlay-73c1b2d1.css.map +0 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.d.ts.map +0 -1
- package/dist/AnchoredOverlay/index.d.ts.map +0 -1
- package/dist/Autocomplete/Autocomplete.d.ts.map +0 -1
- package/dist/Autocomplete/AutocompleteContext.d.ts +0 -17
- package/dist/Autocomplete/AutocompleteContext.d.ts.map +0 -1
- package/dist/Autocomplete/AutocompleteInput.d.ts.map +0 -1
- package/dist/Autocomplete/AutocompleteMenu.d.ts.map +0 -1
- package/dist/Autocomplete/AutocompleteOverlay.d.ts.map +0 -1
- package/dist/Autocomplete/index.d.ts.map +0 -1
- package/dist/Avatar/Avatar.d.ts.map +0 -1
- package/dist/Avatar/index.d.ts.map +0 -1
- package/dist/Avatar/storyHelpers.d.ts +0 -6
- package/dist/Avatar/storyHelpers.d.ts.map +0 -1
- package/dist/AvatarStack/AvatarStack-802bdd7c.css +0 -2
- package/dist/AvatarStack/AvatarStack-802bdd7c.css.map +0 -1
- package/dist/AvatarStack/AvatarStack.d.ts.map +0 -1
- package/dist/AvatarStack/index.d.ts.map +0 -1
- package/dist/Banner/Banner-c1744c4b.css +0 -2
- package/dist/Banner/Banner-c1744c4b.css.map +0 -1
- package/dist/Banner/Banner.d.ts.map +0 -1
- package/dist/Banner/index.d.ts.map +0 -1
- package/dist/BaseStyles-79fd37c4.css +0 -2
- package/dist/BaseStyles-79fd37c4.css.map +0 -1
- package/dist/BaseStyles.d.ts.map +0 -1
- package/dist/Blankslate/Blankslate-2be5efdc.css +0 -2
- package/dist/Blankslate/Blankslate-2be5efdc.css.map +0 -1
- package/dist/Blankslate/Blankslate.d.ts.map +0 -1
- package/dist/Blankslate/BlankslateContext.d.ts +0 -7
- package/dist/Blankslate/BlankslateContext.d.ts.map +0 -1
- package/dist/Blankslate/index.d.ts.map +0 -1
- package/dist/BranchName/BranchName.d.ts.map +0 -1
- package/dist/BranchName/index.d.ts.map +0 -1
- package/dist/Breadcrumbs/Breadcrumbs-dbfc9d95.css +0 -2
- package/dist/Breadcrumbs/Breadcrumbs-dbfc9d95.css.map +0 -1
- package/dist/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/Breadcrumbs/index.d.ts.map +0 -1
- package/dist/Button/Button.d.ts.map +0 -1
- package/dist/Button/ButtonBase-643c673a.css +0 -2
- package/dist/Button/ButtonBase-643c673a.css.map +0 -1
- package/dist/Button/ButtonBase.d.ts.map +0 -1
- package/dist/Button/IconButton.d.ts.map +0 -1
- package/dist/Button/LinkButton.d.ts.map +0 -1
- package/dist/Button/index.d.ts.map +0 -1
- package/dist/Button/types.d.ts.map +0 -1
- package/dist/ButtonGroup/ButtonGroup-10292330.css +0 -2
- package/dist/ButtonGroup/ButtonGroup-10292330.css.map +0 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts.map +0 -1
- package/dist/ButtonGroup/index.d.ts.map +0 -1
- package/dist/Checkbox/Checkbox-edc5dc3e.css +0 -2
- package/dist/Checkbox/Checkbox-edc5dc3e.css.map +0 -1
- package/dist/Checkbox/Checkbox.d.ts.map +0 -1
- package/dist/Checkbox/index.d.ts.map +0 -1
- package/dist/CheckboxGroup/CheckboxGroup.d.ts.map +0 -1
- package/dist/CheckboxGroup/CheckboxGroupContext.d.ts.map +0 -1
- package/dist/CheckboxGroup/index.d.ts.map +0 -1
- package/dist/CircleBadge/CircleBadge.d.ts.map +0 -1
- package/dist/CircleBadge/index.d.ts.map +0 -1
- package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css +0 -2
- package/dist/ConfirmationDialog/ConfirmationDialog-87ccf595.css.map +0 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +0 -1
- package/dist/ConfirmationDialog/ConfirmationDialog.module.css.js +0 -5
- package/dist/CounterLabel/CounterLabel-44fb5d16.css +0 -2
- package/dist/CounterLabel/CounterLabel-44fb5d16.css.map +0 -1
- package/dist/CounterLabel/CounterLabel.d.ts.map +0 -1
- package/dist/CounterLabel/index.d.ts.map +0 -1
- package/dist/DataTable/DataTable.d.ts.map +0 -1
- package/dist/DataTable/ErrorDialog.d.ts.map +0 -1
- package/dist/DataTable/Pagination-b6f8418c.css +0 -2
- package/dist/DataTable/Pagination-b6f8418c.css.map +0 -1
- package/dist/DataTable/Pagination.d.ts.map +0 -1
- package/dist/DataTable/Table-7f5cb3e4.css +0 -2
- package/dist/DataTable/Table-7f5cb3e4.css.map +0 -1
- package/dist/DataTable/Table.d.ts.map +0 -1
- package/dist/DataTable/__tests__/sorting.test.d.ts +0 -2
- package/dist/DataTable/__tests__/sorting.test.d.ts.map +0 -1
- package/dist/DataTable/column.d.ts.map +0 -1
- package/dist/DataTable/index.d.ts.map +0 -1
- package/dist/DataTable/row.d.ts.map +0 -1
- package/dist/DataTable/sorting.d.ts.map +0 -1
- package/dist/DataTable/storyHelpers.d.ts +0 -4
- package/dist/DataTable/storyHelpers.d.ts.map +0 -1
- package/dist/DataTable/storybook/data.d.ts +0 -41
- package/dist/DataTable/storybook/data.d.ts.map +0 -1
- package/dist/DataTable/useTable.d.ts +0 -42
- package/dist/DataTable/useTable.d.ts.map +0 -1
- package/dist/DataTable/utils.d.ts.map +0 -1
- package/dist/Details/Details.d.ts.map +0 -1
- package/dist/Details/index.d.ts.map +0 -1
- package/dist/Dialog/Dialog-1a61e61a.css +0 -2
- package/dist/Dialog/Dialog-1a61e61a.css.map +0 -1
- package/dist/Dialog/Dialog.d.ts.map +0 -1
- package/dist/FeatureFlags/DefaultFeatureFlags.d.ts.map +0 -1
- package/dist/FeatureFlags/FeatureFlagContext.d.ts +0 -3
- package/dist/FeatureFlags/FeatureFlagContext.d.ts.map +0 -1
- package/dist/FeatureFlags/FeatureFlagScope.d.ts.map +0 -1
- package/dist/FeatureFlags/FeatureFlags.d.ts.map +0 -1
- package/dist/FeatureFlags/index.d.ts.map +0 -1
- package/dist/FeatureFlags/useFeatureFlag.d.ts.map +0 -1
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css +0 -2
- package/dist/FilteredActionList/FilteredActionList-f6c2dc7a.css.map +0 -1
- package/dist/FilteredActionList/FilteredActionList.d.ts.map +0 -1
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css +0 -2
- package/dist/FilteredActionList/FilteredActionListLoaders-a46a8ea4.css.map +0 -1
- package/dist/FilteredActionList/FilteredActionListLoaders.d.ts.map +0 -1
- package/dist/FilteredActionList/index.d.ts.map +0 -1
- package/dist/FilteredActionList/types.d.ts.map +0 -1
- package/dist/FilteredActionList/useAnnouncements.d.ts +0 -6
- package/dist/FilteredActionList/useAnnouncements.d.ts.map +0 -1
- package/dist/Flash/Flash.d.ts.map +0 -1
- package/dist/Flash/index.d.ts.map +0 -1
- package/dist/FormControl/FormControl.d.ts.map +0 -1
- package/dist/FormControl/FormControlCaption.d.ts.map +0 -1
- package/dist/FormControl/FormControlLabel.d.ts.map +0 -1
- package/dist/FormControl/FormControlLeadingVisual.d.ts +0 -7
- package/dist/FormControl/FormControlLeadingVisual.d.ts.map +0 -1
- package/dist/FormControl/_FormControlContext.d.ts.map +0 -1
- package/dist/FormControl/_FormControlValidation.d.ts.map +0 -1
- package/dist/FormControl/index.d.ts.map +0 -1
- package/dist/Header/Header.d.ts.map +0 -1
- package/dist/Header/index.d.ts.map +0 -1
- package/dist/Heading/Heading.d.ts.map +0 -1
- package/dist/Heading/index.d.ts.map +0 -1
- package/dist/Hidden/Hidden.d.ts.map +0 -1
- package/dist/Hidden/index.d.ts.map +0 -1
- package/dist/InlineMessage/InlineMessage-80d97643.css +0 -2
- package/dist/InlineMessage/InlineMessage-80d97643.css.map +0 -1
- package/dist/InlineMessage/InlineMessage.d.ts.map +0 -1
- package/dist/InlineMessage/index.d.ts.map +0 -1
- package/dist/KeybindingHint/KeybindingHint.d.ts.map +0 -1
- package/dist/KeybindingHint/components/Chord.d.ts +0 -5
- package/dist/KeybindingHint/components/Chord.d.ts.map +0 -1
- package/dist/KeybindingHint/components/Key.d.ts +0 -9
- package/dist/KeybindingHint/components/Key.d.ts.map +0 -1
- package/dist/KeybindingHint/components/Sequence.d.ts +0 -5
- package/dist/KeybindingHint/components/Sequence.d.ts.map +0 -1
- package/dist/KeybindingHint/index.d.ts +0 -3
- package/dist/KeybindingHint/index.d.ts.map +0 -1
- package/dist/KeybindingHint/key-names.d.ts +0 -16
- package/dist/KeybindingHint/key-names.d.ts.map +0 -1
- package/dist/KeybindingHint/props.d.ts.map +0 -1
- package/dist/Label/Label.d.ts.map +0 -1
- package/dist/Label/index.d.ts.map +0 -1
- package/dist/LabelGroup/LabelGroup-7d19205a.css +0 -2
- package/dist/LabelGroup/LabelGroup-7d19205a.css.map +0 -1
- package/dist/LabelGroup/LabelGroup.d.ts.map +0 -1
- package/dist/LabelGroup/index.d.ts.map +0 -1
- package/dist/Link/Link-968346ff.css +0 -2
- package/dist/Link/Link-968346ff.css.map +0 -1
- package/dist/Link/Link.d.ts.map +0 -1
- package/dist/Link/index.d.ts.map +0 -1
- package/dist/NavList/NavList-5dc067e3.css +0 -2
- package/dist/NavList/NavList-5dc067e3.css.map +0 -1
- package/dist/NavList/NavList.d.ts.map +0 -1
- package/dist/NavList/index.d.ts.map +0 -1
- package/dist/Octicon/Octicon.d.ts.map +0 -1
- package/dist/Octicon/index.d.ts.map +0 -1
- package/dist/Overlay/Overlay-40e80d0e.css +0 -2
- package/dist/Overlay/Overlay-40e80d0e.css.map +0 -1
- package/dist/Overlay/Overlay.d.ts.map +0 -1
- package/dist/Overlay/index.d.ts.map +0 -1
- package/dist/PageHeader/PageHeader-4e1d8fee.css +0 -2
- package/dist/PageHeader/PageHeader-4e1d8fee.css.map +0 -1
- package/dist/PageHeader/PageHeader.d.ts.map +0 -1
- package/dist/PageHeader/index.d.ts.map +0 -1
- package/dist/PageLayout/PageLayout-1849f083.css +0 -2
- package/dist/PageLayout/PageLayout-1849f083.css.map +0 -1
- package/dist/PageLayout/PageLayout.d.ts.map +0 -1
- package/dist/PageLayout/index.d.ts.map +0 -1
- package/dist/Pagehead/Pagehead.d.ts.map +0 -1
- package/dist/Pagehead/index.d.ts.map +0 -1
- package/dist/Pagination/Pagination.d.ts.map +0 -1
- package/dist/Pagination/index.d.ts.map +0 -1
- package/dist/Pagination/mocks/ReactRouterLink.d.ts +0 -8
- package/dist/Pagination/mocks/ReactRouterLink.d.ts.map +0 -1
- package/dist/Pagination/model.d.ts.map +0 -1
- package/dist/Placeholder.d.ts +0 -9
- package/dist/Placeholder.d.ts.map +0 -1
- package/dist/Popover/Popover-3ba3b962.css +0 -2
- package/dist/Popover/Popover-3ba3b962.css.map +0 -1
- package/dist/Popover/Popover.d.ts.map +0 -1
- package/dist/Popover/index.d.ts.map +0 -1
- package/dist/Portal/Portal.d.ts.map +0 -1
- package/dist/Portal/index.d.ts.map +0 -1
- package/dist/ProgressBar/ProgressBar-d27aca1d.css +0 -2
- package/dist/ProgressBar/ProgressBar-d27aca1d.css.map +0 -1
- package/dist/ProgressBar/ProgressBar.d.ts.map +0 -1
- package/dist/ProgressBar/index.d.ts.map +0 -1
- package/dist/Radio/Radio-df9a5c02.css +0 -2
- package/dist/Radio/Radio-df9a5c02.css.map +0 -1
- package/dist/Radio/Radio.d.ts.map +0 -1
- package/dist/Radio/index.d.ts.map +0 -1
- package/dist/RadioGroup/RadioGroup.d.ts.map +0 -1
- package/dist/RadioGroup/index.d.ts.map +0 -1
- package/dist/RelativeTime/RelativeTime.d.ts.map +0 -1
- package/dist/RelativeTime/index.d.ts.map +0 -1
- package/dist/ScrollableRegion/ScrollableRegion.d.ts.map +0 -1
- package/dist/ScrollableRegion/index.d.ts.map +0 -1
- package/dist/SegmentedControl/SegmentedControl-7f79ab74.css +0 -2
- package/dist/SegmentedControl/SegmentedControl-7f79ab74.css.map +0 -1
- package/dist/SegmentedControl/SegmentedControl.d.ts.map +0 -1
- package/dist/SegmentedControl/SegmentedControlButton.d.ts.map +0 -1
- package/dist/SegmentedControl/SegmentedControlIconButton.d.ts.map +0 -1
- package/dist/SegmentedControl/index.d.ts.map +0 -1
- package/dist/Select/Select.d.ts.map +0 -1
- package/dist/Select/index.d.ts.map +0 -1
- package/dist/SelectPanel/SelectPanel-3ac7e8d0.css +0 -2
- package/dist/SelectPanel/SelectPanel-3ac7e8d0.css.map +0 -1
- package/dist/SelectPanel/SelectPanel.d.ts.map +0 -1
- package/dist/SelectPanel/SelectPanelMessage.d.ts.map +0 -1
- package/dist/SelectPanel/index.d.ts.map +0 -1
- package/dist/SideNav.d.ts.map +0 -1
- package/dist/Skeleton/SkeletonBox-248bfcc3.css +0 -2
- package/dist/Skeleton/SkeletonBox-248bfcc3.css.map +0 -1
- package/dist/Skeleton/SkeletonBox.d.ts.map +0 -1
- package/dist/Skeleton/index.d.ts.map +0 -1
- package/dist/SkeletonAvatar/SkeletonAvatar.d.ts.map +0 -1
- package/dist/SkeletonAvatar/index.d.ts.map +0 -1
- package/dist/SkeletonText/SkeletonText.d.ts.map +0 -1
- package/dist/SkeletonText/index.d.ts.map +0 -1
- package/dist/Spinner/Spinner.d.ts.map +0 -1
- package/dist/Spinner/index.d.ts.map +0 -1
- package/dist/SplitPageLayout/SplitPageLayout.d.ts.map +0 -1
- package/dist/SplitPageLayout/index.d.ts.map +0 -1
- package/dist/Stack/Stack-9e7b935d.css +0 -2
- package/dist/Stack/Stack-9e7b935d.css.map +0 -1
- package/dist/Stack/Stack.d.ts.map +0 -1
- package/dist/Stack/index.d.ts.map +0 -1
- package/dist/StateLabel/StateLabel-b586b0bc.css +0 -2
- package/dist/StateLabel/StateLabel-b586b0bc.css.map +0 -1
- package/dist/StateLabel/StateLabel.d.ts.map +0 -1
- package/dist/StateLabel/index.d.ts.map +0 -1
- package/dist/SubNav/SubNav.d.ts.map +0 -1
- package/dist/SubNav/index.d.ts.map +0 -1
- package/dist/TabNav/TabNav.d.ts.map +0 -1
- package/dist/TabNav/index.d.ts.map +0 -1
- package/dist/Text/Text-ca7603b7.css +0 -2
- package/dist/Text/Text-ca7603b7.css.map +0 -1
- package/dist/Text/Text.d.ts.map +0 -1
- package/dist/Text/index.d.ts.map +0 -1
- package/dist/TextInput/TextInput.d.ts.map +0 -1
- package/dist/TextInput/index.d.ts.map +0 -1
- package/dist/TextInputWithTokens/TextInputWithTokens.d.ts.map +0 -1
- package/dist/TextInputWithTokens/index.d.ts.map +0 -1
- package/dist/Textarea/TextArea-54099020.css +0 -2
- package/dist/Textarea/TextArea-54099020.css.map +0 -1
- package/dist/Textarea/Textarea.d.ts.map +0 -1
- package/dist/Textarea/index.d.ts.map +0 -1
- package/dist/ThemeProvider.d.ts.map +0 -1
- package/dist/Timeline/Timeline-116393ee.css +0 -2
- package/dist/Timeline/Timeline-116393ee.css.map +0 -1
- package/dist/Timeline/Timeline.d.ts.map +0 -1
- package/dist/Timeline/index.d.ts.map +0 -1
- package/dist/ToggleSwitch/ToggleSwitch-d5c8dc81.css +0 -2
- package/dist/ToggleSwitch/ToggleSwitch-d5c8dc81.css.map +0 -1
- package/dist/ToggleSwitch/ToggleSwitch.d.ts.map +0 -1
- package/dist/ToggleSwitch/ToggleSwitchStoryWrapper.d.ts +0 -4
- package/dist/ToggleSwitch/ToggleSwitchStoryWrapper.d.ts.map +0 -1
- package/dist/ToggleSwitch/index.d.ts.map +0 -1
- package/dist/Token/IssueLabelToken-a5fe569e.css +0 -2
- package/dist/Token/IssueLabelToken-a5fe569e.css.map +0 -1
- package/dist/Token/IssueLabelToken.d.ts.map +0 -1
- package/dist/Token/Token-942271b0.css +0 -2
- package/dist/Token/Token-942271b0.css.map +0 -1
- package/dist/Token/Token.d.ts.map +0 -1
- package/dist/Token/TokenBase-57c65c47.css +0 -2
- package/dist/Token/TokenBase-57c65c47.css.map +0 -1
- package/dist/Token/TokenBase.d.ts.map +0 -1
- package/dist/Token/_RemoveTokenButton-c205593b.css +0 -2
- package/dist/Token/_RemoveTokenButton-c205593b.css.map +0 -1
- package/dist/Token/_RemoveTokenButton.d.ts +0 -13
- package/dist/Token/_RemoveTokenButton.d.ts.map +0 -1
- package/dist/Token/_TokenTextContainer-2ab10996.css +0 -2
- package/dist/Token/_TokenTextContainer-2ab10996.css.map +0 -1
- package/dist/Token/_TokenTextContainer.d.ts +0 -5
- package/dist/Token/_TokenTextContainer.d.ts.map +0 -1
- package/dist/Token/index.d.ts.map +0 -1
- package/dist/Tooltip/Tooltip-fffa9948.css +0 -2
- package/dist/Tooltip/Tooltip-fffa9948.css.map +0 -1
- package/dist/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/Tooltip/index.d.ts +0 -3
- package/dist/Tooltip/index.d.ts.map +0 -1
- package/dist/TooltipV2/Tooltip-5a80d7b2.css +0 -2
- package/dist/TooltipV2/Tooltip-5a80d7b2.css.map +0 -1
- package/dist/TooltipV2/Tooltip.d.ts.map +0 -1
- package/dist/TooltipV2/index.d.ts.map +0 -1
- package/dist/TreeView/TreeView-bdf34914.css +0 -2
- package/dist/TreeView/TreeView-bdf34914.css.map +0 -1
- package/dist/TreeView/TreeView.d.ts.map +0 -1
- package/dist/TreeView/index.d.ts.map +0 -1
- package/dist/TreeView/shared.d.ts +0 -5
- package/dist/TreeView/shared.d.ts.map +0 -1
- package/dist/TreeView/useRovingTabIndex.d.ts.map +0 -1
- package/dist/TreeView/useTypeahead.d.ts +0 -8
- package/dist/TreeView/useTypeahead.d.ts.map +0 -1
- package/dist/Truncate/Truncate.d.ts.map +0 -1
- package/dist/Truncate/index.d.ts.map +0 -1
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +0 -2
- package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNav.d.ts.map +0 -1
- package/dist/UnderlineNav/UnderlineNavContext.d.ts +0 -14
- package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +0 -1
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css +0 -2
- package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css.map +0 -1
- package/dist/UnderlineNav/UnderlineNavItem.d.ts +0 -42
- package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +0 -1
- package/dist/UnderlineNav/index.d.ts.map +0 -1
- package/dist/UnderlineNav/styles.d.ts +0 -16
- package/dist/UnderlineNav/styles.d.ts.map +0 -1
- package/dist/UnderlineNav/styles.js +0 -19
- package/dist/UnderlineNav/types.d.ts +0 -10
- package/dist/UnderlineNav/types.d.ts.map +0 -1
- package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +0 -1
- package/dist/VisuallyHidden/index.d.ts.map +0 -1
- package/dist/_VisuallyHidden-5c0a2499.css +0 -2
- package/dist/_VisuallyHidden-5c0a2499.css.map +0 -1
- package/dist/_VisuallyHidden.d.ts +0 -8
- package/dist/_VisuallyHidden.d.ts.map +0 -1
- package/dist/deprecated/ActionList/Divider.d.ts.map +0 -1
- package/dist/deprecated/ActionList/Group.d.ts.map +0 -1
- package/dist/deprecated/ActionList/Header.d.ts.map +0 -1
- package/dist/deprecated/ActionList/Item-cf87f98a.css +0 -3
- package/dist/deprecated/ActionList/Item-cf87f98a.css.map +0 -1
- package/dist/deprecated/ActionList/Item.d.ts.map +0 -1
- package/dist/deprecated/ActionList/List.d.ts.map +0 -1
- package/dist/deprecated/ActionList/index.d.ts.map +0 -1
- package/dist/deprecated/ActionMenu.d.ts.map +0 -1
- package/dist/deprecated/DialogV1/Dialog.d.ts.map +0 -1
- package/dist/deprecated/DialogV1/index.d.ts.map +0 -1
- package/dist/deprecated/FilteredSearch/FilteredSearch.d.ts.map +0 -1
- package/dist/deprecated/FilteredSearch/index.d.ts +0 -3
- package/dist/deprecated/FilteredSearch/index.d.ts.map +0 -1
- package/dist/deprecated/UnderlineNav/UnderlineNav.d.ts.map +0 -1
- package/dist/deprecated/UnderlineNav/index.d.ts.map +0 -1
- package/dist/deprecated/index.d.ts.map +0 -1
- package/dist/deprecated/utils/create-slots.d.ts +0 -21
- package/dist/deprecated/utils/create-slots.d.ts.map +0 -1
- package/dist/experimental/CSSComponent/index.d.ts +0 -3
- package/dist/experimental/CSSComponent/index.d.ts.map +0 -1
- package/dist/experimental/IssueLabel/IssueLabel-d9c2c5cf.css +0 -2
- package/dist/experimental/IssueLabel/IssueLabel-d9c2c5cf.css.map +0 -1
- package/dist/experimental/IssueLabel/IssueLabel.d.ts.map +0 -1
- package/dist/experimental/IssueLabel/getColorFromHex.d.ts +0 -8
- package/dist/experimental/IssueLabel/getColorFromHex.d.ts.map +0 -1
- package/dist/experimental/IssueLabel/getColorFromHex.js +0 -185
- package/dist/experimental/IssueLabel/index.d.ts.map +0 -1
- package/dist/experimental/SelectPanel2/SelectPanel-e919f619.css +0 -2
- package/dist/experimental/SelectPanel2/SelectPanel-e919f619.css.map +0 -1
- package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +0 -1
- package/dist/experimental/SelectPanel2/index.d.ts.map +0 -1
- package/dist/experimental/SelectPanel2/mock-story-data.d.ts +0 -67
- package/dist/experimental/SelectPanel2/mock-story-data.d.ts.map +0 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css +0 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css.map +0 -1
- package/dist/experimental/UnderlinePanels/UnderlinePanels.d.ts.map +0 -1
- package/dist/experimental/UnderlinePanels/index.d.ts.map +0 -1
- package/dist/experimental/hooks/index.d.ts.map +0 -1
- package/dist/experimental/index.d.ts.map +0 -1
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/useAnchoredPosition.d.ts.map +0 -1
- package/dist/hooks/useControllableState.d.ts +0 -35
- package/dist/hooks/useControllableState.d.ts.map +0 -1
- package/dist/hooks/useDetails.d.ts.map +0 -1
- package/dist/hooks/useDialog.d.ts +0 -16
- package/dist/hooks/useDialog.d.ts.map +0 -1
- package/dist/hooks/useFocusTrap.d.ts.map +0 -1
- package/dist/hooks/useFocusZone.d.ts.map +0 -1
- package/dist/hooks/useId.d.ts.map +0 -1
- package/dist/hooks/useIsMacOS.d.ts +0 -7
- package/dist/hooks/useIsMacOS.d.ts.map +0 -1
- package/dist/hooks/useIsMacOS.js +0 -32
- package/dist/hooks/useMedia.d.ts +0 -39
- package/dist/hooks/useMedia.d.ts.map +0 -1
- package/dist/hooks/useMenuInitialFocus.d.ts.map +0 -1
- package/dist/hooks/useMenuKeyboardNavigation.d.ts.map +0 -1
- package/dist/hooks/useMnemonics.d.ts.map +0 -1
- package/dist/hooks/useOnEscapePress.d.ts.map +0 -1
- package/dist/hooks/useOnOutsideClick.d.ts.map +0 -1
- package/dist/hooks/useOpenAndCloseFocus.d.ts.map +0 -1
- package/dist/hooks/useOverflow.d.ts.map +0 -1
- package/dist/hooks/useOverlay.d.ts.map +0 -1
- package/dist/hooks/useProvidedRefOrCreate.d.ts.map +0 -1
- package/dist/hooks/useProvidedStateOrCreate.d.ts +0 -11
- package/dist/hooks/useProvidedStateOrCreate.d.ts.map +0 -1
- package/dist/hooks/useRefObjectAsForwardedRef.d.ts.map +0 -1
- package/dist/hooks/useRenderForcingRef.d.ts.map +0 -1
- package/dist/hooks/useResizeObserver.d.ts.map +0 -1
- package/dist/hooks/useResponsiveValue.d.ts.map +0 -1
- package/dist/hooks/useSafeTimeout.d.ts.map +0 -1
- package/dist/hooks/useScrollFlash.d.ts +0 -7
- package/dist/hooks/useScrollFlash.d.ts.map +0 -1
- package/dist/hooks/useSlots.d.ts.map +0 -1
- package/dist/hooks/useSyncedState.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/components/ButtonReset.d.ts +0 -5
- package/dist/internal/components/ButtonReset.d.ts.map +0 -1
- package/dist/internal/components/Caret.d.ts +0 -15
- package/dist/internal/components/Caret.d.ts.map +0 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.d.ts.map +0 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts +0 -8
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.d.ts.map +0 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupContext.d.ts.map +0 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.d.ts.map +0 -1
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.d.ts.map +0 -1
- package/dist/internal/components/CheckboxOrRadioGroup/index.d.ts.map +0 -1
- package/dist/internal/components/ConditionalWrapper.d.ts +0 -5
- package/dist/internal/components/ConditionalWrapper.d.ts.map +0 -1
- package/dist/internal/components/InputLabel-eb267c58.css +0 -2
- package/dist/internal/components/InputLabel-eb267c58.css.map +0 -1
- package/dist/internal/components/InputLabel.d.ts.map +0 -1
- package/dist/internal/components/InputValidation.d.ts +0 -11
- package/dist/internal/components/InputValidation.d.ts.map +0 -1
- package/dist/internal/components/LiveRegion.d.ts +0 -14
- package/dist/internal/components/LiveRegion.d.ts.map +0 -1
- package/dist/internal/components/LiveRegion.js +0 -130
- package/dist/internal/components/TextInputInnerAction.d.ts.map +0 -1
- package/dist/internal/components/TextInputInnerVisualSlot.d.ts +0 -14
- package/dist/internal/components/TextInputInnerVisualSlot.d.ts.map +0 -1
- package/dist/internal/components/TextInputWrapper-889df5d3.css +0 -2
- package/dist/internal/components/TextInputWrapper-889df5d3.css.map +0 -1
- package/dist/internal/components/TextInputWrapper.d.ts.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface-addc90dd.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-addc90dd.css.map +0 -1
- package/dist/internal/components/UnderlineTabbedInterface.d.ts +0 -27
- package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +0 -1
- package/dist/internal/components/UnstyledTextInput.d.ts +0 -4
- package/dist/internal/components/UnstyledTextInput.d.ts.map +0 -1
- package/dist/internal/components/ValidationAnimationContainer.d.ts +0 -8
- package/dist/internal/components/ValidationAnimationContainer.d.ts.map +0 -1
- package/dist/internal/hooks/useEffectCallback.d.ts +0 -8
- package/dist/internal/hooks/useEffectCallback.d.ts.map +0 -1
- package/dist/internal/hooks/useEffectOnce.d.ts +0 -2
- package/dist/internal/hooks/useEffectOnce.d.ts.map +0 -1
- package/dist/internal/hooks/useFocus.d.ts +0 -3
- package/dist/internal/hooks/useFocus.d.ts.map +0 -1
- package/dist/internal/hooks/useMergedRefs.d.ts +0 -2
- package/dist/internal/hooks/useMergedRefs.d.ts.map +0 -1
- package/dist/internal/hooks/useMergedRefs.js +0 -17
- package/dist/internal/internal-types.d.ts.map +0 -1
- package/dist/internal/utils/__tests__/getResponsiveAttributes.test.d.ts +0 -2
- package/dist/internal/utils/__tests__/getResponsiveAttributes.test.d.ts.map +0 -1
- package/dist/internal/utils/__tests__/hasInteractiveNodes.test.d.ts +0 -2
- package/dist/internal/utils/__tests__/hasInteractiveNodes.test.d.ts.map +0 -1
- package/dist/internal/utils/getResponsiveAttributes.d.ts +0 -19
- package/dist/internal/utils/getResponsiveAttributes.d.ts.map +0 -1
- package/dist/internal/utils/getResponsiveControlValues.d.ts +0 -8
- package/dist/internal/utils/getResponsiveControlValues.d.ts.map +0 -1
- package/dist/internal/utils/hasInteractiveNodes.d.ts +0 -11
- package/dist/internal/utils/hasInteractiveNodes.d.ts.map +0 -1
- package/dist/legacy-theme/ts/color-schemes.d.ts +0 -4733
- package/dist/legacy-theme/ts/color-schemes.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/dark.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/dark.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/dark_colorblind.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/dark_colorblind.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/dark_dimmed.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/dark_dimmed.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/dark_high_contrast.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/dark_high_contrast.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/dark_tritanopia.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/dark_tritanopia.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/index.d.ts +0 -4638
- package/dist/legacy-theme/ts/colors/index.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/light.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/light.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/light_colorblind.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/light_colorblind.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/light_high_contrast.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/light_high_contrast.d.ts.map +0 -1
- package/dist/legacy-theme/ts/colors/light_tritanopia.d.ts +0 -517
- package/dist/legacy-theme/ts/colors/light_tritanopia.d.ts.map +0 -1
- package/dist/legacy-theme/ts/index.d.ts +0 -2
- package/dist/legacy-theme/ts/index.d.ts.map +0 -1
- package/dist/live-region/Announce.d.ts.map +0 -1
- package/dist/live-region/AriaAlert.d.ts.map +0 -1
- package/dist/live-region/AriaStatus.d.ts.map +0 -1
- package/dist/live-region/__tests__/test-helpers.d.ts +0 -3
- package/dist/live-region/__tests__/test-helpers.d.ts.map +0 -1
- package/dist/live-region/index.d.ts.map +0 -1
- package/dist/next/index.d.ts.map +0 -1
- package/dist/polyfills/eventListenerSignal.d.ts +0 -7
- package/dist/polyfills/eventListenerSignal.d.ts.map +0 -1
- package/dist/theme.d.ts.map +0 -1
- package/dist/utils/StressTest.d.ts +0 -10
- package/dist/utils/StressTest.d.ts.map +0 -1
- package/dist/utils/__tests__/invariant.test.d.ts +0 -2
- package/dist/utils/__tests__/invariant.test.d.ts.map +0 -1
- package/dist/utils/__tests__/warning.test.d.ts +0 -2
- package/dist/utils/__tests__/warning.test.d.ts.map +0 -1
- package/dist/utils/create-component.d.ts.map +0 -1
- package/dist/utils/deprecate.d.ts +0 -19
- package/dist/utils/deprecate.d.ts.map +0 -1
- package/dist/utils/environment.d.ts +0 -7
- package/dist/utils/environment.d.ts.map +0 -1
- package/dist/utils/form-story-helpers.d.ts +0 -62
- package/dist/utils/form-story-helpers.d.ts.map +0 -1
- package/dist/utils/getBreakpointDeclarations.d.ts +0 -4
- package/dist/utils/getBreakpointDeclarations.d.ts.map +0 -1
- package/dist/utils/invariant.d.ts +0 -3
- package/dist/utils/invariant.d.ts.map +0 -1
- package/dist/utils/is-slot.d.ts.map +0 -1
- package/dist/utils/isNumeric.d.ts +0 -2
- package/dist/utils/isNumeric.d.ts.map +0 -1
- package/dist/utils/modern-polymorphic.d.ts.map +0 -1
- package/dist/utils/polymorphic.d.ts.map +0 -1
- package/dist/utils/scroll.d.ts +0 -6
- package/dist/utils/scroll.d.ts.map +0 -1
- package/dist/utils/test-helpers.d.ts +0 -2
- package/dist/utils/test-helpers.d.ts.map +0 -1
- package/dist/utils/theme.d.ts +0 -20
- package/dist/utils/theme.d.ts.map +0 -1
- package/dist/utils/types/AriaRole.d.ts.map +0 -1
- package/dist/utils/types/ComponentProps.d.ts.map +0 -1
- package/dist/utils/types/Flatten.d.ts +0 -5
- package/dist/utils/types/Flatten.d.ts.map +0 -1
- package/dist/utils/types/FormValidationStatus.d.ts.map +0 -1
- package/dist/utils/types/KeyPaths.d.ts.map +0 -1
- package/dist/utils/types/MandateProps.d.ts.map +0 -1
- package/dist/utils/types/Merge.d.ts.map +0 -1
- package/dist/utils/types/Slots.d.ts.map +0 -1
- package/dist/utils/types/ViewportRangeKeys.d.ts.map +0 -1
- package/dist/utils/types/index.d.ts +0 -7
- package/dist/utils/types/index.d.ts.map +0 -1
- package/dist/utils/use-force-update.d.ts +0 -2
- package/dist/utils/use-force-update.d.ts.map +0 -1
- package/dist/utils/useIsomorphicLayoutEffect.d.ts.map +0 -1
- package/dist/utils/warning.d.ts +0 -4
- package/dist/utils/warning.d.ts.map +0 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"stories": [
|
|
11
11
|
{
|
|
12
12
|
"id": "experimental-components-actionbar--default",
|
|
13
|
-
"code": "() => (\n <ActionBar aria-label=\"Toolbar\">\n <ActionBar.IconButton\n icon={BoldIcon}\n aria-label=\"Bold\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={ItalicIcon}\n aria-label=\"Italic\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={CodeIcon}\n aria-label=\"Code\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={LinkIcon}\n aria-label=\"Link\"\n ></ActionBar.IconButton>\n <ActionBar.Divider />\n <ActionBar.IconButton\n icon={FileAddedIcon}\n aria-label=\"File Added\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={SearchIcon}\n aria-label=\"Search\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={QuoteIcon}\n aria-label=\"Insert Quote\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={ListUnorderedIcon}\n aria-label=\"Unordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={ListOrderedIcon}\n aria-label=\"Ordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={TasklistIcon}\n aria-label=\"Task List\"\n ></ActionBar.IconButton>\n </ActionBar>\n)"
|
|
13
|
+
"code": "() => (\n <ActionBar aria-label=\"Toolbar\">\n <ActionBar.IconButton\n icon={<BoldIcon />}\n aria-label=\"Bold\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<ItalicIcon />}\n aria-label=\"Italic\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<CodeIcon />}\n aria-label=\"Code\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<LinkIcon />}\n aria-label=\"Link\"\n ></ActionBar.IconButton>\n <ActionBar.Divider />\n <ActionBar.IconButton\n icon={<FileAddedIcon />}\n aria-label=\"File Added\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<SearchIcon />}\n aria-label=\"Search\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<QuoteIcon />}\n aria-label=\"Insert Quote\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<ListUnorderedIcon />}\n aria-label=\"Unordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<ListOrderedIcon />}\n aria-label=\"Ordered List\"\n ></ActionBar.IconButton>\n <ActionBar.IconButton\n icon={<TasklistIcon />}\n aria-label=\"Task List\"\n onClick={() => alert('Task List clicked')}\n ></ActionBar.IconButton>\n </ActionBar>\n)"
|
|
14
14
|
}
|
|
15
15
|
],
|
|
16
16
|
"importPath": "@primer/react",
|
|
@@ -98,6 +98,34 @@
|
|
|
98
98
|
"url": "/react/IconButton"
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
+
{
|
|
102
|
+
"name": "ActionBar.Button",
|
|
103
|
+
"props": [
|
|
104
|
+
{
|
|
105
|
+
"name": "children",
|
|
106
|
+
"type": "React.ReactNode",
|
|
107
|
+
"defaultValue": "",
|
|
108
|
+
"required": true,
|
|
109
|
+
"description": "The text content of the button."
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "leadingVisual",
|
|
113
|
+
"type": "Component",
|
|
114
|
+
"defaultValue": "",
|
|
115
|
+
"description": "Provide an octicon to render before the button text. It will also be shown when the button overflows into the menu."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "disabled",
|
|
119
|
+
"type": "boolean",
|
|
120
|
+
"defaultValue": "",
|
|
121
|
+
"description": "Provides a disabled state for the button. The button will remain focusable, and have `aria-disabled` applied."
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"passthrough": {
|
|
125
|
+
"element": "Button",
|
|
126
|
+
"url": "/react/Button"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
101
129
|
{
|
|
102
130
|
"name": "ActionBar.Divider",
|
|
103
131
|
"props": []
|
|
@@ -111,6 +139,41 @@
|
|
|
111
139
|
"defaultValue": ""
|
|
112
140
|
}
|
|
113
141
|
]
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "ActionBar.Menu",
|
|
145
|
+
"props": [
|
|
146
|
+
{
|
|
147
|
+
"name": "aria-label",
|
|
148
|
+
"type": "string",
|
|
149
|
+
"required": true,
|
|
150
|
+
"description": "Accessible label for the menu button."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "icon",
|
|
154
|
+
"type": "Component",
|
|
155
|
+
"required": true,
|
|
156
|
+
"description": "Icon for the menu button."
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "items",
|
|
160
|
+
"type": "ActionBarMenuItemProps[]",
|
|
161
|
+
"required": true,
|
|
162
|
+
"description": "Array of menu items to render in the menu. Each item can be an action, group, or divider."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "overflowIcon",
|
|
166
|
+
"type": "Component | 'none'",
|
|
167
|
+
"required": false,
|
|
168
|
+
"description": "Icon displayed when the menu item is within the overflow menu. If 'none' is provided, no icon will be shown in the overflow menu."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "returnFocusRef",
|
|
172
|
+
"type": "React.RefObject<HTMLElement>",
|
|
173
|
+
"required": false,
|
|
174
|
+
"description": "A ref to an element that should receive focus when the menu is closed."
|
|
175
|
+
}
|
|
176
|
+
]
|
|
114
177
|
}
|
|
115
178
|
]
|
|
116
179
|
},
|
|
@@ -149,6 +212,10 @@
|
|
|
149
212
|
"id": "components-actionlist-features--item-dividers",
|
|
150
213
|
"code": "() => (\n <ActionList showDividers>\n <ActionList.Item>Copy link</ActionList.Item>\n <ActionList.Item>Quote reply</ActionList.Item>\n <ActionList.Item>Edit comment</ActionList.Item>\n </ActionList>\n)"
|
|
151
214
|
},
|
|
215
|
+
{
|
|
216
|
+
"id": "components-actionlist-features--disable-item-gap",
|
|
217
|
+
"code": "() => (\n <FeatureFlags\n flags={{\n primer_react_action_list_item_gap: true,\n }}\n >\n <ActionList.ContainerContext.Provider\n value={{\n container: 'NavList',\n }}\n >\n <Heading as=\"h3\">Default item gap</Heading>\n <ActionList>\n <ActionList.Item>Copy link</ActionList.Item>\n <ActionList.Item>Quote reply</ActionList.Item>\n <ActionList.Item>Edit comment</ActionList.Item>\n </ActionList>\n\n <Heading as=\"h3\">Item gap disabled</Heading>\n <ActionList disableItemGap>\n <ActionList.Item>Copy link</ActionList.Item>\n <ActionList.Item>Quote reply</ActionList.Item>\n <ActionList.Item>Edit comment</ActionList.Item>\n </ActionList>\n </ActionList.ContainerContext.Provider>\n </FeatureFlags>\n)"
|
|
218
|
+
},
|
|
152
219
|
{
|
|
153
220
|
"id": "components-actionlist-features--single-divider",
|
|
154
221
|
"code": "() => (\n <ActionList>\n <ActionList.Item>Copy link</ActionList.Item>\n <ActionList.Item>Quote reply</ActionList.Item>\n <ActionList.Item>Edit comment</ActionList.Item>\n <ActionList.Divider />\n <ActionList.Item variant=\"danger\">Delete file</ActionList.Item>\n </ActionList>\n)"
|
|
@@ -183,7 +250,7 @@
|
|
|
183
250
|
},
|
|
184
251
|
{
|
|
185
252
|
"id": "components-actionlist-features--with-dynamic-content",
|
|
186
|
-
"code": "() => {\n const [isTrue, setIsTrue] = React.useState(false)\n return (\n <
|
|
253
|
+
"code": "() => {\n const [isTrue, setIsTrue] = React.useState(false)\n return (\n <ActionList>\n <ActionList.Item\n onSelect={() => {\n setIsTrue(!isTrue)\n }}\n >\n Activated? {isTrue ? 'Yes' : 'No'}\n </ActionList.Item>\n </ActionList>\n )\n}"
|
|
187
254
|
},
|
|
188
255
|
{
|
|
189
256
|
"id": "components-actionlist-features--disabled-selected-multiselect",
|
|
@@ -227,7 +294,7 @@
|
|
|
227
294
|
},
|
|
228
295
|
{
|
|
229
296
|
"id": "components-actionlist-features--child-with-side-effects",
|
|
230
|
-
"code": "() => {\n const user = users[0]\n const [selected, setSelected] = React.useState(true)\n
|
|
297
|
+
"code": "() => {\n const user = users[0]\n const [selected, setSelected] = React.useState(true)\n return (\n <ActionList\n selectionVariant=\"multiple\"\n role=\"listbox\"\n aria-label=\"Assignees\"\n >\n <ActionList.Item\n selected={selected}\n onSelect={() => setSelected(!selected)}\n role=\"option\"\n >\n <ActionList.LeadingVisual>\n <Avatar src={`https://avatars.githubusercontent.com/${user.login}`} />\n </ActionList.LeadingVisual>\n {user.login}\n <ActionList.Description>\n <SideEffectDescription />\n </ActionList.Description>\n </ActionList.Item>\n </ActionList>\n )\n}"
|
|
231
298
|
},
|
|
232
299
|
{
|
|
233
300
|
"id": "components-actionlist-features--inside-overlay",
|
|
@@ -245,9 +312,21 @@
|
|
|
245
312
|
"id": "components-actionlist-features--with-custom-trailing-visuals",
|
|
246
313
|
"code": "() => (\n <ActionList>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <IssueOpenedIcon />\n </ActionList.LeadingVisual>\n Issues\n <ActionList.TrailingVisual>\n <CounterLabel>20</CounterLabel>\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <GitPullRequestIcon />\n </ActionList.LeadingVisual>\n PRs\n <ActionList.TrailingVisual>\n <CounterLabel>12</CounterLabel>\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <ProjectIcon />\n </ActionList.LeadingVisual>\n Projects\n <ActionList.TrailingVisual>\n <CounterLabel>2</CounterLabel>\n </ActionList.TrailingVisual>\n </ActionList.Item>\n </ActionList>\n)"
|
|
247
314
|
},
|
|
315
|
+
{
|
|
316
|
+
"id": "components-actionlist-features--with-keyboard-shortcuts",
|
|
317
|
+
"code": "() => (\n <ActionList>\n <ActionList.Item>\n New file\n <ActionList.TrailingVisual>\n <KeybindingHint keys=\"Mod+N\" />\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item>\n Open file\n <ActionList.TrailingVisual>\n <KeybindingHint keys=\"Mod+O\" />\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item>\n Save\n <ActionList.TrailingVisual>\n <KeybindingHint keys=\"Mod+S\" />\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Divider />\n <ActionList.Item variant=\"danger\">\n Delete\n <ActionList.TrailingVisual>\n <KeybindingHint keys=\"Mod+D\" />\n </ActionList.TrailingVisual>\n </ActionList.Item>\n </ActionList>\n)"
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
"id": "components-actionlist-features--with-trailing-count",
|
|
321
|
+
"code": "() => (\n <ActionList>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <IssueOpenedIcon />\n </ActionList.LeadingVisual>\n Open issues\n <ActionList.TrailingVisual>\n <CounterLabel>24</CounterLabel>\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <GitPullRequestIcon />\n </ActionList.LeadingVisual>\n Pull requests\n <ActionList.TrailingVisual>\n <CounterLabel>8</CounterLabel>\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <ProjectIcon />\n </ActionList.LeadingVisual>\n Projects\n <ActionList.TrailingVisual>\n <CounterLabel>3</CounterLabel>\n </ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item variant=\"danger\">\n <ActionList.LeadingVisual>\n <AlertIcon />\n </ActionList.LeadingVisual>\n Alerts\n <ActionList.TrailingVisual>\n <CounterLabel>12</CounterLabel>\n </ActionList.TrailingVisual>\n </ActionList.Item>\n </ActionList>\n)"
|
|
322
|
+
},
|
|
248
323
|
{
|
|
249
324
|
"id": "components-actionlist-features--with-trailing-action",
|
|
250
|
-
"code": "() => {\n const [loadingState, setLoadingState] = React.useState(false)\n\n // Auto-toggle every 2.5 seconds to continuously show transitions\n React.useEffect(() => {\n const interval = setInterval(() => {\n setLoadingState((prev) => !prev)\n }, 2500)\n return () => clearInterval(interval)\n }, [])\n return (\n <
|
|
325
|
+
"code": "() => {\n const [loadingState, setLoadingState] = React.useState(false)\n\n // Auto-toggle every 2.5 seconds to continuously show transitions\n React.useEffect(() => {\n const interval = setInterval(() => {\n setLoadingState((prev) => !prev)\n }, 2500)\n return () => clearInterval(interval)\n }, [])\n return (\n <ActionList>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <FileDirectoryIcon />\n </ActionList.LeadingVisual>\n Item 1 (with default TrailingAction)\n <ActionList.TrailingAction\n label=\"Expand sidebar\"\n icon={ArrowLeftIcon}\n />\n </ActionList.Item>\n <ActionList.Item>\n Item 2 (with link TrailingAction)\n <ActionList.TrailingAction\n as=\"a\"\n href=\"#\"\n label=\"Some action 1\"\n icon={ArrowRightIcon}\n />\n </ActionList.Item>\n <ActionList.Item>\n Item 3\n <ActionList.Description>\n This is an inline description.\n </ActionList.Description>\n <ActionList.TrailingAction label=\"Some action 2\" icon={BookIcon} />\n </ActionList.Item>\n <ActionList.Item>\n Item 4\n <ActionList.Description variant=\"block\">\n This is a block description.\n </ActionList.Description>\n <ActionList.TrailingAction label=\"Some action 3\" icon={BookIcon} />\n </ActionList.Item>\n <ActionList.Item>\n Item 5\n <ActionList.Description variant=\"block\">\n This is a block description.\n </ActionList.Description>\n <ActionList.TrailingAction label=\"Some action 4\" />\n </ActionList.Item>\n <ActionList.Item>\n Item 6\n <ActionList.TrailingAction href=\"#\" as=\"a\" label=\"Some action 5\" />\n </ActionList.Item>\n <ActionList.Item>\n Icon button loading state\n <ActionList.Description>\n Shows how IconButton maintains width and centers spinner when loading\n </ActionList.Description>\n <ActionList.TrailingAction\n label=\"Process item\"\n icon={ArrowRightIcon}\n loading\n />\n </ActionList.Item>\n <ActionList.Item>\n Icon button with transitions\n <ActionList.Description>\n Automatically toggles loading state every 2.5 seconds to show\n transitions\n </ActionList.Description>\n <ActionList.TrailingAction\n label=\"Toggle loading\"\n icon={ArrowRightIcon}\n loading={loadingState}\n />\n </ActionList.Item>\n <ActionList.Item>\n Text button loading state\n <ActionList.Description>\n Shows how text button aligns spinner to the right and preserves width\n </ActionList.Description>\n <ActionList.TrailingAction label=\"Save changes\" loading />\n </ActionList.Item>\n <ActionList.Item>\n Text button with transitions\n <ActionList.Description>\n Automatically toggles loading state every 2.5 seconds to show\n transitions\n </ActionList.Description>\n <ActionList.TrailingAction\n label=\"Apply settings\"\n loading={loadingState}\n />\n </ActionList.Item>\n <ActionList.LinkItem href=\"#\">\n LinkItem 1\n <ActionList.Description>\n with TrailingAction this is a long description and should not cause\n horizontal scroll on smaller screen sizes\n </ActionList.Description>\n <ActionList.TrailingAction label=\"Another action\" />\n </ActionList.LinkItem>\n <ActionList.LinkItem href=\"#\">\n LinkItem 2\n <ActionList.Description>\n with TrailingVisual this is a long description and should not cause\n horizontal scroll on smaller screen sizes\n </ActionList.Description>\n <ActionList.TrailingVisual>\n <TableIcon />\n </ActionList.TrailingVisual>\n </ActionList.LinkItem>\n <ActionList.Item inactiveText=\"Unavailable due to an outage\">\n Inactive Item\n <ActionList.Description>With TrailingAction</ActionList.Description>\n <ActionList.TrailingAction\n as=\"a\"\n href=\"#\"\n label=\"Some action 8\"\n icon={ArrowRightIcon}\n />\n </ActionList.Item>\n </ActionList>\n )\n}"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"id": "components-actionlist-features--with-trailing-action-on-group-heading",
|
|
329
|
+
"code": "() => (\n <FeatureFlags\n flags={{\n primer_react_action_list_group_heading_trailing_action: true,\n }}\n >\n <ActionList>\n <ActionList.Group>\n <ActionList.GroupHeading as=\"h3\">\n Custom fields\n <ActionList.GroupHeading.TrailingAction\n label=\"New field\"\n icon={PlusIcon}\n />\n </ActionList.GroupHeading>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <FileDirectoryIcon />\n </ActionList.LeadingVisual>\n Field 1\n </ActionList.Item>\n <ActionList.Item>\n <ActionList.LeadingVisual>\n <FileDirectoryIcon />\n </ActionList.LeadingVisual>\n Field 2\n </ActionList.Item>\n </ActionList.Group>\n <ActionList.Group>\n <ActionList.GroupHeading as=\"h3\" variant=\"filled\">\n Repositories\n <ActionList.GroupHeading.TrailingAction\n as=\"a\"\n href=\"#\"\n label=\"Manage repositories\"\n icon={ProjectIcon}\n />\n </ActionList.GroupHeading>\n <ActionList.Item>primer/react</ActionList.Item>\n <ActionList.Item>primer/primitives</ActionList.Item>\n </ActionList.Group>\n </ActionList>\n </FeatureFlags>\n)"
|
|
251
330
|
},
|
|
252
331
|
{
|
|
253
332
|
"id": "components-actionlist-features--full-variant",
|
|
@@ -256,6 +335,10 @@
|
|
|
256
335
|
{
|
|
257
336
|
"id": "components-actionlist-features--large-item",
|
|
258
337
|
"code": "() => (\n <ActionList>\n <ActionList.Item size=\"large\">Large item</ActionList.Item>\n <ActionList.Item size=\"large\">\n Large item\n <ActionList.Description>With inline description</ActionList.Description>\n </ActionList.Item>\n <ActionList.Item size=\"large\">\n Large item\n <ActionList.Description variant=\"block\">\n With block description\n </ActionList.Description>\n </ActionList.Item>\n </ActionList>\n)"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"id": "components-actionlist-features--small-item",
|
|
341
|
+
"code": "() => (\n <ActionList>\n <ActionList.Item size=\"small\">Small item</ActionList.Item>\n <ActionList.Item size=\"small\">\n Small item\n <ActionList.Description>With inline description</ActionList.Description>\n </ActionList.Item>\n <ActionList.Item size=\"small\">\n Small item\n <ActionList.Description variant=\"block\">\n With block description\n </ActionList.Description>\n </ActionList.Item>\n </ActionList>\n)"
|
|
259
342
|
}
|
|
260
343
|
],
|
|
261
344
|
"importPath": "@primer/react",
|
|
@@ -290,6 +373,12 @@
|
|
|
290
373
|
"type": "AriaRole",
|
|
291
374
|
"defaultValue": "",
|
|
292
375
|
"description": "ARIA role describing the function of the list. `listbox` and `menu` are a common values."
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "disableItemGap",
|
|
379
|
+
"type": "boolean",
|
|
380
|
+
"description": "Disable the gap between items when this `ActionList` is rendered in a `NavList`.",
|
|
381
|
+
"defaultValue": "false"
|
|
293
382
|
}
|
|
294
383
|
],
|
|
295
384
|
"subcomponents": [
|
|
@@ -311,9 +400,9 @@
|
|
|
311
400
|
},
|
|
312
401
|
{
|
|
313
402
|
"name": "size",
|
|
314
|
-
"type": "'medium' | 'large'",
|
|
403
|
+
"type": "'small' | 'medium' | 'large'",
|
|
315
404
|
"defaultValue": "'medium'",
|
|
316
|
-
"description": "The block size of the ActionList
|
|
405
|
+
"description": "The block size of the ActionList item. The `small` size also uses small body text."
|
|
317
406
|
},
|
|
318
407
|
{
|
|
319
408
|
"name": "onSelect",
|
|
@@ -407,6 +496,12 @@
|
|
|
407
496
|
"defaultValue": "false",
|
|
408
497
|
"description": "Indicate whether the item is active. There should never be more than one active item."
|
|
409
498
|
},
|
|
499
|
+
{
|
|
500
|
+
"name": "size",
|
|
501
|
+
"type": "'small' | 'medium' | 'large'",
|
|
502
|
+
"defaultValue": "'medium'",
|
|
503
|
+
"description": "The block size of the ActionList item. The `small` size also uses small body text."
|
|
504
|
+
},
|
|
410
505
|
{
|
|
411
506
|
"name": "ref",
|
|
412
507
|
"type": "React.RefObject<HTMLAnchorElement>"
|
|
@@ -487,6 +582,12 @@
|
|
|
487
582
|
"type": "boolean",
|
|
488
583
|
"defaultValue": "false",
|
|
489
584
|
"description": "Whether the TrailingAction is in a loading state. When true, the TrailingAction will render a spinner instead of an icon. Only available when `as` is 'button'."
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
"name": "tooltipDirection",
|
|
588
|
+
"type": "'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw'",
|
|
589
|
+
"defaultValue": "'w'",
|
|
590
|
+
"description": "Direction of the tooltip shown when hovering over the TrailingAction. Only applies when `icon` is set."
|
|
490
591
|
}
|
|
491
592
|
]
|
|
492
593
|
},
|
|
@@ -731,6 +832,12 @@
|
|
|
731
832
|
"defaultValue": "",
|
|
732
833
|
"description": "Callback that is called when the position of the overlay changes"
|
|
733
834
|
},
|
|
835
|
+
{
|
|
836
|
+
"name": "preventFocusOnClose",
|
|
837
|
+
"type": "boolean",
|
|
838
|
+
"defaultValue": "false",
|
|
839
|
+
"description": "If true, focus will not be returned to the anchor or returnFocusRef when the menu closes. Consumers must manage focus themselves."
|
|
840
|
+
},
|
|
734
841
|
{
|
|
735
842
|
"name": "data-test-id",
|
|
736
843
|
"type": "unknown",
|
|
@@ -968,7 +1075,7 @@
|
|
|
968
1075
|
},
|
|
969
1076
|
{
|
|
970
1077
|
"id": "components-autocomplete-features--with-callback-when-overlay-open-state-changes",
|
|
971
|
-
"code": "() => {\n const [isMenuOpen, setIsMenuOpen] = useState<boolean>(false)\n const onOpenChange = (isOpen: boolean) => {\n setIsMenuOpen(isOpen)\n }\n return (\n <Stack as=\"form\" padding=\"normal\">\n <
|
|
1078
|
+
"code": "() => {\n const [isMenuOpen, setIsMenuOpen] = useState<boolean>(false)\n const onOpenChange = (isOpen: boolean) => {\n setIsMenuOpen(isOpen)\n }\n return (\n <Stack as=\"form\" padding=\"normal\">\n <div className={classes.InputWithStateLabel}>\n <div>\n <FormControl>\n <FormControl.Label id=\"autocompleteLabel\">\n Default label\n </FormControl.Label>\n <Autocomplete>\n <Autocomplete.Input />\n <Autocomplete.Overlay>\n <Autocomplete.Menu\n items={items}\n selectedItemIds={[]}\n onOpenChange={onOpenChange}\n aria-labelledby=\"autocompleteLabel\"\n />\n </Autocomplete.Overlay>\n </Autocomplete>\n </FormControl>\n </div>\n\n <div className={classes.StateLabelInline}>\n The menu is <strong>{isMenuOpen ? 'open' : 'closed'}</strong>\n </div>\n </div>\n </Stack>\n )\n}"
|
|
972
1079
|
},
|
|
973
1080
|
{
|
|
974
1081
|
"id": "components-autocomplete-features--async-loading-of-items",
|
|
@@ -984,11 +1091,11 @@
|
|
|
984
1091
|
},
|
|
985
1092
|
{
|
|
986
1093
|
"id": "components-autocomplete-features--in-overlay-with-custom-scroll-container-ref",
|
|
987
|
-
"code": "() => {\n const scrollContainerRef = useRef<HTMLElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const [isOpen, setIsOpen] = useState(false)\n const [selectedItem, setSelectedItem] = useState<Datum>()\n const handleOpen = () => {\n setIsOpen(true)\n inputRef.current && inputRef.current.focus()\n }\n const selectChange = (item: Datum[] | Datum) => {\n setIsOpen(false)\n if (Array.isArray(item) && item.length) setSelectedItem(item[0])\n triggerRef.current?.focus()\n }\n return (\n <form className={classes.FormPadding}>\n Selected item: {selectedItem ? selectedItem.text : 'none'}\n <AnchoredOverlay\n open={isOpen}\n onOpen={handleOpen}\n onClose={() => setIsOpen(false)}\n width=\"large\"\n focusTrapSettings={{\n initialFocusRef: inputRef,\n }}\n side=\"inside-top\"\n anchorRef={triggerRef}\n renderAnchor={(props) => <Button {...props}
|
|
1094
|
+
"code": "() => {\n const scrollContainerRef = useRef<HTMLElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const triggerRef = useRef<HTMLButtonElement>(null)\n const [isOpen, setIsOpen] = useState(false)\n const [selectedItem, setSelectedItem] = useState<Datum>()\n const handleOpen = () => {\n setIsOpen(true)\n inputRef.current && inputRef.current.focus()\n }\n const selectChange = (item: Datum[] | Datum) => {\n setIsOpen(false)\n if (Array.isArray(item) && item.length) setSelectedItem(item[0])\n triggerRef.current?.focus()\n }\n return (\n <form className={classes.FormPadding}>\n <span id=\"selected-item-status\">\n Selected item: {selectedItem ? selectedItem.text : 'none'}\n </span>\n\n <AnchoredOverlay\n open={isOpen}\n onOpen={handleOpen}\n onClose={() => setIsOpen(false)}\n width=\"large\"\n focusTrapSettings={{\n initialFocusRef: inputRef,\n }}\n side=\"inside-top\"\n anchorRef={triggerRef}\n renderAnchor={(props) => (\n <Button {...props} aria-describedby=\"selected-item-status\">\n open overlay\n </Button>\n )}\n preventOverflow={false}\n >\n <Autocomplete>\n <div className={classes.OverlayFlexCol}>\n <div className={classes.OverlayInputBar}>\n <Autocomplete.Input\n ref={inputRef}\n className={classes.OverlayInput}\n block\n aria-label=\"Search\"\n />\n </div>\n <div\n ref={scrollContainerRef as RefObject<HTMLDivElement>}\n className={classes.OverlayScroll}\n >\n <Autocomplete.Menu\n items={items}\n selectedItemIds={[]}\n customScrollContainerRef={scrollContainerRef}\n aria-labelledby=\"autocompleteLabel\"\n onSelectedChange={selectChange}\n />\n </div>\n </div>\n </Autocomplete>\n </AnchoredOverlay>\n </form>\n )\n}"
|
|
988
1095
|
},
|
|
989
1096
|
{
|
|
990
1097
|
"id": "components-autocomplete-features--in-a-dialog",
|
|
991
|
-
"code": "() => {\n const outerContainerRef = useRef<HTMLDivElement>(null)\n const [mounted, setMounted] = useState(false)\n const [isDialogOpen, setIsDialogOpen] = useState(false)\n useEffect(() => {\n if (outerContainerRef.current instanceof HTMLElement) {\n registerPortalRoot(outerContainerRef.current, 'outerContainer')\n setMounted(true)\n }\n }, [isDialogOpen])\n return (\n <>\n <Button onClick={() => setIsDialogOpen(true)}>Show dialog</Button>\n <Dialog\n aria-label=\"Dialog with autocomplete\"\n id=\"dialog-with-autocomplete\"\n isOpen={isDialogOpen}\n onDismiss={() => setIsDialogOpen(false)}\n >\n <div ref={outerContainerRef}>\n <form className={classes.FormPadding}>\n {mounted ? (\n <FormControl>\n <FormControl.Label id=\"autocompleteLabel\">\n Default label\n </FormControl.Label>\n <Autocomplete>\n <Autocomplete.Input data-testid=\"autocompleteInput\" />\n <Autocomplete.Overlay portalContainerName=\"outerContainer\">\n <Autocomplete.Menu\n items={items}\n selectedItemIds={[]}\n aria-labelledby=\"autocompleteLabel\"\n />\n </Autocomplete.Overlay>\n </Autocomplete>\n </FormControl>\n ) : null}\n </form>\n </div>\n </Dialog>\n <p>\n The Autocomplete.Overlay is portalled to a div inside the Dialog to\n ensure it appears above the dialog in the stacking context.\n </p>\n </>\n )\n}"
|
|
1098
|
+
"code": "() => {\n const outerContainerRef = useRef<HTMLDivElement>(null)\n const [mounted, setMounted] = useState(false)\n const [isDialogOpen, setIsDialogOpen] = useState(false)\n useEffect(() => {\n if (outerContainerRef.current instanceof HTMLElement) {\n registerPortalRoot(outerContainerRef.current, 'outerContainer')\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates\n setMounted(true)\n }\n }, [isDialogOpen])\n return (\n <>\n <Button onClick={() => setIsDialogOpen(true)}>Show dialog</Button>\n <Dialog\n aria-label=\"Dialog with autocomplete\"\n id=\"dialog-with-autocomplete\"\n isOpen={isDialogOpen}\n onDismiss={() => setIsDialogOpen(false)}\n >\n <div ref={outerContainerRef}>\n <form className={classes.FormPadding}>\n {mounted ? (\n <FormControl>\n <FormControl.Label id=\"autocompleteLabel\">\n Default label\n </FormControl.Label>\n <Autocomplete>\n <Autocomplete.Input data-testid=\"autocompleteInput\" />\n <Autocomplete.Overlay portalContainerName=\"outerContainer\">\n <Autocomplete.Menu\n items={items}\n selectedItemIds={[]}\n aria-labelledby=\"autocompleteLabel\"\n />\n </Autocomplete.Overlay>\n </Autocomplete>\n </FormControl>\n ) : null}\n </form>\n </div>\n </Dialog>\n <p>\n The Autocomplete.Overlay is portalled to a div inside the Dialog to\n ensure it appears above the dialog in the stacking context.\n </p>\n </>\n )\n}"
|
|
992
1099
|
}
|
|
993
1100
|
],
|
|
994
1101
|
"importPath": "@primer/react",
|
|
@@ -1131,7 +1238,7 @@
|
|
|
1131
1238
|
},
|
|
1132
1239
|
{
|
|
1133
1240
|
"id": "components-avatar-features--square",
|
|
1134
|
-
"code": "() => (\n <Avatar\n square\n alt=\"primer\"\n src=\"https://avatars.githubusercontent.com/
|
|
1241
|
+
"code": "() => (\n <Avatar\n square\n alt=\"primer\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n)"
|
|
1135
1242
|
},
|
|
1136
1243
|
{
|
|
1137
1244
|
"id": "components-avatar-features--size",
|
|
@@ -1181,35 +1288,35 @@
|
|
|
1181
1288
|
"stories": [
|
|
1182
1289
|
{
|
|
1183
1290
|
"id": "components-avatarstack-features--align-left",
|
|
1184
|
-
"code": "() => (\n <AvatarStack>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1291
|
+
"code": "() => (\n <AvatarStack>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n <Avatar\n alt=\"GitHub logo\"\n src=\"https://avatars.githubusercontent.com/github\"\n />\n <Avatar alt=\"Atom logo\" src=\"https://avatars.githubusercontent.com/atom\" />\n <Avatar\n alt=\"GitHub Desktop logo\"\n src=\"https://avatars.githubusercontent.com/u/13171334?v=4\"\n />\n </AvatarStack>\n)"
|
|
1185
1292
|
},
|
|
1186
1293
|
{
|
|
1187
1294
|
"id": "components-avatarstack-features--align-right",
|
|
1188
|
-
"code": "() => (\n <AvatarStack alignRight>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1295
|
+
"code": "() => (\n <AvatarStack alignRight>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n <Avatar\n alt=\"GitHub logo\"\n src=\"https://avatars.githubusercontent.com/github\"\n />\n <Avatar alt=\"Atom logo\" src=\"https://avatars.githubusercontent.com/atom\" />\n <Avatar\n alt=\"GitHub Desktop logo\"\n src=\"https://avatars.githubusercontent.com/u/13171334?v=4\"\n />\n </AvatarStack>\n)"
|
|
1189
1296
|
},
|
|
1190
1297
|
{
|
|
1191
1298
|
"id": "components-avatarstack-features--disable-expand-on-hover",
|
|
1192
|
-
"code": "() => (\n <AvatarStack disableExpand>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1299
|
+
"code": "() => (\n <AvatarStack disableExpand>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n <Avatar\n alt=\"GitHub logo\"\n src=\"https://avatars.githubusercontent.com/github\"\n />\n <Avatar alt=\"Atom logo\" src=\"https://avatars.githubusercontent.com/atom\" />\n <Avatar\n alt=\"GitHub Desktop logo\"\n src=\"https://avatars.githubusercontent.com/u/13171334?v=4\"\n />\n </AvatarStack>\n)"
|
|
1193
1300
|
},
|
|
1194
1301
|
{
|
|
1195
1302
|
"id": "components-avatarstack-features--custom-size-on-parent",
|
|
1196
|
-
"code": "() => (\n <AvatarStack size={32}>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1303
|
+
"code": "() => (\n <AvatarStack size={32}>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n <Avatar\n alt=\"GitHub logo\"\n src=\"https://avatars.githubusercontent.com/github\"\n />\n <Avatar alt=\"Atom logo\" src=\"https://avatars.githubusercontent.com/atom\" />\n <Avatar\n alt=\"GitHub Desktop logo\"\n src=\"https://avatars.githubusercontent.com/u/13171334?v=4\"\n />\n </AvatarStack>\n)"
|
|
1197
1304
|
},
|
|
1198
1305
|
{
|
|
1199
1306
|
"id": "components-avatarstack-features--custom-size-on-parent-responsive",
|
|
1200
|
-
"code": "() => (\n <AvatarStack\n size={{\n narrow: 32,\n regular: 48,\n wide: 64,\n }}\n >\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1307
|
+
"code": "() => (\n <AvatarStack\n size={{\n narrow: 32,\n regular: 48,\n wide: 64,\n }}\n >\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n <Avatar\n alt=\"GitHub logo\"\n src=\"https://avatars.githubusercontent.com/github\"\n />\n <Avatar alt=\"Atom logo\" src=\"https://avatars.githubusercontent.com/atom\" />\n <Avatar\n alt=\"GitHub Desktop logo\"\n src=\"https://avatars.githubusercontent.com/u/13171334?v=4\"\n />\n </AvatarStack>\n)"
|
|
1201
1308
|
},
|
|
1202
1309
|
{
|
|
1203
1310
|
"id": "components-avatarstack-features--custom-size-on-children",
|
|
1204
|
-
"code": "() => (\n <AvatarStack>\n <Avatar\n size={20}\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1311
|
+
"code": "() => (\n <AvatarStack>\n <Avatar\n size={20}\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n <Avatar\n size={32}\n alt=\"GitHub logo\"\n src=\"https://avatars.githubusercontent.com/github\"\n />\n <Avatar\n size={48}\n alt=\"Atom logo\"\n src=\"https://avatars.githubusercontent.com/atom\"\n />\n <Avatar\n size={64}\n alt=\"GitHub Desktop logo\"\n src=\"https://avatars.githubusercontent.com/u/13171334?v=4\"\n />\n </AvatarStack>\n)"
|
|
1205
1312
|
},
|
|
1206
1313
|
{
|
|
1207
1314
|
"id": "components-avatarstack-features--custom-size-on-children-responsive",
|
|
1208
|
-
"code": "() => (\n <AvatarStack>\n <Avatar\n size={{\n narrow: 16,\n regular: 32,\n wide: 48,\n }}\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1315
|
+
"code": "() => (\n <AvatarStack>\n <Avatar\n size={{\n narrow: 16,\n regular: 32,\n wide: 48,\n }}\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n <Avatar\n size={{\n narrow: 32,\n regular: 48,\n wide: 64,\n }}\n alt=\"GitHub logo\"\n src=\"https://avatars.githubusercontent.com/github\"\n />\n <Avatar\n size={{\n narrow: 48,\n regular: 64,\n wide: 96,\n }}\n alt=\"Atom logo\"\n src=\"https://avatars.githubusercontent.com/atom\"\n />\n <Avatar\n size={{\n narrow: 64,\n regular: 96,\n wide: 120,\n }}\n alt=\"GitHub Desktop logo\"\n src=\"https://avatars.githubusercontent.com/u/13171334?v=4\"\n />\n </AvatarStack>\n)"
|
|
1209
1316
|
},
|
|
1210
1317
|
{
|
|
1211
1318
|
"id": "components-avatarstack-features--with-single-avatar",
|
|
1212
|
-
"code": "() => (\n <AvatarStack>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/
|
|
1319
|
+
"code": "() => (\n <AvatarStack>\n <Avatar\n alt=\"Primer logo\"\n src=\"https://avatars.githubusercontent.com/u/7143434?v=4\"\n />\n </AvatarStack>\n)"
|
|
1213
1320
|
}
|
|
1214
1321
|
],
|
|
1215
1322
|
"importPath": "@primer/react",
|
|
@@ -1232,6 +1339,18 @@
|
|
|
1232
1339
|
"defaultValue": "false",
|
|
1233
1340
|
"description": "Do not spread the avatars on hover"
|
|
1234
1341
|
},
|
|
1342
|
+
{
|
|
1343
|
+
"name": "variant",
|
|
1344
|
+
"type": "'cascade' | 'stack'",
|
|
1345
|
+
"defaultValue": "'cascade'",
|
|
1346
|
+
"description": "The style of overlapping avatars. 'cascade' increases the overlap for 3rd+ avatars, while 'stack' uses a uniform overlap."
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
"name": "shape",
|
|
1350
|
+
"type": "'circle' | 'square'",
|
|
1351
|
+
"defaultValue": "'circle'",
|
|
1352
|
+
"description": "The shape of the avatars."
|
|
1353
|
+
},
|
|
1235
1354
|
{
|
|
1236
1355
|
"name": "size",
|
|
1237
1356
|
"type": "number | { narrow?: number; regular?: number; wide?: number; }",
|
|
@@ -1309,7 +1428,7 @@
|
|
|
1309
1428
|
},
|
|
1310
1429
|
{
|
|
1311
1430
|
"id": "components-banner-features--custom-icon",
|
|
1312
|
-
"code": "() => {\n return (\n <Banner\n title=\"Upsell\"\n description=\"An example banner with a custom icon\"\n
|
|
1431
|
+
"code": "() => {\n return (\n <Banner\n title=\"Upsell\"\n description=\"An example banner with a custom icon\"\n leadingVisual={<CopilotIcon />}\n onDismiss={action('onDismiss')}\n variant=\"upsell\"\n />\n )\n}"
|
|
1313
1432
|
},
|
|
1314
1433
|
{
|
|
1315
1434
|
"id": "components-banner-examples--with-announcement",
|
|
@@ -1340,7 +1459,13 @@
|
|
|
1340
1459
|
{
|
|
1341
1460
|
"name": "icon",
|
|
1342
1461
|
"type": "React.ReactNode",
|
|
1343
|
-
"description": "Provide a custom icon for the Banner. This is only available when `variant` is `info` or `upsell`"
|
|
1462
|
+
"description": "Provide a custom icon for the Banner. This is only available when `variant` is `info` or `upsell`",
|
|
1463
|
+
"deprecated": true
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
"name": "leadingVisual",
|
|
1467
|
+
"type": "React.ReactNode",
|
|
1468
|
+
"description": "Provide a custom leading visual for the Banner. This is only available when `variant` is `info` or `upsell`"
|
|
1344
1469
|
},
|
|
1345
1470
|
{
|
|
1346
1471
|
"name": "onDismiss",
|
|
@@ -1376,6 +1501,12 @@
|
|
|
1376
1501
|
"name": "actionsLayout",
|
|
1377
1502
|
"type": "'default' | 'inline' | 'stacked'",
|
|
1378
1503
|
"description": "Override the responsive layout of the action buttons. 'inline' layout will display the buttons inline with the title and description, while 'stacked' layout will always render the buttons in a new row."
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
"name": "flush",
|
|
1507
|
+
"type": "boolean",
|
|
1508
|
+
"defaultValue": "false",
|
|
1509
|
+
"description": "Full width banner specifically for use within confined spaces, such as dialogs, tables, cards, or boxes where available space is limited."
|
|
1379
1510
|
}
|
|
1380
1511
|
],
|
|
1381
1512
|
"subcomponents": [
|
|
@@ -1704,7 +1835,7 @@
|
|
|
1704
1835
|
},
|
|
1705
1836
|
{
|
|
1706
1837
|
"id": "components-button-features--inactive",
|
|
1707
|
-
"code": "() => (\n <div\n style={{\n display: 'flex',\n flexDirection: 'row',\n gap: '1rem',\n }}\n >\n <Button inactive
|
|
1838
|
+
"code": "() => (\n <div\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n flexDirection: 'row',\n gap: '1rem',\n }}\n >\n <VisuallyHidden id=\"inactive-state\">Inactive</VisuallyHidden>\n <Button inactive aria-describedby=\"inactive-state\">\n Default\n </Button>\n <Button variant=\"primary\" inactive aria-describedby=\"inactive-state\">\n Primary\n </Button>\n <Button variant=\"danger\" inactive aria-describedby=\"inactive-state\">\n Danger\n </Button>\n <Button variant=\"invisible\" inactive aria-describedby=\"inactive-state\">\n Invisible\n </Button>\n </div>\n)"
|
|
1708
1839
|
},
|
|
1709
1840
|
{
|
|
1710
1841
|
"id": "components-button-features--small",
|
|
@@ -1720,7 +1851,7 @@
|
|
|
1720
1851
|
},
|
|
1721
1852
|
{
|
|
1722
1853
|
"id": "components-button-features--loading",
|
|
1723
|
-
"code": "() => <Button loading>Default</Button
|
|
1854
|
+
"code": "() => (\n <div\n style={{\n display: 'flex',\n flexDirection: 'row',\n gap: '1rem',\n }}\n >\n <Button loading>Default</Button>\n <Button variant=\"primary\" loading>\n Primary\n </Button>\n <Button variant=\"danger\" loading>\n Danger\n </Button>\n <Button variant=\"invisible\" loading>\n Invisible\n </Button>\n </div>\n)"
|
|
1724
1855
|
},
|
|
1725
1856
|
{
|
|
1726
1857
|
"id": "components-button-features--loading-custom-announcement",
|
|
@@ -1872,67 +2003,63 @@
|
|
|
1872
2003
|
"stories": [
|
|
1873
2004
|
{
|
|
1874
2005
|
"id": "components-iconbutton--default",
|
|
1875
|
-
"code": "() => <IconButton icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2006
|
+
"code": "() => <IconButton icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
1876
2007
|
},
|
|
1877
2008
|
{
|
|
1878
2009
|
"id": "components-iconbutton-features--primary",
|
|
1879
|
-
"code": "() => <IconButton icon={HeartIcon} variant=\"primary\" aria-label=\"Favorite\"
|
|
2010
|
+
"code": "() => (\n <IconButton icon={<HeartIcon />} variant=\"primary\" aria-label=\"Favorite\" />\n)"
|
|
1880
2011
|
},
|
|
1881
2012
|
{
|
|
1882
2013
|
"id": "components-iconbutton-features--danger",
|
|
1883
|
-
"code": "() => <IconButton icon={HeartIcon} variant=\"danger\" aria-label=\"Favorite\"
|
|
2014
|
+
"code": "() => (\n <IconButton icon={<HeartIcon />} variant=\"danger\" aria-label=\"Favorite\" />\n)"
|
|
1884
2015
|
},
|
|
1885
2016
|
{
|
|
1886
2017
|
"id": "components-iconbutton-features--invisible",
|
|
1887
|
-
"code": "() => <IconButton icon={HeartIcon} variant=\"invisible\" aria-label=\"Favorite\"
|
|
2018
|
+
"code": "() => (\n <IconButton icon={<HeartIcon />} variant=\"invisible\" aria-label=\"Favorite\" />\n)"
|
|
1888
2019
|
},
|
|
1889
2020
|
{
|
|
1890
2021
|
"id": "components-iconbutton-features--disabled",
|
|
1891
|
-
"code": "() => <IconButton disabled icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2022
|
+
"code": "() => <IconButton disabled icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
1892
2023
|
},
|
|
1893
2024
|
{
|
|
1894
2025
|
"id": "components-iconbutton-features--small",
|
|
1895
|
-
"code": "() => <IconButton size=\"small\" icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2026
|
+
"code": "() => <IconButton size=\"small\" icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
1896
2027
|
},
|
|
1897
2028
|
{
|
|
1898
2029
|
"id": "components-iconbutton-features--medium",
|
|
1899
|
-
"code": "() => <IconButton size=\"medium\" icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2030
|
+
"code": "() => <IconButton size=\"medium\" icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
1900
2031
|
},
|
|
1901
2032
|
{
|
|
1902
2033
|
"id": "components-iconbutton-features--large",
|
|
1903
|
-
"code": "() => <IconButton size=\"large\" icon={HeartIcon} aria-label=\"Favorite\" />"
|
|
2034
|
+
"code": "() => <IconButton size=\"large\" icon={<HeartIcon />} aria-label=\"Favorite\" />"
|
|
1904
2035
|
},
|
|
1905
2036
|
{
|
|
1906
2037
|
"id": "components-iconbutton-features--with-description",
|
|
1907
|
-
"code": "() => (\n <IconButton\n icon={InboxIcon}\n aria-label=\"Notifications\"\n description=\"You have no unread notifications.\"\n />\n)"
|
|
2038
|
+
"code": "() => (\n <IconButton\n icon={<InboxIcon />}\n aria-label=\"Notifications\"\n description=\"You have no unread notifications.\"\n />\n)"
|
|
1908
2039
|
},
|
|
1909
2040
|
{
|
|
1910
2041
|
"id": "components-iconbutton-features--external-tooltip",
|
|
1911
|
-
"code": "() => (\n <Tooltip\n text=\"this is a supportive description for icon button\"\n direction=\"se\"\n >\n <IconButton icon={HeartIcon} aria-label=\"HeartIcon\" />\n </Tooltip>\n)"
|
|
1912
|
-
},
|
|
1913
|
-
{
|
|
1914
|
-
"id": "components-iconbutton-features--external-tooltip-version-1",
|
|
1915
|
-
"code": "() => (\n <TooltipV1\n text=\"this is a supportive description for icon button\"\n direction=\"se\"\n >\n <IconButton icon={HeartIcon} aria-label=\"HeartIcon\" />\n </TooltipV1>\n)"
|
|
2042
|
+
"code": "() => (\n <Tooltip\n text=\"this is a supportive description for icon button\"\n direction=\"se\"\n >\n <IconButton icon={<HeartIcon />} aria-label=\"HeartIcon\" />\n </Tooltip>\n)"
|
|
1916
2043
|
},
|
|
1917
2044
|
{
|
|
1918
2045
|
"id": "components-iconbutton-features--as-a-menu-anchor",
|
|
1919
|
-
"code": "() => (\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton icon={ChevronDownIcon} aria-label=\"Something\" />\n </ActionMenu.Anchor>\n\n <ActionMenu.Overlay width=\"medium\">\n <ActionList>\n <ActionList.Item onSelect={() => alert('Copy link clicked')}>\n Copy link\n <ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Quote reply clicked')}>\n Quote reply\n <ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Edit comment clicked')}>\n Edit comment\n <ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Divider />\n <ActionList.Item\n variant=\"danger\"\n onSelect={() => alert('Delete file clicked')}\n >\n Delete file\n <ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual>\n </ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n)"
|
|
2046
|
+
"code": "() => (\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton icon={<ChevronDownIcon />} aria-label=\"Something\" />\n </ActionMenu.Anchor>\n\n <ActionMenu.Overlay width=\"medium\">\n <ActionList>\n <ActionList.Item onSelect={() => alert('Copy link clicked')}>\n Copy link\n <ActionList.TrailingVisual>⌘C</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Quote reply clicked')}>\n Quote reply\n <ActionList.TrailingVisual>⌘Q</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Item onSelect={() => alert('Edit comment clicked')}>\n Edit comment\n <ActionList.TrailingVisual>⌘E</ActionList.TrailingVisual>\n </ActionList.Item>\n <ActionList.Divider />\n <ActionList.Item\n variant=\"danger\"\n onSelect={() => alert('Delete file clicked')}\n >\n Delete file\n <ActionList.TrailingVisual>⌘D</ActionList.TrailingVisual>\n </ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n)"
|
|
1920
2047
|
},
|
|
1921
2048
|
{
|
|
1922
2049
|
"id": "components-iconbutton-features--loading",
|
|
1923
|
-
"code": "() => (\n <IconButton
|
|
2050
|
+
"code": "() => (\n <IconButton\n loading\n icon={<HeartIcon />}\n variant=\"primary\"\n aria-label=\"Primary\"\n />\n)"
|
|
1924
2051
|
},
|
|
1925
2052
|
{
|
|
1926
2053
|
"id": "components-iconbutton-features--loading-trigger",
|
|
1927
|
-
"code": "() => {\n const [isLoading, setIsLoading] = useState(false)\n const handleClick = () => {\n setIsLoading(true)\n setTimeout(() => {\n setIsLoading(false)\n }, 3000)\n }\n return (\n <IconButton\n loading={isLoading}\n onClick={handleClick}\n icon={DownloadIcon}\n aria-label=\"Download\"\n />\n )\n}"
|
|
2054
|
+
"code": "() => {\n const [isLoading, setIsLoading] = useState(false)\n const handleClick = () => {\n setIsLoading(true)\n setTimeout(() => {\n setIsLoading(false)\n }, 3000)\n }\n return (\n <IconButton\n loading={isLoading}\n onClick={handleClick}\n icon={<DownloadIcon />}\n aria-label=\"Download\"\n />\n )\n}"
|
|
1928
2055
|
},
|
|
1929
2056
|
{
|
|
1930
2057
|
"id": "components-iconbutton-features--keybinding-hint-on-description",
|
|
1931
|
-
"code": "() => (\n <IconButton\n icon={InboxIcon}\n aria-label=\"Notifications\"\n description=\"You have unread notifications\"\n keybindingHint=\"G+N\"\n />\n)"
|
|
2058
|
+
"code": "() => (\n <IconButton\n icon={<InboxIcon />}\n aria-label=\"Notifications\"\n description=\"You have unread notifications\"\n keybindingHint=\"G+N\"\n />\n)"
|
|
1932
2059
|
},
|
|
1933
2060
|
{
|
|
1934
2061
|
"id": "components-iconbutton-features--keybinding-hint",
|
|
1935
|
-
"code": "() => <IconButton icon={BoldIcon} aria-label=\"Bold\" keybindingHint=\"Mod+B\"
|
|
2062
|
+
"code": "() => (\n <IconButton icon={<BoldIcon />} aria-label=\"Bold\" keybindingHint=\"Mod+B\" />\n)"
|
|
1936
2063
|
}
|
|
1937
2064
|
],
|
|
1938
2065
|
"importPath": "@primer/react",
|
|
@@ -1973,9 +2100,9 @@
|
|
|
1973
2100
|
},
|
|
1974
2101
|
{
|
|
1975
2102
|
"name": "icon",
|
|
1976
|
-
"type": "
|
|
2103
|
+
"type": "React.ReactNode | React.ComponentType<IconProps> | React.ExoticComponent<IconProps>",
|
|
1977
2104
|
"defaultValue": "",
|
|
1978
|
-
"description": "
|
|
2105
|
+
"description": "Provide an icon component or React node. It will be placed in the center of the button. Use a React element when passing an icon from a Server Component."
|
|
1979
2106
|
},
|
|
1980
2107
|
{
|
|
1981
2108
|
"name": "aria-label",
|
|
@@ -1992,8 +2119,8 @@
|
|
|
1992
2119
|
},
|
|
1993
2120
|
{
|
|
1994
2121
|
"name": "keybindingHint",
|
|
1995
|
-
"type": "string",
|
|
1996
|
-
"description": "Optional keybinding hint to show in the tooltip for this button. See the `KeybindingHint` component documentation for the correct format
|
|
2122
|
+
"type": "string | string[]",
|
|
2123
|
+
"description": "Optional keybinding hint to show in the tooltip for this button. Pass a string for a single shortcut or an array of strings to show multiple shortcuts joined with \"or\". See the `KeybindingHint` component documentation for the correct format. Has no effect if tooltip is overridden or disabled. Does **not** bind any keybindings for this button - this is only for visual hints."
|
|
1997
2124
|
},
|
|
1998
2125
|
{
|
|
1999
2126
|
"name": "tooltipDirection",
|
|
@@ -2049,6 +2176,231 @@
|
|
|
2049
2176
|
],
|
|
2050
2177
|
"subcomponents": []
|
|
2051
2178
|
},
|
|
2179
|
+
"card": {
|
|
2180
|
+
"source": "https://github.com/primer/react/tree/main/packages/react/src/Card",
|
|
2181
|
+
"id": "card",
|
|
2182
|
+
"name": "Card",
|
|
2183
|
+
"status": "draft",
|
|
2184
|
+
"a11yReviewed": false,
|
|
2185
|
+
"importPath": "@primer/react/experimental",
|
|
2186
|
+
"stories": [
|
|
2187
|
+
{
|
|
2188
|
+
"id": "experimental-components-card--default",
|
|
2189
|
+
"code": "() => {\n return (\n <Card>\n <Card.Icon icon={RocketIcon} />\n <Card.Heading>Card Heading</Card.Heading>\n <Card.Description>\n This is a description of the card providing supplemental information.\n </Card.Description>\n <Card.Metadata>\n <PeopleIcon size={16} />3 contributors\n </Card.Metadata>\n </Card>\n )\n}"
|
|
2190
|
+
},
|
|
2191
|
+
{
|
|
2192
|
+
"id": "experimental-components-card-features--with-image",
|
|
2193
|
+
"code": "() => {\n return (\n <Card>\n <Card.Image src=\"https://github.com/octocat.png\" alt=\"Octocat\" />\n <Card.Heading>Card with Image</Card.Heading>\n <Card.Description>\n This card uses an edge-to-edge image instead of an icon.\n </Card.Description>\n </Card>\n )\n}"
|
|
2194
|
+
},
|
|
2195
|
+
{
|
|
2196
|
+
"id": "experimental-components-card-features--compact",
|
|
2197
|
+
"code": "() => {\n return (\n <Card layout=\"compact\">\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n The compact layout uses tighter spacing, an icon without a background\n container, and a smaller title.\n </Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n )\n}"
|
|
2198
|
+
},
|
|
2199
|
+
{
|
|
2200
|
+
"id": "experimental-components-card-features--with-link",
|
|
2201
|
+
"code": "({ fullCardHitArea }) => (\n <Card shadow={false} padding=\"regular\">\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>\n <Card.Link href=\"#primer-react\" fullCardHitArea={fullCardHitArea}>\n primer/react\n </Card.Link>\n </Card.Heading>\n <Card.Description>\n Use fullCardHitArea to make the entire card a link. The Star action\n remains separate.\n </Card.Description>\n <Card.Metadata>\n <Button leadingVisual={StarIcon} size=\"small\">\n Star <VisuallyHidden>primer/react</VisuallyHidden>\n </Button>\n </Card.Metadata>\n <Card.Action>\n <IconButton\n icon={KebabHorizontalIcon}\n aria-label=\"More options for primer/react\"\n variant=\"invisible\"\n />\n </Card.Action>\n </Card>\n)"
|
|
2202
|
+
},
|
|
2203
|
+
{
|
|
2204
|
+
"id": "experimental-components-card-features--with-button",
|
|
2205
|
+
"code": "({ fullCardHitArea }) => {\n const [opened, setOpened] = useState(false)\n return (\n <div className={classes.CardList}>\n <Card layout=\"compact\" padding=\"regular\" shadow={false}>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>\n <Card.Button\n onClick={() => setOpened(true)}\n fullCardHitArea={fullCardHitArea}\n >\n Open repository details\n </Card.Button>\n </Card.Heading>\n <Card.Description>\n Use a button for an action that does not navigate to another page.\n </Card.Description>\n </Card>\n <Card>\n <Card.Heading>\n <Card.Button disabled fullCardHitArea={fullCardHitArea}>\n Repository details unavailable\n </Card.Button>\n </Card.Heading>\n <Card.Description>\n A disabled primary action cannot be activated.\n </Card.Description>\n </Card>\n {opened && (\n <section aria-label=\"Repository details\">\n <h3>primer/react</h3>\n <p>{\"React components for GitHub's Primer Design System.\"}</p>\n <Button onClick={() => setOpened(false)}>\n Close repository details\n </Button>\n </section>\n )}\n </div>\n )\n}"
|
|
2206
|
+
},
|
|
2207
|
+
{
|
|
2208
|
+
"id": "experimental-components-card-features--custom-content",
|
|
2209
|
+
"code": "() => {\n const [pinned, setPinned] = useState<string[]>([])\n return (\n <div className={classes.EqualHeightGrid}>\n {[\n 'primer/react',\n 'primer/primitives-with-a-long-unbroken-repository-name',\n ].map((name, index) => (\n <Card key={name} padding=\"regular\" borderRadius=\"medium\" shadow={false}>\n <div className={classes.ComposedBody}>\n <div className={classes.ComposedHeader}>\n <Card.Heading className={classes.ComposedHeading}>\n <Card.Link href={`#${name}`} fullCardHitArea>\n {name}\n </Card.Link>\n </Card.Heading>\n <IconButton\n icon={PinIcon}\n variant=\"invisible\"\n size=\"small\"\n aria-label={`Pin ${name}`}\n aria-pressed={pinned.includes(name)}\n onClick={() =>\n setPinned((value) =>\n value.includes(name)\n ? value.filter((item) => item !== name)\n : [...value, name],\n )\n }\n />\n </div>\n <Card.Description>\n {index === 0\n ? 'React components.'\n : 'Design tokens for color, spacing, typography, and motion, shared across GitHub interfaces.'}\n </Card.Description>\n <div className={classes.ComposedFooter}>\n <Button size=\"small\" leadingVisual={StarIcon}>\n Star <VisuallyHidden>{name}</VisuallyHidden>\n </Button>\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton\n icon={KebabHorizontalIcon}\n variant=\"invisible\"\n size=\"small\"\n aria-label={`More options for ${name}`}\n />\n </ActionMenu.Anchor>\n <ActionMenu.Overlay>\n <ActionList>\n <ActionList.LinkItem href={`#settings-${name}`}>\n Repository settings\n </ActionList.LinkItem>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n </div>\n </div>\n </Card>\n ))}\n </div>\n )\n}"
|
|
2210
|
+
},
|
|
2211
|
+
{
|
|
2212
|
+
"id": "experimental-components-card-features--with-metadata",
|
|
2213
|
+
"code": "() => {\n return (\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n \"GitHub's design system implemented as React components for building consistent user interfaces.\"\n }\n </Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n )\n}"
|
|
2214
|
+
},
|
|
2215
|
+
{
|
|
2216
|
+
"id": "experimental-components-card-features--with-menu",
|
|
2217
|
+
"code": "() => {\n return (\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n \"GitHub's design system implemented as React components for building consistent user interfaces.\"\n }\n </Card.Description>\n <Card.Action>\n <ActionMenu>\n <ActionMenu.Anchor>\n <IconButton\n icon={KebabHorizontalIcon}\n aria-label=\"More options for primer/react\"\n variant=\"invisible\"\n />\n </ActionMenu.Anchor>\n <ActionMenu.Overlay>\n <ActionList>\n <ActionList.Item>Star</ActionList.Item>\n <ActionList.Item>Watch</ActionList.Item>\n <ActionList.Item>Fork</ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n </Card.Action>\n </Card>\n )\n}"
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
"id": "experimental-components-card-features--standalone-section",
|
|
2221
|
+
"code": "() => (\n <Card as=\"section\">\n <Card.Icon icon={RepoIcon} />\n <Card.Heading>primer/react</Card.Heading>\n <Card.Description>\n {\n 'Standalone cards render as a labelled <section> landmark. aria-labelledby is automatically wired to Card.Heading.'\n }\n </Card.Description>\n </Card>\n)"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
"id": "experimental-components-card-features--in-list",
|
|
2225
|
+
"code": "() => (\n <ul className={classes.CardList} aria-label=\"Repositories\">\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/react</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 1.2k stars\n </Card.Metadata>\n </Card>\n </li>\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/css</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 850 stars\n </Card.Metadata>\n </Card>\n </li>\n <li>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>primer/octicons</Card.Description>\n <Card.Metadata>\n <StarIcon size={16} />\n 2.1k stars\n </Card.Metadata>\n </Card>\n </li>\n </ul>\n)"
|
|
2226
|
+
},
|
|
2227
|
+
{
|
|
2228
|
+
"id": "experimental-components-card-features--interactive-content",
|
|
2229
|
+
"code": "() => {\n const repos = [\n {\n name: 'primer/react',\n },\n {\n name: 'primer/css',\n },\n {\n name: 'primer/octicons',\n },\n ]\n return (\n <ul className={classes.CardList} aria-label=\"Repositories\">\n {repos.map((repo) => (\n <li key={repo.name}>\n <Card>\n <Card.Icon icon={RepoIcon} />\n <Card.Description>{repo.name}</Card.Description>\n <Card.Metadata>\n <Button leadingVisual={StarIcon} size=\"small\">\n Star <VisuallyHidden>{repo.name}</VisuallyHidden>\n </Button>\n <Button leadingVisual={RepoForkedIcon} size=\"small\">\n Fork <VisuallyHidden>{repo.name}</VisuallyHidden>\n </Button>\n </Card.Metadata>\n </Card>\n </li>\n ))}\n </ul>\n )\n}"
|
|
2230
|
+
}
|
|
2231
|
+
],
|
|
2232
|
+
"props": [
|
|
2233
|
+
{
|
|
2234
|
+
"name": "children",
|
|
2235
|
+
"type": "React.ReactNode",
|
|
2236
|
+
"required": true,
|
|
2237
|
+
"description": "The contents of the card. Provide either direct `Card.*` subcomponents (for example `Card.Heading`, `Card.Description`, `Card.Metadata`) for the predefined layout or a custom wrapper for free-form composition. A custom wrapper fills the available card height, allowing a flex-column body with margin-top: auto on footer actions. Grid parents stretch cards by default; when cards are wrapped in list items, consumers must also make the cards fill those items. A card with no children will not render."
|
|
2238
|
+
},
|
|
2239
|
+
{
|
|
2240
|
+
"name": "className",
|
|
2241
|
+
"type": "string",
|
|
2242
|
+
"description": "CSS class name(s) for custom styling."
|
|
2243
|
+
},
|
|
2244
|
+
{
|
|
2245
|
+
"name": "padding",
|
|
2246
|
+
"type": "'none' | 'condensed' | 'regular' | 'spacious' | 'normal'",
|
|
2247
|
+
"defaultValue": "'normal'",
|
|
2248
|
+
"description": "Internal padding: none is 0px, condensed is 8px, regular is 16px, and spacious is 24px in either layout. The default normal padding remains 24px in the default layout and 16px in compact layout for compatibility."
|
|
2249
|
+
},
|
|
2250
|
+
{
|
|
2251
|
+
"name": "shadow",
|
|
2252
|
+
"type": "boolean",
|
|
2253
|
+
"defaultValue": "true",
|
|
2254
|
+
"description": "Whether to show the Card shadow. Set to false for a bordered, shadowless card in dense dashboards."
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
"name": "layout",
|
|
2258
|
+
"type": "'default' | 'compact'",
|
|
2259
|
+
"defaultValue": "'default'",
|
|
2260
|
+
"description": "Compact layout places the icon beside the content, removes its background container, and uses a smaller heading and tighter spacing."
|
|
2261
|
+
},
|
|
2262
|
+
{
|
|
2263
|
+
"name": "borderRadius",
|
|
2264
|
+
"type": "'medium' | 'large'",
|
|
2265
|
+
"defaultValue": "'large'",
|
|
2266
|
+
"description": "Controls the border radius of the Card."
|
|
2267
|
+
},
|
|
2268
|
+
{
|
|
2269
|
+
"name": "as",
|
|
2270
|
+
"type": "'div' | 'section'",
|
|
2271
|
+
"defaultValue": "'div'",
|
|
2272
|
+
"description": "The HTML element to render. Use `'section'` for **standalone** Cards (not inside a list of cards) so screen readers announce the Card as a labelled region. When `Card.Heading` is present, `aria-labelledby` is automatically wired. Use the default `'div'` when the Card is inside an `<li>` of a list of cards."
|
|
2273
|
+
}
|
|
2274
|
+
],
|
|
2275
|
+
"subcomponents": [
|
|
2276
|
+
{
|
|
2277
|
+
"name": "Card.Icon",
|
|
2278
|
+
"props": [
|
|
2279
|
+
{
|
|
2280
|
+
"name": "icon",
|
|
2281
|
+
"type": "React.ElementType",
|
|
2282
|
+
"description": "An Octicon or custom SVG icon to render."
|
|
2283
|
+
},
|
|
2284
|
+
{
|
|
2285
|
+
"name": "aria-label",
|
|
2286
|
+
"type": "string",
|
|
2287
|
+
"description": "Accessible label for the icon. When omitted, the icon is treated as decorative."
|
|
2288
|
+
}
|
|
2289
|
+
]
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
"name": "Card.Image",
|
|
2293
|
+
"props": [
|
|
2294
|
+
{
|
|
2295
|
+
"name": "src",
|
|
2296
|
+
"type": "string",
|
|
2297
|
+
"description": "The image source URL."
|
|
2298
|
+
},
|
|
2299
|
+
{
|
|
2300
|
+
"name": "alt",
|
|
2301
|
+
"type": "string",
|
|
2302
|
+
"defaultValue": "\"\"",
|
|
2303
|
+
"description": "Alt text for accessibility. Defaults to empty string (decorative)."
|
|
2304
|
+
}
|
|
2305
|
+
]
|
|
2306
|
+
},
|
|
2307
|
+
{
|
|
2308
|
+
"name": "Card.Heading",
|
|
2309
|
+
"props": [
|
|
2310
|
+
{
|
|
2311
|
+
"name": "as",
|
|
2312
|
+
"type": "'h2' | 'h3' | 'h4' | 'h5' | 'h6'",
|
|
2313
|
+
"defaultValue": "'h3'",
|
|
2314
|
+
"description": "The heading level to render. When the parent Card uses `as=\"section\"`, the heading's `id` is automatically wired to the section's `aria-labelledby`."
|
|
2315
|
+
}
|
|
2316
|
+
]
|
|
2317
|
+
},
|
|
2318
|
+
{
|
|
2319
|
+
"name": "Card.Link",
|
|
2320
|
+
"props": [
|
|
2321
|
+
{
|
|
2322
|
+
"name": "fullCardHitArea",
|
|
2323
|
+
"type": "boolean",
|
|
2324
|
+
"defaultValue": "false",
|
|
2325
|
+
"description": "Expand the link's hit area over the entire card, with card-wide hover and keyboard focus indicators. By default, only the link itself is clickable and receives a focus ring."
|
|
2326
|
+
},
|
|
2327
|
+
{
|
|
2328
|
+
"name": "href",
|
|
2329
|
+
"type": "string",
|
|
2330
|
+
"required": true,
|
|
2331
|
+
"description": "Navigation destination. Place Card.Link inside Card.Heading. The native link supplies keyboard activation, modifier-click, and browser context menus. Set fullCardHitArea to extend its hit area over the card; use only one expanded Card.Link or Card.Button per card. Do not nest interactive controls inside the link. Secondary native controls can be placed in Card.Action, Card.Metadata, or custom headers and footers; Card layers them above the expanded hit area. When fullCardHitArea is enabled, keep wrappers between the link and Card unpositioned, and note that other card text cannot be selected with a pointer. Leave fullCardHitArea disabled when text selection is needed."
|
|
2332
|
+
},
|
|
2333
|
+
{
|
|
2334
|
+
"name": "children",
|
|
2335
|
+
"type": "React.ReactNode",
|
|
2336
|
+
"required": true,
|
|
2337
|
+
"description": "Descriptive link text, used as the accessible name rather than the entire card contents. Accepts native anchor attributes and forwards its ref to the anchor."
|
|
2338
|
+
}
|
|
2339
|
+
]
|
|
2340
|
+
},
|
|
2341
|
+
{
|
|
2342
|
+
"name": "Card.Button",
|
|
2343
|
+
"props": [
|
|
2344
|
+
{
|
|
2345
|
+
"name": "fullCardHitArea",
|
|
2346
|
+
"type": "boolean",
|
|
2347
|
+
"defaultValue": "false",
|
|
2348
|
+
"description": "Expand the button's hit area over the entire card, with card-wide hover and keyboard focus indicators. By default, only the button itself is clickable and receives a focus ring."
|
|
2349
|
+
},
|
|
2350
|
+
{
|
|
2351
|
+
"name": "children",
|
|
2352
|
+
"type": "React.ReactNode",
|
|
2353
|
+
"required": true,
|
|
2354
|
+
"description": "Descriptive action text. Place Card.Button inside Card.Heading for an action that does not navigate. The native button supplies Enter/Space activation and disabled behavior. Consumers provide the accessible name and onClick handler. Set fullCardHitArea for a whole-card action; use only one expanded Card.Link or Card.Button per card. Put secondary controls outside the button, in Card.Action, Card.Metadata, or custom headers and footers. When fullCardHitArea is enabled, keep wrappers between the button and Card unpositioned. Accepts native button attributes and forwards its ref to the button."
|
|
2355
|
+
},
|
|
2356
|
+
{
|
|
2357
|
+
"name": "type",
|
|
2358
|
+
"type": "'button' | 'submit' | 'reset'",
|
|
2359
|
+
"defaultValue": "'button'",
|
|
2360
|
+
"description": "Native button type. Defaults to button to avoid accidentally submitting a surrounding form."
|
|
2361
|
+
},
|
|
2362
|
+
{
|
|
2363
|
+
"name": "disabled",
|
|
2364
|
+
"type": "boolean",
|
|
2365
|
+
"description": "Disables the button, including its expanded hit area when fullCardHitArea is enabled, and removes it from the tab order. Secondary controls remain independent."
|
|
2366
|
+
}
|
|
2367
|
+
]
|
|
2368
|
+
},
|
|
2369
|
+
{
|
|
2370
|
+
"name": "Card.Description",
|
|
2371
|
+
"props": [
|
|
2372
|
+
{
|
|
2373
|
+
"name": "children",
|
|
2374
|
+
"type": "React.ReactNode",
|
|
2375
|
+
"required": true,
|
|
2376
|
+
"description": "The descriptive text for the card. Rendered inside a `<p>` element so should be flowing text content."
|
|
2377
|
+
}
|
|
2378
|
+
]
|
|
2379
|
+
},
|
|
2380
|
+
{
|
|
2381
|
+
"name": "Card.Action",
|
|
2382
|
+
"props": [
|
|
2383
|
+
{
|
|
2384
|
+
"name": "children",
|
|
2385
|
+
"type": "React.ReactNode",
|
|
2386
|
+
"required": true,
|
|
2387
|
+
"description": "Interactive control for the top-right corner of the card."
|
|
2388
|
+
}
|
|
2389
|
+
]
|
|
2390
|
+
},
|
|
2391
|
+
{
|
|
2392
|
+
"name": "Card.Metadata",
|
|
2393
|
+
"props": [
|
|
2394
|
+
{
|
|
2395
|
+
"name": "children",
|
|
2396
|
+
"type": "React.ReactNode",
|
|
2397
|
+
"required": true,
|
|
2398
|
+
"description": "Metadata content for the bottom of the card. Accepts any content: plain text, icons, or other Primer components."
|
|
2399
|
+
}
|
|
2400
|
+
]
|
|
2401
|
+
}
|
|
2402
|
+
]
|
|
2403
|
+
},
|
|
2052
2404
|
"checkbox": {
|
|
2053
2405
|
"source": "https://github.com/primer/react/tree/main/packages/react/src/Checkbox",
|
|
2054
2406
|
"id": "checkbox",
|
|
@@ -2074,7 +2426,7 @@
|
|
|
2074
2426
|
},
|
|
2075
2427
|
{
|
|
2076
2428
|
"id": "components-checkbox-features--indeterminate",
|
|
2077
|
-
"code": "() => (\n <form>\n
|
|
2429
|
+
"code": "() => {\n const [isIndeterminate, setIsIndeterminate] = useState(true)\n return (\n <form>\n <FormControl>\n <Checkbox\n value=\"default\"\n indeterminate={isIndeterminate}\n onChange={() => {\n setIsIndeterminate(!isIndeterminate)\n }}\n checked={false}\n />\n <FormControl.Label>Default label</FormControl.Label>\n </FormControl>\n </form>\n )\n}"
|
|
2078
2430
|
}
|
|
2079
2431
|
],
|
|
2080
2432
|
"importPath": "@primer/react",
|
|
@@ -2400,20 +2752,27 @@
|
|
|
2400
2752
|
},
|
|
2401
2753
|
{
|
|
2402
2754
|
"id": "components-counterlabel-features--primary-theme",
|
|
2403
|
-
"code": "() => <CounterLabel
|
|
2755
|
+
"code": "() => <CounterLabel variant=\"primary\">12</CounterLabel>"
|
|
2404
2756
|
},
|
|
2405
2757
|
{
|
|
2406
2758
|
"id": "components-counterlabel-features--secondary-theme",
|
|
2407
|
-
"code": "() => <CounterLabel
|
|
2759
|
+
"code": "() => <CounterLabel variant=\"secondary\">12</CounterLabel>"
|
|
2408
2760
|
}
|
|
2409
2761
|
],
|
|
2410
2762
|
"importPath": "@primer/react",
|
|
2411
2763
|
"props": [
|
|
2764
|
+
{
|
|
2765
|
+
"name": "variant",
|
|
2766
|
+
"type": "'primary' | 'secondary'",
|
|
2767
|
+
"defaultValue": "",
|
|
2768
|
+
"description": "Pass in 'primary' for a darker background and inverse text, or 'secondary' for a lighter background and primary text. Omitting the variant prop renders the default counter scheme"
|
|
2769
|
+
},
|
|
2412
2770
|
{
|
|
2413
2771
|
"name": "scheme",
|
|
2414
2772
|
"type": "'primary' | 'secondary'",
|
|
2415
2773
|
"defaultValue": "",
|
|
2416
|
-
"description": "
|
|
2774
|
+
"description": "Use `variant` instead.",
|
|
2775
|
+
"deprecated": true
|
|
2417
2776
|
},
|
|
2418
2777
|
{
|
|
2419
2778
|
"name": "className",
|
|
@@ -2482,8 +2841,48 @@
|
|
|
2482
2841
|
{
|
|
2483
2842
|
"id": "experimental-components-datatable-features--with-pagination",
|
|
2484
2843
|
"code": "() => {\n const pageSize = 10\n const [pageIndex, setPageIndex] = React.useState(0)\n const start = pageIndex * pageSize\n const end = start + pageSize\n const rows = repos.slice(start, end)\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"repositories\">\n Repositories\n </Table.Title>\n <Table.Subtitle as=\"p\" id=\"repositories-subtitle\">\n A subtitle could appear here to give extra context to the data.\n </Table.Subtitle>\n <DataTable\n aria-labelledby=\"repositories\"\n aria-describedby=\"repositories-subtitle\"\n data={rows}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Type',\n field: 'type',\n renderCell: (row) => {\n return <Label>{uppercase(row.type)}</Label>\n },\n },\n {\n header: 'Updated',\n field: 'updatedAt',\n renderCell: (row) => {\n return <RelativeTime date={new Date(row.updatedAt)} />\n },\n },\n {\n header: 'Dependabot',\n field: 'securityFeatures.dependabot',\n renderCell: (row) => {\n return row.securityFeatures.dependabot.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.dependabot.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n {\n header: 'Code scanning',\n field: 'securityFeatures.codeScanning',\n renderCell: (row) => {\n return row.securityFeatures.codeScanning.length > 0 ? (\n <LabelGroup>\n {row.securityFeatures.codeScanning.map((feature) => {\n return <Label key={feature}>{uppercase(feature)}</Label>\n })}\n </LabelGroup>\n ) : null\n },\n },\n ]}\n />\n <Table.Pagination\n aria-label=\"Pagination for Repositories\"\n pageSize={pageSize}\n totalCount={repos.length}\n onChange={({ pageIndex }) => {\n setPageIndex(pageIndex)\n }}\n />\n </Table.Container>\n )\n}"
|
|
2485
|
-
}
|
|
2486
|
-
|
|
2844
|
+
},
|
|
2845
|
+
{
|
|
2846
|
+
"id": "experimental-components-datatable-features--with-groups",
|
|
2847
|
+
"code": "() => {\n const titleId = React.useId()\n const [pageIndex, setPageIndex] = React.useState(0)\n const pageSize = 10\n const allRows = paginationData.flatMap((item) =>\n 'rows' in item ? item.rows : [item],\n )\n const pageRows = new Set(\n allRows\n .slice(pageIndex * pageSize, (pageIndex + 1) * pageSize)\n .map((row) => row.id),\n )\n const data = getPageData(paginationData, pageRows)\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id={titleId}>\n Paginated repositories by visibility\n </Table.Title>\n <DataTable\n aria-labelledby={titleId}\n data={data}\n columns={[\n {\n header: 'Name',\n field: 'name',\n rowHeader: true,\n sortBy: true,\n },\n {\n header: 'Visibility',\n field: 'visibility',\n },\n ]}\n />\n <Table.Pagination\n aria-label=\"Pagination for grouped repositories\"\n pageSize={pageSize}\n totalCount={allRows.length}\n onChange={({ pageIndex }) => setPageIndex(pageIndex)}\n />\n </Table.Container>\n )\n}"
|
|
2848
|
+
},
|
|
2849
|
+
{
|
|
2850
|
+
"id": "experimental-components-datatable-features--with-row-selection",
|
|
2851
|
+
"code": "() => {\n const [selectedRows, setSelectedRows] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set([2]))\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"selectable-repositories\">\n Selectable repositories\n </Table.Title>\n <DataTable\n aria-labelledby=\"selectable-repositories\"\n data={data}\n columns={groupedColumns}\n rowSelection\n selectedRows={selectedRows}\n onSelectionChange={({ selectedRows: nextSelectedRows }) => {\n setSelectedRows(nextSelectedRows)\n }}\n />\n </Table.Container>\n )\n}"
|
|
2852
|
+
},
|
|
2853
|
+
{
|
|
2854
|
+
"id": "experimental-components-datatable-features--with-bulk-actions",
|
|
2855
|
+
"code": "() => {\n const repositories = [\n {\n id: 1,\n name: 'primer/react',\n visibility: 'Public',\n },\n {\n id: 2,\n name: 'primer/css',\n visibility: 'Public',\n },\n {\n id: 3,\n name: 'github/github',\n visibility: 'Internal',\n },\n ]\n const titleId = React.useId()\n const [rows, setRows] = React.useState(repositories)\n const [selectedRows, setSelectedRows] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set([1]))\n const resetButtonRef = React.useRef<HTMLButtonElement>(null)\n return (\n <Table.Container>\n <Table.Title id={titleId}>Repositories</Table.Title>\n <Table.Actions>\n <Button\n ref={resetButtonRef}\n onClick={() => {\n setRows(repositories)\n setSelectedRows(new Set())\n }}\n >\n Reset repositories\n </Button>\n </Table.Actions>\n <DataTable\n aria-labelledby={titleId}\n data={[\n ...rows.filter((row) => row.visibility === 'Internal'),\n {\n groupId: 'public',\n label: 'Public',\n rows: rows.filter((row) => row.visibility === 'Public'),\n },\n ]}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n sortBy: 'alphanumeric',\n },\n {\n header: 'Visibility',\n field: 'visibility',\n },\n ]}\n rowSelection\n selectedRows={selectedRows}\n onSelectionChange={({ selectedRows: next }) => setSelectedRows(next)}\n bulkActionsReturnFocusRef={\n rows.length === 0 ? resetButtonRef : undefined\n }\n collapsibleGroups\n renderBulkActions={({ selectedRows: effectiveIds, clearSelection }) => (\n <>\n <Button\n size=\"small\"\n onClick={() => {\n setRows((current) =>\n current.map((row) =>\n effectiveIds.has(row.id)\n ? {\n ...row,\n visibility: 'Internal',\n }\n : row,\n ),\n )\n clearSelection()\n }}\n >\n Make internal\n </Button>\n <Button\n size=\"small\"\n variant=\"danger\"\n onClick={() => {\n setRows((current) =>\n current.filter((row) => !effectiveIds.has(row.id)),\n )\n clearSelection()\n }}\n >\n Delete selected\n </Button>\n </>\n )}\n />\n </Table.Container>\n )\n}"
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
"id": "experimental-components-datatable-features--with-grouped-row-selection",
|
|
2859
|
+
"code": "() => {\n const [selectedRows, setSelectedRows] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set())\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"selectable-repositories-by-visibility\">\n Selectable repositories by visibility\n </Table.Title>\n <DataTable\n aria-labelledby=\"selectable-repositories-by-visibility\"\n data={repoGroupsWithDisabledRow}\n columns={groupedColumns}\n rowSelection\n selectedRows={selectedRows}\n isRowSelectable={(repo) => repo.id !== 1}\n onSelectionChange={({ selectedRows: nextSelectedRows }) => {\n setSelectedRows(nextSelectedRows)\n }}\n />\n </Table.Container>\n )\n}"
|
|
2860
|
+
},
|
|
2861
|
+
{
|
|
2862
|
+
"id": "experimental-components-datatable-features--with-standalone-and-grouped-row-selection",
|
|
2863
|
+
"code": "() => {\n const [selectedRows, setSelectedRows] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set())\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"selectable-mixed-repositories\">\n Selectable standalone and grouped repositories\n </Table.Title>\n <DataTable\n aria-labelledby=\"selectable-mixed-repositories\"\n data={[\n ...data.filter((repo) => repo.type === 'internal'),\n repoGroups[1],\n ]}\n columns={sortableGroupedColumns}\n rowSelection\n selectedRows={selectedRows}\n onSelectionChange={({ selectedRows: nextSelectedRows }) => {\n setSelectedRows(nextSelectedRows)\n }}\n />\n </Table.Container>\n )\n}"
|
|
2864
|
+
},
|
|
2865
|
+
{
|
|
2866
|
+
"id": "experimental-components-datatable-features--with-paginated-row-selection",
|
|
2867
|
+
"code": "() => {\n const titleId = React.useId()\n const [pageIndex, setPageIndex] = React.useState(0)\n const [selectedRows, setSelectedRows] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set())\n const pageSize = 10\n const allRows = paginationData.flatMap((item) =>\n 'rows' in item ? item.rows : [item],\n )\n const pageRows = new Set(\n allRows\n .slice(pageIndex * pageSize, (pageIndex + 1) * pageSize)\n .map((row) => row.id),\n )\n const data = getPageData(paginationData, pageRows)\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id={titleId}>\n Selectable paginated repositories\n </Table.Title>\n <DataTable\n aria-labelledby={titleId}\n data={data}\n columns={[\n {\n header: 'Name',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Visibility',\n field: 'visibility',\n },\n ]}\n rowSelection\n selectedRows={selectedRows}\n onSelectionChange={({ selectedRows }) => setSelectedRows(selectedRows)}\n />\n <Table.Pagination\n aria-label=\"Pagination for selectable repositories\"\n pageSize={pageSize}\n totalCount={allRows.length}\n onChange={({ pageIndex }) => {\n setPageIndex(pageIndex)\n // Selection applies only to the current page.\n setSelectedRows(new Set())\n }}\n />\n </Table.Container>\n )\n}"
|
|
2868
|
+
},
|
|
2869
|
+
{
|
|
2870
|
+
"id": "experimental-components-datatable-features--with-sortable-groups",
|
|
2871
|
+
"code": "() => (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"sortable-repositories-by-visibility\">\n Sortable repositories by visibility\n </Table.Title>\n <DataTable\n aria-labelledby=\"sortable-repositories-by-visibility\"\n data={repoGroups}\n columns={sortableGroupedColumns}\n />\n </Table.Container>\n)"
|
|
2872
|
+
},
|
|
2873
|
+
{
|
|
2874
|
+
"id": "experimental-components-datatable-features--with-collapsible-groups",
|
|
2875
|
+
"code": "() => {\n const titleId = React.useId()\n const [expandedGroups, setExpandedGroups] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set(['public']))\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id={titleId}>\n Repositories\n </Table.Title>\n <Table.Actions>\n <Button onClick={() => setExpandedGroups(new Set())}>\n Collapse all groups\n </Button>\n <Button onClick={() => setExpandedGroups(new Set(['public']))}>\n Expand all groups\n </Button>\n </Table.Actions>\n <DataTable\n aria-labelledby={titleId}\n data={[\n {\n id: 'github',\n name: 'github/github',\n visibility: 'Internal',\n },\n {\n groupId: 'public',\n label: 'Public',\n rows: [\n {\n id: 'react',\n name: 'primer/react',\n visibility: 'Public',\n },\n {\n id: 'css',\n name: 'primer/css',\n visibility: 'Public',\n },\n ],\n },\n ]}\n columns={[\n {\n header: 'Repository',\n field: 'name',\n rowHeader: true,\n },\n {\n header: 'Visibility',\n field: 'visibility',\n },\n ]}\n collapsibleGroups\n expandedGroups={expandedGroups}\n onExpandedGroupsChange={({ expandedGroups }) =>\n setExpandedGroups(expandedGroups)\n }\n rowSelection\n defaultSelectedRows={new Set(['react'])}\n />\n </Table.Container>\n )\n}"
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
"id": "experimental-components-table-features--with-groups",
|
|
2879
|
+
"code": "() => {\n const titleId = React.useId()\n const [pageIndex, setPageIndex] = React.useState(0)\n const pageSize = 10\n const allRows = paginationData.flatMap((item) =>\n 'rows' in item ? item.rows : [item],\n )\n const pageRows = new Set(\n allRows\n .slice(pageIndex * pageSize, (pageIndex + 1) * pageSize)\n .map((row) => row.id),\n )\n const data = getPageData(paginationData, pageRows)\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id={titleId}>\n Paginated repositories by visibility\n </Table.Title>\n <DataTable\n aria-labelledby={titleId}\n data={data}\n columns={[\n {\n header: 'Name',\n field: 'name',\n rowHeader: true,\n sortBy: true,\n },\n {\n header: 'Visibility',\n field: 'visibility',\n },\n ]}\n />\n <Table.Pagination\n aria-label=\"Pagination for grouped repositories\"\n pageSize={pageSize}\n totalCount={allRows.length}\n onChange={({ pageIndex }) => setPageIndex(pageIndex)}\n />\n </Table.Container>\n )\n}"
|
|
2880
|
+
},
|
|
2881
|
+
{
|
|
2882
|
+
"id": "experimental-components-table-features--with-row-selection",
|
|
2883
|
+
"code": "() => {\n const [selectedRows, setSelectedRows] = React.useState<\n ReadonlySet<DataTableRowId>\n >(() => new Set([2]))\n return (\n <Table.Container>\n <Table.Title as=\"h2\" id=\"selectable-repositories\">\n Selectable repositories\n </Table.Title>\n <DataTable\n aria-labelledby=\"selectable-repositories\"\n data={data}\n columns={groupedColumns}\n rowSelection\n selectedRows={selectedRows}\n onSelectionChange={({ selectedRows: nextSelectedRows }) => {\n setSelectedRows(nextSelectedRows)\n }}\n />\n </Table.Container>\n )\n}"
|
|
2884
|
+
}
|
|
2885
|
+
],
|
|
2487
2886
|
"importPath": "@primer/react/experimental",
|
|
2488
2887
|
"props": [
|
|
2489
2888
|
{
|
|
@@ -2498,14 +2897,85 @@
|
|
|
2498
2897
|
},
|
|
2499
2898
|
{
|
|
2500
2899
|
"name": "data",
|
|
2501
|
-
"type": "Array<Data
|
|
2502
|
-
"description": "Provide
|
|
2900
|
+
"type": "Array<Data | DataTableRowGroup<Data>>",
|
|
2901
|
+
"description": "Provide rows, row groups, or a mixture of both to render in the table, in display order."
|
|
2503
2902
|
},
|
|
2504
2903
|
{
|
|
2505
2904
|
"name": "columns",
|
|
2506
2905
|
"type": "Array<Column<Data>>",
|
|
2507
2906
|
"description": "Provide the columns for the table and the fields in `data` to which they correspond"
|
|
2508
2907
|
},
|
|
2908
|
+
{
|
|
2909
|
+
"name": "getRowId",
|
|
2910
|
+
"type": "(row: Data) => DataTableRowId",
|
|
2911
|
+
"description": "Provide a stable row ID. Defaults to row.id. DataTableRowId is an exported string | number type."
|
|
2912
|
+
},
|
|
2913
|
+
{
|
|
2914
|
+
"name": "rowSelection",
|
|
2915
|
+
"type": "boolean",
|
|
2916
|
+
"description": "Render row checkboxes and current-page select-all. Collapsible groups also get a checkbox for their selectable members."
|
|
2917
|
+
},
|
|
2918
|
+
{
|
|
2919
|
+
"name": "selectedRows",
|
|
2920
|
+
"type": "ReadonlySet<DataTableRowId>",
|
|
2921
|
+
"description": "Control selection using stable IDs from `getRowId`. Missing or non-selectable IDs stay stored but do not count as selected."
|
|
2922
|
+
},
|
|
2923
|
+
{
|
|
2924
|
+
"name": "defaultSelectedRows",
|
|
2925
|
+
"type": "ReadonlySet<DataTableRowId>",
|
|
2926
|
+
"description": "Set the initial selection for an uncontrolled, static, single-page table."
|
|
2927
|
+
},
|
|
2928
|
+
{
|
|
2929
|
+
"name": "onSelectionChange",
|
|
2930
|
+
"type": "({ selectedRows }: { selectedRows: Set<DataTableRowId> }) => void",
|
|
2931
|
+
"description": "Receive a new selection set when a checkbox is toggled. Data changes alone do not trigger this callback."
|
|
2932
|
+
},
|
|
2933
|
+
{
|
|
2934
|
+
"name": "isRowSelectable",
|
|
2935
|
+
"type": "(row: Data) => boolean",
|
|
2936
|
+
"description": "Determine which rows can be selected and counted by select-all."
|
|
2937
|
+
},
|
|
2938
|
+
{
|
|
2939
|
+
"name": "collapsibleGroups",
|
|
2940
|
+
"type": "boolean",
|
|
2941
|
+
"defaultValue": "false",
|
|
2942
|
+
"description": "Enable group disclosures. Collapsing only hides members; selection and select-all still include them."
|
|
2943
|
+
},
|
|
2944
|
+
{
|
|
2945
|
+
"name": "getGroupRowCountLabel",
|
|
2946
|
+
"type": "(rowCount: number) => string",
|
|
2947
|
+
"description": "Localize the description shared by each group checkbox and disclosure. The count includes all members, including non-selectable rows, and defaults to 1 row or N rows."
|
|
2948
|
+
},
|
|
2949
|
+
{
|
|
2950
|
+
"name": "expandedGroups",
|
|
2951
|
+
"type": "ReadonlySet<DataTableRowId>",
|
|
2952
|
+
"description": "Control expanded groups by stable groupId. String and numeric IDs remain distinct."
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
"name": "defaultExpandedGroups",
|
|
2956
|
+
"type": "ReadonlySet<DataTableRowId>",
|
|
2957
|
+
"description": "Initially expanded group IDs. Defaults to all groups in the initial data; subsequently introduced IDs are collapsed."
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
"name": "onExpandedGroupsChange",
|
|
2961
|
+
"type": "({ expandedGroups }: { expandedGroups: Set<DataTableRowId> }) => void",
|
|
2962
|
+
"description": "Receive a new expansion set on a disclosure request. Sorting and data replacement do not emit this callback or clear stored IDs."
|
|
2963
|
+
},
|
|
2964
|
+
{
|
|
2965
|
+
"name": "renderBulkActions",
|
|
2966
|
+
"type": "(context: DataTableBulkActionsContext) => React.ReactNode",
|
|
2967
|
+
"description": "Render actions in place of visible column labels when rowSelection is enabled and selectable rows are selected. Receives selectedRows IDs, selectedCount, and clearSelection, excluding missing and non-selectable rows."
|
|
2968
|
+
},
|
|
2969
|
+
{
|
|
2970
|
+
"name": "bulkActionsProps",
|
|
2971
|
+
"type": "Pick<TableBulkActionsProps, 'aria-label' | 'getSelectedCountLabel'>",
|
|
2972
|
+
"description": "Localize the bulk-action group name and selected-count announcement (including zero)."
|
|
2973
|
+
},
|
|
2974
|
+
{
|
|
2975
|
+
"name": "bulkActionsReturnFocusRef",
|
|
2976
|
+
"type": "React.RefObject<HTMLElement | null>",
|
|
2977
|
+
"description": "Override focus recovery when a focused action disappears. Defaults to select-all, or the table when no selectable rows remain. Does not override focus already moved by the consumer."
|
|
2978
|
+
},
|
|
2509
2979
|
{
|
|
2510
2980
|
"name": "cellPadding",
|
|
2511
2981
|
"type": "'condensed' | 'normal' | 'spacious'",
|
|
@@ -2539,6 +3009,13 @@
|
|
|
2539
3009
|
"description": "Provide the sort direction that the table should be sorted by on the\ncurrently sorted column",
|
|
2540
3010
|
"defaultValue": ""
|
|
2541
3011
|
},
|
|
3012
|
+
{
|
|
3013
|
+
"name": "externalSorting",
|
|
3014
|
+
"type": "boolean",
|
|
3015
|
+
"required": false,
|
|
3016
|
+
"description": "Indicate whether the sorting of the table is managed externally. When `true`, the table will not sort the data internally when a column header is clicked. The `onToggleSort` callback will still be invoked when a column header is clicked.",
|
|
3017
|
+
"defaultValue": "false"
|
|
3018
|
+
},
|
|
2542
3019
|
{
|
|
2543
3020
|
"name": "onToggleSort",
|
|
2544
3021
|
"type": "(columnId: ObjectPaths<Data> | string | number, direction: 'ASC' | 'DESC') => void",
|
|
@@ -2548,6 +3025,38 @@
|
|
|
2548
3025
|
}
|
|
2549
3026
|
],
|
|
2550
3027
|
"subcomponents": [
|
|
3028
|
+
{
|
|
3029
|
+
"name": "Table.BulkActions",
|
|
3030
|
+
"props": [
|
|
3031
|
+
{
|
|
3032
|
+
"name": "selectedCount",
|
|
3033
|
+
"type": "number",
|
|
3034
|
+
"required": true,
|
|
3035
|
+
"description": "The effectively selected row count. Keep the component mounted at zero so count announcements and focus recovery can complete."
|
|
3036
|
+
},
|
|
3037
|
+
{
|
|
3038
|
+
"name": "onFocusReturn",
|
|
3039
|
+
"type": "() => void",
|
|
3040
|
+
"description": "Choose the recovery destination when a focused action disappears and focus has not moved elsewhere."
|
|
3041
|
+
},
|
|
3042
|
+
{
|
|
3043
|
+
"name": "getSelectedCountLabel",
|
|
3044
|
+
"type": "(selectedCount: number) => string",
|
|
3045
|
+
"description": "Localize the visible and announced selected count, including zero."
|
|
3046
|
+
},
|
|
3047
|
+
{
|
|
3048
|
+
"name": "aria-label",
|
|
3049
|
+
"type": "string",
|
|
3050
|
+
"defaultValue": "'Bulk actions'",
|
|
3051
|
+
"description": "Name the action group."
|
|
3052
|
+
},
|
|
3053
|
+
{
|
|
3054
|
+
"name": "children",
|
|
3055
|
+
"type": "React.ReactNode",
|
|
3056
|
+
"description": "Consumer-owned action elements in native Tab order, rendered only when selectedCount is positive."
|
|
3057
|
+
}
|
|
3058
|
+
]
|
|
3059
|
+
},
|
|
2551
3060
|
{
|
|
2552
3061
|
"name": "Table",
|
|
2553
3062
|
"props": [
|
|
@@ -2599,6 +3108,83 @@
|
|
|
2599
3108
|
}
|
|
2600
3109
|
]
|
|
2601
3110
|
},
|
|
3111
|
+
{
|
|
3112
|
+
"name": "Table.Group",
|
|
3113
|
+
"props": [
|
|
3114
|
+
{
|
|
3115
|
+
"name": "collapsible",
|
|
3116
|
+
"type": "boolean",
|
|
3117
|
+
"defaultValue": "false",
|
|
3118
|
+
"description": "Render a disclosure controlling the member body. Without this prop members are always visible."
|
|
3119
|
+
},
|
|
3120
|
+
{
|
|
3121
|
+
"name": "expanded",
|
|
3122
|
+
"type": "boolean",
|
|
3123
|
+
"description": "Control whether the member body is visible."
|
|
3124
|
+
},
|
|
3125
|
+
{
|
|
3126
|
+
"name": "defaultExpanded",
|
|
3127
|
+
"type": "boolean",
|
|
3128
|
+
"defaultValue": "true",
|
|
3129
|
+
"description": "Initial expanded state for an uncontrolled group."
|
|
3130
|
+
},
|
|
3131
|
+
{
|
|
3132
|
+
"name": "onExpandedChange",
|
|
3133
|
+
"type": "({ expanded }: { expanded: boolean }) => void",
|
|
3134
|
+
"description": "Handle a disclosure request. Controlled groups wait for the expanded prop to update."
|
|
3135
|
+
},
|
|
3136
|
+
{
|
|
3137
|
+
"name": "selection",
|
|
3138
|
+
"type": "'all' | 'some' | 'none'",
|
|
3139
|
+
"description": "Render a group checkbox with the given selection state."
|
|
3140
|
+
},
|
|
3141
|
+
{
|
|
3142
|
+
"name": "selectionDisabled",
|
|
3143
|
+
"type": "boolean",
|
|
3144
|
+
"description": "Disable the group checkbox without disabling its disclosure."
|
|
3145
|
+
},
|
|
3146
|
+
{
|
|
3147
|
+
"name": "onToggleSelect",
|
|
3148
|
+
"type": "() => void",
|
|
3149
|
+
"description": "Handle group checkbox activation. Consumers own member selection. When omitted, the group checkbox is disabled."
|
|
3150
|
+
},
|
|
3151
|
+
{
|
|
3152
|
+
"name": "id",
|
|
3153
|
+
"type": "string | number",
|
|
3154
|
+
"description": "A stable identifier exposed on both group sections as `data-group-id`. The group header's DOM id is generated separately so it is safe for use in `headers`."
|
|
3155
|
+
},
|
|
3156
|
+
{
|
|
3157
|
+
"name": "label",
|
|
3158
|
+
"type": "string",
|
|
3159
|
+
"description": "The visible label for the group, shown in the group header and included in its accessible name along with the row count."
|
|
3160
|
+
},
|
|
3161
|
+
{
|
|
3162
|
+
"name": "rowCount",
|
|
3163
|
+
"type": "number",
|
|
3164
|
+
"description": "The total number of member rows, including non-selectable rows. Shown in the header and described separately on the checkbox and disclosure."
|
|
3165
|
+
},
|
|
3166
|
+
{
|
|
3167
|
+
"name": "getRowCountLabel",
|
|
3168
|
+
"type": "(rowCount: number) => string",
|
|
3169
|
+
"description": "Localize the count description shared by the checkbox and disclosure. Defaults to 1 row or N rows."
|
|
3170
|
+
},
|
|
3171
|
+
{
|
|
3172
|
+
"name": "aria-label",
|
|
3173
|
+
"type": "string",
|
|
3174
|
+
"description": "Override the group name used by the header, checkbox, and disclosure. Use getRowCountLabel to localize the controls' separate count description."
|
|
3175
|
+
},
|
|
3176
|
+
{
|
|
3177
|
+
"name": "colSpan",
|
|
3178
|
+
"type": "number",
|
|
3179
|
+
"description": "The number of columns spanned by the group header."
|
|
3180
|
+
},
|
|
3181
|
+
{
|
|
3182
|
+
"name": "children",
|
|
3183
|
+
"type": "React.ReactNode",
|
|
3184
|
+
"description": "The group's member rows, typically a list of `Table.Row` elements. When composing a grouped table directly, use each `Table.Cell`'s native `headers` prop to reference the corresponding `Table.Header` id. The group header association is added automatically."
|
|
3185
|
+
}
|
|
3186
|
+
]
|
|
3187
|
+
},
|
|
2602
3188
|
{
|
|
2603
3189
|
"name": "Table.Row",
|
|
2604
3190
|
"props": [
|
|
@@ -2624,6 +3210,80 @@
|
|
|
2624
3210
|
}
|
|
2625
3211
|
]
|
|
2626
3212
|
},
|
|
3213
|
+
{
|
|
3214
|
+
"name": "Table.SelectionHeader",
|
|
3215
|
+
"props": [
|
|
3216
|
+
{
|
|
3217
|
+
"name": "selection",
|
|
3218
|
+
"type": "'all' | 'some' | 'none'",
|
|
3219
|
+
"required": true,
|
|
3220
|
+
"description": "Whether all, some, or none of the selectable rows are selected."
|
|
3221
|
+
},
|
|
3222
|
+
{
|
|
3223
|
+
"name": "disabled",
|
|
3224
|
+
"type": "boolean",
|
|
3225
|
+
"description": "Whether row selection is unavailable."
|
|
3226
|
+
},
|
|
3227
|
+
{
|
|
3228
|
+
"name": "onToggleSelect",
|
|
3229
|
+
"type": "() => void",
|
|
3230
|
+
"description": "Request toggling selection for all selectable rows."
|
|
3231
|
+
},
|
|
3232
|
+
{
|
|
3233
|
+
"name": "checkboxRef",
|
|
3234
|
+
"type": "React.Ref<HTMLInputElement>",
|
|
3235
|
+
"description": "Forward a ref to the native selection checkbox."
|
|
3236
|
+
},
|
|
3237
|
+
{
|
|
3238
|
+
"name": "aria-label",
|
|
3239
|
+
"type": "string",
|
|
3240
|
+
"defaultValue": "'Select rows'",
|
|
3241
|
+
"description": "Provide the selection checkbox's accessible name."
|
|
3242
|
+
},
|
|
3243
|
+
{
|
|
3244
|
+
"name": "aria-description",
|
|
3245
|
+
"type": "string",
|
|
3246
|
+
"description": "Describe the select-all scope, for example \"Select all 10 rows\"."
|
|
3247
|
+
}
|
|
3248
|
+
]
|
|
3249
|
+
},
|
|
3250
|
+
{
|
|
3251
|
+
"name": "Table.RowSelection",
|
|
3252
|
+
"props": [
|
|
3253
|
+
{
|
|
3254
|
+
"name": "selected",
|
|
3255
|
+
"type": "boolean",
|
|
3256
|
+
"required": true,
|
|
3257
|
+
"description": "Whether the row is selected."
|
|
3258
|
+
},
|
|
3259
|
+
{
|
|
3260
|
+
"name": "disabled",
|
|
3261
|
+
"type": "boolean",
|
|
3262
|
+
"description": "Whether the row cannot be selected."
|
|
3263
|
+
},
|
|
3264
|
+
{
|
|
3265
|
+
"name": "onToggleSelect",
|
|
3266
|
+
"type": "() => void",
|
|
3267
|
+
"description": "Request toggling selection for the row."
|
|
3268
|
+
},
|
|
3269
|
+
{
|
|
3270
|
+
"name": "checkboxRef",
|
|
3271
|
+
"type": "React.Ref<HTMLInputElement>",
|
|
3272
|
+
"description": "Forward a ref to the native row checkbox."
|
|
3273
|
+
},
|
|
3274
|
+
{
|
|
3275
|
+
"name": "aria-label",
|
|
3276
|
+
"type": "string",
|
|
3277
|
+
"defaultValue": "'Select row'",
|
|
3278
|
+
"description": "Name the row checkbox when `aria-labelledby` is not provided."
|
|
3279
|
+
},
|
|
3280
|
+
{
|
|
3281
|
+
"name": "aria-labelledby",
|
|
3282
|
+
"type": "string",
|
|
3283
|
+
"description": "Reference the row header IDs. The checkbox name adds \"Select\" before their text."
|
|
3284
|
+
}
|
|
3285
|
+
]
|
|
3286
|
+
},
|
|
2627
3287
|
{
|
|
2628
3288
|
"name": "Table.Cell",
|
|
2629
3289
|
"props": [
|
|
@@ -2920,7 +3580,7 @@
|
|
|
2920
3580
|
},
|
|
2921
3581
|
{
|
|
2922
3582
|
"id": "components-dialog-features--repro-multistep-dialog-with-conditional-footer",
|
|
2923
|
-
"code": "({ width, height }: DialogStoryProps) => {\n const [isOpen, setIsOpen] = useState(false)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n const [step, setStep] = React.useState(1)\n const [inputText, setInputText] = React.useState('')\n const dialogRef = useRef<HTMLDivElement>(null)\n const renderFooterConditionally = () => {\n if (step === 1) return null\n return (\n <Dialog.Footer>\n <Button variant=\"primary\">Submit</Button>\n </Dialog.Footer>\n )\n }\n React.useEffect(() => {\n // focus the close button when the step changes\n const focusTarget = dialogRef.current?.querySelector(\n 'button[aria-label=\"Close\"]',\n ) as HTMLButtonElement\n if (step === 2) {\n focusTarget.focus()\n }\n }, [step])\n return (\n <>\n <Button onClick={() => setIsOpen(!isOpen)}>Show dialog</Button>\n {isOpen && (\n <Dialog\n title={`Step ${step}`}\n width={width}\n height={height}\n renderFooter={renderFooterConditionally}\n onClose={onDialogClose}\n footerButtons={[\n {\n buttonType: 'primary',\n content: 'Proceed',\n },\n ]}\n ref={dialogRef}\n >\n {step === 1 ? (\n <Stack gap=\"spacious\" direction=\"vertical\">\n <Stack direction=\"horizontal\" justify=\"space-between\">\n Bug Report <Button onClick={() => setStep(2)}>Choose</Button>\n </Stack>\n <Stack direction=\"horizontal\" justify=\"space-between\">\n Feature request{' '}\n <Button onClick={() => setStep(2)}>Choose</Button>\n </Stack>\n </Stack>\n ) : (\n <div>\n <Stack gap=\"condensed\" direction=\"vertical\">\n <label htmlFor=\"description\">Description</label>\n <TextInput\n id=\"description\"\n placeholder=\"Write the description here\"\n value={inputText}\n onChange={(event) => setInputText(event.target.value)}\n />\n </Stack>\n </div>\n )}\n </Dialog>\n )}\n </>\n )\n}"
|
|
3583
|
+
"code": "({ width, height }: DialogStoryProps) => {\n const [isOpen, setIsOpen] = useState(false)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n const [step, setStep] = React.useState(1)\n const [inputText, setInputText] = React.useState('')\n const dialogRef = useRef<HTMLDivElement>(null)\n const renderFooterConditionally = () => {\n if (step === 1) return null\n return (\n <Dialog.Footer>\n <Button variant=\"primary\">Submit</Button>\n </Dialog.Footer>\n )\n }\n React.useEffect(() => {\n // focus the close button when the step changes\n const focusTarget = dialogRef.current?.querySelector(\n 'button[aria-label=\"Close\"]',\n ) as HTMLButtonElement\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-event-handler\n if (step === 2) {\n focusTarget.focus()\n }\n }, [step])\n return (\n <>\n <Button onClick={() => setIsOpen(!isOpen)}>Show dialog</Button>\n {isOpen && (\n <Dialog\n title={`Step ${step}`}\n width={width}\n height={height}\n renderFooter={renderFooterConditionally}\n onClose={onDialogClose}\n footerButtons={[\n {\n buttonType: 'primary',\n content: 'Proceed',\n },\n ]}\n ref={dialogRef}\n >\n {step === 1 ? (\n <Stack gap=\"spacious\" direction=\"vertical\">\n <Stack direction=\"horizontal\" justify=\"space-between\">\n Bug Report <Button onClick={() => setStep(2)}>Choose</Button>\n </Stack>\n <Stack direction=\"horizontal\" justify=\"space-between\">\n Feature request{' '}\n <Button onClick={() => setStep(2)}>Choose</Button>\n </Stack>\n </Stack>\n ) : (\n <div>\n <Stack gap=\"condensed\" direction=\"vertical\">\n <label htmlFor=\"description\">Description</label>\n <TextInput\n id=\"description\"\n placeholder=\"Write the description here\"\n value={inputText}\n onChange={(event) => setInputText(event.target.value)}\n />\n </Stack>\n </div>\n )}\n </Dialog>\n )}\n </>\n )\n}"
|
|
2924
3584
|
},
|
|
2925
3585
|
{
|
|
2926
3586
|
"id": "components-dialog-features--bottom-sheet-narrow",
|
|
@@ -2945,6 +3605,14 @@
|
|
|
2945
3605
|
{
|
|
2946
3606
|
"id": "components-dialog-features--retains-focus-trap-with-dynamic-content",
|
|
2947
3607
|
"code": "() => {\n const [isOpen, setIsOpen] = useState(false)\n const [secondOpen, setSecondOpen] = useState(false)\n const [expandContent, setExpandContent] = useState(false)\n const [changeBodyContent, setChangeBodyContent] = useState(false)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n const onSecondDialogClose = useCallback(() => setSecondOpen(false), [])\n const openSecondDialog = useCallback(() => setSecondOpen(true), [])\n const renderFooterConditionally = () => {\n if (!changeBodyContent) return null\n return (\n <Dialog.Footer>\n <Button variant=\"primary\">Submit</Button>\n </Dialog.Footer>\n )\n }\n return (\n <>\n <Button ref={buttonRef} onClick={() => setIsOpen(!isOpen)}>\n Show dialog\n </Button>\n {isOpen && (\n <Dialog\n title=\"My Dialog\"\n onClose={onDialogClose}\n renderFooter={renderFooterConditionally}\n >\n <Button onClick={() => setExpandContent(!expandContent)}>\n Click me to dynamically {expandContent ? 'remove' : 'render'}{' '}\n content\n </Button>\n <Button onClick={() => setChangeBodyContent(!changeBodyContent)}>\n Click me to {changeBodyContent ? 'remove' : 'add'} a footer\n </Button>\n <Button onClick={openSecondDialog}>\n Click me to open a new dialog\n </Button>\n {expandContent && (\n <Stack gap=\"normal\" direction=\"vertical\">\n {lipsum}\n <Button>Dialog Button Example 1</Button>\n <Button>Dialog Button Example 2</Button>\n </Stack>\n )}\n {secondOpen && (\n <Dialog\n title=\"Inner dialog!\"\n onClose={onSecondDialogClose}\n width=\"small\"\n >\n Hello world\n </Dialog>\n )}\n </Dialog>\n )}\n </>\n )\n}"
|
|
3608
|
+
},
|
|
3609
|
+
{
|
|
3610
|
+
"id": "components-dialog-features--align-top",
|
|
3611
|
+
"code": "() => {\n const [isOpen, setIsOpen] = useState(true)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n return (\n <>\n <Button ref={buttonRef} onClick={() => setIsOpen(true)}>\n Show dialog\n </Button>\n {isOpen && (\n <Dialog title=\"My Dialog\" onClose={onDialogClose} align=\"top\">\n {bodyContent}\n </Dialog>\n )}\n </>\n )\n}"
|
|
3612
|
+
},
|
|
3613
|
+
{
|
|
3614
|
+
"id": "components-dialog-features--align-bottom",
|
|
3615
|
+
"code": "() => {\n const [isOpen, setIsOpen] = useState(true)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const onDialogClose = useCallback(() => setIsOpen(false), [])\n return (\n <>\n <Button ref={buttonRef} onClick={() => setIsOpen(true)}>\n Show dialog\n </Button>\n {isOpen && (\n <Dialog title=\"My Dialog\" onClose={onDialogClose} align=\"bottom\">\n {bodyContent}\n </Dialog>\n )}\n </>\n )\n}"
|
|
2948
3616
|
}
|
|
2949
3617
|
],
|
|
2950
3618
|
"importPath": "@primer/react",
|
|
@@ -2991,8 +3659,8 @@
|
|
|
2991
3659
|
},
|
|
2992
3660
|
{
|
|
2993
3661
|
"name": "width",
|
|
2994
|
-
"type": "'small' | 'medium' | 'large' | 'xlarge'",
|
|
2995
|
-
"description": "The width of the dialog.\nsmall: 296px\nmedium: 320px\nlarge: 480px\nxlarge: 640px"
|
|
3662
|
+
"type": "'small' | 'medium' | 'large' | 'xlarge' | string | number",
|
|
3663
|
+
"description": "The width of the dialog.\nsmall: 296px\nmedium: 320px\nlarge: 480px\nxlarge: 640px\n\nAlso accepts any valid CSS width value (e.g. '400px', '80rem') or a number, which is interpreted as a pixel width."
|
|
2996
3664
|
},
|
|
2997
3665
|
{
|
|
2998
3666
|
"name": "height",
|
|
@@ -3016,11 +3684,24 @@
|
|
|
3016
3684
|
"description": "The position of the dialog",
|
|
3017
3685
|
"defaultValue": ""
|
|
3018
3686
|
},
|
|
3687
|
+
{
|
|
3688
|
+
"name": "align",
|
|
3689
|
+
"type": "'top' | 'center' | 'bottom'",
|
|
3690
|
+
"required": false,
|
|
3691
|
+
"description": "The vertical alignment of the dialog. Only applies when position is 'center' (the default). 'top' positions the Dialog ~4rem from the top of the screen, 'center' (default) vertically centers the Dialog, 'bottom' positions the Dialog near the bottom of the screen.",
|
|
3692
|
+
"defaultValue": ""
|
|
3693
|
+
},
|
|
3019
3694
|
{
|
|
3020
3695
|
"name": "className",
|
|
3021
3696
|
"type": "string | undefined",
|
|
3022
3697
|
"defaultValue": "",
|
|
3023
3698
|
"description": "CSS string"
|
|
3699
|
+
},
|
|
3700
|
+
{
|
|
3701
|
+
"name": "style",
|
|
3702
|
+
"type": "React.CSSProperties | undefined",
|
|
3703
|
+
"defaultValue": "",
|
|
3704
|
+
"description": "React CSS properties"
|
|
3024
3705
|
}
|
|
3025
3706
|
],
|
|
3026
3707
|
"subcomponents": [
|
|
@@ -3112,39 +3793,39 @@
|
|
|
3112
3793
|
"source": "https://github.com/primer/react/tree/main/packages/react/src/Flash",
|
|
3113
3794
|
"id": "flash",
|
|
3114
3795
|
"name": "Flash",
|
|
3115
|
-
"status": "
|
|
3796
|
+
"status": "deprecated",
|
|
3116
3797
|
"a11yReviewed": "2025-01-08",
|
|
3117
3798
|
"stories": [
|
|
3118
3799
|
{
|
|
3119
|
-
"id": "components-flash--default",
|
|
3800
|
+
"id": "deprecated-components-flash--default",
|
|
3120
3801
|
"code": "() => <Flash>Default</Flash>"
|
|
3121
3802
|
},
|
|
3122
3803
|
{
|
|
3123
|
-
"id": "components-flash-features--success",
|
|
3804
|
+
"id": "deprecated-components-flash-features--success",
|
|
3124
3805
|
"code": "() => (\n <Flash\n variant=\"success\"\n style={{\n display: 'grid',\n gridTemplateColumns: 'min-content 1fr minmax(0, auto)',\n gridTemplateAreas: `'visual message actions'`,\n }}\n >\n <div className={classes.Visual}>\n <CheckCircleIcon aria-label=\"Success\" />\n </div>\n <div className={classes.Message}>Success</div>\n </Flash>\n)"
|
|
3125
3806
|
},
|
|
3126
3807
|
{
|
|
3127
|
-
"id": "components-flash-features--danger",
|
|
3808
|
+
"id": "deprecated-components-flash-features--danger",
|
|
3128
3809
|
"code": "() => (\n <Flash\n variant=\"danger\"\n style={{\n display: 'grid',\n gridTemplateColumns: 'min-content 1fr minmax(0, auto)',\n gridTemplateAreas: `'visual message actions'`,\n }}\n >\n <div className={classes.Visual}>\n <InfoIcon aria-label=\"Danger\" />\n </div>\n <div className={classes.Message}>Danger</div>\n </Flash>\n)"
|
|
3129
3810
|
},
|
|
3130
3811
|
{
|
|
3131
|
-
"id": "components-flash-features--warning",
|
|
3812
|
+
"id": "deprecated-components-flash-features--warning",
|
|
3132
3813
|
"code": "() => (\n <Flash\n variant=\"warning\"\n style={{\n display: 'grid',\n gridTemplateColumns: 'min-content 1fr minmax(0, auto)',\n gridTemplateAreas: `'visual message actions'`,\n }}\n >\n <div className={classes.Visual}>\n <AlertIcon aria-label=\"Warning\" />\n </div>\n <div className={classes.Message}>Warning</div>\n </Flash>\n)"
|
|
3133
3814
|
},
|
|
3134
3815
|
{
|
|
3135
|
-
"id": "components-flash-features--full",
|
|
3816
|
+
"id": "deprecated-components-flash-features--full",
|
|
3136
3817
|
"code": "() => (\n <Flash\n full\n style={{\n display: 'grid',\n gridTemplateColumns: 'min-content 1fr minmax(0, auto)',\n gridTemplateAreas: `'visual message actions'`,\n }}\n >\n <div className={classes.Visual}>\n <InfoIcon aria-label=\"Info\" />\n </div>\n <div className={classes.Message}>Full</div>\n </Flash>\n)"
|
|
3137
3818
|
},
|
|
3138
3819
|
{
|
|
3139
|
-
"id": "components-flash-features--with-icon-and-action",
|
|
3820
|
+
"id": "deprecated-components-flash-features--with-icon-and-action",
|
|
3140
3821
|
"code": "() => (\n <Flash className={classes.WithIconAndAction}>\n <div className={classes.Visual}>\n <InfoIcon aria-label=\"Info\" />\n </div>\n <div className={classes.Message}>\n This is a flash message with an icon and an action.\n <Link href=\"/\"> Learn more.</Link>\n </div>\n <div className={classes.ActionsResponsive}>\n <Button>Join waitlist</Button>\n </div>\n </Flash>\n)"
|
|
3141
3822
|
},
|
|
3142
3823
|
{
|
|
3143
|
-
"id": "components-flash-features--with-icon-action-dismiss",
|
|
3824
|
+
"id": "deprecated-components-flash-features--with-icon-action-dismiss",
|
|
3144
3825
|
"code": "() => (\n <Flash className={classes.WithIconActionDismiss}>\n <div className={classes.Visual}>\n <InfoIcon aria-label=\"Info\" />\n </div>\n <div className={classes.Message}>\n This is a flash message with an icon and an action.\n <Link href=\"/\"> Learn more.</Link>\n </div>\n <div className={classes.ActionsResponsive}>\n <Button>Join waitlist</Button>\n </div>\n <div className={classes.Close}>\n <IconButton variant=\"invisible\" icon={XIcon} aria-label=\"Dismiss\" />\n </div>\n </Flash>\n)"
|
|
3145
3826
|
}
|
|
3146
3827
|
],
|
|
3147
|
-
"importPath": "@primer/react",
|
|
3828
|
+
"importPath": "@primer/react/deprecated",
|
|
3148
3829
|
"props": [
|
|
3149
3830
|
{
|
|
3150
3831
|
"name": "full",
|
|
@@ -3186,8 +3867,8 @@
|
|
|
3186
3867
|
"code": "() => {\n const [tokens, setTokens] = useState([...mockTokens])\n const onTokenRemove = (tokenId: string | number) => {\n setTokens(\n tokens.filter((token: { id: string | number }) => token.id !== tokenId),\n )\n }\n return (\n <div className={classes.GridContainer}>\n <FormControl>\n <FormControl.Label id=\"form-label\">\n TextInputWithTokens\n </FormControl.Label>\n <TextInputWithTokens onTokenRemove={onTokenRemove} tokens={tokens} />\n </FormControl>\n <FormControl>\n <FormControl.Label id=\"autocomplete-label\">\n Autocomplete\n </FormControl.Label>\n <Autocomplete>\n <Autocomplete.Input block />\n <Autocomplete.Overlay>\n <Autocomplete.Menu\n aria-labelledby=\"autocomplete-label\"\n items={[\n {\n text: 'css',\n id: '0',\n },\n {\n text: 'css-in-js',\n id: '1',\n },\n {\n text: 'styled-system',\n id: '2',\n },\n {\n text: 'javascript',\n id: '3',\n },\n {\n text: 'typescript',\n id: '4',\n },\n {\n text: 'react',\n id: '5',\n },\n {\n text: 'design-systems',\n id: '6',\n },\n ]}\n selectedItemIds={[]}\n />\n </Autocomplete.Overlay>\n </Autocomplete>\n </FormControl>\n <FormControl>\n <FormControl.Label>Select</FormControl.Label>\n <Select>\n <Select.Option value=\"figma\">Figma</Select.Option>\n <Select.Option value=\"css\">Primer CSS</Select.Option>\n <Select.Option value=\"prc\">Primer React components</Select.Option>\n <Select.Option value=\"pvc\">Primer ViewComponents</Select.Option>\n </Select>\n </FormControl>\n <FormControl>\n <FormControl.Label>Textarea</FormControl.Label>\n <Textarea />\n </FormControl>\n </div>\n )\n}"
|
|
3187
3868
|
},
|
|
3188
3869
|
{
|
|
3189
|
-
"id": "components-formcontrol-features--
|
|
3190
|
-
"code": "() => {\n const [value, setValue] = React.useState('mona lisa')\n const [validationResult, setValidationResult] = React.useState('')\n const doesValueContainSpaces = (inputValue: string) => /\\s/g.test(inputValue)\n const handleInputChange = (e: {\n currentTarget: {\n value: React.SetStateAction<string>\n }\n }) => {\n setValue(e.currentTarget.value)\n }\n React.useEffect(() => {\n if (doesValueContainSpaces(value)) {\n setValidationResult('noSpaces')\n } else if (value) {\n setValidationResult('validName')\n }\n }, [value])\n return (\n <div className={classes.GridContainer}>\n <FormControl>\n <FormControl.Label htmlFor=\"custom-input\">\n GitHub handle\n </FormControl.Label>\n <CustomTextInput\n id=\"custom-input\"\n aria-describedby=\"custom-input-
|
|
3870
|
+
"id": "components-formcontrol-features--with-custom-input",
|
|
3871
|
+
"code": "() => {\n const [value, setValue] = React.useState('mona lisa')\n const [validationResult, setValidationResult] = React.useState('')\n const doesValueContainSpaces = (inputValue: string) => /\\s/g.test(inputValue)\n const handleInputChange = (e: {\n currentTarget: {\n value: React.SetStateAction<string>\n }\n }) => {\n setValue(e.currentTarget.value)\n }\n React.useEffect(() => {\n if (doesValueContainSpaces(value)) {\n // eslint-disable-next-line react-hooks/set-state-in-effect, react-you-might-not-need-an-effect/no-chain-state-updates\n setValidationResult('noSpaces')\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-event-handler\n } else if (value) {\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates\n setValidationResult('validName')\n }\n }, [value])\n return (\n <div className={classes.GridContainer}>\n <FormControl>\n <FormControl.Label htmlFor=\"custom-input\">\n GitHub handle\n </FormControl.Label>\n <CustomTextInput\n id=\"custom-input\"\n aria-describedby=\"custom-input-validation custom-input-caption\"\n aria-invalid={validationResult === 'noSpaces'}\n onChange={handleInputChange}\n />\n {validationResult === 'noSpaces' && (\n <FormControl.Validation id=\"custom-input-validation\" variant=\"error\">\n GitHub handles cannot contain spaces\n </FormControl.Validation>\n )}\n {validationResult === 'validName' && (\n <FormControl.Validation\n id=\"custom-input-validation\"\n variant=\"success\"\n >\n Valid name\n </FormControl.Validation>\n )}\n <FormControl.Caption id=\"custom-input-caption\">\n With or without "@". For example "monalisa" or\n "@monalisa"\n </FormControl.Caption>\n </FormControl>\n\n <CheckboxGroup>\n <CheckboxGroup.Label>Checkboxes</CheckboxGroup.Label>\n <FormControl layout=\"horizontal\">\n <CustomCheckboxInput\n id=\"custom-checkbox-one\"\n aria-describedby=\"custom-checkbox-one-caption\"\n value=\"checkOne\"\n />\n <FormControl.Label htmlFor=\"custom-checkbox-one\">\n Checkbox one\n </FormControl.Label>\n <FormControl.Caption id=\"custom-checkbox-one-caption\">\n Hint text for checkbox one\n </FormControl.Caption>\n </FormControl>\n <FormControl layout=\"horizontal\">\n <CustomCheckboxInput\n id=\"custom-checkbox-two\"\n aria-describedby=\"custom-checkbox-two-caption\"\n value=\"checkTwo\"\n />\n <FormControl.Label htmlFor=\"custom-checkbox-two\">\n Checkbox two\n </FormControl.Label>\n <FormControl.Caption id=\"custom-checkbox-two-caption\">\n Hint text for checkbox two\n </FormControl.Caption>\n </FormControl>\n </CheckboxGroup>\n </div>\n )\n}"
|
|
3191
3872
|
},
|
|
3192
3873
|
{
|
|
3193
3874
|
"id": "components-formcontrol-features--with-checkbox-and-radio-inputs",
|
|
@@ -3199,7 +3880,7 @@
|
|
|
3199
3880
|
},
|
|
3200
3881
|
{
|
|
3201
3882
|
"id": "components-formcontrol-features--validation-example",
|
|
3202
|
-
"code": "() => {\n const [value, setValue] = React.useState('mona lisa')\n const [validationResult, setValidationResult] = React.useState('')\n const doesValueContainSpaces = (inputValue: string) => /\\s/g.test(inputValue)\n const handleInputChange = (e: {\n currentTarget: {\n value: React.SetStateAction<string>\n }\n }) => {\n setValue(e.currentTarget.value)\n }\n React.useEffect(() => {\n if (doesValueContainSpaces(value)) {\n setValidationResult('noSpaces')\n } else if (value) {\n setValidationResult('validName')\n }\n }, [value])\n return (\n <FormControl>\n <FormControl.Label>GitHub handle</FormControl.Label>\n <TextInput block value={value} onChange={handleInputChange} />\n {validationResult === 'noSpaces' && (\n <FormControl.Validation variant=\"error\">\n GitHub handles cannot contain spaces\n </FormControl.Validation>\n )}\n {validationResult === 'validName' && (\n <FormControl.Validation variant=\"success\">\n Valid name\n </FormControl.Validation>\n )}\n <FormControl.Caption>\n With or without "@". For example "monalisa" or\n "@monalisa"\n </FormControl.Caption>\n </FormControl>\n )\n}"
|
|
3883
|
+
"code": "() => {\n const [value, setValue] = React.useState('mona lisa')\n const [validationResult, setValidationResult] = React.useState('')\n const doesValueContainSpaces = (inputValue: string) => /\\s/g.test(inputValue)\n const handleInputChange = (e: {\n currentTarget: {\n value: React.SetStateAction<string>\n }\n }) => {\n setValue(e.currentTarget.value)\n }\n React.useEffect(() => {\n if (doesValueContainSpaces(value)) {\n // eslint-disable-next-line react-hooks/set-state-in-effect, react-you-might-not-need-an-effect/no-chain-state-updates\n setValidationResult('noSpaces')\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-event-handler\n } else if (value) {\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-chain-state-updates\n setValidationResult('validName')\n }\n }, [value])\n return (\n <FormControl>\n <FormControl.Label>GitHub handle</FormControl.Label>\n <TextInput block value={value} onChange={handleInputChange} />\n {validationResult === 'noSpaces' && (\n <FormControl.Validation variant=\"error\">\n GitHub handles cannot contain spaces\n </FormControl.Validation>\n )}\n {validationResult === 'validName' && (\n <FormControl.Validation variant=\"success\">\n Valid name\n </FormControl.Validation>\n )}\n <FormControl.Caption>\n With or without "@". For example "monalisa" or\n "@monalisa"\n </FormControl.Caption>\n </FormControl>\n )\n}"
|
|
3203
3884
|
},
|
|
3204
3885
|
{
|
|
3205
3886
|
"id": "components-formcontrol-features--with-select-panel",
|
|
@@ -3567,6 +4248,12 @@
|
|
|
3567
4248
|
"description": "Specify the type of the inline message",
|
|
3568
4249
|
"type": "'critical' | 'success' | 'unvailable' | 'warning'",
|
|
3569
4250
|
"required": true
|
|
4251
|
+
},
|
|
4252
|
+
{
|
|
4253
|
+
"name": "leadingVisual",
|
|
4254
|
+
"description": "A custom leading visual to display instead of the default variant icon.",
|
|
4255
|
+
"type": "React.ElementType | React.ReactNode",
|
|
4256
|
+
"required": false
|
|
3570
4257
|
}
|
|
3571
4258
|
]
|
|
3572
4259
|
},
|
|
@@ -3584,6 +4271,10 @@
|
|
|
3584
4271
|
{
|
|
3585
4272
|
"id": "experimental-components-keybindinghint-features--on-primary",
|
|
3586
4273
|
"code": "(args) => (\n <div className={classes.PrimaryBackground}>\n <KeybindingHint {...args} />\n </div>\n)"
|
|
4274
|
+
},
|
|
4275
|
+
{
|
|
4276
|
+
"id": "experimental-components-keybindinghint-features--platforms",
|
|
4277
|
+
"code": "({ format = 'full', ...args }) => (\n <table className={classes.PlatformTable}>\n <thead>\n <tr>\n <th\n scope=\"col\"\n className={`${classes.PlatformCell} ${classes.PlatformHeader}`}\n >\n Platform\n </th>\n {modifierKeys.map((key) => (\n <th\n scope=\"col\"\n className={`${classes.PlatformCell} ${classes.PlatformHeader}`}\n key={key}\n >\n {key}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {platforms.map(({ platform, label }) => (\n <tr key={platform}>\n <th\n scope=\"row\"\n className={`${classes.PlatformCell} ${classes.PlatformHeader}`}\n >\n {label}\n </th>\n {modifierKeys.map((key) => (\n <td key={key} className={classes.PlatformCell}>\n <PlatformOverrideProvider value={platform}>\n <KeybindingHint {...args} format={format} keys={`${key}+K`} />\n </PlatformOverrideProvider>\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n)"
|
|
3587
4278
|
}
|
|
3588
4279
|
],
|
|
3589
4280
|
"importPath": "@primer/react",
|
|
@@ -3782,18 +4473,12 @@
|
|
|
3782
4473
|
"defaultValue": "false",
|
|
3783
4474
|
"description": "Set to true for links adjacent to text, underlining them for clear visibility and improved accessibility."
|
|
3784
4475
|
},
|
|
3785
|
-
{
|
|
3786
|
-
"name": "underline",
|
|
3787
|
-
"type": "boolean",
|
|
3788
|
-
"defaultValue": "false",
|
|
3789
|
-
"description": "Use `inline` instead.",
|
|
3790
|
-
"deprecated": true
|
|
3791
|
-
},
|
|
3792
4476
|
{
|
|
3793
4477
|
"name": "hoverColor",
|
|
3794
4478
|
"type": "string",
|
|
3795
4479
|
"defaultValue": "",
|
|
3796
|
-
"description": "
|
|
4480
|
+
"description": "Use CSS modules to style hover color.",
|
|
4481
|
+
"deprecated": true
|
|
3797
4482
|
},
|
|
3798
4483
|
{
|
|
3799
4484
|
"name": "ref",
|
|
@@ -3830,6 +4515,10 @@
|
|
|
3830
4515
|
"id": "components-navlist-features--group-with-expand-and-custom-items",
|
|
3831
4516
|
"code": "() => {\n const Item = ({\n leadingVisual: LeadingVisual,\n text,\n trailingVisual: TrailingVisual,\n ...rest\n }: CustomItemProps) => {\n return (\n <NavList.Item onClick={() => {}} href=\"#\" {...rest} key={text}>\n {LeadingVisual ? (\n <NavList.LeadingVisual>\n <LeadingVisual />\n </NavList.LeadingVisual>\n ) : null}\n {text}\n\n {TrailingVisual ? (\n <NavList.TrailingVisual>\n {typeof TrailingVisual === 'string' ? (\n TrailingVisual\n ) : (\n <TrailingVisual />\n )}\n <VisuallyHidden>results</VisuallyHidden>\n </NavList.TrailingVisual>\n ) : null}\n </NavList.Item>\n )\n }\n const items = [\n {\n href: '#',\n text: 'Commits',\n leadingVisual: GitCommitIcon,\n trailingVisual: '32k',\n },\n {\n href: '#',\n text: 'Packages',\n leadingVisual: PackageIcon,\n trailingVisual: '1k',\n },\n {\n href: '#',\n text: 'Wikis',\n leadingVisual: BookIcon,\n trailingVisual: '121',\n },\n {\n href: '#',\n text: 'Topics',\n leadingVisual: MilestoneIcon,\n trailingVisual: '12k',\n },\n {\n href: '#',\n text: 'Marketplace',\n leadingVisual: TelescopeIcon,\n trailingVisual: ArrowRightIcon,\n },\n ]\n return (\n <NavList>\n <NavList.Group>\n <NavList.Item aria-current=\"page\">\n <NavList.LeadingVisual>\n <CodeIcon />\n </NavList.LeadingVisual>\n Code\n <NavList.TrailingVisual>3k</NavList.TrailingVisual>\n </NavList.Item>\n <NavList.Item>\n <NavList.LeadingVisual>\n <RepoIcon />\n </NavList.LeadingVisual>\n Repositories\n <NavList.TrailingVisual>713</NavList.TrailingVisual>\n </NavList.Item>\n <NavList.Item>\n <NavList.LeadingVisual>\n <IssueOpenedIcon />\n </NavList.LeadingVisual>\n Issues\n <NavList.TrailingVisual>6k</NavList.TrailingVisual>\n </NavList.Item>\n <NavList.Item>\n <NavList.LeadingVisual>\n <GitPullRequestIcon />\n </NavList.LeadingVisual>\n Pull requests\n <NavList.TrailingVisual>4k</NavList.TrailingVisual>\n </NavList.Item>\n <NavList.Item>\n <NavList.LeadingVisual>\n <CommentDiscussionIcon />\n </NavList.LeadingVisual>\n Discussions\n <NavList.TrailingVisual>236</NavList.TrailingVisual>\n </NavList.Item>\n <NavList.Item>\n <NavList.LeadingVisual>\n <PeopleIcon />\n </NavList.LeadingVisual>\n Users\n <NavList.TrailingVisual>10k</NavList.TrailingVisual>\n </NavList.Item>\n <NavList.GroupExpand items={items} renderItem={Item} />\n </NavList.Group>\n </NavList>\n )\n}"
|
|
3832
4517
|
},
|
|
4518
|
+
{
|
|
4519
|
+
"id": "components-navlist-features--with-description",
|
|
4520
|
+
"code": "() => (\n <NavList>\n <NavList.Item href=\"#\" aria-current=\"page\">\n <NavList.LeadingVisual>\n <RepoIcon />\n </NavList.LeadingVisual>\n Main Repository\n <NavList.Description>Primary project repository</NavList.Description>\n </NavList.Item>\n <NavList.Item href=\"#\">\n <NavList.LeadingVisual>\n <BookIcon />\n </NavList.LeadingVisual>\n Documentation\n <NavList.Description>\n User guides and API documentation\n </NavList.Description>\n </NavList.Item>\n <NavList.Item href=\"#\">\n <NavList.LeadingVisual>\n <IssueOpenedIcon />\n </NavList.LeadingVisual>\n Bug Reports\n <NavList.Description variant=\"block\">\n Submit and track bug reports for the project. Include detailed steps to\n reproduce, expected behavior, and system information.\n </NavList.Description>\n </NavList.Item>\n <NavList.Item href=\"#\">\n <NavList.LeadingVisual>\n <PeopleIcon />\n </NavList.LeadingVisual>\n Community\n <NavList.Description variant=\"block\">\n Connect with other developers, share ideas, and collaborate on features\n and improvements.\n </NavList.Description>\n </NavList.Item>\n <NavList.Item href=\"#\">\n <NavList.LeadingVisual>\n <GitCommitIcon />\n </NavList.LeadingVisual>\n Recent Changes\n <NavList.Description>Latest commits and releases</NavList.Description>\n </NavList.Item>\n </NavList>\n)"
|
|
4521
|
+
},
|
|
3833
4522
|
{
|
|
3834
4523
|
"id": "components-navlist-features--with-expand",
|
|
3835
4524
|
"code": "() => {\n const items = [\n {\n href: '#',\n text: 'Item 4',\n },\n {\n href: '#',\n text: 'Item 5',\n },\n {\n href: '#',\n text: 'Item 6',\n },\n {\n href: '#',\n text: 'Item 7',\n },\n {\n href: '#',\n text: 'Item 8',\n },\n {\n href: '#',\n text: 'Item 9',\n },\n ]\n return (\n <PageLayout>\n <PageLayout.Pane position=\"start\">\n <NavList>\n <NavList.Item href=\"#\" aria-current=\"page\">\n Item 1\n </NavList.Item>\n <NavList.Item href=\"#\">Item 2</NavList.Item>\n <NavList.Item href=\"#\">Item 3</NavList.Item>\n <NavList.GroupExpand label=\"Show more\" items={items} />\n </NavList>\n </PageLayout.Pane>\n <PageLayout.Content></PageLayout.Content>\n </PageLayout>\n )\n}"
|
|
@@ -3897,6 +4586,12 @@
|
|
|
3897
4586
|
"defaultValue": "",
|
|
3898
4587
|
"description": ""
|
|
3899
4588
|
},
|
|
4589
|
+
{
|
|
4590
|
+
"name": "disableItemGap",
|
|
4591
|
+
"type": "boolean",
|
|
4592
|
+
"defaultValue": "false",
|
|
4593
|
+
"description": "Disable the gap between items when the item gap feature is enabled."
|
|
4594
|
+
},
|
|
3900
4595
|
{
|
|
3901
4596
|
"name": "ref",
|
|
3902
4597
|
"type": "React.RefObject<HTMLElement>"
|
|
@@ -3908,6 +4603,46 @@
|
|
|
3908
4603
|
}
|
|
3909
4604
|
],
|
|
3910
4605
|
"subcomponents": [
|
|
4606
|
+
{
|
|
4607
|
+
"name": "NavList.Heading",
|
|
4608
|
+
"props": [
|
|
4609
|
+
{
|
|
4610
|
+
"name": "as",
|
|
4611
|
+
"type": "'h2' | 'h3'",
|
|
4612
|
+
"defaultValue": "\"h2\"",
|
|
4613
|
+
"required": false,
|
|
4614
|
+
"description": "Semantic heading level for the NavList. Also sets the default level for child group headings, which render one level deeper (h3 under an h2, h4 under an h3). Constrained to h2/h3 so the hierarchy stays shallow."
|
|
4615
|
+
},
|
|
4616
|
+
{
|
|
4617
|
+
"name": "visuallyHidden",
|
|
4618
|
+
"type": "boolean",
|
|
4619
|
+
"defaultValue": "false",
|
|
4620
|
+
"required": false,
|
|
4621
|
+
"description": "Visually hide the heading while keeping it available to assistive technology and as the accessible name for the `nav` landmark."
|
|
4622
|
+
},
|
|
4623
|
+
{
|
|
4624
|
+
"name": "children",
|
|
4625
|
+
"type": "ReactNode",
|
|
4626
|
+
"required": true,
|
|
4627
|
+
"description": "The text rendered as the NavList's heading."
|
|
4628
|
+
},
|
|
4629
|
+
{
|
|
4630
|
+
"name": "id",
|
|
4631
|
+
"type": "string",
|
|
4632
|
+
"description": "Custom id for the heading element. When set, it is used as the `aria-labelledby` target that names the `nav` landmark; otherwise a generated id is used."
|
|
4633
|
+
},
|
|
4634
|
+
{
|
|
4635
|
+
"name": "className",
|
|
4636
|
+
"type": "string",
|
|
4637
|
+
"description": "Custom CSS class name."
|
|
4638
|
+
},
|
|
4639
|
+
{
|
|
4640
|
+
"name": "style",
|
|
4641
|
+
"type": "React.CSSProperties",
|
|
4642
|
+
"description": "Custom CSS styles."
|
|
4643
|
+
}
|
|
4644
|
+
]
|
|
4645
|
+
},
|
|
3911
4646
|
{
|
|
3912
4647
|
"name": "NavList.Item",
|
|
3913
4648
|
"props": [
|
|
@@ -3949,6 +4684,33 @@
|
|
|
3949
4684
|
"url": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#Attributes"
|
|
3950
4685
|
}
|
|
3951
4686
|
},
|
|
4687
|
+
{
|
|
4688
|
+
"name": "NavList.Description",
|
|
4689
|
+
"props": [
|
|
4690
|
+
{
|
|
4691
|
+
"name": "variant",
|
|
4692
|
+
"type": "'inline' | 'block'",
|
|
4693
|
+
"defaultValue": "'inline'",
|
|
4694
|
+
"description": "`inline` descriptions are positioned beside primary text. `block` descriptions are positioned below primary text."
|
|
4695
|
+
},
|
|
4696
|
+
{
|
|
4697
|
+
"name": "truncate",
|
|
4698
|
+
"type": "boolean",
|
|
4699
|
+
"defaultValue": "false",
|
|
4700
|
+
"description": "Whether the inline description should truncate the text on overflow."
|
|
4701
|
+
},
|
|
4702
|
+
{
|
|
4703
|
+
"name": "className",
|
|
4704
|
+
"type": "string",
|
|
4705
|
+
"description": "Custom CSS class name."
|
|
4706
|
+
},
|
|
4707
|
+
{
|
|
4708
|
+
"name": "style",
|
|
4709
|
+
"type": "React.CSSProperties",
|
|
4710
|
+
"description": "Custom CSS styles."
|
|
4711
|
+
}
|
|
4712
|
+
]
|
|
4713
|
+
},
|
|
3952
4714
|
{
|
|
3953
4715
|
"name": "NavList.LeadingVisual",
|
|
3954
4716
|
"props": [
|
|
@@ -3991,6 +4753,12 @@
|
|
|
3991
4753
|
"type": "string",
|
|
3992
4754
|
"description": "The text that gets rendered as the group's heading. Alternatively, you can pass the `NavList.GroupHeading` component as a child of `NavList.Group`.\nIf both `title` and `NavList.GroupHeading` are passed, `NavList.GroupHeading` will be rendered as the heading."
|
|
3993
4755
|
},
|
|
4756
|
+
{
|
|
4757
|
+
"name": "hideDivider",
|
|
4758
|
+
"type": "boolean",
|
|
4759
|
+
"defaultValue": "false",
|
|
4760
|
+
"description": "Whether to hide the divider that is rendered before the group."
|
|
4761
|
+
},
|
|
3994
4762
|
{
|
|
3995
4763
|
"name": "ref",
|
|
3996
4764
|
"type": "React.RefObject<HTMLElement>"
|
|
@@ -4024,6 +4792,12 @@
|
|
|
4024
4792
|
{
|
|
4025
4793
|
"name": "ref",
|
|
4026
4794
|
"type": "React.RefObject<HTMLElement>"
|
|
4795
|
+
},
|
|
4796
|
+
{
|
|
4797
|
+
"name": "as",
|
|
4798
|
+
"description": "Heading level for the group heading. Sets the semantic heading tag. Defaults to one level below a `NavList.Heading` (h3 under an h2, h4 under an h3), or `h3` when there is no `NavList.Heading`.",
|
|
4799
|
+
"required": false,
|
|
4800
|
+
"type": "'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'"
|
|
4027
4801
|
}
|
|
4028
4802
|
]
|
|
4029
4803
|
},
|
|
@@ -4173,6 +4947,12 @@
|
|
|
4173
4947
|
],
|
|
4174
4948
|
"importPath": "@primer/react",
|
|
4175
4949
|
"props": [
|
|
4950
|
+
{
|
|
4951
|
+
"name": "preventFocusOnClose",
|
|
4952
|
+
"type": "boolean",
|
|
4953
|
+
"defaultValue": "false",
|
|
4954
|
+
"description": "If true, focus will not be returned to returnFocusRef when the Overlay is unmounted. Consumers must manage focus themselves."
|
|
4955
|
+
},
|
|
4176
4956
|
{
|
|
4177
4957
|
"name": "returnFocusRef",
|
|
4178
4958
|
"type": "React.RefObject<HTMLElement>",
|
|
@@ -4698,7 +5478,7 @@
|
|
|
4698
5478
|
},
|
|
4699
5479
|
{
|
|
4700
5480
|
"id": "components-pagelayout-features--pull-request-page",
|
|
4701
|
-
"code": "() => (\n <PageLayout>\n <PageLayout.Header>\n <div className={classes.HeaderStack}>\n <div>\n <Heading as=\"h1\" className={classes.TitleHeading}>\n Input validation styles{' '}\n <Text className={classes.TitleSubdued}>#1831</Text>\n </Heading>\n <div className={classes.StatusRow}>\n <StateLabel status=\"pullOpened\">Open</StateLabel>\n <Text className={classes.StatusMeta}>\n <Link href=\"#\" muted className={classes.BoldMetaLink}>\n mperrotti\n </Link>{' '}\n wants to merge 3 commits into{' '}\n <BranchName href=\"#\">main</BranchName> from{' '}\n <BranchName href=\"#\">mp/validation-styles</BranchName>\n </Text>\n </div>\n </div>\n <TabNav>\n <TabNav.Link href=\"#\" selected>\n Conversation\n </TabNav.Link>\n <TabNav.Link href=\"#\">Commits</TabNav.Link>\n <TabNav.Link href=\"#\">Checks</TabNav.Link>\n <TabNav.Link href=\"#\">Files changed</TabNav.Link>\n </TabNav>\n </div>\n </PageLayout.Header>\n <PageLayout.Content>\n <div className={classes.ContentBox}></div>\n <div className={classes.ScrollBox} tabIndex={0}>\n This box has really long content. If it is too long, it will cause x\n overflow and should show a scrollbar. When this overflows, it should not\n break to overall page layout!\n </div>\n </PageLayout.Content>\n <PageLayout.Pane aria-label=\"Side pane\">\n <div className={classes.PaneStack}>\n <div>\n <Text className={classes.PaneSectionHeading}>Assignees</Text>\n <Text className={classes.PaneMetaText}>\n No one –{' '}\n <Link href=\"#\" muted>\n assign yourself\n </Link>\n </Text>\n </div>\n <div role=\"separator\" className={classes.PaneSeparator}></div>\n <div>\n <Text className={classes.PaneSectionHeading}>Labels</Text>\n <Text className={classes.PaneMetaText}>None yet</Text>\n </div>\n </div>\n </PageLayout.Pane>\n </PageLayout>\n)"
|
|
5481
|
+
"code": "() => (\n <PageLayout>\n <PageLayout.Header>\n <div className={classes.HeaderStack}>\n <div>\n <Heading as=\"h1\" className={classes.TitleHeading}>\n Input validation styles{' '}\n <Text className={classes.TitleSubdued}>#1831</Text>\n </Heading>\n <div className={classes.StatusRow}>\n <StateLabel status=\"pullOpened\">Open</StateLabel>\n <Text className={classes.StatusMeta}>\n <Link href=\"#\" muted className={classes.BoldMetaLink}>\n mperrotti\n </Link>{' '}\n wants to merge 3 commits into{' '}\n <BranchName href=\"#\">main</BranchName> from{' '}\n <BranchName href=\"#\">mp/validation-styles</BranchName>\n </Text>\n </div>\n </div>\n <TabNav>\n <TabNav.Link href=\"#\" selected>\n Conversation\n </TabNav.Link>\n <TabNav.Link href=\"#\">Commits</TabNav.Link>\n <TabNav.Link href=\"#\">Checks</TabNav.Link>\n <TabNav.Link href=\"#\">Files changed</TabNav.Link>\n </TabNav>\n </div>\n </PageLayout.Header>\n <PageLayout.Content>\n <div className={classes.ContentBox}></div>\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n <div className={classes.ScrollBox} tabIndex={0}>\n This box has really long content. If it is too long, it will cause x\n overflow and should show a scrollbar. When this overflows, it should not\n break to overall page layout!\n </div>\n </PageLayout.Content>\n <PageLayout.Pane aria-label=\"Side pane\">\n <div className={classes.PaneStack}>\n <div>\n <Text className={classes.PaneSectionHeading}>Assignees</Text>\n <Text className={classes.PaneMetaText}>\n No one –{' '}\n <Link href=\"#\" muted>\n assign yourself\n </Link>\n </Text>\n </div>\n <div role=\"separator\" className={classes.PaneSeparator}></div>\n <div>\n <Text className={classes.PaneSectionHeading}>Labels</Text>\n <Text className={classes.PaneMetaText}>None yet</Text>\n </div>\n </div>\n </PageLayout.Pane>\n </PageLayout>\n)"
|
|
4702
5482
|
},
|
|
4703
5483
|
{
|
|
4704
5484
|
"id": "components-pagelayout-features--sticky-pane",
|
|
@@ -4706,7 +5486,7 @@
|
|
|
4706
5486
|
},
|
|
4707
5487
|
{
|
|
4708
5488
|
"id": "components-pagelayout-features--nested-scroll-container",
|
|
4709
|
-
"code": "(args) => (\n <div className={classes.NestedScrollContainer}>\n <Placeholder label=\"Above scroll container\" height={120} />\n <div className={classes.OverflowAuto}>\n <PageLayout\n rowGap=\"none\"\n columnGap=\"none\"\n padding=\"none\"\n containerWidth=\"full\"\n >\n <PageLayout.Header padding=\"normal\" divider=\"line\">\n <Placeholder label=\"Header\" height={64} />\n </PageLayout.Header>\n <PageLayout.Content padding=\"normal\" width=\"large\">\n <div\n className={classes.ContentGrid}\n tabIndex={0}\n role=\"region\"\n aria-label=\"Page content\"\n >\n {Array.from({\n length: args.numParagraphsInContent,\n }).map((_, i) => (\n <p key={i} className={classes.Paragraph}>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at\n enim id lorem tempus egestas a non ipsum. Maecenas imperdiet\n ante quam, at varius lorem molestie vel. Sed at eros consequat,\n varius tellus et, auctor felis. Donec pulvinar lacinia urna nec\n commodo. Phasellus at imperdiet risus. Donec sit amet massa\n purus. Nunc sem lectus, bibendum a sapien nec, tristique tempus\n felis. Ut porttitor auctor tellus in imperdiet. Ut blandit\n tincidunt augue, quis fringilla nunc tincidunt sed. Vestibulum\n auctor euismod nisi. Nullam tincidunt est in mi tincidunt\n dictum. Sed consectetur aliquet velit ut ornare.\n </p>\n ))}\n </div>\n </PageLayout.Content>\n <PageLayout.Pane\n position=\"start\"\n padding=\"normal\"\n divider=\"line\"\n sticky\n aria-label=\"Side pane\"\n >\n <div className={classes.ContentGrid}>\n {Array.from({\n length: args.numParagraphsInPane,\n }).map((_, i) => (\n <p key={i} className={classes.Paragraph}>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at\n enim id lorem tempus egestas a non ipsum. Maecenas imperdiet\n ante quam, at varius lorem molestie vel. Sed at eros consequat,\n varius tellus et, auctor felis. Donec pulvinar lacinia urna nec\n commodo. Phasellus at imperdiet risus. Donec sit amet massa\n purus.\n </p>\n ))}\n </div>\n </PageLayout.Pane>\n <PageLayout.Footer padding=\"normal\" divider=\"line\">\n <Placeholder label=\"Footer\" height={64} />\n </PageLayout.Footer>\n </PageLayout>\n </div>\n <Placeholder label=\"Below scroll container\" height={120} />\n </div>\n)"
|
|
5489
|
+
"code": "(args) => (\n <div className={classes.NestedScrollContainer}>\n <Placeholder label=\"Above scroll container\" height={120} />\n <div className={classes.OverflowAuto}>\n <PageLayout\n rowGap=\"none\"\n columnGap=\"none\"\n padding=\"none\"\n containerWidth=\"full\"\n >\n <PageLayout.Header padding=\"normal\" divider=\"line\">\n <Placeholder label=\"Header\" height={64} />\n </PageLayout.Header>\n <PageLayout.Content padding=\"normal\" width=\"large\">\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n <div\n className={classes.ContentGrid}\n tabIndex={0}\n role=\"region\"\n aria-label=\"Page content\"\n >\n {Array.from({\n length: args.numParagraphsInContent,\n }).map((_, i) => (\n <p key={i} className={classes.Paragraph}>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at\n enim id lorem tempus egestas a non ipsum. Maecenas imperdiet\n ante quam, at varius lorem molestie vel. Sed at eros consequat,\n varius tellus et, auctor felis. Donec pulvinar lacinia urna nec\n commodo. Phasellus at imperdiet risus. Donec sit amet massa\n purus. Nunc sem lectus, bibendum a sapien nec, tristique tempus\n felis. Ut porttitor auctor tellus in imperdiet. Ut blandit\n tincidunt augue, quis fringilla nunc tincidunt sed. Vestibulum\n auctor euismod nisi. Nullam tincidunt est in mi tincidunt\n dictum. Sed consectetur aliquet velit ut ornare.\n </p>\n ))}\n </div>\n </PageLayout.Content>\n <PageLayout.Pane\n position=\"start\"\n padding=\"normal\"\n divider=\"line\"\n sticky\n aria-label=\"Side pane\"\n >\n <div className={classes.ContentGrid}>\n {Array.from({\n length: args.numParagraphsInPane,\n }).map((_, i) => (\n <p key={i} className={classes.Paragraph}>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at\n enim id lorem tempus egestas a non ipsum. Maecenas imperdiet\n ante quam, at varius lorem molestie vel. Sed at eros consequat,\n varius tellus et, auctor felis. Donec pulvinar lacinia urna nec\n commodo. Phasellus at imperdiet risus. Donec sit amet massa\n purus.\n </p>\n ))}\n </div>\n </PageLayout.Pane>\n <PageLayout.Footer padding=\"normal\" divider=\"line\">\n <Placeholder label=\"Footer\" height={64} />\n </PageLayout.Footer>\n </PageLayout>\n </div>\n <Placeholder label=\"Below scroll container\" height={120} />\n </div>\n)"
|
|
4710
5490
|
},
|
|
4711
5491
|
{
|
|
4712
5492
|
"id": "components-pagelayout-features--custom-sticky-header",
|
|
@@ -4718,7 +5498,7 @@
|
|
|
4718
5498
|
},
|
|
4719
5499
|
{
|
|
4720
5500
|
"id": "components-pagelayout-features--scroll-container-within-page-layout-pane",
|
|
4721
|
-
"code": "() => (\n <div className={classes.NestedScrollContainer}>\n <div className={classes.OverflowAuto}>\n <Placeholder label=\"Above inner scroll container\" height={120} />\n <PageLayout\n rowGap=\"none\"\n columnGap=\"none\"\n padding=\"none\"\n containerWidth=\"full\"\n >\n <PageLayout.Pane\n position=\"start\"\n padding=\"normal\"\n divider=\"line\"\n sticky\n aria-label=\"Sticky pane\"\n >\n <div className={classes.OverflowAuto}>\n <PageLayout.Pane padding=\"normal\" aria-label=\"Side pane\">\n <Placeholder label=\"Inner scroll container\" height={800} />\n </PageLayout.Pane>\n </div>\n </PageLayout.Pane>\n <PageLayout.Content padding=\"normal\" width=\"large\">\n <div\n className={classes.ContentGrid}\n tabIndex={0}\n role=\"region\"\n aria-label=\"Page content\"\n >\n <Placeholder label=\"Page content\" height={1600} />\n </div>\n </PageLayout.Content>\n </PageLayout>\n <Placeholder label=\"Beneath inner scroll container\" height={120} />\n </div>\n </div>\n)"
|
|
5501
|
+
"code": "() => (\n <div className={classes.NestedScrollContainer}>\n <div className={classes.OverflowAuto}>\n <Placeholder label=\"Above inner scroll container\" height={120} />\n <PageLayout\n rowGap=\"none\"\n columnGap=\"none\"\n padding=\"none\"\n containerWidth=\"full\"\n >\n <PageLayout.Pane\n position=\"start\"\n padding=\"normal\"\n divider=\"line\"\n sticky\n aria-label=\"Sticky pane\"\n >\n <div className={classes.OverflowAuto}>\n <PageLayout.Pane padding=\"normal\" aria-label=\"Side pane\">\n <Placeholder label=\"Inner scroll container\" height={800} />\n </PageLayout.Pane>\n </div>\n </PageLayout.Pane>\n <PageLayout.Content padding=\"normal\" width=\"large\">\n {/* eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex */}\n <div\n className={classes.ContentGrid}\n tabIndex={0}\n role=\"region\"\n aria-label=\"Page content\"\n >\n <Placeholder label=\"Page content\" height={1600} />\n </div>\n </PageLayout.Content>\n </PageLayout>\n <Placeholder label=\"Beneath inner scroll container\" height={120} />\n </div>\n </div>\n)"
|
|
4722
5502
|
},
|
|
4723
5503
|
{
|
|
4724
5504
|
"id": "components-pagelayout-features--custom-pane-widths",
|
|
@@ -4727,6 +5507,54 @@
|
|
|
4727
5507
|
{
|
|
4728
5508
|
"id": "components-pagelayout-features--with-custom-pane-heading",
|
|
4729
5509
|
"code": "() => (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Pane resizable position=\"start\" aria-label=\"Side pane\">\n <Heading as=\"h2\" className={classes.PaneHeading} id=\"pane-heading\">\n Pane Heading\n </Heading>\n <Placeholder height={320} label=\"Pane\" />\n </PageLayout.Pane>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n)"
|
|
5510
|
+
},
|
|
5511
|
+
{
|
|
5512
|
+
"id": "components-pagelayout-features--resizable-pane-without-persistence",
|
|
5513
|
+
"code": "() => {\n const [currentWidth, setCurrentWidth] = React.useState<number>(\n defaultPaneWidth.medium,\n )\n return (\n <PageLayout>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Pane\n resizable\n currentWidth={currentWidth}\n onResizeEnd={setCurrentWidth}\n aria-label=\"Side pane\"\n >\n <Placeholder\n height={320}\n label={`Pane (resizable, not persisted, width: ${currentWidth}px)`}\n />\n </PageLayout.Pane>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n )\n}"
|
|
5514
|
+
},
|
|
5515
|
+
{
|
|
5516
|
+
"id": "components-pagelayout-features--resizable-pane-with-custom-persistence",
|
|
5517
|
+
"code": "() => {\n const key = 'page-layout-features-stories-custom-persistence-pane-width'\n\n // Read initial width from localStorage (CSR only), falling back to medium preset\n const getInitialWidth = (): number => {\n if (typeof window !== 'undefined') {\n const storedWidth = localStorage.getItem(key)\n if (storedWidth !== null) {\n const parsed = parseFloat(storedWidth)\n if (!isNaN(parsed) && parsed > 0) {\n return parsed\n }\n }\n }\n return defaultPaneWidth.medium\n }\n const [currentWidth, setCurrentWidth] =\n React.useState<number>(getInitialWidth)\n useIsomorphicLayoutEffect(() => {\n setCurrentWidth(getInitialWidth())\n }, [])\n const handleWidthChange = (width: number) => {\n setCurrentWidth(width)\n localStorage.setItem(key, width.toString())\n }\n return (\n <PageLayout>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Pane\n width={{\n min: '256px',\n default: `${defaultPaneWidth.medium}px`,\n max: '600px',\n }}\n resizable\n currentWidth={currentWidth}\n onResizeEnd={handleWidthChange}\n aria-label=\"Side pane\"\n >\n <Placeholder height={320} label={`Pane (width: ${currentWidth}px)`} />\n </PageLayout.Pane>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n )\n}"
|
|
5518
|
+
},
|
|
5519
|
+
{
|
|
5520
|
+
"id": "components-pagelayout-features--resizable-pane-with-number-width",
|
|
5521
|
+
"code": "() => {\n const key = 'page-layout-features-stories-number-width'\n\n // Read initial width from localStorage (CSR only), falling back to medium preset\n const getInitialWidth = (): number => {\n if (typeof window !== 'undefined') {\n const storedWidth = localStorage.getItem(key)\n if (storedWidth !== null) {\n const parsed = parseInt(storedWidth, 10)\n if (!isNaN(parsed) && parsed > 0) {\n return parsed\n }\n }\n }\n return defaultPaneWidth.medium\n }\n const [currentWidth, setCurrentWidth] =\n React.useState<number>(getInitialWidth)\n const handleWidthChange = (newWidth: number) => {\n setCurrentWidth(newWidth)\n localStorage.setItem(key, newWidth.toString())\n }\n return (\n <PageLayout>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Pane\n width=\"medium\"\n resizable\n currentWidth={currentWidth}\n onResizeEnd={handleWidthChange}\n aria-label=\"Side pane\"\n >\n <Placeholder height={320} label={`Pane (width: ${currentWidth}px)`} />\n </PageLayout.Pane>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n )\n}"
|
|
5522
|
+
},
|
|
5523
|
+
{
|
|
5524
|
+
"id": "components-pagelayout-features--resizable-pane-with-controlled-width",
|
|
5525
|
+
"code": "() => {\n const key = 'page-layout-features-stories-controlled-width'\n\n // Read initial width from localStorage (CSR only), falling back to medium preset\n const getInitialWidth = (): number => {\n if (typeof window !== 'undefined') {\n const storedWidth = localStorage.getItem(key)\n if (storedWidth !== null) {\n const parsed = parseInt(storedWidth, 10)\n if (!isNaN(parsed) && parsed > 0) {\n return parsed\n }\n }\n }\n return defaultPaneWidth.medium\n }\n const [currentWidth, setCurrentWidth] =\n React.useState<number>(getInitialWidth)\n const handleWidthChange = (newWidth: number) => {\n setCurrentWidth(newWidth)\n localStorage.setItem(key, newWidth.toString())\n }\n return (\n <PageLayout>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Pane\n width={{\n min: '256px',\n default: '296px',\n max: '600px',\n }}\n resizable\n currentWidth={currentWidth}\n onResizeEnd={handleWidthChange}\n aria-label=\"Side pane\"\n >\n <Placeholder height={320} label={`Pane (current: ${currentWidth}px)`} />\n </PageLayout.Pane>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n )\n}"
|
|
5526
|
+
},
|
|
5527
|
+
{
|
|
5528
|
+
"id": "components-pagelayout-features--sidebar-start",
|
|
5529
|
+
"code": "() => (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar position=\"start\" aria-label=\"Navigation sidebar\">\n <Placeholder height={800} label=\"Sidebar (Start)\" />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n)"
|
|
5530
|
+
},
|
|
5531
|
+
{
|
|
5532
|
+
"id": "components-pagelayout-features--sidebar-end",
|
|
5533
|
+
"code": "() => (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar position=\"end\" aria-label=\"Inspector sidebar\">\n <Placeholder height={800} label=\"Sidebar (End)\" />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n)"
|
|
5534
|
+
},
|
|
5535
|
+
{
|
|
5536
|
+
"id": "components-pagelayout-features--resizable-sidebar",
|
|
5537
|
+
"code": "() => (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar\n resizable\n position=\"end\"\n aria-label=\"Resizable sidebar\"\n style={{\n height: 'auto',\n }}\n width={{\n min: '200px',\n default: '300px',\n max: '2000px',\n }}\n >\n <Placeholder height=\"100%\" label=\"Resizable Sidebar\" />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Pane position=\"start\" aria-label=\"Side pane\">\n <Placeholder height={320} label=\"Pane\" />\n </PageLayout.Pane>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n)"
|
|
5538
|
+
},
|
|
5539
|
+
{
|
|
5540
|
+
"id": "components-pagelayout-features--resizable-sidebar-without-persistence",
|
|
5541
|
+
"code": "() => {\n const [currentWidth, setCurrentWidth] = React.useState<number>(300)\n return (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar\n resizable\n position=\"start\"\n currentWidth={currentWidth}\n onResizeEnd={setCurrentWidth}\n aria-label=\"Resizable sidebar (controlled)\"\n style={{\n height: 'auto',\n }}\n width={{\n min: '200px',\n default: '300px',\n max: '600px',\n }}\n >\n <Placeholder\n height=\"100%\"\n label={`Sidebar (controlled, width: ${currentWidth}px)`}\n />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n )\n}"
|
|
5542
|
+
},
|
|
5543
|
+
{
|
|
5544
|
+
"id": "components-pagelayout-features--resizable-sidebar-with-custom-persistence",
|
|
5545
|
+
"code": "() => {\n const key = 'page-layout-features-stories-custom-persistence-sidebar-width'\n\n // Read initial width from localStorage (CSR only), falling back to medium preset\n const getInitialWidth = (): number => {\n if (typeof window !== 'undefined') {\n const storedWidth = localStorage.getItem(key)\n if (storedWidth !== null) {\n const parsed = parseFloat(storedWidth)\n if (!isNaN(parsed) && parsed > 0) {\n return parsed\n }\n }\n }\n return defaultPaneWidth.medium\n }\n const [currentWidth, setCurrentWidth] =\n React.useState<number>(getInitialWidth)\n useIsomorphicLayoutEffect(() => {\n setCurrentWidth(getInitialWidth())\n }, [])\n const handleWidthChange = (width: number) => {\n setCurrentWidth(width)\n localStorage.setItem(key, width.toString())\n }\n return (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar\n resizable\n position=\"start\"\n currentWidth={currentWidth}\n onResizeEnd={handleWidthChange}\n aria-label=\"Resizable sidebar (custom persistence)\"\n style={{\n height: 'auto',\n }}\n width={{\n min: '200px',\n default: `${defaultPaneWidth.medium}px`,\n max: '600px',\n }}\n >\n <Placeholder\n height=\"100%\"\n label={`Sidebar (width: ${currentWidth}px)`}\n />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n )\n}"
|
|
5546
|
+
},
|
|
5547
|
+
{
|
|
5548
|
+
"id": "components-pagelayout-features--sidebar-with-pane-resizable",
|
|
5549
|
+
"code": "() => (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar\n style={{\n height: 'auto',\n }}\n resizable\n position=\"end\"\n aria-label=\"Navigation sidebar\"\n width={{\n min: '200px',\n default: '300px',\n max: '2000px',\n }}\n >\n <Placeholder height=\"100%\" label=\"Resizable Sidebar\" />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Pane resizable position=\"start\" aria-label=\"Side pane\">\n <Placeholder height={320} label=\"Resizable Pane\" />\n </PageLayout.Pane>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n)"
|
|
5550
|
+
},
|
|
5551
|
+
{
|
|
5552
|
+
"id": "components-pagelayout-features--sticky-sidebar",
|
|
5553
|
+
"code": "() => (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar sticky position=\"start\" aria-label=\"Sticky sidebar\">\n <Placeholder height={200} label=\"Sticky Sidebar\" />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Content>\n <Placeholder height={2000} label=\"Tall Content (scroll to test sticky)\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n)"
|
|
5554
|
+
},
|
|
5555
|
+
{
|
|
5556
|
+
"id": "components-pagelayout-features--sidebar-fullscreen-responsive-variant",
|
|
5557
|
+
"code": "() => (\n <PageLayout containerWidth=\"full\">\n <PageLayout.Sidebar\n position=\"start\"\n responsiveVariant=\"fullscreen\"\n aria-label=\"Fullscreen sidebar\"\n >\n <Placeholder height={800} label=\"Sidebar (fullscreen at narrow)\" />\n </PageLayout.Sidebar>\n <PageLayout.Header>\n <Placeholder height={64} label=\"Header\" />\n </PageLayout.Header>\n <PageLayout.Content>\n <Placeholder height={640} label=\"Content\" />\n </PageLayout.Content>\n <PageLayout.Footer>\n <Placeholder height={64} label=\"Footer\" />\n </PageLayout.Footer>\n </PageLayout>\n)"
|
|
4730
5558
|
}
|
|
4731
5559
|
],
|
|
4732
5560
|
"importPath": "@primer/react",
|
|
@@ -4833,96 +5661,190 @@
|
|
|
4833
5661
|
"description": "The amount of padding inside the content."
|
|
4834
5662
|
},
|
|
4835
5663
|
{
|
|
4836
|
-
"name": "hidden",
|
|
4837
|
-
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
|
|
4838
|
-
"defaultValue": "false",
|
|
4839
|
-
"description": "Whether the content is hidden."
|
|
5664
|
+
"name": "hidden",
|
|
5665
|
+
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
|
|
5666
|
+
"defaultValue": "false",
|
|
5667
|
+
"description": "Whether the content is hidden."
|
|
5668
|
+
}
|
|
5669
|
+
]
|
|
5670
|
+
},
|
|
5671
|
+
{
|
|
5672
|
+
"name": "PageLayout.Pane",
|
|
5673
|
+
"props": [
|
|
5674
|
+
{
|
|
5675
|
+
"name": "aria-label",
|
|
5676
|
+
"type": "string | undefined",
|
|
5677
|
+
"description": "Label for the pane. Required if the pane overflows and doesn't have aria-labelledby."
|
|
5678
|
+
},
|
|
5679
|
+
{
|
|
5680
|
+
"name": "aria-labelledby",
|
|
5681
|
+
"type": "string | undefined",
|
|
5682
|
+
"description": "Id of an element that acts as a label for the pane. Required if the pane overflows and doesn't have aria-label."
|
|
5683
|
+
},
|
|
5684
|
+
{
|
|
5685
|
+
"name": "width",
|
|
5686
|
+
"type": "| 'small' | 'medium' | 'large' | { min: string max: string default: string }",
|
|
5687
|
+
"defaultValue": "'medium'",
|
|
5688
|
+
"description": "The width of the pane. If using custom widths, provide an object with keys 'min', 'max' and 'default'."
|
|
5689
|
+
},
|
|
5690
|
+
{
|
|
5691
|
+
"name": "minWidth",
|
|
5692
|
+
"type": "number",
|
|
5693
|
+
"defaultValue": "256",
|
|
5694
|
+
"description": "The minimum width of the pane."
|
|
5695
|
+
},
|
|
5696
|
+
{
|
|
5697
|
+
"name": "resizable",
|
|
5698
|
+
"type": "boolean",
|
|
5699
|
+
"defaultValue": "false",
|
|
5700
|
+
"description": "When true, the pane may be resized by the user. Uses localStorage persistence by default. Note: with default persistence in SSR, the server-rendered width may differ from the stored client width, causing a brief layout shift on hydration. Use `onResizeEnd` with server-aware storage to avoid this."
|
|
5701
|
+
},
|
|
5702
|
+
{
|
|
5703
|
+
"name": "currentWidth",
|
|
5704
|
+
"type": "number | undefined",
|
|
5705
|
+
"description": "Current/controlled width value in pixels. Required when `onResizeEnd` is provided. Pass `undefined` when the persisted value has not loaded yet. The `width` prop still defines the default used when resetting (e.g., double-click)."
|
|
5706
|
+
},
|
|
5707
|
+
{
|
|
5708
|
+
"name": "onResizeEnd",
|
|
5709
|
+
"type": "(width: number) => void",
|
|
5710
|
+
"description": "Callback fired when a resize operation ends (drag release or keyboard key up). When provided, replaces localStorage persistence. Requires `currentWidth`."
|
|
5711
|
+
},
|
|
5712
|
+
{
|
|
5713
|
+
"name": "widthStorageKey",
|
|
5714
|
+
"type": "string",
|
|
5715
|
+
"defaultValue": "'paneWidth'",
|
|
5716
|
+
"description": "localStorage key used to persist the pane width across sessions. Only applies when `resizable` is `true` and no `onResizeEnd` callback is provided."
|
|
5717
|
+
},
|
|
5718
|
+
{
|
|
5719
|
+
"name": "sticky",
|
|
5720
|
+
"type": "boolean",
|
|
5721
|
+
"defaultValue": "false",
|
|
5722
|
+
"description": "Whether the pane should stick to the top of the screen while the content scrolls."
|
|
5723
|
+
},
|
|
5724
|
+
{
|
|
5725
|
+
"name": "offsetHeader",
|
|
5726
|
+
"type": "number | string",
|
|
5727
|
+
"defaultValue": "0",
|
|
5728
|
+
"description": "Use offsetHeader along with the sticky prop to push the sticky pane down to make room for a sticky header if necessary. Use the type `string` to specify the height with a unit i.e. 5rem; otherwise the type `number` will be taken as px."
|
|
5729
|
+
},
|
|
5730
|
+
{
|
|
5731
|
+
"name": "padding",
|
|
5732
|
+
"type": "| 'none' | 'condensed' | 'normal'",
|
|
5733
|
+
"defaultValue": "'none'",
|
|
5734
|
+
"description": "The amount of padding inside the pane."
|
|
5735
|
+
},
|
|
5736
|
+
{
|
|
5737
|
+
"name": "divider",
|
|
5738
|
+
"type": "| 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' }",
|
|
5739
|
+
"defaultValue": "'none'",
|
|
5740
|
+
"description": ""
|
|
5741
|
+
},
|
|
5742
|
+
{
|
|
5743
|
+
"name": "dividerWhenNarrow",
|
|
5744
|
+
"type": "| 'inherit' | 'none' | 'line' | 'filled'",
|
|
5745
|
+
"defaultValue": "'inherit'",
|
|
5746
|
+
"deprecated": true,
|
|
5747
|
+
"description": "Use the divider prop with a responsive value instead."
|
|
5748
|
+
},
|
|
5749
|
+
{
|
|
5750
|
+
"name": "hidden",
|
|
5751
|
+
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
|
|
5752
|
+
"defaultValue": "false",
|
|
5753
|
+
"description": "Whether the pane is hidden."
|
|
5754
|
+
},
|
|
5755
|
+
{
|
|
5756
|
+
"name": "position",
|
|
5757
|
+
"type": "'end' | 'start' | { narrow?: 'end' | 'start'; regular?: 'end' | 'start'; wide?: 'end' | 'start'; }",
|
|
5758
|
+
"description": "Which side of the page the pane should be on. Can be changed for different viewport widths.",
|
|
5759
|
+
"defaultValue": ""
|
|
5760
|
+
},
|
|
5761
|
+
{
|
|
5762
|
+
"name": "ref",
|
|
5763
|
+
"type": "React.RefObject<HTMLDivElement>"
|
|
4840
5764
|
}
|
|
4841
5765
|
]
|
|
4842
5766
|
},
|
|
4843
5767
|
{
|
|
4844
|
-
"name": "PageLayout.
|
|
5768
|
+
"name": "PageLayout.Sidebar",
|
|
4845
5769
|
"props": [
|
|
4846
5770
|
{
|
|
4847
5771
|
"name": "aria-label",
|
|
4848
5772
|
"type": "string | undefined",
|
|
4849
|
-
"description": "
|
|
5773
|
+
"description": "A unique label for the sidebar region."
|
|
4850
5774
|
},
|
|
4851
5775
|
{
|
|
4852
5776
|
"name": "aria-labelledby",
|
|
4853
5777
|
"type": "string | undefined",
|
|
4854
|
-
"description": "
|
|
5778
|
+
"description": "An id to an element which uniquely labels the sidebar region."
|
|
5779
|
+
},
|
|
5780
|
+
{
|
|
5781
|
+
"name": "position",
|
|
5782
|
+
"type": "'start' | 'end'",
|
|
5783
|
+
"defaultValue": "'start'",
|
|
5784
|
+
"description": "Position of the sidebar relative to the page layout. The sidebar spans the full height of the layout, adjacent to the header, content, and footer."
|
|
4855
5785
|
},
|
|
4856
5786
|
{
|
|
4857
5787
|
"name": "width",
|
|
4858
5788
|
"type": "| 'small' | 'medium' | 'large' | { min: string max: string default: string }",
|
|
4859
5789
|
"defaultValue": "'medium'",
|
|
4860
|
-
"description": "The width of the
|
|
5790
|
+
"description": "The width of the sidebar. If using custom widths, provide an object with keys 'min', 'max' and 'default'."
|
|
4861
5791
|
},
|
|
4862
5792
|
{
|
|
4863
5793
|
"name": "minWidth",
|
|
4864
5794
|
"type": "number",
|
|
4865
5795
|
"defaultValue": "256",
|
|
4866
|
-
"description": "
|
|
5796
|
+
"description": "Minimum width of the sidebar when resizable."
|
|
4867
5797
|
},
|
|
4868
5798
|
{
|
|
4869
5799
|
"name": "resizable",
|
|
4870
5800
|
"type": "boolean",
|
|
4871
5801
|
"defaultValue": "false",
|
|
4872
|
-
"description": "When true, the
|
|
5802
|
+
"description": "When true, the sidebar may be resized by the user. By default no persistence is applied; pass `widthStorageKey` to persist via localStorage, or use `onResizeEnd` + `currentWidth` for fully controlled persistence."
|
|
4873
5803
|
},
|
|
4874
5804
|
{
|
|
4875
|
-
"name": "
|
|
4876
|
-
"type": "
|
|
4877
|
-
"
|
|
4878
|
-
"description": "Provide a key used by localStorage to persist the size of the pane on the client."
|
|
5805
|
+
"name": "currentWidth",
|
|
5806
|
+
"type": "number | undefined",
|
|
5807
|
+
"description": "Current/controlled width value in pixels. Required when `onResizeEnd` is provided. Pass `undefined` when the persisted value has not loaded yet. The `width` prop still defines the default used when resetting (e.g., double-click)."
|
|
4879
5808
|
},
|
|
4880
5809
|
{
|
|
4881
|
-
"name": "
|
|
4882
|
-
"type": "
|
|
4883
|
-
"
|
|
4884
|
-
"description": "Whether the pane should stick to the top of the screen while the content scrolls."
|
|
5810
|
+
"name": "onResizeEnd",
|
|
5811
|
+
"type": "(width: number) => void",
|
|
5812
|
+
"description": "Callback fired when a resize operation ends (drag release or keyboard key up). When provided, replaces localStorage persistence. Requires `currentWidth`."
|
|
4885
5813
|
},
|
|
4886
5814
|
{
|
|
4887
|
-
"name": "
|
|
4888
|
-
"type": "
|
|
4889
|
-
"
|
|
4890
|
-
"description": "Use offsetHeader along with the sticky prop to push the sticky pane down to make room for a sticky header if necessary. Use the type `string` to specify the height with a unit i.e. 5rem; otherwise the type `number` will be taken as px."
|
|
5815
|
+
"name": "widthStorageKey",
|
|
5816
|
+
"type": "string",
|
|
5817
|
+
"description": "localStorage key used to persist the sidebar width across sessions. Only applies when `resizable` is `true` and no `onResizeEnd` callback is provided. When omitted, localStorage is not used."
|
|
4891
5818
|
},
|
|
4892
5819
|
{
|
|
4893
5820
|
"name": "padding",
|
|
4894
5821
|
"type": "| 'none' | 'condensed' | 'normal'",
|
|
4895
5822
|
"defaultValue": "'none'",
|
|
4896
|
-
"description": "The amount of padding inside the
|
|
5823
|
+
"description": "The amount of padding inside the sidebar."
|
|
4897
5824
|
},
|
|
4898
5825
|
{
|
|
4899
5826
|
"name": "divider",
|
|
4900
|
-
"type": "| 'none' | 'line'
|
|
5827
|
+
"type": "| 'none' | 'line'",
|
|
4901
5828
|
"defaultValue": "'none'",
|
|
4902
|
-
"description": ""
|
|
5829
|
+
"description": "Divider style between the sidebar and the rest of the layout."
|
|
4903
5830
|
},
|
|
4904
5831
|
{
|
|
4905
|
-
"name": "
|
|
4906
|
-
"type": "
|
|
4907
|
-
"defaultValue": "'inherit'",
|
|
4908
|
-
"deprecated": true,
|
|
4909
|
-
"description": "Use the divider prop with a responsive value instead."
|
|
4910
|
-
},
|
|
4911
|
-
{
|
|
4912
|
-
"name": "hidden",
|
|
4913
|
-
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
|
|
5832
|
+
"name": "sticky",
|
|
5833
|
+
"type": "boolean",
|
|
4914
5834
|
"defaultValue": "false",
|
|
4915
|
-
"description": "Whether the
|
|
5835
|
+
"description": "Whether the sidebar sticks to the viewport when scrolling. When enabled, the sidebar uses position: sticky with top: 0 and height: 100vh."
|
|
4916
5836
|
},
|
|
4917
5837
|
{
|
|
4918
|
-
"name": "
|
|
4919
|
-
"type": "
|
|
4920
|
-
"
|
|
4921
|
-
"
|
|
5838
|
+
"name": "responsiveVariant",
|
|
5839
|
+
"type": "| 'default' | 'fullscreen'",
|
|
5840
|
+
"defaultValue": "'default'",
|
|
5841
|
+
"description": "Controls sidebar behavior at narrow viewport widths (below 768px). 'default' retains its normal inline layout. 'fullscreen' expands to cover the full viewport like a dialog overlay."
|
|
4922
5842
|
},
|
|
4923
5843
|
{
|
|
4924
|
-
"name": "
|
|
4925
|
-
"type": "
|
|
5844
|
+
"name": "hidden",
|
|
5845
|
+
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
|
|
5846
|
+
"defaultValue": "false",
|
|
5847
|
+
"description": "Whether the sidebar is hidden."
|
|
4926
5848
|
}
|
|
4927
5849
|
]
|
|
4928
5850
|
},
|
|
@@ -5148,6 +6070,11 @@
|
|
|
5148
6070
|
"type": "(event: MouseEvent | TouchEvent) => void",
|
|
5149
6071
|
"description": "Callback fired when a click is detected outside the popover content"
|
|
5150
6072
|
},
|
|
6073
|
+
{
|
|
6074
|
+
"name": "onEscape",
|
|
6075
|
+
"type": "(event: KeyboardEvent) => void",
|
|
6076
|
+
"description": "Callback fired when the Escape key is pressed while the popover is open"
|
|
6077
|
+
},
|
|
5151
6078
|
{
|
|
5152
6079
|
"name": "ignoreClickRefs",
|
|
5153
6080
|
"type": "React.RefObject<HTMLElement>[]",
|
|
@@ -5174,7 +6101,7 @@
|
|
|
5174
6101
|
},
|
|
5175
6102
|
{
|
|
5176
6103
|
"id": "behaviors-portal-features--custom-portal-root-by-registration",
|
|
5177
|
-
"code": "() => {\n const outerContainerRef = React.useRef<HTMLDivElement>(null)\n const [mounted, setMounted] = React.useState(false)\n React.useEffect(() => {\n if (outerContainerRef.current instanceof HTMLElement) {\n registerPortalRoot(outerContainerRef.current)\n setMounted(true)\n }\n }, [])\n return (\n <>\n Root position\n <div\n className={clsx(classes.PortalContainer, classes.OuterContainer)}\n ref={outerContainerRef}\n >\n {mounted ? (\n <>\n Outer container\n <div\n className={clsx(classes.PortalContainer, classes.InnerContainer)}\n >\n Inner container\n <Portal>Portaled content rendered at the outer container.</Portal>\n </div>\n </>\n ) : null}\n </div>\n </>\n )\n}"
|
|
6104
|
+
"code": "() => {\n const outerContainerRef = React.useRef<HTMLDivElement>(null)\n const [mounted, setMounted] = React.useState(false)\n React.useEffect(() => {\n if (outerContainerRef.current instanceof HTMLElement) {\n registerPortalRoot(outerContainerRef.current)\n // eslint-disable-next-line react-you-might-not-need-an-effect/no-initialize-state\n setMounted(true)\n }\n }, [])\n return (\n <>\n Root position\n <div\n className={clsx(classes.PortalContainer, classes.OuterContainer)}\n ref={outerContainerRef}\n >\n {mounted ? (\n <>\n Outer container\n <div\n className={clsx(classes.PortalContainer, classes.InnerContainer)}\n >\n Inner container\n <Portal>Portaled content rendered at the outer container.</Portal>\n </div>\n </>\n ) : null}\n </div>\n </>\n )\n}"
|
|
5178
6105
|
},
|
|
5179
6106
|
{
|
|
5180
6107
|
"id": "behaviors-portal-features--multiple-portal-roots",
|
|
@@ -5682,6 +6609,10 @@
|
|
|
5682
6609
|
"id": "components-segmentedcontrol-features--variant-narrow-action-menu",
|
|
5683
6610
|
"code": "() => (\n <SegmentedControl\n aria-label=\"File view\"\n variant={{\n narrow: 'dropdown',\n regular: 'default',\n wide: 'default',\n }}\n >\n <SegmentedControl.Button\n defaultSelected\n aria-label={'Preview'}\n leadingVisual={EyeIcon}\n >\n Preview\n </SegmentedControl.Button>\n <SegmentedControl.Button aria-label={'Raw'} leadingVisual={FileCodeIcon}>\n Raw\n </SegmentedControl.Button>\n <SegmentedControl.Button aria-label={'Blame'} leadingVisual={PeopleIcon}>\n Blame\n </SegmentedControl.Button>\n </SegmentedControl>\n)"
|
|
5684
6611
|
},
|
|
6612
|
+
{
|
|
6613
|
+
"id": "components-segmentedcontrol-features--variant-narrow-action-menu-with-action",
|
|
6614
|
+
"code": "() => {\n const initialViews = [\n {\n id: 'all',\n label: 'All',\n },\n {\n id: 'active',\n label: 'Active',\n },\n {\n id: 'review-requests',\n label: 'Review requests',\n },\n {\n id: 'done',\n label: 'Done',\n },\n ]\n const [views, setViews] = useState(initialViews)\n const [selectedViewId, setSelectedViewId] = useState(initialViews[0].id)\n const handleAddView = () => {\n setViews((currentViews) => {\n const viewNumber = currentViews.length - 3\n return [\n ...currentViews,\n {\n id: `new-view-${viewNumber}`,\n label: `New view ${viewNumber}`,\n },\n ]\n })\n }\n const handleChange = (index: number) => {\n const nextSelectedViewId = views.at(index)?.id\n if (nextSelectedViewId) setSelectedViewId(nextSelectedViewId)\n }\n const handleReset = () => {\n setViews(initialViews)\n setSelectedViewId(initialViews[0].id)\n }\n return (\n <>\n <SegmentedControl\n aria-label=\"View\"\n onChange={handleChange}\n variant={{\n narrow: 'dropdown',\n regular: 'subtle',\n wide: 'subtle',\n }}\n >\n {views.flatMap((view) => [\n ...(view.label === 'Active'\n ? [<SegmentedControl.Divider key={`${view.label}-divider`} />]\n : []),\n <SegmentedControl.Button\n key={view.id}\n selected={view.id === selectedViewId}\n >\n {view.label}\n </SegmentedControl.Button>,\n ])}\n <SegmentedControl.Action\n label=\"Add view\"\n icon={PlusIcon}\n onClick={handleAddView}\n />\n </SegmentedControl>\n <Button\n className={classes.ResetButton}\n size=\"small\"\n onClick={handleReset}\n >\n Reset views\n </Button>\n </>\n )\n}"
|
|
6615
|
+
},
|
|
5685
6616
|
{
|
|
5686
6617
|
"id": "components-segmentedcontrol-features--fullwidth-narrow",
|
|
5687
6618
|
"code": "() => (\n <SegmentedControl\n aria-label=\"File view\"\n fullWidth={{\n narrow: true,\n regular: false,\n wide: false,\n }}\n >\n <SegmentedControl.Button\n defaultSelected\n aria-label={'Preview'}\n leadingVisual={EyeIcon}\n >\n Preview\n </SegmentedControl.Button>\n <SegmentedControl.Button aria-label={'Raw'} leadingVisual={FileCodeIcon}>\n Raw\n </SegmentedControl.Button>\n <SegmentedControl.Button aria-label={'Blame'} leadingVisual={PeopleIcon}>\n Blame\n </SegmentedControl.Button>\n </SegmentedControl>\n)"
|
|
@@ -5701,6 +6632,10 @@
|
|
|
5701
6632
|
{
|
|
5702
6633
|
"id": "components-segmentedcontrol-features--associated-with-a-label-and-caption",
|
|
5703
6634
|
"code": "() => (\n <div className={classes.LabelAndCaptionContainer}>\n <div className={classes.LabelAndCaption}>\n <Text\n className={classes.TextLargeBold}\n id=\"scLabel-vert\"\n style={{\n display: 'block',\n }}\n >\n File view\n </Text>\n <Text\n className={classes.TextMediumSubtle}\n id=\"scCaption-vert\"\n style={{\n display: 'block',\n }}\n >\n Change the way the file is viewed\n </Text>\n </div>\n <SegmentedControl\n aria-labelledby=\"scLabel-vert\"\n aria-describedby=\"scCaption-vert\"\n >\n <SegmentedControl.Button defaultSelected>Preview</SegmentedControl.Button>\n <SegmentedControl.Button>Raw</SegmentedControl.Button>\n <SegmentedControl.Button>Blame</SegmentedControl.Button>\n </SegmentedControl>\n </div>\n)"
|
|
6635
|
+
},
|
|
6636
|
+
{
|
|
6637
|
+
"id": "components-segmentedcontrol-features--variant-subtle",
|
|
6638
|
+
"code": "() => (\n <SegmentedControl aria-label=\"View\" variant=\"subtle\">\n <SegmentedControl.Button defaultSelected count={5}>\n All\n </SegmentedControl.Button>\n <SegmentedControl.Divider />\n <SegmentedControl.Button count={3}>Active</SegmentedControl.Button>\n <SegmentedControl.Button count={10}>\n Review requests\n </SegmentedControl.Button>\n <SegmentedControl.Divider />\n <SegmentedControl.Button count={2}>Done</SegmentedControl.Button>\n </SegmentedControl>\n)"
|
|
5704
6639
|
}
|
|
5705
6640
|
],
|
|
5706
6641
|
"importPath": "@primer/react",
|
|
@@ -5737,9 +6672,9 @@
|
|
|
5737
6672
|
},
|
|
5738
6673
|
{
|
|
5739
6674
|
"name": "variant",
|
|
5740
|
-
"type": "| 'default' | { narrow?: 'hideLabels' | 'dropdown' | 'default' regular?: 'hideLabels' | 'dropdown' | 'default' wide?: 'hideLabels' | 'dropdown' | 'default' }",
|
|
6675
|
+
"type": "| 'default' | 'subtle' | { narrow?: 'hideLabels' | 'dropdown' | 'default' | 'subtle' regular?: 'hideLabels' | 'dropdown' | 'default' | 'subtle' wide?: 'hideLabels' | 'dropdown' | 'default' | 'subtle' }",
|
|
5741
6676
|
"defaultValue": "'default'",
|
|
5742
|
-
"description": "Configure
|
|
6677
|
+
"description": "Configure the control's visual treatment or responsive behavior in tight spaces."
|
|
5743
6678
|
},
|
|
5744
6679
|
{
|
|
5745
6680
|
"name": "size",
|
|
@@ -5845,6 +6780,53 @@
|
|
|
5845
6780
|
"defaultValue": ""
|
|
5846
6781
|
}
|
|
5847
6782
|
]
|
|
6783
|
+
},
|
|
6784
|
+
{
|
|
6785
|
+
"name": "SegmentedControl.Divider",
|
|
6786
|
+
"props": [
|
|
6787
|
+
{
|
|
6788
|
+
"name": "className",
|
|
6789
|
+
"type": "string",
|
|
6790
|
+
"required": false
|
|
6791
|
+
},
|
|
6792
|
+
{
|
|
6793
|
+
"name": "style",
|
|
6794
|
+
"type": "React.CSSProperties",
|
|
6795
|
+
"required": false
|
|
6796
|
+
}
|
|
6797
|
+
]
|
|
6798
|
+
},
|
|
6799
|
+
{
|
|
6800
|
+
"name": "SegmentedControl.Action",
|
|
6801
|
+
"props": [
|
|
6802
|
+
{
|
|
6803
|
+
"name": "label",
|
|
6804
|
+
"type": "string",
|
|
6805
|
+
"required": true,
|
|
6806
|
+
"description": "Accessible label for the action icon button."
|
|
6807
|
+
},
|
|
6808
|
+
{
|
|
6809
|
+
"name": "icon",
|
|
6810
|
+
"type": "Component",
|
|
6811
|
+
"required": true,
|
|
6812
|
+
"description": "The icon rendered by the action button."
|
|
6813
|
+
},
|
|
6814
|
+
{
|
|
6815
|
+
"name": "onClick",
|
|
6816
|
+
"type": "() => void",
|
|
6817
|
+
"description": "The handler that gets called when the action button is clicked."
|
|
6818
|
+
},
|
|
6819
|
+
{
|
|
6820
|
+
"name": "disabled",
|
|
6821
|
+
"type": "boolean",
|
|
6822
|
+
"description": "Whether the action is disabled."
|
|
6823
|
+
},
|
|
6824
|
+
{
|
|
6825
|
+
"name": "loading",
|
|
6826
|
+
"type": "boolean",
|
|
6827
|
+
"description": "Whether the action is in a loading state."
|
|
6828
|
+
}
|
|
6829
|
+
]
|
|
5848
6830
|
}
|
|
5849
6831
|
]
|
|
5850
6832
|
},
|
|
@@ -6097,7 +7079,7 @@
|
|
|
6097
7079
|
"name": "textInputProps",
|
|
6098
7080
|
"type": "Partial<Omit<TextInputProps, 'onChange'>>",
|
|
6099
7081
|
"defaultValue": "",
|
|
6100
|
-
"description": "See [TextInput props](/react/TextInput#props)."
|
|
7082
|
+
"description": "See [TextInput props](/react/TextInput#props). The filter input uses the normal TextInput background by default. Enable `primer_react_select_panel_legacy_contrast` to restore the previous contrast background. An explicit `textInputProps.contrast` value takes precedence over the flag: `true` enables contrast, while `false` or explicitly passing `undefined` disables it. The `contrast` prop remains deprecated."
|
|
6101
7083
|
},
|
|
6102
7084
|
{
|
|
6103
7085
|
"name": "variant",
|
|
@@ -6158,6 +7140,42 @@
|
|
|
6158
7140
|
"type": "'start' | 'end' | 'center'",
|
|
6159
7141
|
"defaultValue": "'start'",
|
|
6160
7142
|
"description": "Determines the alignment of the panel relative to the anchor. Defaults to 'start' which aligns the left edge of the panel with the left edge of the anchor."
|
|
7143
|
+
},
|
|
7144
|
+
{
|
|
7145
|
+
"name": "scrollContainerRef",
|
|
7146
|
+
"type": "React.Ref<HTMLDivElement | null>",
|
|
7147
|
+
"defaultValue": "undefined",
|
|
7148
|
+
"description": "A ref assigned to the scrollable container wrapping the ActionList"
|
|
7149
|
+
},
|
|
7150
|
+
{
|
|
7151
|
+
"name": "actionListProps",
|
|
7152
|
+
"type": "Partial<ActionListProps>",
|
|
7153
|
+
"defaultValue": "undefined",
|
|
7154
|
+
"description": "See [ActionList props](/react/ActionList#props)."
|
|
7155
|
+
},
|
|
7156
|
+
{
|
|
7157
|
+
"name": "focusOutBehavior",
|
|
7158
|
+
"type": "'start' | 'wrap'",
|
|
7159
|
+
"defaultValue": "'wrap'",
|
|
7160
|
+
"description": "Determines how keyboard focus behaves when navigating beyond the first or last item in the list."
|
|
7161
|
+
},
|
|
7162
|
+
{
|
|
7163
|
+
"name": "onActiveDescendantChanged",
|
|
7164
|
+
"type": "(newActiveDescendant: HTMLElement | undefined, previousActiveDescendant: HTMLElement | undefined, directlyActivated: boolean) => void | undefined",
|
|
7165
|
+
"defaultValue": "undefined",
|
|
7166
|
+
"description": "Callback function that is called when the active descendant changes."
|
|
7167
|
+
},
|
|
7168
|
+
{
|
|
7169
|
+
"name": "virtualized",
|
|
7170
|
+
"type": "boolean",
|
|
7171
|
+
"defaultValue": "false",
|
|
7172
|
+
"description": "If true, enables client-side list virtualization. Only the visible items plus a small overscan buffer are rendered in the DOM, dramatically improving performance for large lists. Recommended for lists with more than 100 items. Has no effect when `groupMetadata` is provided."
|
|
7173
|
+
},
|
|
7174
|
+
{
|
|
7175
|
+
"name": "displayInViewport",
|
|
7176
|
+
"type": "boolean",
|
|
7177
|
+
"defaultValue": "false",
|
|
7178
|
+
"description": "If true, the panel will attempt to fit entirely into the visible viewport, without having to scroll."
|
|
6161
7179
|
}
|
|
6162
7180
|
],
|
|
6163
7181
|
"subcomponents": []
|
|
@@ -6184,6 +7202,12 @@
|
|
|
6184
7202
|
],
|
|
6185
7203
|
"importPath": "@primer/react",
|
|
6186
7204
|
"props": [
|
|
7205
|
+
{
|
|
7206
|
+
"name": "delay",
|
|
7207
|
+
"type": "'short' | 'long' | number",
|
|
7208
|
+
"description": "Controls whether and how long to delay rendering the SkeletonBox. Set to 'short' to delay by 300ms, 'long' to delay by 1000ms, or provide a custom number of milliseconds.",
|
|
7209
|
+
"defaultValue": "false"
|
|
7210
|
+
},
|
|
6187
7211
|
{
|
|
6188
7212
|
"name": "width",
|
|
6189
7213
|
"type": "string",
|
|
@@ -6335,10 +7359,46 @@
|
|
|
6335
7359
|
},
|
|
6336
7360
|
"spinner": {
|
|
6337
7361
|
"source": "https://github.com/primer/react/tree/main/packages/react/src/Spinner",
|
|
7362
|
+
"a11yReviewed": "2025-01-08",
|
|
6338
7363
|
"id": "spinner",
|
|
7364
|
+
"importPath": "@primer/react",
|
|
6339
7365
|
"name": "Spinner",
|
|
7366
|
+
"props": [
|
|
7367
|
+
{
|
|
7368
|
+
"description": "Sets the width and height of the spinner.",
|
|
7369
|
+
"name": "size",
|
|
7370
|
+
"type": "'small' | 'medium' | 'large'"
|
|
7371
|
+
},
|
|
7372
|
+
{
|
|
7373
|
+
"defaultValue": "Loading",
|
|
7374
|
+
"description": "Sets the text conveyed by assistive technologies such as screen readers. Set to `null` if the loading state is displayed in a text node somewhere else on the page.",
|
|
7375
|
+
"name": "srText",
|
|
7376
|
+
"type": "string | null"
|
|
7377
|
+
},
|
|
7378
|
+
{
|
|
7379
|
+
"deprecated": true,
|
|
7380
|
+
"description": "Sets the text conveyed by assistive technologies such as screen readers.",
|
|
7381
|
+
"name": "aria-label",
|
|
7382
|
+
"type": "string"
|
|
7383
|
+
},
|
|
7384
|
+
{
|
|
7385
|
+
"defaultValue": "",
|
|
7386
|
+
"description": "",
|
|
7387
|
+
"name": "className",
|
|
7388
|
+
"type": "string"
|
|
7389
|
+
},
|
|
7390
|
+
{
|
|
7391
|
+
"name": "data-*",
|
|
7392
|
+
"type": "string"
|
|
7393
|
+
},
|
|
7394
|
+
{
|
|
7395
|
+
"defaultValue": "false",
|
|
7396
|
+
"description": "Controls whether and how long to delay rendering the spinner. Set to `true` to delay by 1000ms, `'short'` to delay by 300ms, `'long'` to delay by 1000ms, or provide a custom number of milliseconds.",
|
|
7397
|
+
"name": "delay",
|
|
7398
|
+
"type": "boolean | 'short' | 'long' | number"
|
|
7399
|
+
}
|
|
7400
|
+
],
|
|
6340
7401
|
"status": "alpha",
|
|
6341
|
-
"a11yReviewed": "2025-01-08",
|
|
6342
7402
|
"stories": [
|
|
6343
7403
|
{
|
|
6344
7404
|
"id": "components-spinner--default",
|
|
@@ -6355,36 +7415,10 @@
|
|
|
6355
7415
|
{
|
|
6356
7416
|
"id": "components-spinner-features--suppress-screen-reader-text",
|
|
6357
7417
|
"code": "() => (\n <Stack direction=\"horizontal\" className={classes.SuppressScreenReaderText}>\n <Spinner size=\"small\" srText={null} />\n <AriaStatus>Loading...</AriaStatus>\n </Stack>\n)"
|
|
6358
|
-
}
|
|
6359
|
-
],
|
|
6360
|
-
"importPath": "@primer/react",
|
|
6361
|
-
"props": [
|
|
6362
|
-
{
|
|
6363
|
-
"name": "size",
|
|
6364
|
-
"type": "'small' | 'medium' | 'large'",
|
|
6365
|
-
"description": "Sets the width and height of the spinner."
|
|
6366
|
-
},
|
|
6367
|
-
{
|
|
6368
|
-
"name": "srText",
|
|
6369
|
-
"type": "string | null",
|
|
6370
|
-
"defaultValue": "Loading",
|
|
6371
|
-
"description": "Sets the text conveyed by assistive technologies such as screen readers. Set to `null` if the loading state is displayed in a text node somewhere else on the page."
|
|
6372
|
-
},
|
|
6373
|
-
{
|
|
6374
|
-
"name": "aria-label",
|
|
6375
|
-
"type": "string",
|
|
6376
|
-
"description": "Sets the text conveyed by assistive technologies such as screen readers.",
|
|
6377
|
-
"deprecated": true
|
|
6378
|
-
},
|
|
6379
|
-
{
|
|
6380
|
-
"name": "className",
|
|
6381
|
-
"type": "string",
|
|
6382
|
-
"description": "",
|
|
6383
|
-
"defaultValue": ""
|
|
6384
7418
|
},
|
|
6385
7419
|
{
|
|
6386
|
-
"
|
|
6387
|
-
"
|
|
7420
|
+
"id": "components-spinner-features--with-delay",
|
|
7421
|
+
"code": "() => <Spinner delay=\"long\" />"
|
|
6388
7422
|
}
|
|
6389
7423
|
],
|
|
6390
7424
|
"subcomponents": []
|
|
@@ -6402,7 +7436,31 @@
|
|
|
6402
7436
|
},
|
|
6403
7437
|
{
|
|
6404
7438
|
"id": "components-splitpagelayout-features--settings-page",
|
|
6405
|
-
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Pane position=\"start\" aria-label=\"Navigation Pane\">\n <NavList aria-label=\"Main navigation\">\n <NavList.Item href=\"#\">Profile</NavList.Item>\n <NavList.Item href=\"#\" aria-current=\"page\">\n Account\n </NavList.Item>\n <NavList.Item href=\"#\">Emails</NavList.Item>\n <NavList.Item href=\"#\">Notifications</NavList.Item>\n </NavList>\n </SplitPageLayout.Pane>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Danger zone\n </Heading>\n <div className={classes.DeleteAccountContainer}>\n <div className={classes.DeleteAccountTextContainer}>\n <
|
|
7439
|
+
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Pane position=\"start\" aria-label=\"Navigation Pane\">\n <NavList aria-label=\"Main navigation\">\n <NavList.Item href=\"#\">Profile</NavList.Item>\n <NavList.Item href=\"#\" aria-current=\"page\">\n Account\n </NavList.Item>\n <NavList.Item href=\"#\">Emails</NavList.Item>\n <NavList.Item href=\"#\">Notifications</NavList.Item>\n </NavList>\n </SplitPageLayout.Pane>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Danger zone\n </Heading>\n <div className={classes.DeleteAccountContainer}>\n <div className={classes.DeleteAccountTextContainer}>\n <p className={classes.DeleteAccountTitle}>Delete account</p>\n <p className={classes.DeleteAccountDescription}>\n Are you sure you don't want to just downgrade your account to a\n free account? We won't charge your credit card anymore.\n </p>\n </div>\n <Button variant=\"danger\">Delete account</Button>\n </div>\n </SplitPageLayout.Content>\n </SplitPageLayout>\n)"
|
|
7440
|
+
},
|
|
7441
|
+
{
|
|
7442
|
+
"id": "components-splitpagelayout-features--with-sidebar-start",
|
|
7443
|
+
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Sidebar\n position=\"start\"\n aria-label=\"Inspector sidebar\"\n style={{\n height: 'auto',\n }}\n >\n <div className={classes.SidebarContent}>\n <p className={classes.SidebarHeading}>Sidebar</p>\n <p className={classes.SidebarText}>\n This sidebar spans the full height of the layout, adjacent to the\n header, content, and footer.\n </p>\n </div>\n </SplitPageLayout.Sidebar>\n <SplitPageLayout.Header>\n <Heading as=\"h1\">Page Title</Heading>\n </SplitPageLayout.Header>\n <SplitPageLayout.Pane position=\"start\" aria-label=\"Navigation Pane\">\n <NavList aria-label=\"Main navigation\">\n <NavList.Item href=\"#\">Profile</NavList.Item>\n <NavList.Item href=\"#\" aria-current=\"page\">\n Account\n </NavList.Item>\n <NavList.Item href=\"#\">Emails</NavList.Item>\n <NavList.Item href=\"#\">Notifications</NavList.Item>\n </NavList>\n </SplitPageLayout.Pane>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Danger zone\n </Heading>\n <div className={classes.DeleteAccountContainer}>\n <div className={classes.DeleteAccountTextContainer}>\n <p className={classes.DeleteAccountTitle}>Delete account</p>\n <p className={classes.DeleteAccountDescription}>\n Are you sure you don't want to just downgrade your account to a\n free account? We won't charge your credit card anymore.\n </p>\n </div>\n <Button variant=\"danger\">Delete account</Button>\n </div>\n </SplitPageLayout.Content>\n <SplitPageLayout.Footer>\n <p>Footer content</p>\n </SplitPageLayout.Footer>\n </SplitPageLayout>\n)"
|
|
7444
|
+
},
|
|
7445
|
+
{
|
|
7446
|
+
"id": "components-splitpagelayout-features--with-sidebar-end",
|
|
7447
|
+
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Sidebar\n position=\"end\"\n aria-label=\"Inspector sidebar\"\n style={{\n height: 'auto',\n }}\n >\n <div className={classes.SidebarContent}>\n <p className={classes.SidebarHeading}>Inspector</p>\n <p className={classes.SidebarText}>\n This sidebar is positioned at the end (right side) and spans the full\n height.\n </p>\n </div>\n </SplitPageLayout.Sidebar>\n <SplitPageLayout.Header>\n <Heading as=\"h1\">Page Title</Heading>\n </SplitPageLayout.Header>\n <SplitPageLayout.Pane position=\"start\" aria-label=\"Navigation Pane\">\n <NavList aria-label=\"Main navigation\">\n <NavList.Item href=\"#\">Profile</NavList.Item>\n <NavList.Item href=\"#\" aria-current=\"page\">\n Account\n </NavList.Item>\n <NavList.Item href=\"#\">Emails</NavList.Item>\n <NavList.Item href=\"#\">Notifications</NavList.Item>\n </NavList>\n </SplitPageLayout.Pane>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Account Settings\n </Heading>\n <p>Main content area</p>\n </SplitPageLayout.Content>\n <SplitPageLayout.Footer>\n <p>Footer content</p>\n </SplitPageLayout.Footer>\n </SplitPageLayout>\n)"
|
|
7448
|
+
},
|
|
7449
|
+
{
|
|
7450
|
+
"id": "components-splitpagelayout-features--with-resizable-sidebar",
|
|
7451
|
+
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Sidebar\n resizable\n position=\"start\"\n aria-label=\"Resizable sidebar\"\n style={{\n height: 'auto',\n }}\n >\n <div className={classes.SidebarContent}>\n <p className={classes.SidebarHeading}>Resizable Sidebar</p>\n <p className={classes.SidebarText}>\n Drag the edge to resize this sidebar. The width will be persisted\n across sessions.\n </p>\n </div>\n </SplitPageLayout.Sidebar>\n <SplitPageLayout.Header>\n <Heading as=\"h1\">Page Title</Heading>\n </SplitPageLayout.Header>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Main Content\n </Heading>\n <p>\n This layout has a resizable sidebar that can be dragged to adjust its\n width.\n </p>\n </SplitPageLayout.Content>\n <SplitPageLayout.Footer>\n <p>Footer content</p>\n </SplitPageLayout.Footer>\n </SplitPageLayout>\n)"
|
|
7452
|
+
},
|
|
7453
|
+
{
|
|
7454
|
+
"id": "components-splitpagelayout-features--with-sidebar-and-resizable-pane",
|
|
7455
|
+
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Sidebar\n resizable\n position=\"start\"\n aria-label=\"Navigation sidebar\"\n style={{\n height: 'auto',\n }}\n >\n <div className={classes.SidebarContent}>\n <p className={classes.SidebarHeading}>Sidebar</p>\n <p className={classes.SidebarText}>Full-height resizable sidebar</p>\n </div>\n </SplitPageLayout.Sidebar>\n <SplitPageLayout.Header>\n <Heading as=\"h1\">Page Title</Heading>\n </SplitPageLayout.Header>\n <SplitPageLayout.Pane resizable position=\"end\" aria-label=\"Details pane\">\n <div className={classes.SidebarContent}>\n <p className={classes.SidebarHeading}>Details Pane</p>\n <p className={classes.SidebarText}>\n This pane is also resizable and sits beside the content.\n </p>\n </div>\n </SplitPageLayout.Pane>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Main Content\n </Heading>\n <p>\n This layout demonstrates using both a full-height sidebar and a\n resizable pane together. The sidebar spans the entire height while the\n pane sits adjacent to the content area only.\n </p>\n </SplitPageLayout.Content>\n <SplitPageLayout.Footer>\n <p>Footer content</p>\n </SplitPageLayout.Footer>\n </SplitPageLayout>\n)"
|
|
7456
|
+
},
|
|
7457
|
+
{
|
|
7458
|
+
"id": "components-splitpagelayout-features--with-sticky-sidebar",
|
|
7459
|
+
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Sidebar\n sticky\n position=\"start\"\n aria-label=\"Sticky sidebar\"\n >\n <div className={classes.SidebarContent}>\n <p className={classes.SidebarHeading}>Sticky Sidebar</p>\n <p className={classes.SidebarText}>\n This sidebar stays fixed in the viewport as you scroll the page\n content.\n </p>\n </div>\n </SplitPageLayout.Sidebar>\n <SplitPageLayout.Header>\n <Heading as=\"h1\">Page Title</Heading>\n </SplitPageLayout.Header>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Scrollable Content\n </Heading>\n {Array.from({\n length: 20,\n }).map((_, i) => (\n <p key={i}>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim\n id lorem tempus egestas a non ipsum. Maecenas imperdiet ante quam, at\n varius lorem molestie vel.\n </p>\n ))}\n </SplitPageLayout.Content>\n <SplitPageLayout.Footer>\n <p>Footer content</p>\n </SplitPageLayout.Footer>\n </SplitPageLayout>\n)"
|
|
7460
|
+
},
|
|
7461
|
+
{
|
|
7462
|
+
"id": "components-splitpagelayout-features--sidebar-fullscreen-responsive-variant",
|
|
7463
|
+
"code": "() => (\n <SplitPageLayout>\n <SplitPageLayout.Sidebar\n position=\"start\"\n responsiveVariant=\"fullscreen\"\n aria-label=\"Fullscreen sidebar\"\n style={{\n height: 'auto',\n }}\n >\n <div className={classes.SidebarContent}>\n <p className={classes.SidebarHeading}>Fullscreen on Narrow</p>\n <p className={classes.SidebarText}>\n Resize the viewport below 768px to see this sidebar expand to fill the\n entire screen.\n </p>\n </div>\n </SplitPageLayout.Sidebar>\n <SplitPageLayout.Header>\n <Heading as=\"h1\">Page Title</Heading>\n </SplitPageLayout.Header>\n <SplitPageLayout.Content>\n <Heading as=\"h2\" className={classes.SectionHeading}>\n Main Content\n </Heading>\n <p>This content is hidden behind the sidebar at narrow viewports.</p>\n </SplitPageLayout.Content>\n <SplitPageLayout.Footer>\n <p>Footer content</p>\n </SplitPageLayout.Footer>\n </SplitPageLayout>\n)"
|
|
6406
7464
|
}
|
|
6407
7465
|
],
|
|
6408
7466
|
"importPath": "@primer/react",
|
|
@@ -6490,77 +7548,156 @@
|
|
|
6490
7548
|
]
|
|
6491
7549
|
},
|
|
6492
7550
|
{
|
|
6493
|
-
"name": "SplitPageLayout.Pane",
|
|
7551
|
+
"name": "SplitPageLayout.Pane",
|
|
7552
|
+
"props": [
|
|
7553
|
+
{
|
|
7554
|
+
"name": "aria-label",
|
|
7555
|
+
"type": "string | undefined",
|
|
7556
|
+
"description": "Label for the pane. Required if the pane overflows and doesn't have aria-labelledby."
|
|
7557
|
+
},
|
|
7558
|
+
{
|
|
7559
|
+
"name": "aria-labelledby",
|
|
7560
|
+
"type": "string | undefined",
|
|
7561
|
+
"description": "Id of an element that acts as a label for the pane. Required if the pane overflows and doesn't have aria-label."
|
|
7562
|
+
},
|
|
7563
|
+
{
|
|
7564
|
+
"name": "width",
|
|
7565
|
+
"type": "| 'small' | 'medium' | 'large' | { min: string max: string default: string }",
|
|
7566
|
+
"defaultValue": "'medium'",
|
|
7567
|
+
"description": "The width of the pane. If using custom widths, provide an object with keys 'min', 'max' and 'default'."
|
|
7568
|
+
},
|
|
7569
|
+
{
|
|
7570
|
+
"name": "minWidth",
|
|
7571
|
+
"type": "number",
|
|
7572
|
+
"defaultValue": "256",
|
|
7573
|
+
"description": "The minimum width of the pane."
|
|
7574
|
+
},
|
|
7575
|
+
{
|
|
7576
|
+
"name": "resizable",
|
|
7577
|
+
"type": "boolean",
|
|
7578
|
+
"defaultValue": "false",
|
|
7579
|
+
"description": "When true, the pane may be resized by the user. Uses localStorage persistence by default. Note: with default persistence in SSR, the server-rendered width may differ from the stored client width, causing a brief layout shift on hydration. Use `onResizeEnd` with server-aware storage to avoid this."
|
|
7580
|
+
},
|
|
7581
|
+
{
|
|
7582
|
+
"name": "currentWidth",
|
|
7583
|
+
"type": "number | undefined",
|
|
7584
|
+
"description": "Current/controlled width value in pixels. Required when `onResizeEnd` is provided. Pass `undefined` when the persisted value has not loaded yet. The `width` prop still defines the default used when resetting (e.g., double-click)."
|
|
7585
|
+
},
|
|
7586
|
+
{
|
|
7587
|
+
"name": "onResizeEnd",
|
|
7588
|
+
"type": "(width: number) => void",
|
|
7589
|
+
"description": "Callback fired when a resize operation ends (drag release or keyboard key up). When provided, replaces localStorage persistence. Requires `currentWidth`."
|
|
7590
|
+
},
|
|
7591
|
+
{
|
|
7592
|
+
"name": "widthStorageKey",
|
|
7593
|
+
"type": "string",
|
|
7594
|
+
"defaultValue": "'paneWidth'",
|
|
7595
|
+
"description": "localStorage key used to persist the pane width across sessions. Only applies when `resizable` is `true` and no `onResizeEnd` callback is provided."
|
|
7596
|
+
},
|
|
7597
|
+
{
|
|
7598
|
+
"name": "sticky",
|
|
7599
|
+
"type": "boolean",
|
|
7600
|
+
"defaultValue": "true",
|
|
7601
|
+
"description": "Whether the pane should stick to the top of the screen while the content scrolls."
|
|
7602
|
+
},
|
|
7603
|
+
{
|
|
7604
|
+
"name": "offsetHeader",
|
|
7605
|
+
"type": "number | string",
|
|
7606
|
+
"defaultValue": "0",
|
|
7607
|
+
"description": "Use offsetHeader along with the sticky prop to push the sticky pane down to make room for a sticky header if necessary. Use the type `string` to specify the height with a unit i.e. 5rem; otherwise the type `number` will be taken as px."
|
|
7608
|
+
},
|
|
7609
|
+
{
|
|
7610
|
+
"name": "padding",
|
|
7611
|
+
"type": "| 'none' | 'condensed' | 'normal'",
|
|
7612
|
+
"defaultValue": "'normal'",
|
|
7613
|
+
"description": "The amount of padding inside the pane."
|
|
7614
|
+
},
|
|
7615
|
+
{
|
|
7616
|
+
"name": "divider",
|
|
7617
|
+
"type": "| 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' }",
|
|
7618
|
+
"defaultValue": "'line'",
|
|
7619
|
+
"description": ""
|
|
7620
|
+
},
|
|
7621
|
+
{
|
|
7622
|
+
"name": "hidden",
|
|
7623
|
+
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
|
|
7624
|
+
"defaultValue": "false",
|
|
7625
|
+
"description": "Whether the pane is hidden."
|
|
7626
|
+
},
|
|
7627
|
+
{
|
|
7628
|
+
"name": "position",
|
|
7629
|
+
"type": "'end' | 'start' | {narrow?: 'end' | 'start', narrow?: 'end' | 'start', wide?: 'end' | 'start'}",
|
|
7630
|
+
"description": "Which side of the page the pane should be on. Can be changed for different viewport widths.",
|
|
7631
|
+
"defaultValue": "start"
|
|
7632
|
+
}
|
|
7633
|
+
]
|
|
7634
|
+
},
|
|
7635
|
+
{
|
|
7636
|
+
"name": "SplitPageLayout.Sidebar",
|
|
6494
7637
|
"props": [
|
|
6495
7638
|
{
|
|
6496
7639
|
"name": "aria-label",
|
|
6497
7640
|
"type": "string | undefined",
|
|
6498
|
-
"description": "
|
|
7641
|
+
"description": "A unique label for the sidebar region."
|
|
6499
7642
|
},
|
|
6500
7643
|
{
|
|
6501
7644
|
"name": "aria-labelledby",
|
|
6502
7645
|
"type": "string | undefined",
|
|
6503
|
-
"description": "
|
|
7646
|
+
"description": "An id to an element which uniquely labels the sidebar region."
|
|
7647
|
+
},
|
|
7648
|
+
{
|
|
7649
|
+
"name": "position",
|
|
7650
|
+
"type": "'start' | 'end'",
|
|
7651
|
+
"defaultValue": "'start'",
|
|
7652
|
+
"description": "Position of the sidebar relative to the page layout. The sidebar spans the full height of the layout, adjacent to the header, content, and footer."
|
|
6504
7653
|
},
|
|
6505
7654
|
{
|
|
6506
7655
|
"name": "width",
|
|
6507
7656
|
"type": "| 'small' | 'medium' | 'large' | { min: string max: string default: string }",
|
|
6508
7657
|
"defaultValue": "'medium'",
|
|
6509
|
-
"description": "The width of the
|
|
7658
|
+
"description": "The width of the sidebar. If using custom widths, provide an object with keys 'min', 'max' and 'default'."
|
|
6510
7659
|
},
|
|
6511
7660
|
{
|
|
6512
7661
|
"name": "minWidth",
|
|
6513
7662
|
"type": "number",
|
|
6514
7663
|
"defaultValue": "256",
|
|
6515
|
-
"description": "
|
|
7664
|
+
"description": "Minimum width of the sidebar when resizable."
|
|
6516
7665
|
},
|
|
6517
7666
|
{
|
|
6518
7667
|
"name": "resizable",
|
|
6519
7668
|
"type": "boolean",
|
|
6520
7669
|
"defaultValue": "false",
|
|
6521
|
-
"description": "When true, the
|
|
6522
|
-
},
|
|
6523
|
-
{
|
|
6524
|
-
"name": "widthStorageKey",
|
|
6525
|
-
"type": "string",
|
|
6526
|
-
"defaultValue": "'paneWidth'",
|
|
6527
|
-
"description": "Provide a key used by localStorage to persist the size of the pane on the client."
|
|
6528
|
-
},
|
|
6529
|
-
{
|
|
6530
|
-
"name": "sticky",
|
|
6531
|
-
"type": "boolean",
|
|
6532
|
-
"defaultValue": "true",
|
|
6533
|
-
"description": "Whether the pane should stick to the top of the screen while the content scrolls."
|
|
6534
|
-
},
|
|
6535
|
-
{
|
|
6536
|
-
"name": "offsetHeader",
|
|
6537
|
-
"type": "number | string",
|
|
6538
|
-
"defaultValue": "0",
|
|
6539
|
-
"description": "Use offsetHeader along with the sticky prop to push the sticky pane down to make room for a sticky header if necessary. Use the type `string` to specify the height with a unit i.e. 5rem; otherwise the type `number` will be taken as px."
|
|
7670
|
+
"description": "When true, the sidebar may be resized by the user. Width is persisted to localStorage by default."
|
|
6540
7671
|
},
|
|
6541
7672
|
{
|
|
6542
7673
|
"name": "padding",
|
|
6543
7674
|
"type": "| 'none' | 'condensed' | 'normal'",
|
|
6544
7675
|
"defaultValue": "'normal'",
|
|
6545
|
-
"description": "The amount of padding inside the
|
|
7676
|
+
"description": "The amount of padding inside the sidebar."
|
|
6546
7677
|
},
|
|
6547
7678
|
{
|
|
6548
7679
|
"name": "divider",
|
|
6549
|
-
"type": "| 'none' | 'line'
|
|
7680
|
+
"type": "| 'none' | 'line'",
|
|
6550
7681
|
"defaultValue": "'line'",
|
|
6551
|
-
"description": ""
|
|
7682
|
+
"description": "Divider style between the sidebar and the rest of the layout."
|
|
6552
7683
|
},
|
|
6553
7684
|
{
|
|
6554
|
-
"name": "
|
|
6555
|
-
"type": "
|
|
7685
|
+
"name": "sticky",
|
|
7686
|
+
"type": "boolean",
|
|
6556
7687
|
"defaultValue": "false",
|
|
6557
|
-
"description": "Whether the
|
|
7688
|
+
"description": "Whether the sidebar sticks to the viewport when scrolling. When enabled, the sidebar uses position: sticky with top: 0 and height: 100vh."
|
|
6558
7689
|
},
|
|
6559
7690
|
{
|
|
6560
|
-
"name": "
|
|
6561
|
-
"type": "
|
|
6562
|
-
"
|
|
6563
|
-
"
|
|
7691
|
+
"name": "responsiveVariant",
|
|
7692
|
+
"type": "| 'default' | 'fullscreen'",
|
|
7693
|
+
"defaultValue": "'default'",
|
|
7694
|
+
"description": "Controls sidebar behavior at narrow viewport widths (below 768px). 'default' retains its normal inline layout. 'fullscreen' expands to cover the full viewport like a dialog overlay."
|
|
7695
|
+
},
|
|
7696
|
+
{
|
|
7697
|
+
"name": "hidden",
|
|
7698
|
+
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
|
|
7699
|
+
"defaultValue": "false",
|
|
7700
|
+
"description": "Whether the sidebar is hidden."
|
|
6564
7701
|
}
|
|
6565
7702
|
]
|
|
6566
7703
|
},
|
|
@@ -6612,6 +7749,18 @@
|
|
|
6612
7749
|
"id": "components-stack--default",
|
|
6613
7750
|
"code": "() => (\n <Stack>\n <div\n style={{\n background: 'var(--display-lemon-bgColor-muted)',\n borderRadius: 'var(--borderRadius-medium)',\n padding: 'var(--base-size-8)',\n }}\n >\n First\n </div>\n <div\n style={{\n background: 'var(--display-olive-bgColor-muted)',\n borderRadius: 'var(--borderRadius-medium)',\n padding: 'var(--base-size-8)',\n }}\n >\n Second\n </div>\n <div\n style={{\n background: 'var(--display-lime-bgColor-muted)',\n borderRadius: 'var(--borderRadius-medium)',\n padding: 'var(--base-size-8)',\n }}\n >\n Third\n </div>\n </Stack>\n)"
|
|
6614
7751
|
},
|
|
7752
|
+
{
|
|
7753
|
+
"id": "components-stack-features--gap-scale",
|
|
7754
|
+
"code": "() => (\n <Stack gap=\"spacious\">\n {(\n ['none', 'tight', 'condensed', 'cozy', 'normal', 'spacious'] as const\n ).map((gap) => (\n <Stack key={gap}>\n <span\n style={{\n fontSize: 'var(--text-body-size-small)',\n color: 'var(--fgColor-muted)',\n }}\n >\n gap="{gap}"\n </span>\n <Stack direction=\"horizontal\" gap={gap}>\n <Placeholder label=\"A\" />\n <Placeholder label=\"B\" />\n <Placeholder label=\"C\" />\n </Stack>\n </Stack>\n ))}\n </Stack>\n)"
|
|
7755
|
+
},
|
|
7756
|
+
{
|
|
7757
|
+
"id": "components-stack-features--directional-padding",
|
|
7758
|
+
"code": "() => (\n <Stack gap=\"normal\">\n <Stack\n padding=\"normal\"\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label='padding=\"normal\" (all sides)' />\n </Stack>\n <Stack\n padding=\"normal\"\n paddingInline=\"spacious\"\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label='padding=\"normal\" paddingInline=\"spacious\"' />\n </Stack>\n <Stack\n paddingBlock=\"condensed\"\n paddingInline=\"spacious\"\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label='paddingBlock=\"condensed\" paddingInline=\"spacious\"' />\n </Stack>\n </Stack>\n)"
|
|
7759
|
+
},
|
|
7760
|
+
{
|
|
7761
|
+
"id": "components-stack-features--padding-scale",
|
|
7762
|
+
"code": "() => (\n <Stack gap=\"spacious\">\n {(\n ['none', 'tight', 'condensed', 'cozy', 'normal', 'spacious'] as const\n ).map((padding) => (\n <Stack key={padding}>\n <span\n style={{\n fontSize: 'var(--text-body-size-small)',\n color: 'var(--fgColor-muted)',\n }}\n >\n padding="{padding}"\n </span>\n <Stack\n padding={padding}\n style={{\n backgroundColor: 'var(--bgColor-muted)',\n }}\n >\n <Placeholder label=\"Content\" />\n </Stack>\n </Stack>\n ))}\n </Stack>\n)"
|
|
7763
|
+
},
|
|
6615
7764
|
{
|
|
6616
7765
|
"id": "components-stack-features--shrinking-stack-items",
|
|
6617
7766
|
"code": "() => (\n <div\n style={{\n maxWidth: '200px',\n padding: 'var(--base-size-8)',\n }}\n >\n <Stack direction=\"horizontal\" gap=\"condensed\">\n <Stack.Item shrink={false}>\n <ShieldLockIcon size=\"small\" />\n </Stack.Item>\n <Stack.Item>\n This stack has the leading icon set to prevent shrinking\n </Stack.Item>\n </Stack>\n <Stack direction=\"horizontal\" gap=\"condensed\">\n <Stack.Item shrink={true}>\n <ShieldLockIcon size=\"small\" />\n </Stack.Item>\n <Stack.Item>\n This stack item does not have the icon set to prevent shrinking\n </Stack.Item>\n </Stack>\n </div>\n)"
|
|
@@ -6621,7 +7770,7 @@
|
|
|
6621
7770
|
"props": [
|
|
6622
7771
|
{
|
|
6623
7772
|
"name": "gap",
|
|
6624
|
-
"type": "'none' | 'condensed' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'condensed' | 'normal' | 'spacious'>",
|
|
7773
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
6625
7774
|
"description": "Specify the gap between children elements in the stack."
|
|
6626
7775
|
},
|
|
6627
7776
|
{
|
|
@@ -6636,7 +7785,7 @@
|
|
|
6636
7785
|
},
|
|
6637
7786
|
{
|
|
6638
7787
|
"name": "wrap",
|
|
6639
|
-
"type": "'wrap' | 'nowrap' | ResponsiveValue<'wrap' | 'nowrap'>",
|
|
7788
|
+
"type": "'wrap' | 'nowrap' | 'balance' | ResponsiveValue<'wrap' | 'nowrap' | 'balance'>",
|
|
6640
7789
|
"description": "Specify whether items are forced onto one line or can wrap onto multiple lines."
|
|
6641
7790
|
},
|
|
6642
7791
|
{
|
|
@@ -6646,9 +7795,19 @@
|
|
|
6646
7795
|
},
|
|
6647
7796
|
{
|
|
6648
7797
|
"name": "padding",
|
|
6649
|
-
"type": "'none' | 'condensed' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'condensed' | 'normal' | 'spacious'>",
|
|
7798
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
6650
7799
|
"description": "Specify the padding of the stack container."
|
|
6651
7800
|
},
|
|
7801
|
+
{
|
|
7802
|
+
"name": "paddingBlock",
|
|
7803
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
7804
|
+
"description": "Specify the block (vertical) padding of the stack container. Overrides the block axis of padding when both are set."
|
|
7805
|
+
},
|
|
7806
|
+
{
|
|
7807
|
+
"name": "paddingInline",
|
|
7808
|
+
"type": "'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious' | ResponsiveValue<'none' | 'tight' | 'condensed' | 'cozy' | 'normal' | 'spacious'>",
|
|
7809
|
+
"description": "Specify the inline (horizontal) padding of the stack container. Overrides the inline axis of padding when both are set."
|
|
7810
|
+
},
|
|
6652
7811
|
{
|
|
6653
7812
|
"name": "className",
|
|
6654
7813
|
"type": "string"
|
|
@@ -6723,9 +7882,25 @@
|
|
|
6723
7882
|
"id": "components-statelabel-features--unavailable",
|
|
6724
7883
|
"code": "() => <StateLabel status=\"unavailable\">Unavailable</StateLabel>"
|
|
6725
7884
|
},
|
|
7885
|
+
{
|
|
7886
|
+
"id": "components-statelabel-features--alert-opened",
|
|
7887
|
+
"code": "() => <StateLabel status=\"alertOpened\">Open</StateLabel>"
|
|
7888
|
+
},
|
|
7889
|
+
{
|
|
7890
|
+
"id": "components-statelabel-features--alert-fixed",
|
|
7891
|
+
"code": "() => <StateLabel status=\"alertFixed\">Fixed</StateLabel>"
|
|
7892
|
+
},
|
|
7893
|
+
{
|
|
7894
|
+
"id": "components-statelabel-features--alert-dismissed",
|
|
7895
|
+
"code": "() => <StateLabel status=\"alertDismissed\">Dismissed</StateLabel>"
|
|
7896
|
+
},
|
|
7897
|
+
{
|
|
7898
|
+
"id": "components-statelabel-features--alert-closed",
|
|
7899
|
+
"code": "() => <StateLabel status=\"alertClosed\">Closed</StateLabel>"
|
|
7900
|
+
},
|
|
6726
7901
|
{
|
|
6727
7902
|
"id": "components-statelabel-features--small",
|
|
6728
|
-
"code": "() => (\n <StateLabel status=\"issueOpened\"
|
|
7903
|
+
"code": "() => (\n <StateLabel status=\"issueOpened\" size=\"small\">\n Open\n </StateLabel>\n)"
|
|
6729
7904
|
},
|
|
6730
7905
|
{
|
|
6731
7906
|
"id": "components-statelabel-features--open",
|
|
@@ -6734,18 +7909,29 @@
|
|
|
6734
7909
|
{
|
|
6735
7910
|
"id": "components-statelabel-features--closed",
|
|
6736
7911
|
"code": "() => <StateLabel status=\"closed\">Closed</StateLabel>"
|
|
7912
|
+
},
|
|
7913
|
+
{
|
|
7914
|
+
"id": "components-statelabel-features--archived",
|
|
7915
|
+
"code": "() => <StateLabel status=\"archived\">Archived</StateLabel>"
|
|
6737
7916
|
}
|
|
6738
7917
|
],
|
|
6739
7918
|
"importPath": "@primer/react",
|
|
6740
7919
|
"props": [
|
|
7920
|
+
{
|
|
7921
|
+
"name": "size",
|
|
7922
|
+
"type": "'small' | 'medium'",
|
|
7923
|
+
"defaultValue": "'medium'"
|
|
7924
|
+
},
|
|
6741
7925
|
{
|
|
6742
7926
|
"name": "variant",
|
|
6743
7927
|
"type": "'small' | 'normal'",
|
|
6744
|
-
"defaultValue": "'normal'"
|
|
7928
|
+
"defaultValue": "'normal'",
|
|
7929
|
+
"description": "Use `size` instead.",
|
|
7930
|
+
"deprecated": true
|
|
6745
7931
|
},
|
|
6746
7932
|
{
|
|
6747
7933
|
"name": "status",
|
|
6748
|
-
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'issueDraft' | 'unavailable' | 'open' | 'closed'",
|
|
7934
|
+
"type": "'issueOpened' | 'issueClosed' | 'issueClosedNotPlanned' | 'pullOpened' | 'pullClosed' | 'pullMerged' | 'draft' | 'issueDraft' | 'pullQueued' | 'unavailable' | 'alertOpened' | 'alertFixed' | 'alertDismissed' | 'alertClosed' | 'open' | 'closed' | 'archived'",
|
|
6749
7935
|
"required": true
|
|
6750
7936
|
}
|
|
6751
7937
|
],
|
|
@@ -6919,6 +8105,26 @@
|
|
|
6919
8105
|
{
|
|
6920
8106
|
"id": "components-text-features--semibold-weight",
|
|
6921
8107
|
"code": "() => (\n <Text as=\"span\" weight=\"semibold\">\n Stylized text\n </Text>\n)"
|
|
8108
|
+
},
|
|
8109
|
+
{
|
|
8110
|
+
"id": "components-text-features--pre-white-space",
|
|
8111
|
+
"code": "() => (\n <Text as=\"span\" whiteSpace=\"pre\">\n Stylized text\n </Text>\n)"
|
|
8112
|
+
},
|
|
8113
|
+
{
|
|
8114
|
+
"id": "components-text-features--normal-white-space",
|
|
8115
|
+
"code": "() => (\n <Text as=\"span\" whiteSpace=\"normal\">\n Stylized text\n </Text>\n)"
|
|
8116
|
+
},
|
|
8117
|
+
{
|
|
8118
|
+
"id": "components-text-features--nowrap-white-space",
|
|
8119
|
+
"code": "() => (\n <Text as=\"span\" whiteSpace=\"nowrap\">\n Stylized text\n </Text>\n)"
|
|
8120
|
+
},
|
|
8121
|
+
{
|
|
8122
|
+
"id": "components-text-features--pre-wrap-white-space",
|
|
8123
|
+
"code": "() => (\n <Text as=\"span\" whiteSpace=\"pre-wrap\">\n Stylized text\n </Text>\n)"
|
|
8124
|
+
},
|
|
8125
|
+
{
|
|
8126
|
+
"id": "components-text-features--pre-line-white-space",
|
|
8127
|
+
"code": "() => (\n <Text as=\"span\" whiteSpace=\"pre-line\">\n Stylized text\n </Text>\n)"
|
|
6922
8128
|
}
|
|
6923
8129
|
],
|
|
6924
8130
|
"importPath": "@primer/react",
|
|
@@ -7035,11 +8241,17 @@
|
|
|
7035
8241
|
"defaultValue": "false",
|
|
7036
8242
|
"description": "Creates a full-width input element"
|
|
7037
8243
|
},
|
|
8244
|
+
{
|
|
8245
|
+
"name": "characterLimit",
|
|
8246
|
+
"type": "number",
|
|
8247
|
+
"description": "The maximum number of characters allowed in the input"
|
|
8248
|
+
},
|
|
7038
8249
|
{
|
|
7039
8250
|
"name": "contrast",
|
|
7040
8251
|
"type": "boolean",
|
|
7041
8252
|
"defaultValue": "false",
|
|
7042
|
-
"
|
|
8253
|
+
"deprecated": true,
|
|
8254
|
+
"description": "Deprecated. Omit this prop to use the default background."
|
|
7043
8255
|
},
|
|
7044
8256
|
{
|
|
7045
8257
|
"name": "size",
|
|
@@ -7374,11 +8586,23 @@
|
|
|
7374
8586
|
"defaultValue": "'both'",
|
|
7375
8587
|
"description": "Changes the resize behavior"
|
|
7376
8588
|
},
|
|
8589
|
+
{
|
|
8590
|
+
"name": "autoSize",
|
|
8591
|
+
"type": "boolean",
|
|
8592
|
+
"defaultValue": "false",
|
|
8593
|
+
"description": "Allows the textarea to grow to fit its content"
|
|
8594
|
+
},
|
|
8595
|
+
{
|
|
8596
|
+
"name": "characterLimit",
|
|
8597
|
+
"type": "number",
|
|
8598
|
+
"description": "The maximum number of characters allowed in the textarea"
|
|
8599
|
+
},
|
|
7377
8600
|
{
|
|
7378
8601
|
"name": "contrast",
|
|
7379
8602
|
"type": "boolean",
|
|
7380
8603
|
"defaultValue": "false",
|
|
7381
|
-
"
|
|
8604
|
+
"deprecated": true,
|
|
8605
|
+
"description": "Deprecated. Omit this prop to use the default background."
|
|
7382
8606
|
},
|
|
7383
8607
|
{
|
|
7384
8608
|
"name": "validationStatus",
|
|
@@ -7422,31 +8646,51 @@
|
|
|
7422
8646
|
"stories": [
|
|
7423
8647
|
{
|
|
7424
8648
|
"id": "components-timeline--default",
|
|
7425
|
-
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge>\n <
|
|
8649
|
+
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
7426
8650
|
},
|
|
7427
8651
|
{
|
|
7428
8652
|
"id": "components-timeline-features--clip-sidebar",
|
|
7429
|
-
"code": "() => (\n <Timeline clipSidebar>\n <Timeline.Item>\n <Timeline.Badge>\n <
|
|
8653
|
+
"code": "() => (\n <Timeline clipSidebar>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
8654
|
+
},
|
|
8655
|
+
{
|
|
8656
|
+
"id": "components-timeline-features--clip-sidebar-start",
|
|
8657
|
+
"code": "() => (\n <Timeline clipSidebar=\"start\">\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
8658
|
+
},
|
|
8659
|
+
{
|
|
8660
|
+
"id": "components-timeline-features--clip-sidebar-end",
|
|
8661
|
+
"code": "() => (\n <Timeline clipSidebar=\"end\">\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
7430
8662
|
},
|
|
7431
8663
|
{
|
|
7432
8664
|
"id": "components-timeline-features--condensed-items",
|
|
7433
|
-
"code": "() => (\n <Timeline>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <
|
|
8665
|
+
"code": "() => (\n <Timeline>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Break />\n <Timeline.Item condensed>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
7434
8666
|
},
|
|
7435
8667
|
{
|
|
7436
8668
|
"id": "components-timeline-features--timeline-break",
|
|
7437
|
-
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge
|
|
8669
|
+
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge variant=\"done\">\n <GitMergeIcon aria-label=\"Merged\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n <Timeline.Break />\n <Timeline.Item>\n <Timeline.Badge>\n <GitBranchIcon aria-label=\"Branch\" />\n </Timeline.Badge>\n <Timeline.Body>This is a message</Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
8670
|
+
},
|
|
8671
|
+
{
|
|
8672
|
+
"id": "components-timeline-features--badge-variants",
|
|
8673
|
+
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge variant=\"accent\">\n <GitPullRequestIcon aria-label=\"Pull request\" />\n </Timeline.Badge>\n <Timeline.Body>Accent</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"success\">\n <IssueClosedIcon aria-label=\"Closed\" />\n </Timeline.Badge>\n <Timeline.Body>Success</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"attention\">\n <FlameIcon aria-label=\"Attention\" />\n </Timeline.Badge>\n <Timeline.Body>Attention</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"severe\">\n <SkipIcon aria-label=\"Severe\" />\n </Timeline.Badge>\n <Timeline.Body>Severe</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"danger\">\n <XIcon aria-label=\"Danger\" />\n </Timeline.Badge>\n <Timeline.Body>Danger</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"done\">\n <GitMergeIcon aria-label=\"Merged\" />\n </Timeline.Badge>\n <Timeline.Body>Done</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"open\">\n <IssueOpenedIcon aria-label=\"Open\" />\n </Timeline.Badge>\n <Timeline.Body>Open</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"closed\">\n <IssueClosedIcon aria-label=\"Closed\" />\n </Timeline.Badge>\n <Timeline.Body>Closed</Timeline.Body>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge variant=\"sponsors\">\n <HeartIcon aria-label=\"Sponsors\" />\n </Timeline.Badge>\n <Timeline.Body>Sponsors</Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
7438
8674
|
},
|
|
7439
8675
|
{
|
|
7440
8676
|
"id": "components-timeline-features--with-inline-links",
|
|
7441
|
-
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge>\n <
|
|
8677
|
+
"code": "() => (\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge>\n <GitCommitIcon aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n enabled auto-merge (squash)\n </Timeline.Body>\n </Timeline.Item>\n </Timeline>\n)"
|
|
8678
|
+
},
|
|
8679
|
+
{
|
|
8680
|
+
"id": "components-timeline-features--with-actions",
|
|
8681
|
+
"code": "() => (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <div\n className={classes.RealisticTimeline}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest('a')) e.preventDefault()\n }}\n >\n <Timeline>\n <Timeline.Item>\n <Timeline.Badge variant=\"done\">\n <Octicon icon={GitMergeIcon} aria-label=\"Merged\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n merged via the queue into <BranchName href=\"#\">main</BranchName> with\n commit{' '}\n <Link href=\"#\" className={classes.CommitSha}>\n 01e49tb\n </Link>{' '}\n <Link href=\"#\" className={classes.Timestamp} muted>\n just now\n </Link>\n <div className={classes.ChecksSubline}>28 checks passed</div>\n </Timeline.Body>\n <Timeline.Actions>\n <Button size=\"small\">View details</Button>\n <Button size=\"small\">Revert</Button>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <Octicon icon={RepoPushIcon} aria-label=\"Force-push\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n force-pushed the <BranchName href=\"#\">main</BranchName> branch from{' '}\n <Link href=\"#\" className={classes.CommitSha}>\n 01e49tb\n </Link>{' '}\n to{' '}\n <Link href=\"#\" className={classes.CommitSha}>\n 02f50uc\n </Link>{' '}\n <Link href=\"#\" className={classes.Timestamp} muted>\n 2 hours ago\n </Link>\n </Timeline.Body>\n <Timeline.Actions>\n <Button size=\"small\">Compare</Button>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <Octicon icon={GitCommitIcon} aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" muted>\n Update README.md\n </Link>\n </Timeline.Body>\n <Timeline.Actions>\n <Label\n className={`${classes.SignatureLabelVerified} ${classes.HideAtNarrow}`}\n >\n Verified\n </Label>\n <Octicon\n icon={CheckIcon}\n className={classes.IconSuccess}\n aria-label=\"All checks passed\"\n />\n <Link href=\"#\" className={classes.ShaLink} muted>\n 3fbdc0\n </Link>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item condensed>\n <Timeline.Badge>\n <Octicon icon={GitCommitIcon} aria-label=\"Commit\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" muted>\n Initial commit\n </Link>\n </Timeline.Body>\n <Timeline.Actions>\n <Label className={classes.HideAtNarrow}>Unverified</Label>\n <Octicon\n icon={XIcon}\n className={classes.IconDanger}\n aria-label=\"Some checks failed\"\n />\n <Link href=\"#\" className={classes.ShaLink} muted>\n 3fbdc0\n </Link>\n </Timeline.Actions>\n </Timeline.Item>\n <Timeline.Item>\n <Timeline.Badge>\n <Octicon icon={CrossReferenceIcon} aria-label=\"Cross-reference\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Avatar\n src=\"https://avatars.githubusercontent.com/u/92997159?v=4\"\n size={20}\n className={classes.InlineAvatar}\n />\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n Monalisa\n </Link>\n mentioned this pull request{' '}\n <Link href=\"#\" className={classes.Timestamp} muted>\n just now\n </Link>\n <div className={classes.CrossReferenceRow}>\n <div className={classes.CrossReferenceTitle}>\n <Link href=\"#\" className={classes.CrossReferenceLink}>\n <span className={classes.CrossReferenceName}>\n Fix positioning of Autocomplete overlay menu\n </span>{' '}\n <span className={classes.CrossReferenceNumber}>\n primer/react#7431\n </span>\n </Link>\n </div>\n <Octicon\n icon={LockIcon}\n size={16}\n className={classes.CrossReferenceMeta}\n aria-label=\"Private\"\n />\n <StateLabel status=\"pullOpened\" size=\"small\">\n Open\n </StateLabel>\n </div>\n <div className={classes.CrossReferenceTaskline}>\n <Octicon icon={TasklistIcon} size={16} />\n 17 tasks\n </div>\n </Timeline.Body>\n </Timeline.Item>\n </Timeline>\n </div>\n)"
|
|
8682
|
+
},
|
|
8683
|
+
{
|
|
8684
|
+
"id": "components-timeline-features--with-avatar",
|
|
8685
|
+
"code": "() => (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions\n <div\n className={`${classes.RealisticTimeline} ${classes.AvatarGutter}`}\n onClick={(e) => {\n if ((e.target as HTMLElement).closest('a')) e.preventDefault()\n }}\n >\n <Timeline>\n <Timeline.Item>\n <Timeline.Avatar>\n <Avatar\n size={40}\n src=\"https://avatars.githubusercontent.com/u/92997159?v=4\"\n alt=\"\"\n />\n </Timeline.Avatar>\n <Timeline.Badge variant=\"done\">\n <Octicon icon={CheckIcon} aria-label=\"Approved\" />\n </Timeline.Badge>\n <Timeline.Body>\n <Link href=\"#\" className={classes.LinkWithBoldStyle} muted>\n monalisa\n </Link>\n {'approved these changes '}\n <RelativeTime date={new Date()} format=\"relative\" />\n </Timeline.Body>\n <Timeline.Actions>\n <Button size=\"small\">View reviewed changes</Button>\n </Timeline.Actions>\n </Timeline.Item>\n </Timeline>\n </div>\n)"
|
|
7442
8686
|
}
|
|
7443
8687
|
],
|
|
7444
8688
|
"importPath": "@primer/react",
|
|
7445
8689
|
"props": [
|
|
7446
8690
|
{
|
|
7447
8691
|
"name": "clipSidebar",
|
|
7448
|
-
"type": "boolean",
|
|
7449
|
-
"description": "
|
|
8692
|
+
"type": "| boolean | 'start' | 'end' | 'both'",
|
|
8693
|
+
"description": "Controls which ends of the sidebar are clipped. When set to `true` or `'both'`, hides the sidebar above the first and below the last Timeline.Item. Use `'start'` to only clip the top or `'end'` to only clip the bottom."
|
|
7450
8694
|
}
|
|
7451
8695
|
],
|
|
7452
8696
|
"subcomponents": [
|
|
@@ -7462,7 +8706,13 @@
|
|
|
7462
8706
|
},
|
|
7463
8707
|
{
|
|
7464
8708
|
"name": "Timeline.Badge",
|
|
7465
|
-
"props": [
|
|
8709
|
+
"props": [
|
|
8710
|
+
{
|
|
8711
|
+
"name": "variant",
|
|
8712
|
+
"type": "'accent' | 'success' | 'attention' | 'severe' | 'danger' | 'done' | 'open' | 'closed' | 'sponsors'",
|
|
8713
|
+
"description": "The color variant of the badge."
|
|
8714
|
+
}
|
|
8715
|
+
]
|
|
7466
8716
|
},
|
|
7467
8717
|
{
|
|
7468
8718
|
"name": "Timeline.Body",
|
|
@@ -7471,6 +8721,14 @@
|
|
|
7471
8721
|
{
|
|
7472
8722
|
"name": "Timeline.Break",
|
|
7473
8723
|
"props": []
|
|
8724
|
+
},
|
|
8725
|
+
{
|
|
8726
|
+
"name": "Timeline.Actions",
|
|
8727
|
+
"props": []
|
|
8728
|
+
},
|
|
8729
|
+
{
|
|
8730
|
+
"name": "Timeline.Avatar",
|
|
8731
|
+
"props": []
|
|
7474
8732
|
}
|
|
7475
8733
|
]
|
|
7476
8734
|
},
|
|
@@ -7881,12 +9139,64 @@
|
|
|
7881
9139
|
},
|
|
7882
9140
|
{
|
|
7883
9141
|
"name": "keybindingHint",
|
|
7884
|
-
"type": "string",
|
|
7885
|
-
"description": "Optional keybinding hint to indicate the availability of a keyboard shortcut. Supported syntax is described in the docs for the `KeybindingHint` component."
|
|
9142
|
+
"type": "string | string[]",
|
|
9143
|
+
"description": "Optional keybinding hint to indicate the availability of a keyboard shortcut. Pass a string for a single shortcut or an array of strings to show multiple shortcuts joined with \"or\". Supported syntax is described in the docs for the `KeybindingHint` component."
|
|
9144
|
+
},
|
|
9145
|
+
{
|
|
9146
|
+
"name": "delay",
|
|
9147
|
+
"type": "'short' | 'medium' | 'long'",
|
|
9148
|
+
"defaultValue": "short",
|
|
9149
|
+
"description": "Sets the delay before showing the tooltip. `short` is 50ms (default), `medium` is 400ms, and `long` is 1200ms."
|
|
7886
9150
|
}
|
|
7887
9151
|
],
|
|
7888
9152
|
"subcomponents": []
|
|
7889
9153
|
},
|
|
9154
|
+
"topic_tag": {
|
|
9155
|
+
"source": "https://github.com/primer/react/tree/main/packages/react/src/TopicTag",
|
|
9156
|
+
"id": "topic_tag",
|
|
9157
|
+
"name": "TopicTag",
|
|
9158
|
+
"status": "draft",
|
|
9159
|
+
"a11yReviewed": false,
|
|
9160
|
+
"stories": [
|
|
9161
|
+
{
|
|
9162
|
+
"id": "experimental-components-topictag--default",
|
|
9163
|
+
"code": "() => <TopicTag>react</TopicTag>"
|
|
9164
|
+
},
|
|
9165
|
+
{
|
|
9166
|
+
"id": "experimental-components-topictag-features--as-button",
|
|
9167
|
+
"code": "() => <TopicTag as=\"button\">react</TopicTag>"
|
|
9168
|
+
},
|
|
9169
|
+
{
|
|
9170
|
+
"id": "experimental-components-topictag-features--as-group",
|
|
9171
|
+
"code": "() => {\n const tags = [\n 'react',\n 'nodejs',\n 'javascript',\n 'd3',\n 'teachers',\n 'community',\n 'education',\n 'programming',\n 'curriculum',\n 'math',\n ]\n return (\n <TopicTagGroup>\n {tags.map((tag) => (\n <TopicTag key={tag} href={`/topics/${tag}`}>\n {tag}\n </TopicTag>\n ))}\n </TopicTagGroup>\n )\n}"
|
|
9172
|
+
}
|
|
9173
|
+
],
|
|
9174
|
+
"importPath": "@primer/react/experimental",
|
|
9175
|
+
"props": [
|
|
9176
|
+
{
|
|
9177
|
+
"name": "as",
|
|
9178
|
+
"type": "React.ElementType",
|
|
9179
|
+
"description": "The HTML element or React component to render as the root element"
|
|
9180
|
+
},
|
|
9181
|
+
{
|
|
9182
|
+
"name": "className",
|
|
9183
|
+
"type": "string",
|
|
9184
|
+
"description": "Provide a class name for styling on the outermost element"
|
|
9185
|
+
}
|
|
9186
|
+
],
|
|
9187
|
+
"subcomponents": [
|
|
9188
|
+
{
|
|
9189
|
+
"name": "TopicTag.Group",
|
|
9190
|
+
"props": [
|
|
9191
|
+
{
|
|
9192
|
+
"name": "className",
|
|
9193
|
+
"type": "string",
|
|
9194
|
+
"description": "Provide a class name for styling on the outermost element"
|
|
9195
|
+
}
|
|
9196
|
+
]
|
|
9197
|
+
}
|
|
9198
|
+
]
|
|
9199
|
+
},
|
|
7890
9200
|
"tree_view": {
|
|
7891
9201
|
"source": "https://github.com/primer/react/tree/main/packages/react/src/TreeView",
|
|
7892
9202
|
"id": "tree_view",
|
|
@@ -8037,6 +9347,12 @@
|
|
|
8037
9347
|
{
|
|
8038
9348
|
"name": "ref",
|
|
8039
9349
|
"type": "React.Ref<HTMLElement>"
|
|
9350
|
+
},
|
|
9351
|
+
{
|
|
9352
|
+
"name": "as",
|
|
9353
|
+
"type": "React.ElementType",
|
|
9354
|
+
"defaultValue": "'li'",
|
|
9355
|
+
"description": "The element type to render the tree item as. When set to a different element type or component, the polymorphic element is rendered with `role=\"treeitem\"` and is wrapped in an `li` element with `role=\"none\"` so the markup remains valid inside a `ul` with `role=\"tree\"`."
|
|
8040
9356
|
}
|
|
8041
9357
|
]
|
|
8042
9358
|
},
|
|
@@ -8149,6 +9465,10 @@
|
|
|
8149
9465
|
{
|
|
8150
9466
|
"id": "components-truncate-features--max-width",
|
|
8151
9467
|
"code": "() => (\n <Truncate title=\"Some example text with a max width\" maxWidth={200}>\n Some example text with a max width\n </Truncate>\n)"
|
|
9468
|
+
},
|
|
9469
|
+
{
|
|
9470
|
+
"id": "components-truncate-features--as-link",
|
|
9471
|
+
"code": "() => {\n const url =\n 'https://github.com/primer/react/blob/main/packages/react/src/Truncate/Truncate.tsx'\n return (\n <p>\n Mirror:{' '}\n <Truncate as={Link} href={url} title={url} maxWidth={300} inline>\n {url}\n </Truncate>{' '}\n (inline link inside text)\n </p>\n )\n}"
|
|
8152
9472
|
}
|
|
8153
9473
|
],
|
|
8154
9474
|
"importPath": "@primer/react",
|
|
@@ -8192,23 +9512,23 @@
|
|
|
8192
9512
|
},
|
|
8193
9513
|
{
|
|
8194
9514
|
"id": "components-underlinenav-features--with-icons",
|
|
8195
|
-
"code": "() => {\n return (\n <UnderlineNav aria-label=\"Repository with icons\">\n <UnderlineNav.Item
|
|
9515
|
+
"code": "() => {\n return (\n <UnderlineNav aria-label=\"Repository with icons\">\n <UnderlineNav.Item leadingVisual={<CodeIcon />}>Code</UnderlineNav.Item>\n <UnderlineNav.Item leadingVisual={<EyeIcon />} counter={6}>\n Issues\n </UnderlineNav.Item>\n <UnderlineNav.Item\n aria-current=\"page\"\n leadingVisual={<GitPullRequestIcon />}\n >\n Pull Requests\n </UnderlineNav.Item>\n <UnderlineNav.Item leadingVisual={<CommentDiscussionIcon />} counter={7}>\n Discussions\n </UnderlineNav.Item>\n <UnderlineNav.Item leadingVisual={<ProjectIcon />}>\n Projects\n </UnderlineNav.Item>\n </UnderlineNav>\n )\n}"
|
|
8196
9516
|
},
|
|
8197
9517
|
{
|
|
8198
9518
|
"id": "components-underlinenav-features--with-counter-labels",
|
|
8199
|
-
"code": "() => {\n return (\n <UnderlineNav aria-label=\"Repository with counters\">\n <UnderlineNav.Item
|
|
9519
|
+
"code": "() => {\n return (\n <UnderlineNav aria-label=\"Repository with counters\">\n <UnderlineNav.Item\n aria-current=\"page\"\n leadingVisual={<CodeIcon />}\n counter=\"11K\"\n >\n Code\n </UnderlineNav.Item>\n <UnderlineNav.Item leadingVisual={<IssueOpenedIcon />} counter={12}>\n Issues\n </UnderlineNav.Item>\n </UnderlineNav>\n )\n}"
|
|
8200
9520
|
},
|
|
8201
9521
|
{
|
|
8202
9522
|
"id": "components-underlinenav-features--overflow-template",
|
|
8203
|
-
"code": "({ initialSelectedIndex = 1 }: { initialSelectedIndex?: number }) => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(\n initialSelectedIndex,\n )\n return (\n <UnderlineNav
|
|
9523
|
+
"code": "({ initialSelectedIndex = 1 }: { initialSelectedIndex?: number }) => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(\n initialSelectedIndex,\n )\n return (\n <UnderlineNav aria-label=\"Repository\" hideIconsBreakpoint=\"medium\">\n {items.map((item, index) => (\n <UnderlineNav.Item\n key={item.navigation}\n leadingVisual={item.icon}\n aria-current={index === selectedIndex ? 'page' : undefined}\n // Set so that navigation in interaction tests does not cause the\n // page to load the storybook iframe URL and instead keeps the test in\n // the local preview\n target=\"_self\"\n onSelect={(event) => {\n event.preventDefault()\n setSelectedIndex(index)\n }}\n counter={item.counter}\n href={item.href}\n >\n {item.navigation}\n </UnderlineNav.Item>\n ))}\n </UnderlineNav>\n )\n}"
|
|
8204
9524
|
},
|
|
8205
9525
|
{
|
|
8206
9526
|
"id": "components-underlinenav-features--overflow-on-narrow-screen",
|
|
8207
|
-
"code": "() => {\n return <OverflowTemplate initialSelectedIndex={1} />\n}"
|
|
9527
|
+
"code": "() => {\n return <OverflowTemplate initialSelectedIndex={items.length - 1} />\n}"
|
|
8208
9528
|
},
|
|
8209
9529
|
{
|
|
8210
9530
|
"id": "components-underlinenav-features--counters-loading-state",
|
|
8211
|
-
"code": "() => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(1)\n return (\n <UnderlineNav\n aria-label=\"Repository with loading counters\"\n loadingCounters={true}\n >\n {items.map((item, index) => (\n <UnderlineNav.Item\n key={item.navigation}\n
|
|
9531
|
+
"code": "() => {\n const [selectedIndex, setSelectedIndex] = React.useState<number | null>(1)\n return (\n <UnderlineNav\n aria-label=\"Repository with loading counters\"\n loadingCounters={true}\n >\n {items.map((item, index) => (\n <UnderlineNav.Item\n key={item.navigation}\n leadingVisual={item.icon}\n aria-current={index === selectedIndex ? 'page' : undefined}\n onSelect={() => setSelectedIndex(index)}\n counter={item.counter}\n >\n {item.navigation}\n </UnderlineNav.Item>\n ))}\n </UnderlineNav>\n )\n}"
|
|
8212
9532
|
},
|
|
8213
9533
|
{
|
|
8214
9534
|
"id": "components-underlinenav-features--variant-flush",
|
|
@@ -8236,6 +9556,12 @@
|
|
|
8236
9556
|
"defaultValue": "false",
|
|
8237
9557
|
"description": "Whether the navigation items are in loading state. Component waits for all the counters to finish loading to prevent multiple layout shifts."
|
|
8238
9558
|
},
|
|
9559
|
+
{
|
|
9560
|
+
"name": "hideIconsBreakpoint",
|
|
9561
|
+
"type": "'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | null",
|
|
9562
|
+
"defaultValue": "'medium'",
|
|
9563
|
+
"description": "Controls the container width below which icons are hidden to save space. To keep icons visible in a narrow container, use a smaller breakpoint such as `xsmall`, or set to `null` to always show icons."
|
|
9564
|
+
},
|
|
8239
9565
|
{
|
|
8240
9566
|
"name": "variant",
|
|
8241
9567
|
"type": "'inset' | 'flush'",
|
|
@@ -8263,13 +9589,20 @@
|
|
|
8263
9589
|
"name": "href",
|
|
8264
9590
|
"type": "string",
|
|
8265
9591
|
"defaultValue": "",
|
|
8266
|
-
"description": "The URL that the item navigates to.
|
|
9592
|
+
"description": "The URL that the item navigates to. Native anchor items default to `href=\"#\"`. When a custom component is supplied with `as`, no default `href` is added; provide the navigation props required by that component, such as `to` for React Router."
|
|
8267
9593
|
},
|
|
8268
9594
|
{
|
|
8269
9595
|
"name": "icon",
|
|
8270
9596
|
"type": "Component",
|
|
8271
9597
|
"defaultValue": "",
|
|
8272
|
-
"description": "The leading icon comes before item label"
|
|
9598
|
+
"description": "The leading icon comes before item label",
|
|
9599
|
+
"deprecated": true
|
|
9600
|
+
},
|
|
9601
|
+
{
|
|
9602
|
+
"name": "leadingVisual",
|
|
9603
|
+
"type": "React.ReactElement",
|
|
9604
|
+
"defaultValue": "",
|
|
9605
|
+
"description": "The leading visual comes before item label"
|
|
8273
9606
|
},
|
|
8274
9607
|
{
|
|
8275
9608
|
"name": "onSelect",
|
|
@@ -8290,6 +9623,79 @@
|
|
|
8290
9623
|
}
|
|
8291
9624
|
]
|
|
8292
9625
|
},
|
|
9626
|
+
"aria-alert": {
|
|
9627
|
+
"source": "https://github.com/primer/react/tree/main/packages/react/src/live-region",
|
|
9628
|
+
"id": "aria-alert",
|
|
9629
|
+
"name": "AriaAlert",
|
|
9630
|
+
"status": "alpha",
|
|
9631
|
+
"a11yReviewed": false,
|
|
9632
|
+
"importPath": "@primer/react",
|
|
9633
|
+
"stories": [
|
|
9634
|
+
{
|
|
9635
|
+
"id": "components-ariaalert--default",
|
|
9636
|
+
"code": "() => {\n const [message, setMessage] = useState('Default message')\n useEffect(() => {\n const interval = setInterval(() => {\n setMessage(`Last updated at ${new Date().toLocaleTimeString()}`)\n }, 5000)\n return () => {\n clearInterval(interval)\n }\n }, [])\n return <AriaAlert>{message}</AriaAlert>\n}"
|
|
9637
|
+
},
|
|
9638
|
+
{
|
|
9639
|
+
"id": "components-ariaalert-features--visually-hidden-story",
|
|
9640
|
+
"code": "() => {\n return (\n <>\n <p>This is an example</p>\n <VisuallyHidden>\n <AriaAlert>A visually hidden message</AriaAlert>\n </VisuallyHidden>\n </>\n )\n}"
|
|
9641
|
+
}
|
|
9642
|
+
],
|
|
9643
|
+
"props": [
|
|
9644
|
+
{
|
|
9645
|
+
"name": "announceOnShow",
|
|
9646
|
+
"type": "boolean",
|
|
9647
|
+
"description": "Specify if the content of the element should be announced when this component is rendered and is not hidden",
|
|
9648
|
+
"defaultValue": "true"
|
|
9649
|
+
},
|
|
9650
|
+
{
|
|
9651
|
+
"name": "hidden",
|
|
9652
|
+
"type": "boolean",
|
|
9653
|
+
"description": "Specify if the element is hidden",
|
|
9654
|
+
"defaultValue": "false"
|
|
9655
|
+
}
|
|
9656
|
+
]
|
|
9657
|
+
},
|
|
9658
|
+
"aria-status": {
|
|
9659
|
+
"source": "https://github.com/primer/react/tree/main/packages/react/src/live-region",
|
|
9660
|
+
"id": "aria-status",
|
|
9661
|
+
"name": "AriaStatus",
|
|
9662
|
+
"status": "alpha",
|
|
9663
|
+
"a11yReviewed": false,
|
|
9664
|
+
"importPath": "@primer/react",
|
|
9665
|
+
"stories": [
|
|
9666
|
+
{
|
|
9667
|
+
"id": "components-ariastatus--default",
|
|
9668
|
+
"code": "() => {\n const [message, setMessage] = useState('Default message')\n useEffect(() => {\n const interval = setInterval(() => {\n setMessage(`Last updated at ${new Date().toLocaleTimeString()}`)\n }, 5000)\n return () => {\n clearInterval(interval)\n }\n }, [])\n return <AriaStatus>{message}</AriaStatus>\n}"
|
|
9669
|
+
},
|
|
9670
|
+
{
|
|
9671
|
+
"id": "components-ariastatus-features--visually-hidden-story",
|
|
9672
|
+
"code": "() => {\n return (\n <>\n <p>This is an example</p>\n <VisuallyHidden>\n <AriaStatus>A visually hidden message</AriaStatus>\n </VisuallyHidden>\n </>\n )\n}"
|
|
9673
|
+
},
|
|
9674
|
+
{
|
|
9675
|
+
"id": "components-ariastatus-features--with-delay",
|
|
9676
|
+
"code": "() => {\n const [message, setMessage] = useState('Default message')\n useEffect(() => {\n const interval = setInterval(() => {\n setMessage(`Last updated at ${new Date().toLocaleTimeString()}`)\n }, 5000)\n return () => {\n clearInterval(interval)\n }\n }, [])\n return <AriaStatus delayMs={1000}>{message}</AriaStatus>\n}"
|
|
9677
|
+
}
|
|
9678
|
+
],
|
|
9679
|
+
"props": [
|
|
9680
|
+
{
|
|
9681
|
+
"name": "announceOnShow",
|
|
9682
|
+
"type": "boolean",
|
|
9683
|
+
"description": "Specify if the content of the element should be announced when this component is rendered and is not hidden",
|
|
9684
|
+
"defaultValue": "false"
|
|
9685
|
+
},
|
|
9686
|
+
{
|
|
9687
|
+
"name": "hidden",
|
|
9688
|
+
"type": "boolean",
|
|
9689
|
+
"description": "Specify if the element is hidden",
|
|
9690
|
+
"defaultValue": "false"
|
|
9691
|
+
},
|
|
9692
|
+
{
|
|
9693
|
+
"name": "delayMs",
|
|
9694
|
+
"type": "number",
|
|
9695
|
+
"description": "Provide a delay in milliseconds before the announcement is made"
|
|
9696
|
+
}
|
|
9697
|
+
]
|
|
9698
|
+
},
|
|
8293
9699
|
"dialog": {
|
|
8294
9700
|
"source": "https://github.com/primer/react/tree/main/packages/react/src/deprecated/DialogV1",
|
|
8295
9701
|
"id": "dialog",
|
|
@@ -8525,7 +9931,7 @@
|
|
|
8525
9931
|
},
|
|
8526
9932
|
{
|
|
8527
9933
|
"id": "deprecated-components-selectpanel-examples--with-filter-buttons",
|
|
8528
|
-
"code": "() => {\n const [selectedFilter, setSelectedFilter] = React.useState<\n 'branches' | 'tags'\n >('branches')\n\n /* Selection */\n const [savedInitialRef, setSavedInitialRef] = React.useState(data.ref)\n const [selectedRef, setSelectedRef] = React.useState(savedInitialRef)\n const onSubmit = () => {\n setSavedInitialRef(selectedRef)\n data.ref = selectedRef // pretending to persist changes\n\n // eslint-disable-next-line no-console\n console.log('form submitted')\n }\n const onCancel = () => {\n setSelectedRef(savedInitialRef)\n }\n\n /* Filter */\n const [query, setQuery] = React.useState('')\n const onSearchInputChange: React.ChangeEventHandler<HTMLInputElement> = (\n event,\n ) => {\n const query = event.currentTarget.value\n setQuery(query)\n }\n const [filteredRefs, setFilteredRefs] = React.useState(data.branches)\n const setSearchResults = (\n query: string,\n selectedFilter: 'branches' | 'tags',\n ) => {\n if (query === '') setFilteredRefs(data[selectedFilter])\n else {\n setFilteredRefs(\n data[selectedFilter]\n .map((item) => {\n if (item.name.toLowerCase().startsWith(query))\n return {\n priority: 1,\n item,\n }\n else if (item.name.toLowerCase().includes(query))\n return {\n priority: 2,\n item,\n }\n else\n return {\n priority: -1,\n item,\n }\n })\n .filter((result) => result.priority > 0)\n .map((result) => result.item),\n )\n }\n }\n React.useEffect(\n function updateSearchResults() {\n setSearchResults(query, selectedFilter)\n },\n [query, selectedFilter],\n )\n const sortingFn = (ref: { id: string }) => {\n if (ref.id === savedInitialRef) return -1\n else return 1\n }\n const itemsToShow = query\n ? filteredRefs\n : data[selectedFilter].sort(sortingFn)\n return (\n <>\n <h1>With Filter Buttons {savedInitialRef}</h1>\n\n <SelectPanel\n title=\"Switch branches/tags\"\n onSubmit={onSubmit}\n onCancel={onCancel}\n >\n <SelectPanel.Button\n leadingVisual={GitBranchIcon}\n trailingVisual={TriangleDownIcon}\n >\n {savedInitialRef}\n </SelectPanel.Button>\n\n <SelectPanel.Header>\n <SelectPanel.SearchInput onChange={onSearchInputChange} />\n\n <div id=\"filters\" className={classes.FilterButtons}>\n <Button\n variant=\"invisible\"\n style={{\n fontWeight:\n selectedFilter === 'branches'\n ? 'var(--base-text-weight-medium)'\n : 'var(--base-text-weight-normal)',\n color: 'var(--fgColor-default)',\n }}\n onClick={() => setSelectedFilter('branches')}\n count={20}\n >\n Branches\n </Button>\n <Button\n variant=\"invisible\"\n style={{\n fontWeight:\n selectedFilter === 'tags'\n ? 'var(--base-text-weight-medium)'\n : 'var(--base-text-weight-normal)',\n color: 'var(--fgColor-default)',\n }}\n onClick={() => setSelectedFilter('tags')}\n count={8}\n >\n Tags\n </Button>\n </div>\n </SelectPanel.Header>\n\n {itemsToShow.length === 0 ? (\n <SelectPanel.Message\n variant=\"empty\"\n title={`No labels found for \"${query}\"`}\n >\n Try a different search term\n </SelectPanel.Message>\n ) : (\n <ActionList>\n {itemsToShow.map((item) => (\n <ActionList.Item\n key={item.id}\n selected={selectedRef === item.id}\n onSelect={() => setSelectedRef(item.id)}\n >\n {item.name}\n <ActionList.TrailingVisual>\n {item.trailingInfo}\n </ActionList.TrailingVisual>\n </ActionList.Item>\n ))}\n </ActionList>\n )}\n\n <SelectPanel.Footer>\n <SelectPanel.SecondaryAction\n variant=\"link\"\n href={`/${selectedFilter}`}\n >\n View all {selectedFilter}\n </SelectPanel.SecondaryAction>\n </SelectPanel.Footer>\n </SelectPanel>\n </>\n )\n}"
|
|
9934
|
+
"code": "() => {\n const [selectedFilter, setSelectedFilter] = React.useState<\n 'branches' | 'tags'\n >('branches')\n\n /* Selection */\n const [savedInitialRef, setSavedInitialRef] = React.useState(data.ref)\n const [selectedRef, setSelectedRef] = React.useState(savedInitialRef)\n const onSubmit = () => {\n setSavedInitialRef(selectedRef)\n data.ref = selectedRef // pretending to persist changes\n\n // eslint-disable-next-line no-console\n console.log('form submitted')\n }\n const onCancel = () => {\n setSelectedRef(savedInitialRef)\n }\n\n /* Filter */\n const [query, setQuery] = React.useState('')\n const onSearchInputChange: React.ChangeEventHandler<HTMLInputElement> = (\n event,\n ) => {\n const query = event.currentTarget.value\n setQuery(query)\n }\n const [filteredRefs, setFilteredRefs] = React.useState(data.branches)\n const setSearchResults = (\n query: string,\n selectedFilter: 'branches' | 'tags',\n ) => {\n if (query === '') setFilteredRefs(data[selectedFilter])\n else {\n setFilteredRefs(\n data[selectedFilter]\n .map((item) => {\n if (item.name.toLowerCase().startsWith(query))\n return {\n priority: 1,\n item,\n }\n else if (item.name.toLowerCase().includes(query))\n return {\n priority: 2,\n item,\n }\n else\n return {\n priority: -1,\n item,\n }\n })\n .filter((result) => result.priority > 0)\n .map((result) => result.item),\n )\n }\n }\n React.useEffect(\n function updateSearchResults() {\n // eslint-disable-next-line react-hooks/set-state-in-effect, react-you-might-not-need-an-effect/no-derived-state\n setSearchResults(query, selectedFilter)\n },\n [query, selectedFilter],\n )\n const sortingFn = (ref: { id: string }) => {\n if (ref.id === savedInitialRef) return -1\n else return 1\n }\n const itemsToShow = query\n ? filteredRefs\n : data[selectedFilter].sort(sortingFn)\n return (\n <>\n <h1>With Filter Buttons {savedInitialRef}</h1>\n\n <SelectPanel\n title=\"Switch branches/tags\"\n onSubmit={onSubmit}\n onCancel={onCancel}\n >\n <SelectPanel.Button\n leadingVisual={GitBranchIcon}\n trailingVisual={TriangleDownIcon}\n >\n {savedInitialRef}\n </SelectPanel.Button>\n\n <SelectPanel.Header>\n <SelectPanel.SearchInput onChange={onSearchInputChange} />\n\n <div id=\"filters\" className={classes.FilterButtons}>\n <Button\n variant=\"invisible\"\n style={{\n fontWeight:\n selectedFilter === 'branches'\n ? 'var(--base-text-weight-medium)'\n : 'var(--base-text-weight-normal)',\n color: 'var(--fgColor-default)',\n }}\n onClick={() => setSelectedFilter('branches')}\n count={20}\n >\n Branches\n </Button>\n <Button\n variant=\"invisible\"\n style={{\n fontWeight:\n selectedFilter === 'tags'\n ? 'var(--base-text-weight-medium)'\n : 'var(--base-text-weight-normal)',\n color: 'var(--fgColor-default)',\n }}\n onClick={() => setSelectedFilter('tags')}\n count={8}\n >\n Tags\n </Button>\n </div>\n </SelectPanel.Header>\n\n {itemsToShow.length === 0 ? (\n <SelectPanel.Message\n variant=\"empty\"\n title={`No labels found for \"${query}\"`}\n >\n Try a different search term\n </SelectPanel.Message>\n ) : (\n <ActionList>\n {itemsToShow.map((item) => (\n <ActionList.Item\n key={item.id}\n selected={selectedRef === item.id}\n onSelect={() => setSelectedRef(item.id)}\n >\n {item.name}\n <ActionList.TrailingVisual>\n {item.trailingInfo}\n </ActionList.TrailingVisual>\n </ActionList.Item>\n ))}\n </ActionList>\n )}\n\n <SelectPanel.Footer>\n <SelectPanel.SecondaryAction\n variant=\"link\"\n href={`/${selectedFilter}`}\n >\n View all {selectedFilter}\n </SelectPanel.SecondaryAction>\n </SelectPanel.Footer>\n </SelectPanel>\n </>\n )\n}"
|
|
8529
9935
|
}
|
|
8530
9936
|
],
|
|
8531
9937
|
"importPath": "@primer/react/experimental",
|
|
@@ -8744,6 +10150,22 @@
|
|
|
8744
10150
|
{
|
|
8745
10151
|
"id": "experimental-components-underlinepanels-features--with-icons-hidden-on-narrow-screen",
|
|
8746
10152
|
"code": "() => (\n <UnderlinePanels aria-label=\"Tabs with icons\">\n <UnderlinePanels.Tab icon={CodeIcon}>Tab 1</UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={EyeIcon}>Tab 2</UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={GitPullRequestIcon}>Tab 3</UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={CommentDiscussionIcon}>\n Tab 4\n </UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={PlayIcon}>Tab 5</UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={ProjectIcon}>Tab 6</UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={GraphIcon}>Tab 7</UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={GearIcon}>Tab 8</UnderlinePanels.Tab>\n <UnderlinePanels.Tab icon={ShieldLockIcon}>Tab 9</UnderlinePanels.Tab>\n <UnderlinePanels.Panel>Panel 1</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 2</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 3</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 4</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 5</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 6</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 7</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 8</UnderlinePanels.Panel>\n <UnderlinePanels.Panel>Panel 9</UnderlinePanels.Panel>\n </UnderlinePanels>\n)"
|
|
10153
|
+
},
|
|
10154
|
+
{
|
|
10155
|
+
"id": "experimental-components-underlinepanels-features--controlled",
|
|
10156
|
+
"code": "() => {\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <UnderlinePanels\n aria-label=\"Ref type\"\n value={refType}\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n setRefType(value)\n }}\n >\n <UnderlinePanels.Tab value=\"branch\" icon={GitBranchIcon}>\n Branches\n </UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\" icon={TagIcon}>\n Tags\n </UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n <p>\n Selected ref type: <strong>{refType}</strong>\n </p>\n </>\n )\n}"
|
|
10157
|
+
},
|
|
10158
|
+
{
|
|
10159
|
+
"id": "experimental-components-underlinepanels-features--uncontrolled",
|
|
10160
|
+
"code": "() => (\n <>\n <UnderlinePanels\n aria-label=\"Ref type\"\n defaultValue=\"tag\"\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n }}\n >\n <UnderlinePanels.Tab value=\"branch\">Branches</UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\">Tags</UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n </>\n)"
|
|
10161
|
+
},
|
|
10162
|
+
{
|
|
10163
|
+
"id": "experimental-components-underlinepanels-features--manual-activation",
|
|
10164
|
+
"code": "() => {\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <p>\n With <code>activationMode="manual"</code>, arrow keys only\n move focus; press Enter or Space (or click) to commit selection. Prefer\n this when switching tabs triggers async work like a fetch.\n </p>\n <UnderlinePanels\n aria-label=\"Ref type\"\n value={refType}\n activationMode=\"manual\"\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n setRefType(value)\n }}\n >\n <UnderlinePanels.Tab value=\"branch\">Branches</UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\">Tags</UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n </>\n )\n}"
|
|
10165
|
+
},
|
|
10166
|
+
{
|
|
10167
|
+
"id": "experimental-components-underlinepanels-features--in-overlay",
|
|
10168
|
+
"code": "() => {\n const [open, setOpen] = useState(false)\n const [refType, setRefType] = useState('branch')\n return (\n <>\n <AnchoredOverlay\n open={open}\n onOpen={() => setOpen(true)}\n onClose={() => setOpen(false)}\n renderAnchor={(props) => <Button {...props}>Select ref type</Button>}\n overlayProps={{\n role: 'dialog',\n 'aria-modal': true,\n 'aria-label': 'Select a ref type',\n style: {\n width: '320px',\n },\n }}\n focusZoneSettings={{\n disabled: true,\n }}\n >\n <UnderlinePanels\n aria-label=\"Ref type\"\n value={refType}\n onChange={({ value }) => {\n action('onChange')({\n value,\n })\n setRefType(value)\n }}\n >\n <UnderlinePanels.Tab value=\"branch\">Branches</UnderlinePanels.Tab>\n <UnderlinePanels.Tab value=\"tag\">Tags</UnderlinePanels.Tab>\n <UnderlinePanels.Panel value=\"branch\">\n Find or create a branch…\n </UnderlinePanels.Panel>\n <UnderlinePanels.Panel value=\"tag\">\n Search or create a new tag…\n </UnderlinePanels.Panel>\n </UnderlinePanels>\n </AnchoredOverlay>\n </>\n )\n}"
|
|
8747
10169
|
}
|
|
8748
10170
|
],
|
|
8749
10171
|
"importPath": "@primer/react/experimental",
|
|
@@ -8760,6 +10182,30 @@
|
|
|
8760
10182
|
"defaultValue": "",
|
|
8761
10183
|
"description": "ID of the element containing the name for the tab list"
|
|
8762
10184
|
},
|
|
10185
|
+
{
|
|
10186
|
+
"name": "value",
|
|
10187
|
+
"type": "string",
|
|
10188
|
+
"defaultValue": "",
|
|
10189
|
+
"description": "The value of the selected tab, keyed to each `UnderlinePanels.Tab`/`UnderlinePanels.Panel` `value`. Provide this (with `onChange`) for a controlled component where the selected tab is the single source of truth."
|
|
10190
|
+
},
|
|
10191
|
+
{
|
|
10192
|
+
"name": "defaultValue",
|
|
10193
|
+
"type": "string",
|
|
10194
|
+
"defaultValue": "",
|
|
10195
|
+
"description": "The value of the tab selected by default, for an uncontrolled component. Cannot be combined with `value`."
|
|
10196
|
+
},
|
|
10197
|
+
{
|
|
10198
|
+
"name": "onChange",
|
|
10199
|
+
"type": "({value}: {value: string}) => void",
|
|
10200
|
+
"defaultValue": "",
|
|
10201
|
+
"description": "Callback fired whenever the selected tab changes, for every selection method — pointer, Enter/Space, and Arrow/Home/End keys. Unlike `UnderlinePanels.Tab`'s `onSelect` (which only fires on click and Enter/Space), this makes the selected value usable as a single source of truth for data-driven tabs."
|
|
10202
|
+
},
|
|
10203
|
+
{
|
|
10204
|
+
"name": "activationMode",
|
|
10205
|
+
"type": "'automatic' | 'manual'",
|
|
10206
|
+
"defaultValue": "'automatic'",
|
|
10207
|
+
"description": "Controls how tabs are activated with the keyboard. `'automatic'` selects on focus (Arrow/Home/End select immediately); `'manual'` moves focus only and commits selection on Enter, Space, or click. Prefer `'manual'` when displaying a panel is not instant (e.g. it triggers a network request)."
|
|
10208
|
+
},
|
|
8763
10209
|
{
|
|
8764
10210
|
"name": "children",
|
|
8765
10211
|
"type": "Array<UnderlinePanels.Tab | UnderlinePanels.Panel>",
|
|
@@ -8790,6 +10236,12 @@
|
|
|
8790
10236
|
{
|
|
8791
10237
|
"name": "UnderlinePanels.Tab",
|
|
8792
10238
|
"props": [
|
|
10239
|
+
{
|
|
10240
|
+
"name": "value",
|
|
10241
|
+
"type": "string",
|
|
10242
|
+
"defaultValue": "",
|
|
10243
|
+
"description": "A value that uniquely identifies this tab, paired with the `UnderlinePanels.Panel` of the same `value`. Provide this to use domain values (e.g. `'branch'`) with the container's controlled `value`/`onChange` API. When omitted, tabs and panels are paired by DOM order."
|
|
10244
|
+
},
|
|
8793
10245
|
{
|
|
8794
10246
|
"name": "aria-selected",
|
|
8795
10247
|
"type": "| boolean | 'true' | 'false'",
|
|
@@ -8800,7 +10252,7 @@
|
|
|
8800
10252
|
"name": "onSelect",
|
|
8801
10253
|
"type": "(event) => void",
|
|
8802
10254
|
"defaultValue": "",
|
|
8803
|
-
"description": "The handler that gets called when the tab is selected"
|
|
10255
|
+
"description": "The handler that gets called when the tab is selected. Note: this fires only on click and Enter/Space — not on arrow-key navigation. For a callback that fires for every selection method, use the container's `onChange` prop instead."
|
|
8804
10256
|
},
|
|
8805
10257
|
{
|
|
8806
10258
|
"name": "counter",
|
|
@@ -8818,7 +10270,14 @@
|
|
|
8818
10270
|
},
|
|
8819
10271
|
{
|
|
8820
10272
|
"name": "UnderlinePanels.Panel",
|
|
8821
|
-
"props": [
|
|
10273
|
+
"props": [
|
|
10274
|
+
{
|
|
10275
|
+
"name": "value",
|
|
10276
|
+
"type": "string",
|
|
10277
|
+
"defaultValue": "",
|
|
10278
|
+
"description": "A value that uniquely identifies this panel, paired with the `UnderlinePanels.Tab` of the same `value`. When omitted, tabs and panels are paired by DOM order."
|
|
10279
|
+
}
|
|
10280
|
+
],
|
|
8822
10281
|
"passthrough": {
|
|
8823
10282
|
"element": "div",
|
|
8824
10283
|
"url": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div#Attributes"
|