@ssa-ui-kit/core 3.24.1 → 3.25.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.
- package/dist/ai/source-map.md +77 -43
- 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 +18 -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 +63 -0
- package/dist/components/Header/types.d.ts +104 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/index.js +3110 -2091
- package/dist/index.mjs +3111 -2094
- 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
|
+
}
|
|
@@ -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';
|
|
@@ -115,6 +117,8 @@ export type * from './ResponsiveImage/types';
|
|
|
115
117
|
export { default as NavBar } from './NavBar';
|
|
116
118
|
export * from './NavBar';
|
|
117
119
|
export * from './CollapsibleNavBar';
|
|
120
|
+
export * from './Header';
|
|
121
|
+
export type * from './Header/types';
|
|
118
122
|
export * from './TreeView';
|
|
119
123
|
export { default as Tab } from './Tab';
|
|
120
124
|
export { default as TabBar } from './TabBar';
|