@unbxd-ui/unbxd-react-components 0.2.221 → 0.3.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/README.md +17 -1
- package/components/Accordian/Accordian.js +14 -11
- package/components/Accordian/Accordian.stories.js +141 -118
- package/components/Accordian/index.js +1 -1
- package/components/Button/Button.js +8 -6
- package/components/Button/Button.stories.js +181 -62
- package/components/Button/DropdownButton.js +5 -6
- package/components/Button/buttonTheme.css +1 -1
- package/components/Button/index.js +2 -3
- package/components/DataLoader/DataLoader.js +6 -7
- package/components/DataLoader/DataLoader.stories.js +244 -58
- package/components/DataLoader/index.js +1 -1
- package/components/Form/Checkbox.js +12 -11
- package/components/Form/DragDropFileUploader.js +6 -7
- package/components/Form/Dropdown.js +14 -12
- package/components/Form/FileUploader.js +3 -4
- package/components/Form/Form.js +6 -7
- package/components/Form/FormElementWrapper.js +1 -1
- package/components/Form/Input.js +24 -15
- package/components/Form/RadioList.js +8 -9
- package/components/Form/RangeSlider.js +12 -13
- package/components/Form/SearchableDropdown.js +563 -0
- package/components/Form/ServerPaginatedDDList.js +53 -44
- package/components/Form/Textarea.js +26 -10
- package/components/Form/Toggle.js +6 -7
- package/components/Form/formCore.css +1 -1
- package/components/Form/formTheme.css +1 -1
- package/components/Form/index.js +8 -1
- package/components/Form/stories/Checkbox.stories.js +139 -40
- package/components/Form/stories/Dropdown.stories.js +323 -92
- package/components/Form/stories/FileUploader.stories.js +178 -19
- package/components/Form/stories/Input.stories.js +115 -0
- package/components/Form/stories/RangeSlider.stories.js +162 -64
- package/components/Form/stories/SearchableDropdown.stories.js +189 -0
- package/components/Form/stories/ServerPaginatedDropdown.stories.js +365 -0
- package/components/Form/stories/Textarea.stories.js +113 -34
- package/components/Form/stories/Toggle.stories.js +193 -14
- package/components/Form/variables.css +0 -0
- package/components/InlineModal/InlineModal.js +119 -21
- package/components/InlineModal/InlineModal.stories.js +239 -45
- package/components/InlineModal/index.js +1 -2
- package/components/InlineModal/inlineModalCore.css +1 -1
- package/components/Link/Link.js +139 -0
- package/components/Link/Link.stories.js +489 -0
- package/components/Link/index.js +28 -0
- package/components/Link/linkCore.css +1 -0
- package/components/Link/linkTheme.css +1 -0
- package/components/List/List.js +11 -8
- package/components/List/List.stories.js +238 -0
- package/components/List/index.js +1 -1
- package/components/Modal/Modal.js +67 -20
- package/components/Modal/Modal.stories.js +257 -38
- package/components/Modal/index.js +1 -1
- package/components/Modal/modalCore.css +1 -1
- package/components/NoDataPlaceholder/NoDataPlaceholder.js +41 -0
- package/components/NoDataPlaceholder/NoDataPlaceholder.stories.js +42 -0
- package/components/NoDataPlaceholder/index.js +9 -0
- package/components/NoDataPlaceholder/noDataPlaceholderCore.css +1 -0
- package/components/NotificationComponent/NotificationComponent.js +20 -10
- package/components/NotificationComponent/NotificationComponent.stories.js +171 -19
- package/components/NotificationComponent/index.js +1 -1
- package/components/NotificationComponent/notificationTheme.css +1 -1
- package/components/PageLoader/PageLoader.js +84 -0
- package/components/PageLoader/PageLoader.stories.js +276 -0
- package/components/PageLoader/index.js +9 -0
- package/components/PageLoader/pageLoaderCore.css +1 -0
- package/components/ProgressBar/ProgressBar.css +0 -0
- package/components/ProgressBar/ProgressBar.js +1 -1
- package/components/ProgressBar/ProgressBar.stories.js +203 -10
- package/components/ProgressBar/index.js +1 -1
- package/components/ProgressBar/progressBarCore.css +1 -1
- package/components/Table/BaseTable.js +86 -342
- package/components/Table/PaginationComponent.js +4 -4
- package/components/Table/Table.js +7 -326
- package/components/Table/Table.stories.js +2117 -158
- package/components/Table/TableChild.js +383 -0
- package/components/Table/TableConstants.js +15 -0
- package/components/Table/hooks/usePrevious.js +14 -0
- package/components/Table/index.js +14 -1
- package/components/Table/tableCore.css +1 -1
- package/components/TableOld/BaseTable.js +373 -0
- package/components/TableOld/PaginationComponent.js +86 -0
- package/components/TableOld/TableOld.js +367 -0
- package/components/TableOld/index.js +15 -0
- package/components/TabsComponent/TabsComponent.js +6 -7
- package/components/TabsComponent/TabsComponent.stories.js +291 -53
- package/components/TabsComponent/index.js +1 -1
- package/components/ToastNotification/ToastNotificationWrapper.js +212 -0
- package/components/ToastNotification/ToastNotificationWrapper.stories.js +554 -0
- package/components/ToastNotification/index.js +40 -0
- package/components/ToastNotification/toastNotificationCore.css +1 -0
- package/components/Tooltip/Tooltip.js +231 -56
- package/components/Tooltip/Tooltip.stories.js +380 -15
- package/components/Tooltip/index.js +1 -1
- package/components/Tooltip/tooltipCore.css +1 -1
- package/components/Tooltip/tooltipTheme.css +1 -1
- package/components/common/NoDataDropdown.js +50 -0
- package/components/common/common.css +1 -0
- package/components/core.css +2 -3
- package/components/core.scss +21 -1
- package/components/index.js +91 -3
- package/components/theme.css +2 -3
- package/components/theme.scss +2 -1
- package/core/Validators.js +1 -1
- package/core/customHooks.js +4 -4
- package/core/dataLoader.js +58 -17
- package/core/index.js +1 -1
- package/core/utils.js +15 -4
- package/index.js +54 -0
- package/package.json +41 -28
- package/components/Button/DropdownButton.stories.js +0 -49
- package/components/Form/stories/DragDropFileUploader.stories.js +0 -25
- package/components/Form/stories/FormDefault.stories.js +0 -115
- package/components/Form/stories/RadioList.stories.js +0 -53
- package/components/Form/stories/TextInput.stories.js +0 -76
- package/components/Form/stories/form.stories.js +0 -233
- package/components/List/list.stories.js +0 -35
- package/core/dataLoader.stories.js +0 -119
|
@@ -4,49 +4,268 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports["default"] = exports.
|
|
8
|
-
var _react =
|
|
7
|
+
exports["default"] = exports.WithCustomTitle = exports.Interactive = exports.FormModal = exports.Default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
10
|
+
var _Button = _interopRequireWildcard(require("../Button/Button"));
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
20
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
23
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
24
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
25
|
+
var meta = {
|
|
26
|
+
title: 'Components/Modal',
|
|
27
|
+
component: _Modal["default"],
|
|
28
|
+
parameters: {
|
|
29
|
+
layout: 'centered'
|
|
30
|
+
},
|
|
31
|
+
tags: ['autodocs'],
|
|
32
|
+
argTypes: {
|
|
33
|
+
className: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'Additional CSS classes for the modal'
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
control: 'text',
|
|
39
|
+
description: 'Header or title for the modal'
|
|
40
|
+
},
|
|
41
|
+
showClose: {
|
|
42
|
+
control: 'boolean',
|
|
43
|
+
description: 'Whether to show the close button'
|
|
44
|
+
},
|
|
45
|
+
showHeader: {
|
|
46
|
+
control: 'boolean',
|
|
47
|
+
description: 'Whether to show the modal header'
|
|
48
|
+
},
|
|
49
|
+
isConditionalHideEnabled: {
|
|
50
|
+
control: 'boolean',
|
|
51
|
+
description: 'Whether to enable conditional hiding of the modal'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
31
54
|
};
|
|
32
|
-
var
|
|
33
|
-
|
|
55
|
+
var _default = exports["default"] = meta; // Basic Modal
|
|
56
|
+
var Default = exports.Default = {
|
|
57
|
+
render: function render() {
|
|
58
|
+
var modalRef = _react["default"].useRef(null);
|
|
59
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
60
|
+
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
61
|
+
onClick: function onClick() {
|
|
62
|
+
return modalRef.current.showModal();
|
|
63
|
+
}
|
|
64
|
+
}, "Open Modal"), /*#__PURE__*/_react["default"].createElement(_Modal["default"], {
|
|
65
|
+
ref: modalRef,
|
|
66
|
+
title: "Basic Modal",
|
|
67
|
+
onClose: function onClose() {
|
|
68
|
+
return console.log('Modal closed');
|
|
69
|
+
}
|
|
70
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, "This is a basic modal with default settings."), /*#__PURE__*/_react["default"].createElement("div", {
|
|
71
|
+
className: "modal-footer"
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
73
|
+
appearance: _Button.ButtonAppearance.SECONDARY,
|
|
74
|
+
onClick: function onClick() {
|
|
75
|
+
return modalRef.current.hideModal();
|
|
76
|
+
}
|
|
77
|
+
}, "Close")))));
|
|
78
|
+
}
|
|
34
79
|
};
|
|
35
|
-
|
|
36
|
-
|
|
80
|
+
|
|
81
|
+
// Custom Title Component
|
|
82
|
+
var CustomTitle = function CustomTitle() {
|
|
83
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
84
|
+
style: {
|
|
85
|
+
display: 'flex',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
gap: '10px'
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
90
|
+
style: {
|
|
91
|
+
color: '#1a73e8',
|
|
92
|
+
fontSize: '20px'
|
|
93
|
+
}
|
|
94
|
+
}, "\uD83D\uDE80"), /*#__PURE__*/_react["default"].createElement("span", null, "Custom Title Component"));
|
|
37
95
|
};
|
|
38
|
-
var
|
|
39
|
-
|
|
96
|
+
var WithCustomTitle = exports.WithCustomTitle = {
|
|
97
|
+
render: function render() {
|
|
98
|
+
var modalRef = _react["default"].useRef(null);
|
|
99
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
100
|
+
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
101
|
+
onClick: function onClick() {
|
|
102
|
+
return modalRef.current.showModal();
|
|
103
|
+
}
|
|
104
|
+
}, "Open Modal with Custom Title"), /*#__PURE__*/_react["default"].createElement(_Modal["default"], {
|
|
105
|
+
ref: modalRef,
|
|
106
|
+
titleComponent: /*#__PURE__*/_react["default"].createElement(CustomTitle, null)
|
|
107
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", null, "This modal uses a custom title component instead of a simple string title."), /*#__PURE__*/_react["default"].createElement("div", {
|
|
108
|
+
className: "modal-footer"
|
|
109
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
110
|
+
appearance: _Button.ButtonAppearance.SECONDARY,
|
|
111
|
+
onClick: function onClick() {
|
|
112
|
+
return modalRef.current.hideModal();
|
|
113
|
+
}
|
|
114
|
+
}, "Close")))));
|
|
115
|
+
}
|
|
40
116
|
};
|
|
41
|
-
|
|
42
|
-
|
|
117
|
+
|
|
118
|
+
// Form Modal
|
|
119
|
+
var FormModal = exports.FormModal = {
|
|
120
|
+
render: function render() {
|
|
121
|
+
var modalRef = _react["default"].useRef(null);
|
|
122
|
+
var _React$useState = _react["default"].useState({
|
|
123
|
+
name: '',
|
|
124
|
+
email: '',
|
|
125
|
+
message: ''
|
|
126
|
+
}),
|
|
127
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
128
|
+
formData = _React$useState2[0],
|
|
129
|
+
setFormData = _React$useState2[1];
|
|
130
|
+
var handleSubmit = function handleSubmit() {
|
|
131
|
+
console.log('Form submitted:', formData);
|
|
132
|
+
modalRef.current.hideModal();
|
|
133
|
+
};
|
|
134
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
135
|
+
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
136
|
+
onClick: function onClick() {
|
|
137
|
+
return modalRef.current.showModal();
|
|
138
|
+
}
|
|
139
|
+
}, "Open Form Modal"), /*#__PURE__*/_react["default"].createElement(_Modal["default"], {
|
|
140
|
+
ref: modalRef,
|
|
141
|
+
title: "Contact Form",
|
|
142
|
+
className: "form-modal"
|
|
143
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
144
|
+
style: {
|
|
145
|
+
marginBottom: '15px'
|
|
146
|
+
}
|
|
147
|
+
}, /*#__PURE__*/_react["default"].createElement("label", {
|
|
148
|
+
style: {
|
|
149
|
+
display: 'block',
|
|
150
|
+
marginBottom: '5px'
|
|
151
|
+
}
|
|
152
|
+
}, "Name"), /*#__PURE__*/_react["default"].createElement("input", {
|
|
153
|
+
type: "text",
|
|
154
|
+
value: formData.name,
|
|
155
|
+
onChange: function onChange(e) {
|
|
156
|
+
return setFormData(_objectSpread(_objectSpread({}, formData), {}, {
|
|
157
|
+
name: e.target.value
|
|
158
|
+
}));
|
|
159
|
+
},
|
|
160
|
+
style: {
|
|
161
|
+
width: '100%',
|
|
162
|
+
padding: '8px',
|
|
163
|
+
border: '1px solid #ddd',
|
|
164
|
+
borderRadius: '4px'
|
|
165
|
+
}
|
|
166
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
167
|
+
style: {
|
|
168
|
+
marginBottom: '15px'
|
|
169
|
+
}
|
|
170
|
+
}, /*#__PURE__*/_react["default"].createElement("label", {
|
|
171
|
+
style: {
|
|
172
|
+
display: 'block',
|
|
173
|
+
marginBottom: '5px'
|
|
174
|
+
}
|
|
175
|
+
}, "Email"), /*#__PURE__*/_react["default"].createElement("input", {
|
|
176
|
+
type: "email",
|
|
177
|
+
value: formData.email,
|
|
178
|
+
onChange: function onChange(e) {
|
|
179
|
+
return setFormData(_objectSpread(_objectSpread({}, formData), {}, {
|
|
180
|
+
email: e.target.value
|
|
181
|
+
}));
|
|
182
|
+
},
|
|
183
|
+
style: {
|
|
184
|
+
width: '100%',
|
|
185
|
+
padding: '8px',
|
|
186
|
+
border: '1px solid #ddd',
|
|
187
|
+
borderRadius: '4px'
|
|
188
|
+
}
|
|
189
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
190
|
+
style: {
|
|
191
|
+
marginBottom: '15px'
|
|
192
|
+
}
|
|
193
|
+
}, /*#__PURE__*/_react["default"].createElement("label", {
|
|
194
|
+
style: {
|
|
195
|
+
display: 'block',
|
|
196
|
+
marginBottom: '5px'
|
|
197
|
+
}
|
|
198
|
+
}, "Message"), /*#__PURE__*/_react["default"].createElement("textarea", {
|
|
199
|
+
value: formData.message,
|
|
200
|
+
onChange: function onChange(e) {
|
|
201
|
+
return setFormData(_objectSpread(_objectSpread({}, formData), {}, {
|
|
202
|
+
message: e.target.value
|
|
203
|
+
}));
|
|
204
|
+
},
|
|
205
|
+
style: {
|
|
206
|
+
width: '100%',
|
|
207
|
+
padding: '8px',
|
|
208
|
+
border: '1px solid #ddd',
|
|
209
|
+
borderRadius: '4px',
|
|
210
|
+
minHeight: '100px'
|
|
211
|
+
}
|
|
212
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
213
|
+
className: "modal-footer",
|
|
214
|
+
style: {
|
|
215
|
+
display: 'flex',
|
|
216
|
+
justifyContent: 'flex-end',
|
|
217
|
+
gap: '10px'
|
|
218
|
+
}
|
|
219
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
220
|
+
appearance: _Button.ButtonAppearance.SECONDARY,
|
|
221
|
+
onClick: function onClick() {
|
|
222
|
+
return modalRef.current.hideModal();
|
|
223
|
+
}
|
|
224
|
+
}, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
225
|
+
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
226
|
+
onClick: handleSubmit
|
|
227
|
+
}, "Submit")))));
|
|
228
|
+
}
|
|
43
229
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
230
|
+
|
|
231
|
+
// Interactive example
|
|
232
|
+
var Interactive = exports.Interactive = {
|
|
233
|
+
render: function render(args) {
|
|
234
|
+
var modalRef = _react["default"].useRef(null);
|
|
235
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
236
|
+
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
237
|
+
onClick: function onClick() {
|
|
238
|
+
return modalRef.current.showModal();
|
|
239
|
+
}
|
|
240
|
+
}, "Open Interactive Modal"), /*#__PURE__*/_react["default"].createElement(_Modal["default"], _extends({
|
|
241
|
+
ref: modalRef
|
|
242
|
+
}, args), /*#__PURE__*/_react["default"].createElement("div", {
|
|
243
|
+
style: {
|
|
244
|
+
padding: '20px',
|
|
245
|
+
minWidth: '300px'
|
|
246
|
+
}
|
|
247
|
+
}, /*#__PURE__*/_react["default"].createElement("p", null, "This is an interactive modal example."), /*#__PURE__*/_react["default"].createElement("p", null, "Try adjusting the controls in the Storybook panel:"), /*#__PURE__*/_react["default"].createElement("ul", {
|
|
248
|
+
style: {
|
|
249
|
+
marginTop: '10px',
|
|
250
|
+
marginBottom: '20px'
|
|
251
|
+
}
|
|
252
|
+
}, /*#__PURE__*/_react["default"].createElement("li", null, "Change the title"), /*#__PURE__*/_react["default"].createElement("li", null, "Toggle header visibility"), /*#__PURE__*/_react["default"].createElement("li", null, "Toggle close button"), /*#__PURE__*/_react["default"].createElement("li", null, "Add custom classes")), /*#__PURE__*/_react["default"].createElement("div", {
|
|
253
|
+
style: {
|
|
254
|
+
marginTop: '20px',
|
|
255
|
+
textAlign: 'right'
|
|
256
|
+
}
|
|
257
|
+
}, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
258
|
+
appearance: _Button.ButtonAppearance.SECONDARY,
|
|
259
|
+
onClick: function onClick() {
|
|
260
|
+
return modalRef.current.hideModal();
|
|
261
|
+
}
|
|
262
|
+
}, "Close")))));
|
|
263
|
+
},
|
|
264
|
+
args: {
|
|
265
|
+
title: 'Interactive Modal',
|
|
266
|
+
showClose: true,
|
|
267
|
+
showHeader: true,
|
|
268
|
+
isConditionalHideEnabled: false,
|
|
269
|
+
className: ''
|
|
51
270
|
}
|
|
52
271
|
};
|
|
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
9
|
var _default = exports["default"] = _Modal["default"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.RCB-modal{position:fixed;top:0;width:100%;height:100%;background:rgba(0,0,0,0.
|
|
1
|
+
.RCB-modal{position:fixed;top:0;width:100%;height:100%;background:rgba(0,0,0,0.6);display:flex;justify-content:center;align-items:center;z-index:2}.RCB-modal .modal-footer{padding:24px 24px;margin:20px -24px 0px;border-radius:0 0 8px 8px;text-align:right}.RCB-modal .modal-footer .RCB-btn{margin-right:14px}.RCB-modal .modal-footer .RCB-btn:last-child{margin-right:0}.RCB-modal-body{background:#FFF;border-radius:8px;padding:0px}.RCB-modal-header{display:flex;margin-bottom:0px;padding:24px 24px 10px}.RCB-modal-title{flex:1;font-size:18px;font-weight:700;line-height:normal}.RCB-modal-close{cursor:pointer}.RCB-modal-close:before{content:"X"}.RCB-modal-content{padding:24px 24px 0px}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var NoDataPlaceholder = function NoDataPlaceholder(props) {
|
|
11
|
+
var className = props.className,
|
|
12
|
+
image = props.image,
|
|
13
|
+
title = props.title,
|
|
14
|
+
description = props.description;
|
|
15
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
16
|
+
className: "RCB-no-data-placeholder ".concat(className)
|
|
17
|
+
}, image && /*#__PURE__*/_react["default"].createElement("div", {
|
|
18
|
+
className: "RCB-no-data-image"
|
|
19
|
+
}, image), title && /*#__PURE__*/_react["default"].createElement("div", {
|
|
20
|
+
className: "RCB-no-data-title"
|
|
21
|
+
}, title), description && /*#__PURE__*/_react["default"].createElement("div", {
|
|
22
|
+
className: "RCB-no-data-description"
|
|
23
|
+
}, description));
|
|
24
|
+
};
|
|
25
|
+
NoDataPlaceholder.propTypes = {
|
|
26
|
+
/** Pass any additional classNames to NoDataPlaceholder component */
|
|
27
|
+
className: _propTypes["default"].string,
|
|
28
|
+
/** React element (typically an image or icon) to display */
|
|
29
|
+
image: _propTypes["default"].element,
|
|
30
|
+
/** Title text to display */
|
|
31
|
+
title: _propTypes["default"].string,
|
|
32
|
+
/** Description text to display */
|
|
33
|
+
description: _propTypes["default"].string
|
|
34
|
+
};
|
|
35
|
+
NoDataPlaceholder.defaultProps = {
|
|
36
|
+
className: "",
|
|
37
|
+
title: "No Data Available",
|
|
38
|
+
description: "There is no data to display at the moment."
|
|
39
|
+
};
|
|
40
|
+
NoDataPlaceholder.displayName = "NoDataPlaceholder";
|
|
41
|
+
var _default = exports["default"] = NoDataPlaceholder;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _NoDataPlaceholder = _interopRequireDefault(require("./NoDataPlaceholder"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var meta = {
|
|
11
|
+
title: 'Components/NoDataPlaceholder',
|
|
12
|
+
component: _NoDataPlaceholder["default"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: 'centered'
|
|
15
|
+
},
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
argTypes: {
|
|
18
|
+
image: {
|
|
19
|
+
control: 'object',
|
|
20
|
+
description: 'React element (typically an image or icon) to display'
|
|
21
|
+
},
|
|
22
|
+
title: {
|
|
23
|
+
control: 'text',
|
|
24
|
+
description: 'Title text to display'
|
|
25
|
+
},
|
|
26
|
+
description: {
|
|
27
|
+
control: 'text',
|
|
28
|
+
description: 'Description text to display'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var _default = exports["default"] = meta; // Basic placeholder
|
|
33
|
+
var Default = exports.Default = {
|
|
34
|
+
args: {
|
|
35
|
+
image: /*#__PURE__*/_react["default"].createElement("img", {
|
|
36
|
+
src: "https://placehold.co/100",
|
|
37
|
+
alt: "No Data"
|
|
38
|
+
}),
|
|
39
|
+
title: 'No Data Available',
|
|
40
|
+
description: 'There is no data to display at the moment.'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _NoDataPlaceholder = _interopRequireDefault(require("./NoDataPlaceholder"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
var _default = exports["default"] = _NoDataPlaceholder["default"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.RCB-no-data-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;text-align:center}.RCB-no-data-image{margin-bottom:16px}.RCB-no-data-image img{max-width:120px;max-height:120px;object-fit:contain}.RCB-no-data-title{font-size:18px;font-weight:600;color:#333;margin-bottom:8px}.RCB-no-data-description{font-size:14px;color:#666;line-height:1.5}
|
|
@@ -7,15 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports["default"] = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
function
|
|
12
|
-
function
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
13
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(
|
|
16
|
-
function _arrayLikeToArray(
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
16
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
-
function _arrayWithHoles(
|
|
17
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
18
|
var NotificationComponent = function NotificationComponent(props) {
|
|
20
19
|
var _useState = (0, _react.useState)(false),
|
|
21
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -26,7 +25,9 @@ var NotificationComponent = function NotificationComponent(props) {
|
|
|
26
25
|
messageId = props.messageId,
|
|
27
26
|
fadeOut = props.fadeOut,
|
|
28
27
|
fadeOutTime = props.fadeOutTime,
|
|
29
|
-
className = props.className
|
|
28
|
+
className = props.className,
|
|
29
|
+
_props$showClose = props.showClose,
|
|
30
|
+
showClose = _props$showClose === void 0 ? false : _props$showClose;
|
|
30
31
|
var fadeOutMessage = typeof fadeOut !== "undefined" ? fadeOut : appearance === "success";
|
|
31
32
|
var timerID;
|
|
32
33
|
var clearMessage = function clearMessage() {
|
|
@@ -52,7 +53,14 @@ var NotificationComponent = function NotificationComponent(props) {
|
|
|
52
53
|
} else {
|
|
53
54
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
54
55
|
className: "RCB-notif RCB-notif-".concat(appearance, " ").concat(className)
|
|
55
|
-
},
|
|
56
|
+
}, showClose ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
57
|
+
className: "notif-wrapper"
|
|
58
|
+
}, children, /*#__PURE__*/_react["default"].createElement("div", {
|
|
59
|
+
className: "".concat(appearance, "-cross-icon"),
|
|
60
|
+
onClick: function onClick() {
|
|
61
|
+
setHideMessage(true);
|
|
62
|
+
}
|
|
63
|
+
})) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children));
|
|
56
64
|
}
|
|
57
65
|
};
|
|
58
66
|
NotificationComponent.propTypes = {
|
|
@@ -65,7 +73,9 @@ NotificationComponent.propTypes = {
|
|
|
65
73
|
/* Should the message fadeout after (fadeOutTime)ms or not. Default true for success messages only. */
|
|
66
74
|
fadeOut: _propTypes["default"].bool,
|
|
67
75
|
/* fadeout timer, in milliseconds */
|
|
68
|
-
fadeOutTime: _propTypes["default"].number
|
|
76
|
+
fadeOutTime: _propTypes["default"].number,
|
|
77
|
+
/* showClose to hide notification */
|
|
78
|
+
showClose: _propTypes["default"].bool
|
|
69
79
|
};
|
|
70
80
|
NotificationComponent.defaultProps = {
|
|
71
81
|
className: "",
|