@aurora-ds/components 1.2.0 → 1.4.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 +340 -32
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +340 -34
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +122 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties, FormEvent, InputHTMLAttributes, AriaRole, AriaAttributes } from 'react';
|
|
1
|
+
import { ComponentType, SVGProps, ButtonHTMLAttributes, Ref, FC, AnchorHTMLAttributes, HTMLAttributes, ReactNode, CSSProperties, FormEvent, InputHTMLAttributes, MouseEvent, AriaRole, AriaAttributes } from 'react';
|
|
2
2
|
|
|
3
3
|
declare const lightPalette: {
|
|
4
4
|
surfaceBackground: string;
|
|
@@ -335,6 +335,8 @@ type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'
|
|
|
335
335
|
declare const IconButton: FC<IconButtonProps>;
|
|
336
336
|
|
|
337
337
|
type LinkUnderline = 'always' | 'hover' | 'none';
|
|
338
|
+
/** Controls the link color palette. `'default'` uses the brand blue, `'secondary'` uses `textSecondary`. */
|
|
339
|
+
type LinkColor = 'default' | 'secondary';
|
|
338
340
|
|
|
339
341
|
/** SVG icon component, e.g. imported via `?react` or taken from the `IconRegistry`. */
|
|
340
342
|
type LinkIcon = ComponentType<SVGProps<SVGSVGElement>>;
|
|
@@ -343,6 +345,12 @@ type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
|
343
345
|
ref?: Ref<HTMLAnchorElement>;
|
|
344
346
|
/** Controls when the underline is visible. @default 'hover' */
|
|
345
347
|
underline?: LinkUnderline;
|
|
348
|
+
/**
|
|
349
|
+
* Color palette variant. `'default'` uses the brand blue link color,
|
|
350
|
+
* `'secondary'` uses the `textSecondary` color token.
|
|
351
|
+
* @default 'default'
|
|
352
|
+
*/
|
|
353
|
+
color?: LinkColor;
|
|
346
354
|
/**
|
|
347
355
|
* Open in a new tab with `rel="noopener noreferrer"`.
|
|
348
356
|
* @a11y Recommended — warn users that a new tab will open (via visible text or `aria-label`).
|
|
@@ -1046,6 +1054,61 @@ declare const Grid: FC<GridProps>;
|
|
|
1046
1054
|
*/
|
|
1047
1055
|
declare const Stack: FC<StackProps>;
|
|
1048
1056
|
|
|
1057
|
+
/** Separator character rendered between breadcrumb items. */
|
|
1058
|
+
type BreadcrumbSeparator = '/' | '-' | '>';
|
|
1059
|
+
|
|
1060
|
+
type BreadcrumbProps = {
|
|
1061
|
+
/** Breadcrumb items — use `Breadcrumb.Item` as children. */
|
|
1062
|
+
children: ReactNode;
|
|
1063
|
+
/**
|
|
1064
|
+
* Character rendered between each breadcrumb item.
|
|
1065
|
+
* @default '/'
|
|
1066
|
+
*/
|
|
1067
|
+
separator?: BreadcrumbSeparator;
|
|
1068
|
+
/**
|
|
1069
|
+
* Accessible label for the `<nav>` landmark.
|
|
1070
|
+
* @default 'Breadcrumb'
|
|
1071
|
+
* @a11y Recommended — describe the navigation to assistive technologies.
|
|
1072
|
+
*/
|
|
1073
|
+
ariaLabel?: string;
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
type BreadcrumbItemProps = {
|
|
1077
|
+
/** Text label of the breadcrumb item. */
|
|
1078
|
+
label: string;
|
|
1079
|
+
/**
|
|
1080
|
+
* URL to navigate to.
|
|
1081
|
+
* Can be omitted when using SPA navigation via `onClick` (e.g. React Router).
|
|
1082
|
+
*/
|
|
1083
|
+
href?: string;
|
|
1084
|
+
/**
|
|
1085
|
+
* SPA navigation handler (e.g. React Router's `navigate`).
|
|
1086
|
+
* When provided without `href`, the link stays accessible: `role="link"`,
|
|
1087
|
+
* `tabIndex={0}` and Enter-key activation are handled automatically by `Link`.
|
|
1088
|
+
*
|
|
1089
|
+
* @example
|
|
1090
|
+
* <Breadcrumb.Item label="Products" onClick={() => navigate('/products')} />
|
|
1091
|
+
*/
|
|
1092
|
+
onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;
|
|
1093
|
+
/**
|
|
1094
|
+
* Marks this item as the current page. Renders as bold text (non-clickable)
|
|
1095
|
+
* and sets `aria-current="page"`.
|
|
1096
|
+
* @default false
|
|
1097
|
+
*/
|
|
1098
|
+
current?: boolean;
|
|
1099
|
+
/**
|
|
1100
|
+
* Injected internally by `Breadcrumb` — hides the separator for the first item.
|
|
1101
|
+
* @internal
|
|
1102
|
+
*/
|
|
1103
|
+
isFirst?: boolean;
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
type BreadcrumbComponent = FC<BreadcrumbProps> & {
|
|
1107
|
+
Item: FC<BreadcrumbItemProps>;
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
declare const Breadcrumb: BreadcrumbComponent;
|
|
1111
|
+
|
|
1049
1112
|
/**
|
|
1050
1113
|
* Layout variant for the Drawer.
|
|
1051
1114
|
* - `'permanent'` — inline drawer that pushes page content (default on desktop).
|
|
@@ -1228,6 +1291,62 @@ type DrawerContextValue = {
|
|
|
1228
1291
|
};
|
|
1229
1292
|
declare const useDrawerContext: () => DrawerContextValue;
|
|
1230
1293
|
|
|
1294
|
+
type TabsProps = {
|
|
1295
|
+
/** Children — typically a `Tabs.List` with `Tabs.Tab`s and one or more `Tabs.Panel`s. */
|
|
1296
|
+
children: ReactNode;
|
|
1297
|
+
/** Controlled selected tab value. */
|
|
1298
|
+
value?: string;
|
|
1299
|
+
/** Default selected tab value when uncontrolled. */
|
|
1300
|
+
defaultValue?: string;
|
|
1301
|
+
/** Called whenever the selected tab changes. */
|
|
1302
|
+
onChange?: (value: string) => void;
|
|
1303
|
+
/** Optional id prefix used to derive `id`/`aria-controls`/`aria-labelledby`. */
|
|
1304
|
+
id?: string;
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
type TabsListProps = {
|
|
1308
|
+
/** `Tabs.Tab` children. */
|
|
1309
|
+
children: ReactNode;
|
|
1310
|
+
/** Accessible label for the tablist (required by WAI-ARIA when no visible label exists). */
|
|
1311
|
+
ariaLabel?: string;
|
|
1312
|
+
/** Id of an element labelling the tablist (alternative to `ariaLabel`). */
|
|
1313
|
+
ariaLabelledBy?: string;
|
|
1314
|
+
};
|
|
1315
|
+
|
|
1316
|
+
type TabItemProps = {
|
|
1317
|
+
/** Unique value identifying this tab — must match the corresponding `Tabs.Panel` value. */
|
|
1318
|
+
value: string;
|
|
1319
|
+
/** Visible label of the tab. */
|
|
1320
|
+
label: string;
|
|
1321
|
+
/**
|
|
1322
|
+
* Disables the tab. Sets `aria-disabled="true"` without removing the element from
|
|
1323
|
+
* the focus tree — screen readers can still announce its existence.
|
|
1324
|
+
* Click and keyboard activation are blocked programmatically.
|
|
1325
|
+
* Disabled tabs are skipped during ArrowLeft/Right/Home/End keyboard navigation.
|
|
1326
|
+
*/
|
|
1327
|
+
disabled?: boolean;
|
|
1328
|
+
};
|
|
1329
|
+
|
|
1330
|
+
type TabsPanelProps = {
|
|
1331
|
+
/** Value of the tab this panel is associated with. */
|
|
1332
|
+
value: string;
|
|
1333
|
+
/** Panel content. Only rendered when its tab is active (no DOM cost when inactive). */
|
|
1334
|
+
children: ReactNode;
|
|
1335
|
+
/**
|
|
1336
|
+
* Keep the panel mounted even when inactive (set `hidden` instead of unmount).
|
|
1337
|
+
* Useful when the panel holds expensive state that should survive tab switches.
|
|
1338
|
+
*/
|
|
1339
|
+
keepMounted?: boolean;
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
type TabsComponent = FC<TabsProps> & {
|
|
1343
|
+
List: FC<TabsListProps>;
|
|
1344
|
+
Tab: FC<TabItemProps>;
|
|
1345
|
+
Panel: FC<TabsPanelProps>;
|
|
1346
|
+
};
|
|
1347
|
+
|
|
1348
|
+
declare const Tabs: TabsComponent;
|
|
1349
|
+
|
|
1231
1350
|
type AlertProps = {
|
|
1232
1351
|
/**
|
|
1233
1352
|
* Visual style of the alert. @default 'default'
|
|
@@ -1432,5 +1551,5 @@ declare const lightTheme: Theme;
|
|
|
1432
1551
|
|
|
1433
1552
|
declare const darkTheme: Theme;
|
|
1434
1553
|
|
|
1435
|
-
export { Alert, Backdrop, Badge, Box, Button, Card, Checkbox, Dialog, Drawer, Form, Grid, Icon, IconButton, InfoBubble, Link, Menu, Select, Skeleton, Stack, Switch, Text, TextField, Tooltip, darkTheme, lightTheme, useDrawerContext };
|
|
1436
|
-
export type { AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, BackdropProps, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, CheckboxProps, DialogBodyProps, DialogHeaderProps, DialogProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerItemIcon, DrawerItemProps, DrawerProps, DrawerVariant, FormProps, GridProps, GridStyleProps, IconButtonProps, IconProps, IconStyleParams, InfoBubbleProps, LinkIcon, LinkProps, LinkUnderline, MenuGroupProps, MenuItemProps, MenuProps, Palette, SelectOption, SelectProps, SkeletonAnimation, SkeletonProps, SkeletonVariant, StackProps, SwitchColor, SwitchProps, SwitchSize, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, TooltipPlacement, TooltipProps };
|
|
1554
|
+
export { Alert, Backdrop, Badge, Box, Breadcrumb, Button, Card, Checkbox, Dialog, Drawer, Form, Grid, Icon, IconButton, InfoBubble, Link, Menu, Select, Skeleton, Stack, Switch, Tabs, Text, TextField, Tooltip, darkTheme, lightTheme, useDrawerContext };
|
|
1555
|
+
export type { AlertBodyProps, AlertProps, AlertTitleProps, AlertVariant, BackdropProps, BadgeColor, BadgeIcon, BadgeProps, BadgeSize, BadgeVariant, BoxProps, BreadcrumbItemProps, BreadcrumbProps, BreadcrumbSeparator, ButtonColor, ButtonIcon, ButtonProps, ButtonSize, ButtonVariant, CardBodyProps, CardHeaderProps, CardProps, CardVariant, CheckboxProps, DialogBodyProps, DialogHeaderProps, DialogProps, DrawerBodyProps, DrawerFooterProps, DrawerHeaderProps, DrawerItemIcon, DrawerItemProps, DrawerProps, DrawerVariant, FormProps, GridProps, GridStyleProps, IconButtonProps, IconProps, IconStyleParams, InfoBubbleProps, LinkColor, LinkIcon, LinkProps, LinkUnderline, MenuGroupProps, MenuItemProps, MenuProps, Palette, SelectOption, SelectProps, SkeletonAnimation, SkeletonProps, SkeletonVariant, StackProps, SwitchColor, SwitchProps, SwitchSize, TabItemProps, TabsListProps, TabsPanelProps, TabsProps, TextFieldProps, TextFieldSize, TextFieldStatus, TextProps, TextStyleParams, TextVariantStyle, TextVariants, Theme, TooltipPlacement, TooltipProps };
|