@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/field.js CHANGED
@@ -11,6 +11,9 @@ function m({ className: t, ...a }) {
11
11
  className: r(
12
12
  "flex flex-col gap-6",
13
13
  "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
14
+ // sr-only children (FieldLegend srOnly) are position:absolute — FieldSet
15
+ // must be their containing block (see components.md sr-only rule)
16
+ "has-[>.sr-only]:relative",
14
17
  t
15
18
  ),
16
19
  "data-slot": "field-set",
@@ -19,11 +22,12 @@ function m({ className: t, ...a }) {
19
22
  );
20
23
  }
21
24
  m.displayName = "FieldSet";
22
- const y = ["legend", "label"];
25
+ const N = ["legend", "label"];
23
26
  function F({
24
27
  className: t,
25
28
  variant: a = "legend",
26
- ...e
29
+ srOnly: e = !1,
30
+ ...d
27
31
  }) {
28
32
  return /* @__PURE__ */ l(
29
33
  "legend",
@@ -32,11 +36,12 @@ function F({
32
36
  "mb-3 font-medium",
33
37
  "data-[variant=legend]:text-base",
34
38
  "data-[variant=label]:text-sm",
39
+ e && "sr-only",
35
40
  t
36
41
  ),
37
42
  "data-slot": "field-legend",
38
43
  "data-variant": a,
39
- ...e
44
+ ...d
40
45
  }
41
46
  );
42
47
  }
@@ -63,7 +68,10 @@ const b = u(
63
68
  // Checkbox context: match RadioGroup gap-3 spacing
64
69
  "has-[>[role=checkbox]]:gap-3",
65
70
  // Label leading overrides: use leading-normal for wrap-capable labels (checkbox)
66
- "has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal"
71
+ "has-[>[role=checkbox]]:[&_[data-slot=field-label]]:leading-normal",
72
+ // sr-only children are position:absolute — Field must be their containing
73
+ // block so they cannot escape scroll viewports (see components.md sr-only rule)
74
+ "has-[>.sr-only]:relative"
67
75
  ],
