feat(label): add size prop to Label component for responsive text sizing
This commit is contained in:
parent
43e24222cc
commit
6c2c09f9e2
2 changed files with 13 additions and 8 deletions
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
--background: var(--neutral-800);
|
--background: var(--neutral-800);
|
||||||
--background-reversed: var(--neutral-000);
|
--background-reversed: var(--neutral-000);
|
||||||
--base: var(--neutral-800);
|
--basecl: var(--neutral-800);
|
||||||
--text: var(--neutral-000);
|
--text: var(--neutral-000);
|
||||||
--text-alt: var(--neutral-900);
|
--text-alt: var(--neutral-900);
|
||||||
--text-input: var(--text);
|
--text-input: var(--text);
|
||||||
|
@ -207,7 +207,7 @@ p {
|
||||||
|
|
||||||
--color-background: var(--neutral-750);
|
--color-background: var(--neutral-750);
|
||||||
--color-background-reversed: var(--background-reversed);
|
--color-background-reversed: var(--background-reversed);
|
||||||
--color-base: var(--neutral-800);
|
--color-basecl: var(--neutral-800);
|
||||||
--color-text: var(--text);
|
--color-text: var(--text);
|
||||||
--color-text-alt: var(--text-alt);
|
--color-text-alt: var(--text-alt);
|
||||||
--color-text-input: var(--text-input);
|
--color-text-input: var(--text-input);
|
||||||
|
@ -330,7 +330,7 @@ p {
|
||||||
|
|
||||||
--background: var(--neutral-750);
|
--background: var(--neutral-750);
|
||||||
--background-reversed: var(--neutral-000);
|
--background-reversed: var(--neutral-000);
|
||||||
--base: var(--neutral-750);
|
--basecl: var(--neutral-750);
|
||||||
--text: var(--neutral-000);
|
--text: var(--neutral-000);
|
||||||
--text-alt: var(--neutral-900);
|
--text-alt: var(--neutral-900);
|
||||||
--text-input: var(--text);
|
--text-input: var(--text);
|
||||||
|
|
|
@ -5,16 +5,21 @@ import * as LabelPrimitive from '@radix-ui/react-label';
|
||||||
|
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
function Label({
|
type LabelProps = React.ComponentProps<typeof LabelPrimitive.Root> & {
|
||||||
className,
|
size?: 'default' | 'small' | 'large';
|
||||||
...props
|
};
|
||||||
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
||||||
|
function Label({ className, size = 'default', ...props }: LabelProps) {
|
||||||
return (
|
return (
|
||||||
<LabelPrimitive.Root
|
<LabelPrimitive.Root
|
||||||
data-slot='label'
|
data-slot='label'
|
||||||
className={cn(
|
className={cn(
|
||||||
/* Text */
|
/* Text */
|
||||||
'text-sm',
|
size === 'small'
|
||||||
|
? 'text-sm'
|
||||||
|
: size === 'large'
|
||||||
|
? 'text-lg'
|
||||||
|
: 'text-base',
|
||||||
/* Background */
|
/* Background */
|
||||||
'',
|
'',
|
||||||
/* Border */
|
/* Border */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue