@phillips/seldon 1.30.2 → 1.31.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.
@@ -23,6 +23,10 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
23
23
  * The type of the button.
24
24
  */
25
25
  type?: 'button' | 'submit' | 'reset';
26
+ /**
27
+ * Should the button be disabled?
28
+ */
29
+ isDisabled?: boolean;
26
30
  }
27
31
  /**
28
32
  * ## Overview
@@ -33,5 +37,5 @@ export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
33
37
  *
34
38
  * [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-button--overview)
35
39
  */
36
- declare const Button: ({ buttonType, size, children, className, isIconLast: iconLast, type, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
40
+ declare const Button: ({ buttonType, size, children, className, isIconLast: iconLast, type, isDisabled, ...props }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
37
41
  export default Button;
@@ -1,35 +1,37 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import i from "../../node_modules/classnames/index.js";
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import f from "../../node_modules/classnames/index.js";
3
3
  import { getCommonProps as u } from "../../utils/index.js";
4
- const b = ({
4
+ const d = ({
5
5
  buttonType: t = "primary",
6
- size: m = "md",
7
- children: a,
8
- className: n,
9
- isIconLast: r = !1,
10
- type: e = "button",
11
- ...s
6
+ size: a = "md",
7
+ children: m,
8
+ className: e,
9
+ isIconLast: n = !1,
10
+ type: r = "button",
11
+ isDisabled: l = !1,
12
+ ...o
12
13
  }) => {
13
- const { className: o, ...c } = u(s, "Button");
14
- return /* @__PURE__ */ l(
14
+ const { className: s, ...c } = u(o, "Button");
15
+ return /* @__PURE__ */ i(
15
16
  "button",
16
17
  {
17
18
  ...c,
18
- type: e,
19
- className: i(
20
- `${o}`,
21
- `${o}--${m}`,
22
- `${o}--${t}`,
19
+ type: r,
20
+ className: f(
21
+ `${s}`,
22
+ `${s}--${a}`,
23
+ `${s}--${t}`,
23
24
  {
24
- [`${o}--icon-last`]: r
25
+ [`${s}--icon-last`]: n
25
26
  },
26
- n
27
+ e
27
28
  ),
28
- ...s,
29
- children: a
29
+ disabled: l,
30
+ ...o,
31
+ children: m
30
32
  }
31
33
  );
32
34
  };
33
35
  export {
34
- b as default
36
+ d as default
35
37
  };
@@ -1,45 +1,48 @@
1
- import { jsxs as u, jsx as a } from "react/jsx-runtime";
2
- import { getCommonProps as x, px as j, noOp as s } from "../../utils/index.js";
3
- import A from "../Input/Input.js";
4
- import E from "../../assets/account_circle.svg.js";
5
- import M from "../Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
6
- import P from "../Navigation/NavigationList/NavigationList.js";
7
- import S from "../Navigation/NavigationItem/NavigationItem.js";
8
- import { SupportedLanguages as o } from "../../types/commonTypes.js";
9
- import T from "../../node_modules/classnames/index.js";
10
- const H = ({
1
+ import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
+ import { getCommonProps as j, px as A, noOp as r } from "../../utils/index.js";
3
+ import M from "../Input/Input.js";
4
+ import P from "../../assets/account_circle.svg.js";
5
+ import S from "../Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
6
+ import T from "../Navigation/NavigationList/NavigationList.js";
7
+ import U from "../Navigation/NavigationItem/NavigationItem.js";
8
+ import { SupportedLanguages as s } from "../../types/commonTypes.js";
9
+ import w from "../../node_modules/classnames/index.js";
10
+ const K = ({
11
11
  accountDetailsLink: m,
12
- children: p,
13
- className: v,
14
- currentLanguage: n = o.en,
15
- languageOptions: i = [
16
- { label: "English", value: o.en },
17
- { label: "中文", value: o.zh }
12
+ children: v,
13
+ className: p,
14
+ currentLanguage: o = s.en,
15
+ languageOptions: t = [
16
+ { label: "English", value: s.en },
17
+ { label: "中文", value: s.zh }
18
18
  ],
19
- onLanguageChange: d = s,
20
- isLoggedIn: r = !1,
21
- onLogin: f = s,
22
- onLogout: _ = s,
23
- loginLabel: h = "Login",
24
- logoutLabel: N = "Logout",
19
+ onLanguageChange: h = r,
20
+ isLoggedIn: n = !1,
21
+ onLogin: f = r,
22
+ onLogout: _ = r,
23
+ loginLabel: N = "Login",
24
+ logoutLabel: b = "Logout",
25
25
  ...c
26
26
  }) => {
27
- var t, g;
28
- const { className: l, ...b } = x(c, "UserManagement"), $ = (g = (t = i.find((e) => e.value === n)) == null ? void 0 : t.label) != null ? g : "English", C = m != null ? m : "a";
29
- return /* @__PURE__ */ u("div", { ...b, className: T(l, v), ...c, children: [
30
- /* @__PURE__ */ u("ul", { className: `${l}__account-wrapper`, children: [
31
- r && /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(E, { className: `${l}__account-icon` }) }),
27
+ var i, g;
28
+ const { className: l, ...C } = j(c, "UserManagement"), $ = (g = (i = t.find((e) => e.value === o)) == null ? void 0 : i.label) != null ? g : "English", x = m != null ? m : "a", E = (e) => {
29
+ var u;
30
+ (u = document.activeElement) == null || u.blur(), h(e);
31
+ };
32
+ return /* @__PURE__ */ d("div", { ...C, className: w(l, p), ...c, children: [
33
+ /* @__PURE__ */ d("ul", { className: `${l}__account-wrapper`, children: [
34
+ n && /* @__PURE__ */ a(x, { children: /* @__PURE__ */ a(P, { className: `${l}__account-icon` }) }),
32
35
  /* @__PURE__ */ a(
33
- S,
36
+ U,
34
37
  {
35
38
  className: `${l}__login`,
36
- onClick: r ? _ : f,
37
- label: r ? N : h
39
+ onClick: n ? _ : f,
40
+ label: n ? b : N
38
41
  }
39
42
  )
40
43
  ] }),
41
- /* @__PURE__ */ a(M, { className: `${l}__language`, label: $, children: /* @__PURE__ */ a(P, { id: `${j}-langauge-selection-list`, className: `${l}__language__selections`, children: i.map((e) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
42
- A,
44
+ /* @__PURE__ */ a(S, { className: `${l}__language`, label: $, children: /* @__PURE__ */ a(T, { id: `${A}-langauge-selection-list`, className: `${l}__language__selections`, children: t.map((e) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
45
+ M,
43
46
  {
44
47
  type: "radio",
45
48
  id: `radio-${e.value}`,
@@ -47,13 +50,13 @@ const H = ({
47
50
  value: e.value,
48
51
  inline: !0,
49
52
  name: "languages",
50
- checked: e.value === n,
51
- onChange: () => d(e.value)
53
+ checked: e.value === o,
54
+ onChange: () => E(e.value)
52
55
  }
53
56
  ) }, e.value)) }) }),
54
- p
57
+ v
55
58
  ] });
56
59
  };
57
60
  export {
58
- H as default
61
+ K as default
59
62
  };
@@ -78,6 +78,17 @@
78
78
  padding: 0.75em 1.75em;
79
79
  }
80
80
 
81
+ &:disabled {
82
+ background-color: $white;
83
+ border: 1px solid $medium-gray;
84
+ color: $medium-gray;
85
+ cursor: default;
86
+
87
+ svg {
88
+ fill: $medium-gray;
89
+ }
90
+ }
91
+
81
92
  * {
82
93
  margin: 0;
83
94
  }
@@ -22,6 +22,10 @@
22
22
  margin-top: auto;
23
23
  padding: 0;
24
24
  position: unset;
25
+
26
+ .#{$px}-nav__item-trigger {
27
+ text-align: unset;
28
+ }
25
29
  }
26
30
 
27
31
  > li {
@@ -88,6 +92,8 @@
88
92
  }
89
93
  .#{$px}-user-management__language {
90
94
  &__selections {
95
+ padding: 0.8125rem;
96
+
91
97
  @include isHeaderDesktop {
92
98
  background: $off-white;
93
99
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 85%);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.30.2",
3
+ "version": "1.31.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -52,14 +52,14 @@
52
52
  "@semantic-release/changelog": "^6.0.3",
53
53
  "@semantic-release/git": "^10.0.1",
54
54
  "@semantic-release/github": "^10.1.0",
55
- "@storybook/addon-essentials": "^8.2.4",
55
+ "@storybook/addon-essentials": "^8.2.5",
56
56
  "@storybook/addon-interactions": "^8.1.4",
57
57
  "@storybook/addon-links": "^8.1.4",
58
58
  "@storybook/addon-mdx-gfm": "^8.2.4",
59
59
  "@storybook/blocks": "^8.1.4",
60
60
  "@storybook/react": "^8.1.4",
61
61
  "@storybook/react-vite": "^8.1.4",
62
- "@storybook/theming": "^8.2.3",
62
+ "@storybook/theming": "^8.2.4",
63
63
  "@testing-library/jest-dom": "^6.4.6",
64
64
  "@testing-library/react": "^16.0.0",
65
65
  "@testing-library/user-event": "^14.5.2",
@@ -78,7 +78,7 @@
78
78
  "eslint-plugin-react-hooks": "^4.6.2",
79
79
  "eslint-plugin-react-refresh": "^0.4.8",
80
80
  "eslint-plugin-storybook": "^0.8.0",
81
- "husky": "^9.0.11",
81
+ "husky": "^9.1.2",
82
82
  "prettier": "3.3.2",
83
83
  "react": "^18.3.1",
84
84
  "react-docgen-typescript": "^2.2.2",
@@ -95,7 +95,7 @@
95
95
  "stylelint-order": "^6.0.4",
96
96
  "stylelint-scss": "^6.4.1",
97
97
  "ts-node": "^10.9.2",
98
- "typescript": "^5.5.3",
98
+ "typescript": "^5.5.4",
99
99
  "vite": "^5.3.3",
100
100
  "vite-plugin-dts": "^2.3.0",
101
101
  "vite-plugin-svgr": "^4.2.0",