@ntbjs/react-components 1.2.0-rc.2 → 1.2.0-rc.21
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/{ActionButton-761050a9.js → ActionButton-06df3d6c.js} +1 -1
- package/{Alert-96814023.js → Alert-13b75102.js} +2 -2
- package/{AssetGallery-52724211.js → AssetGallery-bcdbfe3a.js} +100 -90
- package/{AssetPreviewTopBar-ade10c15.js → AssetPreviewTopBar-c28715f7.js} +1 -1
- package/{Badge-fa94dca8.js → Badge-aec841c8.js} +1 -1
- package/{Button-5071dc6b.js → Button-c38d56a0.js} +3 -3
- package/{Checkbox-dd2cf216.js → Checkbox-68dc38a8.js} +13 -8
- package/{CompactAutocompleteSelect-d4147107.js → CompactAutocompleteSelect-43e79e21.js} +25 -25
- package/{CompactStarRating-ca1943af.js → CompactStarRating-584850fa.js} +52 -39
- package/{CompactTextInput-c5e38aae.js → CompactTextInput-4388f2f2.js} +60 -52
- package/{ContextMenu-bd818e55.js → ContextMenu-4ec3d9f3.js} +1 -1
- package/{ContextMenuItem-10af8b2f.js → ContextMenuItem-1fe17ed5.js} +1 -1
- package/{InputGroup-4c49ba30.js → InputGroup-49fbc423.js} +1 -1
- package/{Instructions-b955ba72.js → Instructions-06fa9d0c.js} +24 -14
- package/MultiLevelCheckboxSelect-4d9d84cd.js +697 -0
- package/{MultiSelect-87614192.js → MultiSelect-4b8d3d0d.js} +1 -1
- package/{Popover-155cbac8.js → Popover-e4ecb887.js} +31 -5
- package/{Radio-dd81f5d4.js → Radio-32d0513a.js} +1 -1
- package/{SectionSeparator-9f129ade.js → SectionSeparator-259a22ed.js} +1 -1
- package/{Switch-c004ea6d.js → Switch-4a41585f.js} +1 -1
- package/{Tab-8fec1dba.js → Tab-f499ecbc.js} +1 -1
- package/{Tabs-96e366bf.js → Tabs-4d7742bc.js} +8 -38
- package/{TextArea-4d90d02c.js → TextArea-65525d5a.js} +144 -99
- package/{TextInput-e6035fb0.js → TextInput-0d109708.js} +1 -1
- package/{Tooltip-a175e9f5.js → Tooltip-6b6f0b0a.js} +2 -2
- package/{VerificationStatusIcon-a88b1f8d.js → VerificationStatusIcon-b574fd21.js} +1 -1
- package/data/Alert/index.js +2 -2
- package/data/Badge/index.js +2 -2
- package/data/Popover/index.js +4 -3
- package/data/Tab/index.js +2 -2
- package/data/Tabs/index.js +3 -3
- package/data/Tooltip/index.js +3 -3
- package/data/index.js +10 -9
- package/{defaultTheme-c137e17f.js → defaultTheme-ea44e34a.js} +58 -0
- package/inputs/ActionButton/index.js +2 -2
- package/inputs/Button/index.js +6 -5
- package/inputs/Checkbox/index.js +2 -2
- package/inputs/CompactAutocompleteSelect/index.js +2 -3
- package/inputs/CompactStarRating/index.js +2 -3
- package/inputs/CompactTextInput/index.js +11 -11
- package/inputs/MultiSelect/index.js +2 -2
- package/inputs/Radio/index.js +2 -2
- package/inputs/Switch/index.js +2 -2
- package/inputs/TextArea/index.js +14 -3
- package/inputs/TextInput/index.js +2 -2
- package/inputs/index.js +27 -22
- package/layout/InputGroup/index.js +2 -2
- package/layout/SectionSeparator/index.js +2 -2
- package/layout/index.js +3 -3
- package/package.json +2 -1
- package/{shift-away-subtle-a86a6cd2.js → shift-away-subtle-0bed9a3c.js} +1 -1
- package/widgets/AssetGallery/index.js +33 -30
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItem/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +1 -1
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +15 -5
- package/widgets/index.js +35 -32
- package/check-555d831b.js +0 -213
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-ea44e34a.js');
|
|
4
4
|
var lodash = require('lodash');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var styled = require('styled-components');
|
|
7
7
|
var polished = require('polished');
|
|
8
8
|
var TippyTooltip = require('@tippyjs/react');
|
|
9
|
-
require('./shift-away-subtle-
|
|
9
|
+
require('./shift-away-subtle-0bed9a3c.js');
|
|
10
|
+
var maxSize = require('popper-max-size-modifier');
|
|
10
11
|
|
|
11
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
13
|
|
|
13
14
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
15
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
15
16
|
var TippyTooltip__default = /*#__PURE__*/_interopDefaultLegacy(TippyTooltip);
|
|
17
|
+
var maxSize__default = /*#__PURE__*/_interopDefaultLegacy(maxSize);
|
|
16
18
|
|
|
17
19
|
var _templateObject, _templateObject2, _templateObject3;
|
|
18
|
-
var Popover$1 = styled__default['default'](TippyTooltip__default['default']).attrs(defaultTheme.applyDefaultTheme)(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n font-family: ", ";\n font-size: 1rem;\n font-weight: 400;\n color: inherit;\n border-radius: 0;\n line-height: inherit;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n .tippy-content {\n padding: 0;\n }\n\n .tippy-arrow {\n ", "\n }\n\n && > .tippy-arrow::before {\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n & > .tippy-arrow::after {\n content: '';\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n &[data-placement^='top'] {\n & > .tippy-arrow:before {\n bottom: -16px;\n left: -5px;\n border-width: 15px 13px 0;\n ", "\n }\n\n & > .tippy-arrow:after {\n bottom: -15px;\n left: -5px;\n border-width: 15px 13px 0;\n border-top-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='right'] {\n & > .tippy-arrow:before {\n bottom: -5px;\n left: -16px;\n border-width: 13px 15px 13px 0;\n ", "\n }\n\n & > .tippy-arrow:after {\n bottom: -5px;\n left: -15px;\n border-width: 13px 15px 13px 0;\n border-right-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='bottom'] {\n & > .tippy-arrow:before {\n top: -16px;\n left: -5px;\n border-width: 0 13px 15px 13px;\n ", "\n }\n\n & > .tippy-arrow:after {\n top: -14.5px;\n left: -5px;\n border-width: 0 13px 15px 13px;\n border-bottom-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='left'] {\n & > .tippy-arrow::before {\n bottom: -5px;\n right: -16px;\n border-width: 13px 0 13px 15px;\n ", "\n }\n\n & > .tippy-arrow::after {\n bottom: -5px;\n right: -15px;\n border-width: 13px 0 13px 15px;\n border-left-color: initial;\n transform-origin: center top;\n }\n }\n"])), function (props) {
|
|
20
|
+
var Popover$1 = styled__default['default'](TippyTooltip__default['default']).attrs(defaultTheme.applyDefaultTheme)(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n font-family: ", ";\n font-size: 1rem;\n font-weight: 400;\n color: inherit;\n border-radius: 0;\n line-height: inherit;\n max-height: inherit;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n .tippy-content {\n padding: 0;\n max-height: inherit;\n\n > div {\n max-height: inherit;\n }\n }\n\n .tippy-arrow {\n ", "\n }\n\n && > .tippy-arrow::before {\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n & > .tippy-arrow::after {\n content: '';\n position: absolute;\n border-color: transparent;\n border-style: solid;\n }\n\n &[data-placement^='top'] {\n & > .tippy-arrow:before {\n bottom: -16px;\n left: -5px;\n border-width: 15px 13px 0;\n ", "\n }\n\n & > .tippy-arrow:after {\n bottom: -15px;\n left: -5px;\n border-width: 15px 13px 0;\n border-top-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='right'] {\n & > .tippy-arrow:before {\n bottom: -5px;\n left: -16px;\n border-width: 13px 15px 13px 0;\n ", "\n }\n\n & > .tippy-arrow:after {\n bottom: -5px;\n left: -15px;\n border-width: 13px 15px 13px 0;\n border-right-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='bottom'] {\n & > .tippy-arrow:before {\n top: -16px;\n left: -5px;\n border-width: 0 13px 15px 13px;\n ", "\n }\n\n & > .tippy-arrow:after {\n top: -14.5px;\n left: -5px;\n border-width: 0 13px 15px 13px;\n border-bottom-color: initial;\n transform-origin: center top;\n }\n }\n\n &[data-placement^='left'] {\n & > .tippy-arrow::before {\n bottom: -5px;\n right: -16px;\n border-width: 13px 0 13px 15px;\n ", "\n }\n\n & > .tippy-arrow::after {\n bottom: -5px;\n right: -15px;\n border-width: 13px 0 13px 15px;\n border-left-color: initial;\n transform-origin: center top;\n }\n }\n"])), function (props) {
|
|
19
21
|
return props.theme.primaryFontFamily;
|
|
20
22
|
}, function (props) {
|
|
21
23
|
return props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white'));
|
|
@@ -55,7 +57,8 @@ var Popover = React__default['default'].forwardRef(function Popover(_ref, ref) {
|
|
|
55
57
|
contextMenu = _ref.contextMenu,
|
|
56
58
|
contextMenuSublevel = _ref.contextMenuSublevel,
|
|
57
59
|
children = _ref.children,
|
|
58
|
-
|
|
60
|
+
modifiers = _ref.modifiers,
|
|
61
|
+
props = defaultTheme._objectWithoutProperties(_ref, ["content", "interactive", "placement", "duration", "trigger", "offset", "arrow", "visible", "contextMenu", "contextMenuSublevel", "children", "modifiers"]);
|
|
59
62
|
|
|
60
63
|
var errorOffset = React.useMemo(function () {
|
|
61
64
|
return arrow ? 15 : 0;
|
|
@@ -87,6 +90,27 @@ var Popover = React__default['default'].forwardRef(function Popover(_ref, ref) {
|
|
|
87
90
|
offset: [offset[0], offset[1] + errorOffset],
|
|
88
91
|
arrow: contextMenu ? false : arrow,
|
|
89
92
|
visible: visible,
|
|
93
|
+
popperOptions: {
|
|
94
|
+
modifiers: [defaultTheme._objectSpread2(defaultTheme._objectSpread2({}, maxSize__default['default']), {}, {
|
|
95
|
+
options: {
|
|
96
|
+
boundary: 'viewport',
|
|
97
|
+
rootBoundary: 'viewport',
|
|
98
|
+
padding: 10
|
|
99
|
+
}
|
|
100
|
+
}), {
|
|
101
|
+
name: 'applyMaxSize',
|
|
102
|
+
enabled: true,
|
|
103
|
+
phase: 'beforeWrite',
|
|
104
|
+
requires: ['maxSize'],
|
|
105
|
+
fn: function fn(_ref2) {
|
|
106
|
+
var state = _ref2.state;
|
|
107
|
+
var height = state.modifiersData.maxSize.height;
|
|
108
|
+
state.styles.popper = defaultTheme._objectSpread2(defaultTheme._objectSpread2({}, state.styles.popper), {}, {
|
|
109
|
+
maxHeight: "".concat(height, "px")
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}].concat(defaultTheme._toConsumableArray(modifiers))
|
|
113
|
+
},
|
|
90
114
|
onShown: contextMenu ? handleContextMenuItemClick : undefined
|
|
91
115
|
}, props), children);
|
|
92
116
|
});
|
|
@@ -99,6 +123,7 @@ Popover.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
99
123
|
offset: defaultTheme.PropTypes.arrayOf(defaultTheme.PropTypes.number),
|
|
100
124
|
arrow: defaultTheme.PropTypes.bool,
|
|
101
125
|
visible: defaultTheme.PropTypes.bool,
|
|
126
|
+
modifiers: defaultTheme.PropTypes.array,
|
|
102
127
|
contextMenu: defaultTheme.PropTypes.bool,
|
|
103
128
|
contextMenuSublevel: defaultTheme.PropTypes.bool,
|
|
104
129
|
children: defaultTheme.PropTypes.node.isRequired
|
|
@@ -114,7 +139,8 @@ Popover.defaultProps = {
|
|
|
114
139
|
arrow: true,
|
|
115
140
|
visible: undefined,
|
|
116
141
|
contextMenu: false,
|
|
117
|
-
contextMenuSublevel: false
|
|
142
|
+
contextMenuSublevel: false,
|
|
143
|
+
modifiers: []
|
|
118
144
|
};
|
|
119
145
|
|
|
120
146
|
exports.Popover = Popover;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-ea44e34a.js');
|
|
4
4
|
var lodash = require('lodash');
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var Tab = require('./Tab-
|
|
6
|
+
var Tab = require('./Tab-f499ecbc.js');
|
|
7
7
|
var styled = require('styled-components');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -43,9 +43,8 @@ var TabContent = styled__default['default'].div.attrs(defaultTheme.applyDefaultT
|
|
|
43
43
|
|
|
44
44
|
var Tabs = React__default['default'].forwardRef(function Tabs(_ref, forwardedRef) {
|
|
45
45
|
var children = _ref.children,
|
|
46
|
-
minHeight = _ref.minHeight,
|
|
47
46
|
defaultMinHeight = _ref.defaultMinHeight,
|
|
48
|
-
props = defaultTheme._objectWithoutProperties(_ref, ["children", "
|
|
47
|
+
props = defaultTheme._objectWithoutProperties(_ref, ["children", "defaultMinHeight"]);
|
|
49
48
|
|
|
50
49
|
var _useState = React.useState(0),
|
|
51
50
|
_useState2 = defaultTheme._slicedToArray(_useState, 2),
|
|
@@ -54,33 +53,10 @@ var Tabs = React__default['default'].forwardRef(function Tabs(_ref, forwardedRef
|
|
|
54
53
|
|
|
55
54
|
var _useState3 = React.useState(),
|
|
56
55
|
_useState4 = defaultTheme._slicedToArray(_useState3, 2),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var _useState5 = React.useState(),
|
|
61
|
-
_useState6 = defaultTheme._slicedToArray(_useState5, 2),
|
|
62
|
-
minTabHeight = _useState6[0],
|
|
63
|
-
setMinTabHeight = _useState6[1];
|
|
64
|
-
|
|
65
|
-
var _useState7 = React.useState(),
|
|
66
|
-
_useState8 = defaultTheme._slicedToArray(_useState7, 2),
|
|
67
|
-
defaultHeight = _useState8[0],
|
|
68
|
-
setDefaultHeight = _useState8[1];
|
|
56
|
+
defaultHeight = _useState4[0],
|
|
57
|
+
setDefaultHeight = _useState4[1];
|
|
69
58
|
|
|
70
59
|
var contentRef = React.useRef(null);
|
|
71
|
-
var visibleTabs = [];
|
|
72
|
-
React.useEffect(function () {
|
|
73
|
-
if ((visibleTabs === null || visibleTabs === void 0 ? void 0 : visibleTabs.length) > 0) {
|
|
74
|
-
setActiveTab(visibleTabs[0].key);
|
|
75
|
-
setFirstTab(visibleTabs[0]);
|
|
76
|
-
}
|
|
77
|
-
}, []);
|
|
78
|
-
React.useLayoutEffect(function () {
|
|
79
|
-
if (contentRef.current) {
|
|
80
|
-
var height = contentRef.current.offsetHeight;
|
|
81
|
-
setMinTabHeight(height);
|
|
82
|
-
}
|
|
83
|
-
}, [firstTab]);
|
|
84
60
|
React.useEffect(function () {
|
|
85
61
|
setDefaultHeight(defaultMinHeight);
|
|
86
62
|
}, []);
|
|
@@ -97,11 +73,7 @@ var Tabs = React__default['default'].forwardRef(function Tabs(_ref, forwardedRef
|
|
|
97
73
|
return null;
|
|
98
74
|
}
|
|
99
75
|
|
|
100
|
-
if (child.type === Tab.Tab
|
|
101
|
-
visibleTabs.push({
|
|
102
|
-
key: index,
|
|
103
|
-
content: child.props.children
|
|
104
|
-
});
|
|
76
|
+
if (child.type === Tab.Tab) {
|
|
105
77
|
tabs.push({
|
|
106
78
|
key: index,
|
|
107
79
|
trigger: child.props.trigger,
|
|
@@ -130,24 +102,22 @@ var Tabs = React__default['default'].forwardRef(function Tabs(_ref, forwardedRef
|
|
|
130
102
|
}, tab.trigger);
|
|
131
103
|
})), React__default['default'].createElement(TabContent, null, tabs.map(function (tab) {
|
|
132
104
|
return React__default['default'].createElement("div", {
|
|
133
|
-
ref: tab.key === (
|
|
105
|
+
ref: tab.key === (activeTab === null || activeTab === void 0 ? void 0 : activeTab.key) ? contentRef : null,
|
|
134
106
|
key: tab.key,
|
|
135
107
|
role: "tabpanel",
|
|
136
108
|
hidden: tab.key !== activeTab,
|
|
137
109
|
style: {
|
|
138
|
-
minHeight:
|
|
110
|
+
minHeight: !lodash.isEmpty(defaultHeight) ? defaultHeight : ''
|
|
139
111
|
}
|
|
140
112
|
}, tab.content);
|
|
141
113
|
})));
|
|
142
114
|
});
|
|
143
115
|
Tabs.defaultProps = {
|
|
144
|
-
minHeight: false,
|
|
145
116
|
defaultMinHeight: ''
|
|
146
117
|
};
|
|
147
118
|
Tabs.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
148
119
|
children: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.array, defaultTheme.PropTypes.object]),
|
|
149
120
|
backgroundColor: defaultTheme.PropTypes.string,
|
|
150
|
-
minHeight: defaultTheme.PropTypes.bool,
|
|
151
121
|
defaultMinHeight: defaultTheme.PropTypes.string
|
|
152
122
|
} : {};
|
|
153
123
|
|