@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 @@
|
|
|
1
|
+
export * as crafts from './crafts/index';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ClassValue } from 'clsx';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
/** clsx + twMerge,统一处理 class 类型并合并 Tailwind 冲突 */
|
|
4
|
+
export declare function cn(...classes: ClassValue[]): string;
|
|
5
|
+
export declare function cnMerge(...classes: ClassValue[]): string;
|
|
6
|
+
export declare function cx(...classes: ClassValue[]): string;
|
|
7
|
+
export { clsx };
|
package/dist/utils/cn.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
/** clsx + twMerge,统一处理 class 类型并合并 Tailwind 冲突 */
|
|
4
|
+
export function cn(...classes) {
|
|
5
|
+
return twMerge(clsx(...classes));
|
|
6
|
+
}
|
|
7
|
+
export function cnMerge(...classes) {
|
|
8
|
+
return twMerge(clsx(...classes));
|
|
9
|
+
}
|
|
10
|
+
export function cx(...classes) {
|
|
11
|
+
return clsx(...classes);
|
|
12
|
+
}
|
|
13
|
+
export { clsx };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ClassValue, TVCompoundSlots, TVCompoundVariants, TVDefaultVariants, TVReturnType, TVVariants } from 'tailwind-variants';
|
|
2
|
+
import { tv as originTv } from 'tailwind-variants';
|
|
3
|
+
type TVSlots = Record<string, ClassValue> | undefined;
|
|
4
|
+
export type { VariantProps } from 'tailwind-variants';
|
|
5
|
+
export declare function tv<V extends TVVariants<S, B, EV>, CV extends TVCompoundVariants<V, S, B, EV, ES>, DV extends TVDefaultVariants<V, S, EV, ES>, B extends ClassValue = undefined, S extends TVSlots = undefined, E extends TVReturnType = TVReturnType<V, S, B, EV extends undefined ? {} : EV, ES extends undefined ? {} : ES>, EV extends TVVariants<ES, B, E['variants'], ES> = E['variants'], ES extends TVSlots = E['slots'] extends TVSlots ? E['slots'] : undefined>(options: {
|
|
6
|
+
extend?: E;
|
|
7
|
+
base?: B;
|
|
8
|
+
slots?: S;
|
|
9
|
+
variants?: V;
|
|
10
|
+
compoundVariants?: CV;
|
|
11
|
+
compoundSlots?: TVCompoundSlots<V & {
|
|
12
|
+
unstyled: {
|
|
13
|
+
true: ClassValue;
|
|
14
|
+
false: ClassValue;
|
|
15
|
+
};
|
|
16
|
+
}, S, B>;
|
|
17
|
+
defaultVariants?: DV;
|
|
18
|
+
}, ruiConfig?: {
|
|
19
|
+
class?: ClassValue;
|
|
20
|
+
className?: ClassValue;
|
|
21
|
+
slots?: Record<keyof S, ClassValue>;
|
|
22
|
+
}, config?: any): ReturnType<typeof originTv<V & {
|
|
23
|
+
unstyled: {
|
|
24
|
+
true: ClassValue;
|
|
25
|
+
false: ClassValue;
|
|
26
|
+
};
|
|
27
|
+
}, TVCompoundVariants<V & {
|
|
28
|
+
unstyled: {
|
|
29
|
+
true: ClassValue;
|
|
30
|
+
false: ClassValue;
|
|
31
|
+
};
|
|
32
|
+
}, S, B, EV, ES>, TVDefaultVariants<V & {
|
|
33
|
+
unstyled: {
|
|
34
|
+
true: ClassValue;
|
|
35
|
+
false: ClassValue;
|
|
36
|
+
};
|
|
37
|
+
}, S, EV, ES>, B, S, E, EV, ES>>;
|
package/dist/utils/tv.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { tv as originTv } from 'tailwind-variants';
|
|
2
|
+
export function tv(options, ruiConfig, config) {
|
|
3
|
+
// fix: extend时, ruiConfig丢失
|
|
4
|
+
const _ruiConfig = ruiConfig ?? options.extend?._ruiConfig;
|
|
5
|
+
const variants = {
|
|
6
|
+
...(options.variants ?? {}),
|
|
7
|
+
unstyled: {
|
|
8
|
+
true: '',
|
|
9
|
+
false: _ruiConfig?.class ?? _ruiConfig?.className ?? '',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const unstyledCompoundSlots = [];
|
|
13
|
+
for (const key in _ruiConfig?.slots) {
|
|
14
|
+
unstyledCompoundSlots.push({
|
|
15
|
+
slots: [key],
|
|
16
|
+
unstyled: false,
|
|
17
|
+
class: _ruiConfig?.slots[key],
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
options.variants = variants;
|
|
21
|
+
options.defaultVariants = {
|
|
22
|
+
...(options.defaultVariants ?? {}),
|
|
23
|
+
unstyled: false,
|
|
24
|
+
};
|
|
25
|
+
options.compoundSlots = (options.compoundSlots ?? []).concat(unstyledCompoundSlots);
|
|
26
|
+
const result = originTv(options, config);
|
|
27
|
+
result._ruiConfig = ruiConfig;
|
|
28
|
+
return result;
|
|
29
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@raxium/themes",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.1.1",
|
|
5
|
+
"description": "Themes for Raxium",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Hwacc",
|
|
8
|
+
"email": "mshcccck@gmail.com",
|
|
9
|
+
"url": "https://github.com/raxium-ui/raxium-ui"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"raxium",
|
|
14
|
+
"raxium-ui",
|
|
15
|
+
"themes",
|
|
16
|
+
"tailwind"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
"./utils": {
|
|
20
|
+
"types": "./dist/utils/index.d.ts",
|
|
21
|
+
"import": "./dist/utils/index.js",
|
|
22
|
+
"default": "./dist/utils/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./razer": {
|
|
25
|
+
"types": "./dist/razer/index.d.ts",
|
|
26
|
+
"import": "./dist/razer/index.js",
|
|
27
|
+
"default": "./dist/razer/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./default": {
|
|
30
|
+
"types": "./dist/default/index.d.ts",
|
|
31
|
+
"import": "./dist/default/index.js",
|
|
32
|
+
"default": "./dist/default/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./razer/index.css": "./dist/razer/index.css",
|
|
35
|
+
"./razer/preset.css": "./src/razer/preset.css",
|
|
36
|
+
"./default/index.css": "./dist/default/index.css"
|
|
37
|
+
},
|
|
38
|
+
"module": "./dist/index.js",
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"src"
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"clsx": "^2.1.1",
|
|
45
|
+
"tailwind-merge": "^3.4.0",
|
|
46
|
+
"tailwind-variants": "^3.2.2",
|
|
47
|
+
"tailwindcss-animated": "^2.0.0",
|
|
48
|
+
"tailwindcss-motion": "^1.1.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@tailwindcss/cli": "^4.1.18",
|
|
52
|
+
"tailwindcss": "^4.1.18"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "bun run build.ts",
|
|
59
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@theme {
|
|
2
|
+
/* tw default duration */
|
|
3
|
+
--tw-duration: var(--motion-duration);
|
|
4
|
+
--default-transition-duration: var(--motion-duration);
|
|
5
|
+
--transition-duration: var(--motion-duration);
|
|
6
|
+
--tw-timing: var(--motion-timing);
|
|
7
|
+
--default-transition-timing-function: var(--motion-timing);
|
|
8
|
+
--transition-timing-function: var(--motion-timing);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@property --motion-duration {
|
|
12
|
+
syntax: '<time>';
|
|
13
|
+
inherits: false;
|
|
14
|
+
initial-value: 200ms;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@property --motion-timing {
|
|
18
|
+
syntax: '*';
|
|
19
|
+
inherits: false;
|
|
20
|
+
initial-value: cubic-bezier(0, 0, 0.2, 1);
|
|
21
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
@import './animation-easing.css';
|
|
2
|
+
|
|
3
|
+
@plugin 'tailwindcss-motion';
|
|
4
|
+
|
|
5
|
+
@theme {
|
|
6
|
+
--animate-accordion-down: accordion-down var(--tw-duration, 200ms)
|
|
7
|
+
var(--tw-timing, ease-out);
|
|
8
|
+
--animate-accordion-up: accordion-up var(--tw-duration, 200ms)
|
|
9
|
+
var(--tw-timing, ease-out);
|
|
10
|
+
--animate-collapsible-down: collapsible-down var(--tw-duration, 200ms)
|
|
11
|
+
var(--tw-timing, ease-in-out);
|
|
12
|
+
--animate-collapsible-up: collapsible-up var(--tw-duration, 200ms)
|
|
13
|
+
var(--tw-timing, ease-in-out);
|
|
14
|
+
--animate-quick-squeeze-x: squeeze-x var(--tw-duration, 200ms)
|
|
15
|
+
var(--tw-timing, ease-in-out);
|
|
16
|
+
--animate-rippling: rippling var(--tw-ripple-duration, 600ms) ease-out;
|
|
17
|
+
--animate-spin: spin 1s linear infinite;
|
|
18
|
+
--animate-fade-scale-in: fade-scale-in var(--tw-duration, 200ms)
|
|
19
|
+
var(--tw-timing, ease-out);
|
|
20
|
+
--animate-fade-scale-out: fade-scale-out var(--tw-duration, 200ms)
|
|
21
|
+
var(--tw-timing, ease-out);
|
|
22
|
+
--animate-backdrop-blur-in: backdrop-blur-in var(--tw-duration, 200ms)
|
|
23
|
+
var(--tw-timing, ease-out) forwards;
|
|
24
|
+
--animate-backdrop-blur-out: backdrop-blur-out var(--tw-duration, 200ms)
|
|
25
|
+
var(--tw-timing, ease-out) forwards;
|
|
26
|
+
|
|
27
|
+
/* toast exit animations */
|
|
28
|
+
--animate-toast-exit-right: toast-exit-right var(--tw-duration, 200ms)
|
|
29
|
+
var(--tw-timing, ease-out);
|
|
30
|
+
--animate-toast-exit-left: toast-exit-left var(--tw-duration, 200ms)
|
|
31
|
+
var(--tw-timing, ease-out);
|
|
32
|
+
--animate-toast-exit-top: toast-exit-top var(--tw-duration, 200ms)
|
|
33
|
+
var(--tw-timing, ease-out);
|
|
34
|
+
--animate-toast-exit-bottom: toast-exit-bottom var(--tw-duration, 200ms)
|
|
35
|
+
var(--tw-timing, ease-out);
|
|
36
|
+
|
|
37
|
+
/* Keyframes */
|
|
38
|
+
@keyframes accordion-down {
|
|
39
|
+
from {
|
|
40
|
+
height: 0px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
to {
|
|
44
|
+
height: var(--reka-accordion-content-height, 0px);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@keyframes accordion-up {
|
|
49
|
+
from {
|
|
50
|
+
height: var(--reka-accordion-content-height, 0px);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
to {
|
|
54
|
+
height: 0px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@keyframes collapsible-down {
|
|
59
|
+
from {
|
|
60
|
+
height: var(--collapsed-height, 0px);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
to {
|
|
64
|
+
height: var(--height, 0px);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes collapsible-up {
|
|
69
|
+
from {
|
|
70
|
+
height: var(--height, 0px);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
to {
|
|
74
|
+
height: var(--collapsed-height, 0px);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@keyframes squeeze-x {
|
|
79
|
+
from {
|
|
80
|
+
transform: scaleX(1);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
50% {
|
|
84
|
+
transform: scaleX(1.15);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
to {
|
|
88
|
+
transform: scaleX(1);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@keyframes path-dash {
|
|
93
|
+
from {
|
|
94
|
+
stroke-dashoffset: var(--dash-offset-from, 0);
|
|
95
|
+
}
|
|
96
|
+
to {
|
|
97
|
+
stroke-dashoffset: var(--dash-offset-to, 0);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@keyframes fade-down-out {
|
|
102
|
+
from {
|
|
103
|
+
opacity: 1;
|
|
104
|
+
transform: translateY(0);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
to {
|
|
108
|
+
opacity: 0;
|
|
109
|
+
transform: translateY(-2rem);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@keyframes blur-in {
|
|
114
|
+
from {
|
|
115
|
+
filter: blur(1rem);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
to {
|
|
119
|
+
filter: blur(0);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@keyframes rippling {
|
|
124
|
+
0% {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
100% {
|
|
129
|
+
transform: scale(2);
|
|
130
|
+
opacity: 0;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@keyframes toast-exit-right {
|
|
135
|
+
from {
|
|
136
|
+
opacity: 1;
|
|
137
|
+
transform: translate3d(var(--reka-toast-swipe-end-x, 0), 0, 0);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
to {
|
|
141
|
+
opacity: 0;
|
|
142
|
+
transform: translate3d(calc(100% + 24px), 0, 0);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@keyframes toast-exit-left {
|
|
147
|
+
from {
|
|
148
|
+
opacity: 1;
|
|
149
|
+
transform: translate3d(var(--reka-toast-swipe-end-x, 0), 0, 0);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
to {
|
|
153
|
+
opacity: 0;
|
|
154
|
+
transform: translate3d(calc(-100% - 24px), 0, 0);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@keyframes toast-exit-top {
|
|
159
|
+
from {
|
|
160
|
+
opacity: 1;
|
|
161
|
+
transform: translate3d(0, var(--reka-toast-swipe-end-y, 0), 0);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
to {
|
|
165
|
+
opacity: 0;
|
|
166
|
+
transform: translate3d(0, calc(-100% - 24px), 0);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
@keyframes toast-exit-bottom {
|
|
171
|
+
from {
|
|
172
|
+
opacity: 1;
|
|
173
|
+
transform: translate3d(0, var(--reka-toast-swipe-end-y, 0), 0);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
to {
|
|
177
|
+
opacity: 0;
|
|
178
|
+
transform: translate3d(0, calc(100% + 24px), 0);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@keyframes skeleton-wave {
|
|
183
|
+
to {
|
|
184
|
+
background-position-x: -200%;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@keyframes spin {
|
|
189
|
+
from {
|
|
190
|
+
transform: rotate(0deg);
|
|
191
|
+
}
|
|
192
|
+
to {
|
|
193
|
+
transform: rotate(360deg);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
@keyframes fade-scale-in {
|
|
198
|
+
from {
|
|
199
|
+
opacity: 0;
|
|
200
|
+
transform: scale(0.95);
|
|
201
|
+
}
|
|
202
|
+
to {
|
|
203
|
+
opacity: 1;
|
|
204
|
+
transform: scale(1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
@keyframes fade-scale-out {
|
|
209
|
+
from {
|
|
210
|
+
opacity: 1;
|
|
211
|
+
transform: scale(1);
|
|
212
|
+
}
|
|
213
|
+
to {
|
|
214
|
+
opacity: 0;
|
|
215
|
+
transform: scale(0.9);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
@keyframes backdrop-blur-in {
|
|
220
|
+
from {
|
|
221
|
+
backdrop-filter: blur(0);
|
|
222
|
+
}
|
|
223
|
+
to {
|
|
224
|
+
backdrop-filter: blur(.3125rem);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
@keyframes backdrop-blur-out {
|
|
228
|
+
from {
|
|
229
|
+
backdrop-filter: blur(.3125rem);
|
|
230
|
+
}
|
|
231
|
+
to {
|
|
232
|
+
backdrop-filter: blur(0);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
@utility animate-check-dash {
|
|
238
|
+
--dash-offset-from: -50;
|
|
239
|
+
--dash-offset-to: 0;
|
|
240
|
+
stroke-dasharray: 50;
|
|
241
|
+
stroke-dashoffset: var(--dash-offset-from);
|
|
242
|
+
animation: path-dash var(--tw-duration, 150ms) var(--tw-timing, ease-out)
|
|
243
|
+
forwards;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@utility animate-indeterminate-dash {
|
|
247
|
+
--dash-offset-from: 50;
|
|
248
|
+
--dash-offset-to: 0;
|
|
249
|
+
stroke-dasharray: 50;
|
|
250
|
+
stroke-dashoffset: var(--dash-offset-from);
|
|
251
|
+
animation: path-dash var(--tw-duration, 150ms) linear forwards;
|
|
252
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@theme static {
|
|
2
|
+
/* z-indexes */
|
|
3
|
+
--z-base: 0;
|
|
4
|
+
--z-sticky: 10;
|
|
5
|
+
--z-dropdown: 50;
|
|
6
|
+
--z-tooltip: 100;
|
|
7
|
+
--z-fixed: 200;
|
|
8
|
+
--z-overlay: 900;
|
|
9
|
+
--z-modal: 1000;
|
|
10
|
+
--z-popover: 1100;
|
|
11
|
+
--z-toast: 1500;
|
|
12
|
+
--z-loading: 2000;
|
|
13
|
+
--z-devtools: 9999;
|
|
14
|
+
--z-max: 2147483647;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@utility overflow-anchor-none {
|
|
18
|
+
overflow-anchor: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@utility overflow-anchor-auto {
|
|
22
|
+
overflow-anchor: auto;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@utility scrollbar-none {
|
|
26
|
+
scrollbar-width: none; /* Firefox */
|
|
27
|
+
&::-webkit-scrollbar {
|
|
28
|
+
display: none; /* Chrome / Safari */
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { VariantProps } from '../../utils'
|
|
2
|
+
import { tv } from '../../utils'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-badge'
|
|
5
|
+
|
|
6
|
+
export const tvBadge = tv(
|
|
7
|
+
{
|
|
8
|
+
base: [
|
|
9
|
+
'inline-flex',
|
|
10
|
+
'items-center',
|
|
11
|
+
'rounded',
|
|
12
|
+
'uppercase',
|
|
13
|
+
'outline-none',
|
|
14
|
+
'transition-colors',
|
|
15
|
+
],
|
|
16
|
+
variants: {
|
|
17
|
+
variant: {
|
|
18
|
+
default: '',
|
|
19
|
+
secondary: '',
|
|
20
|
+
dot: ['rounded-full', '-top-[.5em]', '-right-[.5em]'],
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
xs: ['text-3xs', 'py-0.25', 'px-1'],
|
|
24
|
+
sm: ['text-2xs', 'py-0.25', 'px-1'],
|
|
25
|
+
base: ['text-xs', 'py-0.5', 'px-1.25'],
|
|
26
|
+
lg: ['text-sm', 'py-0.5', 'px-1.5'],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: 'default',
|
|
31
|
+
size: 'base',
|
|
32
|
+
},
|
|
33
|
+
compoundVariants: [
|
|
34
|
+
{
|
|
35
|
+
variant: 'dot',
|
|
36
|
+
size: 'base',
|
|
37
|
+
class: ['p-0', 'size-[.375rem]'],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
variant: 'dot',
|
|
41
|
+
size: 'sm',
|
|
42
|
+
class: ['p-0', 'size-[.25rem]'],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
variant: 'dot',
|
|
46
|
+
size: 'lg',
|
|
47
|
+
class: ['p-0', 'size-[.5rem]'],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
class: prefix,
|
|
53
|
+
},
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
export type BadgeVariants = VariantProps<typeof tvBadge>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { VariantProps } from '../../utils'
|
|
2
|
+
import { tv } from '../../utils'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-btn'
|
|
5
|
+
|
|
6
|
+
export const tvButton = tv(
|
|
7
|
+
{
|
|
8
|
+
slots: {
|
|
9
|
+
root: [
|
|
10
|
+
'inline-flex',
|
|
11
|
+
'items-center',
|
|
12
|
+
'justify-center',
|
|
13
|
+
'rounded',
|
|
14
|
+
'border',
|
|
15
|
+
'transition-all',
|
|
16
|
+
'disabled:pointer-events-none',
|
|
17
|
+
'disabled:opacity-(--disabled-opacity)',
|
|
18
|
+
'[&_svg]:pointer-events-none',
|
|
19
|
+
'[&_svg]:shrink-0',
|
|
20
|
+
],
|
|
21
|
+
loading: 'size-[1lh] animate-spin',
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
default: '',
|
|
26
|
+
normal: '',
|
|
27
|
+
outline: '',
|
|
28
|
+
text: '',
|
|
29
|
+
icon: {
|
|
30
|
+
root: ['p-0', 'aspect-square', 'border-none'],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
size: {
|
|
34
|
+
xs: {
|
|
35
|
+
root: 'h-6 px-3 gap-1.5 text-xs',
|
|
36
|
+
},
|
|
37
|
+
sm: {
|
|
38
|
+
root: 'h-7 px-4 gap-2 text-sm',
|
|
39
|
+
},
|
|
40
|
+
base: {
|
|
41
|
+
root: 'h-8 px-5 gap-2.5 text-base',
|
|
42
|
+
},
|
|
43
|
+
lg: {
|
|
44
|
+
root: 'h-9 px-6 gap-3 text-lg',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
loading: {
|
|
48
|
+
true: {
|
|
49
|
+
root: 'pointer-events-none',
|
|
50
|
+
},
|
|
51
|
+
false: '',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
defaultVariants: {
|
|
55
|
+
variant: 'default',
|
|
56
|
+
size: 'base',
|
|
57
|
+
loading: false,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
slots: {
|
|
62
|
+
root: prefix,
|
|
63
|
+
loading: `${prefix}-loading`,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
export type ButtonVariants = VariantProps<typeof tvButton>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { VariantProps } from '../../utils'
|
|
2
|
+
import { tv } from '../../utils'
|
|
3
|
+
|
|
4
|
+
const prefix = 'rui-checkbox'
|
|
5
|
+
|
|
6
|
+
export const tvCheckbox = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
root: ['flex', 'items-center', 'gap-2.5', 'w-fit'],
|
|
9
|
+
control: ['peer', 'shrink-0', 'rounded-xs', 'border'],
|
|
10
|
+
indicator: ['flex', 'h-full', 'w-full', 'items-center', 'justify-center', 'text-inherit'],
|
|
11
|
+
indicatorChecked: 'size-[0.875lh] stroke-black stroke-[.125rem] [&>path]:animate-check-dash',
|
|
12
|
+
indicatorMinus: 'size-[0.875lh] stroke-black stroke-[.125rem] [&_path]:animate-indeterminate-dash',
|
|
13
|
+
label: '',
|
|
14
|
+
},
|
|
15
|
+
variants: {
|
|
16
|
+
disabled: {
|
|
17
|
+
true: '',
|
|
18
|
+
false: '',
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
xs: '',
|
|
22
|
+
sm: '',
|
|
23
|
+
base: '',
|
|
24
|
+
lg: '',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
size: 'base',
|
|
29
|
+
},
|
|
30
|
+
compoundVariants: [
|
|
31
|
+
{
|
|
32
|
+
size: 'xs',
|
|
33
|
+
class: {
|
|
34
|
+
control: 'size-3.5',
|
|
35
|
+
label: 'text-xs',
|
|
36
|
+
indicator: 'text-xs',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
size: 'sm',
|
|
41
|
+
class: {
|
|
42
|
+
control: 'size-4',
|
|
43
|
+
label: 'text-sm',
|
|
44
|
+
indicator: 'text-sm',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
size: 'base',
|
|
49
|
+
class: {
|
|
50
|
+
control: 'size-4.5',
|
|
51
|
+
label: 'text-base',
|
|
52
|
+
indicator: 'text-base',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
size: 'lg',
|
|
57
|
+
class: {
|
|
58
|
+
control: 'size-5',
|
|
59
|
+
label: 'text-lg',
|
|
60
|
+
indicator: 'text-lg',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
}, {
|
|
65
|
+
slots: {
|
|
66
|
+
root: prefix,
|
|
67
|
+
control: `${prefix}-control`,
|
|
68
|
+
indicator: `${prefix}-indicator`,
|
|
69
|
+
indicatorChecked: `${prefix}-indicator-checked`,
|
|
70
|
+
indicatorMinus: `${prefix}-indicator-minus`,
|
|
71
|
+
label: `${prefix}-label`,
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
export type CheckboxVariants = VariantProps<typeof tvCheckbox>
|