@splunk/react-ui 5.0.0-rc.2 → 5.0.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/Message.js CHANGED
@@ -68,10 +68,10 @@
68
68
  var t = e.n(r);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
70
  const a = require("prop-types");
71
- var i = e.n(a);
71
+ var o = e.n(a);
72
72
  // CONCATENATED MODULE: external "@splunk/react-icons/CheckCircle"
73
- const o = require("@splunk/react-icons/CheckCircle");
74
- var l = e.n(o);
73
+ const i = require("@splunk/react-icons/CheckCircle");
74
+ var l = e.n(i);
75
75
  // CONCATENATED MODULE: external "@splunk/react-icons/Cross"
76
76
  const s = require("@splunk/react-icons/Cross");
77
77
  var c = e.n(s);
@@ -104,40 +104,44 @@
104
104
  warning: C.variables.notificationColorCaution,
105
105
  error: C.variables.notificationColorNegative
106
106
  };
107
- var k = w().div.withConfig({
107
+ var x = w().div.withConfig({
108
108
  displayName: "MessageStyles__StyledTitle",
109
109
  componentId: "eg66af-0"
110
110
  })([ "", ";" ], C.mixins.typography("title4"));
111
- var x = w().div.withConfig({
111
+ var k = w().div.withConfig({
112
112
  displayName: "MessageStyles__StyledContent",
113
113
  componentId: "eg66af-1"
114
- })([ "", ";grid-row:1 / -1;grid-column:content;max-width:", ";word-wrap:break-word;&:not(:has(> ", ")){", ";}" ], C.mixins.typography("body"), C.variables.lineLength, k, C.mixins.typography("body", {
114
+ })([ "", ";grid-row:1 / -1;grid-column:content;max-width:", ";word-wrap:break-word;&:not(:has(> ", ")){", ";}" ], C.mixins.typography("body"), C.variables.lineLength, x, C.mixins.typography("body", {
115
115
  color: "active"
116
116
  }));
117
- var q = w().span.withConfig({
117
+ var R = w().span.withConfig({
118
118
  displayName: "MessageStyles__StyledIcon",
119
119
  componentId: "eg66af-2"
120
120
  })([ "fill:", ";grid-row:1;height:20px;width:20px;" ], (0, C.pickVariant)("$type", _));
121
- var R = w()(O()).withConfig({
121
+ var q = w()(O()).withConfig({
122
122
  displayName: "MessageStyles__StyledRemove",
123
123
  componentId: "eg66af-3"
124
124
  })([ "grid-column:remove;" ]);
125
- var j = w().div.withConfig({
125
+ var I = w().div.withConfig({
126
126
  displayName: "MessageStyles__Styled",
127
127
  componentId: "eg66af-4"
128
- })([ "", ";grid-template-columns:[icon] 20px ", " [content] auto ", " [remove] min-content;grid-template-rows:1lh auto;align-items:center;padding:", ";", "" ], C.mixins.reset("grid"), C.variables.spacingSmall, C.variables.spacingSmall, C.variables.spacingSmall, (function(e) {
129
- var n = e.$appearance, r = e.$type;
130
- var t = _[r];
131
- return n === "fill" && (0, h.css)([ "background-color:", ";border-left:8px solid ", ";border-radius:", ";box-shadow:", ";grid-template-columns:[icon] 20px ", " [content] fit-content(", ") minmax(", ",1fr) [remove] min-content;padding-inline:", ";" ], C.variables.backgroundColorPopup, t, C.variables.borderRadius, C.variables.embossShadow, C.variables.spacingSmall, C.variables.lineLength, C.variables.spacingSmall, C.variables.spacingMedium);
128
+ })([ "", ";grid-template-rows:1lh auto;align-items:center;padding:", ";", ";", "" ], C.mixins.reset("grid"), C.variables.spacingSmall, (function(e) {
129
+ var n = e.$hasRemoveIcon;
130
+ return (0, h.css)([ "grid-template-columns:[icon] 20px ", " [content] auto ", " [remove] min-content;" ], C.variables.spacingSmall, n ? C.variables.spacingSmall : "0");
131
+ }), (function(e) {
132
+ var n = e.$appearance, r = e.$hasRemoveIcon, t = e.$type;
133
+ var a = _[t];
134
+ return n === "fill" && (0, h.css)([ "background-color:", ";border-left:8px solid ", ";border-radius:", ";box-shadow:", ";grid-template-columns:[icon] 20px ", " [content] fit-content(", ");padding-inline:", ";", "" ], C.variables.backgroundColorPopup, a, C.variables.borderRadius, C.variables.embossShadow, C.variables.spacingSmall, C.variables.lineLength, C.variables.spacingMedium, r && (0,
135
+ h.css)([ "grid-template-columns:[icon] 20px ", " [content] fit-content(", ") minmax(", ",1fr) [remove] min-content;" ], C.variables.spacingSmall, C.variables.lineLength, C.variables.spacingSmall));
132
136
  }));
133
137
  // CONCATENATED MODULE: ./src/Message/Title.tsx
134
- function I(e, n) {
138
+ function j(e, n) {
135
139
  if (null == e) return {};
136
140
  var r, t, a = P(e, n);
137
141
  if (Object.getOwnPropertySymbols) {
138
- var i = Object.getOwnPropertySymbols(e);
139
- for (t = 0; t < i.length; t++) {
140
- r = i[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
142
+ var o = Object.getOwnPropertySymbols(e);
143
+ for (t = 0; t < o.length; t++) {
144
+ r = o[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
141
145
  }
142
146
  }
143
147
  return a;
@@ -154,21 +158,21 @@
154
158
  return r;
155
159
  }
156
160
  var E = {
157
- children: i().node
161
+ children: o().node
158
162
  };
159
163
  /**
160
164
  * A title component for use in `Message`.
161
165
  */ function M(e) {
162
- var n = e.children, r = I(e, [ "children" ]);
166
+ var n = e.children, r = j(e, [ "children" ]);
163
167
  // @docs-props-type TitleProps
164
168
 
165
- return t().createElement(k, r, n);
169
+ return t().createElement(x, r, n);
166
170
  }
167
171
  M.propTypes = E;
168
- /* harmony default export */ const T = M;
172
+ /* harmony default export */ const $ = M;
169
173
  // CONCATENATED MODULE: ./src/Message/Message.tsx
170
- function $() {
171
- return $ = Object.assign ? Object.assign.bind() : function(e) {
174
+ function T() {
175
+ return T = Object.assign ? Object.assign.bind() : function(e) {
172
176
  for (var n = 1; n < arguments.length; n++) {
173
177
  var r = arguments[n];
174
178
  for (var t in r) {
@@ -176,20 +180,20 @@
176
180
  }
177
181
  }
178
182
  return e;
179
- }, $.apply(null, arguments);
183
+ }, T.apply(null, arguments);
180
184
  }
181
185
  function N(e, n) {
182
186
  if (null == e) return {};
183
- var r, t, a = z(e, n);
187
+ var r, t, a = L(e, n);
184
188
  if (Object.getOwnPropertySymbols) {
185
- var i = Object.getOwnPropertySymbols(e);
186
- for (t = 0; t < i.length; t++) {
187
- r = i[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
189
+ var o = Object.getOwnPropertySymbols(e);
190
+ for (t = 0; t < o.length; t++) {
191
+ r = o[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
188
192
  }
189
193
  }
190
194
  return a;
191
195
  }
192
- function z(e, n) {
196
+ function L(e, n) {
193
197
  if (null == e) return {};
194
198
  var r = {};
195
199
  for (var t in e) {
@@ -200,12 +204,12 @@
200
204
  }
201
205
  return r;
202
206
  }
203
- var L = {
204
- appearance: i().oneOf([ "default", "fill" ]),
205
- children: i().node,
206
- elementRef: i().oneOfType([ i().func, i().object ]),
207
- onRequestRemove: i().func,
208
- type: i().oneOf([ "info", "warning", "error", "success" ])
207
+ var z = {
208
+ appearance: o().oneOf([ "default", "fill" ]),
209
+ children: o().node,
210
+ elementRef: o().oneOfType([ o().func, o().object ]),
211
+ onRequestRemove: o().func,
212
+ type: o().oneOf([ "info", "warning", "error", "success" ])
209
213
  };
210
214
  var A = Object.freeze({
211
215
  info: v(),
@@ -224,7 +228,7 @@
224
228
  width: "20px"
225
229
  });
226
230
  function F(e) {
227
- var n = e.appearance, a = n === void 0 ? "default" : n, i = e.children, o = e.elementRef, l = e.onRequestRemove, s = e.type, c = s === void 0 ? "warning" : s, u = N(e, [ "appearance", "children", "elementRef", "onRequestRemove", "type" ]);
231
+ var n = e.appearance, a = n === void 0 ? "default" : n, o = e.children, i = e.elementRef, l = e.onRequestRemove, s = e.type, c = s === void 0 ? "warning" : s, u = N(e, [ "appearance", "children", "elementRef", "onRequestRemove", "type" ]);
228
232
  // @docs-props-type MessagePropsBase
229
233
  var p = (0, r.useCallback)((function(e) {
230
234
  l === null || l === void 0 ? void 0 : l(e);
@@ -232,20 +236,20 @@
232
236
  var d = A[c];
233
237
  var v = B[c];
234
238
 
235
- return t().createElement(j, $({
236
- ref: o,
239
+ return t().createElement(I, T({
240
+ ref: i,
237
241
  $appearance: a,
238
242
  $hasRemoveIcon: !!l,
239
243
  $type: c,
240
244
  "data-test-type": c,
241
245
  "data-test": "message"
242
- }, u), t().createElement(t().Fragment, null, t().createElement(q, {
246
+ }, u), t().createElement(t().Fragment, null, t().createElement(R, {
243
247
  as: d,
244
248
  $type: c,
245
249
  variant: "filled"
246
- }), t().createElement(y(), null, v)), t().createElement(x, {
250
+ }), t().createElement(y(), null, v)), t().createElement(k, {
247
251
  "data-test": "content"
248
- }, i), l && t().createElement(R, {
252
+ }, o), l && t().createElement(q, {
249
253
  "aria-label": "Remove",
250
254
  "data-test": "remove",
251
255
  appearance: "subtle",
@@ -253,8 +257,8 @@
253
257
  icon: D
254
258
  }));
255
259
  }
256
- F.propTypes = L;
257
- F.Title = T;
260
+ F.propTypes = z;
261
+ F.Title = $;
258
262
  /* harmony default export */ const V = F;
259
263
  // CONCATENATED MODULE: ./src/Message/index.ts
260
264
  module.exports = n;
package/ModalLayer.js CHANGED
@@ -72,8 +72,8 @@
72
72
  // CONCATENATED MODULE: external "@splunk/react-ui/Animation"
73
73
  const a = require("@splunk/react-ui/Animation");
74
74
  // CONCATENATED MODULE: external "@splunk/react-ui/Layer"
75
- const l = require("@splunk/react-ui/Layer");
76
- var u = e.n(l);
75
+ const u = require("@splunk/react-ui/Layer");
76
+ var l = e.n(u);
77
77
  // CONCATENATED MODULE: external "styled-components"
78
78
  const c = require("styled-components");
79
79
  var s = e.n(c);
@@ -162,23 +162,23 @@
162
162
  function M(e, r) {
163
163
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
164
164
  if (null != t) {
165
- var n, o, i, a, l = [], u = !0, c = !1;
165
+ var n, o, i, a, u = [], l = !0, c = !1;
166
166
  try {
167
167
  if (i = (t = t.call(e)).next, 0 === r) {
168
168
  if (Object(t) !== t) return;
169
- u = !1;
170
- } else for (;!(u = (n = i.call(t)).done) && (l.push(n.value), l.length !== r); u = !0) {
169
+ l = !1;
170
+ } else for (;!(l = (n = i.call(t)).done) && (u.push(n.value), u.length !== r); l = !0) {
171
171
  }
172
172
  } catch (e) {
173
173
  c = !0, o = e;
174
174
  } finally {
175
175
  try {
176
- if (!u && null != t["return"] && (a = t["return"](), Object(a) !== a)) return;
176
+ if (!l && null != t["return"] && (a = t["return"](), Object(a) !== a)) return;
177
177
  } finally {
178
178
  if (c) throw o;
179
179
  }
180
180
  }
181
- return l;
181
+ return u;
182
182
  }
183
183
  }
184
184
  function A(e) {
@@ -196,7 +196,7 @@
196
196
  var q = [ "escapeKey" ];
197
197
  function E(e) {
198
198
  var r, o;
199
- var i = e.childrenInAnimation, l = e.getDefaultMotionStyle, c = e.getMotionStyle, s = e.onRequestClose, f = e.open, y = e.renderModal, v = e.scrim, d = v === void 0 ? "interactive" : v;
199
+ var i = e.childrenInAnimation, u = e.getDefaultMotionStyle, c = e.getMotionStyle, s = e.onRequestClose, f = e.open, y = e.renderModal, v = e.scrim, d = v === void 0 ? "interactive" : v;
200
200
  var b = (0, t.useState)(false), g = h(b, 2), O = g[0], S = g[1];
201
201
  var j = (0, t.useRef)(true);
202
202
  var w = (0, t.useState)(f), P = h(w, 2), M = P[0], A = P[1];
@@ -208,7 +208,11 @@
208
208
  S(true);
209
209
  A(f);
210
210
  }
211
- (0, t.useEffect)((function() {
211
+ // equivalent to componentDidMount and componentWillUnmount
212
+ (0, t.useEffect)((function() {
213
+ // we need to set this to true on every mount because React.StrictMode will call the effect twice
214
+ // and we need to ensure that allowAnimationUpdates is true while the component is mounted
215
+ j.current = true;
212
216
  return function() {
213
217
  j.current = false;
214
218
  };
@@ -224,7 +228,7 @@
224
228
  S(false);
225
229
  }
226
230
  };
227
- var C = m(m({}, (r = l === null || l === void 0 ? void 0 : l()) !== null && r !== void 0 ? r : {}), {}, {
231
+ var C = m(m({}, (r = u === null || u === void 0 ? void 0 : u()) !== null && r !== void 0 ? r : {}), {}, {
228
232
  overlayOpacity: 0,
229
233
  opacity: 0
230
234
  });
@@ -255,7 +259,7 @@
255
259
  };
256
260
  var _ = f || O || i;
257
261
 
258
- return n().createElement(u(), {
262
+ return n().createElement(l(), {
259
263
  open: _,
260
264
  closeReasons: q,
261
265
  onRequestClose: s