@raxium/themes 0.1.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/badge.d.ts +44 -0
- package/dist/default/crafts/badge.js +48 -0
- package/dist/default/crafts/button.d.ts +107 -0
- package/dist/default/crafts/button.js +60 -0
- package/dist/default/crafts/checkbox.d.ts +62 -0
- package/dist/default/crafts/checkbox.js +70 -0
- package/dist/default/crafts/collapsible.d.ts +111 -0
- package/dist/default/crafts/collapsible.js +55 -0
- package/dist/default/crafts/date-picker.d.ts +369 -0
- package/dist/default/crafts/date-picker.js +242 -0
- package/dist/default/crafts/dialog.d.ts +116 -0
- package/dist/default/crafts/dialog.js +95 -0
- package/dist/default/crafts/editable.d.ts +197 -0
- package/dist/default/crafts/editable.js +95 -0
- package/dist/default/crafts/floating-panel.d.ts +143 -0
- package/dist/default/crafts/floating-panel.js +63 -0
- package/dist/default/crafts/hotkey.d.ts +149 -0
- package/dist/default/crafts/hotkey.js +16 -0
- package/dist/default/crafts/hover-card.d.ts +50 -0
- package/dist/default/crafts/hover-card.js +75 -0
- package/dist/default/crafts/icon.d.ts +8 -0
- package/dist/default/crafts/icon.js +7 -0
- package/dist/default/crafts/index.d.ts +33 -0
- package/dist/default/crafts/index.js +33 -0
- package/dist/default/crafts/input.d.ts +77 -0
- package/dist/default/crafts/input.js +45 -0
- package/dist/default/crafts/menu.d.ts +71 -0
- package/dist/default/crafts/menu.js +111 -0
- package/dist/default/crafts/message.d.ts +131 -0
- package/dist/default/crafts/message.js +58 -0
- package/dist/default/crafts/number-input.d.ts +83 -0
- package/dist/default/crafts/number-input.js +42 -0
- package/dist/default/crafts/pagination.d.ts +190 -0
- package/dist/default/crafts/pagination.js +100 -0
- package/dist/default/crafts/popover.d.ts +104 -0
- package/dist/default/crafts/popover.js +66 -0
- package/dist/default/crafts/progress.d.ts +110 -0
- package/dist/default/crafts/progress.js +121 -0
- package/dist/default/crafts/radio-group.d.ts +119 -0
- package/dist/default/crafts/radio-group.js +92 -0
- package/dist/default/crafts/rating-group.d.ts +71 -0
- package/dist/default/crafts/rating-group.js +38 -0
- package/dist/default/crafts/scroll-area.d.ts +74 -0
- package/dist/default/crafts/scroll-area.js +109 -0
- package/dist/default/crafts/select.d.ts +146 -0
- package/dist/default/crafts/select.js +114 -0
- package/dist/default/crafts/skeleton.d.ts +35 -0
- package/dist/default/crafts/skeleton.js +15 -0
- package/dist/default/crafts/slider.d.ts +167 -0
- package/dist/default/crafts/slider.js +85 -0
- package/dist/default/crafts/spin.d.ts +102 -0
- package/dist/default/crafts/spin.js +56 -0
- package/dist/default/crafts/switch.d.ts +92 -0
- package/dist/default/crafts/switch.js +66 -0
- package/dist/default/crafts/tabs.d.ts +119 -0
- package/dist/default/crafts/tabs.js +116 -0
- package/dist/default/crafts/tags-input.d.ts +158 -0
- package/dist/default/crafts/tags-input.js +72 -0
- package/dist/default/crafts/toast.d.ts +137 -0
- package/dist/default/crafts/toast.js +62 -0
- package/dist/default/crafts/toggle-group.d.ts +92 -0
- package/dist/default/crafts/toggle-group.js +49 -0
- package/dist/default/crafts/toggle.d.ts +29 -0
- package/dist/default/crafts/toggle.js +29 -0
- package/dist/default/crafts/tooltip.d.ts +86 -0
- package/dist/default/crafts/tooltip.js +55 -0
- package/dist/default/crafts/tree.d.ts +208 -0
- package/dist/default/crafts/tree.js +145 -0
- package/dist/default/index.css +1624 -0
- package/dist/default/index.d.ts +2 -0
- package/dist/default/index.js +1 -0
- package/dist/razer/crafts/index.d.ts +15 -0
- package/dist/razer/crafts/index.js +15 -0
- package/dist/razer/index.css +4830 -0
- package/dist/razer/index.d.ts +2 -0
- package/dist/razer/index.js +1 -0
- package/dist/utils/cn.d.ts +7 -0
- package/dist/utils/cn.js +13 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/tv.d.ts +37 -0
- package/dist/utils/tv.js +29 -0
- package/package.json +61 -0
- package/src/css/animation-easing.css +21 -0
- package/src/css/animations.css +252 -0
- package/src/css/index.css +2 -0
- package/src/css/static.css +31 -0
- 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 +2 -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.css +33 -0
- package/src/razer/crafts/index.ts +16 -0
- package/src/razer/index.css +6 -0
- package/src/razer/index.ts +2 -0
- package/src/razer/preset.css +261 -0
- package/src/razer/tailwind.config.ts +10 -0
- package/src/utils/cn.ts +18 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/tv.ts +91 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.rui-toast {
|
|
3
|
+
overflow-wrap: anywhere;
|
|
4
|
+
translate: var(--x) var(--y);
|
|
5
|
+
scale: var(--scale);
|
|
6
|
+
z-index: var(--z-index);
|
|
7
|
+
height: var(--height);
|
|
8
|
+
opacity: var(--opacity);
|
|
9
|
+
|
|
10
|
+
will-change: translate, opacity, scale;
|
|
11
|
+
transition: translate var(--tw-duration, 200ms),
|
|
12
|
+
scale var(--tw-duration, 200ms), opacity var(--tw-duration, 200ms),
|
|
13
|
+
height var(--tw-duration, 200ms);
|
|
14
|
+
transition-timing-function: var(--tw-timing, ease-out);
|
|
15
|
+
|
|
16
|
+
&[data-state='closed'] {
|
|
17
|
+
transition: translate var(--tw-duration, 200ms),
|
|
18
|
+
scale var(--tw-duration, 200ms), opacity var(--tw-duration, 200ms);
|
|
19
|
+
transition-timing-function: var(--tw-timing, ease-out);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.rui-toast-content {
|
|
24
|
+
@apply bg-h22 shadow-rui-popper;
|
|
25
|
+
@apply success:border-l-rui-success error:border-l-rui-error warning:border-l-rui-warning info:border-l-rui-info loading:border-l-rui-parimary;
|
|
26
|
+
&[data-placement^='bottom'] {
|
|
27
|
+
@apply shadow-rui-popper-top;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.rui-toast-icon {
|
|
32
|
+
@apply success:text-rui-success error:text-rui-error warning:text-rui-warning info:text-rui-info loading:text-rui-parimary;
|
|
33
|
+
&[data-type='loading'] {
|
|
34
|
+
@apply animate-spin;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.rui-toast-close {
|
|
39
|
+
@apply text-rui-close hover:text-rui-close-hover;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.rui-toggle-group {
|
|
3
|
+
@apply border-h55;
|
|
4
|
+
}
|
|
5
|
+
.rui-toggle-group-item {
|
|
6
|
+
@apply border-h55 bg-h1a
|
|
7
|
+
hover:bg-h5e hover:border-h4c hover:ring-h4c
|
|
8
|
+
active:bg-h1a active:border-h00 active:text-ha7;
|
|
9
|
+
|
|
10
|
+
&[data-state='on'] {
|
|
11
|
+
@apply bg-rz-green-dark
|
|
12
|
+
hover:bg-rz-green-dark-hover
|
|
13
|
+
hover:border-rz-green-dark-hover
|
|
14
|
+
active:bg-rz-green-dark-active
|
|
15
|
+
active:border-rz-green-dark-active
|
|
16
|
+
active:text-ha7;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.rui-toggle {
|
|
3
|
+
@apply border-h00 bg-h1a
|
|
4
|
+
hover:bg-h5e hover:border-h4c hover:ring-h4c
|
|
5
|
+
active:bg-h1a active:border-h00 active:text-ha7;
|
|
6
|
+
|
|
7
|
+
&[data-state='on'] {
|
|
8
|
+
@apply bg-rz-green-dark
|
|
9
|
+
border-rz-green-dark
|
|
10
|
+
hover:bg-rz-green-dark-hover
|
|
11
|
+
hover:border-rz-green-dark-hover
|
|
12
|
+
active:bg-rz-green-dark-active
|
|
13
|
+
active:border-rz-green-dark-active
|
|
14
|
+
active:text-ha7;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@layer components {
|
|
2
|
+
.rui-tooltip-content {
|
|
3
|
+
--border-radius: var(--radius);
|
|
4
|
+
@apply shadow-rui-popper;
|
|
5
|
+
@apply data-theme-bordered:border-h00;
|
|
6
|
+
@apply surface-dark:data-theme-bordered:border-h33;
|
|
7
|
+
@apply surface-razer:border-h00;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rui-tooltip-content,
|
|
11
|
+
.rui-tooltip-content-inner {
|
|
12
|
+
@apply bg-hff text-h00;
|
|
13
|
+
@apply surface-dark:bg-h00 surface-dark:text-hff;
|
|
14
|
+
@apply surface-razer:bg-rz-green surface-razer:text-h00;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
@import './checkbox.css';
|
|
3
|
+
|
|
4
|
+
@layer components {
|
|
5
|
+
.rui-tree-item[data-disabled] {
|
|
6
|
+
@apply opacity-(--disabled-opacity);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.rui-tree-branch {
|
|
10
|
+
&[data-disabled] {
|
|
11
|
+
@apply opacity-(--disabled-opacity);
|
|
12
|
+
}
|
|
13
|
+
&:not([data-disabled]) {
|
|
14
|
+
& .rui-tree-branch-control[data-disabled] {
|
|
15
|
+
@apply cursor-pointer;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import './components/arrow.css';
|
|
2
|
+
@import './components/badge.css';
|
|
3
|
+
@import './components/button.css';
|
|
4
|
+
@import './components/checkbox.css';
|
|
5
|
+
@import './components/radio-group.css';
|
|
6
|
+
@import './components/collapsible.css';
|
|
7
|
+
@import './components/input.css';
|
|
8
|
+
@import './components/editable.css';
|
|
9
|
+
@import './components/tooltip.css';
|
|
10
|
+
@import './components/dialog.css';
|
|
11
|
+
@import './components/hover-card.css';
|
|
12
|
+
@import './components/popover.css';
|
|
13
|
+
@import './components/switch.css';
|
|
14
|
+
@import './components/menu.css';
|
|
15
|
+
@import './components/select.css';
|
|
16
|
+
@import './components/toast.css';
|
|
17
|
+
@import './components/message.css';
|
|
18
|
+
@import './components/slider.css';
|
|
19
|
+
@import './components/tabs.css';
|
|
20
|
+
@import './components/scroll-area.css';
|
|
21
|
+
@import './components/toggle.css';
|
|
22
|
+
@import './components/toggle-group.css';
|
|
23
|
+
@import './components/progress.css';
|
|
24
|
+
@import './components/hotkey.css';
|
|
25
|
+
@import './components/spin.css';
|
|
26
|
+
@import './components/tags-input.css';
|
|
27
|
+
@import './components/skeleton.css';
|
|
28
|
+
@import './components/rating-group.css';
|
|
29
|
+
@import './components/pagination.css';
|
|
30
|
+
@import './components/number-input.css';
|
|
31
|
+
@import './components/date-picker.css';
|
|
32
|
+
@import './components/tree.css';
|
|
33
|
+
@import './components/floating-panel.css';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* you can extend the core crafts by importing them from the default theme
|
|
4
|
+
* and then extending them with your own customizations
|
|
5
|
+
*
|
|
6
|
+
* example:
|
|
7
|
+
* import { coreCrafts } from '../../../default'
|
|
8
|
+
* import { tv } from '../../utils'
|
|
9
|
+
* export const tvButton = tv({
|
|
10
|
+
* extend: coreCrafts.tvButton,
|
|
11
|
+
* // your own customizations here
|
|
12
|
+
* })
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export {}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
@import '../css/index.css';
|
|
2
|
+
|
|
3
|
+
@custom-variant skin-razer (&:where(html[data-theme-skin=razer], html[data-theme-skin=razer] *));
|
|
4
|
+
|
|
5
|
+
@custom-variant surface-dark (&:where([data-theme-surface=dark], [data-theme-surface=dark] *));
|
|
6
|
+
@custom-variant surface-light (&:where([data-theme-surface=light], [data-theme-surface=light] *));
|
|
7
|
+
@custom-variant surface-razer (&:where([data-theme-surface=razer], [data-theme-surface=razer] *));
|
|
8
|
+
|
|
9
|
+
@custom-variant success (&:where([data-type=success], [data-type=success] *));
|
|
10
|
+
@custom-variant error (&:where([data-type=error], [data-type=error] *));
|
|
11
|
+
@custom-variant warning (&:where([data-type=warning], [data-type=warning] *));
|
|
12
|
+
@custom-variant info (&:where([data-type=info], [data-type=info] *));
|
|
13
|
+
@custom-variant loading (&:where([data-type=loading], [data-type=loading] *));
|
|
14
|
+
@custom-variant arrow-css (&:where([data-arrow-type="css"]));
|
|
15
|
+
@custom-variant arrow-svg (&:where([data-arrow-type="svg"]));
|
|
16
|
+
|
|
17
|
+
@theme {
|
|
18
|
+
/* Spacing */
|
|
19
|
+
--spacing: 0.25rem;
|
|
20
|
+
|
|
21
|
+
/* Breakpoints */
|
|
22
|
+
--break-point-sm: 1024px;
|
|
23
|
+
--break-point-md: 1440px;
|
|
24
|
+
--break-point-lg: 1920px;
|
|
25
|
+
--break-point-xl: 2560px;
|
|
26
|
+
--break-point-2xl: 3840px;
|
|
27
|
+
|
|
28
|
+
/* Colors */
|
|
29
|
+
--color-*: initial;
|
|
30
|
+
--color-tw-ring-color: transparent;
|
|
31
|
+
--color-rz-green: oklch(76.87% 0.2343 141.32);
|
|
32
|
+
--color-rz-green-dark: oklch(47.48% 0.2343 141.32);
|
|
33
|
+
--color-rz-green-dark-hover: oklch(59.25% 0.2343 141.32);
|
|
34
|
+
--color-rz-green-dark-active: oklch(33.16% 0.2343 141.32);
|
|
35
|
+
--color-rz-green-light: oklch(82.23% 0.2343 141.32);
|
|
36
|
+
--color-rz-green-border: oklch(45.35% 0.2343 141.32);
|
|
37
|
+
--color-rz-green-border-hover: oklch(70.57% 0.2343 141.32);
|
|
38
|
+
--color-rz-green-border-active: oklch(45.88% 0.2343 141.32);
|
|
39
|
+
|
|
40
|
+
--color-rz-orange: oklch(80.16% 0.1705 73.27);
|
|
41
|
+
--color-rz-red: oklch(62.32% 0.2121 25.89);
|
|
42
|
+
--color-rz-blue: oklch(69% 0.1282 229.93);
|
|
43
|
+
|
|
44
|
+
--color-black: oklch(0% 0 0);
|
|
45
|
+
--color-h00: oklch(0% 0 0);
|
|
46
|
+
--color-white: oklch(100% 0 0);
|
|
47
|
+
--color-hff: oklch(100% 0 0);
|
|
48
|
+
--color-h70: oklch(54.52% 0 0);
|
|
49
|
+
--color-h4f: oklch(42.76% 0 0);
|
|
50
|
+
--color-h9b: oklch(68.95% 0 0);
|
|
51
|
+
--color-h83: oklch(61% 0 0);
|
|
52
|
+
--color-h37: oklch(33.68% 0 0);
|
|
53
|
+
--color-hcc: oklch(84.52% 0 0);
|
|
54
|
+
--color-hbb: oklch(79.21% 0 0);
|
|
55
|
+
--color-h33: oklch(32.11% 0 0);
|
|
56
|
+
--color-h24: oklch(26.03% 0 0);
|
|
57
|
+
--color-h8f: oklch(65% 0 0);
|
|
58
|
+
--color-h1a: oklch(21.78% 0 0);
|
|
59
|
+
--color-ha7: oklch(72.84% 0 0);
|
|
60
|
+
--color-h5e: oklch(48.19% 0 0);
|
|
61
|
+
--color-h4c: oklch(41.65% 0 0);
|
|
62
|
+
--color-h55: oklch(44.95% 0 0);
|
|
63
|
+
--color-h54: oklch(44.59% 0 0);
|
|
64
|
+
--color-h66: oklch(51.03% 0 0);
|
|
65
|
+
--color-h58: oklch(46.04% 0 0);
|
|
66
|
+
--color-h28: oklch(27.68% 0 0);
|
|
67
|
+
--color-h78: oklch(57.27% 0 0);
|
|
68
|
+
--color-h88: oklch(62.68% 0 0);
|
|
69
|
+
--color-hee: oklch(94.91% 0 0);
|
|
70
|
+
--color-h44: oklch(38.67% 0 0);
|
|
71
|
+
--color-h22: oklch(25.2% 0 0);
|
|
72
|
+
--color-h16: oklch(20.02% 0 0);
|
|
73
|
+
--color-h11: oklch(15.26% 0 0);
|
|
74
|
+
--color-h2a: oklch(22.22% 0 0);
|
|
75
|
+
--color-h1d: oklch(19.61% 0 0);
|
|
76
|
+
--color-h47: oklch(40.64% 0 0);
|
|
77
|
+
--color-h90: oklch(65.34% 0 0);
|
|
78
|
+
|
|
79
|
+
/* Text */
|
|
80
|
+
--text-3xs: 0.5rem;
|
|
81
|
+
--text-3xs--line-height: 1.25;
|
|
82
|
+
--text-2xs: 0.625rem;
|
|
83
|
+
--text-2xs--line-height: 1.25;
|
|
84
|
+
--text-xs: 0.75rem;
|
|
85
|
+
--text-xs--line-height: 1.25;
|
|
86
|
+
--text-sm: 0.875rem;
|
|
87
|
+
--text-sm--line-height: 1.25;
|
|
88
|
+
--text-base: 1rem;
|
|
89
|
+
--text-base--line-height: 1.25;
|
|
90
|
+
--text-lg: 1.125rem;
|
|
91
|
+
--text-lg--line-height: 1.25;
|
|
92
|
+
--text-xl: 1.25rem;
|
|
93
|
+
--text-xl--line-height: 1.25;
|
|
94
|
+
--text-2xl: 1.5rem;
|
|
95
|
+
--text-2xl--line-height: 1.25;
|
|
96
|
+
--text-3xl: 2rem;
|
|
97
|
+
--text-3xl--line-height: 1.25;
|
|
98
|
+
|
|
99
|
+
/* Shadows */
|
|
100
|
+
--shadow-glory: 0 0 1.5625rem 0 oklch(86.64% 0.2343 141.32 / 47%);
|
|
101
|
+
--shadow-black: 0 0 0.625rem 0 oklch(0% 0 0 / 80%);
|
|
102
|
+
--shadow-black-md: 0 0 0.9375rem 0 oklch(0% 0 0 / 80%);
|
|
103
|
+
|
|
104
|
+
/* Fonts */
|
|
105
|
+
--font-rob: Roboto, var(--font-sans);
|
|
106
|
+
--font-rob-regular: Roboto-Regular, var(--font-sans);
|
|
107
|
+
--font-rob-medium: Roboto-Medium, var(--font-sans);
|
|
108
|
+
--font-rob-bold: Roboto-Bold, var(--font-sans);
|
|
109
|
+
--font-rob-black: Roboto-Black, var(--font-sans);
|
|
110
|
+
--font-rz: RazerF5, var(--font-sans);
|
|
111
|
+
--font-rz-light: RazerF5-Light, var(--font-sans);
|
|
112
|
+
--font-rz-medium: RazerF5-Medium, var(--font-sans);
|
|
113
|
+
--font-rz-bold: RazerF5-Bold, var(--font-sans);
|
|
114
|
+
--font-rz-black: RazerF5-Black, var(--font-sans);
|
|
115
|
+
|
|
116
|
+
/* Border Radius */
|
|
117
|
+
--radius: 0.125rem; /* 2px */
|
|
118
|
+
--radius-md: calc(var(--radius) + 0.125rem); /* 4px */
|
|
119
|
+
--radius-lg: calc(var(--radius) + 0.25rem); /* 6px */
|
|
120
|
+
|
|
121
|
+
/* Other */
|
|
122
|
+
--outline: 2px solid var(--color-rz-green);
|
|
123
|
+
--disabled-opacity: var(--opacity-50, 0.5);
|
|
124
|
+
|
|
125
|
+
/* RUI Theme*/
|
|
126
|
+
--color-rui-parimary: var(--color-rz-green);
|
|
127
|
+
--color-rui-parimary-hover: var(--color-rz-green-dark-hover);
|
|
128
|
+
--color-rui-parimary-active: var(--color-rz-green-dark-active);
|
|
129
|
+
|
|
130
|
+
--color-rui-border: var(--color-h54);
|
|
131
|
+
|
|
132
|
+
--color-rui-toggle-text: var(--color-h88);
|
|
133
|
+
--color-rui-toggle-text-hover: var(--color-hff);
|
|
134
|
+
--color-rui-toggle-text-active: var(--color-hff);
|
|
135
|
+
|
|
136
|
+
--color-rui-success: var(--color-rz-green);
|
|
137
|
+
--color-rui-error: var(--color-rz-red);
|
|
138
|
+
--color-rui-info: var(--color-h88);
|
|
139
|
+
--color-rui-warning: var(--color-rz-orange);
|
|
140
|
+
|
|
141
|
+
--color-rui-close: var(--color-h88);
|
|
142
|
+
--color-rui-close-hover: var(--color-hff);
|
|
143
|
+
|
|
144
|
+
--color-rui-separator: var(--color-h00);
|
|
145
|
+
|
|
146
|
+
--font-rui-label: var(--font-rob-bold);
|
|
147
|
+
|
|
148
|
+
--shadow-rui-popper: 0 0.25rem 0.375rem 0 oklch(0% 0 0 / 80%);
|
|
149
|
+
--shadow-rui-popper-top: 0 -0.25rem 0.375rem 0 oklch(0% 0 0 / 80%);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
@theme inline {
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@theme static {
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@layer base {
|
|
159
|
+
*,
|
|
160
|
+
::after,
|
|
161
|
+
::before,
|
|
162
|
+
::backdrop,
|
|
163
|
+
::file-selector-button {
|
|
164
|
+
border-color: var(--color-gray-200, currentColor);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:root {
|
|
168
|
+
font-family: var(--font-roboto, --font-sans);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
*:focus-visible {
|
|
172
|
+
outline: var(--outline);
|
|
173
|
+
outline-offset: 2px;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@utility flex-c {
|
|
178
|
+
@apply flex justify-center items-center;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@utility flex-ac {
|
|
182
|
+
@apply flex justify-around items-center;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@utility flex-bc {
|
|
186
|
+
@apply flex justify-between items-center;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@utility flex-col-c {
|
|
190
|
+
@apply flex flex-col justify-center items-center;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
@utility flex-col-ac {
|
|
194
|
+
@apply flex flex-col justify-center items-center;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@utility flex-col-bc {
|
|
198
|
+
@apply flex flex-col justify-between items-center;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
@utility hide-scrollbar {
|
|
202
|
+
&::-webkit-scrollbar {
|
|
203
|
+
display: none;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@utility webkit-scrollbar {
|
|
208
|
+
::-webkit-scrollbar {
|
|
209
|
+
@apply size-[6px];
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
::-webkit-scrollbar-track-piece {
|
|
213
|
+
@apply bg-transparent rounded-[6px];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
::-webkit-scrollbar-thumb {
|
|
217
|
+
@apply h-[30px] bg-h58/40 rounded-[6px] hover:bg-rz-green active:bg-rz-green/70 focus:bg-rz-green/70;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@utility webkit-scrollbar-self {
|
|
222
|
+
&::-webkit-scrollbar {
|
|
223
|
+
@apply size-[6px];
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
&::-webkit-scrollbar-track-piece {
|
|
227
|
+
@apply bg-transparent rounded-[6px];
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
&::-webkit-scrollbar-thumb {
|
|
231
|
+
@apply h-[30px] bg-h58/40 rounded-[6px] hover:bg-rz-green active:bg-rz-green/70 focus:bg-rz-green/70;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
@utility webkit-small-scrollbar {
|
|
236
|
+
::-webkit-scrollbar {
|
|
237
|
+
@apply size-[3px];
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
::-webkit-scrollbar-track-piece {
|
|
241
|
+
@apply bg-transparent rounded-[1px];
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
::-webkit-scrollbar-thumb {
|
|
245
|
+
@apply h-[5px] bg-h58/40 rounded-[1px] hover:bg-rz-green active:bg-rz-green/70 focus:bg-rz-green/70;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
@utility webkit-small-scrollbar-self {
|
|
250
|
+
&::-webkit-scrollbar {
|
|
251
|
+
@apply size-[3px];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
&::-webkit-scrollbar-track-piece {
|
|
255
|
+
@apply bg-transparent rounded-[1px];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
&::-webkit-scrollbar-thumb {
|
|
259
|
+
@apply h-[5px] bg-h58/40 rounded-[1px] hover:bg-rz-green active:bg-rz-green/70 focus:bg-rz-green/70;
|
|
260
|
+
}
|
|
261
|
+
}
|
package/src/utils/cn.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ClassValue } from 'clsx'
|
|
2
|
+
import clsx from 'clsx'
|
|
3
|
+
import { twMerge } from 'tailwind-merge'
|
|
4
|
+
|
|
5
|
+
/** clsx + twMerge,统一处理 class 类型并合并 Tailwind 冲突 */
|
|
6
|
+
export function cn(...classes: ClassValue[]) {
|
|
7
|
+
return twMerge(clsx(...classes))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function cnMerge(...classes: ClassValue[]) {
|
|
11
|
+
return twMerge(clsx(...classes))
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function cx(...classes: ClassValue[]) {
|
|
15
|
+
return clsx(...classes)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { clsx }
|
package/src/utils/tv.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ClassValue,
|
|
3
|
+
TVCompoundSlots,
|
|
4
|
+
TVCompoundVariants,
|
|
5
|
+
TVDefaultVariants,
|
|
6
|
+
TVReturnType,
|
|
7
|
+
TVVariants,
|
|
8
|
+
} from 'tailwind-variants'
|
|
9
|
+
import { tv as originTv } from 'tailwind-variants'
|
|
10
|
+
|
|
11
|
+
type TVSlots = Record<string, ClassValue> | undefined
|
|
12
|
+
export type { VariantProps } from 'tailwind-variants'
|
|
13
|
+
|
|
14
|
+
export function tv<
|
|
15
|
+
V extends TVVariants<S, B, EV>,
|
|
16
|
+
CV extends TVCompoundVariants<V, S, B, EV, ES>,
|
|
17
|
+
DV extends TVDefaultVariants<V, S, EV, ES>,
|
|
18
|
+
B extends ClassValue = undefined,
|
|
19
|
+
S extends TVSlots = undefined,
|
|
20
|
+
// @ts-expect-error error in tailwind-variants
|
|
21
|
+
E extends TVReturnType = TVReturnType<
|
|
22
|
+
V,
|
|
23
|
+
S,
|
|
24
|
+
B,
|
|
25
|
+
// @ts-expect-error error in tailwind-variants
|
|
26
|
+
EV extends undefined ? {} : EV,
|
|
27
|
+
// @ts-expect-error error in tailwind-variants
|
|
28
|
+
ES extends undefined ? {} : ES
|
|
29
|
+
>,
|
|
30
|
+
EV extends TVVariants<ES, B, E['variants'], ES> = E['variants'],
|
|
31
|
+
ES extends TVSlots = E['slots'] extends TVSlots ? E['slots'] : undefined,
|
|
32
|
+
>(
|
|
33
|
+
options: {
|
|
34
|
+
extend?: E
|
|
35
|
+
base?: B
|
|
36
|
+
slots?: S
|
|
37
|
+
variants?: V
|
|
38
|
+
compoundVariants?: CV
|
|
39
|
+
compoundSlots?: TVCompoundSlots<V & { unstyled: { true: ClassValue, false: ClassValue } }, S, B>
|
|
40
|
+
defaultVariants?: DV
|
|
41
|
+
},
|
|
42
|
+
ruiConfig?: {
|
|
43
|
+
class?: ClassValue
|
|
44
|
+
className?: ClassValue
|
|
45
|
+
slots?: Record<keyof S, ClassValue>
|
|
46
|
+
},
|
|
47
|
+
config?: any,
|
|
48
|
+
) {
|
|
49
|
+
type mergedV = V & { unstyled: { true: ClassValue, false: ClassValue } }
|
|
50
|
+
|
|
51
|
+
// fix: extend时, ruiConfig丢失
|
|
52
|
+
const _ruiConfig = ruiConfig ?? options.extend?._ruiConfig
|
|
53
|
+
const variants = {
|
|
54
|
+
...(options.variants ?? {}),
|
|
55
|
+
unstyled: {
|
|
56
|
+
true: '',
|
|
57
|
+
false: _ruiConfig?.class ?? _ruiConfig?.className ?? '',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const unstyledCompoundSlots: any[] = []
|
|
62
|
+
for (const key in _ruiConfig?.slots) {
|
|
63
|
+
unstyledCompoundSlots.push({
|
|
64
|
+
slots: [key],
|
|
65
|
+
unstyled: false,
|
|
66
|
+
class: _ruiConfig?.slots[key],
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
options.variants = variants as V
|
|
70
|
+
options.defaultVariants = {
|
|
71
|
+
...(options.defaultVariants ?? {}),
|
|
72
|
+
unstyled: false,
|
|
73
|
+
} as unknown as DV
|
|
74
|
+
|
|
75
|
+
options.compoundSlots = (options.compoundSlots ?? []).concat(unstyledCompoundSlots)
|
|
76
|
+
|
|
77
|
+
const result: any = originTv(options as any, config)
|
|
78
|
+
result._ruiConfig = ruiConfig
|
|
79
|
+
return result as ReturnType<
|
|
80
|
+
typeof originTv<
|
|
81
|
+
mergedV,
|
|
82
|
+
TVCompoundVariants<mergedV, S, B, EV, ES>,
|
|
83
|
+
TVDefaultVariants<mergedV, S, EV, ES>,
|
|
84
|
+
B,
|
|
85
|
+
S,
|
|
86
|
+
E,
|
|
87
|
+
EV,
|
|
88
|
+
ES
|
|
89
|
+
>
|
|
90
|
+
>
|
|
91
|
+
}
|