@opensite/ui 3.3.0 → 3.3.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.
Files changed (43) hide show
  1. package/dist/article-breadcrumb-social.cjs +4 -7
  2. package/dist/article-breadcrumb-social.d.cts +2 -11
  3. package/dist/article-breadcrumb-social.d.ts +2 -11
  4. package/dist/article-breadcrumb-social.js +4 -7
  5. package/dist/article-chapters-author.cjs +3 -6
  6. package/dist/article-chapters-author.d.cts +2 -11
  7. package/dist/article-chapters-author.d.ts +2 -11
  8. package/dist/article-chapters-author.js +3 -6
  9. package/dist/article-compact-toc.cjs +4 -7
  10. package/dist/article-compact-toc.d.cts +2 -11
  11. package/dist/article-compact-toc.d.ts +2 -11
  12. package/dist/article-compact-toc.js +4 -7
  13. package/dist/article-hero-prose.cjs +4 -7
  14. package/dist/article-hero-prose.d.cts +2 -11
  15. package/dist/article-hero-prose.d.ts +2 -11
  16. package/dist/article-hero-prose.js +4 -7
  17. package/dist/article-sidebar-sticky.cjs +3 -6
  18. package/dist/article-sidebar-sticky.d.cts +2 -11
  19. package/dist/article-sidebar-sticky.d.ts +2 -11
  20. package/dist/article-sidebar-sticky.js +3 -6
  21. package/dist/article-toc-sidebar.cjs +3 -6
  22. package/dist/article-toc-sidebar.d.cts +1 -10
  23. package/dist/article-toc-sidebar.d.ts +1 -10
  24. package/dist/article-toc-sidebar.js +3 -6
  25. package/dist/feature-capabilities-grid.cjs +10 -43
  26. package/dist/feature-capabilities-grid.d.cts +0 -4
  27. package/dist/feature-capabilities-grid.d.ts +0 -4
  28. package/dist/feature-capabilities-grid.js +10 -43
  29. package/dist/hero-conversation-intelligence.cjs +1 -1
  30. package/dist/hero-conversation-intelligence.js +1 -1
  31. package/dist/longform-content.cjs +1 -1
  32. package/dist/longform-content.d.cts +1 -1
  33. package/dist/longform-content.d.ts +1 -1
  34. package/dist/longform-content.js +1 -1
  35. package/dist/navbar-mega-menu.cjs +14 -5
  36. package/dist/navbar-mega-menu.js +14 -5
  37. package/dist/registry.cjs +64 -117
  38. package/dist/registry.js +64 -117
  39. package/dist/stats-growth-timeline.cjs +87 -64
  40. package/dist/stats-growth-timeline.d.cts +5 -1
  41. package/dist/stats-growth-timeline.d.ts +5 -1
  42. package/dist/stats-growth-timeline.js +88 -65
  43. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { clsx } from 'clsx';
5
5
  import { twMerge } from 'tailwind-merge';
6
6
  import { Slot } from '@radix-ui/react-slot';
7
7
  import { cva } from 'class-variance-authority';
8
- import { jsx, jsxs } from 'react/jsx-runtime';
8
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
9
  import { Icon } from '@page-speed/icon';
10
10
  import { Pressable } from '@page-speed/pressable';
11
11
 
@@ -13,36 +13,6 @@ import { Pressable } from '@page-speed/pressable';
13
13
  function cn(...inputs) {
14
14
  return twMerge(clsx(inputs));
15
15
  }
