Skip to content

Commit f176477

Browse files
fix(button,badge): make cursor consistent — pointer on Button, default on Badge (#309)
* fix(button): restore pointer cursor on Button Tailwind v4 dropped the Preflight rule that gave button/[role="button"] a cursor: pointer, so the base Button showed the default arrow cursor while components that hardcode astw:cursor-pointer (e.g. ActionPanel) did not. Add astw:cursor-pointer to the buttonVariants base classes so all Button instances are consistent. Disabled buttons keep the default cursor via the existing astw:disabled:pointer-events-none. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(badge): pin cursor: default so badges don't inherit pointer A Badge is non-interactive but renders a <div> with no cursor, so it inherited cursor: pointer from clickable ancestors (e.g. a DataTable row with onClickRow). Add astw:cursor-default to badgeVariants so a badge never signals clickability. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(badge): note badges are non-interactive (default cursor) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fb61c8f commit f176477

5 files changed

Lines changed: 32 additions & 15 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@tailor-platform/app-shell": patch
3+
---
4+
5+
Fix cursor consistency across `Button` and `Badge`:
6+
7+
- **`Button`**: restore the pointer cursor. Tailwind v4 dropped the Preflight
8+
rule that gave `button`/`[role="button"]` a `cursor: pointer`, so the base
9+
`Button` showed the default arrow cursor while components that hardcode
10+
`astw:cursor-pointer` (e.g. `ActionPanel`) did not. Added `astw:cursor-pointer`
11+
to the `buttonVariants` base classes so all `Button` instances are consistent.
12+
Disabled buttons keep the default cursor via the existing
13+
`astw:disabled:pointer-events-none`.
14+
- **`Badge`**: pin `astw:cursor-default`. A `Badge` is non-interactive but
15+
renders a `<div>` with no cursor of its own, so it inherited `cursor: pointer`
16+
from clickable ancestors (e.g. a `DataTable` row with `onClickRow`). Explicitly
17+
setting the default cursor stops a badge from signalling clickability.

docs/components/badge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function ProductBadge({ product }: { product: Product }) {
223223
- Use semantic color meanings consistently (green = success, red = error, etc.)
224224
- Don't rely solely on color to convey information
225225
- Consider adding icons or text labels for clarity
226-
- Badges receive focus when interactive (clickable)
226+
- Badges are non-interactive: they render with the default cursor (not a pointer) and won't suggest clickability, even when placed inside a clickable container such as a `DataTable` row with `onClickRow`
227227

228228
## Usage in DescriptionCard
229229

0 commit comments

Comments
 (0)