@opensite/ui 0.0.1

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 (75) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +315 -0
  3. package/dist/animated-dialog.cjs +168 -0
  4. package/dist/animated-dialog.cjs.map +1 -0
  5. package/dist/animated-dialog.d.cts +24 -0
  6. package/dist/animated-dialog.d.ts +24 -0
  7. package/dist/animated-dialog.js +166 -0
  8. package/dist/animated-dialog.js.map +1 -0
  9. package/dist/badge.cjs +49 -0
  10. package/dist/badge.cjs.map +1 -0
  11. package/dist/badge.d.cts +13 -0
  12. package/dist/badge.d.ts +13 -0
  13. package/dist/badge.js +46 -0
  14. package/dist/badge.js.map +1 -0
  15. package/dist/button.cjs +63 -0
  16. package/dist/button.cjs.map +1 -0
  17. package/dist/button.d.cts +14 -0
  18. package/dist/button.d.ts +14 -0
  19. package/dist/button.js +60 -0
  20. package/dist/button.js.map +1 -0
  21. package/dist/card.cjs +99 -0
  22. package/dist/card.cjs.map +1 -0
  23. package/dist/card.d.cts +12 -0
  24. package/dist/card.d.ts +12 -0
  25. package/dist/card.js +91 -0
  26. package/dist/card.js.map +1 -0
  27. package/dist/components.cjs +533 -0
  28. package/dist/components.cjs.map +1 -0
  29. package/dist/components.d.cts +14 -0
  30. package/dist/components.d.ts +14 -0
  31. package/dist/components.js +494 -0
  32. package/dist/components.js.map +1 -0
  33. package/dist/container.cjs +47 -0
  34. package/dist/container.cjs.map +1 -0
  35. package/dist/container.d.cts +16 -0
  36. package/dist/container.d.ts +16 -0
  37. package/dist/container.js +41 -0
  38. package/dist/container.js.map +1 -0
  39. package/dist/index.cjs +534 -0
  40. package/dist/index.cjs.map +1 -0
  41. package/dist/index.d.cts +16 -0
  42. package/dist/index.d.ts +16 -0
  43. package/dist/index.js +494 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/page-hero-banner.cjs +119 -0
  46. package/dist/page-hero-banner.cjs.map +1 -0
  47. package/dist/page-hero-banner.d.cts +22 -0
  48. package/dist/page-hero-banner.d.ts +22 -0
  49. package/dist/page-hero-banner.js +113 -0
  50. package/dist/page-hero-banner.js.map +1 -0
  51. package/dist/popover.cjs +73 -0
  52. package/dist/popover.cjs.map +1 -0
  53. package/dist/popover.d.cts +10 -0
  54. package/dist/popover.d.ts +10 -0
  55. package/dist/popover.js +48 -0
  56. package/dist/popover.js.map +1 -0
  57. package/dist/section.cjs +96 -0
  58. package/dist/section.cjs.map +1 -0
  59. package/dist/section.d.cts +21 -0
  60. package/dist/section.d.ts +21 -0
  61. package/dist/section.js +90 -0
  62. package/dist/section.js.map +1 -0
  63. package/dist/types.cjs +4 -0
  64. package/dist/types.cjs.map +1 -0
  65. package/dist/types.d.cts +180 -0
  66. package/dist/types.d.ts +180 -0
  67. package/dist/types.js +3 -0
  68. package/dist/types.js.map +1 -0
  69. package/dist/utils.cjs +13 -0
  70. package/dist/utils.cjs.map +1 -0
  71. package/dist/utils.d.cts +5 -0
  72. package/dist/utils.d.ts +5 -0
  73. package/dist/utils.js +11 -0
  74. package/dist/utils.js.map +1 -0
  75. package/package.json +152 -0
