diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
index 6cdb475bb0..8749c3000a 100644
--- a/.github/workflows/gh-pages.yml
+++ b/.github/workflows/gh-pages.yml
@@ -30,7 +30,7 @@ jobs:
- name: Build Storybook
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- run: npm run prebuild:storybook && npm run build-storybook:v1
+ run: npm run prebuild:storybook && npm run build-storybook:v2
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index 5fc0dc4e13..e8d79bd801 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -36,7 +36,7 @@ jobs:
- name: Build Storybook
env:
NODE_OPTIONS: "--max_old_space_size=4096"
- run: npm run prebuild:storybook && npm run build-storybook:v1
+ run: npm run prebuild:storybook && npm run build-storybook:v2
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
diff --git a/.gitignore b/.gitignore
index b3feec8272..d8dc66c698 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,5 @@ lib
dist
.vscode
.eslintcache
-coverage
\ No newline at end of file
+coverage
+.idea
diff --git a/.storybook/preview-body.html b/.storybook/preview-body.html
index 6d61aabe65..a23961640f 100644
--- a/.storybook/preview-body.html
+++ b/.storybook/preview-body.html
@@ -91,14 +91,14 @@
table.storybook-colors-example)) {
border: none;
}
- .sb-show-main
+ /* .sb-show-main
:where(table.storybook-colors-example:not(.sb-anchor, .sb-unstyled, .sb-unstyled
table.storybook-colors-example))
tr
td,
.sb-show-main table.storybook-colors-example td > span:first-of-type {
color: unset;
- }
+ } */
.sb-show-main
:where(table.storybook-colors-example:not(.sb-anchor, .sb-unstyled, .sb-unstyled
table.storybook-colors-example))
diff --git a/.storybook/public/nypl-reservoir-design-system-logo.svg b/.storybook/public/nypl-reservoir-design-system-logo.svg
index 1ccc5287dd..80b62fba95 100644
--- a/.storybook/public/nypl-reservoir-design-system-logo.svg
+++ b/.storybook/public/nypl-reservoir-design-system-logo.svg
@@ -1,8 +1,8 @@
-
Notification Heading
@@ -173,7 +173,7 @@ exports[`Notification renders the UI snapshot correctly 3`] = `
Notification Heading
@@ -263,7 +263,7 @@ exports[`Notification renders the UI snapshot correctly 5`] = `
className="css-1xdhyk6"
>
Notification Heading
@@ -447,7 +447,7 @@ exports[`Notification renders the UI snapshot correctly 8`] = `
Notification Heading
@@ -512,7 +512,7 @@ exports[`Notification renders the UI snapshot correctly 9`] = `
Notification Heading
diff --git a/src/components/Pagination/Pagination.mdx b/src/components/Pagination/Pagination.mdx
index 955bb2e12b..f461dbb66e 100644
--- a/src/components/Pagination/Pagination.mdx
+++ b/src/components/Pagination/Pagination.mdx
@@ -10,7 +10,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.0.10` |
-| Latest | `1.5.0` |
+| Latest | `2.0.0` |
## Table of Contents
diff --git a/src/components/Pagination/Pagination.tsx b/src/components/Pagination/Pagination.tsx
index 3d00a22793..d7de6afd63 100644
--- a/src/components/Pagination/Pagination.tsx
+++ b/src/components/Pagination/Pagination.tsx
@@ -130,7 +130,7 @@ export const Pagination = chakra(
// The current page link has different styles.
const currentStyles = isSelectedPage
? {
- color: "ui.black",
+ color: "ui.typography.body",
pointerEvent: "none",
_dark: {
color: "dark.ui.typography.body",
diff --git a/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap b/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap
index 04589b436c..00bb5b6a6c 100644
--- a/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap
+++ b/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap
@@ -15,7 +15,7 @@ exports[`Pagination Rendering renders the UI snapshot correctly 1`] = `
(
- Checked
+
+ Checked
+
- Focused
+
+ Focused
+
- Errored
+
+ Errored
+
- Disabled
+
+ Disabled
+
(
- Helper Text
+
+ Helper Text
+
- Error Text
+
+ Error Text
+
(
- Errored
+
+ Errored
+
- Required
+
+ Required
+
- Disabled
+
+ Disabled
+
A Heading
@@ -947,7 +947,7 @@ exports[`SearchBar renders the UI snapshot correctly 11`] = `
id="withHeadingAndDescription-wrapper"
>
A Heading
diff --git a/src/components/Select/Select.mdx b/src/components/Select/Select.mdx
index 72281c048e..b6f3880e27 100644
--- a/src/components/Select/Select.mdx
+++ b/src/components/Select/Select.mdx
@@ -10,7 +10,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.7.0` |
-| Latest | `1.5.4` |
+| Latest | `2.0.0` |
## Table of Contents
diff --git a/src/components/SkipNavigation/SkipNavigation.tsx b/src/components/SkipNavigation/SkipNavigation.tsx
index da2d0404af..c58de61aef 100644
--- a/src/components/SkipNavigation/SkipNavigation.tsx
+++ b/src/components/SkipNavigation/SkipNavigation.tsx
@@ -37,10 +37,15 @@ export const SkipNavigation = chakra(
>
- Skip to Main Content
+
+ Skip to Main Content
+
-
+
Click to learn about accessibility at the Library
diff --git a/src/components/Slider/Slider.mdx b/src/components/Slider/Slider.mdx
index 1849f3847c..562c538094 100644
--- a/src/components/Slider/Slider.mdx
+++ b/src/components/Slider/Slider.mdx
@@ -10,7 +10,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.25.4` |
-| Latest | `1.5.3` |
+| Latest | `2.0.0` |
## Table of Contents
diff --git a/src/components/Slider/Slider.stories.tsx b/src/components/Slider/Slider.stories.tsx
index 0fa2cbacd0..b7a2420217 100644
--- a/src/components/Slider/Slider.stories.tsx
+++ b/src/components/Slider/Slider.stories.tsx
@@ -152,7 +152,8 @@ export const SingleSliderStates: Story = {
(
-
+
-
+
@@ -369,7 +386,8 @@ export const SingleSliderVariantsHiddenLabels: Story = {
<>
diff --git a/src/components/SocialMediaLinks/SocialMediaLinks.mdx b/src/components/SocialMediaLinks/SocialMediaLinks.mdx
new file mode 100644
index 0000000000..aec538874c
--- /dev/null
+++ b/src/components/SocialMediaLinks/SocialMediaLinks.mdx
@@ -0,0 +1,125 @@
+import { ArgTypes, Canvas, Description, Meta, Source } from "@storybook/blocks";
+import { GetTableData } from "./SocialMediaLinksUtils";
+import Table from "../Table/Table";
+import * as SocialMediaLinksStories from "./SocialMediaLinks.stories";
+import Link from "../Link/Link";
+
+
+
+# SocialMediaLinks
+
+| Component Version | DS Version |
+| ----------------- | ---------- |
+| Added | `2.0.0` |
+| Latest | `2.0.0` |
+
+## Table of Contents
+
+- {Overview}
+- {With Controls}
+- {Accessibility}
+- {Variations}
+- {Responsive Design}
+
+## Overview
+
+
+
+## With Controls
+
+
+
+Passing an array of social media objects to the `linksData` prop allows you to control which social media types are
+displayed, the order they appear, the specific URL used in the link, and the text used for the label of each.
+Of these, only the `type` value is required. The other two props, `labelText` and `url` are optional and will display
+a default value if left undeclared. Order is determined by the order of the array. You may also pass
+_no_ `linksData` prop and the component will return all available social media links with their default values. See [an
+example](#heading-nodata) at the bottom of this document.
+
+Labels are exposed in this example to demonstrate that the text is changed for the middle icon. Click "Show Code," above,
+to view the sample `linksData` code.
+
+
+
+### Available Social Media Types & Their Default Values
+
+The `linksData` prop accepts an array of objects. Each object may be composed of three values: `type`, `labelText`,
+and `url`. Of these, only `type` is required, determining which of the allowed social media icons will be displayed.
+Each type has a default value for its label text and url. See table below for allowed types and default values.
+If values are set for `labelText` and/or `url` in the `linksData` array, those values will override the defaults.
+For example:
+
+
+`}
+ language="tsx"
+/>
+
+
+
+\* `Icon Name` is not a prop. It is returned automatically by the component. Its value is shown here for transparency.
+
+## Accessibility
+
+Internally, links are organized in a `ul` list element using the
+[List](/?path=/docs/components-typography-styles-list--docs),
+[Link](/?path=/docs/components-navigation-link--docs), and
+[Icon](/?path=/docs/components-media-icons-icon--docs) components.
+
+If the `showLabels` prop is set to `false` the labels are still visible to screen reader software.
+
+### Resources
+
+- [Deque University Semantic Markup for Lists](https://dequeuniversity.com/tips/list-markup)
+- [W3C SVG icons](https://design-system.w3.org/styles/svg-icons.html)
+- [Accessible SVG icons](https://css-tricks.com/accessible-svg-icons/)
+
+## Variations
+
+The below variations can be combined in any way EXCEPT ONE. You may _NOT_ combine circular borders with labels.
+
+### Layout Variations
+
+NOTE: Icons will stack automatically for any viewport less than or equal to the "md" breakpoint (currently 600px).
+This layout prop is therefore effectively limited to desktop views.
+
+
+
+### Size Variations
+
+
+
+### Color Variations
+
+
+
+### Border Variations
+
+
+
+### Label Variations
+
+
+
+### Without linksData Prop (Default)
+
+
+
+## Responsive Design
+
+- Icons will stack automatically for any viewport less than or equal to the "md" breakpoint (currently 600px).
+- The minimum clickable area for a link on a mobile device is 44px. This requirement causes the spacing between
+ small and medium icons to be greater than when in a column layout in a desktop viewport.
diff --git a/src/components/SocialMediaLinks/SocialMediaLinks.stories.tsx b/src/components/SocialMediaLinks/SocialMediaLinks.stories.tsx
new file mode 100644
index 0000000000..c81f69781c
--- /dev/null
+++ b/src/components/SocialMediaLinks/SocialMediaLinks.stories.tsx
@@ -0,0 +1,346 @@
+import type { Meta, StoryObj } from "@storybook/react";
+import SocialMediaLinks, {
+ borderTypeArray,
+ colorTypeArray,
+ sizeTypeArray,
+} from "./SocialMediaLinks";
+import { withDesign } from "storybook-addon-designs";
+import { layoutTypesArray } from "../../helpers/types";
+import { Box, VStack } from "@chakra-ui/react";
+import Heading from "../Heading/Heading";
+import Text from "../Text/Text";
+import { Source } from "@storybook/blocks";
+
+const meta: Meta = {
+ title: "Components/Navigation/SocialMediaLinks",
+ component: SocialMediaLinks,
+ decorators: [withDesign],
+ argTypes: {
+ borders: {
+ table: { disable: true },
+ },
+ className: { table: { disable: true } },
+ color: {
+ table: { disable: true },
+ },
+ id: { table: { disable: true } },
+ layout: {
+ table: { disable: true },
+ },
+ linksData: { table: { disable: true } },
+ showLabels: { table: { disable: true } },
+ size: {
+ table: { disable: true },
+ },
+ },
+ parameters: {
+ controls: {
+ hideNoControlsWarning: true,
+ },
+ design: {
+ type: "figma",
+ url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=77103-126004&t=Yx1GyAfBJyhuGIGs-4",
+ },
+ jest: ["SocialMediaLinks.test.tsx"],
+ },
+};
+export default meta;
+type Story = StoryObj;
+
+export const WithControls: Story = {
+ args: {
+ borders: "none",
+ color: "textDefault",
+ className: undefined,
+ id: undefined,
+ layout: "row",
+ linksData: [
+ { type: "facebook" },
+ {
+ type: "twitter",
+ url: "https://twitter.com/NYPLBookmobile",
+ labelText: "Alt Twitter",
+ },
+ {
+ type: "instagram",
+ },
+ ],
+ showLabels: true,
+ size: "small",
+ },
+ argTypes: {
+ borders: {
+ control: { type: "radio" },
+ options: borderTypeArray,
+ table: {
+ disable: false,
+ defaultValue: { summary: "none" },
+ },
+ },
+ className: {
+ control: true,
+ table: {
+ disable: false,
+ },
+ },
+ color: {
+ description:
+ "Any of three optional values that will change the color of the svg and label text (if any).",
+ control: { type: "radio" },
+ // @todo the table will not display these options.
+ options: colorTypeArray,
+ table: {
+ disable: false,
+ defaultValue: { summary: "textDefault" },
+ },
+ },
+ id: {
+ control: true,
+ table: {
+ disable: false,
+ },
+ },
+ layout: {
+ control: { type: "radio" },
+ options: layoutTypesArray,
+ table: {
+ disable: false,
+ defaultValue: { summary: "row" },
+ },
+ },
+ linksData: { table: { disable: false } },
+ showLabels: {
+ table: {
+ disable: false,
+ defaultValue: { summary: false },
+ },
+ },
+ size: {
+ control: { type: "radio" },
+ options: sizeTypeArray,
+ table: {
+ disable: false,
+ defaultValue: { summary: "small" },
+ },
+ },
+ },
+ render: (args) => (
+
+
+
+
+
+ NOTE: background color for textInverse is added for readability in
+ Reservoir. It is not part of the functionality.
+
+
+ ),
+};
+
+export const LayoutVariations: Story = {
+ render: () => (
+
+
+
+
+ '} />
+
+
+
+
+ '} />
+
+
+ ),
+};
+
+export const SizeVariations: Story = {
+ render: () => (
+
+
+
+
+ '} />
+
+
+
+
+ '} />
+
+
+
+
+ '} />
+
+
+ ),
+};
+
+// Making a component just for practice
+const ColorVariationsStory = () => {
+ /*
+ // Now I could put logic in here like below, which I could not do w/o
+ // this being a component.
+ const bg = useColorModeValue("ui.white", "ui.black");
+*/
+ return (
+
+
+
+
+ '} />
+
+
+
+
+ '} />
+
+
+
+
+
+
+
+ NOTE: background color for textInverse is added for readability in
+ Reservoir. It is not part of the functionality.
+
+ '} />
+
+
+ );
+};
+// Gotta export the component we made above
+export const ColorVariations: Story = {
+ render: () => ,
+};
+
+export const BorderVariations: Story = {
+ render: () => (
+
+
+
+
+ '} />
+
+
+
+
+ '} />
+
+
+
+
+
+ NOTE: labels are disallowed with circular borders.
+
+ '} />
+
+
+ ),
+};
+
+export const LabelVariations: Story = {
+ render: () => (
+
+
+
+
+
+
+
+
+
+
+
+
+ ),
+};
+
+export const noLinksData: Story = {
+ render: () => (
+
+ {/* @todo This should work, with import Markdown , but it throws an error. It doesn't like something about the styling.
+ * If the `linksData` prop is not supplied or otherwise "falsy,"
+ the component returns all available social media types and their default
+ values.
+ */}
+
+ If the linksData
prop is not supplied or otherwise "falsy,"
+ the component returns all available social media types and their default
+ values.
+
+
+
+
+ ),
+};
diff --git a/src/components/SocialMediaLinks/SocialMediaLinks.test.tsx b/src/components/SocialMediaLinks/SocialMediaLinks.test.tsx
new file mode 100644
index 0000000000..4ab1b8d8db
--- /dev/null
+++ b/src/components/SocialMediaLinks/SocialMediaLinks.test.tsx
@@ -0,0 +1,470 @@
+import { render, screen } from "@testing-library/react";
+import { axe } from "jest-axe";
+import * as React from "react";
+import renderer from "react-test-renderer";
+import SocialMediaLinks from "./SocialMediaLinks";
+
+// If you want to see what's happening.
+// screen.debug();
+
+describe("SocialMediaLinks Accessibility", () => {
+ describe("Labels", () => {
+ it("passes axe accessibility test without visible labels", async () => {
+ const { container } = render();
+ expect(await axe(container)).toHaveNoViolations();
+ });
+ it("passes axe accessibility test with labels set to true", async () => {
+ const { container } = render();
+ expect(await axe(container)).toHaveNoViolations();
+ });
+ });
+ describe("Colors", () => {
+ it("passes axe accessibility test with link color & labels", async () => {
+ const { container } = render(
+
+ );
+ expect(await axe(container)).toHaveNoViolations();
+ });
+ it("passes axe accessibility test with textInverse color & labels", async () => {
+ const { container } = render(
+
+ );
+ expect(await axe(container)).toHaveNoViolations();
+ });
+ });
+ describe("Borders", () => {
+ it("passes axe accessibility test with straight borders & labels", async () => {
+ const { container } = render(
+
+ );
+ expect(await axe(container)).toHaveNoViolations();
+ });
+ it("passes axe accessibility test with circular borders", async () => {
+ const { container } = render();
+ expect(await axe(container)).toHaveNoViolations();
+ });
+ });
+});
+
+describe("SocialMediaLinks", () => {
+ it("Renders default", () => {
+ render();
+
+ const links = screen.getAllByRole("link");
+
+ // All the types in SocialMediaDataMap.ts should be there.
+ expect(links).toHaveLength(9);
+
+ // Spot tests.
+
+ // Links.
+ expect(links[1]).toHaveAttribute("href", "https://facebook.com/nypl");
+ expect(links[4]).toHaveAttribute("href", "https://soundcloud.com/nypl");
+ expect(links[6]).toHaveAttribute("href", "https://nypl.tumblr.com");
+
+ // Labels.
+ expect(screen.getByText("NYPL Blog")).toBeInTheDocument();
+ expect(screen.getByText("Pinterest")).toBeInTheDocument();
+ expect(screen.getByText("TikTok")).toBeInTheDocument();
+
+ // Icons.
+ expect(screen.getByTitle("Instagram")).toBeInTheDocument();
+ expect(screen.getByTitle("Twitter")).toBeInTheDocument();
+ expect(screen.getByTitle("YouTube")).toBeInTheDocument();
+ });
+
+ it("Renders selected types", () => {
+ render(
+
+ );
+
+ const links = screen.getAllByRole("link");
+
+ // There should be two links.
+ expect(links).toHaveLength(2);
+
+ // The links should be what we assigned and in the same order.
+ expect(links[0]).toHaveAttribute("href", "https://twitter.com/elsewhere");
+ expect(links[1]).toHaveAttribute("href", "https://facebook.com/nypl");
+
+ // The label text we desire should be in the document.
+ expect(screen.getByText("Alt Twitter")).toBeInTheDocument();
+ expect(screen.getByText("NYPL Facebook")).toBeInTheDocument();
+
+ // The icons should appear.
+ expect(screen.getByTitle("NYPL Facebook")).toBeInTheDocument();
+ expect(screen.getByTitle("Alt Twitter")).toBeInTheDocument();
+ });
+
+ it("logs an error if border='circular' and showLabels=true", () => {
+ const error = jest.spyOn(console, "error");
+ render();
+ expect(error).toHaveBeenCalledWith(
+ "NYPL Reservoir SocialMediaLinks: 'showLabels' is set to true, but labels can not be shown with a circular border."
+ );
+ });
+});
+
+describe("SocialMediaLinks Snapshot", () => {
+ it("Renders the UI snapshot correctly when the layout is in a row.", () => {
+ const socialMediaLinksSnapshot = renderer
+ .create()
+ .toJSON();
+ const socialMediaLinksVariantLinksColor = renderer
+ .create()
+ .toJSON();
+ const socialMediaLinksVariantLinksColorWithLabels = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantLinksColorStraightBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantLinksColorCircularBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantLinksColorWithLabelsStraightBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColor = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorWithLabels = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorStraightBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorCircularBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorWithLabelsStraightBorders =
+ renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantWithLabels = renderer
+ .create()
+ .toJSON();
+ const socialMediaLinksVariantStraightBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantWithLabelsStraightBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantWithLabelsCircularBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantCircularBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+
+ expect(socialMediaLinksSnapshot).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColor).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColorWithLabels).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColorStraightBorders).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColorCircularBorders).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantLinksColorWithLabelsStraightBorders
+ ).toMatchSnapshot();
+ expect(socialMediaLinksVariantTextInverseColor).toMatchSnapshot();
+ expect(socialMediaLinksVariantTextInverseColorWithLabels).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantTextInverseColorStraightBorders
+ ).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantTextInverseColorCircularBorders
+ ).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantTextInverseColorWithLabelsStraightBorders
+ ).toMatchSnapshot();
+ expect(socialMediaLinksVariantWithLabels).toMatchSnapshot();
+ expect(socialMediaLinksVariantStraightBorder).toMatchSnapshot();
+ expect(socialMediaLinksVariantWithLabelsStraightBorder).toMatchSnapshot();
+ expect(socialMediaLinksVariantWithLabelsCircularBorder).toMatchSnapshot();
+ expect(socialMediaLinksVariantCircularBorder).toMatchSnapshot();
+ });
+
+ it("Renders the UI snapshot correctly when the layout is in a column.", () => {
+ const socialMediaLinksSnapshot = renderer
+ .create()
+ .toJSON();
+ const socialMediaLinksVariantLinksColor = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantLinksColorWithLabels = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantLinksColorStraightBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantLinksColorCircularBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantLinksColorWithLabelsStraightBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColor = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorWithLabels = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorStraightBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorCircularBorders = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantTextInverseColorWithLabelsStraightBorders =
+ renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantWithLabels = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantStraightBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantWithLabelsStraightBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantWithLabelsCircularBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+ const socialMediaLinksVariantCircularBorder = renderer
+ .create(
+
+ )
+ .toJSON();
+
+ expect(socialMediaLinksSnapshot).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColor).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColorWithLabels).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColorStraightBorders).toMatchSnapshot();
+ expect(socialMediaLinksVariantLinksColorCircularBorders).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantLinksColorWithLabelsStraightBorders
+ ).toMatchSnapshot();
+ expect(socialMediaLinksVariantTextInverseColor).toMatchSnapshot();
+ expect(socialMediaLinksVariantTextInverseColorWithLabels).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantTextInverseColorStraightBorders
+ ).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantTextInverseColorCircularBorders
+ ).toMatchSnapshot();
+ expect(
+ socialMediaLinksVariantTextInverseColorWithLabelsStraightBorders
+ ).toMatchSnapshot();
+ expect(socialMediaLinksVariantWithLabels).toMatchSnapshot();
+ expect(socialMediaLinksVariantStraightBorder).toMatchSnapshot();
+ expect(socialMediaLinksVariantWithLabelsStraightBorder).toMatchSnapshot();
+ expect(socialMediaLinksVariantWithLabelsCircularBorder).toMatchSnapshot();
+ expect(socialMediaLinksVariantCircularBorder).toMatchSnapshot();
+ });
+
+ it("Renders the UI snapshot correctly when linksData has a value.", () => {
+ const socialMediaLinksVariantLinksDataOverride = renderer
+ .create(
+
+ )
+ .toJSON();
+
+ expect(socialMediaLinksVariantLinksDataOverride).toMatchSnapshot();
+ });
+});
diff --git a/src/components/SocialMediaLinks/SocialMediaLinks.tsx b/src/components/SocialMediaLinks/SocialMediaLinks.tsx
new file mode 100644
index 0000000000..d6a8dc04ec
--- /dev/null
+++ b/src/components/SocialMediaLinks/SocialMediaLinks.tsx
@@ -0,0 +1,183 @@
+import { chakra, useStyleConfig } from "@chakra-ui/react";
+import List from "../List/List";
+import Link from "../Link/Link";
+import Icon, { IconSizes } from "../Icons/Icon";
+import { LayoutTypes } from "../../helpers/types";
+import { socialMediaDataMap } from "./SocialMediaLinksUtils";
+import React, { forwardRef } from "react";
+
+export const borderTypeArray = ["none", "circular", "straight"] as const;
+export type BorderType = typeof borderTypeArray[number];
+
+export const colorTypeArray = ["link", "textDefault", "textInverse"] as const;
+export type ColorType = typeof colorTypeArray[number];
+
+export const sizeTypeArray = ["small", "medium", "large"] as const;
+export type SizeType = typeof sizeTypeArray[number];
+
+// This list of allowed types is defined in the SocialMediaDataMap found in SocialMediaLinksUtils.ts and extracted here.
+export const socialMediaLinkTypeArray = socialMediaDataMap.map(
+ ({ type }) => type
+);
+export type SocialMediaLinkType = typeof socialMediaLinkTypeArray[number];
+
+export interface SocialMediaLinkDataProps {
+ /** Optional override for default platform name */
+ labelText?: string;
+ /** Required. Must be one of socialMediaLinkTypeArray */
+ type: SocialMediaLinkType;
+ /** Optional override for default social media url */
+ url?: string;
+}
+
+export interface SocialMediaLinksProps {
+ /** Optional border: straight, circular or none. */
+ borders?: BorderType;
+ /** Optional className you can add in addition to "social-media-links." */
+ className?: string;
+ /** Any of three optional values that will change the color of the svg and label text (if any). */
+ color?: ColorType;
+ /** ID that other components can cross-reference for accessibility purposes. */
+ id?: string;
+ /** Optional desktop layout. Smaller viewports are always in a column. */
+ layout?: LayoutTypes;
+ /** Optional array of social media platform types, urls, and label texts. */
+ linksData?: SocialMediaLinkDataProps[];
+ /** Optional true/false to display names of platforms along with icons.
+ * NOTE: Labels will NOT be shown with a circular border */
+ showLabels?: boolean;
+ /** Optional size: small, medium, or large. */
+ size?: SizeType;
+}
+
+/* Accepts an array containing one or more data objects, each representing a social media platform and optional
+ * overrides for the label and/or URL.
+ *
+ * @returns an array of data objects for each requested platform type that includes type, iconName, labelText and
+ * url. The labelText and url props will include any values supplied to override the defaults.
+ */
+function getLinksData(platforms: SocialMediaLinkDataProps[]) {
+ let allData = [];
+ platforms.forEach((myPlatform) => {
+ // Get the dataset for this platform.
+ let thisPlatformArray = socialMediaDataMap.filter(
+ (socialMediaSlice) => socialMediaSlice.type === myPlatform.type
+ );
+
+ // The filter function returns an array of objects, so let's just get the objects out of the array.
+ let thisPlatformData = thisPlatformArray[0];
+
+ // If a url value exists in myPlatform use it, else use the default.
+ let newUrl = myPlatform.url ?? thisPlatformData.url;
+
+ // If a labelText value exists in myPlatform use it, else use the default.
+ let newLabelText = myPlatform.labelText ?? thisPlatformData.labelText;
+
+ let thisObj = {
+ type: thisPlatformData.type,
+ iconName: thisPlatformData.iconName,
+ labelText: newLabelText,
+ url: newUrl,
+ };
+ allData.push(thisObj);
+ }); // end forEach
+
+ return allData;
+}
+
+/**
+ * The SocialMediaLinks component renders a list of links for accessing social media sites.
+ */
+export const SocialMediaLinks = chakra(
+ forwardRef<
+ HTMLDivElement & HTMLUListElement & HTMLOListElement,
+ SocialMediaLinksProps
+ >((props, ref?) => {
+ const {
+ borders = "none",
+ color = "textDefault",
+ className,
+ id,
+ linksData,
+ layout = "row",
+ showLabels = false,
+ size = "small",
+ ...rest
+ } = props;
+
+ // Turns out you can pass whatever props you want to this thing in order to do logic in the theme.
+ const styles = useStyleConfig("SocialMediaLinks", {
+ variant: borders,
+ size, // Shortcut: if the key and variable names are the same, you can just pass the variable.
+ color,
+ layout,
+ });
+
+ let labelsOn = showLabels;
+ if (labelsOn && borders === "circular") {
+ labelsOn = false;
+ console.error(
+ "NYPL Reservoir SocialMediaLinks: 'showLabels' is set to true, but labels can not be shown with a circular border."
+ );
+ }
+
+ // If linksData has values, use them, else use the entire list of platforms.
+ const socialMediaDataArray = linksData
+ ? getLinksData(linksData)
+ : socialMediaDataMap;
+
+ // Loop through the platform data array and build an array of links.
+ const thisLinksData = [];
+ socialMediaDataArray.forEach((modifiedPlatform) => {
+ // The size prop for the Icon component does not exactly match the convention for SocialMediaLinks size prop.
+ // So let's set the correct Icon size.
+ let iconSize: IconSizes = "medium";
+ switch (size) {
+ case "medium":
+ iconSize = "large";
+ break;
+ case "large":
+ iconSize = "xlarge";
+ break;
+ }
+
+ const linkData = (
+
+
+
+ {labelsOn ? {modifiedPlatform.labelText} : null}
+
+
+ );
+
+ thisLinksData.push(linkData);
+ }); // end socialMediaDataArray foreach
+
+ return (
+
+ );
+ }),
+ { shouldForwardProp: () => true }
+);
+
+export default SocialMediaLinks;
diff --git a/src/components/SocialMediaLinks/SocialMediaLinksUtils.ts b/src/components/SocialMediaLinks/SocialMediaLinksUtils.ts
new file mode 100644
index 0000000000..8be709d9c9
--- /dev/null
+++ b/src/components/SocialMediaLinks/SocialMediaLinksUtils.ts
@@ -0,0 +1,74 @@
+export const socialMediaDataMap = [
+ {
+ type: "blog",
+ iconName: "fileTypeGenericDoc",
+ labelText: "NYPL Blog",
+ url: "https://nypl.org/blog",
+ },
+ {
+ type: "facebook",
+ iconName: "socialFacebook",
+ labelText: "Facebook",
+ url: "https://facebook.com/nypl",
+ },
+ {
+ type: "instagram",
+ iconName: "socialInstagram",
+ labelText: "Instagram",
+ url: "https://instagram.com/nypl",
+ },
+ {
+ type: "pinterest",
+ iconName: "socialPinterest",
+ labelText: "Pinterest",
+ url: "https://pinterest.com/nypl",
+ },
+ {
+ type: "soundcloud",
+ iconName: "socialSoundCloud",
+ labelText: "SoundCloud",
+ url: "https://soundcloud.com/nypl",
+ },
+ {
+ type: "tiktok",
+ iconName: "socialTikTok",
+ labelText: "TikTok",
+ url: "https://tiktok.com/@nypl",
+ },
+ {
+ type: "tumblr",
+ iconName: "socialTumblr",
+ labelText: "Tumblr",
+ url: "https://nypl.tumblr.com",
+ },
+ {
+ type: "twitter",
+ iconName: "socialTwitter",
+ labelText: "Twitter",
+ url: "https://twitter.com/nypl",
+ },
+ {
+ type: "youtube",
+ iconName: "socialYoutube",
+ labelText: "YouTube",
+ url: "https://youtube.com/newyorkpubliclibrary",
+ },
+];
+
+/* Helper function for .mdx component.
+ *
+ * @returns the SocialMediaDataMap values as an array of arrays
+ */
+export function GetTableData() {
+ let tableData = [];
+ socialMediaDataMap.forEach((smPlatform) => {
+ let row = [
+ smPlatform.type,
+ smPlatform.labelText,
+ smPlatform.url,
+ smPlatform.iconName,
+ ];
+ tableData.push(row);
+ });
+ return tableData;
+}
diff --git a/src/components/SocialMediaLinks/__snapshots__/SocialMediaLinks.test.tsx.snap b/src/components/SocialMediaLinks/__snapshots__/SocialMediaLinks.test.tsx.snap
new file mode 100644
index 0000000000..1b5d00f5ff
--- /dev/null
+++ b/src/components/SocialMediaLinks/__snapshots__/SocialMediaLinks.test.tsx.snap
@@ -0,0 +1,14259 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when linksData has a value. 1`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 1`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 2`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 3`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 4`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 5`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 6`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 7`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 8`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 9`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 10`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 11`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 12`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 13`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 14`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 15`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a column. 16`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 1`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 2`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 3`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 4`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 5`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 6`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 7`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 8`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 9`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 10`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 11`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 12`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 13`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 14`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 15`] = `
+
+`;
+
+exports[`SocialMediaLinks Snapshot Renders the UI snapshot correctly when the layout is in a row. 16`] = `
+
+`;
diff --git a/src/components/StatusBadge/StatusBadge.mdx b/src/components/StatusBadge/StatusBadge.mdx
index ec6f9ae346..f26dad3ffb 100644
--- a/src/components/StatusBadge/StatusBadge.mdx
+++ b/src/components/StatusBadge/StatusBadge.mdx
@@ -10,7 +10,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.18.7` |
-| Latest | `1.5.0` |
+| Latest | `2.0.0` |
## Table of Contents
diff --git a/src/components/StructuredContent/StructuredContent.mdx b/src/components/StructuredContent/StructuredContent.mdx
index 4d4ece8325..b482c88ba4 100644
--- a/src/components/StructuredContent/StructuredContent.mdx
+++ b/src/components/StructuredContent/StructuredContent.mdx
@@ -10,7 +10,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.25.9` |
-| Latest | `1.5.0` |
+| Latest | `2.0.0` |
## Table of Contents
diff --git a/src/components/StructuredContent/StructuredContent.tsx b/src/components/StructuredContent/StructuredContent.tsx
index 8a487f194d..20a9b36f22 100644
--- a/src/components/StructuredContent/StructuredContent.tsx
+++ b/src/components/StructuredContent/StructuredContent.tsx
@@ -113,7 +113,7 @@ export const StructuredContent = chakra(
{headingText && {headingText}}
{calloutText && (
-
+
{calloutText}
)}
diff --git a/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap b/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap
index c6f4a00134..437b3e57d2 100644
--- a/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap
+++ b/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap
@@ -6,13 +6,13 @@ exports[`StructuredContent renders the UI snapshot 1`] = `
id="withHTMLStringContent"
>
Heading text
This is the callout text
@@ -32,14 +32,32 @@ exports[`StructuredContent renders the UI snapshot 1`] = `
className="css-0"
>
@@ -61,13 +79,13 @@ exports[`StructuredContent renders the UI snapshot 2`] = `
id="withHTMLDOMContent"
>
Heading text
This is the callout text
@@ -87,14 +105,32 @@ exports[`StructuredContent renders the UI snapshot 2`] = `
className="css-0"
>
@@ -150,13 +186,13 @@ exports[`StructuredContent renders the UI snapshot 3`] = `
id="withoutAnImage"
>
Heading text
This is the callout text
@@ -178,13 +214,13 @@ exports[`StructuredContent renders the UI snapshot 4`] = `
id="withImageWithoutCaptionOrCredit"
>
Heading text
This is the callout text
@@ -215,7 +251,7 @@ exports[`StructuredContent renders the UI snapshot 5`] = `
id="withoutHeading"
>
This is the callout text
@@ -235,14 +271,32 @@ exports[`StructuredContent renders the UI snapshot 5`] = `
className="css-0"
>
@@ -264,7 +318,7 @@ exports[`StructuredContent renders the UI snapshot 6`] = `
id="withoutCalloutText"
>
Heading text
@@ -286,13 +340,13 @@ exports[`StructuredContent renders the UI snapshot 7`] = `
id="withChakraProps"
>
Heading text
This is the callout text
@@ -312,14 +366,32 @@ exports[`StructuredContent renders the UI snapshot 7`] = `
className="css-0"
>
@@ -342,13 +414,13 @@ exports[`StructuredContent renders the UI snapshot 8`] = `
id="withOtherProps"
>
Heading text
This is the callout text
@@ -368,14 +440,32 @@ exports[`StructuredContent renders the UI snapshot 8`] = `
className="css-0"
>
diff --git a/src/components/StyleGuide/Bidirectionality.mdx b/src/components/StyleGuide/Bidirectionality.mdx
index d34f2bf2d9..d188cdb53d 100644
--- a/src/components/StyleGuide/Bidirectionality.mdx
+++ b/src/components/StyleGuide/Bidirectionality.mdx
@@ -112,7 +112,9 @@ the original and intentional design layout is achieved in the RTL direction.
>
- LTR
+
+ LTR
+
- RTL
+
+ RTL
+
) => {
tbody: {
td: {
...cellStyles,
- borderBottom: "1px solid !important",
+ borderBottom: `1px solid ${cellStyles.borderColor}`,
+ color: textColor === "ui.white" ? `#FFF !important` : `#000 !important`, // This is a hack to override other color assignments
+ span: {
+ color:
+ textColor === "ui.white" ? `#FFF !important` : `#000 !important`, // This is a hack to override other color assignments
+ },
},
th: {
borderBottom: `1px solid ${cellStyles.borderColor}`,
@@ -1229,7 +1294,7 @@ export const ColorCard = (props: PropsWithChildren) => {
Connect
-
- Connect is used for the Connect and Get Help section fronts.
-
+ Connect is used for the Connect and Get Help section fronts.
{getColorCards("connect")}
@@ -230,13 +233,13 @@ and coding.
{getColorCards("grayscaleRoot")}
-
+
Cool (standard options)
{getColorCards("grayscaleCool")}
-
+
Warm
The warm grays are alternate options to the cool grays.
diff --git a/src/components/StyledList/StyledList.mdx b/src/components/StyledList/StyledList.mdx
index ad9318dcf5..0c8fc38ff1 100644
--- a/src/components/StyledList/StyledList.mdx
+++ b/src/components/StyledList/StyledList.mdx
@@ -11,7 +11,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `1.3.0` |
-| Latest | `1.5.3` |
+| Latest | `2.0.0` |
## Table of Contents
@@ -44,11 +44,20 @@ Resources:
## Font Size
-The font size can be changed through the `textSize` prop. The values are the same
-as the `size` prop in the `Text` component. This includes `"caption"`, `"default"`,
-`"mini"`, and `"tag"`.
+The font size can be changed through the `textSize` prop. The values are a
+limited selection from the `size` prop in the `Text` component:
-
+`"default"`, `"body1"`, `"body2"`, `"caption"`.
+
+
+
+### Deprecated Options
+
+The following values are still available, but they have been deprecated:
+
+`"tag"`, `"mini"`.
+
+
## StyledList Children
diff --git a/src/components/StyledList/StyledList.stories.tsx b/src/components/StyledList/StyledList.stories.tsx
index 28fc7ffd3c..347e833346 100644
--- a/src/components/StyledList/StyledList.stories.tsx
+++ b/src/components/StyledList/StyledList.stories.tsx
@@ -3,7 +3,7 @@ import type { Meta, StoryObj } from "@storybook/react";
import { withDesign } from "storybook-addon-designs";
import Heading from "../Heading/Heading";
-import StyledList from "./StyledList";
+import StyledList, { textSizesArray } from "./StyledList";
const meta: Meta = {
title: "Components/Typography & Styles/StyledList",
@@ -15,7 +15,10 @@ const meta: Meta = {
id: { control: false },
listItems: { control: false },
style: { control: false },
- textSize: { table: { defaultValue: { summary: "default" } } },
+ textSize: {
+ options: textSizesArray,
+ table: { defaultValue: { summary: "default" } },
+ },
},
};
@@ -73,25 +76,45 @@ export const WithControls: Story = {
};
// The following are additional StyledList example Stories.
-export const FontSize: Story = {
+export const FontSizes: Story = {
render: () => (
- Caption
-
+
+ Default / Body 1
+
+
- Default
-
+
+ Body 2
+
+
- Mini
-
+
+ Caption
+
+
+
+ ),
+};
+export const DeprecatedFontSizes: Story = {
+ render: () => (
+
- Tag
+
+ Tag
+
+
+
+ Mini
+
+
+
),
};
diff --git a/src/components/StyledList/StyledList.tsx b/src/components/StyledList/StyledList.tsx
index 1ca27ddbcd..35bb9217db 100644
--- a/src/components/StyledList/StyledList.tsx
+++ b/src/components/StyledList/StyledList.tsx
@@ -2,7 +2,16 @@ import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
import React, { forwardRef } from "react";
import { checkListChildrenError } from "../List/List";
-import { TextSizes } from "../Text/Text";
+
+export const textSizesArray = [
+ "default",
+ "body1",
+ "body2",
+ "caption",
+ "tag",
+ "mini",
+] as const;
+export type TextSizes = typeof textSizesArray[number];
export interface StyledListProps {
/** Any child node passed to the component. */
diff --git a/src/components/Table/Table.mdx b/src/components/Table/Table.mdx
index da39ddce8d..8454426e90 100644
--- a/src/components/Table/Table.mdx
+++ b/src/components/Table/Table.mdx
@@ -10,7 +10,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.25.9` |
-| Latest | `1.5.0` |
+| Latest | `2.0.0` |
## Table of Contents
diff --git a/src/components/Tabs/Tabs.mdx b/src/components/Tabs/Tabs.mdx
index 783581490a..d4901bb576 100644
--- a/src/components/Tabs/Tabs.mdx
+++ b/src/components/Tabs/Tabs.mdx
@@ -10,7 +10,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.24.0` |
-| Latest | `1.5.2` |
+| Latest | `2.0.0` |
## Table of Contents
diff --git a/src/components/Tabs/Tabs.tsx b/src/components/Tabs/Tabs.tsx
index 5099ed7674..12c741ae7f 100644
--- a/src/components/Tabs/Tabs.tsx
+++ b/src/components/Tabs/Tabs.tsx
@@ -75,7 +75,10 @@ const getElementsFromData = (
// For URL hash enabled tabs, we need to add a custom `onClick` to handle the URL hash.
const tempTab = (
onClickHash(`tab${index + 1}`) : undefined}
>
diff --git a/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap b/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap
index 726ccf9f4f..ba162949a1 100644
--- a/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap
+++ b/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap
@@ -63,7 +63,7 @@ exports[`Tabs renders the UI snapshot correctly 1`] = `