@ufoui/core 0.0.58 → 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.
Files changed (48) hide show
  1. package/assets/index.d.ts +1 -0
  2. package/assets/spinners.d.ts +16 -0
  3. package/components/actions/actions.d.ts +55 -0
  4. package/components/actions/actions.guards.d.ts +15 -0
  5. package/components/avatar/avatar.d.ts +1 -1
  6. package/components/base/boxBase.d.ts +6 -6
  7. package/components/base/dialogBase.d.ts +2 -2
  8. package/components/base/textBase.d.ts +11 -11
  9. package/components/breadcrumbs/breadcrumbs.d.ts +1 -1
  10. package/components/button/button.d.ts +1 -1
  11. package/components/card/card.d.ts +7 -46
  12. package/components/card/cardHeader.d.ts +49 -0
  13. package/components/card/cardMedia.d.ts +9 -0
  14. package/components/card/cardTitle.d.ts +11 -0
  15. package/components/dialogs/dialogHeader.d.ts +1 -1
  16. package/components/dialogs/index.d.ts +1 -1
  17. package/components/fieldset/fieldset.d.ts +1 -1
  18. package/components/layout/article.d.ts +1 -1
  19. package/components/layout/aside.d.ts +1 -1
  20. package/components/layout/content.d.ts +1 -1
  21. package/components/layout/footer.d.ts +1 -1
  22. package/components/layout/header.d.ts +1 -1
  23. package/components/layout/main.d.ts +1 -1
  24. package/components/layout/nav.d.ts +1 -1
  25. package/components/layout/section.d.ts +1 -1
  26. package/components/spinner/spinner.d.ts +27 -2
  27. package/components/toolbar/toolbar.d.ts +1 -1
  28. package/components/typography/h1.d.ts +1 -1
  29. package/components/typography/h2.d.ts +1 -1
  30. package/components/typography/h3.d.ts +1 -1
  31. package/components/typography/h4.d.ts +1 -1
  32. package/components/typography/h5.d.ts +1 -1
  33. package/components/typography/h6.d.ts +1 -1
  34. package/components/typography/label.d.ts +1 -1
  35. package/components/typography/p.d.ts +1 -1
  36. package/components/typography/span.d.ts +1 -1
  37. package/hooks/useAnimate.d.ts +8 -6
  38. package/index.css +1 -1
  39. package/index.d.ts +3 -0
  40. package/index.js +2931 -3137
  41. package/package.json +1 -1
  42. package/types/color.d.ts +7 -6
  43. package/types/dialog.d.ts +0 -11
  44. package/types/motion.d.ts +31 -4
  45. package/utils/color.d.ts +2 -2
  46. package/utils/utils.d.ts +1 -1
  47. package/components/dialogs/dialogActions.d.ts +0 -26
  48. package/components/dialogs/dialogActions.guards.d.ts +0 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ufoui/core",
3
- "version": "0.0.58",
3
+ "version": "0.0.88",
4
4
  "description": "Lightweight Material Design 3 UI components for React",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",
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' | 'outline' | 'outlineVariant' | 'surfaceContainerLowest' | 'surfaceContainerLow' | 'surfaceContainer' | 'surfaceContainerHigh' | 'surfaceContainerHighest' | 'surfaceBright' | 'surfaceDim';
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' | 'black' | 'white';
217
+ export type CoreThemeColor = 'onSurface' | 'onSurfaceVariant' | 'onBackground' | 'inverseOnSurface' | 'inversePrimary' | 'surfaceTint' | 'scrim' | 'shadow';
217
218
  /**
218
219
  * Augmentation point for custom semantic colors.
219
220
  *
@@ -277,17 +278,17 @@ export type SurfaceColor = CoreSurfaceColor | ExtendedColor;
277
278
  */
278
279
  export type BaseColor = SemanticColor | SurfaceColor;
279
280
  /**
280
- * Full theme color set.
281
+ * Border color.
281
282
  *
282
283
  * @category Color
283
284
  */
284
- export type ThemeColor = BaseColor | OnColor<SemanticBaseColor> | OnExtendedColor | CoreThemeColor;
285
+ export type BorderColor = BaseColor | CoreBorderColor;
285
286
  /**
286
- * Border color.
287
+ * Full theme color set.
287
288
  *
288
289
  * @category Color
289
290
  */
290
- export type BorderColor = BaseColor;
291
+ export type ThemeColor = BorderColor | OnColor<SemanticBaseColor> | OnExtendedColor | CoreThemeColor;
291
292
  /**
292
293
  * Input color map used to seed/generate theme schemes.
293
294
  *
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,12 +1,39 @@
1
- export type MotionAnimation = 'fade' | 'fadeBlur' | 'scale' | 'scaleBlur' | 'popup' | 'slideUp' | 'slideDown' | 'slideLeft' | 'slideRight' | 'slideUpBlur' | 'slideDownBlur' | 'slideLeftBlur' | 'slideRightBlur' | 'rotate' | 'rotateUpRight' | 'rotateUpLeft' | 'rollLeft' | 'rollRight' | 'flipX' | 'flipY' | 'bounce' | 'squish' | 'rubber' | 'popElastic' | 'jelly';
2
- export declare const motionClassMap: Record<MotionAnimation, string>;
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 | 'none'): string;
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/utils/color.d.ts CHANGED
@@ -11,9 +11,9 @@ 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: 'theme'): ThemeColor[];
17
17
  /**
18
18
  * Returns basic CSS variable references for a **surface color**.
19
19
  *
@@ -32,7 +32,7 @@ export declare function getColorNames(type: 'border'): BorderColor[];
32
32
  * ```
33
33
  * @category Color
34
34
  */
35
- export declare const getSurfaceColorVar: (color: BaseColor) => {
35
+ export declare const getSurfaceColorVar: (color: ThemeColor) => {
36
36
  color: string;
37
37
  onColor: string;
38
38
  };
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: ElementSize) => string;
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>;