@wonderflow/react-components 2.27.0-next.2 → 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/icons/all.svg +3 -3
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/info-state/index.d.ts +2 -0
- package/info-state/index.js +1 -0
- package/info-state/info-state.d.ts +21 -0
- package/info-state/info-state.js +15 -0
- package/info-state/info-state.module.css +48 -0
- package/package.json +1 -1
- package/themes/dark.css +1 -1
- package/themes/light.css +2 -2
- package/themes/light.json +1 -1
- package/themes.css +4 -4
- package/tooltip/tooltip.js +1 -2
package/icons/all.svg
CHANGED
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
</symbol><symbol id="16/clock-rotate-left" viewBox="0 0 16 16">
|
|
86
86
|
<path d="M14.863 6.588C14.659 5.532 13.122.998 8 1c-2.173-.001-3.812.909-4.948 2.051l-.932-.933A.656.656 0 0 0 1 2.582v3.547c0 .257.209.466.466.466H5.01a.656.656 0 0 0 .464-1.12L4.372 4.371C5.902 2.832 7.635 2.866 8 2.866c2.716-.001 4.585 1.978 5.014 4.013A5.144 5.144 0 0 1 8 13.132a5.09 5.09 0 0 1-2.318-.557.94.94 0 0 0-1.099.16c-.441.442-.34 1.196.216 1.484A6.919 6.919 0 0 0 8 15c4.325 0 7.735-3.926 6.863-8.412ZM8 4.267c-.385 0-.7.315-.7.7v3.5a.7.7 0 0 0 .28.56l1.867 1.4a.63.63 0 0 0 .393.14.7.7 0 0 0 .421-1.26L8.7 8.117v-3.15a.7.7 0 0 0-.7-.7Z"/>
|
|
87
87
|
</symbol><symbol id="16/code" viewBox="0 0 16 16">
|
|
88
|
-
<path d="
|
|
88
|
+
<path d="M13 1H3a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3c0-1.104-.897-2-2-2ZM6.753 9.694a.751.751 0 1 1-1.005 1.114l-2.5-2.25a.75.75 0 0 1 0-1.115l2.5-2.25a.751.751 0 0 1 1.004 1.115L4.872 8l1.881 1.694Zm6-1.138-2.5 2.25c-.144.103-.325.194-.503.194a.75.75 0 0 1-.502-1.308L11.128 8l-1.88-1.692a.751.751 0 0 1 1.003-1.116l2.5 2.25a.75.75 0 0 1 .002 1.114Z"/>
|
|
89
89
|
</symbol><symbol id="16/comment" viewBox="0 0 16 16">
|
|
90
90
|
<path d="M7.988 2C4.115 2 1.001 4.494 1.001 7.572c0 1.329.585 2.544 1.56 3.5-.342 1.35-1.486 2.553-1.5 2.566a.205.205 0 0 0-.041.234.21.21 0 0 0 .199.128c1.815 0 3.153-.85 3.851-1.377a8.53 8.53 0 0 0 2.942.52c3.873 0 6.988-2.495 6.988-5.548S11.862 2 7.988 2Zm-3.53 6.429c-.487 0-.877-.382-.877-.833a.88.88 0 0 1 .877-.857c.486 0 .876.381.876.857 0 .475-.367.833-.876.833Zm3.53 0a.838.838 0 0 1-.851-.833c0-.451.39-.857.851-.857.462 0 .852.381.852.857 0 .475-.364.833-.852.833Zm3.482 0c-.486 0-.877-.382-.877-.833a.88.88 0 0 1 .877-.857c.486 0 .877.381.877.857 0 .475-.368.833-.877.833Z"/>
|
|
91
91
|
</symbol><symbol id="16/compass" viewBox="0 0 16 16">
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
</symbol><symbol id="24/clock-rotate-left" viewBox="0 0 24 24">
|
|
275
275
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 4.005A9.953 9.953 0 0 1 12 2 10 10 0 1 1 2 12.004a.833.833 0 0 1 1.667 0A8.329 8.329 0 1 0 7 5.338l1.5 1.995-6 .334L4.5 2 6 4.005Zm5.41 3.24a.833.833 0 0 1 1.423.588v3.822l3.09 3.09a.833.833 0 0 1-1.179 1.178l-3.333-3.334a.833.833 0 0 1-.244-.589V7.833c0-.22.088-.433.244-.589Z"/>
|
|
276
276
|
</symbol><symbol id="24/code" viewBox="0 0 24 24">
|
|
277
|
-
<path d="
|
|
277
|
+
<path d="M10.718 8.746a.964.964 0 0 0-1.363 0l-2.572 2.571a.964.964 0 0 0 0 1.364l2.572 2.571c.222.191.471.284.716.284a.965.965 0 0 0 .682-1.646L8.862 12l1.89-1.89a.938.938 0 0 0-.034-1.364Zm3.857 0a.964.964 0 1 0-1.363 1.363L15.138 12l-1.89 1.89a.964.964 0 0 0 1.362 1.363l2.572-2.571a.964.964 0 0 0 0-1.364l-2.607-2.572ZM18.43 3H5.57A2.571 2.571 0 0 0 3 5.571V18.43A2.571 2.571 0 0 0 5.571 21H18.43A2.571 2.571 0 0 0 21 18.429V5.57A2.573 2.573 0 0 0 18.429 3Zm.642 15.429a.644.644 0 0 1-.642.642H5.57a.644.644 0 0 1-.642-.642V5.57c0-.354.288-.642.642-.642h12.86c.354 0 .642.288.642.642v12.86Z"/>
|
|
278
278
|
</symbol><symbol id="24/comment" viewBox="0 0 24 24">
|
|
279
279
|
<path d="M7.61 10.093c-.693 0-1.254.57-1.254 1.247 0 .746.56 1.32 1.254 1.32s1.22-.572 1.22-1.284c0-.711-.522-1.283-1.22-1.283Zm4.39-.036c-.695 0-1.219.572-1.219 1.283 0 .712.559 1.247 1.22 1.247.66 0 1.219-.571 1.219-1.247 0-.675-.522-1.283-1.22-1.283Zm4.39.036c-.695 0-1.218.572-1.218 1.284 0 .711.558 1.283 1.219 1.283.696 0 1.254-.572 1.254-1.284 0-.713-.556-1.283-1.254-1.283ZM12 3c-5.542 0-9.999 3.734-9.999 8.34 0 1.91.78 3.66 2.074 5.065-.583 1.584-1.798 2.922-1.818 2.937a.982.982 0 0 0-.18 1.043.857.857 0 0 0 .83.615c2.41 0 4.276-1.032 5.452-1.855 1.132.361 2.358.572 3.642.572 5.542 0 9.999-3.734 9.999-8.304S17.543 3 12 3Zm0 14.792a9.952 9.952 0 0 1-3.071-.486l-.892-.286-.764.552a8.317 8.317 0 0 1-2.253 1.163 9.963 9.963 0 0 0 .779-1.614l.416-1.123-.808-.877c-.705-.773-1.557-2.052-1.557-3.745 0-3.538 3.654-6.415 8.118-6.415 4.463 0 8.118 2.877 8.118 6.415 0 3.54-3.585 6.416-8.085 6.416Z"/>
|
|
280
280
|
</symbol><symbol id="24/compass" viewBox="0 0 24 24">
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
</symbol><symbol id="24/user" viewBox="0 0 24 24">
|
|
379
379
|
<path d="M13.714 13.688h-3.428C6.814 13.688 4 16.457 4 19.875 4 20.496 4.512 21 5.143 21h13.714c.631 0 1.143-.504 1.143-1.125 0-3.417-2.814-6.188-6.286-6.188ZM5.75 19.311c.282-2.218 2.207-3.937 4.536-3.937h3.428c2.327 0 4.254 1.72 4.536 3.938H5.75ZM12 12c2.525 0 4.571-2.015 4.571-4.5S14.525 3 12 3 7.429 5.015 7.429 7.5C7.429 9.986 9.475 12 12 12Zm0-7.313c1.575 0 2.857 1.262 2.857 2.813 0 1.55-1.282 2.813-2.857 2.813-1.575 0-2.857-1.263-2.857-2.813 0-1.55 1.282-2.813 2.857-2.813Z"/>
|
|
380
380
|
</symbol><symbol id="24/wave-sine" viewBox="0 0 24 24">
|
|
381
|
-
<path d="
|
|
381
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.913 11.966a.956.956 0 0 0 .584.43.949.949 0 0 0 .264.035c.308 0 .762-.148.922-.614.299-.869.828-1.948 1.493-2.807.674-.87 1.446-1.46 2.224-1.46.848 0 1.534.575 2.14 1.492.603.913 1.09 2.113 1.556 3.261l.003.007c.545 1.345 1.14 2.81 1.976 3.938.845 1.137 1.954 1.952 3.525 1.952 1.812 0 3.159-1.272 4.06-2.558a12.676 12.676 0 0 0 1.495-2.936.8.8 0 0 0-.066-.67l-.001-.002a.951.951 0 0 0-.586-.43.95.95 0 0 0-.259-.034c-.31 0-.766.147-.926.613-.299.868-.828 1.948-1.493 2.807-.674.87-1.446 1.46-2.224 1.46-.848 0-1.534-.575-2.14-1.492-.603-.913-1.09-2.113-1.556-3.261l-.003-.007c-.545-1.345-1.139-2.81-1.976-3.938C10.08 6.615 8.97 5.8 7.4 5.8c-1.811 0-3.158 1.272-4.059 2.558a12.738 12.738 0 0 0-1.496 2.935.8.8 0 0 0 .068.673Zm19.33-.196Z"/>
|
|
382
382
|
</symbol><symbol id="24/xmark" viewBox="0 0 24 24">
|
|
383
383
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.707 5.707a1 1 0 0 0-1.414-1.414L12 10.586 5.707 4.293a1 1 0 0 0-1.414 1.414L10.586 12l-6.293 6.293a1 1 0 1 0 1.414 1.414L12 13.414l6.293 6.293a1 1 0 0 0 1.414-1.414L13.414 12l6.293-6.293Z"/>
|
|
384
384
|
</symbol></svg>
|
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 @@
|
|
|
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
package/themes/dark.css
CHANGED
package/themes/light.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
102
|
+
* Generated on Tue, 12 Oct 2021 11:20:44 GMT
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
105
|
|
package/tooltip/tooltip.js
CHANGED
|
@@ -22,8 +22,7 @@ export const Tooltip = ({ children, trigger, placement = 'bottom-start', show, s
|
|
|
22
22
|
strategy: 'fixed'
|
|
23
23
|
});
|
|
24
24
|
const { focusWithinProps } = useFocusWithin({
|
|
25
|
-
onFocusWithin: (
|
|
26
|
-
console.log(e);
|
|
25
|
+
onFocusWithin: () => {
|
|
27
26
|
setControlledVisible(true);
|
|
28
27
|
},
|
|
29
28
|
onBlurWithin: () => {
|