@ufoui/core 0.0.1

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.
Files changed (83) hide show
  1. package/LICENSE +150 -0
  2. package/README.md +37 -0
  3. package/TRADEMARK.md +10 -0
  4. package/components/article/article.d.ts +25 -0
  5. package/components/aside/aside.d.ts +27 -0
  6. package/components/avatar/avatar.d.ts +35 -0
  7. package/components/badge/badge.d.ts +57 -0
  8. package/components/base/boxBase/boxBase.d.ts +126 -0
  9. package/components/base/buttonBase/buttonBase.d.ts +126 -0
  10. package/components/base/checkboxBase/checkboxBase.d.ts +124 -0
  11. package/components/base/dialogBase/dialog.d.ts +35 -0
  12. package/components/base/fieldBase/fieldBase.d.ts +50 -0
  13. package/components/base/inlineBase/inlineBase.d.ts +62 -0
  14. package/components/button/button.d.ts +24 -0
  15. package/components/card/card.d.ts +15 -0
  16. package/components/checkbox/checkbox.d.ts +31 -0
  17. package/components/chip/chip.d.ts +7 -0
  18. package/components/content/content.d.ts +28 -0
  19. package/components/dateInput/dateInput.d.ts +2 -0
  20. package/components/dateTimeInput/dateTimeInput.d.ts +2 -0
  21. package/components/dialog/dialogActions.d.ts +15 -0
  22. package/components/dialog/dialogContent.d.ts +9 -0
  23. package/components/dialog/dialogTitle.d.ts +16 -0
  24. package/components/div/div.d.ts +29 -0
  25. package/components/divider/divider.d.ts +70 -0
  26. package/components/divider/divider.guards.d.ts +15 -0
  27. package/components/emailInput/emailInput.d.ts +2 -0
  28. package/components/fab/fab.d.ts +29 -0
  29. package/components/fieldset/fieldset.d.ts +45 -0
  30. package/components/flex/flex.d.ts +36 -0
  31. package/components/footer/footer.d.ts +27 -0
  32. package/components/grid/grid.d.ts +38 -0
  33. package/components/header/header.d.ts +27 -0
  34. package/components/iconButton/iconButton.d.ts +27 -0
  35. package/components/listItem/listItem.d.ts +179 -0
  36. package/components/listItem/listItem.guards.d.ts +15 -0
  37. package/components/main/main.d.ts +27 -0
  38. package/components/menu/menu.d.ts +177 -0
  39. package/components/menu/menu.guards.d.ts +15 -0
  40. package/components/menuItem/menuItem.d.ts +179 -0
  41. package/components/menuItem/menuItem.guards.d.ts +15 -0
  42. package/components/nav/nav.d.ts +27 -0
  43. package/components/numberInput/numberInput.d.ts +2 -0
  44. package/components/option/option.d.ts +6 -0
  45. package/components/option/option.guards.d.ts +16 -0
  46. package/components/radio/radio.d.ts +31 -0
  47. package/components/radiogroup/radioGroup.d.ts +47 -0
  48. package/components/section/section.d.ts +27 -0
  49. package/components/select/select.d.ts +32 -0
  50. package/components/spinner/spinner.d.ts +7 -0
  51. package/components/switch/switch.d.ts +102 -0
  52. package/components/telInput/telInput.d.ts +2 -0
  53. package/components/textField/textField.d.ts +9 -0
  54. package/components/themeProvider/themeProvider.d.ts +54 -0
  55. package/components/timeInput/timeInput.d.ts +2 -0
  56. package/components/toggleButton/toggleButton.d.ts +6 -0
  57. package/components/tooltip/tooltip.d.ts +8 -0
  58. package/components/urlInput/urlInput.d.ts +2 -0
  59. package/context/fieldsetContext.d.ts +22 -0
  60. package/context/radioGroupContext.d.ts +28 -0
  61. package/context/themeContext.d.ts +61 -0
  62. package/hooks/useAnimate.d.ts +55 -0
  63. package/hooks/useClickOutside.d.ts +36 -0
  64. package/hooks/useEscapeHandler.d.ts +1 -0
  65. package/hooks/useFocusState.d.ts +16 -0
  66. package/hooks/useFocusVisible.d.ts +20 -0
  67. package/hooks/useTheme.d.ts +12 -0
  68. package/index.css +1 -0
  69. package/index.d.ts +53 -0
  70. package/index.mjs +3300 -0
  71. package/internal/inlineTooltip/inlineTooltip.d.ts +11 -0
  72. package/internal/inlineTooltip/inlineTooltip2.d.ts +10 -0
  73. package/internal/inlineTooltip/inlineTooltipManager.d.ts +12 -0
  74. package/package.json +38 -0
  75. package/types/index.d.ts +2 -0
  76. package/types/motion.d.ts +17 -0
  77. package/types/theme.d.ts +246 -0
  78. package/utils/calculateFloatingPosition.d.ts +68 -0
  79. package/utils/color.d.ts +415 -0
  80. package/utils/generateMaterialColors.d.ts +31 -0
  81. package/utils/generateSchemes.d.ts +32 -0
  82. package/utils/inputhMethod.d.ts +17 -0
  83. package/utils/utils.d.ts +202 -0
