@zvoove/unity-ui 2.23.1 → 2.24.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.
@@ -1,6 +1,7 @@
1
1
  import { ChangeEventHandler } from 'react';
2
2
  import { default as default_2 } from 'react';
3
3
  import { Dispatch } from 'react';
4
+ import { ElementType } from 'react';
4
5
  import { ForwardedRef } from 'react';
5
6
  import { ForwardRefExoticComponent } from 'react';
6
7
  import { Icon as Icon_2 } from '@phosphor-icons/react';
@@ -179,7 +180,7 @@ declare type AvatarSize = (typeof AVATAR_SIZES)[keyof typeof AVATAR_SIZES];
179
180
 
180
181
  declare type AxisVariant = 'X' | 'Y';
181
182
 
182
- export declare type BackgroundColors = 'background' | 'outline' | 'outline-variant' | 'outline-low' | 'primary' | 'primary-hover' | 'primary-active' | 'secondary' | 'tertiary' | 'primary-container' | 'secondary-container' | 'tertiary-container' | 'tertiary-container-hover' | 'tertiary-container-active' | 'primary-fixed' | 'primary-fixed-dim' | 'secondary-fixed' | 'secondary-fixed-dim' | 'tertiary-fixed' | 'tertiary-fixed-dim' | 'surface' | 'surface-bright' | 'surface-dim' | 'surface-variant' | 'surface-container-lowest' | 'surface-container-low' | 'surface-container' | 'surface-container-high' | 'surface-container-highest' | 'error' | 'error-container' | 'inverse-surface' | 'inverse-on-surface' | 'inverse-primary' | 'scrim' | 'yellow' | 'dark-yellow' | 'yellow-container' | 'green' | 'dark-green' | 'green-container' | 'pink' | 'dark-pink' | 'pink-container' | 'steel-blue' | 'dark-steel-blue' | 'steel-blue-container';
183
+ export declare type BackgroundColors = 'background' | 'outline' | 'outline-variant' | 'outline-low' | 'primary' | 'primary-hover' | 'primary-active' | 'secondary' | 'tertiary' | 'primary-container' | 'secondary-container' | 'tertiary-container' | 'tertiary-container-hover' | 'tertiary-container-active' | 'primary-fixed' | 'primary-fixed-dim' | 'secondary-fixed' | 'secondary-fixed-dim' | 'tertiary-fixed' | 'tertiary-fixed-dim' | 'surface' | 'surface-bright' | 'surface-dim' | 'surface-variant' | 'surface-container-lowest' | 'surface-container-low' | 'surface-container' | 'surface-container-high' | 'surface-container-highest' | 'error' | 'error-container' | 'inverse-surface' | 'inverse-on-surface' | 'inverse-primary' | 'scrim' | 'yellow' | 'dark-yellow' | 'yellow-container' | 'green' | 'dark-green' | 'green-container' | 'pink' | 'dark-pink' | 'pink-container' | 'steel-blue' | 'dark-steel-blue' | 'steel-blue-container' | 'container-neutral' | 'container-neutral-hover';
183
184
 
184
185
  export declare const Badge: ({ children, variant, content, dot, }: BadgeProps) => JSX.Element;
185
186
 
