@catalystsoftware/ui 1.0.5 → 1.0.6

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.
Files changed (155) hide show
  1. package/dist/data/data.tsx +29 -29
  2. package/dist/data/tailwind.config.js +3821 -261
  3. package/dist/data.tsx +29 -29
  4. package/package.json +4 -3
  5. package/components/catalyst-ui/buttons/burger.tsx +0 -207
  6. package/components/catalyst-ui/core/data-display/timeline.tsx +0 -210
  7. package/components/catalyst-ui/core/feedback/alert.tsx +0 -491
  8. package/components/catalyst-ui/core/feedback/spinner-1.tsx +0 -65
  9. package/components/catalyst-ui/core/feedback/toast.tsx +0 -1857
  10. package/components/catalyst-ui/core/navigation/menu.tsx +0 -164
  11. package/components/catalyst-ui/forms/toggle-class.tsx +0 -176
  12. package/components/catalyst-ui/hooks/use-copy-to-clipboard.tsx +0 -419
  13. package/components/catalyst-ui/hooks/use-counter.tsx +0 -13
  14. package/components/catalyst-ui/hooks/use-event-listener.tsx +0 -23
  15. package/components/catalyst-ui/hooks/use-export-markdown.tsx +0 -47
  16. package/components/catalyst-ui/hooks/use-focus.tsx +0 -17
  17. package/components/catalyst-ui/hooks/use-interval.tsx +0 -23
  18. package/components/catalyst-ui/hooks/use-is-client.tsx +0 -16
  19. package/components/catalyst-ui/hooks/use-media-query.tsx +0 -19
  20. package/components/catalyst-ui/hooks/use-mobile.tsx +0 -19
  21. package/components/catalyst-ui/hooks/use-resize-observer.tsx +0 -81
  22. package/components/catalyst-ui/hooks/use-timeout.tsx +0 -21
  23. package/components/catalyst-ui/hooks/use-timer.tsx +0 -209
  24. package/components/catalyst-ui/hooks/use-toggle.tsx +0 -12
  25. package/components/catalyst-ui/media/image.tsx +0 -13
  26. package/components/catalyst-ui/overlays/dual-sidebar.tsx +0 -4142
  27. package/components/catalyst-ui/overlays/sidebar-original.tsx +0 -726
  28. package/components/catalyst-ui/primitives/accordion.tsx +0 -250
  29. package/components/catalyst-ui/primitives/alert-dialog.tsx +0 -126
  30. package/components/catalyst-ui/primitives/aspect-ratio.tsx +0 -9
  31. package/components/catalyst-ui/primitives/avatar.tsx +0 -296
  32. package/components/catalyst-ui/primitives/badge.tsx +0 -57
  33. package/components/catalyst-ui/primitives/breadcrumb.tsx +0 -101
  34. package/components/catalyst-ui/primitives/button.tsx +0 -265
  35. package/components/catalyst-ui/primitives/calendar-v4.tsx +0 -208
  36. package/components/catalyst-ui/primitives/calendar.tsx +0 -295
  37. package/components/catalyst-ui/primitives/card.tsx +0 -618
  38. package/components/catalyst-ui/primitives/carousel.tsx +0 -238
  39. package/components/catalyst-ui/primitives/chart.tsx +0 -347
  40. package/components/catalyst-ui/primitives/checkbox.tsx +0 -225
  41. package/components/catalyst-ui/primitives/collapsible.tsx +0 -212
  42. package/components/catalyst-ui/primitives/command.tsx +0 -393
  43. package/components/catalyst-ui/primitives/context-menu.tsx +0 -236
  44. package/components/catalyst-ui/primitives/dialog.tsx +0 -471
  45. package/components/catalyst-ui/primitives/drawer.tsx +0 -761
  46. package/components/catalyst-ui/primitives/dropdown-menu.tsx +0 -290
  47. package/components/catalyst-ui/primitives/empty.tsx +0 -104
  48. package/components/catalyst-ui/primitives/field.tsx +0 -244
  49. package/components/catalyst-ui/primitives/hover-card.tsx +0 -124
  50. package/components/catalyst-ui/primitives/input-otp.tsx +0 -76
  51. package/components/catalyst-ui/primitives/input.tsx +0 -64
  52. package/components/catalyst-ui/primitives/item.tsx +0 -196
  53. package/components/catalyst-ui/primitives/kbd.tsx +0 -75
  54. package/components/catalyst-ui/primitives/label.tsx +0 -24
  55. package/components/catalyst-ui/primitives/navigation-menu.tsx +0 -150
  56. package/components/catalyst-ui/primitives/pagination.tsx +0 -198
  57. package/components/catalyst-ui/primitives/popover.tsx +0 -232
  58. package/components/catalyst-ui/primitives/progress.tsx +0 -34
  59. package/components/catalyst-ui/primitives/radio-group.tsx +0 -43
  60. package/components/catalyst-ui/primitives/resizable.tsx +0 -56
  61. package/components/catalyst-ui/primitives/select.tsx +0 -155
  62. package/components/catalyst-ui/primitives/separator.tsx +0 -74
  63. package/components/catalyst-ui/primitives/sheet.tsx +0 -126
  64. package/components/catalyst-ui/primitives/skeleton.tsx +0 -15
  65. package/components/catalyst-ui/primitives/slider.tsx +0 -27
  66. package/components/catalyst-ui/primitives/switch.tsx +0 -187
  67. package/components/catalyst-ui/primitives/tabs.tsx +0 -335
  68. package/components/catalyst-ui/primitives/textarea.tsx +0 -24
  69. package/components/catalyst-ui/primitives/toggle-group.tsx +0 -55
  70. package/components/catalyst-ui/primitives/toggle.tsx +0 -42
  71. package/components/catalyst-ui/primitives/tooltip.tsx +0 -116
  72. package/components/catalyst-ui/utils/basic-auth.tsx +0 -40
  73. package/components/catalyst-ui/utils/context-storage.tsx +0 -19
  74. package/components/catalyst-ui/utils/cors-middleware.tsx +0 -71
  75. package/components/catalyst-ui/utils/deferred-content.tsx +0 -595
  76. package/components/catalyst-ui/utils/honeypot-middleware.tsx +0 -38
  77. package/components/catalyst-ui/utils/incId.tsx +0 -75
  78. package/components/catalyst-ui/utils/jwk-auth.tsx +0 -36
  79. package/components/catalyst-ui/utils/request-id.tsx +0 -14
  80. package/components/catalyst-ui/utils/secure-headers.tsx +0 -37
  81. package/components/catalyst-ui/utils/server-timing.tsx +0 -23
  82. package/components/catalyst-ui/utils/utils.ts +0 -43
  83. package/components/catalyst-ui/utils/with-cookie.tsx +0 -43
  84. package/components/catalyst-ui/x/accordian-x.tsx +0 -428
  85. package/components/catalyst-ui/x/alert-x.tsx +0 -413
  86. package/components/catalyst-ui/x/animated-text-x.tsx +0 -2242
  87. package/components/catalyst-ui/x/avatar-x.tsx +0 -515
  88. package/components/catalyst-ui/x/badge-x.tsx +0 -670
  89. package/components/catalyst-ui/x/button-X.tsx +0 -2857
  90. package/components/catalyst-ui/x/button-group-x.tsx +0 -847
  91. package/components/catalyst-ui/x/calendar-x.tsx +0 -1910
  92. package/components/catalyst-ui/x/card-x.tsx +0 -2597
  93. package/components/catalyst-ui/x/checkbox-x.tsx +0 -656
  94. package/components/catalyst-ui/x/collapsible-x.tsx +0 -1360
  95. package/components/catalyst-ui/x/combobox-x.tsx +0 -911
  96. package/components/catalyst-ui/x/data-table-x.tsx +0 -1753
  97. package/components/catalyst-ui/x/date-picker-x.tsx +0 -648
  98. package/components/catalyst-ui/x/dialog-x.tsx +0 -659
  99. package/components/catalyst-ui/x/dropdown-menu-x.tsx +0 -612
  100. package/components/catalyst-ui/x/hover-card-x.tsx +0 -375
  101. package/components/catalyst-ui/x/icon-x.tsx +0 -840
  102. package/components/catalyst-ui/x/input-mask-x.tsx +0 -981
  103. package/components/catalyst-ui/x/input-otp-x.tsx +0 -659
  104. package/components/catalyst-ui/x/loader-x.tsx +0 -1757
  105. package/components/catalyst-ui/x/pagination-x.tsx +0 -622
  106. package/components/catalyst-ui/x/popover-x.tsx +0 -744
  107. package/components/catalyst-ui/x/radio-group-x.tsx +0 -499
  108. package/components/catalyst-ui/x/select-x.tsx +0 -1127
  109. package/components/catalyst-ui/x/sheet-x.tsx +0 -668
  110. package/components/catalyst-ui/x/switch-x.tsx +0 -681
  111. package/components/catalyst-ui/x/table-x.tsx +0 -574
  112. package/components/catalyst-ui/x/tabs-x.tsx +0 -839
  113. package/components/catalyst-ui/x/textarea-x.tsx +0 -1263
  114. package/components/catalyst-ui/x/tooltip-x.tsx +0 -396
  115. package/components/catalyst-ui/x/tracker-x.tsx +0 -560
  116. package/data/bg-data.tsx +0 -901
  117. package/data/buttons-data.tsx +0 -2327
  118. package/data/charts-data.tsx +0 -102
  119. package/data/chat-data.tsx +0 -83
  120. package/data/code-data.tsx +0 -1040
  121. package/data/comboboxes-data.tsx +0 -1843
  122. package/data/command-data.tsx +0 -1381
  123. package/data/core-data.tsx +0 -15953
  124. package/data/crm-data.tsx +0 -47
  125. package/data/data.tsx +0 -159
  126. package/data/date-and-time-data.tsx +0 -554
  127. package/data/dependencies.tsx +0 -7
  128. package/data/ecommerce-data.tsx +0 -1387
  129. package/data/forms-data.tsx +0 -7890
  130. package/data/hooks-data.tsx +0 -5487
  131. package/data/index.ts +0 -34
  132. package/data/inputs-data.tsx +0 -557
  133. package/data/interactive-data.tsx +0 -5394
  134. package/data/lofi-data.tsx +0 -18295
  135. package/data/marketing-data.tsx +0 -2546
  136. package/data/media-data.tsx +0 -1510
  137. package/data/motion-data.tsx +0 -5801
  138. package/data/overlay-data.tsx +0 -4136
  139. package/data/pdf-data.tsx +0 -124
  140. package/data/pos-data.tsx +0 -213
  141. package/data/postcss.config.js +0 -6
  142. package/data/primitive-data.tsx +0 -5170
  143. package/data/prompt-data.tsx +0 -1226
  144. package/data/requiredLibs.ts +0 -4
  145. package/data/sandbox-data.tsx +0 -1
  146. package/data/sidebars-data.tsx +0 -5421
  147. package/data/stacks-data.tsx +0 -32
  148. package/data/table-data.tsx +0 -706
  149. package/data/tailwind.config.js +0 -270
  150. package/data/tailwind.config.ngin.js +0 -3830
  151. package/data/tailwind.css +0 -431
  152. package/data/tools-data.tsx +0 -6910
  153. package/data/typography-data.tsx +0 -2050
  154. package/data/utils-data.tsx +0 -6500
  155. package/data/x-data.tsx +0 -1171
