@ufoui/core 0.0.58 → 0.0.124
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 +86 -0
- package/components/accordion/accordion.d.ts +4 -8
- package/components/accordion/accordionItem.d.ts +3 -5
- package/components/actions/actions.d.ts +55 -0
- package/components/actions/actions.guards.d.ts +15 -0
- package/components/avatar/avatar.d.ts +1 -1
- package/components/base/boxBase.d.ts +6 -6
- package/components/base/checkboxBase.d.ts +3 -7
- package/components/base/dialogBase.d.ts +3 -7
- package/components/base/textBase.d.ts +13 -12
- package/components/breadcrumbs/breadcrumbs.d.ts +3 -5
- package/components/button/button.d.ts +1 -1
- package/components/card/card.d.ts +8 -51
- 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/collapse/collapse.d.ts +4 -8
- 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/item/item.d.ts +43 -0
- package/components/item/item.guards.d.ts +12 -0
- 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/list/list.d.ts +45 -4
- package/components/listbox/listBox.d.ts +25 -0
- package/components/progress/progress.d.ts +35 -11
- package/components/select/select.d.ts +26 -17
- package/components/slider/slider.d.ts +86 -8
- package/components/slider/sliderHandle.d.ts +24 -0
- package/components/spinner/spinner.d.ts +44 -3
- package/components/toast/toast.d.ts +3 -7
- 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 +2 -0
- package/hooks/useAnimate.d.ts +12 -6
- package/hooks/useMotion.d.ts +27 -0
- package/hooks/useUpdateEffect.d.ts +26 -0
- package/index.css +1 -1
- package/index.d.ts +7 -0
- package/index.js +3796 -3517
- package/package.json +1 -1
- package/types/color.d.ts +51 -8
- package/types/dialog.d.ts +0 -11
- package/types/motion.d.ts +55 -4
- package/utils/color.d.ts +5 -4
- package/utils/colorRegistry.d.ts +1 -1
- package/utils/generateMaterialColors.d.ts +38 -12
- package/utils/index.d.ts +1 -1
- package/utils/useUniqueId.d.ts +9 -0
- package/utils/utils.d.ts +1 -1
- package/components/dialogs/dialogActions.d.ts +0 -26
- package/components/dialogs/dialogActions.guards.d.ts +0 -15
- package/utils/uniqueID.d.ts +0 -14
package/package.json
CHANGED
package/types/color.d.ts
CHANGED
|
@@ -207,13 +207,14 @@ export type CoreSemanticColor = 'primary' | 'secondary' | 'tertiary' | 'warning'
|
|
|
207
207
|
*
|
|
208
208
|
* @category Color
|
|
209
209
|
*/
|
|
210
|
-
export type CoreSurfaceColor = 'surface' | 'surfaceVariant' | 'background' | 'inverseSurface' | '
|
|
210
|
+
export type CoreSurfaceColor = 'surface' | 'surfaceVariant' | 'background' | 'inverseSurface' | 'surfaceContainerLowest' | 'surfaceContainerLow' | 'surfaceContainer' | 'surfaceContainerHigh' | 'surfaceContainerHighest' | 'surfaceBright' | 'surfaceDim' | 'black' | 'white';
|
|
211
|
+
export type CoreBorderColor = 'outline' | 'outlineVariant';
|
|
211
212
|
/**
|
|
212
213
|
* Built-in technical color names not intended for direct usage.
|
|
213
214
|
*
|
|
214
215
|
* @category Color
|
|
215
216
|
*/
|
|
216
|
-
export type CoreThemeColor = 'onSurface' | 'onSurfaceVariant' | 'onBackground' | 'inverseOnSurface' | 'inversePrimary' | 'surfaceTint' | 'scrim' | 'shadow'
|
|
217
|
+
export type CoreThemeColor = 'onSurface' | 'onSurfaceVariant' | 'onBackground' | 'inverseOnSurface' | 'inversePrimary' | 'surfaceTint' | 'scrim' | 'shadow';
|
|
217
218
|
/**
|
|
218
219
|
* Augmentation point for custom semantic colors.
|
|
219
220
|
*
|
|
@@ -257,7 +258,7 @@ export type SemanticColor = SemanticBaseColor;
|
|
|
257
258
|
*
|
|
258
259
|
* @category Color
|
|
259
260
|
*/
|
|
260
|
-
export type ExtendedColor = `${SemanticBaseColor}Container` | `${SemanticBaseColor}Fixed
|
|
261
|
+
export type ExtendedColor = `${SemanticBaseColor}Container` | `${SemanticBaseColor}Fixed`;
|
|
261
262
|
/**
|
|
262
263
|
* `on*` counterparts for extended colors.
|
|
263
264
|
*
|
|
@@ -277,17 +278,59 @@ export type SurfaceColor = CoreSurfaceColor | ExtendedColor;
|
|
|
277
278
|
*/
|
|
278
279
|
export type BaseColor = SemanticColor | SurfaceColor;
|
|
279
280
|
/**
|
|
280
|
-
*
|
|
281
|
+
* Border color.
|
|
281
282
|
*
|
|
282
283
|
* @category Color
|
|
283
284
|
*/
|
|
284
|
-
export type
|
|
285
|
+
export type BorderColor = BaseColor | CoreBorderColor | `${SemanticBaseColor}FixedDim`;
|
|
285
286
|
/**
|
|
286
|
-
*
|
|
287
|
+
* Colors allowed for plain text content.
|
|
287
288
|
*
|
|
288
289
|
* @category Color
|
|
289
290
|
*/
|
|
290
|
-
export type
|
|
291
|
+
export type TextColor = SemanticColor | 'onSurface' | 'onBackground' | 'onSurfaceVariant' | OnColor<`${SemanticBaseColor}Container`>;
|
|
292
|
+
/**
|
|
293
|
+
* Full theme color set.
|
|
294
|
+
*
|
|
295
|
+
* @category Color
|
|
296
|
+
*/
|
|
297
|
+
export type ThemeColor = BorderColor | OnColor<SemanticBaseColor> | OnExtendedColor | CoreThemeColor;
|
|
298
|
+
/**
|
|
299
|
+
* Value for a single color role — either a plain hex string or an explicit color/on pair.
|
|
300
|
+
*
|
|
301
|
+
* @category Theme
|
|
302
|
+
*/
|
|
303
|
+
export type ColorRoleValue = string | {
|
|
304
|
+
color: string;
|
|
305
|
+
on?: string;
|
|
306
|
+
};
|
|
307
|
+
/**
|
|
308
|
+
* Full configuration for a custom semantic color token.
|
|
309
|
+
*
|
|
310
|
+
* @remarks
|
|
311
|
+
* - **Plain string** — seed hex for standard MD3 tonal generation. All roles are MD3-computed.
|
|
312
|
+
* - **Object** — exact color overrides per mode:
|
|
313
|
+
* - `main.light` / `main.dark` set the primary role token. `dark` defaults to `light` if omitted.
|
|
314
|
+
* - Each value is either a plain hex string or `{ color, on? }`. When `on` is omitted,
|
|
315
|
+
* the counterpart is derived from the overridden color's luminance (HCT tone < 50 → white, ≥ 50 → near-black).
|
|
316
|
+
* - `fixed` controls the `Fixed` / `onFixed` tokens:
|
|
317
|
+
* - omitted: inherited from the resolved `main` values
|
|
318
|
+
* - `'preserve'`: keeps MD3-generated values unchanged
|
|
319
|
+
* - object `{ light, dark? }`: explicit override, same rules as `main`
|
|
320
|
+
* - `Container` roles are always MD3-generated and are not affected by this config.
|
|
321
|
+
*
|
|
322
|
+
* @category Theme
|
|
323
|
+
*/
|
|
324
|
+
export type CustomColorConfig = string | {
|
|
325
|
+
main: {
|
|
326
|
+
light: ColorRoleValue;
|
|
327
|
+
dark?: ColorRoleValue;
|
|
328
|
+
};
|
|
329
|
+
fixed?: 'preserve' | {
|
|
330
|
+
light: ColorRoleValue;
|
|
331
|
+
dark?: ColorRoleValue;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
291
334
|
/**
|
|
292
335
|
* Input color map used to seed/generate theme schemes.
|
|
293
336
|
*
|
|
@@ -296,4 +339,4 @@ export type BorderColor = BaseColor;
|
|
|
296
339
|
*
|
|
297
340
|
* @category Theme
|
|
298
341
|
*/
|
|
299
|
-
export type ThemeCustomColors = Partial<Record<SemanticBaseColor,
|
|
342
|
+
export type ThemeCustomColors = Partial<Record<SemanticBaseColor, CustomColorConfig>>;
|
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/motion.d.ts
CHANGED
|
@@ -1,15 +1,66 @@
|
|
|
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';
|
|
40
|
+
/**
|
|
41
|
+
* Motion configuration.
|
|
42
|
+
*
|
|
43
|
+
* Allows passing either:
|
|
44
|
+
* - animation preset name (`MotionAnimation`)
|
|
45
|
+
* - full config object with animation, duration and style
|
|
46
|
+
*/
|
|
47
|
+
export interface MotionConfig {
|
|
48
|
+
/** Motion animation preset. */
|
|
49
|
+
animation: MotionAnimation;
|
|
50
|
+
/** Animation duration in milliseconds. */
|
|
51
|
+
duration?: number;
|
|
52
|
+
/** Motion style variant. */
|
|
53
|
+
style?: MotionStyle;
|
|
54
|
+
/** First-render behaviour: `'animate'` plays the open transition on mount, `'skip'` shows the final state immediately. Defaults to the component's own UX default when omitted. */
|
|
55
|
+
initial?: 'animate' | 'skip';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Motion value.
|
|
59
|
+
*
|
|
60
|
+
* Can be provided as a shorthand animation preset name
|
|
61
|
+
* or as a full {@link MotionConfig} object.
|
|
62
|
+
*/
|
|
63
|
+
export type ElementAnimation = MotionAnimation | MotionConfig;
|
|
13
64
|
/**
|
|
14
65
|
* Returns CSS class name for motion style.
|
|
15
66
|
* Expressive enables extended motion parameters.
|
package/utils/color.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseColor, BorderColor, ExtendedColor, SemanticColor, SurfaceColor, ThemeColor } from '../types';
|
|
2
|
-
export type { CoreSemanticColor, CoreSurfaceColor, CoreThemeColor, CustomColors, SemanticBaseColor, OnColor, SemanticColor, ExtendedColor, OnExtendedColor, SurfaceColor, BaseColor, ThemeColor, BorderColor, } from '../types';
|
|
1
|
+
import { BaseColor, BorderColor, ExtendedColor, SemanticColor, SurfaceColor, TextColor, ThemeColor } from '../types';
|
|
2
|
+
export type { CoreSemanticColor, CoreSurfaceColor, CoreThemeColor, CustomColors, SemanticBaseColor, OnColor, SemanticColor, ExtendedColor, OnExtendedColor, SurfaceColor, BaseColor, ThemeColor, BorderColor, TextColor, } from '../types';
|
|
3
3
|
export declare function getOnColorName(colorName: ThemeColor): ThemeColor | undefined;
|
|
4
4
|
/**
|
|
5
5
|
* Returns all color names from the global registry for the selected type.
|
|
@@ -11,9 +11,10 @@ export declare function getOnColorName(colorName: ThemeColor): ThemeColor | unde
|
|
|
11
11
|
export declare function getColorNames(type: 'semantic'): SemanticColor[];
|
|
12
12
|
export declare function getColorNames(type: 'extended'): ExtendedColor[];
|
|
13
13
|
export declare function getColorNames(type: 'surface'): SurfaceColor[];
|
|
14
|
-
export declare function getColorNames(type: 'theme'): ThemeColor[];
|
|
15
14
|
export declare function getColorNames(type: 'base'): BaseColor[];
|
|
16
15
|
export declare function getColorNames(type: 'border'): BorderColor[];
|
|
16
|
+
export declare function getColorNames(type: 'text'): TextColor[];
|
|
17
|
+
export declare function getColorNames(type: 'theme'): ThemeColor[];
|
|
17
18
|
/**
|
|
18
19
|
* Returns basic CSS variable references for a **surface color**.
|
|
19
20
|
*
|
|
@@ -32,7 +33,7 @@ export declare function getColorNames(type: 'border'): BorderColor[];
|
|
|
32
33
|
* ```
|
|
33
34
|
* @category Color
|
|
34
35
|
*/
|
|
35
|
-
export declare const getSurfaceColorVar: (color:
|
|
36
|
+
export declare const getSurfaceColorVar: (color: ThemeColor) => {
|
|
36
37
|
color: string;
|
|
37
38
|
onColor: string;
|
|
38
39
|
};
|
package/utils/colorRegistry.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @category Theme
|
|
5
5
|
*/
|
|
6
|
-
export type ColorType = 'semantic' | 'surface' | 'extended' | 'base' | 'border' | 'theme';
|
|
6
|
+
export type ColorType = 'semantic' | 'surface' | 'extended' | 'base' | 'border' | 'text' | 'theme';
|
|
7
7
|
/**
|
|
8
8
|
* Metadata entry describing how a color name should be used.
|
|
9
9
|
*
|
|
@@ -1,26 +1,52 @@
|
|
|
1
1
|
import { ThemeColorSchemes, ThemeCustomColors } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Generates a full ThemeColorSchemes object (light and dark modes) based on a seed color
|
|
4
|
-
* and optional semantic
|
|
3
|
+
* Generates a full ThemeColorSchemes object (light and dark modes) based on a seed color
|
|
4
|
+
* and optional custom semantic colors.
|
|
5
5
|
*
|
|
6
|
-
* Internally uses the Material Design 3 `themeFromSourceColor()` generator
|
|
7
|
-
* full
|
|
6
|
+
* Internally uses the Material Design 3 `themeFromSourceColor()` generator. Each color is blended
|
|
7
|
+
* toward the source hue and expanded into a full set of roles: main, `on*`, `Container`,
|
|
8
|
+
* `onContainer`, `Fixed`, `onFixed`, `FixedDim`, and `onFixedVariant`.
|
|
8
9
|
*
|
|
9
|
-
*
|
|
10
|
-
* and expanded to support `Container`, `Fixed`, `Dim`, and `on*` roles.
|
|
10
|
+
* Built-in defaults (`info`, `warning`, `success`) are always included unless overridden.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
13
|
-
*
|
|
14
|
-
* @param colors - Optional map of semantic base colors (core + augmented).
|
|
15
|
-
* Defaults include `info`, `warning`, and `success`.
|
|
12
|
+
* @remarks
|
|
13
|
+
* Each entry in `colors` accepts two forms:
|
|
16
14
|
*
|
|
17
|
-
*
|
|
15
|
+
* - **String** — seed hex used to generate the full MD3 tonal palette. All roles are MD3-computed.
|
|
16
|
+
* ```ts
|
|
17
|
+
* { info: '#2196f3' }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* - **Object** — allows exact color overrides per mode:
|
|
21
|
+
* - `main.light` / `main.dark` — overrides the primary role token. `dark` defaults to `light` if omitted.
|
|
22
|
+
* - `on` color is derived automatically from the overridden color's luminance (HCT tone < 50 → white, ≥ 50 → near-black)
|
|
23
|
+
* unless provided explicitly via `{ color, on }`.
|
|
24
|
+
* - `fixed` — controls the `Fixed` / `onFixed` tokens:
|
|
25
|
+
* - omitted: inherited from `main` override
|
|
26
|
+
* - `'preserve'`: keeps the MD3-generated values
|
|
27
|
+
* - object `{ light, dark? }`: explicit override, same rules as `main`
|
|
28
|
+
* - `Container` roles are always MD3-generated and cannot be overridden here.
|
|
29
|
+
* ```ts
|
|
30
|
+
* { brandBlue: { main: { light: '#0057FF' }, fixed: 'preserve' } }
|
|
31
|
+
* { brandBlue: { main: { light: { color: '#0057FF', on: '#FFD600' } } } }
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param seedColor - Hex string used as the MD3 source color for the primary palette. Defaults to `#6750A4`.
|
|
35
|
+
* @param colors - Optional map of semantic color configs (core + augmented via `CustomColors`).
|
|
36
|
+
*
|
|
37
|
+
* @returns A fully resolved `ThemeColorSchemes` object for light and dark modes.
|
|
18
38
|
* Also updates the global color registry via `setColorRegistry()`.
|
|
19
39
|
*
|
|
20
40
|
* @example
|
|
21
41
|
* ```ts
|
|
22
|
-
* const schemes = generateMaterialColors('#6200ee', {
|
|
42
|
+
* const schemes = generateMaterialColors('#6200ee', {
|
|
43
|
+
* info: '#2196f3',
|
|
44
|
+
* brandBlue: { main: { light: '#0057FF', dark: '#0057FF' } },
|
|
45
|
+
* brandBlueYellow: { main: { light: { color: '#0057FF', on: '#FFD600' } } },
|
|
46
|
+
* });
|
|
23
47
|
* const primary = schemes.light.primary;
|
|
48
|
+
* const brandBlue = schemes.dark.brandBlue;
|
|
49
|
+
* const onBrandBlueYellow = schemes.light.onBrandBlueYellow; // '#FFD600'
|
|
24
50
|
* ```
|
|
25
51
|
*
|
|
26
52
|
* @category Theme
|
package/utils/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export * from './generateMaterialColors';
|
|
|
8
8
|
export * from './applyThemeColors';
|
|
9
9
|
export * from './breakpoints';
|
|
10
10
|
export * from './toasts';
|
|
11
|
-
export * from './
|
|
11
|
+
export * from './useUniqueId';
|
|
12
12
|
export * from './controlStyle';
|
|
13
13
|
export * from './getWrapperStyle';
|
|
14
14
|
export * from './flatChildren';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a stable React component ID safe for SSR and hydration.
|
|
3
|
+
*
|
|
4
|
+
* @param prefix - String prepended to the generated ID.
|
|
5
|
+
* @returns A unique ID in the form `${prefix}_xxxx`.
|
|
6
|
+
*
|
|
7
|
+
* @category Utils
|
|
8
|
+
*/
|
|
9
|
+
export declare const useUniqueId: (prefix: string) => string;
|
package/utils/utils.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ export declare const getShapeClass: (shape?: ElementShape) => string;
|
|
|
126
126
|
* @param size Size token.
|
|
127
127
|
* @returns CSS class for size variant.
|
|
128
128
|
*/
|
|
129
|
-
export declare const getSizeClass: (size
|
|
129
|
+
export declare const getSizeClass: (size?: ElementSize) => string;
|
|
130
130
|
/**
|
|
131
131
|
* Returns the appropriate CSS class for the given border size.
|
|
132
132
|
*
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
/** Slot contract for components that can act as dialog actions. */
|
|
3
|
-
export interface DialogActionProps {
|
|
4
|
-
label?: string;
|
|
5
|
-
'aria-label'?: string;
|
|
6
|
-
icon?: ReactNode;
|
|
7
|
-
leading?: ReactNode;
|
|
8
|
-
trailing?: ReactNode;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface DialogActionsProps {
|
|
12
|
-
actions?: ReactNode;
|
|
13
|
-
placement?: 'top' | 'subtitle' | 'bottom' | 'inline';
|
|
14
|
-
align?: 'start' | 'center' | 'end';
|
|
15
|
-
stack?: boolean;
|
|
16
|
-
className?: string;
|
|
17
|
-
/** Maximum number of visible actions before the rest collapse into an overflow menu. */
|
|
18
|
-
maxActions?: number;
|
|
19
|
-
/** Accessible label for the overflow actions button. Default: "More actions" */
|
|
20
|
-
moreLabel?: string;
|
|
21
|
-
moreIcon?: ReactNode;
|
|
22
|
-
}
|
|
23
|
-
export declare const DialogActions: {
|
|
24
|
-
({ actions, className, placement, align, stack, maxActions, moreLabel, }: DialogActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
-
displayName: string;
|
|
26
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ReactElement, ReactNode } from 'react';
|
|
2
|
-
import { DialogActionProps } from './dialogActions';
|
|
3
|
-
export declare const IS_DIALOG_ACTION: unique symbol;
|
|
4
|
-
/**
|
|
5
|
-
* Type guard that checks whether a React node is a dialog action component.
|
|
6
|
-
*
|
|
7
|
-
* Identifies dialog action elements by the internal {@link IS_DIALOG_ACTION} symbol
|
|
8
|
-
* attached to the component type.
|
|
9
|
-
*
|
|
10
|
-
* @param el - React node to test.
|
|
11
|
-
* @returns `true` if the node is a dialog action element.
|
|
12
|
-
*
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare function isDialogAction(el: ReactNode): el is ReactElement<DialogActionProps>;
|
package/utils/uniqueID.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates a fast, pseudo-random unique ID.
|
|
3
|
-
*
|
|
4
|
-
* @param prefix - String prepended to the generated ID.
|
|
5
|
-
* @returns A unique ID in the form `${prefix}_xxxx`.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* - Uses `Math.random()` → extremely fast, ideal for UI/runtime IDs.
|
|
9
|
-
* - Not cryptographically secure.
|
|
10
|
-
* - Suitable for components, form fields, ripple effects, etc.
|
|
11
|
-
*
|
|
12
|
-
* @category Utils
|
|
13
|
-
*/
|
|
14
|
-
export declare const uniqueID: (prefix: string) => string;
|