@phillips/seldon 1.19.2 → 1.19.3

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.
@@ -1,10 +1,9 @@
1
- var n = Object.defineProperty;
2
- var i = (t, r, o) => r in t ? n(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
3
- var e = (t, r, o) => (i(t, typeof r != "symbol" ? r + "" : r, o), o);
4
- import { jsx as c } from "react/jsx-runtime";
5
- import * as l from "react";
6
- import { nullishCoalescing as p } from "../../utils/index.js";
7
- class h extends l.Component {
1
+ var i = Object.defineProperty;
2
+ var c = (t, r, o) => r in t ? i(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
3
+ var e = (t, r, o) => (c(t, typeof r != "symbol" ? r + "" : r, o), o);
4
+ import { jsx as l } from "react/jsx-runtime";
5
+ import * as p from "react";
6
+ class h extends p.Component {
8
7
  constructor() {
9
8
  super(...arguments);
10
9
  e(this, "state", {
@@ -14,12 +13,12 @@ class h extends l.Component {
14
13
  static getDerivedStateFromError() {
15
14
  return { hasError: !0 };
16
15
  }
17
- componentDidCatch(o, s) {
18
- var a;
19
- (a = this.props) == null || a.logger(o, p(s.componentStack, "ErrorBoundary caught an error"));
16
+ componentDidCatch(o, n) {
17
+ var a, s;
18
+ (s = this.props) == null || s.logger(o, (a = n.componentStack) != null ? a : "ErrorBoundary caught an error");
20
19
  }
21
20
  render() {
22
- return this.state.hasError ? this.props.fallback || /* @__PURE__ */ c("h2", { children: "Sorry... An error occurred and we are looking into it" }) : this.props.children;
21
+ return this.state.hasError ? this.props.fallback || /* @__PURE__ */ l("h2", { children: "Sorry... An error occurred and we are looking into it" }) : this.props.children;
23
22
  }
24
23
  }
25
24
  e(h, "defaultProps", {
@@ -1,15 +1,16 @@
1
- import { jsxs as r, jsx as o } from "react/jsx-runtime";
2
- import k from "../../node_modules/classnames/index.js";
3
- import { nullishCoalescing as d, px as p } from "../../utils/index.js";
1
+ import { jsxs as k, jsx as i } from "react/jsx-runtime";
2
+ import d from "../../node_modules/classnames/index.js";
3
+ import { px as p } from "../../utils/index.js";
4
4
  import f from "../Link/Link.js";
5
5
  import { LinkVariants as b } from "../Link/utils.js";
6
- const u = ({ linkProps: t, description: i, className: e, id: s, ...l }) => {
7
- const a = `${p}-link-block`, c = k(a, e), m = d(t.element, f), n = s ? `link-block-${s}` : "link-block";
8
- return /* @__PURE__ */ r("div", { ...l, className: c, id: s, "data-testid": n, children: [
9
- /* @__PURE__ */ o(m, { ...t, "data-testid": `${n}-link`, variant: b.list }),
10
- /* @__PURE__ */ o("p", { className: `${a}__description`, children: i })
6
+ const j = ({ linkProps: s, description: e, className: l, id: t, ...m }) => {
7
+ var o;
8
+ const a = `${p}-link-block`, r = d(a, l), c = (o = s.element) != null ? o : f, n = t ? `link-block-${t}` : "link-block";
9
+ return /* @__PURE__ */ k("div", { ...m, className: r, id: t, "data-testid": n, children: [
10
+ /* @__PURE__ */ i(c, { ...s, "data-testid": `${n}-link`, variant: b.list }),
11
+ /* @__PURE__ */ i("p", { className: `${a}__description`, children: e })
11
12
  ] });
12
13
  };
13
14
  export {
14
- u as default
15
+ j as default
15
16
  };
@@ -65,9 +65,4 @@ interface NormalizedProps {
65
65
  */
66
66
  export declare function useNormalizedInputProps({ disabled, id, invalid, invalidText, readOnly, type, warn, warnText, }: InputProps): NormalizedProps;
67
67
  export declare const defaultYear: number;
68
- /**
69
- * Nullish coalescing operator '??' polyfill
70
- * To be removed once sass upgrade branch is merged in phillips-public
71
- */
72
- export declare const nullishCoalescing: (a: any, b: any) => any;
73
68
  export {};
@@ -1,30 +1,29 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- const o = "phillips";
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ const n = "phillips";
3
3
  function c({
4
- disabled: i = !1,
5
- id: a,
6
- invalid: s = !1,
7
- invalidText: d = "invalid",
4
+ disabled: l = !1,
5
+ id: o,
6
+ invalid: t = !1,
7
+ invalidText: e = "invalid",
8
8
  readOnly: r = !1,
9
- type: l,
10
- warn: e = !1,
11
- warnText: u
9
+ type: a,
10
+ warn: s = !1,
11
+ warnText: v
12
12
  }) {
13
- const n = {
14
- disabled: !r && i,
15
- invalid: !r && !i && s,
16
- invalidId: `${a}-error-msg`,
17
- type: l === "toggle" ? "checkbox" : l,
18
- warn: !r && !i && !s && e,
19
- warnId: `${a}-warn-msg`,
13
+ const i = {
14
+ disabled: !r && l,
15
+ invalid: !r && !l && t,
16
+ invalidId: `${o}-error-msg`,
17
+ type: a === "toggle" ? "checkbox" : a,
18
+ warn: !r && !l && !t && s,
19
+ warnId: `${o}-warn-msg`,
20
20
  validation: null
21
21
  };
22
- return n.invalid && (n.validation = /* @__PURE__ */ t("div", { className: `${o}-input__validation ${o}-${l}-input--invalid`, id: n.invalidId, children: d })), n.warn && (n.validation = /* @__PURE__ */ t("div", { className: `${o}-input__validation ${o}-${l}-input--warn`, id: n.warnId, children: u })), n;
22
+ return i.invalid && (i.validation = /* @__PURE__ */ d("div", { className: `${n}-input__validation ${n}-${a}-input--invalid`, id: i.invalidId, children: e })), i.warn && (i.validation = /* @__PURE__ */ d("div", { className: `${n}-input__validation ${n}-${a}-input--warn`, id: i.warnId, children: v })), i;
23
23
  }
24
- const p = (/* @__PURE__ */ new Date()).getFullYear(), f = (i, a) => i ?? a;
24
+ const p = (/* @__PURE__ */ new Date()).getFullYear();
25
25
  export {
26
26
  p as defaultYear,
27
- f as nullishCoalescing,
28
- o as px,
27
+ n as px,
29
28
  c as useNormalizedInputProps
30
29
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.19.2",
3
+ "version": "1.19.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -59,7 +59,7 @@
59
59
  "@testing-library/user-event": "^14.5.2",
60
60
  "@types/color": "^3.0.6",
61
61
  "@types/jest": "^29.5.12",
62
- "@types/react": "^18.3.1",
62
+ "@types/react": "^18.3.2",
63
63
  "@types/react-dom": "^18.0.11",
64
64
  "@typescript-eslint/eslint-plugin": "^5.59.0",
65
65
  "@typescript-eslint/parser": "^5.62.0",