Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ComponentHeader component, component overview fixes, more #20

Merged
merged 30 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fef9c5c
fix: swap default theme light/dark token
TheSisb Aug 1, 2019
e980d8c
feat: add breadcrumb component
TheSisb Aug 1, 2019
d96bae7
chore: shuffling components folder around
TheSisb Aug 1, 2019
6142e07
chore: remove console.log
TheSisb Aug 1, 2019
c97bc13
chore: tweak scripts and circle build for perf
TheSisb Aug 7, 2019
3a32390
fix(website): lint errors
TheSisb Aug 7, 2019
94a00f9
feat(theme-tokens): add lineHeight80
TheSisb Aug 8, 2019
eb01bd2
chore(website): remove non-functional component wrapper
TheSisb Aug 8, 2019
d141cda
chore(website): shuffle grid folder into component file
TheSisb Aug 8, 2019
f507329
chore(website): minor cleanup
TheSisb Aug 8, 2019
46dd2bd
feat(website): add ComponentHeader component
TheSisb Aug 8, 2019
3c1bcde
chore(website): make ComponentHeader a shortcode
TheSisb Aug 8, 2019
073ba2c
fix(website): component overview page
TheSisb Aug 8, 2019
d23baba
fix(website): sidebar border-edge pixel perfection
TheSisb Aug 8, 2019
1348c90
fix(website): sidebar, header, nav fixes
TheSisb Aug 9, 2019
05b2270
fix(website): fix type-check errors
TheSisb Aug 9, 2019
a408588
fix(website): guard window for ssr
TheSisb Aug 9, 2019
5fc7791
fix(design-tokens): type-checking
TheSisb Aug 9, 2019
e9950f8
chore(website): typo and remove unused file
TheSisb Aug 9, 2019
8dd11b2
fix(circleci): add missing attach_workspace
TheSisb Aug 9, 2019
419ddce
fix(now): add website build step
TheSisb Aug 9, 2019
ccf8136
fix: code review tweaks
TheSisb Aug 13, 2019
b15d3d8
fix: typescript and rebase fixes
TheSisb Aug 13, 2019
1309998
fix: table type-checking
TheSisb Aug 13, 2019
97cd89a
fix: add missing dependency
TheSisb Aug 13, 2019
aa7344a
fix(text): re-add margin
TheSisb Aug 14, 2019
4726f9a
fix: run type-check in build step
TheSisb Aug 14, 2019
a6bf2eb
fix(theme-tokens): re-add clean step in build step
TheSisb Aug 14, 2019
917b994
fix: use tokens
TheSisb Aug 14, 2019
974ef53
fix: use tokens on breadcrumb styles
TheSisb Aug 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 21 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ jobs:
paths:
- node_modules
- run:
name: Run build
name: Run package builds
command: yarn build
TheSisb marked this conversation as resolved.
Show resolved Hide resolved
- run:
name: Build monorepo package cache
command: yarn pre-test
name: Run website build
command: yarn build:website
- persist_to_workspace:
root: ~/
paths:
- repo/packages
- repo/tools/.cache

test:
executor: job-executor
Expand Down Expand Up @@ -71,9 +70,24 @@ jobs:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- attach_workspace:
at: ~/
- run:
name: Run prettier
command: yarn prettier
typecheck:
executor: job-executor
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- attach_workspace:
at: ~/
- run:
name: Run type checker
command: yarn type-check

workflows:
version: 2
Expand All @@ -89,3 +103,6 @@ workflows:
- prettier:
requires:
- build
- typecheck:
requires:
- build
5 changes: 5 additions & 0 deletions now-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

