@pallamart/pm-core-components 1.0.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 (83) hide show
  1. package/LICENSE +32 -0
  2. package/README.md +21 -0
  3. package/dist/auth/microsoft-auth-button.d.ts +6 -0
  4. package/dist/auth/microsoft-auth-button.js +10 -0
  5. package/dist/create-element.d.ts +7 -0
  6. package/dist/create-element.js +34 -0
  7. package/dist/external/breadcrumb.d.ts +10 -0
  8. package/dist/external/breadcrumb.js +20 -0
  9. package/dist/external/index.d.ts +12 -0
  10. package/dist/external/index.js +9 -0
  11. package/dist/external/products/product-details.d.ts +8 -0
  12. package/dist/external/products/product-details.js +12 -0
  13. package/dist/external/products/product-rail-item.d.ts +9 -0
  14. package/dist/external/products/product-rail-item.js +22 -0
  15. package/dist/external/products/product-rail.d.ts +11 -0
  16. package/dist/external/products/product-rail.js +18 -0
  17. package/dist/external/products/room-color-step.d.ts +11 -0
  18. package/dist/external/products/room-color-step.js +36 -0
  19. package/dist/external/products/wall-color-control.d.ts +8 -0
  20. package/dist/external/products/wall-color-control.js +25 -0
  21. package/dist/external/storefront-footer.d.ts +10 -0
  22. package/dist/external/storefront-footer.js +12 -0
  23. package/dist/external/storefront-header.d.ts +5 -0
  24. package/dist/external/storefront-header.js +27 -0
  25. package/dist/external/types.d.ts +27 -0
  26. package/dist/external/types.js +1 -0
  27. package/dist/index.d.ts +27 -0
  28. package/dist/index.js +27 -0
  29. package/dist/loaders/dot-loader.d.ts +1 -0
  30. package/dist/loaders/dot-loader.js +7 -0
  31. package/dist/loaders/inline-loader.d.ts +5 -0
  32. package/dist/loaders/inline-loader.js +10 -0
  33. package/dist/root/not-found-ui.d.ts +5 -0
  34. package/dist/root/not-found-ui.js +25 -0
  35. package/dist/root/root-error-ui.d.ts +7 -0
  36. package/dist/root/root-error-ui.js +28 -0
  37. package/dist/ui/alert.d.ts +8 -0
  38. package/dist/ui/alert.js +25 -0
  39. package/dist/ui/app-header.d.ts +21 -0
  40. package/dist/ui/app-header.js +50 -0
  41. package/dist/ui/avatar.d.ts +4 -0
  42. package/dist/ui/avatar.js +20 -0
  43. package/dist/ui/badge.d.ts +7 -0
  44. package/dist/ui/badge.js +13 -0
  45. package/dist/ui/breadcrumb.d.ts +5 -0
  46. package/dist/ui/breadcrumb.js +29 -0
  47. package/dist/ui/button.d.ts +15 -0
  48. package/dist/ui/button.js +26 -0
  49. package/dist/ui/card.d.ts +7 -0
  50. package/dist/ui/card.js +38 -0
  51. package/dist/ui/dialog.d.ts +16 -0
  52. package/dist/ui/dialog.js +52 -0
  53. package/dist/ui/dropdown-menu.d.ts +12 -0
  54. package/dist/ui/dropdown-menu.js +43 -0
  55. package/dist/ui/empty.d.ts +5 -0
  56. package/dist/ui/empty.js +26 -0
  57. package/dist/ui/file-picker.d.ts +20 -0
  58. package/dist/ui/file-picker.js +49 -0
  59. package/dist/ui/form.d.ts +15 -0
  60. package/dist/ui/form.js +67 -0
  61. package/dist/ui/icon-button.d.ts +11 -0
  62. package/dist/ui/icon-button.js +18 -0
  63. package/dist/ui/misc.d.ts +10 -0
  64. package/dist/ui/misc.js +46 -0
  65. package/dist/ui/popover.d.ts +6 -0
  66. package/dist/ui/popover.js +20 -0
  67. package/dist/ui/progress.d.ts +4 -0
  68. package/dist/ui/progress.js +16 -0
  69. package/dist/ui/separator.d.ts +4 -0
  70. package/dist/ui/separator.js +10 -0
  71. package/dist/ui/skeleton.d.ts +2 -0
  72. package/dist/ui/skeleton.js +8 -0
  73. package/dist/ui/spinner.d.ts +2 -0
  74. package/dist/ui/spinner.js +26 -0
  75. package/dist/ui/table.d.ts +7 -0
  76. package/dist/ui/table.js +41 -0
  77. package/dist/ui/tabs.d.ts +6 -0
  78. package/dist/ui/tabs.js +17 -0
  79. package/dist/ui/tooltip.d.ts +4 -0
  80. package/dist/ui/tooltip.js +20 -0
  81. package/dist/utils/cn.d.ts +1 -0
  82. package/dist/utils/cn.js +3 -0
  83. package/package.json +80 -0
