Skip to content

Commit 57c4bdf

Browse files
radglobbroccolinisoupjonrohanmattcosta7joshblack
authored
Deprecate position prop for PageLayout.Pane, update stories and tests. (#3389)
* Deprecate position prop for PageLayout.Pane, update stories and tests. * Create hungry-spies-remember.md * Fix typo in docs. * Revert PRs that are breaking dotcom to get the current release out (#3408) * Revert "Refactor(ActionList): ActionList.Item should render content as a button if parent is not interactive. (#3284)" This reverts commit 08d7d5d. * Revert "Address ToggleSwitch a11y feedback (#3251)" This reverts commit 580f165. * Revert "Revert "Refactor FilteredActionList to address a11y violations and use new ActionList. (#3247)" (#3349)" This reverts commit a6b4169. * Revert "fix: prevent closing menu when `event.preventDefault()` is called on `ActionList.Item`'s `onSelect` handler by @gr2m (#3346)" This reverts commit 6304923. * Revert "Refactor FilteredActionList to address a11y violations and use new ActionList. (#3247)" This reverts commit e865e3e. * Revert "fix(ActionList): update to read from group context if selectionVariant is defined (#3269)" This reverts commit 21ec626. * Revert "Add back check for GroupContext in ActionList.Selection to fix issues introduced to github/github (#3267)" This reverts commit 332a1af. * Revert "Fix create-slots utils path (#3223)" This reverts commit f50997f. * Revert "Allow up to 4 levels of nesting for the NavList (#3343)" This reverts commit 786013e. * Revert "NavList: Fix group dividers (#3328)" This reverts commit 1fd6d32. * Revert "StyledOcticon/Octicon: Update the render func to use `React.forwardRef()` (#3293)" This reverts commit 027d214. * Revert "Rename component StyledOcticon to Octicon (#3148)" This reverts commit ac437bb. * Revert "Update PRC ActionList implementation to have similar semantics to PVC. (#2878)" This reverts commit 87883c3. * Update generated/components.json * Revert "Bump @primer/react-octicons to v19.0.1 (#3266)" This reverts commit 9532977. * Revert "Remove aria-hidden=true from spans with required asterisk (#3320)" This reverts commit 47b7ea0. * Rename component StyledOcticon to Octicon (#3148) * Rename component StyledOcticon to Octicon * Update generated/components.json * Create .changeset/swift-cows-rest.md * Fix snapshot * Add segments to progressbar (#3114) * Allow ProgressBar to either be given child segments or just a progress value. * Update ProgressBar docs. * Fix progress bar tests. * Create dry-weeks-compete.md * Fix errors from CI. * Rename ProgressBar.Segment to ProgressBar.Item. * Pass backgroundColor instead of bg to get away from system props, simplify children check in ProgressBar. * Updated snapshots. * Updated snapshots using --no-cache flag. * refactor(CircleOcticon): Move files to folder, add storybook and e2e tests. (#3119) * Reorganize CircleOcticon files, add story and e2e tests. * Add index file. * Update generated/components.json * refactor(CircleBadge): move files into folder, add e2e tests. (#3118) * Reorganize CircleBadge, add e2e tests. * Update generated/components.json * test(vrt): update snapshots * Update docs reference. --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * Update generated/components.json * test(vrt): update snapshots --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * Refactor(Popover): move files into folder, add storybook and e2e tests. (#3135) * Move files into folder, add storybook and e2e tests. * Update generated/components.json * test(vrt): update snapshots --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * refactor(ButtonGroup): move files to folder. (#3117) * Reorganize ButtonGroup component and stories. * Update generated/components.json * Add e2e tests. * test(vrt): update snapshots * refactor(CircleBadge): move files into folder, add e2e tests. (#3118) * Reorganize CircleBadge, add e2e tests. * Update generated/components.json * test(vrt): update snapshots * Update docs reference. --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * replace createRef with useRef (#3124) * replace createRef with useRef * changeset * missed null * refactor(FilterList): add files to folder, add storybook and e2e tests. (#3122) * Reorganize FilterList files into folder, add storybook and e2e tests. * Update generated/components.json * test(vrt): update snapshots --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * Refactor(FilteredSearch): move files to folder, add storybook and e2e tests. (#3125) * Move files to folder, add storybook and e2e tests. * Add aria-label to TextInput, fix docs reference. * Update generated/components.json * test(vrt): update snapshots * replace createRef with useRef (#3124) * replace createRef with useRef * changeset * missed null * refactor(FilterList): add files to folder, add storybook and e2e tests. (#3122) * Reorganize FilterList files into folder, add storybook and e2e tests. * Update generated/components.json * test(vrt): update snapshots --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * Fix generated components. --------- Co-authored-by: radglob <radglob@users.noreply.github.com> Co-authored-by: Matthew Costabile <mattcosta7@github.com> * Refactor(LabelGroup): add files to folder, add storybook and e2e tests. (#3131) * Move files to folder, add storybook and e2e tests. * Update generated/components.json * test(vrt): update snapshots --------- Co-authored-by: radglob <radglob@users.noreply.github.com> * test(e2e): update ActionMenu e2e test to remove custom contrast rules (#3130) * test(e2e): update ActionMenu e2e test to remove custom contrast rules * test(vrt): update snapshots * test: remove multiple sections test * test(e2e): restore rule exception for ActionMenu --------- Co-authored-by: Josh Black <joshblack@users.noreply.github.com> * NavList SSR: use useIsomorphicLayoutEffect instead of useLayoutEffect (#3127) * use useIsomorphicLayoutEffect * Create .changeset/fast-panthers-refuse.md --------- Co-authored-by: Josh Black <joshblack@github.com> * Bump @primer/primitives to `7.11.5` (#3120) * npm install @primer/primitives@7.11.5 * Updating`theme-preval` snapshots * Re-run ``` npm run build npm run test -- -u ``` So that /themePreval.test.ts.snap also gets the new timestamp * Update `theme-preval` snapshots docs * Create .changeset/old-falcons-learn.md * test(vrt): update snapshots --------- Co-authored-by: simurai <simurai@users.noreply.github.com> * Update RelativeTime stories (#3136) * Update RelativeTime stories * Update generated/components.json --------- Co-authored-by: colebemis <colebemis@users.noreply.github.com> * chore(deps-dev): bump @types/jest-axe from 3.5.3 to 3.5.5 (#3141) Bumps [@types/jest-axe](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest-axe) from 3.5.3 to 3.5.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest-axe) --- updated-dependencies: - dependency-name: "@types/jest-axe" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @rollup/plugin-typescript from 11.0.0 to 11.1.0 (#3138) Bumps [@rollup/plugin-typescript](https://github.com/rollup/plugins/tree/HEAD/packages/typescript) from 11.0.0 to 11.1.0. - [Release notes](https://github.com/rollup/plugins/releases) - [Changelog](https://github.com/rollup/plugins/blob/master/packages/typescript/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/commonjs-v11.1.0/packages/typescript) --- updated-dependencies: - dependency-name: "@rollup/plugin-typescript" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump eslint-plugin-primer-react from 2.0.2 to 2.0.3 (#3140) * chore(deps-dev): bump eslint-plugin-primer-react from 2.0.2 to 2.0.3 Bumps [eslint-plugin-primer-react](https://github.com/primer/eslint-plugin-primer-react) from 2.0.2 to 2.0.3. - [Release notes](https://github.com/primer/eslint-plugin-primer-react/releases) - [Changelog](https://github.com/primer/eslint-plugin-primer-react/blob/main/CHANGELOG.md) - [Commits](primer/eslint-plugin-primer-react@v2.0.2...v2.0.3) --- updated-dependencies: - dependency-name: eslint-plugin-primer-react dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * chore(eslint): remove unnecessary disable --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josh Black <joshblack@users.noreply.github.com> * chore(deps-dev): bump babel-plugin-styled-components from 2.0.2 to 2.1.1 (#3139) * chore(deps-dev): bump babel-plugin-styled-components from 2.0.2 to 2.1.1 Bumps [babel-plugin-styled-components](https://github.com/styled-components/babel-plugin-styled-components) from 2.0.2 to 2.1.1. - [Release notes](https://github.com/styled-components/babel-plugin-styled-components/releases) - [Commits](styled-components/babel-plugin-styled-components@v2.0.2...v2.1.1) --- updated-dependencies: - dependency-name: babel-plugin-styled-components dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * test(snapshots): update snapshots --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josh Black <joshblack@users.noreply.github.com> * chore(project): update project to use Node.js v18 LTS (#3133) * chore(project): update project to use Node.js v18 LTS * chore: add legacy openssl option for docs builds * chore: update devcontainer image --------- Co-authored-by: Josh Black <joshblack@users.noreply.github.com> * Use SSR-compatible slot implementation in CheckboxGroup/RadioGroup (#3146) * Update slots for checkbox group and radio group * Update useSlot return type * Update exports test * Create .changeset/young-queens-notice.md * Update comment indentation * Add segments to progressbar (#3114) * Allow ProgressBar to either be given child segments or just a progress value. * Update ProgressBar docs. * Fix progress bar tests. * Create dry-weeks-compete.md * Fix errors from CI. * Rename ProgressBar.Segment to ProgressBar.Item. * Pass backgroundColor instead of bg to get away from system props, simplify children check in ProgressBar. * Updated snapshots. * Updated snapshots using --no-cache flag. * Update generated/components.json --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: radglob <radglob@users.noreply.github.com> Co-authored-by: Matthew Costabile <mattcosta7@github.com> Co-authored-by: Josh Black <joshblack@github.com> Co-authored-by: Josh Black <joshblack@users.noreply.github.com> Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com> Co-authored-by: simurai <simurai@github.com> Co-authored-by: simurai <simurai@users.noreply.github.com> Co-authored-by: Cole Bemis <colebemis@github.com> Co-authored-by: colebemis <colebemis@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs(project): move code of conduct under .github (#3145) Co-authored-by: Josh Black <joshblack@users.noreply.github.com> * Add npm workspaces structure to primer/react (#3074) * test(axe): default `color-contrast` check to false * chore: update generate script to not conditionally disable contrast checks * Create adr-015-npm-workspaces.md * docs: update adr * Update adr-015-npm-workspaces.md --------- Co-authored-by: Josh Black <joshblack@users.noreply.github.com> * Update generated/components.json * change styled_octicon key * Update generated/components.json * Update generated/components.json * Update generated/components.json * Octicon folder * Fix package-lock * Fix imports * update path * Update generated/components.json --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: jonrohan <jonrohan@users.noreply.github.com> Co-authored-by: Jeremy Neal <radglob@github.com> Co-authored-by: radglob <radglob@users.noreply.github.com> Co-authored-by: Matthew Costabile <mattcosta7@github.com> Co-authored-by: Josh Black <joshblack@github.com> Co-authored-by: Josh Black <joshblack@users.noreply.github.com> Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com> Co-authored-by: simurai <simurai@github.com> Co-authored-by: simurai <simurai@users.noreply.github.com> Co-authored-by: Cole Bemis <colebemis@github.com> Co-authored-by: colebemis <colebemis@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josep Martins <josepmartins@github.com> * Allow up to 4 levels of nesting for the NavList (#3343) * allows up to 4 levels of nesting for the NavList * adds changeset * Update src/NavList/NavList.tsx Co-authored-by: Cole Bemis <colebemis@github.com> * updates snapshots --------- Co-authored-by: Cole Bemis <colebemis@github.com> * fix: prevent closing menu when `event.preventDefault()` is called on `ActionList.Item`'s `onSelect` handler by @gr2m (#3346) * fix: prevent closing menu when `event.preventDefault()` is called on `ActionList.Item`'s `onSelect` handler (#3163) * test: prevent closing menu when `event.preventDefault()` is called on `ActionList.Item`'s `onSelect` handler Failing test for #3162 * fix: prevent closing menu when `event.preventDefault()` is called on `ActionList.Item`ߴs `onSelect` handler * add storybook example: Delayed Menu Close * update docs * docs: changeset * Update changelog --------- Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com> * Update generated/components.json --------- Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com> Co-authored-by: siddharthkp <siddharthkp@users.noreply.github.com> * Revert "PageLayout.Content should not use main landmark by default. (#3154)" This reverts commit fed1c57. * Revert "Update `PageLayout` docs around `<main>` usage (#3323)" This reverts commit e1904b2. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: broccolinisoup <broccolinisoup@users.noreply.github.com> Co-authored-by: Jon Rohan <yes@jonrohan.codes> Co-authored-by: jonrohan <jonrohan@users.noreply.github.com> Co-authored-by: Jeremy Neal <radglob@github.com> Co-authored-by: radglob <radglob@users.noreply.github.com> Co-authored-by: Matthew Costabile <mattcosta7@github.com> Co-authored-by: Josh Black <joshblack@github.com> Co-authored-by: Josh Black <joshblack@users.noreply.github.com> Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com> Co-authored-by: simurai <simurai@github.com> Co-authored-by: simurai <simurai@users.noreply.github.com> Co-authored-by: Cole Bemis <colebemis@github.com> Co-authored-by: colebemis <colebemis@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josep Martins <josepmartins@github.com> Co-authored-by: Mike Perrotti <mperrotti@github.com> Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com> Co-authored-by: siddharthkp <siddharthkp@users.noreply.github.com> * Version Packages (#3218) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Update changeset to mention changed component. * Put changed components comment after changeset write up. * Fix some spacing issues, docs and story changes. * Update snapshots, formatting and linting. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Armağan <broccolinisoup@github.com> Co-authored-by: broccolinisoup <broccolinisoup@users.noreply.github.com> Co-authored-by: Jon Rohan <yes@jonrohan.codes> Co-authored-by: jonrohan <jonrohan@users.noreply.github.com> Co-authored-by: radglob <radglob@users.noreply.github.com> Co-authored-by: Matthew Costabile <mattcosta7@github.com> Co-authored-by: Josh Black <joshblack@github.com> Co-authored-by: Josh Black <joshblack@users.noreply.github.com> Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com> Co-authored-by: simurai <simurai@github.com> Co-authored-by: simurai <simurai@users.noreply.github.com> Co-authored-by: Cole Bemis <colebemis@github.com> Co-authored-by: colebemis <colebemis@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Josep Martins <josepmartins@github.com> Co-authored-by: Mike Perrotti <mperrotti@github.com> Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com> Co-authored-by: siddharthkp <siddharthkp@users.noreply.github.com> Co-authored-by: GitHub Design Systems Bot <30705008+primer-css@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent bec599d commit 57c4bdf

12 files changed

+350
-392
lines changed

.changeset/hungry-spies-remember.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
Deprecates position prop for PageLayout.Pane. Users will receive a console warning when it is used.
6+
7+
<!-- Changed components: PageLayout -->

generated/components.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@
637637
},
638638
{
639639
"name": "size",
640-
"type": "number",
640+
"type": "number | { narrow?: number; regular?: number; wide?: number; }",
641641
"defaultValue": "20",
642642
"description": "The size of the avatar in pixels."
643643
},
@@ -697,6 +697,18 @@
697697
"defaultValue": "false",
698698
"description": "Align the avatars to the right"
699699
},
700+
{
701+
"name": "disableExpand",
702+
"type": "boolean",
703+
"defaultValue": "false",
704+
"description": "Do not spread the avatars on hover"
705+
},
706+
{
707+
"name": "size",
708+
"type": "number | { narrow?: number; regular?: number; wide?: number; }",
709+
"defaultValue": "20",
710+
"description": "The size of the avatar children in pixels."
711+
},
700712
{
701713
"name": "sx",
702714
"type": "SystemStyleObject"
@@ -1724,7 +1736,7 @@
17241736
"stories": [
17251737
{
17261738
"id": "components-filteredsearch--default",
1727-
"code": "() => (\n <FilteredSearch>\n <ActionMenu>\n <ActionMenu.Button as=\"summary\">Filter</ActionMenu.Button>\n <ActionMenu.Overlay>\n <ActionList>\n <ActionList.Item>Item 1</ActionList.Item>\n <ActionList.Item>Item 2</ActionList.Item>\n <ActionList.Item>Item 3</ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n <TextInput aria-label=\"filtered-search\" leadingVisual={SearchIcon} />\n </FilteredSearch>\n)"
1739+
"code": "() => (\n <FilteredSearch>\n <ActionMenu>\n <ActionMenu.Button as=\"summary\">Filter</ActionMenu.Button>\n <ActionMenu.Overlay>\n <ActionList>\n <ActionList.Item>Item 1</ActionList.Item>\n <ActionList.Item>Item 2</ActionList.Item>\n <ActionList.Item>Item 3</ActionList.Item>\n </ActionList>\n </ActionMenu.Overlay>\n </ActionMenu>\n <TextInput aria-label=\"Filtered search\" leadingVisual={SearchIcon} />\n </FilteredSearch>\n)"
17281740
}
17291741
],
17301742
"props": [
@@ -2797,7 +2809,8 @@
27972809
"name": "position",
27982810
"type": "| 'start' | 'end' | { narrow?: | 'start' | 'end' regular?: | 'start' | 'end' wide?: | 'start' | 'end' }",
27992811
"defaultValue": "'end'",
2800-
"description": ""
2812+
"description": "",
2813+
"deprecated": true
28012814
},
28022815
{
28032816
"name": "positionWhenNarrow",
@@ -4370,7 +4383,7 @@
43704383
"name": "resize",
43714384
"type": "'both' | 'horizontal' | 'vertical' | 'none'",
43724385
"defaultValue": "'both'",
4373-
"description": "Changes background color to a higher contrast color"
4386+
"description": "Changes the resize behavior"
43744387
},
43754388
{
43764389
"name": "validationStatus",
@@ -4382,10 +4395,6 @@
43824395
"name": "ref",
43834396
"type": "React.RefObject<HTMLTextAreaElement>"
43844397
},
4385-
{
4386-
"name": "ref",
4387-
"type": "React.RefObject<HTMLTextareaElement>"
4388-
},
43894398
{
43904399
"name": "as",
43914400
"type": "React.ElementType",
@@ -4708,7 +4717,7 @@
47084717
"stories": [
47094718
{
47104719
"id": "components-treeview--default",
4711-
"code": "() => (\n <nav aria-label=\"Files changed\">\n <TreeView aria-label=\"Files changed\">\n <TreeView.Item id=\"src\" defaultExpanded>\n <TreeView.LeadingVisual>\n <TreeView.DirectoryIcon />\n </TreeView.LeadingVisual>\n src\n <TreeView.SubTree>\n <TreeView.Item id=\"src/Avatar.tsx\">\n <TreeView.LeadingVisual>\n <FileIcon />\n </TreeView.LeadingVisual>\n Avatar.tsx\n <TreeView.TrailingVisual>\n <Octicon\n icon={DiffAddedIcon}\n color=\"success.fg\"\n aria-label=\"added\"\n />\n </TreeView.TrailingVisual>\n </TreeView.Item>\n <TreeView.Item id=\"src/Button.tsx\" current>\n <TreeView.LeadingVisual>\n <FileIcon />\n </TreeView.LeadingVisual>\n Button.tsx\n <TreeView.TrailingVisual>\n <Octicon\n icon={DiffModifiedIcon}\n color=\"attention.fg\"\n aria-label=\"modified\"\n />\n </TreeView.TrailingVisual>\n </TreeView.Item>\n </TreeView.SubTree>\n </TreeView.Item>\n <TreeView.Item id=\"package.json\">\n <TreeView.LeadingVisual>\n <FileIcon />\n </TreeView.LeadingVisual>\n package.json\n <TreeView.TrailingVisual>\n <Octicon\n icon={DiffModifiedIcon}\n color=\"attention.fg\"\n aria-label=\"modified\"\n />\n </TreeView.TrailingVisual>\n </TreeView.Item>\n </TreeView>\n </nav>\n)"
4720+
"code": "() => (\n <nav aria-label=\"Files changed\">\n <TreeView aria-label=\"Files changed\">\n <TreeView.Item id=\"src\" defaultExpanded>\n <TreeView.LeadingVisual>\n <TreeView.DirectoryIcon />\n </TreeView.LeadingVisual>\n src\n <TreeView.SubTree>\n <TreeView.Item id=\"src/Avatar.tsx\">\n <TreeView.LeadingVisual>\n <FileIcon />\n </TreeView.LeadingVisual>\n Avatar.tsx\n <TreeView.TrailingVisual>\n <Octicon\n icon={DiffAddedIcon}\n color=\"success.fg\"\n aria-label=\"Added\"\n />\n </TreeView.TrailingVisual>\n </TreeView.Item>\n <TreeView.Item id=\"src/Button.tsx\" current>\n <TreeView.LeadingVisual>\n <FileIcon />\n </TreeView.LeadingVisual>\n Button.tsx\n <TreeView.TrailingVisual>\n <Octicon\n icon={DiffModifiedIcon}\n color=\"attention.fg\"\n aria-label=\"Modified\"\n />\n </TreeView.TrailingVisual>\n </TreeView.Item>\n </TreeView.SubTree>\n </TreeView.Item>\n <TreeView.Item id=\"package.json\">\n <TreeView.LeadingVisual>\n <FileIcon />\n </TreeView.LeadingVisual>\n package.json\n <TreeView.TrailingVisual>\n <Octicon\n icon={DiffModifiedIcon}\n color=\"attention.fg\"\n aria-label=\"Modified\"\n />\n </TreeView.TrailingVisual>\n </TreeView.Item>\n </TreeView>\n </nav>\n)"
47124721
},
47134722
{
47144723
"id": "components-treeview-features--files",

src/PageLayout/PageLayout.docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@
137137
"name": "position",
138138
"type": "| 'start' | 'end' | { narrow?: | 'start' | 'end' regular?: | 'start' | 'end' wide?: | 'start' | 'end' }",
139139
"defaultValue": "'end'",
140-
"description": ""
140+
"description": "",
141+
"deprecated": true
141142
},
142143
{
143144
"name": "positionWhenNarrow",

src/PageLayout/PageLayout.features.stories.tsx

Lines changed: 41 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -83,49 +83,42 @@ export const StickyPane: Story = args => (
8383
<PageLayout.Header padding="normal" divider="line">
8484
<Placeholder label="Header" height={64} />
8585
</PageLayout.Header>
86-
<PageLayout.Content padding="normal" width="large">
86+
<PageLayout.Pane resizable padding="normal" divider="line" sticky={args.sticky} aria-label="Side pane">
8787
<Box sx={{display: 'grid', gap: 3}}>
88-
{Array.from({length: args.numParagraphsInContent}).map((_, i) => {
89-
const testId = `content${i}`
88+
{Array.from({length: args.numParagraphsInPane}).map((_, i) => {
89+
const testId = `paragraph${i}`
9090
return (
9191
<Box key={i} as="p" sx={{margin: 0}}>
9292
<span data-testid={testId}>
9393
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim id lorem tempus egestas a non
9494
ipsum. Maecenas imperdiet ante quam, at varius lorem molestie vel. Sed at eros consequat, varius tellus
9595
et, auctor felis. Donec pulvinar lacinia urna nec commodo. Phasellus at imperdiet risus. Donec sit amet
96-
massa purus. Nunc sem lectus, bibendum a sapien nec, tristique tempus felis. Ut porttitor auctor tellus
97-
in imperdiet. Ut blandit tincidunt augue, quis fringilla nunc tincidunt sed. Vestibulum auctor euismod
98-
nisi. Nullam tincidunt est in mi tincidunt dictum. Sed consectetur aliquet velit ut ornare.
96+
massa purus.
9997
</span>
10098
</Box>
10199
)
102100
})}
103101
</Box>
104-
</PageLayout.Content>
105-
<PageLayout.Pane
106-
position="start"
107-
resizable
108-
padding="normal"
109-
divider="line"
110-
sticky={args.sticky}
111-
aria-label="Side pane"
112-
>
102+
</PageLayout.Pane>
103+
<PageLayout.Content padding="normal" width="large">
113104
<Box sx={{display: 'grid', gap: 3}}>
114-
{Array.from({length: args.numParagraphsInPane}).map((_, i) => {
115-
const testId = `paragraph${i}`
105+
{Array.from({length: args.numParagraphsInContent}).map((_, i) => {
106+
const testId = `content${i}`
116107
return (
117108
<Box key={i} as="p" sx={{margin: 0}}>
118109
<span data-testid={testId}>
119110
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim id lorem tempus egestas a non
120111
ipsum. Maecenas imperdiet ante quam, at varius lorem molestie vel. Sed at eros consequat, varius tellus
121112
et, auctor felis. Donec pulvinar lacinia urna nec commodo. Phasellus at imperdiet risus. Donec sit amet
122-
massa purus.
113+
massa purus. Nunc sem lectus, bibendum a sapien nec, tristique tempus felis. Ut porttitor auctor tellus
114+
in imperdiet. Ut blandit tincidunt augue, quis fringilla nunc tincidunt sed. Vestibulum auctor euismod
115+
nisi. Nullam tincidunt est in mi tincidunt dictum. Sed consectetur aliquet velit ut ornare.
123116
</span>
124117
</Box>
125118
)
126119
})}
127120
</Box>
128-
</PageLayout.Pane>
121+
</PageLayout.Content>
129122
<PageLayout.Footer padding="normal" divider="line">
130123
<Placeholder label="Footer" height={64} />
131124
</PageLayout.Footer>
@@ -158,32 +151,32 @@ export const NestedScrollContainer: Story = args => (
158151
<PageLayout.Header padding="normal" divider="line">
159152
<Placeholder label="Header" height={64} />
160153
</PageLayout.Header>
161-
<PageLayout.Content padding="normal" width="large">
154+
<PageLayout.Pane padding="normal" divider="line" sticky aria-label="Side pane">
162155
<Box sx={{display: 'grid', gap: 3}}>
163-
{Array.from({length: args.numParagraphsInContent}).map((_, i) => (
156+
{Array.from({length: args.numParagraphsInPane}).map((_, i) => (
164157
<Box key={i} as="p" sx={{margin: 0}}>
165158
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim id lorem tempus egestas a non
166159
ipsum. Maecenas imperdiet ante quam, at varius lorem molestie vel. Sed at eros consequat, varius tellus
167160
et, auctor felis. Donec pulvinar lacinia urna nec commodo. Phasellus at imperdiet risus. Donec sit amet
168-
massa purus. Nunc sem lectus, bibendum a sapien nec, tristique tempus felis. Ut porttitor auctor tellus
169-
in imperdiet. Ut blandit tincidunt augue, quis fringilla nunc tincidunt sed. Vestibulum auctor euismod
170-
nisi. Nullam tincidunt est in mi tincidunt dictum. Sed consectetur aliquet velit ut ornare.
161+
massa purus.
171162
</Box>
172163
))}
173164
</Box>
174-
</PageLayout.Content>
175-
<PageLayout.Pane position="start" padding="normal" divider="line" sticky aria-label="Side pane">
165+
</PageLayout.Pane>
166+
<PageLayout.Content padding="normal" width="large">
176167
<Box sx={{display: 'grid', gap: 3}}>
177-
{Array.from({length: args.numParagraphsInPane}).map((_, i) => (
168+
{Array.from({length: args.numParagraphsInContent}).map((_, i) => (
178169
<Box key={i} as="p" sx={{margin: 0}}>
179170
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim id lorem tempus egestas a non
180171
ipsum. Maecenas imperdiet ante quam, at varius lorem molestie vel. Sed at eros consequat, varius tellus
181172
et, auctor felis. Donec pulvinar lacinia urna nec commodo. Phasellus at imperdiet risus. Donec sit amet
182-
massa purus.
173+
massa purus. Nunc sem lectus, bibendum a sapien nec, tristique tempus felis. Ut porttitor auctor tellus
174+
in imperdiet. Ut blandit tincidunt augue, quis fringilla nunc tincidunt sed. Vestibulum auctor euismod
175+
nisi. Nullam tincidunt est in mi tincidunt dictum. Sed consectetur aliquet velit ut ornare.
183176
</Box>
184177
))}
185178
</Box>
186-
</PageLayout.Pane>
179+
</PageLayout.Content>
187180
<PageLayout.Footer padding="normal" divider="line">
188181
<Placeholder label="Footer" height={64} />
189182
</PageLayout.Footer>
@@ -228,6 +221,23 @@ export const CustomStickyHeader: Story = args => (
228221
Custom sticky header
229222
</Box>
230223
<PageLayout rowGap="none" columnGap="none" padding="none" containerWidth="full">
224+
<PageLayout.Pane padding="normal" divider="line" aria-label="Aside pane" sticky offsetHeader={args.offsetHeader}>
225+
<Box sx={{display: 'grid', gap: 3}}>
226+
{Array.from({length: args.numParagraphsInPane}).map((_, i) => {
227+
const testId = `paragraph${i}`
228+
return (
229+
<Box key={i} as="p" sx={{margin: 0}}>
230+
<span data-testid={testId}>
231+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim id lorem tempus egestas a non
232+
ipsum. Maecenas imperdiet ante quam, at varius lorem molestie vel. Sed at eros consequat, varius
233+
tellus et, auctor felis. Donec pulvinar lacinia urna nec commodo. Phasellus at imperdiet risus. Donec
234+
sit amet massa purus.
235+
</span>
236+
</Box>
237+
)
238+
})}
239+
</Box>
240+
</PageLayout.Pane>
231241
<PageLayout.Content padding="normal" width="large">
232242
<Box sx={{display: 'grid', gap: 3}} data-testid="scrollContainer">
233243
{Array.from({length: args.numParagraphsInContent}).map((_, i) => {
@@ -248,30 +258,6 @@ export const CustomStickyHeader: Story = args => (
248258
})}
249259
</Box>
250260
</PageLayout.Content>
251-
<PageLayout.Pane
252-
position="start"
253-
padding="normal"
254-
divider="line"
255-
aria-label="Aside pane"
256-
sticky
257-
offsetHeader={args.offsetHeader}
258-
>
259-
<Box sx={{display: 'grid', gap: 3}}>
260-
{Array.from({length: args.numParagraphsInPane}).map((_, i) => {
261-
const testId = `paragraph${i}`
262-
return (
263-
<Box key={i} as="p" sx={{margin: 0}}>
264-
<span data-testid={testId}>
265-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at enim id lorem tempus egestas a non
266-
ipsum. Maecenas imperdiet ante quam, at varius lorem molestie vel. Sed at eros consequat, varius
267-
tellus et, auctor felis. Donec pulvinar lacinia urna nec commodo. Phasellus at imperdiet risus. Donec
268-
sit amet massa purus.
269-
</span>
270-
</Box>
271-
)
272-
})}
273-
</Box>
274-
</PageLayout.Pane>
275261
<PageLayout.Footer padding="normal" divider="line">
276262
<Placeholder label="Footer" height={64} />
277263
</PageLayout.Footer>
@@ -306,7 +292,7 @@ export const ResizablePane: Story = () => (
306292
<PageLayout.Header>
307293
<Placeholder height={64} label="Header" />
308294
</PageLayout.Header>
309-
<PageLayout.Pane resizable position="start">
295+
<PageLayout.Pane resizable>
310296
<Placeholder height={320} label="Pane" />
311297
</PageLayout.Pane>
312298
<PageLayout.Content>
@@ -323,7 +309,7 @@ export const ScrollContainerWithinPageLayoutPane: Story = () => (
323309
<Box sx={{overflow: 'auto'}}>
324310
<Placeholder label="Above inner scroll container" height={120} />
325311
<PageLayout rowGap="none" columnGap="none" padding="none" containerWidth="full">
326-
<PageLayout.Pane position="start" padding="normal" divider="line" sticky aria-label="Sticky pane">
312+
<PageLayout.Pane padding="normal" divider="line" sticky aria-label="Sticky pane">
327313
<Box sx={{overflow: 'auto'}}>
328314
<PageLayout.Pane padding="normal">
329315
<Placeholder label="Inner scroll container" height={800} />

src/PageLayout/PageLayout.stories.tsx

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ const meta: Meta = {
3434
'Content.hidden.regular': false,
3535
'Content.hidden.narrow': false,
3636
'Content.hidden.wide': false,
37-
'Pane.position.regular': 'end',
38-
'Pane.position.narrow': 'end',
39-
'Pane.position.wide': 'end',
4037
'Pane.width': 'medium',
4138
'Pane.sticky': false,
4239
'Pane.resizable': false,
@@ -205,31 +202,6 @@ const meta: Meta = {
205202
table: {category: 'Content props'},
206203
},
207204

208-
// Pane prop controls
209-
'Pane.position.regular': {
210-
type: {
211-
name: 'enum',
212-
value: ['start', 'end'],
213-
},
214-
control: {type: 'radio'},
215-
table: {category: 'Pane props'},
216-
},
217-
'Pane.position.narrow': {
218-
type: {
219-
name: 'enum',
220-
value: ['start', 'end'],
221-
},
222-
control: {type: 'radio'},
223-
table: {category: 'Pane props'},
224-
},
225-
'Pane.position.wide': {
226-
type: {
227-
name: 'enum',
228-
value: ['start', 'end'],
229-
},
230-
control: {type: 'radio'},
231-
table: {category: 'Pane props'},
232-
},
233205
'Pane.width': {
234206
type: {
235207
name: 'enum',
@@ -382,11 +354,6 @@ const Template: Story = args => (
382354
</PageLayout.Content>
383355
{args['Render pane?'] ? (
384356
<PageLayout.Pane
385-
position={{
386-
narrow: args['Pane.position.narrow'],
387-
regular: args['Pane.position.regular'],
388-
wide: args['Pane.position.wide'],
389-
}}
390357
width={args['Pane.width']}
391358
minWidth={args['Pane.minWidth']}
392359
sticky={args['Pane.sticky']}

src/PageLayout/PageLayout.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ describe('PageLayout', () => {
5353
<PageLayout.Header divider="line" dividerWhenNarrow="filled">
5454
Header
5555
</PageLayout.Header>
56-
<PageLayout.Content>Content</PageLayout.Content>
57-
<PageLayout.Pane position="start" divider="line" dividerWhenNarrow="filled">
56+
<PageLayout.Pane divider="line" dividerWhenNarrow="filled">
5857
Pane
5958
</PageLayout.Pane>
59+
<PageLayout.Content>Content</PageLayout.Content>
6060
<PageLayout.Footer dividerWhenNarrow="line">Footer</PageLayout.Footer>
6161
</PageLayout>
6262
</ThemeProvider>,

0 commit comments

Comments
 (0)