@ntbjs/react-components 1.2.0-rc.9 → 1.2.0-rc.90

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 (68) hide show
  1. package/{ActionButton-06df3d6c.js → ActionButton-a9316775.js} +20 -13
  2. package/{Alert-13b75102.js → Alert-d69a3f95.js} +20 -24
  3. package/{AssetGallery-9871f7fe.js → AssetGallery-7871c106.js} +421 -501
  4. package/{AssetPreviewTopBar-c28715f7.js → AssetPreviewTopBar-c9e45035.js} +32 -31
  5. package/{Badge-aec841c8.js → Badge-cbbff6b8.js} +28 -49
  6. package/{Button-353f5bbc.js → Button-39607724.js} +53 -65
  7. package/{Checkbox-68dc38a8.js → Checkbox-ad9c9e54.js} +30 -35
  8. package/{CompactAutocompleteSelect-e99629df.js → CompactAutocompleteSelect-00d39020.js} +155 -154
  9. package/{CompactStarRating-5dc2131c.js → CompactStarRating-bbe8800b.js} +132 -109
  10. package/{CompactTextInput-e1a0090e.js → CompactTextInput-72224756.js} +111 -105
  11. package/{ContextMenu-4ec3d9f3.js → ContextMenu-4eb8fdc5.js} +6 -6
  12. package/{ContextMenuItem-1fe17ed5.js → ContextMenuItem-c536b460.js} +23 -27
  13. package/{InputGroup-49fbc423.js → InputGroup-a89a0ea3.js} +6 -6
  14. package/{Instructions-a30c53bc.js → Instructions-474a4220.js} +78 -80
  15. package/{MultiLevelCheckboxSelect-418de626.js → MultiLevelCheckboxSelect-654c291b.js} +127 -219
  16. package/{MultiSelect-4b8d3d0d.js → MultiSelect-149a817b.js} +72 -102
  17. package/{Popover-6afb3779.js → Popover-c5e425a7.js} +45 -21
  18. package/{Radio-32d0513a.js → Radio-55db4781.js} +21 -22
  19. package/{SectionSeparator-259a22ed.js → SectionSeparator-af8dc1ce.js} +6 -6
  20. package/{Switch-4a41585f.js → Switch-04ecd8d0.js} +25 -27
  21. package/{Tab-f499ecbc.js → Tab-e43241f0.js} +7 -7
  22. package/{Tabs-c2261e7e.js → Tabs-21e0079f.js} +64 -66
  23. package/TextArea-c2620d92.js +414 -0
  24. package/{TextInput-0d109708.js → TextInput-9a995449.js} +41 -48
  25. package/{Tooltip-6b6f0b0a.js → Tooltip-a68a7e49.js} +14 -14
  26. package/VerificationStatusIcon-3bae6e2f.js +108 -0
  27. package/{close-ebf2f3cf.js → close-1751121a.js} +8 -12
  28. package/data/Alert/index.js +2 -2
  29. package/data/Badge/index.js +2 -2
  30. package/data/Popover/index.js +4 -3
  31. package/data/Tab/index.js +2 -2
  32. package/data/Tabs/index.js +3 -3
  33. package/data/Tooltip/index.js +3 -3
  34. package/data/index.js +10 -9
  35. package/{defaultTheme-ea44e34a.js → defaultTheme-cd01e6c2.js} +212 -260
  36. package/edit-note-cefe2215.js +37 -0
  37. package/{expand-more-94585605.js → expand-more-d74e2bd2.js} +8 -12
  38. package/inputs/ActionButton/index.js +2 -2
  39. package/inputs/Button/index.js +7 -6
  40. package/inputs/Checkbox/index.js +2 -2
  41. package/inputs/CompactAutocompleteSelect/index.js +16 -6
  42. package/inputs/CompactStarRating/index.js +14 -3
  43. package/inputs/CompactTextInput/index.js +12 -12
  44. package/inputs/MultiSelect/index.js +4 -4
  45. package/inputs/Radio/index.js +2 -2
  46. package/inputs/Switch/index.js +2 -2
  47. package/inputs/TextArea/index.js +15 -4
  48. package/inputs/TextInput/index.js +3 -3
  49. package/inputs/index.js +29 -29
  50. package/layout/InputGroup/index.js +2 -2
  51. package/layout/SectionSeparator/index.js +2 -2
  52. package/layout/index.js +3 -3
  53. package/package.json +4 -3
  54. package/{react-select-creatable.esm-2f23d6c6.js → react-select-creatable.esm-66ca61dc.js} +1470 -1272
  55. package/{shift-away-subtle-0bed9a3c.js → shift-away-subtle-631cd794.js} +1 -1
  56. package/ssr/index.js +1 -3
  57. package/{warning-circle-24522402.js → warning-circle-478e65cc.js} +8 -12
  58. package/widgets/AssetGallery/index.js +32 -32
  59. package/widgets/AssetPreview/AssetPreviewTopBar/index.js +3 -3
  60. package/widgets/ContextMenu/ContextMenuItem/index.js +2 -2
  61. package/widgets/ContextMenu/ContextMenuItemsGroup/index.js +6 -6
  62. package/widgets/ContextMenu/index.js +2 -2
  63. package/widgets/Instructions/index.js +20 -10
  64. package/widgets/index.js +34 -34
  65. package/TextArea-852a461d.js +0 -353
  66. package/VerificationStatusIcon-b574fd21.js +0 -106
  67. package/check-555d831b.js +0 -213
  68. package/edit-note-c47d292e.js +0 -41
