@alfadocs/ui-kit 1.105.0 → 1.107.0

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.
@@ -0,0 +1,97 @@
1
+ import { jsx as g } from "react/jsx-runtime";
2
+ import { forwardRef as S, Children as j } from "react";
3
+ import { c as x } from "./index-D2ZczOXr.js";
4
+ const d = 6;
5
+ function N(a, t) {
6
+ const p = Math.max(1, Math.min(t, d));
7
+ if (a <= p) return Math.max(1, a);
8
+ const m = Math.ceil(a / p), l = Math.ceil(a / m);
9
+ for (let r = l; r >= 2; r -= 1)
10
+ if (a % r !== 1) return r;
11
+ return l;
12
+ }
13
+ function _(a, t) {
14
+ return t > 1 && a > t && a % t === 1;
15
+ }
16
+ const b = {
17
+ 2: "ds:@[400px]:grid-cols-[repeat(var(--sg-t2),minmax(0,1fr))]",
18
+ 3: "ds:@[608px]:grid-cols-[repeat(var(--sg-t3),minmax(0,1fr))]",
19
+ 4: "ds:@[816px]:grid-cols-[repeat(var(--sg-t4),minmax(0,1fr))]",
20
+ 5: "ds:@[1024px]:grid-cols-[repeat(var(--sg-t5),minmax(0,1fr))]",
21
+ 6: "ds:@[1232px]:grid-cols-[repeat(var(--sg-t6),minmax(0,1fr))]"
22
+ }, G = {
23
+ 2: {
24
+ normal: "ds:@[400px]:col-span-[var(--sg-s2)]",
25
+ last: "ds:@[400px]:col-span-[var(--sg-l2)]"
26
+ },
27
+ 3: {
28
+ normal: "ds:@[608px]:col-span-[var(--sg-s3)]",
29
+ last: "ds:@[608px]:col-span-[var(--sg-l3)]"
30
+ },
31
+ 4: {
32
+ normal: "ds:@[816px]:col-span-[var(--sg-s4)]",
33
+ last: "ds:@[816px]:col-span-[var(--sg-l4)]"
34
+ },
35
+ 5: {
36
+ normal: "ds:@[1024px]:col-span-[var(--sg-s5)]",
37
+ last: "ds:@[1024px]:col-span-[var(--sg-l5)]"
38
+ },
39
+ 6: {
40
+ normal: "ds:@[1232px]:col-span-[var(--sg-s6)]",
41
+ last: "ds:@[1232px]:col-span-[var(--sg-l6)]"
42
+ }
43
+ }, A = x("ds:@container ds:block ds:w-full ds:min-w-0"), C = x(
44
+ [
45
+ "ds:grid ds:list-none ds:m-0 ds:p-0 ds:grid-cols-1",
46
+ "ds:gap-[var(--spacing-md)] ds:items-stretch"
47
+ ].join(" ")
48
+ ), O = x("ds:flex ds:min-w-0 ds:[&>*]:w-full ds:[&>*]:min-w-0"), V = S(
49
+ function({ children: t, maxColumns: p = d, className: m, ...l }, r) {
50
+ const f = j.toArray(t), i = f.length, w = Math.min(p, d), u = [], e = {}, v = {};
51
+ for (let s = 2; s <= d; s += 1) {
52
+ const n = N(i, Math.min(s, w)), o = i > 0 ? i % n : 0, c = o === 0 ? 1 : o;
53
+ u.push(b[s]), e[`--sg-t${s}`] = n * c, e[`--sg-s${s}`] = c, e[`--sg-l${s}`] = o === 0 ? c : n, v[s] = o;
54
+ }
55
+ return /* @__PURE__ */ g(
56
+ "div",
57
+ {
58
+ ref: r,
59
+ "data-component": "stat-group",
60
+ "data-count": i,
61
+ role: l["aria-label"] ? "group" : void 0,
62
+ className: [A(), m].filter(Boolean).join(" "),
63
+ ...l,
64
+ children: /* @__PURE__ */ g(
65
+ "ul",
66
+ {
67
+ className: [C(), ...u].join(" "),
68
+ style: e,
69
+ children: f.map((s, n) => {
70
+ const o = Object.entries(G).map(([c, h]) => {
71
+ const M = v[Number(c)];
72
+ return M > 0 && n >= i - M ? h.last : h.normal;
73
+ }).join(" ");
74
+ return /* @__PURE__ */ g(
75
+ "li",
76
+ {
77
+ "data-stat-group-item": "",
78
+ className: [O(), o].join(" "),
79
+ children: s
80
+ },
81
+ n
82
+ );
83
+ })
84
+ }
85
+ )
86
+ }
87
+ );
88
+ }
89
+ );
90
+ V.displayName = "StatGroup";
91
+ export {
92
+ d as S,
93
+ V as a,
94
+ _ as b,
95
+ N as s
96
+ };
97
+ //# sourceMappingURL=stat-group-CC4-O-Fj.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.105.0",
3
+ "packageVersion": "1.107.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -1,4 +1,4 @@
1
- import { R as r, r as s } from "../../_chunks/reviews-panel-jPYgYvxG.js";
1
+ import { R as r, r as s } from "../../_chunks/reviews-panel-CtrwZOUS.js";
2
2
  export {
3
3
  r as ReviewsPanel,
4
4
  s as reviewsPanelAgent
@@ -9,6 +9,14 @@ export interface ReviewItem {
9
9
  overallScore: number;
10
10
  /** Short free-text comment shown on the compact card. */
11
11
  comment?: string;
12
+ /**
13
+ * Language of this review's own text (comment and practice reply), as a
14
+ * BCP 47 tag such as `"it"`. Sets `lang` on that text so a screen reader on
15
+ * a page in another language pronounces it correctly. Overrides the
16
+ * panel-level `contentLang`. Leave it out and no `lang` is written.
17
+ * The pseudonym, date, rating and the kit's labels keep the page language.
18
+ */
19
+ contentLang?: string;
12
20
  /** Practice reply (revealed in the expanded panel only). */
13
21
  reply?: string;
14
22
  /** Optional per-axis breakdown — when present, the card grows an
@@ -45,6 +53,11 @@ export interface ReviewsPanelHandle {
45
53
  export interface ReviewsPanelProps extends Omit<ComponentPropsWithoutRef<'section'>, 'aria-label' | 'children'> {
46
54
  reviews: ReviewItem[];
47
55
  aggregate: ReviewsAggregate;
56
+ /**
57
+ * Default language of every review's own text, as a BCP 47 tag. A review's
58
+ * own `contentLang` wins. Leave both out and no `lang` is written.
59
+ */
60
+ contentLang?: string;
48
61
  /**
49
62
  * Active star filter. Controlled — consumer owns it for shareability via
50
63
  * URL query strings. Omit for uncontrolled (panel-managed) filtering.
@@ -1,4 +1,4 @@
1
- import { S as t, a as o, s as r, b as p } from "../../_chunks/stat-group-DSNnzkbW.js";
1
+ import { S as t, a as o, s as r, b as p } from "../../_chunks/stat-group-CC4-O-Fj.js";
2
2
  export {
3
3
  t as STAT_GROUP_MAX_COLUMNS,
4
4
  o as StatGroup,