@brightlocal/ui-components 2.17.0 → 2.17.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.17.0",
3
+ "version": "2.17.1",
4
4
  "description": "Machine-readable registry of all components in the BrightLocal Design System",
5
5
  "components": [
6
6
  {
package/dist/rating.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),h=require("react"),d=require("@brightlocal/icons"),y=require("@brightlocal/ui-components/lib/utils");function S(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const v=S(h),x={sm:16,md:24},u=v.forwardRef(({value:t,dataHook:a,size:e="sm",ariaLabel:r,trackingEl:g,trackingLabel:m,className:f,...p},b)=>{const s=Math.max(0,Math.min(5,t)),o=x[e];return i.jsx("div",{ref:b,"aria-label":r?r.replace("{value}",String(s)):`Rating: ${s} out of 5 stars`,className:y.cn("flex items-center gap-0.5",f),"data-hook":a,"data-slot":"rating","data-tracking-el":g,"data-tracking-label":m,role:"img",...p,children:[...Array(5)].map((N,n)=>{const j=n+1,l=s>=j,c=!l&&s>n,R=c?((s-n)*100).toFixed(0):l?"100":"0";return i.jsxs("div",{className:"relative","data-slot":"rating-star",children:[i.jsx(d.StarRating,{className:"fill-muted stroke-muted","data-slot":"rating-star-base",size:o}),(l||c)&&i.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 overflow-hidden","data-slot":"rating-star-fill",style:{width:`${R}%`},children:i.jsx(d.StarRating,{size:o})})]},n)})})});u.displayName="Rating";exports.Rating=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),R=require("react"),d=require("@brightlocal/icons"),h=require("@brightlocal/ui-components/lib/utils");function S(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,s.get?s:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const v=S(R),N={sm:16,md:24},u=v.forwardRef(({value:t,dataHook:a,size:e="sm",ariaLabel:s,trackingEl:g,trackingLabel:m,className:f,...p},b)=>{const r=Math.max(0,Math.min(5,t)),o=N[e];return l.jsx("div",{ref:b,"aria-label":s?s.replace("{value}",String(r)):`Rating: ${r} out of 5 stars`,className:h.cn("flex items-center gap-0.5",f),"data-hook":a,"data-slot":"rating","data-tracking-el":g,"data-tracking-label":m,role:"img",...p,children:[...Array(5)].map((k,i)=>{const j=i+1,n=r>=j,c=!n&&r>i,y=c?((r-i)*100).toFixed(0):n?"100":"0";return l.jsxs("div",{className:"relative","data-slot":"rating-star",children:[l.jsx(d.StarRating,{className:"fill-muted stroke-muted","data-slot":"rating-star-base",size:o}),(n||c)&&l.jsx("div",{"aria-hidden":"true",className:"absolute inset-0 overflow-hidden","data-slot":"rating-star-fill",style:{width:`${y}%`},children:l.jsx(d.StarRating,{className:"fill-yellow-400 stroke-yellow-400",size:o})})]},i)})})});u.displayName="Rating";exports.Rating=u;
@@ -1 +1 @@
1
- {"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../../src/components/rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAO9B;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,oFAwEX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../../src/components/rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;GAEG;AACH,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAO9B;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACvE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,MAAM,oFA2EX,CAAC;AAIF,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,UAAU,EAAE,CAAC"}
package/dist/rating.js CHANGED
@@ -1,46 +1,46 @@
1
- import { jsx as e, jsxs as R } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as y } from "react/jsx-runtime";
2
2
  import * as N from "react";
3
3
  import { StarRating as o } from "@brightlocal/icons";
4
- import { cn as k } from "@brightlocal/ui-components/lib/utils";
5
- const y = {
4
+ import { cn as R } from "@brightlocal/ui-components/lib/utils";
5
+ const k = {
6
6
  sm: 16,
7
7
  md: 24
8
- }, z = N.forwardRef(
8
+ }, w = N.forwardRef(
9
9
  ({
10
10
  value: n,
11
- dataHook: d,
12
- size: m = "sm",
13
- ariaLabel: s,
14
- trackingEl: c,
11
+ dataHook: m,
12
+ size: c = "sm",
13
+ ariaLabel: l,
14
+ trackingEl: d,
15
15
  trackingLabel: g,
16
16
  className: f,
17
17
  ...p
18
18
  }, u) => {
19
- const a = Math.max(0, Math.min(5, n)), i = y[m];
19
+ const a = Math.max(0, Math.min(5, n)), r = k[c];
20
20
  return /* @__PURE__ */ e(
21
21
  "div",
22
22
  {
23
23
  ref: u,
24
- "aria-label": s ? s.replace("{value}", String(a)) : `Rating: ${a} out of 5 stars`,
25
- className: k("flex items-center gap-0.5", f),
26
- "data-hook": d,
24
+ "aria-label": l ? l.replace("{value}", String(a)) : `Rating: ${a} out of 5 stars`,
25
+ className: R("flex items-center gap-0.5", f),
26
+ "data-hook": m,
27
27
  "data-slot": "rating",
28
- "data-tracking-el": c,
28
+ "data-tracking-el": d,
29
29
  "data-tracking-label": g,
30
30
  role: "img",
31
31
  ...p,
32
- children: [...Array(5)].map((S, t) => {
33
- const h = t + 1, r = a >= h, l = !r && a > t, v = l ? ((a - t) * 100).toFixed(0) : r ? "100" : "0";
34
- return /* @__PURE__ */ R("div", { className: "relative", "data-slot": "rating-star", children: [
32
+ children: [...Array(5)].map((z, t) => {
33
+ const h = t + 1, s = a >= h, i = !s && a > t, v = i ? ((a - t) * 100).toFixed(0) : s ? "100" : "0";
34
+ return /* @__PURE__ */ y("div", { className: "relative", "data-slot": "rating-star", children: [
35
35
  /* @__PURE__ */ e(
36
36
  o,
37
37
  {
38
38
  className: "fill-muted stroke-muted",
39
39
  "data-slot": "rating-star-base",
40
- size: i
40
+ size: r
41
41
  }
42
42
  ),
43
- (r || l) && /* @__PURE__ */ e(
43
+ (s || i) && /* @__PURE__ */ e(
44
44
  "div",
45
45
  {
46
46
  "aria-hidden": "true",
@@ -49,7 +49,13 @@ const y = {
49
49
  style: {
50
50
  width: `${v}%`
51
51
  },
52
- children: /* @__PURE__ */ e(o, { size: i })
52
+ children: /* @__PURE__ */ e(
53
+ o,
54
+ {
55
+ className: "fill-yellow-400 stroke-yellow-400",
56
+ size: r
57
+ }
58
+ )
53
59
  }
54
60
  )
55
61
  ] }, t);
@@ -58,7 +64,7 @@ const y = {
58
64
  );
59
65
  }
60
66
  );
61
- z.displayName = "Rating";
67
+ w.displayName = "Rating";
62
68
  export {
63
- z as Rating
69
+ w as Rating
64
70
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.17.0",
3
+ "version": "2.17.1",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -195,8 +195,8 @@
195
195
  "sonner": "^2.0.7",
196
196
  "tailwind-merge": "^3.4.0",
197
197
  "vaul": "^1.1.2",
198
- "@brightlocal/icons": "2.3.1",
199
- "@brightlocal/illustrations": "0.5.0"
198
+ "@brightlocal/illustrations": "0.5.0",
199
+ "@brightlocal/icons": "2.3.1"
200
200
  },
201
201
  "size-limit": [
202
202
  {
@@ -110,7 +110,10 @@ const Rating = React.forwardRef<HTMLDivElement, RatingProps>(
110
110
  width: `${fillPercentage}%`,
111
111
  }}
112
112
  >
113
- <StarRating size={starSize} />
113
+ <StarRating
114
+ className="fill-yellow-400 stroke-yellow-400"
115
+ size={starSize}
116
+ />
114
117
  </div>
115
118
  )}
116
119
  </div>