From ba1ca773b1092f076777518ccc4a599ce9827b91 Mon Sep 17 00:00:00 2001 From: kawamataryo Date: Fri, 11 Oct 2024 09:08:20 +0900 Subject: [PATCH] feat: content loader --- .../ContentLoader/ContentLoader.stories.ts | 53 +++++++++ .../ContentLoader/ContentLoader.vue | 101 ++++++++++++++++++ .../ContentLoader/ContentLoader.vue.d.ts | 44 ++++++++ 3 files changed, 198 insertions(+) create mode 100644 src/components/ContentLoader/ContentLoader.stories.ts create mode 100644 src/components/ContentLoader/ContentLoader.vue create mode 100644 types/components/ContentLoader/ContentLoader.vue.d.ts diff --git a/src/components/ContentLoader/ContentLoader.stories.ts b/src/components/ContentLoader/ContentLoader.stories.ts new file mode 100644 index 0000000..343862b --- /dev/null +++ b/src/components/ContentLoader/ContentLoader.stories.ts @@ -0,0 +1,53 @@ +import type { Meta, StoryObj } from '@storybook/vue3' +import ContentLoader from './ContentLoader.vue' + +const meta: Meta = { + title: 'ContentLoader', + component: ContentLoader, + argTypes: { + type: { + control: { type: 'select' }, + options: ['PARAGRAPH', 'BULLET_LIST', 'CIRCLE'], + defaultValue: 'PARAGRAPH', + }, + lineCount: { + control: { type: 'number' }, + defaultValue: 5, + }, + lineHeight: { + control: { type: 'number' }, + defaultValue: 1, + }, + randomLineWidth: { + control: { type: 'boolean' }, + defaultValue: true, + }, + gap: { + control: { type: 'number' }, + defaultValue: 0.8, + }, + }, + render: (args) => ({ + components: { ContentLoader }, + setup() { + return { args } + }, + template: ` + `, + }), +} + +export default meta + +type Story = StoryObj + +export const Default: Story = { + name: 'default', + args: { + type: 'PARAGRAPH', + lineCount: 5, + line: 1, + randomLineWidth: true, + gap: 0.8, + }, +} diff --git a/src/components/ContentLoader/ContentLoader.vue b/src/components/ContentLoader/ContentLoader.vue new file mode 100644 index 0000000..5986da1 --- /dev/null +++ b/src/components/ContentLoader/ContentLoader.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/types/components/ContentLoader/ContentLoader.vue.d.ts b/types/components/ContentLoader/ContentLoader.vue.d.ts new file mode 100644 index 0000000..9a7becf --- /dev/null +++ b/types/components/ContentLoader/ContentLoader.vue.d.ts @@ -0,0 +1,44 @@ +declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{ + type?: "PARAGRAPH" | "BULLET_LIST" | "CIRCLE"; + height?: number; + baseLineHeight?: number; + gap?: number; +}>, { + type: string; + height: number; + baseLineHeight: number; + gap: number; +}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly, { + type: string; + height: number; + baseLineHeight: number; + gap: number; +}>>>, { + type: "PARAGRAPH" | "BULLET_LIST" | "CIRCLE"; + height: number; + gap: number; + baseLineHeight: number; +}, {}>; +export default _default; +type __VLS_WithDefaults = { + [K in keyof Pick]: K extends keyof D ? __VLS_Prettify : P[K]; +}; +type __VLS_Prettify = { + [K in keyof T]: T[K]; +} & {}; +type __VLS_NonUndefinedable = T extends undefined ? never : T; +type __VLS_TypePropsToOption = { + [K in keyof T]-?: {} extends Pick ? { + type: import('vue').PropType<__VLS_NonUndefinedable>; + } : { + type: import('vue').PropType; + required: true; + }; +};