create-disposabl-app 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/disposabl.js +1 -1
  2. package/dist/index.js +2 -2
  3. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +1 -1
  4. package/dist/templates/default/bun.lock +16 -1230
  5. package/dist/templates/default/packages/cli/README.md +9 -24
  6. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +1 -1
  7. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +1 -1
  8. package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +71 -13
  9. package/dist/templates/default/packages/disposabl-kit/package.json +0 -12
  10. package/package.json +1 -1
  11. package/dist/templates/default/apps/web/src/components/connections/expo-connection.tsx +0 -97
  12. package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +0 -44
  13. package/dist/templates/default/apps/web/src/components/connections/use-connection-setup.ts +0 -169
  14. package/dist/templates/default/packages/disposabl-kit/client/components/ui/accordion.tsx +0 -77
  15. package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert-dialog.tsx +0 -185
  16. package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert.tsx +0 -75
  17. package/dist/templates/default/packages/disposabl-kit/client/components/ui/aspect-ratio.tsx +0 -22
  18. package/dist/templates/default/packages/disposabl-kit/client/components/ui/attachment.tsx +0 -207
  19. package/dist/templates/default/packages/disposabl-kit/client/components/ui/avatar.tsx +0 -106
  20. package/dist/templates/default/packages/disposabl-kit/client/components/ui/badge.tsx +0 -51
  21. package/dist/templates/default/packages/disposabl-kit/client/components/ui/breadcrumb.tsx +0 -121
  22. package/dist/templates/default/packages/disposabl-kit/client/components/ui/bubble.tsx +0 -127
  23. package/dist/templates/default/packages/disposabl-kit/client/components/ui/button-group.tsx +0 -87
  24. package/dist/templates/default/packages/disposabl-kit/client/components/ui/calendar.tsx +0 -241
  25. package/dist/templates/default/packages/disposabl-kit/client/components/ui/carousel.tsx +0 -239
  26. package/dist/templates/default/packages/disposabl-kit/client/components/ui/chart.tsx +0 -368
  27. package/dist/templates/default/packages/disposabl-kit/client/components/ui/checkbox.tsx +0 -27
  28. package/dist/templates/default/packages/disposabl-kit/client/components/ui/code-block.tsx +0 -243
  29. package/dist/templates/default/packages/disposabl-kit/client/components/ui/collapsible.tsx +0 -19
  30. package/dist/templates/default/packages/disposabl-kit/client/components/ui/combobox.tsx +0 -300
  31. package/dist/templates/default/packages/disposabl-kit/client/components/ui/command.tsx +0 -194
  32. package/dist/templates/default/packages/disposabl-kit/client/components/ui/context-menu.tsx +0 -271
  33. package/dist/templates/default/packages/disposabl-kit/client/components/ui/dialog.tsx +0 -156
  34. package/dist/templates/default/packages/disposabl-kit/client/components/ui/direction.tsx +0 -4
  35. package/dist/templates/default/packages/disposabl-kit/client/components/ui/drawer.tsx +0 -224
  36. package/dist/templates/default/packages/disposabl-kit/client/components/ui/dropdown-menu.tsx +0 -269
  37. package/dist/templates/default/packages/disposabl-kit/client/components/ui/empty.tsx +0 -103
  38. package/dist/templates/default/packages/disposabl-kit/client/components/ui/hover-card.tsx +0 -50
  39. package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-group.tsx +0 -158
  40. package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-otp.tsx +0 -83
  41. package/dist/templates/default/packages/disposabl-kit/client/components/ui/item.tsx +0 -201
  42. package/dist/templates/default/packages/disposabl-kit/client/components/ui/kbd.tsx +0 -26
  43. package/dist/templates/default/packages/disposabl-kit/client/components/ui/marker.tsx +0 -70
  44. package/dist/templates/default/packages/disposabl-kit/client/components/ui/menubar.tsx +0 -284
  45. package/dist/templates/default/packages/disposabl-kit/client/components/ui/message-scroller.tsx +0 -128
  46. package/dist/templates/default/packages/disposabl-kit/client/components/ui/message.tsx +0 -91
  47. package/dist/templates/default/packages/disposabl-kit/client/components/ui/native-select.tsx +0 -64
  48. package/dist/templates/default/packages/disposabl-kit/client/components/ui/navigation-menu.tsx +0 -170
  49. package/dist/templates/default/packages/disposabl-kit/client/components/ui/pagination.tsx +0 -133
  50. package/dist/templates/default/packages/disposabl-kit/client/components/ui/popover.tsx +0 -87
  51. package/dist/templates/default/packages/disposabl-kit/client/components/ui/progress.tsx +0 -82
  52. package/dist/templates/default/packages/disposabl-kit/client/components/ui/questionnaire.tsx +0 -330
  53. package/dist/templates/default/packages/disposabl-kit/client/components/ui/radio-group.tsx +0 -35
  54. package/dist/templates/default/packages/disposabl-kit/client/components/ui/resizable.tsx +0 -49
  55. package/dist/templates/default/packages/disposabl-kit/client/components/ui/scroll-area.tsx +0 -51
  56. package/dist/templates/default/packages/disposabl-kit/client/components/ui/select.tsx +0 -201
  57. package/dist/templates/default/packages/disposabl-kit/client/components/ui/sheet.tsx +0 -132
  58. package/dist/templates/default/packages/disposabl-kit/client/components/ui/sidebar.tsx +0 -723
  59. package/dist/templates/default/packages/disposabl-kit/client/components/ui/skeleton.tsx +0 -13
  60. package/dist/templates/default/packages/disposabl-kit/client/components/ui/slider.tsx +0 -51
  61. package/dist/templates/default/packages/disposabl-kit/client/components/ui/switch.tsx +0 -31
  62. package/dist/templates/default/packages/disposabl-kit/client/components/ui/table.tsx +0 -113
  63. package/dist/templates/default/packages/disposabl-kit/client/components/ui/tabs.tsx +0 -81
  64. package/dist/templates/default/packages/disposabl-kit/client/components/ui/textarea.tsx +0 -17
  65. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toast.tsx +0 -229
  66. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle-group.tsx +0 -87
  67. package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle.tsx +0 -42
  68. package/dist/templates/default/packages/disposabl-kit/client/components/ui/tooltip.tsx +0 -65
  69. package/dist/templates/default/packages/disposabl-kit/client/components/ui/trace.tsx +0 -161
  70. package/dist/templates/default/packages/disposabl-kit/client/hooks/use-mobile.ts +0 -21
