-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temporarily move offending stories (#2956)
* temporarily move offending stories * temp old storybook * radial * migrate layout components (#2961) * move old layout components for ref * update pkgs + try dark theme * basic light mode working * color modes working in components * configure toolbar + start adding params * dark mode theme config working, start on DocsPage configs * keep migrating * anchors working * aboutheader working, need to start working on other headers + types * fix type errors in .storybook layout components * test stories, need to fix prettier * fix formatting * fixed theming ! * better heading * fix other pkg weirdness * fix default homepage + docs ordering * add absolute paths * add absolute paths * create story template (#2964) * create story template * move template out of atoms * update import * withSource to sourceState --------- Co-authored-by: cassie spain <[email protected]> * add source to template * fix Canvas in template * allow static images in storybook 8 (#2973) * test image stuff * getting closer * test dist * remove asset tests * test in pr * tweak some more examples * create foundations + layout stories (#2966) * create foundations + layout stories * feat(Molecules Pages) (#2971) added existing Molecules pages * typography + meta (#2975) * create foundations + layout stories * start foundations * start retooling componentheader * component header tweak * start restructure of header components * TOC + Theme working, need DataTable + code background color * working on color mode - need to fix text color * revert test * Theme page sorted, need to fix ColorMode * colormode sorted * colormode sorted * start type fix + what to do about blocks * LayoutGrid + content Container * LayoutGrid done * start flexbox, need to look into sandbox stuff * gridbox + flexbox are good, just need to tweak * tweaks to headers * lots of style tweaks + deduplications * fix typograpth, need to fix color mode switches * start on system stories * unify shared elements * add variance + fix tables * more tweaks to status * design tweaks * add hub * more tweaks * rename DataTable * clean up of default * typography + meta stories * add anchor story * start text + hiddentext * text done * started snippet changes * fixed code snippets * meta and sorted done?" * renamed + sorting * more kenny edits * more kenny edits + other new tab for links * the last of it * fix molecule order * update production deploy (#2980) * [gm-916] update storybook production deploy * swap to relative pathing * again * feat(Organisms) (#2978) * added in Organisms stories * remove old styleguide files * Revert "remove old styleguide files" This reverts commit baba497. * feat(Atoms): migrate all Atom stories (#2972) * create story template * move template out of atoms * update import * skip to content * withSource to sourceState * update skip to content * tag story * add statuses * radial progress story * updates from figma * toggle story * update status * pattern story * update toggle interactive example * illustrations story * focus trap story * update playground examples * floating card story * update illustrations subtitle * drawer story * update drawer story * animation story * add figma links * card story * about page * progress bar story * popovercontainer story * loader stories * fix about pages * move examples below * icon stories * checkbox story * add checkbox example * most of input story * Badges started (#2979) * Badges started * badges done * add most GH links, need to test * add github links to most pages * remove comment * finish input stories * update more github links * textarea story * radio story * update examples * select story * fix card usage guidelines * feat(Atoms): adding in the remaining Atoms (#2982) * finished badges * added buttons * added formelements * updated about page * minor touchups * fixed minor ts error * updated usage for CTAButton and IconButton * selectdropdown story * remove optional text * update forminputs table of contents * fix forminput table of contents links * remove logo story * remove placeholder text * update main table of contents * fix icon table of contents * fix loaders table of contents links * PR feedback * uncomment link --------- Co-authored-by: cassie spain <[email protected]> Co-authored-by: Kenny Lin <[email protected]> * remove old styleguide files (#2985) --------- Co-authored-by: Amy Resnik <[email protected]> Co-authored-by: Kenny Lin <[email protected]> --------- Co-authored-by: Amy Resnik <[email protected]> Co-authored-by: Kenny Lin <[email protected]>
- Loading branch information
1 parent
c522fd1
commit c92c5e0
Showing
243 changed files
with
22,726 additions
and
3,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
packages/styleguide/.storybook/components/Elements/Callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Alert } from '@codecademy/gamut'; | ||
|
||
export const Callout: React.FC<{ text: string }> = ({ text }) => { | ||
return ( | ||
<Alert type="subtle" placement="inline"> | ||
{text} | ||
</Alert> | ||
); | ||
}; |
27 changes: 27 additions & 0 deletions
27
packages/styleguide/.storybook/components/Elements/ComponentSource.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { OpenIcon } from '@codecademy/gamut-icons'; | ||
import { Anchor } from '@codecademy/gamut'; | ||
import { css } from '@emotion/react'; | ||
import styled from '@emotion/styled'; | ||
|
||
export const SourceAnchor = styled(Anchor)( | ||
css({ height: '100%', alignContent: 'center' }) | ||
); | ||
|
||
export const sourceAnchorProps = { | ||
icon: OpenIcon, | ||
iconPosition: 'right', | ||
target: '_blank', | ||
} as const; | ||
|
||
export const ComponentSource: React.FC<{ | ||
repo: string; | ||
githubLink?: string; | ||
}> = ({ repo, githubLink }) => { | ||
const npmLink = | ||
githubLink ?? `https://www.npmjs.com/package/@codecademy/${repo}`; | ||
return ( | ||
<SourceAnchor href={npmLink} {...sourceAnchorProps}> | ||
@codecademy/{repo} | ||
</SourceAnchor> | ||
); | ||
}; |
Oops, something went wrong.