@wonderflow/react-components 2.40.0-next.2 → 3.0.0-next.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/modal/modal.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { useUIDSeed } from 'react-uid';
3
- import { LazyMotion, domAnimation, m } from 'framer-motion';
3
+ import { motion } from 'framer-motion';
4
4
  import clsx from 'clsx';
5
5
  import { FocusOn } from 'react-focus-on';
6
6
  import { ModalContent } from './modal-content';
@@ -14,11 +14,10 @@ const ModalElement = forwardRef(({ children, className, overlayColor = 'dark', c
14
14
  visible,
15
15
  titleId: seedID('modal-title')
16
16
  } },
17
- React.createElement(ModalContext.Consumer, null, (ctx) => (React.createElement(LazyMotion, { features: domAnimation },
18
- React.createElement("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": ctx.titleId, className: clsx(ModalClass, className), ref: forwardedRef, ...otherProps },
19
- React.createElement(m.span, { key: seedID('modal-backdrop'), className: Backdrop, "data-overlay-color": overlayColor, initial: { opacity: 0 }, animate: { opacity: 0.95 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }),
20
- React.createElement(FocusOn, { onClickOutside: () => ctx.onClose(), onEscapeKey: ctx.onClose },
21
- React.createElement(m.div, { key: seedID('modal-container'), className: Container, initial: { scale: 0.98, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.98, opacity: 0 }, transition: { ease: 'easeOut', duration: 0.1 } }, children))))))));
17
+ React.createElement(ModalContext.Consumer, null, (ctx) => (React.createElement("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": ctx.titleId, className: clsx(ModalClass, className), ref: forwardedRef, ...otherProps },
18
+ React.createElement(motion.span, { key: seedID('modal-backdrop'), className: Backdrop, "data-overlay-color": overlayColor, initial: { opacity: 0 }, animate: { opacity: 0.95 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }),
19
+ React.createElement(FocusOn, { onClickOutside: () => ctx.onClose(), onEscapeKey: ctx.onClose },
20
+ React.createElement(motion.div, { key: seedID('modal-container'), className: Container, initial: { scale: 0.98, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.98, opacity: 0 }, transition: { ease: 'easeOut', duration: 0.1 } }, children)))))));
22
21
  });
23
22
  export const Modal = forwardRef(({ visible, ...otherProps }, forwardedRef) => {
24
23
  if (typeof visible === 'boolean') {
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.40.0-next.2",
4
+ "version": "3.0.0-next.4",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
@@ -9,7 +9,7 @@
9
9
  "access": "public"
10
10
  },
11
11
  "engines": {
12
- "node": ">=14.x.x",
12
+ "node": ">=14.x",
13
13
  "npm": ">=8.x.x"
14
14
  },
15
15
  "repository": {
@@ -62,16 +62,15 @@
62
62
  "@wonderflow/stylelint-config": "1.1.3",
63
63
  "@wonderflow/tokens": "1.3.7",
64
64
  "clsx": "1.1.1",
65
- "flat": "5.0.2",
66
65
  "framer-motion": "4.1.17",
67
66
  "postcss": "^8.4.5",
68
- "react": ">=17.0.2",
67
+ "react": "^17.0",
69
68
  "react-data-table-component": "7.4.5",
70
- "react-dom": ">=17.0.2",
69
+ "react-dom": "^17.0",
71
70
  "react-focus-on": "3.5.4",
72
71
  "react-loading-skeleton": "3.0.1",
73
72
  "react-masonry-css": "1.0.16",
74
- "react-paginate": "github:AdeleD/react-paginate",
73
+ "react-paginate": "8.1.0",
75
74
  "react-popper-tooltip": "4.3.1",
76
75
  "react-roving-tabindex": "3.1.1",
77
76
  "react-uid": "2.3.1",
@@ -81,8 +80,8 @@
81
80
  },
82
81
  "peerDependencies": {
83
82
  "postcss": "^8.4.5",
84
- "react": ">=17.0.2",
85
- "react-dom": ">=17.0.2"
83
+ "react": "^17.0",
84
+ "react-dom": "^17.0"
86
85
  },
87
86
  "devDependencies": {
88
87
  "@babel/core": "7.16.5",
@@ -100,7 +99,6 @@
100
99
  "@storybook/addons": "6.4.9",
101
100
  "@storybook/react": "6.4.9",
102
101
  "@storybook/theming": "6.4.9",
103
- "@types/flat": "5.0.2",
104
102
  "@types/react-dom": "17.0.11",
105
103
  "@typescript-eslint/eslint-plugin": "5.7.0",
106
104
  "@typescript-eslint/parser": "5.7.0",
package/text/text.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare type TextProps = {
7
7
  weight?: 'thin' | 'bold';
8
8
  maxWidth?: string;
9
9
  textAlign?: 'start' | 'center' | 'end';
10
+ responsive?: boolean;
10
11
  };
11
12
  declare type PolymorphicText = Polymorphic.ForwardRefComponent<'p', TextProps>;
12
13
  export declare const Text: PolymorphicText;
package/text/text.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { Text as TextClass } from './text.module.css';
3
3
  import clsx from 'clsx';
4
- export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p', style, ...otherProps }, forwardedRef) => {
4
+ export const Text = forwardRef(({ children, className, size, sentiment, dimmed, weight, maxWidth, textAlign = 'start', as: Wrapper = 'p', responsive = true, style, ...otherProps }, forwardedRef) => {
5
5
  const dynamicStyle = {
6
6
  '--maxW': maxWidth,
7
7
  '--tAlign': textAlign
8
8
  };
9
- return (React.createElement(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, className: clsx(TextClass, className), style: { ...dynamicStyle, ...style }, ...otherProps }, children));
9
+ return (React.createElement(Wrapper, { ref: forwardedRef, "data-text-size": size, "data-text-weight": weight, "data-text-sentiment": sentiment, "data-text-dimmed": dimmed, "data-text-responsive": responsive, className: clsx(TextClass, className), style: { ...dynamicStyle, ...style }, ...otherProps }, children));
10
10
  });
@@ -3,14 +3,10 @@
3
3
  .Text {
4
4
  line-height: 1.5;
5
5
  min-block-size: 0.01vh;
6
- font-size: var(--fs-min);
6
+ font-size: var(--fs-max);
7
7
  max-inline-size: var(--maxW, initial);
8
8
  text-align: var(--tAlign);
9
9
 
10
- @media (--from-small) {
11
- font-size: var(--fs-max);
12
- }
13
-
14
10
  /* Colors */
15
11
 
16
12
  &[data-text-dimmed='5'] {
@@ -45,14 +41,14 @@
45
41
 
46
42
  &[data-text-size='14'] {
47
43
  font-size: env(--font-size-14);
48
- line-height: 1.2;
44
+ line-height: env(--font-lh-small);
49
45
  }
50
46
 
51
47
  &[data-text-size='16'] {
52
48
  --fs-min: env(--font-size-14);
53
49
  --fs-max: env(--font-size-16);
54
50
 
55
- line-height: 1.2;
51
+ line-height: env(--font-lh-small);
56
52
  }
57
53
 
58
54
  &[data-text-size='18'] {
@@ -79,4 +75,13 @@
79
75
  &[data-text-weight='bold'] {
80
76
  font-weight: 600;
81
77
  }
78
+
79
+ /* Responsiveness */
80
+ &[data-text-responsive='true'] {
81
+ font-size: var(--fs-min);
82
+
83
+ @media (--from-small) {
84
+ font-size: var(--fs-max);
85
+ }
86
+ }
82
87
  }
package/themes/dark.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Tue, 14 Dec 2021 09:06:57 GMT
3
+ * Generated on Wed, 15 Dec 2021 11:09:41 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 Tue, 14 Dec 2021 09:06:57 GMT
3
+ * Generated on Wed, 15 Dec 2021 11:09:41 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 Tue, 14 Dec 2021 09:06:57 GMT
7
+ * Generated on Wed, 15 Dec 2021 11:09:41 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 Tue, 14 Dec 2021 09:06:57 GMT
54
+ * Generated on Wed, 15 Dec 2021 11:09:41 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 Tue, 14 Dec 2021 09:06:57 GMT
102
+ * Generated on Wed, 15 Dec 2021 11:09:41 GMT
103
103
  */
104
104
 
105
105
 
package/title/title.d.ts CHANGED
@@ -4,6 +4,7 @@ export declare type TitleProps = {
4
4
  lineHeight?: 'none' | 'small' | 'large';
5
5
  textAlign?: 'start' | 'center' | 'end';
6
6
  maxWidth?: string;
7
+ responsive?: boolean;
7
8
  };
8
9
  declare type PolymorphicTitle = Polymorphic.ForwardRefComponent<'span', TitleProps>;
9
10
  export declare const Title: PolymorphicTitle;
package/title/title.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import * as styles from './title.module.css';
3
3
  import clsx from 'clsx';
4
- export const Title = forwardRef(({ children, className, as: Wrapper = 'span', lineHeight = 'small', level = '1', textAlign = 'start', maxWidth, style, ...otherProps }, forwardedRef) => {
4
+ export const Title = forwardRef(({ children, className, as: Wrapper = 'span', lineHeight = 'small', level = '1', textAlign = 'start', maxWidth, responsive = true, style, ...otherProps }, forwardedRef) => {
5
5
  const computedLevel = level.match(/\d/g) ? `H${level}` : level.charAt(0).toUpperCase() + level.slice(1);
6
6
  const dynamicStyle = {
7
7
  '--maxW': maxWidth,
8
8
  '--tAlign': textAlign
9
9
  };
10
- return (React.createElement(Wrapper, { ref: forwardedRef, "data-title-line-height": lineHeight, className: clsx(styles.Title, styles[computedLevel], className), style: { ...dynamicStyle, ...style }, ...otherProps }, children));
10
+ return (React.createElement(Wrapper, { ref: forwardedRef, "data-title-line-height": lineHeight, "data-title-responsive": responsive, className: clsx(styles.Title, styles[computedLevel], className), style: { ...dynamicStyle, ...style }, ...otherProps }, children));
11
11
  });
@@ -8,15 +8,11 @@
8
8
  line-height: env(--font-lh-small);
9
9
  color: var(--heading-foreground);
10
10
  min-block-size: 0.01vh;
11
- font-size: var(--fs-min);
11
+ font-size: var(--fs-max);
12
12
  max-inline-size: var(--maxW, initial);
13
13
  text-align: var(--tAlign);
14
14
  overflow-wrap: break-word;
15
15
 
16
- @media (--from-small) {
17
- font-size: var(--fs-max);
18
- }
19
-
20
16
 
21
17
  &[data-title-line-height='small'] {
22
18
  --lh: 1.33;
@@ -79,4 +75,12 @@
79
75
 
80
76
  font-weight: 800;
81
77
  }
78
+
79
+ &[data-title-responsive='true'] {
80
+ font-size: var(--fs-min);
81
+
82
+ @media (--from-small) {
83
+ font-size: var(--fs-max);
84
+ }
85
+ }
82
86
  }