@apicurio/common-ui-components 3.0.1 → 3.0.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.
Files changed (2) hide show
  1. package/dist/main.js +30 -30
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import de, { createContext as Sr, useContext as kr, useState as z, useEffect as Z, useMemo as Pe, Component as gn, forwardRef as We, useLayoutEffect as Tr, useRef as ve, useCallback as Zt, isValidElement as Bi, cloneElement as Qt, createRef as Ir, useImperativeHandle as xr, Fragment as Er, memo as _i } from "react";
2
- import { jsx as d, jsxs as H, Fragment as $e } from "react/jsx-runtime";
2
+ import { jsx as d, jsxs as H, Fragment as qe } from "react/jsx-runtime";
3
3
  import { useInterval as Or, Tooltip as Cr, EmptyState as It, EmptyStateVariant as Pr, EmptyStateBody as ei, Spinner as dt, Alert as Ar, Dropdown as Nr, MenuToggle as mn, DropdownList as Rr, Divider as bn, DropdownItem as Ur, Select as Dr, SelectOption as Lr, TextInput as xt, Button as Et, TextArea as Fr, AboutModal as jr, Content as Y, ContentVariants as Hi, Form as vn, FormGroup as qi, Progress as Mr, LabelGroup as $r, Label as Br, InputGroup as Hr, InputGroupItem as zt, ButtonVariant as qr, Pagination as Wr, PaginationVariant as Kr, Skeleton as Vr } from "@patternfly/react-core";
4
4
  import { EllipsisVIcon as zr, ChevronDownIcon as Jr, ChevronRightIcon as Gr, ErrorCircleOIcon as Xr, SearchIcon as Yr } from "@patternfly/react-icons";
5
5
  import { DateTime as gt } from "luxon";
@@ -401,7 +401,7 @@ var Q = wn, Le = class {
401
401
  const n = new URL(e, "http://127.0.0.1")[t === "fragment" ? "hash" : "search"];
402
402
  return new URLSearchParams(n.slice(1));
403
403
  }
404
- }, Ke = ";", Be = class extends Error {
404
+ }, Ke = ";", $e = class extends Error {
405
405
  constructor(e, t) {
406
406
  var i, n, r;
407
407
  if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error)
@@ -556,7 +556,7 @@ var Q = wn, Le = class {
556
556
  throw r.error("Error parsing JSON response", l), s.ok ? l : new Error(`${s.statusText} (${s.status})`);
557
557
  }
558
558
  if (!s.ok)
559
- throw r.error("Error from server:", c), c.error ? new Be(c) : new Error(`${s.statusText} (${s.status}): ${JSON.stringify(c)}`);
559
+ throw r.error("Error from server:", c), c.error ? new $e(c) : new Error(`${s.statusText} (${s.status}): ${JSON.stringify(c)}`);
560
560
  return c;
561
561
  }
562
562
  async postForm(e, {
@@ -595,7 +595,7 @@ var Q = wn, Le = class {
595
595
  const p = c.headers.get("dpop-nonce");
596
596
  throw new ni(p, `${JSON.stringify(f)}`);
597
597
  }
598
- throw f.error ? new Be(f, t) : new Error(`${c.statusText} (${c.status}): ${JSON.stringify(f)}`);
598
+ throw f.error ? new $e(f, t) : new Error(`${c.statusText} (${c.status}): ${JSON.stringify(f)}`);
599
599
  }
600
600
  return f;
601
601
  }
