@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
@@ -3,9 +3,10 @@ import * as n from "react";
3
3
  import { jsx as f } from "react/jsx-runtime";
4
4
  var x = {
5
5
  description: [],
6
- error: []
6
+ error: [],
7
+ count: []
7
8
  }, c = n.createContext(null);
8
- function m({ children: o }) {
9
+ function g({ children: o }) {
9
10
  const [e, s] = n.useState(x), t = n.useCallback((i, u) => (s((r) => r[i].includes(u) ? r : {
10
11
  ...r,
11
12
  [i]: [...r[i], u]
@@ -23,7 +24,7 @@ function m({ children: o }) {
23
24
  children: o
24
25
  });
25
26
  }
26
- function d(o, e, s) {
27
+ function m(o, e, s) {
27
28
  const t = n.useContext(c)?.register;
28
29
  n.useEffect(() => {
29
30
  if (!(!t || !s))
@@ -41,12 +42,13 @@ function C(o) {
41
42
  const s = o?.split(/\s+/).filter(Boolean) ?? [], t = [.../* @__PURE__ */ new Set([
42
43
  ...e.ids.error,
43
44
  ...e.ids.description,
45
+ ...e.ids.count,
44
46
  ...s
45
47
  ])];
46
48
  return t.length > 0 ? t.join(" ") : void 0;
47
49
  }
48
50
  export {
49
- m as FieldAriaProvider,
50
- d as useFieldAriaRegistration,
51
+ g as FieldAriaProvider,
52
+ m as useFieldAriaRegistration,
51
53
  C as useFieldDescribedBy
52
54
  };
@@ -1 +1 @@
1
- "use client";const ye=require("../_virtual/_rolldown/runtime.cjs"),J=require("../button.cjs"),pe=require("../dialog.cjs"),He=require("../info-tooltip.cjs"),Ge=require("../media-empty.cjs"),Z=require("./compose-event-handlers.cjs"),V=require("./media-viewer-internal.cjs"),D=require("./media-viewer-motion.cjs"),Je=require("./download-file.cjs"),he=require("./image-file-info.cjs"),Qe=require("../relative-date.cjs");let c=require("react");c=ye.__toESM(c,1);let Y=require("@brightlocal/icons"),C=require("@brightlocal/ui-components/lib/utils"),i=require("react/jsx-runtime"),et=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock"),te=require("@radix-ui/react-dialog");te=ye.__toESM(te,1);let W=require("@brightlocal/ui-components/lib/motion"),tt=require("@brightlocal/ui-components/hooks/use-prefers-reduced-motion");var G=[1,1.5,2,3],ge=2.5,we=(0,C.cn)("group/nav absolute inset-y-0 flex w-16 items-center justify-center outline-none sm:w-20","duration-fast opacity-0 transition-opacity ease-out","group-hover/stage:opacity-100 focus-visible:opacity-100","disabled:invisible pointer-coarse:hidden"),xe=(0,C.cn)(J.ButtonVariants({variant:"ghost"}),"pointer-events-none size-9 p-0 group-hover/nav:bg-accent group-hover/nav:text-accent-foreground group-focus-visible/nav:shadow-default"),nt=(t,d)=>`${t} of ${d}`;function rt(t,d,g){const[p,b]=c.useState(()=>new Set),[x,R]=c.useState(()=>new Map),[_,e]=c.useState(()=>new Set),[l,s]=c.useState(()=>new Map),v=c.useCallback((m,n,f)=>{if(!n||!f)return null;const u=n/f;return R(h=>h.get(m)===u?h:new Map(h).set(m,u)),u},[]),o=c.useCallback(m=>{b(n=>new Set(n).add(m))},[]);return c.useEffect(()=>{if(!g)return;let m=!1;for(const n of[t[d],t[d+1],t[d-1]]){if(!n||n.expired)continue;const f=new Image;f.src=n.src,f.decode().then(()=>{m||(v(n.src,f.naturalWidth,f.naturalHeight),s(u=>u.get(n.src)===f.naturalWidth?u:new Map(u).set(n.src,f.naturalWidth)),e(u=>u.has(n.src)?u:new Set(u).add(n.src)))}).catch(()=>{})}return()=>{m=!0}},[g,t,d,v]),{failed:p,ratios:x,widths:l,ready:_,noteRatio:v,markFailed:o}}function at({index:t,openCount:d,openedAtRef:g,triggersRef:p,reducedMotion:b,setOpen:x,revealed:R,reveal:_}){const e=c.useRef(null),l=c.useRef(null),s=c.useRef(null),v=c.useRef(0),o=c.useRef(0),m=u=>{const h=p.current.get(u);return h?.isConnected?h:null};return{imageRef:e,overlayRef:l,barRef:s,revealed:R,reveal:_,zoomIn:(u,h,k)=>{if(v.current===d||(v.current=d,u.style.visibility="visible",_(),k-g.current>500))return;const E=b||h?null:m(t),T=E?D.zoomKeyframe(E,u):null;T?u.animate([T,D.ZOOM_REST],{duration:W.MOTION_DURATION_SLOW_MS,easing:W.MOTION_EASE_EMPHASIZED}):u.animate([{opacity:0},{opacity:1}],{duration:W.MOTION_DURATION_SLOW_MS,easing:"ease-out"})},requestClose:({fade:u=!1}={})=>{if(o.current===d)return;const h=e.current,k=b||u?null:m(t);h?.getAnimations().forEach(r=>r.cancel());const E=h&&k?D.zoomKeyframe(k,h):null;if(!h||!E){x(!1);return}o.current=d;const T={duration:W.MOTION_DURATION_BASE_MS,easing:"ease-in-out",fill:"forwards"};for(const r of[l.current,s.current])r?.animate([{opacity:1},{opacity:0}],T);h.animate([D.ZOOM_REST,E],T).finished.catch(()=>{}).finally(()=>x(!1))}}}function it({index:t,total:d,reducedMotion:g,onStep:p}){const b=c.useRef(null),x=c.useRef(null),R=c.useRef(null),_=c.useRef(null),e=()=>b.current?.clientWidth??0,l=r=>{const y=x.current;y&&(y.style.transform=r?`translateX(${r}px)`:"")},s=r=>r>0&&t===0||r<0&&t===d-1,v=r=>s(r)?D.rubberBand(r,e()*D.RUBBER_BAND_SHARE):r,o=(r,y)=>{const S=x.current?.animate([{transform:`translateX(${r}px)`},{transform:"none"}],D.glideTiming(r,y));_.current=S?{from:r,animation:S}:null},m=(r,y=0)=>{l(0),!(!r||g)&&o(r,y)},n=()=>{const r=_.current?.animation.playState;return r==="running"||r==="paused"},f=()=>{const r=_.current;if(_.current=null,!r||r.animation.playState==="finished")return 0;const y=r.animation.effect?.getComputedTiming().progress,S=r.from*(1-(y??0));return r.animation.cancel(),l(S),S},u=(r,y=0,S=0)=>{if(r===t||r<0||r>=d)return;const X=e();y&&!g&&X&&Math.abs(r-t)===1&&(R.current={from:(r>t?1:-1)*X+y,speed:S}),p(r)},h=r=>u(t+r),k=()=>Math.min(e()*D.DRAG_STEP_SHARE,160),E=(r,y=k())=>{const S=t+(r<0?1:-1);return Math.abs(r)>y&&S>=0&&S<d},T=(r,y,S=0)=>{const X=y<0?1:-1,Q=!(S*y<0&&Math.abs(S)>.2)&&(Math.abs(y)>k()||Math.abs(S)>.5),L=t+X;Q&&L>=0&&L<d?u(L,r,S):m(r,S)};return c.useLayoutEffect(()=>{const r=R.current;R.current=null,_.current?.animation.cancel(),_.current=null,l(0),r?.from&&o(r.from,r.speed)},[t]),{frameRef:b,trackRef:x,moveTrack:l,pastEnd:s,resist:v,settle:m,gliding:n,stopGlide:f,goTo:u,step:h,canStep:E,release:T}}function ot(t,d,g){const p=c.useRef({x:0,y:0}),b=c.useRef(t),x=c.useRef(null),R=c.useRef(!1),_=n=>{const f=d.current,u=g.current;if(!f||!u)return;const h=b.current,k=Math.max(0,(f.offsetWidth*h-u.clientWidth)/2),E=Math.max(0,(f.offsetHeight*h-u.clientHeight)/2),T=p.current;T.x=Math.min(k,Math.max(-k,T.x)),T.y=Math.min(E,Math.max(-E,T.y)),f.style.transition=n?`transform ${W.MOTION_DURATION_BASE_MS}ms ${W.MOTION_EASE_DECELERATE}`:"none",f.style.transform=h===1?"":`translate(${T.x}px, ${T.y}px) scale(${h})`};c.useLayoutEffect(()=>{const n=t/b.current;b.current=t,p.current=t===1?{x:0,y:0}:{x:p.current.x*n,y:p.current.y*n},_(!0)},[t]);const e=(n,f)=>{p.current.x+=n,p.current.y+=f,_(!1)};return{panBy:e,reset:()=>{const n=d.current;p.current={x:0,y:0},b.current=1,n&&(n.style.transition="none",n.style.transform="")},onPointerDown:n=>{n.pointerType==="mouse"&&n.button!==0||(R.current=!1,n.target instanceof Node&&d.current?.contains(n.target)&&(x.current={x:n.clientX,y:n.clientY,moved:!1},n.currentTarget.setPointerCapture?.(n.pointerId)))},onPointerMove:n=>{const f=x.current;if(!f)return;const u=n.clientX-f.x,h=n.clientY-f.y;!f.moved&&Math.hypot(u,h)<4||(f.moved=!0,f.x=n.clientX,f.y=n.clientY,e(u,h))},onPointerUp:()=>{R.current=!!x.current?.moved,x.current=null},consumePan:()=>{const n=R.current;return R.current=!1,n}}}function st(t,d){const g=c.useRef(!1),p=c.useRef(null);return{consumeSwipe:()=>{const l=g.current;return g.current=!1,l},onPointerDown:l=>{g.current=!1,!(l.pointerType==="mouse"||!d)&&(p.current={x:l.clientX,y:l.clientY,axis:null,base:0,offset:0,speed:0,lastX:l.clientX,lastTime:l.timeStamp})},onPointerMove:l=>{const s=p.current;if(!s)return;const v=l.clientX-s.x,o=l.clientY-s.y;if(!s.axis){if(Math.hypot(v,o)<8)return;s.axis=Math.abs(v)>Math.abs(o)?"x":"y",s.axis==="x"&&(s.base=t.stopGlide())}if(s.axis!=="x")return;const m=l.timeStamp-s.lastTime;if(m>0){const n=(l.clientX-s.lastX)/m;s.speed=s.speed*.3+n*.7}s.lastX=l.clientX,s.lastTime=l.timeStamp,s.offset=t.resist(s.base+v),t.moveTrack(s.offset)},onPointerUp:l=>{const s=p.current;if(p.current=null,!s||s.axis!=="x")return;g.current=!0;const v=l.timeStamp-s.lastTime>80?0:s.speed;t.release(s.offset,l.clientX-s.x,v)},onPointerCancel:()=>{const l=p.current;p.current=null,l?.axis==="x"&&t.settle(l.offset)}}}function ct(t,d,g,p){const b=c.useRef(d),x=c.useRef(g),R=c.useRef(p);c.useLayoutEffect(()=>{b.current=d,x.current=g,R.current=p});const _=c.useRef({swiping:!1,intent:0,offset:0,pull:0,previous:0,fading:0,speed:0,last:0,inertia:0,inertiaTimer:0,inertiaPrevious:0,inertiaFaintest:0,inertiaFading:!1,cancelTimer:0});c.useEffect(()=>{if(!t)return;const e=_.current,l=o=>{e.inertia=o,window.clearTimeout(e.inertiaTimer),e.inertiaTimer=window.setTimeout(()=>{e.inertia=0},300)},s=o=>{l(o),e.inertiaPrevious=Math.abs(o),e.inertiaFaintest=Math.abs(o),e.inertiaFading=!1},v=o=>{if(o.ctrlKey)return;if(!x.current){o.preventDefault(),R.current(-o.deltaX,-o.deltaY);return}if(Math.abs(o.deltaY)>Math.abs(o.deltaX)||o.target instanceof Element&&o.target.closest('[data-slot="media-viewer-thumbnails"]'))return;o.preventDefault();const m=b.current,n=Math.abs(o.deltaX),f=o.timeStamp-e.last;if(e.last=o.timeStamp,e.swiping)f>0&&(e.speed=e.speed*.3+-o.deltaX/f*.7);else{window.clearTimeout(e.cancelTimer);const h=e.inertia!==0&&Math.sign(o.deltaX)===Math.sign(e.inertia);h&&(n<e.inertiaPrevious&&(e.inertiaFading||(e.inertiaFaintest=n),e.inertiaFading=!0),e.inertiaFading&&(e.inertiaFaintest=Math.min(e.inertiaFaintest,n)),e.inertiaPrevious=n);const k=e.inertiaFading&&n>=e.inertiaFaintest*2;if(h&&!k&&(m.gliding()||n<=Math.abs(e.inertia)*1.2)){l(o.deltaX),e.intent=0;return}if(e.intent+=o.deltaX,Math.abs(e.intent)<=30){e.cancelTimer=window.setTimeout(()=>{e.intent=0},600);return}e.intent=0,e.swiping=!0,e.inertia=0,e.inertiaFading=!1,e.offset=m.stopGlide(),e.pull=0,e.speed=0,e.fading=0}window.clearTimeout(e.cancelTimer);const u=t.clientWidth;if(e.offset=Math.max(-u,Math.min(u,e.offset-o.deltaX)),e.pull-=o.deltaX,m.moveTrack(m.resist(e.offset)),e.fading=n<e.previous?e.fading+1:0,e.previous=n,m.pastEnd(e.offset)&&e.fading>=2){e.swiping=!1,s(o.deltaX),m.release(m.resist(e.offset),0);return}if(m.canStep(e.pull,u*.2)){e.swiping=!1,s(o.deltaX),m.release(m.resist(e.offset),e.pull,e.speed);return}e.cancelTimer=window.setTimeout(()=>{e.swiping=!1,m.release(m.resist(e.offset),0)},600)};return t.addEventListener("wheel",v,{passive:!1}),()=>{t.removeEventListener("wheel",v),window.clearTimeout(e.cancelTimer),window.clearTimeout(e.inertiaTimer)}},[t])}function lt({dataHook:t,hasPrevious:d,hasNext:g,previousLabel:p,nextLabel:b,onStep:x}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{"aria-label":p??"Previous",className:(0,C.cn)(we,"left-0"),"data-hook":`${t}-previous`,"data-slot":"media-viewer-previous",disabled:!d,type:"button",onClick:()=>x(-1),children:(0,i.jsx)("span",{"aria-hidden":!0,className:xe,children:(0,i.jsx)(Y.ChevronLeft,{})})}),(0,i.jsx)("button",{"aria-label":b??"Next",className:(0,C.cn)(we,"right-0"),"data-hook":`${t}-next`,"data-slot":"media-viewer-next",disabled:!g,type:"button",onClick:()=>x(1),children:(0,i.jsx)("span",{"aria-hidden":!0,className:xe,children:(0,i.jsx)(Y.ChevronRight,{})})})]})}function ut({dataHook:t,items:d,index:g,failed:p,label:b,onSelect:x,onRatio:R}){const _=c.useRef(null);return c.useEffect(()=>{_.current?.querySelector('[aria-current="true"]')?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[g]),(0,i.jsx)("div",{ref:_,"aria-label":b??"Images",className:"mb-2 flex max-w-full gap-1.5 justify-self-center overflow-x-auto p-1 [grid-area:strip] sm:mb-0","data-hook":`${t}-thumbnails`,"data-slot":"media-viewer-thumbnails",role:"group",children:d.map((e,l)=>{const s=l===g,v=e.expired||p.has(e.src);return(0,i.jsx)("button",{"aria-current":s?"true":void 0,"aria-label":e.alt,className:(0,C.cn)("bg-muted relative size-12 shrink-0 overflow-hidden rounded-md outline-none","duration-fast focus-visible:shadow-default transition-opacity ease-out",s?"opacity-100":"opacity-50 hover:opacity-100"),"data-hook":`${t}-thumbnail-${l}`,"data-slot":"media-viewer-thumbnail",type:"button",onClick:()=>x(l),children:v?null:(0,i.jsx)("img",{alt:"",className:"size-full object-cover object-top",decoding:"async",draggable:!1,loading:"lazy",src:e.thumbnailSrc??e.src,onLoad:o=>R(e.src,o.currentTarget.naturalWidth,o.currentTarget.naturalHeight)})},e.src)})})}var be=c.forwardRef(({dataHook:t,children:d,formatPosition:g,previousLabel:p,nextLabel:b,thumbnailsLabel:x,unavailableMessage:R,zoomInLabel:_,zoomOutLabel:e,downloadLabel:l,infoLabel:s,dateLabels:v,className:o,trackingEl:m,trackingLabel:n,onClick:f,onCloseAutoFocus:u,onEscapeKeyDown:h,onKeyDown:k,onOpenAutoFocus:E,...T},r)=>{const{items:y,index:S,setIndex:X,openerRef:Q,open:L,setOpen:ve,openCount:ne,openedAtRef:Me,revealed:Re,reveal:Se,triggersRef:Te,renderActions:re,actionsLabel:je}=V.useMediaViewerContext("MediaViewerContent"),ae=(0,tt.usePrefersReducedMotion)();(0,et.useOverlayPointerLock)();const F=y.length,j=Math.min(Math.max(S,0),Math.max(F-1,0)),Pe=j>0,ke=j<F-1,K=`${ne}:${j}`,[ie,Ee]=c.useState({key:"",level:0}),B=ie.key===K?ie.level:0,N=B>0,H=a=>Ee(w=>{const M=w.key===K?w.level:0,q=Math.min(Math.max(M+a,0),G.length-1);return q===M&&w.key===K?w:{key:K,level:q}}),{failed:ee,ratios:Ne,widths:oe,ready:qe,noteRatio:se,markFailed:Ce}=rt(y,j,L),z=at({index:j,openCount:ne,openedAtRef:Me,triggersRef:Te,reducedMotion:ae,setOpen:ve,revealed:Re,reveal:Se}),I=it({index:j,total:F,reducedMotion:ae,onStep:a=>{z.reveal(),A.reset(),X(a)}}),U=st(I,!N),{frameRef:ce,trackRef:Oe}=I,{imageRef:le,overlayRef:De,barRef:Fe}=z,A=ot(G[B]??1,le,ce),[Ie,Ae]=c.useState(null),$e=c.useCallback(a=>{Ae(a),typeof r=="function"?r(a):r&&(r.current=a)},[r]);ct(Ie,I,!N,A.panBy);const P=y[j],$=!!(P&&!P.expired&&!ee.has(P.src)),Xe=he.useImageFileInfo($?P?.downloadSrc??P?.src:void 0,L),Le=(a,w,M)=>{const q=a.currentTarget,O=se(w,q.naturalWidth,q.naturalHeight);M&&(O&&q.style.setProperty("--media-ratio",String(O)),z.zoomIn(q,O!==null&&1/O>ge,a.timeStamp))},ze=a=>{a.defaultPrevented||a.target.closest('[role="menu"]')||(a.key==="ArrowLeft"?(a.preventDefault(),I.step(-1)):a.key==="ArrowRight"?(a.preventDefault(),I.step(1)):(a.key==="+"||a.key==="=")&&$?(a.preventDefault(),H(1)):a.key==="-"&&$&&(a.preventDefault(),H(-1)))},Ve=a=>{const w=Q.current;w?.isConnected&&(a.preventDefault(),w.focus())},We=a=>{a.preventDefault(),a.currentTarget?.focus()},Be=a=>{U.consumeSwipe()||A.consumePan()||a.target instanceof HTMLElement&&a.target.hasAttribute("data-media-viewer-backdrop")&&z.requestClose({fade:N})},ue=(0,i.jsxs)(i.Fragment,{children:[P&&re?(0,i.jsx)(V.ItemActionsMenu,{dataHook:`${t}-actions-menu`,label:je(P,j),variant:"ghost",children:re(P,j)}):null,(0,i.jsx)(He.InfoTooltip,{ariaLabel:s??"Image details",className:"text-foreground hover:bg-accent size-9 items-center justify-center rounded-md",content:he.describeImageFile(Xe),dataHook:`${t}-info`,disabled:!$})]}),de=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J.Button,{iconOnly:!0,ariaLabel:l??"Download",dataHook:`${t}-download`,disabled:!$,variant:"ghost",onClick:()=>{P&&Je.downloadFile(P.downloadSrc??P.src)},children:(0,i.jsx)(Y.Download,{"aria-hidden":!0})}),(0,i.jsx)(J.Button,{iconOnly:!0,ariaLabel:_??"Zoom in",dataHook:`${t}-zoom-in`,disabled:!$||B===G.length-1,variant:"ghost",onClick:()=>H(1),children:(0,i.jsx)(Y.ZoomIn,{"aria-hidden":!0})}),(0,i.jsx)(J.Button,{iconOnly:!0,ariaLabel:e??"Zoom out",dataHook:`${t}-zoom-out`,disabled:!$||B===0,variant:"ghost",onClick:()=>H(-1),children:(0,i.jsx)(Y.ZoomOut,{"aria-hidden":!0})})]}),[Ue,fe]=c.useState(0),Ze=c.useMemo(()=>()=>(fe(a=>a+1),()=>fe(a=>a-1)),[]),Ye=a=>{const w=y[a];if(!w)return null;const M=a===j,q=w.expired||ee.has(w.src);if(q&&!M)return null;const O=Ne.get(w.src),me=O!==void 0&&1/O>ge;return(0,i.jsx)("div",{"aria-hidden":M?void 0:!0,className:(0,C.cn)("[container-type:size] absolute inset-0 flex px-4 pt-8 pb-4 sm:px-20",M&&!N?"overflow-auto":"overflow-hidden"),"data-media-viewer-backdrop":M?"":void 0,"data-slot":M?"media-viewer-slide":"media-viewer-peek",style:M?void 0:{transform:`translateX(${(a-j)*100}%)`},children:q?(0,i.jsx)("div",{className:"m-auto w-full max-w-3xl",children:(0,i.jsx)("div",{className:"aspect-[4/3] w-full",children:(0,i.jsx)(Ge.MediaEmpty,{dataHook:`${t}-empty`,message:R??"Image no longer available"})})}):(0,i.jsx)("img",{ref:M?le:void 0,alt:M?w.alt:"",className:(0,C.cn)("m-auto block h-auto",M&&N&&"cursor-grab active:cursor-grabbing",me?"w-full max-w-(--media-natural-width)":"w-[min(100cqw,calc(100cqh*var(--media-ratio,1)),var(--media-natural-width,100cqw))]"),"data-fit":M?me?"width":"contain":void 0,"data-hook":M?`${t}-image`:void 0,"data-media-viewer-backdrop":M&&!N?"":void 0,"data-slot":M?"media-viewer-image":void 0,"data-zoom":M?G[B]:void 0,decoding:"sync",draggable:!1,src:qe.has(w.src)?w.src:w.thumbnailSrc??w.src,style:{"--media-ratio":O,"--media-natural-width":oe.has(w.src)?`${oe.get(w.src)}px`:void 0,visibility:M&&!z.revealed?"hidden":void 0},onError:()=>Ce(w.src),onLoad:Ke=>Le(Ke,w.src,M)})},w.src)};return(0,i.jsxs)(pe.DialogPortal,{children:[(0,i.jsx)(pe.DialogOverlay,{ref:De,className:"data-[state=closed]:duration-fast bg-black/85 data-[state=closed]:ease-out"}),(0,i.jsxs)(te.Content,{ref:$e,"aria-describedby":void 0,className:(0,C.cn)("dark text-foreground group/viewer data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-fast fixed inset-0 z-50 grid h-dvh w-screen grid-rows-[minmax(0,1fr)_auto] ease-out outline-none",o),"data-hook":t,"data-media-viewer-backdrop":"","data-slot":"media-viewer-content","data-tracking-el":m??"media-viewer","data-tracking-label":n,...T,onClick:a=>Z.composeEventHandlers(f,Be)(a),onCloseAutoFocus:a=>Z.composeEventHandlers(u,Ve)(a),onEscapeKeyDown:a=>Z.composeEventHandlers(h,w=>{w.preventDefault(),z.requestClose({fade:N})})(a),onKeyDown:a=>Z.composeEventHandlers(k,ze)(a),onOpenAutoFocus:a=>Z.composeEventHandlers(E,We)(a),children:[(0,i.jsxs)("div",{ref:ce,className:(0,C.cn)("group/stage relative min-h-0 overflow-hidden select-none",N?"touch-none":"touch-pan-y"),"data-hook":`${t}-frame`,"data-slot":"media-viewer-frame",onPointerCancel:N?A.onPointerUp:U.onPointerCancel,onPointerDown:N?A.onPointerDown:U.onPointerDown,onPointerMove:N?A.onPointerMove:U.onPointerMove,onPointerUp:N?A.onPointerUp:U.onPointerUp,children:[(0,i.jsx)("div",{ref:Oe,className:"relative size-full",children:[j-1,j,j+1].map(Ye)}),F>1?(0,i.jsx)(lt,{dataHook:t,hasNext:ke,hasPrevious:Pe,nextLabel:b,previousLabel:p,onStep:I.step}):null]}),(0,i.jsxs)("div",{ref:Fe,className:(0,C.cn)("grid items-center gap-x-4 gap-y-1 px-4 pt-6 pb-3 sm:px-8","grid-cols-[minmax(0,1fr)_auto] [grid-template-areas:'strip_strip'_'title_actions'_'caption_actions'_'date_actions']","sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_minmax(0,1fr)] sm:[grid-template-areas:'title_strip_actions'_'caption_strip_actions'_'date_strip_actions']"),"data-media-viewer-backdrop":"","data-slot":"media-viewer-bar",children:[F>1?(0,i.jsx)("span",{"aria-atomic":"true","aria-live":"polite",className:"sr-only","data-hook":`${t}-position`,"data-slot":"media-viewer-position",role:"status",children:(g??nt)(j+1,F)}):null,F>1?(0,i.jsx)(ut,{dataHook:t,failed:ee,index:j,items:y,label:x,onRatio:se,onSelect:I.goTo}):null,P?.alt?(0,i.jsx)(V.TruncatedText,{dataHook:`${t}-caption`,full:P.alt,render:a=>(0,i.jsx)("p",{ref:a,"aria-hidden":!0,className:"text-body-xs truncate [grid-area:caption]","data-hook":`${t}-caption`,"data-slot":"media-viewer-caption",children:P.alt})}):null,P?.date?(0,i.jsx)(Qe.RelativeDate,{className:"truncate [grid-area:date]",dataHook:`${t}-date`,labels:v,value:P.date}):null,(0,i.jsx)(V.MediaViewerControlsContext.Provider,{value:{lead:de,more:ue},children:(0,i.jsxs)(V.MediaViewerActionsRegistry.Provider,{value:Ze,children:[Ue?null:(0,i.jsxs)("div",{className:"flex items-center justify-end gap-1 [grid-area:actions]","data-hook":`${t}-actions`,"data-slot":"media-viewer-actions",children:[de,ue]}),d]})})]})]})]})});be.displayName="MediaViewerView";var _e=c.forwardRef((t,d)=>{const{viewable:g}=V.useMediaViewerContext("MediaViewerContent");return g?(0,i.jsx)(be,{ref:d,...t}):null});_e.displayName="MediaViewerContent";exports.MediaViewerContent=_e;
1
+ "use client";const ye=require("../_virtual/_rolldown/runtime.cjs"),J=require("../button.cjs"),pe=require("../dialog.cjs"),Z=require("./compose-event-handlers.cjs"),He=require("../info-tooltip.cjs"),Ge=require("../media-empty.cjs"),V=require("./media-viewer-internal.cjs"),D=require("./media-viewer-motion.cjs"),Je=require("./download-file.cjs"),he=require("./image-file-info.cjs"),Qe=require("../relative-date.cjs");let c=require("react");c=ye.__toESM(c,1);let Y=require("@brightlocal/icons"),C=require("@brightlocal/ui-components/lib/utils"),i=require("react/jsx-runtime"),et=require("@brightlocal/ui-components/hooks/use-overlay-pointer-lock"),te=require("@radix-ui/react-dialog");te=ye.__toESM(te,1);let W=require("@brightlocal/ui-components/lib/motion"),tt=require("@brightlocal/ui-components/hooks/use-prefers-reduced-motion");var G=[1,1.5,2,3],ge=2.5,we=(0,C.cn)("group/nav absolute inset-y-0 flex w-16 items-center justify-center outline-none sm:w-20","duration-fast opacity-0 transition-opacity ease-out","group-hover/stage:opacity-100 focus-visible:opacity-100","disabled:invisible pointer-coarse:hidden"),xe=(0,C.cn)(J.ButtonVariants({variant:"ghost"}),"pointer-events-none size-9 p-0 group-hover/nav:bg-accent group-hover/nav:text-accent-foreground group-focus-visible/nav:shadow-default"),nt=(t,d)=>`${t} of ${d}`;function rt(t,d,g){const[p,b]=c.useState(()=>new Set),[x,R]=c.useState(()=>new Map),[_,e]=c.useState(()=>new Set),[l,s]=c.useState(()=>new Map),v=c.useCallback((m,n,f)=>{if(!n||!f)return null;const u=n/f;return R(h=>h.get(m)===u?h:new Map(h).set(m,u)),u},[]),o=c.useCallback(m=>{b(n=>new Set(n).add(m))},[]);return c.useEffect(()=>{if(!g)return;let m=!1;for(const n of[t[d],t[d+1],t[d-1]]){if(!n||n.expired)continue;const f=new Image;f.src=n.src,f.decode().then(()=>{m||(v(n.src,f.naturalWidth,f.naturalHeight),s(u=>u.get(n.src)===f.naturalWidth?u:new Map(u).set(n.src,f.naturalWidth)),e(u=>u.has(n.src)?u:new Set(u).add(n.src)))}).catch(()=>{})}return()=>{m=!0}},[g,t,d,v]),{failed:p,ratios:x,widths:l,ready:_,noteRatio:v,markFailed:o}}function at({index:t,openCount:d,openedAtRef:g,triggersRef:p,reducedMotion:b,setOpen:x,revealed:R,reveal:_}){const e=c.useRef(null),l=c.useRef(null),s=c.useRef(null),v=c.useRef(0),o=c.useRef(0),m=u=>{const h=p.current.get(u);return h?.isConnected?h:null};return{imageRef:e,overlayRef:l,barRef:s,revealed:R,reveal:_,zoomIn:(u,h,k)=>{if(v.current===d||(v.current=d,u.style.visibility="visible",_(),k-g.current>500))return;const E=b||h?null:m(t),T=E?D.zoomKeyframe(E,u):null;T?u.animate([T,D.ZOOM_REST],{duration:W.MOTION_DURATION_SLOW_MS,easing:W.MOTION_EASE_EMPHASIZED}):u.animate([{opacity:0},{opacity:1}],{duration:W.MOTION_DURATION_SLOW_MS,easing:"ease-out"})},requestClose:({fade:u=!1}={})=>{if(o.current===d)return;const h=e.current,k=b||u?null:m(t);h?.getAnimations().forEach(r=>r.cancel());const E=h&&k?D.zoomKeyframe(k,h):null;if(!h||!E){x(!1);return}o.current=d;const T={duration:W.MOTION_DURATION_BASE_MS,easing:"ease-in-out",fill:"forwards"};for(const r of[l.current,s.current])r?.animate([{opacity:1},{opacity:0}],T);h.animate([D.ZOOM_REST,E],T).finished.catch(()=>{}).finally(()=>x(!1))}}}function it({index:t,total:d,reducedMotion:g,onStep:p}){const b=c.useRef(null),x=c.useRef(null),R=c.useRef(null),_=c.useRef(null),e=()=>b.current?.clientWidth??0,l=r=>{const y=x.current;y&&(y.style.transform=r?`translateX(${r}px)`:"")},s=r=>r>0&&t===0||r<0&&t===d-1,v=r=>s(r)?D.rubberBand(r,e()*D.RUBBER_BAND_SHARE):r,o=(r,y)=>{const S=x.current?.animate([{transform:`translateX(${r}px)`},{transform:"none"}],D.glideTiming(r,y));_.current=S?{from:r,animation:S}:null},m=(r,y=0)=>{l(0),!(!r||g)&&o(r,y)},n=()=>{const r=_.current?.animation.playState;return r==="running"||r==="paused"},f=()=>{const r=_.current;if(_.current=null,!r||r.animation.playState==="finished")return 0;const y=r.animation.effect?.getComputedTiming().progress,S=r.from*(1-(y??0));return r.animation.cancel(),l(S),S},u=(r,y=0,S=0)=>{if(r===t||r<0||r>=d)return;const X=e();y&&!g&&X&&Math.abs(r-t)===1&&(R.current={from:(r>t?1:-1)*X+y,speed:S}),p(r)},h=r=>u(t+r),k=()=>Math.min(e()*D.DRAG_STEP_SHARE,160),E=(r,y=k())=>{const S=t+(r<0?1:-1);return Math.abs(r)>y&&S>=0&&S<d},T=(r,y,S=0)=>{const X=y<0?1:-1,Q=!(S*y<0&&Math.abs(S)>.2)&&(Math.abs(y)>k()||Math.abs(S)>.5),L=t+X;Q&&L>=0&&L<d?u(L,r,S):m(r,S)};return c.useLayoutEffect(()=>{const r=R.current;R.current=null,_.current?.animation.cancel(),_.current=null,l(0),r?.from&&o(r.from,r.speed)},[t]),{frameRef:b,trackRef:x,moveTrack:l,pastEnd:s,resist:v,settle:m,gliding:n,stopGlide:f,goTo:u,step:h,canStep:E,release:T}}function ot(t,d,g){const p=c.useRef({x:0,y:0}),b=c.useRef(t),x=c.useRef(null),R=c.useRef(!1),_=n=>{const f=d.current,u=g.current;if(!f||!u)return;const h=b.current,k=Math.max(0,(f.offsetWidth*h-u.clientWidth)/2),E=Math.max(0,(f.offsetHeight*h-u.clientHeight)/2),T=p.current;T.x=Math.min(k,Math.max(-k,T.x)),T.y=Math.min(E,Math.max(-E,T.y)),f.style.transition=n?`transform ${W.MOTION_DURATION_BASE_MS}ms ${W.MOTION_EASE_DECELERATE}`:"none",f.style.transform=h===1?"":`translate(${T.x}px, ${T.y}px) scale(${h})`};c.useLayoutEffect(()=>{const n=t/b.current;b.current=t,p.current=t===1?{x:0,y:0}:{x:p.current.x*n,y:p.current.y*n},_(!0)},[t]);const e=(n,f)=>{p.current.x+=n,p.current.y+=f,_(!1)};return{panBy:e,reset:()=>{const n=d.current;p.current={x:0,y:0},b.current=1,n&&(n.style.transition="none",n.style.transform="")},onPointerDown:n=>{n.pointerType==="mouse"&&n.button!==0||(R.current=!1,n.target instanceof Node&&d.current?.contains(n.target)&&(x.current={x:n.clientX,y:n.clientY,moved:!1},n.currentTarget.setPointerCapture?.(n.pointerId)))},onPointerMove:n=>{const f=x.current;if(!f)return;const u=n.clientX-f.x,h=n.clientY-f.y;!f.moved&&Math.hypot(u,h)<4||(f.moved=!0,f.x=n.clientX,f.y=n.clientY,e(u,h))},onPointerUp:()=>{R.current=!!x.current?.moved,x.current=null},consumePan:()=>{const n=R.current;return R.current=!1,n}}}function st(t,d){const g=c.useRef(!1),p=c.useRef(null);return{consumeSwipe:()=>{const l=g.current;return g.current=!1,l},onPointerDown:l=>{g.current=!1,!(l.pointerType==="mouse"||!d)&&(p.current={x:l.clientX,y:l.clientY,axis:null,base:0,offset:0,speed:0,lastX:l.clientX,lastTime:l.timeStamp})},onPointerMove:l=>{const s=p.current;if(!s)return;const v=l.clientX-s.x,o=l.clientY-s.y;if(!s.axis){if(Math.hypot(v,o)<8)return;s.axis=Math.abs(v)>Math.abs(o)?"x":"y",s.axis==="x"&&(s.base=t.stopGlide())}if(s.axis!=="x")return;const m=l.timeStamp-s.lastTime;if(m>0){const n=(l.clientX-s.lastX)/m;s.speed=s.speed*.3+n*.7}s.lastX=l.clientX,s.lastTime=l.timeStamp,s.offset=t.resist(s.base+v),t.moveTrack(s.offset)},onPointerUp:l=>{const s=p.current;if(p.current=null,!s||s.axis!=="x")return;g.current=!0;const v=l.timeStamp-s.lastTime>80?0:s.speed;t.release(s.offset,l.clientX-s.x,v)},onPointerCancel:()=>{const l=p.current;p.current=null,l?.axis==="x"&&t.settle(l.offset)}}}function ct(t,d,g,p){const b=c.useRef(d),x=c.useRef(g),R=c.useRef(p);c.useLayoutEffect(()=>{b.current=d,x.current=g,R.current=p});const _=c.useRef({swiping:!1,intent:0,offset:0,pull:0,previous:0,fading:0,speed:0,last:0,inertia:0,inertiaTimer:0,inertiaPrevious:0,inertiaFaintest:0,inertiaFading:!1,cancelTimer:0});c.useEffect(()=>{if(!t)return;const e=_.current,l=o=>{e.inertia=o,window.clearTimeout(e.inertiaTimer),e.inertiaTimer=window.setTimeout(()=>{e.inertia=0},300)},s=o=>{l(o),e.inertiaPrevious=Math.abs(o),e.inertiaFaintest=Math.abs(o),e.inertiaFading=!1},v=o=>{if(o.ctrlKey)return;if(!x.current){o.preventDefault(),R.current(-o.deltaX,-o.deltaY);return}if(Math.abs(o.deltaY)>Math.abs(o.deltaX)||o.target instanceof Element&&o.target.closest('[data-slot="media-viewer-thumbnails"]'))return;o.preventDefault();const m=b.current,n=Math.abs(o.deltaX),f=o.timeStamp-e.last;if(e.last=o.timeStamp,e.swiping)f>0&&(e.speed=e.speed*.3+-o.deltaX/f*.7);else{window.clearTimeout(e.cancelTimer);const h=e.inertia!==0&&Math.sign(o.deltaX)===Math.sign(e.inertia);h&&(n<e.inertiaPrevious&&(e.inertiaFading||(e.inertiaFaintest=n),e.inertiaFading=!0),e.inertiaFading&&(e.inertiaFaintest=Math.min(e.inertiaFaintest,n)),e.inertiaPrevious=n);const k=e.inertiaFading&&n>=e.inertiaFaintest*2;if(h&&!k&&(m.gliding()||n<=Math.abs(e.inertia)*1.2)){l(o.deltaX),e.intent=0;return}if(e.intent+=o.deltaX,Math.abs(e.intent)<=30){e.cancelTimer=window.setTimeout(()=>{e.intent=0},600);return}e.intent=0,e.swiping=!0,e.inertia=0,e.inertiaFading=!1,e.offset=m.stopGlide(),e.pull=0,e.speed=0,e.fading=0}window.clearTimeout(e.cancelTimer);const u=t.clientWidth;if(e.offset=Math.max(-u,Math.min(u,e.offset-o.deltaX)),e.pull-=o.deltaX,m.moveTrack(m.resist(e.offset)),e.fading=n<e.previous?e.fading+1:0,e.previous=n,m.pastEnd(e.offset)&&e.fading>=2){e.swiping=!1,s(o.deltaX),m.release(m.resist(e.offset),0);return}if(m.canStep(e.pull,u*.2)){e.swiping=!1,s(o.deltaX),m.release(m.resist(e.offset),e.pull,e.speed);return}e.cancelTimer=window.setTimeout(()=>{e.swiping=!1,m.release(m.resist(e.offset),0)},600)};return t.addEventListener("wheel",v,{passive:!1}),()=>{t.removeEventListener("wheel",v),window.clearTimeout(e.cancelTimer),window.clearTimeout(e.inertiaTimer)}},[t])}function lt({dataHook:t,hasPrevious:d,hasNext:g,previousLabel:p,nextLabel:b,onStep:x}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{"aria-label":p??"Previous",className:(0,C.cn)(we,"left-0"),"data-hook":`${t}-previous`,"data-slot":"media-viewer-previous",disabled:!d,type:"button",onClick:()=>x(-1),children:(0,i.jsx)("span",{"aria-hidden":!0,className:xe,children:(0,i.jsx)(Y.ChevronLeft,{})})}),(0,i.jsx)("button",{"aria-label":b??"Next",className:(0,C.cn)(we,"right-0"),"data-hook":`${t}-next`,"data-slot":"media-viewer-next",disabled:!g,type:"button",onClick:()=>x(1),children:(0,i.jsx)("span",{"aria-hidden":!0,className:xe,children:(0,i.jsx)(Y.ChevronRight,{})})})]})}function ut({dataHook:t,items:d,index:g,failed:p,label:b,onSelect:x,onRatio:R}){const _=c.useRef(null);return c.useEffect(()=>{_.current?.querySelector('[aria-current="true"]')?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[g]),(0,i.jsx)("div",{ref:_,"aria-label":b??"Images",className:"mb-2 flex max-w-full gap-1.5 justify-self-center overflow-x-auto p-1 [grid-area:strip] sm:mb-0","data-hook":`${t}-thumbnails`,"data-slot":"media-viewer-thumbnails",role:"group",children:d.map((e,l)=>{const s=l===g,v=e.expired||p.has(e.src);return(0,i.jsx)("button",{"aria-current":s?"true":void 0,"aria-label":e.alt,className:(0,C.cn)("bg-muted relative size-12 shrink-0 overflow-hidden rounded-md outline-none","duration-fast focus-visible:shadow-default transition-opacity ease-out",s?"opacity-100":"opacity-50 hover:opacity-100"),"data-hook":`${t}-thumbnail-${l}`,"data-slot":"media-viewer-thumbnail",type:"button",onClick:()=>x(l),children:v?null:(0,i.jsx)("img",{alt:"",className:"size-full object-cover object-top",decoding:"async",draggable:!1,loading:"lazy",src:e.thumbnailSrc??e.src,onLoad:o=>R(e.src,o.currentTarget.naturalWidth,o.currentTarget.naturalHeight)})},e.src)})})}var be=c.forwardRef(({dataHook:t,children:d,formatPosition:g,previousLabel:p,nextLabel:b,thumbnailsLabel:x,unavailableMessage:R,zoomInLabel:_,zoomOutLabel:e,downloadLabel:l,infoLabel:s,dateLabels:v,className:o,trackingEl:m,trackingLabel:n,onClick:f,onCloseAutoFocus:u,onEscapeKeyDown:h,onKeyDown:k,onOpenAutoFocus:E,...T},r)=>{const{items:y,index:S,setIndex:X,openerRef:Q,open:L,setOpen:ve,openCount:ne,openedAtRef:Me,revealed:Re,reveal:Se,triggersRef:Te,renderActions:re,actionsLabel:je}=V.useMediaViewerContext("MediaViewerContent"),ae=(0,tt.usePrefersReducedMotion)();(0,et.useOverlayPointerLock)();const F=y.length,j=Math.min(Math.max(S,0),Math.max(F-1,0)),Pe=j>0,ke=j<F-1,K=`${ne}:${j}`,[ie,Ee]=c.useState({key:"",level:0}),B=ie.key===K?ie.level:0,N=B>0,H=a=>Ee(w=>{const M=w.key===K?w.level:0,q=Math.min(Math.max(M+a,0),G.length-1);return q===M&&w.key===K?w:{key:K,level:q}}),{failed:ee,ratios:Ne,widths:oe,ready:qe,noteRatio:se,markFailed:Ce}=rt(y,j,L),z=at({index:j,openCount:ne,openedAtRef:Me,triggersRef:Te,reducedMotion:ae,setOpen:ve,revealed:Re,reveal:Se}),I=it({index:j,total:F,reducedMotion:ae,onStep:a=>{z.reveal(),A.reset(),X(a)}}),U=st(I,!N),{frameRef:ce,trackRef:Oe}=I,{imageRef:le,overlayRef:De,barRef:Fe}=z,A=ot(G[B]??1,le,ce),[Ie,Ae]=c.useState(null),$e=c.useCallback(a=>{Ae(a),typeof r=="function"?r(a):r&&(r.current=a)},[r]);ct(Ie,I,!N,A.panBy);const P=y[j],$=!!(P&&!P.expired&&!ee.has(P.src)),Xe=he.useImageFileInfo($?P?.downloadSrc??P?.src:void 0,L),Le=(a,w,M)=>{const q=a.currentTarget,O=se(w,q.naturalWidth,q.naturalHeight);M&&(O&&q.style.setProperty("--media-ratio",String(O)),z.zoomIn(q,O!==null&&1/O>ge,a.timeStamp))},ze=a=>{a.defaultPrevented||a.target.closest('[role="menu"]')||(a.key==="ArrowLeft"?(a.preventDefault(),I.step(-1)):a.key==="ArrowRight"?(a.preventDefault(),I.step(1)):(a.key==="+"||a.key==="=")&&$?(a.preventDefault(),H(1)):a.key==="-"&&$&&(a.preventDefault(),H(-1)))},Ve=a=>{const w=Q.current;w?.isConnected&&(a.preventDefault(),w.focus())},We=a=>{a.preventDefault(),a.currentTarget?.focus()},Be=a=>{U.consumeSwipe()||A.consumePan()||a.target instanceof HTMLElement&&a.target.hasAttribute("data-media-viewer-backdrop")&&z.requestClose({fade:N})},ue=(0,i.jsxs)(i.Fragment,{children:[P&&re?(0,i.jsx)(V.ItemActionsMenu,{dataHook:`${t}-actions-menu`,label:je(P,j),variant:"ghost",children:re(P,j)}):null,(0,i.jsx)(He.InfoTooltip,{ariaLabel:s??"Image details",className:"text-foreground hover:bg-accent size-9 items-center justify-center rounded-md",content:he.describeImageFile(Xe),dataHook:`${t}-info`,disabled:!$})]}),de=(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(J.Button,{iconOnly:!0,ariaLabel:l??"Download",dataHook:`${t}-download`,disabled:!$,variant:"ghost",onClick:()=>{P&&Je.downloadFile(P.downloadSrc??P.src)},children:(0,i.jsx)(Y.Download,{"aria-hidden":!0})}),(0,i.jsx)(J.Button,{iconOnly:!0,ariaLabel:_??"Zoom in",dataHook:`${t}-zoom-in`,disabled:!$||B===G.length-1,variant:"ghost",onClick:()=>H(1),children:(0,i.jsx)(Y.ZoomIn,{"aria-hidden":!0})}),(0,i.jsx)(J.Button,{iconOnly:!0,ariaLabel:e??"Zoom out",dataHook:`${t}-zoom-out`,disabled:!$||B===0,variant:"ghost",onClick:()=>H(-1),children:(0,i.jsx)(Y.ZoomOut,{"aria-hidden":!0})})]}),[Ue,fe]=c.useState(0),Ze=c.useMemo(()=>()=>(fe(a=>a+1),()=>fe(a=>a-1)),[]),Ye=a=>{const w=y[a];if(!w)return null;const M=a===j,q=w.expired||ee.has(w.src);if(q&&!M)return null;const O=Ne.get(w.src),me=O!==void 0&&1/O>ge;return(0,i.jsx)("div",{"aria-hidden":M?void 0:!0,className:(0,C.cn)("[container-type:size] absolute inset-0 flex px-4 pt-8 pb-4 sm:px-20",M&&!N?"overflow-auto":"overflow-hidden"),"data-media-viewer-backdrop":M?"":void 0,"data-slot":M?"media-viewer-slide":"media-viewer-peek",style:M?void 0:{transform:`translateX(${(a-j)*100}%)`},children:q?(0,i.jsx)("div",{className:"m-auto w-full max-w-3xl",children:(0,i.jsx)("div",{className:"aspect-[4/3] w-full",children:(0,i.jsx)(Ge.MediaEmpty,{dataHook:`${t}-empty`,message:R??"Image no longer available"})})}):(0,i.jsx)("img",{ref:M?le:void 0,alt:M?w.alt:"",className:(0,C.cn)("m-auto block h-auto",M&&N&&"cursor-grab active:cursor-grabbing",me?"w-full max-w-(--media-natural-width)":"w-[min(100cqw,calc(100cqh*var(--media-ratio,1)),var(--media-natural-width,100cqw))]"),"data-fit":M?me?"width":"contain":void 0,"data-hook":M?`${t}-image`:void 0,"data-media-viewer-backdrop":M&&!N?"":void 0,"data-slot":M?"media-viewer-image":void 0,"data-zoom":M?G[B]:void 0,decoding:"sync",draggable:!1,src:qe.has(w.src)?w.src:w.thumbnailSrc??w.src,style:{"--media-ratio":O,"--media-natural-width":oe.has(w.src)?`${oe.get(w.src)}px`:void 0,visibility:M&&!z.revealed?"hidden":void 0},onError:()=>Ce(w.src),onLoad:Ke=>Le(Ke,w.src,M)})},w.src)};return(0,i.jsxs)(pe.DialogPortal,{children:[(0,i.jsx)(pe.DialogOverlay,{ref:De,className:"data-[state=closed]:duration-fast bg-black/85 data-[state=closed]:ease-out"}),(0,i.jsxs)(te.Content,{ref:$e,"aria-describedby":void 0,className:(0,C.cn)("dark text-foreground group/viewer data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-fast fixed inset-0 z-50 grid h-dvh w-screen grid-rows-[minmax(0,1fr)_auto] ease-out outline-none",o),"data-hook":t,"data-media-viewer-backdrop":"","data-slot":"media-viewer-content","data-tracking-el":m??"media-viewer","data-tracking-label":n,...T,onClick:a=>Z.composeEventHandlers(f,Be)(a),onCloseAutoFocus:a=>Z.composeEventHandlers(u,Ve)(a),onEscapeKeyDown:a=>Z.composeEventHandlers(h,w=>{w.preventDefault(),z.requestClose({fade:N})})(a),onKeyDown:a=>Z.composeEventHandlers(k,ze)(a),onOpenAutoFocus:a=>Z.composeEventHandlers(E,We)(a),children:[(0,i.jsxs)("div",{ref:ce,className:(0,C.cn)("group/stage relative min-h-0 overflow-hidden select-none",N?"touch-none":"touch-pan-y"),"data-hook":`${t}-frame`,"data-slot":"media-viewer-frame",onPointerCancel:N?A.onPointerUp:U.onPointerCancel,onPointerDown:N?A.onPointerDown:U.onPointerDown,onPointerMove:N?A.onPointerMove:U.onPointerMove,onPointerUp:N?A.onPointerUp:U.onPointerUp,children:[(0,i.jsx)("div",{ref:Oe,className:"relative size-full",children:[j-1,j,j+1].map(Ye)}),F>1?(0,i.jsx)(lt,{dataHook:t,hasNext:ke,hasPrevious:Pe,nextLabel:b,previousLabel:p,onStep:I.step}):null]}),(0,i.jsxs)("div",{ref:Fe,className:(0,C.cn)("grid items-center gap-x-4 gap-y-1 px-4 pt-6 pb-3 sm:px-8","grid-cols-[minmax(0,1fr)_auto] [grid-template-areas:'strip_strip'_'title_actions'_'caption_actions'_'date_actions']","sm:grid-cols-[minmax(0,1fr)_minmax(0,2fr)_minmax(0,1fr)] sm:[grid-template-areas:'title_strip_actions'_'caption_strip_actions'_'date_strip_actions']"),"data-media-viewer-backdrop":"","data-slot":"media-viewer-bar",children:[F>1?(0,i.jsx)("span",{"aria-atomic":"true","aria-live":"polite",className:"sr-only","data-hook":`${t}-position`,"data-slot":"media-viewer-position",role:"status",children:(g??nt)(j+1,F)}):null,F>1?(0,i.jsx)(ut,{dataHook:t,failed:ee,index:j,items:y,label:x,onRatio:se,onSelect:I.goTo}):null,P?.alt?(0,i.jsx)(V.TruncatedText,{dataHook:`${t}-caption`,full:P.alt,render:a=>(0,i.jsx)("p",{ref:a,"aria-hidden":!0,className:"text-body-xs truncate [grid-area:caption]","data-hook":`${t}-caption`,"data-slot":"media-viewer-caption",children:P.alt})}):null,P?.date?(0,i.jsx)(Qe.RelativeDate,{className:"truncate [grid-area:date]",dataHook:`${t}-date`,labels:v,value:P.date}):null,(0,i.jsx)(V.MediaViewerControlsContext.Provider,{value:{lead:de,more:ue},children:(0,i.jsxs)(V.MediaViewerActionsRegistry.Provider,{value:Ze,children:[Ue?null:(0,i.jsxs)("div",{className:"flex items-center justify-end gap-1 [grid-area:actions]","data-hook":`${t}-actions`,"data-slot":"media-viewer-actions",children:[de,ue]}),d]})})]})]})]})});be.displayName="MediaViewerView";var _e=c.forwardRef((t,d)=>{const{viewable:g}=V.useMediaViewerContext("MediaViewerContent");return g?(0,i.jsx)(be,{ref:d,...t}):null});_e.displayName="MediaViewerContent";exports.MediaViewerContent=_e;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { Button as H, ButtonVariants as Ye } from "../button.js";
3
3
  import { DialogOverlay as Ke, DialogPortal as Ge } from "../dialog.js";
4
+ import { composeEventHandlers as Z } from "./compose-event-handlers.js";
4
5
  import { InfoTooltip as He } from "../info-tooltip.js";
5
6
  import { MediaEmpty as Je } from "../media-empty.js";
6
- import { composeEventHandlers as Z } from "./compose-event-handlers.js";
7
7
  import { ItemActionsMenu as Qe, MediaViewerActionsRegistry as et, MediaViewerControlsContext as tt, TruncatedText as nt, useMediaViewerContext as we } from "./media-viewer-internal.js";
8
8
  import { DRAG_STEP_SHARE as at, RUBBER_BAND_SHARE as rt, ZOOM_REST as de, glideTiming as it, rubberBand as ot, zoomKeyframe as fe } from "./media-viewer-motion.js";
9
9
  import { downloadFile as st } from "./download-file.js";
@@ -1 +1 @@
1
- const t=require("../_virtual/_rolldown/runtime.cjs");let e=require("react");e=t.__toESM(e,1);var l="[&_tr>*:first-child]:pl-[var(--content-inset,24px)] [&_tr>*:last-child]:pr-[var(--content-inset,24px)]",a={default:48,sm:40},n=e.createContext("default");function o(r){return{role:"region","aria-label":r??"Scrollable table",tabIndex:0}}exports.TABLE_CONTAINER_INSET=l;exports.TABLE_ROW_MIN_HEIGHT=a;exports.TableSizeContext=n;exports.scrollRegionProps=o;
1
+ const s=require("../_virtual/_rolldown/runtime.cjs");let r=require("react");r=s.__toESM(r,1);var a="[&_tr>*:first-child]:pl-[var(--content-inset,24px)] [&_tr>*:last-child]:pr-[var(--content-inset,24px)]",_={default:48,sm:40},c=r.createContext("default");function E(t){return{role:"region","aria-label":t??"Scrollable table",tabIndex:0}}var n="--table-view-inline-size";function I(t,i){r.useLayoutEffect(()=>{const e=t.current;if(!i||!e)return;const l=()=>e.style.setProperty(n,`${e.clientWidth}px`);l();const o=new ResizeObserver(l);return o.observe(e),()=>{o.disconnect(),e.style.removeProperty(n)}},[t,i])}exports.TABLE_CONTAINER_INSET=a;exports.TABLE_ROW_MIN_HEIGHT=_;exports.TABLE_VIEW_INLINE_SIZE_VAR=n;exports.TableSizeContext=c;exports.scrollRegionProps=E;exports.useTableViewInlineSize=I;
@@ -59,4 +59,23 @@ export declare function scrollRegionProps(scrollRegionLabel: string | undefined)
59
59
  readonly "aria-label": string;
60
60
  readonly tabIndex: 0;
61
61
  };
62
+ /**
63
+ * CSS custom property a table's scroll container publishes with its visible
64
+ * inline size (`clientWidth`, px) — DS-1105. `TableEmpty` caps its message
65
+ * at it and pins the message `sticky left-0`, so the empty state stays in
66
+ * the visible part of a table that scrolls sideways. Measured rather than
67
+ * `container-type: inline-size` + `cqi`: inline-size containment zeroes the
68
+ * element's intrinsic width, which collapses a table to 0px in any
69
+ * shrink-to-fit parent (a row flex item without `flex-1`, `w-fit`, a grid
70
+ * `auto` track).
71
+ */
72
+ export declare const TABLE_VIEW_INLINE_SIZE_VAR = "--table-view-inline-size";
73
+ /**
74
+ * Publish the scroll container's visible inline size as
75
+ * `--table-view-inline-size` on the element itself (inherited by every cell),
76
+ * kept current by a ResizeObserver. Written straight to the element's style —
77
+ * no React state, so a resize never re-renders the table. Removed when
78
+ * `enabled` turns false or on unmount.
79
+ */
80
+ export declare function useTableViewInlineSize(ref: React.RefObject<HTMLElement | null>, enabled: boolean): void;
62
81
  //# sourceMappingURL=table-internal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"table-internal.d.ts","sourceRoot":"","sources":["../../src/lib/table-internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,WAAW,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,2GACwE,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG1D,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,0BAA4C,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS;;;;EAMtE"}
1
+ {"version":3,"file":"table-internal.d.ts","sourceRoot":"","sources":["../../src/lib/table-internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;GAKG;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,WAAW,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,2GACwE,CAAC;AAE3G;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAG1D,CAAC;AAEF,iEAAiE;AACjE,eAAO,MAAM,gBAAgB,0BAA4C,CAAC;AAE1E;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS;;;;EAMtE;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AAErE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EACxC,OAAO,EAAE,OAAO,GACf,IAAI,CAcN"}
@@ -1,18 +1,33 @@
1
- import * as e from "react";
2
- var r = "[&_tr>*:first-child]:pl-[var(--content-inset,24px)] [&_tr>*:last-child]:pr-[var(--content-inset,24px)]", a = {
1
+ import * as l from "react";
2
+ var s = "[&_tr>*:first-child]:pl-[var(--content-inset,24px)] [&_tr>*:last-child]:pr-[var(--content-inset,24px)]", a = {
3
3
  default: 48,
4
4
  sm: 40
5
- }, l = e.createContext("default");
6
- function n(t) {
5
+ }, c = l.createContext("default");
6
+ function u(t) {
7
7
  return {
8
8
  role: "region",
9
9
  "aria-label": t ?? "Scrollable table",
10
10
  tabIndex: 0
11
11
  };
12
12
  }
13
+ var i = "--table-view-inline-size";
14
+ function v(t, r) {
15
+ l.useLayoutEffect(() => {
16
+ const e = t.current;
17
+ if (!r || !e) return;
18
+ const n = () => e.style.setProperty(i, `${e.clientWidth}px`);
19
+ n();
20
+ const o = new ResizeObserver(n);
21
+ return o.observe(e), () => {
22
+ o.disconnect(), e.style.removeProperty(i);
23
+ };
24
+ }, [t, r]);
25
+ }
13
26
  export {
14
- r as TABLE_CONTAINER_INSET,
27
+ s as TABLE_CONTAINER_INSET,
15
28
  a as TABLE_ROW_MIN_HEIGHT,
16
- l as TableSizeContext,
17
- n as scrollRegionProps
29
+ i as TABLE_VIEW_INLINE_SIZE_VAR,
30
+ c as TableSizeContext,
31
+ u as scrollRegionProps,
32
+ v as useTableViewInlineSize
18
33
  };
package/dist/list.cjs CHANGED
@@ -1 +1 @@
1
- "use client";const G=require("./_virtual/_rolldown/runtime.cjs");let s=require("react");s=G.__toESM(s,1);let J=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils"),n=require("react/jsx-runtime"),h=require("@radix-ui/react-slot"),L=require("class-variance-authority"),g=require("@brightlocal/ui-components/tooltip"),Q=require("@brightlocal/ui-components/skeleton");var I=(0,L.cva)(["group/item","flex","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-fast","ease-out","has-[>[data-slot=item-button]]:p-0","has-[>[data-slot=item-link]]:p-0"],{variants:{variant:{default:[],filled:["bg-muted"],outline:["bg-background","border","border-border"],loading:["p-0"]},align:{center:["items-center"],start:["items-start"]}},defaultVariants:{variant:"filled",align:"center"}}),T=(0,L.cva)(["flex","flex-col"],{variants:{inset:{true:["-mr-2","-ml-4"],false:[]},divided:{true:["gap-0","[&>[data-slot=item]]:rounded-none","[&>[data-slot=item]+[data-slot=item]]:border-t","[&>[data-slot=item]+[data-slot=item]]:border-border"],false:["gap-2"]}},defaultVariants:{inset:!1,divided:!1}}),V=s.forwardRef(({className:t,dataHook:e,trackingEl:a,trackingLabel:r,inset:i,divided:o,...l},c)=>(0,n.jsx)("ul",{ref:c,className:(0,d.cn)(T({inset:i,divided:o}),t),"data-divided":o?"":void 0,"data-hook":e,"data-slot":"list","data-tracking-el":a,"data-tracking-label":r,...l}));V.displayName="List";var x=s.forwardRef(({asChild:t=!1,className:e,variant:a,align:r,dataHook:i,trackingEl:o,trackingLabel:l,children:c,...m},p)=>(0,n.jsx)(t?h.Slot:"li",{ref:p,className:(0,d.cn)(I({variant:a,align:r}),e),"data-align":r??"center","data-hook":i,"data-slot":"item","data-tracking-el":o,"data-tracking-label":l,...m,children:a==="loading"?(0,n.jsx)(Q.Skeleton,{className:"h-13 w-full rounded-lg"}):c}));x.displayName="ListItem";var E=(0,L.cva)(["shrink-0"],{variants:{variant:{default:[],icon:["inline-flex","size-10","items-center","justify-center","rounded-lg","border","border-border","bg-background"],image:["size-10","overflow-hidden","rounded-lg","[&_img]:size-full","[&_img]:object-cover"]}},defaultVariants:{variant:"default"}}),k=s.forwardRef(({className:t,variant:e,...a},r)=>(0,n.jsx)("div",{ref:r,className:(0,d.cn)(E({variant:e}),t),"data-slot":"item-media","data-variant":e??"default",...a}));k.displayName="ListItemMedia";var w=s.forwardRef(({className:t,...e},a)=>(0,n.jsx)("div",{ref:a,className:(0,d.cn)("flex min-w-0 flex-1 flex-col gap-1",t),"data-slot":"item-content",...e}));w.displayName="ListItemContent";var U='[data-slot="item-button"], [data-slot="item-link"]';function X(t,e){const[a,r]=s.useState(!1);return s.useEffect(()=>{if(!e||!t)return;const i=()=>r(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1),o=new ResizeObserver(i);o.observe(t);const l=new MutationObserver(i);return l.observe(t,{characterData:!0,childList:!0,subtree:!0}),()=>{o.disconnect(),l.disconnect()}},[e,t]),e&&t!==null&&a}function Y(t,e){const[a,r]=s.useState(null),i=e?t?.closest(U)??null:null;return s.useEffect(()=>{if(!i)return;const o=()=>r(i===document.activeElement&&i.matches(":focus-visible")?i:null),l=()=>r(null);return o(),i.addEventListener("focus",o),i.addEventListener("blur",l),()=>{i.removeEventListener("focus",o),i.removeEventListener("blur",l)}},[i]),i!==null&&a===i}var N=s.forwardRef(({asChild:t=!1,truncate:e=!1,partSlot:a,tooltipSide:r,className:i,children:o,...l},c)=>{const[m,p]=s.useState(null),z=s.useCallback(u=>{p(u),typeof c=="function"?c(u):c&&(c.current=u)},[c]),v=X(m,e),f=Y(m,v),[P,H]=s.useState(!1),[W,b]=s.useState(!1),[K,$]=s.useState(f);f!==K&&($(f),f&&b(!1));const C=(0,n.jsx)(t?h.Slot:"div",{ref:z,className:(0,d.cn)(e&&"line-clamp-2",i),"data-slot":a,"data-truncated":v?"":void 0,...l,children:o});return v?(0,n.jsxs)(g.Tooltip,{open:!W&&(P||f),onOpenChange:u=>{u&&b(!1),H(u)},children:[(0,n.jsx)(g.TooltipTrigger,{asChild:!0,onPointerDown:u=>{const R=u.currentTarget;u.pointerType==="touch"&&(R.closest("button, a, label")||R.tagName==="LABEL")&&u.preventDefault()},children:C}),(0,n.jsx)(g.TooltipContent,{dataHook:`list-${a}-tooltip`,side:r,sideOffset:4,onEscapeKeyDown:()=>b(!0),children:o})]}):C});N.displayName="TruncatableText";var _=s.forwardRef(({className:t,...e},a)=>(0,n.jsx)(N,{ref:a,className:(0,d.cn)("text-foreground text-body",t),partSlot:"item-title",tooltipSide:"top",...e}));_.displayName="ListItemTitle";var y=s.forwardRef(({className:t,...e},a)=>(0,n.jsx)(N,{ref:a,className:(0,d.cn)("text-body-sm text-muted-foreground",t),partSlot:"item-description",tooltipSide:"bottom",...e}));y.displayName="ListItemDescription";var S=s.forwardRef(({className:t,...e},a)=>(0,n.jsx)("div",{ref:a,className:(0,d.cn)("text-muted-foreground flex min-h-9 min-w-9 shrink-0 items-center justify-center gap-2",t),"data-slot":"item-actions",...e}));S.displayName="ListItemActions";var j=s.forwardRef(({className:t,dataHook:e,...a},r)=>(0,n.jsx)("li",{ref:r,className:(0,d.cn)("text-muted-foreground text-label-sm flex items-center pt-4 pr-2 pb-1 pl-4 first:pt-2",t),"data-hook":e,"data-slot":"item-subheader",...a}));j.displayName="ListSubheader";var D=["flex","w-full","min-w-0","items-center","group-data-[align=start]/item:items-start","gap-4","rounded-[inherit]","py-2","pr-2","pl-4","text-left","cursor-pointer","outline-none","hover:bg-accent","focus-visible:shadow-default","transition-colors","duration-fast","ease-out","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","aria-disabled:pointer-events-none","aria-disabled:cursor-not-allowed","aria-disabled:opacity-50"];function q(t,e){const a=t.currentTarget.getAttribute("aria-disabled");if(a==="true"||a===""){t.preventDefault(),t.stopPropagation();return}e?.(t)}var M=s.forwardRef(({className:t,type:e="button",dataHook:a,trackingEl:r,trackingLabel:i,onClickCapture:o,...l},c)=>(0,n.jsx)("button",{ref:c,className:(0,d.cn)(D,t),"data-hook":a,"data-slot":"item-button","data-tracking-el":r,"data-tracking-label":i,type:e,onClickCapture:m=>q(m,o),...l}));M.displayName="ListItemButton";var A=s.forwardRef(({className:t,asChild:e=!1,dataHook:a,trackingEl:r,trackingLabel:i,onClickCapture:o,...l},c)=>(0,n.jsx)(e?h.Slot:"a",{ref:c,className:(0,d.cn)(D,t),"data-hook":a,"data-slot":"item-link","data-tracking-el":r,"data-tracking-label":i,onClickCapture:m=>q(m,o),...l}));A.displayName="ListItemLink";var O=s.forwardRef(({className:t,...e},a)=>(0,n.jsx)("span",{ref:a,className:(0,d.cn)("text-muted-foreground text-body-sm max-w-1/2 min-w-0 shrink truncate text-right",t),"data-slot":"item-value",...e}));O.displayName="ListItemValue";var B=s.forwardRef(({className:t,...e},a)=>(0,n.jsx)(J.ChevronRight,{ref:a,"aria-hidden":!0,className:(0,d.cn)("text-muted-foreground shrink-0",t),"data-slot":"item-chevron",...e}));B.displayName="ListItemChevron";var F=s.forwardRef(({className:t,...e},a)=>(0,n.jsx)("li",{ref:a,"aria-hidden":!0,className:(0,d.cn)("bg-border h-px w-full shrink-0",t),"data-slot":"item-separator",...e}));F.displayName="ListSeparator";var Z=x,tt=k,et=w,at=_,st=y,it=S,rt=j,ot=I;exports.Item=Z;exports.ItemActions=it;exports.ItemContent=et;exports.ItemDescription=st;exports.ItemMedia=tt;exports.ItemSubheader=rt;exports.ItemTitle=at;exports.List=V;exports.ListItem=x;exports.ListItemActions=S;exports.ListItemButton=M;exports.ListItemChevron=B;exports.ListItemContent=w;exports.ListItemDescription=y;exports.ListItemLink=A;exports.ListItemMedia=k;exports.ListItemTitle=_;exports.ListItemValue=O;exports.ListSeparator=F;exports.ListSubheader=j;exports.itemVariants=ot;exports.listItemMediaVariants=E;exports.listItemVariants=I;exports.listVariants=T;
1
+ "use client";const G=require("./_virtual/_rolldown/runtime.cjs");let i=require("react");i=G.__toESM(i,1);let J=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils"),n=require("react/jsx-runtime"),h=require("@radix-ui/react-slot"),L=require("class-variance-authority"),g=require("@brightlocal/ui-components/tooltip"),Q=require("@brightlocal/ui-components/skeleton");var x=(0,L.cva)(["group/item","flex","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-fast","ease-out","has-[>[data-slot=item-button]]:p-0","has-[>[data-slot=item-link]]:p-0"],{variants:{variant:{default:[],filled:["bg-muted"],outline:["bg-background","border","border-border"],loading:["p-0"]},align:{center:["items-center"],start:["items-start"]}},defaultVariants:{variant:"filled",align:"center"}}),T=(0,L.cva)(["flex","flex-col"],{variants:{inset:{true:["-mr-2","-ml-4"],false:[]},divided:{true:["gap-0","[&>[data-slot=item]]:rounded-none","[&>[data-slot=item]+[data-slot=item]]:border-t","[&>[data-slot=item]+[data-slot=item]]:border-border"],false:["gap-2"]},bordered:{true:["gap-0","overflow-hidden","rounded-lg","border","border-border","[&>[data-slot=item]]:rounded-none","[&>[data-slot=item]]:border-0","[&>[data-slot=item]:not(:has(>[data-slot=item-button])):not(:has(>[data-slot=item-link]))]:px-4","[&>[data-slot=item]:not(:has(>[data-slot=item-button])):not(:has(>[data-slot=item-link]))]:py-3","[&>[data-slot=item]>[data-slot=item-button]]:px-4","[&>[data-slot=item]>[data-slot=item-button]]:py-3","[&>[data-slot=item]>[data-slot=item-link]]:px-4","[&>[data-slot=item]>[data-slot=item-link]]:py-3"],false:[]}},defaultVariants:{inset:!1,divided:!1,bordered:!1}}),V=i.forwardRef(({className:t,dataHook:e,trackingEl:a,trackingLabel:r,inset:s,divided:o,bordered:l,...m},u)=>(0,n.jsx)("ul",{ref:u,className:(0,d.cn)(T({inset:s,divided:o,bordered:l}),t),"data-bordered":l?"":void 0,"data-divided":o?"":void 0,"data-hook":e,"data-slot":"list","data-tracking-el":a,"data-tracking-label":r,...m}));V.displayName="List";var I=i.forwardRef(({asChild:t=!1,className:e,variant:a,align:r,dataHook:s,trackingEl:o,trackingLabel:l,children:m,...u},p)=>(0,n.jsx)(t?h.Slot:"li",{ref:p,className:(0,d.cn)(x({variant:a,align:r}),e),"data-align":r??"center","data-hook":s,"data-slot":"item","data-tracking-el":o,"data-tracking-label":l,...u,children:a==="loading"?(0,n.jsx)(Q.Skeleton,{className:"h-13 w-full rounded-lg"}):m}));I.displayName="ListItem";var E=(0,L.cva)(["shrink-0"],{variants:{variant:{default:["group-data-[align=start]/item:mt-1"],icon:["inline-flex","size-10","items-center","justify-center","rounded-lg","border","border-border","bg-background"],image:["size-10","overflow-hidden","rounded-lg","[&_img]:size-full","[&_img]:object-cover"]}},defaultVariants:{variant:"default"}}),k=i.forwardRef(({className:t,variant:e,...a},r)=>(0,n.jsx)("div",{ref:r,className:(0,d.cn)(E({variant:e}),t),"data-slot":"item-media","data-variant":e??"default",...a}));k.displayName="ListItemMedia";var w=i.forwardRef(({className:t,...e},a)=>(0,n.jsx)("div",{ref:a,className:(0,d.cn)("flex min-w-0 flex-1 flex-col gap-1",t),"data-slot":"item-content",...e}));w.displayName="ListItemContent";var U='[data-slot="item-button"], [data-slot="item-link"]';function X(t,e){const[a,r]=i.useState(!1);return i.useEffect(()=>{if(!e||!t)return;const s=()=>r(t.scrollHeight>t.clientHeight+1||t.scrollWidth>t.clientWidth+1),o=new ResizeObserver(s);o.observe(t);const l=new MutationObserver(s);return l.observe(t,{characterData:!0,childList:!0,subtree:!0}),()=>{o.disconnect(),l.disconnect()}},[e,t]),e&&t!==null&&a}function Y(t,e){const[a,r]=i.useState(null),s=e?t?.closest(U)??null:null;return i.useEffect(()=>{if(!s)return;const o=()=>r(s===document.activeElement&&s.matches(":focus-visible")?s:null),l=()=>r(null);return o(),s.addEventListener("focus",o),s.addEventListener("blur",l),()=>{s.removeEventListener("focus",o),s.removeEventListener("blur",l)}},[s]),s!==null&&a===s}var N=i.forwardRef(({asChild:t=!1,truncate:e=!1,partSlot:a,tooltipSide:r,className:s,children:o,...l},m)=>{const[u,p]=i.useState(null),z=i.useCallback(c=>{p(c),typeof m=="function"?m(c):m&&(m.current=c)},[m]),b=X(u,e),f=Y(u,b),[P,H]=i.useState(!1),[W,v]=i.useState(!1),[K,$]=i.useState(f);f!==K&&($(f),f&&v(!1));const C=(0,n.jsx)(t?h.Slot:"div",{ref:z,className:(0,d.cn)(e&&"line-clamp-2",s),"data-slot":a,"data-truncated":b?"":void 0,...l,children:o});return b?(0,n.jsxs)(g.Tooltip,{open:!W&&(P||f),onOpenChange:c=>{c&&v(!1),H(c)},children:[(0,n.jsx)(g.TooltipTrigger,{asChild:!0,onPointerDown:c=>{const R=c.currentTarget;c.pointerType==="touch"&&(R.closest("button, a, label")||R.tagName==="LABEL")&&c.preventDefault()},children:C}),(0,n.jsx)(g.TooltipContent,{dataHook:`list-${a}-tooltip`,side:r,sideOffset:4,onEscapeKeyDown:()=>v(!0),children:o})]}):C});N.displayName="TruncatableText";var y=i.forwardRef(({className:t,...e},a)=>(0,n.jsx)(N,{ref:a,className:(0,d.cn)("text-foreground text-body",t),partSlot:"item-title",tooltipSide:"top",...e}));y.displayName="ListItemTitle";var _=i.forwardRef(({className:t,...e},a)=>(0,n.jsx)(N,{ref:a,className:(0,d.cn)("text-body-sm text-muted-foreground",t),partSlot:"item-description",tooltipSide:"bottom",...e}));_.displayName="ListItemDescription";var S=i.forwardRef(({className:t,...e},a)=>(0,n.jsx)("div",{ref:a,className:(0,d.cn)("text-muted-foreground flex min-h-9 min-w-9 shrink-0 items-center justify-center gap-2",t),"data-slot":"item-actions",...e}));S.displayName="ListItemActions";var j=i.forwardRef(({className:t,dataHook:e,...a},r)=>(0,n.jsx)("li",{ref:r,className:(0,d.cn)("text-muted-foreground text-label-sm flex items-center pt-4 pr-2 pb-1 pl-4 first:pt-2",t),"data-hook":e,"data-slot":"item-subheader",...a}));j.displayName="ListSubheader";var D=["flex","w-full","min-w-0","items-center","group-data-[align=start]/item:items-start","gap-4","rounded-[inherit]","py-2","pr-2","pl-4","text-left","cursor-pointer","outline-none","hover:bg-accent","focus-visible:shadow-default","transition-colors","duration-fast","ease-out","disabled:pointer-events-none","disabled:cursor-not-allowed","disabled:opacity-50","aria-disabled:pointer-events-none","aria-disabled:cursor-not-allowed","aria-disabled:opacity-50"];function q(t,e){const a=t.currentTarget.getAttribute("aria-disabled");if(a==="true"||a===""){t.preventDefault(),t.stopPropagation();return}e?.(t)}var M=i.forwardRef(({className:t,type:e="button",dataHook:a,trackingEl:r,trackingLabel:s,onClickCapture:o,...l},m)=>(0,n.jsx)("button",{ref:m,className:(0,d.cn)(D,t),"data-hook":a,"data-slot":"item-button","data-tracking-el":r,"data-tracking-label":s,type:e,onClickCapture:u=>q(u,o),...l}));M.displayName="ListItemButton";var A=i.forwardRef(({className:t,asChild:e=!1,dataHook:a,trackingEl:r,trackingLabel:s,onClickCapture:o,...l},m)=>(0,n.jsx)(e?h.Slot:"a",{ref:m,className:(0,d.cn)(D,t),"data-hook":a,"data-slot":"item-link","data-tracking-el":r,"data-tracking-label":s,onClickCapture:u=>q(u,o),...l}));A.displayName="ListItemLink";var O=i.forwardRef(({className:t,...e},a)=>(0,n.jsx)("span",{ref:a,className:(0,d.cn)("text-muted-foreground text-body-sm max-w-1/2 min-w-0 shrink truncate text-right",t),"data-slot":"item-value",...e}));O.displayName="ListItemValue";var B=i.forwardRef(({className:t,...e},a)=>(0,n.jsx)(J.ChevronRight,{ref:a,"aria-hidden":!0,className:(0,d.cn)("text-muted-foreground shrink-0",t),"data-slot":"item-chevron",...e}));B.displayName="ListItemChevron";var F=i.forwardRef(({className:t,...e},a)=>(0,n.jsx)("li",{ref:a,"aria-hidden":!0,className:(0,d.cn)("bg-border h-px w-full shrink-0",t),"data-slot":"item-separator",...e}));F.displayName="ListSeparator";var Z=I,tt=k,et=w,at=y,it=_,st=S,rt=j,ot=x;exports.Item=Z;exports.ItemActions=st;exports.ItemContent=et;exports.ItemDescription=it;exports.ItemMedia=tt;exports.ItemSubheader=rt;exports.ItemTitle=at;exports.List=V;exports.ListItem=I;exports.ListItemActions=S;exports.ListItemButton=M;exports.ListItemChevron=B;exports.ListItemContent=w;exports.ListItemDescription=_;exports.ListItemLink=A;exports.ListItemMedia=k;exports.ListItemTitle=y;exports.ListItemValue=O;exports.ListSeparator=F;exports.ListSubheader=j;exports.itemVariants=ot;exports.listItemMediaVariants=E;exports.listItemVariants=x;exports.listVariants=T;
package/dist/list.d.ts CHANGED
@@ -26,6 +26,18 @@ export type ListProps = React.ComponentProps<"ul"> & {
26
26
  * @default false
27
27
  */
28
28
  divided?: boolean;
29
+ /**
30
+ * Wraps the whole group in one rounded border, for a list that sits on its
31
+ * own as a box (e.g. inside a sheet or dialog). The rows inside stay plain:
32
+ * no gap, no row radius and no row border, so `ListItem variant="outline"`
33
+ * renders as a plain row here instead of doubling the border. Rows get
34
+ * balanced padding inside the box, 16px at the sides and 12px top and
35
+ * bottom (on the ListItemButton / ListItemLink for a pressable row). Pair it with
36
+ * `divided` for a 1px line between rows. For separate bordered rows, use
37
+ * `ListItem variant="outline"` on a list without `bordered`.
38
+ * @default false
39
+ */
40
+ bordered?: boolean;
29
41
  /**
30
42
  * Tracking element identifier for analytics.
31
43
  */
@@ -55,6 +67,7 @@ export type ListProps = React.ComponentProps<"ul"> & {
55
67
  declare const listVariants: (props?: ({
56
68
  inset?: boolean | null | undefined;
57
69
  divided?: boolean | null | undefined;
70
+ bordered?: boolean | null | undefined;
58
71
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
59
72
  declare const List: React.ForwardRefExoticComponent<Omit<ListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
60
73
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/components/list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAalD,QAAA,MAAM,gBAAgB;;;8EAmCrB,CAAC;AAMF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG;IACnD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO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