@foris/avocado-suite 1.12.1 → 1.14.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.
Files changed (57) hide show
  1. package/dist/avocado-suite.es.js +21525 -20630
  2. package/dist/avocado-suite.umd.js +165 -157
  3. package/dist/components/DataTable/utils/dataTableUtil.d.ts +1 -1
  4. package/dist/components/access-panel/AccessPanel.d.ts +5 -0
  5. package/dist/components/access-panel/AccessPanel.test.d.ts +0 -0
  6. package/dist/components/access-panel/accessPanel.locale.d.ts +16 -0
  7. package/dist/components/access-panel/components/access-product/AccessProduct.d.ts +1 -0
  8. package/dist/components/account-menu/components/menu-locale-dropdown/MenuLocaleDropdown.test.d.ts +0 -0
  9. package/dist/components/drawer/Drawer.d.ts +78 -41
  10. package/dist/components/drawer/Drawer.test.d.ts +1 -0
  11. package/dist/components/drawer/DrawerExpansion.test.d.ts +1 -0
  12. package/dist/components/drawer/DrawerGuards.test.d.ts +1 -0
  13. package/dist/components/drawer/DrawerKeyboard.test.d.ts +1 -0
  14. package/dist/components/drawer/DrawerMotion.test.d.ts +1 -0
  15. package/dist/components/drawer/DrawerNavigation.test.d.ts +1 -0
  16. package/dist/components/drawer/DrawerStacking.test.d.ts +1 -0
  17. package/dist/components/drawer/components/body/DrawerBody.d.ts +9 -0
  18. package/dist/components/drawer/components/footer/DrawerFooter.d.ts +11 -0
  19. package/dist/components/drawer/components/header/DrawerCloseControl.d.ts +15 -0
  20. package/dist/components/drawer/components/header/DrawerHeader.d.ts +13 -0
  21. package/dist/components/drawer/components/header/DrawerIconButton.d.ts +11 -0
  22. package/dist/components/drawer/components/header/DrawerLegacyHeader.d.ts +19 -0
  23. package/dist/components/drawer/components/navigation/DrawerNavigationView.d.ts +19 -0
  24. package/dist/components/drawer/components/navigation/DrawerNavigationVisit.d.ts +17 -0
  25. package/dist/components/drawer/components/navigation/DrawerView.d.ts +19 -0
  26. package/dist/components/drawer/contexts/drawerNavigationContext.d.ts +19 -0
  27. package/dist/components/drawer/drawer.locale.d.ts +10 -0
  28. package/dist/components/drawer/hooks/useDrawerExpansion.d.ts +11 -0
  29. package/dist/components/drawer/hooks/useDrawerLifecycle.d.ts +17 -0
  30. package/dist/components/drawer/hooks/useDrawerNavigation.d.ts +3 -0
  31. package/dist/components/drawer/hooks/useDrawerNavigation.test.d.ts +1 -0
  32. package/dist/components/drawer/hooks/useDrawerNavigationContext.d.ts +3 -0
  33. package/dist/components/drawer/hooks/useDrawerStack.d.ts +4 -0
  34. package/dist/components/drawer/hooks/useDrawerStack.test.d.ts +1 -0
  35. package/dist/components/drawer/index.d.ts +9 -0
  36. package/dist/components/drawer/types/drawerExpansion.types.d.ts +9 -0
  37. package/dist/components/drawer/types/drawerHeader.types.d.ts +56 -0
  38. package/dist/components/drawer/types/drawerNavigation.types.d.ts +68 -0
  39. package/dist/components/drawer/utils/createDrawerNavigation.d.ts +9 -0
  40. package/dist/components/drawer/utils/createDrawerNavigation.test.d.ts +1 -0
  41. package/dist/components/drawer/utils/drawerKeyboard.d.ts +3 -0
  42. package/dist/components/drawer/utils/drawerNavigationInternals.d.ts +21 -0
  43. package/dist/components/drawer/utils/drawerNavigationState.d.ts +21 -0
  44. package/dist/components/drawer/utils/drawerRequestGate.d.ts +9 -0
  45. package/dist/components/drawer/utils/drawerStack.d.ts +9 -0
  46. package/dist/components/drawer/utils/drawerStack.test.d.ts +1 -0
  47. package/dist/components/drawer-layout/DrawerLayout.d.ts +17 -0
  48. package/dist/components/drawer-layout/DrawerLayout.test.d.ts +1 -0
  49. package/dist/components/drawer-layout/drawerLayoutContext.d.ts +20 -0
  50. package/dist/components/drawer-layout/index.d.ts +3 -0
  51. package/dist/components/header/Header.d.ts +8 -0
  52. package/dist/components/header/Header.test.d.ts +0 -0
  53. package/dist/components/tabs/Tabs.d.ts +5 -0
  54. package/dist/drawer-types.d.ts +2 -0
  55. package/dist/index.d.ts +7 -3
  56. package/dist/style.css +1 -1
  57. package/package.json +5 -2