@@ -1,353 +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(true);
212
- isExpanded(true);
213
- };
214
-
215
- var handleTextAreaShowLess = function handleTextAreaShowLess() {
216
- setExpanded(!expanded);
217
- isExpanded(!expanded);
218
- };
219
-
220
- var calculateRows = function calculateRows() {
221
- var textareaRefCurrent = textInputDomNode === null || textInputDomNode === void 0 ? void 0 : textInputDomNode.current;
222
-
223
- if (textareaRefCurrent !== null) {
224
- var textAreaHeight = textareaRefCurrent === null || textareaRefCurrent === void 0 ? void 0 : textareaRefCurrent.scrollHeight;
225
- var lineHeight = 16;
226
- var calculatedRows = Math.floor(textAreaHeight / lineHeight);
227
- var defaultRowsHeight = rows * lineHeight;
228
- setMaxContentRows(calculatedRows);
229
-
230
- if (calculatedRows > rows) {
231
- setDefaultHeight(defaultRowsHeight);
232
- setMaxHeight(textAreaHeight);
233
- } else {
234
- setMaxHeight();
235
- }
236
- }
237
- };
238
-
239
- React.useEffect(function () {
240
- calculateRows();
241
- }, [value, defaultValue]);
242
- var onKeyDown = React.useCallback(function (event) {
243
- if (event.key === 'Enter') {
244
- event.stopPropagation();
245
- }
246
- }, []);
247
- if (hidden) return null;
248
- return React__default['default'].createElement(TextInput, {
249
- disabled: disabled,
250
- readOnly: readOnly,
251
- type: type,
252
- className: className,
253
- style: style
254
- }, React__default['default'].createElement(TextInputFieldIconAlert, null, icon), React__default['default'].createElement(TextInputField, defaultTheme._extends({
255
- ref: textInputRef,
256
- rows: rows,
257
- expanded: expanded,
258
- defaultHeight: defaultHeight,
259
- maxHeight: maxHeight,
260
- value: value,
261
- defaultValue: defaultValue,
262
- name: name,
263
- placeholder: placeholder || ' ',
264
- required: required,
265
- readOnly: readOnly,
266
- disabled: disabled,
267
- edit: edit,
268
- instructionsTextArea: instructionsTextArea,
269
- showMore: showMore,
270
- type: type,
271
- autoComplete: autoComplete,
272
- hasIcon: Boolean(icon),
273
- icon: icon,
274
- id: "text-input-".concat(uniqueId),
275
- lightBackground: lightBackground,
276
- onChange: function onChange(e) {
277
- if (e.target.value) {
278
- setInputIsEmpty(false);
279
- } else {
280
- setInputIsEmpty(true);
281
- }
282
-
283
- _onChange(e);
284
- },
285
- onKeyDown: onKeyDown,
286
- onBlur: onBlur,
287
- noBorder: noBorder
288
- }, rest, {
289
- onClick: showMore ? handleTextAreaChange : undefined
290
- })), (type === 'loading' || type === 'success') && React__default['default'].createElement(SuccessContainer, null, type === 'loading' && React__default['default'].createElement(check._default, {
291
- color: '#b0b6b9',
292
- size: 12
293
- }), type === 'success' && React__default['default'].createElement(check.SvgCheck, null)), !readOnly && noBorder && React__default['default'].createElement(InputIconContainer, {
294
- disabled: disabled
295
- }, React__default['default'].createElement(editNote.SvgEditNote, null)), label && React__default['default'].createElement(TextInputLabel, {
296
- htmlFor: "text-input-".concat(uniqueId),
297
- hasPlaceholder: Boolean(placeholder),
298
- hasIcon: Boolean(icon),
299
- inputIsEmpty: inputIsEmpty
300
- }, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default['default'].createElement(Description, {
301
- type: type
302
- }, description), maxContentRows > rows && showMore && React__default['default'].createElement(ShowMoreText, {
303
- onClick: showMore ? handleTextAreaShowLess : undefined,
304
- expanded: expanded
305
- }, !expanded ? showMoreText : showLessText));
306
- });
307
- TextArea.defaultProps = {
308
- rows: 4,
309
- noBorder: false,
310
- readOnly: false,
311
- edit: false,
312
- hidden: false,
313
- showMore: false,
314
- showMoreText: '',
315
- showLessText: '',
316
- type: '',
317
- padding: 'medium',
318
- instructionsTextArea: false,
319
- isExpanded: function isExpanded() {}
320
- };
321
- TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
322
- value: defaultTheme.PropTypes.string,
323
- defaultValue: defaultTheme.PropTypes.string,
324
- name: defaultTheme.PropTypes.string,
325
- label: defaultTheme.PropTypes.string,
326
- placeholder: defaultTheme.PropTypes.string,
327
- required: defaultTheme.PropTypes.bool,
328
- disabled: defaultTheme.PropTypes.bool,
329
- hidden: defaultTheme.PropTypes.bool,
330
- readOnly: defaultTheme.PropTypes.bool,
331
- showMore: defaultTheme.PropTypes.bool,
332
- showMoreText: defaultTheme.PropTypes.string,
333
- showLessText: defaultTheme.PropTypes.string,
334
- edit: defaultTheme.PropTypes.bool,
335
- autoComplete: defaultTheme.PropTypes.string,
336
- description: defaultTheme.PropTypes.string,
337
- error: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.bool, defaultTheme.PropTypes.string]),
338
- warning: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.bool, defaultTheme.PropTypes.string]),
339
- icon: defaultTheme.PropTypes.element,
340
- rows: defaultTheme.PropTypes.oneOfType([defaultTheme.PropTypes.number, defaultTheme.PropTypes.string]),
341
- className: defaultTheme.PropTypes.string,
342
- style: defaultTheme.PropTypes.object,
343
- padding: defaultTheme.PropTypes.oneOf(['', 'small', 'medium', 'large']),
344
- lightBackground: defaultTheme.PropTypes.bool,
345
- onChange: defaultTheme.PropTypes.func,
346
- onBlur: defaultTheme.PropTypes.func,
347
- noBorder: defaultTheme.PropTypes.bool,
348
- isExpanded: defaultTheme.PropTypes.func,
349
- type: defaultTheme.PropTypes.oneOf(['', 'error', 'error-border', 'warning', 'loading', 'success']),
350
- instructionsTextArea: defaultTheme.PropTypes.bool
351
- } : {};
352
-
353
- exports.TextArea = TextArea;
@@ -1,106 +0,0 @@
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;