mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
feat(design-system): add intro card and MDX components
This commit is contained in:
parent
6090a6c94f
commit
752250fd7f
9 changed files with 88 additions and 10 deletions
|
@ -1,3 +1,10 @@
|
|||
import { roleypolyTheme } from './theme';
|
||||
import { mdxComponents } from '../src/design-system/atoms/typography/mdx';
|
||||
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
docs: {
|
||||
theme: roleypolyTheme,
|
||||
components: mdxComponents,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@ export const roleypolyTheme = create({
|
|||
|
||||
// UI
|
||||
appBg: palette.taupe300,
|
||||
appContentBg: palette.taupe300,
|
||||
appContentBg: palette.taupe200,
|
||||
appBorderColor: palette.taupe100,
|
||||
appBorderRadius: 0,
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
load("@npm//@bazel/typescript:index.bzl", "ts_library")
|
||||
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
ts_library(
|
||||
name = "lib",
|
||||
srcs = glob(["*.ts"]),
|
||||
)
|
24
src/design-system/Intro.stories.mdx
Normal file
24
src/design-system/Intro.stories.mdx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import { Meta } from '@storybook/addon-docs/blocks';
|
||||
import { Logotype } from 'roleypoly/src/design-system/atoms/branding';
|
||||
import { Space } from 'roleypoly/src/design-system/atoms/space';
|
||||
import { palette } from 'roleypoly/src/design-system/atoms/colors';
|
||||
|
||||
<Meta title="Roleypoly Design System" />
|
||||
|
||||
<Logotype height="4em" circleFill={palette.taupe100} />
|
||||
<Space />
|
||||
|
||||
# Rapid UI
|
||||
|
||||
#### Roleypoly Design System
|
||||
|
||||
This is a tool for Roleypoly developers to design and show off UI
|
||||
components as they build them.
|
||||
|
||||
If you're interested in helping build Roleypoly, [please visit the GitHub project.][roleypoly]
|
||||
|
||||
All components here follow the [Atomic Design System][atomic], and might be used in any number of Roleypoly UI systems, not limited to
|
||||
just the end user web application.
|
||||
|
||||
[roleypoly]: https://github.com/roleypoly/roleypoly
|
||||
[atomic]: https://bradfrost.com/blog/post/atomic-web-design/
|
|
@ -8,7 +8,7 @@ The Roleypoly Design System (rapid) is an atomic design system to help rapidly a
|
|||
|
||||
**Please follow hermeticity considerations.**
|
||||
|
||||
This package cannot reference RPC types, as they do not exist in the outside world. Storybook is the core component of this, and Storybook doesn't know how to find RPC types at CI build time, as Bazel is also not present.
|
||||
This package cannot reference RPC types, as they do not exist in the outside world. Storybook is the core component of this, and Storybook doesn't know how to find RPC types at CI build time, as Bazel is also not present. If you are worried about RPC types being compatible, please write a unit test and include the RPC types then.
|
||||
|
||||
You need:
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ react_library(
|
|||
name = "typography",
|
||||
deps = [
|
||||
"styled-components",
|
||||
"//src/design-system/atoms/colors",
|
||||
"//src/design-system/atoms/timings",
|
||||
"@types/styled-components",
|
||||
],
|
||||
)
|
||||
|
|
33
src/design-system/atoms/typography/mdx.tsx
Normal file
33
src/design-system/atoms/typography/mdx.tsx
Normal file
|
@ -0,0 +1,33 @@
|
|||
import styled from 'styled-components';
|
||||
import * as _ from 'styled-components'; // tslint:disable-line:no-duplicate-imports
|
||||
import {
|
||||
AccentTitle,
|
||||
LargeTitle,
|
||||
Link,
|
||||
MediumTitle,
|
||||
SmallTitle,
|
||||
Text,
|
||||
text600,
|
||||
text700,
|
||||
text800,
|
||||
text900,
|
||||
} from './typography';
|
||||
|
||||
export const mdxComponents = {
|
||||
h1: styled.h1`
|
||||
${text900}
|
||||
`,
|
||||
h2: styled.h2`
|
||||
${text800}
|
||||
`,
|
||||
h3: styled.h3`
|
||||
${text700}
|
||||
`,
|
||||
h4: styled.h4`
|
||||
${text600}
|
||||
`,
|
||||
p: styled.p`
|
||||
${Text}
|
||||
`,
|
||||
a: Link,
|
||||
};
|
|
@ -107,3 +107,12 @@ export const Spacing = () => (
|
|||
})}
|
||||
</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 <3
|
||||
</typography.Link>
|
||||
);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import styled, { css } from 'styled-components';
|
||||
import { palette } from 'roleypoly/src/design-system/atoms/colors';
|
||||
import { transitions } from 'roleypoly/src/design-system/atoms/timings';
|
||||
import * as _ from 'styled-components'; // tslint:disable-line:no-duplicate-imports
|
||||
|
||||
const reset = css`
|
||||
|
@ -86,3 +88,12 @@ export const AmbientLarge = styled.span`
|
|||
export const AmbientSmall = styled.span`
|
||||
${text100}
|
||||
`;
|
||||
|
||||
export const Link = styled.a`
|
||||
color: ${palette.taupe500};
|
||||
text-decoration: none;
|
||||
transition: color ${transitions.actionable}s ease-in-out;
|
||||
&:hover {
|
||||
color: ${palette.taupe600};
|
||||
}
|
||||
`;
|
||||
|
|
Loading…
Add table
Reference in a new issue