@brightlocal/ui-components 2.22.0 → 2.24.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.
Files changed (115) hide show
  1. package/AI_USAGE.md +1 -1
  2. package/README.md +4 -2
  3. package/component-meta.json +134 -25
  4. package/deprecations.json +22 -0
  5. package/dist/alert.cjs +1 -1
  6. package/dist/alert.d.ts.map +1 -1
  7. package/dist/alert.js +32 -35
  8. package/dist/blocks/sidebar.cjs +1 -1
  9. package/dist/blocks/sidebar.d.ts.map +1 -1
  10. package/dist/blocks/sidebar.js +151 -156
  11. package/dist/brand-illustration-motif.cjs +1 -0
  12. package/dist/brand-illustration-motif.d.ts +55 -0
  13. package/dist/brand-illustration-motif.d.ts.map +1 -0
  14. package/dist/brand-illustration-motif.js +67 -0
  15. package/dist/chart.cjs +7 -7
  16. package/dist/chart.d.ts +287 -2
  17. package/dist/chart.d.ts.map +1 -1
  18. package/dist/chart.js +408 -152
  19. package/dist/combobox.cjs +3 -3
  20. package/dist/combobox.d.ts +14 -1
  21. package/dist/combobox.d.ts.map +1 -1
  22. package/dist/combobox.js +387 -376
  23. package/dist/context-menu.cjs +1 -1
  24. package/dist/context-menu.d.ts.map +1 -1
  25. package/dist/context-menu.js +111 -109
  26. package/dist/data-table.cjs +1 -0
  27. package/dist/{blocks/data-table.d.ts → data-table.d.ts} +159 -4
  28. package/dist/data-table.d.ts.map +1 -0
  29. package/dist/data-table.js +721 -0
  30. package/dist/dropdown-menu.cjs +1 -1
  31. package/dist/dropdown-menu.d.ts.map +1 -1
  32. package/dist/dropdown-menu.js +109 -121
  33. package/dist/field.cjs +1 -1
  34. package/dist/field.d.ts +16 -1
  35. package/dist/field.d.ts.map +1 -1
  36. package/dist/field.js +23 -7
  37. package/dist/global-layout.cjs +1 -1
  38. package/dist/global-layout.d.ts +32 -2
  39. package/dist/global-layout.d.ts.map +1 -1
  40. package/dist/global-layout.js +179 -109
  41. package/dist/index.cjs +1 -1
  42. package/dist/index.d.ts +3 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +526 -509
  45. package/dist/label.cjs +1 -1
  46. package/dist/label.d.ts +9 -0
  47. package/dist/label.d.ts.map +1 -1
  48. package/dist/label.js +26 -22
  49. package/dist/lib/spring-settle.cjs +1 -0
  50. package/dist/lib/spring-settle.d.ts +20 -0
  51. package/dist/lib/spring-settle.d.ts.map +1 -0
  52. package/dist/lib/spring-settle.js +4 -0
  53. package/dist/link.cjs +1 -1
  54. package/dist/link.d.ts +3 -2
  55. package/dist/link.d.ts.map +1 -1
  56. package/dist/link.js +22 -11
  57. package/dist/loading.cjs +1 -0
  58. package/dist/loading.d.ts +47 -0
  59. package/dist/loading.d.ts.map +1 -0
  60. package/dist/loading.js +163 -0
  61. package/dist/map.cjs +1 -1
  62. package/dist/map.d.ts.map +1 -1
  63. package/dist/map.js +1 -1
  64. package/dist/menubar.cjs +1 -1
  65. package/dist/menubar.d.ts.map +1 -1
  66. package/dist/menubar.js +97 -99
  67. package/dist/popover.cjs +1 -1
  68. package/dist/popover.d.ts.map +1 -1
  69. package/dist/popover.js +27 -26
  70. package/dist/select.cjs +2 -2
  71. package/dist/select.d.ts +16 -1
  72. package/dist/select.d.ts.map +1 -1
  73. package/dist/select.js +112 -85
  74. package/dist/table.cjs +1 -1
  75. package/dist/table.d.ts +29 -0
  76. package/dist/table.d.ts.map +1 -1
  77. package/dist/table.js +2 -2
  78. package/dist/text-reveal-motion.cjs +1 -1
  79. package/dist/text-reveal-motion.d.ts.map +1 -1
  80. package/dist/text-reveal-motion.js +236 -219
  81. package/dist/tooltip.cjs +1 -1
  82. package/dist/tooltip.d.ts +21 -2
  83. package/dist/tooltip.d.ts.map +1 -1
  84. package/dist/tooltip.js +35 -32
  85. package/dist/typography.cjs +1 -1
  86. package/dist/typography.d.ts +20 -4
  87. package/dist/typography.d.ts.map +1 -1
  88. package/dist/typography.js +263 -228
  89. package/package.json +7 -7
  90. package/src/blocks/sidebar.tsx +11 -23
  91. package/src/components/alert.tsx +10 -17
  92. package/src/components/brand-illustration-motif.tsx +143 -0
  93. package/src/components/chart.tsx +632 -1
  94. package/src/components/combobox.tsx +47 -0
  95. package/src/components/context-menu.tsx +8 -3
  96. package/src/{blocks → components}/data-table.tsx +272 -18
  97. package/src/components/dropdown-menu.tsx +6 -15
  98. package/src/components/field.tsx +31 -0
  99. package/src/components/global-layout.tsx +144 -5
  100. package/src/components/label.tsx +13 -1
  101. package/src/components/link.tsx +13 -1
  102. package/src/components/loading.tsx +355 -0
  103. package/src/components/map.tsx +3 -1
  104. package/src/components/menubar.tsx +6 -5
  105. package/src/components/popover.tsx +6 -2
  106. package/src/components/select.tsx +87 -10
  107. package/src/components/table.tsx +31 -2
  108. package/src/components/text-reveal-motion.tsx +90 -64
  109. package/src/components/tooltip.tsx +28 -3
  110. package/src/components/typography.tsx +74 -18
  111. package/src/index.ts +3 -1
  112. package/src/lib/spring-settle.ts +19 -0
  113. package/dist/blocks/data-table.cjs +0 -1
  114. package/dist/blocks/data-table.d.ts.map +0 -1
  115. package/dist/blocks/data-table.js +0 -654
