@ssa-ui-kit/core 3.25.0 → 3.25.1

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 (33) hide show
  1. package/dist/ai/source-map.md +44 -14
  2. package/dist/components/Breadcrumbs/styles.d.ts +1 -1
  3. package/dist/components/ContextMenu/ContextMenu.d.ts +74 -0
  4. package/dist/components/ContextMenu/ContextMenuOption.d.ts +18 -0
  5. package/dist/components/ContextMenu/index.d.ts +3 -0
  6. package/dist/components/ContextMenu/styles.d.ts +17 -0
  7. package/dist/components/ContextMenu/types.d.ts +153 -0
  8. package/dist/components/ContextMenu/utils.d.ts +79 -0
  9. package/dist/components/Dropdown/types.d.ts +7 -0
  10. package/dist/components/DropdownOptions/DropdownOptions.d.ts +5 -5
  11. package/dist/components/DropdownOptions/useToggleListKeys.d.ts +33 -0
  12. package/dist/components/DropdownOptions/utils.d.ts +9 -0
  13. package/dist/components/FiltersMultiSelect/FiltersMultiSelectProvider.d.ts +9 -0
  14. package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOption.d.ts +31 -1
  15. package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOptions.d.ts +29 -2
  16. package/dist/components/FiltersMultiSelect/utils.d.ts +15 -0
  17. package/dist/components/Header/Header.d.ts +4 -4
  18. package/dist/components/Header/HeaderMobileMenu.d.ts +4 -3
  19. package/dist/components/Header/styles.d.ts +15 -4
  20. package/dist/components/MultipleDropdown/MultipleDropdown.d.ts +4 -1
  21. package/dist/components/MultipleDropdown/types.d.ts +8 -0
  22. package/dist/components/MultipleDropdownOptions/MultipleDropdownOptions.d.ts +27 -0
  23. package/dist/components/Table/ColumnFreezeMenu.d.ts +2 -0
  24. package/dist/components/Typeahead/Typeahead.context.d.ts +9 -1
  25. package/dist/components/Typeahead/components/TypeaheadOptions.d.ts +13 -1
  26. package/dist/components/Typeahead/styles.d.ts +5 -0
  27. package/dist/components/Typeahead/types.d.ts +6 -0
  28. package/dist/components/Typeahead/useTypeahead.d.ts +10 -1
  29. package/dist/components/index.d.ts +2 -0
  30. package/dist/index.js +2532 -1514
  31. package/dist/index.mjs +2529 -1515
  32. package/dist/tsbuildcache +1 -1
  33. package/package.json +3 -3
@@ -1,4 +1,31 @@
1
1
  import React, { type HTMLAttributes } from 'react';
2
- export declare const FiltersMultiSelectOptions: ({ children, ...props }: {
2
+ /**
3
+ * FiltersMultiSelectOptions - The options list of a `FiltersMultiSelect`.
4
+ *
5
+ * Renders its `FiltersMultiSelectOption` children as an include / exclude
6
+ * `ContextMenu`: + and − on each row (one check-circle on group rows), Enter
7
+ * in the search input cycles the highlighted row. Shows the
8
+ * `FiltersMultiSelect` `emptyNode` when it has no options.
9
+ *
10
+ * @category Form Controls
11
+ * @subcategory Selection
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <FiltersMultiSelect store={store}>
16
+ * <FiltersMultiSelectOptions>
17
+ * {filters.map((filter) => (
18
+ * <FiltersMultiSelectOption key={filter.id} filter={filter}>
19
+ * {filter.label}
20
+ * </FiltersMultiSelectOption>
21
+ * ))}
22
+ * </FiltersMultiSelectOptions>
23
+ * </FiltersMultiSelect>
24
+ * ```
25
+ *
26
+ * @see {@link FiltersMultiSelect} - Parent component
27
+ * @see {@link FiltersMultiSelectOption} - One filter row
28
+ */
29
+ export declare const FiltersMultiSelectOptions: ({ children, onMouseDown, ...props }: {
3
30
  children: React.ReactNode;
4
- } & HTMLAttributes<HTMLDivElement>) => import("@emotion/react/jsx-runtime").JSX.Element;
31
+ } & Omit<HTMLAttributes<HTMLUListElement>, "onChange" | "defaultValue" | "children">) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { ContextMenuIncludeExcludeEntry, ContextMenuIncludeExcludeType, ContextMenuItem } from '../ContextMenu';
3
+ import { Filter, SelectedFilter, UseFiltersMultiSelectStore } from './useFiltersMultiSelect';
4
+ /** A ContextMenu row together with the filter it stands for. */
5
+ export type FilterMenuItem = ContextMenuItem<string> & {
6
+ filter: Filter;
7
+ };
8
+ /** Reads `FiltersMultiSelectOption` children into ContextMenu items. */
9
+ export declare const toFilterMenuItems: (children: React.ReactNode) => FilterMenuItem[];
10
+ /** The store's selection in ContextMenu's `includeExclude` shape. */
11
+ export declare const toMenuSelection: (selectedFilters: SelectedFilter[]) => ContextMenuIncludeExcludeEntry<string>[];
12
+ /** The store's current type for a filter, in ContextMenu's terms. */
13
+ export declare const getMenuType: (store: UseFiltersMultiSelectStore, id: string) => ContextMenuIncludeExcludeType | undefined;
14
+ /** Selects `filter` as `type`, or unselects it when `type` is undefined. */
15
+ export declare const setFilterType: (store: UseFiltersMultiSelectStore, { id, label }: Filter, type: ContextMenuIncludeExcludeType | undefined) => void;
@@ -11,10 +11,10 @@ import { HeaderProps } from './types';
11
11
  * further. Following a link closes them.
