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

typography + meta #2975

Merged
merged 56 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e75c216
create foundations + layout stories
dreamwasp Nov 1, 2024
077dceb
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 1, 2024
6537339
start foundations
dreamwasp Nov 4, 2024
03b9002
start retooling componentheader
dreamwasp Nov 4, 2024
55a5dcb
component header tweak
dreamwasp Nov 4, 2024
6d85bc3
start restructure of header components
dreamwasp Nov 4, 2024
7cee2cc
TOC + Theme working, need DataTable + code background color
dreamwasp Nov 4, 2024
2d96f2a
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 4, 2024
826963c
working on color mode - need to fix text color
dreamwasp Nov 4, 2024
497d63b
Merge branch 'cass-gm-842' of ssh://github.com/Codecademy/gamut into …
dreamwasp Nov 4, 2024
7f75bca
revert test
dreamwasp Nov 5, 2024
9b69962
Theme page sorted, need to fix ColorMode
dreamwasp Nov 5, 2024
cb3c78a
colormode sorted
dreamwasp Nov 6, 2024
d85461f
colormode sorted
dreamwasp Nov 6, 2024
b1f2136
start type fix + what to do about blocks
dreamwasp Nov 6, 2024
be4e7ca
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 6, 2024
7032817
LayoutGrid + content Container
dreamwasp Nov 7, 2024
2ab0c47
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 7, 2024
5053d9b
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 7, 2024
f20113c
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 7, 2024
927e21a
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 7, 2024
4abf62e
LayoutGrid done
dreamwasp Nov 7, 2024
86f15c9
Merge branch 'cass-gm-842' of ssh://github.com/Codecademy/gamut into …
dreamwasp Nov 7, 2024
02bcda0
start flexbox, need to look into sandbox stuff
dreamwasp Nov 8, 2024
2c044d5
gridbox + flexbox are good, just need to tweak
dreamwasp Nov 8, 2024
76ace8d
Merge branch 'cass-sb-8-layout', remote-tracking branch 'origin' into…
dreamwasp Nov 8, 2024
be7ec47
tweaks to headers
dreamwasp Nov 8, 2024
a77ce8e
lots of style tweaks + deduplications
dreamwasp Nov 8, 2024
b286e5a
fix typograpth, need to fix color mode switches
dreamwasp Nov 8, 2024
af5be6e
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 11, 2024
a4d6db1
start on system stories
dreamwasp Nov 12, 2024
45ff066
unify shared elements
dreamwasp Nov 12, 2024
0693a32
add variance + fix tables
dreamwasp Nov 12, 2024
d98ca77
more tweaks to status
dreamwasp Nov 12, 2024
c8f9041
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 12, 2024
7641220
design tweaks
dreamwasp Nov 12, 2024
2759bd2
Merge branch 'cass-gm-842' of ssh://github.com/Codecademy/gamut into …
dreamwasp Nov 12, 2024
018ffc3
add hub
dreamwasp Nov 12, 2024
2e01130
more tweaks
dreamwasp Nov 12, 2024
3b3d557
Merge branch 'cass-sb-8-layout' into cass-gm-842
dreamwasp Nov 13, 2024
dce02a1
rename DataTable
dreamwasp Nov 13, 2024
37ab760
clean up of default
dreamwasp Nov 13, 2024
5902037
typography + meta stories
dreamwasp Nov 13, 2024
ee48957
add anchor story
dreamwasp Nov 14, 2024
862fedf
start text + hiddentext
dreamwasp Nov 18, 2024
206fad4
Merge remote-tracking branch 'origin/cass-sb-8-layout' into cass-gm-843
dreamwasp Nov 18, 2024
5c59281
text done
dreamwasp Nov 18, 2024
b473bbb
started snippet changes
dreamwasp Nov 20, 2024
ffb9aa3
fixed code snippets
dreamwasp Nov 20, 2024
a9a528d
meta and sorted done?"
dreamwasp Nov 20, 2024
529822f
renamed + sorting
dreamwasp Nov 21, 2024
b7e1e79
Merge branch 'cass-sb-8-layout' into cass-gm-843
dreamwasp Nov 21, 2024
ce24811
Merge branch 'cass-sb-8-layout' into cass-gm-843
dreamwasp Nov 22, 2024
7d3bed2
more kenny edits
dreamwasp Nov 25, 2024
35bcd5b
more kenny edits + other new tab for links
dreamwasp Nov 25, 2024
2a4bf89
the last of it
dreamwasp Nov 25, 2024
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
171 changes: 111 additions & 60 deletions .vscode/stories.code-snippets
Original file line number Diff line number Diff line change
@@ -1,86 +1,137 @@
{
"Component Story": {
"prefix": "component-story",
"Component Doc": {
"prefix": "component-doc",
"body": [
"import { $1 } from '@codecademy/$2';",
"import title from '@codecademy/macros/lib/title.macro';",
"import { Canvas, Meta, Story } from '@storybook/addon-docs/blocks';",
"import { PropsTable } from '@codecademy/storybook-addon-variance';",
"import { Canvas, Controls, Meta } from '@storybook/blocks';",
"",
"import { ComponentHeader } from '~styleguide/blocks';",
"",
"import * as $1Stories from './$1.stories';",
"",
"export const parameters = {",
"subtitle: `Template component`,",
"design: {",
"type: 'figma',",
"url: 'https: //www.figma.com/file/XXX',",
" },",
"status: 'current',",
"source: {",
"repo: '$2',",
"// this is easy to find by right clicking on the file in VSCode and clicking 'Copy Remote File Url From...' and the selecting 'main' or amending the url path below like so: https://github.com/Codecademy/gamut/blob/main/packages/${2}/src/file/location",
"githubLink:",
"'https: //github.com/Codecademy/gamut/blob/main/packages/gamut/src/Logo',",
" },",
"};",
"<Meta of={$1Stories}/>",
"",
"<ComponentHeader {...parameters} />",
"",
"## Usage",
"",
"Use $1 to [what it should be used for]",
"",
"### Best practices:",
"",
"- [recommendation / best practice for implementation]",
"- [recommendation / best practice for implementation]",
"",
"When NOT to use",
"",
"- [use case]- for [describe the use case], use the [similar component] component.",
"- [use case]- for [describe the use case], use the [similar component] component",
"",
"## Anatomy",
"",
"[Insert image exported from Figma]",
"",
"1. [Element name]",
"- [description including available options and ux writing if relevant]",
"",
"<Meta",
" title={title}",
" component={$1}",
" parameters={{",
" subtitle: '$3',",
" source: '$2',",
" status: 'current' | 'updating' | 'deprecated' | 'static'$4 ,",
" design: {",
" type: 'figma',",
" url: 'https://www.figma.com/file/$5',",
" }",
" }}",
" args={{}}",
"/>",
"## Variants",
"",
"`$1` component summary goes here",
"### [Variant 1 name]",
"",
"## Design Principles",
"Use the [variant 1 name] to [what it should be used for]",
"",
"Design Principles summary",
"<Canvas of={$1Stories.Default} />",
"",
"## Usage Guidelines",
"## Playground",
"",
"Usage summary",
"If you are using a story named 'Default', you can forgo the `of` prop.",
"",
"## Code Playground",
"<Canvas sourceState='shown' of={$1Stories.Default} />",
"",
"<Canvas>",
" <Story name=\"$1\">",
" {(args) => <$1 {...args} />}",
" </Story>",
"</Canvas>",
"<Controls />",
"",
"<PropsTable story=\"$1\"/>"
"## Accessibility considerations",
"",
"- [Accessibility guidance]",
"",
"## UX writing",
"",
"- [content]",
" - [guidance]",
" - [guidance]"
],
"description": "Default Component Story Structure."
"description": "Default Component Doc Structure."
},
"Table of Contents Story": {
"prefix": "toc-story",
"body": [
"import title from '@codecademy/macros/lib/title.macro';",
"import { Meta } from '@storybook/addon-docs/blocks';",
"import { Meta } from '@storybook/blocks';",
"import { AboutHeader, TableOfContents } from '~styleguide/blocks';",
"",
"export const parameters = {",
" id: '$1',",
" title: '$1/About',",
" subtitle: '$2',",
" }",
"",
"import { TableOfContents } from '~styleguide/blocks';",
"<Meta title='$1/About' />",
"",
"<Meta",
" title={title}",
" parameters={{",
" subtitle: '$3',",
" }}",
"/>",
"<AboutHeader {...parameters} />",
"",
"<TableOfContents />"
"Foundations make up the smallest scale design values that comprise a design system. Sometimes referred to elsewhere as "tokens", they are the abstract units that comprise and stitch together our atoms, molecules, and organisms.",
"",
"<TableOfContents",
" links={[",
" {",
" id: '$1/Category',",
" subtitle: 'Short description',",
" title: 'Category',",
" }",
" ]}",
"/>"
],
"description": "TOC Story Structure."
},
"Canvas Block": {
"prefix": "canvas-block",
"body": [
"<Canvas>",
" <Story name=\"$1\" args={{}}>",
" {(args) => <$2 {...args} />}",
" </Story>",
"</Canvas>"
],
"description": "A single story block wrapped in a canvas"
},
"Story Block": {
"prefix": "story-block",
"Component Story": {
"prefix": "component-story",
"body": [
" <Story name=\"$1\" args={{}}>",
" {(args) => <$2 {...args} />}",
" </Story>"
"import { $1 } from '@codecademy/gamut';",
"import type { Meta, StoryObj } from '@storybook/react';",
"",
"const meta: Meta<typeof $1> = {",
" component: $1,",
" args: {},",
"};",
"",
"export default meta;",
"type Story = StoryObj<typeof $1>;",
"",
"export const Default: Story = {",
" args: {",
" children: 'Test'",
" },",
"};",
"",
"export const Secondary: Story = {",
" args: {",
" children: 'Test again',",
" variant: 'secondary'",
" }",
"};"
],
"description": "A single story block without a canvas"
"description": "Default TSX story structure."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
InfoTip,
Text,
} from '@codecademy/gamut';
import { Background } from '@codecademy/gamut-styles';
import { Figma } from '@storybook/addon-designs/blocks';
import { Title } from '@storybook/blocks';
import * as React from 'react';
Expand Down
19 changes: 17 additions & 2 deletions packages/styleguide/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,28 @@ import { DocsContainer } from './components/Elements/DocsContainer';

const preview: Preview = {
parameters: {
backgrounds: {
disable: true,
},
docs: {
container: DocsContainer,
theme: theme,
toc: { headingSelector: 'h1, h2, h3' },
},
backgrounds: {
disable: true,
options: {
storySort: {
method: 'configure',
includeNames: true,
order: [
'Meta',
['About', 'Best Practices', 'Contributing', 'FAQs', 'Stories'],
'Foundations',
'Layouts',
'Typography',
'Atoms',
'*',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we can add Molecules + Organisms here after they're merged in!

],
},
},
viewport: {
defaultViewport: 'responsive',
Expand Down
40 changes: 40 additions & 0 deletions packages/styleguide/src/lib/Meta/About.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Meta } from '@storybook/blocks';

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

export const parameters = {
id: 'Meta',
title: 'Meta',
subtitle:
'Documentation and associated links explaining our in-progress approach to a design system.',
};

<Meta title="Meta/About" />

<AboutHeader {...parameters} />

<TableOfContents
links={[
{
id: 'Meta/Best Practices',
subtitle: 'Current best practices for using the Gamut Design System',
title: 'Best Practices',
status: 'current',
},
{
id: 'Meta/Contributing',
subtitle: `Thanks so much for being interested in contributing to Gamut! We love working with Codecademy employees across all our teams.`,
title: 'Contributing',
},
{
id: 'Meta/FAQ',
dreamwasp marked this conversation as resolved.
Show resolved Hide resolved
subtitle: `Please let us know if there are questions you'd like answered here!`,
title: 'FAQ',
},
{
id: 'Meta/Stories',
subtitle: `We're still building these opinions out, so don't expect all stories to adhere just yet!`,
title: 'Stories',
},
]}
/>
Loading
Loading