@ufoui/core 0.0.40 → 0.0.88
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/assets/index.d.ts +1 -0
- package/assets/spinners.d.ts +16 -0
- package/components/actions/actions.d.ts +55 -0
- package/components/actions/actions.guards.d.ts +15 -0
- package/components/avatar/avatar.d.ts +3 -3
- package/components/badge/badge.d.ts +1 -1
- package/components/base/boxBase.d.ts +6 -6
- package/components/base/dialogBase.d.ts +2 -2
- package/components/base/textBase.d.ts +11 -11
- package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
- package/components/button/button.d.ts +1 -1
- package/components/card/card.d.ts +39 -13
- package/components/card/cardHeader.d.ts +49 -0
- package/components/card/cardMedia.d.ts +9 -0
- package/components/card/cardTitle.d.ts +11 -0
- package/components/dialogs/dialogHeader.d.ts +1 -1
- package/components/dialogs/index.d.ts +1 -1
- package/components/fieldset/fieldset.d.ts +1 -1
- package/components/layout/article.d.ts +1 -1
- package/components/layout/aside.d.ts +1 -1
- package/components/layout/content.d.ts +1 -1
- package/components/layout/footer.d.ts +1 -1
- package/components/layout/header.d.ts +1 -1
- package/components/layout/main.d.ts +1 -1
- package/components/layout/nav.d.ts +1 -1
- package/components/layout/section.d.ts +1 -1
- package/components/link/link.d.ts +13 -14
- package/components/spinner/spinner.d.ts +27 -2
- package/components/themeProvider/themeProvider.d.ts +14 -4
- package/components/toolbar/toolbar.d.ts +1 -1
- package/components/typography/h1.d.ts +1 -1
- package/components/typography/h2.d.ts +1 -1
- package/components/typography/h3.d.ts +1 -1
- package/components/typography/h4.d.ts +1 -1
- package/components/typography/h5.d.ts +1 -1
- package/components/typography/h6.d.ts +1 -1
- package/components/typography/label.d.ts +1 -1
- package/components/typography/p.d.ts +1 -1
- package/components/typography/span.d.ts +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/useAnimate.d.ts +8 -6
- package/hooks/useResponsive.d.ts +60 -0
- package/hooks/useTheme.d.ts +1 -1
- package/index.css +1 -1
- package/index.d.ts +3 -0
- package/index.js +3460 -3404
- package/package.json +1 -1
- package/types/breakpoints.d.ts +38 -0
- package/types/color.d.ts +300 -0
- package/types/dialog.d.ts +0 -11
- package/types/fonts.d.ts +53 -0
- package/types/index.d.ts +3 -0
- package/types/motion.d.ts +31 -4
- package/types/theme.d.ts +8 -205
- package/utils/{applyThemeTokens.d.ts → applyThemeColors.d.ts} +2 -2
- package/utils/breakpoints/breakpoint.d.ts +59 -0
- package/utils/breakpoints/breakpointStore.d.ts +32 -0
- package/utils/breakpoints/index.d.ts +2 -0
- package/utils/color.d.ts +4 -90
- package/utils/colorRegistry.d.ts +0 -7
- package/utils/createRipple.d.ts +17 -0
- package/utils/fontRegistry.d.ts +29 -0
- package/utils/generateMaterialColors.d.ts +8 -11
- package/utils/index.d.ts +6 -1
- package/utils/mergeOverrides.d.ts +13 -0
- package/utils/utils.d.ts +2 -24
- package/components/dialogs/dialogActions.d.ts +0 -26
- package/components/dialogs/dialogActions.guards.d.ts +0 -15
package/package.json
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines responsive breakpoints used by the design system.
|
|
3
|
+
*
|
|
4
|
+
* @category Theme
|
|
5
|
+
*/
|
|
6
|
+
export type ThemeBreakpointKey = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
|
|
7
|
+
/**
|
|
8
|
+
* Optional custom breakpoint names added via module augmentation.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* declare module '@ufoui/core' {
|
|
12
|
+
* interface CustomBreakpoints {
|
|
13
|
+
* ufo: true;
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* @category Theme
|
|
18
|
+
*/
|
|
19
|
+
export interface CustomBreakpoints {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Custom breakpoint keys registered via {@link CustomBreakpoints}.
|
|
23
|
+
*
|
|
24
|
+
* @category Theme
|
|
25
|
+
*/
|
|
26
|
+
export type CustomBreakpointKey = Extract<keyof CustomBreakpoints, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Defines the canonical responsive breakpoints used by the design system.
|
|
29
|
+
*
|
|
30
|
+
* @category Theme
|
|
31
|
+
*/
|
|
32
|
+
export type ThemeBreakpoints = Record<ThemeBreakpointKey, string> & Partial<Record<CustomBreakpointKey, string>> & Record<string, string>;
|
|
33
|
+
/**
|
|
34
|
+
* Partial variant of {@link ThemeBreakpoints}, allowing selective overrides.
|
|
35
|
+
*
|
|
36
|
+
* @category Theme
|
|
37
|
+
*/
|
|
38
|
+
export type PartialThemeBreakpoints = Partial<Record<ThemeBreakpointKey | CustomBreakpointKey, string>> & Record<string, string | undefined>;
|
package/types/color.d.ts
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines all color roles used in a single theme color scheme (e.g. light or dark).
|
|
3
|
+
*
|
|
4
|
+
* Based on the Material Design 3 palette structure with custom extensions
|
|
5
|
+
* for semantic and system colors (e.g. info, success, warning).
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Provides the canonical source for all `--uui-color-*` tokens in both light and dark modes.
|
|
9
|
+
*
|
|
10
|
+
* @category Theme
|
|
11
|
+
*/
|
|
12
|
+
export interface ThemeColorScheme {
|
|
13
|
+
/** Primary brand color used for main UI elements. */
|
|
14
|
+
primary: string;
|
|
15
|
+
/** Foreground color displayed on primary. */
|
|
16
|
+
onPrimary: string;
|
|
17
|
+
/** Container background for primary content. */
|
|
18
|
+
primaryContainer: string;
|
|
19
|
+
/** Foreground color on primary container. */
|
|
20
|
+
onPrimaryContainer: string;
|
|
21
|
+
/** Fixed version of primary for consistent tone. */
|
|
22
|
+
primaryFixed: string;
|
|
23
|
+
/** Foreground color on primaryFixed. */
|
|
24
|
+
onPrimaryFixed: string;
|
|
25
|
+
/** Dimmed tone of primaryFixed. */
|
|
26
|
+
primaryFixedDim: string;
|
|
27
|
+
/** Variant tone for content on primaryFixedDim. */
|
|
28
|
+
onPrimaryFixedVariant: string;
|
|
29
|
+
/** Secondary color for less prominent accents. */
|
|
30
|
+
secondary: string;
|
|
31
|
+
/** Foreground color on secondary. */
|
|
32
|
+
onSecondary: string;
|
|
33
|
+
/** Background container using secondary tone. */
|
|
34
|
+
secondaryContainer: string;
|
|
35
|
+
/** Foreground color on secondary container. */
|
|
36
|
+
onSecondaryContainer: string;
|
|
37
|
+
/** Fixed version of secondary tone. */
|
|
38
|
+
secondaryFixed: string;
|
|
39
|
+
/** Foreground color on secondaryFixed. */
|
|
40
|
+
onSecondaryFixed: string;
|
|
41
|
+
/** Dimmed version of secondaryFixed. */
|
|
42
|
+
secondaryFixedDim: string;
|
|
43
|
+
/** Variant tone for content on secondaryFixedDim. */
|
|
44
|
+
onSecondaryFixedVariant: string;
|
|
45
|
+
/** Tertiary color for decorative or alternative accents. */
|
|
46
|
+
tertiary: string;
|
|
47
|
+
/** Foreground color on tertiary. */
|
|
48
|
+
onTertiary: string;
|
|
49
|
+
/** Background container using tertiary tone. */
|
|
50
|
+
tertiaryContainer: string;
|
|
51
|
+
/** Foreground color on tertiary container. */
|
|
52
|
+
onTertiaryContainer: string;
|
|
53
|
+
/** Fixed version of tertiary tone. */
|
|
54
|
+
tertiaryFixed: string;
|
|
55
|
+
/** Foreground color on tertiaryFixed. */
|
|
56
|
+
onTertiaryFixed: string;
|
|
57
|
+
/** Dimmed version of tertiaryFixed. */
|
|
58
|
+
tertiaryFixedDim: string;
|
|
59
|
+
/** Variant tone for content on tertiaryFixedDim. */
|
|
60
|
+
onTertiaryFixedVariant: string;
|
|
61
|
+
/** Warning tone for alerts or cautions. */
|
|
62
|
+
warning: string;
|
|
63
|
+
/** Foreground color on warning. */
|
|
64
|
+
onWarning: string;
|
|
65
|
+
/** Container color for warning messages. */
|
|
66
|
+
warningContainer: string;
|
|
67
|
+
/** Foreground color on warning container. */
|
|
68
|
+
onWarningContainer: string;
|
|
69
|
+
/** Fixed warning tone. */
|
|
70
|
+
warningFixed: string;
|
|
71
|
+
/** Foreground color on warningFixed. */
|
|
72
|
+
onWarningFixed: string;
|
|
73
|
+
/** Dimmed warningFixed variant. */
|
|
74
|
+
warningFixedDim: string;
|
|
75
|
+
/** Variant foreground color for dimmed warning. */
|
|
76
|
+
onWarningFixedVariant: string;
|
|
77
|
+
/** Informational tone for neutral messages. */
|
|
78
|
+
info: string;
|
|
79
|
+
/** Foreground color on info. */
|
|
80
|
+
onInfo: string;
|
|
81
|
+
/** Container background for info tone. */
|
|
82
|
+
infoContainer: string;
|
|
83
|
+
/** Foreground color on info container. */
|
|
84
|
+
onInfoContainer: string;
|
|
85
|
+
/** Fixed tone for info. */
|
|
86
|
+
infoFixed: string;
|
|
87
|
+
/** Foreground color on infoFixed. */
|
|
88
|
+
onInfoFixed: string;
|
|
89
|
+
/** Dimmed infoFixed variant. */
|
|
90
|
+
infoFixedDim: string;
|
|
91
|
+
/** Variant foreground color for dimmed info. */
|
|
92
|
+
onInfoFixedVariant: string;
|
|
93
|
+
/** Success tone for positive feedback. */
|
|
94
|
+
success: string;
|
|
95
|
+
/** Foreground color on success. */
|
|
96
|
+
onSuccess: string;
|
|
97
|
+
/** Container background for success tone. */
|
|
98
|
+
successContainer: string;
|
|
99
|
+
/** Foreground color on success container. */
|
|
100
|
+
onSuccessContainer: string;
|
|
101
|
+
/** Fixed success tone. */
|
|
102
|
+
successFixed: string;
|
|
103
|
+
/** Foreground color on successFixed. */
|
|
104
|
+
onSuccessFixed: string;
|
|
105
|
+
/** Dimmed successFixed variant. */
|
|
106
|
+
successFixedDim: string;
|
|
107
|
+
/** Variant foreground color for dimmed success. */
|
|
108
|
+
onSuccessFixedVariant: string;
|
|
109
|
+
/** Error tone for destructive actions or validation. */
|
|
110
|
+
error: string;
|
|
111
|
+
/** Foreground color on error. */
|
|
112
|
+
onError: string;
|
|
113
|
+
/** Container background for error tone. */
|
|
114
|
+
errorContainer: string;
|
|
115
|
+
/** Foreground color on error container. */
|
|
116
|
+
onErrorContainer: string;
|
|
117
|
+
/** Fixed error tone. */
|
|
118
|
+
errorFixed: string;
|
|
119
|
+
/** Foreground color on errorFixed. */
|
|
120
|
+
onErrorFixed: string;
|
|
121
|
+
/** Dimmed errorFixed variant. */
|
|
122
|
+
errorFixedDim: string;
|
|
123
|
+
/** Variant foreground color for dimmed error. */
|
|
124
|
+
onErrorFixedVariant: string;
|
|
125
|
+
/** Border and divider color. */
|
|
126
|
+
outline: string;
|
|
127
|
+
/** Secondary outline tone. */
|
|
128
|
+
outlineVariant: string;
|
|
129
|
+
/** Default surface background color. */
|
|
130
|
+
surface: string;
|
|
131
|
+
/** Foreground color on surface. */
|
|
132
|
+
onSurface: string;
|
|
133
|
+
/** Variant background tone for surfaces. */
|
|
134
|
+
surfaceVariant: string;
|
|
135
|
+
/** Foreground color on surfaceVariant. */
|
|
136
|
+
onSurfaceVariant: string;
|
|
137
|
+
/** UI background color. */
|
|
138
|
+
background: string;
|
|
139
|
+
/** Foreground color on background. */
|
|
140
|
+
onBackground: string;
|
|
141
|
+
/** Inverse surface tone (e.g. for bottom navs). */
|
|
142
|
+
inverseSurface: string;
|
|
143
|
+
/** Foreground color on inverse surface. */
|
|
144
|
+
inverseOnSurface: string;
|
|
145
|
+
/** Primary accent used on inverse surfaces. */
|
|
146
|
+
inversePrimary: string;
|
|
147
|
+
/** Color used for shadows and elevation. */
|
|
148
|
+
shadow: string;
|
|
149
|
+
/** Tint overlay for elevated components. */
|
|
150
|
+
surfaceTint: string;
|
|
151
|
+
/** Overlay color for modals, drawers, etc. */
|
|
152
|
+
scrim: string;
|
|
153
|
+
/** Surface tone for highest-level containers. */
|
|
154
|
+
surfaceContainerHighest: string;
|
|
155
|
+
/** Surface tone for high elevation containers. */
|
|
156
|
+
surfaceContainerHigh: string;
|
|
157
|
+
/** Base tone for standard surface containers. */
|
|
158
|
+
surfaceContainer: string;
|
|
159
|
+
/** Surface tone for low elevation containers. */
|
|
160
|
+
surfaceContainerLow: string;
|
|
161
|
+
/** Surface tone for lowest elevation containers. */
|
|
162
|
+
surfaceContainerLowest: string;
|
|
163
|
+
/** Brightest surface tone variant. */
|
|
164
|
+
surfaceBright: string;
|
|
165
|
+
/** Dimmed surface tone variant. */
|
|
166
|
+
surfaceDim: string;
|
|
167
|
+
/** Pure black color used for contrast or background. */
|
|
168
|
+
black: string;
|
|
169
|
+
/** Pure white color used for contrast or foreground. */
|
|
170
|
+
white: string;
|
|
171
|
+
/** Allows for additional custom tokens. */
|
|
172
|
+
[key: string]: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A partial version of {@link ThemeColorScheme}, used for theme overrides
|
|
176
|
+
* or gradual, progressive theming updates.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* Useful when defining incomplete color sets (e.g. custom brand palettes).
|
|
180
|
+
* Also permits additional custom token keys with optional values.
|
|
181
|
+
*
|
|
182
|
+
* @category Theme
|
|
183
|
+
*/
|
|
184
|
+
export type PartialThemeColorScheme = Partial<ThemeColorScheme> & Record<string, string | undefined>;
|
|
185
|
+
/**
|
|
186
|
+
* Collection of named color schemes (e.g. light, dark, high-contrast).
|
|
187
|
+
* Used to organize multiple theme modes within a design system.
|
|
188
|
+
*
|
|
189
|
+
* @category Theme
|
|
190
|
+
*/
|
|
191
|
+
export interface ThemeColorSchemes {
|
|
192
|
+
/** Light mode color scheme. */
|
|
193
|
+
light: PartialThemeColorScheme;
|
|
194
|
+
/** Dark mode color scheme. */
|
|
195
|
+
dark: PartialThemeColorScheme;
|
|
196
|
+
/** Additional custom schemes such as high-contrast or sepia. */
|
|
197
|
+
[key: string]: PartialThemeColorScheme;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Built-in semantic color names available in every theme.
|
|
201
|
+
*
|
|
202
|
+
* @category Color
|
|
203
|
+
*/
|
|
204
|
+
export type CoreSemanticColor = 'primary' | 'secondary' | 'tertiary' | 'warning' | 'info' | 'success' | 'error';
|
|
205
|
+
/**
|
|
206
|
+
* Built-in surface color names intended for backgrounds, layers, and outlines.
|
|
207
|
+
*
|
|
208
|
+
* @category Color
|
|
209
|
+
*/
|
|
210
|
+
export type CoreSurfaceColor = 'surface' | 'surfaceVariant' | 'background' | 'inverseSurface' | 'surfaceContainerLowest' | 'surfaceContainerLow' | 'surfaceContainer' | 'surfaceContainerHigh' | 'surfaceContainerHighest' | 'surfaceBright' | 'surfaceDim' | 'black' | 'white';
|
|
211
|
+
export type CoreBorderColor = 'outline' | 'outlineVariant';
|
|
212
|
+
/**
|
|
213
|
+
* Built-in technical color names not intended for direct usage.
|
|
214
|
+
*
|
|
215
|
+
* @category Color
|
|
216
|
+
*/
|
|
217
|
+
export type CoreThemeColor = 'onSurface' | 'onSurfaceVariant' | 'onBackground' | 'inverseOnSurface' | 'inversePrimary' | 'surfaceTint' | 'scrim' | 'shadow';
|
|
218
|
+
/**
|
|
219
|
+
* Augmentation point for custom semantic colors.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* declare module '@ufoui/core' {
|
|
223
|
+
* interface CustomColors {
|
|
224
|
+
* myBlue: true;
|
|
225
|
+
* }
|
|
226
|
+
* }
|
|
227
|
+
*
|
|
228
|
+
* @category Color
|
|
229
|
+
*/
|
|
230
|
+
export interface CustomColors {
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Custom semantic color token keys registered via {@link CustomColors}.
|
|
234
|
+
*
|
|
235
|
+
* @category Color
|
|
236
|
+
*/
|
|
237
|
+
export type CustomColorKey = Extract<keyof CustomColors, string>;
|
|
238
|
+
/**
|
|
239
|
+
* Base semantic color (core + augmented).
|
|
240
|
+
*
|
|
241
|
+
* @category Color
|
|
242
|
+
*/
|
|
243
|
+
export type SemanticBaseColor = CoreSemanticColor | CustomColorKey;
|
|
244
|
+
/**
|
|
245
|
+
* Builds `on*` color name.
|
|
246
|
+
*
|
|
247
|
+
* @category Color
|
|
248
|
+
*/
|
|
249
|
+
export type OnColor<T extends string> = `on${Capitalize<T>}`;
|
|
250
|
+
/**
|
|
251
|
+
* Semantic color used in component APIs.
|
|
252
|
+
*
|
|
253
|
+
* @category Color
|
|
254
|
+
*/
|
|
255
|
+
export type SemanticColor = SemanticBaseColor;
|
|
256
|
+
/**
|
|
257
|
+
* Extended semantic colors.
|
|
258
|
+
*
|
|
259
|
+
* @category Color
|
|
260
|
+
*/
|
|
261
|
+
export type ExtendedColor = `${SemanticBaseColor}Container` | `${SemanticBaseColor}Fixed` | `${SemanticBaseColor}FixedDim`;
|
|
262
|
+
/**
|
|
263
|
+
* `on*` counterparts for extended colors.
|
|
264
|
+
*
|
|
265
|
+
* @category Color
|
|
266
|
+
*/
|
|
267
|
+
export type OnExtendedColor = OnColor<`${SemanticBaseColor}Container`> | OnColor<`${SemanticBaseColor}Fixed`> | OnColor<`${SemanticBaseColor}FixedVariant`>;
|
|
268
|
+
/**
|
|
269
|
+
* Surface colors.
|
|
270
|
+
*
|
|
271
|
+
* @category Color
|
|
272
|
+
*/
|
|
273
|
+
export type SurfaceColor = CoreSurfaceColor | ExtendedColor;
|
|
274
|
+
/**
|
|
275
|
+
* Colors allowed in component props.
|
|
276
|
+
*
|
|
277
|
+
* @category Color
|
|
278
|
+
*/
|
|
279
|
+
export type BaseColor = SemanticColor | SurfaceColor;
|
|
280
|
+
/**
|
|
281
|
+
* Border color.
|
|
282
|
+
*
|
|
283
|
+
* @category Color
|
|
284
|
+
*/
|
|
285
|
+
export type BorderColor = BaseColor | CoreBorderColor;
|
|
286
|
+
/**
|
|
287
|
+
* Full theme color set.
|
|
288
|
+
*
|
|
289
|
+
* @category Color
|
|
290
|
+
*/
|
|
291
|
+
export type ThemeColor = BorderColor | OnColor<SemanticBaseColor> | OnExtendedColor | CoreThemeColor;
|
|
292
|
+
/**
|
|
293
|
+
* Input color map used to seed/generate theme schemes.
|
|
294
|
+
*
|
|
295
|
+
* @remarks
|
|
296
|
+
* Accepts only semantic base color keys (core + augmented via {@link CustomColors}).
|
|
297
|
+
*
|
|
298
|
+
* @category Theme
|
|
299
|
+
*/
|
|
300
|
+
export type ThemeCustomColors = Partial<Record<SemanticBaseColor, string>>;
|
package/types/dialog.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MotionAnimation } from './motion';
|
|
2
1
|
/**
|
|
3
2
|
* Layout mode for the DialogBase component.
|
|
4
3
|
*
|
|
@@ -11,16 +10,6 @@ import { MotionAnimation } from './motion';
|
|
|
11
10
|
* @category Dialog
|
|
12
11
|
*/
|
|
13
12
|
export type DialogType = 'basic' | 'fullscreen' | 'dockRight' | 'dockLeft' | 'dockTop' | 'dockBottom';
|
|
14
|
-
/**
|
|
15
|
-
* Animation preset for open and close transitions.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Use `'none'` to disable motion. Otherwise uses a {@link MotionAnimation} value.
|
|
19
|
-
* When omitted, a default animation is chosen for the current layout mode.
|
|
20
|
-
*
|
|
21
|
-
* @category Dialog
|
|
22
|
-
*/
|
|
23
|
-
export type DialogAnimation = 'none' | MotionAnimation;
|
|
24
13
|
/**
|
|
25
14
|
* Icon slot within dialog layout.
|
|
26
15
|
*
|
package/types/fonts.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines built-in typography tokens available in the design system.
|
|
3
|
+
*
|
|
4
|
+
* @category Theme
|
|
5
|
+
*/
|
|
6
|
+
export type CoreFont = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall' | 'caption' | 'overline';
|
|
7
|
+
/**
|
|
8
|
+
* Optional custom typography tokens added via module augmentation.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* declare module '@ufoui/core' {
|
|
12
|
+
* interface CustomFonts {
|
|
13
|
+
* promoFont: true;
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* @category Theme
|
|
18
|
+
*/
|
|
19
|
+
export interface CustomFonts {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Custom typography token keys registered via {@link CustomFonts}.
|
|
23
|
+
*
|
|
24
|
+
* @category Theme
|
|
25
|
+
*/
|
|
26
|
+
export type CustomFontKey = Extract<keyof CustomFonts, string>;
|
|
27
|
+
/**
|
|
28
|
+
* All theme typography tokens (core + custom).
|
|
29
|
+
*
|
|
30
|
+
* @category Theme
|
|
31
|
+
*/
|
|
32
|
+
export type ThemeFont = CoreFont | CustomFontKey;
|
|
33
|
+
/**
|
|
34
|
+
* Typography token accepted by component-level `font` props.
|
|
35
|
+
*
|
|
36
|
+
* @category Theme
|
|
37
|
+
*/
|
|
38
|
+
export type ElementFont = ThemeFont;
|
|
39
|
+
/**
|
|
40
|
+
* Full font class map keyed by typography token names.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Includes core and custom typography keys, while also allowing additional string keys.
|
|
44
|
+
*
|
|
45
|
+
* @category Theme
|
|
46
|
+
*/
|
|
47
|
+
export type ThemeFonts = Partial<Record<ThemeFont, string>> & Record<string, string>;
|
|
48
|
+
/**
|
|
49
|
+
* Partial variant of {@link ThemeFonts}, allowing selective overrides.
|
|
50
|
+
*
|
|
51
|
+
* @category Theme
|
|
52
|
+
*/
|
|
53
|
+
export type PartialThemeFonts = Partial<Record<ThemeFont, string>> & Record<string, string | undefined>;
|
package/types/index.d.ts
CHANGED
package/types/motion.d.ts
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export declare const motionClassMap: {
|
|
2
|
+
fade: string;
|
|
3
|
+
fadeBlur: string;
|
|
4
|
+
scale: string;
|
|
5
|
+
scaleBlur: string;
|
|
6
|
+
popup: string;
|
|
7
|
+
slideUp: string;
|
|
8
|
+
slideDown: string;
|
|
9
|
+
slideLeft: string;
|
|
10
|
+
slideRight: string;
|
|
11
|
+
slideUpBlur: string;
|
|
12
|
+
slideDownBlur: string;
|
|
13
|
+
slideLeftBlur: string;
|
|
14
|
+
slideRightBlur: string;
|
|
15
|
+
rotate: string;
|
|
16
|
+
rotateUpRight: string;
|
|
17
|
+
rotateUpLeft: string;
|
|
18
|
+
rollLeft: string;
|
|
19
|
+
rollRight: string;
|
|
20
|
+
flipX: string;
|
|
21
|
+
flipY: string;
|
|
22
|
+
bounce: string;
|
|
23
|
+
squish: string;
|
|
24
|
+
rubber: string;
|
|
25
|
+
popElastic: string;
|
|
26
|
+
jelly: string;
|
|
27
|
+
none: string;
|
|
28
|
+
};
|
|
29
|
+
export type MotionAnimation = keyof typeof motionClassMap;
|
|
3
30
|
/**
|
|
4
31
|
* Returns CSS class name for given motion animation.
|
|
5
32
|
* Returns empty string when animation is not defined or set to 'none'.
|
|
6
33
|
*/
|
|
7
|
-
export declare function getAnimationClass(animation?: MotionAnimation
|
|
34
|
+
export declare function getAnimationClass(animation?: MotionAnimation): string;
|
|
8
35
|
/**
|
|
9
|
-
* Returns list of available motion animation names
|
|
36
|
+
* Returns list of available motion animation names, excluding `'none'`.
|
|
10
37
|
*/
|
|
11
38
|
export declare function getAnimationList(): MotionAnimation[];
|
|
12
39
|
export type MotionStyle = 'regular' | 'expressive';
|
package/types/theme.d.ts
CHANGED
|
@@ -1,207 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Based on the Material Design 3 palette structure with custom extensions
|
|
5
|
-
* for semantic and system colors (e.g. info, success, warning).
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* Provides the canonical source for all `--uui-color-*` tokens in both light and dark modes.
|
|
9
|
-
*
|
|
10
|
-
* @category Theme
|
|
11
|
-
*/
|
|
12
|
-
export interface ThemeScheme {
|
|
13
|
-
/** Primary brand color used for main UI elements. */
|
|
14
|
-
primary: string;
|
|
15
|
-
/** Foreground color displayed on primary. */
|
|
16
|
-
onPrimary: string;
|
|
17
|
-
/** Container background for primary content. */
|
|
18
|
-
primaryContainer: string;
|
|
19
|
-
/** Foreground color on primary container. */
|
|
20
|
-
onPrimaryContainer: string;
|
|
21
|
-
/** Fixed version of primary for consistent tone. */
|
|
22
|
-
primaryFixed: string;
|
|
23
|
-
/** Foreground color on primaryFixed. */
|
|
24
|
-
onPrimaryFixed: string;
|
|
25
|
-
/** Dimmed tone of primaryFixed. */
|
|
26
|
-
primaryFixedDim: string;
|
|
27
|
-
/** Variant tone for content on primaryFixedDim. */
|
|
28
|
-
onPrimaryFixedVariant: string;
|
|
29
|
-
/** Secondary color for less prominent accents. */
|
|
30
|
-
secondary: string;
|
|
31
|
-
/** Foreground color on secondary. */
|
|
32
|
-
onSecondary: string;
|
|
33
|
-
/** Background container using secondary tone. */
|
|
34
|
-
secondaryContainer: string;
|
|
35
|
-
/** Foreground color on secondary container. */
|
|
36
|
-
onSecondaryContainer: string;
|
|
37
|
-
/** Fixed version of secondary tone. */
|
|
38
|
-
secondaryFixed: string;
|
|
39
|
-
/** Foreground color on secondaryFixed. */
|
|
40
|
-
onSecondaryFixed: string;
|
|
41
|
-
/** Dimmed version of secondaryFixed. */
|
|
42
|
-
secondaryFixedDim: string;
|
|
43
|
-
/** Variant tone for content on secondaryFixedDim. */
|
|
44
|
-
onSecondaryFixedVariant: string;
|
|
45
|
-
/** Tertiary color for decorative or alternative accents. */
|
|
46
|
-
tertiary: string;
|
|
47
|
-
/** Foreground color on tertiary. */
|
|
48
|
-
onTertiary: string;
|
|
49
|
-
/** Background container using tertiary tone. */
|
|
50
|
-
tertiaryContainer: string;
|
|
51
|
-
/** Foreground color on tertiary container. */
|
|
52
|
-
onTertiaryContainer: string;
|
|
53
|
-
/** Fixed version of tertiary tone. */
|
|
54
|
-
tertiaryFixed: string;
|
|
55
|
-
/** Foreground color on tertiaryFixed. */
|
|
56
|
-
onTertiaryFixed: string;
|
|
57
|
-
/** Dimmed version of tertiaryFixed. */
|
|
58
|
-
tertiaryFixedDim: string;
|
|
59
|
-
/** Variant tone for content on tertiaryFixedDim. */
|
|
60
|
-
onTertiaryFixedVariant: string;
|
|
61
|
-
/** Warning tone for alerts or cautions. */
|
|
62
|
-
warning: string;
|
|
63
|
-
/** Foreground color on warning. */
|
|
64
|
-
onWarning: string;
|
|
65
|
-
/** Container color for warning messages. */
|
|
66
|
-
warningContainer: string;
|
|
67
|
-
/** Foreground color on warning container. */
|
|
68
|
-
onWarningContainer: string;
|
|
69
|
-
/** Fixed warning tone. */
|
|
70
|
-
warningFixed: string;
|
|
71
|
-
/** Foreground color on warningFixed. */
|
|
72
|
-
onWarningFixed: string;
|
|
73
|
-
/** Dimmed warningFixed variant. */
|
|
74
|
-
warningFixedDim: string;
|
|
75
|
-
/** Variant foreground color for dimmed warning. */
|
|
76
|
-
onWarningFixedVariant: string;
|
|
77
|
-
/** Informational tone for neutral messages. */
|
|
78
|
-
info: string;
|
|
79
|
-
/** Foreground color on info. */
|
|
80
|
-
onInfo: string;
|
|
81
|
-
/** Container background for info tone. */
|
|
82
|
-
infoContainer: string;
|
|
83
|
-
/** Foreground color on info container. */
|
|
84
|
-
onInfoContainer: string;
|
|
85
|
-
/** Fixed tone for info. */
|
|
86
|
-
infoFixed: string;
|
|
87
|
-
/** Foreground color on infoFixed. */
|
|
88
|
-
onInfoFixed: string;
|
|
89
|
-
/** Dimmed infoFixed variant. */
|
|
90
|
-
infoFixedDim: string;
|
|
91
|
-
/** Variant foreground color for dimmed info. */
|
|
92
|
-
onInfoFixedVariant: string;
|
|
93
|
-
/** Success tone for positive feedback. */
|
|
94
|
-
success: string;
|
|
95
|
-
/** Foreground color on success. */
|
|
96
|
-
onSuccess: string;
|
|
97
|
-
/** Container background for success tone. */
|
|
98
|
-
successContainer: string;
|
|
99
|
-
/** Foreground color on success container. */
|
|
100
|
-
onSuccessContainer: string;
|
|
101
|
-
/** Fixed success tone. */
|
|
102
|
-
successFixed: string;
|
|
103
|
-
/** Foreground color on successFixed. */
|
|
104
|
-
onSuccessFixed: string;
|
|
105
|
-
/** Dimmed successFixed variant. */
|
|
106
|
-
successFixedDim: string;
|
|
107
|
-
/** Variant foreground color for dimmed success. */
|
|
108
|
-
onSuccessFixedVariant: string;
|
|
109
|
-
/** Error tone for destructive actions or validation. */
|
|
110
|
-
error: string;
|
|
111
|
-
/** Foreground color on error. */
|
|
112
|
-
onError: string;
|
|
113
|
-
/** Container background for error tone. */
|
|
114
|
-
errorContainer: string;
|
|
115
|
-
/** Foreground color on error container. */
|
|
116
|
-
onErrorContainer: string;
|
|
117
|
-
/** Fixed error tone. */
|
|
118
|
-
errorFixed: string;
|
|
119
|
-
/** Foreground color on errorFixed. */
|
|
120
|
-
onErrorFixed: string;
|
|
121
|
-
/** Dimmed errorFixed variant. */
|
|
122
|
-
errorFixedDim: string;
|
|
123
|
-
/** Variant foreground color for dimmed error. */
|
|
124
|
-
onErrorFixedVariant: string;
|
|
125
|
-
/** Border and divider color. */
|
|
126
|
-
outline: string;
|
|
127
|
-
/** Secondary outline tone. */
|
|
128
|
-
outlineVariant: string;
|
|
129
|
-
/** Default surface background color. */
|
|
130
|
-
surface: string;
|
|
131
|
-
/** Foreground color on surface. */
|
|
132
|
-
onSurface: string;
|
|
133
|
-
/** Variant background tone for surfaces. */
|
|
134
|
-
surfaceVariant: string;
|
|
135
|
-
/** Foreground color on surfaceVariant. */
|
|
136
|
-
onSurfaceVariant: string;
|
|
137
|
-
/** UI background color. */
|
|
138
|
-
background: string;
|
|
139
|
-
/** Foreground color on background. */
|
|
140
|
-
onBackground: string;
|
|
141
|
-
/** Inverse surface tone (e.g. for bottom navs). */
|
|
142
|
-
inverseSurface: string;
|
|
143
|
-
/** Foreground color on inverse surface. */
|
|
144
|
-
inverseOnSurface: string;
|
|
145
|
-
/** Primary accent used on inverse surfaces. */
|
|
146
|
-
inversePrimary: string;
|
|
147
|
-
/** Color used for shadows and elevation. */
|
|
148
|
-
shadow: string;
|
|
149
|
-
/** Tint overlay for elevated components. */
|
|
150
|
-
surfaceTint: string;
|
|
151
|
-
/** Overlay color for modals, drawers, etc. */
|
|
152
|
-
scrim: string;
|
|
153
|
-
/** Surface tone for highest-level containers. */
|
|
154
|
-
surfaceContainerHighest: string;
|
|
155
|
-
/** Surface tone for high elevation containers. */
|
|
156
|
-
surfaceContainerHigh: string;
|
|
157
|
-
/** Base tone for standard surface containers. */
|
|
158
|
-
surfaceContainer: string;
|
|
159
|
-
/** Surface tone for low elevation containers. */
|
|
160
|
-
surfaceContainerLow: string;
|
|
161
|
-
/** Surface tone for lowest elevation containers. */
|
|
162
|
-
surfaceContainerLowest: string;
|
|
163
|
-
/** Brightest surface tone variant. */
|
|
164
|
-
surfaceBright: string;
|
|
165
|
-
/** Dimmed surface tone variant. */
|
|
166
|
-
surfaceDim: string;
|
|
167
|
-
/** Pure black color used for contrast or background. */
|
|
168
|
-
black: string;
|
|
169
|
-
/** Pure white color used for contrast or foreground. */
|
|
170
|
-
white: string;
|
|
171
|
-
/** Allows for additional custom tokens. */
|
|
172
|
-
[key: string]: string;
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* A partial version of {@link ThemeScheme}, used for theme overrides
|
|
176
|
-
* or gradual, progressive theming updates.
|
|
177
|
-
*
|
|
178
|
-
* @remarks
|
|
179
|
-
* Useful when defining incomplete color sets (e.g. custom brand palettes).
|
|
180
|
-
*
|
|
181
|
-
* @category Theme
|
|
182
|
-
*/
|
|
183
|
-
export type PartialThemeScheme = Partial<ThemeScheme>;
|
|
184
|
-
/**
|
|
185
|
-
* Collection of named color schemes (e.g. light, dark, high-contrast).
|
|
186
|
-
* Used to organize multiple theme modes within a design system.
|
|
187
|
-
*
|
|
188
|
-
* @category Theme
|
|
189
|
-
*/
|
|
190
|
-
export interface ThemeSchemes {
|
|
191
|
-
/** Light mode color scheme. */
|
|
192
|
-
light: PartialThemeScheme;
|
|
193
|
-
/** Dark mode color scheme. */
|
|
194
|
-
dark: PartialThemeScheme;
|
|
195
|
-
/** Additional custom schemes such as high-contrast or sepia. */
|
|
196
|
-
[key: string]: PartialThemeScheme;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Partial variant of {@link ThemeSchemes}, allowing selective definition
|
|
200
|
-
* of available color modes.
|
|
201
|
-
*
|
|
202
|
-
* @category Theme
|
|
203
|
-
*/
|
|
204
|
-
export type PartialThemeSchemes = Partial<ThemeSchemes>;
|
|
1
|
+
import { ThemeBreakpoints } from './breakpoints';
|
|
2
|
+
import { ThemeFonts } from './fonts';
|
|
3
|
+
import { ThemeColorSchemes } from './color';
|
|
205
4
|
/**
|
|
206
5
|
* Defines the overall theme configuration, including
|
|
207
6
|
* the active mode and all available color schemes.
|
|
@@ -212,5 +11,9 @@ export interface Theme {
|
|
|
212
11
|
/** Indicates whether dark mode is currently active. */
|
|
213
12
|
darkMode: boolean;
|
|
214
13
|
/** Collection of all available color schemes. */
|
|
215
|
-
schemes:
|
|
14
|
+
schemes: ThemeColorSchemes;
|
|
15
|
+
/** Responsive breakpoint tokens. */
|
|
16
|
+
breakpoints: ThemeBreakpoints;
|
|
17
|
+
/** Font class map keyed by theme font token name. */
|
|
18
|
+
fonts: ThemeFonts;
|
|
216
19
|
}
|