@unbxd-ui/unbxd-react-components 0.2.220 → 0.3.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/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 +4 -4
- package/components/Button/Button.stories.js +168 -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 +56 -41
- 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/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 +20 -1
- package/components/index.js +66 -3
- package/components/theme.css +2 -3
- 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
package/core/utils.js
CHANGED
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _Validators = _interopRequireDefault(require("./Validators"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
9
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
10
|
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; }
|
|
11
11
|
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; }
|
|
12
|
-
function _defineProperty(
|
|
13
|
-
function _toPropertyKey(
|
|
14
|
-
function _toPrimitive(
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
14
|
+
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); }
|
|
15
15
|
var uniqueCounter = 1;
|
|
16
16
|
var utils = {
|
|
17
17
|
configs: {},
|
|
@@ -98,6 +98,17 @@ var utils = {
|
|
|
98
98
|
},
|
|
99
99
|
isArray: function isArray(value) {
|
|
100
100
|
return Object.prototype.toString.call(value) === "[object Array]";
|
|
101
|
+
},
|
|
102
|
+
isRTL: function isRTL(text) {
|
|
103
|
+
var language = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "ar";
|
|
104
|
+
/* eslint-disable no-misleading-character-class */
|
|
105
|
+
/* eslint-disable no-useless-escape */
|
|
106
|
+
var cleanedText = text.replace(/(?:[\0-@\[-`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482-\u0489\u0530\u0557\u0558\u055A-\u055F\u0589-\u05CF\u05EB-\u05EE\u05F3-\u061F\u064B-\u066D\u0670\u06D4\u06D6-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070F\u0711\u0730-\u074C\u07A6-\u07B0\u07B2-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u07FB-\u07FF\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u083F\u0859-\u085F\u086B-\u086F\u0888\u088F-\u089F\u08CA-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962-\u0970\u0981-\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA-\u09BC\u09BE-\u09CD\u09CF-\u09DB\u09DE\u09E2-\u09EF\u09F2-\u09FB\u09FD-\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A-\u0A58\u0A5D\u0A5F-\u0A71\u0A75-\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA-\u0ABC\u0ABE-\u0ACF\u0AD1-\u0ADF\u0AE2-\u0AF8\u0AFA-\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A-\u0B3C\u0B3E-\u0B5B\u0B5E\u0B62-\u0B70\u0B72-\u0B82\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BCF\u0BD1-\u0C04\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C3E-\u0C57\u0C5B\u0C5C\u0C5E\u0C5F\u0C62-\u0C7F\u0C81-\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA-\u0CBC\u0CBE-\u0CDC\u0CDF\u0CE2-\u0CF0\u0CF3-\u0D03\u0D0D\u0D11\u0D3B\u0D3C\u0D3E-\u0D4D\u0D4F-\u0D53\u0D57-\u0D5E\u0D62-\u0D79\u0D80-\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0E00\u0E31\u0E34-\u0E3F\u0E47-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EB1\u0EB4-\u0EBC\u0EBE\u0EBF\u0EC5\u0EC7-\u0EDB\u0EE0-\u0EFF\u0F01-\u0F3F\u0F48\u0F6D-\u0F87\u0F8D-\u0FFF\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16F0\u16F9-\u16FF\u1712-\u171E\u1732-\u173F\u1752-\u175F\u176D\u1771-\u177F\u17B4-\u17D6\u17D8-\u17DB\u17DD-\u181F\u1879-\u187F\u1885\u1886\u18A9\u18AB-\u18AF\u18F6-\u18FF\u191F-\u194F\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19FF\u1A17-\u1A1F\u1A55-\u1AA6\u1AA8-\u1B04\u1B34-\u1B44\u1B4D-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BFF\u1C24-\u1C4C\u1C50-\u1C59\u1C7E\u1C7F\u1C8B-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1CFB-\u1CFF\u1DC0-\u1DFF\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u2182\u2185-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7F\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF-\u2E2E\u2E30-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u3040\u3097-\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA620-\uA629\uA62C-\uA63F\uA66F-\uA67E\uA69E\uA69F\uA6E6-\uA716\uA720\uA721\uA789\uA78A\uA7CE\uA7CF\uA7D2\uA7D4\uA7DD-\uA7F1\uA802\uA806\uA80B\uA823-\uA83F\uA874-\uA881\uA8B4-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF-\uA909\uA926-\uA92F\uA947-\uA95F\uA97D-\uA983\uA9B3-\uA9CE\uA9D0-\uA9DF\uA9E5\uA9F0-\uA9F9\uA9FF\uAA29-\uAA3F\uAA43\uAA4C-\uAA5F\uAA77-\uAA79\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAC3-\uAADA\uAADE\uAADF\uAAEB-\uAAF1\uAAF5-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27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F\uDF89\uDFA9\uDFC3\uDFCC-\uDFFF]|\uD837[\uDC00-\uDEFF\uDF1F-\uDF24\uDF2B-\uDFFF]|\uD838[\uDC00-\uDC2F\uDC6E-\uDCFF\uDD2D-\uDD36\uDD3E-\uDD4D\uDD4F-\uDE8F\uDEAE-\uDEBF\uDEEC-\uDFFF]|\uD839[\uDC00-\uDCCF\uDCEC-\uDDCF\uDDEE\uDDEF\uDDF1-\uDFDF\uDFE7\uDFEC\uDFEF\uDFFF]|\uD83A[\uDCC5-\uDCFF\uDD44-\uDD4A\uDD4C-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD869[\uDEE0-\uDEFF]|\uD86D[\uDF3A-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFEF]|\uD87B[\uDE5E-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDF4F]|\uD888[\uDFB0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/g, "");
|
|
107
|
+
if (cleanedText === "") {
|
|
108
|
+
return language === "ar";
|
|
109
|
+
}
|
|
110
|
+
var rtlRegex = /^[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/;
|
|
111
|
+
return rtlRegex.test(cleanedText);
|
|
101
112
|
}
|
|
102
113
|
};
|
|
103
114
|
var _default = exports["default"] = utils;
|
package/index.js
CHANGED
|
@@ -111,6 +111,12 @@ Object.defineProperty(exports, "NotificationComponent", {
|
|
|
111
111
|
return _components.NotificationComponent;
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
|
+
Object.defineProperty(exports, "PageLoader", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function get() {
|
|
117
|
+
return _components.PageLoader;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
114
120
|
Object.defineProperty(exports, "PaginationComponent", {
|
|
115
121
|
enumerable: true,
|
|
116
122
|
get: function get() {
|
|
@@ -135,12 +141,24 @@ Object.defineProperty(exports, "RangeSlider", {
|
|
|
135
141
|
return _components.RangeSlider;
|
|
136
142
|
}
|
|
137
143
|
});
|
|
144
|
+
Object.defineProperty(exports, "SearchableDropdown", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function get() {
|
|
147
|
+
return _components.SearchableDropdown;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
138
150
|
Object.defineProperty(exports, "Table", {
|
|
139
151
|
enumerable: true,
|
|
140
152
|
get: function get() {
|
|
141
153
|
return _components.Table;
|
|
142
154
|
}
|
|
143
155
|
});
|
|
156
|
+
Object.defineProperty(exports, "TableOld", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function get() {
|
|
159
|
+
return _components.TableOld;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
144
162
|
Object.defineProperty(exports, "TabsComponent", {
|
|
145
163
|
enumerable: true,
|
|
146
164
|
get: function get() {
|
|
@@ -153,6 +171,12 @@ Object.defineProperty(exports, "Textarea", {
|
|
|
153
171
|
return _components.Textarea;
|
|
154
172
|
}
|
|
155
173
|
});
|
|
174
|
+
Object.defineProperty(exports, "ToastNotificationWrapper", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function get() {
|
|
177
|
+
return _components.ToastNotificationWrapper;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
156
180
|
Object.defineProperty(exports, "Toggle", {
|
|
157
181
|
enumerable: true,
|
|
158
182
|
get: function get() {
|
|
@@ -177,12 +201,42 @@ Object.defineProperty(exports, "dataLoader", {
|
|
|
177
201
|
return _core.dataLoader;
|
|
178
202
|
}
|
|
179
203
|
});
|
|
204
|
+
Object.defineProperty(exports, "errorToast", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function get() {
|
|
207
|
+
return _components.errorToast;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "infoToast", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function get() {
|
|
213
|
+
return _components.infoToast;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "resetToast", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function get() {
|
|
219
|
+
return _components.resetToast;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "successToast", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function get() {
|
|
225
|
+
return _components.successToast;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
180
228
|
Object.defineProperty(exports, "utils", {
|
|
181
229
|
enumerable: true,
|
|
182
230
|
get: function get() {
|
|
183
231
|
return _core.utils;
|
|
184
232
|
}
|
|
185
233
|
});
|
|
234
|
+
Object.defineProperty(exports, "warningToast", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function get() {
|
|
237
|
+
return _components.warningToast;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
186
240
|
var _components = require("./components");
|
|
187
241
|
var _core = require("./core");
|
|
188
242
|
var _Button = require("./components/Button");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbxd-ui/unbxd-react-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "React components library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react components",
|
|
@@ -12,15 +12,13 @@
|
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "https://github.com/unbxd/unbxd-react-components.git"
|
|
14
14
|
},
|
|
15
|
-
"author": "
|
|
15
|
+
"author": "Netcore Unbxd",
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"main": "lib/index.js",
|
|
18
18
|
"sideEffects": [
|
|
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",
|
|
@@ -31,22 +29,30 @@
|
|
|
31
29
|
"lint": "eslint src",
|
|
32
30
|
"copypackage": "cp -rf package.json README.md lib",
|
|
33
31
|
"copyscss": "cp -rf src/components/core.scss src/components/theme.scss lib/components",
|
|
34
|
-
"link": "npm run publish-css && npm run build && npm run copypackage && npm run copyscss && cd lib && npm link",
|
|
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
|
-
"@
|
|
40
|
-
"@storybook/addon-storysource": "^7.0.25",
|
|
40
|
+
"@unbxd-ui/unbxd-style-dictionary": "^0.2.5",
|
|
41
41
|
"bluebird": "^3.7.2",
|
|
42
42
|
"dequal": "^1.0.1",
|
|
43
|
+
"esbuild": "^0.25.6",
|
|
43
44
|
"lodash.clonedeep": "^4.5.0",
|
|
45
|
+
"lodash.isequal": "^4.5.0",
|
|
46
|
+
"motion": "^12.0.6",
|
|
44
47
|
"postcss": "^8.4.28",
|
|
45
|
-
"
|
|
46
|
-
"react
|
|
48
|
+
"postcss-loader": "^8.1.1",
|
|
49
|
+
"react": "^18.2.0",
|
|
50
|
+
"react-data-table-component": "^7.7.0",
|
|
51
|
+
"react-dom": "^18.2.0",
|
|
47
52
|
"react-window": "^1.8.6",
|
|
48
53
|
"react-window-infinite-loader": "^1.0.7",
|
|
49
54
|
"sass": "^1.63.6",
|
|
55
|
+
"styled-components": "^6.1.18",
|
|
50
56
|
"whatwg-fetch": "^3.6.2"
|
|
51
57
|
},
|
|
52
58
|
"devDependencies": {
|
|
@@ -56,31 +62,32 @@
|
|
|
56
62
|
"@babel/plugin-proposal-export-default-from": "^7.14.5",
|
|
57
63
|
"@babel/preset-env": "^7.15.8",
|
|
58
64
|
"@babel/preset-react": "^7.14.5",
|
|
59
|
-
"@storybook/addon-
|
|
60
|
-
"@storybook/addon-
|
|
61
|
-
"@storybook/addon-
|
|
62
|
-
"@storybook/addon-
|
|
63
|
-
"@storybook/
|
|
64
|
-
"@storybook/
|
|
65
|
-
"@storybook/react": "^
|
|
66
|
-
"@storybook/
|
|
65
|
+
"@storybook/addon-essentials": "^8.6.14",
|
|
66
|
+
"@storybook/addon-interactions": "^8.6.14",
|
|
67
|
+
"@storybook/addon-onboarding": "^8.6.14",
|
|
68
|
+
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
|
69
|
+
"@storybook/blocks": "^8.6.14",
|
|
70
|
+
"@storybook/react": "^8.6.14",
|
|
71
|
+
"@storybook/react-webpack5": "^8.6.14",
|
|
72
|
+
"@storybook/test": "^8.6.14",
|
|
67
73
|
"autoprefixer": "^10.4.14",
|
|
68
74
|
"babel-eslint": "^10.1.0",
|
|
69
75
|
"babel-loader": "^8.2.3",
|
|
70
76
|
"cross-env": "^7.0.3",
|
|
71
|
-
"css-loader": "^
|
|
72
|
-
"eslint": "^
|
|
77
|
+
"css-loader": "^6.8.1",
|
|
78
|
+
"eslint": "^8.57.1",
|
|
73
79
|
"eslint-plugin-babel": "^5.3.1",
|
|
74
80
|
"eslint-plugin-react": "^7.26.1",
|
|
75
|
-
"
|
|
81
|
+
"eslint-plugin-storybook": "^0.12.0",
|
|
82
|
+
"gh-pages": "^6.3.0",
|
|
76
83
|
"node-sass": "^8.0.0",
|
|
77
|
-
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
|
78
84
|
"postcss-cli": "^10.1.0",
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
85
|
+
"prop-types": "^15.8.1",
|
|
86
|
+
"sass": "^1.89.0",
|
|
87
|
+
"sass-loader": "^13.3.2",
|
|
88
|
+
"storybook": "^8.6.14",
|
|
89
|
+
"style-loader": "^3.3.3",
|
|
90
|
+
"webpack": "^5.88.0"
|
|
84
91
|
},
|
|
85
92
|
"overrides": {
|
|
86
93
|
"fbjs": "^3.0.5",
|
|
@@ -89,6 +96,12 @@
|
|
|
89
96
|
"glob-parent": "5.1.2",
|
|
90
97
|
"parse-url": "^8.1.0",
|
|
91
98
|
"@jest/transform": "^29.3.1",
|
|
92
|
-
"semver": "^7.3.5"
|
|
99
|
+
"semver": "^7.3.5",
|
|
100
|
+
"chokidar": "^4.0.3",
|
|
101
|
+
"braces": "^3.0.3",
|
|
102
|
+
"html-loader": "^5.1.0",
|
|
103
|
+
"serialize-javascript": "^6.0.2",
|
|
104
|
+
"micromatch": "^4.0.8",
|
|
105
|
+
"@babel/helpers": "^7.26.10"
|
|
93
106
|
}
|
|
94
107
|
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.DefaultDropdownButton = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _DropdownButton = _interopRequireDefault(require("./DropdownButton"));
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
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(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
-
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(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
var DROPDOWN_OPTIONS = [{
|
|
20
|
-
id: "PrintApple",
|
|
21
|
-
name: "Print Apple",
|
|
22
|
-
message: "Apple"
|
|
23
|
-
}, {
|
|
24
|
-
id: "PrintMango",
|
|
25
|
-
name: "Print Mango",
|
|
26
|
-
message: "Mango"
|
|
27
|
-
}, {
|
|
28
|
-
id: "PrintGrapes",
|
|
29
|
-
name: "Print Grapes",
|
|
30
|
-
message: "Grapes"
|
|
31
|
-
}];
|
|
32
|
-
var DefaultDropdownButton = exports.DefaultDropdownButton = function DefaultDropdownButton() {
|
|
33
|
-
var _useState = (0, _react.useState)(),
|
|
34
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
-
message = _useState2[0],
|
|
36
|
-
setMessage = _useState2[1];
|
|
37
|
-
var printMessage = function printMessage(data) {
|
|
38
|
-
var message = data.message;
|
|
39
|
-
setMessage(message);
|
|
40
|
-
};
|
|
41
|
-
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
|
42
|
-
label: "Actions",
|
|
43
|
-
options: DROPDOWN_OPTIONS,
|
|
44
|
-
onClick: printMessage
|
|
45
|
-
}), /*#__PURE__*/_react["default"].createElement("div", null, "Message is ".concat(message)));
|
|
46
|
-
};
|
|
47
|
-
var _default = exports["default"] = {
|
|
48
|
-
title: "Dropdown Button"
|
|
49
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.SimpleUsage = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _DragDropFileUploader = _interopRequireDefault(require("../DragDropFileUploader"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
|
-
var _default = exports["default"] = {
|
|
11
|
-
title: "DragDropFileUploader"
|
|
12
|
-
};
|
|
13
|
-
var SimpleUsage = exports.SimpleUsage = function SimpleUsage() {
|
|
14
|
-
var onFileChange = function onFileChange() {
|
|
15
|
-
var files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
16
|
-
console.log("SELECTED FILES");
|
|
17
|
-
for (var i = 0; i < files.length; i++) {
|
|
18
|
-
console.log(files[i].name);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
return /*#__PURE__*/_react["default"].createElement(_DragDropFileUploader["default"], {
|
|
22
|
-
onChange: onFileChange,
|
|
23
|
-
appearance: "block"
|
|
24
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, "Drag & drop files into this area"));
|
|
25
|
-
};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.FormExample = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _Form = _interopRequireDefault(require("../Form"));
|
|
10
|
-
var _Dropdown = _interopRequireDefault(require("../Dropdown"));
|
|
11
|
-
var _Input = _interopRequireDefault(require("../Input"));
|
|
12
|
-
var _Textarea = _interopRequireDefault(require("../Textarea"));
|
|
13
|
-
var _RadioList = _interopRequireDefault(require("../RadioList"));
|
|
14
|
-
var _Checkbox = _interopRequireDefault(require("../Checkbox"));
|
|
15
|
-
var _Toggle = _interopRequireDefault(require("../Toggle"));
|
|
16
|
-
var _RangeSlider = _interopRequireDefault(require("../RangeSlider"));
|
|
17
|
-
var _Button = _interopRequireWildcard(require("../../Button"));
|
|
18
|
-
var _Constants = require("../../../../public/Constants");
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
21
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22
|
-
var formValues = {
|
|
23
|
-
email: "anuhosad@gmail.com",
|
|
24
|
-
description: "This is some temporary description",
|
|
25
|
-
yesNoOption: "NO",
|
|
26
|
-
fruits: ["pineapple"],
|
|
27
|
-
fruit: _Constants.FRUITS_LIST.find(function (obj) {
|
|
28
|
-
return obj.id === 4;
|
|
29
|
-
}),
|
|
30
|
-
isActive: true,
|
|
31
|
-
price: 75
|
|
32
|
-
};
|
|
33
|
-
var FormExample = exports.FormExample = function FormExample() {
|
|
34
|
-
var onSubmit = function onSubmit(formData) {
|
|
35
|
-
var data = formData.data;
|
|
36
|
-
console.log("On submit ----> ", data);
|
|
37
|
-
};
|
|
38
|
-
var onChange = function onChange(formData) {
|
|
39
|
-
var data = formData.data;
|
|
40
|
-
console.log("On change ----> ", data);
|
|
41
|
-
};
|
|
42
|
-
return /*#__PURE__*/_react["default"].createElement(_Form["default"], {
|
|
43
|
-
onSubmit: onSubmit,
|
|
44
|
-
onChange: onChange
|
|
45
|
-
}, /*#__PURE__*/_react["default"].createElement(_Input["default"], {
|
|
46
|
-
defaultValue: formValues["email"],
|
|
47
|
-
type: "text",
|
|
48
|
-
name: "email",
|
|
49
|
-
label: "Name",
|
|
50
|
-
placeholder: "Enter your email",
|
|
51
|
-
appearance: "block"
|
|
52
|
-
}), /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
53
|
-
defaultValue: formValues["description"],
|
|
54
|
-
name: "description",
|
|
55
|
-
label: "Description",
|
|
56
|
-
placeholder: "Enter your description",
|
|
57
|
-
appearance: "block"
|
|
58
|
-
}), /*#__PURE__*/_react["default"].createElement(_RadioList["default"], {
|
|
59
|
-
defaultValue: formValues["yesNoOption"],
|
|
60
|
-
name: "yesNoOption",
|
|
61
|
-
label: "Are you sure?",
|
|
62
|
-
options: [{
|
|
63
|
-
id: "YES",
|
|
64
|
-
name: "Yes"
|
|
65
|
-
}, {
|
|
66
|
-
id: "NO",
|
|
67
|
-
name: "No"
|
|
68
|
-
}],
|
|
69
|
-
appearance: "block"
|
|
70
|
-
}), /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
71
|
-
name: "orange",
|
|
72
|
-
label: "Orange",
|
|
73
|
-
defaultValue: formValues["fruits"].includes("orange")
|
|
74
|
-
}), /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
75
|
-
name: "pineapple",
|
|
76
|
-
label: "Pineapple",
|
|
77
|
-
defaultValue: formValues["fruits"].includes("pineapple")
|
|
78
|
-
}), /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
79
|
-
name: "grapes",
|
|
80
|
-
label: "Grapes",
|
|
81
|
-
defaultValue: formValues["fruits"].includes("grapes")
|
|
82
|
-
}), /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_Dropdown["default"], {
|
|
83
|
-
name: "fruit",
|
|
84
|
-
defaultValue: formValues["fruit"],
|
|
85
|
-
label: "Select fruit",
|
|
86
|
-
options: _Constants.FRUITS_LIST,
|
|
87
|
-
appearance: "block"
|
|
88
|
-
}), /*#__PURE__*/_react["default"].createElement(_Toggle["default"], {
|
|
89
|
-
name: "isActive",
|
|
90
|
-
defaultValue: formValues["isActive"],
|
|
91
|
-
label: "Is Active?",
|
|
92
|
-
appearance: "block"
|
|
93
|
-
}), /*#__PURE__*/_react["default"].createElement(_RangeSlider["default"], {
|
|
94
|
-
defaultValue: formValues["price"],
|
|
95
|
-
name: "price",
|
|
96
|
-
label: "Select price range",
|
|
97
|
-
min: "10",
|
|
98
|
-
max: "100",
|
|
99
|
-
appearance: "block"
|
|
100
|
-
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
101
|
-
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
102
|
-
className: "full-width-btn"
|
|
103
|
-
}, "Submit"));
|
|
104
|
-
};
|
|
105
|
-
FormExample.story = {
|
|
106
|
-
name: "Form"
|
|
107
|
-
};
|
|
108
|
-
var _default = exports["default"] = {
|
|
109
|
-
title: "Form|Form",
|
|
110
|
-
parameters: {
|
|
111
|
-
info: {
|
|
112
|
-
propTables: [_Form["default"]]
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports._RadioList = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _Form = _interopRequireDefault(require("../Form"));
|
|
10
|
-
var _RadioList2 = _interopRequireDefault(require("../RadioList"));
|
|
11
|
-
var _Button = _interopRequireWildcard(require("../../Button"));
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
var _RadioList = exports._RadioList = function _RadioList() {
|
|
16
|
-
var onSubmit = function onSubmit(formData) {
|
|
17
|
-
var data = formData.data;
|
|
18
|
-
console.log("Submitted data: ", data);
|
|
19
|
-
};
|
|
20
|
-
return /*#__PURE__*/_react["default"].createElement(_Form["default"], {
|
|
21
|
-
onSubmit: onSubmit
|
|
22
|
-
}, /*#__PURE__*/_react["default"].createElement(_RadioList2["default"], {
|
|
23
|
-
name: "yesNoOption",
|
|
24
|
-
label: "Are you sure?",
|
|
25
|
-
options: [{
|
|
26
|
-
id: "YES",
|
|
27
|
-
name: "Yes"
|
|
28
|
-
}, {
|
|
29
|
-
id: "NO",
|
|
30
|
-
name: "No"
|
|
31
|
-
}],
|
|
32
|
-
appearance: "block"
|
|
33
|
-
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
34
|
-
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
35
|
-
className: "full-width-btn"
|
|
36
|
-
}, "Submit"));
|
|
37
|
-
};
|
|
38
|
-
_RadioList.story = {
|
|
39
|
-
name: "RadioList",
|
|
40
|
-
parameters: {
|
|
41
|
-
info: {
|
|
42
|
-
propTables: [_RadioList2["default"]]
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
var _default = exports["default"] = {
|
|
47
|
-
title: "Form|RadioList",
|
|
48
|
-
parameters: {
|
|
49
|
-
info: {
|
|
50
|
-
propTables: [_RadioList2["default"]]
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = exports.TextInput = exports.RefUsage = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _Form = _interopRequireDefault(require("../Form"));
|
|
10
|
-
var _Input = _interopRequireDefault(require("../Input"));
|
|
11
|
-
var _Button = _interopRequireWildcard(require("../../Button"));
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
15
|
-
var TextInput = exports.TextInput = function TextInput() {
|
|
16
|
-
var onSubmit = function onSubmit(formData) {
|
|
17
|
-
var data = formData.data,
|
|
18
|
-
_formData$errors = formData.errors,
|
|
19
|
-
errors = _formData$errors === void 0 ? {} : _formData$errors;
|
|
20
|
-
if (Object.keys(errors).length) {
|
|
21
|
-
console.log("ERRORS FOUND : ");
|
|
22
|
-
console.log(errors);
|
|
23
|
-
} else {
|
|
24
|
-
console.log("Submitted data: ", data);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(_Form["default"], {
|
|
28
|
-
onSubmit: onSubmit
|
|
29
|
-
}, /*#__PURE__*/_react["default"].createElement(_Input["default"], {
|
|
30
|
-
type: "text",
|
|
31
|
-
name: "email",
|
|
32
|
-
label: "Name",
|
|
33
|
-
placeholder: "Enter your email",
|
|
34
|
-
appearance: "block",
|
|
35
|
-
validations: [{
|
|
36
|
-
type: "EMAIL",
|
|
37
|
-
message: "Please enter a valid email address"
|
|
38
|
-
}]
|
|
39
|
-
}), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
40
|
-
appearance: _Button.ButtonAppearance.PRIMARY,
|
|
41
|
-
className: "full-width-btn"
|
|
42
|
-
}, "Submit"));
|
|
43
|
-
};
|
|
44
|
-
TextInput.story = {
|
|
45
|
-
parameters: {
|
|
46
|
-
info: {
|
|
47
|
-
propTables: [_Input["default"]]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
var RefUsage = exports.RefUsage = function RefUsage() {
|
|
52
|
-
var inputRef = (0, _react.useRef)();
|
|
53
|
-
var focusInput = function focusInput() {
|
|
54
|
-
inputRef.current.focus();
|
|
55
|
-
};
|
|
56
|
-
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
57
|
-
appearance: _Button.ButtonAppearance.SECONDARY,
|
|
58
|
-
className: "full-width-btn",
|
|
59
|
-
onClick: focusInput
|
|
60
|
-
}, "Focus input"), /*#__PURE__*/_react["default"].createElement(_Input["default"], {
|
|
61
|
-
ref: inputRef,
|
|
62
|
-
type: "text",
|
|
63
|
-
name: "email",
|
|
64
|
-
label: "Name",
|
|
65
|
-
placeholder: "Enter your email",
|
|
66
|
-
appearance: "block"
|
|
67
|
-
}));
|
|
68
|
-
};
|
|
69
|
-
var _default = exports["default"] = {
|
|
70
|
-
title: "Form|Text Input",
|
|
71
|
-
parameters: {
|
|
72
|
-
info: {
|
|
73
|
-
propTables: [TextInput]
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|