@sudobility/building_blocks 0.0.17 → 0.0.18

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/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import React, { useState, useRef, useMemo, useCallback, useEffect, createContext
3
3
  import { TopbarProvider, Topbar, TopbarLeft, TopbarNavigation, TopbarLogo, Logo, TopbarCenter, TopbarRight, TopbarActions, TopbarMobileContent, BreadcrumbSection, Footer, FooterCompact, FooterCompactLeft, FooterVersion, FooterCopyright, FooterCompactRight, FooterGrid, FooterLinkSection, FooterLink, FooterBottom, FooterBrand, FooterSocialLinks, LayoutProvider, Label, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Card, CardContent, Button } from "@sudobility/components";
4
4
  import { clsx } from "clsx";
5
5
  import { twMerge } from "tailwind-merge";
6
- import { ChevronDownIcon, CalendarDaysIcon, PaintBrushIcon, ChevronLeftIcon } from "@heroicons/react/24/outline";
6
+ import { ChevronDownIcon, CalendarDaysIcon, PaintBrushIcon, ChevronLeftIcon, LanguageIcon, ChevronRightIcon, EnvelopeIcon, DocumentTextIcon, CogIcon, HomeIcon } from "@heroicons/react/24/outline";
7
7
  import { GRADIENT_CLASSES, textVariants } from "@sudobility/design";
8
8
  import { cva } from "class-variance-authority";
9
9
  function cn(...inputs) {
@@ -4619,7 +4619,7 @@ function AppPricingPage({
4619
4619
  {
4620
4620
  options: billingPeriodOptions,
4621
4621
  value: billingPeriod,
4622
- onChange: setBillingPeriod
4622
+ onChange: (value) => setBillingPeriod(value)
4623
4623
  }
4624
4624
  ) }),
4625
4625
  /* @__PURE__ */ jsxs(
@@ -4736,13 +4736,296 @@ function AppPricingPage({
4736
4736
  ] }) })
4737
4737
  ] });
4738
4738
  }
