intelicoreact 0.0.96 → 0.0.99

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 (160) hide show
  1. package/dist/Atomic/FormElements/Dropdown/Dropdown.js +5 -3
  2. package/dist/Atomic/FormElements/Dropdown/Dropdown.stories.js +2 -1
  3. package/dist/Atomic/FormElements/Input/Input.js +3 -1
  4. package/dist/Atomic/FormElements/Input/Input.stories.js +5 -1
  5. package/dist/Atomic/FormElements/InputDateRange/InputDateRange.js +4 -4
  6. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.js +179 -70
  7. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.scss +23 -23
  8. package/dist/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +87 -12
  9. package/dist/Atomic/FormElements/Spinner/Spinner.js +21 -0
  10. package/{src/Atomic/FormElements/Dropdown/components/DropdownLoader.scss → dist/Atomic/FormElements/Spinner/Spinner.scss} +8 -5
  11. package/dist/Atomic/FormElements/Spinner/Spinner.stories.js +34 -0
  12. package/dist/Functions/inputExecutor.js +7 -1
  13. package/package.json +3 -2
  14. package/.babelrc +0 -12
  15. package/.eslintignore +0 -10
  16. package/.eslintrc.json +0 -93
  17. package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.js +0 -28
  18. package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.scss +0 -107
  19. package/src/Atomic/FormElements/CheckboxInput/CheckboxInput.stories.js +0 -26
  20. package/src/Atomic/FormElements/DateTime/DateTime.js +0 -18
  21. package/src/Atomic/FormElements/DateTime/DateTime.scss +0 -12
  22. package/src/Atomic/FormElements/DateTime/DateTime.stories.js +0 -17
  23. package/src/Atomic/FormElements/DoubleString/DoubleString.js +0 -13
  24. package/src/Atomic/FormElements/DoubleString/DoubleString.scss +0 -20
  25. package/src/Atomic/FormElements/DoubleString/DoubleString.stories.js +0 -18
  26. package/src/Atomic/FormElements/Dropdown/Dropdown.js +0 -178
  27. package/src/Atomic/FormElements/Dropdown/Dropdown.scss +0 -192
  28. package/src/Atomic/FormElements/Dropdown/Dropdown.stories.js +0 -87
  29. package/src/Atomic/FormElements/Dropdown/components/DropdownLoader.js +0 -17
  30. package/src/Atomic/FormElements/Header/Header.js +0 -67
  31. package/src/Atomic/FormElements/Header/Header.scss +0 -93
  32. package/src/Atomic/FormElements/Header/Header.stories.js +0 -30
  33. package/src/Atomic/FormElements/Input/Input.js +0 -186
  34. package/src/Atomic/FormElements/Input/Input.scss +0 -136
  35. package/src/Atomic/FormElements/Input/Input.stories.js +0 -94
  36. package/src/Atomic/FormElements/InputCalendar/InputCalendar.js +0 -104
  37. package/src/Atomic/FormElements/InputCalendar/InputCalendar.scss +0 -23
  38. package/src/Atomic/FormElements/InputCalendar/InputCalendar.stories.js +0 -39
  39. package/src/Atomic/FormElements/InputDateRange/InputDateRange.js +0 -254
  40. package/src/Atomic/FormElements/InputDateRange/InputDateRange.scss +0 -624
  41. package/src/Atomic/FormElements/InputDateRange/InputDateRange.stories.js +0 -65
  42. package/src/Atomic/FormElements/InputDateRange/components/Datepicker.js +0 -432
  43. package/src/Atomic/FormElements/InputDateRange/components/OpenedPart.js +0 -126
  44. package/src/Atomic/FormElements/InputDateRange/components/SelectItem.js +0 -24
  45. package/src/Atomic/FormElements/InputDateRange/dependencies.js +0 -161
  46. package/src/Atomic/FormElements/InputsRow/InputsRow.js +0 -112
  47. package/src/Atomic/FormElements/InputsRow/InputsRow.scss +0 -45
  48. package/src/Atomic/FormElements/InputsRow/InputsRow.stories.js +0 -34
  49. package/src/Atomic/FormElements/Label/Label.js +0 -13
  50. package/src/Atomic/FormElements/Label/Label.scss +0 -20
  51. package/src/Atomic/FormElements/Label/Label.stories.js +0 -23
  52. package/src/Atomic/FormElements/MobileCalendar/MobileCalendar.js +0 -315
  53. package/src/Atomic/FormElements/MobileCalendar/MobileCalendar.scss +0 -120
  54. package/src/Atomic/FormElements/MobileCalendar/MobileCalendar.stories.js +0 -30
  55. package/src/Atomic/FormElements/Modal/Modal.js +0 -69
  56. package/src/Atomic/FormElements/Modal/Modal.scss +0 -230
  57. package/src/Atomic/FormElements/Modal/Modal.stories.js +0 -116
  58. package/src/Atomic/FormElements/MultiSelect/MultiSelect.js +0 -39
  59. package/src/Atomic/FormElements/MultiSelect/MultiSelect.scss +0 -16
  60. package/src/Atomic/FormElements/MultiSelect/MultiSelect.stories.js +0 -28
  61. package/src/Atomic/FormElements/NavLine/NavLine.js +0 -67
  62. package/src/Atomic/FormElements/NavLine/NavLine.scss +0 -108
  63. package/src/Atomic/FormElements/NavLine/NavLine.stories.js +0 -108
  64. package/src/Atomic/FormElements/NumericInput/NumericInput.js +0 -263
  65. package/src/Atomic/FormElements/NumericInput/NumericInput.scss +0 -135
  66. package/src/Atomic/FormElements/NumericInput/NumericInput.stories.js +0 -78
  67. package/src/Atomic/FormElements/RadioInput/RadioInput.js +0 -28
  68. package/src/Atomic/FormElements/RadioInput/RadioInput.scss +0 -63
  69. package/src/Atomic/FormElements/RadioInput/RadioInput.stories.js +0 -23
  70. package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.js +0 -152
  71. package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.scss +0 -101
  72. package/src/Atomic/FormElements/RangeCalendar/RangeCalendar.stories.js +0 -54
  73. package/src/Atomic/FormElements/RangeInputs/RangeInputs.js +0 -41
  74. package/src/Atomic/FormElements/RangeInputs/RangeInputs.scss +0 -20
  75. package/src/Atomic/FormElements/RangeInputs/RangeInputs.stories.js +0 -23
  76. package/src/Atomic/FormElements/Switcher/Switcher.js +0 -24
  77. package/src/Atomic/FormElements/Switcher/Switcher.scss +0 -56
  78. package/src/Atomic/FormElements/Switcher/Switcher.stories.js +0 -22
  79. package/src/Atomic/FormElements/Table/Partials/TdCell.js +0 -47
  80. package/src/Atomic/FormElements/Table/Partials/TdHeader.js +0 -33
  81. package/src/Atomic/FormElements/Table/Partials/TdRow.js +0 -84
  82. package/src/Atomic/FormElements/Table/Partials/TdTitle.js +0 -38
  83. package/src/Atomic/FormElements/Table/Table.js +0 -50
  84. package/src/Atomic/FormElements/Table/Table.scss +0 -78
  85. package/src/Atomic/FormElements/Table/Table.stories.js +0 -102
  86. package/src/Atomic/FormElements/Table/TdTypes/TdActions.js +0 -59
  87. package/src/Atomic/FormElements/Table/TdTypes/TdPriority.js +0 -20
  88. package/src/Atomic/FormElements/Table/TdTypes/TdRange.js +0 -15
  89. package/src/Atomic/FormElements/Table/TdTypes/TdTypes.scss +0 -35
  90. package/src/Atomic/FormElements/Table/TdTypes/TdWeight.js +0 -43
  91. package/src/Atomic/FormElements/Tag/Tag.js +0 -24
  92. package/src/Atomic/FormElements/Tag/Tag.scss +0 -38
  93. package/src/Atomic/FormElements/Tag/Tag.stories.js +0 -30
  94. package/src/Atomic/FormElements/TagsDropdown/TagsDropdown.js +0 -108
  95. package/src/Atomic/FormElements/TagsDropdown/TagsDropdown.scss +0 -131
  96. package/src/Atomic/FormElements/TagsDropdown/TagsDropdown.stories.js +0 -44
  97. package/src/Atomic/FormElements/TextSwitcher/TextSwitcher.js +0 -18
  98. package/src/Atomic/FormElements/TextSwitcher/TextSwitcher.scss +0 -50
  99. package/src/Atomic/FormElements/TextSwitcher/TextSwitcher.stories.js +0 -21
  100. package/src/Atomic/FormElements/Textarea/Textarea.js +0 -19
  101. package/src/Atomic/FormElements/Textarea/Textarea.scss +0 -35
  102. package/src/Atomic/FormElements/Textarea/Textarea.stories.js +0 -24
  103. package/src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.js +0 -66
  104. package/src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.scss +0 -10
  105. package/src/Atomic/FormElements/TieredCheckboxes/TieredCheckboxes.stories.js +0 -57
  106. package/src/Atomic/FormElements/TimeRange/TimeRange.js +0 -55
  107. package/src/Atomic/FormElements/TimeRange/TimeRange.scss +0 -17
  108. package/src/Atomic/FormElements/TimeRange/TimeRange.stories.js +0 -21
  109. package/src/Atomic/MainMenu/MainMenu.js +0 -112
  110. package/src/Atomic/MainMenu/MainMenu.scss +0 -176
  111. package/src/Atomic/MainMenu/MainMenu.stories.js +0 -91
  112. package/src/Atomic/UI/Accordion/Accordion.js +0 -45
  113. package/src/Atomic/UI/Accordion/Accordion.scss +0 -73
  114. package/src/Atomic/UI/Accordion/Accordion.stories.js +0 -78
  115. package/src/Atomic/UI/Accordion/AccordionItem.js +0 -92
  116. package/src/Atomic/UI/AdvancedTag/AdvTag.js +0 -81
  117. package/src/Atomic/UI/AdvancedTag/AdvancedTags.js +0 -32
  118. package/src/Atomic/UI/AdvancedTag/AdvancedTags.scss +0 -72
  119. package/src/Atomic/UI/AdvancedTag/AdvancedTags.stories.js +0 -49
  120. package/src/Atomic/UI/Alert/Alert.js +0 -23
  121. package/src/Atomic/UI/Alert/Alert.scss +0 -65
  122. package/src/Atomic/UI/Alert/Alert.stories.js +0 -34
  123. package/src/Atomic/UI/Arrow/Arrow.js +0 -41
  124. package/src/Atomic/UI/Arrow/Arrow.scss +0 -19
  125. package/src/Atomic/UI/Arrow/Arrow.stories.js +0 -32
  126. package/src/Atomic/UI/Button/Button.js +0 -17
  127. package/src/Atomic/UI/Button/Button.scss +0 -108
  128. package/src/Atomic/UI/Button/Button.stories.js +0 -49
  129. package/src/Atomic/UI/Calendar/Calendar.js +0 -190
  130. package/src/Atomic/UI/Calendar/Calendar.scss +0 -607
  131. package/src/Atomic/UI/Calendar/Calendar.stories.js +0 -26
  132. package/src/Atomic/UI/Header/partials/default_ava.png +0 -0
  133. package/src/Atomic/UI/Hint/Hint.js +0 -34
  134. package/src/Atomic/UI/Hint/Hint.scss +0 -92
  135. package/src/Atomic/UI/Hint/Hint.stories.js +0 -34
  136. package/src/Atomic/UI/Price/Price.js +0 -20
  137. package/src/Atomic/UI/Price/Price.stories.js +0 -30
  138. package/src/Atomic/UI/Status/Status.js +0 -38
  139. package/src/Atomic/UI/Status/Status.scss +0 -69
  140. package/src/Atomic/UI/Status/Status.stories.js +0 -47
  141. package/src/Constants/index.constants.js +0 -41
  142. package/src/Functions/customEventListener.js +0 -58
  143. package/src/Functions/inputExecutor.js +0 -53
  144. package/src/Functions/schemas.js +0 -31
  145. package/src/Functions/useClickOutside.js +0 -15
  146. package/src/Functions/useMouseUpOutside.js +0 -16
  147. package/src/Functions/useToggle.js +0 -17
  148. package/src/Functions/utils.js +0 -51
  149. package/src/Molecular/Datepicker/Datepicker.js +0 -346
  150. package/src/Molecular/Datepicker/Datepicker.scss +0 -8
  151. package/src/Molecular/Datepicker/Datepicker.stories.js +0 -27
  152. package/src/Molecular/Datepicker/components/Calendar.js +0 -118
  153. package/src/Molecular/FormElements/FormElement.js +0 -18
  154. package/src/Molecular/FormElements/FormElement.scss +0 -8
  155. package/src/Molecular/FormElements/FormElement.stories.js +0 -59
  156. package/src/index.js +0 -3
  157. package/src/scss/_fonts.scss +0 -109
  158. package/src/scss/_vars.scss +0 -48
  159. package/src/scss/main.scss +0 -40
  160. package/webpack.config.js +0 -61
