Skip to content

Commit

Permalink
[ merge into master ] 개발 코드 업데이트
Browse files Browse the repository at this point in the history
✨ 크로마틱 배포 로직 추가
🔥 input 컴포넌트에서 textarea 제거
✨ textarea 컴포넌트 추가
📝 아코디언 스토리북 추가
📝 textarea 스토리북 추가
  • Loading branch information
tmdrb278 authored Oct 26, 2023
2 parents 242ad30 + a5a4f76 commit 8dabcf0
Show file tree
Hide file tree
Showing 11 changed files with 422 additions and 146 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/chromatic-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Name of our action
name: 'Chromatic Publish'
# The event that will trigger the action
on:
workflow_run:
workflows: ["update tag & package"]
types:
- completed

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: yarn
#👇 Adds Chromatic as a step in the workflow
- uses: chromaui/action@v1
# Options required for Chromatic's GitHub Action
with:
#👇 Chromatic projectToken, see https://storybook.js.org/tutorials/design-systems-for-developers/react/ko/review/ to obtain it
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
20 changes: 19 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@types/node": "^18.11.18",
"@vitejs/plugin-vue": "^4.0.0",
"@vue/tsconfig": "^0.1.3",
"chromatic": "^7.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "^1.57.1",
Expand Down
88 changes: 88 additions & 0 deletions src/components/accordion/Accordion.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import type { Meta, StoryObj } from '@storybook/vue3';

import Accordion from '@/components/accordion/Accordion.vue';
import AccordionGroup from '@/components/accordion/AccordionGroup.vue';

// More on how to set up stories at: https://storybook.js.org/docs/vue/writing-stories/introduction
const meta = {
title: 'kyUI3/Accordion',
component: Accordion,
// This component will have an automatically generated docsPage entry: https://storybook.js.org/docs/vue/writing-docs/autodocs
tags: ['autodocs'],
argTypes: {
title: {
description: '아코디언 타이틀',
defaultValue: 'title',
},
isArrow: {
description: '화살표 여부',
defaultValue: false,
},
},
} satisfies Meta<typeof Accordion>;

export default meta;
type Story = StoryObj<typeof meta>;
/*
*👇 Render functions are a framework specific feature to allow you control on how the component renders.
* See https://storybook.js.org/docs/vue/api/csf
* to learn how to use render functions.
*/
export const Default: Story = {
render: (args) => ({
components: { Accordion },
setup() {
return { args };
},
template: `
<Accordion v-bind="args">
<div>아코디언 내용</div>
</Accordion>
`,
}),
args: {
title: 'accordion',
isArrow: false,
},
};

export const Group: Story = {
parameters: {
docs: {
source: {
code: `
<c-accordion-group>
<c-accordion title="accordion1">
<div>여기에 내용을</div>
</c-accordion>
<c-accordion title="accordion2">
<div>꾸며 주시면</div>
</c-accordion>
<c-accordion title="accordion3">
<div>아름다운 아코디언이 완성됩니다.</div>
</c-accordion>
</c-accordion-group>
`,
},
},
},
render: (args) => ({
components: { Accordion, AccordionGroup },
setup() {
return { args };
},
template: `
<AccordionGroup>
<Accordion title="accordion1">
<div>여기에 내용을</div>
</Accordion>
<Accordion title="accordion2">
<div>꾸며 주시면</div>
</Accordion>
<Accordion title="accordion3">
<div>아름다운 아코디언이 완성됩니다.</div>
</Accordion>
</AccordionGroup>
`,
}),
};
2 changes: 2 additions & 0 deletions src/components/accordion/AccordionGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
</div>
</template>

<script setup lang="ts" name="c-accordion-group"></script>

<style lang="scss" scoped>
@import '../../styles/common.scss';
.c-accordion-group {
Expand Down
37 changes: 6 additions & 31 deletions src/components/input/Input.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@ const meta = {
description: '인풋의 스타일에 적용되는 `type`',
defaultValue: 'text',
control: 'select',
options: [
'text',
'textarea',
'email',
'phone',
]
options: ['text', 'email', 'phone'],
},
placeholder: {
description: '인풋 placeholder',
defaultValue: 'input',
},
isValidate: {
description: '인풋에 입력한 값이 유효한 값인지 체크할지 말지 정하는 변수',
description:
'인풋에 입력한 값이 유효한 값인지 체크할지 말지 정하는 변수',
default: true,
},
disabled: {
Expand Down Expand Up @@ -58,7 +54,7 @@ const meta = {
helperText: {
description: 'input 도움말',
defaultValue: '',
}
},
},
} satisfies Meta<typeof Input>;

Expand All @@ -81,7 +77,7 @@ export const Default: Story = {
},
template: `
<Input v-bind="args" v-model="value"></Input>
`
`,
}),
args: {
type: 'text',
Expand All @@ -102,7 +98,7 @@ export const InputWithLabelAndHelperText: Story = {
},
template: `
<Input v-bind="args" v-model="value"></Input>
`
`,
}),
args: {
type: 'text',
Expand All @@ -113,24 +109,3 @@ export const InputWithLabelAndHelperText: Story = {
helperText: '헬퍼 텍스트 입니다.',
},
};

export const Textarea: Story = {
render: (args) => ({
components: {
Input,
},
setup() {
const value = ref('');
return { args, value };
},
template: `
<Input v-bind="args" v-model="value"></Input>
`
}),
args: {
type: 'textarea',
placeholder: 'input',
isValidate: true,
disabled: false,
},
};
Loading

0 comments on commit 8dabcf0

Please sign in to comment.