create-croissant 0.1.39 → 0.1.41
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.
- package/dist/index.js +5 -5
- package/package.json +7 -10
- package/template/.oxlintignore +11 -0
- package/template/README.md +6 -6
- package/template/apps/desktop/README.md +1 -1
- package/template/apps/desktop/electron-builder.yml +6 -6
- package/template/apps/desktop/electron.vite.config.ts +8 -8
- package/template/apps/desktop/package.json +4 -13
- package/template/apps/desktop/src/main/index.ts +32 -32
- package/template/apps/desktop/src/preload/index.d.ts +3 -3
- package/template/apps/desktop/src/preload/index.ts +8 -8
- package/template/apps/desktop/src/renderer/src/App.tsx +5 -5
- package/template/apps/desktop/src/renderer/src/assets/base.css +4 -4
- package/template/apps/desktop/src/renderer/src/assets/main.css +3 -3
- package/template/apps/desktop/src/renderer/src/components/Versions.tsx +4 -4
- package/template/apps/desktop/src/renderer/src/main.tsx +7 -7
- package/template/apps/desktop/tsconfig.json +1 -4
- package/template/apps/desktop/tsconfig.node.json +1 -1
- package/template/apps/desktop/tsconfig.web.json +4 -11
- package/template/apps/mobile/app/(tabs)/_layout.tsx +11 -10
- package/template/apps/mobile/app/(tabs)/explore.tsx +29 -27
- package/template/apps/mobile/app/(tabs)/index.tsx +25 -24
- package/template/apps/mobile/app/_layout.tsx +8 -8
- package/template/apps/mobile/app/modal.tsx +6 -6
- package/template/apps/mobile/components/external-link.tsx +5 -5
- package/template/apps/mobile/components/haptic-tab.tsx +4 -4
- package/template/apps/mobile/components/hello-wave.tsx +5 -4
- package/template/apps/mobile/components/parallax-scroll-view.tsx +15 -13
- package/template/apps/mobile/components/themed-text.tsx +14 -14
- package/template/apps/mobile/components/themed-view.tsx +3 -3
- package/template/apps/mobile/components/ui/collapsible.tsx +14 -13
- package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +4 -4
- package/template/apps/mobile/components/ui/icon-symbol.tsx +9 -9
- package/template/apps/mobile/constants/theme.ts +19 -19
- package/template/apps/mobile/hooks/use-color-scheme.ts +1 -1
- package/template/apps/mobile/hooks/use-color-scheme.web.ts +3 -3
- package/template/apps/mobile/hooks/use-theme-color.ts +4 -4
- package/template/apps/mobile/package.json +3 -6
- package/template/apps/mobile/scripts/reset-project.js +2 -2
- package/template/apps/mobile/tsconfig.json +2 -9
- package/template/apps/platform/drizzle.config.ts +5 -5
- package/template/apps/platform/package.json +2 -6
- package/template/apps/platform/src/components/app-sidebar.tsx +60 -69
- package/template/apps/platform/src/components/login-form.tsx +32 -39
- package/template/apps/platform/src/components/search-form.tsx +5 -13
- package/template/apps/platform/src/components/signup-form.tsx +39 -49
- package/template/apps/platform/src/components/version-switcher.tsx +11 -21
- package/template/apps/platform/src/lib/auth-utils.ts +12 -14
- package/template/apps/platform/src/lib/orpc.ts +17 -17
- package/template/apps/platform/src/routeTree.gen.ts +264 -267
- package/template/apps/platform/src/router.tsx +5 -5
- package/template/apps/platform/src/routes/__root.tsx +13 -15
- package/template/apps/platform/src/routes/_auth/account.tsx +61 -50
- package/template/apps/platform/src/routes/_auth/dashboard.tsx +17 -17
- package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +13 -13
- package/template/apps/platform/src/routes/_auth/examples/ssr-orpc-auth.tsx +17 -17
- package/template/apps/platform/src/routes/_auth.tsx +5 -5
- package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +108 -88
- package/template/apps/platform/src/routes/_public/examples/isr.tsx +14 -14
- package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +92 -75
- package/template/apps/platform/src/routes/_public/index.tsx +22 -19
- package/template/apps/platform/src/routes/_public/login.tsx +4 -4
- package/template/apps/platform/src/routes/_public/signup.tsx +6 -5
- package/template/apps/platform/src/routes/_public.tsx +5 -5
- package/template/apps/platform/src/routes/api/auth/$.ts +13 -13
- package/template/apps/platform/src/routes/api/rpc.$.ts +13 -13
- package/template/apps/platform/tsconfig.json +1 -1
- package/template/apps/platform/vite.config.ts +8 -8
- package/template/docker-compose.yml +1 -1
- package/template/package.json +24 -22
- package/template/packages/auth/package.json +8 -12
- package/template/packages/auth/src/lib/auth.ts +1 -1
- package/template/packages/auth/tsconfig.json +1 -1
- package/template/packages/db/package.json +6 -10
- package/template/packages/db/src/index.ts +4 -4
- package/template/packages/db/src/schema.ts +2 -2
- package/template/packages/db/tsconfig.json +1 -1
- package/template/packages/orpc/package.json +6 -10
- package/template/packages/orpc/src/lib/planets.ts +39 -43
- package/template/packages/orpc/src/lib/router.ts +15 -15
- package/template/packages/orpc/tsconfig.json +1 -1
- package/template/packages/ui/package.json +8 -12
- package/template/packages/ui/src/components/accordion.tsx +20 -22
- package/template/packages/ui/src/components/alert-dialog.tsx +31 -56
- package/template/packages/ui/src/components/alert.tsx +15 -23
- package/template/packages/ui/src/components/aspect-ratio.tsx +3 -3
- package/template/packages/ui/src/components/avatar.tsx +19 -35
- package/template/packages/ui/src/components/badge.tsx +13 -17
- package/template/packages/ui/src/components/breadcrumb.tsx +22 -44
- package/template/packages/ui/src/components/button-group.tsx +16 -25
- package/template/packages/ui/src/components/button.tsx +8 -9
- package/template/packages/ui/src/components/calendar.tsx +43 -82
- package/template/packages/ui/src/components/card.tsx +15 -26
- package/template/packages/ui/src/components/carousel.tsx +70 -78
- package/template/packages/ui/src/components/chart.tsx +84 -117
- package/template/packages/ui/src/components/checkbox.tsx +8 -9
- package/template/packages/ui/src/components/collapsible.tsx +5 -9
- package/template/packages/ui/src/components/combobox.tsx +44 -68
- package/template/packages/ui/src/components/command.tsx +32 -47
- package/template/packages/ui/src/components/context-menu.tsx +45 -71
- package/template/packages/ui/src/components/dialog.tsx +29 -51
- package/template/packages/ui/src/components/direction.tsx +1 -4
- package/template/packages/ui/src/components/drawer.tsx +24 -38
- package/template/packages/ui/src/components/dropdown-menu.tsx +45 -55
- package/template/packages/ui/src/components/empty.tsx +16 -27
- package/template/packages/ui/src/components/field.tsx +49 -63
- package/template/packages/ui/src/components/hover-card.tsx +9 -14
- package/template/packages/ui/src/components/input-group.tsx +40 -52
- package/template/packages/ui/src/components/input-otp.tsx +17 -18
- package/template/packages/ui/src/components/input.tsx +6 -6
- package/template/packages/ui/src/components/item.tsx +31 -44
- package/template/packages/ui/src/components/kbd.tsx +5 -5
- package/template/packages/ui/src/components/label.tsx +6 -6
- package/template/packages/ui/src/components/menubar.tsx +51 -64
- package/template/packages/ui/src/components/mode-toggle.tsx +9 -15
- package/template/packages/ui/src/components/native-select.tsx +18 -24
- package/template/packages/ui/src/components/navigation-menu.tsx +28 -35
- package/template/packages/ui/src/components/pagination.tsx +19 -31
- package/template/packages/ui/src/components/popover.tsx +13 -26
- package/template/packages/ui/src/components/progress.tsx +13 -30
- package/template/packages/ui/src/components/radio-group.tsx +7 -7
- package/template/packages/ui/src/components/resizable.tsx +12 -20
- package/template/packages/ui/src/components/scroll-area.tsx +8 -12
- package/template/packages/ui/src/components/select.tsx +31 -42
- package/template/packages/ui/src/components/separator.tsx +6 -10
- package/template/packages/ui/src/components/sheet.tsx +25 -38
- package/template/packages/ui/src/components/sidebar.tsx +137 -170
- package/template/packages/ui/src/components/skeleton.tsx +3 -3
- package/template/packages/ui/src/components/slider.tsx +5 -5
- package/template/packages/ui/src/components/sonner.tsx +20 -24
- package/template/packages/ui/src/components/spinner.tsx +10 -5
- package/template/packages/ui/src/components/switch.tsx +6 -6
- package/template/packages/ui/src/components/table.tsx +18 -45
- package/template/packages/ui/src/components/tabs.tsx +14 -22
- package/template/packages/ui/src/components/textarea.tsx +5 -5
- package/template/packages/ui/src/components/theme-provider.tsx +43 -48
- package/template/packages/ui/src/components/toggle-group.tsx +18 -20
- package/template/packages/ui/src/components/toggle.tsx +9 -10
- package/template/packages/ui/src/components/tooltip.tsx +10 -22
- package/template/packages/ui/src/hooks/use-mobile.ts +11 -11
- package/template/packages/ui/src/lib/utils.ts +4 -4
- package/template/packages/ui/src/styles/globals.css +106 -106
- package/template/packages/ui/tsconfig.json +1 -1
- package/template/turbo.json +15 -6
- package/template/.prettierignore +0 -10
- package/template/apps/desktop/.prettierignore +0 -6
- package/template/apps/desktop/eslint.config.ts +0 -11
- package/template/apps/desktop/prettier.config.ts +0 -3
- package/template/apps/mobile/eslint.config.js +0 -10
- package/template/apps/platform/eslint.config.ts +0 -11
- package/template/apps/platform/prettier.config.ts +0 -3
- package/template/packages/auth/eslint.config.ts +0 -3
- package/template/packages/auth/prettier.config.ts +0 -3
- package/template/packages/config-eslint/index.ts +0 -24
- package/template/packages/config-eslint/package.json +0 -11
- package/template/packages/config-prettier/index.ts +0 -14
- package/template/packages/config-prettier/package.json +0 -7
- package/template/packages/db/eslint.config.ts +0 -3
- package/template/packages/db/prettier.config.ts +0 -3
- package/template/packages/orpc/eslint.config.ts +0 -3
- package/template/packages/orpc/prettier.config.ts +0 -3
- package/template/packages/ui/eslint.config.ts +0 -3
- package/template/packages/ui/prettier.config.ts +0 -3
- package/template/prettier.config.ts +0 -15
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import * as React from "react"
|
|
2
|
-
import { Combobox as ComboboxPrimitive } from "@base-ui/react"
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
3
3
|
|
|
4
|
-
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react"
|
|
5
|
-
import { cn } from "@workspace/ui/lib/utils"
|
|
6
|
-
import { Button } from "@workspace/ui/components/button"
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react";
|
|
5
|
+
import { cn } from "@workspace/ui/lib/utils";
|
|
6
|
+
import { Button } from "@workspace/ui/components/button";
|
|
7
7
|
import {
|
|
8
8
|
InputGroup,
|
|
9
9
|
InputGroupAddon,
|
|
10
10
|
InputGroupButton,
|
|
11
11
|
InputGroupInput,
|
|
12
|
-
} from "@workspace/ui/components/input-group"
|
|
12
|
+
} from "@workspace/ui/components/input-group";
|
|
13
13
|
|
|
14
|
-
const Combobox = ComboboxPrimitive.Root
|
|
14
|
+
const Combobox = ComboboxPrimitive.Root;
|
|
15
15
|
|
|
16
16
|
function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
|
|
17
|
-
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props}
|
|
17
|
+
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
function ComboboxTrigger({
|
|
21
|
-
className,
|
|
22
|
-
children,
|
|
23
|
-
...props
|
|
24
|
-
}: ComboboxPrimitive.Trigger.Props) {
|
|
20
|
+
function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props) {
|
|
25
21
|
return (
|
|
26
22
|
<ComboboxPrimitive.Trigger
|
|
27
23
|
data-slot="combobox-trigger"
|
|
@@ -31,7 +27,7 @@ function ComboboxTrigger({
|
|
|
31
27
|
{children}
|
|
32
28
|
<ChevronDownIcon className="pointer-events-none size-4 text-muted-foreground" />
|
|
33
29
|
</ComboboxPrimitive.Trigger>
|
|
34
|
-
)
|
|
30
|
+
);
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
@@ -44,7 +40,7 @@ function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
|
44
40
|
>
|
|
45
41
|
<XIcon className="pointer-events-none" />
|
|
46
42
|
</ComboboxPrimitive.Clear>
|
|
47
|
-
)
|
|
43
|
+
);
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
function ComboboxInput({
|
|
@@ -55,15 +51,12 @@ function ComboboxInput({
|
|
|
55
51
|
showClear = false,
|
|
56
52
|
...props
|
|
57
53
|
}: ComboboxPrimitive.Input.Props & {
|
|
58
|
-
showTrigger?: boolean
|
|
59
|
-
showClear?: boolean
|
|
54
|
+
showTrigger?: boolean;
|
|
55
|
+
showClear?: boolean;
|
|
60
56
|
}) {
|
|
61
57
|
return (
|
|
62
58
|
<InputGroup className={cn("w-auto", className)}>
|
|
63
|
-
<ComboboxPrimitive.Input
|
|
64
|
-
render={<InputGroupInput disabled={disabled} />}
|
|
65
|
-
{...props}
|
|
66
|
-
/>
|
|
59
|
+
<ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
|
|
67
60
|
<InputGroupAddon align="inline-end">
|
|
68
61
|
{showTrigger && (
|
|
69
62
|
<InputGroupButton
|
|
@@ -79,7 +72,7 @@ function ComboboxInput({
|
|
|
79
72
|
</InputGroupAddon>
|
|
80
73
|
{children}
|
|
81
74
|
</InputGroup>
|
|
82
|
-
)
|
|
75
|
+
);
|
|
83
76
|
}
|
|
84
77
|
|
|
85
78
|
function ComboboxContent({
|
|
@@ -108,12 +101,15 @@ function ComboboxContent({
|
|
|
108
101
|
<ComboboxPrimitive.Popup
|
|
109
102
|
data-slot="combobox-content"
|
|
110
103
|
data-chips={!!anchor}
|
|
111
|
-
className={cn(
|
|
104
|
+
className={cn(
|
|
105
|
+
"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-lg 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",
|
|
106
|
+
className,
|
|
107
|
+
)}
|
|
112
108
|
{...props}
|
|
113
109
|
/>
|
|
114
110
|
</ComboboxPrimitive.Positioner>
|
|
115
111
|
</ComboboxPrimitive.Portal>
|
|
116
|
-
)
|
|
112
|
+
);
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
@@ -122,24 +118,20 @@ function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
|
122
118
|
data-slot="combobox-list"
|
|
123
119
|
className={cn(
|
|
124
120
|
"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",
|
|
125
|
-
className
|
|
121
|
+
className,
|
|
126
122
|
)}
|
|
127
123
|
{...props}
|
|
128
124
|
/>
|
|
129
|
-
)
|
|
125
|
+
);
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
function ComboboxItem({
|
|
133
|
-
className,
|
|
134
|
-
children,
|
|
135
|
-
...props
|
|
136
|
-
}: ComboboxPrimitive.Item.Props) {
|
|
128
|
+
function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {
|
|
137
129
|
return (
|
|
138
130
|
<ComboboxPrimitive.Item
|
|
139
131
|
data-slot="combobox-item"
|
|
140
132
|
className={cn(
|
|
141
133
|
"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 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",
|
|
142
|
-
className
|
|
134
|
+
className,
|
|
143
135
|
)}
|
|
144
136
|
{...props}
|
|
145
137
|
>
|
|
@@ -152,36 +144,27 @@ function ComboboxItem({
|
|
|
152
144
|
<CheckIcon className="pointer-events-none" />
|
|
153
145
|
</ComboboxPrimitive.ItemIndicator>
|
|
154
146
|
</ComboboxPrimitive.Item>
|
|
155
|
-
)
|
|
147
|
+
);
|
|
156
148
|
}
|
|
157
149
|
|
|
158
150
|
function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
|
|
159
151
|
return (
|
|
160
|
-
<ComboboxPrimitive.Group
|
|
161
|
-
|
|
162
|
-
className={cn(className)}
|
|
163
|
-
{...props}
|
|
164
|
-
/>
|
|
165
|
-
)
|
|
152
|
+
<ComboboxPrimitive.Group data-slot="combobox-group" className={cn(className)} {...props} />
|
|
153
|
+
);
|
|
166
154
|
}
|
|
167
155
|
|
|
168
|
-
function ComboboxLabel({
|
|
169
|
-
className,
|
|
170
|
-
...props
|
|
171
|
-
}: ComboboxPrimitive.GroupLabel.Props) {
|
|
156
|
+
function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) {
|
|
172
157
|
return (
|
|
173
158
|
<ComboboxPrimitive.GroupLabel
|
|
174
159
|
data-slot="combobox-label"
|
|
175
160
|
className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
|
|
176
161
|
{...props}
|
|
177
162
|
/>
|
|
178
|
-
)
|
|
163
|
+
);
|
|
179
164
|
}
|
|
180
165
|
|
|
181
166
|
function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
|
|
182
|
-
return
|
|
183
|
-
<ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
|
|
184
|
-
)
|
|
167
|
+
return <ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />;
|
|
185
168
|
}
|
|
186
169
|
|
|
187
170
|
function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
@@ -190,41 +173,37 @@ function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
|
190
173
|
data-slot="combobox-empty"
|
|
191
174
|
className={cn(
|
|
192
175
|
"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex",
|
|
193
|
-
className
|
|
176
|
+
className,
|
|
194
177
|
)}
|
|
195
178
|
{...props}
|
|
196
179
|
/>
|
|
197
|
-
)
|
|
180
|
+
);
|
|
198
181
|
}
|
|
199
182
|
|
|
200
|
-
function ComboboxSeparator({
|
|
201
|
-
className,
|
|
202
|
-
...props
|
|
203
|
-
}: ComboboxPrimitive.Separator.Props) {
|
|
183
|
+
function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props) {
|
|
204
184
|
return (
|
|
205
185
|
<ComboboxPrimitive.Separator
|
|
206
186
|
data-slot="combobox-separator"
|
|
207
187
|
className={cn("-mx-1 my-1 h-px bg-border", className)}
|
|
208
188
|
{...props}
|
|
209
189
|
/>
|
|
210
|
-
)
|
|
190
|
+
);
|
|
211
191
|
}
|
|
212
192
|
|
|
213
193
|
function ComboboxChips({
|
|
214
194
|
className,
|
|
215
195
|
...props
|
|
216
|
-
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &
|
|
217
|
-
ComboboxPrimitive.Chips.Props) {
|
|
196
|
+
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props) {
|
|
218
197
|
return (
|
|
219
198
|
<ComboboxPrimitive.Chips
|
|
220
199
|
data-slot="combobox-chips"
|
|
221
200
|
className={cn(
|
|
222
201
|
"flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors 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 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
|
|
223
|
-
className
|
|
202
|
+
className,
|
|
224
203
|
)}
|
|
225
204
|
{...props}
|
|
226
205
|
/>
|
|
227
|
-
)
|
|
206
|
+
);
|
|
228
207
|
}
|
|
229
208
|
|
|
230
209
|
function ComboboxChip({
|
|
@@ -233,14 +212,14 @@ function ComboboxChip({
|
|
|
233
212
|
showRemove = true,
|
|
234
213
|
...props
|
|
235
214
|
}: ComboboxPrimitive.Chip.Props & {
|
|
236
|
-
showRemove?: boolean
|
|
215
|
+
showRemove?: boolean;
|
|
237
216
|
}) {
|
|
238
217
|
return (
|
|
239
218
|
<ComboboxPrimitive.Chip
|
|
240
219
|
data-slot="combobox-chip"
|
|
241
220
|
className={cn(
|
|
242
221
|
"flex h-[calc(--spacing(5.25))] 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",
|
|
243
|
-
className
|
|
222
|
+
className,
|
|
244
223
|
)}
|
|
245
224
|
{...props}
|
|
246
225
|
>
|
|
@@ -255,24 +234,21 @@ function ComboboxChip({
|
|
|
255
234
|
</ComboboxPrimitive.ChipRemove>
|
|
256
235
|
)}
|
|
257
236
|
</ComboboxPrimitive.Chip>
|
|
258
|
-
)
|
|
237
|
+
);
|
|
259
238
|
}
|
|
260
239
|
|
|
261
|
-
function ComboboxChipsInput({
|
|
262
|
-
className,
|
|
263
|
-
...props
|
|
264
|
-
}: ComboboxPrimitive.Input.Props) {
|
|
240
|
+
function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props) {
|
|
265
241
|
return (
|
|
266
242
|
<ComboboxPrimitive.Input
|
|
267
243
|
data-slot="combobox-chip-input"
|
|
268
244
|
className={cn("min-w-16 flex-1 outline-none", className)}
|
|
269
245
|
{...props}
|
|
270
246
|
/>
|
|
271
|
-
)
|
|
247
|
+
);
|
|
272
248
|
}
|
|
273
249
|
|
|
274
250
|
function useComboboxAnchor() {
|
|
275
|
-
return React.useRef<HTMLDivElement | null>(null)
|
|
251
|
+
return React.useRef<HTMLDivElement | null>(null);
|
|
276
252
|
}
|
|
277
253
|
|
|
278
254
|
export {
|
|
@@ -292,4 +268,4 @@ export {
|
|
|
292
268
|
ComboboxTrigger,
|
|
293
269
|
ComboboxValue,
|
|
294
270
|
useComboboxAnchor,
|
|
295
|
-
}
|
|
271
|
+
};
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Command as CommandPrimitive } from "cmdk"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
5
5
|
|
|
6
|
-
import { CheckIcon, SearchIcon } from "lucide-react"
|
|
7
|
-
import { cn } from "@workspace/ui/lib/utils"
|
|
6
|
+
import { CheckIcon, SearchIcon } from "lucide-react";
|
|
7
|
+
import { cn } from "@workspace/ui/lib/utils";
|
|
8
8
|
import {
|
|
9
9
|
Dialog,
|
|
10
10
|
DialogContent,
|
|
11
11
|
DialogDescription,
|
|
12
12
|
DialogHeader,
|
|
13
13
|
DialogTitle,
|
|
14
|
-
} from "@workspace/ui/components/dialog"
|
|
15
|
-
import {
|
|
16
|
-
InputGroup,
|
|
17
|
-
InputGroupAddon,
|
|
18
|
-
} from "@workspace/ui/components/input-group"
|
|
14
|
+
} from "@workspace/ui/components/dialog";
|
|
15
|
+
import { InputGroup, InputGroupAddon } from "@workspace/ui/components/input-group";
|
|
19
16
|
|
|
20
|
-
function Command({
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
17
|
+
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
24
18
|
return (
|
|
25
19
|
<CommandPrimitive
|
|
26
20
|
data-slot="command"
|
|
27
21
|
className={cn(
|
|
28
22
|
"flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",
|
|
29
|
-
className
|
|
23
|
+
className,
|
|
30
24
|
)}
|
|
31
25
|
{...props}
|
|
32
26
|
/>
|
|
33
|
-
)
|
|
27
|
+
);
|
|
34
28
|
}
|
|
35
29
|
|
|
36
30
|
function CommandDialog({
|
|
@@ -41,11 +35,11 @@ function CommandDialog({
|
|
|
41
35
|
showCloseButton = false,
|
|
42
36
|
...props
|
|
43
37
|
}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
44
|
-
title?: string
|
|
45
|
-
description?: string
|
|
46
|
-
className?: string
|
|
47
|
-
showCloseButton?: boolean
|
|
48
|
-
children: React.ReactNode
|
|
38
|
+
title?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
className?: string;
|
|
41
|
+
showCloseButton?: boolean;
|
|
42
|
+
children: React.ReactNode;
|
|
49
43
|
}) {
|
|
50
44
|
return (
|
|
51
45
|
<Dialog {...props}>
|
|
@@ -54,16 +48,13 @@ function CommandDialog({
|
|
|
54
48
|
<DialogDescription>{description}</DialogDescription>
|
|
55
49
|
</DialogHeader>
|
|
56
50
|
<DialogContent
|
|
57
|
-
className={cn(
|
|
58
|
-
"top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
51
|
+
className={cn("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0", className)}
|
|
61
52
|
showCloseButton={showCloseButton}
|
|
62
53
|
>
|
|
63
54
|
{children}
|
|
64
55
|
</DialogContent>
|
|
65
56
|
</Dialog>
|
|
66
|
-
)
|
|
57
|
+
);
|
|
67
58
|
}
|
|
68
59
|
|
|
69
60
|
function CommandInput({
|
|
@@ -77,7 +68,7 @@ function CommandInput({
|
|
|
77
68
|
data-slot="command-input"
|
|
78
69
|
className={cn(
|
|
79
70
|
"w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
80
|
-
className
|
|
71
|
+
className,
|
|
81
72
|
)}
|
|
82
73
|
{...props}
|
|
83
74
|
/>
|
|
@@ -86,23 +77,20 @@ function CommandInput({
|
|
|
86
77
|
</InputGroupAddon>
|
|
87
78
|
</InputGroup>
|
|
88
79
|
</div>
|
|
89
|
-
)
|
|
80
|
+
);
|
|
90
81
|
}
|
|
91
82
|
|
|
92
|
-
function CommandList({
|
|
93
|
-
className,
|
|
94
|
-
...props
|
|
95
|
-
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
83
|
+
function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
96
84
|
return (
|
|
97
85
|
<CommandPrimitive.List
|
|
98
86
|
data-slot="command-list"
|
|
99
87
|
className={cn(
|
|
100
88
|
"no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
|
|
101
|
-
className
|
|
89
|
+
className,
|
|
102
90
|
)}
|
|
103
91
|
{...props}
|
|
104
92
|
/>
|
|
105
|
-
)
|
|
93
|
+
);
|
|
106
94
|
}
|
|
107
95
|
|
|
108
96
|
function CommandEmpty({
|
|
@@ -115,7 +103,7 @@ function CommandEmpty({
|
|
|
115
103
|
className={cn("py-6 text-center text-sm", className)}
|
|
116
104
|
{...props}
|
|
117
105
|
/>
|
|
118
|
-
)
|
|
106
|
+
);
|
|
119
107
|
}
|
|
120
108
|
|
|
121
109
|
function CommandGroup({
|
|
@@ -127,11 +115,11 @@ function CommandGroup({
|
|
|
127
115
|
data-slot="command-group"
|
|
128
116
|
className={cn(
|
|
129
117
|
"overflow-hidden p-1 text-foreground **:[[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",
|
|
130
|
-
className
|
|
118
|
+
className,
|
|
131
119
|
)}
|
|
132
120
|
{...props}
|
|
133
121
|
/>
|
|
134
|
-
)
|
|
122
|
+
);
|
|
135
123
|
}
|
|
136
124
|
|
|
137
125
|
function CommandSeparator({
|
|
@@ -144,7 +132,7 @@ function CommandSeparator({
|
|
|
144
132
|
className={cn("-mx-1 h-px bg-border", className)}
|
|
145
133
|
{...props}
|
|
146
134
|
/>
|
|
147
|
-
)
|
|
135
|
+
);
|
|
148
136
|
}
|
|
149
137
|
|
|
150
138
|
function CommandItem({
|
|
@@ -157,30 +145,27 @@ function CommandItem({
|
|
|
157
145
|
data-slot="command-item"
|
|
158
146
|
className={cn(
|
|
159
147
|
"group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
|
|
160
|
-
className
|
|
148
|
+
className,
|
|
161
149
|
)}
|
|
162
150
|
{...props}
|
|
163
151
|
>
|
|
164
152
|
{children}
|
|
165
153
|
<CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
166
154
|
</CommandPrimitive.Item>
|
|
167
|
-
)
|
|
155
|
+
);
|
|
168
156
|
}
|
|
169
157
|
|
|
170
|
-
function CommandShortcut({
|
|
171
|
-
className,
|
|
172
|
-
...props
|
|
173
|
-
}: React.ComponentProps<"span">) {
|
|
158
|
+
function CommandShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
174
159
|
return (
|
|
175
160
|
<span
|
|
176
161
|
data-slot="command-shortcut"
|
|
177
162
|
className={cn(
|
|
178
163
|
"ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
|
|
179
|
-
className
|
|
164
|
+
className,
|
|
180
165
|
)}
|
|
181
166
|
{...props}
|
|
182
167
|
/>
|
|
183
|
-
)
|
|
168
|
+
);
|
|
184
169
|
}
|
|
185
170
|
|
|
186
171
|
export {
|
|
@@ -193,4 +178,4 @@ export {
|
|
|
193
178
|
CommandItem,
|
|
194
179
|
CommandShortcut,
|
|
195
180
|
CommandSeparator,
|
|
196
|
-
}
|
|
181
|
+
};
|