@splunk/react-ui 4.28.0 → 4.28.2

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.
package/WaitSpinner.js CHANGED
@@ -67,8 +67,8 @@
67
67
  const r = require("react");
68
68
  var i = e.n(r);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
- const a = require("prop-types");
71
- var n = e.n(a);
70
+ const n = require("prop-types");
71
+ var a = e.n(n);
72
72
  // CONCATENATED MODULE: external "@splunk/react-ui/AnimationToggle"
73
73
  const s = require("@splunk/react-ui/AnimationToggle");
74
74
  // CONCATENATED MODULE: external "@splunk/themes"
@@ -160,11 +160,11 @@
160
160
  function x(e, t) {
161
161
  if (e == null) return {};
162
162
  var r = S(e, t);
163
- var i, a;
163
+ var i, n;
164
164
  if (Object.getOwnPropertySymbols) {
165
- var n = Object.getOwnPropertySymbols(e);
166
- for (a = 0; a < n.length; a++) {
167
- i = n[a];
165
+ var a = Object.getOwnPropertySymbols(e);
166
+ for (n = 0; n < a.length; n++) {
167
+ i = a[n];
168
168
  if (t.indexOf(i) >= 0) continue;
169
169
  if (!Object.prototype.propertyIsEnumerable.call(e, i)) continue;
170
170
  r[i] = e[i];
@@ -176,21 +176,21 @@
176
176
  if (e == null) return {};
177
177
  var r = {};
178
178
  var i = Object.keys(e);
179
- var a, n;
180
- for (n = 0; n < i.length; n++) {
181
- a = i[n];
182
- if (t.indexOf(a) >= 0) continue;
183
- r[a] = e[a];
179
+ var n, a;
180
+ for (a = 0; a < i.length; a++) {
181
+ n = i[a];
182
+ if (t.indexOf(n) >= 0) continue;
183
+ r[n] = e[n];
184
184
  }
185
185
  return r;
186
186
  }
187
- var z = {
188
- elementRef: n().oneOfType([ n().func, n().object ]),
189
- screenReaderText: n().string,
190
- size: n().oneOf([ "small", "medium", "large" ])
187
+ var O = {
188
+ elementRef: a().oneOfType([ a().func, a().object ]),
189
+ screenReaderText: a().oneOfType([ a().string, a().oneOf([ "null" ]) ]),
190
+ size: a().oneOf([ "small", "medium", "large" ])
191
191
  };
192
- function O(e) {
193
- var t = e.elementRef, r = e.screenReaderText, a = r === void 0 ? (0, l._)("Waiting") : r, n = e.size, c = n === void 0 ? "small" : n, m = x(e, [ "elementRef", "screenReaderText", "size" ]);
192
+ function z(e) {
193
+ var t = e.elementRef, r = e.screenReaderText, n = r === void 0 ? (0, l._)("Waiting") : r, a = e.size, c = a === void 0 ? "small" : a, m = x(e, [ "elementRef", "screenReaderText", "size" ]);
194
194
  // @docs-props-type WaitSpinnerPropsBase
195
195
  var f = (0, s.useAnimationToggle)() === "on";
196
196
  var d = (0, o.useSplunkTheme)(), u = d.isPrisma;
@@ -205,7 +205,7 @@
205
205
  ref: t,
206
206
  $animated: f,
207
207
  $size: c
208
- }, a && i().createElement("title", null, a), i().createElement("g", null, u ? i().createElement(i().Fragment, null, i().createElement(g, {
208
+ }, n && i().createElement("title", null, n), i().createElement("g", null, u ? i().createElement(i().Fragment, null, i().createElement(g, {
209
209
  r: "19",
210
210
  cx: "20",
211
211
  cy: "20",
@@ -223,8 +223,8 @@
223
223
  r: "8.5"
224
224
  }))));
225
225
  }
226
- O.propTypes = z;
227
- /* harmony default export */ const _ = O;
226
+ z.propTypes = O;
227
+ /* harmony default export */ const _ = z;
228
228
  // CONCATENATED MODULE: ./src/WaitSpinner/index.ts
229
229
  module.exports = t;
230
230
  /******/})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.28.0",
3
+ "version": "4.28.2",
4
4
  "description": "Library of React components that implement the Splunk design language",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Splunk Inc.",
@@ -43,7 +43,7 @@
43
43
  "@dnd-kit/sortable": "7.0.2",
44
44
  "@dnd-kit/utilities": "3.2.1",
45
45
  "@splunk/react-icons": "^4.3.0",
46
- "@splunk/themes": "^0.16.4",
46
+ "@splunk/themes": "^0.17.0",
47
47
  "@splunk/ui-utils": "^1.6.0",
48
48
  "commonmark": "^0.30.0",
49
49
  "commonmark-react-renderer": "^4.3.2",
@@ -16,6 +16,7 @@ declare type CollapsiblePanelRequestOpenHandler = (data: {
16
16
  }) => void;
17
17
  /** @public */
18
18
  declare type CollapsiblePanelChangeHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
19
+ action: 'open' | 'close';
19
20
  panelId?: string | number;
20
21
  reason: 'toggleClick';
21
22
  }) => void;
@@ -66,9 +67,8 @@ interface CollapsiblePanelPropsBase {
66
67
  */
67
68
  onRequestOpen?: CollapsiblePanelRequestOpenHandler;
68
69
  /**
69
- * Invoked on a change of the open panel. Callback is passed data, such as
70
- * the `panelId` of the `CollapsiblePanel` that originated the expand request.
71
- * `panelId` is `undefined` when the open panel is collapsed.
70
+ * Invoked on a change of the open panel.
71
+ * Callback is passed the `panelId` of the `CollapsiblePanel` that originated the expand request and the `action` ("open" or "close")
72
72
  */
73
73
  onChange?: CollapsiblePanelChangeHandler;
74
74
  /**
@@ -102,7 +102,7 @@ interface CollapsiblePanelDeprecatedControlledProps extends CollapsiblePanelProp
102
102
  defaultOpen?: never;
103
103
  onRequestOpen?: CollapsiblePanelRequestOpenHandler;
104
104
  onRequestClose?: CollapsiblePanelRequestCloseHandler;
105
- onChange: never;
105
+ onChange?: never;
106
106
  open?: boolean;
107
107
  }
108
108
  interface CollapsiblePanelControlledProps extends CollapsiblePanelPropsBase {
@@ -133,6 +133,7 @@ declare class CollapsiblePanel extends Component<CollapsiblePanelProps, Collapsi
133
133
  constructor(props: Readonly<CollapsiblePanelProps>);
134
134
  componentDidMount(): void;
135
135
  componentDidUpdate(prevProps: Readonly<CollapsiblePanelProps>): void;
136
+ private isOpen;
136
137
  private handleRequestClose;
137
138
  private handleRequestOpen;
138
139
  private handleChange;
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
3
3
  import { ComponentProps } from '../utils/types';
4
4
  /** @public */
5
5
  declare type SingleOpenPanelGroupChangeHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
6
- openPanelId?: string | number | null;
6
+ action: 'open' | 'close';
7
+ panelId?: string | number;
7
8
  reason: 'toggleClick';
8
9
  }) => void;
9
10
  interface SingleOpenPanelGroupPropsBase {
@@ -26,9 +27,8 @@ interface SingleOpenPanelGroupPropsBase {
26
27
  */
27
28
  inset?: boolean;
28
29
  /**
29
- * Invoked on a change of the open panel. Callback is passed data, such as
30
- * the `panelId` of the `CollapsiblePanel` that originated the expand request.
31
- * `panelId` is `undefined` when the open panel is collapsed.
30
+ * Invoked on a change of the open panel.
31
+ * Callback is passed the `panelId` of the `CollapsiblePanel` that originated the expand request and the `action` ("open" or "close")
32
32
  */
33
33
  onChange?: SingleOpenPanelGroupChangeHandler;
34
34
  /**
@@ -19,6 +19,11 @@ interface ModalPropsBase {
19
19
  * `Modal.Header`, `Modal.Body`, and `Modal.Footer`.
20
20
  */
21
21
  children?: React.ReactNode;
22
+ /**
23
+ * @private
24
+ * Set to 'true' to enable closing the Modal by clicking outside of it.
25
+ */
26
+ closeOnClickAway?: boolean;
22
27
  /**
23
28
  * Show dividers between header, body and footer.
24
29
  */
@@ -52,7 +57,7 @@ interface ModalPropsBase {
52
57
  focus: () => void;
53
58
  }) | HTMLElement | null> | (() => void);
54
59
  }
55
- declare const defaultProps: Required<Pick<ModalPropsBase, 'initialFocus' | 'open' | 'divider'>>;
60
+ declare const defaultProps: Required<Pick<ModalPropsBase, 'closeOnClickAway' | 'divider' | 'initialFocus' | 'open'>>;
56
61
  declare type ModalProps = ClassComponentProps<ModalPropsBase, typeof defaultProps, 'div'>;
57
62
  declare class Modal extends Component<ModalProps> {
58
63
  private el;
@@ -60,8 +65,8 @@ declare class Modal extends Component<ModalProps> {
60
65
  private initialFocus;
61
66
  private headerTitleId;
62
67
  private headerSubtitleId;
63
- static propTypes: React.WeakValidationMap<ClassComponentProps<ModalPropsBase, Required<Pick<ModalPropsBase, "open" | "divider" | "initialFocus">>, "div", never>>;
64
- static defaultProps: Required<Pick<ModalPropsBase, "open" | "divider" | "initialFocus">>;
68
+ static propTypes: React.WeakValidationMap<ClassComponentProps<ModalPropsBase, Required<Pick<ModalPropsBase, "open" | "divider" | "closeOnClickAway" | "initialFocus">>, "div", never>>;
69
+ static defaultProps: Required<Pick<ModalPropsBase, "open" | "divider" | "closeOnClickAway" | "initialFocus">>;
65
70
  static Header: typeof Header;
66
71
  static Body: typeof Body;
67
72
  static Footer: typeof Footer;
@@ -10,6 +10,11 @@ declare type ModalLayerRequestCloseHandler = (data: {
10
10
  reason: 'clickAway' | 'escapeKey';
11
11
  }) => void;
12
12
  interface ModalLayerPropsBase {
13
+ /**
14
+ * Indicate whether the animation of the children is still running.
15
+ * If true, the ModalLayer should not close.
16
+ */
17
+ childrenInAnimation?: boolean;
13
18
  /**
14
19
  * A function that returns a default style object for react-spring. The values will be
15
20
  * used as initial values.
@@ -20,32 +25,27 @@ interface ModalLayerPropsBase {
20
25
  * will be passed to `renderModal`.
21
26
  */
22
27
  getMotionStyle?: () => AdditionalInterpolationProperties;
23
- /**
24
- * Indicate whether the animation of the children is still running.
25
- * If true, the ModalLayer should not close.
26
- */
27
- childrenInAnimation?: boolean;
28
28
  /**
29
29
  * A function that will be called when a close event occurs.
30
30
  * The callback will be passed a reason (either 'escapeKey', 'clickAway') and the event.
31
31
  */
32
32
  onRequestClose?: ModalLayerRequestCloseHandler;
33
+ /**
34
+ * Indicates whether the modal is currently open.
35
+ */
36
+ open?: boolean;
33
37
  /**
34
38
  * Function that renders the modal. It is passed the current style object as interpolated by react-spring,
35
39
  * and is expected to return renderable content.
36
40
  */
37
41
  renderModal: ModalLayerRenderModalHandler;
38
42
  /**
39
- * Indicates whether to add an overlay mask on the whole page, blocking other interactions
40
- * while the Modal is open.
43
+ * The non-hidden overlay mask covers the entire page, blocks other interactions while the Modal is open.
44
+ * If set to `interactive`, clicking on the scrim will close the Modal.
41
45
  */
42
- useLayerForClickAway?: boolean;
43
- /**
44
- * Indicates whether the modal is currently open.
45
- */
46
- open?: boolean;
46
+ scrim?: 'visible' | 'hidden' | 'interactive';
47
47
  }
48
- declare const defaultProps: Required<Pick<ModalLayerPropsBase, 'childrenInAnimation' | 'open' | 'useLayerForClickAway'>>;
48
+ declare const defaultProps: Required<Pick<ModalLayerPropsBase, 'childrenInAnimation' | 'open' | 'scrim'>>;
49
49
  declare type ModalLayerProps = ModalLayerPropsBase & typeof defaultProps;
50
50
  interface ModalLayerState {
51
51
  animating: boolean;
@@ -53,7 +53,7 @@ interface ModalLayerState {
53
53
  }
54
54
  declare class ModalLayer extends Component<ModalLayerProps, ModalLayerState> {
55
55
  static propTypes: React.WeakValidationMap<ModalLayerProps>;
56
- static defaultProps: Required<Pick<ModalLayerPropsBase, "open" | "childrenInAnimation" | "useLayerForClickAway">>;
56
+ static defaultProps: Required<Pick<ModalLayerPropsBase, "open" | "childrenInAnimation" | "scrim">>;
57
57
  static getDerivedStateFromProps: React.GetDerivedStateFromProps<ModalLayerProps, ModalLayerState>;
58
58
  private allowAnimationUpdates;
59
59
  constructor(props: Readonly<ModalLayerProps>);
@@ -66,8 +66,8 @@ interface SidePanelState {
66
66
  prevOpen: boolean;
67
67
  }
68
68
  declare class SidePanel extends Component<SidePanelProps, SidePanelState> {
69
- static propTypes: React.WeakValidationMap<ClassComponentProps<SidePanelPropsBase, Required<Pick<SidePanelPropsBase, "open" | "useLayerForClickAway" | "dockPosition">>, "div", never>>;
70
- static defaultProps: Required<Pick<SidePanelPropsBase, "open" | "useLayerForClickAway" | "dockPosition">>;
69
+ static propTypes: React.WeakValidationMap<ClassComponentProps<SidePanelPropsBase, Required<Pick<SidePanelPropsBase, "open" | "dockPosition" | "useLayerForClickAway">>, "div", never>>;
70
+ static defaultProps: Required<Pick<SidePanelPropsBase, "open" | "dockPosition" | "useLayerForClickAway">>;
71
71
  static getDerivedStateFromProps: React.GetDerivedStateFromProps<SidePanelProps, SidePanelState>;
72
72
  constructor(props: Readonly<SidePanelProps>);
73
73
  private handlePanelAnimationEnd;
@@ -9,7 +9,7 @@ interface WaitSpinnerPropsBase {
9
9
  elementRef?: React.Ref<SVGSVGElement>;
10
10
  /** A string to display to screen readers. Set the prop to `null` or an empty string to hide the
11
11
  * spinner from screen readers, such as when there is already a text label beside it. */
12
- screenReaderText?: string;
12
+ screenReaderText?: string | null;
13
13
  /**
14
14
  * Size of WaitSpinner.
15
15
  * `large` is not supported in enterprise themes; falls back to `medium`.