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

Update typography docs #2290

Merged
merged 12 commits into from
Aug 13, 2024
Merged

Update typography docs #2290

merged 12 commits into from
Aug 13, 2024

Conversation

beaesguerra
Copy link
Member

@beaesguerra beaesguerra commented Aug 9, 2024

Summary:

  • Add individual stories for typography components so they are more discoverable
  • Add prop description for tag for Typography components
  • Add documentation for accessible form fields

Issue: WB-1737

Test plan:

  • Review documentation in Storybook for the tag prop for Typography components (?path=/docs/packages-typography--docs)
  • Review accessibility documentation for form fields (?path=/docs/packages-form-accessibility--docs)
  • Confirm that the individual typography components are more discoverable by using the Storybook search bar (ex: search for "label" or "heading" should result in documentation for each component)
  • Review stories for each typography component (?path=/docs/packages-typography--docs)
Screenshot 2024-08-09 at 3 45 11 PM

@beaesguerra beaesguerra self-assigned this Aug 9, 2024
Copy link

changeset-bot bot commented Aug 9, 2024

🦋 Changeset detected

Latest commit: 9eabdf8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Aug 9, 2024

Size Change: 0 B

Total Size: 95.4 kB

ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-accordion/dist/es/index.js 3.78 kB
packages/wonder-blocks-banner/dist/es/index.js 1.53 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.61 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 887 B
packages/wonder-blocks-button/dist/es/index.js 4.03 kB
packages/wonder-blocks-cell/dist/es/index.js 2.01 kB
packages/wonder-blocks-clickable/dist/es/index.js 3.06 kB
packages/wonder-blocks-core/dist/es/index.js 3.45 kB
packages/wonder-blocks-data/dist/es/index.js 6.24 kB
packages/wonder-blocks-dropdown/dist/es/index.js 14.1 kB
packages/wonder-blocks-form/dist/es/index.js 6.03 kB
packages/wonder-blocks-grid/dist/es/index.js 1.36 kB
packages/wonder-blocks-i18n/dist/es/index.js 4.76 kB
packages/wonder-blocks-icon-button/dist/es/index.js 2.99 kB
packages/wonder-blocks-icon/dist/es/index.js 828 B
packages/wonder-blocks-labeled-field/dist/es/index.js 72 B
packages/wonder-blocks-layout/dist/es/index.js 1.82 kB
packages/wonder-blocks-link/dist/es/index.js 2.27 kB
packages/wonder-blocks-modal/dist/es/index.js 5.36 kB
packages/wonder-blocks-pill/dist/es/index.js 1.64 kB
packages/wonder-blocks-popover/dist/es/index.js 4.83 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.52 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.3 kB
packages/wonder-blocks-switch/dist/es/index.js 1.94 kB
packages/wonder-blocks-testing-core/dist/es/index.js 3.64 kB
packages/wonder-blocks-testing/dist/es/index.js 1.13 kB
packages/wonder-blocks-theming/dist/es/index.js 693 B
packages/wonder-blocks-timing/dist/es/index.js 1.8 kB
packages/wonder-blocks-tokens/dist/es/index.js 1.74 kB
packages/wonder-blocks-toolbar/dist/es/index.js 855 B
packages/wonder-blocks-tooltip/dist/es/index.js 6.79 kB
packages/wonder-blocks-typography/dist/es/index.js 1.23 kB

compressed-size-action

Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.20%. Comparing base (67503ae) to head (9eabdf8).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2290      +/-   ##
==========================================
+ Coverage   94.26%   95.20%   +0.94%     
==========================================
  Files         253      253              
  Lines       30262    30262              
  Branches     1707     1856     +149     
==========================================
+ Hits        28525    28810     +285     
+ Misses       1732     1436     -296     
- Partials        5       16      +11     

see 47 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67503ae...9eabdf8. Read the comment docs.

Copy link
Contributor

github-actions bot commented Aug 9, 2024

A new build was pushed to Chromatic! 🚀

https://5e1bf4b385e3fb0020b7073c-sckjurcquk.chromatic.com/

Chromatic results:

Metric Total
Captured snapshots 0
Tests with visual changes 0
Total stories 475
Inherited (not captured) snapshots [TurboSnap] 358
Tests on the build 358

