@polymarbot/nuxt-layer-shadcn-ui 0.1.9 → 0.2.0-w
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/assets/styles/colors.css +10 -10
- package/app/assets/styles/globals.css +1 -0
- package/app/assets/styles/z-index.css +27 -0
- package/app/components/ui/Accordion/index.stories.ts +60 -56
- package/app/components/ui/Accordion/index.vue +1 -1
- package/app/components/ui/AdminLayout/SidebarMenus.vue +0 -2
- package/app/components/ui/AdminLayout/index.stories.ts +9 -8
- package/app/components/ui/Alert/index.stories.ts +28 -26
- package/app/components/ui/Alert/index.vue +6 -6
- package/app/components/ui/Alert/types.ts +2 -1
- package/app/components/ui/AlertDialog/index.stories.ts +85 -50
- package/app/components/ui/AsyncDataTable/index.stories.ts +53 -36
- package/app/components/ui/Avatar/index.stories.ts +56 -51
- package/app/components/ui/Avatar/index.vue +1 -1
- package/app/components/ui/Avatar/types.ts +5 -2
- package/app/components/ui/Badge/index.stories.ts +41 -41
- package/app/components/ui/Badge/index.vue +1 -1
- package/app/components/ui/Badge/types.ts +3 -1
- package/app/components/ui/Breadcrumb/index.stories.ts +48 -37
- package/app/components/ui/Breadcrumb/index.vue +1 -1
- package/app/components/ui/Button/index.stories.ts +94 -90
- package/app/components/ui/Button/index.vue +1 -1
- package/app/components/ui/Button/types.ts +4 -1
- package/app/components/ui/ButtonGroup/index.stories.ts +61 -49
- package/app/components/ui/Card/index.stories.ts +55 -47
- package/app/components/ui/Card/index.vue +1 -1
- package/app/components/ui/Checkbox/index.stories.ts +69 -46
- package/app/components/ui/Checkbox/index.vue +1 -1
- package/app/components/ui/CopyButton/index.stories.ts +89 -31
- package/app/components/ui/DataTable/index.stories.ts +218 -168
- package/app/components/ui/DataTable/index.vue +1 -1
- package/app/components/ui/DatePicker/index.stories.ts +131 -37
- package/app/components/ui/DateRangePicker/index.stories.ts +107 -33
- package/app/components/ui/Divider/index.stories.ts +46 -24
- package/app/components/ui/Divider/index.vue +1 -1
- package/app/components/ui/Drawer/index.stories.ts +131 -81
- package/app/components/ui/Drawer/index.vue +1 -7
- package/app/components/ui/Drawer/types.ts +1 -1
- package/app/components/ui/Dropdown/index.stories.ts +134 -89
- package/app/components/ui/Dropdown/index.vue +5 -1
- package/app/components/ui/Dropdown/types.ts +1 -1
- package/app/components/ui/FormItem/index.stories.ts +87 -43
- package/app/components/ui/FormItem/index.vue +1 -1
- package/app/components/ui/Help/index.stories.ts +46 -35
- package/app/components/ui/Icon/index.stories.ts +41 -43
- package/app/components/ui/Input/index.stories.ts +95 -41
- package/app/components/ui/Input/index.vue +1 -1
- package/app/components/ui/InputCurrency/index.stories.ts +89 -49
- package/app/components/ui/InputNumber/index.stories.ts +93 -29
- package/app/components/ui/InputNumber/index.vue +1 -1
- package/app/components/ui/InputOtp/index.stories.ts +6 -7
- package/app/components/ui/InputOtp/index.vue +1 -1
- package/app/components/ui/InputPercent/index.stories.ts +6 -7
- package/app/components/ui/InputRange/index.stories.ts +6 -7
- package/app/components/ui/Loading/index.stories.ts +19 -19
- package/app/components/ui/Markdown/index.stories.ts +7 -10
- package/app/components/ui/Modal/index.stories.ts +135 -80
- package/app/components/ui/Modal/index.vue +1 -6
- package/app/components/ui/Modal/types.ts +1 -1
- package/app/components/ui/ModalContent/index.stories.ts +54 -26
- package/app/components/ui/ModalContent/index.vue +2 -2
- package/app/components/ui/PageCard/index.stories.ts +177 -67
- package/app/components/ui/Pagination/index.stories.ts +68 -51
- package/app/components/ui/Pagination/index.vue +2 -2
- package/app/components/ui/Popover/index.stories.ts +47 -45
- package/app/components/ui/Popover/index.vue +1 -1
- package/app/components/ui/Qrcode/index.stories.ts +42 -34
- package/app/components/ui/RadioCardGroup/index.stories.ts +23 -32
- package/app/components/ui/RadioCardGroup/index.vue +1 -1
- package/app/components/ui/RadioGroup/index.stories.ts +123 -0
- package/app/components/ui/RadioGroup/index.vue +73 -0
- package/app/components/ui/RadioGroup/types.ts +13 -0
- package/app/components/ui/ScrollArea/index.stories.ts +69 -37
- package/app/components/ui/ScrollArea/index.vue +1 -1
- package/app/components/ui/SearchSelect/index.stories.ts +104 -66
- package/app/components/ui/Select/index.stories.ts +152 -98
- package/app/components/ui/Select/index.vue +3 -3
- package/app/components/ui/Skeleton/index.stories.ts +27 -30
- package/app/components/ui/Skeleton/index.vue +1 -1
- package/app/components/ui/Slider/index.stories.ts +73 -31
- package/app/components/ui/Slider/index.vue +1 -1
- package/app/components/ui/Surface/index.stories.ts +47 -21
- package/app/components/ui/Surface/index.vue +39 -28
- package/app/components/ui/Surface/types.ts +2 -2
- package/app/components/ui/Switch/index.stories.ts +6 -7
- package/app/components/ui/Switch/index.vue +1 -1
- package/app/components/ui/Tabs/index.stories.ts +103 -61
- package/app/components/ui/Tabs/index.vue +1 -1
- package/app/components/ui/Tag/index.stories.ts +42 -25
- package/app/components/ui/Tag/index.vue +39 -28
- package/app/components/ui/Tag/types.ts +2 -2
- package/app/components/ui/Textarea/index.stories.ts +73 -9
- package/app/components/ui/Textarea/index.vue +1 -1
- package/app/components/ui/Toast/index.stories.ts +71 -18
- package/app/components/ui/Toast/index.vue +1 -1
- package/app/components/ui/Tooltip/index.stories.ts +45 -38
- package/app/components/ui/Tooltip/index.vue +1 -1
- package/app/components/ui/WebLink/index.stories.ts +76 -41
- package/app/components/ui/WebLink/index.vue +1 -1
- package/package.json +2 -2
- package/app/components/ui/Radio/index.stories.ts +0 -71
- package/app/components/ui/Radio/index.vue +0 -10
- package/app/components/ui/Radio/types.ts +0 -3
|
@@ -5,30 +5,94 @@ const meta = {
|
|
|
5
5
|
title: 'UI/Textarea',
|
|
6
6
|
component: Textarea,
|
|
7
7
|
argTypes: {
|
|
8
|
+
modelValue: { control: 'text' },
|
|
9
|
+
autocomplete: { control: 'text' },
|
|
10
|
+
rows: { control: 'number' },
|
|
11
|
+
invalid: { control: 'boolean' },
|
|
12
|
+
class: { control: 'text' },
|
|
8
13
|
disabled: { control: 'boolean' },
|
|
9
14
|
readonly: { control: 'boolean' },
|
|
10
|
-
invalid: { control: 'boolean' },
|
|
11
15
|
},
|
|
12
16
|
args: {
|
|
17
|
+
modelValue: '',
|
|
18
|
+
autocomplete: '',
|
|
19
|
+
rows: undefined,
|
|
20
|
+
invalid: false,
|
|
21
|
+
class: '',
|
|
13
22
|
disabled: false,
|
|
14
23
|
readonly: false,
|
|
15
|
-
invalid: false,
|
|
16
24
|
},
|
|
25
|
+
render: args => ({
|
|
26
|
+
components: { Textarea },
|
|
27
|
+
setup: () => ({ args }),
|
|
28
|
+
template: `
|
|
29
|
+
<div class="max-w-sm">
|
|
30
|
+
<Textarea v-bind="args" placeholder="Type your message here..." />
|
|
31
|
+
</div>
|
|
32
|
+
`,
|
|
33
|
+
}),
|
|
17
34
|
} satisfies Meta
|
|
18
35
|
|
|
19
36
|
export default meta
|
|
20
37
|
type Story = StoryObj<typeof meta>
|
|
21
38
|
|
|
22
|
-
export const Default: Story = {
|
|
23
|
-
|
|
39
|
+
export const Default: Story = {}
|
|
40
|
+
|
|
41
|
+
export const Controlled: Story = {
|
|
42
|
+
render: () => ({
|
|
43
|
+
components: { Textarea },
|
|
44
|
+
setup () {
|
|
45
|
+
const value = ref('')
|
|
46
|
+
return { value }
|
|
47
|
+
},
|
|
48
|
+
template: `
|
|
49
|
+
<div class="max-w-sm space-y-2">
|
|
50
|
+
<Textarea v-model="value" placeholder="Type your message here..." />
|
|
51
|
+
<div class="text-sm text-muted-foreground">Value: {{ value }}</div>
|
|
52
|
+
</div>
|
|
53
|
+
`,
|
|
54
|
+
}),
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const WithRows: Story = {
|
|
58
|
+
render: () => ({
|
|
59
|
+
components: { Textarea },
|
|
60
|
+
template: `
|
|
61
|
+
<div class="max-w-sm">
|
|
62
|
+
<Textarea :rows="6" placeholder="6 rows of height" />
|
|
63
|
+
</div>
|
|
64
|
+
`,
|
|
65
|
+
}),
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export const Invalid: Story = {
|
|
69
|
+
render: () => ({
|
|
70
|
+
components: { Textarea },
|
|
71
|
+
template: `
|
|
72
|
+
<div class="max-w-sm">
|
|
73
|
+
<Textarea invalid model-value="Invalid content" />
|
|
74
|
+
</div>
|
|
75
|
+
`,
|
|
76
|
+
}),
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const Disabled: Story = {
|
|
80
|
+
render: () => ({
|
|
81
|
+
components: { Textarea },
|
|
82
|
+
template: `
|
|
83
|
+
<div class="max-w-sm">
|
|
84
|
+
<Textarea disabled model-value="Disabled textarea" />
|
|
85
|
+
</div>
|
|
86
|
+
`,
|
|
87
|
+
}),
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const Readonly: Story = {
|
|
91
|
+
render: () => ({
|
|
24
92
|
components: { Textarea },
|
|
25
|
-
setup: () => ({ args }),
|
|
26
93
|
template: `
|
|
27
94
|
<div class="max-w-sm">
|
|
28
|
-
<
|
|
29
|
-
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
30
|
-
<Textarea v-bind="args" placeholder="Type your message here..." />
|
|
31
|
-
</section>
|
|
95
|
+
<Textarea readonly model-value="Readonly content" />
|
|
32
96
|
</div>
|
|
33
97
|
`,
|
|
34
98
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Textarea as ShadcnTextarea } from '
|
|
2
|
+
import { Textarea as ShadcnTextarea } from '../../shadcn/textarea'
|
|
3
3
|
import type { TextareaProps } from './types'
|
|
4
4
|
|
|
5
5
|
defineOptions({ inheritAttrs: false })
|
|
@@ -3,15 +3,38 @@ import { toast } from 'vue-sonner'
|
|
|
3
3
|
import Button from '../Button/index.vue'
|
|
4
4
|
import Toast from './index.vue'
|
|
5
5
|
|
|
6
|
+
const positions = [ 'top-left', 'top-right', 'bottom-left', 'bottom-right', 'top-center', 'bottom-center' ] as const
|
|
7
|
+
|
|
6
8
|
const meta = {
|
|
7
9
|
title: 'UI/Toast',
|
|
8
10
|
component: Toast,
|
|
11
|
+
argTypes: {
|
|
12
|
+
position: { control: 'select', options: positions },
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
position: 'bottom-right',
|
|
16
|
+
},
|
|
17
|
+
render: args => ({
|
|
18
|
+
components: { Toast, Button },
|
|
19
|
+
setup () {
|
|
20
|
+
const show = () => toast('This is a toast')
|
|
21
|
+
return { args, show }
|
|
22
|
+
},
|
|
23
|
+
template: `
|
|
24
|
+
<div class="space-y-4">
|
|
25
|
+
<Toast v-bind="args" />
|
|
26
|
+
<Button variant="outline" @click="show">Show Toast</Button>
|
|
27
|
+
</div>
|
|
28
|
+
`,
|
|
29
|
+
}),
|
|
9
30
|
} satisfies Meta<typeof Toast>
|
|
10
31
|
|
|
11
32
|
export default meta
|
|
12
33
|
type Story = StoryObj<typeof meta>
|
|
13
34
|
|
|
14
|
-
export const Default: Story = {
|
|
35
|
+
export const Default: Story = {}
|
|
36
|
+
|
|
37
|
+
export const Types: Story = {
|
|
15
38
|
render: () => ({
|
|
16
39
|
components: { Toast, Button },
|
|
17
40
|
setup () {
|
|
@@ -20,28 +43,58 @@ export const Default: Story = {
|
|
|
20
43
|
const showError = () => toast.error('Something went wrong')
|
|
21
44
|
const showInfo = () => toast.info('Here is some information')
|
|
22
45
|
const showWarning = () => toast.warning('Please be careful')
|
|
23
|
-
|
|
24
|
-
return { showDefault, showSuccess, showError, showInfo, showWarning, showWithDescription }
|
|
46
|
+
return { showDefault, showSuccess, showError, showInfo, showWarning }
|
|
25
47
|
},
|
|
26
48
|
template: `
|
|
27
|
-
<div
|
|
49
|
+
<div>
|
|
28
50
|
<Toast position="bottom-right" />
|
|
51
|
+
<div class="flex flex-wrap gap-3">
|
|
52
|
+
<Button variant="outline" @click="showDefault">Default</Button>
|
|
53
|
+
<Button variant="outline" @click="showSuccess">Success</Button>
|
|
54
|
+
<Button variant="outline" @click="showError">Error</Button>
|
|
55
|
+
<Button variant="outline" @click="showInfo">Info</Button>
|
|
56
|
+
<Button variant="outline" @click="showWarning">Warning</Button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
`,
|
|
60
|
+
}),
|
|
61
|
+
}
|
|
29
62
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
63
|
+
export const WithDescription: Story = {
|
|
64
|
+
render: () => ({
|
|
65
|
+
components: { Toast, Button },
|
|
66
|
+
setup () {
|
|
67
|
+
const show = () => toast('Event created', {
|
|
68
|
+
description: 'Your event has been scheduled for tomorrow at 3:00 PM.',
|
|
69
|
+
})
|
|
70
|
+
return { show }
|
|
71
|
+
},
|
|
72
|
+
template: `
|
|
73
|
+
<div>
|
|
74
|
+
<Toast position="bottom-right" />
|
|
75
|
+
<Button variant="outline" @click="show">Show Toast with Description</Button>
|
|
76
|
+
</div>
|
|
77
|
+
`,
|
|
78
|
+
}),
|
|
79
|
+
}
|
|
40
80
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
81
|
+
export const Positions: Story = {
|
|
82
|
+
render: () => ({
|
|
83
|
+
components: { Toast, Button },
|
|
84
|
+
setup () {
|
|
85
|
+
const current = ref<typeof positions[number]>('bottom-right')
|
|
86
|
+
const show = (pos: typeof positions[number]) => {
|
|
87
|
+
current.value = pos
|
|
88
|
+
nextTick(() => toast(`Toast at ${pos}`))
|
|
89
|
+
}
|
|
90
|
+
return { positions, current, show }
|
|
91
|
+
},
|
|
92
|
+
template: `
|
|
93
|
+
<div>
|
|
94
|
+
<Toast :position="current" />
|
|
95
|
+
<div class="flex flex-wrap gap-3">
|
|
96
|
+
<Button v-for="p in positions" :key="p" variant="outline" @click="show(p)">{{ p }}</Button>
|
|
97
|
+
</div>
|
|
45
98
|
</div>
|
|
46
99
|
`,
|
|
47
100
|
}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Toaster as ShadcnSonner } from '
|
|
2
|
+
import { Toaster as ShadcnSonner } from '../../shadcn/sonner'
|
|
3
3
|
import 'vue-sonner/style.css'
|
|
4
4
|
import type { ToastProps } from './types'
|
|
5
5
|
|
|
@@ -2,61 +2,68 @@ import type { Meta, StoryObj } from '@storybook/vue3'
|
|
|
2
2
|
import Button from '../Button/index.vue'
|
|
3
3
|
import Tooltip from './index.vue'
|
|
4
4
|
|
|
5
|
+
const positions = [ 'top', 'bottom', 'left', 'right' ] as const
|
|
6
|
+
|
|
5
7
|
const meta = {
|
|
6
8
|
title: 'UI/Tooltip',
|
|
7
9
|
component: Tooltip,
|
|
8
10
|
argTypes: {
|
|
11
|
+
text: { control: 'text' },
|
|
12
|
+
position: { control: 'select', options: positions },
|
|
9
13
|
disabled: { control: 'boolean' },
|
|
14
|
+
disableClosingTrigger: { control: 'boolean' },
|
|
10
15
|
},
|
|
11
16
|
args: {
|
|
17
|
+
text: 'This is a tooltip',
|
|
18
|
+
position: 'top',
|
|
12
19
|
disabled: false,
|
|
20
|
+
disableClosingTrigger: false,
|
|
13
21
|
},
|
|
22
|
+
render: args => ({
|
|
23
|
+
components: { Tooltip, Button },
|
|
24
|
+
setup: () => ({ args }),
|
|
25
|
+
template: `
|
|
26
|
+
<Tooltip v-bind="args">
|
|
27
|
+
<Button variant="outline">Hover me</Button>
|
|
28
|
+
</Tooltip>
|
|
29
|
+
`,
|
|
30
|
+
}),
|
|
14
31
|
} satisfies Meta<typeof Tooltip>
|
|
15
32
|
|
|
16
33
|
export default meta
|
|
17
34
|
type Story = StoryObj<typeof meta>
|
|
18
35
|
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
|
|
36
|
+
export const Default: Story = {}
|
|
37
|
+
|
|
38
|
+
export const Positions: Story = {
|
|
39
|
+
render: () => ({
|
|
21
40
|
components: { Tooltip, Button },
|
|
22
|
-
setup: () => ({ args }),
|
|
23
41
|
template: `
|
|
24
|
-
<div class="
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
<Tooltip text="Top tooltip" position="top">
|
|
38
|
-
<Button variant="outline">Top</Button>
|
|
39
|
-
</Tooltip>
|
|
40
|
-
<Tooltip text="Bottom tooltip" position="bottom">
|
|
41
|
-
<Button variant="outline">Bottom</Button>
|
|
42
|
-
</Tooltip>
|
|
43
|
-
<Tooltip text="Left tooltip" position="left">
|
|
44
|
-
<Button variant="outline">Left</Button>
|
|
45
|
-
</Tooltip>
|
|
46
|
-
<Tooltip text="Right tooltip" position="right">
|
|
47
|
-
<Button variant="outline">Right</Button>
|
|
48
|
-
</Tooltip>
|
|
49
|
-
</div>
|
|
50
|
-
</section>
|
|
51
|
-
|
|
52
|
-
<!-- Long Text -->
|
|
53
|
-
<section>
|
|
54
|
-
<h3 class="mb-4 text-lg font-medium">Long Text</h3>
|
|
55
|
-
<Tooltip text="This is a longer tooltip message that demonstrates how the tooltip handles multi-line content and wraps properly within its container.">
|
|
56
|
-
<Button variant="outline">Long Tooltip</Button>
|
|
57
|
-
</Tooltip>
|
|
58
|
-
</section>
|
|
42
|
+
<div class="flex flex-wrap items-center gap-4 py-10 justify-center">
|
|
43
|
+
<Tooltip text="Top tooltip" position="top">
|
|
44
|
+
<Button variant="outline">Top</Button>
|
|
45
|
+
</Tooltip>
|
|
46
|
+
<Tooltip text="Bottom tooltip" position="bottom">
|
|
47
|
+
<Button variant="outline">Bottom</Button>
|
|
48
|
+
</Tooltip>
|
|
49
|
+
<Tooltip text="Left tooltip" position="left">
|
|
50
|
+
<Button variant="outline">Left</Button>
|
|
51
|
+
</Tooltip>
|
|
52
|
+
<Tooltip text="Right tooltip" position="right">
|
|
53
|
+
<Button variant="outline">Right</Button>
|
|
54
|
+
</Tooltip>
|
|
59
55
|
</div>
|
|
60
56
|
`,
|
|
61
57
|
}),
|
|
62
58
|
}
|
|
59
|
+
|
|
60
|
+
export const LongText: Story = {
|
|
61
|
+
render: () => ({
|
|
62
|
+
components: { Tooltip, Button },
|
|
63
|
+
template: `
|
|
64
|
+
<Tooltip text="This is a longer tooltip message that demonstrates how the tooltip handles multi-line content and wraps properly within its container.">
|
|
65
|
+
<Button variant="outline">Long Tooltip</Button>
|
|
66
|
+
</Tooltip>
|
|
67
|
+
`,
|
|
68
|
+
}),
|
|
69
|
+
}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
TooltipContent,
|
|
5
5
|
TooltipProvider,
|
|
6
6
|
TooltipTrigger,
|
|
7
|
-
} from '
|
|
7
|
+
} from '../../shadcn/tooltip'
|
|
8
8
|
import type { TooltipProps } from './types'
|
|
9
9
|
|
|
10
10
|
const props = withDefaults(defineProps<TooltipProps>(), {
|
|
@@ -1,59 +1,94 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
2
|
import WebLink from './index.vue'
|
|
3
3
|
|
|
4
|
+
const targets = [ '_self', '_blank', '_parent', '_top' ] as const
|
|
5
|
+
|
|
4
6
|
const meta = {
|
|
5
7
|
title: 'UI/WebLink',
|
|
6
8
|
component: WebLink,
|
|
9
|
+
argTypes: {
|
|
10
|
+
href: { control: 'text' },
|
|
11
|
+
to: { control: 'object' },
|
|
12
|
+
target: { control: 'select', options: targets },
|
|
13
|
+
unstyled: { control: 'boolean' },
|
|
14
|
+
externalIcon: { control: 'boolean' },
|
|
15
|
+
class: { control: 'text' },
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
href: 'https://example.com',
|
|
19
|
+
to: undefined,
|
|
20
|
+
target: undefined,
|
|
21
|
+
unstyled: false,
|
|
22
|
+
externalIcon: true,
|
|
23
|
+
class: '',
|
|
24
|
+
},
|
|
25
|
+
render: args => ({
|
|
26
|
+
components: { WebLink },
|
|
27
|
+
setup: () => ({ args }),
|
|
28
|
+
template: `
|
|
29
|
+
<WebLink v-bind="args">Visit Example.com</WebLink>
|
|
30
|
+
`,
|
|
31
|
+
}),
|
|
7
32
|
} satisfies Meta<typeof WebLink>
|
|
8
33
|
|
|
9
34
|
export default meta
|
|
10
35
|
type Story = StoryObj<typeof meta>
|
|
11
36
|
|
|
12
|
-
export const Default: Story = {
|
|
37
|
+
export const Default: Story = {}
|
|
38
|
+
|
|
39
|
+
export const ExternalLink: Story = {
|
|
13
40
|
render: () => ({
|
|
14
41
|
components: { WebLink },
|
|
15
42
|
template: `
|
|
16
|
-
<div
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
<WebLink href="/dashboard">Go to Dashboard</WebLink>
|
|
20
|
-
</section>
|
|
21
|
-
|
|
22
|
-
<section>
|
|
23
|
-
<h3 class="mb-4 text-lg font-medium">External Link</h3>
|
|
24
|
-
<WebLink href="https://example.com">Visit Example.com</WebLink>
|
|
25
|
-
<p class="mt-1 text-sm text-muted-foreground">External links automatically open in a new tab and show a trailing icon.</p>
|
|
26
|
-
</section>
|
|
27
|
-
|
|
28
|
-
<section>
|
|
29
|
-
<h3 class="mb-4 text-lg font-medium">External Link without Icon</h3>
|
|
30
|
-
<WebLink href="https://example.com" :externalIcon="false">No trailing icon</WebLink>
|
|
31
|
-
</section>
|
|
32
|
-
|
|
33
|
-
<section>
|
|
34
|
-
<h3 class="mb-4 text-lg font-medium">With Explicit Target</h3>
|
|
35
|
-
<WebLink href="https://example.com" target="_self">Same Tab External Link</WebLink>
|
|
36
|
-
</section>
|
|
37
|
-
|
|
38
|
-
<section>
|
|
39
|
-
<h3 class="mb-4 text-lg font-medium">Unstyled</h3>
|
|
40
|
-
<div class="flex flex-col gap-2">
|
|
41
|
-
<WebLink href="/settings" unstyled>Unstyled internal link (no color or underline)</WebLink>
|
|
42
|
-
<WebLink href="https://example.com" unstyled>Unstyled external link (icon still shows)</WebLink>
|
|
43
|
-
</div>
|
|
44
|
-
</section>
|
|
45
|
-
|
|
46
|
-
<section>
|
|
47
|
-
<h3 class="mb-4 text-lg font-medium">Inline Usage</h3>
|
|
48
|
-
<p class="text-sm">
|
|
49
|
-
Please read our
|
|
50
|
-
<WebLink href="https://example.com/terms">Terms of Service</WebLink>
|
|
51
|
-
and
|
|
52
|
-
<WebLink href="https://example.com/privacy">Privacy Policy</WebLink>
|
|
53
|
-
before continuing.
|
|
54
|
-
</p>
|
|
55
|
-
</section>
|
|
43
|
+
<div>
|
|
44
|
+
<WebLink href="https://example.com">Visit Example.com</WebLink>
|
|
45
|
+
<p class="mt-1 text-sm text-muted-foreground">External links automatically open in a new tab and show a trailing icon.</p>
|
|
56
46
|
</div>
|
|
57
47
|
`,
|
|
58
48
|
}),
|
|
59
49
|
}
|
|
50
|
+
|
|
51
|
+
export const ExternalWithoutIcon: Story = {
|
|
52
|
+
render: () => ({
|
|
53
|
+
components: { WebLink },
|
|
54
|
+
template: `
|
|
55
|
+
<WebLink href="https://example.com" :externalIcon="false">No trailing icon</WebLink>
|
|
56
|
+
`,
|
|
57
|
+
}),
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export const WithExplicitTarget: Story = {
|
|
61
|
+
render: () => ({
|
|
62
|
+
components: { WebLink },
|
|
63
|
+
template: `
|
|
64
|
+
<WebLink href="https://example.com" target="_self">Same Tab External Link</WebLink>
|
|
65
|
+
`,
|
|
66
|
+
}),
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const Unstyled: Story = {
|
|
70
|
+
render: () => ({
|
|
71
|
+
components: { WebLink },
|
|
72
|
+
template: `
|
|
73
|
+
<div class="flex flex-col gap-2">
|
|
74
|
+
<WebLink href="/settings" unstyled>Unstyled internal link (no color or underline)</WebLink>
|
|
75
|
+
<WebLink href="https://example.com" unstyled>Unstyled external link (icon still shows)</WebLink>
|
|
76
|
+
</div>
|
|
77
|
+
`,
|
|
78
|
+
}),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const InlineUsage: Story = {
|
|
82
|
+
render: () => ({
|
|
83
|
+
components: { WebLink },
|
|
84
|
+
template: `
|
|
85
|
+
<p class="text-sm">
|
|
86
|
+
Please read our
|
|
87
|
+
<WebLink href="https://example.com/terms">Terms of Service</WebLink>
|
|
88
|
+
and
|
|
89
|
+
<WebLink href="https://example.com/privacy">Privacy Policy</WebLink>
|
|
90
|
+
before continuing.
|
|
91
|
+
</p>
|
|
92
|
+
`,
|
|
93
|
+
}),
|
|
94
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polymarbot/nuxt-layer-shadcn-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0w",
|
|
4
4
|
"description": "Nuxt layer providing shadcn-vue based UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"vue-i18n": "^11",
|
|
43
43
|
"vue-router": "^4 || ^5"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "5833c3657a24919d861e91dac1b19afe3ad84ccf"
|
|
46
46
|
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
2
|
-
import { RadioGroup } from '../../shadcn/radio-group'
|
|
3
|
-
import Radio from './index.vue'
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'UI/Radio',
|
|
7
|
-
component: Radio,
|
|
8
|
-
argTypes: {
|
|
9
|
-
disabled: { control: 'boolean' },
|
|
10
|
-
},
|
|
11
|
-
args: {
|
|
12
|
-
disabled: false,
|
|
13
|
-
},
|
|
14
|
-
} satisfies Meta<typeof Radio>
|
|
15
|
-
|
|
16
|
-
export default meta
|
|
17
|
-
type Story = StoryObj<typeof meta>
|
|
18
|
-
|
|
19
|
-
export const Default: Story = {
|
|
20
|
-
render: args => ({
|
|
21
|
-
components: { RadioGroup, Radio },
|
|
22
|
-
setup () {
|
|
23
|
-
const selected = ref('option1')
|
|
24
|
-
const plan = ref('free')
|
|
25
|
-
return { args, selected, plan }
|
|
26
|
-
},
|
|
27
|
-
template: `
|
|
28
|
-
<div class="space-y-10">
|
|
29
|
-
<!-- Controlled -->
|
|
30
|
-
<section>
|
|
31
|
-
<h3 class="mb-4 text-lg font-medium">Controlled</h3>
|
|
32
|
-
<RadioGroup v-model="selected" :disabled="args.disabled" class="flex flex-col gap-3">
|
|
33
|
-
<label class="flex items-center gap-2 cursor-pointer">
|
|
34
|
-
<Radio value="option1" />
|
|
35
|
-
<span class="text-sm">Option 1</span>
|
|
36
|
-
</label>
|
|
37
|
-
<label class="flex items-center gap-2 cursor-pointer">
|
|
38
|
-
<Radio value="option2" />
|
|
39
|
-
<span class="text-sm">Option 2</span>
|
|
40
|
-
</label>
|
|
41
|
-
<label class="flex items-center gap-2 cursor-pointer">
|
|
42
|
-
<Radio value="option3" />
|
|
43
|
-
<span class="text-sm">Option 3</span>
|
|
44
|
-
</label>
|
|
45
|
-
</RadioGroup>
|
|
46
|
-
<div class="mt-2 text-sm text-muted-foreground">Selected: {{ selected }}</div>
|
|
47
|
-
</section>
|
|
48
|
-
|
|
49
|
-
<!-- Plan Selection -->
|
|
50
|
-
<section>
|
|
51
|
-
<h3 class="mb-4 text-lg font-medium">Plan Selection</h3>
|
|
52
|
-
<RadioGroup v-model="plan" class="flex flex-col gap-3">
|
|
53
|
-
<label class="flex items-center gap-2 cursor-pointer">
|
|
54
|
-
<Radio value="free" />
|
|
55
|
-
<span class="text-sm">Free - $0/month</span>
|
|
56
|
-
</label>
|
|
57
|
-
<label class="flex items-center gap-2 cursor-pointer">
|
|
58
|
-
<Radio value="pro" />
|
|
59
|
-
<span class="text-sm">Pro - $9/month</span>
|
|
60
|
-
</label>
|
|
61
|
-
<label class="flex items-center gap-2 cursor-pointer">
|
|
62
|
-
<Radio value="enterprise" />
|
|
63
|
-
<span class="text-sm">Enterprise - $29/month</span>
|
|
64
|
-
</label>
|
|
65
|
-
</RadioGroup>
|
|
66
|
-
<div class="mt-2 text-sm text-muted-foreground">Plan: {{ plan }}</div>
|
|
67
|
-
</section>
|
|
68
|
-
</div>
|
|
69
|
-
`,
|
|
70
|
-
}),
|
|
71
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { RadioGroupItem } from '@polymarbot/nuxt-layer-shadcn-ui/app/components/shadcn/radio-group'
|
|
3
|
-
import type { RadioProps } from './types'
|
|
4
|
-
|
|
5
|
-
defineProps<RadioProps>()
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<RadioGroupItem />
|
|
10
|
-
</template>
|