@wonderflow/react-components 2.27.1 → 2.28.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/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { Dropdown, DropdownProps } from './dropdown';
12
12
  export { Elevator, ElevatorProps } from './elevator';
13
13
  export { Icon, IconProps } from './icon';
14
14
  export { IconButton, IconButtonProps } from './icon-button';
15
+ export { InfoState, InfoStateProps } from './info-state';
15
16
  export { List, ListProps } from './list';
16
17
  export { Modal, ModalProps, useModalContext } from './modal';
17
18
  export { Prose, ProseProps } from './prose';
package/index.js CHANGED
@@ -12,6 +12,7 @@ export { Dropdown } from './dropdown';
12
12
  export { Elevator } from './elevator';
13
13
  export { Icon } from './icon';
14
14
  export { IconButton } from './icon-button';
15
+ export { InfoState } from './info-state';
15
16
  export { List } from './list';
16
17
  export { Modal, useModalContext } from './modal';
17
18
  export { Prose } from './prose';
@@ -0,0 +1,2 @@
1
+ export { InfoState } from './info-state';
2
+ export type { InfoStateProps } from './info-state';
@@ -0,0 +1 @@
1
+ export { InfoState } from './info-state';
@@ -0,0 +1,21 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { IconNames } from '../icons/types';
3
+ import { StackProps } from '../';
4
+ export declare type InfoStateProps = PropsWithClass & {
5
+ title: ReactNode;
6
+ text?: ReactNode;
7
+ icon?: IconNames;
8
+ image?: string;
9
+ direction?: StackProps['direction'];
10
+ iconColor?: 'gray' | 'cyan' | 'green' | 'purple' | 'yellow' | 'red' | 'blue';
11
+ actions?: ReactNode;
12
+ };
13
+ export declare const InfoState: React.ForwardRefExoticComponent<PropsWithClass & {
14
+ title: ReactNode;
15
+ text?: 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>>;
@@ -0,0 +1,15 @@
1
+ import React, { forwardRef } from 'react';
2
+ import { Stack, Icon, Title, Text } from '../';
3
+ import { IconWrapper, Image } from './info-state.module.css';
4
+ export const InfoState = forwardRef(({ className, children, title, icon, image, direction = 'column', iconColor = 'blue', actions, ...props }) => {
5
+ const isHorizontal = direction === 'row';
6
+ return (React.createElement(Stack, { direction: direction, rowGap: 24, columnGap: 32, className: className, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: (isHorizontal && image) ? 'center' : 'start', fill: false, wrap: !!image, ...props },
7
+ (!image && icon) && React.createElement("span", { "data-info-state-icon-color": iconColor, className: IconWrapper },
8
+ React.createElement(Icon, { name: icon, dimension: 48 })),
9
+ (image && !icon) && React.createElement("img", { className: Image, alt: "", width: "400", src: image, loading: "lazy", decoding: "async" }),
10
+ React.createElement(Stack, { rowGap: 16, horizontalAlign: isHorizontal ? 'start' : 'center', verticalAlign: "center", fill: false },
11
+ React.createElement(Title, { maxWidth: "20ch", textAlign: isHorizontal ? 'start' : 'center', level: "4" }, title),
12
+ React.createElement(Text, { maxWidth: "40ch", textAlign: isHorizontal ? 'start' : 'center' }, children),
13
+ actions && (React.createElement(Stack, { verticalPadding: 16, inline: true, direction: "row", columnGap: 16, rowGap: 16, wrap: true }, actions)))));
14
+ });
15
+ InfoState.displayName = 'InfoState';
@@ -0,0 +1,48 @@
1
+ .IconWrapper {
2
+ border-radius: env(--radius-8);
3
+ padding: env(--space-8);
4
+
5
+ & svg {
6
+ display: block;
7
+ }
8
+
9
+ &[data-info-state-icon-color='cyan'] {
10
+ background-color: var(--highlight-cyan-background);
11
+ color: var(--highlight-cyan-foreground);
12
+ }
13
+
14
+ &[data-info-state-icon-color='gray'] {
15
+ background-color: var(--highlight-gray-background);
16
+ color: var(--highlight-gray-foreground);
17
+ }
18
+
19
+ &[data-info-state-icon-color='green'] {
20
+ background-color: var(--highlight-green-background);
21
+ color: var(--highlight-green-foreground);
22
+ }
23
+
24
+ &[data-info-state-icon-color='purple'] {
25
+ background-color: var(--highlight-purple-background);
26
+ color: var(--highlight-purple-foreground);
27
+ }
28
+
29
+ &[data-info-state-icon-color='yellow'] {
30
+ background-color: var(--highlight-yellow-background);
31
+ color: var(--highlight-yellow-foreground);
32
+ }
33
+
34
+ &[data-info-state-icon-color='red'] {
35
+ background-color: var(--highlight-red-background);
36
+ color: var(--highlight-red-foreground);
37
+ }
38
+
39
+ &[data-info-state-icon-color='blue'] {
40
+ background-color: var(--highlight-blue-background);
41
+ color: var(--highlight-blue-foreground);
42
+ }
43
+ }
44
+
45
+ .Image {
46
+ max-inline-size: 22rem;
47
+ max-block-size: 22rem;
48
+ }
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.27.1",
4
+ "version": "2.28.0-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 Fri, 08 Oct 2021 13:06:06 GMT
3
+ * Generated on Tue, 12 Oct 2021 11:20:44 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 Fri, 08 Oct 2021 13:06:06 GMT
3
+ * Generated on Tue, 12 Oct 2021 11:20:44 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -30,7 +30,7 @@
30
30
  --highlight-yellow-foreground: hsl(25 100% 34%);
31
31
  --highlight-green-background: hsl(149 100% 91%);
32
32
  --highlight-green-foreground: hsl(156 100% 23%);
33
- --highlight-blue-background: hsl(180 100% 95%);
33
+ --highlight-blue-background: hsl(187 100% 89%);
34
34
  --highlight-blue-foreground: hsl(217 80% 35%);
35
35
  --highlight-red-background: hsl(343 100% 96%);
36
36
  --highlight-red-foreground: hsl(351 100% 31%);
package/themes/light.json CHANGED
@@ -25,7 +25,7 @@
25
25
  "highlight-yellow-foreground": "hsl(25 100% 34%)",
26
26
  "highlight-green-background": "hsl(149 100% 91%)",
27
27
  "highlight-green-foreground": "hsl(156 100% 23%)",
28
- "highlight-blue-background": "hsl(180 100% 95%)",
28
+ "highlight-blue-background": "hsl(187 100% 89%)",
29
29
  "highlight-blue-foreground": "hsl(217 80% 35%)",
30
30
  "highlight-red-background": "hsl(343 100% 96%)",
31
31
  "highlight-red-foreground": "hsl(351 100% 31%)",
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 Fri, 08 Oct 2021 13:06:06 GMT
7
+ * Generated on Tue, 12 Oct 2021 11:20:44 GMT
8
8
  */
9
9
 
10
10
 
@@ -34,7 +34,7 @@
34
34
  --highlight-yellow-foreground: hsl(25 100% 34%);
35
35
  --highlight-green-background: hsl(149 100% 91%);
36
36
  --highlight-green-foreground: hsl(156 100% 23%);
37
- --highlight-blue-background: hsl(180 100% 95%);
37
+ --highlight-blue-background: hsl(187 100% 89%);
38
38
  --highlight-blue-foreground: hsl(217 80% 35%);
39
39
  --highlight-red-background: hsl(343 100% 96%);
40
40
  --highlight-red-foreground: hsl(351 100% 31%);
@@ -51,7 +51,7 @@
51
51
  color: var(--global-foreground);
52
52
  /**
53
53
  * Do not edit directly
54
- * Generated on Fri, 08 Oct 2021 13:06:06 GMT
54
+ * Generated on Tue, 12 Oct 2021 11:20: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 Fri, 08 Oct 2021 13:06:06 GMT
102
+ * Generated on Tue, 12 Oct 2021 11:20:44 GMT
103
103
  */
104
104
 
105
105