@phillips/seldon 1.273.0 → 1.275.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.
Files changed (35) hide show
  1. package/dist/_virtual/index10.cjs +1 -1
  2. package/dist/_virtual/index10.js +2 -2
  3. package/dist/_virtual/index9.cjs +1 -1
  4. package/dist/_virtual/index9.js +2 -2
  5. package/dist/components/Article/Article.cjs +1 -1
  6. package/dist/components/Article/Article.js +17 -16
  7. package/dist/components/Card/Card.cjs +1 -1
  8. package/dist/components/Card/Card.js +14 -11
  9. package/dist/components/ExitGateCard/ExitGateCard.cjs +1 -1
  10. package/dist/components/ExitGateCard/ExitGateCard.js +18 -17
  11. package/dist/components/SeldonImage/SeldonImage.cjs +1 -1
  12. package/dist/components/SeldonImage/SeldonImage.d.ts +1 -1
  13. package/dist/components/SeldonImage/SeldonImage.js +45 -44
  14. package/dist/components/SeldonImage/SeldonImage.stories.d.ts +73 -6
  15. package/dist/components/SeldonImage/index.d.ts +1 -0
  16. package/dist/components/SeldonImage/types.cjs +1 -0
  17. package/dist/components/SeldonImage/types.d.ts +6 -0
  18. package/dist/components/SeldonImage/types.js +4 -0
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +55 -53
  21. package/dist/node_modules/ics/dist/index.cjs +1 -1
  22. package/dist/node_modules/ics/dist/index.js +1 -1
  23. package/dist/node_modules/prop-types/node_modules/react-is/index.cjs +1 -1
  24. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  25. package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.cjs +1 -1
  26. package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.js +35 -34
  27. package/dist/patterns/ObjectTile/ObjectTile.cjs +1 -1
  28. package/dist/patterns/ObjectTile/ObjectTile.js +31 -30
  29. package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.cjs +1 -1
  30. package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.js +32 -31
  31. package/dist/scss/components/SeldonImage/_seldonImage.scss +21 -0
  32. package/dist/scss/site-furniture/Footer/_footer.scss +2 -11
  33. package/dist/static/test-image-1200x1600.jpg +0 -0
  34. package/dist/static/test-image-1600x1600.jpg +0 -0
  35. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
@@ -1,4 +1,4 @@
1
- var r = {};
1
+ var e = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ e as __module
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={};exports.__exports=e;
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- e as __module
3
+ r as __exports
4
4
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),j=require("react"),q=require("../../utils/index.cjs"),N=require("../../_virtual/index2.cjs"),h=require("../SeldonImage/SeldonImage.cjs"),n=require("../Text/Text.cjs"),u=require("../Text/types.cjs"),$=require("../Link/Link.cjs"),p=require("../Link/types.cjs"),o=j.forwardRef(({className:d,imageSrc:l,label:s,header:a,description:r,linkElement:m=$.default,linkLabel:i,linkHref:x,...c},_)=>{const{className:t,...f}=q.getCommonProps(c,"Article");return e.jsxs("article",{...f,className:N.default(t,d),...c,ref:_,children:[l?e.jsx(h.default,{aspectRatio:"16/9",src:l,alt:"bull"}):null,e.jsxs("div",{className:`${t}__content`,children:[s?e.jsx(n.default,{variant:u.TextVariants.labelSmall,className:`${t}__content-label`,children:s}):null,a?e.jsx(n.default,{variant:u.TextVariants.headingMedium,className:`${t}__content-title`,children:a}):null,r?e.jsx(n.default,{className:`${t}__content-description`,element:"p",children:r}):null,i?e.jsx(m,{href:x,variant:p.LinkVariants.linkMedium,className:`${t}__content-link`,children:i}):null]})]})});o.displayName="Article";exports.default=o;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),q=require("react"),j=require("../../utils/index.cjs"),p=require("../../_virtual/index2.cjs"),N=require("../SeldonImage/SeldonImage.cjs"),$=require("../SeldonImage/types.cjs"),s=require("../Text/Text.cjs"),u=require("../Text/types.cjs"),h=require("../Link/Link.cjs"),v=require("../Link/types.cjs"),o=q.forwardRef(({className:d,imageSrc:l,label:a,header:n,description:r,linkElement:m=h.default,linkLabel:i,linkHref:x,...c},_)=>{const{className:t,...f}=j.getCommonProps(c,"Article");return e.jsxs("article",{...f,className:p.default(t,d),...c,ref:_,children:[l?e.jsx(N.default,{aspectRatio:$.AspectRatio.Landscape,src:l,alt:n??""}):null,e.jsxs("div",{className:`${t}__content`,children:[a?e.jsx(s.default,{variant:u.TextVariants.labelSmall,className:`${t}__content-label`,children:a}):null,n?e.jsx(s.default,{variant:u.TextVariants.headingMedium,className:`${t}__content-title`,children:n}):null,r?e.jsx(s.default,{className:`${t}__content-description`,element:"p",children:r}):null,i?e.jsx(m,{href:x,variant:v.LinkVariants.linkMedium,className:`${t}__content-link`,children:i}):null]})]})});o.displayName="Article";exports.default=o;
@@ -1,27 +1,28 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
2
  import { forwardRef as N } from "react";
3
3
  import { getCommonProps as h } from "../../utils/index.js";
4
4
  import x from "../../_virtual/index2.js";
5
5
  import $ from "../SeldonImage/SeldonImage.js";
