@opensite/ui 2.1.3 → 2.1.5

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
@@ -2611,6 +2611,70 @@ function CommunityInitiatives({
2611
2611
  }
2612
2612
  );
2613
2613
  }
2614
+ var MOBILE_CLASSES = {
2615
+ "fit-left": "items-start md:items-center",
2616
+ "fit-center": "items-center",
2617
+ "fit-right": "items-end md:items-center",
2618
+ "full-left": "items-stretch md:items-center",
2619
+ "full-center": "items-stretch md:items-center",
2620
+ "full-right": "items-stretch md:items-center"
2621
+ };
2622
+ function BlockActions({
2623
+ mobileConfig,
2624
+ actionsClassName,
2625
+ verticalSpacing = "mt-4 md:mt-8",
2626
+ actions,
2627
+ actionsSlot
2628
+ }) {
2629
+ const width = mobileConfig?.width ?? "full";
2630
+ const position = mobileConfig?.position ?? "center";
2631
+ const mobileLayoutClass = MOBILE_CLASSES[`${width}-${position}`];
2632
+ if (actionsSlot) {
2633
+ return /* @__PURE__ */ jsx("div", { children: actionsSlot });
2634
+ } else if (actions && actions?.length > 0) {
2635
+ return /* @__PURE__ */ jsx(
2636
+ "div",
2637
+ {
2638
+ className: cn(
2639
+ "flex flex-col md:flex-row flex-wrap gap-4",
2640
+ mobileLayoutClass,
2641
+ actionsClassName,
2642
+ verticalSpacing
2643
+ ),
2644
+ children: actions.map((action, index) => /* @__PURE__ */ jsx(ActionComponent, { action }, index))
2645
+ }
2646
+ );
2647
+ } else {
2648
+ return null;
2649
+ }
2650
+ }
2651
+ function ActionComponent({ action }) {
2652
+ const {
2653
+ label,
2654
+ icon,
2655
+ iconAfter,
2656
+ children,
2657
+ href,
2658
+ onClick,
2659
+ className: actionClassName,
2660
+ ...pressableProps
2661
+ } = action;
2662
+ return /* @__PURE__ */ jsx(
2663
+ Pressable,
2664
+ {
2665
+ href,
2666
+ onClick,
2667
+ asButton: action.asButton ?? true,
2668
+ className: actionClassName,
2669
+ ...pressableProps,
2670
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
2671
+ icon,
2672
+ label,
2673
+ iconAfter
2674
+ ] })
2675
+ }
2676
+ );
2677
+ }
2614
2678
  function AboutCultureTabs({
2615
2679
  badgeText,
2616
2680
  heading,
@@ -2624,7 +2688,7 @@ function AboutCultureTabs({
2624
2688
  ctaImages,
2625
2689
  ctaImagesSlot,
2626
2690
  className,
2627
- containerClassName,
2691
+ containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
2628
2692
  headerClassName,
2629
2693
  badgeClassName,
2630
2694
  headingClassName,
@@ -2636,45 +2700,33 @@ function AboutCultureTabs({
2636
2700
  actionsClassName,
2637
2701
  optixFlowConfig,
2638
2702
  background,
2639
- spacing,
2703
+ spacing = "xl",
2640
2704
  pattern,
2641
2705
  patternOpacity
2642
2706
  }) {
2643
2707
  const resolvedAspects = aspects ?? [];
2644
- const [activeTab, setActiveTab] = React4.useState(resolvedAspects[0]?.id || "");
2645
- const actionsContent = useMemo(() => {
2646
- if (actionsSlot) return actionsSlot;
2647
- if (!actions || actions.length === 0) return null;
2648
- return actions.map((action, index) => {
2649
- const { label, icon, iconAfter, children, className: actionClassName, ...pressableProps } = action;
2650
- return /* @__PURE__ */ jsx(
2651
- Pressable,
2652
- {
2653
- asButton: true,
2654
- className: actionClassName,
2655
- ...pressableProps,
2656
- children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
2657
- icon,
2658
- label,
2659
- iconAfter
2660
- ] })
2661
- },
2662
- index
2663
- );
2664
- });
2665
- }, [actionsSlot, actions]);
2708
+ const [activeTab, setActiveTab] = React4.useState(
2709
+ resolvedAspects[0]?.id || ""
2710
+ );
2666
2711
  const ctaImagesContent = useMemo(() => {
2667
2712
  if (ctaImagesSlot) return ctaImagesSlot;
2668
2713
  if (!ctaImages || ctaImages.length === 0) return null;
2669
- return ctaImages.map((src, i) => /* @__PURE__ */ jsx("div", { className: "relative aspect-square overflow-hidden rounded-md", children: /* @__PURE__ */ jsx(
2670
- Img,
2714
+ return ctaImages.map((src, i) => /* @__PURE__ */ jsx(
2715
+ "div",
2671
2716
  {
2672
- src,
2673
- alt: "Team culture",
2674
- className: "h-full w-full object-cover",
2675
- optixFlowConfig
2676
- }
2677
- ) }, i));
2717
+ className: "relative aspect-square overflow-hidden rounded-md",
2718
+ children: /* @__PURE__ */ jsx(
2719
+ Img,
2720
+ {
2721
+ src,
2722
+ alt: "Team culture",
2723
+ className: "h-full w-full object-cover",
2724
+ optixFlowConfig
2725
+ }
2726
+ )
2727
+ },
2728
+ i
2729
+ ));
2678
2730
  }, [ctaImagesSlot, ctaImages, optixFlowConfig]);
2679
2731
  return /* @__PURE__ */ jsxs(
2680
2732
  Section,
@@ -2683,14 +2735,32 @@ function AboutCultureTabs({
2683
2735
  spacing,
2684
2736
  pattern,
2685
2737
  patternOpacity,
2686
- className: cn(className),
2738
+ className,
2687
2739
  containerClassName,
2688
2740
  children: [
2689
- /* @__PURE__ */ jsxs("div", { className: cn("mx-auto mb-12 max-w-3xl space-y-4 text-center", headerClassName), children: [
2690
- badgeText && (typeof badgeText === "string" ? /* @__PURE__ */ jsx("div", { className: cn("inline-block rounded-lg bg-primary/10 px-3 py-1 text-sm", getAccentColor(background), badgeClassName), children: badgeText }) : /* @__PURE__ */ jsx("div", { className: badgeClassName, children: badgeText })),
2691
- heading && (typeof heading === "string" ? /* @__PURE__ */ jsx("h2", { className: cn("text-3xl font-bold tracking-tight md:text-4xl", headingClassName), children: heading }) : /* @__PURE__ */ jsx("div", { className: headingClassName, children: heading })),
2692
- description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn(getTextColor(background, "muted"), descriptionClassName), children: description }) : /* @__PURE__ */ jsx("div", { className: descriptionClassName, children: description }))
2693
- ] }),
2741
+ /* @__PURE__ */ jsxs(
2742
+ "div",
2743
+ {
2744
+ className: cn(
2745
+ "mx-auto mb-12 max-w-full md:max-w-md space-y-4 text-center flex flex-col items-center justify-center",
2746
+ headerClassName
2747
+ ),
2748
+ children: [
2749
+ badgeText && (typeof badgeText === "string" ? /* @__PURE__ */ jsx(Badge, { className: cn("px-3 py-1", badgeClassName), children: badgeText }) : badgeText),
2750
+ heading && (typeof heading === "string" ? /* @__PURE__ */ jsx(
2751
+ "h2",
2752
+ {
2753
+ className: cn(
2754
+ "text-3xl font-bold tracking-tight md:text-4xl text-pretty",
2755
+ headingClassName
2756
+ ),
2757
+ children: heading
2758
+ }
2759
+ ) : heading),
2760
+ description && (typeof description === "string" ? /* @__PURE__ */ jsx("p", { className: cn("text-balance", descriptionClassName), children: description }) : description)
2761
+ ]
2762
+ }
2763
+ ),
2694
2764
  aspectsSlot ? aspectsSlot : resolvedAspects.length > 0 ? /* @__PURE__ */ jsxs(
2695
2765
  Tabs,
2696
2766
  {
@@ -2703,80 +2773,103 @@ function AboutCultureTabs({
2703
2773
  TabsTrigger,
2704
2774
  {
2705
2775
  value: aspect.id,
2706
- className: cn("px-3 py-2.5", `data-[state=active]:${getAccentColor(background)}`, "data-[state=active]:text-primary-foreground"),
2776
+ className: cn("px-3 py-2.5"),
2707
2777
  children: aspect.title
2708
2778
  },
2709
2779
  aspect.id
2710
2780
  )) }) }),
