Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ab90f39
fix readme and set up nav bar
LinKCoding Dec 19, 2024
846138c
testing a11y guidelines
LinKCoding Dec 20, 2024
3317d03
revert preview.ts
LinKCoding Dec 20, 2024
b5b0908
working story and small clean up
LinKCoding Dec 20, 2024
e09f585
add ux copy checklist
LinKCoding Dec 20, 2024
0a22161
alerts and bell notification
LinKCoding Dec 20, 2024
228eae5
fix bell notification's title
LinKCoding Dec 20, 2024
96891ca
added button and links page
LinKCoding Dec 20, 2024
f996a08
removed root aboutheader, which wasn't being used
LinKCoding Dec 20, 2024
8a9848e
added confirmation dialog
LinKCoding Dec 20, 2024
18f899f
added error messages page
LinKCoding Dec 20, 2024
1136a67
added toasts, tooltips, and toc for component guidelines
LinKCoding Dec 20, 2024
db71462
fix ups
LinKCoding Dec 20, 2024
e6d7d51
added tocs and final touch ups
LinKCoding Dec 20, 2024
dec8c02
addressed immediate feedback
LinKCoding Jan 3, 2025
1e29f71
update ui checklist
LinKCoding Jan 3, 2025
0737979
more updates
LinKCoding Jan 3, 2025
3a5dc24
updated a11y guidelines
LinKCoding Jan 3, 2025
beae8de
added alt text page
LinKCoding Jan 3, 2025
695eb7a
update links
LinKCoding Jan 3, 2025
0e74ccb
updated brand voice link
LinKCoding Jan 3, 2025
c6decef
fix broken links
LinKCoding Jan 3, 2025
350f11a
reordering links and typo
LinKCoding Jan 3, 2025
b23cdb1
clean up tsconfig file
LinKCoding Jan 3, 2025
2d598e3
Merge branch 'main' into kl-gm-960
LinKCoding Jan 6, 2025
c7a13d6
remove href from tableofcontents type
LinKCoding Jan 6, 2025
6601b1b
Merge branch 'main' into kl-gm-960
LinKCoding Jan 10, 2025
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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Gamut

// Storybook 8 branch

_The component library & design system for Codecademy._ ✨

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type PageLink = {
status?: 'current' | 'updating' | 'deprecated' | 'static';
subtitle: string;
title: string;
href: string;
};

export const TableOfContents: React.FC<{ links: PageLink[] }> = ({ links }) => {
Expand Down
1 change: 1 addition & 0 deletions packages/styleguide/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const preview: Preview = {
'Typography',
'Atoms',
'Molecules',
'Organisms',
'*',
],
},
Expand Down
23 changes: 0 additions & 23 deletions packages/styleguide/AboutHeader.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/styleguide/src/lib/Molecules/Alert/Alert.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Use an alert to display an important, succinct message with actions for users to
- Form field validation– for inline form errors or validation messages, use inline messaging within the form fields instead of an alert.

## Anatomy
<ImageWrapper src="./alertAnatomy.png" alt="Alert Anatomy diagram"/>
<ImageWrapper src="./molecules/alertAnatomy.png" alt="Alert Anatomy diagram"/>

1. Icon
- Automatically displays for the selected alert type: general, success, error, or subtle
Expand Down
58 changes: 58 additions & 0 deletions packages/styleguide/src/lib/UX Writing/About.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { Meta } from '@storybook/blocks';

import { AboutHeader, TableOfContents } from '~styleguide/blocks';

export const parameters = {
id: 'UX Writing',
title: 'UX Writing',
subtitle: 'Help learners find success by surfacing the right copy and content to the right people at the right time.',
}

<Meta title='UX Writing/About' />

<AboutHeader {...parameters} />

Words are powerful tools that can help us achieve our mission of empowering inspiring careers in technology. When we surface the right words and content to the right people at the right time, we help learners reach their goals. When our learners are successful, so are we.

