@vendure/dashboard 3.3.6-master-202507030835 → 3.3.6-master-202507031258
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/package.json +26 -39
- package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +7 -7
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +3 -8
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +9 -3
- package/src/lib/components/data-table/data-table.tsx +3 -2
- package/src/lib/components/shared/translatable-form-field.tsx +2 -1
- package/src/lib/components/ui/accordion.tsx +45 -50
- package/src/lib/components/ui/alert-dialog.tsx +93 -122
- package/src/lib/components/ui/alert.tsx +48 -54
- package/src/lib/components/ui/badge.tsx +29 -37
- package/src/lib/components/ui/breadcrumb.tsx +82 -89
- package/src/lib/components/ui/button.tsx +51 -52
- package/src/lib/components/ui/calendar.tsx +435 -196
- package/src/lib/components/ui/card.tsx +33 -78
- package/src/lib/components/ui/checkbox.tsx +23 -28
- package/src/lib/components/ui/collapsible.tsx +2 -0
- package/src/lib/components/ui/command.tsx +114 -159
- package/src/lib/components/ui/dialog.tsx +90 -115
- package/src/lib/components/ui/dropdown-menu.tsx +170 -207
- package/src/lib/components/ui/form.tsx +114 -138
- package/src/lib/components/ui/hover-card.tsx +26 -32
- package/src/lib/components/ui/input.tsx +15 -17
- package/src/lib/components/ui/label.tsx +16 -19
- package/src/lib/components/ui/pagination.tsx +87 -108
- package/src/lib/components/ui/popover.tsx +28 -36
- package/src/lib/components/ui/scroll-area.tsx +40 -48
- package/src/lib/components/ui/separator.tsx +20 -22
- package/src/lib/components/ui/sheet.tsx +91 -110
- package/src/lib/components/ui/sidebar.tsx +622 -652
- package/src/lib/components/ui/skeleton.tsx +10 -10
- package/src/lib/components/ui/sonner.tsx +11 -7
- package/src/lib/components/ui/switch.tsx +22 -27
- package/src/lib/components/ui/table.tsx +64 -96
- package/src/lib/components/ui/tabs.tsx +38 -56
- package/src/lib/components/ui/textarea.tsx +14 -14
- package/src/lib/components/ui/tooltip.tsx +37 -45
- package/src/lib/framework/page/detail-page.tsx +26 -20
- package/src/lib/graphql/graphql-env.d.ts +1 -1
- package/src/lib/components/ui/aspect-ratio.tsx +0 -9
- package/src/lib/components/ui/avatar.tsx +0 -53
- package/src/lib/components/ui/carousel.tsx +0 -241
- package/src/lib/components/ui/chart.tsx +0 -351
- package/src/lib/components/ui/context-menu.tsx +0 -252
- package/src/lib/components/ui/drawer.tsx +0 -133
- package/src/lib/components/ui/input-otp.tsx +0 -77
- package/src/lib/components/ui/menubar.tsx +0 -274
- package/src/lib/components/ui/navigation-menu.tsx +0 -168
- package/src/lib/components/ui/progress.tsx +0 -29
- package/src/lib/components/ui/radio-group.tsx +0 -45
- package/src/lib/components/ui/resizable.tsx +0 -54
- package/src/lib/components/ui/slider.tsx +0 -63
- package/src/lib/components/ui/toggle-group.tsx +0 -73
- package/src/lib/components/ui/toggle.tsx +0 -45
|
@@ -1,165 +1,141 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
2
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from
|
|
5
|
+
Controller,
|
|
6
|
+
FormProvider,
|
|
7
|
+
useFormContext,
|
|
8
|
+
useFormState,
|
|
9
|
+
type ControllerProps,
|
|
10
|
+
type FieldPath,
|
|
11
|
+
type FieldValues,
|
|
12
|
+
} from 'react-hook-form';
|
|
13
13
|
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import { Label } from '@/vdb/components/ui/label.js';
|
|
15
|
+
import { cn } from '@/vdb/lib/utils.js';
|
|
16
16
|
|
|
17
|
-
const Form = FormProvider
|
|
17
|
+
const Form = FormProvider;
|
|
18
18
|
|
|
19
19
|
type FormFieldContextValue<
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
21
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
22
22
|
> = {
|
|
23
|
-
|
|
24
|
-
}
|
|
23
|
+
name: TName;
|
|
24
|
+
};
|
|
25
25
|
|
|
26
|
-
const FormFieldContext = React.createContext<FormFieldContextValue>(
|
|
27
|
-
{} as FormFieldContextValue
|
|
28
|
-
)
|
|
26
|
+
const FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);
|
|
29
27
|
|
|
30
28
|
const FormField = <
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
TFieldValues extends FieldValues = FieldValues,
|
|
30
|
+
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
33
31
|
>({
|
|
34
|
-
|
|
32
|
+
...props
|
|
35
33
|
}: ControllerProps<TFieldValues, TName>) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
34
|
+
return (
|
|
35
|
+
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
36
|
+
<Controller {...props} />
|
|
37
|
+
</FormFieldContext.Provider>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
42
40
|
|
|
43
41
|
const useFormField = () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
42
|
+
const fieldContext = React.useContext(FormFieldContext);
|
|
43
|
+
const itemContext = React.useContext(FormItemContext);
|
|
44
|
+
const { getFieldState } = useFormContext();
|
|
45
|
+
const formState = useFormState({ name: fieldContext.name });
|
|
46
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
47
|
+
|
|
48
|
+
if (!fieldContext) {
|
|
49
|
+
throw new Error('useFormField should be used within <FormField>');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const { id } = itemContext;
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
id,
|
|
56
|
+
name: fieldContext.name,
|
|
57
|
+
formItemId: `${id}-form-item`,
|
|
58
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
59
|
+
formMessageId: `${id}-form-item-message`,
|
|
60
|
+
...fieldState,
|
|
61
|
+
};
|
|
62
|
+
};
|
|
65
63
|
|
|
66
64
|
type FormItemContextValue = {
|
|
67
|
-
|
|
68
|
-
}
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
69
67
|
|
|
70
|
-
const FormItemContext = React.createContext<FormItemContextValue>(
|
|
71
|
-
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
data-slot="form-item"
|
|
81
|
-
className={cn("grid gap-2", className)}
|
|
82
|
-
{...props}
|
|
83
|
-
/>
|
|
84
|
-
</FormItemContext.Provider>
|
|
85
|
-
)
|
|
68
|
+
const FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);
|
|
69
|
+
|
|
70
|
+
function FormItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
71
|
+
const id = React.useId();
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<FormItemContext.Provider value={{ id }}>
|
|
75
|
+
<div data-slot="form-item" className={cn('grid gap-2', className)} {...props} />
|
|
76
|
+
</FormItemContext.Provider>
|
|
77
|
+
);
|
|
86
78
|
}
|
|
87
79
|
|
|
88
|
-
function FormLabel({
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{...props}
|
|
101
|
-
/>
|
|
102
|
-
)
|
|
80
|
+
function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
81
|
+
const { error, formItemId } = useFormField();
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Label
|
|
85
|
+
data-slot="form-label"
|
|
86
|
+
data-error={!!error}
|
|
87
|
+
className={cn('data-[error=true]:text-destructive', className)}
|
|
88
|
+
htmlFor={formItemId}
|
|
89
|
+
{...props}
|
|
90
|
+
/>
|
|
91
|
+
);
|
|
103
92
|
}
|
|
104
93
|
|
|
105
94
|
function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
aria-invalid={!!error}
|
|
118
|
-
{...props}
|
|
119
|
-
/>
|
|
120
|
-
)
|
|
95
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Slot
|
|
99
|
+
data-slot="form-control"
|
|
100
|
+
id={formItemId}
|
|
101
|
+
aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}
|
|
102
|
+
aria-invalid={!!error}
|
|
103
|
+
{...props}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
121
106
|
}
|
|
122
107
|
|
|
123
|
-
function FormDescription({ className, ...props }: React.ComponentProps<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
108
|
+
function FormDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
109
|
+
const { formDescriptionId } = useFormField();
|
|
110
|
+
|
|
111
|
+
return (
|
|
112
|
+
<p
|
|
113
|
+
data-slot="form-description"
|
|
114
|
+
id={formDescriptionId}
|
|
115
|
+
className={cn('text-muted-foreground text-sm', className)}
|
|
116
|
+
{...props}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
134
119
|
}
|
|
135
120
|
|
|
136
|
-
function FormMessage({ className, ...props }: React.ComponentProps<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
121
|
+
function FormMessage({ className, ...props }: React.ComponentProps<'p'>) {
|
|
122
|
+
const { error, formMessageId } = useFormField();
|
|
123
|
+
const body = error ? String(error?.message ?? '') : props.children;
|
|
124
|
+
|
|
125
|
+
if (!body) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<p
|
|
131
|
+
data-slot="form-message"
|
|
132
|
+
id={formMessageId}
|
|
133
|
+
className={cn('text-destructive text-sm', className)}
|
|
134
|
+
{...props}
|
|
135
|
+
>
|
|
136
|
+
{body}
|
|
137
|
+
</p>
|
|
138
|
+
);
|
|
154
139
|
}
|
|
155
140
|
|
|
156
|
-
export {
|
|
157
|
-
useFormField,
|
|
158
|
-
Form,
|
|
159
|
-
FormItem,
|
|
160
|
-
FormLabel,
|
|
161
|
-
FormControl,
|
|
162
|
-
FormDescription,
|
|
163
|
-
FormMessage,
|
|
164
|
-
FormField,
|
|
165
|
-
}
|
|
141
|
+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };
|
|
@@ -1,42 +1,36 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
2
|
+
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import { cn } from
|
|
4
|
+
import { cn } from '@/vdb/lib/utils.js';
|
|
5
5
|
|
|
6
|
-
function HoverCard({
|
|
7
|
-
|
|
8
|
-
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
|
|
9
|
-
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
|
|
6
|
+
function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
|
|
7
|
+
return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
|
-
function HoverCardTrigger({
|
|
13
|
-
|
|
14
|
-
}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
|
|
15
|
-
return (
|
|
16
|
-
<HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
|
|
17
|
-
)
|
|
10
|
+
function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
|
|
11
|
+
return <HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />;
|
|
18
12
|
}
|
|
19
13
|
|
|
20
14
|
function HoverCardContent({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
className,
|
|
16
|
+
align = 'center',
|
|
17
|
+
sideOffset = 4,
|
|
18
|
+
...props
|
|
25
19
|
}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
return (
|
|
21
|
+
<HoverCardPrimitive.Portal data-slot="hover-card-portal">
|
|
22
|
+
<HoverCardPrimitive.Content
|
|
23
|
+
data-slot="hover-card-content"
|
|
24
|
+
align={align}
|
|
25
|
+
sideOffset={sideOffset}
|
|
26
|
+
className={cn(
|
|
27
|
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
</HoverCardPrimitive.Portal>
|
|
33
|
+
);
|
|
40
34
|
}
|
|
41
35
|
|
|
42
|
-
export { HoverCard,
|
|
36
|
+
export { HoverCard, HoverCardContent, HoverCardTrigger };
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
|
|
3
|
-
import { cn } from
|
|
3
|
+
import { cn } from '@/vdb/lib/utils.js';
|
|
4
4
|
|
|
5
|
-
function Input({ className, type, ...props }: React.ComponentProps<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
5
|
+
function Input({ className, type, ...props }: React.ComponentProps<'input'>) {
|
|
6
|
+
return (
|
|
7
|
+
<input
|
|
8
|
+
type={type}
|
|
9
|
+
data-slot="input"
|
|
10
|
+
className={cn(
|
|
11
|
+
'border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground aria-invalid:outline-destructive/60 aria-invalid:ring-destructive/20 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60 dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/40 aria-invalid:ring-destructive/20 aria-invalid:border-destructive/60 dark:aria-invalid:border-destructive flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-4 focus-visible:outline-1 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:focus-visible:ring-[3px] aria-invalid:focus-visible:outline-none md:text-sm dark:aria-invalid:focus-visible:ring-4',
|
|
12
|
+
className,
|
|
13
|
+
)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
export { Input }
|
|
19
|
+
export { Input };
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
3
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
|
+
import * as React from 'react';
|
|
5
5
|
|
|
6
|
-
import { cn } from
|
|
6
|
+
import { cn } from '@/vdb/lib/utils.js';
|
|
7
7
|
|
|
8
|
-
function Label({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{...props}
|
|
20
|
-
/>
|
|
21
|
-
)
|
|
8
|
+
function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
9
|
+
return (
|
|
10
|
+
<LabelPrimitive.Root
|
|
11
|
+
data-slot="label"
|
|
12
|
+
className={cn(
|
|
13
|
+
'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
22
19
|
}
|
|
23
20
|
|
|
24
|
-
export { Label }
|
|
21
|
+
export { Label };
|
|
@@ -1,127 +1,106 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
ChevronLeftIcon,
|
|
4
|
-
ChevronRightIcon,
|
|
5
|
-
MoreHorizontalIcon,
|
|
6
|
-
} from "lucide-react"
|
|
1
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
|
|
2
|
+
import * as React from 'react';
|
|
7
3
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { Button, buttonVariants } from '@/vdb/components/ui/button.js';
|
|
5
|
+
import { cn } from '@/vdb/lib/utils.js';
|
|
10
6
|
|
|
11
|
-
function Pagination({ className, ...props }: React.ComponentProps<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
8
|
+
return (
|
|
9
|
+
<nav
|
|
10
|
+
role="navigation"
|
|
11
|
+
aria-label="pagination"
|
|
12
|
+
data-slot="pagination"
|
|
13
|
+
className={cn('mx-auto flex w-full justify-center', className)}
|
|
14
|
+
{...props}
|
|
15
|
+
/>
|
|
16
|
+
);
|
|
21
17
|
}
|
|
22
18
|
|
|
23
|
-
function PaginationContent({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
{...props}
|
|
32
|
-
/>
|
|
33
|
-
)
|
|
19
|
+
function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
|
|
20
|
+
return (
|
|
21
|
+
<ul
|
|
22
|
+
data-slot="pagination-content"
|
|
23
|
+
className={cn('flex flex-row items-center gap-1', className)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
);
|
|
34
27
|
}
|
|
35
28
|
|
|
36
|
-
function PaginationItem({ ...props }: React.ComponentProps<
|
|
37
|
-
|
|
29
|
+
function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
|
|
30
|
+
return <li data-slot="pagination-item" {...props} />;
|
|
38
31
|
}
|
|
39
32
|
|
|
40
33
|
type PaginationLinkProps = {
|
|
41
|
-
|
|
42
|
-
} & Pick<React.ComponentProps<typeof Button>,
|
|
43
|
-
|
|
34
|
+
isActive?: boolean;
|
|
35
|
+
} & Pick<React.ComponentProps<typeof Button>, 'size'> &
|
|
36
|
+
React.ComponentProps<'a'>;
|
|
44
37
|
|
|
45
|
-
function PaginationLink({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
)
|
|
38
|
+
function PaginationLink({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) {
|
|
39
|
+
return (
|
|
40
|
+
<a
|
|
41
|
+
aria-current={isActive ? 'page' : undefined}
|
|
42
|
+
data-slot="pagination-link"
|
|
43
|
+
data-active={isActive}
|
|
44
|
+
className={cn(
|
|
45
|
+
buttonVariants({
|
|
46
|
+
variant: isActive ? 'outline' : 'ghost',
|
|
47
|
+
size,
|
|
48
|
+
}),
|
|
49
|
+
className,
|
|
50
|
+
)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
66
54
|
}
|
|
67
55
|
|
|
68
|
-
function PaginationPrevious({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<span className="hidden sm:block">Previous</span>
|
|
81
|
-
</PaginationLink>
|
|
82
|
-
)
|
|
56
|
+
function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
|
|
57
|
+
return (
|
|
58
|
+
<PaginationLink
|
|
59
|
+
aria-label="Go to previous page"
|
|
60
|
+
size="default"
|
|
61
|
+
className={cn('gap-1 px-2.5 sm:pl-2.5', className)}
|
|
62
|
+
{...props}
|
|
63
|
+
>
|
|
64
|
+
<ChevronLeftIcon />
|
|
65
|
+
<span className="hidden sm:block">Previous</span>
|
|
66
|
+
</PaginationLink>
|
|
67
|
+
);
|
|
83
68
|
}
|
|
84
69
|
|
|
85
|
-
function PaginationNext({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
<ChevronRightIcon />
|
|
98
|
-
</PaginationLink>
|
|
99
|
-
)
|
|
70
|
+
function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>) {
|
|
71
|
+
return (
|
|
72
|
+
<PaginationLink
|
|
73
|
+
aria-label="Go to next page"
|
|
74
|
+
size="default"
|
|
75
|
+
className={cn('gap-1 px-2.5 sm:pr-2.5', className)}
|
|
76
|
+
{...props}
|
|
77
|
+
>
|
|
78
|
+
<span className="hidden sm:block">Next</span>
|
|
79
|
+
<ChevronRightIcon />
|
|
80
|
+
</PaginationLink>
|
|
81
|
+
);
|
|
100
82
|
}
|
|
101
83
|
|
|
102
|
-
function PaginationEllipsis({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
<span className="sr-only">More pages</span>
|
|
115
|
-
</span>
|
|
116
|
-
)
|
|
84
|
+
function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
|
|
85
|
+
return (
|
|
86
|
+
<span
|
|
87
|
+
aria-hidden
|
|
88
|
+
data-slot="pagination-ellipsis"
|
|
89
|
+
className={cn('flex size-9 items-center justify-center', className)}
|
|
90
|
+
{...props}
|
|
91
|
+
>
|
|
92
|
+
<MoreHorizontalIcon className="size-4" />
|
|
93
|
+
<span className="sr-only">More pages</span>
|
|
94
|
+
</span>
|
|
95
|
+
);
|
|
117
96
|
}
|
|
118
97
|
|
|
119
98
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
99
|
+
Pagination,
|
|
100
|
+
PaginationContent,
|
|
101
|
+
PaginationEllipsis,
|
|
102
|
+
PaginationItem,
|
|
103
|
+
PaginationLink,
|
|
104
|
+
PaginationNext,
|
|
105
|
+
PaginationPrevious,
|
|
106
|
+
};
|