2711
- resolvedAspects.map((aspect) => /* @__PURE__ */ jsxs(TabsContent, { value: aspect.id, className: "space-y-8", children: [
2712
- /* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2", children: [
2713
- /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2714
- /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold tracking-tight", children: aspect.title }),
2715
- /* @__PURE__ */ jsx("p", { className: cn("leading-relaxed", getTextColor(background, "muted")), children: aspect.description })
2716
- ] }),
2717
- /* @__PURE__ */ jsx(Card, { className: "border-0 bg-gradient-to-br from-primary/5 to-primary/10 p-0", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 p-6 pt-6", children: [
2718
- /* @__PURE__ */ jsx(
2719
- DynamicIcon,
2720
- {
2721
- name: "lucide/quote",
2722
- size: 32,
2723
- className: cn(getAccentColor(background), "opacity-40")
2724
- }
2725
- ),
2726
- /* @__PURE__ */ jsxs("p", { className: cn("italic", getTextColor(background, "muted")), children: [
2727
- '"',
2728
- aspect.testimonial.quote,
2729
- '"'
2781
+ resolvedAspects.map((aspect) => /* @__PURE__ */ jsxs(
2782
+ TabsContent,
2783
+ {
2784
+ value: aspect.id,
2785
+ className: "space-y-8",
2786
+ children: [
2787
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-6 md:grid-cols-2", children: [
2788
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
2789
+ /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold tracking-tight", children: aspect.title }),
2790
+ /* @__PURE__ */ jsx("p", { className: cn("leading-relaxed"), children: aspect.description })
2791
+ ] }),
2792
+ /* @__PURE__ */ jsx(Card, { className: "border-0 p-0", children: /* @__PURE__ */ jsxs(CardContent, { className: "space-y-4 p-6 pt-6", children: [
2793
+ /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/quote", size: 32 }),
2794
+ /* @__PURE__ */ jsxs("p", { className: "italic", children: [
2795
+ '"',
2796
+ aspect.testimonial.quote,
2797
+ '"'
2798
+ ] }),
2799
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 pt-2", children: [
2800
+ /* @__PURE__ */ jsx("div", { className: "relative h-10 w-10 overflow-hidden rounded-full", children: /* @__PURE__ */ jsx(
2801
+ Img,
2802
+ {
2803
+ src: aspect.testimonial.avatar,
2804
+ alt: aspect.testimonial.author,
2805
+ className: "h-full w-full object-cover",
2806
+ optixFlowConfig
2807
+ }
2808
+ ) }),
2809
+ /* @__PURE__ */ jsxs("div", { children: [
2810
+ /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium", children: aspect.testimonial.author }),
2811
+ /* @__PURE__ */ jsx("p", { className: "text-xs", children: aspect.testimonial.role })
2812
+ ] })
2813
+ ] })
2814
+ ] }) })
2730
2815
  ] }),
2731
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 pt-2", children: [
2732
- /* @__PURE__ */ jsx("div", { className: "relative h-10 w-10 overflow-hidden rounded-full", children: /* @__PURE__ */ jsx(
2733
- Img,
2734
- {
2735
- src: aspect.testimonial.avatar,
2736
- alt: aspect.testimonial.author,
2737
- className: "h-full w-full object-cover",
2738
- optixFlowConfig
2739
- }
2740
- ) }),
2741
- /* @__PURE__ */ jsxs("div", { children: [
2742
- /* @__PURE__ */ jsx("h4", { className: "text-sm font-medium", children: aspect.testimonial.author }),
2743
- /* @__PURE__ */ jsx("p", { className: cn("text-xs", getTextColor(background, "muted")), children: aspect.testimonial.role })
2744
- ] })
2745
- ] })
2746
- ] }) })
2747
- ] }),
2748
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: aspect.images.map((image, idx) => /* @__PURE__ */ jsx(
2749
- "div",
2750
- {
2751
- className: "relative aspect-[4/3] overflow-hidden rounded-lg",
2752
- children: /* @__PURE__ */ jsx(
2753
- Img,
2816
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-3", children: aspect.images.map((image, idx) => /* @__PURE__ */ jsx(
2817
+ "div",
2754
2818
  {
2755
- src: image,
2756
- alt: `${aspect.title} culture`,
2757
- className: "h-full w-full transform object-cover transition-transform duration-500 hover:scale-105",
2758
- optixFlowConfig
2759
- }
2760
- )
2761
- },
2762
- idx
2763
- )) })
2764
- ] }, aspect.id))
2819
+ className: "relative aspect-4/3 overflow-hidden rounded-lg",
2820
+ children: /* @__PURE__ */ jsx(
2821
+ Img,
2822
+ {
2823
+ src: image,
2824
+ alt: `${aspect.title} culture`,
2825
+ className: "h-full w-full transform object-cover transition-transform duration-500 hover:scale-105",
2826
+ optixFlowConfig
2827
+ }
2828
+ )
2829
+ },
2830
+ idx
2831
+ )) })
2832
+ ]
2833
+ },
2834
+ aspect.id
2835
+ ))
2765
2836
  ]
