docs: adds first version of REST docs (#116)
This commit is contained in:
1 parent
1da1ebbb5e
commit
47e2ad2952
29 files changed
+14653
-17
No files matched your search
@@ -0,0 +1,69 @@
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# dotenv environment variable files
|
||||
.env*
|
||||
|
||||
# gatsby files
|
||||
.cache/
|
||||
public
|
||||
|
||||
# Mac files
|
||||
.DS_Store
|
||||
|
||||
# Yarn
|
||||
yarn-error.log
|
||||
.pnp/
|
||||
.pnp.js
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
@@ -0,0 +1,4 @@
|
||||
.cache
|
||||
package.json
|
||||
package-lock.json
|
||||
public
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"arrowParens": "avoid",
|
||||
"semi": false
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
The BSD Zero Clause License (0BSD)
|
||||
|
||||
Copyright (c) 2020 Gatsby Inc.
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,3 @@
|
||||
# Medusa Docs
|
||||
|
||||
Visit: docs.medusa-commerce.com to browse docs.
|
||||
@@ -0,0 +1,6 @@
|
||||
import React from "react"
|
||||
import { ThemeProvider as Provider } from "./src/theme"
|
||||
|
||||
export const wrapPageElement = ({ element }) => {
|
||||
return <Provider>{element}</Provider>
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Configure your Gatsby site with this file.
|
||||
*
|
||||
* See: https://www.gatsbyjs.com/docs/gatsby-config/
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
plugins: [
|
||||
`gatsby-plugin-react-helmet`,
|
||||
{
|
||||
resolve: `gatsby-plugin-anchor-links`,
|
||||
options: {
|
||||
offset: -300,
|
||||
},
|
||||
},
|
||||
`gatsby-transformer-yaml`,
|
||||
{
|
||||
resolve: `gatsby-source-filesystem`,
|
||||
options: {
|
||||
path: `${__dirname}/../docs/api/store`,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import React from "react"
|
||||
import { ThemeProvider as Provider } from "./src/theme"
|
||||
|
||||
export const wrapPageElement = ({ element }) => {
|
||||
return <Provider>{element}</Provider>
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "medusa-commerce-docs",
|
||||
"private": true,
|
||||
"description": "Docs engine for Medusa docs",
|
||||
"version": "0.1.0",
|
||||
"license": "0BSD",
|
||||
"scripts": {
|
||||
"build": "gatsby build",
|
||||
"develop": "gatsby develop",
|
||||
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,md}\"",
|
||||
"start": "npm run develop",
|
||||
"serve": "gatsby serve",
|
||||
"clean": "gatsby clean",
|
||||
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
|
||||
},
|
||||
"dependencies": {
|
||||
"emotion-theming": "^10.0.27",
|
||||
"gatsby": "^2.24.66",
|
||||
"gatsby-plugin-anchor-links": "^1.1.1",
|
||||
"gatsby-plugin-react-helmet": "^3.3.12",
|
||||
"gatsby-source-filesystem": "^2.3.31",
|
||||
"gatsby-transformer-yaml": "^2.4.13",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"react-helmet": "^6.1.0",
|
||||
"react-highlight.js": "^1.0.7",
|
||||
"react-intersection-observer": "^8.29.0",
|
||||
"rebass": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"prettier": "2.1.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/medusajs/medusa"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import React from "react"
|
||||
import { Flex, Box } from "rebass"
|
||||
|
||||
const Layout = ({ children }) => {
|
||||
return (
|
||||
<Flex
|
||||
sx={{
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
overflowY: "scroll",
|
||||
}}
|
||||
fontFamily={"body"}
|
||||
flexDirection="column"
|
||||
flexGrow="1"
|
||||
>
|
||||
<Box>{children}</Box>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
export default Layout
|
||||
@@ -0,0 +1,233 @@
|
||||
import React, { useState, useEffect } from "react"
|
||||
import { graphql } from "gatsby"
|
||||
import { Flex, Box, Text } from "rebass"
|
||||
import { AnchorLink } from "gatsby-plugin-anchor-links"
|
||||
import Highlight from "react-highlight.js"
|
||||
import { Helmet } from "react-helmet"
|
||||
import { InView } from "react-intersection-observer"
|
||||
|
||||
import Layout from "../../components/layout"
|
||||
import "highlight.js/styles/a11y-dark.css"
|
||||
|
||||
const convertToKebabCase = string => {
|
||||
return string.replace(/\s+/g, "-").toLowerCase()
|
||||
}
|
||||
|
||||
const JsonBox = ({ content }) => {
|
||||
const json = JSON.parse(content)
|
||||
return (
|
||||
<Flex
|
||||
sx={{
|
||||
border: "1px solid #454545",
|
||||
backgroundColor: "dark",
|
||||
borderRadius: "5px",
|
||||
marginLeft: "auto",
|
||||
marginRight: "auto",
|
||||
width: "100%",
|
||||
maxHeight: "calc(90vh - 20px)",
|
||||
overflowY: "scroll",
|
||||
alignSelf: "flex-start",
|
||||
fontSize: "1",
|
||||
position: "sticky",
|
||||
top: "20px",
|
||||
bottom: "20px",
|
||||
}}
|
||||
flexDirection="column"
|
||||
as="pre"
|
||||
>
|
||||
<Text fontSize={0} fontFamily="body" py={1} px={2} color="lightest">
|
||||
RESPONSE
|
||||
</Text>
|
||||
<Box w={1} flex="1" sx={{ overflowY: "scroll" }}>
|
||||
<Highlight language="json">
|
||||
{JSON.stringify(json, undefined, 2)}
|
||||
</Highlight>
|
||||
</Box>
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
const ParamSection = ({ routeParam, param }) => {
|
||||
return (
|
||||
<Box
|
||||
py={2}
|
||||
sx={{
|
||||
borderTop: "hairline",
|
||||
}}
|
||||
>
|
||||
<Flex fontSize="1" alignItems="center" pb={2} fontFamily="monospace">
|
||||
<Box mr={2}>{param.name}</Box>
|
||||
{(param.required || routeParam) && (
|
||||
<Text variant="labels.required">required</Text>
|
||||
)}
|
||||
</Flex>
|
||||
<Text fontSize="1">{param.description}</Text>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
const RouteSection = ({ path, method }) => {
|
||||
return (
|
||||
<Box py={2}>
|
||||
<Flex fontFamily="monospace">
|
||||
<Text mr={2} variant={`labels.${method}`}>
|
||||
{method}
|
||||
</Text>
|
||||
<Text>{path}</Text>
|
||||
</Flex>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
const SideBar = ({ endpoints }) => {
|
||||
return (
|
||||
<Flex
|
||||
p={3}
|
||||
sx={{
|
||||
position: "sticky",
|
||||
top: 0,
|
||||
height: "100vh",
|
||||
overflowY: "scroll",
|
||||
backgroundColor: "light",
|
||||
minWidth: "250px",
|
||||
}}
|
||||
flexDirection="column"
|
||||
>
|
||||
{endpoints.edges.map(({ node }) => {
|
||||
return (
|
||||
<Box py={3}>
|
||||
<Text fontSize={1} mb={2} sx={{ textTransform: "uppercase" }}>
|
||||
{node.title}
|
||||
</Text>
|
||||
{node.endpoints.map(e => (
|
||||
<AnchorLink to={`#${convertToKebabCase(e.title)}`}>
|
||||
<Text mb={2} fontSize={0}>
|
||||
{e.title}
|
||||
</Text>
|
||||
</AnchorLink>
|
||||
))}
|
||||
</Box>
|
||||
)
|
||||
})}
|
||||
</Flex>
|
||||
)
|
||||
}
|
||||
|
||||
const StoreApi = ({ data }) => {
|
||||
let { endpoints } = data
|
||||
|
||||
return (
|
||||
<Layout>
|
||||
<Helmet>
|
||||
<title>Store API | Medusa Commerce</title>
|
||||
</Helmet>
|
||||
<Flex>
|
||||
<SideBar endpoints={endpoints} />
|
||||
<Flex p={3} flexDirection="column">
|
||||
{endpoints.edges.map(({ node }) => (
|
||||
<Flex
|
||||
id={convertToKebabCase(node.title)}
|
||||
sx={{
|
||||
minHeight: "90vh",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
<Flex flexDirection="column" flex="60%" maxWidth={756}>
|
||||
<Flex
|
||||
sx={{
|
||||
borderBottom: "hairline",
|
||||
}}
|
||||
py={5}
|
||||
flexDirection="column"
|
||||
borderBottom="hairline"
|
||||
>
|
||||
<Text mb={3} fontSize={4}>
|
||||
{node.title}
|
||||
</Text>
|
||||
<Text fontFamily="monospace" my={2}>
|
||||
{node.route}
|
||||
</Text>
|
||||
<Text mb={4}>{node.description}</Text>
|
||||
{node.endpoints.map(endpoint => (
|
||||
<Flex
|
||||
id={convertToKebabCase(endpoint.title)}
|
||||
sx={{
|
||||
borderTop: "hairline",
|
||||
}}
|
||||
py={4}
|
||||
flexDirection="column"
|
||||
>
|
||||
<Text mb={3} fontSize={3}>
|
||||
{endpoint.title}
|
||||
</Text>
|
||||
<RouteSection
|
||||
method={endpoint.method}
|
||||
path={endpoint.path}
|
||||
/>
|
||||
<Text>{endpoint.description}</Text>
|
||||
{((endpoint.params && endpoint.params.length) ||
|
||||
(endpoint.body && endpoint.body.length)) && (
|
||||
<Box
|
||||
sx={{
|
||||
borderBottom: "hairline",
|
||||
}}
|
||||
my="2"
|
||||
>
|
||||
<Text my={2}>Parameters</Text>
|
||||
{(endpoint.params || []).map(p => (
|
||||
<ParamSection routeParam param={p} />
|
||||
))}
|
||||
{(endpoint.body || []).map(p => (
|
||||
<ParamSection param={p} />
|
||||
))}
|
||||
</Box>
|
||||
)}
|
||||
</Flex>
|
||||
))}
|
||||
</Flex>
|
||||
</Flex>
|
||||
<Flex py={5} px={3} minWidth={450} flex="1">
|
||||
<JsonBox name={node.title} content={node.response} />
|
||||
</Flex>
|
||||
</Flex>
|
||||
))}
|
||||
</Flex>
|
||||
</Flex>
|
||||
</Layout>
|
||||
)
|
||||
}
|
||||
|
||||
export default StoreApi
|
||||
|
||||
export const pageQuery = graphql`
|
||||
{
|
||||
endpoints: allEndpointsYaml(filter: { domain: { eq: "store" } }) {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
title
|
||||
route
|
||||
response
|
||||
description
|
||||
endpoints {
|
||||
title
|
||||
path
|
||||
params {
|
||||
description
|
||||
name
|
||||
type
|
||||
}
|
||||
method
|
||||
description
|
||||
body {
|
||||
type
|
||||
required
|
||||
name
|
||||
description
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -0,0 +1,5 @@
|
||||
import React from "react"
|
||||
|
||||
export default function Home() {
|
||||
return <div>Hello world!</div>
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export default ["40em", "52em", "64em"]
|
||||
@@ -0,0 +1,168 @@
|
||||
export const buttons = {
|
||||
pillActive: {
|
||||
cursor: "pointer",
|
||||
backgroundColor: "transparent",
|
||||
color: "dark",
|
||||
height: "40px",
|
||||
outline: 0,
|
||||
borderRadius: "3px",
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
boxShadow: "pillActive",
|
||||
"&:focus": {
|
||||
boxShadow: "pillActiveFocus",
|
||||
},
|
||||
},
|
||||
pill: {
|
||||
cursor: "pointer",
|
||||
backgroundColor: "transparent",
|
||||
color: "dark",
|
||||
height: "40px",
|
||||
outline: 0,
|
||||
borderRadius: "3px",
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
boxShadow: "pill",
|
||||
"&:focus": {
|
||||
boxShadow: "buttonBoxShadowActive",
|
||||
},
|
||||
},
|
||||
danger: {
|
||||
minHeight: "28px",
|
||||
fontWeight: "500",
|
||||
color: "light",
|
||||
fontSize: "14px",
|
||||
lineHeight: "14px",
|
||||
backgroundColor: "danger",
|
||||
border: 0,
|
||||
outline: 0,
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "3px",
|
||||
boxShadow: "buttonBoxShadow",
|
||||
"&:hover": {
|
||||
color: "darkest",
|
||||
boxShadow: "buttonBoxShadowHover",
|
||||
},
|
||||
"&:active": {
|
||||
boxShadow: "buttonBoxShadowActive",
|
||||
},
|
||||
},
|
||||
primary: {
|
||||
minHeight: "24px",
|
||||
height: "28px",
|
||||
fontWeight: "500",
|
||||
color: "dark",
|
||||
fontSize: "14px",
|
||||
lineHeight: "14px",
|
||||
backgroundColor: "lightest",
|
||||
border: 0,
|
||||
outline: 0,
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "3px",
|
||||
boxShadow: "buttonBoxShadow",
|
||||
"&:hover": {
|
||||
color: "darkest",
|
||||
boxShadow: "buttonBoxShadowHover",
|
||||
},
|
||||
"&:active": {
|
||||
boxShadow: "buttonBoxShadowActive",
|
||||
},
|
||||
"&:disabled": {
|
||||
cursor: "not-allowed",
|
||||
pointerEvents: "none",
|
||||
opacity: 0.5,
|
||||
},
|
||||
},
|
||||
green: {
|
||||
height: "30px",
|
||||
color: "lightest",
|
||||
backgroundColor: "#53725D",
|
||||
border: 0,
|
||||
outline: 0,
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "3px",
|
||||
"&:focus": {
|
||||
boxShadow: "buttonBoxShadowFocus",
|
||||
},
|
||||
"&:active": {
|
||||
boxShadow: "buttonBoxShadowActive",
|
||||
},
|
||||
},
|
||||
secondary: {
|
||||
height: "30px",
|
||||
color: "light",
|
||||
backgroundColor: "dark",
|
||||
border: 0,
|
||||
outline: 0,
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
cursor: "pointer",
|
||||
borderRadius: "3px",
|
||||
"&:focus": {
|
||||
boxShadow: "buttonBoxShadowFocus",
|
||||
},
|
||||
"&:active": {
|
||||
boxShadow: "buttonBoxShadowActive",
|
||||
},
|
||||
},
|
||||
cta: {
|
||||
height: "30px",
|
||||
color: "white",
|
||||
backgroundColor: "medusaGreen",
|
||||
fontWeight: 600,
|
||||
fontSize: "14px",
|
||||
lineHeight: "14px",
|
||||
|
||||
border: 0,
|
||||
outline: 0,
|
||||
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
|
||||
cursor: "pointer",
|
||||
|
||||
borderRadius: "3px",
|
||||
boxShadow: "ctaBoxShadow",
|
||||
|
||||
"&:hover": {
|
||||
boxShadow: "ctaBoxShadowHover",
|
||||
},
|
||||
|
||||
"&:disabled": {
|
||||
cursor: "not-allowed",
|
||||
pointerEvents: "none",
|
||||
opacity: 0.5,
|
||||
},
|
||||
},
|
||||
delete: {
|
||||
height: "30px",
|
||||
color: "white",
|
||||
backgroundColor: "#b02b13",
|
||||
fontWeight: 600,
|
||||
fontSize: "14px",
|
||||
lineHeight: "14px",
|
||||
|
||||
border: 0,
|
||||
outline: 0,
|
||||
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
|
||||
cursor: "pointer",
|
||||
|
||||
borderRadius: "3px",
|
||||
boxShadow: "ctaBoxShadow",
|
||||
|
||||
"&:hover": {
|
||||
boxShadow: "ctaBoxShadowHover",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default buttons
|
||||
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
primary: "#B27979",
|
||||
secondary: "#79B28A",
|
||||
medusaGreen: "#3ecf8e",
|
||||
lightest: "#fefefe",
|
||||
light: "#f0f0f0",
|
||||
gray: "#a3acb9",
|
||||
dark: "#454545",
|
||||
darkest: "#212121",
|
||||
placeholder: "#a3acb9",
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
export default {
|
||||
invalidInput: {
|
||||
color: "dark",
|
||||
backgroundColor: "lightest",
|
||||
|
||||
border: 0,
|
||||
outline: 0,
|
||||
|
||||
cursor: "text",
|
||||
transition: "all 0.2s ease",
|
||||
|
||||
borderRadius: "3px",
|
||||
boxShadow: "invalidBoxShadow",
|
||||
"&.tag__focus": {
|
||||
boxShadow: "inputBoxShadowHover",
|
||||
},
|
||||
"&:focus": {
|
||||
boxShadow: "inputBoxShadowHover",
|
||||
},
|
||||
"&::placeholder": {
|
||||
color: "danger",
|
||||
},
|
||||
},
|
||||
input: {
|
||||
color: "dark",
|
||||
backgroundColor: "lightest",
|
||||
|
||||
border: 0,
|
||||
outline: 0,
|
||||
|
||||
cursor: "text",
|
||||
transition: "all 0.2s ease",
|
||||
|
||||
borderRadius: "3px",
|
||||
boxShadow: "inputBoxShadow",
|
||||
"&.tag__focus": {
|
||||
boxShadow: "inputBoxShadowHover",
|
||||
},
|
||||
"&:focus": {
|
||||
boxShadow: "inputBoxShadowHover",
|
||||
},
|
||||
"&::placeholder": {
|
||||
color: "placeholder",
|
||||
},
|
||||
},
|
||||
textarea: {
|
||||
color: "dark",
|
||||
backgroundColor: "lightest",
|
||||
|
||||
border: 0,
|
||||
outline: 0,
|
||||
|
||||
cursor: "text",
|
||||
transition: "all 0.2s ease",
|
||||
|
||||
borderRadius: "3px",
|
||||
boxShadow: "inputBoxShadow",
|
||||
"&.tag__focus": {
|
||||
boxShadow: "inputBoxShadowHover",
|
||||
},
|
||||
"&:focus": {
|
||||
boxShadow: "inputBoxShadowHover",
|
||||
},
|
||||
"&::placeholder": {
|
||||
color: "placeholder",
|
||||
},
|
||||
},
|
||||
dropdown: {
|
||||
color: "dark",
|
||||
backgroundColor: "lightest",
|
||||
|
||||
border: 0,
|
||||
outline: 0,
|
||||
|
||||
paddingTop: "3px",
|
||||
paddingBottom: "3px",
|
||||
|
||||
cursor: "pointer",
|
||||
|
||||
borderRadius: "3px",
|
||||
boxShadow: "buttonPrimaryBoxShadow",
|
||||
|
||||
"&:hover": {
|
||||
color: "darkest",
|
||||
boxShadow: "buttonPrimaryBoxShadowHover",
|
||||
},
|
||||
|
||||
"&:active": {
|
||||
boxShadow: "buttonPrimaryBoxShadowActive",
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import React from "react"
|
||||
import { ThemeProvider as Provider } from "emotion-theming"
|
||||
|
||||
import breakpoints from "./breakpoints"
|
||||
import buttons from "./buttons"
|
||||
import spacing from "./spacing"
|
||||
import shadows from "./shadows"
|
||||
import forms from "./forms"
|
||||
import labels from "./labels"
|
||||
|
||||
export const theme = {
|
||||
labels,
|
||||
colors: {
|
||||
primary: "#53725D",
|
||||
secondary: "#79B28A",
|
||||
medusaGreen: "#53725D",
|
||||
danger: "#FF7675",
|
||||
muted: "#E3E8EE",
|
||||
lightest: "#fefefe",
|
||||
light: "#f0f0f0",
|
||||
dark: "#454545",
|
||||
darkest: "#212121",
|
||||
placeholder: "#a3acb9",
|
||||
},
|
||||
borders: {
|
||||
hairline: "1px solid #E3E8EE",
|
||||
},
|
||||
fontSizes: [12, 14, 16, 18, 22],
|
||||
fonts: {
|
||||
body:
|
||||
"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Ubuntu, sans-serif",
|
||||
heading: "system-ui, sans-serif",
|
||||
monospace: "Menlo, monospace",
|
||||
},
|
||||
breakpoints,
|
||||
spacing,
|
||||
mediaQueries: {
|
||||
small: `@media screen and (min-width: ${breakpoints[0]})`,
|
||||
medium: `@media screen and (min-width: ${breakpoints[1]})`,
|
||||
large: `@media screen and (min-width: ${breakpoints[2]})`,
|
||||
},
|
||||
grid: {
|
||||
selectedShadow: `
|
||||
inset rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
inset rgba(206, 208, 190, 0.56) 0px 0px 0px 2px,
|
||||
inset rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
inset rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
inset rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
inset rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
inset rgba(0, 0, 0, 0) 0px 0px 0px 0px;
|
||||
`,
|
||||
header: {
|
||||
padding: 2,
|
||||
fontSize: 1,
|
||||
fontFamily: "body",
|
||||
},
|
||||
data: {
|
||||
padding: 2,
|
||||
fontSize: 1,
|
||||
fontFamily: "body",
|
||||
},
|
||||
},
|
||||
shadows,
|
||||
variants: {
|
||||
loginCard: {
|
||||
boxShadow: "buttonBoxShadow",
|
||||
borderRadius: "3px",
|
||||
},
|
||||
badge: {
|
||||
fontSize: "0",
|
||||
color: "dark",
|
||||
backgroundColor: "lightest",
|
||||
boxShadow: "buttonBoxShadow",
|
||||
borderRadius: "3px",
|
||||
minWidth: "unset",
|
||||
px: "1",
|
||||
},
|
||||
},
|
||||
forms,
|
||||
buttons,
|
||||
}
|
||||
|
||||
export const ThemeProvider = ({ children }) => (
|
||||
<Provider theme={theme}>{children}</Provider>
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
export const labels = {
|
||||
required: {
|
||||
color: "danger",
|
||||
fontSize: 0,
|
||||
},
|
||||
GET: {
|
||||
color: "green",
|
||||
},
|
||||
POST: {
|
||||
color: "blue",
|
||||
},
|
||||
DELETE: {
|
||||
color: "danger",
|
||||
},
|
||||
}
|
||||
|
||||
export default labels
|
||||
@@ -0,0 +1,111 @@
|
||||
export default {
|
||||
pill: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0.12) 0px 1px 1px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.08) 0px 0px 5px 0px;
|
||||
`,
|
||||
pillActive: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(83, 114, 93, 0.8) 0px 0px 0px 2px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px
|
||||
`,
|
||||
pillActiveFocus: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(206, 208, 190, 0.36) 0px 0px 0px 4px,
|
||||
rgba(83, 114, 93, 0.8) 0px 0px 0px 2px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px
|
||||
`,
|
||||
invalidBoxShadow: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(255, 66, 87, 0.8) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px;
|
||||
`,
|
||||
inputBoxShadow: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px;
|
||||
`,
|
||||
inputBoxShadowHover: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(206, 208, 190, 0.36) 0px 0px 0px 4px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px;
|
||||
`,
|
||||
buttonBoxShadow: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0.12) 0px 1px 1px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.08) 0px 2px 5px 0px;
|
||||
`,
|
||||
buttonBoxShadowHover: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(0, 0, 0, 0.12) 0px 1px 1px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.08) 0px 3px 9px 0px,
|
||||
rgba(60, 66, 87, 0.08) 0px 2px 5px 0px;
|
||||
`,
|
||||
buttonBoxShadowActive: `
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(206, 208, 190, 0.36) 0px 0px 0px 4px,
|
||||
rgba(0, 0, 0, 0.12) 0px 1px 1px 0px,
|
||||
rgba(60, 66, 87, 0.16) 0px 0px 0px 1px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 66, 87, 0.08) 0px 3px 9px 0px;
|
||||
rgba(60, 66, 87, 0.08) 0px 2px 5px 0px;
|
||||
`,
|
||||
tagBoxShadow: `
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgb(190, 191, 208) 0px 0px 0px 2px,
|
||||
rgba(0, 0, 0, 0) 0px 0px 0px 0px,
|
||||
rgba(60, 62, 87, 0.22) 0px 0px 0px 2px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px;
|
||||
`,
|
||||
ctaBoxShadow: `
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(0,0,0,0.12) 0px 1px 1px 0px,
|
||||
rgba(62, 207, 142, 0) 0px 0px 0px 1px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(60,66,87,0.08) 0px 2px 5px 0px;
|
||||
`,
|
||||
ctaBoxShadowHover: `
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(0,0,0,0.12) 0px 1px 1px 0px,
|
||||
rgba(62, 207, 142, 0) 0px 0px 0px 1px,
|
||||
rgba(0,0,0,0) 0px 0px 0px 0px,
|
||||
rgba(62, 207, 142, 0.25) 0px 3px 9px 0px;
|
||||
rgba(62, 207, 142, 0.25) 0px 2px 5px 0px;
|
||||
`,
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export default [0, 4, 8, 16, 32, 64]
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 225 B |
+12626
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user