@dmitriikapustin/ui 0.5.0 → 0.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.
package/dist/index.cjs CHANGED
@@ -1747,10 +1747,19 @@ function SegmentedControl({
1747
1747
  }
1748
1748
 
1749
1749
  // css-extract-scss:/Users/dimakozh/Desktop/projects/kapustin.cc/packages/ui/src/organisms/Header.module.scss
1750
- var __default44 = { "root": "Header-module_root", "container": "Header-module_container", "bar": "Header-module_bar", "leftGroup": "Header-module_leftGroup", "desktopNav": "Header-module_desktopNav", "navLink": "Header-module_navLink", "desktopActions": "Header-module_desktopActions", "mobileToggle": "Header-module_mobileToggle", "mobileMenu": "Header-module_mobileMenu", "mobileNav": "Header-module_mobileNav", "mobileActions": "Header-module_mobileActions" };
1751
- function Header({ logo, navItems = [], actions, className = "" }) {
1750
+ var __default44 = { "root": "Header-module_root", "container": "Header-module_container", "bar": "Header-module_bar", "leftGroup": "Header-module_leftGroup", "desktopNav": "Header-module_desktopNav", "navLink": "Header-module_navLink", "desktopActions": "Header-module_desktopActions", "mobileToggle": "Header-module_mobileToggle", "mobileMenu": "Header-module_mobileMenu", "mobileNav": "Header-module_mobileNav", "mobileActions": "Header-module_mobileActions", "minimal": "Header-module_minimal", "dark": "Header-module_dark" };
1751
+ function Header({
1752
+ logo,
1753
+ navItems = [],
1754
+ actions,
1755
+ variant = "pill",
1756
+ theme = "light",
1757
+ className = ""
1758
+ }) {
1752
1759
  const [mobileOpen, setMobileOpen] = react.useState(false);
1753
- return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: `${__default44.root}${className ? ` ${className}` : ""}`, children: [
1760
+ const variantClass = variant === "minimal" ? ` ${__default44.minimal}` : "";
1761
+ const themeClass = variant === "minimal" && theme === "dark" ? ` ${__default44.dark}` : "";
1762
+ return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: `${__default44.root}${variantClass}${themeClass}${className ? ` ${className}` : ""}`, children: [
1754
1763
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default44.container, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default44.bar, children: [
1755
1764
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default44.leftGroup, children: [
1756
1765
  logo,
@@ -2663,7 +2672,7 @@ function PromoDevicesCTA({
2663
2672
  }
2664
2673
 
2665
2674
  // css-extract-scss:/Users/dimakozh/Desktop/projects/kapustin.cc/packages/ui/src/organisms/PromoTestimonials.module.scss
2666
- var __default66 = { "root": "PromoTestimonials-module_root", "rootNoVertical": "PromoTestimonials-module_rootNoVertical", "wrapper": "PromoTestimonials-module_wrapper", "avatarSection": "PromoTestimonials-module_avatarSection", "avatarStack": "PromoTestimonials-module_avatarStack", "avatarRing": "PromoTestimonials-module_avatarRing", "overflowBadge": "PromoTestimonials-module_overflowBadge", "overflowCircle": "PromoTestimonials-module_overflowCircle", "headingSection": "PromoTestimonials-module_headingSection", "cardsSection": "PromoTestimonials-module_cardsSection", "cardsGrid": "PromoTestimonials-module_cardsGrid", "card": "PromoTestimonials-module_card", "quote": "PromoTestimonials-module_quote", "author": "PromoTestimonials-module_author", "authorInfo": "PromoTestimonials-module_authorInfo", "authorName": "PromoTestimonials-module_authorName", "authorRole": "PromoTestimonials-module_authorRole", "mediaSection": "PromoTestimonials-module_mediaSection", "mediaBox": "PromoTestimonials-module_mediaBox" };
2675
+ var __default66 = { "root": "PromoTestimonials-module_root", "rootNoVertical": "PromoTestimonials-module_rootNoVertical", "wrapper": "PromoTestimonials-module_wrapper", "avatarSection": "PromoTestimonials-module_avatarSection", "avatarStack": "PromoTestimonials-module_avatarStack", "avatarRing": "PromoTestimonials-module_avatarRing", "overflowBadge": "PromoTestimonials-module_overflowBadge", "overflowCircle": "PromoTestimonials-module_overflowCircle", "headingSection": "PromoTestimonials-module_headingSection", "rating": "PromoTestimonials-module_rating", "cardsSection": "PromoTestimonials-module_cardsSection", "cardsGrid": "PromoTestimonials-module_cardsGrid", "card": "PromoTestimonials-module_card", "quote": "PromoTestimonials-module_quote", "author": "PromoTestimonials-module_author", "authorInfo": "PromoTestimonials-module_authorInfo", "authorName": "PromoTestimonials-module_authorName", "authorRole": "PromoTestimonials-module_authorRole", "mediaSection": "PromoTestimonials-module_mediaSection", "mediaBox": "PromoTestimonials-module_mediaBox" };
2667
2676
  function PromoTestimonials({
2668
2677
  heading,
2669
2678
  subtitle,
@@ -2671,9 +2680,11 @@ function PromoTestimonials({
2671
2680
  media,
2672
2681
  verticalPadding = "default",
2673
2682
  headingSize = "lg",
2683
+ rating,
2674
2684
  className = ""
2675
2685
  }) {
2676
2686
  const noVerticalClass = verticalPadding === "none" ? ` ${__default66.rootNoVertical}` : "";
2687
+ const ratingCountLabel = rating && rating.count !== void 0 && rating.count > 0 ? rating.countLabel ? rating.countLabel(rating.count) : String(rating.count) : null;
2677
2688
  return /* @__PURE__ */ jsxRuntime.jsx("section", { className: `${__default66.root}${noVerticalClass}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default66.wrapper, children: [
2678
2689
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.avatarSection, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default66.avatarStack, children: [
2679
2690
  testimonials.slice(0, 5).map((t, i) => {
@@ -2700,7 +2711,17 @@ function PromoTestimonials({
2700
2711
  testimonials.length - 5
2701
2712
  ] }) })
2702
2713
  ] }) }),
2703
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.headingSection, children: /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }) }),
2714
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default66.headingSection, children: [
2715
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }),
2716
+ rating && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: __default66.rating, children: [
2717
+ rating.value.toFixed(1),
2718
+ " \u2605",
2719
+ ratingCountLabel && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2720
+ " \xB7 ",
2721
+ ratingCountLabel
2722
+ ] })
2723
+ ] })
2724
+ ] }),
2704
2725
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.cardsSection, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.cardsGrid, children: testimonials.map((t, i) => {
2705
2726
  const initials = t.name.split(" ").map((n) => n[0]).join("").toUpperCase();
2706
2727
  return /* @__PURE__ */ jsxRuntime.jsxs(
package/dist/index.d.cts CHANGED
@@ -557,9 +557,22 @@ interface HeaderProps {
557
557
  navItems?: NavItem[];
558
558
  /** Кнопки/контент справа (CTA). Если undefined — блок не рендерится. */
559
559
  actions?: ReactNode;
560
+ /**
561
+ * Визуальный вариант шапки.
562
+ * - `'pill'` (default, BC) — закруглённый pill с border и blur background, margin вокруг.
563
+ * - `'minimal'` — solid full-width, без border/margin (openai.com-style). При hover на один nav-link остальные становятся серыми.
564
+ */
565
+ variant?: 'pill' | 'minimal';
566
+ /**
567
+ * Цветовая тема. Применяется только при `variant='minimal'` — переопределяет bg/fg
568
+ * локально, независимо от глобальной темы страницы.
569
+ * - `'light'` (default) — белый фон, тёмный текст.
570
+ * - `'dark'` — тёмный фон (`--neutral-900`), светлый текст.
571
+ */
572
+ theme?: 'light' | 'dark';
560
573
  className?: string;
561
574
  }
562
- declare function Header({ logo, navItems, actions, className }: HeaderProps): react_jsx_runtime.JSX.Element;
575
+ declare function Header({ logo, navItems, actions, variant, theme, className, }: HeaderProps): react_jsx_runtime.JSX.Element;
563
576
 
564
577
  interface FooterColumn {
565
578
  title: string;
@@ -948,6 +961,17 @@ interface Testimonial {
948
961
  role: string;
949
962
  avatarSrc?: string;
950
963
  }
964
+ interface PromoTestimonialsRating {
965
+ /** Числовое значение рейтинга, например 4.9. Форматируется через `toFixed(1)`. */
966
+ value: number;
967
+ /** Кол-во отзывов. Если undefined / 0 — рендерится только `value ★`. */
968
+ count?: number;
969
+ /**
970
+ * Локализуемый формат count'а. Default — `${count}`. Передавай свою pluralization
971
+ * (например `(n) => \`${n} ${pluralRu(n, ['отзыв','отзыва','отзывов'])}\``).
972
+ */
973
+ countLabel?: (count: number) => string;
974
+ }
951
975
  interface PromoTestimonialsProps {
952
976
  heading: ReactNode;
953
977
  subtitle?: string;
@@ -964,9 +988,16 @@ interface PromoTestimonialsProps {
964
988
  * Используй `'md'` для density-aware admin / dashboard контекстов.
965
989
  */
966
990
  headingSize?: 'sm' | 'md' | 'lg';
991
+ /**
992
+ * Опциональная плашка рейтинга под heading: `«4.9 ★ · 530 отзывов»`.
993
+ * Стилизуется через token `--testimonial-rating-fg` (default `var(--fg-secondary)`).
994
+ * Pluralization count'а — на стороне потребителя через `countLabel` callback (пакет
995
+ * не тащит i18n).
996
+ */
997
+ rating?: PromoTestimonialsRating;
967
998
  className?: string;
968
999
  }
969
- declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
1000
+ declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, rating, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
970
1001
 
971
1002
  interface PromoHeroProps {
972
1003
  title: ReactNode;
package/dist/index.d.ts CHANGED
@@ -557,9 +557,22 @@ interface HeaderProps {
557
557
  navItems?: NavItem[];
558
558
  /** Кнопки/контент справа (CTA). Если undefined — блок не рендерится. */
559
559
  actions?: ReactNode;
560
+ /**
561
+ * Визуальный вариант шапки.
562
+ * - `'pill'` (default, BC) — закруглённый pill с border и blur background, margin вокруг.
563
+ * - `'minimal'` — solid full-width, без border/margin (openai.com-style). При hover на один nav-link остальные становятся серыми.
564
+ */
565
+ variant?: 'pill' | 'minimal';
566
+ /**
567
+ * Цветовая тема. Применяется только при `variant='minimal'` — переопределяет bg/fg
568
+ * локально, независимо от глобальной темы страницы.
569
+ * - `'light'` (default) — белый фон, тёмный текст.
570
+ * - `'dark'` — тёмный фон (`--neutral-900`), светлый текст.
571
+ */
572
+ theme?: 'light' | 'dark';
560
573
  className?: string;
561
574
  }
562
- declare function Header({ logo, navItems, actions, className }: HeaderProps): react_jsx_runtime.JSX.Element;
575
+ declare function Header({ logo, navItems, actions, variant, theme, className, }: HeaderProps): react_jsx_runtime.JSX.Element;
563
576
 
564
577
  interface FooterColumn {
565
578
  title: string;
@@ -948,6 +961,17 @@ interface Testimonial {
948
961
  role: string;
949
962
  avatarSrc?: string;
950
963
  }
964
+ interface PromoTestimonialsRating {
965
+ /** Числовое значение рейтинга, например 4.9. Форматируется через `toFixed(1)`. */
966
+ value: number;
967
+ /** Кол-во отзывов. Если undefined / 0 — рендерится только `value ★`. */
968
+ count?: number;
969
+ /**
970
+ * Локализуемый формат count'а. Default — `${count}`. Передавай свою pluralization
971
+ * (например `(n) => \`${n} ${pluralRu(n, ['отзыв','отзыва','отзывов'])}\``).
972
+ */
973
+ countLabel?: (count: number) => string;
974
+ }
951
975
  interface PromoTestimonialsProps {
952
976
  heading: ReactNode;
953
977
  subtitle?: string;
@@ -964,9 +988,16 @@ interface PromoTestimonialsProps {
964
988
  * Используй `'md'` для density-aware admin / dashboard контекстов.
965
989
  */
966
990
  headingSize?: 'sm' | 'md' | 'lg';
991
+ /**
992
+ * Опциональная плашка рейтинга под heading: `«4.9 ★ · 530 отзывов»`.
993
+ * Стилизуется через token `--testimonial-rating-fg` (default `var(--fg-secondary)`).
994
+ * Pluralization count'а — на стороне потребителя через `countLabel` callback (пакет
995
+ * не тащит i18n).
996
+ */
997
+ rating?: PromoTestimonialsRating;
967
998
  className?: string;
968
999
  }
969
- declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
1000
+ declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, rating, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
970
1001
 
971
1002
  interface PromoHeroProps {
972
1003
  title: ReactNode;
package/dist/index.js CHANGED
@@ -1741,10 +1741,19 @@ function SegmentedControl({
1741
1741
  }
1742
1742
 
1743
1743
  // css-extract-scss:/Users/dimakozh/Desktop/projects/kapustin.cc/packages/ui/src/organisms/Header.module.scss
1744
- var __default44 = { "root": "Header-module_root", "container": "Header-module_container", "bar": "Header-module_bar", "leftGroup": "Header-module_leftGroup", "desktopNav": "Header-module_desktopNav", "navLink": "Header-module_navLink", "desktopActions": "Header-module_desktopActions", "mobileToggle": "Header-module_mobileToggle", "mobileMenu": "Header-module_mobileMenu", "mobileNav": "Header-module_mobileNav", "mobileActions": "Header-module_mobileActions" };
1745
- function Header({ logo, navItems = [], actions, className = "" }) {
1744
+ var __default44 = { "root": "Header-module_root", "container": "Header-module_container", "bar": "Header-module_bar", "leftGroup": "Header-module_leftGroup", "desktopNav": "Header-module_desktopNav", "navLink": "Header-module_navLink", "desktopActions": "Header-module_desktopActions", "mobileToggle": "Header-module_mobileToggle", "mobileMenu": "Header-module_mobileMenu", "mobileNav": "Header-module_mobileNav", "mobileActions": "Header-module_mobileActions", "minimal": "Header-module_minimal", "dark": "Header-module_dark" };
1745
+ function Header({
1746
+ logo,
1747
+ navItems = [],
1748
+ actions,
1749
+ variant = "pill",
1750
+ theme = "light",
1751
+ className = ""
1752
+ }) {
1746
1753
  const [mobileOpen, setMobileOpen] = useState(false);
1747
- return /* @__PURE__ */ jsxs("header", { className: `${__default44.root}${className ? ` ${className}` : ""}`, children: [
1754
+ const variantClass = variant === "minimal" ? ` ${__default44.minimal}` : "";
1755
+ const themeClass = variant === "minimal" && theme === "dark" ? ` ${__default44.dark}` : "";
1756
+ return /* @__PURE__ */ jsxs("header", { className: `${__default44.root}${variantClass}${themeClass}${className ? ` ${className}` : ""}`, children: [
1748
1757
  /* @__PURE__ */ jsx("div", { className: __default44.container, children: /* @__PURE__ */ jsxs("div", { className: __default44.bar, children: [
1749
1758
  /* @__PURE__ */ jsxs("div", { className: __default44.leftGroup, children: [
1750
1759
  logo,
@@ -2657,7 +2666,7 @@ function PromoDevicesCTA({
2657
2666
  }
2658
2667
 
2659
2668
  // css-extract-scss:/Users/dimakozh/Desktop/projects/kapustin.cc/packages/ui/src/organisms/PromoTestimonials.module.scss
2660
- var __default66 = { "root": "PromoTestimonials-module_root", "rootNoVertical": "PromoTestimonials-module_rootNoVertical", "wrapper": "PromoTestimonials-module_wrapper", "avatarSection": "PromoTestimonials-module_avatarSection", "avatarStack": "PromoTestimonials-module_avatarStack", "avatarRing": "PromoTestimonials-module_avatarRing", "overflowBadge": "PromoTestimonials-module_overflowBadge", "overflowCircle": "PromoTestimonials-module_overflowCircle", "headingSection": "PromoTestimonials-module_headingSection", "cardsSection": "PromoTestimonials-module_cardsSection", "cardsGrid": "PromoTestimonials-module_cardsGrid", "card": "PromoTestimonials-module_card", "quote": "PromoTestimonials-module_quote", "author": "PromoTestimonials-module_author", "authorInfo": "PromoTestimonials-module_authorInfo", "authorName": "PromoTestimonials-module_authorName", "authorRole": "PromoTestimonials-module_authorRole", "mediaSection": "PromoTestimonials-module_mediaSection", "mediaBox": "PromoTestimonials-module_mediaBox" };
2669
+ var __default66 = { "root": "PromoTestimonials-module_root", "rootNoVertical": "PromoTestimonials-module_rootNoVertical", "wrapper": "PromoTestimonials-module_wrapper", "avatarSection": "PromoTestimonials-module_avatarSection", "avatarStack": "PromoTestimonials-module_avatarStack", "avatarRing": "PromoTestimonials-module_avatarRing", "overflowBadge": "PromoTestimonials-module_overflowBadge", "overflowCircle": "PromoTestimonials-module_overflowCircle", "headingSection": "PromoTestimonials-module_headingSection", "rating": "PromoTestimonials-module_rating", "cardsSection": "PromoTestimonials-module_cardsSection", "cardsGrid": "PromoTestimonials-module_cardsGrid", "card": "PromoTestimonials-module_card", "quote": "PromoTestimonials-module_quote", "author": "PromoTestimonials-module_author", "authorInfo": "PromoTestimonials-module_authorInfo", "authorName": "PromoTestimonials-module_authorName", "authorRole": "PromoTestimonials-module_authorRole", "mediaSection": "PromoTestimonials-module_mediaSection", "mediaBox": "PromoTestimonials-module_mediaBox" };
2661
2670
  function PromoTestimonials({
2662
2671
  heading,
2663
2672
  subtitle,
@@ -2665,9 +2674,11 @@ function PromoTestimonials({
2665
2674
  media,
2666
2675
  verticalPadding = "default",
2667
2676
  headingSize = "lg",
2677
+ rating,
2668
2678
  className = ""
2669
2679
  }) {
2670
2680
  const noVerticalClass = verticalPadding === "none" ? ` ${__default66.rootNoVertical}` : "";
2681
+ const ratingCountLabel = rating && rating.count !== void 0 && rating.count > 0 ? rating.countLabel ? rating.countLabel(rating.count) : String(rating.count) : null;
2671
2682
  return /* @__PURE__ */ jsx("section", { className: `${__default66.root}${noVerticalClass}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxs("div", { className: __default66.wrapper, children: [
2672
2683
  /* @__PURE__ */ jsx("div", { className: __default66.avatarSection, children: /* @__PURE__ */ jsxs("div", { className: __default66.avatarStack, children: [
2673
2684
  testimonials.slice(0, 5).map((t, i) => {
@@ -2694,7 +2705,17 @@ function PromoTestimonials({
2694
2705
  testimonials.length - 5
2695
2706
  ] }) })
2696
2707
  ] }) }),
2697
- /* @__PURE__ */ jsx("div", { className: __default66.headingSection, children: /* @__PURE__ */ jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }) }),
2708
+ /* @__PURE__ */ jsxs("div", { className: __default66.headingSection, children: [
2709
+ /* @__PURE__ */ jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }),
2710
+ rating && /* @__PURE__ */ jsxs("p", { className: __default66.rating, children: [
2711
+ rating.value.toFixed(1),
2712
+ " \u2605",
2713
+ ratingCountLabel && /* @__PURE__ */ jsxs(Fragment, { children: [
2714
+ " \xB7 ",
2715
+ ratingCountLabel
2716
+ ] })
2717
+ ] })
2718
+ ] }),
2698
2719
  /* @__PURE__ */ jsx("div", { className: __default66.cardsSection, children: /* @__PURE__ */ jsx("div", { className: __default66.cardsGrid, children: testimonials.map((t, i) => {
2699
2720
  const initials = t.name.split(" ").map((n) => n[0]).join("").toUpperCase();
2700
2721
  return /* @__PURE__ */ jsxs(