@opensite/ui 2.5.0 → 2.5.2

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.
@@ -15,7 +15,6 @@ var PopoverPrimitive = require('@radix-ui/react-popover');
15
15
  var icon = require('@page-speed/icon');
16
16
  var usePlatformFromUrl = require('@opensite/hooks/usePlatformFromUrl');
17
17
  var TabsPrimitive = require('@radix-ui/react-tabs');
18
- var forms = require('@page-speed/forms');
19
18
  var integration = require('@page-speed/forms/integration');
20
19
 
21
20
  function _interopNamespace(e) {
@@ -4602,12 +4601,18 @@ function FooterLinksGrid({
4602
4601
  }
4603
4602
  );
4604
4603
  }
4604
+ var DEFAULT_STYLE_RULES = {
4605
+ formContainer: "flex items-stretch w-full",
4606
+ fieldsContainer: "",
4607
+ fieldClassName: "",
4608
+ formClassName: ""
4609
+ };
4605
4610
  var DEFAULT_FORM_FIELDS = [
4606
4611
  {
4607
4612
  name: "email",
4608
4613
  type: "email",
4609
4614
  label: "Email Address",
4610
- placeholder: "Enter your email",
4615
+ placeholder: "Email Address",
4611
4616
  required: true,
4612
4617
  columnSpan: 12
4613
4618
  }
@@ -4620,7 +4625,6 @@ function FooterSocialNewsletter({
4620
4625
  className,
4621
4626
  contentClassName,
4622
4627
  logoWrapperClassName,
4623
- logoClassName,
4624
4628
  gridClassName,
4625
4629
  navSectionClassName,
4626
4630
  navTitleClassName,
@@ -4629,16 +4633,7 @@ function FooterSocialNewsletter({
4629
4633
  socialColumnClassName,
4630
4634
  socialLinksClassName,
4631
4635
  socialLinkClassName,
4632
- formFields = DEFAULT_FORM_FIELDS,
4633
- formConfig,
4634
- onSubmit,
4635
- onSuccess,
4636
- onError,
4637
- successMessage,
4638
- buttonAction,
4639
- helperText,
4640
- formSlot,
4641
- privacyClassName,
4636
+ formEngineSetup,
4642
4637
  bottomClassName,
4643
4638
  copyrightClassName,
4644
4639
  background,
@@ -4648,104 +4643,36 @@ function FooterSocialNewsletter({
4648
4643
  patternOpacity,
4649
4644
  optixFlowConfig
4650
4645
  }) {
4651
- const {
4652
- uploadTokens,
4653
- uploadProgress,
4654
- isUploading,
4655
- uploadFiles,
4656
- removeFile,
4657
- resetUpload
4658
- } = integration.useFileUpload({ onError });
4659
- const { form, submissionError, formMethod, resetSubmissionState } = integration.useContactForm({
4660
- formFields,
4661
- formConfig,
4662
- onSubmit,
4663
- onSuccess: (data) => {
4664
- resetUpload();
4665
- onSuccess?.(data);
4666
- },
4667
- onError,
4668
- uploadTokens
4669
- });
4670
4646
  const renderForm = React4__namespace.useMemo(() => {
4671
- if (formSlot) return formSlot;
4672
- const defaultButtonAction = {
4673
- label: "Subscribe",
4647
+ if (!formEngineSetup) return null;
4648
+ const action = {
4674
4649
  variant: "default",
4675
- className: "h-12"
4650
+ icon: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/arrow-right", size: 16 })
4676
4651
  };
4677
- const action = buttonAction || defaultButtonAction;
4678
- return /* @__PURE__ */ jsxRuntime.jsxs(
4679
- forms.Form,
4652
+ return /* @__PURE__ */ jsxRuntime.jsx(
4653
+ integration.FormEngine,
4680
4654
  {
4681
- form,
4682
- fields: formFields,
4683
- notificationConfig: {
4684
- submissionError,
4685
- successMessage
4686
- },
4687
- formConfig: {
4688
- endpoint: formConfig?.endpoint,
4689
- method: formMethod,
4690
- submissionConfig: formConfig?.submissionConfig,
4691
- formLayout: "button-group",
4692
- buttonGroupSize: "sm",
4693
- submitLabel: action.label,
4694
- submitVariant: action.variant || "default",
4695
- submitIconComponent: action.icon || /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/send" })
4696
- },
4697
- onNewSubmission: () => {
4698
- resetUpload();
4699
- resetSubmissionState();
4655
+ formEngineSetup: {
4656
+ ...formEngineSetup,
4657
+ formLayoutSettings: {
4658
+ ...formEngineSetup.formLayoutSettings,
4659
+ formLayout: "button-group",
4660
+ buttonGroupSetup: {
4661
+ ...formEngineSetup.formLayoutSettings?.buttonGroupSetup,
4662
+ size: "default",
4663
+ submitLabel: action.icon || action.label,
4664
+ submitVariant: action.variant
4665
+ }
4666
+ }
4700
4667
  },
4701
- children: [
4702
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 sm:flex-row", children: [
4703
- formFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsx(
4704
- integration.DynamicFormField,
4705
- {
4706
- field,
4707
- uploadProgress,
4708
- onFileUpload: uploadFiles,
4709
- onFileRemove: removeFile,
4710
- isUploading
4711
- }
4712
- ) }, field.name)),
4713
- /* @__PURE__ */ jsxRuntime.jsxs(
4714
- Pressable,
4715
- {
4716
- onClick: form.handleSubmit,
4717
- asButton: true,
4718
- variant: action.variant,
4719
- className: cn("h-12", action.className),
4720
- disabled: form.isSubmitting,
4721
- children: [
4722
- action.label,
4723
- action.iconAfter
4724
- ]
4725
- }
4726
- )
4727
- ] }),
4728
- helperText && (typeof helperText === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cn("text-sm mt-2"), children: helperText }) : helperText)
4729
- ]
4668
+ defaultFields: DEFAULT_FORM_FIELDS,
4669
+ defaultStyleRules: {
4670
+ ...DEFAULT_STYLE_RULES,
4671
+ formContainer: cn(DEFAULT_STYLE_RULES.formContainer)
4672
+ }
4730
4673
  }
4731
4674
  );
4732
- }, [
4733
- formSlot,
4734
- formFields,
4735
- form,
4736
- formConfig,
4737
- formMethod,
4738
- buttonAction,
4739
- uploadProgress,
4740
- uploadFiles,
4741
- removeFile,
4742
- isUploading,
4743
- submissionError,
4744
- successMessage,
4745
- helperText,
4746
- resetUpload,
4747
- resetSubmissionState
4748
- ]);
4675
+ }, [formEngineSetup]);
4749
4676
  return /* @__PURE__ */ jsxRuntime.jsx(
4750
4677
  Section,
4751
4678
  {
@@ -4753,20 +4680,26 @@ function FooterSocialNewsletter({
4753
4680
  spacing,
4754
4681
  pattern,
4755
4682
  patternOpacity,
4756
- className: cn(className),
4683
+ className,
4757
4684
  containerClassName,
4758
4685
  children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(contentClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("footer", { children: [
4759
4686
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-20", children: [
4760
4687
  logo && /* @__PURE__ */ jsxRuntime.jsx(
4761
- FooterLogo,
4688
+ Pressable,
4762
4689
  {
4763
- logo,
4764
- logoClassName: cn(
4765
- "flex items-center gap-2",
4766
- logoWrapperClassName
4767
- ),
4768
- logoImageClassName: cn("h-10", logoClassName),
4769
- optixFlowConfig
4690
+ href: logo.url || "/",
4691
+ className: cn("block mb-8 md:mb-12", logoWrapperClassName),
4692
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4693
+ img.Img,
4694
+ {
4695
+ src: logo.src,
4696
+ className: cn(
4697
+ "h-16 object-contain w-auto max-w-full",
4698
+ logo.className
4699
+ ),
4700
+ optixFlowConfig
4701
+ }
4702
+ )
4770
4703
  }
4771
4704
  ),
4772
4705
  socialLinks && socialLinks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mt-6", socialColumnClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -4779,10 +4712,9 @@ function FooterSocialNewsletter({
4779
4712
  children: socialLinks.map((social, idx) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx(
4780
4713
  SocialLinkIcon,
4781
4714
  {
4782
- href: social.href,
4783
- label: social.label,
4784
- iconNameOverride: social.iconNameOverride,
4785
- iconSize: 20,
4715
+ size: "icon-lg",
4716
+ variant: "ghost",
4717
+ ...social,
4786
4718
  className: cn(
4787
4719
  "opacity-80 transition-colors hover:opacity-100",
4788
4720
  socialLinkClassName
@@ -6292,7 +6224,7 @@ function FooterAnimatedSocial({
6292
6224
  }
6293
6225
  );
6294
6226
  }
6295
- var DEFAULT_STYLE_RULES = {
6227
+ var DEFAULT_STYLE_RULES2 = {
6296
6228
  formContainer: "flex w-full items-end border-b border-b-foreground/10",
6297
6229
  fieldsContainer: "",
6298
6230
  fieldClassName: "",
@@ -6330,6 +6262,7 @@ function FooterNewsletterMinimal({
6330
6262
  socialLinksClassName,
6331
6263
  socialLinkClassName,
6332
6264
  newsletterSectionClassName,
6265
+ newsletterLabelClassName,
6333
6266
  newsletterFormClassName,
6334
6267
  bottomGridClassName,
6335
6268
  locationClassName,
@@ -6415,9 +6348,9 @@ function FooterNewsletterMinimal({
6415
6348
  },
6416
6349
  defaultFields: DEFAULT_FORM_FIELDS2,
6417
6350
  defaultStyleRules: {
6418
- ...DEFAULT_STYLE_RULES,
6351
+ ...DEFAULT_STYLE_RULES2,
6419
6352
  formContainer: cn(
6420
- DEFAULT_STYLE_RULES.formContainer,
6353
+ DEFAULT_STYLE_RULES2.formContainer,
6421
6354
  newsletterFormClassName
6422
6355
  )
6423
6356
  }
@@ -6443,29 +6376,41 @@ function FooterNewsletterMinimal({
6443
6376
  ),
6444
6377
  children: [
6445
6378
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-10", children: [
6446
- heading && /* @__PURE__ */ jsxRuntime.jsx(
6447
- "p",
6448
- {
6449
- className: cn(
6450
- "relative text-4xl font-medium tracking-tight lg:text-5xl",
6451
- headingClassName
6452
- ),
6453
- children: heading
6454
- }
6455
- ),
6456
- (supportLabel || supportEmail) && /* @__PURE__ */ jsxRuntime.jsxs(
6379
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
6380
+ heading && /* @__PURE__ */ jsxRuntime.jsx(
6381
+ "h2",
6382
+ {
6383
+ className: cn(
6384
+ "relative text-4xl font-semibold tracking-tight lg:text-5xl text-balance",
6385
+ headingClassName
6386
+ ),
6387
+ children: heading
6388
+ }
6389
+ ),
6390
+ location && /* @__PURE__ */ jsxRuntime.jsx(
6391
+ "div",
6392
+ {
6393
+ className: cn(
6394
+ "font-semibold text-lg opacity-75",
6395
+ locationClassName
6396
+ ),
6397
+ children: location
6398
+ }
6399
+ )
6400
+ ] }),
6401
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4", children: (supportLabel || supportEmail) && /* @__PURE__ */ jsxRuntime.jsxs(
6457
6402
  "div",
6458
6403
  {
6459
6404
  className: cn(
6460
- "space-y-1 text-sm font-light tracking-tight lg:text-base",
6405
+ "space-y-1 text-sm tracking-tight lg:text-base",
6461
6406
  supportClassName
6462
6407
  ),
6463
6408
  children: [
6464
- supportLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { children: supportLabel }),
6465
- supportEmail && /* @__PURE__ */ jsxRuntime.jsx(Pressable, { href: `mailto:${supportEmail}`, children: supportEmail })
6409
+ supportLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-light opacity-75", children: supportLabel }),
6410
+ supportEmail && /* @__PURE__ */ jsxRuntime.jsx(Pressable, { className: "font-semibold", href: supportEmail, children: supportEmail })
6466
6411
  ]
6467
6412
  }
6468
- )
6413
+ ) })
6469
6414
  ] }),
6470
6415
  /* @__PURE__ */ jsxRuntime.jsxs(
6471
6416
  "div",
@@ -6483,41 +6428,35 @@ function FooterNewsletterMinimal({
6483
6428
  ]
6484
6429
  }
6485
6430
  ),
6486
- /* @__PURE__ */ jsxRuntime.jsxs(
6431
+ /* @__PURE__ */ jsxRuntime.jsx(
6487
6432
  "div",
6488
6433
  {
6489
6434
  className: cn(
6490
6435
  "mt-20 flex flex-col justify-between gap-15 lg:flex-row",
6491
6436
  newsletterSectionClassName
6492
6437
  ),
6493
- children: [
6494
- formEngineSetup && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full max-w-md flex-col gap-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 text-sm font-light tracking-tight lg:text-base", children: [
6495
- newsletterLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { children: newsletterLabel }),
6496
- renderForm
6497
- ] }) }),
6498
- /* @__PURE__ */ jsxRuntime.jsxs(
6499
- "div",
6438
+ children: formEngineSetup && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full max-w-md flex-col gap-10", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
6439
+ newsletterLabel && /* @__PURE__ */ jsxRuntime.jsx(
6440
+ "p",
6500
6441
  {
6501
6442
  className: cn(
6502
- "grid w-full max-w-xs grid-cols-2 gap-10 text-sm font-light lg:text-base",
6503
- bottomGridClassName
6443
+ "text-xl font-light tracking-tight",
6444
+ newsletterLabelClassName
6504
6445
  ),
6505
- children: [
6506
- location && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-32", locationClassName), children: location }),
6507
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: cn("space-y-1", footerLinksClassName), children: footerLinksContent })
6508
- ]
6446
+ children: newsletterLabel
6509
6447
  }
6510
- )
6511
- ]
6448
+ ),
6449
+ renderForm
6450
+ ] }) })
6512
6451
  }
