@phillips/seldon 1.25.1 → 1.26.1

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 (49) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +2 -4
  2. package/dist/components/Button/Button.d.ts +1 -1
  3. package/dist/components/Button/Button.js +33 -32
  4. package/dist/components/ErrorBoundary/ErrorBoundary.js +4 -4
  5. package/dist/components/Grid/Grid.d.ts +2 -2
  6. package/dist/components/Grid/Grid.js +8 -16
  7. package/dist/components/GridItem/GridItem.d.ts +1 -1
  8. package/dist/components/GridItem/GridItem.js +21 -22
  9. package/dist/components/HeroBanner/HeroBanner.d.ts +3 -2
  10. package/dist/components/HeroBanner/HeroBanner.js +36 -23
  11. package/dist/components/IconButton/IconButton.js +18 -14
  12. package/dist/components/Link/Link.d.ts +2 -2
  13. package/dist/components/Link/Link.js +21 -23
  14. package/dist/components/Link/utils.d.ts +1 -1
  15. package/dist/components/Link/utils.js +6 -6
  16. package/dist/components/LinkBlock/LinkBlock.d.ts +1 -1
  17. package/dist/components/LinkBlock/LinkBlock.js +10 -10
  18. package/dist/components/LinkList/LinkList.d.ts +1 -1
  19. package/dist/components/LinkList/LinkList.js +11 -10
  20. package/dist/components/Modal/Modal.js +43 -36
  21. package/dist/components/Row/Row.d.ts +1 -1
  22. package/dist/components/Row/Row.js +21 -23
  23. package/dist/components/Social/Social.d.ts +2 -2
  24. package/dist/components/Social/Social.js +11 -8
  25. package/dist/components/SplitPanel/SplitPanel.d.ts +1 -1
  26. package/dist/components/SplitPanel/SplitPanel.js +22 -21
  27. package/dist/components/Subscribe/Subscribe.d.ts +1 -1
  28. package/dist/components/Subscribe/Subscribe.js +41 -52
  29. package/dist/components/Text/Text.d.ts +1 -1
  30. package/dist/components/Text/Text.js +12 -20
  31. package/dist/components/ViewingsList/ViewingsList.d.ts +2 -2
  32. package/dist/components/ViewingsList/ViewingsList.js +43 -45
  33. package/dist/index.d.ts +2 -2
  34. package/dist/index.js +61 -60
  35. package/dist/node_modules/change-case/dist/index.js +64 -0
  36. package/dist/node_modules/object-assign/index.js +1 -2
  37. package/dist/node_modules/prop-types/checkPropTypes.js +1 -2
  38. package/dist/node_modules/prop-types/factoryWithThrowingShims.js +1 -2
  39. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +1 -2
  40. package/dist/node_modules/prop-types/lib/ReactPropTypesSecret.js +1 -2
  41. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +1 -2
  42. package/dist/node_modules/react-modal/lib/helpers/scopeTab.js +1 -2
  43. package/dist/node_modules/react-modal/lib/helpers/tabbable.js +2 -4
  44. package/dist/scss/components/Footer/_footer.scss +1 -0
  45. package/dist/scss/components/Grid/_grid.scss +2 -4
  46. package/dist/scss/styles.scss +3 -5
  47. package/dist/utils/index.d.ts +9 -10
  48. package/dist/utils/index.js +38 -29
  49. package/package.json +15 -13
@@ -2,8 +2,7 @@ import { __require as E } from "./lib/ReactPropTypesSecret.js";
2
2
  import { __require as _ } from "./lib/has.js";
3
3
  var f, v;
