v3/packages/design-system/atoms/typography/typography.stories.tsx
Katalina 3291f9aacc
big overhaul (#474)
* miniflare init

* feat(api): add tests

* chore: more tests, almost 100%

* add sessions/state spec

* add majority of routes and datapaths, start on interactions

* nevermind, no interactions

* nevermind x2, tweetnacl is bad but SubtleCrypto has what we need apparently

* simplify interactions verify

* add brute force interactions tests

* every primary path API route is refactored!

* automatically import from legacy, or die trying.

* check that we only fetch legacy once, ever

* remove old-src, same some historic pieces

* remove interactions & worker-utils package, update misc/types

* update some packages we don't need specific pinning for anymore

* update web references to API routes since they all changed

* fix all linting issues, upgrade most packages

* fix tests, divorce enzyme where-ever possible

* update web, fix integration issues

* pre-build api

* fix tests

* move api pretest to api package.json instead of CI

* remove interactions from terraform, fix deploy side configs

* update to tf 1.1.4

* prevent double writes to worker in GCS, port to newer GCP auth workflow

* fix api.tf var refs, upgrade node action

* change to curl-based script upload for worker script due to terraform provider limitations

* oh no, cloudflare freaked out :(
2022-01-31 20:35:22 -05:00

116 lines
3.7 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import * as React from 'react';
import styled from 'styled-components';
import * as typography from './typography';
export default {
title: 'Atoms/Typography',
};
const Text = () => (
<>
<p>
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Et facilis alias placeat
cumque sapiente ad delectus omnis quae. Reiciendis quibusdam deserunt repellat.
Exercitationem modi incidunt autem nemo tempore eaque soluta.
</p>
<p>
4312.
6.
6.
</p>
<p>
🔸🐕🔺💱🎊👽🐛 👨📼🕦📞 👱👆🍗👚🌈 🔝🔟🍉🔰🍲🏁🕗 🎡🐉🍲📻🔢🔄 💟💲🍻💜💩🔼
🎱🌸📛👫🌻 🗽🕜🐥👕🍈. 🐒🍚🔓📱🏦 🎦🌑🔛💙👣🔚 🔆🗻🌿🎳📲🍯 🌞💟🎌🍌 🔪📯🐎💮
👌👭🎋🏉🏰 📓🕃🎂💉🔩 🐟🌇👺🌊🌒 📪👅🍂🍁 🌖🐮🔽🌒📊. 🔤🍍🌸📷🎴 💏🍌📎👥👉👒
👝💜🔶🍣 💨🗼👈💉💉💰 🍐🕖🌰👝🕓🏊🐕 🏀📅📼📒 🐕🌈👋
</p>
</>
);
const swatches: [string, string | undefined, string][] = [
['text900', 'LargeTitle', 'Used for large titles.'],
['text800', 'MediumTitle', 'Used for medium titles.'],
['text700', 'SmallTitle', 'Used for small titles.'],
['text600', 'AccentTitle', 'Used for accenting titles.'],
['text500', 'LargeText', 'Used for general large font text blocks.'],
['text400', 'Text', 'Used for less important font text blocks.'],
['text300', undefined, 'Used for smaller UI elements.'],
['text200', 'AmbientLarge', 'Used for ambient text.'],
['text100', 'AmbientSmall', 'Used for ambient text.'],
];
const Section = styled.section`
margin: 3.26rem;
`;
const swatch = (mixin: typeof typography.text900) =>
styled.p`
${mixin}
`;
const Usage = styled.code`
${typography.text300}
`;
const Description = styled.i`
${typography.text200}
`;
export const Sizes = () => (
<div>
{swatches.map(([mixin, componentName, usage], i) => {
const Component = swatch((typography as any)[mixin]);
return (
<Section key={i}>
<div>
<Component>The quick brown fox jumped over the lazy dog.</Component>
</div>
<div>
<Usage>
<code>
@{mixin} {componentName && `<${componentName} />`}
</code>
</Usage>
</div>
<div>
<Description>{usage}</Description>
</div>
</Section>
);
})}
</div>
);
const SpacingHead = styled.p`
${typography.text700}
`;
const SpacingSection = styled(Section)`
max-width: 50vw;
border-bottom: 1px solid rgb(0 0 0 / 25%);
`;
export const Spacing = () => (
<div>
{swatches.map(([mixin], i) => {
const Component = swatch((typography as any)[mixin]);
return (
<SpacingSection key={i}>
<SpacingHead>@{mixin}</SpacingHead>
<Component>
<Text />
</Component>
</SpacingSection>
);
})}
</div>
);
export const Link = () => (
<typography.Link
target="_blank"
href="https://images.boredomfiles.com/wp-content/uploads/sites/5/2016/03/fox-door-5.png"
>
Here is a link &lt;3
</typography.Link>
);