@wonderflow/react-components 2.39.4 → 2.40.0-next.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/avatar/avatar.js +2 -2
- package/button/button.d.ts +4 -4
- package/button/button.js +4 -5
- package/button/button.module.css +6 -6
- package/card/card.d.ts +1 -1
- package/card/card.js +2 -2
- package/chip/chip.d.ts +10 -3
- package/chip/chip.js +2 -2
- package/circular-progress/circular-progress.js +2 -2
- package/clamp-text/clamp-text.d.ts +1 -1
- package/clamp-text/clamp-text.js +2 -3
- package/container/container.js +2 -3
- package/core/typography.css +1 -6
- package/disclosure/disclosure.js +3 -3
- package/dropdown/dropdown-item.d.ts +1 -1
- package/dropdown/dropdown-item.js +2 -2
- package/dropdown/dropdown-menu.d.ts +3 -3
- package/dropdown/dropdown-menu.js +3 -4
- package/elevator/elevator.d.ts +2 -2
- package/grid/grid-item.js +2 -2
- package/grid/grid.js +2 -2
- package/icon/icon.js +2 -2
- package/icon-button/icon-button.d.ts +1 -1
- package/icon-button/icon-button.js +1 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/info-state/info-state.d.ts +12 -3
- package/info-state/info-state.js +2 -2
- package/input-group/input-group.js +3 -3
- package/input-group/input-group.module.css +0 -3
- package/linear-progress/linear-progress.d.ts +4 -4
- package/linear-progress/linear-progress.js +3 -3
- package/list/list.d.ts +1 -1
- package/list/list.js +2 -3
- package/masonry/masonry.d.ts +2 -2
- package/masonry/masonry.js +2 -2
- package/modal/modal-content.js +2 -2
- package/modal/modal.js +7 -8
- package/package.json +4 -4
- package/pagination/pagination.d.ts +2 -4
- package/pagination/pagination.js +2 -2
- package/prose/prose.js +2 -3
- package/select/select.js +2 -2
- package/selection-controls/checkbox.js +2 -2
- package/selection-controls/radio.js +2 -2
- package/selection-controls/toggle.js +2 -2
- package/separator/index.d.ts +2 -1
- package/separator/index.js +1 -1
- package/separator/separator.d.ts +3 -3
- package/separator/separator.js +3 -4
- package/skeleton-block/skeleton-block.d.ts +1 -1
- package/skeleton-block/skeleton-block.js +2 -2
- package/slider/slider.js +2 -2
- package/snackbar/snackbar.js +2 -3
- package/spinner/spinner.d.ts +5 -2
- package/spinner/spinner.js +5 -4
- package/split-button/split-button.js +2 -3
- package/stack/stack.js +2 -3
- package/star-meter/star-meter.d.ts +1 -1
- package/star-meter/star-meter.js +2 -3
- package/tab/tab-item.js +2 -2
- package/tab/tab-list.js +1 -1
- package/tab/tab-panel.js +3 -2
- package/tab/tab.js +3 -2
- package/table/table.d.ts +3 -3
- package/table/table.js +8 -9
- package/table/table.module.css +0 -4
- package/text/text.d.ts +0 -1
- package/text/text.js +2 -3
- package/text/text.module.css +13 -20
- package/textfield/base-field/base-field.d.ts +1 -0
- package/textfield/base-field/base-field.js +2 -2
- package/textfield/base-field/index.d.ts +1 -1
- package/textfield/textfield.d.ts +4 -4
- package/textfield/textfield.js +3 -3
- package/themes/dark.css +1 -1
- package/themes/light.css +1 -1
- package/themes.css +3 -3
- package/title/title.d.ts +0 -1
- package/title/title.js +2 -3
- package/title/title.module.css +30 -33
- package/toggle-button/toggle-button.js +2 -3
- package/tooltip/tooltip.d.ts +2 -2
package/avatar/avatar.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { Avatar as AvatarClass, Placeholder } from './avatar.module.css';
|
|
4
|
-
export const Avatar = forwardRef(({ className, src, dimension = 'regular', ...
|
|
4
|
+
export const Avatar = forwardRef(({ className, src, dimension = 'regular', ...otherProps }, forwardedRef) => {
|
|
5
5
|
return (React.createElement("picture", { className: clsx(AvatarClass, className), "data-avatar-dimension": dimension },
|
|
6
6
|
React.createElement("svg", { "aria-hidden": "true", className: Placeholder, height: 18, viewBox: "0 0 12 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
7
7
|
React.createElement("path", { opacity: 0.7, d: "M6 0C3.795 0 2 1.794 2 4s1.795 4 4 4 4-1.794 4-4-1.795-4-4-4z", fill: "var(--highlight-blue-foreground)" }),
|
|
8
8
|
React.createElement("path", { d: "M8.4 9H3.6C1.612 9 0 10.575 0 12.531v5.126C1.814 18.517 3.85 19 6 19s4.186-.483 6-1.343v-5.126C12 10.581 10.394 9 8.4 9z", fill: "var(--highlight-blue-foreground)" })),
|
|
9
|
-
src && (React.createElement("img", { ref: forwardedRef, alt: "", src: src, ...
|
|
9
|
+
src && (React.createElement("img", { ref: forwardedRef, alt: "", src: src, ...otherProps }))));
|
|
10
10
|
});
|
|
11
11
|
Avatar.displayName = 'Avatar';
|
package/button/button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, MouseEvent } from 'react';
|
|
2
2
|
import { IconNames } from '../icons/types';
|
|
3
3
|
import { Polymorphic } from '../';
|
|
4
|
-
export declare type ButtonProps =
|
|
4
|
+
export declare type ButtonProps = {
|
|
5
5
|
kind?: 'primary' | 'secondary' | 'flat';
|
|
6
6
|
dimension?: 'regular' | 'small' | 'big';
|
|
7
7
|
fullWidth?: boolean;
|
|
@@ -10,12 +10,12 @@ export declare type ButtonProps = PropsWithClass & {
|
|
|
10
10
|
iconColor?: string;
|
|
11
11
|
disabled?: boolean;
|
|
12
12
|
type?: 'submit' | 'reset' | 'button';
|
|
13
|
-
|
|
13
|
+
busy?: boolean;
|
|
14
14
|
pressed?: boolean;
|
|
15
15
|
onClick?(event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>): void;
|
|
16
16
|
};
|
|
17
17
|
declare type PolymorphicButton = Polymorphic.ForwardRefComponent<'button', ButtonProps>;
|
|
18
18
|
export declare const Button: PolymorphicButton;
|
|
19
19
|
export declare type ButtonsGroupProps = PropsWithClass & Pick<ButtonProps, 'dimension' | 'kind'>;
|
|
20
|
-
export declare const ButtonsGroup:
|
|
20
|
+
export declare const ButtonsGroup: FC<ButtonsGroupProps>;
|
|
21
21
|
export {};
|
package/button/button.js
CHANGED
|
@@ -2,7 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React, { Children, cloneElement, forwardRef, useCallback } from 'react';
|
|
3
3
|
import { Icon, Spinner } from '../';
|
|
4
4
|
import { Button as ButtonClass, SpinnerIndicator, ButtonsGroup as ButtonsGroupClass } from './button.module.css';
|
|
5
|
-
export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', className, children, fullWidth, icon, disabled, iconPosition = 'left', iconColor, type = 'button', pressed, onClick,
|
|
5
|
+
export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', className, children, fullWidth, icon, disabled, iconPosition = 'left', iconColor, type = 'button', pressed, onClick, busy, as: Wrapper = 'button', ...otherProps }, forwardedRef) => {
|
|
6
6
|
const handleClick = useCallback(() => (event) => {
|
|
7
7
|
if (!disabled && onClick)
|
|
8
8
|
onClick(event);
|
|
@@ -14,14 +14,13 @@ export const Button = forwardRef(({ kind = 'primary', dimension = 'regular', cla
|
|
|
14
14
|
regular: 16,
|
|
15
15
|
small: 16
|
|
16
16
|
};
|
|
17
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(ButtonClass, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "
|
|
17
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, type: Wrapper === 'button' ? type : undefined, className: clsx(ButtonClass, className), "data-button-icon-position": iconPosition, "data-button-dimension": dimension, "data-button-kind": kind, "data-button-fullwidth": fullWidth, "aria-disabled": disabled, "aria-busy": busy, "aria-pressed": Wrapper === 'button' ? pressed : undefined, "aria-live": busy ? 'polite' : undefined, onClick: handleClick(), ...otherProps },
|
|
18
18
|
icon && (React.createElement(Icon, { name: icon, fill: iconColor, dimension: iconSize[dimension] })),
|
|
19
|
-
children && React.createElement("span", null, children),
|
|
20
|
-
|
|
19
|
+
(children && busy) ? React.createElement("span", null, children) : children,
|
|
20
|
+
busy && (React.createElement("span", { className: SpinnerIndicator },
|
|
21
21
|
React.createElement(Spinner, { dimension: dimension })))));
|
|
22
22
|
});
|
|
23
23
|
export const ButtonsGroup = ({ children, className, kind, dimension = 'regular' }) => (React.createElement("div", { className: clsx(ButtonsGroupClass, className) }, Children.map(children, (child) => cloneElement(child, {
|
|
24
24
|
kind,
|
|
25
25
|
dimension
|
|
26
26
|
}))));
|
|
27
|
-
Button.displayName = 'Button';
|
package/button/button.module.css
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
background: var(--cta-default);
|
|
50
50
|
color: var(--cta-foreground);
|
|
51
51
|
|
|
52
|
-
&:is(:active) {
|
|
52
|
+
&:not([aria-pressed='true'], [aria-disabled='true']):is(:active) {
|
|
53
53
|
background: var(--cta-dark);
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
|
|
67
67
|
color: var(--global-vibrancy-foreground);
|
|
68
68
|
|
|
69
|
-
&:is(:active) {
|
|
69
|
+
&:not([aria-pressed='true'], [aria-disabled='true']):is(:active) {
|
|
70
70
|
|
|
71
71
|
@mixin vibrancy-hover;
|
|
72
72
|
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
&[data-button-kind='flat'] {
|
|
84
84
|
color: var(--global-vibrancy-foreground);
|
|
85
85
|
|
|
86
|
-
&:is(:active) {
|
|
86
|
+
&:not([aria-pressed='true'], [aria-disabled='true']):is(:active) {
|
|
87
87
|
|
|
88
88
|
@mixin vibrancy-hover;
|
|
89
89
|
}
|
|
@@ -112,15 +112,15 @@
|
|
|
112
112
|
flex-direction: row-reverse;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
&[
|
|
116
|
-
&[
|
|
115
|
+
&[aria-disabled='true'],
|
|
116
|
+
&[aria-disabled='true']:is(:hover, :focus, :active) {
|
|
117
117
|
|
|
118
118
|
@mixin vibrancy-disabled;
|
|
119
119
|
|
|
120
120
|
cursor: not-allowed;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
&[
|
|
123
|
+
&[aria-busy='true'] > :not(.SpinnerIndicator) {
|
|
124
124
|
visibility: hidden;
|
|
125
125
|
}
|
|
126
126
|
}
|
package/card/card.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { StackProps, Polymorphic } from '../';
|
|
3
3
|
import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
|
|
4
|
-
export declare type CardProps =
|
|
4
|
+
export declare type CardProps = Pick<StackProps, 'wrap' | 'columnGap' | 'rowGap' | 'verticalAlign' | 'horizontalAlign'> & {
|
|
5
5
|
padding?: false | TokensTypes['space'];
|
|
6
6
|
left?: ReactNode;
|
|
7
7
|
right?: ReactNode;
|
package/card/card.js
CHANGED
|
@@ -3,12 +3,12 @@ import tkns from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
|
3
3
|
import { Stack } from '../';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { Card as CardClass, Left, Content, Right } from './card.module.css';
|
|
6
|
-
export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padding = 24, radius = 8, left, right, dimmed, bordered, columnGap = 24, rowGap = 24, verticalAlign = 'start', horizontalAlign = 'space-between', vibrant = false, highlightOnHover = false, wrap, style, ...
|
|
6
|
+
export const Card = forwardRef(({ as: Wrapper = 'div', children, className, padding = 24, radius = 8, left, right, dimmed, bordered, columnGap = 24, rowGap = 24, verticalAlign = 'start', horizontalAlign = 'space-between', vibrant = false, highlightOnHover = false, wrap, style, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const dynamicStyle = {
|
|
8
8
|
'--padding': padding && tkns.space[padding],
|
|
9
9
|
'--radius': radius && tkns.radius[radius]
|
|
10
10
|
};
|
|
11
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(CardClass, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, "data-card-vibrant": vibrant, "data-card-highlight-hover": highlightOnHover, ...
|
|
11
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(CardClass, className), style: { ...dynamicStyle, ...style }, "data-card-dimmed": dimmed, "data-card-bordered": bordered, "data-card-vibrant": vibrant, "data-card-highlight-hover": highlightOnHover, ...otherProps },
|
|
12
12
|
React.createElement(Stack, { direction: "row", fill: false, verticalAlign: verticalAlign, horizontalAlign: horizontalAlign, columnGap: columnGap, rowGap: rowGap, wrap: wrap },
|
|
13
13
|
left && React.createElement("div", { className: Left }, left),
|
|
14
14
|
children && (React.createElement("div", { className: Content }, children)),
|
package/chip/chip.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type ChipProps = PropsWithClass & {
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
export declare type ChipProps = PropsWithChildren<PropsWithClass> & {
|
|
3
3
|
dimension?: 'small' | 'regular' | 'big';
|
|
4
4
|
color?: 'gray' | 'cyan' | 'green' | 'purple' | 'yellow' | 'red' | 'blue';
|
|
5
5
|
interactive?: boolean;
|
|
6
6
|
onDismissClick?(): void;
|
|
7
7
|
};
|
|
8
|
-
export declare const Chip: React.
|
|
8
|
+
export declare const Chip: React.ForwardRefExoticComponent<PropsWithClass & {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
} & {
|
|
11
|
+
dimension?: "big" | "small" | "regular" | undefined;
|
|
12
|
+
color?: "gray" | "cyan" | "green" | "purple" | "yellow" | "red" | "blue" | undefined;
|
|
13
|
+
interactive?: boolean | undefined;
|
|
14
|
+
onDismissClick?(): void;
|
|
15
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
package/chip/chip.js
CHANGED
|
@@ -2,7 +2,7 @@ import clsx from 'clsx';
|
|
|
2
2
|
import React, { forwardRef } from 'react';
|
|
3
3
|
import { Icon, Stack } from '../';
|
|
4
4
|
import { Chip as ChipClass, Action } from './chip.module.css';
|
|
5
|
-
export const Chip = forwardRef(({ children, className, dimension = 'regular', color = 'gray', interactive, onDismissClick, ...
|
|
5
|
+
export const Chip = forwardRef(({ children, className, dimension = 'regular', color = 'gray', interactive, onDismissClick, ...otherProps }, forwardedRef) => {
|
|
6
6
|
const properties = {
|
|
7
7
|
small: {
|
|
8
8
|
iconSize: 14
|
|
@@ -14,7 +14,7 @@ export const Chip = forwardRef(({ children, className, dimension = 'regular', co
|
|
|
14
14
|
iconSize: 16
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
return (React.createElement(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(ChipClass, className), verticalAlign: "center", ref: forwardedRef, ...
|
|
17
|
+
return (React.createElement(Stack, { as: "span", direction: "row", columnGap: 8, inline: true, "data-chip-color": color, "data-chip-dimension": dimension, className: clsx(ChipClass, className), verticalAlign: "center", ref: forwardedRef, ...otherProps },
|
|
18
18
|
React.createElement("b", null, children),
|
|
19
19
|
interactive && (React.createElement("button", { onClick: interactive && onDismissClick, className: Action, type: "button" },
|
|
20
20
|
React.createElement(Icon, { name: "xmark", dimension: properties[dimension].iconSize })))));
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { forwardRef, useCallback } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { CircularProgress as CircularProgressClass } from './circular-progress.module.css';
|
|
4
|
-
export const CircularProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, style, ...
|
|
4
|
+
export const CircularProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, style, ...otherProps }, forwardedRef) => {
|
|
5
5
|
const getPercentage = useCallback(() => value ? Math.round((100 * value) / max) : 0, [max, value]);
|
|
6
6
|
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
7
7
|
const dynamicStyle = {
|
|
8
8
|
'--progress': `${getPercentage()}%`
|
|
9
9
|
};
|
|
10
|
-
return (React.createElement("div", { ref: forwardedRef, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: clsx(CircularProgressClass, className), "data-circular-progress": clamp(getPercentage(), 0, 100), "data-circular-progress-dimension": dimension, "data-circular-progress-show-progress": showProgress, style: { ...dynamicStyle, ...style }, ...
|
|
10
|
+
return (React.createElement("div", { ref: forwardedRef, role: "progressbar", "aria-valuenow": value, "aria-valuemin": 0, "aria-valuemax": max, className: clsx(CircularProgressClass, className), "data-circular-progress": clamp(getPercentage(), 0, 100), "data-circular-progress-dimension": dimension, "data-circular-progress-show-progress": showProgress, style: { ...dynamicStyle, ...style }, ...otherProps }));
|
|
11
11
|
});
|
|
12
12
|
CircularProgress.displayName = 'CircularProgress';
|
package/clamp-text/clamp-text.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { ClampText as ClampTextClass } from './clamp-text.module.css';
|
|
4
|
-
export const ClampText = forwardRef(({ className, children, rows = 1, style, as: Wrapper = 'span', ...
|
|
4
|
+
export const ClampText = forwardRef(({ className, children, rows = 1, style, as: Wrapper = 'span', ...otherProps }, forwardedRef) => {
|
|
5
5
|
const dynamicStyle = {
|
|
6
6
|
'--r': rows
|
|
7
7
|
};
|
|
8
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, style: { ...dynamicStyle, ...style }, className: clsx(ClampTextClass, className), ...
|
|
8
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, style: { ...dynamicStyle, ...style }, className: clsx(ClampTextClass, className), ...otherProps }, children));
|
|
9
9
|
});
|
|
10
|
-
ClampText.displayName = 'ClampText';
|
package/container/container.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Container as ContainerClass } from './container.module.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
export const Container = forwardRef(({ children, className, dimension = 'full', padding = true, as: Wrapper = 'div', ...
|
|
5
|
-
return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ContainerClass, className), "data-container-dimension": dimension, "data-container-padding": padding, ...
|
|
4
|
+
export const Container = forwardRef(({ children, className, dimension = 'full', padding = true, as: Wrapper = 'div', ...otherProps }, forwardedRef) => {
|
|
5
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ContainerClass, className), "data-container-dimension": dimension, "data-container-padding": padding, ...otherProps }, children));
|
|
6
6
|
});
|
|
7
|
-
Container.displayName = 'Container';
|
package/core/typography.css
CHANGED
package/disclosure/disclosure.js
CHANGED
|
@@ -3,7 +3,7 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { Disclosure as DisclosureClass, Summary, ExpandIcon, Content } from './disclosure.module.css';
|
|
4
4
|
import { Text, Icon } from '../';
|
|
5
5
|
import { motion } from 'framer-motion';
|
|
6
|
-
export const Disclosure = forwardRef(({ children, open = false, padding = true, className, summary, contentMaxHeight, dimension = 'regular', iconPosition = 'left', expandable = true, style, ...
|
|
6
|
+
export const Disclosure = forwardRef(({ children, open = false, padding = true, className, summary, contentMaxHeight, dimension = 'regular', iconPosition = 'left', expandable = true, style, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const [isOpen, setIsOpen] = useState(open);
|
|
8
8
|
const handleOpen = useCallback(() => (event) => {
|
|
9
9
|
event.preventDefault();
|
|
@@ -24,8 +24,8 @@ export const Disclosure = forwardRef(({ children, open = false, padding = true,
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
const renderContent = useCallback(() => (React.createElement(motion.div, { className: Content, "data-disclosure-padding": padding, "data-disclosure-height": Boolean(contentMaxHeight), animate: isOpen ? { y: 5, opacity: 1 } : { y: 0, opacity: 0 }, transition: { ease: 'easeOut', duration: 0.1 }, initial: false }, children)), [children, contentMaxHeight, isOpen, padding]);
|
|
27
|
-
return (React.createElement("details", { style: { ...dynamicStyle, ...style }, className: clsx(DisclosureClass, className), "data-disclosure-icon-position": iconPosition, "data-disclosure-dimension": dimension, "data-disclosure-expandable": expandable, "aria-expanded": isOpen ? 'true' : 'false', open: isOpen, ref: forwardedRef, ...
|
|
28
|
-
React.createElement(Text, { as: "summary", onClick: handleOpen(), className: Summary,
|
|
27
|
+
return (React.createElement("details", { style: { ...dynamicStyle, ...style }, className: clsx(DisclosureClass, className), "data-disclosure-icon-position": iconPosition, "data-disclosure-dimension": dimension, "data-disclosure-expandable": expandable, "aria-expanded": isOpen ? 'true' : 'false', open: isOpen, ref: forwardedRef, ...otherProps },
|
|
28
|
+
React.createElement(Text, { as: "summary", onClick: handleOpen(), className: Summary, "aria-expanded": isOpen, tabIndex: !expandable ? -1 : 0, size: dimension ? sizes[dimension].summary : undefined, weight: "bold" },
|
|
29
29
|
summary,
|
|
30
30
|
expandable && (React.createElement(Icon, { className: ExpandIcon, name: "chevron-right", dimension: dimension !== 'big' ? 16 : 24 }))),
|
|
31
31
|
renderContent()));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { IconNames } from '../icons/types';
|
|
3
3
|
import { Polymorphic } from '../';
|
|
4
|
-
export declare type DropdownItemProps =
|
|
4
|
+
export declare type DropdownItemProps = {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
icon?: IconNames;
|
|
7
7
|
dimension?: 'small' | 'regular';
|
|
@@ -21,6 +21,6 @@ export const DropdownItem = forwardRef(({ className, children, onClick, icon, di
|
|
|
21
21
|
? (React.createElement(Tooltip, { fill: true, show: focused, placement: "right-start", trigger: InnerContent }, description))
|
|
22
22
|
: InnerContent));
|
|
23
23
|
});
|
|
24
|
-
export const DropdownItemCheckbox = forwardRef(({ children, checked, ...props }, forwardedRef) => React.createElement(DropdownItem, { role: "menuitemcheckbox", "aria-checked": checked, ref: forwardedRef, ...props }, children));
|
|
25
24
|
DropdownItem.displayName = 'Dropdown.Item';
|
|
26
|
-
DropdownItemCheckbox
|
|
25
|
+
export const DropdownItemCheckbox = forwardRef(({ children, checked, ...props }, forwardedRef) => React.createElement(DropdownItem, { role: "menuitemcheckbox", "aria-checked": checked, ref: forwardedRef, ...props }, children));
|
|
26
|
+
DropdownItemCheckbox.displayName = 'Dropdown.ItemCheckbox';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
export declare type DropdownMenuProps =
|
|
1
|
+
import React, { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
export declare type DropdownMenuProps = HTMLAttributes<HTMLUListElement> & {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
};
|
|
5
|
-
export declare const DropdownMenu: React.ForwardRefExoticComponent<
|
|
5
|
+
export declare const DropdownMenu: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLUListElement> & {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
} & React.RefAttributes<HTMLUListElement>>;
|
|
@@ -3,14 +3,13 @@ import { RovingTabIndexProvider } from 'react-roving-tabindex';
|
|
|
3
3
|
import { Stack, Elevator } from '../';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { DropdownMenu as DropdownMenuClass } from './dropdown-menu.module.css';
|
|
6
|
-
|
|
7
|
-
export const DropdownMenu = forwardRef(({ className, children, ...props }, forwardedRef) => {
|
|
6
|
+
export const DropdownMenu = forwardRef(({ className, children, ...otherProps }, forwardedRef) => {
|
|
8
7
|
const renderedChildren = Children.toArray(children).filter(Boolean);
|
|
9
8
|
return (React.createElement(Elevator, { resting: 2 },
|
|
10
|
-
React.createElement(Stack, { as: "ul", ref: forwardedRef, className: clsx(DropdownMenuClass, className), role: "menu", ...
|
|
9
|
+
React.createElement(Stack, { as: "ul", ref: forwardedRef, className: clsx(DropdownMenuClass, className), role: "menu", ...otherProps },
|
|
11
10
|
React.createElement(RovingTabIndexProvider, { options: { direction: 'vertical', loopAround: true } }, Children.map(renderedChildren, (child, index) => {
|
|
12
11
|
var _a;
|
|
13
|
-
return (React.createElement(Stack, { as: "li", role: "none", verticalPadding: ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) ===
|
|
12
|
+
return (React.createElement(Stack, { as: "li", role: "none", verticalPadding: ((_a = child.type) === null || _a === void 0 ? void 0 : _a.displayName) === 'Separator' ? 8 : undefined }, cloneElement(child, {
|
|
14
13
|
autoFocus: index === 0 && true
|
|
15
14
|
})));
|
|
16
15
|
})))));
|
package/elevator/elevator.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC, ReactElement } from 'react';
|
|
2
2
|
export declare type ElevatorProps = {
|
|
3
3
|
resting: 0 | 1 | 2 | 3 | 4;
|
|
4
4
|
hover?: 0 | 1 | 2 | 3 | 4;
|
|
5
5
|
children: ReactElement;
|
|
6
6
|
};
|
|
7
|
-
export declare const Elevator:
|
|
7
|
+
export declare const Elevator: FC<ElevatorProps>;
|
package/grid/grid-item.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { GridItem as GridItemClass } from './grid.module.css';
|
|
4
|
-
export const GridItem = forwardRef(({ children, style, className, fullWidth = false, column, row, ...
|
|
4
|
+
export const GridItem = forwardRef(({ children, style, className, fullWidth = false, column, row, ...otherProps }, forwardedRef) => {
|
|
5
5
|
const dynamicStyle = {
|
|
6
6
|
'--column': column,
|
|
7
7
|
'--row': row
|
|
8
8
|
};
|
|
9
|
-
return (React.createElement("li", { ref: forwardedRef, className: clsx(GridItemClass, className), style: { ...dynamicStyle, ...style }, "data-grid-item-fullwidth": fullWidth, ...
|
|
9
|
+
return (React.createElement("li", { ref: forwardedRef, className: clsx(GridItemClass, className), style: { ...dynamicStyle, ...style }, "data-grid-item-fullwidth": fullWidth, ...otherProps }, children));
|
|
10
10
|
});
|
|
11
11
|
GridItem.displayName = 'Grid.Item';
|
package/grid/grid.js
CHANGED
|
@@ -3,7 +3,7 @@ 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 = forwardRef(({ className, children, columns, rows, rowGap = 8, columnGap = 8, style, filling = 'fill', colMinWidth = '10rem', rowMinHeight = '1fr', ...
|
|
6
|
+
export const Grid = forwardRef(({ className, children, columns, rows, rowGap = 8, columnGap = 8, style, filling = 'fill', colMinWidth = '10rem', rowMinHeight = '1fr', ...otherProps }, forwardedRef) => {
|
|
7
7
|
const computedStyle = {
|
|
8
8
|
'--rGap': rowGap && tksn.space[rowGap],
|
|
9
9
|
'--cGap': columnGap && tksn.space[columnGap],
|
|
@@ -12,7 +12,7 @@ export const Grid = forwardRef(({ className, children, columns, rows, rowGap = 8
|
|
|
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, ref: forwardedRef, ...
|
|
15
|
+
return (React.createElement("ul", { className: clsx(GridClass, className), style: { ...computedStyle, ...style }, "data-grid-filling-type": filling, ref: forwardedRef, ...otherProps }, children));
|
|
16
16
|
});
|
|
17
17
|
Grid.displayName = 'Grid';
|
|
18
18
|
Grid.Item = GridItem;
|
package/icon/icon.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import sprite from '../icons/all.svg';
|
|
3
|
-
export const Icon = forwardRef(({ className, name, dimension = 16, fill, ...
|
|
3
|
+
export const Icon = forwardRef(({ className, name, dimension = 16, fill, ...otherProps }, forwardedRef) => {
|
|
4
4
|
const computedSize = dimension < 24 ? 16 : 24;
|
|
5
|
-
return (React.createElement("svg", { "aria-hidden": "true", width: dimension, height: dimension, fill: fill, className: className, ref: forwardedRef, ...
|
|
5
|
+
return (React.createElement("svg", { "aria-hidden": "true", width: dimension, height: dimension, fill: fill, className: className, ref: forwardedRef, ...otherProps },
|
|
6
6
|
React.createElement("use", { href: `${sprite}#${computedSize}/${name}` })));
|
|
7
7
|
});
|
|
8
8
|
Icon.displayName = 'Icon';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button, ButtonProps, Polymorphic } from '../';
|
|
2
|
-
export declare type IconButtonProps =
|
|
2
|
+
export declare type IconButtonProps = Pick<ButtonProps, 'kind' | 'dimension' | 'icon' | 'disabled' | 'onClick' | 'busy'>;
|
|
3
3
|
declare type PolymorphicIconButton = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Button>, Polymorphic.OwnProps<typeof Button> & IconButtonProps>;
|
|
4
4
|
export declare const IconButton: PolymorphicIconButton;
|
|
5
5
|
export {};
|
|
@@ -2,5 +2,4 @@ import React, { forwardRef } from 'react';
|
|
|
2
2
|
import { IconButton as IconButtonClass } from './icon-button.module.css';
|
|
3
3
|
import { Button } from '../';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
export const IconButton = forwardRef(({ className, icon, dimension, kind, disabled,
|
|
6
|
-
IconButton.displayName = 'IconButton';
|
|
5
|
+
export const IconButton = forwardRef(({ className, icon, dimension, kind, disabled, busy, ...otherProps }, forwardedRef) => (React.createElement(Button, { ref: forwardedRef, icon: icon, dimension: dimension, kind: kind, disabled: disabled, busy: busy, className: clsx(IconButtonClass, className), ...otherProps })));
|
package/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export { LinearProgress, LinearProgressProps } from './linear-progress';
|
|
|
24
24
|
export { Prose, ProseProps } from './prose';
|
|
25
25
|
export { Pagination, PaginationProps } from './pagination';
|
|
26
26
|
export { Select, SelectProps } from './select';
|
|
27
|
-
export { Separator,
|
|
27
|
+
export { Separator, SeparatorProps } from './separator';
|
|
28
28
|
export { SkeletonBlock, SkeletonBlockProps } from './skeleton-block';
|
|
29
29
|
export { Slider, SliderProps } from './slider';
|
|
30
30
|
export { Snackbar, SnackbarProps } from './snackbar';
|
package/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export { LinearProgress } from './linear-progress';
|
|
|
24
24
|
export { Prose } from './prose';
|
|
25
25
|
export { Pagination } from './pagination';
|
|
26
26
|
export { Select } from './select';
|
|
27
|
-
export { Separator
|
|
27
|
+
export { Separator } from './separator';
|
|
28
28
|
export { SkeletonBlock } from './skeleton-block';
|
|
29
29
|
export { Slider } from './slider';
|
|
30
30
|
export { Snackbar } from './snackbar';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
|
2
2
|
import { IconNames } from '../icons/types';
|
|
3
3
|
import { StackProps } from '../';
|
|
4
|
-
export declare type InfoStateProps = PropsWithClass & {
|
|
4
|
+
export declare type InfoStateProps = PropsWithChildren<PropsWithClass> & {
|
|
5
5
|
title: ReactNode;
|
|
6
6
|
icon?: IconNames;
|
|
7
7
|
image?: string;
|
|
@@ -9,4 +9,13 @@ export declare type InfoStateProps = PropsWithClass & {
|
|
|
9
9
|
iconColor?: 'gray' | 'cyan' | 'green' | 'purple' | 'yellow' | 'red' | 'blue';
|
|
10
10
|
actions?: ReactNode;
|
|
11
11
|
};
|
|
12
|
-
export declare const InfoState: React.
|
|
12
|
+
export declare const InfoState: React.ForwardRefExoticComponent<PropsWithClass & {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
} & {
|
|
15
|
+
title: ReactNode;
|
|
16
|
+
icon?: IconNames | undefined;
|
|
17
|
+
image?: string | undefined;
|
|
18
|
+
direction?: StackProps['direction'];
|
|
19
|
+
iconColor?: "gray" | "cyan" | "green" | "purple" | "yellow" | "red" | "blue" | undefined;
|
|
20
|
+
actions?: ReactNode;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
package/info-state/info-state.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Stack, Icon, Title, Text } from '../';
|
|
3
3
|
import { IconWrapper, Image } from './info-state.module.css';
|
|
4
|
-
export const InfoState = forwardRef(({ className, children, title, icon, image, direction = 'column', iconColor = 'blue', actions, ...
|
|
4
|
+
export const InfoState = forwardRef(({ className, children, title, icon, image, direction = 'column', iconColor = 'blue', actions, ...otherProps }, forwardedRef) => {
|
|
5
5
|
const isHorizontal = direction === 'row';
|
|
6
|
-
return (React.createElement(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...
|
|
6
|
+
return (React.createElement(Stack, { ref: forwardedRef, direction: direction, rowGap: 24, columnGap: 32, className: className, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...otherProps },
|
|
7
7
|
(!image && icon) && (React.createElement("span", { "data-info-state-icon-color": iconColor, className: IconWrapper },
|
|
8
8
|
React.createElement(Icon, { name: icon, dimension: 48 }))),
|
|
9
9
|
(image && !icon) && React.createElement("img", { className: Image, alt: "", width: "400", src: image, loading: "lazy", decoding: "async" }),
|
|
@@ -3,11 +3,11 @@ import React, { Children, cloneElement, forwardRef } from 'react';
|
|
|
3
3
|
import { Stack, Text } from '../';
|
|
4
4
|
import { useUIDSeed } from 'react-uid';
|
|
5
5
|
import { End, InputField, Start, InputGroup as InputGroupClass } from './input-group.module.css';
|
|
6
|
-
export const InputGroup = forwardRef(({ className, input, end, start, label, dimension = 'regular', ...
|
|
6
|
+
export const InputGroup = forwardRef(({ className, input, end, start, label, dimension = 'regular', ...otherProps }, forwardedRef) => {
|
|
7
7
|
const uid = useUIDSeed();
|
|
8
|
-
return (React.createElement(Stack, { rowGap: 4, horizontalAlign: "stretch", verticalAlign: "start" },
|
|
8
|
+
return (React.createElement(Stack, { rowGap: 4, horizontalAlign: "stretch", verticalAlign: "start", fill: false },
|
|
9
9
|
label && React.createElement(Text, { as: "label", size: dimension === 'small' ? 14 : 16, htmlFor: uid('field') }, label),
|
|
10
|
-
React.createElement(Stack, { as: "fieldset", direction: "row", verticalAlign: "start", horizontalAlign: "start", fill: false, inline: true, ref: forwardedRef, className: clsx(InputGroupClass, className), "data-input-group-has-end": Boolean(end), "data-input-group-has-start": !!start, ...
|
|
10
|
+
React.createElement(Stack, { as: "fieldset", direction: "row", verticalAlign: "start", horizontalAlign: "start", fill: false, inline: true, ref: forwardedRef, className: clsx(InputGroupClass, className), "data-input-group-has-end": Boolean(end), "data-input-group-has-start": !!start, ...otherProps },
|
|
11
11
|
React.createElement("div", { className: Start }, Children.map(start, (child) => cloneElement(child, {
|
|
12
12
|
dimension
|
|
13
13
|
}))),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type LinearProgressProps =
|
|
1
|
+
import React, { ProgressHTMLAttributes } from 'react';
|
|
2
|
+
export declare type LinearProgressProps = ProgressHTMLAttributes<HTMLProgressElement> & {
|
|
3
3
|
value?: number;
|
|
4
4
|
max?: number;
|
|
5
5
|
dimension?: 'regular' | 'big';
|
|
6
6
|
showProgress?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const LinearProgress: React.ForwardRefExoticComponent<
|
|
8
|
+
export declare const LinearProgress: React.ForwardRefExoticComponent<React.ProgressHTMLAttributes<HTMLProgressElement> & {
|
|
9
9
|
value?: number | undefined;
|
|
10
10
|
max?: number | undefined;
|
|
11
11
|
dimension?: "big" | "regular" | undefined;
|
|
12
12
|
showProgress?: boolean | undefined;
|
|
13
|
-
} & React.RefAttributes<
|
|
13
|
+
} & React.RefAttributes<HTMLProgressElement>>;
|
|
@@ -2,11 +2,11 @@ import React, { forwardRef, useCallback } from 'react';
|
|
|
2
2
|
import { Text } from '../';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { LinearProgress as LinearProgressClass, Progress, Percentage } from './linear-progress.module.css';
|
|
5
|
-
export const LinearProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, ...
|
|
5
|
+
export const LinearProgress = forwardRef(({ className, value, max = 100, dimension = 'regular', showProgress, ...otherProps }, forwardedRef) => {
|
|
6
6
|
const getPercentage = useCallback(() => value ? Math.round((100 * value) / max) : 0, [max, value]);
|
|
7
7
|
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
|
8
|
-
return (React.createElement("div", {
|
|
9
|
-
React.createElement("progress", { role: "progressbar", className: Progress, "data-progress-dimension": dimension, "aria-valuemin": 0, "aria-valuenow": value, "aria-valuemax": max, value: value, max: max, ...
|
|
8
|
+
return (React.createElement("div", { className: clsx(LinearProgressClass, className) },
|
|
9
|
+
React.createElement("progress", { role: "progressbar", ref: forwardedRef, className: Progress, "data-progress-dimension": dimension, "aria-valuemin": 0, "aria-valuenow": value, "aria-valuemax": max, value: value, max: max, ...otherProps }),
|
|
10
10
|
(showProgress) && (React.createElement(Text, { as: "span", className: Percentage, style: {
|
|
11
11
|
'--offset': `${getPercentage()}%`,
|
|
12
12
|
'--translation': value !== 0 ? '-100%' : '-50%'
|
package/list/list.d.ts
CHANGED
package/list/list.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { Children, forwardRef, useMemo } from 'react';
|
|
|
2
2
|
import { List as ListClass, Marker } from './list.module.css';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { Text, Icon } from '../';
|
|
5
|
-
export const List = forwardRef(({ as: Wrapper = 'ul', children, marker = 'circle', dimension = 'regular', className, markerColor, hideMarker = false, ...
|
|
5
|
+
export const List = forwardRef(({ as: Wrapper = 'ul', children, marker = 'circle', dimension = 'regular', className, markerColor, hideMarker = false, ...otherProps }, forwardedRef) => {
|
|
6
6
|
const sizes = {
|
|
7
7
|
small: {
|
|
8
8
|
text: 16,
|
|
@@ -18,8 +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, "data-list-no-marker": hideMarker, ...
|
|
21
|
+
return (React.createElement(Wrapper, { ref: forwardedRef, className: clsx(ListClass, className), "data-list-size": dimension, "data-list-ordered": !isUnordered, "data-list-no-marker": hideMarker, ...otherProps }, 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
|
});
|
|
25
|
-
List.displayName = 'List';
|
package/masonry/masonry.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { TokensTypes } from '@wonderflow/tokens/platforms/web/types';
|
|
3
3
|
export declare type MasonryProps = PropsWithClass & {
|
|
4
4
|
gutter?: 0 | TokensTypes['space'];
|
|
@@ -11,4 +11,4 @@ export declare type MasonryProps = PropsWithClass & {
|
|
|
11
11
|
extraLarge?: number;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
|
-
export declare const Masonry:
|
|
14
|
+
export declare const Masonry: FC<MasonryProps>;
|
package/masonry/masonry.js
CHANGED
|
@@ -3,7 +3,7 @@ import React, { Children, cloneElement } from 'react';
|
|
|
3
3
|
import MasonryLayout from 'react-masonry-css';
|
|
4
4
|
import tksn from '@wonderflow/tokens/platforms/web/tokens.json';
|
|
5
5
|
import { Masonry as MasonryClass, Column } from './masonry.module.css';
|
|
6
|
-
export const Masonry = ({ className, children, columns = 3, gutter = 16, style, ...
|
|
6
|
+
export const Masonry = ({ className, children, columns = 3, gutter = 16, style, ...otherProps }) => {
|
|
7
7
|
const breakpoints = {
|
|
8
8
|
extraSmall: 480,
|
|
9
9
|
small: 768,
|
|
@@ -19,7 +19,7 @@ export const Masonry = ({ className, children, columns = 3, gutter = 16, style,
|
|
|
19
19
|
default: columns.default,
|
|
20
20
|
[breakpoints[current]]: columns[current]
|
|
21
21
|
}), {});
|
|
22
|
-
return (React.createElement(MasonryLayout, { role: "list", className: clsx(MasonryClass, className), columnClassName: Column, breakpointCols: typeof columns === 'number' ? columns : computedColumns, style: { ...dynamicStyle, ...style }, ...
|
|
22
|
+
return (React.createElement(MasonryLayout, { role: "list", className: clsx(MasonryClass, className), columnClassName: Column, breakpointCols: typeof columns === 'number' ? columns : computedColumns, style: { ...dynamicStyle, ...style }, ...otherProps }, Children.map(children, (child) => cloneElement(child, {
|
|
23
23
|
role: 'listitem'
|
|
24
24
|
}))));
|
|
25
25
|
};
|
package/modal/modal-content.js
CHANGED
|
@@ -3,10 +3,10 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import { Content, Header, CloseButton } from './modal-content.module.css';
|
|
4
4
|
import { Title, Elevator, IconButton, Stack } from '../';
|
|
5
5
|
import { useModalContext } from './modal-context';
|
|
6
|
-
export const ModalContent = forwardRef(({ children, className, title, ...
|
|
6
|
+
export const ModalContent = forwardRef(({ children, className, title, ...otherProps }, forwardedRef) => {
|
|
7
7
|
const { onClose, titleId } = useModalContext();
|
|
8
8
|
return (React.createElement(Elevator, { resting: 4 },
|
|
9
|
-
React.createElement("div", { className: clsx(Content, className), ref: forwardedRef, "data-theme": "light", ...
|
|
9
|
+
React.createElement("div", { className: clsx(Content, className), ref: forwardedRef, "data-theme": "light", ...otherProps },
|
|
10
10
|
React.createElement(Stack, { as: "header", verticalAlign: "center", fill: false, horizontalAlign: "space-between", direction: "row", className: Header },
|
|
11
11
|
React.createElement(Title, { level: "5", id: titleId }, title),
|
|
12
12
|
onClose && React.createElement(IconButton, { onClick: onClose, className: CloseButton, icon: "xmark", kind: "flat" })),
|