@@ -0,0 +1,25 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ const alertVariants = {
4
+ default: 'border-border bg-card text-card-foreground',
5
+ destructive: 'border-destructive/40 bg-destructive-muted text-destructive',
6
+ success: 'border-success/40 bg-success-muted text-success-foreground',
7
+ };
8
+ export function Alert({ className, variant = 'default', ...props }) {
9
+ return createElement('div', {
10
+ ...props,
11
+ className: cn('relative w-full rounded-lg border px-4 py-3 text-body-3', alertVariants[variant], className),
12
+ });
13
+ }
14
+ export function AlertTitle({ className, ...props }) {
15
+ return createElement('h5', {
16
+ ...props,
17
+ className: cn('mb-1 leading-none tracking-tight', className),
18
+ });
19
+ }
20
+ export function AlertDescription({ className, ...props }) {
21
+ return createElement('div', {
22
+ ...props,
23
+ className: cn('text-body-3 leading-6 opacity-90', className),
24
+ });
25
+ }
@@ -0,0 +1,21 @@
1
+ interface AppHeaderNavItem {
2
+ active?: boolean;
3
+ href: string;
4
+ id: string;
5
+ label: string;
6
+ }
7
+ interface AppHeaderProps {
8
+ appTitle: string;
9
+ linkComponent?: any;
10
+ logoAlt?: string;
11
+ logoSrc: string;
12
+ navLinkComponent?: any;
13
+ logoutHref: string;
14
+ navItems?: AppHeaderNavItem[];
15
+ user: {
16
+ avatarUrl?: string | null;
17
+ displayName: string;
18
+ } | null;
19
+ }
20
+ export declare function AppHeader({ appTitle, linkComponent, logoAlt, logoSrc, navLinkComponent, logoutHref, navItems, user, }: AppHeaderProps): any;
21
+ export {};
@@ -0,0 +1,50 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ import { Avatar, AvatarFallback, AvatarImage } from './avatar.js';
4
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from './dropdown-menu.js';
5
+ import { TabsList, TabsTrigger } from './tabs.js';
6
+ export function AppHeader({ appTitle, linkComponent, logoAlt = 'Pallamart logo', logoSrc, navLinkComponent, logoutHref, navItems = [], user, }) {
7
+ const LinkComponent = linkComponent ?? 'a';
8
+ const linkDestinationProp = LinkComponent === 'a' ? 'href' : 'to';
9
+ const NavLinkComponent = navLinkComponent ?? LinkComponent;
10
+ const navLinkDestinationProp = NavLinkComponent === 'a' ? 'href' : 'to';
11
+ return createElement('header', { className: 'sticky top-0 z-40 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/80' }, createElement('div', {
12
+ className: 'mx-auto flex w-full max-w-screen-2xl flex-col gap-3 px-4 py-3 sm:px-6',
13
+ }, createElement('div', { className: 'flex min-w-0 items-center justify-between gap-3' }, createElement('div', { className: 'flex min-w-0 flex-1 items-center gap-2.5' }, createElement('div', {
14
+ className: 'flex h-10 w-10 shrink-0 items-center justify-center rounded-lg border border-border bg-muted',
15
+ }, createElement('img', {
16
+ alt: logoAlt,
17
+ className: 'h-6 w-6 object-contain',
18
+ src: logoSrc,
19
+ })), createElement('h1', { className: 'min-w-0 truncate text-body-2 text-foreground' }, appTitle)), user
20
+ ? createElement(DropdownMenu, null, createElement(DropdownMenuTrigger, {
21
+ className: 'inline-flex min-h-10 max-w-[min(14rem,56vw)] items-center justify-center gap-2 whitespace-nowrap rounded-lg border border-input bg-background px-2.5 py-1.5 pr-3.5 text-body-3 leading-none shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
22
+ }, createElement(Avatar, {
23
+ 'aria-label': user.displayName,
24
+ className: 'h-8 w-8',
25
+ title: user.displayName,
26
+ }, user.avatarUrl
27
+ ? createElement(AvatarImage, {
28
+ alt: user.displayName,
29
+ src: user.avatarUrl,
30
+ })
31
+ : createElement(AvatarFallback, null, user.displayName.slice(0, 1).toUpperCase())), createElement('p', { className: 'min-w-0 truncate text-body-3 text-foreground' }, user.displayName)), createElement(DropdownMenuContent, { align: 'end', className: 'min-w-52' }, createElement(DropdownMenuLabel, { className: 'space-y-1 px-3 py-2' }, createElement('p', { className: 'leading-none' }, 'Account'), createElement('p', {
32
+ className: 'mt-0.5 max-w-48 truncate text-body-3 text-muted-foreground',
33
+ }, user.displayName)), createElement(DropdownMenuSeparator, null), createElement(DropdownMenuItem, {
34
+ as: LinkComponent,
35
+ className: 'px-3',
36
+ [linkDestinationProp]: logoutHref,
37
+ }, 'Sign out')))
38
+ : null), navItems.length
39
+ ? createElement('nav', { 'aria-label': 'Primary' }, createElement(TabsList, { className: 'max-w-full justify-start overflow-x-auto rounded-lg' }, ...navItems.map((item) => createElement(NavLinkComponent, {
40
+ 'aria-current': item.active ? 'page' : undefined,
41
+ className: 'shrink-0',
42
+ end: NavLinkComponent === 'a' ? undefined : true,
43
+ key: item.id,
44
+ [navLinkDestinationProp]: item.href,
45
+ }, createElement(TabsTrigger, {
46
+ active: item.active,
47
+ className: cn(item.active ? 'pointer-events-none' : undefined),
48
+ }, item.label)))))
49
+ : null));
50
+ }
@@ -0,0 +1,4 @@
1
+ import type React from 'react';
2
+ export declare function Avatar({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): any;
3
+ export declare function AvatarImage({ className, ...props }: React.ImgHTMLAttributes<HTMLImageElement>): any;
4
+ export declare function AvatarFallback({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): any;
@@ -0,0 +1,20 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Avatar({ className, ...props }) {
4
+ return createElement('span', {
5
+ ...props,
6
+ className: cn('relative flex h-8 w-8 shrink-0 overflow-hidden rounded-full', className),
7
+ });
8
+ }
9
+ export function AvatarImage({ className, ...props }) {
10
+ return createElement('img', {
11
+ ...props,
12
+ className: cn('aspect-square h-full w-full object-cover', className),
13
+ });
14
+ }
15
+ export function AvatarFallback({ className, ...props }) {
16
+ return createElement('span', {
17
+ ...props,
18
+ className: cn('flex h-full w-full items-center justify-center rounded-full bg-muted text-body-3 text-muted-foreground', className),
19
+ });
20
+ }
@@ -0,0 +1,7 @@
1
+ import type React from 'react';
2
+ type BadgeVariant = 'default' | 'outline' | 'secondary';
3
+ export declare function Badge({ className, variant, ...props }: Record<string, unknown> & {
4
+ className?: string;
5
+ variant?: BadgeVariant;
6
+ } & React.HTMLAttributes<HTMLSpanElement>): any;
7
+ export {};
@@ -0,0 +1,13 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ const badgeVariants = {
4
+ default: 'border-transparent bg-primary text-primary-foreground',
5
+ outline: 'text-foreground',
6
+ secondary: 'border-transparent bg-secondary text-secondary-foreground',
7
+ };
8
+ export function Badge({ className, variant = 'secondary', ...props }) {
9
+ return createElement('span', {
10
+ ...props,
11
+ className: cn('inline-flex h-6 items-center rounded-md border px-2.5 text-xs leading-none transition-colors', badgeVariants[variant], className),
12
+ });
13
+ }
@@ -0,0 +1,5 @@
1
+ import type React from 'react';
2
+ export declare function Breadcrumb({ className, ...props }: React.HTMLAttributes<HTMLElement>): any;
3
+ export declare function BreadcrumbList({ className, ...props }: React.OlHTMLAttributes<HTMLOListElement>): any;
4
+ export declare function BreadcrumbItem({ className, ...props }: React.LiHTMLAttributes<HTMLLIElement>): any;
5
+ export declare function BreadcrumbSeparator({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): any;
@@ -0,0 +1,29 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Breadcrumb({ className, ...props }) {
4
+ return createElement('nav', {
5
+ ...props,
6
+ 'aria-label': props['aria-label'] ?? 'Breadcrumb',
7
+ className: cn('flex', className),
8
+ });
9
+ }
10
+ export function BreadcrumbList({ className, ...props }) {
11
+ return createElement('ol', {
12
+ ...props,
13
+ className: cn('flex flex-wrap items-center gap-1.5 text-body-3 text-muted-foreground', className),
14
+ });
15
+ }
16
+ export function BreadcrumbItem({ className, ...props }) {
17
+ return createElement('li', {
18
+ ...props,
19
+ className: cn('inline-flex items-center gap-1.5', className),
20
+ });
21
+ }
22
+ export function BreadcrumbSeparator({ className, ...props }) {
23
+ return createElement('span', {
24
+ ...props,
25
+ 'aria-hidden': true,
26
+ className: cn('text-muted-foreground/70', className),
27
+ children: props.children ?? '/',
28
+ });
29
+ }
@@ -0,0 +1,15 @@
1
+ import type React from 'react';
2
+ type ButtonVariant = 'default' | 'destructive' | 'ghost' | 'link' | 'outline' | 'secondary';
3
+ type ButtonSize = 'default' | 'icon' | 'lg' | 'sm';
4
+ export declare function buttonVariants({ className, size, variant, }?: {
5
+ className?: string;
6
+ size?: ButtonSize;
7
+ variant?: ButtonVariant;
8
+ }): string;
9
+ export declare function Button({ as, className, size, variant, ...props }: Record<string, unknown> & {
10
+ as?: any;
11
+ className?: string;
12
+ size?: ButtonSize;
13
+ variant?: ButtonVariant;
14
+ } & React.ButtonHTMLAttributes<HTMLButtonElement>): any;
15
+ export {};
@@ -0,0 +1,26 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ const buttonBase = 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-body-3 leading-none transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50';
4
+ const buttonVariantsByName = {
5
+ default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
6
+ destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
7
+ ghost: 'hover:bg-accent hover:text-accent-foreground',
8
+ link: 'text-primary underline-offset-4 hover:underline',
9
+ outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
10
+ secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
11
+ };
12
+ const buttonSizesByName = {
13
+ default: 'h-10 px-4 py-2',
14
+ icon: 'h-9 w-9',
15
+ lg: 'h-11 rounded-md px-8',
16
+ sm: 'h-8 rounded-md px-3 text-xs',
17
+ };
18
+ export function buttonVariants({ className, size = 'default', variant = 'default', } = {}) {
19
+ return cn(buttonBase, buttonVariantsByName[variant], buttonSizesByName[size], className);
20
+ }
21
+ export function Button({ as, className, size, variant, ...props }) {
22
+ return createElement(as ?? 'button', {
23
+ ...props,
24
+ className: buttonVariants({ className, size, variant }),
25
+ });
26
+ }
@@ -0,0 +1,7 @@
1
+ import type React from 'react';
2
+ export declare function Card({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
3
+ export declare function CardHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
4
+ export declare function CardTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): any;
5
+ export declare function CardDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): any;
6
+ export declare function CardContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
7
+ export declare function CardFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
@@ -0,0 +1,38 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Card({ className, ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ className: cn('rounded-lg border bg-card text-card-foreground shadow-sm', className),
7
+ });
8
+ }
9
+ export function CardHeader({ className, ...props }) {
10
+ return createElement('div', {
11
+ ...props,
12
+ className: cn('flex flex-col gap-1.5 p-5 sm:p-6', className),
13
+ });
14
+ }
15
+ export function CardTitle({ className, ...props }) {
16
+ return createElement('h3', {
17
+ ...props,
18
+ className: cn('text-header-4 leading-6 tracking-tight', className),
19
+ });
20
+ }
21
+ export function CardDescription({ className, ...props }) {
22
+ return createElement('p', {
23
+ ...props,
24
+ className: cn('text-body-3 text-muted-foreground', className),
25
+ });
26
+ }
27
+ export function CardContent({ className, ...props }) {
28
+ return createElement('div', {
29
+ ...props,
30
+ className: cn('p-5 sm:p-6', className),
31
+ });
32
+ }
33
+ export function CardFooter({ className, ...props }) {
34
+ return createElement('div', {
35
+ ...props,
36
+ className: cn('flex items-center p-5 sm:p-6', className),
37
+ });
38
+ }
@@ -0,0 +1,16 @@
1
+ import type React from 'react';
2
+ interface DialogProps {
3
+ children: React.ReactNode;
4
+ onOpenChange?: (open: boolean) => void;
5
+ open: boolean;
6
+ }
7
+ export declare function Dialog({ children, onOpenChange, open, }: DialogProps): any;
8
+ export declare function DialogOverlay({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
9
+ export declare function DialogContent({ children, className, side, ...props }: React.HTMLAttributes<HTMLDivElement> & {
10
+ side?: 'center' | 'right';
11
+ }): any;
12
+ export declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
13
+ export declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
14
+ export declare function DialogTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): any;
15
+ export declare function DialogDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): any;
16
+ export {};
@@ -0,0 +1,52 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Dialog({ children, onOpenChange, open, }) {
4
+ if (!open) {
5
+ return null;
6
+ }
7
+ return createElement('div', { className: 'fixed inset-0 z-50' }, createElement(DialogOverlay, { onClick: () => onOpenChange?.(false) }), children);
8
+ }
9
+ export function DialogOverlay({ className, ...props }) {
10
+ return createElement('div', {
11
+ ...props,
12
+ className: cn('fixed inset-0 bg-overlay/80 backdrop-blur-sm animate-fade-in', className),
13
+ });
14
+ }
15
+ export function DialogContent({ children, className, side = 'center', ...props }) {
16
+ return createElement('div', {
17
+ 'aria-modal': 'true',
18
+ className: side === 'right'
19
+ ? 'fixed inset-y-0 right-0 flex w-full justify-end sm:max-w-none'
20
+ : 'fixed inset-0 flex items-center justify-center p-4',
21
+ role: 'dialog',
22
+ }, createElement('div', {
23
+ ...props,
24
+ className: cn(side === 'right'
25
+ ? 'h-full w-full overflow-auto border-l border-border bg-card text-card-foreground shadow-lg animate-slide-fade-in sm:max-w-2xl'
26
+ : 'max-h-[90vh] w-full overflow-auto rounded-lg border border-border bg-card text-card-foreground shadow-lg animate-slide-fade-in sm:max-w-3xl', className),
27
+ }, children));
28
+ }
29
+ export function DialogHeader({ className, ...props }) {
30
+ return createElement('div', {
31
+ ...props,
32
+ className: cn('flex flex-col gap-1.5 text-left', className),
33
+ });
34
+ }
35
+ export function DialogFooter({ className, ...props }) {
36
+ return createElement('div', {
37
+ ...props,
38
+ className: cn('flex flex-col-reverse gap-2 sm:flex-row sm:justify-end', className),
39
+ });
40
+ }
41
+ export function DialogTitle({ className, ...props }) {
42
+ return createElement('h2', {
43
+ ...props,
44
+ className: cn('text-header-4 leading-none tracking-tight', className),
45
+ });
46
+ }
47
+ export function DialogDescription({ className, ...props }) {
48
+ return createElement('p', {
49
+ ...props,
50
+ className: cn('text-body-3 text-muted-foreground', className),
51
+ });
52
+ }
@@ -0,0 +1,12 @@
1
+ import type React from 'react';
2
+ export declare function DropdownMenu({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
3
+ export declare function DropdownMenuTrigger({ className, ...props }: React.HTMLAttributes<HTMLElement>): any;
4
+ export declare function DropdownMenuContent({ align, className, ...props }: React.HTMLAttributes<HTMLDivElement> & {
5
+ align?: 'end' | 'start';
6
+ }): any;
7
+ export declare function DropdownMenuLabel({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
8
+ export declare function DropdownMenuSeparator({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
9
+ export declare function DropdownMenuItem({ as, className, ...props }: Record<string, unknown> & {
10
+ as?: any;
11
+ className?: string;
12
+ } & React.HTMLAttributes<HTMLElement>): any;
@@ -0,0 +1,43 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function DropdownMenu({ className, ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ className: cn('group relative inline-block text-left', className),
7
+ });
8
+ }
9
+ export function DropdownMenuTrigger({ className, ...props }) {
10
+ return createElement('button', {
11
+ ...props,
12
+ type: props.type ?? 'button',
13
+ className: cn('flex cursor-pointer items-center', className),
14
+ });
15
+ }
16
+ export function DropdownMenuContent({ align = 'end', className, ...props }) {
17
+ return createElement('div', {
18
+ ...props,
19
+ className: cn('absolute top-full z-50 hidden min-w-56 pt-2 text-popover-foreground group-hover:block group-focus-within:block', align === 'end' ? 'right-0' : 'left-0', className),
20
+ children: createElement('div', {
21
+ className: 'overflow-hidden rounded-md border bg-popover p-1 shadow-lg',
22
+ children: props.children,
23
+ }),
24
+ });
25
+ }
26
+ export function DropdownMenuLabel({ className, ...props }) {
27
+ return createElement('div', {
28
+ ...props,
29
+ className: cn('px-2 py-1.5 text-body-3 leading-none', className),
30
+ });
31
+ }
32
+ export function DropdownMenuSeparator({ className, ...props }) {
33
+ return createElement('div', {
34
+ ...props,
35
+ className: cn('-mx-1 my-1 h-px bg-muted', className),
36
+ });
37
+ }
38
+ export function DropdownMenuItem({ as, className, ...props }) {
39
+ return createElement(as ?? 'div', {
40
+ ...props,
41
+ className: cn('relative flex min-h-8 w-full cursor-default select-none items-center rounded-sm px-2 py-1.5 text-body-3 outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground', className),
42
+ });
43
+ }
@@ -0,0 +1,5 @@
1
+ import type React from 'react';
2
+ export declare function Empty({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
3
+ export declare function EmptyTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): any;
4
+ export declare function EmptyDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): any;
5
+ export declare function EmptyPanel({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
@@ -0,0 +1,26 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Empty({ className, ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ className: cn('flex min-h-40 flex-col items-center justify-center rounded-lg border border-dashed px-6 py-10 text-center', className),
7
+ });
8
+ }
9
+ export function EmptyTitle({ className, ...props }) {
10
+ return createElement('h3', {
11
+ ...props,
12
+ className: cn('text-body-3 text-foreground', className),
13
+ });
14
+ }
15
+ export function EmptyDescription({ className, ...props }) {
16
+ return createElement('p', {
17
+ ...props,
18
+ className: cn('mt-2 text-body-3 text-muted-foreground', className),
19
+ });
20
+ }
21
+ export function EmptyPanel({ className, ...props }) {
22
+ return createElement('div', {
23
+ ...props,
24
+ className: cn('rounded-lg border border-dashed border-border bg-muted/40 px-4 py-5 text-body-3 text-muted-foreground', className),
25
+ });
26
+ }
@@ -0,0 +1,20 @@
1
+ import type React from 'react';
2
+ interface FilePickerProps {
3
+ accept?: string;
4
+ disabled?: boolean;
5
+ error?: string;
6
+ inputId: string;
7
+ inputRef?: React.Ref<HTMLInputElement>;
8
+ label?: string;
9
+ name?: string;
10
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
11
+ onClear?: () => void;
12
+ onClickPicker?: () => void;
13
+ onDrop?: React.DragEventHandler<HTMLDivElement>;
14
+ onDragOver?: React.DragEventHandler<HTMLDivElement>;
15
+ onPickerClick?: React.MouseEventHandler<HTMLLabelElement>;
16
+ previewName?: string | null;
17
+ previewUrl?: string | null;
18
+ }
19
+ export declare function FilePicker({ accept, disabled, error, inputId, inputRef, label, name, onChange, onClear, onClickPicker, onDragOver, onDrop, onPickerClick, previewName, previewUrl, }: FilePickerProps): any;
20
+ export {};
@@ -0,0 +1,49 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { Button } from './button.js';
3
+ import { Input, Label } from './form.js';
4
+ export function FilePicker({ accept = 'image/*', disabled, error, inputId, inputRef, label = 'Photo', name, onChange, onClear, onClickPicker, onDragOver, onDrop, onPickerClick, previewName, previewUrl, }) {
5
+ return createElement('div', { className: 'flex w-full flex-col space-y-2' }, label ? createElement(Label, null, label) : null, createElement('div', {
6
+ className: 'relative min-h-[12rem] w-full overflow-hidden rounded-lg border-2 border-dashed border-border bg-card transition-colors',
7
+ onDragOver,
8
+ onDrop,
9
+ }, previewName && previewUrl
10
+ ? createElement('div', { className: 'flex h-full min-h-[12rem] flex-col' }, createElement('div', { className: 'flex flex-1 items-center justify-center bg-card/80 p-4' }, createElement('img', {
11
+ alt: '',
12
+ className: 'max-h-48 w-auto rounded-lg border border-border object-contain',
13
+ src: previewUrl,
14
+ })), createElement('div', {
15
+ className: 'flex items-center justify-between gap-3 border-t border-border bg-card px-4 py-3',
16
+ }, createElement('span', { className: 'min-w-0 flex-1 truncate text-body-3 text-foreground' }, previewName), createElement('div', { className: 'flex shrink-0 items-center gap-2' }, createElement(Button, {
17
+ 'aria-label': 'Change file',
18
+ disabled,
19
+ onClick: onClickPicker,
20
+ size: 'sm',
21
+ type: 'button',
22
+ variant: 'outline',
23
+ }, 'Change'), createElement(Button, {
24
+ 'aria-label': 'Remove file',
25
+ className: 'h-auto px-0 py-0 text-muted-foreground',
26
+ disabled,
27
+ onClick: onClear,
28
+ type: 'button',
29
+ variant: 'link',
30
+ }, 'Remove'))))
31
+ : createElement(Label, {
32
+ 'aria-disabled': disabled,
33
+ className: 'absolute inset-0 flex cursor-pointer flex-col items-center justify-center gap-2 p-6 transition-colors hover:bg-primary/5 hover:border-primary/40',
34
+ htmlFor: inputId,
35
+ onClick: onPickerClick,
36
+ style: { cursor: disabled ? 'not-allowed' : 'pointer' },
37
+ }, createElement('div', { className: 'flex flex-col items-center gap-1 text-center' }, createElement('span', { className: 'text-body-3 text-foreground' }, 'Drag & drop here or click to browse'), createElement('span', { className: 'text-body-3 text-muted-foreground' }, accept === 'image/*' ? 'Images only' : accept))), createElement(Input, {
38
+ 'aria-disabled': disabled,
39
+ 'aria-label': label,
40
+ accept,
41
+ className: 'sr-only',
42
+ disabled,
43
+ id: inputId,
44
+ name,
45
+ onChange,
46
+ ref: inputRef,
47
+ type: 'file',
48
+ })), error ? createElement('p', { className: 'text-body-3 text-destructive' }, error) : null);
49
+ }
@@ -0,0 +1,15 @@
1
+ import type React from 'react';
2
+ export declare function Field({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
3
+ export declare function Label({ className, ...props }: React.LabelHTMLAttributes<HTMLLabelElement>): any;
4
+ export declare function Input({ className, ...props }: React.InputHTMLAttributes<HTMLInputElement> & {
5
+ ref?: React.Ref<HTMLInputElement>;
6
+ }): any;
7
+ export declare function DatePicker({ className, ...props }: React.InputHTMLAttributes<HTMLInputElement> & {
8
+ ref?: React.Ref<HTMLInputElement>;
9
+ }): any;
10
+ export declare function Textarea({ className, ...props }: React.TextareaHTMLAttributes<HTMLTextAreaElement>): any;
11
+ export declare function Select({ className, ...props }: React.SelectHTMLAttributes<HTMLSelectElement>): any;
12
+ export declare function Checkbox({ className, ...props }: React.InputHTMLAttributes<HTMLInputElement>): any;
13
+ export declare function Switch({ className, ...props }: React.InputHTMLAttributes<HTMLInputElement>): any;
14
+ export declare function RadioGroup({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
15
+ export declare function Radio({ className, ...props }: React.InputHTMLAttributes<HTMLInputElement>): any;
@@ -0,0 +1,67 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Field({ className, ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ className: cn('grid gap-2', className),
7
+ });
8
+ }
9
+ export function Label({ className, ...props }) {
10
+ return createElement('label', {
11
+ ...props,
12
+ className: cn('text-body-3 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70', className),
13
+ });
14
+ }
15
+ export function Input({ className, ...props }) {
16
+ return createElement('input', {
17
+ ...props,
18
+ className: cn('flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-body-3 shadow-sm transition-colors file:border-0 file:bg-transparent file:text-body-3 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className),
19
+ });
20
+ }
21
+ export function DatePicker({ className, ...props }) {
22
+ return createElement(Input, {
23
+ ...props,
24
+ type: 'date',
25
+ className,
26
+ });
27
+ }
28
+ export function Textarea({ className, ...props }) {
29
+ return createElement('textarea', {
30
+ ...props,
31
+ className: cn('flex min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-body-3 shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className),
32
+ });
33
+ }
34
+ export function Select({ className, ...props }) {
35
+ return createElement('select', {
36
+ ...props,
37
+ className: cn('flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-body-3 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className),
38
+ });
39
+ }
40
+ export function Checkbox({ className, ...props }) {
41
+ return createElement('input', {
42
+ ...props,
43
+ type: 'checkbox',
44
+ className: cn('h-4 w-4 shrink-0 rounded-sm border border-input bg-background text-primary shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className),
45
+ });
46
+ }
47
+ export function Switch({ className, ...props }) {
48
+ return createElement('input', {
49
+ ...props,
50
+ type: 'checkbox',
51
+ className: cn('h-5 w-9 shrink-0 appearance-none rounded-full border border-input bg-input shadow-sm transition-colors checked:bg-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 before:block before:h-4 before:w-4 before:translate-x-0 before:rounded-full before:bg-background before:shadow before:transition-transform checked:before:translate-x-4', className),
52
+ });
53
+ }
54
+ export function RadioGroup({ className, ...props }) {
55
+ return createElement('div', {
56
+ ...props,
57
+ role: props.role ?? 'radiogroup',
58
+ className: cn('grid gap-2', className),
59
+ });
60
+ }
61
+ export function Radio({ className, ...props }) {
62
+ return createElement('input', {
63
+ ...props,
64
+ type: 'radio',
65
+ className: cn('h-4 w-4 shrink-0 rounded-full border border-input bg-background text-primary shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50', className),
66
+ });
67
+ }
@@ -0,0 +1,11 @@
1
+ import type React from 'react';
2
+ import { type PmIconKey } from '@pallamart/pm-icons';
3
+ type IconButtonVariant = 'default' | 'destructive' | 'ghost' | 'outline' | 'secondary';
4
+ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
+ iconKey: PmIconKey | string;
6
+ iconLabel: string;
7
+ iconSize?: number | string;
8
+ variant?: IconButtonVariant;
9
+ }
10
+ export declare function IconButton({ className, iconKey, iconLabel, iconSize, title, type, variant, ...props }: IconButtonProps): any;
11
+ export {};
@@ -0,0 +1,18 @@
1
+ import { PmIcon } from '@pallamart/pm-icons';
2
+ import { createElement } from '../create-element.js';
3
+ import { cn } from '../utils/cn.js';
4
+ import { buttonVariants } from './button.js';
5
+ const IconComponent = PmIcon;
6
+ export function IconButton({ className, iconKey, iconLabel, iconSize = 16, title, type = 'button', variant = 'ghost', ...props }) {
7
+ return createElement('button', {
8
+ ...props,
9
+ 'aria-label': iconLabel,
10
+ className: cn(buttonVariants({ size: 'icon', variant }), className),
11
+ title: title ?? iconLabel,
12
+ type,
13
+ }, createElement(IconComponent, {
14
+ 'aria-hidden': true,
15
+ iconKey,
16
+ size: iconSize,
17
+ }));
18
+ }
@@ -0,0 +1,10 @@
1
+ import type React from 'react';
2
+ export declare function AspectRatio({ className, ratio, ...props }: React.HTMLAttributes<HTMLDivElement> & {
3
+ ratio?: number;
4
+ }): any;
5
+ export declare function ButtonGroup({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
6
+ export declare function StatusPanel({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
7
+ export declare function Kbd({ className, ...props }: React.HTMLAttributes<HTMLElement>): any;
8
+ export declare function Pagination({ className, ...props }: React.HTMLAttributes<HTMLElement>): any;
9
+ export declare function PaginationContent({ className, ...props }: React.HTMLAttributes<HTMLUListElement>): any;
10
+ export declare function PaginationItem({ className, ...props }: React.HTMLAttributes<HTMLLIElement>): any;