@ntbjs/react-components 2.0.2-rc.3 → 2.0.2-rc.5

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 (27) hide show
  1. package/build/inputs/ActionButton/ActionButton.js +5 -9
  2. package/build/inputs/ActionButton/ActionButton.js.map +1 -1
  3. package/build/inputs/ActionButton/ActionButton.styled.js +13 -16
  4. package/build/inputs/ActionButton/ActionButton.styled.js.map +1 -1
  5. package/build/inputs/CompactTextInput/CompactTextInput.js +71 -58
  6. package/build/inputs/CompactTextInput/CompactTextInput.js.map +1 -1
  7. package/build/inputs/CompactTextInput/CompactTextInput.styled.js +208 -133
  8. package/build/inputs/CompactTextInput/CompactTextInput.styled.js.map +1 -1
  9. package/build/inputs/MultiSelect/MultiSelect.js +94 -202
  10. package/build/inputs/MultiSelect/MultiSelect.js.map +1 -1
  11. package/build/inputs/MultiSelect/MultiSelect.styled.js +162 -68
  12. package/build/inputs/MultiSelect/MultiSelect.styled.js.map +1 -1
  13. package/build/inputs/TextArea/TextArea.js +77 -67
  14. package/build/inputs/TextArea/TextArea.js.map +1 -1
  15. package/build/inputs/TextArea/TextArea.styled.js +204 -171
  16. package/build/inputs/TextArea/TextArea.styled.js.map +1 -1
  17. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js +26 -20
  18. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.js.map +1 -1
  19. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js +15 -19
  20. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryCompactCard/AssetGalleryCompactCard.styled.js.map +1 -1
  21. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js +16 -18
  22. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.js.map +1 -1
  23. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js +34 -75
  24. package/build/widgets/AssetGallery/AssetGalleryBase/AssetGalleryGridCard/AssetGalleryGridCard.styled.js.map +1 -1
  25. package/build/widgets/Instructions/Instructions.js +9 -0
  26. package/build/widgets/Instructions/Instructions.js.map +1 -1
  27. package/package.json +3 -3
@@ -1,35 +1,22 @@
1
1
  import styled, { css } from 'styled-components';
2
2
  import { applyDefaultTheme } from '../../utils/defaultTheme.js';
3
3
  import { ReactComponent as SvgClose } from '../../icons/close.svg.js';
4
- import Select from 'react-select';
4
+ import Select, { components } from 'react-select';
5
5
  import CreatableSelect from 'react-select/creatable';
6
6
  import { withAsyncPaginate, AsyncPaginate } from 'react-select-async-paginate';
7
7
 
8
- const AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);
9
8
  const showMoreHeight = 114;
10
- const MultiSelectWrapper = styled.div`
9
+ const AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);
10
+ const sharedStyle = css`
11
+ font-family: ${props => props.theme.primaryFontFamily};
12
+ font-size: 12px;
13
+ font-weight: 400;
11
14
  position: relative;
