Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Feb 27, 2025
1 parent 1d2ac1c commit 9be10a3
Show file tree
Hide file tree
Showing 35 changed files with 42 additions and 46 deletions.
19 changes: 7 additions & 12 deletions docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ import { type DefaultTheme, defineConfig } from 'vitepress'
import { baseConfig } from '../../../config/vite'
import { storyPlugin } from './story'

function getStoryHost(): string {
if (process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL) {
return new URL(process.env.DEPLOY_PRIME_URL).host.replace('-docs', '-story')
}
return 'story.sefirot.globalbrains.com'
}

export default defineConfig({
lang: 'en-US',
title: 'Sefirot',
Expand All @@ -19,10 +12,12 @@ export default defineConfig({

vite: {
...baseConfig,
plugins: [
...baseConfig.plugins!,
storyPlugin()
]
plugins: [...(baseConfig.plugins || []), storyPlugin()],
optimizeDeps: {
entries: ['../lib/**/*'],
include: ['lodash-es', 'markdown-it > argparse', 'markdown-it > entities'],
exclude: ['markdown-it']
}
},

themeConfig: {
Expand All @@ -31,7 +26,7 @@ export default defineConfig({
},

nav: [
{ text: 'Playground', link: `https://${getStoryHost()}` }
{ text: 'Playground', link: '/stories/action-list-01-playground' }
],

outline: [2, 3],
Expand Down
3 changes: 2 additions & 1 deletion docs/.vitepress/theme/components/Board.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import SButton from 'sefirot/components/SButton.vue'
import 'sefirot/styles/bootstrap.css'
defineProps<{
title: string
Expand All @@ -8,7 +9,7 @@ defineProps<{
</script>

<template>
<div class="Board">
<div class="Board vp-raw">
<div class="b-root">
<div class="b-menu">
<div class="b-title">{{ title }}</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/Showcase.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defineProps<{
<div class="Showcase">
<div class="header">
<p class="path">@globalbrain/sefirot/lib{{ path }}</p>
<a v-if="story" class="button" :href="`/stories/${story}`" target="_blank">
<a v-if="story" class="button" :href="`/stories/${story}`">
<SButton size="mini" mode="mute" label="View in Playground" tag="span" />
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/action-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const list: ActionList = [

<Showcase
path="/components/SActionList.vue"
story="/stories-components-sactionlist-01-playground-story-vue"
story="action-list-01-playground"
>
<SActionList :list="list" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/alert.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SAlert from 'sefirot/components/SAlert.vue'

<Showcase
path="/components/SAlert.vue"
story="/stories-components-salert-01-playground-story-vue"
story="alert-01-playground"
>
<SAlert mode="info">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et <a href="#">dolore magna</a> aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/avatar-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The `SAvatarStack` component is used to display a stack of avatars. It is useful

<Showcase
path="/components/SAvatarStack.vue"
story="/stories-components-savatarstack-01-playground-story-vue"
story="avatar-stack-01-playground"
>
<div class="flex flex-wrap gap-16">
<SAvatarStack :avatars="avatars" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SAvatar from 'sefirot/components/SAvatar.vue'

<Showcase
path="/components/SAvatar.vue"
story="/stories-components-savatar-01-playground-story-vue"
story="avatar-01-playground"
>
<div class="flex flex-wrap gap-16">
<SAvatar avatar="https://github.com/kiaking.png" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/button-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SButtonGroup from 'sefirot/components/SButtonGroup.vue'

<Showcase
path="/components/SButtonGroup.vue"
story="/stories-components-sbuttongroup-01-playground-story-vue"
story="button-group-01-playground"
>
<SButtonGroup>
<SButton mode="mute" label="Left" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const modes = ['default', 'neutral', 'info', 'success', 'warning', 'danger'] as

<Showcase
path="/components/SButton.vue"
story="/stories-components-sbutton-01-playground-story-vue"
story="button-01-playground"
>
<div class="flex flex-wrap gap-12">
<SButton v-for="m in modes" :key="m" :mode="m" label="Button" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import SControlText from 'sefirot/components/SControlText.vue'

<Showcase
path="/components/SCard.vue"
story="/stories-components-scard-01-playground-story-vue"
story="card-01-playground"
>
<div class="flex flex-wrap gap-12">
<SCard>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SContent from 'sefirot/components/SContent.vue'

<Showcase
path="/components/SContent.vue"
story="/stories-components-scontent-01-playground-story-vue"
story="content-01-playground"
>
<SContent>
<h2>Title of the section</h2>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/desc.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import SDescText from 'sefirot/components/SDescText.vue'

<Showcase
path="/components/SDesc.vue"
story="/stories-components-sdesc-01-playground-story-vue"
story="desc-01-playground"
>
<div>
<SDesc cols="2" gap="24">
Expand Down
2 changes: 1 addition & 1 deletion docs/components/divider.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SDivider from 'sefirot/components/SDivider.vue'

<Showcase
path="/components/SDivider.vue"
story="/stories-components-sdivider-01-playground-story-vue"
story="divider-01-playground"
>
<SDivider />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SGridItem from 'sefirot/components/SGridItem.vue'

<Showcase
path="/components/SGrid.vue"
story="/stories-components-sgrid-01-playground-story-vue"
story="grid-01-playground"
>
<SGrid cols="4" gap="24">
<SGridItem>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/head.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SHeadTitle from 'sefirot/components/SHeadTitle.vue'

<Showcase
path="/components/SHead.vue"
story="/stories-components-shead-01-playground-story-vue"
story="head-01-playground"
>
<SHead>
<SHeadTitle>The head title</SHeadTitle>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/indicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const states = ['pending', 'ready', 'queued', 'running', 'completed', 'failed']

<Showcase
path="/components/SIndicator.vue"
story="/stories-components-sindicator-01-playground-story-vue"
story="indicator-01-playground"
>
<div class="flex flex-wrap gap-16">
<SIndicator v-for="s in states" :key="s" size="mini" :state="s" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-addon.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const input = ref<string | null>(null)

<Showcase
path="/components/SInputText.vue"
story="/stories-components-sinputtext-02-addons-story-vue"
story="input-text-02-addons"
>
<SInputText placeholder="johndoe" v-model="input">
<template #addon-before>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const input = ref(false)

<Showcase
path="/components/SInputCheckbox.vue"
story="/stories-components-sinputcheckbox-01-playground-story-vue"
story="input-checkbox-01-playground"
>
<SInputCheckbox text="Item 001" v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-checkboxes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const options = [

<Showcase
path="/components/SInputCheckboxes.vue"
story="/stories-components-sinputcheckboxes-01-playground-story-vue"
story="input-checkboxes-01-playground"
>
<SInputCheckboxes :options="options" v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-file-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const input = ref([])

<Showcase
path="/components/SInputFileUpload.vue"
story="/stories-components-sinputfileupload-01-playground-story-vue"
story="input-file-upload-01-playground"
>
<SInputFileUpload v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const input = ref(null)

<Showcase
path="/components/SInputFile.vue"
story="/stories-components-sinputfile-01-playground-story-vue"
story="input-file-01-playground"
>
<SInputFile placeholder="No file choosen" v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-hms.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const input = ref({

<Showcase
path="/components/SSInputHMS.vue"
story="/stories-components-sinputhms-01-playground-story-vue"
story="input-hms-01-playground"
>
<SInputHMS v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const input = shallowRef(null)

<Showcase
path="/components/SInputImage.vue"
story="/stories-components-sinputimage-01-playground-story-vue"
story="input-image-01-playground"
>
<SInputImage help="JPG or PNG. 500KB max." v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const input = ref<number | null>(null)

<Showcase
path="/components/SInputNumber.vue"
story="/stories-components-sinputnumber-01-playground-story-vue"
story="input-number-01-playground"
>
<SInputNumber placeholder="123,456,789" v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-radios.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const options = [

<Showcase
path="/components/SInputRadios.vue"
story="/stories-components-sinputradios-01-playground-story-vue"
story="input-radios-01-playground"
>
<SInputRadios :options="options" v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-segments.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const value = ref('table')

<Showcase
path="/components/SInputSegments.vue"
story="/stories-components-sinputsegments-01-playground-story-vue"
story="input-segments-01-playground"
>
<SInputSegments :options="options" v-model="value" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-select.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const options = [

<Showcase
path="/components/SSInputSelect.vue"
story="/stories-components-sinputselect-01-playground-story-vue"
story="input-select-01-playground"
>
<SInputSelect :options="options" nullable v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const input = ref(false)

<Showcase
path="/components/SInputSwitch.vue"
story="/stories-components-sinputselect-01-playground-story-vue"
story="input-select-01-playground"
>
<SInputSwitch v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-textarea.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const input = ref<string | null>(null)

<Showcase
path="/components/SInputTextarea.vue"
story="/stories-components-sinputtextarea-01-playground-story-vue"
story="input-textarea-01-playground"
>
<SInputTextarea placeholder="Placeholder text" v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/input-ymd.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const input = ref({

<Showcase
path="/components/SInputYMD.vue"
story="/stories-components-sinputymd-01-playground-story-vue"
story="input-ymd-01-playground"
>
<SInputYMD v-model="input" />
</Showcase>
Expand Down
2 changes: 1 addition & 1 deletion docs/components/pill.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const modes = ['default', 'mute', 'neutral', 'info', 'success', 'warning', 'dang

<Showcase
path="/components/SPill.vue"
story="/stories-components-spill-01-playground-story-vue"
story="pill-01-playground"
>
<div class="flex flex-wrap gap-12">
<SPill v-for="m in modes" :key="m" :mode="m" label="Pill" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const modes = ['default', 'neutral', 'info', 'success', 'warning', 'danger'] as

<Showcase
path="/components/SState.vue"
story="/stories-components-sstate-01-playground-story-vue"
story="state-01-playground"
>
<div class="flex flex-wrap gap-12">
<SState v-for="m in modes" :key="m" :mode="m" label="State" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/table.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const options = useTable({

<Showcase
path="/components/STable.vue"
story="/stories-components-stable-01-playground-story-vue"
story="table-01-playground"
>
<ClientOnly>
<STable class="table" :options="options" />
Expand Down
2 changes: 1 addition & 1 deletion docs/components/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import STooltip from 'sefirot/components/STooltip.vue'

<Showcase
path="/components/STooltip.vue"
story="/stories-components-stooltip-01-playground-story-vue"
story="tooltip-01-playground"
>
<STooltip text="This is a tooltip message.">
Hover this text.
Expand Down
2 changes: 1 addition & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import { postcssIsolateStyles } from 'vitepress'
export default {
plugins: [
postcssNested(),
postcssIsolateStyles({ includeFiles: [/vp-doc\.css/] })
postcssIsolateStyles({ includeFiles: [/(?:base|vp-doc)\.css/] })
]
}

0 comments on commit 9be10a3

Please sign in to comment.