In the following pages, you’ll find a collection of tips and tools for writing effective product copy on your own. Need a little help? [Submit a UX writing request here.](https://skillsoftdev.atlassian.net/jira/software/c/projects/WRITE/boards/685)


<TableOfContents
links={[
{
id: 'Alerts',
subtitle: 'Make clear what you’re alerting the user to. Then, clarify any next steps they need to take or inform them about the timing of a resolution on our end.',
title: 'Alerts',
},
{
id: 'Bell notification',
subtitle: 'Keep it brief (<86 characters), make it actionable, and ensure the messaging is in support of the learner’s journey.',
title: 'Bell notification',
},
{
id: 'Button and links',
subtitle: 'Be specific, use action-oriented language, and emphasize value. Keep to 3 words or less (unless necessary for clarity), and use sentence case.',
title: 'Button and links',
},
{
id: 'Confirmation dialogs',
subtitle: 'Simplify the language, prioritize the message, and make sure the implication of what learners are saying "Yes" (or "No") to is crystal clear.',
title: 'Confirmation dialogs',
},
{
id: 'Error messages',
subtitle: 'Above all else, error messages should explain and resolve. Inform learners of what went wrong and let them know how to proceed.',
title: 'Error messages',
},
{
id: 'Toasts',
subtitle: 'Keep it brief, ensure the message is personal and relevant, and avoid distracting from the learning experience.',
title: 'Toasts',
},
{
id: 'Tooltips',
subtitle: `Keep tooltips short and useful. Avoid using them to share information that's vital for learners to complete tasks.`,
title: 'Tooltips',
},
]}
/>
115 changes: 115 additions & 0 deletions packages/styleguide/src/lib/UX Writing/Accessibility guidelines.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import { Meta } from '@storybook/blocks';

import { AboutHeader } from '~styleguide/blocks';


export const parameters = {
title: "Accessibility guidelines",
subtitle: 'In order for content to be accessible, it must be perceivable, operable, understandable, and robust.',
status: 'static',
};

<Meta title="UX Writing/Accessibility guidelines" />

<AboutHeader {...parameters} />

## The 4 principles of accessibility

The World Wide Web Consortium (W3C) is the Internet's main international standards organization. W3C maintains a set of guidelines for web accessibility. The most up-to-date version of W3C's Web Content Accessibility Guidelines is [WCAG 2.2](https://www.w3.org/TR/WCAG22/).

The Web Content Accessibility Guidelines contain 4 principles for creating accessible content. Understanding these 4 principles is key to understanding how to write accessible content.

### 1. Perceivable

Information on-screen must be perceivable to blind, deaf, low-vision, or color-blind learners.

- Include meaningful and unique alt text for all non-decorative images or icons
- Don't rely on visuals for words to make sense
- If text is meant to be read, include it as text and not an image
- Include captions for video and audio content

### 2. Operable

Content should be easy for users to navigate and find what they're looking for. Touch and click targets should be easy to hit and content should be accessible with a screen reader.

- Make hyperlink text long enough that it's easy to hover over and click
- Use meaningful, unique, and descriptive CTAs
- Avoid ambiguous link text like "Click here" or "Read more"
- If more than one label contains the same text, clarify with screen-reader-only text
- Write so that labels, tooltips, and input fields appear in a logical order
- Avoid directional language like "above" or "below"
- Ensure users have enough time to read text

### 3. Understandable

Content should be easy to understand. Plus, it should appear and operate in predictable ways.

- Use H1, H2, H3 headings correctly and consistently ([Learn more about headings](https://www.notion.so/Headings-be907c4d24c84dffb970cedc3ee54936))
- Check to ensure copy is at a 7th-grade reading level or below
- Use short, clear sentences and paragraphs
- Avoid jargon, slang, and idioms
- Expand acronyms on first use
- Use list formatting when appropriate

### 4. Robust

- Write in a way that's platform-agnostic (i.e. select or choose vs. tap or click)

### Bonus: Meaningful

You'll find the word "meaningful" used a lot in guidance for writing for accessibility. So we're taking the opportunity to throw in a quick definition of what we mean when we use it.

Meaningful text is useful text. It provides the full context a user needs to understand a situation.

Meaningful alt text describes what's important about an image a user can't see. Meaningful button text clearly where a link will go. It avoids ambiguous standalone phrases like "click here" or "read more."

## Accessible content checklist

### Alt text
- Is alt text included for all non-decorative images on the page?
- Does your alt text provide all the information a user needs to understand what the image is being used to convey?

### Buttons
- Is CTA text meaningful? Is it clear where clicking will take the user?
- If there is more than one button on the page, is the text for each button unique?
- If each button is not unique, have you provided screen-reader-only text to clarify?

### Headings
- Does your page include a single, unique H1 title?
- Are H2 and H3 headings used correctly and consistently?



### Hyperlinks
- Is link text meaningful? Is it clear where clicking will take the user?
- Are hyperlinks long enough (2-3 words) to be easy to click on?
- If there is more than one hyperlink on the page, is the text for each link unique?
- If each hyperlink is not unique, have you provided screen-reader-only text to clarify?


### Imagery
- Do all non-decorative images or icons contain[alt text](https://skillsoftdev.atlassian.net/wiki/spaces/265f8fcabee0479ea6841c6b0b7e2171/pages/4440883349/Alternate+alt+text)?
Copy link
Contributor Author

@LinKCoding LinKCoding Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

certain pages pointed to notion, like this one, but I found the corresponding confluence page.
since this repo is open-source, should we make this information more available?
e.g. I can copy/paste what's in the confluence onto this page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me take a look at our Accessibility guidelines page and come back to this. We may be able to link to a section there instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circling back...
Yes this section looks perfect! https://skillsoftdev.atlassian.net/wiki/spaces/265f8fcabee0479ea6841c6b0b7e2171/pages/4440883349/Alternate+alt+text
Let's add it under "Component guidelines" for now (even though it's not technically a component).
Thanks so much for finding it!

- Does the alt text provide all the information a user needs to understand what the image is being used to
- Are all words understandable without reliance on imagery?


### Readability
- Do users have enough time to read the text?
- Is your copy at a reading level of grade 7 or below? Test with [Hemingway App](https://hemingwayapp.com).
- Are sentences and paragraphs short and clear?
- Is your content free of jargon, slang, and idioms?
- Have you used list formatting when appropriate?
- Do users have enough time to read the text?

### Screenreader compatibility
- Does text appear in chronological order?
- Are headings used correctly and appropriately?
- Have you avoided directional language (i.e. "the form on the right" or "in the section below")?
- Is the language platform-agnostic?
- Have you passed the buttons, headings, hyperlinks, imagery, and readability checklists?


### Video and audio content
- Are captions included for all audio and video content?
- For video, do the captions match what's happening on-screen?
- For audio, are transcripts available?
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { Meta } from '@storybook/blocks';

import { AboutHeader, LinkTo, TableOfContents } from '~styleguide/blocks';

export const parameters = {
id: 'Component Guidelines',
title: 'Component Guidelines',
subtitle: 'Get up to speed on best practices for writing for user interfaces, including guidance for writing for specific components in Gamut.',
}

<Meta title='UX Writing/Component Guidelines/About' />

<AboutHeader {...parameters} />

Writing on your own? Use the <LinkTo id="UX Writing/UI copy checklist">step-by-step guide</LinkTo> to ensure the copy is clear and useful.

<TableOfContents
links={[
{
id: 'Component Guidelines/Alerts',
subtitle: 'Make clear what you’re alerting the user to. Then, clarify any next steps they need to take or inform them about the timing of a resolution on our end.',
title: 'Alerts',
},
{
id: 'Component Guidelines/Bell notification',
subtitle: 'Keep it brief (<86 characters), make it actionable, and ensure the messaging is in support of the learner’s journey.',
title: 'Bell notification',
},
{
id: 'Component Guidelines/Button and links',
subtitle: 'Be specific, use action-oriented language, and emphasize value. Keep to 3 words or less (unless necessary for clarity), and use sentence case.',
title: 'Button and links',
},
{
id: 'Component Guidelines/Confirmation dialogs',
subtitle: 'Simplify the language, prioritize the message, and make sure the implication of what learners are saying "Yes" (or "No") to is crystal clear.',
title: 'Confirmation dialogs',
},
{
id: 'Component Guidelines/Error messages',
subtitle: 'Above all else, error messages should explain and resolve. Inform learners of what went wrong and let them know how to proceed.',
title: 'Error messages',
},
{
id: 'Component Guidelines/Toasts',
subtitle: 'Keep it brief, ensure the message is personal and relevant, and avoid distracting from the learning experience.',
title: 'Toasts',
},
{
id: 'Component Guidelines/Tooltips',
subtitle: `Keep tooltips short and useful. Avoid using them to share information that's vital for learners to complete tasks.`,
title: 'Tooltips',
},
]}
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { Alert, Text } from '@codecademy/gamut/src';
import { Meta } from '@storybook/blocks';

import { AboutHeader, LinkTo } from '~styleguide/blocks';


export const parameters = {
title: "Alerts",
subtitle: 'Make clear what you’re alerting the user to. Then, clarify any next steps they need to take or inform them about the timing of a resolution on our end.',
status: 'static',
};

<Meta title="UX Writing/Component guidelines/Alerts" />

<AboutHeader {...parameters} />




Alerts are used to display important information and, if relevant, provide relevant actions the learner needs to take to resolve the alert.

Alerts are similar to <LinkTo id="UX Writing/Component guidelines/Error messages">error messages</LinkTo>, but the approach is slightly different. An error message informs users of **what went wrong** and **how to proceed**, but with an alert nothing has gone wrong _yet_.

Alerts should make clear **what the issue or information is** and **how to proceed**. In the event of an alert, the user might need to take action to proceed _or_ they may simply need to be informed that _we_ will be taking action within a specific timeframe.

## Examples

<br />

<Alert type="general" cta={{ children: 'Resend verification' }} mx={0} >
<Text> Please verify your email so we can make sure your account is secure. A link
has been sent to name@email.com. </Text>
</Alert>

<br />

<Alert type="success" cta={{ children: '' }}>
<Text>Success! Your content has been assigned.</Text>
</Alert>

<br />

<Alert type="error" cta={{ children: '' }}>
<Text>We were unable to add this team member. Please refresh the page and try again.</Text>
</Alert>

<br />

<Alert type="notice" cta={{ children: 'Learn more' }}>
<Text>Maintenance: Codecademy will be offline between 2AM and 4AM EST.</Text>
</Alert>

<br />

<Alert type="feature" cta={{ children: 'Add your name' }}>
<Text>Update your profile with your name to help your team with account management.</Text>
</Alert>

<br />

## Best practices

- **Start with the full context in mind.** Your goal is to alert the learner without frustration. That's why, before you start writing, you'll need to know answers to the following questions:
1. What will a learner be trying to do when this alert appears?
2. What might happen if the learner doesn't receive the information in this alert?
3. Does the learner need to take action to remove the alert?
4. If the learner can't resolve the alert on their own, what information can we provide so they know what to expect?
- **Explain and clarify how to proceed.** Inform learners of the issue or information (explain) and let them know how to proceed. For example, we may alert learners that they need to verify their email address before they can update their profile. If there is no way for them to proceed, don't just leave them hanging. For instance, if the site has scheduled downtime, let them know when it will be back up. If more information is needed, prompt them to contact customer support or share a link to an FAQ where they can learn more.
- **Write in a conversational style.** Oftentimes, alerts end up sounding robotic. Instead of writing like a computer, write like a human. Before you start writing, try explaining things to yourself or someone else out loud. This practice can help you figure out how to write the alert in a more human way.
- **Front-load the most important information.** While our alert component allows for multiple lines of text, we truncate after the first line and users can expand to see the full message.

## Checklist
- Does the alert explain the information or issue clearly?
- If relevant, have you explained what the user can do to resolve the alert or what we're doing on our end?
- Is important information front-loaded?
- Have you asked someone unrelated to the project to read the message and did they understand it?
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { Meta } from '@storybook/blocks';

import { AboutHeader } from '~styleguide/blocks';

export const parameters = {
title: "Bell notification",
subtitle: 'Keep it brief (<86 characters), make it actionable, and ensure the messaging is in support of the learner’s journey.',
status: 'static',
};

<Meta title="UX Writing/Component guidelines/Bell notification" />

<AboutHeader {...parameters} />

Bell notifications let us share CTAs relevant to a learner’s personal experience. This includes things like changes to a course a learner is taking, responses to a forum post they wrote, or other calls to action that support their learning journey.

## Best practices

- **Notifications are personal.** Bell notifications should be used to surface calls to action that are relevant to a learner’s personal experience.
- **Notifications support focused learning.** Bell notifications should notify learners about information in support of their learning journey. They should not be a deterrent or distractor to that learning. The messaging should be relevant to the interactions, content, goals, and interests of the individual learner.
- **Notifications are actionable.** All notifications should have a personalized, clickable action. Use a bell notification only when there is a relevant action to take. Otherwise, opt for a different communication channel.
- **Notifications are brief messages.** Notifications should be no longer than 86 characters (max. 3 lines). Unless otherwise specified — or directly removed by the learner — a notification should disappear after 30 days.

## Checklist
- Does the notification include an action for the learner to take?
- Is the action clear?
- Is the notification copy 86 characters or less?
Loading
Loading