@ntbjs/react-components 1.1.2 → 1.2.0-rc.10

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.
Files changed (74) hide show
  1. package/{ActionButton-c3f5ed94.js → ActionButton-06df3d6c.js} +15 -5
  2. package/Alert-13b75102.js +117 -0
  3. package/AssetGallery-f63e2732.js +1848 -0
  4. package/{AssetPreviewTopBar-449e6019.js → AssetPreviewTopBar-c28715f7.js} +15 -15
  5. package/Badge-aec841c8.js +221 -0
  6. package/{Button-432f87c6.js → Button-353f5bbc.js} +3 -3
  7. package/{Checkbox-d80544d6.js → Checkbox-68dc38a8.js} +13 -8
  8. package/{CompactAutocompleteSelect-94cee1b4.js → CompactAutocompleteSelect-43e79e21.js} +10 -10
  9. package/{CompactStarRating-ec4dea7f.js → CompactStarRating-9c81ca6e.js} +9 -9
  10. package/{CompactTextInput-49dc27db.js → CompactTextInput-8d1aae0f.js} +31 -25
  11. package/{ContextMenu-d088833b.js → ContextMenu-4ec3d9f3.js} +1 -1
  12. package/ContextMenuItem-1fe17ed5.js +110 -0
  13. package/{InputGroup-09ce9572.js → InputGroup-49fbc423.js} +1 -1
  14. package/{Instructions-116f443c.js → Instructions-a78f15fc.js} +5 -5
  15. package/MultiLevelCheckboxSelect-418de626.js +728 -0
  16. package/{MultiSelect-abf02057.js → MultiSelect-4b8d3d0d.js} +2 -2
  17. package/{Popover-d3a4b72e.js → Popover-6afb3779.js} +2 -2
  18. package/{Radio-70259f02.js → Radio-32d0513a.js} +1 -1
  19. package/{SectionSeparator-225719cd.js → SectionSeparator-259a22ed.js} +1 -1
  20. package/{Switch-a7cbb0c0.js → Switch-4a41585f.js} +1 -1
  21. package/{Tab-9936ddea.js → Tab-f499ecbc.js} +1 -1
  22. package/{Tabs-93f6362c.js → Tabs-c2261e7e.js} +2 -2
  23. package/{TextArea-a99b3096.js → TextArea-fc4de398.js} +30 -18
  24. package/{TextInput-c0ef017d.js → TextInput-0d109708.js} +1 -1
  25. package/{Tooltip-1b7b0052.js → Tooltip-6b6f0b0a.js} +2 -2
  26. package/VerificationStatusIcon-b574fd21.js +106 -0
  27. package/data/Alert/index.js +3 -2
  28. package/data/Badge/index.js +2 -2
  29. package/data/Popover/index.js +3 -3
  30. package/data/Tab/index.js +2 -2
  31. package/data/Tabs/index.js +3 -3
  32. package/data/Tooltip/index.js +3 -3
  33. package/data/index.js +10 -8
  34. package/{defaultTheme-50f2b88f.js → defaultTheme-ea44e34a.js} +59 -1
  35. package/icons/add.svg +3 -0
  36. package/icons/album.svg +3 -0
  37. package/icons/check-rectangle-filled.svg +3 -0
  38. package/icons/corporate.svg +3 -0
  39. package/icons/download.svg +3 -3
  40. package/icons/index.js +77 -0
  41. package/icons/layers.svg +3 -0
  42. package/icons/play.svg +3 -3
  43. package/icons/shopping_cart_add.svg +3 -0
  44. package/icons/verification.svg +3 -0
  45. package/inputs/ActionButton/index.js +3 -2
  46. package/inputs/Button/index.js +5 -5
  47. package/inputs/Checkbox/index.js +2 -2
  48. package/inputs/CompactAutocompleteSelect/index.js +3 -4
  49. package/inputs/CompactStarRating/index.js +2 -3
  50. package/inputs/CompactTextInput/index.js +10 -10
  51. package/inputs/MultiSelect/index.js +3 -3
  52. package/inputs/Radio/index.js +2 -2
  53. package/inputs/Switch/index.js +2 -2
  54. package/inputs/TextArea/index.js +2 -3
  55. package/inputs/TextInput/index.js +2 -2
  56. package/inputs/index.js +28 -23
  57. package/layout/InputGroup/index.js +2 -2
  58. package/layout/SectionSeparator/index.js +2 -2
  59. package/layout/index.js +3 -3
  60. package/package.json +1 -1
  61. package/{react-select-creatable.esm-c4ae6839.js → react-select-creatable.esm-2f23d6c6.js} +8 -15
  62. package/{shift-away-subtle-cfdf1dbe.js → shift-away-subtle-0bed9a3c.js} +1 -1
  63. package/styles/config.scss +3 -1
  64. package/widgets/AssetGallery/index.js +33 -29
  65. package/widgets/AssetPreview/AssetPreviewTopBar/index.js +2 -2
  66. package/widgets/ContextMenu/ContextMenuItem/index.js +5 -105
  67. package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +1 -1
  68. package/widgets/ContextMenu/index.js +2 -2
  69. package/widgets/Instructions/index.js +5 -6
  70. package/widgets/index.js +36 -31
  71. package/Alert-3e4f8be1.js +0 -62
  72. package/AssetGallery-797a8561.js +0 -1397
  73. package/Badge-9461fc7f.js +0 -154
  74. package/check-555d831b.js +0 -213
