@spaced-out/ui-design-system 0.0.1-alpha.0 → 0.0.1-alpha.1
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/CHANGELOG.md +7 -0
- package/babel.config.js +1 -6
- package/lib/components/Button/Button.js +31 -40
- package/lib/components/ButtonDropdown/ButtonDropdown.js +39 -46
- package/lib/components/Checkbox/Checkbox.js +36 -41
- package/lib/components/Checkbox/CheckboxGroup.js +12 -16
- package/lib/components/CircularLoader/CircularLoader.js +16 -19
- package/lib/components/CodeBlock.js +4 -8
- package/lib/components/Dialog/Dialog.js +38 -51
- package/lib/components/Dropdown/Dropdown.js +46 -51
- package/lib/components/Grid/Grid.js +6 -9
- package/lib/components/Icon/ClickableIcon.js +6 -10
- package/lib/components/Icon/Icon.js +6 -10
- package/lib/components/InContextAlert/InContextAlert.js +29 -35
- package/lib/components/Input/Input.js +65 -78
- package/lib/components/LinearLoader/LinearLoader.js +8 -10
- package/lib/components/Menu/Menu.js +37 -40
- package/lib/components/Modal/Modal.js +18 -22
- package/lib/components/Notification/Notification.js +26 -32
- package/lib/components/Panel/Panel.js +23 -36
- package/lib/components/RadioButton/RadioButton.js +23 -27
- package/lib/components/RadioButton/RadioGroup.js +12 -16
- package/lib/components/SearchInput/SearchInput.js +3 -5
- package/lib/components/Text/Text.js +45 -61
- package/lib/components/Textarea/Textarea.js +34 -45
- package/lib/components/Toast/Toast.js +26 -38
- package/lib/components/Toast/ToastContainer.js +4 -5
- package/lib/components/Toggle/Toggle.js +21 -26
- package/lib/components/Tooltip/Tooltip.js +21 -30
- package/lib/components/Truncate/Truncate.js +3 -5
- package/lib/components/Typeahead/Typeahead.js +50 -55
- package/lib/utils/makeClassNameComponent.js +5 -8
- package/package.json +1 -1
|
@@ -14,11 +14,10 @@ var _clickAway = require("../../utils/click-away");
|
|
|
14
14
|
var _Input = require("../Input");
|
|
15
15
|
var _Menu = require("../Menu");
|
|
16
16
|
var _DropdownModule = _interopRequireDefault(require("./Dropdown.module.css"));
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
19
|
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; }
|
|
21
|
-
|
|
20
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
21
|
const Dropdown = _ref => {
|
|
23
22
|
let {
|
|
24
23
|
options,
|
|
@@ -54,55 +53,51 @@ const Dropdown = _ref => {
|
|
|
54
53
|
setInputValue(selectedOption.label);
|
|
55
54
|
}
|
|
56
55
|
}, [selectedOption]);
|
|
57
|
-
return /*#__PURE__*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
})
|
|
103
|
-
})]
|
|
104
|
-
});
|
|
105
|
-
}
|
|
56
|
+
return /*#__PURE__*/React.createElement(_clickAway.ClickAway, null, _ref2 => {
|
|
57
|
+
let {
|
|
58
|
+
isOpen,
|
|
59
|
+
onOpen,
|
|
60
|
+
cancelNext,
|
|
61
|
+
clickAway
|
|
62
|
+
} = _ref2;
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
64
|
+
"data-testid": "Dropdown",
|
|
65
|
+
className: (0, _classify.classify)(_DropdownModule.default.dropdownContainer, classNames?.wrapper),
|
|
66
|
+
ref: dropdownRef
|
|
67
|
+
}, /*#__PURE__*/React.createElement(_Input.Input, _extends({
|
|
68
|
+
boxRef: reference,
|
|
69
|
+
size: size,
|
|
70
|
+
placeholder: placeholder,
|
|
71
|
+
value: inputValue,
|
|
72
|
+
classNames: {
|
|
73
|
+
box: _DropdownModule.default.inputBox
|
|
74
|
+
}
|
|
75
|
+
}, inputProps, {
|
|
76
|
+
iconRightName: isOpen ? 'angle-up' : 'angle-down',
|
|
77
|
+
readOnly: true,
|
|
78
|
+
onContainerClick: e => {
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
onOpen();
|
|
81
|
+
}
|
|
82
|
+
})), isOpen && options && /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
onClickCapture: cancelNext,
|
|
84
|
+
ref: floating,
|
|
85
|
+
style: {
|
|
86
|
+
position: strategy,
|
|
87
|
+
top: y ?? _space.spaceNone,
|
|
88
|
+
left: x ?? _space.spaceNone,
|
|
89
|
+
width: _size.sizeFluid,
|
|
90
|
+
backgroundColor: _color.colorBackgroundTertiary
|
|
91
|
+
}
|
|
92
|
+
}, /*#__PURE__*/React.createElement(_Menu.Menu, {
|
|
93
|
+
isFluid: true,
|
|
94
|
+
options: options,
|
|
95
|
+
onSelect: option => {
|
|
96
|
+
handleSelect(option);
|
|
97
|
+
clickAway();
|
|
98
|
+
},
|
|
99
|
+
size: size
|
|
100
|
+
})));
|
|
106
101
|
});
|
|
107
102
|
};
|
|
108
103
|
exports.Dropdown = Dropdown;
|
|
@@ -7,7 +7,6 @@ exports.Row = exports.Col = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = require("../../utils/classify");
|
|
9
9
|
var _GridModule = _interopRequireDefault(require("./Grid.module.css"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
12
|
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; }
|
|
@@ -53,14 +52,13 @@ const Row = _ref => {
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
});
|
|
56
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
56
|
"data-testid": "Grid",
|
|
58
57
|
className: (0, _classify.classify)(_GridModule.default.gridRow, _GridModule.default[`gridRowSpan${span}`], className),
|
|
59
58
|
style: {
|
|
60
59
|
gridTemplateColumns: `repeat(${GRID_COLUMN_COUNT}, 1fr)`
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
});
|
|
60
|
+
}
|
|
61
|
+
}, childrenWithProps);
|
|
64
62
|
};
|
|
65
63
|
exports.Row = Row;
|
|
66
64
|
const Col = _ref2 => {
|
|
@@ -70,13 +68,12 @@ const Col = _ref2 => {
|
|
|
70
68
|
gridColumnStart,
|
|
71
69
|
gridColumnEnd
|
|
72
70
|
} = _ref2;
|
|
73
|
-
return /*#__PURE__*/
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
74
72
|
className: (0, _classify.classify)(_GridModule.default.gridColumn, className),
|
|
75
73
|
style: {
|
|
76
74
|
gridColumnStart,
|
|
77
75
|
gridColumnEnd
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
});
|
|
76
|
+
}
|
|
77
|
+
}, children);
|
|
81
78
|
};
|
|
82
79
|
exports.Col = Col;
|
|
@@ -10,27 +10,23 @@ var _Button = require("../Button");
|
|
|
10
10
|
var _Text = require("../Text");
|
|
11
11
|
var _ = require("./");
|
|
12
12
|
var _ClickableIconModule = _interopRequireDefault(require("./ClickableIcon.module.css"));
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
14
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
15
|
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; }
|
|
17
|
-
|
|
16
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
17
|
const ClickableIcon = _ref => {
|
|
19
18
|
let {
|
|
20
19
|
size = 'medium',
|
|
21
20
|
...props
|
|
22
21
|
} = _ref;
|
|
23
|
-
return /*#__PURE__*/
|
|
24
|
-
...props,
|
|
22
|
+
return /*#__PURE__*/React.createElement(_Button.UnstyledButton, _extends({}, props, {
|
|
25
23
|
className: (0, _classify.default)(_ClickableIconModule.default.button, {
|
|
26
24
|
[_ClickableIconModule.default.small]: size === 'small',
|
|
27
25
|
[_ClickableIconModule.default.medium]: size === 'medium'
|
|
28
|
-
}),
|
|
29
|
-
children: /*#__PURE__*/(0, _jsxRuntime.js)(_.Icon, {
|
|
30
|
-
size: size,
|
|
31
|
-
...props
|
|
32
26
|
})
|
|
33
|
-
})
|
|
27
|
+
}), /*#__PURE__*/React.createElement(_.Icon, _extends({
|
|
28
|
+
size: size
|
|
29
|
+
}, props)));
|
|
34
30
|
};
|
|
35
31
|
exports.ClickableIcon = ClickableIcon;
|
|
36
32
|
const CloseIcon = _ref2 => {
|
|
@@ -40,7 +36,7 @@ const CloseIcon = _ref2 => {
|
|
|
40
36
|
color = _Text.TEXT_COLORS.primary,
|
|
41
37
|
onClick
|
|
42
38
|
} = _ref2;
|
|
43
|
-
return /*#__PURE__*/
|
|
39
|
+
return /*#__PURE__*/React.createElement(ClickableIcon, {
|
|
44
40
|
name: "close",
|
|
45
41
|
size: size,
|
|
46
42
|
type: type,
|
|
@@ -9,7 +9,6 @@ require("./FontAwesomeLibrary");
|
|
|
9
9
|
var _typography = require("../../types/typography");
|
|
10
10
|
var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
11
11
|
var _typographyModule = _interopRequireDefault(require("../../styles/typography.module.css"));
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
14
|
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; }
|
|
@@ -25,14 +24,11 @@ const Icon = _ref => {
|
|
|
25
24
|
className,
|
|
26
25
|
onClick
|
|
27
26
|
} = _ref;
|
|
28
|
-
return /*#__PURE__*/(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
});
|
|
27
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !!name && /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: (0, _classify.default)(_typographyModule.default.centerAlignFlex, _typographyModule.default[`${size}Icon`], _typographyModule.default[color], className),
|
|
29
|
+
onClick: onClick
|
|
30
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
31
|
+
className: (0, _classify.default)(`fa-${type} fa-${name}`)
|
|
32
|
+
})));
|
|
37
33
|
};
|
|
38
34
|
exports.Icon = Icon;
|
|
@@ -11,7 +11,6 @@ var _Icon = require("../Icon");
|
|
|
11
11
|
var _Text = require("../Text");
|
|
12
12
|
var _Truncate = require("../Truncate");
|
|
13
13
|
var _InContextAlertModule = _interopRequireDefault(require("./InContextAlert.module.css"));
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
15
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
16
|
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; }
|
|
@@ -31,42 +30,42 @@ const AlertIcon = _ref => {
|
|
|
31
30
|
} = _ref;
|
|
32
31
|
switch (semantic) {
|
|
33
32
|
case ALERT_SEMANTIC.neutral:
|
|
34
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
35
34
|
color: _typography.TEXT_COLORS.neutral,
|
|
36
35
|
name: leftIconName ? leftIconName : 'face-smile',
|
|
37
36
|
size: "small",
|
|
38
37
|
type: "regular"
|
|
39
38
|
});
|
|
40
39
|
case ALERT_SEMANTIC.success:
|
|
41
|
-
return /*#__PURE__*/
|
|
40
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
42
41
|
name: "circle-check",
|
|
43
42
|
size: "small",
|
|
44
43
|
color: _typography.TEXT_COLORS.success,
|
|
45
44
|
type: "regular"
|
|
46
45
|
});
|
|
47
46
|
case ALERT_SEMANTIC.information:
|
|
48
|
-
return /*#__PURE__*/
|
|
47
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
49
48
|
name: "circle-info",
|
|
50
49
|
size: "small",
|
|
51
50
|
color: _typography.TEXT_COLORS.information,
|
|
52
51
|
type: "regular"
|
|
53
52
|
});
|
|
54
53
|
case ALERT_SEMANTIC.warning:
|
|
55
|
-
return /*#__PURE__*/
|
|
54
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
56
55
|
name: "circle-exclamation",
|
|
57
56
|
size: "small",
|
|
58
57
|
color: _typography.TEXT_COLORS.warning,
|
|
59
58
|
type: "regular"
|
|
60
59
|
});
|
|
61
60
|
case ALERT_SEMANTIC.danger:
|
|
62
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
63
62
|
name: "shield-exclamation",
|
|
64
63
|
size: "small",
|
|
65
64
|
color: _typography.TEXT_COLORS.danger,
|
|
66
65
|
type: "regular"
|
|
67
66
|
});
|
|
68
67
|
default:
|
|
69
|
-
return /*#__PURE__*/
|
|
68
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
70
69
|
color: _typography.TEXT_COLORS.neutral,
|
|
71
70
|
name: "face-smile",
|
|
72
71
|
size: "small",
|
|
@@ -89,33 +88,28 @@ const InContextAlert = props => {
|
|
|
89
88
|
onCloseClick && onCloseClick(e);
|
|
90
89
|
selfDismiss && setDismissed(true);
|
|
91
90
|
};
|
|
92
|
-
return /*#__PURE__*/(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
onClick: closeClickHandler,
|
|
116
|
-
className: _InContextAlertModule.default.closeIcon
|
|
117
|
-
})]
|
|
118
|
-
})
|
|
119
|
-
});
|
|
91
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !dismissed && /*#__PURE__*/React.createElement("div", {
|
|
92
|
+
className: (0, _classify.classify)(_InContextAlertModule.default.alertContainer, {
|
|
93
|
+
[_InContextAlertModule.default.neutral]: semantic === ALERT_SEMANTIC.neutral,
|
|
94
|
+
[_InContextAlertModule.default.success]: semantic === ALERT_SEMANTIC.success,
|
|
95
|
+
[_InContextAlertModule.default.information]: semantic === ALERT_SEMANTIC.information,
|
|
96
|
+
[_InContextAlertModule.default.warning]: semantic === ALERT_SEMANTIC.warning,
|
|
97
|
+
[_InContextAlertModule.default.danger]: semantic === ALERT_SEMANTIC.danger
|
|
98
|
+
}, classNames?.wrapper)
|
|
99
|
+
}, /*#__PURE__*/React.createElement(AlertIcon, {
|
|
100
|
+
semantic: semantic,
|
|
101
|
+
leftIconName: leftIconName
|
|
102
|
+
}), React.Children.count(children) > 0 && /*#__PURE__*/React.createElement(_Text.SubTitleExtraSmall, {
|
|
103
|
+
className: (0, _classify.classify)(classNames?.alertText)
|
|
104
|
+
}, /*#__PURE__*/React.createElement(_Truncate.Truncate, {
|
|
105
|
+
line: 2
|
|
106
|
+
}, children)), dismissable && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
107
|
+
color: _typography.TEXT_COLORS.primary,
|
|
108
|
+
name: "close",
|
|
109
|
+
size: "small",
|
|
110
|
+
type: "regular",
|
|
111
|
+
onClick: closeClickHandler,
|
|
112
|
+
className: _InContextAlertModule.default.closeIcon
|
|
113
|
+
})));
|
|
120
114
|
};
|
|
121
115
|
exports.InContextAlert = InContextAlert;
|
|
@@ -9,11 +9,10 @@ var _classify = require("../../utils/classify");
|
|
|
9
9
|
var _Icon = require("../Icon");
|
|
10
10
|
var _Text = require("../Text");
|
|
11
11
|
var _InputModule = _interopRequireDefault(require("./Input.module.css"));
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
14
|
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; }
|
|
16
|
-
|
|
15
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
16
|
const Input_ = (props, ref) => {
|
|
18
17
|
const {
|
|
19
18
|
value,
|
|
@@ -53,69 +52,60 @@ const Input_ = (props, ref) => {
|
|
|
53
52
|
}
|
|
54
53
|
onIconRightClick && onIconRightClick(e);
|
|
55
54
|
};
|
|
56
|
-
return /*#__PURE__*/
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
56
|
className: (0, _classify.classify)(_InputModule.default.wrapper, {
|
|
58
57
|
[_InputModule.default.filled]: controlledInputFilled ?? false,
|
|
59
58
|
[_InputModule.default.withError]: error ?? false
|
|
59
|
+
})
|
|
60
|
+
}, Boolean(label) && /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: _InputModule.default.info
|
|
62
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
+
className: _InputModule.default.infoContent
|
|
64
|
+
}, /*#__PURE__*/React.createElement(_Text.FormLabelSmall, {
|
|
65
|
+
color: "secondary"
|
|
66
|
+
}, label ?? ''), "\xA0", required && /*#__PURE__*/React.createElement(_Text.FormLabelSmall, {
|
|
67
|
+
color: "danger"
|
|
68
|
+
}, '*'))), /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
className: (0, _classify.classify)(_InputModule.default.box, classNames?.box, {
|
|
70
|
+
[_InputModule.default.inputDisabled]: disabled ?? false,
|
|
71
|
+
[_InputModule.default.medium]: size === 'medium',
|
|
72
|
+
[_InputModule.default.small]: size === 'small',
|
|
73
|
+
[_InputModule.default.locked]: locked
|
|
60
74
|
}),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
onFocus: onFocus,
|
|
96
|
-
onBlur: onBlur,
|
|
97
|
-
type: showPassword ? 'text' : type,
|
|
98
|
-
readOnly: readOnly && 'readOnly',
|
|
99
|
-
...inputProps
|
|
100
|
-
}), /*#__PURE__*/(0, _jsxRuntime.js)(RightInputIcon, {
|
|
101
|
-
isEmail: type === 'email',
|
|
102
|
-
isPassword: type === 'password',
|
|
103
|
-
showPassword: showPassword,
|
|
104
|
-
isLocked: locked,
|
|
105
|
-
isDisabled: disabled,
|
|
106
|
-
onClick: handleRightIconClick,
|
|
107
|
-
iconRightName: iconRightName,
|
|
108
|
-
iconRightType: iconRightType,
|
|
109
|
-
className: classNames?.iconRight
|
|
110
|
-
})]
|
|
111
|
-
}), (Boolean(helperText) || error) && /*#__PURE__*/(0, _jsxRuntime.js)("div", {
|
|
112
|
-
className: _InputModule.default.info,
|
|
113
|
-
children: /*#__PURE__*/(0, _jsxRuntime.js)(_Text.BodySmall, {
|
|
114
|
-
color: error && errorText ? 'danger' : disabled ? 'disabled' : 'secondary',
|
|
115
|
-
children: error && errorText ? errorText : helperText ?? ''
|
|
116
|
-
})
|
|
117
|
-
})]
|
|
118
|
-
});
|
|
75
|
+
onClick: !(disabled || locked) ? onContainerClick : null,
|
|
76
|
+
ref: boxRef
|
|
77
|
+
}, iconLeftName && /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
78
|
+
className: (0, _classify.classify)(classNames?.iconLeft),
|
|
79
|
+
name: iconLeftName,
|
|
80
|
+
color: disabled ? 'disabled' : 'secondary',
|
|
81
|
+
size: "small",
|
|
82
|
+
type: iconLeftType
|
|
83
|
+
}), /*#__PURE__*/React.createElement("input", _extends({
|
|
84
|
+
disabled: locked || disabled,
|
|
85
|
+
name: name,
|
|
86
|
+
ref: ref,
|
|
87
|
+
placeholder: placeholder,
|
|
88
|
+
value: value,
|
|
89
|
+
onChange: onChange,
|
|
90
|
+
onFocus: onFocus,
|
|
91
|
+
onBlur: onBlur,
|
|
92
|
+
type: showPassword ? 'text' : type,
|
|
93
|
+
readOnly: readOnly && 'readOnly'
|
|
94
|
+
}, inputProps)), /*#__PURE__*/React.createElement(RightInputIcon, {
|
|
95
|
+
isEmail: type === 'email',
|
|
96
|
+
isPassword: type === 'password',
|
|
97
|
+
showPassword: showPassword,
|
|
98
|
+
isLocked: locked,
|
|
99
|
+
isDisabled: disabled,
|
|
100
|
+
onClick: handleRightIconClick,
|
|
101
|
+
iconRightName: iconRightName,
|
|
102
|
+
iconRightType: iconRightType,
|
|
103
|
+
className: classNames?.iconRight
|
|
104
|
+
})), (Boolean(helperText) || error) && /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: _InputModule.default.info
|
|
106
|
+
}, /*#__PURE__*/React.createElement(_Text.BodySmall, {
|
|
107
|
+
color: error && errorText ? 'danger' : disabled ? 'disabled' : 'secondary'
|
|
108
|
+
}, error && errorText ? errorText : helperText ?? '')));
|
|
119
109
|
};
|
|
120
110
|
const RightInputIcon = _ref => {
|
|
121
111
|
let {
|
|
@@ -129,44 +119,41 @@ const RightInputIcon = _ref => {
|
|
|
129
119
|
...rightIconProps
|
|
130
120
|
} = _ref;
|
|
131
121
|
if (isLocked) {
|
|
132
|
-
return /*#__PURE__*/
|
|
122
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, _extends({
|
|
133
123
|
name: "lock",
|
|
134
124
|
color: isDisabled ? 'disabled' : 'secondary',
|
|
135
|
-
size: "small"
|
|
136
|
-
|
|
137
|
-
});
|
|
125
|
+
size: "small"
|
|
126
|
+
}, rightIconProps));
|
|
138
127
|
}
|
|
139
128
|
if (isEmail) {
|
|
140
|
-
return /*#__PURE__*/
|
|
129
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, _extends({
|
|
141
130
|
name: "at",
|
|
142
131
|
color: isDisabled ? 'disabled' : 'secondary',
|
|
143
132
|
size: "small",
|
|
144
|
-
type: iconRightType
|
|
145
|
-
|
|
146
|
-
});
|
|
133
|
+
type: iconRightType
|
|
134
|
+
}, rightIconProps));
|
|
147
135
|
}
|
|
148
136
|
if (isPassword) {
|
|
149
|
-
return /*#__PURE__*/
|
|
137
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, _extends({
|
|
150
138
|
name: showPassword ? 'eye-slash' : 'eye',
|
|
151
139
|
color: isDisabled ? 'disabled' : 'secondary',
|
|
152
140
|
size: "small",
|
|
153
|
-
type: iconRightType
|
|
154
|
-
|
|
141
|
+
type: iconRightType
|
|
142
|
+
}, rightIconProps, {
|
|
155
143
|
className: (0, _classify.classify)(_InputModule.default.rightClickableIcon, {
|
|
156
144
|
[_InputModule.default.disabled]: isDisabled || isLocked
|
|
157
145
|
})
|
|
158
|
-
});
|
|
146
|
+
}));
|
|
159
147
|
}
|
|
160
148
|
if (iconRightName) {
|
|
161
|
-
return /*#__PURE__*/
|
|
149
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, _extends({
|
|
162
150
|
name: iconRightName || '',
|
|
163
151
|
color: isDisabled ? 'disabled' : 'secondary',
|
|
164
152
|
size: "small",
|
|
165
|
-
type: iconRightType
|
|
166
|
-
|
|
167
|
-
});
|
|
153
|
+
type: iconRightType
|
|
154
|
+
}, rightIconProps));
|
|
168
155
|
}
|
|
169
|
-
return /*#__PURE__*/
|
|
156
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
170
157
|
};
|
|
171
158
|
const Input = /*#__PURE__*/React.forwardRef(Input_);
|
|
172
159
|
exports.Input = Input;
|
|
@@ -7,7 +7,6 @@ exports.LinearLoader = void 0;
|
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _classify = require("../../utils/classify");
|
|
9
9
|
var _LinearLoaderModule = _interopRequireDefault(require("./LinearLoader.module.css"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
12
|
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; }
|
|
@@ -18,18 +17,17 @@ const LinearLoader = _ref => {
|
|
|
18
17
|
size = 'medium',
|
|
19
18
|
className
|
|
20
19
|
} = _ref;
|
|
21
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
22
21
|
className: (0, _classify.classify)(_LinearLoaderModule.default.lineContainer, {
|
|
23
22
|
[_LinearLoaderModule.default.large]: size === 'large',
|
|
24
23
|
[_LinearLoaderModule.default.medium]: size === 'medium',
|
|
25
24
|
[_LinearLoaderModule.default.small]: size === 'small'
|
|
26
|
-
}, className)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
25
|
+
}, className)
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: _LinearLoaderModule.default.progressBar,
|
|
28
|
+
style: {
|
|
29
|
+
width: `${value + '%'}`
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
34
32
|
};
|
|
35
33
|
exports.LinearLoader = LinearLoader;
|