@aurora-ds/components 1.6.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +101 -15
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +99 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +78 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -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
|
|
|
@@ -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.
|
|
@@ -2960,6 +2984,49 @@ type UseKeyPressOptions = {
|
|
|
2960
2984
|
*/
|
|
2961
2985
|
declare const useKeyPress: (keyMap: KeyPressMap, { target, enabled }?: UseKeyPressOptions) => void;
|
|
2962
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
|
+
|
|
2963
3030
|
/**
|
|
2964
3031
|
* Merges several refs (callback or object) into a single stable callback ref.
|
|
2965
3032
|
*
|
|
@@ -3096,5 +3163,5 @@ declare const lightTheme: Theme;
|
|
|
3096
3163
|
|
|
3097
3164
|
declare const darkTheme: Theme;
|
|
3098
3165
|
|
|
3099
|
-
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, useControllableState, useDrawerContext, useFocusTrap, useKeyPress, useListKeyNav, useMenuPosition, useMergedRefs, useTooltipPosition, useTransitionRender };
|
|
3100
|
-
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, 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 };
|
|
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 };
|