yarn
yarn build
yarn build:website
4 changes: 2 additions & 2 deletions now.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"version": 2,
"builds": [
{
"src": "package.json",
"src": "now-build.sh",
"use": "@now/static-build",
"config": { "distDir": "packages/paste-website/public" }
"config": {"distDir": "packages/paste-website/public"}
}
]
}
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@
"start:website": "yarn workspace @twilio-paste/website develop",
"watch:icons": "yarn workspace @twilio-paste/icons watch",
"prebuild": "node ./tools/build/pre-build.js",
"build": "lerna run build",
"build": "lerna run build --ignore @twilio-paste/website",
"build:dev": "yarn prebuild && yarn build:tokens && lerna run build:dev",
"build:tokens": "yarn workspace @twilio-paste/design-tokens tokens",
"build:icons": "yarn workspace @twilio-paste/icons build",
"build:storybook": "build-storybook -c .storybook -o /docs",
"build:website": "yarn workspace @twilio-paste/website build",
"pre-push": "yarn build && concurrently \"yarn:lint\" \"yarn:test\" \"yarn:prettier\"",
"pre-push": "concurrently \"yarn:lint\" \"yarn:test\" \"yarn:prettier\" \"yarn:type-check\"",
"release": "yarn lerna publish --skip-npm",
"clean": "node ./tools/build/clean-repo.js && lerna clean --yes && lerna run clean && yarn bootstrap",
"pre-test": "node ./tools/build/pre-test.js",
"test": "yarn pre-test && node --experimental-worker ./node_modules/.bin/jest",
"test:coverage": "yarn pre-test && node --experimental-worker ./node_modules/.bin/jest --coverage",
"prettier": "prettier --list-different '{.storybook,packages}/**/*.{ts,tsx}'",
"prettier-clean": "prettier --write '{.storybook,packages}/**/*.{ts,tsx}'",
"lint": "eslint --ext .tsx,.ts ./packages/**",
"lint": "yarn pre-test && eslint --ext .tsx,.ts ./packages/**",
"type-check": "lerna run type-check"
},
"dependencies": {
"@emotion/core": "^10.0.14",
"@emotion/styled": "^10.0.14",
"@emotion/core": "^10.0.15",
"@emotion/styled": "^10.0.15",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-uid": "^2.2.0",
Expand All @@ -56,7 +56,6 @@
"@commitlint/cli": "8.0.0",
"@commitlint/config-conventional": "8.0.0",
"@emotion/babel-preset-css-prop": "^10.0.14",
"@emotion/core": "^10.0.14",
"@expo/spawn-async": "^1.5.0",
"@storybook/addon-actions": "^5.1.9",
"@storybook/addon-info": "^5.1.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/paste-core/utilities/box/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"peerDependencies": {
"@emotion/styled": "^10.0.10",
"@twilio-paste/theme-tokens": "^0.2.2",
"@twilio-paste/theme-tokens": "^0.4.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"styled-system": "^4.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@twilio-paste/screen-reader-only",
"version": "0.0.0",
"version": "0.0.1",
"category": "typography",
"status": "alpha",
"description": "",
Expand Down
2 changes: 1 addition & 1 deletion packages/paste-core/utilities/text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"peerDependencies": {
"@emotion/styled": "^10.0.10",
"@twilio-paste/theme-tokens": "^0.2.2",
"@twilio-paste/theme-tokens": "^0.4.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"styled-system": "^4.1.0"
Expand Down
1 change: 0 additions & 1 deletion packages/paste-core/utilities/text/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {ThemeShape} from '@twilio-paste/theme-tokens';

interface MarginProps {
m?: keyof ThemeShape['space'];
margin?: keyof ThemeShape['space'];
TheSisb marked this conversation as resolved.
Show resolved Hide resolved
mt?: keyof ThemeShape['space'];
marginTop?: keyof ThemeShape['space'];
mr?: keyof ThemeShape['space'];
Expand Down
13 changes: 7 additions & 6 deletions packages/paste-design-tokens/formatters/sketchpalette.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import color from 'color';
import * as color from 'color';
import * as Immutable from 'immutable';
import {ImmutableStyleMap} from 'theo';

interface SketchPaletteColor {
name: string;
red?: number;
green?: number;
blue?: number;
alpha?: number;
red: number;
green: number;
blue: number;
alpha: number;
}

interface ColorRGB {
Expand All @@ -16,7 +16,8 @@ interface ColorRGB {
valpha: string;
}

const convertToSketchPaletteColor = (input: string): Partial<SketchPaletteColor> => {
const convertToSketchPaletteColor = (input: string): {[key: string]: number} => {
// @ts-ignore FIXME
TheSisb marked this conversation as resolved.
Show resolved Hide resolved
const convertedColor: ColorRGB = color.rgb(input);

return {
Expand Down
4 changes: 2 additions & 2 deletions packages/paste-design-tokens/tokens/global/border-color.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ props:
value: "{!palette-gray-50}"
comment: Default border color
color-border-light:
value: "{!palette-gray-60}"
value: "{!palette-gray-40}"
comment: Light border color
color-border-dark:
value: "{!palette-gray-40}"
value: "{!palette-gray-60}"
comment: Dark border color

# input borders
Expand Down
2 changes: 1 addition & 1 deletion packages/paste-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"peerDependencies": {
"@emotion/styled": "^10.0.14",
"@twilio-paste/theme-tokens": "^0.2.2",
"@twilio-paste/theme-tokens": "^0.4.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-uid": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/paste-theme-tokens/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dist"
],
"scripts": {
"build": "yarn clean && yarn compile",
TheSisb marked this conversation as resolved.
Show resolved Hide resolved
"build": "yarn compile",
"build:dev": "yarn clean && yarn compile:dev",
"clean": "rm -rf ./dist && rm -rf tsconfig.build.tsbuildinfo && rm -rf .rpt2_cache",
"compile": "rollup -c --environment NODE_ENV:production",
Expand All @@ -22,7 +22,7 @@
"type-check": "tsc --noEmit"
},
"peerDependencies": {
"@twilio-paste/design-tokens": "^2.0.2"
"@twilio-paste/design-tokens": "^2.2.0"
},
"devDependencies": {
"@twilio-paste/design-tokens": "^2.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/paste-theme-tokens/src/default/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const lineHeights = {
lineHeight50: '1.75rem', // #28px
lineHeight60: '2rem', // #32px
lineHeight70: '2.25rem', // #36px
lineHeight80: '2.5rem', // #40px
};
const maxWidths = {
...sizings,
Expand Down
1 change: 1 addition & 0 deletions packages/paste-theme-tokens/src/sendgrid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const lineHeights = {
lineHeight50: '1.75rem', // #28px
lineHeight60: '2rem', // #32px
lineHeight70: '2.25rem', // #36px
lineHeight80: '2.5rem', // #40px
TheSisb marked this conversation as resolved.
Show resolved Hide resolved
};
const maxWidths = {
...sizings,
Expand Down
5 changes: 3 additions & 2 deletions packages/paste-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@twilio-paste/theme-tokens": "^0.4.0",
"emotion-theming": "^10.0.10"
},
"peerDependencies": {
"@twilio-paste/theme-tokens": "^0.4.0",
"@emotion/core": "^10.0.14",
"@emotion/styled": "^10.0.14",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"styled-system": "^4.1.0"
},
"devDependencies": {
"@twilio-paste/theme-tokens": "^0.4.0",
"rollup": "^1.16.2",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^10.0.1",
Expand All @@ -41,4 +42,4 @@
"rollup-plugin-typescript2": "^0.21.2",
"typescript": "^3.5.2"
}
}
}
3 changes: 1 addition & 2 deletions packages/paste-website/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ module.exports = {
resolve: `gatsby-plugin-mdx`,
options: {
defaultLayouts: {
default: require.resolve('./src/templates/index.tsx'),
components: require.resolve('./src/templates/components.tsx'),
default: require.resolve('./src/layouts/DefaultLayout.tsx'),
},
},
},
Expand Down
1 change: 1 addition & 0 deletions packages/paste-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@mdx-js/tag": "^0.20.3",
"@twilio-paste/box": "^0.2.4",
"@twilio-paste/heading": "^0.3.0",
"@twilio-paste/screen-reader-only": "0.0.1",
"@twilio-paste/text": "^0.3.1",
"@twilio-paste/theme": "^0.3.0",
"@twilio-paste/theme-tokens": "^0.4.0",
Expand Down
35 changes: 35 additions & 0 deletions packages/paste-website/src/components/breadcrumb/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import * as React from 'react';
import styled from '@emotion/styled';
import {themeGet} from 'styled-system';
import {Link} from 'gatsby';

const CrumbSlashStyled = styled.aside(props => ({
padding: `0 ${themeGet('space.space20')(props)}`,
display: 'inline',
color: themeGet('textColors.colorTextWeak')(props),
}));

const CrumbSlash: React.FC<{}> = () => <CrumbSlashStyled>/</CrumbSlashStyled>;

const Breadcrumb: React.FC<{}> = ({children}) => {
return (
<>
{React.Children.map(children, child => (
<>
{child}
<CrumbSlash />
</>
))}
</>
);
};

const BreadcrumbItem = styled(Link)`
height: 24px;
font-size: 14px;
line-height: 1.71;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write a TODO here to convert these to tokens? line-heights are coming and font-size should already cover it.

Also is the height going to cause a problem if you bump the base font size for the page? Will the font scale (when using rems from tokens) and the fixed height cause issues?

letter-spacing: normal;
color: ${themeGet('textColors.colorTextLink')};
`;

export {Breadcrumb, BreadcrumbItem};
8 changes: 3 additions & 5 deletions packages/paste-website/src/components/callout/types.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import {TextProps} from '@twilio-paste/text';

export type CalloutVariants = 'primary' | 'secondary' | 'warning';

export interface CalloutTitleProps {
as?: string;
}

export interface CalloutTextProps {
as?: string;
marginTop?: string;
marginBottom?: string;
}
export type CalloutTextProps = Pick<TextProps, 'marginTop' | 'marginBottom' | 'as'>;

export interface CalloutProps {
marginTop?: string;
Expand Down
Loading