@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
  /* @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 { FormLabel, FormDescription } from '../../common'
13
13
 
14
14
  // Local Definitions
15
15
 
16
+ import './styles.scss'
17
+
16
18
  const baseClassName = styleNames.base
17
19
 
18
20
  const componentClassName = 'link-input'
@@ -36,10 +38,6 @@ const LinkInput = ({
36
38
  autoComplete,
37
39
  // ...otherProps
38
40
  }) => {
39
- useInsertionEffect(() => {
40
- import('./styles.scss')
41
- }, [])
42
-
43
41
  const [field] = useField({ name, validate })
44
42
 
45
43
  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 { useState, useInsertionEffect } from 'react'
4
+ import { useState } from 'react'
5
5
 
6
6
  import { useField } from 'formik'
7
7
 
@@ -11,6 +11,8 @@ import PropTypes from 'prop-types'
11
11
 
12
12
  // Local Definitions
13
13
 
14
+ import './styles.scss'
15
+
14
16
  import { Combobox, MultipleCombobox } from './common'
15
17
 
16
18
  /**
@@ -40,10 +42,6 @@ const QueryCombobox = ({
40
42
  promptCreateNewOption,
41
43
  // ...otherProps
42
44
  }) => {
43
- useInsertionEffect(() => {
44
- import('./styles.scss')
45
- }, [])
46
-
47
45
  const [, meta, helpers] = useField({ name, validate })
48
46
 
49
47
  const { setValue, setError } = helpers
@@ -125,17 +125,19 @@ const Combobox = ({
125
125
  >
126
126
  {label}
127
127
  </FormLabel>
128
- <input {...getInputProps()} className="input" disabled={disabled} placeholder={placeholder} />
129
- {isFetching && (
130
- <LoadingCircle className="x-main" />
131
- )}
132
- {inputValue.length > minLength && !isFetching && (
128
+ <div className="input-container">
129
+ <input {...getInputProps()} className="input" disabled={disabled} placeholder={placeholder} />
130
+ {isFetching && (
131
+ <LoadingCircle className="x-main" />
132
+ )}
133
+ {inputValue.length > minLength && !isFetching && (
133
134
  <Button isSimple isCompact color="heading" onClick={resetInputValue}>
134
135
  <span className="icon">
135
136
  Y
136
137
  </span>
137
138
  </Button>
138
- )}
139
+ )}
140
+ </div>
139
141
  <FormDescription className="s-1" description={description} name={name} />
140
142
  <Popover
141
143
  isOpen={isOpen}
@@ -215,18 +215,20 @@ const MultipleCombobox = ({
215
215
  ))}
216
216
  </div>
217
217
  )}
218
- <input
219
- {...getInputProps(
220
- getDropdownProps({ preventKeyAction: isOpen }),
218
+
219
+ <div className="input-container">
220
+ <input
221
+ {...getInputProps(
222
+ getDropdownProps({ preventKeyAction: isOpen }),
223
+ )}
224
+ className="input"
225
+ disabled={disabled}
226
+ placeholder={placeholder}
227
+ />
228
+ {isFetching && (
229
+ <LoadingCircle className="x-main" />
221
230
  )}
222
- className="input"
223
- disabled={disabled}
224
- placeholder={placeholder}
225
- />
226
- {isFetching && (
227
- <LoadingCircle className="x-main" />
228
- )}
229
- {inputValue.length > minLength && !isFetching && (
231
+ {inputValue.length > minLength && !isFetching && (
230
232
  <Button
231
233
  isSimple
232
234
  isCompact
@@ -237,7 +239,8 @@ const MultipleCombobox = ({
237
239
  Y
238
240
  </span>
239
241
  </Button>
240
- )}
242
+ )}
243
+ </div>
241
244
 
242
245
  <FormDescription className="s-1" description={description} name={name} />
243
246
  <Popover
@@ -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,13 +1,14 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  import * as React from 'react'
3
3
 
4
- import { useState, useInsertionEffect, memo } from 'react'
4
+ import { useState, memo } from 'react'
5
5
 
6
6
  import PropTypes from 'prop-types'
7
7
 
8
8
  import styleNames from '@pareto-engineering/bem/exports'
9
9
 
10
10
  // Local Definitions
11
+ import './styles.scss'
11
12
 
12
13
  import { Rating } from './common'
13
14
  import { FormLabel } from '../../common'
@@ -35,10 +36,6 @@ const RatingsInput = ({
35
36
  optional,
36
37
  // ...otherProps
37
38
  }) => {
38
- useInsertionEffect(() => {
39
- import('./styles.scss')
40
- }, [])
41
-
42
39
  const [hover, setHover] = useState(null)
43
40
 
44
41
  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 { useField } from 'formik'
7
7
 
@@ -13,6 +13,8 @@ import { LoadingCircle } from 'ui/a'
13
13
 
14
14
  import { FormLabel, FormDescription } from '../../common'
15
15
 
16
+ import './styles.scss'
17
+
16
18
  // Local Definitions
17
19
 
18
20
  const baseClassName = styleNames.base
@@ -39,10 +41,6 @@ const SelectInput = ({
39
41
  autoComplete,
40
42
  // ...otherProps
41
43
  }) => {
42
- useInsertionEffect(() => {
43
- import('./styles.scss')
44
- }, [])
45
-
46
44
  const [field] = useField({ name, validate })
47
45
 
48
46
  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 { FormLabel, FormDescription } from '../../common'
13
13
 
14
14
  // Local Definitions
15
15
 
16
+ import './styles.scss'
17
+
16
18
  const baseClassName = styleNames.base
17
19
 
18
20
  const componentClassName = 'text-input'
@@ -38,10 +40,6 @@ const TextInput = ({
38
40
  symbol,
39
41
  ...otherProps
40
42
  }) => {
41
- useInsertionEffect(() => {
42
- import('./styles.scss')
43
- }, [])
44
-
45
43
  const [field] = useField({ name, validate })
46
44
  const symbolStyle = symbol
47
45
  ? { '--symbol': symbol }
@@ -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
 
@@ -11,6 +11,8 @@ import { useField } from 'formik'
11
11
 
12
12
  // Local Definitions
13
13
 
14
+ import './styles.scss'
15
+
14
16
  import { FormLabel, FormDescription } from '../../common'
15
17
 
16
18
  const baseClassName = styleNames.base
@@ -38,10 +40,6 @@ const TextareaInput = ({
38
40
  resize,
39
41
  // ...otherProps
40
42
  }) => {
41
- useInsertionEffect(() => {
42
- import('./styles.scss')
43
- }, [])
44
-
45
43
  const [field] = useField({ name, validate })
46
44
 
47
45
  return (