@kenlo/kdls-design-system 2.0.2 → 2.0.5

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/README.md CHANGED
@@ -24,4 +24,4 @@ Os tokens ficam em `foundations/tokens.css` como CSS custom properties (`var(--s
24
24
 
25
25
  ## Status
26
26
 
27
- Em construção — ainda não publicado no npm.
27
+ Publicado no npm como [`@kenlo/kdls-design-system`](https://www.npmjs.com/package/@kenlo/kdls-design-system).
@@ -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
- export type SelectProps = SelectInputProps | SelectPillWithLabel | SelectPillWithIcon;
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;
@@ -0,0 +1,11 @@
1
+ export type ColorScheme = 'primary' | 'neutral' | 'secondary' | 'tertiary' | 'lya' | 'leaf' | 'sand' | 'wood' | 'clay' | 'flower' | 'dusk' | 'sky' | 'sea' | 'lake';
2
+ export type RadiusScheme = 'default' | 'soft' | 'flat' | 'rounded';
3
+ export type FontScheme = 'manrope' | 'inter' | 'helvetica' | 'source-sans' | 'nunito' | 'montserrat';
4
+ export type ThemeMode = 'light' | 'dark' | 'system';
5
+ export interface KdlsConfig {
6
+ theme?: ThemeMode;
7
+ colorScheme?: ColorScheme;
8
+ radius?: RadiusScheme;
9
+ font?: FontScheme;
10
+ }
11
+ export declare function configureKdls(config: KdlsConfig, root?: HTMLElement): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Theme';
@@ -1,5 +1,6 @@
1
1
  import '../foundations/tokens.css';
2
2
  export * from './ColorScheme';
3
+ export * from './Theme';
3
4
  export * from './Form';
4
5
  export * from './Accordion';
5
6
  export * from './AccordionGroup';