Skip to content

Commit cd53110

Browse files
committed
fix!: move SocialButton to addons, update docs for addons
1 parent b5325bf commit cd53110

File tree

31 files changed

+228
-47
lines changed

31 files changed

+228
-47
lines changed

.vitepress/components/PropsTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const inheritProps = computed(() => {
5151
class="pt-4"
5252
>
5353
<CollapsibleTrigger class="font-medium">
54-
Inherit from Reka UI
54+
Props inherited from Reka UI
5555
<template #right>
5656
<CollapsibleIndicator />
5757
</template>

.vitepress/config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ export default defineConfig({
1111
cleanUrls: true,
1212
vite: {
1313
plugins: [
14-
// @ts-ignore
14+
// @ts-expect-error this seems a type bug of vite
1515
tailwindcss(),
1616
],
1717
resolve: {
1818
alias: {
1919
'~': resolve(__dirname, '..'),
2020
'#components': resolve(__dirname, '../src/components'),
21+
'#addons': resolve(__dirname, '../src/addons'),
2122
},
2223
},
2324
},
@@ -91,6 +92,7 @@ export default defineConfig({
9192
items: [
9293
{ text: 'Turnstile', link: '/addons/turnstile' },
9394
{ text: 'Iconify', link: '/addons/iconify' },
95+
{ text: 'SocialButton', link: '/addons/social-button' },
9496
],
9597
},
9698
],

.vitepress/plugins/example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function markdownExampleTagBlock(md: MarkdownRenderer) {
5757
const source = fs.readFileSync(srcPath, { encoding: 'utf-8' })
5858
const srcToken = new state.Token('fence', 'code', 0)
5959
srcToken.info = 'vue'
60-
srcToken.content = source.replace(/#components/g, '@typlog/ui').trim()
60+
srcToken.content = source.replace(/#components/g, '@typlog/ui').replace(/#addons/g, '@typlog/ui/addons').trim()
6161
const endToken = new state.Token('html_inline', '', 0)
6262
endToken.content = '</template>\n</Example>'
6363
state.tokens.splice(index + 1, 0, srcToken, endToken)

docs/content/addons/iconify.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: IconifyCollection
3+
description: A collection of icons, powered by iconify.
4+
status: alpha
5+
source: https://github.com/typlog/ui/tree/main/src/addons/iconset
6+
---
7+
8+
<Example name="iconify/Overview.vue" variant="full" />
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: SocialButton
3+
description: A button component styled specially for social logins.
4+
status: alpha
5+
source: https://github.com/typlog/ui/tree/main/src/addons/button/SocialButton.vue
6+
---
7+
8+
<Example name="social-button/Overview.vue" variant="full" />
9+
10+
## API Reference
11+
12+
<PropsTable name="SocialButton" />
13+
14+
## Examples
15+
16+
### Brand
17+
18+
<Example name="social-button/Brand.vue" />
19+
20+
### Size
21+
22+
<Example name="social-button/Size.vue" />
23+
24+
### Variant
25+
26+
<Example name="social-button/Variant.vue" />
27+
28+
### Radius
29+
30+
<Example name="social-button/Radius.vue" />

docs/content/addons/turnstile.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Turnstile
3+
description: A Turnstile widget confirms web visitors are real and blocks unwanted bots.
4+
status: alpha
5+
source: https://github.com/typlog/ui/tree/main/src/addons/turnstile
6+
---
7+
8+
<Example name="turnstile/Overview.vue" variant="full" />

docs/examples/iconify/Overview.vue

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<script setup lang="ts">
2+
import {
3+
Icon,
4+
Button,
5+
DialogRoot,
6+
DialogTrigger,
7+
DialogTitle,
8+
DialogClose,
9+
DialogPopup,
10+
} from '#components'
11+
import { IconifyCollection } from '#addons'
12+
13+
const onSelectIcon = (icon: string) => {
14+
console.info('select:', icon)
15+
}
16+
</script>
17+
18+
<template>
19+
<DialogRoot>
20+
<Button :as="DialogTrigger">Choose an icon</Button>
21+
<DialogPopup size="5" class="h-(--dialog-popup-max-height)">
22+
<div class="py-2 px-4 w-full flex items-center justify-between bg-gray-2 border-b sticky top-0">
23+
<DialogTitle>Choose an icon from iconify</DialogTitle>
24+
<Button variant="ghost" color="gray" :as="DialogClose">
25+
<Icon icon="lucide:x" />
26+
</Button>
27+
</div>
28+
<div class="p-4">
29+
<IconifyCollection @select="onSelectIcon" />
30+
</div>
31+
</DialogPopup>
32+
</DialogRoot>
33+
</template>

docs/examples/radio-group/Overview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const selected = ref<string>('1')
77

88
<template>
99
<div class="flex">
10-
<RadioGroupRoot class="flex flex-col gap-2" v-model="selected">
10+
<RadioGroupRoot v-model="selected" class="flex flex-col gap-2">
1111
<RadioGroupItem value="1">
1212
Default layout
1313
</RadioGroupItem>

docs/examples/radio/Size.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const checked = ref(true)
77

88
<template>
99
<div class="flex items-center gap-2">
10-
<Radio size="1" v-model="checked" />
11-
<Radio size="2" v-model="checked" />
12-
<Radio size="3" v-model="checked" />
10+
<Radio v-model="checked" size="1" />
11+
<Radio v-model="checked" size="2" />
12+
<Radio v-model="checked" size="3" />
1313
</div>
1414
</template>

docs/examples/select/Overview.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
</script>
1212

1313
<template>
14-
<SelectRoot defaultValue="apple">
14+
<SelectRoot default-value="apple">
1515
<SelectTrigger />
1616
<SelectContent>
1717
<SelectGroup>

0 commit comments

Comments
 (0)