@@ -0,0 +1,21 @@
1
+ import type { createDrawerRequestGate } from './drawerRequestGate';
2
+ /** Shell-only connection to a controller store; never exported from the package. */
3
+ export interface DrawerNavigationInternals {
4
+ /** Stable identity of the navigation context, even when its root visit resets. */
5
+ readonly contextId: string;
6
+ /** One pending request shared by navigation and dismissal, including cancellation. */
7
+ readonly requests: Pick<ReturnType<typeof createDrawerRequestGate>, 'run' | 'block' | 'invalidate'>;
8
+ /** Resets after close; effect cleanup preserves untouched roots for StrictMode. */
9
+ endSession(reason: 'close' | 'unmount'): void;
10
+ }
11
+ /** Private details of one published controller snapshot. */
12
+ export interface DrawerNavigationSnapshotDetails {
13
+ /** Store connection, stable for the lifetime of the navigation context. */
14
+ internals: DrawerNavigationInternals;
15
+ /** Operation that produced this snapshot; selects the view transition. */
16
+ lastAction: 'push' | 'back' | 'replace' | 'reset';
17
+ }
18
+ /** Associates private details with a snapshot without widening the public type. */
19
+ export declare function linkDrawerNavigation(controller: object, details: DrawerNavigationSnapshotDetails): void;
20
+ /** Reads the details of a snapshot created by useDrawerNavigation. */
21
+ export declare function readDrawerNavigation(controller: object | undefined): DrawerNavigationSnapshotDetails | undefined;
@@ -0,0 +1,21 @@
1
+ import type { DrawerNavigationEntry, DrawerNavigationTarget } from '../types/drawerNavigation.types';
2
+ /** Private history state; domain data and component instances never live here. */
3
+ export interface DrawerNavigationState<Target extends DrawerNavigationTarget> {
4
+ /** Context identity that produced this history. */
5
+ navigationKey: string | number;
6
+ /** Generation used to reject commands retained from a previous session. */
7
+ session: number;
8
+ /** Next visit number, never reused by resets. */
9
+ nextId: number;
10
+ /** Root-to-current history. */
11
+ entries: readonly DrawerNavigationEntry<Target>[];
12
+ }
13
+ /** Supported history mutations, independent of rendering and routing. */
14
+ export type DrawerNavigationAction<Target extends DrawerNavigationTarget> = {
15
+ type: 'push' | 'replace' | 'reset';
16
+ target: Target;
17
+ } | {
18
+ type: 'back';
19
+ };
20
+ /** Reduces one command without mutating previous entries or consumer parameters. */
21
+ export declare function reduceDrawerNavigation<Target extends DrawerNavigationTarget>(state: DrawerNavigationState<Target>, action: DrawerNavigationAction<Target>, keyPrefix: string): DrawerNavigationState<Target>;
@@ -0,0 +1,9 @@
1
+ /** A user confirmation; a thrown error or rejected promise counts as a denial. */
2
+ export type DrawerGuard = () => boolean | Promise<boolean>;
3
+ /** Runs one user request at a time; an approval that arrives after invalidation is ignored. */
4
+ export declare function createDrawerRequestGate(onPendingChange: (isPending: boolean) => void): {
5
+ readonly isPending: boolean;
6
+ invalidate: () => void;
7
+ block(value: boolean): void;
8
+ run(guard: DrawerGuard | undefined, commit: () => void): Promise<boolean>;
9
+ };
@@ -0,0 +1,9 @@
1
+ type Listener = () => void;
2
+ /** Open order of floating drawers, shared across React roots without a common provider. */
3
+ export declare const drawerStack: {
4
+ push(id: string): void;
5
+ remove(id: string): void;
6
+ subscribe(listener: Listener): () => void;
7
+ getSnapshot: () => readonly string[];
8
+ };
9
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ /** An application-level host with a stable main area and one contextual panel. */
3
+ export interface DrawerLayoutProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** Main application content; receives the space left by a pinned Drawer. */
5
+ children: React.ReactNode;
6
+ /** One Drawer, optionally wrapped by a component that owns its state. */
7
+ drawer: React.ReactNode;
8
+ /** Minimum usable main-content width in CSS pixels; chosen by the application. */
9
+ minContentWidth: number;
10
+ }
11
+ /**
12
+ * Reserves real layout space for a pinned Drawer while keeping both slots mounted.
13
+ * Give the host a bounded height, and place it outside transformed/clipping ancestors
14
+ * so its floating panel can use viewport positioning.
15
+ */
16
+ declare const DrawerLayout: React.FC<DrawerLayoutProps>;
17
+ export default DrawerLayout;
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ /** Requested presentation; insufficient host space temporarily falls back to floating. */
3
+ export type DrawerMode = 'floating' | 'pinned';
4
+ /** @internal Space occupied by the single panel supported by this host. */
5
+ export interface DrawerReservation {
6
+ /** Measured panel width in CSS pixels. */
7
+ width: number;
8
+ /** Physical edge occupied by the panel. */
9
+ origin: 'left' | 'right';
10
+ }
11
+ /** @internal Measurements and reservation shared only with the drawer slot. */
12
+ export interface DrawerLayoutContextValue {
13
+ /** Whether both the desktop breakpoint and the caller's content minimum fit. */
14
+ canPin: boolean;
15
+ /** Responsive hosted width, independent of the main content's remaining width. */
16
+ panelWidth: number;
17
+ /** Reserves or releases the panel column without moving its React subtree. */
18
+ reserve: (reservation: DrawerReservation | null) => void;
19
+ }
20
+ export declare const DrawerLayoutContext: import("react").Context<DrawerLayoutContextValue | null>;
@@ -0,0 +1,3 @@
1
+ export { default } from './DrawerLayout';
2
+ export type { DrawerLayoutProps } from './DrawerLayout';
3
+ export type { DrawerMode } from './drawerLayoutContext';
@@ -24,6 +24,14 @@ export interface HeaderProps {
24
24
  hasSidebarMenu?: boolean;
25
25
  sidebarMenuContent?: React.ReactNode;
26
26
  sidebarHeightGap?: number;
27
+ /** Controls the sidebar from outside; when omitted, the Header owns its state. */
28
+ sidebarMenuOpen?: boolean;
29
+ /**
30
+ * Called with the requested sidebar state from ☰, the sidebar overlay or another menu.
31
+ * The overlay closes the sidebar itself and reports `false` once its close animation
32
+ * ends, so update `sidebarMenuOpen` to keep it in sync.
33
+ */
34
+ onSidebarMenuToggle?: (open: boolean) => void;
27
35
  }
