Skip to content

Commit

Permalink
fix: ControlChip snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
malangcat committed Jan 3, 2025
1 parent 296c7ad commit ff4e48b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions docs/registry/ui/control-chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ import * as React from "react";

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

export interface ControlChipProps extends SeedControlChip.RootProps {
export interface ControlChipToggleProps extends SeedControlChip.RootProps {
prefixIcon?: React.ReactNode;

suffixIcon?: React.ReactNode;

count?: number;
}

export const ControlChip = React.forwardRef<HTMLLabelElement, ControlChipProps>(
export const ControlChipToggle = React.forwardRef<
HTMLLabelElement,
ControlChipToggleProps
>(
(
{ className, children, prefixIcon, suffixIcon, count, ...otherProps },
ref,
Expand All @@ -34,7 +37,18 @@ export const ControlChip = React.forwardRef<HTMLLabelElement, ControlChipProps>(
);
},
);
ControlChip.displayName = "ControlChip";
ControlChipToggle.displayName = "ControlChip.Toggle";

export const ControlChip = Object.assign(
() => {
console.warn(
"ControlChip is a base component and should not be rendered. Use ControlChip.Toggle or ControlChip.Radio instead.",
);
},
{
Toggle: ControlChipToggle,
},
);

/**
* This file is generated snippet from the Seed Design.
Expand Down

0 comments on commit ff4e48b

Please sign in to comment.