Skip to content

Commit 360b679

Browse files
authored
v0.2.6
2 parents 0521de7 + 97affbb commit 360b679

File tree

16 files changed

+66
-40
lines changed

16 files changed

+66
-40
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@channel.io/design-system",
3-
"version": "0.2.5",
3+
"version": "0.2.6",
44
"description": "Design System by Channel",
55
"repository": {
66
"type": "git",

src/components/Button/Button.styled.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import styled from 'styled-components'
1+
import { styled } from '../../styling/Theme'
22

33
export const ButtonComponent = styled.button`
44
color: red;

src/components/Checkbox/Checkbox.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
import React, { useRef, useState, useCallback } from 'react'
33
import { action } from '@storybook/addon-actions'
44
import { boolean, select, withKnobs } from '@storybook/addon-knobs'
5-
import styled from 'styled-components'
65
import { random } from 'lodash-es'
76

87
/* Internal dependencies */
9-
import { LightTheme, ThemeProvider } from '../../styling/Theme'
8+
import { styled, LightTheme, ThemeProvider } from '../../styling/Theme'
109
import Checkbox from './Checkbox'
1110
import CheckType from './CheckType'
1211

src/components/Checkbox/Checkbox.styled.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/* External dependencies */
2-
import styled from 'styled-components'
3-
41
/* Internal dependencies */
2+
import { styled } from '../../styling/Theme'
53
import { absoluteCenter } from '../../styling/Mixins'
64
import Palette from '../../styling/Palette'
75
import { StyledWrapperProps, StyledCheckerProps, StyledContentProps } from './Checkbox.types'
@@ -11,9 +9,6 @@ const CHECKER_BOX_SIZE = 18
119
const CHECKER_ICON_THICKNESS = 2
1210
const CHECKER_BORDER_THICKNESS = 2
1311

14-
const TRANSITION_DURATION = '.15s'
15-
const TRANSITION_FUNCTION = 'ease-in-out'
16-
1712
export const Wrapper = styled.div<StyledWrapperProps>`
1813
display: inline-flex;
1914
align-items: center;
@@ -34,7 +29,7 @@ const checkerBase = (props: StyledCheckerProps) => `
3429
border-bottom: solid ${CHECKER_ICON_THICKNESS}px transparent;
3530
border-color: ${Palette.white};
3631
content: '';
37-
transition: border-color ${TRANSITION_DURATION} ${TRANSITION_FUNCTION};
32+
transition: ${props.theme?.transition?.BorderTransition};
3833
}
3934
4035
${(props.checkStatus === CheckType.True || props.checkStatus === CheckType.Partial) ? `
@@ -87,9 +82,7 @@ export const Checker = styled.div<StyledCheckerProps>`
8782
background-color: ${Palette.white};
8883
border: ${CHECKER_BORDER_THICKNESS}px solid ${props => props.theme?.colors?.border3};
8984
border-radius: 4px;
90-
transition:
91-
${`color ${TRANSITION_DURATION} ${TRANSITION_FUNCTION}`},
92-
${`background ${TRANSITION_DURATION} ${TRANSITION_FUNCTION}`};
85+
transition: ${props => props.theme?.transition?.BackgroundTransition}, ${props => props.theme?.transition?.ColorTransition};
9386
9487
${props => (!props.disabled ? `
9588
&:hover {
@@ -109,6 +102,6 @@ export const Checker = styled.div<StyledCheckerProps>`
109102
export const Content = styled.div<StyledContentProps>`
110103
box-sizing: border-box;
111104
padding: ${CHECKER_BORDER_THICKNESS}px 0;
112-
margin-left: 2px;
105+
margin-left: 9px;
113106
user-select: none;
114107
`

src/components/Icon/Icon.stories.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/* External dependencies */
22
import React from 'react'
33
import { withKnobs, select, color, number } from '@storybook/addon-knobs'
4-
import styled from 'styled-components'
54

65
/* Internal dependencies */
76
import { Text } from '../Text'
8-
import { ThemeProvider, LightTheme } from '../../styling/Theme'
7+
import { styled, ThemeProvider, LightTheme } from '../../styling/Theme'
98
import Palette from '../../styling/Palette'
109
import icons, { IconName } from './generated'
1110
import Icon from './Icon'

src/components/Icon/Icon.styled.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/* External dependencies */
2-
import styled from 'styled-components'
3-
41
/* Internal dependencies */
2+
import { styled } from '../../styling/Theme'
53
import { IconStyledProps } from './Icon.types'
64

75
function getMargin({
@@ -16,6 +14,7 @@ function getMargin({
1614
const Icon = styled.svg<IconStyledProps>`
1715
color: ${props => props.color || 'inherit'};
1816
margin: ${getMargin};
17+
transition: ${props => props.theme?.transition?.ColorTransition};
1918
`
2019

2120
export default Icon

src/components/Radio/Radio.styled.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* eslint-disable @typescript-eslint/indent, consistent-return */
2-
/* External dependencies */
3-
import styled, { css } from 'styled-components'
4-
52
/* Internal dependencies */
3+
import { styled, css } from '../../styling/Theme'
64
import RadioProps, { StyledRadioHandleProps } from './Radio.types'
75

86
export const StyledRadioWrapper = styled.div<RadioProps>`
@@ -31,6 +29,7 @@ const StyledRadioHandleDot = css<StyledRadioHandleProps>`
3129
return 'transparent'
3230
}};
3331
border-radius: 50%;
32+
transition: ${props => props.theme?.transition?.BackgroundTransition};
3433
`
3534

3635
export const StyledRadioHandle = styled.div<RadioProps & StyledRadioHandleProps>`
@@ -51,6 +50,7 @@ export const StyledRadioHandle = styled.div<RadioProps & StyledRadioHandleProps>
5150
if (props.checked) { return props.theme?.colors?.success1 }
5251
return props.theme?.colors?.background0
5352
}};
53+
transition: ${props => props.theme?.transition?.BackgroundTransition};
5454
5555
&::after {
5656
${StyledRadioHandleDot};

src/components/Switch/Switch.styled.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/* External dependencies */
2-
import styled from 'styled-components'
3-
41
/* Internal dependencies */
2+
import { styled } from '../../styling/Theme'
53
import { WrapperProps, ContentProps } from './Switch.types'
64

75
const PADDING = 4

src/components/Text/Text.styled.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/* External dependencies */
2-
import styled from 'styled-components'
3-
41
/* Internal dependencies */
2+
import { styled } from '../../styling/Theme'
53
import TextProps from './Text.types'
64

75
const Text = styled.span<TextProps>`

0 commit comments

Comments
 (0)