28
36
  declare const Header: FC<HeaderProps>;
29
37
  export default Header;
File without changes
@@ -13,6 +13,11 @@ export interface TabsProps {
13
13
  items: TabItemProps[];
14
14
  /** Callback that will be triggered when one of the tabs is clicked. */
15
15
  onClick?: (index: number) => void;
16
+ /**
17
+ * Keeps the outgoing panel's height as the incoming panel's `min-height` on every switch,
18
+ * so the page does not jump. The `min-height` only grows while `Tabs` stays mounted.
19
+ */
20
+ preserveHeight?: boolean;
16
21
  }
17
22
  declare const Tabs: FC<TabsProps>;
18
23
  export default Tabs;
@@ -0,0 +1,2 @@
1
+ /** Public type-only entry point for adapters of the contextual Drawer. */
2
+ export type { DrawerProps, DrawerExpansionConfig, DrawerHeaderConfig, } from './components/drawer';
package/dist/index.d.ts CHANGED
@@ -56,7 +56,8 @@ import Tooltip from './components/tooltip/Tooltip';
56
56
  import Table from './components/table';
57
57
  import Weekly from './components/weekly';
58
58
  import WeeklyGroup from './components/weekly-group';
59
- import Drawer from './components/drawer/Drawer';
59
+ import Drawer from './components/drawer';
60
+ import DrawerLayout from './components/drawer-layout';
60
61
  import Banner from './components/banner';
