Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.1.2 #1460

Merged
merged 22 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
6145215
Updating chakra ui to max version of 1.8.9
EdwinGuzman Oct 27, 2023
53a0122
Updating layout for Hero campaign variant
EdwinGuzman Oct 31, 2023
08666f2
Updating the getSectionColors function to return the dark mode varian…
EdwinGuzman Nov 1, 2023
dc36c75
add sizeBasedOn prop to Logo
jackiequach Nov 2, 2023
eea55b5
add changelog table
jackiequach Nov 2, 2023
a093dac
added functionality and docs for autoComplete prop
bigfishdesign13 Nov 2, 2023
efe3f37
updates based on feedback
bigfishdesign13 Nov 3, 2023
09998fa
add changelog to toc
jackiequach Nov 7, 2023
7954414
Merge pull request #1457 from NYPL/DSD-1618/textinput-autocomplete
bigfishdesign13 Nov 7, 2023
904ae03
Merge branch 'development' into DSD-1520/logo-sizeBasedOn
jackiequach Nov 7, 2023
47cff7e
Merge pull request #1456 from NYPL/DSD-1520/logo-sizeBasedOn
bigfishdesign13 Nov 7, 2023
86aa82f
Merging and fixing conflicts from development
EdwinGuzman Nov 7, 2023
d678291
Merge pull request #1452 from NYPL/DSD-1612/chakra-minor-update
EdwinGuzman Nov 7, 2023
979b33f
Merge branch 'development' into DSD-1569/hero-campaign-spacing
EdwinGuzman Nov 7, 2023
070c5d7
Merge pull request #1454 from NYPL/DSD-1569/hero-campaign-spacing
EdwinGuzman Nov 7, 2023
7961998
Merge branch 'development' into DSD-1604/dark-getSectionColors
EdwinGuzman Nov 7, 2023
7c5e615
Merge pull request #1455 from NYPL/DSD-1604/dark-getSectionColors
EdwinGuzman Nov 7, 2023
f4b34dc
2.1.2
bigfishdesign13 Nov 9, 2023
9deb9ea
Prep for Release v2.1.2
bigfishdesign13 Nov 9, 2023
fe4a299
forgot newslettersignup update
EdwinGuzman Nov 9, 2023
74b67ee
Merge pull request #1459 from NYPL/release-2.1.2
bigfishdesign13 Nov 9, 2023
b7ebd52
Merge branch 'release' into development
bigfishdesign13 Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ Currently, this repo is in Prerelease. When it is released, this project will ad

## Prerelease

## 2.1.2 (November 9, 2023)

### Adds

- Adds the `sizeBasedOn` prop to the `Logo` component.
- Added the `autoComplete` prop to the `TextInput` component for setting the "autocomplete" attribute manually.

### Updates

- Updates max version for Chakra UI to `1.8.9` for minor bug fixes.
- Updates the layout for the `"campaign"` variant of the `Hero` component to have consistent padding on its left and right sides.
- Updates the `getSectionColors` function to also return dark mode color variants.
- Updates the `NewsletterSignup` component's `newsletterSignupType` prop to render proper dark mode variant colors.

## 2.1.1 (October 26, 2023)