4
4
  function P() {
5
- if (v)
6
- return f;
5
+ if (v) return f;
7
6
  v = 1;
8
7
  var o = function() {
9
8
  };
@@ -1,8 +1,7 @@
1
1
  import { __require as u } from "./lib/ReactPropTypesSecret.js";
2
2
  var o, p;
3
3
  function g() {
4
- if (p)
5
- return o;
4
+ if (p) return o;
6
5
  p = 1;
7
6
  var c = u();
8
7
  function n() {
@@ -5,8 +5,7 @@ import { __require as re } from "./lib/has.js";
5
5
  import { __require as ne } from "./checkPropTypes.js";
6
6
  var A, C;
7
7
  function oe() {
8
- if (C)
9
- return A;
8
+ if (C) return A;
10
9
  C = 1;
11
10
  var k = F(), W = N(), h = ee(), j = re(), R = ne(), T = function() {
12
11
  };
@@ -1,7 +1,6 @@
1
1
  var e, r;
2
2
  function _() {
3
- if (r)
4
- return e;
3
+ if (r) return e;
5
4
  r = 1;
6
5
  var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
7
6
  return e = t, e;
@@ -9,8 +9,7 @@ import { __exports as r } from "../../../../../_virtual/react-is.production.min.
9
9
  */
10
10
  var _;
11
11
  function g() {
12
- if (_)
13
- return r;
12
+ if (_) return r;
14
13
  _ = 1;
15
14
  var t = typeof Symbol == "function" && Symbol.for, a = t ? Symbol.for("react.element") : 60103, b = t ? Symbol.for("react.portal") : 60106, n = t ? Symbol.for("react.fragment") : 60107, c = t ? Symbol.for("react.strict_mode") : 60108, f = t ? Symbol.for("react.profiler") : 60114, i = t ? Symbol.for("react.provider") : 60109, s = t ? Symbol.for("react.context") : 60110, d = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, y = t ? Symbol.for("react.forward_ref") : 60112, l = t ? Symbol.for("react.suspense") : 60113, x = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, p = t ? Symbol.for("react.lazy") : 60116, C = t ? Symbol.for("react.block") : 60121, M = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, w = t ? Symbol.for("react.scope") : 60119;
16
15
  function o(e) {
@@ -20,8 +20,7 @@ import { t as _ } from "./tabbable.js";
20
20
  }
21
21
  var t = void 0, n = r.shiftKey, o = a[0], u = a[a.length - 1], i = v();
22
22
  if (e === i) {
23
- if (!n)
24
- return;
23
+ if (!n) return;
25
24
  t = u;
26
25
  }
27
26
  if (u === i && !n && (t = o), o === i && n && (t = u), t) {
@@ -21,8 +21,7 @@ import { __module as n } from "../../../../_virtual/tabbable.js";
21
21
  }
22
22
  function b(t) {
23
23
  var e = t.offsetWidth <= 0 && t.offsetHeight <= 0;
24
- if (e && !t.innerHTML)
25
- return !0;
24
+ if (e && !t.innerHTML) return !0;
26
25
  try {
27
26
  var r = window.getComputedStyle(t), o = r.getPropertyValue("display");
28
27
  return e ? o !== s && c(t, r) : o === d;
@@ -32,8 +31,7 @@ import { __module as n } from "../../../../_virtual/tabbable.js";
32
31
  }
33
32
  function l(t) {
34
33
  for (var e = t, r = t.getRootNode && t.getRootNode(); e && e !== document.body; ) {
35
- if (r && e === r && (e = r.host.parentNode), b(e))
36
- return !1;
34
+ if (r && e === r && (e = r.host.parentNode), b(e)) return !1;
37
35
  e = e.parentNode;
38
36
  }
39
37
  return !0;
@@ -6,6 +6,7 @@
6
6
  .#{$px}-footer {
7
7
  background-color: $off-white;
8
8
  border-top: 1px solid $keyline-gray;
9
+ margin: $spacing-lg 0 0;
9
10
  width: 100%;
10
11
 
11
12
  ul {
@@ -2,11 +2,9 @@
2
2
  @import '../../utils';
3
3
 
4
4
  .#{$px}-grid {
5
- &__container {
6
- @include gridContainer(false);
7
- }
5
+ @include gridContainer(false);
8
6
 
9
- &__container--has-margins {
7
+ &--has-margins {
10
8
  margin: 0 $spacing-md;
11
9
 
12
10
  @media (min-width: 1401px) {
@@ -7,11 +7,12 @@
7
7
  @import './typography';
8
8
  @import './sharedClasses';
9
9
 
10
+ // 📑 Pages
11
+ @import 'pages/page';
12
+
10
13
  // ⚛️ Components
11
14
  @import 'components/Button/button';
12
15
  @import 'components/IconButton/iconButton';
13
-
14
- // @import 'components/DatePicker/datePicker';
15
16
  @import 'components/Footer/footer';
16
17
  @import 'components/Grid/grid';
17
18
  @import 'components/Header/header';
@@ -29,6 +30,3 @@
29
30
  @import 'components/LinkList/linkList';
30
31
  @import 'components/Text/text';
31
32
  @import 'components/Modal/modal';
32
-
33
- // 📑 Pages
34
- @import 'pages/page';
@@ -1,5 +1,14 @@
1
1
  import * as React from 'react';
2
2
  export declare const px = "phillips";
3
+ /**
4
+ * Returns standard props values incorporating the component name into the class name and data-testid
5
+ */
6
+ export declare const getCommonProps: ({ id, ...props }: {
7
+ id?: string | undefined;
8
+ }, componentName: string) => {
9
+ 'data-testid': string;
10
+ className: string;
11
+ };
3
12
  export declare enum PaddingTokens {
4
13
  xs = "xs",
5
14
  sm = "sm",
@@ -8,16 +17,6 @@ export declare enum PaddingTokens {
8
17
  xl = "xl"
9
18
  }
10
19
  export declare const noOp: () => void;
11
- export interface CommonProps {
12
- /**
13
- * Optional className to be applied to the outer most element
14
- */
15
- className?: string;
16
- /**
17
- * A custom `id`
18
- */
19
- id?: string;
20
- }
21
20
  export interface InputProps {
22
21
  /**
23
22
  * Specify whether the `<input>` should be disabled
@@ -1,36 +1,45 @@
1
- import { jsx as s } from "react/jsx-runtime";
2
- const n = "phillips";
3
- var c = /* @__PURE__ */ ((i) => (i.xs = "xs", i.sm = "sm", i.md = "md", i.lg = "lg", i.xl = "xl", i))(c || {});
4
- const v = () => {
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { kebabCase as c } from "../node_modules/change-case/dist/index.js";
3
+ const t = "phillips", v = ({ id: a, ...i }, e) => {
4
+ const l = c(e);
5
+ return {
6
+ ...i,
7
+ "data-testid": a ? `${l}-${a}` : `${l}`,
8
+ className: `${t}-${l}`
9
+ };
10
+ };
11
+ var $ = /* @__PURE__ */ ((a) => (a.xs = "xs", a.sm = "sm", a.md = "md", a.lg = "lg", a.xl = "xl", a))($ || {});
12
+ const f = () => {
5
13
  };
6
- function p({
7
- disabled: i = !1,
8
- id: l,
9
- invalid: t = !1,
10
- invalidText: o = "invalid",
11
- readOnly: r = !1,
12
- type: e,
13
- warn: d = !1,
14
- warnText: m
14
+ function x({
15
+ disabled: a = !1,
16
+ id: i,
17
+ invalid: e = !1,
18
+ invalidText: l = "invalid",
19
+ readOnly: s = !1,
20
+ type: r,
21
+ warn: m = !1,
22
+ warnText: d
15
23
  }) {
16
- const a = {
17
- disabled: !r && i,
18
- invalid: !r && !i && t,
19
- invalidId: `${l}-error-msg`,
20
- type: e === "toggle" ? "checkbox" : e,
21
- warn: !r && !i && !t && d,
22
- warnId: `${l}-warn-msg`,
24
+ const n = {
25
+ disabled: !s && a,
26
+ invalid: !s && !a && e,
27
+ invalidId: `${i}-error-msg`,
28
+ type: r === "toggle" ? "checkbox" : r,
29
+ warn: !s && !a && !e && m,
30
+ warnId: `${i}-warn-msg`,
23
31
  validation: null
24
32
  };
25
- return a.invalid && (a.validation = /* @__PURE__ */ s("div", { className: `${n}-input__validation ${n}-${e}-input--invalid`, id: a.invalidId, children: o })), a.warn && (a.validation = /* @__PURE__ */ s("div", { className: `${n}-input__validation ${n}-${e}-input--warn`, id: a.warnId, children: m })), a;
33
+ return n.invalid && (n.validation = /* @__PURE__ */ o("div", { className: `${t}-input__validation ${t}-${r}-input--invalid`, id: n.invalidId, children: l })), n.warn && (n.validation = /* @__PURE__ */ o("div", { className: `${t}-input__validation ${t}-${r}-input--warn`, id: n.warnId, children: d })), n;
26
34
  }
27
- const $ = (/* @__PURE__ */ new Date()).getFullYear(), x = (i, l = "end", t = "vertical") => `${n}-padding-${t}-${i}-${l}`, f = (i) => /(.+)@(.+){2,}\.(.+){2,}/i.test(i);
35
+ const g = (/* @__PURE__ */ new Date()).getFullYear(), w = (a, i = "end", e = "vertical") => `${t}-padding-${e}-${a}-${i}`, N = (a) => /(.+)@(.+){2,}\.(.+){2,}/i.test(a);
28
36
  export {
29
- c as PaddingTokens,
30
- $ as defaultYear,
31
- f as emailValidation,
32
- x as generatePaddingClassName,
33
- v as noOp,
34
- n as px,
35
- p as useNormalizedInputProps
37
+ $ as PaddingTokens,
38
+ g as defaultYear,
39
+ N as emailValidation,
40
+ w as generatePaddingClassName,
41
+ v as getCommonProps,
42
+ f as noOp,
43
+ t as px,
44
+ x as useNormalizedInputProps
36
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.25.1",
3
+ "version": "1.26.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -32,12 +32,14 @@
32
32
  "preview": "npx http-server storybook-static",
33
33
  "clean": "rimraf './dist'",
34
34
  "clean:stories": "rimraf './storybook-static'",
35
+ "create-component": "node --no-warnings --loader ts-node/esm .template/scripts/createComponent.ts",
35
36
  "format": "prettier . --write",
36
37
  "lint": "tsc --noEmit && eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 && npm run lint:styles",
37
38
  "lint:styles": "stylelint \"src/**/*.scss\" --fix",
38
39
  "prepare": "husky install"
39
40
  },
40
41
  "dependencies": {
42
+ "change-case": "^5.4.4",
41
43
  "classnames": "^2.5.1",
42
44
  "flatpickr": "^4.6.13",
43
45
  "react-modal": "^3.16.1"
@@ -46,20 +48,20 @@
46
48
  "@chromatic-com/storybook": "^1.5.0",
47
49
  "@commitlint/cli": "^19.3.0",
48
50
  "@commitlint/config-conventional": "^19.2.2",
49
- "@figma/code-connect": "^0.1.2",
51
+ "@figma/code-connect": "^0.2.1",
50
52
  "@semantic-release/changelog": "^6.0.3",
51
53
  "@semantic-release/git": "^10.0.1",
52
- "@semantic-release/github": "^10.0.5",
53
- "@storybook/addon-essentials": "^8.1.5",
54
+ "@semantic-release/github": "^10.0.6",
55
+ "@storybook/addon-essentials": "^8.1.10",
54
56
  "@storybook/addon-interactions": "^8.1.4",
55
57
  "@storybook/addon-links": "^8.1.4",
56
- "@storybook/addon-mdx-gfm": "^8.1.5",
58
+ "@storybook/addon-mdx-gfm": "^8.1.10",
57
59
  "@storybook/blocks": "^8.1.4",
58
60
  "@storybook/react": "^8.1.4",
59
61
  "@storybook/react-vite": "^8.1.4",
60
- "@storybook/theming": "^8.1.5",
61
- "@testing-library/jest-dom": "^6.4.5",
62
- "@testing-library/react": "^14.0.0",
62
+ "@storybook/theming": "^8.1.10",
63
+ "@testing-library/jest-dom": "^6.4.6",
64
+ "@testing-library/react": "^16.0.0",
63
65
  "@testing-library/user-event": "^14.5.2",
64
66
  "@types/color": "^3.0.6",
65
67
  "@types/react": "^18.3.3",
@@ -67,7 +69,7 @@
67
69
  "@types/react-modal": "^3.16.3",
68
70
  "@typescript-eslint/eslint-plugin": "^5.62.0",
69
71
  "@typescript-eslint/parser": "^5.62.0",
70
- "@vitejs/plugin-react": "^4.3.0",
72
+ "@vitejs/plugin-react": "^4.3.1",
71
73
  "@vitest/coverage-v8": "^1.6.0",
72
74
  "color": "^4.2.3",
73
75
  "eslint": "^8.57.0",
@@ -75,24 +77,24 @@
75
77
  "eslint-plugin-react-refresh": "^0.4.7",
76
78
  "eslint-plugin-storybook": "^0.8.0",
77
79
  "husky": "^9.0.11",
78
- "prettier": "3.3.0",
80
+ "prettier": "3.3.2",
79
81
  "react": "^18.3.1",
80
82
  "react-docgen-typescript": "^2.2.2",
81
83
  "react-dom": "^18.2.0",
82
84
  "rimraf": "^5.0.7",
83
85
  "rollup-plugin-copy": "^3.5.0",
84
86
  "rollup-plugin-peer-deps-external": "^2.2.4",
85
- "sass": "^1.77.4",
87
+ "sass": "^1.77.6",
86
88
  "semantic-release": "^23.1.1",
87
89
  "storybook": "^8.1.4",
88
90
  "stylelint": "^16.6.1",
89
91
  "stylelint-config-standard": "^36.0.0",
90
92
  "stylelint-config-standard-scss": "^13.1.0",
91
93
  "stylelint-order": "^6.0.4",
92
- "stylelint-scss": "^6.3.0",
94
+ "stylelint-scss": "^6.3.1",
93
95
  "ts-node": "^10.9.2",
94
96
  "typescript": "^5.4.5",
95
- "vite": "^5.2.12",
97
+ "vite": "^5.3.1",
96
98
  "vite-plugin-dts": "^2.3.0",
97
99
  "vite-plugin-svgr": "^4.2.0",
98
100
  "vite-tsconfig-paths": "^4.3.2",