12
12
  *
13
13
  * ### Layout
14
- * From 900px the navigation is centred between the logo and the right side,
15
- * and scrolls sideways when it does not fit. Below 900px it moves into a
16
- * drawer opened by a burger button, the logo is centred and `rightSide`
17
- * stays as it is.
14
+ * The layout follows the Header's own width, not the window's. From 900px
15
+ * the navigation is centred between the logo and the right side, and scrolls
16
+ * sideways when it does not fit. Below 900px it moves into a drawer opened
17
+ * by a burger button, the logo is centred and `rightSide` stays as it is.
18
18
  *
19
19
  * ### Selected state
20
20
  * The design sets the selected item in bold. The kit marks it by color
@@ -10,9 +10,10 @@ interface HeaderMobileMenuProps {
10
10
  navLabel: string;
11
11
  }
12
12
  /**
13
- * The navigation below 900px: a full-width drawer holding a `TreeView`, the
14
- * same engine as CollapsibleNavBar's menu. The tree owns expansion and opens
15
- * the group holding the current page; this module owns the routing.
13
+ * The navigation below 900px: a 400px drawer (full width on phones) holding
14
+ * a `TreeView`, the same engine as CollapsibleNavBar's menu. The tree owns
15
+ * expansion and opens the group holding the current page; this module owns
16
+ * the routing.
16
17
  */
