@ntbjs/react-components 1.2.0-rc.8 → 1.2.0-rc.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/{ActionButton-06df3d6c.js → ActionButton-46735b89.js} +13 -5
  2. package/{AssetGallery-46f5cbef.js → AssetGallery-71d9aeac.js} +127 -52
  3. package/{AssetPreviewTopBar-c28715f7.js → AssetPreviewTopBar-912c3469.js} +8 -3
  4. package/{Button-353f5bbc.js → Button-49f82b31.js} +1 -1
  5. package/{CompactAutocompleteSelect-e99629df.js → CompactAutocompleteSelect-9425bd2e.js} +111 -78
  6. package/{CompactStarRating-5dc2131c.js → CompactStarRating-7d7ad40e.js} +85 -46
  7. package/{CompactTextInput-fa11fda0.js → CompactTextInput-86d0b82c.js} +77 -77
  8. package/{ContextMenuItem-1fe17ed5.js → ContextMenuItem-ba2b697e.js} +3 -3
  9. package/{Instructions-6c9498a9.js → Instructions-d6d5b998.js} +20 -7
  10. package/{MultiLevelCheckboxSelect-418de626.js → MultiLevelCheckboxSelect-24c88aaa.js} +36 -66
  11. package/{Popover-6afb3779.js → Popover-569cd272.js} +31 -5
  12. package/{Tabs-c2261e7e.js → Tabs-ea48ce3e.js} +46 -42
  13. package/TextArea-a215d377.js +436 -0
  14. package/{Tooltip-6b6f0b0a.js → Tooltip-66daf6e3.js} +2 -2
  15. package/{VerificationStatusIcon-b574fd21.js → VerificationStatusIcon-6fe95a92.js} +24 -12
  16. package/data/Popover/index.js +2 -1
  17. package/data/Tabs/index.js +1 -1
  18. package/data/Tooltip/index.js +1 -1
  19. package/data/index.js +5 -4
  20. package/inputs/ActionButton/index.js +1 -1
  21. package/inputs/Button/index.js +3 -2
  22. package/inputs/CompactAutocompleteSelect/index.js +12 -2
  23. package/inputs/CompactStarRating/index.js +13 -2
  24. package/inputs/CompactTextInput/index.js +6 -6
  25. package/inputs/TextArea/index.js +13 -2
  26. package/inputs/index.js +15 -15
  27. package/package.json +2 -1
  28. package/widgets/AssetGallery/index.js +14 -14
  29. package/widgets/AssetPreview/AssetPreviewTopBar/index.js +1 -1
  30. package/widgets/ContextMenu/ContextMenuItem/index.js +1 -1
  31. package/widgets/Instructions/index.js +14 -4
  32. package/widgets/index.js +16 -16
  33. package/TextArea-1689b8d8.js +0 -348
  34. package/check-555d831b.js +0 -213
@@ -1,348 +0,0 @@
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
- var check = require('./check-555d831b.js');
8
- var editNote = require('./edit-note-c47d292e.js');
9
- var styled = require('styled-components');
10
-
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
14
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
15
-
16
- 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;
17
- var fadeInCheck = styled.keyframes(_templateObject || (_templateObject = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n"])));
18
- var fadeOutCheck = styled.keyframes(_templateObject2 || (_templateObject2 = defaultTheme._taggedTemplateLiteral(["\n from {\n opacity: 1\n }\n to {\n opacity: 0\n }\n"])));
19
- 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"])));
20
- var placeholderBaseStyle = styled.css(_templateObject4 || (_templateObject4 = defaultTheme._taggedTemplateLiteral(["\n ", "\n\n ", "\n"])), function (props) {
21
- return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'));
22
- }, function (props) {
23
- return props.theme.themeProp('opacity', 0.6, 0.5);
24
- });
25
- 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 svg {\n width: 15px;\n opacity: 0.7;\n transition: opacity 250ms;\n ", "\n ", "\n }\n"])), function (props) {
26
- return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-900'), '!important');
27
- }, function (props) {
28
- return props.disabled && styled.css(_templateObject6 || (_templateObject6 = defaultTheme._taggedTemplateLiteral(["\n display: none;\n "])));
29
- });
30
- 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 &&:hover:not(:focus) {\n ", ";\n }\n\n ", " \n\n ", " \n ", "\n ", ";\n\n ", ";\n\n ", ";\n\n &&:hover:not(:focus) {\n ", ";\n transition: background 350ms;\n & + ", " {\n opacity: 1;\n ", ";\n transition: opacity 350ms;\n }\n }\n\n ", "\n ", "\n ", "\n\n &::placeholder {\n ", "\n\n ", "\n }\n\n &&:focus {\n outline: none;\n ", "\n\n ", ";\n\n ", "\n ", "\n }\n\n &&:not(:hover):not(:focus) {\n ", ";\n\n ", ";\n }\n"])), function (props) {
31
- return props.padding === 'small' && styled.css(_templateObject8 || (_templateObject8 = defaultTheme._taggedTemplateLiteral(["\n padding: 5px 10px;\n "])));
32
- }, function (props) {
33
- return props.padding === 'medium' && styled.css(_templateObject9 || (_templateObject9 = defaultTheme._taggedTemplateLiteral(["\n padding: 13px 15px;\n "])));
34
- }, function (props) {
35
- return props.padding === 'large' && styled.css(_templateObject10 || (_templateObject10 = defaultTheme._taggedTemplateLiteral(["\n padding: 15px 55px;\n "])));
36
- }, function (props) {
37
- return props.showMore && !props.expanded && props.defaultHeight < props.maxHeight && styled.css(_templateObject11 || (_templateObject11 = defaultTheme._taggedTemplateLiteral(["\n height: ", "px;\n -webkit-mask-image: linear-gradient(0deg, transparent 5px, white 45px);\n "])), props.defaultHeight);
38
- }, function (props) {
39
- return props.expanded && styled.css(_templateObject12 || (_templateObject12 = defaultTheme._taggedTemplateLiteral(["\n height: ", "px;\n "])), props.maxHeight);
40
- }, function (props) {
41
- return props.theme.themeProp('color', 'white', 'black');
42
- }, function (props) {
43
- return props.readOnly && styled.css(_templateObject13 || (_templateObject13 = defaultTheme._taggedTemplateLiteral(["\n cursor: default;\n border-color: transparent !important;\n "])));
44
- }, function (props) {
45
- return props.disabled && styled.css(_templateObject14 || (_templateObject14 = defaultTheme._taggedTemplateLiteral(["\n cursor: not-allowed;\n "])));
46
- }, function (props) {
47
- return props.readOnly && styled.css(_templateObject15 || (_templateObject15 = defaultTheme._taggedTemplateLiteral(["\n padding: 12px 10px; ;\n "])));
48
- }, function (props) {
49
- return props.showMore && styled.css(_templateObject16 || (_templateObject16 = defaultTheme._taggedTemplateLiteral(["\n overflow: hidden;\n "])));
50
- }, function (props) {
51
- return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'));
52
- }, function (props) {
53
- return (props.state === 'warning' || props.state === 'error') && props.theme.themeProp('color', props.theme.getColor('gray-900'), props.theme.getColor('gray-900'));
54
- }, function (props) {
55
- return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
56
- }, function (props) {
57
- return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-400'));
58
- }, function (props) {
59
- return props.noBorder && styled.css(_templateObject17 || (_templateObject17 = defaultTheme._taggedTemplateLiteral(["\n border-color: transparent !important;\n "])));
60
- }, function (props) {
61
- return props.type === 'error-border' && styled.css(_templateObject18 || (_templateObject18 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('border-color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
62
- }, function (props) {
63
- return !props.readOnly && props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
64
- }, function (props) {
65
- return props.type === 'warning' && styled.css(_templateObject19 || (_templateObject19 = defaultTheme._taggedTemplateLiteral(["\n padding: 13px 15px 13px 10px;\n ", "\n ", "\n &&:hover:not(:focus) {\n ", "\n ", "\n }\n &&:read-only:hover {\n ", "\n }\n "])), props.theme.themeProp('color', 'white', 'black'), props.theme.themeProp('background', '#634E01 ', props.theme.getColor('signal-yellow-400')), function (props) {
66
- return props.disabled && styled.css(_templateObject20 || (_templateObject20 = defaultTheme._taggedTemplateLiteral(["\n background: none !important;\n "])));
67
- }, props.theme.themeProp('background', '#816600', '#F4E21E'), props.theme.themeProp('background', props.theme.getColor('signal-yellow-500'), props.theme.getColor('signal-yellow-400')));
68
- }, function (props) {
69
- return props.type === 'error' && styled.css(_templateObject21 || (_templateObject21 = defaultTheme._taggedTemplateLiteral(["\n padding: 13px 15px 13px 10px;\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'));
70
- }, function (props) {
71
- return props.lightBackground && styled.css(_templateObject22 || (_templateObject22 = 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'));
72
- }, function (props) {
73
- return props.edit && props.theme.themeProp('background', '#505050', '#eff1f4');
74
- }, function (props) {
75
- return props.edit && !props.type === 'warning' && props.theme.themeProp('background', '#505050', '#eff1f4');
76
- }, function (props) {
77
- return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#AD8800', '#FFF3A7');
78
- }, function (props) {
79
- return props.noBorder && !props.readOnly && props.type != 'warning' ? props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100')) : 'background: transparent';
80
- }, InputIconContainer, function (props) {
81
- return props.type === 'success' && styled.css(_templateObject23 || (_templateObject23 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0;\n "])));
82
- }, function (props) {
83
- return props.type === 'warning' && styled.css(_templateObject24 || (_templateObject24 = defaultTheme._taggedTemplateLiteral(["\n border-color: ", ";\n "])), props.theme.getColor('orange-500'));
84
- }, function (props) {
85
- return props.type === 'error' && styled.css(_templateObject25 || (_templateObject25 = defaultTheme._taggedTemplateLiteral(["\n border-color: ", ";\n "])), props.theme.getColor('red-500'));
86
- }, function (props) {
87
- return props.hasIcon && styled.css(_templateObject26 || (_templateObject26 = defaultTheme._taggedTemplateLiteral(["\n padding-left: 55px;\n padding-right: 25px;\n "])));
88
- }, function (props) {
89
- return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-600'), 1);
90
- }, function (props) {
91
- return props.theme.themeProp('opacity', 0.6, 0.5, 1);
92
- }, function (props) {
93
- return props.theme.themeProp('border-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-600'));
94
- }, function (props) {
95
- return props.theme.themeProp('background', props.theme.getColor('gray-700'), props.theme.getColor('gray-100'));
96
- }, function (props) {
97
- return props.type === 'warning' && styled.css(_templateObject27 || (_templateObject27 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n "])), props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
98
- }, function (props) {
99
- return props.type === 'error' && styled.css(_templateObject28 || (_templateObject28 = defaultTheme._taggedTemplateLiteral(["\n ", "\n ", "\n "])), props.theme.themeProp('background', 'white', 'white'), props.theme.themeProp('color', 'black', 'black'));
100
- }, function (props) {
101
- return props.edit && props.theme.themeProp('background', '#505050', '#eff1f4');
102
- }, function (props) {
103
- return props.edit && props.type === 'warning' && props.theme.themeProp('background', '#AD8800', '#FFF3A7');
104
- });
105
- var TextInputLabel = styled__default['default'].label.attrs(defaultTheme.applyDefaultTheme)(_templateObject29 || (_templateObject29 = 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) {
106
- 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%)"));
107
- }, function (props) {
108
- return !props.inputIsEmpty && styled.css(_templateObject30 || (_templateObject30 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), activeLabel);
109
- }, function (props) {
110
- return props.hasPlaceholder && styled.css(_templateObject31 || (_templateObject31 = defaultTheme._taggedTemplateLiteral(["\n ", ";\n "])), activeLabel);
111
- }, function (props) {
112
- return props.hasIcon && styled.css(_templateObject32 || (_templateObject32 = defaultTheme._taggedTemplateLiteral(["\n left: 55px;\n "])));
113
- });
114
- var TextInputFieldIcon = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject33 || (_templateObject33 = 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"])));
115
- var TextInputFieldIconAlert = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject34 || (_templateObject34 = 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) {
116
- return props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-600'));
117
- });
118
- var TextInput = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject35 || (_templateObject35 = 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) {
119
- return props.readOnly && styled.css(_templateObject36 || (_templateObject36 = defaultTheme._taggedTemplateLiteral(["\n pointer-events: none;\n "])));
120
- }, function (props) {
121
- return props.disabled && styled.css(_templateObject37 || (_templateObject37 = defaultTheme._taggedTemplateLiteral(["\n opacity: 0.5;\n\n > * {\n cursor: not-allowed;\n }\n "])));
122
- }, TextInputLabel, activeLabel, TextInputFieldIcon, TextInputField, TextInputLabel, activeLabel, function (props) {
123
- return props.type === 'error' && props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500'));
124
- });
125
- var Description = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject38 || (_templateObject38 = 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) {
126
- return props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'));
127
- }, function (props) {
128
- return (props.type === 'warning-border' || props.type === 'warning') && styled.css(_templateObject39 || (_templateObject39 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('orange-500')));
129
- }, function (props) {
130
- return (props.type === 'error-border' || props.type === 'error') && styled.css(_templateObject40 || (_templateObject40 = defaultTheme._taggedTemplateLiteral(["\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
131
- });
132
- var SuccessContainer = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject41 || (_templateObject41 = 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) {
133
- return props.fadeIn ? 0 : 1;
134
- }, function (props) {
135
- return props.fadeIn ? fadeOutCheck : fadeInCheck;
136
- }, function (props) {
137
- return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('gray-500'));
138
- });
139
- var ShowMoreText = styled__default['default'].div.attrs(defaultTheme.applyDefaultTheme)(_templateObject42 || (_templateObject42 = 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\n ", "\n transition: margin-top 550ms ease-in-out;\n -webkit-mask-image: linear-gradient(180deg, transparent 1px, white 5px);\n ", "\n\n ", ";\n\n ", "\n"])), function (props) {
140
- return props.expanded && styled.css(_templateObject43 || (_templateObject43 = defaultTheme._taggedTemplateLiteral(["\n margin-top: 0px;\n "])));
141
- }, function (props) {
142
- return props.theme.themeProp('background', props.theme.getColor('gray-900'), props.theme.getColor('white'));
143
- }, function (props) {
144
- return props.theme.themeProp('color', props.theme.getColor('gray-300'), props.theme.getColor('emerald-500'));
145
- }, function (props) {
146
- return props.type === 'error' && styled.css(_templateObject44 || (_templateObject44 = defaultTheme._taggedTemplateLiteral(["\n content: 'error';\n ", "\n "])), props.theme.themeProp('color', props.theme.getColor('red-200'), props.theme.getColor('red-500')));
147
- });
148
-
149
- var TextArea = React__default['default'].forwardRef(function TextArea(_ref, forwardedRef) {
150
- var value = _ref.value,
151
- defaultValue = _ref.defaultValue,
152
- name = _ref.name,
153
- label = _ref.label,
154
- placeholder = _ref.placeholder,
155
- required = _ref.required,
156
- disabled = _ref.disabled,
157
- hidden = _ref.hidden,
158
- readOnly = _ref.readOnly,
159
- edit = _ref.edit,
160
- showMore = _ref.showMore,
161
- showMoreText = _ref.showMoreText,
162
- showLessText = _ref.showLessText,
163
- autoComplete = _ref.autoComplete,
164
- description = _ref.description,
165
- type = _ref.type,
166
- icon = _ref.icon,
167
- rows = _ref.rows,
168
- className = _ref.className,
169
- style = _ref.style,
170
- _onChange = _ref.onChange,
171
- onBlur = _ref.onBlur,
172
- lightBackground = _ref.lightBackground,
173
- noBorder = _ref.noBorder,
174
- instructionsTextArea = _ref.instructionsTextArea,
175
- isExpanded = _ref.isExpanded,
176
- 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"]);
177
-
178
- var textInputDomNode = React.useRef(null);
179
- var textInputRef = useMergedRefs.useMergedRefs(forwardedRef, textInputDomNode);
180
-
181
- var _useState = React.useState(!(value || defaultValue)),
182
- _useState2 = defaultTheme._slicedToArray(_useState, 2),
183
- inputIsEmpty = _useState2[0],
184
- setInputIsEmpty = _useState2[1];
185
-
186
- var _useState3 = React.useState(''),
187
- _useState4 = defaultTheme._slicedToArray(_useState3, 2),
188
- maxContentRows = _useState4[0],
189
- setMaxContentRows = _useState4[1];
190
-
191
- var _useState5 = React.useState(false),
192
- _useState6 = defaultTheme._slicedToArray(_useState5, 2),
193
- expanded = _useState6[0],
194
- setExpanded = _useState6[1];
195
-
196
- var _useState7 = React.useState(''),
197
- _useState8 = defaultTheme._slicedToArray(_useState7, 2),
198
- maxHeight = _useState8[0],
199
- setMaxHeight = _useState8[1];
200
-
201
- var _useState9 = React.useState(''),
202
- _useState10 = defaultTheme._slicedToArray(_useState9, 2),
203
- defaultHeight = _useState10[0],
204
- setDefaultHeight = _useState10[1];
205
-
206
- var _useState11 = React.useState(nanoid.nanoid()),
207
- _useState12 = defaultTheme._slicedToArray(_useState11, 1),
208
- uniqueId = _useState12[0];
209
-
210
- var handleTextAreaChange = function handleTextAreaChange() {
211
- setExpanded(!expanded);
212
- isExpanded(expanded);
213
- };
214
-
215
- var calculateRows = function calculateRows() {
216
- var textareaRefCurrent = textInputDomNode === null || textInputDomNode === void 0 ? void 0 : textInputDomNode.current;
217
-
218
- if (textareaRefCurrent !== null) {
219
- var textAreaHeight = textareaRefCurrent === null || textareaRefCurrent === void 0 ? void 0 : textareaRefCurrent.scrollHeight;
220
- var lineHeight = 16;
221
- var calculatedRows = Math.floor(textAreaHeight / lineHeight);
222
- var defaultRowsHeight = rows * lineHeight;
223
- setMaxContentRows(calculatedRows);
224
-
225
- if (calculatedRows > rows) {
226
- setDefaultHeight(defaultRowsHeight);
227
- setMaxHeight(textAreaHeight);
228
- } else {
229
- setMaxHeight();
230
- }
231
- }
232
- };
233
-
234
- React.useEffect(function () {
235
- calculateRows();
236
- }, [value, defaultValue]);
237
- var onKeyDown = React.useCallback(function (event) {
238
- if (event.key === 'Enter') {
239
- event.stopPropagation();
240
- }
241
- }, []);
242
- if (hidden) return null;
243
- return React__default['default'].createElement(TextInput, {
244
- disabled: disabled,
245
- readOnly: readOnly,
246
- type: type,
247
- className: className,
248
- style: style
249
- }, React__default['default'].createElement(TextInputFieldIconAlert, null, icon), React__default['default'].createElement(TextInputField, defaultTheme._extends({
250
- ref: textInputRef,
251
- rows: rows,
252
- expanded: expanded,
253
- defaultHeight: defaultHeight,
254
- maxHeight: maxHeight,
255
- value: value,
256
- defaultValue: defaultValue,
257
- name: name,
258
- placeholder: placeholder || ' ',
259
- required: required,
260
- readOnly: readOnly,
261
- disabled: disabled,
262
- edit: edit,
263
- instructionsTextArea: instructionsTextArea,
264
- showMore: showMore,
265
- type: type,
266
- autoComplete: autoComplete,
267
- hasIcon: Boolean(icon),
268
- icon: icon,
269
- id: "text-input-".concat(uniqueId),
270
- lightBackground: lightBackground,
271
- onChange: function onChange(e) {
272
- if (e.target.value) {
273
- setInputIsEmpty(false);
274
- } else {
275
- setInputIsEmpty(true);
276
- }
277
-
278
- _onChange(e);
279
- },
280
- onKeyDown: onKeyDown,
281
- onBlur: onBlur,
282
- noBorder: noBorder
283
- }, rest, {
284
- onClick: showMore ? handleTextAreaChange : undefined
285
- })), (type === 'loading' || type === 'success') && React__default['default'].createElement(SuccessContainer, null, type === 'loading' && React__default['default'].createElement(check._default, {
286
- color: '#b0b6b9',
287
- size: 12
288
- }), type === 'success' && React__default['default'].createElement(check.SvgCheck, null)), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
289
- disabled: disabled
290
- }, React__default['default'].createElement(editNote.SvgEditNote, null)), label && React__default['default'].createElement(TextInputLabel, {
291
- htmlFor: "text-input-".concat(uniqueId),
292
- hasPlaceholder: Boolean(placeholder),
293
- hasIcon: Boolean(icon),
294
- inputIsEmpty: inputIsEmpty
295
- }, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default['default'].createElement(Description, {
296
- type: type
297
- }, description), maxContentRows > rows && showMore && React__default['default'].createElement(ShowMoreText, {
298
- onClick: showMore ? handleTextAreaChange : undefined,
299
- expanded: expanded
300
- }, !expanded ? showMoreText : showLessText));
301
- });
302
- TextArea.defaultProps = {
303
- rows: 4,
304
- noBorder: false,
305
- readOnly: false,
306
- edit: false,
307
- hidden: false,
308
- showMore: false,
309
- showMoreText: '',
310
- showLessText: '',
311
- type: '',
312
- padding: 'medium',
313
- instructionsTextArea: false,
314
- isExpanded: function isExpanded() {}
315
- };
316
- TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
317
- value: defaultTheme.PropTypes.string,
318
- defaultValue: defaultTheme.PropTypes.string,
319
- name: defaultTheme.PropTypes.string,
320
- label: defaultTheme.PropTypes.string,
321
- placeholder: defaultTheme.PropTypes.string,
322
- required: defaultTheme.PropTypes.bool,
323
- disabled: defaultTheme.PropTypes.bool,
324
- hidden: defaultTheme.PropTypes.bool,
325
- readOnly: defaultTheme.PropTypes.bool,
326
- showMore: defaultTheme.PropTypes.bool,
327
- showMoreText: defaultTheme.PropTypes.string,
328
- showLessText: defaultTheme.PropTypes.string,
329
- edit: defaultTheme.PropTypes.bool,
330
- autoComplete: defaultTheme.PropTypes.string,
331
- description: defaultTheme.PropTypes.string,
332
- error: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.bool, defaultTheme.PropTypes.string]),
333
- warning: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.bool, defaultTheme.PropTypes.string]),
334
- icon: defaultTheme.PropTypes.element,
335
- rows: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.number, defaultTheme.PropTypes.string]),
336
- className: defaultTheme.PropTypes.string,
337
- style: defaultTheme.PropTypes.object,
338
- padding: defaultTheme.PropTypes.oneOf(['', 'small', 'medium', 'large']),
339
- lightBackground: defaultTheme.PropTypes.bool,
340
- onChange: defaultTheme.PropTypes.func,
341
- onBlur: defaultTheme.PropTypes.func,
342
- noBorder: defaultTheme.PropTypes.bool,
343
- isExpanded: defaultTheme.PropTypes.func,
344
- type: defaultTheme.PropTypes.oneOf(['', 'error', 'error-border', 'warning', 'loading', 'success']),
345
- instructionsTextArea: defaultTheme.PropTypes.bool
346
- } : {};
347
-
348
- exports.TextArea = TextArea;
package/check-555d831b.js DELETED
@@ -1,213 +0,0 @@
1
- 'use strict';
2
-
3
- var React$1 = require('react');
4
-
5
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React$1);
28
- var React__namespace = /*#__PURE__*/_interopNamespace(React$1);
29
-
30
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
31
-
32
- var MoonLoader$1 = {};
33
-
34
- var unitConverter = {};
35
-
36
- Object.defineProperty(unitConverter, "__esModule", { value: true });
37
- unitConverter.cssValue = unitConverter.parseLengthAndUnit = void 0;
38
- var cssUnit = {
39
- cm: true,
40
- mm: true,
41
- in: true,
42
- px: true,
43
- pt: true,
44
- pc: true,
45
- em: true,
46
- ex: true,
47
- ch: true,
48
- rem: true,
49
- vw: true,
50
- vh: true,
51
- vmin: true,
52
- vmax: true,
53
- "%": true,
54
- };
55
- /**
56
- * If size is a number, append px to the value as default unit.
57
- * If size is a string, validate against list of valid units.
58
- * If unit is valid, return size as is.
59
- * If unit is invalid, console warn issue, replace with px as the unit.
60
- *
61
- * @param {(number | string)} size
62
- * @return {LengthObject} LengthObject
63
- */
64
- function parseLengthAndUnit(size) {
65
- if (typeof size === "number") {
66
- return {
67
- value: size,
68
- unit: "px",
69
- };
70
- }
71
- var value;
72
- var valueString = (size.match(/^[0-9.]*/) || "").toString();
73
- if (valueString.includes(".")) {
74
- value = parseFloat(valueString);
75
- }
76
- else {
77
- value = parseInt(valueString, 10);
78
- }
79
- var unit = (size.match(/[^0-9]*$/) || "").toString();
80
- if (cssUnit[unit]) {
81
- return {
82
- value: value,
83
- unit: unit,
84
- };
85
- }
86
- console.warn("React Spinners: ".concat(size, " is not a valid css value. Defaulting to ").concat(value, "px."));
87
- return {
88
- value: value,
89
- unit: "px",
90
- };
91
- }
92
- unitConverter.parseLengthAndUnit = parseLengthAndUnit;
93
- /**
94
- * Take value as an input and return valid css value
95
- *
96
- * @param {(number | string)} value
97
- * @return {string} valid css value
98
- */
99
- function cssValue(value) {
100
- var lengthWithunit = parseLengthAndUnit(value);
101
- return "".concat(lengthWithunit.value).concat(lengthWithunit.unit);
102
- }
103
- unitConverter.cssValue = cssValue;
104
-
105
- var animation = {};
106
-
107
- Object.defineProperty(animation, "__esModule", { value: true });
108
- animation.createAnimation = void 0;
109
- var createAnimation = function (loaderName, frames, suffix) {
110
- var animationName = "react-spinners-".concat(loaderName, "-").concat(suffix);
111
- if (typeof window == "undefined" || !window.document) {
112
- return animationName;
113
- }
114
- var styleEl = document.createElement("style");
115
- document.head.appendChild(styleEl);
116
- var styleSheet = styleEl.sheet;
117
- var keyFrames = "\n @keyframes ".concat(animationName, " {\n ").concat(frames, "\n }\n ");
118
- if (styleSheet) {
119
- styleSheet.insertRule(keyFrames, 0);
120
- }
121
- return animationName;
122
- };
123
- animation.createAnimation = createAnimation;
124
-
125
- var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
126
- __assign = Object.assign || function(t) {
127
- for (var s, i = 1, n = arguments.length; i < n; i++) {
128
- s = arguments[i];
129
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
130
- t[p] = s[p];
131
- }
132
- return t;
133
- };
134
- return __assign.apply(this, arguments);
135
- };
136
- var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
137
- if (k2 === undefined) k2 = k;
138
- var desc = Object.getOwnPropertyDescriptor(m, k);
139
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
140
- desc = { enumerable: true, get: function() { return m[k]; } };
141
- }
142
- Object.defineProperty(o, k2, desc);
143
- }) : (function(o, m, k, k2) {
144
- if (k2 === undefined) k2 = k;
145
- o[k2] = m[k];
146
- }));
147
- var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
148
- Object.defineProperty(o, "default", { enumerable: true, value: v });
149
- }) : function(o, v) {
150
- o["default"] = v;
151
- });
152
- var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
153
- if (mod && mod.__esModule) return mod;
154
- var result = {};
155
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
156
- __setModuleDefault(result, mod);
157
- return result;
158
- };
159
- var __rest = (commonjsGlobal && commonjsGlobal.__rest) || function (s, e) {
160
- var t = {};
161
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
162
- t[p] = s[p];
163
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
164
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
165
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
166
- t[p[i]] = s[p[i]];
167
- }
168
- return t;
169
- };
170
- Object.defineProperty(MoonLoader$1, "__esModule", { value: true });
171
- var React = __importStar(React__default['default']);
172
- var unitConverter_1 = unitConverter;
173
- var animation_1 = animation;
174
- var moon = (0, animation_1.createAnimation)("MoonLoader", "100% {transform: rotate(360deg)}", "moon");
175
- function MoonLoader(_a) {
176
- var _b = _a.loading, loading = _b === void 0 ? true : _b, _c = _a.color, color = _c === void 0 ? "#000000" : _c, _d = _a.speedMultiplier, speedMultiplier = _d === void 0 ? 1 : _d, _e = _a.cssOverride, cssOverride = _e === void 0 ? {} : _e, _f = _a.size, size = _f === void 0 ? 60 : _f, additionalprops = __rest(_a, ["loading", "color", "speedMultiplier", "cssOverride", "size"]);
177
- var _g = (0, unitConverter_1.parseLengthAndUnit)(size), value = _g.value, unit = _g.unit;
178
- var moonSize = value / 7;
179
- var wrapper = __assign({ display: "inherit", position: "relative", width: "".concat("".concat(value + moonSize * 2).concat(unit)), height: "".concat("".concat(value + moonSize * 2).concat(unit)), animation: "".concat(moon, " ").concat(0.6 / speedMultiplier, "s 0s infinite linear"), animationFillMode: "forwards" }, cssOverride);
180
- var ballStyle = function (size) {
181
- return {
182
- width: (0, unitConverter_1.cssValue)(size),
183
- height: (0, unitConverter_1.cssValue)(size),
184
- borderRadius: "100%",
185
- };
186
- };
187
- var ball = __assign(__assign({}, ballStyle(moonSize)), { backgroundColor: "".concat(color), opacity: "0.8", position: "absolute", top: "".concat("".concat(value / 2 - moonSize / 2).concat(unit)), animation: "".concat(moon, " ").concat(0.6 / speedMultiplier, "s 0s infinite linear"), animationFillMode: "forwards" });
188
- var circle = __assign(__assign({}, ballStyle(value)), { border: "".concat(moonSize, "px solid ").concat(color), opacity: "0.1", boxSizing: "content-box", position: "absolute" });
189
- if (!loading) {
190
- return null;
191
- }
192
- return (React.createElement("span", __assign({ style: wrapper }, additionalprops),
193
- React.createElement("span", { style: ball }),
194
- React.createElement("span", { style: circle })));
195
- }
196
- var _default = MoonLoader$1.default = MoonLoader;
197
-
198
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
199
-
200
- var _ref = /*#__PURE__*/React__namespace.createElement("path", {
201
- fill: "currentColor",
202
- d: "M7.627 14.435l-5.69-5.69L0 10.67l7.627 7.627L24 1.924 22.076 0z"
203
- });
204
-
205
- function SvgCheck(props) {
206
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
207
- xmlns: "http://www.w3.org/2000/svg",
208
- viewBox: "0 0 24 18.297"
209
- }, props), _ref);
210
- }
211
-
212
- exports.SvgCheck = SvgCheck;
213
- exports._default = _default;