@ssa-ui-kit/core 3.25.0 → 3.26.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 (47) hide show
  1. package/dist/ai/source-map.md +76 -23
  2. package/dist/components/Breadcrumbs/styles.d.ts +1 -1
  3. package/dist/components/Chip/helpers.d.ts +2 -2
  4. package/dist/components/Chip/types.d.ts +10 -3
  5. package/dist/components/ContextMenu/ContextMenu.d.ts +74 -0
  6. package/dist/components/ContextMenu/ContextMenuOption.d.ts +18 -0
  7. package/dist/components/ContextMenu/index.d.ts +3 -0
  8. package/dist/components/ContextMenu/styles.d.ts +17 -0
  9. package/dist/components/ContextMenu/types.d.ts +153 -0
  10. package/dist/components/ContextMenu/utils.d.ts +79 -0
  11. package/dist/components/Dropdown/Dropdown.d.ts +1 -1
  12. package/dist/components/Dropdown/types.d.ts +14 -0
  13. package/dist/components/DropdownOptions/DropdownOptions.d.ts +5 -5
  14. package/dist/components/DropdownOptions/useToggleListKeys.d.ts +33 -0
  15. package/dist/components/DropdownOptions/utils.d.ts +9 -0
  16. package/dist/components/FiltersMultiSelect/FiltersMultiSelectProvider.d.ts +9 -0
  17. package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOption.d.ts +31 -1
  18. package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOptions.d.ts +29 -2
  19. package/dist/components/FiltersMultiSelect/utils.d.ts +15 -0
  20. package/dist/components/Footer/Footer.d.ts +42 -0
  21. package/dist/components/Footer/index.d.ts +1 -0
  22. package/dist/components/Footer/styles.d.ts +53 -0
  23. package/dist/components/Footer/types.d.ts +110 -0
  24. package/dist/components/Header/Header.d.ts +4 -4
  25. package/dist/components/Header/HeaderMobileMenu.d.ts +4 -3
  26. package/dist/components/Header/styles.d.ts +15 -4
  27. package/dist/components/Label/Label.d.ts +11 -1
  28. package/dist/components/Label/index.d.ts +1 -0
  29. package/dist/components/Label/types.d.ts +36 -1
  30. package/dist/components/MultipleDropdown/MultipleDropdown.d.ts +4 -1
  31. package/dist/components/MultipleDropdown/types.d.ts +8 -0
  32. package/dist/components/MultipleDropdownOptions/MultipleDropdownOptions.d.ts +27 -0
  33. package/dist/components/Table/ColumnFreezeMenu.d.ts +2 -0
  34. package/dist/components/TextField/TextField.d.ts +1 -1
  35. package/dist/components/TextField/types.d.ts +7 -0
  36. package/dist/components/Textarea/types.d.ts +4 -0
  37. package/dist/components/Typeahead/Typeahead.context.d.ts +10 -1
  38. package/dist/components/Typeahead/Typeahead.d.ts +1 -1
  39. package/dist/components/Typeahead/components/TypeaheadOptions.d.ts +13 -1
  40. package/dist/components/Typeahead/styles.d.ts +5 -0
  41. package/dist/components/Typeahead/types.d.ts +14 -1
  42. package/dist/components/Typeahead/useTypeahead.d.ts +12 -2
  43. package/dist/components/index.d.ts +5 -0
  44. package/dist/index.js +3593 -2167
  45. package/dist/index.mjs +3588 -2168
  46. package/dist/tsbuildcache +1 -1
  47. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
1
  import type { UseFormReturn, FieldError } from 'react-hook-form';
2
2
  import { InputProps } from '../Input/types';
3
+ import { LabelBadge } from '../Label/types';
3
4
  /**
4
5
  * Props for the TextField component
5
6
  *
@@ -55,6 +56,12 @@ export interface TextFieldProps extends InputProps, Partial<Pick<UseFormReturn,
55
56
  * Label text displayed above the input field
56
57
  */
57
58
  label?: string;
