@nypl/design-system-react-components 0.25.9 → 0.25.10

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 (78) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/components/DatePicker/DatePicker.d.ts +1 -1
  3. package/dist/components/Fieldset/Fieldset.d.ts +1 -3
  4. package/dist/components/Form/Form.d.ts +13 -12
  5. package/dist/components/Form/FormTypes.d.ts +2 -2
  6. package/dist/components/HorizontalRule/HorizontalRule.d.ts +1 -1
  7. package/dist/components/RadioGroup/RadioGroup.d.ts +3 -3
  8. package/dist/components/SearchBar/SearchBar.d.ts +5 -5
  9. package/dist/components/Table/Table.d.ts +9 -3
  10. package/dist/components/Template/Template.d.ts +23 -4
  11. package/dist/design-system-react-components.cjs.development.js +197 -89
  12. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  13. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  14. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  15. package/dist/design-system-react-components.esm.js +186 -91
  16. package/dist/design-system-react-components.esm.js.map +1 -1
  17. package/dist/index.d.ts +4 -4
  18. package/dist/resources.scss +0 -2
  19. package/dist/theme/components/breadcrumb.d.ts +1 -1
  20. package/dist/theme/components/customTable.d.ts +12 -3
  21. package/package.json +40 -36
  22. package/src/components/Accordion/Accordion.stories.mdx +1 -1
  23. package/src/components/Accordion/Accordion.test.tsx +45 -1
  24. package/src/components/Accordion/Accordion.tsx +20 -8
  25. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +243 -0
  26. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +13 -2
  27. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +15 -0
  28. package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -3
  29. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +5 -5
  30. package/src/components/Card/Card.stories.mdx +1 -1
  31. package/src/components/Card/Card.tsx +4 -1
  32. package/src/components/Chakra/Flex.stories.mdx +113 -0
  33. package/src/components/DatePicker/DatePicker.stories.mdx +1 -1
  34. package/src/components/DatePicker/DatePicker.test.tsx +6 -6
  35. package/src/components/DatePicker/DatePicker.tsx +3 -4
  36. package/src/components/Fieldset/Fieldset.stories.mdx +1 -1
  37. package/src/components/Fieldset/Fieldset.tsx +2 -4
  38. package/src/components/Form/Form.stories.mdx +34 -16
  39. package/src/components/Form/Form.test.tsx +92 -3
  40. package/src/components/Form/Form.tsx +25 -21
  41. package/src/components/Form/FormTypes.tsx +2 -2
  42. package/src/components/Form/__snapshots__/Form.test.tsx.snap +0 -1
  43. package/src/components/Hero/Hero.stories.mdx +1 -1
  44. package/src/components/HorizontalRule/HorizontalRule.stories.mdx +3 -2
  45. package/src/components/HorizontalRule/HorizontalRule.tsx +2 -2
  46. package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +4 -4
  47. package/src/components/List/List.stories.mdx +1 -1
  48. package/src/components/List/List.tsx +1 -1
  49. package/src/components/Pagination/Pagination.stories.mdx +1 -1
  50. package/src/components/Pagination/Pagination.tsx +2 -2
  51. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +5 -5
  52. package/src/components/RadioGroup/RadioGroup.stories.mdx +1 -1
  53. package/src/components/RadioGroup/RadioGroup.test.tsx +13 -11
  54. package/src/components/RadioGroup/RadioGroup.tsx +88 -89
  55. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +18 -18
  56. package/src/components/SearchBar/SearchBar.Test.tsx +106 -28
  57. package/src/components/SearchBar/SearchBar.stories.mdx +7 -4
  58. package/src/components/SearchBar/SearchBar.tsx +19 -20
  59. package/src/components/Select/Select.test.tsx +89 -0
  60. package/src/components/Select/Select.tsx +7 -1
  61. package/src/components/Select/__snapshots__/Select.test.tsx.snap +545 -0
  62. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +7 -0
  63. package/src/components/Table/Table.stories.mdx +118 -19
  64. package/src/components/Table/Table.test.tsx +80 -3
  65. package/src/components/Table/Table.tsx +26 -16
  66. package/src/components/Table/__snapshots__/Table.test.tsx.snap +1179 -0
  67. package/src/components/Tabs/Tabs.stories.mdx +1 -1
  68. package/src/components/Tabs/Tabs.test.tsx +21 -5
  69. package/src/components/Tabs/Tabs.tsx +33 -18
  70. package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +195 -0
  71. package/src/components/Template/Template.stories.mdx +79 -4
  72. package/src/components/Template/Template.test.tsx +65 -3
  73. package/src/components/Template/Template.tsx +58 -8
  74. package/src/components/Template/__snapshots__/Template.test.tsx.snap +93 -0
  75. package/src/index.ts +8 -2
  76. package/src/theme/components/breadcrumb.ts +1 -1
  77. package/src/theme/components/customTable.ts +16 -3
  78. package/src/utils/componentCategories.ts +1 -0
