Skip to content

refactor: standardize disabled state and cursor: default #728

Open
paanSinghCoder wants to merge 2 commits intomainfrom
refactor/standardize-disabled-state
Open

refactor: standardize disabled state and cursor: default #728
paanSinghCoder wants to merge 2 commits intomainfrom
refactor/standardize-disabled-state

Conversation

@paanSinghCoder
Copy link
Copy Markdown
Contributor

Description

refactor: standardize disabled state and cursor: default for all componentes

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes, no bug fixes just code improvements)
  • Chore (changes to the build process or auxiliary tools and libraries such as documentation generation)
  • Style (changes that do not affect the meaning of the code (white-space, formatting, etc))
  • Test (adding missing tests or correcting existing tests)
  • Improvement (Improvements to existing code)
  • Other (please specify)

How Has This Been Tested?

[Describe the tests that you ran to verify your changes]

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (.mdx files)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Screenshots (if appropriate):

[Add screenshots here]

Related Issues

[Link any related issues here using #issue-number]

@paanSinghCoder paanSinghCoder self-assigned this Apr 2, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment Apr 2, 2026 11:15am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

📝 Walkthrough

Walkthrough

This pull request standardizes the disabled state styling across the Raystack UI component library. The changes include: (1) normalizing disabled element opacity to 0.5 across all components (previously varied between 0.4, 0.6, and 0.8), (2) removing cursor: not-allowed declarations from disabled interactive elements, (3) removing explicit color overrides on disabled states in favor of opacity-based visual indication, and (4) simplifying CSS rules targeting disabled states. Minor formatting adjustments include removing trailing newlines from CSS files and adjusting whitespace in selectors.

Suggested reviewers

  • ravisuhag
  • rohilsurana
  • rsbh
  • rohanchkrabrty
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main objective of the PR: standardizing disabled state styling and cursor behavior across all UI components.
Description check ✅ Passed The description is related to the changeset, identifying this as a refactor to standardize disabled state and cursor styling across components.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/raystack/components/checkbox/checkbox.module.css (1)

49-56: ⚠️ Potential issue | 🟡 Minor

Missing pointer-events: none may cause unintended hover effects on disabled checkbox.

The disabled checkbox state only applies opacity: 0.5 but doesn't disable pointer events. This means:

  1. The disabled checkbox will still show cursor: pointer (inherited from line 20)
  2. The hover state override (lines 53-56) will be triggered, showing visual feedback

Other components in this PR (tabs, breadcrumb, sidebar) use pointer-events: none to prevent interaction on disabled elements.

🐛 Proposed fix
 .checkbox[data-disabled] {
   opacity: 0.5;
+  pointer-events: none;
 }
-
-.checkbox[data-disabled]:hover {
-  background: var(--rs-color-background-base-primary);
-  border-color: var(--rs-color-border-base-primary);
-}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/checkbox/checkbox.module.css` around lines 49 -
56, The disabled checkbox style currently only sets opacity but leaves pointer
interactions enabled, so update the .checkbox[data-disabled] rule to include
pointer-events: none and ensure it also resets cursor to default (to override
the .checkbox cursor: pointer rule), and remove or no-op the
.checkbox[data-disabled]:hover rule (or keep it but ensure it does nothing) so
disabled checkboxes do not show hover/border changes; modify the selectors
.checkbox[data-disabled] and .checkbox[data-disabled]:hover accordingly to
mirror the other components' disabled behavior.
packages/raystack/components/radio/radio.module.css (1)

37-41: ⚠️ Potential issue | 🟠 Major

Disabled radio items still present a pointer cursor.

Because .radioitem keeps cursor: pointer (Line 18) and disabled styles here don’t override it, disabled radios still look interactive on hover.

Suggested fix
 .radioitem[data-disabled],
 .radioitem[data-disabled]:hover {
   background: var(--rs-color-background-neutral-secondary);
   border-color: var(--rs-color-border-base-secondary);
+  cursor: default;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/radio/radio.module.css` around lines 37 - 41,
The disabled radio styles for .radioitem[data-disabled] do not override the
interactive cursor set on .radioitem, so update the CSS for
.radioitem[data-disabled] and .radioitem[data-disabled]:hover to explicitly set
cursor to default or not-allowed (e.g., cursor: default or cursor: not-allowed)
and ensure hover rules also include that cursor value so disabled radios no
longer show the pointer; modify the selectors referencing
.radioitem[data-disabled] and .radioitem[data-disabled]:hover accordingly.
packages/raystack/components/button/button.module.css (1)

101-106: ⚠️ Potential issue | 🟠 Major

Disabled cursor behavior is inconsistent across button variants.

Line 105 sets cursor: default only for outline buttons, but shared disabled states (Lines 32-36) still inherit cursor: pointer from Line 11 for other variants. This breaks the “standardized disabled cursor” goal.

Suggested fix
 .button:disabled,
 .button-disabled {
   opacity: 0.5;
   pointer-events: initial;
+  cursor: default;
 }
@@
 .button-outline:disabled,
 .button-outline.button-disabled {
   opacity: 0.5;
   background-color: transparent;
-  cursor: default;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/button/button.module.css` around lines 101 -
106, Shared disabled styles currently leave cursor as pointer for non-outline
variants; update the disabled selector logic so the standardized disabled cursor
(cursor: default) applies to all button variants rather than only
.button-outline. Modify the shared disabled selectors (e.g., .button:disabled
and .button.button-disabled or whatever shared disabled rules are present) to
include cursor: default, or consolidate by adding a broad selector that targets
all disabled buttons and button-disabled classes in addition to
.button-outline:disabled/.button-outline.button-disabled so every variant uses
cursor: default when disabled.
🧹 Nitpick comments (2)
packages/raystack/components/calendar/calendar.module.css (1)

36-39: Consider removing color override from .navButton:disabled for consistency.

The .navButton:disabled rule retains an explicit color override alongside opacity: 0.5. Other disabled states in this PR rely solely on opacity for visual indication. This could be cleaned up in a follow-up for full consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/calendar/calendar.module.css` around lines 36 -
39, Remove the explicit color override from the .navButton:disabled rule and
rely only on opacity: 0.5 for the disabled visual treatment; update the
.navButton:disabled CSS selector to drop the color property so it matches other
disabled states that use opacity alone and avoids overriding inherited/semantic
colors.
packages/raystack/components/switch/switch.module.css (1)

36-42: Consider adding opacity: 0.5 for consistency with other disabled components.

The switch component uses background color overrides for its disabled state rather than the opacity: 0.5 pattern used elsewhere in this PR (tabs, sidebar, checkbox, etc.). If this is intentional for design reasons (e.g., to maintain clear toggle state visibility), consider adding a brief comment to document this deviation.

💡 Optional: Add opacity for consistency
 .switch[data-disabled] {
   background: var(--rs-color-background-neutral-primary);
+  opacity: 0.5;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/switch/switch.module.css` around lines 36 - 42,
The disabled switch CSS currently overrides background but doesn't apply the
project's standard disabled opacity; update the .switch[data-disabled] rule (and
.switch[data-disabled][data-checked] rule) to include opacity: 0.5 so the switch
matches other disabled components, and if this background override is
intentional instead of opacity, add a short comment above those selectors
documenting the design rationale; locate the selectors .switch[data-disabled]
and .switch[data-disabled][data-checked] in switch.module.css to make the
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@packages/raystack/components/button/button.module.css`:
- Around line 101-106: Shared disabled styles currently leave cursor as pointer
for non-outline variants; update the disabled selector logic so the standardized
disabled cursor (cursor: default) applies to all button variants rather than
only .button-outline. Modify the shared disabled selectors (e.g.,
.button:disabled and .button.button-disabled or whatever shared disabled rules
are present) to include cursor: default, or consolidate by adding a broad
selector that targets all disabled buttons and button-disabled classes in
addition to .button-outline:disabled/.button-outline.button-disabled so every
variant uses cursor: default when disabled.

In `@packages/raystack/components/checkbox/checkbox.module.css`:
- Around line 49-56: The disabled checkbox style currently only sets opacity but
leaves pointer interactions enabled, so update the .checkbox[data-disabled] rule
to include pointer-events: none and ensure it also resets cursor to default (to
override the .checkbox cursor: pointer rule), and remove or no-op the
.checkbox[data-disabled]:hover rule (or keep it but ensure it does nothing) so
disabled checkboxes do not show hover/border changes; modify the selectors
.checkbox[data-disabled] and .checkbox[data-disabled]:hover accordingly to
mirror the other components' disabled behavior.

In `@packages/raystack/components/radio/radio.module.css`:
- Around line 37-41: The disabled radio styles for .radioitem[data-disabled] do
not override the interactive cursor set on .radioitem, so update the CSS for
.radioitem[data-disabled] and .radioitem[data-disabled]:hover to explicitly set
cursor to default or not-allowed (e.g., cursor: default or cursor: not-allowed)
and ensure hover rules also include that cursor value so disabled radios no
longer show the pointer; modify the selectors referencing
.radioitem[data-disabled] and .radioitem[data-disabled]:hover accordingly.

---

Nitpick comments:
In `@packages/raystack/components/calendar/calendar.module.css`:
- Around line 36-39: Remove the explicit color override from the
.navButton:disabled rule and rely only on opacity: 0.5 for the disabled visual
treatment; update the .navButton:disabled CSS selector to drop the color
property so it matches other disabled states that use opacity alone and avoids
overriding inherited/semantic colors.

In `@packages/raystack/components/switch/switch.module.css`:
- Around line 36-42: The disabled switch CSS currently overrides background but
doesn't apply the project's standard disabled opacity; update the
.switch[data-disabled] rule (and .switch[data-disabled][data-checked] rule) to
include opacity: 0.5 so the switch matches other disabled components, and if
this background override is intentional instead of opacity, add a short comment
above those selectors documenting the design rationale; locate the selectors
.switch[data-disabled] and .switch[data-disabled][data-checked] in
switch.module.css to make the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e2c9de43-bc3b-416b-b97a-627862180fa3

📥 Commits

Reviewing files that changed from the base of the PR and between e741c21 and 8609e99.

📒 Files selected for processing (16)
  • packages/raystack/components/breadcrumb/breadcrumb.module.css
  • packages/raystack/components/button/button.module.css
  • packages/raystack/components/calendar/calendar.module.css
  • packages/raystack/components/checkbox/checkbox.module.css
  • packages/raystack/components/combobox/combobox.module.css
  • packages/raystack/components/icon-button/icon-button.module.css
  • packages/raystack/components/input-field/input-field.module.css
  • packages/raystack/components/menu/cell.module.css
  • packages/raystack/components/radio/radio.module.css
  • packages/raystack/components/search/search.module.css
  • packages/raystack/components/select/select.module.css
  • packages/raystack/components/sidebar/sidebar.module.css
  • packages/raystack/components/switch/switch.module.css
  • packages/raystack/components/tabs/tabs.module.css
  • packages/raystack/components/text-area/text-area.module.css
  • packages/raystack/components/toggle/toggle.module.css
💤 Files with no reviewable changes (2)
  • packages/raystack/components/search/search.module.css
  • packages/raystack/components/toggle/toggle.module.css

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.

1 participant