@leitware/dockets 0.1.0
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/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +18 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +86 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/list.d.ts +3 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +36 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/registry.d.ts +18 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +712 -0
- package/dist/registry.js.map +1 -0
- package/package.json +40 -0
- package/templates/accordion.tsx +77 -0
- package/templates/alert-dialog.tsx +66 -0
- package/templates/alert.tsx +41 -0
- package/templates/aspect-ratio.tsx +15 -0
- package/templates/avatar.tsx +27 -0
- package/templates/badge.tsx +1 -0
- package/templates/block-loader.tsx +1 -0
- package/templates/breadcrumb.tsx +31 -0
- package/templates/button.tsx +1 -0
- package/templates/calendar.tsx +45 -0
- package/templates/card.tsx +35 -0
- package/templates/carousel.tsx +39 -0
- package/templates/checkbox.tsx +50 -0
- package/templates/code-block.tsx +1 -0
- package/templates/collapsible.tsx +35 -0
- package/templates/combobox.tsx +154 -0
- package/templates/command.tsx +50 -0
- package/templates/contact-footer.tsx +193 -0
- package/templates/context-menu.tsx +16 -0
- package/templates/dialog.tsx +67 -0
- package/templates/drawer.tsx +12 -0
- package/templates/dropdown-menu.tsx +95 -0
- package/templates/form-input.tsx +64 -0
- package/templates/form.tsx +10 -0
- package/templates/hover-card.tsx +5 -0
- package/templates/input-otp.tsx +6 -0
- package/templates/label.tsx +1 -0
- package/templates/layout-primitives.tsx +11 -0
- package/templates/layouts.tsx +346 -0
- package/templates/lib/utils.ts +49 -0
- package/templates/list-item.tsx +1 -0
- package/templates/list-items.tsx +41 -0
- package/templates/list.tsx +89 -0
- package/templates/logo.tsx +12 -0
- package/templates/marketing-footer.tsx +33 -0
- package/templates/marketing-header.tsx +46 -0
- package/templates/menubar.tsx +16 -0
- package/templates/navigation-menu.tsx +11 -0
- package/templates/pagination.tsx +86 -0
- package/templates/popover.tsx +8 -0
- package/templates/pricing-receipt.tsx +71 -0
- package/templates/pricing-tabs.tsx +60 -0
- package/templates/progress.tsx +29 -0
- package/templates/radio-group.tsx +58 -0
- package/templates/receipt-card.tsx +1 -0
- package/templates/receipt.tsx +269 -0
- package/templates/resizable.tsx +1 -0
- package/templates/scroll-area.tsx +1 -0
- package/templates/select.tsx +110 -0
- package/templates/separator.tsx +1 -0
- package/templates/sheet.tsx +12 -0
- package/templates/sidebar.tsx +15 -0
- package/templates/simple-footer.tsx +43 -0
- package/templates/simple-header.tsx +77 -0
- package/templates/skeleton.tsx +33 -0
- package/templates/slider.tsx +55 -0
- package/templates/styles/dockets.css +104 -0
- package/templates/switch.tsx +49 -0
- package/templates/table.tsx +73 -0
- package/templates/tabs.tsx +61 -0
- package/templates/theme-toggle.tsx +46 -0
- package/templates/toast.tsx +1 -0
- package/templates/toggle-group.tsx +1 -0
- package/templates/toggle.tsx +1 -0
- package/templates/tooltip.tsx +31 -0
- package/templates/tree-view.tsx +1 -0
- package/templates/ui/accordion.tsx +73 -0
- package/templates/ui/alert-dialog.tsx +128 -0
- package/templates/ui/alert.tsx +56 -0
- package/templates/ui/aspect-ratio.tsx +19 -0
- package/templates/ui/avatar.tsx +74 -0
- package/templates/ui/badge.tsx +48 -0
- package/templates/ui/block-loader.tsx +40 -0
- package/templates/ui/button.tsx +77 -0
- package/templates/ui/calendar.tsx +160 -0
- package/templates/ui/card.tsx +73 -0
- package/templates/ui/carousel.tsx +149 -0
- package/templates/ui/checkbox.tsx +33 -0
- package/templates/ui/code-block.tsx +36 -0
- package/templates/ui/collapsible.tsx +48 -0
- package/templates/ui/combobox.tsx +295 -0
- package/templates/ui/command.tsx +148 -0
- package/templates/ui/context-menu.tsx +212 -0
- package/templates/ui/dialog.tsx +138 -0
- package/templates/ui/drawer.tsx +134 -0
- package/templates/ui/dropdown-menu.tsx +254 -0
- package/templates/ui/form.tsx +122 -0
- package/templates/ui/hover-card.tsx +44 -0
- package/templates/ui/input-group.tsx +148 -0
- package/templates/ui/input-otp.tsx +153 -0
- package/templates/ui/input.tsx +20 -0
- package/templates/ui/label.tsx +17 -0
- package/templates/ui/layout.tsx +252 -0
- package/templates/ui/list-item.tsx +50 -0
- package/templates/ui/menubar.tsx +225 -0
- package/templates/ui/navigation-menu.tsx +117 -0
- package/templates/ui/pagination.tsx +110 -0
- package/templates/ui/popover.tsx +77 -0
- package/templates/ui/progress.tsx +37 -0
- package/templates/ui/radio-group.tsx +41 -0
- package/templates/ui/receipt-card.tsx +70 -0
- package/templates/ui/resizable.tsx +140 -0
- package/templates/ui/scroll-area.tsx +64 -0
- package/templates/ui/select.tsx +186 -0
- package/templates/ui/separator.tsx +21 -0
- package/templates/ui/sheet.tsx +134 -0
- package/templates/ui/sidebar.tsx +222 -0
- package/templates/ui/skeleton.tsx +35 -0
- package/templates/ui/slider.tsx +60 -0
- package/templates/ui/switch.tsx +33 -0
- package/templates/ui/table.tsx +114 -0
- package/templates/ui/tabs.tsx +79 -0
- package/templates/ui/textarea.tsx +18 -0
- package/templates/ui/toast.tsx +139 -0
- package/templates/ui/toggle-group.tsx +68 -0
- package/templates/ui/toggle.tsx +47 -0
- package/templates/ui/tooltip.tsx +53 -0
- package/templates/ui/tree-view.tsx +76 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
import { toggleVariants } from '@/components/ui/toggle'
|
|
7
|
+
import type { VariantProps } from 'class-variance-authority'
|
|
8
|
+
|
|
9
|
+
interface ToggleGroupContextValue extends VariantProps<typeof toggleVariants> {}
|
|
10
|
+
|
|
11
|
+
const ToggleGroupContext = React.createContext<ToggleGroupContextValue>({
|
|
12
|
+
variant: 'default',
|
|
13
|
+
size: 'default',
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
function ToggleGroup({
|
|
17
|
+
className,
|
|
18
|
+
variant = 'outline',
|
|
19
|
+
size = 'default',
|
|
20
|
+
children,
|
|
21
|
+
...props
|
|
22
|
+
}: ToggleGroupPrimitive.Root.Props & VariantProps<typeof toggleVariants>) {
|
|
23
|
+
return (
|
|
24
|
+
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
25
|
+
<ToggleGroupPrimitive.Root
|
|
26
|
+
data-slot="toggle-group"
|
|
27
|
+
className={cn(
|
|
28
|
+
// Container holds left+top border; items add right+bottom (newspaper pattern)
|
|
29
|
+
'inline-flex items-center rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground',
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</ToggleGroupPrimitive.Root>
|
|
36
|
+
</ToggleGroupContext.Provider>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ToggleGroupItem({
|
|
41
|
+
className,
|
|
42
|
+
variant,
|
|
43
|
+
size,
|
|
44
|
+
children,
|
|
45
|
+
...props
|
|
46
|
+
}: ToggleGroupPrimitive.Item.Props & VariantProps<typeof toggleVariants>) {
|
|
47
|
+
const ctx = React.useContext(ToggleGroupContext)
|
|
48
|
+
const resolvedVariant = variant ?? ctx.variant
|
|
49
|
+
const resolvedSize = size ?? ctx.size
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<ToggleGroupPrimitive.Item
|
|
53
|
+
data-slot="toggle-group-item"
|
|
54
|
+
className={cn(
|
|
55
|
+
toggleVariants({ variant: resolvedVariant, size: resolvedSize }),
|
|
56
|
+
// No stacking: container owns left border; items add right border except last
|
|
57
|
+
'rounded-[var(--radius)] border-0',
|
|
58
|
+
'[&:not(:last-child)]:border-r-[length:var(--border-width)] [&:not(:last-child)]:border-foreground',
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
</ToggleGroupPrimitive.Item>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { ToggleGroup, ToggleGroupItem }
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Toggle as TogglePrimitive } from '@base-ui/react/toggle'
|
|
4
|
+
import { cva, type VariantProps } from 'class-variance-authority'
|
|
5
|
+
import * as React from 'react'
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
const toggleVariants = cva(
|
|
9
|
+
'inline-flex items-center justify-center gap-2 rounded-[var(--radius)] text-xs font-medium uppercase tracking-wider disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
default:
|
|
14
|
+
'border-[length:var(--border-width)] border-dashed border-transparent hover:border-foreground/30 hover:bg-accent hover:text-accent-foreground data-pressed:border-foreground data-pressed:bg-foreground data-pressed:text-background',
|
|
15
|
+
outline:
|
|
16
|
+
'border-[length:var(--border-width)] border-dashed border-foreground bg-transparent hover:bg-accent hover:text-accent-foreground data-pressed:bg-foreground data-pressed:text-background',
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
default: 'h-9 px-3',
|
|
20
|
+
sm: 'h-8 px-2.5',
|
|
21
|
+
lg: 'h-10 px-4',
|
|
22
|
+
icon: 'h-9 w-9',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
variant: 'default',
|
|
27
|
+
size: 'default',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
function Toggle({
|
|
33
|
+
className,
|
|
34
|
+
variant,
|
|
35
|
+
size,
|
|
36
|
+
...props
|
|
37
|
+
}: TogglePrimitive.Root.Props & VariantProps<typeof toggleVariants>) {
|
|
38
|
+
return (
|
|
39
|
+
<TogglePrimitive.Root
|
|
40
|
+
data-slot="toggle"
|
|
41
|
+
className={cn(toggleVariants({ variant, size }), className)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export { Toggle, toggleVariants }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip'
|
|
4
|
+
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
function TooltipProvider({ delay = 0, ...props }: TooltipPrimitive.Provider.Props) {
|
|
8
|
+
return <TooltipPrimitive.Provider data-slot="tooltip-provider" delay={delay} {...props} />
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
|
|
12
|
+
return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {
|
|
16
|
+
return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function TooltipContent({
|
|
20
|
+
className,
|
|
21
|
+
side = 'top',
|
|
22
|
+
sideOffset = 4,
|
|
23
|
+
align = 'center',
|
|
24
|
+
alignOffset = 0,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
}: TooltipPrimitive.Popup.Props &
|
|
28
|
+
Pick<TooltipPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {
|
|
29
|
+
return (
|
|
30
|
+
<TooltipPrimitive.Portal>
|
|
31
|
+
<TooltipPrimitive.Positioner
|
|
32
|
+
align={align}
|
|
33
|
+
alignOffset={alignOffset}
|
|
34
|
+
side={side}
|
|
35
|
+
sideOffset={sideOffset}
|
|
36
|
+
className="isolate z-50"
|
|
37
|
+
>
|
|
38
|
+
<TooltipPrimitive.Popup
|
|
39
|
+
data-slot="tooltip-content"
|
|
40
|
+
className={cn(
|
|
41
|
+
'z-50 w-fit max-w-xs origin-(--transform-origin) rounded-[var(--radius)] border-[length:var(--border-width)] border-dashed border-foreground bg-popover px-3 py-1.5 text-xs text-popover-foreground 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-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',
|
|
42
|
+
className,
|
|
43
|
+
)}
|
|
44
|
+
{...props}
|
|
45
|
+
>
|
|
46
|
+
{children}
|
|
47
|
+
</TooltipPrimitive.Popup>
|
|
48
|
+
</TooltipPrimitive.Positioner>
|
|
49
|
+
</TooltipPrimitive.Portal>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface TreeViewProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue'> {
|
|
5
|
+
defaultValue?: boolean
|
|
6
|
+
depth?: number
|
|
7
|
+
isFile?: boolean
|
|
8
|
+
isLastChild?: boolean
|
|
9
|
+
isRoot?: boolean
|
|
10
|
+
parentLines?: boolean[]
|
|
11
|
+
title: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const TreeView = React.forwardRef<HTMLDivElement, TreeViewProps>(
|
|
15
|
+
(
|
|
16
|
+
{
|
|
17
|
+
defaultValue = false,
|
|
18
|
+
title,
|
|
19
|
+
children,
|
|
20
|
+
depth = 0,
|
|
21
|
+
isFile = false,
|
|
22
|
+
isLastChild = false,
|
|
23
|
+
parentLines = [],
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
},
|
|
27
|
+
ref,
|
|
28
|
+
) => {
|
|
29
|
+
const [show, setShow] = React.useState<boolean>(defaultValue)
|
|
30
|
+
|
|
31
|
+
const onToggleShow = (): void => {
|
|
32
|
+
if (!isFile) setShow((prevShow) => !prevShow)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const hasChildren = React.Children.count(children) > 0
|
|
36
|
+
|
|
37
|
+
const spacing = parentLines.map((line) => (line ? '│ . ' : '. . ')).join('')
|
|
38
|
+
const endPrefix = isLastChild ? '└───' : '├───'
|
|
39
|
+
const prefix = `${spacing}${endPrefix}`
|
|
40
|
+
const icon = isFile ? ' ' : show ? '╦ ' : '╤ '
|
|
41
|
+
|
|
42
|
+
const updatedParentLines = [...parentLines, !isLastChild]
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div ref={ref} data-slot="tree-view" className={cn('whitespace-nowrap', className)} {...props}>
|
|
46
|
+
<div
|
|
47
|
+
tabIndex={0}
|
|
48
|
+
role="button"
|
|
49
|
+
onClick={onToggleShow}
|
|
50
|
+
className="cursor-pointer border-0"
|
|
51
|
+
aria-expanded={show}
|
|
52
|
+
>
|
|
53
|
+
{prefix}
|
|
54
|
+
{icon}
|
|
55
|
+
{title}
|
|
56
|
+
</div>
|
|
57
|
+
{show && hasChildren && (
|
|
58
|
+
<div>
|
|
59
|
+
{React.Children.map(children, (child, index) =>
|
|
60
|
+
React.isValidElement(child)
|
|
61
|
+
? React.cloneElement(child as React.ReactElement<TreeViewProps>, {
|
|
62
|
+
depth: depth + 1,
|
|
63
|
+
isLastChild: index === React.Children.count(children) - 1,
|
|
64
|
+
parentLines: updatedParentLines,
|
|
65
|
+
})
|
|
66
|
+
: child,
|
|
67
|
+
)}
|
|
68
|
+
</div>
|
|
69
|
+
)}
|
|
70
|
+
</div>
|
|
71
|
+
)
|
|
72
|
+
},
|
|
73
|
+
)
|
|
74
|
+
TreeView.displayName = 'TreeView'
|
|
75
|
+
|
|
76
|
+
export { TreeView }
|