Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Commit

Permalink
Migration to @dooboo-ui/theme (#150)
Browse files Browse the repository at this point in the history
This is a follow-up to previous work #149 .

* initial docs migration

* demo migration init

* Fix broken tests except [ButtonGroup]

* Update CI

* Fix [ButtonGroup] test

Co-authored-by: hyochan <dooboolab@gmail.com>
  • Loading branch information
yujonglee and hyochan authored Oct 16, 2021
1 parent 5bd77a4 commit 612f661
Show file tree
Hide file tree
Showing 100 changed files with 177 additions and 382 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Install modules
run: yarn install --frozen-lockfile

- name: Prepare pacakges
run: yarn pre

- name: Check linting
run: yarn lint

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn pre
- run: yarn build
- run: cd lib && yarn publish
env:
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Accordion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {Accordion, ThemeProvider} from 'dooboo-ui';
import React, {ReactElement} from 'react';

import {Accordion} from 'dooboo-ui';
import {IC_ARR_DOWN} from '../../icon';
import {ThemeProvider} from '@dooboo-ui/theme';
import styled from '@emotion/native';

const Container = styled.View`
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/AdditionalElement.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import {IC_FACEBOOK, IC_GOOGLE} from '../../icon';
import {Image, View} from 'react-native';
import React, {useState} from 'react';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';
import styled, {css} from '@emotion/native';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import {action} from '@storybook/addon-actions';

Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Basic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import React from 'react';
import {View} from 'react-native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Button.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Meta, Story, Canvas} from '@storybook/addon-docs/blocks';
import {ThemeProvider} from 'dooboo-ui';
import {ThemeProvider} from '@dooboo-ui/theme';

import {
Basic,
Loading,
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Disabled.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import React from 'react';
import {View} from 'react-native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Link.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {Button, ThemeProvider} from 'dooboo-ui';
import {Linking, StyleSheet, View} from 'react-native';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import React from 'react';
import {ThemeProvider} from '@dooboo-ui/theme';

const styles = StyleSheet.create({
container: {
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Loading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import React from 'react';
import {View} from 'react-native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/OnPress.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import React, {useState} from 'react';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import {View} from 'react-native';
import styled from '@emotion/native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Outlined.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import React from 'react';
import {View} from 'react-native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Sizes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import React from 'react';
import {View} from 'react-native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Button/Solid.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Button, ThemeProvider, ThemeType} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {Button} from 'dooboo-ui';
import type {FC} from 'react';
import React from 'react';
import {View} from 'react-native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/ButtonGroup/ButtonGroup.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Meta, Story, Canvas} from '@storybook/addon-docs/blocks';
import {ThemeProvider} from 'dooboo-ui';
import {ThemeProvider} from '@dooboo-ui/theme';

import {Light, Dark} from './index';

<Meta title="Components/ButtonGroup" />
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/ButtonGroup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {ButtonGroup, ThemeProvider} from 'dooboo-ui';
import React, {ReactElement, useState} from 'react';

import {ButtonGroup} from 'dooboo-ui';
import {ThemeProvider} from '@dooboo-ui/theme';
import {View} from 'react-native';
import styled from '@emotion/native';

Expand Down
9 changes: 2 additions & 7 deletions docs/src/components/Checkbox/Basic.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
Checkbox,
LoadingIndicator,
ThemeProvider,
ThemeType,
useTheme,
} from 'dooboo-ui';
import {Checkbox, LoadingIndicator, useTheme} from 'dooboo-ui';
import React, {FC, useState} from 'react';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {View} from 'react-native';
import {useFonts} from 'expo-font';
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Checkbox/Checkbox.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Meta, Story, Canvas} from '@storybook/addon-docs/blocks';
import {ThemeProvider} from 'dooboo-ui';
import {ThemeProvider} from '@dooboo-ui/theme';
import {Basic, Solid, Disabled, LeftElement, RightElement} from './index';

<Meta title="Components/Checkbox" />
Expand Down
9 changes: 2 additions & 7 deletions docs/src/components/Checkbox/Disabled.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
Checkbox,
LoadingIndicator,
ThemeProvider,
ThemeType,
useTheme,
} from 'dooboo-ui';
import {Checkbox, LoadingIndicator} from 'dooboo-ui';
import React, {FC} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {View} from 'react-native';
import {useFonts} from 'expo-font';
Expand Down
9 changes: 2 additions & 7 deletions docs/src/components/Checkbox/LeftElement.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
Checkbox,
LoadingIndicator,
ThemeProvider,
ThemeType,
useTheme,
} from 'dooboo-ui';
import {Checkbox, LoadingIndicator} from 'dooboo-ui';
import React, {FC, useState} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {View} from 'react-native';
import styled from '@emotion/native';
Expand Down
9 changes: 2 additions & 7 deletions docs/src/components/Checkbox/RightElement.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
Checkbox,
LoadingIndicator,
ThemeProvider,
ThemeType,
useTheme,
} from 'dooboo-ui';
import {Checkbox, LoadingIndicator} from 'dooboo-ui';
import React, {FC, useState} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {View} from 'react-native';
import styled from '@emotion/native';
Expand Down
9 changes: 2 additions & 7 deletions docs/src/components/Checkbox/Solid.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
Checkbox,
LoadingIndicator,
ThemeProvider,
ThemeType,
useTheme,
} from 'dooboo-ui';
import {Checkbox, LoadingIndicator} from 'dooboo-ui';
import React, {FC, useState} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {View} from 'react-native';
import {useFonts} from 'expo-font';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/FAB/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {FAB, ThemeProvider, withTheme} from 'dooboo-ui';
import {FC, ReactElement, useState} from 'react';
import {SafeAreaView, View} from 'react-native';
import {ThemeProvider, withTheme} from '@dooboo-ui/theme';

import {FAB} from 'dooboo-ui';
import styled from '@emotion/native';
import {useFonts} from 'expo-font';

Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/Icon/Default.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Icon, IconName, ThemeProvider, ThemeType} from 'dooboo-ui';
import {Icon, IconName} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import type {FC} from 'react';
import {View} from 'react-native';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/IconButton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {ThemeProvider, IconButton, Icon} from 'dooboo-ui';
import {Icon, IconButton} from 'dooboo-ui';
import React, {ReactElement} from 'react';

import {ThemeProvider} from '@dooboo-ui/theme';
import {View} from 'react-native';
import styled from '@emotion/native';
import {useFonts} from 'expo-font';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/LoadingIndicator/Basic.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {LoadingIndicator, ThemeProvider, ThemeType} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import type {FC} from 'react';
import {LoadingIndicator} from 'dooboo-ui';
import styled from '@emotion/native';

const StyledView = styled.View`
Expand Down
6 changes: 4 additions & 2 deletions docs/src/components/LoadingIndicator/ImageVersion.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {LoadingIndicator, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import {IC_GIF} from '../../icon';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import type {FC} from 'react';
import {IC_GIF} from '../../icon';
import {LoadingIndicator} from 'dooboo-ui';
import {View} from 'react-native';

const ImageComponent: FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Meta, Story, Canvas} from '@storybook/addon-docs/blocks';
import {ThemeProvider} from 'dooboo-ui';
import {ThemeProvider} from '@dooboo-ui/theme';
import {Basic, ImageVersion, Link} from './index';

<Meta title="Components/LoadingIndicator" />
Expand Down
4 changes: 3 additions & 1 deletion docs/src/components/RadioGroup/Basic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {RadioGroup, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import React, {FC} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {RadioGroup} from 'dooboo-ui';
import {View} from 'react-native';

const data = ['one', 'two', 'three', 'four'];
Expand Down
4 changes: 3 additions & 1 deletion docs/src/components/RadioGroup/Colored.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {RadioGroup, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import React, {FC} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {RadioGroup} from 'dooboo-ui';
import {View} from 'react-native';

const data = ['one', 'two', 'three', 'four'];
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/RadioGroup/RadioGroup.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Meta, Story, Canvas} from '@storybook/addon-docs/blocks';
import {ThemeProvider} from 'dooboo-ui';
import {ThemeProvider} from '@dooboo-ui/theme';

import {
BasicDemo,
ColoredDemo,
Expand Down
4 changes: 3 additions & 1 deletion docs/src/components/RadioGroup/SelectValue.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {RadioGroup, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import React, {FC, useState} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {RadioGroup} from 'dooboo-ui';
import {View} from 'react-native';

const data = ['one', 'two', 'three', 'four'];
Expand Down
4 changes: 3 additions & 1 deletion docs/src/components/RadioGroup/WithLabels.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {RadioGroup, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import React, {FC} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {RadioGroup} from 'dooboo-ui';
import {View} from 'react-native';

const data = ['one', 'two', 'three', 'four'];
Expand Down
4 changes: 3 additions & 1 deletion docs/src/components/RadioGroup/WithTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {RadioGroup, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import React, {FC} from 'react';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import {RadioGroup} from 'dooboo-ui';
import {View} from 'react-native';

const data = ['one', 'two', 'three', 'four'];
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/SelectBox/Animation.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, {useState} from 'react';
import {SelectBox, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import type {FC} from 'react';
import {SelectBox} from 'dooboo-ui';
import {View} from 'react-native';
import styled from '@emotion/native';
import {useFonts} from 'expo-font';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/SelectBox/Disabled.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, {useState} from 'react';
import {SelectBox, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import type {FC} from 'react';
import {SelectBox} from 'dooboo-ui';
import {View} from 'react-native';
import styled from '@emotion/native';
import {useFonts} from 'expo-font';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/SelectBox/SelectBox.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Meta, Story, Canvas} from '@storybook/addon-docs/blocks';
import {ThemeProvider} from 'dooboo-ui';
import {ThemeProvider} from '@dooboo-ui/theme';

import {Basic} from './index.tsx';
import {Disabled} from './Disabled.tsx';
import {Animation} from './Animation.tsx';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/SelectBox/Styled.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, {useState} from 'react';
import {SelectBox, ThemeProvider, ThemeType, useTheme} from 'dooboo-ui';
import {ThemeProvider, ThemeType, useTheme} from '@dooboo-ui/theme';

import type {FC} from 'react';
import {SelectBox} from 'dooboo-ui';
import {View} from 'react-native';
import styled from '@emotion/native';
import {useFonts} from 'expo-font';
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/SwitchToggle/Basic.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {FC, useState} from 'react';
import {SwitchToggle, ThemeProvider, ThemeType, Typography} from 'dooboo-ui';
import {SwitchToggle, Typography} from 'dooboo-ui';
import {ThemeProvider, ThemeType} from '@dooboo-ui/theme';

import {View} from 'react-native';

Expand Down
2 changes: 1 addition & 1 deletion docs/src/styled.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import '@emotion/react';
import type {DoobooTheme} from 'dooboo-ui';
import type {DoobooTheme} from '@dooboo-ui/theme';

declare module '@emotion/react' {
export interface Theme extends DoobooTheme {}
Expand Down
10 changes: 2 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ module.exports = {
testMatch: ['**/__tests__/**/*.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'svg', 'png', 'json'],
globals: {
'ts-jest': {
babelConfig: true,
tsconfig: {
jsx: 'react',
},
diagnostics: false,
},
'ts-jest': {tsconfig: 'tsconfig.spec.json'},
},
modulePathIgnorePatterns: [
'<rootDir>/server/',
Expand All @@ -41,7 +35,7 @@ module.exports = {
},
transformIgnorePatterns: [
// eslint-disable-next-line max-len
'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@sentry/.*)',
'node_modules/(?!(jest-)?react-native|react-clone-referenced-element|@react-native-community|expo(nent)?|@expo(nent)?/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|@sentry/.*|dooboo-ui|@dooboo-ui)',
],
coveragePathIgnorePatterns: [
'.example.',
Expand Down
Loading

0 comments on commit 612f661

Please sign in to comment.