@sps-woodland/photo 8.7.4 → 8.7.6

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.
package/lib/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("react"),d=require("@sps-woodland/core"),v=require("@sps-woodland/tokens"),I=require("@spscommerce/ds-react"),g=require("@spscommerce/ds-shared"),h=require("@spscommerce/utils");function T(e){if(e&&e.__esModule)return e;const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(a,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return a.default=e,Object.freeze(a)}const t=T(M);function W(e,a,o){return a in e?Object.defineProperty(e,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[a]=o,e}function E(e,a){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,r)}return o}function y(e){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?E(Object(o),!0).forEach(function(r){W(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):E(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}var z=(e,a,o)=>{for(var r of Object.keys(e)){var n;if(e[r]!==((n=a[r])!==null&&n!==void 0?n:o[r]))return!1}return!0},C=e=>a=>{var o=e.defaultClassName,r=y(y({},e.defaultVariants),a);for(var n in r){var c,p=(c=r[n])!==null&&c!==void 0?c:e.defaultVariants[n];if(p!=null){var s=p;typeof s=="boolean"&&(s=s===!0?"true":"false");var i=e.variantClassNames[n][s];i&&(o+=" "+i)}}for(var[l,u]of e.compoundVariants)z(l,r,e.defaultVariants)&&(o+=" "+u);return o},L=C({defaultClassName:"dons243",variantClassNames:{mode:{fill:"dons244",fit:"dons245"}},defaultVariants:{mode:"fill"},compoundVariants:[]}),q="dons246",D=C({defaultClassName:"dons240",variantClassNames:{placeholder:{true:"dons241",false:"dons242"}},defaultVariants:{placeholder:!1},compoundVariants:[]});function P({className:e,src:a,altText:o,mode:r="fill",placeholderIcon:n="photo",...c}){const p=t.useRef(null),s=t.useRef(null),i=t.useRef(null),l=t.useRef(null),[u,R]=t.useState(),[x,_]=t.useState(!1);t.useEffect(()=>{s.current&&(i.current&&(window.clearInterval(i.current),i.current=null),i.current=window.setInterval(()=>{if(s.current){const m=s.current.getBoundingClientRect();if(m.height){i.current&&(window.clearInterval(i.current),i.current=null);let f=!0;f=m.width/m.height>1,_(f===(r==="fit"))}}},1e3/60))},[p.current,s.current,a]),t.useEffect(()=>{l.current&&(window.clearInterval(l.current),l.current=null),l.current=window.setInterval(()=>{if(p.current){const m=p.current.getBoundingClientRect();m.width&&(F(m.width),l.current&&(window.clearInterval(l.current),l.current=null))}},1e3/60)},[p.current]);function F(m){var f,w,b;if(m){const N=((b=(w=(f=document==null?void 0:document.body)==null?void 0:f.parentElement)==null?void 0:w.style)==null?void 0:b.fontSize)||"16px",B=Number(N.substring(0,N.length-2));R(m/B)}}function V(){if(typeof u<"u")return u*.05}function A(){if(typeof u<"u")return .75*u}return t.createElement("div",{ref:p,className:d.cl(D({placeholder:!a}),e),style:{width:`${u}`&&`${u}rem`,fontSize:`${V()}rem`,height:`${A()}rem`},...c},a?u?t.createElement("img",{className:L({mode:x?"fit":"fill"}),ref:s,src:a,alt:o}):t.createElement("span",null):t.createElement(d.Icon,{className:q,icon:n}))}d.Metadata.set(P,{name:"Photo",props:{src:"string",altText:"string",mode:{type:'"fill" | "fit"',default:'"fill"'},placeholderIcon:"IconName"}});var O="i6pp7s1",S="i6pp7s0",k="i6pp7s3",G="i6pp7s2",K=C({defaultClassName:"i6pp7s4",variantClassNames:{selected:{true:"i6pp7s5",false:"i6pp7s6"}},defaultVariants:{selected:!1},compoundVariants:[]});function j({children:e,className:a,...o}){const[r]=d.selectChildren(e,[{type:P}]),[n,c]=t.useState(0);function p(){n+1===r.length?c(0):c(n+1)}function s(){c(n===0?r.length-1:n-1)}return t.createElement("div",{className:v.grid.root,...o},t.createElement("div",{className:d.cl(S)},t.createElement("div",{className:d.cl(O)},t.createElement(I.SpsButton,{tabIndex:0,kind:g.ButtonKind.ICON,icon:g.SpsIcon.ARROW_LEFT_CIRCLE,onClick:s}))),t.createElement("div",{className:v.grid[10]},t.createElement("div",{className:d.cl(k,v.grid[12])},r[n]),t.createElement("div",{className:d.cl(G,v.grid[12])},r.map((i,l)=>t.createElement("button",{tabIndex:0,className:d.cl(K({selected:l===n})),onClick:()=>c(l)},i)))),t.createElement("div",{className:d.cl(S)},t.createElement("div",{className:d.cl(O)},t.createElement(I.SpsButton,{tabIndex:0,kind:g.ButtonKind.ICON,icon:g.SpsIcon.ARROW_RIGHT_CIRCLE,onClick:p}))))}const H={components:[P,j],examples:{sizing:{label:"Sizing",description:"Photos are block elements, so a photo fills its container's width unless an explicit width is set. It is always a 4:3 aspect ratio. In this example, photos have been placed in cards which have different widths in the 12 column grid.",examples:{basic:{react:h.code`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),d=require("@sps-woodland/core"),v=require("@sps-woodland/tokens"),I=require("@spscommerce/ds-react"),g=require("@spscommerce/ds-shared"),f=require("@spscommerce/utils");function z(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(a,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return a.default=e,Object.freeze(a)}const t=z(W);function D(e,a,o){return a in e?Object.defineProperty(e,a,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[a]=o,e}function E(e,a){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),o.push.apply(o,r)}return o}function y(e){for(var a=1;a<arguments.length;a++){var o=arguments[a]!=null?arguments[a]:{};a%2?E(Object(o),!0).forEach(function(r){D(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):E(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}var L=(e,a,o)=>{for(var r of Object.keys(e)){var n;if(e[r]!==((n=a[r])!==null&&n!==void 0?n:o[r]))return!1}return!0},C=e=>a=>{var o=e.defaultClassName,r=y(y({},e.defaultVariants),a);for(var n in r){var c,p=(c=r[n])!==null&&c!==void 0?c:e.defaultVariants[n];if(p!=null){var i=p;typeof i=="boolean"&&(i=i===!0?"true":"false");var s=e.variantClassNames[n][i];s&&(o+=" "+s)}}for(var[l,u]of e.compoundVariants)L(l,r,e.defaultVariants)&&(o+=" "+u);return o},M=C({defaultClassName:"dons243",variantClassNames:{mode:{fill:"dons244",fit:"dons245"}},defaultVariants:{mode:"fill"},compoundVariants:[]}),q="dons246",_=C({defaultClassName:"dons240",variantClassNames:{placeholder:{true:"dons241",false:"dons242"}},defaultVariants:{placeholder:!1},compoundVariants:[]});function P({className:e,src:a,altText:o,mode:r="fill",placeholderIcon:n="photo",...c}){const p=t.useRef(null),i=t.useRef(null),s=t.useRef(null),l=t.useRef(null),[u,R]=t.useState(),[x,F]=t.useState(!1);t.useEffect(()=>{i.current&&(s.current&&(window.clearInterval(s.current),s.current=null),s.current=window.setInterval(()=>{if(i.current){const m=i.current.getBoundingClientRect();if(m.height){s.current&&(window.clearInterval(s.current),s.current=null);let h=!0;h=m.width/m.height>1,F(h===(r==="fit"))}}},1e3/60))},[p.current,i.current,a]),t.useEffect(()=>{l.current&&(window.clearInterval(l.current),l.current=null),l.current=window.setInterval(()=>{if(p.current){const m=p.current.getBoundingClientRect();m.width&&(V(m.width),l.current&&(window.clearInterval(l.current),l.current=null))}},1e3/60)},[p.current]);function V(m){var h,w,b;if(m){const N=((b=(w=(h=document==null?void 0:document.body)==null?void 0:h.parentElement)==null?void 0:w.style)==null?void 0:b.fontSize)||"16px",T=Number(N.substring(0,N.length-2));R(m/T)}}function A(){if(typeof u<"u")return u*.05}function B(){if(typeof u<"u")return .75*u}return t.createElement("div",{ref:p,className:d.cl(_({placeholder:!a}),e),style:{width:`${u}`&&`${u}rem`,fontSize:`${A()}rem`,height:`${B()}rem`},...c},a?u?t.createElement("img",{className:M({mode:x?"fit":"fill"}),ref:i,src:a,alt:o}):t.createElement("span",null):t.createElement(d.Icon,{className:q,icon:n}))}d.Metadata.set(P,{name:"Photo",props:{src:"string",altText:"string",mode:{type:'"fill" | "fit"',default:'"fill"'},placeholderIcon:"IconName"}});var O="i6pp7s1",S="i6pp7s0",k="i6pp7s3",G="i6pp7s2",K=C({defaultClassName:"i6pp7s4",variantClassNames:{selected:{true:"i6pp7s5",false:"i6pp7s6"}},defaultVariants:{selected:!1},compoundVariants:[]});function j({children:e,className:a,...o}){const[r]=d.selectChildren(e,[{type:P}]),[n,c]=t.useState(0);function p(){n+1===r.length?c(0):c(n+1)}function i(){c(n===0?r.length-1:n-1)}return t.createElement("div",{className:v.grid.root,...o},t.createElement("div",{className:d.cl(S)},t.createElement("div",{className:d.cl(O)},t.createElement(I.SpsButton,{tabIndex:0,kind:g.ButtonKind.ICON,icon:g.SpsIcon.ARROW_LEFT_CIRCLE,onClick:i}))),t.createElement("div",{className:v.grid[10]},t.createElement("div",{className:d.cl(k,v.grid[12])},r[n]),t.createElement("div",{className:d.cl(G,v.grid[12])},r.map((s,l)=>t.createElement("button",{tabIndex:0,className:d.cl(K({selected:l===n})),onClick:()=>c(l)},s)))),t.createElement("div",{className:d.cl(S)},t.createElement("div",{className:d.cl(O)},t.createElement(I.SpsButton,{tabIndex:0,kind:g.ButtonKind.ICON,icon:g.SpsIcon.ARROW_RIGHT_CIRCLE,onClick:p}))))}const H={components:[P,j],examples:{sizing:{label:"Sizing",description:"Photos are block elements, so a photo fills its container's width unless an explicit width is set. It is always a 4:3 aspect ratio. In this example, photos have been placed in cards which have different widths in the 12 column grid.",examples:{basic:{react:f.code`
2
2
  import { Photo } from "@sps-woodland/photo";
3
3
  import { Card } from "@sps-woodland/cards";
4
4
 
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
  )
25
25
  }
26
- `}}},displayMode:{label:"Fill vs. Fit",description:()=>t.createElement("p",null,"There are two display modes available:",t.createElement("ul",null,t.createElement("li",null,t.createElement("b",null,'"fill"')," fills the entire 4:3 container, cropping off any excess portions of the image."),t.createElement("li",null,t.createElement("b",null,'"fit"')," fits the entire image into the container, leaving any excess portions of the container blank."))),examples:{landscape:{description:"Landscape oriented photo",react:h.code`
26
+ `}}},displayMode:{label:"Fill vs. Fit",description:()=>t.createElement("p",null,"There are two display modes available:",t.createElement("ul",null,t.createElement("li",null,t.createElement("b",null,'"fill"')," fills the entire 4:3 container, cropping off any excess portions of the image."),t.createElement("li",null,t.createElement("b",null,'"fit"')," fits the entire image into the container, leaving any excess portions of the container blank."))),examples:{landscape:{description:"Landscape oriented photo",react:f.code`
27
27
  import { Photo } from "@sps-woodland/photo";
28
28
  import { Card } from "@sps-woodland/cards";
29
29
 
@@ -43,7 +43,7 @@
43
43
  </div>
44
44
  )
45
45
  }
46
- `},portrait:{description:"Portrait oriented photo ",react:h.code`
46
+ `},portrait:{description:"Portrait oriented photo ",react:f.code`
47
47
  import { Photo } from "@sps-woodland/photo";
48
48
  import { Card } from "@sps-woodland/cards";
49
49
 
@@ -63,7 +63,7 @@
63
63
  </div>
64
64
  )
65
65
  }
66
- `}}},placeholder:{label:"Placeholders",description:"When an image is not provided for a particular use case (such as a user avatar, a company photo, item image, etc.), a placeholder should be shown in its place. The placeholder's icon, selected from our SPS icon set, should represent the type of image it is substituting for.",examples:{general:{description:"General Photo",react:h.code`
66
+ `}}},placeholder:{label:"Placeholders",description:"When an image is not provided for a particular use case (such as a user avatar, a company photo, item image, etc.), a placeholder should be shown in its place. The placeholder's icon, selected from our SPS icon set, should represent the type of image it is substituting for.",examples:{general:{description:"General Photo",react:f.code`
67
67
  import { Photo } from "@sps-woodland/photo";
68
68
 
69
69
  function Component () {
@@ -75,7 +75,7 @@
75
75
  </div>
76
76
  )
77
77
  }
78
- `},photoAlt:{description:"Photo Alt",react:h.code`
78
+ `},photoAlt:{description:"Photo Alt",react:f.code`
79
79
  import { Photo } from "@sps-woodland/photo";
80
80
 
81
81
  function Component () {
@@ -87,7 +87,7 @@
87
87
  </div>
88
88
  )
89
89
  }