59
+ /**
60
+ * Status badge to the right of the label, e.g.
61
+ * `{ text: 'mapped', color: 'primary' }`. Announced as the field's
62
+ * description. Needs a `label`.
63
+ */
64
+ labelBadge?: LabelBadge;
58
65
  /**
59
66
  * React Hook Form field error object
60
67
  * Used to display validation error messages
@@ -111,6 +111,10 @@ export interface TextareaProps extends Partial<Pick<UseFormReturn, 'register'>>
111
111
  * Defaults to `formElement-${name}` when not provided.
112
112
  */
113
113
  id?: string;
114
+ /**
115
+ * Ids of the elements describing the textarea — a label badge, helper text
116
+ */
117
+ 'aria-describedby'?: string;
114
118
  /**
115
119
  * Paste event handler
116
120
  * Fired when content is pasted into the textarea
@@ -11,6 +11,7 @@ export declare const TypeaheadContext: React.Context<{
11
11
  isMultiple: boolean | undefined;
12
12
  singleLine: boolean;
13
13
  typeaheadId: string;
14
+ labelId: string | undefined;
14
15
  triggerRef: React.RefObject<HTMLDivElement | null>;
15
16
  className: string | undefined;
16
17
  startIcon: React.ReactNode;
@@ -24,8 +25,16 @@ export declare const TypeaheadContext: React.Context<{
24
25
  status: "error" | "success" | "basic";
25
26
  error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
26
27
  placeholder: string | null | undefined;
27
- options: (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
28
+ listId: string;
29
+ menuItems: import("..").ContextMenuItem<import("./types").TypeaheadValue>[];
30
+ activeValue: import("./types").TypeaheadValue | null;
31
+ setActiveValue: React.Dispatch<React.SetStateAction<import("./types").TypeaheadValue | null>>;
32
+ inputAriaProps: {
33
+ 'aria-controls': string | undefined;
34
+ 'aria-activedescendant': string | undefined;
35
+ };
28
36
  customOptionValue: string | null;
37
+ handleOptionAction: (value: import("./types").TypeaheadValue) => void;
29
38
  handleChange: ({ value, shouldClose, resetInput, }: {
30
39
  value?: string | number;
31
40
  shouldClose?: boolean;
@@ -172,4 +172,4 @@ import { TypeaheadProps } from './types';
172
172
  *
173
173
  * @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
174
174
  */
