Conversation
WalkthroughBased on the provided information, here's the updated content: WalkthroughThe changes involve the creation of a new Changes
Assessment against linked issues
TipsChat with CodeRabbit Bot (
|
app/client/packages/design-system/widgets/src/components/TagGroup/src/Tag.tsx
Show resolved
Hide resolved
|
|
||
| # Tag Group | ||
|
|
||
| Switch Group is a group of checkboxes that can be selected together. |
There was a problem hiding this comment.
The title "Switch Group" seems to be a copy-paste error and should be corrected to "Tag Group" to match the context of the component being documented.
- Switch Group is a group of checkboxes that can be selected together.
+ Tag Group is a group of tags that can be interacted with.Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| Switch Group is a group of checkboxes that can be selected together. | |
| Tag Group is a group of tags that can be interacted with. |
|
|
||
| # Single Selection Mode | ||
|
|
||
| Switch Group can be configured to allow only one selection at a time with the `selectionMode` prop. |
There was a problem hiding this comment.
The reference to "Switch Group" should be updated to "Tag Group" to maintain consistency with the component being described.
- Switch Group can be configured to allow only one selection at a time with the `selectionMode` prop.
+ Tag Group can be configured to allow only one selection at a time with the `selectionMode` prop.Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| Switch Group can be configured to allow only one selection at a time with the `selectionMode` prop. | |
| Tag Group can be configured to allow only one selection at a time with the `selectionMode` prop. |
|
|
||
| # Multiple Selection Mode | ||
|
|
||
| Switch Group can be configured to allow multiple selections at a time with the `selectionMode` prop with value `multiple`. |
There was a problem hiding this comment.
The reference to "Switch Group" should be corrected to "Tag Group" to accurately describe the component's functionality.
- Switch Group can be configured to allow multiple selections at a time with the `selectionMode` prop with value `multiple`.
+ Tag Group can be configured to allow multiple selections at a time with the `selectionMode` prop with value `multiple`.Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| Switch Group can be configured to allow multiple selections at a time with the `selectionMode` prop with value `multiple`. | |
| Tag Group can be configured to allow multiple selections at a time with the `selectionMode` prop with value `multiple`. |
app/client/packages/design-system/widgets/src/components/TagGroup/src/Tag.tsx
Show resolved
Hide resolved
| <HeadlessTag textValue={textValue} {...props} className={styles["tag"]}> | ||
| {({ allowsRemoving }) => ( | ||
| <> | ||
| <span className={getTypographyClassName("footnote")}>{children}</span> |
There was a problem hiding this comment.
Can we pass className to the tag directly? Can we avoid adding span?
| </HeadlessText> | ||
| )} | ||
| {Boolean(errorMessage) && ( | ||
| <HeadlessText elementType="div" slot="errorMessage"> |
There was a problem hiding this comment.
Each HeadlessText component will create an additional DOM node. Is it necessary? Can we use just WDS Text component in the same way? If not, then may be we can throw WDS typography classes into the spectrum component.
app/client/packages/design-system/widgets/src/components/TagGroup/stories/TagGroup.stories.mdx
Show resolved
Hide resolved
app/client/packages/design-system/widgets/src/components/TagGroup/stories/TagGroup.stories.mdx
Show resolved
Hide resolved
app/client/packages/design-system/widgets/src/components/TagGroup/src/Tag.tsx
Show resolved
Hide resolved
app/client/packages/design-system/widgets/src/components/TagGroup/src/Tag.tsx
Show resolved
Hide resolved
| {children} | ||
| </HeadlessTagList> | ||
| {Boolean(description) && ( | ||
| <HeadlessText elementType="div" slot="description"> |
There was a problem hiding this comment.
Two components ( HeadlessText and Text ) are required because we need slot feature of HeadlessText and we need styles from our Text.
There was a problem hiding this comment.
Ignore. This is fixed.
app/client/packages/design-system/widgets/src/components/TagGroup/stories/TagGroup.stories.mdx
Show resolved
Hide resolved
| </HeadlessText> | ||
| )} | ||
| {Boolean(errorMessage) && ( | ||
| <HeadlessText elementType="div" slot="errorMessage"> |
| <HeadlessTag textValue={textValue} {...props} className={styles["tag"]}> | ||
| {({ allowsRemoving }) => ( | ||
| <> | ||
| <span className={getTypographyClassName("footnote")}>{children}</span> |
app/client/packages/design-system/widgets/src/components/TagGroup/src/Tag.tsx
Show resolved
Hide resolved
| {...wrapperProps} | ||
| className={wrapperClassName} | ||
| data-disabled={isDisabled ? "" : undefined} | ||
| data-disabled={Boolean(isDisabled) ? "" : undefined} |
There was a problem hiding this comment.
The data-disabled attribute should be a boolean value, but it's being set to an empty string or undefined. It should be set to true or false directly.
- data-disabled={Boolean(isDisabled) ? "" : undefined}
+ data-disabled={isDisabled}Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| data-disabled={Boolean(isDisabled) ? "" : undefined} | |
| data-disabled={isDisabled} |
| "@blueprintjs/icons": "3.22.0", | ||
| "@types/react": "^17.0.2", | ||
| "postcss": "8.4.31", | ||
| "@react-types/shared": "3.19.0" |
| data-testid="create-workspace-form__name" | ||
| name="name" | ||
| placeholder="Name" | ||
| // @ts-expect-error Type mismatch |
There was a problem hiding this comment.
How does this relate to us?
Fixes #29134
Summary by CodeRabbit
New Features
TagGroupandTagcomponents with features like label, description, error message, and tag removal options.TagGroupto demonstrate various configurations and use cases.Enhancements
Switchcomponent with improved validation logic.TextAreainitialization to handle undefined default values more gracefully.validationStateproperty toHelpTextandFieldcomponents to support form validation states.Style Updates
TagGroupandTagcomponents to improve UI consistency and interactivity.Documentation
TagGroupandTagcomponents.