@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 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,9 @@
1
+ import { Size } from "../common/common-types";
2
+
3
+ export const cardSize: Record<Size, number> = {
4
+ xs: 240,
5
+ s: 360,
6
+ m: 480,
7
+ l: 600,
8
+ xl: 720,
9
+ };
@@ -0,0 +1,10 @@
1
+ import { Size } from "../common/common-types";
2
+
3
+ export type CardType = "default" | "outlined";
4
+
5
+ export interface CardProps {
6
+ size?: Size;
7
+ cardType?: CardType;
8
+ clickable?: boolean;
9
+ disabled?: boolean;
10
+ }
@@ -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,8 @@
1
+ import { IconSize } from "../../icon/icon.constants";
2
+
3
+ export function getNavItemLabelIconSize(isNested = false, collapsed = false): number {
4
+ if (isNested) {
5
+ return IconSize.s;
6
+ }
7
+ return collapsed ? IconSize.l : IconSize.m;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { NavItemProps } from "../nav-item/nav-item.interface";
2
+
3
+ export interface NavMenuProps extends NavItemProps {
4
+ items: NavItemProps[];
5
+ open?: boolean;
6
+ showMenuIcon?: boolean;
7
+ }
@@ -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
+ }
@@ -1,2 +1,4 @@
1
1
  export const TOOLTIP_GAP = 4;
2
- export const TOOLTIP_GAP_ARROW = 9;
2
+ export const TOOLTIP_GAP_ARROW = 5;
3
+ export const TOOLTIP_FADE_OUT_DURATION = 200;
4
+ export const TOOLTIP_ANIMATION_DURATION = 150;
@@ -3,4 +3,5 @@ export interface TooltipProps {
3
3
  alignment?: import("../../common-types").Alignment;
4
4
  label?: string;
5
5
  arrow?: boolean;
6
+ gap?: number;
6
7
  }
@@ -0,0 +1,5 @@
1
+ import { TOOLTIP_GAP, TOOLTIP_GAP_ARROW } from "./tooltip.constants";
2
+
3
+ export function getTooltipGap(arrow: boolean, customGap: number = TOOLTIP_GAP): number {
4
+ return arrow ? TOOLTIP_GAP_ARROW + customGap : customGap;
5
+ }
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-system-rte/core",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "lint": "eslint .",