-
Notifications
You must be signed in to change notification settings - Fork 12
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
15 changed files
with
364 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script setup lang="ts"> | ||
import SDivider from 'sefirot/components/SDivider.vue' | ||
</script> | ||
|
||
# SDivider <Badge text="3.11.0" /> | ||
|
||
`<SDivider>` is a component to display a horizontal line. | ||
|
||
<Showcase | ||
path="/components/SDivider.vue" | ||
story="/stories-components-sdivider-01-playground-story-vue" | ||
> | ||
<SDivider /> | ||
</Showcase> | ||
## Import | ||
|
||
```ts | ||
import SDivider from '@globalbrain/sefirot/lib/components/SDivider.vue' | ||
``` | ||
|
||
## Usage | ||
|
||
Place `<SDivider>` anywhere you want to display a horizontal line. | ||
|
||
```vue-html | ||
<SDivider /> | ||
``` |
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,90 @@ | ||
# SDoc <Badge text="3.11.0" /> | ||
|
||
`<SDoc>` is a component to display a doc style contents. It controls the nested element styles and spacing to have a consistent look and feel. | ||
|
||
## Import | ||
|
||
```ts | ||
import SDoc from '@globalbrain/sefirot/lib/components/SDoc.vue' | ||
import SDocSection from '@globalbrain/sefirot/lib/components/SDocSection.vue' | ||
``` | ||
|
||
## Usage | ||
|
||
Nest the elements inside `<SDoc>` component and it will apply basic styles to the element, including spacing between elements. | ||
|
||
Most of the time, you should be using [`<SContent>`](content) to build title and description section, [`<SDivider>`](divider) to display section divider, and the use [`<SGrid>`](grid) to show form elements. | ||
|
||
```vue-html | ||
<SDoc> | ||
<SContent> | ||
<h1>Title of the content</h1> | ||
<p>Lorem ipsum...</p> | ||
</SContent> | ||
<SDivider /> | ||
<SContent> | ||
<h2>Section title</h2> | ||
<p>Lorem ipsum...</p> | ||
</SContent> | ||
<SGrid gap="24"> | ||
<SGridItem> | ||
<SInputText | ||
label="Name" | ||
placeholder="John Doe" | ||
:model-value="null" | ||
/> | ||
</SGridItem> | ||
<SGridItem> | ||
<SInputText | ||
type="email" | ||
label="Email" | ||
placeholder="john.doe@example.com" | ||
:model-value="null" | ||
/> | ||
</SGridItem> | ||
</SGrid> | ||
</SDoc> | ||
``` | ||
|
||
You may use `<SDocSection>` to organize the content into sections. There is no difference in terms of stylings, but it helps organize your code when the content is large. It also helps code editor to collapse the section. You could add class name to the section to make it readable too. | ||
|
||
```vue-html | ||
<SDoc> | ||
<SDocSection class="header"> | ||
<SContent> | ||
<h1>Title of the content</h1> | ||
<p>Lorem ipsum...</p> | ||
</SContent> | ||
</SDocSection> | ||
<SDivider /> | ||
<SDocSection class="account-info"> | ||
<SContent> | ||
<h2>Section title</h2> | ||
<p>Lorem ipsum...</p> | ||
</SContent> | ||
<SGrid gap="24"> | ||
<SGridItem> | ||
<SInputText | ||
label="Name" | ||
placeholder="John Doe" | ||
:model-value="null" | ||
/> | ||
</SGridItem> | ||
<SGridItem> | ||
<SInputText | ||
type="email" | ||
label="Email" | ||
placeholder="john.doe@example.com" | ||
:model-value="null" | ||
/> | ||
</SGridItem> | ||
</SGrid> | ||
</SDocSection> | ||
</SDoc> | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<div class="SDivider"> | ||
<div class="line" /> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="postcss"> | ||
.SDivider { | ||
padding: var(--divider-padding); | ||
} | ||
.line { | ||
height: 1px; | ||
background-color: var(--c-divider); | ||
} | ||
</style> |
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,17 @@ | ||
<template> | ||
<div class="SDoc"> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="postcss"> | ||
.SDoc { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
} | ||
.SDoc { | ||
--divider-padding: 24px 0; | ||
} | ||
</style> |
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,13 @@ | ||
<template> | ||
<div class="SDocSection"> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="postcss"> | ||
.SDocSection { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
} | ||
</style> |
Oops, something went wrong.