@ssa-ui-kit/core 3.24.1 → 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.
- package/dist/ai/source-map.md +119 -55
- package/dist/components/Breadcrumbs/styles.d.ts +1 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +74 -0
- package/dist/components/ContextMenu/ContextMenuOption.d.ts +18 -0
- package/dist/components/ContextMenu/index.d.ts +3 -0
- package/dist/components/ContextMenu/styles.d.ts +17 -0
- package/dist/components/ContextMenu/types.d.ts +153 -0
- package/dist/components/ContextMenu/utils.d.ts +79 -0
- package/dist/components/Dropdown/types.d.ts +7 -0
- package/dist/components/DropdownOptions/DropdownOptions.d.ts +5 -5
- package/dist/components/DropdownOptions/useToggleListKeys.d.ts +33 -0
- package/dist/components/DropdownOptions/utils.d.ts +9 -0
- package/dist/components/FiltersMultiSelect/FiltersMultiSelectProvider.d.ts +9 -0
- package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOption.d.ts +31 -1
- package/dist/components/FiltersMultiSelect/components/FiltersMultiSelectOptions.d.ts +29 -2
- package/dist/components/FiltersMultiSelect/utils.d.ts +15 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.d.ts +79 -0
- package/dist/components/FloatingActionButton/index.d.ts +1 -0
- package/dist/components/FloatingActionButton/styles.d.ts +42 -0
- package/dist/components/FloatingActionButton/types.d.ts +129 -0
- package/dist/components/Header/Header.d.ts +43 -0
- package/dist/components/Header/HeaderMobileMenu.d.ts +19 -0
- package/dist/components/Header/HeaderNavMenu.d.ts +17 -0
- package/dist/components/Header/helpers.d.ts +13 -0
- package/dist/components/Header/index.d.ts +1 -0
- package/dist/components/Header/styles.d.ts +74 -0
- package/dist/components/Header/types.d.ts +104 -0
- package/dist/components/MultipleDropdown/MultipleDropdown.d.ts +4 -1
- package/dist/components/MultipleDropdown/types.d.ts +8 -0
- package/dist/components/MultipleDropdownOptions/MultipleDropdownOptions.d.ts +27 -0
- package/dist/components/Table/ColumnFreezeMenu.d.ts +2 -0
- package/dist/components/Typeahead/Typeahead.context.d.ts +9 -1
- package/dist/components/Typeahead/components/TypeaheadOptions.d.ts +13 -1
- package/dist/components/Typeahead/styles.d.ts +5 -0
- package/dist/components/Typeahead/types.d.ts +6 -0
- package/dist/components/Typeahead/useTypeahead.d.ts +10 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/index.js +10204 -8167
- package/dist/index.mjs +12979 -10948
- package/dist/tsbuildcache +1 -1
- package/dist/utils/colorUtils.d.ts +15 -0
- package/package.json +3 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { MapIconsType } from '../Icon/types';
|
|
3
|
+
/**
|
|
4
|
+
* Header size. Sets the bar height — 64px, 84px or 92px — and the logo box.
|
|
5
|
+
*/
|
|
6
|
+
export type HeaderSize = 'small' | 'medium' | 'large';
|
|
7
|
+
/**
|
|
8
|
+
* Header color scheme: white bar, or the dark graphite gradient.
|
|
9
|
+
*/
|
|
10
|
+
export type HeaderTheme = 'light' | 'dark';
|
|
11
|
+
/**
|
|
12
|
+
* One entry of the Header navigation.
|
|
13
|
+
*
|
|
14
|
+
* A leaf item with a `path` renders as a router link. An item with `children`
|
|
15
|
+
* is a group: on desktop it opens a dropdown (hover with a mouse, tap on touch
|
|
16
|
+
* screens), in the mobile menu it expands in place. Groups nest two levels
|
|
17
|
+
* deep at most — the third level is not rendered.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const items: HeaderNavItem[] = [
|
|
22
|
+
* { id: 'home', label: 'Home', path: '/' },
|
|
23
|
+
* {
|
|
24
|
+
* id: 'people',
|
|
25
|
+
* label: 'People',
|
|
26
|
+
* children: [
|
|
27
|
+
* { id: 'employees', label: 'Employees', path: '/people/employees' },
|
|
28
|
+
* { id: 'vacancies', label: 'Vacancies', path: '/people/vacancies' },
|
|
29
|
+
* ],
|
|
30
|
+
* },
|
|
31
|
+
* ];
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export interface HeaderNavItem {
|
|
35
|
+
/** Unique key of the item within its level */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Visible label */
|
|
38
|
+
label: ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Leading icon — a kit icon name, or an element rendered as-is. A string is
|
|
41
|
+
* always read as an icon name; wrap anything else (an emoji, text) in an
|
|
42
|
+
* element. Shown in the mobile menu and before the label on desktop.
|
|
43
|
+
*/
|
|
44
|
+
icon?: keyof MapIconsType | ReactElement;
|
|
45
|
+
/**
|
|
46
|
+
* Route the item links to. Ignored on group items (those with `children`),
|
|
47
|
+
* which only open their submenu; a group is highlighted when any of its
|
|
48
|
+
* descendants matches the current location.
|
|
49
|
+
*/
|
|
50
|
+
path?: string;
|
|
51
|
+
/** Renders the item greyed out and not interactive */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/** Submenu items; makes this item a group */
|
|
54
|
+
children?: HeaderNavItem[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Props for the Header component.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <Header
|
|
62
|
+
* logo={<img src="/logo.svg" alt="Acme" />}
|
|
63
|
+
* items={items}
|
|
64
|
+
* rightSide={<UserProfile {...profile} />}
|
|
65
|
+
* />
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export interface HeaderProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
69
|
+
/**
|
|
70
|
+
* Project logo, placed in a box of fixed height. Leave it out and the box
|
|
71
|
+
* stays empty, so the layout does not shift between apps with and without
|
|
72
|
+
* a logo.
|
|
73
|
+
*/
|
|
74
|
+
logo?: ReactNode;
|
|
75
|
+
/** Navigation items. Rendered centred; scrolls sideways when it overflows. */
|
|
76
|
+
items?: HeaderNavItem[];
|
|
77
|
+
/**
|
|
78
|
+
* Right-hand content — user profile, notifications, log out, whatever the
|
|
79
|
+
* app needs. Rendered as-is on every screen size.
|
|
80
|
+
*/
|
|
81
|
+
rightSide?: ReactNode;
|
|
82
|
+
/**
|
|
83
|
+
* Color scheme of the bar and its menus. Named after the kit's other
|
|
84
|
+
* light/dark components (TreeView, CollapsibleNavBar) — not the Emotion
|
|
85
|
+
* theme.
|
|
86
|
+
* @default 'light'
|
|
87
|
+
*/
|
|
88
|
+
theme?: HeaderTheme;
|
|
89
|
+
/**
|
|
90
|
+
* Bar height and logo size
|
|
91
|
+
* @default 'small'
|
|
92
|
+
*/
|
|
93
|
+
size?: HeaderSize;
|
|
94
|
+
/**
|
|
95
|
+
* Accessible name of the navigation landmark
|
|
96
|
+
* @default 'Main'
|
|
97
|
+
*/
|
|
98
|
+
navLabel?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Accessible name of the burger button shown below 900px
|
|
101
|
+
* @default 'Open menu'
|
|
102
|
+
*/
|
|
103
|
+
menuButtonLabel?: string;
|
|
104
|
+
}
|
|
@@ -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
|
-
* -
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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>;
|
|
@@ -2,6 +2,8 @@ export { default as Button } from './Button';
|
|
|
2
2
|
export type * from './Button/types';
|
|
3
3
|
export * from './ButtonGroup';
|
|
4
4
|
export * from './IconButton';
|
|
5
|
+
export * from './FloatingActionButton';
|
|
6
|
+
export type * from './FloatingActionButton/types';
|
|
5
7
|
export * from './Breadcrumbs';
|
|
6
8
|
export { default as Checkbox } from './Checkbox';
|
|
7
9
|
export * from './Checkbox';
|
|
@@ -23,6 +25,8 @@ export { default as Radio } from './Radio';
|
|
|
23
25
|
export type { RadioProps } from './Radio/types';
|
|
24
26
|
export { default as RadioGroup } from './RadioGroup';
|
|
25
27
|
export type * from './RadioGroup/types';
|
|
28
|
+
export * from './ContextMenu';
|
|
29
|
+
export type * from './ContextMenu/types';
|
|
26
30
|
export { default as Dropdown } from './Dropdown';
|
|
27
31
|
export type * from './Dropdown/types';
|
|
28
32
|
export { default as DropdownArrow } from './DropdownArrow';
|
|
@@ -115,6 +119,8 @@ export type * from './ResponsiveImage/types';
|
|
|
115
119
|
export { default as NavBar } from './NavBar';
|
|
116
120
|
export * from './NavBar';
|
|
117
121
|
export * from './CollapsibleNavBar';
|
|
122
|
+
export * from './Header';
|
|
123
|
+
export type * from './Header/types';
|
|
118
124
|
export * from './TreeView';
|
|
119
125
|
export { default as Tab } from './Tab';
|
|
120
126
|
export { default as TabBar } from './TabBar';
|