@splunk/react-ui 5.3.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 (60) hide show
  1. package/Accordion.js +31 -31
  2. package/Avatar.js +13 -13
  3. package/Breadcrumbs.js +66 -63
  4. package/ButtonSimple.js +52 -52
  5. package/CHANGELOG.md +16 -0
  6. package/CardLayout.js +39 -36
  7. package/Clickable.js +5 -6
  8. package/Code.js +424 -528
  9. package/CollapsiblePanel.js +1 -1
  10. package/Color.js +903 -1025
  11. package/DefinitionList.js +1 -1
  12. package/FormRows.js +13 -11
  13. package/JSONTree.js +682 -1408
  14. package/Link.js +5 -5
  15. package/Markdown.js +9 -5
  16. package/Menu.js +72 -67
  17. package/Multiselect.js +2692 -2780
  18. package/Popover.js +201 -196
  19. package/Resize.js +11 -8
  20. package/ResultsMenu.js +913 -1030
  21. package/ScreenReaderContent.js +86 -130
  22. package/Scroll.js +366 -425
  23. package/Select.js +1741 -1832
  24. package/Slider.js +1 -1
  25. package/SlidingPanels.js +129 -127
  26. package/StepBar.js +123 -97
  27. package/Switch.js +115 -111
  28. package/TabBar.js +10 -10
  29. package/Table.js +1239 -1240
  30. package/TextArea.js +596 -684
  31. package/Tree.js +638 -682
  32. package/package.json +11 -11
  33. package/types/src/Breadcrumbs/Breadcrumbs.d.ts +1 -5
  34. package/types/src/Breadcrumbs/BreadcrumbsContext.d.ts +7 -0
  35. package/types/src/Breadcrumbs/Item.d.ts +1 -1
  36. package/types/src/ButtonSimple/mixin.d.ts +1 -1
  37. package/types/src/JSONTree/JSONTreeItem.d.ts +1 -1
  38. package/types/src/JSONTree/renderTreeItems.d.ts +1 -1
  39. package/types/src/Modal/ModalContext.d.ts +1 -1
  40. package/types/src/Multiselect/Compact.d.ts +2 -2
  41. package/types/src/Multiselect/Normal.d.ts +2 -2
  42. package/types/src/Number/utils.d.ts +1 -1
  43. package/types/src/Popover/getPlacement.d.ts +1 -1
  44. package/types/src/RadioList/Option.d.ts +1 -1
  45. package/types/src/RadioList/RadioListContext.d.ts +1 -1
  46. package/types/src/StepBar/StepBar.d.ts +4 -1
  47. package/types/src/StepBar/StepBarContext.d.ts +1 -0
  48. package/types/src/StepBar/docs/examples/Vertical.d.ts +6 -0
  49. package/types/src/Switch/Switch.d.ts +7 -1
  50. package/types/src/TabBar/Tab.d.ts +3 -1
  51. package/types/src/TabBar/docs/examples/Icons.d.ts +4 -0
  52. package/types/src/TabBar/docs/examples/Tooltips.d.ts +3 -0
  53. package/types/src/TabLayout/Panel.d.ts +2 -0
  54. package/types/src/Table/Head.d.ts +1 -1
  55. package/types/src/Table/Row.d.ts +1 -1
  56. package/types/src/Table/Table.d.ts +1 -0
  57. package/types/src/Tree/TreeContext.d.ts +1 -1
  58. package/useControlled.js +61 -97
  59. package/usePrevious.js +30 -62
  60. package/useResizeObserver.js +95 -127
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -44,10 +44,10 @@
44
44
  "@dnd-kit/sortable": "^8.0.0",
45
45
  "@dnd-kit/utilities": "^3.2.2",
46
46
  "@react-spring/web": "^9.7.5",
