@foris/avocado-suite 1.10.0 → 1.10.2

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 (31) hide show
  1. package/dist/avocado-suite.es.js +12890 -11141
  2. package/dist/avocado-suite.umd.js +152 -148
  3. package/dist/components/contextual-navigation/ContextualNavigation.d.ts +4 -0
  4. package/dist/components/contextual-navigation/ContextualNavigation.test.d.ts +0 -0
  5. package/dist/components/contextual-navigation/components/contextual-nav-control/ContextualNavControl.d.ts +9 -0
  6. package/dist/components/contextual-navigation/components/contextual-nav-control/index.d.ts +1 -0
  7. package/dist/components/contextual-navigation/components/contextual-nav-icon/ContextualNavIcon.d.ts +12 -0
  8. package/dist/components/contextual-navigation/components/contextual-nav-icon/index.d.ts +1 -0
  9. package/dist/components/contextual-navigation/components/contextual-nav-item/ContextualNavItem.d.ts +11 -0
  10. package/dist/components/contextual-navigation/components/contextual-nav-item/index.d.ts +1 -0
  11. package/dist/components/contextual-navigation/components/contextual-nav-overflow/ContextualNavOverflow.d.ts +10 -0
  12. package/dist/components/contextual-navigation/components/contextual-nav-overflow/index.d.ts +1 -0
  13. package/dist/components/contextual-navigation/contextualNavigation.locale.d.ts +14 -0
  14. package/dist/components/contextual-navigation/hooks/useContextualNavigationCollapse.d.ts +11 -0
  15. package/dist/components/contextual-navigation/hooks/useContextualNavigationCollapse.test.d.ts +1 -0
  16. package/dist/components/contextual-navigation/index.d.ts +2 -0
  17. package/dist/components/contextual-navigation/types.d.ts +43 -0
  18. package/dist/components/contextual-navigation/utils/contextualNavigation.util.d.ts +3 -0
  19. package/dist/components/contextual-navigation/utils/contextualNavigation.util.test.d.ts +1 -0
  20. package/dist/components/dropzone/Dropzone.d.ts +22 -0
  21. package/dist/components/dropzone/Dropzone.test.d.ts +0 -0
  22. package/dist/components/dropzone/DropzoneFileTag.d.ts +8 -0
  23. package/dist/components/dropzone/DropzoneZoneBody.d.ts +14 -0
  24. package/dist/components/dropzone/dropzone.types.d.ts +9 -0
  25. package/dist/components/dropzone/index.d.ts +3 -0
  26. package/dist/components/file-upload/FileUpload.d.ts +33 -0
  27. package/dist/components/file-upload/FileUpload.test.d.ts +0 -0
  28. package/dist/components/file-upload/index.d.ts +2 -0
  29. package/dist/index.d.ts +7 -1
  30. package/dist/style.css +1 -1
  31. package/package.json +2 -1