@@ -0,0 +1,180 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+
3
+ /**
4
+ * Max width variants for Container component
5
+ */
6
+ type ContainerMaxWidth = "sm" | "md" | "lg" | "xl" | "2xl" | "4xl" | "full";
7
+ /**
8
+ * Background variants for Section component
9
+ */
10
+ type SectionBackground = "white" | "gray" | "dark" | "gradient" | "primary" | "secondary" | "muted";
11
+ /**
12
+ * Spacing variants for Section component
13
+ */
14
+ type SectionSpacing = "sm" | "md" | "lg" | "xl";
15
+ /**
16
+ * Size variants for AnimatedDialog component
17
+ */
18
+ type AnimatedDialogSize = "sm" | "md" | "lg" | "xl" | "full";
19
+ /**
20
+ * Props for Container component
21
+ */
22
+ interface ContainerProps extends HTMLAttributes<HTMLElement> {
23
+ /**
24
+ * The content to be rendered inside the container
25
+ */
26
+ children: ReactNode;
27
+ /**
28
+ * Maximum width of the container
29
+ * @default "xl"
30
+ */
31
+ maxWidth?: ContainerMaxWidth;
32
+ /**
33
+ * HTML element type to render
34
+ * @default "div"
35
+ */
36
+ as?: keyof JSX.IntrinsicElements;
37
+ /**
38
+ * Additional CSS classes
39
+ */
40
+ className?: string;
41
+ }
42
+ /**
43
+ * Props for Section component
44
+ */
45
+ interface SectionProps extends HTMLAttributes<HTMLElement> {
46
+ /**
47
+ * Section ID for anchor links
48
+ */
49
+ id?: string;
50
+ /**
51
+ * Section title (renders as h2)
52
+ */
53
+ title?: string;
54
+ /**
55
+ * Section subtitle/eyebrow (renders above title)
56
+ */
57
+ subtitle?: string;
58
+ /**
59
+ * The content to be rendered inside the section
60
+ */
61
+ children: ReactNode;
62
+ /**
63
+ * Background style variant
64
+ * @default "white"
65
+ */
66
+ background?: SectionBackground;
67
+ /**
68
+ * Vertical spacing variant
69
+ * @default "lg"
70
+ */
71
+ spacing?: SectionSpacing;
72
+ /**
73
+ * Additional CSS classes
74
+ */
75
+ className?: string;
76
+ }
77
+ /**
78
+ * Props for AnimatedDialog component
79
+ */
80
+ interface AnimatedDialogProps {
81
+ /**
82
+ * Whether the dialog is open
83
+ */
84
+ open: boolean;
85
+ /**
86
+ * Callback when the dialog open state changes
87
+ */
88
+ onOpenChange: (open: boolean) => void;
89
+ /**
90
+ * Dialog title
91
+ */
92
+ title?: string;
93
+ /**
94
+ * Eyebrow text above title
95
+ */
96
+ eyebrow?: string;
97
+ /**
98
+ * Dialog description
99
+ */
100
+ description?: string;
101
+ /**
102
+ * Dialog content
103
+ */
104
+ children?: ReactNode;
105
+ /**
106
+ * Custom header content (overrides title/eyebrow/description)
107
+ */
108
+ header?: ReactNode;
109
+ /**
110
+ * Footer content
111
+ */
112
+ footer?: ReactNode;
113
+ /**
114
+ * Dialog size variant
115
+ * @default "lg"
116
+ */
117
+ size?: AnimatedDialogSize;
118
+ /**
119
+ * Additional CSS classes for the dialog container
120
+ */
121
+ className?: string;
122
+ /**
123
+ * Additional CSS classes for the content area
124
+ */
125
+ contentClassName?: string;
126
+ }
127
+ /**
128
+ * Props for PageHeroBanner component
129
+ */
130
+ interface PageHeroBannerProps extends HTMLAttributes<HTMLDivElement> {
131
+ /**
132
+ * Image URL or Media ID to display as background
133
+ * Either imageUrl or videoUrl must be provided
134
+ */
135
+ imageUrl?: string;
136
+ /**
137
+ * Video URL or Media ID to display as background
138
+ * Either imageUrl or videoUrl must be provided
139
+ */
140
+ videoUrl?: string;
141
+ /**
142
+ * Alt text for the image (not used for video)
143
+ */
144
+ alt?: string;
145
+ /**
146
+ * Content to display on top of the banner
147
+ */
148
+ children: ReactNode;
149
+ /**
150
+ * Custom className for the banner container
151
+ */
152
+ className?: string;
153
+ /**
154
+ * Whether to use eager loading for the image
155
+ * @default true for hero banners
156
+ */
157
+ loading?: "eager" | "lazy";
158
+ /**
159
+ * Minimum height of the banner
160
+ * @default "500px"
161
+ */
162
+ minHeight?: string;
163
+ /**
164
+ * Whether to show the gradient overlay
165
+ * @default true
166
+ */
167
+ showOverlay?: boolean;
168
+ /**
169
+ * Gradient overlay opacity
170
+ * @default 0.6
171
+ */
172
+ overlayOpacity?: number;
173
+ /**
174
+ * Maximum width of content area
175
+ * @default "4xl"
176
+ */
177
+ contentMaxWidth?: ContainerMaxWidth;
178
+ }
179
+
180
+ export type { AnimatedDialogProps, AnimatedDialogSize, ContainerMaxWidth, ContainerProps, PageHeroBannerProps, SectionBackground, SectionProps, SectionSpacing };
@@ -0,0 +1,180 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+
3
+ /**
4
+ * Max width variants for Container component
5
+ */
6
+ type ContainerMaxWidth = "sm" | "md" | "lg" | "xl" | "2xl" | "4xl" | "full";
7
+ /**
8
+ * Background variants for Section component
9
+ */
10
+ type SectionBackground = "white" | "gray" | "dark" | "gradient" | "primary" | "secondary" | "muted";
11
+ /**
12
+ * Spacing variants for Section component
13
+ */
14
+ type SectionSpacing = "sm" | "md" | "lg" | "xl";
15
+ /**
16
+ * Size variants for AnimatedDialog component
17
+ */
18
+ type AnimatedDialogSize = "sm" | "md" | "lg" | "xl" | "full";
19
+ /**
20
+ * Props for Container component
21
+ */
22
+ interface ContainerProps extends HTMLAttributes<HTMLElement> {
23
+ /**
24
+ * The content to be rendered inside the container
25
+ */
26
+ children: ReactNode;
27
+ /**
28
+ * Maximum width of the container
29
+ * @default "xl"
30
+ */
31
+ maxWidth?: ContainerMaxWidth;
32
+ /**
33
+ * HTML element type to render
34
+ * @default "div"
35
+ */
36
+ as?: keyof JSX.IntrinsicElements;
37
+ /**
38
+ * Additional CSS classes
39
+ */
40
+ className?: string;
41
+ }
42
+ /**
43
+ * Props for Section component
44
+ */
45
+ interface SectionProps extends HTMLAttributes<HTMLElement> {
46
+ /**
47
+ * Section ID for anchor links
48
+ */
49
+ id?: string;
50
+ /**
51
+ * Section title (renders as h2)
52
+ */
53
+ title?: string;
54
+ /**
55
+ * Section subtitle/eyebrow (renders above title)
56
+ */
57
+ subtitle?: string;
58
+ /**
59
+ * The content to be rendered inside the section
60
+ */
61
+ children: ReactNode;
62
+ /**
63
+ * Background style variant
64
+ * @default "white"
65
+ */
66
+ background?: SectionBackground;
67
+ /**
68
+ * Vertical spacing variant
69
+ * @default "lg"
70
+ */
71
+ spacing?: SectionSpacing;
72
+ /**
73
+ * Additional CSS classes
74
+ */
75
+ className?: string;
76
+ }
77
+ /**
78
+ * Props for AnimatedDialog component
79
+ */
80
+ interface AnimatedDialogProps {
81
+ /**
82
+ * Whether the dialog is open
83
+ */
84
+ open: boolean;
85
+ /**
86
+ * Callback when the dialog open state changes
87
+ */
88
+ onOpenChange: (open: boolean) => void;
89
+ /**
90
+ * Dialog title
91
+ */
92
+ title?: string;
93
+ /**
94
+ * Eyebrow text above title
95
+ */
96
+ eyebrow?: string;
97
+ /**
98
+ * Dialog description
99
+ */
100
+ description?: string;
101
+ /**
102
+ * Dialog content
103
+ */
104
+ children?: ReactNode;
105
+ /**
106
+ * Custom header content (overrides title/eyebrow/description)
107
+ */
108
+ header?: ReactNode;
109
+ /**
110
+ * Footer content
111
+ */
112
+ footer?: ReactNode;
113
+ /**
114
+ * Dialog size variant
115
+ * @default "lg"
116
+ */
117
+ size?: AnimatedDialogSize;
118
+ /**
119
+ * Additional CSS classes for the dialog container
120
+ */
121
+ className?: string;
122
+ /**
123
+ * Additional CSS classes for the content area
124
+ */
125
+ contentClassName?: string;
126
+ }
127
+ /**
128
+ * Props for PageHeroBanner component
129
+ */
130
+ interface PageHeroBannerProps extends HTMLAttributes<HTMLDivElement> {
131
+ /**
132
+ * Image URL or Media ID to display as background
133
+ * Either imageUrl or videoUrl must be provided
134
+ */
135
+ imageUrl?: string;
136
+ /**
137
+ * Video URL or Media ID to display as background
138
+ * Either imageUrl or videoUrl must be provided
139
+ */
140
+ videoUrl?: string;
141
+ /**
142
+ * Alt text for the image (not used for video)
143
+ */
144
+ alt?: string;
145
+ /**
146
+ * Content to display on top of the banner
147
+ */
148
+ children: ReactNode;
149
+ /**
150
+ * Custom className for the banner container
151
+ */
152
+ className?: string;
153
+ /**
154
+ * Whether to use eager loading for the image
155
+ * @default true for hero banners
156
+ */
157
+ loading?: "eager" | "lazy";
158
+ /**
159
+ * Minimum height of the banner
160
+ * @default "500px"
161
+ */
162
+ minHeight?: string;
163
+ /**
164
+ * Whether to show the gradient overlay
165
+ * @default true
166
+ */
167
+ showOverlay?: boolean;
168
+ /**
169
+ * Gradient overlay opacity
170
+ * @default 0.6
171
+ */
172
+ overlayOpacity?: number;
173
+ /**
174
+ * Maximum width of content area
175
+ * @default "4xl"
176
+ */
177
+ contentMaxWidth?: ContainerMaxWidth;
178
+ }
179
+
180
+ export type { AnimatedDialogProps, AnimatedDialogSize, ContainerMaxWidth, ContainerProps, PageHeroBannerProps, SectionBackground, SectionProps, SectionSpacing };
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=types.js.map
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
package/dist/utils.cjs ADDED
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var clsx = require('clsx');
4
+ var tailwindMerge = require('tailwind-merge');
5
+
6
+ // lib/utils.ts
7
+ function cn(...inputs) {
8
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
9
+ }
10
+
11
+ exports.cn = cn;
12
+ //# sourceMappingURL=utils.cjs.map
13
+ //# sourceMappingURL=utils.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts"],"names":["twMerge","clsx"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"utils.cjs","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+
5
+ export { cn };
@@ -0,0 +1,5 @@
1
+ import { ClassValue } from 'clsx';
2
+
3
+ declare function cn(...inputs: ClassValue[]): string;
4
+
5
+ export { cn };
package/dist/utils.js ADDED
@@ -0,0 +1,11 @@
1
+ import { clsx } from 'clsx';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ // lib/utils.ts
5
+ function cn(...inputs) {
6
+ return twMerge(clsx(inputs));
7
+ }
8
+
9
+ export { cn };
10
+ //# sourceMappingURL=utils.js.map
11
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts"],"names":[],"mappings":";;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B","file":"utils.js","sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,152 @@
1
+ {
2
+ "name": "@opensite/ui",
3
+ "version": "0.0.1",
4
+ "description": "Foundational UI component library for OpenSite Semantic Site Builder with tree-shakable exports and abstract styling",
5
+ "keywords": [
6
+ "react",
7
+ "performance",
8
+ "pagespeed",
9
+ "tree-shakeable",
10
+ "ui",
11
+ "shadcn",
12
+ "tailwind"
13
+ ],
14
+ "homepage": "https://github.com/opensite-ai/opensite-ui#readme",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/opensite-ai/opensite-ui.git"
18
+ },
19
+ "bugs": {
20
+ "url": "https://github.com/opensite-ai/opensite-ui/issues"
21
+ },
22
+ "author": "OpenSite AI (https://opensite.ai)",
23
+ "license": "MIT",
24
+ "type": "module",
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "require": "./dist/index.cjs"
33
+ },
34
+ "./components": {
35
+ "types": "./dist/components.d.ts",
36
+ "import": "./dist/components.js",
37
+ "require": "./dist/components.cjs"
38
+ },
39
+ "./components/container": {
40
+ "types": "./dist/container.d.ts",
41
+ "import": "./dist/container.js",
42
+ "require": "./dist/container.cjs"
43
+ },
44
+ "./components/section": {
45
+ "types": "./dist/section.d.ts",
46
+ "import": "./dist/section.js",
47
+ "require": "./dist/section.cjs"
48
+ },
49
+ "./components/animated-dialog": {
50
+ "types": "./dist/animated-dialog.d.ts",
51
+ "import": "./dist/animated-dialog.js",
52
+ "require": "./dist/animated-dialog.cjs"
53
+ },
54
+ "./components/page-hero-banner": {
55
+ "types": "./dist/page-hero-banner.d.ts",
56
+ "import": "./dist/page-hero-banner.js",
57
+ "require": "./dist/page-hero-banner.cjs"
58
+ },
59
+ "./components/button": {
60
+ "types": "./dist/button.d.ts",
61
+ "import": "./dist/button.js",
62
+ "require": "./dist/button.cjs"
63
+ },
64
+ "./components/card": {
65
+ "types": "./dist/card.d.ts",
66
+ "import": "./dist/card.js",
67
+ "require": "./dist/card.cjs"
68
+ },
69
+ "./components/badge": {
70
+ "types": "./dist/badge.d.ts",
71
+ "import": "./dist/badge.js",
72
+ "require": "./dist/badge.cjs"
73
+ },
74
+ "./components/popover": {
75
+ "types": "./dist/popover.d.ts",
76
+ "import": "./dist/popover.js",
77
+ "require": "./dist/popover.cjs"
78
+ },
79
+ "./utils": {
80
+ "types": "./dist/utils.d.ts",
81
+ "import": "./dist/utils.js",
82
+ "require": "./dist/utils.cjs"
83
+ },
84
+ "./types": {
85
+ "types": "./dist/types.d.ts",
86
+ "import": "./dist/types.js",
87
+ "require": "./dist/types.cjs"
88
+ }
89
+ },
90
+ "files": [
91
+ "dist",
92
+ "README.md",
93
+ "LICENSE"
94
+ ],
95
+ "publishConfig": {
96
+ "access": "public"
97
+ },
98
+ "sideEffects": false,
99
+ "scripts": {
100
+ "build": "tsup",
101
+ "dev": "tsup --watch",
102
+ "test": "vitest",
103
+ "test:ci": "./scripts/test-ci-silent.sh",
104
+ "type-check": "tsc --noEmit",
105
+ "size": "bash -c 'size-limit --silent 2>/dev/null'",
106
+ "prepublishOnly": "pnpm run build && pnpm run test:ci"
107
+ },
108
+ "peerDependencies": {
109
+ "react": ">=16.8.0",
110
+ "react-dom": ">=16.8.0"
111
+ },
112
+ "devDependencies": {
113
+ "@size-limit/preset-small-lib": "^11.2.0",
114
+ "@testing-library/jest-dom": "^6.9.1",
115
+ "@testing-library/react": "^16.3.0",
116
+ "@testing-library/user-event": "^14.6.1",
117
+ "@types/node": "^24.10.0",
118
+ "@types/react": "^18.3.12",
119
+ "@types/react-dom": "^18.3.1",
120
+ "@vitejs/plugin-react": "^5.1.1",
121
+ "@vitest/coverage-v8": "^4.0.10",
122
+ "@vitest/ui": "^4.0.10",
123
+ "happy-dom": "^20.0.10",
124
+ "jsdom": "^27.2.0",
125
+ "react": "^18.3.1",
126
+ "react-dom": "^18.3.1",
127
+ "size-limit": "^11.1.6",
128
+ "tsup": "^8.3.5",
129
+ "typescript": "^5.7.2",
130
+ "vitest": "^4.0.10"
131
+ },
132
+ "dependencies": {
133
+ "@opensite/hooks": "^0.1.1",
134
+ "@radix-ui/react-popover": "^1.1.15",
135
+ "@radix-ui/react-slot": "^1.2.4",
136
+ "class-variance-authority": "^0.7.1",
137
+ "clsx": "^2.1.1",
138
+ "framer-motion": "^12.2.0",
139
+ "lucide-react": "^0.562.0",
140
+ "tailwind-merge": "^3.4.0",
141
+ "tw-animate-css": "^1.4.0"
142
+ },
143
+ "optionalDependencies": {
144
+ "@legendapp/state": "^3.0.0-beta.42",
145
+ "valibot": "^1.2.0"
146
+ },
147
+ "packageManager": "pnpm@9.14.4",
148
+ "engines": {
149
+ "node": ">=18.0.0",
150
+ "pnpm": ">=9.0.0"
151
+ }
152
+ }