@spaced-out/ui-design-system 0.0.1-alpha.0 → 0.0.1-beta.0
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/.cspell/custom-words.txt +4 -0
- package/.github/workflows/publish_to_npm.yml +70 -0
- package/CHANGELOG.md +9 -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
|
@@ -10,11 +10,10 @@ var _classify = _interopRequireDefault(require("../../utils/classify"));
|
|
|
10
10
|
var _Icon = require("../Icon");
|
|
11
11
|
var _Modal = require("../Modal");
|
|
12
12
|
var _DialogModule = _interopRequireDefault(require("./Dialog.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 DIALOG_SEMANTIC = Object.freeze({
|
|
19
18
|
neutral: 'neutral',
|
|
20
19
|
success: 'success',
|
|
@@ -30,37 +29,37 @@ const DialogIcon = _ref => {
|
|
|
30
29
|
} = _ref;
|
|
31
30
|
switch (semantic) {
|
|
32
31
|
case DIALOG_SEMANTIC.neutral:
|
|
33
|
-
return /*#__PURE__*/
|
|
32
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
34
33
|
color: _typography.TEXT_COLORS.neutral,
|
|
35
34
|
name: iconName ? iconName : 'face-smile',
|
|
36
35
|
type: "solid"
|
|
37
36
|
});
|
|
38
37
|
case DIALOG_SEMANTIC.success:
|
|
39
|
-
return /*#__PURE__*/
|
|
38
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
40
39
|
name: "circle-check",
|
|
41
40
|
color: _typography.TEXT_COLORS.success,
|
|
42
41
|
type: "solid"
|
|
43
42
|
});
|
|
44
43
|
case DIALOG_SEMANTIC.information:
|
|
45
|
-
return /*#__PURE__*/
|
|
44
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
46
45
|
name: "circle-info",
|
|
47
46
|
color: _typography.TEXT_COLORS.information,
|
|
48
47
|
type: "solid"
|
|
49
48
|
});
|
|
50
49
|
case DIALOG_SEMANTIC.warning:
|
|
51
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
52
51
|
name: "circle-exclamation",
|
|
53
52
|
color: _typography.TEXT_COLORS.warning,
|
|
54
53
|
type: "solid"
|
|
55
54
|
});
|
|
56
55
|
case DIALOG_SEMANTIC.danger:
|
|
57
|
-
return /*#__PURE__*/
|
|
56
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
58
57
|
name: "shield-exclamation",
|
|
59
58
|
color: _typography.TEXT_COLORS.danger,
|
|
60
59
|
type: "solid"
|
|
61
60
|
});
|
|
62
61
|
default:
|
|
63
|
-
return /*#__PURE__*/
|
|
62
|
+
return /*#__PURE__*/React.createElement(_Icon.Icon, {
|
|
64
63
|
color: _typography.TEXT_COLORS.neutral,
|
|
65
64
|
name: "face-smile",
|
|
66
65
|
type: "solid"
|
|
@@ -71,40 +70,31 @@ const DialogHeader = _ref2 => {
|
|
|
71
70
|
let {
|
|
72
71
|
children
|
|
73
72
|
} = _ref2;
|
|
74
|
-
return /*#__PURE__*/(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
children: children
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
});
|
|
73
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, React.Children.count(children) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: _DialogModule.default.dialogHeader
|
|
75
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: _DialogModule.default.headerContent
|
|
77
|
+
}, children)));
|
|
83
78
|
};
|
|
84
79
|
exports.DialogHeader = DialogHeader;
|
|
85
80
|
const DialogBody = _ref3 => {
|
|
86
81
|
let {
|
|
87
82
|
children
|
|
88
83
|
} = _ref3;
|
|
89
|
-
return /*#__PURE__*/
|
|
90
|
-
className: _DialogModule.default.dialogBody
|
|
91
|
-
|
|
92
|
-
});
|
|
84
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: _DialogModule.default.dialogBody
|
|
86
|
+
}, children);
|
|
93
87
|
};
|
|
94
88
|
exports.DialogBody = DialogBody;
|
|
95
89
|
const DialogFooter = _ref4 => {
|
|
96
90
|
let {
|
|
97
91
|
children
|
|
98
92
|
} = _ref4;
|
|
99
|
-
return /*#__PURE__*/(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
children: children
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
});
|
|
93
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, React.Children.count(children) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: _DialogModule.default.dialogFooter
|
|
95
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
className: _DialogModule.default.dialogFooterActions
|
|
97
|
+
}, children)));
|
|
108
98
|
};
|
|
109
99
|
exports.DialogFooter = DialogFooter;
|
|
110
100
|
const Dialog = _ref5 => {
|
|
@@ -118,31 +108,28 @@ const Dialog = _ref5 => {
|
|
|
118
108
|
semantic = 'neutral',
|
|
119
109
|
...restDialogProps
|
|
120
110
|
} = _ref5;
|
|
121
|
-
return /*#__PURE__*/
|
|
111
|
+
return /*#__PURE__*/React.createElement(_Modal.Modal, _extends({
|
|
122
112
|
isOpen: isOpen,
|
|
123
113
|
onClose: onClose,
|
|
124
114
|
showBackdrop: showBackdrop,
|
|
125
|
-
tapOutsideToClose: tapOutsideToClose
|
|
126
|
-
|
|
115
|
+
tapOutsideToClose: tapOutsideToClose
|
|
116
|
+
}, restDialogProps, {
|
|
127
117
|
classNames: {
|
|
128
118
|
content: (0, _classify.default)(_DialogModule.default.dialog)
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
})
|
|
145
|
-
}), children]
|
|
146
|
-
});
|
|
119
|
+
}
|
|
120
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
className: _DialogModule.default.topBlock
|
|
122
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: (0, _classify.default)(_DialogModule.default.iconContainer, {
|
|
124
|
+
[_DialogModule.default.neutral]: semantic === DIALOG_SEMANTIC.neutral,
|
|
125
|
+
[_DialogModule.default.success]: semantic === DIALOG_SEMANTIC.success,
|
|
126
|
+
[_DialogModule.default.information]: semantic === DIALOG_SEMANTIC.information,
|
|
127
|
+
[_DialogModule.default.warning]: semantic === DIALOG_SEMANTIC.warning,
|
|
128
|
+
[_DialogModule.default.danger]: semantic === DIALOG_SEMANTIC.danger
|
|
129
|
+
})
|
|
130
|
+
}, /*#__PURE__*/React.createElement(DialogIcon, {
|
|
131
|
+
semantic: semantic,
|
|
132
|
+
iconName: iconName
|
|
133
|
+
}))), children);
|
|
147
134
|
};
|
|
148
135
|
exports.Dialog = Dialog;
|
|
@@ -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;
|