6513
6452
  ),
6514
6453
  brandText && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("mt-20 w-full lg:mt-32", brandSectionClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
6515
6454
  framerMotion.motion.div,
6516
6455
  {
6517
- initial: { opacity: 0, y: 20 },
6456
+ initial: { opacity: 0, y: 80 },
6518
6457
  whileInView: { opacity: 1, y: 0 },
6519
- viewport: { once: true },
6520
- transition: { duration: 0.6 },
6458
+ viewport: { once: true, amount: 0.5 },
6459
+ transition: { duration: 0.9, ease: [0.16, 1, 0.3, 1] },
6521
6460
  className: "text-center",
6522
6461
  children: /* @__PURE__ */ jsxRuntime.jsx(
6523
6462
  "span",
@@ -6535,19 +6474,51 @@ function FooterNewsletterMinimal({
6535
6474
  "div",
6536
6475
  {
6537
6476
  className: cn(
6538
- "mt-8 text-center text-sm opacity-80",
6477
+ "flex flex-col items-center space-y-6",
6478
+ brandText ? "mb-24" : "mt-8",
6539
6479
  copyrightClassName
6540
6480
  ),
6541
6481
  children: [
6542
- /* @__PURE__ */ jsxRuntime.jsx(FooterCopyright, { copyright }),
6543
6482
  /* @__PURE__ */ jsxRuntime.jsx(
6544
- BrandAttribution,
6483
+ "div",
6484
+ {
6485
+ className: cn(
6486
+ "flex items-center justify-center",
6487
+ bottomGridClassName
6488
+ ),
6489
+ children: /* @__PURE__ */ jsxRuntime.jsx(
6490
+ "div",
6491
+ {
6492
+ className: cn(
6493
+ "flex gap-4 md:gap-6 text-sm font-light lg:text-base",
6494
+ "text-center items-center justify-center flex-wrap",
6495
+ footerLinksClassName
6496
+ ),
6497
+ children: footerLinksContent
6498
+ }
6499
+ )
6500
+ }
6501
+ ),
6502
+ /* @__PURE__ */ jsxRuntime.jsxs(
6503
+ "div",
6545
6504
  {
6546
- internalBrandSlug: "open_site_ai",
6547
- optionIndex: 4,
6548
- variant: "div",
6549
- containerClassName: "mt-2",
6550
- linkClassName: "underline underline-offset-4 transition-colors hover:opacity-100"
6505
+ className: cn(
6506
+ "mt-8 text-center text-sm opacity-50",
6507
+ copyrightClassName
6508
+ ),
6509
+ children: [
6510
+ /* @__PURE__ */ jsxRuntime.jsx(FooterCopyright, { copyright }),
6511
+ /* @__PURE__ */ jsxRuntime.jsx(
6512
+ BrandAttribution,
6513
+ {
6514
+ internalBrandSlug: "open_site_ai",
6515
+ optionIndex: 4,
6516
+ variant: "div",
6517
+ containerClassName: "mt-2",
6518
+ linkClassName: "underline underline-offset-4 transition-colors hover:opacity-100"
6519
+ }
6520
+ )
6521
+ ]
6551
6522
  }
6552
6523
  )
6553
6524
  ]