rouse-ui-kit 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/src/theme.ts ADDED
@@ -0,0 +1,220 @@
1
+ import { createTheme } from "@mui/material/styles";
2
+ import {
3
+ background,
4
+ error,
5
+ gray,
6
+ info,
7
+ interaction,
8
+ other,
9
+ primary,
10
+ secondary,
11
+ success,
12
+ text,
13
+ typography as t,
14
+ warning,
15
+ } from "./design-tokens";
16
+
17
+ const theme = createTheme({
18
+ // ─── Palette ────────────────────────────────────────────────────────────────
19
+ palette: {
20
+ primary: {
21
+ light: primary.light,
22
+ main: primary.main,
23
+ dark: primary.dark,
24
+ contrastText: primary.contrastText,
25
+ },
26
+ secondary: {
27
+ light: secondary.light,
28
+ main: secondary.main,
29
+ dark: secondary.dark,
30
+ contrastText: secondary.contrastText,
31
+ },
32
+ error: {
33
+ light: error.light,
34
+ main: error.main,
35
+ },
36
+ warning: {
37
+ main: warning.main,
38
+ },
39
+ success: {
40
+ light: success.light,
41
+ main: success.main,
42
+ },
43
+ info: {
44
+ light: info.light,
45
+ main: info.main,
46
+ },
47
+ text: {
48
+ primary: text.primary,
49
+ secondary: text.secondary,
50
+ disabled: text.disabled,
51
+ },
52
+ background: {
53
+ paper: background.paper,
54
+ default: background.default,
55
+ },
56
+ divider: other.divider,
57
+ action: {
58
+ disabledBackground: other.divider,
59
+ disabled: text.disabled,
60
+ hover: interaction.hover,
61
+ selected: interaction.selected,
62
+ },
63
+ },
64
+
65
+ // ─── Typography ─────────────────────────────────────────────────────────────
66
+ typography: {
67
+ fontFamily: t.fontFamily,
68
+ h1: t.h1,
69
+ h2: t.h2,
70
+ h3: t.h3,
71
+ h4: t.h4,
72
+ h5: t.h5,
73
+ h6: t.h6,
74
+ subtitle1: t.subtitle1,
75
+ subtitle2: t.subtitle2,
76
+ body1: t.body1,
77
+ body2: t.body2,
78
+ button: t.button,
79
+ caption: t.caption,
80
+ overline: t.overline,
81
+ },
82
+
83
+ // ─── Component overrides ────────────────────────────────────────────────────
84
+ components: {
85
+ // Button
86
+ MuiButton: {
87
+ styleOverrides: {
88
+ root: {
89
+ borderRadius: "4px",
90
+ padding: "8px 16px",
91
+ boxShadow: "none",
92
+ "&:hover": { boxShadow: "none" },
93
+ "&:focus-visible": {
94
+ outline: `4px solid ${interaction.focusRing}`,
95
+ outlineOffset: "0px",
96
+ },
97
+ },
98
+ containedPrimary: {
99
+ "&:hover": { backgroundColor: primary.dark },
100
+ },
101
+ outlinedPrimary: {
102
+ border: `1px solid ${primary.light}`,
103
+ color: primary.main,
104
+ "&:hover": {
105
+ backgroundColor: primary.tint,
106
+ border: `1px solid ${primary.light}`,
107
+ },
108
+ "&:focus-visible": {
109
+ outline: `4px solid ${interaction.focusRing}`,
110
+ outlineOffset: "0px",
111
+ border: `1px solid ${primary.light}`,
112
+ },
113
+ "&.Mui-disabled": {
114
+ border: `1px solid ${gray[20]}`,
115
+ color: text.disabled,
116
+ },
117
+ },
118
+ textPrimary: {
119
+ padding: "8px",
120
+ color: primary.main,
121
+ "&:hover": { backgroundColor: primary.tint },
122
+ "&:focus-visible": {
123
+ outline: `4px solid ${interaction.focusRing}`,
124
+ outlineOffset: "0px",
125
+ },
126
+ "&.Mui-disabled": { color: text.disabled },
127
+ },
128
+ },
129
+ },
130
+
131
+ // Checkbox
132
+ MuiCheckbox: {
133
+ styleOverrides: {
134
+ root: {
135
+ padding: "8px",
136
+ borderRadius: "19px",
137
+ color: primary.main,
138
+ "& .MuiSvgIcon-root": { fontSize: "20px" },
139
+ "&:hover": { backgroundColor: primary.shade8p },
140
+ "&.Mui-focusVisible": { backgroundColor: interaction.focus },
141
+ "&.Mui-checked": { color: primary.main },
142
+ "&.Mui-disabled": { color: gray[20] },
143
+ },
144
+ },
145
+ },
146
+
147
+ // FormControlLabel (Checkbox label)
148
+ MuiFormControlLabel: {
149
+ styleOverrides: {
150
+ label: {
151
+ ...t.caption,
152
+ color: text.primary,
153
+ "&.Mui-disabled": { color: text.disabled },
154
+ },
155
+ },
156
+ },
157
+
158
+ // OutlinedInput (TextField + Select shared)
159
+ MuiOutlinedInput: {
160
+ styleOverrides: {
161
+ root: {
162
+ fontSize: t.inputText.fontSize,
163
+ letterSpacing: t.inputText.letterSpacing,
164
+ color: text.primary,
165
+ "& .MuiOutlinedInput-notchedOutline": {
166
+ borderColor: other.outlinedBorder,
167
+ },
168
+ "&:hover .MuiOutlinedInput-notchedOutline": {
169
+ borderColor: primary.main,
170
+ },
171
+ "&.Mui-focused .MuiOutlinedInput-notchedOutline": {
172
+ borderColor: primary.main,
173
+ borderWidth: "2px",
174
+ },
175
+ "&.Mui-disabled .MuiOutlinedInput-notchedOutline": {
176
+ borderColor: other.divider,
177
+ },
178
+ "&.Mui-error .MuiOutlinedInput-notchedOutline": {
179
+ borderColor: error.main,
180
+ borderWidth: "2px",
181
+ },
182
+ },
183
+ input: {
184
+ padding: "9px 14px",
185
+ lineHeight: t.inputText.lineHeight,
186
+ },
187
+ },
188
+ },
189
+
190
+ // InputLabel (Select + TextField shared)
191
+ MuiInputLabel: {
192
+ styleOverrides: {
193
+ root: {
194
+ fontSize: t.inputText.fontSize,
195
+ lineHeight: t.inputText.lineHeight,
196
+ letterSpacing: t.inputText.letterSpacing,
197
+ color: text.secondary,
198
+ "&.Mui-focused": { color: primary.main },
199
+ "&.Mui-error": { color: error.main },
200
+ "&.Mui-disabled": { color: "rgba(0, 0, 0, 0.38)" },
201
+ },
202
+ },
203
+ },
204
+
205
+ // FormHelperText
206
+ MuiFormHelperText: {
207
+ styleOverrides: {
208
+ root: {
209
+ ...t.helperText,
210
+ color: text.secondary,
211
+ marginTop: "4px",
212
+ marginLeft: 0,
213
+ marginRight: 0,
214
+ },
215
+ },
216
+ },
217
+ },
218
+ });
219
+
220
+ export default theme;