16
- function getNestedCardBg(parentBg, variant = "muted", options) {
17
- const isDark = parentBg === "dark" || parentBg === "secondary" || parentBg === "primary";
18
- if (isDark) {
19
- switch (variant) {
20
- case "muted":
21
- return "bg-background";
22
- case "card":
23
- return "bg-card";
24
- case "accent":
25
- return "bg-accent";
26
- case "subtle":
27
- return "bg-background/50";
28
- }
29
- } else {
30
- switch (variant) {
31
- case "muted":
32
- return "bg-muted";
33
- case "card":
34
- return "bg-card";
35
- case "accent":
36
- return "bg-accent";
37
- case "subtle":
38
- return "bg-muted/50";
39
- }
40
- }
41
- }
42
- function getNestedCardTextColor(parentBg, options) {
43
- const isDark = parentBg === "dark" || parentBg === "secondary" || parentBg === "primary";
44
- return isDark ? "text-foreground" : "";
45
- }
46
16
  var badgeVariants = cva(
47
17
  "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
48
18
  {
@@ -459,6 +429,70 @@ var Section = React__default.forwardRef(
459
429
  }
460
430
  );
461
431
  Section.displayName = "Section";
432
+ var MOBILE_CLASSES = {
433
+ "fit-left": "items-start md:items-center",
434
+ "fit-center": "items-center",
435
+ "fit-right": "items-end md:items-center",
436
+ "full-left": "items-stretch md:items-center",
437
+ "full-center": "items-stretch md:items-center",
438
+ "full-right": "items-stretch md:items-center"
439
+ };
440
+ function BlockActions({
441
+ mobileConfig,
442
+ actionsClassName,
443
+ verticalSpacing = "mt-4 md:mt-8",
444
+ actions,
445
+ actionsSlot
446
+ }) {
447
+ const width = mobileConfig?.width ?? "full";
448
+ const position = mobileConfig?.position ?? "center";
449
+ const mobileLayoutClass = MOBILE_CLASSES[`${width}-${position}`];
450
+ if (actionsSlot) {
451
+ return /* @__PURE__ */ jsx("div", { children: actionsSlot });
452
+ } else if (actions && actions?.length > 0) {
453
+ return /* @__PURE__ */ jsx(
454
+ "div",
455
+ {
456
+ className: cn(
457
+ "flex flex-col md:flex-row flex-wrap gap-4",
458
+ mobileLayoutClass,
459
+ actionsClassName,
460
+ verticalSpacing
461
+ ),
462
+ children: actions.map((action, index) => /* @__PURE__ */ jsx(ActionComponent, { action }, index))
463
+ }
464
+ );
465
+ } else {
466
+ return null;
467
+ }
468
+ }
469
+ function ActionComponent({ action }) {
470
+ const {
471
+ label,
472
+ icon,
473
+ iconAfter,
474
+ children,
475
+ href,
476
+ onClick,
477
+ className: actionClassName,
478
+ ...pressableProps
479
+ } = action;
480
+ return /* @__PURE__ */ jsx(
481
+ Pressable,
482
+ {
483
+ href,
484
+ onClick,
485
+ asButton: action.asButton ?? true,
486
+ className: actionClassName,
487
+ ...pressableProps,
488
+ children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [
489
+ icon,
490
+ label,
491
+ iconAfter
492
+ ] })
493
+ }
494
+ );
495
+ }
462
496
  function StatsGrowthTimeline({
463
497
  sectionId = "stats-growth-timeline",
464
498
  badge,
@@ -475,6 +509,7 @@ function StatsGrowthTimeline({
475
509
  futureSlot,
476
510
  actions,
477
511
  actionsSlot,
512
+ actionsClassName,
478
513
  background,
479
514
  pattern,
480
515
  patternOpacity,
@@ -521,19 +556,18 @@ function StatsGrowthTimeline({
521
556
  "div",
522
557
  {
523
558
  className: cn(
524
- "mb-4 inline-flex h-9 w-20 items-center justify-center rounded-full text-sm font-semibold",
525
- getNestedCardBg(background, "muted"),
526
- getNestedCardTextColor(background)
559
+ "bg-muted text-muted-foreground",
560
+ "mb-4 inline-flex h-fit py-2 w-fit px-4 items-center justify-center rounded-full text-sm font-semibold"
527
561
  ),
528
562
  children: milestone.year
529
563
  }
530
564
  ),
531
- milestone.title && (typeof milestone.title === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-2 text-xl font-bold", children: milestone.title }) : /* @__PURE__ */ jsx("div", { className: "mb-2", children: milestone.title })),
532
- milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 text-muted-foreground", children: milestone.description }) : /* @__PURE__ */ jsx("div", { className: "mb-4", children: milestone.description })),
565
+ milestone.title && (typeof milestone.title === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-2 text-xl font-bold", children: milestone.title }) : milestone.title),
566
+ milestone.description && (typeof milestone.description === "string" ? /* @__PURE__ */ jsx("p", { className: "mb-4 text-muted-foreground", children: milestone.description }) : milestone.description),
533
567
  milestone.metric && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 rounded-lg border bg-background p-4 shadow-sm", children: [
534
568
  renderMilestoneIcon(milestone),
535
569
  /* @__PURE__ */ jsxs("div", { children: [
536
- /* @__PURE__ */ jsx("div", { className: "text-3xl font-bold text-primary", children: milestone.metric.value }),
570
+ /* @__PURE__ */ jsx("div", { className: "text-2xl font-bold text-primary", children: milestone.metric.value }),
537
571
  milestone.metric.label && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: milestone.metric.label })
538
572
  ] })
539
573
  ] })
@@ -559,16 +593,15 @@ function StatsGrowthTimeline({
559
593
  "div",
560
594
  {
561
595
  className: cn(
562
- "mt-24 rounded-lg p-8",
563
- getNestedCardBg(background, "muted"),
564
- getNestedCardTextColor(background),
596
+ "p-6 md:p-12 bg-card text-card-foreground",
597
+ "mt-24 rounded-lg border border-border shadow-md",
565
598
  currentStatsClassName
566
599
  ),
567
600
  children: [
568
- currentStatsHeading && (typeof currentStatsHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-6 text-center text-2xl font-bold", children: currentStatsHeading }) : /* @__PURE__ */ jsx("div", { className: "mb-6 text-center", children: currentStatsHeading })),
601
+ currentStatsHeading && (typeof currentStatsHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-12 text-center text-4xl lg:text-5xl font-bold", children: currentStatsHeading }) : currentStatsHeading),
569
602
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-8 md:grid-cols-4", children: currentStats.map((stat, index) => /* @__PURE__ */ jsxs("div", { className: cn("text-center", stat.className), children: [
570
- /* @__PURE__ */ jsx("div", { className: "mb-2 text-3xl font-bold text-primary md:text-4xl", children: stat.value }),
571
- stat.label && /* @__PURE__ */ jsx("p", { className: "font-medium text-muted-foreground", children: stat.label })
603
+ /* @__PURE__ */ jsx("div", { className: "text-2xl font-semibold text-primary md:text-3xl xl:text-4xl", children: stat.value }),
604
+ stat.label && /* @__PURE__ */ jsx("p", { className: "font-medium text-balance text-sm", children: stat.label })
572
605
  ] }, index)) })
573
606
  ]
574
607
  }
