@ardly/bunext 1.0.6 → 1.0.8

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 (118) hide show
  1. package/README.md +61 -16
  2. package/cli.mjs +126 -0
  3. package/package.json +14 -58
  4. package/.eslintrc.json +0 -8
  5. package/.prettierignore +0 -4
  6. package/STRUCTURE.md +0 -77
  7. package/bin/cli.mjs +0 -126
  8. package/components.json +0 -21
  9. package/next.config.ts +0 -22
  10. package/postcss.config.mjs +0 -8
  11. package/prettier.config.js +0 -7
  12. package/public/android-chrome-192x192.png +0 -0
  13. package/public/android-chrome-512x512.png +0 -0
  14. package/public/favicon.svg +0 -1
  15. package/public/loading-dots.gif +0 -0
  16. package/public/logo.svg +0 -1
  17. package/public/ogImage.webp +0 -0
  18. package/public/site.webmanifest +0 -19
  19. package/src/actions/placeholder.ts +0 -30
  20. package/src/actions/sampleAction.ts +0 -39
  21. package/src/app/(index)/intr/TestCard.tsx +0 -31
  22. package/src/app/(index)/intr/page.tsx +0 -17
  23. package/src/app/(index)/page.tsx +0 -156
  24. package/src/app/(index)/pagetr/page.tsx +0 -37
  25. package/src/app/error-wrapper.tsx +0 -32
  26. package/src/app/global-error.tsx +0 -53
  27. package/src/app/layout.tsx +0 -56
  28. package/src/app/loading.tsx +0 -11
  29. package/src/app/not-found.tsx +0 -45
  30. package/src/app/sitemap.ts +0 -14
  31. package/src/components/Providers/root-provider.tsx +0 -22
  32. package/src/components/Providers/theme-provider.tsx +0 -27
  33. package/src/components/TestComp.tsx +0 -11
  34. package/src/components/brand.tsx +0 -35
  35. package/src/components/navigation/footer.tsx +0 -32
  36. package/src/components/navigation/main-nav.tsx +0 -55
  37. package/src/components/navigation/mobile-nav.tsx +0 -154
  38. package/src/components/navigation/site-header.tsx +0 -67
  39. package/src/components/ui/avatar.tsx +0 -50
  40. package/src/components/ui/badge.tsx +0 -36
  41. package/src/components/ui/button.tsx +0 -56
  42. package/src/components/ui/card.tsx +0 -79
  43. package/src/components/ui/command.tsx +0 -153
  44. package/src/components/ui/dialog.tsx +0 -122
  45. package/src/components/ui/drawer.tsx +0 -118
  46. package/src/components/ui/dropdown-menu.tsx +0 -200
  47. package/src/components/ui/input.tsx +0 -22
  48. package/src/components/ui/label.tsx +0 -26
  49. package/src/components/ui/multi-select.tsx +0 -380
  50. package/src/components/ui/origin/multiselect.tsx +0 -645
  51. package/src/components/ui/popover.tsx +0 -31
  52. package/src/components/ui/radio-group.tsx +0 -44
  53. package/src/components/ui/separator.tsx +0 -31
  54. package/src/components/ui/skeleton.tsx +0 -15
  55. package/src/components/ui/themeSelector.tsx +0 -157
  56. package/src/components/ui/toast.tsx +0 -129
  57. package/src/components/ui/toaster.tsx +0 -31
  58. package/src/components/ui/tooltip.tsx +0 -39
  59. package/src/components/utils/ConditionalLink.tsx +0 -46
  60. package/src/components/utils/Image.tsx +0 -57
  61. package/src/components/utils/Img.tsx +0 -104
  62. package/src/components/utils/Spinner.tsx +0 -29
  63. package/src/components/utils/TopButton.tsx +0 -67
  64. package/src/components/utils/TransitionLink.tsx +0 -67
  65. package/src/components/utils/copy.tsx +0 -98
  66. package/src/components/utils/featureFlag.tsx +0 -22
  67. package/src/components/utils/icons.tsx +0 -155
  68. package/src/components/utils/share-modal.tsx +0 -159
  69. package/src/hooks/use-intersection.ts +0 -52
  70. package/src/hooks/use-lazy-load.ts +0 -33
  71. package/src/hooks/use-meta-color.ts +0 -25
  72. package/src/hooks/use-toast.ts +0 -191
  73. package/src/lib/config/featureflags.ts +0 -63
  74. package/src/lib/config/siteConfig.ts +0 -172
  75. package/src/lib/config/user.ts +0 -9
  76. package/src/lib/data/footer-data.ts +0 -85
  77. package/src/lib/data/nav-data.ts +0 -30
  78. package/src/lib/data/siteData.ts +0 -52
  79. package/src/lib/utils/index.ts +0 -190
  80. package/src/styles/customGlobal.css +0 -141
  81. package/src/styles/globals.css +0 -72
  82. package/src/styles/tailwind/base.ts +0 -46
  83. package/src/styles/tailwind/fonts/ClashDisplay-Bold.eot +0 -0
  84. package/src/styles/tailwind/fonts/ClashDisplay-Bold.ttf +0 -0
  85. package/src/styles/tailwind/fonts/ClashDisplay-Bold.woff +0 -0
  86. package/src/styles/tailwind/fonts/ClashDisplay-Bold.woff2 +0 -0
  87. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.eot +0 -0
  88. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.ttf +0 -0
  89. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.woff +0 -0
  90. package/src/styles/tailwind/fonts/ClashDisplay-Extralight.woff2 +0 -0
  91. package/src/styles/tailwind/fonts/ClashDisplay-Light.eot +0 -0
  92. package/src/styles/tailwind/fonts/ClashDisplay-Light.ttf +0 -0
  93. package/src/styles/tailwind/fonts/ClashDisplay-Light.woff +0 -0
  94. package/src/styles/tailwind/fonts/ClashDisplay-Light.woff2 +0 -0
  95. package/src/styles/tailwind/fonts/ClashDisplay-Medium.eot +0 -0
  96. package/src/styles/tailwind/fonts/ClashDisplay-Medium.ttf +0 -0
  97. package/src/styles/tailwind/fonts/ClashDisplay-Medium.woff +0 -0
  98. package/src/styles/tailwind/fonts/ClashDisplay-Medium.woff2 +0 -0
  99. package/src/styles/tailwind/fonts/ClashDisplay-Regular.eot +0 -0
  100. package/src/styles/tailwind/fonts/ClashDisplay-Regular.ttf +0 -0
  101. package/src/styles/tailwind/fonts/ClashDisplay-Regular.woff +0 -0
  102. package/src/styles/tailwind/fonts/ClashDisplay-Regular.woff2 +0 -0
  103. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.eot +0 -0
  104. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.ttf +0 -0
  105. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.woff +0 -0
  106. package/src/styles/tailwind/fonts/ClashDisplay-Semibold.woff2 +0 -0
  107. package/src/styles/tailwind/fonts/ClashDisplay-Variable.eot +0 -0
  108. package/src/styles/tailwind/fonts/ClashDisplay-Variable.ttf +0 -0
  109. package/src/styles/tailwind/fonts/ClashDisplay-Variable.woff +0 -0
  110. package/src/styles/tailwind/fonts/ClashDisplay-Variable.woff2 +0 -0
  111. package/src/styles/tailwind/fonts/GeistMonoVF.woff +0 -0
  112. package/src/styles/tailwind/fonts/GeistVF.woff +0 -0
  113. package/src/styles/tailwind/fonts.ts +0 -51
  114. package/src/styles/tailwind/tailwindUtils.ts +0 -29
  115. package/src/types/index.ts +0 -80
  116. package/tailwind.config.ts +0 -104
  117. package/tsconfig.json +0 -28
  118. package/vercel.json +0 -6
