-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: bump deps * feat: init storybook * feat: ui stories * docs: adjust docs * fix: update stories * fix: calendar now using radix built in calendar * feat(ui): carousel * feat(ui): range calendar * feat(ui): complete all stories * ci: test storybook * chore: use separate vite storybook config, remove prettier and @storybook/builder-vite * ci: fix lint and comment out storybook-test job
- Loading branch information
Showing
149 changed files
with
18,636 additions
and
6,171 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 |
---|---|---|
|
@@ -96,3 +96,34 @@ jobs: | |
name: test-report | ||
path: html/ | ||
retention-days: 2 | ||
|
||
# running pnpm story:build --quiet leads to "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory" | ||
# storybook-test: | ||
# timeout-minutes: 60 | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/[email protected] | ||
|
||
# - name: Install pnpm | ||
# uses: pnpm/action-setup@v3 | ||
|
||
# - name: Setup node | ||
# uses: actions/[email protected] | ||
# with: | ||
# node-version: lts/* | ||
# cache: pnpm | ||
|
||
# - name: Install dependencies | ||
# run: pnpm install | ||
|
||
# - name: Install Playwright | ||
# run: pnpm dlx playwright install --with-deps | ||
|
||
# - name: Build Storybook | ||
# run: pnpm story:build --quiet | ||
|
||
# - name: Serve Storybook and run tests | ||
# run: | | ||
# pnpm dlx concurrently -k -s first -n "SB,TEST" -c "magenta,blue" \ | ||
# "pnpm dlx http-server storybook-static --port 6006 --silent" \ | ||
# "pnpm dlx wait-on tcp:6006 && yarn story:test" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import type { AddonOptionsVite } from '@storybook/addon-coverage' | ||
import type { StorybookConfig } from '@storybook/vue3-vite' | ||
|
||
const coverageConfig: AddonOptionsVite = { | ||
istanbul: { | ||
// exclude: ['**/exampleDirectory/**'], | ||
}, | ||
} | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../docs/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'], | ||
staticDirs: ['../docs/assets'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
'@storybook/addon-a11y', | ||
{ | ||
name: '@storybook/addon-coverage', | ||
options: coverageConfig, | ||
}, | ||
'@storybook/addon-themes', | ||
'@storybook/addon-designs', | ||
], | ||
framework: { | ||
name: '@storybook/vue3-vite', | ||
options: { | ||
docgen: 'vue-component-meta', | ||
builder: { | ||
viteConfigPath: './vite-storybook.config.ts', | ||
}, | ||
}, | ||
}, | ||
docs: { | ||
defaultName: 'Documentation', | ||
}, | ||
core: { | ||
disableTelemetry: true, // 👈 Disables telemetry | ||
}, | ||
} | ||
|
||
export default config |
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,18 @@ | ||
import { addons } from '@storybook/manager-api' | ||
import { create } from '@storybook/theming/create' | ||
|
||
const customTheme = create({ | ||
base: 'dark', | ||
brandTitle: 'Vue App Storybook', | ||
brandUrl: 'https://vue-app-rifandani.vercel.app', | ||
brandImage: 'https://www.vectorlogo.zone/logos/vuejs/vuejs-icon.svg', | ||
brandTarget: '_self', | ||
|
||
// Typography | ||
fontBase: '"Lato", sans-serif', | ||
fontCode: 'monospace', | ||
}) | ||
|
||
addons.setConfig({ | ||
theme: customTheme, | ||
}) |
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,62 @@ | ||
import { type Decorator, type Preview, setup } from '@storybook/vue3' | ||
import { createPinia } from 'pinia' | ||
import { createI18n } from 'vue-i18n' | ||
import { VueQueryPlugin } from '@tanstack/vue-query' | ||
import { withThemeByClassName } from '@storybook/addon-themes' | ||
import enUS from '../src/i18n/en-US.json' | ||
import idID from '../src/i18n/id-ID.json' | ||
import '../src/main.css' | ||
|
||
setup((app) => { | ||
// Type-define 'en-US' as the master schema for the resource | ||
type MessageSchema = typeof enUS | ||
|
||
const i18n = createI18n<[MessageSchema], 'en-US' | 'id-ID'>({ | ||
legacy: false, // you must set `false`, to use Composition API | ||
locale: 'en-US', | ||
fallbackLocale: 'en-US', // set fallback locale | ||
messages: { | ||
'en-US': enUS, | ||
'id-ID': idID, | ||
}, | ||
}) | ||
const pinia = createPinia() | ||
|
||
app.use(i18n) | ||
app.use(pinia) | ||
app.use(VueQueryPlugin, { | ||
queryClientConfig: { | ||
defaultOptions: { | ||
queries: { | ||
// gcTime: 1_000 * 60 * 5, // 5 mins. Defaults to 5 mins | ||
staleTime: 1_000 * 30, // 30 secs. Defaults to 0 | ||
networkMode: 'offlineFirst', | ||
}, | ||
}, | ||
}, | ||
}) | ||
}) | ||
|
||
export const decorators: Decorator[] = [ | ||
withThemeByClassName({ | ||
themes: { | ||
light: 'light', | ||
dark: 'dark', | ||
}, | ||
defaultTheme: 'light', | ||
}), | ||
] | ||
|
||
const preview: Preview = { | ||
tags: ['autodocs'], | ||
parameters: { | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/i, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
export default preview |
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,22 @@ | ||
import type { TestRunnerConfig } from '@storybook/test-runner' | ||
|
||
// see: https://storybook.js.org/docs/writing-tests/test-runner#test-hook-api | ||
const config: TestRunnerConfig = { | ||
// async preVisit(page) { | ||
// await injectAxe(page); | ||
// }, | ||
// async postVisit(page) { | ||
// await checkA11y(page, '#storybook-root', { | ||
// detailedReport: true, | ||
// detailedReportOptions: { | ||
// html: true, | ||
// }, | ||
// }); | ||
// }, | ||
tags: { | ||
exclude: ['exclude-test'], | ||
skip: ['skip-test'], | ||
}, | ||
} | ||
|
||
export default config |
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
Oops, something went wrong.