@@ -1,243 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { cva, type VariantProps } from "class-variance-authority";
5
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
6
-
7
- import { Button } from "@disposabl/disposabl-kit/client/components/ui/button";
8
- import { CheckIcon, CopyIcon } from "lucide-react";
9
-
10
- const codeBlockVariants = cva(
11
- "group/code-block relative flex w-full min-w-0 flex-col overflow-hidden rounded-lg text-sm has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/50 data-[size=sm]:text-xs",
12
- {
13
- variants: {
14
- variant: {
15
- default:
16
- "border border-input text-foreground has-[>[data-slot=code-block-content]:focus-visible]:border-ring dark:bg-input/30",
17
- destructive:
18
- "border border-destructive/30 text-destructive dark:border-destructive/40",
19
- },
20
- },
21
- defaultVariants: {
22
- variant: "default",
23
- },
24
- },
25
- );
26
-
27
- function CodeBlock({
28
- className,
29
- variant = "default",
30
- size = "default",
31
- ...props
32
- }: React.ComponentProps<"div"> &
33
- VariantProps<typeof codeBlockVariants> & { size?: "default" | "sm" }) {
34
- return (
35
- <div
36
- data-slot="code-block"
37
- data-variant={variant}
38
- data-size={size}
39
- className={cn(codeBlockVariants({ variant }), className)}
40
- {...props}
41
- />
42
- );
43
- }
44
-
45
- function CodeBlockHeader({ className, ...props }: React.ComponentProps<"div">) {
46
- return (
47
- <div
48
- data-slot="code-block-header"
49
- className={cn(
50
- "flex min-w-0 shrink-0 items-center gap-2 px-4 pt-4 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pt-3 group-data-[variant=destructive]/code-block:text-destructive *:has-[>[data-slot=code-block-title]]:min-w-0",
51
- className,
52
- )}
53
- {...props}
54
- />
55
- );
56
- }
57
-
58
- function CodeBlockTitle({ className, ...props }: React.ComponentProps<"div">) {
59
- return (
60
- <div
61
- data-slot="code-block-title"
62
- className={cn(
63
- "min-w-0 truncate font-sans text-sm font-medium text-foreground group-data-[size=sm]/code-block:text-xs group-data-[variant=destructive]/code-block:text-destructive [&_svg]:pointer-events-none [&_svg]:inline-block [&_svg]:align-middle [&_svg:not([class*='size-'])]:size-4 group-data-[size=sm]/code-block:[&_svg:not([class*='size-'])]:size-3.5 *:[svg]:me-1.5",
64
- className,
65
- )}
66
- {...props}
67
- />
68
- );
69
- }
70
-
71
- function CodeBlockActions({
72
- className,
73
- ...props
74
- }: React.ComponentProps<"div">) {
75
- return (
76
- <div
77
- data-slot="code-block-actions"
78
- className={cn(
79
- "-my-1 ms-auto -me-1.5 flex shrink-0 items-center gap-1 [[data-slot=code-block]>&]:absolute [[data-slot=code-block]>&]:end-3 [[data-slot=code-block]>&]:top-3 [[data-slot=code-block]>&]:z-10 [[data-slot=code-block]>&]:m-0 [[data-slot=code-block]>&]:opacity-0 [[data-slot=code-block]>&]:transition-opacity [[data-slot=code-block]>&]:group-focus-within/code-block:opacity-100 [[data-slot=code-block]>&]:group-hover/code-block:opacity-100 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:end-2 group-data-[size=sm]/code-block:[[data-slot=code-block]>&]:top-2 [[data-slot=code-block]>&]:pointer-coarse:opacity-100 [[data-slot=code-block]>&]:*:[button]:bg-background [[data-slot=code-block]>&]:*:[button]:ring-1 [[data-slot=code-block]>&]:*:[button]:ring-foreground/10",
80
- className,
81
- )}
82
- {...props}
83
- />
84
- );
85
- }
86
-
87
- function CodeBlockCopyButton({
88
- value,
89
- variant = "ghost",
90
- size = "icon-xs",
91
- className,
92
- onClick,
93
- ...props
94
- }: React.ComponentProps<typeof Button> & { value: string }) {
95
- const [copied, setCopied] = React.useState(false);
96
-
97
- React.useEffect(() => {
98
- if (!copied) {
99
- return;
100
- }
101
-
102
- const timeout = setTimeout(() => setCopied(false), 2000);
103
- return () => clearTimeout(timeout);
104
- }, [copied]);
105
-
106
- return (
107
- <>
108
- <Button
109
- data-slot="code-block-copy-button"
110
- data-copied={copied || undefined}
111
- variant={variant}
112
- size={size}
113
- aria-label={copied ? "Copied" : "Copy"}
114
- className={cn(className)}
115
- onClick={(event) => {
116
- onClick?.(event);
117
- navigator.clipboard
118
- .writeText(value)
119
- .then(() => setCopied(true))
120
- .catch(() => {});
121
- }}
122
- {...props}
123
- >
124
- {copied ? <CheckIcon /> : <CopyIcon />}
125
- </Button>
126
- <span aria-live="polite" className="sr-only">
127
- {copied ? "Copied" : ""}
128
- </span>
129
- </>
130
- );
131
- }
132
-
133
- function CodeBlockContent({
134
- className,
135
- children,
136
- style,
137
- wrap = false,
138
- lineNumbers = false,
139
- startLine = 1,
140
- ...props
141
- }: React.ComponentProps<"pre"> & {
142
- wrap?: boolean;
143
- lineNumbers?: boolean;
144
- startLine?: number;
145
- }) {
146
- return (
147
- <pre
148
- data-slot="code-block-content"
149
- data-wrap={wrap || undefined}
150
- data-numbered={lineNumbers || undefined}
151
- dir="ltr"
152
- tabIndex={0}
153
- style={{ counterReset: `line ${startLine - 1}`, ...style }}
154
- className={cn(
155
- "min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto px-4 py-4 text-start font-mono leading-relaxed outline-none group-has-data-[slot=code-block-footer]/code-block:pb-2 group-has-data-[slot=code-block-header]/code-block:pt-2 group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:py-3 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap",
156
- className,
157
- )}
158
- {...props}
159
- >
160
- <code
161
- data-slot="code-block-code"
162
- className="grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0"
163
- >
164
- {lineNumbers && typeof children === "string"
165
- ? children
166
- .replace(/\n$/, "")
167
- .split("\n")
168
- .map((line, index) => (
169
- <CodeBlockLine key={index}>{line}</CodeBlockLine>
170
- ))
171
- : children}
172
- </code>
173
- </pre>
174
- );
175
- }
176
-
177
- const codeBlockLineVariants = cva(
178
- "relative -mx-4 block min-h-lh px-4 group-data-[size=sm]/code-block:-mx-3 group-data-[size=sm]/code-block:px-3 before:min-w-6 before:text-end before:text-muted-foreground after:absolute after:start-1 after:top-0 after:text-muted-foreground after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:gap-x-3 in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']",
179
- {
180
- variants: {
181
- variant: {
182
- default: "",
183
- added: "bg-muted after:content-['+']",
184
- removed: "bg-destructive/10 after:text-destructive after:content-['−']",
185
- highlighted: "bg-muted",
186
- },
187
- },
188
- defaultVariants: {
189
- variant: "default",
190
- },
191
- },
192
- );
193
-
194
- function CodeBlockLine({
195
- className,
196
- variant = "default",
197
- children,
198
- ...props
199
- }: React.ComponentProps<"span"> & VariantProps<typeof codeBlockLineVariants>) {
200
- // An empty line holds a newline so copying a selection keeps blank lines.
201
- const empty =
202
- children === undefined ||
203
- children === null ||
204
- children === "" ||
205
- (Array.isArray(children) && children.length === 0);
206
-
207
- return (
208
- <span
209
- data-slot="code-block-line"
210
- data-variant={variant}
211
- className={cn(codeBlockLineVariants({ variant }), className)}
212
- {...props}
213
- >
214
- <span data-slot="code-block-line-content" className="min-w-0">
215
- {empty ? "\n" : children}
216
- </span>
217
- </span>
218
- );
219
- }
220
-
221
- function CodeBlockFooter({ className, ...props }: React.ComponentProps<"div">) {
222
- return (
223
- <div
224
- data-slot="code-block-footer"
225
- className={cn(
226
- "flex min-w-0 shrink-0 items-center gap-2 px-4 pb-4 text-muted-foreground group-data-[size=sm]/code-block:px-3 group-data-[size=sm]/code-block:pb-3",
227
- className,
228
- )}
229
- {...props}
230
- />
231
- );
232
- }
233
-
234
- export {
235
- CodeBlock,
236
- CodeBlockHeader,
237
- CodeBlockTitle,
238
- CodeBlockActions,
239
- CodeBlockCopyButton,
240
- CodeBlockContent,
241
- CodeBlockLine,
242
- CodeBlockFooter,
243
- };
@@ -1,19 +0,0 @@
1
- import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
2
-
3
- function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {
4
- return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
5
- }
6
-
7
- function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {
8
- return (
9
- <CollapsiblePrimitive.Trigger data-slot="collapsible-trigger" {...props} />
10
- );
11
- }
12
-
13
- function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {
14
- return (
15
- <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />
16
- );
17
- }
18
-
19
- export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -1,300 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { Combobox as ComboboxPrimitive } from "@base-ui/react";
5
- import { cn } from "@disposabl/disposabl-kit/client/lib/utils";
6
-
7
- import { Button } from "@disposabl/disposabl-kit/client/components/ui/button";
8
- import {
9
- InputGroup,
10
- InputGroupAddon,
11
- InputGroupButton,
12
- InputGroupInput,
13
- } from "@disposabl/disposabl-kit/client/components/ui/input-group";
14
- import { ChevronDownIcon, XIcon, CheckIcon } from "lucide-react";
15
-
16
- const Combobox = ComboboxPrimitive.Root;
17
-
18
- function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
19
- return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />;
20
- }
21
-
22
- function ComboboxTrigger({
23
- className,
24
- children,
25
- ...props
26
- }: ComboboxPrimitive.Trigger.Props) {
27
- return (
28
- <ComboboxPrimitive.Trigger
29
- data-slot="combobox-trigger"
30
- className={cn("[&_svg:not([class*='size-'])]:size-4", className)}
31
- {...props}
32
- >
33
- {children}
34
- <ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
35
- </ComboboxPrimitive.Trigger>
36
- );
37
- }
38
-
39
- function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
40
- return (
41
- <ComboboxPrimitive.Clear
42
- data-slot="combobox-clear"
43
- render={<InputGroupButton variant="ghost" size="icon-xs" />}
44
- className={cn(className)}
45
- {...props}
46
- >
47
- <XIcon className="pointer-events-none" />
48
- </ComboboxPrimitive.Clear>
49
- );
50
- }
51
-
52
- function ComboboxInput({
53
- className,
54
- children,
55
- disabled = false,
56
- showTrigger = true,
57
- showClear = false,
58
- ...props
59
- }: ComboboxPrimitive.Input.Props & {
60
- showTrigger?: boolean;
61
- showClear?: boolean;
62
- }) {
63
- return (
64
- <InputGroup className={cn("w-auto", className)}>
65
- <ComboboxPrimitive.Input
66
- render={<InputGroupInput disabled={disabled} />}
67
- {...props}
68
- />
69
- <InputGroupAddon align="inline-end">
70
- {showTrigger && (
71
- <InputGroupButton
72
- size="icon-xs"
73
- variant="ghost"
74
- render={<ComboboxTrigger />}
75
- data-slot="input-group-button"
76
- className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"
77
- disabled={disabled}
78
- />
79
- )}
80
- {showClear && <ComboboxClear disabled={disabled} />}
81
- </InputGroupAddon>
82
- {children}
83
- </InputGroup>
84
- );
85
- }
86
-
87
- function ComboboxContent({
88
- className,
89
- side = "bottom",
90
- sideOffset = 6,
91
- align = "start",
92
- alignOffset = 0,
93
- anchor,
94
- ...props
95
- }: ComboboxPrimitive.Popup.Props &
96
- Pick<
97
- ComboboxPrimitive.Positioner.Props,
98
- "side" | "align" | "sideOffset" | "alignOffset" | "anchor"
99
- >) {
100
- return (
101
- <ComboboxPrimitive.Portal>
102
- <ComboboxPrimitive.Positioner
103
- side={side}
104
- sideOffset={sideOffset}
105
- align={align}
106
- alignOffset={alignOffset}
107
- anchor={anchor}
108
- className="isolate z-50"
109
- >
110
- <ComboboxPrimitive.Popup
111
- data-slot="combobox-content"
112
- data-chips={!!anchor}
113
- className={cn(
114
- "group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
115
- className,
116
- )}
117
- {...props}
118
- />
119
- </ComboboxPrimitive.Positioner>
120
- </ComboboxPrimitive.Portal>
121
- );
122
- }
123
-
124
- function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
125
- return (
126
- <ComboboxPrimitive.List
127
- data-slot="combobox-list"
128
- className={cn(
129
- "no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0",
130
- className,
131
- )}
132
- {...props}
133
- />
134
- );
135
- }
136
-
137
- function ComboboxItem({
138
- className,
139
- children,
140
- ...props
141
- }: ComboboxPrimitive.Item.Props) {
142
- return (
143
- <ComboboxPrimitive.Item
144
- data-slot="combobox-item"
145
- className={cn(
146
- "relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground 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
- {...props}
150
- >
151
- {children}
152
- <ComboboxPrimitive.ItemIndicator
153
- render={
154
- <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />
155
- }
156
- >
157
- <CheckIcon className="pointer-events-none" />
158
- </ComboboxPrimitive.ItemIndicator>
159
- </ComboboxPrimitive.Item>
160
- );
161
- }
162
-
163
- function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
164
- return (
165
- <ComboboxPrimitive.Group
166
- data-slot="combobox-group"
167
- className={cn(className)}
168
- {...props}
169
- />
170
- );
171
- }
172
-
173
- function ComboboxLabel({
174
- className,
175
- ...props
176
- }: ComboboxPrimitive.GroupLabel.Props) {
177
- return (
178
- <ComboboxPrimitive.GroupLabel
179
- data-slot="combobox-label"
180
- className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
181
- {...props}
182
- />
183
- );
184
- }
185
-
186
- function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
187
- return (
188
- <ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
189
- );
190
- }
191
-
192
- function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
193
- return (
194
- <ComboboxPrimitive.Empty
195
- data-slot="combobox-empty"
196
- className={cn(
197
- "hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex",
198
- className,
199
- )}
200
- {...props}
201
- />
202
- );
203
- }
204
-
205
- function ComboboxSeparator({
206
- className,
207
- ...props
208
- }: ComboboxPrimitive.Separator.Props) {
209
- return (
210
- <ComboboxPrimitive.Separator
211
- data-slot="combobox-separator"
212
- className={cn("-mx-1 my-1 h-px bg-border", className)}
213
- {...props}
214
- />
215
- );
216
- }
217
-
218
- function ComboboxChips({
219
- className,
220
- ...props
221
- }: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &
222
- ComboboxPrimitive.Chips.Props) {
223
- return (
224
- <ComboboxPrimitive.Chips
225
- data-slot="combobox-chips"
226
- className={cn(
227
- "flex min-h-9 flex-wrap items-center gap-1.5 rounded-md border border-input bg-transparent bg-clip-padding px-2.5 py-1.5 text-sm shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
228
- className,
229
- )}
230
- {...props}
231
- />
232
- );
233
- }
234
-
235
- function ComboboxChip({
236
- className,
237
- children,
238
- showRemove = true,
239
- ...props
240
- }: ComboboxPrimitive.Chip.Props & {
241
- showRemove?: boolean;
242
- }) {
243
- return (
244
- <ComboboxPrimitive.Chip
245
- data-slot="combobox-chip"
246
- className={cn(
247
- "flex h-[calc(--spacing(5.5))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0",
248
- className,
249
- )}
250
- {...props}
251
- >
252
- {children}
253
- {showRemove && (
254
- <ComboboxPrimitive.ChipRemove
255
- render={<Button variant="ghost" size="icon-xs" />}
256
- className="-ml-1 opacity-50 hover:opacity-100"
257
- data-slot="combobox-chip-remove"
258
- >
259
- <XIcon className="pointer-events-none" />
260
- </ComboboxPrimitive.ChipRemove>
261
- )}
262
- </ComboboxPrimitive.Chip>
263
- );
264
- }
265
-
266
- function ComboboxChipsInput({
267
- className,
268
- ...props
269
- }: ComboboxPrimitive.Input.Props) {
270
- return (
271
- <ComboboxPrimitive.Input
272
- data-slot="combobox-chip-input"
273
- className={cn("min-w-16 flex-1 outline-none", className)}
274
- {...props}
275
- />
276
- );
277
- }
278
-
279
- function useComboboxAnchor() {
280
- return React.useRef<HTMLDivElement | null>(null);
281
- }
282
-
283
- export {
284
- Combobox,
285
- ComboboxInput,
286
- ComboboxContent,
287
- ComboboxList,
288
- ComboboxItem,
289
- ComboboxGroup,
290
- ComboboxLabel,
291
- ComboboxCollection,
292
- ComboboxEmpty,
293
- ComboboxSeparator,
294
- ComboboxChips,
295
- ComboboxChip,
296
- ComboboxChipsInput,
297
- ComboboxTrigger,
298
- ComboboxValue,
299
- useComboboxAnchor,
300
- };