@rark-ui/themes 1.2.0 → 1.2.2
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/dist/.tsbuildinfo +1 -1
- package/dist/default/crafts/message.js +1 -1
- package/dist/default/crafts/toast.js +1 -1
- package/dist/default/index.css +0 -239
- package/dist/razer/index.css +4 -329
- package/package.json +11 -8
- package/src/default/crafts/badge.ts +56 -56
- package/src/default/crafts/button.ts +68 -68
- package/src/default/crafts/checkbox.ts +75 -75
- package/src/default/crafts/collapsible.ts +61 -61
- package/src/default/crafts/date-picker.ts +261 -261
- package/src/default/crafts/dialog.ts +103 -103
- package/src/default/crafts/editable.ts +108 -108
- package/src/default/crafts/floating-panel.ts +71 -71
- package/src/default/crafts/hotkey.ts +24 -24
- package/src/default/crafts/hover-card.ts +83 -83
- package/src/default/crafts/icon.ts +15 -15
- package/src/default/crafts/index.ts +62 -62
- package/src/default/crafts/input.ts +50 -50
- package/src/default/crafts/menu.ts +118 -118
- package/src/default/crafts/message.ts +66 -66
- package/src/default/crafts/number-input.ts +51 -51
- package/src/default/crafts/pagination.ts +120 -120
- package/src/default/crafts/popover.ts +74 -74
- package/src/default/crafts/progress.ts +131 -131
- package/src/default/crafts/radio-group.ts +100 -100
- package/src/default/crafts/rating-group.ts +46 -46
- package/src/default/crafts/scroll-area.ts +116 -116
- package/src/default/crafts/select.ts +122 -122
- package/src/default/crafts/skeleton.ts +23 -23
- package/src/default/crafts/slider.ts +93 -93
- package/src/default/crafts/spin.ts +64 -64
- package/src/default/crafts/switch.ts +71 -71
- package/src/default/crafts/tabs.ts +122 -122
- package/src/default/crafts/tags-input.ts +81 -81
- package/src/default/crafts/toast.ts +70 -70
- package/src/default/crafts/toggle-group.ts +57 -57
- package/src/default/crafts/toggle.ts +34 -34
- package/src/default/crafts/tooltip.ts +63 -63
- package/src/default/crafts/tree.ts +165 -165
- package/src/default/index.ts +4 -4
- package/src/default/tailwind.config.ts +2 -0
- package/src/razer/components/arrow.css +19 -19
- package/src/razer/components/badge.css +12 -12
- package/src/razer/components/button.css +39 -39
- package/src/razer/components/checkbox.css +39 -39
- package/src/razer/components/collapsible.css +16 -16
- package/src/razer/components/date-picker.css +46 -46
- package/src/razer/components/dialog.css +28 -28
- package/src/razer/components/editable.css +26 -26
- package/src/razer/components/floating-panel.css +10 -10
- package/src/razer/components/hotkey.css +4 -4
- package/src/razer/components/hover-card.css +14 -14
- package/src/razer/components/input.css +29 -29
- package/src/razer/components/menu.css +47 -47
- package/src/razer/components/message.css +41 -41
- package/src/razer/components/number-input.css +8 -8
- package/src/razer/components/pagination.css +13 -13
- package/src/razer/components/popover.css +19 -19
- package/src/razer/components/progress.css +78 -78
- package/src/razer/components/radio-group.css +44 -44
- package/src/razer/components/rating-group.css +26 -26
- package/src/razer/components/scroll-area.css +13 -13
- package/src/razer/components/select.css +31 -31
- package/src/razer/components/skeleton.css +10 -10
- package/src/razer/components/slider.css +27 -27
- package/src/razer/components/spin.css +14 -14
- package/src/razer/components/switch.css +24 -24
- package/src/razer/components/tabs.css +10 -10
- package/src/razer/components/tags-input.css +16 -16
- package/src/razer/components/toast.css +41 -41
- package/src/razer/components/toggle-group.css +19 -19
- package/src/razer/components/toggle.css +16 -16
- package/src/razer/components/tooltip.css +16 -16
- package/src/razer/components/tree.css +18 -18
- package/src/razer/components/virtual.css +16 -16
- package/src/razer/crafts/index.ts +16 -16
- package/src/razer/index.ts +4 -4
- package/src/razer/preset.css +261 -261
- package/src/razer/tailwind.config.ts +2 -0
- package/src/shared/css/animation-easing.css +21 -21
- package/src/shared/css/animations.css +252 -252
- package/src/shared/css/index.css +2 -2
- package/src/shared/css/static.css +31 -31
- package/src/shared/utils/tv.ts +91 -91
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
-
import { tv } from '../../shared/utils/tv'
|
|
3
|
-
|
|
4
|
-
const prefix = 'rui-hover-card'
|
|
5
|
-
|
|
6
|
-
export const tvHoverCard = tv(
|
|
7
|
-
{
|
|
8
|
-
slots: {
|
|
9
|
-
content: [
|
|
10
|
-
'rounded-(--border-radius)',
|
|
11
|
-
'data-[state=open]:motion-opacity-in',
|
|
12
|
-
'data-[state=open]:motion-scale-in-95',
|
|
13
|
-
'data-[state=open]:data-[placement^=bottom]:motion-translate-y-in-[.25rem]',
|
|
14
|
-
'data-[state=open]:data-[placement^=top]:-motion-translate-y-in-[.25rem]',
|
|
15
|
-
'data-[state=open]:data-[placement^=left]:-motion-translate-x-in-[.25rem]',
|
|
16
|
-
'data-[state=open]:data-[placement^=right]:motion-translate-x-in-[.25rem]',
|
|
17
|
-
'data-[state=closed]:motion-opacity-out',
|
|
18
|
-
'data-[state=closed]:motion-scale-out-95',
|
|
19
|
-
'data-[state=closed]:data-[placement^=bottom]:motion-translate-y-out-[.25rem]',
|
|
20
|
-
'data-[state=closed]:data-[placement^=top]:-motion-translate-y-out-[.25rem]',
|
|
21
|
-
'data-[state=closed]:data-[placement^=left]:-motion-translate-x-out-[.25rem]',
|
|
22
|
-
'data-[state=closed]:data-[placement^=right]:motion-translate-x-out-[.25rem]',
|
|
23
|
-
],
|
|
24
|
-
contentInner: ['relative', 'rounded-(--border-radius)', 'z-10'],
|
|
25
|
-
},
|
|
26
|
-
variants: {
|
|
27
|
-
size: {
|
|
28
|
-
xs: '',
|
|
29
|
-
sm: '',
|
|
30
|
-
base: '',
|
|
31
|
-
lg: '',
|
|
32
|
-
},
|
|
33
|
-
bordered: {
|
|
34
|
-
true: '',
|
|
35
|
-
false: '',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
defaultVariants: {
|
|
39
|
-
size: 'base',
|
|
40
|
-
bordered: true,
|
|
41
|
-
},
|
|
42
|
-
compoundVariants: [
|
|
43
|
-
{
|
|
44
|
-
size: 'xs',
|
|
45
|
-
class: {
|
|
46
|
-
contentInner: 'px-1.5 py-0.5 text-xs',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
size: 'sm',
|
|
51
|
-
class: {
|
|
52
|
-
contentInner: 'px-2 py-1 text-sm',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
size: 'base',
|
|
57
|
-
class: {
|
|
58
|
-
contentInner: 'px-2.5 py-1.5 text-base',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
size: 'lg',
|
|
63
|
-
class: {
|
|
64
|
-
contentInner: 'px-3 py-2 text-lg',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
bordered: true,
|
|
69
|
-
class: {
|
|
70
|
-
content: 'border',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
slots: {
|
|
77
|
-
content: `${prefix}-content`,
|
|
78
|
-
contentInner: `${prefix}-content-inner`,
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
export type HoverCardVariants = VariantProps<typeof tvHoverCard>
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-hover-card'
|
|
5
|
+
|
|
6
|
+
export const tvHoverCard = tv(
|
|
7
|
+
{
|
|
8
|
+
slots: {
|
|
9
|
+
content: [
|
|
10
|
+
'rounded-(--border-radius)',
|
|
11
|
+
'data-[state=open]:motion-opacity-in',
|
|
12
|
+
'data-[state=open]:motion-scale-in-95',
|
|
13
|
+
'data-[state=open]:data-[placement^=bottom]:motion-translate-y-in-[.25rem]',
|
|
14
|
+
'data-[state=open]:data-[placement^=top]:-motion-translate-y-in-[.25rem]',
|
|
15
|
+
'data-[state=open]:data-[placement^=left]:-motion-translate-x-in-[.25rem]',
|
|
16
|
+
'data-[state=open]:data-[placement^=right]:motion-translate-x-in-[.25rem]',
|
|
17
|
+
'data-[state=closed]:motion-opacity-out',
|
|
18
|
+
'data-[state=closed]:motion-scale-out-95',
|
|
19
|
+
'data-[state=closed]:data-[placement^=bottom]:motion-translate-y-out-[.25rem]',
|
|
20
|
+
'data-[state=closed]:data-[placement^=top]:-motion-translate-y-out-[.25rem]',
|
|
21
|
+
'data-[state=closed]:data-[placement^=left]:-motion-translate-x-out-[.25rem]',
|
|
22
|
+
'data-[state=closed]:data-[placement^=right]:motion-translate-x-out-[.25rem]',
|
|
23
|
+
],
|
|
24
|
+
contentInner: ['relative', 'rounded-(--border-radius)', 'z-10'],
|
|
25
|
+
},
|
|
26
|
+
variants: {
|
|
27
|
+
size: {
|
|
28
|
+
xs: '',
|
|
29
|
+
sm: '',
|
|
30
|
+
base: '',
|
|
31
|
+
lg: '',
|
|
32
|
+
},
|
|
33
|
+
bordered: {
|
|
34
|
+
true: '',
|
|
35
|
+
false: '',
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
defaultVariants: {
|
|
39
|
+
size: 'base',
|
|
40
|
+
bordered: true,
|
|
41
|
+
},
|
|
42
|
+
compoundVariants: [
|
|
43
|
+
{
|
|
44
|
+
size: 'xs',
|
|
45
|
+
class: {
|
|
46
|
+
contentInner: 'px-1.5 py-0.5 text-xs',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
size: 'sm',
|
|
51
|
+
class: {
|
|
52
|
+
contentInner: 'px-2 py-1 text-sm',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
size: 'base',
|
|
57
|
+
class: {
|
|
58
|
+
contentInner: 'px-2.5 py-1.5 text-base',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
size: 'lg',
|
|
63
|
+
class: {
|
|
64
|
+
contentInner: 'px-3 py-2 text-lg',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
bordered: true,
|
|
69
|
+
class: {
|
|
70
|
+
content: 'border',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
slots: {
|
|
77
|
+
content: `${prefix}-content`,
|
|
78
|
+
contentInner: `${prefix}-content-inner`,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
export type HoverCardVariants = VariantProps<typeof tvHoverCard>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
-
import { tv } from '../../shared/utils/tv'
|
|
3
|
-
|
|
4
|
-
const prefix = 'rui-icon'
|
|
5
|
-
|
|
6
|
-
export const tvIcon = tv(
|
|
7
|
-
{
|
|
8
|
-
base: 'size-[1lh]',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
class: prefix,
|
|
12
|
-
},
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
export type IconVariants = VariantProps<typeof tvIcon>
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-icon'
|
|
5
|
+
|
|
6
|
+
export const tvIcon = tv(
|
|
7
|
+
{
|
|
8
|
+
base: 'size-[1lh]',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
class: prefix,
|
|
12
|
+
},
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
export type IconVariants = VariantProps<typeof tvIcon>
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
export { type BadgeVariants, tvBadge } from './badge'
|
|
2
|
-
export { type ButtonVariants, tvButton } from './button'
|
|
3
|
-
export { type CheckboxVariants, tvCheckbox } from './checkbox'
|
|
4
|
-
export {
|
|
5
|
-
type CollapsibleVariants,
|
|
6
|
-
type ReadMoreVariants,
|
|
7
|
-
tvCollapsible,
|
|
8
|
-
tvReadMore,
|
|
9
|
-
} from './collapsible'
|
|
10
|
-
export {
|
|
11
|
-
type DatePickerVariants,
|
|
12
|
-
type DatePickerViewVariants,
|
|
13
|
-
tvDatePicker,
|
|
14
|
-
tvDatePickerView,
|
|
15
|
-
} from './date-picker'
|
|
16
|
-
export { type DialogVariants, tvDialog } from './dialog'
|
|
17
|
-
export {
|
|
18
|
-
type EditableInputVariants,
|
|
19
|
-
type EditableVariants,
|
|
20
|
-
tvEditable,
|
|
21
|
-
tvEditableInput,
|
|
22
|
-
} from './editable'
|
|
23
|
-
export { type FloatingPanelVariants, tvFloatingPanel } from './floating-panel'
|
|
24
|
-
export { type HotkeyVariants, tvHotkey } from './hotkey'
|
|
25
|
-
export { type HoverCardVariants, tvHoverCard } from './hover-card'
|
|
26
|
-
export { type IconVariants, tvIcon } from './icon'
|
|
27
|
-
export { type InputVariants, tvInput } from './input'
|
|
28
|
-
export { type MenuVariants, tvMenu } from './menu'
|
|
29
|
-
export { type MessageVariants, tvMessage } from './message'
|
|
30
|
-
export { type NumberInputVariants, tvNumberInput } from './number-input'
|
|
31
|
-
export {
|
|
32
|
-
type PaginationGotoVariants,
|
|
33
|
-
type PaginationPageSizeVariants,
|
|
34
|
-
type PaginationVariants,
|
|
35
|
-
tvPagination,
|
|
36
|
-
tvPaginationGoto,
|
|
37
|
-
tvPaginationPageSize,
|
|
38
|
-
} from './pagination'
|
|
39
|
-
export { type PopoverVariants, tvPopover } from './popover'
|
|
40
|
-
export { type ProgressVariants, tvProgress } from './progress'
|
|
41
|
-
export { type RadioGroupVariants, tvRadioGroup } from './radio-group'
|
|
42
|
-
export { type RatingGroupVariants, tvRatingGroup } from './rating-group'
|
|
43
|
-
export { type ScrollAreaVariants, tvScrollArea } from './scroll-area'
|
|
44
|
-
export { type SelectVariants, tvSelect } from './select'
|
|
45
|
-
export { type SkeletonVariants, tvSkeleton } from './skeleton'
|
|
46
|
-
export { type SliderVariants, tvSlider } from './slider'
|
|
47
|
-
export { type SpinVariants, tvSpin } from './spin'
|
|
48
|
-
export { type SwitchVariants, tvSwitch } from './switch'
|
|
49
|
-
export { type TabsVariants, tvTabs } from './tabs'
|
|
50
|
-
export { type TagsInputVariants, tvTagsInput } from './tags-input'
|
|
51
|
-
export { type ToastVariants, tvToast } from './toast'
|
|
52
|
-
export { type ToggleVariants, tvToggle } from './toggle'
|
|
53
|
-
export { type ToggleGroupVariants, tvToggleGroup } from './toggle-group'
|
|
54
|
-
export { type TooltipVariants, tvTooltip } from './tooltip'
|
|
55
|
-
export {
|
|
56
|
-
type TreeBranchVariants,
|
|
57
|
-
type TreeItemVariants,
|
|
58
|
-
type TreeVariants,
|
|
59
|
-
tvTree,
|
|
60
|
-
tvTreeBranch,
|
|
61
|
-
tvTreeItem,
|
|
62
|
-
} from './tree'
|
|
1
|
+
export { type BadgeVariants, tvBadge } from './badge'
|
|
2
|
+
export { type ButtonVariants, tvButton } from './button'
|
|
3
|
+
export { type CheckboxVariants, tvCheckbox } from './checkbox'
|
|
4
|
+
export {
|
|
5
|
+
type CollapsibleVariants,
|
|
6
|
+
type ReadMoreVariants,
|
|
7
|
+
tvCollapsible,
|
|
8
|
+
tvReadMore,
|
|
9
|
+
} from './collapsible'
|
|
10
|
+
export {
|
|
11
|
+
type DatePickerVariants,
|
|
12
|
+
type DatePickerViewVariants,
|
|
13
|
+
tvDatePicker,
|
|
14
|
+
tvDatePickerView,
|
|
15
|
+
} from './date-picker'
|
|
16
|
+
export { type DialogVariants, tvDialog } from './dialog'
|
|
17
|
+
export {
|
|
18
|
+
type EditableInputVariants,
|
|
19
|
+
type EditableVariants,
|
|
20
|
+
tvEditable,
|
|
21
|
+
tvEditableInput,
|
|
22
|
+
} from './editable'
|
|
23
|
+
export { type FloatingPanelVariants, tvFloatingPanel } from './floating-panel'
|
|
24
|
+
export { type HotkeyVariants, tvHotkey } from './hotkey'
|
|
25
|
+
export { type HoverCardVariants, tvHoverCard } from './hover-card'
|
|
26
|
+
export { type IconVariants, tvIcon } from './icon'
|
|
27
|
+
export { type InputVariants, tvInput } from './input'
|
|
28
|
+
export { type MenuVariants, tvMenu } from './menu'
|
|
29
|
+
export { type MessageVariants, tvMessage } from './message'
|
|
30
|
+
export { type NumberInputVariants, tvNumberInput } from './number-input'
|
|
31
|
+
export {
|
|
32
|
+
type PaginationGotoVariants,
|
|
33
|
+
type PaginationPageSizeVariants,
|
|
34
|
+
type PaginationVariants,
|
|
35
|
+
tvPagination,
|
|
36
|
+
tvPaginationGoto,
|
|
37
|
+
tvPaginationPageSize,
|
|
38
|
+
} from './pagination'
|
|
39
|
+
export { type PopoverVariants, tvPopover } from './popover'
|
|
40
|
+
export { type ProgressVariants, tvProgress } from './progress'
|
|
41
|
+
export { type RadioGroupVariants, tvRadioGroup } from './radio-group'
|
|
42
|
+
export { type RatingGroupVariants, tvRatingGroup } from './rating-group'
|
|
43
|
+
export { type ScrollAreaVariants, tvScrollArea } from './scroll-area'
|
|
44
|
+
export { type SelectVariants, tvSelect } from './select'
|
|
45
|
+
export { type SkeletonVariants, tvSkeleton } from './skeleton'
|
|
46
|
+
export { type SliderVariants, tvSlider } from './slider'
|
|
47
|
+
export { type SpinVariants, tvSpin } from './spin'
|
|
48
|
+
export { type SwitchVariants, tvSwitch } from './switch'
|
|
49
|
+
export { type TabsVariants, tvTabs } from './tabs'
|
|
50
|
+
export { type TagsInputVariants, tvTagsInput } from './tags-input'
|
|
51
|
+
export { type ToastVariants, tvToast } from './toast'
|
|
52
|
+
export { type ToggleVariants, tvToggle } from './toggle'
|
|
53
|
+
export { type ToggleGroupVariants, tvToggleGroup } from './toggle-group'
|
|
54
|
+
export { type TooltipVariants, tvTooltip } from './tooltip'
|
|
55
|
+
export {
|
|
56
|
+
type TreeBranchVariants,
|
|
57
|
+
type TreeItemVariants,
|
|
58
|
+
type TreeVariants,
|
|
59
|
+
tvTree,
|
|
60
|
+
tvTreeBranch,
|
|
61
|
+
tvTreeItem,
|
|
62
|
+
} from './tree'
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
-
import { tv } from '../../shared/utils/tv'
|
|
3
|
-
|
|
4
|
-
const prefix = 'rui-input'
|
|
5
|
-
|
|
6
|
-
export const tvInput = tv({
|
|
7
|
-
slots: {
|
|
8
|
-
root: [
|
|
9
|
-
'flex',
|
|
10
|
-
'items-center',
|
|
11
|
-
'min-w-0',
|
|
12
|
-
'border',
|
|
13
|
-
'rounded',
|
|
14
|
-
'transition-all',
|
|
15
|
-
'data-[state=disabled]:pointer-events-none',
|
|
16
|
-
'data-[state=disabled]:opacity-(--disabled-opacity)',
|
|
17
|
-
],
|
|
18
|
-
input: ['flex-1', 'w-0', 'outline-hidden', 'border-none', 'bg-transparent'],
|
|
19
|
-
clearable: ['size-[1lh]', 'flex', 'items-center', 'justify-center'],
|
|
20
|
-
},
|
|
21
|
-
variants: {
|
|
22
|
-
size: {
|
|
23
|
-
xs: {
|
|
24
|
-
root: 'px-2 py-1.5 gap-1.5 text-xs',
|
|
25
|
-
input: 'placeholder:text-xs',
|
|
26
|
-
},
|
|
27
|
-
sm: {
|
|
28
|
-
root: 'px-2 py-1.5 gap-2 text-sm',
|
|
29
|
-
input: 'placeholder:text-sm',
|
|
30
|
-
},
|
|
31
|
-
base: {
|
|
32
|
-
root: 'px-2 py-2 gap-2.5 text-base',
|
|
33
|
-
input: 'placeholder:text-base',
|
|
34
|
-
},
|
|
35
|
-
lg: {
|
|
36
|
-
root: 'px-2 py-2.5 gap-3 text-lg',
|
|
37
|
-
input: 'placeholder:text-lg',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
defaultVariants: { size: 'base' },
|
|
42
|
-
}, {
|
|
43
|
-
slots: {
|
|
44
|
-
root: prefix,
|
|
45
|
-
input: `${prefix}-input`,
|
|
46
|
-
clearable: `${prefix}-clearable`,
|
|
47
|
-
},
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
export type InputVariants = VariantProps<typeof tvInput>
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-input'
|
|
5
|
+
|
|
6
|
+
export const tvInput = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
root: [
|
|
9
|
+
'flex',
|
|
10
|
+
'items-center',
|
|
11
|
+
'min-w-0',
|
|
12
|
+
'border',
|
|
13
|
+
'rounded',
|
|
14
|
+
'transition-all',
|
|
15
|
+
'data-[state=disabled]:pointer-events-none',
|
|
16
|
+
'data-[state=disabled]:opacity-(--disabled-opacity)',
|
|
17
|
+
],
|
|
18
|
+
input: ['flex-1', 'w-0', 'outline-hidden', 'border-none', 'bg-transparent'],
|
|
19
|
+
clearable: ['size-[1lh]', 'flex', 'items-center', 'justify-center'],
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
size: {
|
|
23
|
+
xs: {
|
|
24
|
+
root: 'px-2 py-1.5 gap-1.5 text-xs',
|
|
25
|
+
input: 'placeholder:text-xs',
|
|
26
|
+
},
|
|
27
|
+
sm: {
|
|
28
|
+
root: 'px-2 py-1.5 gap-2 text-sm',
|
|
29
|
+
input: 'placeholder:text-sm',
|
|
30
|
+
},
|
|
31
|
+
base: {
|
|
32
|
+
root: 'px-2 py-2 gap-2.5 text-base',
|
|
33
|
+
input: 'placeholder:text-base',
|
|
34
|
+
},
|
|
35
|
+
lg: {
|
|
36
|
+
root: 'px-2 py-2.5 gap-3 text-lg',
|
|
37
|
+
input: 'placeholder:text-lg',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
defaultVariants: { size: 'base' },
|
|
42
|
+
}, {
|
|
43
|
+
slots: {
|
|
44
|
+
root: prefix,
|
|
45
|
+
input: `${prefix}-input`,
|
|
46
|
+
clearable: `${prefix}-clearable`,
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export type InputVariants = VariantProps<typeof tvInput>
|
|
@@ -1,118 +1,118 @@
|
|
|
1
|
-
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
-
import { tv } from '../../shared/utils/tv'
|
|
3
|
-
|
|
4
|
-
const prefix = 'rui-menu'
|
|
5
|
-
|
|
6
|
-
export const tvMenu = tv(
|
|
7
|
-
{
|
|
8
|
-
slots: {
|
|
9
|
-
root: '',
|
|
10
|
-
content: [
|
|
11
|
-
'rounded-(--border-radius)',
|
|
12
|
-
'data-[state=open]:motion-opacity-in',
|
|
13
|
-
'data-[state=open]:motion-scale-in-95',
|
|
14
|
-
'data-[state=open]:data-[placement^=bottom]:motion-translate-y-in-[.25rem]',
|
|
15
|
-
'data-[state=open]:data-[placement^=top]:-motion-translate-y-in-[.25rem]',
|
|
16
|
-
'data-[state=open]:data-[placement^=left]:-motion-translate-x-in-[.25rem]',
|
|
17
|
-
'data-[state=open]:data-[placement^=right]:motion-translate-x-in-[.25rem]',
|
|
18
|
-
'data-[state=closed]:motion-opacity-out',
|
|
19
|
-
'data-[state=closed]:motion-scale-out-95',
|
|
20
|
-
'data-[state=closed]:data-[placement^=bottom]:motion-translate-y-out-[.25rem]',
|
|
21
|
-
'data-[state=closed]:data-[placement^=top]:-motion-translate-y-out-[.25rem]',
|
|
22
|
-
'data-[state=closed]:data-[placement^=left]:-motion-translate-x-out-[.25rem]',
|
|
23
|
-
'data-[state=closed]:data-[placement^=right]:motion-translate-x-out-[.25rem]',
|
|
24
|
-
],
|
|
25
|
-
contentInner: [
|
|
26
|
-
'relative',
|
|
27
|
-
'rounded-(--border-radius)',
|
|
28
|
-
'z-10',
|
|
29
|
-
'min-w-(--reference-width)',
|
|
30
|
-
],
|
|
31
|
-
item: [
|
|
32
|
-
'relative',
|
|
33
|
-
'flex',
|
|
34
|
-
'items-center',
|
|
35
|
-
'rounded',
|
|
36
|
-
'cursor-pointer',
|
|
37
|
-
'transition-colors',
|
|
38
|
-
'data-[disabled]:pointer-events-none',
|
|
39
|
-
'data-[disabled]:opacity-(--disabled-opacity)',
|
|
40
|
-
],
|
|
41
|
-
itemGroup: '',
|
|
42
|
-
itemGroupLabel: 'relative border-b',
|
|
43
|
-
triggerItem: 'justify-between',
|
|
44
|
-
triggerItemIndicator: [
|
|
45
|
-
'transition-transform',
|
|
46
|
-
'data-[state=open]:rotate-180',
|
|
47
|
-
],
|
|
48
|
-
radioItem: 'justify-between',
|
|
49
|
-
},
|
|
50
|
-
variants: {
|
|
51
|
-
size: {
|
|
52
|
-
xs: '',
|
|
53
|
-
sm: '',
|
|
54
|
-
base: '',
|
|
55
|
-
lg: '',
|
|
56
|
-
},
|
|
57
|
-
bordered: {
|
|
58
|
-
true: '',
|
|
59
|
-
false: '',
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
compoundVariants: [
|
|
63
|
-
{
|
|
64
|
-
size: 'xs',
|
|
65
|
-
class: {
|
|
66
|
-
contentInner: 'px-1.5 py-1',
|
|
67
|
-
item: 'text-xs px-1.5 py-1 gap-1.5',
|
|
68
|
-
itemGroupLabel: 'text-xs px-1.5 py-1.5 mb-0.5',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
size: 'sm',
|
|
73
|
-
class: {
|
|
74
|
-
contentInner: 'px-2 py-1.5',
|
|
75
|
-
item: 'text-sm px-2 py-1.5 gap-2',
|
|
76
|
-
itemGroupLabel: 'text-sm px-2 py-2 mb-1',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
size: 'base',
|
|
81
|
-
class: {
|
|
82
|
-
contentInner: 'px-2.5 py-2',
|
|
83
|
-
item: 'text-base px-2.5 py-2 gap-2.5',
|
|
84
|
-
itemGroupLabel: 'text-base px-2.5 py-2.5 mb-1.5',
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
size: 'lg',
|
|
89
|
-
class: {
|
|
90
|
-
contentInner: 'px-3 py-2.5',
|
|
91
|
-
item: 'text-lg px-3 py-2.5 gap-3',
|
|
92
|
-
itemGroupLabel: 'text-xl px-3 py-3 mb-2',
|
|
93
|
-
},
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
bordered: true,
|
|
97
|
-
class: {
|
|
98
|
-
content: 'border',
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
defaultVariants: { size: 'base', bordered: true },
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
slots: {
|
|
106
|
-
root: prefix,
|
|
107
|
-
content: `${prefix}-content`,
|
|
108
|
-
contentInner: `${prefix}-content-inner`,
|
|
109
|
-
item: `${prefix}-item`,
|
|
110
|
-
itemGroup: `${prefix}-item-group`,
|
|
111
|
-
itemGroupLabel: `${prefix}-item-group-label`,
|
|
112
|
-
triggerItem: `${prefix}-trigger-item`,
|
|
113
|
-
triggerItemIndicator: `${prefix}-trigger-item-indicator`,
|
|
114
|
-
radioItem: `${prefix}-radio-item`,
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
)
|
|
118
|
-
export type MenuVariants = VariantProps<typeof tvMenu>
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-menu'
|
|
5
|
+
|
|
6
|
+
export const tvMenu = tv(
|
|
7
|
+
{
|
|
8
|
+
slots: {
|
|
9
|
+
root: '',
|
|
10
|
+
content: [
|
|
11
|
+
'rounded-(--border-radius)',
|
|
12
|
+
'data-[state=open]:motion-opacity-in',
|
|
13
|
+
'data-[state=open]:motion-scale-in-95',
|
|
14
|
+
'data-[state=open]:data-[placement^=bottom]:motion-translate-y-in-[.25rem]',
|
|
15
|
+
'data-[state=open]:data-[placement^=top]:-motion-translate-y-in-[.25rem]',
|
|
16
|
+
'data-[state=open]:data-[placement^=left]:-motion-translate-x-in-[.25rem]',
|
|
17
|
+
'data-[state=open]:data-[placement^=right]:motion-translate-x-in-[.25rem]',
|
|
18
|
+
'data-[state=closed]:motion-opacity-out',
|
|
19
|
+
'data-[state=closed]:motion-scale-out-95',
|
|
20
|
+
'data-[state=closed]:data-[placement^=bottom]:motion-translate-y-out-[.25rem]',
|
|
21
|
+
'data-[state=closed]:data-[placement^=top]:-motion-translate-y-out-[.25rem]',
|
|
22
|
+
'data-[state=closed]:data-[placement^=left]:-motion-translate-x-out-[.25rem]',
|
|
23
|
+
'data-[state=closed]:data-[placement^=right]:motion-translate-x-out-[.25rem]',
|
|
24
|
+
],
|
|
25
|
+
contentInner: [
|
|
26
|
+
'relative',
|
|
27
|
+
'rounded-(--border-radius)',
|
|
28
|
+
'z-10',
|
|
29
|
+
'min-w-(--reference-width)',
|
|
30
|
+
],
|
|
31
|
+
item: [
|
|
32
|
+
'relative',
|
|
33
|
+
'flex',
|
|
34
|
+
'items-center',
|
|
35
|
+
'rounded',
|
|
36
|
+
'cursor-pointer',
|
|
37
|
+
'transition-colors',
|
|
38
|
+
'data-[disabled]:pointer-events-none',
|
|
39
|
+
'data-[disabled]:opacity-(--disabled-opacity)',
|
|
40
|
+
],
|
|
41
|
+
itemGroup: '',
|
|
42
|
+
itemGroupLabel: 'relative border-b',
|
|
43
|
+
triggerItem: 'justify-between',
|
|
44
|
+
triggerItemIndicator: [
|
|
45
|
+
'transition-transform',
|
|
46
|
+
'data-[state=open]:rotate-180',
|
|
47
|
+
],
|
|
48
|
+
radioItem: 'justify-between',
|
|
49
|
+
},
|
|
50
|
+
variants: {
|
|
51
|
+
size: {
|
|
52
|
+
xs: '',
|
|
53
|
+
sm: '',
|
|
54
|
+
base: '',
|
|
55
|
+
lg: '',
|
|
56
|
+
},
|
|
57
|
+
bordered: {
|
|
58
|
+
true: '',
|
|
59
|
+
false: '',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
compoundVariants: [
|
|
63
|
+
{
|
|
64
|
+
size: 'xs',
|
|
65
|
+
class: {
|
|
66
|
+
contentInner: 'px-1.5 py-1',
|
|
67
|
+
item: 'text-xs px-1.5 py-1 gap-1.5',
|
|
68
|
+
itemGroupLabel: 'text-xs px-1.5 py-1.5 mb-0.5',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
size: 'sm',
|
|
73
|
+
class: {
|
|
74
|
+
contentInner: 'px-2 py-1.5',
|
|
75
|
+
item: 'text-sm px-2 py-1.5 gap-2',
|
|
76
|
+
itemGroupLabel: 'text-sm px-2 py-2 mb-1',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
size: 'base',
|
|
81
|
+
class: {
|
|
82
|
+
contentInner: 'px-2.5 py-2',
|
|
83
|
+
item: 'text-base px-2.5 py-2 gap-2.5',
|
|
84
|
+
itemGroupLabel: 'text-base px-2.5 py-2.5 mb-1.5',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
size: 'lg',
|
|
89
|
+
class: {
|
|
90
|
+
contentInner: 'px-3 py-2.5',
|
|
91
|
+
item: 'text-lg px-3 py-2.5 gap-3',
|
|
92
|
+
itemGroupLabel: 'text-xl px-3 py-3 mb-2',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
bordered: true,
|
|
97
|
+
class: {
|
|
98
|
+
content: 'border',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
defaultVariants: { size: 'base', bordered: true },
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
slots: {
|
|
106
|
+
root: prefix,
|
|
107
|
+
content: `${prefix}-content`,
|
|
108
|
+
contentInner: `${prefix}-content-inner`,
|
|
109
|
+
item: `${prefix}-item`,
|
|
110
|
+
itemGroup: `${prefix}-item-group`,
|
|
111
|
+
itemGroupLabel: `${prefix}-item-group-label`,
|
|
112
|
+
triggerItem: `${prefix}-trigger-item`,
|
|
113
|
+
triggerItemIndicator: `${prefix}-trigger-item-indicator`,
|
|
114
|
+
radioItem: `${prefix}-radio-item`,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
)
|
|
118
|
+
export type MenuVariants = VariantProps<typeof tvMenu>
|