Skip to content

Commit 22cd408

Browse files
🔖 Version 0.0.15
Merge pull request #20 from commitd/develop
2 parents 4e7ae24 + eb58414 commit 22cd408

File tree

23 files changed

+103
-88
lines changed

23 files changed

+103
-88
lines changed

.drone.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,23 @@ type: docker
44
name: components
55

66
steps:
7-
- name: build
8-
image: node:latest
7+
- name: npm_auth
8+
image: robertstettner/drone-npm-auth
99
environment:
10-
GITHUB_TOKEN:
10+
settings:
11+
registry: npm.pkg.github.com
12+
token:
1113
from_secret: github_token
12-
volumes:
13-
- name: drone
14-
path: /drone
14+
15+
- name: build
16+
image: node:latest
1517
commands:
16-
- . /drone/config/env
1718
- yarn install
1819
- yarn build
1920

2021
- name: publish
2122
image: node:latest
22-
environment:
23-
GITHUB_TOKEN:
24-
from_secret: github_token
25-
volumes:
26-
- name: drone
27-
path: /drone
2823
commands:
29-
- . /drone/config/env
3024
- yarn publish
3125
- yarn deploy-storybook --ci
3226
when:
@@ -43,19 +37,19 @@ steps:
4337
from_secret: sonar_token
4438
settings:
4539
exclusions: '**/node_modules/**/*,**/dist/**/*.js'
40+
when:
41+
branch:
42+
- master
4643

4744
- name: slack
4845
image: plugins/slack
4946
settings:
5047
channel: group-ci
5148
webhook:
5249
from_secret: slack_webhook
50+
template:
51+
from_secret: slack_template
5352
when:
5453
status:
5554
- success
5655
- failure
57-
58-
volumes:
59-
- name: drone
60-
host:
61-
path: /drone

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@commitd:registry=https://npm.pkg.github.com/

example/index.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import * as React from 'react'
33
import * as ReactDOM from 'react-dom'
44
import * as C from '../dist'
55
import logo from './images/Committed - Yellow Trans-128px.png'
6-
import { Display } from '../dist'
76

87
const footerHeight = '200px'
98

