Skip to content

Commit

Permalink
docs: add or update stories of alert, avatar and button (#467)
Browse files Browse the repository at this point in the history
affects: @gio-design/components
  • Loading branch information
jack0pan authored Nov 13, 2020
1 parent 80d1d59 commit d0f994b
Show file tree
Hide file tree
Showing 16 changed files with 6,747 additions and 308 deletions.
59 changes: 34 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Bootstrap
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn bootstrap
Expand All @@ -66,7 +66,7 @@ jobs:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Lint pull request title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
- name: Lint commits count
Expand All @@ -76,16 +76,15 @@ jobs:
run: yarn lint:style
- name: ESLint
run: yarn lint:components
review:
name: UI Review
if: ${{ !(startsWith(github.event.pull_request.title, 'chore') || startsWith(github.event.pull_request.title, 'docs')) }}
needs: [install]
build:
name: Build Packages
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: '1'
- name: Setup Node.js
uses: actions/setup-node@v2.1.2
with:
Expand All @@ -96,24 +95,29 @@ jobs:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Build Storybook
run: yarn build-storybook
- name: Upload to Chromatic
uses: chromaui/action@v1
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Cache packages
uses: actions/cache@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: no8vpz82l1j
storybookBuildDir: packages/components/storybook-static/
build:
name: Build Packages
needs: install
path: |
packages/components/dist
packages/components/es
packages/icons/dist
packages/icons/es
packages/tokens/dist
key: packages-${{ github.sha }}
- name: Build
run: yarn build
review:
name: UI Review
if: ${{ !startsWith(github.event.pull_request.title, 'chore') }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: '1'
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2.1.2
with:
Expand All @@ -124,8 +128,8 @@ jobs:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Cache packages
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Restore packages from cache
uses: actions/cache@v2
with:
path: |
Expand All @@ -135,8 +139,14 @@ jobs:
packages/icons/es
packages/tokens/dist
key: packages-${{ github.sha }}
- name: Build
run: yarn build
- name: Build Storybook
run: yarn build-storybook
- name: Upload to Chromatic
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: no8vpz82l1j
storybookBuildDir: packages/components/storybook-static/
test:
name: Test Coverage
if: ${{ !(startsWith(github.event.pull_request.title, 'chore') || startsWith(github.event.pull_request.title, 'docs')) }}
Expand All @@ -157,7 +167,7 @@ jobs:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Restore packages from cache
uses: actions/cache@v2
with:
Expand All @@ -174,4 +184,3 @@ jobs:
uses: codecov/codecov-action@v1
with:
directory: ./packages/components/coverage/

7 changes: 6 additions & 1 deletion packages/components/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ module.exports = {
'<rootDir>/__mocks__/fileMock.js',
'iconfont.js': '<rootDir>/__mocks__/iconMock.js',
},
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/index.{ts,tsx}', '!src/**/interface.ts'],
collectCoverageFrom: [
'src/**/*.{ts,tsx}',
'!src/**/index.{ts,tsx}',
'!src/**/interfaces.ts',
'!src/**/*.stories.{ts,tsx}',
],
coverageDirectory: './coverage/',
};
19 changes: 19 additions & 0 deletions packages/components/src/components/alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import { Story, Meta } from '@storybook/react/types-6-0';

import Alert from './index';
import { AlertProps } from './interfaces';
import './style';

export default {
title: 'Components/Basic/Alert',
component: Alert,
} as Meta;

const Template: Story<AlertProps> = (args) => <Alert {...args} />;

export const Default = Template.bind({});
Default.args = {
type: 'success',
message: 'Success Alert',
};
Loading

1 comment on commit d0f994b

@vercel
Copy link

@vercel vercel bot commented on d0f994b Nov 13, 2020

Choose a reason for hiding this comment

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

Please sign in to comment.