Skip to content

Commit

Permalink
Merges in development, updates CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviawongnyc committed Dec 5, 2024
2 parents 2ad0f66 + 797a35f commit 15a9ee9
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 103 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@ Currently, this repo is in Prerelease. When it is released, this project will ad

## Prerelease

### Updates

- Updates `Template` component(s) and styles per [TAD](https://docs.google.com/document/d/1vZJX7Y-DnEM44-iWw5qoXGdxqavHEN6prhr-YDTNr0o/edit?pli=1&tab=t.0).

## 3.5.0 (December 5, 2024)

### Adds

- Adds the `"SubNav"`component.
- Adds the `SubNav` component.
- Adds the `useScrollFadeStyles` hook.

### Updates

- Updates the `MultiSelect` component to add `itemCount` as a data property to the `items` prop to render the item count for an option.

### Fixes

- Fixes issue where focus indicator was being cut off in places in the `Template` component.

## 3.4.4 (November 20, 2024)

### Adds
Expand Down
68 changes: 34 additions & 34 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nypl/design-system-react-components",
"version": "3.5.0-rc2",
"version": "3.5.0",
"description": "NYPL Reservoir Design System React Components",
"repository": {
"type": "git",
Expand Down
18 changes: 9 additions & 9 deletions src/components/MultiSelect/MultiSelect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { changelogData } from "./multiSelectChangelogData";
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `1.4.0` |
| Latest | `3.4.0` |
| Latest | `3.5.0` |

## Table of Contents

Expand Down Expand Up @@ -139,7 +139,7 @@ count. The format is as follows:
{
id: "architecture",
name: "Architecture",
isDisabled: true,,
isDisabled: true,
itemCount: 7
},
{
Expand All @@ -157,7 +157,7 @@ count. The format is as follows:
name: 'User Experience'
},
{
id: 'tecture',
id: 'architecture',
isDisabled: false,
name: 'Architecture'
},
Expand Down Expand Up @@ -329,7 +329,7 @@ child checkbox will not be clickable and its state will not change.
name: 'User Experience'
},
{
id: 'tecture',
id: 'architecture_design',
isDisabled: false,
name: 'Architecture'
},
Expand Down Expand Up @@ -382,7 +382,7 @@ child checkbox will not be clickable and its state will not change.
name: 'User Experience'
},
{
id: 'tecture',
id: 'architecture_design',
isDisabled: true,
name: 'Architecture'
},
Expand Down Expand Up @@ -446,9 +446,9 @@ the component to allow users to search the available checkbox items.

## Show Item Count

The recommended UX patterns for filtering is to include an item count associated
with each option in a `MultiSelect` component. The item counts can be rendered by
passing the `itemCount` data property to the `items` prop.
The recommended UX pattern for filtering is to include an item count associated
with each option in a `MultiSelect` component. The item counts can be rendered
by passing the `itemCount` data property to the `items` prop.

<Source
code={`
Expand Down Expand Up @@ -482,7 +482,7 @@ passing the `itemCount` data property to the `items` prop.
itemCount: 5,
},
{
id: "tecture",
id: "architecture_design",
name: "Architecture",
itemCount: 3,
},
Expand Down
8 changes: 4 additions & 4 deletions src/components/MultiSelect/MultiSelect.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const withChildrenItems = [
name: "User Experience",
},
{
id: "tecture",
id: "architecture_design",
name: "Architecture",
},
{
Expand Down Expand Up @@ -139,7 +139,7 @@ const withDisabledItems = [
isDisabled: true,
},
{
id: "tecture",
id: "architecture_design",
name: "Architecture",
isDisabled: false,
},
Expand Down Expand Up @@ -185,7 +185,7 @@ const withDisabledAllChildrenItems = [
isDisabled: true,
},
{
id: "tecture",
id: "architecture_design",
name: "Architecture",
isDisabled: true,
},
Expand Down Expand Up @@ -228,7 +228,7 @@ const withItemCountItems = [
itemCount: 5,
},
{
id: "tecture",
id: "architecture_design",
name: "Architecture",
itemCount: 3,
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/MultiSelect/multiSelectChangelogData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { ChangelogData } from "../../utils/ComponentChangelogTable";

export const changelogData: ChangelogData[] = [
{
date: "Prerelease",
version: "Prerelease",
date: "2024-12-05",
version: "3.5.0",
type: "Update",
affects: ["Documentation", "Functionality"],
notes: [
Expand Down
8 changes: 4 additions & 4 deletions src/components/SubNav/SubNav.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import { changelogData } from "./subNavChangelogData";

# SubNav

| Component Version | DS Version |
| ----------------- | ------------ |
| Added | `Prerelease` |
| Latest | `Prerelease` |
| Component Version | DS Version |
| ----------------- | ---------- |
| Added | `3.5.0` |
| Latest | `3.5.0` |

## Table of Contents

Expand Down
26 changes: 17 additions & 9 deletions src/components/SubNav/SubNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,28 @@ interface SubNavButtonProps extends SubNavItemProps {

export const SubNavButton: React.FC<
React.PropsWithChildren<SubNavButtonProps>
> = ({ id, children, isOutlined, isSelected, screenreaderOnlyText = "" }) => {
> = ({
id,
children,
isOutlined,
isSelected,
onClick,
screenreaderOnlyText = "",
}) => {
const childrenStyles = useMultiStyleConfig("SubNavChildren", {
isOutlined: isOutlined,
});

return (
<li>
<Button
id={id}
aria-current={isSelected ? "page" : null}
buttonType="text"
className={isSelected ? "selectedItem" : ""}
sx={childrenStyles.outLine}
aria-current={isSelected ? "page" : null}
id={id}
onClick={onClick}
screenreaderOnlyText={screenreaderOnlyText}
sx={childrenStyles.outLine}
>
{children}
</Button>
Expand All @@ -150,14 +158,14 @@ export const SubNavLink: React.FC<React.PropsWithChildren<SubNavLinkProps>> = ({
return (
<li>
<Link
key={id}
id={id}
type="action"
aria-current={isSelected ? "page" : null}
className={isSelected ? "selectedItem" : ""}
href={href}
id={id}
isUnderlined={false}
key={id}
screenreaderOnlyText={screenreaderOnlyText}
aria-current={isSelected ? "page" : null}
className={isSelected ? "selectedItem" : ""}
type="action"
sx={childrenStyles.outLine}
>
{children}
Expand Down
4 changes: 2 additions & 2 deletions src/components/SubNav/subNavChangelogData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { ChangelogData } from "../../utils/ComponentChangelogTable";

export const changelogData: ChangelogData[] = [
{
date: "Prerelease",
version: "Prerelease",
date: "2024-12-05",
version: "3.5.0",
type: "New Feature",
affects: ["Documentation", "Functionality"],
notes: ["Added the `SubNav` component"],
Expand Down
9 changes: 9 additions & 0 deletions src/components/Template/templateChangelogData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ export const changelogData: ChangelogData[] = [
"Major update to component and styles based on the [Template TAD](https://docs.google.com/document/d/1vZJX7Y-DnEM44-iWw5qoXGdxqavHEN6prhr-YDTNr0o/edit?pli=1&tab=t.0).",
],
},
{
date: "2024-12-05",
version: "3.5.0",
type: "Bug Fix",
affects: ["Styles"],
notes: [
"Adjusts padding to fix an issue where focus indicators were being cut off in the primary content section.",
],
},
{
date: "2024-10-02",
version: "3.4.0",
Expand Down
Loading

0 comments on commit 15a9ee9

Please sign in to comment.