@atomazing-org/design-system 1.1.1 → 1.2.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 +257 -345
- package/dist/chunk-JBLCVRJT.mjs +2 -0
- package/dist/chunk-JBLCVRJT.mjs.map +1 -0
- package/dist/index.d.mts +957 -207
- package/dist/index.d.ts +957 -207
- package/dist/index.js +30 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -30
- package/dist/index.mjs.map +1 -1
- package/dist/presets/index.d.mts +17 -0
- package/dist/presets/index.d.ts +17 -0
- package/dist/presets/index.js +2 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/index.mjs +2 -0
- package/dist/presets/index.mjs.map +1 -0
- package/dist/typography-Dq0wCojD.d.mts +121 -0
- package/dist/typography-Dq0wCojD.d.ts +121 -0
- package/package.json +9 -2
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ThemeOptions, TypeBackground } from '@mui/material/styles';
|
|
2
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Available options for dark mode configuration.
|
|
6
|
+
* - `system`: Follows the operating system preference.
|
|
7
|
+
* - `auto`: Alias of `system` (no contrast-based detection in current contract).
|
|
8
|
+
* - `light`: Forces light mode.
|
|
9
|
+
* - `dark`: Forces dark mode.
|
|
10
|
+
*/
|
|
11
|
+
type DarkModeOptions = "system" | "auto" | "light" | "dark";
|
|
12
|
+
interface OptionItem {
|
|
13
|
+
label: string;
|
|
14
|
+
value: DarkModeOptions;
|
|
15
|
+
icon: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
type ThemeModeBackground = Partial<Record<"light" | "dark", Partial<TypeBackground>>>;
|
|
18
|
+
type NamedThemeOptions = ThemeOptions & {
|
|
19
|
+
name: string;
|
|
20
|
+
background?: ThemeModeBackground;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Represents user-specific theme preferences stored in the application.
|
|
24
|
+
*/
|
|
25
|
+
interface AppSettings {
|
|
26
|
+
/**
|
|
27
|
+
* The selected theme name from the available themes list.
|
|
28
|
+
* Invalid or missing values are normalized to the first available theme.
|
|
29
|
+
*/
|
|
30
|
+
theme: string;
|
|
31
|
+
/**
|
|
32
|
+
* Controls how dark mode is applied in the app.
|
|
33
|
+
*/
|
|
34
|
+
darkMode: DarkModeOptions;
|
|
35
|
+
}
|
|
36
|
+
interface ThemeContextProps {
|
|
37
|
+
theme: string;
|
|
38
|
+
darkMode: DarkModeOptions;
|
|
39
|
+
setTheme: (theme: string) => void;
|
|
40
|
+
setDarkMode: (mode: DarkModeOptions) => void;
|
|
41
|
+
themes: NamedThemeOptions[];
|
|
42
|
+
selectedTheme: NamedThemeOptions;
|
|
43
|
+
defaultThemeName: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type ThemeId = string;
|
|
47
|
+
type ThemeScheme = "light" | "dark";
|
|
48
|
+
type DarkModeSetting = DarkModeOptions;
|
|
49
|
+
interface ThemePreset {
|
|
50
|
+
id: ThemeId;
|
|
51
|
+
label: string;
|
|
52
|
+
colorSchemes: {
|
|
53
|
+
light: ThemeOptions;
|
|
54
|
+
dark: ThemeOptions;
|
|
55
|
+
};
|
|
56
|
+
description?: string;
|
|
57
|
+
tags?: string[];
|
|
58
|
+
version?: string;
|
|
59
|
+
}
|
|
60
|
+
type NormalizedPreset = ThemePreset & {
|
|
61
|
+
meta?: {
|
|
62
|
+
origin: "preset" | "legacy" | "custom";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
interface CustomTypographyVariants {
|
|
67
|
+
text_xl_regular: CSSProperties;
|
|
68
|
+
text_lg_regular: CSSProperties;
|
|
69
|
+
text_md_regular: CSSProperties;
|
|
70
|
+
text_sm_regular: CSSProperties;
|
|
71
|
+
text_xs_regular: CSSProperties;
|
|
72
|
+
text_2xs_regular: CSSProperties;
|
|
73
|
+
text_xl_bold: CSSProperties;
|
|
74
|
+
text_lg_bold: CSSProperties;
|
|
75
|
+
text_md_bold: CSSProperties;
|
|
76
|
+
text_sm_bold: CSSProperties;
|
|
77
|
+
text_xs_bold: CSSProperties;
|
|
78
|
+
text_2xs_bold: CSSProperties;
|
|
79
|
+
text_xl_semibold: CSSProperties;
|
|
80
|
+
text_lg_semibold: CSSProperties;
|
|
81
|
+
text_md_semibold: CSSProperties;
|
|
82
|
+
text_sm_semibold: CSSProperties;
|
|
83
|
+
text_xs_semibold: CSSProperties;
|
|
84
|
+
text_2xs_semibold: CSSProperties;
|
|
85
|
+
text_xl_thin: CSSProperties;
|
|
86
|
+
text_lg_thin: CSSProperties;
|
|
87
|
+
text_md_thin: CSSProperties;
|
|
88
|
+
text_sm_thin: CSSProperties;
|
|
89
|
+
text_xs_thin: CSSProperties;
|
|
90
|
+
text_2xs_thin: CSSProperties;
|
|
91
|
+
header_2xl_regular: CSSProperties;
|
|
92
|
+
header_xl_regular: CSSProperties;
|
|
93
|
+
header_lg_regular: CSSProperties;
|
|
94
|
+
header_md_regular: CSSProperties;
|
|
95
|
+
header_sm_regular: CSSProperties;
|
|
96
|
+
header_xs_regular: CSSProperties;
|
|
97
|
+
header_2xl_bold: CSSProperties;
|
|
98
|
+
header_xl_bold: CSSProperties;
|
|
99
|
+
header_lg_bold: CSSProperties;
|
|
100
|
+
header_md_bold: CSSProperties;
|
|
101
|
+
header_sm_bold: CSSProperties;
|
|
102
|
+
header_xs_bold: CSSProperties;
|
|
103
|
+
header_2xl_semibold: CSSProperties;
|
|
104
|
+
header_xl_semibold: CSSProperties;
|
|
105
|
+
header_lg_semibold: CSSProperties;
|
|
106
|
+
header_md_semibold: CSSProperties;
|
|
107
|
+
header_sm_semibold: CSSProperties;
|
|
108
|
+
header_xs_semibold: CSSProperties;
|
|
109
|
+
}
|
|
110
|
+
declare module "@mui/material/styles" {
|
|
111
|
+
interface TypographyVariants extends CustomTypographyVariants {
|
|
112
|
+
}
|
|
113
|
+
interface TypographyVariantsOptions extends Partial<CustomTypographyVariants> {
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
declare module "@mui/material/Typography" {
|
|
117
|
+
interface TypographyPropsVariantOverrides extends Record<keyof CustomTypographyVariants, true> {
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type { AppSettings as A, CustomTypographyVariants as C, DarkModeOptions as D, NamedThemeOptions as N, OptionItem as O, ThemeContextProps as T, ThemePreset as a, ThemeModeBackground as b, NormalizedPreset as c, DarkModeSetting as d, ThemeId as e, ThemeScheme as f };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomazing-org/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A library providing a set of useful utils, MUI style extensions, and components to build your application.",
|
|
6
6
|
"author": "PonomarevBPM + MarkSinD",
|
|
@@ -21,14 +21,21 @@
|
|
|
21
21
|
"types": "./dist/index.d.ts",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
24
25
|
"import": "./dist/index.mjs",
|
|
25
26
|
"require": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./presets": {
|
|
29
|
+
"types": "./dist/presets/index.d.ts",
|
|
30
|
+
"import": "./dist/presets/index.mjs",
|
|
31
|
+
"require": "./dist/presets/index.js"
|
|
26
32
|
}
|
|
27
33
|
},
|
|
28
34
|
"files": [
|
|
29
35
|
"dist",
|
|
30
36
|
"README.md"
|
|
31
37
|
],
|
|
38
|
+
"sideEffects": false,
|
|
32
39
|
"publishConfig": {
|
|
33
40
|
"access": "public",
|
|
34
41
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -36,7 +43,7 @@
|
|
|
36
43
|
"scripts": {
|
|
37
44
|
"build": "tsup",
|
|
38
45
|
"dev": "tsup --watch",
|
|
39
|
-
"test": "vitest",
|
|
46
|
+
"test": "vitest run",
|
|
40
47
|
"format": "npm run format:eslint && npm run format:prettier",
|
|
41
48
|
"format:eslint": "npm run lint:eslint -- --fix",
|
|
42
49
|
"format:prettier": "npm run lint:prettier -- --write",
|