@@ -580,39 +613,29 @@ function StatsGrowthTimeline({
580
613
  currentStatsHeading,
581
614
  currentStatsClassName
582
615
  ]);
583
- const actionsContent = useMemo(() => {
584
- if (actionsSlot) return actionsSlot;
585
- if (!actions || actions.length === 0) return null;
586
- return actions.map((action, index) => /* @__PURE__ */ jsxs(
587
- Pressable,
588
- {
589
- href: action.href,
590
- onClick: action.onClick,
591
- variant: action.variant,
592
- className: "inline-flex items-center font-medium text-primary hover:underline",
593
- children: [
594
- action.label,
595
- /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-right", size: 16, className: "ml-2" })
596
- ]
597
- },
598
- index
599
- ));
600
- }, [actionsSlot, actions]);
601
616
  const futureContent = useMemo(() => {
602
617
  if (futureSlot) return futureSlot;
603
618
  if (!futureHeading && !futureDescription && (!actions || actions.length === 0))
604
619
  return null;
605
620
  return /* @__PURE__ */ jsxs("div", { className: cn("mt-16 text-center", futureClassName), children: [
606
621
  futureHeading && (typeof futureHeading === "string" ? /* @__PURE__ */ jsx("h3", { className: "mb-4 text-2xl font-bold", children: futureHeading }) : /* @__PURE__ */ jsx("div", { className: "mb-4", children: futureHeading })),
607
- futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "mx-auto mb-8 max-w-2xl text-muted-foreground", children: futureDescription }) : /* @__PURE__ */ jsx("div", { className: "mx-auto mb-8 max-w-2xl", children: futureDescription })),
608
- actionsContent
622
+ futureDescription && (typeof futureDescription === "string" ? /* @__PURE__ */ jsx("p", { className: "mx-auto mb-8 max-w-full md:max-w-lg text-balance", children: futureDescription }) : futureDescription),
623
+ /* @__PURE__ */ jsx(
624
+ BlockActions,
625
+ {
626
+ actions,
627
+ actionsSlot,
628
+ actionsClassName
629
+ }
630
+ )
609
631
  ] });
610
632
  }, [
611
633
  futureSlot,
612
634
  futureHeading,
613
635
  futureDescription,
614
636
  futureClassName,
615
- actionsContent,
637
+ actionsSlot,
638
+ actionsClassName,
616
639
  actions
617
640
  ]);
618
641
  const hasHeaderContent = !!(badge || badgeSlot || heading || description);
@@ -649,7 +672,7 @@ function StatsGrowthTimeline({
649
672
  ),
650
673
  children: description
651
674
  }
652
- ) : /* @__PURE__ */ jsx("div", { className: cn("mx-auto max-w-3xl", descriptionClassName), children: description }))
675
+ ) : description)
653
676
  ] }),
654
677
  milestonesContent,
655
678
  currentStatsContent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensite/ui",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "Foundational UI component library for OpenSite Semantic Site Builder with tree-shakable exports and abstract styling",
5
5
  "keywords": [
6
6
  "react",