@foundrykit/components 2.2.0 → 2.2.1
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/dist/chunk-4WYKNDYY.js +91 -0
- package/dist/chunk-4WYKNDYY.js.map +1 -0
- package/dist/chunk-5CXNMTIN.js +84 -0
- package/dist/chunk-5CXNMTIN.js.map +1 -0
- package/dist/chunk-B5ZTF5MZ.js +203 -0
- package/dist/chunk-B5ZTF5MZ.js.map +1 -0
- package/dist/chunk-EDNWBEKV.js +51 -0
- package/dist/chunk-EDNWBEKV.js.map +1 -0
- package/dist/chunk-ID7BFTID.js +248 -0
- package/dist/chunk-ID7BFTID.js.map +1 -0
- package/dist/chunk-IYBHXVCH.js +181 -0
- package/dist/chunk-IYBHXVCH.js.map +1 -0
- package/dist/chunk-KQZEF7PS.js +71 -0
- package/dist/chunk-KQZEF7PS.js.map +1 -0
- package/dist/chunk-P3GSYR7O.js +889 -0
- package/dist/chunk-P3GSYR7O.js.map +1 -0
- package/dist/chunk-PKSRYDN4.js +168 -0
- package/dist/chunk-PKSRYDN4.js.map +1 -0
- package/dist/chunk-SFM7ZMG2.js +104 -0
- package/dist/chunk-SFM7ZMG2.js.map +1 -0
- package/dist/chunk-TLQQZJUR.js +126 -0
- package/dist/chunk-TLQQZJUR.js.map +1 -0
- package/dist/chunk-UE7CDYEN.js +59 -0
- package/dist/chunk-UE7CDYEN.js.map +1 -0
- package/dist/chunk-UG7YS3D5.js +198 -0
- package/dist/chunk-UG7YS3D5.js.map +1 -0
- package/dist/components/advanced-search-bar/index.d.ts +308 -0
- package/dist/components/advanced-search-bar/index.js +34 -0
- package/dist/components/advanced-search-bar/index.js.map +1 -0
- package/dist/components/calendar/index.d.ts +20 -0
- package/dist/components/calendar/index.js +11 -0
- package/dist/components/calendar/index.js.map +1 -0
- package/dist/components/carousel/index.d.ts +40 -0
- package/dist/components/carousel/index.js +17 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/chart/index.d.ts +59 -0
- package/dist/components/chart/index.js +21 -0
- package/dist/components/chart/index.js.map +1 -0
- package/dist/components/combobox/index.d.ts +33 -0
- package/dist/components/combobox/index.js +10 -0
- package/dist/components/combobox/index.js.map +1 -0
- package/dist/components/command/index.d.ts +33 -0
- package/dist/components/command/index.js +25 -0
- package/dist/components/command/index.js.map +1 -0
- package/dist/components/data-table/index.d.ts +17 -0
- package/dist/components/data-table/index.js +9 -0
- package/dist/components/data-table/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +17 -0
- package/dist/components/date-picker/index.js +9 -0
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/form/index.d.ts +37 -0
- package/dist/components/form/index.js +23 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/input-otp/index.d.ts +30 -0
- package/dist/components/input-otp/index.js +15 -0
- package/dist/components/input-otp/index.js.map +1 -0
- package/dist/components/pagination/index.d.ts +26 -0
- package/dist/components/pagination/index.js +20 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/search-bar/index.d.ts +17 -0
- package/dist/components/search-bar/index.js +9 -0
- package/dist/components/search-bar/index.js.map +1 -0
- package/dist/components/sidebar/index.d.ts +70 -0
- package/dist/components/sidebar/index.js +652 -0
- package/dist/components/sidebar/index.js.map +1 -0
- package/dist/components/theme-toggle/index.d.ts +20 -0
- package/dist/components/theme-toggle/index.js +9 -0
- package/dist/components/theme-toggle/index.js.map +1 -0
- package/dist/index.d.ts +27 -605
- package/dist/index.js +73 -2337
- package/dist/index.js.map +1 -1
- package/package.json +15 -8
- package/CHANGELOG.md +0 -362
- package/src/components/advanced-search-bar/config.ts +0 -223
- package/src/components/advanced-search-bar/index.tsx +0 -1415
- package/src/components/calendar/config.ts +0 -51
- package/src/components/calendar/index.tsx +0 -225
- package/src/components/carousel/config.ts +0 -28
- package/src/components/carousel/index.tsx +0 -258
- package/src/components/chart/config.ts +0 -28
- package/src/components/chart/index.tsx +0 -365
- package/src/components/combobox/config.ts +0 -28
- package/src/components/combobox/index.tsx +0 -111
- package/src/components/command/config.ts +0 -804
- package/src/components/command/index.tsx +0 -195
- package/src/components/data-table/config.ts +0 -28
- package/src/components/data-table/index.tsx +0 -124
- package/src/components/date-picker/config.ts +0 -55
- package/src/components/date-picker/index.tsx +0 -207
- package/src/components/form/config.ts +0 -21
- package/src/components/form/index.tsx +0 -150
- package/src/components/input-otp/config.ts +0 -28
- package/src/components/input-otp/index.tsx +0 -92
- package/src/components/pagination/config.ts +0 -367
- package/src/components/pagination/index.tsx +0 -135
- package/src/components/search-bar/config.ts +0 -58
- package/src/components/search-bar/index.tsx +0 -70
- package/src/components/sidebar/config.ts +0 -29
- package/src/components/sidebar/index.tsx +0 -723
- package/src/components/theme-toggle/config.ts +0 -27
- package/src/components/theme-toggle/index.tsx +0 -63
- package/src/index.ts +0 -83
- package/tsconfig.json +0 -12
- package/tsconfig.lint.json +0 -8
- package/tsup.config.ts +0 -11
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Label } from '@foundrykit/primitives';
|
|
4
|
-
import { cn } from '@foundrykit/utils';
|
|
5
|
-
import type * as LabelPrimitive from '@radix-ui/react-label';
|
|
6
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import {
|
|
9
|
-
Controller,
|
|
10
|
-
type ControllerProps,
|
|
11
|
-
type FieldPath,
|
|
12
|
-
type FieldValues,
|
|
13
|
-
FormProvider,
|
|
14
|
-
} from 'react-hook-form';
|
|
15
|
-
|
|
16
|
-
/** Form context provider — re-export of react-hook-form's `FormProvider`. */
|
|
17
|
-
const Form = FormProvider;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Connects a single field to react-hook-form via a `Controller` and exposes the
|
|
21
|
-
* field name to the surrounding form components through context.
|
|
22
|
-
*/
|
|
23
|
-
const FormField = <
|
|
24
|
-
TFieldValues extends FieldValues = FieldValues,
|
|
25
|
-
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,
|
|
26
|
-
>({
|
|
27
|
-
...props
|
|
28
|
-
}: ControllerProps<TFieldValues, TName>) => {
|
|
29
|
-
return (
|
|
30
|
-
<FormFieldContext.Provider value={{ name: props.name }}>
|
|
31
|
-
<Controller {...props} />
|
|
32
|
-
</FormFieldContext.Provider>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
import {
|
|
37
|
-
FormFieldContext,
|
|
38
|
-
FormItemContext,
|
|
39
|
-
useFormField,
|
|
40
|
-
} from '@foundrykit/hooks';
|
|
41
|
-
|
|
42
|
-
// FormItemContext is now provided by hooks package
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Wrapper for a single form field that generates a unique id shared by its
|
|
46
|
-
* label, control, description, and message for accessible associations.
|
|
47
|
-
*/
|
|
48
|
-
function FormItem({ className, ...props }: React.ComponentProps<'div'>) {
|
|
49
|
-
const id = React.useId();
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<FormItemContext.Provider value={{ id }}>
|
|
53
|
-
<div
|
|
54
|
-
data-slot='form-item'
|
|
55
|
-
className={cn('grid gap-2', className)}
|
|
56
|
-
{...props}
|
|
57
|
-
/>
|
|
58
|
-
</FormItemContext.Provider>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/** Label bound to the field's control; styled as an error when the field is invalid. */
|
|
63
|
-
function FormLabel({
|
|
64
|
-
className,
|
|
65
|
-
...props
|
|
66
|
-
}: React.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
67
|
-
const { error, formItemId } = useFormField();
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<Label
|
|
71
|
-
data-slot='form-label'
|
|
72
|
-
data-error={!!error}
|
|
73
|
-
className={cn('data-[error=true]:text-destructive', className)}
|
|
74
|
-
htmlFor={formItemId}
|
|
75
|
-
{...props}
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Wires the field's control element with the correct `id`, `aria-describedby`,
|
|
82
|
-
* and `aria-invalid` attributes. Render the input as its single child.
|
|
83
|
-
*/
|
|
84
|
-
function FormControl({ ...props }: React.ComponentProps<typeof Slot>) {
|
|
85
|
-
const { error, formItemId, formDescriptionId, formMessageId } =
|
|
86
|
-
useFormField();
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<Slot
|
|
90
|
-
data-slot='form-control'
|
|
91
|
-
id={formItemId}
|
|
92
|
-
aria-describedby={
|
|
93
|
-
!error
|
|
94
|
-
? `${formDescriptionId}`
|
|
95
|
-
: `${formDescriptionId} ${formMessageId}`
|
|
96
|
-
}
|
|
97
|
-
aria-invalid={!!error}
|
|
98
|
-
{...props}
|
|
99
|
-
/>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/** Helper text describing the field, linked to the control via `aria-describedby`. */
|
|
104
|
-
function FormDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
105
|
-
const { formDescriptionId } = useFormField();
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<p
|
|
109
|
-
data-slot='form-description'
|
|
110
|
-
id={formDescriptionId}
|
|
111
|
-
className={cn('text-muted-foreground text-sm', className)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Displays the field's validation error message, or its children when there is
|
|
119
|
-
* no error. Renders nothing when there is no content to show.
|
|
120
|
-
*/
|
|
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
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export {
|
|
142
|
-
Form,
|
|
143
|
-
FormControl,
|
|
144
|
-
FormDescription,
|
|
145
|
-
FormField,
|
|
146
|
-
FormItem,
|
|
147
|
-
FormLabel,
|
|
148
|
-
FormMessage,
|
|
149
|
-
useFormField,
|
|
150
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const InputOTPConfig: ComponentConfig = {
|
|
4
|
-
name: 'Input OTP',
|
|
5
|
-
description:
|
|
6
|
-
'An accessible one-time-password input with individually styled character slots.',
|
|
7
|
-
category: 'components',
|
|
8
|
-
tags: ['otp', 'input', 'form', 'verification', 'accessible'],
|
|
9
|
-
preview: {
|
|
10
|
-
type: 'static',
|
|
11
|
-
html: '<div class="flex items-center gap-2"><div class="flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white text-sm text-gray-600">1</div><div class="flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white text-sm text-gray-600">2</div><div class="flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white text-sm text-gray-600">3</div></div>',
|
|
12
|
-
},
|
|
13
|
-
variants: [
|
|
14
|
-
{
|
|
15
|
-
name: 'Default',
|
|
16
|
-
description: 'Default six-digit OTP input',
|
|
17
|
-
code: '<InputOTP maxLength={6}><InputOTPGroup><InputOTPSlot index={0} /></InputOTPGroup></InputOTP>',
|
|
18
|
-
preview: {
|
|
19
|
-
type: 'component',
|
|
20
|
-
component: 'InputOTP',
|
|
21
|
-
props: {},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
dependencies: ['utils'],
|
|
26
|
-
packageDependencies: ['input-otp', 'lucide-react'],
|
|
27
|
-
files: ['components/input-otp/index.tsx'],
|
|
28
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { cn } from '@foundrykit/utils';
|
|
4
|
-
import { OTPInput, OTPInputContext } from 'input-otp';
|
|
5
|
-
import { MinusIcon } from 'lucide-react';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Accessible one-time-password input with individually styled character slots.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```tsx
|
|
13
|
-
* <InputOTP maxLength={6}>
|
|
14
|
-
* <InputOTPGroup>
|
|
15
|
-
* <InputOTPSlot index={0} />
|
|
16
|
-
* <InputOTPSlot index={1} />
|
|
17
|
-
* </InputOTPGroup>
|
|
18
|
-
* </InputOTP>
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
function InputOTP({
|
|
22
|
-
className,
|
|
23
|
-
containerClassName,
|
|
24
|
-
...props
|
|
25
|
-
}: React.ComponentProps<typeof OTPInput> & {
|
|
26
|
-
containerClassName?: string;
|
|
27
|
-
}) {
|
|
28
|
-
return (
|
|
29
|
-
<OTPInput
|
|
30
|
-
data-slot='input-otp'
|
|
31
|
-
containerClassName={cn(
|
|
32
|
-
'flex items-center gap-2 has-disabled:opacity-50',
|
|
33
|
-
containerClassName
|
|
34
|
-
)}
|
|
35
|
-
className={cn('disabled:cursor-not-allowed', className)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Groups related OTP slots together with a shared border. */
|
|
42
|
-
function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
43
|
-
return (
|
|
44
|
-
<div
|
|
45
|
-
data-slot='input-otp-group'
|
|
46
|
-
className={cn('flex items-center', className)}
|
|
47
|
-
{...props}
|
|
48
|
-
/>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/** A single character slot, driven by the OTP input context. */
|
|
53
|
-
function InputOTPSlot({
|
|
54
|
-
index,
|
|
55
|
-
className,
|
|
56
|
-
...props
|
|
57
|
-
}: React.ComponentProps<'div'> & {
|
|
58
|
-
index: number;
|
|
59
|
-
}) {
|
|
60
|
-
const inputOTPContext = React.useContext(OTPInputContext);
|
|
61
|
-
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div
|
|
65
|
-
data-slot='input-otp-slot'
|
|
66
|
-
data-active={isActive}
|
|
67
|
-
className={cn(
|
|
68
|
-
'data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]',
|
|
69
|
-
className
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
>
|
|
73
|
-
{char}
|
|
74
|
-
{hasFakeCaret && (
|
|
75
|
-
<div className='pointer-events-none absolute inset-0 flex items-center justify-center'>
|
|
76
|
-
<div className='animate-caret-blink bg-foreground h-4 w-px duration-1000' />
|
|
77
|
-
</div>
|
|
78
|
-
)}
|
|
79
|
-
</div>
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** Visual separator rendered between OTP groups. */
|
|
84
|
-
function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>) {
|
|
85
|
-
return (
|
|
86
|
-
<div data-slot='input-otp-separator' role='separator' {...props}>
|
|
87
|
-
<MinusIcon />
|
|
88
|
-
</div>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
|
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
import type { ComponentConfig } from '@foundrykit/types';
|
|
2
|
-
|
|
3
|
-
export const paginationConfig: ComponentConfig = {
|
|
4
|
-
name: 'Pagination',
|
|
5
|
-
description: 'Pagination component for navigating through pages of content',
|
|
6
|
-
category: 'components',
|
|
7
|
-
tags: ['navigation', 'interactive', 'ui'],
|
|
8
|
-
preview: {
|
|
9
|
-
type: 'static',
|
|
10
|
-
html: '<div class="flex h-12 w-full items-center justify-center rounded-md bg-gray-200"><div class="flex items-center space-x-2"><button class="inline-flex items-center justify-center rounded-md text-sm font-medium h-9 px-3 py-2 border border-gray-300 bg-white hover:bg-gray-50">Previous</button><button class="inline-flex items-center justify-center rounded-md text-sm font-medium h-9 w-9 border border-gray-300 bg-white hover:bg-gray-50">1</button><button class="inline-flex items-center justify-center rounded-md text-sm font-medium h-9 w-9 border border-blue-500 bg-blue-500 text-white">2</button><button class="inline-flex items-center justify-center rounded-md text-sm font-medium h-9 w-9 border border-gray-300 bg-white hover:bg-gray-50">3</button><button class="inline-flex items-center justify-center rounded-md text-sm font-medium h-9 px-3 py-2 border border-gray-300 bg-white hover:bg-gray-50">Next</button></div></div>',
|
|
11
|
-
},
|
|
12
|
-
variants: [
|
|
13
|
-
{
|
|
14
|
-
name: 'Default',
|
|
15
|
-
description: 'Basic pagination with page numbers',
|
|
16
|
-
code: `<Pagination>
|
|
17
|
-
<PaginationContent>
|
|
18
|
-
<PaginationItem>
|
|
19
|
-
<PaginationPrevious href="#" />
|
|
20
|
-
</PaginationItem>
|
|
21
|
-
<PaginationItem>
|
|
22
|
-
<PaginationLink href="#" isActive>1</PaginationLink>
|
|
23
|
-
</PaginationItem>
|
|
24
|
-
<PaginationItem>
|
|
25
|
-
<PaginationLink href="#">2</PaginationLink>
|
|
26
|
-
</PaginationItem>
|
|
27
|
-
<PaginationItem>
|
|
28
|
-
<PaginationLink href="#">3</PaginationLink>
|
|
29
|
-
</PaginationItem>
|
|
30
|
-
<PaginationItem>
|
|
31
|
-
<PaginationNext href="#" />
|
|
32
|
-
</PaginationItem>
|
|
33
|
-
</PaginationContent>
|
|
34
|
-
</Pagination>`,
|
|
35
|
-
preview: {
|
|
36
|
-
type: 'component',
|
|
37
|
-
component: 'Pagination',
|
|
38
|
-
props: {
|
|
39
|
-
children: {
|
|
40
|
-
type: 'PaginationContent',
|
|
41
|
-
props: {
|
|
42
|
-
children: [
|
|
43
|
-
{
|
|
44
|
-
type: 'PaginationItem',
|
|
45
|
-
props: {
|
|
46
|
-
children: {
|
|
47
|
-
type: 'PaginationPrevious',
|
|
48
|
-
props: { href: '#' },
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
type: 'PaginationItem',
|
|
54
|
-
props: {
|
|
55
|
-
children: {
|
|
56
|
-
type: 'PaginationLink',
|
|
57
|
-
props: { href: '#', isActive: true, children: '1' },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
type: 'PaginationItem',
|
|
63
|
-
props: {
|
|
64
|
-
children: {
|
|
65
|
-
type: 'PaginationLink',
|
|
66
|
-
props: { href: '#', children: '2' },
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
type: 'PaginationItem',
|
|
72
|
-
props: {
|
|
73
|
-
children: {
|
|
74
|
-
type: 'PaginationLink',
|
|
75
|
-
props: { href: '#', children: '3' },
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
type: 'PaginationItem',
|
|
81
|
-
props: {
|
|
82
|
-
children: { type: 'PaginationNext', props: { href: '#' } },
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'With Ellipsis',
|
|
93
|
-
description: 'Pagination with ellipsis for many pages',
|
|
94
|
-
code: `<Pagination>
|
|
95
|
-
<PaginationContent>
|
|
96
|
-
<PaginationItem>
|
|
97
|
-
<PaginationPrevious href="#" />
|
|
98
|
-
</PaginationItem>
|
|
99
|
-
<PaginationItem>
|
|
100
|
-
<PaginationLink href="#">1</PaginationLink>
|
|
101
|
-
</PaginationItem>
|
|
102
|
-
<PaginationItem>
|
|
103
|
-
<PaginationEllipsis />
|
|
104
|
-
</PaginationItem>
|
|
105
|
-
<PaginationItem>
|
|
106
|
-
<PaginationLink href="#" isActive>4</PaginationLink>
|
|
107
|
-
</PaginationItem>
|
|
108
|
-
<PaginationItem>
|
|
109
|
-
<PaginationLink href="#">5</PaginationLink>
|
|
110
|
-
</PaginationItem>
|
|
111
|
-
<PaginationItem>
|
|
112
|
-
<PaginationEllipsis />
|
|
113
|
-
</PaginationItem>
|
|
114
|
-
<PaginationItem>
|
|
115
|
-
<PaginationLink href="#">10</PaginationLink>
|
|
116
|
-
</PaginationItem>
|
|
117
|
-
<PaginationItem>
|
|
118
|
-
<PaginationNext href="#" />
|
|
119
|
-
</PaginationItem>
|
|
120
|
-
</PaginationContent>
|
|
121
|
-
</Pagination>`,
|
|
122
|
-
preview: {
|
|
123
|
-
type: 'component',
|
|
124
|
-
component: 'Pagination',
|
|
125
|
-
props: {
|
|
126
|
-
children: {
|
|
127
|
-
type: 'PaginationContent',
|
|
128
|
-
props: {
|
|
129
|
-
children: [
|
|
130
|
-
{
|
|
131
|
-
type: 'PaginationItem',
|
|
132
|
-
props: {
|
|
133
|
-
children: {
|
|
134
|
-
type: 'PaginationPrevious',
|
|
135
|
-
props: { href: '#' },
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
type: 'PaginationItem',
|
|
141
|
-
props: {
|
|
142
|
-
children: {
|
|
143
|
-
type: 'PaginationLink',
|
|
144
|
-
props: { href: '#', children: '1' },
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
type: 'PaginationItem',
|
|
150
|
-
props: {
|
|
151
|
-
children: { type: 'PaginationEllipsis', props: {} },
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
type: 'PaginationItem',
|
|
156
|
-
props: {
|
|
157
|
-
children: {
|
|
158
|
-
type: 'PaginationLink',
|
|
159
|
-
props: { href: '#', isActive: true, children: '4' },
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
type: 'PaginationItem',
|
|
165
|
-
props: {
|
|
166
|
-
children: {
|
|
167
|
-
type: 'PaginationLink',
|
|
168
|
-
props: { href: '#', children: '5' },
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
type: 'PaginationItem',
|
|
174
|
-
props: {
|
|
175
|
-
children: { type: 'PaginationEllipsis', props: {} },
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
type: 'PaginationItem',
|
|
180
|
-
props: {
|
|
181
|
-
children: {
|
|
182
|
-
type: 'PaginationLink',
|
|
183
|
-
props: { href: '#', children: '10' },
|
|
184
|
-
},
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
type: 'PaginationItem',
|
|
189
|
-
props: {
|
|
190
|
-
children: { type: 'PaginationNext', props: { href: '#' } },
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
],
|
|
194
|
-
},
|
|
195
|
-
},
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: 'Compact',
|
|
201
|
-
description: 'Compact pagination with smaller buttons',
|
|
202
|
-
code: `<Pagination>
|
|
203
|
-
<PaginationContent>
|
|
204
|
-
<PaginationItem>
|
|
205
|
-
<PaginationPrevious href="#" />
|
|
206
|
-
</PaginationItem>
|
|
207
|
-
<PaginationItem>
|
|
208
|
-
<PaginationLink href="#" size="sm" isActive>1</PaginationLink>
|
|
209
|
-
</PaginationItem>
|
|
210
|
-
<PaginationItem>
|
|
211
|
-
<PaginationLink href="#" size="sm">2</PaginationLink>
|
|
212
|
-
</PaginationItem>
|
|
213
|
-
<PaginationItem>
|
|
214
|
-
<PaginationLink href="#" size="sm">3</PaginationLink>
|
|
215
|
-
</PaginationItem>
|
|
216
|
-
<PaginationItem>
|
|
217
|
-
<PaginationNext href="#" />
|
|
218
|
-
</PaginationItem>
|
|
219
|
-
</PaginationContent>
|
|
220
|
-
</Pagination>`,
|
|
221
|
-
preview: {
|
|
222
|
-
type: 'component',
|
|
223
|
-
component: 'Pagination',
|
|
224
|
-
props: {
|
|
225
|
-
children: {
|
|
226
|
-
type: 'PaginationContent',
|
|
227
|
-
props: {
|
|
228
|
-
children: [
|
|
229
|
-
{
|
|
230
|
-
type: 'PaginationItem',
|
|
231
|
-
props: {
|
|
232
|
-
children: {
|
|
233
|
-
type: 'PaginationPrevious',
|
|
234
|
-
props: { href: '#' },
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
type: 'PaginationItem',
|
|
240
|
-
props: {
|
|
241
|
-
children: {
|
|
242
|
-
type: 'PaginationLink',
|
|
243
|
-
props: {
|
|
244
|
-
href: '#',
|
|
245
|
-
size: 'sm',
|
|
246
|
-
isActive: true,
|
|
247
|
-
children: '1',
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
type: 'PaginationItem',
|
|
254
|
-
props: {
|
|
255
|
-
children: {
|
|
256
|
-
type: 'PaginationLink',
|
|
257
|
-
props: { href: '#', size: 'sm', children: '2' },
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
type: 'PaginationItem',
|
|
263
|
-
props: {
|
|
264
|
-
children: {
|
|
265
|
-
type: 'PaginationLink',
|
|
266
|
-
props: { href: '#', size: 'sm', children: '3' },
|
|
267
|
-
},
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
type: 'PaginationItem',
|
|
272
|
-
props: {
|
|
273
|
-
children: { type: 'PaginationNext', props: { href: '#' } },
|
|
274
|
-
},
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
},
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
name: 'Disabled States',
|
|
284
|
-
description: 'Pagination with disabled previous/next buttons',
|
|
285
|
-
code: `<Pagination>
|
|
286
|
-
<PaginationContent>
|
|
287
|
-
<PaginationItem>
|
|
288
|
-
<PaginationPrevious href="#" className="pointer-events-none opacity-50" />
|
|
289
|
-
</PaginationItem>
|
|
290
|
-
<PaginationItem>
|
|
291
|
-
<PaginationLink href="#" isActive>1</PaginationLink>
|
|
292
|
-
</PaginationItem>
|
|
293
|
-
<PaginationItem>
|
|
294
|
-
<PaginationLink href="#">2</PaginationLink>
|
|
295
|
-
</PaginationItem>
|
|
296
|
-
<PaginationItem>
|
|
297
|
-
<PaginationLink href="#">3</PaginationLink>
|
|
298
|
-
</PaginationItem>
|
|
299
|
-
<PaginationItem>
|
|
300
|
-
<PaginationNext href="#" />
|
|
301
|
-
</PaginationItem>
|
|
302
|
-
</PaginationContent>
|
|
303
|
-
</Pagination>`,
|
|
304
|
-
preview: {
|
|
305
|
-
type: 'component',
|
|
306
|
-
component: 'Pagination',
|
|
307
|
-
props: {
|
|
308
|
-
children: {
|
|
309
|
-
type: 'PaginationContent',
|
|
310
|
-
props: {
|
|
311
|
-
children: [
|
|
312
|
-
{
|
|
313
|
-
type: 'PaginationItem',
|
|
314
|
-
props: {
|
|
315
|
-
children: {
|
|
316
|
-
type: 'PaginationPrevious',
|
|
317
|
-
props: {
|
|
318
|
-
href: '#',
|
|
319
|
-
className: 'pointer-events-none opacity-50',
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
type: 'PaginationItem',
|
|
326
|
-
props: {
|
|
327
|
-
children: {
|
|
328
|
-
type: 'PaginationLink',
|
|
329
|
-
props: { href: '#', isActive: true, children: '1' },
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
type: 'PaginationItem',
|
|
335
|
-
props: {
|
|
336
|
-
children: {
|
|
337
|
-
type: 'PaginationLink',
|
|
338
|
-
props: { href: '#', children: '2' },
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
type: 'PaginationItem',
|
|
344
|
-
props: {
|
|
345
|
-
children: {
|
|
346
|
-
type: 'PaginationLink',
|
|
347
|
-
props: { href: '#', children: '3' },
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
type: 'PaginationItem',
|
|
353
|
-
props: {
|
|
354
|
-
children: { type: 'PaginationNext', props: { href: '#' } },
|
|
355
|
-
},
|
|
356
|
-
},
|
|
357
|
-
],
|
|
358
|
-
},
|
|
359
|
-
},
|
|
360
|
-
},
|
|
361
|
-
},
|
|
362
|
-
},
|
|
363
|
-
],
|
|
364
|
-
dependencies: ['utils', 'button'],
|
|
365
|
-
packageDependencies: ['lucide-react'],
|
|
366
|
-
files: ['components/pagination/index.tsx'],
|
|
367
|
-
};
|