@nypl/design-system-react-components 1.0.6 → 1.0.7

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.
@@ -2111,7 +2111,7 @@ var Link = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props, ref) {
2111
2111
  var variant = "link";
2112
2112
 
2113
2113
  if (typeof children === "string" && !href) {
2114
- throw new Error("`Link` needs the `href` prop.");
2114
+ throw new Error("NYPL Reservoir Link: The `Link` component needs the `href` prop if its child element is a string.");
2115
2115
  }
2116
2116
 
2117
2117
  if (type === "action" || type === "forwards" || type === "backwards" || type === "external") {
@@ -2135,15 +2135,15 @@ var Link = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props, ref) {
2135
2135
  // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/32832
2136
2136
  // let children = React.Children.only(children);
2137
2137
  if (React__default.Children.count(children) > 1) {
2138
- throw new Error("Please pass only one child into `Link`.");
2138
+ throw new Error("NYPL Reservoir Link: Please pass only one child into the `Link` component.");
2139
2139
  }
2140
2140
 
2141
2141
  var childrenToClone = children[0] ? children[0] : children;
2142
2142
  var childProps = childrenToClone.props;
2143
- return React__default.createElement(Box, {
2143
+ return React__default.createElement(Box, Object.assign({
2144
2144
  as: "span",
2145
2145
  __css: style
2146
- }, React__default.cloneElement(childrenToClone, _extends({
2146
+ }, rest), React__default.cloneElement(childrenToClone, _extends({
2147
2147
  className: className
2148
2148
  }, linkProps, childProps, {
2149
2149
  ref: ref,
@@ -2359,9 +2359,9 @@ var Image = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props, ref) {
2359
2359
  className: className,
2360
2360
  size: size
2361
2361
  }, caption || credit ? {} : rest), imageComponent) : imageComponent;
2362
- return React__default.createElement(Box, {
2362
+ return React__default.createElement(Box, Object.assign({
2363
2363
  ref: finalRefs
2364
- }, caption || credit ? React__default.createElement(Box, Object.assign({
2364
+ }, rest), caption || credit ? React__default.createElement(Box, Object.assign({
2365
2365
  as: "figure",
2366
2366
  __css: _extends({}, styles.figure, additionalFigureStyles)
2367
2367
  }, rest), finalImage, React__default.createElement(Box, {
@@ -2372,7 +2372,11 @@ var Image = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props, ref) {
2372
2372
  }, caption), credit && React__default.createElement(Box, {
2373
2373
  __css: styles.captionWrappers
2374
2374
  }, credit))) : finalImage);
2375
- }));
2375
+ }), {
2376
+ shouldForwardProp: function shouldForwardProp() {
2377
+ return true;
2378
+ }
2379
+ });
2376
2380
 
2377
2381
  var _excluded$Y = ["children"],
2378
2382
  _excluded2$1 = ["bottomBorder", "children", "isCentered", "layout", "topBorder"],
@@ -5502,21 +5506,32 @@ var secondaryBase = {
5502
5506
  flexFlow: {
5503
5507
  base: "column nowrap",
5504
5508
  md: "row wrap"
5509
+ }
5510
+ }),
5511
+ imgWrapper: {
5512
+ marginEnd: {
5513
+ base: "calc(-50vw + 50%)",
5514
+ md: "0"
5515
+ },
5516
+ marginStart: {
5517
+ base: "calc(-50vw + 50%)",
5518
+ md: "0"
5519
+ },
5520
+ flex: {
5521
+ base: "1 1 100%",
5522
+ md: "0 0 250px"
5523
+ },
5524
+ order: {
5525
+ base: "2",
5526
+ md: "3"
5505
5527
  },
5506
5528
  img: {
5507
- flex: {
5508
- base: "1 1 100%",
5509
- md: "0 0 250px"
5510
- },
5511
- order: {
5512
- md: "3"
5513
- },
5514
5529
  height: "150px",
5515
5530
  minWidth: "0",
5516
5531
  objectFit: "cover",
5517
5532
  width: "100%"
5518
5533
  }
5519
- }),
5534
+ },
5520
5535
  bodyText: {
5521
5536
  paddingBottom: "inset.default",
5522
5537
  paddingEnd: {
@@ -5527,6 +5542,7 @@ var secondaryBase = {
5527
5542
  md: "1 1 50%"
5528
5543
  },
5529
5544
  order: {
5545
+ base: "3",
5530
5546
  md: "2"
5531
5547
  }
5532
5548
  }
@@ -5534,18 +5550,14 @@ var secondaryBase = {
5534
5550
 
5535
5551
  var secondaryHeadingBase = {
5536
5552
  marginBottom: "0",
5537
- bg: "ui.black",
5538
5553
  color: "ui.white",
5539
5554
  flex: "1 1 100%",
5540
5555
  marginTop: "0",
5541
5556
  paddingBottom: "xxs",
5542
5557
  position: "relative",
5543
5558
  zIndex: "0",
5544
- order: {
5545
- md: "1"
5546
- },
5559
+ order: "1",
5547
5560
  _before: {
5548
- bg: "ui.black",
5549
5561
  content: "\"\"",
5550
5562
  height: "100%",
5551
5563
  left: "-2000px",
@@ -5557,6 +5569,10 @@ var secondaryHeadingBase = {
5557
5569
  // update the background color.
5558
5570
 
5559
5571
  var getSecondaryVariantStyles = function getSecondaryVariantStyles(bgColor) {
5572
+ if (bgColor === void 0) {
5573
+ bgColor = "ui.black";
5574
+ }
5575
+
5560
5576
  return _extends({}, secondaryBase, {
5561
5577
  heading: _extends({}, secondaryHeadingBase, {
5562
5578
  bg: bgColor,
@@ -5603,11 +5619,7 @@ var primary$1 = {
5603
5619
  }
5604
5620
  }
5605
5621
  };
5606
-
5607
- var secondary$1 = /*#__PURE__*/_extends({}, secondaryBase, {
5608
- heading: /*#__PURE__*/_extends({}, secondaryHeadingBase)
5609
- });
5610
-
5622
+ var secondary$1 = /*#__PURE__*/getSecondaryVariantStyles();
5611
5623
  var secondaryBooksAndMore = /*#__PURE__*/getSecondaryVariantStyles("section.books-and-more.primary");
5612
5624
  var secondaryLocations = /*#__PURE__*/getSecondaryVariantStyles("section.locations.primary");
5613
5625
  var secondaryResearch = /*#__PURE__*/getSecondaryVariantStyles("section.research.primary");
@@ -5711,18 +5723,22 @@ var fiftyFifty = {
5711
5723
  lg: "unset"
5712
5724
  }
5713
5725
  }),
5714
- img: {
5726
+ imgWrapper: {
5715
5727
  marginBottom: {
5716
5728
  base: "s",
5717
5729
  lg: "unset"
5718
5730
  },
5719
5731
  marginEnd: {
5732
+ base: "-15px",
5720
5733
  lg: "s"
5721
5734
  },
5735
+ marginStart: {
5736
+ base: "-15px"
5737
+ },
5722
5738
  maxWidth: {
5723
- base: "fit-content",
5724
5739
  lg: "50%"
5725
- }
5740
+ },
5741
+ width: "auto"
5726
5742
  }
5727
5743
  };
5728
5744
  var Hero = {
@@ -5898,18 +5914,18 @@ var baseUnorderedStyles = function baseUnorderedStyles(noStyling) {
5898
5914
  }
5899
5915
  });
5900
5916
  };
5901
- var baseSectionDefinitionStyles = {
5917
+ var baseSectionDescriptionStyles = {
5902
5918
  borderBottom: "1px solid",
5903
5919
  borderColor: "ui.gray.light-cool",
5904
5920
  paddingStart: "0",
5905
5921
  h2: {
5906
5922
  borderTop: "3px solid",
5907
- borderColor: "section.research.primary",
5923
+ borderColor: "ui.gray.medium",
5908
5924
  margin: "0",
5909
5925
  padding: "var(--nypl-space-xs) 0 0"
5910
5926
  }
5911
5927
  };
5912
- var baseDefinitionStyles = /*#__PURE__*/_extends({}, baseSectionDefinitionStyles, {
5928
+ var baseDescriptionStyles = /*#__PURE__*/_extends({}, baseSectionDescriptionStyles, {
5913
5929
  dl: {
5914
5930
  display: "grid",
5915
5931
  gridTemplateColumns: {
@@ -5959,7 +5975,7 @@ var List = {
5959
5975
  return baseUnorderedStyles(noStyling);
5960
5976
  },
5961
5977
  ol: textMargin,
5962
- dl: baseDefinitionStyles
5978
+ dl: baseDescriptionStyles
5963
5979
  }
5964
5980
  };
5965
5981
 
@@ -6876,10 +6892,10 @@ var StructuredContent = {
6876
6892
  }, baseUnorderedStyles()),
6877
6893
  ol: _extends({}, baseListStyles(), textMargin),
6878
6894
  // For section, h2 in the definition list.
6879
- section: baseSectionDefinitionStyles,
6880
- dl: baseDefinitionStyles.dl,
6881
- dt: baseDefinitionStyles.dt,
6882
- dd: baseDefinitionStyles.dd,
6895
+ section: baseSectionDescriptionStyles,
6896
+ dl: baseDescriptionStyles.dl,
6897
+ dt: baseDescriptionStyles.dt,
6898
+ dd: baseDescriptionStyles.dd,
6883
6899
  table: {
6884
6900
  width: "100%",
6885
6901
  th: _extends({
@@ -7617,7 +7633,8 @@ var Hero$1 = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props, ref)
7617
7633
  __css: styles.interior
7618
7634
  }, finalHeading, subHeaderText)) : React__default.createElement(React__default.Fragment, null, heroType !== "primary" && heroType !== "tertiary" && React__default.createElement(Image, {
7619
7635
  alt: imageProps.alt,
7620
- src: imageProps.src
7636
+ src: imageProps.src,
7637
+ __css: styles.imgWrapper
7621
7638
  }), finalHeading, heroType === "tertiary" && subHeaderText ? React__default.createElement("p", null, subHeaderText) : React__default.createElement(Box, {
7622
7639
  __css: styles.bodyText
7623
7640
  }, subHeaderText));
@@ -11216,7 +11233,7 @@ var SearchBar$1 = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props,
11216
11233
 
11217
11234
 
11218
11235
  var selectElem = selectProps && React__default.createElement(Select$1, Object.assign({
11219
- id: "searchbar-select-" + id,
11236
+ id: (selectProps == null ? void 0 : selectProps.id) || "searchbar-select-" + id,
11220
11237
  labelText: selectProps == null ? void 0 : selectProps.labelText,
11221
11238
  name: selectProps == null ? void 0 : selectProps.name,
11222
11239
  onChange: selectProps == null ? void 0 : selectProps.onChange,
@@ -11225,13 +11242,13 @@ var SearchBar$1 = /*#__PURE__*/chakra( /*#__PURE__*/forwardRef(function (props,
11225
11242
  __css: styles.select
11226
11243
  }, stateProps), selectProps == null ? void 0 : selectProps.optionsData.map(function (option) {
11227
11244
  return React__default.createElement("option", {
11228
- key: option,
11229
- value: option
11230
- }, option);
11245
+ key: option.value,
11246
+ value: option.value
11247
+ }, option.text);
11231
11248
  })); // Render the `TextInput` component.
11232
11249
 
11233
11250
  var textInputNative = textInputProps && React__default.createElement(TextInput, Object.assign({
11234
- id: "searchbar-textinput-" + id,
11251
+ id: (textInputProps == null ? void 0 : textInputProps.id) || "searchbar-textinput-" + id,
11235
11252
  labelText: textInputProps == null ? void 0 : textInputProps.labelText,
11236
11253
  name: textInputProps == null ? void 0 : textInputProps.name,
11237
11254
  onChange: textInputProps == null ? void 0 : textInputProps.onChange,