@wonderflow/react-components 2.37.0 → 2.37.4-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.
@@ -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
@@ -14,14 +14,14 @@ 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, "data-button-disabled": disabled, "data-button-is-loading": loading, "aria-disabled": disabled, "aria-busy": loading, "aria-pressed": Wrapper === 'button' && pressed, "aria-live": loading ? 'polite' : undefined, onClick: handleClick(), ...props },
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, "data-button-disabled": disabled, "data-button-is-loading": loading, "aria-disabled": disabled, "aria-busy": loading, "aria-pressed": Wrapper === 'button' ? pressed : undefined, "aria-live": loading ? 'polite' : undefined, onClick: handleClick(), ...props },
18
18
  icon && (React.createElement(Icon, { name: icon, fill: iconColor, dimension: iconSize[dimension] })),
19
19
  children && React.createElement("span", null, children),
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: 'secondary',
25
- dimension: 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';
@@ -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%);
@@ -25,7 +25,7 @@ export const Disclosure = forwardRef(({ children, open = false, padding = true,
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
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, ...props },
28
- React.createElement(Text, { as: "summary", onClick: handleOpen(), className: Summary, fluid: false, "aria-expanded": isOpen, tabIndex: !expandable ? -1 : 0, size: dimension ? sizes[dimension].summary : undefined, weight: "bold", role: "button" },
28
+ React.createElement(Text, { as: "summary", onClick: handleOpen(), className: Summary, fluid: false, "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()));
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, role: "list", ...props }, Children.map(children, (child) => (React.createElement(Text, { as: "li", size: sizes[dimension].text },
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
  });
@@ -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 '../title';
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", { className: Header },
13
- onClose && React.createElement(IconButton, { onClick: onClose, className: CloseButton, icon: "xmark", kind: "flat" }),
14
- React.createElement(Title, { level: "5", id: titleId }, title)),
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';
@@ -33,7 +33,7 @@
33
33
  env(--space-24);
34
34
  }
35
35
 
36
- .CloseButton {
36
+ .CloseButton.CloseButton {
37
37
  position: absolute;
38
38
  top: env(--space-8);
39
39
  right: env(--space-8);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wonderflow/react-components",
3
3
  "description": "UI components from Wonderflow's Wanda design system",
4
- "version": "2.37.0",
4
+ "version": "2.37.4-next.1",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
package/themes/dark.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Nov 2021 14:54:21 GMT
3
+ * Generated on Mon, 22 Nov 2021 08:53:42 GMT
4
4
  */
5
5
 
6
6
  :root {
package/themes/light.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Thu, 18 Nov 2021 14:54:21 GMT
3
+ * Generated on Mon, 22 Nov 2021 08:53:42 GMT
4
4
  */
5
5
 
6
6
  :root {
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 Thu, 18 Nov 2021 14:54:21 GMT
7
+ * Generated on Mon, 22 Nov 2021 08:53:42 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 Thu, 18 Nov 2021 14:54:21 GMT
54
+ * Generated on Mon, 22 Nov 2021 08:53:42 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 Thu, 18 Nov 2021 14:54:21 GMT
102
+ * Generated on Mon, 22 Nov 2021 08:53:42 GMT
103
103
  */
104
104
 
105
105