@splunk/react-ui 5.2.0 → 5.4.0

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 (114) hide show
  1. package/Accordion.js +31 -31
  2. package/Avatar.js +64 -59
  3. package/Box.js +2 -1
  4. package/Breadcrumbs.js +66 -63
  5. package/ButtonSimple.js +52 -52
  6. package/CHANGELOG.md +47 -0
  7. package/Calendar.js +8 -4
  8. package/CardLayout.js +39 -36
  9. package/Checkbox.d.ts +2 -0
  10. package/Checkbox.js +350 -0
  11. package/Clickable.js +5 -6
  12. package/Code.js +451 -536
  13. package/CollapsiblePanel.js +184 -210
  14. package/Color.js +903 -1023
  15. package/ControlGroup.js +2 -1
  16. package/Date.js +123 -119
  17. package/DefinitionList.js +100 -77
  18. package/Dropdown.js +2 -2
  19. package/DualListbox.js +409 -353
  20. package/File.js +102 -99
  21. package/FormRows.js +13 -11
  22. package/JSONTree.js +679 -1391
  23. package/Link.js +7 -7
  24. package/MIGRATION.md +27 -0
  25. package/Markdown.js +171 -156
  26. package/Menu.js +107 -100
  27. package/Modal.js +3 -3
  28. package/Multiselect.js +2698 -2767
  29. package/Paginator.js +2 -1
  30. package/Popover.js +201 -196
  31. package/Resize.js +11 -8
  32. package/ResultsMenu.js +913 -1029
  33. package/ScreenReaderContent.js +86 -130
  34. package/Scroll.js +366 -424
  35. package/Search.js +131 -127
  36. package/Select.js +1741 -1831
  37. package/Slider.js +1 -1
  38. package/SlidingPanels.js +129 -127
  39. package/StepBar.js +123 -97
  40. package/Switch.js +214 -242
  41. package/TabBar.js +10 -10
  42. package/Table.js +1255 -1248
  43. package/Text.js +180 -206
  44. package/TextArea.js +596 -675
  45. package/Tooltip.js +144 -139
  46. package/Tree.js +638 -682
  47. package/package.json +15 -16
  48. package/tsconfig.check-docs.json +8 -0
  49. package/types/src/Avatar/docs/examples/Basic.d.ts +1 -1
  50. package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
  51. package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
  52. package/types/src/Breadcrumbs/Item.d.ts +1 -1
  53. package/types/src/ButtonSimple/mixin.d.ts +1 -1
  54. package/types/src/Checkbox/Checkbox.d.ts +90 -0
  55. package/types/src/Checkbox/docs/examples/Basic.d.ts +7 -0
  56. package/types/src/Checkbox/docs/examples/Disabled.d.ts +6 -0
  57. package/types/src/Checkbox/docs/examples/Error.d.ts +6 -0
  58. package/types/src/Checkbox/docs/examples/Uncontrolled.d.ts +7 -0
  59. package/types/src/Checkbox/index.d.ts +2 -0
  60. package/types/src/Code/Code.d.ts +4 -1
  61. package/types/src/Code/LineHighlights.d.ts +1 -0
  62. package/types/src/Code/LineNumbers.d.ts +2 -1
  63. package/types/src/Code/docs/examples/CustomizeContainer.d.ts +7 -0
  64. package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +3 -3
  65. package/types/src/Date/Date.d.ts +7 -1
  66. package/types/src/DefinitionList/DefinitionList.d.ts +7 -2
  67. package/types/src/DefinitionList/DefinitionListContext.d.ts +1 -1
  68. package/types/src/DefinitionList/docs/examples/StackedLayout.d.ts +6 -0
  69. package/types/src/DualListbox/DualListbox.d.ts +1 -1
  70. package/types/src/DualListbox/Label.d.ts +7 -7
  71. package/types/src/DualListbox/Listbox.d.ts +2 -2
  72. package/types/src/DualListbox/ListboxContext.d.ts +1 -1
  73. package/types/src/File/File.d.ts +7 -1
  74. package/types/src/JSONTree/JSONTreeItem.d.ts +5 -3
  75. package/types/src/JSONTree/renderTreeItems.d.ts +3 -2
  76. package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +2 -1
  77. package/types/src/Menu/docs/examples/Dimmed.d.ts +1 -1
  78. package/types/src/Menu/docs/examples/Disabled.d.ts +1 -0
  79. package/types/src/Modal/ModalContext.d.ts +1 -1
  80. package/types/src/Multiselect/Compact.d.ts +9 -3
  81. package/types/src/Multiselect/Multiselect.d.ts +7 -1
  82. package/types/src/Multiselect/Normal.d.ts +9 -3
  83. package/types/src/Number/utils.d.ts +1 -1
  84. package/types/src/Popover/getPlacement.d.ts +1 -1
  85. package/types/src/RadioList/Option.d.ts +1 -1
  86. package/types/src/RadioList/RadioListContext.d.ts +1 -1
  87. package/types/src/Search/Search.d.ts +5 -1
  88. package/types/src/StepBar/StepBar.d.ts +4 -1
  89. package/types/src/StepBar/StepBarContext.d.ts +1 -0
  90. package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
  91. package/types/src/Switch/Switch.d.ts +13 -1
  92. package/types/src/Switch/docs/examples/Basic.d.ts +2 -10
  93. package/types/src/Switch/docs/examples/Disabled.d.ts +2 -9
  94. package/types/src/TabBar/Tab.d.ts +3 -1
  95. package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
  96. package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
  97. package/types/src/TabLayout/Panel.d.ts +2 -0
  98. package/types/src/Table/ExpandButton.d.ts +1 -1
  99. package/types/src/Table/Head.d.ts +1 -1
  100. package/types/src/Table/Row.d.ts +1 -1
  101. package/types/src/Table/Table.d.ts +1 -0
  102. package/types/src/Tooltip/Tooltip.d.ts +14 -1
  103. package/types/src/Tree/TreeContext.d.ts +1 -1
  104. package/useControlled.js +61 -97
  105. package/usePrevious.js +30 -62
  106. package/useResizeObserver.js +95 -127
  107. package/NonInteractiveCheckbox.js +0 -101
  108. package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +0 -12
  109. package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +0 -22
  110. package/types/src/NonInteractiveCheckbox/index.d.ts +0 -1
  111. package/types/src/Switch/docs/examples/Error.d.ts +0 -6
  112. package/types/src/Text/IconOutlinedHide.d.ts +0 -3
  113. package/types/src/Text/IconOutlinedView.d.ts +0 -3
  114. /package/cypress/{tsconfig.cypress.json → tsconfig.check-cypress.json} +0 -0
