iguazio.dashboard-react-controls 0.0.5 → 0.0.8
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/Backdrop/Backdrop.js +48 -0
- package/dist/components/Backdrop/Backdrop.scss +32 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.js +100 -0
- package/dist/components/ConfirmDialog/confirmDialog.scss +19 -0
- package/dist/components/FormCheckBox/FormCheckBox.js +57 -0
- package/dist/components/FormCheckBox/formCheckBox.scss +33 -0
- package/dist/components/FormInput/FormInput.js +446 -0
- package/dist/components/FormInput/formInput.scss +92 -0
- package/dist/components/FormSelect/FormSelect.js +341 -0
- package/dist/components/FormSelect/FormSelect.test.js +158 -0
- package/dist/components/FormSelect/formSelect.scss +93 -0
- package/dist/components/Modal/Modal.js +116 -0
- package/dist/components/Modal/Modal.scss +121 -0
- package/dist/components/PopUpDialog/PopUpDialog.js +1 -1
- package/dist/components/PopUpDialog/popUpDialog.scss +2 -2
- package/dist/components/Tip/Tip.js +132 -0
- package/dist/components/Tip/Tip.test.js +96 -0
- package/dist/components/Tip/tip.scss +89 -0
- package/dist/components/Wizard/Wizard.js +239 -0
- package/dist/components/Wizard/Wizard.scss +17 -0
- package/dist/components/Wizard/WizardSteps/WizardSteps.js +65 -0
- package/dist/components/Wizard/WizardSteps/WizardSteps.scss +67 -0
- package/dist/components/index.js +56 -0
- package/dist/constants.js +29 -3
- package/dist/elements/OptionsMenu/OptionsMenu.js +63 -0
- package/dist/elements/OptionsMenu/optionsMenu.scss +49 -0
- package/dist/elements/SelectOption/SelectOption.js +95 -0
- package/dist/elements/SelectOption/SelectOption.test.js +99 -0
- package/dist/elements/SelectOption/selectOption.scss +61 -0
- package/dist/elements/ValidationTemplate/ValidationTemplate.js +48 -0
- package/dist/elements/ValidationTemplate/ValidationTemplate.scss +36 -0
- package/dist/elements/index.js +31 -0
- package/dist/hooks/index.js +13 -0
- package/dist/hooks/useDetectOutsideClick.js +34 -0
- package/dist/index.js +13 -5
- package/dist/scss/colors.scss +1 -0
- package/dist/scss/mixins.scss +105 -23
- package/dist/scss/variables.scss +1 -0
- package/dist/types.js +62 -2
- package/dist/utils/validationService.js +269 -0
- package/package.json +7 -4
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _components = require("../../components");
|
|
15
|
+
|
|
16
|
+
var _types = require("../../types");
|
|
17
|
+
|
|
18
|
+
var _checkmark = require("../../images/checkmark.svg");
|
|
19
|
+
|
|
20
|
+
require("./selectOption.scss");
|
|
21
|
+
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
var SelectOption = function SelectOption(_ref) {
|
|
27
|
+
var item = _ref.item,
|
|
28
|
+
_onClick = _ref.onClick,
|
|
29
|
+
selectType = _ref.selectType,
|
|
30
|
+
selectedId = _ref.selectedId,
|
|
31
|
+
withSelectedIcon = _ref.withSelectedIcon;
|
|
32
|
+
var selectClassName = (0, _classnames.default)('select__item', item.hidden && 'hidden', item.disabled && 'disabled');
|
|
33
|
+
|
|
34
|
+
if (selectType === 'checkbox') {
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
36
|
+
"data-testid": "select-checkbox",
|
|
37
|
+
className: "select__item",
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.FormCheckBox, {
|
|
39
|
+
item: item,
|
|
40
|
+
selectedId: selectedId,
|
|
41
|
+
onChange: _onClick,
|
|
42
|
+
children: [item.status && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
43
|
+
className: "state-".concat(item.status, "-job status")
|
|
44
|
+
}), item.label]
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
50
|
+
"data-testid": "select-option",
|
|
51
|
+
className: selectClassName,
|
|
52
|
+
onClick: function onClick() {
|
|
53
|
+
!item.disabled && _onClick(item.id);
|
|
54
|
+
},
|
|
55
|
+
children: [item.icon && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
56
|
+
"data-testid": "select-icon",
|
|
57
|
+
className: "select__icon",
|
|
58
|
+
children: item.icon
|
|
59
|
+
}), item.status && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
60
|
+
className: "state-".concat(item.status, "-job status")
|
|
61
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
62
|
+
className: "data-ellipsis label-row",
|
|
63
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
64
|
+
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextTooltipTemplate, {
|
|
65
|
+
text: item.label
|
|
66
|
+
}),
|
|
67
|
+
children: item.label
|
|
68
|
+
}), withSelectedIcon && item.id === selectedId && /*#__PURE__*/(0, _jsxRuntime.jsx)(_checkmark.ReactComponent, {
|
|
69
|
+
className: "checkmark"
|
|
70
|
+
})]
|
|
71
|
+
}), item.subLabel && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Tooltip, {
|
|
72
|
+
className: "sub-label",
|
|
73
|
+
template: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextTooltipTemplate, {
|
|
74
|
+
text: item.subLabel
|
|
75
|
+
}),
|
|
76
|
+
children: item.subLabel
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
SelectOption.defaultProps = {
|
|
82
|
+
onClick: function onClick() {},
|
|
83
|
+
selectType: '',
|
|
84
|
+
withSelectedIcon: true
|
|
85
|
+
};
|
|
86
|
+
SelectOption.propTypes = {
|
|
87
|
+
disabled: _propTypes.default.bool,
|
|
88
|
+
item: _types.SELECT_OPTION.isRequired,
|
|
89
|
+
onClick: _propTypes.default.func,
|
|
90
|
+
selectType: _propTypes.default.string,
|
|
91
|
+
selectedId: _propTypes.default.string,
|
|
92
|
+
withSelectedIcon: _propTypes.default.bool
|
|
93
|
+
};
|
|
94
|
+
var _default = SelectOption;
|
|
95
|
+
exports.default = _default;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _react = _interopRequireDefault(require("react"));
|
|
4
|
+
|
|
5
|
+
var _react2 = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _SelectOption = _interopRequireDefault(require("./SelectOption"));
|
|
8
|
+
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
|
|
17
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
|
|
19
|
+
var renderComponent = function renderComponent(props) {
|
|
20
|
+
return (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOption.default, _objectSpread({}, props)));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
jest.mock('igz-controls/images/checkbox-unchecked.svg', function () {
|
|
24
|
+
return {
|
|
25
|
+
ReactComponent: 'unchecked-icon'
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
jest.mock('igz-controls/images/checkbox-checked.svg', function () {
|
|
29
|
+
return {
|
|
30
|
+
ReactComponent: 'unchecked-icon'
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
describe('SelectOption component', function () {
|
|
34
|
+
var wrapper;
|
|
35
|
+
beforeEach(function () {
|
|
36
|
+
var props = {
|
|
37
|
+
item: {
|
|
38
|
+
label: 'Test1',
|
|
39
|
+
id: 'test1',
|
|
40
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
41
|
+
children: "icon"
|
|
42
|
+
}),
|
|
43
|
+
subLabel: 'Test1'
|
|
44
|
+
},
|
|
45
|
+
selectType: ''
|
|
46
|
+
};
|
|
47
|
+
wrapper = renderComponent(props);
|
|
48
|
+
});
|
|
49
|
+
afterEach(_react2.cleanup);
|
|
50
|
+
it('renders without crashing', function () {
|
|
51
|
+
expect(wrapper.queryByTestId('select-option')).not.toBeNull();
|
|
52
|
+
});
|
|
53
|
+
it('should display checkbox inside option if props selectType is "checkbox"', function () {
|
|
54
|
+
wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOption.default, {
|
|
55
|
+
item: {
|
|
56
|
+
label: 'Test1',
|
|
57
|
+
id: 'test1'
|
|
58
|
+
},
|
|
59
|
+
selectType: "checkbox",
|
|
60
|
+
selectedId: "test1"
|
|
61
|
+
}));
|
|
62
|
+
expect(wrapper.queryByTestId('select-checkbox')).not.toBeNull();
|
|
63
|
+
});
|
|
64
|
+
it('should display select icon if it exists in the props "item"', function () {
|
|
65
|
+
expect(wrapper.getByTestId('select-icon')).not.toBeNull();
|
|
66
|
+
});
|
|
67
|
+
it('should won\'t call onClick callback if props disable set to "true"', function () {
|
|
68
|
+
var mockCLick = jest.fn();
|
|
69
|
+
wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOption.default, {
|
|
70
|
+
item: {
|
|
71
|
+
label: 'Test1',
|
|
72
|
+
id: 'test1'
|
|
73
|
+
},
|
|
74
|
+
onCLick: mockCLick,
|
|
75
|
+
selectType: "test1",
|
|
76
|
+
disabled: true
|
|
77
|
+
}));
|
|
78
|
+
var selectOption = wrapper.getByTestId('select-option');
|
|
79
|
+
|
|
80
|
+
_react2.fireEvent.click(selectOption);
|
|
81
|
+
|
|
82
|
+
expect(mockCLick).toHaveBeenCalledTimes(0);
|
|
83
|
+
});
|
|
84
|
+
it('should display subLabel if it exists in props item', function () {
|
|
85
|
+
expect(wrapper.queryByTestId('tooltip-wrapper')).not.toBeNull();
|
|
86
|
+
});
|
|
87
|
+
it('should add class "disabled" to SelectOption if props disabled set to "true"', function () {
|
|
88
|
+
wrapper.rerender( /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectOption.default, {
|
|
89
|
+
item: {
|
|
90
|
+
label: 'Test1',
|
|
91
|
+
id: 'test1'
|
|
92
|
+
},
|
|
93
|
+
selectType: "test1",
|
|
94
|
+
disabled: true
|
|
95
|
+
}));
|
|
96
|
+
var selectOption = wrapper.getByTestId('select-option');
|
|
97
|
+
expect(selectOption.className).toMatch('disabled');
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@import '../../scss/colors';
|
|
2
|
+
@import '../../scss/mixins';
|
|
3
|
+
|
|
4
|
+
.select {
|
|
5
|
+
&__icon {
|
|
6
|
+
display: flex;
|
|
7
|
+
margin-right: 10px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__item {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 49px;
|
|
15
|
+
padding: 0 15px;
|
|
16
|
+
|
|
17
|
+
&.hidden {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.checkbox {
|
|
22
|
+
flex: 1;
|
|
23
|
+
height: 100%;
|
|
24
|
+
|
|
25
|
+
svg {
|
|
26
|
+
margin: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
background-color: $alabaster;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.status {
|
|
36
|
+
margin: 0 10px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.all {
|
|
40
|
+
margin: 0;
|
|
41
|
+
|
|
42
|
+
@include statusState(none);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.label-row {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-flow: row nowrap;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: space-between;
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.checkmark {
|
|
54
|
+
margin: 0 0 0 10px;
|
|
55
|
+
|
|
56
|
+
path {
|
|
57
|
+
fill: $chateauGreen;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
+
|
|
14
|
+
var _success_done = require("../../images/success_done.svg");
|
|
15
|
+
|
|
16
|
+
var _close = require("../../images/close.svg");
|
|
17
|
+
|
|
18
|
+
require("./ValidationTemplate.scss");
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
var ValidationTemplate = function ValidationTemplate(_ref) {
|
|
25
|
+
var valid = _ref.valid,
|
|
26
|
+
validationMessage = _ref.validationMessage;
|
|
27
|
+
var validationClasses = (0, _classnames.default)('validation-option', valid && 'text-muted');
|
|
28
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
|
|
29
|
+
className: validationClasses,
|
|
30
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
31
|
+
className: "validation-option__icon",
|
|
32
|
+
children: valid ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_success_done.ReactComponent, {
|
|
33
|
+
className: "validation-option__icon_valid"
|
|
34
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_close.ReactComponent, {
|
|
35
|
+
className: "validation-option__icon_invalid"
|
|
36
|
+
})
|
|
37
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
38
|
+
children: validationMessage
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
ValidationTemplate.propTypes = {
|
|
44
|
+
valid: _propTypes.default.bool.isRequired,
|
|
45
|
+
validationMessage: _propTypes.default.string.isRequired
|
|
46
|
+
};
|
|
47
|
+
var _default = ValidationTemplate;
|
|
48
|
+
exports.default = _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@import '../../scss/colors';
|
|
2
|
+
|
|
3
|
+
.validation-option {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: flex-start;
|
|
6
|
+
margin: 0.6rem 0;
|
|
7
|
+
padding: 0 1rem;
|
|
8
|
+
font-size: 0.875rem;
|
|
9
|
+
|
|
10
|
+
&__icon {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
width: 20px;
|
|
15
|
+
height: 20px;
|
|
16
|
+
margin-right: 0.5rem;
|
|
17
|
+
|
|
18
|
+
&_valid {
|
|
19
|
+
width: 14px;
|
|
20
|
+
height: 15px;
|
|
21
|
+
|
|
22
|
+
path {
|
|
23
|
+
fill: $brightTurquoise;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&_invalid {
|
|
28
|
+
width: 12px;
|
|
29
|
+
height: 12px;
|
|
30
|
+
|
|
31
|
+
path {
|
|
32
|
+
fill: $amaranth;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "OptionsMenu", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _OptionsMenu.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "SelectOption", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _SelectOption.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ValidationTemplate", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _ValidationTemplate.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _OptionsMenu = _interopRequireDefault(require("./OptionsMenu/OptionsMenu"));
|
|
26
|
+
|
|
27
|
+
var _SelectOption = _interopRequireDefault(require("./SelectOption/SelectOption"));
|
|
28
|
+
|
|
29
|
+
var _ValidationTemplate = _interopRequireDefault(require("./ValidationTemplate/ValidationTemplate"));
|
|
30
|
+
|
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useDetectOutsideClick", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _useDetectOutsideClick.useDetectOutsideClick;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _useDetectOutsideClick = require("./useDetectOutsideClick");
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useDetectOutsideClick = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Hook for handling closing when clicking outside of an element
|
|
12
|
+
* @function useDetectOutsideClick
|
|
13
|
+
* @param {React.node} ref
|
|
14
|
+
* @param {function} handler A callback function to use on outside click
|
|
15
|
+
*/
|
|
16
|
+
var useDetectOutsideClick = function useDetectOutsideClick(ref, handler) {
|
|
17
|
+
(0, _react.useEffect)(function () {
|
|
18
|
+
var onClick = function onClick(e) {
|
|
19
|
+
e.stopPropagation(); // If the active element exists and is clicked outside of
|
|
20
|
+
|
|
21
|
+
if (ref.current !== null && !ref.current.contains(e.target)) {
|
|
22
|
+
handler(e);
|
|
23
|
+
}
|
|
24
|
+
}; // If the item is active (ie open) then listen for clicks outside
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
window.addEventListener('click', onClick);
|
|
28
|
+
return function () {
|
|
29
|
+
window.removeEventListener('click', onClick);
|
|
30
|
+
};
|
|
31
|
+
}, [ref, handler]);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.useDetectOutsideClick = useDetectOutsideClick;
|
package/dist/index.js
CHANGED
|
@@ -5,20 +5,28 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.types = exports.constants = exports.components = void 0;
|
|
8
|
+
exports.types = exports.hooks = exports.elements = exports.constants = exports.components = void 0;
|
|
9
9
|
|
|
10
10
|
var components = _interopRequireWildcard(require("./components"));
|
|
11
11
|
|
|
12
12
|
exports.components = components;
|
|
13
13
|
|
|
14
|
-
var types = _interopRequireWildcard(require("./types"));
|
|
15
|
-
|
|
16
|
-
exports.types = types;
|
|
17
|
-
|
|
18
14
|
var constants = _interopRequireWildcard(require("./constants"));
|
|
19
15
|
|
|
20
16
|
exports.constants = constants;
|
|
21
17
|
|
|
18
|
+
var elements = _interopRequireWildcard(require("./elements"));
|
|
19
|
+
|
|
20
|
+
exports.elements = elements;
|
|
21
|
+
|
|
22
|
+
var hooks = _interopRequireWildcard(require("./hooks"));
|
|
23
|
+
|
|
24
|
+
exports.hooks = hooks;
|
|
25
|
+
|
|
26
|
+
var types = _interopRequireWildcard(require("./types"));
|
|
27
|
+
|
|
28
|
+
exports.types = types;
|
|
29
|
+
|
|
22
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
31
|
|
|
24
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/dist/scss/colors.scss
CHANGED
package/dist/scss/mixins.scss
CHANGED
|
@@ -181,9 +181,7 @@
|
|
|
181
181
|
&_grey {
|
|
182
182
|
@include chipButtonAddBackground($mulledWineThree, $topaz);
|
|
183
183
|
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
@else {
|
|
184
|
+
} @else {
|
|
187
185
|
&_none {
|
|
188
186
|
background-color: transparent;
|
|
189
187
|
}
|
|
@@ -261,9 +259,7 @@
|
|
|
261
259
|
&_medium {
|
|
262
260
|
@include chipButtonAddSize(34px);
|
|
263
261
|
}
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
@else {
|
|
262
|
+
} @else {
|
|
267
263
|
&_dense {
|
|
268
264
|
height: 26px;
|
|
269
265
|
}
|
|
@@ -308,9 +304,7 @@
|
|
|
308
304
|
&_purple {
|
|
309
305
|
@include editableChipFont($amethyst);
|
|
310
306
|
}
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
@else if $component == Chip {
|
|
307
|
+
} @else if $component == Chip {
|
|
314
308
|
&_white {
|
|
315
309
|
@include chipFont($white);
|
|
316
310
|
}
|
|
@@ -330,9 +324,7 @@
|
|
|
330
324
|
&_orange {
|
|
331
325
|
@include chipFont($sorbus);
|
|
332
326
|
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
@else if $component == ButtonAddChip {
|
|
327
|
+
} @else if $component == ButtonAddChip {
|
|
336
328
|
&_primary {
|
|
337
329
|
@include chipButtonAddColor($topaz);
|
|
338
330
|
}
|
|
@@ -722,6 +714,11 @@
|
|
|
722
714
|
}
|
|
723
715
|
}
|
|
724
716
|
|
|
717
|
+
.disabled {
|
|
718
|
+
color: $doveGray;
|
|
719
|
+
cursor: not-allowed;
|
|
720
|
+
}
|
|
721
|
+
|
|
725
722
|
.no-border {
|
|
726
723
|
border-bottom: none;
|
|
727
724
|
|
|
@@ -980,25 +977,110 @@
|
|
|
980
977
|
@mixin gradient($type) {
|
|
981
978
|
@if $type == 'card' {
|
|
982
979
|
background: linear-gradient(180deg, $brightTurquoise 4px, $white 4px);
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
@else {
|
|
986
|
-
background:
|
|
987
|
-
linear-gradient(
|
|
988
|
-
88.84deg,
|
|
989
|
-
#d873e1 5.49%,
|
|
990
|
-
#fc658f 57.67%,
|
|
991
|
-
#ffb971 107.73%
|
|
992
|
-
);
|
|
980
|
+
} @else {
|
|
981
|
+
background: linear-gradient(88.84deg, #d873e1 5.49%, #fc658f 57.67%, #ffb971 107.73%);
|
|
993
982
|
}
|
|
994
983
|
}
|
|
995
984
|
|
|
996
985
|
@mixin fieldWrapper {
|
|
986
|
+
display: flex;
|
|
987
|
+
flex: 1;
|
|
988
|
+
flex-flow: row nowrap;
|
|
989
|
+
align-items: center;
|
|
997
990
|
position: relative;
|
|
998
991
|
width: 100%;
|
|
999
|
-
padding: 18px 16px;
|
|
1000
992
|
color: $primary;
|
|
1001
993
|
background-color: transparent;
|
|
1002
994
|
border: $primaryBorder;
|
|
1003
995
|
border-radius: 4px;
|
|
1004
996
|
}
|
|
997
|
+
|
|
998
|
+
@mixin formField {
|
|
999
|
+
.form-field {
|
|
1000
|
+
position: relative;
|
|
1001
|
+
display: flex;
|
|
1002
|
+
flex-flow: column nowrap;
|
|
1003
|
+
height: 100%;
|
|
1004
|
+
width: 100%;
|
|
1005
|
+
|
|
1006
|
+
&__label {
|
|
1007
|
+
margin-bottom: 5px;
|
|
1008
|
+
color: $topaz;
|
|
1009
|
+
font-size: 12px;
|
|
1010
|
+
text-align: left;
|
|
1011
|
+
text-transform: capitalize;
|
|
1012
|
+
background-color: transparent;
|
|
1013
|
+
|
|
1014
|
+
&-mandatory {
|
|
1015
|
+
color: $amaranth;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
&-disabled {
|
|
1019
|
+
color: $spunPearl;
|
|
1020
|
+
|
|
1021
|
+
.form-field__label-mandatory {
|
|
1022
|
+
color: $spunPearl;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
&__wrapper {
|
|
1028
|
+
@include fieldWrapper;
|
|
1029
|
+
|
|
1030
|
+
&-disabled {
|
|
1031
|
+
color: $spunPearl;
|
|
1032
|
+
cursor: not-allowed;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
&-invalid {
|
|
1036
|
+
border: $errorBorder;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
&.without-border {
|
|
1040
|
+
border-color: transparent;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
&-dense {
|
|
1044
|
+
padding-top: 12px;
|
|
1045
|
+
padding-bottom: 12px;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
&-normal {
|
|
1049
|
+
padding-top: 14px;
|
|
1050
|
+
padding-bottom: 14px;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
&-medium {
|
|
1054
|
+
padding-top: 16px;
|
|
1055
|
+
padding-bottom: 16px;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
&-chunky {
|
|
1059
|
+
padding-top: 18px;
|
|
1060
|
+
padding-bottom: 18px;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
&__control {
|
|
1065
|
+
position: relative;
|
|
1066
|
+
display: flex;
|
|
1067
|
+
flex: 1;
|
|
1068
|
+
overflow: hidden;
|
|
1069
|
+
padding: 0 8px 0 16px;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
&__icons {
|
|
1073
|
+
display: flex;
|
|
1074
|
+
flex-shrink: 0;
|
|
1075
|
+
align-items: center;
|
|
1076
|
+
margin-right: 4px;
|
|
1077
|
+
min-height: 25px;
|
|
1078
|
+
|
|
1079
|
+
& > * {
|
|
1080
|
+
display: flex;
|
|
1081
|
+
align-items: center;
|
|
1082
|
+
padding: 0 4px;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}
|