@@ -1163,13 +1163,14 @@ function Icon(props) {
1163
1163
  * is open or closed.
1164
1164
  */
1165
1165
 
1166
- var getIcon = function getIcon(isExpanded) {
1166
+ var getIcon = function getIcon(isExpanded, index, id) {
1167
1167
  if (isExpanded === void 0) {
1168
1168
  isExpanded = false;
1169
1169
  }
1170
1170
 
1171
1171
  var iconName = isExpanded ? exports.IconNames.Minus : exports.IconNames.Plus;
1172
1172
  return React.createElement(Icon, {
1173
+ id: "accordion-" + id + "-icon-" + index,
1173
1174
  name: iconName,
1174
1175
  size: exports.IconSizes.Small
1175
1176
  });
@@ -1181,7 +1182,7 @@ var getIcon = function getIcon(isExpanded) {
1181
1182
  */
1182
1183
 
1183
1184
 
1184
- var getElementsFromContentData = function getElementsFromContentData(data) {
1185
+ var getElementsFromContentData = function getElementsFromContentData(data, id) {
1185
1186
  var _data;
1186
1187
 
1187
1188
  if (data === void 0) {
@@ -1194,23 +1195,27 @@ var getElementsFromContentData = function getElementsFromContentData(data) {
1194
1195
  return data.map(function (content, index) {
1195
1196
  // This is done to support both string and DOM element input.
1196
1197
  var panel = typeof content.panel === "string" ? React.createElement(react.AccordionPanel, {
1198
+ id: id + "-panel-" + index,
1197
1199
  key: index,
1198
1200
  dangerouslySetInnerHTML: {
1199
1201
  __html: content.panel
1200
1202
  }
1201
1203
  }) : React.createElement(react.AccordionPanel, {
1204
+ id: id + "-panel-" + index,
1202
1205
  key: index
1203
1206
  }, content.panel);
1204
1207
  return React.createElement(react.AccordionItem, {
1208
+ id: id + "-item-" + index,
1205
1209
  key: index
1206
1210
  }, function (_ref) {
1207
1211
  var isExpanded = _ref.isExpanded;
1208
1212
  return React.createElement(React.Fragment, null, React.createElement(react.AccordionButton, {
1213
+ id: id + "-button-" + index,
1209
1214
  padding: multiplePadding
1210
1215
  }, React.createElement(react.Box, {
1211
1216
  flex: "1",
1212
1217
  textAlign: "left"
1213
- }, content.label), getIcon(isExpanded)), panel);
1218
+ }, content.label), getIcon(isExpanded, index, id)), panel);
1214
1219
  });
1215
1220
  });
1216
1221
  };
@@ -1232,7 +1237,7 @@ function Accordion(props) {
1232
1237
  id: id,
1233
1238
  defaultIndex: [openFirstAccordion],
1234
1239
  allowMultiple: true
1235
- }, getElementsFromContentData(contentData));
1240
+ }, getElementsFromContentData(contentData, id));
1236
1241
  }
1237
1242
 