package/TextArea.js CHANGED
@@ -1,105 +1,19 @@
1
1
  /******/ (() => {
2
2
  // webpackBootstrap
3
3
  /******/ "use strict";
4
- /******/ var e = {
5
- /***/ 3639:
6
- /***/ (e, r, t) => {
7
- // EXPORTS
8
- t.d(r, {
9
- default: () => /* reexport */ s
10
- });
11
- // UNUSED EXPORTS: isAllowedType, isPrimitive
12
- // EXTERNAL MODULE: external "react"
13
- var n = t(9497);
14
- // CONCATENATED MODULE: external "lodash/isEqual"
15
- const o = require("lodash/isEqual");
16
- // EXTERNAL MODULE: external "lodash/has"
17
- var a = t(5919);
18
- var i = t.n(a);
19
- // CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
20
- function l(e) {
21
- return e === null || e === undefined || typeof e === "boolean" || typeof e === "string" || typeof e === "number";
22
- }
23
- function u(e) {
24
- if (l(e)) {
25
- return true;
26
- }
27
- if (Array.isArray(e)) {
28
- return e.every(l);
29
- }
30
- return false;
31
- }
32
- /**
33
- * This is a private component not intended for use outside @splunk/react-ui
34
- *
35
- * A hook that accepts a default value (as used in an uncontrolled component)
36
- * and validates that actions that aren't valid in an uncontrolled component
37
- * such as updating the default value, combining default value with value, etc.
38
- * are not happening.
39
- *
40
- * Return the controlled state of the component.
41
- */ function c(e) {
42
- var r = e.componentProps, t = e.componentName, o = t === void 0 ? "this component" : t, a = e.defaultValuePropName, l = a === void 0 ? "defaultValue" : a, u = e.valuePropName, c = u === void 0 ? "value" : u;
43
- var s = (0, n.useRef)(i()(r, c));
44
- var d = (0, n.useRef)(r[l]);
45
- (0, n.useEffect)((function() {
46
- if (false) {}
47
- }), [ o, r, l, c ]);
48
- (0, n.useEffect)((function() {
49
- if (false) {}
50
- if (false) {}
51
- if (false) {}
52
- }), [ o, r, l, c ]);
53
- return s.current;
54
- }
55
- /* harmony default export */ const s = c;
56
- } // CONCATENATED MODULE: ./src/useControlled/index.ts
57
- /***/ ,
58
- /***/ 5919:
59
- /***/ e => {
60
- e.exports = require("lodash/has");
61
- /***/ },
62
- /***/ 9497:
63
- /***/ e => {
64
- e.exports = require("react");
65
- /***/
66
- /******/ }
67
- };
68
- /************************************************************************/
69
- /******/ // The module cache
70
- /******/ var r = {};
71
- /******/
72
- /******/ // The require function
73
- /******/ function t(n) {
74
- /******/ // Check if module is in cache
75
- /******/ var o = r[n];
76
- /******/ if (o !== undefined) {
77
- /******/ return o.exports;
78
- /******/ }
79
- /******/ // Create a new module (and put it into the cache)
80
- /******/ var a = r[n] = {
81
- /******/ // no module.id needed
82
- /******/ // no module.loaded needed
83
- /******/ exports: {}
84
- /******/ };
85
- /******/
86
- /******/ // Execute the module function
87
- /******/ e[n](a, a.exports, t);
88
- /******/
89
- /******/ // Return the exports of the module
90
- /******/ return a.exports;
91
- /******/ }
4
+ /******/ // The require scope
5
+ /******/ var e = {};
92
6
  /******/
93
7
  /************************************************************************/
94
8
  /******/ /* webpack/runtime/compat get default export */
95
9
  /******/ (() => {
96
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
97
- /******/ t.n = e => {
98
- /******/ var r = e && e.__esModule ?
99
- /******/ () => e["default"]
100
- /******/ : () => e
11
+ /******/ e.n = n => {
12
+ /******/ var r = n && n.__esModule ?
13
+ /******/ () => n["default"]
14
+ /******/ : () => n
101
15
  /******/;
102
- t.d(r, {
16
+ e.d(r, {
103
17
  a: r
104
18
  });
105
19
  /******/ return r;
@@ -109,12 +23,12 @@
109
23
  /******/ /* webpack/runtime/define property getters */
110
24
  /******/ (() => {
111
25
  /******/ // define getter functions for harmony exports
112
- /******/ t.d = (e, r) => {
113
- /******/ for (var n in r) {
114
- /******/ if (t.o(r, n) && !t.o(e, n)) {
115
- /******/ Object.defineProperty(e, n, {
26
+ /******/ e.d = (n, r) => {
27
+ /******/ for (var t in r) {
28
+ /******/ if (e.o(r, t) && !e.o(n, t)) {
29
+ /******/ Object.defineProperty(n, t, {
116
30
  enumerable: true,
117
- get: r[n]
31
+ get: r[t]
118
32
  });
119
33
  /******/ }
120
34
  /******/ }
@@ -123,14 +37,14 @@
123
37
  /******/
124
38
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
125
39
  /******/ (() => {
126
- /******/ t.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
40
+ /******/ e.o = (e, n) => Object.prototype.hasOwnProperty.call(e, n)
127
41
  /******/;
128
42
  })();
129
43
  /******/
130
44
  /******/ /* webpack/runtime/make namespace object */
131
45
  /******/ (() => {
132
46
  /******/ // define __esModule on exports
133
- /******/ t.r = e => {
47
+ /******/ e.r = e => {
134
48
  /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
135
49
  /******/ Object.defineProperty(e, Symbol.toStringTag, {
136
50
  value: "Module"
@@ -143,615 +57,622 @@
143
57
  /******/ })();
144
58
  /******/
145
59
  /************************************************************************/ var n = {};
146
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
147
- (() => {
148
- // ESM COMPAT FLAG
149
- t.r(n);
150
- // EXPORTS
151
- t.d(n, {
152
- default: () => /* reexport */ ue
153
- });
154
- // EXTERNAL MODULE: external "react"
155
- var e = t(9497);
156
- var r = t.n(e);
157
- // CONCATENATED MODULE: external "lodash/keys"
158
- const o = require("lodash/keys");
159
- var a = t.n(o);
160
- // CONCATENATED MODULE: external "lodash/omit"
161
- const i = require("lodash/omit");
162
- var l = t.n(i);
163
- // CONCATENATED MODULE: external "lodash/pickBy"
164
- const u = require("lodash/pickBy");
165
- var c = t.n(u);
166
- // CONCATENATED MODULE: external "lodash/throttle"
167
- const s = require("lodash/throttle");
168
- var d = t.n(s);
169
- // CONCATENATED MODULE: external "prop-types"
170
- const f = require("prop-types");
171
- var p = t.n(f);
172
- // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
173
- const v = require("@splunk/react-ui/EventListener");
174
- var b = t.n(v);
175
- // CONCATENATED MODULE: ./src/TextArea/syncHeightWithShadow.ts
176
- // This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui),
177
- // which is MIT-licensed:
178
- // The MIT License (MIT)
179
- // Copyright (c) 2014 Call-Em-All
180
- // Permission is hereby granted, free of charge, to any person obtaining a copy
181
- // of this software and associated documentation files (the "Software"), to deal
182
- // in the Software without restriction, including without limitation the rights
183
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
184
- // copies of the Software, and to permit persons to whom the Software is
185
- // furnished to do so, subject to the following conditions:
186
- // The above copyright notice and this permission notice shall be included in all
187
- // copies or substantial portions of the Software.
188
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
189
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
190
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
191
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
192
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
193
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
194
- // SOFTWARE.
195
- // End of MIT license text.
196
- function m(e) {
197
- var r = e.height, t = e.rowsMax, n = e.rowsMin, o = e.shadow;
198
- if (o) {
199
- var a = window.getComputedStyle(o);
200
- var i = a.getPropertyValue("line-height");
201
- // jsdom does not properly inherit/re-calculate the line-height property so we skip in these cases SUI-1943, SUI-2428
202
- if (i === "inherit" || i === "normal") {
203
- return false;
204
- }
205
- var l = parseInt(i, 10);
206
- var u = parseInt(a.getPropertyValue("padding-top"), 10);
207
- var c = parseInt(a.getPropertyValue("padding-bottom"), 10);
208
- var s = parseInt(a.getPropertyValue("border-top-width"), 10);
209
- var d = parseInt(a.getPropertyValue("border-bottom-width"), 10);
210
- var f = o.scrollHeight + s + d;
211
- /* eslint-disable no-restricted-globals */
212
- // Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
213
- // We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable.
214
- if (f === undefined || isNaN(f)) {
215
- return false;
216
- }
217
- /* eslint-enable no-restricted-globals */ if (t >= n) {
218
- var p = t * l + u + c + s + d;
219
- f = Math.min(p, f);
220
- }
221
- var v = n * l + u + c + s + d;
222
- f = Math.max(v, f);
223
- if (r !== f) {
224
- return f;
225
- }
60
+ // ESM COMPAT FLAG
61
+ e.r(n);
62
+ // EXPORTS
63
+ e.d(n, {
64
+ default: () => /* reexport */ de
65
+ });
66
+ // CONCATENATED MODULE: external "react"
67
+ const r = require("react");
68
+ var t = e.n(r);
69
+ // CONCATENATED MODULE: external "lodash/keys"
70
+ const o = require("lodash/keys");
71
+ var a = e.n(o);
72
+ // CONCATENATED MODULE: external "lodash/omit"
73
+ const i = require("lodash/omit");
74
+ var l = e.n(i);
75
+ // CONCATENATED MODULE: external "lodash/pickBy"
76
+ const u = require("lodash/pickBy");
77
+ var c = e.n(u);
78
+ // CONCATENATED MODULE: external "lodash/throttle"
79
+ const s = require("lodash/throttle");
80
+ var d = e.n(s);
81
+ // CONCATENATED MODULE: external "prop-types"
82
+ const f = require("prop-types");
83
+ var p = e.n(f);
84
+ // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
85
+ const v = require("@splunk/react-ui/EventListener");
86
+ var b = e.n(v);
87
+ // CONCATENATED MODULE: external "@splunk/react-ui/useControlled"
88
+ const m = require("@splunk/react-ui/useControlled");
89
+ var y = e.n(m);
90
+ // CONCATENATED MODULE: ./src/TextArea/syncHeightWithShadow.ts
91
+ // This file was adapted from [Call-Em-All's material-ui](https://github.com/mui-org/material-ui),
92
+ // which is MIT-licensed:
93
+ // The MIT License (MIT)
94
+ // Copyright (c) 2014 Call-Em-All
95
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
96
+ // of this software and associated documentation files (the "Software"), to deal
97
+ // in the Software without restriction, including without limitation the rights
98
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
+ // copies of the Software, and to permit persons to whom the Software is
100
+ // furnished to do so, subject to the following conditions:
101
+ // The above copyright notice and this permission notice shall be included in all
102
+ // copies or substantial portions of the Software.
103
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
104
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
105
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
106
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
107
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
108
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
109
+ // SOFTWARE.
110
+ // End of MIT license text.
111
+ function h(e) {
112
+ var n = e.height, r = e.rowsMax, t = e.rowsMin, o = e.shadow;
113
+ if (o) {
114
+ var a = window.getComputedStyle(o);
115
+ var i = a.getPropertyValue("line-height");
116
+ // jsdom does not properly inherit/re-calculate the line-height property so we skip in these cases SUI-1943, SUI-2428
117
+ if (i === "inherit" || i === "normal") {
118
+ return false;
119
+ }
120
+ var l = parseInt(i, 10);
121
+ var u = parseInt(a.getPropertyValue("border-top-width"), 10);
122
+ var c = parseInt(a.getPropertyValue("border-bottom-width"), 10);
123
+ var s = o.scrollHeight + u + c;
124
+ /* eslint-disable no-restricted-globals */
125
+ // Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
126
+ // We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable.
127
+ if (s === undefined || isNaN(s)) {
128
+ return false;
129
+ }
130
+ /* eslint-enable no-restricted-globals */ if (r >= t) {
131
+ var d = r * l + u + c;
132
+ s = Math.min(d, s);
133
+ }
134
+ var f = t * l + u + c;
135
+ s = Math.max(f, s);
136
+ if (n !== s) {
137
+ return s;
226
138
  }
227
- return false;
228
139
  }
229
- // CONCATENATED MODULE: external "styled-components"
230
- const y = require("styled-components");
231
- var h = t.n(y);
232
- // CONCATENATED MODULE: external "@splunk/react-ui/Box"
233
- const g = require("@splunk/react-ui/Box");
234
- var x = t.n(g);
235
- // CONCATENATED MODULE: external "@splunk/themes"
236
- const w = require("@splunk/themes");
237
- // CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts
238
- var C = "230px";
239
- var S = w.variables.spacingSmall;
240
- // Because the height cannot be set from variables.inputHeight with the syncHeight/auto expanding rows
241
- // the value here is set to be custom to ensure the correct total height across row values
242
- var O = "5px";
243
- var A = h()(x()).withConfig({
244
- displayName: "TextAreaStyles__StyledBox",
245
- componentId: "gfy8yp-0"
246
- })([ "", " display:flex;justify-content:space-between;flex-grow:1;flex-shrink:1;position:relative;min-height:", ";overflow:hidden;border:", " solid ", ";border-radius:", ";box-sizing:border-box;background-color:", ";box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);align-items:center;gap:", ";padding:0 ", ";&:hover:not([disabled]){border-color:", ";}&:not([disabled]):has(textarea:focus){box-shadow:", ";color:", ";}", " ", " ", " ", " &[data-inline]{width:", ";flex-basis:", ";}" ], w.mixins.reset("inline-flex"), w.variables.inputHeight, w.variables.inputBorderWidth, w.variables.interactiveColorBorder, w.variables.borderRadius, w.variables.interactiveColorBackground, w.variables.spacingSmall, S, w.variables.interactiveColorBorderHover, w.variables.focusShadow, w.variables.contentColorActive, (function(e) {
247
- var r = e.$error;
248
- return r && (0, y.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], w.variables.interactiveColorAccentError, w.variables.interactiveColorAccentErrorStrong);
249
- }), (function(e) {
250
- var r = e.$append;
251
- return r && (0, y.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
252
- }), (function(e) {
253
- var r = e.$prepend;
254
- return r && (0, y.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
255
- }), (function(e) {
256
- var r = e.disabled;
257
- return r && (0, y.css)([ "background-color:", ";border-color:", ";box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);" ], w.variables.interactiveColorBackgroundDisabled, w.variables.interactiveColorBorderDisabled);
258
- }), C, C);
259
- // This wrapper ensures the textarea and shadow text area are the same width.
260
- // The wrapper's size is determined by the parent flex layout: the textarea and shadow
261
- // are both set to be 100% of the wrapper.
262
- // Having the same width is necessary for the height to be calculated correctly
263
- // so that the value wrapping behavior is correct
264
- var E = h().div.withConfig({
265
- displayName: "TextAreaStyles__StyledTextAreaAndShadowWrapper",
266
- componentId: "gfy8yp-1"
267
- })([ "", ";position:relative;overflow:hidden;flex-grow:1;" ], w.mixins.reset("inline-flex"));
268
- var j = h().textarea.withConfig({
269
- displayName: "TextAreaStyles__StyledTextArea",
270
- componentId: "gfy8yp-2"
271
- })([ "", ";color:", ";position:relative;resize:none;overflow:auto;white-space:pre-wrap;width:100%;line-height:20px;padding-top:", ";padding-bottom:", ";&::placeholder{color:", ";opacity:1;}&[disabled]{cursor:not-allowed;color:", ";&::placeholder{color:", ";}}" ], w.mixins.reset(), w.variables.contentColorActive, O, O, w.variables.contentColorMuted, w.variables.contentColorDisabled, w.variables.contentColorDisabled);
272
- var I = h()(j).withConfig({
273
- displayName: "TextAreaStyles__StyledTextAreaShadow",
274
- componentId: "gfy8yp-3"
275
- })([ "position:absolute;overflow:hidden;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;" ]);
276
- var k = h().div.withConfig({
277
- displayName: "TextAreaStyles__StyledAdornment",
278
- componentId: "gfy8yp-4"
279
- })([ "align-self:flex-start;display:inline-flex;align-items:center;justify-content:center;pointer-events:none;color:", ";padding:", " 0;", ";" ], w.variables.contentColorMuted, O, (function(e) {
280
- var r = e.$disabled;
281
- return r && (0, y.css)([ "cursor:not-allowed;color:", ";" ], w.variables.contentColorDisabled);
282
- }));
283
- // EXTERNAL MODULE: ./src/useControlled/index.ts + 2 modules
284
- var P = t(3639);
285
- // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
286
- /* eslint-disable @typescript-eslint/no-empty-function */
287
- var T = {
288
- body: {
289
- appendChild: function e() {
290
- return [];
291
- }
292
- },
293
- addEventListener: function e() {},
294
- removeEventListener: function e() {},
295
- activeElement: {
296
- blur: function e() {},
297
- nodeName: ""
298
- },
299
- querySelector: function e() {
300
- return null;
301
- },
302
- querySelectorAll: function e() {
140
+ return false;
141
+ }
142
+ // CONCATENATED MODULE: external "styled-components"
143
+ const g = require("styled-components");
144
+ var w = e.n(g);
145
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
146
+ const C = require("@splunk/react-ui/Box");
147
+ var x = e.n(C);
148
+ // CONCATENATED MODULE: external "@splunk/themes"
149
+ const S = require("@splunk/themes");
150
+ // CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts
151
+ var A = "230px";
152
+ var O = S.variables.spacingSmall;
153
+ // variables.inputHeight can't be used with syncHeight/auto-expanding rows.
154
+ // Use a custom value here to ensure the single-line TextArea matches the Text height
155
+ // and keeps the vertical spacing above the label consistent (SUI-8053).
156
+ var E = (0, S.pick)({
157
+ comfortable: "5px",
158
+ compact: "3px"
159
+ });
160
+ var j = w()(x()).withConfig({
161
+ displayName: "TextAreaStyles__StyledBox",
162
+ componentId: "gfy8yp-0"
163
+ })([ "display:grid;grid-template-columns:[startAdornment] min-content [content] minmax(0,1fr) [endAdornment] min-content;position:relative;min-height:", ";overflow:hidden;border:", " solid ", ";border-radius:", ";background-color:", ";box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);align-items:center;padding:", " ", ";&:hover:not([disabled]){border-color:", ";}&:not([disabled]):has(textarea:focus){box-shadow:", ";color:", ";}", " ", " ", " ", " ", "" ], S.variables.inputHeight, S.variables.inputBorderWidth, S.variables.interactiveColorBorder, S.variables.borderRadius, S.variables.interactiveColorBackground, E, O, S.variables.interactiveColorBorderHover, S.variables.focusShadow, S.variables.contentColorActive, (function(e) {
164
+ var n = e.$error;
165
+ return n && (0, g.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], S.variables.interactiveColorAccentError, S.variables.interactiveColorAccentErrorStrong);
166
+ }), (function(e) {
167
+ var n = e.$append;
168
+ return n && (0, g.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
169
+ }), (function(e) {
170
+ var n = e.$prepend;
171
+ return n && (0, g.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
172
+ }), (function(e) {
173
+ var n = e.disabled;
174
+ return n && (0, g.css)([ "background-color:", ";border-color:", ";box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);" ], S.variables.interactiveColorBackgroundDisabled, S.variables.interactiveColorBorderDisabled);
175
+ }), (function(e) {
176
+ var n = e.$inline;
177
+ return n && (0, g.css)([ "display:inline-grid;width:", ";" ], A);
178
+ }));
179
+ // This wrapper ensures the textarea and shadow text area are the same width.
180
+ // The wrapper's size is determined by the parent grid layout: the textarea and shadow
181
+ // are both set to be 100% of the wrapper.
182
+ // Having the same width is necessary for the height to be calculated correctly
183
+ // so that the value wrapping behavior is correct
184
+ var k = w().div.withConfig({
185
+ displayName: "TextAreaStyles__StyledTextAreaAndShadowWrapper",
186
+ componentId: "gfy8yp-1"
187
+ })([ "", ";position:relative;overflow:hidden;flex-grow:1;grid-column:content;" ], S.mixins.reset("inline-flex"));
188
+ var I = w().textarea.withConfig({
189
+ displayName: "TextAreaStyles__StyledTextArea",
190
+ componentId: "gfy8yp-2"
191
+ })([ "", ";color:", ";position:relative;resize:none;overflow:auto;white-space:pre-wrap;width:100%;line-height:20px;&::placeholder{color:", ";opacity:1;}&[disabled]{cursor:not-allowed;color:", ";&::placeholder{color:", ";}}" ], S.mixins.reset(), S.variables.contentColorActive, S.variables.contentColorMuted, S.variables.contentColorDisabled, S.variables.contentColorDisabled);
192
+ var T = w()(I).withConfig({
193
+ displayName: "TextAreaStyles__StyledTextAreaShadow",
194
+ componentId: "gfy8yp-3"
195
+ })([ "position:absolute;overflow:hidden;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;" ]);
196
+ var P = (0, g.css)([ "display:inline-flex;min-height:1lh;align-self:start;align-items:center;justify-content:center;pointer-events:none;color:", ";", ";" ], S.variables.contentColorMuted, (function(e) {
197
+ var n = e.$disabled;
198
+ return n && (0, g.css)([ "cursor:not-allowed;color:", ";" ], S.variables.contentColorDisabled);
199
+ }));
200
+ var B = w().div.withConfig({
201
+ displayName: "TextAreaStyles__StyledStartAdornment",
202
+ componentId: "gfy8yp-4"
203
+ })([ "", " grid-column:startAdornment;margin-inline-end:", ";" ], P, S.variables.spacingSmall);
204
+ var M = w().div.withConfig({
205
+ displayName: "TextAreaStyles__StyledEndAdornment",
206
+ componentId: "gfy8yp-5"
207
+ })([ "", " grid-column:endAdornment;margin-inline-start:", ";" ], P, S.variables.spacingSmall);
208
+ // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
209
+ /* eslint-disable @typescript-eslint/no-empty-function */
210
+ var N = {
211
+ body: {
212
+ appendChild: function e() {
303
213
  return [];
304
- },
305
- getElementById: function e() {
306
- return null;
307
- },
308
- createEvent: function e() {
309
- return {
310
- initEvent: function e() {}
311
- };
312
- },
313
- createElement: function e() {
314
- return {
315
- children: [],
316
- childNodes: [],
317
- style: {},
318
- setAttribute: function e() {},
319
- getElementsByTagName: function e() {
320
- return [];
321
- }
322
- };
323
- },
324
- createElementNS: function e() {
325
- return {};
326
- },
327
- importNode: function e() {
328
- return null;
329
- },
330
- location: {
331
- hash: "",
332
- host: "",
333
- hostname: "",
334
- href: "",
335
- origin: "",
336
- pathname: "",
337
- protocol: "",
338
- search: ""
339
214
  }
340
- };
341
- function B() {
342
- var e = typeof document !== "undefined" ? document : T;
343
- return e;
344
- }
345
- var N = B();
346
- /* harmony default export */ const q = /* unused pure expression or super */ null && N;
347
- // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
348
- /* eslint-disable @typescript-eslint/no-empty-function */
349
- var M = {
350
- document: T,
351
- navigator: {
352
- userAgent: ""
353
- },
354
- location: {
355
- hash: "",
356
- host: "",
357
- hostname: "",
358
- href: "",
359
- origin: "",
360
- pathname: "",
361
- protocol: "",
362
- search: ""
363
- },
364
- history: {
365
- replaceState: function e() {},
366
- pushState: function e() {},
367
- go: function e() {},
368
- back: function e() {}
369
- },
370
- CustomEvent: function e() {
371
- return this;
372
- },
373
- addEventListener: function e() {},
374
- removeEventListener: function e() {},
375
- getComputedStyle: function e() {
376
- return {
377
- getPropertyValue: function e() {
378
- return "";
379
- }
380
- };
381
- },
382
- Image: function e() {},
383
- Date: function e() {},
384
- screen: {},
385
- setTimeout: function e() {},
386
- clearTimeout: function e() {},
387
- matchMedia: function e() {
388
- return {};
389
- },
390
- requestAnimationFrame: function e(r) {
391
- if (typeof setTimeout === "undefined") {
392
- r();
393
- return null;
215
+ },
216
+ addEventListener: function e() {},
217
+ removeEventListener: function e() {},
218
+ activeElement: {
219
+ blur: function e() {},
220
+ nodeName: ""
221
+ },
222
+ querySelector: function e() {
223
+ return null;
224
+ },
225
+ querySelectorAll: function e() {
226
+ return [];
227
+ },
228
+ getElementById: function e() {
229
+ return null;
230
+ },
231
+ createEvent: function e() {
232
+ return {
233
+ initEvent: function e() {}
234
+ };
235
+ },
236
+ createElement: function e() {
237
+ return {
238
+ children: [],
239
+ childNodes: [],
240
+ style: {},
241
+ setAttribute: function e() {},
242
+ getElementsByTagName: function e() {
243
+ return [];
394
244
  }
395
- return setTimeout(r, 0);
396
- },
397
- cancelAnimationFrame: function e(r) {
398
- if (typeof setTimeout === "undefined") {
399
- return;
245
+ };
246
+ },
247
+ createElementNS: function e() {
248
+ return {};
249
+ },
250
+ importNode: function e() {
251
+ return null;
252
+ },
253
+ location: {
254
+ hash: "",
255
+ host: "",
256
+ hostname: "",
257
+ href: "",
258
+ origin: "",
259
+ pathname: "",
260
+ protocol: "",
261
+ search: ""
262
+ }
263
+ };
264
+ function q() {
265
+ var e = typeof document !== "undefined" ? document : N;
266
+ return e;
267
+ }
268
+ var _ = q();
269
+ /* harmony default export */ const D = /* unused pure expression or super */ null && _;
270
+ // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
271
+ /* eslint-disable @typescript-eslint/no-empty-function */
272
+ var $ = {
273
+ document: N,
274
+ navigator: {
275
+ userAgent: ""
276
+ },
277
+ location: {
278
+ hash: "",
279
+ host: "",
280
+ hostname: "",
281
+ href: "",
282
+ origin: "",
283
+ pathname: "",
284
+ protocol: "",
285
+ search: ""
286
+ },
287
+ history: {
288
+ replaceState: function e() {},
289
+ pushState: function e() {},
290
+ go: function e() {},
291
+ back: function e() {}
292
+ },
293
+ CustomEvent: function e() {
294
+ return this;
295
+ },
296
+ addEventListener: function e() {},
297
+ removeEventListener: function e() {},
298
+ getComputedStyle: function e() {
299
+ return {
300
+ getPropertyValue: function e() {
301
+ return "";
400
302
  }
401
- clearTimeout(r);
303
+ };
304
+ },
305
+ Image: function e() {},
306
+ Date: function e() {},
307
+ screen: {},
308
+ setTimeout: function e() {},
309
+ clearTimeout: function e() {},
310
+ matchMedia: function e() {
311
+ return {};
312
+ },
313
+ requestAnimationFrame: function e(n) {
314
+ if (typeof setTimeout === "undefined") {
315
+ n();
316
+ return null;
402
317
  }
403
- };
404
- function D() {
405
- var e = typeof window !== "undefined" ? window : M;
406
- return e;
318
+ return setTimeout(n, 0);
319
+ },
320
+ cancelAnimationFrame: function e(n) {
321
+ if (typeof setTimeout === "undefined") {
322
+ return;
323
+ }
324
+ clearTimeout(n);
407
325
  }
408
- var _ = D();
409
- /* harmony default export */ const R = _;
410
- // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
411
- /**
326
+ };
327
+ function F() {
328
+ var e = typeof window !== "undefined" ? window : $;
329
+ return e;
330
+ }
331
+ var R = F();
332
+ /* harmony default export */ const L = R;
333
+ // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
334
+ /**
412
335
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
413
336
  *
414
337
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
415
338
  * @param current - The new value of the ref.
416
339
  */
417
- function F(e, r) {
418
- if (e) {
419
- if (typeof e === "function") {
420
- e(r);
421
- } else {
422
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
423
- // the intention here is to signal "we will take care of setting 'current', not you".
424
- e.current = r;
340
+ function V(e, n) {
341
+ if (e) {
342
+ if (typeof e === "function") {
343
+ e(n);
344
+ } else {
345
+ // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
346
+ // the intention here is to signal "we will take care of setting 'current', not you".
347
+ e.current = n;
425
348
  // eslint-disable-line no-param-reassign
426
- }
427
- }
428
- }
429
- // CONCATENATED MODULE: ./src/TextArea/TextArea.tsx
430
- function V(e) {
431
- "@babel/helpers - typeof";
432
- return V = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
433
- return typeof e;
434
- } : function(e) {
435
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
436
- }, V(e);
349
+ }
437
350
  }
438
- function $() {
439
- return $ = Object.assign ? Object.assign.bind() : function(e) {
440
- for (var r = 1; r < arguments.length; r++) {
441
- var t = arguments[r];
442
- for (var n in t) {
443
- ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
444
- }
351
+ }
352
+ // CONCATENATED MODULE: ./src/TextArea/TextArea.tsx
353
+ function z(e) {
354
+ "@babel/helpers - typeof";
355
+ return z = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
356
+ return typeof e;
357
+ } : function(e) {
358
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
359
+ }, z(e);
360
+ }
361
+ function K() {
362
+ return K = Object.assign ? Object.assign.bind() : function(e) {
363
+ for (var n = 1; n < arguments.length; n++) {
364
+ var r = arguments[n];
365
+ for (var t in r) {
366
+ ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
445
367
  }
446
- return e;
447
- }, $.apply(null, arguments);
448
- }
449
- function L(e) {
450
- return H(e) || K(e) || Z(e) || z();
451
- }
452
- function z() {
453
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
454
- }
455
- function K(e) {
456
- if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
457
- }
458
- function H(e) {
459
- if (Array.isArray(e)) return ee(e);
460
- }
461
- function W(e, r) {
462
- var t = Object.keys(e);
463
- if (Object.getOwnPropertySymbols) {
464
- var n = Object.getOwnPropertySymbols(e);
465
- r && (n = n.filter((function(r) {
466
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
467
- }))), t.push.apply(t, n);
468
- }
469
- return t;
470
- }
471
- function U(e) {
472
- for (var r = 1; r < arguments.length; r++) {
473
- var t = null != arguments[r] ? arguments[r] : {};
474
- r % 2 ? W(Object(t), !0).forEach((function(r) {
475
- G(e, r, t[r]);
476
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : W(Object(t)).forEach((function(r) {
477
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
478
- }));
479
368
  }
480
369
  return e;
370
+ }, K.apply(null, arguments);
371
+ }
372
+ function H(e) {
373
+ return G(e) || U(e) || re(e) || W();
374
+ }
375
+ function W() {
376
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
377
+ }
378
+ function U(e) {
379
+ if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
380
+ }
381
+ function G(e) {
382
+ if (Array.isArray(e)) return te(e);
383
+ }
384
+ function J(e, n) {
385
+ var r = Object.keys(e);
386
+ if (Object.getOwnPropertySymbols) {
387
+ var t = Object.getOwnPropertySymbols(e);
388
+ n && (t = t.filter((function(n) {
389
+ return Object.getOwnPropertyDescriptor(e, n).enumerable;
390
+ }))), r.push.apply(r, t);
481
391
  }
482
- function G(e, r, t) {
483
- return (r = J(r)) in e ? Object.defineProperty(e, r, {
484
- value: t,
485
- enumerable: !0,
486
- configurable: !0,
487
- writable: !0
488
- }) : e[r] = t, e;
489
- }
490
- function J(e) {
491
- var r = Q(e, "string");
492
- return "symbol" == V(r) ? r : r + "";
493
- }
494
- function Q(e, r) {
495
- if ("object" != V(e) || !e) return e;
496
- var t = e[Symbol.toPrimitive];
497
- if (void 0 !== t) {
498
- var n = t.call(e, r || "default");
499
- if ("object" != V(n)) return n;
500
- throw new TypeError("@@toPrimitive must return a primitive value.");
501
- }
502
- return ("string" === r ? String : Number)(e);
503
- }
504
- function X(e, r) {
505
- return te(e) || re(e, r) || Z(e, r) || Y();
392
+ return r;
393
+ }
394
+ function Q(e) {
395
+ for (var n = 1; n < arguments.length; n++) {
396
+ var r = null != arguments[n] ? arguments[n] : {};
397
+ n % 2 ? J(Object(r), !0).forEach((function(n) {
398
+ X(e, n, r[n]);
399
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : J(Object(r)).forEach((function(n) {
400
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
401
+ }));
506
402
  }
507
- function Y() {
508
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
403
+ return e;
404
+ }
405
+ function X(e, n, r) {
406
+ return (n = Y(n)) in e ? Object.defineProperty(e, n, {
407
+ value: r,
408
+ enumerable: !0,
409
+ configurable: !0,
410
+ writable: !0
411
+ }) : e[n] = r, e;
412
+ }
413
+ function Y(e) {
414
+ var n = Z(e, "string");
415
+ return "symbol" == z(n) ? n : n + "";
416
+ }
417
+ function Z(e, n) {
418
+ if ("object" != z(e) || !e) return e;
419
+ var r = e[Symbol.toPrimitive];
420
+ if (void 0 !== r) {
421
+ var t = r.call(e, n || "default");
422
+ if ("object" != z(t)) return t;
423
+ throw new TypeError("@@toPrimitive must return a primitive value.");
509
424
  }
510
- function Z(e, r) {
511
- if (e) {
512
- if ("string" == typeof e) return ee(e, r);
513
- var t = {}.toString.call(e).slice(8, -1);
514
- return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ee(e, r) : void 0;
515
- }
425
+ return ("string" === n ? String : Number)(e);
426
+ }
427
+ function ee(e, n) {
428
+ return ae(e) || oe(e, n) || re(e, n) || ne();
429
+ }
430
+ function ne() {
431
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
432
+ }
433
+ function re(e, n) {
434
+ if (e) {
435
+ if ("string" == typeof e) return te(e, n);
436
+ var r = {}.toString.call(e).slice(8, -1);
437
+ return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? te(e, n) : void 0;
516
438
  }
517
- function ee(e, r) {
518
- (null == r || r > e.length) && (r = e.length);
519
- for (var t = 0, n = Array(r); t < r; t++) {
520
- n[t] = e[t];
521
- }
522
- return n;
439
+ }
440
+ function te(e, n) {
441
+ (null == n || n > e.length) && (n = e.length);
442
+ for (var r = 0, t = Array(n); r < n; r++) {
443
+ t[r] = e[r];
523
444
  }
524
- function re(e, r) {
525
- var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
526
- if (null != t) {
527
- var n, o, a, i, l = [], u = !0, c = !1;
445
+ return t;
446
+ }
447
+ function oe(e, n) {
448
+ var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
449
+ if (null != r) {
450
+ var t, o, a, i, l = [], u = !0, c = !1;
451
+ try {
452
+ if (a = (r = r.call(e)).next, 0 === n) {
453
+ if (Object(r) !== r) return;
454
+ u = !1;
455
+ } else for (;!(u = (t = a.call(r)).done) && (l.push(t.value), l.length !== n); u = !0) {
456
+ }
457
+ } catch (e) {
458
+ c = !0, o = e;
459
+ } finally {
528
460
  try {
529
- if (a = (t = t.call(e)).next, 0 === r) {
530
- if (Object(t) !== t) return;
531
- u = !1;
532
- } else for (;!(u = (n = a.call(t)).done) && (l.push(n.value), l.length !== r); u = !0) {
533
- }
534
- } catch (e) {
535
- c = !0, o = e;
461
+ if (!u && null != r["return"] && (i = r["return"](), Object(i) !== i)) return;
536
462
  } finally {
537
- try {
538
- if (!u && null != t["return"] && (i = t["return"](), Object(i) !== i)) return;
539
- } finally {
540
- if (c) throw o;
541
- }
463
+ if (c) throw o;
542
464
  }
543
- return l;
544
465
  }
466
+ return l;
545
467
  }
546
- function te(e) {
547
- if (Array.isArray(e)) return e;
548
- }
549
- function ne(e, r) {
550
- if (null == e) return {};
551
- var t, n, o = oe(e, r);
552
- if (Object.getOwnPropertySymbols) {
553
- var a = Object.getOwnPropertySymbols(e);
554
- for (n = 0; n < a.length; n++) {
555
- t = a[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
556
- }
468
+ }
469
+ function ae(e) {
470
+ if (Array.isArray(e)) return e;
471
+ }
472
+ function ie(e, n) {
473
+ if (null == e) return {};
474
+ var r, t, o = le(e, n);
475
+ if (Object.getOwnPropertySymbols) {
476
+ var a = Object.getOwnPropertySymbols(e);
477
+ for (t = 0; t < a.length; t++) {
478
+ r = a[t], -1 === n.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
557
479
  }
558
- return o;
559
480
  }
560
- function oe(e, r) {
561
- if (null == e) return {};
562
- var t = {};
563
- for (var n in e) {
564
- if ({}.hasOwnProperty.call(e, n)) {
565
- if (-1 !== r.indexOf(n)) continue;
566
- t[n] = e[n];
567
- }
481
+ return o;
482
+ }
483
+ function le(e, n) {
484
+ if (null == e) return {};
485
+ var r = {};
486
+ for (var t in e) {
487
+ if ({}.hasOwnProperty.call(e, t)) {
488
+ if (-1 !== n.indexOf(t)) continue;
489
+ r[t] = e[t];
568
490
  }
569
- return t;
570
491
  }
571
- /** @public */
572
- /** @public */
573
- /** @public */ var ae = {
574
- append: p().bool,
575
- autoCapitalize: p().string,
576
- autoComplete: p().string,
577
- autoCorrect: p().string,
578
- autoFocus: p().bool,
579
- children: p().node,
580
- defaultValue: p().string,
581
- describedBy: p().string,
582
- disabled: p().bool,
583
- elementRef: p().oneOfType([ p().func, p().object ]),
584
- endAdornment: p().node,
585
- error: p().bool,
586
- inline: p().bool,
587
- /** @private. */
588
- inputClassName: p().string,
589
- inputId: p().string,
590
- inputRef: p().oneOfType([ p().func, p().object ]),
591
- labelledBy: p().string,
592
- maxLength: p().number,
593
- name: p().string,
594
- onBlur: p().func,
595
- onChange: p().func,
596
- onFocus: p().func,
597
- onKeyDown: p().func,
598
- onSelect: p().func,
599
- onInputClick: p().func,
600
- prepend: p().bool,
601
- /** @private. */
602
- required: p().bool,
603
- rowsMax: p().number,
604
- rowsMin: p().number,
605
- spellCheck: p().bool,
606
- tabIndex: p().number,
607
- startAdornment: p().node,
608
- value: p().string
609
- };
610
- var ie = function e() {};
611
- /** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ function le(t) {
612
- var n = t.append, o = n === void 0 ? false : n, i = t.autoCapitalize, u = t.autoComplete, s = t.autoCorrect, f = t.autoFocus, p = f === void 0 ? false : f, v = t.children, y = t.disabled, h = y === void 0 ? false : y, g = t.describedBy, x = t.defaultValue, w = t.elementRef, C = t.error, S = C === void 0 ? false : C, O = t.endAdornment, T = t.inline, B = T === void 0 ? false : T, N = t.inputClassName, q = t.inputId, M = t.inputRef, D = t.labelledBy, _ = t.maxLength, V = t.name, z = t.onBlur, K = t.onChange, H = t.onFocus, W = t.onInputClick, G = t.onKeyDown, J = t.onSelect, Q = t.placeholder, Y = t.prepend, Z = Y === void 0 ? false : Y, ee = t.required, re = t.rowsMin, te = re === void 0 ? 2 : re, oe = t.rowsMax, ae = oe === void 0 ? 8 : oe, le = t.spellCheck, ue = t.startAdornment, ce = t.tabIndex, se = ce === void 0 ? 0 : ce, de = t.value, fe = ne(t, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "disabled", "describedBy", "defaultValue", "elementRef", "error", "endAdornment", "inline", "inputClassName", "inputId", "inputRef", "labelledBy", "maxLength", "name", "onBlur", "onChange", "onFocus", "onInputClick", "onKeyDown", "onSelect", "placeholder", "prepend", "required", "rowsMin", "rowsMax", "spellCheck", "startAdornment", "tabIndex", "value" ]);
613
- // @docs-props-type TextAreaPropsBase
614
- (0, e.useEffect)((function() {
615
- if (false) {}
616
- }), [ te, ae ]);
617
- var pe = (0, P["default"])({
618
- componentName: "TextArea",
619
- /* eslint-disable-next-line prefer-rest-params */
620
- componentProps: arguments[0]
492
+ return r;
493
+ }
494
+ /** @public */
495
+ /** @public */
496
+ /** @public */ var ue = {
497
+ append: p().bool,
498
+ autoCapitalize: p().string,
499
+ autoComplete: p().string,
500
+ autoCorrect: p().string,
501
+ autoFocus: p().bool,
502
+ children: p().node,
503
+ defaultValue: p().string,
504
+ describedBy: p().string,
505
+ disabled: p().bool,
506
+ elementRef: p().oneOfType([ p().func, p().object ]),
507
+ endAdornment: p().node,
508
+ error: p().bool,
509
+ inline: p().bool,
510
+ /** @private. */
511
+ inputClassName: p().string,
512
+ inputId: p().string,
513
+ inputRef: p().oneOfType([ p().func, p().object ]),
514
+ labelledBy: p().string,
515
+ maxLength: p().number,
516
+ name: p().string,
517
+ onBlur: p().func,
518
+ onChange: p().func,
519
+ onFocus: p().func,
520
+ onKeyDown: p().func,
521
+ onSelect: p().func,
522
+ onInputClick: p().func,
523
+ prepend: p().bool,
524
+ /** @private. */
525
+ required: p().bool,
526
+ rowsMax: p().number,
527
+ rowsMin: p().number,
528
+ spellCheck: p().bool,
529
+ tabIndex: p().number,
530
+ startAdornment: p().node,
531
+ value: p().string
532
+ };
533
+ var ce = function e() {};
534
+ /** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ function se(e) {
535
+ var n = e.append, o = n === void 0 ? false : n, i = e.autoCapitalize, u = e.autoComplete, s = e.autoCorrect, f = e.autoFocus, p = f === void 0 ? false : f, v = e.children, m = e.disabled, g = m === void 0 ? false : m, w = e.describedBy, C = e.defaultValue, x = e.elementRef, S = e.error, A = S === void 0 ? false : S, O = e.endAdornment, E = e.inline, P = E === void 0 ? false : E, N = e.inputClassName, q = e.inputId, _ = e.inputRef, D = e.labelledBy, $ = e.maxLength, F = e.name, R = e.onBlur, z = e.onChange, W = e.onFocus, U = e.onInputClick, G = e.onKeyDown, J = e.onSelect, X = e.placeholder, Y = e.prepend, Z = Y === void 0 ? false : Y, ne = e.required, re = e.rowsMin, te = re === void 0 ? 2 : re, oe = e.rowsMax, ae = oe === void 0 ? 8 : oe, le = e.spellCheck, ue = e.startAdornment, se = e.tabIndex, de = se === void 0 ? 0 : se, fe = e.value, pe = ie(e, [ "append", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "children", "disabled", "describedBy", "defaultValue", "elementRef", "error", "endAdornment", "inline", "inputClassName", "inputId", "inputRef", "labelledBy", "maxLength", "name", "onBlur", "onChange", "onFocus", "onInputClick", "onKeyDown", "onSelect", "placeholder", "prepend", "required", "rowsMin", "rowsMax", "spellCheck", "startAdornment", "tabIndex", "value" ]);
536
+ // @docs-props-type TextAreaPropsBase
537
+ (0, r.useEffect)((function() {
538
+ if (false) {}
539
+ }), [ te, ae ]);
540
+ var ve = y()({
541
+ componentName: "TextArea",
542
+ /* eslint-disable-next-line prefer-rest-params */
543
+ componentProps: arguments[0]
544
+ });
545
+ var be = (0, r.useState)(C || ""), me = ee(be, 2), ye = me[0], he = me[1];
546
+ var ge = (0, r.useState)(), we = ee(ge, 2), Ce = we[0], xe = we[1];
547
+ var Se = (0, r.useRef)(null);
548
+ var Ae = (0, r.useRef)(null);
549
+ var Oe = ve ? fe : ye;
550
+ var Ee = (0, r.useCallback)((function(e) {
551
+ Se.current = e;
552
+ V(_, e);
553
+ }), [ _, Se ]);
554
+ var je = (0, r.useCallback)((function(e) {
555
+ G === null || G === void 0 ? void 0 : G(e);
556
+ }), [ G ]);
557
+ var ke = (0, r.useCallback)((function(e) {
558
+ J === null || J === void 0 ? void 0 : J(e);
559
+ }), [ J ]);
560
+ var Ie = (0, r.useCallback)((function(e) {
561
+ U === null || U === void 0 ? void 0 : U(e);
562
+ }), [ U ]);
563
+ var Te = (0, r.useCallback)((function(e) {
564
+ var n = e.target.value;
565
+ W === null || W === void 0 ? void 0 : W(e, {
566
+ value: n,
567
+ name: F
621
568
  });
622
- var ve = (0, e.useState)(x || ""), be = X(ve, 2), me = be[0], ye = be[1];
623
- var he = (0, e.useState)(), ge = X(he, 2), xe = ge[0], we = ge[1];
624
- var Ce = (0, e.useRef)(null);
625
- var Se = (0, e.useRef)(null);
626
- var Oe = pe ? de : me;
627
- var Ae = (0, e.useCallback)((function(e) {
628
- Ce.current = e;
629
- F(M, e);
630
- }), [ M, Ce ]);
631
- var Ee = (0, e.useCallback)((function(e) {
632
- G === null || G === void 0 ? void 0 : G(e);
633
- }), [ G ]);
634
- var je = (0, e.useCallback)((function(e) {
635
- J === null || J === void 0 ? void 0 : J(e);
636
- }), [ J ]);
637
- var Ie = (0, e.useCallback)((function(e) {
638
- W === null || W === void 0 ? void 0 : W(e);
639
- }), [ W ]);
640
- var ke = (0, e.useCallback)((function(e) {
641
- var r = e.target.value;
642
- H === null || H === void 0 ? void 0 : H(e, {
643
- value: r,
644
- name: V
645
- });
646
- }), [ V, H ]);
647
- var Pe = (0, e.useCallback)((function(e) {
648
- var r = e.target.value;
649
- z === null || z === void 0 ? void 0 : z(e, {
650
- value: r,
651
- name: V
652
- });
653
- }), [ V, z ]);
654
- var Te = (0, e.useCallback)((function(e) {
655
- var r = e.target.value;
656
- if (!pe) {
657
- ye(r);
658
- }
659
- K === null || K === void 0 ? void 0 : K(e, {
660
- value: r,
661
- name: V
662
- });
663
- }), [ K, ye, pe, V ]);
664
- var Be = (0, e.useCallback)((function() {
665
- var e = m({
666
- height: xe,
667
- rowsMax: ae,
668
- rowsMin: te,
669
- shadow: Se.current
670
- });
671
- if (e !== false) {
672
- we(e);
673
- }
674
- }), [ we, Se, ae, te, xe ]);
675
- var Ne = (0, e.useMemo)((function() {
676
- return d()(Be, 100);
677
- }), [ Be ]);
678
- (0, e.useLayoutEffect)((function() {
679
- Be();
680
- }));
681
- var qe = U(U({}, c()(fe, (function(e, r) {
682
- return r === "role" || r.indexOf("aria-") === 0;
683
- }))), {}, {
684
- "aria-describedby": g,
685
- "aria-labelledby": D,
686
- "aria-invalid": S || undefined
569
+ }), [ F, W ]);
570
+ var Pe = (0, r.useCallback)((function(e) {
571
+ var n = e.target.value;
572
+ R === null || R === void 0 ? void 0 : R(e, {
573
+ value: n,
574
+ name: F
687
575
  });
688
- var Me = l()(fe, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick" ].concat(L(a()(qe))));
689
- var De = {
690
- $append: o || undefined,
691
- $error: S,
692
- $prepend: Z || undefined
693
- };
694
- var _e = U(U({}, qe), {}, {
695
- "data-test": "textbox",
696
- autoCapitalize: i,
697
- autoComplete: u,
698
- autoCorrect: s,
699
- autoFocus: p,
700
- className: N,
701
- disabled: h,
702
- id: q,
703
- maxLength: _,
704
- name: V,
705
- onBlur: Pe,
706
- onChange: Te,
707
- onFocus: ke,
708
- onKeyDown: Ee,
709
- onSelect: je,
710
- onClick: Ie,
711
- placeholder: Q,
712
- // support HTML attribute
713
- ref: Ae,
714
- required: ee,
715
- spellCheck: le,
716
- style: {
717
- height: xe
718
- },
719
- tabIndex: se,
720
- value: Oe,
721
- $error: S
576
+ }), [ F, R ]);
577
+ var Be = (0, r.useCallback)((function(e) {
578
+ var n = e.target.value;
579
+ if (!ve) {
580
+ he(n);
581
+ }
582
+ z === null || z === void 0 ? void 0 : z(e, {
583
+ value: n,
584
+ name: F
722
585
  });
723
-
724
- return r().createElement(r().Fragment, null, r().createElement(A, $({
725
- tabIndex: -1,
726
- "data-test": "text-area",
727
- "data-test-value": Oe,
728
- "data-test-disabled": h ? "disabled" : undefined,
729
- elementRef: w,
730
- flex: true,
731
- inline: B,
732
- disabled: h
733
- }, Me, De), ue && r().createElement(k, {
734
- $disabled: !!h
735
- }, ue), r().createElement(E, null, r().createElement(I, {
736
- "aria-hidden": "true",
737
- tabIndex: -1,
738
- onChange: ie,
739
- rows: te,
740
- ref: Se,
741
- value: Q && !Oe ? Q : Oe
742
- }), r().createElement(j, _e)), v, O && r().createElement(k, {
743
- $disabled: !!h
744
- }, O)), r().createElement(b(), {
745
- target: R,
746
- eventType: "resize",
747
- listener: Ne
748
- }));
749
- }
750
- le.propTypes = ae;
751
- le.componentType = "TextArea";
752
- /* harmony default export */ const ue = le;
753
- // only for styled components using TextArea
754
- }) // CONCATENATED MODULE: ./src/TextArea/index.ts
755
- ();
586
+ }), [ z, he, ve, F ]);
587
+ var Me = (0, r.useCallback)((function() {
588
+ var e = h({
589
+ height: Ce,
590
+ rowsMax: ae,
591
+ rowsMin: te,
592
+ shadow: Ae.current
593
+ });
594
+ if (e !== false) {
595
+ xe(e);
596
+ }
597
+ }), [ xe, Ae, ae, te, Ce ]);
598
+ var Ne = (0, r.useMemo)((function() {
599
+ return d()(Me, 100);
600
+ }), [ Me ]);
601
+ (0, r.useLayoutEffect)((function() {
602
+ Me();
603
+ }));
604
+ var qe = Q(Q({}, c()(pe, (function(e, n) {
605
+ return n === "role" || n.indexOf("aria-") === 0;
606
+ }))), {}, {
607
+ "aria-describedby": w,
608
+ "aria-labelledby": D,
609
+ "aria-invalid": A || undefined
610
+ });
611
+ var _e = l()(pe, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick" ].concat(H(a()(qe))));
612
+ var De = {
613
+ $append: o || undefined,
614
+ $error: A,
615
+ $prepend: Z || undefined
616
+ };
617
+ var $e = Q(Q({}, qe), {}, {
618
+ "data-test": "textbox",
619
+ autoCapitalize: i,
620
+ autoComplete: u,
621
+ autoCorrect: s,
622
+ autoFocus: p,
623
+ className: N,
624
+ disabled: g,
625
+ id: q,
626
+ maxLength: $,
627
+ name: F,
628
+ onBlur: Pe,
629
+ onChange: Be,
630
+ onFocus: Te,
631
+ onKeyDown: je,
632
+ onSelect: ke,
633
+ onClick: Ie,
634
+ placeholder: X,
635
+ // support HTML attribute
636
+ ref: Ee,
637
+ required: ne,
638
+ spellCheck: le,
639
+ style: {
640
+ height: Ce
641
+ },
642
+ tabIndex: de,
643
+ value: Oe,
644
+ $error: A
645
+ });
646
+
647
+ return t().createElement(t().Fragment, null, t().createElement(j, K({
648
+ tabIndex: -1,
649
+ "data-test": "text-area",
650
+ "data-test-value": Oe,
651
+ "data-test-disabled": g ? "disabled" : undefined,
652
+ elementRef: x,
653
+ $inline: P,
654
+ disabled: g
655
+ }, _e, De), ue && t().createElement(B, {
656
+ $disabled: !!g
657
+ }, ue), t().createElement(k, null, t().createElement(T, {
658
+ "aria-hidden": "true",
659
+ tabIndex: -1,
660
+ onChange: ce,
661
+ rows: te,
662
+ ref: Ae,
663
+ value: X && !Oe ? X : Oe
664
+ }), t().createElement(I, $e)), v, O && t().createElement(M, {
665
+ $disabled: !!g
666
+ }, O)), t().createElement(b(), {
667
+ target: L,
668
+ eventType: "resize",
669
+ listener: Ne
670
+ }));
671
+ }
672
+ se.propTypes = ue;
673
+ se.componentType = "TextArea";
674
+ /* harmony default export */ const de = se;
675
+ // only for styled components using TextArea
676
+ // CONCATENATED MODULE: ./src/TextArea/index.ts
756
677
  module.exports = n;
757
678
  /******/})();