@pareto-engineering/design-system 4.0.0-alpha.73 → 4.0.0-alpha.75

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 (46) hide show
  1. package/dist/cjs/a/DatePicker/DatePicker.js +162 -0
  2. package/dist/cjs/a/DatePicker/index.js +13 -0
  3. package/dist/cjs/a/DatePicker/styles.scss +380 -0
  4. package/dist/cjs/a/XMLEditor/XMLEditor.js +5 -0
  5. package/dist/cjs/a/index.js +8 -1
  6. package/dist/cjs/f/fields/SelectInput/SelectInput.js +33 -42
  7. package/dist/cjs/f/fields/SelectInput/common/Menu/Menu.js +83 -0
  8. package/dist/cjs/f/fields/SelectInput/common/Menu/index.js +13 -0
  9. package/dist/cjs/f/fields/SelectInput/common/Multiple/Multiple.js +244 -0
  10. package/dist/cjs/f/fields/SelectInput/common/Multiple/index.js +13 -0
  11. package/dist/cjs/f/fields/SelectInput/common/Single/Single.js +104 -0
  12. package/dist/cjs/f/fields/SelectInput/common/Single/index.js +13 -0
  13. package/dist/cjs/f/fields/SelectInput/common/index.js +26 -0
  14. package/dist/cjs/f/fields/SelectInput/styles.scss +149 -45
  15. package/dist/es/a/DatePicker/DatePicker.js +154 -0
  16. package/dist/es/a/DatePicker/index.js +2 -0
  17. package/dist/es/a/DatePicker/styles.scss +380 -0
  18. package/dist/es/a/XMLEditor/XMLEditor.js +5 -0
  19. package/dist/es/a/index.js +2 -1
  20. package/dist/es/f/fields/SelectInput/SelectInput.js +31 -42
  21. package/dist/es/f/fields/SelectInput/common/Menu/Menu.js +73 -0
  22. package/dist/es/f/fields/SelectInput/common/Menu/index.js +2 -0
  23. package/dist/es/f/fields/SelectInput/common/Multiple/Multiple.js +235 -0
  24. package/dist/es/f/fields/SelectInput/common/Multiple/index.js +2 -0
  25. package/dist/es/f/fields/SelectInput/common/Single/Single.js +96 -0
  26. package/dist/es/f/fields/SelectInput/common/Single/index.js +2 -0
  27. package/dist/es/f/fields/SelectInput/common/index.js +3 -0
  28. package/dist/es/f/fields/SelectInput/styles.scss +149 -45
  29. package/package.json +3 -2
  30. package/src/stories/a/DatePicker.stories.jsx +88 -0
  31. package/src/stories/f/SelectInput.stories.jsx +15 -0
  32. package/src/ui/a/DatePicker/DatePicker.jsx +201 -0
  33. package/src/ui/a/DatePicker/index.js +2 -0
  34. package/src/ui/a/DatePicker/styles.scss +380 -0
  35. package/src/ui/a/XMLEditor/XMLEditor.jsx +6 -0
  36. package/src/ui/a/index.js +1 -0
  37. package/src/ui/f/fields/SelectInput/SelectInput.jsx +34 -47
  38. package/src/ui/f/fields/SelectInput/common/Menu/Menu.jsx +103 -0
  39. package/src/ui/f/fields/SelectInput/common/Menu/index.js +2 -0
  40. package/src/ui/f/fields/SelectInput/common/Multiple/Multiple.jsx +288 -0
  41. package/src/ui/f/fields/SelectInput/common/Multiple/index.js +2 -0
  42. package/src/ui/f/fields/SelectInput/common/Single/Single.jsx +125 -0
  43. package/src/ui/f/fields/SelectInput/common/Single/index.js +2 -0
  44. package/src/ui/f/fields/SelectInput/common/index.js +3 -0
  45. package/src/ui/f/fields/SelectInput/styles.scss +149 -45
  46. package/tests/__snapshots__/Storyshots.test.js.snap +7559 -398
