@kenlo/kdls-design-system 2.0.3 → 2.5.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/components/Header/Header.d.ts +26 -0
- package/dist/components/Select/Select.d.ts +13 -1
- package/dist/components/Table/Table.d.ts +14 -0
- package/dist/index.cjs +3 -3
- package/dist/index.css +1 -1
- package/dist/index.js +2737 -2553
- package/foundations/tokens.css +14 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Header.css';
|
|
3
3
|
import type { KenloLogoProduct } from '../KenloLogo';
|
|
4
|
+
import { IconElement } from '../Icon/Icon';
|
|
4
5
|
import '../../foundations/Scrollbar/Scrollbar.css';
|
|
5
6
|
export interface HeaderNavItem {
|
|
6
7
|
label: string;
|
|
@@ -9,6 +10,7 @@ export interface HeaderNavItem {
|
|
|
9
10
|
children?: {
|
|
10
11
|
label: string;
|
|
11
12
|
href?: string;
|
|
13
|
+
onClick?: () => void;
|
|
12
14
|
}[];
|
|
13
15
|
onClick?: () => void;
|
|
14
16
|
}
|
|
@@ -19,6 +21,18 @@ export interface HeaderNotification {
|
|
|
19
21
|
time: string;
|
|
20
22
|
read?: boolean;
|
|
21
23
|
}
|
|
24
|
+
export interface HeaderProduct {
|
|
25
|
+
label: string;
|
|
26
|
+
icon?: IconElement;
|
|
27
|
+
href?: string;
|
|
28
|
+
active?: boolean;
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface HeaderProfileMenuItem {
|
|
32
|
+
label: string;
|
|
33
|
+
href?: string;
|
|
34
|
+
onClick?: () => void;
|
|
35
|
+
}
|
|
22
36
|
export interface HeaderProps {
|
|
23
37
|
/** Kenlo product that determines the logo */
|
|
24
38
|
product?: KenloLogoProduct;
|
|
@@ -29,6 +43,8 @@ export interface HeaderProps {
|
|
|
29
43
|
/** Notifications */
|
|
30
44
|
notifications?: HeaderNotification[];
|
|
31
45
|
onClearNotifications?: () => void;
|
|
46
|
+
/** Cross-product navigation list — the grid button only renders when there's more than 1 item (a single item means the product being viewed is the only destination) */
|
|
47
|
+
products?: HeaderProduct[];
|
|
32
48
|
/** User data */
|
|
33
49
|
user?: {
|
|
34
50
|
name: string;
|
|
@@ -39,9 +55,19 @@ export interface HeaderProps {
|
|
|
39
55
|
};
|
|
40
56
|
/** Slot for context selector (unit/site) */
|
|
41
57
|
contextSelector?: React.ReactNode;
|
|
58
|
+
/** Free slot on the right, before the avatar — e.g. a version badge */
|
|
59
|
+
rightSlot?: React.ReactNode;
|
|
60
|
+
/** Items shown in the profile menu (desktop dropdown + mobile menu), below the user info. Customizable per product — empty by default, nothing decorative is assumed. */
|
|
61
|
+
profileMenuItems?: HeaderProfileMenuItem[];
|
|
62
|
+
/** Logout action — renders as the last row (danger-styled) in both the desktop profile panel and the mobile menu. Hidden entirely when omitted. */
|
|
63
|
+
onLogout?: () => void;
|
|
64
|
+
/** Label for the logout row — default 'Sair' */
|
|
65
|
+
logoutLabel?: string;
|
|
42
66
|
/** FAQs callback */
|
|
43
67
|
onFAQs?: () => void;
|
|
44
68
|
showFAQs?: boolean;
|
|
69
|
+
/** Hides the notifications bell — use when the product has no notifications concept */
|
|
70
|
+
showNotifications?: boolean;
|
|
45
71
|
className?: string;
|
|
46
72
|
}
|
|
47
73
|
export declare const Header: React.FC<HeaderProps>;
|
|
@@ -112,6 +112,18 @@ export type SelectPillWithIcon = SelectBase & SelectWidthProps & SelectNoFormPro
|
|
|
112
112
|
label?: string;
|
|
113
113
|
iconLeft: IconElement;
|
|
114
114
|
};
|
|
115
|
-
|
|
115
|
+
/** trigger="nav" with label — iconLeft optional, no form props. Visually matches a Nav.Item / Menu navButton — use to build a dropdown that must blend into a Header or Nav row instead of looking like a form field. */
|
|
116
|
+
export type SelectNavWithLabel = SelectBase & SelectWidthProps & SelectNoFormProps & {
|
|
117
|
+
trigger: 'nav';
|
|
118
|
+
label: string;
|
|
119
|
+
iconLeft?: IconElement;
|
|
120
|
+
};
|
|
121
|
+
/** trigger="nav" with icon — label optional, no form props */
|
|
122
|
+
export type SelectNavWithIcon = SelectBase & SelectWidthProps & SelectNoFormProps & {
|
|
123
|
+
trigger: 'nav';
|
|
124
|
+
label?: string;
|
|
125
|
+
iconLeft: IconElement;
|
|
126
|
+
};
|
|
127
|
+
export type SelectProps = SelectInputProps | SelectPillWithLabel | SelectPillWithIcon | SelectNavWithLabel | SelectNavWithIcon;
|
|
116
128
|
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLDivElement>>;
|
|
117
129
|
export default Select;
|
|
@@ -19,6 +19,13 @@ export interface TableColumn<T = Record<string, unknown>> {
|
|
|
19
19
|
ellipsis?: boolean;
|
|
20
20
|
/** true = sortable, sorting done by the backend (the component only reports state via onSortChange, doesn't reorder `rows`) · function = sorts on the frontend using this comparator — handle dates and numbers inside it, don't let the component guess the type */
|
|
21
21
|
sortable?: boolean | ((a: T, b: T) => number);
|
|
22
|
+
/**
|
|
23
|
+
* Marks this column as a mobile-only action slot — has no effect above the mobile
|
|
24
|
+
* breakpoint. `'link'` pulls it out of the stack into a final row shared with any other
|
|
25
|
+
* `'link'` columns (one button: left-aligned; more than one: split evenly). `'icon'`
|
|
26
|
+
* (e.g. a chevron or a ••• menu) pins it to the row's top-right corner instead.
|
|
27
|
+
*/
|
|
28
|
+
mobileAction?: 'link' | 'icon';
|
|
22
29
|
/** Custom cell rendering — when omitted, displays row[key] directly */
|
|
23
30
|
render?: (value: unknown, row: T, index: number) => React.ReactNode;
|
|
24
31
|
}
|
|
@@ -31,6 +38,13 @@ export interface TableProps<T extends Record<string, unknown> = Record<string, u
|
|
|
31
38
|
columns: TableColumn<T>[];
|
|
32
39
|
/** Row data */
|
|
33
40
|
rows: T[];
|
|
41
|
+
/**
|
|
42
|
+
* Layout of the table. `'default'` is a flush list — rows have no radius, no gap
|
|
43
|
+
* between them, divided by a top border only. `'cardLines'` keeps each row as an
|
|
44
|
+
* individual card instead (own border, radius, gap, plus the container's own padding).
|
|
45
|
+
* Background, the theme's radius and the bordered stroke behave the same in both.
|
|
46
|
+
*/
|
|
47
|
+
variant?: 'default' | 'cardLines';
|
|
34
48
|
/**
|
|
35
49
|
* Shows a 1px neutral-20 border around the component. `false` by default.
|
|
36
50
|
* Use `true` when the surrounding background matches the Table's background (--color-neutral-00) —
|