@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.
Files changed (135) hide show
  1. package/dist/cli.d.ts +3 -0
  2. package/dist/cli.d.ts.map +1 -0
  3. package/dist/cli.js +18 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/add.d.ts +3 -0
  6. package/dist/commands/add.d.ts.map +1 -0
  7. package/dist/commands/add.js +86 -0
  8. package/dist/commands/add.js.map +1 -0
  9. package/dist/commands/list.d.ts +3 -0
  10. package/dist/commands/list.d.ts.map +1 -0
  11. package/dist/commands/list.js +36 -0
  12. package/dist/commands/list.js.map +1 -0
  13. package/dist/registry.d.ts +18 -0
  14. package/dist/registry.d.ts.map +1 -0
  15. package/dist/registry.js +712 -0
  16. package/dist/registry.js.map +1 -0
  17. package/package.json +40 -0
  18. package/templates/accordion.tsx +77 -0
  19. package/templates/alert-dialog.tsx +66 -0
  20. package/templates/alert.tsx +41 -0
  21. package/templates/aspect-ratio.tsx +15 -0
  22. package/templates/avatar.tsx +27 -0
  23. package/templates/badge.tsx +1 -0
  24. package/templates/block-loader.tsx +1 -0
  25. package/templates/breadcrumb.tsx +31 -0
  26. package/templates/button.tsx +1 -0
  27. package/templates/calendar.tsx +45 -0
  28. package/templates/card.tsx +35 -0
  29. package/templates/carousel.tsx +39 -0
  30. package/templates/checkbox.tsx +50 -0
  31. package/templates/code-block.tsx +1 -0
  32. package/templates/collapsible.tsx +35 -0
  33. package/templates/combobox.tsx +154 -0
  34. package/templates/command.tsx +50 -0
  35. package/templates/contact-footer.tsx +193 -0
  36. package/templates/context-menu.tsx +16 -0
  37. package/templates/dialog.tsx +67 -0
  38. package/templates/drawer.tsx +12 -0
  39. package/templates/dropdown-menu.tsx +95 -0
  40. package/templates/form-input.tsx +64 -0
  41. package/templates/form.tsx +10 -0
  42. package/templates/hover-card.tsx +5 -0
  43. package/templates/input-otp.tsx +6 -0
  44. package/templates/label.tsx +1 -0
  45. package/templates/layout-primitives.tsx +11 -0
  46. package/templates/layouts.tsx +346 -0
  47. package/templates/lib/utils.ts +49 -0
  48. package/templates/list-item.tsx +1 -0
  49. package/templates/list-items.tsx +41 -0
  50. package/templates/list.tsx +89 -0
  51. package/templates/logo.tsx +12 -0
  52. package/templates/marketing-footer.tsx +33 -0
  53. package/templates/marketing-header.tsx +46 -0
  54. package/templates/menubar.tsx +16 -0
  55. package/templates/navigation-menu.tsx +11 -0
  56. package/templates/pagination.tsx +86 -0
  57. package/templates/popover.tsx +8 -0
  58. package/templates/pricing-receipt.tsx +71 -0
  59. package/templates/pricing-tabs.tsx +60 -0
  60. package/templates/progress.tsx +29 -0
  61. package/templates/radio-group.tsx +58 -0
  62. package/templates/receipt-card.tsx +1 -0
  63. package/templates/receipt.tsx +269 -0
  64. package/templates/resizable.tsx +1 -0
  65. package/templates/scroll-area.tsx +1 -0
  66. package/templates/select.tsx +110 -0
  67. package/templates/separator.tsx +1 -0
  68. package/templates/sheet.tsx +12 -0
  69. package/templates/sidebar.tsx +15 -0
  70. package/templates/simple-footer.tsx +43 -0
  71. package/templates/simple-header.tsx +77 -0
  72. package/templates/skeleton.tsx +33 -0
  73. package/templates/slider.tsx +55 -0
  74. package/templates/styles/dockets.css +104 -0
  75. package/templates/switch.tsx +49 -0
  76. package/templates/table.tsx +73 -0
  77. package/templates/tabs.tsx +61 -0
  78. package/templates/theme-toggle.tsx +46 -0
  79. package/templates/toast.tsx +1 -0
  80. package/templates/toggle-group.tsx +1 -0
  81. package/templates/toggle.tsx +1 -0
  82. package/templates/tooltip.tsx +31 -0
  83. package/templates/tree-view.tsx +1 -0
  84. package/templates/ui/accordion.tsx +73 -0
  85. package/templates/ui/alert-dialog.tsx +128 -0
  86. package/templates/ui/alert.tsx +56 -0
  87. package/templates/ui/aspect-ratio.tsx +19 -0
  88. package/templates/ui/avatar.tsx +74 -0
  89. package/templates/ui/badge.tsx +48 -0
  90. package/templates/ui/block-loader.tsx +40 -0
  91. package/templates/ui/button.tsx +77 -0
  92. package/templates/ui/calendar.tsx +160 -0
  93. package/templates/ui/card.tsx +73 -0
  94. package/templates/ui/carousel.tsx +149 -0
  95. package/templates/ui/checkbox.tsx +33 -0
  96. package/templates/ui/code-block.tsx +36 -0
  97. package/templates/ui/collapsible.tsx +48 -0
  98. package/templates/ui/combobox.tsx +295 -0
  99. package/templates/ui/command.tsx +148 -0
  100. package/templates/ui/context-menu.tsx +212 -0
  101. package/templates/ui/dialog.tsx +138 -0
  102. package/templates/ui/drawer.tsx +134 -0
  103. package/templates/ui/dropdown-menu.tsx +254 -0
  104. package/templates/ui/form.tsx +122 -0
  105. package/templates/ui/hover-card.tsx +44 -0
  106. package/templates/ui/input-group.tsx +148 -0
  107. package/templates/ui/input-otp.tsx +153 -0
  108. package/templates/ui/input.tsx +20 -0
  109. package/templates/ui/label.tsx +17 -0
  110. package/templates/ui/layout.tsx +252 -0
  111. package/templates/ui/list-item.tsx +50 -0
  112. package/templates/ui/menubar.tsx +225 -0
  113. package/templates/ui/navigation-menu.tsx +117 -0
  114. package/templates/ui/pagination.tsx +110 -0
  115. package/templates/ui/popover.tsx +77 -0
  116. package/templates/ui/progress.tsx +37 -0
  117. package/templates/ui/radio-group.tsx +41 -0
  118. package/templates/ui/receipt-card.tsx +70 -0
  119. package/templates/ui/resizable.tsx +140 -0
  120. package/templates/ui/scroll-area.tsx +64 -0
  121. package/templates/ui/select.tsx +186 -0
  122. package/templates/ui/separator.tsx +21 -0
  123. package/templates/ui/sheet.tsx +134 -0
  124. package/templates/ui/sidebar.tsx +222 -0
  125. package/templates/ui/skeleton.tsx +35 -0
  126. package/templates/ui/slider.tsx +60 -0
  127. package/templates/ui/switch.tsx +33 -0
  128. package/templates/ui/table.tsx +114 -0
  129. package/templates/ui/tabs.tsx +79 -0
  130. package/templates/ui/textarea.tsx +18 -0
  131. package/templates/ui/toast.tsx +139 -0
  132. package/templates/ui/toggle-group.tsx +68 -0
  133. package/templates/ui/toggle.tsx +47 -0
  134. package/templates/ui/tooltip.tsx +53 -0
  135. 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 }