@splunk/react-ui 5.4.0 → 5.6.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 (89) hide show
  1. package/AnchorMenu.d.ts +2 -0
  2. package/AnchorMenu.js +286 -0
  3. package/Badge.d.ts +2 -0
  4. package/Badge.js +154 -0
  5. package/CHANGELOG.md +42 -0
  6. package/Code.js +1097 -500
  7. package/Color.js +142 -141
  8. package/ComboBox.js +6 -5
  9. package/Link.js +74 -44
  10. package/MIGRATION.md +32 -1
  11. package/Menu.js +41 -43
  12. package/Multiselect.js +615 -2156
  13. package/Number.js +3 -3
  14. package/PhoneNumber.d.ts +2 -0
  15. package/PhoneNumber.js +769 -0
  16. package/Popover.js +73 -75
  17. package/RadioList.js +166 -151
  18. package/ResultsMenu.js +27 -29
  19. package/Select.js +179 -1768
  20. package/SelectBase.d.ts +2 -0
  21. package/SelectBase.js +1714 -0
  22. package/Slider.js +358 -302
  23. package/SlidingPanels.js +55 -62
  24. package/Switch.js +42 -27
  25. package/TabBar.js +295 -294
  26. package/TabLayout.js +14 -14
  27. package/Table.js +1087 -1040
  28. package/TransitionOpen.js +65 -58
  29. package/cypress/support/commands.ts +40 -0
  30. package/cypress/support/component.ts +1 -1
  31. package/cypress/support/index.d.ts +22 -0
  32. package/docker-compose.yml +99 -52
  33. package/package.json +9 -5
  34. package/stubs-splunkui.d.ts +0 -86
  35. package/test-runner-jest.config.js +1 -0
  36. package/types/src/AnchorMenu/AnchorMenu.d.ts +36 -0
  37. package/types/src/AnchorMenu/AnchorMenuContext.d.ts +6 -0
  38. package/types/src/AnchorMenu/Item.d.ts +35 -0
  39. package/types/src/AnchorMenu/docs/examples/Basic.d.ts +6 -0
  40. package/types/src/AnchorMenu/index.d.ts +3 -0
  41. package/types/src/Badge/Badge.d.ts +29 -0
  42. package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
  43. package/types/src/Badge/docs/examples/Count.d.ts +6 -0
  44. package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
  45. package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
  46. package/types/src/Badge/index.d.ts +2 -0
  47. package/types/src/Code/Code.d.ts +4 -3
  48. package/types/src/Code/index.d.ts +1 -0
  49. package/types/src/Link/Link.d.ts +4 -0
  50. package/types/src/Link/LinkContext.d.ts +14 -0
  51. package/types/src/Link/docs/examples/Visited.d.ts +7 -0
  52. package/types/src/Link/index.d.ts +1 -0
  53. package/types/src/Menu/Item.d.ts +1 -1
  54. package/types/src/Multiselect/Compact.d.ts +8 -1
  55. package/types/src/Multiselect/Multiselect.d.ts +8 -1
  56. package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
  57. package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
  58. package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
  59. package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
  60. package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
  61. package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
  62. package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
  63. package/types/src/PhoneNumber/index.d.ts +2 -0
  64. package/types/src/PhoneNumber/utils.d.ts +47 -0
  65. package/types/src/RadioList/Option.d.ts +6 -1
  66. package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
  67. package/types/src/Select/Option.d.ts +8 -3
  68. package/types/src/Select/Select.d.ts +1 -1
  69. package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
  70. package/types/src/{Select → SelectBase}/SelectBase.d.ts +11 -2
  71. package/types/src/SelectBase/index.d.ts +2 -0
  72. package/types/src/Slider/Slider.d.ts +7 -1
  73. package/types/src/Switch/Switch.d.ts +4 -1
  74. package/types/src/Table/Body.d.ts +6 -1
  75. package/types/src/Table/Cell.d.ts +5 -1
  76. package/types/src/Table/Head.d.ts +6 -2
  77. package/types/src/Table/HeadCell.d.ts +5 -1
  78. package/types/src/Table/Row.d.ts +5 -1
  79. package/types/src/Table/Table.d.ts +20 -1
  80. package/types/src/Table/TableContext.d.ts +1 -0
  81. package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
  82. package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
  83. package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
  84. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
  85. package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
  86. package/usePrevious.d.ts +2 -0
  87. package/useResizeObserver.js +59 -92
  88. package/useRovingFocus.js +96 -41
  89. /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
