cronixui 1.0.5 → 1.0.6
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/package.json +5 -1
- package/packages/go/cronixui/go.mod +2 -9
- package/packages/go/cronixui/tokens.go +129 -0
- package/packages/python/cronixui/__init__.py +75 -1
- package/packages/python/cronixui/tokens.py +200 -0
- package/packages/rust/cronixui/src/lib.rs +2 -0
- package/packages/rust/cronixui/src/tokens.rs +137 -0
- package/packages/web/src/tokens.ts +120 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cronixui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "CronixUI - A dark-themed UI toolkit with crimson accents and Outfit typography. Available for JavaScript, TypeScript, Python, Go, and Rust.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
"import": "./packages/react/src/index.js",
|
|
31
31
|
"types": "./packages/react/src/index.d.ts"
|
|
32
32
|
},
|
|
33
|
+
"./tokens": {
|
|
34
|
+
"import": "./packages/web/src/tokens.ts",
|
|
35
|
+
"types": "./packages/web/src/tokens.ts"
|
|
36
|
+
},
|
|
33
37
|
"./css": "./packages/web/dist/cronixui.css",
|
|
34
38
|
"./css/min": "./packages/web/dist/cronixui.min.css",
|
|
35
39
|
"./js": "./packages/web/dist/cronixui.js",
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
name = "cronixui"
|
|
3
|
-
version = "1.0.2"
|
|
4
|
-
description = "CronixUI - A dark-themed UI toolkit with crimson accents and Outfit typography"
|
|
5
|
-
license = "GPL-3.0"
|
|
6
|
-
authors = ["CazyUndee"]
|
|
7
|
-
keywords = ["ui", "dark-mode", "design-system", "components"]
|
|
1
|
+
module github.com/CazyUndee/CronixUI/packages/go/cronixui
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
path = "cronixui.go"
|
|
3
|
+
go 1.21
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
package cronixui
|
|
2
|
+
|
|
3
|
+
// Color represents a color token
|
|
4
|
+
type Color struct {
|
|
5
|
+
Hex string
|
|
6
|
+
R int
|
|
7
|
+
G int
|
|
8
|
+
B int
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Background colors
|
|
12
|
+
var (
|
|
13
|
+
BG = Color{Hex: "#0a0a0a", R: 10, G: 10, B: 10}
|
|
14
|
+
Surface = Color{Hex: "#111111", R: 17, G: 17, B: 17}
|
|
15
|
+
Surface2 = Color{Hex: "#1a1a1a", R: 26, G: 26, B: 26}
|
|
16
|
+
Surface3 = Color{Hex: "#222222", R: 34, G: 34, B: 34}
|
|
17
|
+
Surface4 = Color{Hex: "#2a2a2a", R: 42, G: 42, B: 42}
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
// Text colors
|
|
21
|
+
var (
|
|
22
|
+
Text = Color{Hex: "#f0ede8", R: 240, G: 237, B: 232}
|
|
23
|
+
TextMuted = "rgba(240, 237, 232, 0.5)"
|
|
24
|
+
TextDim = "rgba(240, 237, 232, 0.25)"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
// Accent colors (Crimson)
|
|
28
|
+
var (
|
|
29
|
+
Accent = Color{Hex: "#6b2323", R: 107, G: 35, B: 35}
|
|
30
|
+
AccentHover = Color{Hex: "#7d2a2a", R: 125, G: 42, B: 42}
|
|
31
|
+
AccentLight = Color{Hex: "#8a3535", R: 138, G: 53, B: 53}
|
|
32
|
+
AccentGlow = "rgba(107, 35, 35, 0.3)"
|
|
33
|
+
AccentText = Color{Hex: "#c97a7a", R: 201, G: 122, B: 122}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
// Semantic colors
|
|
37
|
+
var (
|
|
38
|
+
Success = Color{Hex: "#1e5028", R: 30, G: 80, B: 40}
|
|
39
|
+
SuccessBorder = "rgba(60, 140, 70, 0.4)"
|
|
40
|
+
SuccessText = Color{Hex: "#6bc47a", R: 107, G: 196, B: 122}
|
|
41
|
+
|
|
42
|
+
Warning = Color{Hex: "#503c14", R: 80, G: 60, B: 20}
|
|
43
|
+
WarningBorder = "rgba(150, 110, 30, 0.4)"
|
|
44
|
+
WarningText = Color{Hex: "#c4a43a", R: 196, G: 164, B: 58}
|
|
45
|
+
|
|
46
|
+
Error_ = Color{Hex: "#501414", R: 80, G: 20, B: 20}
|
|
47
|
+
ErrorBorder = "rgba(180, 60, 60, 0.4)"
|
|
48
|
+
ErrorText = Color{Hex: "#c46b6b", R: 196, G: 107, B: 107}
|
|
49
|
+
|
|
50
|
+
Info = Color{Hex: "#143550", R: 20, G: 53, B: 80}
|
|
51
|
+
InfoBorder = "rgba(60, 140, 200, 0.4)"
|
|
52
|
+
InfoText = Color{Hex: "#6ba8c4", R: 107, G: 168, B: 196}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
// Border colors
|
|
56
|
+
var (
|
|
57
|
+
Border = "rgba(255, 255, 255, 0.08)"
|
|
58
|
+
BorderHover = "rgba(255, 255, 255, 0.15)"
|
|
59
|
+
BorderFocus = "rgba(255, 255, 255, 0.25)"
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
// Typography tokens
|
|
63
|
+
var (
|
|
64
|
+
FontFamily = "'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
65
|
+
FontMono = "'JetBrains Mono', 'Fira Code', 'Consolas', monospace"
|
|
66
|
+
FontSizeXs = 11
|
|
67
|
+
FontSizeSm = 12
|
|
68
|
+
FontSizeBase = 13
|
|
69
|
+
FontSizeMd = 14
|
|
70
|
+
FontSizeLg = 16
|
|
71
|
+
FontSizeXl = 20
|
|
72
|
+
FontSize2xl = 28
|
|
73
|
+
FontSize3xl = 36
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
// Spacing tokens
|
|
77
|
+
var (
|
|
78
|
+
Space1 = 4
|
|
79
|
+
Space2 = 8
|
|
80
|
+
Space3 = 12
|
|
81
|
+
Space4 = 16
|
|
82
|
+
Space5 = 20
|
|
83
|
+
Space6 = 24
|
|
84
|
+
Space8 = 32
|
|
85
|
+
Space10 = 40
|
|
86
|
+
Space12 = 48
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
// Border radius tokens
|
|
90
|
+
var (
|
|
91
|
+
RadiusSm = 6
|
|
92
|
+
Radius = 10
|
|
93
|
+
RadiusLg = 14
|
|
94
|
+
RadiusXl = 20
|
|
95
|
+
RadiusFull = 9999
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
// Shadow tokens
|
|
99
|
+
var (
|
|
100
|
+
ShadowSm = "0 1px 2px rgba(0, 0, 0, 0.3)"
|
|
101
|
+
Shadow = "0 4px 12px rgba(0, 0, 0, 0.4)"
|
|
102
|
+
ShadowLg = "0 8px 24px rgba(0, 0, 0, 0.5)"
|
|
103
|
+
ShadowGlow = "0 0 20px rgba(107, 35, 35, 0.3)"
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
// Transition tokens
|
|
107
|
+
var (
|
|
108
|
+
TransitionFast = "0.1s ease"
|
|
109
|
+
TransitionDefault = "0.15s ease"
|
|
110
|
+
TransitionSlow = "0.25s ease"
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
// Z-index tokens
|
|
114
|
+
var (
|
|
115
|
+
ZIndexDropdown = 100
|
|
116
|
+
ZIndexSticky = 200
|
|
117
|
+
ZIndexFixed = 300
|
|
118
|
+
ZIndexModalBackdrop = 400
|
|
119
|
+
ZIndexModal = 500
|
|
120
|
+
ZIndexPopover = 600
|
|
121
|
+
ZIndexTooltip = 700
|
|
122
|
+
ZIndexToast = 800
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
// Layout tokens
|
|
126
|
+
var (
|
|
127
|
+
ContainerMax = 1200
|
|
128
|
+
SidebarWidth = 260
|
|
129
|
+
)
|
|
@@ -13,8 +13,45 @@ from .command_palette import CommandPalette, CommandPaletteItem
|
|
|
13
13
|
from .search import Search, SearchItem
|
|
14
14
|
from .nav import Nav
|
|
15
15
|
from .core import init, query, query_all, create_el
|
|
16
|
+
from .tokens import (
|
|
17
|
+
BG,
|
|
18
|
+
SURFACE,
|
|
19
|
+
SURFACE_2,
|
|
20
|
+
SURFACE_3,
|
|
21
|
+
SURFACE_4,
|
|
22
|
+
TEXT,
|
|
23
|
+
TEXT_MUTED,
|
|
24
|
+
TEXT_DIM,
|
|
25
|
+
ACCENT,
|
|
26
|
+
ACCENT_HOVER,
|
|
27
|
+
ACCENT_LIGHT,
|
|
28
|
+
ACCENT_GLOW,
|
|
29
|
+
ACCENT_TEXT,
|
|
30
|
+
SUCCESS,
|
|
31
|
+
SUCCESS_BORDER,
|
|
32
|
+
SUCCESS_TEXT,
|
|
33
|
+
WARNING,
|
|
34
|
+
WARNING_BORDER,
|
|
35
|
+
WARNING_TEXT,
|
|
36
|
+
ERROR,
|
|
37
|
+
ERROR_BORDER,
|
|
38
|
+
ERROR_TEXT,
|
|
39
|
+
INFO,
|
|
40
|
+
INFO_BORDER,
|
|
41
|
+
INFO_TEXT,
|
|
42
|
+
BORDER,
|
|
43
|
+
BORDER_HOVER,
|
|
44
|
+
BORDER_FOCUS,
|
|
45
|
+
typography,
|
|
46
|
+
spacing,
|
|
47
|
+
radius,
|
|
48
|
+
shadow,
|
|
49
|
+
transition,
|
|
50
|
+
z_index,
|
|
51
|
+
layout,
|
|
52
|
+
)
|
|
16
53
|
|
|
17
|
-
__version__ = "1.0.
|
|
54
|
+
__version__ = "1.0.5"
|
|
18
55
|
__all__ = [
|
|
19
56
|
"Toast",
|
|
20
57
|
"Toggle",
|
|
@@ -32,4 +69,41 @@ __all__ = [
|
|
|
32
69
|
"query",
|
|
33
70
|
"query_all",
|
|
34
71
|
"create_el",
|
|
72
|
+
# Colors
|
|
73
|
+
"BG",
|
|
74
|
+
"SURFACE",
|
|
75
|
+
"SURFACE_2",
|
|
76
|
+
"SURFACE_3",
|
|
77
|
+
"SURFACE_4",
|
|
78
|
+
"TEXT",
|
|
79
|
+
"TEXT_MUTED",
|
|
80
|
+
"TEXT_DIM",
|
|
81
|
+
"ACCENT",
|
|
82
|
+
"ACCENT_HOVER",
|
|
83
|
+
"ACCENT_LIGHT",
|
|
84
|
+
"ACCENT_GLOW",
|
|
85
|
+
"ACCENT_TEXT",
|
|
86
|
+
"SUCCESS",
|
|
87
|
+
"SUCCESS_BORDER",
|
|
88
|
+
"SUCCESS_TEXT",
|
|
89
|
+
"WARNING",
|
|
90
|
+
"WARNING_BORDER",
|
|
91
|
+
"WARNING_TEXT",
|
|
92
|
+
"ERROR",
|
|
93
|
+
"ERROR_BORDER",
|
|
94
|
+
"ERROR_TEXT",
|
|
95
|
+
"INFO",
|
|
96
|
+
"INFO_BORDER",
|
|
97
|
+
"INFO_TEXT",
|
|
98
|
+
"BORDER",
|
|
99
|
+
"BORDER_HOVER",
|
|
100
|
+
"BORDER_FOCUS",
|
|
101
|
+
# Token objects
|
|
102
|
+
"typography",
|
|
103
|
+
"spacing",
|
|
104
|
+
"radius",
|
|
105
|
+
"shadow",
|
|
106
|
+
"transition",
|
|
107
|
+
"z_index",
|
|
108
|
+
"layout",
|
|
35
109
|
]
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CronixUI Design Tokens
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from typing import Tuple
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass(frozen=True)
|
|
10
|
+
class Color:
|
|
11
|
+
"""Color token."""
|
|
12
|
+
|
|
13
|
+
hex: str
|
|
14
|
+
rgb: Tuple[int, int, int]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# Background colors
|
|
18
|
+
BG = Color("#0a0a0a", (10, 10, 10))
|
|
19
|
+
SURFACE = Color("#111111", (17, 17, 17))
|
|
20
|
+
SURFACE_2 = Color("#1a1a1a", (26, 26, 26))
|
|
21
|
+
SURFACE_3 = Color("#222222", (34, 34, 34))
|
|
22
|
+
SURFACE_4 = Color("#2a2a2a", (42, 42, 42))
|
|
23
|
+
|
|
24
|
+
# Text colors
|
|
25
|
+
TEXT = Color("#f0ede8", (240, 237, 232))
|
|
26
|
+
TEXT_MUTED = "rgba(240, 237, 232, 0.5)"
|
|
27
|
+
TEXT_DIM = "rgba(240, 237, 232, 0.25)"
|
|
28
|
+
|
|
29
|
+
# Accent (Crimson)
|
|
30
|
+
ACCENT = Color("#6b2323", (107, 35, 35))
|
|
31
|
+
ACCENT_HOVER = Color("#7d2a2a", (125, 42, 42))
|
|
32
|
+
ACCENT_LIGHT = Color("#8a3535", (138, 53, 53))
|
|
33
|
+
ACCENT_GLOW = "rgba(107, 35, 35, 0.3)"
|
|
34
|
+
ACCENT_TEXT = Color("#c97a7a", (201, 122, 122))
|
|
35
|
+
|
|
36
|
+
# Semantic colors
|
|
37
|
+
SUCCESS = Color("#1e5028", (30, 80, 40))
|
|
38
|
+
SUCCESS_BORDER = "rgba(60, 140, 70, 0.4)"
|
|
39
|
+
SUCCESS_TEXT = Color("#6bc47a", (107, 196, 122))
|
|
40
|
+
|
|
41
|
+
WARNING = Color("#503c14", (80, 60, 20))
|
|
42
|
+
WARNING_BORDER = "rgba(150, 110, 30, 0.4)"
|
|
43
|
+
WARNING_TEXT = Color("#c4a43a", (196, 164, 58))
|
|
44
|
+
|
|
45
|
+
ERROR = Color("#501414", (80, 20, 20))
|
|
46
|
+
ERROR_BORDER = "rgba(180, 60, 60, 0.4)"
|
|
47
|
+
ERROR_TEXT = Color("#c46b6b", (196, 107, 107))
|
|
48
|
+
|
|
49
|
+
INFO = Color("#143550", (20, 53, 80))
|
|
50
|
+
INFO_BORDER = "rgba(60, 140, 200, 0.4)"
|
|
51
|
+
INFO_TEXT = Color("#6ba8c4", (107, 168, 196))
|
|
52
|
+
|
|
53
|
+
# Border
|
|
54
|
+
BORDER = "rgba(255, 255, 255, 0.08)"
|
|
55
|
+
BORDER_HOVER = "rgba(255, 255, 255, 0.15)"
|
|
56
|
+
BORDER_FOCUS = "rgba(255, 255, 255, 0.25)"
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@dataclass(frozen=True)
|
|
60
|
+
class Typography:
|
|
61
|
+
"""Typography tokens."""
|
|
62
|
+
|
|
63
|
+
font_family: str = (
|
|
64
|
+
"'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"
|
|
65
|
+
)
|
|
66
|
+
font_mono: str = "'JetBrains Mono', 'Fira Code', 'Consolas', monospace"
|
|
67
|
+
|
|
68
|
+
# Font sizes
|
|
69
|
+
xs: int = 11
|
|
70
|
+
sm: int = 12
|
|
71
|
+
base: int = 13
|
|
72
|
+
md: int = 14
|
|
73
|
+
lg: int = 16
|
|
74
|
+
xl: int = 20
|
|
75
|
+
xxl: int = 28
|
|
76
|
+
xxxl: int = 36
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@dataclass(frozen=True)
|
|
80
|
+
class Spacing:
|
|
81
|
+
"""Spacing tokens."""
|
|
82
|
+
|
|
83
|
+
space_1: int = 4
|
|
84
|
+
space_2: int = 8
|
|
85
|
+
space_3: int = 12
|
|
86
|
+
space_4: int = 16
|
|
87
|
+
space_5: int = 20
|
|
88
|
+
space_6: int = 24
|
|
89
|
+
space_8: int = 32
|
|
90
|
+
space_10: int = 40
|
|
91
|
+
space_12: int = 48
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@dataclass(frozen=True)
|
|
95
|
+
class Radius:
|
|
96
|
+
"""Border radius tokens."""
|
|
97
|
+
|
|
98
|
+
sm: int = 6
|
|
99
|
+
default: int = 10
|
|
100
|
+
lg: int = 14
|
|
101
|
+
xl: int = 20
|
|
102
|
+
full: int = 9999
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@dataclass(frozen=True)
|
|
106
|
+
class Shadow:
|
|
107
|
+
"""Shadow tokens."""
|
|
108
|
+
|
|
109
|
+
sm: str = "0 1px 2px rgba(0, 0, 0, 0.3)"
|
|
110
|
+
default: str = "0 4px 12px rgba(0, 0, 0, 0.4)"
|
|
111
|
+
lg: str = "0 8px 24px rgba(0, 0, 0, 0.5)"
|
|
112
|
+
glow: str = "0 0 20px rgba(107, 35, 35, 0.3)"
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
@dataclass(frozen=True)
|
|
116
|
+
class Transition:
|
|
117
|
+
"""Transition tokens."""
|
|
118
|
+
|
|
119
|
+
fast: str = "0.1s ease"
|
|
120
|
+
default: str = "0.15s ease"
|
|
121
|
+
slow: str = "0.25s ease"
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
@dataclass(frozen=True)
|
|
125
|
+
class ZIndex:
|
|
126
|
+
"""Z-index tokens."""
|
|
127
|
+
|
|
128
|
+
dropdown: int = 100
|
|
129
|
+
sticky: int = 200
|
|
130
|
+
fixed: int = 300
|
|
131
|
+
modal_backdrop: int = 400
|
|
132
|
+
modal: int = 500
|
|
133
|
+
popover: int = 600
|
|
134
|
+
tooltip: int = 700
|
|
135
|
+
toast: int = 800
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
@dataclass(frozen=True)
|
|
139
|
+
class Layout:
|
|
140
|
+
"""Layout tokens."""
|
|
141
|
+
|
|
142
|
+
container_max: int = 1200
|
|
143
|
+
sidebar_width: int = 260
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# Token instances
|
|
147
|
+
typography = Typography()
|
|
148
|
+
spacing = Spacing()
|
|
149
|
+
radius = Radius()
|
|
150
|
+
shadow = Shadow()
|
|
151
|
+
transition = Transition()
|
|
152
|
+
z_index = ZIndex()
|
|
153
|
+
layout = Layout()
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
__all__ = [
|
|
157
|
+
"Color",
|
|
158
|
+
"BG",
|
|
159
|
+
"SURFACE",
|
|
160
|
+
"SURFACE_2",
|
|
161
|
+
"SURFACE_3",
|
|
162
|
+
"SURFACE_4",
|
|
163
|
+
"TEXT",
|
|
164
|
+
"TEXT_MUTED",
|
|
165
|
+
"TEXT_DIM",
|
|
166
|
+
"ACCENT",
|
|
167
|
+
"ACCENT_HOVER",
|
|
168
|
+
"ACCENT_LIGHT",
|
|
169
|
+
"ACCENT_GLOW",
|
|
170
|
+
"ACCENT_TEXT",
|
|
171
|
+
"SUCCESS",
|
|
172
|
+
"SUCCESS_BORDER",
|
|
173
|
+
"SUCCESS_TEXT",
|
|
174
|
+
"WARNING",
|
|
175
|
+
"WARNING_BORDER",
|
|
176
|
+
"WARNING_TEXT",
|
|
177
|
+
"ERROR",
|
|
178
|
+
"ERROR_BORDER",
|
|
179
|
+
"ERROR_TEXT",
|
|
180
|
+
"INFO",
|
|
181
|
+
"INFO_BORDER",
|
|
182
|
+
"INFO_TEXT",
|
|
183
|
+
"BORDER",
|
|
184
|
+
"BORDER_HOVER",
|
|
185
|
+
"BORDER_FOCUS",
|
|
186
|
+
"Typography",
|
|
187
|
+
"typography",
|
|
188
|
+
"Spacing",
|
|
189
|
+
"spacing",
|
|
190
|
+
"Radius",
|
|
191
|
+
"radius",
|
|
192
|
+
"Shadow",
|
|
193
|
+
"shadow",
|
|
194
|
+
"Transition",
|
|
195
|
+
"transition",
|
|
196
|
+
"ZIndex",
|
|
197
|
+
"z_index",
|
|
198
|
+
"Layout",
|
|
199
|
+
"layout",
|
|
200
|
+
]
|
|
@@ -25,6 +25,7 @@ mod accordion;
|
|
|
25
25
|
mod pagination;
|
|
26
26
|
mod command_palette;
|
|
27
27
|
mod search;
|
|
28
|
+
mod tokens;
|
|
28
29
|
|
|
29
30
|
pub use toast::{Toast, ToastType};
|
|
30
31
|
pub use toggle::Toggle;
|
|
@@ -35,6 +36,7 @@ pub use accordion::Accordion;
|
|
|
35
36
|
pub use pagination::Pagination;
|
|
36
37
|
pub use command_palette::{CommandPalette, CommandPaletteItem};
|
|
37
38
|
pub use search::{Search, SearchItem};
|
|
39
|
+
pub use tokens::*;
|
|
38
40
|
|
|
39
41
|
/// Initialize CronixUI
|
|
40
42
|
pub fn init() {
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//! Design tokens for CronixUI
|
|
2
|
+
|
|
3
|
+
use std::fmt;
|
|
4
|
+
|
|
5
|
+
/// Color representation
|
|
6
|
+
#[derive(Debug, Clone, Copy)]
|
|
7
|
+
pub struct Color {
|
|
8
|
+
pub hex: &'static str,
|
|
9
|
+
pub r: u8,
|
|
10
|
+
pub g: u8,
|
|
11
|
+
pub b: u8,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl fmt::Display for Color {
|
|
15
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
16
|
+
write!(f, "{}", self.hex)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Background colors
|
|
21
|
+
pub const BG: Color = Color { hex: "#0a0a0a", r: 10, g: 10, b: 10 };
|
|
22
|
+
pub const SURFACE: Color = Color { hex: "#111111", r: 17, g: 17, b: 17 };
|
|
23
|
+
pub const SURFACE_2: Color = Color { hex: "#1a1a1a", r: 26, g: 26, b: 26 };
|
|
24
|
+
pub const SURFACE_3: Color = Color { hex: "#222222", r: 34, g: 34, b: 34 };
|
|
25
|
+
pub const SURFACE_4: Color = Color { hex: "#2a2a2a", r: 42, g: 42, b: 42 };
|
|
26
|
+
|
|
27
|
+
// Text colors
|
|
28
|
+
pub const TEXT: Color = Color { hex: "#f0ede8", r: 240, g: 237, b: 232 };
|
|
29
|
+
pub const TEXT_MUTED: &str = "rgba(240, 237, 232, 0.5)";
|
|
30
|
+
pub const TEXT_DIM: &str = "rgba(240, 237, 232, 0.25)";
|
|
31
|
+
|
|
32
|
+
// Accent colors (Crimson)
|
|
33
|
+
pub const ACCENT: Color = Color { hex: "#6b2323", r: 107, g: 35, b: 35 };
|
|
34
|
+
pub const ACCENT_HOVER: Color = Color { hex: "#7d2a2a", r: 125, g: 42, b: 42 };
|
|
35
|
+
pub const ACCENT_LIGHT: Color = Color { hex: "#8a3535", r: 138, g: 53, b: 53 };
|
|
36
|
+
pub const ACCENT_GLOW: &str = "rgba(107, 35, 35, 0.3)";
|
|
37
|
+
pub const ACCENT_TEXT: Color = Color { hex: "#c97a7a", r: 201, g: 122, b: 122 };
|
|
38
|
+
|
|
39
|
+
// Semantic colors - Success
|
|
40
|
+
pub const SUCCESS: Color = Color { hex: "#1e5028", r: 30, g: 80, b: 40 };
|
|
41
|
+
pub const SUCCESS_BORDER: &str = "rgba(60, 140, 70, 0.4)";
|
|
42
|
+
pub const SUCCESS_TEXT: Color = Color { hex: "#6bc47a", r: 107, g: 196, b: 122 };
|
|
43
|
+
|
|
44
|
+
// Semantic colors - Warning
|
|
45
|
+
pub const WARNING: Color = Color { hex: "#503c14", r: 80, g: 60, b: 20 };
|
|
46
|
+
pub const WARNING_BORDER: &str = "rgba(150, 110, 30, 0.4)";
|
|
47
|
+
pub const WARNING_TEXT: Color = Color { hex: "#c4a43a", r: 196, g: 164, b: 58 };
|
|
48
|
+
|
|
49
|
+
// Semantic colors - Error
|
|
50
|
+
pub const ERROR: Color = Color { hex: "#501414", r: 80, g: 20, b: 20 };
|
|
51
|
+
pub const ERROR_BORDER: &str = "rgba(180, 60, 60, 0.4)";
|
|
52
|
+
pub const ERROR_TEXT: Color = Color { hex: "#c46b6b", r: 196, g: 107, b: 107 };
|
|
53
|
+
|
|
54
|
+
// Semantic colors - Info
|
|
55
|
+
pub const INFO: Color = Color { hex: "#143550", r: 20, g: 53, b: 80 };
|
|
56
|
+
pub const INFO_BORDER: &str = "rgba(60, 140, 200, 0.4)";
|
|
57
|
+
pub const INFO_TEXT: Color = Color { hex: "#6ba8c4", r: 107, g: 168, b: 196 };
|
|
58
|
+
|
|
59
|
+
// Border colors
|
|
60
|
+
pub const BORDER: &str = "rgba(255, 255, 255, 0.08)";
|
|
61
|
+
pub const BORDER_HOVER: &str = "rgba(255, 255, 255, 0.15)";
|
|
62
|
+
pub const BORDER_FOCUS: &str = "rgba(255, 255, 255, 0.25)";
|
|
63
|
+
|
|
64
|
+
// Typography
|
|
65
|
+
pub const FONT_FAMILY: &str = "'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";
|
|
66
|
+
pub const FONT_MONO: &str = "'JetBrains Mono', 'Fira Code', 'Consolas', monospace";
|
|
67
|
+
|
|
68
|
+
pub const FONT_SIZE_XS: u8 = 11;
|
|
69
|
+
pub const FONT_SIZE_SM: u8 = 12;
|
|
70
|
+
pub const FONT_SIZE_BASE: u8 = 13;
|
|
71
|
+
pub const FONT_SIZE_MD: u8 = 14;
|
|
72
|
+
pub const FONT_SIZE_LG: u8 = 16;
|
|
73
|
+
pub const FONT_SIZE_XL: u8 = 20;
|
|
74
|
+
pub const FONT_SIZE_2XL: u8 = 28;
|
|
75
|
+
pub const FONT_SIZE_3XL: u8 = 36;
|
|
76
|
+
|
|
77
|
+
// Spacing
|
|
78
|
+
pub const SPACE_1: u8 = 4;
|
|
79
|
+
pub const SPACE_2: u8 = 8;
|
|
80
|
+
pub const SPACE_3: u8 = 12;
|
|
81
|
+
pub const SPACE_4: u8 = 16;
|
|
82
|
+
pub const SPACE_5: u8 = 20;
|
|
83
|
+
pub const SPACE_6: u8 = 24;
|
|
84
|
+
pub const SPACE_8: u8 = 32;
|
|
85
|
+
pub const SPACE_10: u8 = 40;
|
|
86
|
+
pub const SPACE_12: u8 = 48;
|
|
87
|
+
|
|
88
|
+
// Border radius
|
|
89
|
+
pub const RADIUS_SM: u8 = 6;
|
|
90
|
+
pub const RADIUS: u8 = 10;
|
|
91
|
+
pub const RADIUS_LG: u8 = 14;
|
|
92
|
+
pub const RADIUS_XL: u8 = 20;
|
|
93
|
+
pub const RADIUS_FULL: u16 = 9999;
|
|
94
|
+
|
|
95
|
+
// Shadows
|
|
96
|
+
pub const SHADOW_SM: &str = "0 1px 2px rgba(0, 0, 0, 0.3)";
|
|
97
|
+
pub const SHADOW: &str = "0 4px 12px rgba(0, 0, 0, 0.4)";
|
|
98
|
+
pub const SHADOW_LG: &str = "0 8px 24px rgba(0, 0, 0, 0.5)";
|
|
99
|
+
pub const SHADOW_GLOW: &str = "0 0 20px rgba(107, 35, 35, 0.3)";
|
|
100
|
+
|
|
101
|
+
// Transitions
|
|
102
|
+
pub const TRANSITION_FAST: &str = "0.1s ease";
|
|
103
|
+
pub const TRANSITION_DEFAULT: &str = "0.15s ease";
|
|
104
|
+
pub const TRANSITION_SLOW: &str = "0.25s ease";
|
|
105
|
+
|
|
106
|
+
// Z-index
|
|
107
|
+
pub const Z_INDEX_DROPDOWN: u16 = 100;
|
|
108
|
+
pub const Z_INDEX_STICKY: u16 = 200;
|
|
109
|
+
pub const Z_INDEX_FIXED: u16 = 300;
|
|
110
|
+
pub const Z_INDEX_MODAL_BACKDROP: u16 = 400;
|
|
111
|
+
pub const Z_INDEX_MODAL: u16 = 500;
|
|
112
|
+
pub const Z_INDEX_POPOVER: u16 = 600;
|
|
113
|
+
pub const Z_INDEX_TOOLTIP: u16 = 700;
|
|
114
|
+
pub const Z_INDEX_TOAST: u16 = 800;
|
|
115
|
+
|
|
116
|
+
// Layout
|
|
117
|
+
pub const CONTAINER_MAX: u16 = 1200;
|
|
118
|
+
pub const SIDEBAR_WIDTH: u16 = 260;
|
|
119
|
+
|
|
120
|
+
#[cfg(test)]
|
|
121
|
+
mod tests {
|
|
122
|
+
use super::*;
|
|
123
|
+
|
|
124
|
+
#[test]
|
|
125
|
+
fn test_colors() {
|
|
126
|
+
assert_eq!(BG.hex, "#0a0a0a");
|
|
127
|
+
assert_eq!(ACCENT.hex, "#6b2323");
|
|
128
|
+
assert_eq!(TEXT.r, 240);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
#[test]
|
|
132
|
+
fn test_spacing() {
|
|
133
|
+
assert_eq!(SPACE_1, 4);
|
|
134
|
+
assert_eq!(SPACE_4, 16);
|
|
135
|
+
assert_eq!(SPACE_12, 48);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export interface ColorToken {
|
|
2
|
+
hex: string;
|
|
3
|
+
r: number;
|
|
4
|
+
g: number;
|
|
5
|
+
b: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Background colors
|
|
9
|
+
export const BG: ColorToken = { hex: '#0a0a0a', r: 10, g: 10, b: 10 };
|
|
10
|
+
export const SURFACE: ColorToken = { hex: '#111111', r: 17, g: 17, b: 17 };
|
|
11
|
+
export const SURFACE_2: ColorToken = { hex: '#1a1a1a', r: 26, g: 26, b: 26 };
|
|
12
|
+
export const SURFACE_3: ColorToken = { hex: '#222222', r: 34, g: 34, b: 34 };
|
|
13
|
+
export const SURFACE_4: ColorToken = { hex: '#2a2a2a', r: 42, g: 42, b: 42 };
|
|
14
|
+
|
|
15
|
+
// Text colors
|
|
16
|
+
export const TEXT: ColorToken = { hex: '#f0ede8', r: 240, g: 237, b: 232 };
|
|
17
|
+
export const TEXT_MUTED = 'rgba(240, 237, 232, 0.5)' as const;
|
|
18
|
+
export const TEXT_DIM = 'rgba(240, 237, 232, 0.25)' as const;
|
|
19
|
+
|
|
20
|
+
// Accent colors (Crimson)
|
|
21
|
+
export const ACCENT: ColorToken = { hex: '#6b2323', r: 107, g: 35, b: 35 };
|
|
22
|
+
export const ACCENT_HOVER: ColorToken = { hex: '#7d2a2a', r: 125, g: 42, b: 42 };
|
|
23
|
+
export const ACCENT_LIGHT: ColorToken = { hex: '#8a3535', r: 138, g: 53, b: 53 };
|
|
24
|
+
export const ACCENT_GLOW = 'rgba(107, 35, 35, 0.3)' as const;
|
|
25
|
+
export const ACCENT_TEXT: ColorToken = { hex: '#c97a7a', r: 201, g: 122, b: 122 };
|
|
26
|
+
|
|
27
|
+
// Semantic colors - Success
|
|
28
|
+
export const SUCCESS: ColorToken = { hex: '#1e5028', r: 30, g: 80, b: 40 };
|
|
29
|
+
export const SUCCESS_BORDER = 'rgba(60, 140, 70, 0.4)' as const;
|
|
30
|
+
export const SUCCESS_TEXT: ColorToken = { hex: '#6bc47a', r: 107, g: 196, b: 122 };
|
|
31
|
+
|
|
32
|
+
// Semantic colors - Warning
|
|
33
|
+
export const WARNING: ColorToken = { hex: '#503c14', r: 80, g: 60, b: 20 };
|
|
34
|
+
export const WARNING_BORDER = 'rgba(150, 110, 30, 0.4)' as const;
|
|
35
|
+
export const WARNING_TEXT: ColorToken = { hex: '#c4a43a', r: 196, g: 164, b: 58 };
|
|
36
|
+
|
|
37
|
+
// Semantic colors - Error
|
|
38
|
+
export const ERROR: ColorToken = { hex: '#501414', r: 80, g: 20, b: 20 };
|
|
39
|
+
export const ERROR_BORDER = 'rgba(180, 60, 60, 0.4)' as const;
|
|
40
|
+
export const ERROR_TEXT: ColorToken = { hex: '#c46b6b', r: 196, g: 107, b: 107 };
|
|
41
|
+
|
|
42
|
+
// Semantic colors - Info
|
|
43
|
+
export const INFO: ColorToken = { hex: '#143550', r: 20, g: 53, b: 80 };
|
|
44
|
+
export const INFO_BORDER = 'rgba(60, 140, 200, 0.4)' as const;
|
|
45
|
+
export const INFO_TEXT: ColorToken = { hex: '#6ba8c4', r: 107, g: 168, b: 196 };
|
|
46
|
+
|
|
47
|
+
// Border colors
|
|
48
|
+
export const BORDER = 'rgba(255, 255, 255, 0.08)' as const;
|
|
49
|
+
export const BORDER_HOVER = 'rgba(255, 255, 255, 0.15)' as const;
|
|
50
|
+
export const BORDER_FOCUS = 'rgba(255, 255, 255, 0.25)' as const;
|
|
51
|
+
|
|
52
|
+
// Typography
|
|
53
|
+
export const FONT_FAMILY = "'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif" as const;
|
|
54
|
+
export const FONT_MONO = "'JetBrains Mono', 'Fira Code', 'Consolas', monospace" as const;
|
|
55
|
+
|
|
56
|
+
export const FONT_SIZE = {
|
|
57
|
+
xs: 11,
|
|
58
|
+
sm: 12,
|
|
59
|
+
base: 13,
|
|
60
|
+
md: 14,
|
|
61
|
+
lg: 16,
|
|
62
|
+
xl: 20,
|
|
63
|
+
'2xl': 28,
|
|
64
|
+
'3xl': 36,
|
|
65
|
+
} as const;
|
|
66
|
+
|
|
67
|
+
// Spacing
|
|
68
|
+
export const SPACE = {
|
|
69
|
+
1: 4,
|
|
70
|
+
2: 8,
|
|
71
|
+
3: 12,
|
|
72
|
+
4: 16,
|
|
73
|
+
5: 20,
|
|
74
|
+
6: 24,
|
|
75
|
+
8: 32,
|
|
76
|
+
10: 40,
|
|
77
|
+
12: 48,
|
|
78
|
+
} as const;
|
|
79
|
+
|
|
80
|
+
// Border radius
|
|
81
|
+
export const RADIUS = {
|
|
82
|
+
sm: 6,
|
|
83
|
+
default: 10,
|
|
84
|
+
lg: 14,
|
|
85
|
+
xl: 20,
|
|
86
|
+
full: 9999,
|
|
87
|
+
} as const;
|
|
88
|
+
|
|
89
|
+
// Shadows
|
|
90
|
+
export const SHADOW = {
|
|
91
|
+
sm: '0 1px 2px rgba(0, 0, 0, 0.3)',
|
|
92
|
+
default: '0 4px 12px rgba(0, 0, 0, 0.4)',
|
|
93
|
+
lg: '0 8px 24px rgba(0, 0, 0, 0.5)',
|
|
94
|
+
glow: '0 0 20px rgba(107, 35, 35, 0.3)',
|
|
95
|
+
} as const;
|
|
96
|
+
|
|
97
|
+
// Transitions
|
|
98
|
+
export const TRANSITION = {
|
|
99
|
+
fast: '0.1s ease',
|
|
100
|
+
default: '0.15s ease',
|
|
101
|
+
slow: '0.25s ease',
|
|
102
|
+
} as const;
|
|
103
|
+
|
|
104
|
+
// Z-index
|
|
105
|
+
export const Z_INDEX = {
|
|
106
|
+
dropdown: 100,
|
|
107
|
+
sticky: 200,
|
|
108
|
+
fixed: 300,
|
|
109
|
+
modalBackdrop: 400,
|
|
110
|
+
modal: 500,
|
|
111
|
+
popover: 600,
|
|
112
|
+
tooltip: 700,
|
|
113
|
+
toast: 800,
|
|
114
|
+
} as const;
|
|
115
|
+
|
|
116
|
+
// Layout
|
|
117
|
+
export const LAYOUT = {
|
|
118
|
+
containerMax: 1200,
|
|
119
|
+
sidebarWidth: 260,
|
|
120
|
+
} as const;
|