@catalystsoftware/ui 1.0.5 → 1.0.7

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,668 +0,0 @@
1
- /**const SheetDemo = () => {
2
- return (
3
- <Sheet>
4
- <SheetTrigger asChild>
5
- <Button variant='outline'>Default</Button>
6
- </SheetTrigger>
7
- <SheetContent>
8
- <SheetHeader>
9
- <SheetTitle>Edit profile</SheetTitle>
10
- <SheetDescription>Make changes to your profile here. Click save when you&apos;re done.</SheetDescription>
11
- </SheetHeader>
12
- <div className='grid flex-1 auto-rows-min gap-6 px-4'>
13
- <div className='grid gap-3'>
14
- <Label htmlFor='sheet-demo-name'>Name</Label>
15
- <Input id='sheet-demo-name' defaultValue='Pedro Duarte' />
16
- </div>
17
- <div className='grid gap-3'>
18
- <Label htmlFor='sheet-demo-username'>Username</Label>
19
- <Input id='sheet-demo-username' defaultValue='@peduarte' />
20
- </div>
21
- </div>
22
- <SheetFooter>
23
- <Button type='submit'>Save changes</Button>
24
- <SheetClose asChild>
25
- <Button variant='outline'>Close</Button>
26
- </SheetClose>
27
- </SheetFooter>
28
- </SheetContent>
29
- </Sheet>
30
- )
31
- }
32
-
33
- const SheetSidesDemo = () => {
34
- return (
35
- <div className='flex flex-wrap gap-2'>
36
- <Sheet>
37
- <SheetTrigger asChild>
38
- <Button variant='outline'>Top</Button>
39
- </SheetTrigger>
40
- <SheetContent side='top'>
41
- <SheetHeader>
42
- <SheetTitle>Edit profile</SheetTitle>
43
- <SheetDescription>Make changes to your profile here. Click save when you&apos;re done.</SheetDescription>
44
- </SheetHeader>
45
- <div className='grid flex-1 auto-rows-min gap-6 px-4'>
46
- <div className='grid gap-3'>
47
- <Label htmlFor='sheet-demo-name'>Name</Label>
48
- <Input id='sheet-demo-name' defaultValue='Pedro Duarte' />
49
- </div>
50
- <div className='grid gap-3'>
51
- <Label htmlFor='sheet-demo-username'>Username</Label>
52
- <Input id='sheet-demo-username' defaultValue='@peduarte' />
53
- </div>
54
- </div>
55
- <SheetFooter>
56
- <Button type='submit'>Save changes</Button>
57
- <SheetClose asChild>
58
- <Button variant='outline'>Close</Button>
59
- </SheetClose>
60
- </SheetFooter>
61
- </SheetContent>
62
- </Sheet>
63
- <Sheet>
64
- <SheetTrigger asChild>
65
- <Button variant='outline'>Right</Button>
66
- </SheetTrigger>
67
- <SheetContent side='right'>
68
- <SheetHeader>
69
- <SheetTitle>Edit profile</SheetTitle>
70
- <SheetDescription>Make changes to your profile here. Click save when you&apos;re done.</SheetDescription>
71
- </SheetHeader>
72
- <div className='grid flex-1 auto-rows-min gap-6 px-4'>
73
- <div className='grid gap-3'>
74
- <Label htmlFor='sheet-demo-name'>Name</Label>
75
- <Input id='sheet-demo-name' defaultValue='Pedro Duarte' />
76
- </div>
77
- <div className='grid gap-3'>
78
- <Label htmlFor='sheet-demo-username'>Username</Label>
79
- <Input id='sheet-demo-username' defaultValue='@peduarte' />
80
- </div>
81
- </div>
82
- <SheetFooter>
83
- <Button type='submit'>Save changes</Button>
84
- <SheetClose asChild>
85
- <Button variant='outline'>Close</Button>
86
- </SheetClose>
87
- </SheetFooter>
88
- </SheetContent>
89
- </Sheet>
90
- <Sheet>
91
- <SheetTrigger asChild>
92
- <Button variant='outline'>Bottom</Button>
93
- </SheetTrigger>
94
- <SheetContent side='bottom'>
95
- <SheetHeader>
96
- <SheetTitle>Edit profile</SheetTitle>
97
- <SheetDescription>Make changes to your profile here. Click save when you&apos;re done.</SheetDescription>
98
- </SheetHeader>
99
- <div className='grid flex-1 auto-rows-min gap-6 px-4'>
100
- <div className='grid gap-3'>
101
- <Label htmlFor='sheet-demo-name'>Name</Label>
102
- <Input id='sheet-demo-name' defaultValue='Pedro Duarte' />
103
- </div>
104
- <div className='grid gap-3'>
105
- <Label htmlFor='sheet-demo-username'>Username</Label>
106
- <Input id='sheet-demo-username' defaultValue='@peduarte' />
107
- </div>
108
- </div>
109
- <SheetFooter>
110
- <Button type='submit'>Save changes</Button>
111
- <SheetClose asChild>
112
- <Button variant='outline'>Close</Button>
113
- </SheetClose>
114
- </SheetFooter>
115
- </SheetContent>
116
- </Sheet>
117
- <Sheet>
118
- <SheetTrigger asChild>
119
- <Button variant='outline'>Left</Button>
120
- </SheetTrigger>
121
- <SheetContent side='left'>
122
- <SheetHeader>
123
- <SheetTitle>Edit profile</SheetTitle>
124
- <SheetDescription>Make changes to your profile here. Click save when you&apos;re done.</SheetDescription>
125
- </SheetHeader>
126
- <div className='grid flex-1 auto-rows-min gap-6 px-4'>
127
- <div className='grid gap-3'>
128
- <Label htmlFor='sheet-demo-name'>Name</Label>
129
- <Input id='sheet-demo-name' defaultValue='Pedro Duarte' />
130
- </div>
131
- <div className='grid gap-3'>
132
- <Label htmlFor='sheet-demo-username'>Username</Label>
133
- <Input id='sheet-demo-username' defaultValue='@peduarte' />
134
- </div>
135
- </div>
136
- <SheetFooter>
137
- <Button type='submit'>Save changes</Button>
138
- <SheetClose asChild>
139
- <Button variant='outline'>Close</Button>
140
- </SheetClose>
141
- </SheetFooter>
142
- </SheetContent>
143
- </Sheet>
144
- </div>
145
- )
146
- }
147
-
148
- const SheetWithNoOverlayDemo = () => {
149
- return (
150
- <Sheet modal={false}>
151
- <SheetTrigger asChild>
152
- <Button variant='outline'>No Overlay</Button>
153
- </SheetTrigger>
154
- <SheetContent>
155
- <SheetHeader>
156
- <SheetTitle>Edit profile</SheetTitle>
157
- <SheetDescription>Make changes to your profile here. Click save when you&apos;re done.</SheetDescription>
158
- </SheetHeader>
159
- <div className='grid flex-1 auto-rows-min gap-6 px-4'>
160
- <div className='grid gap-3'>
161
- <Label htmlFor='sheet-demo-name'>Name</Label>
162
- <Input id='sheet-demo-name' defaultValue='Pedro Duarte' />
163
- </div>
164
- <div className='grid gap-3'>
165
- <Label htmlFor='sheet-demo-username'>Username</Label>
166
- <Input id='sheet-demo-username' defaultValue='@peduarte' />
167
- </div>
168
- </div>
169
- <SheetFooter>
170
- <Button type='submit'>Save changes</Button>
171
- <SheetClose asChild>
172
- <Button variant='outline'>Close</Button>
173
- </SheetClose>
174
- </SheetFooter>
175
- </SheetContent>
176
- </Sheet>
177
- )
178
- }
179
-
180
- const SheetWithScrollableContentDemo = () => {
181
- return (
182
- <Sheet>
183
- <SheetTrigger asChild>
184
- <Button variant='outline'>Scrollable Content</Button>
185
- </SheetTrigger>
186
- <SheetContent>
187
- <ScrollArea className='h-full'>
188
- <SheetHeader>
189
- <SheetTitle>Terms & Condition</SheetTitle>
190
- <SheetDescription>Make sure read the terms and conditions before proceeding.</SheetDescription>
191
- </SheetHeader>
192
- <div className='space-y-1 p-4 pt-0 text-sm'>
193
- <p className='mb-2 font-medium'>Last Updated: June 1, 2025</p>
194
-
195
- <h3>1. Introduction</h3>
196
- <p>
197
- Welcome to our platform. These Terms and Conditions outline the rules and regulations for the use of our
198
- services. By accessing or using our services, you agree to comply with these terms. If you do not agree
199
- with any of these terms, please do not use our services.
200
- </p>
201
-
202
- <h3>2. Acceptance of Terms</h3>
203
- <p>
204
- By using our services, you confirm that you have read, understood, and accepted these terms. You also
205
- agree to comply with any additional guidelines, policies, or rules that may apply to specific features of
206
- our services.
207
- </p>
208
-
209
- <h3>3. Services Provided</h3>
210
- <p>
211
- We offer a range of digital services including but not limited to content creation, subscription services,
212
- and access to various online tools. You acknowledge that the nature of our services may change over time,
213
- and we reserve the right to modify, suspend, or discontinue services at any time.
214
- </p>
215
-
216
- <h3>4. User Obligations</h3>
217
- <p>
218
- As a user, you agree to provide accurate and complete information when required, and to update this
219
- information if necessary. You are responsible for maintaining the confidentiality of your account details,
220
- including username and password, and for all activities under your account.
221
- </p>
222
-
223
- <h3>5. Prohibited Activities</h3>
224
- <p>You may not use our services for any unlawful activities, including but not limited to:</p>
225
- <ul>
226
- <li>Distributing malicious content or viruses</li>
227
- <li>Engaging in illegal activities or fraud</li>
228
- <li>Impersonating another user or entity</li>
229
- <li>Harassing or bullying other users</li>
230
- </ul>
231
-
232
- <h3>6. Content Ownership</h3>
233
- <p>
234
- All content, including text, images, graphics, and software on our platform, is owned by us or our
235
- licensors and is protected by copyright laws. You are granted a limited, non-exclusive license to access
236
- and use this content for personal or business purposes.
237
- </p>
238
-
239
- <h3>7. Privacy and Data Protection</h3>
240
- <p>
241
- Your privacy is important to us. Please refer to our <a href='#'>Privacy Policy</a> to understand how we
242
- collect, use, and protect your personal data.
243
- </p>
244
-
245
- <h3>8. Payment Terms</h3>
246
- <p>
247
- Some of our services are available for a fee. You agree to pay all applicable charges and fees associated
248
- with your use of the services. We reserve the right to change the pricing of our services at any time.
249
- </p>
250
-
251
- <h3>9. Termination</h3>
252
- <p>
253
- We may suspend or terminate your account if you violate these Terms and Conditions or engage in any
254
- behavior that we deem inappropriate. Upon termination, your access to our services will be revoked, and
255
- any outstanding payments will be due immediately.
256
- </p>
257
-
258
- <h3>10. Disclaimers and Limitation of Liability</h3>
259
- <p>
260
- We provide our services &quot;as is&quot; and make no warranties regarding the accuracy, reliability, or
261
- availability of the services. We are not responsible for any damages, losses, or expenses incurred by your
262
- use of our services.
263
- </p>
264
-
265
- <h3>11. Governing Law</h3>
266
- <p>
267
- These Terms and Conditions shall be governed by and construed in accordance with the laws of the
268
- jurisdiction in which our company is based. Any disputes arising from these terms shall be subject to the
269
- exclusive jurisdiction of the courts of that jurisdiction.
270
- </p>
271
-
272
- <h3>12. Changes to Terms</h3>
273
- <p>
274
- We reserve the right to update or modify these Terms and Conditions at any time. Any changes will be
275
- posted on this page, and the revised terms will take effect immediately upon posting. It is your
276
- responsibility to review these terms periodically for any updates.
277
- </p>
278
-
279
- <h3>13. Contact Information</h3>
280
- <p>If you have any questions or concerns about these Terms and Conditions, please contact us at:</p>
281
- <p>Email: support@example.com</p>
282
- <p>Phone: +1 (800) 123-4567</p>
283
- </div>
284
- <SheetFooter>
285
- <SheetClose asChild>
286
- <Button type='submit'>Accept</Button>
287
- </SheetClose>
288
- <SheetClose asChild>
289
- <Button variant='outline'>Cancel</Button>
290
- </SheetClose>
291
- </SheetFooter>
292
- </ScrollArea>
293
- </SheetContent>
294
- </Sheet>
295
- )
296
- }
297
-
298
- const SheetWithFormDemo = () => {
299
- const FormSchema = z.object({
300
- firstName: z.string().min(1, 'First name is required').min(2, 'First name must be at least 2 characters'),
301
- lastName: z.string().min(1, 'Last name is required').min(2, 'Last name must be at least 2 characters'),
302
- email: z.string().min(1, 'Email is required').email({ message: 'Please enter a valid email address.' }),
303
- mobileNumber: z
304
- .number({ required_error: 'Mobile number is required', invalid_type_error: 'Please enter a valid number' })
305
- .int('Mobile number must be a whole number')
306
- .positive('Mobile number must be positive')
307
- .refine(val => val.toString().length === 10, 'Mobile number must be exactly 10 digits'),
308
- password: z.string().min(1, 'Password is required').min(8, 'Password must be at least 8 characters')
309
- })
310
-
311
- const form = useForm<z.infer<typeof FormSchema>>({
312
- resolver: zodResolver(FormSchema),
313
- defaultValues: {
314
- firstName: '',
315
- lastName: '',
316
- email: '',
317
- mobileNumber: undefined,
318
- password: ''
319
- }
320
- })
321
-
322
- const onSubmit = () => {
323
- toast.custom(() => (
324
- <Alert className='border-green-600 text-green-600 dark:border-green-400 dark:text-green-400'>
325
- <CheckCheckIcon />
326
- <AlertTitle>Account created successfully!</AlertTitle>
327
- </Alert>
328
- ))
329
- }
330
-
331
- return (
332
- <Sheet>
333
- <SheetTrigger asChild>
334
- <Button variant='outline'>Sign Up</Button>
335
- </SheetTrigger>
336
- <SheetContent>
337
- <SheetHeader>
338
- <SheetTitle className='text-center text-xl font-bold'>Sign Up</SheetTitle>
339
- </SheetHeader>
340
- <Form {...form}>
341
- <form onSubmit={form.handleSubmit(onSubmit)} className='w-full'>
342
- <div className='space-y-4 p-4 pt-0'>
343
- <FormField
344
- control={form.control}
345
- name='firstName'
346
- render={({ field }) => (
347
- <FormItem>
348
- <FormLabel>First Name</FormLabel>
349
- <FormControl>
350
- <Input placeholder='First name' {...field} />
351
- </FormControl>
352
- <FormMessage />
353
- </FormItem>
354
- )}
355
- />
356
- <FormField
357
- control={form.control}
358
- name='lastName'
359
- render={({ field }) => (
360
- <FormItem>
361
- <FormLabel>Last Name</FormLabel>
362
- <FormControl>
363
- <Input placeholder='Last name' {...field} />
364
- </FormControl>
365
- <FormMessage />
366
- </FormItem>
367
- )}
368
- />
369
- <FormField
370
- control={form.control}
371
- name='email'
372
- render={({ field }) => (
373
- <FormItem>
374
- <FormLabel>Email</FormLabel>
375
- <FormControl>
376
- <Input placeholder='Email address' {...field} />
377
- </FormControl>
378
- <FormMessage />
379
- </FormItem>
380
- )}
381
- />
382
- <FormField
383
- control={form.control}
384
- name='mobileNumber'
385
- render={({ field }) => (
386
- <FormItem>
387
- <FormLabel>Mobile Number</FormLabel>
388
- <FormControl>
389
- <Input
390
- type='tel'
391
- placeholder='8585858585'
392
- value={field.value ? field.value.toString() : ''}
393
- onChange={e => {
394
- const value = e.target.value.replace(/[^\d]/g, '')
395
-
396
- const limitedValue = value.slice(0, 10)
397
-
398
- const numValue = limitedValue === '' ? undefined : parseInt(limitedValue, 10)
399
-
400
- field.onChange(numValue)
401
- }}
402
- />
403
- </FormControl>
404
- <FormMessage />
405
- </FormItem>
406
- )}
407
- />
408
- <FormField
409
- control={form.control}
410
- name='password'
411
- render={({ field }) => (
412
- <FormItem>
413
- <FormLabel>Password</FormLabel>
414
- <FormControl>
415
- <Input type='password' placeholder='Password' {...field} />
416
- </FormControl>
417
- <FormMessage />
418
- </FormItem>
419
- )}
420
- />
421
- </div>
422
- <SheetFooter>
423
- <Button type='submit'>Create Account</Button>
424
-
425
- <SheetClose asChild>
426
- <Button variant='outline'>Close</Button>
427
- </SheetClose>
428
- </SheetFooter>
429
- </form>
430
- </Form>
431
- </SheetContent>
432
- </Sheet>
433
- )
434
- }
435
-
436
- const NavigationMenu = ({ item, level }: { level: number; item: NavigationItem }) => {
437
- if (item.type === 'page') {
438
- return (
439
- <div
440
- className='focus-visible:ring-ring/50 flex items-center gap-2 rounded-md p-1 outline-none focus-visible:ring-[3px]'
441
- style={{ paddingLeft: `${level === 0 ? 0.25 : 1.75}rem` }}
442
- >
443
- {level === 0 ? <item.icon className='size-4 shrink-0' /> : <CircleSmallIcon className='size-4 shrink-0' />}
444
- <span className='text-sm'>{item.name}</span>
445
- </div>
446
- )
447
- }
448
-
449
- return (
450
- <Collapsible className='flex flex-col gap-1.5' style={{ paddingLeft: `${level === 0 ? 0 : 1.5}rem` }}>
451
- <CollapsibleTrigger className='focus-visible:ring-ring/50 flex items-center gap-2 rounded-md p-1 outline-none focus-visible:ring-[3px]'>
452
- {level === 0 ? <item.icon className='size-4 shrink-0' /> : <CircleSmallIcon className='size-4 shrink-0' />}
453
- <span className='flex-1 text-start text-sm'>{item.name}</span>
454
- <ChevronRightIcon className='size-4 shrink-0 transition-transform [[data-state="open"]>&]:rotate-90' />
455
- </CollapsibleTrigger>
456
- <CollapsibleContent className='data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down flex flex-col gap-1.5 overflow-hidden transition-all duration-300'>
457
- {item.children.map(item => (
458
- <NavigationMenu key={item.name} item={item} level={level + 1} />
459
- ))}
460
- </CollapsibleContent>
461
- </Collapsible>
462
- )
463
- }
464
-
465
- const SheetWithNavigationMenuDemo = () => {
466
- return (
467
- <Sheet>
468
- <SheetTrigger asChild>
469
- <Button variant='outline'>Navigation Menu</Button>
470
- </SheetTrigger>
471
- <SheetContent side='left' className='w-75'>
472
- <SheetHeader>
473
- <SheetTitle>Menu</SheetTitle>
474
- </SheetHeader>
475
- <div className='flex flex-col gap-2.5 p-4 pt-0'>
476
- {navigationMenu.map(item => (
477
- <NavigationMenu key={item.name} item={item} level={0} />
478
- ))}
479
- </div>
480
- </SheetContent>
481
- </Sheet>
482
- )
483
- }
484
-
485
- const DataTableDensityDemo = () => {
486
- const [tableData, setTableData] = useState(data)
487
- const [globalFilter, setGlobalFilter] = useState('')
488
- const [sorting, setSorting] = useState<SortingState>([])
489
- const [columnFilters, setColumnFilters] = useState<ColumnFiltersState>([])
490
- const [columnVisibility, setColumnVisibility] = useState<VisibilityState>({})
491
- const [rowSelection, setRowSelection] = useState({})
492
- const [isSheetOpen, setIsSheetOpen] = useState(false)
493
-
494
- // Form state for adding new user
495
- const [newUser, setNewUser] = useState({
496
- name: '',
497
- email: '',
498
- amount: '',
499
- status: 'pending' as Payment['status']
500
- })
501
-
502
- // Function to handle form submission
503
- const handleAddUser = () => {
504
- if (!newUser.name || !newUser.email || !newUser.amount) {
505
- return // Basic validation
506
- }
507
-
508
- const newPayment: Payment = {
509
- id: String(tableData.length + 1),
510
- name: newUser.name,
511
- email: newUser.email,
512
- amount: parseFloat(newUser.amount),
513
- status: newUser.status
514
- }
515
-
516
- setTableData([...tableData, newPayment])
517
-
518
- // Reset form
519
- setNewUser({
520
- name: '',
521
- email: '',
522
- amount: '',
523
- status: 'pending'
524
- })
525
-
526
- setIsSheetOpen(false)
527
- }
528
-
529
- const table = useReactTable({
530
- data: tableData,
531
- columns,
532
- onSortingChange: setSorting,
533
- onColumnFiltersChange: setColumnFilters,
534
- getCoreRowModel: getCoreRowModel(),
535
- getPaginationRowModel: getPaginationRowModel(),
536
- getSortedRowModel: getSortedRowModel(),
537
- getFilteredRowModel: getFilteredRowModel(),
538
- onColumnVisibilityChange: setColumnVisibility,
539
- onRowSelectionChange: setRowSelection,
540
- onGlobalFilterChange: setGlobalFilter,
541
- globalFilterFn: 'includesString',
542
- state: {
543
- sorting,
544
- columnFilters,
545
- columnVisibility,
546
- rowSelection,
547
- globalFilter
548
- }
549
- })
550
-
551
- return (
552
- <div className='w-full'>
553
- <div className='flex justify-between gap-2 py-4 max-sm:flex-col sm:items-center'>
554
- <Input
555
- placeholder='Search all columns...'
556
- value={globalFilter ?? ''}
557
- onChange={event => setGlobalFilter(String(event.target.value))}
558
- className='max-w-2xs'
559
- />
560
- <Sheet open={isSheetOpen} onOpenChange={setIsSheetOpen}>
561
- <SheetTrigger asChild>
562
- <Button variant='outline'>
563
- <PlusIcon />
564
- Add Users
565
- </Button>
566
- </SheetTrigger>
567
- <SheetContent>
568
- <SheetHeader>
569
- <SheetTitle>Add New User</SheetTitle>
570
- <SheetDescription>Add a new user to the table. Fill in all the required information.</SheetDescription>
571
- </SheetHeader>
572
- <div className='grid flex-1 auto-rows-min gap-6 px-4'>
573
- <div className='grid gap-3'>
574
- <Label htmlFor='user-name'>Name</Label>
575
- <Input
576
- id='user-name'
577
- value={newUser.name}
578
- onChange={e => setNewUser({ ...newUser, name: e.target.value })}
579
- placeholder='Enter user name'
580
- />
581
- </div>
582
- <div className='grid gap-3'>
583
- <Label htmlFor='user-email'>Email</Label>
584
- <Input
585
- id='user-email'
586
- type='email'
587
- value={newUser.email}
588
- onChange={e => setNewUser({ ...newUser, email: e.target.value })}
589
- placeholder='Enter email address'
590
- />
591
- </div>
592
- <div className='grid gap-3'>
593
- <Label htmlFor='user-amount'>Amount</Label>
594
- <Input
595
- id='user-amount'
596
- type='number'
597
- value={newUser.amount}
598
- onChange={e => setNewUser({ ...newUser, amount: e.target.value })}
599
- placeholder='Enter amount'
600
- />
601
- </div>
602
- <div className='grid gap-3'>
603
- <Label htmlFor='user-status'>Status</Label>
604
- <Select
605
- value={newUser.status}
606
- onValueChange={(value: Payment['status']) => setNewUser({ ...newUser, status: value })}
607
- >
608
- <SelectTrigger className='w-full'>
609
- <SelectValue placeholder='Select status' />
610
- </SelectTrigger>
611
- <SelectContent>
612
- <SelectItem value='pending'>Pending</SelectItem>
613
- <SelectItem value='processing'>Processing</SelectItem>
614
- <SelectItem value='success'>Success</SelectItem>
615
- <SelectItem value='failed'>Failed</SelectItem>
616
- </SelectContent>
617
- </Select>
618
- </div>
619
- </div>
620
- <SheetFooter>
621
- <Button type='button' onClick={handleAddUser}>
622
- Add User
623
- </Button>
624
- <SheetClose asChild>
625
- <Button variant='outline'>Cancel</Button>
626
- </SheetClose>
627
- </SheetFooter>
628
- </SheetContent>
629
- </Sheet>
630
- </div>
631
- <div className='rounded-md border'>
632
- <Table>
633
- <TableHeader>
634
- {table.getHeaderGroups().map(headerGroup => (
635
- <TableRow key={headerGroup.id}>
636
- {headerGroup.headers.map(header => {
637
- return (
638
- <TableHead key={header.id}>
639
- {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
640
- </TableHead>
641
- )
642
- })}
643
- </TableRow>
644
- ))}
645
- </TableHeader>
646
- <TableBody>
647
- {table.getRowModel().rows?.length ? (
648
- table.getRowModel().rows.map(row => (
649
- <TableRow key={row.id} data-state={row.getIsSelected() && 'selected'}>
650
- {row.getVisibleCells().map(cell => (
651
- <TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>
652
- ))}
653
- </TableRow>
654
- ))
655
- ) : (
656
- <TableRow>
657
- <TableCell colSpan={columns.length} className='h-24 text-center'>
658
- No results.
659
- </TableCell>
660
- </TableRow>
661
- )}
662
- </TableBody>
663
- </Table>
664
- </div>
665
- <p className='text-muted-foreground mt-4 text-center text-sm'>Add new user with sheet</p>
666
- </div>
667
- )
668
- } */