@@ -964,13 +964,13 @@ var Q = wn, Le = class {
964
964
  validateSignoutResponse(e, t) {
965
965
  const i = this._logger.create("validateSignoutResponse");
966
966
  if (t.id !== e.state && i.throw(new Error("State does not match")), i.debug("state validated"), e.userState = t.data, e.error)
967
- throw i.warn("Response was error", e.error), new Be(e);
967
+ throw i.warn("Response was error", e.error), new $e(e);
968
968
  }
969
969
  _processSigninState(e, t) {
970
970
  var i;
971
971
  const n = this._logger.create("_processSigninState");
972
972
  if (t.id !== e.state && n.throw(new Error("State does not match")), t.client_id || n.throw(new Error("No client_id on state")), t.authority || n.throw(new Error("No authority on state")), this._settings.authority !== t.authority && n.throw(new Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== t.client_id && n.throw(new Error("client_id mismatch on settings vs. signin state")), n.debug("state validated"), e.userState = t.data, e.url_state = t.url_state, (i = e.scope) != null || (e.scope = t.scope), e.error)
973
- throw n.warn("Response was error", e.error), new Be(e);
973
+ throw n.warn("Response was error", e.error), new $e(e);
974
974
  t.code_verifier && !e.code && n.throw(new Error("Expected code in response"));
975
975
  }
976
976
  async _processClaims(e, t = !1, i = !0) {
@@ -1439,7 +1439,7 @@ var _s = In, ws = "openid", Jt = class {
1439
1439
  const i = this._logger.create("readSignoutResponseState"), n = new Ss(ii.readParams(e, this.settings.response_mode));
1440
1440
  if (!n.state) {
1441
1441
  if (i.debug("No state in response"), n.error)
1442
- throw i.warn("Response was error:", n.error), new Be(n);
1442
+ throw i.warn("Response was error:", n.error), new $e(n);
1443
1443
  return { state: void 0, response: n };
1444
1444
  }
1445
1445
  const r = await this.settings.stateStore[t ? "remove" : "get"](n.state);
@@ -2195,7 +2195,7 @@ var _s = In, ws = "openid", Jt = class {
2195
2195
  sub: l.profile.sub
2196
2196
  }) : (t.info("success, user not authenticated"), null);
2197
2197
  } catch (c) {
2198
- if (this.settings.monitorAnonymousSession && c instanceof Be)
2198
+ if (this.settings.monitorAnonymousSession && c instanceof $e)
2199
2199
  switch (c.error) {
2200
2200
  case "login_required":
2201
2201
  case "consent_required":
@@ -2234,7 +2234,7 @@ var _s = In, ws = "openid", Jt = class {
2234
2234
  const i = this._logger.create("_buildUser"), n = new Gt(e);
2235
2235
  if (t) {
2236
2236
  if (t !== n.profile.sub)
2237
- throw i.debug("current user does not match user returned from signin. sub from signin:", n.profile.sub), new Be({ ...e, error: "login_required" });
2237
+ throw i.debug("current user does not match user returned from signin. sub from signin:", n.profile.sub), new $e({ ...e, error: "login_required" });
2238
2238
  i.debug("current user matches user returned from signin");
2239
2239
  }
2240
2240
  return await this.storeUser(n), i.debug("user stored"), await this._events.load(n), n;
@@ -2680,7 +2680,7 @@ const ro = async (e, t) => {
2680
2680
  ouiaId: "ObjectDropdown",
2681
2681
  popperProps: s,
2682
2682
  shouldFocusToggleOnSelect: !0,
2683
- children: /* @__PURE__ */ d(Rr, { children: e.items.map((c, l) => e.itemIsVisible !== void 0 && !e.itemIsVisible(c) ? /* @__PURE__ */ d($e, {}) : e.itemIsDivider && e.itemIsDivider(c) ? /* @__PURE__ */ d(bn, { component: "li" }, `divider-${l}`) : /* @__PURE__ */ d(
2683
+ children: /* @__PURE__ */ d(Rr, { children: e.items.map((c, l) => e.itemIsVisible !== void 0 && !e.itemIsVisible(c) ? null : e.itemIsDivider && e.itemIsDivider(c) ? /* @__PURE__ */ d(bn, { component: "li" }, `divider-${l}`) : /* @__PURE__ */ d(
2684
2684
  Ur,
2685
2685
  {
2686
2686
  value: l,
@@ -3038,9 +3038,9 @@ const Io = (e) => {
3038
3038
  return 0;
3039
3039
  }, G = (() => {
3040
3040
  let ae;
3041
- return x && (ae = H($e, { children: [d("span", { className: j("pf-v6-c-button__icon-favorite"), children: d(yo, {}) }), d("span", { className: j("pf-v6-c-button__icon-favorited"), children: d(_o, {}) })] })), f && (ae = d(ko, {})), p && (ae = To), v && !ie && (ae = v), ae && d("span", { className: j(K.buttonIcon, t && K.modifiers[ee ? "end" : "start"]), children: ae });
3041
+ return x && (ae = H(qe, { children: [d("span", { className: j("pf-v6-c-button__icon-favorite"), children: d(yo, {}) }), d("span", { className: j("pf-v6-c-button__icon-favorited"), children: d(_o, {}) })] })), f && (ae = d(ko, {})), p && (ae = To), v && !ie && (ae = v), ae && d("span", { className: j(K.buttonIcon, t && K.modifiers[ee ? "end" : "start"]), children: ae });
3042
3042
  })(), te = t && d("span", { className: j("pf-v6-c-button__text"), children: t });
3043
- return H(q, Object.assign({ "aria-expanded": u }, O, a ? ne : null, (a || !V && s) && { "aria-disabled": !0 }, { "aria-label": y, className: j(K.button, K.modifiers[S], f && K.modifiers.settings, p && K.modifiers.hamburger, p && b && K.modifiers[b], o && K.modifiers.block, s && !V && K.modifiers.disabled, a && K.modifiers.ariaDisabled, r && K.modifiers.clicked, L && S === Ce.link && K.modifiers.inline, x && K.modifiers.favorite, x && D && K.modifiers.favorited, l && (S === Ce.secondary || S === Ce.link) && K.modifiers.danger, c !== null && S !== Ce.plain && K.modifiers.progress, c && K.modifiers.inProgress, F && S === Ce.plain && K.modifiers.noPadding, S === Ce.stateful && K.modifiers[E], w === tt.sm && K.modifiers.small, w === tt.lg && K.modifiers.displayLg, i), disabled: V ? s : null, tabIndex: C !== null ? C : J(), type: V || W ? T : null, role: W ? "button" : h, ref: A }, $, { children: [c && d("span", { className: j(K.buttonProgress), children: d(Ln, { size: ci.md, isInline: L, "aria-valuetext": k, "aria-label": P, "aria-labelledby": m }) }), ee ? H($e, { children: [te, G] }) : H($e, { children: [G, te] }), R && d("span", { className: j(K.buttonCount, R.className), children: d(jn, { isRead: R.isRead, isDisabled: s, children: R.count }) })] }));
3043
+ return H(q, Object.assign({ "aria-expanded": u }, O, a ? ne : null, (a || !V && s) && { "aria-disabled": !0 }, { "aria-label": y, className: j(K.button, K.modifiers[S], f && K.modifiers.settings, p && K.modifiers.hamburger, p && b && K.modifiers[b], o && K.modifiers.block, s && !V && K.modifiers.disabled, a && K.modifiers.ariaDisabled, r && K.modifiers.clicked, L && S === Ce.link && K.modifiers.inline, x && K.modifiers.favorite, x && D && K.modifiers.favorited, l && (S === Ce.secondary || S === Ce.link) && K.modifiers.danger, c !== null && S !== Ce.plain && K.modifiers.progress, c && K.modifiers.inProgress, F && S === Ce.plain && K.modifiers.noPadding, S === Ce.stateful && K.modifiers[E], w === tt.sm && K.modifiers.small, w === tt.lg && K.modifiers.displayLg, i), disabled: V ? s : null, tabIndex: C !== null ? C : J(), type: V || W ? T : null, role: W ? "button" : h, ref: A }, $, { children: [c && d("span", { className: j(K.buttonProgress), children: d(Ln, { size: ci.md, isInline: L, "aria-valuetext": k, "aria-label": P, "aria-labelledby": m }) }), ee ? H(qe, { children: [te, G] }) : H(qe, { children: [G, te] }), R && d("span", { className: j(K.buttonCount, R.className), children: d(jn, { isRead: R.isRead, isDisabled: s, children: R.count }) })] }));
3044
3044
  }, ki = We((e, t) => d(Io, Object.assign({ innerRef: t }, e)));
3045
3045
  ki.displayName = "Button";
3046
3046
  const oe = {
@@ -4085,7 +4085,7 @@ const Gn = !!(typeof window < "u" && window.document && window.document.createEl
4085
4085
  return _n.createPortal($i(), U);
4086
4086
  }
4087
4087
  };
4088
- return H($e, { children: [!y && e && Bi(e) && d("div", { style: { display: "contents" }, ref: (U) => {
4088
+ return H(qe, { children: [!y && e && Bi(e) && d("div", { style: { display: "contents" }, ref: (U) => {
4089
4089
  ee(U == null ? void 0 : U.firstElementChild);
4090
4090
  }, children: e }), y && e && Bi(e) && e, Se && Ht && yr()] });
4091
4091
  };
@@ -4189,7 +4189,7 @@ Yn.displayName = "Tooltip";
4189
4189
  * tabbable 6.4.0
4190
4190
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
4191
4191
  */
4192
- var Zn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], Nt = /* @__PURE__ */ Zn.join(","), Qn = typeof Element > "u", He = Qn ? function() {
4192
+ var Zn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], Nt = /* @__PURE__ */ Zn.join(","), Qn = typeof Element > "u", Be = Qn ? function() {
4193
4193
  } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, Rt = !Qn && Element.prototype.getRootNode ? function(e) {
4194
4194
  var t;
4195
4195
  return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
@@ -4209,7 +4209,7 @@ var Zn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
4209
4209
  if (Ut(t))
4210
4210
  return [];
4211
4211
  var r = Array.prototype.slice.apply(t.querySelectorAll(Nt));
4212
- return i && He.call(t, Nt) && r.unshift(t), r = r.filter(n), r;
4212
+ return i && Be.call(t, Nt) && r.unshift(t), r = r.filter(n), r;
4213
4213
  }, Dt = function(t, i, n) {
4214
4214
  for (var r = [], o = Array.from(t); o.length; ) {
4215
4215
  var s = o.shift();
@@ -4221,7 +4221,7 @@ var Zn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
4221
4221
  candidates: l
4222
4222
  });
4223
4223
  } else {
4224
- var u = He.call(s, Nt);
4224
+ var u = Be.call(s, Nt);
4225
4225
  u && n.filter(s) && (i || !t.includes(s)) && r.push(s);
4226
4226
  var f = s.shadowRoot || // check for an undisclosed shadow
4227
4227
  typeof n.getShadowRoot == "function" && n.getShadowRoot(s), p = !Ut(f, !1) && (!n.shadowRootFilter || n.shadowRootFilter(s));
@@ -4313,8 +4313,8 @@ var Zn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
4313
4313
  }
4314
4314
  if (getComputedStyle(t).visibility === "hidden")
4315
4315
  return !0;
4316
- var s = He.call(t, "details>summary:first-of-type"), a = s ? t.parentElement : t;
4317
- if (He.call(a, "details:not([open]) *"))
4316
+ var s = Be.call(t, "details>summary:first-of-type"), a = s ? t.parentElement : t;
4317
+ if (Be.call(a, "details:not([open]) *"))
4318
4318
  return !0;
4319
4319
  if (!n || n === "full" || // full-native can run this branch when it falls through in case
4320
4320
  // Element#checkVisibility is unsupported
@@ -4342,7 +4342,7 @@ var Zn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
4342
4342
  for (var n = 0; n < i.children.length; n++) {
4343
4343
  var r = i.children.item(n);
4344
4344
  if (r.tagName === "LEGEND")
4345
- return He.call(i, "fieldset[disabled] *") ? !0 : !r.contains(t);
4345
+ return Be.call(i, "fieldset[disabled] *") ? !0 : !r.contains(t);
4346
4346
  }
4347
4347
  return !0;
4348
4348
  }
@@ -4388,14 +4388,14 @@ var Zn = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert]
4388
4388
  flatten: !0,
4389
4389
  getShadowRoot: i.getShadowRoot
4390
4390
  }) : n = er(t, i.includeContainer, Lt.bind(null, i)), n;
4391
- }, qe = function(t, i) {
4391
+ }, He = function(t, i) {
4392
4392
  if (i = i || {}, !t)
4393
4393
  throw new Error("No node provided");
4394
- return He.call(t, Nt) === !1 ? !1 : pi(i, t);
4394
+ return Be.call(t, Nt) === !1 ? !1 : pi(i, t);
4395
4395
  }, lc = /* @__PURE__ */ Zn.concat("iframe:not([inert]):not([inert] *)").join(","), Yt = function(t, i) {
4396
4396
  if (i = i || {}, !t)
4397
4397
  throw new Error("No node provided");
4398
- return He.call(t, lc) === !1 ? !1 : Lt(i, t);
4398
+ return Be.call(t, lc) === !1 ? !1 : Lt(i, t);
4399
4399
  };
4400
4400
  /*!
4401
4401
  * focus-trap 7.6.4
@@ -4596,9 +4596,9 @@ var fn = {
4596
4596
  }, p = function() {
4597
4597
  if (s.containerGroups = s.containers.map(function(h) {
4598
4598
  var g = ac(h, o.tabbableOptions), _ = cc(h, o.tabbableOptions), C = g.length > 0 ? g[0] : void 0, A = g.length > 0 ? g[g.length - 1] : void 0, R = _.find(function(q) {
4599
- return qe(q);
4599
+ return He(q);
4600
4600
  }), O = _.slice().reverse().find(function(q) {
4601
- return qe(q);
4601
+ return He(q);
4602
4602
  }), $ = !!g.find(function(q) {
4603
4603
  return Me(q) > 0;
4604
4604
  });
@@ -4634,9 +4634,9 @@ var fn = {
4634
4634
  nextTabbableNode: function(V) {
4635
4635
  var W = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, ee = g.indexOf(V);
4636
4636
  return ee < 0 ? W ? _.slice(_.indexOf(V) + 1).find(function(ie) {
4637
- return qe(ie);
4637
+ return He(ie);
4638
4638
  }) : _.slice(0, _.indexOf(V)).reverse().find(function(ie) {
4639
- return qe(ie);
4639
+ return He(ie);
4640
4640
  }) : g[ee + (W ? 1 : -1)];
4641
4641
  }
4642
4642
  };
@@ -4680,7 +4680,7 @@ var fn = {
4680
4680
  var le = J.firstTabbableNode;
4681
4681
  return g === le;
4682
4682
  });
4683
- if (q < 0 && ($.container === g || Yt(g, o.tabbableOptions) && !qe(g, o.tabbableOptions) && !$.nextTabbableNode(g, !1)) && (q = O), q >= 0) {
4683
+ if (q < 0 && ($.container === g || Yt(g, o.tabbableOptions) && !He(g, o.tabbableOptions) && !$.nextTabbableNode(g, !1)) && (q = O), q >= 0) {
4684
4684
  var V = q === 0 ? s.tabbableGroups.length - 1 : q - 1, W = s.tabbableGroups[V];
4685
4685
  R = Me(g) >= 0 ? W.lastTabbableNode : W.lastDomTabbableNode;
4686
4686
  } else nt(_) || (R = $.nextTabbableNode(g, !1));
@@ -4689,7 +4689,7 @@ var fn = {
4689
4689
  var le = J.lastTabbableNode;
4690
4690
  return g === le;
4691
4691
  });
4692
- if (ee < 0 && ($.container === g || Yt(g, o.tabbableOptions) && !qe(g, o.tabbableOptions) && !$.nextTabbableNode(g)) && (ee = O), ee >= 0) {
4692
+ if (ee < 0 && ($.container === g || Yt(g, o.tabbableOptions) && !He(g, o.tabbableOptions) && !$.nextTabbableNode(g)) && (ee = O), ee >= 0) {
4693
4693
  var ie = ee === s.tabbableGroups.length - 1 ? 0 : ee + 1, ne = s.tabbableGroups[ie];
4694
4694
  R = Me(g) >= 0 ? ne.firstTabbableNode : ne.firstDomTabbableNode;
4695
4695
  } else nt(_) || (R = $.nextTabbableNode(g));
@@ -5216,7 +5216,7 @@ const Cc = (e) => {
5216
5216
  1
5217
5217
  /* AUTHENTICATED */
5218
5218
  );
5219
- }, []), /* @__PURE__ */ H($e, { children: [
5219
+ }, []), /* @__PURE__ */ H(qe, { children: [
5220
5220
  /* @__PURE__ */ d(be, { condition: t === 0 && n.isOidcAuthEnabled(), children: /* @__PURE__ */ d(It, { headingLevel: "h4", titleText: "Loading", children: /* @__PURE__ */ d(ei, { children: /* @__PURE__ */ d(dt, { size: "xl", "aria-label": "Loading spinner" }) }) }) }),
5221
5221
  /* @__PURE__ */ d(be, { condition: t === 0 && n.isBasicAuthEnabled(), children: /* @__PURE__ */ d(Cc, { onLogin: r }) }),
5222
5222
  /* @__PURE__ */ d(be, { condition: t === 2, children: /* @__PURE__ */ d(It, { headingLevel: "h4", icon: Xr, titleText: "Empty state", children: /* @__PURE__ */ d(ei, { children: "Authentication failed." }) }) }),
@@ -5313,7 +5313,7 @@ function Pc({ columns: e, rows: t, getTd: i = () => wi }) {
5313
5313
  }
5314
5314
  ) }, `cell_${s}`);
5315
5315
  }), r = new Array(t).fill(0).map((o, s) => /* @__PURE__ */ d(Ot, { children: n }, `row_${s}`));
5316
- return /* @__PURE__ */ d($e, { children: r });
5316
+ return /* @__PURE__ */ d(qe, { children: r });
5317
5317
  }
5318
5318
  const el = ({
5319
5319
  ariaLabel: e,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apicurio/common-ui-components",
3
3
  "private": false,
4
- "version": "3.0.1",
4
+ "version": "3.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",