Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SplitPageLayout API #2144

Merged
merged 7 commits into from
Jun 30, 2022
Merged

SplitPageLayout API #2144

merged 7 commits into from
Jun 30, 2022

Conversation

colebemis
Copy link
Contributor

@colebemis colebemis commented Jun 23, 2022

Summary

This PR includes documentation for the proposed API of the SplitPageLayout component. I'm looking for feedback on the API before I begin implementation.

Here's a preview of the SplitPageLayout documentation: https://primer-48c11ddef3-13348165.drafts.github.io/SplitPageLayout

Here's a diagram of the proposed API:
image
(FigJam file)

Note about responsive props

SplitPageLayout adopts the responsive prop API that @vdepizzol proposed in this ADR.

Any prop marked "responsive" will optionally accept an object mapping viewport ranges to prop values. Example:

// Use "line" divider for all viewport ranges
<SplitPageLayout.Header divider="line">

// Use "line" divider on regular viewports and "filled" for narrow viewports
<SplitPageLayout.Header dividier={{regular: 'line', narrow: 'filled'}}>

Part of https://github.com/github/primer/issues/793

@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2022

⚠️ No Changeset found

Latest commit: 6e60bdf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jun 23, 2022

size-limit report 📦

Path Size
dist/browser.esm.js 67.6 KB (0%)
dist/browser.umd.js 67.97 KB (0%)

@colebemis colebemis temporarily deployed to github-pages June 23, 2022 23:58 Inactive
@colebemis colebemis marked this pull request as ready for review June 24, 2022 00:15
@colebemis colebemis requested review from a team and mperrotti June 24, 2022 00:15
@colebemis colebemis added skip changeset This change does not need a changelog react labels Jun 24, 2022
@colebemis colebemis temporarily deployed to github-pages June 24, 2022 00:27 Inactive
Co-authored-by: Vinicius Depizzol <vdepizzol@gmail.com>
@colebemis colebemis temporarily deployed to github-pages June 24, 2022 01:12 Inactive
<SplitPageLayout.Content>
<Placeholder label="Content" height={240} />
</SplitPageLayout.Content>
</SplitPageLayout>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay! makes so much sense

<SplitPageLayout.Header>
<Placeholder label="Header" height={64} />
</SplitPageLayout.Header>
<SplitPageLayout.Pane visible={{narrow: false}}>
Copy link
Member

@siddharthkp siddharthkp Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I generally prefer optional boolean attributes to be true instead of false, especially when the default is visible=true: <SplitPageLayout.Pane hidden={{narrow: true}}>

"visible: no, not visible" vs "hidden: yes, hidden"

bonus points for matching/extending the HTML attribute hidden https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like hidden 👍 (especially because it aligns with an existing HTML attribute). @vdepizzol @jonrohan how do you feel about using hidden instead of visible?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was push back because it matched html spec. In the PVC case hidden: true would end up being attributes on the html tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we don't want the attribute to end up on the HTML tag? Seems like it would be semantically correct:

The hidden global attribute is a Boolean attribute indicating that the element is not yet, or is no longer, relevant.The hidden global attribute is a Boolean attribute indicating that the element is not yet, or is no longer, relevant.

Copy link
Contributor

@vdepizzol vdepizzol Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also prefer hidden, but like @jonrohan mentioned, there's a big confusion in the way PVC is designed, since it handles element attributes and component properties the same way.

Through system_arguments, a boolean hidden HTML attribute can be passed to any PVC already. Since the visibility prop also needs to accept responsive values (narrow/regular/wide), and doesn't manipulate the hidden attribute directly, we tried to find an alternative.

If you folks think this is not a problem, I'm happy to use hidden instead. I'd just like to make sure the API is the same across PRC and PVC.

@jonrohan what do you think about dropping support for system_arguments in PageLayout and SplitPageLayout? We definitely don't want any of those utilities applied, and I can't think of any custom HTML attribute being useful there (maybe data-*?)

c/c @joelhawksley

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general I'd like system_argument support to be turned off by default, I think moving that way for any new components is the way to go

@jonrohan yes please <3

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vdepizzol I'm not familiar with the hidden property as I've only ever used/recommended display: none. I'm cc'ing @primer/accessibility-reviewers on this one.

Copy link
Contributor

@owenniblock owenniblock Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm fully grokking what you're asking here so apologies in advance if I don't answer your question correctly 😅

