@opensite/ui 0.0.1 → 0.0.3
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/README.md +117 -2
- package/dist/alternating-blocks.cjs +138 -0
- package/dist/alternating-blocks.cjs.map +1 -0
- package/dist/alternating-blocks.d.cts +65 -0
- package/dist/alternating-blocks.d.ts +65 -0
- package/dist/alternating-blocks.js +132 -0
- package/dist/alternating-blocks.js.map +1 -0
- package/dist/animated-dialog.cjs +6 -6
- package/dist/animated-dialog.cjs.map +1 -1
- package/dist/animated-dialog.js +6 -6
- package/dist/animated-dialog.js.map +1 -1
- package/dist/button.cjs.map +1 -1
- package/dist/button.js.map +1 -1
- package/dist/components.cjs +50 -7
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.cts +2 -1
- package/dist/components.d.ts +2 -1
- package/dist/components.js +50 -8
- package/dist/components.js.map +1 -1
- package/dist/index.cjs +50 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +50 -8
- package/dist/index.js.map +1 -1
- package/dist/page-hero-banner.cjs +1 -1
- package/dist/page-hero-banner.cjs.map +1 -1
- package/dist/page-hero-banner.js +1 -1
- package/dist/page-hero-banner.js.map +1 -1
- package/dist/registry.cjs +227 -0
- package/dist/registry.cjs.map +1 -0
- package/dist/registry.d.cts +55 -0
- package/dist/registry.d.ts +55 -0
- package/dist/registry.js +215 -0
- package/dist/registry.js.map +1 -0
- package/dist/section.cjs +2 -0
- package/dist/section.cjs.map +1 -1
- package/dist/section.js +2 -0
- package/dist/section.js.map +1 -1
- package/dist/types.d.cts +37 -2
- package/dist/types.d.ts +37 -2
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# @opensite/ui
|
|
2
4
|
|
|
3
5
|
Foundational UI component library for the OpenSite Semantic Site Builder ecosystem. Provides tree-shakable, performance-optimized components with abstract styling support.
|
|
@@ -98,7 +100,7 @@ import { Section } from "@opensite/ui/components/section";
|
|
|
98
100
|
|
|
99
101
|
### AnimatedDialog
|
|
100
102
|
|
|
101
|
-
Animated modal dialog component using framer-motion.
|
|
103
|
+
Animated modal dialog component using framer-motion with polished default styles.
|
|
102
104
|
|
|
103
105
|
```tsx
|
|
104
106
|
import { AnimatedDialog } from "@opensite/ui/components/animated-dialog";
|
|
@@ -137,6 +139,13 @@ function MyComponent() {
|
|
|
137
139
|
- `className?: string` - Additional CSS classes for container
|
|
138
140
|
- `contentClassName?: string` - Additional CSS classes for content area
|
|
139
141
|
|
|
142
|
+
**Default Styles:**
|
|
143
|
+
- Background uses theme background color for proper contrast
|
|
144
|
+
- Generous padding (p-6 on mobile, p-12 on desktop) for spacious feel
|
|
145
|
+
- Proper viewport spacing (my-12 on mobile, my-20 on desktop)
|
|
146
|
+
- Close button with circular background that maintains shape on all screen sizes
|
|
147
|
+
- Smooth framer-motion animations with backdrop blur
|
|
148
|
+
|
|
140
149
|
### PageHeroBanner
|
|
141
150
|
|
|
142
151
|
Hero banner component with image or video background support.
|
|
@@ -169,19 +178,121 @@ import { PageHeroBanner } from "@opensite/ui/components/page-hero-banner";
|
|
|
169
178
|
- `className?: string` - Additional CSS classes
|
|
170
179
|
- All standard div attributes
|
|
171
180
|
|
|
181
|
+
### Button
|
|
182
|
+
|
|
183
|
+
Interactive button component with multiple variants and sizes.
|
|
184
|
+
|
|
185
|
+
```tsx
|
|
186
|
+
import { Button } from "@opensite/ui/components/button";
|
|
187
|
+
|
|
188
|
+
<Button variant="default" size="md">
|
|
189
|
+
Click Me
|
|
190
|
+
</Button>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
**Props:**
|
|
194
|
+
- `variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link"` (default: "default")
|
|
195
|
+
- `size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg"` (default: "default")
|
|
196
|
+
- `asChild?: boolean` - Render as child component using Radix Slot (default: false)
|
|
197
|
+
- All standard button attributes
|
|
198
|
+
|
|
172
199
|
### shadcn/ui Components
|
|
173
200
|
|
|
174
201
|
Additional components from shadcn/ui are available:
|
|
175
202
|
|
|
176
203
|
```tsx
|
|
177
|
-
import { Button } from "@opensite/ui/components/button";
|
|
178
204
|
import { Card, CardHeader, CardContent, CardFooter } from "@opensite/ui/components/card";
|
|
179
205
|
import { Badge } from "@opensite/ui/components/badge";
|
|
180
206
|
import { Popover, PopoverTrigger, PopoverContent } from "@opensite/ui/components/popover";
|
|
181
207
|
```
|
|
182
208
|
|
|
209
|
+
### Content-Specific Blocks
|
|
210
|
+
|
|
211
|
+
Pre-configured, reusable UI blocks for common content patterns.
|
|
212
|
+
|
|
213
|
+
#### AlternatingBlocks
|
|
214
|
+
|
|
215
|
+
Display content sections with alternating left/right media placement. Uses the Section component for consistent spacing, backgrounds, and optional titles. Located in the `about` category.
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
import { AlternatingBlocks } from "@opensite/ui/blocks/about/alternating-blocks";
|
|
219
|
+
|
|
220
|
+
<AlternatingBlocks
|
|
221
|
+
title="Our Journey"
|
|
222
|
+
subtitle="About Us"
|
|
223
|
+
background="gray"
|
|
224
|
+
spacing="xl"
|
|
225
|
+
sections={[
|
|
226
|
+
{
|
|
227
|
+
content: (
|
|
228
|
+
<div>
|
|
229
|
+
<h3 className="mb-3 text-2xl font-semibold">Our Story</h3>
|
|
230
|
+
<p className="text-muted-foreground">Started in 2018...</p>
|
|
231
|
+
</div>
|
|
232
|
+
),
|
|
233
|
+
media: <img src="story.jpg" alt="Our story" />,
|
|
234
|
+
mediaLeft: false
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
content: <div>...</div>,
|
|
238
|
+
media: <img src="mission.jpg" alt="Our mission" />,
|
|
239
|
+
mediaLeft: true
|
|
240
|
+
}
|
|
241
|
+
]}
|
|
242
|
+
/>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Props:**
|
|
246
|
+
- `sections: AlternatingBlockSection[]` - Array of content sections (required)
|
|
247
|
+
- `content: ReactNode` - Content to display (text, headings, etc.)
|
|
248
|
+
- `media: ReactNode` - Media to display (image, video, icon, etc.)
|
|
249
|
+
- `mediaLeft?: boolean` - Place media on left side (default: false)
|
|
250
|
+
- `title?: string` - Section title (optional)
|
|
251
|
+
- `subtitle?: string` - Section subtitle/eyebrow (optional)
|
|
252
|
+
- `background?: SectionBackground` - Background variant ("white" | "gray" | "accent", default: "white")
|
|
253
|
+
- `spacing?: SectionSpacing` - Vertical spacing ("none" | "sm" | "md" | "lg" | "xl", default: "lg")
|
|
254
|
+
- `className?: string` - Additional CSS classes for Section wrapper
|
|
255
|
+
- `contentClassName?: string` - Additional CSS classes for content container
|
|
256
|
+
|
|
257
|
+
**Note:** Blocks are now organized by category. Import path includes category: `@opensite/ui/blocks/[category]/[block-name]`
|
|
258
|
+
|
|
259
|
+
### Block Registry
|
|
260
|
+
|
|
261
|
+
Semantic registry for AI-driven component selection. Maps semantic concepts to available UI blocks.
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
import {
|
|
265
|
+
BLOCK_REGISTRY,
|
|
266
|
+
getBlocksBySemanticTag,
|
|
267
|
+
getBlocksByCategory,
|
|
268
|
+
searchBlocks
|
|
269
|
+
} from "@opensite/ui/registry";
|
|
270
|
+
|
|
271
|
+
// Get blocks by semantic tag
|
|
272
|
+
const aboutBlocks = getBlocksBySemanticTag("about");
|
|
273
|
+
|
|
274
|
+
// Get blocks by category
|
|
275
|
+
const featureBlocks = getBlocksByCategory("features");
|
|
276
|
+
|
|
277
|
+
// Search blocks
|
|
278
|
+
const results = searchBlocks("alternating");
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Available Functions:**
|
|
282
|
+
- `getBlocksBySemanticTag(tag: string)` - Find blocks matching semantic tag
|
|
283
|
+
- `getBlocksByCategory(category: BlockCategory)` - Find blocks in category
|
|
284
|
+
- `getBlockById(id: string)` - Get specific block by ID
|
|
285
|
+
- `getAllBlocks()` - Get all registered blocks
|
|
286
|
+
- `getAllCategories()` - Get all available categories
|
|
287
|
+
- `searchBlocks(query: string)` - Search blocks by name/description/tags
|
|
288
|
+
|
|
289
|
+
**Block Categories:**
|
|
290
|
+
- about, features, cta, testimonials, services, hero, footer, header, pricing, team, stats, faq, contact, gallery, timeline, process, benefits, comparison
|
|
291
|
+
|
|
183
292
|
## Styling
|
|
184
293
|
|
|
294
|
+
For comprehensive styling documentation including all CSS variables, theming guides, and customization examples, see [STYLES.md](./docs/STYLES.md).
|
|
295
|
+
|
|
185
296
|
### CSS Variables
|
|
186
297
|
|
|
187
298
|
Components use CSS variables for theming. Define these in your global CSS:
|
|
@@ -241,6 +352,10 @@ import type {
|
|
|
241
352
|
SectionSpacing,
|
|
242
353
|
AnimatedDialogProps,
|
|
243
354
|
PageHeroBannerProps,
|
|
355
|
+
AlternatingBlocksProps,
|
|
356
|
+
AlternatingBlockSection,
|
|
357
|
+
BlockRegistryEntry,
|
|
358
|
+
BlockCategory,
|
|
244
359
|
} from "@opensite/ui/types";
|
|
245
360
|
```
|
|
246
361
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var clsx = require('clsx');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
|
|
10
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
11
|
+
|
|
12
|
+
// lib/utils.ts
|
|
13
|
+
function cn(...inputs) {
|
|
14
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
15
|
+
}
|
|
16
|
+
var maxWidthStyles = {
|
|
17
|
+
sm: "max-w-screen-sm",
|
|
18
|
+
md: "max-w-screen-md",
|
|
19
|
+
lg: "max-w-screen-lg",
|
|
20
|
+
xl: "max-w-screen-xl",
|
|
21
|
+
"2xl": "max-w-screen-2xl",
|
|
22
|
+
"4xl": "max-w-[1536px]",
|
|
23
|
+
full: "max-w-full"
|
|
24
|
+
};
|
|
25
|
+
var Container = React__default.default.forwardRef(
|
|
26
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
27
|
+
const Component = as;
|
|
28
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
29
|
+
Component,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
className: cn(
|
|
33
|
+
"mx-auto w-full px-4 sm:px-6 lg:px-8",
|
|
34
|
+
maxWidthStyles[maxWidth],
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
...props,
|
|
38
|
+
children
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
Container.displayName = "Container";
|
|
44
|
+
var backgroundStyles = {
|
|
45
|
+
white: "bg-background text-foreground",
|
|
46
|
+
gray: "bg-muted/30 text-foreground",
|
|
47
|
+
dark: "bg-foreground text-background",
|
|
48
|
+
gradient: "bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
49
|
+
primary: "bg-primary text-primary-foreground",
|
|
50
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
51
|
+
muted: "bg-muted text-muted-foreground"
|
|
52
|
+
};
|
|
53
|
+
var spacingStyles = {
|
|
54
|
+
sm: "py-12 md:py-16",
|
|
55
|
+
md: "py-16 md:py-24",
|
|
56
|
+
lg: "py-20 md:py-32",
|
|
57
|
+
xl: "py-24 md:py-40"
|
|
58
|
+
};
|
|
59
|
+
var Section = React__default.default.forwardRef(
|
|
60
|
+
({
|
|
61
|
+
id,
|
|
62
|
+
title,
|
|
63
|
+
subtitle,
|
|
64
|
+
children,
|
|
65
|
+
className,
|
|
66
|
+
style,
|
|
67
|
+
background = "white",
|
|
68
|
+
spacing = "lg",
|
|
69
|
+
...props
|
|
70
|
+
}, ref) => {
|
|
71
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
"section",
|
|
73
|
+
{
|
|
74
|
+
ref,
|
|
75
|
+
id,
|
|
76
|
+
className: cn(
|
|
77
|
+
backgroundStyles[background],
|
|
78
|
+
spacingStyles[spacing],
|
|
79
|
+
className
|
|
80
|
+
),
|
|
81
|
+
style,
|
|
82
|
+
...props,
|
|
83
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(Container, { children: [
|
|
84
|
+
(title || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center mb-12 md:mb-16", children: [
|
|
85
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold uppercase tracking-wider mb-2 text-primary", children: subtitle }),
|
|
86
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight", children: title })
|
|
87
|
+
] }),
|
|
88
|
+
children
|
|
89
|
+
] })
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
Section.displayName = "Section";
|
|
95
|
+
function AlternatingBlocks({
|
|
96
|
+
sections,
|
|
97
|
+
title,
|
|
98
|
+
subtitle,
|
|
99
|
+
background = "white",
|
|
100
|
+
spacing = "lg",
|
|
101
|
+
className,
|
|
102
|
+
contentClassName
|
|
103
|
+
}) {
|
|
104
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
|
+
Section,
|
|
106
|
+
{
|
|
107
|
+
title,
|
|
108
|
+
subtitle,
|
|
109
|
+
background,
|
|
110
|
+
spacing,
|
|
111
|
+
className,
|
|
112
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mx-auto w-full max-w-[900px]", contentClassName), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-12", children: sections?.map((section, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: "grid items-center gap-8 md:grid-cols-2 md:gap-12",
|
|
116
|
+
children: [
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: section.mediaLeft ? "md:order-2" : "", children: section.content }),
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
className: cn(
|
|
122
|
+
"aspect-4/3 overflow-hidden rounded-lg border",
|
|
123
|
+
section.mediaLeft ? "md:order-1" : ""
|
|
124
|
+
),
|
|
125
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-full w-full items-center justify-center", children: section.media })
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
index
|
|
131
|
+
)) }) })
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
exports.AlternatingBlocks = AlternatingBlocks;
|
|
137
|
+
//# sourceMappingURL=alternating-blocks.cjs.map
|
|
138
|
+
//# sourceMappingURL=alternating-blocks.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx","../components/blocks/about/alternating-blocks.tsx"],"names":["twMerge","clsx","React","jsx","jsxs"],"mappings":";;;;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,cAAA,GAAiB;AAAA,EACrB,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,KAAA,EAAO,kBAAA;AAAA,EACP,KAAA,EAAO,gBAAA;AAAA,EACP,IAAA,EAAM;AACR,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AAA;AAAA,UAEC,SAAA,EAAU,kDAAA;AAAA,UAEV,QAAA,EAAA;AAAA,4BAAAD,cAAAA,CAAC,SAAI,SAAA,EAAW,OAAA,CAAQ,YAAY,YAAA,GAAe,EAAA,EAChD,kBAAQ,OAAA,EACX,CAAA;AAAA,4BAEAA,cAAAA;AAAA,cAAC,KAAA;AAAA,cAAA;AAAA,gBACC,SAAA,EAAW,EAAA;AAAA,kBACT,8CAAA;AAAA,kBACA,OAAA,CAAQ,YAAY,YAAA,GAAe;AAAA,iBACrC;AAAA,gBAEA,0BAAAA,cAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gDAAA,EACZ,kBAAQ,KAAA,EACX;AAAA;AAAA;AACF;AAAA,SAAA;AAAA,QAhBK;AAAA,OAkBR,GACH,CAAA,EACF;AAAA;AAAA,GACF;AAEJ","file":"alternating-blocks.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","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n style,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n style={style}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n","import * as React from \"react\";\nimport { cn } from \"../../../lib/utils\";\nimport { Section } from \"../../ui/section\";\nimport type { SectionBackground, SectionSpacing } from \"../../../src/types\";\n\nexport interface AlternatingBlockSection {\n content: React.ReactNode;\n media: React.ReactNode;\n mediaLeft?: boolean;\n}\n\nexport interface AlternatingBlocksProps {\n /**\n * Array of sections to display with alternating layout\n */\n sections: AlternatingBlockSection[];\n /**\n * Section title (optional)\n */\n title?: string;\n /**\n * Section subtitle/eyebrow (optional)\n */\n subtitle?: string;\n /**\n * Background style variant\n * @default \"white\"\n */\n background?: SectionBackground;\n /**\n * Vertical spacing variant\n * @default \"lg\"\n */\n spacing?: SectionSpacing;\n /**\n * Additional CSS classes for the Section wrapper\n */\n className?: string;\n /**\n * Additional CSS classes for the content container\n */\n contentClassName?: string;\n}\n\n/**\n * AlternatingBlocks component displays content sections with alternating media placement.\n * Uses the Section component for consistent spacing, backgrounds, and optional titles.\n *\n * @example\n * ```tsx\n * <AlternatingBlocks\n * title=\"Our Story\"\n * subtitle=\"About Us\"\n * background=\"gray\"\n * spacing=\"xl\"\n * sections={[\n * {\n * content: <div><h3>Title</h3><p>Description</p></div>,\n * media: <img src=\"...\" alt=\"...\" />,\n * mediaLeft: false\n * }\n * ]}\n * />\n * ```\n */\nexport function AlternatingBlocks({\n sections,\n title,\n subtitle,\n background = \"white\",\n spacing = \"lg\",\n className,\n contentClassName,\n}: AlternatingBlocksProps) {\n return (\n <Section\n title={title}\n subtitle={subtitle}\n background={background}\n spacing={spacing}\n className={className}\n >\n <div className={cn(\"mx-auto w-full max-w-[900px]\", contentClassName)}>\n <div className=\"space-y-12\">\n {sections?.map((section, index) => (\n <div\n key={index}\n className=\"grid items-center gap-8 md:grid-cols-2 md:gap-12\"\n >\n <div className={section.mediaLeft ? \"md:order-2\" : \"\"}>\n {section.content}\n </div>\n\n <div\n className={cn(\n \"aspect-4/3 overflow-hidden rounded-lg border\",\n section.mediaLeft ? \"md:order-1\" : \"\",\n )}\n >\n <div className=\"flex h-full w-full items-center justify-center\">\n {section.media}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </Section>\n );\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { SectionBackground, SectionSpacing } from './types.cjs';
|
|
4
|
+
|
|
5
|
+
interface AlternatingBlockSection {
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
media: React.ReactNode;
|
|
8
|
+
mediaLeft?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface AlternatingBlocksProps {
|
|
11
|
+
/**
|
|
12
|
+
* Array of sections to display with alternating layout
|
|
13
|
+
*/
|
|
14
|
+
sections: AlternatingBlockSection[];
|
|
15
|
+
/**
|
|
16
|
+
* Section title (optional)
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Section subtitle/eyebrow (optional)
|
|
21
|
+
*/
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Background style variant
|
|
25
|
+
* @default "white"
|
|
26
|
+
*/
|
|
27
|
+
background?: SectionBackground;
|
|
28
|
+
/**
|
|
29
|
+
* Vertical spacing variant
|
|
30
|
+
* @default "lg"
|
|
31
|
+
*/
|
|
32
|
+
spacing?: SectionSpacing;
|
|
33
|
+
/**
|
|
34
|
+
* Additional CSS classes for the Section wrapper
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Additional CSS classes for the content container
|
|
39
|
+
*/
|
|
40
|
+
contentClassName?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* AlternatingBlocks component displays content sections with alternating media placement.
|
|
44
|
+
* Uses the Section component for consistent spacing, backgrounds, and optional titles.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <AlternatingBlocks
|
|
49
|
+
* title="Our Story"
|
|
50
|
+
* subtitle="About Us"
|
|
51
|
+
* background="gray"
|
|
52
|
+
* spacing="xl"
|
|
53
|
+
* sections={[
|
|
54
|
+
* {
|
|
55
|
+
* content: <div><h3>Title</h3><p>Description</p></div>,
|
|
56
|
+
* media: <img src="..." alt="..." />,
|
|
57
|
+
* mediaLeft: false
|
|
58
|
+
* }
|
|
59
|
+
* ]}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare function AlternatingBlocks({ sections, title, subtitle, background, spacing, className, contentClassName, }: AlternatingBlocksProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
|
|
65
|
+
export { type AlternatingBlockSection, AlternatingBlocks, type AlternatingBlocksProps };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { SectionBackground, SectionSpacing } from './types.js';
|
|
4
|
+
|
|
5
|
+
interface AlternatingBlockSection {
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
media: React.ReactNode;
|
|
8
|
+
mediaLeft?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface AlternatingBlocksProps {
|
|
11
|
+
/**
|
|
12
|
+
* Array of sections to display with alternating layout
|
|
13
|
+
*/
|
|
14
|
+
sections: AlternatingBlockSection[];
|
|
15
|
+
/**
|
|
16
|
+
* Section title (optional)
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Section subtitle/eyebrow (optional)
|
|
21
|
+
*/
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Background style variant
|
|
25
|
+
* @default "white"
|
|
26
|
+
*/
|
|
27
|
+
background?: SectionBackground;
|
|
28
|
+
/**
|
|
29
|
+
* Vertical spacing variant
|
|
30
|
+
* @default "lg"
|
|
31
|
+
*/
|
|
32
|
+
spacing?: SectionSpacing;
|
|
33
|
+
/**
|
|
34
|
+
* Additional CSS classes for the Section wrapper
|
|
35
|
+
*/
|
|
36
|
+
className?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Additional CSS classes for the content container
|
|
39
|
+
*/
|
|
40
|
+
contentClassName?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* AlternatingBlocks component displays content sections with alternating media placement.
|
|
44
|
+
* Uses the Section component for consistent spacing, backgrounds, and optional titles.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <AlternatingBlocks
|
|
49
|
+
* title="Our Story"
|
|
50
|
+
* subtitle="About Us"
|
|
51
|
+
* background="gray"
|
|
52
|
+
* spacing="xl"
|
|
53
|
+
* sections={[
|
|
54
|
+
* {
|
|
55
|
+
* content: <div><h3>Title</h3><p>Description</p></div>,
|
|
56
|
+
* media: <img src="..." alt="..." />,
|
|
57
|
+
* mediaLeft: false
|
|
58
|
+
* }
|
|
59
|
+
* ]}
|
|
60
|
+
* />
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare function AlternatingBlocks({ sections, title, subtitle, background, spacing, className, contentClassName, }: AlternatingBlocksProps): react_jsx_runtime.JSX.Element;
|
|
64
|
+
|
|
65
|
+
export { type AlternatingBlockSection, AlternatingBlocks, type AlternatingBlocksProps };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
// lib/utils.ts
|
|
7
|
+
function cn(...inputs) {
|
|
8
|
+
return twMerge(clsx(inputs));
|
|
9
|
+
}
|
|
10
|
+
var maxWidthStyles = {
|
|
11
|
+
sm: "max-w-screen-sm",
|
|
12
|
+
md: "max-w-screen-md",
|
|
13
|
+
lg: "max-w-screen-lg",
|
|
14
|
+
xl: "max-w-screen-xl",
|
|
15
|
+
"2xl": "max-w-screen-2xl",
|
|
16
|
+
"4xl": "max-w-[1536px]",
|
|
17
|
+
full: "max-w-full"
|
|
18
|
+
};
|
|
19
|
+
var Container = React.forwardRef(
|
|
20
|
+
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
21
|
+
const Component = as;
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Component,
|
|
24
|
+
{
|
|
25
|
+
ref,
|
|
26
|
+
className: cn(
|
|
27
|
+
"mx-auto w-full px-4 sm:px-6 lg:px-8",
|
|
28
|
+
maxWidthStyles[maxWidth],
|
|
29
|
+
className
|
|
30
|
+
),
|
|
31
|
+
...props,
|
|
32
|
+
children
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
Container.displayName = "Container";
|
|
38
|
+
var backgroundStyles = {
|
|
39
|
+
white: "bg-background text-foreground",
|
|
40
|
+
gray: "bg-muted/30 text-foreground",
|
|
41
|
+
dark: "bg-foreground text-background",
|
|
42
|
+
gradient: "bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
|
|
43
|
+
primary: "bg-primary text-primary-foreground",
|
|
44
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
45
|
+
muted: "bg-muted text-muted-foreground"
|
|
46
|
+
};
|
|
47
|
+
var spacingStyles = {
|
|
48
|
+
sm: "py-12 md:py-16",
|
|
49
|
+
md: "py-16 md:py-24",
|
|
50
|
+
lg: "py-20 md:py-32",
|
|
51
|
+
xl: "py-24 md:py-40"
|
|
52
|
+
};
|
|
53
|
+
var Section = React.forwardRef(
|
|
54
|
+
({
|
|
55
|
+
id,
|
|
56
|
+
title,
|
|
57
|
+
subtitle,
|
|
58
|
+
children,
|
|
59
|
+
className,
|
|
60
|
+
style,
|
|
61
|
+
background = "white",
|
|
62
|
+
spacing = "lg",
|
|
63
|
+
...props
|
|
64
|
+
}, ref) => {
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
"section",
|
|
67
|
+
{
|
|
68
|
+
ref,
|
|
69
|
+
id,
|
|
70
|
+
className: cn(
|
|
71
|
+
backgroundStyles[background],
|
|
72
|
+
spacingStyles[spacing],
|
|
73
|
+
className
|
|
74
|
+
),
|
|
75
|
+
style,
|
|
76
|
+
...props,
|
|
77
|
+
children: /* @__PURE__ */ jsxs(Container, { children: [
|
|
78
|
+
(title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-12 md:mb-16", children: [
|
|
79
|
+
subtitle && /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold uppercase tracking-wider mb-2 text-primary", children: subtitle }),
|
|
80
|
+
title && /* @__PURE__ */ jsx("h2", { className: "text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight", children: title })
|
|
81
|
+
] }),
|
|
82
|
+
children
|
|
83
|
+
] })
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
Section.displayName = "Section";
|
|
89
|
+
function AlternatingBlocks({
|
|
90
|
+
sections,
|
|
91
|
+
title,
|
|
92
|
+
subtitle,
|
|
93
|
+
background = "white",
|
|
94
|
+
spacing = "lg",
|
|
95
|
+
className,
|
|
96
|
+
contentClassName
|
|
97
|
+
}) {
|
|
98
|
+
return /* @__PURE__ */ jsx(
|
|
99
|
+
Section,
|
|
100
|
+
{
|
|
101
|
+
title,
|
|
102
|
+
subtitle,
|
|
103
|
+
background,
|
|
104
|
+
spacing,
|
|
105
|
+
className,
|
|
106
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("mx-auto w-full max-w-[900px]", contentClassName), children: /* @__PURE__ */ jsx("div", { className: "space-y-12", children: sections?.map((section, index) => /* @__PURE__ */ jsxs(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
className: "grid items-center gap-8 md:grid-cols-2 md:gap-12",
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsx("div", { className: section.mediaLeft ? "md:order-2" : "", children: section.content }),
|
|
112
|
+
/* @__PURE__ */ jsx(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: cn(
|
|
116
|
+
"aspect-4/3 overflow-hidden rounded-lg border",
|
|
117
|
+
section.mediaLeft ? "md:order-1" : ""
|
|
118
|
+
),
|
|
119
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center", children: section.media })
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
},
|
|
124
|
+
index
|
|
125
|
+
)) }) })
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { AlternatingBlocks };
|
|
131
|
+
//# sourceMappingURL=alternating-blocks.js.map
|
|
132
|
+
//# sourceMappingURL=alternating-blocks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../lib/utils.ts","../components/ui/container.tsx","../components/ui/section.tsx","../components/blocks/about/alternating-blocks.tsx"],"names":["React","jsx","jsxs"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACDA,IAAM,cAAA,GAAiB;AAAA,EACrB,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,EAAA,EAAI,iBAAA;AAAA,EACJ,KAAA,EAAO,kBAAA;AAAA,EACP,KAAA,EAAO,gBAAA;AAAA,EACP,IAAA,EAAM;AACR,CAAA;AAYO,IAAM,YAAY,KAAA,CAAM,UAAA;AAAA,EAC7B,CAAC,EAAE,QAAA,EAAU,QAAA,GAAW,IAAA,EAAM,SAAA,EAAW,EAAA,GAAK,KAAA,EAAO,GAAG,KAAA,EAAM,EAAG,GAAA,KAAQ;AACvE,IAAA,MAAM,SAAA,GAAY,EAAA;AAClB,IAAA,uBACE,GAAA;AAAA,MAAC,SAAA;AAAA,MAAA;AAAA,QACC,GAAA;AAAA,QACA,SAAA,EAAW,EAAA;AA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AA,iBACrC;AAAA,gBAEA,0BAAAA,GAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,gDAAA,EACZ,kBAAQ,KAAA,EACX;AAAA;AAAA;AACF;AAAA,SAAA;AAAA,QAhBK;AAAA,OAkBR,GACH,CAAA,EACF;AAAA;AAAA,GACF;AAEJ","file":"alternating-blocks.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","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport type { ContainerProps } from \"../../src/types\";\n\nconst maxWidthStyles = {\n sm: \"max-w-screen-sm\",\n md: \"max-w-screen-md\",\n lg: \"max-w-screen-lg\",\n xl: \"max-w-screen-xl\",\n \"2xl\": \"max-w-screen-2xl\",\n \"4xl\": \"max-w-[1536px]\",\n full: \"max-w-full\",\n};\n\n/**\n * Container component for consistent content width and centering\n *\n * @example\n * ```tsx\n * <Container maxWidth=\"xl\">\n * <h1>Page Content</h1>\n * </Container>\n * ```\n */\nexport const Container = React.forwardRef<HTMLDivElement, ContainerProps>(\n ({ children, maxWidth = \"xl\", className, as = \"div\", ...props }, ref) => {\n const Component = as as any;\n return (\n <Component\n ref={ref}\n className={cn(\n \"mx-auto w-full px-4 sm:px-6 lg:px-8\",\n maxWidthStyles[maxWidth],\n className\n )}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nContainer.displayName = \"Container\";\n","import React from \"react\";\nimport { cn } from \"../../lib/utils\";\nimport { Container } from \"./container\";\nimport type { SectionProps } from \"../../src/types\";\n\n/**\n * Background style variants\n * Uses standard Tailwind/shadcn CSS variables for theming\n */\nconst backgroundStyles = {\n white: \"bg-background text-foreground\",\n gray: \"bg-muted/30 text-foreground\",\n dark: \"bg-foreground text-background\",\n gradient: \"bg-gradient-to-br from-primary via-primary/90 to-foreground text-primary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n secondary: \"bg-secondary text-secondary-foreground\",\n muted: \"bg-muted text-muted-foreground\",\n};\n\n/**\n * Vertical spacing variants\n */\nconst spacingStyles = {\n sm: \"py-12 md:py-16\",\n md: \"py-16 md:py-24\",\n lg: \"py-20 md:py-32\",\n xl: \"py-24 md:py-40\",\n};\n\n/**\n * Section component for consistent page sections with optional title, subtitle, and background\n *\n * @example\n * ```tsx\n * <Section\n * title=\"Our Services\"\n * subtitle=\"What we offer\"\n * background=\"gray\"\n * spacing=\"lg\"\n * >\n * <div>Section content goes here</div>\n * </Section>\n * ```\n */\nexport const Section = React.forwardRef<HTMLElement, SectionProps>(\n (\n {\n id,\n title,\n subtitle,\n children,\n className,\n style,\n background = \"white\",\n spacing = \"lg\",\n ...props\n },\n ref\n ) => {\n return (\n <section\n ref={ref}\n id={id}\n className={cn(\n backgroundStyles[background],\n spacingStyles[spacing],\n className\n )}\n style={style}\n {...props}\n >\n <Container>\n {(title || subtitle) && (\n <div className=\"text-center mb-12 md:mb-16\">\n {subtitle && (\n <p className=\"text-sm font-semibold uppercase tracking-wider mb-2 text-primary\">\n {subtitle}\n </p>\n )}\n {title && (\n <h2 className=\"text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight\">\n {title}\n </h2>\n )}\n </div>\n )}\n {children}\n </Container>\n </section>\n );\n }\n);\n\nSection.displayName = \"Section\";\n","import * as React from \"react\";\nimport { cn } from \"../../../lib/utils\";\nimport { Section } from \"../../ui/section\";\nimport type { SectionBackground, SectionSpacing } from \"../../../src/types\";\n\nexport interface AlternatingBlockSection {\n content: React.ReactNode;\n media: React.ReactNode;\n mediaLeft?: boolean;\n}\n\nexport interface AlternatingBlocksProps {\n /**\n * Array of sections to display with alternating layout\n */\n sections: AlternatingBlockSection[];\n /**\n * Section title (optional)\n */\n title?: string;\n /**\n * Section subtitle/eyebrow (optional)\n */\n subtitle?: string;\n /**\n * Background style variant\n * @default \"white\"\n */\n background?: SectionBackground;\n /**\n * Vertical spacing variant\n * @default \"lg\"\n */\n spacing?: SectionSpacing;\n /**\n * Additional CSS classes for the Section wrapper\n */\n className?: string;\n /**\n * Additional CSS classes for the content container\n */\n contentClassName?: string;\n}\n\n/**\n * AlternatingBlocks component displays content sections with alternating media placement.\n * Uses the Section component for consistent spacing, backgrounds, and optional titles.\n *\n * @example\n * ```tsx\n * <AlternatingBlocks\n * title=\"Our Story\"\n * subtitle=\"About Us\"\n * background=\"gray\"\n * spacing=\"xl\"\n * sections={[\n * {\n * content: <div><h3>Title</h3><p>Description</p></div>,\n * media: <img src=\"...\" alt=\"...\" />,\n * mediaLeft: false\n * }\n * ]}\n * />\n * ```\n */\nexport function AlternatingBlocks({\n sections,\n title,\n subtitle,\n background = \"white\",\n spacing = \"lg\",\n className,\n contentClassName,\n}: AlternatingBlocksProps) {\n return (\n <Section\n title={title}\n subtitle={subtitle}\n background={background}\n spacing={spacing}\n className={className}\n >\n <div className={cn(\"mx-auto w-full max-w-[900px]\", contentClassName)}>\n <div className=\"space-y-12\">\n {sections?.map((section, index) => (\n <div\n key={index}\n className=\"grid items-center gap-8 md:grid-cols-2 md:gap-12\"\n >\n <div className={section.mediaLeft ? \"md:order-2\" : \"\"}>\n {section.content}\n </div>\n\n <div\n className={cn(\n \"aspect-4/3 overflow-hidden rounded-lg border\",\n section.mediaLeft ? \"md:order-1\" : \"\",\n )}\n >\n <div className=\"flex h-full w-full items-center justify-center\">\n {section.media}\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </Section>\n );\n}\n"]}
|
package/dist/animated-dialog.cjs
CHANGED
|
@@ -91,19 +91,19 @@ function AnimatedDialog({
|
|
|
91
91
|
"aria-labelledby": title ? titleId : void 0,
|
|
92
92
|
"aria-describedby": description ? descriptionId : void 0,
|
|
93
93
|
className: cn(
|
|
94
|
-
"relative z-
|
|
94
|
+
"relative z-60 mx-auto my-12 flex w-[92vw] max-h-[85vh] flex-col overflow-hidden rounded-3xl bg-background p-6 shadow-2xl ring-1 ring-border/10 md:my-20 md:p-12",
|
|
95
95
|
sizeStyles[size],
|
|
96
96
|
className
|
|
97
97
|
),
|
|
98
98
|
children: [
|
|
99
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-8", children: [
|
|
100
100
|
header ? header : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
101
101
|
eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold uppercase tracking-[0.3em] text-primary", children: eyebrow }) : null,
|
|
102
102
|
title ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
103
103
|
"h2",
|
|
104
104
|
{
|
|
105
105
|
id: titleId,
|
|
106
|
-
className: "text-2xl font-semibold text-
|
|
106
|
+
className: "text-2xl font-semibold text-foreground md:text-4xl",
|
|
107
107
|
children: title
|
|
108
108
|
}
|
|
109
109
|
) : null,
|
|
@@ -121,7 +121,7 @@ function AnimatedDialog({
|
|
|
121
121
|
{
|
|
122
122
|
type: "button",
|
|
123
123
|
"aria-label": "Close dialog",
|
|
124
|
-
className: "flex h-
|
|
124
|
+
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-foreground text-background transition hover:bg-foreground/80 md:h-11 md:w-11",
|
|
125
125
|
onClick: () => onOpenChange(false),
|
|
126
126
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
127
127
|
"svg",
|
|
@@ -150,13 +150,13 @@ function AnimatedDialog({
|
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
152
152
|
className: cn(
|
|
153
|
-
"mt-
|
|
153
|
+
"mt-8 flex-1 min-h-0 overflow-y-auto pr-2 md:mt-10",
|
|
154
154
|
contentClassName
|
|
155
155
|
),
|
|
156
156
|
children
|
|
157
157
|
}
|
|
158
158
|
) : null,
|
|
159
|
-
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-
|
|
159
|
+
footer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-8 md:mt-10", children: footer }) : null
|
|
160
160
|
]
|
|
161
161
|
}
|
|
162
162
|
)
|