@lumx/core 4.3.2-alpha.17 → 4.3.2-alpha.18
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/js/constants/enums/index.d.ts +9 -0
- package/js/constants/enums/index.js +10 -1
- package/js/constants/index.js +1 -1
- package/js/types/PartialBy.d.ts +12 -0
- package/js/types/index.d.ts +1 -0
- package/js/utils/classNames/bem/block.d.ts +3 -2
- package/js/utils/classNames/bem/element.d.ts +3 -2
- package/js/utils/classNames/bem/index.d.ts +5 -4
- package/js/utils/events/index.js +2 -0
- package/package.json +2 -28
- package/js/components/Badge/BadgeWrapper.d.ts +0 -13
- package/js/components/Badge/BadgeWrapperStories.d.ts +0 -29
- package/js/components/Badge/BadgeWrapperTests.d.ts +0 -9
- package/js/components/Badge/Stories.d.ts +0 -52
- package/js/components/Badge/Tests.d.ts +0 -12
- package/js/components/Badge/index.d.ts +0 -37
- package/js/components/Button/Button.d.ts +0 -48
- package/js/components/Button/ButtonGroup.d.ts +0 -36
- package/js/components/Button/ButtonGroupStories.d.ts +0 -37
- package/js/components/Button/ButtonRoot.d.ts +0 -55
- package/js/components/Button/ButtonRootTests.d.ts +0 -12
- package/js/components/Button/IconButton.d.ts +0 -45
- package/js/components/Button/IconButtonStories.d.ts +0 -211
- package/js/components/Button/IconButtonTests.d.ts +0 -15
- package/js/components/Button/Stories.d.ts +0 -301
- package/js/components/Button/Tests.d.ts +0 -15
- package/js/components/Checkbox/Stories.d.ts +0 -88
- package/js/components/Checkbox/Tests.d.ts +0 -15
- package/js/components/Checkbox/index.d.ts +0 -49
- package/js/components/Divider/Stories.d.ts +0 -21
- package/js/components/Divider/Tests.d.ts +0 -12
- package/js/components/Divider/index.d.ts +0 -27
- package/js/components/Flag/Stories.d.ts +0 -120
- package/js/components/Flag/Tests.d.ts +0 -14
- package/js/components/Flag/index.d.ts +0 -34
- package/js/components/FlexBox/Stories.d.ts +0 -108
- package/js/components/FlexBox/Tests.d.ts +0 -13
- package/js/components/FlexBox/constants.d.ts +0 -4
- package/js/components/FlexBox/index.d.ts +0 -50
- package/js/components/FlexBox/types.d.ts +0 -7
- package/js/components/Heading/Stories.d.ts +0 -89
- package/js/components/Heading/Tests.d.ts +0 -11
- package/js/components/Heading/constants.d.ts +0 -21
- package/js/components/Heading/index.d.ts +0 -44
- package/js/components/Heading/utils.d.ts +0 -8
- package/js/components/Icon/Stories.d.ts +0 -150
- package/js/components/Icon/Tests.d.ts +0 -14
- package/js/components/Icon/constants.d.ts +0 -1
- package/js/components/Icon/index.d.ts +0 -41
- package/js/components/InputHelper/Stories.d.ts +0 -43
- package/js/components/InputHelper/Tests.d.ts +0 -12
- package/js/components/InputHelper/constants.d.ts +0 -3
- package/js/components/InputHelper/index.d.ts +0 -26
- package/js/components/InputLabel/Stories.d.ts +0 -34
- package/js/components/InputLabel/Tests.d.ts +0 -12
- package/js/components/InputLabel/index.d.ts +0 -25
- package/js/components/Link/Stories.d.ts +0 -93
- package/js/components/Link/Tests.d.ts +0 -15
- package/js/components/Link/index.d.ts +0 -54
- package/js/components/Message/Stories.d.ts +0 -119
- package/js/components/Message/Tests.d.ts +0 -14
- package/js/components/Message/index.d.ts +0 -75
- package/js/components/RadioButton/Stories.d.ts +0 -77
- package/js/components/RadioButton/Tests.d.ts +0 -15
- package/js/components/RadioButton/index.d.ts +0 -45
- package/js/components/RawClickable/Tests.d.ts +0 -14
- package/js/components/RawClickable/index.d.ts +0 -13
- package/js/components/Skeleton/SkeletonCircle.d.ts +0 -32
- package/js/components/Skeleton/SkeletonCircleStories.d.ts +0 -45
- package/js/components/Skeleton/SkeletonCircleTests.d.ts +0 -12
- package/js/components/Skeleton/SkeletonRectangle.d.ts +0 -47
- package/js/components/Skeleton/SkeletonRectangleStories.d.ts +0 -87
- package/js/components/Skeleton/SkeletonRectangleTests.d.ts +0 -13
- package/js/components/Skeleton/SkeletonTypography.d.ts +0 -37
- package/js/components/Skeleton/SkeletonTypographyStories.d.ts +0 -40
- package/js/components/Skeleton/SkeletonTypographyTests.d.ts +0 -13
- package/js/components/Skeleton/index.d.ts +0 -3
- package/js/components/Switch/Stories.d.ts +0 -94
- package/js/components/Switch/Tests.d.ts +0 -15
- package/js/components/Switch/index.d.ts +0 -47
- package/js/components/Table/Stories.d.ts +0 -25
- package/js/components/Table/TableCell.d.ts +0 -55
- package/js/components/Table/TableCellStories.d.ts +0 -44
- package/js/components/Table/TableCellTests.d.ts +0 -11
- package/js/components/Table/TableRowStories.d.ts +0 -23
- package/js/components/Table/Tests.d.ts +0 -11
- package/js/components/Table/constants.d.ts +0 -9
- package/js/components/Table/index.d.ts +0 -27
- package/js/components/Text/Stories.d.ts +0 -167
- package/js/components/Text/Tests.d.ts +0 -10
- package/js/components/Text/index.d.ts +0 -935
- package/js/components/Thumbnail/Stories.d.ts +0 -168
- package/js/components/Thumbnail/Tests.d.ts +0 -11
- package/js/components/Thumbnail/index.d.ts +0 -84
- package/js/components/Thumbnail/types.d.ts +0 -45
- package/js/components/Thumbnail/utils.d.ts +0 -79
- package/stories/controls/color.d.ts +0 -15
- package/stories/controls/element.d.ts +0 -16
- package/stories/controls/focusPoint.d.ts +0 -8
- package/stories/controls/icons.d.ts +0 -66
- package/stories/controls/image.d.ts +0 -96
- package/stories/controls/selectArgType.d.ts +0 -7
- package/stories/controls/theme.d.ts +0 -7
- package/stories/controls/typography.d.ts +0 -8
- package/stories/controls/withUndefined.d.ts +0 -1
- package/stories/types.d.ts +0 -47
- package/stories/utils/combinations.d.ts +0 -100
- package/stories/utils/concatPath.d.ts +0 -10
- package/stories/utils/disableArgTypes.d.ts +0 -7
- package/stories/utils/initDemoShadowDOMPortal.d.ts +0 -5
- package/stories/utils/lorem.d.ts +0 -7
- package/stories/utils/toFlattenProps.d.ts +0 -12
- package/stories/utils/withCategory.d.ts +0 -4
- package/testing/commonTestsSuiteTL.d.ts +0 -87
- package/testing/index.d.ts +0 -1
- package/testing/queries.d.ts +0 -4
|
@@ -198,3 +198,12 @@ export declare const ColorVariant: {
|
|
|
198
198
|
export type ColorVariant = ValueOf<typeof ColorVariant>;
|
|
199
199
|
/** ColorPalette with all possible color variant combination */
|
|
200
200
|
export type ColorWithVariants = ColorPalette | Exclude<`${ColorPalette}-${ColorVariant}`, `light-D${number}` | `dark-D${number}`>;
|
|
201
|
+
export declare const REAL_SIZE_FOR_LUMX_SIZE: {
|
|
202
|
+
xxs: number;
|
|
203
|
+
xs: number;
|
|
204
|
+
s: number;
|
|
205
|
+
m: number;
|
|
206
|
+
l: number;
|
|
207
|
+
xl: number;
|
|
208
|
+
xxl: number;
|
|
209
|
+
};
|
|
@@ -151,5 +151,14 @@ const ColorVariant = {
|
|
|
151
151
|
L6: 'L6',
|
|
152
152
|
N: 'N',
|
|
153
153
|
};
|
|
154
|
+
const REAL_SIZE_FOR_LUMX_SIZE = {
|
|
155
|
+
[Size.xxs]: 14,
|
|
156
|
+
[Size.xs]: 20,
|
|
157
|
+
[Size.s]: 24,
|
|
158
|
+
[Size.m]: 36,
|
|
159
|
+
[Size.l]: 64,
|
|
160
|
+
[Size.xl]: 128,
|
|
161
|
+
[Size.xxl]: 256,
|
|
162
|
+
};
|
|
154
163
|
|
|
155
|
-
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
|
|
164
|
+
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
|
package/js/constants/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { BACKSPACE_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESCAPE_KEY_CODE, LEFT_KEY_CODE, RIGHT_KEY_CODE, SPACE_KEY_CODE, TAB_KEY_CODE, UP_KEY_CODE } from './keycodes/index.js';
|
|
2
2
|
export { DIALOG_TRANSITION_DURATION, EXPANSION_PANEL_TRANSITION_DURATION, NOTIFICATION_TRANSITION_DURATION, SLIDESHOW_TRANSITION_DURATION, TOOLTIP_HOVER_DELAY, TOOLTIP_LONG_PRESS_DELAY } from './components/index.js';
|
|
3
|
-
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
|
|
3
|
+
export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
|
|
4
4
|
export { VISUALLY_HIDDEN } from './className/index.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same as `Partial` but for one property only.
|
|
3
|
+
*
|
|
4
|
+
* @example PartialBy<Foo, 'bar'> => produces a type almost identical to `Foo` but with the `bar` property as optional.
|
|
5
|
+
*/
|
|
6
|
+
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
7
|
+
/**
|
|
8
|
+
* Same as `Partial` but for all except some properties only.
|
|
9
|
+
*
|
|
10
|
+
* @example PartialExcept<Foo, 'bar'> => produces a type almost identical to `Foo` but with the `bar` property as it is on the original type.
|
|
11
|
+
*/
|
|
12
|
+
export type PartialExcept<T, K extends keyof T> = Pick<T, K> & Partial<Omit<T, K>>;
|
package/js/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassValue } from 'classnames/types';
|
|
1
2
|
import { type Modifier } from './modifier';
|
|
2
3
|
/**
|
|
3
4
|
* Generates a BEM block + modifier class name string.
|
|
@@ -11,5 +12,5 @@ import { type Modifier } from './modifier';
|
|
|
11
12
|
* block('button'); // 'button'
|
|
12
13
|
* block('button', { active: true, disabled: false }); // 'button button--active'
|
|
13
14
|
*/
|
|
14
|
-
export declare function block(baseName: string, additionalClasses:
|
|
15
|
-
export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?:
|
|
15
|
+
export declare function block(baseName: string, additionalClasses: ClassValue[]): string;
|
|
16
|
+
export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassValue } from 'classnames/types';
|
|
1
2
|
import type { Modifier } from './modifier';
|
|
2
3
|
/**
|
|
3
4
|
* Creates a BEM element class generator function for the given base class.
|
|
@@ -12,5 +13,5 @@ import type { Modifier } from './modifier';
|
|
|
12
13
|
* element('my-button', 'icon'); // 'my-button__icon'
|
|
13
14
|
* element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
|
|
14
15
|
*/
|
|
15
|
-
export declare function element(baseClass: string, elem: string, additionalClasses:
|
|
16
|
-
export declare function element(baseClass: string, elem: string, modifiers?: Modifier, additionalClasses?:
|
|
16
|
+
export declare function element(baseClass: string, elem: string, additionalClasses: ClassValue[]): string;
|
|
17
|
+
export declare function element(baseClass: string, elem: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassValue } from 'classnames/types';
|
|
1
2
|
import { block } from './block';
|
|
2
3
|
import { element } from './element';
|
|
3
4
|
import { type Modifier } from './modifier';
|
|
@@ -6,12 +7,12 @@ import { type Modifier } from './modifier';
|
|
|
6
7
|
*/
|
|
7
8
|
export declare function bem(baseName: string): {
|
|
8
9
|
block: {
|
|
9
|
-
(additionalClasses:
|
|
10
|
-
(modifiers?: Modifier, additionalClasses?:
|
|
10
|
+
(additionalClasses: ClassValue[]): string;
|
|
11
|
+
(modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
11
12
|
};
|
|
12
13
|
element: {
|
|
13
|
-
(elem: string, additionalClasses:
|
|
14
|
-
(elem: string, modifiers?: Modifier, additionalClasses?:
|
|
14
|
+
(elem: string, additionalClasses: ClassValue[]): string;
|
|
15
|
+
(elem: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
|
|
15
16
|
};
|
|
16
17
|
modifier: (modifiers: Modifier) => string;
|
|
17
18
|
};
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/icons": "^4.3.2-alpha.
|
|
9
|
+
"@lumx/icons": "^4.3.2-alpha.18",
|
|
10
10
|
"classnames": "^2.3.2",
|
|
11
11
|
"focus-visible": "^5.0.2",
|
|
12
12
|
"lodash": "4.17.23",
|
|
@@ -22,32 +22,6 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"type": "module",
|
|
24
24
|
"name": "@lumx/core",
|
|
25
|
-
"exports": {
|
|
26
|
-
"./js/constants": {
|
|
27
|
-
"default": "./js/constants/index.js",
|
|
28
|
-
"types": "./js/constants/index.d.ts"
|
|
29
|
-
},
|
|
30
|
-
"./js/types": {
|
|
31
|
-
"default": "./js/types/index.js",
|
|
32
|
-
"types": "./js/types/index.d.ts"
|
|
33
|
-
},
|
|
34
|
-
"./js/utils/classNames": {
|
|
35
|
-
"default": "./js/utils/classNames/index.js",
|
|
36
|
-
"types": "./js/utils/classNames/index.d.ts"
|
|
37
|
-
},
|
|
38
|
-
"./js/utils/disabledState": {
|
|
39
|
-
"default": "./js/utils/disabledState/index.js",
|
|
40
|
-
"types": "./js/utils/disabledState/index.d.ts"
|
|
41
|
-
},
|
|
42
|
-
"./js/utils/selectors": {
|
|
43
|
-
"default": "./js/utils/selectors/index.js",
|
|
44
|
-
"types": "./js/utils/selectors/index.d.ts"
|
|
45
|
-
},
|
|
46
|
-
"./js/utils": {
|
|
47
|
-
"default": "./js/utils/index.js",
|
|
48
|
-
"types": "./js/utils/index.d.ts"
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
25
|
"publishConfig": {
|
|
52
26
|
"directory": "dist"
|
|
53
27
|
},
|
|
@@ -63,7 +37,7 @@
|
|
|
63
37
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
64
38
|
},
|
|
65
39
|
"sideEffects": false,
|
|
66
|
-
"version": "4.3.2-alpha.
|
|
40
|
+
"version": "4.3.2-alpha.18",
|
|
67
41
|
"devDependencies": {
|
|
68
42
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
69
43
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
2
|
-
export interface BadgeWrapperProps extends HasClassName {
|
|
3
|
-
/** Badge element to display */
|
|
4
|
-
badge?: JSXElement;
|
|
5
|
-
/** Content to wrap with badge */
|
|
6
|
-
children?: JSXElement;
|
|
7
|
-
/** Ref forwarding */
|
|
8
|
-
ref?: CommonRef;
|
|
9
|
-
}
|
|
10
|
-
export declare const COMPONENT_NAME = "BadgeWrapper";
|
|
11
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
12
|
-
export declare const DEFAULT_PROPS: Partial<BadgeWrapperProps>;
|
|
13
|
-
export declare const BadgeWrapper: (props: BadgeWrapperProps) => import("react").JSX.Element;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
export declare function setup({ component, render, overrides, }: SetupStoriesOptions<{
|
|
3
|
-
overrides: 'WithIcon' | 'WithButton';
|
|
4
|
-
decorators?: never;
|
|
5
|
-
}>): {
|
|
6
|
-
meta: {
|
|
7
|
-
component: any;
|
|
8
|
-
render: any;
|
|
9
|
-
argTypes: {
|
|
10
|
-
children: {
|
|
11
|
-
control: boolean;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
args: {
|
|
15
|
-
badge?: import("react").ReactNode;
|
|
16
|
-
children?: import("react").ReactNode;
|
|
17
|
-
ref?: import("../../types").CommonRef;
|
|
18
|
-
className?: string | undefined;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
/** Using badge wrapper with icon */
|
|
22
|
-
WithIcon: {
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
};
|
|
25
|
-
/** Using badge wrapper with button */
|
|
26
|
-
WithButton: {
|
|
27
|
-
[x: string]: any;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
3
|
-
props: any;
|
|
4
|
-
badgeWrapper: HTMLElement;
|
|
5
|
-
div: HTMLElement;
|
|
6
|
-
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
7
|
-
};
|
|
8
|
-
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
9
|
-
export default _default;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
import { ColorPalette } from '../../constants';
|
|
3
|
-
/**
|
|
4
|
-
* Setup Badge stories for a specific framework (React or Vue).
|
|
5
|
-
* This function creates all the stories with the appropriate decorators.
|
|
6
|
-
*/
|
|
7
|
-
export declare function setup({ component, render, decorators: { withCombinations }, overrides, }: SetupStoriesOptions<{
|
|
8
|
-
overrides: 'WithIcon';
|
|
9
|
-
decorators: 'withCombinations';
|
|
10
|
-
}>): {
|
|
11
|
-
meta: {
|
|
12
|
-
component: any;
|
|
13
|
-
render: any;
|
|
14
|
-
argTypes: {
|
|
15
|
-
color: {
|
|
16
|
-
control: {
|
|
17
|
-
type: "select" | "inline-radio";
|
|
18
|
-
};
|
|
19
|
-
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
|
|
20
|
-
mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
|
|
21
|
-
};
|
|
22
|
-
children: {
|
|
23
|
-
control: boolean;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
args: {
|
|
27
|
-
children?: import("react").ReactNode;
|
|
28
|
-
color?: ColorPalette | undefined;
|
|
29
|
-
ref?: import("../../types").CommonRef;
|
|
30
|
-
className?: string | undefined;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
/** Using badge with text children */
|
|
34
|
-
WithText: {
|
|
35
|
-
args: {
|
|
36
|
-
children: string;
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
/** Using badge with icon children - Icon component provided via overrides */
|
|
40
|
-
WithIcon: {
|
|
41
|
-
[x: string]: any;
|
|
42
|
-
};
|
|
43
|
-
/** All combinations of colors and children types */
|
|
44
|
-
AllColors: {
|
|
45
|
-
argTypes: {
|
|
46
|
-
color: {
|
|
47
|
-
control: boolean;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
decorators: ((story: any, context: any) => any)[];
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
badge: HTMLElement;
|
|
8
|
-
div: HTMLElement;
|
|
9
|
-
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
12
|
-
export default _default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ColorPalette } from '../../constants';
|
|
2
|
-
import type { CommonRef, HasClassName, JSXElement, LumxClassName } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* Defines the props of the component.
|
|
5
|
-
*/
|
|
6
|
-
export interface BadgeProps extends HasClassName {
|
|
7
|
-
/** Badge content. */
|
|
8
|
-
children?: JSXElement;
|
|
9
|
-
/** Color variant. */
|
|
10
|
-
color?: ColorPalette;
|
|
11
|
-
/** reference to the root element */
|
|
12
|
-
ref?: CommonRef;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Component display name.
|
|
16
|
-
*/
|
|
17
|
-
export declare const COMPONENT_NAME = "Badge";
|
|
18
|
-
/**
|
|
19
|
-
* Component default class name and class prefix.
|
|
20
|
-
*/
|
|
21
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
22
|
-
/**
|
|
23
|
-
* Component default props.
|
|
24
|
-
*/
|
|
25
|
-
export declare const DEFAULT_PROPS: Partial<BadgeProps>;
|
|
26
|
-
/**
|
|
27
|
-
* Badge component.
|
|
28
|
-
*
|
|
29
|
-
* @param props Component props.
|
|
30
|
-
* @return JSX element.
|
|
31
|
-
*/
|
|
32
|
-
export declare const Badge: {
|
|
33
|
-
(props: BadgeProps): import("react").JSX.Element;
|
|
34
|
-
displayName: string;
|
|
35
|
-
className: "lumx-badge";
|
|
36
|
-
defaultProps: Partial<BadgeProps>;
|
|
37
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { JSXElement, LumxClassName } from '../../types';
|
|
2
|
-
import { BaseButtonProps } from './ButtonRoot';
|
|
3
|
-
/**
|
|
4
|
-
* Button emphasis definition.
|
|
5
|
-
* @deprecated Use Emphasis instead.
|
|
6
|
-
*/
|
|
7
|
-
export declare const ButtonEmphasis: {
|
|
8
|
-
readonly low: "low";
|
|
9
|
-
readonly medium: "medium";
|
|
10
|
-
readonly high: "high";
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Defines the props of the component.
|
|
14
|
-
*/
|
|
15
|
-
export interface ButtonProps extends BaseButtonProps {
|
|
16
|
-
/** Left icon (SVG path). */
|
|
17
|
-
leftIcon?: string;
|
|
18
|
-
/** Right icon (SVG path). */
|
|
19
|
-
rightIcon?: string;
|
|
20
|
-
/** When `true`, the button gets as large as possible. */
|
|
21
|
-
fullWidth?: boolean;
|
|
22
|
-
/** Children */
|
|
23
|
-
children?: JSXElement;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Component display name.
|
|
27
|
-
*/
|
|
28
|
-
export declare const COMPONENT_NAME = "Button";
|
|
29
|
-
/**
|
|
30
|
-
* Component default class name and class prefix.
|
|
31
|
-
*/
|
|
32
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
33
|
-
/**
|
|
34
|
-
* Component default props.
|
|
35
|
-
*/
|
|
36
|
-
export declare const DEFAULT_PROPS: Partial<ButtonProps>;
|
|
37
|
-
/**
|
|
38
|
-
* Button component.
|
|
39
|
-
*
|
|
40
|
-
* @param props Component props.
|
|
41
|
-
* @return JSX element.
|
|
42
|
-
*/
|
|
43
|
-
export declare const Button: {
|
|
44
|
-
(props: ButtonProps): import("react").JSX.Element;
|
|
45
|
-
displayName: string;
|
|
46
|
-
className: "lumx-button";
|
|
47
|
-
defaultProps: Partial<ButtonProps>;
|
|
48
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { LumxClassName, HasClassName, JSXElement, CommonRef } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Defines the props of the component
|
|
4
|
-
*/
|
|
5
|
-
export interface ButtonGroupProps extends HasClassName {
|
|
6
|
-
/**
|
|
7
|
-
* Children
|
|
8
|
-
*/
|
|
9
|
-
children?: JSXElement;
|
|
10
|
-
/** reference to the root element */
|
|
11
|
-
ref?: CommonRef;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Component display name.
|
|
15
|
-
*/
|
|
16
|
-
export declare const COMPONENT_NAME = "ButtonGroup";
|
|
17
|
-
/**
|
|
18
|
-
* Component default class name and class prefix.
|
|
19
|
-
*/
|
|
20
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
21
|
-
/**
|
|
22
|
-
* Component default props.
|
|
23
|
-
*/
|
|
24
|
-
export declare const DEFAULT_PROPS: Partial<ButtonGroupProps>;
|
|
25
|
-
/**
|
|
26
|
-
* ButtonGroup component.
|
|
27
|
-
*
|
|
28
|
-
* @param props Component props.
|
|
29
|
-
* @return JSX element.
|
|
30
|
-
*/
|
|
31
|
-
export declare const ButtonGroup: {
|
|
32
|
-
(props: ButtonGroupProps): import("react").JSX.Element;
|
|
33
|
-
displayName: string;
|
|
34
|
-
className: "lumx-button-group";
|
|
35
|
-
defaultProps: Partial<ButtonGroupProps>;
|
|
36
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
/** Names of all ButtonGroup stories */
|
|
3
|
-
export type ButtonGroupStoryName = 'Variants' | 'OneButton' | 'ManyButtons';
|
|
4
|
-
/** Options for setting up ButtonGroup stories */
|
|
5
|
-
export type SetupButtonGroupStoriesOptions = SetupStoriesOptions<{
|
|
6
|
-
overrides: ButtonGroupStoryName;
|
|
7
|
-
decorators: 'withCombinations';
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Setup ButtonGroup stories for a specific framework (React or Vue).
|
|
11
|
-
* This function creates all the stories with the appropriate decorators.
|
|
12
|
-
* Framework-specific render functions or args can be injected via `overrides`.
|
|
13
|
-
*/
|
|
14
|
-
export declare function setup({ component, render, decorators: { withCombinations }, overrides, }: SetupButtonGroupStoriesOptions): {
|
|
15
|
-
meta: {
|
|
16
|
-
component: any;
|
|
17
|
-
render: any;
|
|
18
|
-
argTypes: {
|
|
19
|
-
children: {
|
|
20
|
-
control: boolean;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
args: Partial<import("./ButtonGroup").ButtonGroupProps>;
|
|
24
|
-
};
|
|
25
|
-
/** Size & emphasis variants */
|
|
26
|
-
Variants: {
|
|
27
|
-
decorators: ((story: any, context: any) => any)[];
|
|
28
|
-
};
|
|
29
|
-
/** ButtonGroup with a single button */
|
|
30
|
-
OneButton: {
|
|
31
|
-
[x: string]: any;
|
|
32
|
-
};
|
|
33
|
-
/** ButtonGroup with many buttons */
|
|
34
|
-
ManyButtons: {
|
|
35
|
-
[x: string]: any;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { ColorPalette, Emphasis, Size } from '../../constants';
|
|
2
|
-
import { HasTheme, HasAriaDisabled, AriaAttributes, HasClassName } from '../../types';
|
|
3
|
-
import { BaseClickableProps } from '../RawClickable';
|
|
4
|
-
/**
|
|
5
|
-
* Button size definition.
|
|
6
|
-
*/
|
|
7
|
-
export type ButtonSize = Extract<Size, 's' | 'm'>;
|
|
8
|
-
export interface BaseButtonProps extends Pick<AriaAttributes, 'aria-expanded' | 'aria-haspopup' | 'aria-pressed' | 'aria-label'>, HasClassName, HasTheme, HasAriaDisabled, BaseClickableProps {
|
|
9
|
-
/** Color variant. */
|
|
10
|
-
color?: ColorPalette;
|
|
11
|
-
/** Emphasis variant. */
|
|
12
|
-
emphasis?: Emphasis;
|
|
13
|
-
/** Whether or not the button has a background color in low emphasis. */
|
|
14
|
-
hasBackground?: boolean;
|
|
15
|
-
/** Native anchor href property. It determines whether the Button will be a <button> or an <a>. */
|
|
16
|
-
href?: string;
|
|
17
|
-
/** Whether the component is disabled or not. */
|
|
18
|
-
isDisabled?: boolean;
|
|
19
|
-
/** Whether the component is selected or not (unsupported in `high` emphasis). */
|
|
20
|
-
isSelected?: boolean;
|
|
21
|
-
/** Native button name property. */
|
|
22
|
-
name?: string;
|
|
23
|
-
/** Size variant. */
|
|
24
|
-
size?: ButtonSize;
|
|
25
|
-
/** Native anchor target property. */
|
|
26
|
-
target?: '_self' | '_blank' | '_parent' | '_top';
|
|
27
|
-
/** Native button type. */
|
|
28
|
-
type?: 'submit' | 'reset' | 'button' | undefined;
|
|
29
|
-
/** Custom component for the link (can be used to inject router Link). */
|
|
30
|
-
linkAs?: 'a' | any;
|
|
31
|
-
/** whether the button is dispalyed in full width or not */
|
|
32
|
-
fullWidth?: boolean;
|
|
33
|
-
/** whether the button is currently active or not */
|
|
34
|
-
isActive?: boolean;
|
|
35
|
-
/** whether the button is currently focused or not */
|
|
36
|
-
isFocused?: boolean;
|
|
37
|
-
/** whether the button is currently focused or not */
|
|
38
|
-
isHovered?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export interface ButtonRootProps extends BaseButtonProps {
|
|
41
|
-
variant: 'button' | 'icon';
|
|
42
|
-
}
|
|
43
|
-
export declare const BUTTON_WRAPPER_CLASSNAME = "lumx-button-wrapper";
|
|
44
|
-
export declare const BUTTON_CLASSNAME = "lumx-button";
|
|
45
|
-
/**
|
|
46
|
-
* ButtonRoot component.
|
|
47
|
-
*
|
|
48
|
-
* @param props Component props.
|
|
49
|
-
* @return JSX Element.
|
|
50
|
-
*/
|
|
51
|
-
export declare const ButtonRoot: {
|
|
52
|
-
(props: ButtonRootProps): import("react").JSX.Element;
|
|
53
|
-
displayName: string;
|
|
54
|
-
defaultProps: {};
|
|
55
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '@lumx/core/testing';
|
|
2
|
-
import { ButtonRootProps } from './ButtonRoot';
|
|
3
|
-
type SetupProps = Partial<ButtonRootProps>;
|
|
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<ButtonRootProps>) => {
|
|
8
|
-
props: any;
|
|
9
|
-
button: HTMLElement;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: (renderOptions: SetupOptions<ButtonRootProps>) => void;
|
|
12
|
-
export default _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { BaseButtonProps } from './ButtonRoot';
|
|
2
|
-
import type { LumxClassName } from '../../types';
|
|
3
|
-
export interface IconButtonProps extends BaseButtonProps {
|
|
4
|
-
/**
|
|
5
|
-
* Icon (SVG path).
|
|
6
|
-
* If `image` is also set, `image` will be used instead.
|
|
7
|
-
*/
|
|
8
|
-
icon?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Image (image url).
|
|
11
|
-
* Has priority over `icon`.
|
|
12
|
-
*/
|
|
13
|
-
image?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Label text (required for a11y purpose).
|
|
16
|
-
* If you really don't want an aria-label, you can set an empty label (this is not recommended).
|
|
17
|
-
*/
|
|
18
|
-
label: string;
|
|
19
|
-
/** text to be displayed on hover */
|
|
20
|
-
title?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Component display name.
|
|
24
|
-
*/
|
|
25
|
-
export declare const COMPONENT_NAME = "IconButton";
|
|
26
|
-
/**
|
|
27
|
-
* Component default class name and class prefix.
|
|
28
|
-
*/
|
|
29
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
30
|
-
/**
|
|
31
|
-
* Component default props.
|
|
32
|
-
*/
|
|
33
|
-
export declare const DEFAULT_PROPS: Partial<IconButtonProps>;
|
|
34
|
-
/**
|
|
35
|
-
* IconButton component.
|
|
36
|
-
*
|
|
37
|
-
* @param props Component props.
|
|
38
|
-
* @return JSX element.
|
|
39
|
-
*/
|
|
40
|
-
export declare const IconButton: {
|
|
41
|
-
(props: IconButtonProps): import("react").JSX.Element;
|
|
42
|
-
displayName: string;
|
|
43
|
-
className: "lumx-icon-button";
|
|
44
|
-
defaultProps: Partial<IconButtonProps>;
|
|
45
|
-
};
|