68
76
  {
69
77
  variants: {
@@ -72,12 +80,20 @@ const b = u(
72
80
  horizontal: [
73
81
  "grid grid-cols-[auto_1fr] items-center gap-x-2",
74
82
  "[&>[data-slot=field-description]]:col-start-2 [&>[data-slot=field-error]]:col-start-2",
75
- "has-[>[data-slot=field-content]]:items-start"
83
+ "has-[>[data-slot=field-content]]:items-start",
84
+ // sr-only label leaves grid flow — collapse to a single column
85
+ "has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]",
86
+ "[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1",
87
+ "[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-error]]:col-start-1"
76
88
  ],
77
89
  responsive: [
78
90
  "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:grid @md/field-group:grid-cols-[auto_1fr] @md/field-group:items-center @md/field-group:[&>*]:w-auto",
79
91
  "@md/field-group:[&>[data-slot=field-description]]:col-start-2 @md/field-group:[&>[data-slot=field-error]]:col-start-2",
80
- "@md/field-group:has-[>[data-slot=field-content]]:items-start"
92
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start",
93
+ // sr-only label leaves grid flow — collapse to a single column
94
+ "@md/field-group:has-[>.sr-only[data-slot=field-label]]:grid-cols-[1fr]",
95
+ "@md/field-group:[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-description]]:col-start-1",
96
+ "@md/field-group:[&:has(>.sr-only[data-slot=field-label])>[data-slot=field-error]]:col-start-1"
81
97
  ]
82
98
  },
83
99
  variant: {
@@ -252,5 +268,5 @@ export {
252
268
  I as FieldLabel,
253
269
  F as FieldLegend,
254
270
  m as FieldSet,
255
- y as fieldLegendVariants
271
+ N as fieldLegendVariants
256
272
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),h=require("react"),d=require("@brightlocal/ui-components/lib/utils"),v=require("./header.cjs"),w=require("./scroll-area.cjs");function k(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const i=k(h),u=i.forwardRef(({className:t,maxWidth:a="var(--ds-breakpoint-xl)",dataHook:e,trackingEl:o,trackingLabel:l,children:n,...r},c)=>{const g=typeof a=="number"?`${a}px`:a;return s.jsx(w.ScrollArea,{className:d.cn("h-dvh w-full [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",t),dataHook:`${e}-scroll`,scrollOrientation:"both",children:s.jsx("div",{ref:c,className:"p-section-sm flex min-h-dvh w-full flex-col","data-hook":e,"data-slot":"global-layout","data-tracking-el":o,"data-tracking-label":l,...r,children:s.jsx("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:g},children:n})})})});u.displayName="GlobalLayout";const G="224px",b=i.forwardRef(({className:t,width:a=G,dataHook:e,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("aside",{ref:n,className:d.cn("sticky hidden shrink-0 self-start outline-none lg:block",t),"data-hook":e,"data-slot":"sidebar-container",...l,style:{width:r,top:"var(--ds-section-padding-y-sm)",height:"calc(100dvh - 2 * var(--ds-section-padding-y-sm))",...l.style},children:o})});b.displayName="GlobalLayoutSidebar";const y=i.forwardRef(({className:t,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:e,children:o,...l},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("div",{ref:n,className:d.cn("px-section-xs flex min-w-0 flex-1 flex-col gap-6",t),"data-hook":e,"data-slot":"content-wrapper",style:{"--content-max-width":r},...l,children:o})});y.displayName="GlobalLayoutContent";const f=i.forwardRef(({className:t,dataHook:a,trackingEl:e,trackingLabel:o,children:l,...n},r)=>s.jsx(v.Header,{ref:r,className:d.cn("mx-auto w-full flex-wrap justify-between gap-4",t),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:e,trackingLabel:o,...n,children:l}));f.displayName="GlobalLayoutContentHeader";const m=i.forwardRef(({className:t,dataHook:a,trackingEl:e,trackingLabel:o,children:l,...n},r)=>s.jsx("div",{ref:r,className:d.cn("mx-auto hidden w-full items-center justify-end gap-2 lg:flex",t),"data-hook":a,"data-slot":"content-actions","data-tracking-el":e,"data-tracking-label":o,style:{maxWidth:"var(--ds-breakpoint-lg)"},...n,children:l}));m.displayName="GlobalLayoutContentActions";const x=i.forwardRef(({className:t,dataHook:a,trackingEl:e,trackingLabel:o,children:l,...n},r)=>s.jsx("div",{ref:r,className:d.cn("mx-auto flex w-full flex-1 flex-col gap-6",t),"data-hook":a,"data-slot":"content-body","data-tracking-el":e,"data-tracking-label":o,style:{maxWidth:"var(--content-max-width)"},...n,children:l}));x.displayName="GlobalLayoutContentBody";const p=i.forwardRef(({className:t,dataHook:a,ariaLabel:e,trackingEl:o,trackingLabel:l,children:n,...r},c)=>s.jsx("div",{ref:c,"aria-label":e??"Mobile navigation",className:d.cn("flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",t),"data-hook":a,"data-slot":"mobile-header","data-tracking-el":o,"data-tracking-label":l,role:"toolbar",...r,children:n}));p.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=u;exports.GlobalLayoutContent=y;exports.GlobalLayoutContentActions=m;exports.GlobalLayoutContentBody=x;exports.GlobalLayoutContentHeader=f;exports.GlobalLayoutMobileHeader=p;exports.GlobalLayoutSidebar=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),G=require("react"),j=require("@brightlocal/icons"),c=require("@brightlocal/ui-components/lib/utils"),x=require("./header.cjs"),N=require("./link.cjs"),C=require("./scroll-area.cjs"),R=require("./typography.cjs");function S(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=S(G),m=i.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-xl)",dataHook:t,trackingEl:l,trackingLabel:o,children:n,...r},d)=>{const b=typeof a=="number"?`${a}px`:a;return s.jsx(C.ScrollArea,{className:c.cn("h-dvh w-full [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",e),dataHook:`${t}-scroll`,scrollOrientation:"both",children:s.jsx("div",{ref:d,className:"p-section-sm flex min-h-dvh w-full flex-col","data-hook":t,"data-slot":"global-layout","data-tracking-el":l,"data-tracking-label":o,...r,children:s.jsx("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:b},children:n})})})});m.displayName="GlobalLayout";const H="224px",h=i.forwardRef(({className:e,width:a=H,dataHook:t,children:l,...o},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("aside",{ref:n,className:c.cn("sticky hidden shrink-0 self-start outline-none lg:block",e),"data-hook":t,"data-slot":"sidebar-container",...o,style:{width:r,top:"var(--ds-section-padding-y-sm)",height:"calc(100dvh - 2 * var(--ds-section-padding-y-sm))",...o.style},children:l})});h.displayName="GlobalLayoutSidebar";const k=i.forwardRef(({className:e,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:t,children:l,...o},n)=>{const r=typeof a=="number"?`${a}px`:a;return s.jsx("div",{ref:n,className:c.cn("px-section-xs flex min-w-0 flex-1 flex-col gap-6",e),"data-hook":t,"data-slot":"content-wrapper",style:{"--content-max-width":r},...o,children:l})});k.displayName="GlobalLayoutContent";const y=i.forwardRef(({dataHook:e,ariaLabel:a,href:t,onClick:l,...o},n)=>{const r=d=>{t===void 0&&d.preventDefault(),l?.(d)};return s.jsx(N.Link,{ref:n,"aria-label":a||"Go back","data-slot":"content-header-back-link",dataHook:e??"content-header-back-link",href:t??"#",variant:"icon",onClick:r,...o,children:s.jsx(j.ArrowLeft,{"aria-hidden":"true"})})});y.displayName="GlobalLayoutBackLink";const f=i.forwardRef(({dataHook:e,...a},t)=>s.jsx(R.TypographyMuted,{ref:t,"data-slot":"content-header-subtitle",dataHook:e??"content-header-subtitle",...a}));f.displayName="GlobalLayoutSubtitle";const g=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:l,children:o,...n},r)=>{const d=[],b=[],p=[];return i.Children.forEach(o,u=>{i.isValidElement(u)&&u.type===y?d.push(u):i.isValidElement(u)&&u.type===f?b.push(u):p.push(u)}),d.length===0&&b.length===0?s.jsx(x.Header,{ref:r,className:c.cn("mx-auto w-full flex-wrap justify-between gap-4",e),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:t,trackingLabel:l,...n,children:o}):s.jsxs(x.Header,{ref:r,className:c.cn("mx-auto w-full items-start",e),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:t,trackingLabel:l,...n,children:[d,s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2","data-slot":"content-header-body",children:[s.jsx("div",{className:"flex w-full flex-wrap items-center justify-between gap-4","data-slot":"content-header-title",children:p}),b]})]})});g.displayName="GlobalLayoutContentHeader";const w=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:l,children:o,...n},r)=>s.jsx("div",{ref:r,className:c.cn("mx-auto hidden w-full items-center justify-end gap-2 lg:flex",e),"data-hook":a,"data-slot":"content-actions","data-tracking-el":t,"data-tracking-label":l,style:{maxWidth:"var(--ds-breakpoint-lg)"},...n,children:o}));w.displayName="GlobalLayoutContentActions";const L=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:l,children:o,...n},r)=>s.jsx("div",{ref:r,className:c.cn("mx-auto flex w-full flex-1 flex-col gap-6",e),"data-hook":a,"data-slot":"content-body","data-tracking-el":t,"data-tracking-label":l,style:{maxWidth:"var(--content-max-width)"},...n,children:o}));L.displayName="GlobalLayoutContentBody";const v=i.forwardRef(({className:e,dataHook:a,ariaLabel:t,trackingEl:l,trackingLabel:o,children:n,...r},d)=>s.jsx("div",{ref:d,"aria-label":t??"Mobile navigation",className:c.cn("flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",e),"data-hook":a,"data-slot":"mobile-header","data-tracking-el":l,"data-tracking-label":o,role:"toolbar",...r,children:n}));v.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=m;exports.GlobalLayoutBackLink=y;exports.GlobalLayoutContent=k;exports.GlobalLayoutContentActions=w;exports.GlobalLayoutContentBody=L;exports.GlobalLayoutContentHeader=g;exports.GlobalLayoutMobileHeader=v;exports.GlobalLayoutSidebar=h;exports.GlobalLayoutSubtitle=f;
@@ -42,6 +42,36 @@ interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
42
42
  maxWidth?: string | number;
43
43
  }
44
44
  declare const GlobalLayoutContent: React.ForwardRefExoticComponent<Omit<GlobalLayoutContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
45
+ interface GlobalLayoutBackLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
46
+ /**
47
+ * Data hook for automated testing
48
+ * @default "content-header-back-link"
49
+ */
50
+ dataHook?: string;
51
+ /**
52
+ * Accessible label for the icon-only back link.
53
+ * @default "Go back"
54
+ */
55
+ ariaLabel?: string;
56
+ }
57
+ /**
58
+ * Icon-only back link for the page header. Place it as a direct child of
59
+ * `GlobalLayoutContentHeader` — the header positions it before the title.
60
+ * Pass `href` for URL navigation or `onClick` for SPA router navigation.
61
+ */
62
+ declare const GlobalLayoutBackLink: React.ForwardRefExoticComponent<GlobalLayoutBackLinkProps & React.RefAttributes<HTMLAnchorElement>>;
63
+ interface GlobalLayoutSubtitleProps extends React.ComponentProps<"p"> {
64
+ /**
65
+ * Data hook for automated testing
66
+ * @default "content-header-subtitle"
67
+ */
68
+ dataHook?: string;
69
+ }
70
+ /**
71
+ * Muted description text for the page header. Place it as a direct child of
72
+ * `GlobalLayoutContentHeader` — the header positions it below the title row.
73
+ */
74
+ declare const GlobalLayoutSubtitle: React.ForwardRefExoticComponent<Omit<GlobalLayoutSubtitleProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
45
75
  interface GlobalLayoutContentHeaderProps extends React.ComponentProps<"header"> {
46
76
  /**
47
77
  * Data hook for automated testing (required)
@@ -107,6 +137,6 @@ interface GlobalLayoutMobileHeaderProps extends React.ComponentProps<"div"> {
107
137
  trackingLabel?: string;
108
138
  }
109
139
  declare const GlobalLayoutMobileHeader: React.ForwardRefExoticComponent<Omit<GlobalLayoutMobileHeaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
110
- export { GlobalLayout, GlobalLayoutSidebar, GlobalLayoutContent, GlobalLayoutContentActions, GlobalLayoutContentHeader, GlobalLayoutContentBody, GlobalLayoutMobileHeader, };
111
- export type { GlobalLayoutProps, GlobalLayoutSidebarProps, GlobalLayoutContentProps, GlobalLayoutContentActionsProps, GlobalLayoutContentHeaderProps, GlobalLayoutContentBodyProps, GlobalLayoutMobileHeaderProps, };
140
+ export { GlobalLayout, GlobalLayoutSidebar, GlobalLayoutContent, GlobalLayoutContentActions, GlobalLayoutContentHeader, GlobalLayoutBackLink, GlobalLayoutSubtitle, GlobalLayoutContentBody, GlobalLayoutMobileHeader, };
141
+ export type { GlobalLayoutProps, GlobalLayoutSidebarProps, GlobalLayoutContentProps, GlobalLayoutContentActionsProps, GlobalLayoutContentHeaderProps, GlobalLayoutBackLinkProps, GlobalLayoutSubtitleProps, GlobalLayoutContentBodyProps, GlobalLayoutMobileHeaderProps, };
112
142
  //# sourceMappingURL=global-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources":["../../src/components/global-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC7D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,QAAA,MAAM,YAAY,uGA6CjB,CAAC;AAMF,UAAU,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IACtE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,mBAAmB,2GA0BvB,CAAC;AAIH,UAAU,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACpE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,QAAA,MAAM,mBAAmB,8GAmCxB,CAAC;AAIF,UAA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EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,GACzB,CAAC;AAEF,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,EAC5B,6BAA6B,GAC9B,CAAC"}
@@ -1,45 +1,48 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { cn as i } from "@brightlocal/ui-components/lib/utils";
4
- import { Header as m } from "./header.js";
5
- import { ScrollArea as y } from "./scroll-area.js";
6
- const b = s.forwardRef(
1
+ import { jsx as s, jsxs as b } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { ArrowLeft as x } from "@brightlocal/icons";
4
+ import { cn as c } from "@brightlocal/ui-components/lib/utils";
5
+ import { Header as y } from "./header.js";
6
+ import { Link as k } from "./link.js";
7
+ import { ScrollArea as w } from "./scroll-area.js";
8
+ import { TypographyMuted as g } from "./typography.js";
9
+ const v = i.forwardRef(
7
10
  ({
8
- className: o,
11
+ className: e,
9
12
  maxWidth: a = "var(--ds-breakpoint-xl)",
10
13
  dataHook: t,
11
- trackingEl: l,
12
- trackingLabel: e,
13
- children: r,
14
- ...n
15
- }, c) => {
16
- const f = typeof a == "number" ? `${a}px` : a;
17
- return /* @__PURE__ */ d(
18
- y,
14
+ trackingEl: o,
15
+ trackingLabel: l,
16
+ children: n,
17
+ ...r
18
+ }, d) => {
19
+ const u = typeof a == "number" ? `${a}px` : a;
20
+ return /* @__PURE__ */ s(
21
+ w,
19
22
  {
20
- className: i(
23
+ className: c(
21
24
  "h-dvh w-full [&>[data-radix-scroll-area-viewport]>div]:block! [&>[data-radix-scroll-area-viewport]>div]:min-w-0!",
22
- o
25
+ e
23
26
  ),
24
27
  dataHook: `${t}-scroll`,
25
28
  scrollOrientation: "both",
26
- children: /* @__PURE__ */ d(
29
+ children: /* @__PURE__ */ s(
27
30
  "div",
28
31
  {
29
- ref: c,
32
+ ref: d,
30
33
  className: "p-section-sm flex min-h-dvh w-full flex-col",
31
34
  "data-hook": t,
32
35
  "data-slot": "global-layout",
33
- "data-tracking-el": l,
34
- "data-tracking-label": e,
35
- ...n,
36
- children: /* @__PURE__ */ d(
36
+ "data-tracking-el": o,
37
+ "data-tracking-label": l,
38
+ ...r,
39
+ children: /* @__PURE__ */ s(
37
40
  "div",
38
41
  {
39
42
  className: "mx-auto flex w-full flex-1",
40
43
  "data-slot": "global-container",
41
- style: { maxWidth: f },
42
- children: r
44
+ style: { maxWidth: u },
45
+ children: n
43
46
  }
44
47
  )
45
48
  }
@@ -48,150 +51,217 @@ const b = s.forwardRef(
48
51
  );
49
52
  }
50
53
  );
51
- b.displayName = "GlobalLayout";
52
- const u = "224px", p = s.forwardRef(({ className: o, width: a = u, dataHook: t, children: l, ...e }, r) => {
53
- const n = typeof a == "number" ? `${a}px` : a;
54
- return /* @__PURE__ */ d(
54
+ v.displayName = "GlobalLayout";
55
+ const L = "224px", N = i.forwardRef(({ className: e, width: a = L, dataHook: t, children: o, ...l }, n) => {
56
+ const r = typeof a == "number" ? `${a}px` : a;
57
+ return /* @__PURE__ */ s(
55
58
  "aside",
56
59
  {
57
- ref: r,
58
- className: i(
60
+ ref: n,
61
+ className: c(
59
62
  "sticky hidden shrink-0 self-start outline-none lg:block",
60
- o
63
+ e
61
64
  ),
62
65
  "data-hook": t,
63
66
  "data-slot": "sidebar-container",
64
- ...e,
67
+ ...l,
65
68
  style: {
66
- width: n,
69
+ width: r,
67
70
  top: "var(--ds-section-padding-y-sm)",
68
71
  height: "calc(100dvh - 2 * var(--ds-section-padding-y-sm))",
69
- ...e.style
72
+ ...l.style
70
73
  },
71
- children: l
74
+ children: o
72
75
  }
73
76
  );
74
77
  });
75
- p.displayName = "GlobalLayoutSidebar";
76
- const x = s.forwardRef(
78
+ N.displayName = "GlobalLayoutSidebar";
79
+ const G = i.forwardRef(
77
80
  ({
78
- className: o,
81
+ className: e,
79
82
  maxWidth: a = "var(--ds-breakpoint-lg)",
80
83
  dataHook: t,
81
- children: l,
82
- ...e
83
- }, r) => {
84
- const n = typeof a == "number" ? `${a}px` : a;
85
- return /* @__PURE__ */ d(
84
+ children: o,
85
+ ...l
86
+ }, n) => {
87
+ const r = typeof a == "number" ? `${a}px` : a;
88
+ return /* @__PURE__ */ s(
86
89
  "div",
87
90
  {
88
- ref: r,
89
- className: i(
91
+ ref: n,
92
+ className: c(
90
93
  "px-section-xs flex min-w-0 flex-1 flex-col gap-6",
91
- o
94
+ e
92
95
  ),
93
96
  "data-hook": t,
94
97
  "data-slot": "content-wrapper",
95
- style: { "--content-max-width": n },
96
- ...e,
97
- children: l
98
+ style: { "--content-max-width": r },
99
+ ...l,
100
+ children: o
98
101
  }
99
102
  );
100
103
  }
101
104
  );
102
- x.displayName = "GlobalLayoutContent";
103
- const h = s.forwardRef(
104
- ({ className: o, dataHook: a, trackingEl: t, trackingLabel: l, children: e, ...r }, n) => /* @__PURE__ */ d(
105
- m,
106
- {
107
- ref: n,
108
- className: i(
109
- "mx-auto w-full flex-wrap justify-between gap-4",
110
- o
111
- ),
112
- "data-slot": "content-header",
113
- dataHook: a,
114
- style: { maxWidth: "var(--ds-breakpoint-lg)" },
115
- trackingEl: t,
116
- trackingLabel: l,
117
- ...r,
118
- children: e
119
- }
120
- )
105
+ G.displayName = "GlobalLayoutContent";
106
+ const p = i.forwardRef(({ dataHook: e, ariaLabel: a, href: t, onClick: o, ...l }, n) => /* @__PURE__ */ s(
107
+ k,
108
+ {
109
+ ref: n,
110
+ "aria-label": a || "Go back",
111
+ "data-slot": "content-header-back-link",
112
+ dataHook: e ?? "content-header-back-link",
113
+ href: t ?? "#",
114
+ variant: "icon",
115
+ onClick: (d) => {
116
+ t === void 0 && d.preventDefault(), o?.(d);
117
+ },
118
+ ...l,
119
+ children: /* @__PURE__ */ s(x, { "aria-hidden": "true" })
120
+ }
121
+ ));
122
+ p.displayName = "GlobalLayoutBackLink";
123
+ const h = i.forwardRef(({ dataHook: e, ...a }, t) => /* @__PURE__ */ s(
124
+ g,
125
+ {
126
+ ref: t,
127
+ "data-slot": "content-header-subtitle",
128
+ dataHook: e ?? "content-header-subtitle",
129
+ ...a
130
+ }
131
+ ));
132
+ h.displayName = "GlobalLayoutSubtitle";
133
+ const C = i.forwardRef(
134
+ ({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: l, ...n }, r) => {
135
+ const d = [], u = [], m = [];
136
+ return i.Children.forEach(l, (f) => {
137
+ i.isValidElement(f) && f.type === p ? d.push(f) : i.isValidElement(f) && f.type === h ? u.push(f) : m.push(f);
138
+ }), d.length === 0 && u.length === 0 ? /* @__PURE__ */ s(
139
+ y,
140
+ {
141
+ ref: r,
142
+ className: c(
143
+ "mx-auto w-full flex-wrap justify-between gap-4",
144
+ e
145
+ ),
146
+ "data-slot": "content-header",
147
+ dataHook: a,
148
+ style: { maxWidth: "var(--ds-breakpoint-lg)" },
149
+ trackingEl: t,
150
+ trackingLabel: o,
151
+ ...n,
152
+ children: l
153
+ }
154
+ ) : /* @__PURE__ */ b(
155
+ y,
156
+ {
157
+ ref: r,
158
+ className: c("mx-auto w-full items-start", e),
159
+ "data-slot": "content-header",
160
+ dataHook: a,
161
+ style: { maxWidth: "var(--ds-breakpoint-lg)" },
162
+ trackingEl: t,
163
+ trackingLabel: o,
164
+ ...n,
165
+ children: [
166
+ d,
167
+ /* @__PURE__ */ b(
168
+ "div",
169
+ {
170
+ className: "flex min-w-0 flex-1 flex-col gap-2",
171
+ "data-slot": "content-header-body",
172
+ children: [
173
+ /* @__PURE__ */ s(
174
+ "div",
175
+ {
176
+ className: "flex w-full flex-wrap items-center justify-between gap-4",
177
+ "data-slot": "content-header-title",
178
+ children: m
179
+ }
180
+ ),
181
+ u
182
+ ]
183
+ }
184
+ )
185
+ ]
186
+ }
187
+ );
188
+ }
121
189
  );
122
- h.displayName = "GlobalLayoutContentHeader";
123
- const g = s.forwardRef(
124
- ({ className: o, dataHook: a, trackingEl: t, trackingLabel: l, children: e, ...r }, n) => /* @__PURE__ */ d(
190
+ C.displayName = "GlobalLayoutContentHeader";
191
+ const R = i.forwardRef(
192
+ ({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: l, ...n }, r) => /* @__PURE__ */ s(
125
193
  "div",
126
194
  {
127
- ref: n,
128
- className: i(
195
+ ref: r,
196
+ className: c(
129
197
  "mx-auto hidden w-full items-center justify-end gap-2 lg:flex",
130
- o
198
+ e
131
199
  ),
132
200
  "data-hook": a,
133
201
  "data-slot": "content-actions",
134
202
  "data-tracking-el": t,
135
- "data-tracking-label": l,
203
+ "data-tracking-label": o,
136
204
  style: { maxWidth: "var(--ds-breakpoint-lg)" },
137
- ...r,
138
- children: e
205
+ ...n,
206
+ children: l
139
207
  }
140
208
  )
141
209
  );
142
- g.displayName = "GlobalLayoutContentActions";
143
- const v = s.forwardRef(
144
- ({ className: o, dataHook: a, trackingEl: t, trackingLabel: l, children: e, ...r }, n) => /* @__PURE__ */ d(
210
+ R.displayName = "GlobalLayoutContentActions";
211
+ const H = i.forwardRef(
212
+ ({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: l, ...n }, r) => /* @__PURE__ */ s(
145
213
  "div",
146
214
  {
147
- ref: n,
148
- className: i("mx-auto flex w-full flex-1 flex-col gap-6", o),
215
+ ref: r,
216
+ className: c("mx-auto flex w-full flex-1 flex-col gap-6", e),
149
217
  "data-hook": a,
150
218
  "data-slot": "content-body",
151
219
  "data-tracking-el": t,
152
- "data-tracking-label": l,
220
+ "data-tracking-label": o,
153
221
  style: { maxWidth: "var(--content-max-width)" },
154
- ...r,
155
- children: e
222
+ ...n,
223
+ children: l
156
224
  }
157
225
  )
158
226
  );
159
- v.displayName = "GlobalLayoutContentBody";
160
- const w = s.forwardRef(
227
+ H.displayName = "GlobalLayoutContentBody";
228
+ const S = i.forwardRef(
161
229
  ({
162
- className: o,
230
+ className: e,
163
231
  dataHook: a,
164
232
  ariaLabel: t,
165
- trackingEl: l,
166
- trackingLabel: e,
167
- children: r,
168
- ...n
169
- }, c) => /* @__PURE__ */ d(
233
+ trackingEl: o,
234
+ trackingLabel: l,
235
+ children: n,
236
+ ...r
237
+ }, d) => /* @__PURE__ */ s(
170
238
  "div",
171
239
  {
172
- ref: c,
240
+ ref: d,
173
241
  "aria-label": t ?? "Mobile navigation",
174
- className: i(
242
+ className: c(
175
243
  "flex w-full items-center justify-start gap-2.5 py-2 lg:hidden",
176
- o
244
+ e
177
245
  ),
178
246
  "data-hook": a,
179
247
  "data-slot": "mobile-header",
180
- "data-tracking-el": l,
181
- "data-tracking-label": e,
248
+ "data-tracking-el": o,
249
+ "data-tracking-label": l,
182
250
  role: "toolbar",
183
- ...n,
184
- children: r
251
+ ...r,
252
+ children: n
185
253
  }
186
254
  )
187
255
  );
188
- w.displayName = "GlobalLayoutMobileHeader";
256
+ S.displayName = "GlobalLayoutMobileHeader";
189
257
  export {
190
- b as GlobalLayout,
191
- x as GlobalLayoutContent,
192
- g as GlobalLayoutContentActions,
193
- v as GlobalLayoutContentBody,
194
- h as GlobalLayoutContentHeader,
195
- w as GlobalLayoutMobileHeader,
196
- p as GlobalLayoutSidebar
258
+ v as GlobalLayout,
259
+ p as GlobalLayoutBackLink,
260
+ G as GlobalLayoutContent,
261
+ R as GlobalLayoutContentActions,
262
+ H as GlobalLayoutContentBody,
263
+ C as GlobalLayoutContentHeader,
264
+ S as GlobalLayoutMobileHeader,
265
+ N as GlobalLayoutSidebar,
266
+ h as GlobalLayoutSubtitle
197
267
  };