@pareto-engineering/design-system 4.0.0-alpha.64 → 4.0.0-alpha.65

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.
Files changed (44) hide show
  1. package/dist/cjs/f/common/Description/Description.js +5 -6
  2. package/dist/cjs/f/common/Label/Label.js +5 -7
  3. package/dist/cjs/f/fields/Checkbox/Checkbox.js +4 -9
  4. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +3 -6
  5. package/dist/cjs/f/fields/EditorInput/EditorInput.js +7 -4
  6. package/dist/cjs/f/fields/LinkInput/LinkInput.js +3 -7
  7. package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +6 -4
  8. package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +4 -2
  9. package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +4 -2
  10. package/dist/cjs/f/fields/QueryCombobox/styles.scss +37 -31
  11. package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +6 -4
  12. package/dist/cjs/f/fields/SelectInput/SelectInput.js +3 -5
  13. package/dist/cjs/f/fields/TextInput/TextInput.js +3 -7
  14. package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +3 -5
  15. package/dist/es/f/common/Description/Description.js +1 -4
  16. package/dist/es/f/common/Label/Label.js +7 -14
  17. package/dist/es/f/fields/Checkbox/Checkbox.js +1 -5
  18. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +25 -30
  19. package/dist/es/f/fields/EditorInput/EditorInput.js +2 -4
  20. package/dist/es/f/fields/LinkInput/LinkInput.js +2 -4
  21. package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +2 -4
  22. package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +4 -2
  23. package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +4 -2
  24. package/dist/es/f/fields/QueryCombobox/styles.scss +37 -31
  25. package/dist/es/f/fields/RatingsInput/RatingsInput.js +2 -5
  26. package/dist/es/f/fields/SelectInput/SelectInput.js +2 -4
  27. package/dist/es/f/fields/TextInput/TextInput.js +2 -4
  28. package/dist/es/f/fields/TextareaInput/TextareaInput.js +2 -4
  29. package/package.json +3 -3
  30. package/src/ui/f/common/Description/Description.jsx +2 -6
  31. package/src/ui/f/common/Label/Label.jsx +19 -27
  32. package/src/ui/f/fields/Checkbox/Checkbox.jsx +1 -6
  33. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +39 -44
  34. package/src/ui/f/fields/EditorInput/EditorInput.jsx +3 -5
  35. package/src/ui/f/fields/LinkInput/LinkInput.jsx +3 -5
  36. package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +3 -5
  37. package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +8 -6
  38. package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +15 -12
  39. package/src/ui/f/fields/QueryCombobox/styles.scss +37 -31
  40. package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +2 -5
  41. package/src/ui/f/fields/SelectInput/SelectInput.jsx +3 -5
  42. package/src/ui/f/fields/TextInput/TextInput.jsx +3 -5
  43. package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +3 -5
  44. package/tests/__snapshots__/Storyshots.test.js.snap +609 -8434
@@ -1,7 +1,7 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { useInsertionEffect, memo } from 'react';
4
+ import { memo } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import styleNames from '@pareto-engineering/bem/exports';
7
7
 
@@ -9,6 +9,7 @@ import styleNames from '@pareto-engineering/bem/exports';
9
9
 
10
10
  import { Choice } from "./common";
11
11
  import { FormDescription, FormLabel } from "../../common";
12
+ import "./styles.scss";
12
13
  const baseClassName = styleNames.base;
13
14
  const componentClassName = 'choices-input';
14
15
 
