@ufoui/core 0.0.12 → 0.0.58
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/icons.d.ts +5 -2
- package/components/accordion/accordion.d.ts +2 -2
- package/components/avatar/avatar.d.ts +2 -2
- package/components/badge/badge.d.ts +2 -2
- package/components/base/boxBase.d.ts +4 -4
- package/components/base/buttonBase.d.ts +5 -5
- package/components/base/checkboxBase.d.ts +2 -2
- package/components/base/dialogBase.d.ts +105 -9
- package/components/base/fieldBase.d.ts +1 -1
- package/components/card/card.d.ts +78 -13
- package/components/dialogs/dialogActions.d.ts +19 -7
- package/components/dialogs/dialogActions.guards.d.ts +15 -0
- package/components/dialogs/dialogContent.d.ts +7 -1
- package/components/dialogs/dialogHeader.d.ts +60 -0
- package/components/dialogs/dialogTitle.d.ts +9 -5
- package/components/dialogs/index.d.ts +1 -0
- package/components/link/link.d.ts +13 -14
- package/components/menu/menu.d.ts +2 -2
- package/components/rating/rating.d.ts +2 -2
- package/components/switch/switch.d.ts +2 -2
- package/components/themeProvider/themeProvider.d.ts +20 -15
- package/components/toolbar/toolbar.d.ts +1 -1
- package/components/tooltip/tooltip.d.ts +2 -2
- package/hooks/index.d.ts +1 -0
- package/hooks/useResponsive.d.ts +60 -0
- package/hooks/useTheme.d.ts +1 -1
- package/index.css +1 -1
- package/index.js +3186 -3023
- package/internal/icon/icon.d.ts +28 -0
- package/internal/index.d.ts +1 -0
- package/internal/inlineTooltip/inlineTooltipManager.d.ts +3 -3
- package/internal/slots/slot.d.ts +1 -1
- package/package.json +1 -1
- package/types/breakpoints.d.ts +38 -0
- package/types/color.d.ts +299 -0
- package/types/dialog.d.ts +37 -0
- package/types/fonts.d.ts +53 -0
- package/types/index.d.ts +4 -0
- package/types/motion.d.ts +2 -2
- package/types/theme.d.ts +8 -235
- package/utils/applyThemeColors.d.ts +10 -0
- 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/calculateFloatingPosition.d.ts +3 -3
- package/utils/color.d.ts +14 -153
- package/utils/colorRegistry.d.ts +37 -0
- package/utils/controlStyle.d.ts +8 -8
- package/utils/createRipple.d.ts +17 -0
- package/utils/flatChildren.d.ts +17 -0
- package/utils/fontRegistry.d.ts +29 -0
- package/utils/generateMaterialColors.d.ts +9 -12
- package/utils/index.d.ts +9 -1
- package/utils/mergeOverrides.d.ts +13 -0
- package/utils/renderPortal.d.ts +30 -0
- package/utils/utils.d.ts +3 -25
- package/utils/generateSchemes.d.ts +0 -32
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SurfaceColor } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link Icon} wrapper.
|
|
5
|
+
*
|
|
6
|
+
* @category Internal components
|
|
7
|
+
*/
|
|
8
|
+
export interface IconProps {
|
|
9
|
+
/** Icon graphic or element rendered inside the wrapper. */
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
/** Additional class names merged with the base `uui-icon` token. */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Theme surface token as CSS `color` (for `currentColor` SVG). */
|
|
14
|
+
color?: SurfaceColor;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders icon content with the shared `uui-icon` layout class.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
* @function
|
|
21
|
+
* @param props Component properties.
|
|
22
|
+
*
|
|
23
|
+
* @category Internal components
|
|
24
|
+
*/
|
|
25
|
+
export declare const Icon: {
|
|
26
|
+
({ icon, className, color }: IconProps): import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
package/internal/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { default as React, HTMLProps, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ElementPlacement } from '../../utils';
|
|
3
3
|
interface InlineTooltipManagerProps extends HTMLProps<HTMLSpanElement> {
|
|
4
4
|
triggerRef: React.RefObject<HTMLElement>;
|
|
5
5
|
tooltip: ReactElement;
|
|
6
|
-
align:
|
|
6
|
+
align: ElementPlacement;
|
|
7
7
|
}
|
|
8
8
|
export declare const InlineTooltipManager: {
|
|
9
|
-
({ tooltip, align, triggerRef }: InlineTooltipManagerProps): React.ReactPortal;
|
|
9
|
+
({ tooltip, align, triggerRef }: InlineTooltipManagerProps): React.ReactPortal | null;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
export {};
|
package/internal/slots/slot.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ interface SlotProps {
|
|
|
22
22
|
*
|
|
23
23
|
* @category Slot
|
|
24
24
|
*/
|
|
25
|
-
export declare const Slot: ({ start, end, content, className }: SlotProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const Slot: ({ start, end, content, className }: SlotProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
26
26
|
/**
|
|
27
27
|
* Slot wrapper for leading content.
|
|
28
28
|
*
|
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,299 @@
|
|
|
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' | 'outline' | 'outlineVariant' | 'surfaceContainerLowest' | 'surfaceContainerLow' | 'surfaceContainer' | 'surfaceContainerHigh' | 'surfaceContainerHighest' | 'surfaceBright' | 'surfaceDim';
|
|
211
|
+
/**
|
|
212
|
+
* Built-in technical color names not intended for direct usage.
|
|
213
|
+
*
|
|
214
|
+
* @category Color
|
|
215
|
+
*/
|
|
216
|
+
export type CoreThemeColor = 'onSurface' | 'onSurfaceVariant' | 'onBackground' | 'inverseOnSurface' | 'inversePrimary' | 'surfaceTint' | 'scrim' | 'shadow' | 'black' | 'white';
|
|
217
|
+
/**
|
|
218
|
+
* Augmentation point for custom semantic colors.
|
|
219
|
+
*
|
|
220
|
+
* @example
|
|
221
|
+
* declare module '@ufoui/core' {
|
|
222
|
+
* interface CustomColors {
|
|
223
|
+
* myBlue: true;
|
|
224
|
+
* }
|
|
225
|
+
* }
|
|
226
|
+
*
|
|
227
|
+
* @category Color
|
|
228
|
+
*/
|
|
229
|
+
export interface CustomColors {
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Custom semantic color token keys registered via {@link CustomColors}.
|
|
233
|
+
*
|
|
234
|
+
* @category Color
|
|
235
|
+
*/
|
|
236
|
+
export type CustomColorKey = Extract<keyof CustomColors, string>;
|
|
237
|
+
/**
|
|
238
|
+
* Base semantic color (core + augmented).
|
|
239
|
+
*
|
|
240
|
+
* @category Color
|
|
241
|
+
*/
|
|
242
|
+
export type SemanticBaseColor = CoreSemanticColor | CustomColorKey;
|
|
243
|
+
/**
|
|
244
|
+
* Builds `on*` color name.
|
|
245
|
+
*
|
|
246
|
+
* @category Color
|
|
247
|
+
*/
|
|
248
|
+
export type OnColor<T extends string> = `on${Capitalize<T>}`;
|
|
249
|
+
/**
|
|
250
|
+
* Semantic color used in component APIs.
|
|
251
|
+
*
|
|
252
|
+
* @category Color
|
|
253
|
+
*/
|
|
254
|
+
export type SemanticColor = SemanticBaseColor;
|
|
255
|
+
/**
|
|
256
|
+
* Extended semantic colors.
|
|
257
|
+
*
|
|
258
|
+
* @category Color
|
|
259
|
+
*/
|
|
260
|
+
export type ExtendedColor = `${SemanticBaseColor}Container` | `${SemanticBaseColor}Fixed` | `${SemanticBaseColor}FixedDim`;
|
|
261
|
+
/**
|
|
262
|
+
* `on*` counterparts for extended colors.
|
|
263
|
+
*
|
|
264
|
+
* @category Color
|
|
265
|
+
*/
|
|
266
|
+
export type OnExtendedColor = OnColor<`${SemanticBaseColor}Container`> | OnColor<`${SemanticBaseColor}Fixed`> | OnColor<`${SemanticBaseColor}FixedVariant`>;
|
|
267
|
+
/**
|
|
268
|
+
* Surface colors.
|
|
269
|
+
*
|
|
270
|
+
* @category Color
|
|
271
|
+
*/
|
|
272
|
+
export type SurfaceColor = CoreSurfaceColor | ExtendedColor;
|
|
273
|
+
/**
|
|
274
|
+
* Colors allowed in component props.
|
|
275
|
+
*
|
|
276
|
+
* @category Color
|
|
277
|
+
*/
|
|
278
|
+
export type BaseColor = SemanticColor | SurfaceColor;
|
|
279
|
+
/**
|
|
280
|
+
* Full theme color set.
|
|
281
|
+
*
|
|
282
|
+
* @category Color
|
|
283
|
+
*/
|
|
284
|
+
export type ThemeColor = BaseColor | OnColor<SemanticBaseColor> | OnExtendedColor | CoreThemeColor;
|
|
285
|
+
/**
|
|
286
|
+
* Border color.
|
|
287
|
+
*
|
|
288
|
+
* @category Color
|
|
289
|
+
*/
|
|
290
|
+
export type BorderColor = BaseColor;
|
|
291
|
+
/**
|
|
292
|
+
* Input color map used to seed/generate theme schemes.
|
|
293
|
+
*
|
|
294
|
+
* @remarks
|
|
295
|
+
* Accepts only semantic base color keys (core + augmented via {@link CustomColors}).
|
|
296
|
+
*
|
|
297
|
+
* @category Theme
|
|
298
|
+
*/
|
|
299
|
+
export type ThemeCustomColors = Partial<Record<SemanticBaseColor, string>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MotionAnimation } from './motion';
|
|
2
|
+
/**
|
|
3
|
+
* Layout mode for the DialogBase component.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Determines dialog placement and sizing:
|
|
7
|
+
* - `'basic'` - centered dialog
|
|
8
|
+
* - `'fullscreen'` - full viewport
|
|
9
|
+
* - `'dockLeft'` / `'dockRight'` / `'dockTop'` / `'dockBottom'` - edge-docked panels
|
|
10
|
+
*
|
|
11
|
+
* @category Dialog
|
|
12
|
+
*/
|
|
13
|
+
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
|
+
/**
|
|
25
|
+
* Icon slot within dialog layout.
|
|
26
|
+
*
|
|
27
|
+
* Defines where the icon is rendered inside the dialog structure.
|
|
28
|
+
*
|
|
29
|
+
* Slots:
|
|
30
|
+
* - **leading** – inline with the title
|
|
31
|
+
* - **top** – placed above the title in the header
|
|
32
|
+
* - **contentLeft** – placed on the left side of the content area
|
|
33
|
+
* - **contentRight** – placed on the right side of the content area
|
|
34
|
+
*
|
|
35
|
+
* @category Dialog
|
|
36
|
+
*/
|
|
37
|
+
export type DialogIconSlot = 'leading' | 'top' | 'contentLeft' | 'contentRight';
|
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
|
@@ -2,9 +2,9 @@ export type MotionAnimation = 'fade' | 'fadeBlur' | 'scale' | 'scaleBlur' | 'pop
|
|
|
2
2
|
export declare const motionClassMap: Record<MotionAnimation, string>;
|
|
3
3
|
/**
|
|
4
4
|
* Returns CSS class name for given motion animation.
|
|
5
|
-
* Returns empty string when animation is not defined.
|
|
5
|
+
* Returns empty string when animation is not defined or set to 'none'.
|
|
6
6
|
*/
|
|
7
|
-
export declare function getAnimationClass(animation?: MotionAnimation): string;
|
|
7
|
+
export declare function getAnimationClass(animation?: MotionAnimation | 'none'): string;
|
|
8
8
|
/**
|
|
9
9
|
* Returns list of available motion animation names.
|
|
10
10
|
*/
|