4739
+ const getIcon = (icon) => {
4740
+ switch (icon) {
4741
+ case "home":
4742
+ return /* @__PURE__ */ jsx(HomeIcon, { className: "w-5 h-5 mr-2" });
4743
+ case "document":
4744
+ return /* @__PURE__ */ jsx(DocumentTextIcon, { className: "w-5 h-5 mr-2" });
4745
+ case "envelope":
4746
+ return /* @__PURE__ */ jsx(EnvelopeIcon, { className: "w-5 h-5 mr-2" });
4747
+ case "cog":
4748
+ return /* @__PURE__ */ jsx(CogIcon, { className: "w-5 h-5 mr-2" });
4749
+ case "language":
4750
+ return /* @__PURE__ */ jsx(LanguageIcon, { className: "w-5 h-5 mr-2" });
4751
+ default:
4752
+ return null;
4753
+ }
4754
+ };
4755
+ const AppSitemapPage = ({
4756
+ text,
4757
+ sections,
4758
+ languages,
4759
+ quickLinks = [],
4760
+ LinkComponent,
4761
+ PageWrapper,
4762
+ className
4763
+ }) => {
4764
+ const content = /* @__PURE__ */ jsxs("div", { className: `max-w-7xl mx-auto px-4 py-12 ${className || ""}`, children: [
4765
+ /* @__PURE__ */ jsxs("div", { className: "text-center mb-12", children: [
4766
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl font-bold text-gray-900 dark:text-white mb-4", children: text.title }),
4767
+ /* @__PURE__ */ jsx("p", { className: "text-xl text-gray-600 dark:text-gray-300", children: text.subtitle })
4768
+ ] }),
4769
+ languages.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mb-12 p-6 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4770
+ /* @__PURE__ */ jsxs("h2", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-4 flex items-center", children: [
4771
+ /* @__PURE__ */ jsx(LanguageIcon, { className: "w-6 h-6 mr-2" }),
4772
+ text.languagesSectionTitle
4773
+ ] }),
4774
+ /* @__PURE__ */ jsx("p", { className: "text-gray-600 dark:text-gray-300 mb-6", children: text.languagesDescription }),
4775
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-4", children: languages.map((lang) => /* @__PURE__ */ jsxs(
4776
+ LinkComponent,
4777
+ {
4778
+ href: "/",
4779
+ language: lang.code,
4780
+ className: "flex items-center space-x-2 p-3 bg-white dark:bg-gray-800 rounded-lg hover:shadow-md transition-shadow",
4781
+ children: [
4782
+ /* @__PURE__ */ jsx("span", { className: "text-2xl", children: lang.flag }),
4783
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-gray-900 dark:text-white", children: lang.name })
4784
+ ]
4785
+ },
4786
+ lang.code
4787
+ )) })
4788
+ ] }),
4789
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8", children: sections.map((section, index) => /* @__PURE__ */ jsxs(
4790
+ "div",
4791
+ {
4792
+ className: "bg-white dark:bg-gray-800 rounded-lg shadow-sm p-6",
4793
+ children: [
4794
+ /* @__PURE__ */ jsxs("h2", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-4 flex items-center", children: [
4795
+ getIcon(section.icon),
4796
+ section.title
4797
+ ] }),
4798
+ /* @__PURE__ */ jsx("ul", { className: "space-y-2", children: section.links.map((link, linkIndex) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
4799
+ LinkComponent,
4800
+ {
4801
+ href: link.path,
4802
+ className: "group flex items-start text-sm hover:text-blue-600 dark:hover:text-blue-400 transition-colors",
4803
+ children: [
4804
+ /* @__PURE__ */ jsx(ChevronRightIcon, { className: "w-4 h-4 mt-0.5 mr-2 flex-shrink-0 text-gray-400 group-hover:text-blue-600 dark:group-hover:text-blue-400" }),
4805
+ /* @__PURE__ */ jsxs("div", { children: [
4806
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-gray-700 dark:text-gray-300 group-hover:text-blue-600 dark:group-hover:text-blue-400", children: link.label }),
4807
+ link.description && /* @__PURE__ */ jsx("span", { className: "block text-xs text-gray-500 dark:text-gray-400 mt-0.5", children: link.description })
4808
+ ] })
4809
+ ]
4810
+ }
4811
+ ) }, linkIndex)) })
4812
+ ]
4813
+ },
4814
+ index
4815
+ )) }),
4816
+ quickLinks.length > 0 && /* @__PURE__ */ jsxs("div", { className: "mt-12 p-6 bg-gray-50 dark:bg-gray-900 rounded-lg", children: [
4817
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mb-4", children: text.quickLinksTitle }),
4818
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3", children: quickLinks.map((link, index) => {
4819
+ const baseClasses = "inline-flex items-center px-4 py-2 rounded-lg transition-colors";
4820
+ const variantClasses = link.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700" : link.variant === "secondary" ? "bg-gray-600 text-white hover:bg-gray-700" : "border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800";
4821
+ return /* @__PURE__ */ jsxs(
4822
+ LinkComponent,
4823
+ {
4824
+ href: link.path,
4825
+ className: `${baseClasses} ${variantClasses}`,
4826
+ children: [
4827
+ link.icon === "envelope" && /* @__PURE__ */ jsx(EnvelopeIcon, { className: "w-5 h-5 mr-2" }),
4828
+ link.icon === "document" && /* @__PURE__ */ jsx(DocumentTextIcon, { className: "w-5 h-5 mr-2" }),
4829
+ link.label
4830
+ ]
4831
+ },
4832
+ index
4833
+ );
4834
+ }) })
4835
+ ] })
4836
+ ] });
4837
+ if (PageWrapper) {
4838
+ return /* @__PURE__ */ jsx(PageWrapper, { children: content });
4839
+ }
4840
+ return content;
4841
+ };
4842
+ const SectionHeading$1 = ({ children }) => /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mt-8 mb-4", children });
4843
+ const SubsectionHeading = ({ children }) => /* @__PURE__ */ jsx("h3", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100 mt-6 mb-3", children });
4844
+ const Paragraph$1 = ({
4845
+ children,
4846
+ className = ""
4847
+ }) => /* @__PURE__ */ jsx("p", { className: `text-gray-600 dark:text-gray-300 mb-6 ${className}`, children });
4848
+ const List$1 = ({ items }) => /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside text-gray-600 dark:text-gray-300 mb-6", children: items.map((item, index) => /* @__PURE__ */ jsx("li", { children: item }, index)) });
4849
+ const AppPrivacyPolicyPage = ({
4850
+ text,
4851
+ lastUpdatedDate = (/* @__PURE__ */ new Date()).toLocaleDateString(),
4852
+ PageWrapper,
4853
+ className
4854
+ }) => {
4855
+ const content = /* @__PURE__ */ jsxs("div", { className: `max-w-7xl mx-auto px-4 py-12 ${className || ""}`, children: [
4856
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl font-bold text-gray-900 dark:text-gray-100 mb-8", children: text.heading }),
4857
+ /* @__PURE__ */ jsxs("div", { className: "prose prose-lg max-w-none", children: [
4858
+ /* @__PURE__ */ jsxs(Paragraph$1, { className: "mb-6", children: [
4859
+ text.lastUpdatedLabel,
4860
+ " ",
4861
+ lastUpdatedDate
4862
+ ] }),
4863
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.introduction.title }),
4864
+ /* @__PURE__ */ jsx(Paragraph$1, { children: text.introduction.content }),
4865
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.informationWeCollect.title }),
4866
+ /* @__PURE__ */ jsx(SubsectionHeading, { children: text.informationWeCollect.youProvide.title }),
4867
+ /* @__PURE__ */ jsx(List$1, { items: text.informationWeCollect.youProvide.items }),
4868
+ /* @__PURE__ */ jsx(SubsectionHeading, { children: text.informationWeCollect.automatic.title }),
4869
+ /* @__PURE__ */ jsx(List$1, { items: text.informationWeCollect.automatic.items }),
4870
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.howWeUse.title }),
4871
+ text.howWeUse.description && /* @__PURE__ */ jsx(Paragraph$1, { className: "mb-4", children: text.howWeUse.description }),
4872
+ /* @__PURE__ */ jsx(List$1, { items: text.howWeUse.items }),
4873
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.informationSharing.title }),
4874
+ text.informationSharing.description && /* @__PURE__ */ jsx(Paragraph$1, { className: "mb-4", children: text.informationSharing.description }),
4875
+ /* @__PURE__ */ jsx(List$1, { items: text.informationSharing.items }),
4876
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.dataSecurity.title }),
4877
+ text.dataSecurity.description && /* @__PURE__ */ jsx(Paragraph$1, { className: "mb-4", children: text.dataSecurity.description }),
4878
+ /* @__PURE__ */ jsx(List$1, { items: text.dataSecurity.items }),
4879
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.dataRetention.title }),
4880
+ /* @__PURE__ */ jsx(Paragraph$1, { children: text.dataRetention.content }),
4881
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.privacyRights.title }),
4882
+ text.privacyRights.description && /* @__PURE__ */ jsx(Paragraph$1, { className: "mb-4", children: text.privacyRights.description }),
4883
+ /* @__PURE__ */ jsx(List$1, { items: text.privacyRights.items }),
4884
+ text.web3Considerations && /* @__PURE__ */ jsxs(Fragment, { children: [
4885
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.web3Considerations.title }),
4886
+ text.web3Considerations.description && /* @__PURE__ */ jsx(Paragraph$1, { className: "mb-4", children: text.web3Considerations.description }),
4887
+ /* @__PURE__ */ jsx(List$1, { items: text.web3Considerations.items })
4888
+ ] }),
4889
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.internationalTransfers.title }),
4890
+ /* @__PURE__ */ jsx(Paragraph$1, { children: text.internationalTransfers.content }),
4891
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.childrensPrivacy.title }),
4892
+ /* @__PURE__ */ jsx(Paragraph$1, { children: text.childrensPrivacy.content }),
4893
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.cookies.title }),
4894
+ /* @__PURE__ */ jsx(Paragraph$1, { children: /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: text.cookies.content } }) }),
4895
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.changes.title }),
4896
+ /* @__PURE__ */ jsx(Paragraph$1, { children: text.changes.content }),
4897
+ /* @__PURE__ */ jsx(SectionHeading$1, { children: text.contact.title }),
4898
+ /* @__PURE__ */ jsx(Paragraph$1, { children: text.contact.description }),
4899
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-50 dark:bg-gray-800 p-4 rounded-lg", children: /* @__PURE__ */ jsxs("p", { className: "text-gray-700 dark:text-gray-300", children: [
4900
+ text.contact.info.emailLabel,
4901
+ " ",
4902
+ /* @__PURE__ */ jsx(
4903
+ "a",
4904
+ {
4905
+ href: `mailto:${text.contact.info.email}`,
4906
+ className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",
4907
+ children: text.contact.info.email
4908
+ }
4909
+ ),
4910
+ /* @__PURE__ */ jsx("br", {}),
4911
+ text.contact.info.websiteLabel,
4912
+ " ",
4913
+ /* @__PURE__ */ jsx(
4914
+ "a",
4915
+ {
4916
+ href: text.contact.info.websiteUrl,
4917
+ className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",
4918
+ children: text.contact.info.websiteUrl
4919
+ }
4920
+ ),
4921
+ /* @__PURE__ */ jsx("br", {}),
4922
+ text.contact.info.dpoLabel,
4923
+ " ",
4924
+ /* @__PURE__ */ jsx(
4925
+ "a",
4926
+ {
4927
+ href: `mailto:${text.contact.info.dpoEmail}`,
4928
+ className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",
4929
+ children: text.contact.info.dpoEmail
4930
+ }
4931
+ )
4932
+ ] }) }),
4933
+ /* @__PURE__ */ jsxs("div", { className: "mt-8 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4934
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-blue-900 dark:text-blue-200 mb-2", children: text.contact.info.gdprTitle }),
4935
+ /* @__PURE__ */ jsxs("p", { className: "text-blue-800 dark:text-blue-300", children: [
4936
+ text.contact.info.gdprContent,
4937
+ " ",
4938
+ /* @__PURE__ */ jsx(
4939
+ "a",
4940
+ {
4941
+ href: `mailto:${text.contact.info.dpoEmail}`,
4942
+ className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",
4943
+ children: text.contact.info.dpoEmail
4944
+ }
4945
+ )
4946
+ ] })
4947
+ ] })
4948
+ ] })
4949
+ ] });
4950
+ if (PageWrapper) {
4951
+ return /* @__PURE__ */ jsx(PageWrapper, { children: content });
4952
+ }
4953
+ return content;
4954
+ };
4955
+ function isSectionWithList(section) {
4956
+ return "items" in section && Array.isArray(section.items);
4957
+ }
4958
+ const SectionHeading = ({ children }) => /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold text-gray-900 dark:text-gray-100 mt-8 mb-4", children });
4959
+ const Paragraph = ({
4960
+ children,
4961
+ className = ""
4962
+ }) => /* @__PURE__ */ jsx("p", { className: `text-gray-600 dark:text-gray-300 mb-6 ${className}`, children });
4963
+ const List = ({ items }) => /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside text-gray-600 dark:text-gray-300 mb-6", children: items.map((item, index) => /* @__PURE__ */ jsx("li", { children: item }, index)) });
4964
+ const AppTermsOfServicePage = ({
4965
+ text,
4966
+ lastUpdatedDate = (/* @__PURE__ */ new Date()).toLocaleDateString(),
4967
+ PageWrapper,
4968
+ className
4969
+ }) => {
4970
+ const content = /* @__PURE__ */ jsxs("div", { className: `max-w-7xl mx-auto px-4 py-12 ${className || ""}`, children: [
4971
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl font-bold text-gray-900 dark:text-gray-100 mb-8", children: text.title }),
4972
+ /* @__PURE__ */ jsxs("div", { className: "prose prose-lg dark:prose-invert max-w-none", children: [
4973
+ /* @__PURE__ */ jsx(Paragraph, { className: "mb-6", children: text.lastUpdated.replace("{{date}}", lastUpdatedDate) }),
4974
+ text.sections.map((section, index) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
4975
+ /* @__PURE__ */ jsx(SectionHeading, { children: section.title }),
4976
+ isSectionWithList(section) ? /* @__PURE__ */ jsxs(Fragment, { children: [
4977
+ section.description && /* @__PURE__ */ jsx(Paragraph, { className: "mb-4", children: section.description }),
4978
+ /* @__PURE__ */ jsx(List, { items: section.items }),
4979
+ section.additionalContent && /* @__PURE__ */ jsx(Paragraph, { children: section.additionalContent })
4980
+ ] }) : section.isHtml ? /* @__PURE__ */ jsx(Paragraph, { children: /* @__PURE__ */ jsx("span", { dangerouslySetInnerHTML: { __html: section.content } }) }) : /* @__PURE__ */ jsx(Paragraph, { children: section.content })
4981
+ ] }, index)),
4982
+ /* @__PURE__ */ jsx(SectionHeading, { children: text.contact.title }),
4983
+ text.contact.isHtml ? /* @__PURE__ */ jsx(Paragraph, { children: /* @__PURE__ */ jsx(
4984
+ "span",
4985
+ {
4986
+ dangerouslySetInnerHTML: { __html: text.contact.description }
4987
+ }
4988
+ ) }) : /* @__PURE__ */ jsx(Paragraph, { children: text.contact.description }),
4989
+ /* @__PURE__ */ jsx("div", { className: "bg-gray-50 dark:bg-gray-800 p-4 rounded-lg", children: /* @__PURE__ */ jsxs("p", { className: "text-gray-700 dark:text-gray-300", children: [
4990
+ text.contact.info.emailLabel,
4991
+ " ",
4992
+ /* @__PURE__ */ jsx(
4993
+ "a",
4994
+ {
4995
+ href: `mailto:${text.contact.info.email}`,
4996
+ className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",
4997
+ children: text.contact.info.email
4998
+ }
4999
+ ),
5000
+ /* @__PURE__ */ jsx("br", {}),
5001
+ text.contact.info.websiteLabel,
5002
+ " ",
5003
+ /* @__PURE__ */ jsx(
5004
+ "a",
5005
+ {
5006
+ href: text.contact.info.websiteUrl,
5007
+ className: "text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",
5008
+ children: text.contact.info.websiteUrl
5009
+ }
5010
+ )
5011
+ ] }) })
5012
+ ] })
5013
+ ] });
5014
+ if (PageWrapper) {
5015
+ return /* @__PURE__ */ jsx(PageWrapper, { children: content });
5016
+ }
5017
+ return content;
5018
+ };
4739
5019
  export {
4740
5020
  AppBreadcrumbs,
4741
5021
  AppFooter,
4742
5022
  AppFooterForHomePage,
4743
5023
  AppPageLayout,
4744
5024
  AppPricingPage,
5025
+ AppPrivacyPolicyPage,
5026
+ AppSitemapPage,
4745
5027
  AppSubscriptionsPage,
5028
+ AppTermsOfServicePage,
4746
5029
  AppTopBar,
4747
5030
  AppTopBarWithFirebaseAuth,
4748
5031
  AppTopBarWithWallet,