@photoroom/ui 0.1.844 → 0.1.845

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.
@@ -3,7 +3,10 @@ export type VideoExampleTileProps = Readonly<{
3
3
  posterSrc?: string;
4
4
  productImageSrc?: string;
5
5
  productImageAlt?: string;
6
+ href?: string;
7
+ label?: string;
8
+ actionLabel?: string;
6
9
  className?: string;
7
10
  }>;
8
- export declare const VideoExampleTile: ({ videoSrc, posterSrc, productImageSrc, productImageAlt, className, }: VideoExampleTileProps) => import("react").JSX.Element;
11
+ export declare const VideoExampleTile: ({ videoSrc, posterSrc, productImageSrc, productImageAlt, href, label, actionLabel, className, }: VideoExampleTileProps) => import("react").JSX.Element;
9
12
  //# sourceMappingURL=VideoExampleTile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VideoExampleTile.d.ts","sourceRoot":"","sources":["../../../../src/components/website/VideoExamplesBlock/VideoExampleTile.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAIH,eAAO,MAAM,gBAAgB,0EAM1B,qBAAqB,gCA2FvB,CAAC"}
1
+ {"version":3,"file":"VideoExampleTile.d.ts","sourceRoot":"","sources":["../../../../src/components/website/VideoExamplesBlock/VideoExampleTile.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAIH,eAAO,MAAM,gBAAgB,oGAS1B,qBAAqB,gCA4GvB,CAAC"}
@@ -4,6 +4,8 @@ export type VideoExample = Readonly<{
4
4
  posterSrc?: string;
5
5
  productImageSrc?: string;
6
6
  productImageAlt?: string;
7
+ href?: string;
8
+ label?: string;
7
9
  }>;
8
10
  export type VideoExamplesCategory = Readonly<{
9
11
  id: string;
@@ -16,7 +18,8 @@ export type VideoExamplesBlockProps = Readonly<{
16
18
  /** Opens this tab and moves it right after the first tab. Falls back to the first category. */
17
19
  defaultCategoryId?: string;
18
20
  tabListLabel?: string;
21
+ tileActionLabel?: string;
19
22
  footer: React.ReactNode;
20
23
  }> & React.ComponentProps<"section">;
21
- export declare const VideoExamplesBlock: ({ titleBlock, categories, defaultCategoryId, tabListLabel, footer, className, ...rest }: VideoExamplesBlockProps) => import("react").JSX.Element;
24
+ export declare const VideoExamplesBlock: ({ titleBlock, categories, defaultCategoryId, tabListLabel, tileActionLabel, footer, className, ...rest }: VideoExamplesBlockProps) => import("react").JSX.Element;
22
25
  //# sourceMappingURL=VideoExamplesBlock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VideoExamplesBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/website/VideoExamplesBlock/VideoExamplesBlock.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC3C,EAAE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/F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;CACzB,CAAC,GACA,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;AAgBlC,eAAO,MAAM,kBAAkB,6GAS5B,uBAAuB,gCAiEzB,CAAC"}
package/index.mjs CHANGED
@@ -62762,41 +62762,53 @@ var WDe = ({ title: e, logos: t, className: n, ...r }) => {
62762
62762
  })]
62763
62763
  })]
62764
62764
  });
