@create-lft-app/nextjs 3.2.0 → 3.3.0
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/README.md +549 -549
- package/package.json +48 -48
- package/template/.claude/skills/anti-patterns.md +150 -0
- package/template/.claude/skills/drizzle-schema.md +178 -0
- package/template/.claude/skills/formatting.md +56 -0
- package/template/.claude/skills/module-architecture.md +143 -0
- package/template/.claude/skills/supabase-server-actions.md +199 -0
- package/template/.claude/skills/ui-patterns.md +161 -0
- package/template/CLAUDE.md +114 -1239
- package/template/drizzle.config.ts +12 -12
- package/template/eslint.config.mjs +16 -16
- package/template/gitignore +36 -36
- package/template/next.config.ts +7 -7
- package/template/package.json +86 -86
- package/template/postcss.config.mjs +7 -7
- package/template/proxy.ts +12 -12
- package/template/public/logolft.svg +11 -11
- package/template/src/app/(auth)/dashboard/dashboard-content.tsx +124 -124
- package/template/src/app/(auth)/dashboard/page.tsx +9 -9
- package/template/src/app/(auth)/layout.tsx +7 -7
- package/template/src/app/(auth)/users/page.tsx +9 -9
- package/template/src/app/(auth)/users/users-content.tsx +26 -26
- package/template/src/app/(public)/layout.tsx +7 -7
- package/template/src/app/(public)/login/page.tsx +17 -17
- package/template/src/app/api/webhooks/route.ts +20 -20
- package/template/src/app/globals.css +249 -249
- package/template/src/app/layout.tsx +37 -37
- package/template/src/app/page.tsx +5 -5
- package/template/src/app/providers.tsx +27 -27
- package/template/src/components/layout/main-content.tsx +28 -28
- package/template/src/components/layout/sidebar-context.tsx +33 -33
- package/template/src/components/layout/sidebar.tsx +141 -141
- package/template/src/components/tables/data-table-column-header.tsx +68 -68
- package/template/src/components/tables/data-table-date-filter.tsx +203 -203
- package/template/src/components/tables/data-table-faceted-filter.tsx +185 -185
- package/template/src/components/tables/data-table-filters-dropdown.tsx +130 -130
- package/template/src/components/tables/data-table-number-filter.tsx +295 -295
- package/template/src/components/tables/data-table-pagination.tsx +99 -99
- package/template/src/components/tables/data-table-toolbar.tsx +140 -140
- package/template/src/components/tables/data-table-view-options.tsx +63 -63
- package/template/src/components/tables/data-table.tsx +148 -148
- package/template/src/components/tables/index.ts +9 -9
- package/template/src/components/ui/accordion.tsx +58 -58
- package/template/src/components/ui/alert-dialog.tsx +165 -165
- package/template/src/components/ui/alert.tsx +66 -66
- package/template/src/components/ui/animations/index.ts +44 -44
- package/template/src/components/ui/avatar.tsx +55 -55
- package/template/src/components/ui/badge.tsx +50 -50
- package/template/src/components/ui/button.tsx +118 -118
- package/template/src/components/ui/calendar.tsx +220 -220
- package/template/src/components/ui/card.tsx +113 -113
- package/template/src/components/ui/checkbox.tsx +38 -38
- package/template/src/components/ui/collapsible.tsx +33 -33
- package/template/src/components/ui/command.tsx +196 -196
- package/template/src/components/ui/dialog.tsx +156 -156
- package/template/src/components/ui/dropdown-menu.tsx +280 -280
- package/template/src/components/ui/form.tsx +171 -171
- package/template/src/components/ui/icons.tsx +167 -167
- package/template/src/components/ui/input.tsx +28 -28
- package/template/src/components/ui/label.tsx +25 -25
- package/template/src/components/ui/motion.tsx +197 -197
- package/template/src/components/ui/page-transition.tsx +166 -166
- package/template/src/components/ui/popover.tsx +59 -59
- package/template/src/components/ui/progress.tsx +32 -32
- package/template/src/components/ui/radio-group.tsx +45 -45
- package/template/src/components/ui/scroll-area.tsx +63 -63
- package/template/src/components/ui/select.tsx +208 -208
- package/template/src/components/ui/separator.tsx +28 -28
- package/template/src/components/ui/sheet.tsx +170 -170
- package/template/src/components/ui/sidebar.tsx +726 -726
- package/template/src/components/ui/skeleton.tsx +15 -15
- package/template/src/components/ui/slider.tsx +58 -58
- package/template/src/components/ui/sonner.tsx +47 -47
- package/template/src/components/ui/spinner.tsx +27 -27
- package/template/src/components/ui/submit-button.tsx +47 -47
- package/template/src/components/ui/switch.tsx +31 -31
- package/template/src/components/ui/table.tsx +120 -120
- package/template/src/components/ui/tabs.tsx +75 -75
- package/template/src/components/ui/textarea.tsx +26 -26
- package/template/src/components/ui/tooltip.tsx +70 -70
- package/template/src/config/navigation.ts +59 -59
- package/template/src/config/roles.ts +27 -27
- package/template/src/config/site.ts +12 -12
- package/template/src/db/index.ts +12 -12
- package/template/src/db/schema/index.ts +1 -1
- package/template/src/db/schema/users.ts +16 -16
- package/template/src/db/seed.ts +39 -39
- package/template/src/hooks/index.ts +3 -3
- package/template/src/hooks/use-mobile.ts +21 -21
- package/template/src/hooks/useDataTable.ts +82 -82
- package/template/src/hooks/useDebounce.ts +49 -49
- package/template/src/hooks/useMediaQuery.ts +36 -36
- package/template/src/lib/date/config.ts +36 -36
- package/template/src/lib/date/formatters.ts +127 -127
- package/template/src/lib/date/index.ts +26 -26
- package/template/src/lib/excel/exporter.ts +89 -89
- package/template/src/lib/excel/index.ts +14 -14
- package/template/src/lib/excel/parser.ts +96 -96
- package/template/src/lib/query-client.ts +35 -35
- package/template/src/lib/supabase/admin.ts +23 -23
- package/template/src/lib/supabase/client.ts +11 -11
- package/template/src/lib/supabase/proxy.ts +67 -67
- package/template/src/lib/supabase/server.ts +38 -38
- package/template/src/lib/supabase/types.ts +53 -53
- package/template/src/lib/utils.ts +6 -6
- package/template/src/lib/validations/common.ts +75 -75
- package/template/src/lib/validations/index.ts +20 -20
- package/template/src/modules/auth/actions/auth-actions.ts +59 -59
- package/template/src/modules/auth/components/login-form.tsx +68 -68
- package/template/src/modules/auth/hooks/useAuth.ts +38 -38
- package/template/src/modules/auth/hooks/useAuthMutations.ts +43 -43
- package/template/src/modules/auth/hooks/useAuthQueries.ts +43 -43
- package/template/src/modules/auth/index.ts +12 -12
- package/template/src/modules/auth/schemas/auth.schema.ts +32 -32
- package/template/src/modules/auth/stores/useAuthStore.ts +37 -37
- package/template/src/modules/users/actions/users-actions.ts +166 -166
- package/template/src/modules/users/columns.tsx +106 -106
- package/template/src/modules/users/components/users-list.tsx +48 -48
- package/template/src/modules/users/hooks/useUsers.ts +39 -39
- package/template/src/modules/users/hooks/useUsersMutations.ts +55 -55
- package/template/src/modules/users/hooks/useUsersQueries.ts +35 -35
- package/template/src/modules/users/index.ts +30 -30
- package/template/src/modules/users/schemas/users.schema.ts +51 -51
- package/template/src/modules/users/stores/useUsersStore.ts +60 -60
- package/template/src/modules/users/types/auth-user.types.ts +42 -42
- package/template/src/modules/users/utils/user-mapper.ts +32 -32
- package/template/src/stores/index.ts +1 -1
- package/template/src/stores/useUiStore.ts +55 -55
- package/template/src/types/api.ts +28 -28
- package/template/src/types/index.ts +2 -2
- package/template/src/types/table.ts +34 -34
- package/template/supabase/config.toml +94 -94
- package/template/tsconfig.json +42 -42
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import {
|
|
5
|
-
ColumnDef,
|
|
6
|
-
ColumnFiltersState,
|
|
7
|
-
SortingState,
|
|
8
|
-
VisibilityState,
|
|
9
|
-
flexRender,
|
|
10
|
-
getCoreRowModel,
|
|
11
|
-
getFacetedRowModel,
|
|
12
|
-
getFacetedUniqueValues,
|
|
13
|
-
getFilteredRowModel,
|
|
14
|
-
getPaginationRowModel,
|
|
15
|
-
getSortedRowModel,
|
|
16
|
-
useReactTable,
|
|
17
|
-
} from '@tanstack/react-table'
|
|
18
|
-
|
|
19
|
-
import {
|
|
20
|
-
Table,
|
|
21
|
-
TableBody,
|
|
22
|
-
TableCell,
|
|
23
|
-
TableHead,
|
|
24
|
-
TableHeader,
|
|
25
|
-
TableRow,
|
|
26
|
-
} from '@/components/ui/table'
|
|
27
|
-
import { DataTableToolbar } from './data-table-toolbar'
|
|
28
|
-
import { DataTablePagination } from './data-table-pagination'
|
|
29
|
-
import { DataTableViewOptions } from './data-table-view-options'
|
|
30
|
-
|
|
31
|
-
export interface FilterConfig {
|
|
32
|
-
columnId: string
|
|
33
|
-
type: 'faceted' | 'date-range' | 'number-range'
|
|
34
|
-
title: string
|
|
35
|
-
options?: { label: string; value: string; icon?: React.ComponentType<{ className?: string }> }[]
|
|
36
|
-
/** Para number-range: formato del número */
|
|
37
|
-
format?: 'currency' | 'number'
|
|
38
|
-
/** Para number-range: símbolo de moneda */
|
|
39
|
-
currencySymbol?: string
|
|
40
|
-
/** Para number-range: paso del input */
|
|
41
|
-
step?: number
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
interface DataTableProps<TData, TValue> {
|
|
45
|
-
columns: ColumnDef<TData, TValue>[]
|
|
46
|
-
data: TData[]
|
|
47
|
-
searchKey?: string
|
|
48
|
-
searchPlaceholder?: string
|
|
49
|
-
filters?: FilterConfig[]
|
|
50
|
-
/** Modo de visualización de filtros: 'dropdown' (default), 'inline', 'inline-collapsible' */
|
|
51
|
-
filterMode?: 'dropdown' | 'inline' | 'inline-collapsible'
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function DataTable<TData, TValue>({
|
|
55
|
-
columns,
|
|
56
|
-
data,
|
|
57
|
-
searchKey,
|
|
58
|
-
searchPlaceholder = 'Buscar...',
|
|
59
|
-
filters,
|
|
60
|
-
filterMode = 'dropdown',
|
|
61
|
-
}: DataTableProps<TData, TValue>) {
|
|
62
|
-
const [sorting, setSorting] = React.useState<SortingState>([])
|
|
63
|
-
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>([])
|
|
64
|
-
const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({})
|
|
65
|
-
const [rowSelection, setRowSelection] = React.useState({})
|
|
66
|
-
|
|
67
|
-
const table = useReactTable({
|
|
68
|
-
data,
|
|
69
|
-
columns,
|
|
70
|
-
getCoreRowModel: getCoreRowModel(),
|
|
71
|
-
getPaginationRowModel: getPaginationRowModel(),
|
|
72
|
-
onSortingChange: setSorting,
|
|
73
|
-
getSortedRowModel: getSortedRowModel(),
|
|
74
|
-
onColumnFiltersChange: setColumnFilters,
|
|
75
|
-
getFilteredRowModel: getFilteredRowModel(),
|
|
76
|
-
onColumnVisibilityChange: setColumnVisibility,
|
|
77
|
-
onRowSelectionChange: setRowSelection,
|
|
78
|
-
getFacetedRowModel: getFacetedRowModel(),
|
|
79
|
-
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
80
|
-
state: {
|
|
81
|
-
sorting,
|
|
82
|
-
columnFilters,
|
|
83
|
-
columnVisibility,
|
|
84
|
-
rowSelection,
|
|
85
|
-
},
|
|
86
|
-
})
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<div className="space-y-4">
|
|
90
|
-
<DataTableToolbar
|
|
91
|
-
table={table}
|
|
92
|
-
searchKey={searchKey}
|
|
93
|
-
searchPlaceholder={searchPlaceholder}
|
|
94
|
-
filters={filters}
|
|
95
|
-
filterMode={filterMode}
|
|
96
|
-
/>
|
|
97
|
-
<div className="rounded-md border">
|
|
98
|
-
<Table>
|
|
99
|
-
<TableHeader>
|
|
100
|
-
{table.getHeaderGroups().map((headerGroup) => (
|
|
101
|
-
<TableRow key={headerGroup.id}>
|
|
102
|
-
{headerGroup.headers.map((header, index) => {
|
|
103
|
-
const isLastHeader = index === headerGroup.headers.length - 1
|
|
104
|
-
return (
|
|
105
|
-
<TableHead key={header.id}>
|
|
106
|
-
<div className={isLastHeader ? 'flex items-center justify-end gap-2' : ''}>
|
|
107
|
-
{header.isPlaceholder
|
|
108
|
-
? null
|
|
109
|
-
: flexRender(
|
|
110
|
-
header.column.columnDef.header,
|
|
111
|
-
header.getContext()
|
|
112
|
-
)}
|
|
113
|
-
{isLastHeader && <DataTableViewOptions table={table} />}
|
|
114
|
-
</div>
|
|
115
|
-
</TableHead>
|
|
116
|
-
)
|
|
117
|
-
})}
|
|
118
|
-
</TableRow>
|
|
119
|
-
))}
|
|
120
|
-
</TableHeader>
|
|
121
|
-
<TableBody>
|
|
122
|
-
{table.getRowModel().rows?.length ? (
|
|
123
|
-
table.getRowModel().rows.map((row) => (
|
|
124
|
-
<TableRow
|
|
125
|
-
key={row.id}
|
|
126
|
-
data-state={row.getIsSelected() && 'selected'}
|
|
127
|
-
>
|
|
128
|
-
{row.getVisibleCells().map((cell) => (
|
|
129
|
-
<TableCell key={cell.id}>
|
|
130
|
-
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
131
|
-
</TableCell>
|
|
132
|
-
))}
|
|
133
|
-
</TableRow>
|
|
134
|
-
))
|
|
135
|
-
) : (
|
|
136
|
-
<TableRow>
|
|
137
|
-
<TableCell colSpan={columns.length} className="h-24 text-center">
|
|
138
|
-
No hay resultados.
|
|
139
|
-
</TableCell>
|
|
140
|
-
</TableRow>
|
|
141
|
-
)}
|
|
142
|
-
</TableBody>
|
|
143
|
-
</Table>
|
|
144
|
-
</div>
|
|
145
|
-
<DataTablePagination table={table} />
|
|
146
|
-
</div>
|
|
147
|
-
)
|
|
148
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import {
|
|
5
|
+
ColumnDef,
|
|
6
|
+
ColumnFiltersState,
|
|
7
|
+
SortingState,
|
|
8
|
+
VisibilityState,
|
|
9
|
+
flexRender,
|
|
10
|
+
getCoreRowModel,
|
|
11
|
+
getFacetedRowModel,
|
|
12
|
+
getFacetedUniqueValues,
|
|
13
|
+
getFilteredRowModel,
|
|
14
|
+
getPaginationRowModel,
|
|
15
|
+
getSortedRowModel,
|
|
16
|
+
useReactTable,
|
|
17
|
+
} from '@tanstack/react-table'
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
Table,
|
|
21
|
+
TableBody,
|
|
22
|
+
TableCell,
|
|
23
|
+
TableHead,
|
|
24
|
+
TableHeader,
|
|
25
|
+
TableRow,
|
|
26
|
+
} from '@/components/ui/table'
|
|
27
|
+
import { DataTableToolbar } from './data-table-toolbar'
|
|
28
|
+
import { DataTablePagination } from './data-table-pagination'
|
|
29
|
+
import { DataTableViewOptions } from './data-table-view-options'
|
|
30
|
+
|
|
31
|
+
export interface FilterConfig {
|
|
32
|
+
columnId: string
|
|
33
|
+
type: 'faceted' | 'date-range' | 'number-range'
|
|
34
|
+
title: string
|
|
35
|
+
options?: { label: string; value: string; icon?: React.ComponentType<{ className?: string }> }[]
|
|
36
|
+
/** Para number-range: formato del número */
|
|
37
|
+
format?: 'currency' | 'number'
|
|
38
|
+
/** Para number-range: símbolo de moneda */
|
|
39
|
+
currencySymbol?: string
|
|
40
|
+
/** Para number-range: paso del input */
|
|
41
|
+
step?: number
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface DataTableProps<TData, TValue> {
|
|
45
|
+
columns: ColumnDef<TData, TValue>[]
|
|
46
|
+
data: TData[]
|
|
47
|
+
searchKey?: string
|
|
48
|
+
searchPlaceholder?: string
|
|
49
|
+
filters?: FilterConfig[]
|
|
50
|
+
/** Modo de visualización de filtros: 'dropdown' (default), 'inline', 'inline-collapsible' */
|
|
51
|
+
filterMode?: 'dropdown' | 'inline' | 'inline-collapsible'
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function DataTable<TData, TValue>({
|
|
55
|
+
columns,
|
|
56
|
+
data,
|
|
57
|
+
searchKey,
|
|
58
|
+
searchPlaceholder = 'Buscar...',
|
|
59
|
+
filters,
|
|
60
|
+
filterMode = 'dropdown',
|
|
61
|
+
}: DataTableProps<TData, TValue>) {
|
|
62
|
+
const [sorting, setSorting] = React.useState<SortingState>([])
|
|
63
|
+
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>([])
|
|
64
|
+
const [columnVisibility, setColumnVisibility] = React.useState<VisibilityState>({})
|
|
65
|
+
const [rowSelection, setRowSelection] = React.useState({})
|
|
66
|
+
|
|
67
|
+
const table = useReactTable({
|
|
68
|
+
data,
|
|
69
|
+
columns,
|
|
70
|
+
getCoreRowModel: getCoreRowModel(),
|
|
71
|
+
getPaginationRowModel: getPaginationRowModel(),
|
|
72
|
+
onSortingChange: setSorting,
|
|
73
|
+
getSortedRowModel: getSortedRowModel(),
|
|
74
|
+
onColumnFiltersChange: setColumnFilters,
|
|
75
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
76
|
+
onColumnVisibilityChange: setColumnVisibility,
|
|
77
|
+
onRowSelectionChange: setRowSelection,
|
|
78
|
+
getFacetedRowModel: getFacetedRowModel(),
|
|
79
|
+
getFacetedUniqueValues: getFacetedUniqueValues(),
|
|
80
|
+
state: {
|
|
81
|
+
sorting,
|
|
82
|
+
columnFilters,
|
|
83
|
+
columnVisibility,
|
|
84
|
+
rowSelection,
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<div className="space-y-4">
|
|
90
|
+
<DataTableToolbar
|
|
91
|
+
table={table}
|
|
92
|
+
searchKey={searchKey}
|
|
93
|
+
searchPlaceholder={searchPlaceholder}
|
|
94
|
+
filters={filters}
|
|
95
|
+
filterMode={filterMode}
|
|
96
|
+
/>
|
|
97
|
+
<div className="rounded-md border">
|
|
98
|
+
<Table>
|
|
99
|
+
<TableHeader>
|
|
100
|
+
{table.getHeaderGroups().map((headerGroup) => (
|
|
101
|
+
<TableRow key={headerGroup.id}>
|
|
102
|
+
{headerGroup.headers.map((header, index) => {
|
|
103
|
+
const isLastHeader = index === headerGroup.headers.length - 1
|
|
104
|
+
return (
|
|
105
|
+
<TableHead key={header.id}>
|
|
106
|
+
<div className={isLastHeader ? 'flex items-center justify-end gap-2' : ''}>
|
|
107
|
+
{header.isPlaceholder
|
|
108
|
+
? null
|
|
109
|
+
: flexRender(
|
|
110
|
+
header.column.columnDef.header,
|
|
111
|
+
header.getContext()
|
|
112
|
+
)}
|
|
113
|
+
{isLastHeader && <DataTableViewOptions table={table} />}
|
|
114
|
+
</div>
|
|
115
|
+
</TableHead>
|
|
116
|
+
)
|
|
117
|
+
})}
|
|
118
|
+
</TableRow>
|
|
119
|
+
))}
|
|
120
|
+
</TableHeader>
|
|
121
|
+
<TableBody>
|
|
122
|
+
{table.getRowModel().rows?.length ? (
|
|
123
|
+
table.getRowModel().rows.map((row) => (
|
|
124
|
+
<TableRow
|
|
125
|
+
key={row.id}
|
|
126
|
+
data-state={row.getIsSelected() && 'selected'}
|
|
127
|
+
>
|
|
128
|
+
{row.getVisibleCells().map((cell) => (
|
|
129
|
+
<TableCell key={cell.id}>
|
|
130
|
+
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
|
131
|
+
</TableCell>
|
|
132
|
+
))}
|
|
133
|
+
</TableRow>
|
|
134
|
+
))
|
|
135
|
+
) : (
|
|
136
|
+
<TableRow>
|
|
137
|
+
<TableCell colSpan={columns.length} className="h-24 text-center">
|
|
138
|
+
No hay resultados.
|
|
139
|
+
</TableCell>
|
|
140
|
+
</TableRow>
|
|
141
|
+
)}
|
|
142
|
+
</TableBody>
|
|
143
|
+
</Table>
|
|
144
|
+
</div>
|
|
145
|
+
<DataTablePagination table={table} />
|
|
146
|
+
</div>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { DataTable, type FilterConfig } from './data-table'
|
|
2
|
-
export { DataTablePagination } from './data-table-pagination'
|
|
3
|
-
export { DataTableColumnHeader } from './data-table-column-header'
|
|
4
|
-
export { DataTableToolbar } from './data-table-toolbar'
|
|
5
|
-
export { DataTableViewOptions } from './data-table-view-options'
|
|
6
|
-
export { DataTableFacetedFilter, type FacetedFilterOption } from './data-table-faceted-filter'
|
|
7
|
-
export { DataTableDateFilter, dateRangeFilterFn } from './data-table-date-filter'
|
|
8
|
-
export { DataTableNumberFilter, numberRangeFilterFn, type NumberRange } from './data-table-number-filter'
|
|
9
|
-
export { DataTableFiltersDropdown } from './data-table-filters-dropdown'
|
|
1
|
+
export { DataTable, type FilterConfig } from './data-table'
|
|
2
|
+
export { DataTablePagination } from './data-table-pagination'
|
|
3
|
+
export { DataTableColumnHeader } from './data-table-column-header'
|
|
4
|
+
export { DataTableToolbar } from './data-table-toolbar'
|
|
5
|
+
export { DataTableViewOptions } from './data-table-view-options'
|
|
6
|
+
export { DataTableFacetedFilter, type FacetedFilterOption } from './data-table-faceted-filter'
|
|
7
|
+
export { DataTableDateFilter, dateRangeFilterFn } from './data-table-date-filter'
|
|
8
|
+
export { DataTableNumberFilter, numberRangeFilterFn, type NumberRange } from './data-table-number-filter'
|
|
9
|
+
export { DataTableFiltersDropdown } from './data-table-filters-dropdown'
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
5
|
-
import { ChevronDown } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "@/lib/utils"
|
|
8
|
-
|
|
9
|
-
const Accordion = AccordionPrimitive.Root
|
|
10
|
-
|
|
11
|
-
const AccordionItem = React.forwardRef<
|
|
12
|
-
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
13
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
14
|
-
>(({ className, ...props }, ref) => (
|
|
15
|
-
<AccordionPrimitive.Item
|
|
16
|
-
ref={ref}
|
|
17
|
-
className={cn("", className)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
))
|
|
21
|
-
AccordionItem.displayName = "AccordionItem"
|
|
22
|
-
|
|
23
|
-
const AccordionTrigger = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
26
|
-
>(({ className, children, ...props }, ref) => (
|
|
27
|
-
<AccordionPrimitive.Header className="flex">
|
|
28
|
-
<AccordionPrimitive.Trigger
|
|
29
|
-
ref={ref}
|
|
30
|
-
className={cn(
|
|
31
|
-
"flex flex-1 items-center justify-between py-4 font-medium transition-all [&[data-state=open]>svg]:rotate-180",
|
|
32
|
-
className
|
|
33
|
-
)}
|
|
34
|
-
{...props}
|
|
35
|
-
>
|
|
36
|
-
{children}
|
|
37
|
-
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
38
|
-
</AccordionPrimitive.Trigger>
|
|
39
|
-
</AccordionPrimitive.Header>
|
|
40
|
-
))
|
|
41
|
-
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
42
|
-
|
|
43
|
-
const AccordionContent = React.forwardRef<
|
|
44
|
-
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
45
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
46
|
-
>(({ className, children, ...props }, ref) => (
|
|
47
|
-
<AccordionPrimitive.Content
|
|
48
|
-
ref={ref}
|
|
49
|
-
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
50
|
-
{...props}
|
|
51
|
-
>
|
|
52
|
-
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
53
|
-
</AccordionPrimitive.Content>
|
|
54
|
-
))
|
|
55
|
-
|
|
56
|
-
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
57
|
-
|
|
58
|
-
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
5
|
+
import { ChevronDown } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { cn } from "@/lib/utils"
|
|
8
|
+
|
|
9
|
+
const Accordion = AccordionPrimitive.Root
|
|
10
|
+
|
|
11
|
+
const AccordionItem = React.forwardRef<
|
|
12
|
+
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
13
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
14
|
+
>(({ className, ...props }, ref) => (
|
|
15
|
+
<AccordionPrimitive.Item
|
|
16
|
+
ref={ref}
|
|
17
|
+
className={cn("", className)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
))
|
|
21
|
+
AccordionItem.displayName = "AccordionItem"
|
|
22
|
+
|
|
23
|
+
const AccordionTrigger = React.forwardRef<
|
|
24
|
+
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
26
|
+
>(({ className, children, ...props }, ref) => (
|
|
27
|
+
<AccordionPrimitive.Header className="flex">
|
|
28
|
+
<AccordionPrimitive.Trigger
|
|
29
|
+
ref={ref}
|
|
30
|
+
className={cn(
|
|
31
|
+
"flex flex-1 items-center justify-between py-4 font-medium transition-all [&[data-state=open]>svg]:rotate-180",
|
|
32
|
+
className
|
|
33
|
+
)}
|
|
34
|
+
{...props}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200" />
|
|
38
|
+
</AccordionPrimitive.Trigger>
|
|
39
|
+
</AccordionPrimitive.Header>
|
|
40
|
+
))
|
|
41
|
+
AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName
|
|
42
|
+
|
|
43
|
+
const AccordionContent = React.forwardRef<
|
|
44
|
+
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
45
|
+
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
46
|
+
>(({ className, children, ...props }, ref) => (
|
|
47
|
+
<AccordionPrimitive.Content
|
|
48
|
+
ref={ref}
|
|
49
|
+
className="overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
<div className={cn("pb-4 pt-0", className)}>{children}</div>
|
|
53
|
+
</AccordionPrimitive.Content>
|
|
54
|
+
))
|
|
55
|
+
|
|
56
|
+
AccordionContent.displayName = AccordionPrimitive.Content.displayName
|
|
57
|
+
|
|
58
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|