vanilla-vue-ui 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vanilla-vue-ui",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "files": [
@@ -9,7 +9,8 @@
9
9
  "custom",
10
10
  "icon",
11
11
  "types",
12
- "util"
12
+ "util",
13
+ "page-template"
13
14
  ],
14
15
  "scripts": {
15
16
  "dev": "vite",
@@ -28,7 +29,8 @@
28
29
  "copy-icon": "copyfiles -u 1 src/icon/**/* .",
29
30
  "copy-types": "copyfiles -u 1 src/types/**/* .",
30
31
  "copy-util": "copyfiles -u 1 src/util/**/* .",
31
- "copy": "npm run copy-template && npm run copy-basic && npm run copy-custom && npm run copy-icon && npm run copy-types && npm run copy-util"
32
+ "copy-page-template": "copyfiles -u 1 src/page-template/**/* .",
33
+ "copy": "npm run copy-template && npm run copy-basic && npm run copy-custom && npm run copy-icon && npm run copy-types && npm run copy-util && npm run copy-page-template"
32
34
  },
33
35
  "dependencies": {
34
36
  "@headlessui/vue": "^1.7.17",
@@ -0,0 +1,13 @@
1
+ <template>
2
+ <slot name="header"></slot>
3
+
4
+ <main>
5
+ <slot name="title"></slot>
6
+
7
+ <slot></slot>
8
+ </main>
9
+
10
+ <slot name="bottom"></slot>
11
+
12
+ <slot name="footer"></slot>
13
+ </template>
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <slot name="header"></slot>
3
+
4
+ <main>
5
+ <article>
6
+ <slot></slot>
7
+ </article>
8
+ </main>
9
+
10
+ <slot name="footer"></slot>
11
+ </template>
@@ -0,0 +1,62 @@
1
+ // Replace vue3 with vue if you are using Storybook for Vue 2
2
+ import type { Meta, StoryObj } from '@storybook/vue3';
3
+ import DashboardTemplate from './WDashboardTemplate.vue';
4
+ import { HomeIcon } from '@heroicons/vue/24/outline'
5
+
6
+ type DashboardTemplateProps = InstanceType<typeof DashboardTemplate>['$props']
7
+
8
+ const meta: Meta<typeof DashboardTemplate> = {
9
+ component: DashboardTemplate,
10
+ };
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof DashboardTemplate>;
14
+
15
+ /*
16
+ *👇 Render functions are a framework specific feature to allow you control on how the component renders.
17
+ * See https://storybook.js.org/docs/api/csf
18
+ * to learn how to use render functions.
19
+ */
20
+ export const Primary: Story = {
21
+ render: (args: DashboardTemplateProps) => ({
22
+ setup() {
23
+ return {
24
+ ...args
25
+ }
26
+ },
27
+ components: { DashboardTemplate },
28
+ template: `
29
+ <DashboardTemplate :navigationTop="navigationTop">
30
+ <div class="prose">
31
+ <h1>Menu</h1>
32
+ </div>
33
+ </DashboardTemplate>
34
+ `,
35
+ }),
36
+ args: {
37
+ navigationTop: [{ name: 'メニュー', href: '/ja', onClick: undefined, icon: HomeIcon, current: false }]
38
+ }
39
+ };
40
+
41
+ export const WithBottom: Story = {
42
+ render: (args: DashboardTemplateProps) => ({
43
+ setup() {
44
+ return {
45
+ ...args
46
+ }
47
+ },
48
+ components: { DashboardTemplate },
49
+ template: `
50
+ <DashboardTemplate :title="title" :navigationTop="navigationTop" :navigationBottom="navigationBottom">
51
+ <div class="prose">
52
+ <h1>Menu</h1>
53
+ </div>
54
+ </DashboardTemplate>
55
+ `,
56
+ }),
57
+ args: {
58
+ title: '管理ページ',
59
+ navigationTop: [{ name: 'メニュー', href: '/ja', onClick: undefined, icon: HomeIcon, current: false }],
60
+ navigationBottom: [{ name: 'ログアウト', href: undefined, onClick: () => console.log('ログアウトボタンが押されました。'), icon: undefined, current: undefined }]
61
+ }
62
+ };
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <NavigationDrawer
3
+ :title="props.title"
4
+ :navigation-top="navigationTop"
5
+ :navigation-bottom="navigationBottom"
6
+ >
7
+ <Banner />
8
+
9
+ <div class="mt-4 lg:mt-8 mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
10
+ <div class="mx-auto max-w-3xl">
11
+ <Breadcrumb />
12
+
13
+ <div class="mt-4 lg:mt-10">
14
+ <slot />
15
+ </div>
16
+ </div>
17
+ </div>
18
+
19
+ <FooterSimple :text="props.footerText" />
20
+ </NavigationDrawer>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ import type { NavigationDrawerContent } from '../../template/navigation-drawer/NavigationDrawerContent'
25
+ import NavigationDrawer from '../../template/navigation-drawer/NavigationDrawer.vue'
26
+ import FooterSimple from '../../template/footer-simple/WFooterSimple.vue'
27
+ import Breadcrumb from '../../basic/breadcrumb/WBreadcrumb.vue'
28
+ import Banner from '../../basic/banner/WBanner.vue'
29
+ import type { PropType } from 'vue'
30
+
31
+ const props = defineProps({
32
+ title: {
33
+ type: String as PropType<string>,
34
+ default: "Dashboard"
35
+ },
36
+ navigationTop: {
37
+ type: Array as PropType<NavigationDrawerContent[]>,
38
+ required: true
39
+ },
40
+ navigationBottom: {
41
+ type: Array as PropType<NavigationDrawerContent[]>,
42
+ required: false,
43
+ default: []
44
+ },
45
+ footerText: {
46
+ type: String as PropType<string>,
47
+ required: false,
48
+ default: `© 2020 Your Company, Inc. All rights reserved.`
49
+ }
50
+ })
51
+ </script>