2766
2837
  }
2767
2838
  ) : null,
2768
- /* @__PURE__ */ jsxs("div", { className: cn("relative mt-16 rounded-xl border bg-background p-8 md:p-12", ctaClassName), children: [
2769
- /* @__PURE__ */ jsxs("div", { className: "grid items-center gap-8 md:grid-cols-2", children: [
2770
- /* @__PURE__ */ jsxs("div", { children: [
2771
- ctaHeading && (typeof ctaHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: cn("mb-4 text-2xl font-bold", ctaHeadingClassName), children: ctaHeading }) : /* @__PURE__ */ jsx("div", { className: cn("mb-4", ctaHeadingClassName), children: ctaHeading })),
2772
- ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mb-6", getTextColor(background, "muted"), ctaDescriptionClassName), children: ctaDescription }) : /* @__PURE__ */ jsx("div", { className: cn("mb-6", ctaDescriptionClassName), children: ctaDescription })),
2773
- (actionsSlot || actions && actions.length > 0) && /* @__PURE__ */ jsx("div", { className: cn("flex gap-4", actionsClassName), children: actionsContent })
2774
- ] }),
2775
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-2", children: ctaImagesContent })
2776
- ] }),
2777
- /* @__PURE__ */ jsx("div", { className: "absolute -left-5 -top-5 h-10 w-10 rounded-full bg-primary/10" }),
2778
- /* @__PURE__ */ jsx("div", { className: "absolute -bottom-5 -right-5 h-10 w-10 rounded-full bg-primary/10" })
2779
- ] })
2839
+ /* @__PURE__ */ jsxs(
2840
+ "div",
2841
+ {
2842
+ className: cn(
2843
+ "relative mt-16 rounded-xl border p-8 md:p-12",
2844
+ ctaClassName
2845
+ ),
2846
+ children: [
2847
+ /* @__PURE__ */ jsxs("div", { className: "grid items-center gap-8 md:grid-cols-2", children: [
2848
+ /* @__PURE__ */ jsxs("div", { children: [
2849
+ ctaHeading && (typeof ctaHeading === "string" ? /* @__PURE__ */ jsx(
2850
+ "h3",
2851
+ {
2852
+ className: cn("mb-4 text-2xl font-bold", ctaHeadingClassName),
2853
+ children: ctaHeading
2854
+ }
2855
+ ) : ctaHeading),
2856
+ ctaDescription && (typeof ctaDescription === "string" ? /* @__PURE__ */ jsx("p", { className: cn("mb-6", ctaDescriptionClassName), children: ctaDescription }) : ctaDescription),
2857
+ /* @__PURE__ */ jsx(
2858
+ BlockActions,
2859
+ {
2860
+ actions,
2861
+ actionsSlot,
2862
+ actionsClassName
2863
+ }
2864
+ )
2865
+ ] }),
2866
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-3 gap-2", children: ctaImagesContent })
2867
+ ] }),
2868
+ /* @__PURE__ */ jsx("div", { className: "absolute -left-5 -top-5 h-10 w-10 rounded-full bg-primary/10" }),
2869
+ /* @__PURE__ */ jsx("div", { className: "absolute -bottom-5 -right-5 h-10 w-10 rounded-full bg-primary/10" })
2870
+ ]
2871
+ }
2872
+ )
2780
2873
  ]
2781
2874
  }
2782
2875
  );