12
- /* Targets internal container to ensure overlay is visible even if library tries to clip it */
13
- & [class*='ValueContainer'] {
14
- overflow: visible !important;
15
- }
16
- `;
17
- const Label = styled.label.attrs(applyDefaultTheme)`
18
- ${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
19
- font-size: 0.875rem;
20
- margin-bottom: 4px;
21
- display: block;
22
15
  `;
23
- const Control = styled.div`
24
- & > div {
25
- cursor: ${props => props.$readOnly ? 'default' : 'pointer'};
26
- }
16
+ const MultiSelectWrapper = styled.div.attrs(applyDefaultTheme)`
17
+ position: relative;
27
18
  `;
28
- const ValueContainer = styled.div.attrs(applyDefaultTheme)`
29
- display: flex;
30
- flex-wrap: wrap;
31
- gap: 8px;
32
- max-height: ${props => props.$showMore ? props.$error || props.$warning ? 'none' : `${showMoreHeight + 16}px` : 'none'};
19
+ const InnerWrapper = styled.div`
33
20
  ${props => (props.$error || props.$warning) && css`
34
21
  border: 1px solid;
35
22
  border-radius: 3px;
@@ -37,85 +24,192 @@ const ValueContainer = styled.div.attrs(applyDefaultTheme)`
37
24
  border-color: ${props.$error ? props.theme.getColor('red-500') : props.theme.getColor('orange-500')};
38
25
  `}
39
26
  `;
40
- const MultiValueWrapper = styled.div`
41
- margin: 0;
27
+ const Label = styled.label.attrs(applyDefaultTheme)`
28
+ ${props => props.theme.themeProp('color', props.theme.getColor('white'), props.theme.getColor('gray-700'))};
29
+ flex-basis: 33.33%;
30
+ font-size: 0.875rem;
31
+ line-height: 1rem;
32
+ cursor: pointer;
33
+ height: 19px;
34
+ display: flex;
35
+ align-items: center;
42
36
  `;
43
- const MultiValueRemoveIcon = styled(SvgClose)`
44
- width: 8px;
45
- stroke: white;
46
- stroke-width: 2px;
37
+ const MultiValue = styled(components.MultiValue).attrs(applyDefaultTheme)`
38
+ && {
39
+ border-radius: 3px;
40
+ margin: 0;
41
+ display: flex;
42
+ align-items: center;
43
+ border: none;
44
+
45
+ ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('gray-800'))}
46
+
47
+ ${props => props.isDisabled && css`
48
+ opacity: 0.6;
49
+ cursor: not-allowed !important;
50
+
51
+ & > * {
52
+ pointer-events: none;
53
+ cursor: not-allowed !important;
54
+ }
55
+ `}
56
+
57
+ ${props => props.isReadOnly && !props.isDisabled && css`
58
+ cursor: default !important;
59
+ `}
60
+
61
+
62
+ & > div:first-of-type {
63
+ font-size: 12px;
64
+ min-height: 26px;
65
+ display: flex;
66
+ align-items: center;
67
+ padding: ${props => props.isDisabled || props.isReadOnly ? '0 8px' : '0 3px 0 8px'};
68
+ color: ${props => props.theme.getColor('gray-100')};
69
+ cursor: ${props => props.isDisabled ? 'not-allowed' : props.isReadOnly ? 'default' : 'pointer'};
70
+ }
71
+
72
+ /* Target the Remove Button */
73
+ .multi-select__multi-value__remove,
74
+ & > div:last-of-type {
75
+ display: flex;
76
+ align-items: center;
77
+ padding: 0 8px 0 5px;
78
+ height: 26px;
79
+ width: fit-content;
80
+ cursor: pointer;
81
+ background-color: transparent;
82
+
83
+ ${props => !props.isDisabled && !props.isReadOnly && css`
84
+ &:hover {
85
+ background-color: ${props.theme.getColor('red-500')} !important;
86
+ border-radius: 0 3px 3px 0;
87
+ }
88
+ `}
89
+
90
+ svg {
91
+ stroke: white;
92
+ stroke-width: 2px;
93
+ width: 8px;
94
+ }
95
+ }
96
+ }
47
97
  `;
48
- const InputWrapper = styled.div.attrs(applyDefaultTheme)`
49
- min-width: 150px;
98
+ const MultiSelect = styled(Select)`
99
+ ${sharedStyle}
100
+ `;
101
+ const CreatableMultiSelect = styled(CreatableSelect)`
102
+ ${sharedStyle}
103
+ `;
104
+ const AsyncMultiSelect = styled(AsyncPaginate)`
105
+ ${sharedStyle}
106
+ `;
107
+ const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate)`
108
+ ${sharedStyle}
109
+ `;
110
+ const InputWrapper = styled.div`
50
111
  position: relative;
51
- ${props => !props.$focused && props.$editText && css`
52
- &::before {
112
+ display: flex;
113
+ align-items: center;
114
+ min-width: 150px;
115
+
116
+ input {
117
+ color: ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))} !important;
118
+ font-size: ${props => props.$focused ? '14px' : '12px'} !important;
119
+ }
120
+
121
+ ${props => !props.$focused && css`
122
+ &:before {
53
123
  content: '${props.$editText}';
54
- color: ${p => p.theme.getColor('gray-400')};
55
- font-size: 12px;
56
124
  position: absolute;
57
- top: 50%;
58
- transform: translateY(-50%);
125
+ left: 2px;
126
+ color: ${props.theme.themeProp('color', props.theme.getColor('gray-400'), props.theme.getColor('gray-500'))};
59
127
  pointer-events: none;
128
+ font-size: 12px;
60
129
  }
61
130
  `}
62
- input {
63
- color: ${props => props.theme.themeProp(props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))} !important;
131
+
132
+ ${props => props.isDisabled && css`
133
+ opacity: 0.5;
134
+ cursor: not-allowed;
135
+ pointer-events: none;
136
+ `};
137
+ `;
138
+ const DropdownMenu = styled(components.Menu).attrs(applyDefaultTheme)`
139
+ font-size: 14px;
140
+
141
+ ${props => props.theme.themeProp('background-color', props.theme.getColor('gray-600'), props.theme.getColor('white'))}
142
+
143
+ ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
144
+ `;
145
+ const sharedOptionStyle = css`
146
+ ${props => props.isFocused && css`
147
+ ${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
148
+ `}
149
+
150
+ ${props => props.isSelected && css`
151
+ ${props.theme.themeProp('background-color', 'transparent', 'transparent')}
152
+
153
+ ${props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
154
+ `}
155
+
156
+ ${props => props.isFocused && props.isSelected && css`
157
+ ${props.theme.themeProp('background-color', props.theme.getColor('gray-500'), props.theme.getColor('gray-200'))}
158
+ `}
159
+
160
+ :hover {
161
+ cursor: pointer;
64
162
  }
65
163
  `;
66
- const OptionContent = styled.div`
67
- display: flex;
164
+ const Option = styled(components.Option).attrs(applyDefaultTheme)`
165
+ ${sharedOptionStyle}
166
+ padding: 8px 12px;
167
+ `;
168
+ const SelectedOption = styled(components.Option).attrs(applyDefaultTheme)`
169
+ ${sharedOptionStyle}
170
+ display: flex !important;
68
171
  justify-content: space-between;
69
172
  align-items: center;
70
173
  padding: 8px 12px;
71
- width: 100%;
72
- font-size: 14px;
73
- color: inherit;
74
- `;
75
- styled.div`
76
- [class*='menu'] {
77
- z-index: 9999 !important;
78
- border-radius: 4px;
79
- }
80
174
  `;
81
175
  const DropdownOptionDeleteIcon = styled(SvgClose).attrs(applyDefaultTheme)`
176
+ stroke-width: 1px;
82
177
  width: 8px;
83
- stroke: ${props => props.theme.themeProp(props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))};
178
+ ${props => props.theme.themeProp('stroke', props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))}
84
179
  `;
85
180
  const ShowMoreWrapper = styled.div.attrs(applyDefaultTheme)`
181
+ align-items: end;
182
+ display: flex;
183
+ flex-direction: column;
184
+ height: 100%;
185
+ left: 0;
86
186
  position: absolute;
187
+ max-height: ${showMoreHeight + 16}px;
87
188
  top: 0;
88
- left: 0;
89
189
  width: 100%;
90
- height: 100%;
91
- display: flex;
92
- flex-direction: column;
93
- justify-content: flex-end;
94
- z-index: 50;
95
- color: ${props => props.theme.themeProp(props.theme.getColor('gray-100'), props.theme.getColor('emerald-500'))};
190
+ z-index: 2;
191
+ cursor: pointer;
192
+ color: ${props => props.theme.themeProp('color', props.theme.getColor('gray-100'), props.theme.getColor('emerald-500'))};
96
193
  &:hover {
97
- cursor: pointer;
98
194
  text-decoration: underline;
99
195
  }
100
196
  `;
101
197
  const ShowMoreOverlay = styled.div.attrs(applyDefaultTheme)`
102
- flex: 1;
103
- background: ${props => props.theme.themeProp('linear-gradient(180deg, #12121200 0%, #121212 100%)', 'linear-gradient(180deg, #fefefe00 0%, #fefefe 100%)')};
198
+ height: 100%;
199
+ max-height: ${showMoreHeight}px;
200
+ ${props => props.theme.themeProp('background', 'transparent linear-gradient(180deg, #12121200 0%, #12121230 40%, #12121279 70%, #121212 95%, #121212 100%) 0% 0% no-repeat padding-box', 'transparent linear-gradient(180deg, #fefefe00 0%, #fefefe30 40%, #fefefe79 70%, #fefefe 95%, #fefefe 100%) 0% 0% no-repeat padding-box')}
104
201
  `;
105
202
  const ShowMoreText = styled.div.attrs(applyDefaultTheme)`
106
- background-color: ${props => props.theme.themeProp('#121212', '#fefefe')};
107
- text-align: right;
108
203
  font-size: 0.875rem;
204
+ width: 100%;
205
+ background-color: ${props => props.theme.themeProp('background-color', '#121212', '#fefefe')};
109
206
  `;
110
207
  const ErrorMessage = styled.div.attrs(applyDefaultTheme)`
111
- color: ${props => props.$error ? props.theme.getColor('red-500') : props.theme.getColor('orange-500')};
208
+ color: ${props => props.$error ? props.theme.getColor('red-500') : props.$warning ? props.theme.getColor('orange-500') : 'inherit'};
112
209
  font-size: 0.75rem;
113
210
  margin-top: 8px;
211
+ padding: 0 12px;
114
212
  `;
115
- const MultiSelect = styled(Select).attrs(applyDefaultTheme)``;
116
- const CreatableMultiSelect = styled(CreatableSelect).attrs(applyDefaultTheme)``;
117
- const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate).attrs(applyDefaultTheme)``;
118
- const AsyncMultiSelect = styled(AsyncPaginate).attrs(applyDefaultTheme)``;
119
213
 
120
- export { AsyncCreatableMultiSelect, AsyncMultiSelect, Control, CreatableMultiSelect, DropdownOptionDeleteIcon, ErrorMessage, InputWrapper, Label, MultiSelect, MultiSelectWrapper, MultiValueRemoveIcon, MultiValueWrapper, OptionContent, ShowMoreOverlay, ShowMoreText, ShowMoreWrapper, ValueContainer };
214
+ export { AsyncCreatableMultiSelect, AsyncMultiSelect, CreatableMultiSelect, DropdownMenu, DropdownOptionDeleteIcon, ErrorMessage, InnerWrapper, InputWrapper, Label, MultiSelect, MultiSelectWrapper, MultiValue, Option, SelectedOption, ShowMoreOverlay, ShowMoreText, ShowMoreWrapper };
121
215
  //# sourceMappingURL=MultiSelect.styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.styled.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\nimport Select from 'react-select';\nimport CreatableSelect from 'react-select/creatable';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\n\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\nconst showMoreHeight = 114;\n\nexport const MultiSelectWrapper = styled.div`\n position: relative;\n /* Targets internal container to ensure overlay is visible even if library tries to clip it */\n & [class*='ValueContainer'] {\n overflow: visible !important;\n }\n`;\n\nexport const Label = styled.label.attrs(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n font-size: 0.875rem;\n margin-bottom: 4px;\n display: block;\n`;\n\nexport const Control = styled.div`\n & > div {\n cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};\n }\n`;\n\nexport const ValueContainer = styled.div.attrs(applyDefaultTheme)`\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n max-height: ${props =>\n props.$showMore\n ? props.$error || props.$warning\n ? 'none'\n : `${showMoreHeight + 16}px`\n : 'none'};\n ${props =>\n (props.$error || props.$warning) &&\n css`\n border: 1px solid;\n border-radius: 3px;\n padding: 4px;\n border-color: ${props.$error\n ? props.theme.getColor('red-500')\n : props.theme.getColor('orange-500')};\n `}\n`;\n\nexport const MultiValueWrapper = styled.div`\n margin: 0;\n`;\n\nexport const MultiValueRemoveIcon = styled(CloseIcon)`\n width: 8px;\n stroke: white;\n stroke-width: 2px;\n`;\n\nexport const InputWrapper = styled.div.attrs(applyDefaultTheme)`\n min-width: 150px;\n position: relative;\n ${props =>\n !props.$focused &&\n props.$editText &&\n css`\n &::before {\n content: '${props.$editText}';\n color: ${p => p.theme.getColor('gray-400')};\n font-size: 12px;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n }\n `}\n input {\n color: ${props =>\n props.theme.themeProp(\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )} !important;\n }\n`;\n\nexport const OptionContent = styled.div`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n width: 100%;\n font-size: 14px;\n color: inherit;\n`;\n\nexport const DropdownMenu = styled.div`\n [class*='menu'] {\n z-index: 9999 !important;\n border-radius: 4px;\n }\n`;\n\nexport const DropdownOptionDeleteIcon = styled(CloseIcon).attrs(applyDefaultTheme)`\n width: 8px;\n stroke: ${props =>\n props.theme.themeProp(props.theme.getColor('gray-100'), props.theme.getColor('gray-900'))};\n`;\n\nexport const ShowMoreWrapper = styled.div.attrs(applyDefaultTheme)`\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n flex-direction: column;\n justify-content: flex-end;\n z-index: 50;\n color: ${props =>\n props.theme.themeProp(props.theme.getColor('gray-100'), props.theme.getColor('emerald-500'))};\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n }\n`;\n\nexport const ShowMoreOverlay = styled.div.attrs(applyDefaultTheme)`\n flex: 1;\n background: ${props =>\n props.theme.themeProp(\n 'linear-gradient(180deg, #12121200 0%, #121212 100%)',\n 'linear-gradient(180deg, #fefefe00 0%, #fefefe 100%)'\n )};\n`;\n\nexport const ShowMoreText = styled.div.attrs(applyDefaultTheme)`\n background-color: ${props => props.theme.themeProp('#121212', '#fefefe')};\n text-align: right;\n font-size: 0.875rem;\n`;\n\nexport const ErrorMessage = styled.div.attrs(applyDefaultTheme)`\n color: ${props =>\n props.$error ? props.theme.getColor('red-500') : props.theme.getColor('orange-500')};\n font-size: 0.75rem;\n margin-top: 8px;\n`;\n\nexport const MultiSelect = styled(Select).attrs(applyDefaultTheme)``;\nexport const CreatableMultiSelect = styled(CreatableSelect).attrs(applyDefaultTheme)``;\nexport const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate).attrs(\n applyDefaultTheme\n)``;\nexport const AsyncMultiSelect = styled(AsyncPaginate).attrs(applyDefaultTheme)``;\n"],"names":["AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","showMoreHeight","MultiSelectWrapper","styled","div","Label","label","attrs","applyDefaultTheme","props","theme","themeProp","getColor","Control","$readOnly","ValueContainer","$showMore","$error","$warning","css","MultiValueWrapper","MultiValueRemoveIcon","CloseIcon","InputWrapper","$focused","$editText","p","OptionContent","DropdownOptionDeleteIcon","ShowMoreWrapper","ShowMoreOverlay","ShowMoreText","ErrorMessage","MultiSelect","Select","CreatableMultiSelect","AsyncCreatableMultiS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C,MAAM,CAACH,eAAe,CAAC,CAACO,KAAK,CAACC,iBAAiB,CAAC,CAAE,EAAA;AACzE4B,MAAAA,yBAAyB,GAAGjC,MAAM,CAACL,4BAA4B,CAAC,CAACS,KAAK,CACjFC,iBACF,CAAC,CAAE,EAAA;AACU6B,MAAAA,gBAAgB,GAAGlC,MAAM,CAACmC,aAAa,CAAC,CAAC/B,KAAK,CAACC,iBAAiB,CAAC,CAAE;;;;"}
1
+ {"version":3,"file":"MultiSelect.styled.js","sources":["../../../src/components/inputs/MultiSelect/MultiSelect.styled.js"],"sourcesContent":["import styled, { css } from 'styled-components';\nimport { applyDefaultTheme } from '../../../utils/defaultTheme';\nimport { ReactComponent as CloseIcon } from '../../../icons/close.svg';\nimport { components } from 'react-select';\nimport Select from 'react-select';\nimport CreatableSelect from 'react-select/creatable';\nimport { AsyncPaginate, withAsyncPaginate } from 'react-select-async-paginate';\n\nconst showMoreHeight = 114;\nconst AsyncCreatableSelectPaginate = withAsyncPaginate(CreatableSelect);\n\nconst sharedStyle = css`\n font-family: ${props => props.theme.primaryFontFamily};\n font-size: 12px;\n font-weight: 400;\n position: relative;\n`;\n\nexport const MultiSelectWrapper = styled.div.attrs(applyDefaultTheme)`\n position: relative;\n`;\n\nexport const InnerWrapper = styled.div`\n ${props =>\n (props.$error || props.$warning) &&\n css`\n border: 1px solid;\n border-radius: 3px;\n padding: 4px;\n border-color: ${props.$error\n ? props.theme.getColor('red-500')\n : props.theme.getColor('orange-500')};\n `}\n`;\n\nexport const Label = styled.label.attrs(applyDefaultTheme)`\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('white'),\n props.theme.getColor('gray-700')\n )};\n flex-basis: 33.33%;\n font-size: 0.875rem;\n line-height: 1rem;\n cursor: pointer;\n height: 19px;\n display: flex;\n align-items: center;\n`;\n\nexport const MultiValue = styled(components.MultiValue).attrs(applyDefaultTheme)`\n && {\n border-radius: 3px;\n margin: 0;\n display: flex;\n align-items: center;\n border: none;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('gray-800')\n )}\n\n ${props =>\n props.isDisabled &&\n css`\n opacity: 0.6;\n cursor: not-allowed !important;\n\n & > * {\n pointer-events: none;\n cursor: not-allowed !important;\n }\n `}\n\n ${props =>\n props.isReadOnly &&\n !props.isDisabled &&\n css`\n cursor: default !important;\n `}\n\n \n & > div:first-of-type {\n font-size: 12px;\n min-height: 26px;\n display: flex;\n align-items: center;\n padding: ${props => (props.isDisabled || props.isReadOnly ? '0 8px' : '0 3px 0 8px')};\n color: ${props => props.theme.getColor('gray-100')};\n cursor: ${props =>\n props.isDisabled ? 'not-allowed' : props.isReadOnly ? 'default' : 'pointer'};\n }\n\n /* Target the Remove Button */\n .multi-select__multi-value__remove,\n & > div:last-of-type {\n display: flex;\n align-items: center;\n padding: 0 8px 0 5px;\n height: 26px;\n width: fit-content;\n cursor: pointer;\n background-color: transparent;\n\n ${props =>\n !props.isDisabled &&\n !props.isReadOnly &&\n css`\n &:hover {\n background-color: ${props.theme.getColor('red-500')} !important;\n border-radius: 0 3px 3px 0;\n }\n `}\n\n svg {\n stroke: white;\n stroke-width: 2px;\n width: 8px;\n }\n }\n }\n`;\n\nexport const MultiSelect = styled(Select)`\n ${sharedStyle}\n`;\nexport const CreatableMultiSelect = styled(CreatableSelect)`\n ${sharedStyle}\n`;\nexport const AsyncMultiSelect = styled(AsyncPaginate)`\n ${sharedStyle}\n`;\nexport const AsyncCreatableMultiSelect = styled(AsyncCreatableSelectPaginate)`\n ${sharedStyle}\n`;\n\nexport const InputWrapper = styled.div`\n position: relative;\n display: flex;\n align-items: center;\n min-width: 150px;\n\n input {\n color: ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )} !important;\n font-size: ${props => (props.$focused ? '14px' : '12px')} !important;\n }\n\n ${props =>\n !props.$focused &&\n css`\n &:before {\n content: '${props.$editText}';\n position: absolute;\n left: 2px;\n color: ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-400'),\n props.theme.getColor('gray-500')\n )};\n pointer-events: none;\n font-size: 12px;\n }\n `}\n\n ${props =>\n props.isDisabled &&\n css`\n opacity: 0.5;\n cursor: not-allowed;\n pointer-events: none;\n `};\n`;\n\n/* MultiSelect.styled.js */\n\n/* MultiSelect.styled.js */\n\nexport const DropdownMenu = styled(components.Menu).attrs(applyDefaultTheme)`\n font-size: 14px;\n\n ${props =>\n props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-600'),\n props.theme.getColor('white')\n )}\n\n ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )}\n`;\n\nconst sharedOptionStyle = css`\n ${props =>\n props.isFocused &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n\n ${props =>\n props.isSelected &&\n css`\n ${props.theme.themeProp('background-color', 'transparent', 'transparent')}\n\n ${props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )}\n `}\n\n ${props =>\n props.isFocused &&\n props.isSelected &&\n css`\n ${props.theme.themeProp(\n 'background-color',\n props.theme.getColor('gray-500'),\n props.theme.getColor('gray-200')\n )}\n `}\n\n :hover {\n cursor: pointer;\n }\n`;\n\nexport const Option = styled(components.Option).attrs(applyDefaultTheme)`\n ${sharedOptionStyle}\n padding: 8px 12px;\n`;\n\nexport const SelectedOption = styled(components.Option).attrs(applyDefaultTheme)`\n ${sharedOptionStyle}\n display: flex !important;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n`;\n\nexport const DropdownOptionDeleteIcon = styled(CloseIcon).attrs(applyDefaultTheme)`\n stroke-width: 1px;\n width: 8px;\n ${props =>\n props.theme.themeProp(\n 'stroke',\n props.theme.getColor('gray-100'),\n props.theme.getColor('gray-900')\n )}\n`;\n\nexport const ShowMoreWrapper = styled.div.attrs(applyDefaultTheme)`\n align-items: end;\n display: flex;\n flex-direction: column;\n height: 100%;\n left: 0;\n position: absolute;\n max-height: ${showMoreHeight + 16}px;\n top: 0;\n width: 100%;\n z-index: 2;\n cursor: pointer;\n color: ${props =>\n props.theme.themeProp(\n 'color',\n props.theme.getColor('gray-100'),\n props.theme.getColor('emerald-500')\n )};\n &:hover {\n text-decoration: underline;\n }\n`;\n\nexport const ShowMoreOverlay = styled.div.attrs(applyDefaultTheme)`\n height: 100%;\n max-height: ${showMoreHeight}px;\n ${props =>\n props.theme.themeProp(\n 'background',\n 'transparent linear-gradient(180deg, #12121200 0%, #12121230 40%, #12121279 70%, #121212 95%, #121212 100%) 0% 0% no-repeat padding-box',\n 'transparent linear-gradient(180deg, #fefefe00 0%, #fefefe30 40%, #fefefe79 70%, #fefefe 95%, #fefefe 100%) 0% 0% no-repeat padding-box'\n )}\n`;\n\nexport const ShowMoreText = styled.div.attrs(applyDefaultTheme)`\n font-size: 0.875rem;\n width: 100%;\n background-color: ${props => props.theme.themeProp('background-color', '#121212', '#fefefe')};\n`;\n\nexport const ErrorMessage = styled.div.attrs(applyDefaultTheme)`\n color: ${props =>\n props.$error\n ? props.theme.getColor('red-500')\n : props.$warning\n ? props.theme.getColor('orange-500')\n : 'inherit'};\n font-size: 0.75rem;\n margin-top: 8px;\n padding: 0 12px;\n`;\n"],"names":["showMoreHeight","AsyncCreatableSelectPaginate","withAsyncPaginate","CreatableSelect","sharedStyle","css","props","theme","primaryFontFamily","MultiSelectWrapper","styled","div","attrs","applyDefaultTheme","InnerWrapper","$error","$warning","getColor","Label","label","themeProp","MultiValue","components","isDisabled","isReadOnly","MultiSelect","Select","CreatableMultiSelect","AsyncMultiSelect","AsyncPaginate","AsyncCreatableMultiSelect","InputWrapper","$focused","$editText","DropdownMenu","Menu","sharedOptionStyle","isFocused","isSelected","Option","SelectedOption","DropdownOptionDeleteIcon","CloseIcon","ShowMoreWrapper","ShowMoreOverlay","ShowMoreText","ErrorMessage"],"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AU,CAAC,EAChCX,KAAK,CAACC,KAAK,CAACU,QAAQ,CAAC,aAAa,CACpC,CAAC,CAAA;AACL;AACA;AACA;AACA,EAAC;AAEM,MAAM2B,eAAe,GAAGlC,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAClE;AACA,cAAA,EAAgBb,cAAc,CAAA;AAC9B,EAAA,EAAIM,KAAK,IACLA,KAAK,CAACC,KAAK,CAACa,SAAS,CACnB,YAAY,EACZ,wIAAwI,EACxI,wIACF,CAAC,CAAA;AACL,EAAC;AAEM,MAAMyB,YAAY,GAAGnC,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC/D;AACA;AACA,oBAAA,EAAsBP,KAAK,IAAIA,KAAK,CAACC,KAAK,CAACa,SAAS,CAAC,kBAAkB,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;AAC9F,EAAC;AAEM,MAAM0B,YAAY,GAAGpC,MAAM,CAACC,GAAG,CAACC,KAAK,CAACC,iBAAiB,CAAC,CAAA;AAC/D,SAAA,EAAWP,KAAK,IACZA,KAAK,CAACS,MAAM,GACRT,KAAK,CAACC,KAAK,CAACU,QAAQ,CAAC,SAAS,CAAC,GAC/BX,KAAK,CAACU,QAAQ,GACZV,KAAK,CAACC,KAAK,CAACU,QAAQ,CAAC,YAAY,CAAC,GAClC,SAAS,CAAA;AACnB;AACA;AACA;AACA;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import React__default, { useRef, useState, useEffect, useCallback, useMemo, memo } from 'react';
2
+ import React__default, { useRef, useState, useMemo, useEffect, useCallback } from 'react';
3
3
  import { isEmpty } from 'lodash';
4
4
  import useMergedRefs from '@restart/hooks/useMergedRefs';
5
5
  import { nanoid } from 'nanoid';
@@ -12,7 +12,7 @@ import '../../data/Tabs/Tabs.js';
12
12
  import Tooltip from '../../data/Tooltip/Tooltip.js';
13
13
  import '../../data/VerificationStatusIcon/VerificationStatusIcon.js';
14
14
  import { ReactComponent as SvgEditNote } from '../../icons/edit-note.svg.js';
15
- import { TextInputField, TextAreaContainter, Label, SuccessContainerLabel, TextInput, TextInputFieldIconAlert, SuccessContainer, InputIconContainer, TextInputLabel, Description } from './TextArea.styled.js';
15
+ import { TextAreaContainter, Label, SuccessContainerLabel, TextInput, TextInputFieldIconAlert, TextInputField, SuccessContainer, InputIconContainer, TextInputLabel, Description } from './TextArea.styled.js';
16
16
 
17
17
  const TextArea = React__default.forwardRef(function TextArea({
18
18
  value,
@@ -46,77 +46,89 @@ const TextArea = React__default.forwardRef(function TextArea({
46
46
  const textInputDomNode = useRef(null);
47
47
  const textInputRef = useMergedRefs(forwardedRef, textInputDomNode);
48
48
  const [inputIsEmpty, setInputIsEmpty] = useState(!(value || defaultValue));
49
- const [uniqueId] = useState(() => nanoid());
49
+ const [autoFocus, setAutoFocus] = useState(false);
50
+ const [uniqueId] = useState(nanoid());
51
+ const memoizedDescriptionToolTip = useMemo(() => {
52
+ return descriptionToolTip;
53
+ }, [descriptionToolTip]);
50
54
  useEffect(() => {
51
- setInputIsEmpty(!(value || defaultValue));
55
+ setAutoFocus(false);
52
56
  }, [value, defaultValue]);
53
57
  const onKeyDown = useCallback(event => {
54
58
  if (event.key === 'Enter') {
55
59
  event.stopPropagation();
56
60
  }
57
61
  }, []);
58
- const handleChange = useCallback(e => {
59
- setInputIsEmpty(!e.target.value);
60
- onChange(e);
61
- }, [onChange]);
62
- const textAreaElement = useMemo(() => React__default.createElement(TextInputField, _extends({
63
- ref: textInputRef,
64
- rows: rows,
65
- value: value,
66
- defaultValue: defaultValue,
67
- name: name,
68
- placeholder: placeholder,
69
- required: required,
70
- readOnly: readOnly,
71
- disabled: disabled,
72
- $edit: edit,
73
- $type: type,
74
- autoComplete: autoComplete,
75
- $hasIcon: Boolean(icon),
76
- id: `text-input-${uniqueId}`,
77
- $padding: padding,
78
- $borderRadius: borderRadius,
79
- $noBorder: noBorder,
80
- onChange: handleChange,
81
- onKeyDown: onKeyDown,
82
- onBlur: onBlur
83
- }, rest)), [textInputRef, rows, value, defaultValue, name, placeholder, required, readOnly, disabled, edit, type, autoComplete, icon, uniqueId, padding, borderRadius, noBorder, handleChange, onKeyDown, onBlur, rest]);
84
- const wrappedInput = useMemo(() => React__default.createElement(TextAreaContainter, null, fieldLabel && React__default.createElement(Label, {
85
- htmlFor: uniqueId,
86
- $disabled: disabled
87
- }, fieldLabel, React__default.createElement(SuccessContainerLabel, {
88
- $type: type
89
- }, type === 'loading' && loadingIcon, type === 'success' && successIcon)), React__default.createElement(TextInput, {
90
- $fieldLabel: !isEmpty(fieldLabel),
91
- disabled: disabled,
92
- readOnly: readOnly,
93
- $type: type,
94
- className: className,
95
- style: style
96
- }, icon && React__default.createElement(TextInputFieldIconAlert, {
97
- $type: type
98
- }, icon), textAreaElement, !fieldLabel && (type === 'loading' || type === 'success') && React__default.createElement(SuccessContainer, {
99
- $type: type
100
- }, type === 'loading' && loadingIcon, type === 'success' && successIcon), !readOnly && noBorder && React__default.createElement(InputIconContainer, {
101
- $disabled: disabled
102
- }, React__default.createElement(SvgEditNote, {
103
- className: padding === 'small' ? 'smallPadingIcon' : undefined
104
- })), label && React__default.createElement(TextInputLabel, {
105
- htmlFor: `text-input-${uniqueId}`,
106
- $hasPlaceholder: Boolean(placeholder),
107
- $hasIcon: Boolean(icon),
108
- $inputIsEmpty: inputIsEmpty
109
- }, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default.createElement(Description, {
110
- $type: type
111
- }, description))), [fieldLabel, uniqueId, disabled, type, loadingIcon, successIcon, icon, textAreaElement, readOnly, noBorder, padding, label, placeholder, inputIsEmpty, required, description, className, style]);
62
+ const input = () => {
63
+ return React__default.createElement(TextAreaContainter, null, fieldLabel && React__default.createElement(Label, {
64
+ htmlFor: uniqueId,
65
+ disabled: disabled
66
+ }, fieldLabel, React__default.createElement(SuccessContainerLabel, null, type === 'loading' && loadingIcon, type === 'success' && successIcon)), React__default.createElement(TextInput, {
67
+ $fieldLabel: !isEmpty(fieldLabel),
68
+ disabled: disabled,
69
+ readOnly: readOnly,
70
+ $type: type,
71
+ className: className,
72
+ style: style
73
+ }, React__default.createElement(TextInputFieldIconAlert, {
74
+ $type: type
75
+ }, icon), React__default.createElement(TextInputField, _extends({
76
+ autoFocus: autoFocus,
77
+ $borderRadius: borderRadius,
78
+ ref: textInputRef,
79
+ rows: rows,
80
+ value: value,
81
+ defaultValue: defaultValue,
82
+ name: name,
83
+ placeholder: placeholder || ' ',
84
+ required: required,
85
+ readOnly: readOnly,
86
+ disabled: disabled,
87
+ $edit: edit,
88
+ $type: type,
89
+ autoComplete: autoComplete,
90
+ $hasIcon: Boolean(icon),
91
+ id: `text-input-${uniqueId}`,
92
+ key: uniqueId,
93
+ $padding: padding,
94
+ onChange: e => {
95
+ if (e.target.value) {
96
+ setInputIsEmpty(false);
97
+ if (!autoFocus) {
98
+ setAutoFocus(true);
99
+ }
100
+ } else {
101
+ setInputIsEmpty(true);
102
+ if (!autoFocus) {
103
+ setAutoFocus(true);
104
+ }
105
+ }
106
+ onChange(e);
107
+ },
108
+ onKeyDown: onKeyDown,
109
+ onBlur: onBlur,
110
+ $noBorder: noBorder
111
+ }, rest)), !fieldLabel && (type === 'loading' || type === 'success') && React__default.createElement(SuccessContainer, null, type === 'loading' && loadingIcon, type === 'success' && successIcon), !readOnly && (edit || noBorder) && React__default.createElement(InputIconContainer, {
112
+ disabled: disabled
113
+ }, React__default.createElement(SvgEditNote, {
114
+ className: padding === 'small' ? 'smallPadingIcon' : undefined
115
+ })), label && React__default.createElement(TextInputLabel, {
116
+ htmlFor: `text-input-${uniqueId}`,
117
+ $hasPlaceholder: Boolean(placeholder),
118
+ $hasIcon: Boolean(icon),
119
+ $inputIsEmpty: inputIsEmpty
120
+ }, label, required && ' *'), typeof description === 'string' && description.length > 0 && React__default.createElement(Description, {
121
+ $type: type
122
+ }, description)));
123
+ };
112
124
  if (hidden) return null;
113
- return React__default.createElement(Tooltip, {
114
- content: descriptionToolTip || '',
125
+ return React__default.createElement(React__default.Fragment, null, !memoizedDescriptionToolTip && input(), memoizedDescriptionToolTip && React__default.createElement("div", null, React__default.createElement(Tooltip, {
126
+ content: memoizedDescriptionToolTip,
127
+ key: "tooltipTextArea1",
115
128
  placement: "bottom-end",
116
- trigger: "mouseenter",
117
- zIndex: 999999,
118
- disabled: !descriptionToolTip
119
- }, wrappedInput);
129
+ trigger: 'mouseenter',
130
+ zIndex: 999999
131
+ }, input())));
120
132
  });
121
133
  TextArea.defaultProps = {
122
134
  rows: 4,
@@ -152,14 +164,12 @@ TextArea.propTypes = process.env.NODE_ENV !== "production" ? {
152
164
  onChange: PropTypes.func,
153
165
  onBlur: PropTypes.func,
154
166
  noBorder: PropTypes.bool,
155
- isExpanded: PropTypes.func,
156
167
  type: PropTypes.oneOf(['', 'error', 'error-border', 'warning-border', 'warning', 'loading', 'success']),
157
168
  loadingIcon: PropTypes.element,
158
169
  successIcon: PropTypes.element,
159
170
  descriptionToolTip: PropTypes.string,
160
171
  borderRadius: PropTypes.number
161
172
  } : {};
162
- var TextArea$1 = memo(TextArea);
163
173
 
164
- export { TextArea$1 as default };
174
+ export { TextArea as default };
165
175
  //# sourceMappingURL=TextArea.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sources":["../../../src/components/inputs/TextArea/TextArea.js"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState, useMemo, memo } from 'react';\nimport { isEmpty } from 'lodash';\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nimport { nanoid } from 'nanoid';\nimport PropTypes from 'prop-types';\nimport { Tooltip } from '../../data';\n\nimport { ReactComponent as EditNoteIcon } from '../../../icons/edit-note.svg';\nimport * as S from './TextArea.styled';\n\n/**\n * Text areas let users enter and edit text in the UI. They typically appear in forms and dialogs.\n *\n * ### Import\n *\n * ``` js\n * import { TextArea } from '@ntbjs/react-components/inputs'\n * // or\n * import TextArea from '@ntbjs/react-components/inputs/TextArea'\n * ```\n */\nconst TextArea = React.forwardRef(function TextArea(\n {\n value,\n defaultValue,\n name,\n label,\n placeholder,\n required,\n disabled,\n hidden,\n readOnly,\n edit,\n autoComplete,\n description,\n type,\n icon,\n rows,\n className,\n style,\n onChange,\n onBlur,\n noBorder,\n loadingIcon,\n successIcon,\n padding,\n descriptionToolTip,\n borderRadius,\n fieldLabel,\n ...rest\n },\n forwardedRef\n) {\n const textInputDomNode = useRef(null);\n const textInputRef = useMergedRefs(forwardedRef, textInputDomNode);\n\n const [inputIsEmpty, setInputIsEmpty] = useState(!(value || defaultValue));\n const [uniqueId] = useState(() => nanoid());\n\n useEffect(() => {\n setInputIsEmpty(!(value || defaultValue));\n }, [value, defaultValue]);\n\n const onKeyDown = useCallback(event => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n }\n }, []);\n\n const handleChange = useCallback(\n e => {\n setInputIsEmpty(!e.target.value);\n onChange(e);\n },\n [onChange]\n );\n\n const textAreaElement = useMemo(\n () => (\n <S.TextInputField\n ref={textInputRef}\n rows={rows}\n value={value}\n defaultValue={defaultValue}\n name={name}\n placeholder={placeholder}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n $edit={edit}\n $type={type}\n autoComplete={autoComplete}\n $hasIcon={Boolean(icon)}\n id={`text-input-${uniqueId}`}\n $padding={padding}\n $borderRadius={borderRadius}\n $noBorder={noBorder}\n onChange={handleChange}\n onKeyDown={onKeyDown}\n onBlur={onBlur}\n {...rest}\n />\n ),\n [\n textInputRef,\n rows,\n value,\n defaultValue,\n name,\n placeholder,\n required,\n readOnly,\n disabled,\n edit,\n type,\n autoComplete,\n icon,\n uniqueId,\n padding,\n borderRadius,\n noBorder,\n handleChange,\n onKeyDown,\n onBlur,\n rest\n ]\n );\n\n const wrappedInput = useMemo(\n () => (\n <S.TextAreaContainter>\n {fieldLabel && (\n <S.Label htmlFor={uniqueId} $disabled={disabled}>\n {fieldLabel}\n <S.SuccessContainerLabel $type={type}>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainerLabel>\n </S.Label>\n )}\n <S.TextInput\n $fieldLabel={!isEmpty(fieldLabel)}\n disabled={disabled}\n readOnly={readOnly}\n $type={type}\n className={className}\n style={style}\n >\n {icon && <S.TextInputFieldIconAlert $type={type}>{icon}</S.TextInputFieldIconAlert>}\n {textAreaElement}\n {!fieldLabel && (type === 'loading' || type === 'success') && (\n <S.SuccessContainer $type={type}>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n )}\n {!readOnly && noBorder && (\n <S.InputIconContainer $disabled={disabled}>\n <EditNoteIcon className={padding === 'small' ? 'smallPadingIcon' : undefined} />\n </S.InputIconContainer>\n )}\n {label && (\n <S.TextInputLabel\n htmlFor={`text-input-${uniqueId}`}\n $hasPlaceholder={Boolean(placeholder)}\n $hasIcon={Boolean(icon)}\n $inputIsEmpty={inputIsEmpty}\n >\n {label}\n {required && ' *'}\n </S.TextInputLabel>\n )}\n {typeof description === 'string' && description.length > 0 && (\n <S.Description $type={type}>{description}</S.Description>\n )}\n </S.TextInput>\n </S.TextAreaContainter>\n ),\n [\n fieldLabel,\n uniqueId,\n disabled,\n type,\n loadingIcon,\n successIcon,\n icon,\n textAreaElement,\n readOnly,\n noBorder,\n padding,\n label,\n placeholder,\n inputIsEmpty,\n required,\n description,\n className,\n style\n ]\n );\n\n if (hidden) return null;\n\n return (\n <Tooltip\n content={descriptionToolTip || ''}\n placement=\"bottom-end\"\n trigger=\"mouseenter\"\n zIndex={999999}\n disabled={!descriptionToolTip}\n >\n {wrappedInput}\n </Tooltip>\n );\n});\n\nTextArea.defaultProps = {\n rows: 4,\n noBorder: false,\n readOnly: false,\n edit: false,\n hidden: false,\n type: '',\n padding: 'medium',\n descriptionToolTip: '',\n onChange: () => {},\n borderRadius: 0\n};\n\nTextArea.propTypes = {\n /**\n * Value to be sent. Typically the content of the text area.\n */\n value: PropTypes.string,\n\n /**\n * Default value/text to be displayed in the text area by default.\n */\n defaultValue: PropTypes.string,\n\n /**\n * Name of the text area (used when sending form data)\n */\n name: PropTypes.string,\n\n /**\n * Label text for the text area. If the text area is empty (no input and no placeholder)\n * and isn't in focus, the label text will be displayed grayed out in the text area itself.\n * Otherwise, the label text will be displayed in the top left corner.\n */\n label: PropTypes.string,\n\n /**\n * Field Label text for the text area field. I\n */\n fieldLabel: PropTypes.string,\n\n /**\n * Placeholder text to be displayed if the text area is empty (no input)\n */\n placeholder: PropTypes.string,\n\n /**\n * Whether the user is required to fill in the text area\n */\n required: PropTypes.bool,\n\n /**\n * Whether the text area is disabled\n */\n disabled: PropTypes.bool,\n /**\n * Whether the component is hidden or visible.\n */\n hidden: PropTypes.bool,\n /**\n * Whether the text area is read-only\n */\n readOnly: PropTypes.bool,\n /**\n * Displays a grey background to show that value is editable\n */\n edit: PropTypes.bool,\n /**\n * ?\n */\n autoComplete: PropTypes.string,\n /**\n * Descriptive text displayed below the text area\n */\n description: PropTypes.string,\n\n /**\n * Optional icon to be displayed left of the text inside the text area\n */\n icon: PropTypes.element,\n /**\n * How many rows/lines of text to be displayed by default\n */\n rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * Add custom class names to the HTML element\n */\n className: PropTypes.string,\n /**\n * Add custom CSS styling\n */\n style: PropTypes.object,\n /**\n * Add padding (small-medium-large)\n */\n padding: PropTypes.oneOf(['small', 'medium', 'large']),\n /**\n * Optional callback function for the `onChange` event\n */\n onChange: PropTypes.func,\n /**\n * Optional callback function for the `onBlur` event\n */\n onBlur: PropTypes.func,\n noBorder: PropTypes.bool,\n // warningAlert: PropTypes.bool,\n // errorAlert: PropTypes.bool,\n isExpanded: PropTypes.func,\n /**\n * Define the type based on error,error-border , warning, loading and success.\n */\n type: PropTypes.oneOf([\n '',\n 'error',\n 'error-border',\n 'warning-border',\n 'warning',\n 'loading',\n 'success'\n ]),\n /**\n * Icon element – E.g: `icon={<Spinner />}`\n */\n loadingIcon: PropTypes.element,\n /**\n * Icon element – E.g: `icon={<Check />}`\n */\n successIcon: PropTypes.element,\n /**\n * Description ToolTip text.\n */\n descriptionToolTip: PropTypes.string,\n /**\n * Border Radius for rounded borders.\n */\n borderRadius: PropTypes.number\n};\n\nexport default memo(TextArea);\n"],"names":["TextArea","React","forwardRef","value","defaultValue","name","label","placeholder","required","disabled","hidden","readOnly","edit","autoComplete","description","type","icon","rows","className","style","onChange","onBlur","noBorder","loadingIcon","successIcon","padding","descriptionToolTip","borderRadius","fieldLabel","rest","forwardedRef","textInputDomNode","useRef","textInputRef","useMergedRefs","inputIsEmpty","setInputIsEmpty","useState","uniqueId","nanoid","useEffect","onKeyDown","useCallback","event","key","stopPropagation","handleChange","e","target","textAreaElement","useMemo","createElement","S","_extends","ref","$edit","$type","$hasIcon","Boolean","id","$padding","$borderRadius","$noBorder","wrappedInput","htmlFor","$disabled","$fieldLabel","isEmpty","EditNoteIcon","undefined","$hasPlaceholder","$inputIsEmpty","length","Tooltip","content","placement","trigger","zIndex","defaultProps","propTypes","process","env","NODE_ENV","PropTypes","string","bool","element","oneOfType","number","object","oneOf","func","isExpanded","memo"],"mappings":";;;;;;;;;;;;;;;;AAqBA,MAAMA,QAAQ,GAAGC,cAAK,CAACC,UAAU,CAAC,SAASF,QAAQA,CACjD;EACEG,KAAK;EACLC,YAAY;EACZC,IAAI;EACJC,KAAK;EACLC,WAAW;EACXC,QAAQ;EACRC,QAAQ;EACRC,MAAM;EACNC,QAAQ;EACRC,IAAI;EACJC,YAAY;EACZC,WAAW;EACXC,IAAI;EACJC,IAAI;EACJC,IAAI;EACJC,SAAS;EACTC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,QAAQ;EACRC,WAAW;EACXC,WAAW;EACXC,OAAO;EACPC,kBAAkB;EAClBC,YAAY;EACZC,UAAU;EACV,GAAGC,IAAAA;AACL,CAAC,EACDC,YAAY,EACZ;AACA,EAAA,MAAMC,gBAAgB,GAAGC,MAAM,CAAC,IAAI,CAAC,CAAA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EACT,SAAS,EACT,SAAS,CACV,CAAC;EAIFnE,WAAW,EAAE4D,SAAS,CAACG,OAAO;EAI9B9D,WAAW,EAAE2D,SAAS,CAACG,OAAO;EAI9B5D,kBAAkB,EAAEyD,SAAS,CAACC,MAAM;EAIpCzD,YAAY,EAAEwD,SAAS,CAACK,MAAAA;AAC1B,CAAC,GAAA,EAAA,CAAA;AAED,iBAAeK,IAAI,CAAC7F,QAAQ,CAAC;;;;"}
1
+ {"version":3,"file":"TextArea.js","sources":["../../../src/components/inputs/TextArea/TextArea.js"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState, useMemo } from 'react';\n\nimport { isEmpty } from 'lodash';\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nimport { nanoid } from 'nanoid';\nimport PropTypes from 'prop-types';\nimport { Tooltip } from '../../data';\n\nimport { ReactComponent as EditNoteIcon } from '../../../icons/edit-note.svg';\nimport * as S from './TextArea.styled';\n\n/**\n * Text areas let users enter and edit text in the UI. They typically appear in forms and dialogs.\n *\n * ### Import\n *\n * ``` js\n * import { TextArea } from '@ntbjs/react-components/inputs'\n * // or\n * import TextArea from '@ntbjs/react-components/inputs/TextArea'\n * ```\n */\nconst TextArea = React.forwardRef(function TextArea(\n {\n value,\n defaultValue,\n name,\n label,\n placeholder,\n required,\n disabled,\n hidden,\n readOnly,\n edit,\n autoComplete,\n description,\n type,\n icon,\n rows,\n className,\n style,\n onChange,\n onBlur,\n noBorder,\n loadingIcon,\n successIcon,\n padding,\n descriptionToolTip,\n borderRadius,\n fieldLabel,\n ...rest\n },\n forwardedRef\n) {\n const textInputDomNode = useRef(null);\n const textInputRef = useMergedRefs(forwardedRef, textInputDomNode);\n\n const [inputIsEmpty, setInputIsEmpty] = useState(!(value || defaultValue));\n const [autoFocus, setAutoFocus] = useState(false);\n\n const [uniqueId] = useState(nanoid());\n\n const memoizedDescriptionToolTip = useMemo(() => {\n return descriptionToolTip;\n }, [descriptionToolTip]);\n\n useEffect(() => {\n setAutoFocus(false);\n }, [value, defaultValue]);\n\n const onKeyDown = useCallback(event => {\n if (event.key === 'Enter') {\n event.stopPropagation();\n }\n }, []);\n\n const input = () => {\n return (\n <S.TextAreaContainter>\n {fieldLabel && (\n <S.Label htmlFor={uniqueId} disabled={disabled}>\n {fieldLabel}\n <S.SuccessContainerLabel>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainerLabel>\n </S.Label>\n )}\n <S.TextInput\n $fieldLabel={!isEmpty(fieldLabel)}\n disabled={disabled}\n readOnly={readOnly}\n $type={type}\n className={className}\n style={style}\n >\n <S.TextInputFieldIconAlert $type={type}>{icon}</S.TextInputFieldIconAlert>\n <S.TextInputField\n autoFocus={autoFocus}\n $borderRadius={borderRadius}\n ref={textInputRef}\n rows={rows}\n value={value}\n defaultValue={defaultValue}\n name={name}\n placeholder={placeholder || ' '}\n required={required}\n readOnly={readOnly}\n disabled={disabled}\n $edit={edit}\n $type={type}\n autoComplete={autoComplete}\n $hasIcon={Boolean(icon)}\n id={`text-input-${uniqueId}`}\n key={uniqueId}\n $padding={padding}\n onChange={e => {\n if (e.target.value) {\n setInputIsEmpty(false);\n if (!autoFocus) {\n setAutoFocus(true);\n }\n } else {\n setInputIsEmpty(true);\n if (!autoFocus) {\n setAutoFocus(true);\n }\n }\n onChange(e);\n }}\n onKeyDown={onKeyDown}\n onBlur={onBlur}\n $noBorder={noBorder}\n {...rest}\n />\n {!fieldLabel && (type === 'loading' || type === 'success') && (\n <S.SuccessContainer>\n {type === 'loading' && loadingIcon}\n {type === 'success' && successIcon}\n </S.SuccessContainer>\n )}\n {!readOnly && (edit || noBorder) && (\n <S.InputIconContainer disabled={disabled}>\n <EditNoteIcon className={padding === 'small' ? 'smallPadingIcon' : undefined} />\n </S.InputIconContainer>\n )}\n {label && (\n <S.TextInputLabel\n htmlFor={`text-input-${uniqueId}`}\n $hasPlaceholder={Boolean(placeholder)}\n $hasIcon={Boolean(icon)}\n $inputIsEmpty={inputIsEmpty}\n >\n {label}\n {required && ' *'}\n </S.TextInputLabel>\n )}\n {typeof description === 'string' && description.length > 0 && (\n <S.Description $type={type}>{description}</S.Description>\n )}\n </S.TextInput>\n </S.TextAreaContainter>\n );\n };\n\n if (hidden) return null;\n\n return (\n <>\n {!memoizedDescriptionToolTip && input()}\n {memoizedDescriptionToolTip && (\n <div>\n <Tooltip\n content={memoizedDescriptionToolTip}\n key=\"tooltipTextArea1\"\n placement=\"bottom-end\"\n trigger={'mouseenter'}\n zIndex={999999}\n >\n {input()}\n </Tooltip>\n </div>\n )}\n </>\n );\n});\n\nTextArea.defaultProps = {\n rows: 4,\n noBorder: false,\n readOnly: false,\n edit: false,\n hidden: false,\n type: '',\n padding: 'medium',\n descriptionToolTip: '',\n onChange: () => {},\n borderRadius: 0\n};\n\nTextArea.propTypes = {\n /**\n * Value to be sent. Typically the content of the text area.\n */\n value: PropTypes.string,\n\n /**\n * Default value/text to be displayed in the text area by default.\n */\n defaultValue: PropTypes.string,\n\n /**\n * Name of the text area (used when sending form data)\n */\n name: PropTypes.string,\n\n /**\n * Label text for the text area. If the text area is empty (no input and no placeholder)\n * and isn't in focus, the label text will be displayed grayed out in the text area itself.\n * Otherwise, the label text will be displayed in the top left corner.\n */\n label: PropTypes.string,\n\n /**\n * Field Label text for the text area field. I\n */\n fieldLabel: PropTypes.string,\n\n /**\n * Placeholder text to be displayed if the text area is empty (no input)\n */\n placeholder: PropTypes.string,\n\n /**\n * Whether the user is required to fill in the text area\n */\n required: PropTypes.bool,\n\n /**\n * Whether the text area is disabled\n */\n disabled: PropTypes.bool,\n /**\n * Whether the component is hidden or visible.\n */\n hidden: PropTypes.bool,\n /**\n * Whether the text area is read-only\n */\n readOnly: PropTypes.bool,\n /**\n * Displays a grey background to show that value is editable\n */\n edit: PropTypes.bool,\n /**\n * ?\n */\n autoComplete: PropTypes.string,\n /**\n * Descriptive text displayed below the text area\n */\n description: PropTypes.string,\n\n /**\n * Optional icon to be displayed left of the text inside the text area\n */\n icon: PropTypes.element,\n /**\n * How many rows/lines of text to be displayed by default\n */\n rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * Add custom class names to the HTML element\n */\n className: PropTypes.string,\n /**\n * Add custom CSS styling\n */\n style: PropTypes.object,\n /**\n * Add padding (small-medium-large)\n */\n padding: PropTypes.oneOf(['small', 'medium', 'large']),\n /**\n * Optional callback function for the `onChange` event\n */\n onChange: PropTypes.func,\n /**\n * Optional callback function for the `onBlur` event\n */\n onBlur: PropTypes.func,\n noBorder: PropTypes.bool,\n // warningAlert: PropTypes.bool,\n // errorAlert: PropTypes.bool,\n /**\n * Define the type based on error,error-border , warning, loading and success.\n */\n type: PropTypes.oneOf([\n '',\n 'error',\n 'error-border',\n 'warning-border',\n 'warning',\n 'loading',\n 'success'\n ]),\n /**\n * Icon element â€\" E.g: `icon={<Spinner />}`\n */\n loadingIcon: PropTypes.element,\n /**\n * Icon element â€\" E.g: `icon={<Check />}`\n */\n successIcon: PropTypes.element,\n /**\n * Description ToolTip text.\n */\n descriptionToolTip: PropTypes.string,\n /**\n * Border Radius for rounded borders.\n */\n borderRadius: PropTypes.number\n};\n\nexport default TextArea;\n"],"names":["TextArea","React","forwardRef","value","defaultValue","name","label","placeholder","required","disabled","hidden","readOnly","edit","autoComplete","description","type","icon","rows","className","style","onChange","onBlur","noBorder","loadingIcon","successIcon","padding","descriptionToolTip","borderRadius","fieldLabel","rest","forwardedRef","textInputDomNode","useRef","textInputRef","useMergedRefs","inputIsEmpty","setInputIsEmpty","useState","autoFocus","setAutoFocus","uniqueId","nanoid","memoizedDescriptionToolTip","useMemo","useEffect","onKeyDown","useCallback","event","key","stopPropagation","input","createElement","S","htmlFor","$fieldLabel","isEmpty","$type","_extends","$borderRadius","ref","$edit","$hasIcon","Boolean","id","$padding","e","target","$noBorder","EditNoteIcon","undefined","$hasPlaceholder","$inputIsEmpty","length","Fragment","Tooltip","content","placement","trigger","zIndex","defaultProps","propTypes","process","env","NODE_ENV","PropTypes","string","b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