47
- "@splunk/react-icons": "^5.3.0",
48
- "@splunk/themes": "^1.2.1",
49
- "@splunk/ui-utils": "^1.10.0",
50
- "decimal.js-light": "^2.2.3",
47
+ "@splunk/react-icons": "^5.4.0",
48
+ "@splunk/themes": "^1.3.0",
49
+ "@splunk/ui-utils": "^1.11.0",
50
+ "decimal.js-light": "^2.5.1",
51
51
  "lodash": "^4.17.14",
52
52
  "moment": "^2.29.4",
53
53
  "prop-types": "^15.6.2",
@@ -60,9 +60,9 @@
60
60
  "@babel/core": "^7.28.0",
61
61
  "@babel/plugin-transform-runtime": "^7.28.0",
62
62
  "@splunk/babel-preset": "^4.0.0",
63
- "@splunk/docs-gen": "^1.1.1",
63
+ "@splunk/docs-gen": "^1.2.0",
64
64
  "@splunk/eslint-config": "^5.0.0",
65
- "@splunk/react-docs": "^1.3.0",
65
+ "@splunk/react-docs": "^1.4.0",
66
66
  "@splunk/stylelint-config": "^5.0.0",
67
67
  "@splunk/test-runner-utils": "^0.4.1",
68
68
  "@splunk/webpack-configs": "^7.0.2",
@@ -74,12 +74,12 @@
74
74
  "@storybook/react-webpack5": "^7.6.20",
75
75
  "@storybook/test-runner": "0.16.0",
76
76
  "@testing-library/cypress": "^9.0.0",
77
- "@testing-library/dom": "^10.4.0",
77
+ "@testing-library/dom": "^10.4.1",
78
78
  "@testing-library/jest-dom": "^6.6.3",
79
79
  "@testing-library/react": "^16.3.0",
80
80
  "@testing-library/react-hooks": "^8.0.1",
81
81
  "@testing-library/user-event": "^14.6.1",
82
- "@types/jest": "^29.5.14",
82
+ "@types/jest": "^30.0.0",
83
83
  "@types/lodash": "^4.14.156",
84
84
  "@types/node": "^18.16.0",
85
85
  "@types/prismjs": "^1.26.3",
@@ -118,8 +118,8 @@
118
118
  "fs-readdir-recursive": "^1.0.0",
119
119
  "glob": "^7.1.6",
120
120
  "http-server": "^14.1.1",
121
- "jest": "^29.7.0",
122
- "jest-environment-jsdom": "^29.7.0",
121
+ "jest": "^30.1.3",
122
+ "jest-environment-jsdom": "^30.1.2",
123
123
  "jest-image-snapshot": "^5.1.0",
124
124
  "jest-junit": "^10.0.0",
125
125
  "jest-stare": "^2.4.1",
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import BreadcrumbsContext from './BreadcrumbsContext';
3
4
  import Item from './Item';
4
5
  import { ComponentProps } from '../utils/types';
5
6
  /** @public */
@@ -27,11 +28,6 @@ interface BreadcrumbsPropsBase {
27
28
  onClick?: BreadcrumbsClickHandler;
28
29
  }
29
30
  type BreadcrumbsProps = ComponentProps<BreadcrumbsPropsBase, 'nav'>;
30
- type BreadcrumbsContextValue = {
31
- onClick?: BreadcrumbsClickHandler;
32
- prefix?: string;
33
- };
34
- declare const BreadcrumbsContext: React.Context<BreadcrumbsContextValue>;
35
31
  declare function Breadcrumbs({ children, elementRef, enableCurrentPage, onClick, ...otherProps }: BreadcrumbsProps): React.JSX.Element;