@@ -0,0 +1,415 @@
1
+ import { default as React } from 'react';
2
+ import { ThemeExtendedColorKeys, ThemeSchemeKeys, ThemeSemanticColorKeys, ThemeSurfaceColorKeys } from '../components/types';
3
+ /**
4
+ * Represents a high-level semantic color token (e.g. `primary`, `error`, `success`).
5
+ * Derived from {@link ThemeSemanticColorKeys}.
6
+ * @category Color
7
+ */
8
+ export type SemanticColor = (typeof ThemeSemanticColorKeys)[number];
9
+ /**
10
+ * Represents tokens extending the {@link SemanticColor} set
11
+ * with additional container and fixed variants.
12
+ * Derived from {@link ThemeExtendedColorKeys}.
13
+ * @category Color
14
+ */
15
+ export type ExtendedColor = (typeof ThemeExtendedColorKeys)[number];
16
+ /**
17
+ * Represents surface-related color tokens extending {@link ExtendedColor},
18
+ * including background, outline, and container surface roles.
19
+ * Derived from {@link ThemeSurfaceColorKeys}.
20
+ * @category Color
21
+ */
22
+ export type SurfaceColor = (typeof ThemeSurfaceColorKeys)[number];
23
+ /**
24
+ * Represents any valid color token defined in the theme,
25
+ * including semantic, extended, and surface roles.
26
+ * Derived from {@link ThemeSchemeKeys}.
27
+ * @category Color
28
+ */
29
+ export type ThemeColor = (typeof ThemeSchemeKeys)[number];
30
+ /**
31
+ * Generates utility class names (`uui-*`) for a given **semantic color** and its variants.
32
+ *
33
+ * @remarks
34
+ * Produces `text`, `border`, and `background` class names for a semantic color and its
35
+ * derived tokens (`on`, `container`, `fixed`, `fixedDim`, etc.).
36
+ * If the provided key is invalid, `'primary'` is used as fallback.
37
+ *
38
+ * All class names follow the pattern `uui-{type}-{kebab-case-color}`.
39
+ *
40
+ * @param color - Semantic color name (e.g. `'primary'`, `'error'`, `'success'`).
41
+ * @returns Object with `uui-text-*`, `uui-border-*`, and `uui-bg-*` class names for all variants.
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * getSemanticColorClasses('primary');
46
+ * // → { textColor: 'uui-text-primary', bgOnColor: 'uui-bg-on-primary', ... }
47
+ * ```
48
+ * @category Color
49
+ */
50
+ export declare const getSemanticColorClasses: (color: SemanticColor) => {
51
+ textColor: string;
52
+ borderColor: string;
53
+ bgColor: string;
54
+ textOnColor: string;
55
+ borderOnColor: string;
56
+ bgOnColor: string;
57
+ textContainer: string;
58
+ borderContainer: string;
59
+ bgContainer: string;
60
+ textOnContainer: string;
61
+ borderOnContainer: string;
62
+ bgOnContainer: string;
63
+ textFixed: string;
64
+ borderFixed: string;
65
+ bgFixed: string;
66
+ textOnFixed: string;
67
+ borderOnFixed: string;
68
+ bgOnFixed: string;
69
+ textFixedDim: string;
70
+ borderFixedDim: string;
71
+ bgFixedDim: string;
72
+ textOnFixedVariant: string;
73
+ borderOnFixedVariant: string;
74
+ bgOnFixedVariant: string;
75
+ };
76
+ /**
77
+ * Bidirectional mapping between theme colors and their “on” counterparts.
78
+ *
79
+ * @remarks
80
+ * Provides both directions — e.g. `'surface' → 'onSurface'` and `'onSurface' → 'surface'` —
81
+ * for all semantic, extended, and surface tokens defined in {@link ThemeColor}.
82
+ * Enables consistent inverse lookups for text/background pairings.
83
+ *
84
+ * Commonly used by {@link getSurfaceColorClasses}.
85
+ *
86
+ * @category Color
87
+ */
88
+ export declare const inverseColorMap: {
89
+ readonly surface: "onSurface";
90
+ readonly surfaceVariant: "onSurfaceVariant";
91
+ readonly surfaceContainerLowest: "onSurface";
92
+ readonly surfaceContainerLow: "onSurface";
93
+ readonly surfaceContainer: "onSurface";
94
+ readonly surfaceContainerHigh: "onSurface";
95
+ readonly surfaceContainerHighest: "onSurface";
96
+ readonly surfaceDim: "onSurface";
97
+ readonly surfaceBright: "onSurface";
98
+ readonly background: "onBackground";
99
+ readonly inverseSurface: "inverseOnSurface";
100
+ readonly primary: "onPrimary";
101
+ readonly secondary: "onSecondary";
102
+ readonly tertiary: "onTertiary";
103
+ readonly warning: "onWarning";
104
+ readonly info: "onInfo";
105
+ readonly success: "onSuccess";
106
+ readonly error: "onError";
107
+ readonly primaryContainer: "onPrimaryContainer";
108
+ readonly primaryFixed: "onPrimaryFixed";
109
+ readonly primaryFixedDim: "onPrimaryFixedVariant";
110
+ readonly secondaryContainer: "onSecondaryContainer";
111
+ readonly secondaryFixed: "onSecondaryFixed";
112
+ readonly secondaryFixedDim: "onSecondaryFixedVariant";
113
+ readonly tertiaryContainer: "onTertiaryContainer";
114
+ readonly tertiaryFixed: "onTertiaryFixed";
115
+ readonly tertiaryFixedDim: "onTertiaryFixedVariant";
116
+ readonly warningContainer: "onWarningContainer";
117
+ readonly warningFixed: "onWarningFixed";
118
+ readonly warningFixedDim: "onWarningFixedVariant";
119
+ readonly infoContainer: "onInfoContainer";
120
+ readonly infoFixed: "onInfoFixed";
121
+ readonly infoFixedDim: "onInfoFixedVariant";
122
+ readonly successContainer: "onSuccessContainer";
123
+ readonly successFixed: "onSuccessFixed";
124
+ readonly successFixedDim: "onSuccessFixedVariant";
125
+ readonly errorContainer: "onErrorContainer";
126
+ readonly errorFixed: "onErrorFixed";
127
+ readonly errorFixedDim: "onErrorFixedVariant";
128
+ readonly outline: "surface";
129
+ readonly outlineVariant: "inverseSurface";
130
+ readonly inversePrimary: "onPrimaryContainer";
131
+ readonly black: "white";
132
+ readonly white: "black";
133
+ readonly onSurface: "surface";
134
+ readonly onSurfaceVariant: "surfaceVariant";
135
+ readonly onBackground: "background";
136
+ readonly inverseOnSurface: "inverseSurface";
137
+ readonly onPrimary: "primary";
138
+ readonly onSecondary: "secondary";
139
+ readonly onTertiary: "tertiary";
140
+ readonly onWarning: "warning";
141
+ readonly onInfo: "info";
142
+ readonly onSuccess: "success";
143
+ readonly onError: "error";
144
+ readonly onPrimaryContainer: "primaryContainer";
145
+ readonly onSecondaryContainer: "secondaryContainer";
146
+ readonly onTertiaryContainer: "tertiaryContainer";
147
+ readonly onWarningContainer: "warningContainer";
148
+ readonly onInfoContainer: "infoContainer";
149
+ readonly onSuccessContainer: "successContainer";
150
+ readonly onErrorContainer: "errorContainer";
151
+ };
152
+ /**
153
+ * Returns utility class names (`uui-*`) for a given surface color and its mapped “on” color.
154
+ *
155
+ * @remarks
156
+ * Uses the {@link inverseColorMap} to find the related “on” color
157
+ * (e.g. `'surfaceContainer'` → `'onSurface'`).
158
+ * Produces `text`, `border`, and `background` variants for both.
159
+ * All names are kebab-cased (e.g. `'surfaceContainerHigh'` → `'surface-container-high'`).
160
+ *
161
+ * @param color - Surface color key (e.g. `'surfaceContainerHigh'`).
162
+ * @returns Object with `uui-text-*`, `uui-border-*`, and `uui-bg-*` class names for base and on-color.
163
+ *
164
+ * @example
165
+ * ```ts
166
+ * getSurfaceColorClasses('surfaceContainer');
167
+ * // → { textColor: 'uui-text-surface-container', textOnColor: 'uui-text-on-surface', ... }
168
+ * ```
169
+ * @category Color
170
+ */
171
+ export declare const getSurfaceColorClasses: (color: SurfaceColor) => {
172
+ readonly textColor: `uui-text-${string}`;
173
+ readonly textOnColor: `uui-text-${string}`;
174
+ readonly borderColor: `uui-border-${string}`;
175
+ readonly borderOnColor: `uui-border-${string}`;
176
+ readonly bgColor: `uui-bg-${string}`;
177
+ readonly bgOnColor: `uui-bg-${string}`;
178
+ };
179
+ /**
180
+ * Returns utility class names (`uui-*`) for any theme color token.
181
+ *
182
+ * @remarks
183
+ * Generates `text`, `border`, and `background` class names based on the provided
184
+ * {@link ThemeColor}. If the color key is invalid, `'primary'` is used as fallback.
185
+ *
186
+ * @param color - Theme color token (e.g. `'primary'`, `'surfaceContainerHigh'`, `'error'`).
187
+ * @returns An object with `uui-text-*`, `uui-border-*`, and `uui-bg-*` class names.
188
+ *
189
+ * @example
190
+ * ```ts
191
+ * getColorClasses('error');
192
+ * // → { textColor: 'uui-text-error', borderColor: 'uui-border-error', bgColor: 'uui-bg-error' }
193
+ * ```
194
+ * @category Color
195
+ */
196
+ export declare const getColorClasses: (color: ThemeColor) => {
197
+ readonly textColor: `uui-text-${string}`;
198
+ readonly borderColor: `uui-border-${string}`;
199
+ readonly bgColor: `uui-bg-${string}`;
200
+ };
201
+ /**
202
+ * Represents the available border color options.
203
+ *
204
+ * @category Color
205
+ */
206
+ export type BorderColor = SurfaceColor;
207
+ /**
208
+ * Returns the appropriate border color class for a given configuration.
209
+ *
210
+ * @remarks
211
+ * Typical border colors are `'outline'` and `'outlineVariant'`, matching MD3 tokens.
212
+ * @param borderColor - Border color keyword or surface color token.
213
+ * @returns The resolved border color class (e.g. `'uui-border-surface-container-high'`).
214
+ *
215
+ * @example
216
+ * ```ts
217
+ * getBorderColorClass('surfaceContainer'); // → 'uui-border-surface-container'
218
+ * ```
219
+ * @category Color
220
+ */
221
+ export declare function getBorderColorClass(borderColor: BorderColor): `uui-border-${string}`;
222
+ /**
223
+ * Returns all CSS variable references for a **semantic color**.
224
+ *
225
+ * @remarks
226
+ * Generates `var(--uui-color-*)` tokens only for semantic colors
227
+ * defined in {@link SemanticColor} (e.g. `primary`, `error`, `success`).
228
+ * Useful for dynamic component theming and inline styles.
229
+ *
230
+ * @param color - Semantic color key (e.g. `'primary'`, `'error'`, `'info'`).
231
+ * @returns Object containing `var(--uui-color-...)` references for all variants.
232
+ *
233
+ * @example
234
+ * ```ts
235
+ * const vars = getSemanticColorVar('primary');
236
+ * // → "var(--uui-color-primary)", "var(--uui-color-on-primary)"
237
+ * ```
238
+ * @category Color
239
+ */
240
+ export declare const getSemanticColorVar: (color: SemanticColor) => {
241
+ color: string;
242
+ onColor: string;
243
+ container: string;
244
+ onContainer: string;
245
+ fixed: string;
246
+ fixedDim: string;
247
+ onFixed: string;
248
+ onFixedVariant: string;
249
+ };
250
+ /**
251
+ * Returns basic CSS variable references for a **surface color**.
252
+ *
253
+ * @remarks
254
+ * Generates `var(--uui-color-*)` tokens for surface-related colors
255
+ * defined in {@link SurfaceColor} (e.g. `surface`, `surfaceContainer`, `background`).
256
+ * Intended for quick surface/background styling.
257
+ *
258
+ * @param color - Surface color key (e.g. `'surface'`, `'background'`, `'surfaceContainerHigh'`).
259
+ * @returns Object containing `{ color, onColor }` variable references.
260
+ *
261
+ * @example
262
+ * ```ts
263
+ * const vars = getSurfaceColorVar('surfaceContainer');
264
+ * // → { color: "var(--uui-color-surface-container)", onColor: "var(--uui-color-on-surface)" }
265
+ * ```
266
+ * @category Color
267
+ */
268
+ export declare const getSurfaceColorVar: (color: SurfaceColor) => {
269
+ color: string;
270
+ onColor: string;
271
+ };
272
+ /**
273
+ * Converts a HEX color string into an RGB tuple.
274
+ *
275
+ * @param hex - HEX color string (e.g. `#ff8800`).
276
+ * @returns RGB tuple as `[r, g, b]` numeric values.
277
+ *
278
+ * @example
279
+ * ```ts
280
+ * hexToRgbValues('#ff8800');
281
+ * // → [255, 136, 0]
282
+ * ```
283
+ * @category Color
284
+ */
285
+ export declare const hexToRgbValues: (hex: string) => [number, number, number];
286
+ /**
287
+ * Converts a HEX color string to an RGB string format.
288
+ *
289
+ * @param colorValue - HEX color string (e.g. `#ff8800`).
290
+ * @returns Comma-separated RGB string (e.g. `"255,136,0"`).
291
+ *
292
+ * @example
293
+ * ```ts
294
+ * hexToRgb('#ff8800');
295
+ * // → "255,136,0"
296
+ * ```
297
+ * @category Color
298
+ */
299
+ export declare const hexToRgb: (colorValue: string) => string;
300
+ /**
301
+ * Calculates the Material Design 3 surface tint overlay color
302
+ * for a given elevation level and base tint color.
303
+ *
304
+ * @param elevation - Elevation level between 0–5.
305
+ * @param tintColor - Base tint color in HEX format (e.g. `#ffcc00`).
306
+ * @returns CSS color string in `rgba(r, g, b, a)` format with correct alpha applied.
307
+ *
308
+ * @example
309
+ * ```ts
310
+ * getTintOverlayColor(3, '#ffcc00');
311
+ * // → "rgba(255, 204, 0, 0.11)"
312
+ * ```
313
+ * @category Color
314
+ */
315
+ export declare function getTintOverlayColor(elevation: number, tintColor: string): string;
316
+ /**
317
+ * Returns a set of predefined utility class names for fixed theme colors.
318
+ *
319
+ * Each entry maps text, border, outline, and background variants like:
320
+ * `textSurface`, `bgOnSurface`, `borderOutlineVariant`, etc.
321
+ *
322
+ * @returns Object with fixed color class mappings.
323
+ */
324
+ export declare const getFixedColorClasses: () => Record<string, string>;
325
+ /**
326
+ * Returns a map of `uui-current-*` classes for the given element color.
327
+ *
328
+ * @param color - The base color name (e.g. 'primary', 'error', etc.)
329
+ * @returns An object with `uui-current-*` class names for various variants.
330
+ */
331
+ export declare const getCurrentColorClasses: (color: SemanticColor) => {
332
+ [k: string]: `uui-current-${string}` | `uui-current-on-${string}` | `uui-current-${string}-container` | `uui-current-on-${string}-container` | `uui-current-${string}-fixed` | `uui-current-on-${string}-fixed` | `uui-current-${string}-fixed-dim` | `uui-current-on-${string}-fixed-variant`;
333
+ };
334
+ /**
335
+ * Creates a style builder for MD3 color tokens.
336
+ *
337
+ * @remarks
338
+ * The builder provides typed functions for applying theme color tokens
339
+ * to background, text, border, and outline properties using CSS variables.
340
+ *
341
+ * - `bg(color)` — sets background from any ThemeColor
342
+ * - `bg.on(surfaceColor)` — sets background from corresponding `on-*` surface color
343
+ * - `bg.container(semanticColor)` — sets semantic `*-container` background
344
+ * - `bg.onContainer(semanticColor)` — sets semantic `on-*-container` background
345
+ * - `bg.fixed(semanticColor)` — semantic `*-fixed` background
346
+ * - `bg.fixedDim(semanticColor)` — semantic `*-fixed-dim` background
347
+ *
348
+ * - `text(color)` — sets text color from any ThemeColor
349
+ * - `text.on(surfaceColor)` — sets text from `on-*` surface colors
350
+ * - `text.onContainer(semanticColor)` — sets text from semantic `on-*-container`
351
+ *
352
+ * - `border(color)` — sets border-color from any ThemeColor
353
+ * - `outline(color)` — sets outline-color from any ThemeColor
354
+ *
355
+ * The builder accumulates all style operations internally
356
+ * and exposes them via `.get()` as a final React.CSSProperties object.
357
+ *
358
+ * @example
359
+ * const style = ColorStyle();
360
+ * style.bg('surfaceContainerLow');
361
+ * style.text.on('surface');
362
+ * return <button style={style.get()}>Press</button>;
363
+ */
364
+ /**
365
+ * Creates a strictly typed style builder for MD3 color tokens.
366
+ *
367
+ * @category Color
368
+ */
369
+ type CSSPropertyKey = Extract<keyof React.CSSProperties, string>;
370
+ type CSSVar = `--${string}`;
371
+ export declare function ControlStyle(initial?: React.CSSProperties): {
372
+ bg: ((color?: ThemeColor) => void) & {
373
+ on(color?: SurfaceColor): void;
374
+ container(color?: SemanticColor): void;
375
+ onContainer(color?: SemanticColor): void;
376
+ fixed(color?: SemanticColor): void;
377
+ fixedDim(color?: SemanticColor): void;
378
+ };
379
+ text: ((color?: ThemeColor) => void) & {
380
+ on(color?: SurfaceColor): void;
381
+ container(color?: SemanticColor): void;
382
+ onContainer(color?: SemanticColor): void;
383
+ fixed(color?: SemanticColor): void;
384
+ fixedDim(color?: SemanticColor): void;
385
+ };
386
+ border: ((color?: ThemeColor) => void) & {
387
+ on(color?: SurfaceColor): void;
388
+ container(color?: SemanticColor): void;
389
+ onContainer(color?: SemanticColor): void;
390
+ fixed(color?: SemanticColor): void;
391
+ fixedDim(color?: SemanticColor): void;
392
+ };
393
+ outline: ((color?: ThemeColor) => void) & {
394
+ on(color?: SurfaceColor): void;
395
+ container(color?: SemanticColor): void;
396
+ onContainer(color?: SemanticColor): void;
397
+ fixed(color?: SemanticColor): void;
398
+ fixedDim(color?: SemanticColor): void;
399
+ };
400
+ current: ((color?: ThemeColor) => void) & {
401
+ on(color?: SurfaceColor): void;
402
+ container(color?: SemanticColor): void;
403
+ onContainer(color?: SemanticColor): void;
404
+ fixed(color?: SemanticColor): void;
405
+ fixedDim(color?: SemanticColor): void;
406
+ };
407
+ set: {
408
+ <K extends CSSPropertyKey>(key: K, value: React.CSSProperties[K]): void;
409
+ (key: CSSVar, value: string): void;
410
+ };
411
+ get(): React.CSSProperties;
412
+ merge(styles?: React.CSSProperties): void;
413
+ };
414
+ export declare function getBorderColor(borderColor?: BorderColor): BorderColor;
415
+ export {};
@@ -0,0 +1,31 @@
1
+ import { PartialThemeSchemes, ThemeSchemes } from '../components/types';
2
+ export type ExtraColorOverrides = Partial<Record<'info' | 'warning' | 'success', string>>;
3
+ /**
4
+ * Generates a full ThemeSchemes object (light and dark modes) based on a seed color,
5
+ * optional token overrides, and custom semantic colors (info, warning, success).
6
+ *
7
+ * Internally uses the Material Design 3 `themeFromSourceColor()` generator and applies
8
+ * full resolution of all MD3 roles as defined in ThemeSchemeKeys.
9
+ *
10
+ * Custom semantic colors (e.g. `info`, `warning`, `success`) are blended into the palette
11
+ * and expanded to support `Container`, `Fixed`, `Dim`, and `on*` roles.
12
+ *
13
+ * @param seedColor - Optional seed color in hex (e.g. "#6200ee"). Used as the base for the primary palette.
14
+ * Defaults to `#6750A4` if not provided.
15
+ * @param customSchemes - Optional overrides for light and dark color values.
16
+ * Partial values will be merged with generated ones.
17
+ * @param extraColors - Optional custom base colors for `info`, `warning`, and `success`.
18
+ * These will override the default values (`#03a9f4`, `#ffd600`, `#689f38`).
19
+ *
20
+ * @returns A fully resolved ThemeSchemes object with all required color roles populated for light and dark modes.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * const schemes = generateMaterialColors('#6200ee', { info: '#2196f3' }, {});
25
+ * const primary = schemes.light.primary;
26
+ * const infoContainer = schemes.dark.infoContainer;
27
+ * ```
28
+ *
29
+ * @category Theme
30
+ */
31
+ export declare function generateMaterialColors(seedColor?: string, extraColors?: ExtraColorOverrides, customSchemes?: PartialThemeSchemes): ThemeSchemes;
@@ -0,0 +1,32 @@
1
+ import { PartialThemeSchemes, ThemeSchemes } from '../components/types';
2
+ import { ExtraColorOverrides } from './generateMaterialColors';
3
+ /**
4
+ * Generates and injects CSS custom properties for Material Design 3 theme colors.
5
+ *
6
+ * This function calls `generateMaterialColors()` to resolve a complete light/dark
7
+ * `ThemeSchemes` object based on a seed color, optional extra semantic colors
8
+ * (`info`, `warning`, `success`), and optional overrides for individual color tokens.
9
+ *
10
+ * All resolved tokens are converted to CSS variables using kebab-case, e.g.:
11
+ * `--uui-color-primary`, `--uui-color-on-surface`, etc.
12
+ *
13
+ * Light mode tokens are injected into `:root`, dark mode tokens into `.dark`.
14
+ * Variables are injected once into a single `<style>` tag with ID `ufo-ui-theme`.
15
+ *
16
+ * @param seedColor - The base seed color used to generate MD3 tonal palettes.
17
+ * Defaults to `#6750A4` if not provided.
18
+ * @param extraColors - Optional map of base semantic colors for `info`, `warning`, and `success`.
19
+ * These override the default values.
20
+ * @param schemes - Optional overrides for light and dark color tokens.
21
+ * Partial values will be merged with the generated ones.
22
+ *
23
+ * @returns A fully resolved `ThemeSchemes` object containing all tokens for light and dark modes.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const schemes = generateSchemes('#6200ee', { info: '#0288d1' }, { light: { primary: '#ff5722' } });
28
+ * ```
29
+ *
30
+ * @category Theme
31
+ */
32
+ export declare function generateSchemes(seedColor?: string, extraColors?: ExtraColorOverrides, schemes?: PartialThemeSchemes): ThemeSchemes;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Initializes global listeners that track the user's last interaction method.
3
+ *
4
+ * The setup runs once per runtime and updates the internal interaction
5
+ * modality based on keyboard or pointer input.
6
+ *
7
+ * @internal
8
+ */
9
+ export declare function ensureInputMethod(): void;
10
+ /**
11
+ * Returns the last detected interaction method.
12
+ *
13
+ * Possible values are `'keyboard'` or `'pointer'`.
14
+ *
15
+ * @internal
16
+ */
17
+ export declare function getInputMethod(): "pointer" | "keyboard";