@@ -1,263 +0,0 @@
1
- import React, { useState, useEffect, useRef } from 'react';
2
- import cn from 'classnames';
3
- import { Minus, Plus } from 'react-feather';
4
- import InputMask from 'react-input-mask';
5
- import { KEYBOARD_SERVICE_KEYS } from '../../../Constants/index.constants';
6
- import { formatInput } from '../../../Functions/inputExecutor';
7
-
8
- import './NumericInput.scss';
9
-
10
- let timerOutside;
11
- let timerFocus;
12
-
13
- const NumericInput = ({
14
- onChange,
15
- disabled,
16
- withDelete,
17
- numStep = 1,
18
- min = 0,
19
- max,
20
- value,
21
- placeholder,
22
- className,
23
- onBlur,
24
- onFocus,
25
- onKeyUp,
26
- mask,
27
- maskChar,
28
- formatChars,
29
- error,
30
- icon,
31
- symbolsLimit,
32
- isNotBlinkErrors,
33
- blinkTime,
34
- isPriceInput,
35
- isFocusDefault = false
36
- }) => {
37
- const DEFAULT_BLINK_TIME = 200;
38
-
39
- //REFS
40
- const inputRef = useRef(null);
41
- const decRef = useRef(null);
42
- const incRef = useRef(null);
43
- const wrapRef = useRef(null);
44
-
45
- const previousValueRef = useRef(value);
46
-
47
- // STATES
48
- const [inputValue, setInputValue] = useState(value || min || '');
49
- const [inputValueFormated, setInputValueFormated] = useState(inputValue);
50
- const [intMemoVal, setIntMemoVal] = useState(0);
51
-
52
- const [isFocused, setIsFocused] = useState(false);
53
- const [isEditing, setEditing] = useState(false);
54
-
55
- const [isAttemptToChange, setIsAttemptToChange] = useState(false);
56
- const [isToHighlightError, setIsToHighlightError] = useState(false);
57
-
58
- const { onlyNumbers } = formatInput;
59
- const { addCommas, removeComma } = formatInput.priceInput;
60
-
61
- // HANDLES
62
- const handle = {
63
- change: (e) => {
64
- let inputValue = e.target ? onlyNumbers(e.target.value) : e;
65
-
66
- if (
67
- inputValue &&
68
- (decRef.current.contains(e.target) || incRef.current.contains(e.target))
69
- ) {
70
- inputValue = parseFloat(inputValue);
71
- if (min && +min > inputValue) {
72
- inputValue = min;
73
- } else if (max && +max < inputValue) inputValue = max;
74
- }
75
- if (symbolsLimit) {
76
- inputValue = inputValue.toString().substring(0, +symbolsLimit);
77
- }
78
- setInputValue(inputValue.toString());
79
- },
80
- clear: () => {
81
- handle.change(min || '');
82
- },
83
- focus: (e) => {
84
- if (isFocused) return;
85
- setIsFocused(true);
86
- if (onFocus) onFocus(e);
87
- },
88
- blur: (e) => {
89
- if (!isFocused) return;
90
-
91
- setIsFocused(false);
92
- setEditing(false);
93
-
94
- if (onBlur) onBlur(e);
95
- },
96
- keyUp: (e) => {
97
- if (!isNotBlinkErrors) {
98
- const changedValue = '' + (value ?? '');
99
- const previousValue = '' + (previousValueRef.current ?? '');
100
- const currentSet = (() => {
101
- if (previousValue.length < changedValue.length)
102
- return value
103
- .toString()
104
- .slice(previousValue.length - changedValue.length);
105
- else return changedValue.toString().includes(e.key) ? e.key : '';
106
- })();
107
-
108
- if (
109
- !KEYBOARD_SERVICE_KEYS.includes(e.key) &&
110
- changedValue === previousValue
111
- )
112
- setIsAttemptToChange(true);
113
-
114
- if (KEYBOARD_SERVICE_KEYS.includes(e.key) || !currentSet)
115
- previousValueRef.current = value;
116
- else previousValueRef.current = previousValue + currentSet[0];
117
- }
118
-
119
- if (onKeyUp) onKeyUp(e.keyCode, e.target.value);
120
- },
121
- decrement: (e) => {
122
- handle.change(intMemoVal - +numStep);
123
- },
124
- increment: (e) => {
125
- handle.change(intMemoVal + +numStep);
126
- }
127
- };
128
-
129
- //Check Outside Click
130
- useEffect(() => {
131
- const handleClickOutside = (event) => {
132
- if (!wrapRef.current.contains(event.target)) {
133
- setIsFocused(false);
134
- }
135
- };
136
-
137
- document.addEventListener('mousedown', handleClickOutside, true);
138
- return () =>
139
- document.removeEventListener('mousedown', handleClickOutside, true);
140
- }, []);
141
-
142
- useEffect(() => {
143
- if (!isNotBlinkErrors && isAttemptToChange) {
144
- setIsAttemptToChange(false);
145
- setIsToHighlightError(true);
146
- setTimeout(() => {
147
- setIsToHighlightError(false);
148
- }, blinkTime || DEFAULT_BLINK_TIME);
149
- }
150
- }, [isAttemptToChange]);
151
-
152
- //On Input Value Change
153
- useEffect(() => {
154
- if (inputValue !== value) setIsFocused(true);
155
-
156
- setInputValueFormated(
157
- isPriceInput
158
- ? isFocused
159
- ? removeComma(inputValue)
160
- : addCommas(inputValue)
161
- : inputValue
162
- );
163
- setIntMemoVal(parseInt(inputValue));
164
-
165
- if (typeof onChange === 'function') onChange(inputValue?.toString());
166
- }, [inputValue]);
167
-
168
- //On Integer Value Change
169
- useEffect(() => {
170
- if (isNaN(intMemoVal)) setIntMemoVal(min || 0);
171
- }, [intMemoVal]);
172
-
173
- //On Focuse Change
174
- useEffect(() => {
175
- setInputValueFormated(
176
- isPriceInput
177
- ? isFocused
178
- ? removeComma(inputValue)
179
- : addCommas(inputValue)
180
- : inputValue
181
- );
182
-
183
- if (isFocused) {
184
- if (typeof onFocus === 'function') onFocus({ target: inputRef?.current });
185
- inputRef?.current?.focus();
186
- } else {
187
- if (typeof onBlur === 'function') onBlur({ target: inputRef?.current });
188
- inputRef?.current?.blur();
189
- }
190
- }, [isFocused]);
191
-
192
- useEffect(() => {
193
- if (inputRef?.current && typeof isFocusDefault === 'boolean')
194
- setIsFocused(isFocusDefault);
195
- setEditing(isFocusDefault)
196
- }, [inputRef, isFocusDefault]);
197
-
198
- function renderInput() {
199
- const uniProps = {
200
- className: `input ${className || ''}`,
201
- placeholder,
202
- value: inputValueFormated,
203
- disabled,
204
- onChange: handle.change,
205
- onFocus: () => {
206
- setIsFocused(true);
207
- setEditing(true);
208
- },
209
- onBlur: () => setEditing(false),
210
- onKeyUp: handle.keyUp,
211
- min,
212
- max,
213
- ...(maskChar ? { maskChar } : {}),
214
- ...(formatChars ? { formatChars } : {})
215
- };
216
-
217
- return (
218
- <>
219
- <input {...uniProps} ref={inputRef} type='text' />
220
-
221
- <div className='input__nums'>
222
- <button
223
- ref={decRef}
224
- onMouseDown={(e) => handle.decrement(e)}
225
- className={cn(`input__num-btn`, { disabled: +value <= min })}
226
- >
227
- <Minus />
228
- </button>
229
- <button
230
- ref={incRef}
231
- onMouseDown={(e) => handle.increment(e)}
232
- className={cn(`input__num-btn`, { disabled: +value >= max })}
233
- >
234
- <Plus />
235
- </button>
236
- </div>
237
- </>
238
- );
239
- }
240
-
241
- return (
242
- <div
243
- ref={wrapRef}
244
- className={cn(
245
- `input__wrap`,
246
- { [`input__wrap_focus`]: isFocused },
247
- { [`input__wrap_error`]: error || isToHighlightError },
248
- { [`input__wrap_disabled`]: disabled }
249
- )}
250
- >
251
- {renderInput()}
252
- {icon}
253
- {withDelete && (
254
- <span
255
- className={cn(`input__close`, { hidden: !inputValue })}
256
- onClick={() => handle.clear()}
257
- />
258
- )}
259
- </div>
260
- );
261
- };
262
-
263
- export default NumericInput;
@@ -1,135 +0,0 @@
1
- .input {
2
- position: relative;
3
- word-break: break-all;
4
- border: none;
5
- background: none;
6
- padding: 0 10px;
7
- width: 100%;
8
- &::-webkit-outer-spin-button,
9
- &::-webkit-inner-spin-button {
10
- -webkit-appearance: none;
11
- }
12
-
13
- &__wrap {
14
- display: flex;
15
- align-items: center;
16
- border: 1px solid #e2e5ec;
17
- box-sizing: border-box;
18
- background-color: #fff;
19
- height: 28px;
20
- border-radius: 4px;
21
-
22
- &_focus {
23
- border-color: #6b81dd;
24
- filter: drop-shadow(0px 0px 4px rgba(93, 120, 255, 0.5));
25
- }
26
-
27
- &_disabled {
28
- background: #f7f8fa;
29
- opacity: 0.5;
30
- border-color: #a6acb1;
31
- pointer-events: none;
32
- }
33
-
34
- &_error {
35
- border-color: #f06d8d;
36
- }
37
- }
38
-
39
- &_disabled {
40
- background: #f7f8fa;
41
- opacity: 0.5;
42
- border-color: #a6acb1;
43
- pointer-events: none;
44
- }
45
-
46
- &_error {
47
- border-color: #f06d8d;
48
- }
49
-
50
- svg {
51
- margin-right: 4px;
52
- }
53
-
54
- &__input {
55
- width: 100%;
56
- height: 100%;
57
- box-sizing: border-box;
58
- font-size: 13px;
59
- font-weight: 400;
60
- color: #1e1e2d;
61
- border: none;
62
- padding: 0 5px;
63
- border-radius: 4px;
64
- }
65
-
66
- &__close {
67
- position: relative;
68
- opacity: 0.6;
69
- width: 14px;
70
- height: 14px;
71
- background: none;
72
- cursor: pointer;
73
- margin-right: 4px;
74
- visibility: hidden;
75
- pointer-events: none;
76
- &:hover {
77
- opacity: 1;
78
- }
79
-
80
- &:before,
81
- &:after {
82
- content: '';
83
- position: absolute;
84
- top: 0;
85
- left: 0;
86
- right: 0;
87
- margin: auto;
88
- height: 14px;
89
- width: 2px;
90
- background-color: #9aa0b9;
91
- }
92
-
93
- &:before {
94
- transform: rotate(45deg);
95
- }
96
-
97
- &:after {
98
- transform: rotate(-45deg);
99
- }
100
- }
101
-
102
- &__nums {
103
- display: flex;
104
- align-items: center;
105
- height: 100%;
106
- }
107
-
108
- &__num-btn {
109
- cursor: pointer;
110
- display: flex;
111
- align-items: center;
112
- justify-content: center;
113
- height: 100%;
114
- width: 24px;
115
- border-left: 1px solid #e2e5ec;
116
- background: none;
117
- font-size: 20px;
118
- user-select: none;
119
- &.disabled {
120
- opacity: 0.3;
121
- }
122
- svg {
123
- margin-right: 0;
124
- }
125
- }
126
-
127
- &-label {
128
- margin-bottom: 5px;
129
- }
130
- }
131
-
132
- .input__wrap:hover .input__close {
133
- visibility: visible;
134
- pointer-events: all;
135
- }
@@ -1,78 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { User } from 'react-feather';
3
- import NumericInput from './NumericInput';
4
-
5
- global.lng = 'en';
6
-
7
- export default {
8
- title: 'Form Elements/NumericInput',
9
- component: NumericInput,
10
- argTypes: {
11
- disabled: {
12
- description: 'boolean'
13
- },
14
- isFocusDefault: {
15
- description: 'boolean - if true, input will be focused on mount'
16
- },
17
- isInitialFocus: {
18
- description: 'boolean - if true, the input will be focused on mount'
19
- },
20
- error: {
21
- description: 'text - coloring input if is errored'
22
- },
23
- isPriceInput: {
24
- description: 'boolean - if true, the input will be styled as PriceInput'
25
- },
26
- withDelete: {
27
- description: 'boolean - add clear-cross by hover'
28
- },
29
- numStep: {
30
- description: 'number/text - plus/minus buttons factor (default: 1)'
31
- },
32
- min: {
33
- description: 'number/text - minimal number for numeric input'
34
- },
35
- max: {
36
- description: 'number/text - maximal number for numeric input'
37
- },
38
- placeholder: {
39
- description: 'text'
40
- },
41
- icon: { description: 'JSX' },
42
- value: { description: '(* - required prop)' },
43
- className: { description: 'string' },
44
- mask: {
45
- description:
46
- 'string: force input to masked https://www.npmjs.com/package/react-input-mask'
47
- },
48
- symbolsLimit: {
49
- description: 'Set limit of symbols in input, overhead will be ignored'
50
- },
51
- onBlur: { description: 'custom callback on blur' },
52
- onFocus: { description: 'custom callback on focus' },
53
- onKeyUp: { description: 'custom callback on keyup, returns event keyCode' }
54
- }
55
- };
56
-
57
- const Template = (args) => {
58
- const [value, setValue] = useState('15000');
59
- return <NumericInput {...args} value={value} onChange={setValue} />;
60
- };
61
-
62
- export const NumericInputTemplate = Template.bind({});
63
-
64
- NumericInputTemplate.args = {
65
- disabled: false,
66
- isFocusDefault: false,
67
- error: '',
68
- isPriceInput: false,
69
- mask: '',
70
- withDelete: true,
71
- isNumeric: false,
72
- numStep: 100,
73
- min: '0',
74
- max: '15000',
75
- symbolsLimit: 5,
76
- placeholder: 'Placeholder',
77
- icon: <User />
78
- };
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
- import cn from 'classnames';
3
-
4
- import './RadioInput.scss';
5
-
6
- const RC = 'radio-input';
7
-
8
- const RadioInput = ({ label, id, checked, name, onChange, disabled, className, value }) => {
9
- return (
10
- <label className={cn(RC, className, { [`${RC}_disabled`]: disabled })} htmlFor={id}>
11
- <div className={cn(`${RC}__input`)}>
12
- <input
13
- id={id}
14
- type="radio"
15
- checked={checked === value}
16
- className={`${RC}__radio`}
17
- onChange={() => onChange(checked)}
18
- name={name}
19
- disabled={disabled}
20
- />
21
- <div className={`${RC}__mark`} />
22
- </div>
23
- {label && <div className={`${RC}__label`}>{label}</div>}
24
- </label>
25
- );
26
- };
27
-
28
- export default RadioInput;
@@ -1,63 +0,0 @@
1
- @import "../../../scss/vars";
2
-
3
- .radio-input {
4
- display: inline-flex;
5
- align-items: center;
6
- cursor: pointer;
7
-
8
- &_disabled {
9
- .radio-input__input {
10
- opacity: 0.3;
11
- pointer-events: none;
12
- cursor: auto;
13
- }
14
- }
15
-
16
- &:hover {
17
- .radio-input__input {
18
- background-color: $color--gray--light;
19
- }
20
- }
21
-
22
- &__input {
23
- width: 14px;
24
- height: 14px;
25
- border-radius: 50%;
26
- border: 1px solid $color--gray;
27
- position: relative;
28
- background-color: #ffff;
29
- }
30
-
31
- &__mark {
32
- width: 10px;
33
- height: 10px;
34
- border-radius: 50%;
35
- background-color: $color--primary;
36
- position: absolute;
37
- top: 0;
38
- bottom: 0;
39
- right: 0;
40
- left: 0;
41
- margin: auto;
42
- z-index: 1;
43
- display: none;
44
- }
45
-
46
- .radio-input__radio:checked ~ .radio-input__mark {
47
- display: block;
48
- }
49
-
50
- &__radio {
51
- opacity: 0;
52
- position: absolute;
53
- height: 0;
54
- width: 0;
55
- }
56
-
57
- &__label {
58
- font-size: 13px;
59
- font-weight: 400;
60
- user-select: none;
61
- margin-left: 5px;
62
- }
63
- }
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import RadioInput from './RadioInput';
3
-
4
- global.lng = 'en';
5
- export default {
6
- title: 'RadioInput',
7
- component: RadioInput
8
- };
9
-
10
- const Template = args => (
11
- <>
12
- <RadioInput {...args} />
13
- </>
14
- );
15
-
16
- export const Radio = Template.bind({});
17
-
18
- Radio.args = {
19
- name: 'test-name',
20
- label: 'Test label',
21
- disabled: false,
22
- value: false
23
- };