6
- import t from "../Text/Text.js";
6
+ import { AspectRatio as k } from "../SeldonImage/types.js";
7
+ import l from "../Text/Text.js";
7
8
  import { TextVariants as c } from "../Text/types.js";
8
- import k from "../Link/Link.js";
9
- import { LinkVariants as v } from "../Link/types.js";
10
- const A = N(
11
- ({ className: d, imageSrc: n, label: a, header: r, description: m, linkElement: f = k, linkLabel: i, linkHref: p, ...o }, u) => {
12
- const { className: e, ..._ } = h(o, "Article");
13
- return /* @__PURE__ */ s("article", { ..._, className: x(e, d), ...o, ref: u, children: [
14
- n ? /* @__PURE__ */ l($, { aspectRatio: "16/9", src: n, alt: "bull" }) : null,
15
- /* @__PURE__ */ s("div", { className: `${e}__content`, children: [
16
- a ? /* @__PURE__ */ l(t, { variant: c.labelSmall, className: `${e}__content-label`, children: a }) : null,
17
- r ? /* @__PURE__ */ l(t, { variant: c.headingMedium, className: `${e}__content-title`, children: r }) : null,
18
- m ? /* @__PURE__ */ l(t, { className: `${e}__content-description`, element: "p", children: m }) : null,
19
- i ? /* @__PURE__ */ l(f, { href: p, variant: v.linkMedium, className: `${e}__content-link`, children: i }) : null
9
+ import v from "../Link/Link.js";
10
+ import { LinkVariants as A } from "../Link/types.js";
11
+ const R = N(
12
+ ({ className: p, imageSrc: n, label: r, header: a, description: m, linkElement: f = v, linkLabel: o, linkHref: d, ...i }, _) => {
13
+ const { className: t, ...u } = h(i, "Article");
14
+ return /* @__PURE__ */ s("article", { ...u, className: x(t, p), ...i, ref: _, children: [
15
+ n ? /* @__PURE__ */ e($, { aspectRatio: k.Landscape, src: n, alt: a ?? "" }) : null,
16
+ /* @__PURE__ */ s("div", { className: `${t}__content`, children: [
17
+ r ? /* @__PURE__ */ e(l, { variant: c.labelSmall, className: `${t}__content-label`, children: r }) : null,
18
+ a ? /* @__PURE__ */ e(l, { variant: c.headingMedium, className: `${t}__content-title`, children: a }) : null,
19
+ m ? /* @__PURE__ */ e(l, { className: `${t}__content-description`, element: "p", children: m }) : null,
20
+ o ? /* @__PURE__ */ e(f, { href: d, variant: A.linkMedium, className: `${t}__content-link`, children: o }) : null
20
21
  ] })
21
22
  ] });
22
23
  }
23
24
  );
24
- A.displayName = "Article";
25
+ R.displayName = "Article";
25
26
  export {
26
- A as default
27
+ R as default
27
28
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),l=require("../../_virtual/index2.cjs"),s=require("react"),d=require("../../utils/index.cjs"),q=require("./types.cjs"),V=require("../Link/Link.cjs"),v=require("../Link/types.cjs"),i=require("../Text/Text.cjs"),n=require("../Text/types.cjs"),T=require("../Video/Video.cjs"),S=require("../SeldonImage/SeldonImage.cjs"),c=s.forwardRef(({element:e="div",className:t,id:a,variant:o=q.CardVariants.default,...m},$)=>{const{className:f,...j}=d.getCommonProps({id:a,...m},"Card"),b=l.default(f,t,{[`${f}--${o}`]:o});return r.jsx(e,{className:b,id:a,ref:$,...j,...m})}),u=s.forwardRef(({aspectRatio:e="16/9",...t},a)=>r.jsx(S.default,{...t,aspectRatio:e,className:`${d.px}-card__image`,ref:a})),C=s.forwardRef(({aspectRatio:e=16/9,className:t,...a},o)=>r.jsx(T.default,{...a,ref:o,aspectRatio:e,className:l.default(`${d.px}-card__video`,t)})),x=s.forwardRef(({className:e,...t},a)=>r.jsx("div",{...t,className:l.default(`${d.px}-card__details`,e),ref:a})),p=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__eyebrow`,e),ref:a,variant:n.TextVariants.labelSmall})),N=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__title`,e),ref:a,variant:n.TextVariants.headingSmall})),_=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__description`,e),ref:a,variant:n.TextVariants.bodySmall})),y=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__badge`,e),ref:a,variant:n.TextVariants.badgeSmall})),R=s.forwardRef(({className:e,...t},a)=>r.jsx("div",{...t,className:l.default(`${d.px}-card__meta`,e),ref:a})),g=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__meta-item`,e),ref:a,variant:n.TextVariants.labelSmall})),w=s.forwardRef(({className:e,variant:t=v.LinkVariants.linkSmall,...a},o)=>r.jsx(V.default,{...a,ref:o,className:l.default(`${d.px}-card__cta`,e),variant:t}));c.displayName="Card.Root";u.displayName="Card.Image";C.displayName="Card.Video";x.displayName="Card.Content";p.displayName="Card.Eyebrow";N.displayName="Card.Title";_.displayName="Card.Description";y.displayName="Card.Badge";R.displayName="Card.Meta";g.displayName="Card.MetaItem";w.displayName="Card.Cta";const M=Object.assign(c,{Root:c,Image:u,Video:C,Content:x,Eyebrow:p,Title:N,Description:_,Badge:y,Meta:R,MetaItem:g,Cta:w});exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),l=require("../../_virtual/index2.cjs"),s=require("react"),d=require("../../utils/index.cjs"),q=require("./types.cjs"),V=require("../Link/Link.cjs"),v=require("../Link/types.cjs"),i=require("../Text/Text.cjs"),n=require("../Text/types.cjs"),T=require("../Video/Video.cjs"),S=require("../SeldonImage/SeldonImage.cjs"),M=require("../SeldonImage/types.cjs"),c=s.forwardRef(({element:e="div",className:t,id:a,variant:o=q.CardVariants.default,...m},w)=>{const{className:f,...j}=d.getCommonProps({id:a,...m},"Card"),b=l.default(f,t,{[`${f}--${o}`]:o});return r.jsx(e,{className:b,id:a,ref:w,...j,...m})}),u=s.forwardRef(({aspectRatio:e=M.AspectRatio.Landscape,...t},a)=>r.jsx(S.default,{...t,aspectRatio:e,className:`${d.px}-card__image`,ref:a})),C=s.forwardRef(({aspectRatio:e=16/9,className:t,...a},o)=>r.jsx(T.default,{...a,ref:o,aspectRatio:e,className:l.default(`${d.px}-card__video`,t)})),p=s.forwardRef(({className:e,...t},a)=>r.jsx("div",{...t,className:l.default(`${d.px}-card__details`,e),ref:a})),x=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__eyebrow`,e),ref:a,variant:n.TextVariants.labelSmall})),N=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__title`,e),ref:a,variant:n.TextVariants.headingSmall})),_=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__description`,e),ref:a,variant:n.TextVariants.bodySmall})),y=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__badge`,e),ref:a,variant:n.TextVariants.badgeSmall})),R=s.forwardRef(({className:e,...t},a)=>r.jsx("div",{...t,className:l.default(`${d.px}-card__meta`,e),ref:a})),$=s.forwardRef(({className:e,...t},a)=>r.jsx(i.default,{...t,className:l.default(`${d.px}-card__meta-item`,e),ref:a,variant:n.TextVariants.labelSmall})),g=s.forwardRef(({className:e,variant:t=v.LinkVariants.linkSmall,...a},o)=>r.jsx(V.default,{...a,ref:o,className:l.default(`${d.px}-card__cta`,e),variant:t}));c.displayName="Card.Root";u.displayName="Card.Image";C.displayName="Card.Video";p.displayName="Card.Content";x.displayName="Card.Eyebrow";N.displayName="Card.Title";_.displayName="Card.Description";y.displayName="Card.Badge";R.displayName="Card.Meta";$.displayName="Card.MetaItem";g.displayName="Card.Cta";const I=Object.assign(c,{Root:c,Image:u,Video:C,Content:p,Eyebrow:x,Title:N,Description:_,Badge:y,Meta:R,MetaItem:$,Cta:g});exports.default=I;
@@ -3,12 +3,13 @@ import m from "../../_virtual/index2.js";
3
3
  import { forwardRef as s } from "react";
4
4
  import { getCommonProps as w, px as o } from "../../utils/index.js";
5
5
  import { CardVariants as x } from "./types.js";
6
- import T from "../Link/Link.js";
7
- import { LinkVariants as R } from "../Link/types.js";
6
+ import R from "../Link/Link.js";
7
+ import { LinkVariants as T } from "../Link/types.js";
8
8
  import i from "../Text/Text.js";
9
9
  import { TextVariants as l } from "../Text/types.js";
10
10
  import k from "../Video/Video.js";
11
11
  import u from "../SeldonImage/SeldonImage.js";
12
+ import { AspectRatio as B } from "../SeldonImage/types.js";
12
13
  const c = s(
13
14
  ({ element: e = "div", className: r, id: a, variant: d = x.default, ...n }, S) => {
14
15
  const { className: C, ...V } = w({ id: a, ...n }, "Card"), M = m(C, r, {
@@ -16,7 +17,9 @@ const c = s(
16
17
  });
17
18
  return /* @__PURE__ */ t(e, { className: M, id: a, ref: S, ...V, ...n });
18
19
  }
19
- ), p = s(({ aspectRatio: e = "16/9", ...r }, a) => /* @__PURE__ */ t(u, { ...r, aspectRatio: e, className: `${o}-card__image`, ref: a })), N = s(({ aspectRatio: e = 16 / 9, className: r, ...a }, d) => /* @__PURE__ */ t(k, { ...a, ref: d, aspectRatio: e, className: m(`${o}-card__video`, r) })), _ = s(({ className: e, ...r }, a) => /* @__PURE__ */ t("div", { ...r, className: m(`${o}-card__details`, e), ref: a })), y = s(({ className: e, ...r }, a) => /* @__PURE__ */ t(
20
+ ), p = s(
21
+ ({ aspectRatio: e = B.Landscape, ...r }, a) => /* @__PURE__ */ t(u, { ...r, aspectRatio: e, className: `${o}-card__image`, ref: a })
22
+ ), N = s(({ aspectRatio: e = 16 / 9, className: r, ...a }, d) => /* @__PURE__ */ t(k, { ...a, ref: d, aspectRatio: e, className: m(`${o}-card__video`, r) })), _ = s(({ className: e, ...r }, a) => /* @__PURE__ */ t("div", { ...r, className: m(`${o}-card__details`, e), ref: a })), f = s(({ className: e, ...r }, a) => /* @__PURE__ */ t(
20
23
  i,
21
24
  {
22
25
  ...r,
@@ -24,7 +27,7 @@ const c = s(
24
27
  ref: a,
25
28
  variant: l.labelSmall
26
29
  }
27
- )), f = s(({ className: e, ...r }, a) => /* @__PURE__ */ t(
30
+ )), y = s(({ className: e, ...r }, a) => /* @__PURE__ */ t(
28
31
  i,
29
32
  {
30
33
  ...r,
@@ -49,26 +52,26 @@ const c = s(
49
52
  variant: l.labelSmall
50
53
  }
51
54
  )), I = s(
52
- ({ className: e, variant: r = R.linkSmall, ...a }, d) => /* @__PURE__ */ t(T, { ...a, ref: d, className: m(`${o}-card__cta`, e), variant: r })
55
+ ({ className: e, variant: r = T.linkSmall, ...a }, d) => /* @__PURE__ */ t(R, { ...a, ref: d, className: m(`${o}-card__cta`, e), variant: r })
53
56
  );
54
57
  c.displayName = "Card.Root";
55
58
  p.displayName = "Card.Image";
56
59
  N.displayName = "Card.Video";
57
60
  _.displayName = "Card.Content";
58
- y.displayName = "Card.Eyebrow";
59
- f.displayName = "Card.Title";
61
+ f.displayName = "Card.Eyebrow";
62
+ y.displayName = "Card.Title";
60
63
  g.displayName = "Card.Description";
61
64
  $.displayName = "Card.Badge";
62
65
  b.displayName = "Card.Meta";
63
66
  v.displayName = "Card.MetaItem";
64
67
  I.displayName = "Card.Cta";
65
- const F = Object.assign(c, {
68
+ const H = Object.assign(c, {
66
69
  Root: c,
67
70
  Image: p,
68
71
  Video: N,
69
72
  Content: _,
70
- Eyebrow: y,
71
- Title: f,
73
+ Eyebrow: f,
74
+ Title: y,
72
75
  Description: g,
73
76
  Badge: $,
74
77
  Meta: b,
@@ -76,5 +79,5 @@ const F = Object.assign(c, {
76
79
  Cta: I
77
80
  });
78
81
  export {
79
- F as default
82
+ H as default
80
83
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),$=require("../../_virtual/index2.cjs"),v=require("react"),y=require("../../utils/index.cjs"),b=require("../Button/Button.cjs"),C=require("../Button/types.cjs"),E=require("../SeldonImage/SeldonImage.cjs"),a=require("../Text/Text.cjs"),d=require("../Text/types.cjs"),G=require("../Link/Link.cjs"),m=v.forwardRef(({className:x,imageSrc:s,label:n,header:r,description:l,linkLabel:i,linkHref:c,linkElement:o=G.default,variant:_=C.ButtonVariants.secondary,altText:f="Exit Gate Card Image",imageSrcSet:j,imageSizes:q,imageLoading:N,imageFetchPriority:h,...u},g)=>{const{className:t,...p}=y.getCommonProps(u,"ExitGateCard");return e.jsxs("article",{...p,className:$.default(t,x),...u,ref:g,children:[s?e.jsx(E.default,{objectFit:"cover",aspectRatio:"16/9",src:s,alt:f,srcSet:j,sizes:q,loading:N,fetchPriority:h,className:`${t}__desktop_image`}):null,e.jsxs("div",{className:`${t}__content`,children:[n?e.jsx(a.default,{variant:d.TextVariants.labelMedium,element:"span",className:`${t}__content-label`,children:n}):null,r?e.jsx(a.default,{variant:d.TextVariants.headingLarge,element:"span",className:`${t}__content-title`,children:r}):null,l?e.jsx(a.default,{element:"span",className:`${t}__content-description`,children:l}):null,(i||o)&&c?e.jsx(o,{href:c,children:e.jsx(b.default,{variant:_,tabIndex:-1,className:`${t}__content-link`,children:i})}):null]})]})});m.displayName="ExitGateCard";exports.default=m;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("../../_virtual/index2.cjs"),y=require("react"),v=require("../../utils/index.cjs"),b=require("../Button/Button.cjs"),C=require("../Button/types.cjs"),E=require("../SeldonImage/SeldonImage.cjs"),R=require("../SeldonImage/types.cjs"),a=require("../Text/Text.cjs"),d=require("../Text/types.cjs"),G=require("../Link/Link.cjs"),m=y.forwardRef(({className:x,imageSrc:s,label:n,header:r,description:l,linkLabel:i,linkHref:c,linkElement:o=G.default,variant:_=C.ButtonVariants.secondary,altText:f="Exit Gate Card Image",imageSrcSet:j,imageSizes:p,imageLoading:q,imageFetchPriority:N,...u},h)=>{const{className:t,...$}=v.getCommonProps(u,"ExitGateCard");return e.jsxs("article",{...$,className:g.default(t,x),...u,ref:h,children:[s?e.jsx(E.default,{objectFit:"cover",aspectRatio:R.AspectRatio.Landscape,src:s,alt:f,srcSet:j,sizes:p,loading:q,fetchPriority:N,className:`${t}__desktop_image`}):null,e.jsxs("div",{className:`${t}__content`,children:[n?e.jsx(a.default,{variant:d.TextVariants.labelMedium,element:"span",className:`${t}__content-label`,children:n}):null,r?e.jsx(a.default,{variant:d.TextVariants.headingLarge,element:"span",className:`${t}__content-title`,children:r}):null,l?e.jsx(a.default,{element:"span",className:`${t}__content-description`,children:l}):null,(i||o)&&c?e.jsx(o,{href:c,children:e.jsx(b.default,{variant:_,tabIndex:-1,className:`${t}__content-link`,children:i})}):null]})]})});m.displayName="ExitGateCard";exports.default=m;
@@ -1,14 +1,15 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
2
  import E from "../../_virtual/index2.js";
3
3
  import { forwardRef as v } from "react";
4
4
  import { getCommonProps as G } from "../../utils/index.js";
5
5
  import b from "../Button/Button.js";
6
6
  import { ButtonVariants as j } from "../Button/types.js";
7
7
  import y from "../SeldonImage/SeldonImage.js";
8
+ import { AspectRatio as I } from "../SeldonImage/types.js";
8
9
  import a from "../Text/Text.js";
9
10
  import { TextVariants as p } from "../Text/types.js";
10
- import I from "../Link/Link.js";
11
- const P = v(
11
+ import P from "../Link/Link.js";
12
+ const R = v(
12
13
  ({
13
14
  className: f,
14
15
  imageSrc: r,
@@ -16,8 +17,8 @@ const P = v(
16
17
  header: o,
17
18
  description: s,
18
19
  linkLabel: m,
19
- linkHref: l,
20
- linkElement: i = I,
20
+ linkHref: i,
21
+ linkElement: l = P,
21
22
  variant: _ = j.secondary,
22
23
  altText: u = "Exit Gate Card Image",
23
24
  imageSrcSet: x,
@@ -26,32 +27,32 @@ const P = v(
26
27
  imageFetchPriority: g,
27
28
  ...c
28
29
  }, $) => {
29
- const { className: e, ...C } = G(c, "ExitGateCard");
30
- return /* @__PURE__ */ d("article", { ...C, className: E(e, f), ...c, ref: $, children: [
31
- r ? /* @__PURE__ */ t(
30
+ const { className: t, ...C } = G(c, "ExitGateCard");
31
+ return /* @__PURE__ */ d("article", { ...C, className: E(t, f), ...c, ref: $, children: [
32
+ r ? /* @__PURE__ */ e(
32
33
  y,
33
34
  {
34
35
  objectFit: "cover",
35
- aspectRatio: "16/9",
36
+ aspectRatio: I.Landscape,
36
37
  src: r,
37
38
  alt: u,
38
39
  srcSet: x,
39
40
  sizes: N,
40
41
  loading: h,
41
42
  fetchPriority: g,
42
- className: `${e}__desktop_image`
43
+ className: `${t}__desktop_image`
43
44
  }
44
45
  ) : null,
45
- /* @__PURE__ */ d("div", { className: `${e}__content`, children: [
46
- n ? /* @__PURE__ */ t(a, { variant: p.labelMedium, element: "span", className: `${e}__content-label`, children: n }) : null,
47
- o ? /* @__PURE__ */ t(a, { variant: p.headingLarge, element: "span", className: `${e}__content-title`, children: o }) : null,
48
- s ? /* @__PURE__ */ t(a, { element: "span", className: `${e}__content-description`, children: s }) : null,
49
- (m || i) && l ? /* @__PURE__ */ t(i, { href: l, children: /* @__PURE__ */ t(b, { variant: _, tabIndex: -1, className: `${e}__content-link`, children: m }) }) : null
46
+ /* @__PURE__ */ d("div", { className: `${t}__content`, children: [
47
+ n ? /* @__PURE__ */ e(a, { variant: p.labelMedium, element: "span", className: `${t}__content-label`, children: n }) : null,
48
+ o ? /* @__PURE__ */ e(a, { variant: p.headingLarge, element: "span", className: `${t}__content-title`, children: o }) : null,
49
+ s ? /* @__PURE__ */ e(a, { element: "span", className: `${t}__content-description`, children: s }) : null,
50
+ (m || l) && i ? /* @__PURE__ */ e(l, { href: i, children: /* @__PURE__ */ e(b, { variant: _, tabIndex: -1, className: `${t}__content-link`, children: m }) }) : null
50
51
  ] })
51
52
  ] });
52
53
  }
53
54
  );
54
- P.displayName = "ExitGateCard";
55
+ R.displayName = "ExitGateCard";
55
56
  export {
56
- P as default
57
+ R as default
57
58
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),o=require("react"),u=require("../../_virtual/index2.cjs"),w=require("../../utils/index.cjs"),P=require("./utils.cjs"),x=require("../Icon/Icon.cjs"),R=typeof window>"u",h=o.memo(o.forwardRef(({className:j,aspectRatio:c="none",objectFit:g="none",hasBlurBackground:y=!1,imageClassName:p,imageStyle:N,src:a,alt:f,srcSet:n,sizes:i,loading:q,fetchPriority:E,errorText:L="Error loading image",imageBlocked:l=!1,...$},S)=>{const{className:e,...b}=w.getCommonProps($,"SeldonImage"),I=o.useRef(null),[t,d]=o.useState(()=>{if(R)return"loading";const s=document.getElementById(a);if(s instanceof HTMLImageElement&&!s.classList.contains(`${e}-img--hidden`))return"loaded";const m=document.createElement("img");return n&&(m.srcset=n),i&&(m.sizes=i),m.src=a,m.complete?"loaded":"loading"}),v=o.useCallback(async()=>{const s=await P.isImageValid({img:I.current,src:a,srcSet:n,sizes:i});d(s?"loaded":"error")},[a,n,i]);return o.useEffect(()=>{v()},[v]),r.jsxs("div",{"data-chromatic":"ignore",ref:S,className:u.default(e,j,{[`${e}--aspect-ratio-${c.replace("/","-")}`]:c!=="none",[`${e}--error-image`]:t==="error"||l}),role:"img","aria-label":f,...$,...b,children:[y&&r.jsx("div",{className:u.default(`${e}-blur`,{[`${e}-blur--hidden`]:t==="loading"||t==="error"||l}),style:{backgroundImage:`url(${a})`}}),t==="error"||l?r.jsx("div",{className:`${e}--error`,children:l?r.jsx(x.default,{icon:"ImageUnavailable","aria-label":"Image Unavailable",role:"img"}):r.jsx(x.default,{icon:"PhillipsLogo","aria-label":L,role:"img",color:"$black-25"})}):null,r.jsx("img",{className:u.default(`${e}-img`,p,{[`${e}-img--hidden`]:t==="error"||l,[`${e}-img--object-fit-${g}`]:g!=="none"}),id:a,style:N,src:a,srcSet:n,sizes:i,alt:f,"data-testid":`${b["data-testid"]}-img`,ref:I,loading:q,fetchpriority:E,onLoad:()=>{d("loaded")},onError:()=>{d("error")}})]})}));h.displayName="SeldonImage";exports.default=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),r=require("react"),u=require("../../_virtual/index2.cjs"),w=require("../../utils/index.cjs"),P=require("./utils.cjs"),v=require("./types.cjs"),x=require("../Icon/Icon.cjs"),C=typeof window>"u",y=r.memo(r.forwardRef(({className:N,aspectRatio:c=v.AspectRatio.None,objectFit:g="none",hasBlurBackground:h=!1,imageClassName:j,imageStyle:q,src:a,alt:f,srcSet:i,sizes:n,loading:E,fetchPriority:R,errorText:L="Error loading image",imageBlocked:t=!1,...$},S)=>{const{className:e,...b}=w.getCommonProps($,"SeldonImage"),I=r.useRef(null),[l,s]=r.useState(()=>{if(C)return"loading";const d=document.getElementById(a);if(d instanceof HTMLImageElement&&!d.classList.contains(`${e}-img--hidden`))return"loaded";const m=document.createElement("img");return i&&(m.srcset=i),n&&(m.sizes=n),m.src=a,m.complete?"loaded":"loading"}),p=r.useCallback(async()=>{const d=await P.isImageValid({img:I.current,src:a,srcSet:i,sizes:n});s(d?"loaded":"error")},[a,i,n]);return r.useEffect(()=>{p()},[p]),o.jsxs("div",{"data-chromatic":"ignore",ref:S,className:u.default(e,N,{[`${e}--aspect-ratio-${c.replace("/","-")}`]:c!==v.AspectRatio.None,[`${e}--error-image`]:l==="error"||t}),role:"img","aria-label":f,...$,...b,children:[h&&o.jsx("div",{className:u.default(`${e}-blur`,{[`${e}-blur--hidden`]:l==="loading"||l==="error"||t}),style:{backgroundImage:`url(${a})`}}),l==="error"||t?o.jsx("div",{className:`${e}--error`,children:t?o.jsx(x.default,{icon:"ImageUnavailable","aria-label":"Image Unavailable",role:"img"}):o.jsx(x.default,{icon:"PhillipsLogo","aria-label":L,role:"img",color:"$black-25"})}):null,o.jsx("img",{className:u.default(`${e}-img`,j,{[`${e}-img--hidden`]:l==="error"||t,[`${e}-img--object-fit-${g}`]:g!=="none"}),id:a,style:q,src:a,srcSet:i,sizes:n,alt:f,"data-testid":`${b["data-testid"]}-img`,ref:I,loading:E,fetchpriority:R,onLoad:()=>{s("loaded")},onError:()=>{s("error")}})]})}));y.displayName="SeldonImage";exports.default=y;
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps } from 'react';
2
- type AspectRatio = '16/9' | '1/1' | 'none';
2
+ import { AspectRatio } from './types';
3
3
  export interface SeldonImageProps extends ComponentProps<'div'> {
4
4
  /**
5
5
  * The aspect ratio of the image container.
@@ -1,93 +1,94 @@
1
- import { jsxs as C, jsx as l } from "react/jsx-runtime";
2
- import { memo as P, forwardRef as S, useRef as j, useState as R, useCallback as U, useEffect as V } from "react";
1
+ import { jsxs as P, jsx as l } from "react/jsx-runtime";
2
+ import { memo as R, forwardRef as S, useRef as j, useState as U, useCallback as V, useEffect as A } from "react";
3
3
  import s from "../../_virtual/index2.js";
4
4
  import { getCommonProps as H } from "../../utils/index.js";
5
5
  import { isImageValid as M } from "./utils.js";
6
- import I from "../Icon/Icon.js";
7
- const T = typeof window > "u", q = P(
6
+ import { AspectRatio as I } from "./types.js";
7
+ import N from "../Icon/Icon.js";
8
+ const T = typeof window > "u", q = R(
8
9
  S(
9
10
  ({
10
11
  className: h,
11
- aspectRatio: g = "none",
12
+ aspectRatio: g = I.None,
12
13
  objectFit: c = "none",
13
14
  hasBlurBackground: v = !1,
14
15
  imageClassName: y,
15
- imageStyle: N,
16
- src: a,
16
+ imageStyle: E,
17
+ src: o,
17
18
  alt: f,
18
- srcSet: o,
19
+ srcSet: a,
19
20
  sizes: r,
20
- loading: E,
21
- fetchPriority: L,
22
- errorText: w = "Error loading image",
23
- imageBlocked: n = !1,
21
+ loading: L,
22
+ fetchPriority: w,
23
+ errorText: x = "Error loading image",
24
+ imageBlocked: i = !1,
24
25
  ...u
25
- }, x) => {
26
- const { className: e, ...$ } = H(u, "SeldonImage"), p = j(null), [i, m] = R(() => {
26
+ }, C) => {
27
+ const { className: e, ...p } = H(u, "SeldonImage"), $ = j(null), [n, t] = U(() => {
27
28
  if (T)
28
29
  return "loading";
29
- const t = document.getElementById(a);
30
- if (t instanceof HTMLImageElement && !t.classList.contains(`${e}-img--hidden`))
30
+ const m = document.getElementById(o);
31
+ if (m instanceof HTMLImageElement && !m.classList.contains(`${e}-img--hidden`))
31
32
  return "loaded";
32
33
  const d = document.createElement("img");
33
- return o && (d.srcset = o), r && (d.sizes = r), d.src = a, d.complete ? "loaded" : "loading";
34
- }), b = U(async () => {
35
- const t = await M({
36
- img: p.current,
37
- src: a,
38
- srcSet: o,
34
+ return a && (d.srcset = a), r && (d.sizes = r), d.src = o, d.complete ? "loaded" : "loading";
35
+ }), b = V(async () => {
36
+ const m = await M({
37
+ img: $.current,
38
+ src: o,
39
+ srcSet: a,
39
40
  sizes: r
40
41
  });
41
- m(t ? "loaded" : "error");
42
- }, [a, o, r]);
43
- return V(() => {
42
+ t(m ? "loaded" : "error");
43
+ }, [o, a, r]);
44
+ return A(() => {
44
45
  b();
45
- }, [b]), /* @__PURE__ */ C(
46
+ }, [b]), /* @__PURE__ */ P(
46
47
  "div",
47
48
  {
48
49
  "data-chromatic": "ignore",
49
- ref: x,
50
+ ref: C,
50
51
  className: s(e, h, {
51
- [`${e}--aspect-ratio-${g.replace("/", "-")}`]: g !== "none",
52
- [`${e}--error-image`]: i === "error" || n
52
+ [`${e}--aspect-ratio-${g.replace("/", "-")}`]: g !== I.None,
53
+ [`${e}--error-image`]: n === "error" || i
53
54
  }),
54
55
  role: "img",
55
56
  "aria-label": f,
56
57
  ...u,
57
- ...$,
58
+ ...p,
58
59
  children: [
59
60
  v && /* @__PURE__ */ l(
60
61
  "div",
61
62
  {
62
63
  className: s(`${e}-blur`, {
63
- [`${e}-blur--hidden`]: i === "loading" || i === "error" || n
64
+ [`${e}-blur--hidden`]: n === "loading" || n === "error" || i
64
65
  }),
65
- style: { backgroundImage: `url(${a})` }
66
+ style: { backgroundImage: `url(${o})` }
66
67
  }
67
68
  ),
68
- i === "error" || n ? /* @__PURE__ */ l("div", { className: `${e}--error`, children: n ? /* @__PURE__ */ l(I, { icon: "ImageUnavailable", "aria-label": "Image Unavailable", role: "img" }) : /* @__PURE__ */ l(I, { icon: "PhillipsLogo", "aria-label": w, role: "img", color: "$black-25" }) }) : null,
69
+ n === "error" || i ? /* @__PURE__ */ l("div", { className: `${e}--error`, children: i ? /* @__PURE__ */ l(N, { icon: "ImageUnavailable", "aria-label": "Image Unavailable", role: "img" }) : /* @__PURE__ */ l(N, { icon: "PhillipsLogo", "aria-label": x, role: "img", color: "$black-25" }) }) : null,
69
70
  /* @__PURE__ */ l(
70
71
  "img",
71
72
  {
72
73
  className: s(`${e}-img`, y, {
73
- [`${e}-img--hidden`]: i === "error" || n,
74
+ [`${e}-img--hidden`]: n === "error" || i,
74
75
  [`${e}-img--object-fit-${c}`]: c !== "none"
75
76
  }),
76
- id: a,
77
- style: N,
78
- src: a,
79
- srcSet: o,
77
+ id: o,
78
+ style: E,
79
+ src: o,
80
+ srcSet: a,
80
81
  sizes: r,
81
82
  alt: f,
82
- "data-testid": `${$["data-testid"]}-img`,
83
- ref: p,
84
- loading: E,
85
- fetchpriority: L,
83
+ "data-testid": `${p["data-testid"]}-img`,
84
+ ref: $,
85
+ loading: L,
86
+ fetchpriority: w,
86
87
  onLoad: () => {
87
- m("loaded");
88
+ t("loaded");
88
89
  },
89
90
  onError: () => {
90
- m("error");
91
+ t("error");
91
92
  }
92
93
  }
93
94
  )
@@ -1,7 +1,15 @@
1
+ import { Decorator } from '@storybook/react-vite';
1
2
  import { default as SeldonImage } from './SeldonImage';
3
+ import { AspectRatio } from './types';
2
4
  declare const meta: {
3
5
  title: string;
4
6
  component: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<Omit<import('./SeldonImage').SeldonImageProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>>;
7
+ argTypes: {
8
+ aspectRatio: {
9
+ control: "select";
10
+ options: AspectRatio[];
11
+ };
12
+ };
5
13
  };
6
14
  export default meta;
7
15
  export declare const Playground: {
@@ -9,16 +17,75 @@ export declare const Playground: {
9
17
  args: {
10
18
  src: string;
11
19
  alt: string;
12
- aspectRatio: string;
20
+ aspectRatio: AspectRatio;
13
21
  };
14
- argTypes: {};
22
+ decorators: Decorator[];
23
+ };
24
+ export declare const AspectRatioLandscape: {
25
+ (props: React.ComponentProps<typeof SeldonImage>): import("react/jsx-runtime").JSX.Element;
26
+ args: {
27
+ src: string;
28
+ alt: string;
29
+ aspectRatio: AspectRatio;
30
+ objectFit: string;
31
+ };
32
+ decorators: Decorator[];
33
+ };
34
+ export declare const AspectRatioPortrait: {
35
+ (props: React.ComponentProps<typeof SeldonImage>): import("react/jsx-runtime").JSX.Element;
36
+ args: {
37
+ src: string;
38
+ alt: string;
39
+ aspectRatio: AspectRatio;
40
+ objectFit: string;
41
+ };
42
+ decorators: Decorator[];
43
+ };
44
+ export declare const AspectRatioSquare: {
45
+ (props: React.ComponentProps<typeof SeldonImage>): import("react/jsx-runtime").JSX.Element;
46
+ args: {
47
+ src: string;
48
+ alt: string;
49
+ aspectRatio: AspectRatio;
50
+ objectFit: string;
51
+ };
52
+ decorators: Decorator[];
53
+ };
54
+ export declare const AspectRatioPortraitHeightConstrained: {
55
+ (props: React.ComponentProps<typeof SeldonImage>): import("react/jsx-runtime").JSX.Element;
56
+ args: {
57
+ src: string;
58
+ alt: string;
59
+ aspectRatio: AspectRatio;
60
+ objectFit: string;
61
+ };
62
+ decorators: Decorator[];
63
+ };
64
+ export declare const AspectRatioSquareHeightConstrained: {
65
+ (props: React.ComponentProps<typeof SeldonImage>): import("react/jsx-runtime").JSX.Element;
66
+ args: {
67
+ src: string;
68
+ alt: string;
69
+ aspectRatio: AspectRatio;
70
+ objectFit: string;
71
+ };
72
+ decorators: Decorator[];
73
+ };
74
+ export declare const AspectRatioNone: {
75
+ (props: React.ComponentProps<typeof SeldonImage>): import("react/jsx-runtime").JSX.Element;
76
+ args: {
77
+ src: string;
78
+ alt: string;
79
+ aspectRatio: AspectRatio;
80
+ };
81
+ decorators: Decorator[];
15
82
  };
16
83
  export declare const CircleImage: {
17
84
  (props: React.ComponentProps<typeof SeldonImage>): import("react/jsx-runtime").JSX.Element;
18
85
  args: {
19
86
  src: string;
20
87
  alt: string;
21
- aspectRatio: string;
88
+ aspectRatio: AspectRatio;
22
89
  objectFit: string;
23
90
  imageStyle: {
24
91
  borderRadius: string;
@@ -31,7 +98,7 @@ export declare const BlurBackground: {
31
98
  args: {
32
99
  src: string;
33
100
  alt: string;
34
- aspectRatio: string;
101
+ aspectRatio: AspectRatio;
35
102
  objectFit: string;
36
103
  hasBlurBackground: boolean;
37
104
  };
@@ -42,7 +109,7 @@ export declare const BrokenImage: {
42
109
  args: {
43
110
  src: string;
44
111
  alt: string;
45
- aspectRatio: string;
112
+ aspectRatio: AspectRatio;
46
113
  objectFit: string;
47
114
  };
48
115
  argTypes: {};
@@ -52,7 +119,7 @@ export declare const ImageBlocked: {
52
119
  args: {
53
120
  src: string;
54
121
  alt: string;
55
- aspectRatio: string;
122
+ aspectRatio: AspectRatio;
56
123
  objectFit: string;
57
124
  imageBlocked: boolean;
58
125
  };
@@ -1 +1,2 @@
1
1
  export { default as SeldonImage, type SeldonImageProps } from './SeldonImage';
2
+ export { AspectRatio } from './types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var r=(e=>(e.Landscape="16/9",e.Portrait="3/4",e.Square="1/1",e.None="none",e))(r||{});exports.AspectRatio=r;
@@ -0,0 +1,6 @@
1
+ export declare enum AspectRatio {
2
+ Landscape = "16/9",
3
+ Portrait = "3/4",
4
+ Square = "1/1",
5
+ None = "none"
6
+ }
@@ -0,0 +1,4 @@
1
+ var n = /* @__PURE__ */ ((r) => (r.Landscape = "16/9", r.Portrait = "3/4", r.Square = "1/1", r.None = "none", r))(n || {});
2
+ export {
3
+ n as AspectRatio
4
+ };