To hide an element visually but still allow the screen reader to access it, we style it so that it appears off the page (e.g. <h1 class="sr-only">A heading which a screen reader will read</h1> will achieve this).

However, if you try to apply this on any content which contains focusable elements (buttons, and other form elements) this causes confusion for sighted users who navigate via keyboard since the elements will gain keyboard focus but the user won't be able to see the element that's focused.

In the case of panels that could contain focusable elements, you'd have to hide this from all users to avoid confusion since it's most likely that there will be focusable elements within the panel. I would advise using display: none on a css class for this since that seems to be the pattern we use and recommend elsewhere.

As a slight aside, I would also recommend when you're building a prototype for this component that it's tested early with a high zoom to ensure that developers who use high zoom don't find panels removed unnecessarily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank y'all for weighing in. Based on everyone's input so far, I'm going to move forward with the hidden prop for this API draft. It seems like we agree that calling the prop hidden is better than visible from a component API perspective, but we still need to figure out the implementation details. We can discuss those details in future PRs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chiming in a bit late here, but I'd like to consider using something besides hidden. I think we need to be careful of overloading terms in our glossary, and hidden is also an HTML attribute.

While I do generally agree that having system arguments coexist with HTML attributes, in this case I think it's actually a good thing! IMO we should be leaving room for HTML to supercede our component systems as it it ultimately the underlying technology we're building on.

<SplitPageLayout.Header>
<Placeholder label="Header" height={64} />
</SplitPageLayout.Header>
<SplitPageLayout.Pane visible={{narrow: false}}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for "hidden". For hidden FormControl labels, we use a prop named visuallyHidden.

