style: lint and format
This commit is contained in:
parent
09ef1cacde
commit
b64f345e13
@ -4,13 +4,7 @@ const url = require('url');
|
|||||||
|
|
||||||
const request = require('./request');
|
const request = require('./request');
|
||||||
|
|
||||||
const {
|
const { _path, _getAuthHeaders, account, url: host } = request.client;
|
||||||
_path,
|
|
||||||
_getAuthHeaders,
|
|
||||||
account,
|
|
||||||
url: host
|
|
||||||
} = request.client;
|
|
||||||
|
|
||||||
const client = request.client;
|
const client = request.client;
|
||||||
const getAuthHeaders = awaitify(_getAuthHeaders.bind(client));
|
const getAuthHeaders = awaitify(_getAuthHeaders.bind(client));
|
||||||
|
|
||||||
@ -36,12 +30,13 @@ const metadata = {
|
|||||||
|
|
||||||
const href = url.format({
|
const href = url.format({
|
||||||
protocol: 'https',
|
protocol: 'https',
|
||||||
host: host.replace(/^https\:\/\//, ''),
|
host: host.replace(/^https:\/\//, ''),
|
||||||
pathname
|
pathname
|
||||||
});
|
});
|
||||||
|
|
||||||
return fetch(href, { method: 'GET', headers })
|
return fetch(href, { method: 'GET', headers }).then(response =>
|
||||||
.then((response) => response.json());
|
response.json()
|
||||||
|
);
|
||||||
},
|
},
|
||||||
get: ctx => {
|
get: ctx => {
|
||||||
return request('getMachineMetadata', ctx);
|
return request('getMachineMetadata', ctx);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// const argv = require('minimist')(process.argv.slice(2));
|
// const argv = require('minimist')(process.argv.slice(2));
|
||||||
// const { makeExecutableSchema, addMockFunctionsToSchema } = require('graphql-tools');
|
// const { makeExecutableSchema, addMockFunctionsToSchema } = require('graphql-tools');
|
||||||
|
|
||||||
const { query, mutation } = require('./schema');
|
// const { query, mutation } = require('./schema');
|
||||||
|
|
||||||
// console.log(new GraphQLSchema({
|
// console.log(new GraphQLSchema({
|
||||||
// query,
|
// query,
|
||||||
|
@ -49,7 +49,7 @@ module.exports = new GraphQLObjectType({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
rule: {
|
rule: {
|
||||||
type: GraphQLString, //FirewallRuleSyntaxType,
|
type: GraphQLString, // FirewallRuleSyntaxType,
|
||||||
description: 'Firewall rule',
|
description: 'Firewall rule',
|
||||||
resolve: ({ rule }) => {
|
resolve: ({ rule }) => {
|
||||||
return rule;
|
return rule;
|
||||||
|
@ -5,6 +5,7 @@ import remcalc from 'remcalc';
|
|||||||
import { H1, P, Button, ViewContainer } from 'joyent-ui-toolkit';
|
import { H1, P, Button, ViewContainer } from 'joyent-ui-toolkit';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledContainer = styled.div`
|
||||||
|
/* trick prettier */
|
||||||
margin-top: ${remcalc(60)};
|
margin-top: ${remcalc(60)};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import forceArray from 'force-array';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Card,
|
Card,
|
||||||
@ -9,12 +8,18 @@ import {
|
|||||||
CardView
|
CardView
|
||||||
} from 'joyent-ui-toolkit';
|
} from 'joyent-ui-toolkit';
|
||||||
|
|
||||||
export default ({ rule = '', global = false, enabled = false, first, last }) => (
|
export default ({
|
||||||
|
rule = '',
|
||||||
|
global = false,
|
||||||
|
enabled = false,
|
||||||
|
first,
|
||||||
|
last
|
||||||
|
}) => (
|
||||||
<Card collapsed flat={!last} topMargin={first} bottomless={!last} gapless>
|
<Card collapsed flat={!last} topMargin={first} bottomless={!last} gapless>
|
||||||
<CardView>
|
<CardView>
|
||||||
<CardMeta>
|
<CardMeta>
|
||||||
<CardTitle>{rule}</CardTitle>
|
<CardTitle>{rule}</CardTitle>
|
||||||
<CardLabel icon={global && String.fromCodePoint(0x1F30D)} />
|
<CardLabel icon={global && String.fromCodePoint(0x1f30d)} />
|
||||||
<CardLabel color={enabled ? 'green' : 'red'} />
|
<CardLabel color={enabled ? 'green' : 'red'} />
|
||||||
</CardMeta>
|
</CardMeta>
|
||||||
</CardView>
|
</CardView>
|
||||||
|
@ -41,17 +41,21 @@ export default ({ name, state, primaryIp, last, first }) => (
|
|||||||
</CardAction>
|
</CardAction>
|
||||||
<CardTitle to={`/instances/${name}`}>{name}</CardTitle>
|
<CardTitle to={`/instances/${name}`}>{name}</CardTitle>
|
||||||
<Small>
|
<Small>
|
||||||
<CardLabel>
|
<CardLabel>{primaryIp}</CardLabel>
|
||||||
{primaryIp}
|
|
||||||
</CardLabel>
|
|
||||||
</Small>
|
</Small>
|
||||||
<Small>
|
<Small>
|
||||||
<CardLabel color={stateColor[state]} title={`The instance is ${state}`}>
|
<CardLabel
|
||||||
|
color={stateColor[state]}
|
||||||
|
title={`The instance is ${state}`}
|
||||||
|
>
|
||||||
{titleCase(state)}
|
{titleCase(state)}
|
||||||
</CardLabel>
|
</CardLabel>
|
||||||
</Small>
|
</Small>
|
||||||
<SmallOnly>
|
<SmallOnly>
|
||||||
<CardLabel color={stateColor[state]} title={`The instance is ${state}`} />
|
<CardLabel
|
||||||
|
color={stateColor[state]}
|
||||||
|
title={`The instance is ${state}`}
|
||||||
|
/>
|
||||||
</SmallOnly>
|
</SmallOnly>
|
||||||
</CardMeta>
|
</CardMeta>
|
||||||
</CardView>
|
</CardView>
|
||||||
|
@ -14,7 +14,14 @@ import {
|
|||||||
|
|
||||||
const { SmallOnly, Small } = QueryBreakpoints;
|
const { SmallOnly, Small } = QueryBreakpoints;
|
||||||
|
|
||||||
const TextareaKeyValue = ({ name, formName, formValue, handleSubmit, onRemove, textarea }) => (
|
const TextareaKeyValue = ({
|
||||||
|
name,
|
||||||
|
formName,
|
||||||
|
formValue,
|
||||||
|
handleSubmit,
|
||||||
|
onRemove,
|
||||||
|
textarea
|
||||||
|
}) => (
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={12} sm={10}>
|
<Col xs={12} sm={10}>
|
||||||
@ -23,7 +30,14 @@ const TextareaKeyValue = ({ name, formName, formValue, handleSubmit, onRemove, t
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={6} sm={1}>
|
<Col xs={6} sm={1}>
|
||||||
<Button type="button" onClick={() => onRemove(name)} secondary small icon fluid>
|
<Button
|
||||||
|
type="button"
|
||||||
|
onClick={() => onRemove(name)}
|
||||||
|
secondary
|
||||||
|
small
|
||||||
|
icon
|
||||||
|
fluid
|
||||||
|
>
|
||||||
<BinIcon />
|
<BinIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
@ -34,7 +48,7 @@ const TextareaKeyValue = ({ name, formName, formValue, handleSubmit, onRemove, t
|
|||||||
</Col>
|
</Col>
|
||||||
<Col xs={12} sm={12}>
|
<Col xs={12} sm={12}>
|
||||||
<FormGroup name={formValue} reduxForm>
|
<FormGroup name={formValue} reduxForm>
|
||||||
<Field name={formValue} component={Editor} mode='sh' />
|
<Field name={formValue} component={Editor} mode="sh" />
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
<SmallOnly>
|
<SmallOnly>
|
||||||
@ -47,7 +61,14 @@ const TextareaKeyValue = ({ name, formName, formValue, handleSubmit, onRemove, t
|
|||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
|
||||||
const InputKeyValue = ({ name, formName, formValue, handleSubmit, onRemove, textarea }) => (
|
const InputKeyValue = ({
|
||||||
|
name,
|
||||||
|
formName,
|
||||||
|
formValue,
|
||||||
|
handleSubmit,
|
||||||
|
onRemove,
|
||||||
|
textarea
|
||||||
|
}) => (
|
||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={12} sm={5}>
|
<Col xs={12} sm={5}>
|
||||||
@ -61,7 +82,14 @@ const InputKeyValue = ({ name, formName, formValue, handleSubmit, onRemove, text
|
|||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={6} sm={1}>
|
<Col xs={6} sm={1}>
|
||||||
<Button type="button" onClick={() => onRemove(name)} secondary small icon fluid>
|
<Button
|
||||||
|
type="button"
|
||||||
|
onClick={() => onRemove(name)}
|
||||||
|
secondary
|
||||||
|
small
|
||||||
|
icon
|
||||||
|
fluid
|
||||||
|
>
|
||||||
<BinIcon />
|
<BinIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</Col>
|
</Col>
|
||||||
@ -77,6 +105,5 @@ const InputKeyValue = ({ name, formName, formValue, handleSubmit, onRemove, text
|
|||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
|
||||||
export default ({ textarea, ...rest }) => textarea
|
export default ({ textarea, ...rest }) =>
|
||||||
? <TextareaKeyValue {...rest} />
|
textarea ? <TextareaKeyValue {...rest} /> : <InputKeyValue {...rest} />;
|
||||||
: <InputKeyValue {...rest} />;
|
|
||||||
|
@ -1,10 +1,22 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import forceArray from 'force-array';
|
import forceArray from 'force-array';
|
||||||
|
|
||||||
import { FormGroup, Input, FormLabel, ViewContainer, StatusLoader } from 'joyent-ui-toolkit';
|
import {
|
||||||
|
FormGroup,
|
||||||
|
Input,
|
||||||
|
FormLabel,
|
||||||
|
ViewContainer,
|
||||||
|
StatusLoader
|
||||||
|
} from 'joyent-ui-toolkit';
|
||||||
|
|
||||||
import Item from './item';
|
import Item from './item';
|
||||||
|
|
||||||
export default ({ instances, loading, handleChange = () => null, handleSubmit }) => {
|
export default ({
|
||||||
|
instances,
|
||||||
|
loading,
|
||||||
|
handleChange = () => null,
|
||||||
|
handleSubmit
|
||||||
|
}) => {
|
||||||
const _instances = forceArray(instances);
|
const _instances = forceArray(instances);
|
||||||
|
|
||||||
const items = _instances.map((instance, i, all) => (
|
const items = _instances.map((instance, i, all) => (
|
||||||
@ -16,7 +28,8 @@ export default ({ instances, loading, handleChange = () => null, handleSubmit })
|
|||||||
/>
|
/>
|
||||||
));
|
));
|
||||||
|
|
||||||
const _loading = (!items.length && loading) ? (
|
const _loading =
|
||||||
|
!items.length && loading ? (
|
||||||
<ViewContainer center>
|
<ViewContainer center>
|
||||||
<StatusLoader />
|
<StatusLoader />
|
||||||
</ViewContainer>
|
</ViewContainer>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactJson from 'react-json-view';
|
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import forceArray from 'force-array';
|
import forceArray from 'force-array';
|
||||||
import { compose, graphql } from 'react-apollo';
|
import { compose, graphql } from 'react-apollo';
|
||||||
@ -11,7 +10,6 @@ import { ViewContainer, Title, StatusLoader, Message } from 'joyent-ui-toolkit';
|
|||||||
import GetFirewallRules from '@graphql/list-firewall-rules.gql';
|
import GetFirewallRules from '@graphql/list-firewall-rules.gql';
|
||||||
import { FirewallRule as InstanceFirewallRule } from '@components/instances';
|
import { FirewallRule as InstanceFirewallRule } from '@components/instances';
|
||||||
|
|
||||||
|
|
||||||
const Firewall = ({
|
const Firewall = ({
|
||||||
firewallEnabled = false,
|
firewallEnabled = false,
|
||||||
firewallRules = [],
|
firewallRules = [],
|
||||||
@ -20,11 +18,11 @@ const Firewall = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const values = forceArray(firewallRules);
|
const values = forceArray(firewallRules);
|
||||||
const _title = <Title>Firewall</Title>;
|
const _title = <Title>Firewall</Title>;
|
||||||
const _loading = !(loading && !values.length) ? null : (
|
const _loading = !(loading && !values.length) ? null : <StatusLoader />;
|
||||||
<StatusLoader />
|
|
||||||
);
|
|
||||||
|
|
||||||
const _firewall = !_loading && values.map((rule, i, all) => (
|
const _firewall =
|
||||||
|
!_loading &&
|
||||||
|
values.map((rule, i, all) => (
|
||||||
<InstanceFirewallRule
|
<InstanceFirewallRule
|
||||||
key={rule.id}
|
key={rule.id}
|
||||||
{...rule}
|
{...rule}
|
||||||
|
@ -7,7 +7,7 @@ import forceArray from 'force-array';
|
|||||||
import get from 'lodash.get';
|
import get from 'lodash.get';
|
||||||
import find from 'lodash.find';
|
import find from 'lodash.find';
|
||||||
|
|
||||||
import { ViewContainer, Title, StatusLoader, Message } from 'joyent-ui-toolkit';
|
import { ViewContainer, Title, Message } from 'joyent-ui-toolkit';
|
||||||
|
|
||||||
import GetInstances from '@graphql/list-instances.gql';
|
import GetInstances from '@graphql/list-instances.gql';
|
||||||
import { List as InstanceList } from '@components/instances';
|
import { List as InstanceList } from '@components/instances';
|
||||||
@ -20,7 +20,7 @@ const InstanceListForm = reduxForm({
|
|||||||
const List = ({ instances = [], loading = false, error }) => {
|
const List = ({ instances = [], loading = false, error }) => {
|
||||||
const _title = <Title>Instances</Title>;
|
const _title = <Title>Instances</Title>;
|
||||||
const _instances = forceArray(instances);
|
const _instances = forceArray(instances);
|
||||||
const _loading = (!instances.length && loading);
|
const _loading = !instances.length && loading;
|
||||||
|
|
||||||
const _error = !error ? null : (
|
const _error = !error ? null : (
|
||||||
<Message
|
<Message
|
||||||
|
@ -12,7 +12,8 @@ import { ViewContainer, Title, StatusLoader, Message } from 'joyent-ui-toolkit';
|
|||||||
import GetMetadata from '@graphql/list-metadata.gql';
|
import GetMetadata from '@graphql/list-metadata.gql';
|
||||||
import { KeyValue } from '@components/instances';
|
import { KeyValue } from '@components/instances';
|
||||||
|
|
||||||
const MetadataForms = (metadata = []) => metadata.map(({ key, formName, formValue, value, name }) => {
|
const MetadataForms = (metadata = []) =>
|
||||||
|
metadata.map(({ key, formName, formValue, value, name }) => {
|
||||||
const MetadataForm = reduxForm({
|
const MetadataForm = reduxForm({
|
||||||
form: `instance-metadata-${key}`,
|
form: `instance-metadata-${key}`,
|
||||||
initialValues: {
|
initialValues: {
|
||||||
@ -32,7 +33,7 @@ const MetadataForms = (metadata = []) => metadata.map(({ key, formName, formValu
|
|||||||
textarea
|
textarea
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const Metadata = ({ metadata = [], loading, error }) => {
|
const Metadata = ({ metadata = [], loading, error }) => {
|
||||||
const _title = <Title>Metadata</Title>;
|
const _title = <Title>Metadata</Title>;
|
||||||
@ -79,7 +80,6 @@ export default compose(
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const metadata = Object.keys(values).reduce((all, name) => {
|
const metadata = Object.keys(values).reduce((all, name) => {
|
||||||
const key = paramCase(name);
|
const key = paramCase(name);
|
||||||
|
|
||||||
|
@ -10,15 +10,14 @@ import { ViewContainer, Title, StatusLoader, Message } from 'joyent-ui-toolkit';
|
|||||||
import GetNetworks from '@graphql/list-networks.gql';
|
import GetNetworks from '@graphql/list-networks.gql';
|
||||||
import { Network as InstanceNetwork } from '@components/instances';
|
import { Network as InstanceNetwork } from '@components/instances';
|
||||||
|
|
||||||
|
|
||||||
const Networks = ({ networks = [], loading, error }) => {
|
const Networks = ({ networks = [], loading, error }) => {
|
||||||
const values = forceArray(networks);
|
const values = forceArray(networks);
|
||||||
const _title = <Title>Networks</Title>;
|
const _title = <Title>Networks</Title>;
|
||||||
const _loading = !(loading && !values.length) ? null : (
|
const _loading = !(loading && !values.length) ? null : <StatusLoader />;
|
||||||
<StatusLoader />
|
|
||||||
);
|
|
||||||
|
|
||||||
const _networks = !_loading && values.map((network, i, all) => (
|
const _networks =
|
||||||
|
!_loading &&
|
||||||
|
values.map((network, i, all) => (
|
||||||
<InstanceNetwork
|
<InstanceNetwork
|
||||||
key={network.id}
|
key={network.id}
|
||||||
{...network}
|
{...network}
|
||||||
|
@ -13,7 +13,8 @@ import { KeyValue } from '@components/instances';
|
|||||||
import GetTags from '@graphql/list-tags.gql';
|
import GetTags from '@graphql/list-tags.gql';
|
||||||
import PutTags from '@graphql/add-tags.gql';
|
import PutTags from '@graphql/add-tags.gql';
|
||||||
|
|
||||||
const TagForms = (tags = []) => tags.map(({ key, formName, formValue, value, name }) => {
|
const TagForms = (tags = []) =>
|
||||||
|
tags.map(({ key, formName, formValue, value, name }) => {
|
||||||
const TagForm = reduxForm({
|
const TagForm = reduxForm({
|
||||||
form: `instance-tags-${key}`,
|
form: `instance-tags-${key}`,
|
||||||
initialValues: {
|
initialValues: {
|
||||||
@ -32,7 +33,7 @@ const TagForms = (tags = []) => tags.map(({ key, formName, formValue, value, nam
|
|||||||
onRemove={key => console.log('remove', key)}
|
onRemove={key => console.log('remove', key)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const Tags = ({ tags = [], loading, error }) => {
|
const Tags = ({ tags = [], loading, error }) => {
|
||||||
const _title = <Title>Tags</Title>;
|
const _title = <Title>Tags</Title>;
|
||||||
@ -79,7 +80,6 @@ export default compose(
|
|||||||
[]
|
[]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const tags = Object.keys(values).reduce((all, name) => {
|
const tags = Object.keys(values).reduce((all, name) => {
|
||||||
const key = paramCase(name);
|
const key = paramCase(name);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
import { ThemeProvider, injectGlobal } from 'styled-components';
|
import { ThemeProvider } from 'styled-components';
|
||||||
import { theme, RootContainer } from 'joyent-ui-toolkit';
|
import { theme, RootContainer } from 'joyent-ui-toolkit';
|
||||||
import { ApolloProvider } from 'react-apollo';
|
import { ApolloProvider } from 'react-apollo';
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
import { BrowserRouter, Route, Switch } from 'react-router-dom';
|
||||||
import styled from 'styled-components';
|
|
||||||
|
|
||||||
import { PageContainer } from 'joyent-ui-toolkit';
|
import { PageContainer } from 'joyent-ui-toolkit';
|
||||||
|
|
||||||
|
@ -24,7 +24,9 @@ export default ({ theme }) => css`
|
|||||||
${unloadedFontFamily};
|
${unloadedFontFamily};
|
||||||
}
|
}
|
||||||
|
|
||||||
html, body, #root {
|
html,
|
||||||
|
body,
|
||||||
|
#root {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +34,8 @@ export default ({ theme }) => css`
|
|||||||
${loadedFontFamily};
|
${loadedFontFamily};
|
||||||
}
|
}
|
||||||
|
|
||||||
.CodeMirror, .ReactCodeMirror {
|
.CodeMirror,
|
||||||
|
.ReactCodeMirror {
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,10 +7,9 @@ const sides = ['top', 'right', 'bottom', 'left'];
|
|||||||
const unitProps = (() => {
|
const unitProps = (() => {
|
||||||
const sided = rule => sides.map(side => `${rule}-${side}`);
|
const sided = rule => sides.map(side => `${rule}-${side}`);
|
||||||
|
|
||||||
const measures = ['margin', 'padding'].reduce(
|
const measures = ['margin', 'padding']
|
||||||
(props, rule) => [...props, rule, ...sided(rule)],
|
.reduce((props, rule) => [...props, rule, ...sided(rule)], [])
|
||||||
[]
|
.concat(['height', 'width']);
|
||||||
).concat(['height', 'width']);
|
|
||||||
|
|
||||||
return sides.reduce((acc, side) => [...acc, `border-${side}-width`], [
|
return sides.reduce((acc, side) => [...acc, `border-${side}-width`], [
|
||||||
'border',
|
'border',
|
||||||
|
@ -33,6 +33,7 @@ const Arrow = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const Container = styled.div`
|
const Container = styled.div`
|
||||||
|
/* trick prettier */
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -49,17 +49,21 @@ const breakpoint = label => (...args) => css`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const toQuery = label => ({ children, ...rest }) => (
|
const toQuery = label => ({ children, ...rest }) => (
|
||||||
<MediaQuery query={screens[label]}>
|
<MediaQuery query={screens[label]}>{children}</MediaQuery>
|
||||||
{children}
|
|
||||||
</MediaQuery>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
export const styled = Object.keys(screens).reduce((sum, label) => ({
|
export const styled = Object.keys(screens).reduce(
|
||||||
|
(sum, label) => ({
|
||||||
...sum,
|
...sum,
|
||||||
[label]: breakpoint(label)
|
[label]: breakpoint(label)
|
||||||
}), {});
|
}),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
export const query = Object.keys(screens).reduce((sum, label) => ({
|
export const query = Object.keys(screens).reduce(
|
||||||
|
(sum, label) => ({
|
||||||
...sum,
|
...sum,
|
||||||
[pascalCase(label)]: toQuery(label)
|
[pascalCase(label)]: toQuery(label)
|
||||||
}), {});
|
}),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
@ -89,7 +89,7 @@ const style = css`
|
|||||||
background-color: ${props => props.theme.whiteActive};
|
background-color: ${props => props.theme.whiteActive};
|
||||||
border-color: ${props => props.theme.grey};
|
border-color: ${props => props.theme.grey};
|
||||||
}
|
}
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${is('tertiary')`
|
${is('tertiary')`
|
||||||
color: ${props => props.theme.tertiary};
|
color: ${props => props.theme.tertiary};
|
||||||
@ -106,7 +106,7 @@ const style = css`
|
|||||||
background-color: ${props => props.theme.background};
|
background-color: ${props => props.theme.background};
|
||||||
border-color: ${props => props.theme.grey};
|
border-color: ${props => props.theme.grey};
|
||||||
}
|
}
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${is('tertiary', 'selected')`
|
${is('tertiary', 'selected')`
|
||||||
background-color: ${props => props.theme.tertiaryActive};
|
background-color: ${props => props.theme.tertiaryActive};
|
||||||
@ -145,7 +145,7 @@ const style = css`
|
|||||||
background-color: ${props => props.theme.disabled};
|
background-color: ${props => props.theme.disabled};
|
||||||
border-color: ${props => props.theme.disabled};
|
border-color: ${props => props.theme.disabled};
|
||||||
}
|
}
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${is('rect')`
|
${is('rect')`
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import remcalc from 'remcalc';
|
import remcalc from 'remcalc';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import is, { isNot } from 'styled-is';
|
import is, { isNot } from 'styled-is';
|
||||||
import unitcalc from 'unitcalc';
|
|
||||||
|
|
||||||
const Dot = styled.span`
|
const Dot = styled.span`
|
||||||
width: ${remcalc(6)};
|
width: ${remcalc(6)};
|
||||||
@ -20,6 +19,7 @@ const Dot = styled.span`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const Icon = styled.span`
|
const Icon = styled.span`
|
||||||
|
/* trick prettier */
|
||||||
background-color: none;
|
background-color: none;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import is from 'styled-is';
|
import is from 'styled-is';
|
||||||
import typography from '../typography';
|
|
||||||
import P from '../text/p';
|
import P from '../text/p';
|
||||||
|
|
||||||
export default P.extend`
|
export default P.extend`
|
||||||
|
@ -5,7 +5,6 @@ import is from 'styled-is';
|
|||||||
|
|
||||||
import Baseline from '../baseline';
|
import Baseline from '../baseline';
|
||||||
|
|
||||||
|
|
||||||
const Divider = styled(Row)`
|
const Divider = styled(Row)`
|
||||||
background-color: ${props => props.theme.grey};
|
background-color: ${props => props.theme.grey};
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ import React from 'react';
|
|||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { Input } from 'normalized-styled-components';
|
import { Input } from 'normalized-styled-components';
|
||||||
import { Broadcast, Subscriber } from 'react-broadcast';
|
import { Broadcast, Subscriber } from 'react-broadcast';
|
||||||
import { border, borderRadius } from '../../boxes';
|
|
||||||
import BaseInput from './input';
|
import BaseInput from './input';
|
||||||
import remcalc from 'remcalc';
|
import remcalc from 'remcalc';
|
||||||
import is from 'styled-is';
|
import is from 'styled-is';
|
||||||
|
@ -3,6 +3,7 @@ import Baseline from '../baseline';
|
|||||||
import typography from '../typography';
|
import typography from '../typography';
|
||||||
|
|
||||||
const StyledLegend = Legend.extend`
|
const StyledLegend = Legend.extend`
|
||||||
|
/* trick prettier */
|
||||||
${typography.semibold};
|
${typography.semibold};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import unitcalc from 'unitcalc';
|
|||||||
import { PlusIcon, MinusIcon } from '../icons';
|
import { PlusIcon, MinusIcon } from '../icons';
|
||||||
|
|
||||||
const StyledContainer = styled.div`
|
const StyledContainer = styled.div`
|
||||||
|
/* trick prettier */
|
||||||
margin-bottom: ${unitcalc(4)};
|
margin-bottom: ${unitcalc(4)};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -89,7 +89,8 @@ const style = css`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledButton = NButton.extend`
|
const StyledButton = NButton.extend`
|
||||||
${style}
|
/* trick prettier */
|
||||||
|
${style};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledAnchor = A.extend`
|
const StyledAnchor = A.extend`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import is, { isNot } from 'styled-is';
|
import is from 'styled-is';
|
||||||
import { Grid } from 'react-styled-flexboxgrid';
|
import { Grid } from 'react-styled-flexboxgrid';
|
||||||
import remcalc from 'remcalc';
|
import remcalc from 'remcalc';
|
||||||
|
|
||||||
|
@ -54,24 +54,24 @@ const StyledContainer = styled.div`
|
|||||||
${isOr('active', 'completed')`
|
${isOr('active', 'completed')`
|
||||||
border-top: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
border-top: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
||||||
border-bottom: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
border-bottom: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${is('first')`
|
${is('first')`
|
||||||
border-left: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
border-left: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
||||||
padding-left: ${remcalc(13)};
|
padding-left: ${remcalc(13)};
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${isNot('first', 'completed', 'active')`
|
${isNot('first', 'completed', 'active')`
|
||||||
border-right: ${remcalc(1)} solid ${props => props.theme.grey};
|
border-right: ${remcalc(1)} solid ${props => props.theme.grey};
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${isOr('active', 'completed')`
|
${isOr('active', 'completed')`
|
||||||
border-right: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
border-right: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${isNot('last')`
|
${isNot('last')`
|
||||||
border-right: none;
|
border-right: none;
|
||||||
`}
|
`};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledArrow = styled.span`
|
const StyledArrow = styled.span`
|
||||||
|
@ -10,11 +10,11 @@ const Tick = styled(TickIcon)`
|
|||||||
|
|
||||||
${is('active')`
|
${is('active')`
|
||||||
fill: ${props => props.theme.secondary};
|
fill: ${props => props.theme.secondary};
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${is('completed')`
|
${is('completed')`
|
||||||
fill: ${props => props.theme.white};
|
fill: ${props => props.theme.white};
|
||||||
`}
|
`};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledIndicator = styled.span`
|
const StyledIndicator = styled.span`
|
||||||
@ -30,11 +30,11 @@ const StyledIndicator = styled.span`
|
|||||||
|
|
||||||
${isOr('completed', 'active')`
|
${isOr('completed', 'active')`
|
||||||
border: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
border: ${remcalc(1)} solid ${props => props.theme.greenDark};
|
||||||
`}
|
`};
|
||||||
|
|
||||||
${is('completed')`
|
${is('completed')`
|
||||||
background: ${props => props.theme.green};
|
background: ${props => props.theme.green};
|
||||||
`}
|
`};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const Indicator = ({ first, completed, active, last, ...rest }) => {
|
const Indicator = ({ first, completed, active, last, ...rest }) => {
|
||||||
|
@ -34,13 +34,16 @@ const style = css`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const Anchor = Baseline(A.extend`
|
export const Anchor = Baseline(A.extend`
|
||||||
|
/* trick prettier */
|
||||||
${style};
|
${style};
|
||||||
`);
|
`);
|
||||||
|
|
||||||
export const NavLink = Baseline(styled(RRNavLink)`
|
export const NavLink = Baseline(styled(RRNavLink)`
|
||||||
|
/* trick prettier */
|
||||||
${style};
|
${style};
|
||||||
`);
|
`);
|
||||||
|
|
||||||
export const Link = Baseline(styled(RRLink)`
|
export const Link = Baseline(styled(RRLink)`
|
||||||
|
/* trick prettier */
|
||||||
${style};
|
${style};
|
||||||
`);
|
`);
|
||||||
|
@ -60,7 +60,7 @@ Slider.propTypes = {
|
|||||||
draggableTrack: PropTypes.bool,
|
draggableTrack: PropTypes.bool,
|
||||||
onChangeStart: PropTypes.func,
|
onChangeStart: PropTypes.func,
|
||||||
children: PropTypes.node,
|
children: PropTypes.node,
|
||||||
greyed: PropTypes.bool,
|
greyed: PropTypes.bool
|
||||||
};
|
};
|
||||||
|
|
||||||
Slider.defaultProps = {
|
Slider.defaultProps = {
|
||||||
|
@ -32,10 +32,12 @@ const StyledFirstRect = styled.rect`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledSecondRect = StyledFirstRect.extend`
|
const StyledSecondRect = StyledFirstRect.extend`
|
||||||
|
/* trick prettier */
|
||||||
animation-delay: 0.5s;
|
animation-delay: 0.5s;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledThirdRect = StyledFirstRect.extend`
|
const StyledThirdRect = StyledFirstRect.extend`
|
||||||
|
/* trick prettier */
|
||||||
animation-delay: 1s;
|
animation-delay: 1s;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import theme from '../theme';
|
|||||||
import Base, { global } from '../base';
|
import Base, { global } from '../base';
|
||||||
|
|
||||||
const StyledBase = Base.extend`
|
const StyledBase = Base.extend`
|
||||||
|
/* trick prettier */
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ const Preview = styled.div`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const Paragraph = P.extend`
|
const Paragraph = P.extend`
|
||||||
|
/* trick prettier */
|
||||||
margin: 0;
|
margin: 0;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { css } from 'styled-components';
|
import { css } from 'styled-components';
|
||||||
import theme from '../theme'
|
import theme from '../theme';
|
||||||
|
|
||||||
const baseFonts = `
|
const baseFonts = `
|
||||||
-apple-system,
|
-apple-system,
|
||||||
@ -18,20 +18,24 @@ export const loadedFontFamily = css`
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
export const unloadedFontFamily = css`
|
export const unloadedFontFamily = css`
|
||||||
|
/* trick prettier */
|
||||||
font-family: ${baseFonts};
|
font-family: ${baseFonts};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const color = theme.text;
|
export const color = theme.text;
|
||||||
|
|
||||||
export const semibold = css`
|
export const semibold = css`
|
||||||
|
/* trick prettier */
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const medium = css`
|
export const medium = css`
|
||||||
|
/* trick prettier */
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const normal = css`
|
export const normal = css`
|
||||||
|
/* trick prettier */
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user