@xjur-ui/react 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/components/steps/index.js +1 -1
- package/package.json +7 -4
- package/.turbo/turbo-build.log +0 -419
- package/eslint.config.js +0 -10
- package/postcss.config.js +0 -5
- package/prettier.config.js +0 -7
- package/src/components/avatar-group.tsx +0 -76
- package/src/components/avatar.tsx +0 -54
- package/src/components/badge.tsx +0 -40
- package/src/components/breadcrumb.tsx +0 -119
- package/src/components/chip.tsx +0 -117
- package/src/components/collapsible.tsx +0 -35
- package/src/components/controls/button.tsx +0 -107
- package/src/components/controls/calendar.tsx +0 -124
- package/src/components/controls/checkbox.tsx +0 -57
- package/src/components/controls/context/field.context.ts +0 -27
- package/src/components/controls/date-picker.tsx +0 -199
- package/src/components/controls/floating-label.tsx +0 -60
- package/src/components/controls/input.tsx +0 -237
- package/src/components/controls/otp-input.tsx +0 -45
- package/src/components/controls/radio.tsx +0 -74
- package/src/components/controls/rich-editor.tsx +0 -372
- package/src/components/controls/search-input.tsx +0 -154
- package/src/components/controls/search-selector.tsx +0 -98
- package/src/components/controls/select.tsx +0 -274
- package/src/components/controls/switch.tsx +0 -31
- package/src/components/custom/pessoa/index.ts +0 -9
- package/src/components/custom/pessoa/pessoa-add-button.tsx +0 -35
- package/src/components/custom/pessoa/pessoa-body.tsx +0 -22
- package/src/components/custom/pessoa/pessoa-close-button.tsx +0 -13
- package/src/components/custom/pessoa/pessoa-content.tsx +0 -25
- package/src/components/custom/pessoa/pessoa-footer.tsx +0 -15
- package/src/components/custom/pessoa/pessoa-header.tsx +0 -35
- package/src/components/custom/pessoa/pessoa-trigger.tsx +0 -25
- package/src/components/custom/pessoa/pessoa.context.tsx +0 -73
- package/src/components/custom/pessoa/pessoa.tsx +0 -35
- package/src/components/dialog.tsx +0 -242
- package/src/components/divider.tsx +0 -24
- package/src/components/drag-and-drop/drag-handle.tsx +0 -46
- package/src/components/drag-and-drop/drag-list-item.tsx +0 -91
- package/src/components/drag-and-drop/drag-list.tsx +0 -47
- package/src/components/drag-and-drop/drag-root.tsx +0 -30
- package/src/components/drag-and-drop/index.ts +0 -39
- package/src/components/drag-and-drop/types/drag-item.ts +0 -7
- package/src/components/dropdown-menu.tsx +0 -101
- package/src/components/full-calendar/calendar-add-event.tsx +0 -15
- package/src/components/full-calendar/calendar-body.tsx +0 -12
- package/src/components/full-calendar/calendar-cell.tsx +0 -120
- package/src/components/full-calendar/calendar-day-view.tsx +0 -76
- package/src/components/full-calendar/calendar-event.tsx +0 -178
- package/src/components/full-calendar/calendar-header.tsx +0 -14
- package/src/components/full-calendar/calendar-month-view.tsx +0 -69
- package/src/components/full-calendar/calendar-more-events-dropdown.tsx +0 -39
- package/src/components/full-calendar/calendar-navigator.tsx +0 -86
- package/src/components/full-calendar/calendar-root.tsx +0 -165
- package/src/components/full-calendar/calendar-today-button.tsx +0 -21
- package/src/components/full-calendar/calendar-toggle-view.tsx +0 -61
- package/src/components/full-calendar/calendar-view-renderer.tsx +0 -19
- package/src/components/full-calendar/calendar-week-day.tsx +0 -49
- package/src/components/full-calendar/calendar-week-view.tsx +0 -88
- package/src/components/full-calendar/helpers/calendar.ts +0 -158
- package/src/components/full-calendar/index.ts +0 -16
- package/src/components/full-calendar/types/calendar-cell.ts +0 -4
- package/src/components/full-calendar/types/calendar-event.ts +0 -7
- package/src/components/full-calendar/types/calendar-view.ts +0 -1
- package/src/components/full-calendar/types/calendar-week-hour.ts +0 -4
- package/src/components/horizontal-scroll.tsx +0 -159
- package/src/components/icon.tsx +0 -29
- package/src/components/list.tsx +0 -111
- package/src/components/logo.tsx +0 -44
- package/src/components/selection-bar.tsx +0 -273
- package/src/components/sheet.tsx +0 -150
- package/src/components/skeleton.tsx +0 -12
- package/src/components/status.tsx +0 -43
- package/src/components/steps/index.ts +0 -6
- package/src/components/steps/step.tsx +0 -23
- package/src/components/steps/steps-action.tsx +0 -65
- package/src/components/steps/steps-content.tsx +0 -12
- package/src/components/steps/steps-context.tsx +0 -121
- package/src/components/steps/steps-navigation.tsx +0 -80
- package/src/components/steps/steps-root.tsx +0 -9
- package/src/components/table/index.ts +0 -8
- package/src/components/table/table-body.tsx +0 -17
- package/src/components/table/table-cell.tsx +0 -14
- package/src/components/table/table-footer.tsx +0 -17
- package/src/components/table/table-head.tsx +0 -31
- package/src/components/table/table-header.tsx +0 -17
- package/src/components/table/table-row.tsx +0 -21
- package/src/components/table/table-sort.tsx +0 -34
- package/src/components/table/table.tsx +0 -16
- package/src/components/tabs.tsx +0 -72
- package/src/components/tag.tsx +0 -99
- package/src/components/tooltip.tsx +0 -63
- package/src/components/typography.tsx +0 -85
- package/src/components/upload.tsx +0 -647
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-os.ts +0 -32
- package/src/index.css +0 -5
- package/src/resources/icons.ts +0 -154
- package/src/resources/input-mask.ts +0 -91
- package/src/resources/logo/horizontal.tsx +0 -70
- package/src/resources/logo/icon.tsx +0 -54
- package/src/resources/logo/index.tsx +0 -33
- package/src/resources/logo/vertical.tsx +0 -70
- package/src/types.d.ts +0 -4
- package/tsconfig.json +0 -4
- package/tsup.config.ts +0 -30
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { cx } from '@xjur-ui/util'
|
|
2
|
-
import { Icon } from '../icon'
|
|
3
|
-
|
|
4
|
-
export function TableSort({
|
|
5
|
-
className,
|
|
6
|
-
sortedDirection,
|
|
7
|
-
...props
|
|
8
|
-
}: React.ComponentProps<'button'> & { sortedDirection?: 'asc' | 'desc' }) {
|
|
9
|
-
return (
|
|
10
|
-
<button
|
|
11
|
-
className={cx(
|
|
12
|
-
'size-large-1x rounded-small-1x',
|
|
13
|
-
'flex cursor-pointer items-center justify-center',
|
|
14
|
-
'hidden group-hover/th:flex',
|
|
15
|
-
'data-[sorted=true]:flex',
|
|
16
|
-
'transition-all duration-200 ease-out',
|
|
17
|
-
'data-[sorted=true]:bg-primary-alt-active data-[sorted=true]:text-primary-label-active',
|
|
18
|
-
'absolute top-1/2 right-0 -translate-y-1/2',
|
|
19
|
-
className
|
|
20
|
-
)}
|
|
21
|
-
data-sorted={sortedDirection !== undefined}
|
|
22
|
-
type="button"
|
|
23
|
-
{...props}
|
|
24
|
-
>
|
|
25
|
-
{sortedDirection !== undefined ? (
|
|
26
|
-
<Icon
|
|
27
|
-
name={sortedDirection === 'asc' ? 'arrow_downward' : 'arrow_upward'}
|
|
28
|
-
/>
|
|
29
|
-
) : (
|
|
30
|
-
<Icon name="swap_vert" />
|
|
31
|
-
)}
|
|
32
|
-
</button>
|
|
33
|
-
)
|
|
34
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { cx } from '@xjur-ui/util'
|
|
2
|
-
|
|
3
|
-
export function Table({ className, ...props }: React.ComponentProps<'table'>) {
|
|
4
|
-
return (
|
|
5
|
-
<div
|
|
6
|
-
className="text-size-body-md scrollbar-thin relative w-full overflow-hidden transition-all hover:overflow-x-auto"
|
|
7
|
-
data-slot="table-container"
|
|
8
|
-
>
|
|
9
|
-
<table
|
|
10
|
-
className={cx('w-full caption-bottom', className)}
|
|
11
|
-
data-slot="table"
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
)
|
|
16
|
-
}
|
package/src/components/tabs.tsx
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs'
|
|
3
|
-
import { tv } from '@xjur-ui/util'
|
|
4
|
-
|
|
5
|
-
const tabsStyles = tv({
|
|
6
|
-
slots: {
|
|
7
|
-
list: 'flex items-center gap-0',
|
|
8
|
-
trigger:
|
|
9
|
-
'inline-flex items-center justify-center gap-small px-small py-small_1x-alt h-large-4x ' +
|
|
10
|
-
'font-medium cursor-pointer transition-colors !text-size-label-md ' +
|
|
11
|
-
'disabled:opacity-38 disabled:pointer-events-none',
|
|
12
|
-
content: ''
|
|
13
|
-
},
|
|
14
|
-
variants: {
|
|
15
|
-
variant: {
|
|
16
|
-
line: {
|
|
17
|
-
trigger:
|
|
18
|
-
'rounded-small-1x text-neutral-dark border-b-[3px] border-b-transparent ' +
|
|
19
|
-
'hover:bg-layer-2-hover ' +
|
|
20
|
-
'data-[state=active]:text-primary-active ' +
|
|
21
|
-
'data-[state=active]:border-b-primary-active ' +
|
|
22
|
-
'data-[state=active]:rounded-none data-[state=active]:bg-transparent'
|
|
23
|
-
},
|
|
24
|
-
button: {
|
|
25
|
-
trigger:
|
|
26
|
-
'rounded-tl-small-1x rounded-tr-small-1x rounded-bl-none rounded-br-none px-large ' +
|
|
27
|
-
'bg-primary-idle text-neutral-label ' +
|
|
28
|
-
'hover:bg-primary-hover ' +
|
|
29
|
-
'data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-active'
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
defaultVariants: {
|
|
34
|
-
variant: 'button'
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
export function TabsRoot(
|
|
39
|
-
props: React.ComponentProps<typeof TabsPrimitive.Tabs>
|
|
40
|
-
) {
|
|
41
|
-
return <TabsPrimitive.Tabs {...props} />
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type TabsListProps = React.ComponentProps<typeof TabsPrimitive.TabsList>
|
|
45
|
-
|
|
46
|
-
export function TabsList({ className, ...props }: TabsListProps) {
|
|
47
|
-
const { list } = tabsStyles({})
|
|
48
|
-
return <TabsPrimitive.TabsList className={list({ className })} {...props} />
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface TabsTriggerProps
|
|
52
|
-
extends React.ComponentProps<typeof TabsPrimitive.TabsTrigger> {
|
|
53
|
-
variant?: 'line' | 'button'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function TabsTrigger({
|
|
57
|
-
variant,
|
|
58
|
-
className,
|
|
59
|
-
...props
|
|
60
|
-
}: TabsTriggerProps) {
|
|
61
|
-
const { trigger } = tabsStyles({ variant })
|
|
62
|
-
return (
|
|
63
|
-
<TabsPrimitive.TabsTrigger className={trigger({ className })} {...props} />
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function TabsContent(
|
|
68
|
-
props: React.ComponentProps<typeof TabsPrimitive.TabsContent>
|
|
69
|
-
) {
|
|
70
|
-
const { content } = tabsStyles()
|
|
71
|
-
return <TabsPrimitive.TabsContent className={content()} {...props} />
|
|
72
|
-
}
|
package/src/components/tag.tsx
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'
|
|
2
|
-
import { type ComponentProps } from 'react'
|
|
3
|
-
import { Typography } from './typography'
|
|
4
|
-
import { Icon, type IconType } from './icon'
|
|
5
|
-
|
|
6
|
-
const tagVariants = cva(
|
|
7
|
-
[
|
|
8
|
-
'group/tag relative h-large-2x w-fit rounded-small-1x px-small py-none flex items-center gap-small_1x-alt',
|
|
9
|
-
'transition-all duration-200'
|
|
10
|
-
],
|
|
11
|
-
{
|
|
12
|
-
variants: {
|
|
13
|
-
variant: {
|
|
14
|
-
primary:
|
|
15
|
-
'bg-primary-alt-idle text-primary-label-idle hover:bg-primary-alt-hover',
|
|
16
|
-
danger:
|
|
17
|
-
'bg-danger-alt-idle text-danger-label-idle hover:bg-danger-alt-hover',
|
|
18
|
-
neutral: 'bg-layer-1-idle text-neutral-dark hover:bg-layer-1-hover'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
defaultVariants: {
|
|
22
|
-
variant: 'primary'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
export function TagRoot({
|
|
28
|
-
className,
|
|
29
|
-
variant = 'primary',
|
|
30
|
-
disabled = false,
|
|
31
|
-
...props
|
|
32
|
-
}: ComponentProps<'div'> &
|
|
33
|
-
ClassVariantProps<typeof tagVariants> & { disabled?: boolean }) {
|
|
34
|
-
return (
|
|
35
|
-
<div
|
|
36
|
-
className={cx(tagVariants({ variant }), className)}
|
|
37
|
-
data-disabled={disabled}
|
|
38
|
-
{...props}
|
|
39
|
-
/>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function TagText({
|
|
44
|
-
variant = 'label',
|
|
45
|
-
size = 'sm-1x',
|
|
46
|
-
weight = 'medium',
|
|
47
|
-
className,
|
|
48
|
-
...props
|
|
49
|
-
}: ComponentProps<typeof Typography>) {
|
|
50
|
-
return (
|
|
51
|
-
<Typography
|
|
52
|
-
className={cx(className, 'truncate')}
|
|
53
|
-
size={size}
|
|
54
|
-
variant={variant}
|
|
55
|
-
weight={weight}
|
|
56
|
-
{...props}
|
|
57
|
-
/>
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function TagIcon({ className, ...props }: ComponentProps<typeof Icon>) {
|
|
62
|
-
return (
|
|
63
|
-
<Icon
|
|
64
|
-
className={
|
|
65
|
-
(cx(
|
|
66
|
-
'text-size-body-md',
|
|
67
|
-
'group-data-[variant=primary]:text-primary-label-idle',
|
|
68
|
-
'group-data-[variant=danger]:text-danger-label-idle',
|
|
69
|
-
'group-data-[variant=neutral]:text-icon-neutral-3'
|
|
70
|
-
),
|
|
71
|
-
className)
|
|
72
|
-
}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function TagClose({
|
|
79
|
-
className,
|
|
80
|
-
children = <TagIcon name="close" />,
|
|
81
|
-
...props
|
|
82
|
-
}: ComponentProps<'button'> & { name?: IconType }) {
|
|
83
|
-
return (
|
|
84
|
-
<button
|
|
85
|
-
className={cx(
|
|
86
|
-
className,
|
|
87
|
-
'cursor-pointer bg-inherit',
|
|
88
|
-
'invisible items-center justify-center group-hover/tag:data-[disabled=false]:visible',
|
|
89
|
-
'absolute top-0 right-0',
|
|
90
|
-
'h-large-2x w-large-2x rounded-circle',
|
|
91
|
-
'transition-[visibility] duration-200'
|
|
92
|
-
)}
|
|
93
|
-
type="button"
|
|
94
|
-
{...props}
|
|
95
|
-
>
|
|
96
|
-
{children}
|
|
97
|
-
</button>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as TooltipPrimitive from '@radix-ui/react-tooltip'
|
|
2
|
-
import { cx } from '@xjur-ui/util'
|
|
3
|
-
|
|
4
|
-
function TooltipProvider({
|
|
5
|
-
delayDuration = 0,
|
|
6
|
-
...props
|
|
7
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
|
|
8
|
-
return (
|
|
9
|
-
<TooltipPrimitive.Provider
|
|
10
|
-
data-slot="tooltip-provider"
|
|
11
|
-
delayDuration={delayDuration}
|
|
12
|
-
{...props}
|
|
13
|
-
/>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function Tooltip({
|
|
18
|
-
...props
|
|
19
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
|
|
20
|
-
return (
|
|
21
|
-
<TooltipProvider>
|
|
22
|
-
<TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
23
|
-
</TooltipProvider>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function TooltipTrigger({
|
|
28
|
-
...props
|
|
29
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
|
|
30
|
-
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function TooltipContent({
|
|
34
|
-
className,
|
|
35
|
-
sideOffset = 1,
|
|
36
|
-
variant = 'simple',
|
|
37
|
-
children,
|
|
38
|
-
...props
|
|
39
|
-
}: React.ComponentProps<typeof TooltipPrimitive.Content> & {
|
|
40
|
-
variant?: 'simple' | 'rich'
|
|
41
|
-
}) {
|
|
42
|
-
return (
|
|
43
|
-
<TooltipPrimitive.Portal>
|
|
44
|
-
<TooltipPrimitive.Content
|
|
45
|
-
className={cx(
|
|
46
|
-
'text-size-body-sm text-balance',
|
|
47
|
-
'data-[variant=simple]:bg-alt-2 data-[variant=simple]:text-neutral-label data-[variant=simple]:rounded-small-1x data-[variant=simple]:px-small data-[variant=simple]:py-small-1x',
|
|
48
|
-
'data-[variant=rich]:bg-layer-2-idle data-[variant=rich]:text-neutral-dark data-[variant=rich]:rounded-small data-[variant=rich]:border-border-layer-2 data-[variant=rich]:p-large data-[variant=rich]:border',
|
|
49
|
-
'animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin)',
|
|
50
|
-
className
|
|
51
|
-
)}
|
|
52
|
-
data-slot="tooltip-content"
|
|
53
|
-
data-variant={variant}
|
|
54
|
-
sideOffset={sideOffset}
|
|
55
|
-
{...props}
|
|
56
|
-
>
|
|
57
|
-
{children}
|
|
58
|
-
</TooltipPrimitive.Content>
|
|
59
|
-
</TooltipPrimitive.Portal>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { Slot } from '@radix-ui/react-slot'
|
|
2
|
-
import { cva, type ClassVariantProps } from '@xjur-ui/util'
|
|
3
|
-
import { memo, type ComponentProps } from 'react'
|
|
4
|
-
|
|
5
|
-
const typographyVariants = cva('', {
|
|
6
|
-
variants: {
|
|
7
|
-
variant: {
|
|
8
|
-
body: '',
|
|
9
|
-
label: '',
|
|
10
|
-
title: '',
|
|
11
|
-
headline: ''
|
|
12
|
-
},
|
|
13
|
-
size: {
|
|
14
|
-
'sm-2x': '',
|
|
15
|
-
'sm-1x': '',
|
|
16
|
-
sm: '',
|
|
17
|
-
md: '',
|
|
18
|
-
lg: ''
|
|
19
|
-
},
|
|
20
|
-
weight: {
|
|
21
|
-
thin: 'font-thin',
|
|
22
|
-
extraLight: 'font-extralight',
|
|
23
|
-
light: 'font-light',
|
|
24
|
-
normal: 'font-normal',
|
|
25
|
-
medium: 'font-medium',
|
|
26
|
-
semibold: 'font-semibold',
|
|
27
|
-
bold: 'font-bold',
|
|
28
|
-
extraBold: 'font-extrabold',
|
|
29
|
-
black: 'font-black'
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
compoundVariants: [
|
|
33
|
-
{ variant: 'body', size: 'sm-1x', class: 'text-size-body-sm-1x' },
|
|
34
|
-
{ variant: 'body', size: 'sm', class: 'text-size-body-sm' },
|
|
35
|
-
{ variant: 'body', size: 'md', class: 'text-size-body-md' },
|
|
36
|
-
{ variant: 'body', size: 'lg', class: 'text-size-body-lg' },
|
|
37
|
-
|
|
38
|
-
{ variant: 'label', size: 'sm-2x', class: 'text-size-label-sm-2x' },
|
|
39
|
-
{ variant: 'label', size: 'sm-1x', class: 'text-size-label-sm-1x' },
|
|
40
|
-
{ variant: 'label', size: 'sm', class: 'text-size-label-sm' },
|
|
41
|
-
{ variant: 'label', size: 'md', class: 'text-size-label-md' },
|
|
42
|
-
{ variant: 'label', size: 'lg', class: 'text-size-label-lg' },
|
|
43
|
-
|
|
44
|
-
{ variant: 'title', size: 'sm', class: 'text-size-title-sm' },
|
|
45
|
-
{ variant: 'title', size: 'md', class: 'text-size-title-md' },
|
|
46
|
-
{ variant: 'title', size: 'lg', class: 'text-size-title-lg' },
|
|
47
|
-
|
|
48
|
-
{ variant: 'headline', size: 'sm', class: 'text-size-headline-sm' },
|
|
49
|
-
{ variant: 'headline', size: 'md', class: 'text-size-headline-md' },
|
|
50
|
-
{ variant: 'headline', size: 'lg', class: 'text-size-headline-lg' }
|
|
51
|
-
],
|
|
52
|
-
defaultVariants: {
|
|
53
|
-
variant: 'body',
|
|
54
|
-
size: 'md',
|
|
55
|
-
weight: 'normal'
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
export interface TypographyProps
|
|
60
|
-
extends ComponentProps<'base'>,
|
|
61
|
-
ClassVariantProps<typeof typographyVariants> {
|
|
62
|
-
asChild?: boolean
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export const Typography = memo(
|
|
66
|
-
({
|
|
67
|
-
variant,
|
|
68
|
-
size,
|
|
69
|
-
weight,
|
|
70
|
-
asChild,
|
|
71
|
-
className,
|
|
72
|
-
...props
|
|
73
|
-
}: TypographyProps) => {
|
|
74
|
-
const Component = asChild ? Slot : 'span'
|
|
75
|
-
|
|
76
|
-
return (
|
|
77
|
-
<Component
|
|
78
|
-
className={typographyVariants({ variant, size, weight, className })}
|
|
79
|
-
{...props}
|
|
80
|
-
/>
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
Typography.displayName = 'Typography'
|