@starasia/theme 1.0.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/README.md +143 -0
- package/dist/components/ThemeProvider.d.ts +12 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/default.json.d.ts +542 -0
- package/dist/helpers/brandcolor.d.ts +3 -0
- package/dist/helpers/colorpalette.d.ts +3 -0
- package/dist/helpers/components.d.ts +3 -0
- package/dist/helpers/createTheme.d.ts +3 -0
- package/dist/helpers/font.d.ts +8 -0
- package/dist/helpers/generator.d.ts +3 -0
- package/dist/helpers/index.d.ts +6 -0
- package/dist/helpers/injector.d.ts +2 -0
- package/dist/helpers/maincolor.d.ts +3 -0
- package/dist/helpers/metric.d.ts +3 -0
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/use.d.ts +4 -0
- package/dist/hooks/useTheme.d.ts +6 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +1418 -0
- package/dist/index.umd.js +54 -0
- package/dist/types/components/alert.d.ts +33 -0
- package/dist/types/components/badge.d.ts +43 -0
- package/dist/types/components/button.d.ts +18 -0
- package/dist/types/components/card.d.ts +18 -0
- package/dist/types/components/checkbox.d.ts +29 -0
- package/dist/types/components/date.d.ts +39 -0
- package/dist/types/components/input.d.ts +33 -0
- package/dist/types/components/menu.d.ts +21 -0
- package/dist/types/components/pagination.d.ts +32 -0
- package/dist/types/components/radio.d.ts +26 -0
- package/dist/types/components/tab.d.ts +25 -0
- package/dist/types/components/table.d.ts +35 -0
- package/dist/types/components/textarea.d.ts +37 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/theme.d.ts +236 -0
- package/package.json +46 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { AlertModel } from './components/alert';
|
|
2
|
+
import { BadgeModel } from './components/badge';
|
|
3
|
+
import { ButtonModel } from './components/button';
|
|
4
|
+
import { CardModel } from './components/card';
|
|
5
|
+
import { CheckboxModel } from './components/checkbox';
|
|
6
|
+
import { DateModel } from './components/date';
|
|
7
|
+
import { InputModel } from './components/input';
|
|
8
|
+
import { MenuModel } from './components/menu';
|
|
9
|
+
import { PaginationModel } from './components/pagination';
|
|
10
|
+
import { RadioModel } from './components/radio';
|
|
11
|
+
import { TabModel } from './components/tab';
|
|
12
|
+
import { TableModel } from './components/table';
|
|
13
|
+
import { TextareaModel } from './components/textarea';
|
|
14
|
+
|
|
15
|
+
export interface ThemeObject {
|
|
16
|
+
colors?: Colors;
|
|
17
|
+
metrics?: Metrics;
|
|
18
|
+
font?: Font;
|
|
19
|
+
components?: ThemeComponentModel;
|
|
20
|
+
}
|
|
21
|
+
export interface ThemeComponentModel {
|
|
22
|
+
alert?: AlertModel;
|
|
23
|
+
badge?: BadgeModel;
|
|
24
|
+
card?: CardModel;
|
|
25
|
+
checkbox?: CheckboxModel;
|
|
26
|
+
date?: DateModel;
|
|
27
|
+
input?: InputModel;
|
|
28
|
+
menu?: MenuModel;
|
|
29
|
+
button?: ButtonModel;
|
|
30
|
+
pagination?: PaginationModel;
|
|
31
|
+
radio?: RadioModel;
|
|
32
|
+
table?: TableModel;
|
|
33
|
+
tabs?: TabModel;
|
|
34
|
+
textarea?: TextareaModel;
|
|
35
|
+
}
|
|
36
|
+
export interface Colors {
|
|
37
|
+
raw?: Raw;
|
|
38
|
+
computed?: Computed;
|
|
39
|
+
main?: Main;
|
|
40
|
+
brand?: Brand;
|
|
41
|
+
text?: Text;
|
|
42
|
+
utility?: Utility;
|
|
43
|
+
}
|
|
44
|
+
export interface Raw {
|
|
45
|
+
white?: Shades;
|
|
46
|
+
black?: Shades;
|
|
47
|
+
blue?: Shades;
|
|
48
|
+
pink?: Shades;
|
|
49
|
+
purple?: Shades;
|
|
50
|
+
gray?: Shades;
|
|
51
|
+
red?: Shades;
|
|
52
|
+
orange?: Shades;
|
|
53
|
+
aloha?: Shades;
|
|
54
|
+
green?: Shades;
|
|
55
|
+
}
|
|
56
|
+
export interface Shades {
|
|
57
|
+
"50"?: string;
|
|
58
|
+
"100"?: string;
|
|
59
|
+
"200"?: string;
|
|
60
|
+
"300"?: string;
|
|
61
|
+
"400"?: string;
|
|
62
|
+
"500"?: string;
|
|
63
|
+
"600"?: string;
|
|
64
|
+
"700"?: string;
|
|
65
|
+
"800"?: string;
|
|
66
|
+
"900"?: string;
|
|
67
|
+
[key: string]: string | undefined;
|
|
68
|
+
}
|
|
69
|
+
export interface Computed extends Raw {
|
|
70
|
+
}
|
|
71
|
+
export interface Main {
|
|
72
|
+
primary?: Theme;
|
|
73
|
+
secondary?: Theme;
|
|
74
|
+
tertiary?: Theme;
|
|
75
|
+
success?: Theme;
|
|
76
|
+
danger?: Theme;
|
|
77
|
+
warning?: Theme;
|
|
78
|
+
}
|
|
79
|
+
export interface Theme {
|
|
80
|
+
"background-color"?: string;
|
|
81
|
+
"text-color"?: string;
|
|
82
|
+
"border-color"?: string;
|
|
83
|
+
hover?: Hover;
|
|
84
|
+
active?: Active;
|
|
85
|
+
disable?: Disable;
|
|
86
|
+
}
|
|
87
|
+
export interface Hover extends Theme {
|
|
88
|
+
}
|
|
89
|
+
export interface Active extends Theme {
|
|
90
|
+
shadow?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface Disable extends Theme {
|
|
93
|
+
}
|
|
94
|
+
export interface Brand {
|
|
95
|
+
primary?: BrandItem;
|
|
96
|
+
secondary?: BrandItem;
|
|
97
|
+
}
|
|
98
|
+
export interface BrandItem {
|
|
99
|
+
default?: string;
|
|
100
|
+
secondary?: string;
|
|
101
|
+
tertiary?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface Text {
|
|
104
|
+
default?: string;
|
|
105
|
+
secondary?: string;
|
|
106
|
+
tertiary?: string;
|
|
107
|
+
disable?: string;
|
|
108
|
+
white?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface Utility {
|
|
111
|
+
success?: Theme;
|
|
112
|
+
danger?: Theme;
|
|
113
|
+
warning?: Theme;
|
|
114
|
+
information?: Theme;
|
|
115
|
+
dark?: Theme;
|
|
116
|
+
fill?: Theme;
|
|
117
|
+
}
|
|
118
|
+
export interface Metrics {
|
|
119
|
+
radii?: Radii;
|
|
120
|
+
spacing?: Spacing;
|
|
121
|
+
border?: Border;
|
|
122
|
+
shadows?: Shadows;
|
|
123
|
+
borderRadius?: BorderRadius;
|
|
124
|
+
}
|
|
125
|
+
export interface BorderRadius extends Sizes {
|
|
126
|
+
rounded: string;
|
|
127
|
+
circular: string;
|
|
128
|
+
}
|
|
129
|
+
export interface Radii extends Sizes {
|
|
130
|
+
none: string;
|
|
131
|
+
xs: string;
|
|
132
|
+
sm: string;
|
|
133
|
+
md: string;
|
|
134
|
+
lg: string;
|
|
135
|
+
xl: string;
|
|
136
|
+
"2xl": string;
|
|
137
|
+
full: string;
|
|
138
|
+
}
|
|
139
|
+
export interface Sizes {
|
|
140
|
+
[key: string]: string | number;
|
|
141
|
+
}
|
|
142
|
+
export interface Spacing extends Sizes {
|
|
143
|
+
"0": string;
|
|
144
|
+
"1": string;
|
|
145
|
+
"2": string;
|
|
146
|
+
"4": string;
|
|
147
|
+
"6": string;
|
|
148
|
+
"8": string;
|
|
149
|
+
"10": string;
|
|
150
|
+
"12": string;
|
|
151
|
+
"14": string;
|
|
152
|
+
"16": string;
|
|
153
|
+
"18": string;
|
|
154
|
+
"20": string;
|
|
155
|
+
"24": string;
|
|
156
|
+
"28": string;
|
|
157
|
+
"32": string;
|
|
158
|
+
"36": string;
|
|
159
|
+
"40": string;
|
|
160
|
+
"48": string;
|
|
161
|
+
"64": string;
|
|
162
|
+
"80": string;
|
|
163
|
+
"96": string;
|
|
164
|
+
"128": string;
|
|
165
|
+
"160": string;
|
|
166
|
+
"192": string;
|
|
167
|
+
"224": string;
|
|
168
|
+
"256": string;
|
|
169
|
+
auto: string;
|
|
170
|
+
xs: string;
|
|
171
|
+
sm: string;
|
|
172
|
+
md: string;
|
|
173
|
+
lg: string;
|
|
174
|
+
xl: string;
|
|
175
|
+
"2xl": string;
|
|
176
|
+
"3xl": string;
|
|
177
|
+
}
|
|
178
|
+
export interface Border {
|
|
179
|
+
default?: string;
|
|
180
|
+
}
|
|
181
|
+
export interface Shadows extends Sizes {
|
|
182
|
+
sm: string;
|
|
183
|
+
md: string;
|
|
184
|
+
lg: string;
|
|
185
|
+
xl: string;
|
|
186
|
+
"2xl": string;
|
|
187
|
+
inner: string;
|
|
188
|
+
unnamed: string;
|
|
189
|
+
}
|
|
190
|
+
export interface Font {
|
|
191
|
+
fontSizes?: FontSizes;
|
|
192
|
+
fontWeights?: FontWeights;
|
|
193
|
+
lineHeights?: LineHeights;
|
|
194
|
+
}
|
|
195
|
+
export interface FontSizes extends Sizes {
|
|
196
|
+
xs: string;
|
|
197
|
+
sm: string;
|
|
198
|
+
md: string;
|
|
199
|
+
lg: string;
|
|
200
|
+
xl: string;
|
|
201
|
+
"2xl": string;
|
|
202
|
+
"3xl": string;
|
|
203
|
+
"4xl": string;
|
|
204
|
+
"5xl": string;
|
|
205
|
+
"6xl": string;
|
|
206
|
+
}
|
|
207
|
+
export interface LineHeights extends Sizes {
|
|
208
|
+
"3": string;
|
|
209
|
+
"4": string;
|
|
210
|
+
"5": string;
|
|
211
|
+
"6": string;
|
|
212
|
+
"7": string;
|
|
213
|
+
"8": string;
|
|
214
|
+
"9": string;
|
|
215
|
+
"10": string;
|
|
216
|
+
none: number;
|
|
217
|
+
tight: number;
|
|
218
|
+
snug: number;
|
|
219
|
+
normal: number;
|
|
220
|
+
relaxed: number;
|
|
221
|
+
loose: number;
|
|
222
|
+
}
|
|
223
|
+
export interface Weights {
|
|
224
|
+
[key: string]: number;
|
|
225
|
+
}
|
|
226
|
+
export interface FontWeights extends Weights {
|
|
227
|
+
hairline: number;
|
|
228
|
+
thin: number;
|
|
229
|
+
light: number;
|
|
230
|
+
normal: number;
|
|
231
|
+
medium: number;
|
|
232
|
+
semibold: number;
|
|
233
|
+
bold: number;
|
|
234
|
+
extrabold: number;
|
|
235
|
+
black: number;
|
|
236
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@starasia/theme",
|
|
3
|
+
"author": "Prawito Hudoro",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Theme component for starasia UI",
|
|
6
|
+
"main": "dist/index.umd.js",
|
|
7
|
+
"module": "dist/index.es.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"dev": "vite --config vite.config.ts --port 3000",
|
|
14
|
+
"build": "vite build --config vite.config.ts"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [],
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18.0.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@starasia/button": "^1.0.0",
|
|
24
|
+
"@starasia/text": "1.0.0",
|
|
25
|
+
"@types/node": "^20.14.2",
|
|
26
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
27
|
+
"tsconfig-paths": "^4.2.0",
|
|
28
|
+
"typescript": "^5.4.5",
|
|
29
|
+
"vite": "^5.2.13",
|
|
30
|
+
"vite-plugin-dts": "^3.9.1",
|
|
31
|
+
"react": "^18.2.0",
|
|
32
|
+
"react-dom": "^18.2.0",
|
|
33
|
+
"@types/react": "^18.2.55",
|
|
34
|
+
"@types/react-dom": "^18.2.19"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": ">=18.2.0",
|
|
38
|
+
"react-dom": ">=18.2.0"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@starasia/css": "1.0.0"
|
|
45
|
+
}
|
|
46
|
+
}
|