From af794bf6d1da4e05945363088d68c4b69a0e8034 Mon Sep 17 00:00:00 2001 From: "jeff.park" Date: Thu, 26 Oct 2023 10:22:12 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=A8=20=ED=81=AC=EB=A1=9C=EB=A7=88?= =?UTF-8?q?=ED=8B=B1=20=EB=B0=B0=ED=8F=AC=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/chromatic-publish.yml | 22 ++++++++++++++++++++++ package-lock.json | 20 +++++++++++++++++++- package.json | 1 + 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/chromatic-publish.yml diff --git a/.github/workflows/chromatic-publish.yml b/.github/workflows/chromatic-publish.yml new file mode 100644 index 0000000..145ccbf --- /dev/null +++ b/.github/workflows/chromatic-publish.yml @@ -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 }} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 914f073..01542b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "kyui3", "version": "0.2.1", - "license": "ISC", + "license": "MIT", "dependencies": { "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", @@ -29,6 +29,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", @@ -6686,6 +6687,17 @@ "node": ">=10" } }, + "node_modules/chromatic": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-7.5.0.tgz", + "integrity": "sha512-9B1rT8/L71BZTmAGXFBvKGrudnVZ4uBcGFckx0ZEMvOXboI0DOyr1/ehmSB1YmPOhu+r/7dy2jfTEzPmYcpXJg==", + "dev": true, + "bin": { + "chroma": "dist/bin.js", + "chromatic": "dist/bin.js", + "chromatic-cli": "dist/bin.js" + } + }, "node_modules/chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", @@ -18203,6 +18215,12 @@ "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", "dev": true }, + "chromatic": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-7.5.0.tgz", + "integrity": "sha512-9B1rT8/L71BZTmAGXFBvKGrudnVZ4uBcGFckx0ZEMvOXboI0DOyr1/ehmSB1YmPOhu+r/7dy2jfTEzPmYcpXJg==", + "dev": true + }, "chrome-trace-event": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", diff --git a/package.json b/package.json index 1059a09..c658bc1 100644 --- a/package.json +++ b/package.json @@ -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", From e58d97a6838cf40294863bff9f34fb81849e32dc Mon Sep 17 00:00:00 2001 From: "jeff.park" Date: Thu, 26 Oct 2023 11:04:39 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=94=A5=20input=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=EC=97=90=EC=84=9C=20textarea=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input/Input.stories.ts | 37 +---- src/components/input/Input.vue | 215 ++++++++++++-------------- 2 files changed, 107 insertions(+), 145 deletions(-) diff --git a/src/components/input/Input.stories.ts b/src/components/input/Input.stories.ts index cdfd009..968d235 100644 --- a/src/components/input/Input.stories.ts +++ b/src/components/input/Input.stories.ts @@ -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: { @@ -58,7 +54,7 @@ const meta = { helperText: { description: 'input ๋„์›€๋ง', defaultValue: '', - } + }, }, } satisfies Meta; @@ -81,7 +77,7 @@ export const Default: Story = { }, template: ` - ` + `, }), args: { type: 'text', @@ -102,7 +98,7 @@ export const InputWithLabelAndHelperText: Story = { }, template: ` - ` + `, }), args: { type: 'text', @@ -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: ` - - ` - }), - args: { - type: 'textarea', - placeholder: 'input', - isValidate: true, - disabled: false, - }, -}; \ No newline at end of file diff --git a/src/components/input/Input.vue b/src/components/input/Input.vue index 4a04e1a..7eacea8 100644 --- a/src/components/input/Input.vue +++ b/src/components/input/Input.vue @@ -1,33 +1,32 @@ \ No newline at end of file + From 988334d9ccaa8463cf816ff57c9252e44b8f70b0 Mon Sep 17 00:00:00 2001 From: "jeff.park" Date: Thu, 26 Oct 2023 11:04:59 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=A8=20textarea=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/textarea/TextArea.vue | 120 +++++++++++++++++++++++++++ src/components/textarea/index.ts | 3 + src/index.ts | 6 ++ 3 files changed, 129 insertions(+) create mode 100644 src/components/textarea/TextArea.vue create mode 100644 src/components/textarea/index.ts diff --git a/src/components/textarea/TextArea.vue b/src/components/textarea/TextArea.vue new file mode 100644 index 0000000..1430f03 --- /dev/null +++ b/src/components/textarea/TextArea.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/components/textarea/index.ts b/src/components/textarea/index.ts new file mode 100644 index 0000000..1749ee9 --- /dev/null +++ b/src/components/textarea/index.ts @@ -0,0 +1,3 @@ +import TextArea from './TextArea.vue'; + +export { TextArea }; diff --git a/src/index.ts b/src/index.ts index 7703d40..f35f568 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,7 @@ import type { App } from 'vue'; // components import { Input } from './components/input/index'; +import { TextArea } from './components/textarea/index'; import { Icon } from './components/icon/index'; import { Button, ButtonGroup } from './components/button/index'; import { Switch } from './components/switch/index'; @@ -110,6 +111,10 @@ const components = [ name: 'c-accordion-group', value: AccordionGroup, }, + { + name: 'c-textarea', + value: TextArea, + }, ]; const kyui3 = { @@ -143,6 +148,7 @@ export { Modal, Accordion, AccordionGroup, + TextArea, FontAwesomeIcon, }; From 903df7005a7ea73ad9af9d9b1196f68950e6c5e1 Mon Sep 17 00:00:00 2001 From: "jeff.park" Date: Thu, 26 Oct 2023 11:47:42 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=93=9D=20=EC=95=84=EC=BD=94=EB=94=94?= =?UTF-8?q?=EC=96=B8=20=EC=8A=A4=ED=86=A0=EB=A6=AC=EB=B6=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/accordion/Accordion.stories.ts | 88 +++++++++++++++++++ src/components/accordion/AccordionGroup.vue | 2 + 2 files changed, 90 insertions(+) create mode 100644 src/components/accordion/Accordion.stories.ts diff --git a/src/components/accordion/Accordion.stories.ts b/src/components/accordion/Accordion.stories.ts new file mode 100644 index 0000000..39f9e17 --- /dev/null +++ b/src/components/accordion/Accordion.stories.ts @@ -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; + +export default meta; +type Story = StoryObj; +/* + *๐Ÿ‘‡ 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: ` + +
์•„์ฝ”๋””์–ธ ๋‚ด์šฉ
+
+ `, + }), + args: { + title: 'accordion', + isArrow: false, + }, +}; + +export const Group: Story = { + parameters: { + docs: { + source: { + code: ` + + +
์—ฌ๊ธฐ์— ๋‚ด์šฉ์„
+
+ +
๊พธ๋ฉฐ ์ฃผ์‹œ๋ฉด
+
+ +
์•„๋ฆ„๋‹ค์šด ์•„์ฝ”๋””์–ธ์ด ์™„์„ฑ๋ฉ๋‹ˆ๋‹ค.
+
+
+`, + }, + }, + }, + render: (args) => ({ + components: { Accordion, AccordionGroup }, + setup() { + return { args }; + }, + template: ` + + +
์—ฌ๊ธฐ์— ๋‚ด์šฉ์„
+
+ +
๊พธ๋ฉฐ ์ฃผ์‹œ๋ฉด
+
+ +
์•„๋ฆ„๋‹ค์šด ์•„์ฝ”๋””์–ธ์ด ์™„์„ฑ๋ฉ๋‹ˆ๋‹ค.
+
+
+ `, + }), +}; diff --git a/src/components/accordion/AccordionGroup.vue b/src/components/accordion/AccordionGroup.vue index 0f444f3..f7292b4 100644 --- a/src/components/accordion/AccordionGroup.vue +++ b/src/components/accordion/AccordionGroup.vue @@ -4,6 +4,8 @@ + +