@lumx/react 3.14.2-alpha.0 → 3.14.2-alpha.1
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/index.d.ts +8 -1
- package/index.js +13 -9
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/dialog/Dialog.tsx +4 -9
- package/src/components/progress/ProgressCircular.stories.tsx +15 -1
- package/src/components/progress/ProgressCircular.test.tsx +6 -0
- package/src/components/progress/ProgressCircular.tsx +22 -7
package/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/core": "^3.14.2-alpha.
|
|
10
|
-
"@lumx/icons": "^3.14.2-alpha.
|
|
9
|
+
"@lumx/core": "^3.14.2-alpha.1",
|
|
10
|
+
"@lumx/icons": "^3.14.2-alpha.1",
|
|
11
11
|
"@popperjs/core": "^2.5.4",
|
|
12
12
|
"body-scroll-lock": "^3.1.5",
|
|
13
13
|
"classnames": "^2.3.2",
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"build:storybook": "storybook build"
|
|
111
111
|
},
|
|
112
112
|
"sideEffects": false,
|
|
113
|
-
"version": "3.14.2-alpha.
|
|
113
|
+
"version": "3.14.2-alpha.1"
|
|
114
114
|
}
|
|
@@ -214,18 +214,13 @@ export const Dialog = forwardRef<DialogProps, HTMLDivElement>((props, ref) => {
|
|
|
214
214
|
|
|
215
215
|
<HeadingLevelProvider level={2}>
|
|
216
216
|
<ThemeProvider value={undefined}>
|
|
217
|
-
<
|
|
218
|
-
className={`${CLASSNAME}__container`}
|
|
219
|
-
role="dialog"
|
|
220
|
-
aria-modal="true"
|
|
221
|
-
{...dialogProps}
|
|
222
|
-
>
|
|
217
|
+
<div className={`${CLASSNAME}__container`} role="dialog" aria-modal="true" {...dialogProps}>
|
|
223
218
|
<ClickAwayProvider
|
|
224
219
|
callback={!shouldPreventCloseOnClickAway && onClose}
|
|
225
220
|
childrenRefs={clickAwayRefs}
|
|
226
221
|
parentRef={rootRef}
|
|
227
222
|
>
|
|
228
|
-
<
|
|
223
|
+
<section className={`${CLASSNAME}__wrapper`} ref={wrapperRef}>
|
|
229
224
|
{(header || headerChildContent) && (
|
|
230
225
|
<header
|
|
231
226
|
{...headerChildProps}
|
|
@@ -278,9 +273,9 @@ export const Dialog = forwardRef<DialogProps, HTMLDivElement>((props, ref) => {
|
|
|
278
273
|
<Progress variant={ProgressVariant.circular} />
|
|
279
274
|
</div>
|
|
280
275
|
)}
|
|
281
|
-
</
|
|
276
|
+
</section>
|
|
282
277
|
</ClickAwayProvider>
|
|
283
|
-
</
|
|
278
|
+
</div>
|
|
284
279
|
</ThemeProvider>
|
|
285
280
|
</HeadingLevelProvider>
|
|
286
281
|
</div>,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ProgressCircular, ProgressCircularSize, Size, Text } from '@lumx/react';
|
|
2
3
|
import { getSelectArgType } from '@lumx/react/stories/controls/selectArgType';
|
|
3
4
|
import { withCombinations } from '@lumx/react/stories/decorators/withCombinations';
|
|
4
5
|
|
|
@@ -28,3 +29,16 @@ export const AllSizes = {
|
|
|
28
29
|
}),
|
|
29
30
|
],
|
|
30
31
|
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Inline display variant to use inside text
|
|
35
|
+
*/
|
|
36
|
+
export const Inline = {
|
|
37
|
+
render() {
|
|
38
|
+
return (
|
|
39
|
+
<Text as="p">
|
|
40
|
+
Some text with <ProgressCircular display="inline" size="xxs" /> inline progress
|
|
41
|
+
</Text>
|
|
42
|
+
);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -21,6 +21,7 @@ describe(`<${ProgressCircular.displayName}>`, () => {
|
|
|
21
21
|
it('should render default', () => {
|
|
22
22
|
const { element } = setup();
|
|
23
23
|
expect(element).toHaveClass(`${CLASSNAME}--size-m`);
|
|
24
|
+
expect(element.tagName).toBe('DIV');
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
it('should render size xs', () => {
|
|
@@ -28,6 +29,11 @@ describe(`<${ProgressCircular.displayName}>`, () => {
|
|
|
28
29
|
expect(element).toHaveClass(`${CLASSNAME}--size-xs`);
|
|
29
30
|
});
|
|
30
31
|
|
|
32
|
+
it('should render display inline', () => {
|
|
33
|
+
const { element } = setup({ display: 'inline' });
|
|
34
|
+
expect(element.tagName).toBe('SPAN');
|
|
35
|
+
});
|
|
36
|
+
|
|
31
37
|
commonTestsSuiteRTL(setup, {
|
|
32
38
|
baseClassName: CLASSNAME,
|
|
33
39
|
forwardClassName: 'element',
|
|
@@ -17,8 +17,15 @@ export type ProgressCircularSize = Extract<Size, 'xxs' | 'xs' | 's' | 'm'>;
|
|
|
17
17
|
* Defines the props of the component.
|
|
18
18
|
*/
|
|
19
19
|
export interface ProgressCircularProps extends GenericProps, HasTheme {
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Progress circular size.
|
|
22
|
+
*/
|
|
21
23
|
size?: ProgressCircularSize;
|
|
24
|
+
/**
|
|
25
|
+
* Progress display type (inline or block).
|
|
26
|
+
* @default 'block'
|
|
27
|
+
*/
|
|
28
|
+
display?: 'inline' | 'block';
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
/**
|
|
@@ -36,6 +43,7 @@ const CLASSNAME = getRootClassName(COMPONENT_NAME);
|
|
|
36
43
|
*/
|
|
37
44
|
const DEFAULT_PROPS: Partial<ProgressCircularProps> = {
|
|
38
45
|
size: Size.m,
|
|
46
|
+
display: 'block',
|
|
39
47
|
};
|
|
40
48
|
|
|
41
49
|
/**
|
|
@@ -47,21 +55,28 @@ const DEFAULT_PROPS: Partial<ProgressCircularProps> = {
|
|
|
47
55
|
*/
|
|
48
56
|
export const ProgressCircular = forwardRef<ProgressCircularProps, HTMLDivElement>((props, ref) => {
|
|
49
57
|
const defaultTheme = useTheme() || Theme.light;
|
|
50
|
-
const {
|
|
58
|
+
const {
|
|
59
|
+
className,
|
|
60
|
+
theme = defaultTheme,
|
|
61
|
+
size = DEFAULT_PROPS.size,
|
|
62
|
+
display = DEFAULT_PROPS.display,
|
|
63
|
+
...forwardedProps
|
|
64
|
+
} = props;
|
|
65
|
+
const Element = display === 'block' ? 'div' : 'span';
|
|
51
66
|
|
|
52
67
|
return (
|
|
53
|
-
<
|
|
68
|
+
<Element
|
|
54
69
|
ref={ref}
|
|
55
70
|
{...forwardedProps}
|
|
56
|
-
className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, theme, size }))}
|
|
71
|
+
className={classNames(className, handleBasicClasses({ prefix: CLASSNAME, theme, size, display }))}
|
|
57
72
|
>
|
|
58
|
-
<
|
|
59
|
-
<
|
|
73
|
+
<Element className="lumx-progress-circular__double-bounce1" />
|
|
74
|
+
<Element className="lumx-progress-circular__double-bounce2" />
|
|
60
75
|
|
|
61
76
|
<svg className="lumx-progress-circular__svg" viewBox="25 25 50 50">
|
|
62
77
|
<circle className="lumx-progress-circular__path" cx="50" cy="50" r="20" fill="none" strokeWidth="5" />
|
|
63
78
|
</svg>
|
|
64
|
-
</
|
|
79
|
+
</Element>
|
|
65
80
|
);
|
|
66
81
|
});
|
|
67
82
|
ProgressCircular.displayName = COMPONENT_NAME;
|