@ntbjs/react-components 1.0.0 → 1.1.0-beta.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.
- package/{AssetGallery-2d26f3cf.js → AssetGallery-1a3e0374.js} +12 -5
- package/AssetPreviewTopBar-020a6f96.js +92 -0
- package/AutocompleteSelect-e82bd937.js +358 -0
- package/Badge-34ad2850.js +146 -0
- package/Button-e6a6139c.js +264 -0
- package/CompactStarRating-f7a58649.js +246 -0
- package/CompactTextInput-faf4ea96.js +265 -0
- package/ContextMenu-a68d4f28.js +32 -0
- package/InputGroup-66dd343c.js +28 -0
- package/MultiSelect-3eca3c3e.js +361 -0
- package/Popover-63d38274.js +127 -0
- package/SectionSeparator-12aff748.js +37 -0
- package/Tab-51124003.js +30 -0
- package/Tabs-452079b5.js +99 -0
- package/{TextArea-52cf4c0a.js → TextArea-efe4fa88.js} +64 -24
- package/{TextInput-a7c32f5f.js → TextInput-e4c6d536.js} +42 -22
- package/{Tooltip-f95a39f4.js → Tooltip-7c57004f.js} +12 -10
- package/close-ebf2f3cf.js +41 -0
- package/data/Badge/index.js +10 -0
- package/data/Popover/index.js +1 -1
- package/data/Tab/index.js +10 -0
- package/data/Tabs/index.js +12 -0
- package/data/index.js +8 -2
- package/edit-note-c47d292e.js +41 -0
- package/expand-more-94585605.js +41 -0
- package/icons/arrow-back.svg +4 -0
- package/icons/arrow-drop-down.svg +4 -0
- package/icons/close.svg +4 -0
- package/icons/delete-context-menu.svg +4 -0
- package/icons/design-services.svg +4 -0
- package/icons/edit-note.svg +4 -0
- package/icons/expand-more.svg +4 -0
- package/icons/link.svg +4 -0
- package/icons/star-filled.svg +3 -0
- package/icons/star.svg +3 -0
- package/icons/triangle-right.svg +4 -0
- package/inputs/AutocompleteSelect/index.js +18 -0
- package/inputs/Button/index.js +7 -1
- package/inputs/CompactStarRating/index.js +11 -0
- package/inputs/CompactTextInput/index.js +20 -0
- package/inputs/MultiSelect/index.js +15 -0
- package/inputs/TextArea/index.js +2 -1
- package/inputs/TextInput/index.js +2 -1
- package/inputs/index.js +25 -3
- package/layout/InputGroup/index.js +10 -0
- package/layout/SectionSeparator/index.js +10 -0
- package/layout/index.js +14 -0
- package/package.json +4 -2
- package/react-select-creatable.esm-eb462367.js +7622 -0
- package/widgets/AssetGallery/index.js +23 -8
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +11 -0
- package/widgets/ContextMenu/ContextMenuItem/index.js +112 -0
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +32 -0
- package/widgets/ContextMenu/index.js +10 -0
- package/widgets/index.js +26 -8
- package/Button-0d728b52.js +0 -156
- package/Popover-d3e2f6c0.js +0 -97
package/Tabs-452079b5.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultTheme = require('./defaultTheme-870f7df1.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
var Tab = require('./Tab-51124003.js');
|
|
7
|
+
var lodash = require('lodash');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
|
+
|
|
14
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
15
|
+
var Tabs$1 = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral([""])));
|
|
16
|
+
var TabHeaders = styled__default['default'].ul.attrs(defaultTheme.applyDefaultTheme)(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n display: flex;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n gap: 24px;\n margin: 0;\n padding: 0;\n\n"])));
|
|
17
|
+
var TabHeader = styled__default['default'].li.attrs(defaultTheme.applyDefaultTheme)(_templateObject3 || (_templateObject3 = defaultTheme._taggedTemplateLiteral(["\n font-family: ", ";\n text-transform: uppercase;\n font-weight: 600;\n font-size: 0.875rem;\n display: flex;\n padding-bottom: 8px;\n letter-spacing: 0.6px;\n cursor: pointer;\n border-bottom: 1px solid;\n border-color: transparent;\n margin-bottom: 1px;\n ", ";\n &&:hover:not(:focus) {\n ", ";\n"])), function (props) {
|
|
18
|
+
return props.theme.secondaryFontFamily;
|
|
19
|
+
}, function (props) {
|
|
20
|
+
return props.active && styled.css(_templateObject4 || (_templateObject4 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
21
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-400'), props.theme.getColor('gray-700'));
|
|
22
|
+
});
|
|
23
|
+
}, function (props) {
|
|
24
|
+
return props.theme.themeProp('border-color', function () {
|
|
25
|
+
if (props.active) {
|
|
26
|
+
return props.theme.getColor('gray-400');
|
|
27
|
+
} else {
|
|
28
|
+
return props.theme.getColor('gray-400');
|
|
29
|
+
}
|
|
30
|
+
}, function () {
|
|
31
|
+
if (props.active) {
|
|
32
|
+
return props.theme.getColor('gray-700');
|
|
33
|
+
} else {
|
|
34
|
+
return props.theme.getColor('gray-700');
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
var TabContent = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject5 || (_templateObject5 = defaultTheme._taggedTemplateLiteral(["\n padding-top: 16px;\n border-top: 1px solid;\n margin-top: -2px;\n ", ";\n"])), function (props) {
|
|
39
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-600'), '#F0F2F5');
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
var Tabs = React__default['default'].forwardRef(function Tabs(_ref, forwardedRef) {
|
|
43
|
+
var children = _ref.children,
|
|
44
|
+
props = defaultTheme._objectWithoutProperties(_ref, ["children"]);
|
|
45
|
+
|
|
46
|
+
var _useState = React.useState(0),
|
|
47
|
+
_useState2 = defaultTheme._slicedToArray(_useState, 2),
|
|
48
|
+
activeTab = _useState2[0],
|
|
49
|
+
setActiveTab = _useState2[1];
|
|
50
|
+
|
|
51
|
+
var tabs = React.useMemo(function () {
|
|
52
|
+
var tabs = [];
|
|
53
|
+
|
|
54
|
+
function extractChildren(children) {
|
|
55
|
+
React.Children.forEach(children, function (child, index) {
|
|
56
|
+
if (child.type === React.Fragment) {
|
|
57
|
+
extractChildren(child.props.children);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (child.type === Tab.Tab && !lodash.isEmpty(child.props.trigger)) {
|
|
61
|
+
tabs.push({
|
|
62
|
+
key: index,
|
|
63
|
+
trigger: child.props.trigger,
|
|
64
|
+
content: child.props.children
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
extractChildren(children);
|
|
71
|
+
return tabs;
|
|
72
|
+
}, [children]);
|
|
73
|
+
return React__default['default'].createElement(Tabs$1, defaultTheme._extends({
|
|
74
|
+
ref: forwardedRef
|
|
75
|
+
}, props, {
|
|
76
|
+
role: "tablist"
|
|
77
|
+
}), React__default['default'].createElement(TabHeaders, null, tabs.map(function (tab) {
|
|
78
|
+
return React__default['default'].createElement(TabHeader, {
|
|
79
|
+
key: tab.key,
|
|
80
|
+
active: tab.key === activeTab,
|
|
81
|
+
onClick: function onClick() {
|
|
82
|
+
return setActiveTab(tab.key);
|
|
83
|
+
},
|
|
84
|
+
role: "tab"
|
|
85
|
+
}, tab.trigger);
|
|
86
|
+
})), React__default['default'].createElement(TabContent, null, tabs.map(function (tab) {
|
|
87
|
+
return React__default['default'].createElement("div", {
|
|
88
|
+
key: tab.key,
|
|
89
|
+
role: "tabpanel",
|
|
90
|
+
hidden: tab.key !== activeTab
|
|
91
|
+
}, tab.content);
|
|
92
|
+
})));
|
|
93
|
+
});
|
|
94
|
+
Tabs.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
95
|
+
children: defaultTheme.PropTypes.element
|
|
96
|
+
} : {};
|
|
97
|
+
Tabs.defaultProps = {};
|
|
98
|
+
|
|
99
|
+
exports.Tabs = Tabs;
|
|
@@ -5,59 +5,78 @@ var React = require('react');
|
|
|
5
5
|
var nanoid = require('nanoid');
|
|
6
6
|
var styled = require('styled-components');
|
|
7
7
|
var lodash = require('lodash');
|
|
8
|
+
var editNote = require('./edit-note-c47d292e.js');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
11
|
|
|
11
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
13
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
14
|
|
|
14
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17;
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22;
|
|
15
16
|
var activeLabel = styled.css(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n font-size: 0.75rem;\n padding: 0 3px;\n top: -7px;\n letter-spacing: 0.03em;\n left: 8px !important;\n opacity: 1 !important;\n"])));
|
|
16
17
|
var placeholderBaseStyle = styled.css(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n ", "\n\n ", "\n"])), function (props) {
|
|
17
18
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'));
|
|
18
19
|
}, function (props) {
|
|
19
20
|
return props.theme.themeProp('opacity', 0.6, 0.5);
|
|
20
21
|
});
|
|
21
|
-
var
|
|
22
|
+
var InputIconContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject3 || (_templateObject3 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0;\n pointer-events: none;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n display: flex;\n align-items: flex-start;\n position: absolute;\n right: 5px;\n top: 10px;\n bottom: 0;\n svg {\n width: 15px;\n opacity: 0.7;\n transition: opacity 250ms;\n ", "\n }\n"])), function (props) {
|
|
23
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-900'), '!important');
|
|
24
|
+
});
|
|
25
|
+
var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.applyDefaultTheme)(_templateObject4 || (_templateObject4 = defaultTheme._taggedTemplateLiteral(["\n display: block;\n width: 100%;\n font-family: inherit;\n font-size: 0.875rem;\n border-radius: 2px;\n padding: 13px 10px;\n resize: vertical;\n ", "\n ", "\n ", "\n border: 1px solid;\n ", "\n ", " \n\n ", " \n\n ", " \n\n ", " \n\n &&:hover:not(:focus) {\n ", ";\n transition: background 350ms;\n & + ", " {\n opacity: 1;\n transition: opacity 350ms;\n }\n }\n \n border-radius: 3px;\n box-sizing: border-box;\n appearance: none;\n transition: border-color 350ms;\n ", "\n ", "\n ", "\n\n ", "\n\n &::placeholder {\n ", "\n\n ", "\n }\n\n :focus {\n outline: none;\n ", "\n }\n\n :focus {\n outline: none;\n border-color: ", " !important\n \n"])), function (props) {
|
|
22
26
|
return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'));
|
|
27
|
+
}, function (props) {
|
|
28
|
+
return (props.warningAlert || props.errorAlert) && props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('gray-900'));
|
|
23
29
|
}, function (props) {
|
|
24
30
|
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
25
31
|
}, function (props) {
|
|
26
32
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'));
|
|
27
33
|
}, function (props) {
|
|
28
|
-
return props.
|
|
34
|
+
return props.noBorder && styled.css(_templateObject5 || (_templateObject5 = defaultTheme._taggedTemplateLiteral(["\n border-color: transparent !important;\n "])));
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.warningAlert && styled.css(_templateObject6 || (_templateObject6 = defaultTheme._taggedTemplateLiteral(["\n background: ", " !important;\n :focus {\n background: white !important;\n }\n &&:hover:not(:focus) {\n background: ", " !important;\n }\n &&:read-only:hover {\n background: ", " !important;\n }\n "])), props.theme.getColor('signal-yellow-400'), props.theme.getColor('signal-yellow-500'), props.theme.getColor('signal-yellow-400'));
|
|
37
|
+
}, function (props) {
|
|
38
|
+
return props.errorAlert && styled.css(_templateObject7 || (_templateObject7 = defaultTheme._taggedTemplateLiteral(["\n background: ", " !important;\n :focus {\n background: white !important;\n }\n &&:hover:not(:focus) {\n background: #f7d5d0 !important;\n }\n &&:read-only:hover {\n background: ", " !important;\n }\n "])), props.theme.getColor('red-200'), props.theme.getColor('red-200'));
|
|
39
|
+
}, function (props) {
|
|
40
|
+
return props.lightBackground && styled.css(_templateObject8 || (_templateObject8 = defaultTheme._taggedTemplateLiteral(["\n background: #fffde8 !important;\n :focus {\n background: white !important;\n }\n "])));
|
|
41
|
+
}, function (props) {
|
|
42
|
+
return props.noBorder && !props.readOnly ? props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100')) : 'background: transparent';
|
|
43
|
+
}, InputIconContainer, function (props) {
|
|
44
|
+
return props.warning && styled.css(_templateObject9 || (_templateObject9 = defaultTheme._taggedTemplateLiteral(["\n border-color: ", " !important;\n "])), props.theme.getColor('orange-500'));
|
|
45
|
+
}, function (props) {
|
|
46
|
+
return props.error && styled.css(_templateObject10 || (_templateObject10 = defaultTheme._taggedTemplateLiteral(["\n border-color: ", " !important;\n "])), props.theme.getColor('red-500'));
|
|
29
47
|
}, function (props) {
|
|
30
|
-
return props.
|
|
48
|
+
return props.hasIcon && styled.css(_templateObject11 || (_templateObject11 = defaultTheme._taggedTemplateLiteral(["\n padding-left: 35px;\n "])));
|
|
31
49
|
}, function (props) {
|
|
32
|
-
return props.
|
|
50
|
+
return (props.warningAlert || props.errorAlert) && styled.css(_templateObject12 || (_templateObject12 = defaultTheme._taggedTemplateLiteral(["\n padding-left: 60px;\n padding-top: 25px;\n padding-right: 30px;\n "])));
|
|
33
51
|
}, function (props) {
|
|
34
52
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'), 1);
|
|
35
53
|
}, function (props) {
|
|
36
54
|
return props.theme.themeProp('opacity', 0.6, 0.5, 1);
|
|
37
55
|
}, function (props) {
|
|
38
56
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-600'));
|
|
57
|
+
}, function (props) {
|
|
58
|
+
return props.theme.getColor('gray-600');
|
|
39
59
|
});
|
|
40
|
-
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(
|
|
60
|
+
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(_templateObject13 || (_templateObject13 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 13px;\n left: 11px;\n line-height: 1.2;\n font-size: 0.875rem;\n transition: all 150ms;\n\n ", ";\n\n ", "\n\n ", "\n content: \"\";\n\n ", "\n"])), placeholderBaseStyle, function (props) {
|
|
41
61
|
return props.theme.themeProp('background', "linear-gradient(0deg, ".concat(props.theme.getColor('gray-900'), " calc(50% + 1px), transparent 50%)"), "linear-gradient(0deg, ".concat(props.theme.getColor('white'), " calc(50% + 1px), transparent 50%)"));
|
|
42
62
|
}, function (props) {
|
|
43
|
-
return props.hasPlaceholder && styled.css(
|
|
63
|
+
return props.hasPlaceholder && styled.css(_templateObject14 || (_templateObject14 = defaultTheme._taggedTemplateLiteral(["\n ", ";\n ", "\n "])), activeLabel, props.error && styled.css(_templateObject15 || (_templateObject15 = defaultTheme._taggedTemplateLiteral(["\n color: ", " !important;\n "])), props.theme.getColor('red-500')));
|
|
44
64
|
}, function (props) {
|
|
45
|
-
return props.hasIcon && styled.css(
|
|
65
|
+
return props.hasIcon && styled.css(_templateObject16 || (_templateObject16 = defaultTheme._taggedTemplateLiteral(["\n left: 35px;\n "])));
|
|
66
|
+
});
|
|
67
|
+
var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject17 || (_templateObject17 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n height: 2.625rem;\n display: flex;\n padding: 0 10px;\n\n svg {\n width: 15px;\n opacity: 0.6;\n transition: opacity 250ms;\n }\n"])));
|
|
68
|
+
var TextInputFieldIconAlert = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject18 || (_templateObject18 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 13px;\n left: 25px;\n height: 2.625rem;\n display: flex;\n padding: 0 10px;\n svg {\n width: 15px;\n opacity: 0.6;\n transition: opacity 250ms;\n ", "\n }\n"])), function (props) {
|
|
69
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-600'), props.theme.getColor('gray-600'), 1);
|
|
46
70
|
});
|
|
47
|
-
var
|
|
48
|
-
var TextInput = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject12 || (_templateObject12 = defaultTheme._taggedTemplateLiteral(["\n position: relative;\n\n &:focus-within {\n ", " {\n ", ";\n }\n\n ", " {\n svg {\n opacity: 1;\n }\n }\n }\n\n ", ":not(:placeholder-shown) + ", " {\n ", ";\n ", "\n // ", "\n ", "\n }\n\n ", "\n"])), TextInputLabel, activeLabel, TextInputFieldIcon, TextInputField, TextInputLabel, activeLabel, function (props) {
|
|
71
|
+
var TextInput = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject19 || (_templateObject19 = defaultTheme._taggedTemplateLiteral(["\n position: relative;\n\n &:focus-within {\n ", " {\n ", ";\n }\n\n ", " {\n svg {\n opacity: 1;\n }\n }\n }\n\n ", ":not(:placeholder-shown) + ", " {\n ", ";\n ", "\n }\n\n ", "\n"])), TextInputLabel, activeLabel, TextInputFieldIcon, TextInputField, TextInputLabel, activeLabel, function (props) {
|
|
49
72
|
return props.error && props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500'));
|
|
50
73
|
}, function (props) {
|
|
51
|
-
return props.
|
|
52
|
-
}, function (props) {
|
|
53
|
-
return props.warning && styled.css(_templateObject14 || (_templateObject14 = defaultTheme._taggedTemplateLiteral(["\n color: ", " !important;\n "])), props.theme.getColor('orange-500'));
|
|
54
|
-
}, function (props) {
|
|
55
|
-
return props.disabled && styled.css(_templateObject15 || (_templateObject15 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0.5;\n\n > * {\n cursor: not-allowed;\n }\n "])));
|
|
74
|
+
return props.disabled && styled.css(_templateObject20 || (_templateObject20 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0.5;\n\n > * {\n cursor: not-allowed;\n }\n "])));
|
|
56
75
|
});
|
|
57
|
-
var Description = styled__default['default'].p.attrs(defaultTheme.applyDefaultTheme)(
|
|
76
|
+
var Description = styled__default['default'].p.attrs(defaultTheme.applyDefaultTheme)(_templateObject21 || (_templateObject21 = defaultTheme._taggedTemplateLiteral(["\n margin: 8px 0 0 0;\n padding: 0 0.6875rem;\n font-size: 0.75rem;\n line-height: 1.333;\n\n ", ";\n\n ", "\n"])), function (props) {
|
|
58
77
|
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
|
|
59
78
|
}, function (props) {
|
|
60
|
-
return props.error && styled.css(
|
|
79
|
+
return props.error && styled.css(_templateObject22 || (_templateObject22 = defaultTheme._taggedTemplateLiteral(["\n content: 'error';\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
61
80
|
});
|
|
62
81
|
|
|
63
82
|
var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forwardedRef) {
|
|
@@ -79,7 +98,11 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
79
98
|
style = _ref.style,
|
|
80
99
|
onChange = _ref.onChange,
|
|
81
100
|
onBlur = _ref.onBlur,
|
|
82
|
-
|
|
101
|
+
lightBackground = _ref.lightBackground,
|
|
102
|
+
noBorder = _ref.noBorder,
|
|
103
|
+
warningAlert = _ref.warningAlert,
|
|
104
|
+
errorAlert = _ref.errorAlert,
|
|
105
|
+
rest = defaultTheme._objectWithoutProperties(_ref, ["value", "defaultValue", "name", "label", "placeholder", "required", "disabled", "readOnly", "autoComplete", "description", "error", "warning", "icon", "rows", "className", "style", "onChange", "onBlur", "lightBackground", "noBorder", "warningAlert", "errorAlert"]);
|
|
83
106
|
|
|
84
107
|
var _useState = React.useState(nanoid.nanoid()),
|
|
85
108
|
_useState2 = defaultTheme._slicedToArray(_useState, 1),
|
|
@@ -115,12 +138,13 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
115
138
|
return null;
|
|
116
139
|
}, [description, error, warning]);
|
|
117
140
|
return React__default['default'].createElement(TextInput, {
|
|
118
|
-
disabled: disabled
|
|
141
|
+
disabled: disabled,
|
|
142
|
+
readOnly: readOnly,
|
|
119
143
|
error: hasError,
|
|
120
144
|
warning: hasWarning,
|
|
121
145
|
className: className,
|
|
122
146
|
style: style
|
|
123
|
-
},
|
|
147
|
+
}, !warningAlert && !errorAlert && React__default['default'].createElement(TextInputFieldIcon, null, icon), (warningAlert || errorAlert) && React__default['default'].createElement(TextInputFieldIconAlert, null, icon), React__default['default'].createElement(TextInputField, defaultTheme._extends({
|
|
124
148
|
ref: forwardedRef,
|
|
125
149
|
rows: rows,
|
|
126
150
|
value: value,
|
|
@@ -132,12 +156,20 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
132
156
|
readOnly: readOnly,
|
|
133
157
|
autoComplete: autoComplete,
|
|
134
158
|
hasIcon: Boolean(icon),
|
|
159
|
+
icon: icon,
|
|
135
160
|
error: hasError,
|
|
136
161
|
warning: hasWarning,
|
|
137
162
|
id: "text-input-".concat(uniqueId),
|
|
163
|
+
lightBackground: lightBackground,
|
|
138
164
|
onChange: onChange,
|
|
139
|
-
onBlur: onBlur
|
|
140
|
-
|
|
165
|
+
onBlur: onBlur,
|
|
166
|
+
noBorder: noBorder,
|
|
167
|
+
warningAlert: warningAlert,
|
|
168
|
+
errorAlert: errorAlert
|
|
169
|
+
}, rest)), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
|
|
170
|
+
warningAlert: warningAlert,
|
|
171
|
+
errorAlert: errorAlert
|
|
172
|
+
}, React__default['default'].createElement(editNote.SvgEditNote, null)), label && React__default['default'].createElement(TextInputLabel, {
|
|
141
173
|
htmlFor: "text-input-".concat(uniqueId),
|
|
142
174
|
hasPlaceholder: Boolean(placeholder),
|
|
143
175
|
hasIcon: Boolean(icon),
|
|
@@ -147,7 +179,11 @@ var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forw
|
|
|
147
179
|
}, descriptionText));
|
|
148
180
|
});
|
|
149
181
|
TextArea.defaultProps = {
|
|
150
|
-
rows: 4
|
|
182
|
+
rows: 4,
|
|
183
|
+
noBorder: false,
|
|
184
|
+
readOnly: false,
|
|
185
|
+
warningAlert: false,
|
|
186
|
+
errorAlert: false
|
|
151
187
|
};
|
|
152
188
|
TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
153
189
|
value: defaultTheme.PropTypes.string,
|
|
@@ -166,8 +202,12 @@ TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
166
202
|
rows: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.number, defaultTheme.PropTypes.string]),
|
|
167
203
|
className: defaultTheme.PropTypes.string,
|
|
168
204
|
style: defaultTheme.PropTypes.object,
|
|
205
|
+
lightBackground: defaultTheme.PropTypes.bool,
|
|
169
206
|
onChange: defaultTheme.PropTypes.func,
|
|
170
|
-
onBlur: defaultTheme.PropTypes.func
|
|
207
|
+
onBlur: defaultTheme.PropTypes.func,
|
|
208
|
+
noBorder: defaultTheme.PropTypes.bool,
|
|
209
|
+
warningAlert: defaultTheme.PropTypes.bool,
|
|
210
|
+
errorAlert: defaultTheme.PropTypes.bool
|
|
171
211
|
} : {};
|
|
172
212
|
|
|
173
213
|
exports.TextArea = TextArea;
|
|
@@ -5,13 +5,14 @@ var React = require('react');
|
|
|
5
5
|
var nanoid = require('nanoid');
|
|
6
6
|
var styled = require('styled-components');
|
|
7
7
|
var lodash = require('lodash');
|
|
8
|
+
var editNote = require('./edit-note-c47d292e.js');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
11
|
|
|
11
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
13
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
13
14
|
|
|
14
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22;
|
|
15
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24;
|
|
15
16
|
var activeLabel = styled.css(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n font-size: 0.75rem;\n padding: 0 3px;\n top: -7px;\n letter-spacing: 0.03em;\n left: 8px !important;\n opacity: 1 !important;\n"])));
|
|
16
17
|
var Adornment = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n flex-shrink: 0;\n font-family: inherit;\n font-size: 0.875rem;\n line-height: initial;\n padding: 13px 10px;\n ", "\n ", "\n border: 1px solid;\n ", "\n border-radius: 3px;\n z-index: 1;\n ", "\n box-sizing: border-box;\n appearance: none;\n transition: border-color 350ms;\n height: 2.75rem;\n\n ", "\n ", "\n"])), function (props) {
|
|
17
18
|
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
|
|
@@ -29,50 +30,61 @@ var Adornment = styled__default['default'].div.attrs(defaultTheme.applyDefaultTh
|
|
|
29
30
|
var TextInputWrapper = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject7 || (_templateObject7 = defaultTheme._taggedTemplateLiteral(["\n display: flex;\n align-content: center;\n\n &:focus-within {\n ", " {\n outline: none;\n ", "\n }\n }\n"])), Adornment, function (props) {
|
|
30
31
|
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-600'), 1);
|
|
31
32
|
});
|
|
32
|
-
var
|
|
33
|
+
var InputIconContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject8 || (_templateObject8 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0;\n pointer-events: none;\n border-top-right-radius: 3px;\n border-bottom-right-radius: 3px;\n padding-right: 4px;\n padding-left: 30px;\n display: flex;\n align-items: center;\n position: absolute;\n right: 0;\n top: 0;\n bottom: 0;\n color: ", ";\n\n ", "\n\n ", "\n\n > svg {\n width: 12px;\n }\n"])), function (props) {
|
|
34
|
+
return props.theme.getColor('gray-400');
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.warning && props.theme.themeProp('color', '#C3AF43', '#C3AF43');
|
|
37
|
+
}, function (props) {
|
|
38
|
+
return props.error && props.theme.themeProp('color', '#CB968F', '#CB968F');
|
|
39
|
+
});
|
|
40
|
+
var TextInputField = styled__default['default'].input.attrs(defaultTheme.applyDefaultTheme)(_templateObject9 || (_templateObject9 = defaultTheme._taggedTemplateLiteral(["\n display: block;\n width: 100%;\n font-family: inherit;\n font-size: 0.875rem;\n line-height: 1;\n padding: 13px 10px;\n ", "\n ", "\n border: 1px solid;\n ", ";\n border-radius: 3px;\n box-sizing: border-box;\n appearance: none;\n transition: border-color 350ms;\n height: 2.75rem !important; // important is needed to override the default Foundation styling used in the Mediebank\n margin-bottom: 0; // needed to override the default Foundation styling used in the Mediebank\n\n ", "\n ", "\n ", "\n\n &::placeholder {\n ", "\n\n ", "\n }\n\n ", "\n\n &&:hover:not(:focus) {\n ", ";\n transition: background 350ms;\n & + ", " {\n opacity: 1;\n transition: opacity 350ms;\n }\n }\n\n :focus {\n outline: none;\n border-color: ", " !important\n"])), function (props) {
|
|
33
41
|
return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'));
|
|
34
42
|
}, function (props) {
|
|
35
43
|
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
36
44
|
}, function (props) {
|
|
37
|
-
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'));
|
|
45
|
+
return props.noBorder ? 'border-color: transparent !important' : props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'));
|
|
38
46
|
}, function (props) {
|
|
39
|
-
return props.warning && styled.css(
|
|
47
|
+
return props.warning && styled.css(_templateObject10 || (_templateObject10 = defaultTheme._taggedTemplateLiteral(["\n border-color: ", " !important;\n "])), props.theme.getColor('orange-500'));
|
|
40
48
|
}, function (props) {
|
|
41
|
-
return props.error && styled.css(
|
|
49
|
+
return props.error && styled.css(_templateObject11 || (_templateObject11 = defaultTheme._taggedTemplateLiteral(["\n border-color: ", " !important;\n "])), props.theme.getColor('red-500'));
|
|
42
50
|
}, function (props) {
|
|
43
|
-
return props.hasIcon && styled.css(
|
|
51
|
+
return props.hasIcon && styled.css(_templateObject12 || (_templateObject12 = defaultTheme._taggedTemplateLiteral(["\n padding-left: 35px;\n "])));
|
|
44
52
|
}, function (props) {
|
|
45
53
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'), 1);
|
|
46
54
|
}, function (props) {
|
|
47
55
|
return props.theme.themeProp('opacity', 0.6, 0.5, 1);
|
|
48
56
|
}, function (props) {
|
|
49
|
-
return props.
|
|
57
|
+
return props.warning && styled.css(_templateObject13 || (_templateObject13 = defaultTheme._taggedTemplateLiteral(["\n color: ", " !important;\n "])), props.theme.getColor('orange-500'));
|
|
58
|
+
}, function (props) {
|
|
59
|
+
return props.noBorder ? props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-200')) : 'background: transparent';
|
|
60
|
+
}, InputIconContainer, function (props) {
|
|
61
|
+
return props.theme.getColor('gray-600');
|
|
50
62
|
});
|
|
51
|
-
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(
|
|
63
|
+
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(_templateObject14 || (_templateObject14 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n top: 15px;\n left: 11px;\n line-height: 1.2;\n font-size: 0.875rem;\n transition: all 150ms;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n\n content: \"\";\n\n ", "\n"])), function (props) {
|
|
52
64
|
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'));
|
|
53
65
|
}, function (props) {
|
|
54
66
|
return props.theme.themeProp('opacity', 0.6, 0.5);
|
|
55
67
|
}, function (props) {
|
|
56
68
|
return props.theme.themeProp('background', "linear-gradient(0deg, ".concat(props.theme.getColor('gray-900'), " calc(50% + 1px), transparent 50%)"), "linear-gradient(0deg, ".concat(props.theme.getColor('white'), " calc(50% + 1px), transparent 50%)"));
|
|
57
69
|
}, function (props) {
|
|
58
|
-
return (props.hasPlaceholder || props.hasAdornments) && styled.css(
|
|
70
|
+
return (props.hasPlaceholder || props.hasAdornments) && styled.css(_templateObject15 || (_templateObject15 = defaultTheme._taggedTemplateLiteral(["\n ", ";\n ", "\n "])), activeLabel, props.error && styled.css(_templateObject16 || (_templateObject16 = defaultTheme._taggedTemplateLiteral(["\n color: ", " !important;\n "])), props.theme.getColor('red-500')));
|
|
59
71
|
}, function (props) {
|
|
60
|
-
return props.hasIcon && styled.css(
|
|
72
|
+
return props.hasIcon && styled.css(_templateObject17 || (_templateObject17 = defaultTheme._taggedTemplateLiteral(["\n left: 35px;\n "])));
|
|
61
73
|
});
|
|
62
|
-
var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(
|
|
63
|
-
var TextInput$1 = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(
|
|
74
|
+
var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject18 || (_templateObject18 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n height: 2.625rem;\n display: flex;\n padding: 0 10px;\n\n svg {\n width: 15px;\n opacity: 0.6;\n transition: opacity 250ms;\n }\n"])));
|
|
75
|
+
var TextInput$1 = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject19 || (_templateObject19 = defaultTheme._taggedTemplateLiteral(["\n position: relative;\n\n &:focus-within {\n ", " {\n ", ";\n }\n\n ", " {\n svg {\n opacity: 1;\n }\n }\n }\n\n ", ":not(:placeholder-shown) + ", " {\n ", ";\n ", "\n // ", "\n ", "\n }\n\n ", "\n"])), TextInputLabel, activeLabel, TextInputFieldIcon, TextInputField, TextInputLabel, activeLabel, function (props) {
|
|
64
76
|
return props.error && props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500'));
|
|
65
77
|
}, function (props) {
|
|
66
|
-
return props.error && styled.css(
|
|
78
|
+
return props.error && styled.css(_templateObject20 || (_templateObject20 = defaultTheme._taggedTemplateLiteral(["\n // color: ", " !important;\n //\n "])), props.theme.getColor('red-500'));
|
|
67
79
|
}, function (props) {
|
|
68
|
-
return props.warning && styled.css(
|
|
80
|
+
return props.warning && styled.css(_templateObject21 || (_templateObject21 = defaultTheme._taggedTemplateLiteral(["\n color: ", " !important;\n "])), props.theme.getColor('orange-500'));
|
|
69
81
|
}, function (props) {
|
|
70
|
-
return props.disabled && styled.css(
|
|
82
|
+
return props.disabled && styled.css(_templateObject22 || (_templateObject22 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0.5;\n\n > * {\n cursor: not-allowed;\n pointer-events: none !important;\n }\n "])));
|
|
71
83
|
});
|
|
72
|
-
var Description = styled__default['default'].p.attrs(defaultTheme.applyDefaultTheme)(
|
|
84
|
+
var Description = styled__default['default'].p.attrs(defaultTheme.applyDefaultTheme)(_templateObject23 || (_templateObject23 = defaultTheme._taggedTemplateLiteral(["\n margin: 8px 0 0 0;\n padding: 0 0.6875rem;\n font-size: 0.75rem;\n line-height: 1.333;\n\n ", ";\n\n ", "\n"])), function (props) {
|
|
73
85
|
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
|
|
74
86
|
}, function (props) {
|
|
75
|
-
return props.error && styled.css(
|
|
87
|
+
return props.error && styled.css(_templateObject24 || (_templateObject24 = defaultTheme._taggedTemplateLiteral(["\n content: 'error';\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
76
88
|
});
|
|
77
89
|
|
|
78
90
|
var toFnRef = function toFnRef(ref) {
|
|
@@ -132,7 +144,8 @@ var TextInput = React__default['default'].forwardRef(function TextInput(_ref, fo
|
|
|
132
144
|
style = _ref.style,
|
|
133
145
|
onChange = _ref.onChange,
|
|
134
146
|
onBlur = _ref.onBlur,
|
|
135
|
-
|
|
147
|
+
noBorder = _ref.noBorder,
|
|
148
|
+
rest = defaultTheme._objectWithoutProperties(_ref, ["value", "defaultValue", "name", "label", "placeholder", "type", "required", "disabled", "readOnly", "autoComplete", "description", "error", "warning", "icon", "adornments", "className", "style", "onChange", "onBlur", "noBorder"]);
|
|
136
149
|
|
|
137
150
|
var textInputDomNode = React.useRef(null);
|
|
138
151
|
var textInputRef = useMergedRefs(forwardedRef, textInputDomNode);
|
|
@@ -200,8 +213,13 @@ var TextInput = React__default['default'].forwardRef(function TextInput(_ref, fo
|
|
|
200
213
|
warning: hasWarning,
|
|
201
214
|
id: "text-input-".concat(uniqueId),
|
|
202
215
|
onChange: onChange,
|
|
203
|
-
onBlur: onBlur
|
|
204
|
-
|
|
216
|
+
onBlur: onBlur,
|
|
217
|
+
noBorder: noBorder
|
|
218
|
+
}, rest)), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
|
|
219
|
+
error: error,
|
|
220
|
+
warning: warning
|
|
221
|
+
}, React__default['default'].createElement(editNote.SvgEditNote, null)), label && React__default['default'].createElement(TextInputLabel, {
|
|
222
|
+
noBorder: noBorder,
|
|
205
223
|
htmlFor: "text-input-".concat(uniqueId),
|
|
206
224
|
hasPlaceholder: Boolean(placeholder),
|
|
207
225
|
hasAdornments: Boolean(typeof (adornments === null || adornments === void 0 ? void 0 : adornments.prefix) === 'string' && adornments.prefix.length > 0 || typeof (adornments === null || adornments === void 0 ? void 0 : adornments.suffix) === 'string' && adornments.suffix.length > 0),
|
|
@@ -219,7 +237,8 @@ var TextInput = React__default['default'].forwardRef(function TextInput(_ref, fo
|
|
|
219
237
|
}, descriptionText));
|
|
220
238
|
});
|
|
221
239
|
TextInput.defaultProps = {
|
|
222
|
-
type: 'text'
|
|
240
|
+
type: 'text',
|
|
241
|
+
noBorder: false
|
|
223
242
|
};
|
|
224
243
|
TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
225
244
|
value: defaultTheme.PropTypes.string,
|
|
@@ -243,7 +262,8 @@ TextInput.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
243
262
|
className: defaultTheme.PropTypes.string,
|
|
244
263
|
style: defaultTheme.PropTypes.object,
|
|
245
264
|
onChange: defaultTheme.PropTypes.func,
|
|
246
|
-
onBlur: defaultTheme.PropTypes.func
|
|
265
|
+
onBlur: defaultTheme.PropTypes.func,
|
|
266
|
+
noBorder: defaultTheme.PropTypes.bool
|
|
247
267
|
} : {};
|
|
248
268
|
|
|
249
269
|
exports.TextInput = TextInput;
|
|
@@ -4,7 +4,7 @@ var defaultTheme = require('./defaultTheme-870f7df1.js');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
var TippyTooltip = require('@tippyjs/react');
|
|
7
|
-
require('./Popover-
|
|
7
|
+
require('./Popover-63d38274.js');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
@@ -26,8 +26,9 @@ var Tooltip = React__default['default'].forwardRef(function Tooltip(_ref, ref) {
|
|
|
26
26
|
interactive = _ref.interactive,
|
|
27
27
|
placement = _ref.placement,
|
|
28
28
|
duration = _ref.duration,
|
|
29
|
+
trigger = _ref.trigger,
|
|
29
30
|
children = _ref.children,
|
|
30
|
-
props = defaultTheme._objectWithoutProperties(_ref, ["content", "interactive", "placement", "duration", "children"]);
|
|
31
|
+
props = defaultTheme._objectWithoutProperties(_ref, ["content", "interactive", "placement", "duration", "trigger", "children"]);
|
|
31
32
|
|
|
32
33
|
return React__default['default'].createElement(Tooltip$1, defaultTheme._extends({
|
|
33
34
|
ref: ref,
|
|
@@ -35,17 +36,10 @@ var Tooltip = React__default['default'].forwardRef(function Tooltip(_ref, ref) {
|
|
|
35
36
|
interactive: interactive,
|
|
36
37
|
placement: placement,
|
|
37
38
|
duration: duration,
|
|
39
|
+
trigger: trigger,
|
|
38
40
|
animation: 'shift-away-subtle'
|
|
39
41
|
}, props), children);
|
|
40
42
|
});
|
|
41
|
-
Tooltip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
42
|
-
content: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.string, defaultTheme.PropTypes.element]).isRequired,
|
|
43
|
-
interactive: defaultTheme.PropTypes.bool,
|
|
44
|
-
placement: defaultTheme.PropTypes.oneOf(['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'auto', 'auto-start', 'auto-end']),
|
|
45
|
-
duration: defaultTheme.PropTypes.number,
|
|
46
|
-
trigger: defaultTheme.PropTypes.string,
|
|
47
|
-
children: defaultTheme.PropTypes.node.isRequired
|
|
48
|
-
} : {};
|
|
49
43
|
Tooltip.defaultProps = {
|
|
50
44
|
content: 'Tooltip',
|
|
51
45
|
interactive: false,
|
|
@@ -53,5 +47,13 @@ Tooltip.defaultProps = {
|
|
|
53
47
|
duration: 350,
|
|
54
48
|
trigger: 'mouseenter focus'
|
|
55
49
|
};
|
|
50
|
+
Tooltip.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
51
|
+
content: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.string, defaultTheme.PropTypes.element]).isRequired,
|
|
52
|
+
interactive: defaultTheme.PropTypes.bool,
|
|
53
|
+
placement: defaultTheme.PropTypes.oneOf(['top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'auto', 'auto-start', 'auto-end']),
|
|
54
|
+
duration: defaultTheme.PropTypes.number,
|
|
55
|
+
trigger: defaultTheme.PropTypes.oneOf(['mouseenter', 'mouseenter focus', 'click', 'focusin', 'mouseenter click']),
|
|
56
|
+
children: defaultTheme.PropTypes.node.isRequired
|
|
57
|
+
} : {};
|
|
56
58
|
|
|
57
59
|
exports.Tooltip = Tooltip;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule) return e;
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return e[k];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n['default'] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
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); }
|
|
28
|
+
|
|
29
|
+
var _ref = /*#__PURE__*/React__namespace.createElement("path", {
|
|
30
|
+
fill: "currentColor",
|
|
31
|
+
d: "M2.1 27.3L0 25.2l11.55-11.55L0 2.1 2.1 0l11.55 11.55L25.2 0l2.1 2.1-11.55 11.55L27.3 25.2l-2.1 2.1-11.55-11.55L2.1 27.3z"
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function SvgClose(props) {
|
|
35
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
36
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
+
viewBox: "0 0 27.3 27.3"
|
|
38
|
+
}, props), _ref);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.SvgClose = SvgClose;
|
package/data/Popover/index.js
CHANGED
package/data/index.js
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var Popover = require('../Popover-
|
|
6
|
-
var Tooltip = require('../Tooltip-
|
|
5
|
+
var Popover = require('../Popover-63d38274.js');
|
|
6
|
+
var Tooltip = require('../Tooltip-7c57004f.js');
|
|
7
|
+
var Tab = require('../Tab-51124003.js');
|
|
8
|
+
var Tabs = require('../Tabs-452079b5.js');
|
|
9
|
+
var Badge = require('../Badge-34ad2850.js');
|
|
7
10
|
require('../defaultTheme-870f7df1.js');
|
|
8
11
|
require('styled-components');
|
|
9
12
|
require('react');
|
|
@@ -15,3 +18,6 @@ require('@tippyjs/react');
|
|
|
15
18
|
|
|
16
19
|
exports.Popover = Popover.Popover;
|
|
17
20
|
exports.Tooltip = Tooltip.Tooltip;
|
|
21
|
+
exports.Tab = Tab.Tab;
|
|
22
|
+
exports.Tabs = Tabs.Tabs;
|
|
23
|
+
exports.Badge = Badge.Badge;
|