### Adds
Expand Down
1,009 changes: 212 additions & 797 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nypl/design-system-react-components",
"version": "2.1.1",
"version": "2.1.2",
"description": "NYPL Reservoir Design System React Components",
"repository": {
"type": "git",
Expand Down Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@chakra-ui/focus-lock": ">=1.2.6 <2.0.0",
"@chakra-ui/react": ">=1.8.5 <=1.8.8",
"@chakra-ui/react": ">=1.8.5 <=1.8.9",
"@chakra-ui/system": ">=1.11.0 <=1.12.1",
"@charlietango/use-native-lazy-loading": "1.10.0",
"@emotion/react": "11.4.1",
Expand All @@ -73,7 +73,7 @@
},
"peerDependencies": {
"@chakra-ui/focus-lock": ">=1.2.6 <2.0.0",
"@chakra-ui/react": ">=1.8.5 <=1.8.8",
"@chakra-ui/react": ">=1.8.5 <=1.8.9",
"@chakra-ui/system": ">=1.11.0 <=1.12.1",
"@emotion/react": "11.4.1",
"@emotion/styled": "11.3.0",
Expand Down
91 changes: 91 additions & 0 deletions src/__tests__/utils/getSectionColors.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import { getSectionColors } from "../../utils/getSectionColors";

describe("getSectionColors", () => {
// Spot check color objects in `sectionColorsDataMap` in
// `src/helpers/types.ts`.
it("returns an object with primary and secondary colors for the passed type", () => {
const brand = getSectionColors({
type: "brand",
});
const education = getSectionColors({
type: "education",
});
const researchLibrarySchomburg = getSectionColors({
type: "researchLibrarySchomburg",
});
const whatsOn = getSectionColors({
type: "whatsOn",
});

expect(brand).toEqual({
primary: "brand.primary",
secondary: "brand.secondary",
});
expect(education).toEqual({
primary: "section.education.primary",
secondary: "section.education.secondary",
});
expect(researchLibrarySchomburg).toEqual({
primary: "section.research-library.schomburg",
secondary: null,
});
expect(whatsOn).toEqual({
primary: "section.whats-on.primary",
secondary: "section.whats-on.secondary",
});
});

it("returns a string with the appropriate color value", () => {
const booksAndMore = getSectionColors({
type: "booksAndMore",
colorValue: "secondary",
});
const connect = getSectionColors({
type: "connect",
colorValue: "primary",
});
const research = getSectionColors({
type: "research",
colorValue: "primary",
});
const researchLibrarySchwarzman = getSectionColors({
type: "researchLibrarySchwarzman",
colorValue: "secondary",
});

expect(booksAndMore).toEqual("section.books-and-more.secondary");
expect(connect).toEqual("section.connect.primary");
expect(research).toEqual("section.research.primary");
expect(researchLibrarySchwarzman).toEqual(null);
});

it("returns a string with the dark mode color variant", () => {
const locations = getSectionColors({
type: "locations",
colorValue: "secondary",
isDark: true,
});
const researchLibraryLpa = getSectionColors({
type: "researchLibraryLpa",
colorValue: "primary",
isDark: true,
});
const researchLibrarySchwarzman = getSectionColors({
type: "researchLibrarySchwarzman",
colorValue: "primary",
isDark: true,
});
const whatsOn = getSectionColors({
type: "whatsOn",
colorValue: "secondary",
isDark: true,
});

expect(locations).toEqual("dark.section.locations.secondary");
expect(researchLibraryLpa).toEqual("dark.section.research-library.lpa");
expect(researchLibrarySchwarzman).toEqual(
"dark.section.research-library.schwartzman"
);
expect(whatsOn).toEqual("dark.section.whats-on.secondary");
});
});
17 changes: 17 additions & 0 deletions src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 1`] = `
>
<input
aria-label="From, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="basic-start"
Expand Down Expand Up @@ -103,6 +104,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 1`] = `
>
<input
aria-label="To, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="basic-end"
Expand Down Expand Up @@ -184,6 +186,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 2`] = `
>
<input
aria-label="From, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="no-label-start"
Expand Down Expand Up @@ -237,6 +240,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 2`] = `
>
<input
aria-label="To, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="no-label-end"
Expand Down Expand Up @@ -318,6 +322,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 3`] = `
>
<input
aria-label="From, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="custom-format-start"
Expand Down Expand Up @@ -371,6 +376,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 3`] = `
>
<input
aria-label="To, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="custom-format-end"
Expand Down Expand Up @@ -454,6 +460,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 4`] = `
aria-describedby="invalid-start-helperText"
aria-invalid={true}
aria-label="From, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="invalid-start"
Expand Down Expand Up @@ -525,6 +532,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 4`] = `
aria-describedby="invalid-end-helperText"
aria-invalid={true}
aria-label="To, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="invalid-end"
Expand Down Expand Up @@ -631,6 +639,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 5`] = `
>
<input
aria-label="From, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={true}
id="disabled-start"
Expand Down Expand Up @@ -684,6 +693,7 @@ exports[`DatePicker Date Range renders the UI snapshot correctly 5`] = `
>
<input
aria-label="To, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={true}
id="disabled-end"
Expand Down Expand Up @@ -763,6 +773,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 1`] = `
>
<input
aria-label="Select the full date you want to visit NYPL, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="basic-start"
Expand Down Expand Up @@ -824,6 +835,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 2`] = `
>
<input
aria-label="Select the date you want to visit NYPL, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="no-label-start"
Expand Down Expand Up @@ -892,6 +904,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 3`] = `
>
<input
aria-label="Select the date you want to visit NYPL, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="custom-format-start"
Expand Down Expand Up @@ -962,6 +975,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 4`] = `
aria-describedby="invalid-start-helperText"
aria-invalid={true}
aria-label="Select the date you want to visit NYPL, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="invalid-start"
Expand Down Expand Up @@ -1047,6 +1061,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 5`] = `
<input
aria-describedby="disabled-start-helperText"
aria-label="Select the date you want to visit NYPL, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={true}
id="disabled-start"
Expand Down Expand Up @@ -1132,6 +1147,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 6`] = `
<input
aria-describedby="chakra-start-helperText"
aria-label="Select the date you want to visit NYPL, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="chakra-start"
Expand Down Expand Up @@ -1218,6 +1234,7 @@ exports[`DatePicker Single input renders the UI snapshot correctly 7`] = `
<input
aria-describedby="props-start-helperText"
aria-label="Select the date you want to visit NYPL, Press tab to access the calendar."
autoComplete={null}
className="chakra-input css-0"
disabled={false}
id="props-start"
Expand Down
2 changes: 1 addition & 1 deletion src/components/Hero/Hero.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.2.0` |
| Latest | `2.1.1` |
| Latest | `2.1.2` |

## Table of Contents

Expand Down
9 changes: 9 additions & 0 deletions src/components/Hero/heroChangelogData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
import { ChangelogData } from "../../utils/ComponentChangelogTable";

export const changelogData: ChangelogData[] = [
{
date: "2023-11-09",
version: "2.1.2",
type: "Update",
affects: ["Styles"],
notes: [
'Updates the layout for the "campaign" variant to have consistent padding on its left and right sides.',
],
},
{
date: "2023-10-26",
version: "2.1.1",
Expand Down
24 changes: 22 additions & 2 deletions src/components/Logo/Logo.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ArgTypes, Canvas, Description, Meta, Source } from "@storybook/blocks";

import { changelogData } from "./logoChangelogData";
import ComponentChangelogTable from "../../utils/ComponentChangelogTable";
import * as LogoStories from "./Logo.stories";
import Link from "../Link/Link";

Expand All @@ -10,7 +11,7 @@ import Link from "../Link/Link";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `0.25.9` |
| Latest | `1.5.2` |
| Latest | `2.1.2` |

## Table of Contents

Expand All @@ -20,6 +21,7 @@ import Link from "../Link/Link";
- {<Link href="#sizes" target="_self">Sizes</Link>}
- {<Link href="#all-logos" target="_self">All Logos</Link>}
- {<Link href="#custom-logos" target="_self">Custom Logos</Link>}
- {<Link href="#changelog" target="_self">Changelog</Link>}

## Overview

Expand Down Expand Up @@ -59,6 +61,10 @@ from the `LogoSizes` type. The values are `"default"`, `"xxsmall"`, `"xsmall"`,
Note: `"default"` sets the width to `100%` and the rendered logo will expand to
fill the full width of the parent element.

In addition, the `sizeBasedOn` prop can be passed to determine whether the size
of the `Logo` is updated based on either the `"height"` or `"width"`. By default,
the `sizeBasedOn` prop is set to `"width"`.

<Source
code={`
// Example
Expand All @@ -69,6 +75,16 @@ fill the full width of the parent element.

<Canvas of={LogoStories.Sizes} />

<Source
code={`
// Example
<Logo name="nyplFullBlack" size="large" sizeBasedOn="height" />
`}
language="jsx"
/>

<Canvas of={LogoStories.SizesBasedOnHeight} />

## All Logos

Update the icon of the `Logo` component by passing the `name` prop with a value
Expand Down Expand Up @@ -118,3 +134,7 @@ child to the `Logo` component.
/>

<Canvas of={LogoStories.CustomLogos} />

## Changelog

<ComponentChangelogTable changelogData={changelogData} />
Loading
Loading