-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from vuejs-jp/enhance/pathPrefix-false
pathPrefix to false
- Loading branch information
Showing
28 changed files
with
312 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './lib/useArray' | ||
export * from './lib/useColor' | ||
export * from './lib/useNav' | ||
export * from './lib/useToast' | ||
export * from './lib/useTypography' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { onMounted, onUnmounted, ref } from 'vue' | ||
|
||
export function useNav() { | ||
const navRef = ref<HTMLElement | null>(null) | ||
const showNav = ref(false) | ||
|
||
function checkShowNav() { | ||
showNav.value = window.pageYOffset > 50 | ||
} | ||
|
||
onMounted(function () { | ||
checkShowNav() | ||
window.addEventListener('scroll', checkShowNav) | ||
}) | ||
|
||
onUnmounted(function () { | ||
window.removeEventListener('scroll', checkShowNav) | ||
}) | ||
|
||
return { navRef, showNav } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { StoryFn } from '@storybook/vue3' | ||
import Header from './Header.vue' | ||
|
||
export default { | ||
title: 'common/Header', | ||
component: Header, | ||
parameters: { | ||
backgrounds: { | ||
default: 'dark', | ||
values: [ | ||
{ | ||
name: 'dark', | ||
value: '#35495e', | ||
}, | ||
{ | ||
name: 'light', | ||
value: '#fff', | ||
}, | ||
], | ||
}, | ||
}, | ||
args: { | ||
color: 'vue-blue', | ||
}, | ||
argTypes: { | ||
color: { | ||
description: 'The color property', | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
const Template: StoryFn<unknown> = (args, { argTypes }) => ({ | ||
props: Object.keys(argTypes), | ||
components: { Header }, | ||
setup() { | ||
return { args } | ||
}, | ||
template: '<Header v-bind="args" />', | ||
}) | ||
|
||
export const Default = Template.bind({}) | ||
|
||
Default.parameters = { | ||
layout: 'fullscreen', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
import Logo from './Logo.vue' | ||
import { useColor, useNav } from '@vuejs-jp/composable' | ||
const { navRef } = useNav() | ||
const { color } = useColor() | ||
</script> | ||
|
||
<template> | ||
<nav | ||
ref="navRef" | ||
:style="{ backgroundColor: color('white') }" | ||
> | ||
<div class="nav-root"> | ||
<h1> | ||
<Logo color="vue-blue" /> | ||
</h1> | ||
</div> | ||
</nav> | ||
</template> | ||
|
||
<style scoped> | ||
nav { | ||
position: fixed; | ||
top: 0; | ||
z-index: 10; | ||
width: 100%; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
.nav-root { | ||
padding: 20px 80px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { StoryFn } from '@storybook/vue3' | ||
import Logo from './Logo.vue' | ||
|
||
export default { | ||
title: 'common/Logo', | ||
component: Logo, | ||
parameters: { | ||
backgrounds: { | ||
default: 'light', | ||
values: [ | ||
{ | ||
name: 'dark', | ||
value: '#35495e', | ||
}, | ||
{ | ||
name: 'light', | ||
value: '#fff', | ||
}, | ||
], | ||
}, | ||
}, | ||
args: { | ||
color: 'vue-blue', | ||
}, | ||
argTypes: { | ||
color: { | ||
description: 'The color property', | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
const Template: StoryFn<unknown> = (args, { argTypes }) => ({ | ||
props: Object.keys(argTypes), | ||
components: { Logo }, | ||
setup() { | ||
return { args } | ||
}, | ||
template: '<Logo v-bind="args" />', | ||
}) | ||
|
||
export const Default = Template.bind({}) | ||
|
||
export const Dark = Template.bind({}) | ||
Dark.args = { | ||
color: 'white', | ||
} | ||
Dark.parameters = { | ||
backgrounds: { | ||
default: 'dark', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<script setup lang="ts"> | ||
import { defineAsyncComponent } from 'vue' | ||
import type { Color } from '@vuejs-jp/model' | ||
import { useColor } from '@vuejs-jp/composable' | ||
export type LogoProps = { | ||
color: Color | ||
} | ||
const props = defineProps<LogoProps>() | ||
const svgComponent = | ||
defineAsyncComponent( | ||
() => import('../../assets/logo/vuefes_logo.svg?component'), | ||
) | ||
const { color: fillColor } = useColor() | ||
</script> | ||
|
||
<template> | ||
<component | ||
:is="svgComponent" | ||
:fill="fillColor(props.color)" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { StoryFn } from '@storybook/vue3' | ||
import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport' | ||
import SpHeader from './SpHeader.vue' | ||
|
||
export default { | ||
title: 'common/SpHeader', | ||
component: SpHeader, | ||
parameters: { | ||
backgrounds: { | ||
default: 'dark', | ||
values: [ | ||
{ | ||
name: 'dark', | ||
value: '#35495e', | ||
}, | ||
{ | ||
name: 'light', | ||
value: '#fff', | ||
}, | ||
], | ||
}, | ||
viewport: { | ||
viewports: { | ||
...MINIMAL_VIEWPORTS, | ||
mobile1: { | ||
name: 'Small mobile', | ||
styles: { width: '375px', height: '667px' }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
args: { | ||
color: 'vue-blue', | ||
}, | ||
argTypes: { | ||
color: { | ||
description: 'The color property', | ||
control: { | ||
type: 'text', | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
const Template: StoryFn<unknown> = (args, { argTypes }) => ({ | ||
props: Object.keys(argTypes), | ||
components: { SpHeader }, | ||
setup() { | ||
return { args } | ||
}, | ||
template: '<SpHeader v-bind="args" />', | ||
}) | ||
|
||
export const Default = Template.bind({}) | ||
|
||
Default.parameters = { | ||
layout: 'fullscreen', | ||
viewport: { | ||
defaultViewport: 'mobile1', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script setup lang="ts"> | ||
import Logo from './Logo.vue' | ||
import { useColor, useNav } from '@vuejs-jp/composable' | ||
const { navRef } = useNav() | ||
const { color } = useColor() | ||
</script> | ||
|
||
<template> | ||
<nav | ||
ref="navRef" | ||
:style="{ backgroundColor: color('white') }" | ||
> | ||
<div class="nav-root"> | ||
<h1> | ||
<Logo color="vue-blue" /> | ||
</h1> | ||
</div> | ||
</nav> | ||
</template> | ||
|
||
<style scoped> | ||
nav { | ||
position: fixed; | ||
top: 0; | ||
z-index: 10; | ||
width: 100%; | ||
padding: 0; | ||
margin: 0; | ||
} | ||
.nav-root { | ||
padding: 16px 0; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
} | ||
</style> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/ui/components/InputField.vue → packages/ui/components/forms/InputField.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/ui/components/SubmitButton.vue → ...ages/ui/components/forms/SubmitButton.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/ui/components/TextAreaField.vue → ...ges/ui/components/forms/TextAreaField.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters