@unbxd-ui/unbxd-react-components 0.2.145-beta.4 → 0.2.145-beta.5
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 +1 -1
- package/components/Accordian/Accordian.stories.js +140 -116
- package/components/Button/Button.stories.js +166 -59
- package/components/DataLoader/DataLoader.stories.js +176 -53
- package/components/Form/stories/Checkbox.stories.js +131 -38
- package/components/Form/stories/Dropdown.stories.js +321 -91
- package/components/Form/stories/FileUploader.stories.js +177 -18
- package/components/Form/stories/Input.stories.js +112 -0
- package/components/Form/stories/RangeSlider.stories.js +160 -62
- package/components/Form/stories/SearchableDropdown.stories.js +189 -0
- package/components/Form/stories/ServerPaginatedDropdown.stories.js +370 -0
- package/components/Form/stories/Textarea.stories.js +112 -32
- package/components/Form/stories/Toggle.stories.js +191 -13
- package/components/InlineModal/InlineModal.stories.js +238 -43
- package/components/List/List.stories.js +238 -0
- package/components/Modal/Modal.stories.js +274 -36
- package/components/NotificationComponent/NotificationComponent.stories.js +169 -18
- package/components/ProgressBar/ProgressBar.css +0 -0
- package/components/ProgressBar/ProgressBar.stories.js +202 -9
- package/components/TabsComponent/TabsComponent.stories.js +290 -52
- package/components/Tooltip/Tooltip.stories.js +208 -14
- package/package.json +24 -18
- package/components/Button/DropdownButton.stories.js +0 -48
- package/components/Form/stories/DragDropFileUploader.stories.js +0 -25
- package/components/Form/stories/FormDefault.stories.js +0 -114
- package/components/Form/stories/RadioList.stories.js +0 -52
- package/components/Form/stories/TextInput.stories.js +0 -75
- package/components/Form/stories/form.stories.js +0 -232
- package/components/List/list.stories.js +0 -35
- package/components/Table/Table.stories.js +0 -197
- package/core/dataLoader.stories.js +0 -118
|
@@ -3,59 +3,297 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.VerticalTabs = exports.
|
|
6
|
+
exports["default"] = exports.WithEventHandling = exports.WithDisabledTabs = exports.VerticalTabs = exports.DisabledWithStaticContent = exports.Default = exports.CustomTabTitle = exports.CustomStyling = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _TabsComponent = _interopRequireDefault(require("./TabsComponent"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
});
|
|
10
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
11
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
13
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
14
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
15
|
+
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."); }
|
|
16
|
+
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; } }
|
|
17
|
+
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; }
|
|
18
|
+
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; } }
|
|
19
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
20
|
+
var meta = {
|
|
21
|
+
title: 'Components/TabsComponent',
|
|
22
|
+
component: _TabsComponent["default"],
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: 'centered'
|
|
25
|
+
},
|
|
26
|
+
tags: ['autodocs'],
|
|
27
|
+
argTypes: {
|
|
28
|
+
appearance: {
|
|
29
|
+
control: 'select',
|
|
30
|
+
options: ['HORIZONTAL', 'VERTICAL'],
|
|
31
|
+
description: 'Orientation of the tabs'
|
|
32
|
+
},
|
|
33
|
+
className: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'Additional CSS classes'
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Whether all tabs are disabled'
|
|
40
|
+
},
|
|
41
|
+
selectedTab: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
description: 'ID of the initially selected tab'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var _default = exports["default"] = meta;
|
|
48
|
+
var Tab1Content = function Tab1Content() {
|
|
49
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
50
|
+
style: {
|
|
51
|
+
padding: '20px'
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/_react["default"].createElement("h3", null, "First Tab Content"), /*#__PURE__*/_react["default"].createElement("p", null, "This is the content of the first tab."));
|
|
54
|
+
};
|
|
55
|
+
var Tab2Content = function Tab2Content() {
|
|
56
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
57
|
+
style: {
|
|
58
|
+
padding: '20px'
|
|
59
|
+
}
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement("h3", null, "Second Tab Content"), /*#__PURE__*/_react["default"].createElement("p", null, "This is the content of the second tab."));
|
|
61
|
+
};
|
|
62
|
+
var Tab3Content = function Tab3Content() {
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
64
|
+
style: {
|
|
65
|
+
padding: '20px'
|
|
66
|
+
}
|
|
67
|
+
}, /*#__PURE__*/_react["default"].createElement("h3", null, "Third Tab Content"), /*#__PURE__*/_react["default"].createElement("p", null, "This is the content of the third tab."));
|
|
68
|
+
};
|
|
69
|
+
var Default = exports.Default = {
|
|
70
|
+
render: function render() {
|
|
71
|
+
return /*#__PURE__*/_react["default"].createElement(_TabsComponent["default"], {
|
|
72
|
+
items: [{
|
|
73
|
+
id: 'tab1',
|
|
74
|
+
label: 'Tab 1',
|
|
75
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab1Content, null)
|
|
76
|
+
}, {
|
|
77
|
+
id: 'tab2',
|
|
78
|
+
label: 'Tab 2',
|
|
79
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab2Content, null)
|
|
80
|
+
}, {
|
|
81
|
+
id: 'tab3',
|
|
82
|
+
label: 'Tab 3',
|
|
83
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab3Content, null)
|
|
84
|
+
}],
|
|
85
|
+
appearance: "HORIZONTAL"
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
var VerticalTabs = exports.VerticalTabs = {
|
|
90
|
+
render: function render() {
|
|
91
|
+
return /*#__PURE__*/_react["default"].createElement(_TabsComponent["default"], {
|
|
92
|
+
items: [{
|
|
93
|
+
id: 'tab1',
|
|
94
|
+
label: 'Tab 1',
|
|
95
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab1Content, null)
|
|
96
|
+
}, {
|
|
97
|
+
id: 'tab2',
|
|
98
|
+
label: 'Tab 2',
|
|
99
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab2Content, null)
|
|
100
|
+
}, {
|
|
101
|
+
id: 'tab3',
|
|
102
|
+
label: 'Tab 3',
|
|
103
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab3Content, null)
|
|
104
|
+
}],
|
|
105
|
+
appearance: "VERTICAL"
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
var WithDisabledTabs = exports.WithDisabledTabs = {
|
|
110
|
+
render: function render() {
|
|
111
|
+
return /*#__PURE__*/_react["default"].createElement(_TabsComponent["default"], {
|
|
112
|
+
items: [{
|
|
113
|
+
id: 'tab1',
|
|
114
|
+
label: 'Enabled Tab',
|
|
115
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab1Content, null)
|
|
116
|
+
}, {
|
|
117
|
+
id: 'tab2',
|
|
118
|
+
label: 'Disabled Tab',
|
|
119
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab2Content, null),
|
|
120
|
+
disabled: true
|
|
121
|
+
}, {
|
|
122
|
+
id: 'tab3',
|
|
123
|
+
label: 'Enabled Tab',
|
|
124
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab3Content, null)
|
|
125
|
+
}],
|
|
126
|
+
appearance: "HORIZONTAL"
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
var CustomStyling = exports.CustomStyling = {
|
|
131
|
+
render: function render() {
|
|
132
|
+
var customItems = [{
|
|
133
|
+
id: 'success',
|
|
134
|
+
label: /*#__PURE__*/_react["default"].createElement("span", {
|
|
135
|
+
style: {
|
|
136
|
+
color: '#4CAF50'
|
|
137
|
+
}
|
|
138
|
+
}, "\u2713 Success"),
|
|
139
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement("div", {
|
|
140
|
+
style: {
|
|
141
|
+
padding: '20px',
|
|
142
|
+
color: '#4CAF50'
|
|
143
|
+
}
|
|
144
|
+
}, "Success content")
|
|
145
|
+
}, {
|
|
146
|
+
id: 'warning',
|
|
147
|
+
label: /*#__PURE__*/_react["default"].createElement("span", {
|
|
148
|
+
style: {
|
|
149
|
+
color: '#FFC107'
|
|
150
|
+
}
|
|
151
|
+
}, "\u26A0 Warning"),
|
|
152
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement("div", {
|
|
153
|
+
style: {
|
|
154
|
+
padding: '20px',
|
|
155
|
+
color: '#FFC107'
|
|
156
|
+
}
|
|
157
|
+
}, "Warning content")
|
|
158
|
+
}, {
|
|
159
|
+
id: 'error',
|
|
160
|
+
label: /*#__PURE__*/_react["default"].createElement("span", {
|
|
161
|
+
style: {
|
|
162
|
+
color: '#F44336'
|
|
163
|
+
}
|
|
164
|
+
}, "\u2715 Error"),
|
|
165
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement("div", {
|
|
166
|
+
style: {
|
|
167
|
+
padding: '20px',
|
|
168
|
+
color: '#F44336'
|
|
169
|
+
}
|
|
170
|
+
}, "Error content")
|
|
171
|
+
}];
|
|
172
|
+
return /*#__PURE__*/_react["default"].createElement(_TabsComponent["default"], {
|
|
173
|
+
items: customItems,
|
|
174
|
+
appearance: "HORIZONTAL",
|
|
175
|
+
className: "custom-tabs"
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
var WithEventHandling = exports.WithEventHandling = {
|
|
180
|
+
render: function render() {
|
|
181
|
+
var _React$useState = _react["default"].useState('tab1'),
|
|
182
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
183
|
+
activeTab = _React$useState2[0],
|
|
184
|
+
setActiveTab = _React$useState2[1];
|
|
185
|
+
var _React$useState3 = _react["default"].useState([]),
|
|
186
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
187
|
+
log = _React$useState4[0],
|
|
188
|
+
setLog = _React$useState4[1];
|
|
189
|
+
var handleTabChange = function handleTabChange(tabId) {
|
|
190
|
+
setLog(function (prev) {
|
|
191
|
+
return [].concat(_toConsumableArray(prev), ["Tab change requested: ".concat(tabId)]);
|
|
192
|
+
});
|
|
193
|
+
return tabId !== 'tab3';
|
|
194
|
+
};
|
|
195
|
+
var handleTabChanged = function handleTabChanged(tabId) {
|
|
196
|
+
setLog(function (prev) {
|
|
197
|
+
return [].concat(_toConsumableArray(prev), ["Tab changed to: ".concat(tabId)]);
|
|
198
|
+
});
|
|
199
|
+
setActiveTab(tabId);
|
|
200
|
+
};
|
|
201
|
+
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_TabsComponent["default"], {
|
|
202
|
+
items: [{
|
|
203
|
+
id: 'tab1',
|
|
204
|
+
label: 'Tab 1',
|
|
205
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab1Content, null)
|
|
206
|
+
}, {
|
|
207
|
+
id: 'tab2',
|
|
208
|
+
label: 'Tab 2',
|
|
209
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab2Content, null)
|
|
210
|
+
}, {
|
|
211
|
+
id: 'tab3',
|
|
212
|
+
label: 'Tab 3 (Blocked)',
|
|
213
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab3Content, null)
|
|
214
|
+
}],
|
|
215
|
+
selectedTab: activeTab,
|
|
216
|
+
onTabChange: handleTabChange,
|
|
217
|
+
onTabChanged: handleTabChanged
|
|
218
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
219
|
+
style: {
|
|
220
|
+
marginTop: '20px',
|
|
221
|
+
padding: '10px',
|
|
222
|
+
background: '#f5f5f5'
|
|
223
|
+
}
|
|
224
|
+
}, /*#__PURE__*/_react["default"].createElement("h4", null, "Event Log:"), log.map(function (entry, index) {
|
|
225
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
226
|
+
key: index
|
|
227
|
+
}, entry);
|
|
228
|
+
})));
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
var DisabledWithStaticContent = exports.DisabledWithStaticContent = {
|
|
232
|
+
render: function render() {
|
|
233
|
+
return /*#__PURE__*/_react["default"].createElement(_TabsComponent["default"], {
|
|
234
|
+
items: [{
|
|
235
|
+
id: 'tab1',
|
|
236
|
+
label: 'Tab 1',
|
|
237
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab1Content, null)
|
|
238
|
+
}, {
|
|
239
|
+
id: 'tab2',
|
|
240
|
+
label: 'Tab 2',
|
|
241
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab2Content, null)
|
|
242
|
+
}, {
|
|
243
|
+
id: 'tab3',
|
|
244
|
+
label: 'Tab 3',
|
|
245
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab3Content, null)
|
|
246
|
+
}],
|
|
247
|
+
disabled: true,
|
|
248
|
+
staticTabContent: /*#__PURE__*/_react["default"].createElement("div", {
|
|
249
|
+
style: {
|
|
250
|
+
padding: '20px',
|
|
251
|
+
textAlign: 'center',
|
|
252
|
+
color: '#666'
|
|
253
|
+
}
|
|
254
|
+
}, /*#__PURE__*/_react["default"].createElement("h3", null, "Tabs are currently disabled"), /*#__PURE__*/_react["default"].createElement("p", null, "This content is shown when all tabs are disabled."))
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
var CustomTabTitle = exports.CustomTabTitle = {
|
|
259
|
+
render: function render() {
|
|
260
|
+
var CustomTitle = function CustomTitle(props) {
|
|
261
|
+
var itemData = props.itemData,
|
|
262
|
+
selected = props.selected,
|
|
263
|
+
changeTab = props.changeTab;
|
|
264
|
+
var id = itemData.id,
|
|
265
|
+
label = itemData.label;
|
|
266
|
+
var isSelected = id === selected;
|
|
267
|
+
return /*#__PURE__*/_react["default"].createElement("li", {
|
|
268
|
+
onClick: function onClick() {
|
|
269
|
+
return changeTab(id);
|
|
270
|
+
},
|
|
271
|
+
style: {
|
|
272
|
+
padding: '10px 20px',
|
|
273
|
+
cursor: 'pointer',
|
|
274
|
+
backgroundColor: isSelected ? '#3E71F2' : '#fff',
|
|
275
|
+
color: isSelected ? '#fff' : '#000',
|
|
276
|
+
borderRadius: '20px',
|
|
277
|
+
margin: '0 5px',
|
|
278
|
+
listStyle: 'none'
|
|
279
|
+
}
|
|
280
|
+
}, label);
|
|
281
|
+
};
|
|
282
|
+
return /*#__PURE__*/_react["default"].createElement(_TabsComponent["default"], {
|
|
283
|
+
items: [{
|
|
284
|
+
id: 'tab1',
|
|
285
|
+
label: 'Custom Tab 1',
|
|
286
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab1Content, null)
|
|
287
|
+
}, {
|
|
288
|
+
id: 'tab2',
|
|
289
|
+
label: 'Custom Tab 2',
|
|
290
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab2Content, null)
|
|
291
|
+
}, {
|
|
292
|
+
id: 'tab3',
|
|
293
|
+
label: 'Custom Tab 3',
|
|
294
|
+
bodyComponent: /*#__PURE__*/_react["default"].createElement(Tab3Content, null)
|
|
295
|
+
}],
|
|
296
|
+
TabTitleItem: CustomTitle
|
|
297
|
+
});
|
|
298
|
+
}
|
|
61
299
|
};
|
|
@@ -3,21 +3,215 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.
|
|
6
|
+
exports["default"] = exports.RichContent = exports.ProgrammaticControl = exports.DirectionsDemo = exports.Default = exports.CustomStyling = exports.ClickActivated = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _Tooltip = _interopRequireDefault(require("./Tooltip"));
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
10
|
+
var meta = {
|
|
11
|
+
title: 'Components/Tooltip',
|
|
12
|
+
component: _Tooltip["default"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: 'centered'
|
|
15
|
+
},
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
argTypes: {
|
|
18
|
+
direction: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: ['right', 'bottom', 'left', 'top'],
|
|
21
|
+
description: 'Direction in which the tooltip appears'
|
|
22
|
+
},
|
|
23
|
+
activatorAction: {
|
|
24
|
+
control: 'radio',
|
|
25
|
+
options: ['click', 'hover'],
|
|
26
|
+
description: 'Action that triggers the tooltip'
|
|
27
|
+
},
|
|
28
|
+
className: {
|
|
29
|
+
control: 'text',
|
|
30
|
+
description: 'Additional CSS classes'
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var _default = exports["default"] = meta; // Custom activator components
|
|
35
|
+
var InfoIcon = function InfoIcon() {
|
|
36
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
37
|
+
style: {
|
|
38
|
+
width: '20px',
|
|
39
|
+
height: '20px',
|
|
40
|
+
borderRadius: '50%',
|
|
41
|
+
backgroundColor: '#3E71F2',
|
|
42
|
+
color: 'white',
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
justifyContent: 'center',
|
|
46
|
+
fontSize: '14px',
|
|
47
|
+
cursor: 'pointer'
|
|
48
|
+
}
|
|
49
|
+
}, "i");
|
|
50
|
+
};
|
|
51
|
+
var QuestionIcon = function QuestionIcon() {
|
|
52
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
|
+
style: {
|
|
54
|
+
width: '20px',
|
|
55
|
+
height: '20px',
|
|
56
|
+
borderRadius: '50%',
|
|
57
|
+
backgroundColor: '#6c757d',
|
|
58
|
+
color: 'white',
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
fontSize: '14px',
|
|
63
|
+
cursor: 'pointer'
|
|
64
|
+
}
|
|
65
|
+
}, "?");
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Default story with hover action
|
|
69
|
+
var Default = exports.Default = {
|
|
70
|
+
render: function render() {
|
|
71
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
72
|
+
style: {
|
|
73
|
+
padding: '50px'
|
|
74
|
+
}
|
|
75
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], null, "This is a default tooltip that appears on hover"));
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Story demonstrating different directions
|
|
80
|
+
var DirectionsDemo = exports.DirectionsDemo = {
|
|
81
|
+
render: function render() {
|
|
82
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
83
|
+
style: {
|
|
84
|
+
display: 'grid',
|
|
85
|
+
gridTemplateColumns: 'repeat(2, 1fr)',
|
|
86
|
+
gap: '50px',
|
|
87
|
+
padding: '50px'
|
|
88
|
+
}
|
|
89
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
90
|
+
direction: "right"
|
|
91
|
+
}, "Tooltip on the right"), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
92
|
+
direction: "left"
|
|
93
|
+
}, "Tooltip on the left"), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
94
|
+
direction: "top"
|
|
95
|
+
}, "Tooltip on the top"), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
96
|
+
direction: "bottom"
|
|
97
|
+
}, "Tooltip on the bottom"));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// Story with click action
|
|
102
|
+
var ClickActivated = exports.ClickActivated = {
|
|
103
|
+
render: function render() {
|
|
104
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
105
|
+
style: {
|
|
106
|
+
padding: '50px'
|
|
107
|
+
}
|
|
108
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
109
|
+
activatorAction: "click",
|
|
110
|
+
TooltipActivator: InfoIcon
|
|
111
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
112
|
+
style: {
|
|
113
|
+
padding: '10px'
|
|
114
|
+
}
|
|
115
|
+
}, "This tooltip is activated by clicking")));
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Story with custom activator and rich content
|
|
120
|
+
var RichContent = exports.RichContent = {
|
|
121
|
+
render: function render() {
|
|
122
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
123
|
+
style: {
|
|
124
|
+
padding: '50px'
|
|
125
|
+
}
|
|
126
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
127
|
+
TooltipActivator: QuestionIcon,
|
|
128
|
+
direction: "bottom"
|
|
129
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
130
|
+
style: {
|
|
131
|
+
padding: '15px',
|
|
132
|
+
maxWidth: '200px'
|
|
133
|
+
}
|
|
134
|
+
}, /*#__PURE__*/_react["default"].createElement("h4", {
|
|
135
|
+
style: {
|
|
136
|
+
margin: '0 0 10px 0'
|
|
137
|
+
}
|
|
138
|
+
}, "Help Information"), /*#__PURE__*/_react["default"].createElement("p", {
|
|
139
|
+
style: {
|
|
140
|
+
margin: '0'
|
|
141
|
+
}
|
|
142
|
+
}, "This tooltip contains rich HTML content with styling and formatting."), /*#__PURE__*/_react["default"].createElement("ul", {
|
|
143
|
+
style: {
|
|
144
|
+
margin: '10px 0 0 0',
|
|
145
|
+
paddingLeft: '20px'
|
|
146
|
+
}
|
|
147
|
+
}, /*#__PURE__*/_react["default"].createElement("li", null, "Feature 1"), /*#__PURE__*/_react["default"].createElement("li", null, "Feature 2"), /*#__PURE__*/_react["default"].createElement("li", null, "Feature 3")))));
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// Story showing custom styling
|
|
152
|
+
var CustomStyling = exports.CustomStyling = {
|
|
153
|
+
render: function render() {
|
|
154
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
155
|
+
style: {
|
|
156
|
+
padding: '50px'
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
159
|
+
className: "custom-tooltip",
|
|
160
|
+
TooltipActivator: function TooltipActivator() {
|
|
161
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
162
|
+
style: {
|
|
163
|
+
padding: '5px 10px',
|
|
164
|
+
backgroundColor: '#28a745',
|
|
165
|
+
color: 'white',
|
|
166
|
+
borderRadius: '4px',
|
|
167
|
+
cursor: 'pointer'
|
|
168
|
+
}
|
|
169
|
+
}, "Hover me");
|
|
170
|
+
}
|
|
171
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
172
|
+
style: {
|
|
173
|
+
padding: '10px',
|
|
174
|
+
backgroundColor: '#28a745',
|
|
175
|
+
color: 'white',
|
|
176
|
+
borderRadius: '4px',
|
|
177
|
+
boxShadow: '0 2px 4px rgba(0,0,0,0.2)'
|
|
178
|
+
}
|
|
179
|
+
}, "Custom styled tooltip content")));
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Story demonstrating programmatic control
|
|
184
|
+
var ProgrammaticControl = exports.ProgrammaticControl = {
|
|
185
|
+
render: function render() {
|
|
186
|
+
var tooltipRef = _react["default"].useRef();
|
|
187
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
188
|
+
style: {
|
|
189
|
+
padding: '50px'
|
|
190
|
+
}
|
|
191
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
192
|
+
style: {
|
|
193
|
+
marginBottom: '20px'
|
|
194
|
+
}
|
|
195
|
+
}, /*#__PURE__*/_react["default"].createElement("button", {
|
|
196
|
+
onClick: function onClick() {
|
|
197
|
+
return tooltipRef.current.hideToolTip();
|
|
198
|
+
},
|
|
199
|
+
style: {
|
|
200
|
+
padding: '8px 16px',
|
|
201
|
+
backgroundColor: '#dc3545',
|
|
202
|
+
color: 'white',
|
|
203
|
+
border: 'none',
|
|
204
|
+
borderRadius: '4px',
|
|
205
|
+
cursor: 'pointer'
|
|
206
|
+
}
|
|
207
|
+
}, "Hide Tooltip")), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
208
|
+
ref: tooltipRef,
|
|
209
|
+
activatorAction: "click",
|
|
210
|
+
TooltipActivator: InfoIcon
|
|
211
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
212
|
+
style: {
|
|
213
|
+
padding: '10px'
|
|
214
|
+
}
|
|
215
|
+
}, "This tooltip can be controlled programmatically")));
|
|
216
|
+
}
|
|
23
217
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbxd-ui/unbxd-react-components",
|
|
3
|
-
"version": "0.2.145-beta.
|
|
3
|
+
"version": "0.2.145-beta.5",
|
|
4
4
|
"description": "React components library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react components",
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
"*.css"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
|
-
"storybook": "start-storybook -p 6006 -s public",
|
|
23
|
-
"deploy-storybook": "storybook-to-ghpages",
|
|
24
22
|
"scss": "node-sass src/components -o src/components --output-style compressed",
|
|
25
23
|
"publish-scss": "node-sass src/components -o lib/components --output-style compressed",
|
|
26
24
|
"postcss": "postcss src/components/*.css --use autoprefixer --dir src/components",
|
|
@@ -33,21 +31,22 @@
|
|
|
33
31
|
"copyscss": "cp -rf src/components/core.scss src/components/theme.scss lib/components",
|
|
34
32
|
"link": "npm run build-css && npm run publish-css && npm run build && npm run copypackage && npm run copyscss && cd lib && npm link",
|
|
35
33
|
"publish-prod": "npm run publish-css && npm run build && npm run copypackage && npm run copyscss && cd lib && npm publish",
|
|
36
|
-
"publish-beta": "npm run publish-css && npm run build && npm run copypackage && npm run copyscss && cd lib && npm publish --tag beta"
|
|
34
|
+
"publish-beta": "npm run publish-css && npm run build && npm run copypackage && npm run copyscss && cd lib && npm publish --tag beta",
|
|
35
|
+
"storybook": "storybook dev -p 6007",
|
|
36
|
+
"build-storybook": "storybook build",
|
|
37
|
+
"deploy-storybook": "gh-pages -d storybook-static"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@storybook/addon-a11y": "^7.0.25",
|
|
40
|
-
"@storybook/addon-storysource": "^7.0.25",
|
|
41
40
|
"bluebird": "^3.7.2",
|
|
42
41
|
"dequal": "^1.0.1",
|
|
43
42
|
"lodash.clonedeep": "^4.5.0",
|
|
44
43
|
"motion": "^12.0.6",
|
|
45
44
|
"postcss": "^8.4.28",
|
|
45
|
+
"postcss-loader": "^8.1.1",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"react-dom": "^18.2.0",
|
|
48
48
|
"react-window": "^1.8.6",
|
|
49
49
|
"react-window-infinite-loader": "^1.0.7",
|
|
50
|
-
"sass": "^1.63.6",
|
|
51
50
|
"whatwg-fetch": "^3.6.2"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
@@ -57,25 +56,32 @@
|
|
|
57
56
|
"@babel/plugin-proposal-export-default-from": "^7.14.5",
|
|
58
57
|
"@babel/preset-env": "^7.15.8",
|
|
59
58
|
"@babel/preset-react": "^7.14.5",
|
|
60
|
-
"@storybook/addon-
|
|
61
|
-
"@storybook/addon-
|
|
62
|
-
"@storybook/addon-
|
|
63
|
-
"@storybook/addon-
|
|
64
|
-
"@storybook/
|
|
65
|
-
"@storybook/
|
|
66
|
-
"@storybook/react": "^
|
|
67
|
-
"@storybook/
|
|
59
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
60
|
+
"@storybook/addon-interactions": "^8.6.14",
|
|
61
|
+
"@storybook/addon-onboarding": "^8.6.14",
|
|
62
|
+
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
|
63
|
+
"@storybook/blocks": "^8.6.14",
|
|
64
|
+
"@storybook/react": "^8.6.14",
|
|
65
|
+
"@storybook/react-webpack5": "^8.6.14",
|
|
66
|
+
"@storybook/test": "^8.6.14",
|
|
68
67
|
"autoprefixer": "^10.4.14",
|
|
69
68
|
"babel-eslint": "^10.1.0",
|
|
70
69
|
"babel-loader": "^8.2.3",
|
|
71
70
|
"cross-env": "^7.0.3",
|
|
72
|
-
"
|
|
71
|
+
"css-loader": "^6.8.1",
|
|
72
|
+
"eslint": "^8.57.1",
|
|
73
73
|
"eslint-plugin-babel": "^5.3.1",
|
|
74
74
|
"eslint-plugin-react": "^7.26.1",
|
|
75
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
76
|
+
"gh-pages": "^6.3.0",
|
|
75
77
|
"node-sass": "^8.0.0",
|
|
76
78
|
"postcss-cli": "^10.1.0",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
+
"prop-types": "^15.8.1",
|
|
80
|
+
"sass": "^1.89.0",
|
|
81
|
+
"sass-loader": "^13.3.2",
|
|
82
|
+
"storybook": "^8.6.14",
|
|
83
|
+
"style-loader": "^3.3.3",
|
|
84
|
+
"webpack": "^5.88.0"
|
|
79
85
|
},
|
|
80
86
|
"overrides": {
|
|
81
87
|
"fbjs": "^3.0.5",
|