17
18
  export declare const HeaderMobileMenu: ({ store, items, headerTheme, palette, pathname, navLabel, }: HeaderMobileMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
18
19
  export {};
@@ -5,6 +5,8 @@ export declare const SIZES: Record<HeaderSize, {
5
5
  logo: number;
6
6
  }>;
7
7
  export declare const MENU_WIDTH = 164;
8
+ /** From this header width up the bar shows the nav; below it, the burger. */
9
+ export declare const DESKTOP_MIN_WIDTH = 900;
8
10
  /** Design: dropdowns sit 6px below their trigger and flyouts 6px aside. */
9
11
  export declare const MENU_OFFSET = 6;
10
12
  export declare const resolvePalette: (theme: Theme, headerTheme: HeaderTheme) => {
@@ -33,10 +35,16 @@ export declare const resolvePalette: (theme: Theme, headerTheme: HeaderTheme) =>
33
35
  drawerBackground: `rgb${string}` | "transparent";
34
36
  };
35
37
  export type HeaderPalette = ReturnType<typeof resolvePalette>;
36
- export declare const root: (theme: Theme, palette: HeaderPalette, size: HeaderSize) => import("@emotion/react").SerializedStyles;
38
+ /**
39
+ * The query container. It is the `header` itself, so consumer styles such
40
+ * as `position: sticky` land on the outermost element; the layout that
41
+ * the query switches lives on the bar inside.
42
+ */
43
+ export declare const container: (palette: HeaderPalette) => import("@emotion/react").SerializedStyles;
44
+ export declare const bar: (size: HeaderSize) => import("@emotion/react").SerializedStyles;
37
45
  export declare const burger: (theme: Theme, palette: HeaderPalette) => import("@emotion/react").SerializedStyles;
38
46
  /** Holds the burger's column when there is no menu, so the logo stays centred. */
39
- export declare const burgerPlaceholder: (theme: Theme) => import("@emotion/react").SerializedStyles;
47
+ export declare const burgerPlaceholder: import("@emotion/react").SerializedStyles;
40
48
  /**
41
49
  * Fixed height from the size; width follows the logo so wordmarks fit, but
42
50
  * never drops below a square, so an empty box still holds its place.
@@ -46,7 +54,7 @@ export declare const logo: (size: HeaderSize) => import("@emotion/react").Serial
46
54
  * The scroll container. Dropdowns are portalled, so the overflow here does
47
55
  * not clip them.
48
56
  */
49
- export declare const nav: (theme: Theme) => import("@emotion/react").SerializedStyles;
57
+ export declare const nav: import("@emotion/react").SerializedStyles;
50
58
  /** `margin: auto` centres the list while it fits and lets it scroll after. */
51
59
  export declare const navList: import("@emotion/react").SerializedStyles;
52
60
  export declare const rightSide: import("@emotion/react").SerializedStyles;
@@ -59,5 +67,8 @@ export declare const navItem: (theme: Theme, palette: HeaderPalette, active: boo
59
67
  export declare const menu: (theme: Theme, palette: HeaderPalette) => import("@emotion/react").SerializedStyles;
60
68
  export declare const menuItem: (theme: Theme, palette: HeaderPalette, active: boolean) => import("@emotion/react").SerializedStyles;
61
69
  export declare const drawerContent: (palette: HeaderPalette) => import("@emotion/react").SerializedStyles;
62
- /** Chevron of a mobile group row; flips while the group is open. */
70
+ /**
71
+ * Chevron of a mobile group row; flips while the group is open. Pushed to the
72
+ * row's end so every chevron shares one vertical line.
73
+ */
63
74
  export declare const mobileToggle: (expanded: boolean) => import("@emotion/react").SerializedStyles;
@@ -68,7 +68,10 @@ import { DropdownProps } from './types';
68
68
  *
69
69
  * @accessibility
70
70
  * - ARIA attributes set according to WAI-ARIA combobox pattern
71
- * - Keyboard navigation (Arrow keys, Enter, Escape)
71
+ * - Focus stays on the toggle, which points at the highlighted option with
72
+ * `aria-activedescendant`
73
+ * - Arrow keys, Home and End move the highlight; Enter or Space toggles it
74
+ * (picks and closes in single-select mode); Escape and Tab close
72
75
  * - Click outside to close
73
76
  * - Screen reader friendly with aria-expanded and aria-controls
74
77
  *
@@ -119,4 +119,12 @@ export interface DropdownContextType<T extends DropdownOptionProps> {
119
119
  * Max height (px) of the options list
120
120
  */
121
121
  maxHeight?: number;
122
+ /**
123
+ * Highlighted option, driven by the toggle's keyboard and the pointer
124
+ */
125
+ activeValue?: string | number | null;
126
+ /**
127
+ * Updates the highlighted option
128
+ */
129
+ setActiveValue?: (value: string | number | null) => void;
122
130
  }
@@ -1,3 +1,30 @@
1
1
  import { DropdownItemsListProps } from './types';
2
+ /**
3
+ * MultipleDropdownOptions - Options menu container for MultipleDropdown
4
+ *
5
+ * Renders the `DropdownOption` children as a `ContextMenu` under the
6
+ * MultipleDropdown toggle: a checkbox per row in multi-select mode, a check
7
+ * mark on the selected row otherwise. Focus stays on the toggle; the
8
+ * highlighted option is driven from there and announced through
9
+ * `aria-activedescendant`.
10
+ *
11
+ * @category Form Controls
12
+ * @subcategory Selection
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * // Rendered by MultipleDropdown from its DropdownOption children
17
+ * <MultipleDropdown label="Fruits" onChange={handleChange}>
18
+ * <DropdownOption value="apple">Apple</DropdownOption>
19
+ * <DropdownOption value="banana">Banana</DropdownOption>
20
+ * </MultipleDropdown>
21
+ * ```
22
+ *
23
+ * @see {@link MultipleDropdown} - Parent component
24
+ *
25
+ * @accessibility
26
+ * - Uses role="listbox" (multi-selectable in multi-select mode) with role="option" rows
27
+ * - Arrow keys, Home, End, Enter, Space and Escape on the toggle
28
+ */
2
29
  declare const MultipleDropdownOptions: ({ "aria-labelledby": ariaLabelledbyNative, ariaLabelledby, id, children, }: DropdownItemsListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
30
  export default MultipleDropdownOptions;
@@ -27,6 +27,8 @@ import { ColumnFreezeMenuProps } from './types';
27
27
  *
28
28
  * @accessibility
29
29
  * - The trigger is a labelled button, reachable by keyboard even while hidden
30
+ * - Opening moves focus into the menu (`role="menu"`): arrows, Home, End and
31
+ * type-to-find move the highlight, Enter or Space picks, Escape closes
30
32
  * - Clicks inside the menu do not reach the header cell, so they never sort
31
33
  */
32
34
  export declare const ColumnFreezeMenu: ({ columnId }: ColumnFreezeMenuProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -24,8 +24,16 @@ export declare const TypeaheadContext: React.Context<{
24
24
  status: "error" | "success" | "basic";
25
25
  error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
26
26
  placeholder: string | null | undefined;
27
- options: (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
27
+ listId: string;
28
+ menuItems: import("..").ContextMenuItem<import("./types").TypeaheadValue>[];
29
+ activeValue: import("./types").TypeaheadValue | null;
30
+ setActiveValue: React.Dispatch<React.SetStateAction<import("./types").TypeaheadValue | null>>;
31
+ inputAriaProps: {
32
+ 'aria-controls': string | undefined;
33
+ 'aria-activedescendant': string | undefined;
34
+ };
28
35
  customOptionValue: string | null;
36
+ handleOptionAction: (value: import("./types").TypeaheadValue) => void;
29
37
  handleChange: ({ value, shouldClose, resetInput, }: {
30
38
  value?: string | number;
31
39
  shouldClose?: boolean;
@@ -1,2 +1,14 @@
1
1
  import { TypeaheadItemsListProps } from '../types';
2
- export declare const TypeaheadOptions: ({ noItemsMessage, children, }: TypeaheadItemsListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ /**
3
+ * TypeaheadOptions - The Typeahead's option list: a `ContextMenu` driven from
4
+ * the Typeahead's input. The options themselves come from the `TypeaheadOption`
5
+ * children of `Typeahead`, filtered by the typed text. Rendered by
6
+ * `Typeahead` itself; reads everything from the Typeahead context.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * // Inside a Typeahead's popup
11
+ * <TypeaheadOptions noItemsMessage="Nobody matches" />
12
+ * ```
13
+ */
14
+ export declare const TypeaheadOptions: ({ noItemsMessage, className, }: TypeaheadItemsListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -75,3 +75,8 @@ export declare const TypeaheadTrigger: import("@emotion/styled").StyledComponent
75
75
  isOpen: boolean;
76
76
  status: ReturnType<typeof useTypeahead>["status"];
77
77
  }, {}, {}>;
78
+ /** A user-typed value that is not one of the options. */
79
+ export declare const CustomValueLabel: import("@emotion/styled").StyledComponent<{
80
+ theme?: Theme;
81
+ as?: React.ElementType;
82
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
@@ -219,6 +219,12 @@ export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'defaultS
219
219
  * Props for TypeaheadOptions container component
220
220
  */
221
221
  export interface TypeaheadItemsListProps extends CommonProps {
222
+ /**
223
+ * Ignored: the options come from the `TypeaheadOption` children of
224
+ * `Typeahead`, through context.
225
+ *
226
+ * @deprecated Has no effect. Removed in the next major release.
227
+ */
222
228
  children?: React.ReactNode;
223
229
  noItemsMessage?: string;
224
230
  }
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { OpenChangeReason } from '@floating-ui/react';
3
+ import { ContextMenuItem } from '../ContextMenu';
3
4
  import { TypeaheadOptionProps, TypeaheadValue, UseTypeaheadProps } from './types';
4
5
  type HandleChangeParams = {
5
6
  value?: string | number;
@@ -29,8 +30,16 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: p
29
30
  status: "error" | "success" | "basic";
30
31
  error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
31
32
  placeholder: string | null | undefined;
32
- options: (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
33
+ listId: string;
34
+ menuItems: ContextMenuItem<TypeaheadValue>[];
35
+ activeValue: TypeaheadValue | null;
36
+ setActiveValue: React.Dispatch<React.SetStateAction<TypeaheadValue | null>>;
37
+ inputAriaProps: {
38
+ 'aria-controls': string | undefined;
39
+ 'aria-activedescendant': string | undefined;
40
+ };
33
41
  customOptionValue: string | null;
42
+ handleOptionAction: (value: TypeaheadValue) => void;
34
43
  handleChange: ({ value, shouldClose, resetInput, }: HandleChangeParams) => void;
35
44
  useFormResult: import("react-hook-form").UseFormReturn<import("react-hook-form").FieldValues, any, import("react-hook-form").FieldValues>;
36
45
  register: import("react-hook-form").UseFormRegister<import("react-hook-form").FieldValues>;
@@ -25,6 +25,8 @@ export { default as Radio } from './Radio';
25
25
  export type { RadioProps } from './Radio/types';
26
26
  export { default as RadioGroup } from './RadioGroup';
27
27
  export type * from './RadioGroup/types';
28
+ export * from './ContextMenu';
29
+ export type * from './ContextMenu/types';
28
30
  export { default as Dropdown } from './Dropdown';
29
31
  export type * from './Dropdown/types';
30
32
  export { default as DropdownArrow } from './DropdownArrow';