@atomazing-org/design-system 1.0.69 → 1.0.72
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 → README.MD} +277 -277
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +29 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +68 -68
package/{README.md → README.MD}
RENAMED
|
@@ -1,277 +1,277 @@
|
|
|
1
|
-
@atomazing-org/design-system
|
|
2
|
-
|
|
3
|
-
Modern MUI + Emotion design system with a ready theme factory, extended typography, global styles, component overrides, animations, and handy utilities.
|
|
4
|
-
|
|
5
|
-
Contents
|
|
6
|
-
- Introduction
|
|
7
|
-
- Installation
|
|
8
|
-
- Quick Start
|
|
9
|
-
- Provider Props
|
|
10
|
-
- Dynamic Themes (array)
|
|
11
|
-
- Theme Switching (UI)
|
|
12
|
-
- Dark Mode Control
|
|
13
|
-
- Extended Palette (4 variants)
|
|
14
|
-
- Palette Overrides
|
|
15
|
-
- Using Palette In SX
|
|
16
|
-
- Typography Variants
|
|
17
|
-
- Global Styles
|
|
18
|
-
- Animations
|
|
19
|
-
- Components
|
|
20
|
-
- Utilities
|
|
21
|
-
- SSR Notes
|
|
22
|
-
- Peer Dependencies
|
|
23
|
-
|
|
24
|
-
Introduction
|
|
25
|
-
The package streamlines consistent theming across apps: dark/light mode, typography variants, global styles, and component defaults. Built on MUI v7 + Emotion.
|
|
26
|
-
|
|
27
|
-
Installation
|
|
28
|
-
```bash
|
|
29
|
-
npm install @atomazing-org/design-system
|
|
30
|
-
npm install @mui/material @mui/icons-material @emotion/react @emotion/styled @emotion/css
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Quick Start
|
|
34
|
-
```tsx
|
|
35
|
-
import { ThemeProviderWrapper } from '@atomazing-org/design-system';
|
|
36
|
-
|
|
37
|
-
export function App() {
|
|
38
|
-
return (
|
|
39
|
-
<ThemeProviderWrapper>
|
|
40
|
-
{/* your app */}
|
|
41
|
-
</ThemeProviderWrapper>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
If `themes` is not provided, the provider falls back to a single "Default" theme using the current palette brand color.
|
|
47
|
-
|
|
48
|
-
Provider Props
|
|
49
|
-
- `themes?: { name: string; primaryColor: string; secondaryColor?: string }[]`
|
|
50
|
-
- `fontFamily?: string`
|
|
51
|
-
- `colorPaletteOverride?: Partial<ColorPaletteType>`
|
|
52
|
-
|
|
53
|
-
Dynamic Themes (array)
|
|
54
|
-
Provide a fully dynamic list of themes to the provider. This takes priority over static defaults.
|
|
55
|
-
|
|
56
|
-
```tsx
|
|
57
|
-
<ThemeProviderWrapper
|
|
58
|
-
themes={[
|
|
59
|
-
{ name: 'Blue', primaryColor: '#3B82F6' },
|
|
60
|
-
{
|
|
61
|
-
name: 'Aurora',
|
|
62
|
-
primaryColor: '#00E952',
|
|
63
|
-
secondaryColor: '#011926',
|
|
64
|
-
background: {
|
|
65
|
-
light: { default: '#F0FFF6', paper: '#FFFFFF' },
|
|
66
|
-
dark: { default: '#071B13', paper: '#0E2A1F' },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{ name: 'Gray', primaryColor: '#64748B' },
|
|
70
|
-
]}
|
|
71
|
-
>
|
|
72
|
-
{/* ... */}
|
|
73
|
-
</ThemeProviderWrapper>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Theme Switching (UI)
|
|
77
|
-
Use the theme context to read and change the active theme.
|
|
78
|
-
|
|
79
|
-
```tsx
|
|
80
|
-
import { useThemeSettings } from '@atomazing-org/design-system';
|
|
81
|
-
import { ToggleButton, ToggleButtonGroup } from '@mui/material';
|
|
82
|
-
|
|
83
|
-
export function ThemeToggle() {
|
|
84
|
-
const { theme, setTheme } = useThemeSettings();
|
|
85
|
-
const options = ['Blue', 'Green', 'Gray'];
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<ToggleButtonGroup
|
|
89
|
-
size="small"
|
|
90
|
-
exclusive
|
|
91
|
-
color="brand"
|
|
92
|
-
value={theme}
|
|
93
|
-
onChange={(_, v) => v && setTheme(v)}
|
|
94
|
-
>
|
|
95
|
-
{options.map((o) => (
|
|
96
|
-
<ToggleButton key={o} value={o}>{o}</ToggleButton>
|
|
97
|
-
))}
|
|
98
|
-
</ToggleButtonGroup>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Dark Mode Control
|
|
104
|
-
Use `useThemeSettings()` to read and set dark mode. Modes: `light | dark | system | auto`.
|
|
105
|
-
|
|
106
|
-
```tsx
|
|
107
|
-
import { useThemeSettings, darkModeOptions } from '@atomazing-org/design-system';
|
|
108
|
-
import { RadioGroup, FormControlLabel, Radio } from '@mui/material';
|
|
109
|
-
|
|
110
|
-
export function DarkModeSelector() {
|
|
111
|
-
const { darkMode, setDarkMode } = useThemeSettings();
|
|
112
|
-
const options = darkModeOptions; // label + icon
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<RadioGroup
|
|
116
|
-
row
|
|
117
|
-
value={darkMode}
|
|
118
|
-
onChange={(e) => setDarkMode(e.target.value as any)}
|
|
119
|
-
>
|
|
120
|
-
{options.map((o) => (
|
|
121
|
-
<FormControlLabel key={o.value} value={o.value} control={<Radio />} label={o.label} />
|
|
122
|
-
))}
|
|
123
|
-
</RadioGroup>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
Extended Palette (4 variants)
|
|
129
|
-
The design system adds four typed colors to the MUI palette, available on common components via the `color` prop:
|
|
130
|
-
|
|
131
|
-
- brand: project brand color (uses the active theme `primary`).
|
|
132
|
-
- neutral: neutral/gray scale color (from the design-system palette).
|
|
133
|
-
- accent: supporting accent color (from palette `accent`).
|
|
134
|
-
- muted: soft/desaturated color (based on neutral by default).
|
|
135
|
-
|
|
136
|
-
Supported components: `Button`, `Chip`, `Badge`, `Alert`.
|
|
137
|
-
|
|
138
|
-
```tsx
|
|
139
|
-
import { Button, Chip, Alert } from '@mui/material';
|
|
140
|
-
|
|
141
|
-
<Button color="brand" variant="contained">Brand</Button>
|
|
142
|
-
<Button color="neutral" variant="outlined">Neutral</Button>
|
|
143
|
-
<Chip color="accent" label="Accent" />
|
|
144
|
-
<Alert color="muted" variant="filled">Muted Alert</Alert>
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
Palette Overrides
|
|
148
|
-
Override base palette tokens for the whole app.
|
|
149
|
-
|
|
150
|
-
```tsx
|
|
151
|
-
<ThemeProviderWrapper
|
|
152
|
-
colorPaletteOverride={{
|
|
153
|
-
brand: '#4F46E5',
|
|
154
|
-
accent: '#F59E0B',
|
|
155
|
-
muted: '#94A3B8',
|
|
156
|
-
neutral: '#64748B',
|
|
157
|
-
success: '#16A34A',
|
|
158
|
-
warning: '#D97706',
|
|
159
|
-
error: '#DC2626',
|
|
160
|
-
info: '#0284C7',
|
|
161
|
-
}}
|
|
162
|
-
>
|
|
163
|
-
{/* ... */}
|
|
164
|
-
</ThemeProviderWrapper>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
Using Palette In SX
|
|
168
|
-
```tsx
|
|
169
|
-
import { Box } from '@mui/material';
|
|
170
|
-
|
|
171
|
-
<Box sx={{ bgcolor: (t) => t.palette.accent.main, color: (t) => t.palette.getContrastText(t.palette.accent.main) }}>
|
|
172
|
-
Accent surface
|
|
173
|
-
</Box>
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Typography Variants
|
|
177
|
-
Extra variants are available (mapping to `<p>`/headers). Examples:
|
|
178
|
-
|
|
179
|
-
```tsx
|
|
180
|
-
import { Typography } from '@mui/material';
|
|
181
|
-
|
|
182
|
-
<Typography variant="text_md_regular">Body text</Typography>
|
|
183
|
-
<Typography variant="text_sm_bold">Strong caption</Typography>
|
|
184
|
-
<Typography variant="header_lg_bold">Section Title</Typography>
|
|
185
|
-
<Typography variant="header_md_semibold">Semibold Heading</Typography>
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
Global Styles
|
|
189
|
-
`ThemeProviderWrapper` injects global styles via Emotion. You can also set a custom font family:
|
|
190
|
-
|
|
191
|
-
```tsx
|
|
192
|
-
<ThemeProviderWrapper fontFamily="Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif">
|
|
193
|
-
{/* ... */}
|
|
194
|
-
</ThemeProviderWrapper>
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
Animations
|
|
198
|
-
Keyframes ready for use in Emotion/MUI `sx`:
|
|
199
|
-
|
|
200
|
-
```tsx
|
|
201
|
-
import { keyframes } from '@emotion/react';
|
|
202
|
-
import { fadeIn, slideIn, scale, pulseAnimation, progressPulse } from '@atomazing-org/design-system';
|
|
203
|
-
import styled from '@emotion/styled';
|
|
204
|
-
|
|
205
|
-
const Card = styled.div`
|
|
206
|
-
animation: ${fadeIn} 300ms ease-in both;
|
|
207
|
-
`;
|
|
208
|
-
|
|
209
|
-
const Glowing = styled.div`
|
|
210
|
-
animation: ${progressPulse('#9FA9EA')} 2s ease-in-out infinite;
|
|
211
|
-
`;
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
Components
|
|
215
|
-
- ErrorBoundary
|
|
216
|
-
```tsx
|
|
217
|
-
import { ErrorBoundary } from '@atomazing-org/design-system';
|
|
218
|
-
|
|
219
|
-
<ErrorBoundary>
|
|
220
|
-
<App />
|
|
221
|
-
</ErrorBoundary>
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
- Loading
|
|
225
|
-
```tsx
|
|
226
|
-
import { Loading } from '@atomazing-org/design-system';
|
|
227
|
-
|
|
228
|
-
<Loading />
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
- PathName / DialogBtn
|
|
232
|
-
```tsx
|
|
233
|
-
import { PathName, DialogBtn } from '@atomazing-org/design-system';
|
|
234
|
-
|
|
235
|
-
<PathName>/settings/profile</PathName>
|
|
236
|
-
<DialogBtn variant="contained" color="brand">OK</DialogBtn>
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
Utilities
|
|
240
|
-
```tsx
|
|
241
|
-
import {
|
|
242
|
-
getFontColor, isFontLight, isHexColor,
|
|
243
|
-
timeAgo, timeAgoFromStart,
|
|
244
|
-
useResponsiveDisplay, useSystemTheme,
|
|
245
|
-
displayGreeting, getDayIdentifier,
|
|
246
|
-
systemInfo,
|
|
247
|
-
} from '@atomazing-org/design-system';
|
|
248
|
-
|
|
249
|
-
// Colors
|
|
250
|
-
getFontColor('#ffffff'); // '#101727' | '#f0f0f0'
|
|
251
|
-
isFontLight('#222');
|
|
252
|
-
isHexColor('#abc');
|
|
253
|
-
|
|
254
|
-
// Time
|
|
255
|
-
timeAgo(new Date(Date.now() - 3600_000));
|
|
256
|
-
timeAgoFromStart(new Date(Date.now() + 90_000));
|
|
257
|
-
|
|
258
|
-
// Device
|
|
259
|
-
const isMobile = useResponsiveDisplay(768);
|
|
260
|
-
const sysTheme = useSystemTheme(); // 'light' | 'dark' | 'unknown'
|
|
261
|
-
|
|
262
|
-
// Misc
|
|
263
|
-
displayGreeting(); // Good morning / afternoon / evening
|
|
264
|
-
getDayIdentifier(new Date()); // 'YYYY-MM-DD'
|
|
265
|
-
console.log(systemInfo.os, systemInfo.browser);
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
SSR Notes
|
|
269
|
-
- The library guards `localStorage`/`navigator`. Use normally in SSR apps; hydration updates settings on client.
|
|
270
|
-
- For Next.js, place the provider in a client boundary (e.g., `layout.tsx` with `"use client"`).
|
|
271
|
-
|
|
272
|
-
Peer Dependencies
|
|
273
|
-
- `@mui/material` ^7
|
|
274
|
-
- `@mui/icons-material` ^7
|
|
275
|
-
- `@emotion/react` ^11
|
|
276
|
-
- `@emotion/styled` ^11
|
|
277
|
-
- `@emotion/css` ^11 (optional)
|
|
1
|
+
@atomazing-org/design-system
|
|
2
|
+
|
|
3
|
+
Modern MUI + Emotion design system with a ready theme factory, extended typography, global styles, component overrides, animations, and handy utilities.
|
|
4
|
+
|
|
5
|
+
Contents
|
|
6
|
+
- Introduction
|
|
7
|
+
- Installation
|
|
8
|
+
- Quick Start
|
|
9
|
+
- Provider Props
|
|
10
|
+
- Dynamic Themes (array)
|
|
11
|
+
- Theme Switching (UI)
|
|
12
|
+
- Dark Mode Control
|
|
13
|
+
- Extended Palette (4 variants)
|
|
14
|
+
- Palette Overrides
|
|
15
|
+
- Using Palette In SX
|
|
16
|
+
- Typography Variants
|
|
17
|
+
- Global Styles
|
|
18
|
+
- Animations
|
|
19
|
+
- Components
|
|
20
|
+
- Utilities
|
|
21
|
+
- SSR Notes
|
|
22
|
+
- Peer Dependencies
|
|
23
|
+
|
|
24
|
+
Introduction
|
|
25
|
+
The package streamlines consistent theming across apps: dark/light mode, typography variants, global styles, and component defaults. Built on MUI v7 + Emotion.
|
|
26
|
+
|
|
27
|
+
Installation
|
|
28
|
+
```bash
|
|
29
|
+
npm install @atomazing-org/design-system
|
|
30
|
+
npm install @mui/material @mui/icons-material @emotion/react @emotion/styled @emotion/css
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Quick Start
|
|
34
|
+
```tsx
|
|
35
|
+
import { ThemeProviderWrapper } from '@atomazing-org/design-system';
|
|
36
|
+
|
|
37
|
+
export function App() {
|
|
38
|
+
return (
|
|
39
|
+
<ThemeProviderWrapper>
|
|
40
|
+
{/* your app */}
|
|
41
|
+
</ThemeProviderWrapper>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If `themes` is not provided, the provider falls back to a single "Default" theme using the current palette brand color.
|
|
47
|
+
|
|
48
|
+
Provider Props
|
|
49
|
+
- `themes?: { name: string; primaryColor: string; secondaryColor?: string }[]`
|
|
50
|
+
- `fontFamily?: string`
|
|
51
|
+
- `colorPaletteOverride?: Partial<ColorPaletteType>`
|
|
52
|
+
|
|
53
|
+
Dynamic Themes (array)
|
|
54
|
+
Provide a fully dynamic list of themes to the provider. This takes priority over static defaults.
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
<ThemeProviderWrapper
|
|
58
|
+
themes={[
|
|
59
|
+
{ name: 'Blue', primaryColor: '#3B82F6' },
|
|
60
|
+
{
|
|
61
|
+
name: 'Aurora',
|
|
62
|
+
primaryColor: '#00E952',
|
|
63
|
+
secondaryColor: '#011926',
|
|
64
|
+
background: {
|
|
65
|
+
light: { default: '#F0FFF6', paper: '#FFFFFF' },
|
|
66
|
+
dark: { default: '#071B13', paper: '#0E2A1F' },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{ name: 'Gray', primaryColor: '#64748B' },
|
|
70
|
+
]}
|
|
71
|
+
>
|
|
72
|
+
{/* ... */}
|
|
73
|
+
</ThemeProviderWrapper>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Theme Switching (UI)
|
|
77
|
+
Use the theme context to read and change the active theme.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { useThemeSettings } from '@atomazing-org/design-system';
|
|
81
|
+
import { ToggleButton, ToggleButtonGroup } from '@mui/material';
|
|
82
|
+
|
|
83
|
+
export function ThemeToggle() {
|
|
84
|
+
const { theme, setTheme } = useThemeSettings();
|
|
85
|
+
const options = ['Blue', 'Green', 'Gray'];
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<ToggleButtonGroup
|
|
89
|
+
size="small"
|
|
90
|
+
exclusive
|
|
91
|
+
color="brand"
|
|
92
|
+
value={theme}
|
|
93
|
+
onChange={(_, v) => v && setTheme(v)}
|
|
94
|
+
>
|
|
95
|
+
{options.map((o) => (
|
|
96
|
+
<ToggleButton key={o} value={o}>{o}</ToggleButton>
|
|
97
|
+
))}
|
|
98
|
+
</ToggleButtonGroup>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Dark Mode Control
|
|
104
|
+
Use `useThemeSettings()` to read and set dark mode. Modes: `light | dark | system | auto`.
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
import { useThemeSettings, darkModeOptions } from '@atomazing-org/design-system';
|
|
108
|
+
import { RadioGroup, FormControlLabel, Radio } from '@mui/material';
|
|
109
|
+
|
|
110
|
+
export function DarkModeSelector() {
|
|
111
|
+
const { darkMode, setDarkMode } = useThemeSettings();
|
|
112
|
+
const options = darkModeOptions; // label + icon
|
|
113
|
+
|
|
114
|
+
return (
|
|
115
|
+
<RadioGroup
|
|
116
|
+
row
|
|
117
|
+
value={darkMode}
|
|
118
|
+
onChange={(e) => setDarkMode(e.target.value as any)}
|
|
119
|
+
>
|
|
120
|
+
{options.map((o) => (
|
|
121
|
+
<FormControlLabel key={o.value} value={o.value} control={<Radio />} label={o.label} />
|
|
122
|
+
))}
|
|
123
|
+
</RadioGroup>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Extended Palette (4 variants)
|
|
129
|
+
The design system adds four typed colors to the MUI palette, available on common components via the `color` prop:
|
|
130
|
+
|
|
131
|
+
- brand: project brand color (uses the active theme `primary`).
|
|
132
|
+
- neutral: neutral/gray scale color (from the design-system palette).
|
|
133
|
+
- accent: supporting accent color (from palette `accent`).
|
|
134
|
+
- muted: soft/desaturated color (based on neutral by default).
|
|
135
|
+
|
|
136
|
+
Supported components: `Button`, `Chip`, `Badge`, `Alert`.
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
import { Button, Chip, Alert } from '@mui/material';
|
|
140
|
+
|
|
141
|
+
<Button color="brand" variant="contained">Brand</Button>
|
|
142
|
+
<Button color="neutral" variant="outlined">Neutral</Button>
|
|
143
|
+
<Chip color="accent" label="Accent" />
|
|
144
|
+
<Alert color="muted" variant="filled">Muted Alert</Alert>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Palette Overrides
|
|
148
|
+
Override base palette tokens for the whole app.
|
|
149
|
+
|
|
150
|
+
```tsx
|
|
151
|
+
<ThemeProviderWrapper
|
|
152
|
+
colorPaletteOverride={{
|
|
153
|
+
brand: '#4F46E5',
|
|
154
|
+
accent: '#F59E0B',
|
|
155
|
+
muted: '#94A3B8',
|
|
156
|
+
neutral: '#64748B',
|
|
157
|
+
success: '#16A34A',
|
|
158
|
+
warning: '#D97706',
|
|
159
|
+
error: '#DC2626',
|
|
160
|
+
info: '#0284C7',
|
|
161
|
+
}}
|
|
162
|
+
>
|
|
163
|
+
{/* ... */}
|
|
164
|
+
</ThemeProviderWrapper>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Using Palette In SX
|
|
168
|
+
```tsx
|
|
169
|
+
import { Box } from '@mui/material';
|
|
170
|
+
|
|
171
|
+
<Box sx={{ bgcolor: (t) => t.palette.accent.main, color: (t) => t.palette.getContrastText(t.palette.accent.main) }}>
|
|
172
|
+
Accent surface
|
|
173
|
+
</Box>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Typography Variants
|
|
177
|
+
Extra variants are available (mapping to `<p>`/headers). Examples:
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
import { Typography } from '@mui/material';
|
|
181
|
+
|
|
182
|
+
<Typography variant="text_md_regular">Body text</Typography>
|
|
183
|
+
<Typography variant="text_sm_bold">Strong caption</Typography>
|
|
184
|
+
<Typography variant="header_lg_bold">Section Title</Typography>
|
|
185
|
+
<Typography variant="header_md_semibold">Semibold Heading</Typography>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Global Styles
|
|
189
|
+
`ThemeProviderWrapper` injects global styles via Emotion. You can also set a custom font family:
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
<ThemeProviderWrapper fontFamily="Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif">
|
|
193
|
+
{/* ... */}
|
|
194
|
+
</ThemeProviderWrapper>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Animations
|
|
198
|
+
Keyframes ready for use in Emotion/MUI `sx`:
|
|
199
|
+
|
|
200
|
+
```tsx
|
|
201
|
+
import { keyframes } from '@emotion/react';
|
|
202
|
+
import { fadeIn, slideIn, scale, pulseAnimation, progressPulse } from '@atomazing-org/design-system';
|
|
203
|
+
import styled from '@emotion/styled';
|
|
204
|
+
|
|
205
|
+
const Card = styled.div`
|
|
206
|
+
animation: ${fadeIn} 300ms ease-in both;
|
|
207
|
+
`;
|
|
208
|
+
|
|
209
|
+
const Glowing = styled.div`
|
|
210
|
+
animation: ${progressPulse('#9FA9EA')} 2s ease-in-out infinite;
|
|
211
|
+
`;
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Components
|
|
215
|
+
- ErrorBoundary
|
|
216
|
+
```tsx
|
|
217
|
+
import { ErrorBoundary } from '@atomazing-org/design-system';
|
|
218
|
+
|
|
219
|
+
<ErrorBoundary>
|
|
220
|
+
<App />
|
|
221
|
+
</ErrorBoundary>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
- Loading
|
|
225
|
+
```tsx
|
|
226
|
+
import { Loading } from '@atomazing-org/design-system';
|
|
227
|
+
|
|
228
|
+
<Loading />
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
- PathName / DialogBtn
|
|
232
|
+
```tsx
|
|
233
|
+
import { PathName, DialogBtn } from '@atomazing-org/design-system';
|
|
234
|
+
|
|
235
|
+
<PathName>/settings/profile</PathName>
|
|
236
|
+
<DialogBtn variant="contained" color="brand">OK</DialogBtn>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Utilities
|
|
240
|
+
```tsx
|
|
241
|
+
import {
|
|
242
|
+
getFontColor, isFontLight, isHexColor,
|
|
243
|
+
timeAgo, timeAgoFromStart,
|
|
244
|
+
useResponsiveDisplay, useSystemTheme,
|
|
245
|
+
displayGreeting, getDayIdentifier,
|
|
246
|
+
systemInfo,
|
|
247
|
+
} from '@atomazing-org/design-system';
|
|
248
|
+
|
|
249
|
+
// Colors
|
|
250
|
+
getFontColor('#ffffff'); // '#101727' | '#f0f0f0'
|
|
251
|
+
isFontLight('#222');
|
|
252
|
+
isHexColor('#abc');
|
|
253
|
+
|
|
254
|
+
// Time
|
|
255
|
+
timeAgo(new Date(Date.now() - 3600_000));
|
|
256
|
+
timeAgoFromStart(new Date(Date.now() + 90_000));
|
|
257
|
+
|
|
258
|
+
// Device
|
|
259
|
+
const isMobile = useResponsiveDisplay(768);
|
|
260
|
+
const sysTheme = useSystemTheme(); // 'light' | 'dark' | 'unknown'
|
|
261
|
+
|
|
262
|
+
// Misc
|
|
263
|
+
displayGreeting(); // Good morning / afternoon / evening
|
|
264
|
+
getDayIdentifier(new Date()); // 'YYYY-MM-DD'
|
|
265
|
+
console.log(systemInfo.os, systemInfo.browser);
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
SSR Notes
|
|
269
|
+
- The library guards `localStorage`/`navigator`. Use normally in SSR apps; hydration updates settings on client.
|
|
270
|
+
- For Next.js, place the provider in a client boundary (e.g., `layout.tsx` with `"use client"`).
|
|
271
|
+
|
|
272
|
+
Peer Dependencies
|
|
273
|
+
- `@mui/material` ^7
|
|
274
|
+
- `@mui/icons-material` ^7
|
|
275
|
+
- `@emotion/react` ^11
|
|
276
|
+
- `@emotion/styled` ^11
|
|
277
|
+
- `@emotion/css` ^11 (optional)
|
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import * as React$1 from 'react';
|
|
|
4
4
|
import React__default, { ErrorInfo, ReactNode, FC, PropsWithChildren } from 'react';
|
|
5
5
|
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
6
6
|
import * as _mui_material from '@mui/material';
|
|
7
|
-
import { Theme, PaletteMode } from '@mui/material';
|
|
7
|
+
import { ThemeOptions, Theme, PaletteMode } from '@mui/material';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
declare const DialogBtn: _emotion_styled.StyledComponent<_mui_material.ButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<React$1.DetailedHTMLProps<React$1.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style" | "className" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "href" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loading" | "loadingIndicator" | "loadingPosition" | "size" | "startIcon" | "variant"> & {
|
|
@@ -259,6 +259,12 @@ type ThemeProviderWrapperProps = PropsWithChildren<{
|
|
|
259
259
|
}[];
|
|
260
260
|
/** Optional color palette override (e.g., fontLight/fontDark/accent colors). */
|
|
261
261
|
colorPaletteOverride?: Partial<ColorPaletteType>;
|
|
262
|
+
/**
|
|
263
|
+
* Optional MUI theme overrides to customize design system styles.
|
|
264
|
+
* Allows external consumers to override any part of the theme (components, palette, typography, etc.).
|
|
265
|
+
* Applied after the design system theme, so it takes precedence.
|
|
266
|
+
*/
|
|
267
|
+
themeOverrides?: ThemeOptions;
|
|
262
268
|
}>;
|
|
263
269
|
declare const ThemeProviderWrapper: FC<ThemeProviderWrapperProps>;
|
|
264
270
|
|
|
@@ -271,7 +277,7 @@ declare const commonComponentProps: Theme["components"];
|
|
|
271
277
|
declare const createCustomTheme: (primaryColor: string, mode?: PaletteMode, secondaryColor?: string, background?: {
|
|
272
278
|
default?: string;
|
|
273
279
|
paper?: string;
|
|
274
|
-
}) => Theme;
|
|
280
|
+
}, themeOverrides?: ThemeOptions) => Theme;
|
|
275
281
|
|
|
276
282
|
/**
|
|
277
283
|
* Injects global styles into the document using Emotion.
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as React$1 from 'react';
|
|
|
4
4
|
import React__default, { ErrorInfo, ReactNode, FC, PropsWithChildren } from 'react';
|
|
5
5
|
import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
|
|
6
6
|
import * as _mui_material from '@mui/material';
|
|
7
|
-
import { Theme, PaletteMode } from '@mui/material';
|
|
7
|
+
import { ThemeOptions, Theme, PaletteMode } from '@mui/material';
|
|
8
8
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
declare const DialogBtn: _emotion_styled.StyledComponent<_mui_material.ButtonOwnProps & Omit<_mui_material.ButtonBaseOwnProps, "classes"> & _mui_material_OverridableComponent.CommonProps & Omit<React$1.DetailedHTMLProps<React$1.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style" | "className" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "href" | "color" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "loading" | "loadingIndicator" | "loadingPosition" | "size" | "startIcon" | "variant"> & {
|
|
@@ -259,6 +259,12 @@ type ThemeProviderWrapperProps = PropsWithChildren<{
|
|
|
259
259
|
}[];
|
|
260
260
|
/** Optional color palette override (e.g., fontLight/fontDark/accent colors). */
|
|
261
261
|
colorPaletteOverride?: Partial<ColorPaletteType>;
|
|
262
|
+
/**
|
|
263
|
+
* Optional MUI theme overrides to customize design system styles.
|
|
264
|
+
* Allows external consumers to override any part of the theme (components, palette, typography, etc.).
|
|
265
|
+
* Applied after the design system theme, so it takes precedence.
|
|
266
|
+
*/
|
|
267
|
+
themeOverrides?: ThemeOptions;
|
|
262
268
|
}>;
|
|
263
269
|
declare const ThemeProviderWrapper: FC<ThemeProviderWrapperProps>;
|
|
264
270
|
|
|
@@ -271,7 +277,7 @@ declare const commonComponentProps: Theme["components"];
|
|
|
271
277
|
declare const createCustomTheme: (primaryColor: string, mode?: PaletteMode, secondaryColor?: string, background?: {
|
|
272
278
|
default?: string;
|
|
273
279
|
paper?: string;
|
|
274
|
-
}) => Theme;
|
|
280
|
+
}, themeOverrides?: ThemeOptions) => Theme;
|
|
275
281
|
|
|
276
282
|
/**
|
|
277
283
|
* Injects global styles into the document using Emotion.
|