@nypl/design-system-react-components 3.4.0-rc-hero → 3.4.0-rc-hero-2

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.
@@ -38701,11 +38701,21 @@ const db = [
38701
38701
  variant: v
38702
38702
  }), O = R.heading, P = d && X.cloneElement(d, { __css: O });
38703
38703
  let I = {}, Y = {};
38704
+ const A = L.component || /* @__PURE__ */ H.jsx(
38705
+ ua,
38706
+ {
38707
+ alt: L.alt,
38708
+ fallbackSrc: L.fallbackSrc,
38709
+ id: L.id,
38710
+ onError: L.onError,
38711
+ src: L.src
38712
+ }
38713
+ );
38704
38714
  if (L.component) {
38705
38715
  const { src: e1, id: c1, alt: v1, fallbackSrc: w1, onError: y1 } = L.component.props;
38706
38716
  Object.assign(L, { src: e1, id: c1, alt: v1, fallbackSrc: w1, onError: y1 });
38707
38717
  }
38708
- L.src && !L.alt && console.warn(
38718
+ console.log("pre check", L), L.src && !L.alt && console.warn(
38709
38719
  'NYPL Reservoir Hero: The "imageProps.src" prop was passed but the "imageProps.alt" props was not. This will make the rendered image inaccessible.'
38710
38720
  ), v === "primary" ? (i || console.warn(
38711
38721
  "NYPL Reservoir Hero: It is recommended to use the `backgroundImageSrc` prop for the `'primary'` `heroType` variant."
@@ -38726,7 +38736,7 @@ const db = [
38726
38736
  ), v !== "campaign" && E && console.warn(
38727
38737
  "NYPL Reservoir Hero: The `isDarkBackgroundImage` prop has been passed, but the `'campaign'` `heroType` variant was not set. It will be ignored."
38728
38738
  );
38729
- const A = {
38739
+ const $ = {
38730
38740
  primary: a5("ui.black", "dark.ui.bg.default"),
38731
38741
  secondary: a5("ui.bg.default", "dark.ui.bg.default"),
38732
38742
  tertiary: a5("ui.gray.x-dark", "dark.ui.bg.default"),
@@ -38736,14 +38746,14 @@ const db = [
38736
38746
  "dark.ui.bg.active"
38737
38747
  ),
38738
38748
  fiftyFifty: a5("ui.bg.default", "dark.ui.bg.default")
38739
- }, $ = A[v];
38749
+ }, j = $[v];
38740
38750
  if (v === "primary")
38741
38751
  I = i ? {
38742
- bgColor: $,
38752
+ bgColor: j,
38743
38753
  backgroundImage: `/**/url("${i}")`
38744
38754
  } : {};
38745
38755
  else if (v === "secondary")
38746
- I = { bgColor: $ };
38756
+ I = { bgColor: j };
38747
38757
  else if (v === "campaign") {
38748
38758
  const e1 = {
38749
38759
  content: '""',
@@ -38775,29 +38785,20 @@ const db = [
38775
38785
  } : {
38776
38786
  _before: {
38777
38787
  ...e1,
38778
- bgColor: A.campaignBackdrop
38788
+ bgColor: $.campaignBackdrop
38779
38789
  }
38780
38790
  };
38781
38791
  } else
38782
- (v === "tertiary" || v === "fiftyFifty") && (I = s ? { bgColor: s } : { bgColor: s || $ });
38792
+ (v === "tertiary" || v === "fiftyFifty") && (I = s ? { bgColor: s } : { bgColor: s || j });
38783
38793
  db.includes(v) ? (p || s || o) && console.warn(
38784
38794
  "NYPL Reservoir Hero: The `foregroundColor`, `backgroundColor`, or `backdropBackgroundColor` props have been passed, but the `'secondary'` `heroType` variant will not use them."
38785
38795
  ) : Y = {
38786
38796
  ...p && { color: p },
38787
- ...s ? { backgroundColor: s } : { bgColor: $ }
38797
+ ...s ? { backgroundColor: s } : { bgColor: j }
38788
38798
  }, p && M && console.warn(
38789
38799
  "NYPL Reservoir Hero: The `foregroundColor` and `isDarkText` props have both been passed. Thse props can not be used at the same time, so the `foregroundColor` prop will override the `isDarkText` prop."
38790
38800
  );
38791
- const j = /* @__PURE__ */ H.jsx(
38792
- ua,
38793
- {
38794
- alt: L.alt,
38795
- fallbackSrc: L.fallbackSrc,
38796
- id: L.id,
38797
- onError: L.onError,
38798
- src: L.src
38799
- }
38800
- ), i1 = v === "campaign" ? /* @__PURE__ */ H.jsxs(H.Fragment, { children: [
38801
+ const i1 = v === "campaign" ? /* @__PURE__ */ H.jsxs(H.Fragment, { children: [
38801
38802
  /* @__PURE__ */ H.jsx(
38802
38803
  g1,
38803
38804
  {
@@ -38807,7 +38808,7 @@ const db = [
38807
38808
  style: {
38808
38809
  backgroundImage: `/**/url("${L.src}")`
38809
38810
  },
38810
- children: j
38811
+ children: A
38811
38812
  }
38812
38813
  ),
38813
38814
  /* @__PURE__ */ H.jsxs(g1, { __css: R.interior, children: [
@@ -38824,7 +38825,7 @@ const db = [
38824
38825
  style: {
38825
38826
  backgroundImage: v === "fiftyFifty" ? `/**/url("${L.src}")` : void 0
38826
38827
  },
38827
- children: j
38828
+ children: A
38828
38829
  }
38829
38830
  ),
38830
38831
  P,
@@ -29,13 +29,12 @@ export interface HeroProps {
29
29
  heroType?: HeroTypes;
30
30
  /** ID that other components can cross reference for accessibility purposes. */
31
31
  id?: string;
32
- /** Object used to create and render the `Image` component. Note that only
33
- * `alt`, `component`, and `src` are the available attributes to pass. If
34
- * `imageProps.alt` is left blank, a warning will be logged to the console and
32
+ /** Object used to create and render the `Image` component. You can pass either `component`
33
+ * (with its own internal props) or `src`, `alt`, and `id`.
34
+ * You can also pass `fallBackSrc` and `onError` (only needed for the "campaign" variant).
35
+ * If `imageProps.alt` is left blank, a warning will be logged to the console and
35
36
  * will cause accessibility issues. For `imageProps.src`, it will only work for
36
- * the "secondary", "fiftyFifty" and "campaign" `Hero` types; Note: `imageProps.src`
37
- * can only be used in conjunction with `backgroundImageSrc` for the "campaign"
38
- * `Hero` type. Note: not all `Hero` variations utilize this prop. */
37
+ * the "secondary", "fiftyFifty" and "campaign" `Hero` types. */
39
38
  imageProps?: ComponentImageProps;
40
39
  /** Optional boolean used to toggle the default text color from light to dark.
41
40
  * Set isDarkText to `true` if the backgroundColor is set to a light color. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nypl/design-system-react-components",
3
- "version": "3.4.0-rc-hero",
3
+ "version": "3.4.0-rc-hero-2",
4
4
  "description": "NYPL Reservoir Design System React Components",
5
5
  "repository": {
6
6
  "type": "git",