1238
1243
  (function (ColorVariants) {
@@ -1329,11 +1334,15 @@ function Breadcrumbs(props) {
1329
1334
  var finalStyles = _extends({}, styles, additionalStyles);
1330
1335
 
1331
1336
  var breadcrumbItems = getElementsFromData(breadcrumbsData, id);
1332
- return React.createElement(react.Breadcrumb, {
1337
+ var ariaAttrs = {
1338
+ "aria-label": "Breadcrumb"
1339
+ };
1340
+ return React.createElement(react.Breadcrumb, Object.assign({
1333
1341
  className: className,
1334
- __css: finalStyles,
1335
1342
  id: id
1336
- }, breadcrumbItems);
1343
+ }, ariaAttrs, {
1344
+ __css: finalStyles
1345
+ }), breadcrumbItems);
1337
1346
  }
1338
1347
 
1339
1348
  (function (ButtonTypes) {
@@ -1868,7 +1877,7 @@ function Card(props) {
1868
1877
  mainActionLink: mainActionLink
1869
1878
  }, child.props.children) : child.props.children;
1870
1879
  var elem = React.cloneElement(child, {
1871
- additionalStyles: styles.heading,
1880
+ additionalStyles: _extends({}, styles.heading, child.props.additionalStyles),
1872
1881
  key: key,
1873
1882
  center: center,
1874
1883
  // Override the child text with the potential `CardLinkOverlay`.
@@ -2286,9 +2295,15 @@ function FormRow(props) {
2286
2295
  var count = React.Children.count(children);
2287
2296
  var alteredChildren = React.Children.map(children, function (child, i) {
2288
2297
  if (!child) return null;
2289
- return React.cloneElement(child, {
2290
- id: id + "-grandchild" + i
2291
- });
2298
+
2299
+ if (child.type === FormField || child.props.mdxType === "FormField") {
2300
+ return React.cloneElement(child, {
2301
+ id: id + "-grandchild" + i
2302
+ });
2303
+ }
2304
+
2305
+ console.warn("FormRow children must be `FormField` components.");
2306
+ return null;
2292
2307
  });
2293
2308
  return React.createElement(SimpleGrid, {
2294
2309
  columns: count,
@@ -2317,29 +2332,29 @@ function Form(props) {
2317
2332
  var action = props.action,
2318
2333
  children = props.children,
2319
2334
  className = props.className,
2335
+ _props$gap = props.gap,
2336
+ gap = _props$gap === void 0 ? exports.GridGaps.Large : _props$gap,
2320
2337
  _props$id = props.id,
2321
2338
  id = _props$id === void 0 ? generateUUID() : _props$id,
2322
2339
  method = props.method,
2323
- _props$spacing = props.spacing,
2324
- spacing = _props$spacing === void 0 ? exports.GridGaps.Large : _props$spacing;
2340
+ onSubmit = props.onSubmit;
2325
2341
  var attributes = {};
2326
2342
  action && (attributes["action"] = action);
2327
2343
  method && (method === "get" || method === "post") && (attributes["method"] = method);
2328
2344
  var alteredChildren = React.Children.map(children, function (child, i) {
2329
2345
  return React.cloneElement(child, {
2330
- gap: spacing,
2346
+ gap: gap,
2331
2347
  id: id + "-child" + i
2332
2348
  });
2333
2349
  });
2334
- return React.createElement(react.Box, Object.assign({
2335
- as: "form",
2350
+ return React.createElement("form", Object.assign({
2336
2351
  "aria-label": "form",
2337
- id: id
2338
- }, attributes, {
2339
- className: className
2340
- }), React.createElement(SimpleGrid, {
2352
+ className: className,
2353
+ id: id,
2354
+ onSubmit: onSubmit
2355
+ }, attributes), React.createElement(SimpleGrid, {
2341
2356
  columns: 1,
2342
- gap: spacing,
2357
+ gap: gap,
2343
2358
  id: id + "-parent"
2344
2359
  }, alteredChildren));
2345
2360
  }
@@ -3312,7 +3327,7 @@ var Breadcrumb = {
3312
3327
  marginInlineStart: "xxs"
3313
3328
  }
3314
3329
  },
3315
- "li:nth-last-child(2)": {
3330
+ "li:nth-last-of-type(2)": {
3316
3331
  display: "inline-block",
3317
3332
  span: {
3318
3333
  display: {
@@ -5415,6 +5430,15 @@ var baseStyle$3 = function baseStyle(_ref) {
5415
5430
  showRowDividers = _ref.showRowDividers,
5416
5431
  useRowHeaders = _ref.useRowHeaders;
5417
5432
  return {
5433
+ // Headers `th` can be rendered as the first cell in every row through the
5434
+ // `useRowHeaders`. Whereas the header `th` in the `thead` can be rendered
5435
+ // with a custom color, the row header `th` in the `tbody` should always
5436
+ // have text color black.
5437
+ tbody: {
5438
+ th: {
5439
+ color: "var(--nypl-colors-ui-black)"
5440
+ }
5441
+ },
5418
5442
  th: {
5419
5443
  border: showRowDividers ? undefined : "none",
5420
5444
  borderBottom: showRowDividers ? undefined : "0px",
@@ -5447,11 +5471,15 @@ var baseStyle$3 = function baseStyle(_ref) {
5447
5471
  },
5448
5472
  caption: {
5449
5473
  captionSide: "top",
5450
- textAlign: "left",
5451
- fontSize: "heading.secondary",
5452
5474
  color: "ui.black",
5453
- textTransform: "capitalize",
5454
- fontWeight: "heading.secondary"
5475
+ fontSize: "heading.secondary",
5476
+ fontWeight: "heading.secondary",
5477
+ marginBottom: "s",
5478
+ marginLeft: "0",
5479
+ marginRight: "0",
5480
+ marginTop: "0",
5481
+ padding: "0",
5482
+ textAlign: "left"
5455
5483
  }
5456
5484
  };
5457
5485
  };
@@ -6002,7 +6030,7 @@ function HorizontalRule$1(props) {
6002
6030
  _props$height = props.height,
6003
6031
  height = _props$height === void 0 ? "2px" : _props$height,
6004
6032
  _props$width = props.width,
6005
- width = _props$width === void 0 ? "auto" : _props$width;
6033
+ width = _props$width === void 0 ? "100%" : _props$width;
6006
6034
  var styles = react.useStyleConfig("HorizontalRule", {
6007
6035
  align: align
6008
6036
  });
@@ -6114,7 +6142,7 @@ function List$1(props) {
6114
6142
  React.Children.map(children, function (child) {
6115
6143
  var _child$props;
6116
6144
 
6117
- if ((child == null ? void 0 : child.type) !== "li" && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.mdxType) !== "li") {
6145
+ if (child && (child == null ? void 0 : child.type) !== "li" && (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.mdxType) !== "li") {
6118
6146
  console.warn("Direct children of `List` (" + listType + ") should be `<li>`s.");
6119
6147
  }
6120
6148
  });
@@ -7032,8 +7060,7 @@ var Pagination$1 = function Pagination(props) {
7032
7060
  id = _props$id === void 0 ? generateUUID() : _props$id,
7033
7061
  _props$initialPage = props.initialPage,
7034
7062
  initialPage = _props$initialPage === void 0 ? 1 : _props$initialPage,
7035
- _props$onPageChange = props.onPageChange,
7036
- onPageChange = _props$onPageChange === void 0 ? function () {} : _props$onPageChange,
7063
+ onPageChange = props.onPageChange,
7037
7064
  pageCount = props.pageCount;
7038
7065
 
7039
7066
  var _useState = React.useState(initialPage),
@@ -7063,7 +7090,7 @@ var Pagination$1 = function Pagination(props) {
7063
7090
  e.preventDefault && e.preventDefault();
7064
7091
  if (currentPage === selectedPage) return;
7065
7092
  setCurrentPage(selectedPage);
7066
- onPageChange(selectedPage);
7093
+ onPageChange && onPageChange(selectedPage);
7067
7094
  }; // Select the previous page.
7068
7095
 
7069
7096
 
@@ -7428,16 +7455,16 @@ var RadioGroup$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
7428
7455
 
7429
7456
  var styles = react.useMultiStyleConfig("RadioGroup", {});
7430
7457
  return React.createElement(Fieldset, {
7431
- id: "radio-group-" + id,
7432
7458
  className: className,
7459
+ id: "radio-group-" + id,
7433
7460
  isLegendHidden: !showLabel,
7434
7461
  legendText: labelText,
7435
7462
  optReqFlag: optReqFlag
7436
7463
  }, React.createElement(react.Stack, Object.assign({
7464
+ "aria-label": !showLabel ? labelText : null,
7437
7465
  direction: [layout],
7438
7466
  spacing: spacingProp,
7439
- ref: ref,
7440
- "aria-label": !showLabel ? labelText : null
7467
+ ref: ref
7441
7468
  }, radioGroupProps, {
7442
7469
  sx: styles.stack
7443
7470
  }), newChildren), footnote && showHelperInvalidText && React.createElement(react.Box, {
@@ -7605,6 +7632,7 @@ var Select$1 = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
7605
7632
  ref: ref
7606
7633
  }, controlledProps, ariaAttributes, {
7607
7634
  icon: React__default.createElement(Icon, {
7635
+ id: id + "-icon",
7608
7636
  name: exports.IconNames.Arrow,
7609
7637
  size: exports.IconSizes.Medium
7610
7638
  }),
@@ -7660,8 +7688,6 @@ function SearchBar$1(props) {
7660
7688
  showHelperInvalidText: false,
7661
7689
  showLabel: false
7662
7690
  };
7663
- var helperErrorTextID = generateUUID();
7664
- var ariaDescribedby = helperErrorTextID;
7665
7691
  var footnote = isInvalid ? invalidText : helperText;
7666
7692
  var finalAriaLabel = footnote ? labelText + " - " + footnote : labelText;
7667
7693
  var textInputPlaceholder = (textInputProps == null ? void 0 : textInputProps.placeholder) + " " + (isRequired ? "(Required)" : "");
@@ -7677,9 +7703,10 @@ function SearchBar$1(props) {
7677
7703
  }; // Render the `Select` component.
7678
7704
 
7679
7705
  var selectElem = selectProps && React.createElement(Select$1, Object.assign({
7680
- id: generateUUID(),
7681
- name: selectProps == null ? void 0 : selectProps.name,
7706
+ id: "searchbar-select-" + id,
7682
7707
  labelText: selectProps == null ? void 0 : selectProps.labelText,
7708
+ name: selectProps == null ? void 0 : selectProps.name,
7709
+ onChange: selectProps == null ? void 0 : selectProps.onChange,
7683
7710
  type: SelectTypes.SearchBar
7684
7711
  }, stateProps), selectProps == null ? void 0 : selectProps.optionsData.map(function (option) {
7685
7712
  return React.createElement("option", {
@@ -7689,11 +7716,11 @@ function SearchBar$1(props) {
7689
7716
  })); // Render the `TextInput` component.
7690
7717
 
7691
7718
  var textInputNative = textInputProps && React.createElement(TextInput, Object.assign({
7692
- id: generateUUID(),
7719
+ id: "searchbar-textinput-" + id,
7693
7720
  labelText: textInputProps == null ? void 0 : textInputProps.labelText,
7694
- placeholder: textInputPlaceholder,
7695
- onChange: textInputProps == null ? void 0 : textInputProps.onChange,
7696
7721
  name: textInputProps == null ? void 0 : textInputProps.name,
7722
+ onChange: textInputProps == null ? void 0 : textInputProps.onChange,
7723
+ placeholder: textInputPlaceholder,
7697
7724
  type: exports.TextInputTypes.text,
7698
7725
  variantType: selectElem ? TextInputVariants.SearchBarSelect : TextInputVariants.SearchBar,
7699
7726
  value: textInputProps == null ? void 0 : textInputProps.value
@@ -7702,16 +7729,17 @@ function SearchBar$1(props) {
7702
7729
  var buttonElem = React.createElement(Button, {
7703
7730
  additionalStyles: searchBarButtonStyles,
7704
7731
  buttonType: buttonType,
7705
- id: generateUUID(),
7732
+ id: "searchbar-button-" + id,
7706
7733
  isDisabled: isDisabled,
7707
7734
  onClick: buttonOnClick,
7708
7735
  type: "submit"
7709
7736
  }, React.createElement(Icon, {
7737
+ align: exports.IconAlign.Left,
7738
+ id: "searchbar-icon-" + id,
7710
7739
  name: exports.IconNames.Search,
7711
- size: exports.IconSizes.Small,
7712
- align: exports.IconAlign.Left
7713
- }), "Search"); // If a custom input element was passed, use that instead of the
7714
- // `TextInput` component.
7740
+ size: exports.IconSizes.Small
7741
+ }), "Search"); // If a custom input element was passed, use that element
7742
+ // instead of the DS `TextInput` component.
7715
7743
 
7716
7744
  var textInputElem = textInputElement || textInputNative;
7717
7745
  return React.createElement(ComponentWrapper$1, {
@@ -7723,11 +7751,10 @@ function SearchBar$1(props) {
7723
7751
  isInvalid: isInvalid
7724
7752
  }, React.createElement(react.Box, {
7725
7753
  as: "form",
7726
- id: id + "-form",
7754
+ id: "searchbar-form-" + id,
7727
7755
  className: className,
7728
7756
  role: "search",
7729
7757
  "aria-label": finalAriaLabel,
7730
- "aria-describedby": ariaDescribedby,
7731
7758
  onSubmit: onSubmit,
7732
7759
  method: method,
7733
7760
  action: action,
@@ -8291,11 +8318,14 @@ var getElementsFromContentData$1 = function getElementsFromContentData(data, use
8291
8318
  var panels = [];
8292
8319
 
8293
8320
  if (!(data != null && data.length)) {
8294
- return {};
8321
+ return {
8322
+ tabs: [],
8323
+ panels: []
8324
+ };
8295
8325
  }
8296
8326
 
8297
8327
  if ((data == null ? void 0 : data.length) > 6) {
8298
- console.warn("We recommend to use no more than six tabs. If more than six tabs are " + "needed, consider other navigational patterns.");
8328
+ console.warn("Tabs: We recommend to use no more than six tabs. If more than six tabs " + "are needed, consider other navigational patterns.");
8299
8329
  }
8300
8330
 
8301
8331
  data.forEach(function (tab, index) {
@@ -8311,10 +8341,10 @@ var getElementsFromContentData$1 = function getElementsFromContentData(data, use
8311
8341
 
8312
8342
  if (typeof tab.content === "string") {
8313
8343
  tempPanel = React.createElement(react.TabPanel, {
8314
- key: index,
8315
8344
  dangerouslySetInnerHTML: {
8316
8345
  __html: tab.content
8317
- }
8346
+ },
8347
+ key: index
8318
8348
  });
8319
8349
  } else {
8320
8350
  tempPanel = React.createElement(react.TabPanel, {
@@ -8341,7 +8371,10 @@ var getElementsFromChildren = function getElementsFromChildren(children) {
8341
8371
  var panels = [];
8342
8372
 
8343
8373
  if (!(children != null && children.length)) {
8344
- return {};
8374
+ return {
8375
+ tabs: [],
8376
+ panels: []
8377
+ };
8345
8378
  }
8346
8379
 
8347
8380
  children.forEach(function (child) {
@@ -8350,7 +8383,7 @@ var getElementsFromChildren = function getElementsFromChildren(children) {
8350
8383
  var childTabs = React.Children.count(child.props.children);
8351
8384
 
8352
8385
  if (childTabs > 6) {
8353
- console.warn("We recommend to use no more than six tabs. If more than six tabs are " + "needed, consider other navigational patterns.");
8386
+ console.warn("Tabs: We recommend to use no more than six tabs. If more than six " + "tabs are needed, consider other navigational patterns.");
8354
8387
  }
8355
8388
  }
8356
8389
 
@@ -8395,7 +8428,11 @@ function Tabs(props) {
8395
8428
 
8396
8429
  var _ref = contentData ? getElementsFromContentData$1(contentData, useHash) : getElementsFromChildren(children),
8397
8430
  tabs = _ref.tabs,
8398
- panels = _ref.panels; // `tabs` is an array for the children component approach but an object for
8431
+ panels = _ref.panels;
8432
+
8433
+ if (!tabs.length || !panels.length) {
8434
+ console.warn("Tabs: Pass data in the `data` props or as children.");
8435
+ } // `tabs` is an array for the children component approach but an object for
8399
8436
  // the `contentData` prop approach. We need to get the right props key value
8400
8437
  // to set the carousel's length.
8401
8438
 
@@ -8421,43 +8458,47 @@ function Tabs(props) {
8421
8458
  }
8422
8459
  }, [goToStart, windowDimensions.width]);
8423
8460
  var previousButton = React.createElement(Button, {
8424
- buttonType: exports.ButtonTypes.Primary,
8425
8461
  attributes: _extends({
8426
8462
  "aria-label": "Previous"
8427
8463
  }, styles.buttonArrows, {
8428
8464
  left: "0"
8429
8465
  }),
8466
+ buttonType: exports.ButtonTypes.Primary,
8467
+ id: "tabs-previous-" + id,
8430
8468
  onClick: prevSlide
8431
8469
  }, React.createElement(Icon, {
8432
- name: exports.IconNames.Arrow,
8433
8470
  iconRotation: exports.IconRotationTypes.Rotate90,
8471
+ id: "tabs-previous-icon-" + id,
8472
+ name: exports.IconNames.Arrow,
8434
8473
  size: exports.IconSizes.Small
8435
8474
  }));
8436
8475
  var nextButton = React.createElement(Button, {
8437
- buttonType: exports.ButtonTypes.Primary,
8438
8476
  attributes: _extends({
8439
8477
  "aria-label": "Next"
8440
8478
  }, styles.buttonArrows, {
8441
8479
  right: "0"
8442
8480
  }),
8481
+ buttonType: exports.ButtonTypes.Primary,
8482
+ id: "tabs-next-" + id,
8443
8483
  onClick: nextSlide
8444
8484
  }, React.createElement(Icon, {
8445
- name: exports.IconNames.Arrow,
8446
8485
  iconRotation: exports.IconRotationTypes.Rotate270,
8486
+ id: "tabs-next-icon-" + id,
8487
+ name: exports.IconNames.Arrow,
8447
8488
  size: exports.IconSizes.Small
8448
8489
  }));
8449
8490
 
8450
8491
  if (children && contentData != null && contentData.length) {
8451
- console.warn("Only pass children or data in the `data` props but not both.");
8492
+ console.warn("Tabs: Only pass children or data in the `data` props but not both.");
8452
8493
  }
8453
8494
 
8454
8495
  return React.createElement(react.Tabs, {
8455
- id: id,
8456
- onChange: onChange,
8457
8496
  defaultIndex: defaultIndex,
8458
- variant: "enclosed",
8497
+ id: id,
8459
8498
  // The following lazy loads each panel whenever it is needed.
8460
- isLazy: true
8499
+ isLazy: true,
8500
+ onChange: onChange,
8501
+ variant: "enclosed"
8461
8502
  }, React.createElement(react.Box, {
8462
8503
  __css: styles.tablistWrapper,
8463
8504
  sx: {
@@ -8483,18 +8524,57 @@ var Template$1 = function Template(props) {
8483
8524
  }, props.children);
8484
8525
  };
8485
8526
  /**
8486
- * This optional component should be the first child of the `Template`
8487
- * component. This is rendered as an HTML `<header>` element.
8527
+ * This optional component renders its children from edge-to-edge and should
8528
+ * be used for alerts or notifications that are typically site-wide. This must
8529
+ * be rendered immediately before the `TemplateHeader` component. This is meant
8530
+ * for components that render an `aside` HTML element or HTML element with the
8531
+ * `role="complementary"` attribute. These elements should *not* be rendered
8532
+ * in the `header` HTML section since that's an accessibility violation.
8488
8533
  */
8489
8534
 
8490
8535
 
8491
- var TemplateHeader$1 = function TemplateHeader(props) {
8492
- var styles = react.useStyleConfig("TemplateHeader", {});
8536
+ var TemplateAboveHeader = function TemplateAboveHeader(props) {
8537
+ var styles = react.useStyleConfig("TemplateBreakout", {});
8493
8538
  return React.createElement(react.Box, {
8494
- as: "header",
8495
8539
  __css: styles
8496
8540
  }, props.children);
8497
8541
  };
8542
+ /**
8543
+ * This optional component should be the first child of the `Template`
8544
+ * component. This is rendered as an HTML `<header>` element. If an HTML
8545
+ * `<header>` element is already passed in a custom component as the children,
8546
+ * set `renderFooterElement` to `false`. Otherwise, the parent wrapper will
8547
+ * render an HTML `<header>` element.
8548
+ */
8549
+
8550
+
8551
+ var TemplateHeader$1 = function TemplateHeader(_ref) {
8552
+ var children = _ref.children,
8553
+ _ref$renderHeaderElem = _ref.renderHeaderElement,
8554
+ renderHeaderElement = _ref$renderHeaderElem === void 0 ? true : _ref$renderHeaderElem;
8555
+ var styles = react.useStyleConfig("TemplateHeader", {});
8556
+ var headerElement = React.createElement(react.Box, {
8557
+ __css: styles
8558
+ }, children); // The user wants to render the `header` HTML element.
8559
+
8560
+ if (renderHeaderElement) {
8561
+ // But if they passed in a component that renders an HTML `<header>`,
8562
+ // then log a warning.
8563
+ React.Children.map(children, function (child) {
8564
+ var _child$props;
8565
+
8566
+ if ((child == null ? void 0 : child.type) === "header" || (child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.mdxType) === "header") {
8567
+ console.warn("`TemplateHeader`: An HTML `header` element was passed in. Set " + "`renderHeaderElement` to `false` to avoid nested HTML `header` elements.");
8568
+ }
8569
+ });
8570
+ headerElement = React.createElement(react.Box, {
8571
+ as: "header",
8572
+ __css: styles
8573
+ }, children);
8574
+ }
8575
+
8576
+ return headerElement;
8577
+ };
8498
8578
  /**
8499
8579
  * This optional component should be used inside the `TemplateHeader` component.
8500
8580
  * This is meant to render its children from edge to edge and is most useful
@@ -8528,11 +8608,11 @@ var TemplateContent$1 = function TemplateContent(props) {
8528
8608
  // `TemplateContentSidebar` components.
8529
8609
 
8530
8610
  var newChildren = React.Children.map(children, function (child) {
8531
- var _child$props, _child$props2;
8611
+ var _child$props2, _child$props3;
8532
8612
 
8533
8613
  var newChild = child;
8534
8614
 
8535
- if (child && (child == null ? void 0 : child.type) === TemplateContentPrimary$1 || child != null && child.props && ((_child$props = child.props) == null ? void 0 : _child$props.mdxType) === "TemplateContentPrimary" || (child == null ? void 0 : child.type) === TemplateContentSidebar$1 || child != null && child.props && ((_child$props2 = child.props) == null ? void 0 : _child$props2.mdxType) === "TemplateContentSidebar") {
8615
+ if (child && (child == null ? void 0 : child.type) === TemplateContentPrimary$1 || child != null && child.props && ((_child$props2 = child.props) == null ? void 0 : _child$props2.mdxType) === "TemplateContentPrimary" || (child == null ? void 0 : child.type) === TemplateContentSidebar$1 || child != null && child.props && ((_child$props3 = child.props) == null ? void 0 : _child$props3.mdxType) === "TemplateContentSidebar") {
8536
8616
  newChild = React.cloneElement(child, {
8537
8617
  sidebar: sidebar
8538
8618
  });
@@ -8607,18 +8687,18 @@ var TemplateContentSidebar$1 = function TemplateContentSidebar(props) {
8607
8687
  */
8608
8688
 
8609
8689
 
8610
- var TemplateFooter = function TemplateFooter(_ref) {
8611
- var children = _ref.children,
8612
- _ref$renderFooterElem = _ref.renderFooterElement,
8613
- renderFooterElement = _ref$renderFooterElem === void 0 ? true : _ref$renderFooterElem;
8690
+ var TemplateFooter = function TemplateFooter(_ref2) {
8691
+ var children = _ref2.children,
8692
+ _ref2$renderFooterEle = _ref2.renderFooterElement,
8693
+ renderFooterElement = _ref2$renderFooterEle === void 0 ? true : _ref2$renderFooterEle;
8614
8694
  var footerElement = React.createElement(React.Fragment, null, children); // The user wants to render the `footer` HTML element.
8615
8695
 
8616
8696
  if (renderFooterElement) {
8617
8697
  // But give a warning if one was passed.
8618
8698
  React.Children.map(children, function (child) {
8619
- var _child$props3;
8699
+ var _child$props4;
8620
8700
 
8621
- if ((child == null ? void 0 : child.type) === "footer" || (child == null ? void 0 : (_child$props3 = child.props) == null ? void 0 : _child$props3.mdxType) === "footer") {
8701
+ if ((child == null ? void 0 : child.type) === "footer" || (child == null ? void 0 : (_child$props4 = child.props) == null ? void 0 : _child$props4.mdxType) === "footer") {
8622
8702
  console.warn("`TemplateFooter`: An HTML `footer` element was passed in. Set " + "`renderFooterElement` to `false` to avoid nested HTML `footer` elements.");
8623
8703
  }
8624
8704
  });
@@ -8639,7 +8719,8 @@ var TemplateFooter = function TemplateFooter(_ref) {
8639
8719
 
8640
8720
 
8641
8721
  var TemplateAppContainer = function TemplateAppContainer(props) {
8642
- var breakout = props.breakout,
8722
+ var aboveHeader = props.aboveHeader,
8723
+ breakout = props.breakout,
8643
8724
  contentPrimary = props.contentPrimary,
8644
8725
  contentSidebar = props.contentSidebar,
8645
8726
  contentTop = props.contentTop,
@@ -8648,12 +8729,17 @@ var TemplateAppContainer = function TemplateAppContainer(props) {
8648
8729
  _props$sidebar2 = props.sidebar,
8649
8730
  sidebar = _props$sidebar2 === void 0 ? "none" : _props$sidebar2,
8650
8731
  _props$renderFooterEl = props.renderFooterElement,
8651
- renderFooterElement = _props$renderFooterEl === void 0 ? true : _props$renderFooterEl;
8732
+ renderFooterElement = _props$renderFooterEl === void 0 ? true : _props$renderFooterEl,
8733
+ _props$renderHeaderEl = props.renderHeaderElement,
8734
+ renderHeaderElement = _props$renderHeaderEl === void 0 ? true : _props$renderHeaderEl;
8735
+ var aboveHeaderElem = aboveHeader && React.createElement(TemplateAboveHeader, null, aboveHeader);
8652
8736
  var breakoutElem = breakout && React.createElement(TemplateBreakout$1, null, breakout);
8653
8737
  var contentTopElem = contentTop && React.createElement(TemplateContentTop$1, null, contentTop);
8654
8738
  var contentPrimaryElem = contentPrimary && React.createElement(TemplateContentPrimary$1, null, contentPrimary);
8655
8739
  var contentSidebarElem = contentSidebar && React.createElement(TemplateContentSidebar$1, null, contentSidebar);
8656
- return React.createElement(Template$1, null, (header || breakoutElem) && React.createElement(TemplateHeader$1, null, header, breakoutElem), React.createElement(TemplateContent$1, {
8740
+ return React.createElement(Template$1, null, aboveHeaderElem, (header || breakoutElem) && React.createElement(TemplateHeader$1, {
8741
+ renderHeaderElement: renderHeaderElement
8742
+ }, header, breakoutElem), React.createElement(TemplateContent$1, {
8657
8743
  sidebar: sidebar
8658
8744
  }, contentTopElem, sidebar === "left" && contentSidebarElem, contentPrimaryElem, sidebar === "right" && contentSidebarElem), footer && React.createElement(TemplateFooter, {
8659
8745
  renderFooterElement: renderFooterElement
@@ -8881,6 +8967,11 @@ function VideoPlayer$1(props) {
8881
8967
  }, embedElement)));
8882
8968
  }
8883
8969
 
8970
+ /**
8971
+ * Basic `Table` component used to organize and display tabular data in
8972
+ * rows and columns.
8973
+ */
8974
+
8884
8975
  function Table(props) {
8885
8976
  var className = props.className,
8886
8977
  columnHeaders = props.columnHeaders,
@@ -8888,12 +8979,12 @@ function Table(props) {
8888
8979
  columnHeadersTextColor = props.columnHeadersTextColor,
8889
8980
  _props$id = props.id,
8890
8981
  id = _props$id === void 0 ? generateUUID() : _props$id,
8891
- _props$useRowHeaders = props.useRowHeaders,
8892
- useRowHeaders = _props$useRowHeaders === void 0 ? false : _props$useRowHeaders,
8893
8982
  _props$showRowDivider = props.showRowDividers,
8894
8983
  showRowDividers = _props$showRowDivider === void 0 ? false : _props$showRowDivider,
8895
8984
  tableData = props.tableData,
8896
- titleText = props.titleText;
8985
+ titleText = props.titleText,
8986
+ _props$useRowHeaders = props.useRowHeaders,
8987
+ useRowHeaders = _props$useRowHeaders === void 0 ? false : _props$useRowHeaders;
8897
8988
  var customColors = {};
8898
8989
  columnHeadersBackgroundColor && (customColors["backgroundColor"] = columnHeadersBackgroundColor);
8899
8990
  columnHeadersTextColor && (customColors["color"] = columnHeadersTextColor);
@@ -8902,18 +8993,23 @@ function Table(props) {
8902
8993
  showRowDividers: showRowDividers,
8903
8994
  useRowHeaders: useRowHeaders
8904
8995
  });
8905
- var columnHeadersElems = columnHeaders && React.createElement(react.Thead, null, React.createElement(react.Tr, null, columnHeaders.map(function (child, key) {
8996
+ var tableCaption = titleText && React.createElement(react.TableCaption, null, titleText);
8997
+ var columnHeadersElems = (columnHeaders == null ? void 0 : columnHeaders.length) > 0 && React.createElement(react.Thead, null, React.createElement(react.Tr, null, columnHeaders.map(function (child, key) {
8906
8998
  return React.createElement(react.Th, {
8907
- scope: "col",
8908
8999
  key: key,
9000
+ scope: "col",
8909
9001
  sx: customColors
8910
9002
  }, child);
8911
9003
  })));
9004
+ /**
9005
+ * This renders a normal `tbody` DOM element structure if the `tableData`
9006
+ * passed is a two-dimensional array. This is to render the appropriate
9007
+ * row and column structure for a table.
9008
+ */
8912
9009
 
8913
9010
  var tableBodyElems = function tableBodyElems() {
8914
- /** tableData value should be two dimensional array */
8915
9011
  if (!Array.isArray(tableData) || tableData.length <= 0 || tableData[0].constructor !== Array) {
8916
- console.warn("Table data should be two dimensional array.");
9012
+ console.warn("Table: data should be two dimensional array.");
8917
9013
  return null;
8918
9014
  }
8919
9015
 
@@ -8931,7 +9027,6 @@ function Table(props) {
8931
9027
  }));
8932
9028
  };
8933
9029
 
8934
- var tableCaption = titleText && React.createElement(react.TableCaption, null, titleText);
8935
9030
  return React.createElement(react.Table, {
8936
9031
  id: id,
8937
9032
  sx: styles,
@@ -8963,6 +9058,12 @@ Object.defineProperty(exports, 'Circle', {
8963
9058
  return react.Circle;
8964
9059
  }
8965
9060
  });
9061
+ Object.defineProperty(exports, 'Flex', {
9062
+ enumerable: true,
9063
+ get: function () {
9064
+ return react.Flex;
9065
+ }
9066
+ });
8966
9067
  Object.defineProperty(exports, 'Grid', {
8967
9068
  enumerable: true,
8968
9069
  get: function () {
@@ -8981,6 +9082,12 @@ Object.defineProperty(exports, 'HStack', {
8981
9082
  return react.HStack;
8982
9083
  }
8983
9084
  });
9085
+ Object.defineProperty(exports, 'Spacer', {
9086
+ enumerable: true,
9087
+ get: function () {
9088
+ return react.Spacer;
9089
+ }
9090
+ });
8984
9091
  Object.defineProperty(exports, 'Square', {
8985
9092
  enumerable: true,
8986
9093
  get: function () {
@@ -9037,8 +9144,8 @@ exports.DatePicker = DatePicker;
9037
9144
  exports.Fieldset = Fieldset;
9038
9145
  exports.Form = Form;
9039
9146
  exports.FormField = FormField;
9147
+ exports.FormGaps = exports.GridGaps;
9040
9148
  exports.FormRow = FormRow;
9041
- exports.FormSpacing = exports.GridGaps;
9042
9149
  exports.Heading = Heading;
9043
9150
  exports.HelperErrorText = HelperErrorText;
9044
9151
  exports.Hero = Hero$1;
@@ -9065,6 +9172,7 @@ exports.StructuredContent = StructuredContent$1;
9065
9172
  exports.Table = Table;
9066
9173
  exports.Tabs = Tabs;
9067
9174
  exports.Template = Template$1;
9175
+ exports.TemplateAboveHeader = TemplateAboveHeader;
9068
9176
  exports.TemplateAppContainer = TemplateAppContainer;
9069
9177
  exports.TemplateBreakout = TemplateBreakout$1;
9070
9178
  exports.TemplateContent = TemplateContent$1;