@@ -1,622 +0,0 @@
1
- 'use client'
2
-
3
- import React, { useId } from 'react'
4
- import { ChevronLeft, ChevronRight, ChevronFirst, ChevronLast } from 'lucide-react'
5
- import { cn } from "~/components/catalyst-ui"
6
- import {
7
- Pagination,
8
- PaginationContent,
9
- PaginationItem,
10
- PaginationLink,
11
- PaginationPrevious,
12
- PaginationNext,
13
- PaginationEllipsis
14
- } from "~/components/catalyst-ui"
15
- import { Button, buttonVariants } from "~/components/catalyst-ui"
16
- import { Label } from "~/components/catalyst-ui"
17
- import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "~/components/catalyst-ui"
18
- import { Tooltip, TooltipContent, TooltipTrigger } from "~/components/catalyst-ui"
19
-
20
- // #region PARENT FUNCTION
21
- export function PaginationX({ pagination = 'default', ...props }: any) {
22
- switch (pagination) {
23
- case 'WithIcon':
24
- return <WithIcon {...props} />
25
- case 'PrimaryButton':
26
- return <PrimaryButton {...props} />
27
- case 'SecondaryButton':
28
- return <SecondaryButton {...props} />
29
- case 'Bordered':
30
- return <Bordered {...props} />
31
- case 'Rounded':
32
- return <Rounded {...props} />
33
- case 'FirstLast':
34
- return <FirstLast {...props} />
35
- case 'WithEllipsis':
36
- return <WithEllipsis {...props} />
37
- case 'Underline':
38
- return <Underline {...props} />
39
- case 'Card':
40
- return <Card {...props} />
41
- case 'Numberless':
42
- return <Numberless {...props} />
43
- case 'NumberlessWithText':
44
- return <NumberlessWithText {...props} />
45
- case 'Mini':
46
- return <Mini {...props} />
47
- case 'WithSelect':
48
- return <WithSelect {...props} />
49
- case 'Table':
50
- return <Table {...props} />
51
- default:
52
- return <DefaultPagination {...props} />
53
- }
54
- }
55
- // #endregion
56
-
57
- // #region SUPPORTING FUNCTIONS
58
- const DefaultPagination = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
59
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
60
-
61
- return (
62
- <Pagination className={className} {...props}>
63
- <PaginationContent>
64
- <PaginationItem>
65
- <PaginationPrevious href='#' />
66
- </PaginationItem>
67
- {pages.map(page => (
68
- <PaginationItem key={page}>
69
- <PaginationLink href={`#${page}`} isActive={page === currentPage}>
70
- {page}
71
- </PaginationLink>
72
- </PaginationItem>
73
- ))}
74
- <PaginationItem>
75
- <PaginationNext href='#' />
76
- </PaginationItem>
77
- </PaginationContent>
78
- </Pagination>
79
- )
80
- }
81
-
82
- const WithIcon = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
83
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
84
-
85
- return (
86
- <Pagination className={className} {...props}>
87
- <PaginationContent>
88
- <PaginationItem>
89
- <PaginationLink href='#' aria-label='Go to previous page' size='icon'>
90
- <ChevronLeft className='size-4' />
91
- </PaginationLink>
92
- </PaginationItem>
93
- {pages.map(page => (
94
- <PaginationItem key={page}>
95
- <PaginationLink href={`#${page}`} isActive={page === currentPage}>
96
- {page}
97
- </PaginationLink>
98
- </PaginationItem>
99
- ))}
100
- <PaginationItem>
101
- <PaginationLink href='#' aria-label='Go to next page' size='icon'>
102
- <ChevronRight className='size-4' />
103
- </PaginationLink>
104
- </PaginationItem>
105
- </PaginationContent>
106
- </Pagination>
107
- )
108
- }
109
-
110
- const PrimaryButton = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
111
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
112
-
113
- return (
114
- <Pagination className={className} {...props}>
115
- <PaginationContent>
116
- <PaginationItem>
117
- <PaginationPrevious href='#' />
118
- </PaginationItem>
119
- {pages.map(page => (
120
- <PaginationItem key={page}>
121
- <PaginationLink
122
- href={`#${page}`}
123
- isActive={page === currentPage}
124
- className={cn(
125
- page === currentPage && buttonVariants({
126
- variant: 'default',
127
- size: 'icon'
128
- }),
129
- page === currentPage && 'hover:!text-primary-foreground dark:bg-primary dark:text-primary-foreground dark:hover:text-primary-foreground dark:hover:bg-primary/90 !shadow-none dark:border-transparent'
130
- )}
131
- >
132
- {page}
133
- </PaginationLink>
134
- </PaginationItem>
135
- ))}
136
- <PaginationItem>
137
- <PaginationNext href='#' />
138
- </PaginationItem>
139
- </PaginationContent>
140
- </Pagination>
141
- )
142
- }
143
-
144
- const SecondaryButton = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
145
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
146
-
147
- return (
148
- <Pagination className={className} {...props}>
149
- <PaginationContent>
150
- <PaginationItem>
151
- <PaginationPrevious href='#' />
152
- </PaginationItem>
153
- {pages.map(page => (
154
- <PaginationItem key={page}>
155
- <PaginationLink
156
- href={`#${page}`}
157
- isActive={page === currentPage}
158
- className={cn(
159
- page === currentPage && 'hover:!text-secondary-foreground !border-none !shadow-none',
160
- page === currentPage && buttonVariants({
161
- variant: 'secondary',
162
- size: 'icon'
163
- })
164
- )}
165
- >
166
- {page}
167
- </PaginationLink>
168
- </PaginationItem>
169
- ))}
170
- <PaginationItem>
171
- <PaginationNext href='#' />
172
- </PaginationItem>
173
- </PaginationContent>
174
- </Pagination>
175
- )
176
- }
177
-
178
- const Bordered = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
179
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
180
-
181
- return (
182
- <Pagination className={className} {...props}>
183
- <PaginationContent className='gap-0 divide-x overflow-hidden rounded-lg border'>
184
- <PaginationItem>
185
- <PaginationPrevious href='#' className='rounded-none' />
186
- </PaginationItem>
187
- {pages.map(page => {
188
- const isActive = page === currentPage
189
- return (
190
- <PaginationItem key={page}>
191
- <PaginationLink
192
- href={`#${page}`}
193
- className={cn(
194
- {
195
- [buttonVariants({
196
- variant: 'default',
197
- className: 'hover:!text-primary-foreground dark:bg-primary dark:text-primary-foreground dark:hover:text-primary-foreground dark:hover:bg-primary/90 dark:border-transparent'
198
- })]: isActive
199
- },
200
- 'rounded-none border-none'
201
- )}
202
- isActive={isActive}
203
- >
204
- {page}
205
- </PaginationLink>
206
- </PaginationItem>
207
- )
208
- })}
209
- <PaginationItem>
210
- <PaginationNext href='#' className='rounded-none' />
211
- </PaginationItem>
212
- </PaginationContent>
213
- </Pagination>
214
- )
215
- }
216
-
217
- const Rounded = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
218
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
219
-
220
- return (
221
- <Pagination className={className} {...props}>
222
- <PaginationContent>
223
- <PaginationItem>
224
- <PaginationPrevious href='#' className='rounded-full' />
225
- </PaginationItem>
226
- {pages.map(page => (
227
- <PaginationItem key={page}>
228
- <PaginationLink href={`#${page}`} isActive={page === currentPage} className='rounded-full'>
229
- {page}
230
- </PaginationLink>
231
- </PaginationItem>
232
- ))}
233
- <PaginationItem>
234
- <PaginationNext href='#' className='rounded-full' />
235
- </PaginationItem>
236
- </PaginationContent>
237
- </Pagination>
238
- )
239
- }
240
-
241
- const FirstLast = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
242
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
243
-
244
- return (
245
- <Pagination className={className} {...props}>
246
- <PaginationContent>
247
- <PaginationItem>
248
- <PaginationLink href='#' aria-label='Go to first page' size='icon' className='rounded-full'>
249
- <ChevronFirst className='size-4' />
250
- </PaginationLink>
251
- </PaginationItem>
252
- <PaginationItem>
253
- <PaginationLink href='#' aria-label='Go to previous page' size='icon' className='rounded-full'>
254
- <ChevronLeft className='size-4' />
255
- </PaginationLink>
256
- </PaginationItem>
257
- {pages.map(page => (
258
- <PaginationItem key={page}>
259
- <PaginationLink href={`#${page}`} isActive={page === currentPage} className='rounded-full'>
260
- {page}
261
- </PaginationLink>
262
- </PaginationItem>
263
- ))}
264
- <PaginationItem>
265
- <PaginationLink href='#' aria-label='Go to next page' size='icon' className='rounded-full'>
266
- <ChevronRight className='size-4' />
267
- </PaginationLink>
268
- </PaginationItem>
269
- <PaginationItem>
270
- <PaginationLink href='#' aria-label='Go to last page' size='icon' className='rounded-full'>
271
- <ChevronLast className='size-4' />
272
- </PaginationLink>
273
- </PaginationItem>
274
- </PaginationContent>
275
- </Pagination>
276
- )
277
- }
278
-
279
- const WithEllipsis = ({ currentPage = 2, className, ...props }: any) => {
280
- return (
281
- <Pagination className={className} {...props}>
282
- <PaginationContent>
283
- <PaginationItem>
284
- <PaginationPrevious href='#' />
285
- </PaginationItem>
286
- <PaginationItem>
287
- <PaginationLink href='#'>1</PaginationLink>
288
- </PaginationItem>
289
- <PaginationItem>
290
- <PaginationLink href='#' isActive={currentPage === 2}>
291
- 2
292
- </PaginationLink>
293
- </PaginationItem>
294
- <PaginationItem>
295
- <Tooltip>
296
- <TooltipTrigger asChild>
297
- <PaginationEllipsis />
298
- </TooltipTrigger>
299
- <TooltipContent>
300
- <p>8 other pages</p>
301
- </TooltipContent>
302
- </Tooltip>
303
- </PaginationItem>
304
- <PaginationItem>
305
- <PaginationNext href='#' />
306
- </PaginationItem>
307
- </PaginationContent>
308
- </Pagination>
309
- )
310
- }
311
-
312
- const Underline = ({ currentPage = 1, totalPages = 3, className, ...props }: any) => {
313
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
314
-
315
- return (
316
- <Pagination className={className} {...props}>
317
- <PaginationContent>
318
- <PaginationItem>
319
- <PaginationPrevious href='#' className='rounded-none' />
320
- </PaginationItem>
321
- {pages.map(page => (
322
- <PaginationItem key={page}>
323
- <PaginationLink
324
- href={`#${page}`}
325
- isActive={page === currentPage}
326
- className={cn(
327
- 'rounded-none',
328
- page === currentPage && 'border-primary! border-0 border-b-2 bg-transparent! !shadow-none'
329
- )}
330
- >
331
- {page}
332
- </PaginationLink>
333
- </PaginationItem>
334
- ))}
335
- <PaginationItem>
336
- <PaginationNext href='#' className='rounded-none' />
337
- </PaginationItem>
338
- </PaginationContent>
339
- </Pagination>
340
- )
341
- }
342
-
343
- const Card = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
344
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
345
-
346
- return (
347
- <Pagination className={className} {...props}>
348
- <PaginationContent className='rounded-md border p-1 shadow-xs'>
349
- <PaginationItem>
350
- <PaginationPrevious href='#' />
351
- </PaginationItem>
352
- {pages.map(page => (
353
- <PaginationItem key={page}>
354
- <PaginationLink href={`#${page}`} isActive={page === currentPage}>
355
- {page}
356
- </PaginationLink>
357
- </PaginationItem>
358
- ))}
359
- <PaginationItem>
360
- <PaginationNext href='#' />
361
- </PaginationItem>
362
- </PaginationContent>
363
- </Pagination>
364
- )
365
- }
366
-
367
- const Numberless = ({ className, ...props }: any) => {
368
- return (
369
- <Pagination className={className} {...props}>
370
- <PaginationContent className='w-full justify-between'>
371
- <PaginationItem>
372
- <PaginationPrevious href='#' className='border' />
373
- </PaginationItem>
374
- <PaginationItem>
375
- <PaginationNext href='#' className='border' />
376
- </PaginationItem>
377
- </PaginationContent>
378
- </Pagination>
379
- )
380
- }
381
-
382
- const NumberlessWithText = ({ currentPage = 2, totalPages = 5, className, ...props }: any) => {
383
- return (
384
- <Pagination className={className} {...props}>
385
- <PaginationContent className='w-full justify-between'>
386
- <PaginationItem>
387
- <PaginationPrevious href='#' className='border' />
388
- </PaginationItem>
389
- <PaginationItem>
390
- <p className='text-muted-foreground text-sm' aria-live='polite'>
391
- Page <span className='text-foreground'>{currentPage}</span> of <span className='text-foreground'>{totalPages}</span>
392
- </p>
393
- </PaginationItem>
394
- <PaginationItem>
395
- <PaginationNext href='#' className='border' />
396
- </PaginationItem>
397
- </PaginationContent>
398
- </Pagination>
399
- )
400
- }
401
-
402
- const Mini = ({ currentPage = 2, totalPages = 5, className, ...props }: any) => {
403
- return (
404
- <Pagination className={className} {...props}>
405
- <PaginationContent>
406
- <PaginationItem>
407
- <PaginationLink href='#' aria-label='Go to previous page' size='icon'>
408
- <ChevronLeft className='size-4' />
409
- </PaginationLink>
410
- </PaginationItem>
411
- <PaginationItem>
412
- <p className='text-muted-foreground text-sm' aria-live='polite'>
413
- Page <span className='text-foreground'>{currentPage}</span> of <span className='text-foreground'>{totalPages}</span>
414
- </p>
415
- </PaginationItem>
416
- <PaginationItem>
417
- <PaginationLink href='#' aria-label='Go to next page' size='icon'>
418
- <ChevronRight className='size-4' />
419
- </PaginationLink>
420
- </PaginationItem>
421
- </PaginationContent>
422
- </Pagination>
423
- )
424
- }
425
-
426
- const WithSelect = ({ className, ...props }: any) => {
427
- return (
428
- <Pagination className={className} {...props}>
429
- <PaginationContent>
430
- <PaginationItem>
431
- <PaginationLink href='#' aria-label='Go to first page' size='icon' className='rounded-full'>
432
- <ChevronFirst className='size-4' />
433
- </PaginationLink>
434
- </PaginationItem>
435
- <PaginationItem>
436
- <PaginationLink href='#' aria-label='Go to previous page' size='icon' className='rounded-full'>
437
- <ChevronLeft className='size-4' />
438
- </PaginationLink>
439
- </PaginationItem>
440
- <PaginationItem>
441
- <Select defaultValue={String(1)} aria-label='Select page'>
442
- <SelectTrigger id='select-page' className='w-fit whitespace-nowrap' aria-label='Select page'>
443
- <SelectValue placeholder='Select page' />
444
- </SelectTrigger>
445
- <SelectContent>
446
- {Array.from({ length: 10 }, (_, i) => i + 1).map(page => (
447
- <SelectItem key={page} value={String(page)}>
448
- Page {page}
449
- </SelectItem>
450
- ))}
451
- </SelectContent>
452
- </Select>
453
- </PaginationItem>
454
- <PaginationItem>
455
- <PaginationLink href='#' aria-label='Go to next page' size='icon' className='rounded-full'>
456
- <ChevronRight className='size-4' />
457
- </PaginationLink>
458
- </PaginationItem>
459
- <PaginationItem>
460
- <PaginationLink href='#' aria-label='Go to last page' size='icon' className='rounded-full'>
461
- <ChevronLast className='size-4' />
462
- </PaginationLink>
463
- </PaginationItem>
464
- </PaginationContent>
465
- </Pagination>
466
- )
467
- }
468
-
469
- const Table = ({ currentPage = 2, totalPages = 3, className, ...props }: any) => {
470
- const id = useId()
471
- const pages = Array.from({ length: totalPages }, (_, i) => i + 1)
472
-
473
- return (
474
- <div className='flex w-full flex-wrap items-center justify-between gap-6 max-sm:justify-center'>
475
- <div className='flex shrink-0 items-center gap-3'>
476
- <Label htmlFor={id}>Rows per page</Label>
477
- <Select defaultValue='10'>
478
- <SelectTrigger id={id} className='w-fit whitespace-nowrap'>
479
- <SelectValue placeholder='Select number of results' />
480
- </SelectTrigger>
481
- <SelectContent className='[&_*[role=option]]:pr-8 [&_*[role=option]]:pl-2 [&_*[role=option]>span]:right-2 [&_*[role=option]>span]:left-auto'>
482
- <SelectItem value='10'>10</SelectItem>
483
- <SelectItem value='25'>25</SelectItem>
484
- <SelectItem value='50'>50</SelectItem>
485
- </SelectContent>
486
- </Select>
487
- </div>
488
- <div className='text-muted-foreground flex grow items-center justify-end whitespace-nowrap max-sm:justify-center'>
489
- <p className='text-muted-foreground text-sm whitespace-nowrap' aria-live='polite'>
490
- Showing <span className='text-foreground'>1</span> to <span className='text-foreground'>10</span> of{' '}
491
- <span className='text-foreground'>100</span> products
492
- </p>
493
- </div>
494
- <Pagination className='w-fit max-sm:mx-0'>
495
- <PaginationContent>
496
- <PaginationItem>
497
- <PaginationLink href='#' aria-label='Go to first page' size='icon' className='rounded-full'>
498
- <ChevronFirst className='size-4' />
499
- </PaginationLink>
500
- </PaginationItem>
501
- <PaginationItem>
502
- <PaginationLink href='#' aria-label='Go to previous page' size='icon' className='rounded-full'>
503
- <ChevronLeft className='size-4' />
504
- </PaginationLink>
505
- </PaginationItem>
506
- {pages.map(page => (
507
- <PaginationItem key={page}>
508
- <PaginationLink href={`#${page}`} isActive={page === currentPage} className='rounded-full'>
509
- {page}
510
- </PaginationLink>
511
- </PaginationItem>
512
- ))}
513
- <PaginationItem>
514
- <Tooltip>
515
- <TooltipTrigger asChild>
516
- <PaginationEllipsis />
517
- </TooltipTrigger>
518
- <TooltipContent>
519
- <p>2 other pages</p>
520
- </TooltipContent>
521
- </Tooltip>
522
- </PaginationItem>
523
- <PaginationItem>
524
- <PaginationLink href='#' aria-label='Go to next page' size='icon' className='rounded-full'>
525
- <ChevronRight className='size-4' />
526
- </PaginationLink>
527
- </PaginationItem>
528
- <PaginationItem>
529
- <PaginationLink href='#' aria-label='Go to last page' size='icon' className='rounded-full'>
530
- <ChevronLast className='size-4' />
531
- </PaginationLink>
532
- </PaginationItem>
533
- </PaginationContent>
534
- </Pagination>
535
- </div>
536
- )
537
- }
538
- // #endregion
539
-
540
- // #region DEMO
541
- export function PaginationXDemo() {
542
- return (
543
- <div className='space-y-12 p-6 max-w-4xl mx-auto'>
544
- <div>
545
- <h3 className='text-lg font-semibold mb-4'>Default</h3>
546
- <PaginationX />
547
- </div>
548
-
549
- <div>
550
- <h3 className='text-lg font-semibold mb-4'>With Icon</h3>
551
- <PaginationX pagination='WithIcon' />
552
- </div>
553
-
554
- <div>
555
- <h3 className='text-lg font-semibold mb-4'>Primary Button</h3>
556
- <PaginationX pagination='PrimaryButton' />
557
- </div>
558
-
559
- <div>
560
- <h3 className='text-lg font-semibold mb-4'>Secondary Button</h3>
561
- <PaginationX pagination='SecondaryButton' />
562
- </div>
563
-
564
- <div>
565
- <h3 className='text-lg font-semibold mb-4'>Bordered</h3>
566
- <PaginationX pagination='Bordered' />
567
- </div>
568
-
569
- <div>
570
- <h3 className='text-lg font-semibold mb-4'>Rounded</h3>
571
- <PaginationX pagination='Rounded' />
572
- </div>
573
-
574
- <div>
575
- <h3 className='text-lg font-semibold mb-4'>First & Last Navigation</h3>
576
- <PaginationX pagination='FirstLast' />
577
- </div>
578
-
579
- <div>
580
- <h3 className='text-lg font-semibold mb-4'>With Ellipsis</h3>
581
- <PaginationX pagination='WithEllipsis' />
582
- </div>
583
-
584
- <div>
585
- <h3 className='text-lg font-semibold mb-4'>Underline</h3>
586
- <PaginationX pagination='Underline' />
587
- </div>
588
-
589
- <div>
590
- <h3 className='text-lg font-semibold mb-4'>Card</h3>
591
- <PaginationX pagination='Card' />
592
- </div>
593
-
594
- <div>
595
- <h3 className='text-lg font-semibold mb-4'>Numberless</h3>
596
- <PaginationX pagination='Numberless' />
597
- </div>
598
-
599
- <div>
600
- <h3 className='text-lg font-semibold mb-4'>Numberless with Text</h3>
601
- <PaginationX pagination='NumberlessWithText' />
602
- </div>
603
-
604
- <div>
605
- <h3 className='text-lg font-semibold mb-4'>Mini</h3>
606
- <PaginationX pagination='Mini' />
607
- </div>
608
-
609
- <div>
610
- <h3 className='text-lg font-semibold mb-4'>With Select</h3>
611
- <PaginationX pagination='WithSelect' />
612
- </div>
613
-
614
- <div>
615
- <h3 className='text-lg font-semibold mb-4'>Table Pagination</h3>
616
- <PaginationX pagination='Table' />
617
- </div>
618
- </div>
619
- )
620
- }
621
-
622
- // #endregion