@wonderflow/react-components 2.37.1 → 2.37.4
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/button/button.d.ts +1 -1
- package/button/button.js +3 -3
- package/button/button.module.css +3 -3
- package/grid/grid.d.ts +1 -4
- package/grid/grid.js +5 -4
- package/list/list.js +1 -1
- package/modal/modal-content.js +4 -6
- package/modal/modal-content.module.css +1 -1
- package/package.json +1 -1
- package/themes/dark.css +1 -1
- package/themes/light.css +1 -1
- package/themes.css +3 -3
- package/title/title.module.css +4 -4
package/button/button.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ export declare type ButtonProps = PropsWithClass & {
|
|
|
16
16
|
};
|
|
17
17
|
declare type PolymorphicButton = Polymorphic.ForwardRefComponent<'button', ButtonProps>;
|
|
18
18
|
export declare const Button: PolymorphicButton;
|
|
19
|
-
export declare type ButtonsGroupProps = PropsWithClass & Pick<ButtonProps, 'dimension'>;
|
|
19
|
+
export declare type ButtonsGroupProps = PropsWithClass & Pick<ButtonProps, 'dimension' | 'kind'>;
|
|
20
20
|
export declare const ButtonsGroup: React.FC<ButtonsGroupProps>;
|
|
21
21
|
export {};
|
package/button/button.js
CHANGED
|
@@ -20,8 +20,8 @@ export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', cla
|
|
|
20
20
|
loading && (React.createElement("span", { className: SpinnerIndicator },
|
|
21
21
|
React.createElement(Spinner, { dimension: dimension })))));
|
|
22
22
|
});
|
|
23
|
-
export const ButtonsGroup = ({ children, className, dimension = 'regular' }) => (React.createElement("div", { className: clsx(ButtonsGroupClass, className) }, Children.map(children, (child) => cloneElement(child, {
|
|
24
|
-
kind
|
|
25
|
-
dimension
|
|
23
|
+
export const ButtonsGroup = ({ children, className, kind, dimension = 'regular' }) => (React.createElement("div", { className: clsx(ButtonsGroupClass, className) }, Children.map(children, (child) => cloneElement(child, {
|
|
24
|
+
kind,
|
|
25
|
+
dimension
|
|
26
26
|
}))));
|
|
27
27
|
Button.displayName = 'Button';
|
package/button/button.module.css
CHANGED
|
@@ -127,17 +127,17 @@
|
|
|
127
127
|
.ButtonsGroup {
|
|
128
128
|
display: inline-flex;
|
|
129
129
|
|
|
130
|
-
& > *:not(:first-child, :last-child) {
|
|
130
|
+
& > *:not(:first-child, :last-child, :only-of-type) {
|
|
131
131
|
border-radius: 0;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
& > *:first-child {
|
|
134
|
+
& > *:first-child:not(:only-of-type) {
|
|
135
135
|
border-top-right-radius: 0;
|
|
136
136
|
border-bottom-right-radius: 0;
|
|
137
137
|
box-shadow: inset -1px 0 0 hsl(0deg 0% 40% / 10%);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
& > *:last-child {
|
|
140
|
+
& > *:last-child:not(:only-of-type) {
|
|
141
141
|
border-top-left-radius: 0;
|
|
142
142
|
border-bottom-left-radius: 0;
|
|
143
143
|
box-shadow: inset 1px 0 0 hsl(0deg 0% 40% / 10%);
|
package/grid/grid.d.ts
CHANGED
|
@@ -10,7 +10,4 @@ export declare type GridProps = PropsWithClass & {
|
|
|
10
10
|
colMinWidth?: string;
|
|
11
11
|
rowMinHeight?: string;
|
|
12
12
|
};
|
|
13
|
-
export declare const Grid:
|
|
14
|
-
({ className, children, columns, rows, rowGap, columnGap, style, filling, colMinWidth, rowMinHeight, ...props }: GridProps): JSX.Element;
|
|
15
|
-
Item: React.FC<import("./grid-item").GridItemProps>;
|
|
16
|
-
};
|
|
13
|
+
export declare const Grid: React.FC<GridProps>;
|
package/grid/grid.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import tksn from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
4
4
|
import { GridItem } from './grid-item';
|
|
5
5
|
import { Grid as GridClass } from './grid.module.css';
|
|
6
|
-
export const Grid = ({ className, children, columns, rows, rowGap = 8, columnGap = 8, style, filling = 'fill', colMinWidth = '10rem', rowMinHeight = '1fr', ...props }) => {
|
|
6
|
+
export const Grid = forwardRef(({ className, children, columns, rows, rowGap = 8, columnGap = 8, style, filling = 'fill', colMinWidth = '10rem', rowMinHeight = '1fr', ...props }, forwardedRef) => {
|
|
7
7
|
const computedStyle = {
|
|
8
8
|
'--rGap': rowGap && tksn.space[rowGap],
|
|
9
9
|
'--cGap': columnGap && tksn.space[columnGap],
|
|
@@ -12,6 +12,7 @@ export const Grid = ({ className, children, columns, rows, rowGap = 8, columnGap
|
|
|
12
12
|
'--rows': rows,
|
|
13
13
|
'--row-min-h': rowMinHeight
|
|
14
14
|
};
|
|
15
|
-
return (React.createElement("ul", { className: clsx(GridClass, className), style: { ...computedStyle, ...style }, "data-grid-filling-type": filling, ...props }, children));
|
|
16
|
-
};
|
|
15
|
+
return (React.createElement("ul", { className: clsx(GridClass, className), style: { ...computedStyle, ...style }, "data-grid-filling-type": filling, ref: forwardedRef, ...props }, children));
|
|
16
|
+
});
|
|
17
|
+
Grid.displayName = 'Grid';
|
|
17
18
|
Grid.Item = GridItem;
|
package/list/list.js
CHANGED
|
@@ -18,7 +18,7 @@ export const List = forwardRef(({ as: Wrapper = 'ul', children, marker = 'circle
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
const isUnordered = useMemo(() => Wrapper === 'ul', [Wrapper]);
|
|
21
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ListClass, className), "data-list-size": dimension, "data-list-ordered": !isUnordered,
|
|
21
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ListClass, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, ...props }, Children.map(children, (child) => (React.createElement(Text, { as: "li", size: sizes[dimension].text },
|
|
22
22
|
isUnordered && (React.createElement(Icon, { name: marker, className: Marker, fill: markerColor, dimension: marker !== 'circle' ? sizes[dimension].icon : 16 })),
|
|
23
23
|
child.props.children)))));
|
|
24
24
|
});
|
package/modal/modal-content.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { Content, Header, CloseButton } from './modal-content.module.css';
|
|
4
|
-
import { Title } from '../
|
|
5
|
-
import { Elevator } from '../elevator';
|
|
6
|
-
import { IconButton } from '../icon-button';
|
|
4
|
+
import { Title, Elevator, IconButton, Stack } from '../';
|
|
7
5
|
import { useModalContext } from './modal-context';
|
|
8
6
|
export const ModalContent = forwardRef(({ children, className, title, ...props }, forwardedRef) => {
|
|
9
7
|
const { onClose, titleId } = useModalContext();
|
|
10
8
|
return (React.createElement(Elevator, { resting: 4 },
|
|
11
9
|
React.createElement("div", { className: clsx(Content, className), ref: forwardedRef, "data-theme": "light", ...props },
|
|
12
|
-
React.createElement("header",
|
|
13
|
-
|
|
14
|
-
React.createElement(
|
|
10
|
+
React.createElement(Stack, { as: "header", verticalAlign: "center", fill: false, horizontalAlign: "space-between", direction: "row", className: Header },
|
|
11
|
+
React.createElement(Title, { level: "5", id: titleId }, title),
|
|
12
|
+
onClose && React.createElement(IconButton, { onClick: onClose, className: CloseButton, icon: "xmark", kind: "flat" })),
|
|
15
13
|
children)));
|
|
16
14
|
});
|
|
17
15
|
ModalContent.displayName = 'Modal.Content';
|
package/package.json
CHANGED
package/themes/dark.css
CHANGED
package/themes/light.css
CHANGED
package/themes.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
color: var(--global-foreground);
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Tue, 23 Nov 2021 14:26:44 GMT
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
color: var(--global-foreground);
|
|
52
52
|
/**
|
|
53
53
|
* Do not edit directly
|
|
54
|
-
* Generated on
|
|
54
|
+
* Generated on Tue, 23 Nov 2021 14:26:44 GMT
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
57
|
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
color: var(--global-foreground);
|
|
100
100
|
/**
|
|
101
101
|
* Do not edit directly
|
|
102
|
-
* Generated on
|
|
102
|
+
* Generated on Tue, 23 Nov 2021 14:26:44 GMT
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
105
|
|
package/title/title.module.css
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
--fluid-type-factor: calc(1.35rem + 2.37vw);
|
|
57
57
|
--fluid-type-max: 2.37rem;
|
|
58
58
|
|
|
59
|
-
font-weight:
|
|
59
|
+
font-weight: 800;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
&:is(.H2) {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
--fluid-type-factor: calc(1.8rem + 3.17vw);
|
|
65
65
|
--fluid-type-max: 3.16rem;
|
|
66
66
|
|
|
67
|
-
font-weight:
|
|
67
|
+
font-weight: 800;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
&:is(.H1) {
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
--fluid-type-factor: calc(2.23rem + 4.17vw);
|
|
73
73
|
--fluid-type-max: 4.2rem;
|
|
74
74
|
|
|
75
|
-
font-weight:
|
|
75
|
+
font-weight: 800;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
&.Display {
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
--fluid-type-factor: calc(3.19rem + 5.66vw);
|
|
81
81
|
--fluid-type-max: 5.6rem;
|
|
82
82
|
|
|
83
|
-
font-weight:
|
|
83
|
+
font-weight: 800;
|
|
84
84
|
}
|
|
85
85
|
}
|