@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.
Files changed (57) hide show
  1. package/assets/icons.d.ts +5 -2
  2. package/components/accordion/accordion.d.ts +2 -2
  3. package/components/avatar/avatar.d.ts +2 -2
  4. package/components/badge/badge.d.ts +2 -2
  5. package/components/base/boxBase.d.ts +4 -4
  6. package/components/base/buttonBase.d.ts +5 -5
  7. package/components/base/checkboxBase.d.ts +2 -2
  8. package/components/base/dialogBase.d.ts +105 -9
  9. package/components/base/fieldBase.d.ts +1 -1
  10. package/components/card/card.d.ts +78 -13
  11. package/components/dialogs/dialogActions.d.ts +19 -7
  12. package/components/dialogs/dialogActions.guards.d.ts +15 -0
  13. package/components/dialogs/dialogContent.d.ts +7 -1
  14. package/components/dialogs/dialogHeader.d.ts +60 -0
  15. package/components/dialogs/dialogTitle.d.ts +9 -5
  16. package/components/dialogs/index.d.ts +1 -0
  17. package/components/link/link.d.ts +13 -14
  18. package/components/menu/menu.d.ts +2 -2
  19. package/components/rating/rating.d.ts +2 -2
  20. package/components/switch/switch.d.ts +2 -2
  21. package/components/themeProvider/themeProvider.d.ts +20 -15
  22. package/components/toolbar/toolbar.d.ts +1 -1
  23. package/components/tooltip/tooltip.d.ts +2 -2
  24. package/hooks/index.d.ts +1 -0
  25. package/hooks/useResponsive.d.ts +60 -0
  26. package/hooks/useTheme.d.ts +1 -1
  27. package/index.css +1 -1
  28. package/index.js +3186 -3023
  29. package/internal/icon/icon.d.ts +28 -0
  30. package/internal/index.d.ts +1 -0
  31. package/internal/inlineTooltip/inlineTooltipManager.d.ts +3 -3
  32. package/internal/slots/slot.d.ts +1 -1
  33. package/package.json +1 -1
  34. package/types/breakpoints.d.ts +38 -0
  35. package/types/color.d.ts +299 -0
  36. package/types/dialog.d.ts +37 -0
  37. package/types/fonts.d.ts +53 -0
  38. package/types/index.d.ts +4 -0
  39. package/types/motion.d.ts +2 -2
  40. package/types/theme.d.ts +8 -235
  41. package/utils/applyThemeColors.d.ts +10 -0
  42. package/utils/breakpoints/breakpoint.d.ts +59 -0
  43. package/utils/breakpoints/breakpointStore.d.ts +32 -0
  44. package/utils/breakpoints/index.d.ts +2 -0
  45. package/utils/calculateFloatingPosition.d.ts +3 -3
  46. package/utils/color.d.ts +14 -153
  47. package/utils/colorRegistry.d.ts +37 -0
  48. package/utils/controlStyle.d.ts +8 -8
  49. package/utils/createRipple.d.ts +17 -0
  50. package/utils/flatChildren.d.ts +17 -0
  51. package/utils/fontRegistry.d.ts +29 -0
  52. package/utils/generateMaterialColors.d.ts +9 -12
  53. package/utils/index.d.ts +9 -1
  54. package/utils/mergeOverrides.d.ts +13 -0
  55. package/utils/renderPortal.d.ts +30 -0
  56. package/utils/utils.d.ts +3 -25
  57. package/utils/generateSchemes.d.ts +0 -32
package/assets/icons.d.ts CHANGED
@@ -1,11 +1,14 @@
1
+ export declare const ChevronRightIcon: import("react/jsx-runtime").JSX.Element;
2
+ export declare const CloseIcon: import("react/jsx-runtime").JSX.Element;
3
+ export declare const ArrowBackIcon: import("react/jsx-runtime").JSX.Element;
4
+ export declare const MoreVertIcon: import("react/jsx-runtime").JSX.Element;
1
5
  export declare const CheckmarkIcon: import("react/jsx-runtime").JSX.Element;
2
6
  export declare const IndeterminateIcon: import("react/jsx-runtime").JSX.Element;
3
7
  export declare const RadioIcon: import("react/jsx-runtime").JSX.Element;
4
- export declare const ArrowRightIcon: import("react/jsx-runtime").JSX.Element;
5
8
  export declare const CheckboxIcon: import("react/jsx-runtime").JSX.Element;
