Skip to content

Commit 4d9b4be

Browse files
authored
chore(button) - remove react-slot (#781)
* remove label && slot * remove react-label dependency * remove dependency * format * adapt plan * chore(button) - remove react-slog * updates * update plan * edit plan * format
1 parent f721f5d commit 4d9b4be

6 files changed

Lines changed: 6 additions & 42 deletions

File tree

example/package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 0 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@
9595
"@radix-ui/react-radio-group": "^1.3.8",
9696
"@radix-ui/react-scroll-area": "^1.2.10",
9797
"@radix-ui/react-select": "^2.2.6",
98-
"@radix-ui/react-slot": "^1.2.4",
9998
"@radix-ui/react-tabs": "^1.1.13",
10099
"@remoteoss/remote-json-schema-form-kit": "github:remoteoss/remote-json-schema-form-kit#v0.0.5",
101100
"@tailwindcss/cli": "^4.1.17",

plans/headless-library.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ Decouple all Radix UI (and other visual) dependencies from the library core, mak
2222

2323
### Visual components embedded in flows/shared (must be made overridable or moved)
2424

25-
- `EstimationResults` — uses `Card`, `Accordion`, `BasicTooltip`, `ActionsDropdown`
26-
- `SummaryResults` — uses `Card`, `Accordion`
27-
- `Termination/PaidTimeOff` — uses `Button`
28-
- `ContractorOnboarding/ContractPreviewStatement` — uses `Alert`
29-
- `ActionsDropdown` — uses `Button` from `ui/button`
25+
- `EstimationResults` — uses `Accordion`
26+
- `SummaryResults` — uses `Accordion`
3027

3128
---
3229

src/components/ui/badge.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as React from 'react';
2-
import { Slot } from '@radix-ui/react-slot';
32
import { cva, type VariantProps } from 'class-variance-authority';
43

54
import { cn } from '@/src/lib/utils';
@@ -28,14 +27,10 @@ const badgeVariants = cva(
2827
function Badge({
2928
className,
3029
variant,
31-
asChild = false,
3230
...props
33-
}: React.ComponentProps<'span'> &
34-
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35-
const Comp = asChild ? Slot : 'span';
36-
31+
}: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants>) {
3732
return (
38-
<Comp
33+
<span
3934
data-slot='badge'
4035
className={cn(badgeVariants({ variant }), className)}
4136
{...props}

src/components/ui/button.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Slot } from '@radix-ui/react-slot';
21
import { cva, type VariantProps } from 'class-variance-authority';
32
import * as React from 'react';
43

@@ -40,16 +39,10 @@ function Button({
4039
className,
4140
variant,
4241
size,
43-
asChild = false,
4442
...props
45-
}: React.ComponentProps<'button'> &
46-
VariantProps<typeof buttonVariants> & {
47-
asChild?: boolean;
48-
}) {
49-
const Comp = asChild ? Slot : 'button';
50-
43+
}: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants>) {
5144
return (
52-
<Comp
45+
<button
5346
data-slot='button'
5447
className={cn(
5548
buttonVariants({ variant, size, className }),

0 commit comments

Comments
 (0)