simple-master-ui 0.1.0
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/LICENSE +21 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.js +313 -0
- package/dist/components.js.map +1 -0
- package/dist/css.d.ts +4 -0
- package/dist/css.js +28 -0
- package/dist/css.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/tokens.d.ts +2 -0
- package/dist/tokens.js +37 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +65 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +40 -0
- package/readme.md +247 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ajomuch92
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
const T = {
|
|
2
|
+
primary: 'var(--color-primary)',
|
|
3
|
+
primaryFg: 'var(--color-primary-fg)',
|
|
4
|
+
secondary: 'var(--color-secondary)',
|
|
5
|
+
secondaryFg: 'var(--color-secondary-fg)',
|
|
6
|
+
accent: 'var(--color-accent)',
|
|
7
|
+
accentFg: 'var(--color-accent-fg)',
|
|
8
|
+
neutral: 'var(--color-neutral)',
|
|
9
|
+
neutralFg: 'var(--color-neutral-fg)',
|
|
10
|
+
success: 'var(--color-success)',
|
|
11
|
+
successFg: 'var(--color-success-fg)',
|
|
12
|
+
warning: 'var(--color-warning)',
|
|
13
|
+
warningFg: 'var(--color-warning-fg)',
|
|
14
|
+
error: 'var(--color-error)',
|
|
15
|
+
errorFg: 'var(--color-error-fg)',
|
|
16
|
+
info: 'var(--color-info)',
|
|
17
|
+
infoFg: 'var(--color-info-fg)',
|
|
18
|
+
base: 'var(--color-base)',
|
|
19
|
+
base2: 'var(--color-base-2)',
|
|
20
|
+
base3: 'var(--color-base-3)',
|
|
21
|
+
border: 'var(--color-border)',
|
|
22
|
+
content: 'var(--color-content)',
|
|
23
|
+
content2: 'var(--color-content-2)',
|
|
24
|
+
rSm: 'var(--radius-sm)',
|
|
25
|
+
rMd: 'var(--radius-md)',
|
|
26
|
+
rLg: 'var(--radius-lg)',
|
|
27
|
+
rXl: 'var(--radius-xl)',
|
|
28
|
+
rFull: 'var(--radius-full)',
|
|
29
|
+
shSm: 'var(--shadow-sm)',
|
|
30
|
+
shMd: 'var(--shadow-md)',
|
|
31
|
+
shLg: 'var(--shadow-lg)',
|
|
32
|
+
shXl: 'var(--shadow-xl)',
|
|
33
|
+
tFast: 'var(--transition-fast)',
|
|
34
|
+
tNormal: 'var(--transition-normal)',
|
|
35
|
+
tSlow: 'var(--transition-slow)',
|
|
36
|
+
};
|
|
37
|
+
const btn = {
|
|
38
|
+
'': `inline-flex align-items:center justify-content:center gap:2 font:14 font:medium r:${T.rMd} px:4x h:10x ~background|${T.tNormal},color|${T.tNormal},box-shadow|${T.tNormal} cursor:pointer select:none outline:none border:none appearance:none fg:${T.content} bg:${T.base3} shadow:${T.shSm}`,
|
|
39
|
+
primary: `btn bg:${T.primary}! fg:${T.primaryFg}!`,
|
|
40
|
+
secondary: `btn bg:${T.secondary}! fg:${T.secondaryFg}!`,
|
|
41
|
+
accent: `btn bg:${T.accent}! fg:${T.accentFg}!`,
|
|
42
|
+
neutral: `btn bg:${T.neutral}! fg:${T.neutralFg}!`,
|
|
43
|
+
success: `btn bg:${T.success}! fg:${T.successFg}!`,
|
|
44
|
+
warning: `btn bg:${T.warning}! fg:${T.warningFg}!`,
|
|
45
|
+
error: `btn bg:${T.error}! fg:${T.errorFg}!`,
|
|
46
|
+
ghost: `btn bg:transparent! shadow:none! fg:${T.primary}! hover:bg:${T.primary}/.1!`,
|
|
47
|
+
outline: `btn bg:transparent! b:1|solid|${T.primary}! fg:${T.primary}! hover:bg:${T.primary}/.1!`,
|
|
48
|
+
link: `btn bg:transparent! shadow:none! fg:${T.primary}! hover:text:underline! px:0! h:auto!`,
|
|
49
|
+
xs: `btn px:2x h:6x font:12! r:${T.rSm}!`,
|
|
50
|
+
sm: `btn px:3x h:8x font:13!`,
|
|
51
|
+
lg: `btn px:6x h:12x font:16!`,
|
|
52
|
+
xl: `btn px:8x h:14x font:18!`,
|
|
53
|
+
wide: `btn w:full!`,
|
|
54
|
+
square: `btn px:0! w:10x!`,
|
|
55
|
+
circle: `btn px:0! w:10x! r:${T.rFull}!`,
|
|
56
|
+
};
|
|
57
|
+
const badge = {
|
|
58
|
+
'': `inline-flex align-items:center justify-content:center px:2x h:6x font:12 font:medium r:${T.rFull} bg:${T.base3} fg:${T.content2}`,
|
|
59
|
+
primary: `badge bg:${T.primary}! fg:${T.primaryFg}!`,
|
|
60
|
+
secondary: `badge bg:${T.secondary}! fg:${T.secondaryFg}!`,
|
|
61
|
+
accent: `badge bg:${T.accent}! fg:${T.accentFg}!`,
|
|
62
|
+
success: `badge bg:${T.success}! fg:${T.successFg}!`,
|
|
63
|
+
warning: `badge bg:${T.warning}! fg:${T.warningFg}!`,
|
|
64
|
+
error: `badge bg:${T.error}! fg:${T.errorFg}!`,
|
|
65
|
+
info: `badge bg:${T.info}! fg:${T.infoFg}!`,
|
|
66
|
+
ghost: `badge bg:transparent! b:1|solid|${T.border}!`,
|
|
67
|
+
outline: `badge bg:transparent! b:1|solid|currentColor!`,
|
|
68
|
+
sm: `badge h:4x px:1.5x font:11!`,
|
|
69
|
+
lg: `badge h:8x px:3x font:14!`,
|
|
70
|
+
};
|
|
71
|
+
const card = {
|
|
72
|
+
'': `flex flex:col bg:${T.base} r:${T.rXl} shadow:${T.shMd} b:1|solid|${T.border} overflow:hidden`,
|
|
73
|
+
body: `flex flex:col p:6x gap:4`,
|
|
74
|
+
title: `font:20 font:semibold fg:${T.content} lh:1.3`,
|
|
75
|
+
actions: `flex align-items:center gap:3 mt:auto`,
|
|
76
|
+
bordered: `card b:2|solid|${T.border}! shadow:none!`,
|
|
77
|
+
glass: `card bg:white/.1 backdrop-blur:12 b:1|solid|white/.2!`,
|
|
78
|
+
};
|
|
79
|
+
const input = {
|
|
80
|
+
'': `flex h:10x w:full r:${T.rMd} b:1|solid|${T.border} bg:${T.base} px:3x font:14 fg:${T.content} outline:none ~border|${T.tFast},box-shadow|${T.tFast} focus:b:${T.primary} focus:ring:3|solid|${T.primary}/.2`,
|
|
81
|
+
sm: `input h:8x px:2x font:13!`,
|
|
82
|
+
lg: `input h:12x px:4x font:16!`,
|
|
83
|
+
error: `input b:${T.error}! focus:ring:3|solid|${T.error}/.2!`,
|
|
84
|
+
success: `input b:${T.success}! focus:ring:3|solid|${T.success}/.2!`,
|
|
85
|
+
ghost: `input b:none! bg:${T.base2}!`,
|
|
86
|
+
};
|
|
87
|
+
const textarea = {
|
|
88
|
+
'': `w:full min-h:24x r:${T.rMd} b:1|solid|${T.border} bg:${T.base} p:3x font:14 fg:${T.content} outline:none ~border|${T.tFast} focus:b:${T.primary} resize:vertical`,
|
|
89
|
+
};
|
|
90
|
+
const select = {
|
|
91
|
+
'': `h:10x w:full r:${T.rMd} b:1|solid|${T.border} bg:${T.base} px:3x font:14 fg:${T.content} outline:none ~border|${T.tFast} focus:b:${T.primary} appearance:none cursor:pointer`,
|
|
92
|
+
sm: `select h:8x font:13!`,
|
|
93
|
+
lg: `select h:12x font:16!`,
|
|
94
|
+
};
|
|
95
|
+
const alert = {
|
|
96
|
+
'': `flex align-items:start gap:3 p:4x r:${T.rLg} b:1|solid|transparent`,
|
|
97
|
+
info: `alert bg:${T.info}/.1 b:${T.info}/.3! fg:${T.info}!`,
|
|
98
|
+
success: `alert bg:${T.success}/.1 b:${T.success}/.3! fg:${T.success}!`,
|
|
99
|
+
warning: `alert bg:${T.warning}/.1 b:${T.warning}/.3! fg:${T.warning}!`,
|
|
100
|
+
error: `alert bg:${T.error}/.1 b:${T.error}/.3! fg:${T.error}!`,
|
|
101
|
+
title: `font:medium font:15 lh:1`,
|
|
102
|
+
desc: `font:14 opacity:.8`,
|
|
103
|
+
};
|
|
104
|
+
const avatar = {
|
|
105
|
+
'': `rel inline-flex`,
|
|
106
|
+
xs: `w:8x h:8x`,
|
|
107
|
+
sm: `w:10x h:10x`,
|
|
108
|
+
md: `w:12x h:12x`,
|
|
109
|
+
lg: `w:16x h:16x`,
|
|
110
|
+
xl: `w:24x h:24x`,
|
|
111
|
+
placeholder: `round bg:${T.primary}/.15 fg:${T.primary} font:semibold flex align-items:center justify-content:center`,
|
|
112
|
+
ring: `outline:3|solid|${T.primary} outline-offset:2`,
|
|
113
|
+
};
|
|
114
|
+
const navbar = {
|
|
115
|
+
'': `flex align-items:center w:full px:4x h:16x bg:${T.base} bb:1|solid|${T.border} gap:4`,
|
|
116
|
+
brand: `flex align-items:center gap:2 font:20 font:bold fg:${T.content} text:none`,
|
|
117
|
+
start: `flex align-items:center flex:1 gap:1`,
|
|
118
|
+
end: `flex align-items:center gap:2 ml:auto`,
|
|
119
|
+
center: `flex align-items:center gap:1`,
|
|
120
|
+
item: `px:3x py:2x r:${T.rMd} font:14 font:medium fg:${T.content2} ~color|${T.tFast},background|${T.tFast} hover:fg:${T.content} hover:bg:${T.base2} cursor:pointer text:none`,
|
|
121
|
+
'item-active': `navbar-item fg:${T.primary}! bg:${T.primary}/.1!`,
|
|
122
|
+
};
|
|
123
|
+
const menu = {
|
|
124
|
+
'': `flex flex:col gap:1 p:2x`,
|
|
125
|
+
item: `flex align-items:center gap:3 px:3x py:2.5x r:${T.rMd} font:14 font:medium fg:${T.content2} ~color|${T.tFast},background|${T.tFast} hover:fg:${T.content} hover:bg:${T.base2} cursor:pointer text:none`,
|
|
126
|
+
'item-active': `menu-item fg:${T.primary}! bg:${T.primary}/.1!`,
|
|
127
|
+
title: `px:3x py:2x font:12 font:semibold uppercase letter-spacing:.05em fg:${T.content2}`,
|
|
128
|
+
divider: `h:1px bg:${T.border} my:2`,
|
|
129
|
+
};
|
|
130
|
+
const tabs = {
|
|
131
|
+
'': `flex align-items:end gap:0 bb:2|solid|${T.border}`,
|
|
132
|
+
tab: `px:4x py:2.5x font:14 font:medium fg:${T.content2} ~color|${T.tFast},border|${T.tFast} cursor:pointer bb:2|solid|transparent mb:-2px hover:fg:${T.content}`,
|
|
133
|
+
'tab-active': `tabs-tab fg:${T.primary}! bb:2|solid|${T.primary}!`,
|
|
134
|
+
boxed: `tabs bg:${T.base2} p:1x r:${T.rLg} b:none! gap:1`,
|
|
135
|
+
'boxed-tab': `tabs-tab r:${T.rMd} b:none! mb:0!`,
|
|
136
|
+
'boxed-tab-active': `tabs-boxed-tab fg:${T.primary}! bg:${T.base}! shadow:${T.shSm}`,
|
|
137
|
+
};
|
|
138
|
+
const table = {
|
|
139
|
+
'': `w:full border-collapse:collapse font:14`,
|
|
140
|
+
head: `bg:${T.base2}`,
|
|
141
|
+
th: `px:4x py:3x text:left font:semibold fg:${T.content2} font:12 uppercase letter-spacing:.05em bb:1|solid|${T.border}`,
|
|
142
|
+
td: `px:4x py:3.5x fg:${T.content} bb:1|solid|${T.border}`,
|
|
143
|
+
row: `~background|${T.tFast} hover:bg:${T.base2}`,
|
|
144
|
+
'row-active': `bg:${T.primary}/.05!`,
|
|
145
|
+
zebra: `bg:${T.base2}:nth-child(even)`,
|
|
146
|
+
wrapper: `w:full overflow:auto r:${T.rXl} b:1|solid|${T.border}`,
|
|
147
|
+
};
|
|
148
|
+
const modal = {
|
|
149
|
+
'': `fixed inset:0 z:50 flex align-items:center justify-content:center p:4x bg:black/.5 backdrop-blur:4`,
|
|
150
|
+
box: `rel bg:${T.base} r:${T.rXl} shadow:${T.shXl} w:full max-w:lg max-h:90vh overflow:auto p:6x flex flex:col gap:4`,
|
|
151
|
+
title: `font:20 font:semibold fg:${T.content}`,
|
|
152
|
+
body: `fg:${T.content2} font:15 lh:1.6`,
|
|
153
|
+
actions: `flex justify-content:end gap:3 mt:2x`,
|
|
154
|
+
close: `abs top:4x right:4x btn btn-ghost btn-square btn-sm`,
|
|
155
|
+
};
|
|
156
|
+
const drawer = {
|
|
157
|
+
'': `fixed top:0 left:0 h:full w:72x bg:${T.base} shadow:${T.shXl} b:right:1|solid|${T.border} flex flex:col z:40 ~transform|${T.tNormal}`,
|
|
158
|
+
overlay: `fixed inset:0 bg:black/.4 backdrop-blur:2 z:30`,
|
|
159
|
+
header: `flex align-items:center px:4x h:16x bb:1|solid|${T.border} font:18 font:semibold`,
|
|
160
|
+
body: `flex:1 overflow:auto p:4x`,
|
|
161
|
+
footer: `p:4x bt:1|solid|${T.border}`,
|
|
162
|
+
};
|
|
163
|
+
const progress = {
|
|
164
|
+
'': `w:full h:2.5x r:${T.rFull} bg:${T.base3} overflow:hidden`,
|
|
165
|
+
bar: `h:full bg:${T.primary} r:${T.rFull} ~width|${T.tSlow}`,
|
|
166
|
+
success: `progress-bar bg:${T.success}!`,
|
|
167
|
+
warning: `progress-bar bg:${T.warning}!`,
|
|
168
|
+
error: `progress-bar bg:${T.error}!`,
|
|
169
|
+
sm: `progress h:1.5x!`,
|
|
170
|
+
lg: `progress h:4x!`,
|
|
171
|
+
};
|
|
172
|
+
const skeleton = {
|
|
173
|
+
'': `bg:${T.base3} r:${T.rMd} @pulse|1.5s|ease-in-out|infinite`,
|
|
174
|
+
text: `skeleton h:4x w:full`,
|
|
175
|
+
circle: `skeleton r:${T.rFull}!`,
|
|
176
|
+
rect: `skeleton r:${T.rSm}!`,
|
|
177
|
+
};
|
|
178
|
+
const loading = {
|
|
179
|
+
'': `inline-block r:${T.rFull} b:2|solid|${T.border} b-top:2|solid|${T.primary} @spin|.7s|linear|infinite`,
|
|
180
|
+
sm: `loading w:4x h:4x`,
|
|
181
|
+
md: `loading w:6x h:6x`,
|
|
182
|
+
lg: `loading w:10x h:10x`,
|
|
183
|
+
xl: `loading w:16x h:16x`,
|
|
184
|
+
};
|
|
185
|
+
const tooltip = {
|
|
186
|
+
'': `rel inline-flex`,
|
|
187
|
+
text: `abs bottom:full left:50% translate(-50%,-4px) px:2.5x py:1.5x r:${T.rMd} bg:${T.content} fg:${T.base} font:12 font:medium white-space:nowrap opacity:0 pointer-events:none ~opacity|${T.tFast} mb:1.5x z:50`,
|
|
188
|
+
show: `tooltip-text opacity:1!`,
|
|
189
|
+
};
|
|
190
|
+
const dropdown = {
|
|
191
|
+
'': `rel inline-flex`,
|
|
192
|
+
menu: `abs top:full left:0 mt:1x min-w:48x bg:${T.base} r:${T.rLg} shadow:${T.shLg} b:1|solid|${T.border} p:1x z:50 flex flex:col gap:0.5`,
|
|
193
|
+
item: `px:3x py:2x r:${T.rMd} font:14 fg:${T.content} ~background|${T.tFast} hover:bg:${T.base2} cursor:pointer flex align-items:center gap:2.5`,
|
|
194
|
+
divider: `h:1px bg:${T.border} my:1x`,
|
|
195
|
+
label: `px:3x py:1.5x font:12 font:semibold uppercase letter-spacing:.05em fg:${T.content2}`,
|
|
196
|
+
};
|
|
197
|
+
const breadcrumb = {
|
|
198
|
+
'': `flex align-items:center gap:2 flex-wrap:wrap font:14`,
|
|
199
|
+
item: `flex align-items:center gap:2 fg:${T.content2}`,
|
|
200
|
+
link: `fg:${T.primary} ~color|${T.tFast} hover:fg:${T.primary} text:none font:medium`,
|
|
201
|
+
separator: `fg:${T.border}`,
|
|
202
|
+
active: `fg:${T.content} font:medium`,
|
|
203
|
+
};
|
|
204
|
+
const pagination = {
|
|
205
|
+
'': `flex align-items:center gap:1`,
|
|
206
|
+
item: `inline-flex align-items:center justify-content:center w:9x h:9x r:${T.rMd} font:14 font:medium fg:${T.content2} ~background|${T.tFast},color|${T.tFast} hover:bg:${T.base2} hover:fg:${T.content} cursor:pointer border:none bg:transparent`,
|
|
207
|
+
active: `pagination-item bg:${T.primary}! fg:${T.primaryFg}!`,
|
|
208
|
+
disabled: `pagination-item opacity:.4! cursor:not-allowed!`,
|
|
209
|
+
};
|
|
210
|
+
const stat = {
|
|
211
|
+
'': `flex flex:col gap:1 p:5x bg:${T.base} r:${T.rXl} b:1|solid|${T.border}`,
|
|
212
|
+
title: `font:13 font:medium fg:${T.content2} uppercase letter-spacing:.08em`,
|
|
213
|
+
value: `font:32 font:bold fg:${T.content} lh:1.2`,
|
|
214
|
+
desc: `font:13 fg:${T.content2}`,
|
|
215
|
+
icon: `w:12x h:12x r:${T.rLg} bg:${T.primary}/.1 fg:${T.primary} flex align-items:center justify-content:center`,
|
|
216
|
+
group: `grid grid-cols:repeat(auto-fit,minmax(200px,1fr)) gap:4`,
|
|
217
|
+
};
|
|
218
|
+
const accordion = {
|
|
219
|
+
'': `flex flex:col b:1|solid|${T.border} r:${T.rXl} overflow:hidden`,
|
|
220
|
+
item: `flex flex:col bb:1|solid|${T.border} last:bb:none`,
|
|
221
|
+
trigger: `flex align-items:center justify-content:space-between px:4x py:4x font:15 font:medium fg:${T.content} cursor:pointer hover:bg:${T.base2} ~background|${T.tFast}`,
|
|
222
|
+
content: `px:4x pb:4x font:14 fg:${T.content2} lh:1.7`,
|
|
223
|
+
};
|
|
224
|
+
const toast = {
|
|
225
|
+
'': `fixed bottom:4x right:4x flex flex:col gap:3 z:100 max-w:sm w:full`,
|
|
226
|
+
item: `flex align-items:start gap:3 px:4x py:3.5x r:${T.rLg} shadow:${T.shLg} bg:${T.base} b:1|solid|${T.border} font:14`,
|
|
227
|
+
success: `toast-item b:${T.success}! bg:${T.success}/.05!`,
|
|
228
|
+
error: `toast-item b:${T.error}! bg:${T.error}/.05!`,
|
|
229
|
+
warning: `toast-item b:${T.warning}! bg:${T.warning}/.05!`,
|
|
230
|
+
close: `btn btn-ghost btn-xs btn-square ml:auto`,
|
|
231
|
+
};
|
|
232
|
+
const chip = {
|
|
233
|
+
'': `inline-flex align-items:center gap:2 px:3x h:7x r:${T.rFull} font:13 font:medium bg:${T.base3} fg:${T.content} b:1|solid|${T.border}`,
|
|
234
|
+
primary: `chip bg:${T.primary}/.15! fg:${T.primary}! b:${T.primary}/.3!`,
|
|
235
|
+
secondary: `chip bg:${T.secondary}/.15! fg:${T.secondary}! b:${T.secondary}/.3!`,
|
|
236
|
+
success: `chip bg:${T.success}/.15! fg:${T.success}! b:${T.success}/.3!`,
|
|
237
|
+
warning: `chip bg:${T.warning}/.15! fg:${T.warning}! b:${T.warning}/.3!`,
|
|
238
|
+
error: `chip bg:${T.error}/.15! fg:${T.error}! b:${T.error}/.3!`,
|
|
239
|
+
};
|
|
240
|
+
const divider = {
|
|
241
|
+
'': `flex align-items:center gap:4 fg:${T.content2} font:13`,
|
|
242
|
+
line: `flex:1 h:1px bg:${T.border}`,
|
|
243
|
+
label: `white-space:nowrap`,
|
|
244
|
+
vertical: `w:1px bg:${T.border} self:stretch`,
|
|
245
|
+
};
|
|
246
|
+
const code = {
|
|
247
|
+
'': `font:14 font:mono px:1.5x py:.5x r:${T.rSm} bg:${T.base3} fg:${T.primary}`,
|
|
248
|
+
block: `code w:full p:4x r:${T.rLg} overflow:auto bg:${T.content} fg:${T.base} lh:1.7 font:13 block`,
|
|
249
|
+
};
|
|
250
|
+
const steps = {
|
|
251
|
+
'': `flex align-items:start gap:0 w:full`,
|
|
252
|
+
step: `flex:1 flex flex:col align-items:center`,
|
|
253
|
+
bullet: `w:8x h:8x r:${T.rFull} bg:${T.base3} b:2|solid|${T.border} flex align-items:center justify-content:center font:13 font:semibold fg:${T.content2} z:10`,
|
|
254
|
+
'bullet-active': `steps-bullet bg:${T.primary}! b:${T.primary}! fg:${T.primaryFg}!`,
|
|
255
|
+
line: `h:2px bg:${T.border} flex:1 mt:4x`,
|
|
256
|
+
'line-done': `steps-line bg:${T.primary}!`,
|
|
257
|
+
label: `mt:2x font:13 font:medium fg:${T.content2} text:center`,
|
|
258
|
+
'label-active': `steps-label fg:${T.primary}!`,
|
|
259
|
+
};
|
|
260
|
+
const hero = {
|
|
261
|
+
'': `rel flex align-items:center justify-content:center py:24x px:4x text:center bg:${T.base2} overflow:hidden`,
|
|
262
|
+
body: `rel z:10 flex flex:col align-items:center gap:6 max-w:3xl`,
|
|
263
|
+
title: `font:48 font:bold fg:${T.content} lh:1.1 tracking-tight font:60@md`,
|
|
264
|
+
sub: `font:18 fg:${T.content2} lh:1.6 max-w:2xl`,
|
|
265
|
+
actions: `flex align-items:center gap:4 flex-wrap:wrap justify-content:center mt:2x`,
|
|
266
|
+
};
|
|
267
|
+
const formGroup = {
|
|
268
|
+
'': `flex flex:col gap:1.5x`,
|
|
269
|
+
label: `font:14 font:medium fg:${T.content}`,
|
|
270
|
+
hint: `font:12 fg:${T.content2}`,
|
|
271
|
+
error: `font:12 fg:${T.error}`,
|
|
272
|
+
};
|
|
273
|
+
const container = {
|
|
274
|
+
'': `max-w:1280 mx:auto px:4x px:6x@sm px:8x@lg w:full`,
|
|
275
|
+
};
|
|
276
|
+
const section = {
|
|
277
|
+
'': `py:16x py:24x@md`,
|
|
278
|
+
};
|
|
279
|
+
export const defaultComponents = {
|
|
280
|
+
btn,
|
|
281
|
+
badge,
|
|
282
|
+
card,
|
|
283
|
+
input,
|
|
284
|
+
textarea,
|
|
285
|
+
select,
|
|
286
|
+
alert,
|
|
287
|
+
avatar,
|
|
288
|
+
navbar,
|
|
289
|
+
menu,
|
|
290
|
+
tabs,
|
|
291
|
+
table,
|
|
292
|
+
modal,
|
|
293
|
+
drawer,
|
|
294
|
+
progress,
|
|
295
|
+
skeleton,
|
|
296
|
+
loading,
|
|
297
|
+
tooltip,
|
|
298
|
+
dropdown,
|
|
299
|
+
breadcrumb,
|
|
300
|
+
pagination,
|
|
301
|
+
stat,
|
|
302
|
+
accordion,
|
|
303
|
+
toast,
|
|
304
|
+
chip,
|
|
305
|
+
divider,
|
|
306
|
+
code,
|
|
307
|
+
steps,
|
|
308
|
+
hero,
|
|
309
|
+
'form-group': formGroup,
|
|
310
|
+
container,
|
|
311
|
+
section,
|
|
312
|
+
};
|
|
313
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,GAAG;IACR,OAAO,EAAK,sBAAsB;IAClC,SAAS,EAAG,yBAAyB;IACrC,SAAS,EAAG,wBAAwB;IACpC,WAAW,EAAC,2BAA2B;IACvC,MAAM,EAAM,qBAAqB;IACjC,QAAQ,EAAI,wBAAwB;IACpC,OAAO,EAAK,sBAAsB;IAClC,SAAS,EAAG,yBAAyB;IACrC,OAAO,EAAK,sBAAsB;IAClC,SAAS,EAAG,yBAAyB;IACrC,OAAO,EAAK,sBAAsB;IAClC,SAAS,EAAG,yBAAyB;IACrC,KAAK,EAAO,oBAAoB;IAChC,OAAO,EAAK,uBAAuB;IACnC,IAAI,EAAQ,mBAAmB;IAC/B,MAAM,EAAM,sBAAsB;IAClC,IAAI,EAAQ,mBAAmB;IAC/B,KAAK,EAAO,qBAAq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AAiB;IACzB,EAAE,EAAO,kFAAkF,CAAC,CAAC,KAAK,kBAAkB;IACpH,IAAI,EAAK,2DAA2D;IACpE,KAAK,EAAI,wBAAwB,CAAC,CAAC,OAAO,mCAAmC;IAC7E,GAAG,EAAM,cAAc,CAAC,CAAC,QAAQ,mBAAmB;IACpD,OAAO,EAAE,2EAA2E;CACrF,CAAA;AAGD,MAAM,SAAS,GAAiB;IAC9B,EAAE,EAAO,wBAAwB;IACjC,KAAK,EAAI,0BAA0B,CAAC,CAAC,OAAO,EAAE;IAC9C,IAAI,EAAK,cAAc,CAAC,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAI,cAAc,CAAC,CAAC,KAAK,EAAE;CACjC,CAAA;AAGD,MAAM,SAAS,GAAiB;IAC9B,EAAE,EAAE,mDAAmD;CACxD,CAAA;AAGD,MAAM,OAAO,GAAiB;IAC5B,EAAE,EAAE,kBAAkB;CACvB,CAAA;AASD,MAAM,CAAC,MAAM,iBAAiB,GAAkB;IAC9C,GAAG;IACH,KAAK;IACL,IAAI;IACJ,KAAK;IACL,QAAQ;IACR,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,UAAU;IACV,UAAU;IACV,IAAI;IACJ,SAAS;IACT,KAAK;IACL,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,YAAY,EAAE,SAAS;IACvB,SAAS;IACT,OAAO;CACR,CAAA"}
|
package/dist/css.d.ts
ADDED
package/dist/css.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function lightValue(v) {
|
|
2
|
+
return typeof v === 'string' ? v : v['@light'];
|
|
3
|
+
}
|
|
4
|
+
function darkValue(v) {
|
|
5
|
+
return typeof v === 'string' ? v : v['@dark'];
|
|
6
|
+
}
|
|
7
|
+
export function buildRootCSS(tokens) {
|
|
8
|
+
const lines = Object.entries(tokens).map(([key, value]) => ` ${key}: ${lightValue(value)};`);
|
|
9
|
+
return `:root {\n${lines.join('\n')}\n}`;
|
|
10
|
+
}
|
|
11
|
+
export function buildDarkCSS(tokens) {
|
|
12
|
+
const lines = Object.entries(tokens)
|
|
13
|
+
.filter(([, value]) => typeof value === 'object')
|
|
14
|
+
.map(([key, value]) => ` ${key}: ${darkValue(value)};`);
|
|
15
|
+
return `[data-theme="dark"] {\n${lines.join('\n')}\n}`;
|
|
16
|
+
}
|
|
17
|
+
export function injectCSS(css, id = 'smu-tokens') {
|
|
18
|
+
if (typeof document === 'undefined')
|
|
19
|
+
return;
|
|
20
|
+
let el = document.getElementById(id);
|
|
21
|
+
if (!el) {
|
|
22
|
+
el = document.createElement('style');
|
|
23
|
+
el.id = id;
|
|
24
|
+
document.head.appendChild(el);
|
|
25
|
+
}
|
|
26
|
+
el.textContent = css;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=css.js.map
|
package/dist/css.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.js","sourceRoot":"","sources":["../src/css.ts"],"names":[],"mappings":"AAYA,SAAS,UAAU,CAAC,CAAa;IAC/B,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;AAChD,CAAC;AAMD,SAAS,SAAS,CAAC,CAAa;IAC9B,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;AAC/C,CAAC;AAKD,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CACtC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,UAAU,CAAC,KAAmB,CAAC,GAAG,CAClE,CAAA;IACD,OAAO,YAAY,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAA;AAC1C,CAAC;AAMD,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC5C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;SACjC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC;SAChD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,SAAS,CAAC,KAAmB,CAAC,GAAG,CAAC,CAAA;IAExE,OAAO,0BAA0B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAA;AACxD,CAAC;AAMD,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,EAAE,GAAG,YAAY;IACtD,IAAI,OAAO,QAAQ,KAAK,WAAW;QAAE,OAAM;IAC3C,IAAI,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAA4B,CAAA;IAC/D,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QACpC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAA;QACV,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IAC/B,CAAC;IACD,EAAE,CAAC,WAAW,GAAG,GAAG,CAAA;AACtB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SMUConfig, SMUTokens, ComponentsMap, ComponentMap, SMUExtendOptions, PartialSMUTokens, PartialComponentsMap } from './types.js';
|
|
2
|
+
export type { SMUConfig, SMUTokens, ComponentsMap, ComponentMap, SMUExtendOptions, PartialSMUTokens, PartialComponentsMap, };
|
|
3
|
+
export { defaultTokens } from './tokens';
|
|
4
|
+
export { defaultComponents } from './components';
|
|
5
|
+
export { buildRootCSS, buildDarkCSS, injectCSS } from './css';
|
|
6
|
+
export declare function buildConfig(tokens?: SMUTokens, components?: ComponentsMap): SMUConfig;
|
|
7
|
+
export declare function extend(options?: SMUExtendOptions): SMUConfig;
|
|
8
|
+
export declare function injectTokens(config?: SMUConfig): void;
|
|
9
|
+
declare const defaultConfig: SMUConfig;
|
|
10
|
+
export default defaultConfig;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defaultTokens } from './tokens.js';
|
|
2
|
+
import { defaultComponents } from './components.js';
|
|
3
|
+
import { buildRootCSS, buildDarkCSS, injectCSS } from './css.js';
|
|
4
|
+
export { defaultTokens } from './tokens';
|
|
5
|
+
export { defaultComponents } from './components';
|
|
6
|
+
export { buildRootCSS, buildDarkCSS, injectCSS } from './css';
|
|
7
|
+
function flattenComponents(components) {
|
|
8
|
+
const result = {};
|
|
9
|
+
for (const [name, def] of Object.entries(components)) {
|
|
10
|
+
if (typeof def === 'string') {
|
|
11
|
+
result[name] = def;
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
for (const [variant, value] of Object.entries(def)) {
|
|
15
|
+
const key = variant === '' ? name : `${name}-${variant}`;
|
|
16
|
+
result[key] = value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
export function buildConfig(tokens = defaultTokens, components = defaultComponents) {
|
|
23
|
+
return {
|
|
24
|
+
classes: flattenComponents(components),
|
|
25
|
+
tokens,
|
|
26
|
+
rootCSS: buildRootCSS(tokens),
|
|
27
|
+
darkCSS: buildDarkCSS(tokens),
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function extend(options = {}) {
|
|
31
|
+
const mergedTokens = {
|
|
32
|
+
...defaultTokens,
|
|
33
|
+
...(options.tokens ?? {}),
|
|
34
|
+
};
|
|
35
|
+
const mergedComponents = { ...defaultComponents };
|
|
36
|
+
if (options.components) {
|
|
37
|
+
for (const [name, def] of Object.entries(options.components)) {
|
|
38
|
+
const existing = mergedComponents[name];
|
|
39
|
+
if (def === undefined) {
|
|
40
|
+
}
|
|
41
|
+
else if (typeof def === 'string') {
|
|
42
|
+
mergedComponents[name] = def;
|
|
43
|
+
}
|
|
44
|
+
else if (typeof existing === 'object' && existing !== null && typeof def === 'object') {
|
|
45
|
+
mergedComponents[name] = { ...existing, ...def };
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
mergedComponents[name] = def;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return buildConfig(mergedTokens, mergedComponents);
|
|
53
|
+
}
|
|
54
|
+
export function injectTokens(config) {
|
|
55
|
+
const c = config ?? buildConfig();
|
|
56
|
+
injectCSS(c.rootCSS + '\n' + c.darkCSS, 'smu-tokens');
|
|
57
|
+
}
|
|
58
|
+
const defaultConfig = buildConfig();
|
|
59
|
+
export default defaultConfig;
|
|
60
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA0CA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAYhE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAc7D,SAAS,iBAAiB,CAAC,UAAyB;IAClD,MAAM,MAAM,GAA2B,EAAE,CAAA;IAEzC,KAAK,MAAM,CAAC,IAAI,EA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SAAS,EAAE,CAAC;YAExB,CAAC;iBAAM,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBACnC,gBAAgB,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;YAC9B,CAAC;iBAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBAExF,gBAAgB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAI,QAAyB,EAAE,GAAG,GAAG,EAAE,CAAA;YACpE,CAAC;iBAAM,CAAC;gBACN,gBAAgB,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;YAC9B,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAA;AACpD,CAAC;AAUD,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC7C,MAAM,CAAC,GAAG,MAAM,IAAI,WAAW,EAAE,CAAA;IACjC,SAAS,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;AACvD,CAAC;AAeD,MAAM,aAAa,GAAc,WAAW,EAAE,CAAA;AAC9C,eAAe,aAAa,CAAA"}
|
package/dist/tokens.d.ts
ADDED
package/dist/tokens.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export const defaultTokens = {
|
|
2
|
+
'--color-primary': { '@light': '#4f46e5', '@dark': '#818cf8' },
|
|
3
|
+
'--color-primary-fg': { '@light': '#ffffff', '@dark': '#ffffff' },
|
|
4
|
+
'--color-secondary': { '@light': '#0ea5e9', '@dark': '#38bdf8' },
|
|
5
|
+
'--color-secondary-fg': { '@light': '#ffffff', '@dark': '#ffffff' },
|
|
6
|
+
'--color-accent': { '@light': '#f59e0b', '@dark': '#fbbf24' },
|
|
7
|
+
'--color-accent-fg': { '@light': '#ffffff', '@dark': '#000000' },
|
|
8
|
+
'--color-neutral': { '@light': '#64748b', '@dark': '#94a3b8' },
|
|
9
|
+
'--color-neutral-fg': { '@light': '#ffffff', '@dark': '#000000' },
|
|
10
|
+
'--color-success': { '@light': '#22c55e', '@dark': '#4ade80' },
|
|
11
|
+
'--color-success-fg': { '@light': '#ffffff', '@dark': '#000000' },
|
|
12
|
+
'--color-warning': { '@light': '#f59e0b', '@dark': '#fbbf24' },
|
|
13
|
+
'--color-warning-fg': { '@light': '#000000', '@dark': '#000000' },
|
|
14
|
+
'--color-error': { '@light': '#ef4444', '@dark': '#f87171' },
|
|
15
|
+
'--color-error-fg': { '@light': '#ffffff', '@dark': '#ffffff' },
|
|
16
|
+
'--color-info': { '@light': '#3b82f6', '@dark': '#60a5fa' },
|
|
17
|
+
'--color-info-fg': { '@light': '#ffffff', '@dark': '#ffffff' },
|
|
18
|
+
'--color-base': { '@light': '#ffffff', '@dark': '#0f172a' },
|
|
19
|
+
'--color-base-2': { '@light': '#f8fafc', '@dark': '#1e293b' },
|
|
20
|
+
'--color-base-3': { '@light': '#f1f5f9', '@dark': '#334155' },
|
|
21
|
+
'--color-border': { '@light': '#e2e8f0', '@dark': '#334155' },
|
|
22
|
+
'--color-content': { '@light': '#0f172a', '@dark': '#f1f5f9' },
|
|
23
|
+
'--color-content-2': { '@light': '#475569', '@dark': '#94a3b8' },
|
|
24
|
+
'--radius-sm': '0.25rem',
|
|
25
|
+
'--radius-md': '0.5rem',
|
|
26
|
+
'--radius-lg': '0.75rem',
|
|
27
|
+
'--radius-xl': '1rem',
|
|
28
|
+
'--radius-full': '9999px',
|
|
29
|
+
'--shadow-sm': '0 1px 2px 0 rgb(0 0 0/.08)',
|
|
30
|
+
'--shadow-md': '0 4px 6px -1px rgb(0 0 0/.1),0 2px 4px -2px rgb(0 0 0/.1)',
|
|
31
|
+
'--shadow-lg': '0 10px 15px -3px rgb(0 0 0/.1),0 4px 6px -4px rgb(0 0 0/.1)',
|
|
32
|
+
'--shadow-xl': '0 20px 25px -5px rgb(0 0 0/.1),0 8px 10px -6px rgb(0 0 0/.1)',
|
|
33
|
+
'--transition-fast': '150ms cubic-bezier(0.4,0,0.2,1)',
|
|
34
|
+
'--transition-normal': '200ms cubic-bezier(0.4,0,0.2,1)',
|
|
35
|
+
'--transition-slow': '300ms cubic-bezier(0.4,0,0.2,1)',
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,aAAa,GAAc;IAEtC,iBAAiB,EAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,oBAAoB,EAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,mBAAmB,EAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,sBAAsB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,gBAAgB,EAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,mBAAmB,EAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,iBAAiB,EAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,oBAAoB,EAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,iBAAiB,EAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,oBAAoB,EAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,iBAAiB,EAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE;IACnE,oBAAoB,EAAI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export type ComponentDef = MasterClass | ComponentMap;
|
|
3
|
+
export interface ComponentMap {
|
|
4
|
+
[variant: string]: MasterClass;
|
|
5
|
+
}
|
|
6
|
+
export type ComponentsMap = Record<string, ComponentDef>;
|
|
7
|
+
export type ColorValue = string | {
|
|
8
|
+
'@light': string;
|
|
9
|
+
'@dark': string;
|
|
10
|
+
};
|
|
11
|
+
export interface SMUColorTokens {
|
|
12
|
+
'--color-primary': ColorValue;
|
|
13
|
+
'--color-primary-fg': ColorValue;
|
|
14
|
+
'--color-secondary': ColorValue;
|
|
15
|
+
'--color-secondary-fg': ColorValue;
|
|
16
|
+
'--color-accent': ColorValue;
|
|
17
|
+
'--color-accent-fg': ColorValue;
|
|
18
|
+
'--color-neutral': ColorValue;
|
|
19
|
+
'--color-neutral-fg': ColorValue;
|
|
20
|
+
'--color-success': ColorValue;
|
|
21
|
+
'--color-success-fg': ColorValue;
|
|
22
|
+
'--color-warning': ColorValue;
|
|
23
|
+
'--color-warning-fg': ColorValue;
|
|
24
|
+
'--color-error': ColorValue;
|
|
25
|
+
'--color-error-fg': ColorValue;
|
|
26
|
+
'--color-info': ColorValue;
|
|
27
|
+
'--color-info-fg': ColorValue;
|
|
28
|
+
'--color-base': ColorValue;
|
|
29
|
+
'--color-base-2': ColorValue;
|
|
30
|
+
'--color-base-3': ColorValue;
|
|
31
|
+
'--color-border': ColorValue;
|
|
32
|
+
'--color-content': ColorValue;
|
|
33
|
+
'--color-content-2': ColorValue;
|
|
34
|
+
}
|
|
35
|
+
export interface SMURadiusTokens {
|
|
36
|
+
'--radius-sm': string;
|
|
37
|
+
'--radius-md': string;
|
|
38
|
+
'--radius-lg': string;
|
|
39
|
+
'--radius-xl': string;
|
|
40
|
+
'--radius-full': string;
|
|
41
|
+
}
|
|
42
|
+
export interface SMUShadowTokens {
|
|
43
|
+
'--shadow-sm': string;
|
|
44
|
+
'--shadow-md': string;
|
|
45
|
+
'--shadow-lg': string;
|
|
46
|
+
'--shadow-xl': string;
|
|
47
|
+
}
|
|
48
|
+
export interface SMUTransitionTokens {
|
|
49
|
+
'--transition-fast': string;
|
|
50
|
+
'--transition-normal': string;
|
|
51
|
+
'--transition-slow': string;
|
|
52
|
+
}
|
|
53
|
+
export type SMUTokens = SMUColorTokens & SMURadiusTokens & SMUShadowTokens & SMUTransitionTokens;
|
|
54
|
+
export type PartialSMUTokens = Partial<SMUTokens>;
|
|
55
|
+
export type PartialComponentsMap = Partial<Record<string, ComponentDef>>;
|
|
56
|
+
export interface SMUConfig {
|
|
57
|
+
classes: Record<string, string>;
|
|
58
|
+
tokens: SMUTokens;
|
|
59
|
+
rootCSS: string;
|
|
60
|
+
darkCSS: string;
|
|
61
|
+
}
|
|
62
|
+
export interface SMUExtendOptions {
|
|
63
|
+
tokens?: PartialSMUTokens;
|
|
64
|
+
components?: PartialComponentsMap;
|
|
65
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "simple-master-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A component library for Master CSS — pure HTML classes, no JS, dark/light theme support.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist/",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"typecheck": "tsc --noEmit"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"master-css",
|
|
26
|
+
"ui",
|
|
27
|
+
"components",
|
|
28
|
+
"dark-mode",
|
|
29
|
+
"design-system",
|
|
30
|
+
"no-js"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@master/css": ">=1.0.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@master/css": "^1.37.8",
|
|
38
|
+
"typescript": "^5.9.3"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Simple Master UI
|
|
2
|
+
|
|
3
|
+
> A **TypeScript-first** component library for [Master CSS](https://css.master.co) — pure HTML class names, zero JavaScript, built-in dark/light theme support. Inspired by DaisyUI.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- ✅ **25+ components** — buttons, cards, inputs, alerts, tables, avatars, and more
|
|
10
|
+
- 🌗 **Dark/light themes** — automatic via CSS variables and `data-theme` attribute
|
|
11
|
+
- 🚫 **Zero JS** — styles only, works with any stack or plain HTML
|
|
12
|
+
- 📦 **NPM ready** — fully typed, ships `.d.ts` files
|
|
13
|
+
- 🎨 **Fully customizable** — override any token or component variant with type safety
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install simple-master-ui @master/css
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### With Master CSS v1 (`Style.extend`)
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { Style } from '@master/css'
|
|
31
|
+
import { buildConfig, injectTokens } from 'simple-master-ui'
|
|
32
|
+
|
|
33
|
+
const config = buildConfig()
|
|
34
|
+
|
|
35
|
+
// Register all component classes
|
|
36
|
+
Style.extend('classes', config.classes)
|
|
37
|
+
|
|
38
|
+
// Inject CSS variable tokens into the document
|
|
39
|
+
injectTokens(config)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Extend with your own tokens and components
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { Style } from '@master/css'
|
|
46
|
+
import { extend, injectTokens } from 'simple-master-ui'
|
|
47
|
+
|
|
48
|
+
const config = extend({
|
|
49
|
+
tokens: {
|
|
50
|
+
// Override primary color for light and dark
|
|
51
|
+
'--color-primary': { '@light': '#e11d48', '@dark': '#fb7185' },
|
|
52
|
+
// Override a radius
|
|
53
|
+
'--radius-md': '0.75rem',
|
|
54
|
+
},
|
|
55
|
+
components: {
|
|
56
|
+
// Add a new variant to btn
|
|
57
|
+
btn: {
|
|
58
|
+
brand: 'btn bg:red-50! fg:white! font:bold',
|
|
59
|
+
},
|
|
60
|
+
// Completely override a component
|
|
61
|
+
card: {
|
|
62
|
+
'': 'flex flex:col bg:white r:12 shadow:lg b:1|solid|gray-20',
|
|
63
|
+
body: 'p:8x flex flex:col gap:5',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
Style.extend('classes', config.classes)
|
|
69
|
+
injectTokens(config)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### CDN / Plain HTML (no build step)
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<html data-theme="light">
|
|
76
|
+
<head>
|
|
77
|
+
<!-- Inject tokens via style tag -->
|
|
78
|
+
<style id="smu-tokens">
|
|
79
|
+
:root {
|
|
80
|
+
--color-primary: #4f46e5;
|
|
81
|
+
--color-base: #ffffff;
|
|
82
|
+
/* … see dist/index.js for all tokens … */
|
|
83
|
+
}
|
|
84
|
+
[data-theme="dark"] {
|
|
85
|
+
--color-primary: #818cf8;
|
|
86
|
+
--color-base: #0f172a;
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
89
|
+
<script src="https://cdn.master.co/css@1"></script>
|
|
90
|
+
<script>
|
|
91
|
+
// Register classes via the global Style object
|
|
92
|
+
MasterStyleSheet.extend?.('classes', { /* paste config.classes here */ })
|
|
93
|
+
</script>
|
|
94
|
+
</head>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Theme Toggle
|
|
100
|
+
|
|
101
|
+
```html
|
|
102
|
+
<html data-theme="light">
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
// Toggle dark mode
|
|
107
|
+
document.documentElement.setAttribute('data-theme', 'dark')
|
|
108
|
+
|
|
109
|
+
// Read current theme
|
|
110
|
+
const isDark = document.documentElement.getAttribute('data-theme') === 'dark'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## API
|
|
116
|
+
|
|
117
|
+
### `buildConfig(tokens?, components?): SMUConfig`
|
|
118
|
+
|
|
119
|
+
Build a config from fully resolved tokens and components.
|
|
120
|
+
|
|
121
|
+
```ts
|
|
122
|
+
import { buildConfig, defaultTokens, defaultComponents } from 'simple-master-ui'
|
|
123
|
+
|
|
124
|
+
const config = buildConfig(defaultTokens, defaultComponents)
|
|
125
|
+
// config.classes — flat Record<string, string> for Style.extend
|
|
126
|
+
// config.tokens — resolved SMUTokens
|
|
127
|
+
// config.rootCSS — :root { … } string
|
|
128
|
+
// config.darkCSS — [data-theme="dark"] { … } string
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### `extend(options): SMUConfig`
|
|
132
|
+
|
|
133
|
+
Merge your overrides on top of the defaults.
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
import { extend } from 'simple-master-ui'
|
|
137
|
+
|
|
138
|
+
const config = extend({
|
|
139
|
+
tokens: { '--color-primary': '#ff0000' },
|
|
140
|
+
components: { btn: { danger: 'btn bg:red-50! fg:white!' } },
|
|
141
|
+
})
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### `injectTokens(config?): void`
|
|
145
|
+
|
|
146
|
+
Inject CSS token variables into `document.head`. Safe to call multiple times.
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
import { injectTokens } from 'simple-master-ui'
|
|
150
|
+
injectTokens() // uses default config
|
|
151
|
+
injectTokens(customConfig) // uses your config
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### `buildRootCSS(tokens): string` / `buildDarkCSS(tokens): string`
|
|
155
|
+
|
|
156
|
+
Generate raw CSS strings (useful for SSR).
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
import { buildRootCSS, buildDarkCSS, defaultTokens } from 'simple-master-ui'
|
|
160
|
+
|
|
161
|
+
const html = `
|
|
162
|
+
<style>
|
|
163
|
+
${buildRootCSS(defaultTokens)}
|
|
164
|
+
${buildDarkCSS(defaultTokens)}
|
|
165
|
+
</style>
|
|
166
|
+
`
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Components
|
|
172
|
+
|
|
173
|
+
| Component | Base class | Variants example |
|
|
174
|
+
|---------------|-----------------|-------------------------------------------|
|
|
175
|
+
| Button | `btn` | `btn-primary`, `btn-sm`, `btn-outline`, `btn-circle` |
|
|
176
|
+
| Badge | `badge` | `badge-success`, `badge-lg`, `badge-outline` |
|
|
177
|
+
| Card | `card` | `card-body`, `card-title`, `card-bordered` |
|
|
178
|
+
| Input | `input` | `input-sm`, `input-error`, `input-ghost` |
|
|
179
|
+
| Select | `select` | `select-sm`, `select-lg` |
|
|
180
|
+
| Textarea | `textarea` | — |
|
|
181
|
+
| Alert | `alert` | `alert-info`, `alert-success`, `alert-error` |
|
|
182
|
+
| Avatar | `avatar` | `avatar-md`, `avatar-placeholder`, `avatar-ring` |
|
|
183
|
+
| Navbar | `navbar` | `navbar-brand`, `navbar-item`, `navbar-item-active` |
|
|
184
|
+
| Menu | `menu` | `menu-item`, `menu-item-active`, `menu-title` |
|
|
185
|
+
| Tabs | `tabs` | `tabs-tab`, `tabs-tab-active`, `tabs-boxed` |
|
|
186
|
+
| Table | `table` | `table-th`, `table-td`, `table-row`, `table-wrapper` |
|
|
187
|
+
| Modal | `modal` | `modal-box`, `modal-title`, `modal-actions` |
|
|
188
|
+
| Drawer | `drawer` | `drawer-overlay`, `drawer-header`, `drawer-body` |
|
|
189
|
+
| Progress | `progress` | `progress-bar`, `progress-success`, `progress-lg` |
|
|
190
|
+
| Skeleton | `skeleton` | `skeleton-text`, `skeleton-circle` |
|
|
191
|
+
| Loading | `loading` | `loading-sm`, `loading-md`, `loading-lg` |
|
|
192
|
+
| Tooltip | `tooltip` | `tooltip-text`, `tooltip-show` |
|
|
193
|
+
| Dropdown | `dropdown` | `dropdown-menu`, `dropdown-item`, `dropdown-divider` |
|
|
194
|
+
| Breadcrumb | `breadcrumb` | `breadcrumb-item`, `breadcrumb-link` |
|
|
195
|
+
| Pagination | `pagination` | `pagination-item`, `pagination-active` |
|
|
196
|
+
| Stat | `stat` | `stat-title`, `stat-value`, `stat-desc` |
|
|
197
|
+
| Accordion | `accordion` | `accordion-item`, `accordion-trigger` |
|
|
198
|
+
| Toast | `toast` | `toast-item`, `toast-success`, `toast-error` |
|
|
199
|
+
| Chip | `chip` | `chip-primary`, `chip-error` |
|
|
200
|
+
| Divider | `divider` | `divider-line`, `divider-label` |
|
|
201
|
+
| Code | `code` | `code-block` |
|
|
202
|
+
| Steps | `steps` | `steps-step`, `steps-bullet-active` |
|
|
203
|
+
| Hero | `hero` | `hero-body`, `hero-title`, `hero-sub` |
|
|
204
|
+
| Form Group | `form-group` | `form-group-label`, `form-group-error` |
|
|
205
|
+
| Container | `container` | — |
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Design Tokens
|
|
210
|
+
|
|
211
|
+
All tokens map to CSS custom properties. Override via `extend({ tokens: { … } })`:
|
|
212
|
+
|
|
213
|
+
| Token | Light default | Dark default |
|
|
214
|
+
|------------------------|---------------|--------------|
|
|
215
|
+
| `--color-primary` | `#4f46e5` | `#818cf8` |
|
|
216
|
+
| `--color-secondary` | `#0ea5e9` | `#38bdf8` |
|
|
217
|
+
| `--color-accent` | `#f59e0b` | `#fbbf24` |
|
|
218
|
+
| `--color-success` | `#22c55e` | `#4ade80` |
|
|
219
|
+
| `--color-warning` | `#f59e0b` | `#fbbf24` |
|
|
220
|
+
| `--color-error` | `#ef4444` | `#f87171` |
|
|
221
|
+
| `--color-base` | `#ffffff` | `#0f172a` |
|
|
222
|
+
| `--color-content` | `#0f172a` | `#f1f5f9` |
|
|
223
|
+
| `--color-border` | `#e2e8f0` | `#334155` |
|
|
224
|
+
| `--radius-md` | `0.5rem` | `0.5rem` |
|
|
225
|
+
| `--shadow-md` | `0 4px 6px …` | same |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## TypeScript
|
|
230
|
+
|
|
231
|
+
All exports are fully typed. Key types:
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
import type {
|
|
235
|
+
SMUConfig, // output of buildConfig() / extend()
|
|
236
|
+
SMUTokens, // all design token keys
|
|
237
|
+
SMUExtendOptions, // input to extend()
|
|
238
|
+
ComponentMap, // { '': string, primary: string, … }
|
|
239
|
+
ComponentsMap, // { btn: ComponentMap, card: ComponentMap, … }
|
|
240
|
+
} from 'simple-master-ui'
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## License
|
|
246
|
+
|
|
247
|
+
MIT © Simple Master UI Contributors
|