9
+ export declare const MenuCheckIcon: import("react/jsx-runtime").JSX.Element;
6
10
  export declare const RadioCheckedIcon: import("react/jsx-runtime").JSX.Element;
7
11
  export declare const RadioUncheckedIcon: import("react/jsx-runtime").JSX.Element;
8
- export declare const MenuCheckIcon: import("react/jsx-runtime").JSX.Element;
9
12
  export declare const ExpandIcon: import("react/jsx-runtime").JSX.Element;
10
13
  export declare const StarIcon: import("react/jsx-runtime").JSX.Element;
11
14
  export declare const StarFilledIcon: import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BoxBaseProps } from '../base';
3
- import { BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFont, ElementShape, SurfaceColor } from '../../utils';
3
+ import { BaseColor, BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFont, ElementShape } from '../../utils';
4
4
  import { MotionAnimation, MotionStyle } from '../../types';
5
5
  export type AccordionVariant = 'text' | 'pills' | 'grouped' | 'segmented';
6
6
  export type AccordionConfig = {
@@ -15,7 +15,7 @@ export type AccordionConfig = {
15
15
  animation?: MotionAnimation;
16
16
  motionStyle?: MotionStyle;
17
17
  duration?: number;
18
- color?: SurfaceColor;
18
+ color?: BaseColor;
19
19
  disabled?: boolean;
20
20
  };
21
21
  /**
@@ -21,8 +21,8 @@ export interface AvatarProps extends Omit<BoxBaseProps, 'component' | 'elementCl
21
21
  /**
22
22
  * Avatar identity component displaying image, initials, or custom content.
23
23
  *
24
- * Automatically derives a background color from name when no image
25
- * and no explicit color are provided.
24
+ * Automatically derives a fallback background color from name when no image
25
+ * and no explicit color are provided, using semantic and extended color pools.
26
26
  *
27
27
  * @function
28
28
  * @param props Component properties.
@@ -1,5 +1,5 @@
1
1
  import { HTMLAttributes } from 'react';
2
- import { ElementAlign, ElementBorder, ElementElevation, ElementFont, ElementShape, ElementSize } from '../../utils/utils';
2
+ import { ElementBorder, ElementElevation, ElementFont, ElementPlacement, ElementShape, ElementSize } from '../../utils';
3
3
  import { BorderColor, SemanticColor } from '../../utils/color';
4
4
  /**
5
5
  * Props for the Badge component.
@@ -10,7 +10,7 @@ import { BorderColor, SemanticColor } from '../../utils/color';
10
10
  */
11
11
  export interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'ref' | 'size'> {
12
12
  /** Position relative to the parent element. */
13
- align?: ElementAlign;
13
+ align?: ElementPlacement;
14
14
  /** Accessible label for screen readers when badge conveys information. */
15
15
  ariaLabel?: string;
16
16
  /** Border width when outlined. */
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ElementType, HTMLAttributes, ReactNode } from 'react';
2
- import { BorderColor, ElementBorder, ElementElevation, ElementFont, ElementShape, SurfaceColor, WrapperProps } from '../../utils';
2
+ import { BaseColor, BorderColor, ElementBorder, ElementElevation, ElementFont, ElementShape, WrapperProps } from '../../utils';
3
3
  /**
4
4
  * Layout mode for {@link BoxBase}.
5
5
  *
@@ -41,7 +41,7 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'
41
41
  /** Layout direction shortcut. Same as `direction="col"`. */
42
42
  col?: boolean;
43
43
  /** Surface background token. Default: `'surface'`. */
44
- color?: SurfaceColor;
44
+ color?: BaseColor;
45
45
  /** Grid template columns (`3` → `repeat(3, 1fr)`). */
46
46
  cols?: number | string;
47
47
  /** Custom HTML element/component. Default: `div`. */
@@ -59,9 +59,9 @@ export interface BoxBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'
59
59
  /** Font token controlling typography (size, weight, line-height). */
60
60
  font?: ElementFont;
61
61
  /** Forces full height (100%). */
62
- hf?: boolean;
62
+ fullHeight?: boolean;
63
63
  /** Forces full width (100%). */
64
- wf?: boolean;
64
+ fullWidth?: boolean;
65
65
  /** Gap between children (flex/grid). */
66
66
  gap?: number | string;
67
67
  /** Horizontal gap (`column-gap`). */
@@ -1,5 +1,5 @@
1
1
  import { default as React, ReactNode } from 'react';
2
- import { BorderColor, ElementAlign, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTouchEffect, SemanticColor, SurfaceColor } from '../../utils';
2
+ import { BaseColor, BorderColor, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPlacement, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTouchEffect, SemanticColor } from '../../utils';
3
3
  /**
4
4
  * Props for the ButtonBase component.
5
5
  *
@@ -37,7 +37,7 @@ export interface ButtonBaseProps extends Omit<React.ButtonHTMLAttributes<HTMLBut
37
37
  /** Font token for label and content. */
38
38
  font?: ElementFont;
39
39
  /** Expands button to full width. */
40
- wf?: boolean;
40
+ fullWidth?: boolean;
41
41
  /** Hover visual effects. */
42
42
  hoverEffects?: ElementHoverEffect[];
43
43
  /** Icon rendered at the start of the button. */
@@ -77,13 +77,13 @@ export interface ButtonBaseProps extends Omit<React.ButtonHTMLAttributes<HTMLBut
77
77
  /** Shape override when selected. */
78
78
  selectedShape?: ElementShape;
79
79
  /** Text color override when selected. */
80
- selectedTextColor?: SurfaceColor;
80
+ selectedTextColor?: BaseColor;
81
81
  /** Shape of the button. */
82
82
  shape?: ElementShape;
83
83
  /** Predefined button size. Default: medium */
84
84
  size?: ElementSize;
85
85
  /** Text color override. */
86
- textColor?: SurfaceColor;
86
+ textColor?: BaseColor;
87
87
  /** Tooltip text and accessibility label fallback. */
88
88
  title?: string;
89
89
  /** Enables toggle button behavior. */
@@ -91,7 +91,7 @@ export interface ButtonBaseProps extends Omit<React.ButtonHTMLAttributes<HTMLBut
91
91
  /** Enables tonal style. */
92
92
  tonal?: boolean;
93
93
  /** Tooltip alignment relative to the button. */
94
- tooltipAlign?: ElementAlign;
94
+ tooltipAlign?: ElementPlacement;
95
95
  /** Touch and click visual effects. */
96
96
  touchEffects?: ElementTouchEffect[];
97
97
  /** Custom trailing content. */
@@ -1,5 +1,5 @@
1
1
  import { default as React, ReactNode } from 'react';
2
- import { BorderColor, ElementAlign, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect, SemanticColor, SurfaceColor } from '../../utils';
2
+ import { BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPlacement, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect, SemanticColor, SurfaceColor } from '../../utils';
3
3
  import { MotionAnimation, MotionStyle } from '../../types';
4
4
  /**
5
5
  * Props for the CheckboxBase component.
@@ -83,7 +83,7 @@ export interface CheckboxBaseProps extends Omit<React.InputHTMLAttributes<HTMLIn
83
83
  /** Placement of text relative to the control. */
84
84
  textPlacement?: ElementTextPlacement;
85
85
  /** Tooltip alignment relative to the control. */
86
- tooltipAlign?: ElementAlign;
86
+ tooltipAlign?: ElementPlacement;
87
87
  /** Touch and click visual effects. */
88
88
  touchEffects?: ElementTouchEffect[];
89
89
  /** Input type. */
@@ -1,34 +1,130 @@
1
- import { default as React, ReactNode } from 'react';
2
- import { BorderColor, ElementElevation, ElementOutline, ElementShape, ElementSize, SurfaceColor } from '../../utils';
3
- import { MotionAnimation, MotionStyle } from '../../types';
4
- export type DialogType = 'basic' | 'fullscreen' | 'dockRight' | 'dockLeft' | 'dockTop' | 'dockBottom';
5
- export type DialogAnimation = 'none' | MotionAnimation;
1
+ import { default as React, ReactElement, ReactNode } from 'react';
2
+ import { BorderColor, ElementElevation, ElementFont, ElementOutline, ElementShape, ElementSize, SurfaceColor } from '../../utils';
3
+ import { DialogAnimation, DialogIconSlot, DialogType, MotionStyle } from '../../types';
4
+ /**
5
+ * Props for the DialogBase component.
6
+ *
7
+ * Supports backdrop and portal rendering, transitions, Escape and backdrop
8
+ * dismiss, and optional modal focus trap and scroll locking.
9
+ *
10
+ * @category Base components
11
+ */
6
12
  export interface DialogBaseProps {
13
+ /** Semantic UUI element class for the dialog panel. */
7
14
  elementClass?: string;
15
+ /** Whether the dialog is open. */
8
16
  open: boolean;
17
+ /** Handler invoked when the dialog should close. */
9
18
  onClose?: () => void;
19
+ /** Layout mode. Default: basic */
10
20
  type?: DialogType;
21
+ /** Surface background token. */
11
22
  color?: SurfaceColor;
23
+ /** Elevation level. Default: 3 for non-fullscreen layouts. */
12
24
  elevation?: ElementElevation;
25
+ /** Predefined panel size. Default: small for horizontal docks, medium otherwise. */
13
26
  size?: ElementSize;
27
+ /** Shape of the dialog panel. */
14
28
  shape?: ElementShape;
29
+ /** Outline thickness when outlined. */
15
30
  border?: ElementOutline;
31
+ /** Outline color when outlined. */
16
32
  borderColor?: BorderColor;
17
- wf?: boolean;
18
- hf?: boolean;
33
+ /** Expands panel to full width. */
34
+ fullWidth?: boolean;
35
+ /** Expands panel to full height. */
36
+ fullHeight?: boolean;
37
+ /** Fits content to the panel. */
19
38
  fit?: boolean;
39
+ /** Renders the panel in detached layout style. */
20
40
  detached?: boolean;
41
+ /** Animation preset; `'none'` disables motion. */
21
42
  animation?: DialogAnimation;
43
+ /** Duration in milliseconds for open and close animations. Default: 500 */
22
44
  duration?: number;
23
- disableBackdropClose?: boolean;
24
- disableEscapeKey?: boolean;
45
+ /** Whether the dialog closes when the backdrop is clicked. Default: true */
46
+ closeOnBackdrop?: boolean;
47
+ /** Whether the dialog closes when Escape is pressed. Default: true */
48
+ closeOnEsc?: boolean;
49
+ /** Dialog content. */
25
50
  children?: ReactNode;
51
+ /** Visual title text. Referenced via aria-labelledby on the dialog element. */
52
+ label?: string;
53
+ /** Accessible label for dialogs without a visible title. */
54
+ 'aria-label'?: string;
55
+ /** Icon rendered in the dialog. Position controlled by iconSlot. */
56
+ icon?: ReactElement;
57
+ showIcon?: boolean;
58
+ iconColor?: SurfaceColor;
59
+ /** Where the icon is placed. Default: leading */
60
+ iconSlot?: DialogIconSlot;
61
+ /** Alignment of the title text. Default: start */
62
+ titleAlign?: 'start' | 'center' | 'end';
63
+ /** Full leading slot content for the title area. */
64
+ leading?: ReactNode;
65
+ /** Trailing slot content for the title area. */
66
+ trailing?: ReactNode;
67
+ /** Action buttons rendered in the dialog. */
68
+ actions?: ReactNode;
69
+ /** Where actions are placed. Default: inline for fullscreen, bottom otherwise (MD3) */
70
+ actionsPlacement?: 'top' | 'subtitle' | 'bottom' | 'inline';
71
+ /** Alignment of action buttons. Default: end (MD3) */
72
+ actionsAlign?: 'start' | 'center' | 'end';
73
+ /** Stack actions vertically instead of horizontally. Default: false (MD3) */
74
+ actionsStack?: boolean;
75
+ /** Maximum number of visible actions before the rest collapse into an overflow menu. Only applies when actionsPosition is inline. */
76
+ maxActions?: number;
77
+ /** Accessible label for the overflow actions button. Default: "More actions" */
78
+ moreLabel?: string;
79
+ /** Custom icon for the overflow actions button. */
80
+ moreIcon?: ReactElement;
81
+ /** Renders a close button in the trailing slot. */
82
+ showClose?: boolean;
83
+ /** Custom icon for the close button. */
84
+ closeIcon?: ReactElement;
85
+ /** Renders a back button in the leading slot. */
86
+ showBack?: boolean;
87
+ /** Custom icon for the back button. */
88
+ backIcon?: ReactElement;
89
+ /** Handler for the back button. Defaults to onClose. */
90
+ onBack?: () => void;
91
+ /** Additional class names for the dialog panel. */
26
92
  className?: string;
93
+ /** Motion style helper classes for the panel. */
27
94
  motionStyle?: MotionStyle;
95
+ /** Enables modal behaviour, focus trap, aria-modal, and body scroll lock when applicable. */
28
96
  modal?: boolean;
97
+ /** Focuses the dialog when opened (with modal focus trap). */
29
98
  autoFocus?: boolean;
99
+ /** Removes default panel padding. */
30
100
  flush?: boolean;
101
+ /** Renders inline without a portal (e.g. docked regions). */
31
102
  docked?: boolean;
103
+ /** Skips portaling and modal body scroll lock; for anchored overlays. */
32
104
  anchored?: boolean;
105
+ font?: ElementFont;
106
+ titleFont?: ElementFont;
33
107
  }
108
+ /**
109
+ * Low-level base component for modal and docked dialogs.
110
+ *
111
+ * Renders a backdrop and panel (via BoxBase), portaled to `#dialog-root` (created if
112
+ * missing; see {@link renderPortal}) unless `docked` or `anchored`.
113
+ *
114
+ *
115
+ * @param props Component properties.
116
+ * @function
117
+ *
118
+ * @example
119
+ * <DialogBase open={open} onClose={() => setOpen(false)} modal>
120
+ * {children}
121
+ * </DialogBase>
122
+ *
123
+ * @example
124
+ * <DialogBase open type="dockRight" anchored >
125
+ * {children}
126
+ * </DialogBase>
127
+ *
128
+ * @category Base components
129
+ */
34
130
  export declare const DialogBase: React.ForwardRefExoticComponent<DialogBaseProps & React.RefAttributes<HTMLDivElement>>;
@@ -21,7 +21,7 @@ export interface FieldBaseProps extends Omit<React.InputHTMLAttributes<HTMLInput
21
21
  outlined?: boolean;
22
22
  filled?: boolean;
23
23
  classic?: boolean;
24
- wFull?: boolean;
24
+ fullWidth?: boolean;
25
25
  /** Control shape variant. */
26
26
  shape?: ElementShape;
27
27
  /** Text color override for the label. */
@@ -1,15 +1,80 @@
1
- import { HTMLProps } from 'react';
2
- import { ElementAlign, ElementShape, ElementSize } from '../../utils/utils';
3
- import { SemanticColor } from '../../utils/color';
4
- export interface CardProps extends Omit<HTMLProps<HTMLSpanElement>, 'ref' | 'size'> {
5
- value: string | number;
6
- color?: SemanticColor;
7
- position?: ElementAlign;
8
- size?: ElementSize;
1
+ import { default as React, ElementType, ReactElement, ReactNode } from 'react';
2
+ import { BorderColor, ElementElevation, ElementFont, ElementShape, SurfaceColor } from '../../utils';
3
+ import { DialogAnimation, DialogIconSlot, MotionStyle } from '../../types';
4
+ import { BoxBaseProps } from '../base';
5
+ export type CardVariant = 'elevated' | 'filled' | 'outlined';
6
+ /**
7
+ * Props for {@link Card}.
8
+ *
9
+ * Card surface built on top of {@link BoxBase}.
10
+ *
11
+ * @category Card
12
+ */
13
+ export interface CardProps extends Omit<BoxBaseProps, 'type' | 'elementClass' | 'color' | 'elevation' | 'borderColor'> {
14
+ /** Underlying element/component. Default: `article`. */
15
+ component?: ElementType;
16
+ /** Card content. */
17
+ children?: ReactNode;
18
+ /** Card variant. Default: `elevated`. */
19
+ variant?: CardVariant;
20
+ /** Whether the card is visible. */
21
+ open?: boolean;
22
+ /** Entry/exit animation preset. Use `none` to disable. */
23
+ animation?: DialogAnimation;
24
+ /** Animation duration in ms. */
25
+ duration?: number;
26
+ /** Motion style helper classes. */
27
+ motionStyle?: MotionStyle;
28
+ /** Surface color token override. */
29
+ color?: SurfaceColor;
30
+ /** Elevation override. */
31
+ elevation?: ElementElevation;
32
+ /** Shape token. Default: `rounded` (MD3 medium corner). */
9
33
  shape?: ElementShape;
10
- raised?: boolean;
11
- elevated?: boolean;
12
- outlined?: boolean;
13
- filled?: boolean;
34
+ /** Border color override (used by outlined cards). */
35
+ borderColor?: BorderColor;
36
+ /** Visual title text. */
37
+ label?: string;
38
+ /** Accessible label for cards without visible title. */
39
+ 'aria-label'?: string;
40
+ /** Card icon. */
41
+ icon?: ReactElement;
42
+ showIcon?: boolean;
43
+ iconColor?: SurfaceColor;
44
+ iconSlot?: DialogIconSlot;
45
+ /** Title alignment. */
46
+ titleAlign?: 'start' | 'center' | 'end';
47
+ /** Header leading slot content. */
48
+ leading?: ReactNode;
49
+ /** Header trailing slot content. */
50
+ trailing?: ReactNode;
51
+ /** Header/content actions. */
52
+ actions?: ReactNode;
53
+ /** Actions placement. Default: `bottom`. */
54
+ actionsPlacement?: 'top' | 'subtitle' | 'bottom' | 'inline';
55
+ /** Actions alignment. */
56
+ actionsAlign?: 'start' | 'center' | 'end';
57
+ /** Stack actions vertically. */
58
+ actionsStack?: boolean;
59
+ /** Maximum number of visible actions before overflow. */
60
+ maxActions?: number;
61
+ /** Overflow button label. */
62
+ moreLabel?: string;
63
+ /** Overflow button icon. */
64
+ moreIcon?: ReactElement;
65
+ /** Shows close button in header. */
66
+ showClose?: boolean;
67
+ /** Close button icon override. */
68
+ closeIcon?: ReactElement;
69
+ /** Shows back button in header. */
70
+ showBack?: boolean;
71
+ /** Back button icon override. */
72
+ backIcon?: ReactElement;
73
+ /** Back button handler. Defaults to onClose. */
74
+ onBack?: () => void;
75
+ /** Close button handler. */
76
+ onClose?: () => void;
77
+ /** Header title font token. */
78
+ titleFont?: ElementFont;
14
79
  }
15
- export declare const Card: import('react').ForwardRefExoticComponent<CardProps & import('react').RefAttributes<HTMLSpanElement>>;
80
+ export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLElement>>;
@@ -1,14 +1,26 @@
1
1
  import { ReactNode } from 'react';
2
- import { BorderColor, ElementOutline, SurfaceColor } from '../../utils';
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
+ }
3
11
  export interface DialogActionsProps {
4
- children?: ReactNode;
12
+ actions?: ReactNode;
13
+ placement?: 'top' | 'subtitle' | 'bottom' | 'inline';
14
+ align?: 'start' | 'center' | 'end';
15
+ stack?: boolean;
5
16
  className?: string;
6
- color?: SurfaceColor;
7
- borderTop?: boolean;
8
- borderTopWidth?: ElementOutline;
9
- borderColor?: BorderColor;
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;
10
22
  }
11
23
  export declare const DialogActions: {
12
- ({ children, className, color, borderTop, borderTopWidth, borderColor, }: DialogActionsProps): import("react/jsx-runtime").JSX.Element | null;
24
+ ({ actions, className, placement, align, stack, maxActions, moreLabel, }: DialogActionsProps): import("react/jsx-runtime").JSX.Element | null;
13
25
  displayName: string;
14
26
  };
@@ -0,0 +1,15 @@
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>;
@@ -1,9 +1,15 @@
1
1
  import { ReactNode } from 'react';
2
+ import { SurfaceColor } from '../../utils';
3
+ import { DialogIconSlot } from '../../types';
2
4
  export interface DialogContentProps {
3
5
  children?: ReactNode;
6
+ icon?: ReactNode;
7
+ showIcon?: boolean;
8
+ iconColor?: SurfaceColor;
9
+ iconSlot?: DialogIconSlot;
4
10
  className?: string;
5
11
  }
6
12
  export declare const DialogContent: {
7
- ({ children, className }: DialogContentProps): import("react/jsx-runtime").JSX.Element | null;
13
+ ({ children, iconSlot, icon, showIcon, iconColor, className }: DialogContentProps): import("react/jsx-runtime").JSX.Element | null;
8
14
  displayName: string;
9
15
  };
@@ -0,0 +1,60 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { DialogActionsProps } from './dialogActions';
3
+ import { ElementFont, SurfaceColor } from '../../utils';
4
+ import { DialogIconSlot } from '../../types';
5
+ /**
6
+ * Props for {@link DialogHeader}.
7
+ *
8
+ * @category Dialog
9
+ */
10
+ export interface DialogHeaderProps {
11
+ /** Optional content before the back button and title row. */
12
+ leading?: ReactNode;
13
+ /** When true, renders the back affordance with {@link backIcon}. */
14
+ showBack?: boolean;
15
+ /** Invoked when the back control is activated. */
16
+ onBack?: () => void;
17
+ /** Icon element for the back control. */
18
+ backIcon?: ReactElement;
19
+ /** Resolved icon wrapper for leading/top slots; omit when no dialog icon. */
20
+ icon?: ReactElement;
21
+ showIcon?: boolean;
22
+ iconColor?: SurfaceColor;
23
+ /** Where the icon is placed inside the header vs content (see {@link DialogIconSlot}). */
24
+ iconSlot: DialogIconSlot;
25
+ /** Title alignment passed to {@link DialogTitle}. */
26
+ titleAlign?: 'start' | 'center' | 'end';
27
+ /** Title text. */
28
+ label?: string;
29
+ /** Action buttons (see {@link DialogActions}). */
30
+ actions?: DialogActionsProps['actions'];
31
+ actionsAlign?: DialogActionsProps['align'];
32
+ actionsStack?: DialogActionsProps['stack'];
33
+ maxActions?: DialogActionsProps['maxActions'];
34
+ moreLabel?: DialogActionsProps['moreLabel'];
35
+ moreIcon?: DialogActionsProps['moreIcon'];
36
+ /** Optional content after actions / before close in the header row. */
37
+ trailing?: ReactNode;
38
+ /** When true, renders the close control with {@link closeIcon}. */
39
+ showClose?: boolean;
40
+ /** Invoked when the close control is activated. */
41
+ onClose?: () => void;
42
+ /** Icon element for the close control (already resolved to default or override). */
43
+ closeIcon?: ReactElement;
44
+ font?: ElementFont;
45
+ }
46
+ /**
47
+ * Dialog title row: leading/back/icon, title, inline actions, trailing, and close.
48
+ *
49
+ * @remarks
50
+ * Non-inline actions are omitted here and rendered below the content by the parent.
51
+ *
52
+ * @function
53
+ * @param props Component properties.
54
+ *
55
+ * @category Dialog
56
+ */
57
+ export declare const DialogHeader: {
58
+ ({ leading, showBack, onBack, backIcon, icon, showIcon, iconColor, iconSlot, titleAlign, label, actions, actionsAlign, actionsStack, maxActions, moreLabel, moreIcon, trailing, showClose, onClose, closeIcon, font, }: DialogHeaderProps): import("react/jsx-runtime").JSX.Element;
59
+ displayName: string;
60
+ };
@@ -1,15 +1,19 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ElementFont, SurfaceColor } from '../../utils';
3
+ import { DialogIconSlot } from '../../types';
3
4
  export interface DialogTitleProps {
4
- icon?: ReactNode;
5
5
  label?: string;
6
- children?: ReactNode;
7
6
  className?: string;
8
7
  font?: ElementFont;
9
- color?: SurfaceColor;
10
- textColor?: SurfaceColor;
8
+ /** Resolved icon wrapper for leading/top slots; omit when no dialog icon. */
9
+ icon?: ReactNode | null;
10
+ /** Where the icon is placed inside the header vs content (see {@link DialogIconSlot}). */
11
+ iconSlot?: DialogIconSlot;
12
+ showIcon?: boolean;
13
+ iconColor?: SurfaceColor;
14
+ align?: 'start' | 'center' | 'end';
11
15
  }
