@lumx/core 4.3.2-alpha.10 → 4.3.2-alpha.12

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 (123) 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 +211 -0
  14. package/js/components/Button/IconButtonTests.d.ts +15 -0
  15. package/js/components/Button/Stories.d.ts +301 -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/Heading/Stories.d.ts +89 -0
  32. package/js/components/Heading/Tests.d.ts +11 -0
  33. package/js/components/Heading/constants.d.ts +21 -0
  34. package/js/components/Heading/index.d.ts +44 -0
  35. package/js/components/Heading/utils.d.ts +8 -0
  36. package/js/components/Icon/Stories.d.ts +150 -0
  37. package/js/components/Icon/Tests.d.ts +14 -0
  38. package/js/components/Icon/constants.d.ts +1 -0
  39. package/js/components/Icon/index.d.ts +41 -0
  40. package/js/components/InputHelper/Stories.d.ts +43 -0
  41. package/js/components/InputHelper/Tests.d.ts +12 -0
  42. package/js/components/InputHelper/constants.d.ts +3 -0
  43. package/js/components/InputHelper/index.d.ts +26 -0
  44. package/js/components/InputLabel/Stories.d.ts +34 -0
  45. package/js/components/InputLabel/Tests.d.ts +12 -0
  46. package/js/components/InputLabel/index.d.ts +25 -0
  47. package/js/components/Link/Stories.d.ts +93 -0
  48. package/js/components/Link/Tests.d.ts +15 -0
  49. package/js/components/Link/index.d.ts +54 -0
  50. package/js/components/Message/Stories.d.ts +119 -0
  51. package/js/components/Message/Tests.d.ts +14 -0
  52. package/js/components/Message/index.d.ts +75 -0
  53. package/js/components/RadioButton/Stories.d.ts +77 -0
  54. package/js/components/RadioButton/Tests.d.ts +15 -0
  55. package/js/components/RadioButton/index.d.ts +45 -0
  56. package/js/components/RawClickable/Tests.d.ts +14 -0
  57. package/js/components/RawClickable/index.d.ts +13 -0
  58. package/js/components/Skeleton/SkeletonCircle.d.ts +32 -0
  59. package/js/components/Skeleton/SkeletonCircleStories.d.ts +45 -0
  60. package/js/components/Skeleton/SkeletonCircleTests.d.ts +12 -0
  61. package/js/components/Skeleton/SkeletonRectangle.d.ts +47 -0
  62. package/js/components/Skeleton/SkeletonRectangleStories.d.ts +87 -0
  63. package/js/components/Skeleton/SkeletonRectangleTests.d.ts +13 -0
  64. package/js/components/Skeleton/SkeletonTypography.d.ts +37 -0
  65. package/js/components/Skeleton/SkeletonTypographyStories.d.ts +40 -0
  66. package/js/components/Skeleton/SkeletonTypographyTests.d.ts +13 -0
  67. package/js/components/Skeleton/index.d.ts +3 -0
  68. package/js/components/Switch/Stories.d.ts +94 -0
  69. package/js/components/Switch/Tests.d.ts +15 -0
  70. package/js/components/Switch/index.d.ts +47 -0
  71. package/js/components/Table/Stories.d.ts +25 -0
  72. package/js/components/Table/TableCell.d.ts +55 -0
  73. package/js/components/Table/TableCellStories.d.ts +44 -0
  74. package/js/components/Table/TableCellTests.d.ts +11 -0
  75. package/js/components/Table/TableRowStories.d.ts +23 -0
  76. package/js/components/Table/Tests.d.ts +11 -0
  77. package/js/components/Table/constants.d.ts +9 -0
  78. package/js/components/Table/index.d.ts +27 -0
  79. package/js/components/Text/Stories.d.ts +167 -0
  80. package/js/components/Text/Tests.d.ts +10 -0
  81. package/js/components/Text/index.d.ts +935 -0
  82. package/js/components/Thumbnail/Stories.d.ts +168 -0
  83. package/js/components/Thumbnail/Tests.d.ts +11 -0
  84. package/js/components/Thumbnail/index.d.ts +84 -0
  85. package/js/components/Thumbnail/types.d.ts +45 -0
  86. package/js/components/Thumbnail/utils.d.ts +79 -0
  87. package/js/constants/enums/index.d.ts +0 -9
  88. package/js/constants/enums/index.js +1 -10
  89. package/js/constants/index.js +1 -1
  90. package/js/types/index.d.ts +0 -1
  91. package/js/utils/classNames/bem/block.d.ts +2 -3
  92. package/js/utils/classNames/bem/element.d.ts +2 -3
  93. package/js/utils/classNames/bem/index.d.ts +4 -5
  94. package/lumx.css +0 -94
  95. package/package.json +23 -2
  96. package/scss/_components.scss +0 -1
  97. package/scss/lumx.scss +0 -1
  98. package/stories/controls/color.d.ts +15 -0
  99. package/stories/controls/element.d.ts +16 -0
  100. package/stories/controls/focusPoint.d.ts +8 -0
  101. package/stories/controls/icons.d.ts +66 -0
  102. package/stories/controls/image.d.ts +96 -0
  103. package/stories/controls/selectArgType.d.ts +7 -0
  104. package/stories/controls/theme.d.ts +7 -0
  105. package/stories/controls/typography.d.ts +8 -0
  106. package/stories/controls/withUndefined.d.ts +1 -0
  107. package/stories/types.d.ts +47 -0
  108. package/stories/utils/combinations.d.ts +100 -0
  109. package/stories/utils/concatPath.d.ts +10 -0
  110. package/stories/utils/disableArgTypes.d.ts +7 -0
  111. package/stories/utils/initDemoShadowDOMPortal.d.ts +5 -0
  112. package/stories/utils/lorem.d.ts +7 -0
  113. package/stories/utils/toFlattenProps.d.ts +12 -0
  114. package/stories/utils/withCategory.d.ts +4 -0
  115. package/testing/commonTestsSuiteTL.d.ts +87 -0
  116. package/testing/index.d.ts +1 -0
  117. package/testing/queries.d.ts +4 -0
  118. package/js/types/PartialBy.d.ts +0 -12
  119. package/js/types/index.js +0 -1
  120. package/js/utils/disabledState/index.js +0 -12
  121. package/js/utils/events/index.js +0 -2
  122. package/scss/components/combobox/_index.scss +0 -86
  123. package/scss/components/combobox/_mixins.scss +0 -63