@@ -31,35 +32,29 @@ const ChoicesInput = ({
31
32
  description,
32
33
  spaceBetween,
33
34
  ...otherProps
34
- }) => {
35
- useInsertionEffect(() => {
36
- import("./styles.scss");
37
- }, []);
38
- return /*#__PURE__*/React.createElement("div", {
39
- id: id,
40
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
41
- style: style
42
- }, label && /*#__PURE__*/React.createElement(FormLabel, {
43
- name: name,
44
- color: labelColor,
45
- optional: optional
46
- // {...otherProps}
47
- }, label), /*#__PURE__*/React.createElement("div", {
48
- className: ['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')
49
- }, options.map(choice => /*#__PURE__*/React.createElement(Choice, _extends({
50
- className: `x-${color}`,
51
- key: choice.value,
52
- name: name,
53
- id: `${name}-${choice.value}`,
54
- multiple: multiple,
55
- validate: validate,
56
- disabled: disabled
57
- }, otherProps, choice)))), /*#__PURE__*/React.createElement(FormDescription, {
58
- className: "s-1",
59
- description: description,
60
- name: name
61
- }));
62
- };
35
+ }) => /*#__PURE__*/React.createElement("div", {
36
+ id: id,
37
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
38
+ style: style
39
+ }, label && /*#__PURE__*/React.createElement(FormLabel, {
40
+ name: name,
41
+ color: labelColor,
42
+ optional: optional
43
+ }, label), /*#__PURE__*/React.createElement("div", {
44
+ className: ['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')
45
+ }, options.map(choice => /*#__PURE__*/React.createElement(Choice, _extends({
46
+ className: `x-${color}`,
47
+ key: choice.value,
48
+ name: name,
49
+ id: `${name}-${choice.value}`,
50
+ multiple: multiple,
51
+ validate: validate,
52
+ disabled: disabled
53
+ }, otherProps, choice)))), /*#__PURE__*/React.createElement(FormDescription, {
54
+ className: "s-1",
55
+ description: description,
56
+ name: name
57
+ }));
63
58
  ChoicesInput.propTypes = {
64
59
  /**
65
60
  * The HTML id for this element
@@ -1,7 +1,7 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  /* eslint-disable import/no-extraneous-dependencies -- required here */
3
3
  import * as React from 'react';
4
- import { useInsertionEffect, memo } from 'react';
4
+ import { memo } from 'react';
5
5
  import { useFormikContext } from 'formik';
6
6
  import { LexicalComposer } from '@lexical/react/LexicalComposer';
7
7
  import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
@@ -20,6 +20,7 @@ import styleNames from '@pareto-engineering/bem/exports';
20
20
 
21
21
  import { FormLabel, FormDescription } from "../../common";
22
22
  import { Toolbar, TreeViewPlugin } from "./common";
23
+ import "./styles.scss";
23
24
  const baseClassName = styleNames.base;
24
25
  const componentClassName = 'editor-input';
25
26
 
@@ -43,9 +44,6 @@ const EditorInput = ({
43
44
  showDebugger
44
45
  // ...otherProps
45
46
  }) => {
46
- useInsertionEffect(() => {
47
- import("./styles.scss");
48
- }, []);
49
47
  const formik = useFormikContext();
50
48
  const setInitialValue = () => {
51
49
  const value = formik.values[name];
@@ -1,7 +1,7 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { useInsertionEffect, memo } from 'react';
4
+ import { memo } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import styleNames from '@pareto-engineering/bem/exports';
7
7
  import { useField } from 'formik';
@@ -9,6 +9,7 @@ import { FormLabel, FormDescription } from "../../common";
9
9
 
10
10
  // Local Definitions
11
11
 
12
+ import "./styles.scss";
12
13
  const baseClassName = styleNames.base;
13
14
  const componentClassName = 'link-input';
14
15
 
@@ -31,9 +32,6 @@ const LinkInput = ({
31
32
  autoComplete
32
33
  // ...otherProps
33
34
  }) => {
34
- useInsertionEffect(() => {
35
- import("./styles.scss");
36
- }, []);
37
35
  const [field] = useField({
38
36
  name,
39
37
  validate
@@ -1,12 +1,13 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react';
3
- import { useState, useInsertionEffect } from 'react';
3
+ import { useState } from 'react';
4
4
  import { useField } from 'formik';
5
5
  import { useRelayEnvironment, fetchQuery } from 'react-relay';
6
6
  import PropTypes from 'prop-types';
7
7
 
8
8
  // Local Definitions
9
9
 
10
+ import "./styles.scss";
10
11
  import { Combobox, MultipleCombobox } from "./common";
11
12
 
12
13
  /**
@@ -36,9 +37,6 @@ const QueryCombobox = ({
36
37
  promptCreateNewOption
37
38
  // ...otherProps
38
39
  }) => {
39
- useInsertionEffect(() => {
40
- import("./styles.scss");
41
- }, []);
42
40
  const [, meta, helpers] = useField({
43
41
  name,
44
42
  validate
@@ -103,7 +103,9 @@ const Combobox = ({
103
103
  name: name,
104
104
  optional: optional,
105
105
  color: labelColor
106
- }), label), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(), {
106
+ }), label), /*#__PURE__*/React.createElement("div", {
107
+ className: "input-container"
108
+ }, /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(), {
107
109
  className: "input",
108
110
  disabled: disabled,
109
111
  placeholder: placeholder
@@ -116,7 +118,7 @@ const Combobox = ({
116
118
  onClick: resetInputValue
117
119
  }, /*#__PURE__*/React.createElement("span", {
118
120
  className: "icon"
119
- }, "Y")), /*#__PURE__*/React.createElement(FormDescription, {
121
+ }, "Y"))), /*#__PURE__*/React.createElement(FormDescription, {
120
122
  className: "s-1",
121
123
  description: description,
122
124
  name: name
@@ -181,7 +181,9 @@ const MultipleCombobox = ({
181
181
  color: color
182
182
  }, /*#__PURE__*/React.createElement("span", null, selectedItem.label), /*#__PURE__*/React.createElement("span", {
183
183
  className: "icon close"
184
- }, "Y"))))), /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(getDropdownProps({
184
+ }, "Y"))))), /*#__PURE__*/React.createElement("div", {
185
+ className: "input-container"
186
+ }, /*#__PURE__*/React.createElement("input", _extends({}, getInputProps(getDropdownProps({
185
187
  preventKeyAction: isOpen
186
188
  })), {
187
189
  className: "input",
@@ -196,7 +198,7 @@ const MultipleCombobox = ({
196
198
  onClick: resetInputValue
197
199
  }, /*#__PURE__*/React.createElement("span", {
198
200
  className: "icon"
199
- }, "Y")), /*#__PURE__*/React.createElement(FormDescription, {
201
+ }, "Y"))), /*#__PURE__*/React.createElement(FormDescription, {
200
202
  className: "s-1",
201
203
  description: description,
202
204
  name: name
@@ -23,7 +23,6 @@ $on-disabled-background: var(--on-background-inputs-30);
23
23
  display: flex;
24
24
  flex-direction: column;
25
25
  outline: none;
26
- position: relative;
27
26
 
28
27
  > .#{bem.$base}.form-label {
29
28
  margin-bottom: var(--gap);
@@ -60,45 +59,52 @@ $on-disabled-background: var(--on-background-inputs-30);
60
59
  }
61
60
  }
62
61
 
63
- >.#{bem.$base}.loading-circle,
64
- >.#{bem.$base}.button {
65
- position: absolute;
66
- right: $default-loading-circle-displacement;
67
- }
68
-
69
- >.#{bem.$base}.loading-circle {
70
- top: calc($default-loading-circle-displacement * 1.5);
71
- }
72
62
 
73
- >.#{bem.$base}.button {
74
- top: $default-loading-circle-displacement;
75
- }
63
+ > .input-container {
64
+ position: relative;
76
65
 
77
- > .input {
78
- background: $default-background;
79
- border: $default-border;
80
- border-radius: calc(var(--theme-default-border-radius) / 2);
81
- color: $on-default-background;
82
- outline: none;
83
- padding: $default-input-padding;
66
+ >.#{bem.$base}.loading-circle,
67
+ >.#{bem.$base}.button {
68
+ position: absolute;
69
+ right: $default-loading-circle-displacement;
70
+ }
84
71
 
85
- &::placeholder {
86
- color: var(--metadata);
72
+ >.#{bem.$base}.loading-circle {
73
+ top: calc($default-loading-circle-displacement * 1.5);
87
74
  }
88
75
 
89
- &:disabled {
90
- background-color: $disabled-background;
91
- color: $on-disabled-background;
76
+ >.#{bem.$base}.button {
77
+ top: $default-loading-circle-displacement;
92
78
  }
93
79
 
94
- &:not(:disabled) {
95
- &:hover,
96
- &:active {
97
- border: $hover-border;
80
+
81
+ > .input {
82
+ background: $default-background;
83
+ border: $default-border;
84
+ border-radius: calc(var(--theme-default-border-radius) / 2);
85
+ color: $on-default-background;
86
+ outline: none;
87
+ padding: $default-input-padding;
88
+ width: 100%;
89
+
90
+ &::placeholder {
91
+ color: var(--metadata);
92
+ }
93
+
94
+ &:disabled {
95
+ background-color: $disabled-background;
96
+ color: $on-disabled-background;
98
97
  }
99
98
 
100
- &:focus {
101
- border: $focus-border;
99
+ &:not(:disabled) {
100
+ &:hover,
101
+ &:active {
102
+ border: $hover-border;
103
+ }
104
+
105
+ &:focus {
106
+ border: $focus-border;
107
+ }
102
108
  }
103
109
  }
104
110
  }
@@ -1,11 +1,11 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react';
3
- import { useState, useInsertionEffect, memo } from 'react';
3
+ import { useState, memo } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import styleNames from '@pareto-engineering/bem/exports';
6
6
 
7
7
  // Local Definitions
8
-
8
+ import "./styles.scss";
9
9
  import { Rating } from "./common";
10
10
  import { FormLabel } from "../../common";
11
11
  const baseClassName = styleNames.base;
@@ -30,9 +30,6 @@ const RatingsInput = ({
30
30
  optional
31
31
  // ...otherProps
32
32
  }) => {
33
- useInsertionEffect(() => {
34
- import("./styles.scss");
35
- }, []);
36
33
  const [hover, setHover] = useState(null);
37
34
  return /*#__PURE__*/React.createElement("div", {
38
35
  id: id,
@@ -1,12 +1,13 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { useInsertionEffect, memo } from 'react';
4
+ import { memo } from 'react';
5
5
  import { useField } from 'formik';
6
6
  import PropTypes from 'prop-types';
7
7
  import styleNames from '@pareto-engineering/bem/exports';
8
8
  import { LoadingCircle } from "../../../a";
9
9
  import { FormLabel, FormDescription } from "../../common";
10
+ import "./styles.scss";
10
11
 
11
12
  // Local Definitions
12
13
 
@@ -33,9 +34,6 @@ const SelectInput = ({
33
34
  autoComplete
34
35
  // ...otherProps
35
36
  }) => {
36
- useInsertionEffect(() => {
37
- import("./styles.scss");
38
- }, []);
39
37
  const [field] = useField({
40
38
  name,
41
39
  validate
@@ -1,7 +1,7 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { useInsertionEffect, memo } from 'react';
4
+ import { memo } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import styleNames from '@pareto-engineering/bem/exports';
7
7
  import { useField } from 'formik';
@@ -9,6 +9,7 @@ import { FormLabel, FormDescription } from "../../common";
9
9
 
10
10
  // Local Definitions
11
11
 
12
+ import "./styles.scss";
12
13
  const baseClassName = styleNames.base;
13
14
  const componentClassName = 'text-input';
14
15
 
@@ -33,9 +34,6 @@ const TextInput = ({
33
34
  symbol,
34
35
  ...otherProps
35
36
  }) => {
36
- useInsertionEffect(() => {
37
- import("./styles.scss");
38
- }, []);
39
37
  const [field] = useField({
40
38
  name,
41
39
  validate
@@ -1,13 +1,14 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
  /* @pareto-engineering/generator-front 1.0.12 */
3
3
  import * as React from 'react';
4
- import { useInsertionEffect, memo } from 'react';
4
+ import { memo } from 'react';
5
5
  import PropTypes from 'prop-types';
6
6
  import styleNames from '@pareto-engineering/bem/exports';
7
7
  import { useField } from 'formik';
8
8
 
9
9
  // Local Definitions
10
10
 
11
+ import "./styles.scss";
11
12
  import { FormLabel, FormDescription } from "../../common";
12
13
  const baseClassName = styleNames.base;
13
14
  const componentClassName = 'text-area-input';
@@ -33,9 +34,6 @@ const TextareaInput = ({
33
34
  resize
34
35
  // ...otherProps
35
36
  }) => {
36
- useInsertionEffect(() => {
37
- import("./styles.scss");
38
- }, []);
39
37
  const [field] = useField({
40
38
  name,
41
39
  validate
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "4.0.0-alpha.64",
3
+ "version": "4.0.0-alpha.65",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@lexical/react": "^0.11.3",
54
- "@pareto-engineering/assets": "^4.0.0-alpha.63",
54
+ "@pareto-engineering/assets": "^4.0.0-alpha.65",
55
55
  "@pareto-engineering/bem": "^4.0.0-alpha.20",
56
56
  "@pareto-engineering/styles": "^4.0.0-alpha.57",
57
57
  "@pareto-engineering/utils": "^4.0.0-alpha.46",
@@ -71,5 +71,5 @@
71
71
  "relay-test-utils": "^15.0.0"
72
72
  },
73
73
  "browserslist": "> 2%",
74
- "gitHead": "2664d428449c22570d89c6c4f9e6d65e3c1d51c1"
74
+ "gitHead": "daa9532989bb08c3a7adfa33d2356499c27333e2"
75
75
  }
@@ -1,8 +1,6 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { useInsertionEffect } from 'react'
5
-
6
4
  import { useField } from 'formik'
7
5
 
8
6
  import PropTypes from 'prop-types'
@@ -11,6 +9,8 @@ import styleNames from '@pareto-engineering/bem/exports'
11
9
 
12
10
  // Local Definitions
13
11
 
12
+ import './styles.scss'
13
+
14
14
  const baseClassName = styleNames.base
15
15
 
16
16
  const componentClassName = 'description'
@@ -27,10 +27,6 @@ const Description = ({
27
27
  color,
28
28
  // ...otherProps
29
29
  }) => {
30
- useInsertionEffect(() => {
31
- import('./styles.scss')
32
- }, [])
33
-
34
30
  const [, meta] = useField(name)
35
31
  const hasError = meta.touched && meta.error
36
32
 
@@ -1,13 +1,12 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { useInsertionEffect } from 'react'
5
-
6
4
  import PropTypes from 'prop-types'
7
5
 
8
6
  import styleNames from '@pareto-engineering/bem/exports'
9
7
 
10
8
  // Local Definitions
9
+ import './styles.scss'
11
10
 
12
11
  const baseClassName = styleNames.base
13
12
 
@@ -26,31 +25,24 @@ const Label = ({
26
25
  optional,
27
26
  as:Wrapper,
28
27
  // ...otherProps
29
- }) => {
30
- useInsertionEffect(() => {
31
- import('./styles.scss')
32
- }, [])
33
-
34
- return (
35
- <Wrapper
36
- htmlFor={Wrapper === 'label' ? name : undefined}
37
- id={id}
38
- className={[
39
- baseClassName,
40
- componentClassName,
41
- userClassName,
42
- `x-${color}`,
43
- ]
44
- .filter((e) => e)
45
- .join(' ')}
46
- style={style}
47
- // {...otherProps}
48
- >
49
- {children}
50
- {optional && ' (Optional)'}
51
- </Wrapper>
52
- )
53
- }
28
+ }) => (
29
+ <Wrapper
30
+ htmlFor={Wrapper === 'label' ? name : undefined}
31
+ id={id}
32
+ className={[
33
+ baseClassName,
34
+ componentClassName,
35
+ userClassName,
36
+ `x-${color}`,
37
+ ]
38
+ .filter((e) => e)
39
+ .join(' ')}
40
+ style={style}
41
+ >
42
+ {children}
43
+ {optional && ' (Optional)'}
44
+ </Wrapper>
45
+ )
54
46
 
55
47
  Label.propTypes = {
56
48
  /**
@@ -1,8 +1,6 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { useInsertionEffect } from 'react'
5
-
6
4
  import PropTypes from 'prop-types'
7
5
 
8
6
  import styleNames from '@pareto-engineering/bem/exports'
@@ -12,6 +10,7 @@ import { useField } from 'formik'
12
10
  import { FormLabel, FormDescription } from '../../common'
13
11
 
14
12
  // Local Definitions
13
+ import './styles.scss'
15
14
 
16
15
  const baseClassName = styleNames.base
17
16
 
@@ -32,10 +31,6 @@ const Checkbox = ({
32
31
  labelColor,
33
32
  // ...otherProps
34
33
  }) => {
35
- useInsertionEffect(() => {
36
- import('./styles.scss')
37
- }, [])
38
-
39
34
  const [field] = useField({ name, type: 'checkbox' })
40
35
 
41
36
  return (
@@ -1,7 +1,7 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { useInsertionEffect, memo } from 'react'
4
+ import { memo } from 'react'
5
5
 
6
6
  import PropTypes from 'prop-types'
7
7
 
@@ -13,6 +13,8 @@ import { Choice } from './common'
13
13
 
14
14
  import { FormDescription, FormLabel } from '../../common'
15
15
 
16
+ import './styles.scss'
17
+
16
18
  const baseClassName = styleNames.base
17
19
 
18
20
  const componentClassName = 'choices-input'
@@ -36,52 +38,45 @@ const ChoicesInput = ({
36
38
  description,
37
39
  spaceBetween,
38
40
  ...otherProps
39
- }) => {
40
- useInsertionEffect(() => {
41
- import('./styles.scss')
42
- }, [])
43
-
44
- return (
45
- <div
46
- id={id}
47
- className={[
48
- baseClassName,
49
- componentClassName,
50
- userClassName,
51
- ]
52
- .filter((e) => e)
53
- .join(' ')}
54
- style={style}
41
+ }) => (
42
+ <div
43
+ id={id}
44
+ className={[
45
+ baseClassName,
46
+ componentClassName,
47
+ userClassName,
48
+ ]
49
+ .filter((e) => e)
50
+ .join(' ')}
51
+ style={style}
52
+ >
53
+ {label && (
54
+ <FormLabel
55
+ name={name}
56
+ color={labelColor}
57
+ optional={optional}
55
58
  >
56
- {label && (
57
- <FormLabel
59
+ {label}
60
+ </FormLabel>
61
+ )}
62
+ <div className={['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')}>
63
+ { options.map((choice) => (
64
+ <Choice
65
+ className={`x-${color}`}
66
+ key={choice.value}
58
67
  name={name}
59
- color={labelColor}
60
- optional={optional}
61
- // {...otherProps}
62
- >
63
- {label}
64
- </FormLabel>
65
- )}
66
- <div className={['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')}>
67
- { options.map((choice) => (
68
- <Choice
69
- className={`x-${color}`}
70
- key={choice.value}
71
- name={name}
72
- id={`${name}-${choice.value}`}
73
- multiple={multiple}
74
- validate={validate}
75
- disabled={disabled}
76
- {...otherProps}
77
- {...choice}
78
- />
79
- ))}
80
- </div>
81
- <FormDescription className="s-1" description={description} name={name} />
68
+ id={`${name}-${choice.value}`}
69
+ multiple={multiple}
70
+ validate={validate}
71
+ disabled={disabled}
72
+ {...otherProps}
73
+ {...choice}
74
+ />
75
+ ))}
82
76
  </div>
83
- )
84
- }
77
+ <FormDescription className="s-1" description={description} name={name} />
78
+ </div>
79
+ )
85
80
 
86
81
  ChoicesInput.propTypes = {
87
82
  /**
@@ -1,7 +1,7 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  /* eslint-disable import/no-extraneous-dependencies -- required here */
3
3
  import * as React from 'react'
4
- import { useInsertionEffect, memo } from 'react'
4
+ import { memo } from 'react'
5
5
  import { useFormikContext } from 'formik'
6
6
  import { LexicalComposer } from '@lexical/react/LexicalComposer'
7
7
  import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
@@ -22,6 +22,8 @@ import styleNames from '@pareto-engineering/bem/exports'
22
22
  import { FormLabel, FormDescription } from '../../common'
23
23
  import { Toolbar, TreeViewPlugin } from './common'
24
24
 
25
+ import './styles.scss'
26
+
25
27
  const baseClassName = styleNames.base
26
28
  const componentClassName = 'editor-input'
27
29
 
@@ -45,10 +47,6 @@ const EditorInput = ({
45
47
  showDebugger,
46
48
  // ...otherProps
47
49
  }) => {
48
- useInsertionEffect(() => {
49
- import('./styles.scss')
50
- }, [])
51
-
52
50
  const formik = useFormikContext()
53
51
 
54
52
  const setInitialValue = () => {