12
16
  export declare const DialogTitle: {
13
- ({ icon, label, children, className, font }: DialogTitleProps): import("react/jsx-runtime").JSX.Element | null;
17
+ ({ label, icon, iconSlot, className, iconColor, showIcon, align, font, }: DialogTitleProps): import("react/jsx-runtime").JSX.Element | null;
14
18
  displayName: string;
15
19
  };
@@ -1,6 +1,7 @@
1
1
  export * from './dialog';
2
2
  export * from './dialogActions';
3
3
  export * from './dialogContent';
4
+ export * from './dialogHeader';
4
5
  export * from './dialogTitle';
5
6
  export * from './drawer';
6
7
  export * from './bottomSheet';
@@ -1,9 +1,10 @@
1
1
  import { default as React, ElementType, ReactNode } from 'react';
2
- import { ElementFocusEffect, ElementFont, ElementHoverEffect, ElementPressedEffect, SurfaceColor } from '../../utils';
2
+ import { BaseColor, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementPressedEffect } from '../../utils';
3
3
  /**
4
- * Props for the Link component.
4
+ * Props for {@link Link}.
5
5
  *
6
- * Inline link element with optional leading and trailing content and animated underline.
6
+ * Polymorphic inline link that can render as a native anchor or custom navigation component.
7
+ * Supports optional leading/trailing visuals, underline behavior, and interaction effects.
7
8
  *
8
9
  * @category Link
9
10
  */