90
- `},user:{description:"User / Single Person",react:h.code`
90
+ `},user:{description:"User / Single Person",react:f.code`
91
91
  import { Photo } from "@sps-woodland/photo";
92
92
 
93
93
  function Component () {
@@ -99,7 +99,7 @@
99
99
  </div>
100
100
  )
101
101
  }
102
- `},group:{description:"Group / Multiple People",react:h.code`
102
+ `},group:{description:"Group / Multiple People",react:f.code`
103
103
  import { Photo } from "@sps-woodland/photo";
104
104
 
105
105
  function Component () {
@@ -111,7 +111,7 @@
111
111
  </div>
112
112
  )
113
113
  }
114
- `},company:{description:"Company / Building",react:h.code`
114
+ `},company:{description:"Company / Building",react:f.code`
115
115
  import { Photo } from "@sps-woodland/photo";
116
116
 
117
117
  function Component () {
@@ -123,7 +123,7 @@
123
123
  </div>
124
124
  )
125
125
  }
126
- `}}},carousel:{label:"Photo Carousel",description:"",examples:{general:{description:"",react:h.code`
126
+ `}}},carousel:{label:"Photo Carousel",description:"",examples:{general:{description:"",react:f.code`
127
127
  import { PhotoCarousel, Photo } from "@sps-woodland/photo";
