Skip to content

Commit ff4e48b

Browse files
committed
fix: ControlChip snippet
1 parent 296c7ad commit ff4e48b

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

docs/registry/ui/control-chip.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import * as React from "react";
55

66
import "@seed-design/stylesheet/controlChip.css";
77

8-
export interface ControlChipProps extends SeedControlChip.RootProps {
8+
export interface ControlChipToggleProps extends SeedControlChip.RootProps {
99
prefixIcon?: React.ReactNode;
1010

1111
suffixIcon?: React.ReactNode;
1212

1313
count?: number;
1414
}
1515

16-
export const ControlChip = React.forwardRef<HTMLLabelElement, ControlChipProps>(
16+
export const ControlChipToggle = React.forwardRef<
17+
HTMLLabelElement,
18+
ControlChipToggleProps
19+
>(
1720
(
1821
{ className, children, prefixIcon, suffixIcon, count, ...otherProps },
1922
ref,
@@ -34,7 +37,18 @@ export const ControlChip = React.forwardRef<HTMLLabelElement, ControlChipProps>(
3437
);
3538
},
3639
);
37-
ControlChip.displayName = "ControlChip";
40+
ControlChipToggle.displayName = "ControlChip.Toggle";
41+
42+
export const ControlChip = Object.assign(
43+
() => {
44+
console.warn(
45+
"ControlChip is a base component and should not be rendered. Use ControlChip.Toggle or ControlChip.Radio instead.",
46+
);
47+
},
48+
{
49+
Toggle: ControlChipToggle,
50+
},
51+
);
3852

3953
/**
4054
* This file is generated snippet from the Seed Design.

0 commit comments

Comments
 (0)