@phillips/seldon 1.26.1 → 1.26.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.
@@ -6,7 +6,7 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
6
6
  /**
7
7
  * True if button comes after text
8
8
  */
9
- iconLast?: boolean;
9
+ isIconLast?: boolean;
10
10
  /**
11
11
  * Optional click handler
12
12
  */
@@ -33,5 +33,5 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
33
33
  *
34
34
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-button--overview)
35
35
  */
36
- declare const Button: ({ buttonType, size, children, className, iconLast, type, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
36
+ declare const Button: ({ buttonType, size, children, className, isIconLast: iconLast, type, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
37
37
  export default Button;
@@ -1,31 +1,31 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- import u from "../../node_modules/classnames/index.js";
3
- import { getCommonProps as $ } from "../../utils/index.js";
2
+ import i from "../../node_modules/classnames/index.js";
3
+ import { getCommonProps as u } from "../../utils/index.js";
4
4
  const b = ({
5
- buttonType: s = "primary",
5
+ buttonType: t = "primary",
6
6
  size: m = "md",
7
7
  children: a,
8
- className: r,
9
- iconLast: n = !1,
8
+ className: n,
9
+ isIconLast: r = !1,
10
10
  type: e = "button",
11
- ...t
11
+ ...s
12
12
  }) => {
13
- const { className: o, ...c } = $(t, "Button");
13
+ const { className: o, ...c } = u(s, "Button");
14
14
  return /* @__PURE__ */ l(
15
15
  "button",
16
16
  {
17
17
  ...c,
18
18
  type: e,
19
- className: u(
19
+ className: i(
20
20
  `${o}`,
21
21
  `${o}--${m}`,
22
- `${o}--${s}`,
22
+ `${o}--${t}`,
23
23
  {
24
- [`${o}--icon-last`]: n
24
+ [`${o}--icon-last`]: r
25
25
  },
26
- r
26
+ n
27
27
  ),
28
- ...t,
28
+ ...s,
29
29
  children: a
30
30
  }
31
31
  );
@@ -1,15 +1,15 @@
1
- import { jsxs as R, jsx as l } from "react/jsx-runtime";
2
- import * as y from "react";
3
- import a from "../../node_modules/classnames/index.js";
4
- import { px as t, useNormalizedInputProps as z } from "../../utils/index.js";
5
- const S = y.forwardRef(
1
+ import { jsxs as P, jsx as l } from "react/jsx-runtime";
2
+ import * as R from "react";
3
+ import n from "../../node_modules/classnames/index.js";
4
+ import { px as t, useNormalizedInputProps as S } from "../../utils/index.js";
5
+ const z = R.forwardRef(
6
6
  ({
7
7
  children: r,
8
- className: n,
9
- defaultValue: o,
10
- disabled: d,
8
+ className: a,
9
+ defaultValue: d,
10
+ disabled: o,
11
11
  hideLabel: u,
12
- id: e,
12
+ id: i,
13
13
  inline: m,
14
14
  invalid: $,
15
15
  invalidText: c,
@@ -21,38 +21,39 @@ const S = y.forwardRef(
21
21
  value: h,
22
22
  warn: v,
23
23
  warnText: x,
24
- ...j
25
- }, N) => {
26
- const s = "select", i = z({ disabled: d, id: e, invalid: $, invalidText: c, readOnly: p, type: s, warn: v, warnText: x }), P = a(`${t}-${s}-input`, `${t}-input`, `${t}-input--${w}`, {
24
+ ...N
25
+ }, j) => {
26
+ const s = "select", e = S({ disabled: o, id: i, invalid: $, invalidText: c, readOnly: p, type: s, warn: v, warnText: x }), y = n(`${t}-${s}-input`, `${t}-input`, `${t}-input--${w}`, {
27
27
  [`${t}-input--inline`]: m,
28
28
  [`${t}-input--readonly`]: p,
29
- [`${t}-input--disabled`]: i.disabled,
30
- [`${t}-input--invalid`]: i.invalid,
31
- [`${t}-input--warn`]: i.warn,
32
- [`${n}__wrapper`]: n
29
+ [`${t}-input--disabled`]: e.disabled,
30
+ [`${t}-input--invalid`]: e.invalid,
31
+ [`${t}-input--warn`]: e.warn,
32
+ [`${a}__wrapper`]: a
33
33
  });
34
- return /* @__PURE__ */ R("div", { className: P, children: [
35
- /* @__PURE__ */ l("label", { htmlFor: e, className: a(`${t}-input__label`, { [`${t}-input__label--hidden`]: u }), children: _ }),
34
+ return /* @__PURE__ */ P("div", { className: y, children: [
35
+ /* @__PURE__ */ l("label", { htmlFor: i, className: n(`${t}-input__label`, { [`${t}-input__label--hidden`]: u }), children: _ }),
36
36
  /* @__PURE__ */ l(
37
37
  "select",
38
38
  {
39
- className: a(`${t}-input__input`, { className: n }),
40
- "data-testid": e,
41
- defaultValue: o,
42
- disabled: i.disabled,
43
- id: e,
39
+ className: n(`${t}-input__input`, { className: a }),
40
+ "data-testid": i,
41
+ defaultValue: d,
42
+ disabled: e.disabled,
43
+ id: i,
44
44
  onChange: b,
45
45
  onClick: f,
46
- ref: N,
46
+ ref: j,
47
47
  value: h,
48
- ...j,
48
+ ...N,
49
49
  children: r
50
50
  }
51
51
  ),
52
- i.validation
52
+ e.validation
53
53
  ] });
54
54
  }
55
55
  );
56
+ z.displayName = "Select";
56
57
  export {
57
- S as default
58
+ z as default
58
59
  };
@@ -7,16 +7,16 @@ import P from "./ViewingsListCard.js";
7
7
  import R from "../Button/Button.js";
8
8
  const $ = () => Math.floor(Math.random() * 100) + Date.now(), G = ({
9
9
  cardTitle: C = "Viewing Details",
10
- className: N,
10
+ className: E,
11
11
  i18n: f = {},
12
12
  onAdd: r,
13
13
  onDelete: e,
14
- onSave: O,
15
- title: D,
14
+ onSave: N,
15
+ title: O,
16
16
  viewings: c,
17
17
  ...i
18
18
  }) => {
19
- const [a, h] = d.useState(c), [m, n] = d.useState(""), [o, u] = d.useState(), { className: p, ...E } = M(i, "ViewingsList");
19
+ const [a, h] = d.useState(c), [m, n] = d.useState(""), [s, u] = d.useState(), { className: p, ...D } = M(i, "ViewingsList");
20
20
  d.useEffect(() => {
21
21
  h(c);
22
22
  }, [c]);
@@ -26,19 +26,19 @@ const $ = () => Math.floor(Math.random() * 100) + Date.now(), G = ({
26
26
  }, V = (t) => {
27
27
  n(""), typeof e == "function" && e(t);
28
28
  }, k = (t) => {
29
- n(t), u(a == null ? void 0 : a.find((s) => s.id === t));
29
+ n(t), u(a == null ? void 0 : a.find((o) => o.id === t));
30
30
  }, x = (t) => {
31
- O(t) && n("");
31
+ N(t) && n("");
32
32
  }, B = () => {
33
- typeof o == "string" ? typeof e == "function" && e(o) : m === (o == null ? void 0 : o.id) && h((t) => t == null ? void 0 : t.map((s) => s.id === o.id ? o : s)), n("");
33
+ typeof s == "string" ? typeof e == "function" && e(s) : m === (s == null ? void 0 : s.id) && h((t) => t == null ? void 0 : t.map((o) => o.id === s.id ? s : o)), n("");
34
34
  };
35
- return /* @__PURE__ */ L("div", { ...E, className: S(p, N), key: m, ...i }, /* @__PURE__ */ l("h2", { className: S(`${p}__title`), children: D }), a == null ? void 0 : a.map((t, s) => /* @__PURE__ */ l(
35
+ return /* @__PURE__ */ L("div", { ...D, className: S(p, E), key: m, ...i }, /* @__PURE__ */ l("h2", { className: S(`${p}__title`), children: O }), a == null ? void 0 : a.map((t, o) => /* @__PURE__ */ l(
36
36
  P,
37
37
  {
38
38
  ...t,
39
39
  ...f,
40
- cardTitle: t.location ? `${C} ${s + 1}` : void 0,
41
- editState: m === t.id,
40
+ cardTitle: t.location ? `${C} ${o + 1}` : void 0,
41
+ isEditState: m === t.id,
42
42
  onCancel: B,
43
43
  onDelete: V,
44
44
  onEdit: () => k(t.id),
@@ -20,7 +20,7 @@ export interface ViewingsListCardProps extends ViewingsListCardFormProps, Record
20
20
  /**
21
21
  * Location of viewing
22
22
  */
23
- editState?: boolean;
23
+ isEditState?: boolean;
24
24
  /**
25
25
  * Default boolean to determine whether viewing is enabled on site
26
26
  */
@@ -108,5 +108,5 @@ export interface ViewingsListCardProps extends ViewingsListCardFormProps, Record
108
108
  */
109
109
  saveBtnLabel?: string;
110
110
  }
111
- declare const ViewingsListCard: ({ address1, address1Label, addressUrl, addressUrlLabel, address2, address2Label, address3, address3Label, cancelBtnLabel, cardTitle, deleteBtnLabel, editBtnLabel, editState, enableOnSite, enableOnSiteToggleLabel, email, emailLabel, emailLink, emailLinkLabel, emailOn, emailToggleLabel, id, invalidFields, location, locationLabel, onCancel, onEdit, onDelete, onSave, previewDates, previewDatesLabel, previewHours1, previewHours1Label, previewHours2, previewHours2Label, previewLabel, previewLabelValue, previewOn, previewToggleLabel, saveBtnLabel, viewingLabel, viewingLabelValue, viewingDates, viewingDatesLabel, viewingHours1, viewingHours1Label, viewingHours2, viewingHours2Label, }: ViewingsListCardProps) => import("react/jsx-runtime").JSX.Element;
111
+ declare const ViewingsListCard: ({ address1, address1Label, addressUrl, addressUrlLabel, address2, address2Label, address3, address3Label, cancelBtnLabel, cardTitle, deleteBtnLabel, editBtnLabel, isEditState: editState, enableOnSite, enableOnSiteToggleLabel, email, emailLabel, emailLink, emailLinkLabel, emailOn, emailToggleLabel, id, invalidFields, location, locationLabel, onCancel, onEdit, onDelete, onSave, previewDates, previewDatesLabel, previewHours1, previewHours1Label, previewHours2, previewHours2Label, previewLabel, previewLabelValue, previewOn, previewToggleLabel, saveBtnLabel, viewingLabel, viewingLabelValue, viewingDates, viewingDatesLabel, viewingHours1, viewingHours1Label, viewingHours2, viewingHours2Label, }: ViewingsListCardProps) => import("react/jsx-runtime").JSX.Element;
112
112
  export default ViewingsListCard;
@@ -1,13 +1,13 @@
1
- import { jsxs as a, jsx as e, Fragment as y } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as t, Fragment as y } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
- import ie from "../../node_modules/classnames/index.js";
3
+ import it from "../../node_modules/classnames/index.js";
4
4
  import { px as E } from "../../utils/index.js";
5
5
  import g from "../Input/Input.js";
6
6
  import l from "../Button/Button.js";
7
- import pe from "./ViewingsListCardForm.js";
8
- const u = `${E}-viewings-list-card`, Ee = ({
9
- address1: $,
10
- address1Label: d,
7
+ import pt from "./ViewingsListCardForm.js";
8
+ const u = `${E}-viewings-list-card`, Et = ({
9
+ address1: d,
10
+ address1Label: $,
11
11
  addressUrl: C,
12
12
  addressUrlLabel: T,
13
13
  address2: O,
@@ -18,16 +18,16 @@ const u = `${E}-viewings-list-card`, Ee = ({
18
18
  cardTitle: L = "Add New Viewing",
19
19
  deleteBtnLabel: _ = "DELETE",
20
20
  editBtnLabel: k = "EDIT",
21
- editState: o,
21
+ isEditState: o,
22
22
  enableOnSite: i = "false",
23
23
  enableOnSiteToggleLabel: I = "Enabled on website",
24
24
  email: N,
25
- emailLabel: V = "Email",
26
- emailLink: S,
25
+ emailLabel: S = "Email",
26
+ emailLink: V,
27
27
  emailLinkLabel: v = "Email Address",
28
28
  emailOn: j = "false",
29
29
  emailToggleLabel: D = "Include Email Address",
30
- id: t,
30
+ id: e,
31
31
  invalidFields: n,
32
32
  location: R,
33
33
  locationLabel: q = "Location",
@@ -49,40 +49,40 @@ const u = `${E}-viewings-list-card`, Ee = ({
49
49
  viewingLabel: Y,
50
50
  viewingLabelValue: Z,
51
51
  viewingDates: F,
52
- viewingDatesLabel: ee,
53
- viewingHours1: te,
54
- viewingHours1Label: ne,
55
- viewingHours2: oe,
56
- viewingHours2Label: se
52
+ viewingDatesLabel: tt,
53
+ viewingHours1: et,
54
+ viewingHours1Label: nt,
55
+ viewingHours2: ot,
56
+ viewingHours2Label: st
57
57
  }) => {
58
- const [ce, re] = r.useState(i === "true"), c = r.useRef(null);
58
+ const [ct, rt] = r.useState(i === "true"), c = r.useRef(null);
59
59
  r.useEffect(() => {
60
60
  o && c.current && c.current.focus();
61
61
  }, [o]), r.useEffect(() => {
62
62
  var s, b;
63
63
  n && c.current && ((b = (s = c.current.closest(".phillips-viewings-list-card")) == null ? void 0 : s.querySelector(".phillips-input--invalid input")) == null || b.focus());
64
64
  }, [n]);
65
- const le = () => {
65
+ const lt = () => {
66
66
  typeof p == "function" && p();
67
- }, ue = () => {
67
+ }, ut = () => {
68
68
  typeof m == "function" && m();
69
- }, ae = (s) => {
69
+ }, at = (s) => {
70
70
  typeof h == "function" && h(s);
71
71
  };
72
72
  return /* @__PURE__ */ a(
73
73
  "section",
74
74
  {
75
- "data-testid": `viewings-list-card-${t}`,
76
- id: t,
77
- className: ie(`${u}`, { [`${u}--edit-state`]: o }),
75
+ "data-testid": `viewings-list-card-${e}`,
76
+ id: e,
77
+ className: it(`${u}`, { [`${u}--edit-state`]: o }),
78
78
  children: [
79
- /* @__PURE__ */ e("h3", { className: `${u}__title`, children: L }),
80
- /* @__PURE__ */ e("input", { type: "hidden", name: "id", value: t }),
81
- /* @__PURE__ */ e(
79
+ /* @__PURE__ */ t("h3", { className: `${u}__title`, children: L }),
80
+ /* @__PURE__ */ t("input", { type: "hidden", name: "id", value: e }),
81
+ /* @__PURE__ */ t(
82
82
  g,
83
83
  {
84
84
  ref: c,
85
- id: `location-${t}`,
85
+ id: `location-${e}`,
86
86
  defaultValue: R,
87
87
  labelText: q,
88
88
  size: "sm",
@@ -92,11 +92,11 @@ const u = `${E}-viewings-list-card`, Ee = ({
92
92
  readOnly: !o
93
93
  }
94
94
  ),
95
- o ? /* @__PURE__ */ e(
96
- pe,
95
+ o ? /* @__PURE__ */ t(
96
+ pt,
97
97
  {
98
- address1: $,
99
- address1Label: d,
98
+ address1: d,
99
+ address1Label: $,
100
100
  addressUrl: C,
101
101
  addressUrlLabel: T,
102
102
  address2: O,
@@ -104,12 +104,12 @@ const u = `${E}-viewings-list-card`, Ee = ({
104
104
  address3: x,
105
105
  address3Label: z,
106
106
  email: N,
107
- emailLabel: V,
108
- emailLink: S,
107
+ emailLabel: S,
108
+ emailLink: V,
109
109
  emailLinkLabel: v,
110
110
  emailOn: j,
111
111
  emailToggleLabel: D,
112
- id: t,
112
+ id: e,
113
113
  invalidFields: n,
114
114
  previewDates: B,
115
115
  previewDatesLabel: G,
@@ -124,17 +124,17 @@ const u = `${E}-viewings-list-card`, Ee = ({
124
124
  viewingLabel: Y,
125
125
  viewingLabelValue: Z,
126
126
  viewingDates: F,
127
- viewingDatesLabel: ee,
128
- viewingHours1: te,
129
- viewingHours1Label: ne,
130
- viewingHours2: oe,
131
- viewingHours2Label: se
127
+ viewingDatesLabel: tt,
128
+ viewingHours1: et,
129
+ viewingHours1Label: nt,
130
+ viewingHours2: ot,
131
+ viewingHours2Label: st
132
132
  }
133
133
  ) : null,
134
- /* @__PURE__ */ e(
134
+ /* @__PURE__ */ t(
135
135
  g,
136
136
  {
137
- id: `enableOnSite-${t}`,
137
+ id: `enableOnSite-${e}`,
138
138
  type: "toggle",
139
139
  defaultChecked: i === "true",
140
140
  labelText: I,
@@ -142,25 +142,25 @@ const u = `${E}-viewings-list-card`, Ee = ({
142
142
  inline: !0,
143
143
  value: "true",
144
144
  name: "enableOnSite",
145
- onChange: () => re((s) => !s),
145
+ onChange: () => rt((s) => !s),
146
146
  readOnly: !o
147
147
  }
148
148
  ),
149
- ce ? null : /* @__PURE__ */ e("input", { type: "hidden", name: "enableOnSite", value: "false" }),
150
- /* @__PURE__ */ e("hr", {}),
151
- /* @__PURE__ */ e("div", { className: `${u}__btn-group ${E}-button__group`, children: o ? /* @__PURE__ */ a(y, { children: [
152
- /* @__PURE__ */ e(l, { id: `vlc-save-btn-${t}`, buttonType: "ghost", type: "submit", size: "sm", onClick: ae, children: X }),
153
- /* @__PURE__ */ e(l, { id: `vlc-cancel-btn-${t}`, buttonType: "ghost", type: "button", size: "sm", onClick: le, children: A })
149
+ ct ? null : /* @__PURE__ */ t("input", { type: "hidden", name: "enableOnSite", value: "false" }),
150
+ /* @__PURE__ */ t("hr", {}),
151
+ /* @__PURE__ */ t("div", { className: `${u}__btn-group ${E}-button__group`, children: o ? /* @__PURE__ */ a(y, { children: [
152
+ /* @__PURE__ */ t(l, { id: `vlc-save-btn-${e}`, buttonType: "ghost", type: "submit", size: "sm", onClick: at, children: X }),
153
+ /* @__PURE__ */ t(l, { id: `vlc-cancel-btn-${e}`, buttonType: "ghost", type: "button", size: "sm", onClick: lt, children: A })
154
154
  ] }) : /* @__PURE__ */ a(y, { children: [
155
- /* @__PURE__ */ e(l, { id: `vlc-edit-btn-${t}`, buttonType: "ghost", type: "button", size: "sm", onClick: ue, children: k }),
156
- /* @__PURE__ */ e(
155
+ /* @__PURE__ */ t(l, { id: `vlc-edit-btn-${e}`, buttonType: "ghost", type: "button", size: "sm", onClick: ut, children: k }),
156
+ /* @__PURE__ */ t(
157
157
  l,
158
158
  {
159
- id: `vlc-delete-btn-${t}`,
159
+ id: `vlc-delete-btn-${e}`,
160
160
  buttonType: "ghost",
161
161
  type: "button",
162
162
  size: "sm",
163
- onClick: () => typeof f == "function" && f(t),
163
+ onClick: () => typeof f == "function" && f(e),
164
164
  children: _
165
165
  }
166
166
  )
@@ -170,5 +170,5 @@ const u = `${E}-viewings-list-card`, Ee = ({
170
170
  );
171
171
  };
172
172
  export {
173
- Ee as default
173
+ Et as default
174
174
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.26.1",
3
+ "version": "1.26.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -73,6 +73,7 @@
73
73
  "@vitest/coverage-v8": "^1.6.0",
74
74
  "color": "^4.2.3",
75
75
  "eslint": "^8.57.0",
76
+ "eslint-plugin-react": "^7.34.3",
76
77
  "eslint-plugin-react-hooks": "^4.6.2",
77
78
  "eslint-plugin-react-refresh": "^0.4.7",
78
79
  "eslint-plugin-storybook": "^0.8.0",
@@ -91,7 +92,7 @@
91
92
  "stylelint-config-standard": "^36.0.0",
92
93
  "stylelint-config-standard-scss": "^13.1.0",
93
94
  "stylelint-order": "^6.0.4",
94
- "stylelint-scss": "^6.3.1",
95
+ "stylelint-scss": "^6.3.2",
95
96
  "ts-node": "^10.9.2",
96
97
  "typescript": "^5.4.5",
97
98
  "vite": "^5.3.1",