61
62
  import Beacon from './components/beacon';
62
63
  import Hotspot from './components/hotspot';
@@ -72,7 +73,7 @@ import { toast } from 'react-toastify';
72
73
  * Hooks
73
74
  */
74
75
  export { useFloatingPortal } from './hooks/useFloatingPortal';
75
- 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, BarChart, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, LineChart, Loading, MatrixTable, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, ProgressBarBase, RadioButton, RoundButton, SegmentedProgress, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, Textarea, ThemeProvider, ThemeStore, LocaleStore, Timer, Toaster, Tooltip, Table, toast, };
76
+ export { Banner, Beacon, Header, HeaderNavigation, ContextualNavigation, Hotspot, NavList, Drawer, DrawerLayout, AccessPanel, AccountMenu, SidebarMenu, Weekly, WeeklyGroup, Accordion, Box, Breadcrumbs, Button, Card, CardAccordion, CardNotification, Checkbox, DataCard, DataTable, DatePicker, Divider, Dropzone, FileUpload, BarChart, Donut, DonutLabels, DonutLegend, DropdownButton, Heading, Link, LineChart, Loading, MatrixTable, Menu, Modal, Pager, Pill, PreviewerMarkdown, Processing, ProgressBar, ProgressBarBase, RadioButton, RoundButton, SegmentedProgress, Select, SelectPagination, SkeletonBase, SkeletonCircle, Stepper, Switch, Tabs, Tag, Text, TextField, Textarea, ThemeProvider, ThemeStore, LocaleStore, Timer, Toaster, Tooltip, Table, toast, };
76
77
  /**
77
78
  * Types
78
79
  */
@@ -106,7 +107,10 @@ export type { TabsProps } from './components/tabs/Tabs';
106
107
  export type { TimerTime } from './components/timer/Timer';
107
108
  export type { ModalProps } from './components/modal/Modal';
108
109
  export type { AccountMenuFooterAction, AccountMenuProps, } from './components/account-menu/AccountMenu';
109
- export type { DrawerProps } from './components/drawer/Drawer';
110
+ export type { DrawerLayoutProps, DrawerMode } from './components/drawer-layout';
111
+ export type { DrawerExpansionConfig } from './components/drawer';
112
+ export { DrawerView, useDrawerNavigation, useDrawerNavigationContext, } from './components/drawer';
113
+ export type { DrawerCloseReason, DrawerHeaderAction, DrawerHeaderConfig, DrawerNavigationBinding, DrawerNavigationController, DrawerNavigationEntry, DrawerNavigationOptions, DrawerNavigationRequest, DrawerNavigationTarget, DrawerProps, DrawerViewProps, } from './components/drawer';
110
114
  export type { NavListProps } from './components/nav-list';
111
115
  export type { NavListItemData, NavListLeaf } from './components/nav-list/types';
112
116
  export type { PagerProps } from './components/pager/Pager';