@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,393 +0,0 @@
1
- import { Command as CommandPrimitive } from "cmdk";
2
- import { Search } from "lucide-react";
3
- import { cva, type VariantProps } from "class-variance-authority";
4
- import { cn } from "~/components/catalyst-ui";
5
- import { Dialog, DialogContent } from "~/components/catalyst-ui";
6
- import { Button } from "~/components/catalyst-ui";
7
- import React from "react";
8
-
9
- // @dev app/components/catalyst-ui/data/primitive-data.tsx:2631
10
- const commandVariants = cva(
11
- "flex h-full w-full flex-col overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-all",
12
- {
13
- variants: {
14
- variant: {
15
- default: "bg-popover text-popover-foreground border border-border shadow-xs",
16
- framer: "max-w-[640px] w-full p-2 bg-gray-900 rounded-2xl border border-gray-200 shadow-lg font-sans hover:shadow-xl",
17
- linear: "max-w-[640px] w-full bg-gradient-to-br from-[#27282b] to-[#2d2e31] rounded-lg overflow-hidden p-0 font-sans shadow-lg hover:shadow-xl",
18
- raycast: "max-w-[640px] w-full bg-gray-900 rounded-xl py-2 font-sans shadow-lg border border-gray-700 relative hover:shadow-xl",
19
- vercel: "max-w-[640px] w-full p-2 bg-[rgba(22,22,22,0.7)] rounded-xl overflow-hidden font-sans border border-gray-200 shadow-lg transition-all duration-300 hover:shadow-xl",
20
- search: "w-full rounded-2xl border shadow-2xl border-zinc-800 bg-zinc-900 hover:shadow-3xl",
21
- elevated: "bg-surface-container-low text-primary shadow-md hover:shadow-lg active:shadow-sm",
22
- filled: "bg-primary text-on-primary shadow-sm hover:shadow-md active:shadow-sm",
23
- tonal: "bg-secondary-container text-on-secondary-container hover:shadow-sm active:shadow-none",
24
- glass: "bg-background/20 backdrop-blur-md border border-border/50 text-foreground hover:bg-background/30 shadow-lg",
25
- destructive: "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20",
26
- gradient: "bg-gradient-to-r from-primary to-primary/80 text-primary-foreground shadow-md hover:shadow-lg active:shadow-sm",
27
- fumadocs: "w-full divide-y divide-border rounded-2xl border bg-popover/60 backdrop-blur-xl text-popover-foreground shadow-2xl shadow-black/40 overflow-hidden",
28
-
29
- },
30
- },
31
- defaultVariants: {
32
- variant: "default",
33
- },
34
- }
35
- );
36
-
37
- const commandInputVariants = cva(
38
- "flex items-center border-b px-3 transition-all",
39
- {
40
- variants: {
41
- variant: {
42
- default: "",
43
- framer: "h-12 gap-2 border-gray-200 mb-3 pb-2",
44
- linear: "p-0 border-gray-200",
45
- raycast: "border-0 px-4",
46
- vercel: "border-gray-200 px-2 mb-4",
47
- elevated: "border-primary/20",
48
- filled: "border-on-primary/20",
49
- tonal: "border-on-secondary-container/20",
50
- glass: "border-border/30",
51
- destructive: "border-destructive/20",
52
- gradient: "border-primary-foreground/20",
53
- fumadocs: "flex flex-row items-center gap-2 p-3 pb-2 border-0",
54
- },
55
- },
56
- defaultVariants: {
57
- variant: "default",
58
- },
59
- }
60
- );
61
-
62
- const commandInputFieldVariants = cva(
63
- "flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 transition-all focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
64
- {
65
- variants: {
66
- variant: {
67
- default: "h-11",
68
- framer: "h-auto text-base border-none font-sans bg-transparent text-gray-100 placeholder:text-gray-500 focus-visible:ring-blue-500",
69
- linear: "h-auto text-lg p-5 border-none font-sans bg-transparent text-gray-100 placeholder:text-gray-500 rounded-none m-0 caret-[#6e5ed2] focus-visible:ring-[#6e5ed2]",
70
- raycast: "h-auto text-[15px] py-2 px-4 border-none font-sans bg-transparent text-gray-100 placeholder:text-gray-500 focus-visible:ring-gray-400",
71
- vercel: "h-auto text-[17px] py-2 px-2 pb-4 border-none font-sans bg-transparent text-gray-100 placeholder:text-gray-500 rounded-none focus-visible:ring-gray-400",
72
- elevated: "text-primary placeholder:text-primary/60 focus-visible:ring-primary",
73
- filled: "text-on-primary placeholder:text-on-primary/60 focus-visible:ring-on-primary",
74
- tonal: "text-on-secondary-container placeholder:text-on-secondary-container/60 focus-visible:ring-on-secondary-container",
75
- glass: "text-foreground placeholder:text-foreground/60 focus-visible:ring-border",
76
- destructive: "text-white placeholder:text-white/60 focus-visible:ring-destructive",
77
- gradient: "text-primary-foreground placeholder:text-primary-foreground/60 focus-visible:ring-primary-foreground",
78
- fumadocs: "w-0 flex-1 bg-transparent text-lg placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0",
79
-
80
- },
81
- },
82
- defaultVariants: {
83
- variant: "default",
84
- },
85
- }
86
- );
87
-
88
- const commandListVariants = cva(
89
- "overflow-y-auto overflow-x-hidden transition-all",
90
- {
91
- variants: {
92
- variant: {
93
- default: "h-full max-h-[700px]",
94
- framer: "h-full",
95
- linear: "min-h-[300px] max-h-[400px] overflow-auto overscroll-contain transition-[height] duration-100",
96
- raycast: "px-2 h-[393px] overflow-auto overscroll-contain scroll-pb-10 transition-[height] duration-100 pb-10",
97
- vercel: "min-h-[330px] max-h-[400px] overflow-auto overscroll-contain transition-[height] duration-100",
98
- elevated: "max-h-[700px]",
99
- filled: "max-h-[700px]",
100
- tonal: "max-h-[700px]",
101
- glass: "max-h-[700px] backdrop-blur-sm",
102
- destructive: "max-h-[700px]",
103
- gradient: "max-h-[700px]",
104
- fumadocs: "w-full flex flex-col overflow-y-auto max-h-[460px] p-1",
105
-
106
- },
107
- },
108
- defaultVariants: {
109
- variant: "default",
110
- },
111
- }
112
- );
113
-
114
- const commandItemVariants = cva(
115
- "relative flex cursor-pointer select-none items-center px-2 py-1.5 text-sm outline-none transition-all rounded-md aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
116
- {
117
- variants: {
118
- variant: {
119
- default: "border-l-4 border-transparent hover:bg-accent/50 hover:border-primary aria-selected:border-primary",
120
- framer: "rounded-xl text-sm gap-3 text-gray-100 p-2 mr-2 font-medium aria-selected:bg-blue-500 aria-selected:text-white data-[disabled=true]:text-gray-400 data-[disabled=true]:cursor-not-allowed mt-1 first:mt-0 hover:bg-gray-800",
121
- linear: "h-12 text-sm gap-3 px-4 text-gray-100 select-none will-change-[background,color] aria-selected:bg-gray-800 aria-selected:after:content-[''] aria-selected:after:absolute aria-selected:after:left-0 aria-selected:after:z-[123] aria-selected:after:w-[3px] aria-selected:after:h-full aria-selected:after:bg-[#5f6ad2] active:bg-gray-700 data-[disabled=true]:text-gray-400 data-[disabled=true]:cursor-not-allowed mt-1 first:mt-0 hover:bg-gray-800/50",
122
- raycast: "h-10 rounded-lg text-sm gap-2 px-2 text-gray-100 select-none will-change-[background,color] aria-selected:bg-gray-700 aria-selected:text-gray-100 active:bg-gray-700 data-[disabled=true]:text-gray-400 data-[disabled=true]:cursor-not-allowed first:mt-2 mt-1 hover:bg-gray-800",
123
- vercel: "h-12 rounded-lg text-sm gap-2 px-4 text-gray-500 select-none will-change-[background,color] aria-selected:bg-gray-800/50 aria-selected:text-gray-100 active:bg-gray-700 data-[disabled=true]:text-gray-400 data-[disabled=true]:cursor-not-allowed mt-1 first:mt-0 hover:bg-gray-800/30",
124
- elevated: "hover:bg-surface-container-high aria-selected:bg-surface-container-high focus-visible:ring-primary",
125
- filled: "hover:bg-primary/80 aria-selected:bg-primary/80 focus-visible:ring-on-primary",
126
- tonal: "hover:bg-secondary-container/80 aria-selected:bg-secondary-container/80 focus-visible:ring-on-secondary-container",
127
- glass: "hover:bg-background/40 aria-selected:bg-background/40 focus-visible:ring-border",
128
- destructive: "hover:bg-destructive/80 aria-selected:bg-destructive/80 focus-visible:ring-destructive",
129
- gradient: "hover:bg-primary/60 aria-selected:bg-primary/60 focus-visible:ring-primary-foreground",
130
- fumadocs: "relative flex select-none flex-row items-center gap-2 p-2 text-start text-sm rounded-lg font-medium bg-transparent aria-selected:bg-accent aria-selected:text-accent-foreground hover:bg-accent/50",
131
-
132
- },
133
- },
134
- defaultVariants: {
135
- variant: "default",
136
- },
137
- }
138
- );
139
-
140
- const commandGroupVariants = cva(
141
- "overflow-hidden p-1 text-foreground transition-all [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
142
- {
143
- variants: {
144
- variant: {
145
- default: "",
146
- framer: "[&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:mb-2",
147
- linear: "[&_[cmdk-group-heading]]:select-none [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:px-2",
148
- raycast: "[&_[cmdk-group-heading]]:select-none [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:flex [&_[cmdk-group-heading]]:items-center",
149
- vercel: "[&_[cmdk-group-heading]]:select-none [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:text-gray-500 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:flex [&_[cmdk-group-heading]]:items-center [&_[cmdk-group-heading]]:mb-2 mt-2",
150
- elevated: "[&_[cmdk-group-heading]]:text-primary/70",
151
- filled: "[&_[cmdk-group-heading]]:text-on-primary/70",
152
- tonal: "[&_[cmdk-group-heading]]:text-on-secondary-container/70",
153
- glass: "[&_[cmdk-group-heading]]:text-foreground/70",
154
- destructive: "[&_[cmdk-group-heading]]:text-white/70",
155
- gradient: "[&_[cmdk-group-heading]]:text-primary-foreground/70",
156
- fumadocs: "",
157
- },
158
- },
159
- defaultVariants: {
160
- variant: "default",
161
- },
162
- }
163
- );
164
-
165
- interface CommandContextValue {
166
- variant?: 'default' | 'framer' | 'linear' | 'raycast' | 'vercel' | "search" | "elevated" | "filled" | "tonal" | "glass" | "glass" | "destructive" | "gradient" | "fumadocs";
167
- }
168
-
169
- const CommandContext = React.createContext<CommandContextValue>({
170
- variant: 'default',
171
- });
172
-
173
- interface CommandProps extends React.ComponentPropsWithoutRef<typeof CommandPrimitive> {
174
- variant?: 'default' | 'framer' | 'linear' | 'raycast' | 'vercel' | "search" | "elevated" | "filled" | "tonal" | "glass" | "glass" | "destructive" | "gradient" | "fumadocs";
175
- }
176
-
177
- const Command = React.forwardRef<
178
- React.ElementRef<typeof CommandPrimitive>,
179
- CommandProps
180
- >(({ className, variant = 'default', ...props }, ref) => (
181
- <CommandContext.Provider value={{ variant }}>
182
- <CommandPrimitive
183
- ref={ref}
184
- className={cn(commandVariants({ variant }), className)}
185
- {...props}
186
- />
187
- </CommandContext.Provider>
188
- ));
189
- Command.displayName = CommandPrimitive.displayName;
190
-
191
- const CommandInput = React.forwardRef<
192
- React.ElementRef<typeof CommandPrimitive.Input>,
193
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
194
- >(({ placeholder = 'Search...', className, ...props }, ref) => {
195
- const { variant } = React.useContext(CommandContext);
196
-
197
- return (
198
- <div className={cn(commandInputVariants({ variant }))} cmdk-input-wrapper="">
199
- <Search className={cn(
200
- "shrink-0 opacity-50 ",
201
- variant === 'framer' ? "w-5 h-5 text-gray-500" : "mr-2 h-4 w-4"
202
- )} />
203
- <CommandPrimitive.Input
204
- ref={ref}
205
- placeholder={placeholder}
206
- className={cn("focus:outline-none outline-none focus:border-transparent ring-0 focus:ring-0", commandInputFieldVariants({ variant }), className)}
207
- onFocus={(e) => e.target.style.boxShadow = 'none'}
208
- {...props}
209
- />
210
- </div>
211
- );
212
- });
213
- CommandInput.displayName = CommandPrimitive.Input.displayName;
214
-
215
- const CommandList = React.forwardRef<
216
- React.ElementRef<typeof CommandPrimitive.List>,
217
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List> & { MHList?: string }
218
- >(({ maxHeight = "max-h-[400px]", className, ...props }, ref) => {
219
- const { variant } = React.useContext(CommandContext);
220
-
221
- return (
222
- <CommandPrimitive.List
223
- ref={ref}
224
- className={cn(commandListVariants({ variant }), maxHeight, className)}
225
- {...props}
226
- />
227
- );
228
- });
229
- CommandList.displayName = CommandPrimitive.List.displayName;
230
-
231
- const CommandEmpty = React.forwardRef<
232
- React.ElementRef<typeof CommandPrimitive.Empty>,
233
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
234
- >((props, ref) => {
235
- const { variant } = React.useContext(CommandContext);
236
-
237
- return (
238
- <CommandPrimitive.Empty
239
- ref={ref}
240
- className={cn(
241
- "text-center text-sm",
242
- variant === 'framer' && "py-8 whitespace-pre-wrap text-gray-500",
243
- variant === 'linear' && "text-sm flex items-center justify-center h-16 whitespace-pre-wrap text-gray-500",
244
- variant === 'raycast' && "text-sm flex items-center justify-center h-16 whitespace-pre-wrap text-gray-500",
245
- variant === 'vercel' && "text-sm flex items-center justify-center h-12 whitespace-pre-wrap text-gray-500"
246
- )}
247
- {...props}
248
- />
249
- );
250
- });
251
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
252
-
253
- const CommandGroup = React.forwardRef<
254
- React.ElementRef<typeof CommandPrimitive.Group>,
255
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
256
- >(({ className, ...props }, ref) => {
257
- const { variant } = React.useContext(CommandContext);
258
-
259
- return (
260
- <CommandPrimitive.Group
261
- ref={ref}
262
- className={cn(commandGroupVariants({ variant }), className)}
263
- {...props}
264
- />
265
- );
266
- });
267
- CommandGroup.displayName = CommandPrimitive.Group.displayName;
268
-
269
- const CommandItem = React.forwardRef<
270
- React.ElementRef<typeof CommandPrimitive.Item>,
271
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
272
- >(({ className, ...props }, ref) => {
273
- const { variant } = React.useContext(CommandContext);
274
-
275
- return (
276
- <CommandPrimitive.Item
277
- ref={ref}
278
- data-slot="command-item"
279
- className={cn(commandItemVariants({ variant }), className)}
280
- {...props}
281
- />
282
- );
283
- });
284
- CommandItem.displayName = CommandPrimitive.Item.displayName;
285
-
286
- const CommandShortcut = ({
287
- className,
288
- ...props
289
- }: React.HTMLAttributes<HTMLSpanElement>) => {
290
- return (
291
- <span
292
- className={cn(
293
- "ml-auto text-xs tracking-widest text-muted-foreground",
294
- className
295
- )}
296
- {...props}
297
- />
298
- );
299
- };
300
- CommandShortcut.displayName = "CommandShortcut";
301
-
302
- const CommandSeparator = ({
303
- className,
304
- ...props
305
- }: React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>) => {
306
- const { variant } = React.useContext(CommandContext);
307
-
308
- return (
309
- <CommandPrimitive.Separator
310
- className={cn(
311
- variant === 'framer' && "h-px w-full bg-gray-200 my-1",
312
- variant === 'linear' && "h-px w-full bg-gray-200 my-1",
313
- variant === 'raycast' && "h-px w-full bg-gray-200 my-1",
314
- variant === 'vercel' && "h-px w-full bg-gray-200 my-1",
315
- variant === 'default' && "-mx-1 h-px bg-border",
316
- className
317
- )}
318
- {...props}
319
- />
320
- );
321
- };
322
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
323
-
324
- const CommandDialogButton = ({ variant = 'outline', setOpen, buttonChildren, ...buttonProps }: any) => {
325
- return (
326
- <Button
327
- onClick={() => setOpen(true)}
328
- variant={variant}
329
- {...buttonProps}
330
- >
331
- {buttonChildren}
332
- </Button>
333
- );
334
- };
335
-
336
- const CommandDialog = ({ variant = 'default', buttonType = 'input', buttonChildren, children, ...props }: any) => {
337
- const [open, setOpen] = React.useState(false);
338
-
339
- React.useEffect(() => {
340
- const down = (e: KeyboardEvent) => {
341
- if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
342
- e.preventDefault();
343
- setOpen((open) => !open);
344
- }
345
- };
346
- document.addEventListener("keydown", down);
347
- return () => document.removeEventListener("keydown", down);
348
- }, []);
349
-
350
- return (
351
- <>
352
- <CommandDialogButton variant={variant} setOpen={setOpen} buttonChildren={buttonChildren} />
353
- <Dialog open={open} onOpenChange={setOpen} {...props}>
354
- <DialogContent className="overflow-hidden p-0 shadow-lg">
355
- <Command variant={variant}>
356
- {children}
357
- </Command>
358
- </DialogContent>
359
- </Dialog>
360
- </>
361
- );
362
- };
363
-
364
- const CommandDialogCustom = ({ variant = 'default', children, ...props }: any) => {
365
- return (
366
- <Dialog {...props}>
367
- <DialogContent className="overflow-hidden p-0 shadow-lg">
368
- <Command variant={variant}>
369
- {children}
370
- </Command>
371
- </DialogContent>
372
- </Dialog>
373
- );
374
- };
375
-
376
- export {
377
- Command,
378
- CommandDialog,
379
- CommandInput,
380
- CommandList,
381
- CommandEmpty,
382
- CommandGroup,
383
- CommandItem,
384
- CommandShortcut,
385
- CommandSeparator,
386
- CommandDialogCustom,
387
- commandVariants,
388
- commandInputVariants,
389
- commandInputFieldVariants,
390
- commandListVariants,
391
- commandItemVariants,
392
- commandGroupVariants,
393
- };
@@ -1,236 +0,0 @@
1
- import * as React from "react"
2
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
3
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
4
- import { cn } from '~/components/catalyst-ui'
5
-
6
- // @dev app/components/catalyst-ui/data/primitive-data.tsx:1769
7
-
8
- function ContextMenu({
9
- ...props
10
- }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
11
- return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
12
- }
13
-
14
- function ContextMenuTrigger({
15
- ...props
16
- }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
17
- return (
18
- <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
19
- )
20
- }
21
-
22
- function ContextMenuGroup({
23
- ...props
24
- }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
25
- return (
26
- <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
27
- )
28
- }
29
-
30
- function ContextMenuPortal({
31
- ...props
32
- }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
33
- return (
34
- <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
35
- )
36
- }
37
-
38
- function ContextMenuSub({
39
- ...props
40
- }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
41
- return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />
42
- }
43
-
44
- function ContextMenuRadioGroup({
45
- ...props
46
- }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
47
- return (
48
- <ContextMenuPrimitive.RadioGroup
49
- data-slot="context-menu-radio-group"
50
- {...props}
51
- />
52
- )
53
- }
54
-
55
- function ContextMenuSubTrigger({
56
- className,
57
- inset,
58
- children,
59
- ...props
60
- }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
61
- inset?: boolean
62
- }) {
63
- return (
64
- <ContextMenuPrimitive.SubTrigger
65
- data-slot="context-menu-sub-trigger"
66
- data-inset={inset}
67
- className={cn(
68
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
69
- className
70
- )}
71
- {...props}
72
- >
73
- {children}
74
- <ChevronRightIcon className="ml-auto" />
75
- </ContextMenuPrimitive.SubTrigger>
76
- )
77
- }
78
-
79
- function ContextMenuSubContent({
80
- className,
81
- ...props
82
- }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
83
- return (
84
- <ContextMenuPrimitive.SubContent
85
- data-slot="context-menu-sub-content"
86
- className={cn(
87
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
88
- className
89
- )}
90
- {...props}
91
- />
92
- )
93
- }
94
-
95
- function ContextMenuContent({
96
- className,
97
- ...props
98
- }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
99
- return (
100
- <ContextMenuPrimitive.Portal>
101
- <ContextMenuPrimitive.Content
102
- data-slot="context-menu-content"
103
- className={cn(
104
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
105
- className
106
- )}
107
- {...props}
108
- />
109
- </ContextMenuPrimitive.Portal>
110
- )
111
- }
112
-
113
- function ContextMenuItem({
114
- className,
115
- inset,
116
- variant = "default",
117
- ...props
118
- }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
119
- inset?: boolean
120
- variant?: "default" | "destructive"
121
- }) {
122
- return (
123
- <ContextMenuPrimitive.Item
124
- data-slot="context-menu-item"
125
- data-inset={inset}
126
- data-variant={variant}
127
- className={cn(
128
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
129
- className
130
- )}
131
- {...props}
132
- />
133
- )
134
- }
135
-
136
- function ContextMenuCheckboxItem({
137
- className,
138
- children,
139
- checked,
140
- ...props
141
- }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
142
- return (
143
- <ContextMenuPrimitive.CheckboxItem
144
- data-slot="context-menu-checkbox-item"
145
- className={cn(
146
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
147
- className
148
- )}
149
- checked={checked}
150
- {...props}
151
- >
152
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
153
- <ContextMenuPrimitive.ItemIndicator>
154
- <CheckIcon className="size-4" />
155
- </ContextMenuPrimitive.ItemIndicator>
156
- </span>
157
- {children}
158
- </ContextMenuPrimitive.CheckboxItem>
159
- )
160
- }
161
-
162
- function ContextMenuRadioItem({
163
- className,
164
- children,
165
- ...props
166
- }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
167
- return (
168
- <ContextMenuPrimitive.RadioItem
169
- data-slot="context-menu-radio-item"
170
- className={cn(
171
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
172
- className
173
- )}
174
- {...props}
175
- >
176
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
177
- <ContextMenuPrimitive.ItemIndicator>
178
- <CircleIcon className="size-2 fill-current" />
179
- </ContextMenuPrimitive.ItemIndicator>
180
- </span>
181
- {children}
182
- </ContextMenuPrimitive.RadioItem>
183
- )
184
- }
185
-
186
- function ContextMenuLabel({
187
- className,
188
- inset,
189
- ...props
190
- }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
191
- inset?: boolean
192
- }) {
193
- return (
194
- <ContextMenuPrimitive.Label
195
- data-slot="context-menu-label"
196
- data-inset={inset}
197
- className={cn(
198
- "text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
199
- className
200
- )}
201
- {...props}
202
- />
203
- )
204
- }
205
-
206
- function ContextMenuSeparator({
207
- className,
208
- ...props
209
- }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
210
- return (
211
- <ContextMenuPrimitive.Separator
212
- data-slot="context-menu-separator"
213
- className={cn("bg-border -mx-1 my-1 h-px", className)}
214
- {...props}
215
- />
216
- )
217
- }
218
-
219
- function ContextMenuShortcut({
220
- className,
221
- ...props
222
- }: React.ComponentProps<"span">) {
223
- return (
224
- <span
225
- data-slot="context-menu-shortcut"
226
- className={cn(
227
- "text-muted-foreground ml-auto text-xs tracking-widest",
228
- className
229
- )}
230
- {...props}
231
- />
232
- )
233
- }
234
-
235
- export { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuGroup, ContextMenuPortal, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuRadioGroup
236
- }