-
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
1 parent
88090d3
commit dcdb948
Showing
2 changed files
with
76 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script lang="ts"> | ||
import { LightBulb16 } from "svelte-octicons"; | ||
import Flex from "./Flex.svelte"; | ||
</script> | ||
|
||
<aside class="tip"> | ||
<div class="icon"><slot name="icon"><LightBulb16 /></slot></div> | ||
<Flex direction="column" justify="center"> | ||
<slot /> | ||
</Flex> | ||
</aside> | ||
|
||
<style> | ||
.tip { | ||
display: flex; | ||
gap: 1rem; | ||
padding: 1rem; | ||
border-radius: 1rem; | ||
color: var(--color, var(--gray-5, #233944)); | ||
fill: var(--fill, var(--gray-4, #5c717c)); | ||
background-color: var(--background-color, var(--gray-1, #f5f6f7)); | ||
border: 1px solid var(--border-color, var(--gray-3, #99a8b3)); | ||
} | ||
.icon { | ||
display: flex; | ||
align-items: center; | ||
} | ||
</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,48 @@ | ||
<script context="module" lang="ts"> | ||
import { Story } from "@storybook/addon-svelte-csf"; | ||
import Tip from "../Tip.svelte"; | ||
import Pin from "@/common/icons/Pin.svelte"; | ||
import Premium from "@/common/icons/Premium.svelte"; | ||
import { Info16 } from "svelte-octicons"; | ||
export const meta = { | ||
title: "Components / Common / Tip", | ||
component: Tip, | ||
tags: ["autodocs"], | ||
parameters: { layout: "centered" }, | ||
}; | ||
</script> | ||
|
||
<Story name="Basic"> | ||
<Tip>All dogs go to heaven</Tip> | ||
</Story> | ||
|
||
<Story name="With Icon"> | ||
<Tip> | ||
<Pin slot="icon" /> | ||
Pinned items will appear here. | ||
</Tip> | ||
</Story> | ||
|
||
<Story name="With Colors"> | ||
<Tip | ||
--fill="var(--green-dark)" | ||
--background-color="var(--green-light)" | ||
--border-color="var(--green)" | ||
> | ||
<Premium slot="icon" /> | ||
This feature is for premium users. | ||
</Tip> | ||
</Story> | ||
|
||
<Story name="With Large Icon"> | ||
<Tip | ||
--color="var(--blue-5)" | ||
--fill="var(--blue-4)" | ||
--background-color="var(--blue-1)" | ||
--border-color="var(--blue-3)" | ||
> | ||
<Info16 height="32" width="32" slot="icon" /> | ||
Learn about all the interesting facts | ||
</Tip> | ||
</Story> |