36
32
  declare namespace Breadcrumbs {
37
33
  var propTypes: {
@@ -0,0 +1,7 @@
1
+ import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
2
+ export interface BreadcrumbsContext {
3
+ onClick?: BreadcrumbsClickHandler;
4
+ prefix?: string;
5
+ }
6
+ export declare const BreadcrumbsContext: import("react").Context<BreadcrumbsContext>;
7
+ export default BreadcrumbsContext;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { BreadcrumbsClickHandler } from './Breadcrumbs';
3
+ import { BreadcrumbsClickHandler } from '@splunk/react-ui/Breadcrumbs';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  interface ItemPropsBase {
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { AnyTheme, Interpolation, InterpolationResult, ThemedProps } from '@splunk/themes';
2
2
  declare const buttonVariants: readonly ["primary", "secondary", "destructive", "destructiveSecondary", "subtle", "standalone"];
3
- type ButtonVariant = typeof buttonVariants[number];
3
+ type ButtonVariant = (typeof buttonVariants)[number];
4
4
  type ButtonStyleProps = ThemedProps & Partial<{
5
5
  $append: boolean;
6
6
  $prepend: boolean;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import { JSONElement } from '@splunk/react-ui/JSONTree';
3
4
  import { TreeItemPropsBase } from '@splunk/react-ui/Tree';
4
- import { JSONElement } from './JSONTree';
5
5
  import { ComponentProps } from '../utils/types';
6
6
  export type ExpandLinkRenderer = (params: {
7
7
  onToggleExpansion: (event: React.KeyboardEvent<HTMLLIElement> | React.MouseEvent<HTMLSpanElement>, data?: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from './JSONTree';
2
+ import { JSONElement, JSONTreeClickKeyHandler, JSONTreeClickValueHandler } from '@splunk/react-ui/JSONTree';
3
3
  type RenderTreeItemsProps = {
4
4
  baseId: string;
5
5
  defaultOpen?: boolean;
@@ -1,4 +1,4 @@
1
- import { ModalRequestCloseHandler } from './Modal';
1
+ import { ModalRequestCloseHandler } from '@splunk/react-ui/Modal';
2
2
  export interface ModalContext {
3
3
  divider?: 'header' | 'footer' | 'both' | 'none';
4
4
  titleId?: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from './Multiselect';
3
+ import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '@splunk/react-ui/Multiselect';
4
4
  import { SelectBaseProps } from '../Select/SelectBase';
5
5
  import { ComponentProps } from '../utils/types';
6
6
  interface CompactPropsBase {
@@ -196,7 +196,7 @@ declare namespace Compact {
196
196
  /** @private */
197
197
  virtualization: PropTypes.Requireable<number>;
198
198
  };
199
- var Option: typeof import("./Option").default;
199
+ var Option: typeof import("@splunk/react-ui/Multiselect").Option;
200
200
  var Divider: typeof import("@splunk/react-ui/Menu").Divider;
201
201
  var Heading: typeof import("@splunk/react-ui/Menu").Heading;
202
202
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from './Multiselect';
3
+ import { MultiselectChangeHandler, MultiselectFilterChangeHandler, MultiselectScrollBottomHandler } from '@splunk/react-ui/Multiselect';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  interface NormalPropsBase {
6
6
  /**
@@ -165,7 +165,7 @@ declare namespace Normal {
165
165
  tabConfirmsNewValue: PropTypes.Requireable<boolean>;
166
166
  values: PropTypes.Requireable<any[]>;
167
167
  };
168
- var Option: typeof import("./Option").default;
168
+ var Option: typeof import("@splunk/react-ui/Multiselect").Option;
169
169
  var Divider: typeof import("@splunk/react-ui/Menu").Divider;
170
170
  var Heading: typeof import("@splunk/react-ui/Menu").Heading;
171
171
  }
@@ -1,4 +1,4 @@
1
- declare const getDecimalSeparatorByLocale: (locale: string) => "." | ",";
1
+ declare const getDecimalSeparatorByLocale: (locale: string) => "," | ".";
2
2
  type LimitValueArgs = {
3
3
  val: number;
4
4
  min?: number;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { PopoverPlacement, PopoverPlacementStatus } from './Popover';
2
+ import { PopoverPlacement, PopoverPlacementStatus } from '@splunk/react-ui/Popover';
3
3
  interface ExtendedDOMRect extends DOMRect {
4
4
  middle: number;
5
5
  center: number;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { RadioListChangeHandler, RadioListValueTypes } from './RadioList';
3
+ import { RadioListChangeHandler, RadioListValueTypes } from '@splunk/react-ui/RadioList';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  interface OptionPropsBase {
6
6
  children?: React.ReactNode;
@@ -1,4 +1,4 @@
1
- import { RadioListChangeHandler, RadioListValueTypes } from './RadioList';
1
+ import { RadioListChangeHandler, RadioListValueTypes } from '@splunk/react-ui/RadioList';
2
2
  export interface RadioListContext {
3
3
  disabled?: boolean;
4
4
  error?: boolean;
@@ -17,15 +17,18 @@ interface StepBarPropsBase {
17
17
  * Setting inline to true makes the Step Bar an inline element. It assumes its minimum width.
18
18
  */
19
19
  inline?: boolean;
20
+ /** The flow direction of steps. */
21
+ orientation?: 'horizontal' | 'vertical';
20
22
  }
21
23
  type StepBarProps = ComponentProps<StepBarPropsBase, 'ul'>;
22
- declare function StepBar({ activeStepId, children, elementRef, inline, ...otherProps }: StepBarProps): React.JSX.Element;
24
+ declare function StepBar({ activeStepId, children, elementRef, inline, orientation, ...otherProps }: StepBarProps): React.JSX.Element;
23
25
  declare namespace StepBar {
24
26
  var propTypes: {
25
27
  activeStepId: PropTypes.Validator<any>;
26
28
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
27
29
  elementRef: PropTypes.Requireable<object>;
28
30
  inline: PropTypes.Requireable<boolean>;
31
+ orientation: PropTypes.Requireable<string>;
29
32
  };
30
33
  var Step: typeof import("./Step").default;
31
34
  }
@@ -2,6 +2,7 @@ export interface StepBarContext {
2
2
  activeStepId: number;
3
3
  idCounter?: string;
4
4
  lastChildIndex?: number;
5
+ orientation: 'horizontal' | 'vertical';
5
6
  }
6
7
  export declare const StepBarContext: import("react").Context<StepBarContext>;
7
8
  export default StepBarContext;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * @name Vertical
4
+ */
5
+ declare function Vertical(): React.JSX.Element;
6
+ export default Vertical;
@@ -20,6 +20,11 @@ interface SwitchPropsBase {
20
20
  */
21
21
  appearance?: 'checkbox' | 'toggle';
22
22
  children?: React.ReactNode;
23
+ /**
24
+ * The id of the description. When placed in a ControlGroup, this is automatically set to the
25
+ * ControlGroup's help component.
26
+ */
27
+ describedBy?: string;
23
28
  disabled?: boolean;
24
29
  /**
25
30
  * A React ref which is set to the DOM element when the component mounts, and null when it unmounts.
@@ -88,11 +93,12 @@ type SwitchProps = ComponentProps<SwitchCheckboxWithSomePropsBase | SwitchNoSome
88
93
  /**
89
94
  * `Switch` is a basic form control with an on/off state.
90
95
  */
91
- declare function Switch({ appearance, children, disabled, elementRef, error, id, inline, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, role, tabIndex, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
96
+ declare function Switch({ appearance, children, describedBy, disabled, elementRef, error, id, inline, labelledBy, onClick, required, selected, selectedLabel, someSelectedLabel, role, tabIndex, toggleRef, unselectedLabel, value, ...otherProps }: SwitchProps): React.JSX.Element;
92
97
  declare namespace Switch {
93
98
  var propTypes: {
94
99
  appearance: PropTypes.Requireable<string>;
95
100
  children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
101
+ describedBy: PropTypes.Requireable<string>;
96
102
  disabled: PropTypes.Requireable<boolean>;
97
103
  elementRef: PropTypes.Requireable<object>;
98
104
  error: PropTypes.Requireable<boolean>;
@@ -41,7 +41,9 @@ interface TabPropsBase {
41
41
  * instead of a <button> tag. */
42
42
  to?: string;
43
43
  /**
44
- * Content to show in a tooltip.
44
+ * Content to show in a tooltip when the user hovers over or focuses on the Tab.
45
+ *
46
+ * Note: The tooltip will override the label for the Tab for screen readers.
45
47
  */
46
48
  tooltip?: React.ReactNode;
47
49
  /**
@@ -1,6 +1,10 @@
1
1
  import React from 'react';
2
2
  /**
3
3
  * @name Icons
4
+ * @description Icons can be used in tabs to provide additional context.
5
+ * Use icons sparingly and only when they add value that the text alone cannot communicate.
6
+ *
7
+ * Icon only tabs are not recommended. If you do use an icon only tab, a tooltip is required to provide an accessible name to the tab.
4
8
  */
5
9
  declare function IconsLeft(): React.JSX.Element;
6
10
  export default IconsLeft;
@@ -1,6 +1,9 @@
1
1
  import React from 'react';
2
2
  /**
3
3
  * @name Tooltips
4
+ * @description Tooltips must be used when the entire tab label is not visible: e.g. due to truncation.
5
+ * The tooltip will override the accessible name of the tab.
6
+ * Tooltips should not be used to add a description or additional information.
4
7
  */
5
8
  declare function Tooltips(): React.JSX.Element;
6
9
  export default Tooltips;
@@ -22,6 +22,8 @@ interface PanelPropsBase {
22
22
  panelId: string;
23
23
  /**
24
24
  * Content to show in a tooltip when the user hovers over or focuses on the tab.
25
+ *
26
+ * Note: The tooltip will override the label for the Panel for screen readers.
25
27
  */
26
28
  tooltip?: React.ReactNode;
27
29
  /** Prevents user from clicking the tab. */
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { TableRequestMoveColumnHandler } from './Table';
3
+ import { TableRequestMoveColumnHandler } from '@splunk/react-ui/Table';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  type HeadAutosizeColumnHandler = (event: React.MouseEvent<HTMLHRElement>, data: {
6
6
  columnId?: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { TableRequestMoveRowHandler } from './Table';
3
+ import { TableRequestMoveRowHandler } from '@splunk/react-ui/Table';
4
4
  import { ComponentProps } from '../utils/types';
5
5
  /** @public */
6
6
  type RowActionPrimaryClickHandler = (event: React.MouseEvent, data?: any) => void;
@@ -119,6 +119,7 @@ interface TablePropsBase {
119
119
  /**
120
120
  * An event handler for resize of columns for the current column being resized. The function is passed an event and a data
121
121
  * object with `columnId`, `id`, `index`, and `width`.
122
+ * Every Table.HeadCell must have a width prop when using onRequestResizeColumn. Table with resizableFillLayout supports width of "auto".
122
123
  */
123
124
  onRequestResizeColumn?: TableRequestResizeColumnHandler;
124
125
  /**
@@ -1,5 +1,5 @@
1
+ import { RemoveNodeHandler, SetNodeHandler } from '@splunk/react-ui/Tree';
1
2
  import { TreeItemClickHandler, TreeItemKeyDownHandler } from './Item';
2
- import { RemoveNodeHandler, SetNodeHandler } from './Tree';
3
3
  export interface TreeContext {
4
4
  defaultIndent?: boolean;
5
5
  onItemKeyDown?: TreeItemKeyDownHandler;
package/useControlled.js CHANGED
@@ -1,67 +1,34 @@
1
1
  /******/ (() => {
2
2
  // webpackBootstrap
3
3
  /******/ "use strict";
4
- /******/ var e = {
5
- /***/ 5919:
6
- /***/ e => {
7
- e.exports = require("lodash/has");
8
- /***/ },
9
- /***/ 9497:
10
- /***/ e => {
11
- e.exports = require("react");
12
- /***/
13
- /******/ }
14
- };
15
- /************************************************************************/
16
- /******/ // The module cache
17
- /******/ var r = {};
18
- /******/
19
- /******/ // The require function
20
- /******/ function t(o) {
21
- /******/ // Check if module is in cache
22
- /******/ var n = r[o];
23
- /******/ if (n !== undefined) {
24
- /******/ return n.exports;
25
- /******/ }
26
- /******/ // Create a new module (and put it into the cache)
27
- /******/ var u = r[o] = {
28
- /******/ // no module.id needed
29
- /******/ // no module.loaded needed
30
- /******/ exports: {}
31
- /******/ };
32
- /******/
33
- /******/ // Execute the module function
34
- /******/ e[o](u, u.exports, t);
35
- /******/
36
- /******/ // Return the exports of the module
37
- /******/ return u.exports;
38
- /******/ }
4
+ /******/ // The require scope
5
+ /******/ var e = {};
39
6
  /******/
40
7
  /************************************************************************/
41
8
  /******/ /* webpack/runtime/compat get default export */
42
9
  /******/ (() => {
43
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
44
- /******/ t.n = e => {
45
- /******/ var r = e && e.__esModule ?
46
- /******/ () => e["default"]
47
- /******/ : () => e
11
+ /******/ e.n = r => {
12
+ /******/ var t = r && r.__esModule ?
13
+ /******/ () => r["default"]
14
+ /******/ : () => r
48
15
  /******/;
49
- t.d(r, {
50
- a: r
16
+ e.d(t, {
17
+ a: t
51
18
  });
52
- /******/ return r;
19
+ /******/ return t;
53
20
  /******/ };
54
21
  /******/ })();
55
22
  /******/
56
23
  /******/ /* webpack/runtime/define property getters */
57
24
  /******/ (() => {
58
25
  /******/ // define getter functions for harmony exports
59
- /******/ t.d = (e, r) => {
60
- /******/ for (var o in r) {
61
- /******/ if (t.o(r, o) && !t.o(e, o)) {
62
- /******/ Object.defineProperty(e, o, {
26
+ /******/ e.d = (r, t) => {
27
+ /******/ for (var o in t) {
28
+ /******/ if (e.o(t, o) && !e.o(r, o)) {
29
+ /******/ Object.defineProperty(r, o, {
63
30
  enumerable: true,
64
- get: r[o]
31
+ get: t[o]
65
32
  });
66
33
  /******/ }
67
34
  /******/ }
@@ -70,14 +37,14 @@
70
37
  /******/
71
38
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
72
39
  /******/ (() => {
73
- /******/ t.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
40
+ /******/ e.o = (e, r) => Object.prototype.hasOwnProperty.call(e, r)
74
41
  /******/;
75
42
  })();
76
43
  /******/
77
44
  /******/ /* webpack/runtime/make namespace object */
78
45
  /******/ (() => {
79
46
  /******/ // define __esModule on exports
80
- /******/ t.r = e => {
47
+ /******/ e.r = e => {
81
48
  /******/ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
82
49
  /******/ Object.defineProperty(e, Symbol.toStringTag, {
83
50
  value: "Module"
@@ -89,38 +56,36 @@
89
56
  /******/ };
90
57
  /******/ })();
91
58
  /******/
92
- /************************************************************************/ var o = {};
93
- // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
94
- (() => {
95
- // ESM COMPAT FLAG
96
- t.r(o);
97
- // EXPORTS
98
- t.d(o, {
99
- default: () => /* reexport */ l,
100
- isAllowedType: () => /* reexport */ f,
101
- isPrimitive: () => /* reexport */ a
102
- });
103
- // EXTERNAL MODULE: external "react"
104
- var e = t(9497);
105
- // CONCATENATED MODULE: external "lodash/isEqual"
106
- const r = require("lodash/isEqual");
107
- // EXTERNAL MODULE: external "lodash/has"
108
- var n = t(5919);
109
- var u = t.n(n);
110
- // CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
111
- function a(e) {
112
- return e === null || e === undefined || typeof e === "boolean" || typeof e === "string" || typeof e === "number";
59
+ /************************************************************************/ var r = {};
60
+ // ESM COMPAT FLAG
61
+ e.r(r);
62
+ // EXPORTS
63
+ e.d(r, {
64
+ default: () => /* reexport */ l,
65
+ isAllowedType: () => /* reexport */ f,
66
+ isPrimitive: () => /* reexport */ a
67
+ });
68
+ // CONCATENATED MODULE: external "react"
69
+ const t = require("react");
70
+ // CONCATENATED MODULE: external "lodash/isEqual"
71
+ const o = require("lodash/isEqual");
72
+ // CONCATENATED MODULE: external "lodash/has"
73
+ const n = require("lodash/has");
74
+ var u = e.n(n);
75
+ // CONCATENATED MODULE: ./src/useControlled/useControlled.tsx
76
+ function a(e) {
77
+ return e === null || e === undefined || typeof e === "boolean" || typeof e === "string" || typeof e === "number";
78
+ }
79
+ function f(e) {
80
+ if (a(e)) {
81
+ return true;
113
82
  }
114
- function f(e) {
115
- if (a(e)) {
116
- return true;
117
- }
118
- if (Array.isArray(e)) {
119
- return e.every(a);
120
- }
121
- return false;
83
+ if (Array.isArray(e)) {
84
+ return e.every(a);
122
85
  }
123
- /**
86
+ return false;
87
+ }
88
+ /**
124
89
  * This is a private component not intended for use outside @splunk/react-ui
125
90
  *
126
91
  * A hook that accepts a default value (as used in an uncontrolled component)
@@ -129,22 +94,21 @@
129
94
  * are not happening.
130
95
  *
131
96
  * Return the controlled state of the component.
132
- */ function i(r) {
133
- var t = r.componentProps, o = r.componentName, n = o === void 0 ? "this component" : o, a = r.defaultValuePropName, f = a === void 0 ? "defaultValue" : a, i = r.valuePropName, l = i === void 0 ? "value" : i;
134
- var s = (0, e.useRef)(u()(t, l));
135
- var d = (0, e.useRef)(t[f]);
136
- (0, e.useEffect)((function() {
137
- if (false) {}
138
- }), [ n, t, f, l ]);
139
- (0, e.useEffect)((function() {
140
- if (false) {}
141
- if (false) {}
142
- if (false) {}
143
- }), [ n, t, f, l ]);
144
- return s.current;
145
- }
146
- /* harmony default export */ const l = i;
147
- }) // CONCATENATED MODULE: ./src/useControlled/index.ts
148
- ();
149
- module.exports = o;
97
+ */ function i(e) {
98
+ var r = e.componentProps, o = e.componentName, n = o === void 0 ? "this component" : o, a = e.defaultValuePropName, f = a === void 0 ? "defaultValue" : a, i = e.valuePropName, l = i === void 0 ? "value" : i;
99
+ var s = (0, t.useRef)(u()(r, l));
100
+ var d = (0, t.useRef)(r[f]);
101
+ (0, t.useEffect)((function() {
102
+ if (false) {}
103
+ }), [ n, r, f, l ]);
104
+ (0, t.useEffect)((function() {
105
+ if (false) {}
106
+ if (false) {}
107
+ if (false) {}
108
+ }), [ n, r, f, l ]);
109
+ return s.current;
110
+ }
111
+ /* harmony default export */ const l = i;
112
+ // CONCATENATED MODULE: ./src/useControlled/index.ts
113
+ module.exports = r;
150
114
  /******/})();