@splunk/react-ui 5.3.0 → 5.5.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 +13 -13
  3. package/Badge.js +154 -0
  4. package/Breadcrumbs.js +66 -63
  5. package/ButtonSimple.js +52 -52
  6. package/CHANGELOG.md +43 -0
  7. package/CardLayout.js +39 -36
  8. package/Clickable.js +5 -6
  9. package/Code.js +917 -424
  10. package/CollapsiblePanel.js +1 -1
  11. package/Color.js +904 -1025
  12. package/ComboBox.js +6 -5
  13. package/DefinitionList.js +1 -1
  14. package/FormRows.js +13 -11
  15. package/JSONTree.js +682 -1408
  16. package/Link.js +74 -44
  17. package/MIGRATION.md +32 -1
  18. package/Markdown.js +9 -5
  19. package/Menu.js +100 -97
  20. package/Multiselect.js +1223 -2858
  21. package/Number.js +3 -3
  22. package/PhoneNumber.d.ts +2 -0
  23. package/PhoneNumber.js +769 -0
  24. package/Popover.js +235 -232
  25. package/RadioList.js +166 -151
  26. package/Resize.js +11 -8
  27. package/ResultsMenu.js +911 -1030
  28. package/ScreenReaderContent.js +86 -130
  29. package/Scroll.js +366 -425
  30. package/Select.js +267 -1947
  31. package/SelectBase.d.ts +2 -0
  32. package/SelectBase.js +1681 -0
  33. package/Slider.js +202 -199
  34. package/SlidingPanels.js +170 -175
  35. package/StepBar.js +123 -97
  36. package/Switch.js +137 -118
  37. package/TabBar.js +296 -295
  38. package/TabLayout.js +14 -14
  39. package/Table.js +1562 -1516
  40. package/TextArea.js +596 -684
  41. package/TransitionOpen.js +82 -74
  42. package/Tree.js +638 -682
  43. package/docker-compose.yml +99 -52
  44. package/package.json +16 -12
  45. package/stubs-splunkui.d.ts +0 -86
  46. package/test-runner-jest.config.js +1 -0
  47. package/types/src/Badge/Badge.d.ts +29 -0
  48. package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
  49. package/types/src/Badge/docs/examples/Count.d.ts +6 -0
  50. package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
  51. package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
  52. package/types/src/Badge/index.d.ts +2 -0
  53. package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
  54. package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
  55. package/types/src/Breadcrumbs/Item.d.ts +1 -1
  56. package/types/src/ButtonSimple/mixin.d.ts +1 -1
  57. package/types/src/Code/Code.d.ts +4 -3
  58. package/types/src/Code/index.d.ts +1 -0
  59. package/types/src/JSONTree/JSONTreeItem.d.ts +1 -1
  60. package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
  61. package/types/src/Link/Link.d.ts +4 -0
  62. package/types/src/Link/LinkContext.d.ts +14 -0
  63. package/types/src/Link/docs/examples/Visited.d.ts +7 -0
  64. package/types/src/Link/index.d.ts +1 -0
  65. package/types/src/Modal/ModalContext.d.ts +1 -1
  66. package/types/src/Multiselect/Compact.d.ts +3 -3
  67. package/types/src/Multiselect/Multiselect.d.ts +1 -1
  68. package/types/src/Multiselect/Normal.d.ts +2 -2
  69. package/types/src/Number/utils.d.ts +1 -1
  70. package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
  71. package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
  72. package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
  73. package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
  74. package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
  75. package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
  76. package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
  77. package/types/src/PhoneNumber/index.d.ts +2 -0
  78. package/types/src/PhoneNumber/utils.d.ts +47 -0
  79. package/types/src/Popover/getPlacement.d.ts +1 -1
  80. package/types/src/RadioList/Option.d.ts +7 -2
  81. package/types/src/RadioList/RadioListContext.d.ts +1 -1
  82. package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
  83. package/types/src/Select/Option.d.ts +8 -3
  84. package/types/src/Select/Select.d.ts +1 -1
  85. package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
  86. package/types/src/{Select → SelectBase}/SelectBase.d.ts +3 -1
  87. package/types/src/SelectBase/index.d.ts +2 -0
  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 +10 -1
  92. package/types/src/TabBar/Tab.d.ts +3 -1
  93. package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
  94. package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
  95. package/types/src/TabLayout/Panel.d.ts +2 -0
  96. package/types/src/Table/Body.d.ts +6 -1
  97. package/types/src/Table/Cell.d.ts +5 -1
  98. package/types/src/Table/Head.d.ts +6 -2
  99. package/types/src/Table/HeadCell.d.ts +5 -1
  100. package/types/src/Table/Row.d.ts +5 -1
  101. package/types/src/Table/Table.d.ts +21 -1
  102. package/types/src/Table/TableContext.d.ts +1 -0
  103. package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
  104. package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
  105. package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
  106. package/types/src/Tree/TreeContext.d.ts +1 -1
  107. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
  108. package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
  109. package/useControlled.js +61 -97
  110. package/usePrevious.d.ts +2 -0
  111. package/usePrevious.js +30 -62
  112. package/useResizeObserver.js +71 -136
  113. package/useRovingFocus.js +96 -41
  114. /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +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, n) => {
7
- // EXPORTS
8
- n.d(r, {
9
- default: () => /* reexport */ s
10
- });
11
- // UNUSED EXPORTS: isAllowedType, isPrimitive
12
- // EXTERNAL MODULE: external "react"
13
- var t = n(9497);
14
- // CONCATENATED MODULE: external "lodash/isEqual"
15
- const o = require("lodash/isEqual");
16
- // EXTERNAL MODULE: external "lodash/has"
17
- var a = n(5919);
18
- var i = n.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, n = e.componentName, o = n === void 0 ? "this component" : n, a = e.defaultValuePropName, l = a === void 0 ? "defaultValue" : a, u = e.valuePropName, c = u === void 0 ? "value" : u;
43
- var s = (0, t.useRef)(i()(r, c));
44
- var d = (0, t.useRef)(r[l]);
45
- (0, t.useEffect)((function() {
46
- if (false) {}
47
- }), [ o, r, l, c ]);
48
- (0, t.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 n(t) {
74
- /******/ // Check if module is in cache
75
- /******/ var o = r[t];
76
- /******/ if (o !== undefined) {
77
- /******/ return o.exports;
78
- /******/ }
79
- /******/ // Create a new module (and put it into the cache)
80
- /******/ var a = r[t] = {
81
- /******/ // no module.id needed
82
- /******/ // no module.loaded needed
83
- /******/ exports: {}
84
- /******/ };
85
- /******/
86
- /******/ // Execute the module function
87
- /******/ e[t](a, a.exports, n);
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
- /******/ n.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
- n.d(r, {
16
+ e.d(r, {
103
17
  a: r
104
18
  });
105
19
  /******/ return r;
@@ -109,10 +23,10 @@
109
23
  /******/ /* webpack/runtime/define property getters */
110
24
  /******/ (() => {
111
25
  /******/ // define getter functions for harmony exports
112
- /******/ n.d = (e, r) => {
26
+ /******/ e.d = (n, r) => {
113
27
  /******/ for (var t in r) {
114
- /******/ if (n.o(r, t) && !n.o(e, t)) {
115
- /******/ Object.defineProperty(e, t, {
28
+ /******/ if (e.o(r, t) && !e.o(n, t)) {
29
+ /******/ Object.defineProperty(n, t, {
116
30
  enumerable: true,
117
31
  get: r[t]
118
32
  });
@@ -123,14 +37,14 @@
123
37
  /******/
124
38
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
125
39
  /******/ (() => {
126
- /******/ n.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
- /******/ n.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"
@@ -142,625 +56,623 @@
142
56
  /******/ };
143
57
  /******/ })();
144
58
  /******/
145
- /************************************************************************/ var t = {};
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
- n.r(t);
150
- // EXPORTS
151
- n.d(t, {
152
- default: () => /* reexport */ se
153
- });
154
- // EXTERNAL MODULE: external "react"
155
- var e = n(9497);
156
- var r = n.n(e);
157
- // CONCATENATED MODULE: external "lodash/keys"
158
- const o = require("lodash/keys");
159
- var a = n.n(o);
160
- // CONCATENATED MODULE: external "lodash/omit"
161
- const i = require("lodash/omit");
162
- var l = n.n(i);
163
- // CONCATENATED MODULE: external "lodash/pickBy"
164
- const u = require("lodash/pickBy");
165
- var c = n.n(u);
166
- // CONCATENATED MODULE: external "lodash/throttle"
167
- const s = require("lodash/throttle");
168
- var d = n.n(s);
169
- // CONCATENATED MODULE: external "prop-types"
170
- const f = require("prop-types");
171
- var p = n.n(f);
172
- // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
173
- const v = require("@splunk/react-ui/EventListener");
174
- var m = n.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 b(e) {
197
- var r = e.height, n = e.rowsMax, t = 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("border-top-width"), 10);
207
- var c = parseInt(a.getPropertyValue("border-bottom-width"), 10);
208
- var s = o.scrollHeight + u + c;
209
- /* eslint-disable no-restricted-globals */
210
- // Leverage the global `isNaN` here for IE support, rather than Number.isNaN.
211
- // We know newHeight is numeric because we parseInt() above, so `isNaN` should be reliable.
212
- if (s === undefined || isNaN(s)) {
213
- return false;
214
- }
215
- /* eslint-enable no-restricted-globals */ if (n >= t) {
216
- var d = n * l + u + c;
217
- s = Math.min(d, s);
218
- }
219
- var f = t * l + u + c;
220
- s = Math.max(f, s);
221
- if (r !== s) {
222
- return s;
223
- }
59
+ /************************************************************************/ var n = {};
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;
224
138
  }
225
- return false;
226
139
  }
227
- // CONCATENATED MODULE: external "styled-components"
228
- const y = require("styled-components");
229
- var h = n.n(y);
230
- // CONCATENATED MODULE: external "@splunk/react-ui/Box"
231
- const g = require("@splunk/react-ui/Box");
232
- var w = n.n(g);
233
- // CONCATENATED MODULE: external "@splunk/themes"
234
- const x = require("@splunk/themes");
235
- // CONCATENATED MODULE: ./src/TextArea/TextAreaStyles.ts
236
- var C = "230px";
237
- var S = x.variables.spacingSmall;
238
- // variables.inputHeight can't be used with syncHeight/auto-expanding rows.
239
- // Use a custom value here to ensure the single-line TextArea matches the Text height
240
- // and keeps the vertical spacing above the label consistent (SUI-8053).
241
- var A = (0, x.pick)({
242
- comfortable: "5px",
243
- compact: "3px"
244
- });
245
- var O = h()(w()).withConfig({
246
- displayName: "TextAreaStyles__StyledBox",
247
- componentId: "gfy8yp-0"
248
- })([ "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:", ";}", " ", " ", " ", " ", "" ], x.variables.inputHeight, x.variables.inputBorderWidth, x.variables.interactiveColorBorder, x.variables.borderRadius, x.variables.interactiveColorBackground, A, S, x.variables.interactiveColorBorderHover, x.variables.focusShadow, x.variables.contentColorActive, (function(e) {
249
- var r = e.$error;
250
- return r && (0, y.css)([ "border-color:", ";&:hover:not([disabled]){border-color:", ";}" ], x.variables.interactiveColorAccentError, x.variables.interactiveColorAccentErrorStrong);
251
- }), (function(e) {
252
- var r = e.$append;
253
- return r && (0, y.css)([ "margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
254
- }), (function(e) {
255
- var r = e.$prepend;
256
- return r && (0, y.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
257
- }), (function(e) {
258
- var r = e.disabled;
259
- return r && (0, y.css)([ "background-color:", ";border-color:", ";box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);" ], x.variables.interactiveColorBackgroundDisabled, x.variables.interactiveColorBorderDisabled);
260
- }), (function(e) {
261
- var r = e.$inline;
262
- return r && (0, y.css)([ "display:inline-grid;width:", ";" ], C);
263
- }));
264
- // This wrapper ensures the textarea and shadow text area are the same width.
265
- // The wrapper's size is determined by the parent grid layout: the textarea and shadow
266
- // are both set to be 100% of the wrapper.
267
- // Having the same width is necessary for the height to be calculated correctly
268
- // so that the value wrapping behavior is correct
269
- var E = h().div.withConfig({
270
- displayName: "TextAreaStyles__StyledTextAreaAndShadowWrapper",
271
- componentId: "gfy8yp-1"
272
- })([ "", ";position:relative;overflow:hidden;flex-grow:1;grid-column:content;" ], x.mixins.reset("inline-flex"));
273
- var j = h().textarea.withConfig({
274
- displayName: "TextAreaStyles__StyledTextArea",
275
- componentId: "gfy8yp-2"
276
- })([ "", ";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:", ";}}" ], x.mixins.reset(), x.variables.contentColorActive, x.variables.contentColorMuted, x.variables.contentColorDisabled, x.variables.contentColorDisabled);
277
- var I = h()(j).withConfig({
278
- displayName: "TextAreaStyles__StyledTextAreaShadow",
279
- componentId: "gfy8yp-3"
280
- })([ "position:absolute;overflow:hidden;left:-10000px;top:-10000px;visibility:hidden;pointer-events:none;" ]);
281
- var k = (0, y.css)([ "display:inline-flex;min-height:1lh;align-self:start;align-items:center;justify-content:center;pointer-events:none;color:", ";", ";" ], x.variables.contentColorMuted, (function(e) {
282
- var r = e.$disabled;
283
- return r && (0, y.css)([ "cursor:not-allowed;color:", ";" ], x.variables.contentColorDisabled);
284
- }));
285
- var T = h().div.withConfig({
286
- displayName: "TextAreaStyles__StyledStartAdornment",
287
- componentId: "gfy8yp-4"
288
- })([ "", " grid-column:startAdornment;margin-inline-end:", ";" ], k, x.variables.spacingSmall);
289
- var P = h().div.withConfig({
290
- displayName: "TextAreaStyles__StyledEndAdornment",
291
- componentId: "gfy8yp-5"
292
- })([ "", " grid-column:endAdornment;margin-inline-start:", ";" ], k, x.variables.spacingSmall);
293
- // EXTERNAL MODULE: ./src/useControlled/index.ts + 2 modules
294
- var B = n(3639);
295
- // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
296
- /* eslint-disable @typescript-eslint/no-empty-function */
297
- var N = {
298
- body: {
299
- appendChild: function e() {
300
- return [];
301
- }
302
- },
303
- addEventListener: function e() {},
304
- removeEventListener: function e() {},
305
- activeElement: {
306
- blur: function e() {},
307
- nodeName: ""
308
- },
309
- querySelector: function e() {
310
- return null;
311
- },
312
- 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() {
313
213
  return [];
314
- },
315
- getElementById: function e() {
316
- return null;
317
- },
318
- createEvent: function e() {
319
- return {
320
- initEvent: function e() {}
321
- };
322
- },
323
- createElement: function e() {
324
- return {
325
- children: [],
326
- childNodes: [],
327
- style: {},
328
- setAttribute: function e() {},
329
- getElementsByTagName: function e() {
330
- return [];
331
- }
332
- };
333
- },
334
- createElementNS: function e() {
335
- return {};
336
- },
337
- importNode: function e() {
338
- return null;
339
- },
340
- location: {
341
- hash: "",
342
- host: "",
343
- hostname: "",
344
- href: "",
345
- origin: "",
346
- pathname: "",
347
- protocol: "",
348
- search: ""
349
214
  }
350
- };
351
- function q() {
352
- var e = typeof document !== "undefined" ? document : N;
353
- return e;
354
- }
355
- var M = q();
356
- /* harmony default export */ const _ = /* unused pure expression or super */ null && M;
357
- // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
358
- /* eslint-disable @typescript-eslint/no-empty-function */
359
- var D = {
360
- document: N,
361
- navigator: {
362
- userAgent: ""
363
- },
364
- location: {
365
- hash: "",
366
- host: "",
367
- hostname: "",
368
- href: "",
369
- origin: "",
370
- pathname: "",
371
- protocol: "",
372
- search: ""
373
- },
374
- history: {
375
- replaceState: function e() {},
376
- pushState: function e() {},
377
- go: function e() {},
378
- back: function e() {}
379
- },
380
- CustomEvent: function e() {
381
- return this;
382
- },
383
- addEventListener: function e() {},
384
- removeEventListener: function e() {},
385
- getComputedStyle: function e() {
386
- return {
387
- getPropertyValue: function e() {
388
- return "";
389
- }
390
- };
391
- },
392
- Image: function e() {},
393
- Date: function e() {},
394
- screen: {},
395
- setTimeout: function e() {},
396
- clearTimeout: function e() {},
397
- matchMedia: function e() {
398
- return {};
399
- },
400
- requestAnimationFrame: function e(r) {
401
- if (typeof setTimeout === "undefined") {
402
- r();
403
- 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 [];
404
244
  }
405
- return setTimeout(r, 0);
406
- },
407
- cancelAnimationFrame: function e(r) {
408
- if (typeof setTimeout === "undefined") {
409
- 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 "";
410
302
  }
411
- 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;
412
317
  }
413
- };
414
- function R() {
415
- var e = typeof window !== "undefined" ? window : D;
416
- return e;
318
+ return setTimeout(n, 0);
319
+ },
320
+ cancelAnimationFrame: function e(n) {
321
+ if (typeof setTimeout === "undefined") {
322
+ return;
323
+ }
324
+ clearTimeout(n);
417
325
  }
418
- var $ = R();
419
- /* harmony default export */ const F = $;
420
- // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
421
- /**
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
+ /**
422
335
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
423
336
  *
424
337
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
425
338
  * @param current - The new value of the ref.
426
339
  */
427
- function L(e, r) {
428
- if (e) {
429
- if (typeof e === "function") {
430
- e(r);
431
- } else {
432
- // the public signature of this util uses React.Ref<T> to mirror the way React types refs.
433
- // the intention here is to signal "we will take care of setting 'current', not you".
434
- 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;
435
348
  // eslint-disable-line no-param-reassign
436
- }
437
- }
438
- }
439
- // CONCATENATED MODULE: ./src/TextArea/TextArea.tsx
440
- function V(e) {
441
- "@babel/helpers - typeof";
442
- return V = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
443
- return typeof e;
444
- } : function(e) {
445
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
446
- }, V(e);
349
+ }
447
350
  }
448
- function z() {
449
- return z = Object.assign ? Object.assign.bind() : function(e) {
450
- for (var r = 1; r < arguments.length; r++) {
451
- var n = arguments[r];
452
- for (var t in n) {
453
- ({}).hasOwnProperty.call(n, t) && (e[t] = n[t]);
454
- }
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]);
455
367
  }
456
- return e;
457
- }, z.apply(null, arguments);
458
- }
459
- function K(e) {
460
- return U(e) || W(e) || re(e) || H();
461
- }
462
- function H() {
463
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
464
- }
465
- function W(e) {
466
- if ("undefined" != typeof Symbol && null != e[Symbol.iterator] || null != e["@@iterator"]) return Array.from(e);
467
- }
468
- function U(e) {
469
- if (Array.isArray(e)) return ne(e);
470
- }
471
- function G(e, r) {
472
- var n = Object.keys(e);
473
- if (Object.getOwnPropertySymbols) {
474
- var t = Object.getOwnPropertySymbols(e);
475
- r && (t = t.filter((function(r) {
476
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
477
- }))), n.push.apply(n, t);
478
- }
479
- return n;
480
- }
481
- function J(e) {
482
- for (var r = 1; r < arguments.length; r++) {
483
- var n = null != arguments[r] ? arguments[r] : {};
484
- r % 2 ? G(Object(n), !0).forEach((function(r) {
485
- Q(e, r, n[r]);
486
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : G(Object(n)).forEach((function(r) {
487
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
488
- }));
489
368
  }
490
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);
491
391
  }
492
- function Q(e, r, n) {
493
- return (r = X(r)) in e ? Object.defineProperty(e, r, {
494
- value: n,
495
- enumerable: !0,
496
- configurable: !0,
497
- writable: !0
498
- }) : e[r] = n, e;
499
- }
500
- function X(e) {
501
- var r = Y(e, "string");
502
- return "symbol" == V(r) ? r : r + "";
503
- }
504
- function Y(e, r) {
505
- if ("object" != V(e) || !e) return e;
506
- var n = e[Symbol.toPrimitive];
507
- if (void 0 !== n) {
508
- var t = n.call(e, r || "default");
509
- if ("object" != V(t)) return t;
510
- throw new TypeError("@@toPrimitive must return a primitive value.");
511
- }
512
- return ("string" === r ? String : Number)(e);
513
- }
514
- function Z(e, r) {
515
- return oe(e) || te(e, r) || re(e, r) || ee();
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
+ }));
516
402
  }
517
- function ee() {
518
- 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.");
519
424
  }
520
- function re(e, r) {
521
- if (e) {
522
- if ("string" == typeof e) return ne(e, r);
523
- var n = {}.toString.call(e).slice(8, -1);
524
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ne(e, r) : void 0;
525
- }
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;
526
438
  }
527
- function ne(e, r) {
528
- (null == r || r > e.length) && (r = e.length);
529
- for (var n = 0, t = Array(r); n < r; n++) {
530
- t[n] = e[n];
531
- }
532
- return t;
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];
533
444
  }
534
- function te(e, r) {
535
- var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
536
- if (null != n) {
537
- var t, 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 {
538
460
  try {
539
- if (a = (n = n.call(e)).next, 0 === r) {
540
- if (Object(n) !== n) return;
541
- u = !1;
542
- } else for (;!(u = (t = a.call(n)).done) && (l.push(t.value), l.length !== r); u = !0) {
543
- }
544
- } catch (e) {
545
- c = !0, o = e;
461
+ if (!u && null != r["return"] && (i = r["return"](), Object(i) !== i)) return;
546
462
  } finally {
547
- try {
548
- if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
549
- } finally {
550
- if (c) throw o;
551
- }
463
+ if (c) throw o;
552
464
  }
553
- return l;
554
465
  }
466
+ return l;
555
467
  }
556
- function oe(e) {
557
- if (Array.isArray(e)) return e;
558
- }
559
- function ae(e, r) {
560
- if (null == e) return {};
561
- var n, t, o = ie(e, r);
562
- if (Object.getOwnPropertySymbols) {
563
- var a = Object.getOwnPropertySymbols(e);
564
- for (t = 0; t < a.length; t++) {
565
- n = a[t], -1 === r.indexOf(n) && {}.propertyIsEnumerable.call(e, n) && (o[n] = e[n]);
566
- }
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]);
567
479
  }
568
- return o;
569
480
  }
570
- function ie(e, r) {
571
- if (null == e) return {};
572
- var n = {};
573
- for (var t in e) {
574
- if ({}.hasOwnProperty.call(e, t)) {
575
- if (-1 !== r.indexOf(t)) continue;
576
- n[t] = e[t];
577
- }
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];
578
490
  }
579
- return n;
580
491
  }
581
- /** @public */
582
- /** @public */
583
- /** @public */ var le = {
584
- append: p().bool,
585
- autoCapitalize: p().string,
586
- autoComplete: p().string,
587
- autoCorrect: p().string,
588
- autoFocus: p().bool,
589
- children: p().node,
590
- defaultValue: p().string,
591
- describedBy: p().string,
592
- disabled: p().bool,
593
- elementRef: p().oneOfType([ p().func, p().object ]),
594
- endAdornment: p().node,
595
- error: p().bool,
596
- inline: p().bool,
597
- /** @private. */
598
- inputClassName: p().string,
599
- inputId: p().string,
600
- inputRef: p().oneOfType([ p().func, p().object ]),
601
- labelledBy: p().string,
602
- maxLength: p().number,
603
- name: p().string,
604
- onBlur: p().func,
605
- onChange: p().func,
606
- onFocus: p().func,
607
- onKeyDown: p().func,
608
- onSelect: p().func,
609
- onInputClick: p().func,
610
- prepend: p().bool,
611
- /** @private. */
612
- required: p().bool,
613
- rowsMax: p().number,
614
- rowsMin: p().number,
615
- spellCheck: p().bool,
616
- tabIndex: p().number,
617
- startAdornment: p().node,
618
- value: p().string
619
- };
620
- var ue = function e() {};
621
- /** Note: TextArea places role and aria props onto the input. All other props are placed on the wrapper. */ function ce(n) {
622
- var t = n.append, o = t === void 0 ? false : t, i = n.autoCapitalize, u = n.autoComplete, s = n.autoCorrect, f = n.autoFocus, p = f === void 0 ? false : f, v = n.children, y = n.disabled, h = y === void 0 ? false : y, g = n.describedBy, w = n.defaultValue, x = n.elementRef, C = n.error, S = C === void 0 ? false : C, A = n.endAdornment, k = n.inline, N = k === void 0 ? false : k, q = n.inputClassName, M = n.inputId, _ = n.inputRef, D = n.labelledBy, R = n.maxLength, $ = n.name, V = n.onBlur, H = n.onChange, W = n.onFocus, U = n.onInputClick, G = n.onKeyDown, Q = n.onSelect, X = n.placeholder, Y = n.prepend, ee = Y === void 0 ? false : Y, re = n.required, ne = n.rowsMin, te = ne === void 0 ? 2 : ne, oe = n.rowsMax, ie = oe === void 0 ? 8 : oe, le = n.spellCheck, ce = n.startAdornment, se = n.tabIndex, de = se === void 0 ? 0 : se, fe = n.value, pe = ae(n, [ "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" ]);
623
- // @docs-props-type TextAreaPropsBase
624
- (0, e.useEffect)((function() {
625
- if (false) {}
626
- }), [ te, ie ]);
627
- var ve = (0, B["default"])({
628
- componentName: "TextArea",
629
- /* eslint-disable-next-line prefer-rest-params */
630
- 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
631
568
  });
632
- var me = (0, e.useState)(w || ""), be = Z(me, 2), ye = be[0], he = be[1];
633
- var ge = (0, e.useState)(), we = Z(ge, 2), xe = we[0], Ce = we[1];
634
- var Se = (0, e.useRef)(null);
635
- var Ae = (0, e.useRef)(null);
636
- var Oe = ve ? fe : ye;
637
- var Ee = (0, e.useCallback)((function(e) {
638
- Se.current = e;
639
- L(_, e);
640
- }), [ _, Se ]);
641
- var je = (0, e.useCallback)((function(e) {
642
- G === null || G === void 0 ? void 0 : G(e);
643
- }), [ G ]);
644
- var Ie = (0, e.useCallback)((function(e) {
645
- Q === null || Q === void 0 ? void 0 : Q(e);
646
- }), [ Q ]);
647
- var ke = (0, e.useCallback)((function(e) {
648
- U === null || U === void 0 ? void 0 : U(e);
649
- }), [ U ]);
650
- var Te = (0, e.useCallback)((function(e) {
651
- var r = e.target.value;
652
- W === null || W === void 0 ? void 0 : W(e, {
653
- value: r,
654
- name: $
655
- });
656
- }), [ $, W ]);
657
- var Pe = (0, e.useCallback)((function(e) {
658
- var r = e.target.value;
659
- V === null || V === void 0 ? void 0 : V(e, {
660
- value: r,
661
- name: $
662
- });
663
- }), [ $, V ]);
664
- var Be = (0, e.useCallback)((function(e) {
665
- var r = e.target.value;
666
- if (!ve) {
667
- he(r);
668
- }
669
- H === null || H === void 0 ? void 0 : H(e, {
670
- value: r,
671
- name: $
672
- });
673
- }), [ H, he, ve, $ ]);
674
- var Ne = (0, e.useCallback)((function() {
675
- var e = b({
676
- height: xe,
677
- rowsMax: ie,
678
- rowsMin: te,
679
- shadow: Ae.current
680
- });
681
- if (e !== false) {
682
- Ce(e);
683
- }
684
- }), [ Ce, Ae, ie, te, xe ]);
685
- var qe = (0, e.useMemo)((function() {
686
- return d()(Ne, 100);
687
- }), [ Ne ]);
688
- (0, e.useLayoutEffect)((function() {
689
- Ne();
690
- }));
691
- var Me = J(J({}, c()(pe, (function(e, r) {
692
- return r === "role" || r.indexOf("aria-") === 0;
693
- }))), {}, {
694
- "aria-describedby": g,
695
- "aria-labelledby": D,
696
- "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
697
575
  });
698
- var _e = l()(pe, [ "inputRef", "onBlur", "onChange", "onFocus", "onKeyDown", "onSelect", "onInputClick" ].concat(K(a()(Me))));
699
- var De = {
700
- $append: o || undefined,
701
- $error: S,
702
- $prepend: ee || undefined
703
- };
704
- var Re = J(J({}, Me), {}, {
705
- "data-test": "textbox",
706
- autoCapitalize: i,
707
- autoComplete: u,
708
- autoCorrect: s,
709
- autoFocus: p,
710
- className: q,
711
- disabled: h,
712
- id: M,
713
- maxLength: R,
714
- name: $,
715
- onBlur: Pe,
716
- onChange: Be,
717
- onFocus: Te,
718
- onKeyDown: je,
719
- onSelect: Ie,
720
- onClick: ke,
721
- placeholder: X,
722
- // support HTML attribute
723
- ref: Ee,
724
- required: re,
725
- spellCheck: le,
726
- style: {
727
- height: xe
728
- },
729
- tabIndex: de,
730
- value: Oe,
731
- $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
732
585
  });
733
-
734
- return r().createElement(r().Fragment, null, r().createElement(O, z({
735
- tabIndex: -1,
736
- "data-test": "text-area",
737
- "data-test-value": Oe,
738
- "data-test-disabled": h ? "disabled" : undefined,
739
- elementRef: x,
740
- $inline: N,
741
- disabled: h
742
- }, _e, De), ce && r().createElement(T, {
743
- $disabled: !!h
744
- }, ce), r().createElement(E, null, r().createElement(I, {
745
- "aria-hidden": "true",
746
- tabIndex: -1,
747
- onChange: ue,
748
- rows: te,
749
- ref: Ae,
750
- value: X && !Oe ? X : Oe
751
- }), r().createElement(j, Re)), v, A && r().createElement(P, {
752
- $disabled: !!h
753
- }, A)), r().createElement(m(), {
754
- target: F,
755
- eventType: "resize",
756
- listener: qe
757
- }));
758
- }
759
- ce.propTypes = le;
760
- ce.componentType = "TextArea";
761
- /* harmony default export */ const se = ce;
762
- // only for styled components using TextArea
763
- }) // CONCATENATED MODULE: ./src/TextArea/index.ts
764
- ();
765
- module.exports = t;
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
677
+ module.exports = n;
766
678
  /******/})();