@dmitriikapustin/ui 0.5.0 → 0.5.1

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
@@ -2663,7 +2663,7 @@ function PromoDevicesCTA({
2663
2663
  }
2664
2664
 
2665
2665
  // 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" };
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", "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
2667
  function PromoTestimonials({
2668
2668
  heading,
2669
2669
  subtitle,
@@ -2671,9 +2671,11 @@ function PromoTestimonials({
2671
2671
  media,
2672
2672
  verticalPadding = "default",
2673
2673
  headingSize = "lg",
2674
+ rating,
2674
2675
  className = ""
2675
2676
  }) {
2676
2677
  const noVerticalClass = verticalPadding === "none" ? ` ${__default66.rootNoVertical}` : "";
2678
+ const ratingCountLabel = rating && rating.count !== void 0 && rating.count > 0 ? rating.countLabel ? rating.countLabel(rating.count) : String(rating.count) : null;
2677
2679
  return /* @__PURE__ */ jsxRuntime.jsx("section", { className: `${__default66.root}${noVerticalClass}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default66.wrapper, children: [
2678
2680
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.avatarSection, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default66.avatarStack, children: [
2679
2681
  testimonials.slice(0, 5).map((t, i) => {
@@ -2700,7 +2702,17 @@ function PromoTestimonials({
2700
2702
  testimonials.length - 5
2701
2703
  ] }) })
2702
2704
  ] }) }),
2703
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.headingSection, children: /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }) }),
2705
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: __default66.headingSection, children: [
2706
+ /* @__PURE__ */ jsxRuntime.jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }),
2707
+ rating && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: __default66.rating, children: [
2708
+ rating.value.toFixed(1),
2709
+ " \u2605",
2710
+ ratingCountLabel && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2711
+ " \xB7 ",
2712
+ ratingCountLabel
2713
+ ] })
2714
+ ] })
2715
+ ] }),
2704
2716
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.cardsSection, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: __default66.cardsGrid, children: testimonials.map((t, i) => {
2705
2717
  const initials = t.name.split(" ").map((n) => n[0]).join("").toUpperCase();
2706
2718
  return /* @__PURE__ */ jsxRuntime.jsxs(
package/dist/index.d.cts CHANGED
@@ -948,6 +948,17 @@ interface Testimonial {
948
948
  role: string;
949
949
  avatarSrc?: string;
950
950
  }
951
+ interface PromoTestimonialsRating {
952
+ /** Числовое значение рейтинга, например 4.9. Форматируется через `toFixed(1)`. */
953
+ value: number;
954
+ /** Кол-во отзывов. Если undefined / 0 — рендерится только `value ★`. */
955
+ count?: number;
956
+ /**
957
+ * Локализуемый формат count'а. Default — `${count}`. Передавай свою pluralization
958
+ * (например `(n) => \`${n} ${pluralRu(n, ['отзыв','отзыва','отзывов'])}\``).
959
+ */
960
+ countLabel?: (count: number) => string;
961
+ }
951
962
  interface PromoTestimonialsProps {
952
963
  heading: ReactNode;
953
964
  subtitle?: string;
@@ -964,9 +975,16 @@ interface PromoTestimonialsProps {
964
975
  * Используй `'md'` для density-aware admin / dashboard контекстов.
965
976
  */
966
977
  headingSize?: 'sm' | 'md' | 'lg';
978
+ /**
979
+ * Опциональная плашка рейтинга под heading: `«4.9 ★ · 530 отзывов»`.
980
+ * Стилизуется через token `--testimonial-rating-fg` (default `var(--fg-secondary)`).
981
+ * Pluralization count'а — на стороне потребителя через `countLabel` callback (пакет
982
+ * не тащит i18n).
983
+ */
984
+ rating?: PromoTestimonialsRating;
967
985
  className?: string;
968
986
  }
969
- declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
987
+ declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, rating, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
970
988
 
971
989
  interface PromoHeroProps {
972
990
  title: ReactNode;
package/dist/index.d.ts CHANGED
@@ -948,6 +948,17 @@ interface Testimonial {
948
948
  role: string;
949
949
  avatarSrc?: string;
950
950
  }
951
+ interface PromoTestimonialsRating {
952
+ /** Числовое значение рейтинга, например 4.9. Форматируется через `toFixed(1)`. */
953
+ value: number;
954
+ /** Кол-во отзывов. Если undefined / 0 — рендерится только `value ★`. */
955
+ count?: number;
956
+ /**
957
+ * Локализуемый формат count'а. Default — `${count}`. Передавай свою pluralization
958
+ * (например `(n) => \`${n} ${pluralRu(n, ['отзыв','отзыва','отзывов'])}\``).
959
+ */
960
+ countLabel?: (count: number) => string;
961
+ }
951
962
  interface PromoTestimonialsProps {
952
963
  heading: ReactNode;
953
964
  subtitle?: string;
@@ -964,9 +975,16 @@ interface PromoTestimonialsProps {
964
975
  * Используй `'md'` для density-aware admin / dashboard контекстов.
965
976
  */
966
977
  headingSize?: 'sm' | 'md' | 'lg';
978
+ /**
979
+ * Опциональная плашка рейтинга под heading: `«4.9 ★ · 530 отзывов»`.
980
+ * Стилизуется через token `--testimonial-rating-fg` (default `var(--fg-secondary)`).
981
+ * Pluralization count'а — на стороне потребителя через `countLabel` callback (пакет
982
+ * не тащит i18n).
983
+ */
984
+ rating?: PromoTestimonialsRating;
967
985
  className?: string;
968
986
  }
969
- declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
987
+ declare function PromoTestimonials({ heading, subtitle, testimonials, media, verticalPadding, headingSize, rating, className, }: PromoTestimonialsProps): react_jsx_runtime.JSX.Element;
970
988
 
971
989
  interface PromoHeroProps {
972
990
  title: ReactNode;
package/dist/index.js CHANGED
@@ -2657,7 +2657,7 @@ function PromoDevicesCTA({
2657
2657
  }
2658
2658
 
2659
2659
  // 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" };
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", "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
2661
  function PromoTestimonials({
2662
2662
  heading,
2663
2663
  subtitle,
@@ -2665,9 +2665,11 @@ function PromoTestimonials({
2665
2665
  media,
2666
2666
  verticalPadding = "default",
2667
2667
  headingSize = "lg",
2668
+ rating,
2668
2669
  className = ""
2669
2670
  }) {
2670
2671
  const noVerticalClass = verticalPadding === "none" ? ` ${__default66.rootNoVertical}` : "";
2672
+ const ratingCountLabel = rating && rating.count !== void 0 && rating.count > 0 ? rating.countLabel ? rating.countLabel(rating.count) : String(rating.count) : null;
2671
2673
  return /* @__PURE__ */ jsx("section", { className: `${__default66.root}${noVerticalClass}${className ? ` ${className}` : ""}`, children: /* @__PURE__ */ jsxs("div", { className: __default66.wrapper, children: [
2672
2674
  /* @__PURE__ */ jsx("div", { className: __default66.avatarSection, children: /* @__PURE__ */ jsxs("div", { className: __default66.avatarStack, children: [
2673
2675
  testimonials.slice(0, 5).map((t, i) => {
@@ -2694,7 +2696,17 @@ function PromoTestimonials({
2694
2696
  testimonials.length - 5
2695
2697
  ] }) })
2696
2698
  ] }) }),
2697
- /* @__PURE__ */ jsx("div", { className: __default66.headingSection, children: /* @__PURE__ */ jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }) }),
2699
+ /* @__PURE__ */ jsxs("div", { className: __default66.headingSection, children: [
2700
+ /* @__PURE__ */ jsx(SectionHeading, { size: headingSize, align: "center", subtitle, children: heading }),
2701
+ rating && /* @__PURE__ */ jsxs("p", { className: __default66.rating, children: [
2702
+ rating.value.toFixed(1),
2703
+ " \u2605",
2704
+ ratingCountLabel && /* @__PURE__ */ jsxs(Fragment, { children: [
2705
+ " \xB7 ",
2706
+ ratingCountLabel
2707
+ ] })
2708
+ ] })
2709
+ ] }),
2698
2710
  /* @__PURE__ */ jsx("div", { className: __default66.cardsSection, children: /* @__PURE__ */ jsx("div", { className: __default66.cardsGrid, children: testimonials.map((t, i) => {
2699
2711
  const initials = t.name.split(" ").map((n) => n[0]).join("").toUpperCase();
2700
2712
  return /* @__PURE__ */ jsxs(