@weaverclub/render 0.0.2 → 0.0.3

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 (64) hide show
  1. package/dist/entrypoint +0 -0
  2. package/package.json +6 -2
  3. package/.github/workflows/publish.yml +0 -44
  4. package/biome.json +0 -42
  5. package/build.ts +0 -62
  6. package/bun.lock +0 -733
  7. package/bunfig.toml +0 -3
  8. package/ideas.md +0 -11
  9. package/publish.ts +0 -62
  10. package/src/cli/command/renderCommand.ts +0 -112
  11. package/src/cli/entrypoint.ts +0 -25
  12. package/src/core/bundler.ts +0 -180
  13. package/src/core/control/arrayControl.ts +0 -15
  14. package/src/core/control/booleanControl.ts +0 -15
  15. package/src/core/control/control.ts +0 -7
  16. package/src/core/control/controlBuilder.ts +0 -87
  17. package/src/core/control/numberControl.ts +0 -15
  18. package/src/core/control/stringControl.ts +0 -15
  19. package/src/core/control/variantControl.ts +0 -18
  20. package/src/core/css/css.ts +0 -50
  21. package/src/core/css/tailwind.ts +0 -172
  22. package/src/core/html.ts +0 -63
  23. package/src/core/pkg.ts +0 -92
  24. package/src/core/story.ts +0 -52
  25. package/src/core/tsconfig.ts +0 -46
  26. package/src/react/react.ts +0 -2
  27. package/src/react/reactControlBuilder.ts +0 -130
  28. package/src/react/reactStory.ts +0 -36
  29. package/src/server/api/getStories.ts +0 -44
  30. package/src/server/api/renderIframe.ts +0 -66
  31. package/src/server/backend.ts +0 -104
  32. package/src/server/streaming.ts +0 -16
  33. package/src/ui/api.ts +0 -16
  34. package/src/ui/app.tsx +0 -23
  35. package/src/ui/cn.ts +0 -6
  36. package/src/ui/components/appSidebar.tsx +0 -76
  37. package/src/ui/components/button.stories.tsx +0 -32
  38. package/src/ui/components/button.tsx +0 -55
  39. package/src/ui/components/command.tsx +0 -187
  40. package/src/ui/components/contextMenu.tsx +0 -261
  41. package/src/ui/components/dialog.tsx +0 -153
  42. package/src/ui/components/input.tsx +0 -23
  43. package/src/ui/components/inputGroup.tsx +0 -157
  44. package/src/ui/components/kdb.tsx +0 -26
  45. package/src/ui/components/searchCommand.tsx +0 -5
  46. package/src/ui/components/separator.tsx +0 -22
  47. package/src/ui/components/sheet.tsx +0 -131
  48. package/src/ui/components/sidebar.tsx +0 -725
  49. package/src/ui/components/skeleton.tsx +0 -13
  50. package/src/ui/components/spinner.tsx +0 -15
  51. package/src/ui/components/tabButton.tsx +0 -80
  52. package/src/ui/components/tabContent.tsx +0 -20
  53. package/src/ui/components/tabList.tsx +0 -53
  54. package/src/ui/components/textarea.tsx +0 -17
  55. package/src/ui/components/tooltip.tsx +0 -67
  56. package/src/ui/frontend.tsx +0 -68
  57. package/src/ui/hooks/useMobile.ts +0 -23
  58. package/src/ui/index.html +0 -12
  59. package/src/ui/routeTree.gen.ts +0 -35
  60. package/src/ui/routes/__root.tsx +0 -9
  61. package/src/ui/styles.css +0 -123
  62. package/src/ui/tabs.tsx +0 -89
  63. package/tsconfig.json +0 -25
  64. package/tsr.config.json +0 -6
@@ -1,261 +0,0 @@
1
- import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu'
2
- import { CheckIcon, ChevronRightIcon } from 'lucide-react'
3
- import type * as React from 'react'
4
- import { cn } from '../cn'
5
-
6
- function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
7
- return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
8
- }
9
-
10
- function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {
11
- return (
12
- <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
13
- )
14
- }
15
-
16
- function ContextMenuTrigger({
17
- className,
18
- ...props
19
- }: ContextMenuPrimitive.Trigger.Props) {
20
- return (
21
- <ContextMenuPrimitive.Trigger
22
- data-slot="context-menu-trigger"
23
- className={cn('select-none', className)}
24
- {...props}
25
- />
26
- )
27
- }
28
-
29
- function ContextMenuContent({
30
- className,
31
- align = 'start',
32
- alignOffset = 4,
33
- side = 'right',
34
- sideOffset = 0,
35
- ...props
36
- }: ContextMenuPrimitive.Popup.Props &
37
- Pick<
38
- ContextMenuPrimitive.Positioner.Props,
39
- 'align' | 'alignOffset' | 'side' | 'sideOffset'
40
- >) {
41
- return (
42
- <ContextMenuPrimitive.Portal>
43
- <ContextMenuPrimitive.Positioner
44
- className="isolate z-50 outline-none"
45
- align={align}
46
- alignOffset={alignOffset}
47
- side={side}
48
- sideOffset={sideOffset}
49
- >
50
- <ContextMenuPrimitive.Popup
51
- data-slot="context-menu-content"
52
- className={cn(
53
- 'data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 dark z-50 max-h-(--available-height) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none',
54
- className
55
- )}
56
- {...props}
57
- />
58
- </ContextMenuPrimitive.Positioner>
59
- </ContextMenuPrimitive.Portal>
60
- )
61
- }
62
-
63
- function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {
64
- return (
65
- <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
66
- )
67
- }
68
-
69
- function ContextMenuLabel({
70
- className,
71
- inset,
72
- ...props
73
- }: ContextMenuPrimitive.GroupLabel.Props & {
74
- inset?: boolean
75
- }) {
76
- return (
77
- <ContextMenuPrimitive.GroupLabel
78
- data-slot="context-menu-label"
79
- data-inset={inset}
80
- className={cn(
81
- 'text-muted-foreground px-2 py-1.5 text-xs data-inset:pl-8',
82
- className
83
- )}
84
- {...props}
85
- />
86
- )
87
- }
88
-
89
- function ContextMenuItem({
90
- className,
91
- inset,
92
- variant = 'default',
93
- ...props
94
- }: ContextMenuPrimitive.Item.Props & {
95
- inset?: boolean
96
- variant?: 'default' | 'destructive'
97
- }) {
98
- return (
99
- <ContextMenuPrimitive.Item
100
- data-slot="context-menu-item"
101
- data-inset={inset}
102
- data-variant={variant}
103
- className={cn(
104
- "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 not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
105
- className
106
- )}
107
- {...props}
108
- />
109
- )
110
- }
111
-
112
- function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {
113
- return (
114
- <ContextMenuPrimitive.SubmenuRoot data-slot="context-menu-sub" {...props} />
115
- )
116
- }
117
-
118
- function ContextMenuSubTrigger({
119
- className,
120
- inset,
121
- children,
122
- ...props
123
- }: ContextMenuPrimitive.SubmenuTrigger.Props & {
124
- inset?: boolean
125
- }) {
126
- return (
127
- <ContextMenuPrimitive.SubmenuTrigger
128
- data-slot="context-menu-sub-trigger"
129
- data-inset={inset}
130
- className={cn(
131
- "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-hidden select-none data-inset:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
132
- className
133
- )}
134
- {...props}
135
- >
136
- {children}
137
- <ChevronRightIcon className="ml-auto" />
138
- </ContextMenuPrimitive.SubmenuTrigger>
139
- )
140
- }
141
-
142
- function ContextMenuSubContent({
143
- ...props
144
- }: React.ComponentProps<typeof ContextMenuContent>) {
145
- return (
146
- <ContextMenuContent
147
- data-slot="context-menu-sub-content"
148
- className="shadow-lg"
149
- side="right"
150
- {...props}
151
- />
152
- )
153
- }
154
-
155
- function ContextMenuCheckboxItem({
156
- className,
157
- children,
158
- checked,
159
- ...props
160
- }: ContextMenuPrimitive.CheckboxItem.Props) {
161
- return (
162
- <ContextMenuPrimitive.CheckboxItem
163
- data-slot="context-menu-checkbox-item"
164
- className={cn(
165
- "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
166
- className
167
- )}
168
- checked={checked}
169
- {...props}
170
- >
171
- <span className="absolute right-2 flex items-center justify-center pointer-events-none">
172
- <ContextMenuPrimitive.CheckboxItemIndicator>
173
- <CheckIcon />
174
- </ContextMenuPrimitive.CheckboxItemIndicator>
175
- </span>
176
- {children}
177
- </ContextMenuPrimitive.CheckboxItem>
178
- )
179
- }
180
-
181
- function ContextMenuRadioGroup({
182
- ...props
183
- }: ContextMenuPrimitive.RadioGroup.Props) {
184
- return (
185
- <ContextMenuPrimitive.RadioGroup
186
- data-slot="context-menu-radio-group"
187
- {...props}
188
- />
189
- )
190
- }
191
-
192
- function ContextMenuRadioItem({
193
- className,
194
- children,
195
- ...props
196
- }: ContextMenuPrimitive.RadioItem.Props) {
197
- return (
198
- <ContextMenuPrimitive.RadioItem
199
- data-slot="context-menu-radio-item"
200
- className={cn(
201
- "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
202
- className
203
- )}
204
- {...props}
205
- >
206
- <span className="absolute right-2 flex items-center justify-center pointer-events-none">
207
- <ContextMenuPrimitive.RadioItemIndicator>
208
- <CheckIcon />
209
- </ContextMenuPrimitive.RadioItemIndicator>
210
- </span>
211
- {children}
212
- </ContextMenuPrimitive.RadioItem>
213
- )
214
- }
215
-
216
- function ContextMenuSeparator({
217
- className,
218
- ...props
219
- }: ContextMenuPrimitive.Separator.Props) {
220
- return (
221
- <ContextMenuPrimitive.Separator
222
- data-slot="context-menu-separator"
223
- className={cn('bg-border/50 -mx-1 my-1 h-px', className)}
224
- {...props}
225
- />
226
- )
227
- }
228
-
229
- function ContextMenuShortcut({
230
- className,
231
- ...props
232
- }: React.ComponentProps<'span'>) {
233
- return (
234
- <span
235
- data-slot="context-menu-shortcut"
236
- className={cn(
237
- 'text-muted-foreground group-focus/context-menu-item:text-accent-foreground ml-auto text-[0.625rem] tracking-widest',
238
- className
239
- )}
240
- {...props}
241
- />
242
- )
243
- }
244
-
245
- export {
246
- ContextMenu,
247
- ContextMenuTrigger,
248
- ContextMenuContent,
249
- ContextMenuItem,
250
- ContextMenuCheckboxItem,
251
- ContextMenuRadioItem,
252
- ContextMenuLabel,
253
- ContextMenuSeparator,
254
- ContextMenuShortcut,
255
- ContextMenuGroup,
256
- ContextMenuPortal,
257
- ContextMenuSub,
258
- ContextMenuSubContent,
259
- ContextMenuSubTrigger,
260
- ContextMenuRadioGroup
261
- }
@@ -1,153 +0,0 @@
1
- import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'
2
- import { XIcon } from 'lucide-react'
3
- import type * as React from 'react'
4
- import { cn } from '../cn'
5
- import { Button } from './button'
6
-
7
- function Dialog({ ...props }: DialogPrimitive.Root.Props) {
8
- return <DialogPrimitive.Root data-slot="dialog" {...props} />
9
- }
10
-
11
- function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
12
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
13
- }
14
-
15
- function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
16
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
17
- }
18
-
19
- function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
20
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
21
- }
22
-
23
- function DialogOverlay({
24
- className,
25
- ...props
26
- }: DialogPrimitive.Backdrop.Props) {
27
- return (
28
- <DialogPrimitive.Backdrop
29
- data-slot="dialog-overlay"
30
- className={cn(
31
- 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50',
32
- className
33
- )}
34
- {...props}
35
- />
36
- )
37
- }
38
-
39
- function DialogContent({
40
- className,
41
- children,
42
- showCloseButton = true,
43
- ...props
44
- }: DialogPrimitive.Popup.Props & {
45
- showCloseButton?: boolean
46
- }) {
47
- return (
48
- <DialogPortal>
49
- <DialogOverlay />
50
- <DialogPrimitive.Popup
51
- data-slot="dialog-content"
52
- className={cn(
53
- 'bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none',
54
- className
55
- )}
56
- {...props}
57
- >
58
- {children}
59
- {showCloseButton && (
60
- <DialogPrimitive.Close
61
- data-slot="dialog-close"
62
- render={
63
- <Button
64
- variant="ghost"
65
- className="absolute top-2 right-2"
66
- size="icon-sm"
67
- />
68
- }
69
- >
70
- <XIcon />
71
- <span className="sr-only">Close</span>
72
- </DialogPrimitive.Close>
73
- )}
74
- </DialogPrimitive.Popup>
75
- </DialogPortal>
76
- )
77
- }
78
-
79
- function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
80
- return (
81
- <div
82
- data-slot="dialog-header"
83
- className={cn('gap-1 flex flex-col', className)}
84
- {...props}
85
- />
86
- )
87
- }
88
-
89
- function DialogFooter({
90
- className,
91
- showCloseButton = false,
92
- children,
93
- ...props
94
- }: React.ComponentProps<'div'> & {
95
- showCloseButton?: boolean
96
- }) {
97
- return (
98
- <div
99
- data-slot="dialog-footer"
100
- className={cn(
101
- 'gap-2 flex flex-col-reverse sm:flex-row sm:justify-end',
102
- className
103
- )}
104
- {...props}
105
- >
106
- {children}
107
- {showCloseButton && (
108
- <DialogPrimitive.Close render={<Button variant="outline" />}>
109
- Close
110
- </DialogPrimitive.Close>
111
- )}
112
- </div>
113
- )
114
- }
115
-
116
- function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
117
- return (
118
- <DialogPrimitive.Title
119
- data-slot="dialog-title"
120
- className={cn('text-sm font-medium', className)}
121
- {...props}
122
- />
123
- )
124
- }
125
-
126
- function DialogDescription({
127
- className,
128
- ...props
129
- }: DialogPrimitive.Description.Props) {
130
- return (
131
- <DialogPrimitive.Description
132
- data-slot="dialog-description"
133
- className={cn(
134
- 'text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3',
135
- className
136
- )}
137
- {...props}
138
- />
139
- )
140
- }
141
-
142
- export {
143
- Dialog,
144
- DialogClose,
145
- DialogContent,
146
- DialogDescription,
147
- DialogFooter,
148
- DialogHeader,
149
- DialogOverlay,
150
- DialogPortal,
151
- DialogTitle,
152
- DialogTrigger
153
- }
@@ -1,23 +0,0 @@
1
- import { Input as InputPrimitive } from '@base-ui/react/input'
2
- import type * as React from 'react'
3
- import { cn } from '../cn'
4
-
5
- function Input({
6
- className,
7
- type,
8
- ...props
9
- }: React.ComponentProps<typeof InputPrimitive>) {
10
- return (
11
- <InputPrimitive
12
- type={type}
13
- data-slot="input"
14
- className={cn(
15
- 'bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-md border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-2 aria-invalid:ring-2 md:text-xs/relaxed file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
16
- className
17
- )}
18
- {...props}
19
- />
20
- )
21
- }
22
-
23
- export { Input }
@@ -1,157 +0,0 @@
1
- import { cva, type VariantProps } from 'class-variance-authority'
2
- import type * as React from 'react'
3
- import { cn } from '../cn'
4
- import { Button } from './button'
5
- import { Input } from './input'
6
- import { Textarea } from './textarea'
7
-
8
- function InputGroup({ className, ...props }: React.ComponentProps<'div'>) {
9
- return (
10
- // biome-ignore lint/a11y/useSemanticElements: Div is required to allow custom positioning
11
- <div
12
- data-slot="input-group"
13
- role="group"
14
- className={cn(
15
- 'border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-2 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto',
16
- className
17
- )}
18
- {...props}
19
- />
20
- )
21
- }
22
-
23
- const inputGroupAddonVariants = cva(
24
- "text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",
25
- {
26
- variants: {
27
- align: {
28
- 'inline-start':
29
- 'pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first',
30
- 'inline-end':
31
- 'pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last',
32
- 'block-start':
33
- 'px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start',
34
- 'block-end':
35
- 'px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start'
36
- }
37
- },
38
- defaultVariants: {
39
- align: 'inline-start'
40
- }
41
- }
42
- )
43
-
44
- function InputGroupAddon({
45
- className,
46
- align = 'inline-start',
47
- ...props
48
- }: React.ComponentProps<'div'> & VariantProps<typeof inputGroupAddonVariants>) {
49
- return (
50
- // biome-ignore lint/a11y/useKeyWithClickEvents: Required to focus the input when clicking on the addon
51
- // biome-ignore lint/a11y/useSemanticElements: Div is required to allow custom positioning
52
- <div
53
- role="group"
54
- data-slot="input-group-addon"
55
- data-align={align}
56
- className={cn(inputGroupAddonVariants({ align }), className)}
57
- onClick={(e) => {
58
- if ((e.target as HTMLElement).closest('button')) {
59
- return
60
- }
61
- e.currentTarget.parentElement?.querySelector('input')?.focus()
62
- }}
63
- {...props}
64
- />
65
- )
66
- }
67
-
68
- const inputGroupButtonVariants = cva(
69
- 'gap-2 rounded-md text-xs/relaxed shadow-none flex items-center',
70
- {
71
- variants: {
72
- size: {
73
- xs: "h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",
74
- sm: '',
75
- 'icon-xs': 'size-6 p-0 has-[>svg]:p-0',
76
- 'icon-sm': 'size-8 p-0 has-[>svg]:p-0'
77
- }
78
- },
79
- defaultVariants: {
80
- size: 'xs'
81
- }
82
- }
83
- )
84
-
85
- function InputGroupButton({
86
- className,
87
- type = 'button',
88
- variant = 'ghost',
89
- size = 'xs',
90
- ...props
91
- }: Omit<React.ComponentProps<typeof Button>, 'size' | 'type'> &
92
- VariantProps<typeof inputGroupButtonVariants> & {
93
- type?: 'button' | 'submit' | 'reset'
94
- }) {
95
- return (
96
- <Button
97
- type={type}
98
- data-size={size}
99
- variant={variant}
100
- className={cn(inputGroupButtonVariants({ size }), className)}
101
- {...props}
102
- />
103
- )
104
- }
105
-
106
- function InputGroupText({ className, ...props }: React.ComponentProps<'span'>) {
107
- return (
108
- <span
109
- className={cn(
110
- "text-muted-foreground gap-2 text-xs/relaxed [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none",
111
- className
112
- )}
113
- {...props}
114
- />
115
- )
116
- }
117
-
118
- function InputGroupInput({
119
- className,
120
- ...props
121
- }: React.ComponentProps<'input'>) {
122
- return (
123
- <Input
124
- data-slot="input-group-control"
125
- className={cn(
126
- 'rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1',
127
- className
128
- )}
129
- {...props}
130
- />
131
- )
132
- }
133
-
134
- function InputGroupTextarea({
135
- className,
136
- ...props
137
- }: React.ComponentProps<'textarea'>) {
138
- return (
139
- <Textarea
140
- data-slot="input-group-control"
141
- className={cn(
142
- 'rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1 resize-none',
143
- className
144
- )}
145
- {...props}
146
- />
147
- )
148
- }
149
-
150
- export {
151
- InputGroup,
152
- InputGroupAddon,
153
- InputGroupButton,
154
- InputGroupText,
155
- InputGroupInput,
156
- InputGroupTextarea
157
- }
@@ -1,26 +0,0 @@
1
- import { cn } from '../cn'
2
-
3
- function Kbd({ className, ...props }: React.ComponentProps<'kbd'>) {
4
- return (
5
- <kbd
6
- data-slot="kbd"
7
- className={cn(
8
- "bg-muted text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 h-5 w-fit min-w-5 gap-1 rounded-xs px-1 font-sans text-[0.625rem] font-medium [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none",
9
- className
10
- )}
11
- {...props}
12
- />
13
- )
14
- }
15
-
16
- function KbdGroup({ className, ...props }: React.ComponentProps<'div'>) {
17
- return (
18
- <kbd
19
- data-slot="kbd-group"
20
- className={cn('gap-1 inline-flex items-center', className)}
21
- {...props}
22
- />
23
- )
24
- }
25
-
26
- export { Kbd, KbdGroup }
@@ -1,5 +0,0 @@
1
- import { Command } from './command'
2
-
3
- export function SearchCommand() {
4
- return <Command></Command>
5
- }
@@ -1,22 +0,0 @@
1
- import { Separator as SeparatorPrimitive } from '@base-ui/react/separator'
2
- import { cn } from '../cn'
3
-
4
- function Separator({
5
- className,
6
- orientation = 'horizontal',
7
- ...props
8
- }: SeparatorPrimitive.Props) {
9
- return (
10
- <SeparatorPrimitive
11
- data-slot="separator"
12
- orientation={orientation}
13
- className={cn(
14
- 'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch',
15
- className
16
- )}
17
- {...props}
18
- />
19
- )
20
- }
21
-
22
- export { Separator }