@atomazing-org/design-system 1.0.63 → 1.0.65
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 +199 -13
- package/dist/index.d.mts +8 -19
- package/dist/index.d.ts +8 -19
- package/dist/index.js +27 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,8 +6,18 @@ Contents
|
|
|
6
6
|
- Introduction
|
|
7
7
|
- Installation
|
|
8
8
|
- Quick Start
|
|
9
|
+
- Provider Props
|
|
10
|
+
- Dynamic Themes (array)
|
|
11
|
+
- Theme Switching (UI)
|
|
12
|
+
- Dark Mode Control
|
|
9
13
|
- Extended Palette (4 variants)
|
|
10
|
-
-
|
|
14
|
+
- Palette Overrides
|
|
15
|
+
- Using Palette In SX
|
|
16
|
+
- Typography Variants
|
|
17
|
+
- Global Styles
|
|
18
|
+
- Animations
|
|
19
|
+
- Components
|
|
20
|
+
- Utilities
|
|
11
21
|
- SSR Notes
|
|
12
22
|
- Peer Dependencies
|
|
13
23
|
|
|
@@ -33,17 +43,90 @@ export function App() {
|
|
|
33
43
|
}
|
|
34
44
|
```
|
|
35
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
|
+
{ name: 'Green', primaryColor: '#22C55E', secondaryColor: '#F6F9F6' },
|
|
61
|
+
{ name: 'Gray', primaryColor: '#64748B' },
|
|
62
|
+
]}
|
|
63
|
+
>
|
|
64
|
+
{/* ... */}
|
|
65
|
+
</ThemeProviderWrapper>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Theme Switching (UI)
|
|
69
|
+
Use the theme context to read and change the active theme.
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { useThemeSettings } from '@atomazing-org/design-system';
|
|
73
|
+
import { ToggleButton, ToggleButtonGroup } from '@mui/material';
|
|
74
|
+
|
|
75
|
+
export function ThemeToggle() {
|
|
76
|
+
const { theme, setTheme } = useThemeSettings();
|
|
77
|
+
const options = ['Blue', 'Green', 'Gray'];
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<ToggleButtonGroup
|
|
81
|
+
size="small"
|
|
82
|
+
exclusive
|
|
83
|
+
color="brand"
|
|
84
|
+
value={theme}
|
|
85
|
+
onChange={(_, v) => v && setTheme(v)}
|
|
86
|
+
>
|
|
87
|
+
{options.map((o) => (
|
|
88
|
+
<ToggleButton key={o} value={o}>{o}</ToggleButton>
|
|
89
|
+
))}
|
|
90
|
+
</ToggleButtonGroup>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Dark Mode Control
|
|
96
|
+
Use `useThemeSettings()` to read and set dark mode. Modes: `light | dark | system | auto`.
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
import { useThemeSettings, darkModeOptions } from '@atomazing-org/design-system';
|
|
100
|
+
import { RadioGroup, FormControlLabel, Radio } from '@mui/material';
|
|
101
|
+
|
|
102
|
+
export function DarkModeSelector() {
|
|
103
|
+
const { darkMode, setDarkMode } = useThemeSettings();
|
|
104
|
+
const options = darkModeOptions; // label + icon
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<RadioGroup
|
|
108
|
+
row
|
|
109
|
+
value={darkMode}
|
|
110
|
+
onChange={(e) => setDarkMode(e.target.value as any)}
|
|
111
|
+
>
|
|
112
|
+
{options.map((o) => (
|
|
113
|
+
<FormControlLabel key={o.value} value={o.value} control={<Radio />} label={o.label} />
|
|
114
|
+
))}
|
|
115
|
+
</RadioGroup>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
36
120
|
Extended Palette (4 variants)
|
|
37
121
|
The design system adds four typed colors to the MUI palette, available on common components via the `color` prop:
|
|
38
122
|
|
|
39
|
-
- brand: project brand color (
|
|
123
|
+
- brand: project brand color (uses the active theme `primary`).
|
|
40
124
|
- neutral: neutral/gray scale color (from the design-system palette).
|
|
41
125
|
- accent: supporting accent color (from palette `accent`).
|
|
42
126
|
- muted: soft/desaturated color (based on neutral by default).
|
|
43
127
|
|
|
44
|
-
Supported components
|
|
128
|
+
Supported components: `Button`, `Chip`, `Badge`, `Alert`.
|
|
45
129
|
|
|
46
|
-
Examples
|
|
47
130
|
```tsx
|
|
48
131
|
import { Button, Chip, Alert } from '@mui/material';
|
|
49
132
|
|
|
@@ -53,26 +136,129 @@ import { Button, Chip, Alert } from '@mui/material';
|
|
|
53
136
|
<Alert color="muted" variant="filled">Muted Alert</Alert>
|
|
54
137
|
```
|
|
55
138
|
|
|
56
|
-
|
|
57
|
-
|
|
139
|
+
Palette Overrides
|
|
140
|
+
Override base palette tokens for the whole app.
|
|
58
141
|
|
|
59
142
|
```tsx
|
|
60
|
-
<ThemeProviderWrapper
|
|
143
|
+
<ThemeProviderWrapper
|
|
144
|
+
colorPaletteOverride={{
|
|
145
|
+
brand: '#4F46E5',
|
|
146
|
+
accent: '#F59E0B',
|
|
147
|
+
muted: '#94A3B8',
|
|
148
|
+
neutral: '#64748B',
|
|
149
|
+
success: '#16A34A',
|
|
150
|
+
warning: '#D97706',
|
|
151
|
+
error: '#DC2626',
|
|
152
|
+
info: '#0284C7',
|
|
153
|
+
}}
|
|
154
|
+
>
|
|
61
155
|
{/* ... */}
|
|
62
156
|
</ThemeProviderWrapper>
|
|
157
|
+
```
|
|
63
158
|
|
|
64
|
-
|
|
159
|
+
Using Palette In SX
|
|
160
|
+
```tsx
|
|
65
161
|
import { Box } from '@mui/material';
|
|
66
162
|
|
|
67
|
-
<Box sx={{ bgcolor: (t) => t.palette.
|
|
163
|
+
<Box sx={{ bgcolor: (t) => t.palette.accent.main, color: (t) => t.palette.getContrastText(t.palette.accent.main) }}>
|
|
164
|
+
Accent surface
|
|
165
|
+
</Box>
|
|
68
166
|
```
|
|
69
167
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
168
|
+
Typography Variants
|
|
169
|
+
Extra variants are available (mapping to `<p>`/headers). Examples:
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
import { Typography } from '@mui/material';
|
|
173
|
+
|
|
174
|
+
<Typography variant="text_md_regular">Body text</Typography>
|
|
175
|
+
<Typography variant="text_sm_bold">Strong caption</Typography>
|
|
176
|
+
<Typography variant="header_lg_bold">Section Title</Typography>
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Global Styles
|
|
180
|
+
`ThemeProviderWrapper` injects global styles via Emotion. You can also set a custom font family:
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
<ThemeProviderWrapper fontFamily="Inter, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif">
|
|
184
|
+
{/* ... */}
|
|
185
|
+
</ThemeProviderWrapper>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Animations
|
|
189
|
+
Keyframes ready for use in Emotion/MUI `sx`:
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
import { keyframes } from '@emotion/react';
|
|
193
|
+
import { fadeIn, slideIn, scale, pulseAnimation, progressPulse } from '@atomazing-org/design-system';
|
|
194
|
+
import styled from '@emotion/styled';
|
|
195
|
+
|
|
196
|
+
const Card = styled.div`
|
|
197
|
+
animation: ${fadeIn} 300ms ease-in both;
|
|
198
|
+
`;
|
|
199
|
+
|
|
200
|
+
const Glowing = styled.div`
|
|
201
|
+
animation: ${progressPulse('#9FA9EA')} 2s ease-in-out infinite;
|
|
202
|
+
`;
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Components
|
|
206
|
+
- ErrorBoundary
|
|
207
|
+
```tsx
|
|
208
|
+
import { ErrorBoundary } from '@atomazing-org/design-system';
|
|
209
|
+
|
|
210
|
+
<ErrorBoundary>
|
|
211
|
+
<App />
|
|
212
|
+
</ErrorBoundary>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
- Loading
|
|
216
|
+
```tsx
|
|
217
|
+
import { Loading } from '@atomazing-org/design-system';
|
|
218
|
+
|
|
219
|
+
<Loading />
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
- PathName / DialogBtn
|
|
223
|
+
```tsx
|
|
224
|
+
import { PathName, DialogBtn } from '@atomazing-org/design-system';
|
|
225
|
+
|
|
226
|
+
<PathName>/settings/profile</PathName>
|
|
227
|
+
<DialogBtn variant="contained" color="brand">OK</DialogBtn>
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Utilities
|
|
231
|
+
```tsx
|
|
232
|
+
import {
|
|
233
|
+
getFontColor, isFontLight, isHexColor,
|
|
234
|
+
timeAgo, timeAgoFromStart,
|
|
235
|
+
useResponsiveDisplay, useSystemTheme,
|
|
236
|
+
displayGreeting, getDayIdentifier,
|
|
237
|
+
systemInfo,
|
|
238
|
+
} from '@atomazing-org/design-system';
|
|
239
|
+
|
|
240
|
+
// Colors
|
|
241
|
+
getFontColor('#ffffff'); // '#101727' | '#f0f0f0'
|
|
242
|
+
isFontLight('#222');
|
|
243
|
+
isHexColor('#abc');
|
|
244
|
+
|
|
245
|
+
// Time
|
|
246
|
+
timeAgo(new Date(Date.now() - 3600_000));
|
|
247
|
+
timeAgoFromStart(new Date(Date.now() + 90_000));
|
|
248
|
+
|
|
249
|
+
// Device
|
|
250
|
+
const isMobile = useResponsiveDisplay(768);
|
|
251
|
+
const sysTheme = useSystemTheme(); // 'light' | 'dark' | 'unknown'
|
|
252
|
+
|
|
253
|
+
// Misc
|
|
254
|
+
displayGreeting(); // Good morning / afternoon / evening
|
|
255
|
+
getDayIdentifier(new Date()); // 'YYYY-MM-DD'
|
|
256
|
+
console.log(systemInfo.os, systemInfo.browser);
|
|
257
|
+
```
|
|
73
258
|
|
|
74
259
|
SSR Notes
|
|
75
|
-
- The library guards `localStorage`/`navigator
|
|
260
|
+
- The library guards `localStorage`/`navigator`. Use normally in SSR apps; hydration updates settings on client.
|
|
261
|
+
- For Next.js, place the provider in a client boundary (e.g., `layout.tsx` with `"use client"`).
|
|
76
262
|
|
|
77
263
|
Peer Dependencies
|
|
78
264
|
- `@mui/material` ^7
|
package/dist/index.d.mts
CHANGED
|
@@ -220,17 +220,17 @@ declare const useThemeSettings: () => ThemeContextProps;
|
|
|
220
220
|
type ThemeProviderWrapperProps = PropsWithChildren<{
|
|
221
221
|
/** Optional font stack to apply across the app. */
|
|
222
222
|
fontFamily?: string;
|
|
223
|
-
/**
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Optional dynamic list of themes.
|
|
225
|
+
* Takes precedence over static defaults when provided.
|
|
226
|
+
*/
|
|
227
|
+
themes?: {
|
|
228
|
+
name: string;
|
|
227
229
|
primaryColor: string;
|
|
228
230
|
secondaryColor?: string;
|
|
229
|
-
}
|
|
231
|
+
}[];
|
|
230
232
|
/** Optional color palette override (e.g., fontLight/fontDark/accent colors). */
|
|
231
233
|
colorPaletteOverride?: Partial<ColorPaletteType>;
|
|
232
|
-
/** Optional registry of ad-hoc colors to inject into theme.palette.custom */
|
|
233
|
-
customColors?: Record<string, string>;
|
|
234
234
|
}>;
|
|
235
235
|
declare const ThemeProviderWrapper: FC<ThemeProviderWrapperProps>;
|
|
236
236
|
|
|
@@ -241,13 +241,6 @@ declare const ThemeProviderWrapper: FC<ThemeProviderWrapperProps>;
|
|
|
241
241
|
declare const commonComponentProps: Theme["components"];
|
|
242
242
|
|
|
243
243
|
declare const createCustomTheme: (primaryColor: string, mode?: PaletteMode, secondaryColor?: string) => Theme;
|
|
244
|
-
/**
|
|
245
|
-
* A predefined list of named themes based on the `themeConfig` definition.
|
|
246
|
-
*/
|
|
247
|
-
declare const themes: {
|
|
248
|
-
name: string;
|
|
249
|
-
MuiTheme: Theme;
|
|
250
|
-
}[];
|
|
251
244
|
|
|
252
245
|
/**
|
|
253
246
|
* Injects global styles into the document using Emotion.
|
|
@@ -360,10 +353,6 @@ declare const getColorPalette: () => ColorPaletteType;
|
|
|
360
353
|
* Pass `undefined` or empty to reset to defaults.
|
|
361
354
|
*/
|
|
362
355
|
declare const setColorPaletteOverride: (override?: Partial<ColorPaletteType>) => void;
|
|
363
|
-
declare const themeConfig: Record<string, {
|
|
364
|
-
primaryColor: string;
|
|
365
|
-
secondaryColor?: string;
|
|
366
|
-
}>;
|
|
367
356
|
/** Backward-compatible live view of the active palette. */
|
|
368
357
|
declare const ColorPalette: Readonly<ColorPaletteType>;
|
|
369
358
|
|
|
@@ -453,4 +442,4 @@ declare const useResponsiveDisplay: (breakpoint?: number) => boolean;
|
|
|
453
442
|
*/
|
|
454
443
|
declare const useSystemTheme: () => SystemTheme;
|
|
455
444
|
|
|
456
|
-
export { type AppSettings, ColorPalette, type ColorPaletteType, type CustomTypographyVariants, type DarkModeOptions, DialogBtn, ErrorBoundary, GlobalStyles, Loading, type OptionItem, PathName, type SystemTheme, type ThemeContextProps, ThemeProviderWrapper, commonComponentProps, createCustomTheme, darkModeOptions, defaultColorPalette, displayGreeting, fadeIn, fadeInLeft, getColorPalette, getDayIdentifier, getFontColor, installAppAnimation, isDarkMode, isFontLight, isHexColor, logoutAnimation, progressPulse, pulseAnimation, scale, setColorPaletteOverride, slideIn, slideInBottom, systemInfo,
|
|
445
|
+
export { type AppSettings, ColorPalette, type ColorPaletteType, type CustomTypographyVariants, type DarkModeOptions, DialogBtn, ErrorBoundary, GlobalStyles, Loading, type OptionItem, PathName, type SystemTheme, type ThemeContextProps, ThemeProviderWrapper, commonComponentProps, createCustomTheme, darkModeOptions, defaultColorPalette, displayGreeting, fadeIn, fadeInLeft, getColorPalette, getDayIdentifier, getFontColor, installAppAnimation, isDarkMode, isFontLight, isHexColor, logoutAnimation, progressPulse, pulseAnimation, scale, setColorPaletteOverride, slideIn, slideInBottom, systemInfo, timeAgo, timeAgoFromStart, useResponsiveDisplay, useSystemTheme, useThemeSettings };
|
package/dist/index.d.ts
CHANGED
|
@@ -220,17 +220,17 @@ declare const useThemeSettings: () => ThemeContextProps;
|
|
|
220
220
|
type ThemeProviderWrapperProps = PropsWithChildren<{
|
|
221
221
|
/** Optional font stack to apply across the app. */
|
|
222
222
|
fontFamily?: string;
|
|
223
|
-
/**
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Optional dynamic list of themes.
|
|
225
|
+
* Takes precedence over static defaults when provided.
|
|
226
|
+
*/
|
|
227
|
+
themes?: {
|
|
228
|
+
name: string;
|
|
227
229
|
primaryColor: string;
|
|
228
230
|
secondaryColor?: string;
|
|
229
|
-
}
|
|
231
|
+
}[];
|
|
230
232
|
/** Optional color palette override (e.g., fontLight/fontDark/accent colors). */
|
|
231
233
|
colorPaletteOverride?: Partial<ColorPaletteType>;
|
|
232
|
-
/** Optional registry of ad-hoc colors to inject into theme.palette.custom */
|
|
233
|
-
customColors?: Record<string, string>;
|
|
234
234
|
}>;
|
|
235
235
|
declare const ThemeProviderWrapper: FC<ThemeProviderWrapperProps>;
|
|
236
236
|
|
|
@@ -241,13 +241,6 @@ declare const ThemeProviderWrapper: FC<ThemeProviderWrapperProps>;
|
|
|
241
241
|
declare const commonComponentProps: Theme["components"];
|
|
242
242
|
|
|
243
243
|
declare const createCustomTheme: (primaryColor: string, mode?: PaletteMode, secondaryColor?: string) => Theme;
|
|
244
|
-
/**
|
|
245
|
-
* A predefined list of named themes based on the `themeConfig` definition.
|
|
246
|
-
*/
|
|
247
|
-
declare const themes: {
|
|
248
|
-
name: string;
|
|
249
|
-
MuiTheme: Theme;
|
|
250
|
-
}[];
|
|
251
244
|
|
|
252
245
|
/**
|
|
253
246
|
* Injects global styles into the document using Emotion.
|
|
@@ -360,10 +353,6 @@ declare const getColorPalette: () => ColorPaletteType;
|
|
|
360
353
|
* Pass `undefined` or empty to reset to defaults.
|
|
361
354
|
*/
|
|
362
355
|
declare const setColorPaletteOverride: (override?: Partial<ColorPaletteType>) => void;
|
|
363
|
-
declare const themeConfig: Record<string, {
|
|
364
|
-
primaryColor: string;
|
|
365
|
-
secondaryColor?: string;
|
|
366
|
-
}>;
|
|
367
356
|
/** Backward-compatible live view of the active palette. */
|
|
368
357
|
declare const ColorPalette: Readonly<ColorPaletteType>;
|
|
369
358
|
|
|
@@ -453,4 +442,4 @@ declare const useResponsiveDisplay: (breakpoint?: number) => boolean;
|
|
|
453
442
|
*/
|
|
454
443
|
declare const useSystemTheme: () => SystemTheme;
|
|
455
444
|
|
|
456
|
-
export { type AppSettings, ColorPalette, type ColorPaletteType, type CustomTypographyVariants, type DarkModeOptions, DialogBtn, ErrorBoundary, GlobalStyles, Loading, type OptionItem, PathName, type SystemTheme, type ThemeContextProps, ThemeProviderWrapper, commonComponentProps, createCustomTheme, darkModeOptions, defaultColorPalette, displayGreeting, fadeIn, fadeInLeft, getColorPalette, getDayIdentifier, getFontColor, installAppAnimation, isDarkMode, isFontLight, isHexColor, logoutAnimation, progressPulse, pulseAnimation, scale, setColorPaletteOverride, slideIn, slideInBottom, systemInfo,
|
|
445
|
+
export { type AppSettings, ColorPalette, type ColorPaletteType, type CustomTypographyVariants, type DarkModeOptions, DialogBtn, ErrorBoundary, GlobalStyles, Loading, type OptionItem, PathName, type SystemTheme, type ThemeContextProps, ThemeProviderWrapper, commonComponentProps, createCustomTheme, darkModeOptions, defaultColorPalette, displayGreeting, fadeIn, fadeInLeft, getColorPalette, getDayIdentifier, getFontColor, installAppAnimation, isDarkMode, isFontLight, isHexColor, logoutAnimation, progressPulse, pulseAnimation, scale, setColorPaletteOverride, slideIn, slideInBottom, systemInfo, timeAgo, timeAgoFromStart, useResponsiveDisplay, useSystemTheme, useThemeSettings };
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Ae=Object.create;var M=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var We=(e,t)=>{for(var o in t)M(e,o,{get:t[o],enumerable:!0})},X=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $e(t))!ze.call(e,r)&&r!==o&&M(e,r,{get:()=>t[r],enumerable:!(n=Le(t,r))||n.enumerable});return e};var f=(e,t,o)=>(o=e!=null?Ae(Be(e)):{},X(t||!e||!e.__esModule?M(o,"default",{value:e,enumerable:!0}):o,e)),Ge=e=>X(M({},"__esModule",{value:!0}),e);var Xe={};We(Xe,{ColorPalette:()=>le,DialogBtn:()=>j,ErrorBoundary:()=>P,GlobalStyles:()=>W,Loading:()=>K,PathName:()=>te,ThemeProviderWrapper:()=>Fe,commonComponentProps:()=>I,createCustomTheme:()=>v,darkModeOptions:()=>ae,defaultColorPalette:()=>C,displayGreeting:()=>ue,fadeIn:()=>ke,fadeInLeft:()=>ve,getColorPalette:()=>s,getDayIdentifier:()=>ce,getFontColor:()=>S,installAppAnimation:()=>Re,isDarkMode:()=>A,isFontLight:()=>me,isHexColor:()=>Y,logoutAnimation:()=>Pe,progressPulse:()=>Me,pulseAnimation:()=>Se,scale:()=>Ce,setColorPaletteOverride:()=>E,slideIn:()=>we,slideInBottom:()=>Te,systemInfo:()=>fe,timeAgo:()=>he,timeAgoFromStart:()=>xe,useResponsiveDisplay:()=>ge,useSystemTheme:()=>B,useThemeSettings:()=>se});module.exports=Ge(Xe);var J=f(require("@emotion/styled")),Q=require("@mui/material"),j=(0,J.default)(Q.Button)`
|
|
2
2
|
padding: 10px 16px;
|
|
3
3
|
border-radius: 16px;
|
|
4
4
|
font-size: 16px;
|
|
5
5
|
margin: 8px;
|
|
6
|
-
`;var
|
|
6
|
+
`;var Z=f(require("react")),N=f(require("@emotion/styled")),G=f(require("@mui/icons-material/ErrorOutlineRounded")),_=require("@mui/material"),m=require("react/jsx-runtime"),P=class extends Z.default.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,o){console.error("Error:",t),console.error("Error Info:",o)}render(){var n,r,i;let{state:t,props:o}=this;return t.hasError?(0,m.jsxs)(Ne,{children:[(0,m.jsx)(Ue,{children:(0,m.jsx)(_.Box,{children:"Something went wrong.\xA0"})}),(0,m.jsxs)("h3",{children:[(0,m.jsxs)(_.Box,{style:{color:"#ff3131",display:"inline-block"},children:[(0,m.jsx)(G.default,{sx:{verticalAlign:"middle",mb:"4px"}})," ","ERROR:"]})," ",(0,m.jsxs)(_.Box,{translate:"no",children:["[",(n=t.error)==null?void 0:n.name,"] ",(r=t.error)==null?void 0:r.message]}),(0,m.jsxs)(_.Box,{style:{color:"#ff3131",display:"inline-block"},children:[(0,m.jsx)(G.default,{sx:{verticalAlign:"middle",mb:"4px"}})," ","Stack:"]})," ",(0,m.jsxs)(_.Box,{translate:"no",children:["[",(i=t.error)==null?void 0:i.stack,"]"]})]})]}):o.children}},Ne=N.default.div`
|
|
7
7
|
margin: 0 8vw;
|
|
8
8
|
@media (max-width: 768px) {
|
|
9
9
|
margin: 0;
|
|
10
10
|
}
|
|
11
|
-
`,
|
|
11
|
+
`,Ue=N.default.h1`
|
|
12
12
|
margin-top: 32px;
|
|
13
13
|
margin-bottom: 32px;
|
|
14
14
|
font-size: 36px;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
margin-top: 0;
|
|
25
25
|
margin-bottom: 0;
|
|
26
26
|
}
|
|
27
|
-
`;var
|
|
27
|
+
`;var R=require("react"),q=f(require("@emotion/styled")),D=require("@mui/material"),g=require("react/jsx-runtime"),K=()=>{let[e,t]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{let o=setTimeout(()=>{t(!0)},100);return()=>clearTimeout(o)},[]),(0,g.jsx)(He,{"aria-live":"polite",role:"status",children:e&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(D.CircularProgress,{"aria-label":"loading",size:80,thickness:4}),(0,g.jsx)("h3",{style:{opacity:.8},children:"Loading Page..."})]})})},He=(0,q.default)(D.Box)`
|
|
28
28
|
position: absolute;
|
|
29
29
|
top: 50%;
|
|
30
30
|
left: 50%;
|
|
@@ -35,26 +35,28 @@
|
|
|
35
35
|
flex-direction: column;
|
|
36
36
|
text-align: center;
|
|
37
37
|
gap: 8px;
|
|
38
|
-
`;var
|
|
38
|
+
`;var ee=f(require("@emotion/styled")),te=ee.default.code`
|
|
39
39
|
background: #000000c8;
|
|
40
40
|
color: white;
|
|
41
41
|
padding: 4px 6px;
|
|
42
42
|
border-radius: 8px;
|
|
43
|
-
`;var se=f(require("@mui/icons-material/BrightnessAutoRounded")),le=f(require("@mui/icons-material/DarkModeRounded")),pe=f(require("@mui/icons-material/LightModeRounded")),me=f(require("@mui/icons-material/PersonalVideoRounded")),k=require("react/jsx-runtime"),E=32,de=[{label:"Auto",value:"auto",icon:(0,k.jsx)(se.default,{color:"inherit",sx:{fontSize:E}})},{label:"System",value:"system",icon:(0,k.jsx)(me.default,{color:"inherit",sx:{fontSize:E}})},{label:"Light",value:"light",icon:(0,k.jsx)(pe.default,{color:"inherit",sx:{fontSize:E}})},{label:"Dark",value:"dark",icon:(0,k.jsx)(le.default,{color:"inherit",sx:{fontSize:E}})}];var C={fontDark:"#101727",fontLight:"#f0f0f0",brand:"#9FA9EA",accent:"#F3503A",muted:"#64748B",success:"#2E7D32",info:"#0288D1",warning:"#ED6C02",error:"#D32F2F",neutral:"#64748B"};var A=require("react"),J=(0,A.createContext)(void 0),ue=()=>{let e=(0,A.useContext)(J);if(!e)throw new Error("useThemeSettings must be used within ThemeProviderWrapper");return e};var d=require("react"),Ae=require("@emotion/react"),Le=require("@mui/material/styles");var L={MuiTooltip:{defaultProps:{disableInteractive:!0},styleOverrides:{tooltip:({theme:e})=>({backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",padding:"8px 16px",borderRadius:e.shape.borderRadius,fontSize:"12px"})}},MuiButton:{styleOverrides:{root:({theme:e})=>({padding:"12px 24px",borderRadius:e.shape.borderRadius}),contained:{boxShadow:"none"}}},MuiSkeleton:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiSelect:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius}),select:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px"}}},MuiDialog:{defaultProps:{slotProps:{paper:{style:{padding:"12px",borderRadius:24,minWidth:"400px"}}}},styleOverrides:{root:{"& .MuiDialog-container":{backdropFilter:"blur(4px)"}}}},MuiAvatar:{styleOverrides:{root:{fontWeight:500}}},MuiAlert:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiTextField:{defaultProps:{variant:"outlined"},styleOverrides:{root:({theme:e})=>({"& .MuiInputBase-root":{borderRadius:e.shape.borderRadius}})}},MuiOutlinedInput:{styleOverrides:{root:({theme:e})=>({color:e.palette.primary.main,"& fieldset":{borderColor:e.palette.primary.main},"&:hover fieldset":{borderColor:e.palette.primary.dark},"&.Mui-focused fieldset":{borderColor:e.palette.primary.main}})}},MuiInputLabel:{styleOverrides:{root:({theme:e})=>({color:e.palette.primary.main,"&.Mui-focused":{color:e.palette.primary.main}})}},MuiFormHelperText:{styleOverrides:{root:({theme:e})=>({color:e.palette.error.main})}},MuiPaper:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius}),elevation8:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiBottomNavigationAction:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius,padding:"12px",margin:0,maxHeight:"none"})}},MuiDialogContent:{styleOverrides:{root:{padding:0}}},MuiSlider:{styleOverrides:{valueLabel:({theme:e})=>({borderRadius:e.shape.borderRadius,padding:"6px 14px","&::before, &::after":{display:"none"}})}},MuiCircularProgress:{styleOverrides:{circle:{strokeLinecap:"round"}}},MuiTab:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiAccordion:{styleOverrides:{root:{"&::before":{display:"none"}}}}};var Q=require("@mui/material");var c={...C},l=()=>c,$=e=>{c={...C,...e}},B={Main:{primaryColor:"#9FA9EA",secondaryColor:"#f2f2f2"}},ce={get fontDark(){return c.fontDark},get fontLight(){return c.fontLight},get brand(){return c.brand},get accent(){return c.accent},get muted(){return c.muted},get success(){return c.success},get info(){return c.info},get warning(){return c.warning},get error(){return c.error},get neutral(){return c.neutral}};var fe={defaultProps:{variantMapping:{text_xl_regular:"p",text_lg_regular:"p",text_md_regular:"p",text_sm_regular:"p",text_xs_regular:"p",text_2xs_regular:"p",text_xl_bold:"p",text_lg_bold:"p",text_md_bold:"p",text_sm_bold:"p",text_xs_bold:"p",text_2xs_bold:"p",text_xl_semibold:"p",text_lg_semibold:"p",text_md_semibold:"p",text_sm_semibold:"p",text_xs_semibold:"p",text_2xs_semibold:"p",text_xl_thin:"p",text_lg_thin:"p",text_md_thin:"p",text_sm_thin:"p",text_xs_thin:"p",text_2xs_thin:"p",header_2xl_regular:"h1",header_xl_regular:"h2",header_lg_regular:"h3",header_md_regular:"h4",header_sm_regular:"h5",header_xs_regular:"h6",header_2xl_bold:"h1",header_xl_bold:"h2",header_lg_bold:"h3",header_md_bold:"h4",header_sm_bold:"h5",header_xs_bold:"h6"}}},he={text_xl_regular:{font:"400 20px/30px inherit inherit"},text_lg_regular:{font:"400 18px/28px inherit inherit"},text_md_regular:{font:"400 16px/24px inherit inherit"},text_sm_regular:{font:"400 14px/20px inherit inherit"},text_xs_regular:{font:"400 12px/18px inherit inherit"},text_2xs_regular:{font:"400 10px/14px inherit inherit"},text_xl_bold:{font:"700 20px/30px inherit inherit"},text_lg_bold:{font:"700 18px/28px inherit inherit"},text_md_bold:{font:"700 16px/24px inherit inherit"},text_sm_bold:{font:"700 14px/20px inherit inherit"},text_xs_bold:{font:"700 12px/18px inherit inherit"},text_2xs_bold:{font:"700 10px/14px inherit inherit"},text_xl_semibold:{font:"600 20px/30px inherit inherit"},text_lg_semibold:{font:"600 18px/28px inherit inherit"},text_md_semibold:{font:"600 16px/24px inherit inherit"},text_sm_semibold:{font:"600 14px/20px inherit inherit"},text_xs_semibold:{font:"600 12px/18px inherit inherit"},text_2xs_semibold:{font:"600 10px/14px inherit inherit"},text_xl_thin:{font:"100 20px/30px inherit inherit"},text_lg_thin:{font:"100 18px/28px inherit inherit"},text_md_thin:{font:"100 16px/24px inherit inherit"},text_sm_thin:{font:"100 14px/20px inherit inherit"},text_xs_thin:{font:"100 12px/18px inherit inherit"},text_2xs_thin:{font:"100 10px/14px inherit inherit"},header_2xl_regular:{font:"400 48px/60px inherit inherit"},header_xl_regular:{font:"400 42px/54px inherit inherit"},header_lg_regular:{font:"400 36px/46px inherit inherit"},header_md_regular:{font:"400 30px/38px inherit inherit"},header_sm_regular:{font:"400 26px/34px inherit inherit"},header_xs_regular:{font:"400 22px/30px inherit inherit"},header_2xl_bold:{font:"700 48px/60px inherit inherit"},header_xl_bold:{font:"700 42px/54px inherit inherit"},header_lg_bold:{font:"700 36px/46px inherit inherit"},header_md_bold:{font:"700 30px/38px inherit inherit"},header_sm_bold:{font:"700 26px/34px inherit inherit"},header_xs_bold:{font:"700 22px/30px inherit inherit"}};var b=(e,t="light",o)=>{let n=t==="dark",r=(0,Q.createTheme)({palette:{mode:t}});return(0,Q.createTheme)(r,{palette:{primary:{...r.palette.primary,main:e},brand:r.palette.augmentColor({color:{main:l().brand}}),neutral:r.palette.augmentColor({color:{main:l().neutral}}),accent:r.palette.augmentColor({color:{main:l().accent}}),muted:r.palette.augmentColor({color:{main:l().muted}}),...o?{secondary:{...r.palette.secondary,main:o}}:{},error:{...r.palette.error,main:l().error},warning:{...r.palette.warning,main:l().warning},success:{...r.palette.success,main:l().success},info:{...r.palette.info,main:l().info},background:n?{...r.palette.background,default:"#1C1C1E",paper:"#2C2C2E"}:{...r.palette.background,default:"#F2F2F7",paper:"#FFFFFF"},divider:n?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.12)"},components:{...L,MuiTypography:fe},typography:{...he,fontFamily:'var(--app-font-family, "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif)'},shape:{borderRadius:24}})},z=Object.entries(B).map(([e,t])=>({name:e,MuiTheme:b(t.primaryColor,"light",t.secondaryColor)}));var ke=require("react"),H=require("@emotion/react"),Ce=require("@mui/material/styles");var Z=e=>/^#([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$/.test(e),w=e=>{if(!Z(e))return console.error("Invalid hex color provided:",e),l().fontDark;let t=e.slice(1),o=t.length===3?t.split("").map(x=>x+x).join(""):t,n=Number.parseInt(o.slice(0,2),16),r=Number.parseInt(o.slice(2,4),16),i=Number.parseInt(o.slice(4,6),16),p=Math.round((n*299+r*587+i*114)/1e3),a=l();return p>128?a.fontDark:a.fontLight},xe=e=>w(e)===l().fontLight;var ge=()=>{let e=new Date().getHours();return e>=5&&e<12?"Good morning":e>12&&e<18?"Good afternoon":"Good evening"};var ye=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${o}-${n}`};var Ze=()=>{let e=(typeof navigator=="undefined"?"":navigator.userAgent).toLowerCase();return e.includes("windows nt")?"Windows":e.includes("iphone")||e.includes("ipad")||e.includes("ipod")?"iOS":e.includes("mac")?"macOS":e.includes("android")?"Android":e.includes("linux")?"Linux":"Unknown"},qe=()=>{let e=(typeof navigator=="undefined"?"":navigator.userAgent).toLowerCase();return e.includes("edg")?"Edge":e.includes("chrome")?"Chrome":e.includes("firefox")?"Firefox":e.includes("safari")?"Safari":"Unknown"},be={os:typeof navigator=="undefined"?"Unknown":Ze(),browser:typeof navigator=="undefined"?"Unknown":qe()};var W=(e,t)=>{switch(e){case"light":return!1;case"dark":return!0;case"system":return t==="dark";default:return!1}};var _e=(e,t)=>{let o=t!=null?t:typeof navigator=="undefined"?"en-US":navigator.language,n=new Date;e=new Date(e);let r=Math.floor((n.getTime()-e.getTime())/1e3),i=new Intl.RelativeTimeFormat(o,{numeric:"auto"});if(r<60)return i.format(-r,"second");if(r<3600){let a=Math.floor(r/60);return i.format(-a,"minute")}if(r<86400){let a=Math.floor(r/3600);return i.format(-a,"hour")}let p=Math.floor(r/86400);return i.format(-p,"day")},ve=(e,t)=>{let o=t!=null?t:typeof navigator=="undefined"?"en-US":navigator.language,n=new Date;e=new Date(e);let r=(e.getTime()-n.getTime())/1e3,i=Math.floor(r/(60*60)),p=Math.floor((r-60*60*i)/60),a=Math.floor(r-60*60*i-60*p),x=new Intl.RelativeTimeFormat(o,{numeric:"auto"});if(p===0&&a<60)return x.format(a,"second");if(i===0&&p<60)return x.format(p,"minute");if(i<24){let S=`${new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(i,"hour")}`,_=` ${new Intl.RelativeTimeFormat(o,{localeMatcher:"lookup",numeric:"always",style:"long"}).format(p,"minute")}`.replace(/^\D+/,"");return`${S} ${_}`}let y=Math.floor(a/86400);return x.format(y,"day")};var G=require("react"),Te=(e=768)=>{let[t,o]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{let n=()=>{o(window.innerWidth<e)};n();let r=()=>n();return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};var N=require("react"),U=()=>{let[e,t]=(0,N.useState)("unknown");return(0,N.useEffect)(()=>{let o=r=>{t(r.matches?"dark":"light")},n=globalThis.matchMedia("(prefers-color-scheme: dark)");return t(n.matches?"dark":"light"),n.addEventListener("change",o),()=>{n.removeEventListener("change",o)}},[]),e};var we=require("react/jsx-runtime"),Y=({fontFamily:e})=>{let t=(0,Ce.useTheme)(),o=t.palette.mode==="dark",n=t.palette.primary.main,r=t.palette.background.default,i=(0,ke.useMemo)(()=>w(n),[n]);return(0,we.jsx)(H.Global,{styles:H.css`
|
|
43
|
+
`;var re=f(require("@mui/icons-material/BrightnessAutoRounded")),oe=f(require("@mui/icons-material/DarkModeRounded")),ne=f(require("@mui/icons-material/LightModeRounded")),ie=f(require("@mui/icons-material/PersonalVideoRounded")),T=require("react/jsx-runtime"),O=32,ae=[{label:"Auto",value:"auto",icon:(0,T.jsx)(re.default,{color:"inherit",sx:{fontSize:O}})},{label:"System",value:"system",icon:(0,T.jsx)(ie.default,{color:"inherit",sx:{fontSize:O}})},{label:"Light",value:"light",icon:(0,T.jsx)(ne.default,{color:"inherit",sx:{fontSize:O}})},{label:"Dark",value:"dark",icon:(0,T.jsx)(oe.default,{color:"inherit",sx:{fontSize:O}})}];var C={fontDark:"#101727",fontLight:"#f0f0f0",brand:"#9FA9EA",accent:"#F3503A",muted:"#64748B",success:"#2E7D32",info:"#0288D1",warning:"#ED6C02",error:"#D32F2F",neutral:"#64748B"};var F=require("react"),U=(0,F.createContext)(void 0),se=()=>{let e=(0,F.useContext)(U);if(!e)throw new Error("useThemeSettings must be used within ThemeProviderWrapper");return e};var p=require("react"),De=require("@emotion/react"),Oe=require("@mui/material/styles");var I={MuiTooltip:{defaultProps:{disableInteractive:!0},styleOverrides:{tooltip:({theme:e})=>({backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",padding:"8px 16px",borderRadius:e.shape.borderRadius,fontSize:"12px"})}},MuiButton:{styleOverrides:{root:({theme:e})=>({padding:"12px 24px",borderRadius:e.shape.borderRadius}),contained:{boxShadow:"none"}}},MuiSkeleton:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiSelect:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius}),select:{display:"flex",justifyContent:"flex-start",alignItems:"center",gap:"4px"}}},MuiDialog:{defaultProps:{slotProps:{paper:{style:{padding:"12px",borderRadius:24,minWidth:"400px"}}}},styleOverrides:{root:{"& .MuiDialog-container":{backdropFilter:"blur(4px)"}}}},MuiAvatar:{styleOverrides:{root:{fontWeight:500}}},MuiAlert:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiTextField:{defaultProps:{variant:"outlined"},styleOverrides:{root:({theme:e})=>({"& .MuiInputBase-root":{borderRadius:e.shape.borderRadius}})}},MuiOutlinedInput:{styleOverrides:{root:({theme:e})=>({color:e.palette.primary.main,"& fieldset":{borderColor:e.palette.primary.main},"&:hover fieldset":{borderColor:e.palette.primary.dark},"&.Mui-focused fieldset":{borderColor:e.palette.primary.main}})}},MuiInputLabel:{styleOverrides:{root:({theme:e})=>({color:e.palette.primary.main,"&.Mui-focused":{color:e.palette.primary.main}})}},MuiFormHelperText:{styleOverrides:{root:({theme:e})=>({color:e.palette.error.main})}},MuiPaper:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius}),elevation8:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiMenuItem:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiBottomNavigationAction:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius,padding:"12px",margin:0,maxHeight:"none"})}},MuiDialogContent:{styleOverrides:{root:{padding:0}}},MuiSlider:{styleOverrides:{valueLabel:({theme:e})=>({borderRadius:e.shape.borderRadius,padding:"6px 14px","&::before, &::after":{display:"none"}})}},MuiCircularProgress:{styleOverrides:{circle:{strokeLinecap:"round"}}},MuiTab:{styleOverrides:{root:({theme:e})=>({borderRadius:e.shape.borderRadius})}},MuiAccordion:{styleOverrides:{root:{"&::before":{display:"none"}}}}};var H=require("@mui/material");var u={...C},s=()=>u,E=e=>{u={...C,...e}},le={get fontDark(){return u.fontDark},get fontLight(){return u.fontLight},get brand(){return u.brand},get accent(){return u.accent},get muted(){return u.muted},get success(){return u.success},get info(){return u.info},get warning(){return u.warning},get error(){return u.error},get neutral(){return u.neutral}};var pe={defaultProps:{variantMapping:{text_xl_regular:"p",text_lg_regular:"p",text_md_regular:"p",text_sm_regular:"p",text_xs_regular:"p",text_2xs_regular:"p",text_xl_bold:"p",text_lg_bold:"p",text_md_bold:"p",text_sm_bold:"p",text_xs_bold:"p",text_2xs_bold:"p",text_xl_semibold:"p",text_lg_semibold:"p",text_md_semibold:"p",text_sm_semibold:"p",text_xs_semibold:"p",text_2xs_semibold:"p",text_xl_thin:"p",text_lg_thin:"p",text_md_thin:"p",text_sm_thin:"p",text_xs_thin:"p",text_2xs_thin:"p",header_2xl_regular:"h1",header_xl_regular:"h2",header_lg_regular:"h3",header_md_regular:"h4",header_sm_regular:"h5",header_xs_regular:"h6",header_2xl_bold:"h1",header_xl_bold:"h2",header_lg_bold:"h3",header_md_bold:"h4",header_sm_bold:"h5",header_xs_bold:"h6"}}},de={text_xl_regular:{font:"400 20px/30px inherit inherit"},text_lg_regular:{font:"400 18px/28px inherit inherit"},text_md_regular:{font:"400 16px/24px inherit inherit"},text_sm_regular:{font:"400 14px/20px inherit inherit"},text_xs_regular:{font:"400 12px/18px inherit inherit"},text_2xs_regular:{font:"400 10px/14px inherit inherit"},text_xl_bold:{font:"700 20px/30px inherit inherit"},text_lg_bold:{font:"700 18px/28px inherit inherit"},text_md_bold:{font:"700 16px/24px inherit inherit"},text_sm_bold:{font:"700 14px/20px inherit inherit"},text_xs_bold:{font:"700 12px/18px inherit inherit"},text_2xs_bold:{font:"700 10px/14px inherit inherit"},text_xl_semibold:{font:"600 20px/30px inherit inherit"},text_lg_semibold:{font:"600 18px/28px inherit inherit"},text_md_semibold:{font:"600 16px/24px inherit inherit"},text_sm_semibold:{font:"600 14px/20px inherit inherit"},text_xs_semibold:{font:"600 12px/18px inherit inherit"},text_2xs_semibold:{font:"600 10px/14px inherit inherit"},text_xl_thin:{font:"100 20px/30px inherit inherit"},text_lg_thin:{font:"100 18px/28px inherit inherit"},text_md_thin:{font:"100 16px/24px inherit inherit"},text_sm_thin:{font:"100 14px/20px inherit inherit"},text_xs_thin:{font:"100 12px/18px inherit inherit"},text_2xs_thin:{font:"100 10px/14px inherit inherit"},header_2xl_regular:{font:"400 36px/44px inherit inherit"},header_xl_regular:{font:"400 32px/40px inherit inherit"},header_lg_regular:{font:"400 28px/36px inherit inherit"},header_md_regular:{font:"400 24px/32px inherit inherit"},header_sm_regular:{font:"400 20px/28px inherit inherit"},header_xs_regular:{font:"400 18px/26px inherit inherit"},header_2xl_bold:{font:"700 36px/44px inherit inherit"},header_xl_bold:{font:"700 32px/40px inherit inherit"},header_lg_bold:{font:"700 28px/36px inherit inherit"},header_md_bold:{font:"700 24px/32px inherit inherit"},header_sm_bold:{font:"700 20px/28px inherit inherit"},header_xs_bold:{font:"700 18px/26px inherit inherit"}};var v=(e,t="light",o)=>{let n=t==="dark",r=(0,H.createTheme)({palette:{mode:t}});return(0,H.createTheme)(r,{palette:{primary:{...r.palette.primary,main:e},brand:r.palette.augmentColor({color:{main:e}}),neutral:r.palette.augmentColor({color:{main:s().neutral}}),accent:r.palette.augmentColor({color:{main:s().accent}}),muted:r.palette.augmentColor({color:{main:s().muted}}),...o?{secondary:{...r.palette.secondary,main:o}}:{},error:{...r.palette.error,main:s().error},warning:{...r.palette.warning,main:s().warning},success:{...r.palette.success,main:s().success},info:{...r.palette.info,main:s().info},background:n?{...r.palette.background,default:"#1C1C1E",paper:"#2C2C2E"}:{...r.palette.background,default:"#F2F2F7",paper:"#FFFFFF"},divider:n?"rgba(255,255,255,0.12)":"rgba(0,0,0,0.12)"},components:{...I,MuiTypography:pe},typography:{...de,fontFamily:'var(--app-font-family, "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif)'},shape:{borderRadius:24}})};var ye=require("react"),z=require("@emotion/react"),be=require("@mui/material/styles");var Y=e=>/^#([\dA-Fa-f]{3}|[\dA-Fa-f]{6})$/.test(e),S=e=>{if(!Y(e))return console.error("Invalid hex color provided:",e),s().fontDark;let t=e.slice(1),o=t.length===3?t.split("").map(x=>x+x).join(""):t,n=Number.parseInt(o.slice(0,2),16),r=Number.parseInt(o.slice(2,4),16),i=Number.parseInt(o.slice(4,6),16),d=Math.round((n*299+r*587+i*114)/1e3),a=s();return d>128?a.fontDark:a.fontLight},me=e=>S(e)===s().fontLight;var ue=()=>{let e=new Date().getHours();return e>=5&&e<12?"Good morning":e>12&&e<18?"Good afternoon":"Good evening"};var ce=e=>{let t=e.getFullYear(),o=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${o}-${n}`};var Ye=()=>{let e=(typeof navigator=="undefined"?"":navigator.userAgent).toLowerCase();return e.includes("windows nt")?"Windows":e.includes("iphone")||e.includes("ipad")||e.includes("ipod")?"iOS":e.includes("mac")?"macOS":e.includes("android")?"Android":e.includes("linux")?"Linux":"Unknown"},Ve=()=>{let e=(typeof navigator=="undefined"?"":navigator.userAgent).toLowerCase();return e.includes("edg")?"Edge":e.includes("chrome")?"Chrome":e.includes("firefox")?"Firefox":e.includes("safari")?"Safari":"Unknown"},fe={os:typeof navigator=="undefined"?"Unknown":Ye(),browser:typeof navigator=="undefined"?"Unknown":Ve()};var A=(e,t)=>{switch(e){case"light":return!1;case"dark":return!0;case"system":return t==="dark";default:return!1}};var he=(e,t)=>{let o=t!=null?t:typeof navigator=="undefined"?"en-US":navigator.language,n=new Date;e=new Date(e);let r=Math.floor((n.getTime()-e.getTime())/1e3),i=new Intl.RelativeTimeFormat(o,{numeric:"auto"});if(r<60)return i.format(-r,"second");if(r<3600){let a=Math.floor(r/60);return i.format(-a,"minute")}if(r<86400){let a=Math.floor(r/3600);return i.format(-a,"hour")}let d=Math.floor(r/86400);return i.format(-d,"day")},xe=(e,t)=>{let o=t!=null?t:typeof navigator=="undefined"?"en-US":navigator.language,n=new Date;e=new Date(e);let r=(e.getTime()-n.getTime())/1e3,i=Math.floor(r/(60*60)),d=Math.floor((r-60*60*i)/60),a=Math.floor(r-60*60*i-60*d),x=new Intl.RelativeTimeFormat(o,{numeric:"auto"});if(d===0&&a<60)return x.format(a,"second");if(i===0&&d<60)return x.format(d,"minute");if(i<24){let w=`${new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(i,"hour")}`,b=` ${new Intl.RelativeTimeFormat(o,{localeMatcher:"lookup",numeric:"always",style:"long"}).format(d,"minute")}`.replace(/^\D+/,"");return`${w} ${b}`}let y=Math.floor(a/86400);return x.format(y,"day")};var L=require("react"),ge=(e=768)=>{let[t,o]=(0,L.useState)(!1);return(0,L.useEffect)(()=>{let n=()=>{o(window.innerWidth<e)};n();let r=()=>n();return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[e]),t};var $=require("react"),B=()=>{let[e,t]=(0,$.useState)("unknown");return(0,$.useEffect)(()=>{let o=r=>{t(r.matches?"dark":"light")},n=globalThis.matchMedia("(prefers-color-scheme: dark)");return t(n.matches?"dark":"light"),n.addEventListener("change",o),()=>{n.removeEventListener("change",o)}},[]),e};var _e=require("react/jsx-runtime"),W=({fontFamily:e})=>{let t=(0,be.useTheme)(),o=t.palette.mode==="dark",n=t.palette.primary.main,r=t.palette.background.default,i=(0,ye.useMemo)(()=>S(n),[n]);return(0,_e.jsx)(z.Global,{styles:z.css`
|
|
44
44
|
/* Allow application to control font via CSS var or prop */
|
|
45
45
|
:root {
|
|
46
46
|
${e?`--app-font-family: ${e};`:""}
|
|
47
47
|
}
|
|
48
48
|
* {
|
|
49
|
-
font-family:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
font-family:
|
|
50
|
+
var(
|
|
51
|
+
--app-font-family,
|
|
52
|
+
"Mulish",
|
|
53
|
+
system-ui,
|
|
54
|
+
-apple-system,
|
|
55
|
+
"Segoe UI",
|
|
56
|
+
Roboto,
|
|
57
|
+
Arial
|
|
58
|
+
),
|
|
59
|
+
sans-serif !important;
|
|
58
60
|
-webkit-tap-highlight-color: transparent;
|
|
59
61
|
&::selection {
|
|
60
62
|
background-color: ${`${n}e1`};
|
|
@@ -169,7 +171,7 @@
|
|
|
169
171
|
border-radius: 42px 42px 0 0;
|
|
170
172
|
z-index: 9999999;
|
|
171
173
|
}
|
|
172
|
-
`})};var h=require("@emotion/react"),
|
|
174
|
+
`})};var h=require("@emotion/react"),ve=h.keyframes`
|
|
173
175
|
from {
|
|
174
176
|
opacity: 0;
|
|
175
177
|
transform: translateX(-40px);
|
|
@@ -178,35 +180,35 @@
|
|
|
178
180
|
opacity: 1;
|
|
179
181
|
transform: translateX(0);
|
|
180
182
|
}
|
|
181
|
-
`,
|
|
183
|
+
`,ke=h.keyframes`
|
|
182
184
|
from {
|
|
183
185
|
opacity: 0;
|
|
184
186
|
}
|
|
185
187
|
to {
|
|
186
188
|
opacity: 1;
|
|
187
189
|
}
|
|
188
|
-
`,
|
|
190
|
+
`,we=h.keyframes`
|
|
189
191
|
from {
|
|
190
192
|
transform: translateX(-100%);
|
|
191
193
|
}
|
|
192
194
|
to {
|
|
193
195
|
transform: translateX(0);
|
|
194
196
|
}
|
|
195
|
-
`,
|
|
197
|
+
`,Te=h.keyframes`
|
|
196
198
|
from {
|
|
197
199
|
transform: translateY(100%);
|
|
198
200
|
}
|
|
199
201
|
to {
|
|
200
202
|
transform: translateY(0);
|
|
201
203
|
}
|
|
202
|
-
`,
|
|
204
|
+
`,Ce=h.keyframes`
|
|
203
205
|
from {
|
|
204
206
|
transform: scale(0);
|
|
205
207
|
}
|
|
206
208
|
to {
|
|
207
209
|
transform: scale(1);
|
|
208
210
|
}
|
|
209
|
-
`,
|
|
211
|
+
`,Se=(e,t=12)=>h.keyframes`
|
|
210
212
|
0% {
|
|
211
213
|
transform: scale(0.95);
|
|
212
214
|
box-shadow: 0 0 0 0 ${e}b2;
|
|
@@ -219,7 +221,7 @@
|
|
|
219
221
|
transform: scale(0.95);
|
|
220
222
|
box-shadow: 0 0 0 0 ${e}00;
|
|
221
223
|
}
|
|
222
|
-
`,
|
|
224
|
+
`,Me=e=>h.keyframes`
|
|
223
225
|
0% {
|
|
224
226
|
filter: none;
|
|
225
227
|
}
|
|
@@ -229,7 +231,7 @@
|
|
|
229
231
|
100% {
|
|
230
232
|
filter: none;
|
|
231
233
|
}
|
|
232
|
-
`,
|
|
234
|
+
`,Pe=h.keyframes`
|
|
233
235
|
0% {
|
|
234
236
|
transform: scale(1);
|
|
235
237
|
opacity: 1;
|
|
@@ -242,7 +244,7 @@
|
|
|
242
244
|
transform: scale(1);
|
|
243
245
|
opacity: 1;
|
|
244
246
|
}
|
|
245
|
-
`,
|
|
247
|
+
`,Re=h.keyframes`
|
|
246
248
|
0% {
|
|
247
249
|
transform: translateY(0);
|
|
248
250
|
}
|
|
@@ -258,5 +260,5 @@
|
|
|
258
260
|
100% {
|
|
259
261
|
transform: translateY(0);
|
|
260
262
|
}
|
|
261
|
-
`;var
|
|
263
|
+
`;var k=require("react/jsx-runtime"),Fe=({children:e,fontFamily:t,themes:o,colorPaletteOverride:n})=>{let r=B();(0,p.useEffect)(()=>{E(n)},[n]);let[i,d]=(0,p.useState)("system"),[a,x]=(0,p.useState)("auto");(0,p.useEffect)(()=>{if(globalThis.window!==void 0)try{let c=globalThis.localStorage.getItem("appSettings");if(c){let l=JSON.parse(c);l.theme&&d(l.theme),l.darkMode&&x(l.darkMode)}}catch(c){}},[]),(0,p.useEffect)(()=>{if(globalThis.window!==void 0)try{globalThis.localStorage.setItem("appSettings",JSON.stringify({theme:i,darkMode:a}))}catch(c){}},[i,a]);let y=(0,p.useMemo)(()=>{if(o&&o.length>0)return o.map(l=>({name:l.name,MuiTheme:v(l.primaryColor,"light",l.secondaryColor)}));let c=s().brand;return[{name:"Default",MuiTheme:v(c,"light")}]},[o]),w=(0,p.useMemo)(()=>{var c;return i==="system"||r==="unknown"?y[0].MuiTheme:((c=y.find(l=>l.name===i))==null?void 0:c.MuiTheme)||y[0].MuiTheme},[r,i,y]),b=(0,p.useMemo)(()=>A(a,r)?"dark":"light",[a,r]),Ie=(0,p.useMemo)(()=>{var l,V;let c=(V=(l=w.palette)==null?void 0:l.secondary)==null?void 0:V.main;return v(w.palette.primary.main,b,c)},[w,b]),Ee=(0,p.useMemo)(()=>({darkMode:b==="dark"}),[b]);return(0,k.jsx)(U.Provider,{value:{theme:i,darkMode:a,setTheme:d,setDarkMode:x},children:(0,k.jsx)(Oe.ThemeProvider,{theme:Ie,children:(0,k.jsxs)(De.ThemeProvider,{theme:Ee,children:[(0,k.jsx)(W,{fontFamily:t}),e]})})})};0&&(module.exports={ColorPalette,DialogBtn,ErrorBoundary,GlobalStyles,Loading,PathName,ThemeProviderWrapper,commonComponentProps,createCustomTheme,darkModeOptions,defaultColorPalette,displayGreeting,fadeIn,fadeInLeft,getColorPalette,getDayIdentifier,getFontColor,installAppAnimation,isDarkMode,isFontLight,isHexColor,logoutAnimation,progressPulse,pulseAnimation,scale,setColorPaletteOverride,slideIn,slideInBottom,systemInfo,timeAgo,timeAgoFromStart,useResponsiveDisplay,useSystemTheme,useThemeSettings});
|
|
262
264
|
//# sourceMappingURL=index.js.map
|