@@ -13,12 +12,9 @@ const Header = () => (
1312
<C.Box flexGrow={1}>
1413
<C.Heading.h1>Example</C.Heading.h1>
1514
</C.Box>
16-
<C.IconButton
17-
href="https://github.com/commitd/components"
18-
target="_blank"
19-
/>
15+
<C.Avatar src="https://i.pravatar.cc/40" />
2016
<C.Button color="inherit" variant="text">
21-
Login
17+
Logout
2218
</C.Button>
2319
</C.Toolbar>
2420
</C.AppBar>
@@ -44,6 +40,7 @@ const Content = () => (
4440
We believe we can all move forward faster by being open. Learn more about
4541
our contributions.
4642
</C.Text>
43+
<C.Divider my={3} />
4744
<C.Flex justifyContent="center" alignContent="center" flexWrap="wrap">
4845
{[
4946
'Speedy Spotless',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@commitd/components",
3-
"version": "0.0.14",
3+
"version": "0.0.15",
44
"description": "Committed Component Library",
55
"author": "Committed",
66
"license": "UNLICENSED",

src/components/avatar/Avatar.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react'
1+
import React from 'react'
22
import MaterialAvatar, {
33
AvatarProps as MaterialAvatarProps
44
} from '@material-ui/core/Avatar'
@@ -12,25 +12,26 @@ import {
1212
FlexboxProps
1313
} from '@material-ui/system'
1414
import { fractionToPercent } from '../../util'
15+
import { Theme } from '../../theme'
1516

16-
export const textColor = style({
17+
const textColor = style<'color', Theme>({
1718
prop: 'color',
1819
themeKey: 'palette'
1920
})
2021

21-
export const bgcolor = style({
22-
prop: 'bg',
22+
const bgcolor = style<'bgcolor', Theme>({
23+
prop: 'bgcolor',
2324
cssProperty: 'backgroundColor',
2425
themeKey: 'palette'
2526
})
2627

27-
export const width = style({
28+
const width = style<'size', Theme>({
2829
prop: 'size',
2930
cssProperty: 'width',
3031
transform: fractionToPercent
3132
})
3233

33-
export const height = style({
34+
const height = style<'size', Theme>({
3435
prop: 'size',
3536
cssProperty: 'height',
3637
transform: fractionToPercent
@@ -42,18 +43,20 @@ export type AvatarProps = MaterialAvatarProps &
4243
/**
4344
* The background color
4445
*/
45-
bg?: string
46+
bgcolor?: string
4647
/**
4748
* The color of the icon or text
4849
*/
4950
color?: string
5051
/**
5152
* The size (width and height) of the avatar, e.g. (24px)
5253
*/
53-
size?: string
54+
size?: string | number
5455
}
5556

56-
export const Avatar = styled<React.ComponentType<AvatarProps>>(MaterialAvatar)(
57+
export const Avatar: React.ComponentType<AvatarProps> = styled<
58+
React.ComponentType<AvatarProps>
59+
>(MaterialAvatar)(
5760
compose(
5861
spacing,
5962
flexbox,

src/components/card/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react'
1+
import React from 'react'
22
import { palette, PaletteProps } from '@material-ui/system'
33
import {
44
withPositioning,

src/components/divider/Divider.tsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,26 @@ import MaterialDivider, {
33
DividerProps as MaterialDividerProps
44
} from '@material-ui/core/Divider'
55
import { styled } from '@material-ui/styles'
6-
import { style } from '@material-ui/system'
6+
import { style, SpacingProps, spacing, compose } from '@material-ui/system'
7+
import { Theme } from '../../theme'
78

8-
export type DividerProps = MaterialDividerProps & {
9-
/* the color of the divider from the theme's palette */
10-
color: string
11-
}
9+
export type DividerProps = MaterialDividerProps &
10+
SpacingProps & {
11+
/* the color of the divider from the theme's palette */
12+
color?: string
13+
}
1214

13-
export const color = style({
15+
const color = style<'color', Theme>({
1416
prop: 'color',
1517
cssProperty: 'backgroundColor',
1618
themeKey: 'palette'
1719
})
1820

19-
export const Divider = styled<React.ComponentType<DividerProps>>(
20-
MaterialDivider
21-
)(color)
21+
export const Divider: React.ComponentType<DividerProps> = styled<
22+
React.ComponentType<DividerProps>
23+
>(MaterialDivider)(
24+
compose(
25+
color,
26+
spacing
27+
)
28+
)

src/components/form/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type FormProps = React.FormHTMLAttributes<HTMLFormElement> &
1515
FlexboxProps &
1616
SizingProps
1717

18-
export const Form = styled('form')(
18+
export const Form: React.ComponentType<FormProps> = styled('form')(
1919
compose(
2020
spacing,
2121
flexbox,

src/components/form/FormControl.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export type FormControlProps = MaterialFormControlProps &
1818
FlexboxProps &
1919
SizingProps
2020

21-
export const FormControl = styled<
22-
React.ComponentType<MaterialFormControlProps>
23-
>(MaterialFormControl)(
21+
export const FormControl: React.ComponentType<
22+
MaterialFormControlProps
23+
> = styled(MaterialFormControl)(
2424
compose(
2525
spacing,
2626
flexbox,

src/components/iconbutton/IconButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface IconButtonProps
1818
FlexboxProps,
1919
AProps {}
2020

21-
export const IconButton = styled<React.ComponentType<IconButtonProps>>(
21+
export const IconButton: React.ComponentType<IconButtonProps> = styled(
2222
withNoOpener(MaterialIconButton)
2323
)(
2424
compose(

0 commit comments

Comments
 (0)