@@ -0,0 +1,4 @@
1
+ import type { FC } from 'react';
2
+ import type { ContextualNavigationProps } from './types';
3
+ declare const ContextualNavigation: FC<ContextualNavigationProps>;
4
+ export default ContextualNavigation;
@@ -0,0 +1,9 @@
1
+ import type { FC, HTMLAttributes } from 'react';
2
+ import type { ContextualNavigationItem } from '../../types';
3
+ export type ContextualNavControlProps = HTMLAttributes<HTMLElement> & {
4
+ item: ContextualNavigationItem;
5
+ isActive: boolean;
6
+ };
7
+ /** A link when the destination has an `href` and is enabled; a button otherwise. */
8
+ declare const ContextualNavControl: FC<ContextualNavControlProps>;
9
+ export default ContextualNavControl;
@@ -0,0 +1 @@
1
+ export { default } from './ContextualNavControl';
@@ -0,0 +1,12 @@
1
+ import type { FC } from 'react';
2
+ import type { IconTypes } from '../../../../../../avocado-icons';
3
+ export type ContextualNavIconProps = {
4
+ name: IconTypes;
5
+ isActive: boolean;
6
+ isDisabled?: boolean;
7
+ showBadge?: boolean;
8
+ /** Without it the badge is decorative and hidden from assistive technology. */
9
+ badgeAriaLabel?: string;
10
+ };
11
+ declare const ContextualNavIcon: FC<ContextualNavIconProps>;
12
+ export default ContextualNavIcon;
@@ -0,0 +1 @@
1
+ export { default } from './ContextualNavIcon';
@@ -0,0 +1,11 @@
1
+ import type { FC } from 'react';
2
+ import type { ContextualNavigationItem, ContextualNavigationProps } from '../../types';
3
+ export type ContextualNavItemProps = {
4
+ item: ContextualNavigationItem;
5
+ activeId?: string;
6
+ isCollapsed?: boolean;
7
+ isMobileOverflowHidden?: boolean;
8
+ onItemClick?: ContextualNavigationProps['onItemClick'];
9
+ };
10
+ declare const ContextualNavItem: FC<ContextualNavItemProps>;
11
+ export default ContextualNavItem;
@@ -0,0 +1 @@
1
+ export { default } from './ContextualNavItem';
@@ -0,0 +1,10 @@
1
+ import type { FC } from 'react';
2
+ import type { ContextualNavigationItem, ContextualNavigationProps } from '../../types';
3
+ export type ContextualNavOverflowProps = {
4
+ items: ContextualNavigationItem[];
5
+ activeId?: string;
6
+ label: string;
7
+ onItemClick?: ContextualNavigationProps['onItemClick'];
8
+ };
9
+ declare const ContextualNavOverflow: FC<ContextualNavOverflowProps>;
10
+ export default ContextualNavOverflow;
@@ -0,0 +1 @@
1
+ export { default } from './ContextualNavOverflow';
@@ -0,0 +1,14 @@
1
+ export declare const CONTEXTUAL_NAVIGATION_STRINGS: {
2
+ en: {
3
+ navLabel: string;
4
+ expandNav: string;
5
+ collapseNav: string;
6
+ overflowLabel: string;
7
+ };
8
+ es: {
9
+ navLabel: string;
10
+ expandNav: string;
11
+ collapseNav: string;
12
+ overflowLabel: string;
13
+ };
14
+ };
@@ -0,0 +1,11 @@
1
+ type UseContextualNavigationCollapseParams = {
2
+ collapsed?: boolean;
3
+ defaultCollapsed?: boolean;
4
+ persistenceKey?: string;
5
+ onCollapsedChange?: (collapsed: boolean) => void;
6
+ };
7
+ export declare const useContextualNavigationCollapse: ({ collapsed, defaultCollapsed, persistenceKey, onCollapsedChange, }: UseContextualNavigationCollapseParams) => {
8
+ collapsed: boolean;
9
+ toggleCollapsed: () => void;
10
+ };
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './ContextualNavigation';
2
+ export type { ContextualNavigationProps, ContextualNavigationItem, } from './types';
@@ -0,0 +1,43 @@
1
+ import type { MouseEvent, ReactNode } from 'react';
2
+ import type { IconTypes } from '../../../../avocado-icons';
3
+ export type ContextualNavigationItem = {
4
+ /** Unique id; matches `activeId` when this destination is current. */
5
+ id: string;
6
+ /** Visible label. */
7
+ label: string;
8
+ /** Leading icon. */
9
+ icon: IconTypes;
10
+ /** Destination URL. When set, the item renders as a link. */
11
+ href?: string;
12
+ /** Prevents activation and navigation. */
13
+ disabled?: boolean;
14
+ /** Shows a notification dot on the item. */
15
+ showBadge?: boolean;
16
+ /** Accessible name for the badge; required when `showBadge` is true. */
17
+ badgeAriaLabel?: string;
18
+ };
19
+ export type ContextualNavigationProps = {
20
+ /** Every destination, in groups separated by dividers on desktop. */
21
+ sections: ContextualNavigationItem[][];
22
+ /** Id of the current destination. */
23
+ activeId?: string;
24
+ /** Controlled collapsed state for the desktop sidebar. */
25
+ collapsed?: boolean;
26
+ /** Initial collapsed state when uncontrolled. */
27
+ defaultCollapsed?: boolean;
28
+ /** Called when the user toggles the desktop sidebar collapse control. */
29
+ onCollapsedChange?: (collapsed: boolean) => void;
30
+ /** `localStorage` key for persisting the collapsed state. */
31
+ persistenceKey?: string;
32
+ /**
33
+ * Called when an item is activated, before native navigation.
34
+ * Call `event.preventDefault()` to take over navigation.
35
+ */
36
+ onItemClick?: (item: ContextualNavigationItem, event: MouseEvent<HTMLElement>) => void;
37
+ /** Names the `nav` landmark — important when the page has more than one nav region. */
38
+ 'aria-label'?: string;
39
+ /** Page content rendered beside or below the navigation. */
40
+ children: ReactNode;
41
+ /** Extra class for the root element. Not applied when every section is empty, since only `children` renders. */
42
+ className?: string;
43
+ };
@@ -0,0 +1,3 @@
1
+ import type { ContextualNavigationItem } from '../types';
2
+ /** Destinations that do not fit the mobile bar, in declaration order. */
3
+ export declare const getMobileOverflowItems: (sections: ContextualNavigationItem[][]) => ContextualNavigationItem[];
@@ -0,0 +1,22 @@
1
+ import { type FC } from 'react';
2
+ import { type Accept } from 'react-dropzone';
3
+ import type { DropzoneDisplay, DropzoneUploadStatus } from './dropzone.types';
4
+ export type { DropzoneDisplay, DropzoneUploadStatus } from './dropzone.types';
5
+ export interface DropzoneProps {
6
+ selectLabel: string;
7
+ dropHint: string;
8
+ activeLabel: string;
9
+ uploadingLabel: string;
10
+ uploadErrorLabel: string;
11
+ buttonLabel: string;
12
+ file: File | null;
13
+ uploadStatus?: DropzoneUploadStatus;
14
+ disabled?: boolean;
15
+ accept?: Accept;
16
+ display?: DropzoneDisplay;
17
+ onFileChange: (file: File | null) => void;
18
+ onRemove?: () => void;
19
+ className?: string;
20
+ }
21
+ declare const Dropzone: FC<DropzoneProps>;
22
+ export default Dropzone;
File without changes
@@ -0,0 +1,8 @@
1
+ import type { FC } from 'react';
2
+ export interface DropzoneFileTagProps {
3
+ file: File;
4
+ onRemove: () => void;
5
+ stacked?: boolean;
6
+ }
7
+ declare const DropzoneFileTag: FC<DropzoneFileTagProps>;
8
+ export default DropzoneFileTag;
@@ -0,0 +1,14 @@
1
+ import type { FC, MouseEvent } from 'react';
2
+ import type { DropzoneLabels, DropzoneUploadStatus } from './dropzone.types';
3
+ export interface DropzoneZoneBodyProps {
4
+ disabled: boolean;
5
+ uploadStatus: DropzoneUploadStatus;
6
+ isDragActive: boolean;
7
+ file: File | null;
8
+ showUploadedChip: boolean;
9
+ labels: DropzoneLabels;
10
+ onOpenPicker: (event?: MouseEvent<HTMLElement>) => void;
11
+ onRemove: () => void;
12
+ }
13
+ declare const DropzoneZoneBody: FC<DropzoneZoneBodyProps>;
14
+ export default DropzoneZoneBody;
@@ -0,0 +1,9 @@
1
+ export type DropzoneUploadStatus = 'idle' | 'uploading' | 'error';
2
+ export type DropzoneDisplay = 'zone' | 'button';
3
+ export interface DropzoneLabels {
4
+ selectLabel: string;
5
+ dropHint: string;
6
+ activeLabel: string;
7
+ uploadingLabel: string;
8
+ uploadErrorLabel: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ export { default as Dropzone } from './Dropzone';
2
+ export type { DropzoneProps } from './Dropzone';
3
+ export type { DropzoneDisplay, DropzoneUploadStatus } from './dropzone.types';
@@ -0,0 +1,33 @@
1
+ import type { FC } from 'react';
2
+ import type { Accept } from 'react-dropzone';
3
+ import { type CardNotificationProps } from '../card-notification/CardNotification';
4
+ import { type DropzoneUploadStatus } from '../dropzone/Dropzone';
5
+ export interface FileUploadProps {
6
+ title: string;
7
+ rulesTitle: string;
8
+ rules: string[];
9
+ helpTitle: string;
10
+ helpDescription: string;
11
+ templateLinkLabel: string;
12
+ templateHref?: string;
13
+ onTemplateLinkClick?: () => void;
14
+ selectLabel: string;
15
+ dropHint: string;
16
+ activeLabel: string;
17
+ uploadingLabel: string;
18
+ uploadErrorLabel: string;
19
+ buttonLabel: string;
20
+ file: File | null;
21
+ uploadStatus?: DropzoneUploadStatus;
22
+ disabled?: boolean;
23
+ accept?: Accept;
24
+ onFileChange: (file: File | null) => void;
25
+ onRemove?: () => void;
26
+ notificationVisible?: boolean;
27
+ notificationTitle?: string;
28
+ notificationDescription?: string;
29
+ notificationState?: CardNotificationProps['state'];
30
+ className?: string;
31
+ }
32
+ declare const FileUpload: FC<FileUploadProps>;
33
+ export default FileUpload;
@@ -0,0 +1,2 @@
1
+ export { default as FileUpload } from './FileUpload';
2
+ export type { FileUploadProps } from './FileUpload';
package/dist/index.d.ts CHANGED
@@ -16,6 +16,8 @@ import DataCard from './components/data-card/DataCard';
16
16
  import DataTable from './components/DataTable/DataTable';
17
17
  import DatePicker from './components/date-picker/DatePicker';
18
18
  import Divider from './components/divider/Divider';
19
+ import Dropzone from './components/dropzone/Dropzone';
20
+ import FileUpload from './components/file-upload/FileUpload';
19
21
  import Donut from './components/donut/Donut';
20
22
  import DonutLabels from './components/donut/donut-labels/DonutLabels';
21
23
  import DonutLegend from './components/donut/donut-legend/DonutLegend';
@@ -58,13 +60,14 @@ import AccessPanel from './components/access-panel/AccessPanel';
58
60
  import AccountMenu from './components/account-menu/AccountMenu';
59
61
  import Header from './components/header/Header';
60
62
  import HeaderNavigation from './components/header-navigation';
63
+ import ContextualNavigation from './components/contextual-navigation';
61
64
  import NavList from './components/nav-list';
62
65
  import { toast } from 'react-toastify';
63
66
  /**
64
67
  * Hooks
65
68
  */
66
69
  export { useFloatingPortal } from './hooks/useFloatingPortal';
67
- export { Banner, Beacon, Header, HeaderNavigation, 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, };
70
+ export { Banner, Beacon, Header, HeaderNavigation, ContextualNavigation, Hotspot, NavList, Drawer, AccessPanel, AccountMenu, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Dropzone, FileUpload, 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, };
68
71
  /**
69
72
  * Types
70
73
  */
@@ -76,8 +79,11 @@ export type { CardAccordionProps } from './components/card-accordion/CardAccordi
76
79
  export type { CardNotificationProps } from './components/card-notification/CardNotification';
77
80
  export type { DataCardProps, DataCardV1Props, DataCardV1Variant, DataCardV2Props, DataCardV2HeaderStyle, DataCardV2Status, DataCardPaletteIndex, HeaderStatusColor, } from './components/data-card/DataCard';
78
81
  export type { DividerProps } from './components/divider/Divider';
82
+ export type { DropzoneDisplay, DropzoneProps, DropzoneUploadStatus, } from './components/dropzone/Dropzone';
83
+ export type { FileUploadProps } from './components/file-upload/FileUpload';
79
84
  export type { HeadingProps } from './components/heading/Heading';
80
85
  export type { HeaderNavigationProps, HeaderNavigationVisual, } from './components/header-navigation';
86
+ export type { ContextualNavigationProps, ContextualNavigationItem, } from './components/contextual-navigation';
81
87
  export type { LinkProps } from './components/link/Link';
82
88
  export type { MenuItem } from './types/menu.types';
83
89
  export type { RoundButtonProps } from './components/round-button/RoundButton';