@@ -0,0 +1,201 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { DayPicker } from 'react-day-picker'
5
+
6
+ import { format } from 'date-fns'
7
+
8
+ import PropTypes from 'prop-types'
9
+
10
+ import styleNames from '@pareto-engineering/bem/exports'
11
+
12
+ import './styles.scss'
13
+
14
+ // Local Definitions
15
+
16
+ const baseClassName = styleNames.base
17
+
18
+ const componentClassName = 'date-picker'
19
+
20
+ /**
21
+ * This is the component description.
22
+ */
23
+ const DatePickerWrapper = ({
24
+ id,
25
+ className:userClassName,
26
+ style,
27
+ mode,
28
+ selected,
29
+ setSelection,
30
+ fromMonth,
31
+ toDate,
32
+ customFooter,
33
+ timeFrom,
34
+ setTimeFrom,
35
+ timeTo,
36
+ setTimeTo,
37
+ dateFormat,
38
+ showDebugger,
39
+ ...otherProps
40
+ }) => {
41
+ const convertFooterText = (selection) => {
42
+ if (mode === 'single') {
43
+ return format(selection, dateFormat)
44
+ }
45
+ if (mode === 'multiple') {
46
+ return selection.map((date) => format(date, dateFormat)).join(', ')
47
+ }
48
+ if (mode === 'range') {
49
+ return selection.from && selection.to
50
+ ? `${format(selection.from, dateFormat)} - ${format(selection.to, dateFormat)}`
51
+ : 'Please pick an additional day.'
52
+ }
53
+ return null
54
+ }
55
+
56
+ return (
57
+ <div
58
+ id={id}
59
+ className={[
60
+ baseClassName,
61
+ componentClassName,
62
+ userClassName,
63
+ ]
64
+ .filter((e) => e)
65
+ .join(' ')}
66
+ style={style}
67
+ >
68
+ <DayPicker
69
+ mode={mode}
70
+ selected={selected}
71
+ onSelect={setSelection}
72
+ fromMonth={fromMonth}
73
+ toDate={toDate}
74
+ showOutsideDays
75
+ footer={customFooter || (
76
+ <div className="default-footer">
77
+ {
78
+ timeFrom && (
79
+ <>
80
+ <p className="time-label s-1">
81
+ <span className="icon">C</span>
82
+ &nbsp;
83
+ Time
84
+ </p>
85
+ <div className={`time-inputs${timeTo ? ' multiple' : ''}`}>
86
+ <input className="s-1" type="time" value={timeFrom} onChange={(e) => setTimeFrom(e.target.value)} />
87
+ {
88
+ timeTo && (
89
+ <>
90
+ <span className="icon s-2">r</span>
91
+ <input className="s-1" type="time" value={timeTo} onChange={(e) => setTimeTo(e.target.value)} />
92
+ </>
93
+ )
94
+ }
95
+ </div>
96
+ </>
97
+ )
98
+ }
99
+ <p className="s-1 footer-text">{selected && convertFooterText(selected)}</p>
100
+ </div>
101
+ )}
102
+ {...otherProps}
103
+ />
104
+ {
105
+ showDebugger && (
106
+ <div className="debugger">
107
+ <pre>
108
+ {JSON.stringify(selected, null, 2)}
109
+ </pre>
110
+ </div>
111
+ )
112
+ }
113
+ </div>
114
+ )
115
+ }
116
+
117
+ DatePickerWrapper.propTypes = {
118
+ /**
119
+ * The HTML id for this element
120
+ */
121
+ id:PropTypes.string,
122
+
123
+ /**
124
+ * The HTML class names for this element
125
+ */
126
+ className:PropTypes.string,
127
+
128
+ /**
129
+ * The React-written, css properties for this element.
130
+ */
131
+ style:PropTypes.objectOf(PropTypes.string),
132
+
133
+ /**
134
+ * The mode for this date picker.
135
+ */
136
+ mode:PropTypes.oneOf(['single', 'multiple', 'range']),
137
+
138
+ /**
139
+ * The current selection.
140
+ */
141
+ // eslint-disable-next-line react/forbid-prop-types
142
+ selected:PropTypes.objectOf(PropTypes.any).isRequired,
143
+
144
+ /**
145
+ * The function to update the selection.
146
+ */
147
+ setSelection:PropTypes.func.isRequired,
148
+
149
+ /**
150
+ * The earliest month to display.
151
+ */
152
+ fromMonth:PropTypes.instanceOf(Date),
153
+
154
+ /**
155
+ * The latest month to display.
156
+ */
157
+ toDate:PropTypes.instanceOf(Date),
158
+
159
+ /**
160
+ * Custom footer component.
161
+ */
162
+ customFooter:PropTypes.node,
163
+
164
+ /**
165
+ * The start time.
166
+ */
167
+ timeFrom:PropTypes.string,
168
+
169
+ /**
170
+ * The function to update the start time.
171
+ */
172
+ setTimeFrom:PropTypes.func,
173
+
174
+ /**
175
+ * The end time.
176
+ */
177
+ timeTo:PropTypes.string,
178
+
179
+ /**
180
+ * The function to update the end time.
181
+ */
182
+ setTimeTo:PropTypes.func,
183
+
184
+ /**
185
+ * The date format.
186
+ */
187
+ dateFormat:PropTypes.string,
188
+
189
+ /**
190
+ * Show the debugger.
191
+ */
192
+ showDebugger:PropTypes.bool,
193
+ }
194
+
195
+ DatePickerWrapper.defaultProps = {
196
+ mode :'single',
197
+ dateFormat :'PPP',
198
+ showDebugger:false,
199
+ }
200
+
201
+ export default DatePickerWrapper
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as DatePicker } from './DatePicker'
@@ -0,0 +1,380 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* stylelint-disable max-nesting-depth -- needed here */
3
+ /* stylelint-disable selector-class-pattern -- needed here */
4
+ /* stylelint-disable selector-max-compound-selectors -- needed here */
5
+ /* stylelint-disable declaration-no-important -- needed here */
6
+ /* stylelint-disable font-weight-notation -- needed here */
7
+ /* stylelint-disable declaration-block-no-duplicate-properties -- needed here */
8
+
9
+ @use "@pareto-engineering/bem";
10
+
11
+ $default-background: var(--background-far);
12
+ $default-border: var(--theme-default-input-border);
13
+ $default-input-border-radius: var(--theme-default-input-border-radius);
14
+ $default-padding: .55em .75em;
15
+ $default-spacing-size: calc(var(--gap) / 2);
16
+ $rdp-cell-size: 40px;
17
+ $rdp-caption-font-size: 1em;
18
+ $rdp-accent-color: var(--hard-interactive);
19
+ $rdp-outline: 2px solid var(--hard-interactive);
20
+ $rdp-selected-color: var(--on-interactive);
21
+
22
+ .#{bem.$base}.date-picker {
23
+ /* Hide elements for devices that are not screen readers */
24
+ .rdp-vhidden {
25
+ appearance: none;
26
+ appearance: none;
27
+ appearance: none;
28
+ background: transparent;
29
+ border: 0;
30
+ border: 0 !important;
31
+ box-sizing: border-box;
32
+ clip: rect(1px, 1px, 1px, 1px) !important;
33
+ height: 1px !important;
34
+ margin: 0;
35
+ overflow: hidden !important;
36
+ padding: 0;
37
+ padding: 0 !important;
38
+ position: absolute !important;
39
+ top: 0;
40
+ width: 1px !important;
41
+ }
42
+
43
+ /* Buttons */
44
+ .rdp-button_reset {
45
+ appearance: none;
46
+ appearance: none;
47
+ appearance: none;
48
+ background: none;
49
+ color: inherit;
50
+ cursor: default;
51
+ font: inherit;
52
+ margin: 0;
53
+ padding: 0;
54
+ position: relative;
55
+ }
56
+
57
+ .rdp-button_reset:focus-visible {
58
+ /* Make sure to reset outline only when :focus-visible is supported */
59
+ outline: none;
60
+ }
61
+
62
+ .rdp-button {
63
+ border: 2px solid transparent;
64
+ }
65
+
66
+ .rdp-button[disabled]:not(.rdp-day_selected) {
67
+ opacity: .25;
68
+ }
69
+
70
+ .rdp-button:not([disabled]) {
71
+ cursor: pointer;
72
+ }
73
+
74
+ .rdp-button:focus-visible:not([disabled]) {
75
+ background-color: $default-background;
76
+ border: $rdp-outline;
77
+ color: inherit;
78
+ }
79
+
80
+ .rdp-button:hover:not([disabled]):not(.rdp-day_selected) {
81
+ background-color: $default-background;
82
+ }
83
+
84
+ .rdp-months {
85
+ display: flex;
86
+ }
87
+
88
+ .rdp-month {
89
+ margin: 0 1em;
90
+ }
91
+
92
+ .rdp-month:first-child {
93
+ margin-left: 0;
94
+ }
95
+
96
+ .rdp-month:last-child {
97
+ margin-right: 0;
98
+ }
99
+
100
+ .rdp-table {
101
+ background-color: $default-background;
102
+ border-collapse: collapse;
103
+ margin: 0;
104
+ max-width: calc($rdp-cell-size * 7);
105
+ }
106
+
107
+ .rdp-with_weeknumber .rdp-table {
108
+ border-collapse: collapse;
109
+ max-width: calc($rdp-cell-size * 8);
110
+ }
111
+
112
+ .rdp-caption {
113
+ align-items: center;
114
+ background-color: $default-background;
115
+ display: flex;
116
+ justify-content: space-between;
117
+ padding: 0;
118
+ text-align: left;
119
+ }
120
+
121
+ .rdp-multiple_months .rdp-caption {
122
+ display: block;
123
+ position: relative;
124
+ text-align: center;
125
+ }
126
+
127
+ .rdp-caption_dropdowns {
128
+ display: inline-flex;
129
+ position: relative;
130
+ }
131
+
132
+ .rdp-caption_label {
133
+ align-items: center;
134
+ border: 0;
135
+ border: 2px solid transparent;
136
+ color: var(--heading);
137
+ display: inline-flex;
138
+ font-family: inherit;
139
+ font-size: $rdp-caption-font-size;
140
+ font-weight: bold;
141
+ margin: 0;
142
+ padding: 0 .25em;
143
+ position: relative;
144
+ white-space: nowrap;
145
+ z-index: 1;
146
+ }
147
+
148
+ .rdp-nav {
149
+ white-space: nowrap;
150
+ }
151
+
152
+ .rdp-multiple_months .rdp-caption_start .rdp-nav {
153
+ left: 0;
154
+ position: absolute;
155
+ top: 50%;
156
+ transform: translateY(-50%);
157
+ }
158
+
159
+ .rdp-multiple_months .rdp-caption_end .rdp-nav {
160
+ position: absolute;
161
+ right: 0;
162
+ top: 50%;
163
+ transform: translateY(-50%);
164
+ }
165
+
166
+ .rdp-nav_button {
167
+ align-items: center;
168
+ border-radius: 100%;
169
+ display: inline-flex;
170
+ height: $rdp-cell-size;
171
+ justify-content: center;
172
+ padding: .25em;
173
+ width: $rdp-cell-size;
174
+ }
175
+
176
+ /* ---------- */
177
+
178
+ /* Dropdowns */
179
+
180
+ /* ---------- */
181
+
182
+ .rdp-dropdown_year,
183
+ .rdp-dropdown_month {
184
+ align-items: center;
185
+ display: inline-flex;
186
+ position: relative;
187
+ }
188
+
189
+ .rdp-dropdown {
190
+ appearance: none;
191
+ background-color: transparent;
192
+ border: none;
193
+ bottom: 0;
194
+ cursor: inherit;
195
+ font-family: inherit;
196
+ font-size: inherit;
197
+ left: 0;
198
+ line-height: inherit;
199
+ margin: 0;
200
+ opacity: 0;
201
+ padding: 0;
202
+ position: absolute;
203
+ top: 0;
204
+ width: 100%;
205
+ z-index: 2;
206
+ }
207
+
208
+ .rdp-dropdown[disabled] {
209
+ color: unset;
210
+ opacity: unset;
211
+ }
212
+
213
+ .rdp-dropdown:focus-visible:not([disabled]) + .rdp-caption_label {
214
+ background-color: $default-background;
215
+ border: $rdp-outline;
216
+ border-radius: 6px;
217
+ }
218
+
219
+ .rdp-dropdown_icon {
220
+ margin: 0 0 0 5px;
221
+ }
222
+
223
+ .rdp-head {
224
+ border: 0;
225
+ }
226
+
227
+ .rdp-head_row,
228
+ .rdp-row {
229
+ height: 100%;
230
+ }
231
+
232
+ .rdp-head_cell {
233
+ font-size: .75em;
234
+ font-weight: 700;
235
+ height: 100%;
236
+ height: $rdp-cell-size;
237
+ padding: 0;
238
+ text-align: center;
239
+ text-transform: uppercase;
240
+ vertical-align: middle;
241
+ }
242
+
243
+ .rdp-tbody {
244
+ border: 0;
245
+ }
246
+
247
+ .rdp-tfoot {
248
+ margin: .5em;
249
+
250
+ .default-footer {
251
+ display: flex;
252
+ flex-direction: column;
253
+
254
+ >.footer-text {
255
+ align-self: center;
256
+ }
257
+
258
+ >.time-label {
259
+ align-items: center;
260
+ align-self: first baseline;
261
+ color: var(--heading);
262
+ display: flex;
263
+ margin: 0;
264
+ padding: $default-spacing-size;
265
+ }
266
+
267
+ >.time-inputs {
268
+ :not(.multiple) {
269
+ margin-left: $default-spacing-size;
270
+ }
271
+
272
+ &.multiple {
273
+ align-items: center;
274
+ align-self: center;
275
+ display: flex;
276
+ gap: $default-spacing-size;
277
+ }
278
+
279
+ >input[type="time"] {
280
+ background-color: $default-background;
281
+ border: $default-border;
282
+ border-radius: $default-input-border-radius;
283
+ color: var(--paragraph);
284
+ outline: none;
285
+ padding: $default-padding;
286
+
287
+ &::-webkit-calendar-picker-indicator {
288
+ background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAyMCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDEuNUwxMCAxMC41TDEgMS41IiBzdHJva2U9IiM0QzRENTMiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
289
+ background-position: calc(100% - $default-spacing-size / 2);
290
+ background-repeat: no-repeat;
291
+ background-size: $default-spacing-size;
292
+ }
293
+ }
294
+ }
295
+ }
296
+ }
297
+
298
+ .rdp-cell {
299
+ height: 100%;
300
+ height: $rdp-cell-size;
301
+ padding: 0;
302
+ text-align: center;
303
+ width: $rdp-cell-size;
304
+ }
305
+
306
+ .rdp-weeknumber {
307
+ font-size: .75em;
308
+ }
309
+
310
+ .rdp-weeknumber,
311
+ .rdp-day {
312
+ align-items: center;
313
+ border: 2px solid transparent;
314
+ border-radius: 100%;
315
+ box-sizing: border-box;
316
+ display: flex;
317
+ height: $rdp-cell-size;
318
+ justify-content: center;
319
+ margin: 0;
320
+ max-width: $rdp-cell-size;
321
+ overflow: hidden;
322
+ width: $rdp-cell-size;
323
+ }
324
+
325
+ .rdp-day_today:not(.rdp-day_outside) {
326
+ font-weight: bold;
327
+ }
328
+
329
+ .rdp-day_selected,
330
+ .rdp-day_selected:focus-visible,
331
+ .rdp-day_selected:hover {
332
+ background-color: $rdp-accent-color;
333
+ color: $rdp-selected-color;
334
+ opacity: 1;
335
+ }
336
+
337
+ .rdp-day_outside {
338
+ opacity: .5;
339
+ }
340
+
341
+ .rdp-day_selected:focus-visible {
342
+ /* Since the background is the same use again the outline */
343
+ outline: $rdp-outline;
344
+ outline-offset: 2px;
345
+ z-index: 1;
346
+ }
347
+
348
+ .rdp:not([dir="rtl"]) .rdp-day_range_start:not(.rdp-day_range_end) {
349
+ border-bottom-right-radius: 0;
350
+ border-top-right-radius: 0;
351
+ }
352
+
353
+ .rdp:not([dir="rtl"]) .rdp-day_range_end:not(.rdp-day_range_start) {
354
+ border-bottom-left-radius: 0;
355
+ border-top-left-radius: 0;
356
+ }
357
+
358
+ .rdp[dir="rtl"] .rdp-day_range_start:not(.rdp-day_range_end) {
359
+ border-bottom-left-radius: 0;
360
+ border-top-left-radius: 0;
361
+ }
362
+
363
+ .rdp[dir="rtl"] .rdp-day_range_end:not(.rdp-day_range_start) {
364
+ border-bottom-right-radius: 0;
365
+ border-top-right-radius: 0;
366
+ }
367
+
368
+ .rdp-day_range_end.rdp-day_range_start {
369
+ border-radius: 100%;
370
+ }
371
+
372
+ .rdp-day_range_middle {
373
+ background-color: var(--interactive);
374
+ border-radius: 0;
375
+ }
376
+
377
+ .rdp-nav_icon {
378
+ color: var(--ui-icons);
379
+ }
380
+ }
@@ -56,6 +56,7 @@ const XMLEditor = ({
56
56
  gutterWidth,
57
57
  config,
58
58
  onChange,
59
+ onBlur,
59
60
  stopPropagationKeys,
60
61
  }) => {
61
62
  const editorRef = useRef()
@@ -83,6 +84,11 @@ const XMLEditor = ({
83
84
  onChange(view)
84
85
  // view.state.doc.toString() to receive the current content in the editor.
85
86
  }),
87
+ EditorView.focusChangeEffect.of((state, focused) => {
88
+ if (!focused) {
89
+ onBlur?.(state)
90
+ }
91
+ }),
86
92
  EditorView.domEventHandlers({
87
93
  keydown(e) {
88
94
  if (stopPropagationKeys?.includes(e.key)) {
package/src/ui/a/index.js CHANGED
@@ -27,3 +27,4 @@ export { Removable } from './Removable'
27
27
  export { ToggleSwitch } from './ToggleSwitch'
28
28
  export { XMLEditor } from './XMLEditor'
29
29
  export { LexicalPreview } from './LexicalPreview'
30
+ export { DatePicker } from './DatePicker'
@@ -3,18 +3,14 @@ import * as React from 'react'
3
3
 
4
4
  import { memo } from 'react'
5
5
 
6
- import { useField } from 'formik'
7
-
8
6
  import PropTypes from 'prop-types'
9
7
 
10
8
  import styleNames from '@pareto-engineering/bem/exports'
11
9
 
12
- import { LoadingCircle } from 'ui/a'
13
-
14
- import { FormLabel, FormDescription } from '../../common'
15
-
16
10
  import './styles.scss'
17
11
 
12
+ import { Single, Multiple } from './common'
13
+
18
14
  // Local Definitions
19
15
 
20
16
  const baseClassName = styleNames.base
@@ -39,9 +35,28 @@ const SelectInput = ({
39
35
  disabled,
40
36
  isLoading,
41
37
  autoComplete,
38
+ placeholder,
39
+ getTagColor,
40
+ multiple,
42
41
  // ...otherProps
43
42
  }) => {
44
- const [field] = useField({ name, validate })
43
+ const inputProps = {
44
+ name,
45
+ label,
46
+ labelColor,
47
+ color,
48
+ options,
49
+ validate,
50
+ optional,
51
+ description,
52
+ disabled,
53
+ isLoading,
54
+ placeholder,
55
+ getTagColor,
56
+ autoComplete,
57
+ }
58
+
59
+ const Input = multiple ? Multiple : Single
45
60
 
46
61
  return (
47
62
  <div
@@ -55,45 +70,7 @@ const SelectInput = ({
55
70
  .join(' ')}
56
71
  style={style}
57
72
  >
58
- <FormLabel
59
- name={name}
60
- color={labelColor}
61
- optional={optional}
62
- // {...otherProps}
63
- >
64
- {label}
65
- </FormLabel>
66
- <div className={`select-wrapper${disabled ? ' disabled' : ''}`}>
67
- <select
68
- className={`input y-${color}`}
69
- {...field}
70
- value={field.value || ''}
71
- id={name}
72
- disabled={disabled}
73
- autoComplete={autoComplete}
74
- >
75
- {
76
- options.map((option) => {
77
- // i.e if option is a string like "blah", return { value: "blah", label: "blah" }
78
- const newOption = typeof option === 'string' ? { value: option, label: option } : option
79
-
80
- return (
81
- <option
82
- key={newOption.value}
83
- value={newOption.value}
84
- disabled={newOption?.disabled || false}
85
- >
86
- {newOption.label}
87
- </option>
88
- )
89
- })
90
- }
91
- </select>
92
- {isLoading && (
93
- <LoadingCircle className="x-main" />
94
- )}
95
- </div>
96
- <FormDescription className="s-1" description={description} name={name} />
73
+ <Input {...inputProps} />
97
74
  </div>
98
75
  )
99
76
  }
@@ -175,11 +152,21 @@ SelectInput.propTypes = {
175
152
  * Whether the input is optional or not
176
153
  */
177
154
  optional:PropTypes.bool,
155
+
156
+ /**
157
+ * Whether the select input should allow multiple selections
158
+ */
159
+ multiple:PropTypes.bool,
160
+
161
+ /**
162
+ * The placeholder of the select input
163
+ */
164
+ placeholder:PropTypes.string,
178
165
  }
179
166
 
180
167
  SelectInput.defaultProps = {
181
168
  disabled:false,
182
- color :'paragraph',
169
+ multiple:false,
183
170
  }
184
171
 
185
172
  export default memo(SelectInput)