62765
- }, XDe = "(prefers-reduced-motion: reduce)", m9 = ({ videoSrc: e, posterSrc: t, productImageSrc: n, productImageAlt: r = "", className: i }) => {
62766
- let a = H(null);
62765
+ }, XDe = "(prefers-reduced-motion: reduce)", m9 = ({ videoSrc: e, posterSrc: t, productImageSrc: n, productImageAlt: r = "", href: i, label: a, actionLabel: o, className: s }) => {
62766
+ let c = H(null);
62767
62767
  return Me(() => {
62768
- let n = a.current;
62768
+ let n = c.current;
62769
62769
  if (!n || !("IntersectionObserver" in window)) return;
62770
- let r = window.matchMedia(XDe), i = !1, o = () => {
62770
+ let r = window.matchMedia(XDe), i = !1, a = () => {
62771
62771
  n.hasAttribute("src") && (n.removeAttribute("src"), n.load());
62772
- }, s = () => {
62773
- !i || r.matches ? o() : (n.getAttribute("src") !== e && n.setAttribute("src", e), n.play().catch(() => void 0));
62774
- }, c = new IntersectionObserver((e) => {
62775
- i = !!e[e.length - 1]?.isIntersecting, i && t && !n.hasAttribute("poster") && n.setAttribute("poster", t), s();
62772
+ }, o = () => {
62773
+ !i || r.matches ? a() : (n.getAttribute("src") !== e && n.setAttribute("src", e), n.play().catch(() => void 0));
62774
+ }, s = new IntersectionObserver((e) => {
62775
+ i = !!e[e.length - 1]?.isIntersecting, i && t && !n.hasAttribute("poster") && n.setAttribute("poster", t), o();
62776
62776
  }, { rootMargin: "200px" });
62777
- return c.observe(n), r.addEventListener("change", s), () => {
62778
- c.disconnect(), r.removeEventListener("change", s), o();
62777
+ return s.observe(n), r.addEventListener("change", o), () => {
62778
+ s.disconnect(), r.removeEventListener("change", o), a();
62779
62779
  };
62780
- }, [e, t]), /* @__PURE__ */ R("div", {
62781
- className: W("rounded-500 bg-background-subdued relative aspect-9/16 w-full overflow-hidden", "after:rounded-500 after:pointer-events-none after:absolute after:inset-0", "after:border-misc-hairline-emphasized after:misc-border-size-hairline", i),
62782
- children: [/* @__PURE__ */ L("video", {
62783
- ref: a,
62784
- loop: !0,
62785
- muted: !0,
62786
- playsInline: !0,
62787
- disablePictureInPicture: !0,
62788
- preload: "none",
62789
- className: "size-full object-cover"
62790
- }), n && /* @__PURE__ */ L("div", {
62791
- className: U("absolute start-1.5 bottom-1.5 size-700 overflow-hidden", "rounded-300 bg-surface-primary shadow-500", "border-content-white-primary border-[1.5px]"),
62792
- children: /* @__PURE__ */ L("img", {
62793
- src: n,
62794
- alt: r,
62795
- loading: "lazy",
62796
- decoding: "async",
62780
+ }, [e, t]), /* @__PURE__ */ R(i ? "a" : "div", {
62781
+ ...i ? {
62782
+ href: i,
62783
+ "aria-label": a
62784
+ } : {},
62785
+ className: W("group rounded-500 bg-background-subdued relative block aspect-9/16 w-full overflow-hidden", "after:rounded-500 after:pointer-events-none after:absolute after:inset-0", "after:border-misc-hairline-emphasized after:misc-border-size-hairline", "focus-visible:ring-misc-focus-indicator focus-visible:misc-border-size-focus-ring outline-hidden", s),
62786
+ children: [
62787
+ /* @__PURE__ */ L("video", {
62788
+ ref: c,
62789
+ loop: !0,
62790
+ muted: !0,
62791
+ playsInline: !0,
62792
+ disablePictureInPicture: !0,
62793
+ preload: "none",
62797
62794
  className: "size-full object-cover"
62795
+ }),
62796
+ n && /* @__PURE__ */ L("div", {
62797
+ className: U("absolute start-1.5 bottom-1.5 size-700 overflow-hidden", "rounded-300 bg-surface-primary shadow-500", "border-content-white-primary border-[1.5px]"),
62798
+ children: /* @__PURE__ */ L("img", {
62799
+ src: n,
62800
+ alt: r,
62801
+ loading: "lazy",
62802
+ decoding: "async",
62803
+ className: "size-full object-cover"
62804
+ })
62805
+ }),
62806
+ i && /* @__PURE__ */ L("span", {
62807
+ "aria-hidden": !0,
62808
+ className: U("absolute inset-0 flex items-center justify-center px-4 text-center", "bg-black-alpha-500 component-500 text-content-white-primary font-600", "opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 group-active:opacity-100"),
62809
+ children: o
62798
62810
  })
62799
- })]
62811
+ ]
62800
62812
  });
62801
62813
  }, ZDe = 12, QDe = (e, t) => {
62802
62814
  let [n, ...r] = e;
@@ -62805,26 +62817,26 @@ var WDe = ({ title: e, logos: t, className: n, ...r }) => {
62805
62817
  t,
62806
62818
  ...r.filter((e) => e !== t)
62807
62819
  ];
62808
- }, $De = ({ titleBlock: e, categories: t, defaultCategoryId: n, tabListLabel: r, footer: i, className: a, ...o }) => {
62809
- let s = t.find((e) => e.id === n), c = QDe(t, s), l = (s ?? t[0])?.id;
62820
+ }, $De = ({ titleBlock: e, categories: t, defaultCategoryId: n, tabListLabel: r, tileActionLabel: i, footer: a, className: o, ...s }) => {
62821
+ let c = t.find((e) => e.id === n), l = QDe(t, c), u = (c ?? t[0])?.id;
62810
62822
  return /* @__PURE__ */ L("section", {
62811
- className: W("pt-e700 pb-e1000 px-4 sm:px-6 md:px-8 xl:px-10", a),
62812
- ...o,
62823
+ className: W("pt-e700 pb-e1000 px-4 sm:px-6 md:px-8 xl:px-10", o),
62824
+ ...s,
62813
62825
  children: /* @__PURE__ */ R("div", {
62814
62826
  className: "gap-i500 mx-auto flex w-full max-w-300 flex-col",
62815
62827
  children: [/* @__PURE__ */ R("div", {
62816
62828
  className: "gap-i400 flex flex-col",
62817
62829
  children: [e, t.length > 0 && /* @__PURE__ */ R(K8, {
62818
- defaultValue: l,
62830
+ defaultValue: u,
62819
62831
  className: "flex flex-col gap-4",
62820
62832
  children: [/* @__PURE__ */ L(K8.List, {
62821
62833
  "aria-label": r,
62822
62834
  className: "-mx-2 w-auto scrollbar-none overflow-x-auto px-2",
62823
- children: c.map((e) => /* @__PURE__ */ L(K8.Item, {
62835
+ children: l.map((e) => /* @__PURE__ */ L(K8.Item, {
62824
62836
  value: e.id,
62825
62837
  children: e.label
62826
62838
  }, e.id))
62827
- }), c.map((e) => /* @__PURE__ */ L(K8.Content, {
62839
+ }), l.map((e) => /* @__PURE__ */ L(K8.Content, {
62828
62840
  value: e.id,
62829
62841
  children: /* @__PURE__ */ L("ul", {
62830
62842
  role: "list",
@@ -62835,15 +62847,18 @@ var WDe = ({ title: e, logos: t, className: n, ...r }) => {
62835
62847
  videoSrc: e.videoSrc,
62836
62848
  posterSrc: e.posterSrc,
62837
62849
  productImageSrc: e.productImageSrc,
62838
- productImageAlt: e.productImageAlt
62850
+ productImageAlt: e.productImageAlt,
62851
+ href: e.href,
62852
+ label: e.label,
62853
+ actionLabel: i
62839
62854
  })
62840
62855
  }, e.id))
62841
62856
  })
62842
62857
  }, e.id))]
62843
- }, l)]
62858
+ }, u)]
62844
62859
  }), /* @__PURE__ */ L("div", {
62845
62860
  className: "flex",
62846
- children: i
62861
+ children: a
62847
62862
  })]
62848
62863
  })
62849
62864
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photoroom/ui",
3
- "version": "0.1.844",
3
+ "version": "0.1.845",
4
4
  "private": false,
5
5
  "description": "Photoroom design system components",
6
6
  "sideEffects": [