This file contains hidden or 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
const { readdir, readFile } = require('fs') | |
const { resolve } = require('path') | |
const { getOptions } = require('loader-utils') | |
const SketchTool = require('sketch-tool') | |
const svgson = require('svgson') | |
const del = require('del') | |
module.exports = function(content) { | |
this.cacheable && this.cacheable(true) |
This file contains hidden or 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
import React from 'react' | |
const BASE = 8 | |
const SIDES = ['Top', 'Right', 'Bottom', 'Left'] | |
const SIDES_LOWERCASE = ['top', 'right', 'bottom', 'left'] | |
function isNullLike(value) { | |
return value === null || typeof value === 'undefined' | |
} |
This file contains hidden or 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
import React from 'react' | |
import createStyledElement from 'create-styled-element' | |
import { parseToRgb } from 'polished' | |
import { createTone } from 'tonality' | |
import directionalStyles from './directional-styles' | |
// get "directionalStyles" here: https://gist.github.com/souporserious/54f9e56ebac4fc4dab603c4212f2ec2e | |
const systemFonts = | |
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' |
This file contains hidden or 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
function capitalize(s) { | |
return s.slice(0, 1).toUpperCase() + s.slice(1) | |
} | |
function getValue(value, spacing) { | |
return !spacing || isNaN(value) ? value : value * spacing | |
} | |
function isNullLike(value) { | |
return value === null || typeof value === 'undefined' |
This file contains hidden or 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
import deepExtend from 'deep-extend' | |
import colorStyles from './color-styles' | |
import fluidSize from './fluid-size' | |
import { fontBase, lineHeight, spacing, verticalRhythm } from '../design-system' | |
function valuesDefined(...values) { | |
return values.some(value => typeof value !== 'undefined') | |
} | |
function parseSides(...sides) { |
This file contains hidden or 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
import React, { Component, Children, cloneElement } from 'react' | |
import PropTypes from 'prop-types' | |
import createStyledElement from 'create-styled-element' | |
import Box from '../Box' | |
import Flex from '../Flex' | |
function Card({ row, subdued, ...props }) { | |
return ( | |
<Flex |
This file contains hidden or 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
// Adaptation from: https://github.com/styleguidist/react-styleguidist/blob/a010018f6672af81332018399fc0e595e81d4b24/scripts/schemas/config.js | |
var reactDocgen = require('react-docgen') | |
var createDisplayNameHandler = require('react-docgen-displayname-handler') | |
.createDisplayNameHandler | |
module.exports = function(content) { | |
this.cacheable && this.cacheable(true) | |
var callback = this.async() | |
var file = this.request.split('!').pop() |
This file contains hidden or 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
// make sure to have babel-plugin-preval setup so this import works as expected | |
// https://github.com/kentcdodds/babel-plugin-preval | |
import docs from "./get-react-docs.js" | |
// do whatever you want with all of the component documentation | |
function renderDocs() { | |
return ( | |
<div> | |
{docs.map(doc => ...)} | |
</div> |
This file contains hidden or 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
const path = require('path') | |
const express = require('express') | |
const webpack = require('webpack') | |
const webpackDevMiddleware = require('webpack-dev-middleware') | |
const webpackHotMiddleware = require('webpack-hot-middleware') | |
const config = require('./webpack.config.js') | |
const app = express() | |
const port = 8080 | |
const compiler = webpack(config) | |
const middleware = webpackDevMiddleware(compiler, { |
This file contains hidden or 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
function ArrowToggle({ active }) { | |
return <Icon name={active ? 'arrow-up' : 'arrow-down'} /> | |
} | |
function renderTrigger({ isOpen, selectedItem, toggleMenu, ...props }) { | |
return ( | |
<Button onClick={toggleMenu} {...props}> | |
{selectedItem} <ArrowToggle active={isOpen} /> | |
</Button> | |
) |