128
128
 
129
129
  function Component () {
package/lib/index.es.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as e from "react";
2
- import { Metadata as B, cl as h, Icon as L, selectChildren as z } from "@sps-woodland/core";
2
+ import { Metadata as L, cl as f, Icon as z, selectChildren as T } from "@sps-woodland/core";
3
3
  import { grid as v } from "@sps-woodland/tokens";
4
4
  import { SpsButton as b } from "@spscommerce/ds-react";
5
5
  import { ButtonKind as I, SpsIcon as E } from "@spscommerce/ds-shared";
6
6
  import { code as u } from "@spscommerce/utils";
7
- function T(t, a, r) {
7
+ function D(t, a, r) {
8
8
  return a in t ? Object.defineProperty(t, a, {
9
9
  value: r,
10
10
  enumerable: !0,
@@ -26,14 +26,14 @@ function O(t) {
26
26
  for (var a = 1; a < arguments.length; a++) {
27
27
  var r = arguments[a] != null ? arguments[a] : {};
28
28
  a % 2 ? y(Object(r), !0).forEach(function(o) {
29
- T(t, o, r[o]);
29
+ D(t, o, r[o]);
30
30
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : y(Object(r)).forEach(function(o) {
31
31
  Object.defineProperty(t, o, Object.getOwnPropertyDescriptor(r, o));
32
32
  });
33
33
  }
34
34
  return t;
35
35
  }
36
- var D = (t, a, r) => {
36
+ var M = (t, a, r) => {
37
37
  for (var o of Object.keys(t)) {
38
38
  var n;
39
39
  if (t[o] !== ((n = a[o]) !== null && n !== void 0 ? n : r[o]))
@@ -45,16 +45,19 @@ var D = (t, a, r) => {
45
45
  for (var n in o) {
46
46
  var d, c = (d = o[n]) !== null && d !== void 0 ? d : t.defaultVariants[n];
47
47
  if (c != null) {
48
- var s = c;
49
- typeof s == "boolean" && (s = s === !0 ? "true" : "false");
50
- var i = t.variantClassNames[n][s];
51
- i && (r += " " + i);
48
+ var i = c;
49
+ typeof i == "boolean" && (i = i === !0 ? "true" : "false");
50
+ var s = (
51
+ // @ts-expect-error
52
+ t.variantClassNames[n][i]
53
+ );
54
+ s && (r += " " + s);
52
55
  }
53
56
  }
54
57
  for (var [l, p] of t.compoundVariants)
55
- D(l, o, t.defaultVariants) && (r += " " + p);
58
+ M(l, o, t.defaultVariants) && (r += " " + p);
56
59
  return r;
57
- }, M = g({ defaultClassName: "dons243", variantClassNames: { mode: { fill: "dons244", fit: "dons245" } }, defaultVariants: { mode: "fill" }, compoundVariants: [] }), G = "dons246", H = g({ defaultClassName: "dons240", variantClassNames: { placeholder: { true: "dons241", false: "dons242" } }, defaultVariants: { placeholder: !1 }, compoundVariants: [] });
60
+ }, G = g({ defaultClassName: "dons243", variantClassNames: { mode: { fill: "dons244", fit: "dons245" } }, defaultVariants: { mode: "fill" }, compoundVariants: [] }), H = "dons246", K = g({ defaultClassName: "dons240", variantClassNames: { placeholder: { true: "dons241", false: "dons242" } }, defaultVariants: { placeholder: !1 }, compoundVariants: [] });
58
61
  function P({
59
62
  className: t,
60
63
  src: a,
@@ -63,19 +66,19 @@ function P({
63
66
  placeholderIcon: n = "photo",
64
67
  ...d
65
68
  }) {
66
- const c = e.useRef(null), s = e.useRef(null), i = e.useRef(null), l = e.useRef(null), [p, j] = e.useState(), [S, V] = e.useState(!1);
69
+ const c = e.useRef(null), i = e.useRef(null), s = e.useRef(null), l = e.useRef(null), [p, j] = e.useState(), [S, V] = e.useState(!1);
67
70
  e.useEffect(() => {
68
- s.current && (i.current && (window.clearInterval(i.current), i.current = null), i.current = window.setInterval(() => {
69
- if (s.current) {
70
- const m = s.current.getBoundingClientRect();
71
+ i.current && (s.current && (window.clearInterval(s.current), s.current = null), s.current = window.setInterval(() => {
72
+ if (i.current) {
73
+ const m = i.current.getBoundingClientRect();
71
74
  if (m.height) {
72
- i.current && (window.clearInterval(i.current), i.current = null);
73
- let f = !0;
74
- f = m.width / m.height > 1, V(f === (o === "fit"));
75
+ s.current && (window.clearInterval(s.current), s.current = null);
76
+ let h = !0;
77
+ h = m.width / m.height > 1, V(h === (o === "fit"));
75
78
  }
76
79
  }
77
80
  }, 1e3 / 60));
78
- }, [c.current, s.current, a]), e.useEffect(() => {
81
+ }, [c.current, i.current, a]), e.useEffect(() => {
79
82
  l.current && (window.clearInterval(l.current), l.current = null), l.current = window.setInterval(() => {
80
83
  if (c.current) {
81
84
  const m = c.current.getBoundingClientRect();
@@ -84,10 +87,10 @@ function P({
84
87
  }, 1e3 / 60);
85
88
  }, [c.current]);
86
89
  function F(m) {
87
- var f, C, w;
90
+ var h, C, w;
88
91
  if (m) {
89
- const N = ((w = (C = (f = document == null ? void 0 : document.body) == null ? void 0 : f.parentElement) == null ? void 0 : C.style) == null ? void 0 : w.fontSize) || "16px", _ = Number(N.substring(0, N.length - 2));
90
- j(m / _);
92
+ const N = ((w = (C = (h = document == null ? void 0 : document.body) == null ? void 0 : h.parentElement) == null ? void 0 : C.style) == null ? void 0 : w.fontSize) || "16px", B = Number(N.substring(0, N.length - 2));
93
+ j(m / B);
91
94
  }
92
95
  }
93
96
  function W() {
@@ -102,7 +105,7 @@ function P({
102
105
  "div",
103
106
  {
104
107
  ref: c,
105
- className: h(H({ placeholder: !a }), t),
108
+ className: f(K({ placeholder: !a }), t),
106
109
  style: {
107
110
  width: `${p}` && `${p}rem`,
108
111
  fontSize: `${W()}rem`,
@@ -113,15 +116,15 @@ function P({
113
116
  a ? p ? /* @__PURE__ */ e.createElement(
114
117
  "img",
115
118
  {
116
- className: M({ mode: S ? "fit" : "fill" }),
117
- ref: s,
119
+ className: G({ mode: S ? "fit" : "fill" }),
120
+ ref: i,
118
121
  src: a,
119
122
  alt: r
120
123
  }
121
- ) : /* @__PURE__ */ e.createElement("span", null) : /* @__PURE__ */ e.createElement(L, { className: G, icon: n })
124
+ ) : /* @__PURE__ */ e.createElement("span", null) : /* @__PURE__ */ e.createElement(z, { className: H, icon: n })
122
125
  );
123
126
  }
124
- B.set(P, {
127
+ L.set(P, {
125
128
  name: "Photo",
126
129
  props: {
127
130
  src: "string",
@@ -133,36 +136,36 @@ B.set(P, {
133
136
  placeholderIcon: "IconName"
134
137
  }
135
138
  });
136
- var x = "i6pp7s1", R = "i6pp7s0", K = "i6pp7s3", k = "i6pp7s2", U = g({ defaultClassName: "i6pp7s4", variantClassNames: { selected: { true: "i6pp7s5", false: "i6pp7s6" } }, defaultVariants: { selected: !1 }, compoundVariants: [] });
139
+ var x = "i6pp7s1", R = "i6pp7s0", _ = "i6pp7s3", k = "i6pp7s2", U = g({ defaultClassName: "i6pp7s4", variantClassNames: { selected: { true: "i6pp7s5", false: "i6pp7s6" } }, defaultVariants: { selected: !1 }, compoundVariants: [] });
137
140
  function q({
138
141
  children: t,
139
142
  className: a,
140
143
  ...r
141
144
  }) {
142
- const [o] = z(t, [{ type: P }]), [n, d] = e.useState(0);
145
+ const [o] = T(t, [{ type: P }]), [n, d] = e.useState(0);
143
146
  function c() {
144
147
  n + 1 === o.length ? d(0) : d(n + 1);
145
148
  }
146
- function s() {
149
+ function i() {
147
150
  d(n === 0 ? o.length - 1 : n - 1);
148
151
  }
149
- return /* @__PURE__ */ e.createElement("div", { className: v.root, ...r }, /* @__PURE__ */ e.createElement("div", { className: h(R) }, /* @__PURE__ */ e.createElement("div", { className: h(x) }, /* @__PURE__ */ e.createElement(
152
+ return /* @__PURE__ */ e.createElement("div", { className: v.root, ...r }, /* @__PURE__ */ e.createElement("div", { className: f(R) }, /* @__PURE__ */ e.createElement("div", { className: f(x) }, /* @__PURE__ */ e.createElement(
150
153
  b,
151
154
  {
152
155
  tabIndex: 0,
153
156
  kind: I.ICON,
154
157
  icon: E.ARROW_LEFT_CIRCLE,
155
- onClick: s
158
+ onClick: i
156
159
  }
157
- ))), /* @__PURE__ */ e.createElement("div", { className: v[10] }, /* @__PURE__ */ e.createElement("div", { className: h(K, v[12]) }, o[n]), /* @__PURE__ */ e.createElement("div", { className: h(k, v[12]) }, o.map((i, l) => /* @__PURE__ */ e.createElement(
160
+ ))), /* @__PURE__ */ e.createElement("div", { className: v[10] }, /* @__PURE__ */ e.createElement("div", { className: f(_, v[12]) }, o[n]), /* @__PURE__ */ e.createElement("div", { className: f(k, v[12]) }, o.map((s, l) => /* @__PURE__ */ e.createElement(
158
161
  "button",
159
162
  {
160
163
  tabIndex: 0,
161
- className: h(U({ selected: l === n })),
164
+ className: f(U({ selected: l === n })),
162
165
  onClick: () => d(l)
163
166
  },
164
- i
165
- )))), /* @__PURE__ */ e.createElement("div", { className: h(R) }, /* @__PURE__ */ e.createElement("div", { className: h(x) }, /* @__PURE__ */ e.createElement(
167
+ s
168
+ )))), /* @__PURE__ */ e.createElement("div", { className: f(R) }, /* @__PURE__ */ e.createElement("div", { className: f(x) }, /* @__PURE__ */ e.createElement(
166
169
  b,
167
170
  {
168
171
  tabIndex: 0,
package/lib/style.css CHANGED
@@ -1 +1 @@
1
- .dons240{align-items:center;display:flex;justify-content:center;overflow:hidden;padding:0!important;vertical-align:middle}.dons241{background:oklch(96.64% .001 197.14);box-shadow:inset .0625rem 0 0 oklch(86.84% .002 197.12),inset -.0625rem 0 0 oklch(86.84% .002 197.12),inset 0 .0625rem 0 oklch(86.84% .002 197.12),inset 0 -.0625rem 0 oklch(86.84% .002 197.12),inset 1em 0 0 oklch(100% 0 0),inset -1em 0 0 oklch(100% 0 0),inset 0 1em 0 oklch(100% 0 0),inset 0 -1em 0 oklch(100% 0 0)}.dons243{visibility:hidden}.dons244{height:100%;visibility:visible;width:auto}.dons245{height:auto;visibility:visible;width:100%}.dons246{flex:1;font-size:6em;text-align:center;color:oklch(56.48% .008 219.62)}.i6pp7s0{display:table;float:right}.i6pp7s1{display:table-cell;vertical-align:middle}.i6pp7s2{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.i6pp7s3{display:block;margin-bottom:.5rem;width:100%}.i6pp7s4{display:block;background:transparent;border:0;cursor:pointer;padding:0}.i6pp7s6{opacity:.4}
1
+ .dons240{align-items:center;display:flex;justify-content:center;overflow:hidden;padding:0!important;vertical-align:middle}.dons241{background:#f3f4f4;box-shadow:inset .0625rem 0 #d2d4d4,inset -.0625rem 0 #d2d4d4,inset 0 .0625rem #d2d4d4,inset 0 -.0625rem #d2d4d4,inset 1em 0 #fff,inset -1em 0 #fff,inset 0 1em #fff,inset 0 -1em #fff}.dons243{visibility:hidden}.dons244{height:100%;visibility:visible;width:auto}.dons245{height:auto;visibility:visible;width:100%}.dons246{flex:1;font-size:6em;text-align:center;color:#717779}.i6pp7s0{display:table;float:right}.i6pp7s1{display:table-cell;vertical-align:middle}.i6pp7s2{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}.i6pp7s3{display:block;margin-bottom:.5rem;width:100%}.i6pp7s4{display:block;background:transparent;border:0;cursor:pointer;padding:0}.i6pp7s6{opacity:.4}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sps-woodland/photo",
3
3
  "description": "SPS Woodland Design System photo component",
4
- "version": "8.7.4",
4
+ "version": "8.7.6",
5
5
  "author": "SPS Commerce",
6
6
  "license": "UNLICENSED",
7
7
  "repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/photo",
@@ -29,10 +29,10 @@
29
29
  "@spscommerce/utils": "^6.12.1",
30
30
  "react": "^16.9.0",
31
31
  "react-dom": "^16.9.0",
32
- "@sps-woodland/core": "8.7.4",
33
- "@sps-woodland/tokens": "8.7.4",
34
- "@spscommerce/ds-react": "8.7.4",
35
- "@spscommerce/ds-shared": "8.7.4"
32
+ "@sps-woodland/core": "8.7.6",
33
+ "@sps-woodland/tokens": "8.7.6",
34
+ "@spscommerce/ds-react": "8.7.6",
35
+ "@spscommerce/ds-shared": "8.7.6"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@spscommerce/utils": "^6.12.1",
@@ -40,10 +40,10 @@
40
40
  "@vanilla-extract/recipes": "^0.2.5",
41
41
  "react": "^16.9.0",
42
42
  "react-dom": "^16.9.0",
43
- "@sps-woodland/core": "8.7.4",
44
- "@sps-woodland/tokens": "8.7.4",
45
- "@spscommerce/ds-react": "8.7.4",
46
- "@spscommerce/ds-shared": "8.7.4"
43
+ "@sps-woodland/core": "8.7.6",
44
+ "@sps-woodland/tokens": "8.7.6",
45
+ "@spscommerce/ds-react": "8.7.6",
46
+ "@spscommerce/ds-shared": "8.7.6"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "pnpm run build:js && pnpm run build:types",
File without changes