package/Badge-9461fc7f.js DELETED
@@ -1,154 +0,0 @@
1
- 'use strict';
2
-
3
- var defaultTheme = require('./defaultTheme-50f2b88f.js');
4
- var React = require('react');
5
- var styled = require('styled-components');
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
11
-
12
- var _templateObject, _templateObject2, _templateObject3, _templateObject4;
13
- var Badge$1 = styled__default['default'].span.attrs(defaultTheme.applyDefaultTheme)(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n align-content: center;\n display: ", ";\n font-family: ", ";\n font-size: 1rem;\n font-weight: 500;\n min-height: 26px;\n position: relative;\n width: ", ";\n"])), function (props) {
14
- return props.elevated || !props.hasChildren ? 'inline-flex' : 'flex';
15
- }, function (props) {
16
- return props.theme.primaryFontFamily;
17
- }, function (props) {
18
- return props.elevated ? 'fit-content' : 'initial';
19
- });
20
- var BadgeChildrenContainer = styled__default['default'].span.attrs(defaultTheme.applyDefaultTheme)(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n align-self: center;\n height: fit-content;\n margin-right: 8px;\n"])));
21
- var BadgeLabel = styled__default['default'].span.attrs(defaultTheme.applyDefaultTheme)(_templateObject3 || (_templateObject3 = defaultTheme._taggedTemplateLiteral(["\n border-radius: ", ";\n display: inline-block;\n font-size: ", ";\n font-weight: normal;\n height: fit-content;\n letter-spacing: 0.32px;\n margin-left: ", ";\n padding ", ";\n position: ", ";\n right: 0;\n transform: ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), function (props) {
22
- return props.elevated ? '12px' : '14px';
23
- }, function (props) {
24
- return props.elevated ? '0.625rem' : '0.750rem';
25
- }, function (props) {
26
- return props.elevated ? '15px' : 'auto';
27
- }, function (props) {
28
- return props.elevated ? '4px 7px' : '6px 10px';
29
- }, function (props) {
30
- return props.elevated ? 'absolute' : 'initial';
31
- }, function (props) {
32
- return props.elevated ? 'translate(33%, -8px)' : 'initial';
33
- }, function (props) {
34
- return props.paddingY && props.paddingX && styled.css(_templateObject4 || (_templateObject4 = defaultTheme._taggedTemplateLiteral(["\n padding-top: ", "px;\n padding-bottom: ", "px;\n padding-left: ", "px;\n padding-right: ", "px;\n "])), props.paddingY, props.paddingY, props.paddingX, props.paddingX);
35
- }, function (props) {
36
- return props.theme.themeProp('background', function () {
37
- var active = props.active;
38
- var error = props.error;
39
- var warning = props.warning;
40
-
41
- switch (true) {
42
- case !error && !warning && !active:
43
- return props.theme.getColor('gray-600');
44
-
45
- case !error && !warning && active:
46
- return props.theme.getColor('gray-700');
47
-
48
- case error && active:
49
- return props.theme.getColor('red-500');
50
-
51
- case error:
52
- return props.theme.getColor('red-200');
53
-
54
- case warning && active:
55
- return props.theme.getColor('signal-yellow-500');
56
-
57
- case warning:
58
- return props.theme.getColor('signal-yellow-400');
59
-
60
- default:
61
- return props.theme.getColor('gray-600');
62
- }
63
- }, function () {
64
- var active = props.active;
65
- var error = props.error;
66
- var warning = props.warning;
67
-
68
- switch (true) {
69
- case !error && !warning && !active:
70
- return props.theme.getColor('gray-200');
71
-
72
- case !error && !warning && active:
73
- return props.theme.getColor('white');
74
-
75
- case error && active:
76
- return props.theme.getColor('red-500');
77
-
78
- case error:
79
- return props.theme.getColor('red-200');
80
-
81
- case warning && active:
82
- return props.theme.getColor('signal-yellow-500');
83
-
84
- case warning:
85
- return props.theme.getColor('signal-yellow-400');
86
-
87
- default:
88
- return props.theme.getColor('gray-200');
89
- }
90
- });
91
- }, function (props) {
92
- return props.theme.themeProp('color', function () {
93
- if (props.warning && !props.error || props.error && !props.active) {
94
- return props.theme.getColor('gray-900');
95
- } else {
96
- return props.theme.getColor('white');
97
- }
98
- }, function () {
99
- if (props.error && props.active) {
100
- return props.theme.getColor('white');
101
- } else {
102
- return props.theme.getColor('gray-900');
103
- }
104
- });
105
- });
106
-
107
- var Badge = React__default['default'].forwardRef(function Badge(_ref, forwardedRef) {
108
- var badgeContent = _ref.badgeContent,
109
- paddingY = _ref.paddingY,
110
- paddingX = _ref.paddingX,
111
- children = _ref.children,
112
- elevated = _ref.elevated,
113
- active = _ref.active,
114
- error = _ref.error,
115
- warning = _ref.warning,
116
- props = defaultTheme._objectWithoutProperties(_ref, ["badgeContent", "paddingY", "paddingX", "children", "elevated", "active", "error", "warning"]);
117
-
118
- if (typeof badgeContent === 'number') {
119
- badgeContent = Intl.NumberFormat('en', {
120
- notation: 'compact'
121
- }).format(badgeContent);
122
- }
123
-
124
- return React__default['default'].createElement(Badge$1, defaultTheme._extends({
125
- ref: forwardedRef,
126
- elevated: elevated,
127
- hasChildren: Boolean(children)
128
- }, props), children && React__default['default'].createElement(BadgeChildrenContainer, null, children), badgeContent && React__default['default'].createElement(BadgeLabel, {
129
- elevated: elevated,
130
- active: active,
131
- paddingY: paddingY,
132
- paddingX: paddingX,
133
- error: error,
134
- warning: warning
135
- }, badgeContent));
136
- });
137
- Badge.propTypes = process.env.NODE_ENV !== "production" ? {
138
- badgeContent: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.string, defaultTheme.PropTypes.number]),
139
- paddingY: defaultTheme.PropTypes.number,
140
- paddingX: defaultTheme.PropTypes.number,
141
- children: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.node, defaultTheme.PropTypes.string]),
142
- elevated: defaultTheme.PropTypes.bool,
143
- active: defaultTheme.PropTypes.bool,
144
- error: defaultTheme.PropTypes.bool,
145
- warning: defaultTheme.PropTypes.bool
146
- } : {};
147
- Badge.defaultProps = {
148
- elevated: false,
149
- active: false,
150
- error: false,
151
- warning: false
152
- };
153
-
154
- exports.Badge = Badge;
package/check-555d831b.js DELETED
@@ -1,213 +0,0 @@
1
- 'use strict';
2
-
3
- var React$1 = require('react');
4
-
5
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
28
- var React__namespace = /*#__PURE__*/_interopNamespace(React$1);
29
-
30
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
31
-
32
- var MoonLoader$1 = {};
33
-
34
- var unitConverter = {};
35
-
36
- Object.defineProperty(unitConverter, "__esModule", { value: true });
37
- unitConverter.cssValue = unitConverter.parseLengthAndUnit = void 0;
38
- var cssUnit = {
39
- cm: true,
40
- mm: true,
41
- in: true,
42
- px: true,
43
- pt: true,
44
- pc: true,
45
- em: true,
46
- ex: true,
47
- ch: true,
48
- rem: true,
49
- vw: true,
50
- vh: true,
51
- vmin: true,
52
- vmax: true,
53
- "%": true,
54
- };
55
- /**
56
- * If size is a number, append px to the value as default unit.
57
- * If size is a string, validate against list of valid units.
58
- * If unit is valid, return size as is.
59
- * If unit is invalid, console warn issue, replace with px as the unit.
60
- *
61
- * @param {(number | string)} size
62
- * @return {LengthObject} LengthObject
63
- */
64
- function parseLengthAndUnit(size) {
65
- if (typeof size === "number") {
66
- return {
67
- value: size,
68
- unit: "px",
69
- };
70
- }
71
- var value;
72
- var valueString = (size.match(/^[0-9.]*/) || "").toString();
73
- if (valueString.includes(".")) {
74
- value = parseFloat(valueString);
75
- }
76
- else {
77
- value = parseInt(valueString, 10);
78
- }
79
- var unit = (size.match(/[^0-9]*$/) || "").toString();
80
- if (cssUnit[unit]) {
81
- return {
82
- value: value,
83
- unit: unit,
84
- };
85
- }
86
- console.warn("React Spinners: ".concat(size, " is not a valid css value. Defaulting to ").concat(value, "px."));
87
- return {
88
- value: value,
89
- unit: "px",
90
- };
91
- }
92
- unitConverter.parseLengthAndUnit = parseLengthAndUnit;
93
- /**
94
- * Take value as an input and return valid css value
95
- *
96
- * @param {(number | string)} value
97
- * @return {string} valid css value
98
- */
99
- function cssValue(value) {
100
- var lengthWithunit = parseLengthAndUnit(value);
101
- return "".concat(lengthWithunit.value).concat(lengthWithunit.unit);
102
- }
103
- unitConverter.cssValue = cssValue;
104
-
105
- var animation = {};
106
-
107
- Object.defineProperty(animation, "__esModule", { value: true });
108
- animation.createAnimation = void 0;
109
- var createAnimation = function (loaderName, frames, suffix) {
110
- var animationName = "react-spinners-".concat(loaderName, "-").concat(suffix);
111
- if (typeof window == "undefined" || !window.document) {
112
- return animationName;
113
- }
114
- var styleEl = document.createElement("style");
115
- document.head.appendChild(styleEl);
116
- var styleSheet = styleEl.sheet;
117
- var keyFrames = "\n @keyframes ".concat(animationName, " {\n ").concat(frames, "\n }\n ");
118
- if (styleSheet) {
119
- styleSheet.insertRule(keyFrames, 0);
120
- }
121
- return animationName;
122
- };
123
- animation.createAnimation = createAnimation;
124
-
125
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
126
- __assign = Object.assign || function(t) {
127
- for (var s, i = 1, n = arguments.length; i < n; i++) {
128
- s = arguments[i];
129
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
130
- t[p] = s[p];
131
- }
132
- return t;
133
- };
134
- return __assign.apply(this, arguments);
135
- };
136
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
137
- if (k2 === undefined) k2 = k;
138
- var desc = Object.getOwnPropertyDescriptor(m, k);
139
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
140
- desc = { enumerable: true, get: function() { return m[k]; } };
141
- }
142
- Object.defineProperty(o, k2, desc);
143
- }) : (function(o, m, k, k2) {
144
- if (k2 === undefined) k2 = k;
145
- o[k2] = m[k];
146
- }));
147
- var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
148
- Object.defineProperty(o, "default", { enumerable: true, value: v });
149
- }) : function(o, v) {
150
- o["default"] = v;
151
- });
152
- var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
153
- if (mod && mod.__esModule) return mod;
154
- var result = {};
155
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
156
- __setModuleDefault(result, mod);
157
- return result;
158
- };
159
- var __rest = (commonjsGlobal && commonjsGlobal.__rest) || function (s, e) {
160
- var t = {};
161
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
162
- t[p] = s[p];
163
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
164
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
165
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
166
- t[p[i]] = s[p[i]];
167
- }
168
- return t;
169
- };
170
- Object.defineProperty(MoonLoader$1, "__esModule", { value: true });
171
- var React = __importStar(React__default['default']);
172
- var unitConverter_1 = unitConverter;
173
- var animation_1 = animation;
174
- var moon = (0, animation_1.createAnimation)("MoonLoader", "100% {transform: rotate(360deg)}", "moon");
175
- function MoonLoader(_a) {
176
- var _b = _a.loading, loading = _b === void 0 ? true : _b, _c = _a.color, color = _c === void 0 ? "#000000" : _c, _d = _a.speedMultiplier, speedMultiplier = _d === void 0 ? 1 : _d, _e = _a.cssOverride, cssOverride = _e === void 0 ? {} : _e, _f = _a.size, size = _f === void 0 ? 60 : _f, additionalprops = __rest(_a, ["loading", "color", "speedMultiplier", "cssOverride", "size"]);
177
- var _g = (0, unitConverter_1.parseLengthAndUnit)(size), value = _g.value, unit = _g.unit;
178
- var moonSize = value / 7;
179
- var wrapper = __assign({ display: "inherit", position: "relative", width: "".concat("".concat(value + moonSize * 2).concat(unit)), height: "".concat("".concat(value + moonSize * 2).concat(unit)), animation: "".concat(moon, " ").concat(0.6 / speedMultiplier, "s 0s infinite linear"), animationFillMode: "forwards" }, cssOverride);
180
- var ballStyle = function (size) {
181
- return {
182
- width: (0, unitConverter_1.cssValue)(size),
183
- height: (0, unitConverter_1.cssValue)(size),
184
- borderRadius: "100%",
185
- };
186
- };
187
- var ball = __assign(__assign({}, ballStyle(moonSize)), { backgroundColor: "".concat(color), opacity: "0.8", position: "absolute", top: "".concat("".concat(value / 2 - moonSize / 2).concat(unit)), animation: "".concat(moon, " ").concat(0.6 / speedMultiplier, "s 0s infinite linear"), animationFillMode: "forwards" });
188
- var circle = __assign(__assign({}, ballStyle(value)), { border: "".concat(moonSize, "px solid ").concat(color), opacity: "0.1", boxSizing: "content-box", position: "absolute" });
189
- if (!loading) {
190
- return null;
191
- }
192
- return (React.createElement("span", __assign({ style: wrapper }, additionalprops),
193
- React.createElement("span", { style: ball }),
194
- React.createElement("span", { style: circle })));
195
- }
196
- var _default = MoonLoader$1.default = MoonLoader;
197
-
198
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
199
-
200
- var _ref = /*#__PURE__*/React__namespace.createElement("path", {
201
- fill: "currentColor",
202
- d: "M7.627 14.435l-5.69-5.69L0 10.67l7.627 7.627L24 1.924 22.076 0z"
203
- });
204
-
205
- function SvgCheck(props) {
206
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
207
- xmlns: "http://www.w3.org/2000/svg",
208
- viewBox: "0 0 24 18.297"
209
- }, props), _ref);
210
- }
211
-
212
- exports.SvgCheck = SvgCheck;
213
- exports._default = _default;