package/dist/label.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),b=require("react"),f=require("@radix-ui/react-label"),p=require("class-variance-authority"),m=require("@brightlocal/ui-components/lib/utils");function n(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const g=n(b),y=n(f),o=p.cva(["text-sm font-medium leading-none","text-foreground"],{variants:{optional:{true:"after:ml-1 after:content-['(optional)']"}},defaultVariants:{}}),l=g.forwardRef(({className:e,optional:a,dataHook:t,trackingEl:r,trackingLabel:i,children:s,...c},u)=>d.jsx(y.Root,{ref:u,className:m.cn("flex items-center select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",o({optional:a}),e),"data-hook":t,"data-slot":"label","data-tracking-el":r||"label","data-tracking-label":i,...c,children:s}));l.displayName="Label";exports.Label=l;exports.labelVariants=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),f=require("react"),p=require("@radix-ui/react-label"),m=require("class-variance-authority"),g=require("@brightlocal/ui-components/lib/utils");function n(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const y=n(f),j=n(p),o=m.cva(["text-sm font-medium leading-none","text-foreground"],{variants:{optional:{true:"after:ml-1 after:content-['(optional)']"},srOnly:{true:"sr-only"}},defaultVariants:{}}),l=y.forwardRef(({className:e,optional:a,srOnly:t,dataHook:r,trackingEl:i,trackingLabel:s,children:c,...u},d)=>b.jsx(j.Root,{ref:d,className:g.cn("flex items-center select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",o({optional:a,srOnly:t}),e),"data-hook":r,"data-slot":"label","data-tracking-el":i||"label","data-tracking-label":s,...u,children:c}));l.displayName="Label";exports.Label=l;exports.labelVariants=o;
package/dist/label.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as React from "react";
2
2
  declare const labelVariants: (props?: ({
3
3
  optional?: boolean | null | undefined;
4
+ srOnly?: boolean | null | undefined;
4
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
6
  interface LabelProps extends React.ComponentPropsWithoutRef<"label"> {
6
7
  /**
@@ -23,6 +24,14 @@ interface LabelProps extends React.ComponentPropsWithoutRef<"label"> {
23
24
  * @default false
24
25
  */
25
26
  optional?: boolean;
27
+ /**
28
+ * Visually hides the label while keeping it in the accessibility tree,
29
+ * preserving the label/input association via `htmlFor`.
30
+ * The parent element must establish a positioning context (`relative`) —
31
+ * Field handles this automatically for FieldLabel.
32
+ * @default false
33
+ */
34
+ srOnly?: boolean;
26
35
  }
27
36
  declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
28
37
  export { Label, labelVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,aAAa;;8EAUlB,CAAC;AAEF,UAAU,UAAW,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC;IAClE;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,KAAK,qFA+BV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAEhC,YAAY,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../src/components/label.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,aAAa;;;8EAalB,CAAC;AAEF,UAAU,UAAW,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC;IAClE;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,QAAA,MAAM,KAAK,qFAgCV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAEhC,YAAY,EAAE,UAAU,EAAE,CAAC"}
package/dist/label.js CHANGED
@@ -1,47 +1,51 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import * as m from "@radix-ui/react-label";
4
- import { cva as p } from "class-variance-authority";
5
- import { cn as c } from "@brightlocal/ui-components/lib/utils";
6
- const f = p(
2
+ import * as m from "react";
3
+ import * as p from "@radix-ui/react-label";
4
+ import { cva as c } from "class-variance-authority";
5
+ import { cn as f } from "@brightlocal/ui-components/lib/utils";
6
+ const b = c(
7
7
  ["text-sm font-medium leading-none", "text-foreground"],
8
8
  {
9
9
  variants: {
10
10
  optional: {
11
11
  true: "after:ml-1 after:content-['(optional)']"
12
+ },
13
+ srOnly: {
14
+ true: "sr-only"
12
15
  }
13
16
  },
14
17
  defaultVariants: {}
15
18
  }
16
- ), b = s.forwardRef(
19
+ ), u = m.forwardRef(
17
20
  ({
18
21
  className: a,
19
22
  optional: e,
20
- dataHook: t,
21
- trackingEl: o,
22
- trackingLabel: r,
23
- children: l,
23
+ srOnly: t,
24
+ dataHook: o,
25
+ trackingEl: r,
26
+ trackingLabel: l,
27
+ children: n,
24
28
  ...i
25
- }, n) => /* @__PURE__ */ d(
26
- m.Root,
29
+ }, s) => /* @__PURE__ */ d(
30
+ p.Root,
27
31
  {
28
- ref: n,
29
- className: c(
32
+ ref: s,
33
+ className: f(
30
34
  "flex items-center select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
31
- f({ optional: e }),
35
+ b({ optional: e, srOnly: t }),
32
36
  a
33
37
  ),
34
- "data-hook": t,
38
+ "data-hook": o,
35
39
  "data-slot": "label",
36
- "data-tracking-el": o || "label",
37
- "data-tracking-label": r,
40
+ "data-tracking-el": r || "label",
41
+ "data-tracking-label": l,
38
42
  ...i,
39
- children: l
43
+ children: n
40
44
  }
41
45
  )
42
46
  );
43
- b.displayName = "Label";
47
+ u.displayName = "Label";
44
48
  export {
45
- b as Label,
46
- f as labelVariants
49
+ u as Label,
50
+ b as labelVariants
47
51
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=.005;exports.SETTLE_REST_DELTA=T;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Overshoot margin for progress springs that drive shape morphs (Loading,
3
+ * TextRevealMotion).
4
+ *
5
+ * framer-motion ends a non-overshooting spring on the first frame it comes
6
+ * within `restDelta` of the target, and on that same frame snaps the value to
7
+ * the target. A spring aimed exactly at 1 therefore jumps its last ~0.5% of
8
+ * progress (~1.8° of rotation) in a single frame — a visible pop at ~99%.
9
+ *
10
+ * Instead, aim the spring at `1 + SETTLE_REST_DELTA` with `restDelta` set to
11
+ * this value: the spring then rests on the first frame its value reaches 1.0,
12
+ * and the terminal snap runs from ≥1 to 1 + SETTLE_REST_DELTA — entirely
13
+ * inside the region the render clamps to 1, so nothing moves on screen.
14
+ *
15
+ * Precondition: the spring must not overshoot, i.e. damping ≥
16
+ * 2 × √(stiffness × mass). An underdamped spring would swing past the
17
+ * overshoot target and ring back below 1, exposing a post-landing wobble.
18
+ */
19
+ export declare const SETTLE_REST_DELTA = 0.005;
20
+ //# sourceMappingURL=spring-settle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spring-settle.d.ts","sourceRoot":"","sources":["../../src/lib/spring-settle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,iBAAiB,QAAQ,CAAC"}
@@ -0,0 +1,4 @@
1
+ const E = 5e-3;
2
+ export {
3
+ E as SETTLE_REST_DELTA
4
+ };
package/dist/link.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),y=require("@brightlocal/icons"),c=require("@radix-ui/react-slot"),m=require("class-variance-authority"),j=require("@brightlocal/ui-components/lib/utils");function S(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const w=S(h),i=["justify-center","h-9","px-4","py-2","rounded-full","text-sm","font-semibold","no-underline","whitespace-nowrap","shrink-0","[&_svg]:pointer-events-none","[&_svg]:shrink-0","transition-[color,background-color,border-color,box-shadow]","duration-150","ease-in-out","focus-visible:shadow-default"],q=m.cva(["inline-flex","items-center","gap-2","cursor-pointer","outline-none"],{variants:{variant:{inline:["rounded-sm","text-link","dark:text-link-dark","no-underline","hover:underline","hover:underline-offset-4","active:text-link/80","visited:text-link-visited","visited:dark:text-link-visited-dark","transition-[text-decoration,text-decoration-color,text-underline-offset,color]","duration-300","focus-visible:shadow-default"],filled:[...i,"bg-secondary","text-secondary-foreground","hover:bg-secondary/80"],outline:[...i,"border","border-input","border-solid","bg-background","text-foreground","hover:bg-accent","hover:text-accent-foreground","dark:bg-input/30","dark:border-input","dark:hover:bg-input/50","dark:hover:border-input"],ghost:[...i,"bg-transparent","text-foreground","hover:bg-accent"]}},defaultVariants:{variant:"inline"}}),u=w.forwardRef(({className:e,variant:t="inline",dataHook:n,trackingEl:r,trackingLabel:f,asChild:b=!1,external:a=!1,showExternalIcon:k=!0,children:s,...g},p)=>{const x=a?{target:"_blank",rel:"noopener noreferrer"}:{},v=t==="inline"?"link-default":`link-${t}`,l={ref:p,className:j.cn(q({variant:t}),e),"data-hook":n,"data-slot":"link","data-tracking-el":r||v,"data-tracking-label":f,...x,...g},d=a&&k&&o.jsx(y.ExternalLink,{"aria-hidden":"true","data-slot":"external-icon"});return b?o.jsxs(c.Slot,{...l,children:[o.jsx(c.Slottable,{children:s}),d]}):o.jsxs("a",{...l,children:[s,d]})});u.displayName="Link";exports.Link=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),y=require("@brightlocal/icons"),d=require("@radix-ui/react-slot"),m=require("class-variance-authority"),j=require("@brightlocal/ui-components/lib/utils");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const S=w(h),i=["justify-center","h-9","px-4","py-2","rounded-full","text-sm","font-semibold","no-underline","whitespace-nowrap","shrink-0","[&_svg]:pointer-events-none","[&_svg]:shrink-0","transition-[color,background-color,border-color,box-shadow]","duration-150","ease-in-out","focus-visible:shadow-default"],q=m.cva(["inline-flex","items-center","gap-2","cursor-pointer","outline-none"],{variants:{variant:{inline:["rounded-sm","text-link","dark:text-link-dark","no-underline","hover:underline","hover:underline-offset-4","active:text-link/80","visited:text-link-visited","visited:dark:text-link-visited-dark","transition-[text-decoration,text-decoration-color,text-underline-offset,color]","duration-300","focus-visible:shadow-default"],filled:[...i,"bg-secondary","text-secondary-foreground","hover:bg-secondary/80"],outline:[...i,"border","border-input","border-solid","bg-background","text-foreground","hover:bg-accent","hover:text-accent-foreground","dark:bg-input/30","dark:border-input","dark:hover:bg-input/50","dark:hover:border-input"],ghost:[...i,"bg-transparent","text-foreground","hover:bg-accent"],icon:[...i,"w-9","px-0","bg-transparent","text-foreground","hover:bg-accent"]}},defaultVariants:{variant:"inline"}}),u=S.forwardRef(({className:e,variant:t="inline",dataHook:n,trackingEl:r,trackingLabel:f,asChild:b=!1,external:a=!1,showExternalIcon:g=!0,children:s,...k},p)=>{const x=a?{target:"_blank",rel:"noopener noreferrer"}:{},v=t==="inline"?"link-default":`link-${t}`,l={ref:p,className:j.cn(q({variant:t}),e),"data-hook":n,"data-slot":"link","data-tracking-el":r||v,"data-tracking-label":f,...x,...k},c=a&&g&&o.jsx(y.ExternalLink,{"aria-hidden":"true","data-slot":"external-icon"});return b?o.jsxs(d.Slot,{...l,children:[o.jsx(d.Slottable,{children:s}),c]}):o.jsxs("a",{...l,children:[s,c]})});u.displayName="Link";exports.Link=u;
package/dist/link.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  declare const linkVariants: (props?: ({
4
- variant?: "inline" | "ghost" | "filled" | "outline" | null | undefined;
4
+ variant?: "inline" | "ghost" | "filled" | "icon" | "outline" | null | undefined;
5
5
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
6
  /** Supported visual style variants for the Link component. */
7
7
  export type LinkVariant = NonNullable<VariantProps<typeof linkVariants>["variant"]>;
@@ -13,7 +13,8 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
13
13
  /**
14
14
  * Visual style variant. `inline` renders a standard text link; `filled`,
15
15
  * `outline` and `ghost` render button-styled treatments for inline actions
16
- * and high-priority navigation.
16
+ * and high-priority navigation; `icon` renders a circular icon-only link
17
+ * (provide an `aria-label` since there is no text content).
17
18
  * @default "inline"
18
19
  */
19
20
  variant?: LinkVariant;
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA0BlE,QAAA,MAAM,YAAY;;8EA6DjB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,WAAW,CACnC,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,SAAS,CAAC,CAC7C,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,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AAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/link.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsxs as a, jsx as d } from "react/jsx-runtime";
2
2
  import * as h from "react";
3
3
  import { ExternalLink as v } from "@brightlocal/icons";
4
- import { Slot as m, Slottable as y } from "@radix-ui/react-slot";
5
- import { cva as w } from "class-variance-authority";
4
+ import { Slot as m, Slottable as w } from "@radix-ui/react-slot";
5
+ import { cva as y } from "class-variance-authority";
6
6
  import { cn as j } from "@brightlocal/ui-components/lib/utils";
7
- const r = [
7
+ const e = [
8
8
  "justify-center",
9
9
  "h-9",
10
10
  "px-4",
@@ -21,7 +21,7 @@ const r = [
21
21
  "duration-150",
22
22
  "ease-in-out",
23
23
  "focus-visible:shadow-default"
24
- ], L = w(
24
+ ], L = y(
25
25
  // `gap-2` (spacing/2) keeps the icon–text gap consistent across all variants.
26
26
  ["inline-flex", "items-center", "gap-2", "cursor-pointer", "outline-none"],
27
27
  {
@@ -48,7 +48,7 @@ const r = [
48
48
  ],
49
49
  // Button-styled, filled (maps to Button `secondary`).
50
50
  filled: [
51
- ...r,
51
+ ...e,
52
52
  "bg-secondary",
53
53
  "text-secondary-foreground",
54
54
  "hover:bg-secondary/80"
@@ -56,7 +56,7 @@ const r = [
56
56
  // Button-styled, bordered. Uses the `input` border token in both modes
57
57
  // and keeps that border on focus (focus is the shared shadow ring only).
58
58
  outline: [
59
- ...r,
59
+ ...e,
60
60
  "border",
61
61
  "border-input",
62
62
  "border-solid",
@@ -71,7 +71,18 @@ const r = [
71
71
  ],
72
72
  // Button-styled, transparent (maps to Button `ghost`).
73
73
  ghost: [
74
- ...r,
74
+ ...e,
75
+ "bg-transparent",
76
+ "text-foreground",
77
+ "hover:bg-accent"
78
+ ],
79
+ // Icon-only, circular. Mirrors `ghost` in a fixed 36px square
80
+ // footprint for icon-only links (e.g. back navigation).
81
+ // Requires an `aria-label` since there is no text content.
82
+ icon: [
83
+ ...e,
84
+ "w-9",
85
+ "px-0",
75
86
  "bg-transparent",
76
87
  "text-foreground",
77
88
  "hover:bg-accent"
@@ -85,7 +96,7 @@ const r = [
85
96
  ), S = h.forwardRef(
86
97
  ({
87
98
  className: l,
88
- variant: e = "inline",
99
+ variant: r = "inline",
89
100
  dataHook: s,
90
101
  trackingEl: c,
91
102
  trackingLabel: u,
@@ -95,9 +106,9 @@ const r = [
95
106
  children: n,
96
107
  ...b
97
108
  }, p) => {
98
- const g = t ? { target: "_blank", rel: "noopener noreferrer" } : {}, x = e === "inline" ? "link-default" : `link-${e}`, o = {
109
+ const g = t ? { target: "_blank", rel: "noopener noreferrer" } : {}, x = r === "inline" ? "link-default" : `link-${r}`, o = {
99
110
  ref: p,
100
- className: j(L({ variant: e }), l),
111
+ className: j(L({ variant: r }), l),
101
112
  "data-hook": s,
102
113
  "data-slot": "link",
103
114
  "data-tracking-el": c || x,
@@ -106,7 +117,7 @@ const r = [
106
117
  ...b
107
118
  }, i = t && k && /* @__PURE__ */ d(v, { "aria-hidden": "true", "data-slot": "external-icon" });
108
119
  return f ? /* @__PURE__ */ a(m, { ...o, children: [
109
- /* @__PURE__ */ d(y, { children: n }),
120
+ /* @__PURE__ */ d(w, { children: n }),
110
121
  i
111
122
  ] }) : /* @__PURE__ */ a("a", { ...o, children: [
112
123
  n,
@@ -0,0 +1 @@
1
+ "use strict";var B=Object.create;var N=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var U=(t,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of H(e))!Z.call(t,l)&&l!==n&&N(t,l,{get:()=>e[l],enumerable:!(c=F(e,l))||c.enumerable});return t};var z=(t,e,n)=>(n=t!=null?B(W(t)):{},U(e||!t||!t.__esModule?N(n,"default",{value:t,enumerable:!0}):n,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),i=require("react"),J=require("framer-motion"),K=require("@brightlocal/ui-components/lib/utils"),Q=require("./hooks/use-prefers-reduced-motion.cjs"),P=require("./lib/spring-settle.cjs");function V(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,c.get?c:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const X=V(i),j="M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z",O="M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z",G="M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z",Y=t=>t<0?0:t>1?1:t,g=[j,O,G,j,G,O],tt=150,et=30,nt=9,ot=.5,rt=360,q=56,S=.15,T=45,st=-Math.PI/4,at=.5,$=X.forwardRef(({className:t,dataHook:e,loadingLabel:n,trackingEl:c,trackingLabel:l,...k},v)=>{const L=Q.usePrefersReducedMotion(),_=i.useId(),I=i.useMemo(()=>`loading-gradient-${_.replace(/:/g,"")}`,[_]),D=i.useRef(null),w=i.useRef(null),b=i.useRef(null);return i.useEffect(()=>{if(L)return;const u=b.current;if(!u)return;const a=u;let d,o=null;const y=S*.8+Math.random()*S*.4,p=S*.53+Math.random()*S*.27,R=Math.random()*Math.PI*2,A=Math.random()*Math.PI*2;let m=-1/0;function r(h){o===null&&(o=h);const C=(h-o)/1e3,s=st+Math.sin(C*y+R)*at+Math.sin(C*p+A)*.25;if(Math.abs(s-m)>.01){m=s;const E=Math.cos(s),M=Math.sin(s);a.setAttribute("x1",`${50+T*E}%`),a.setAttribute("y1",`${50+T*M}%`),a.setAttribute("x2",`${50-T*E}%`),a.setAttribute("y2",`${50-T*M}%`)}d=requestAnimationFrame(r)}return d=requestAnimationFrame(r),()=>cancelAnimationFrame(d)},[L]),i.useEffect(()=>{const u=D.current,a=w.current;if(!u||!a)return;const d=p=>{a.style.transform=`rotate(${p}deg)`,b.current?.setAttribute("gradientTransform",`rotate(${-p} 0.5 0.5)`)};if(L){u.setAttribute("d",g[0]),a.style.opacity="1",d(0);return}const o={cancelled:!1};async function y(){const{interpolate:p}=await import("flubber");if(o.cancelled)return;const R=[];for(let r=0;r<g.length;r++)R.push(p(g[r],g[(r+1)%g.length]));a.style.opacity="1";let A=0,m=0;for(;!o.cancelled;){const r=R[A];if(await new Promise(s=>setTimeout(s,tt)),o.cancelled)break;const h=m,C=m+rt;await new Promise(s=>{if(o.cancelled){s();return}const E=J.animate(0,1+P.SETTLE_REST_DELTA,{type:"spring",stiffness:et,damping:nt,mass:ot,restDelta:P.SETTLE_REST_DELTA,onUpdate:M=>{if(o.cancelled){E.stop(),s();return}const x=Y(M);u.setAttribute("d",r(x)),d(h+x*(C-h))},onComplete:()=>{o.cancelled||(u.setAttribute("d",r(1)),d(C)),s()}})}),m=C,A=(A+1)%g.length}}return y(),()=>{o.cancelled=!0}},[L]),f.jsxs("svg",{ref:v,"aria-label":n??"Loading",className:K.cn("shrink-0",t),"data-hook":e,"data-slot":"loading","data-tracking-el":c,"data-tracking-label":l,fill:"none",height:q,role:"img",style:{overflow:"visible"},viewBox:"-30 -30 560 560",width:q,xmlns:"http://www.w3.org/2000/svg",...k,children:[f.jsx("defs",{children:f.jsxs("linearGradient",{ref:b,id:I,x1:"81.8%",x2:"18.2%",y1:"18.2%",y2:"81.8%",children:[f.jsx("stop",{offset:"-60%",stopColor:"var(--loading-gradient-from)"}),f.jsx("stop",{offset:"120%",stopColor:"var(--loading-gradient-to)"})]})}),f.jsx("g",{ref:w,style:{opacity:0,transformOrigin:"250px 250px",willChange:"transform"},children:f.jsx("path",{ref:D,d:g[0],fill:`url(#${I})`})})]})});$.displayName="Loading";exports.Loading=$;
@@ -0,0 +1,47 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Props for the Loading component.
4
+ * Extends native `svg` props for full attribute + layout-className support.
5
+ */
6
+ export interface LoadingProps extends Omit<React.ComponentPropsWithoutRef<"svg">, "children"> {
7
+ /**
8
+ * Required data-hook attribute for automated testing.
9
+ * @example "page-loading"
10
+ */
11
+ dataHook: string;
12
+ /**
13
+ * Accessible label for the loading animation, announced by screen readers.
14
+ * @default "Loading"
15
+ */
16
+ loadingLabel?: string;
17
+ /**
18
+ * Tracking element identifier for analytics.
19
+ */
20
+ trackingEl?: string;
21
+ /**
22
+ * Tracking label for analytics context.
23
+ */
24
+ trackingLabel?: string;
25
+ }
26
+ /**
27
+ * Brand loading animation — a gradient shape that morphs between a circle, a
28
+ * star, and a starburst while gently rotating, with a slowly wandering gradient.
29
+ *
30
+ * The animation is fully self-contained and opinionated: size, timing, spring
31
+ * physics and colours are all baked in. The only accessibility hook is an
32
+ * optional `loadingLabel`. Colours come from the `--loading-gradient-from` /
33
+ * `--loading-gradient-to` design tokens — the brand "Gradient Green"
34
+ * (#FFF085 → #2AE855) in light mode, chart-token variants in dark mode.
35
+ *
36
+ * Respects `prefers-reduced-motion`: renders a static shape when reduced motion
37
+ * is requested.
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * <Loading dataHook="page-loading" />
42
+ * <Loading dataHook="page-loading" loadingLabel={t("common.loading")} />
43
+ * ```
44
+ */
45
+ declare const Loading: React.ForwardRefExoticComponent<LoadingProps & React.RefAttributes<SVGSVGElement>>;
46
+ export { Loading };
47
+ //# sourceMappingURL=loading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/components/loading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2E/B;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,UAAU,CACX;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,OAAO,oFA8NZ,CAAC;AAIF,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { jsxs as w, jsx as u } from "react/jsx-runtime";
2
+ import * as H from "react";
3
+ import { useId as W, useMemo as Z, useRef as M, useEffect as D } from "react";
4
+ import { animate as U } from "framer-motion";
5
+ import { cn as j } from "@brightlocal/ui-components/lib/utils";
6
+ import { usePrefersReducedMotion as q } from "./hooks/use-prefers-reduced-motion.js";
7
+ import { SETTLE_REST_DELTA as N } from "./lib/spring-settle.js";
8
+ const b = "M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z", x = "M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z", P = "M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z", z = (d) => d < 0 ? 0 : d > 1 ? 1 : d, a = [
9
+ b,
10
+ x,
11
+ P,
12
+ b,
13
+ P,
14
+ x
15
+ ], J = 150, K = 30, Q = 9, V = 0.5, X = 360, G = 56, h = 0.15, L = 45, Y = -Math.PI / 4, t5 = 0.5, e5 = H.forwardRef(
16
+ ({ className: d, dataHook: $, loadingLabel: k, trackingEl: B, trackingLabel: F, ...O }, v) => {
17
+ const p = q(), I = W(), S = Z(
18
+ () => `loading-gradient-${I.replace(/:/g, "")}`,
19
+ [I]
20
+ ), T = M(null), y = M(null), R = M(null);
21
+ return D(() => {
22
+ if (p) return;
23
+ const r = R.current;
24
+ if (!r) return;
25
+ const o = r;
26
+ let s, t = null;
27
+ const E = h * 0.8 + Math.random() * h * 0.4, i = h * 0.53 + Math.random() * h * 0.27, C = Math.random() * Math.PI * 2, f = Math.random() * Math.PI * 2;
28
+ let c = -1 / 0;
29
+ function e(m) {
30
+ t === null && (t = m);
31
+ const l = (m - t) / 1e3, n = Y + Math.sin(l * E + C) * t5 + Math.sin(l * i + f) * 0.25;
32
+ if (Math.abs(n - c) > 0.01) {
33
+ c = n;
34
+ const g = Math.cos(n), A = Math.sin(n);
35
+ o.setAttribute("x1", `${50 + L * g}%`), o.setAttribute("y1", `${50 + L * A}%`), o.setAttribute("x2", `${50 - L * g}%`), o.setAttribute("y2", `${50 - L * A}%`);
36
+ }
37
+ s = requestAnimationFrame(e);
38
+ }
39
+ return s = requestAnimationFrame(e), () => cancelAnimationFrame(s);
40
+ }, [p]), D(() => {
41
+ const r = T.current, o = y.current;
42
+ if (!r || !o) return;
43
+ const s = (i) => {
44
+ o.style.transform = `rotate(${i}deg)`, R.current?.setAttribute(
45
+ "gradientTransform",
46
+ `rotate(${-i} 0.5 0.5)`
47
+ );
48
+ };
49
+ if (p) {
50
+ r.setAttribute("d", a[0]), o.style.opacity = "1", s(0);
51
+ return;
52
+ }
53
+ const t = { cancelled: !1 };
54
+ async function E() {
55
+ const { interpolate: i } = await import("flubber");
56
+ if (t.cancelled) return;
57
+ const C = [];
58
+ for (let e = 0; e < a.length; e++)
59
+ C.push(
60
+ i(
61
+ a[e],
62
+ a[(e + 1) % a.length]
63
+ )
64
+ );
65
+ o.style.opacity = "1";
66
+ let f = 0, c = 0;
67
+ for (; !t.cancelled; ) {
68
+ const e = C[f];
69
+ if (await new Promise((n) => setTimeout(n, J)), t.cancelled) break;
70
+ const m = c, l = c + X;
71
+ await new Promise((n) => {
72
+ if (t.cancelled) {
73
+ n();
74
+ return;
75
+ }
76
+ const g = U(0, 1 + N, {
77
+ type: "spring",
78
+ stiffness: K,
79
+ damping: Q,
80
+ mass: V,
81
+ restDelta: N,
82
+ onUpdate: (A) => {
83
+ if (t.cancelled) {
84
+ g.stop(), n();
85
+ return;
86
+ }
87
+ const _ = z(A);
88
+ r.setAttribute("d", e(_)), s(
89
+ m + _ * (l - m)
90
+ );
91
+ },
92
+ onComplete: () => {
93
+ t.cancelled || (r.setAttribute("d", e(1)), s(l)), n();
94
+ }
95
+ });
96
+ }), c = l, f = (f + 1) % a.length;
97
+ }
98
+ }
99
+ return E(), () => {
100
+ t.cancelled = !0;
101
+ };
102
+ }, [p]), /* @__PURE__ */ w(
103
+ "svg",
104
+ {
105
+ ref: v,
106
+ "aria-label": k ?? "Loading",
107
+ className: j("shrink-0", d),
108
+ "data-hook": $,
109
+ "data-slot": "loading",
110
+ "data-tracking-el": B,
111
+ "data-tracking-label": F,
112
+ fill: "none",
113
+ height: G,
114
+ role: "img",
115
+ style: { overflow: "visible" },
116
+ viewBox: "-30 -30 560 560",
117
+ width: G,
118
+ xmlns: "http://www.w3.org/2000/svg",
119
+ ...O,
120
+ children: [
121
+ /* @__PURE__ */ u("defs", { children: /* @__PURE__ */ w(
122
+ "linearGradient",
123
+ {
124
+ ref: R,
125
+ id: S,
126
+ x1: "81.8%",
127
+ x2: "18.2%",
128
+ y1: "18.2%",
129
+ y2: "81.8%",
130
+ children: [
131
+ /* @__PURE__ */ u("stop", { offset: "-60%", stopColor: "var(--loading-gradient-from)" }),
132
+ /* @__PURE__ */ u("stop", { offset: "120%", stopColor: "var(--loading-gradient-to)" })
133
+ ]
134
+ }
135
+ ) }),
136
+ /* @__PURE__ */ u(
137
+ "g",
138
+ {
139
+ ref: y,
140
+ style: {
141
+ opacity: 0,
142
+ transformOrigin: "250px 250px",
143
+ willChange: "transform"
144
+ },
145
+ children: /* @__PURE__ */ u(
146
+ "path",
147
+ {
148
+ ref: T,
149
+ d: a[0],
150
+ fill: `url(#${S})`
151
+ }
152
+ )
153
+ }
154
+ )
155
+ ]
156
+ }
157
+ );
158
+ }
159
+ );
160
+ e5.displayName = "Loading";
161
+ export {
162
+ e5 as Loading
163
+ };
package/dist/map.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),ae=require("react"),ne=require("class-variance-authority"),P=require("@brightlocal/icons"),R=require("@brightlocal/illustrations"),L=require("@brightlocal/ui-components/button"),T=require("@brightlocal/ui-components/card"),g=require("@brightlocal/ui-components/lib/utils"),j=require("@brightlocal/ui-components/popover");function oe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const p=oe(ae),se={ROADMAP:"roadmap",SATELLITE:"satellite"},le=["water","landscape","road","poi","transit"];function ie(e,t){return[...le.map(a=>({featureType:a,elementType:"geometry",stylers:[{saturation:e,lightness:t}]})),{elementType:"labels.text.fill",stylers:[{saturation:e,lightness:t-10}]},{elementType:"labels.icon",stylers:[{saturation:e,lightness:t}]}]}const E=[{elementType:"geometry",stylers:[{color:"#444444"}]},{elementType:"labels.text.fill",stylers:[{color:"#aaaaaa"}]},{elementType:"labels.text.stroke",stylers:[{color:"#323232"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#30405a"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#4b4b4b"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#5c5c5c"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#3e3e3e"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#525252"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#505050"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]}],A={default:{light:[],dark:E},muted:{light:ie(-40,20),dark:E}},k=new Set;let w=typeof document<"u"&&document.body.classList.contains("dark"),O=!1;function ce(){if(O||typeof document>"u")return;O=!0,new MutationObserver(()=>{const t=document.body.classList.contains("dark");if(t!==w){w=t;for(const a of k)a()}}).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function de(e){return k.add(e),ce(),()=>{k.delete(e)}}function ue(){return w}function pe(){return!1}function I(){return p.useSyncExternalStore(de,ue,pe)}function me(e="default"){const t=I();return A[e][t?"dark":"light"]}const _={primary:"strong",secondary:"moderate",warning:"moderate",destructive:"unranked",outline:"unranked"};function fe(e){return e in _}function ge(e){return fe(e)?_[e]:e}const h={strong:{className:"bg-primary dark:bg-green-400",cssVar:"--ds-tailwind-colors-green-400",fallback:"#2ae855"},moderate:{className:"bg-chart-4",cssVar:"--ds-tailwind-colors-yellow-400",fallback:"#facc15"},weak:{className:"bg-orange-400",cssVar:"--ds-tailwind-colors-orange-400",fallback:"#fb923c"},unranked:{className:"bg-red-600",cssVar:"--ds-tailwind-colors-red-600",fallback:"#dc2626"},error:{className:"bg-warning-background dark:bg-orange-200",cssVar:"--ds-tailwind-colors-orange-200",fallback:"#fed7aa"}},y=Object.fromEntries(Object.entries(h).map(([e,t])=>[e,t.className])),ye=ne.cva("inline-flex items-center justify-center rounded-full font-sans text-sm font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-200 ease-out hover:shadow-md",{variants:{variant:{strong:`${y.strong}`,moderate:`${y.moderate}`,weak:`${y.weak}`,unranked:`${y.unranked} text-white dark:text-white`,error:`${y.error}`}},defaultVariants:{variant:"strong"}}),C=p.forwardRef(({value:e,variant:t="strong",loading:a=!1,pulse:n,dataHook:s,className:o,trackingEl:r,trackingLabel:c,style:i,...d},m)=>{const u=ge(t);return l.jsx("div",{ref:m,className:g.cn(a?"border-border bg-accent rounded-full border":ye({variant:u}),"size-8 p-0",o),"data-hook":s,"data-slot":"map-grid-pin","data-state":a?"loading":void 0,"data-tracking-el":r||"map-grid-pin","data-tracking-label":c,style:i,...d,children:u==="error"&&!a?l.jsx(P.TriangleAlert,{"aria-hidden":"true",className:"text-warning-foreground",size:14}):String(e)})});C.displayName="MapGridPin";function D(){const t={colors:Object.fromEntries(Object.entries(h).map(([n,s])=>[n,s.fallback])),fontFamily:"Inter, system-ui, sans-serif",textColor:"#111412"};if(typeof document>"u")return t;const a=getComputedStyle(document.documentElement);return{colors:Object.fromEntries(Object.entries(h).map(([n,{cssVar:s,fallback:o}])=>[n,a.getPropertyValue(s).trim()||o])),fontFamily:a.getPropertyValue("--ds-font-font-sans").trim()||t.fontFamily,textColor:a.getPropertyValue("--ds-tailwind-colors-neutral-950").trim()||t.textColor}}function xe(){return D().colors}const be=Object.fromEntries(Object.entries(h).map(([e,t])=>[e,t.fallback])),M=["strong","moderate","weak","unranked","error"];function N(e,t){const{colors:a,fontFamily:n,textColor:s}=D(),o=40,r=o/2,c=2,i=r-c,d=i*.55,u=[...e].sort((f,x)=>M.indexOf(f.variant)-M.indexOf(x.variant)).filter(f=>f.count>0),W=u.reduce((f,x)=>f+x.count,0)||1,Z=Math.max(Number(t)||0,1);let b;const S=u[0];if(u.length<=1){const f=S?a[S.variant]:"#e5e7eb";b=`<circle cx="${r}" cy="${r}" r="${i}" fill="${f}"/>`}else{b="";let f=-Math.PI/2;for(const x of u){const $=x.count/W*Math.PI*2,v=f+$,Q=r+i*Math.cos(f),X=r+i*Math.sin(f),ee=r+i*Math.cos(v),te=r+i*Math.sin(v),re=$>Math.PI?1:0;b+=`<path d="M${r},${r}L${Q.toFixed(2)},${X.toFixed(2)}A${i},${i} 0 ${re} 1 ${ee.toFixed(2)},${te.toFixed(2)}Z" fill="${a[x.variant]}"/>`,f=v}}const J=Math.round(o*.3);return[`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}" style="filter:drop-shadow(0 1px 2px rgba(0,0,0,.15))">`,`<circle cx="${r}" cy="${r}" r="${r}" fill="white"/>`,b,`<circle cx="${r}" cy="${r}" r="${i}" fill="none" stroke="white" stroke-width="${c}"/>`,`<circle cx="${r}" cy="${r}" r="${d}" fill="white"/>`,`<text x="${r}" y="${r}" text-anchor="middle" dominant-baseline="central" font-family="${n}" font-size="${J}" font-weight="600" fill="${s}">${Z}</text>`,"</svg>"].join("")}function he(e){if(typeof DOMParser>"u")throw new Error("createClusterPinElement requires a browser environment (DOMParser). Use createClusterPinSvg for SSR.");const{markers:t,count:a,getVariant:n}=e,s=new Map;for(const m of t){const u=n(m);s.set(u,(s.get(u)??0)+1)}const o=[];for(const m of M){const u=s.get(m);u&&o.push({variant:m,count:u})}const r=N(o,a),d=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;if(!(d instanceof SVGElement))throw new Error("createClusterPinElement: failed to parse SVG");return d}const V=p.forwardRef(({segments:e,count:t,dataHook:a,className:n,trackingEl:s,trackingLabel:o,...r},c)=>{const i=JSON.stringify(e),d=p.useMemo(()=>N(e,t),[i,t]);return l.jsx("div",{dangerouslySetInnerHTML:{__html:d},ref:c,className:g.cn("inline-flex items-center justify-center",n),"data-hook":a,"data-slot":"map-cluster-pin","data-tracking-el":s||"map-cluster-pin","data-tracking-label":o,...r})});V.displayName="MapClusterPin";const F=p.forwardRef(({icon:e,animateIn:t=!1,value:a,variant:n,pulse:s,dataHook:o,className:r,trackingEl:c,trackingLabel:i,ariaLabel:d,...m},u)=>a!==void 0||n!==void 0||s!==void 0?l.jsx(C,{ref:u,className:r,dataHook:o,pulse:s,trackingEl:c,trackingLabel:i,value:a??1,variant:n,...m}):l.jsx("div",{ref:u,"aria-label":d??"Location",className:g.cn("relative inline-flex h-[46px] w-[38px] items-start justify-center",r),"data-hook":o,"data-slot":"map-location-pin","data-tracking-el":c||"map-location-pin","data-tracking-label":i,role:"img",...m,children:l.jsxs("span",{"aria-hidden":"true",className:g.cn("relative flex size-full",t&&"animate-pop-in origin-bottom will-change-transform"),children:[l.jsxs("svg",{"aria-hidden":"true",className:"size-full overflow-visible drop-shadow-sm",fill:"none",viewBox:"0 0 38 46",children:[l.jsx("path",{className:"fill-white",d:"M38 19.15C38 29.21 29.4 35.77 20.38 44.63C19.61 45.39 18.37 45.41 17.58 44.67C8.01 35.79 0 29.23 0 19.15C0 8.57 8.51 0 19 0C29.49 0 38 8.57 38 19.15Z"}),l.jsx("circle",{className:"fill-sky-500",cx:"19",cy:"19",r:"16"})]}),l.jsx("span",{className:"absolute top-[19px] left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-white",children:e??l.jsx(P.Store,{size:16})})]})}));F.displayName="MapLocationPin";const z=p.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:n,children:s,iconOnly:o=!0,...r},c)=>{const i=I();return l.jsx(L.Button,{ref:c,className:e,"data-slot":"map-control-button",dataHook:t,iconOnly:o,trackingEl:a||"map-control-button",trackingLabel:n,variant:i?"secondary":"outline",...r,children:s})});z.displayName="MapControlButton";const q=p.forwardRef(({className:e,children:t,dataHook:a,trackingEl:n,trackingLabel:s,ariaLabel:o,...r},c)=>l.jsxs("div",{ref:c,"aria-label":o??"Loading map",className:g.cn("border-border relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border",e),"data-hook":a,"data-slot":"map-loading-state","data-tracking-el":n||"map-loading-state","data-tracking-label":s,role:"status",...r,children:[l.jsx(B,{}),t&&l.jsx("div",{className:"relative",children:t})]}));q.displayName="MapLoadingState";const B=p.memo(function({rounded:t}){return l.jsx(R.MapBackground,{"aria-hidden":"true",className:g.cn("absolute inset-0 h-full w-full object-cover",t&&"rounded-[inherit]"),mode:"auto"})}),G=p.forwardRef(({className:e,title:t="We couldn't load your map rankings.",message:a="Reloading usually fixes it, and it won't use any credits",onRetry:n,retryLoading:s=!1,retryLabel:o="Reload",dataHook:r,trackingEl:c,trackingLabel:i,...d},m)=>l.jsxs("div",{ref:m,className:g.cn("border-border relative flex h-full w-full flex-col items-center justify-center gap-4 rounded-lg border p-4 text-center sm:gap-6 sm:p-8",e),"data-hook":r,"data-slot":"map-error-state","data-tracking-el":c||"map-error-state","data-tracking-label":i,role:"alert",...d,children:[l.jsx(B,{rounded:!0}),l.jsxs("div",{className:"relative flex flex-col items-center gap-4 sm:gap-6",children:[l.jsx("div",{"aria-hidden":"true",className:"flex items-center justify-center","data-slot":"map-error-illustration",children:l.jsx(R.GlobeyFixingFault,{className:"h-auto w-full max-w-41"})}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-foreground text-lg font-medium","data-slot":"map-error-title",children:t}),a&&l.jsx("p",{className:"text-muted-foreground text-sm","data-slot":"map-error-message",children:a})]}),n&&l.jsxs(L.Button,{className:"mt-1",dataHook:`${r}-retry`,loading:s,size:"sm",variant:"primary",onClick:n,children:[!s&&l.jsx(P.RefreshCw,{"aria-hidden":"true"}),o]})]})]}));G.displayName="MapErrorState";const K=p.forwardRef(({variant:e,color:t,dataHook:a,className:n,children:s,...o},r)=>{const c=e?y[e]:t;return l.jsxs("span",{ref:r,className:g.cn("text-foreground flex items-center gap-1 font-sans text-xs",n),"data-hook":a,"data-slot":"map-legend-item",...o,children:[l.jsx("span",{"aria-hidden":"true",className:g.cn("inline-block size-2 shrink-0 rounded-full",c)}),s]})});K.displayName="MapLegendItem";const Y=p.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:n,ariaLabel:s,children:o,...r},c)=>l.jsx(T.Card,{ref:c,"aria-label":s??"Map legend",className:g.cn("inline-flex w-auto max-w-none flex-row items-center bg-white font-sans dark:bg-neutral-800",e),"data-slot":"map-legend",dataHook:t,density:"condensed",role:"group",trackingEl:a||"map-legend",trackingLabel:n,variant:"border",...r,children:l.jsx(T.CardContent,{className:"flex items-center gap-3",children:o})}));Y.displayName="MapLegend";function ve(e){const{hoverWhenOpen:t=!1}=e??{},[a,n]=p.useState(null),[s,o]=p.useState(null),r=p.useCallback(d=>{o(d),n(d)},[]),c=p.useCallback(()=>{n(null)},[]),i=p.useCallback(d=>{const m={onClick:()=>r(d)};return t&&(m.onPointerEnter=u=>{u.pointerType==="mouse"&&a!=null&&r(d)}),m},[t,r,a]);return{activeItem:a,anchorItem:s,showItem:r,close:c,getInteractionProps:i}}const ke=j.Popover,H=j.PopoverAnchor;H.displayName="MapPopoverAnchor";const U=p.forwardRef(({className:e,side:t="top",sideOffset:a=4,dataHook:n,trackingEl:s,trackingLabel:o,...r},c)=>l.jsx(j.PopoverContent,{ref:c,className:g.cn("w-auto max-w-68.25 p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0",e),"data-slot":"map-popover-content","data-tracking-el":s||"map-popover","data-tracking-label":o,dataHook:n,side:t,sideOffset:a,onCloseAutoFocus:i=>i.preventDefault(),onOpenAutoFocus:i=>i.preventDefault(),...r}));U.displayName="MapPopoverContent";exports.MAP_STYLES=A;exports.MapClusterPin=V;exports.MapControlButton=z;exports.MapErrorState=G;exports.MapGridPin=C;exports.MapLegend=Y;exports.MapLegendItem=K;exports.MapLoadingState=q;exports.MapLocationPin=F;exports.MapPopover=ke;exports.MapPopoverAnchor=H;exports.MapPopoverContent=U;exports.MapTypeId=se;exports.clusterPinHexColors=be;exports.createClusterPinElement=he;exports.createClusterPinSvg=N;exports.mapGridPinColorMap=y;exports.resolveClusterPinColors=xe;exports.useMapPopoverClick=ve;exports.useMapStyles=me;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),ae=require("react"),ne=require("class-variance-authority"),P=require("@brightlocal/icons"),R=require("@brightlocal/illustrations"),L=require("@brightlocal/ui-components/button"),T=require("@brightlocal/ui-components/card"),g=require("@brightlocal/ui-components/lib/utils"),j=require("@brightlocal/ui-components/popover");function oe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const p=oe(ae),se={ROADMAP:"roadmap",SATELLITE:"satellite"},le=["water","landscape","road","poi","transit"];function ie(e,t){return[...le.map(a=>({featureType:a,elementType:"geometry",stylers:[{saturation:e,lightness:t}]})),{elementType:"labels.text.fill",stylers:[{saturation:e,lightness:t-10}]},{elementType:"labels.icon",stylers:[{saturation:e,lightness:t}]}]}const E=[{elementType:"geometry",stylers:[{color:"#444444"}]},{elementType:"labels.text.fill",stylers:[{color:"#aaaaaa"}]},{elementType:"labels.text.stroke",stylers:[{color:"#323232"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#30405a"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#4b4b4b"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#5c5c5c"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#3e3e3e"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#525252"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#505050"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]}],A={default:{light:[],dark:E},muted:{light:ie(-40,20),dark:E}},k=new Set;let w=typeof document<"u"&&!!document.body&&document.body.classList.contains("dark"),O=!1;function ce(){if(O||typeof document>"u")return;O=!0,new MutationObserver(()=>{const t=document.body.classList.contains("dark");if(t!==w){w=t;for(const a of k)a()}}).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function de(e){return k.add(e),ce(),()=>{k.delete(e)}}function ue(){return w}function pe(){return!1}function I(){return p.useSyncExternalStore(de,ue,pe)}function me(e="default"){const t=I();return A[e][t?"dark":"light"]}const _={primary:"strong",secondary:"moderate",warning:"moderate",destructive:"unranked",outline:"unranked"};function fe(e){return e in _}function ge(e){return fe(e)?_[e]:e}const h={strong:{className:"bg-primary dark:bg-green-400",cssVar:"--ds-tailwind-colors-green-400",fallback:"#2ae855"},moderate:{className:"bg-chart-4",cssVar:"--ds-tailwind-colors-yellow-400",fallback:"#facc15"},weak:{className:"bg-orange-400",cssVar:"--ds-tailwind-colors-orange-400",fallback:"#fb923c"},unranked:{className:"bg-red-600",cssVar:"--ds-tailwind-colors-red-600",fallback:"#dc2626"},error:{className:"bg-warning-background dark:bg-orange-200",cssVar:"--ds-tailwind-colors-orange-200",fallback:"#fed7aa"}},y=Object.fromEntries(Object.entries(h).map(([e,t])=>[e,t.className])),ye=ne.cva("inline-flex items-center justify-center rounded-full font-sans text-sm font-semibold text-foreground dark:text-neutral-900 border-2 border-white shadow-sm transition-shadow duration-200 ease-out hover:shadow-md",{variants:{variant:{strong:`${y.strong}`,moderate:`${y.moderate}`,weak:`${y.weak}`,unranked:`${y.unranked} text-white dark:text-white`,error:`${y.error}`}},defaultVariants:{variant:"strong"}}),C=p.forwardRef(({value:e,variant:t="strong",loading:a=!1,pulse:n,dataHook:s,className:o,trackingEl:r,trackingLabel:c,style:i,...d},m)=>{const u=ge(t);return l.jsx("div",{ref:m,className:g.cn(a?"border-border bg-accent rounded-full border":ye({variant:u}),"size-8 p-0",o),"data-hook":s,"data-slot":"map-grid-pin","data-state":a?"loading":void 0,"data-tracking-el":r||"map-grid-pin","data-tracking-label":c,style:i,...d,children:u==="error"&&!a?l.jsx(P.TriangleAlert,{"aria-hidden":"true",className:"text-warning-foreground",size:14}):String(e)})});C.displayName="MapGridPin";function D(){const t={colors:Object.fromEntries(Object.entries(h).map(([n,s])=>[n,s.fallback])),fontFamily:"Inter, system-ui, sans-serif",textColor:"#111412"};if(typeof document>"u")return t;const a=getComputedStyle(document.documentElement);return{colors:Object.fromEntries(Object.entries(h).map(([n,{cssVar:s,fallback:o}])=>[n,a.getPropertyValue(s).trim()||o])),fontFamily:a.getPropertyValue("--ds-font-font-sans").trim()||t.fontFamily,textColor:a.getPropertyValue("--ds-tailwind-colors-neutral-950").trim()||t.textColor}}function xe(){return D().colors}const be=Object.fromEntries(Object.entries(h).map(([e,t])=>[e,t.fallback])),M=["strong","moderate","weak","unranked","error"];function N(e,t){const{colors:a,fontFamily:n,textColor:s}=D(),o=40,r=o/2,c=2,i=r-c,d=i*.55,u=[...e].sort((f,x)=>M.indexOf(f.variant)-M.indexOf(x.variant)).filter(f=>f.count>0),W=u.reduce((f,x)=>f+x.count,0)||1,Z=Math.max(Number(t)||0,1);let b;const S=u[0];if(u.length<=1){const f=S?a[S.variant]:"#e5e7eb";b=`<circle cx="${r}" cy="${r}" r="${i}" fill="${f}"/>`}else{b="";let f=-Math.PI/2;for(const x of u){const $=x.count/W*Math.PI*2,v=f+$,Q=r+i*Math.cos(f),X=r+i*Math.sin(f),ee=r+i*Math.cos(v),te=r+i*Math.sin(v),re=$>Math.PI?1:0;b+=`<path d="M${r},${r}L${Q.toFixed(2)},${X.toFixed(2)}A${i},${i} 0 ${re} 1 ${ee.toFixed(2)},${te.toFixed(2)}Z" fill="${a[x.variant]}"/>`,f=v}}const J=Math.round(o*.3);return[`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 ${o} ${o}" style="filter:drop-shadow(0 1px 2px rgba(0,0,0,.15))">`,`<circle cx="${r}" cy="${r}" r="${r}" fill="white"/>`,b,`<circle cx="${r}" cy="${r}" r="${i}" fill="none" stroke="white" stroke-width="${c}"/>`,`<circle cx="${r}" cy="${r}" r="${d}" fill="white"/>`,`<text x="${r}" y="${r}" text-anchor="middle" dominant-baseline="central" font-family="${n}" font-size="${J}" font-weight="600" fill="${s}">${Z}</text>`,"</svg>"].join("")}function he(e){if(typeof DOMParser>"u")throw new Error("createClusterPinElement requires a browser environment (DOMParser). Use createClusterPinSvg for SSR.");const{markers:t,count:a,getVariant:n}=e,s=new Map;for(const m of t){const u=n(m);s.set(u,(s.get(u)??0)+1)}const o=[];for(const m of M){const u=s.get(m);u&&o.push({variant:m,count:u})}const r=N(o,a),d=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;if(!(d instanceof SVGElement))throw new Error("createClusterPinElement: failed to parse SVG");return d}const V=p.forwardRef(({segments:e,count:t,dataHook:a,className:n,trackingEl:s,trackingLabel:o,...r},c)=>{const i=JSON.stringify(e),d=p.useMemo(()=>N(e,t),[i,t]);return l.jsx("div",{dangerouslySetInnerHTML:{__html:d},ref:c,className:g.cn("inline-flex items-center justify-center",n),"data-hook":a,"data-slot":"map-cluster-pin","data-tracking-el":s||"map-cluster-pin","data-tracking-label":o,...r})});V.displayName="MapClusterPin";const F=p.forwardRef(({icon:e,animateIn:t=!1,value:a,variant:n,pulse:s,dataHook:o,className:r,trackingEl:c,trackingLabel:i,ariaLabel:d,...m},u)=>a!==void 0||n!==void 0||s!==void 0?l.jsx(C,{ref:u,className:r,dataHook:o,pulse:s,trackingEl:c,trackingLabel:i,value:a??1,variant:n,...m}):l.jsx("div",{ref:u,"aria-label":d??"Location",className:g.cn("relative inline-flex h-[46px] w-[38px] items-start justify-center",r),"data-hook":o,"data-slot":"map-location-pin","data-tracking-el":c||"map-location-pin","data-tracking-label":i,role:"img",...m,children:l.jsxs("span",{"aria-hidden":"true",className:g.cn("relative flex size-full",t&&"animate-pop-in origin-bottom will-change-transform"),children:[l.jsxs("svg",{"aria-hidden":"true",className:"size-full overflow-visible drop-shadow-sm",fill:"none",viewBox:"0 0 38 46",children:[l.jsx("path",{className:"fill-white",d:"M38 19.15C38 29.21 29.4 35.77 20.38 44.63C19.61 45.39 18.37 45.41 17.58 44.67C8.01 35.79 0 29.23 0 19.15C0 8.57 8.51 0 19 0C29.49 0 38 8.57 38 19.15Z"}),l.jsx("circle",{className:"fill-sky-500",cx:"19",cy:"19",r:"16"})]}),l.jsx("span",{className:"absolute top-[19px] left-1/2 flex -translate-x-1/2 -translate-y-1/2 items-center justify-center text-white",children:e??l.jsx(P.Store,{size:16})})]})}));F.displayName="MapLocationPin";const z=p.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:n,children:s,iconOnly:o=!0,...r},c)=>{const i=I();return l.jsx(L.Button,{ref:c,className:e,"data-slot":"map-control-button",dataHook:t,iconOnly:o,trackingEl:a||"map-control-button",trackingLabel:n,variant:i?"secondary":"outline",...r,children:s})});z.displayName="MapControlButton";const q=p.forwardRef(({className:e,children:t,dataHook:a,trackingEl:n,trackingLabel:s,ariaLabel:o,...r},c)=>l.jsxs("div",{ref:c,"aria-label":o??"Loading map",className:g.cn("border-border relative flex h-full w-full items-center justify-center overflow-hidden rounded-lg border",e),"data-hook":a,"data-slot":"map-loading-state","data-tracking-el":n||"map-loading-state","data-tracking-label":s,role:"status",...r,children:[l.jsx(B,{}),t&&l.jsx("div",{className:"relative",children:t})]}));q.displayName="MapLoadingState";const B=p.memo(function({rounded:t}){return l.jsx(R.MapBackground,{"aria-hidden":"true",className:g.cn("absolute inset-0 h-full w-full object-cover",t&&"rounded-[inherit]"),mode:"auto"})}),G=p.forwardRef(({className:e,title:t="We couldn't load your map rankings.",message:a="Reloading usually fixes it, and it won't use any credits",onRetry:n,retryLoading:s=!1,retryLabel:o="Reload",dataHook:r,trackingEl:c,trackingLabel:i,...d},m)=>l.jsxs("div",{ref:m,className:g.cn("border-border relative flex h-full w-full flex-col items-center justify-center gap-4 rounded-lg border p-4 text-center sm:gap-6 sm:p-8",e),"data-hook":r,"data-slot":"map-error-state","data-tracking-el":c||"map-error-state","data-tracking-label":i,role:"alert",...d,children:[l.jsx(B,{rounded:!0}),l.jsxs("div",{className:"relative flex flex-col items-center gap-4 sm:gap-6",children:[l.jsx("div",{"aria-hidden":"true",className:"flex items-center justify-center","data-slot":"map-error-illustration",children:l.jsx(R.GlobeyFixingFault,{className:"h-auto w-full max-w-41"})}),l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsx("h3",{className:"text-foreground text-lg font-medium","data-slot":"map-error-title",children:t}),a&&l.jsx("p",{className:"text-muted-foreground text-sm","data-slot":"map-error-message",children:a})]}),n&&l.jsxs(L.Button,{className:"mt-1",dataHook:`${r}-retry`,loading:s,size:"sm",variant:"primary",onClick:n,children:[!s&&l.jsx(P.RefreshCw,{"aria-hidden":"true"}),o]})]})]}));G.displayName="MapErrorState";const K=p.forwardRef(({variant:e,color:t,dataHook:a,className:n,children:s,...o},r)=>{const c=e?y[e]:t;return l.jsxs("span",{ref:r,className:g.cn("text-foreground flex items-center gap-1 font-sans text-xs",n),"data-hook":a,"data-slot":"map-legend-item",...o,children:[l.jsx("span",{"aria-hidden":"true",className:g.cn("inline-block size-2 shrink-0 rounded-full",c)}),s]})});K.displayName="MapLegendItem";const Y=p.forwardRef(({className:e,dataHook:t,trackingEl:a,trackingLabel:n,ariaLabel:s,children:o,...r},c)=>l.jsx(T.Card,{ref:c,"aria-label":s??"Map legend",className:g.cn("inline-flex w-auto max-w-none flex-row items-center bg-white font-sans dark:bg-neutral-800",e),"data-slot":"map-legend",dataHook:t,density:"condensed",role:"group",trackingEl:a||"map-legend",trackingLabel:n,variant:"border",...r,children:l.jsx(T.CardContent,{className:"flex items-center gap-3",children:o})}));Y.displayName="MapLegend";function ve(e){const{hoverWhenOpen:t=!1}=e??{},[a,n]=p.useState(null),[s,o]=p.useState(null),r=p.useCallback(d=>{o(d),n(d)},[]),c=p.useCallback(()=>{n(null)},[]),i=p.useCallback(d=>{const m={onClick:()=>r(d)};return t&&(m.onPointerEnter=u=>{u.pointerType==="mouse"&&a!=null&&r(d)}),m},[t,r,a]);return{activeItem:a,anchorItem:s,showItem:r,close:c,getInteractionProps:i}}const ke=j.Popover,H=j.PopoverAnchor;H.displayName="MapPopoverAnchor";const U=p.forwardRef(({className:e,side:t="top",sideOffset:a=4,dataHook:n,trackingEl:s,trackingLabel:o,...r},c)=>l.jsx(j.PopoverContent,{ref:c,className:g.cn("w-auto max-w-68.25 p-3 data-[state=closed]:animate-none data-[state=closed]:opacity-0",e),"data-slot":"map-popover-content","data-tracking-el":s||"map-popover","data-tracking-label":o,dataHook:n,side:t,sideOffset:a,onCloseAutoFocus:i=>i.preventDefault(),onOpenAutoFocus:i=>i.preventDefault(),...r}));U.displayName="MapPopoverContent";exports.MAP_STYLES=A;exports.MapClusterPin=V;exports.MapControlButton=z;exports.MapErrorState=G;exports.MapGridPin=C;exports.MapLegend=Y;exports.MapLegendItem=K;exports.MapLoadingState=q;exports.MapLocationPin=F;exports.MapPopover=ke;exports.MapPopoverAnchor=H;exports.MapPopoverContent=U;exports.MapTypeId=se;exports.clusterPinHexColors=be;exports.createClusterPinElement=he;exports.createClusterPinSvg=N;exports.mapGridPinColorMap=y;exports.resolveClusterPinColors=xe;exports.useMapPopoverClick=ve;exports.useMapStyles=me;
package/dist/map.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/components/map.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EACL,OAAO,EAGP,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;AAM5C;;;;GAIG;AACH,QAAA,MAAM,SAAS;IACb,4BAA4B;;IAE5B,gFAAgF;;CAExE,CAAC;AAEX;;GAEG;AACH,KAAK,cAAc,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAMjE;;;;GAIG;AACH,KAAK,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3C;;;;GAIG;AACH,KAAK,YAAY,GAAG;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,E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AC,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,iBAAiB,4GAiCtB,CAAC;AAQF,OAAO,EACL,UAAU,EACV,SAAS,EACT,cAAc,EACd,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,GACnB,CAAC;AAEF,YAAY,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,IAAI,aAAa,EAChC,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,GACvB,CAAC"}
1
+ {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/components/map.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,EACL,OAAO,EAGP,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;AAM5C;;;;GAIG;AACH,QAAA,MAAM,SAAS;IACb,4BAA4B;;IAE5B,gFAAgF;;CAExE,CAAC;AAEX;;GAEG;AACH,KAAK,cAAc,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC;AAMjE;;;;GAIG;AACH,KAAK,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC;AAE3C;;;;GAIG;AACH,KAAK,YAAY,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IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,iBAAiB,4GAiCtB,CAAC;AAQF,OAAO,EACL,UAAU,EACV,SAAS,EACT,cAAc,EACd,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,SAAS,EACT,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,kBAAkB,GACnB,CAAC;AAEF,YAAY,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,IAAI,aAAa,EAChC,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,GACvB,CAAC"}
package/dist/map.js CHANGED
@@ -69,7 +69,7 @@ const $ = [
69
69
  default: { light: [], dark: $ },
70
70
  muted: { light: re(-40, 20), dark: $ }
71
71
  }, w = /* @__PURE__ */ new Set();
72
- let M = typeof document < "u" && document.body.classList.contains("dark"), S = !1;
72
+ let M = typeof document < "u" && !!document.body && document.body.classList.contains("dark"), S = !1;
73
73
  function oe() {
74
74
  if (S || typeof document > "u") return;
75
75
  S = !0, new MutationObserver(() => {