-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
98 additions
and
90 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
13 changes: 7 additions & 6 deletions
13
packages/kitbook/src/lib/layout/sidebar/search/SearchModal.variants.ts
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,15 +1,16 @@ | ||
import type { Variant } from 'kitbook' | ||
import type Component from './SearchModal.svelte' | ||
|
||
export const variants: Variant<Component>[] = [ | ||
{ | ||
description: 'urls should start with `/search` since that is passed in as the kitbookPath', | ||
props: { | ||
kitbookPath: '/search', | ||
export const Basic: Variant<Component> = { | ||
_meta: { | ||
description: 'Hit Ctrl+K or Meta+K to open modal. Urls should start with `/search` since that is passed in as the kitbookPath', | ||
tests: { | ||
skip: true, | ||
}, | ||
viewports: [ | ||
{ name: 'Desktop', width: 800, height: 600 }, | ||
{ name: 'Mobile', width: 320, height: 600 }, | ||
], | ||
}, | ||
] | ||
kitbookPath: '/search', | ||
} |
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
83 changes: 45 additions & 38 deletions
83
packages/kitbook/src/lib/routes/[...file]/_page.variants.ts
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,44 +1,51 @@ | ||
import type { Variant } from 'kitbook' | ||
import type { GroupedPage, Variant, VariantMeta } from 'kitbook' | ||
import type Component from './+page.svelte' | ||
|
||
import { variants as hiVariants } from './mockComponents/Hi.variants' | ||
// import { variants as hiVariants } from './mockComponents/Hi.variants' | ||
|
||
export const variants: Variant<Component>[] = [ | ||
{ | ||
name: 'i18n', | ||
description: 'Has three languages, which can be toggled between or both can be selected. Variants will will 500 error because they are a sandbox in a sandbox. That is ok as they are just here to show the current language. Try changing the language in the sidebar and use the multi-select feature.', | ||
props: { | ||
data: { | ||
settings: { | ||
title: 'i18n Kitbook', | ||
description: '', | ||
expandTree: true, | ||
viewports: [{ | ||
width: 300, | ||
height: 300, | ||
}], | ||
languages: [ | ||
{ code: 'en', name: 'English' }, | ||
{ code: 'es', name: 'Spanish' }, | ||
{ code: 'fr', name: 'French' }, | ||
], | ||
}, | ||
loadedModules: { | ||
variantsModule: { variants: hiVariants }, | ||
}, | ||
pages: { | ||
'/docs/1-get-started': { | ||
name: 'get started', | ||
url: '/docs/1-get-started', | ||
path: '/src/docs/1-get-started.md', | ||
extensions: [ | ||
'md', | ||
], | ||
}, | ||
}, | ||
pagesStore: null, | ||
}, | ||
export const shared_meta: VariantMeta = {} | ||
|
||
const shared = { | ||
} satisfies Partial<Variant<Component>> | ||
|
||
const page: GroupedPage = { | ||
name: 'get started', | ||
url: '/docs/1-get-started', | ||
path: '/src/docs/1-get-started.md', | ||
extensions: [ | ||
'md', | ||
], | ||
} | ||
|
||
export const i18n: Variant<Component> = { | ||
...shared, | ||
data: { | ||
settings: { | ||
title: 'i18n Kitbook', | ||
description: '', | ||
expandTree: true, | ||
viewports: [{ | ||
width: 300, | ||
height: 300, | ||
}], | ||
languages: [ | ||
{ code: 'en', name: 'English' }, | ||
{ code: 'es', name: 'Spanish' }, | ||
{ code: 'fr', name: 'French' }, | ||
], | ||
}, | ||
loadedModules: { | ||
// variantsModule: { variants: hiVariants }, | ||
}, | ||
pages: { | ||
'/docs/1-get-started': page, | ||
}, | ||
page, | ||
pageKey: '/docs/1-get-started', | ||
pagesStore: null, | ||
}, | ||
_meta: { | ||
description: 'Has three languages, which can be toggled between or both can be selected. Variants will will 500 error because they are a sandbox in a sandbox. That is ok as they are just here to show the current language. Try changing the language in the sidebar and use the multi-select feature.', | ||
viewports: [{ width: 1000, height: 600 }], | ||
}, | ||
] | ||
} |
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