@ntbjs/react-components 1.1.1 → 1.1.3
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-c3f5ed94.js → ActionButton-06df3d6c.js} +15 -5
- package/Alert-13b75102.js +117 -0
- package/AssetGallery-d5e4f7a6.js +1857 -0
- package/{AssetPreviewTopBar-449e6019.js → AssetPreviewTopBar-c28715f7.js} +15 -15
- package/Badge-aec841c8.js +221 -0
- package/{Button-432f87c6.js → Button-49f82b31.js} +3 -3
- package/{Checkbox-d80544d6.js → Checkbox-68dc38a8.js} +13 -8
- package/{CompactAutocompleteSelect-0c08a1aa.js → CompactAutocompleteSelect-87c8c7e7.js} +121 -90
- package/{CompactStarRating-77f54a07.js → CompactStarRating-1aedbcf4.js} +103 -66
- package/{CompactTextInput-8750600d.js → CompactTextInput-aafb1a17.js} +88 -61
- package/{ContextMenu-d088833b.js → ContextMenu-4ec3d9f3.js} +1 -1
- package/ContextMenuItem-1fe17ed5.js +110 -0
- package/{InputGroup-09ce9572.js → InputGroup-49fbc423.js} +1 -1
- package/{Instructions-ed68e52f.js → Instructions-b9f2e184.js} +27 -14
- package/MultiLevelCheckboxSelect-eeb5dcef.js +698 -0
- package/{MultiSelect-abf02057.js → MultiSelect-4b8d3d0d.js} +2 -2
- package/{Popover-d3a4b72e.js → Popover-569cd272.js} +33 -7
- package/{Radio-70259f02.js → Radio-32d0513a.js} +1 -1
- package/{SectionSeparator-225719cd.js → SectionSeparator-259a22ed.js} +1 -1
- package/{Switch-a7cbb0c0.js → Switch-4a41585f.js} +1 -1
- package/{Tab-9936ddea.js → Tab-f499ecbc.js} +1 -1
- package/{Tabs-93f6362c.js → Tabs-4d7742bc.js} +8 -38
- package/TextArea-229e7abb.js +435 -0
- package/{TextInput-c0ef017d.js → TextInput-0d109708.js} +1 -1
- package/{Tooltip-1b7b0052.js → Tooltip-66daf6e3.js} +4 -4
- package/VerificationStatusIcon-b574fd21.js +106 -0
- package/data/Alert/index.js +3 -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 +11 -8
- package/{defaultTheme-50f2b88f.js → defaultTheme-ea44e34a.js} +59 -1
- package/icons/add.svg +3 -0
- package/icons/album.svg +3 -0
- package/icons/check-rectangle-filled.svg +3 -0
- package/icons/corporate.svg +3 -0
- package/icons/download.svg +3 -3
- package/icons/index.js +77 -0
- package/icons/layers.svg +3 -0
- package/icons/play.svg +3 -3
- package/icons/shopping_cart_add.svg +3 -0
- package/icons/verification.svg +3 -0
- package/inputs/ActionButton/index.js +3 -2
- package/inputs/Button/index.js +6 -5
- package/inputs/Checkbox/index.js +2 -2
- package/inputs/CompactAutocompleteSelect/index.js +14 -4
- package/inputs/CompactStarRating/index.js +14 -3
- package/inputs/CompactTextInput/index.js +11 -10
- package/inputs/MultiSelect/index.js +3 -3
- 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 +29 -23
- 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/{react-select-creatable.esm-c4ae6839.js → react-select-creatable.esm-2f23d6c6.js} +8 -15
- package/{shift-away-subtle-cfdf1dbe.js → shift-away-subtle-0bed9a3c.js} +1 -1
- package/styles/config.scss +3 -1
- package/widgets/AssetGallery/index.js +34 -29
- package/widgets/AssetPreview/AssetPreviewTopBar/index.js +2 -2
- package/widgets/ContextMenu/ContextMenuItem/index.js +5 -105
- package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +1 -1
- package/widgets/ContextMenu/index.js +2 -2
- package/widgets/Instructions/index.js +16 -6
- package/widgets/index.js +37 -31
- package/Alert-3e4f8be1.js +0 -62
- package/AssetGallery-f01f30eb.js +0 -1397
- package/Badge-9461fc7f.js +0 -154
- package/TextArea-1ed790e5.js +0 -340
- package/check-555d831b.js +0 -213
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultTheme = require('./defaultTheme-ea44e34a.js');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var useMergedRefs = require('./useMergedRefs-b6d2f8fc.js');
|
|
6
|
+
var nanoid = require('nanoid');
|
|
7
|
+
require('./Alert-13b75102.js');
|
|
8
|
+
require('./Badge-aec841c8.js');
|
|
9
|
+
require('./Popover-569cd272.js');
|
|
10
|
+
require('./Tab-f499ecbc.js');
|
|
11
|
+
require('./Tabs-4d7742bc.js');
|
|
12
|
+
var Tooltip = require('./Tooltip-66daf6e3.js');
|
|
13
|
+
require('./VerificationStatusIcon-b574fd21.js');
|
|
14
|
+
var editNote = require('./edit-note-c47d292e.js');
|
|
15
|
+
var styled = require('styled-components');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
20
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
21
|
+
|
|
22
|
+
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, _templateObject25, _templateObject26, _templateObject27, _templateObject28, _templateObject29, _templateObject30, _templateObject31, _templateObject32, _templateObject33, _templateObject34, _templateObject35, _templateObject36, _templateObject37, _templateObject38, _templateObject39, _templateObject40, _templateObject41, _templateObject42, _templateObject43, _templateObject44, _templateObject45, _templateObject46, _templateObject47;
|
|
23
|
+
var fadeInCheck = styled.keyframes(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n"])));
|
|
24
|
+
var fadeOutCheck = styled.keyframes(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 1\n }\n to {\n opacity: 0\n }\n"])));
|
|
25
|
+
var activeLabel = styled.css(_templateObject3 || (_templateObject3 = 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"])));
|
|
26
|
+
var placeholderBaseStyle = styled.css(_templateObject4 || (_templateObject4 = defaultTheme._taggedTemplateLiteral(["\n ", "\n\n ", "\n"])), function (props) {
|
|
27
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'));
|
|
28
|
+
}, function (props) {
|
|
29
|
+
return props.theme.themeProp('opacity', 0.6, 0.5);
|
|
30
|
+
});
|
|
31
|
+
var InputIconContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject5 || (_templateObject5 = 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: 15px;\n top: 10px;\n bottom: 0;\n > .smallPadingIcon {\n padding: 4px;\n width: 15px;\n height: 15px;\n border-radius: 5px;\n opacity: 1;\n margin-top: -5px;\n ", "\n }\n svg {\n width: 15px;\n opacity: 0.7;\n transition: opacity 250ms;\n ", "\n ", "\n }\n"])), function (props) {
|
|
32
|
+
return props.theme.themeProp('background-color', props.theme.getColor('gray-900'), props.theme.getColor('gray-300'), '!important');
|
|
33
|
+
}, function (props) {
|
|
34
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-900'), '!important');
|
|
35
|
+
}, function (props) {
|
|
36
|
+
return props.disabled && styled.css(_templateObject6 || (_templateObject6 = defaultTheme._taggedTemplateLiteral(["\n display: none;\n "])));
|
|
37
|
+
});
|
|
38
|
+
var TextInputField = styled__default['default'].textarea.attrs(defaultTheme.applyDefaultTheme)(_templateObject7 || (_templateObject7 = defaultTheme._taggedTemplateLiteral(["\n width: 100%;\n font-family: inherit;\n font-size: 0.875rem;\n border-radius: 2px;\n padding: 5px 10px;\n resize: vertical;\n z-index: 0;\n border-radius: 3px;\n box-sizing: border-box;\n appearance: none;\n border: 1px solid;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n ", "\n\n transition: height 550ms ease-in-out; border-color 350ms;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n \n ", "\n \n ", "\n\n ", "\n \n ", "\n\n ", "\n\n ", " \n\n ", " \n\n ", " \n \n\n ", " \n \n ", "\n\n ", "\n\n ", " \n\n ", "\n \n \n ", "\n\n ", "\n\n ", ";\n\n ", ";\n\n ", ";\n\n ", ";\n\n \n ", "\n\n &&:hover:not(:focus) {\n ", ";\n\n ", ";\n\n ", "\n\n ", ";\n\n \n ", "; \n\n\n ", ";\n transition: background 350ms;\n & + ", " {\n opacity: 1;\n ", ";\n transition: opacity 350ms;\n }\n }\n\n &::placeholder {\n ", "\n\n ", "\n }\n\n &&:focus {\n outline: none;\n ", "\n\n ", ";\n\n \n ", " \n \n ", "\n\n }\n\n &&:not(:hover):not(:focus) {\n ", ";\n\n ", ";\n\n ", ";\n }\n"])), function (props) {
|
|
39
|
+
return props.padding === 'small' && styled.css(_templateObject8 || (_templateObject8 = defaultTheme._taggedTemplateLiteral(["\n padding: 5px 10px;\n "])));
|
|
40
|
+
}, function (props) {
|
|
41
|
+
return props.padding === 'medium' && styled.css(_templateObject9 || (_templateObject9 = defaultTheme._taggedTemplateLiteral(["\n padding: 13px 15px;\n "])));
|
|
42
|
+
}, function (props) {
|
|
43
|
+
return props.padding === 'large' && styled.css(_templateObject10 || (_templateObject10 = defaultTheme._taggedTemplateLiteral(["\n padding: 15px 55px;\n "])));
|
|
44
|
+
}, function (props) {
|
|
45
|
+
return props.showMore && !props.expanded && props.defaultHeight < props.maxHeight && styled.css(_templateObject11 || (_templateObject11 = defaultTheme._taggedTemplateLiteral(["\n -webkit-mask-image: linear-gradient(0deg, transparent 5px, white 45px);\n "])));
|
|
46
|
+
}, function (props) {
|
|
47
|
+
return props.expanded && styled.css(_templateObject12 || (_templateObject12 = defaultTheme._taggedTemplateLiteral(["\n height: ", "px;\n "])), props.maxHeight);
|
|
48
|
+
}, function (props) {
|
|
49
|
+
return props.theme.themeProp('color', 'white', 'black');
|
|
50
|
+
}, function (props) {
|
|
51
|
+
return props.readOnly && styled.css(_templateObject13 || (_templateObject13 = defaultTheme._taggedTemplateLiteral(["\n cursor: default;\n border-color: transparent !important;\n "])));
|
|
52
|
+
}, function (props) {
|
|
53
|
+
return props.disabled && styled.css(_templateObject14 || (_templateObject14 = defaultTheme._taggedTemplateLiteral(["\n cursor: not-allowed;\n "])));
|
|
54
|
+
}, function (props) {
|
|
55
|
+
return props.readOnly && styled.css(_templateObject15 || (_templateObject15 = defaultTheme._taggedTemplateLiteral(["\n padding: 12px 10px; ;\n "])));
|
|
56
|
+
}, function (props) {
|
|
57
|
+
return props.showMore && styled.css(_templateObject16 || (_templateObject16 = defaultTheme._taggedTemplateLiteral(["\n overflow: hidden;\n "])));
|
|
58
|
+
}, function (props) {
|
|
59
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'));
|
|
60
|
+
}, function (props) {
|
|
61
|
+
return (props.state === 'warning' || props.state === 'error') && props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('gray-900'));
|
|
62
|
+
}, function (props) {
|
|
63
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
64
|
+
}, function (props) {
|
|
65
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'));
|
|
66
|
+
}, function (props) {
|
|
67
|
+
return props.noBorder && styled.css(_templateObject17 || (_templateObject17 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
68
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
69
|
+
});
|
|
70
|
+
}, function (props) {
|
|
71
|
+
return props.type === 'warning' && styled.css(_templateObject18 || (_templateObject18 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), props.theme.themeProp('color', 'white', 'black'), props.theme.themeProp('background', '#634E01', '#FFFDE8'), props.theme.themeProp('border-color', '#634E01 ', '#FFFDE8'));
|
|
72
|
+
}, function (props) {
|
|
73
|
+
return props.type === 'instructions-warning' && styled.css(_templateObject19 || (_templateObject19 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), props.theme.themeProp('color', 'white', 'black'), props.theme.themeProp('background', '#634E01', '#FFF36C'), props.theme.themeProp('border-color', '#634E01 ', '#FFF36C'));
|
|
74
|
+
}, function (props) {
|
|
75
|
+
return props.type === 'error' && styled.css(_templateObject20 || (_templateObject20 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), props.theme.themeProp('color', 'white', 'black'), props.theme.themeProp('background', '#7f1b1b', '#FBEAE6'), props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6'));
|
|
76
|
+
}, function (props) {
|
|
77
|
+
return props.noBorder && props.type === 'instructions-warning' && styled.css(_templateObject21 || (_templateObject21 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
78
|
+
return props.theme.themeProp('border-color', '#634E01', '#FFF36C');
|
|
79
|
+
});
|
|
80
|
+
}, function (props) {
|
|
81
|
+
return props.noBorder && props.type === 'warning' && styled.css(_templateObject22 || (_templateObject22 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
82
|
+
return props.theme.themeProp('border-color', '#634E01', '#FFFDE8');
|
|
83
|
+
});
|
|
84
|
+
}, function (props) {
|
|
85
|
+
return props.noBorder && props.type === 'error' && styled.css(_templateObject23 || (_templateObject23 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
86
|
+
return props.theme.themeProp('border-color', '#7f1b1b', '#FBEAE6');
|
|
87
|
+
});
|
|
88
|
+
}, function (props) {
|
|
89
|
+
return props.type === 'warning-border' && styled.css(_templateObject24 || (_templateObject24 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('border-color', props.theme.getColor('red-200'), props.theme.getColor('orange-500')));
|
|
90
|
+
}, function (props) {
|
|
91
|
+
return props.type === 'error-border' && styled.css(_templateObject25 || (_templateObject25 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('border-color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
92
|
+
}, function (props) {
|
|
93
|
+
return props.lightBackground && styled.css(_templateObject26 || (_templateObject26 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n &&:hover {\n ", "\n }\n "])), props.theme.themeProp('background', '#FFFDDE', '#fffde8'), props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('gray-900')), props.theme.themeProp('background', 'white', 'white'));
|
|
94
|
+
}, function (props) {
|
|
95
|
+
return props.edit && props.theme.themeProp('background', '#505050', '#eff1f4');
|
|
96
|
+
}, function (props) {
|
|
97
|
+
return props.edit && !props.type === 'warning' && props.theme.themeProp('background', '#505050', '#eff1f4');
|
|
98
|
+
}, function (props) {
|
|
99
|
+
return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#AD8800', '#FFF3A7');
|
|
100
|
+
}, function (props) {
|
|
101
|
+
return props.edit && props.type === 'instructions-warning' && props.theme.themeProp('background', '#AD8800 ', '#FFF3A7');
|
|
102
|
+
}, function (props) {
|
|
103
|
+
return props.hasIcon && styled.css(_templateObject27 || (_templateObject27 = defaultTheme._taggedTemplateLiteral(["\n padding-left: 55px;\n padding-right: 25px;\n "])));
|
|
104
|
+
}, function (props) {
|
|
105
|
+
return !props.readOnly && !props.disabled && props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
|
|
106
|
+
}, function (props) {
|
|
107
|
+
return props.type === 'instructions-warning' && props.theme.themeProp('background', '#806403', '#F4E21E');
|
|
108
|
+
}, function (props) {
|
|
109
|
+
return props.noBorder && props.type === 'instructions-warning' && styled.css(_templateObject28 || (_templateObject28 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
110
|
+
return props.theme.themeProp('border-color', '#806403', '#F4E21E');
|
|
111
|
+
});
|
|
112
|
+
}, function (props) {
|
|
113
|
+
return props.type === 'warning' && props.theme.themeProp('background', '#806403', '#FFFEBF');
|
|
114
|
+
}, function (props) {
|
|
115
|
+
return props.type === 'error' && props.theme.themeProp('background', '#F7D5D0', '#F7D5D0');
|
|
116
|
+
}, function (props) {
|
|
117
|
+
return props.noBorder && !props.readOnly && props.type != 'warning' && props.type != 'error' && props.type != 'instructions-warning' ? props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100')) : 'background: transparent';
|
|
118
|
+
}, InputIconContainer, function (props) {
|
|
119
|
+
return props.type === 'success' && styled.css(_templateObject29 || (_templateObject29 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0;\n "])));
|
|
120
|
+
}, function (props) {
|
|
121
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'), 1);
|
|
122
|
+
}, function (props) {
|
|
123
|
+
return props.theme.themeProp('opacity', 0.6, 0.5, 1);
|
|
124
|
+
}, function (props) {
|
|
125
|
+
return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-600'));
|
|
126
|
+
}, function (props) {
|
|
127
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('white'));
|
|
128
|
+
}, function (props) {
|
|
129
|
+
return props.type === 'warning' && styled.css(_templateObject30 || (_templateObject30 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), function (props) {
|
|
130
|
+
return props.theme.themeProp('border-color', '#F4E21E', '#F4E21E');
|
|
131
|
+
}, props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
|
|
132
|
+
}, function (props) {
|
|
133
|
+
return props.type === 'error' && styled.css(_templateObject31 || (_templateObject31 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n ", "\n "])), function (props) {
|
|
134
|
+
return props.theme.themeProp('border-color', '#D83018', '#D83018');
|
|
135
|
+
}, props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
|
|
136
|
+
}, function (props) {
|
|
137
|
+
return props.edit && props.theme.themeProp('background', '#505050', '#eff1f4');
|
|
138
|
+
}, function (props) {
|
|
139
|
+
return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#AD8800', '#FFF3A7');
|
|
140
|
+
}, function (props) {
|
|
141
|
+
return props.edit && props.type === 'instructions-warning' && props.theme.themeProp('background', '#AD8800 ', '#FFF3A7');
|
|
142
|
+
});
|
|
143
|
+
var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(_templateObject32 || (_templateObject32 = 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 margin-botton: 50px;\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n content: \"\";\n\n ", "\n"])), placeholderBaseStyle, function (props) {
|
|
144
|
+
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%)"));
|
|
145
|
+
}, function (props) {
|
|
146
|
+
return !props.inputIsEmpty && styled.css(_templateObject33 || (_templateObject33 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), activeLabel);
|
|
147
|
+
}, function (props) {
|
|
148
|
+
return props.hasPlaceholder && styled.css(_templateObject34 || (_templateObject34 = defaultTheme._taggedTemplateLiteral(["\n ", ";\n "])), activeLabel);
|
|
149
|
+
}, function (props) {
|
|
150
|
+
return props.hasIcon && styled.css(_templateObject35 || (_templateObject35 = defaultTheme._taggedTemplateLiteral(["\n left: 55px;\n "])));
|
|
151
|
+
});
|
|
152
|
+
var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject36 || (_templateObject36 = 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"])));
|
|
153
|
+
var TextInputFieldIconAlert = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject37 || (_templateObject37 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n top: 2.8px;\n height: 2.625rem;\n display: flex;\n padding: 0 10px 0 30px;\n svg {\n width: 15px;\n opacity: 0.6;\n transition: opacity 250ms;\n margin-top: -3px;\n ", "\n }\n"])), function (props) {
|
|
154
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-600'));
|
|
155
|
+
});
|
|
156
|
+
var TextInput = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject38 || (_templateObject38 = defaultTheme._taggedTemplateLiteral(["\n position: relative;\n\n ", "\n\n ", "\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"])), function (props) {
|
|
157
|
+
return props.readOnly && styled.css(_templateObject39 || (_templateObject39 = defaultTheme._taggedTemplateLiteral(["\n pointer-events: none;\n "])));
|
|
158
|
+
}, function (props) {
|
|
159
|
+
return props.disabled && styled.css(_templateObject40 || (_templateObject40 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0.5;\n\n > * {\n cursor: not-allowed;\n }\n "])));
|
|
160
|
+
}, TextInputLabel, activeLabel, TextInputFieldIcon, TextInputField, TextInputLabel, activeLabel, function (props) {
|
|
161
|
+
return props.type === 'error' && props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500'));
|
|
162
|
+
});
|
|
163
|
+
var Description = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject41 || (_templateObject41 = 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\n ", "\n"])), function (props) {
|
|
164
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
|
|
165
|
+
}, function (props) {
|
|
166
|
+
return (props.type === 'warning-border' || props.type === 'warning') && styled.css(_templateObject42 || (_templateObject42 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('orange-500')));
|
|
167
|
+
}, function (props) {
|
|
168
|
+
return (props.type === 'error-border' || props.type === 'error') && styled.css(_templateObject43 || (_templateObject43 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
169
|
+
});
|
|
170
|
+
var SuccessContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject44 || (_templateObject44 = defaultTheme._taggedTemplateLiteral(["\n opacity: 1;\n pointer-events: none;\n opacity: ", ";\n animation: ", " 0.5s ease-in-out;\n transition: opacity 0.5s ease-in-out;\n position: absolute;\n margin-top: -35px;\n margin-left: 5px;\n width: 15px;\n height: 15px;\n padding: 5px;\n ", "\n\n > svg {\n width: 15px;\n }\n"])), function (props) {
|
|
171
|
+
return props.fadeIn ? 0 : 1;
|
|
172
|
+
}, function (props) {
|
|
173
|
+
return props.fadeIn ? fadeOutCheck : fadeInCheck;
|
|
174
|
+
}, function (props) {
|
|
175
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'));
|
|
176
|
+
});
|
|
177
|
+
var ShowMoreText = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject45 || (_templateObject45 = defaultTheme._taggedTemplateLiteral(["\n margin-top: -18px;\n margin-bottom: 0;\n display: block;\n position: absolute;\n font-size: 0.875rem;\n cursor: pointer;\n padding: 2px 10px;\n margin-right: 10px;\n margin-top: -26px;\n ", "\n transition: margin-top 550ms ease-in-out;\n -webkit-mask-image: linear-gradient(180deg, transparent 1px, white 7px);\n ", "\n\n ", ";\n\n ", "\n"])), function (props) {
|
|
178
|
+
return props.expanded && styled.css(_templateObject46 || (_templateObject46 = defaultTheme._taggedTemplateLiteral(["\n margin-top: 0px;\n "])));
|
|
179
|
+
}, function (props) {
|
|
180
|
+
return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
|
|
181
|
+
}, function (props) {
|
|
182
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('emerald-500'));
|
|
183
|
+
}, function (props) {
|
|
184
|
+
return props.type === 'error' && styled.css(_templateObject47 || (_templateObject47 = defaultTheme._taggedTemplateLiteral(["\n content: 'error';\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forwardedRef) {
|
|
188
|
+
var value = _ref.value,
|
|
189
|
+
defaultValue = _ref.defaultValue,
|
|
190
|
+
name = _ref.name,
|
|
191
|
+
label = _ref.label,
|
|
192
|
+
placeholder = _ref.placeholder,
|
|
193
|
+
required = _ref.required,
|
|
194
|
+
disabled = _ref.disabled,
|
|
195
|
+
hidden = _ref.hidden,
|
|
196
|
+
readOnly = _ref.readOnly,
|
|
197
|
+
edit = _ref.edit,
|
|
198
|
+
showMore = _ref.showMore,
|
|
199
|
+
showMoreText = _ref.showMoreText,
|
|
200
|
+
showLessText = _ref.showLessText,
|
|
201
|
+
autoComplete = _ref.autoComplete,
|
|
202
|
+
description = _ref.description,
|
|
203
|
+
type = _ref.type,
|
|
204
|
+
icon = _ref.icon,
|
|
205
|
+
rows = _ref.rows,
|
|
206
|
+
className = _ref.className,
|
|
207
|
+
style = _ref.style,
|
|
208
|
+
_onChange = _ref.onChange,
|
|
209
|
+
onBlur = _ref.onBlur,
|
|
210
|
+
lightBackground = _ref.lightBackground,
|
|
211
|
+
noBorder = _ref.noBorder,
|
|
212
|
+
instructionsTextArea = _ref.instructionsTextArea,
|
|
213
|
+
isExpanded = _ref.isExpanded,
|
|
214
|
+
loadingIcon = _ref.loadingIcon,
|
|
215
|
+
successIcon = _ref.successIcon,
|
|
216
|
+
padding = _ref.padding,
|
|
217
|
+
descriptionToolTip = _ref.descriptionToolTip,
|
|
218
|
+
rest = defaultTheme._objectWithoutProperties(_ref, ["value", "defaultValue", "name", "label", "placeholder", "required", "disabled", "hidden", "readOnly", "edit", "showMore", "showMoreText", "showLessText", "autoComplete", "description", "type", "icon", "rows", "className", "style", "onChange", "onBlur", "lightBackground", "noBorder", "instructionsTextArea", "isExpanded", "loadingIcon", "successIcon", "padding", "descriptionToolTip"]);
|
|
219
|
+
|
|
220
|
+
var textInputDomNode = React.useRef(null);
|
|
221
|
+
var textInputRef = useMergedRefs.useMergedRefs(forwardedRef, textInputDomNode);
|
|
222
|
+
|
|
223
|
+
var _useState = React.useState(!(value || defaultValue)),
|
|
224
|
+
_useState2 = defaultTheme._slicedToArray(_useState, 2),
|
|
225
|
+
inputIsEmpty = _useState2[0],
|
|
226
|
+
setInputIsEmpty = _useState2[1];
|
|
227
|
+
|
|
228
|
+
var _useState3 = React.useState(''),
|
|
229
|
+
_useState4 = defaultTheme._slicedToArray(_useState3, 2),
|
|
230
|
+
maxContentRows = _useState4[0],
|
|
231
|
+
setMaxContentRows = _useState4[1];
|
|
232
|
+
|
|
233
|
+
var _useState5 = React.useState(false),
|
|
234
|
+
_useState6 = defaultTheme._slicedToArray(_useState5, 2),
|
|
235
|
+
expanded = _useState6[0],
|
|
236
|
+
setExpanded = _useState6[1];
|
|
237
|
+
|
|
238
|
+
var _useState7 = React.useState(''),
|
|
239
|
+
_useState8 = defaultTheme._slicedToArray(_useState7, 2),
|
|
240
|
+
maxHeight = _useState8[0],
|
|
241
|
+
setMaxHeight = _useState8[1];
|
|
242
|
+
|
|
243
|
+
var _useState9 = React.useState(''),
|
|
244
|
+
_useState10 = defaultTheme._slicedToArray(_useState9, 2),
|
|
245
|
+
defaultHeight = _useState10[0],
|
|
246
|
+
setDefaultHeight = _useState10[1];
|
|
247
|
+
|
|
248
|
+
var _useState11 = React.useState(false),
|
|
249
|
+
_useState12 = defaultTheme._slicedToArray(_useState11, 2),
|
|
250
|
+
autoFocus = _useState12[0],
|
|
251
|
+
setAutoFocus = _useState12[1];
|
|
252
|
+
|
|
253
|
+
var _useState13 = React.useState(nanoid.nanoid()),
|
|
254
|
+
_useState14 = defaultTheme._slicedToArray(_useState13, 1),
|
|
255
|
+
uniqueId = _useState14[0];
|
|
256
|
+
|
|
257
|
+
var memoizedDescriptionToolTip = React.useMemo(function () {
|
|
258
|
+
return descriptionToolTip;
|
|
259
|
+
}, [descriptionToolTip]);
|
|
260
|
+
React.useEffect(function () {
|
|
261
|
+
setExpanded(false);
|
|
262
|
+
isExpanded(false);
|
|
263
|
+
setAutoFocus(false);
|
|
264
|
+
}, [value, defaultValue]);
|
|
265
|
+
|
|
266
|
+
var handleTextAreaChange = function handleTextAreaChange() {
|
|
267
|
+
setExpanded(true);
|
|
268
|
+
isExpanded(true);
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
var handleTextAreaShowLess = function handleTextAreaShowLess() {
|
|
272
|
+
setExpanded(!expanded);
|
|
273
|
+
isExpanded(!expanded);
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
var calculateRows = function calculateRows() {
|
|
277
|
+
var textareaRefCurrent = textInputDomNode === null || textInputDomNode === void 0 ? void 0 : textInputDomNode.current;
|
|
278
|
+
|
|
279
|
+
if (textareaRefCurrent !== null) {
|
|
280
|
+
var textAreaHeight = textareaRefCurrent === null || textareaRefCurrent === void 0 ? void 0 : textareaRefCurrent.scrollHeight;
|
|
281
|
+
var lineHeight = 16;
|
|
282
|
+
var calculatedRows = Math.floor(textAreaHeight / lineHeight);
|
|
283
|
+
var defaultRowsHeight = rows * lineHeight;
|
|
284
|
+
setMaxContentRows(calculatedRows);
|
|
285
|
+
|
|
286
|
+
if (calculatedRows > rows) {
|
|
287
|
+
setDefaultHeight(defaultRowsHeight);
|
|
288
|
+
setMaxHeight(textAreaHeight);
|
|
289
|
+
} else {
|
|
290
|
+
setMaxHeight();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
React.useEffect(function () {
|
|
296
|
+
calculateRows();
|
|
297
|
+
}, [value, defaultValue]);
|
|
298
|
+
var onKeyDown = React.useCallback(function (event) {
|
|
299
|
+
if (event.key === 'Enter') {
|
|
300
|
+
event.stopPropagation();
|
|
301
|
+
}
|
|
302
|
+
}, []);
|
|
303
|
+
|
|
304
|
+
var input = function input() {
|
|
305
|
+
return React__default['default'].createElement(TextInput, {
|
|
306
|
+
disabled: disabled,
|
|
307
|
+
readOnly: readOnly,
|
|
308
|
+
type: type,
|
|
309
|
+
className: className,
|
|
310
|
+
style: style
|
|
311
|
+
}, React__default['default'].createElement(TextInputFieldIconAlert, null, icon), React__default['default'].createElement(TextInputField, defaultTheme._extends({
|
|
312
|
+
autoFocus: autoFocus,
|
|
313
|
+
ref: textInputRef,
|
|
314
|
+
rows: rows,
|
|
315
|
+
expanded: expanded,
|
|
316
|
+
defaultHeight: defaultHeight,
|
|
317
|
+
maxHeight: maxHeight,
|
|
318
|
+
value: value,
|
|
319
|
+
defaultValue: defaultValue,
|
|
320
|
+
name: name,
|
|
321
|
+
placeholder: placeholder || ' ',
|
|
322
|
+
required: required,
|
|
323
|
+
readOnly: readOnly,
|
|
324
|
+
disabled: disabled,
|
|
325
|
+
edit: edit,
|
|
326
|
+
instructionsTextArea: instructionsTextArea,
|
|
327
|
+
showMore: showMore,
|
|
328
|
+
type: type,
|
|
329
|
+
autoComplete: autoComplete,
|
|
330
|
+
hasIcon: Boolean(icon),
|
|
331
|
+
icon: icon,
|
|
332
|
+
id: "text-input-".concat(uniqueId),
|
|
333
|
+
key: uniqueId,
|
|
334
|
+
lightBackground: lightBackground,
|
|
335
|
+
padding: padding,
|
|
336
|
+
onChange: function onChange(e) {
|
|
337
|
+
if (e.target.value) {
|
|
338
|
+
setInputIsEmpty(false);
|
|
339
|
+
|
|
340
|
+
if (!autoFocus) {
|
|
341
|
+
setAutoFocus(true);
|
|
342
|
+
}
|
|
343
|
+
} else {
|
|
344
|
+
setInputIsEmpty(true);
|
|
345
|
+
|
|
346
|
+
if (!autoFocus) {
|
|
347
|
+
setAutoFocus(true);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
_onChange(e);
|
|
352
|
+
},
|
|
353
|
+
onKeyDown: onKeyDown,
|
|
354
|
+
onBlur: onBlur,
|
|
355
|
+
noBorder: noBorder
|
|
356
|
+
}, rest, {
|
|
357
|
+
onClick: showMore ? handleTextAreaChange : undefined
|
|
358
|
+
})), (type === 'loading' || type === 'success') && React__default['default'].createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
|
|
359
|
+
disabled: disabled
|
|
360
|
+
}, React__default['default'].createElement(editNote.SvgEditNote, {
|
|
361
|
+
className: padding === 'small' ? 'smallPadingIcon' : undefined
|
|
362
|
+
})), label && React__default['default'].createElement(TextInputLabel, {
|
|
363
|
+
htmlFor: "text-input-".concat(uniqueId),
|
|
364
|
+
hasPlaceholder: Boolean(placeholder),
|
|
365
|
+
hasIcon: Boolean(icon),
|
|
366
|
+
inputIsEmpty: inputIsEmpty
|
|
367
|
+
}, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default['default'].createElement(Description, {
|
|
368
|
+
type: type
|
|
369
|
+
}, description), maxContentRows > rows && showMore && React__default['default'].createElement(ShowMoreText, {
|
|
370
|
+
onClick: showMore ? handleTextAreaShowLess : undefined,
|
|
371
|
+
expanded: expanded
|
|
372
|
+
}, !expanded ? showMoreText : showLessText));
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
if (hidden) return null;
|
|
376
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, !memoizedDescriptionToolTip && input(), memoizedDescriptionToolTip && React__default['default'].createElement("div", null, React__default['default'].createElement(Tooltip.Tooltip, {
|
|
377
|
+
content: memoizedDescriptionToolTip,
|
|
378
|
+
key: "tooltipTextArea1",
|
|
379
|
+
placement: "bottom-end",
|
|
380
|
+
trigger: 'mouseenter',
|
|
381
|
+
zIndex: 999999
|
|
382
|
+
}, input())));
|
|
383
|
+
});
|
|
384
|
+
TextArea.defaultProps = {
|
|
385
|
+
rows: 4,
|
|
386
|
+
noBorder: false,
|
|
387
|
+
readOnly: false,
|
|
388
|
+
edit: false,
|
|
389
|
+
hidden: false,
|
|
390
|
+
showMore: false,
|
|
391
|
+
showMoreText: '',
|
|
392
|
+
showLessText: '',
|
|
393
|
+
type: '',
|
|
394
|
+
padding: 'medium',
|
|
395
|
+
instructionsTextArea: false,
|
|
396
|
+
descriptionToolTip: '',
|
|
397
|
+
isExpanded: function isExpanded() {},
|
|
398
|
+
onChange: function onChange() {}
|
|
399
|
+
};
|
|
400
|
+
TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
401
|
+
value: defaultTheme.PropTypes.string,
|
|
402
|
+
defaultValue: defaultTheme.PropTypes.string,
|
|
403
|
+
name: defaultTheme.PropTypes.string,
|
|
404
|
+
label: defaultTheme.PropTypes.string,
|
|
405
|
+
placeholder: defaultTheme.PropTypes.string,
|
|
406
|
+
required: defaultTheme.PropTypes.bool,
|
|
407
|
+
disabled: defaultTheme.PropTypes.bool,
|
|
408
|
+
hidden: defaultTheme.PropTypes.bool,
|
|
409
|
+
readOnly: defaultTheme.PropTypes.bool,
|
|
410
|
+
showMore: defaultTheme.PropTypes.bool,
|
|
411
|
+
showMoreText: defaultTheme.PropTypes.string,
|
|
412
|
+
showLessText: defaultTheme.PropTypes.string,
|
|
413
|
+
edit: defaultTheme.PropTypes.bool,
|
|
414
|
+
autoComplete: defaultTheme.PropTypes.string,
|
|
415
|
+
description: defaultTheme.PropTypes.string,
|
|
416
|
+
error: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.bool, defaultTheme.PropTypes.string]),
|
|
417
|
+
warning: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.bool, defaultTheme.PropTypes.string]),
|
|
418
|
+
icon: defaultTheme.PropTypes.element,
|
|
419
|
+
rows: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.number, defaultTheme.PropTypes.string]),
|
|
420
|
+
className: defaultTheme.PropTypes.string,
|
|
421
|
+
style: defaultTheme.PropTypes.object,
|
|
422
|
+
padding: defaultTheme.PropTypes.oneOf(['', 'small', 'medium', 'large']),
|
|
423
|
+
lightBackground: defaultTheme.PropTypes.bool,
|
|
424
|
+
onChange: defaultTheme.PropTypes.func,
|
|
425
|
+
onBlur: defaultTheme.PropTypes.func,
|
|
426
|
+
noBorder: defaultTheme.PropTypes.bool,
|
|
427
|
+
isExpanded: defaultTheme.PropTypes.func,
|
|
428
|
+
type: defaultTheme.PropTypes.oneOf(['', 'error', 'error-border', 'warning-border', 'warning', 'instructions-warning', 'loading', 'success']),
|
|
429
|
+
instructionsTextArea: defaultTheme.PropTypes.bool,
|
|
430
|
+
loadingIcon: defaultTheme.PropTypes.element,
|
|
431
|
+
successIcon: defaultTheme.PropTypes.element,
|
|
432
|
+
descriptionToolTip: defaultTheme.PropTypes.string
|
|
433
|
+
} : {};
|
|
434
|
+
|
|
435
|
+
exports.TextArea = TextArea;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var defaultTheme = require('./defaultTheme-
|
|
3
|
+
var defaultTheme = require('./defaultTheme-ea44e34a.js');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var styled = require('styled-components');
|
|
6
6
|
var TippyTooltip = require('@tippyjs/react');
|
|
7
|
-
require('./shift-away-subtle-
|
|
7
|
+
require('./shift-away-subtle-0bed9a3c.js');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
@@ -31,7 +31,7 @@ var Tooltip = React__default['default'].forwardRef(function Tooltip(_ref, ref) {
|
|
|
31
31
|
children = _ref.children,
|
|
32
32
|
props = defaultTheme._objectWithoutProperties(_ref, ["content", "interactive", "placement", "duration", "trigger", "visible", "children"]);
|
|
33
33
|
|
|
34
|
-
return React__default['default'].createElement(Tooltip$1, defaultTheme._extends({
|
|
34
|
+
return React__default['default'].createElement("div", null, React__default['default'].createElement(Tooltip$1, defaultTheme._extends({
|
|
35
35
|
ref: ref,
|
|
36
36
|
content: content,
|
|
37
37
|
interactive: interactive,
|
|
@@ -40,7 +40,7 @@ var Tooltip = React__default['default'].forwardRef(function Tooltip(_ref, ref) {
|
|
|
40
40
|
trigger: trigger,
|
|
41
41
|
visible: visible,
|
|
42
42
|
animation: 'shift-away-subtle'
|
|
43
|
-
}, props), children);
|
|
43
|
+
}, props), children));
|
|
44
44
|
});
|
|
45
45
|
Tooltip.defaultProps = {
|
|
46
46
|
content: 'Tooltip',
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var defaultTheme = require('./defaultTheme-ea44e34a.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
|
+
function _interopNamespace(e) {
|
|
10
|
+
if (e && e.__esModule) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return e[k];
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n['default'] = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
30
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
31
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
32
|
+
|
|
33
|
+
var _templateObject, _templateObject2;
|
|
34
|
+
var VerificationStatusIcon$1 = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n display: flex;\n position: relative;\n font: normal normal normal 12px/16px Roboto;\n\n ", ";\n\n svg {\n height: ", "px;\n }\n"])), function (props) {
|
|
35
|
+
return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-700'));
|
|
36
|
+
}, function (props) {
|
|
37
|
+
var _props$iconHeight;
|
|
38
|
+
|
|
39
|
+
return (_props$iconHeight = props.iconHeight) !== null && _props$iconHeight !== void 0 ? _props$iconHeight : 15;
|
|
40
|
+
});
|
|
41
|
+
var VerificationStatusColor = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n position: absolute;\n bottom: 0;\n left: ", "px;\n width: ", "px;\n height: ", "px;\n border-radius: 50%;\n\n ", "\n"])), function (props) {
|
|
42
|
+
var _props$iconHeight2;
|
|
43
|
+
|
|
44
|
+
return ((_props$iconHeight2 = props.iconHeight) !== null && _props$iconHeight2 !== void 0 ? _props$iconHeight2 : 15) * 2 / 3;
|
|
45
|
+
}, function (props) {
|
|
46
|
+
var _props$iconHeight3;
|
|
47
|
+
|
|
48
|
+
return ((_props$iconHeight3 = props.iconHeight) !== null && _props$iconHeight3 !== void 0 ? _props$iconHeight3 : 15) * 2 / 3;
|
|
49
|
+
}, function (props) {
|
|
50
|
+
var _props$iconHeight4;
|
|
51
|
+
|
|
52
|
+
return ((_props$iconHeight4 = props.iconHeight) !== null && _props$iconHeight4 !== void 0 ? _props$iconHeight4 : 15) * 2 / 3;
|
|
53
|
+
}, function (props) {
|
|
54
|
+
var darkThemeColor = props.theme.getColor('gray-100');
|
|
55
|
+
var lightThemeColor = props.theme.getColor('gray-500');
|
|
56
|
+
|
|
57
|
+
if (props.status === 'verified') {
|
|
58
|
+
darkThemeColor = props.theme.getColor('emerald-500');
|
|
59
|
+
lightThemeColor = props.theme.getColor('emerald-300');
|
|
60
|
+
} else if (props.status === 'pending') {
|
|
61
|
+
darkThemeColor = props.theme.getColor('brown-500');
|
|
62
|
+
lightThemeColor = props.theme.getColor('signal-yellow-500');
|
|
63
|
+
} else if (props.status === 'rejected') {
|
|
64
|
+
darkThemeColor = props.theme.getColor('red-600');
|
|
65
|
+
lightThemeColor = props.theme.getColor('red-200');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return props.theme.themeProp('background-color', darkThemeColor, lightThemeColor);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
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); }
|
|
72
|
+
|
|
73
|
+
var _ref = /*#__PURE__*/React__namespace.createElement("path", {
|
|
74
|
+
fill: "currentColor",
|
|
75
|
+
d: "M9.3 12.662q-1.698 0-2.864-1.166T5.27 8.632q0-1.697 1.166-2.864T9.3 4.602q1.698 0 2.864 1.166t1.166 2.864q0 1.698-1.166 2.864T9.3 12.662zm0-1.86q.925 0 1.548-.622.622-.622.622-1.548t-.622-1.547q-.623-.623-1.548-.623t-1.548.623q-.622.622-.622 1.547t.622 1.548q.623.622 1.548.622zm0 12.686q-4.023-1.097-6.661-4.735Q0 15.113 0 10.616V3.482L9.3 0l9.3 3.482v7.134q0 4.498-2.639 8.137-2.638 3.639-6.661 4.735zm0-11.744zm0-9.765L1.86 4.757v5.86q0 1.769.507 3.421.507 1.653 1.408 3.083 1.254-.639 2.626-.999 1.373-.36 2.899-.36t2.898.36q1.373.36 2.627 1 .901-1.431 1.408-3.084.507-1.652.507-3.422V4.757L9.3 1.98zm0 15.643q-1.2 0-2.307.26-1.108.26-2.093.73.923 1.025 2.03 1.773 1.109.747 2.37 1.143 1.262-.395 2.363-1.143 1.102-.748 2.025-1.773-.985-.47-2.087-.73-1.102-.26-2.301-.26z"
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
function SvgVerification(props) {
|
|
79
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
80
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
81
|
+
viewBox: "-2.5 0 24 24"
|
|
82
|
+
}, props), _ref);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var VerificationStatusIcon = React__default['default'].forwardRef(function VerificationStatusIcon(_ref, forwardedRef) {
|
|
86
|
+
var status = _ref.status,
|
|
87
|
+
iconHeight = _ref.iconHeight,
|
|
88
|
+
props = defaultTheme._objectWithoutProperties(_ref, ["status", "iconHeight"]);
|
|
89
|
+
|
|
90
|
+
return React__default['default'].createElement(VerificationStatusIcon$1, defaultTheme._extends({
|
|
91
|
+
iconHeight: iconHeight,
|
|
92
|
+
ref: forwardedRef
|
|
93
|
+
}, props), React__default['default'].createElement(SvgVerification, null), React__default['default'].createElement(VerificationStatusColor, {
|
|
94
|
+
iconHeight: iconHeight,
|
|
95
|
+
status: status
|
|
96
|
+
}));
|
|
97
|
+
});
|
|
98
|
+
VerificationStatusIcon.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
99
|
+
status: defaultTheme.PropTypes.oneOf(['verified', 'pending', 'rejected']).isRequired,
|
|
100
|
+
iconHeight: defaultTheme.PropTypes.number
|
|
101
|
+
} : {};
|
|
102
|
+
VerificationStatusIcon.defaultProps = {
|
|
103
|
+
iconHeight: 15
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
exports.VerificationStatusIcon = VerificationStatusIcon;
|
package/data/Alert/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Alert = require('../../Alert-
|
|
4
|
-
require('../../defaultTheme-
|
|
3
|
+
var Alert = require('../../Alert-13b75102.js');
|
|
4
|
+
require('../../defaultTheme-ea44e34a.js');
|
|
5
5
|
require('styled-components');
|
|
6
6
|
require('react');
|
|
7
|
+
require('lodash');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
package/data/Badge/index.js
CHANGED
package/data/Popover/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Popover = require('../../Popover-
|
|
4
|
-
require('../../defaultTheme-
|
|
3
|
+
var Popover = require('../../Popover-569cd272.js');
|
|
4
|
+
require('../../defaultTheme-ea44e34a.js');
|
|
5
5
|
require('styled-components');
|
|
6
6
|
require('lodash');
|
|
7
7
|
require('react');
|
|
8
8
|
require('polished');
|
|
9
9
|
require('@tippyjs/react');
|
|
10
|
-
require('../../shift-away-subtle-
|
|
10
|
+
require('../../shift-away-subtle-0bed9a3c.js');
|
|
11
|
+
require('popper-max-size-modifier');
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
|
package/data/Tab/index.js
CHANGED