@@ -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: string[]): string;
23
+ (modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): string;
24
+ }, element: {
25
+ (elem: string, additionalClasses: string[]): string;
26
+ (elem: string, modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): 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: string[]): string;
38
+ (modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: string[]): 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,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
+ };
@@ -0,0 +1,14 @@
1
+ import { SetupOptions } from '../../../testing';
2
+ import { IconProps } from '.';
3
+ type SetupProps = Partial<IconProps>;
4
+ /**
5
+ * Mounts the component and returns common DOM elements / data needed in multiple tests further down.
6
+ */
7
+ export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<IconProps>) => {
8
+ i: HTMLElement;
9
+ svg: HTMLElement;
10
+ path: HTMLElement;
11
+ props: IconProps;
12
+ };
13
+ declare const _default: (renderOptions: SetupOptions<IconProps>) => void;
14
+ export default _default;
@@ -0,0 +1 @@
1
+ export declare const ICON_SIZES: ("xxs" | "xs" | "s" | "m" | "l" | "xl" | "xxl")[];
@@ -0,0 +1,41 @@
1
+ import { ColorWithVariants, ColorVariant } from '../../constants';
2
+ import type { LumxClassName, HasTheme, HasClassName, CommonRef } from '../../types';
3
+ import { ICON_SIZES } from './constants';
4
+ export declare const COMPONENT_NAME = "Icon";
5
+ export declare const IconClassName: LumxClassName<typeof COMPONENT_NAME>;
6
+ export type IconSizes = (typeof ICON_SIZES)[number];
7
+ /**
8
+ * Defines the props of the component.
9
+ */
10
+ export interface IconProps extends HasClassName, HasTheme {
11
+ /** Color variant. */
12
+ color?: ColorWithVariants;
13
+ /** Lightened or darkened variant of the selected icon color. */
14
+ colorVariant?: ColorVariant;
15
+ /** Whether the icon has a shape. */
16
+ hasShape?: boolean;
17
+ /**
18
+ * Icon (SVG path) draw code (`d` property of the `<path>` SVG element).
19
+ * See https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths
20
+ */
21
+ icon: string;
22
+ /** Size variant. */
23
+ size?: IconSizes;
24
+ /** Sets an alternative text on the svg. Will set an `img` role to the svg. */
25
+ alt?: string;
26
+ /** Vertical alignment of the icon (only applies for icons nested in Text/Heading). */
27
+ verticalAlign?: null | 'middle';
28
+ /** reference to the root element */
29
+ ref?: CommonRef;
30
+ }
31
+ /**
32
+ * Icon component.
33
+ *
34
+ * @param props Component props.
35
+ */
36
+ export declare const Icon: {
37
+ (props: IconProps): import("react").JSX.Element;
38
+ displayName: string;
39
+ className: "lumx-icon";
40
+ defaultProps: Partial<IconProps>;
41
+ };
@@ -0,0 +1,43 @@
1
+ import { Kind } from '@lumx/core/js/constants';
2
+ import type { SetupStoriesOptions } from '@lumx/core/stories/types';
3
+ /**
4
+ * Setup InputHelper stories for a specific framework (React or Vue).
5
+ * This function creates all the stories with the appropriate decorators.
6
+ * Framework-specific render functions or args can be injected via `overrides`.
7
+ */
8
+ export declare function setup({ component, render, decorators: { withCombinations }, }: SetupStoriesOptions<{
9
+ decorators: 'withCombinations';
10
+ }>): {
11
+ meta: {
12
+ component: any;
13
+ render: any;
14
+ argTypes: {
15
+ kind: {
16
+ control: {
17
+ type: "select" | "inline-radio";
18
+ };
19
+ options: ("info" | "success" | "warning" | "error")[];
20
+ mapping: Record<string, "info" | "success" | "warning" | "error"> | undefined;
21
+ };
22
+ };
23
+ args: {
24
+ children: string;
25
+ kind?: Kind | undefined;
26
+ ref?: import("../../types").CommonRef;
27
+ id?: string | undefined;
28
+ className?: string | undefined;
29
+ theme?: import("@lumx/core/js/constants").Theme | undefined;
30
+ };
31
+ };
32
+ /** Default input helper */
33
+ Default: {};
34
+ /** All `kind` variants */
35
+ AllKinds: {
36
+ argTypes: {
37
+ kind: {
38
+ control: boolean;
39
+ };
40
+ };
41
+ decorators: ((story: any, context: any) => any)[];
42
+ };
43
+ };
@@ -0,0 +1,12 @@
1
+ import { SetupOptions } from '../../../testing';
2
+ import { InputHelperProps } from '.';
3
+ type SetupProps = Partial<InputHelperProps>;
4
+ /**
5
+ * Mounts the component and returns common DOM elements / data needed in multiple tests further down.
6
+ */
7
+ export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<InputHelperProps>) => {
8
+ helper: HTMLElement;
9
+ props: InputHelperProps;
10
+ };
11
+ declare const _default: (renderOptions: SetupOptions<InputHelperProps>) => void;
12
+ export default _default;