@brightlocal/ui-components 3.4.0 → 3.5.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 (196) hide show
  1. package/AI_USAGE.md +22 -3
  2. package/README.md +177 -109
  3. package/component-meta.json +1061 -102
  4. package/dist/alert-dialog.cjs +1 -1
  5. package/dist/alert-dialog.d.ts +13 -2
  6. package/dist/alert-dialog.d.ts.map +1 -1
  7. package/dist/alert-dialog.js +4 -3
  8. package/dist/banner.cjs +1 -1
  9. package/dist/banner.d.ts +47 -11
  10. package/dist/banner.d.ts.map +1 -1
  11. package/dist/banner.js +156 -79
  12. package/dist/blocks/empty-state.cjs +1 -1
  13. package/dist/blocks/empty-state.d.ts +40 -5
  14. package/dist/blocks/empty-state.d.ts.map +1 -1
  15. package/dist/blocks/empty-state.js +59 -52
  16. package/dist/blocks/input-list.d.ts +1 -0
  17. package/dist/blocks/input-list.d.ts.map +1 -1
  18. package/dist/blocks/sidebar.cjs +1 -1
  19. package/dist/blocks/sidebar.d.ts +12 -6
  20. package/dist/blocks/sidebar.d.ts.map +1 -1
  21. package/dist/blocks/sidebar.js +64 -63
  22. package/dist/button.cjs +1 -1
  23. package/dist/button.d.ts.map +1 -1
  24. package/dist/button.js +47 -43
  25. package/dist/card.cjs +1 -1
  26. package/dist/card.d.ts +12 -0
  27. package/dist/card.d.ts.map +1 -1
  28. package/dist/card.js +115 -97
  29. package/dist/chart.cjs +6 -6
  30. package/dist/chart.d.ts +6 -10
  31. package/dist/chart.d.ts.map +1 -1
  32. package/dist/chart.js +281 -296
  33. package/dist/combobox.cjs +3 -3
  34. package/dist/combobox.d.ts.map +1 -1
  35. package/dist/combobox.js +430 -343
  36. package/dist/command.cjs +1 -1
  37. package/dist/command.d.ts +23 -2
  38. package/dist/command.d.ts.map +1 -1
  39. package/dist/command.js +212 -207
  40. package/dist/count-indicator.cjs +1 -0
  41. package/dist/count-indicator.d.ts +85 -0
  42. package/dist/count-indicator.d.ts.map +1 -0
  43. package/dist/count-indicator.js +72 -0
  44. package/dist/data-table.cjs +1 -1
  45. package/dist/data-table.d.ts +101 -11
  46. package/dist/data-table.d.ts.map +1 -1
  47. package/dist/data-table.js +593 -523
  48. package/dist/dialog.cjs +1 -1
  49. package/dist/dialog.d.ts +26 -3
  50. package/dist/dialog.d.ts.map +1 -1
  51. package/dist/dialog.js +62 -47
  52. package/dist/drawer.cjs +1 -1
  53. package/dist/drawer.d.ts +8 -4
  54. package/dist/drawer.d.ts.map +1 -1
  55. package/dist/drawer.js +37 -38
  56. package/dist/file-upload.cjs +1 -0
  57. package/dist/file-upload.d.ts +546 -0
  58. package/dist/file-upload.d.ts.map +1 -0
  59. package/dist/file-upload.js +1103 -0
  60. package/dist/global-layout.cjs +1 -1
  61. package/dist/global-layout.d.ts +7 -2
  62. package/dist/global-layout.d.ts.map +1 -1
  63. package/dist/global-layout.js +52 -52
  64. package/dist/hooks/use-file-dropzone.cjs +1 -0
  65. package/dist/hooks/use-file-dropzone.d.ts +75 -0
  66. package/dist/hooks/use-file-dropzone.d.ts.map +1 -0
  67. package/dist/hooks/use-file-dropzone.js +133 -0
  68. package/dist/hover-card.cjs +1 -1
  69. package/dist/hover-card.d.ts +29 -16
  70. package/dist/hover-card.d.ts.map +1 -1
  71. package/dist/hover-card.js +153 -36
  72. package/dist/index.cjs +1 -1
  73. package/dist/index.d.ts +3 -0
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +676 -640
  76. package/dist/input-chip.cjs +1 -1
  77. package/dist/input-chip.d.ts +30 -1
  78. package/dist/input-chip.d.ts.map +1 -1
  79. package/dist/input-chip.js +131 -115
  80. package/dist/input-group.cjs +1 -1
  81. package/dist/input-group.d.ts +37 -2
  82. package/dist/input-group.d.ts.map +1 -1
  83. package/dist/input-group.js +131 -114
  84. package/dist/input-password.cjs +1 -1
  85. package/dist/input-password.js +6 -6
  86. package/dist/lib/empty-canvas.cjs +1 -1
  87. package/dist/lib/empty-canvas.d.ts +27 -1
  88. package/dist/lib/empty-canvas.d.ts.map +1 -1
  89. package/dist/lib/empty-canvas.js +27 -23
  90. package/dist/lib/empty-chip.cjs +1 -1
  91. package/dist/lib/empty-chip.d.ts +19 -2
  92. package/dist/lib/empty-chip.d.ts.map +1 -1
  93. package/dist/lib/empty-chip.js +14 -9
  94. package/dist/lib/field-aria.cjs +1 -1
  95. package/dist/lib/field-aria.d.ts +4 -4
  96. package/dist/lib/field-aria.d.ts.map +1 -1
  97. package/dist/lib/field-aria.js +7 -5
  98. package/dist/lib/media-viewer-content.cjs +1 -1
  99. package/dist/lib/media-viewer-content.js +1 -1
  100. package/dist/lib/table-internal.cjs +1 -1
  101. package/dist/lib/table-internal.d.ts +19 -0
  102. package/dist/lib/table-internal.d.ts.map +1 -1
  103. package/dist/lib/table-internal.js +22 -7
  104. package/dist/list.cjs +1 -1
  105. package/dist/list.d.ts +13 -0
  106. package/dist/list.d.ts.map +1 -1
  107. package/dist/list.js +103 -82
  108. package/dist/logo-mark.cjs +1 -1
  109. package/dist/logo-mark.d.ts +18 -2
  110. package/dist/logo-mark.d.ts.map +1 -1
  111. package/dist/logo-mark.js +159 -79
  112. package/dist/media-empty.cjs +1 -1
  113. package/dist/media-empty.d.ts +50 -7
  114. package/dist/media-empty.d.ts.map +1 -1
  115. package/dist/media-empty.js +14 -13
  116. package/dist/media-viewer.cjs +1 -1
  117. package/dist/media-viewer.js +6 -6
  118. package/dist/multi-select-filter.cjs +1 -1
  119. package/dist/multi-select-filter.d.ts.map +1 -1
  120. package/dist/multi-select-filter.js +92 -101
  121. package/dist/pagination.cjs +1 -1
  122. package/dist/pagination.d.ts +11 -0
  123. package/dist/pagination.d.ts.map +1 -1
  124. package/dist/pagination.js +17 -17
  125. package/dist/relative-date.d.ts +6 -0
  126. package/dist/relative-date.d.ts.map +1 -1
  127. package/dist/resizable.d.ts +1 -1
  128. package/dist/result-count.cjs +1 -1
  129. package/dist/result-count.d.ts +13 -16
  130. package/dist/result-count.d.ts.map +1 -1
  131. package/dist/result-count.js +24 -33
  132. package/dist/sheet.cjs +1 -1
  133. package/dist/sheet.d.ts +22 -3
  134. package/dist/sheet.d.ts.map +1 -1
  135. package/dist/sheet.js +152 -125
  136. package/dist/single-select-filter.cjs +1 -1
  137. package/dist/single-select-filter.d.ts.map +1 -1
  138. package/dist/single-select-filter.js +67 -76
  139. package/dist/table.cjs +1 -1
  140. package/dist/table.d.ts.map +1 -1
  141. package/dist/table.js +77 -76
  142. package/dist/tabs.cjs +1 -1
  143. package/dist/tabs.d.ts +39 -3
  144. package/dist/tabs.d.ts.map +1 -1
  145. package/dist/tabs.js +127 -76
  146. package/dist/textarea.cjs +1 -1
  147. package/dist/textarea.d.ts +34 -0
  148. package/dist/textarea.d.ts.map +1 -1
  149. package/dist/textarea.js +115 -19
  150. package/dist/tooltip.cjs +1 -1
  151. package/dist/tooltip.d.ts.map +1 -1
  152. package/dist/tooltip.js +137 -131
  153. package/dist/typography-text.cjs +1 -1
  154. package/dist/typography-text.d.ts +6 -2
  155. package/dist/typography-text.d.ts.map +1 -1
  156. package/dist/typography-text.js +14 -13
  157. package/package.json +3 -4
  158. package/src/blocks/empty-state.tsx +108 -48
  159. package/src/blocks/input-list.tsx +1 -0
  160. package/src/blocks/sidebar.tsx +39 -16
  161. package/src/components/alert-dialog.tsx +18 -2
  162. package/src/components/banner.tsx +247 -68
  163. package/src/components/button.tsx +27 -10
  164. package/src/components/card.tsx +89 -7
  165. package/src/components/chart.tsx +47 -67
  166. package/src/components/combobox.tsx +221 -12
  167. package/src/components/command.tsx +83 -37
  168. package/src/components/count-indicator.tsx +188 -0
  169. package/src/components/data-table.tsx +506 -159
  170. package/src/components/dialog.tsx +74 -5
  171. package/src/components/drawer.tsx +52 -32
  172. package/src/components/file-upload.tsx +2574 -0
  173. package/src/components/global-layout.tsx +18 -5
  174. package/src/components/hover-card.tsx +395 -65
  175. package/src/components/input-chip.tsx +67 -2
  176. package/src/components/input-group.tsx +89 -6
  177. package/src/components/list.tsx +40 -3
  178. package/src/components/logo-mark.tsx +109 -25
  179. package/src/components/media-empty.tsx +62 -7
  180. package/src/components/multi-select-filter.tsx +9 -16
  181. package/src/components/pagination.tsx +15 -2
  182. package/src/components/relative-date.tsx +6 -0
  183. package/src/components/result-count.tsx +27 -54
  184. package/src/components/sheet.tsx +86 -8
  185. package/src/components/single-select-filter.tsx +9 -16
  186. package/src/components/table.tsx +16 -1
  187. package/src/components/tabs.tsx +223 -41
  188. package/src/components/textarea.tsx +271 -4
  189. package/src/components/tooltip.tsx +29 -2
  190. package/src/components/typography-text.tsx +7 -2
  191. package/src/hooks/use-file-dropzone.ts +325 -0
  192. package/src/index.ts +3 -0
  193. package/src/lib/empty-canvas.tsx +47 -20
  194. package/src/lib/empty-chip.tsx +38 -3
  195. package/src/lib/field-aria.tsx +11 -6
  196. package/src/lib/table-internal.ts +38 -0