@@ -812,6 +813,7 @@ export declare const commonIconsMap: {
812
813
  readonly 'text-align-left': Icon_2;
813
814
  readonly 'text-align-right': Icon_2;
814
815
  readonly 'text-t': Icon_2;
816
+ readonly ticket: Icon_2;
815
817
  readonly notches: Icon_2;
816
818
  readonly time: Icon_2;
817
819
  readonly timer: Icon_2;
@@ -1393,7 +1395,7 @@ export declare interface FloatSearchTranslations {
1393
1395
  close?: string;
1394
1396
  }
1395
1397
 
1396
- export declare type ForegroundColors = 'primary' | 'secondary' | 'tertiary' | 'yellow' | 'green' | 'pink' | 'steel-blue' | 'dark-yellow' | 'dark-green' | 'dark-pink' | 'dark-steel-blue' | 'inverse-on-surface' | 'on-primary' | 'on-secondary' | 'on-tertiary' | 'on-primary-container' | 'on-secondary-container' | 'on-tertiary-container' | 'on-primary-fixed' | 'on-primary-fixed-variant' | 'on-secondary-fixed' | 'on-secondary-fixed-variant' | 'on-tertiary-fixed' | 'on-tertiary-fixed-variant' | 'on-surface' | 'on-surface-variant' | 'on-surface-variant-lowest' | 'on-error' | 'on-error-container' | 'on-yellow' | 'on-dark-yellow' | 'on-yellow-container' | 'on-green' | 'on-dark-green' | 'on-green-container' | 'on-pink' | 'on-dark-pink' | 'on-pink-container' | 'on-steel-blue' | 'on-dark-steel-blue' | 'on-steel-blue-container' | 'error' | 'on-scrim';
1398
+ export declare type ForegroundColors = 'primary' | 'secondary' | 'tertiary' | 'yellow' | 'green' | 'pink' | 'steel-blue' | 'dark-yellow' | 'dark-green' | 'dark-pink' | 'dark-steel-blue' | 'inverse-on-surface' | 'on-primary' | 'on-secondary' | 'on-tertiary' | 'on-primary-container' | 'on-secondary-container' | 'on-tertiary-container' | 'on-primary-fixed' | 'on-primary-fixed-variant' | 'on-secondary-fixed' | 'on-secondary-fixed-variant' | 'on-tertiary-fixed' | 'on-tertiary-fixed-variant' | 'on-surface' | 'on-surface-variant' | 'on-surface-variant-lowest' | 'on-error' | 'on-error-container' | 'on-yellow' | 'on-dark-yellow' | 'on-yellow-container' | 'on-green' | 'on-dark-green' | 'on-green-container' | 'on-pink' | 'on-dark-pink' | 'on-pink-container' | 'on-steel-blue' | 'on-dark-steel-blue' | 'on-steel-blue-container' | 'error' | 'on-scrim' | 'on-container-neutral';
1397
1399
 
1398
1400
  export declare const FormLabel: ({ value, required, htmlFor, ...props }: FormLabelProps) => JSX.Element;
1399
1401
 
@@ -1732,6 +1734,7 @@ declare const iconMap: {
1732
1734
  readonly 'text-align-left': Icon_2;
1733
1735
  readonly 'text-align-right': Icon_2;
1734
1736
  readonly 'text-t': Icon_2;
1737
+ readonly ticket: Icon_2;
1735
1738
  readonly notches: Icon_2;
1736
1739
  readonly time: Icon_2;
1737
1740
  readonly timer: Icon_2;
@@ -1881,6 +1884,18 @@ export declare interface InfoBoxProps {
1881
1884
 
1882
1885
  export declare type InfoBoxVariant = 'default' | 'positive' | 'warning' | 'error' | 'subtle' | 'neutral' | 'outlined';
1883
1886
 
1887
+ /**
1888
+ * Detects **sectioned** `items` passed to `ListMenu`.
1889
+ *
1890
+ * **Sectioned** when the array is non-empty and the first entry looks like
1891
+ * `{ title?, items: ListMenuItem[] }`: it has an `items` array and does **not**
1892
+ * have a top-level `label` (every `ListMenuItem` has `label`). Any section may omit
1893
+ * `title` (e.g. the first group) — no header row is rendered.
1894
+ *
1895
+ * **Flat** when empty `[]` or when entries are normal rows. Do not mix shapes in one array.
1896
+ */
1897
+ export declare function isListMenuSections<T extends ElementType = 'a'>(items: ListMenuItem<T>[] | ListMenuSection<T>[]): items is ListMenuSection<T>[];
1898
+
1884
1899
  export declare type JustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly';
1885
1900
 
1886
1901
  declare type LabelStates = {
@@ -1924,9 +1939,10 @@ export declare type ListMenuItem<T extends React.ElementType = 'a'> = {
1924
1939
 
1925
1940
  export declare type ListMenuProps<T extends React.ElementType = 'a'> = {
1926
1941
  /**
1927
- * The list of menu items
1942
+ * Either a flat list of menu items (default) **or** an array of sections
1943
+ * `{ title?, items }[]`. The two shapes are mutually exclusive — use one or the other.
1928
1944
  */
1929
- items: ListMenuItem<T>[];
1945
+ items: ListMenuItem<T>[] | ListMenuSection<T>[];
1930
1946
  /**
1931
1947
  * The active item must match the id of the menu item
1932
1948
  */
@@ -1952,6 +1968,21 @@ export declare type ListMenuProps<T extends React.ElementType = 'a'> = {
1952
1968
  onItemClick?: (item: ListMenuItem<T>) => void;
1953
1969
  };
1954
1970
 
1971
+ /**
1972
+ * One titled group of rows inside a sectioned `ListMenu`. Do not mix with flat
1973
+ * `ListMenuItem[]` in the same `items` array.
1974
+ */
1975
+ export declare type ListMenuSection<T extends React.ElementType = 'a'> = {
1976
+ /**
1977
+ * Optional section header (uppercase label styling; omitted when missing, empty, or whitespace-only).
1978
+ */
1979
+ title?: string;
1980
+ /**
1981
+ * Rows in this section; same shape as flat `ListMenu` items.
1982
+ */
1983
+ items: ListMenuItem<T>[];
1984
+ };
1985
+
1955
1986
  export declare type ListMenuVariant = 'default' | 'compact';
1956
1987
 
1957
1988
  export declare type Margin = SpacingKeys | {
@@ -2034,7 +2065,11 @@ export declare interface MessageActionsProps {
2034
2065
 
2035
2066
  export declare type MessageActionsVariant = 'sender' | 'receiver';
2036
2067
 
2037
- export declare type MidSection<T extends React.ElementType = 'a'> = {
2068
+ /**
2069
+ * One titled block of mid-section rows. Items are always rendered with **compact** `ListMenu` density;
2070
+ * this type only describes the data shape (same as root `midSections` on `SideNavigation`).
2071
+ */
2072
+ export declare type MidSection<T extends ElementType = 'a'> = {
2038
2073
  /**
2039
2074
  * The title of the section
2040
2075
  */
@@ -2059,12 +2094,48 @@ export declare type MidSection<T extends React.ElementType = 'a'> = {
2059
2094
  */
2060
2095
  highlight?: boolean;
2061
2096
  /**
2062
- * When set, the section collapses into this icon when the menu is closed.
2097
+ * When set, the section collapses into this icon when the menu is closed (desktop only).
2063
2098
  * On hover, a PopUpMenu opens revealing the section items.
2064
2099
  */
2065
2100
  replaceWithIconOnClose?: CommonIconNames;
2066
2101
  };
2067
2102
 
2103
+ export declare const MidSectionMenus: {
2104
+ <T extends ElementType = "a">({ sections, open, variant, activeItem, linkComponent: LinkComponent, onItemClick, }: MidSectionMenusProps<T>): JSX.Element | null;
2105
+ displayName: string;
2106
+ };
2107
+
2108
+ export declare type MidSectionMenusProps<T extends ElementType = 'a'> = {
2109
+ /**
2110
+ * Section definitions (same shape as `SideNavigation` `midSections`).
2111
+ */
2112
+ sections: MidSection<T>[];
2113
+ /**
2114
+ * Whether the parent navigation is expanded (labels visible).
2115
+ * @default true
2116
+ */
2117
+ open?: boolean;
2118
+ /**
2119
+ * Sidebar shell width mode: must match the parent `SideNavigation` `variant` so open/closed width
2120
+ * transitions on the section wrappers stay aligned (`default` vs `compact` rail widths).
2121
+ * Does **not** change list row density — inner `ListMenu` instances are always `compact`.
2122
+ * @default 'default'
2123
+ */
2124
+ variant?: ListMenuVariant;
2125
+ /**
2126
+ * Active item id for `ListMenu` highlighting.
2127
+ */
2128
+ activeItem?: string;
2129
+ /**
2130
+ * Link element for menu rows.
2131
+ */
2132
+ linkComponent?: T | 'a';
2133
+ /**
2134
+ * Called when a row is activated (same contract as `ListMenu` / `SideNavigation` root lists).
2135
+ */
2136
+ onItemClick?: (item: ListMenuItem<T>) => void;
2137
+ };
2138
+
2068
2139
  declare type NonNullable_2<T> = Exclude<T, null | undefined>;
2069
2140
  export { NonNullable_2 as NonNullable }
2070
2141
 
@@ -2829,7 +2900,7 @@ export declare type SheetProps = UnionPlacement & {
2829
2900
  showBackArrow?: boolean;
2830
2901
  };
2831
2902
 
2832
- export declare const SideNavigation: <T extends React.ElementType = "a">({ menuItems, utilityItems, midSections, userArea, hideUserAreaInMobile, logo, open, variant, activeItem, onToggleOpen, onItemClick, linkComponent: LinkComponent, }: SideNavigationProps<T>) => JSX.Element;
2903
+ export declare const SideNavigation: <T extends ElementType = "a">({ menuItems, utilityItems, midSections, subMenus, userArea, hideUserAreaInMobile, hideToggleButton, addBorderToToggleButton, logo, open, variant, activeItem, onToggleOpen, onActiveItemChange, onItemClick, linkComponent: LinkComponent, }: SideNavigationProps<T>) => JSX.Element;
2833
2904
 
2834
2905
  export declare type SideNavigationProps<T extends React.ElementType = 'a'> = {
2835
2906
  /**
@@ -2865,9 +2936,15 @@ export declare type SideNavigationProps<T extends React.ElementType = 'a'> = {
2865
2936
  */
2866
2937
  utilityItems?: ListMenuItem<T>[];
2867
2938
  /**
2868
- * Additional sections rendered between menu items and utility items.
2939
+ * Sections between the root main list and utility items, with collapse/expand behavior when the sidebar
2940
+ * closes (see `replaceWithIconOnClose`). Only the **root** column uses this prop; any lists inside a
2941
+ * slide-in panel belong in that layer’s `content`.
2869
2942
  */
2870
2943
  midSections?: MidSection<T>[];
2944
+ /**
2945
+ * Slide-in panels: `parentId` matches a root `menuItems` id; `content` is the custom body (back row is built-in).
2946
+ */
2947
+ subMenus?: SubMenuLayer[];
2871
2948
  /**
2872
2949
  * User area rendered at the bottom of the navigation
2873
2950
  */
@@ -2878,7 +2955,21 @@ export declare type SideNavigationProps<T extends React.ElementType = 'a'> = {
2878
2955
  */
2879
2956
  hideUserAreaInMobile?: boolean;
2880
2957
  /**
2881
- * The active item must match the id of the menu item
2958
+ * When `true`, the built-in expand/collapse control in the header row is not rendered.
2959
+ * Use a `utilityItems` entry with `onClick` (and controlled `open` / `onToggleOpen`) instead.
2960
+ * @default false
2961
+ */
2962
+ hideToggleButton?: boolean;
2963
+ /**
2964
+ * When `true`, a border top, right and bottom are added to the toggle button. <br />
2965
+ * This is useful when the SideNavigation is used next to a Card with outlined variant as a content container.
2966
+ * @default false
2967
+ */
2968
+ addBorderToToggleButton?: boolean;
2969
+ /**
2970
+ * Active id for **root** `menuItems` / `utilityItems`. To open a sub panel from the shell, pass either the
2971
+ * layer’s `parentId` (e.g. `'zain'`) or an opaque dotted string `'<parentId>.<segment>'` where only the
2972
+ * part before the first `.` is read to choose the panel; the rest is for your app / `content` only.
2882
2973
  */
2883
2974
  activeItem?: string;
2884
2975
  /**
@@ -2889,6 +2980,12 @@ export declare type SideNavigationProps<T extends React.ElementType = 'a'> = {
2889
2980
  * The callback to handle the open/close state
2890
2981
  */
2891
2982
  onToggleOpen?: (open: boolean) => void;
2983
+ /**
2984
+ * Fired after a root `menuItems` / `utilityItems` click with the suggested `activeItem` id, or with the
2985
+ * sub-panel `parentId` when opening a layer. Not called for `__back__` or `target="_blank"`. Clicks inside
2986
+ * `subMenus[].content` are not observed here.
2987
+ */
2988
+ onActiveItemChange?: (activeItem: string) => void;
2892
2989
  /**
2893
2990
  * The callback to handle the item click
2894
2991
  */
@@ -3141,6 +3238,27 @@ export declare interface StackProps extends React.HTMLAttributes<HTMLDivElement>
3141
3238
  maxWidth?: ResponsiveType<number | string>;
3142
3239
  }
3143
3240
 
3241
+ /**
3242
+ * Slide-in panel for a root `menuItems` entry. The shell renders only the back row and spacer; pass any
3243
+ * content (e.g. one or more `ListMenu`s from a micro-frontend) as `content`. Selection and `activeItem`
3244
+ * for that UI live outside `SideNavigation`.
3245
+ */
3246
+ export declare type SubMenuLayer = {
3247
+ /**
3248
+ * Must match the `id` of the root `menuItems` entry that opens this panel.
3249
+ */
3250
+ parentId: string;
3251
+ /**
3252
+ * Custom body below the back row (often `ListMenu` or composed layout from a remote module).
3253
+ */
3254
+ content: ReactNode;
3255
+ /**
3256
+ * Label for the control that returns to the main menu.
3257
+ * @default 'Hauptmenü'
3258
+ */
3259
+ backLabel?: string;
3260
+ };
3261
+
3144
3262
  export declare const Switch: default_2.ForwardRefExoticComponent<SwitchProps & default_2.RefAttributes<HTMLInputElement>>;
3145
3263
 
3146
3264
  export declare interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {