@lumx/core 4.3.2-alpha.4 → 4.3.2-alpha.40

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.
Files changed (130) hide show
  1. package/js/components/Badge/BadgeWrapper.d.ts +13 -0
  2. package/js/components/Badge/BadgeWrapperStories.d.ts +29 -0
  3. package/js/components/Badge/BadgeWrapperTests.d.ts +9 -0
  4. package/js/components/Badge/Stories.d.ts +52 -0
  5. package/js/components/Badge/Tests.d.ts +12 -0
  6. package/js/components/Badge/index.d.ts +37 -0
  7. package/js/components/Button/Button.d.ts +48 -0
  8. package/js/components/Button/ButtonGroup.d.ts +36 -0
  9. package/js/components/Button/ButtonGroupStories.d.ts +37 -0
  10. package/js/components/Button/ButtonRoot.d.ts +55 -0
  11. package/js/components/Button/ButtonRootTests.d.ts +12 -0
  12. package/js/components/Button/IconButton.d.ts +45 -0
  13. package/js/components/Button/IconButtonStories.d.ts +212 -0
  14. package/js/components/Button/IconButtonTests.d.ts +15 -0
  15. package/js/components/Button/Stories.d.ts +302 -0
  16. package/js/components/Button/Tests.d.ts +15 -0
  17. package/js/components/Checkbox/Stories.d.ts +88 -0
  18. package/js/components/Checkbox/Tests.d.ts +15 -0
  19. package/js/components/Checkbox/index.d.ts +49 -0
  20. package/js/components/Divider/Stories.d.ts +21 -0
  21. package/js/components/Divider/Tests.d.ts +12 -0
  22. package/js/components/Divider/index.d.ts +27 -0
  23. package/js/components/Flag/Stories.d.ts +120 -0
  24. package/js/components/Flag/Tests.d.ts +14 -0
  25. package/js/components/Flag/index.d.ts +34 -0
  26. package/js/components/FlexBox/Stories.d.ts +108 -0
  27. package/js/components/FlexBox/Tests.d.ts +13 -0
  28. package/js/components/FlexBox/constants.d.ts +4 -0
  29. package/js/components/FlexBox/index.d.ts +50 -0
  30. package/js/components/FlexBox/types.d.ts +7 -0
  31. package/js/components/GridColumn/GridColumn.d.ts +48 -0
  32. package/js/components/GridColumn/GridColumnStories.d.ts +47 -0
  33. package/js/components/GridColumn/GridColumnTests.d.ts +12 -0
  34. package/js/components/Heading/Stories.d.ts +89 -0
  35. package/js/components/Heading/Tests.d.ts +11 -0
  36. package/js/components/Heading/constants.d.ts +21 -0
  37. package/js/components/Heading/index.d.ts +44 -0
  38. package/js/components/Heading/utils.d.ts +8 -0
  39. package/js/components/Icon/Stories.d.ts +150 -0
  40. package/js/components/Icon/Tests.d.ts +14 -0
  41. package/js/components/Icon/constants.d.ts +1 -0
  42. package/js/components/Icon/index.d.ts +41 -0
  43. package/js/components/InputHelper/Stories.d.ts +43 -0
  44. package/js/components/InputHelper/Tests.d.ts +12 -0
  45. package/js/components/InputHelper/constants.d.ts +3 -0
  46. package/js/components/InputHelper/index.d.ts +26 -0
  47. package/js/components/InputLabel/Stories.d.ts +34 -0
  48. package/js/components/InputLabel/Tests.d.ts +12 -0
  49. package/js/components/InputLabel/index.d.ts +25 -0
  50. package/js/components/Link/Stories.d.ts +93 -0
  51. package/js/components/Link/Tests.d.ts +15 -0
  52. package/js/components/Link/index.d.ts +54 -0
  53. package/js/components/Message/Stories.d.ts +119 -0
  54. package/js/components/Message/Tests.d.ts +14 -0
  55. package/js/components/Message/index.d.ts +75 -0
  56. package/js/components/ProgressCircular/Stories.d.ts +30 -0
  57. package/js/components/ProgressCircular/Tests.d.ts +11 -0
  58. package/js/components/ProgressCircular/index.d.ts +52 -0
  59. package/js/components/ProgressLinear/Stories.d.ts +11 -0
  60. package/js/components/ProgressLinear/Tests.d.ts +11 -0
  61. package/js/components/ProgressLinear/index.d.ts +27 -0
  62. package/js/components/RadioButton/Stories.d.ts +77 -0
  63. package/js/components/RadioButton/Tests.d.ts +15 -0
  64. package/js/components/RadioButton/index.d.ts +45 -0
  65. package/js/components/RawClickable/Tests.d.ts +14 -0
  66. package/js/components/RawClickable/index.d.ts +14 -0
  67. package/js/components/Skeleton/SkeletonCircle.d.ts +32 -0
  68. package/js/components/Skeleton/SkeletonCircleStories.d.ts +45 -0
  69. package/js/components/Skeleton/SkeletonCircleTests.d.ts +12 -0
  70. package/js/components/Skeleton/SkeletonRectangle.d.ts +47 -0
  71. package/js/components/Skeleton/SkeletonRectangleStories.d.ts +87 -0
  72. package/js/components/Skeleton/SkeletonRectangleTests.d.ts +13 -0
  73. package/js/components/Skeleton/SkeletonTypography.d.ts +37 -0
  74. package/js/components/Skeleton/SkeletonTypographyStories.d.ts +40 -0
  75. package/js/components/Skeleton/SkeletonTypographyTests.d.ts +13 -0
  76. package/js/components/Skeleton/index.d.ts +3 -0
  77. package/js/components/Switch/Stories.d.ts +94 -0
  78. package/js/components/Switch/Tests.d.ts +15 -0
  79. package/js/components/Switch/index.d.ts +47 -0
  80. package/js/components/Table/Stories.d.ts +25 -0
  81. package/js/components/Table/TableCell.d.ts +55 -0
  82. package/js/components/Table/TableCellStories.d.ts +44 -0
  83. package/js/components/Table/TableCellTests.d.ts +11 -0
  84. package/js/components/Table/TableRowStories.d.ts +23 -0
  85. package/js/components/Table/Tests.d.ts +11 -0
  86. package/js/components/Table/constants.d.ts +9 -0
  87. package/js/components/Table/index.d.ts +27 -0
  88. package/js/components/Text/Stories.d.ts +167 -0
  89. package/js/components/Text/Tests.d.ts +10 -0
  90. package/js/components/Text/index.d.ts +935 -0
  91. package/js/components/Thumbnail/Stories.d.ts +178 -0
  92. package/js/components/Thumbnail/Tests.d.ts +11 -0
  93. package/js/components/Thumbnail/index.d.ts +84 -0
  94. package/js/components/Thumbnail/types.d.ts +45 -0
  95. package/js/components/Thumbnail/utils.d.ts +79 -0
  96. package/js/components/Toolbar/Stories.d.ts +46 -0
  97. package/js/components/Toolbar/Tests.d.ts +12 -0
  98. package/js/components/Toolbar/index.d.ts +33 -0
  99. package/js/constants/enums/index.d.ts +9 -0
  100. package/js/constants/enums/index.js +10 -1
  101. package/js/constants/index.js +1 -1
  102. package/js/types/AriaAttributes.d.ts +29 -2
  103. package/js/types/PartialBy.d.ts +12 -0
  104. package/js/types/index.d.ts +2 -0
  105. package/js/types/jsx/PropsToOverride.d.ts +2 -0
  106. package/js/utils/classNames/bem/block.d.ts +3 -2
  107. package/js/utils/classNames/bem/element.d.ts +3 -2
  108. package/js/utils/classNames/bem/index.d.ts +5 -4
  109. package/package.json +31 -2
  110. package/stories/controls/color.d.ts +15 -0
  111. package/stories/controls/element.d.ts +16 -0
  112. package/stories/controls/focusPoint.d.ts +8 -0
  113. package/stories/controls/icons.d.ts +66 -0
  114. package/stories/controls/image.d.ts +96 -0
  115. package/stories/controls/selectArgType.d.ts +7 -0
  116. package/stories/controls/theme.d.ts +7 -0
  117. package/stories/controls/typography.d.ts +8 -0
  118. package/stories/controls/withUndefined.d.ts +1 -0
  119. package/stories/types.d.ts +43 -0
  120. package/stories/utils/combinations.d.ts +100 -0
  121. package/stories/utils/concatPath.d.ts +10 -0
  122. package/stories/utils/disableArgTypes.d.ts +7 -0
  123. package/stories/utils/initDemoShadowDOMPortal.d.ts +5 -0
  124. package/stories/utils/lorem.d.ts +7 -0
  125. package/stories/utils/toFlattenProps.d.ts +12 -0
  126. package/stories/utils/withCategory.d.ts +4 -0
  127. package/testing/commonTestsSuiteTL.d.ts +87 -0
  128. package/testing/index.d.ts +1 -0
  129. package/testing/queries.d.ts +4 -0
  130. package/js/utils/events/index.js +0 -2
@@ -0,0 +1,34 @@
1
+ import { ColorPalette } from '../../constants';
2
+ import type { LumxClassName, HasTheme, JSXElement, HasClassName, CommonRef } from '../../types';
3
+ import { TextProps } from '../Text';
4
+ export interface FlagProps extends HasClassName, HasTheme {
5
+ /** Color of the component. */
6
+ color?: ColorPalette;
7
+ /** Icon to use before the label. */
8
+ icon?: string;
9
+ /** Text label of the flag. */
10
+ children: JSXElement;
11
+ /** Enable text truncate on overflow */
12
+ truncate?: boolean;
13
+ /** ref to the root element */
14
+ ref?: CommonRef;
15
+ /** Text component to use for rendering the label */
16
+ Text: (props: TextProps) => any;
17
+ }
18
+ export declare const COMPONENT_NAME = "Flag";
19
+ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
20
+ export declare const DEFAULT_PROPS: Partial<FlagProps>;
21
+ export declare const block: {
22
+ (additionalClasses: import("classnames/types").ClassValue[]): string;
23
+ (modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
24
+ }, element: {
25
+ (elem: string, additionalClasses: import("classnames/types").ClassValue[]): string;
26
+ (elem: string, modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
27
+ };
28
+ /**
29
+ * Flag component.
30
+ *
31
+ * @param props Component props.
32
+ * @return JSX element.
33
+ */
34
+ export declare const Flag: (props: FlagProps) => import("react").JSX.Element;
@@ -0,0 +1,108 @@
1
+ import type { SetupStoriesOptions } from '@lumx/core/stories/types';
2
+ /**
3
+ * Setup FlexBox stories for a specific framework (React or Vue).
4
+ * This function creates all the stories with the appropriate decorators.
5
+ * Framework-specific render functions or args can be injected via `overrides`.
6
+ */
7
+ export declare function setup({ component, render, args, decorators: { withWrapper, withCombinations }, overrides, }: SetupStoriesOptions<{
8
+ overrides: 'NoShrink' | 'MarginAuto';
9
+ decorators: 'withCombinations' | 'withWrapper';
10
+ }>): {
11
+ meta: {
12
+ component: any;
13
+ render: any;
14
+ args: any;
15
+ argTypes: {
16
+ orientation: {
17
+ control: {
18
+ type: "select" | "inline-radio";
19
+ };
20
+ options: ("horizontal" | "vertical")[];
21
+ mapping: Record<string, "horizontal" | "vertical"> | undefined;
22
+ };
23
+ fillSpace: {
24
+ control: string;
25
+ };
26
+ wrap: {
27
+ control: string;
28
+ };
29
+ noShrink: {
30
+ control: string;
31
+ };
32
+ hAlign: {
33
+ control: {
34
+ type: "select" | "inline-radio";
35
+ };
36
+ options: ("bottom" | "center" | "space-around" | "space-between" | "space-evenly" | "top")[];
37
+ mapping: Record<string, "bottom" | "center" | "space-around" | "space-between" | "space-evenly" | "top"> | undefined;
38
+ };
39
+ vAlign: {
40
+ control: {
41
+ type: "select" | "inline-radio";
42
+ };
43
+ options: ("center" | "left" | "right" | "space-around" | "space-between" | "space-evenly")[];
44
+ mapping: Record<string, "center" | "left" | "right" | "space-around" | "space-between" | "space-evenly"> | undefined;
45
+ };
46
+ gap: {
47
+ control: {
48
+ type: "select" | "inline-radio";
49
+ };
50
+ options: ("tiny" | "regular" | "medium" | "big" | "huge")[];
51
+ mapping: Record<string, "tiny" | "regular" | "medium" | "big" | "huge"> | undefined;
52
+ };
53
+ };
54
+ };
55
+ /** Without config, FlexBox acts as a simple <div> */
56
+ NoConfig: {
57
+ decorators: ((story: any, context: any) => any)[];
58
+ };
59
+ /** Horizontal orientation with all possible item alignments */
60
+ Horizontal: {
61
+ args: {
62
+ orientation: "horizontal";
63
+ };
64
+ decorators: ((story: any, context: any) => any)[];
65
+ };
66
+ /** Vertical orientation with all possible item alignments */
67
+ Vertical: {
68
+ args: {
69
+ orientation: "vertical";
70
+ };
71
+ decorators: ((story: any, context: any) => any)[];
72
+ };
73
+ /** All gap sizes */
74
+ GapSizes: {
75
+ args: {
76
+ orientation: "horizontal";
77
+ };
78
+ argTypes: {
79
+ gap: {
80
+ control: boolean;
81
+ };
82
+ };
83
+ decorators: ((story: any, context: any) => any)[];
84
+ };
85
+ /** Wrap items in new row or column */
86
+ Wrap: {
87
+ args: {
88
+ orientation: "horizontal";
89
+ wrap: boolean;
90
+ };
91
+ argTypes: {
92
+ wrap: {
93
+ control: boolean;
94
+ };
95
+ };
96
+ decorators: ((story: any, context: any) => any)[];
97
+ };
98
+ /** Prevent FlexBox from shrinking into a parent flex box */
99
+ NoShrink: {
100
+ args: any;
101
+ decorators: ((story: any, context: any) => any)[];
102
+ };
103
+ /** All combinations of margin auto values */
104
+ MarginAuto: {
105
+ args: any;
106
+ decorators: ((story: any, context: any) => any)[];
107
+ };
108
+ };
@@ -0,0 +1,13 @@
1
+ import { SetupOptions } from '../../../testing';
2
+ import { FlexBoxProps } from '.';
3
+ type SetupProps = Partial<FlexBoxProps>;
4
+ /**
5
+ * Mounts the component and returns common DOM elements / data needed in multiple tests further down.
6
+ */
7
+ export declare const setup: (props: SetupProps | undefined, { render, ...options }: SetupOptions<FlexBoxProps>) => {
8
+ props: Partial<FlexBoxProps>;
9
+ flexBox: HTMLElement;
10
+ container: any;
11
+ };
12
+ declare const _default: (renderOptions: SetupOptions<FlexBoxProps>) => void;
13
+ export default _default;
@@ -0,0 +1,4 @@
1
+ export declare const GAP_SIZES: ("tiny" | "regular" | "medium" | "big" | "huge")[];
2
+ export declare const SPACE_ALIGNMENTS: ("space-around" | "space-between" | "space-evenly")[];
3
+ export declare const VERTICAL_ALIGNMENTS: ("bottom" | "center" | "space-around" | "space-between" | "space-evenly" | "top")[];
4
+ export declare const HORIZONTAL_ALIGNMENTS: ("center" | "left" | "right" | "space-around" | "space-between" | "space-evenly")[];
@@ -0,0 +1,50 @@
1
+ import { Orientation } from '../../constants';
2
+ import type { LumxClassName, JSXElement, HasClassName } from '../../types';
3
+ import type { FlexHorizontalAlignment, FlexVerticalAlignment, GapSize, MarginAutoAlignment } from './types';
4
+ export type * from './types';
5
+ /**
6
+ * Defines the props of the component.
7
+ */
8
+ export interface FlexBoxProps extends HasClassName {
9
+ /** Children elements. */
10
+ children?: JSXElement;
11
+ /** Whether the "content filling space" is enabled or not. */
12
+ fillSpace?: boolean;
13
+ /** Gap space between flexbox items. */
14
+ gap?: GapSize;
15
+ /** Flex horizontal alignment. */
16
+ hAlign?: FlexVerticalAlignment;
17
+ /** Whether the "auto margin" is enabled all around or not. */
18
+ marginAuto?: MarginAutoAlignment | MarginAutoAlignment[];
19
+ /** Whether the "content shrink" is disabled or not. */
20
+ noShrink?: boolean;
21
+ /** Flex direction. */
22
+ orientation?: Orientation;
23
+ /** Flex vertical alignment. */
24
+ vAlign?: FlexHorizontalAlignment;
25
+ /** Whether the "flex wrap" is enabled or not. */
26
+ wrap?: boolean;
27
+ }
28
+ /**
29
+ * Component display name.
30
+ */
31
+ export declare const COMPONENT_NAME = "FlexBox";
32
+ /**
33
+ * Component default class name and class prefix.
34
+ */
35
+ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
36
+ export declare const block: {
37
+ (additionalClasses: import("classnames/types").ClassValue[]): string;
38
+ (modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
39
+ };
40
+ /**
41
+ * Get FlexBox component props (className computation).
42
+ *
43
+ * @param props Component props.
44
+ * @return Computed props with className.
45
+ */
46
+ export declare function getFlexBoxProps(props: FlexBoxProps): {
47
+ className: string;
48
+ /** Children elements. */
49
+ children?: JSXElement;
50
+ };
@@ -0,0 +1,7 @@
1
+ import { Alignment, HorizontalAlignment, Size, VerticalAlignment } from '../../constants';
2
+ export type MarginAutoAlignment = Extract<Alignment, 'top' | 'bottom' | 'right' | 'left'>;
3
+ export type GapSize = Extract<Size, 'tiny' | 'regular' | 'medium' | 'big' | 'huge'>;
4
+ type SpaceAlignment = Extract<Alignment, 'space-between' | 'space-evenly' | 'space-around'>;
5
+ export type FlexVerticalAlignment = VerticalAlignment | SpaceAlignment;
6
+ export type FlexHorizontalAlignment = HorizontalAlignment | SpaceAlignment;
7
+ export {};
@@ -0,0 +1,48 @@
1
+ import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
2
+ import { Size } from '../../constants';
3
+ export type GridColumnGapSize = Extract<Size, 'tiny' | 'regular' | 'big' | 'huge'>;
4
+ /**
5
+ * Defines the props of the component.
6
+ */
7
+ export interface GridColumnProps extends HasClassName {
8
+ /** Customize the root element. */
9
+ as?: any;
10
+ /** Children elements. */
11
+ children?: JSXElement;
12
+ /** Space between columns and rows. */
13
+ gap?: GridColumnGapSize;
14
+ /** Ideal number of columns. */
15
+ maxColumns?: number;
16
+ /** Minimum width for each item, reduce the number of column if there is not enough space. */
17
+ itemMinWidth?: number;
18
+ /** Custom styles. */
19
+ style?: any;
20
+ /** reference to the root element */
21
+ ref?: CommonRef;
22
+ }
23
+ /**
24
+ * Component display name.
25
+ */
26
+ export declare const COMPONENT_NAME = "GridColumn";
27
+ /**
28
+ * Component default class name and class prefix.
29
+ */
30
+ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
31
+ /**
32
+ * Component default props.
33
+ */
34
+ export declare const DEFAULT_PROPS: Partial<GridColumnProps>;
35
+ /**
36
+ * The GridColumn is a layout component that can display children in a grid
37
+ * with custom display properties. It also comes with a responsive design,
38
+ * with a number of column that reduce when there is not enough space for each item.
39
+ *
40
+ * @param props Component props.
41
+ * @return JSX element.
42
+ */
43
+ export declare const GridColumn: {
44
+ (props: GridColumnProps): import("react").JSX.Element;
45
+ displayName: string;
46
+ className: "lumx-grid-column";
47
+ defaultProps: Partial<GridColumnProps>;
48
+ };
@@ -0,0 +1,47 @@
1
+ import type { SetupStoriesOptions } from '@lumx/core/stories/types';
2
+ export declare function setup({ component, render, }: SetupStoriesOptions<{
3
+ decorators?: never;
4
+ }>): {
5
+ meta: {
6
+ component: any;
7
+ render: any;
8
+ argTypes: {
9
+ nbItems: {
10
+ control: string;
11
+ };
12
+ gap: {
13
+ control: {
14
+ type: "select" | "inline-radio";
15
+ };
16
+ options: (import("./GridColumn").GridColumnGapSize | undefined)[];
17
+ mapping: Record<string, import("./GridColumn").GridColumnGapSize | undefined> | undefined;
18
+ };
19
+ itemMinWidth: {
20
+ control: string;
21
+ };
22
+ maxColumns: {
23
+ control: string;
24
+ };
25
+ };
26
+ args: {
27
+ nbItems: number;
28
+ as?: any;
29
+ children?: import("react").ReactNode;
30
+ gap?: import("./GridColumn").GridColumnGapSize | undefined;
31
+ maxColumns?: number | undefined;
32
+ itemMinWidth?: number | undefined;
33
+ style?: any;
34
+ ref?: import("../../types").CommonRef;
35
+ className?: string | undefined;
36
+ };
37
+ };
38
+ /** Default grid column displaying a single column */
39
+ Default: {};
40
+ /** Grid column with max 4 columns (responsive) */
41
+ Columns: {
42
+ args: {
43
+ maxColumns: number;
44
+ itemMinWidth: number;
45
+ };
46
+ };
47
+ };
@@ -0,0 +1,12 @@
1
+ import { SetupOptions } from '../../../testing';
2
+ /**
3
+ * Mounts the component and returns common DOM elements / data needed in multiple tests further down.
4
+ */
5
+ export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
6
+ props: any;
7
+ gridColumn: HTMLElement;
8
+ div: HTMLElement;
9
+ wrapper: Partial<import("../../../testing").SetupResult>;
10
+ };
11
+ declare const _default: (renderOptions: SetupOptions<any>) => void;
12
+ export default _default;
@@ -0,0 +1,89 @@
1
+ import type { SetupStoriesOptions } from '@lumx/core/stories/types';
2
+ /**
3
+ * Setup Heading stories for a specific framework (React or Vue).
4
+ * This function creates all the stories with the appropriate decorators.
5
+ * Framework-specific render functions or args can be injected via `overrides`.
6
+ */
7
+ export declare function setup({ component, render, decorators: { withCombinations }, overrides, }: SetupStoriesOptions<{
8
+ overrides: 'NestedHeadingLevelProvider';
9
+ decorators: 'withCombinations';
10
+ }>): {
11
+ meta: {
12
+ component: any;
13
+ render: any;
14
+ argTypes: {
15
+ as: {
16
+ control: {
17
+ type: "select" | "inline-radio";
18
+ };
19
+ options: import("../../types").HeadingElement[];
20
+ mapping: Record<string, import("../../types").HeadingElement> | undefined;
21
+ };
22
+ children: {
23
+ control: string;
24
+ };
25
+ typography: {
26
+ control: {
27
+ type: "select" | "inline-radio";
28
+ };
29
+ options: ("overline" | "caption" | "body1" | "body2" | "subtitle1" | "subtitle2" | "title" | "headline" | "display1" | "custom-title1" | "custom-title2" | "custom-title3" | "custom-title4" | "custom-title5" | "custom-title6" | "custom-intro" | "custom-body-large" | "custom-body" | "custom-quote" | "custom-publish-info" | "custom-button")[];
30
+ mapping: Record<string, "overline" | "caption" | "body1" | "body2" | "subtitle1" | "subtitle2" | "title" | "headline" | "display1" | "custom-title1" | "custom-title2" | "custom-title3" | "custom-title4" | "custom-title5" | "custom-title6" | "custom-intro" | "custom-body-large" | "custom-body" | "custom-quote" | "custom-publish-info" | "custom-button"> | undefined;
31
+ };
32
+ color: {
33
+ control: {
34
+ type: "select" | "inline-radio";
35
+ };
36
+ options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
37
+ mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
38
+ };
39
+ colorVariant: {
40
+ control: {
41
+ type: "select" | "inline-radio";
42
+ };
43
+ options: ("D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N")[];
44
+ mapping: Record<string, "D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N"> | undefined;
45
+ };
46
+ whiteSpace: {
47
+ control: {
48
+ type: "select" | "inline-radio";
49
+ };
50
+ options: string[];
51
+ mapping: Record<string, string> | undefined;
52
+ };
53
+ };
54
+ };
55
+ /** Default heading with text */
56
+ Default: {
57
+ args: {
58
+ children: string;
59
+ };
60
+ };
61
+ /** All supported heading elements */
62
+ AllLevels: {
63
+ args: {
64
+ children: string;
65
+ };
66
+ argTypes: {
67
+ as: {
68
+ control: boolean;
69
+ };
70
+ };
71
+ decorators: ((story: any, context: any) => any)[];
72
+ };
73
+ /** All typography */
74
+ AllTypography: {
75
+ args: {
76
+ children: string;
77
+ };
78
+ argTypes: {
79
+ typography: {
80
+ control: boolean;
81
+ };
82
+ };
83
+ decorators: ((story: any, context: any) => any)[];
84
+ };
85
+ /** Nest HeadingLevelProvider to increment heading levels */
86
+ NestedHeadingLevelProvider: {
87
+ [x: string]: any;
88
+ };
89
+ };
@@ -0,0 +1,11 @@
1
+ import { SetupOptions } from '../../../testing';
2
+ import { HeadingProps } from '.';
3
+ /**
4
+ * Mounts the component and returns common DOM elements / data needed in multiple tests further down.
5
+ */
6
+ export declare const setup: (propsOverride: Partial<HeadingProps> | undefined, { render, ...options }: SetupOptions<HeadingProps>) => {
7
+ heading: HTMLElement;
8
+ props: HeadingProps;
9
+ };
10
+ declare const _default: ({ render, screen, ...options }: SetupOptions<HeadingProps>) => void;
11
+ export default _default;
@@ -0,0 +1,21 @@
1
+ import { HeadingElement } from '../../types';
2
+ /** The maximum authorized heading level. */
3
+ export declare const MAX_HEADING_LEVEL = 6;
4
+ /**
5
+ * Typography to use by default depending on the heading level.
6
+ */
7
+ export declare const DEFAULT_TYPOGRAPHY_BY_LEVEL: {
8
+ h1: "display1";
9
+ h2: "headline";
10
+ h3: "title";
11
+ h4: "subtitle2";
12
+ h5: "subtitle1";
13
+ h6: "body2";
14
+ };
15
+ export interface HeadingLevelContext {
16
+ /** The current level */
17
+ level: number;
18
+ /** The heading element matching the current level */
19
+ headingElement: HeadingElement;
20
+ }
21
+ export declare const defaultContext: HeadingLevelContext;
@@ -0,0 +1,44 @@
1
+ import { HeadingElement, LumxClassName } from '../../types';
2
+ import { TextProps } from '../Text';
3
+ /**
4
+ * Defines the props of the component.
5
+ */
6
+ export interface HeadingProps extends Partial<TextProps> {
7
+ /**
8
+ * Display a specific heading level instead of the one provided by parent context provider.
9
+ */
10
+ as?: HeadingElement;
11
+ }
12
+ /**
13
+ * Component display name.
14
+ */
15
+ export declare const COMPONENT_NAME = "Heading";
16
+ /**
17
+ * Component default class name and class prefix.
18
+ */
19
+ export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
20
+ /**
21
+ * Component default props.
22
+ */
23
+ export declare const DEFAULT_PROPS: {};
24
+ /**
25
+ * Get Heading component common props
26
+ *
27
+ * @param props Component props.
28
+ * @param contextHeadingElement Heading element from context.
29
+ * @return Common Props
30
+ */
31
+ export declare const getHeadingProps: (props: HeadingProps, contextHeadingElement?: HeadingElement) => {
32
+ as: HeadingElement;
33
+ className: string;
34
+ typography: import("../../constants").Typography;
35
+ color?: import("../../constants").ColorWithVariants | undefined;
36
+ colorVariant?: import("../../constants").ColorVariant | undefined;
37
+ truncate?: boolean | {
38
+ lines: number;
39
+ } | undefined;
40
+ noWrap?: boolean | undefined;
41
+ whiteSpace?: import("../../constants").WhiteSpace | undefined;
42
+ children?: import("react").ReactNode;
43
+ style?: import("react").CSSProperties | undefined;
44
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Computes the next heading level based on the optional prop level or the parent context level.
3
+ *
4
+ * @param levelProp - The explicit level provided via props (optional).
5
+ * @param parentLevel - The level from the parent context.
6
+ * @returns The calculated heading level, clamped to the maximum allowed level.
7
+ */
8
+ export declare const computeHeadingLevel: (levelProp: number | undefined, parentLevel: number) => number;
@@ -0,0 +1,150 @@
1
+ import type { SetupStoriesOptions } from '@lumx/core/stories/types';
2
+ /**
3
+ * Setup Icon stories for a specific framework (React or Vue).
4
+ * This function creates all the stories with the appropriate decorators.
5
+ * Framework-specific render functions or args can be injected via `overrides`.
6
+ */
7
+ export declare function setup({ component, decorators: { withCombinations }, overrides, }: SetupStoriesOptions<{
8
+ overrides: 'SizeAndShape' | 'AllColors' | 'InsideText';
9
+ decorators: 'withCombinations';
10
+ }>): {
11
+ meta: {
12
+ component: any;
13
+ argTypes: {
14
+ icon: {
15
+ control: {
16
+ type: string;
17
+ };
18
+ options: {
19
+ undefined: undefined;
20
+ mdiAbTesting: string;
21
+ mdiAbjadArabic: string;
22
+ mdiAccount: string;
23
+ mdiAccountBox: string;
24
+ mdiAlert: string;
25
+ mdiAlertCircle: string;
26
+ mdiArrowDown: string;
27
+ mdiArrowUp: string;
28
+ mdiAtom: string;
29
+ mdiBee: string;
30
+ mdiBell: string;
31
+ mdiBullhornOutline: string;
32
+ mdiCheck: string;
33
+ mdiCheckCircle: string;
34
+ mdiChevronDown: string;
35
+ mdiChevronLeft: string;
36
+ mdiChevronRight: string;
37
+ mdiChevronUp: string;
38
+ mdiClose: string;
39
+ mdiCloseCircle: string;
40
+ mdiDelete: string;
41
+ mdiDotsHorizontal: string;
42
+ mdiDragVertical: string;
43
+ mdiEarth: string;
44
+ mdiEmail: string;
45
+ mdiEye: string;
46
+ mdiFileEdit: string;
47
+ mdiFlag: string;
48
+ mdiFolder: string;
49
+ mdiFolderGoogleDrive: string;
50
+ mdiFoodApple: string;
51
+ mdiGoogleCirclesExtended: string;
52
+ mdiHeart: string;
53
+ mdiHome: string;
54
+ mdiImageBroken: string;
55
+ mdiInformation: string;
56
+ mdiLink: string;
57
+ mdiMagnifyMinusOutline: string;
58
+ mdiMagnifyPlusOutline: string;
59
+ mdiMenuDown: string;
60
+ mdiMessageTextOutline: string;
61
+ mdiMinus: string;
62
+ mdiOpenInNew: string;
63
+ mdiPauseCircleOutline: string;
64
+ mdiPencil: string;
65
+ mdiPlay: string;
66
+ mdiPlayCircleOutline: string;
67
+ mdiPlus: string;
68
+ mdiRadioboxBlank: string;
69
+ mdiRadioboxMarked: string;
70
+ mdiReply: string;
71
+ mdiSend: string;
72
+ mdiStar: string;
73
+ mdiTextBox: string;
74
+ mdiTextBoxPlus: string;
75
+ mdiTram: string;
76
+ mdiTranslate: string;
77
+ mdiViewList: string;
78
+ };
79
+ };
80
+ hasShape: {
81
+ control: string;
82
+ };
83
+ size: {
84
+ control: {
85
+ type: "select" | "inline-radio";
86
+ };
87
+ options: ("xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl")[];
88
+ mapping: Record<string, "xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl"> | undefined;
89
+ };
90
+ color: {
91
+ control: {
92
+ type: "select" | "inline-radio";
93
+ };
94
+ options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
95
+ mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
96
+ };
97
+ colorVariant: {
98
+ control: {
99
+ type: "select" | "inline-radio";
100
+ };
101
+ options: ("D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N")[];
102
+ mapping: Record<string, "D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N"> | undefined;
103
+ };
104
+ };
105
+ };
106
+ /** All combinations of size and shape */
107
+ SizeAndShape: {
108
+ args: {
109
+ icon: string;
110
+ };
111
+ argTypes: {
112
+ hasShape: {
113
+ control: boolean;
114
+ };
115
+ size: {
116
+ control: boolean;
117
+ };
118
+ };
119
+ decorators: ((story: any, context: any) => any)[];
120
+ };
121
+ /** All combinations of color and color variants */
122
+ AllColors: {
123
+ args: {
124
+ size: "m";
125
+ icon: string;
126
+ };
127
+ argTypes: {
128
+ hasShape: {
129
+ control: boolean;
130
+ };
131
+ color: {
132
+ control: boolean;
133
+ };
134
+ colorVariant: {
135
+ control: boolean;
136
+ };
137
+ };
138
+ decorators: ((story: any, context: any) => any)[];
139
+ };
140
+ /** Icon inside a text component (renders as inline instead of block and can adapt to the verticalAlign) */
141
+ InsideText: {
142
+ args: any;
143
+ argTypes: {
144
+ verticalAlign: {
145
+ control: string;
146
+ options: (string | undefined)[];
147
+ };
148
+ };
149
+ };
150
+ };