@@ -1 +1 @@
1
- const R=require("./_virtual/_rolldown/runtime.cjs"),B=require("./breadcrumb.cjs"),S=require("./button.cjs"),A=require("./typography-text.cjs"),w=require("./header.cjs"),E=require("./link.cjs"),M=require("./scroll-area.cjs");let r=require("react");r=R.__toESM(r,1);let G=require("@brightlocal/icons"),u=require("@brightlocal/ui-components/lib/utils"),e=require("react/jsx-runtime");var j=r.forwardRef(({className:t,maxWidth:a="none",dataHook:l,trackingEl:o,trackingLabel:n,children:s,...i},c)=>{const b=typeof a=="number"?`${a}px`:a;return(0,e.jsx)(M.ScrollArea,{className:(0,u.cn)("h-dvh w-full [&>[data-radix-scroll-area-viewport]]:p-0!",t),dataHook:`${l}-scroll`,scrollOrientation:"both",children:(0,e.jsx)("div",{ref:c,className:"flex min-h-dvh w-full flex-col","data-hook":l,"data-slot":"global-layout","data-tracking-el":o,"data-tracking-label":n,...i,children:(0,e.jsx)("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:b},children:s})})})});j.displayName="GlobalLayout";var I="288px",N=r.forwardRef(({className:t,width:a=I,dataHook:l,children:o,...n},s)=>{const i=typeof a=="number"?`${a}px`:a;return(0,e.jsx)("aside",{ref:s,className:(0,u.cn)("sticky hidden shrink-0 self-start outline-none lg:block",t),"data-hook":l,"data-slot":"sidebar-container",...n,style:{width:i,top:0,height:"100dvh",...n.style},children:o})});N.displayName="GlobalLayoutSidebar";var _=r.forwardRef(({className:t,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:l,children:o,...n},s)=>{const i=typeof a=="number"?`${a}px`:a;return(0,e.jsx)("div",{ref:s,className:(0,u.cn)("pb-section-sm lg:pt-section-sm flex min-w-0 flex-1 flex-col gap-6",t),"data-hook":l,"data-slot":"content-wrapper",style:{"--content-max-width":i},...n,children:o})});_.displayName="GlobalLayoutContent";var f="px-4 md:px-6 lg:px-section-xs",g=r.forwardRef((t,a)=>{if(t.href===void 0){const{dataHook:s,ariaLabel:i,...c}=t;return(0,e.jsx)(S.Button,{ref:a,ariaLabel:i||"Go back","data-slot":"content-header-back-link",dataHook:s??"content-header-back-link",variant:"ghost",...c,children:(0,e.jsx)(G.ArrowLeft,{"aria-hidden":"true"})})}const{dataHook:l,ariaLabel:o,...n}=t;return(0,e.jsx)(E.Link,{ref:a,"aria-label":o||"Go back","data-slot":"content-header-back-link",dataHook:l??"content-header-back-link",variant:"icon",...n,children:(0,e.jsx)(G.ArrowLeft,{"aria-hidden":"true"})})});g.displayName="GlobalLayoutBackLink";var v=r.forwardRef(({dataHook:t,asChild:a,...l},o)=>(0,e.jsx)(A.TypographyText,{ref:o,asChild:a,color:"muted","data-slot":"content-header-subtitle",dataHook:t??"content-header-subtitle",variant:"body-sm",...l}));v.displayName="GlobalLayoutSubtitle";var k=r.forwardRef(({className:t,dataHook:a,children:l,...o},n)=>(0,e.jsx)("div",{ref:n,className:(0,u.cn)("aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",t),"data-hook":a??"content-header-image","data-slot":"content-header-image",...o,children:l}));k.displayName="GlobalLayoutImage";var q=r.forwardRef(({className:t,dataHook:a,trackingEl:l,trackingLabel:o,children:n,...s},i)=>{const c=[],b=[],h=[],m=[],x=[],p=[];return r.Children.forEach(n,d=>{r.isValidElement(d)&&d.type===g?c.push(d):r.isValidElement(d)&&d.type===k?b.push(d):r.isValidElement(d)&&d.type===B.Breadcrumb?h.push(d):r.isValidElement(d)&&d.type===v?m.push(d):r.isValidElement(d)&&d.type===y?x.push(d):p.push(d)}),c.length===0&&b.length===0&&h.length===0&&m.length===0&&x.length===0?(0,e.jsx)("div",{className:(0,u.cn)("w-full",f),"data-slot":"content-header-region",children:(0,e.jsx)(w.Header,{ref:i,className:(0,u.cn)("mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",t),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:l,trackingLabel:o,...s,children:n})}):(0,e.jsx)("div",{className:(0,u.cn)("w-full",f),"data-slot":"content-header-region",children:(0,e.jsxs)(w.Header,{ref:i,className:(0,u.cn)("mx-auto w-full items-start gap-4",t),"data-slot":"content-header",dataHook:a,style:{maxWidth:"var(--ds-breakpoint-lg)"},trackingEl:l,trackingLabel:o,...s,children:[c,b,(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2","data-slot":"content-header-body",children:[h,x.length>0?(0,e.jsxs)("div",{className:"flex w-full flex-wrap items-start justify-between gap-4 max-md:flex-col","data-slot":"content-header-title",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2","data-slot":"content-header-text",children:[p,m]}),(0,e.jsx)(C.Provider,{value:!0,children:x})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start","data-slot":"content-header-title",children:p}),m]})]})]})})});q.displayName="GlobalLayoutContentHeader";var C=r.createContext(!1),y=r.forwardRef(({className:t,dataHook:a,trackingEl:l,trackingLabel:o,children:n,...s},i)=>{const c=r.useContext(C),b=(0,e.jsx)("div",{ref:i,className:(0,u.cn)(c?"flex shrink-0 items-center gap-2":"mx-auto hidden w-full items-center justify-end gap-2 lg:flex",t),"data-hook":a,"data-slot":"content-actions","data-tracking-el":l,"data-tracking-label":o,style:c?void 0:{maxWidth:"var(--ds-breakpoint-lg)"},...s,children:n});return c?b:(0,e.jsx)("div",{className:(0,u.cn)("w-full",f),"data-slot":"content-actions-region",children:b})});y.displayName="GlobalLayoutActions";var T=y,L=r.forwardRef(({className:t,dataHook:a,trackingEl:l,trackingLabel:o,children:n,...s},i)=>(0,e.jsx)("div",{className:(0,u.cn)("flex w-full flex-1 flex-col",f),"data-slot":"content-body-region",children:(0,e.jsx)("div",{ref:i,className:(0,u.cn)("mx-auto flex w-full flex-1 flex-col gap-6",t),"data-hook":a,"data-slot":"content-body","data-tracking-el":l,"data-tracking-label":o,style:{maxWidth:"var(--content-max-width)"},...s,children:n})}));L.displayName="GlobalLayoutBody";var V=L,H=r.forwardRef(({className:t,dataHook:a,ariaLabel:l,trackingEl:o,trackingLabel:n,children:s,...i},c)=>(0,e.jsx)("div",{ref:c,"aria-label":l??"Mobile navigation",className:(0,u.cn)("flex w-full items-center justify-start gap-2 px-4 pt-6 pb-2 md:px-6 lg:hidden [&_[data-slot=sidebar-trigger]]:-ml-0.5",t),"data-hook":a,"data-slot":"mobile-header","data-tracking-el":o,"data-tracking-label":n,role:"toolbar",...i,children:s}));H.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=j;exports.GlobalLayoutActions=y;exports.GlobalLayoutBackLink=g;exports.GlobalLayoutBody=L;exports.GlobalLayoutContent=_;exports.GlobalLayoutContentActions=T;exports.GlobalLayoutContentBody=V;exports.GlobalLayoutContentHeader=q;exports.GlobalLayoutImage=k;exports.GlobalLayoutMobileHeader=H;exports.GlobalLayoutSidebar=N;exports.GlobalLayoutSubtitle=v;
1
+ const B=require("./_virtual/_rolldown/runtime.cjs"),S=require("./breadcrumb.cjs"),A=require("./button.cjs"),E=require("./typography-text.cjs"),G=require("./header.cjs"),M=require("./link.cjs"),T=require("./scroll-area.cjs");let r=require("react");r=B.__toESM(r,1);let j=require("@brightlocal/icons"),u=require("@brightlocal/ui-components/lib/utils"),e=require("react/jsx-runtime");var N=r.forwardRef(({className:t,maxWidth:a="none",dataHook:l,trackingEl:o,trackingLabel:n,children:s,...i},c)=>{const b=typeof a=="number"?`${a}px`:a;return(0,e.jsx)(T.ScrollArea,{className:(0,u.cn)("h-dvh w-full [&>[data-radix-scroll-area-viewport]]:p-0!",t),dataHook:`${l}-scroll`,scrollOrientation:"both",children:(0,e.jsx)("div",{ref:c,className:"flex min-h-dvh w-full flex-col","data-hook":l,"data-slot":"global-layout","data-tracking-el":o,"data-tracking-label":n,...i,children:(0,e.jsx)("div",{className:"mx-auto flex w-full flex-1","data-slot":"global-container",style:{maxWidth:b},children:s})})})});N.displayName="GlobalLayout";var I="288px",_=r.forwardRef(({className:t,width:a=I,dataHook:l,children:o,...n},s)=>{const i=typeof a=="number"?`${a}px`:a;return(0,e.jsx)("aside",{ref:s,className:(0,u.cn)("sticky hidden shrink-0 self-start outline-none lg:block",t),"data-hook":l,"data-slot":"sidebar-container",...n,style:{width:i,top:0,height:"100dvh",...n.style},children:o})});_.displayName="GlobalLayoutSidebar";var q=r.forwardRef(({className:t,maxWidth:a="var(--ds-breakpoint-lg)",dataHook:l,children:o,...n},s)=>{const i=typeof a=="number"?`${a}px`:a;return(0,e.jsx)("div",{ref:s,className:(0,u.cn)("pb-section-sm lg:pt-section-sm flex min-w-0 flex-1 flex-col gap-6",t),"data-hook":l,"data-slot":"content-wrapper",style:{"--content-max-width":i},...n,children:o})});q.displayName="GlobalLayoutContent";var f="px-4 md:px-6 lg:px-section-xs",g="var(--content-max-width, var(--ds-breakpoint-lg))",v=r.forwardRef((t,a)=>{if(t.href===void 0){const{dataHook:s,ariaLabel:i,...c}=t;return(0,e.jsx)(A.Button,{ref:a,ariaLabel:i||"Go back","data-slot":"content-header-back-link",dataHook:s??"content-header-back-link",variant:"ghost",...c,children:(0,e.jsx)(j.ArrowLeft,{"aria-hidden":"true"})})}const{dataHook:l,ariaLabel:o,...n}=t;return(0,e.jsx)(M.Link,{ref:a,"aria-label":o||"Go back","data-slot":"content-header-back-link",dataHook:l??"content-header-back-link",variant:"icon",...n,children:(0,e.jsx)(j.ArrowLeft,{"aria-hidden":"true"})})});v.displayName="GlobalLayoutBackLink";var k=r.forwardRef(({dataHook:t,asChild:a,...l},o)=>(0,e.jsx)(E.TypographyText,{ref:o,asChild:a,color:"muted","data-slot":"content-header-subtitle",dataHook:t??"content-header-subtitle",variant:"body-sm",...l}));k.displayName="GlobalLayoutSubtitle";var L=r.forwardRef(({className:t,dataHook:a,children:l,...o},n)=>(0,e.jsx)("div",{ref:n,className:(0,u.cn)("aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",t),"data-hook":a??"content-header-image","data-slot":"content-header-image",...o,children:l}));L.displayName="GlobalLayoutImage";var C=r.forwardRef(({className:t,dataHook:a,trackingEl:l,trackingLabel:o,children:n,...s},i)=>{const c=[],b=[],h=[],m=[],x=[],p=[];return r.Children.forEach(n,d=>{r.isValidElement(d)&&d.type===v?c.push(d):r.isValidElement(d)&&d.type===L?b.push(d):r.isValidElement(d)&&d.type===S.Breadcrumb?h.push(d):r.isValidElement(d)&&d.type===k?m.push(d):r.isValidElement(d)&&d.type===y?x.push(d):p.push(d)}),c.length===0&&b.length===0&&h.length===0&&m.length===0&&x.length===0?(0,e.jsx)("div",{className:(0,u.cn)("w-full",f),"data-slot":"content-header-region",children:(0,e.jsx)(G.Header,{ref:i,className:(0,u.cn)("mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start",t),"data-slot":"content-header",dataHook:a,style:{maxWidth:g},trackingEl:l,trackingLabel:o,...s,children:n})}):(0,e.jsx)("div",{className:(0,u.cn)("w-full",f),"data-slot":"content-header-region",children:(0,e.jsxs)(G.Header,{ref:i,className:(0,u.cn)("mx-auto w-full items-start gap-4",t),"data-slot":"content-header",dataHook:a,style:{maxWidth:g},trackingEl:l,trackingLabel:o,...s,children:[c,b,(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2","data-slot":"content-header-body",children:[h,x.length>0?(0,e.jsxs)("div",{className:"flex w-full flex-wrap items-start justify-between gap-4 max-md:flex-col","data-slot":"content-header-title",children:[(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2","data-slot":"content-header-text",children:[p,m]}),(0,e.jsx)(H.Provider,{value:!0,children:x})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start","data-slot":"content-header-title",children:p}),m]})]})]})})});C.displayName="GlobalLayoutContentHeader";var H=r.createContext(!1),y=r.forwardRef(({className:t,dataHook:a,trackingEl:l,trackingLabel:o,children:n,...s},i)=>{const c=r.useContext(H),b=(0,e.jsx)("div",{ref:i,className:(0,u.cn)(c?"flex shrink-0 items-center gap-2":"mx-auto hidden w-full items-center justify-end gap-2 lg:flex",t),"data-hook":a,"data-slot":"content-actions","data-tracking-el":l,"data-tracking-label":o,style:c?void 0:{maxWidth:g},...s,children:n});return c?b:(0,e.jsx)("div",{className:(0,u.cn)("w-full",f),"data-slot":"content-actions-region",children:b})});y.displayName="GlobalLayoutActions";var V=y,w=r.forwardRef(({className:t,dataHook:a,trackingEl:l,trackingLabel:o,children:n,...s},i)=>(0,e.jsx)("div",{className:(0,u.cn)("flex w-full flex-1 flex-col",f),"data-slot":"content-body-region",children:(0,e.jsx)("div",{ref:i,className:(0,u.cn)("mx-auto flex w-full flex-1 flex-col gap-6",t),"data-hook":a,"data-slot":"content-body","data-tracking-el":l,"data-tracking-label":o,style:{maxWidth:"var(--content-max-width)"},...s,children:n})}));w.displayName="GlobalLayoutBody";var W=w,R=r.forwardRef(({className:t,dataHook:a,ariaLabel:l,trackingEl:o,trackingLabel:n,children:s,...i},c)=>(0,e.jsx)("div",{ref:c,"aria-label":l??"Mobile navigation",className:(0,u.cn)("flex w-full items-center justify-start gap-2 px-4 pt-6 pb-2 md:px-6 lg:hidden [&_[data-slot=sidebar-trigger]]:-ml-0.5",t),"data-hook":a,"data-slot":"mobile-header","data-tracking-el":o,"data-tracking-label":n,role:"toolbar",...i,children:s}));R.displayName="GlobalLayoutMobileHeader";exports.GlobalLayout=N;exports.GlobalLayoutActions=y;exports.GlobalLayoutBackLink=v;exports.GlobalLayoutBody=w;exports.GlobalLayoutContent=q;exports.GlobalLayoutContentActions=V;exports.GlobalLayoutContentBody=W;exports.GlobalLayoutContentHeader=C;exports.GlobalLayoutImage=L;exports.GlobalLayoutMobileHeader=R;exports.GlobalLayoutSidebar=_;exports.GlobalLayoutSubtitle=k;
@@ -39,7 +39,10 @@ interface GlobalLayoutContentProps extends React.ComponentProps<"div"> {
39
39
  */
40
40
  dataHook?: string;
41
41
  /**
42
- * Maximum width of the content area. Use `breakpoint` tokens from `@brightlocal/tokens/breakpoints`.
42
+ * Maximum width of the content column. Use `breakpoint` tokens from `@brightlocal/tokens/breakpoints`.
43
+ * The page header (`GlobalLayoutContentHeader`), a standalone
44
+ * `GlobalLayoutActions` row and `GlobalLayoutBody` all follow it, so the
45
+ * title lines up with the cards below at every width.
43
46
  * @default breakpoint.lg
44
47
  */
45
48
  maxWidth?: string | number;
@@ -178,7 +181,9 @@ interface GlobalLayoutContentHeaderProps extends React.ComponentProps<"header">
178
181
  /**
179
182
  * Page header for the content area. Slots direct children (back link, image,
180
183
  * breadcrumb, subtitle, actions) around the title row per the Figma Page
181
- * Header design.
184
+ * Header design. Its column follows the `maxWidth` set on
185
+ * `GlobalLayoutContent`, so it is always as wide as `GlobalLayoutBody` — no
186
+ * `maxWidth` override needed (DS-1248).
182
187
  *
183
188
  * The consumer-supplied page title must be `TypographyHeading level={1}
184
189
  * variant="page"` so it sits on the semantic type scale's
@@ -1 +1 @@
1
- {"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources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EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,wBAAwB,mHA0C7B,CAAC;AAIF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,GACxB,CAAC;AAEF,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,8BAA8B,EAC9B,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,+BAA+B,EAC/B,4BAA4B,GAC7B,CAAC;AAQF;;GAEG;AACH,KAAK,+BAA+B,GAAG,wBAAwB,CAAC;AAEhE;;GAEG;AACH,KAAK,4BAA4B,GAAG,qBAAqB,CAAC"}
1
+ {"version":3,"file":"global-layout.d.ts","sourceRoot":"","sources":["../../src/components/global-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/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;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,QAAA,MAAM,YAAY,uGAgDjB,CAAC;AAQF,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;CACz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EhE;;GAEG;AACH,KAAK,4BAA4B,GAAG,qBAAqB,CAAC"}
@@ -1,16 +1,16 @@
1
- import { Breadcrumb as C } from "./breadcrumb.js";
2
- import { Button as H } from "./button.js";
1
+ import { Breadcrumb as H } from "./breadcrumb.js";
2
+ import { Button as E } from "./button.js";
3
3
  import { TypographyText as j } from "./typography-text.js";
4
- import { Header as v } from "./header.js";
4
+ import { Header as k } from "./header.js";
5
5
  import { Link as B } from "./link.js";
6
- import { ScrollArea as E } from "./scroll-area.js";
6
+ import { ScrollArea as S } from "./scroll-area.js";
7
7
  import * as n from "react";
8
- import { ArrowLeft as k } from "@brightlocal/icons";
8
+ import { ArrowLeft as w } from "@brightlocal/icons";
9
9
  import { cn as m } from "@brightlocal/ui-components/lib/utils";
10
- import { Fragment as S, jsx as l, jsxs as u } from "react/jsx-runtime";
11
- var A = n.forwardRef(({ className: e, maxWidth: a = "none", dataHook: t, trackingEl: o, trackingLabel: r, children: s, ...i }, c) => {
10
+ import { Fragment as T, jsx as l, jsxs as u } from "react/jsx-runtime";
11
+ var _ = n.forwardRef(({ className: e, maxWidth: a = "none", dataHook: t, trackingEl: o, trackingLabel: r, children: s, ...i }, c) => {
12
12
  const f = typeof a == "number" ? `${a}px` : a;
13
- return /* @__PURE__ */ l(E, {
13
+ return /* @__PURE__ */ l(S, {
14
14
  className: m("h-dvh w-full [&>[data-radix-scroll-area-viewport]]:p-0!", e),
15
15
  dataHook: `${t}-scroll`,
16
16
  scrollOrientation: "both",
@@ -31,8 +31,8 @@ var A = n.forwardRef(({ className: e, maxWidth: a = "none", dataHook: t, trackin
31
31
  })
32
32
  });
33
33
  });
34
- A.displayName = "GlobalLayout";
35
- var _ = "288px", I = n.forwardRef(({ className: e, width: a = _, dataHook: t, children: o, ...r }, s) => {
34
+ _.displayName = "GlobalLayout";
35
+ var A = "288px", I = n.forwardRef(({ className: e, width: a = A, dataHook: t, children: o, ...r }, s) => {
36
36
  const i = typeof a == "number" ? `${a}px` : a;
37
37
  return /* @__PURE__ */ l("aside", {
38
38
  ref: s,
@@ -63,17 +63,17 @@ var M = n.forwardRef(({ className: e, maxWidth: a = "var(--ds-breakpoint-lg)", d
63
63
  });
64
64
  });
65
65
  M.displayName = "GlobalLayoutContent";
66
- var y = "px-4 md:px-6 lg:px-section-xs", w = n.forwardRef((e, a) => {
66
+ var p = "px-4 md:px-6 lg:px-section-xs", v = "var(--content-max-width, var(--ds-breakpoint-lg))", N = n.forwardRef((e, a) => {
67
67
  if (e.href === void 0) {
68
68
  const { dataHook: s, ariaLabel: i, ...c } = e;
69
- return /* @__PURE__ */ l(H, {
69
+ return /* @__PURE__ */ l(E, {
70
70
  ref: a,
71
71
  ariaLabel: i || "Go back",
72
72
  "data-slot": "content-header-back-link",
73
73
  dataHook: s ?? "content-header-back-link",
74
74
  variant: "ghost",
75
75
  ...c,
76
- children: /* @__PURE__ */ l(k, { "aria-hidden": "true" })
76
+ children: /* @__PURE__ */ l(w, { "aria-hidden": "true" })
77
77
  });
78
78
  }
79
79
  const { dataHook: t, ariaLabel: o, ...r } = e;
@@ -84,11 +84,11 @@ var y = "px-4 md:px-6 lg:px-section-xs", w = n.forwardRef((e, a) => {
84
84
  dataHook: t ?? "content-header-back-link",
85
85
  variant: "icon",
86
86
  ...r,
87
- children: /* @__PURE__ */ l(k, { "aria-hidden": "true" })
87
+ children: /* @__PURE__ */ l(w, { "aria-hidden": "true" })
88
88
  });
89
89
  });
90
- w.displayName = "GlobalLayoutBackLink";
91
- var N = n.forwardRef(({ dataHook: e, asChild: a, ...t }, o) => /* @__PURE__ */ l(j, {
90
+ N.displayName = "GlobalLayoutBackLink";
91
+ var L = n.forwardRef(({ dataHook: e, asChild: a, ...t }, o) => /* @__PURE__ */ l(j, {
92
92
  ref: o,
93
93
  asChild: a,
94
94
  color: "muted",
@@ -97,8 +97,8 @@ var N = n.forwardRef(({ dataHook: e, asChild: a, ...t }, o) => /* @__PURE__ */ l
97
97
  variant: "body-sm",
98
98
  ...t
99
99
  }));
100
- N.displayName = "GlobalLayoutSubtitle";
101
- var L = n.forwardRef(({ className: e, dataHook: a, children: t, ...o }, r) => /* @__PURE__ */ l("div", {
100
+ L.displayName = "GlobalLayoutSubtitle";
101
+ var G = n.forwardRef(({ className: e, dataHook: a, children: t, ...o }, r) => /* @__PURE__ */ l("div", {
102
102
  ref: r,
103
103
  className: m("aspect-[3/2] h-12 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover", e),
104
104
  "data-hook": a ?? "content-header-image",
@@ -106,34 +106,34 @@ var L = n.forwardRef(({ className: e, dataHook: a, children: t, ...o }, r) => /*
106
106
  ...o,
107
107
  children: t
108
108
  }));
109
- L.displayName = "GlobalLayoutImage";
110
- var T = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => {
111
- const c = [], f = [], h = [], b = [], p = [], x = [];
109
+ G.displayName = "GlobalLayoutImage";
110
+ var V = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => {
111
+ const c = [], f = [], y = [], b = [], h = [], x = [];
112
112
  return n.Children.forEach(r, (d) => {
113
- n.isValidElement(d) && d.type === w ? c.push(d) : n.isValidElement(d) && d.type === L ? f.push(d) : n.isValidElement(d) && d.type === C ? h.push(d) : n.isValidElement(d) && d.type === N ? b.push(d) : n.isValidElement(d) && d.type === g ? p.push(d) : x.push(d);
114
- }), c.length === 0 && f.length === 0 && h.length === 0 && b.length === 0 && p.length === 0 ? /* @__PURE__ */ l("div", {
115
- className: m("w-full", y),
113
+ n.isValidElement(d) && d.type === N ? c.push(d) : n.isValidElement(d) && d.type === G ? f.push(d) : n.isValidElement(d) && d.type === H ? y.push(d) : n.isValidElement(d) && d.type === L ? b.push(d) : n.isValidElement(d) && d.type === g ? h.push(d) : x.push(d);
114
+ }), c.length === 0 && f.length === 0 && y.length === 0 && b.length === 0 && h.length === 0 ? /* @__PURE__ */ l("div", {
115
+ className: m("w-full", p),
116
116
  "data-slot": "content-header-region",
117
- children: /* @__PURE__ */ l(v, {
117
+ children: /* @__PURE__ */ l(k, {
118
118
  ref: i,
119
119
  className: m("mx-auto w-full flex-wrap justify-between gap-4 max-md:flex-col max-md:items-start", e),
120
120
  "data-slot": "content-header",
121
121
  dataHook: a,
122
- style: { maxWidth: "var(--ds-breakpoint-lg)" },
122
+ style: { maxWidth: v },
123
123
  trackingEl: t,
124
124
  trackingLabel: o,
125
125
  ...s,
126
126
  children: r
127
127
  })
128
128
  }) : /* @__PURE__ */ l("div", {
129
- className: m("w-full", y),
129
+ className: m("w-full", p),
130
130
  "data-slot": "content-header-region",
131
- children: /* @__PURE__ */ u(v, {
131
+ children: /* @__PURE__ */ u(k, {
132
132
  ref: i,
133
133
  className: m("mx-auto w-full items-start gap-4", e),
134
134
  "data-slot": "content-header",
135
135
  dataHook: a,
136
- style: { maxWidth: "var(--ds-breakpoint-lg)" },
136
+ style: { maxWidth: v },
137
137
  trackingEl: t,
138
138
  trackingLabel: o,
139
139
  ...s,
@@ -143,18 +143,18 @@ var T = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel:
143
143
  /* @__PURE__ */ u("div", {
144
144
  className: "flex min-w-0 flex-1 flex-col gap-2",
145
145
  "data-slot": "content-header-body",
146
- children: [h, p.length > 0 ? /* @__PURE__ */ u("div", {
146
+ children: [y, h.length > 0 ? /* @__PURE__ */ u("div", {
147
147
  className: "flex w-full flex-wrap items-start justify-between gap-4 max-md:flex-col",
148
148
  "data-slot": "content-header-title",
149
149
  children: [/* @__PURE__ */ u("div", {
150
150
  className: "flex min-w-0 flex-1 flex-col gap-2",
151
151
  "data-slot": "content-header-text",
152
152
  children: [x, b]
153
- }), /* @__PURE__ */ l(G.Provider, {
153
+ }), /* @__PURE__ */ l(R.Provider, {
154
154
  value: !0,
155
- children: p
155
+ children: h
156
156
  })]
157
- }) : /* @__PURE__ */ u(S, { children: [/* @__PURE__ */ l("div", {
157
+ }) : /* @__PURE__ */ u(T, { children: [/* @__PURE__ */ l("div", {
158
158
  className: "flex w-full flex-wrap items-center justify-between gap-4 max-md:flex-col max-md:items-start",
159
159
  "data-slot": "content-header-title",
160
160
  children: x
@@ -164,28 +164,28 @@ var T = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel:
164
164
  })
165
165
  });
166
166
  });
167
- T.displayName = "GlobalLayoutContentHeader";
168
- var G = n.createContext(!1), g = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => {
169
- const c = n.useContext(G), f = /* @__PURE__ */ l("div", {
167
+ V.displayName = "GlobalLayoutContentHeader";
168
+ var R = n.createContext(!1), g = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => {
169
+ const c = n.useContext(R), f = /* @__PURE__ */ l("div", {
170
170
  ref: i,
171
171
  className: m(c ? "flex shrink-0 items-center gap-2" : "mx-auto hidden w-full items-center justify-end gap-2 lg:flex", e),
172
172
  "data-hook": a,
173
173
  "data-slot": "content-actions",
174
174
  "data-tracking-el": t,
175
175
  "data-tracking-label": o,
176
- style: c ? void 0 : { maxWidth: "var(--ds-breakpoint-lg)" },
176
+ style: c ? void 0 : { maxWidth: v },
177
177
  ...s,
178
178
  children: r
179
179
  });
180
180
  return c ? f : /* @__PURE__ */ l("div", {
181
- className: m("w-full", y),
181
+ className: m("w-full", p),
182
182
  "data-slot": "content-actions-region",
183
183
  children: f
184
184
  });
185
185
  });
186
186
  g.displayName = "GlobalLayoutActions";
187
- var J = g, R = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => /* @__PURE__ */ l("div", {
188
- className: m("flex w-full flex-1 flex-col", y),
187
+ var K = g, C = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackingLabel: o, children: r, ...s }, i) => /* @__PURE__ */ l("div", {
188
+ className: m("flex w-full flex-1 flex-col", p),
189
189
  "data-slot": "content-body-region",
190
190
  children: /* @__PURE__ */ l("div", {
191
191
  ref: i,
@@ -199,8 +199,8 @@ var J = g, R = n.forwardRef(({ className: e, dataHook: a, trackingEl: t, trackin
199
199
  children: r
200
200
  })
201
201
  }));
202
- R.displayName = "GlobalLayoutBody";
203
- var K = R, V = n.forwardRef(({ className: e, dataHook: a, ariaLabel: t, trackingEl: o, trackingLabel: r, children: s, ...i }, c) => /* @__PURE__ */ l("div", {
202
+ C.displayName = "GlobalLayoutBody";
203
+ var Q = C, W = n.forwardRef(({ className: e, dataHook: a, ariaLabel: t, trackingEl: o, trackingLabel: r, children: s, ...i }, c) => /* @__PURE__ */ l("div", {
204
204
  ref: c,
205
205
  "aria-label": t ?? "Mobile navigation",
206
206
  className: m("flex w-full items-center justify-start gap-2 px-4 pt-6 pb-2 md:px-6 lg:hidden [&_[data-slot=sidebar-trigger]]:-ml-0.5", e),
@@ -212,18 +212,18 @@ var K = R, V = n.forwardRef(({ className: e, dataHook: a, ariaLabel: t, tracking
212
212
  ...i,
213
213
  children: s
214
214
  }));
215
- V.displayName = "GlobalLayoutMobileHeader";
215
+ W.displayName = "GlobalLayoutMobileHeader";
216
216
  export {
217
- A as GlobalLayout,
217
+ _ as GlobalLayout,
218
218
  g as GlobalLayoutActions,
219
- w as GlobalLayoutBackLink,
220
- R as GlobalLayoutBody,
219
+ N as GlobalLayoutBackLink,
220
+ C as GlobalLayoutBody,
221
221
  M as GlobalLayoutContent,
222
- J as GlobalLayoutContentActions,
223
- K as GlobalLayoutContentBody,
224
- T as GlobalLayoutContentHeader,
225
- L as GlobalLayoutImage,
226
- V as GlobalLayoutMobileHeader,
222
+ K as GlobalLayoutContentActions,
223
+ Q as GlobalLayoutContentBody,
224
+ V as GlobalLayoutContentHeader,
225
+ G as GlobalLayoutImage,
226
+ W as GlobalLayoutMobileHeader,
227
227
  I as GlobalLayoutSidebar,
228
- N as GlobalLayoutSubtitle
228
+ L as GlobalLayoutSubtitle
229
229
  };
@@ -0,0 +1 @@
1
+ let i=require("react");function A(t){if(!t)return;const e=[];for(const[a,s]of Object.entries(t))e.push(a),e.push(...s);return e.join(",")}function v(t,e){for(const[a,s]of Object.entries(e)){if(a===t||a.endsWith("/*")&&t.startsWith(a.replace("/*","/")))return!0;const n=`.${t.split("/").pop()}`;if(s.some(d=>d.toLowerCase()===n.toLowerCase()))return!0}return!1}function P(t,e){const a=t.slice(t.lastIndexOf(".")).toLowerCase();for(const s of Object.values(e))if(s.some(n=>n.toLowerCase()===a))return!0;return!1}function b(t,e){const a=[];if(e.accept){const s=t.type?v(t.type,e.accept):!1,n=P(t.name,e.accept);!s&&!n&&a.push("file-invalid-type")}return e.maxSize!==void 0&&t.size>e.maxSize&&a.push("file-too-large"),e.minSize!==void 0&&t.size<e.minSize&&a.push("file-too-small"),e.validate&&a.push(...e.validate(t)),a}function C(t,e){let a=!1;for(let s=0;s<t.length;s++){const n=t[s];if(n.kind==="file"&&(a=!0,e&&!v(n.type,e)))return!1}return a}function S(t={}){const{disabled:e=!1,maxFiles:a,multiple:s,onFilesChange:n}=t,[d,m]=(0,i.useState)("idle"),p=(0,i.useRef)(0),g=(0,i.useRef)(null),u=(0,i.useCallback)(r=>{const c=Array.from(r);let o=[];const f=[];for(const l of c){const h=b(l,t);h.length>0?f.push({file:l,errors:h}):o.push(l)}if(a!==void 0&&o.length>a){const l=o.slice(a);o=o.slice(0,a);for(const h of l)f.push({file:h,errors:["too-many-files"]})}n?.({acceptedFiles:o,rejectedFiles:f})},[a,n,t]),k=(0,i.useCallback)(r=>{if(r.preventDefault(),r.stopPropagation(),!e&&(p.current+=1,p.current===1)){const c=C(r.dataTransfer.items,t.accept);m(c?"accept":"reject")}},[e,t.accept]),D=(0,i.useCallback)(r=>{r.preventDefault(),r.stopPropagation(),!e&&(r.dataTransfer.dropEffect="copy")},[e]),F=(0,i.useCallback)(r=>{r.preventDefault(),r.stopPropagation(),!e&&(p.current-=1,p.current===0&&m("idle"))},[e]),x=(0,i.useCallback)(r=>{if(r.preventDefault(),r.stopPropagation(),p.current=0,m("idle"),e)return;const c=[];if(r.dataTransfer.items)for(let o=0;o<r.dataTransfer.items.length;o++){const f=r.dataTransfer.items[o];if(f.kind!=="file"||f.webkitGetAsEntry?.()?.isDirectory)continue;const l=f.getAsFile();l&&c.push(l)}else c.push(...Array.from(r.dataTransfer.files));u(c)},[e,u]),y=(0,i.useCallback)(r=>{e||(r.target.files&&u(r.target.files),r.target.value="")},[e,u]),w=(0,i.useCallback)(r=>{if(e)return;const c=Array.from(r.clipboardData.files);c.length>0&&(r.preventDefault(),u(c))},[e,u]),z=(0,i.useCallback)(()=>{e||g.current?.click()},[e]);return{state:d,dragActive:d!=="idle",dropzoneProps:{onDragEnter:k,onDragOver:D,onDragLeave:F,onDrop:x,onPaste:w},inputProps:{type:"file",accept:A(t.accept),multiple:s??a!==1,disabled:e,onChange:y,tabIndex:-1,style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",borderWidth:0}},inputRef:g,openFilePicker:z}}exports.dragItemsMatchAccept=C;exports.useFileDropzone=S;exports.validateFile=b;
@@ -0,0 +1,75 @@
1
+ type FileError = "file-too-large" | "file-too-small" | "too-many-files" | "file-invalid-type";
2
+ interface FileRejection {
3
+ file: File;
4
+ errors: FileError[];
5
+ }
6
+ interface UseFileDropzoneOptions {
7
+ /**
8
+ * Accepted MIME types or extensions, keyed by MIME with extension arrays.
9
+ * @example { "image/*": [".png", ".jpg"], "application/pdf": [".pdf"] }
10
+ */
11
+ accept?: Record<string, readonly string[]>;
12
+ /** Maximum file size in bytes. */
13
+ maxSize?: number;
14
+ /** Minimum file size in bytes. */
15
+ minSize?: number;
16
+ /** Maximum number of files. `1` disables `multiple` on the input when `multiple` is not set. */
17
+ maxFiles?: number;
18
+ /** Whether the file input accepts multiple files. Defaults to `maxFiles !== 1`. */
19
+ multiple?: boolean;
20
+ /** Whether the dropzone is disabled. */
21
+ disabled?: boolean;
22
+ /** Custom validation function. Return an array of error codes or an empty array. */
23
+ validate?: (file: File) => FileError[];
24
+ /** Called with accepted and rejected files after a drop or file pick. */
25
+ onFilesChange?: (details: {
26
+ acceptedFiles: File[];
27
+ rejectedFiles: FileRejection[];
28
+ }) => void;
29
+ }
30
+ type DropzoneState = "idle" | "accept" | "reject";
31
+ interface UseFileDropzoneReturn {
32
+ /** Current visual state of the drop zone. */
33
+ state: DropzoneState;
34
+ /** Whether a drag is currently over the zone. */
35
+ dragActive: boolean;
36
+ /** Props to spread on the drop zone element. */
37
+ dropzoneProps: {
38
+ onDragEnter: (e: React.DragEvent) => void;
39
+ onDragOver: (e: React.DragEvent) => void;
40
+ onDragLeave: (e: React.DragEvent) => void;
41
+ onDrop: (e: React.DragEvent) => void;
42
+ onPaste: (e: React.ClipboardEvent) => void;
43
+ };
44
+ /** Props to spread on the hidden file input. */
45
+ inputProps: {
46
+ type: "file";
47
+ accept: string | undefined;
48
+ multiple: boolean;
49
+ disabled: boolean | undefined;
50
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
51
+ tabIndex: -1;
52
+ style: React.CSSProperties;
53
+ };
54
+ /** Ref for the hidden file input. */
55
+ inputRef: React.RefObject<HTMLInputElement | null>;
56
+ /** Programmatically open the file picker. */
57
+ openFilePicker: () => void;
58
+ }
59
+ export declare function validateFile(file: File, options: UseFileDropzoneOptions): FileError[];
60
+ export declare function dragItemsMatchAccept(items: DataTransferItemList, accept?: Record<string, readonly string[]>): boolean;
61
+ /**
62
+ * Native HTML5 drag-and-drop for file inputs: tracks the drag state
63
+ * (`idle` / `accept` / `reject`) by sniffing dragged item MIME types,
64
+ * validates dropped, picked or pasted files against `accept`, `minSize`,
65
+ * `maxSize` and a custom `validate`, and returns the props to spread on the
66
+ * drop zone and its hidden `<input type="file">`.
67
+ *
68
+ * `maxFiles` here limits one batch; a running total across drops is the
69
+ * caller's job (see `FileUpload`).
70
+ *
71
+ * @param options - Accepted types, size limits, max files, disabled flag, custom validate, and onFilesChange callback.
72
+ */
73
+ export declare function useFileDropzone(options?: UseFileDropzoneOptions): UseFileDropzoneReturn;
74
+ export type { FileError, FileRejection, UseFileDropzoneOptions, UseFileDropzoneReturn, DropzoneState, };
75
+ //# sourceMappingURL=use-file-dropzone.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-file-dropzone.d.ts","sourceRoot":"","sources":["../../src/hooks/use-file-dropzone.ts"],"names":[],"mappings":"AAEA,KAAK,SAAS,GACZ,gBAAgB,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAE/E,UAAU,aAAa;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,UAAU,sBAAsB;IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;IAC3C,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oFAAoF;IACpF,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;IACvC,yEAAyE;IACzE,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;QACxB,aAAa,EAAE,IAAI,EAAE,CAAC;QACtB,aAAa,EAAE,aAAa,EAAE,CAAC;KAChC,KAAK,IAAI,CAAC;CACZ;AAED,KAAK,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElD,UAAU,qBAAqB;IAC7B,6CAA6C;IAC7C,KAAK,EAAE,aAAa,CAAC;IACrB,iDAAiD;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,aAAa,EAA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ACV,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,GACd,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { useCallback as f, useRef as v, useState as A } from "react";
2
+ function P(t) {
3
+ if (!t) return;
4
+ const e = [];
5
+ for (const [n, i] of Object.entries(t))
6
+ e.push(n), e.push(...i);
7
+ return e.join(",");
8
+ }
9
+ function x(t, e) {
10
+ for (const [n, i] of Object.entries(e)) {
11
+ if (n === t || n.endsWith("/*") && t.startsWith(n.replace("/*", "/"))) return !0;
12
+ const s = `.${t.split("/").pop()}`;
13
+ if (i.some((d) => d.toLowerCase() === s.toLowerCase())) return !0;
14
+ }
15
+ return !1;
16
+ }
17
+ function S(t, e) {
18
+ const n = t.slice(t.lastIndexOf(".")).toLowerCase();
19
+ for (const i of Object.values(e)) if (i.some((s) => s.toLowerCase() === n)) return !0;
20
+ return !1;
21
+ }
22
+ function j(t, e) {
23
+ const n = [];
24
+ if (e.accept) {
25
+ const i = t.type ? x(t.type, e.accept) : !1, s = S(t.name, e.accept);
26
+ !i && !s && n.push("file-invalid-type");
27
+ }
28
+ return e.maxSize !== void 0 && t.size > e.maxSize && n.push("file-too-large"), e.minSize !== void 0 && t.size < e.minSize && n.push("file-too-small"), e.validate && n.push(...e.validate(t)), n;
29
+ }
30
+ function k(t, e) {
31
+ let n = !1;
32
+ for (let i = 0; i < t.length; i++) {
33
+ const s = t[i];
34
+ if (s.kind === "file" && (n = !0, e && !x(s.type, e)))
35
+ return !1;
36
+ }
37
+ return n;
38
+ }
39
+ function L(t = {}) {
40
+ const { disabled: e = !1, maxFiles: n, multiple: i, onFilesChange: s } = t, [d, m] = A("idle"), p = v(0), g = v(null), u = f((r) => {
41
+ const a = Array.from(r);
42
+ let o = [];
43
+ const l = [];
44
+ for (const c of a) {
45
+ const h = j(c, t);
46
+ h.length > 0 ? l.push({
47
+ file: c,
48
+ errors: h
49
+ }) : o.push(c);
50
+ }
51
+ if (n !== void 0 && o.length > n) {
52
+ const c = o.slice(n);
53
+ o = o.slice(0, n);
54
+ for (const h of c) l.push({
55
+ file: h,
56
+ errors: ["too-many-files"]
57
+ });
58
+ }
59
+ s?.({
60
+ acceptedFiles: o,
61
+ rejectedFiles: l
62
+ });
63
+ }, [
64
+ n,
65
+ s,
66
+ t
67
+ ]), y = f((r) => {
68
+ if (r.preventDefault(), r.stopPropagation(), !e && (p.current += 1, p.current === 1)) {
69
+ const a = k(r.dataTransfer.items, t.accept);
70
+ m(a ? "accept" : "reject");
71
+ }
72
+ }, [e, t.accept]), D = f((r) => {
73
+ r.preventDefault(), r.stopPropagation(), !e && (r.dataTransfer.dropEffect = "copy");
74
+ }, [e]), F = f((r) => {
75
+ r.preventDefault(), r.stopPropagation(), !e && (p.current -= 1, p.current === 0 && m("idle"));
76
+ }, [e]), b = f((r) => {
77
+ if (r.preventDefault(), r.stopPropagation(), p.current = 0, m("idle"), e) return;
78
+ const a = [];
79
+ if (r.dataTransfer.items) for (let o = 0; o < r.dataTransfer.items.length; o++) {
80
+ const l = r.dataTransfer.items[o];
81
+ if (l.kind !== "file" || l.webkitGetAsEntry?.()?.isDirectory) continue;
82
+ const c = l.getAsFile();
83
+ c && a.push(c);
84
+ }
85
+ else a.push(...Array.from(r.dataTransfer.files));
86
+ u(a);
87
+ }, [e, u]), w = f((r) => {
88
+ e || (r.target.files && u(r.target.files), r.target.value = "");
89
+ }, [e, u]), C = f((r) => {
90
+ if (e) return;
91
+ const a = Array.from(r.clipboardData.files);
92
+ a.length > 0 && (r.preventDefault(), u(a));
93
+ }, [e, u]), z = f(() => {
94
+ e || g.current?.click();
95
+ }, [e]);
96
+ return {
97
+ state: d,
98
+ dragActive: d !== "idle",
99
+ dropzoneProps: {
100
+ onDragEnter: y,
101
+ onDragOver: D,
102
+ onDragLeave: F,
103
+ onDrop: b,
104
+ onPaste: C
105
+ },
106
+ inputProps: {
107
+ type: "file",
108
+ accept: P(t.accept),
109
+ multiple: i ?? n !== 1,
110
+ disabled: e,
111
+ onChange: w,
112
+ tabIndex: -1,
113
+ style: {
114
+ position: "absolute",
115
+ width: 1,
116
+ height: 1,
117
+ padding: 0,
118
+ margin: -1,
119
+ overflow: "hidden",
120
+ clip: "rect(0,0,0,0)",
121
+ whiteSpace: "nowrap",
122
+ borderWidth: 0
123
+ }
124
+ },
125
+ inputRef: g,
126
+ openFilePicker: z
127
+ };
128
+ }
129
+ export {
130
+ k as dragItemsMatchAccept,
131
+ L as useFileDropzone,
132
+ j as validateFile
133
+ };
@@ -1 +1 @@
1
- "use client";const u=require("./_virtual/_rolldown/runtime.cjs");let o=require("react");o=u.__toESM(o,1);let s=require("@brightlocal/ui-components/lib/utils"),n=require("react/jsx-runtime"),e=require("@radix-ui/react-hover-card");e=u.__toESM(e,1);function _({openDelay:a=300,closeDelay:r=300,...t}){return(0,n.jsx)(e.Root,{closeDelay:r,openDelay:a,...t})}_.displayName="HoverCard";var g=o.forwardRef(({className:a,disabled:r,dataHook:t,trackingEl:d,trackingLabel:i,...l},c)=>(0,n.jsx)(e.Trigger,{ref:c,"aria-disabled":r,className:(0,s.cn)("text-link text-label cursor-pointer underline",r&&"pointer-events-none cursor-not-allowed opacity-50",a),"data-hook":t,"data-slot":"hover-card-trigger","data-tracking-el":d,"data-tracking-label":i,...l}));g.displayName="HoverCardTrigger";var v=o.forwardRef(({className:a,align:r="center",sideOffset:t=4,dataHook:d,trackingEl:i,trackingLabel:l,...c},C)=>(0,n.jsx)(e.Portal,{children:(0,n.jsx)(e.Content,{ref:C,align:r,className:(0,s.cn)("border-border bg-popover text-popover-foreground z-50 w-max max-w-sm rounded-lg border p-4 shadow-md outline-hidden",s.FLOATING_CONTENT_ANIMATION,a),"data-hook":d,"data-slot":"hover-card-content","data-tracking-el":i,"data-tracking-label":l,sideOffset:t,...c})}));v.displayName="HoverCardContent";exports.HoverCard=_;exports.HoverCardContent=v;exports.HoverCardTrigger=g;
1
+ "use client";const I=require("./_virtual/_rolldown/runtime.cjs"),s=require("./lib/compose-event-handlers.cjs");let e=require("react");e=I.__toESM(e,1);let j=require("@brightlocal/ui-components/lib/utils"),h=require("react/jsx-runtime"),U=require("@radix-ui/react-slot"),b=require("@radix-ui/react-popover");b=I.__toESM(b,1);var y=e.createContext(null);function M(){const a=e.useContext(y);if(!a)throw new Error("HoverCard components must be used within <HoverCard>");return a}function S({openDelay:a=300,closeDelay:u=300,open:p,defaultOpen:k=!1,onOpenChange:f,children:H}){const[_,P]=e.useState(k??!1),C=p!==void 0,o=C?p:_,l=e.useRef(void 0),d=e.useRef(void 0),m=e.useRef(null),i=e.useRef("hover"),c=e.useRef(null),r=e.useCallback(n=>{n||(i.current="hover"),C||P(n),f?.(n)},[C,f]),t=e.useCallback(()=>{l.current!==void 0&&(clearTimeout(l.current),l.current=void 0),d.current!==void 0&&(clearTimeout(d.current),d.current=void 0)},[]);e.useEffect(()=>t,[t]);const g=e.useCallback(()=>{if(t(),i.current==="touch"){if(o)return;i.current="hover"}a>0?l.current=setTimeout(()=>r(!0),a):r(!0)},[t,a,o,r]),v=e.useCallback(()=>{t(),!(i.current==="touch"&&o)&&(u>0?d.current=setTimeout(()=>r(!1),u):r(!1))},[t,u,o,r]),x=e.useCallback(n=>{n.pointerType!=="touch"&&g()},[g]),E=e.useCallback(n=>{n.pointerType!=="touch"&&(c.current=null,v())},[v]),w=e.useCallback(n=>{c.current=n.pointerType==="touch"?"touch":"mouse"},[]),N=e.useCallback(()=>{c.current=null},[]),R=e.useCallback(()=>{const n=c.current;c.current=null,n==="touch"&&(t(),o?r(!1):(i.current="touch",r(!0)))},[t,o,r]),O=e.useCallback(()=>{c.current||g()},[g]),q=e.useCallback(()=>{v()},[v]),F=e.useCallback(()=>{t()},[t]),T=e.useCallback(n=>{n.pointerType!=="touch"&&v()},[v]),L=e.useCallback(n=>{const A=n.target;A instanceof Node&&m.current?.contains(A)&&n.preventDefault()},[]),z=e.useCallback(n=>{n||(t(),r(!1))},[t,r]),G=e.useMemo(()=>({open:o,triggerRef:m,onTriggerPointerEnter:x,onTriggerPointerLeave:E,onTriggerPointerDown:w,onTriggerPointerCancel:N,onTriggerClick:R,onTriggerFocus:O,onTriggerBlur:q,onContentPointerEnter:F,onContentPointerLeave:T,onContentInteractOutside:L}),[o,x,E,w,N,R,O,q,F,T,L]);return(0,h.jsx)(y.Provider,{value:G,children:(0,h.jsx)(b.Root,{open:o,onOpenChange:z,children:H})})}S.displayName="HoverCard";var B=e.forwardRef(({className:a,disabled:u,dataHook:p,trackingEl:k,trackingLabel:f,asChild:H,children:_,onBlur:P,onClick:C,onFocus:o,onPointerCancel:l,onPointerDown:d,onPointerEnter:m,onPointerLeave:i,...c},r)=>{const{open:t,triggerRef:g,onTriggerPointerEnter:v,onTriggerPointerLeave:x,onTriggerPointerDown:E,onTriggerPointerCancel:w,onTriggerClick:N,onTriggerFocus:R,onTriggerBlur:O}=M(),q=e.useCallback(T=>{g.current=T,typeof r=="function"?r(T):r&&(r.current=T)},[r,g]),F=H?U.Slot:"a";return(0,h.jsx)(b.Anchor,{asChild:!0,children:(0,h.jsx)(F,{ref:q,"aria-disabled":u||void 0,"aria-expanded":t,className:(0,j.cn)("text-link text-label cursor-pointer underline",u&&"pointer-events-none cursor-not-allowed opacity-50",a),"data-hook":p,"data-slot":"hover-card-trigger","data-state":t?"open":"closed","data-tracking-el":k,"data-tracking-label":f,...c,onBlur:s.composeEventHandlers(P,O),onClick:s.composeEventHandlers(C,N),onFocus:s.composeEventHandlers(o,R),onPointerCancel:s.composeEventHandlers(l,w),onPointerDown:s.composeEventHandlers(d,E),onPointerEnter:s.composeEventHandlers(m,v),onPointerLeave:s.composeEventHandlers(i,x),children:_})})});B.displayName="HoverCardTrigger";var D=e.forwardRef(({className:a,align:u="center",sideOffset:p=4,dataHook:k,trackingEl:f,trackingLabel:H,children:_,onInteractOutside:P,onPointerEnter:C,onPointerLeave:o,...l},d)=>{const{onContentPointerEnter:m,onContentPointerLeave:i,onContentInteractOutside:c}=M();return(0,h.jsx)(b.Portal,{children:(0,h.jsx)(b.Content,{ref:d,align:u,className:(0,j.cn)("border-border bg-popover text-popover-foreground z-50 w-max max-w-sm rounded-lg border p-4 shadow-md outline-hidden",j.FLOATING_CONTENT_ANIMATION,a),"data-hook":k,"data-slot":"hover-card-content","data-tracking-el":f,"data-tracking-label":H,sideOffset:p,onCloseAutoFocus:r=>r.preventDefault(),onOpenAutoFocus:r=>r.preventDefault(),...l,role:"none",onInteractOutside:s.composeEventHandlers(P,c),onPointerEnter:s.composeEventHandlers(C,m),onPointerLeave:s.composeEventHandlers(o,i),children:_})})});D.displayName="HoverCardContent";exports.HoverCard=S;exports.HoverCardContent=D;exports.HoverCardTrigger=B;
@@ -1,35 +1,44 @@
1
1
  import * as React from "react";
2
- import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
3
  /**
4
4
  * HoverCard props
5
5
  */
6
- export interface HoverCardProps extends React.ComponentProps<typeof HoverCardPrimitive.Root> {
6
+ export interface HoverCardProps {
7
7
  /**
8
- * Time in milliseconds to delay opening the hover card
8
+ * Time in milliseconds to delay opening the hover card.
9
9
  * @default 300
10
10
  */
11
11
  openDelay?: number;
12
12
  /**
13
- * Time in milliseconds to delay closing the hover card
13
+ * Time in milliseconds to delay closing the hover card. Also serves as the
14
+ * grace period when moving the pointer from trigger to content.
14
15
  * @default 300
15
16
  */
16
17
  closeDelay?: number;
18
+ /** Controlled open state */
19
+ open?: boolean;
20
+ /** Initial open state for uncontrolled mode */
21
+ defaultOpen?: boolean;
22
+ /** Callback when open state changes */
23
+ onOpenChange?: (open: boolean) => void;
24
+ children: React.ReactNode;
17
25
  }
18
26
  /**
19
- * HoverCard - A component that displays content on hover
27
+ * HoverCard — a card that appears on hover, with touch support.
20
28
  *
21
- * Based on Radix UI Hover Card primitive
22
- * @see https://www.radix-ui.com/docs/primitives/components/hover-card
23
- *
24
- * Default timing:
25
- * - openDelay: 300ms
26
- * - closeDelay: 300ms
29
+ * Behavior by input type:
30
+ * - **Mouse / pen / keyboard**: opens on hover or focus after `openDelay`, closes
31
+ * after `closeDelay` when the pointer leaves (the delay doubles as a grace period
32
+ * so the pointer can move from trigger to content without closing).
33
+ * - **Touch**: a tap toggles it open/closed. While open the card ignores hover/blur
34
+ * so its text can be long-pressed and copied; it closes on a second tap of the
35
+ * trigger, a tap outside, or Escape.
27
36
  */
28
- declare function HoverCard({ openDelay, closeDelay, ...props }: HoverCardProps): React.JSX.Element;
37
+ declare function HoverCard({ openDelay, closeDelay, open: controlledOpen, defaultOpen, onOpenChange, children, }: HoverCardProps): React.JSX.Element;
29
38
  declare namespace HoverCard {
30
39
  var displayName: string;
31
40
  }
32
- export interface HoverCardTriggerProps extends React.ComponentProps<typeof HoverCardPrimitive.Trigger> {
41
+ export interface HoverCardTriggerProps extends React.ComponentPropsWithoutRef<"a"> {
33
42
  /**
34
43
  * Data hook for automated testing
35
44
  */
@@ -46,12 +55,16 @@ export interface HoverCardTriggerProps extends React.ComponentProps<typeof Hover
46
55
  * Optional analytics label context
47
56
  */
48
57
  trackingLabel?: string;
58
+ /**
59
+ * Render as child element using Radix Slot
60
+ */
61
+ asChild?: boolean;
49
62
  }
50
63
  /**
51
64
  * HoverCardTrigger - The element that triggers the hover card
52
65
  */
53
- declare const HoverCardTrigger: React.ForwardRefExoticComponent<Omit<HoverCardTriggerProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
54
- export interface HoverCardContentProps extends React.ComponentPropsWithoutRef<typeof HoverCardPrimitive.Content> {
66
+ declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
67
+ export interface HoverCardContentProps extends Omit<React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>, "onOpenAutoFocus" | "onCloseAutoFocus"> {
55
68
  /**
56
69
  * Data hook for automated testing
57
70
  */
@@ -66,7 +79,7 @@ export interface HoverCardContentProps extends React.ComponentPropsWithoutRef<ty
66
79
  trackingLabel?: string;
67
80
  }
68
81
  /**
69
- * HoverCardContent - The content container that appears on hover
82
+ * HoverCardContent - The content container that appears on hover or touch
70
83
  */
71
84
  declare const HoverCardContent: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
72
85
  export { HoverCard, HoverCardTrigger, HoverCardContent };