175
- export declare const Typeahead: ({ name, label, value, defaultValue, selectedItems, defaultSelectedItems, isOpen, disabled, isDisabled, isMultiple, singleLine, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, popoverClassName, optionsClassName, wrapperClassName, filterOptions, autoSelect, allowCustomValues, width, onChange, onEmptyChange, onClearAll, onRemoveSelectedClick, renderOption, }: TypeaheadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
175
+ export declare const Typeahead: ({ name, label, labelBadge, value, defaultValue, selectedItems, defaultSelectedItems, isOpen, disabled, isDisabled, isMultiple, singleLine, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, popoverClassName, optionsClassName, wrapperClassName, filterOptions, autoSelect, allowCustomValues, width, onChange, onEmptyChange, onClearAll, onRemoveSelectedClick, renderOption, }: TypeaheadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -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>, {}>;
@@ -1,5 +1,6 @@
1
1
  import { CommonProps } from '../../types/emotion';
2
2
  import { FieldError } from 'react-hook-form';
3
+ import { LabelBadge } from '../Label/types';
3
4
  /**
4
5
  * Allowed value types for Typeahead options
5
6
  */
@@ -139,6 +140,12 @@ export interface TypeaheadProps {
139
140
  * Label text displayed above the input
140
141
  */
141
142
  label?: string;
143
+ /**
144
+ * Status badge to the right of the label, e.g.
145
+ * `{ text: 'mapped', color: 'primary' }`. Announced as the input's
146
+ * description. Needs a `label`.
147
+ */
148
+ labelBadge?: LabelBadge;
142
149
  /**
143
150
  * Helper text displayed below the input
144
151
  */
@@ -214,11 +221,17 @@ export interface TypeaheadProps {
214
221
  * Props used by the useTypeahead hook
215
222
  * Internal type that picks specific props from TypeaheadProps
216
223
  */
217
- export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'defaultSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'singleLine' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'validationSchema' | 'error' | 'success' | 'placeholder' | 'filterOptions' | 'autoSelect' | 'allowCustomValues'>;
224
+ export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'defaultSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'singleLine' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'validationSchema' | 'error' | 'success' | 'placeholder' | 'filterOptions' | 'autoSelect' | 'allowCustomValues' | 'label'>;
218
225
  /**
219
226
  * Props for TypeaheadOptions container component
220
227
  */
221
228
  export interface TypeaheadItemsListProps extends CommonProps {
229
+ /**
230
+ * Ignored: the options come from the `TypeaheadOption` children of
231
+ * `Typeahead`, through context.
232
+ *
233
+ * @deprecated Has no effect. Removed in the next major release.
234
+ */
222
235
  children?: React.ReactNode;
223
236
  noItemsMessage?: string;
224
237
  }
@@ -1,12 +1,13 @@
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;
6
7
  shouldClose?: boolean;
7
8
  resetInput?: boolean;
8
9
  };
9
- export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: providedSelectedItems, defaultSelectedItems, isDisabled, isMultiple, singleLine, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, filterOptions, autoSelect, allowCustomValues, onChange, onClearAll, onRemoveSelectedClick, onEmptyChange, renderOption, }: UseTypeaheadProps) => {
10
+ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: providedSelectedItems, defaultSelectedItems, isDisabled, isMultiple, singleLine, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, filterOptions, autoSelect, allowCustomValues, onChange, onClearAll, onRemoveSelectedClick, onEmptyChange, renderOption, label, }: UseTypeaheadProps) => {
10
11
  isOpen: boolean;
11
12
  isDisabled: boolean | undefined;
12
13
  optionsWithKey: Record<string | number, TypeaheadOptionProps>;
@@ -16,6 +17,7 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: p
16
17
  isMultiple: boolean | undefined;
17
18
  singleLine: boolean;
18
19
  typeaheadId: string;
20
+ labelId: string | undefined;
19
21
  triggerRef: React.RefObject<HTMLDivElement | null>;
20
22
  className: string | undefined;
21
23
  startIcon: React.ReactNode;
@@ -29,8 +31,16 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: p
29
31
  status: "error" | "success" | "basic";
30
32
  error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
31
33
  placeholder: string | null | undefined;
32
- options: (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
34
+ listId: string;
35
+ menuItems: ContextMenuItem<TypeaheadValue>[];
36
+ activeValue: TypeaheadValue | null;
37
+ setActiveValue: React.Dispatch<React.SetStateAction<TypeaheadValue | null>>;
38
+ inputAriaProps: {
39
+ 'aria-controls': string | undefined;
40
+ 'aria-activedescendant': string | undefined;
41
+ };
33
42
  customOptionValue: string | null;
43
+ handleOptionAction: (value: TypeaheadValue) => void;
34
44
  handleChange: ({ value, shouldClose, resetInput, }: HandleChangeParams) => void;
35
45
  useFormResult: import("react-hook-form").UseFormReturn<import("react-hook-form").FieldValues, any, import("react-hook-form").FieldValues>;
36
46
  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';
@@ -91,6 +93,7 @@ export type * from './Chip/types';
91
93
  export { default as Avatar } from './Avatar';
92
94
  export * from './Avatar/types';
93
95
  export { default as Label } from './Label';
96
+ export { getLabelBadgeId } from './Label';
94
97
  export type * from './Label/types';
95
98
  export { default as Indicator } from './Indicator';
96
99
  export type * from './Indicator/types';
@@ -119,6 +122,8 @@ export * from './NavBar';
119
122
  export * from './CollapsibleNavBar';
120
123
  export * from './Header';
121
124
  export type * from './Header/types';
125
+ export * from './Footer';
126
+ export type * from './Footer/types';
122
127
  export * from './TreeView';
123
128
  export { default as Tab } from './Tab';
124
129
  export { default as TabBar } from './TabBar';