-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(docs): types for classNames and itemClasses #4209
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,7 +81,7 @@ Keyboard key is a component to display which key or combination of keys performs | |
| }, | ||
| { | ||
| attribute: "classNames", | ||
| type: 'Record<"base" | "abbr" | "content", string>', | ||
| type: 'Partial<Record<"base" | "abbr" | "content", string>>', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Type definition is consistent with other components The verification shows that the
🔗 Analysis chainLGTM! Type definition correctly updated. The change from Let's verify the consistency of this change across other component documentation files: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check if other component docs use the correct Partial<Record> type for classNames
# Expected: All components should use Partial<Record> for consistency
# Search for classNames type definitions in MDX files
rg -t mdx 'classNames.*Record.*string' apps/docs/content/docs/components/
Length of output: 103 Script: #!/bin/bash
# Let's try a different approach to search for Record type definitions in documentation
rg "type.*Record.*string" apps/docs/content/docs/
Length of output: 7783 |
||
| description: "Allows to set custom class names for the keyboard key slots.", | ||
| default: "-" | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -210,7 +210,7 @@ You can customize the `Progress` component by passing custom Tailwind CSS classe | |
| }, | ||
| { | ||
| attribute: "classNames", | ||
| type: "Record<'base' | 'labelWrapper' | 'label' | 'track' | 'value' | 'indicator', string>", | ||
| type: "Partial<Record<'base' | 'labelWrapper' | 'label' | 'track' | 'value' | 'indicator', string>>", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Inconsistent classNames type definitions found in dropdown and listbox components The verification revealed that most components correctly use
🔗 Analysis chainLGTM! Type definition correctly updated. The change from Let's verify the consistency of this change across other components mentioned in the AI summary: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check if the classNames type is consistently defined as Partial<Record> across all component docs
# Expected: All components should use Partial<Record> for classNames type
# Search for classNames type definitions in component docs
rg -U 'attribute: "classNames"[^}]+type: "[^"]+"' apps/docs/content/docs/components/
Length of output: 9797 |
||
| description: "Allows to set custom class names for the progress slots.", | ||
| default: "-" | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Found inconsistent type definitions in the dropdown component documentation
The search revealed that most components correctly use
Partial<Record>, but the dropdown component has some inconsistent type definitions that need to be updated:apps/docs/content/docs/components/dropdown.mdx:classNamesfor dropdown section usesRecordinstead ofPartial<Record>itemClassesusesRecordinstead ofPartial<Record>classNamesfor dropdown item usesRecordinstead ofPartial<Record>🔗 Analysis chain
LGTM! The type definition change correctly addresses the issue.
The update from
RecordtoPartial<Record>accurately reflects that the class name keys are optional, which resolves the confusion reported in issue #3216.Let's verify if similar type definitions need to be updated in other component documentation files:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1694
Script:
Length of output: 17477