fix (InputField): Update Tooltip usage and fix docs css#706
fix (InputField): Update Tooltip usage and fix docs css#706paanSinghCoder merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughRemoved a trailing newline from a CSS file, refactored InputField's infoTooltip to use Tooltip.Trigger/Tooltip.Content, and added a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/raystack/components/input-field/input-field.tsx (1)
91-97: Switch trigger from<span>to semantic<button>for keyboard accessibility.The
@base-ui/reactTooltip.Trigger does not automatically preserve button semantics or keyboard focusability when a custom element is provided via therenderprop. Since a<span>is rendered here, the trigger is not keyboard-accessible. Use a semantic button element with an accessible label instead.Recommended change
<Tooltip.Trigger render={ - <span className={styles.helpIcon}> + <button + type='button' + className={styles.helpIcon} + aria-label={`More information about ${label}`} + > <InfoCircledIcon /> - </span> + </button> } />🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/raystack/components/input-field/input-field.tsx` around lines 91 - 97, The Tooltip.Trigger currently supplies a non-interactive <span> via its render prop which breaks keyboard accessibility; update the render content in Tooltip.Trigger to use a semantic <button> (e.g., type="button") instead of the span so it is focusable and operable via keyboard, keep the className={styles.helpIcon} to preserve styling, add an appropriate accessible label (aria-label) or visually hidden text for the InfoCircledIcon, and ensure any existing click/keyboard handlers still work with the new button element.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/raystack/components/input-field/input-field.tsx`:
- Around line 91-97: The Tooltip.Trigger currently supplies a non-interactive
<span> via its render prop which breaks keyboard accessibility; update the
render content in Tooltip.Trigger to use a semantic <button> (e.g.,
type="button") instead of the span so it is focusable and operable via keyboard,
keep the className={styles.helpIcon} to preserve styling, add an appropriate
accessible label (aria-label) or visually hidden text for the InfoCircledIcon,
and ensure any existing click/keyboard handlers still work with the new button
element.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0a2ffce9-302a-4aff-9d79-cde9e6eaa684
📒 Files selected for processing (2)
apps/www/src/components/preview/preview.module.csspackages/raystack/components/input-field/input-field.tsx
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/www/src/content/docs/components/input-field/demo.ts (1)
37-37: Use a shared constant for demo width to reduce drift.
"560px"is duplicated across multiple snippets. Centralizing it will make future updates safer and faster.Refactor sketch
+const DEFAULT_DEMO_WIDTH = '560px'; + export const playground = { type: 'playground', controls: { @@ - width: { type: 'text', initialValue: '560px' }, + width: { type: 'text', initialValue: DEFAULT_DEMO_WIDTH }, @@ export const basicDemo = { type: 'code', code: ` <InputField label="Default" placeholder="Enter text" - width="560px" + width="${DEFAULT_DEMO_WIDTH}" />` }; @@ export const helperTextDemo = { type: 'code', code: ` <InputField label="With label" placeholder="Enter text" helperText="This is a helper text" - width="560px" + width="${DEFAULT_DEMO_WIDTH}" />` };Also applies to: 47-47, 57-57, 68-68, 79-79, 89-89, 99-99
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/www/src/content/docs/components/input-field/demo.ts` at line 37, The demos in apps/www/src/content/docs/components/input-field/demo.ts repeat the literal "560px" across multiple snippets; define a single shared constant (e.g., const DEMO_WIDTH = "560px") at the top of the module and replace each width="560px" occurrence with width={DEMO_WIDTH} (or width={DEMO_WIDTH} string usage appropriate to the existing JSX/snippet syntax) so all demos (the repeated occurrences around the input-field examples) reference the shared DEMO_WIDTH constant.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/www/src/content/docs/components/input-field/demo.ts`:
- Line 37: The demos in apps/www/src/content/docs/components/input-field/demo.ts
repeat the literal "560px" across multiple snippets; define a single shared
constant (e.g., const DEMO_WIDTH = "560px") at the top of the module and replace
each width="560px" occurrence with width={DEMO_WIDTH} (or width={DEMO_WIDTH}
string usage appropriate to the existing JSX/snippet syntax) so all demos (the
repeated occurrences around the input-field examples) reference the shared
DEMO_WIDTH constant.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 664fe627-e658-43b0-8227-cab2b0246526
📒 Files selected for processing (2)
apps/www/src/components/preview/preview.module.cssapps/www/src/content/docs/components/input-field/demo.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/www/src/components/preview/preview.module.css
Description
fix (InputField): Update Tooltip usage in InputField and fix docs CSS.
Type of Change
How Has This Been Tested?
Manual
Checklist:
Summary by CodeRabbit
Refactor
Documentation