docs: fix some component

This commit is contained in:
sadeghbarati 2024-09-19 14:51:48 +03:30
parent 775d59b51d
commit e774b9f1c1
4 changed files with 42 additions and 42 deletions

View File

@ -11,7 +11,7 @@ import { Label } from '@/lib/registry/new-york/ui/label'
<Label for="date" class="shrink-0"> <Label for="date" class="shrink-0">
Pick a date Pick a date
</Label> </Label>
<DatePickerWithRange class="[&>button]:w-[260px]" /> <DatePickerWithRange />
</div> </div>
</CardContent> </CardContent>
</Card> </Card>

View File

@ -1,13 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { h } from 'vue'
import { useForm } from 'vee-validate'
import { toTypedSchema } from '@vee-validate/zod'
import * as z from 'zod'
import {
PinInput,
PinInputGroup,
PinInputInput,
} from '@/lib/registry/default/ui/pin-input'
import { Button } from '@/lib/registry/default/ui/button' import { Button } from '@/lib/registry/default/ui/button'
import { import {
FormControl, FormControl,
@ -17,7 +8,16 @@ import {
FormLabel, FormLabel,
FormMessage, FormMessage,
} from '@/lib/registry/default/ui/form' } from '@/lib/registry/default/ui/form'
import {
PinInput,
PinInputGroup,
PinInputInput,
} from '@/lib/registry/default/ui/pin-input'
import { toast } from '@/lib/registry/default/ui/toast' import { toast } from '@/lib/registry/default/ui/toast'
import { toTypedSchema } from '@vee-validate/zod'
import { useForm } from 'vee-validate'
import { h } from 'vue'
import * as z from 'zod'
const formSchema = toTypedSchema(z.object({ const formSchema = toTypedSchema(z.object({
pin: z.array(z.coerce.string()).length(5, { message: 'Invalid input' }), pin: z.array(z.coerce.string()).length(5, { message: 'Invalid input' }),
@ -48,7 +48,7 @@ const handleComplete = (e: string[]) => console.log(e.join(''))
<FormControl> <FormControl>
<PinInput <PinInput
id="pin-input" id="pin-input"
v-model="value!" :model-value="value"
placeholder="○" placeholder="○"
class="flex gap-2 items-center mt-1" class="flex gap-2 items-center mt-1"
otp otp

View File

@ -6,6 +6,26 @@ import type {
SortingState, SortingState,
VisibilityState, VisibilityState,
} from '@tanstack/vue-table' } from '@tanstack/vue-table'
import { Button } from '@/lib/registry/new-york/ui/button'
import { Checkbox } from '@/lib/registry/new-york/ui/checkbox'
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuTrigger,
} from '@/lib/registry/new-york/ui/dropdown-menu'
import { Input } from '@/lib/registry/new-york/ui/input'
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@/lib/registry/new-york/ui/table'
import { valueUpdater } from '@/lib/utils'
import { CaretSortIcon, ChevronDownIcon } from '@radix-icons/vue'
import { import {
FlexRender, FlexRender,
getCoreRowModel, getCoreRowModel,
@ -16,28 +36,8 @@ import {
useVueTable, useVueTable,
} from '@tanstack/vue-table' } from '@tanstack/vue-table'
import { h, ref } from 'vue' import { h, ref } from 'vue'
import { CaretSortIcon, ChevronDownIcon } from '@radix-icons/vue'
import DropdownAction from './DataTableDemoColumn.vue' import DropdownAction from './DataTableDemoColumn.vue'
import { Button } from '@/lib/registry/new-york/ui/button'
import { Checkbox } from '@/lib/registry/new-york/ui/checkbox'
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuTrigger,
} from '@/lib/registry/new-york/ui/dropdown-menu'
import { Input } from '@/lib/registry/new-york/ui/input'
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@/lib/registry/new-york/ui/table'
import { valueUpdater } from '@/lib/utils'
export interface Payment { export interface Payment {
id: string id: string
amount: number amount: number
@ -105,7 +105,7 @@ const columns: ColumnDef<Payment>[] = [
return h(Button, { return h(Button, {
variant: 'ghost', variant: 'ghost',
onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'),
}, ['Email', h(CaretSortIcon, { class: 'ml-2 h-4 w-4' })]) }, () => ['Email', h(CaretSortIcon, { class: 'ml-2 h-4 w-4' })])
}, },
cell: ({ row }) => h('div', { class: 'lowercase' }, row.getValue('email')), cell: ({ row }) => h('div', { class: 'lowercase' }, row.getValue('email')),
}, },

View File

@ -1,13 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { h } from 'vue'
import { useForm } from 'vee-validate'
import { toTypedSchema } from '@vee-validate/zod'
import * as z from 'zod'
import {
PinInput,
PinInputGroup,
PinInputInput,
} from '@/lib/registry/new-york/ui/pin-input'
import { Button } from '@/lib/registry/new-york/ui/button' import { Button } from '@/lib/registry/new-york/ui/button'
import { import {
FormControl, FormControl,
@ -17,7 +8,16 @@ import {
FormLabel, FormLabel,
FormMessage, FormMessage,
} from '@/lib/registry/new-york/ui/form' } from '@/lib/registry/new-york/ui/form'
import {
PinInput,
PinInputGroup,
PinInputInput,
} from '@/lib/registry/new-york/ui/pin-input'
import { toast } from '@/lib/registry/new-york/ui/toast' import { toast } from '@/lib/registry/new-york/ui/toast'
import { toTypedSchema } from '@vee-validate/zod'
import { useForm } from 'vee-validate'
import { h } from 'vue'
import * as z from 'zod'
const formSchema = toTypedSchema(z.object({ const formSchema = toTypedSchema(z.object({
pin: z.array(z.coerce.string()).length(5, { message: 'Invalid input' }), pin: z.array(z.coerce.string()).length(5, { message: 'Invalid input' }),
@ -48,7 +48,7 @@ const handleComplete = (e: string[]) => console.log(e.join(''))
<FormControl> <FormControl>
<PinInput <PinInput
id="pin-input" id="pin-input"
v-model="value!" :model-value="value"
placeholder="○" placeholder="○"
class="flex gap-2 items-center mt-1" class="flex gap-2 items-center mt-1"
otp otp