@design-system-rte/core 0.20.0 → 0.21.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/CHANGELOG.md +21 -0
- package/components/card/card.constats.ts +9 -0
- package/components/card/card.interface.d.ts +10 -0
- package/components/card/card.stories.shared.ts +112 -0
- package/components/divider/divider.interface.d.ts +1 -1
- package/components/side-nav/nav-item/nav-item.interface.d.ts +20 -0
- package/components/side-nav/nav-item/nav-item.utils.ts +8 -0
- package/components/side-nav/nav-menu/nav-menu.interface.d.ts +7 -0
- package/components/side-nav/side-nav.constants.ts +16 -0
- package/components/side-nav/side-nav.interface.d.ts +34 -0
- package/components/tooltip/tooltip.constants.ts +3 -1
- package/components/tooltip/tooltip.interface.d.ts +1 -0
- package/components/tooltip/tooltip.utils.ts +5 -0
- package/design-tokens/tokens/_mixins.scss +9 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @design-system-rte/core
|
|
2
2
|
|
|
3
|
+
## 0.21.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f22d3ee: ## Changes
|
|
8
|
+
- (Docs) create subcomponent for pages
|
|
9
|
+
|
|
10
|
+
- 8bca3e1: ## Changes
|
|
11
|
+
- (Card) mutualize testing common logic
|
|
12
|
+
- (Card) add card component
|
|
13
|
+
|
|
14
|
+
- 4a444d4: ## Changes
|
|
15
|
+
- (Side Navigation) add Divider support for navItems & navMenus
|
|
16
|
+
- (Side Navigation) add Badge support
|
|
17
|
+
- (Side Navigation) add footer items
|
|
18
|
+
- (Side Navigation) add NavItem selection for SideNav
|
|
19
|
+
- (Tooltip) add customizable gap
|
|
20
|
+
- (Side Navigation) correct accesibility standards for ul and li items
|
|
21
|
+
- (Side Navigation) add Nested Menus to SideNav
|
|
22
|
+
- (Side Navigation) implement simple side nav from base side nav
|
|
23
|
+
|
|
3
24
|
## 0.20.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Size } from "../common/common-types";
|
|
2
|
+
|
|
3
|
+
import type { CardType } from "./card.interface";
|
|
4
|
+
|
|
5
|
+
export interface CardStoryArgTypes {
|
|
6
|
+
size: {
|
|
7
|
+
control: "select";
|
|
8
|
+
options: Size[];
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
cardType: {
|
|
12
|
+
control: "select";
|
|
13
|
+
options: CardType[];
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
clickable: {
|
|
17
|
+
control: "boolean";
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
disabled: {
|
|
21
|
+
control: "boolean";
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const cardStoryArgTypes: CardStoryArgTypes = {
|
|
27
|
+
size: {
|
|
28
|
+
control: "select",
|
|
29
|
+
options: ["xs", "s", "m", "l", "xl"],
|
|
30
|
+
description: "Size of the card",
|
|
31
|
+
},
|
|
32
|
+
cardType: {
|
|
33
|
+
control: "select",
|
|
34
|
+
options: ["default", "outlined"],
|
|
35
|
+
description: "Type of card styling",
|
|
36
|
+
},
|
|
37
|
+
clickable: {
|
|
38
|
+
control: "boolean",
|
|
39
|
+
description: "Whether the card is clickable",
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
control: "boolean",
|
|
43
|
+
description: "Whether the card is disabled",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export interface SizeExample {
|
|
48
|
+
size: Size;
|
|
49
|
+
label: string;
|
|
50
|
+
width: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const sizeExamples: SizeExample[] = [
|
|
54
|
+
{ size: "xs", label: "Extra Small (xs)", width: "240px width" },
|
|
55
|
+
{ size: "s", label: "Small (s)", width: "360px width" },
|
|
56
|
+
{ size: "m", label: "Medium (m)", width: "480px width" },
|
|
57
|
+
{ size: "l", label: "Large (l)", width: "600px width" },
|
|
58
|
+
{ size: "xl", label: "Extra Large (xl)", width: "720px width" },
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
export interface CardTypeExample {
|
|
62
|
+
cardType: CardType;
|
|
63
|
+
title: string;
|
|
64
|
+
description: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const cardTypeExamples: CardTypeExample[] = [
|
|
68
|
+
{
|
|
69
|
+
cardType: "default",
|
|
70
|
+
title: "Default Card",
|
|
71
|
+
description: "This card uses the default styling with elevation shadow.",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
cardType: "outlined",
|
|
75
|
+
title: "Outlined Card",
|
|
76
|
+
description: "This card uses outlined styling with a border instead of shadow.",
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
export interface DefaultStoryArgs {
|
|
81
|
+
size: Size;
|
|
82
|
+
cardType: CardType;
|
|
83
|
+
clickable: boolean;
|
|
84
|
+
disabled: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export const defaultStoryArgs: DefaultStoryArgs = {
|
|
88
|
+
size: "m",
|
|
89
|
+
cardType: "default",
|
|
90
|
+
clickable: false,
|
|
91
|
+
disabled: false,
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export interface ClickableStoryArgs extends DefaultStoryArgs {
|
|
95
|
+
clickable: true;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const clickableStoryArgs: ClickableStoryArgs = {
|
|
99
|
+
...defaultStoryArgs,
|
|
100
|
+
clickable: true,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export interface DisabledStoryArgs extends DefaultStoryArgs {
|
|
104
|
+
clickable: true;
|
|
105
|
+
disabled: true;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export const disabledStoryArgs: DisabledStoryArgs = {
|
|
109
|
+
...defaultStoryArgs,
|
|
110
|
+
clickable: true,
|
|
111
|
+
disabled: true,
|
|
112
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type DividerThickness = "light" | "medium" | "bold";
|
|
2
|
-
export type DividerAppearance = "default" | "inverse" | "brand";
|
|
2
|
+
export type DividerAppearance = "default" | "inverse" | "brand" | "brand-navigation";
|
|
3
3
|
export type DividerEndPoint = "square" | "round";
|
|
4
4
|
|
|
5
5
|
export interface DividerProps {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BadgeProps } from "../../badge/badge.interface";
|
|
2
|
+
import { SideNavAppearance } from "../side-nav.interface";
|
|
3
|
+
|
|
4
|
+
export interface NavItemProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
appearance?: SideNavAppearance;
|
|
7
|
+
label: string;
|
|
8
|
+
icon?: string;
|
|
9
|
+
showIcon?: boolean;
|
|
10
|
+
showBadge?: boolean;
|
|
11
|
+
collapsed?: boolean;
|
|
12
|
+
link?: string;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
items?: NavItemProps[];
|
|
15
|
+
active?: boolean;
|
|
16
|
+
isNested?: boolean;
|
|
17
|
+
parentMenuOpen?: boolean;
|
|
18
|
+
badge?: BadgeProps;
|
|
19
|
+
showDivider?: boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DividerAppearance } from "../divider/divider.interface";
|
|
2
|
+
|
|
3
|
+
import { SideNavAppearance, SideNavSize } from "./side-nav.interface";
|
|
4
|
+
|
|
5
|
+
export const sideNavCollapsedSize: number = 64;
|
|
6
|
+
|
|
7
|
+
export const sideNavPanelSize: Record<SideNavSize, number> = {
|
|
8
|
+
s: 224,
|
|
9
|
+
m: 320,
|
|
10
|
+
l: 504,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const dividerAppearanceBySideNavAppearance: Record<SideNavAppearance, DividerAppearance> = {
|
|
14
|
+
neutral: "default",
|
|
15
|
+
brand: "brand-navigation",
|
|
16
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { NavItemProps } from "./nav-item/nav-item.interface";
|
|
2
|
+
|
|
3
|
+
export type SideNavSize = "s" | "m" | "l";
|
|
4
|
+
|
|
5
|
+
export type SideNavAppearance = "neutral" | "brand";
|
|
6
|
+
|
|
7
|
+
export interface SideNavHeaderConfig {
|
|
8
|
+
icon?: string;
|
|
9
|
+
title: string;
|
|
10
|
+
version?: string;
|
|
11
|
+
identifier?: string;
|
|
12
|
+
link?: string | null;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface SideNavProps extends BaseSideNavProps {
|
|
18
|
+
collapsible?: boolean;
|
|
19
|
+
items: NavItemProps[];
|
|
20
|
+
footerItems?: NavItemProps[];
|
|
21
|
+
activeItem?: string;
|
|
22
|
+
headerConfig: SideNavHeaderConfig;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface BaseSideNavProps {
|
|
26
|
+
appearance?: SideNavAppearance;
|
|
27
|
+
size?: SideNavSize;
|
|
28
|
+
collapsed?: boolean;
|
|
29
|
+
showHeader?: boolean;
|
|
30
|
+
showFooter?: boolean;
|
|
31
|
+
showScrollbar?: boolean;
|
|
32
|
+
autoCollapse?: boolean;
|
|
33
|
+
scrollable?: boolean;
|
|
34
|
+
}
|
|
@@ -171,6 +171,15 @@
|
|
|
171
171
|
font-style: normal;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
@mixin typography-heading-xs {
|
|
175
|
+
@include typography-heading;
|
|
176
|
+
font-family: $heading-xs-semibold-font-family;
|
|
177
|
+
font-weight: $heading-xs-semibold-font-weight;
|
|
178
|
+
font-size: $heading-xs-semibold-font-size;
|
|
179
|
+
line-height: $heading-xs-semibold-line-height;
|
|
180
|
+
letter-spacing: $heading-xs-semibold-letter-spacing;
|
|
181
|
+
}
|
|
182
|
+
|
|
174
183
|
@mixin typography-heading-s {
|
|
175
184
|
@include typography-heading;
|
|
176
185
|
font-family: $heading-s-semibold-font-family;
|