@aurora-ds/components 1.5.0 → 1.7.0
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/dist/cjs/index.js +216 -34
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +205 -35
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +305 -13
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, TdHTMLAttributes, ThHTMLAttributes, AriaAttributes, ErrorInfo, Component, FormEvent, InputHTMLAttributes, MouseEvent, AriaRole } from 'react';
|
|
2
|
+
import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, TdHTMLAttributes, ThHTMLAttributes, AriaAttributes, ErrorInfo, Component, FormEvent, InputHTMLAttributes, MouseEvent, AriaRole, RefObject, RefCallback } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
declare const lightPalette: {
|
|
@@ -400,9 +400,13 @@ type LinkColor = 'default' | 'secondary';
|
|
|
400
400
|
|
|
401
401
|
/** SVG icon component, e.g. imported via `?react` or taken from the `IconRegistry`. */
|
|
402
402
|
type LinkIcon = ComponentType<SVGProps<SVGSVGElement>>;
|
|
403
|
-
type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
403
|
+
type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {
|
|
404
404
|
/** React 19 ref prop. */
|
|
405
405
|
ref?: Ref<HTMLAnchorElement>;
|
|
406
|
+
/** Visible link text — rendered inside a `<Text>` element. */
|
|
407
|
+
label: string;
|
|
408
|
+
/** Font size token applied to the label text. @default 'md' */
|
|
409
|
+
fontSize?: keyof Theme['fontSize'];
|
|
406
410
|
/** Controls when the underline is visible. @default 'hover' */
|
|
407
411
|
underline?: LinkUnderline;
|
|
408
412
|
/**
|
|
@@ -428,10 +432,10 @@ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
428
432
|
*
|
|
429
433
|
* @example
|
|
430
434
|
* // Standard href
|
|
431
|
-
* <Link href="/about"
|
|
435
|
+
* <Link href="/about" label="About" />
|
|
432
436
|
*
|
|
433
437
|
* // React Router (no href)
|
|
434
|
-
* <Link onClick={() => navigate('/about')}
|
|
438
|
+
* <Link onClick={() => navigate('/about')} label="About" />
|
|
435
439
|
*/
|
|
436
440
|
href?: string;
|
|
437
441
|
/** SVG icon rendered before the text. */
|
|
@@ -447,11 +451,11 @@ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
447
451
|
* In that case the component stays accessible: it gets `role="link"`,
|
|
448
452
|
* `tabIndex={0}` and keyboard Enter support automatically.
|
|
449
453
|
*
|
|
450
|
-
* @example <Link href='/about'
|
|
451
|
-
* @example <Link href='https://example.com'
|
|
452
|
-
* @example <Link href='/profile' underline='always' startIcon={UserIcon}
|
|
453
|
-
* @example <Link href='/terms' underline='none'
|
|
454
|
-
* @example <Link onClick={() => navigate('/about')}
|
|
454
|
+
* @example <Link href='/about' label='About' />
|
|
455
|
+
* @example <Link href='https://example.com' label='External site' external />
|
|
456
|
+
* @example <Link href='/profile' underline='always' startIcon={UserIcon} label='Profile' />
|
|
457
|
+
* @example <Link href='/terms' underline='none' label='Terms' />
|
|
458
|
+
* @example <Link onClick={() => navigate('/about')} label='About (SPA)' />
|
|
455
459
|
*/
|
|
456
460
|
declare const Link: FC<LinkProps>;
|
|
457
461
|
|
|
@@ -1133,7 +1137,7 @@ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryS
|
|
|
1133
1137
|
static getDerivedStateFromError: (error: Error) => ErrorBoundaryState;
|
|
1134
1138
|
componentDidCatch(error: Error, info: ErrorInfo): void;
|
|
1135
1139
|
private reset;
|
|
1136
|
-
render(): string | number | bigint | boolean | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> |
|
|
1140
|
+
render(): string | number | bigint | boolean | react_jsx_runtime.JSX.Element | Iterable<react.ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<react.ReactNode> | null | undefined> | null | undefined;
|
|
1137
1141
|
}
|
|
1138
1142
|
|
|
1139
1143
|
type DefaultErrorFallbackProps = {
|
|
@@ -2649,6 +2653,11 @@ type AlertTitleProps = {
|
|
|
2649
2653
|
* (e.g. `<Icon icon={MyIcon} strokeColor="primaryMain" />`) for full customisation.
|
|
2650
2654
|
*/
|
|
2651
2655
|
icon?: ComponentType<SVGProps<SVGSVGElement>> | ReactNode;
|
|
2656
|
+
/**
|
|
2657
|
+
* Callback fired when the user clicks the dismiss (×) button.
|
|
2658
|
+
* When provided, a close `IconButton` is rendered on the right side of the title row.
|
|
2659
|
+
*/
|
|
2660
|
+
onDismiss?: () => void;
|
|
2652
2661
|
};
|
|
2653
2662
|
|
|
2654
2663
|
type AlertBodyProps = {
|
|
@@ -2656,10 +2665,25 @@ type AlertBodyProps = {
|
|
|
2656
2665
|
children: ReactNode;
|
|
2657
2666
|
};
|
|
2658
2667
|
|
|
2668
|
+
type AlertActionsProps = {
|
|
2669
|
+
/**
|
|
2670
|
+
* Action elements to render inside the actions row.
|
|
2671
|
+
* Typically one or more `<Button>` or `<Link>` components.
|
|
2672
|
+
*
|
|
2673
|
+
* @example
|
|
2674
|
+
* <Alert.Actions>
|
|
2675
|
+
* <Button size="sm" variant="outlined">Retry</Button>
|
|
2676
|
+
* <Button size="sm" variant="text">Dismiss</Button>
|
|
2677
|
+
* </Alert.Actions>
|
|
2678
|
+
*/
|
|
2679
|
+
children: ReactNode;
|
|
2680
|
+
};
|
|
2681
|
+
|
|
2659
2682
|
type AlertVariant = 'default' | 'success' | 'error' | 'warning' | 'info';
|
|
2660
2683
|
type AlertComponent = FC<AlertProps> & {
|
|
2661
2684
|
Title: FC<AlertTitleProps>;
|
|
2662
2685
|
Body: FC<AlertBodyProps>;
|
|
2686
|
+
Actions: FC<AlertActionsProps>;
|
|
2663
2687
|
};
|
|
2664
2688
|
|
|
2665
2689
|
declare const Alert: AlertComponent;
|
|
@@ -2701,7 +2725,7 @@ type DialogProps = {
|
|
|
2701
2725
|
minWidth?: number | string;
|
|
2702
2726
|
/** Minimum height of the dialog panel. Accepts numbers (px) or any CSS height value. */
|
|
2703
2727
|
minHeight?: number | string;
|
|
2704
|
-
/** Whether the dialog takes the full viewport
|
|
2728
|
+
/** Whether the dialog takes the full viewport on all screen sizes. @default false */
|
|
2705
2729
|
fullscreen?: boolean;
|
|
2706
2730
|
/**
|
|
2707
2731
|
* Accessible label — use when Dialog.Header is not present.
|
|
@@ -2739,6 +2763,29 @@ declare const Dialog: DialogComponent;
|
|
|
2739
2763
|
|
|
2740
2764
|
/** Where the menu opens relative to its anchor. */
|
|
2741
2765
|
type MenuPlacement = 'bottom' | 'right';
|
|
2766
|
+
type UseMenuPositionOptions = {
|
|
2767
|
+
/** Anchor element the menu is positioned relative to. */
|
|
2768
|
+
anchorEl?: HTMLElement | null;
|
|
2769
|
+
/** Whether the menu is currently open. */
|
|
2770
|
+
open: boolean;
|
|
2771
|
+
/** Ref to the menu panel element — used to measure actual dimensions. */
|
|
2772
|
+
menuRef: RefObject<HTMLElement | null>;
|
|
2773
|
+
/** Minimum width override. Defaults to the anchor element's width. */
|
|
2774
|
+
minWidth?: number | string;
|
|
2775
|
+
/** Gap in px between anchor and menu. @default 4 */
|
|
2776
|
+
gap?: number;
|
|
2777
|
+
/**
|
|
2778
|
+
* Where the menu opens relative to the anchor.
|
|
2779
|
+
* - `'bottom'` — opens below the anchor (default dropdown).
|
|
2780
|
+
* - `'right'` — opens beside the anchor (submenu), flipping to the left when there is no room.
|
|
2781
|
+
* @default 'bottom'
|
|
2782
|
+
*/
|
|
2783
|
+
placement?: MenuPlacement;
|
|
2784
|
+
};
|
|
2785
|
+
type UseMenuPositionResult = {
|
|
2786
|
+
/** Computed inline style to apply on the menu panel (top, left, minWidth). */
|
|
2787
|
+
style: CSSProperties;
|
|
2788
|
+
};
|
|
2742
2789
|
|
|
2743
2790
|
type MenuProps = {
|
|
2744
2791
|
/** Whether the menu is visible. */
|
|
@@ -2867,9 +2914,254 @@ declare const Menu: MenuComponent;
|
|
|
2867
2914
|
*/
|
|
2868
2915
|
declare const Tooltip: FC<TooltipProps>;
|
|
2869
2916
|
|
|
2917
|
+
/**
|
|
2918
|
+
* Locks scrolling on `document.body` while `active` is true.
|
|
2919
|
+
*
|
|
2920
|
+
* Preserves the current scroll position and keeps the scrollbar gutter
|
|
2921
|
+
* (`overflow-y: scroll`) to avoid horizontal layout shift when the scrollbar
|
|
2922
|
+
* disappears. The original styles and scroll position are restored on cleanup.
|
|
2923
|
+
*
|
|
2924
|
+
* @example useBodyScrollLock(isDialogOpen)
|
|
2925
|
+
*/
|
|
2926
|
+
declare const useBodyScrollLock: (active: boolean) => void;
|
|
2927
|
+
|
|
2928
|
+
type UseControllableStateOptions<T> = {
|
|
2929
|
+
/** Controlled value. When defined, the hook operates in controlled mode. */
|
|
2930
|
+
value?: T;
|
|
2931
|
+
/** Initial value used in uncontrolled mode. */
|
|
2932
|
+
defaultValue: T;
|
|
2933
|
+
/** Called with the next value whenever `setValue` runs. */
|
|
2934
|
+
onChange?: (value: T) => void;
|
|
2935
|
+
};
|
|
2936
|
+
type UseControllableStateResult<T> = [T, (next: T) => void];
|
|
2937
|
+
|
|
2938
|
+
/**
|
|
2939
|
+
* Unifies controlled and uncontrolled value handling.
|
|
2940
|
+
*
|
|
2941
|
+
* - When `value` is provided the hook is controlled: the returned value mirrors
|
|
2942
|
+
* it and internal state is never used to render.
|
|
2943
|
+
* - Otherwise it is uncontrolled: state starts at `defaultValue` and updates
|
|
2944
|
+
* internally.
|
|
2945
|
+
*
|
|
2946
|
+
* In both modes `setValue` calls `onChange` with the next value, so consumers
|
|
2947
|
+
* have a single code path regardless of mode.
|
|
2948
|
+
*
|
|
2949
|
+
* @example
|
|
2950
|
+
* const [value, setValue] = useControllableState({ value, defaultValue: '', onChange })
|
|
2951
|
+
*/
|
|
2952
|
+
declare const useControllableState: <T>({ value, defaultValue, onChange, }: UseControllableStateOptions<T>) => UseControllableStateResult<T>;
|
|
2953
|
+
|
|
2954
|
+
/**
|
|
2955
|
+
* Traps Tab / Shift+Tab focus within the element referenced by `containerRef`
|
|
2956
|
+
* while `active` is true. Focusable elements are recomputed on each Tab press
|
|
2957
|
+
* so dynamic content is handled correctly. Required for accessible modals.
|
|
2958
|
+
*
|
|
2959
|
+
* @example useFocusTrap(panelRef, open)
|
|
2960
|
+
*/
|
|
2961
|
+
declare const useFocusTrap: (containerRef: RefObject<HTMLElement | null>, active: boolean) => void;
|
|
2962
|
+
|
|
2963
|
+
type KeyPressHandler = (event: KeyboardEvent) => void;
|
|
2964
|
+
/** Map of key name → handler, for handling multiple keys in a single hook call. */
|
|
2965
|
+
type KeyPressMap = Partial<Record<KeyboardEvent['key'], KeyPressHandler>>;
|
|
2966
|
+
type UseKeyPressOptions = {
|
|
2967
|
+
/** Only trigger when this element is the target (defaults to the whole document) */
|
|
2968
|
+
target?: EventTarget | null;
|
|
2969
|
+
/** Whether the listener is active */
|
|
2970
|
+
enabled?: boolean;
|
|
2971
|
+
};
|
|
2972
|
+
|
|
2973
|
+
/**
|
|
2974
|
+
* Listens to keyboard events and dispatches to the matching handler in `keyMap`.
|
|
2975
|
+
* A single hook call can handle multiple keys.
|
|
2976
|
+
*
|
|
2977
|
+
* @example
|
|
2978
|
+
* ` s
|
|
2979
|
+
* useKeyPress(
|
|
2980
|
+
* { ArrowDown: onDown, ArrowUp: onUp, Enter: onEnter, Escape: onClose },
|
|
2981
|
+
* { enabled: isOpen }
|
|
2982
|
+
* )
|
|
2983
|
+
* `
|
|
2984
|
+
*/
|
|
2985
|
+
declare const useKeyPress: (keyMap: KeyPressMap, { target, enabled }?: UseKeyPressOptions) => void;
|
|
2986
|
+
|
|
2987
|
+
/**
|
|
2988
|
+
* Responsive breakpoints (min-width, mobile-first).
|
|
2989
|
+
* Keep in sync with themeBreakpoints.
|
|
2990
|
+
*/
|
|
2991
|
+
declare const BREAKPOINTS: {
|
|
2992
|
+
readonly xs: 480;
|
|
2993
|
+
readonly sm: 640;
|
|
2994
|
+
readonly md: 768;
|
|
2995
|
+
readonly lg: 1024;
|
|
2996
|
+
readonly xl: 1280;
|
|
2997
|
+
readonly '2xl': 1536;
|
|
2998
|
+
};
|
|
2999
|
+
|
|
3000
|
+
type Breakpoint = keyof typeof BREAKPOINTS;
|
|
3001
|
+
/**
|
|
3002
|
+
* Listens to a CSS media query string and returns whether it currently matches.
|
|
3003
|
+
*
|
|
3004
|
+
* @param query - A valid CSS media query string, e.g. `'(max-width: 639px)'`.
|
|
3005
|
+
* @returns `true` when the media query matches, `false` otherwise.
|
|
3006
|
+
*
|
|
3007
|
+
* @example
|
|
3008
|
+
* const isMobile = useMediaQuery('(max-width: 639px)')
|
|
3009
|
+
*/
|
|
3010
|
+
declare const useMediaQuery: (query: string) => boolean;
|
|
3011
|
+
/**
|
|
3012
|
+
* Returns `true` when the viewport width is **below** the given breakpoint (mobile-first max).
|
|
3013
|
+
*
|
|
3014
|
+
* @param breakpoint - One of the Aurora breakpoints: `xs` | `sm` | `md` | `lg` | `xl` | `2xl`.
|
|
3015
|
+
*
|
|
3016
|
+
* @example
|
|
3017
|
+
* const isMobile = useBreakpointMax('sm') // true when width < 640px
|
|
3018
|
+
*/
|
|
3019
|
+
declare const useBreakpointMax: (breakpoint: Breakpoint) => boolean;
|
|
3020
|
+
/**
|
|
3021
|
+
* Returns `true` when the viewport width is **at or above** the given breakpoint.
|
|
3022
|
+
*
|
|
3023
|
+
* @param breakpoint - One of the Aurora breakpoints: `xs` | `sm` | `md` | `lg` | `xl` | `2xl`.
|
|
3024
|
+
*
|
|
3025
|
+
* @example
|
|
3026
|
+
* const isDesktop = useBreakpointMin('md') // true when width >= 768px
|
|
3027
|
+
*/
|
|
3028
|
+
declare const useBreakpointMin: (breakpoint: Breakpoint) => boolean;
|
|
3029
|
+
|
|
3030
|
+
/**
|
|
3031
|
+
* Merges several refs (callback or object) into a single stable callback ref.
|
|
3032
|
+
*
|
|
3033
|
+
* Useful when a component needs an internal ref while still forwarding the
|
|
3034
|
+
* consumer's `ref`. The returned callback keeps a stable identity across
|
|
3035
|
+
* renders to avoid detach/attach churn, always assigning to the latest refs.
|
|
3036
|
+
*
|
|
3037
|
+
* @example
|
|
3038
|
+
* const inputRef = useRef<HTMLInputElement | null>(null)
|
|
3039
|
+
* const mergedRef = useMergedRefs(ref, inputRef)
|
|
3040
|
+
*/
|
|
3041
|
+
declare const useMergedRefs: <T>(...refs: Array<Ref<T> | undefined>) => RefCallback<T>;
|
|
3042
|
+
|
|
3043
|
+
type UseTransitionRenderReturnType = {
|
|
3044
|
+
/** Whether the element should be mounted in the DOM. */
|
|
3045
|
+
isVisible: boolean;
|
|
3046
|
+
/** Whether the fade-in CSS class should be applied. */
|
|
3047
|
+
isFadingIn: boolean;
|
|
3048
|
+
};
|
|
3049
|
+
|
|
3050
|
+
/**
|
|
3051
|
+
* Manages mount/unmount transitions with a two-phase approach (visible → fading-in).
|
|
3052
|
+
*
|
|
3053
|
+
* Opening sequence:
|
|
3054
|
+
* 1. `useLayoutEffect` sets `isVisible=true` synchronously before the browser paints
|
|
3055
|
+
* → element is in the DOM at its initial hidden state on the very first frame.
|
|
3056
|
+
* 2. Double `requestAnimationFrame` in `useEffect` waits for two rendered frames
|
|
3057
|
+
* before setting `isFadingIn=true`, guaranteeing the CSS transition always starts
|
|
3058
|
+
* from the painted hidden state (prevents flickering).
|
|
3059
|
+
*
|
|
3060
|
+
* Closing sequence:
|
|
3061
|
+
* `isFadingIn=false` → CSS transition plays → after `duration` ms → `isVisible=false`.
|
|
3062
|
+
*
|
|
3063
|
+
* @param isOpen - Whether the element should be shown.
|
|
3064
|
+
* @param duration - Transition duration in milliseconds (defaults to `DEFAULT_TRANSITION_DURATION_MS`).
|
|
3065
|
+
*/
|
|
3066
|
+
declare const useTransitionRender: (isOpen: boolean, duration?: number) => UseTransitionRenderReturnType;
|
|
3067
|
+
|
|
3068
|
+
type UseListKeyNavOptions = {
|
|
3069
|
+
/** Total number of navigable items. */
|
|
3070
|
+
itemCount: number;
|
|
3071
|
+
/** Whether keyboard navigation is active (menu is open). */
|
|
3072
|
+
enabled: boolean;
|
|
3073
|
+
/** Called with the flat index of the item confirmed via Enter. */
|
|
3074
|
+
onSelect: (index: number) => void;
|
|
3075
|
+
/** Returns true if the item at a given index should be skipped during navigation. */
|
|
3076
|
+
isDisabled?: (index: number) => boolean;
|
|
3077
|
+
/** Whether navigation wraps around at boundaries. @default true */
|
|
3078
|
+
loop?: boolean;
|
|
3079
|
+
/** Index to focus when navigation becomes active. @default 0 */
|
|
3080
|
+
initialIndex?: number;
|
|
3081
|
+
};
|
|
3082
|
+
type UseListKeyNavResult = {
|
|
3083
|
+
/** Currently keyboard-focused item index, or -1 when navigation is inactive. */
|
|
3084
|
+
focusedIndex: number;
|
|
3085
|
+
/** Manually override the focused index. */
|
|
3086
|
+
setFocusedIndex: (index: number) => void;
|
|
3087
|
+
};
|
|
3088
|
+
|
|
3089
|
+
/**
|
|
3090
|
+
* Manages keyboard navigation for a listbox-style menu.
|
|
3091
|
+
*
|
|
3092
|
+
* Binds ArrowDown, ArrowUp, Home, End, and Enter using `useKeyPress`.
|
|
3093
|
+
* Automatically skips disabled items and optionally wraps around (loop).
|
|
3094
|
+
* Resets focus when `enabled` toggles.
|
|
3095
|
+
*/
|
|
3096
|
+
declare const useListKeyNav: ({ itemCount, enabled, onSelect, isDisabled, loop, initialIndex, }: UseListKeyNavOptions) => UseListKeyNavResult;
|
|
3097
|
+
|
|
3098
|
+
/**
|
|
3099
|
+
* Computes and continuously updates the `position: fixed` style for a menu panel.
|
|
3100
|
+
*
|
|
3101
|
+
* Positioning strategy:
|
|
3102
|
+
* - `placement="bottom"` (default): the menu opens below the anchor. If it would
|
|
3103
|
+
* overflow the bottom of the viewport, `top` is shifted up so the menu bottom
|
|
3104
|
+
* lands at `viewportHeight - margin` (never going off the top of the screen).
|
|
3105
|
+
* - `placement="right"` (submenu): the menu opens to the right of the anchor and
|
|
3106
|
+
* flips to the left when there is no horizontal room. Its `top` aligns with the
|
|
3107
|
+
* anchor top and is clamped to the viewport.
|
|
3108
|
+
*
|
|
3109
|
+
* Scroll handling: the page scroll is locked while the menu is open (see
|
|
3110
|
+
* `MenuPanel`), so the anchor cannot move out from under the menu. As a safety
|
|
3111
|
+
* net for nested scroll containers, the menu re-positions on scroll/resize so it
|
|
3112
|
+
* always stays attached to its anchor.
|
|
3113
|
+
*
|
|
3114
|
+
* Uses a two-pass strategy: first render with `menuHeight = 0`, then a rAF
|
|
3115
|
+
* recompute with the actual rendered size to apply any overflow offset.
|
|
3116
|
+
*/
|
|
3117
|
+
declare const useMenuPosition: ({ anchorEl, open, menuRef, minWidth, gap, placement, }: UseMenuPositionOptions) => UseMenuPositionResult;
|
|
3118
|
+
|
|
3119
|
+
type UseTooltipPositionOptions = {
|
|
3120
|
+
/** Preferred placement of the tooltip relative to its trigger. */
|
|
3121
|
+
placement: TooltipPlacement;
|
|
3122
|
+
};
|
|
3123
|
+
type TooltipPosition = {
|
|
3124
|
+
top: number;
|
|
3125
|
+
left: number;
|
|
3126
|
+
};
|
|
3127
|
+
type UseTooltipPositionResult = {
|
|
3128
|
+
/** Ref to attach to the wrapper element (trigger container). */
|
|
3129
|
+
wrapperRef: RefObject<HTMLDivElement | null>;
|
|
3130
|
+
/** Ref to attach to the tooltip bubble element. */
|
|
3131
|
+
bubbleRef: RefObject<HTMLDivElement | null>;
|
|
3132
|
+
/** Whether the tooltip bubble should be mounted in the DOM. */
|
|
3133
|
+
isVisible: boolean;
|
|
3134
|
+
/** Whether the tooltip has faded in (drives opacity/scale transition). */
|
|
3135
|
+
isFadingIn: boolean;
|
|
3136
|
+
/** Computed fixed position for the tooltip bubble. */
|
|
3137
|
+
position: TooltipPosition;
|
|
3138
|
+
handleMouseEnter: () => void;
|
|
3139
|
+
handleMouseLeave: () => void;
|
|
3140
|
+
handleFocus: () => void;
|
|
3141
|
+
handleBlur: () => void;
|
|
3142
|
+
/** Hides the tooltip immediately (used when hideOnClick=true). */
|
|
3143
|
+
handleClick: () => void;
|
|
3144
|
+
};
|
|
3145
|
+
|
|
3146
|
+
/**
|
|
3147
|
+
* Computes and continuously updates the `position: fixed` coordinates for a
|
|
3148
|
+
* tooltip bubble, clamping it to the viewport on all four sides.
|
|
3149
|
+
*
|
|
3150
|
+
* Positioning strategy (two-pass):
|
|
3151
|
+
* - First pass: mount the bubble at the preferred position.
|
|
3152
|
+
* - Second pass (rAF): read the actual rendered size and clamp all sides.
|
|
3153
|
+
*
|
|
3154
|
+
* Handles:
|
|
3155
|
+
* - All four placements: top, bottom, left, right.
|
|
3156
|
+
* - Screen-edge clamping so the tooltip never overflows any side.
|
|
3157
|
+
* - Fade-in animation (sets `isFadingIn` on next tick to trigger CSS transition).
|
|
3158
|
+
* - Mouse/focus event handlers for show/hide.
|
|
3159
|
+
*/
|
|
3160
|
+
declare const useTooltipPosition: ({ placement, }: UseTooltipPositionOptions) => UseTooltipPositionResult;
|
|
3161
|
+
|
|
2870
3162
|
declare const lightTheme: Theme;
|
|
2871
3163
|
|
|
2872
3164
|
declare const darkTheme: Theme;
|
|
2873
3165
|
|
|
2874
|
-
export { Accordion, Alert, Article, Aside, Avatar, AvatarGroup, Backdrop, Badge, Box, Breadcrumb, Button, Card, Checkbox, DatePicker, DefaultErrorFallback, Dialog, Drawer, ErrorBoundary, Fab, Footer, Form, Grid, Header, Icon, IconButton, Image, InfoBubble, Link, LoaderScreen, Main, Menu, Nav, Pagination, RadioButton, RadioGroup, Section, Select, Separator, Skeleton, Stack, SvgImage, Switch, Table, Tabs, Text, TextField, ToggleButton, ToggleGroup, ToggleIconButton, Tooltip, darkTheme, lightTheme, useDrawerContext };
|
|
2875
|
-
export type { AccordionBodyProps, AccordionProps, AccordionTitleProps, AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, ArticleProps, AsideProps, AvatarColor, AvatarGroupOverlap, AvatarGroupProps, AvatarProps, AvatarShape, AvatarSize, BackdropProps, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, BreadcrumbItemProps, BreadcrumbProps, BreadcrumbSeparator, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, CheckboxProps, DatePickerProps, DatePickerSize, DatePickerStatus, DefaultErrorFallbackProps, DialogBodyProps, DialogHeaderProps, DialogProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerItemIcon, DrawerItemProps, DrawerProps, DrawerVariant, ErrorBoundaryFallbackRenderProps, ErrorBoundaryProps, FabColor, FabIcon, FabPlacement, FabProps, FabSize, FooterProps, FormProps, GridProps, GridStyleProps, HeaderProps, IconButtonProps, IconProps, IconStyleParams, ImageProps, InfoBubbleProps, LinkColor, LinkIcon, LinkProps, LinkUnderline, LoaderScreenProps, MainProps, MenuGroupProps, MenuItemProps, MenuItemRole, MenuPlacement, MenuProps, NavProps, PaginationProps, PaginationShape, PaginationSize, Palette, RadioButtonProps, RadioGroupProps, SectionProps, SelectOption, SelectProps, SeparatorOrientation, SeparatorProps, SeparatorStyleParams, SeparatorThickness, SkeletonAnimation, SkeletonProps, SkeletonVariant, StackProps, SvgImageProps, SwitchColor, SwitchProps, SwitchSize, TabItemProps, TableAlign, TableBodyProps, TableCellProps, TableColumn, TableFootProps, TableHeadProps, TableHeaderCellProps, TableLayout, TableProps, TableRowProps, TabsListProps, TabsPanelProps, TabsProps, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, ToggleButtonProps, ToggleButtonVariant, ToggleGroupProps, ToggleIconButtonProps, TooltipPlacement, TooltipProps, WeekStart };
|
|
3166
|
+
export { Accordion, Alert, Article, Aside, Avatar, AvatarGroup, Backdrop, Badge, Box, Breadcrumb, Button, Card, Checkbox, DatePicker, DefaultErrorFallback, Dialog, Drawer, ErrorBoundary, Fab, Footer, Form, Grid, Header, Icon, IconButton, Image, InfoBubble, Link, LoaderScreen, Main, Menu, Nav, Pagination, RadioButton, RadioGroup, Section, Select, Separator, Skeleton, Stack, SvgImage, Switch, Table, Tabs, Text, TextField, ToggleButton, ToggleGroup, ToggleIconButton, Tooltip, darkTheme, lightTheme, useBodyScrollLock, useBreakpointMax, useBreakpointMin, useControllableState, useDrawerContext, useFocusTrap, useKeyPress, useListKeyNav, useMediaQuery, useMenuPosition, useMergedRefs, useTooltipPosition, useTransitionRender };
|
|
3167
|
+
export type { AccordionBodyProps, AccordionProps, AccordionTitleProps, AlertActionsProps, AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, ArticleProps, AsideProps, AvatarColor, AvatarGroupOverlap, AvatarGroupProps, AvatarProps, AvatarShape, AvatarSize, BackdropProps, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, BreadcrumbItemProps, BreadcrumbProps, BreadcrumbSeparator, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, CheckboxProps, DatePickerProps, DatePickerSize, DatePickerStatus, DefaultErrorFallbackProps, DialogBodyProps, DialogHeaderProps, DialogProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerItemIcon, DrawerItemProps, DrawerProps, DrawerVariant, ErrorBoundaryFallbackRenderProps, ErrorBoundaryProps, FabColor, FabIcon, FabPlacement, FabProps, FabSize, FooterProps, FormProps, GridProps, GridStyleProps, HeaderProps, IconButtonProps, IconProps, IconStyleParams, ImageProps, InfoBubbleProps, KeyPressHandler, KeyPressMap, LinkColor, LinkIcon, LinkProps, LinkUnderline, LoaderScreenProps, MainProps, MenuGroupProps, MenuItemProps, MenuItemRole, MenuPlacement, MenuProps, NavProps, PaginationProps, PaginationShape, PaginationSize, Palette, RadioButtonProps, RadioGroupProps, SectionProps, SelectOption, SelectProps, SeparatorOrientation, SeparatorProps, SeparatorStyleParams, SeparatorThickness, SkeletonAnimation, SkeletonProps, SkeletonVariant, StackProps, SvgImageProps, SwitchColor, SwitchProps, SwitchSize, TabItemProps, TableAlign, TableBodyProps, TableCellProps, TableColumn, TableFootProps, TableHeadProps, TableHeaderCellProps, TableLayout, TableProps, TableRowProps, TabsListProps, TabsPanelProps, TabsProps, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, ToggleButtonProps, ToggleButtonVariant, ToggleGroupProps, ToggleIconButtonProps, TooltipPlacement, TooltipPosition, TooltipProps, UseControllableStateOptions, UseControllableStateResult, UseKeyPressOptions, UseListKeyNavOptions, UseListKeyNavResult, UseMenuPositionOptions, UseMenuPositionResult, UseTooltipPositionOptions, UseTooltipPositionResult, UseTransitionRenderReturnType, WeekStart };
|