@itcase/ui 1.1.1 → 1.1.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/dist/components/Button.js +8 -3
- package/dist/components/Cell.js +32 -14
- package/dist/components/DatePicker.js +2 -1
- package/dist/components/FormField.js +3 -3
- package/dist/components/Grid.js +2 -2
- package/dist/components/Icon.js +125 -16
- package/dist/components/Input.js +1 -8
- package/dist/components/InputMask.js +233 -0
- package/dist/components/InputPassword.js +6 -6
- package/dist/components/Label.js +4 -4
- package/dist/components/Modal.js +27 -27
- package/dist/components/{Fader.js → Overlay.js} +43 -43
- package/dist/components/Response.js +10 -9
- package/dist/components/ScrollOnDrag.js +290 -0
- package/dist/components/Search.js +19 -3
- package/dist/components/Tab.js +8 -8
- package/dist/components/Text.js +4 -4
- package/dist/constants/componentProps/borderWidth.js +3 -1
- package/dist/constants/componentProps/emojiSize.js +3 -1
- package/dist/constants/componentProps/iconFillSize.js +3 -1
- package/dist/constants/componentProps/iconSize.js +3 -1
- package/dist/constants/componentProps/sizePX.js +3 -1
- package/dist/css/components/DatePicker/DatePicker.css +12 -5
- package/dist/css/components/Group/Group.css +0 -8
- package/dist/css/components/InputMask/Input.css +77 -0
- package/dist/css/components/Label/Label.css +0 -19
- package/dist/css/components/Loader/Loader.css +1 -1
- package/dist/css/components/Modal/Modal.css +3 -3
- package/dist/css/components/{Fader/Fader.css → Overlay/Overlay.css} +10 -10
- package/dist/css/components/Response/Response.css +8 -0
- package/dist/css/components/ScrollOnDrag/ScrollOnDrag.css +6 -0
- package/dist/css/styles/align/align_vertical-reverse.css +6 -6
- package/dist/css/styles/align/align_vertical.css +8 -8
- package/dist/css/styles/border-color/border-color.css +1 -1
- package/dist/css/styles/border-color/border-color_focus.css +2 -2
- package/dist/css/styles/border-color/border-color_hover.css +1 -1
- package/dist/css/styles/caret-color/caret-color.css +1 -1
- package/dist/css/styles/fill/fill.css +2 -2
- package/dist/css/styles/fill/fill_active.css +2 -2
- package/dist/css/styles/fill/fill_active_hover.css +2 -2
- package/dist/css/styles/fill/fill_disabled.css +2 -2
- package/dist/css/styles/fill/fill_hover.css +2 -2
- package/dist/stories/ModalConfirm.stories.js +1 -1
- package/dist/stories/ModalDefault.stories.js +1 -1
- package/dist/stories/NotFound.stories.js +3 -4
- package/package.json +1 -1
- package/dist/components/Empty.js +0 -229
- package/dist/css/components/Empty/Empty.css +0 -21
- package/dist/stories/Empty.stories.js +0 -115
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var PropTypes = require('prop-types');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
7
|
+
require('lodash/castArray');
|
|
8
|
+
require('lodash/camelCase');
|
|
9
|
+
require('../context/UIContext.js');
|
|
10
|
+
require('../hooks/useMediaQueries.js');
|
|
11
|
+
require('react-responsive');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
16
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
17
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
18
|
+
|
|
19
|
+
const inputMaskConfig = {
|
|
20
|
+
state: {},
|
|
21
|
+
setState: newComponent => {
|
|
22
|
+
inputMaskConfig.state = newComponent;
|
|
23
|
+
},
|
|
24
|
+
appearance: {},
|
|
25
|
+
setAppearance: newComponent => {
|
|
26
|
+
inputMaskConfig.appearance = newComponent;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const Input = /*#__PURE__*/React__default.default.forwardRef(function Input(props, ref) {
|
|
30
|
+
const {
|
|
31
|
+
appearance,
|
|
32
|
+
state,
|
|
33
|
+
id,
|
|
34
|
+
index,
|
|
35
|
+
dataTestId,
|
|
36
|
+
type,
|
|
37
|
+
className,
|
|
38
|
+
name,
|
|
39
|
+
placeholder,
|
|
40
|
+
isDisabled,
|
|
41
|
+
value,
|
|
42
|
+
onBlur,
|
|
43
|
+
onChange,
|
|
44
|
+
onFocus,
|
|
45
|
+
onKeyDown
|
|
46
|
+
} = props;
|
|
47
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
48
|
+
prefix: 'fill_',
|
|
49
|
+
propsKey: 'fill'
|
|
50
|
+
});
|
|
51
|
+
const fillDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
52
|
+
prefix: 'fill_disabled_',
|
|
53
|
+
propsKey: 'fillDisabled'
|
|
54
|
+
});
|
|
55
|
+
const sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
56
|
+
prefix: 'input_size_',
|
|
57
|
+
propsKey: 'size'
|
|
58
|
+
});
|
|
59
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
60
|
+
prefix: 'input_shape_',
|
|
61
|
+
propsKey: 'shape'
|
|
62
|
+
});
|
|
63
|
+
const textSizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
64
|
+
prefix: 'text_size_',
|
|
65
|
+
propsKey: 'textSize'
|
|
66
|
+
});
|
|
67
|
+
const textColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
68
|
+
prefix: 'text-color_',
|
|
69
|
+
propsKey: 'textColor'
|
|
70
|
+
});
|
|
71
|
+
const textColorDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
72
|
+
prefix: 'text-color_disabled_',
|
|
73
|
+
propsKey: 'textColor'
|
|
74
|
+
});
|
|
75
|
+
const caretClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
76
|
+
prefix: 'caret-color_',
|
|
77
|
+
propsKey: 'caret'
|
|
78
|
+
});
|
|
79
|
+
const placeholderTextColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
80
|
+
prefix: 'placeholder-text-color_',
|
|
81
|
+
propsKey: 'placeholderTextColor'
|
|
82
|
+
});
|
|
83
|
+
const placeholderTextColorDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
84
|
+
prefix: 'placeholder-text-color_disabled_',
|
|
85
|
+
propsKey: 'placeholderTextColorDisabled'
|
|
86
|
+
});
|
|
87
|
+
const weightClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
88
|
+
prefix: 'text-weight_',
|
|
89
|
+
propsKey: 'textWeight'
|
|
90
|
+
});
|
|
91
|
+
const borderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
92
|
+
prefix: 'border-width_',
|
|
93
|
+
propsKey: 'borderWidth'
|
|
94
|
+
});
|
|
95
|
+
const borderWidthDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
96
|
+
prefix: 'border-width_disabled_',
|
|
97
|
+
propsKey: 'borderWidthDisabled'
|
|
98
|
+
});
|
|
99
|
+
const borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
100
|
+
prefix: 'border-color_',
|
|
101
|
+
propsKey: 'borderColor'
|
|
102
|
+
});
|
|
103
|
+
const borderColorDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
104
|
+
prefix: 'border-color_disabled_',
|
|
105
|
+
propsKey: 'borderColorDisabled'
|
|
106
|
+
});
|
|
107
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
108
|
+
prefix: 'width_',
|
|
109
|
+
propsKey: 'width'
|
|
110
|
+
});
|
|
111
|
+
return /*#__PURE__*/React__default.default.createElement("input", {
|
|
112
|
+
className: clsx__default.default(className, 'input', type === 'number' && 'input_type_number', (textSizeClass || textColorClass || weightClass) && 'text', caretClass, !isDisabled ? fillClass : fillDisabledClass, shapeClass || inputMaskConfig.appearance[appearance] && `input_shape_${inputMaskConfig.appearance[appearance].shape}`.replace(/([A-Z])/g, '-$1').toLowerCase(), textSizeClass || inputMaskConfig.appearance[appearance] && `text_size_${inputMaskConfig.appearance[appearance].textSize}`.replace(/([A-Z])/g, '-$1').toLowerCase(), weightClass, widthClass, !isDisabled ? borderWidthClass : borderWidthDisabledClass, sizeClass || inputMaskConfig.appearance[appearance] && `input_size_${inputMaskConfig.appearance[appearance].size}`.replace(/([A-Z])/g, '-$1').toLowerCase(), borderColorClass || inputMaskConfig.appearance[appearance]?.borderColor && `border-color_${inputMaskConfig.appearance[appearance].borderColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), placeholderTextColorClass || inputMaskConfig.appearance[appearance]?.placeholderTextColor && `placeholder-text-color_${inputMaskConfig.appearance[appearance].placeholderTextColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), textColorClass || inputMaskConfig.appearance[appearance]?.textColor && `text-color_${inputMaskConfig.appearance[appearance].textColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), !isDisabled ? borderColorClass || inputMaskConfig.state[state]?.borderColor && `border-color_${inputMaskConfig.state[state].borderColor}`.replace(/([A-Z])/g, '-$1').toLowerCase() : borderColorDisabledClass || inputMaskConfig.state[state]?.borderColor && `border-color_disabled_${inputMaskConfig.state[state].borderColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), !isDisabled ? placeholderTextColorClass || inputMaskConfig.state[state]?.placeholderTextColor && `placeholder-text-color_${inputMaskConfig.state[state].placeholderTextColor}`.replace(/([A-Z])/g, '-$1').toLowerCase() : placeholderTextColorDisabledClass || inputMaskConfig.state[state]?.placeholderTextColor && `placeholder-text-color_${inputMaskConfig.state[state].placeholderTextColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), !isDisabled ? textColorClass || inputMaskConfig.state[state]?.textColor && `text-color_${inputMaskConfig.state[state].textColor}`.replace(/([A-Z])/g, '-$1').toLowerCase() : textColorDisabledClass || inputMaskConfig.state[state]?.textColor && `text-color_${inputMaskConfig.state[state].textColor}`.replace(/([A-Z])/g, '-$1').toLowerCase()),
|
|
113
|
+
type: type,
|
|
114
|
+
id: id,
|
|
115
|
+
index: index,
|
|
116
|
+
ref: ref,
|
|
117
|
+
disabled: isDisabled,
|
|
118
|
+
placeholder: placeholder,
|
|
119
|
+
"data-test-id": dataTestId || (name ? `${name}Input` : 'input'),
|
|
120
|
+
value: value,
|
|
121
|
+
onBlur: onBlur,
|
|
122
|
+
onChange: onChange,
|
|
123
|
+
onFocus: onFocus,
|
|
124
|
+
onKeyDown: onKeyDown
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
Input.propTypes = {
|
|
128
|
+
id: PropTypes__default.default.string,
|
|
129
|
+
className: PropTypes__default.default.string,
|
|
130
|
+
placeholder: PropTypes__default.default.string,
|
|
131
|
+
value: PropTypes__default.default.string,
|
|
132
|
+
checked: PropTypes__default.default.bool,
|
|
133
|
+
isDisabled: PropTypes__default.default.bool,
|
|
134
|
+
onBlur: PropTypes__default.default.func,
|
|
135
|
+
onChange: PropTypes__default.default.func,
|
|
136
|
+
onKeyDown: PropTypes__default.default.func,
|
|
137
|
+
type: PropTypes__default.default.string
|
|
138
|
+
};
|
|
139
|
+
Input.defaultProps = {
|
|
140
|
+
size: 'm',
|
|
141
|
+
type: 'text'
|
|
142
|
+
};
|
|
143
|
+
Input.__docgenInfo = {
|
|
144
|
+
"description": "",
|
|
145
|
+
"methods": [],
|
|
146
|
+
"displayName": "Input",
|
|
147
|
+
"props": {
|
|
148
|
+
"size": {
|
|
149
|
+
"defaultValue": {
|
|
150
|
+
"value": "'m'",
|
|
151
|
+
"computed": false
|
|
152
|
+
},
|
|
153
|
+
"required": false
|
|
154
|
+
},
|
|
155
|
+
"type": {
|
|
156
|
+
"defaultValue": {
|
|
157
|
+
"value": "'text'",
|
|
158
|
+
"computed": false
|
|
159
|
+
},
|
|
160
|
+
"description": "",
|
|
161
|
+
"type": {
|
|
162
|
+
"name": "string"
|
|
163
|
+
},
|
|
164
|
+
"required": false
|
|
165
|
+
},
|
|
166
|
+
"id": {
|
|
167
|
+
"description": "",
|
|
168
|
+
"type": {
|
|
169
|
+
"name": "string"
|
|
170
|
+
},
|
|
171
|
+
"required": false
|
|
172
|
+
},
|
|
173
|
+
"className": {
|
|
174
|
+
"description": "",
|
|
175
|
+
"type": {
|
|
176
|
+
"name": "string"
|
|
177
|
+
},
|
|
178
|
+
"required": false
|
|
179
|
+
},
|
|
180
|
+
"placeholder": {
|
|
181
|
+
"description": "",
|
|
182
|
+
"type": {
|
|
183
|
+
"name": "string"
|
|
184
|
+
},
|
|
185
|
+
"required": false
|
|
186
|
+
},
|
|
187
|
+
"value": {
|
|
188
|
+
"description": "",
|
|
189
|
+
"type": {
|
|
190
|
+
"name": "string"
|
|
191
|
+
},
|
|
192
|
+
"required": false
|
|
193
|
+
},
|
|
194
|
+
"checked": {
|
|
195
|
+
"description": "",
|
|
196
|
+
"type": {
|
|
197
|
+
"name": "bool"
|
|
198
|
+
},
|
|
199
|
+
"required": false
|
|
200
|
+
},
|
|
201
|
+
"isDisabled": {
|
|
202
|
+
"description": "",
|
|
203
|
+
"type": {
|
|
204
|
+
"name": "bool"
|
|
205
|
+
},
|
|
206
|
+
"required": false
|
|
207
|
+
},
|
|
208
|
+
"onBlur": {
|
|
209
|
+
"description": "",
|
|
210
|
+
"type": {
|
|
211
|
+
"name": "func"
|
|
212
|
+
},
|
|
213
|
+
"required": false
|
|
214
|
+
},
|
|
215
|
+
"onChange": {
|
|
216
|
+
"description": "",
|
|
217
|
+
"type": {
|
|
218
|
+
"name": "func"
|
|
219
|
+
},
|
|
220
|
+
"required": false
|
|
221
|
+
},
|
|
222
|
+
"onKeyDown": {
|
|
223
|
+
"description": "",
|
|
224
|
+
"type": {
|
|
225
|
+
"name": "func"
|
|
226
|
+
},
|
|
227
|
+
"required": false
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
exports.Input = Input;
|
|
233
|
+
exports.inputMaskConfig = inputMaskConfig;
|
|
@@ -55,7 +55,7 @@ const inputPasswordConfig = {
|
|
|
55
55
|
inputPasswordConfig.appearance = newComponent;
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
function
|
|
58
|
+
function InputMask(props) {
|
|
59
59
|
const {
|
|
60
60
|
appearance,
|
|
61
61
|
state,
|
|
@@ -152,7 +152,7 @@ function InputPassword(props) {
|
|
|
152
152
|
onClick: revealeHandler
|
|
153
153
|
}));
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
InputMask.propTypes = {
|
|
156
156
|
id: PropTypes__default.default.string,
|
|
157
157
|
className: PropTypes__default.default.string,
|
|
158
158
|
placeholder: PropTypes__default.default.string,
|
|
@@ -164,14 +164,14 @@ InputPassword.propTypes = {
|
|
|
164
164
|
onKeyDown: PropTypes__default.default.func,
|
|
165
165
|
type: PropTypes__default.default.string
|
|
166
166
|
};
|
|
167
|
-
|
|
167
|
+
InputMask.defaultProps = {
|
|
168
168
|
size: 'm',
|
|
169
169
|
type: 'text'
|
|
170
170
|
};
|
|
171
|
-
|
|
171
|
+
InputMask.__docgenInfo = {
|
|
172
172
|
"description": "",
|
|
173
173
|
"methods": [],
|
|
174
|
-
"displayName": "
|
|
174
|
+
"displayName": "InputMask",
|
|
175
175
|
"props": {
|
|
176
176
|
"size": {
|
|
177
177
|
"defaultValue": {
|
|
@@ -257,5 +257,5 @@ InputPassword.__docgenInfo = {
|
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
259
|
|
|
260
|
-
exports.
|
|
260
|
+
exports.InputMask = InputMask;
|
|
261
261
|
exports.inputPasswordConfig = inputPasswordConfig;
|
package/dist/components/Label.js
CHANGED
|
@@ -112,7 +112,7 @@ function Label(props) {
|
|
|
112
112
|
prefix: 'border_type_',
|
|
113
113
|
propsKey: 'borderType'
|
|
114
114
|
});
|
|
115
|
-
|
|
115
|
+
useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
116
116
|
prefix: 'label_text-align_',
|
|
117
117
|
propsKey: 'textAlign'
|
|
118
118
|
});
|
|
@@ -136,7 +136,7 @@ function Label(props) {
|
|
|
136
136
|
// } = labelAppearanceItem
|
|
137
137
|
|
|
138
138
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
139
|
-
className: clsx__default.default(className, 'label', fillClass || labelAppearanceItem.fill && `fill_${labelAppearanceItem.fill}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillHoverClass || labelAppearanceItem.fillHover && `fill_hover_${labelAppearanceItem.fillHover}`.replace(/([A-Z])/g, '-$1').toLowerCase(), shapeClass, borderClass, borderTypeClass, sizeClass, wrapClass, widthClass, alignDirectionClass, alignClass,
|
|
139
|
+
className: clsx__default.default(className, 'label', fillClass || labelAppearanceItem.fill && `fill_${labelAppearanceItem.fill}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillHoverClass || labelAppearanceItem.fillHover && `fill_hover_${labelAppearanceItem.fillHover}`.replace(/([A-Z])/g, '-$1').toLowerCase(), shapeClass || labelAppearanceItem.shape && `label_shape_${labelAppearanceItem.shape}`.replace(/([A-Z])/g, '-$1').toLowerCase(), borderClass, borderTypeClass, sizeClass || labelAppearanceItem.size && `label_size_${labelAppearanceItem.size}`.replace(/([A-Z])/g, '-$1').toLowerCase(), wrapClass, widthClass, alignDirectionClass, alignClass, type && `label_type_${type}`, set && `label_set_${set}`, mode && `label_mode_${mode}`, onClick && (cursor || 'cursor_type_pointer')),
|
|
140
140
|
"data-tour": dataTour,
|
|
141
141
|
style: labelStyles,
|
|
142
142
|
onClick: onClick,
|
|
@@ -146,12 +146,12 @@ function Label(props) {
|
|
|
146
146
|
className: "label__inner"
|
|
147
147
|
}, typeof label === 'string' ? /*#__PURE__*/React__default.default.createElement(index.Text, {
|
|
148
148
|
className: "label__label",
|
|
149
|
-
size: labelTextSize,
|
|
149
|
+
size: labelTextSize || labelAppearanceItem.labelTextSize,
|
|
150
150
|
textColor: labelTextColor || labelAppearanceItem.labelTextColor,
|
|
151
151
|
textColorHover: labelTextColorHover || labelAppearanceItem.labelTextColorHover,
|
|
152
152
|
textWeight: labelTextWeight || labelAppearanceItem.labelTextWeight,
|
|
153
153
|
textWrap: labelTextWrap
|
|
154
|
-
}, label) : /*#__PURE__*/React__default.default.createElement("div", {
|
|
154
|
+
}, label || labelAppearanceItem.label) : /*#__PURE__*/React__default.default.createElement("div", {
|
|
155
155
|
className: "label__label"
|
|
156
156
|
}, label), children, showTooltip && /*#__PURE__*/React__default.default.createElement(index$1.Tooltip, {
|
|
157
157
|
alignment: tooltipAlignment,
|
package/dist/components/Modal.js
CHANGED
|
@@ -4,7 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var PropTypes = require('prop-types');
|
|
5
5
|
var ReactDOM = require('react-dom');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
|
-
var index = require('./
|
|
7
|
+
var index = require('./Overlay.js');
|
|
8
8
|
var useStyles = require('../hooks/useStyles.js');
|
|
9
9
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
10
10
|
var index$1 = require('./Loader.js');
|
|
@@ -59,11 +59,11 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
59
59
|
closeButton,
|
|
60
60
|
contentClassName,
|
|
61
61
|
id,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
isOverlay,
|
|
63
|
+
overlayClassName,
|
|
64
|
+
overlayFill,
|
|
65
|
+
overlayFillGradient,
|
|
66
|
+
overlayOpacity,
|
|
67
67
|
isOpen: initialIsOpen,
|
|
68
68
|
isScrollOnOpen,
|
|
69
69
|
isSetFocusOnOpen,
|
|
@@ -83,7 +83,7 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
83
83
|
}
|
|
84
84
|
}, []);
|
|
85
85
|
const modalContentRef = React.useRef(null);
|
|
86
|
-
const
|
|
86
|
+
const modalOverlayRef = React.useRef(null);
|
|
87
87
|
const [isOpen, setIsOpen] = React.useState(initialIsOpen);
|
|
88
88
|
const addModalProps = React.useCallback(element => {
|
|
89
89
|
// Change class need in "useEffect"
|
|
@@ -132,10 +132,10 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
132
132
|
if (modalContentElement) {
|
|
133
133
|
modalContentElement.parentNode.appendChild(modalContentElement)
|
|
134
134
|
}
|
|
135
|
-
// Also move
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
|
|
135
|
+
// Also move overlay to end of modal root container after container
|
|
136
|
+
const modalOverlayElement = modalOverlayRef.current
|
|
137
|
+
if (modalOverlayElement) {
|
|
138
|
+
modalOverlayElement.parentNode.appendChild(modalOverlayElement)
|
|
139
139
|
}
|
|
140
140
|
*/
|
|
141
141
|
}, [onOpenModal]);
|
|
@@ -206,13 +206,13 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
206
206
|
onClick: closeModal
|
|
207
207
|
}, closeButton), /*#__PURE__*/React__default.default.createElement("div", {
|
|
208
208
|
className: "modal-content__wrapper"
|
|
209
|
-
}, children)), /*#__PURE__*/React__default.default.createElement(index.
|
|
210
|
-
className: clsx__default.default('
|
|
211
|
-
fill:
|
|
212
|
-
fillGradient:
|
|
213
|
-
|
|
214
|
-
opacity:
|
|
215
|
-
ref:
|
|
209
|
+
}, children)), /*#__PURE__*/React__default.default.createElement(index.Overlay, {
|
|
210
|
+
className: clsx__default.default('modal__overlay', 'overlay_type_modal', overlayClassName),
|
|
211
|
+
fill: overlayFill,
|
|
212
|
+
fillGradient: overlayFillGradient,
|
|
213
|
+
isOverlay: isOverlay,
|
|
214
|
+
opacity: overlayOpacity,
|
|
215
|
+
ref: modalOverlayRef
|
|
216
216
|
})) : null,
|
|
217
217
|
// A DOM element
|
|
218
218
|
modalElement);
|
|
@@ -224,11 +224,11 @@ Modal.propTypes = {
|
|
|
224
224
|
closeText: PropTypes__default.default.string,
|
|
225
225
|
contentClassName: PropTypes__default.default.string,
|
|
226
226
|
debug: PropTypes__default.default.bool,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
overlayFill: PropTypes__default.default.string,
|
|
228
|
+
overlayFillGradient: PropTypes__default.default.string,
|
|
229
|
+
overlayOpacity: PropTypes__default.default.string,
|
|
230
230
|
id: PropTypes__default.default.string,
|
|
231
|
-
|
|
231
|
+
isOverlay: PropTypes__default.default.bool,
|
|
232
232
|
isScrollOnOpen: PropTypes__default.default.bool,
|
|
233
233
|
isSetFocusOnOpen: PropTypes__default.default.bool,
|
|
234
234
|
modalQuerySelector: PropTypes__default.default.string,
|
|
@@ -236,7 +236,7 @@ Modal.propTypes = {
|
|
|
236
236
|
onOpenModal: PropTypes__default.default.func
|
|
237
237
|
};
|
|
238
238
|
Modal.defaultProps = {
|
|
239
|
-
|
|
239
|
+
isOverlay: true,
|
|
240
240
|
isOpen: false,
|
|
241
241
|
isScrollOnOpen: true,
|
|
242
242
|
isSetFocusOnOpen: true,
|
|
@@ -247,7 +247,7 @@ Modal.__docgenInfo = {
|
|
|
247
247
|
"methods": [],
|
|
248
248
|
"displayName": "Modal",
|
|
249
249
|
"props": {
|
|
250
|
-
"
|
|
250
|
+
"isOverlay": {
|
|
251
251
|
"defaultValue": {
|
|
252
252
|
"value": "true",
|
|
253
253
|
"computed": false
|
|
@@ -340,21 +340,21 @@ Modal.__docgenInfo = {
|
|
|
340
340
|
},
|
|
341
341
|
"required": false
|
|
342
342
|
},
|
|
343
|
-
"
|
|
343
|
+
"overlayFill": {
|
|
344
344
|
"description": "",
|
|
345
345
|
"type": {
|
|
346
346
|
"name": "string"
|
|
347
347
|
},
|
|
348
348
|
"required": false
|
|
349
349
|
},
|
|
350
|
-
"
|
|
350
|
+
"overlayFillGradient": {
|
|
351
351
|
"description": "",
|
|
352
352
|
"type": {
|
|
353
353
|
"name": "string"
|
|
354
354
|
},
|
|
355
355
|
"required": false
|
|
356
356
|
},
|
|
357
|
-
"
|
|
357
|
+
"overlayOpacity": {
|
|
358
358
|
"description": "",
|
|
359
359
|
"type": {
|
|
360
360
|
"name": "string"
|
|
@@ -22,10 +22,10 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
22
22
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
23
23
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
24
24
|
|
|
25
|
-
function
|
|
25
|
+
function Overlay(props) {
|
|
26
26
|
const {
|
|
27
27
|
className,
|
|
28
|
-
|
|
28
|
+
isOverlay,
|
|
29
29
|
type
|
|
30
30
|
} = props;
|
|
31
31
|
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
@@ -41,19 +41,15 @@ function Fader(props) {
|
|
|
41
41
|
propsKey: 'opacity'
|
|
42
42
|
});
|
|
43
43
|
const {
|
|
44
|
-
styles:
|
|
44
|
+
styles: overlayStyles
|
|
45
45
|
} = useStyles.useStyles(props);
|
|
46
46
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
47
|
-
className: clsx__default.default(className, '
|
|
48
|
-
style:
|
|
47
|
+
className: clsx__default.default(className, 'overlay', opacityClass, isOverlay && 'overlay_state_visible', type && `${className}_type_${type}`, fillClass, fillGradientClass),
|
|
48
|
+
style: overlayStyles
|
|
49
49
|
}, "\xA0");
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
Overlay.propTypes = {
|
|
52
52
|
className: PropTypes__default.default.string,
|
|
53
|
-
opacity: PropTypes__default.default.string,
|
|
54
|
-
opacityDesktop: PropTypes__default.default.string,
|
|
55
|
-
opacityMobile: PropTypes__default.default.string,
|
|
56
|
-
opacityTablet: PropTypes__default.default.string,
|
|
57
53
|
fill: PropTypes__default.default.oneOf(fill.default),
|
|
58
54
|
fillMobile: PropTypes__default.default.oneOf(fill.default),
|
|
59
55
|
fillTablet: PropTypes__default.default.oneOf(fill.default),
|
|
@@ -62,13 +58,17 @@ Fader.propTypes = {
|
|
|
62
58
|
fillGradientMobile: PropTypes__default.default.oneOf(fillGradient.default),
|
|
63
59
|
fillGradientTablet: PropTypes__default.default.oneOf(fillGradient.default),
|
|
64
60
|
fillGradientDesktop: PropTypes__default.default.oneOf(fillGradient.default),
|
|
61
|
+
opacity: PropTypes__default.default.string,
|
|
62
|
+
opacityDesktop: PropTypes__default.default.string,
|
|
63
|
+
opacityMobile: PropTypes__default.default.string,
|
|
64
|
+
opacityTablet: PropTypes__default.default.string,
|
|
65
65
|
type: PropTypes__default.default.string,
|
|
66
|
-
|
|
66
|
+
isOverlay: PropTypes__default.default.any
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
Overlay.__docgenInfo = {
|
|
69
69
|
"description": "",
|
|
70
70
|
"methods": [],
|
|
71
|
-
"displayName": "
|
|
71
|
+
"displayName": "Overlay",
|
|
72
72
|
"props": {
|
|
73
73
|
"className": {
|
|
74
74
|
"description": "",
|
|
@@ -77,34 +77,6 @@ Fader.__docgenInfo = {
|
|
|
77
77
|
},
|
|
78
78
|
"required": false
|
|
79
79
|
},
|
|
80
|
-
"opacity": {
|
|
81
|
-
"description": "",
|
|
82
|
-
"type": {
|
|
83
|
-
"name": "string"
|
|
84
|
-
},
|
|
85
|
-
"required": false
|
|
86
|
-
},
|
|
87
|
-
"opacityDesktop": {
|
|
88
|
-
"description": "",
|
|
89
|
-
"type": {
|
|
90
|
-
"name": "string"
|
|
91
|
-
},
|
|
92
|
-
"required": false
|
|
93
|
-
},
|
|
94
|
-
"opacityMobile": {
|
|
95
|
-
"description": "",
|
|
96
|
-
"type": {
|
|
97
|
-
"name": "string"
|
|
98
|
-
},
|
|
99
|
-
"required": false
|
|
100
|
-
},
|
|
101
|
-
"opacityTablet": {
|
|
102
|
-
"description": "",
|
|
103
|
-
"type": {
|
|
104
|
-
"name": "string"
|
|
105
|
-
},
|
|
106
|
-
"required": false
|
|
107
|
-
},
|
|
108
80
|
"fill": {
|
|
109
81
|
"description": "",
|
|
110
82
|
"type": {
|
|
@@ -177,6 +149,34 @@ Fader.__docgenInfo = {
|
|
|
177
149
|
},
|
|
178
150
|
"required": false
|
|
179
151
|
},
|
|
152
|
+
"opacity": {
|
|
153
|
+
"description": "",
|
|
154
|
+
"type": {
|
|
155
|
+
"name": "string"
|
|
156
|
+
},
|
|
157
|
+
"required": false
|
|
158
|
+
},
|
|
159
|
+
"opacityDesktop": {
|
|
160
|
+
"description": "",
|
|
161
|
+
"type": {
|
|
162
|
+
"name": "string"
|
|
163
|
+
},
|
|
164
|
+
"required": false
|
|
165
|
+
},
|
|
166
|
+
"opacityMobile": {
|
|
167
|
+
"description": "",
|
|
168
|
+
"type": {
|
|
169
|
+
"name": "string"
|
|
170
|
+
},
|
|
171
|
+
"required": false
|
|
172
|
+
},
|
|
173
|
+
"opacityTablet": {
|
|
174
|
+
"description": "",
|
|
175
|
+
"type": {
|
|
176
|
+
"name": "string"
|
|
177
|
+
},
|
|
178
|
+
"required": false
|
|
179
|
+
},
|
|
180
180
|
"type": {
|
|
181
181
|
"description": "",
|
|
182
182
|
"type": {
|
|
@@ -184,7 +184,7 @@ Fader.__docgenInfo = {
|
|
|
184
184
|
},
|
|
185
185
|
"required": false
|
|
186
186
|
},
|
|
187
|
-
"
|
|
187
|
+
"isOverlay": {
|
|
188
188
|
"description": "",
|
|
189
189
|
"type": {
|
|
190
190
|
"name": "any"
|
|
@@ -194,4 +194,4 @@ Fader.__docgenInfo = {
|
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
|
|
197
|
-
exports.
|
|
197
|
+
exports.Overlay = Overlay;
|
|
@@ -98,6 +98,7 @@ function Response(props) {
|
|
|
98
98
|
secondaryButtonShape,
|
|
99
99
|
secondaryButtonSize,
|
|
100
100
|
secondaryButtonWidth,
|
|
101
|
+
set,
|
|
101
102
|
onClickPrimaryButton,
|
|
102
103
|
onClickSecondaryButton
|
|
103
104
|
} = props;
|
|
@@ -144,8 +145,8 @@ function Response(props) {
|
|
|
144
145
|
propsKey: 'borderType'
|
|
145
146
|
});
|
|
146
147
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
147
|
-
className: clsx__default.default(className, 'response', fillClass, fillHoverClass, shapeClass, borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass)
|
|
148
|
-
}, before, ImageComponent, /*#__PURE__*/React__default.default.createElement(index.Group, {
|
|
148
|
+
className: clsx__default.default(className, 'response', fillClass, fillHoverClass, shapeClass, borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, set && `response_set_${set}`)
|
|
149
|
+
}, before, ImageComponent || responseConfig.appearance[appearance]?.imageSrc, /*#__PURE__*/React__default.default.createElement(index.Group, {
|
|
149
150
|
className: "response__desc",
|
|
150
151
|
width: "fill"
|
|
151
152
|
}, title && /*#__PURE__*/React__default.default.createElement(index$1.Title, {
|
|
@@ -157,31 +158,31 @@ function Response(props) {
|
|
|
157
158
|
className: "response__message",
|
|
158
159
|
size: messageTextSize || responseConfig.appearance[appearance]?.messageTextSize,
|
|
159
160
|
textColor: messageTextColor || responseConfig.appearance[appearance]?.messageTextColor
|
|
160
|
-
}, message)), (primaryButtonLabel || primaryButton || secondaryButtonLabel || secondaryButton) && /*#__PURE__*/React__default.default.createElement(index.Group, {
|
|
161
|
+
}, message)), (primaryButtonLabel || responseConfig.appearance[appearance]?.primaryButtonLabel || primaryButton || secondaryButtonLabel || responseConfig.appearance[appearance]?.secondaryButtonLabel || secondaryButton) && /*#__PURE__*/React__default.default.createElement(index.Group, {
|
|
161
162
|
className: "response__button",
|
|
162
163
|
width: "fill"
|
|
163
|
-
}, primaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(index$3.Button, {
|
|
164
|
+
}, primaryButtonLabel || responseConfig.appearance[appearance].primaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(index$3.Button, {
|
|
164
165
|
after: primaryButtonAfter,
|
|
165
|
-
appearance: primaryButtonAppearance || responseConfig.appearance[appearance]?.primaryButtonAppearance,
|
|
166
|
+
appearance: primaryButtonAppearance || responseConfig.appearance[appearance]?.primaryButtonAppearance || 'dev',
|
|
166
167
|
before: primaryButtonBefore,
|
|
167
168
|
className: "response__button-item",
|
|
168
169
|
fill: primaryButtonFill,
|
|
169
170
|
fillHover: primaryButtonFillHover,
|
|
170
|
-
label: primaryButtonLabel,
|
|
171
|
+
label: primaryButtonLabel || responseConfig.appearance[appearance].primaryButtonLabel,
|
|
171
172
|
labelTextColor: primaryButtonLabelTextColor,
|
|
172
173
|
labelTextSize: primaryButtonLabelTextSize || responseConfig.appearance[appearance]?.primaryButtonLabelTextSize,
|
|
173
174
|
shape: primaryButtonShape || responseConfig.appearance[appearance]?.primaryButtonShape,
|
|
174
175
|
size: primaryButtonSize || responseConfig.appearance[appearance]?.primaryButtonSize,
|
|
175
176
|
width: primaryButtonWidth || responseConfig.appearance[appearance]?.primaryButtonWidth,
|
|
176
177
|
onClick: onClickPrimaryButton
|
|
177
|
-
}) : primaryButton, secondaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(index$3.Button, {
|
|
178
|
+
}) : primaryButton, secondaryButtonLabel || responseConfig.appearance[appearance]?.secondaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(index$3.Button, {
|
|
178
179
|
after: secondaryButtonAfter,
|
|
179
|
-
appearance: secondaryButtonAppearance || responseConfig.appearance[appearance]?.secondaryButtonAppearance,
|
|
180
|
+
appearance: secondaryButtonAppearance || responseConfig.appearance[appearance]?.secondaryButtonAppearance || 'dev',
|
|
180
181
|
before: secondaryButtonBefore,
|
|
181
182
|
className: "response__button-item",
|
|
182
183
|
fill: secondaryButtonFill,
|
|
183
184
|
fillHover: secondaryButtonFillHover,
|
|
184
|
-
label: secondaryButtonLabel,
|
|
185
|
+
label: secondaryButtonLabel || responseConfig.appearance[appearance].secondaryButtonLabel,
|
|
185
186
|
labelTextColor: secondaryButtonLabelTextColor,
|
|
186
187
|
labelTextSize: secondaryButtonLabelTextSize || responseConfig.appearance[appearance]?.secondaryButtonLabelTextSize,
|
|
187
188
|
shape: secondaryButtonShape || responseConfig.appearance[appearance]?.secondaryButtonShape,
|