@@ -3,24 +3,26 @@ export default {
control: {type: "text"},
description: "Text to appear with the specified typography styles.",
table: {type: {summary: "React.Node"}},
type: {required: false},
Copy link
Member Author

Choose a reason for hiding this comment

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

Removing these addressed TypeScript errors! These aren't needed since these props are not being marked as required already!

@@ -0,0 +1,35 @@
import * as React from "react";
Copy link
Member Author

Choose a reason for hiding this comment

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

Creating stories for each typography component so that they are more discoverable. These won't be included in Chromatic tests. All the new stories for typography components are based on the same changes!

@beaesguerra beaesguerra marked this pull request as ready for review August 9, 2024 21:56
@khan-actions-bot khan-actions-bot requested a review from a team August 9, 2024 21:56
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Aug 9, 2024

Gerald

Required Reviewers
  • @Khan/wonder-blocks for changes to .changeset/eight-pans-impress.md, __docs__/wonder-blocks-form/_overview_.mdx, __docs__/wonder-blocks-form/accessibility.mdx, __docs__/wonder-blocks-form/accessibility.stories.tsx, __docs__/wonder-blocks-typography/body-monospace.stories.tsx, __docs__/wonder-blocks-typography/body-serif-block.stories.tsx, __docs__/wonder-blocks-typography/body-serif.stories.tsx, __docs__/wonder-blocks-typography/body.stories.tsx, __docs__/wonder-blocks-typography/caption.stories.tsx, __docs__/wonder-blocks-typography/footnote.stories.tsx, __docs__/wonder-blocks-typography/heading-large.stories.tsx, __docs__/wonder-blocks-typography/heading-medium.stories.tsx, __docs__/wonder-blocks-typography/heading-small.stories.tsx, __docs__/wonder-blocks-typography/heading-xsmall.stories.tsx, __docs__/wonder-blocks-typography/label-large.stories.tsx, __docs__/wonder-blocks-typography/label-medium.stories.tsx, __docs__/wonder-blocks-typography/label-small.stories.tsx, __docs__/wonder-blocks-typography/label-xsmall.stories.tsx, __docs__/wonder-blocks-typography/tagline.stories.tsx, __docs__/wonder-blocks-typography/title.stories.tsx, __docs__/wonder-blocks-typography/typography.argtypes.ts, __docs__/wonder-blocks-typography/typography.stories.tsx

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

Copy link
Contributor

github-actions bot commented Aug 9, 2024

npm Snapshot: NOT Published

🤕 Oh noes!! We couldn't find any changesets in this PR (9edf54a). As a result, we did not publish an npm snapshot for you.

Copy link
Member

@jandrade jandrade left a comment

Choose a reason for hiding this comment

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

Thanks for working on all these improvements! I left some comments to convert the accessibility page to MDX.


import {BodyMonospace} from "@khanacademy/wonder-blocks-typography";

export default {
Copy link
Member

Choose a reason for hiding this comment

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

thought: It would be great if we could describe what's the general purpose for each typography component, but this is not something we document anywhere, probably something worth sharing in the WB cubby meeting this week.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great idea! That would be helpful for usage - I'm not sure myself when certain typography components should be used (ex: when should the different label sizes be used?) I added it to our agenda!

Copy link
Member

Choose a reason for hiding this comment

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

suggestion: I think it would be better if this page would be created as a separate MDX file, so it can make better use of the Storybook docs feature.

You can see an example of how we use this here: https://github.com/Khan/wonder-blocks/blob/76967ed08c63c4bd0d7d44ae4ccfda9e2c7554f1/__docs__/wonder-blocks-icon/accessibility.mdx

Apart from that, the documentation is super clear and concise :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to use mdx for the docs portion, thanks for the suggestion!

* screenreaders so that it can communicate the relationship between the label and
* the form field.
*
* Guidelines:
Copy link
Member

Choose a reason for hiding this comment

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

suggestion/nit: After moving this to a MDX file, this could be formatted as a subheading (e.g. ### Guidelines).

};

/**
* <h2>Form Field Labels</h2>
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: Same here: ## Form Field Labels.

@khan-actions-bot khan-actions-bot requested a review from a team August 12, 2024 22:10
@beaesguerra beaesguerra requested a review from jandrade August 12, 2024 22:12
Copy link
Member

@jandrade jandrade left a comment

Choose a reason for hiding this comment

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

Looks great! thanks for the MDX change :shipit:

Comment on lines +24 to +26
tags: [
"!dev", // Hide individual stories from sidebar so they are only shown in the docs page.
],
Copy link
Member

Choose a reason for hiding this comment

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

Neat, TIL about this :)

@beaesguerra beaesguerra merged commit 490ddd6 into main Aug 13, 2024
16 checks passed
@beaesguerra beaesguerra deleted the docs-updates branch August 13, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants