-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Re-add storybook * Re-add storybook to ci_cd * Use built storybook for CI * Fix mobile searchbar clear button * Update snapshots * Try fixing pnpx cache access * Fix type * Fix value type * Update the error string * Add docs build * Remove favicon replacement * Add svg icon * Update the lock file
- Loading branch information
Showing
179 changed files
with
6,625 additions
and
3,147 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
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
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,12 +1,18 @@ | ||
import { h } from "vue" | ||
|
||
export const WithScreenshotArea = (story) => { | ||
return { | ||
template: ` | ||
<div | ||
class="screenshot-area" | ||
:style="{ display: 'inline-block', padding: '2rem' }" | ||
> | ||
<story /> | ||
</div>`, | ||
components: { story }, | ||
setup() { | ||
return () => | ||
h( | ||
"div", | ||
{ | ||
class: "screenshot-area", | ||
style: "display: inline-block; padding: 2rem;", | ||
}, | ||
[h(story())] | ||
) | ||
}, | ||
} | ||
} |
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,31 @@ | ||
import { h, ref } from "vue" | ||
|
||
import { useSearchStore } from "~/stores/search" | ||
|
||
import VButton from "~/components/VButton.vue" | ||
|
||
export const WithTeleportTarget = (story) => { | ||
return { | ||
components: { story }, | ||
setup() { | ||
const isRendered = ref(false) | ||
const renderStory = () => { | ||
isRendered.value = true | ||
} | ||
// A workaround to make sure that the useStorage is initialized in the child story | ||
useSearchStore().addRecentSearch("cat") | ||
return () => | ||
h("div", null, [ | ||
isRendered.value | ||
? h(story()) | ||
: h( | ||
VButton, | ||
{ variant: "filled-dark", size: "large", onClick: renderStory }, | ||
{ default: () => "Render Story" } | ||
), | ||
h("div"), | ||
h("div", { id: "teleports" }), | ||
]) | ||
}, | ||
} | ||
} |
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,18 +1,17 @@ | ||
import { ref, onMounted } from "vue" | ||
import { ref, onMounted, h } from "vue" | ||
|
||
import { useLayout } from "~/composables/use-layout" | ||
|
||
export const WithUiStore = (story) => { | ||
return { | ||
template: `<div ref="element"><story /></div>`, | ||
components: { story }, | ||
setup() { | ||
const element = ref() | ||
const { updateBreakpoint } = useLayout() | ||
onMounted(() => { | ||
updateBreakpoint() | ||
}) | ||
return { element } | ||
return () => h("div", { ref: element }, [h(story())]) | ||
}, | ||
} | ||
} |
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 type { StorybookConfig } from "@storybook-vue/nuxt" | ||
|
||
const config: StorybookConfig = { | ||
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], | ||
addons: [ | ||
"@storybook/addon-links", | ||
"@storybook/addon-essentials", | ||
"@storybook/addon-interactions", | ||
], | ||
framework: { | ||
name: "@storybook-vue/nuxt", | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: "tag", | ||
}, | ||
} | ||
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,47 @@ | ||
import { VIEWPORTS } from "~/constants/screens" | ||
|
||
import { WithUiStore } from "~~/.storybook/decorators/with-ui-store" | ||
import { WithRTL } from "~~/.storybook/decorators/with-rtl" | ||
|
||
import type { Preview } from "@storybook/vue3" | ||
|
||
const preview: Preview = { | ||
decorators: [WithRTL, WithUiStore], | ||
globalTypes: { | ||
languageDirection: { | ||
name: "RTL", | ||
description: "Simulate an RTL language.", | ||
table: { | ||
defaultValue: { summary: "ltr" }, | ||
}, | ||
toolbar: { | ||
icon: "globe", | ||
items: [ | ||
{ value: "ltr", title: "LTR" }, | ||
{ value: "rtl", title: "RTL" }, | ||
], | ||
}, | ||
}, | ||
}, | ||
parameters: { | ||
backgrounds: { | ||
default: "light", | ||
values: [ | ||
{ name: "light", value: "#ffffff" }, | ||
{ name: "dark", value: "#0d0d0d" }, | ||
], | ||
}, | ||
viewport: { | ||
viewports: { ...VIEWPORTS }, | ||
}, | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
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
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
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.