@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,225 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Menu as MenuPrimitive } from '@base-ui/react/menu'
|
|
4
|
+
import { CheckIcon, ChevronDownIcon, ChevronRightIcon } from 'lucide-react'
|
|
5
|
+
import * as React from 'react'
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
function Menubar({ className, ...props }: React.ComponentProps<'div'>) {
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
data-slot="menubar"
|
|
12
|
+
role="menubar"
|
|
13
|
+
className={cn(
|
|
14
|
+
'flex h-9 items-center rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground bg-card text-card-foreground',
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function MenubarMenu({ ...props }: MenuPrimitive.Root.Props) {
|
|
23
|
+
return <MenuPrimitive.Root data-slot="menubar-menu" {...props} />
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function MenubarTrigger({ className, children, ...props }: MenuPrimitive.Trigger.Props) {
|
|
27
|
+
return (
|
|
28
|
+
<MenuPrimitive.Trigger
|
|
29
|
+
data-slot="menubar-trigger"
|
|
30
|
+
className={cn(
|
|
31
|
+
'flex h-full cursor-default items-center gap-1 px-3 text-xs font-medium uppercase tracking-wider select-none',
|
|
32
|
+
'hover:bg-accent hover:text-accent-foreground',
|
|
33
|
+
'data-popup-open:bg-foreground data-popup-open:text-background',
|
|
34
|
+
'focus-visible:outline-none focus-visible:bg-accent',
|
|
35
|
+
'disabled:pointer-events-none disabled:opacity-50',
|
|
36
|
+
// No stacking: each menu trigger gets right border except last
|
|
37
|
+
'[&:not(:last-child)]:border-r-[length:var(--border-width)] [&:not(:last-child)]:border-foreground',
|
|
38
|
+
className,
|
|
39
|
+
)}
|
|
40
|
+
{...props}
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
<ChevronDownIcon className="size-3 text-muted-foreground" />
|
|
44
|
+
</MenuPrimitive.Trigger>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function MenubarContent({
|
|
49
|
+
className,
|
|
50
|
+
align = 'start',
|
|
51
|
+
sideOffset = 2,
|
|
52
|
+
...props
|
|
53
|
+
}: MenuPrimitive.Popup.Props &
|
|
54
|
+
Pick<MenuPrimitive.Positioner.Props, 'align' | 'sideOffset'>) {
|
|
55
|
+
return (
|
|
56
|
+
<MenuPrimitive.Portal>
|
|
57
|
+
<MenuPrimitive.Positioner
|
|
58
|
+
align={align}
|
|
59
|
+
sideOffset={sideOffset}
|
|
60
|
+
className="isolate z-50 outline-none"
|
|
61
|
+
>
|
|
62
|
+
<MenuPrimitive.Popup
|
|
63
|
+
data-slot="menubar-content"
|
|
64
|
+
className={cn(
|
|
65
|
+
'z-50 min-w-40 origin-(--transform-origin) overflow-hidden rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground bg-popover text-popover-foreground shadow-none duration-100 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',
|
|
66
|
+
className,
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
</MenuPrimitive.Positioner>
|
|
71
|
+
</MenuPrimitive.Portal>
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function MenubarItem({
|
|
76
|
+
className,
|
|
77
|
+
inset,
|
|
78
|
+
variant = 'default',
|
|
79
|
+
...props
|
|
80
|
+
}: MenuPrimitive.Item.Props & {
|
|
81
|
+
inset?: boolean
|
|
82
|
+
variant?: 'default' | 'destructive'
|
|
83
|
+
}) {
|
|
84
|
+
return (
|
|
85
|
+
<MenuPrimitive.Item
|
|
86
|
+
data-slot="menubar-item"
|
|
87
|
+
data-inset={inset}
|
|
88
|
+
data-variant={variant}
|
|
89
|
+
className={cn(
|
|
90
|
+
"relative flex cursor-default items-center gap-2 rounded-[var(--radius)] px-2 py-1.5 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
91
|
+
className,
|
|
92
|
+
)}
|
|
93
|
+
{...props}
|
|
94
|
+
/>
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function MenubarCheckboxItem({
|
|
99
|
+
className,
|
|
100
|
+
children,
|
|
101
|
+
checked,
|
|
102
|
+
...props
|
|
103
|
+
}: MenuPrimitive.CheckboxItem.Props) {
|
|
104
|
+
return (
|
|
105
|
+
<MenuPrimitive.CheckboxItem
|
|
106
|
+
data-slot="menubar-checkbox-item"
|
|
107
|
+
className={cn(
|
|
108
|
+
"relative flex cursor-default items-center gap-2 rounded-[var(--radius)] py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus: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",
|
|
109
|
+
className,
|
|
110
|
+
)}
|
|
111
|
+
checked={checked}
|
|
112
|
+
{...props}
|
|
113
|
+
>
|
|
114
|
+
<span className="pointer-events-none absolute right-2 flex items-center justify-center">
|
|
115
|
+
<MenuPrimitive.CheckboxItemIndicator>
|
|
116
|
+
<CheckIcon className="size-3" />
|
|
117
|
+
</MenuPrimitive.CheckboxItemIndicator>
|
|
118
|
+
</span>
|
|
119
|
+
{children}
|
|
120
|
+
</MenuPrimitive.CheckboxItem>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function MenubarRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
|
|
125
|
+
return <MenuPrimitive.RadioGroup data-slot="menubar-radio-group" {...props} />
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function MenubarRadioItem({ className, children, ...props }: MenuPrimitive.RadioItem.Props) {
|
|
129
|
+
return (
|
|
130
|
+
<MenuPrimitive.RadioItem
|
|
131
|
+
data-slot="menubar-radio-item"
|
|
132
|
+
className={cn(
|
|
133
|
+
"relative flex cursor-default items-center gap-2 rounded-[var(--radius)] py-1.5 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus: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",
|
|
134
|
+
className,
|
|
135
|
+
)}
|
|
136
|
+
{...props}
|
|
137
|
+
>
|
|
138
|
+
<span className="pointer-events-none absolute right-2 flex items-center justify-center">
|
|
139
|
+
<MenuPrimitive.RadioItemIndicator>
|
|
140
|
+
<CheckIcon className="size-3" />
|
|
141
|
+
</MenuPrimitive.RadioItemIndicator>
|
|
142
|
+
</span>
|
|
143
|
+
{children}
|
|
144
|
+
</MenuPrimitive.RadioItem>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function MenubarLabel({ className, inset, ...props }: React.ComponentProps<'div'> & { inset?: boolean }) {
|
|
149
|
+
return (
|
|
150
|
+
<div
|
|
151
|
+
data-slot="menubar-label"
|
|
152
|
+
data-inset={inset}
|
|
153
|
+
className={cn('px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7', className)}
|
|
154
|
+
{...props}
|
|
155
|
+
/>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function MenubarSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {
|
|
160
|
+
return (
|
|
161
|
+
<MenuPrimitive.Separator
|
|
162
|
+
data-slot="menubar-separator"
|
|
163
|
+
className={cn('-mx-1 h-[length:var(--border-width)] bg-border', className)}
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function MenubarShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
170
|
+
return (
|
|
171
|
+
<span
|
|
172
|
+
data-slot="menubar-shortcut"
|
|
173
|
+
className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
|
|
174
|
+
{...props}
|
|
175
|
+
/>
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function MenubarSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
|
|
180
|
+
return <MenuPrimitive.SubmenuRoot data-slot="menubar-sub" {...props} />
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function MenubarSubTrigger({ className, children, inset, ...props }: MenuPrimitive.SubmenuTrigger.Props & { inset?: boolean }) {
|
|
184
|
+
return (
|
|
185
|
+
<MenuPrimitive.SubmenuTrigger
|
|
186
|
+
data-slot="menubar-sub-trigger"
|
|
187
|
+
data-inset={inset}
|
|
188
|
+
className={cn(
|
|
189
|
+
"flex cursor-default items-center gap-2 rounded-[var(--radius)] px-2 py-1.5 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
190
|
+
className,
|
|
191
|
+
)}
|
|
192
|
+
{...props}
|
|
193
|
+
>
|
|
194
|
+
{children}
|
|
195
|
+
<ChevronRightIcon className="ml-auto" />
|
|
196
|
+
</MenuPrimitive.SubmenuTrigger>
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function MenubarSubContent({ className, ...props }: React.ComponentProps<typeof MenubarContent>) {
|
|
201
|
+
return (
|
|
202
|
+
<MenubarContent
|
|
203
|
+
data-slot="menubar-sub-content"
|
|
204
|
+
className={cn('w-auto min-w-[96px]', className)}
|
|
205
|
+
{...props}
|
|
206
|
+
/>
|
|
207
|
+
)
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export {
|
|
211
|
+
Menubar,
|
|
212
|
+
MenubarMenu,
|
|
213
|
+
MenubarTrigger,
|
|
214
|
+
MenubarContent,
|
|
215
|
+
MenubarItem,
|
|
216
|
+
MenubarCheckboxItem,
|
|
217
|
+
MenubarRadioGroup,
|
|
218
|
+
MenubarRadioItem,
|
|
219
|
+
MenubarLabel,
|
|
220
|
+
MenubarSeparator,
|
|
221
|
+
MenubarShortcut,
|
|
222
|
+
MenubarSub,
|
|
223
|
+
MenubarSubTrigger,
|
|
224
|
+
MenubarSubContent,
|
|
225
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { ChevronDownIcon } from 'lucide-react'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
function NavigationMenu({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
6
|
+
return (
|
|
7
|
+
<nav
|
|
8
|
+
data-slot="navigation-menu"
|
|
9
|
+
className={cn('relative flex items-center', className)}
|
|
10
|
+
{...props}
|
|
11
|
+
/>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function NavigationMenuList({ className, ...props }: React.ComponentProps<'ul'>) {
|
|
16
|
+
return (
|
|
17
|
+
<ul
|
|
18
|
+
data-slot="navigation-menu-list"
|
|
19
|
+
className={cn('flex items-center gap-0 list-none', className)}
|
|
20
|
+
{...props}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function NavigationMenuItem({ className, ...props }: React.ComponentProps<'li'>) {
|
|
26
|
+
return (
|
|
27
|
+
<li
|
|
28
|
+
data-slot="navigation-menu-item"
|
|
29
|
+
className={cn('relative', className)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const navigationMenuTriggerStyle = cn(
|
|
36
|
+
'group inline-flex h-9 items-center justify-center gap-1 rounded-[var(--radius)] px-3 py-2 text-xs font-medium uppercase tracking-wider hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50',
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
function NavigationMenuTrigger({
|
|
40
|
+
className,
|
|
41
|
+
children,
|
|
42
|
+
...props
|
|
43
|
+
}: React.ComponentProps<'button'>) {
|
|
44
|
+
return (
|
|
45
|
+
<button
|
|
46
|
+
data-slot="navigation-menu-trigger"
|
|
47
|
+
className={cn(navigationMenuTriggerStyle, 'cursor-default', className)}
|
|
48
|
+
{...props}
|
|
49
|
+
>
|
|
50
|
+
{children}
|
|
51
|
+
<ChevronDownIcon className="size-3 transition-transform duration-200 group-data-open:rotate-180" />
|
|
52
|
+
</button>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function NavigationMenuContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
57
|
+
return (
|
|
58
|
+
<div
|
|
59
|
+
data-slot="navigation-menu-content"
|
|
60
|
+
className={cn(
|
|
61
|
+
'absolute top-full left-0 z-50 w-auto min-w-48 rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground bg-popover p-2 text-popover-foreground 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',
|
|
62
|
+
className,
|
|
63
|
+
)}
|
|
64
|
+
{...props}
|
|
65
|
+
/>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function NavigationMenuLink({ className, ...props }: React.ComponentProps<'a'>) {
|
|
70
|
+
return (
|
|
71
|
+
<a
|
|
72
|
+
data-slot="navigation-menu-link"
|
|
73
|
+
className={cn(
|
|
74
|
+
'block select-none rounded-[var(--radius)] px-3 py-2 text-xs leading-none outline-none hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground',
|
|
75
|
+
className,
|
|
76
|
+
)}
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function NavigationMenuViewport({ className, ...props }: React.ComponentProps<'div'>) {
|
|
83
|
+
return (
|
|
84
|
+
<div
|
|
85
|
+
data-slot="navigation-menu-viewport"
|
|
86
|
+
className={cn('absolute top-full left-0 z-50 mt-1', className)}
|
|
87
|
+
{...props}
|
|
88
|
+
/>
|
|
89
|
+
)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function NavigationMenuIndicator({ className, ...props }: React.ComponentProps<'div'>) {
|
|
93
|
+
return (
|
|
94
|
+
<div
|
|
95
|
+
data-slot="navigation-menu-indicator"
|
|
96
|
+
className={cn(
|
|
97
|
+
'top-full z-[1] flex h-[length:var(--border-width)] items-end justify-center overflow-hidden',
|
|
98
|
+
className,
|
|
99
|
+
)}
|
|
100
|
+
{...props}
|
|
101
|
+
>
|
|
102
|
+
<div className="relative top-[60%] h-2 w-2 rotate-45 bg-foreground" />
|
|
103
|
+
</div>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
NavigationMenu,
|
|
109
|
+
NavigationMenuList,
|
|
110
|
+
NavigationMenuItem,
|
|
111
|
+
NavigationMenuTrigger,
|
|
112
|
+
NavigationMenuContent,
|
|
113
|
+
NavigationMenuLink,
|
|
114
|
+
NavigationMenuViewport,
|
|
115
|
+
NavigationMenuIndicator,
|
|
116
|
+
navigationMenuTriggerStyle,
|
|
117
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react'
|
|
3
|
+
import { cn } from '@/lib/utils'
|
|
4
|
+
|
|
5
|
+
function Pagination({ className, ...props }: React.ComponentProps<'nav'>) {
|
|
6
|
+
return (
|
|
7
|
+
<nav
|
|
8
|
+
data-slot="pagination"
|
|
9
|
+
role="navigation"
|
|
10
|
+
aria-label="pagination"
|
|
11
|
+
className={cn('mx-auto flex w-full justify-center', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function PaginationContent({ className, ...props }: React.ComponentProps<'ul'>) {
|
|
18
|
+
return (
|
|
19
|
+
<ul
|
|
20
|
+
data-slot="pagination-content"
|
|
21
|
+
className={cn('flex items-center gap-0 list-none', className)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function PaginationItem({ ...props }: React.ComponentProps<'li'>) {
|
|
28
|
+
return <li data-slot="pagination-item" {...props} />
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type PaginationLinkProps = {
|
|
32
|
+
isActive?: boolean
|
|
33
|
+
disabled?: boolean
|
|
34
|
+
} & React.ComponentProps<'a'>
|
|
35
|
+
|
|
36
|
+
function PaginationLink({ className, isActive, disabled, ...props }: PaginationLinkProps) {
|
|
37
|
+
return (
|
|
38
|
+
<a
|
|
39
|
+
data-slot="pagination-link"
|
|
40
|
+
aria-current={isActive ? 'page' : undefined}
|
|
41
|
+
aria-disabled={disabled}
|
|
42
|
+
className={cn(
|
|
43
|
+
'flex h-9 min-w-9 items-center justify-center rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground text-xs font-medium uppercase tracking-wider',
|
|
44
|
+
// No stacking: negative margin collapses adjacent item borders
|
|
45
|
+
'-ml-[length:var(--border-width)] first:ml-0',
|
|
46
|
+
isActive
|
|
47
|
+
? 'z-10 bg-foreground text-background'
|
|
48
|
+
: 'bg-card text-card-foreground hover:bg-accent hover:text-accent-foreground',
|
|
49
|
+
disabled && 'pointer-events-none opacity-40',
|
|
50
|
+
className,
|
|
51
|
+
)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function PaginationPrevious({ className, ...props }: React.ComponentProps<'a'>) {
|
|
58
|
+
return (
|
|
59
|
+
<PaginationLink
|
|
60
|
+
data-slot="pagination-previous"
|
|
61
|
+
aria-label="Previous page"
|
|
62
|
+
className={cn('gap-1 px-2.5', className)}
|
|
63
|
+
{...props}
|
|
64
|
+
>
|
|
65
|
+
<ChevronLeftIcon className="size-3.5" />
|
|
66
|
+
<span className="sr-only sm:not-sr-only">Prev</span>
|
|
67
|
+
</PaginationLink>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function PaginationNext({ className, ...props }: React.ComponentProps<'a'>) {
|
|
72
|
+
return (
|
|
73
|
+
<PaginationLink
|
|
74
|
+
data-slot="pagination-next"
|
|
75
|
+
aria-label="Next page"
|
|
76
|
+
className={cn('gap-1 px-2.5', className)}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
<span className="sr-only sm:not-sr-only">Next</span>
|
|
80
|
+
<ChevronRightIcon className="size-3.5" />
|
|
81
|
+
</PaginationLink>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
|
|
86
|
+
return (
|
|
87
|
+
<span
|
|
88
|
+
data-slot="pagination-ellipsis"
|
|
89
|
+
aria-hidden
|
|
90
|
+
className={cn(
|
|
91
|
+
'flex h-9 w-9 items-center justify-center rounded-[var(--radius)] border-[length:var(--border-width)] border-dashed border-foreground -ml-[length:var(--border-width)] first:ml-0 text-muted-foreground',
|
|
92
|
+
className,
|
|
93
|
+
)}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
<MoreHorizontalIcon className="size-3.5" />
|
|
97
|
+
<span className="sr-only">More pages</span>
|
|
98
|
+
</span>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
Pagination,
|
|
104
|
+
PaginationContent,
|
|
105
|
+
PaginationItem,
|
|
106
|
+
PaginationLink,
|
|
107
|
+
PaginationPrevious,
|
|
108
|
+
PaginationNext,
|
|
109
|
+
PaginationEllipsis,
|
|
110
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover'
|
|
4
|
+
import { XIcon } from 'lucide-react'
|
|
5
|
+
import type * as React from 'react'
|
|
6
|
+
import { cn } from '@/lib/utils'
|
|
7
|
+
|
|
8
|
+
function Popover({ ...props }: PopoverPrimitive.Root.Props) {
|
|
9
|
+
return <PopoverPrimitive.Root data-slot="popover" {...props} />
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
|
|
13
|
+
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function PopoverPortal({ ...props }: PopoverPrimitive.Portal.Props) {
|
|
17
|
+
return <PopoverPrimitive.Portal data-slot="popover-portal" {...props} />
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function PopoverClose({ ...props }: PopoverPrimitive.Close.Props) {
|
|
21
|
+
return <PopoverPrimitive.Close data-slot="popover-close" {...props} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function PopoverContent({
|
|
25
|
+
className,
|
|
26
|
+
side = 'bottom',
|
|
27
|
+
sideOffset = 6,
|
|
28
|
+
align = 'center',
|
|
29
|
+
showCloseButton = false,
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}: PopoverPrimitive.Popup.Props &
|
|
33
|
+
Pick<PopoverPrimitive.Positioner.Props, 'side' | 'sideOffset' | 'align'> & {
|
|
34
|
+
showCloseButton?: boolean
|
|
35
|
+
}) {
|
|
36
|
+
return (
|
|
37
|
+
<PopoverPortal>
|
|
38
|
+
<PopoverPrimitive.Positioner
|
|
39
|
+
side={side}
|
|
40
|
+
sideOffset={sideOffset}
|
|
41
|
+
align={align}
|
|
42
|
+
className="isolate z-50"
|
|
43
|
+
>
|
|
44
|
+
<PopoverPrimitive.Popup
|
|
45
|
+
data-slot="popover-content"
|
|
46
|
+
className={cn(
|
|
47
|
+
'relative z-50 w-72 origin-(--transform-origin) rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground bg-popover p-4 text-xs/relaxed text-popover-foreground shadow-none duration-100 outline-none 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 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',
|
|
48
|
+
className,
|
|
49
|
+
)}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
{showCloseButton && (
|
|
54
|
+
<PopoverPrimitive.Close
|
|
55
|
+
className="absolute top-2 right-2 flex size-6 items-center justify-center text-muted-foreground hover:text-foreground"
|
|
56
|
+
aria-label="Close"
|
|
57
|
+
>
|
|
58
|
+
<XIcon className="size-3.5" />
|
|
59
|
+
</PopoverPrimitive.Close>
|
|
60
|
+
)}
|
|
61
|
+
</PopoverPrimitive.Popup>
|
|
62
|
+
</PopoverPrimitive.Positioner>
|
|
63
|
+
</PopoverPortal>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function PopoverArrow({ className, ...props }: PopoverPrimitive.Arrow.Props) {
|
|
68
|
+
return (
|
|
69
|
+
<PopoverPrimitive.Arrow
|
|
70
|
+
data-slot="popover-arrow"
|
|
71
|
+
className={cn('fill-foreground', className)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { Popover, PopoverTrigger, PopoverPortal, PopoverClose, PopoverContent, PopoverArrow }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { Progress as ProgressPrimitive } from '@base-ui/react/progress'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
function Progress({
|
|
8
|
+
className,
|
|
9
|
+
value,
|
|
10
|
+
max = 100,
|
|
11
|
+
...props
|
|
12
|
+
}: ProgressPrimitive.Root.Props) {
|
|
13
|
+
return (
|
|
14
|
+
<ProgressPrimitive.Root
|
|
15
|
+
data-slot="progress"
|
|
16
|
+
value={value}
|
|
17
|
+
max={max}
|
|
18
|
+
className={cn(
|
|
19
|
+
'relative h-2 w-full overflow-hidden rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground bg-transparent',
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
>
|
|
24
|
+
<ProgressPrimitive.Track
|
|
25
|
+
data-slot="progress-track"
|
|
26
|
+
className="relative h-full w-full overflow-hidden bg-muted"
|
|
27
|
+
>
|
|
28
|
+
<ProgressPrimitive.Indicator
|
|
29
|
+
data-slot="progress-indicator"
|
|
30
|
+
className="h-full w-[var(--progress-value)] bg-foreground transition-[width] duration-300"
|
|
31
|
+
/>
|
|
32
|
+
</ProgressPrimitive.Track>
|
|
33
|
+
</ProgressPrimitive.Root>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { Progress }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'
|
|
4
|
+
import * as React from 'react'
|
|
5
|
+
import { cn } from '@/lib/utils'
|
|
6
|
+
|
|
7
|
+
function RadioGroup({ className, ...props }: RadioGroupPrimitive.Root.Props) {
|
|
8
|
+
return (
|
|
9
|
+
<RadioGroupPrimitive.Root
|
|
10
|
+
data-slot="radio-group"
|
|
11
|
+
className={cn('flex flex-col gap-2', className)}
|
|
12
|
+
{...props}
|
|
13
|
+
/>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function RadioGroupItem({ className, ...props }: RadioGroupPrimitive.Item.Props) {
|
|
18
|
+
return (
|
|
19
|
+
<RadioGroupPrimitive.Item
|
|
20
|
+
data-slot="radio-group-item"
|
|
21
|
+
className={cn(
|
|
22
|
+
'peer flex size-4 shrink-0 items-center justify-center rounded-[var(--radius)] border-[length:var(--border-width)] border-foreground bg-transparent',
|
|
23
|
+
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
|
|
24
|
+
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
25
|
+
'data-checked:bg-foreground',
|
|
26
|
+
'aria-invalid:border-destructive',
|
|
27
|
+
className,
|
|
28
|
+
)}
|
|
29
|
+
{...props}
|
|
30
|
+
>
|
|
31
|
+
<RadioGroupPrimitive.Indicator
|
|
32
|
+
data-slot="radio-group-indicator"
|
|
33
|
+
className="flex items-center justify-center"
|
|
34
|
+
>
|
|
35
|
+
<div className="size-1.5 rounded-[var(--radius)] bg-background" />
|
|
36
|
+
</RadioGroupPrimitive.Indicator>
|
|
37
|
+
</RadioGroupPrimitive.Item>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { RadioGroup, RadioGroupItem }
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { cn } from '@/lib/utils'
|
|
3
|
+
|
|
4
|
+
interface CardProps extends React.HTMLAttributes<HTMLElement> {
|
|
5
|
+
title?: string
|
|
6
|
+
mode?: 'left' | 'right' | 'center'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ReceiptCard = React.forwardRef<HTMLElement, CardProps>(
|
|
10
|
+
({ children, mode = 'center', title, className, ...props }, ref) => {
|
|
11
|
+
const leftClasses =
|
|
12
|
+
'min-w-[10%] w-full shadow-[inset_1px_0_0_0_var(--border-color),inset_0_1px_0_0_var(--border-color)] py-2 px-[2ch]'
|
|
13
|
+
|
|
14
|
+
const leftCornerClasses =
|
|
15
|
+
'shrink-0 shadow-[inset_1px_0_0_0_var(--border-color),inset_0_1px_0_0_var(--border-color)] py-2 px-[1ch]'
|
|
16
|
+
|
|
17
|
+
const rightClasses =
|
|
18
|
+
'min-w-[10%] w-full shadow-[inset_-1px_0_0_0_var(--border-color),inset_0_1px_0_0_var(--border-color)] py-2 px-[2ch]'
|
|
19
|
+
|
|
20
|
+
const rightCornerClasses =
|
|
21
|
+
'shrink-0 shadow-[inset_-1px_0_0_0_var(--border-color),inset_0_1px_0_0_var(--border-color)] py-2 px-[1ch]'
|
|
22
|
+
|
|
23
|
+
const titleClasses = 'shrink-0 px-[1ch] text-sm font-normal'
|
|
24
|
+
|
|
25
|
+
let titleElement = (
|
|
26
|
+
<header className="flex items-end justify-between">
|
|
27
|
+
<div className={leftClasses} aria-hidden="true" />
|
|
28
|
+
{title ? <h2 className={titleClasses}>{title}</h2> : null}
|
|
29
|
+
<div className={rightClasses} aria-hidden="true" />
|
|
30
|
+
</header>
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
if (mode === 'left') {
|
|
34
|
+
titleElement = (
|
|
35
|
+
<header className="flex items-end justify-between">
|
|
36
|
+
<div className={leftCornerClasses} aria-hidden="true" />
|
|
37
|
+
<h2 className={titleClasses}>{title}</h2>
|
|
38
|
+
<div className={rightClasses} aria-hidden="true" />
|
|
39
|
+
</header>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (mode === 'right') {
|
|
44
|
+
titleElement = (
|
|
45
|
+
<header className="flex items-end justify-between">
|
|
46
|
+
<div className={leftClasses} aria-hidden="true" />
|
|
47
|
+
<h2 className={titleClasses}>{title}</h2>
|
|
48
|
+
<div className={rightCornerClasses} aria-hidden="true" />
|
|
49
|
+
</header>
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<article
|
|
55
|
+
ref={ref}
|
|
56
|
+
data-slot="receipt-card"
|
|
57
|
+
className={cn('relative block p-0 whitespace-pre-wrap', className)}
|
|
58
|
+
{...props}
|
|
59
|
+
>
|
|
60
|
+
{titleElement}
|
|
61
|
+
<section className="block py-2 px-[2ch] overflow-x-auto overflow-y-hidden shadow-[inset_1px_0_0_0_var(--border-color),inset_-1px_0_0_0_var(--border-color),inset_0_-1px_0_0_var(--border-color)] scrollbar-none">
|
|
62
|
+
{children}
|
|
63
|
+
</section>
|
|
64
|
+
</article>
|
|
65
|
+
)
|
|
66
|
+
},
|
|
67
|
+
)
|
|
68
|
+
ReceiptCard.displayName = 'ReceiptCard'
|
|
69
|
+
|
|
70
|
+
export { ReceiptCard }
|