@rark-ui/themes 1.1.0 → 1.2.1
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 -0
- package/dist/default/crafts/message.js +1 -1
- package/dist/default/crafts/toast.js +1 -1
- package/dist/razer/index.css +4 -4
- package/package.json +10 -8
- package/src/default/crafts/badge.ts +56 -0
- package/src/default/crafts/button.ts +68 -0
- package/src/default/crafts/checkbox.ts +75 -0
- package/src/default/crafts/collapsible.ts +61 -0
- package/src/default/crafts/date-picker.ts +261 -0
- package/src/default/crafts/dialog.ts +103 -0
- package/src/default/crafts/editable.ts +108 -0
- package/src/default/crafts/floating-panel.ts +71 -0
- package/src/default/crafts/hotkey.ts +24 -0
- package/src/default/crafts/hover-card.ts +83 -0
- package/src/default/crafts/icon.ts +15 -0
- package/src/default/crafts/index.ts +62 -0
- package/src/default/crafts/input.ts +50 -0
- package/src/default/crafts/menu.ts +118 -0
- package/src/default/crafts/message.ts +66 -0
- package/src/default/crafts/number-input.ts +51 -0
- package/src/default/crafts/pagination.ts +120 -0
- package/src/default/crafts/popover.ts +74 -0
- package/src/default/crafts/progress.ts +131 -0
- package/src/default/crafts/radio-group.ts +100 -0
- package/src/default/crafts/rating-group.ts +46 -0
- package/src/default/crafts/scroll-area.ts +116 -0
- package/src/default/crafts/select.ts +122 -0
- package/src/default/crafts/skeleton.ts +23 -0
- package/src/default/crafts/slider.ts +93 -0
- package/src/default/crafts/spin.ts +64 -0
- package/src/default/crafts/switch.ts +71 -0
- package/src/default/crafts/tabs.ts +122 -0
- package/src/default/crafts/tags-input.ts +81 -0
- package/src/default/crafts/toast.ts +70 -0
- package/src/default/crafts/toggle-group.ts +57 -0
- package/src/default/crafts/toggle.ts +34 -0
- package/src/default/crafts/tooltip.ts +63 -0
- package/src/default/crafts/tree.ts +165 -0
- package/src/default/index.css +3 -0
- package/src/default/index.ts +4 -0
- package/src/default/tailwind.config.ts +9 -0
- package/src/razer/components/arrow.css +20 -0
- package/src/razer/components/badge.css +13 -0
- package/src/razer/components/button.css +40 -0
- package/src/razer/components/checkbox.css +39 -0
- package/src/razer/components/collapsible.css +16 -0
- package/src/razer/components/date-picker.css +46 -0
- package/src/razer/components/dialog.css +29 -0
- package/src/razer/components/editable.css +27 -0
- package/src/razer/components/floating-panel.css +11 -0
- package/src/razer/components/hotkey.css +5 -0
- package/src/razer/components/hover-card.css +14 -0
- package/src/razer/components/input.css +29 -0
- package/src/razer/components/menu.css +47 -0
- package/src/razer/components/message.css +41 -0
- package/src/razer/components/number-input.css +9 -0
- package/src/razer/components/pagination.css +14 -0
- package/src/razer/components/popover.css +19 -0
- package/src/razer/components/progress.css +78 -0
- package/src/razer/components/radio-group.css +44 -0
- package/src/razer/components/rating-group.css +26 -0
- package/src/razer/components/scroll-area.css +14 -0
- package/src/razer/components/select.css +31 -0
- package/src/razer/components/skeleton.css +11 -0
- package/src/razer/components/slider.css +27 -0
- package/src/razer/components/spin.css +15 -0
- package/src/razer/components/switch.css +24 -0
- package/src/razer/components/tabs.css +11 -0
- package/src/razer/components/tags-input.css +16 -0
- package/src/razer/components/toast.css +41 -0
- package/src/razer/components/toggle-group.css +19 -0
- package/src/razer/components/toggle.css +17 -0
- package/src/razer/components/tooltip.css +16 -0
- package/src/razer/components/tree.css +19 -0
- package/src/razer/components/virtual.css +17 -0
- package/src/razer/components.css +33 -0
- package/src/razer/crafts/index.ts +16 -0
- package/src/razer/index.css +6 -0
- package/src/razer/index.ts +4 -0
- package/src/razer/preset.css +261 -0
- package/src/razer/tailwind.config.ts +10 -0
- package/src/shared/css/animation-easing.css +21 -0
- package/src/shared/css/animations.css +252 -0
- package/src/shared/css/index.css +2 -0
- package/src/shared/css/static.css +31 -0
- package/src/shared/utils/cn.ts +1 -0
- package/src/shared/utils/tv.ts +91 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-dialog'
|
|
5
|
+
|
|
6
|
+
export const tvDialog = tv(
|
|
7
|
+
{
|
|
8
|
+
slots: {
|
|
9
|
+
backdrop: [
|
|
10
|
+
'fixed',
|
|
11
|
+
'inset-0',
|
|
12
|
+
'z-(--z-overlay)',
|
|
13
|
+
'data-[state=open]:motion-opacity-in',
|
|
14
|
+
'data-[state=open]:animate-backdrop-blur-in',
|
|
15
|
+
'data-[state=closed]:motion-opacity-out',
|
|
16
|
+
'data-[state=closed]:animate-backdrop-blur-out',
|
|
17
|
+
],
|
|
18
|
+
positioner: ['fixed', 'inset-0', 'z-(--z-modal)', 'flex', 'items-center', 'justify-center'],
|
|
19
|
+
content: [
|
|
20
|
+
'relative',
|
|
21
|
+
'max-w-full',
|
|
22
|
+
'md:max-w-[80vw]',
|
|
23
|
+
'border',
|
|
24
|
+
'rounded',
|
|
25
|
+
'data-[state=open]:motion-opacity-in',
|
|
26
|
+
'data-[state=open]:motion-translate-y-in',
|
|
27
|
+
'data-[state=closed]:motion-opacity-out',
|
|
28
|
+
'data-[state=closed]:motion-translate-y-out',
|
|
29
|
+
],
|
|
30
|
+
close: '',
|
|
31
|
+
header: ['flex', 'items-center', 'justify-between'],
|
|
32
|
+
title: [],
|
|
33
|
+
body: ['flex-1', 'overflow-y-auto'],
|
|
34
|
+
footer: ['flex', 'items-center', 'justify-end'],
|
|
35
|
+
},
|
|
36
|
+
variants: {
|
|
37
|
+
size: {
|
|
38
|
+
xs: {
|
|
39
|
+
body: 'p-4 text-xs',
|
|
40
|
+
footer: 'px-4 py-3 gap-4 text-xs',
|
|
41
|
+
header: 'py-2 px-4 text-xs',
|
|
42
|
+
close: [
|
|
43
|
+
'p-0.25',
|
|
44
|
+
'text-xs',
|
|
45
|
+
'data-[variant=content-close]:pt-1.5',
|
|
46
|
+
'data-[variant=content-close]:pr-1.5',
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
sm: {
|
|
50
|
+
body: 'p-5 text-sm',
|
|
51
|
+
footer: 'px-5 py-4 gap-5 text-sm',
|
|
52
|
+
header: 'py-2.5 px-5 text-sm',
|
|
53
|
+
close: [
|
|
54
|
+
'p-0.5',
|
|
55
|
+
'text-sm',
|
|
56
|
+
'data-[variant=content-close]:p-0',
|
|
57
|
+
'data-[variant=content-close]:pt-2',
|
|
58
|
+
'data-[variant=content-close]:pr-2',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
base: {
|
|
62
|
+
body: 'p-6 text-base',
|
|
63
|
+
footer: 'px-6 py-5 gap-6 text-base',
|
|
64
|
+
header: 'py-3 px-6 text-base',
|
|
65
|
+
close: [
|
|
66
|
+
'p-0.75',
|
|
67
|
+
'text-base',
|
|
68
|
+
'data-[variant=content-close]:pt-2.5',
|
|
69
|
+
'data-[variant=content-close]:pr-2.5',
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
lg: {
|
|
73
|
+
body: 'p-8 text-lg',
|
|
74
|
+
footer: 'px-8 py-6 gap-8 text-lg',
|
|
75
|
+
header: 'py-4 px-8 text-lg',
|
|
76
|
+
close: [
|
|
77
|
+
'p-1',
|
|
78
|
+
'text-lg',
|
|
79
|
+
'data-[variant=content-close]:pt-3',
|
|
80
|
+
'data-[variant=content-close]:pr-3',
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
defaultVariants: {
|
|
86
|
+
size: 'base',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
slots: {
|
|
91
|
+
backdrop: `${prefix}-backdrop`,
|
|
92
|
+
positioner: `${prefix}-positioner`,
|
|
93
|
+
content: `${prefix}-content`,
|
|
94
|
+
header: `${prefix}-header`,
|
|
95
|
+
close: `${prefix}-close`,
|
|
96
|
+
title: `${prefix}-title`,
|
|
97
|
+
body: `${prefix}-body`,
|
|
98
|
+
footer: `${prefix}-footer`,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
export type DialogVariants = VariantProps<typeof tvDialog>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
import { tvInput } from './input'
|
|
4
|
+
|
|
5
|
+
const prefix = 'rui-editable'
|
|
6
|
+
|
|
7
|
+
export const tvEditable = tv(
|
|
8
|
+
{
|
|
9
|
+
slots: {
|
|
10
|
+
root: 'flex items-center',
|
|
11
|
+
area: '',
|
|
12
|
+
preview: '',
|
|
13
|
+
},
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
xs: '',
|
|
17
|
+
sm: '',
|
|
18
|
+
base: '',
|
|
19
|
+
lg: '',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
compoundVariants: [
|
|
23
|
+
{
|
|
24
|
+
size: 'xs',
|
|
25
|
+
class: {
|
|
26
|
+
root: 'text-xs',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
size: 'sm',
|
|
31
|
+
class: {
|
|
32
|
+
root: 'text-sm',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
size: 'base',
|
|
37
|
+
class: {
|
|
38
|
+
root: 'text-base',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
size: 'lg',
|
|
43
|
+
class: {
|
|
44
|
+
root: 'text-lg',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
defaultVariants: { size: 'base' },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
slots: {
|
|
52
|
+
root: prefix,
|
|
53
|
+
area: `${prefix}-area`,
|
|
54
|
+
preview: `${prefix}-preview`,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
export const tvEditableInput = tv(
|
|
60
|
+
{
|
|
61
|
+
extend: tvInput,
|
|
62
|
+
slots: {
|
|
63
|
+
root: '',
|
|
64
|
+
input: 'min-w-20 w-fit',
|
|
65
|
+
clearable: '',
|
|
66
|
+
},
|
|
67
|
+
compoundVariants: [
|
|
68
|
+
{
|
|
69
|
+
size: 'xs',
|
|
70
|
+
class: {
|
|
71
|
+
root: 'px-1 py-0.25',
|
|
72
|
+
clearable: 'text-xs size-[1lh]',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
size: 'sm',
|
|
77
|
+
class: {
|
|
78
|
+
root: 'px-1 py-0.5',
|
|
79
|
+
clearable: 'text-sm size-[1lh]',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
size: 'base',
|
|
84
|
+
class: {
|
|
85
|
+
root: 'px-2 py-0.75',
|
|
86
|
+
clearable: 'text-base size-[1lh]',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
size: 'lg',
|
|
91
|
+
class: {
|
|
92
|
+
root: 'px-2 py-1',
|
|
93
|
+
clearable: 'text-lg size-[1lh]',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
slots: {
|
|
100
|
+
root: `${prefix}-input`,
|
|
101
|
+
input: `${prefix}-input-input`,
|
|
102
|
+
clearable: `${prefix}-input-clearable`,
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
export type EditableVariants = VariantProps<typeof tvEditable>
|
|
108
|
+
export type EditableInputVariants = VariantProps<typeof tvEditableInput>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-floating-panel'
|
|
5
|
+
|
|
6
|
+
export const tvFloatingPanel = tv(
|
|
7
|
+
{
|
|
8
|
+
slots: {
|
|
9
|
+
positioner: '',
|
|
10
|
+
content: '',
|
|
11
|
+
header: 'w-full flex items-center justify-between',
|
|
12
|
+
control: 'flex items-center gap-2',
|
|
13
|
+
title: '',
|
|
14
|
+
trigger: 'flex items-center justify-center',
|
|
15
|
+
resizeVertical: 'h-full w-2',
|
|
16
|
+
resizeHorizontal: 'w-full h-2',
|
|
17
|
+
resizeCorner: 'size-2',
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
xs: {
|
|
22
|
+
header: 'py-2 pl-4 pr-3 text-xs',
|
|
23
|
+
control: '',
|
|
24
|
+
trigger: 'size-5',
|
|
25
|
+
resizeVertical: 'w-0.5',
|
|
26
|
+
resizeHorizontal: 'h-0.5',
|
|
27
|
+
resizeCorner: 'size-1',
|
|
28
|
+
},
|
|
29
|
+
sm: {
|
|
30
|
+
header: 'py-2.5 pl-5 pr-4 text-sm',
|
|
31
|
+
control: '',
|
|
32
|
+
trigger: 'size-6',
|
|
33
|
+
resizeVertical: 'w-0.75',
|
|
34
|
+
resizeHorizontal: 'h-0.75',
|
|
35
|
+
resizeCorner: 'size-1.5',
|
|
36
|
+
},
|
|
37
|
+
base: {
|
|
38
|
+
header: 'py-3 pl-6 pr-5 text-base',
|
|
39
|
+
control: '',
|
|
40
|
+
trigger: 'size-7',
|
|
41
|
+
resizeVertical: 'w-1',
|
|
42
|
+
resizeHorizontal: 'h-1',
|
|
43
|
+
resizeCorner: 'size-2',
|
|
44
|
+
},
|
|
45
|
+
lg: {
|
|
46
|
+
header: 'py-4 pl-8 pr-7 text-lg',
|
|
47
|
+
control: '',
|
|
48
|
+
trigger: 'size-8',
|
|
49
|
+
resizeVertical: 'w-1.25',
|
|
50
|
+
resizeHorizontal: 'h-1.25',
|
|
51
|
+
resizeCorner: 'size-2.5',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
slots: {
|
|
58
|
+
positioner: `${prefix}-positioner`,
|
|
59
|
+
content: `${prefix}-content`,
|
|
60
|
+
header: `${prefix}-header`,
|
|
61
|
+
control: `${prefix}-control`,
|
|
62
|
+
title: `${prefix}-title`,
|
|
63
|
+
trigger: `${prefix}-trigger`,
|
|
64
|
+
resizeVertical: `${prefix}-resize-vertical`,
|
|
65
|
+
resizeHorizontal: `${prefix}-resize-horizontal`,
|
|
66
|
+
resizeCorner: `${prefix}-resize-corner`,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
export type FloatingPanelVariants = VariantProps<typeof tvFloatingPanel>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { VariantProps } from '../../shared/utils/tv'
|
|
2
|
+
import { tv } from '../../shared/utils/tv'
|
|
3
|
+
import { tvInput } from './input'
|
|
4
|
+
|
|
5
|
+
const inputPrefix = 'rui-input'
|
|
6
|
+
const prefix = 'rui-hotkey'
|
|
7
|
+
|
|
8
|
+
export const tvHotkey = tv(
|
|
9
|
+
{
|
|
10
|
+
extend: tvInput,
|
|
11
|
+
slots: {
|
|
12
|
+
root: ['relative'],
|
|
13
|
+
input: [],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
slots: {
|
|
18
|
+
root: [inputPrefix, prefix],
|
|
19
|
+
input: [`${inputPrefix}-input`, `${prefix}-input`],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
export type HotkeyVariants = VariantProps<typeof tvHotkey>
|
|
@@ -0,0 +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>
|
|
@@ -0,0 +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>
|
|
@@ -0,0 +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'
|
|
@@ -0,0 +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>
|
|
@@ -0,0 +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>
|