package/useRovingFocus.js CHANGED
@@ -8,12 +8,12 @@
8
8
  /******/ /* webpack/runtime/define property getters */
9
9
  /******/ (() => {
10
10
  /******/ // define getter functions for harmony exports
11
- /******/ e.d = (t, r) => {
12
- /******/ for (var n in r) {
13
- /******/ if (e.o(r, n) && !e.o(t, n)) {
14
- /******/ Object.defineProperty(t, n, {
11
+ /******/ e.d = (r, t) => {
12
+ /******/ for (var n in t) {
13
+ /******/ if (e.o(t, n) && !e.o(r, n)) {
14
+ /******/ Object.defineProperty(r, n, {
15
15
  enumerable: true,
16
- get: r[n]
16
+ get: t[n]
17
17
  });
18
18
  /******/ }
19
19
  /******/ }
@@ -22,7 +22,7 @@
22
22
  /******/
23
23
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
24
24
  /******/ (() => {
25
- /******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
25
+ /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
26
26
  /******/;
27
27
  })();
28
28
  /******/
@@ -41,19 +41,70 @@
41
41
  /******/ };
42
42
  /******/ })();
43
43
  /******/
44
- /************************************************************************/ var t = {};
44
+ /************************************************************************/ var r = {};
45
45
  // ESM COMPAT FLAG
46
- e.r(t);
46
+ e.r(r);
47
47
  // EXPORTS
48
- e.d(t, {
49
- default: () => /* reexport */ u
48
+ e.d(r, {
49
+ default: () => /* reexport */ s
50
50
  });
51
51
  // CONCATENATED MODULE: external "react"
52
- const r = require("react");
52
+ const t = require("react");
53
53
  // CONCATENATED MODULE: external "@splunk/ui-utils/focus"
54
54
  const n = require("@splunk/ui-utils/focus");
55
55
  // CONCATENATED MODULE: ./src/useRovingFocus/useRovingFocus.tsx
56
- var a = {
56
+ function o(e) {
57
+ "@babel/helpers - typeof";
58
+ return o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
59
+ return typeof e;
60
+ } : function(e) {
61
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
62
+ }, o(e);
63
+ }
64
+ function u(e, r) {
65
+ var t = Object.keys(e);
66
+ if (Object.getOwnPropertySymbols) {
67
+ var n = Object.getOwnPropertySymbols(e);
68
+ r && (n = n.filter((function(r) {
69
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
70
+ }))), t.push.apply(t, n);
71
+ }
72
+ return t;
73
+ }
74
+ function i(e) {
75
+ for (var r = 1; r < arguments.length; r++) {
76
+ var t = null != arguments[r] ? arguments[r] : {};
77
+ r % 2 ? u(Object(t), !0).forEach((function(r) {
78
+ a(e, r, t[r]);
79
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : u(Object(t)).forEach((function(r) {
80
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
81
+ }));
82
+ }
83
+ return e;
84
+ }
85
+ function a(e, r, t) {
86
+ return (r = c(r)) in e ? Object.defineProperty(e, r, {
87
+ value: t,
88
+ enumerable: !0,
89
+ configurable: !0,
90
+ writable: !0
91
+ }) : e[r] = t, e;
92
+ }
93
+ function c(e) {
94
+ var r = f(e, "string");
95
+ return "symbol" == o(r) ? r : r + "";
96
+ }
97
+ function f(e, r) {
98
+ if ("object" != o(e) || !e) return e;
99
+ var t = e[Symbol.toPrimitive];
100
+ if (void 0 !== t) {
101
+ var n = t.call(e, r || "default");
102
+ if ("object" != o(n)) return n;
103
+ throw new TypeError("@@toPrimitive must return a primitive value.");
104
+ }
105
+ return ("string" === r ? String : Number)(e);
106
+ }
107
+ var l = {
57
108
  enableLoop: false,
58
109
  orientation: "horizontal",
59
110
  enableTab: false,
@@ -78,48 +129,52 @@
78
129
  * <button type="button">second</button>
79
130
  * </div>
80
131
  * ```
81
- */ function o() {
82
- var e = (0, r.useRef)(0);
83
- var t = (0, r.useRef)([]);
84
- var o = function r(n) {
85
- e.current = n;
86
- t.current.forEach((function(t, r) {
87
- return r === e.current ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", "-1");
132
+ */ function b() {
133
+ var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
134
+ var r = (0, t.useRef)(0);
135
+ var o = (0, t.useRef)([]);
136
+ var u = i(i({}, l), e);
137
+ var a = function e(t) {
138
+ r.current = t;
139
+ o.current.forEach((function(e, t) {
140
+ return t === r.current ? e.removeAttribute("tabindex") : e.setAttribute("tabindex", "-1");
88
141
  }));
89
142
  };
90
- var u = function r(a) {
91
- t.current = a != null ? (0, n.getSortedTabbableElements)(a, {
143
+ var c = function e(t) {
144
+ o.current = t != null ? (0, n.getSortedTabbableElements)(t, {
92
145
  ignoreTabIndex: true
93
146
  }) : [];
94
- o(e.current);
147
+ a(r.current);
95
148
  };
96
- var i = function e(r) {
97
- var n = r.relatedTarget instanceof Element && t.current.includes(r.relatedTarget);
98
- if (!n) {
99
- o(0);
149
+ var f = function e(r) {
150
+ var t = r.relatedTarget instanceof HTMLElement && o.current.includes(r.relatedTarget);
151
+ if (!t) {
152
+ a(0);
100
153
  }
101
154
  };
102
- var c = function e(r) {
103
- var n = r.target instanceof Element ? t.current.indexOf(r.target) : -1;
104
- if (n >= 0) {
105
- o(n);
155
+ var b = function e(r) {
156
+ var t = r.target instanceof HTMLElement ? o.current.indexOf(r.target) : -1;
157
+ if (t >= 0) {
158
+ a(t);
106
159
  }
107
160
  };
108
- var l = function e(r) {
109
- var o = t.current.includes(r.nativeEvent.target);
110
- /* Only apply focus if we are among the navigable items in this container */ if (r.nativeEvent.target instanceof HTMLElement && o) {
111
- var u = t.current.indexOf(r.nativeEvent.target);
112
- (0, n.handleFocus)(r.key, t.current, u, a);
161
+ var s = function e(r) {
162
+ var t = r.nativeEvent.target;
163
+ var i = t instanceof HTMLElement ? o.current.indexOf(t) : -1;
164
+ if (i === -1) {
165
+ return;
113
166
  }
167
+ /* Only apply focus if we are among the navigable items in this container */ (0,
168
+ n.handleFocus)(r.key, o.current, i, u);
114
169
  };
115
170
  return {
116
- ref: u,
117
- onBlur: i,
118
- onFocus: c,
119
- onKeyDown: l
171
+ ref: c,
172
+ onBlur: f,
173
+ onFocus: b,
174
+ onKeyDown: s
120
175
  };
121
176
  }
122
- /* harmony default export */ const u = o;
177
+ /* harmony default export */ const s = b;
123
178
  // CONCATENATED MODULE: ./src/useRovingFocus/index.ts
124
- module.exports = t;
179
+ module.exports = r;
125
180
  /******/})();