@foris/avocado-suite 1.8.23 → 1.8.25

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.
@@ -0,0 +1,7 @@
1
+ import { ButtonHTMLAttributes } from 'react';
2
+ export interface BeaconProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'type' | 'aria-label'> {
3
+ /** Accessible name. Required — the beacon has no text content. */
4
+ label: string;
5
+ }
6
+ declare const Beacon: import("react").ForwardRefExoticComponent<BeaconProps & import("react").RefAttributes<HTMLButtonElement>>;
7
+ export default Beacon;
File without changes
@@ -0,0 +1,2 @@
1
+ export { default } from './Beacon';
2
+ export type { BeaconProps } from './Beacon';
@@ -1,14 +1,18 @@
1
1
  import type { FC, ReactNode } from 'react';
2
2
  import type { IconTypes } from '../../../../avocado-icons';
3
3
  export interface CardAccordionProps {
4
- /** Content action */
4
+ /** Primary call to action, rendered below the header when condensed */
5
5
  actionContent?: ReactNode;
6
- /** Content card accordion */
7
- children: ReactNode | string;
6
+ /** Accessible name of the card, required when `title` is not a plain string */
7
+ ariaLabel?: string;
8
+ /** Collapsible panel content. Without it the card renders no panel */
9
+ children?: ReactNode;
8
10
  /** Overwrite className */
9
11
  className?: string;
12
+ /** Layout density, defaults to 'expanded'. Mobile always renders condensed */
13
+ density?: 'expanded' | 'condensed';
10
14
  /** Description content */
11
- description?: ReactNode | string;
15
+ description?: ReactNode;
12
16
  /** Disabled state */
13
17
  disabled?: boolean;
14
18
  /** Size Icon */
@@ -17,10 +21,21 @@ export interface CardAccordionProps {
17
21
  iconName?: IconTypes;
18
22
  /** Gradient Icon */
19
23
  iconGradient?: boolean;
20
- /** Set accordion visibility */
24
+ /** Overflow control, always rendered beside the chevron */
25
+ menuContent?: ReactNode;
26
+ /** Toggle handler, its presence turns the card controlled */
27
+ onToggle?: (opened: boolean) => void;
28
+ /** Open state: initial when uncontrolled, required with `onToggle` */
21
29
  opened?: boolean;
22
- /** Set title */
23
- title: string;
30
+ /** A string renders in `Heading h3`, other nodes plain, hence `ariaLabel` */
31
+ title: ReactNode;
32
+ /** Cosmetic variant, only radius and panel background. Default 'default' */
33
+ type?: 'default' | 'expressive';
24
34
  }
35
+ /**
36
+ * A header click landing on one of these belongs to the consumer, not the toggle.
37
+ * Exported so the tests assert against the same list.
38
+ */
39
+ export declare const INTERACTIVE_SELECTOR: string;
25
40
  declare const CardAccordion: FC<CardAccordionProps>;
26
41
  export default CardAccordion;
@@ -1,9 +1,11 @@
1
1
  import type { FC, ReactElement, ReactNode } from 'react';
2
+ import { IconTypes } from '../../../../avocado-icons';
2
3
  declare enum NotificationState {
3
4
  Warning = "warning",
4
5
  Error = "error",
5
6
  Info = "info",
6
- Success = "success"
7
+ Success = "success",
8
+ Neutral = "neutral"
7
9
  }
8
10
  export interface CardNotificationProps {
9
11
  /** Content card notification */
@@ -14,12 +16,17 @@ export interface CardNotificationProps {
14
16
  dismissible?: boolean;
15
17
  /** Extra content to be displayed below the main content of the card */
16
18
  extraContent?: ReactNode;
19
+ /**
20
+ * Overrides the default state icon, or sets one for `neutral`
21
+ * (which has no default icon).
22
+ */
23
+ icon?: IconTypes;
17
24
  /** Outlined variant */
18
25
  outlined?: boolean;
19
26
  /** State or variant of the notification */
20
27
  state: `${NotificationState}`;
21
28
  /** Title of the notification */
22
- title: ReactElement | string;
29
+ title?: ReactElement | string;
23
30
  }
24
31
  declare const CardNotification: FC<CardNotificationProps>;
25
32
  export default CardNotification;
@@ -0,0 +1,33 @@
1
+ import { FC, ReactNode } from 'react';
2
+ /** Declared here on purpose: `react-joyride` must not leak into the public API. */
3
+ export type HotspotPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right' | 'center' | 'auto';
4
+ interface HotspotBaseProps {
5
+ /** CSS selector of the element the card anchors to and the spotlight cuts out. */
6
+ target: string;
7
+ content: ReactNode;
8
+ title?: string;
9
+ /** Controls visibility. The consumer owns "already seen" persistence. */
10
+ isOpen: boolean;
11
+ onClose: () => void;
12
+ /** Fires when the card becomes visible. Analytics hook. */
13
+ onOpen?: () => void;
14
+ /** Label of the confirm button. Required — avocado-suite ships no copy. */
15
+ closeLabel: string;
16
+ placement?: HotspotPlacement;
17
+ /** Spotlight inset around the target, in px. Default 8. */
18
+ spotlightPadding?: number;
19
+ /** Default 1000. Escape hatch for shells that stack differently. */
20
+ zIndex?: number;
21
+ className?: string;
22
+ }
23
+ export type HotspotProps = HotspotBaseProps & ({
24
+ showBeacon?: false;
25
+ beaconLabel?: never;
26
+ beaconClassName?: never;
27
+ } | {
28
+ showBeacon: true;
29
+ beaconLabel: string;
30
+ beaconClassName?: string;
31
+ });
32
+ declare const Hotspot: FC<HotspotProps>;
33
+ export default Hotspot;
File without changes
@@ -0,0 +1,2 @@
1
+ export { default } from './Hotspot';
2
+ export type { HotspotPlacement, HotspotProps } from './Hotspot';
package/dist/index.d.ts CHANGED
@@ -51,6 +51,8 @@ import Weekly from './components/weekly';
51
51
  import WeeklyGroup from './components/weekly-group';
52
52
  import Drawer from './components/drawer/Drawer';
53
53
  import Banner from './components/banner';
54
+ import Beacon from './components/beacon';
55
+ import Hotspot from './components/hotspot';
54
56
  import SidebarMenu from './components/sidebar-menu/SidebarMenu';
55
57
  import AccessPanel from './components/access-panel/AccessPanel';
56
58
  import AccountMenu from './components/account-menu/AccountMenu';
@@ -61,11 +63,13 @@ import { toast } from 'react-toastify';
61
63
  * Hooks
62
64
  */
63
65
  export { useFloatingPortal } from './hooks/useFloatingPortal';
64
- export { Banner, Header, NavList, Drawer, AccessPanel, AccountMenu, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, Loading, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, Textarea, ThemeProvider, ThemeStore, LocaleStore, Timer, Toaster, Tooltip, Table, toast, };
66
+ export { Banner, Beacon, Header, Hotspot, NavList, Drawer, AccessPanel, AccountMenu, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, Loading, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, RadioButton, RoundButton, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, Textarea, ThemeProvider, ThemeStore, LocaleStore, Timer, Toaster, Tooltip, Table, toast, };
65
67
  /**
66
68
  * Types
67
69
  */
68
70
  export type { ButtonProps } from './components/button/Button';
71
+ export type { BeaconProps } from './components/beacon';
72
+ export type { HotspotPlacement, HotspotProps } from './components/hotspot';
69
73
  export type { BreadcrumbItem } from './components/breadcrumbs/Breadcrumbs';
70
74
  export type { CardAccordionProps } from './components/card-accordion/CardAccordion';
71
75
  export type { CardNotificationProps } from './components/card-notification/CardNotification';