@splunk/react-ui 4.28.1 → 4.29.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.
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"
@@ -77,16 +77,16 @@
77
77
  const l = require("@splunk/ui-utils/i18n");
78
78
  // CONCATENATED MODULE: external "styled-components"
79
79
  const c = require("styled-components");
80
- var m = e.n(c);
80
+ var f = e.n(c);
81
81
  // CONCATENATED MODULE: ./src/WaitSpinner/WaitSpinnerStyles.ts
82
- var p = m().div.withConfig({
82
+ var m = f().div.withConfig({
83
83
  displayName: "WaitSpinnerStyles__Styled",
84
84
  componentId: "sc-1nu971z-0"
85
85
  })([ "", ";align-items:center;" ], o.mixins.reset("inline-flex"));
86
- var f = (0, c.keyframes)([ "100%{transform:rotate(360deg);}" ]);
86
+ var p = (0, c.keyframes)([ "100%{transform:rotate(360deg);}" ]);
87
87
  var d = (0, c.keyframes)([ "0%{transform:scale(0);opacity:0;}100%{transform:scale(1);opacity:1;}" ]);
88
88
  var u = "2.07s";
89
- var y = m().svg.withConfig({
89
+ var y = f().svg.withConfig({
90
90
  displayName: "WaitSpinnerStyles__StyledSvg",
91
91
  componentId: "sc-1nu971z-1"
92
92
  })([ "", " ", "" ], (0, o.pickVariant)("$size", {
@@ -105,20 +105,20 @@
105
105
  }), (function(e) {
106
106
  var t = e.$animated;
107
107
  return t && (0, o.pick)({
108
- enterprise: (0, c.css)([ "transform-origin:center;animation:", " 1.2s steps(64) infinite;" ], f),
109
- prisma: (0, c.css)([ "animation:", " ", " infinite linear,", " 500ms cubic-bezier(0.01,0,0,1);" ], f, u, d)
108
+ enterprise: (0, c.css)([ "transform-origin:center;animation:", " 1.2s steps(64) infinite;" ], p),
109
+ prisma: (0, c.css)([ "animation:", " ", " infinite linear,", " 500ms cubic-bezier(0.01,0,0,1);" ], p, u, d)
110
110
  });
111
111
  }));
112
112
  var h = (0, c.keyframes)([ "0%{stroke-dasharray:110 10;stroke-dashoffset:-5.5;animation-timing-function:cubic-bezier(0.8,0,0.83,1);}50%{stroke-dasharray:26 94;stroke-dashoffset:-152;}100%{stroke-dasharray:110 10;stroke-dashoffset:-246.5;animation-timing-function:cubic-bezier(0.33,0,0.67,1);}" ]);
113
113
  var v = (0, c.keyframes)([ "0%{stroke-dasharray:7 113;stroke-dashoffset:3;animation-timing-function:cubic-bezier(0.8,0,0.83,1);}50%{stroke-dasharray:90 30;stroke-dashoffset:-60;}100%{stroke-dasharray:7 113;stroke-dashoffset:-238;animation-timing-function:cubic-bezier(0.33,0,0.67,1);}" ]);
114
- var g = m().circle.withConfig({
114
+ var g = f().circle.withConfig({
115
115
  displayName: "WaitSpinnerStyles__StyledPrismaBasePath",
116
116
  componentId: "sc-1nu971z-2"
117
117
  })([ "stroke:", ";stroke-width:2;fill:transparent;", " stroke-dasharray:110 10;stroke-dashoffset:-5.5;" ], o.variables.contentColorDisabled, (function(e) {
118
118
  var t = e.$animated;
119
119
  return t && (0, c.css)([ "animation:", " ", " infinite;animation-fill-mode:backwards;" ], h, u);
120
120
  }));
121
- var k = m().circle.withConfig({
121
+ var k = f().circle.withConfig({
122
122
  displayName: "WaitSpinnerStyles__StyledPrismaFillPath",
123
123
  componentId: "sc-1nu971z-3"
124
124
  })([ "fill:transparent;stroke-width:2;stroke:", ";stroke-dasharray:7 113;stroke-dashoffset:3;", "" ], (0,
@@ -130,7 +130,7 @@
130
130
  var t = e.$animated;
131
131
  return t && (0, c.css)([ "animation:", " ", " infinite;" ], v, u);
132
132
  }));
133
- var b = m().circle.withConfig({
133
+ var b = f().circle.withConfig({
134
134
  displayName: "WaitSpinnerStyles__StyledEnterpriseCircle",
135
135
  componentId: "sc-1nu971z-4"
136
136
  })([ "fill:transparent;stroke:", ";stroke-width:2px;", "" ], (0, o.pick)({
@@ -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,46 +176,47 @@
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, f = x(e, [ "elementRef", "screenReaderText", "size" ]);
194
194
  // @docs-props-type WaitSpinnerPropsBase
195
- var f = (0, s.useAnimationToggle)() === "on";
195
+ if (false) {}
196
+ var p = (0, s.useAnimationToggle)() === "on";
196
197
  var d = (0, o.useSplunkTheme)(), u = d.isPrisma;
197
198
  var h = u ? "0 0 40 40" : "0 0 19 19";
198
199
 
199
- return i().createElement(p, w({
200
+ return i().createElement(m, w({
200
201
  "data-test": "wait-spinner"
201
- }, m), i().createElement(y, {
202
+ }, f), i().createElement(y, {
202
203
  viewBox: h,
203
204
  version: "1.1",
204
205
  xmlns: "http://www.w3.org/2000/svg",
205
206
  ref: t,
206
- $animated: f,
207
+ $animated: p,
207
208
  $size: c
208
- }, a && i().createElement("title", null, a), i().createElement("g", null, u ? i().createElement(i().Fragment, null, i().createElement(g, {
209
+ }, n && i().createElement("title", null, n), i().createElement("g", null, u ? i().createElement(i().Fragment, null, i().createElement(g, {
209
210
  r: "19",
210
211
  cx: "20",
211
212
  cy: "20",
212
- $animated: f,
213
+ $animated: p,
213
214
  $size: c
214
215
  }), i().createElement(k, {
215
216
  r: "19",
216
217
  cx: "20",
217
218
  cy: "20",
218
- $animated: f,
219
+ $animated: p,
219
220
  $size: c
220
221
  })) : i().createElement(b, {
221
222
  cx: "9.5",
@@ -223,8 +224,8 @@
223
224
  r: "8.5"
224
225
  }))));
225
226
  }
226
- O.propTypes = z;
227
- /* harmony default export */ const _ = O;
227
+ z.propTypes = O;
228
+ /* harmony default export */ const _ = z;
228
229
  // CONCATENATED MODULE: ./src/WaitSpinner/index.ts
229
230
  module.exports = t;
230
231
  /******/})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splunk/react-ui",
3
- "version": "4.28.1",
3
+ "version": "4.29.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.",
@@ -42,7 +42,7 @@
42
42
  "@dnd-kit/core": "6.0.8",
43
43
  "@dnd-kit/sortable": "7.0.2",
44
44
  "@dnd-kit/utilities": "3.2.1",
45
- "@splunk/react-icons": "^4.3.0",
45
+ "@splunk/react-icons": "^4.4.0",
46
46
  "@splunk/themes": "^0.17.0",
47
47
  "@splunk/ui-utils": "^1.6.0",
48
48
  "commonmark": "^0.30.0",
@@ -0,0 +1,2 @@
1
+ declare const RemovableWithNonStringChildren: () => JSX.Element;
2
+ export default RemovableWithNonStringChildren;
@@ -76,7 +76,7 @@ interface MarkdownPropsBase {
76
76
  codeRenderer?: CodeRenderer;
77
77
  /**
78
78
  * A custom code block renderer. The function is passed an object containing `language`,
79
- * `literal`, and `nodeKey`.
79
+ * `literal`, and `nodeKey`. It supports the same languages as used in the `Code` component.
80
80
  */
81
81
  codeBlockRenderer?: CodeBlockRenderer;
82
82
  /**
@@ -0,0 +1,2 @@
1
+ declare function Basic(): JSX.Element;
2
+ export default Basic;
@@ -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>);
@@ -1,5 +1,6 @@
1
- import React, { Component } from 'react';
2
- import { ClassComponentProps } from '../utils/types';
1
+ import React from 'react';
2
+ import PropTypes from 'prop-types';
3
+ import { ComponentProps } from '../utils/types';
3
4
  declare type PaginatorButtonClickHandler = (event: React.MouseEvent<HTMLButtonElement>, data: {
4
5
  page?: number;
5
6
  }) => void;
@@ -16,13 +17,17 @@ interface PaginatorButtonPropsBase {
16
17
  /** @private */
17
18
  selected?: boolean;
18
19
  }
19
- declare const defaultProps: Required<Pick<PaginatorButtonPropsBase, 'selected'>>;
20
- declare type PaginatorButtonProps = ClassComponentProps<PaginatorButtonPropsBase, typeof defaultProps, 'button'>;
21
- declare class PaginatorButton extends Component<PaginatorButtonProps, {}> {
22
- static propTypes: React.WeakValidationMap<ClassComponentProps<PaginatorButtonPropsBase, Required<Pick<PaginatorButtonPropsBase, "selected">>, "button", never>>;
23
- static defaultProps: Required<Pick<PaginatorButtonPropsBase, "selected">>;
24
- handleClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
25
- render(): JSX.Element;
20
+ declare type PaginatorButtonProps = ComponentProps<PaginatorButtonPropsBase, 'button'>;
21
+ declare function PaginatorButton({ children, disabled, onClick, page, selected, ...otherProps }: PaginatorButtonProps): JSX.Element;
22
+ declare namespace PaginatorButton {
23
+ var propTypes: {
24
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
25
+ disabled: PropTypes.Requireable<string | boolean>;
26
+ onClick: PropTypes.Requireable<(...args: any[]) => any>;
27
+ page: PropTypes.Requireable<number>;
28
+ /** @private */
29
+ selected: PropTypes.Requireable<boolean>;
30
+ };
26
31
  }
27
32
  export default PaginatorButton;
28
33
  export { PaginatorButtonClickHandler };
@@ -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;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { ComponentProps } from '../utils/types';
4
4
  interface WaitSpinnerPropsBase {
5
+ /** @deprecated This prop is deprecated and will be removed in the next major version. */
5
6
  children?: never;
6
7
  /**
7
8
  * A React ref which is set to the DOM element when the component mounts and null when it unmounts.
@@ -9,7 +10,7 @@ interface WaitSpinnerPropsBase {
9
10
  elementRef?: React.Ref<SVGSVGElement>;
10
11
  /** A string to display to screen readers. Set the prop to `null` or an empty string to hide the
11
12
  * spinner from screen readers, such as when there is already a text label beside it. */
12
- screenReaderText?: string;
13
+ screenReaderText?: string | null;
13
14
  /**
14
15
  * Size of WaitSpinner.
15
16
  * `large` is not supported in enterprise themes; falls back to `medium`.