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

RichSelectList: update color and make label optional #330

Merged
merged 12 commits into from Mar 15, 2024

Conversation

jliotta
Copy link
Collaborator

@jliotta jliotta commented Mar 15, 2024

This PR adds the following updates for RichSelectList:

  • Make the label prop optional (similar to what we do for TextField
  • Because the label is now optional, I've added a required accessibilityLabel prop
  • Make the default color for the select box white

Changes needed for Shoppable Group Lessons which is the first use case of RichSelectList

Copy link

changeset-bot bot commented Mar 15, 2024

🦋 Changeset detected

Latest commit: 28a5bcb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@cambly/syntax-core Minor
@syntax/storybook Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link

vercel bot commented Mar 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
syntax ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 15, 2024 11:22pm

@jliotta jliotta changed the title RichSelectList: update color, optional label, adjust onClear functionality RichSelectList: update color and make label optional Mar 15, 2024
@@ -2,3 +2,7 @@
.richSelectBox:focus-visible {
Copy link
Contributor

Choose a reason for hiding this comment

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

@jliotta could you make sure to add a changeset to this PR? pnpm run changeset

@@ -59,7 +60,9 @@ export type RichSelectListProps = Omit<
/** Text shown below select box */
helperText?: string;
/** Text shown above select box */
label: string;
label?: string;
//** */
Copy link
Contributor

Choose a reason for hiding this comment

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

@jliotta instead of adding new accessibilityLabel prop, can we allow for an id to be passed in? This follows the same API as TextField:

The way folks can then add a label, is by adding a custom label outside of RichSelectList:

const reactId = useId();
const inputId = id ?? reactId;

@@ -117,6 +121,7 @@ function RichSelectList(props: RichSelectListProps): ReactElement {
...richSelectBoxProps
} = props;

const id = useId();
Copy link
Contributor

Choose a reason for hiding this comment

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

See

const reactId = useId();
const inputId = id ?? reactId;
- we want similar logic here

@@ -32,6 +32,7 @@
outline: 0;
padding: 0 36px 0 12px;
width: 100%;
background-color: var(--color-base-white);
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: can we alphabetically sort this?

@jliotta
Copy link
Collaborator Author

jliotta commented Mar 15, 2024

@christianvuerings I think I addressed your comments but please take another look! I'm going to merge this in for now since it's blocking some FE work but I can submit a follow-up PR if needed on Monday

@jliotta jliotta merged commit adbd975 into Cambly:main Mar 15, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants