diff --git a/bun.lockb b/bun.lockb index d78bb5da..6bf71081 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/composable/index.ts b/packages/composable/index.ts index 3d4464b1..d64adf78 100644 --- a/packages/composable/index.ts +++ b/packages/composable/index.ts @@ -1,4 +1,5 @@ export * from './lib/useArray' export * from './lib/useColor' +export * from './lib/useNav' export * from './lib/useToast' export * from './lib/useTypography' diff --git a/packages/composable/lib/useNav.ts b/packages/composable/lib/useNav.ts new file mode 100644 index 00000000..3c875585 --- /dev/null +++ b/packages/composable/lib/useNav.ts @@ -0,0 +1,21 @@ +import { onMounted, onUnmounted, ref } from 'vue' + +export function useNav() { + const navRef = ref(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 } +} diff --git a/packages/ui/.storybook/main.js b/packages/ui/.storybook/main.js index 70cc02b3..6bcb0b52 100644 --- a/packages/ui/.storybook/main.js +++ b/packages/ui/.storybook/main.js @@ -10,6 +10,7 @@ module.exports = { '@storybook/addon-backgrounds', '@storybook/addon-essentials', '@storybook/addon-links', + '@storybook/addon-viewport', ], framework: { name: '@storybook/vue3-vite', diff --git a/packages/ui/assets/logo/vuefes_logo.svg b/packages/ui/assets/logo/vuefes_logo.svg new file mode 100644 index 00000000..1979d366 --- /dev/null +++ b/packages/ui/assets/logo/vuefes_logo.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/packages/ui/components/CssResetButton.stories.ts b/packages/ui/components/common/CssResetButton.stories.ts similarity index 95% rename from packages/ui/components/CssResetButton.stories.ts rename to packages/ui/components/common/CssResetButton.stories.ts index 0519449f..08f7b88f 100644 --- a/packages/ui/components/CssResetButton.stories.ts +++ b/packages/ui/components/common/CssResetButton.stories.ts @@ -2,7 +2,7 @@ import { StoryFn } from '@storybook/vue3' import CssResetButton from './CssResetButton.vue' export default { - title: 'Example/CssResetButton', + title: 'common/CssResetButton', component: CssResetButton, args: { default: 'Go!', diff --git a/packages/ui/components/CssResetButton.vue b/packages/ui/components/common/CssResetButton.vue similarity index 100% rename from packages/ui/components/CssResetButton.vue rename to packages/ui/components/common/CssResetButton.vue diff --git a/packages/ui/components/common/Header.stories.ts b/packages/ui/components/common/Header.stories.ts new file mode 100644 index 00000000..9194e4e7 --- /dev/null +++ b/packages/ui/components/common/Header.stories.ts @@ -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 = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { Header }, + setup() { + return { args } + }, + template: '
', +}) + +export const Default = Template.bind({}) + +Default.parameters = { + layout: 'fullscreen', +} diff --git a/packages/ui/components/common/Header.vue b/packages/ui/components/common/Header.vue new file mode 100644 index 00000000..4baae749 --- /dev/null +++ b/packages/ui/components/common/Header.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/packages/ui/components/common/Logo.stories.ts b/packages/ui/components/common/Logo.stories.ts new file mode 100644 index 00000000..97379c85 --- /dev/null +++ b/packages/ui/components/common/Logo.stories.ts @@ -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 = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { Logo }, + setup() { + return { args } + }, + template: '', +}) + +export const Default = Template.bind({}) + +export const Dark = Template.bind({}) +Dark.args = { + color: 'white', +} +Dark.parameters = { + backgrounds: { + default: 'dark', + }, +} diff --git a/packages/ui/components/common/Logo.vue b/packages/ui/components/common/Logo.vue new file mode 100644 index 00000000..79ae606e --- /dev/null +++ b/packages/ui/components/common/Logo.vue @@ -0,0 +1,25 @@ + + + diff --git a/packages/ui/components/common/SpHeader.stories.ts b/packages/ui/components/common/SpHeader.stories.ts new file mode 100644 index 00000000..1e7e0db0 --- /dev/null +++ b/packages/ui/components/common/SpHeader.stories.ts @@ -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 = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { SpHeader }, + setup() { + return { args } + }, + template: '', +}) + +export const Default = Template.bind({}) + +Default.parameters = { + layout: 'fullscreen', + viewport: { + defaultViewport: 'mobile1', + }, +} diff --git a/packages/ui/components/common/SpHeader.vue b/packages/ui/components/common/SpHeader.vue new file mode 100644 index 00000000..7ec58938 --- /dev/null +++ b/packages/ui/components/common/SpHeader.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/packages/ui/components/Typography.stories.ts b/packages/ui/components/common/Typography.stories.ts similarity index 100% rename from packages/ui/components/Typography.stories.ts rename to packages/ui/components/common/Typography.stories.ts diff --git a/packages/ui/components/Typography.vue b/packages/ui/components/common/Typography.vue similarity index 100% rename from packages/ui/components/Typography.vue rename to packages/ui/components/common/Typography.vue diff --git a/packages/ui/components/InputField.stories.ts b/packages/ui/components/forms/InputField.stories.ts similarity index 100% rename from packages/ui/components/InputField.stories.ts rename to packages/ui/components/forms/InputField.stories.ts diff --git a/packages/ui/components/InputField.vue b/packages/ui/components/forms/InputField.vue similarity index 97% rename from packages/ui/components/InputField.vue rename to packages/ui/components/forms/InputField.vue index 0d329346..3ae47951 100644 --- a/packages/ui/components/InputField.vue +++ b/packages/ui/components/forms/InputField.vue @@ -1,7 +1,7 @@