@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,46 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function AspectRatio({ className, ratio = 1, ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ className: cn('relative w-full overflow-hidden', className),
7
+ style: { ...props.style, aspectRatio: String(ratio) },
8
+ });
9
+ }
10
+ export function ButtonGroup({ className, ...props }) {
11
+ return createElement('div', {
12
+ ...props,
13
+ className: cn('inline-flex items-center rounded-md shadow-sm [&>*:first-child]:rounded-r-none [&>*:last-child]:rounded-l-none [&>*:not(:first-child):not(:last-child)]:rounded-none', className),
14
+ });
15
+ }
16
+ export function StatusPanel({ className, ...props }) {
17
+ return createElement('div', {
18
+ ...props,
19
+ className: cn('flex flex-col gap-4 rounded-lg border border-border bg-muted/30 p-4 lg:flex-row lg:items-center lg:justify-between', className),
20
+ });
21
+ }
22
+ export function Kbd({ className, ...props }) {
23
+ return createElement('kbd', {
24
+ ...props,
25
+ className: cn('pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-body-4 text-muted-foreground', className),
26
+ });
27
+ }
28
+ export function Pagination({ className, ...props }) {
29
+ return createElement('nav', {
30
+ ...props,
31
+ 'aria-label': props['aria-label'] ?? 'Pagination',
32
+ className: cn('mx-auto flex w-full justify-center', className),
33
+ });
34
+ }
35
+ export function PaginationContent({ className, ...props }) {
36
+ return createElement('ul', {
37
+ ...props,
38
+ className: cn('flex flex-row items-center gap-1', className),
39
+ });
40
+ }
41
+ export function PaginationItem({ className, ...props }) {
42
+ return createElement('li', {
43
+ ...props,
44
+ className: cn('', className),
45
+ });
46
+ }
@@ -0,0 +1,6 @@
1
+ import type React from 'react';
2
+ export declare function Popover({ className, ...props }: React.HTMLAttributes<HTMLDetailsElement>): any;
3
+ export declare function PopoverTrigger({ className, ...props }: React.HTMLAttributes<HTMLElement>): any;
4
+ export declare function PopoverContent({ align, className, ...props }: React.HTMLAttributes<HTMLDivElement> & {
5
+ align?: 'end' | 'start';
6
+ }): any;
@@ -0,0 +1,20 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Popover({ className, ...props }) {
4
+ return createElement('details', {
5
+ ...props,
6
+ className: cn('group relative inline-block text-left', className),
7
+ });
8
+ }
9
+ export function PopoverTrigger({ className, ...props }) {
10
+ return createElement('summary', {
11
+ ...props,
12
+ className: cn('flex cursor-pointer list-none items-center [&::-webkit-details-marker]:hidden', className),
13
+ });
14
+ }
15
+ export function PopoverContent({ align = 'end', className, ...props }) {
16
+ return createElement('div', {
17
+ ...props,
18
+ className: cn('absolute z-50 mt-2 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-lg', align === 'end' ? 'right-0' : 'left-0', className),
19
+ });
20
+ }
@@ -0,0 +1,4 @@
1
+ import type React from 'react';
2
+ export declare function Progress({ className, value, ...props }: React.HTMLAttributes<HTMLDivElement> & {
3
+ value?: number;
4
+ }): any;
@@ -0,0 +1,16 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Progress({ className, value = 0, ...props }) {
4
+ const normalizedValue = Math.max(0, Math.min(100, value));
5
+ return createElement('div', {
6
+ ...props,
7
+ 'aria-valuemax': 100,
8
+ 'aria-valuemin': 0,
9
+ 'aria-valuenow': normalizedValue,
10
+ role: 'progressbar',
11
+ className: cn('relative h-2 w-full overflow-hidden rounded-full bg-secondary', className),
12
+ }, createElement('div', {
13
+ className: 'h-full w-full flex-1 bg-primary transition-all',
14
+ style: { transform: `translateX(-${100 - normalizedValue}%)` },
15
+ }));
16
+ }
@@ -0,0 +1,4 @@
1
+ import type React from 'react';
2
+ export declare function Separator({ className, orientation, ...props }: React.HTMLAttributes<HTMLDivElement> & {
3
+ orientation?: 'horizontal' | 'vertical';
4
+ }): any;
@@ -0,0 +1,10 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Separator({ className, orientation = 'horizontal', ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ 'aria-orientation': orientation,
7
+ role: props.role ?? 'separator',
8
+ className: cn('shrink-0 bg-border', orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px', className),
9
+ });
10
+ }
@@ -0,0 +1,2 @@
1
+ import type React from 'react';
2
+ export declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
@@ -0,0 +1,8 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Skeleton({ className, ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ className: cn('animate-pulse rounded-md bg-muted', className),
7
+ });
8
+ }
@@ -0,0 +1,2 @@
1
+ import type React from 'react';
2
+ export declare function Spinner({ className, ...props }: React.SVGProps<SVGSVGElement>): any;
@@ -0,0 +1,26 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Spinner({ className, ...props }) {
4
+ const svgProps = props;
5
+ return createElement('svg', {
6
+ ...svgProps,
7
+ 'aria-label': props['aria-label'] ?? 'Loading',
8
+ className: cn('h-4 w-4 animate-spin', className),
9
+ fill: 'none',
10
+ role: 'status',
11
+ viewBox: '0 0 24 24',
12
+ }, createElement('circle', {
13
+ className: 'opacity-25',
14
+ cx: 12,
15
+ cy: 12,
16
+ r: 10,
17
+ stroke: 'currentColor',
18
+ strokeWidth: 4,
19
+ }), createElement('path', {
20
+ className: 'opacity-75',
21
+ d: 'M4 12a8 8 0 0 1 8-8',
22
+ stroke: 'currentColor',
23
+ strokeLinecap: 'round',
24
+ strokeWidth: 4,
25
+ }));
26
+ }
@@ -0,0 +1,7 @@
1
+ import type React from 'react';
2
+ export declare function Table({ className, ...props }: React.TableHTMLAttributes<HTMLTableElement>): any;
3
+ export declare function TableHeader({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): any;
4
+ export declare function TableBody({ className, ...props }: React.HTMLAttributes<HTMLTableSectionElement>): any;
5
+ export declare function TableRow({ className, ...props }: React.HTMLAttributes<HTMLTableRowElement>): any;
6
+ export declare function TableHead({ className, ...props }: React.ThHTMLAttributes<HTMLTableCellElement>): any;
7
+ export declare function TableCell({ className, ...props }: React.TdHTMLAttributes<HTMLTableCellElement>): any;
@@ -0,0 +1,41 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function Table({ className, ...props }) {
4
+ return createElement('div', {
5
+ className: 'w-full overflow-auto',
6
+ children: createElement('table', {
7
+ ...props,
8
+ className: cn('w-full caption-bottom text-body-3', className),
9
+ }),
10
+ });
11
+ }
12
+ export function TableHeader({ className, ...props }) {
13
+ return createElement('thead', {
14
+ ...props,
15
+ className: cn('[&_tr]:border-b', className),
16
+ });
17
+ }
18
+ export function TableBody({ className, ...props }) {
19
+ return createElement('tbody', {
20
+ ...props,
21
+ className: cn('[&_tr:last-child]:border-0', className),
22
+ });
23
+ }
24
+ export function TableRow({ className, ...props }) {
25
+ return createElement('tr', {
26
+ ...props,
27
+ className: cn('border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted', className),
28
+ });
29
+ }
30
+ export function TableHead({ className, ...props }) {
31
+ return createElement('th', {
32
+ ...props,
33
+ className: cn('h-10 px-3 text-left align-middle text-muted-foreground', className),
34
+ });
35
+ }
36
+ export function TableCell({ className, ...props }) {
37
+ return createElement('td', {
38
+ ...props,
39
+ className: cn('px-3 py-3 align-middle', className),
40
+ });
41
+ }
@@ -0,0 +1,6 @@
1
+ import type React from 'react';
2
+ export declare function TabsList({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): any;
3
+ export declare function TabsTrigger({ as, className, active, ...props }: React.HTMLAttributes<HTMLElement> & {
4
+ active?: boolean;
5
+ as?: any;
6
+ }): any;
@@ -0,0 +1,17 @@
1
+ import { createElement } from '../create-element.js';
2
+ import { cn } from '../utils/cn.js';
3
+ export function TabsList({ className, ...props }) {
4
+ return createElement('div', {
5
+ ...props,
6
+ className: cn('inline-flex h-9 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground', className),
7
+ });
8
+ }
9
+ export function TabsTrigger({ as, className, active, ...props }) {
10
+ return createElement(as ?? 'span', {
11
+ ...props,
12
+ type: as === 'button' ? props.type ?? 'button' : undefined,
13
+ className: cn('inline-flex h-7 items-center justify-center whitespace-nowrap rounded-sm px-3 text-body-3 leading-none transition-all', active
14
+ ? 'bg-background text-foreground shadow-sm'
15
+ : 'text-muted-foreground hover:text-foreground', className),
16
+ });
17
+ }
@@ -0,0 +1,4 @@
1
+ import type React from 'react';
2
+ export declare function Tooltip({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): any;
3
+ export declare function TooltipTrigger({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): any;
4
+ export declare function TooltipContent({ 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 Tooltip({ className, ...props }) {
4
+ return createElement('span', {
5
+ ...props,
6
+ className: cn('group relative inline-flex', className),
7
+ });
8
+ }
9
+ export function TooltipTrigger({ className, ...props }) {
10
+ return createElement('span', {
11
+ ...props,
12
+ className: cn('inline-flex', className),
13
+ });
14
+ }
15
+ export function TooltipContent({ className, ...props }) {
16
+ return createElement('span', {
17
+ ...props,
18
+ className: cn('pointer-events-none absolute bottom-full left-1/2 z-50 mb-2 hidden -translate-x-1/2 whitespace-nowrap rounded-md bg-primary px-2 py-1 text-xs text-primary-foreground shadow group-hover:block', className),
19
+ });
20
+ }
@@ -0,0 +1 @@
1
+ export declare function cn(...values: Array<false | null | string | undefined>): string;
@@ -0,0 +1,3 @@
1
+ export function cn(...values) {
2
+ return values.filter(Boolean).join(' ');
3
+ }
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@pallamart/pm-core-components",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./external": {
15
+ "types": "./dist/external/index.d.ts",
16
+ "import": "./dist/external/index.js",
17
+ "default": "./dist/external/index.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "/dist"
22
+ ],
23
+ "scripts": {
24
+ "husky:prepare": "npx husky",
25
+ "build": "tsc",
26
+ "setup:graphify": "sh scripts/graphify-setup.sh",
27
+ "update:graphify": "sh scripts/graphify-update.sh",
28
+ "lint": "npm run lint:eslint",
29
+ "lint:fix": "npm run lint:eslint:fix",
30
+ "format:check": "npx prettier --check --ignore-unknown \"src/**/*.{ts,tsx,json,md}\"",
31
+ "format:prettier": "npx prettier --write \"src/**/*.{ts,tsx,json,md}\"",
32
+ "lint:eslint": "npx eslint \"src/**/*.{ts,tsx}\"",
33
+ "lint:eslint:fix": "npx eslint --fix \"src/**/*.{ts,tsx}\"",
34
+ "release": "semantic-release"
35
+ },
36
+ "dependencies": {
37
+ "@pallamart/pm-icons": "1.0.0",
38
+ "@pallamart/pm-utilities": "1.0.1"
39
+ },
40
+ "peerDependencies": {
41
+ "@pallamart/pm-design-system": "1.0.1",
42
+ "react": "^18 || ^19"
43
+ },
44
+ "devDependencies": {
45
+ "@commitlint/cli": "^20.1.0",
46
+ "@commitlint/config-conventional": "^20.0.0",
47
+ "@eslint/compat": "^2.0.0",
48
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
49
+ "@semantic-release/changelog": "^6.0.3",
50
+ "@semantic-release/commit-analyzer": "^13.0.0",
51
+ "@semantic-release/git": "^10.0.1",
52
+ "@semantic-release/github": "^11.0.1",
53
+ "@semantic-release/npm": "^12.0.0",
54
+ "@semantic-release/release-notes-generator": "^14.0.1",
55
+ "@types/react": "^18.3.28",
56
+ "@typescript-eslint/eslint-plugin": "^8.48.0",
57
+ "@typescript-eslint/parser": "^8.48.0",
58
+ "commitlint": "^20.1.0",
59
+ "conventional-changelog-conventionalcommits": "^7.0.2",
60
+ "eslint": "^9.39.1",
61
+ "eslint-config-prettier": "^10.1.8",
62
+ "eslint-plugin-import": "^2.32.0",
63
+ "eslint-plugin-prettier": "^5.5.4",
64
+ "husky": "^9.1.7",
65
+ "lint-staged": "^16.2.7",
66
+ "prettier": "^3.6.2",
67
+ "react": "^18.3.1",
68
+ "semantic-release": "^24.2.0",
69
+ "ts-node": "^10.9.2",
70
+ "typescript": "^5.9.3"
71
+ },
72
+ "publishConfig": {
73
+ "access": "public",
74
+ "registry": "https://registry.npmjs.org/"
75
+ },
76
+ "repository": {
77
+ "type": "git",
78
+ "url": "git+https://github.com/pallamart/pm-core-components.git"
79
+ }
80
+ }