@@ -18,14 +19,14 @@ export type LinkProps<T extends ElementType = 'a'> = {
18
19
  leading?: ReactNode;
19
20
  /** Trailing visual element. */
20
21
  trailing?: ReactNode;
21
- /** Surface color token applied to text. */
22
- color?: SurfaceColor;
22
+ /** Color token applied to text. */
23
+ color?: BaseColor;
23
24
  /** Underline visibility behavior. */
24
25
  underline?: 'none' | 'hover' | 'always';
25
26
  /** Font token applied to content. */
26
27
  font?: ElementFont;
27
28
  /** Opens link in new tab with security attributes. */
28
- isExternal?: boolean;
29
+ external?: boolean;
29
30
  /** Accessibility label override. */
30
31
  'aria-label'?: string;
31
32
  /** Additional class applied to the root element. */
@@ -44,15 +45,13 @@ export type LinkProps<T extends ElementType = 'a'> = {
44
45
  underlineAnimation?: 'scale' | 'fade';
45
46
  } & Omit<React.ComponentPropsWithoutRef<T>, 'as' | 'color' | 'children' | 'className'>;
46
47
  export interface LinkComponent {
48
+ /**
49
+ * Renders a polymorphic link element.
50
+ *
51
+ * @typeParam T - Element type rendered by the component.
52
+ * @param props - Link configuration and props for the rendered element type.
53
+ */
47
54
  <T extends ElementType = 'a'>(props: LinkProps<T>): ReactNode;
48
55
  displayName?: string;
49
56
  }
50
- /**
51
- * Inline link component with optional leading and trailing content and animated underline.
52
- *
53
- * @function
54
- * @param props Component properties.
55
- *
56
- * @category Link
57
- */
58
57
  export declare const Link: LinkComponent;
@@ -1,6 +1,6 @@
1
1
  import { default as React, HTMLAttributes, ReactNode, RefObject } from 'react';
2
2
  import { MotionAnimation, MotionStyle } from '../../types';
3
- import { BorderColor, ElementAlign, ElementBorder, ElementDensity, ElementElevation, ElementFloatingMode, ElementFocusEffect, ElementFont, ElementSelectedEffect, ElementShape, ElementTouchEffect, SurfaceColor } from '../../utils';
3
+ import { BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFloatingMode, ElementFocusEffect, ElementFont, ElementPlacement, ElementSelectedEffect, ElementShape, ElementTouchEffect, SurfaceColor } from '../../utils';
4
4
  /**
5
5
  * Visual style preset for the Menu component.
6
6
  *
@@ -85,7 +85,7 @@ export interface MenuProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>
85
85
  /** Opens the menu on pointer hover. */
86
86
  openOnHover?: boolean;
87
87
  /** Preferred placement relative to the anchor. */
88
- placement?: ElementAlign;
88
+ placement?: ElementPlacement;
89
89
  /** Icon used for checked radio items. */
90
90
  radioCheckedIcon?: ReactNode;
91
91
  /** Icon used for unchecked radio items. */
@@ -1,5 +1,5 @@
1
1
  import { default as React, ReactNode } from 'react';
2
- import { ElementAlign, ElementDensity, ElementFocusEffect, ElementFont, ElementSize, ElementTextPlacement, SurfaceColor } from '../../utils';
2
+ import { ElementDensity, ElementFocusEffect, ElementFont, ElementPlacement, ElementSize, ElementTextPlacement, SurfaceColor } from '../../utils';
3
3
  /**
4
4
  * Props for the Rating component.
5
5
  *
@@ -51,7 +51,7 @@ export interface RatingProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
51
51
  /** Placement of label and description relative to the control. */
52
52
  textPlacement?: ElementTextPlacement;
53
53
  /** Tooltip alignment relative to the control. */
54
- tooltipAlign?: ElementAlign;
54
+ tooltipAlign?: ElementPlacement;
55
55
  /** Current rating value when used as a controlled component. */
56
56
  value?: number;
57
57
  }