docs/content/SplitPageLayout.mdx Show resolved Hide resolved
// This prop accepts a viewport range map (i.e. {regular: ..., narrow: ...}) in addition to a single value.
// The `regular` and `wide` keys of the viewport range map can be 'none' or 'line'.
// The `narrow` key of the viewport range map can be 'none' or 'line' or 'filled'.
type={`ResponsiveValue<
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResponsiveValue<> is a little cryptic. Should we explicitly write out the object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. ResponsiveValue<> doesn't explain much. The full type signature looks like this:

'none' | 'line' | { narrow?: 'none' | 'line' | 'filled'; regular?: 'none' | 'line'; wide?: 'none' | 'line' }

Do you think it'd be overwhelming to show the whole thing?

My original plan was to add a separate documentation page about responsive props that explains what ResponsiveValue<> means and link to it from here.


<PropsTable>
<PropsTableRow
name="width"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be called "maxWidth" if it's the maximum width of the content area?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me. We'd need to update this in PageLayout as well. @vdepizzol @jonrohan How you feel about width -> maxWidth?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should remain as width. As a prop, it's a characteristic of the region, not a reference to the CSS attribute. Responsive components are expected to adjust on smaller viewport sizes anyway.

@colebemis colebemis temporarily deployed to github-pages June 30, 2022 17:39 Inactive
@colebemis
Copy link
Contributor Author

I'm going to go ahead and merge this draft to keep SplitPageLayout moving forward. Feel free to leave any additional feedback about the SplitPageLayout or PageLayout API in the #primer-react channel in Slack.

@colebemis colebemis merged commit 9299d23 into main Jun 30, 2022
@colebemis colebemis deleted the splitpagelayout-api branch June 30, 2022 17:48
PrinceSumberia pushed a commit to PrinceSumberia/react that referenced this pull request Aug 1, 2022
* Draft SplitPageLayout API docs

* Update docs/content/SplitPageLayout.mdx

Co-authored-by: Vinicius Depizzol <vdepizzol@gmail.com>

* Update docs/content/SplitPageLayout.mdx

* visible -> hidden prop

Co-authored-by: Vinicius Depizzol <vdepizzol@gmail.com>
siddharthkp added a commit that referenced this pull request Aug 3, 2022
* Fix typos

* Namespace UnderlineNav (#2053)

* namespace underline classes?

* snippity snaps

* Create quick-toys-fly.md

* Version Packages (#2034)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Select component a11y fixes (#2038)

* fixes disabled option colors for all browsers (Firefox had the most issues)

* fixes custom arrow color for disabled state and Windows high contrast mode, and hacks around Firefox quirks

* updates SelectInput stories to use FormControl

* makes cursor behavior consistent for inputs

* removes redundant ARIA attributes from <select>

* updates tests and snapshots

* adds changeset

* fixes media query for forced colors (high contrast mode)

* hacks around Firefox Windows high-contrast mode quirk

* addresses a11y feedback

* fixes linting

* Finish updating global focus styles (#2050)

* updates focus styles that do not match the Primer CSS implementation

* updates ThemeSwitcher to render ActionMenu instead of DropdownMenu

* explicitly sets outline-offset in global focus styles instead of adding a new style that 'beats' the default 2px

* update snapshots

* fixes cross-browser issues for global focus styles

* fixes unintentional laggy focus style update on SubNav

* updates focus styles for UnderlineNav

* DRY button focus styles

* updates snapshots

* adds changeset

* fixes type error

* revert themePreval snapshot update

* Tooltip: anchoredPosition + IconButton (#2006)

* Add breaking story

* Add memex story

* use behaviors deploy preview

* add tooltip triangle

* update snapshot

* add label tooltips for story

* update @primer/behaviors to latest

* lint: remove unused import

* Refactor Tooltip

* Use Tooltip in IconButton

* Add triangle styles for all directions

* Add docs

* Added delay

* change ReactElement to ReactNode

* keep ReactElement

* Add tests!

* compatible types :)

* Fix docs

* update snapshots

* update behaviors to next minor

* update snapshots

* Fix IconButton duplicate label

* missed a spot!

* Fix Button story with tooltip

* Apply suggestions from code review

Co-authored-by: Cole Bemis <colebemis@github.com>

* fix alignment with span

Co-authored-by: Cole Bemis <colebemis@github.com>

* Implement NavList component (part 1) (#2058)

* Create NavList component

* Implement NavList subcomponents

* Reset font weight of trailing visual

* Export NavList from drafts

* Update NavList docs

* Update NavList.mdx

* Add children to props type

* Add NavList tests

* Create breezy-cooks-destroy.md

* Pass props to underlying nav element

* Show divider between groups

* Update snapshot

* ThemeProvider: Fix theme sync with system settings (#2048)

* disable theme decorator for themeprovider story

* remove incorrect effect

* Create wicked-boats-allow.md

Co-authored-by: Mike Perrotti <mperrotti@github.com>

* Move theme decorator into helper util (#2044)

* Move theme decorator into helper util

* fix height

* is addons import the problem?

* does this work better for consumer-tests?

* yep, deep import doesn't work either

* add option to disable theme decorator on a story level

Co-authored-by: Mike Perrotti <mperrotti@github.com>

* Add missing changelog for #2006! (#2069)

* Create improved-tooltip.md

* Create iconbutton-default-tooltip.md

* typo lol

* Implement NavList.SubNav (#2064)

* wip subnav

* Add active prop to ActionList.Item

* Handle nested current item

* Add simple storybook story

* Update snapshot

* Stub tests

* Use NavList in PageLayout story

* Add test case todo

* Fix sx typescript error

* Add NavList.Item test

* Add subnav tests

* Add support for as="button" to ActionList.Item

* Add nested subnav test

* Update docs

* Use spacing primitive

* Reset marginY for safari

* Document active prop

* Create strong-nails-sip.md

* Update snapshots

* Update issue templates for this repo to include redirects to pattern … (#2063)

* Update issue templates for this repo to include redirects to pattern proposal and request issues

* Delete component proposal issue template

* Update pattern discussion URL

* Fix ButtonGroup component and add docs (#2054)

* Make ButtonGroup display inline-flex

* Create documentation page for ButtonGroup

* Update Button docs

* Create six-mirrors-call.md

* Update tests

* Update stories

* Update six-mirrors-call.md

* ActionMenu: adjust width based on padding (#2080)

* adjust width based on padding

* update snapshost

* Form component design tweaks (#2057)

* adds color-scheme style so inputs pick up UA color scheme styles

* crops toggle switch knob's shadow inside the toggle switch boundaries

* does not stretch FormControl input child to fill parent width unless 'block' prop is passed, and passes missing TextInputWrapper props in the Select component

* adds changeset

* rm duplicate prop

* NavList: Add `sx` prop (#2077)

* Add support for `sx` prop to NavList components

* Default sx to empty object

* Create happy-brooms-swim.md

* Update snapshot

* Fix broken inline component links (#2082)

* updates Link href paths that link to React components

* adds changeset

* Fix ActionMenu with IconButton (#2084)

* Fix IconButton for ActionMenu

* Add test case

* NavList.Item: Add `as` prop (#2076)

* Add as prop to NavList.Item

* Add test case for react router link with subnav

* Use DOM APIs to determine if subnav contains current item

* Update snapshots

* Remove "not implemented" warnings

* Create dry-feet-attack.md

* Fix merge issues

* Update snapshot

* Fixes `onRemove` console error coming from token components (#2087)

* prevents onRemove prop from being passed from token components though to the HTML element

* adds changeset

* Fix overflow issues in PageLayout.Content (#2075)

* Fix overflow issues in PageLayout.Content

* Update PageLayout story

* Prettier

* Create gentle-countries-rest.md

* Fix merge errors

* Update src/PageLayout/PageLayout.tsx

* Update snapshot

Co-authored-by: Dusty Greif <dustin.greif@gmail.com>

* Uncomment guard (#2091)

* Revert accessible Tooltip + IconButton (#2092)

* Revert "Fix ActionMenu with IconButton (#2084)"

This reverts commit 3204599.

* Revert 2069 + 2006 + 2084

* Version Packages (#2056)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Bump doctocat version (#2096)

* Fix Dialog example (#2083)

* import Dialog v2 instead of old Dialog

* Revert "import Dialog v1 instead of old Dialog"

This reverts commit 8ac1080.

* move the new Dialog to drafts

* undeprecate the legacy dialog

* Update docs/content/drafts/Dialog.mdx

Co-authored-by: Cole Bemis <colebemis@github.com>

* update navigation menu

* Create funny-hats-sing.md

Co-authored-by: Cole Bemis <colebemis@github.com>

* Set aria-multiselectable in SelectPanel (#2095)

* Reduce storybook build time in CI to < 2 mins (#2093)

* debug-ci-gatsby-build-speed

* add storybook as well

* remove storybook-addon-html

* test: use storybook-addon-html, but disable babel-plugin-open-source

* test: remove Pagination component

* make room for storybook

* try storybook-addon-turbo-build

* bring back Pagination

* test: optimizationLevel: 2

* debug: give more info during build!

* rollback debuging changes

* move addon-html back to production only

Co-authored-by: Cole Bemis <colebemis@github.com>

* Adds draft SegmentedControl docs (#2081)

* adds a draft for the SegmentedControl component docs

* addresses first round of PR feedback

* changes 'block' prop name to 'fullWidth

* Update docs/content/SegmentedControl.mdx

Co-authored-by: Cole Bemis <colebemis@github.com>

* Update docs/content/SegmentedControl.mdx

Co-authored-by: Cole Bemis <colebemis@github.com>

* Update docs/content/SegmentedControl.mdx

Co-authored-by: Cole Bemis <colebemis@github.com>

* addresses remainder of PR feedback

Co-authored-by: Cole Bemis <colebemis@github.com>

* Tests: Add tests for lockfile version (#2106)

* Add tests for lockfile version

* add resolveJsonModule for typecheck

* Allow minor version updates for prod dependencies (#2117)

* Allow minor version updates for prod dependencies

* Create proud-colts-attend.md

* chore(deps): bump @primer/octicons-react from 16.1.1 to 17.3.0 (#2119)

Bumps [@primer/octicons-react](https://github.com/primer/octicons) from 16.1.1 to 17.3.0.
- [Release notes](https://github.com/primer/octicons/releases)
- [Changelog](https://github.com/primer/octicons/blob/main/CHANGELOG.md)
- [Commits](primer/octicons@v16.1.1...v17.3.0)

---
updated-dependencies:
- dependency-name: "@primer/octicons-react"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Export NavList from the main bundle (#2112)

* Export ActionListDividerProps

* Export NavList from the main bundle

* Add NavList link to the nav

* Create stale-hounds-notice.md

* Add componentId

* Fix CI for Node 16.15.1 (#2123)

* update package-lock for node 16.15.1

* use Node 14 for docs

* Use Node 14 for deploy production

* Version Packages (#2097)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* ADR: Parallel drafts track & plan for deprecated components (#1722)

* propose migration plan

* Update adr-005.md

* Update adr-005.md

* move SelectMenu to the first list

* Update with parallel track talk

* Update adr-005.md

* rename back to drafts

* Update contributor-docs/adrs/adr-005.md

Co-authored-by: Cole Bemis <colebemis@github.com>

* Apply suggestions from code review

Co-authored-by: Cole Bemis <colebemis@github.com>
Co-authored-by: Leslie Cohn-Wein <lesliecdubs@github.com>

* Remove component list from ADR

Co-authored-by: Mike Perrotti <mperrotti@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>
Co-authored-by: Leslie Cohn-Wein <lesliecdubs@github.com>

* ADR 004: Strict props or Composite components (#1703)

* Add ADR for children as API

* add adrs to eslint ignore list

* editing phase 1

* add NewButton examples

* lol title

* Replace accidental Button usage

* change title

* add renderChild to the example

* Apply suggestions from code review

Co-authored-by: Leslie Cohn-Wein <lesliecdubs@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>

* Apply suggestions from code review

Co-authored-by: Cole Bemis <colebemis@github.com>

* Add decision

* Update contributor-docs/adrs/adr-004-children-as-api.md

* clarify ActionMenu example is from legacy version

* removed sidenote because it feels like a tangent

Co-authored-by: Leslie Cohn-Wein <lesliecdubs@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>

* Fixed an issue with ButtonDanger Not defined. (#2128)

Replaced ButtonDanger with Button Component with the props variant="danger"

Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>

* Deprecate SideNav in favor of NavList (#2120)

* Deprecate SideNav

* Create small-donkeys-provide.md

* Enforce correct semantics for TabNav (#2125)

* Swaps nav and div and adds semantically correct roles

* Fix tests, add body div and move sx

* Adds changeset

* Fixing TabNavProps export

Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>

* Adding codeql scanning (#2134)

https://github.com/github/primer/issues/937

* Navlist passthrough action list group props (#2133)

* passthrough actionlist group props to navlist.group

* changeset

* pass through props

* fix pass through block

* Update docs/content/NavList.mdx

* avoid passing through action list props, but spread additional props to allow aria and data attributes through

Co-authored-by: Cole Bemis <colebemis@github.com>

* Explicitly declare workflow permissions for previews (#2137)

* explicitly declare workflow permissions for previews

* Basic SegmentedControl functionality (#2108)

* implements basic SegmentedControl functionality

* updates file structure

* adds SegmentedControl to drafts

* adds changeset

* fixes TypeScripts issues

* revert package-lock.json changes

* fixes SegmentedControl tests and updates snapshot

* style bug fixes

* Update src/SegmentedControl/fixtures.stories.tsx

Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>

* improve visual design for hover and active states

* ARIA updates from Chelsea's feedback

* updates tests and snapshots

* Ignore *.test.tsx files in build types

* Use named export for SegmentedControl

This fixes live code examples in the docs

* Update package-lock.json

* updates lock file

* fixes checkExports test for SegmentedControl

* design tweak for icon-only segmented control button

Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>

* Use import for `focus-visible` instead of require (#2149)

* CONTRIBUTING.md: Updating typecheck instructions (#2151)

The `typecheck` script was renamed in the past in #1960, correcting the contribution docs

* Add AutocompleteContext to Autocomplete component exports (#2153)

* Autocomplete: allow "falsely" input values (#2154)

* fix: allow autocomplete input value to be  falsely

* chore: added changeset

* fixes linting error

Co-authored-by: Erik Hughes <erik.hughes@outlook.com>

* fix: checkbox to useIsomorphicLayoutEffect (#2155)

Co-authored-by: Erik Hughes <erik.hughes@outlook.com>

* Change false to undefined (#2122)

* Add focusZone to TabNav (#2139)

* Add focusZone to TabNav

* Add aria-selected to tabs

* Custom strategy to ensure selected tab is focused on re-entry

* Add tests for new TabNav focus management

* ActionMenu: a11y fixes (batch 1) (#2099)

* Don't add aria-expanded=false

* remove "Select a" from aria-label

* remove tabIndex from AnchoredOverlay

* update story to use interactive element

* update snapshots

* Create anchored-overlay-clever-mails-roll.md

* update outdated label in test

* Add describedby to milestone story

* ActionMenu: Replace typeahead with mnemonics (#2105)

* Replace typeahead with mnemonics

* add aria-keyshortcuts as part of useMnemonics

* Create gold-falcons-shake.md

* support user configured aria-keyshortcuts

* delete unused useTypeaheadFocus

* Selected tab doesn't need to be <a> tag (#2158)

* Selected tab doesn't need to be a tag

* Updates tests for new code and updates snapshot

* AnchoredOverlay: Keep tabIndex for renderAnchor (#2159)

* Revert "remove tabIndex from AnchoredOverlay"

This reverts commit e7f2d03.

* remove change from changelog as well

* update matching snapshots

* Version Packages (#2131)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* SplitPageLayout API (#2144)

* Draft SplitPageLayout API docs

* Update docs/content/SplitPageLayout.mdx

Co-authored-by: Vinicius Depizzol <vdepizzol@gmail.com>

* Update docs/content/SplitPageLayout.mdx

* visible -> hidden prop

Co-authored-by: Vinicius Depizzol <vdepizzol@gmail.com>

* Convert commonjs code to esm during build (#2150)

* Build theme-preval to esm

* Use default export for theme-preval

* Create sweet-elephants-end.md

* Update theme-preval snapshot

* skip transform for storybook (#2177)

* Correct and improve Storybook and docs for form controls (#2143)

* updates checkbox props tables, storybook stories, and storybook controls

* updates Radio props table, Storybook stories, and Storybook controls

* updates FormControl Storybook stories, and Storybook controls

* updates TextInput and TextInputWithWrapper props tables, Storybook stories, and Storybook controls

* updates Select stories

* fixes more issues with Select stories and prop docs

* updates Textarea prop tables, Storybook stories, and Storybook controls

* updates CheckboxGroup and RadioGroup Storybook stories, and Storybook controls

* updates Autocomplete Storybook stories, and Storybook controls

* fixes 'size' control in TextInput stories

* fixes a11y issues with Autocomplete examples

* updates input stories to use the FormControl component and controls, and updates sidebar to reflect that relationship

* updates tests

* adds changeset

* fix linting issue

* updates after merging from main

* excludes story-helpers.tsx from build

* fixes regression in CheckboxGroup and RadioGroup fixture stories

* Bump primer primitives to latest `7.8.4` (#2180)

* update version of primer primitives

* update preval stamp

* changeset

* update snapshot

* Improves keyboard navigation for the SegmentedControl (#2145)

* implements keyboard navigation strategy for the SegmentedControl suggested by the a11y team, and warns component users if the control does not have a label

* adds changeset

* crappy fix for bug where useFocusZone breaks after selecting a button

* corrects typo in test name

* consolidates button focus test, and adds comment to focusInStrategy test

* remove getNextFocusable by tweaking focusInStrategy

Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>

* Version Packages (#2161)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Updated StateLabel to include `issueClosedNotPlanned` and fix `issueClosed` colour (#2171)

* Updated StateLabel

* Add changeset

* Update test

* Update the test suites

* Fix broken focus outline on the Select component (#2173)

* fixes broken focus outline on the Select component

* fixes linting issue

* adds changeset

* SegmentedControl variant prop (#2164)

* renders a tooltip for icon-only segmented control buttons

* implements responsive variant prop

* adds tests

* minor story tweaks

* refactor useMatchMedia

* adds useMatchMedia tests, fixes useMatchMedia bugs, updates SegmentedControl tests

* removes aria attributes from Storybook controls

* rm irrelevant 'TODO' comments

* adds changeset

* adds helpful comments

* fixes button font-size in Safari

* updates snapshots

* addresses PR feedback

* Update docs/content/SegmentedControl.mdx

Co-authored-by: Cole Bemis <colebemis@github.com>

* Update docs/content/SegmentedControl.mdx

Co-authored-by: Cole Bemis <colebemis@github.com>

* Update .changeset/pretty-students-judge.md

Co-authored-by: Josep Martins <jsp.mrtns@gmail.com>

* bumps @primer/primitives to version with segmented control variables

* corrects storybook knobs to match current API

* rm 'wide' key from 'variant' prop in props table

* fix bad merge in SegmentedControl

* adds more context to a11y issues with the tooltip implementation

* adds changeset

Co-authored-by: Cole Bemis <colebemis@github.com>
Co-authored-by: Josep Martins <jsp.mrtns@gmail.com>

* Use SegmentedControl component primitives (#2186)

* bumps @primer/primitives and uses SegmentedControl component tokens

* revert comment change in SegmentedControlIconButton

* adds changeset

* update themePreval snap with primitives@7.9.0

* PageLayout: Implement responsive `hidden` prop (#2174)

* Implement responsive hidden prop

* Write tests for useResponsiveValue

* Document hidden prop

* Update viewport range variables

* Add hidden prop to header/footer/content

* Update PageLayout tests

* Create empty-garlics-clean.md

* Fix lint errors

* Button should respect polymorphic as prop (#2166)

* update button to respect polymorphic as prop

* update docs

* update docs

* fix doc

* changeset

* fix by removing sc as propr types

* Add back link buttons stories using basic button

Co-authored-by: Pavithra Kodmad <pksjce@github.com>

* [passion week] Interaction tests with storybook's play function (#2172)

* Add storybook play function for autocomplete

* Add github workflow

* Must run on pull-request and push to main

* Package.lock revert

* update workflow

* configure static directories

* Build storybooks correctly

* A more complete autocomplete test

* Fix up packge lock?

* Fix up packge lock?

* Add some documentation

* Fix up autocomplete tests by adding data-testid

* Codemod for react 18 children types (#2196)

* run react 18 types codemod

* run prettier

* changeset

* Upgrade `user-event` to v14 (#2190)

* Upgrade `userEvent` to v14

* Fix Autocomplete tests

Co-authored-by: Cole Bemis <colebemis@github.com>

* PageLayout: Update `divider` prop responsive API (#2198)

* Deprecate dividerWhenNarrow in favor of responsive values

* Update PageLayout docs

* Create spotty-parents-cheat.md

* Update spotty-parents-cheat.md

* Update snapshots

* docs: NavList example with next/link's URL object (#2203)

Adding another use-case in the NavList's NextJS example

* PageLayout: Update `position` responsive prop API (#2199)

* Update position prop API

* Update snapshots

* Update docs

* Create fair-tips-travel.md

* ActionMenu: Remove focus trap + Fix initial focus (#2024)

* Revert "Revert "ActionMenu: Remove focus trap (#1984)" (#2023)"

This reverts commit 866abc0.

* prevent scroll when moving from anchor to menu

* Add shortcut example from memex

* progress!

* make refs required

* onclick should not interfere with keyboard

* default to first item if anchor is not used

* use userEvent instead of fireEvent for test to get full event

* remedy merge

* ignore containerRef for initial focus

* update changeset to include initial focus on click

* migrate to user-event@14

Co-authored-by: Cole Bemis <colebemis@github.com>

* Default ConfirmationDialog to focusing `cancel` when the confirmation is a dangerous one (#2185)

* allow configuration of the initial focus in a confirmation dialog

* changeset

* explicitly set the autoFocus when danger to cancel

* intermediate value

Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>

Co-authored-by: Mike Perrotti <mperrotti@github.com>
Co-authored-by: Katie Langerman <langermank@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>
Co-authored-by: Siddharth Kshetrapal <siddharthkp@github.com>
Co-authored-by: Cole Bemis <colebemis@github.com>
Co-authored-by: Leslie Cohn-Wein <lesliecdubs@github.com>
Co-authored-by: Dusty Greif <dustin.greif@gmail.com>
Co-authored-by: y-tomida <fmtyd509@gmail.com>
Co-authored-by: Hector Garcia <hectahertz@github.com>
Co-authored-by: Dusty Greif <dgreif@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Karim K. Kanji <karimkkanji@cryosoft.co.ke>
Co-authored-by: Owen Niblock <owenniblock@github.com>
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
Co-authored-by: Matthew Costabile <mattcosta7@github.com>
Co-authored-by: Rez <rezrah@github.com>
Co-authored-by: Jeff Wilcox <427913+jeffwilcox@users.noreply.github.com>
Co-authored-by: Will Glas <35304767+willglas@users.noreply.github.com>
Co-authored-by: Erik Hughes <erik.hughes@outlook.com>
Co-authored-by: Vinicius Depizzol <vdepizzol@gmail.com>
Co-authored-by: Andrew L <anleac@github.com>
Co-authored-by: Josep Martins <jsp.mrtns@gmail.com>
Co-authored-by: Pavithra Kodmad <pksjce@github.com>
Co-authored-by: Ian Sanders <iansan5653@github.com>
Co-authored-by: Mardav Wala <wiinci@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
react skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants