@wonderflow/react-components 2.40.0-next.1 → 3.0.0-next.3

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.1",
4
+ "version": "3.0.0-next.3",
5
5
  "author": "Wonderflow",
6
6
  "license": "MIT",
7
7
  "main": "index.js",
@@ -9,7 +9,8 @@
9
9
  "access": "public"
10
10
  },
11
11
  "engines": {
12
- "node": "16.x"
12
+ "node": ">=14.x",
13
+ "npm": ">=8.x.x"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -57,20 +58,19 @@
57
58
  },
58
59
  "dependencies": {
59
60
  "@react-aria/interactions": "3.7.0",
60
- "@wonderflow/eslint-config": "1.1.6",
61
- "@wonderflow/stylelint-config": "1.1.2",
62
- "@wonderflow/tokens": "1.3.6",
61
+ "@wonderflow/eslint-config": "1.1.7",
62
+ "@wonderflow/stylelint-config": "1.1.3",
63
+ "@wonderflow/tokens": "1.3.7",
63
64
  "clsx": "1.1.1",
64
- "flat": "5.0.2",
65
65
  "framer-motion": "4.1.17",
66
- "postcss": "8.4.5",
67
- "react": ">=17.0.2",
66
+ "postcss": "^8.4.5",
67
+ "react": "^17.0",
68
68
  "react-data-table-component": "7.4.5",
69
- "react-dom": ">=17.0.2",
69
+ "react-dom": "^17.0",
70
70
  "react-focus-on": "3.5.4",
71
71
  "react-loading-skeleton": "3.0.1",
72
72
  "react-masonry-css": "1.0.16",
73
- "react-paginate": "github:AdeleD/react-paginate",
73
+ "react-paginate": "8.1.0",
74
74
  "react-popper-tooltip": "4.3.1",
75
75
  "react-roving-tabindex": "3.1.1",
76
76
  "react-uid": "2.3.1",
@@ -79,11 +79,12 @@
79
79
  "type-fest": "2.8.0"
80
80
  },
81
81
  "peerDependencies": {
82
- "react": ">=17.0.2",
83
- "react-dom": ">=17.0.2"
82
+ "postcss": "^8.4.5",
83
+ "react": "^17.0",
84
+ "react-dom": "^17.0"
84
85
  },
85
86
  "devDependencies": {
86
- "@babel/core": "7.16.0",
87
+ "@babel/core": "7.16.5",
87
88
  "@commitlint/cli": "15.0.0",
88
89
  "@commitlint/config-conventional": "15.0.0",
89
90
  "@semantic-release/exec": "6.0.2",
@@ -98,11 +99,10 @@
98
99
  "@storybook/addons": "6.4.9",
99
100
  "@storybook/react": "6.4.9",
100
101
  "@storybook/theming": "6.4.9",
101
- "@types/flat": "5.0.2",
102
102
  "@types/react-dom": "17.0.11",
103
- "@typescript-eslint/eslint-plugin": "5.6.0",
104
- "@typescript-eslint/parser": "5.6.0",
105
- "@wonderflow/config": "1.6.2",
103
+ "@typescript-eslint/eslint-plugin": "5.7.0",
104
+ "@typescript-eslint/parser": "5.7.0",
105
+ "@wonderflow/config": "1.6.3",
106
106
  "babel-loader": "8.2.3",
107
107
  "commit-analyzer-fail-on-no-release": "1.0.0",
108
108
  "commitizen": "4.2.4",
@@ -110,6 +110,7 @@
110
110
  "cz-conventional-changelog": "3.3.0",
111
111
  "directory-tree": "3.0.1",
112
112
  "eslint": "7.32.0",
113
+ "eslint-plugin-react": "7.27.1",
113
114
  "fs-extra": "10.0.0",
114
115
  "husky": "7.0.4",
115
116
  "is-ci": "3.0.1",
@@ -123,7 +124,7 @@
123
124
  "stylelint": "14.1.0",
124
125
  "svgo": "2.8.0",
125
126
  "svgstore": "3.0.1",
126
- "typescript": "4.5.3",
127
+ "typescript": "4.5.4",
127
128
  "typescript-plugin-css-modules": "3.4.0",
128
129
  "yargs": "17.3.0"
129
130
  },
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
  });
@@ -1,16 +1,15 @@
1
1
  @import '../core/media.css';
2
2
 
3
3
  .Text {
4
+ --fs-min: env(--font-size-16);
5
+ --fs-max: env(--font-size-18);
6
+
4
7
  line-height: 1.5;
5
8
  min-block-size: 0.01vh;
6
- font-size: var(--fs-min);
9
+ font-size: var(--fs-max);
7
10
  max-inline-size: var(--maxW, initial);
8
11
  text-align: var(--tAlign);
9
12
 
10
- @media (--from-small) {
11
- font-size: var(--fs-max);
12
- }
13
-
14
13
  /* Colors */
15
14
 
16
15
  &[data-text-dimmed='5'] {
@@ -45,14 +44,14 @@
45
44
 
46
45
  &[data-text-size='14'] {
47
46
  font-size: env(--font-size-14);
48
- line-height: 1.2;
47
+ line-height: env(--font-lh-small);
49
48
  }
50
49
 
51
50
  &[data-text-size='16'] {
52
51
  --fs-min: env(--font-size-14);
53
52
  --fs-max: env(--font-size-16);
54
53
 
55
- line-height: 1.2;
54
+ line-height: env(--font-lh-small);
56
55
  }
57
56
 
58
57
  &[data-text-size='18'] {
@@ -79,4 +78,13 @@
79
78
  &[data-text-weight='bold'] {
80
79
  font-weight: 600;
81
80
  }
81
+
82
+ /* Responsiveness */
83
+ &[data-text-responsive='true'] {
84
+ font-size: var(--fs-min);
85
+
86
+ @media (--from-small) {
87
+ font-size: var(--fs-max);
88
+ }
89
+ }
82
90
  }
package/themes/dark.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Mon, 13 Dec 2021 16:40:16 GMT
3
+ * Generated on Wed, 15 Dec 2021 10:20:47 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 Mon, 13 Dec 2021 16:40:16 GMT
3
+ * Generated on Wed, 15 Dec 2021 10:20:47 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 Mon, 13 Dec 2021 16:40:16 GMT
7
+ * Generated on Wed, 15 Dec 2021 10:20:47 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 Mon, 13 Dec 2021 16:40:16 GMT
54
+ * Generated on Wed, 15 Dec 2021 10:20:47 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 Mon, 13 Dec 2021 16:40:16 GMT
102
+ * Generated on Wed, 15 Dec 2021 10:20:47 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
  }