@@ -1,380 +0,0 @@
1
- import * as React from 'react'
2
- import { cva, type VariantProps } from 'class-variance-authority'
3
- import {
4
- CheckIcon,
5
- XCircle,
6
- ChevronDown,
7
- XIcon,
8
- WandSparkles,
9
- } from 'lucide-react'
10
-
11
- import { cn } from '@/lib/utils'
12
- import { Separator } from '@/components/ui/separator'
13
- import { Button } from '@/components/ui/button'
14
- import { Badge } from '@/components/ui/badge'
15
- import {
16
- Popover,
17
- PopoverContent,
18
- PopoverTrigger,
19
- } from '@/components/ui/popover'
20
- import {
21
- Command,
22
- CommandEmpty,
23
- CommandGroup,
24
- CommandInput,
25
- CommandItem,
26
- CommandList,
27
- CommandSeparator,
28
- } from '@/components/ui/command'
29
-
30
- /**
31
- * Variants for the multi-select component to handle different styles.
32
- * Uses class-variance-authority (cva) to define different styles based on "variant" prop.
33
- */
34
- const multiSelectVariants = cva(
35
- 'm-1 transition ease-in-out delay-150 hover:-translate-y-1 hover:scale-110 duration-300',
36
- {
37
- variants: {
38
- variant: {
39
- default:
40
- ' bg-secondary/40 text-foreground hover:bg-secondary/45 px-2 py-1 font-medium ',
41
- secondary:
42
- 'border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80',
43
- destructive:
44
- 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
45
- inverted: 'inverted',
46
- },
47
- },
48
- defaultVariants: {
49
- variant: 'default',
50
- },
51
- }
52
- )
53
-
54
- /**
55
- * Props for MultiSelect component
56
- */
57
- interface MultiSelectProps
58
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
59
- VariantProps<typeof multiSelectVariants> {
60
- /**
61
- * An array of option objects to be displayed in the multi-select component.
62
- * Each option object has a label, value, and an optional icon.
63
- */
64
- options: {
65
- /** The text to display for the option. */
66
- label: string
67
- /** The unique value associated with the option. */
68
- value: string
69
- /** Optional icon component to display alongside the option. */
70
- icon?: React.ComponentType<{ className?: string }>
71
- }[]
72
-
73
- /**
74
- * Callback function triggered when the selected values change.
75
- * Receives an array of the new selected values.
76
- */
77
- onValueChange: (value: string[]) => void
78
-
79
- /** The default selected values when the component mounts. */
80
- defaultValue?: string[]
81
-
82
- /**
83
- * Placeholder text to be displayed when no values are selected.
84
- * Optional, defaults to "Select options".
85
- */
86
- placeholder?: string
87
-
88
- /**
89
- * Animation duration in seconds for the visual effects (e.g., bouncing badges).
90
- * Optional, defaults to 0 (no animation).
91
- */
92
- animation?: number
93
-
94
- /**
95
- * Maximum number of items to display. Extra selected items will be summarized.
96
- * Optional, defaults to 3.
97
- */
98
- maxCount?: number
99
-
100
- /**
101
- * The modality of the popover. When set to true, interaction with outside elements
102
- * will be disabled and only popover content will be visible to screen readers.
103
- * Optional, defaults to false.
104
- */
105
- modalPopover?: boolean
106
-
107
- /**
108
- * If true, renders the multi-select component as a child of another component.
109
- * Optional, defaults to false.
110
- */
111
- asChild?: boolean
112
-
113
- /**
114
- * Additional class names to apply custom styles to the multi-select component.
115
- * Optional, can be used to add custom styles.
116
- */
117
- className?: string
118
- }
119
-
120
- export const MultiSelect = React.forwardRef<
121
- HTMLButtonElement,
122
- MultiSelectProps
123
- >(
124
- (
125
- {
126
- options,
127
- onValueChange,
128
- variant,
129
- defaultValue = [],
130
- placeholder = 'Select options',
131
- animation = 0,
132
- maxCount = 3,
133
- modalPopover = false,
134
- asChild = false,
135
- className,
136
- ...props
137
- },
138
- ref
139
- ) => {
140
- const [selectedValues, setSelectedValues] =
141
- React.useState<string[]>(defaultValue)
142
- const [isPopoverOpen, setIsPopoverOpen] = React.useState(false)
143
- const [isAnimating, setIsAnimating] = React.useState(false)
144
-
145
- const handleInputKeyDown = (
146
- event: React.KeyboardEvent<HTMLInputElement>
147
- ) => {
148
- if (event.key === 'Enter') {
149
- setIsPopoverOpen(true)
150
- } else if (event.key === 'Backspace' && !event.currentTarget.value) {
151
- const newSelectedValues = [...selectedValues]
152
- newSelectedValues.pop()
153
- setSelectedValues(newSelectedValues)
154
- onValueChange(newSelectedValues)
155
- }
156
- }
157
-
158
- const toggleOption = (option: string) => {
159
- const newSelectedValues = selectedValues.includes(option)
160
- ? selectedValues.filter((value) => value !== option)
161
- : [...selectedValues, option]
162
- setSelectedValues(newSelectedValues)
163
- onValueChange(newSelectedValues)
164
- }
165
-
166
- const handleClear = () => {
167
- setSelectedValues([])
168
- onValueChange([])
169
- }
170
-
171
- const handleTogglePopover = () => {
172
- setIsPopoverOpen((prev) => !prev)
173
- }
174
-
175
- const clearExtraOptions = () => {
176
- const newSelectedValues = selectedValues.slice(0, maxCount)
177
- setSelectedValues(newSelectedValues)
178
- onValueChange(newSelectedValues)
179
- }
180
-
181
- const toggleAll = () => {
182
- if (selectedValues.length === options.length) {
183
- handleClear()
184
- } else {
185
- const allValues = options.map((option) => option.value)
186
- setSelectedValues(allValues)
187
- onValueChange(allValues)
188
- }
189
- }
190
-
191
- return (
192
- <Popover
193
- open={isPopoverOpen}
194
- onOpenChange={setIsPopoverOpen}
195
- modal={modalPopover}
196
- >
197
- <PopoverTrigger asChild>
198
- <Button
199
- ref={ref}
200
- {...props}
201
- onClick={handleTogglePopover}
202
- className={cn(
203
- 'flex h-auto min-h-10 w-full items-center justify-between rounded-md border bg-inherit p-1 hover:bg-inherit [&_svg]:pointer-events-auto',
204
- className
205
- )}
206
- >
207
- {selectedValues.length > 0 ? (
208
- <div className="flex w-[97%] items-center justify-between">
209
- <div className="flex flex-wrap items-center">
210
- {selectedValues.slice(0, maxCount).map((value) => {
211
- const option = options.find((o) => o.value === value)
212
- const IconComponent = option?.icon
213
- return (
214
- <Badge
215
- key={value}
216
- className={cn(
217
- 'backdrop-blur-2xl',
218
- isAnimating ? 'animate-bounce' : '',
219
- multiSelectVariants({ variant })
220
- )}
221
- style={{ animationDuration: `${animation}s` }}
222
- >
223
- {IconComponent && (
224
- <IconComponent className="mr-2 h-4 w-4" />
225
- )}
226
- {option?.label}
227
- <XCircle
228
- className="ml-2 h-4 w-4 cursor-pointer"
229
- onClick={(event) => {
230
- event.stopPropagation()
231
- toggleOption(value)
232
- }}
233
- />
234
- </Badge>
235
- )
236
- })}
237
- {selectedValues.length > maxCount && (
238
- <Badge
239
- className={cn(
240
- 'backdrop-blur-2xl',
241
- isAnimating ? 'animate-bounce' : '',
242
- multiSelectVariants({ variant })
243
- )}
244
- style={{ animationDuration: `${animation}s` }}
245
- >
246
- {`+ ${selectedValues.length - maxCount} more`}
247
- <XCircle
248
- className="ml-2 h-4 w-4 cursor-pointer"
249
- onClick={(event) => {
250
- event.stopPropagation()
251
- clearExtraOptions()
252
- }}
253
- />
254
- </Badge>
255
- )}
256
- </div>
257
- <div className="flex items-center justify-between">
258
- <XIcon
259
- className="mx-2 h-4 cursor-pointer text-muted-foreground"
260
- onClick={(event) => {
261
- event.stopPropagation()
262
- handleClear()
263
- }}
264
- />
265
- <Separator
266
- orientation="vertical"
267
- className="flex h-full min-h-6"
268
- />
269
- <ChevronDown className="mx-2 h-4 cursor-pointer text-muted-foreground" />
270
- </div>
271
- </div>
272
- ) : (
273
- <div className="mx-auto flex w-full items-center justify-between">
274
- <span className="mx-3 text-sm text-muted-foreground">
275
- {placeholder}
276
- </span>
277
- <ChevronDown className="mx-2 h-4 cursor-pointer text-muted-foreground" />
278
- </div>
279
- )}
280
- </Button>
281
- </PopoverTrigger>
282
- <PopoverContent
283
- className="w-auto p-0"
284
- align="start"
285
- onEscapeKeyDown={() => setIsPopoverOpen(false)}
286
- >
287
- <Command>
288
- <CommandInput
289
- placeholder="Search..."
290
- onKeyDown={handleInputKeyDown}
291
- />
292
- <CommandList>
293
- <CommandEmpty>No results found.</CommandEmpty>
294
- <CommandGroup>
295
- <CommandItem
296
- key="all"
297
- onSelect={toggleAll}
298
- className="cursor-pointer"
299
- >
300
- <div
301
- className={cn(
302
- 'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
303
- selectedValues.length === options.length
304
- ? 'bg-primary text-primary-foreground'
305
- : 'opacity-50 [&_svg]:invisible'
306
- )}
307
- >
308
- <CheckIcon className="h-4 w-4" />
309
- </div>
310
- <span>(Select All)</span>
311
- </CommandItem>
312
- {options.map((option) => {
313
- const isSelected = selectedValues.includes(option.value)
314
- return (
315
- <CommandItem
316
- key={option.value}
317
- onSelect={() => toggleOption(option.value)}
318
- className="cursor-pointer"
319
- >
320
- <div
321
- className={cn(
322
- 'mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary',
323
- isSelected
324
- ? 'bg-primary text-primary-foreground'
325
- : 'opacity-50 [&_svg]:invisible'
326
- )}
327
- >
328
- <CheckIcon className="h-4 w-4" />
329
- </div>
330
- {option.icon && (
331
- <option.icon className="mr-2 h-4 w-4 text-muted-foreground" />
332
- )}
333
- <span>{option.label}</span>
334
- </CommandItem>
335
- )
336
- })}
337
- </CommandGroup>
338
- <CommandSeparator />
339
- <CommandGroup>
340
- <div className="flex items-center justify-between">
341
- {selectedValues.length > 0 && (
342
- <>
343
- <CommandItem
344
- onSelect={handleClear}
345
- className="flex-1 cursor-pointer justify-center text-red-500 data-[selected='true']:bg-red-500/30 data-[selected=true]:text-red-500"
346
- >
347
- Clear
348
- </CommandItem>
349
- <Separator
350
- orientation="vertical"
351
- className="flex h-full min-h-6"
352
- />
353
- </>
354
- )}
355
- <CommandItem
356
- onSelect={() => setIsPopoverOpen(false)}
357
- className="max-w-full flex-1 cursor-pointer justify-center"
358
- >
359
- Close
360
- </CommandItem>
361
- </div>
362
- </CommandGroup>
363
- </CommandList>
364
- </Command>
365
- </PopoverContent>
366
- {animation > 0 && selectedValues.length > 0 && (
367
- <WandSparkles
368
- className={cn(
369
- 'my-2 h-3 w-3 cursor-pointer bg-background text-foreground',
370
- isAnimating ? '' : 'text-muted-foreground'
371
- )}
372
- onClick={() => setIsAnimating(!isAnimating)}
373
- />
374
- )}
375
- </Popover>
376
- )
377
- }
378
- )
379
-
380
- MultiSelect.displayName = 'MultiSelect'