@phillips/seldon 1.221.0 → 1.223.0

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,85 +1,87 @@
1
- import { jsxs as w, jsx as t } from "react/jsx-runtime";
2
- import { memo as x, forwardRef as C, useRef as P, useState as S, useCallback as j, useEffect as k } from "react";
1
+ import { jsxs as w, jsx as l } from "react/jsx-runtime";
2
+ import { memo as L, forwardRef as C, useRef as S, useState as T, useCallback as V, useEffect as j } from "react";
3
3
  import d from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as R } from "../../utils/index.js";
5
- import V from "../Icon/Icon.js";
6
- import { isImageValid as B } from "./utils.js";
7
- const H = typeof window > "u", M = x(
4
+ import { getCommonProps as k } from "../../utils/index.js";
5
+ import { TextVariants as M } from "../Text/types.js";
6
+ import P from "../Text/Text.js";
7
+ import { isImageValid as R } from "./utils.js";
8
+ const B = typeof window > "u", H = L(
8
9
  C(
9
10
  ({
10
11
  className: I,
11
12
  aspectRatio: s = "none",
12
13
  objectFit: g = "none",
13
- hasBlurBackground: b = !1,
14
- imageClassName: h,
15
- imageStyle: y,
16
- src: o,
17
- alt: c,
18
- srcSet: a,
14
+ hasBlurBackground: y = !1,
15
+ imageClassName: N,
16
+ imageStyle: b,
17
+ src: a,
18
+ alt: f,
19
+ srcSet: o,
19
20
  sizes: r,
20
- loading: N,
21
- fetchPriority: E,
22
- errorText: v = "Error loading image",
23
- ...f
24
- }, L) => {
25
- const { className: e, ...u } = R(f, "SeldonImage"), p = P(null), [n, i] = S(() => {
26
- if (H)
21
+ loading: h,
22
+ fetchPriority: v,
23
+ errorText: x = "Image Unavailable",
24
+ ...c
25
+ }, E) => {
26
+ const { className: e, ...u } = k(c, "SeldonImage"), p = S(null), [n, i] = T(() => {
27
+ if (B)
27
28
  return "loading";
28
- const l = document.getElementById(o);
29
- if (l instanceof HTMLImageElement && !l.classList.contains(`${e}-img--hidden`))
29
+ const t = document.getElementById(a);
30
+ if (t instanceof HTMLImageElement && !t.classList.contains(`${e}-img--hidden`))
30
31
  return "loaded";
31
32
  const m = document.createElement("img");
32
- return a && (m.srcset = a), r && (m.sizes = r), m.src = o, m.complete ? "loaded" : "loading";
33
- }), $ = j(async () => {
34
- const l = await B({
33
+ return o && (m.srcset = o), r && (m.sizes = r), m.src = a, m.complete ? "loaded" : "loading";
34
+ }), $ = V(async () => {
35
+ const t = await R({
35
36
  img: p.current,
36
- src: o,
37
- srcSet: a,
37
+ src: a,
38
+ srcSet: o,
38
39
  sizes: r
39
40
  });
40
- i(l ? "loaded" : "error");
41
- }, [o, a, r]);
42
- return k(() => {
41
+ i(t ? "loaded" : "error");
42
+ }, [a, o, r]);
43
+ return j(() => {
43
44
  $();
44
45
  }, [$]), /* @__PURE__ */ w(
45
46
  "div",
46
47
  {
47
- ref: L,
48
+ ref: E,
48
49
  className: d(e, I, {
49
- [`${e}--aspect-ratio-${s.replace("/", "-")}`]: s !== "none"
50
+ [`${e}--aspect-ratio-${s.replace("/", "-")}`]: s !== "none",
51
+ [`${e}--error-image`]: n === "error"
50
52
  }),
51
53
  role: "img",
52
- "aria-label": c,
53
- ...f,
54
+ "aria-label": f,
55
+ ...c,
54
56
  ...u,
55
57
  children: [
56
- b && /* @__PURE__ */ t(
58
+ y && /* @__PURE__ */ l(
57
59
  "div",
58
60
  {
59
61
  className: d(`${e}-blur`, {
60
62
  [`${e}-blur--hidden`]: n === "loading" || n === "error"
61
63
  }),
62
- style: { backgroundImage: `url(${o})` }
64
+ style: { backgroundImage: `url(${a})` }
63
65
  }
64
66
  ),
65
- n === "error" ? /* @__PURE__ */ t("div", { className: `${e}--error`, children: /* @__PURE__ */ t(V, { icon: "PhillipsLogo", "aria-label": v, role: "img" }) }) : null,
66
- /* @__PURE__ */ t(
67
+ n === "error" ? /* @__PURE__ */ l("div", { className: `${e}--error`, children: /* @__PURE__ */ l(P, { variant: M.displayMedium, className: `${e}--error-text`, children: x }) }) : null,
68
+ /* @__PURE__ */ l(
67
69
  "img",
68
70
  {
69
- className: d(`${e}-img`, h, {
71
+ className: d(`${e}-img`, N, {
70
72
  [`${e}-img--hidden`]: n === "error",
71
73
  [`${e}-img--object-fit-${g}`]: g !== "none"
72
74
  }),
73
- id: o,
74
- style: y,
75
- src: o,
76
- srcSet: a,
75
+ id: a,
76
+ style: b,
77
+ src: a,
78
+ srcSet: o,
77
79
  sizes: r,
78
- alt: c,
80
+ alt: f,
79
81
  "data-testid": `${u["data-testid"]}-img`,
80
82
  ref: p,
81
- loading: N,
82
- fetchpriority: E,
83
+ loading: h,
84
+ fetchpriority: v,
83
85
  onLoad: () => {
84
86
  i("loaded");
85
87
  },
@@ -94,7 +96,7 @@ const H = typeof window > "u", M = x(
94
96
  }
95
97
  )
96
98
  );
97
- M.displayName = "SeldonImage";
99
+ H.displayName = "SeldonImage";
98
100
  export {
99
- M as default
101
+ H as default
100
102
  };
@@ -15,14 +15,16 @@
15
15
  &--error {
16
16
  width: 100%;
17
17
 
18
- .phillips-logo {
19
- fill: $medium-gray;
18
+ &-image {
19
+ background-color: $bg-soft;
20
20
  }
21
21
 
22
- svg {
22
+ &-text {
23
+ color: $black-50;
23
24
  left: 50%;
24
- max-width: 50%;
25
25
  position: absolute;
26
+ text-align: center;
27
+ text-transform: uppercase;
26
28
  top: 50%;
27
29
  transform: translate(-50%, -50%);
28
30
  }
@@ -8,15 +8,16 @@
8
8
  width: 635px;
9
9
 
10
10
  @media (max-width: $breakpoint-md) {
11
- height: 100vh;
11
+ height: 100dvh;
12
12
  width: 100%;
13
13
  }
14
14
  }
15
15
 
16
16
  &__wrapper {
17
17
  display: flex;
18
+ flex: 1;
18
19
  flex-direction: column;
19
- height: 100%;
20
+ min-height: -webkit-fill-available;
20
21
  }
21
22
 
22
23
  &__header {
@@ -84,6 +85,12 @@
84
85
  &::placeholder {
85
86
  font-variation-settings: 'wght' 700;
86
87
  }
88
+
89
+ // Remove iOS gray background
90
+ @supports (-webkit-touch-callout: none) {
91
+ appearance: none;
92
+ background-color: $white-100;
93
+ }
87
94
  }
88
95
  }
89
96
 
@@ -22,6 +22,7 @@
22
22
  border: 1px solid $black-100;
23
23
  border-radius: $radius-xs;
24
24
  box-sizing: border-box;
25
+ color: $text-default;
25
26
  cursor: pointer;
26
27
  display: flex;
27
28
  flex-direction: row;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.221.0",
3
+ "version": "1.223.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"