neba 1.11.0 → 1.12.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 (161) hide show
  1. package/README.md +4 -4
  2. package/dist/components/animate-appear/AnimateAppear.d.ts +2 -13
  3. package/dist/components/animate-appear/AnimateAppear.js +1 -1
  4. package/dist/components/animate-blink/AnimateBlink.d.ts +2 -2
  5. package/dist/components/animate-blink/AnimateBlink.js +1 -1
  6. package/dist/components/animate-counter/AnimateCounter.d.ts +45 -0
  7. package/dist/components/animate-counter/AnimateCounter.js +1 -0
  8. package/dist/components/animate-counter/index.d.ts +1 -0
  9. package/dist/components/animate-counter/index.js +1 -0
  10. package/dist/components/animate-fade/AnimateFade.d.ts +2 -2
  11. package/dist/components/animate-fade/AnimateFade.js +1 -1
  12. package/dist/components/animate-float/AnimateFloat.d.ts +35 -0
  13. package/dist/components/animate-float/AnimateFloat.js +1 -0
  14. package/dist/components/animate-float/index.d.ts +1 -0
  15. package/dist/components/animate-float/index.js +1 -0
  16. package/dist/components/animate-grow/AnimateGrow.d.ts +2 -2
  17. package/dist/components/animate-grow/AnimateGrow.js +1 -1
  18. package/dist/components/animate-reveal/AnimateReveal.d.ts +41 -0
  19. package/dist/components/animate-reveal/AnimateReveal.js +1 -0
  20. package/dist/components/animate-reveal/index.d.ts +1 -0
  21. package/dist/components/animate-reveal/index.js +1 -0
  22. package/dist/components/animate-rotate/AnimateRotate.d.ts +2 -2
  23. package/dist/components/animate-rotate/AnimateRotate.js +1 -1
  24. package/dist/components/animate-scramble/AnimateScramble.d.ts +48 -0
  25. package/dist/components/animate-scramble/AnimateScramble.js +1 -0
  26. package/dist/components/animate-scramble/index.d.ts +1 -0
  27. package/dist/components/animate-scramble/index.js +1 -0
  28. package/dist/components/animate-shake/AnimateShake.d.ts +39 -0
  29. package/dist/components/animate-shake/AnimateShake.js +1 -0
  30. package/dist/components/animate-shake/index.d.ts +1 -0
  31. package/dist/components/animate-shake/index.js +1 -0
  32. package/dist/components/animate-slide/AnimateSlide.d.ts +2 -2
  33. package/dist/components/animate-slide/AnimateSlide.js +1 -1
  34. package/dist/components/animate-split/AnimateSplit.d.ts +61 -0
  35. package/dist/components/animate-split/AnimateSplit.js +1 -0
  36. package/dist/components/animate-split/index.d.ts +1 -0
  37. package/dist/components/animate-split/index.js +1 -0
  38. package/dist/components/animate-typing/AnimateTyping.js +1 -1
  39. package/dist/components/animate-zoom/AnimateZoom.d.ts +2 -2
  40. package/dist/components/animate-zoom/AnimateZoom.js +1 -1
  41. package/dist/components/avatar/Avatar.js +1 -1
  42. package/dist/components/bar-chart/BarChart.js +1 -1
  43. package/dist/components/checkbox/Checkbox.js +1 -1
  44. package/dist/components/combobox/Combobox.js +1 -1
  45. package/dist/components/command-palette/CommandPalette.js +1 -1
  46. package/dist/components/container/Container.d.ts +12 -4
  47. package/dist/components/container/Container.js +1 -1
  48. package/dist/components/data-table/DataTable.js +1 -1
  49. package/dist/components/dialog/Dialog.js +1 -1
  50. package/dist/components/drawer/Drawer.js +1 -1
  51. package/dist/components/flex/Flex.d.ts +93 -0
  52. package/dist/components/flex/Flex.js +1 -0
  53. package/dist/components/flex/index.d.ts +2 -0
  54. package/dist/components/flex/index.js +1 -0
  55. package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
  56. package/dist/components/footer/Footer.d.ts +4 -3
  57. package/dist/components/footer/Footer.js +1 -1
  58. package/dist/components/gallery/Gallery.d.ts +150 -0
  59. package/dist/components/gallery/Gallery.js +1 -0
  60. package/dist/components/gallery/GalleryViewer.d.ts +30 -0
  61. package/dist/components/gallery/GalleryViewer.js +1 -0
  62. package/dist/components/gallery/index.d.ts +2 -0
  63. package/dist/components/gallery/index.js +1 -0
  64. package/dist/components/gauge-chart/GaugeChart.js +1 -1
  65. package/dist/components/grid/Grid.js +1 -1
  66. package/dist/components/grid-container/GridContainer.js +1 -1
  67. package/dist/components/header/Header.d.ts +5 -4
  68. package/dist/components/header/Header.js +1 -1
  69. package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
  70. package/dist/components/hover-card/HoverCard.js +1 -1
  71. package/dist/components/how-to-steps/HowToSteps.js +1 -1
  72. package/dist/components/image/Image.d.ts +123 -3
  73. package/dist/components/image/Image.js +1 -1
  74. package/dist/components/image/index.d.ts +1 -1
  75. package/dist/components/menu/Menu.js +1 -1
  76. package/dist/components/navigation-menu/NavigationMenu.js +1 -1
  77. package/dist/components/overlay/Overlay.js +1 -1
  78. package/dist/components/pie-chart/PieChart.js +1 -1
  79. package/dist/components/popover/Popover.js +1 -1
  80. package/dist/components/radio-group/RadioGroup.js +1 -1
  81. package/dist/components/rating/Rating.js +1 -1
  82. package/dist/components/scatter-chart/ScatterChart.js +1 -1
  83. package/dist/components/scroll-zone/ScrollZone.d.ts +9 -4
  84. package/dist/components/scroll-zone/ScrollZone.js +1 -1
  85. package/dist/components/select/Select.js +1 -1
  86. package/dist/components/show/Show.d.ts +60 -0
  87. package/dist/components/show/Show.js +1 -0
  88. package/dist/components/show/index.d.ts +2 -0
  89. package/dist/components/show/index.js +1 -0
  90. package/dist/components/sidebar/Sidebar.js +1 -1
  91. package/dist/components/spoiler/Spoiler.js +1 -1
  92. package/dist/components/stack/Stack.d.ts +126 -0
  93. package/dist/components/stack/Stack.js +1 -0
  94. package/dist/components/stack/index.d.ts +1 -0
  95. package/dist/components/stack/index.js +1 -0
  96. package/dist/components/statistic/Statistic.d.ts +8 -3
  97. package/dist/components/tabs/Tabs.d.ts +28 -0
  98. package/dist/components/tabs/Tabs.js +1 -1
  99. package/dist/components/timeline-chart/TimelineChart.js +1 -1
  100. package/dist/components/toast/Toast.js +1 -1
  101. package/dist/components/toggle/Toggle.js +1 -1
  102. package/dist/components/tooltip/Tooltip.js +1 -1
  103. package/dist/components/tour/Tour.js +1 -1
  104. package/dist/components/transfer/Transfer.js +1 -1
  105. package/dist/components/tree-view/TreeView.js +1 -1
  106. package/dist/hooks/index.d.ts +1 -1
  107. package/dist/hooks/index.js +1 -1
  108. package/dist/hooks/useMediaQuery.d.ts +35 -1
  109. package/dist/hooks/useMediaQuery.js +1 -1
  110. package/dist/index.d.ts +10 -1
  111. package/dist/index.js +1 -1
  112. package/dist/internal/animate.d.ts +65 -2
  113. package/dist/internal/animate.js +1 -1
  114. package/dist/internal/chart-frame.d.ts +32 -0
  115. package/dist/internal/chart-frame.js +1 -1
  116. package/dist/internal/chart-line.js +1 -1
  117. package/dist/internal/chart.d.ts +16 -0
  118. package/dist/internal/chart.js +1 -1
  119. package/dist/internal/grid.d.ts +13 -27
  120. package/dist/internal/grid.js +1 -1
  121. package/dist/internal/i18n.d.ts +20 -0
  122. package/dist/internal/i18n.js +1 -1
  123. package/dist/internal/media.d.ts +9 -2
  124. package/dist/internal/media.js +1 -1
  125. package/dist/internal/page-layout.d.ts +11 -9
  126. package/dist/internal/page-layout.js +1 -1
  127. package/dist/internal/picker.js +1 -1
  128. package/dist/internal/responsive.d.ts +97 -0
  129. package/dist/internal/responsive.js +1 -0
  130. package/dist/internal/styles.d.ts +68 -0
  131. package/dist/internal/styles.js +1 -1
  132. package/dist/internal/text.d.ts +42 -0
  133. package/dist/internal/text.js +1 -0
  134. package/dist/locales/ar.js +1 -1
  135. package/dist/locales/de.js +1 -1
  136. package/dist/locales/es.js +1 -1
  137. package/dist/locales/fr.js +1 -1
  138. package/dist/locales/hi.js +1 -1
  139. package/dist/locales/id.js +1 -1
  140. package/dist/locales/it.js +1 -1
  141. package/dist/locales/ja.js +1 -1
  142. package/dist/locales/ko.js +1 -1
  143. package/dist/locales/nl.js +1 -1
  144. package/dist/locales/pl.js +1 -1
  145. package/dist/locales/pt.js +1 -1
  146. package/dist/locales/ru.js +1 -1
  147. package/dist/locales/th.js +1 -1
  148. package/dist/locales/tr.js +1 -1
  149. package/dist/locales/vi.js +1 -1
  150. package/dist/locales/zh-hans.js +1 -1
  151. package/dist/locales/zh-hant.js +1 -1
  152. package/dist/styles.css +1 -1
  153. package/dist/tailwind.css +280 -24
  154. package/dist/types.d.ts +119 -6
  155. package/package.json +18 -17
  156. package/dist/components/avatar-group/AvatarGroup.d.ts +0 -47
  157. package/dist/components/avatar-group/AvatarGroup.js +0 -1
  158. package/dist/components/avatar-group/index.d.ts +0 -2
  159. package/dist/components/avatar-group/index.js +0 -1
  160. package/dist/internal/avatar-group.d.ts +0 -22
  161. package/dist/internal/avatar-group.js +0 -1
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a,Fragment as l}from"react/jsx-runtime";import*as o from"react";import{AspectRatio as t}from"../aspect-ratio/AspectRatio.js";import{Dialog as s}from"../dialog/Dialog.js";import{Skeleton as n}from"../skeleton/Skeleton.js";import{cx as i,radiusClasses as c,transitionClasses as r}from"../../internal/styles.js";const m={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none"};export const Image=/*@__PURE__*/o.forwardRef(function({alt:d,ratio:f="auto",fit:u="cover",rounded:p=!1,placeholder:b,fallback:g,onLoadingStatusChange:h,preview:x=!1,className:v,classNames:j,style:N,src:k,...y},w){const[z,S]=o.useState("loading"),[C,E]=o.useState(!1);o.useEffect(()=>{S("loading")},[k]);const I=e=>{S(e),h?.(e)},L=!1===p?"":c[!0===p?"md":p],R=e("img",{ref:w,src:k,alt:d,className:i("block size-full",m[u],L,r,"loaded"===z?"opacity-100":"opacity-0",j?.image),onLoad:()=>I("loaded"),onError:()=>I("failed"),...y}),_="failed"===z?e("span",{className:i("absolute inset-0 flex items-center justify-center","bg-(--neba-disabled-bg) text-(--neba-muted-fg)",L,j?.fallback),children:g??e("span",{className:"px-2 text-center text-sm",children:d||"Image unavailable"})}):"loading"===z&&!1!==b?e("span",{className:i("absolute inset-0",j?.placeholder),children:b??e(n,{shape:"rect",className:i("size-full",L)})}):null,A=a("span",{className:"relative block size-full",children:[R,_]}),D="auto"===f?e("span",{className:i("relative block overflow-hidden",L,v),style:N,children:A}):e(t,{ratio:f,className:i("overflow-hidden",L,v),style:N,children:A});return x?a(l,{children:[e("button",{type:"button","aria-label":d,className:i("block w-full cursor-zoom-in [outline:none]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:2px]",L),onClick:()=>E(!0),children:D}),e(s,{open:C,onOpenChange:E,size:"xl",title:d,children:e("img",{src:k,alt:d,className:"mx-auto block max-h-[70vh] w-auto max-w-full"})})]}):D});
1
+ "use client";import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as n from"react";import{AspectRatio as o}from"../aspect-ratio/AspectRatio.js";import{Skeleton as r}from"../skeleton/Skeleton.js";import{cx as l,metaTextValues as s,radiusClasses as i,toLength as c}from"../../internal/styles.js";const u={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none"},d={none:"none",grayscale:"grayscale(1)",sepia:"sepia(0.72)",invert:"invert(1)",saturate:"saturate(1.5)",mute:"saturate(0.45)",contrast:"contrast(1.25)"},f={"top-start":"items-start justify-start","top-end":"items-start justify-end","bottom-start":"items-end justify-start","bottom-end":"items-end justify-end",center:"items-center justify-center"},m=n.lazy(()=>import("../dialog/Dialog.js").then(e=>({default:e.Dialog})));function p(e,t){switch(e){case"rect":return{borderRadius:"0px"};case"circle":return{borderRadius:"50%"};case"arch":return{borderRadius:`50% 50% ${t} ${t} / 55% 55% ${t} ${t}`};case"cut":return{clipPath:`polygon(${t} 0, calc(100% - ${t}) 0, 100% ${t}, 100% calc(100% - ${t}), calc(100% - ${t}) 100%, ${t} 100%, 0 calc(100% - ${t}), 0 ${t})`};default:return{borderRadius:t}}}function g(e){const t=t=>`linear-gradient(to ${t}, transparent, #000 ${e}, #000 calc(100% - ${e}), transparent)`,a=`${t("right")}, ${t("bottom")}`;return{maskImage:a,maskComposite:"intersect",WebkitMaskImage:a,WebkitMaskComposite:"source-in"}}export const Image=/*@__PURE__*/n.forwardRef(function({alt:b,ratio:h="auto",fit:v="cover",rounded:x=!1,placeholder:y,fallback:$,onLoadingStatusChange:k,preview:w=!1,filter:N="none",frame:j,watermark:S,protect:C=!1,className:z,classNames:M,style:R,src:D,...I},_){const[W,E]=n.useState("loading"),[L,A]=n.useState(!1),F=n.useRef(null),H=n.useRef(k);H.current=k;const O=n.useCallback(e=>{F.current=e,"function"==typeof _?_(e):_&&(_.current=e)},[_]);n.useEffect(()=>{const e=F.current,t=D&&e?.complete?e.naturalWidth>0?"loaded":"failed":null;E(t??"loading"),t&&H.current?.(t)},[D]);const P=e=>{E(e),k?.(e)},T=!1===x?"":i[!0===x?"md":x],U=N in d?d[N]:N,q=!0===C?{}:!1===C?null:C,B=null!==q&&!1!==q.contextMenu,G=null!==q&&!1!==q.drag,J=null!==q&&!1!==q.select,K=e=>e.preventDefault(),Q=q?{onContextMenu:B?K:void 0,onDragStart:G?K:void 0,draggable:!G&&void 0,className:J?"select-none":"",style:J?{WebkitTouchCallout:"none"}:void 0}:null,V=e("img",{ref:O,src:D,alt:b,className:l("block size-full",u[v],T,"[transition:opacity_var(--neba-duration-fill)_var(--neba-ease),filter_var(--neba-duration-fill)_var(--neba-ease)]","loaded"===W?"opacity-100":"opacity-0",Q?.className,M?.image),style:{filter:"none"===U?void 0:U,...Q?.style},onLoad:()=>P("loaded"),onError:()=>P("failed"),onContextMenu:Q?.onContextMenu,onDragStart:Q?.onDragStart,draggable:Q?.draggable,...I}),X="failed"===W?e("span",{className:l("absolute inset-0 flex items-center justify-center","bg-(--neba-disabled-bg) text-(--neba-muted-fg)",T,M?.fallback),children:$??e("span",{className:"px-2 text-center text-sm",children:b||"Image unavailable"})}):"loading"===W&&!1!==y?e("span",{className:l("absolute inset-0",M?.placeholder),children:y??e(r,{shape:"rect",className:l("size-full",T)})}):null,Y=void 0===S?null:function(t,a){const n="string"==typeof t?{content:t}:t,{content:o,position:r="bottom-end",repeat:i=!1,opacity:u=.35,size:d="xs",color:m="#ffffff"}=n,p="string"==typeof d&&d in s?s[d]:c(d)??s.xs,g=n.rotate??(i&&"string"==typeof o?-24:0);if(i&&"string"==typeof o){const t=function(e,t){let a=0;for(const t of e)a+=/[ᄀ-ᇿ⺀-꓏가-퟿豈-﫿︰-﹏]/.test(t)?1:.6;const n=Math.max(16,Math.round(16*(a+2.4))),o=e.replace(/[&<>]/g,e=>"&"===e?"&amp;":"<"===e?"&lt;":"&gt;");return{uri:`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="${n}" height="52"><text x="0" y="32" font-family="system-ui, sans-serif" font-size="16" fill="${t}" stroke="rgba(0,0,0,0.28)" stroke-width="0.6" paint-order="stroke">${o}</text></svg>`)}`,width:n,height:52}}(o,m);return e("span",{"aria-hidden":"true",className:l("pointer-events-none absolute select-none",a),style:{inset:"-40%",opacity:u,transform:`rotate(${g}deg)`,backgroundImage:`url("${t.uri}")`,backgroundSize:`calc(${p} * ${t.width/16}) calc(${p} * ${t.height/16})`}})}return e("span",{"aria-hidden":"true",className:l("pointer-events-none absolute inset-0 flex select-none p-2",f[r],a),children:e("span",{style:{color:m,opacity:u,fontSize:p,lineHeight:1.2,textShadow:"0 1px 2px rgba(0, 0, 0, 0.45)",transform:g?`rotate(${g}deg)`:void 0},children:o})})}(S,M?.watermark),Z=t("span",{className:"relative block size-full",children:[V,X,Y]}),ee=void 0===j?null:function(e,t){const a=!0===t?"md":t;return{shape:"rounded",corner:!1===a?"md":a,..."string"==typeof e?{shape:e}:e}}(j,x),te=null===ee?"0px":function(e){return"string"==typeof e&&e in i?`var(--neba-radius-${e})`:c(e)??"0px"}(ee.corner??"md"),ae=null===ee?void 0:c(ee.mat),ne=null===ee?void 0:c(ee.feather),oe={...null===ee?null:p(ee.shape,te),...void 0===ne?null:g(ne),...null===ee?R:null},re="auto"===h?e("span",{className:l("relative block overflow-hidden",null===ee?T:"",null===ee?z:""),style:oe,children:Z}):e(o,{ratio:h,className:l("overflow-hidden",null===ee?T:"",null===ee?z:""),style:oe,children:Z}),le=null===ee?void 0:function(e){if(void 0===e.border||!1===e.border)return;const t=!0===e.border?"1px":c(e.border);return`inset 0 0 0 ${t} ${e.borderColor??"var(--neba-line)"}`}(ee),se=void 0===ae?te:`calc(${te} + ${ae})`,ie=null===ee?re:t("span",{className:l("relative block",M?.frame,z),style:{...p(ee.shape,se),padding:ae,background:ee.background??(void 0===ae?void 0:"var(--neba-surface)"),boxShadow:ee.elevation?`var(--neba-shadow-${ee.elevation})`:void 0,...R},children:[re,void 0===le?null:e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",style:{...p(ee.shape,se),boxShadow:le}})]});return w?t(a,{children:[e("button",{type:"button","aria-label":b,className:l("block w-full cursor-zoom-in [outline:none]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:2px]",T),onClick:()=>A(!0),children:ie}),e(n.Suspense,{fallback:null,children:e(m,{open:L,onOpenChange:A,size:"xl",title:b,children:t("span",{className:"relative mx-auto block w-fit",children:[e("img",{src:D,alt:b,className:l("mx-auto block max-h-[70vh] w-auto max-w-full",Q?.className),style:{filter:"none"===U?void 0:U,...Q?.style},onContextMenu:Q?.onContextMenu,onDragStart:Q?.onDragStart,draggable:Q?.draggable}),Y]})})})]}):ie});
@@ -1,2 +1,2 @@
1
1
  export { Image } from './Image.js';
2
- export type { ImageProps, ImageSlot } from './Image.js';
2
+ export type { ImageProps, ImageSlot, NebaImageFilter, NebaImageFrame, NebaImageFrameOptions, NebaImageFrameShape, NebaImageProtection, NebaImageWatermark, NebaImageWatermarkOptions } from './Image.js';
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import*as a from"react";import{Menu as l}from"@base-ui/react/menu";import{ContextMenu as s}from"@base-ui/react/context-menu";import{MenuContext as i}from"../../internal/menu.js";import{CheckIcon as o,ChevronIcon as r,DotIcon as c}from"../../internal/icons.js";import{safeRel as d}from"../../internal/link.js";import{controlTextLeadingClasses as u,cx as m,gapClasses as p,hasContent as h,iconClasses as x,metaTextClasses as f,radiusClasses as b,surfaceClasses as g,surfaceSlots as y,transitionClasses as N}from"../../internal/styles.js";const C=[g,"max-h-[min(24rem,var(--available-height))] min-w-40 overflow-y-auto overscroll-contain","border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),v={default:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2",xl:"px-3.5 py-2.5"},compact:{xs:"px-1 py-0.5",sm:"px-1.5 py-0.5",md:"px-2 py-1",lg:"px-2.5 py-1",xl:"px-3 py-1.5"}},k={xs:b.xs,sm:b.xs,md:b.sm,lg:b.sm,xl:b.md};function O(e,n,t,a){return m("relative flex w-full cursor-pointer items-center select-none",t?"text-(--n-accent)":"text-(--neba-fg)",v[n][e],k[e],p[e],u[e],N,x,"data-[highlighted]:bg-(--n-soft-hover)","data-[popup-open]:bg-(--n-soft)","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]",a??"")}const z="flex h-[1lh] w-[1.2em] shrink-0 items-center justify-center";function I({children:t,description:a,size:l}){return h(a)?n("span",{className:"flex min-w-0 flex-1 flex-col text-start",children:[e("span",{className:"truncate",children:t}),e("span",{className:`truncate text-(--neba-muted-fg) ${f[l]}`,children:a})]}):e("span",{className:"min-w-0 flex-1 truncate text-start",children:t})}export function MenuItem({onClick:s,href:o,target:r,rel:c,startIcon:u,endIcon:m,shortcut:p,description:x,color:b,closeOnClick:g=!0,disabled:N=!1,label:C,children:v,className:k,style:M}){const j=a.useContext(i),{size:$,density:w}=j,P=n(t,{children:[h(u)?e("span",{className:`${z} text-(--neba-muted-fg)`,children:u}):null,e(I,{description:x,size:$,children:v}),h(m)?e("span",{className:`${z} text-(--neba-muted-fg)`,children:m}):null,h(p)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${f[$]}`,children:p}):null]}),R=b?y(b,0):void 0,F=R||M?{...R,...M}:void 0;return void 0!==o?e(l.LinkItem,{href:o,target:r,rel:d(r,c),label:C,closeOnClick:g,onClick:s,className:O($,w,Boolean(b),k),style:F,children:P}):e(l.Item,{disabled:N,label:C,closeOnClick:g,onClick:s,className:O($,w,Boolean(b),k),style:F,children:P})}export function MenuCheckboxItem({checked:t,defaultChecked:s,onCheckedChange:r,endIcon:c,shortcut:d,description:u,color:m,closeOnClick:p=!1,disabled:x=!1,label:b,children:g,className:N,style:C}){const{size:v,density:k}=a.useContext(i),M=m?y(m,0):void 0;return n(l.CheckboxItem,{checked:t,defaultChecked:s,onCheckedChange:e=>r?.(e),disabled:x,label:b,closeOnClick:p,className:O(v,k,Boolean(m),N),style:M||C?{...M,...C}:void 0,children:[e("span",{className:`${z} text-(--n-accent)`,children:e(l.CheckboxItemIndicator,{className:"flex items-center justify-center",children:e(o,{})})}),e(I,{description:u,size:v,children:g}),h(c)?e("span",{className:`${z} text-(--neba-muted-fg)`,children:c}):null,h(d)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${f[v]}`,children:d}):null]})}export function MenuRadioGroup({value:n,defaultValue:t,onValueChange:a,disabled:s=!1,children:i,className:o}){return e(l.RadioGroup,{value:n,defaultValue:t,onValueChange:e=>a?.(e),disabled:s,className:o,children:i})}export function MenuRadioItem({value:t,endIcon:s,shortcut:o,description:r,color:d,closeOnClick:u=!1,disabled:m=!1,label:p,children:x,className:b,style:g}){const{size:N,density:C}=a.useContext(i),v=d?y(d,0):void 0;return n(l.RadioItem,{value:t,disabled:m,label:p,closeOnClick:u,className:O(N,C,Boolean(d),b),style:v||g?{...v,...g}:void 0,children:[e("span",{className:`${z} text-(--n-accent)`,children:e(l.RadioItemIndicator,{className:"flex items-center justify-center",children:e(c,{})})}),e(I,{description:r,size:N,children:x}),h(s)?e("span",{className:`${z} text-(--neba-muted-fg)`,children:s}):null,h(o)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${f[N]}`,children:o}):null]})}export function MenuGroup({label:t,children:s,className:o}){const{size:r,density:c}=a.useContext(i);return n(l.Group,{className:o,children:[h(t)?e(l.GroupLabel,{className:[v[c][r],f[r],"font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),children:t}):null,s]})}export function MenuSeparator({className:n,...t}){return e(l.Separator,{className:m("-mx-1 my-1 h-px bg-(--n-line)",n??""),...t})}export function MenuSubmenu({label:t,startIcon:s,disabled:o=!1,side:c="right",sideOffset:d=4,children:p,className:x,style:f}){const g=a.useContext(i),{size:N,density:v,color:k}=g;return n(l.SubmenuRoot,{children:[n(l.SubmenuTrigger,{disabled:o,className:O(N,v,!1),children:[h(s)?e("span",{className:`${z} text-(--neba-muted-fg)`,children:s}):null,e("span",{className:"min-w-0 flex-1 truncate text-start",children:t}),e("span",{className:`${z} text-(--neba-muted-fg) -rotate-90`,children:e(r,{})})]}),e(l.Portal,{children:e(l.Positioner,{className:"neba-portal z-50 [outline:none]",side:c,sideOffset:d,align:"start",children:e(l.Popup,{className:m(C,b[N],u[N],x??""),style:{...y(k,3),...f},children:p})})})]})}export function Menu({size:t="md",color:s="primary",density:o="default",trigger:r,open:c,defaultOpen:d,onOpenChange:p,side:h="bottom",align:x="start",sideOffset:f=6,modal:g,openOnHover:N=!1,loopFocus:v=!0,disabled:k=!1,className:O,style:z,children:I}){const M=a.useMemo(()=>({size:t,color:s,density:o}),[t,s,o]);return e(i.Provider,{value:M,children:n(l.Root,{open:c,defaultOpen:d,onOpenChange:e=>p?.(e),modal:g,loopFocus:v,disabled:k,children:[r?e(l.Trigger,{render:r,openOnHover:N,disabled:k}):null,e(l.Portal,{children:e(l.Positioner,{className:"neba-portal z-50 [outline:none]",side:h,align:x,sideOffset:f,children:e(l.Popup,{className:m(C,b[t],u[t],O??""),style:{...y(s,3),...z},children:I})})})]})})}export function ContextMenu({size:t="md",color:l="primary",density:o="default",content:r,children:c,open:d,defaultOpen:p,onOpenChange:h,loopFocus:x=!0,disabled:f=!1,className:g,style:N}){const v=a.useMemo(()=>({size:t,color:l,density:o}),[t,l,o]);return e(i.Provider,{value:v,children:n(s.Root,{open:d,defaultOpen:p,onOpenChange:e=>h?.(e),loopFocus:x,disabled:f,children:[e(s.Trigger,{children:c}),e(s.Portal,{children:e(s.Positioner,{className:"neba-portal z-50 [outline:none]",children:e(s.Popup,{className:m(C,b[t],u[t],g??""),style:{...y(l,3),...N},children:r})})})]})})}
1
+ "use client";import{jsx as e,jsxs as n,Fragment as l}from"react/jsx-runtime";import*as t from"react";import{Menu as s}from"@base-ui/react/menu";import{ContextMenu as a}from"@base-ui/react/context-menu";import{MenuContext as o}from"../../internal/menu.js";import{CheckIcon as r,ChevronIcon as i,DotIcon as c}from"../../internal/icons.js";import{safeRel as d}from"../../internal/link.js";import{controlTextLeadingClasses as u,cx as m,gapClasses as p,hasContent as h,iconClasses as x,metaTextClasses as f,popupFadeClasses as b,radiusClasses as g,surfaceClasses as N,surfaceSlots as y,transitionClasses as C}from"../../internal/styles.js";const k=[N,"max-h-[min(24rem,var(--available-height))] min-w-40 overflow-y-auto overscroll-contain","border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",b].join(" "),v={default:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2",xl:"px-3.5 py-2.5"},compact:{xs:"px-1 py-0.5",sm:"px-1.5 py-0.5",md:"px-2 py-1",lg:"px-2.5 py-1",xl:"px-3 py-1.5"}},O={xs:g.xs,sm:g.xs,md:g.sm,lg:g.sm,xl:g.md};function z(e,n,l,t){return m("relative flex w-full cursor-pointer items-center select-none",l?"text-(--n-accent)":"text-(--neba-fg)",v[n][e],O[e],p[e],u[e],C,x,"data-[highlighted]:bg-(--n-soft-hover)","data-[popup-open]:bg-(--n-soft)","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]",t??"")}const I="flex h-[1lh] w-[1.2em] shrink-0 items-center justify-center";function M({children:l,description:t,size:s}){return h(t)?n("span",{className:"flex min-w-0 flex-1 flex-col text-start",children:[e("span",{className:"truncate",children:l}),e("span",{className:`truncate text-(--neba-muted-fg) ${f[s]}`,children:t})]}):e("span",{className:"min-w-0 flex-1 truncate text-start",children:l})}export function MenuItem({onClick:a,href:r,target:i,rel:c,startIcon:u,endIcon:m,shortcut:p,description:x,color:b,closeOnClick:g=!0,disabled:N=!1,label:C,children:k,className:v,style:O}){const j=t.useContext(o),{size:$,density:w}=j,P=n(l,{children:[h(u)?e("span",{className:`${I} text-(--neba-muted-fg)`,children:u}):null,e(M,{description:x,size:$,children:k}),h(m)?e("span",{className:`${I} text-(--neba-muted-fg)`,children:m}):null,h(p)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${f[$]}`,children:p}):null]}),R=b?y(b,0):void 0,F=R||O?{...R,...O}:void 0;return void 0!==r?e(s.LinkItem,{href:r,target:i,rel:d(i,c),label:C,closeOnClick:g,onClick:a,className:z($,w,Boolean(b),v),style:F,children:P}):e(s.Item,{disabled:N,label:C,closeOnClick:g,onClick:a,className:z($,w,Boolean(b),v),style:F,children:P})}export function MenuCheckboxItem({checked:l,defaultChecked:a,onCheckedChange:i,endIcon:c,shortcut:d,description:u,color:m,closeOnClick:p=!1,disabled:x=!1,label:b,children:g,className:N,style:C}){const{size:k,density:v}=t.useContext(o),O=m?y(m,0):void 0;return n(s.CheckboxItem,{checked:l,defaultChecked:a,onCheckedChange:e=>i?.(e),disabled:x,label:b,closeOnClick:p,className:z(k,v,Boolean(m),N),style:O||C?{...O,...C}:void 0,children:[e("span",{className:`${I} text-(--n-accent)`,children:e(s.CheckboxItemIndicator,{className:"flex items-center justify-center",children:e(r,{})})}),e(M,{description:u,size:k,children:g}),h(c)?e("span",{className:`${I} text-(--neba-muted-fg)`,children:c}):null,h(d)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${f[k]}`,children:d}):null]})}export function MenuRadioGroup({value:n,defaultValue:l,onValueChange:t,disabled:a=!1,children:o,className:r}){return e(s.RadioGroup,{value:n,defaultValue:l,onValueChange:e=>t?.(e),disabled:a,className:r,children:o})}export function MenuRadioItem({value:l,endIcon:a,shortcut:r,description:i,color:d,closeOnClick:u=!1,disabled:m=!1,label:p,children:x,className:b,style:g}){const{size:N,density:C}=t.useContext(o),k=d?y(d,0):void 0;return n(s.RadioItem,{value:l,disabled:m,label:p,closeOnClick:u,className:z(N,C,Boolean(d),b),style:k||g?{...k,...g}:void 0,children:[e("span",{className:`${I} text-(--n-accent)`,children:e(s.RadioItemIndicator,{className:"flex items-center justify-center",children:e(c,{})})}),e(M,{description:i,size:N,children:x}),h(a)?e("span",{className:`${I} text-(--neba-muted-fg)`,children:a}):null,h(r)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${f[N]}`,children:r}):null]})}export function MenuGroup({label:l,children:a,className:r}){const{size:i,density:c}=t.useContext(o);return n(s.Group,{className:r,children:[h(l)?e(s.GroupLabel,{className:[v[c][i],f[i],"font-semibold tracking-wide text-(--neba-muted-fg) uppercase"].join(" "),children:l}):null,a]})}export function MenuSeparator({className:n,...l}){return e(s.Separator,{className:m("-mx-1 my-1 h-px bg-(--n-line)",n??""),...l})}export function MenuSubmenu({label:l,startIcon:a,disabled:r=!1,side:c="right",sideOffset:d=4,children:p,className:x,style:f}){const b=t.useContext(o),{size:N,density:C,color:v}=b;return n(s.SubmenuRoot,{children:[n(s.SubmenuTrigger,{disabled:r,className:z(N,C,!1),children:[h(a)?e("span",{className:`${I} text-(--neba-muted-fg)`,children:a}):null,e("span",{className:"min-w-0 flex-1 truncate text-start",children:l}),e("span",{className:`${I} text-(--neba-muted-fg) -rotate-90`,children:e(i,{})})]}),e(s.Portal,{children:e(s.Positioner,{className:"neba-portal z-50 [outline:none]",side:c,sideOffset:d,align:"start",children:e(s.Popup,{className:m(k,g[N],u[N],x??""),style:{...y(v,3),...f},children:p})})})]})}export function Menu({size:l="md",color:a="primary",density:r="default",trigger:i,open:c,defaultOpen:d,onOpenChange:p,side:h="bottom",align:x="start",sideOffset:f=6,modal:b,openOnHover:N=!1,loopFocus:C=!0,disabled:v=!1,className:O,style:z,children:I}){const M=t.useMemo(()=>({size:l,color:a,density:r}),[l,a,r]);return e(o.Provider,{value:M,children:n(s.Root,{open:c,defaultOpen:d,onOpenChange:e=>p?.(e),modal:b,loopFocus:C,disabled:v,children:[i?e(s.Trigger,{render:i,openOnHover:N,disabled:v}):null,e(s.Portal,{children:e(s.Positioner,{className:"neba-portal z-50 [outline:none]",side:h,align:x,sideOffset:f,children:e(s.Popup,{className:m(k,g[l],u[l],O??""),style:{...y(a,3),...z},children:I})})})]})})}export function ContextMenu({size:l="md",color:s="primary",density:r="default",content:i,children:c,open:d,defaultOpen:p,onOpenChange:h,loopFocus:x=!0,disabled:f=!1,className:b,style:N}){const C=t.useMemo(()=>({size:l,color:s,density:r}),[l,s,r]);return e(o.Provider,{value:C,children:n(a.Root,{open:d,defaultOpen:p,onOpenChange:e=>h?.(e),loopFocus:x,disabled:f,children:[e(a.Trigger,{children:c}),e(a.Portal,{children:e(a.Positioner,{className:"neba-portal z-50 [outline:none]",children:e(a.Popup,{className:m(k,g[l],u[l],b??""),style:{...y(s,3),...N},children:i})})})]})})}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as n,Fragment as a}from"react/jsx-runtime";import*as t from"react";import{NavigationMenu as i}from"@base-ui/react/navigation-menu";import{ChevronIcon as r}from"../../internal/icons.js";import{safeRel as o}from"../../internal/link.js";import{controlHeightClasses as s,controlTextClasses as l,controlTextLeadingClasses as d,cx as c,gapClasses as u,hasContent as f,iconClasses as p,metaTextClasses as m,paddingXClasses as h,radiusClasses as b,surfaceClasses as v,surfaceSlots as g,transitionClasses as x}from"../../internal/styles.js";const y=/*@__PURE__*/t.createContext({size:"md",density:"default"}),N=["inline-flex shrink-0 cursor-pointer select-none items-center justify-center","whitespace-nowrap font-medium leading-none no-underline","text-(--neba-fg) bg-transparent","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",x,p,"hover:bg-(--n-soft)","data-[popup-open]:bg-(--n-soft-hover) data-[popup-open]:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","data-[disabled]:hover:bg-transparent"].join(" "),w=[v,"relative border text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none] overflow-hidden","[transition:opacity_var(--neba-duration)_var(--neba-ease),width_var(--neba-duration)_var(--neba-ease),height_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),j=["flex min-w-0 cursor-pointer items-start no-underline","text-(--neba-fg) bg-transparent",x,p,"hover:bg-(--n-soft)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"].join(" "),_={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"};export const NavigationMenuLink=/*@__PURE__*/t.forwardRef(function({href:a,title:r,description:o,startIcon:s,className:l,children:p,...v},g){const{size:x,density:N}=t.useContext(y);return n(i.Link,{ref:g,href:a,className:c(j,b[x],u[x],h[N??"default"][x],"py-2",l??""),...v,children:[f(s)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:s}):null,n("span",{className:"flex min-w-0 flex-col gap-0.5",children:[e("span",{className:`font-medium ${d[x]}`,children:r}),f(o)?e("span",{className:`text-(--neba-muted-fg) ${m[x]}`,children:o}):null,p]})]})});export function NavigationMenuItem({label:d,href:c,target:p,rel:m,startIcon:v,value:g,disabled:x=!1,columns:w=1,children:j}){const{size:k,density:z}=t.useContext(y),C=void 0!==c&&!f(j),$=[N,s[k],l[k],u[k],h[z??"default"][k],b[k]].join(" ");return e(i.Item,{value:g,children:C?n(i.Link,{href:c,target:p,rel:o(p,m),className:$,children:[f(v)?v:null,d]}):n(a,{children:[n(i.Trigger,{disabled:x,className:$,children:[f(v)?v:null,d,e(i.Icon,{className:"flex items-center [transition:rotate_var(--neba-duration)_var(--neba-ease)] data-[popup-open]:rotate-180",children:e(r,{})})]}),e(i.Content,{className:`grid gap-1 ${_[k]}`,style:w>1?{gridTemplateColumns:`repeat(${w}, minmax(0, 1fr))`}:void 0,children:j})]})})}export const NavigationMenu=/*@__PURE__*/t.forwardRef(function({size:a="md",color:r="primary",density:o="default",orientation:s="horizontal",value:l,defaultValue:d,onValueChange:c,delay:f,closeDelay:p,sideOffset:m=8,className:h,style:v,children:x,...N},j){const _=t.useMemo(()=>({size:a,density:o}),[a,o]);return e(y.Provider,{value:_,children:n(i.Root,{ref:j,orientation:s,value:l,defaultValue:d,onValueChange:e=>c?.(e),delay:f,closeDelay:p,className:h,style:{...g(r,3),"--n-soft-hover":`var(--neba-${r}-soft-hover)`,...v},...N,children:[e(i.List,{className:["flex items-center","vertical"===s?"flex-col items-stretch":"flex-row",u[a]].join(" "),children:x}),e(i.Portal,{children:e(i.Positioner,{className:"neba-portal z-50 [outline:none]",sideOffset:m,collisionPadding:12,children:e(i.Popup,{className:`${w} ${b[a]}`,children:e(i.Viewport,{})})})})]})})});
1
+ "use client";import{jsx as e,jsxs as n,Fragment as a}from"react/jsx-runtime";import*as t from"react";import{NavigationMenu as i}from"@base-ui/react/navigation-menu";import{ChevronIcon as r}from"../../internal/icons.js";import{safeRel as o}from"../../internal/link.js";import{controlHeightClasses as s,controlTextClasses as l,controlTextLeadingClasses as d,cx as c,gapClasses as u,hasContent as f,iconClasses as p,metaTextClasses as m,paddingXClasses as h,popupFadeStateClasses as b,radiusClasses as v,surfaceClasses as g,surfaceSlots as x,transitionClasses as N}from"../../internal/styles.js";const y=/*@__PURE__*/t.createContext({size:"md",density:"default"}),w=["inline-flex shrink-0 cursor-pointer select-none items-center justify-center","whitespace-nowrap font-medium leading-none no-underline","text-(--neba-fg) bg-transparent","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",N,p,"hover:bg-(--n-soft)","data-[popup-open]:bg-(--n-soft-hover) data-[popup-open]:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","data-[disabled]:hover:bg-transparent"].join(" "),j=[g,"relative border text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none] overflow-hidden","[transition:opacity_var(--neba-duration)_var(--neba-ease),width_var(--neba-duration)_var(--neba-ease),height_var(--neba-duration)_var(--neba-ease)]",b].join(" "),_=["flex min-w-0 cursor-pointer items-start no-underline","text-(--neba-fg) bg-transparent",N,p,"hover:bg-(--n-soft)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"].join(" "),k={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"};export const NavigationMenuLink=/*@__PURE__*/t.forwardRef(function({href:a,title:r,description:o,startIcon:s,className:l,children:p,...b},g){const{size:x,density:N}=t.useContext(y);return n(i.Link,{ref:g,href:a,className:c(_,v[x],u[x],h[N??"default"][x],"py-2",l??""),...b,children:[f(s)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:s}):null,n("span",{className:"flex min-w-0 flex-col gap-0.5",children:[e("span",{className:`font-medium ${d[x]}`,children:r}),f(o)?e("span",{className:`text-(--neba-muted-fg) ${m[x]}`,children:o}):null,p]})]})});export function NavigationMenuItem({label:d,href:c,target:p,rel:m,startIcon:b,value:g,disabled:x=!1,columns:N=1,children:j}){const{size:_,density:z}=t.useContext(y),C=void 0!==c&&!f(j),$=[w,s[_],l[_],u[_],h[z??"default"][_],v[_]].join(" ");return e(i.Item,{value:g,children:C?n(i.Link,{href:c,target:p,rel:o(p,m),className:$,children:[f(b)?b:null,d]}):n(a,{children:[n(i.Trigger,{disabled:x,className:$,children:[f(b)?b:null,d,e(i.Icon,{className:"flex items-center [transition:rotate_var(--neba-duration)_var(--neba-ease)] data-[popup-open]:rotate-180",children:e(r,{})})]}),e(i.Content,{className:`grid gap-1 ${k[_]}`,style:N>1?{gridTemplateColumns:`repeat(${N}, minmax(0, 1fr))`}:void 0,children:j})]})})}export const NavigationMenu=/*@__PURE__*/t.forwardRef(function({size:a="md",color:r="primary",density:o="default",orientation:s="horizontal",value:l,defaultValue:d,onValueChange:c,delay:f,closeDelay:p,sideOffset:m=8,className:h,style:b,children:g,...N},w){const _=t.useMemo(()=>({size:a,density:o}),[a,o]);return e(y.Provider,{value:_,children:n(i.Root,{ref:w,orientation:s,value:l,defaultValue:d,onValueChange:e=>c?.(e),delay:f,closeDelay:p,className:h,style:{...x(r,3),"--n-soft-hover":`var(--neba-${r}-soft-hover)`,...b},...N,children:[e(i.List,{className:["flex items-center","vertical"===s?"flex-col items-stretch":"flex-row",u[a]].join(" "),children:g}),e(i.Portal,{children:e(i.Positioner,{className:"neba-portal z-50 [outline:none]",sideOffset:m,collisionPadding:12,children:e(i.Popup,{className:`${j} ${v[a]}`,children:e(i.Viewport,{})})})})]})})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as r}from"@base-ui/react/dialog";import{overlayMessages as t,useMessages as l}from"../../internal/i18n.js";import{cx as n,surfaceSlots as i}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";const o={scrim:"bg-(--neba-scrim) [backdrop-filter:blur(2px)]",blur:"[background-color:color-mix(in_oklab,var(--neba-scrim)_55%,transparent)] [backdrop-filter:blur(14px)_saturate(1.4)]",solid:"bg-(--neba-surface)",clear:""},c={start:"items-start",center:"items-center",end:"items-end"},m={xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8",xl:"p-10"},p=["[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" ");export function Overlay(d){const{open:b,defaultOpen:f,onOpenChange:u,tone:x="scrim",dismissible:y=!1,modal:g=!0,align:j="center",size:h="md",color:k="primary",locale:O,label:_,className:v,style:z,children:N,...P}=s(d,["size","locale"]),w=l(t,O);return e(r.Root,{open:b,defaultOpen:f,modal:g,disablePointerDismissal:!y,onOpenChange:(e,a)=>{y||e||"escape-key"!==a.reason?u?.(e):a.cancel()},children:a(r.Portal,{children:[e(r.Backdrop,{className:`neba-portal fixed inset-0 z-50 ${p} ${o[x]}`}),e(r.Viewport,{className:["neba-portal fixed inset-0 z-50 flex justify-center",c[j],m[h]].join(" "),children:e(r.Popup,{"aria-label":_??w.label,className:n("flex max-h-full max-w-full flex-col items-center justify-center","[outline:none]",p,v??""),style:{...i(k,0),...z},...P,children:N})})]})})}
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as l}from"@base-ui/react/dialog";import{overlayMessages as r,useMessages as s}from"../../internal/i18n.js";import{cx as n,popupFadeClasses as t,surfaceSlots as i}from"../../internal/styles.js";import{useStyleDefaults as o}from"../../internal/defaults.js";const c={scrim:"bg-(--neba-scrim) [backdrop-filter:blur(2px)]",blur:"[background-color:color-mix(in_oklab,var(--neba-scrim)_55%,transparent)] [backdrop-filter:blur(14px)_saturate(1.4)]",solid:"bg-(--neba-surface)",clear:""},m={start:"items-start",center:"items-center",end:"items-end"},p={xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8",xl:"p-10"};export function Overlay(d){const{open:f,defaultOpen:b,onOpenChange:u,tone:x="scrim",dismissible:g=!1,modal:j=!0,align:h="center",size:y="md",color:k="primary",locale:O,label:z,className:N,style:P,children:_,...v}=o(d,["size","locale"]),w=s(r,O);return e(l.Root,{open:f,defaultOpen:b,modal:j,disablePointerDismissal:!g,onOpenChange:(e,a)=>{g||e||"escape-key"!==a.reason?u?.(e):a.cancel()},children:a(l.Portal,{children:[e(l.Backdrop,{className:`neba-portal fixed inset-0 z-50 ${t} ${c[x]}`}),e(l.Viewport,{className:["neba-portal fixed inset-0 z-50 flex justify-center",m[h],p[y]].join(" "),children:e(l.Popup,{"aria-label":z??w.label,className:n("flex max-h-full max-w-full flex-col items-center justify-center","[outline:none]",t,N??""),style:{...i(k,0),...P},...v,children:_})})]})})}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{ChartDataTable as n,ChartLegendBar as l,ChartStatus as i,ChartSurface as r,ChartTooltipPanel as o,useMeasuredWidth as s,useVisibility as d}from"../../internal/chart-frame.js";import{arcPath as u,categoryAt as m,chartFontSizes as c,compactNumber as h,formatCategory as v,markGap as f,plotHeights as p,seriesColor as b,toValue as x}from"../../internal/chart.js";import{numberFormatter as g}from"../../internal/format.js";import{cx as y,metaTextClasses as M}from"../../internal/styles.js";import{chartMessages as j,emptyMessages as N,useMessages as w}from"../../internal/i18n.js";import{useStyleDefaults as z}from"../../internal/defaults.js";const I={pie:0,donut:.62,semi:.62};export function PieChart(P){const{data:k,categories:A,shape:$="pie",startAngle:L=0,center:S,valueLabels:_="none",height:B,format:E,locale:R,label:C,legend:D,tooltip:O,empty:K,size:V="md",variant:W="text",padded:q=!1,className:F,...G}=z(P,["size","variant","locale"]),H=a.useRef(null),J=s(H),Q=w(N,R),T=w(j,R),U=a.useId(),X=a.useCallback(e=>E?g(R,E).format(e):h(e,R),[E,R]),Y=a.useMemo(()=>k.map(x),[k]),Z=a.useMemo(()=>Y.map((e,t)=>({name:v(m(t,A,[Y]),R),data:[k[t]],color:e.color})),[Y,A,k,R]),ee=d(Z),[te,ae]=a.useState(null),ne=Z.map((e,t)=>b(e,t)),le=Y.reduce((e,t,a)=>ee.visible[a]&&null!==t.value?e+Math.abs(t.value):e,0),ie="semi"===$,re="number"==typeof B?B:p[V],oe=c[V],se=!1===D?{interactive:!1}:!0===D||void 0===D?{}:D,de=!1!==D&&Z.length>1,ue=se.side??"bottom",me=!1===O?{mode:"none"}:!0===O||void 0===O?{}:O,ce="none"===me.mode,he=J/2,ve=Math.max(0,Math.min(J/2,ie?re:re/2)-2),fe=ie?Math.min(re,re/2+ve/2):re/2,pe=ve*I[$],be=le<=0||ve<=0,xe=ve>0?Math.min(4,f/ve*(180/Math.PI)):0,ge=ie?180:360,ye=[];let Me=ie?-90:L;Y.forEach((e,t)=>{if(!ee.visible[t]||null===e.value||0===e.value)return;const a=Math.abs(e.value)/le,n=a*ge;ye.push({index:t,start:Me,end:Me+n,value:e.value,share:a}),Me+=n});const je=null===te?[]:[{seriesIndex:te,name:Z[te]?.name,color:Y[te]?.color??ne[te],value:Y[te]?.value??null,formatted:`${X(Y[te]?.value??0)} · ${Math.round(10*(Math.abs(Y[te]?.value??0)/le*100+Number.EPSILON))/10}%`,label:Y[te]?.label}];return t(r,{...G,size:V,variant:W,padded:q,className:F,legendSide:ue,legend:de?e(l,{series:Z,colors:ne,options:se,visibility:ee,size:V,values:se.showValue?Y.map(e=>null===e.value?void 0:X(e.value)):void 0}):null,table:be?null:e(n,{id:U,caption:C,categories:Z.map(e=>e.name??""),series:[{name:C,data:k}],values:[Y],format:X,locale:R}),children:[t("div",{ref:H,role:"img",tabIndex:be?void 0:0,"aria-label":C??T.label,"aria-describedby":be?void 0:U,onPointerLeave:()=>ae(null),onBlur:()=>ae(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;const t=ye.map(e=>e.index);if(0===t.length)return;const a=null===te?-1:t.indexOf(te),n="ArrowRight"===e.key?a+1:a-1;ae(t[(n+t.length)%t.length]),e.preventDefault()},className:y("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:re},children:[be?e("div",{className:y("flex h-full items-center justify-center text-(--neba-muted-fg)",M[V]),children:K??Q.title}):J>0?t("svg",{width:J,height:re,viewBox:`0 0 ${J} ${re}`,"aria-hidden":"true",className:"block",children:[ye.map(t=>{const a=null!==ee.hovered&&ee.hovered!==t.index||null!==te&&te!==t.index,n=t.end-t.start>2*xe?xe/2:0;return e("path",{d:u(he,fe,ve,pe,t.start+n,t.end-n),fill:Y[t.index].color??ne[t.index],opacity:a?.32:1,onPointerEnter:ce?void 0:()=>ae(t.index),className:"[transition:opacity_var(--neba-duration)_var(--neba-ease)]"},t.index)}),"all"===_?ye.map(t=>{const a=((t.start+t.end)/2-90)*(Math.PI/180),n=pe>0?(pe+ve)/2:.68*ve,l=`${Math.round(100*t.share)}%`;return(t.end-t.start)*(Math.PI/180)*n<2*oe||ve-pe<1.6*oe?null:e("text",{x:he+n*Math.cos(a),y:fe+n*Math.sin(a),textAnchor:"middle",dominantBaseline:"central",fontSize:oe,fontWeight:600,fill:"var(--neba-surface)",className:"tabular-nums",children:l},t.index)}):null]}):null,S&&pe>0?e("div",{className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{left:he-pe,top:fe-pe,width:2*pe,height:ie?pe:2*pe},children:S}):null,null===te||ce?null:me.render?e("div",{className:"pointer-events-none absolute top-0 left-1/2 z-10",children:me.render({index:te,category:Z[te]?.name??te,items:je})}):e(o,{heading:Z[te]?.name,items:je,x:he,y:8,flip:!1,size:V})]}),ce?null:e(i,{heading:null===te?void 0:Z[te]?.name,items:je})]})}
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{ChartDataTable as l,ChartLegendBar as n,ChartStatus as i,ChartSurface as r,ChartTooltipPanel as s,markTransitionClasses as o,useMeasuredWidth as d,useVisibility as u}from"../../internal/chart-frame.js";import{arcPath as m,categoryAt as c,chartFontSizes as h,compactNumber as v,formatCategory as f,markGap as p,plotHeights as x,seriesColor as b,toValue as g}from"../../internal/chart.js";import{numberFormatter as y}from"../../internal/format.js";import{cx as M,metaTextClasses as j}from"../../internal/styles.js";import{chartMessages as N,emptyMessages as w,useMessages as z}from"../../internal/i18n.js";import{useStyleDefaults as I}from"../../internal/defaults.js";const P={pie:0,donut:.62,semi:.62};export function PieChart(k){const{data:A,categories:$,shape:L="pie",startAngle:S=0,center:B,valueLabels:E="none",height:R,format:C,locale:D,label:O,legend:_,tooltip:K,empty:V,size:W="md",variant:q="text",padded:F=!1,className:G,...H}=I(k,["size","variant","locale"]),J=a.useRef(null),Q=d(J),T=z(w,D),U=z(N,D),X=a.useId(),Y=a.useCallback(e=>C?y(D,C).format(e):v(e,D),[C,D]),Z=a.useMemo(()=>A.map(g),[A]),ee=a.useMemo(()=>Z.map((e,t)=>({name:f(c(t,$,[Z]),D),data:[A[t]],color:e.color})),[Z,$,A,D]),te=u(ee),[ae,le]=a.useState(null),ne=ee.map((e,t)=>b(e,t)),ie=Z.reduce((e,t,a)=>te.visible[a]&&null!==t.value?e+Math.abs(t.value):e,0),re="semi"===L,se="number"==typeof R?R:x[W],oe=h[W],de=!1===_?{interactive:!1}:!0===_||void 0===_?{}:_,ue=!1!==_&&ee.length>1,me=de.side??"bottom",ce=!1===K?{mode:"none"}:!0===K||void 0===K?{}:K,he="none"===ce.mode,ve=Q/2,fe=Math.max(0,Math.min(Q/2,re?se:se/2)-2),pe=re?Math.min(se,se/2+fe/2):se/2,xe=fe*P[L],be=ie<=0||fe<=0,ge=fe>0?Math.min(4,p/fe*(180/Math.PI)):0,ye=re?180:360,Me=[];let je=re?-90:S;Z.forEach((e,t)=>{if(!te.visible[t]||null===e.value||0===e.value)return;const a=Math.abs(e.value)/ie,l=a*ye;Me.push({index:t,start:je,end:je+l,value:e.value,share:a}),je+=l});const Ne=null===ae?[]:[{seriesIndex:ae,name:ee[ae]?.name,color:Z[ae]?.color??ne[ae],value:Z[ae]?.value??null,formatted:`${Y(Z[ae]?.value??0)} · ${Math.round(10*(Math.abs(Z[ae]?.value??0)/ie*100+Number.EPSILON))/10}%`,label:Z[ae]?.label}];return t(r,{...H,size:W,variant:q,padded:F,className:G,legendSide:me,legend:ue?e(n,{series:ee,colors:ne,options:de,visibility:te,size:W,values:de.showValue?Z.map(e=>null===e.value?void 0:Y(e.value)):void 0}):null,table:be?null:e(l,{id:X,caption:O,categories:ee.map(e=>e.name??""),series:[{name:O,data:A}],values:[Z],format:Y,locale:D}),children:[t("div",{ref:J,role:"img",tabIndex:be?void 0:0,"aria-label":O??U.label,"aria-describedby":be?void 0:X,onPointerLeave:()=>le(null),onBlur:()=>le(null),onKeyDown:e=>{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;const t=Me.map(e=>e.index);if(0===t.length)return;const a=null===ae?-1:t.indexOf(ae),l="ArrowRight"===e.key?a+1:a-1;le(t[(l+t.length)%t.length]),e.preventDefault()},className:M("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:se},children:[be?e("div",{className:M("flex h-full items-center justify-center text-(--neba-muted-fg)",j[W]),children:V??T.title}):Q>0?t("svg",{width:Q,height:se,viewBox:`0 0 ${Q} ${se}`,"aria-hidden":"true",className:"block",children:[Me.map(t=>{const a=null!==te.hovered&&te.hovered!==t.index||null!==ae&&ae!==t.index,l=t.end-t.start>2*ge?ge/2:0;return e("path",{d:m(ve,pe,fe,xe,t.start+l,t.end-l),fill:Z[t.index].color??ne[t.index],opacity:a?.32:1,onPointerEnter:he?void 0:()=>le(t.index),className:o},t.index)}),"all"===E?Me.map(t=>{const a=((t.start+t.end)/2-90)*(Math.PI/180),l=xe>0?(xe+fe)/2:.68*fe,n=`${Math.round(100*t.share)}%`;return(t.end-t.start)*(Math.PI/180)*l<2*oe||fe-xe<1.6*oe?null:e("text",{x:ve+l*Math.cos(a),y:pe+l*Math.sin(a),textAnchor:"middle",dominantBaseline:"central",fontSize:oe,fontWeight:600,fill:"var(--neba-surface)",className:"tabular-nums",children:n},t.index)}):null]}):null,B&&xe>0?e("div",{className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{left:ve-xe,top:pe-xe,width:2*xe,height:re?xe:2*xe},children:B}):null,null===ae||he?null:ce.render?e("div",{className:"pointer-events-none absolute top-0 left-1/2 z-10",children:ce.render({index:ae,category:ee[ae]?.name??ae,items:Ne})}):e(s,{heading:ee[ae]?.name,items:Ne,x:ve,y:8,flip:!1,size:W})]}),he?null:e(i,{heading:null===ae?void 0:ee[ae]?.name,items:Ne})]})}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Popover as t}from"@base-ui/react/popover";import{boxPaddingXClasses as o,boxPaddingYClasses as s}from"../box/Box.js";import{actionMessages as n,useMessages as i}from"../../internal/i18n.js";import{CloseIcon as l}from"../../internal/icons.js";import{cx as r,hasContent as d,metaTextClasses as c,radiusClasses as m,sheetBodyClasses as p,sheetHeaderGapClasses as f,sheetSectionGapClasses as u,sheetTitleClasses as h,surfaceClasses as x,surfaceSlots as b}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const v={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},w=[x,"relative flex flex-col","border text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),y={xs:8,sm:9,md:10,lg:11,xl:12};export const PopoverClose=t.Close;export function Popover(x){const{size:j="md",color:N="primary",density:_="default",trigger:k,title:O,description:z,children:C,side:P="bottom",align:$="center",sideOffset:B=6,alignOffset:L=0,arrow:M=!1,open:T,defaultOpen:W,onOpenChange:A,modal:D=!1,dismissible:E=!0,showClose:R=!1,locale:q,closeLabel:F,width:G,className:H,style:I,...J}=g(x,["size","density","locale"]),K=i(n,q),Q=o[_][j],S=s[_][j],U=y[j],V=d(O)||d(z);return a(t.Root,{open:T,defaultOpen:W,modal:D,onOpenChange:(e,a)=>{E||e||"escape-key"!==a.reason&&"outside-press"!==a.reason&&"focus-out"!==a.reason?A?.(e):a.cancel()},children:[k?e(t.Trigger,{render:k}):null,e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-50 [outline:none]",side:P,align:$,sideOffset:B,alignOffset:L,children:a(t.Popup,{className:r(w,m[j],p[j],u[j],Q,S,void 0===G?v[j]:"",H??""),style:{...b(N,3),...void 0===G?null:{maxWidth:"number"==typeof G?`${G}px`:G},...I},...J,children:[M?e(t.Arrow,{className:["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" "),children:a("svg",{width:U,height:U/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:[e("path",{d:"M0 0h10L5 5z",fill:"var(--n-panel-press)"}),e("path",{d:"M0 0 5 5 10 0",fill:"none",stroke:"var(--n-line)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]})}):null,V||R?a("div",{className:"flex shrink-0 items-start gap-3",children:[a("div",{className:`flex min-w-0 flex-1 flex-col ${f[j]}`,children:[d(O)?e(t.Title,{className:`m-0 font-semibold ${h[j]}`,children:O}):null,d(z)?e(t.Description,{className:`m-0 text-(--neba-muted-fg) ${c[j]}`,children:z}):null]}),R?e(t.Close,{"aria-label":F??K.close,className:["flex size-[1.6em] shrink-0 cursor-pointer items-center justify-center","rounded-full text-(--neba-muted-fg)","[&_svg]:size-[1.1em] [&_svg]:shrink-0","[transition:background-color_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)]","hover:bg-(--n-soft) hover:text-(--neba-fg)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),children:e(l,{})}):null]}):null,d(C)?e("div",{className:"min-w-0",children:C}):null]})})})]})}
1
+ "use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Popover as s}from"@base-ui/react/popover";import{boxPaddingXClasses as a,boxPaddingYClasses as t}from"../box/Box.js";import{actionMessages as l,useMessages as n}from"../../internal/i18n.js";import{CloseIcon as i}from"../../internal/icons.js";import{cx as r,hasContent as d,metaTextClasses as c,popupFadeClasses as m,radiusClasses as f,sheetBodyClasses as p,sheetHeaderGapClasses as u,sheetSectionGapClasses as h,sheetTitleClasses as x,surfaceClasses as b,surfaceSlots as g}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";const w={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},j=[b,"relative flex flex-col","border text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",m].join(" "),N={xs:8,sm:9,md:10,lg:11,xl:12};export const PopoverClose=s.Close;export function Popover(m){const{size:b="md",color:k="primary",density:y="default",trigger:O,title:_,description:z,children:C,side:P="bottom",align:$="center",sideOffset:B=6,alignOffset:L=0,arrow:M=!1,open:T,defaultOpen:W,onOpenChange:A,modal:D=!1,dismissible:E=!0,showClose:R=!1,locale:q,closeLabel:F,width:G,className:H,style:I,...J}=v(m,["size","density","locale"]),K=n(l,q),Q=a[y][b],S=t[y][b],U=N[b],V=d(_)||d(z);return o(s.Root,{open:T,defaultOpen:W,modal:D,onOpenChange:(e,o)=>{E||e||"escape-key"!==o.reason&&"outside-press"!==o.reason&&"focus-out"!==o.reason?A?.(e):o.cancel()},children:[O?e(s.Trigger,{render:O}):null,e(s.Portal,{children:e(s.Positioner,{className:"neba-portal z-50 [outline:none]",side:P,align:$,sideOffset:B,alignOffset:L,children:o(s.Popup,{className:r(j,f[b],p[b],h[b],Q,S,void 0===G?w[b]:"",H??""),style:{...g(k,3),...void 0===G?null:{maxWidth:"number"==typeof G?`${G}px`:G},...I},...J,children:[M?e(s.Arrow,{className:["data-[side=top]:bottom-[-1px]","data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180","data-[side=left]:right-[-1px] data-[side=left]:-rotate-90","data-[side=right]:left-[-1px] data-[side=right]:rotate-90"].join(" "),children:o("svg",{width:U,height:U/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:[e("path",{d:"M0 0h10L5 5z",fill:"var(--n-panel-press)"}),e("path",{d:"M0 0 5 5 10 0",fill:"none",stroke:"var(--n-line)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]})}):null,V||R?o("div",{className:"flex shrink-0 items-start gap-3",children:[o("div",{className:`flex min-w-0 flex-1 flex-col ${u[b]}`,children:[d(_)?e(s.Title,{className:`m-0 font-semibold ${x[b]}`,children:_}):null,d(z)?e(s.Description,{className:`m-0 text-(--neba-muted-fg) ${c[b]}`,children:z}):null]}),R?e(s.Close,{"aria-label":F??K.close,className:["flex size-[1.6em] shrink-0 cursor-pointer items-center justify-center","rounded-full text-(--neba-muted-fg)","[&_svg]:size-[1.1em] [&_svg]:shrink-0","[transition:background-color_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)]","hover:bg-(--n-soft) hover:text-(--neba-fg)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),children:e(i,{})}):null]}):null,d(C)?e("div",{className:"min-w-0",children:C}):null]})})})]})}
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as o}from"@base-ui/react/field";import{controlTextClasses as i,cx as t,hitAreaClasses as s,metaTextClasses as c,surfaceClasses as d,tickDotClasses as b,tickRowLeadingClasses as f,tickSizeClasses as m,transitionClasses as h}from"../../internal/styles.js";const p=/*@__PURE__*/r.createContext({size:"md",color:"primary",readOnly:!1}),u=["relative inline-flex shrink-0 items-center justify-center rounded-full border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",h,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),v=[d,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),x=[d,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),g=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" ");export const Radio=/*@__PURE__*/r.forwardRef(function({label:l,description:s,disabled:d=!1,className:h,classNames:N,style:y,...k},j){const R=r.useContext(p),$=k.readOnly??R.readOnly;return e(o.Root,{disabled:d,className:t("flex flex-col",h??""),style:y,children:a("div",{className:`flex items-start gap-2 ${i[R.size]} ${f}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(n.Root,{ref:j,className:t(u,m[R.size],d?g:$?x:v,N?.control),disabled:d,...k,children:e(n.Indicator,{className:t("rounded-full bg-current",b[R.size],N?.indicator)})})}),l||s?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(o.Label,{className:t("leading-[1.4]",d?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",N?.label),children:l}):null,s?e(o.Description,{className:t(c[R.size],"text-(--neba-muted-fg)",N?.description),children:s}):null]}):null]})})});export const RadioGroup=/*@__PURE__*/r.forwardRef(function({size:n="md",color:i="primary",orientation:s="vertical",label:d,description:b,error:f,invalid:m,disabled:h=!1,readOnly:u=!1,className:v,classNames:x,style:g,children:N,...y},k){const j=null!=f&&!1!==f&&""!==f,R=m??j,$=R?"danger":i,w={"--n-fill":`var(--neba-${$}-fill)`,"--n-fill-hover":`var(--neba-${$}-fill-hover)`,"--n-on-solid":`var(--neba-${$}-on-solid)`,"--n-accent":`var(--neba-${$}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${$}-line)`,"--n-line-hover":`var(--neba-${$}-line-hover)`,"--n-ring":`var(--neba-${$}-ring)`},z=r.useMemo(()=>({size:n,color:$,readOnly:u}),[n,$,u]);return e(p.Provider,{value:z,children:a(o.Root,{disabled:h,invalid:R,className:t("flex flex-col gap-1.5",v??""),style:{...w,...g},children:[d?e(o.Label,{className:t(c[n],"font-medium",h?"text-(--neba-disabled-fg)":"text-(--neba-fg)",x?.label),children:d}):null,b?e(o.Description,{className:t(c[n],"text-(--neba-muted-fg)",x?.description),children:b}):null,e(l,{ref:k,disabled:h,readOnly:u,className:t("flex","horizontal"===s?"flex-row flex-wrap gap-x-5 gap-y-2":"flex-col gap-2",x?.control),...y,children:N}),e(o.Error,j?{match:!0,className:t(c[n],"text-(--n-accent)",x?.error),children:f}:{className:t(c[n],"text-(--n-accent)",x?.error)})]})})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as i}from"@base-ui/react/field";import{controlTextClasses as o,cx as t,hitAreaClasses as s,metaTextClasses as c,surfaceClasses as d,tickDotClasses as b,tickRowLeadingClasses as f,tickSizeClasses as h,transitionClasses as m}from"../../internal/styles.js";const u=/*@__PURE__*/r.createContext({size:"md",color:"primary",readOnly:!1}),p=["relative inline-flex shrink-0 items-center justify-center rounded-full border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",m,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),v=[d,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),g=[d,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),x=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" "),N=["rounded-full bg-current","[transition:width_var(--neba-duration)_var(--neba-ease),height_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:size-0 data-[ending-style]:size-0"].join(" ");export const Radio=/*@__PURE__*/r.forwardRef(function({label:l,description:s,disabled:d=!1,className:m,classNames:y,style:k,...j},z){const w=r.useContext(u),R=j.readOnly??w.readOnly;return e(i.Root,{disabled:d,className:t("flex flex-col",m??""),style:k,children:a("div",{className:`flex items-start gap-2 ${o[w.size]} ${f}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(n.Root,{ref:z,className:t(p,h[w.size],d?x:R?g:v,y?.control),disabled:d,...j,children:e(n.Indicator,{className:t(N,b[w.size],y?.indicator)})})}),l||s?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(i.Label,{className:t("leading-[1.4]",d?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",y?.label),children:l}):null,s?e(i.Description,{className:t(c[w.size],"text-(--neba-muted-fg)",y?.description),children:s}):null]}):null]})})});export const RadioGroup=/*@__PURE__*/r.forwardRef(function({size:n="md",color:o="primary",orientation:s="vertical",label:d,description:b,error:f,invalid:h,disabled:m=!1,readOnly:p=!1,className:v,classNames:g,style:x,children:N,...y},k){const j=null!=f&&!1!==f&&""!==f,z=h??j,w=z?"danger":o,R={"--n-fill":`var(--neba-${w}-fill)`,"--n-fill-hover":`var(--neba-${w}-fill-hover)`,"--n-on-solid":`var(--neba-${w}-on-solid)`,"--n-accent":`var(--neba-${w}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${w}-line)`,"--n-line-hover":`var(--neba-${w}-line-hover)`,"--n-ring":`var(--neba-${w}-ring)`},$=r.useMemo(()=>({size:n,color:w,readOnly:p}),[n,w,p]);return e(u.Provider,{value:$,children:a(i.Root,{disabled:m,invalid:z,className:t("flex flex-col gap-1.5",v??""),style:{...R,...x},children:[d?e(i.Label,{className:t(c[n],"font-medium",m?"text-(--neba-disabled-fg)":"text-(--neba-fg)",g?.label),children:d}):null,b?e(i.Description,{className:t(c[n],"text-(--neba-muted-fg)",g?.description),children:b}):null,e(l,{ref:k,disabled:m,readOnly:p,className:t("flex","horizontal"===s?"flex-row flex-wrap gap-x-5 gap-y-2":"flex-col gap-2",g?.control),...y,children:N}),e(i.Error,j?{match:!0,className:t(c[n],"text-(--n-accent)",g?.error),children:f}:{className:t(c[n],"text-(--n-accent)",g?.error)})]})})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{StarIcon as t,StarOutlineIcon as l}from"../../internal/icons.js";import{fillMessage as r,ratingMessages as i,useMessages as s}from"../../internal/i18n.js";import{controlSlots as o,cx as d,focusWithinRingClasses as m,gapClasses as c,iconSizeClasses as u,radiusClasses as h,srOnlyClasses as f,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const x="flex items-center justify-center";export const Rating=/*@__PURE__*/n.forwardRef(function(y,v){const{value:g,defaultValue:j=0,onValueChange:N,count:M=5,precision:w=1,icon:k,emptyIcon:S,clearable:C=!0,readOnly:L=!1,disabled:P=!1,name:q,required:I=!1,size:z="md",color:A="warning",locale:R,label:V,valueLabel:E,className:F,style:O,onPointerLeave:B,...D}=b(y,["size","locale"]),G=s(i,R),H=n.useId(),J=q??H,[K,Q]=n.useState(j),T=void 0!==g,U=T?g:K,[W,X]=n.useState(null),Y=Math.max(1,Math.floor(M)),Z=w>0&&w<=1?w:1,$=Math.round(1/Z),_=Math.max(0,Math.min(Y,W??U)),ee=n.useCallback(e=>E?E(e,Y):e<=0?G.empty:r(G.value,{value:String(e),max:String(Y)}),[E,Y,G]),ae=e=>{T||Q(e),N?.(e)},ne=Array.from({length:Y},(n,r)=>{const i=Math.max(0,Math.min(1,_-r));return a("span",{className:d("relative inline-flex shrink-0",u[z],h.xs,L||P?"":m),children:[e("span",{className:[x,u[z],P?"text-(--neba-disabled-fg)":"text-(--n-empty)"].join(" "),children:S??e(l,{})}),e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-y-0 start-0 overflow-hidden",style:{width:100*i+"%"},children:e("span",{className:[x,u[z],P?"text-(--neba-disabled-fg)":"text-(--n-fill)",p].join(" "),children:k??e(t,{})})}),L?null:Array.from({length:$},(a,n)=>{const t=Number((r+(n+1)*Z).toFixed(4));return e("label",{className:["absolute inset-y-0",P?"cursor-not-allowed":"cursor-pointer"].join(" "),style:{insetInlineStart:100*n/$+"%",width:100/$+"%"},onPointerEnter:()=>{P||X(t)},children:e("input",{type:"radio",className:f,name:J,value:t,checked:U===t,disabled:P,required:I,"aria-label":ee(t),onChange:()=>ae(t),onClick:()=>{C&&U===t&&ae(0)}})},t)})]},r)}),te=d("inline-flex items-center align-middle",c[z],P?"cursor-not-allowed":"",F??""),le={...o(A,0,"solid"),"--n-empty":"color-mix(in oklab, var(--neba-muted-fg) 40%, transparent)",...O};return e("div",L?{ref:v,role:"img","aria-label":ee(Math.max(0,Math.min(Y,U))),className:te,style:le,onPointerLeave:B,...D,children:ne}:{ref:v,role:"radiogroup","aria-label":V??G.label,"aria-disabled":P||void 0,"aria-required":I||void 0,className:te,style:le,onPointerLeave:e=>{X(null),B?.(e)},...D,children:ne})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{StarIcon as t,StarOutlineIcon as r}from"../../internal/icons.js";import{fillMessage as l,ratingMessages as i,useMessages as s}from"../../internal/i18n.js";import{controlSlots as o,cx as d,focusWithinRingClasses as m,gapClasses as c,iconSizeClasses as u,radiusClasses as h,srOnlyClasses as f,transitionClasses as b}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const x="flex items-center justify-center";export const Rating=/*@__PURE__*/n.forwardRef(function(v,y){const{value:g,defaultValue:j=0,onValueChange:N,count:M=5,precision:w=1,icon:k,emptyIcon:S,clearable:C=!0,readOnly:L=!1,disabled:P=!1,name:q,required:I=!1,size:z="md",color:A="warning",locale:R,label:V,valueLabel:_,className:E,style:F,onPointerLeave:O,...B}=p(v,["size","locale"]),D=s(i,R),G=n.useId(),H=q??G,[J,K]=n.useState(j),Q=void 0!==g,T=Q?g:J,[U,W]=n.useState(null),X=Math.max(1,Math.floor(M)),Y=w>0&&w<=1?w:1,Z=Math.round(1/Y),$=Math.max(0,Math.min(X,U??T)),ee=n.useCallback(e=>_?_(e,X):e<=0?D.empty:l(D.value,{value:String(e),max:String(X)}),[_,X,D]),ae=e=>{Q||K(e),N?.(e)},ne=Array.from({length:X},(n,l)=>{const i=Math.max(0,Math.min(1,$-l));return a("span",{className:d("relative inline-flex shrink-0",u[z],h.xs,L||P?"":m),children:[e("span",{className:[x,u[z],P?"text-(--neba-disabled-fg)":"text-(--n-empty)"].join(" "),children:S??e(r,{})}),e("span",{"aria-hidden":"true",className:d("pointer-events-none absolute inset-y-0 start-0 overflow-hidden","[transition:width_var(--neba-duration)_var(--neba-ease)]"),style:{width:100*i+"%"},children:e("span",{className:[x,u[z],P?"text-(--neba-disabled-fg)":"text-(--n-fill)",b].join(" "),children:k??e(t,{})})}),L?null:Array.from({length:Z},(a,n)=>{const t=Number((l+(n+1)*Y).toFixed(4));return e("label",{className:["absolute inset-y-0",P?"cursor-not-allowed":"cursor-pointer"].join(" "),style:{insetInlineStart:100*n/Z+"%",width:100/Z+"%"},onPointerEnter:()=>{P||W(t)},children:e("input",{type:"radio",className:f,name:H,value:t,checked:T===t,disabled:P,required:I,"aria-label":ee(t),onChange:()=>ae(t),onClick:()=>{C&&T===t&&ae(0)}})},t)})]},l)}),te=d("inline-flex items-center align-middle",c[z],P?"cursor-not-allowed":"",E??""),re={...o(A,0,"solid"),"--n-empty":"color-mix(in oklab, var(--neba-muted-fg) 40%, transparent)",...F};return e("div",L?{ref:y,role:"img","aria-label":ee(Math.max(0,Math.min(X,T))),className:te,style:re,onPointerLeave:O,...B,children:ne}:{ref:y,role:"radiogroup","aria-label":V??D.label,"aria-disabled":P||void 0,"aria-required":I||void 0,className:te,style:re,onPointerLeave:e=>{W(null),O?.(e)},...B,children:ne})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as l}from"../../internal/chart-frame.js";import{bubbleRadius as t,formatCategory as i,markerRadii as s,markGap as o,markPath as n,markShapes as c,plotHeights as u,pointX as d}from"../../internal/chart.js";import{cx as h,srOnlyClasses as m}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export function ScatterChart(r){const{shape:i="auto",pointRadius:o,maxRadius:h,series:m,categories:b,size:v="md",xAxis:y,...z}=f(r,["size"]),g=o??s[v],j=h??Math.max(g+2,("number"==typeof z.height?z.height:u[v])/12),k=m.reduce((e,r)=>r.color?e:e+1,0),M="auto"===i||"varied"===i?"circle":i,w="varied"===i||"auto"===i&&k>3,N=a.useCallback(e=>w?c[e%c.length]:M,[w,M]),E=a.useCallback(e=>{const r=[];let a=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(a=Math.max(a,e.z))})}),e.values.forEach((l,i)=>{e.visible[i]&&l.forEach((l,s)=>{if(null===l.value)return;const o=d(l,s,b);null!==o&&r.push({series:i,index:s,x:e.categoryValuePx(o),y:e.valuePx(l.value),r:void 0===l.z?g:t(l.z,a,j,2)})})}),r},[b,g,j]);return e(l,{...z,series:m,categories:b,size:v,xScale:"value",xAxis:y,marks:E,markInset:j,includeZero:!1,swatch:(r,a)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:n(N(r),5,5,4),fill:a})}),table:r=>e(p,{id:r,series:m,categories:b,label:z.label,xLabel:y?.label,yLabel:z.yAxis?.label,locale:z.locale,format:z.format}),children:r=>e(x,{context:r,shapeOf:N})})}function x({context:r,shapeOf:l}){const{marks:t,values:i,colors:s,hovered:c,activeMark:u}=r,d=a.useMemo(()=>[...t].sort((e,r)=>r.r-e.r),[t]);return e("g",{children:d.map(r=>{const a=i[r.series]?.[r.index],t=null!==c&&c!==r.series,d=u?.series===r.series&&u?.index===r.index;return e("path",{d:n(l(r.series),r.x,r.y,d?r.r+1:r.r),fill:a?.color??s[r.series],stroke:"var(--neba-chart-gap)",strokeWidth:o,opacity:t?.28:1},`${r.series}-${r.index}`)})})}function p({id:l,series:t,categories:s,label:o,xLabel:n,yLabel:c,locale:u,format:d}){const f=a.useMemo(()=>new Intl.NumberFormat(u,d??{maximumFractionDigits:2}),[u,d]),x=t.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:l,className:h(m),children:[o?e("caption",{children:o}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:n??"x"}),e("th",{scope:"col",children:c??"y"}),x?e("th",{scope:"col",children:"z"}):null]})}),e("tbody",{children:t.flatMap((a,l)=>a.data.map((t,o)=>{const n="object"==typeof t&&null!==t?t:null,c=n?n.y:"number"==typeof t?t:null,d=n?.x??s?.[o]??o;return r("tr",{children:[e("th",{scope:"row",children:a.name??l+1}),e("td",{children:i(d,u)}),e("td",{children:null!==c&&Number.isFinite(c)?f.format(c):""}),x?e("td",{children:void 0===n?.z?"":f.format(n.z)}):null]},`${l}-${o}`)}))})]})}
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as l,markTransitionClasses as t}from"../../internal/chart-frame.js";import{bubbleRadius as i,formatCategory as s,markerRadii as o,markGap as n,markPath as c,markShapes as u,plotHeights as d,pointX as h}from"../../internal/chart.js";import{cx as m,srOnlyClasses as x}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export function ScatterChart(r){const{shape:t="auto",pointRadius:s,maxRadius:n,series:m,categories:x,size:v="md",xAxis:y,...g}=f(r,["size"]),z=s??o[v],j=n??Math.max(z+2,("number"==typeof g.height?g.height:d[v])/12),k=m.reduce((e,r)=>r.color?e:e+1,0),w="auto"===t||"varied"===t?"circle":t,M="varied"===t||"auto"===t&&k>3,N=a.useCallback(e=>M?u[e%u.length]:w,[M,w]),$=a.useCallback(e=>{const r=[];let a=0;return e.values.forEach(e=>{e.forEach(e=>{null!==e.value&&void 0!==e.z&&Number.isFinite(e.z)&&(a=Math.max(a,e.z))})}),e.values.forEach((l,t)=>{e.visible[t]&&l.forEach((l,s)=>{if(null===l.value)return;const o=h(l,s,x);null!==o&&r.push({series:t,index:s,x:e.categoryValuePx(o),y:e.valuePx(l.value),r:void 0===l.z?z:i(l.z,a,j,2)})})}),r},[x,z,j]);return e(l,{...g,series:m,categories:x,size:v,xScale:"value",xAxis:y,marks:$,markInset:j,includeZero:!1,swatch:(r,a)=>e("svg",{viewBox:"0 0 10 10",className:"size-2.5 overflow-visible","aria-hidden":"true",children:e("path",{d:c(N(r),5,5,4),fill:a})}),table:r=>e(b,{id:r,series:m,categories:x,label:g.label,xLabel:y?.label,yLabel:g.yAxis?.label,locale:g.locale,format:g.format}),children:r=>e(p,{context:r,shapeOf:N})})}function p({context:r,shapeOf:l}){const{marks:i,values:s,colors:o,hovered:u,activeMark:d}=r,h=a.useMemo(()=>[...i].sort((e,r)=>r.r-e.r),[i]);return e("g",{children:h.map(r=>{const a=s[r.series]?.[r.index],i=null!==u&&u!==r.series,h=d?.series===r.series&&d?.index===r.index;return e("path",{d:c(l(r.series),r.x,r.y,r.r),fill:a?.color??o[r.series],stroke:"var(--neba-chart-gap)",strokeWidth:n,opacity:i?.28:1,className:t,style:{transformBox:"view-box",transformOrigin:`${r.x}px ${r.y}px`,scale:h&&r.r>0?(r.r+1)/r.r:1}},`${r.series}-${r.index}`)})})}function b({id:l,series:t,categories:i,label:o,xLabel:n,yLabel:c,locale:u,format:d}){const h=a.useMemo(()=>new Intl.NumberFormat(u,d??{maximumFractionDigits:2}),[u,d]),f=t.some(e=>e.data.some(e=>"object"==typeof e&&null!==e&&void 0!==e.z));return r("table",{id:l,className:m(x),children:[o?e("caption",{children:o}):null,e("thead",{children:r("tr",{children:[e("th",{scope:"col"}),e("th",{scope:"col",children:n??"x"}),e("th",{scope:"col",children:c??"y"}),f?e("th",{scope:"col",children:"z"}):null]})}),e("tbody",{children:t.flatMap((a,l)=>a.data.map((t,o)=>{const n="object"==typeof t&&null!==t?t:null,c=n?n.y:"number"==typeof t?t:null,d=n?.x??i?.[o]??o;return r("tr",{children:[e("th",{scope:"row",children:a.name??l+1}),e("td",{children:s(d,u)}),e("td",{children:null!==c&&Number.isFinite(c)?h.format(c):""}),f?e("td",{children:void 0===n?.z?"":h.format(n.z)}):null]},`${l}-${o}`)}))})]})}
@@ -3,9 +3,12 @@ import type { NebaOrientation, NebaStyleProps } from '../../types.js';
3
3
  /**
4
4
  * When the scroll buttons are drawn.
5
5
  *
6
- * - `auto` — only the one that has somewhere to go, and neither of them while
7
- * everything fits. The default: a control that cannot do anything is worse
8
- * than no control, and a row that does not overflow is not a scroller.
6
+ * - `auto` — neither of them while everything fits, and at an end whichever
7
+ * costs less: an `overlay` button with nowhere to go is not drawn at all, an
8
+ * `inline` one is drawn `disabled`. The default. A control that cannot do
9
+ * anything is worse than no control — but an inline lane is held open either
10
+ * way, and an empty one is not one control fewer, it is the same width
11
+ * reading as stray padding. A row that does not overflow is not a scroller.
9
12
  * - `always` — both, from the first paint, with the one that has nowhere to go
10
13
  * `disabled` rather than gone. What a row whose content arrives later wants,
11
14
  * since the buttons do not appear under the pointer half a second in.
@@ -40,7 +43,9 @@ export type ScrollZoneMode = 'item' | 'page' | 'hold';
40
43
  *
41
44
  * The lane an `inline` button sits in is kept even while that button has
42
45
  * nowhere to go, or the strip would resize under the pointer every time it
43
- * reached an end.
46
+ * reached an end. That is also what decides what `buttons="auto"` does at an
47
+ * end: the lane is paid for either way, so the button stays there and is
48
+ * `disabled`, while an `overlay` one — whose absence is free — is removed.
44
49
  */
45
50
  export type ScrollZoneButtonPlacement = 'inline' | 'overlay';
46
51
  export interface ScrollZoneProps extends NebaStyleProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'color'> {
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{IconButton as r}from"../icon-button/IconButton.js";import{spacingValue as o}from"../../internal/grid.js";import{scrollMessages as i,useMessages as l}from"../../internal/i18n.js";import{ChevronIcon as s}from"../../internal/icons.js";import{queryMatches as a,reducedMotionQuery as c}from"../../internal/media.js";import{observeResize as u}from"../../internal/observe.js";import{cx as d}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";const m={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-3",xl:"p-4"},p={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-3",xl:"gap-4"};export const ScrollZone=/*@__PURE__*/n.forwardRef(function(v,b){const{orientation:w="horizontal",lines:g=1,spacing:h=2,buttons:y="auto",buttonPlacement:x="inline",mode:k="item",step:L=1,speed:E=900,snap:C=!1,drag:j=!0,wheel:M=!1,scrollbar:P=!1,variant:R="solid",size:N="md",color:T="primary",density:A="default",locale:D,label:W,previousLabel:z,nextLabel:S,className:B,style:F,children:Y,...H}=f(v,["size","density","variant","locale"]),I=l(i,D),X="horizontal"===w,$=Math.max(1,Math.round(g)),q=Math.max(1,Math.round(L)),K=n.useRef(null),_=n.useRef(null),[V,Z]=n.useState({back:!1,forward:!1}),G=n.useCallback(()=>{const e=K.current;if(!e)return;const t=X?e.clientWidth:e.clientHeight,n=X?e.scrollWidth:e.scrollHeight,r=Math.abs(X?e.scrollLeft:e.scrollTop);Z(e=>{const o=r>1,i=n-t-r>1;return e.back===o&&e.forward===i?e:{back:o,forward:i}})},[X]);n.useEffect(()=>{const e=K.current,t=_.current;if(!e)return;G();const n=[u(e,G),t?u(t,G):null];return()=>{for(const e of n)e?.()}},[G]);const J=n.useCallback(()=>{const e=K.current;return e&&X&&"rtl"===getComputedStyle(e).direction?-1:1},[X]),O=n.useCallback((e,t)=>{const n=K.current;if(!n)return;const r=t?a(c)?"auto":"smooth":"auto";n.scrollBy(X?{left:e,behavior:r}:{top:e,behavior:r})},[X]),Q=n.useCallback(()=>{const e=K.current,t=_.current;if(!e||!t)return[];const n=X&&"rtl"===getComputedStyle(e).direction,r=X?n?"right":"left":"top",o=n?-1:1,i=e.getBoundingClientRect()[r],l=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-i)*o);l.includes(t)||l.push(t)}return l.sort((e,t)=>e-t)},[X]),U=n.useCallback((e,t=k)=>{const n=K.current;if(!n)return;const r=J(),o=X?n.clientWidth:n.clientHeight;if("page"===t)return void O(o*(e?1:-1)*r,!0);const i=Q(),l=i.filter(e=>e>1),s=i.filter(e=>e<-1),a=e?l[q-1]:s[s.length-q];O(void 0!==a?a*r:o*(e?1:-1)*r,!0)},[J,X,Q,q,k,O]),ee=n.useRef(null);n.useEffect(()=>()=>ee.current?.(),[]);const te=n.useCallback((e,t)=>{if(ee.current)return;const n=J(),r=performance.now();let o=r,i=0;const l=t=>{const r=t-o;o=t,O(E*r/1e3*(e?1:-1)*n,!1),i=requestAnimationFrame(l)};i=requestAnimationFrame(l);const s=()=>{cancelAnimationFrame(i),ee.current=null,window.removeEventListener(t,s),window.removeEventListener("pointercancel",s),window.removeEventListener("blur",s),performance.now()-r<140&&U(e,"item")};ee.current=s,window.addEventListener(t,s),window.addEventListener("pointercancel",s),window.addEventListener("blur",s)},[U,J,O,E]),ne=n.useRef(null);function re(e){return"hold"!==k?{onClick:()=>U(e)}:{onPointerDown:t=>{0===t.button&&te(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),te(e,"keyup"))}}}n.useEffect(()=>()=>ne.current?.(),[]),n.useEffect(()=>{const e=K.current;if(!e||!M||!X)return;const t=t=>{if(t.ctrlKey||Math.abs(t.deltaX)>Math.abs(t.deltaY))return;const n=1===t.deltaMode?16:2===t.deltaMode?e.clientWidth:1,r=t.deltaY*n;if(!r)return;const o=Math.abs(e.scrollLeft);(r>0?e.scrollWidth-e.clientWidth-o>1:o>1)&&(t.preventDefault(),O(r*J(),!1))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[J,X,O,M]);const oe="none"!==y&&("always"===y||V.back||V.forward),ie="inline"===x;function le(t){const n=t?V.forward:V.back;if("auto"===y&&!n&&!ie)return e("span",{});const o=X?t?"-rotate-90 rtl:rotate-90":"rotate-90 rtl:-rotate-90":t?"":"rotate-180",i="auto"===y&&!n,l=e(r,{variant:R,size:N,color:T,density:A,elevation:1,label:t?S??I.next:z??I.previous,disabled:!n,className:"pointer-events-auto",icon:e("span",{className:d("flex items-center",o),children:e(s,{})}),...re(t)});return ie?e("span",{className:d("flex shrink-0 items-center justify-center",i?"invisible":""),inert:i,children:l}):l}return t("div",{ref:b,className:d("relative flex min-w-0",ie&&X?"flex-row items-stretch":"flex-col",ie?p[N]:"",B),style:{"--n-ring":`var(--neba-${T}-ring)`,...F},...H,children:[oe&&ie?le(!1):null,e("div",{ref:K,tabIndex:0,role:"group","aria-label":W??I.label,className:d("min-h-0 min-w-0 grow",X?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden",C?X?"snap-x snap-mandatory":"snap-y snap-mandatory":"",P?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",j&&(V.back||V.forward)?"cursor-grab data-[dragging]:cursor-grabbing":"","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"),onScroll:G,onPointerDown:function(e){if(!j||"touch"===e.pointerType||0!==e.button)return;ne.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,o=t.scrollLeft,i=t.scrollTop;let l=!1;const s=document.body.style.getPropertyValue("-webkit-user-select"),a=e=>{const s=e.clientX-n,a=e.clientY-r;if(!l){if(Math.abs(X?s:a)<4)return;l=!0,t.setPointerCapture(e.pointerId),t.dataset.dragging="true",document.body.style.setProperty("-webkit-user-select","none")}X?t.scrollLeft=o-s:t.scrollTop=i-a},c=()=>{ne.current=null,t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",c),delete t.dataset.dragging,s?document.body.style.setProperty("-webkit-user-select",s):document.body.style.removeProperty("-webkit-user-select")},u=()=>{const e=l;if(c(),!e)return;const n=e=>{e.stopPropagation(),e.preventDefault()};t.addEventListener("click",n,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener("click",n,!0),0)};ne.current=c,t.addEventListener("pointermove",a),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",c)},children:e("div",{ref:_,className:d(C?"[&>*]:snap-start":""),style:{display:"grid",gap:o(h),gridAutoFlow:X?"column":"row",...X?{width:"max-content",gridTemplateRows:`repeat(${$}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${$}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:Y})}),oe&&ie?le(!0):null,oe&&!ie?t("div",{className:d("pointer-events-none absolute inset-0 flex justify-between",X?"items-center":"flex-col items-center",m[N]),children:[le(!1),le(!0)]}):null]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{IconButton as r}from"../icon-button/IconButton.js";import{spacingValue as o}from"../../internal/grid.js";import{scrollMessages as i,useMessages as l}from"../../internal/i18n.js";import{ChevronIcon as s}from"../../internal/icons.js";import{queryMatches as a,reducedMotionQuery as c}from"../../internal/media.js";import{observeResize as u}from"../../internal/observe.js";import{cx as d}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";const m={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-3",xl:"p-4"},p={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-3",xl:"gap-4"};export const ScrollZone=/*@__PURE__*/n.forwardRef(function(v,b){const{orientation:w="horizontal",lines:g=1,spacing:h=2,buttons:y="auto",buttonPlacement:x="inline",mode:k="item",step:L=1,speed:E=900,snap:C=!1,drag:j=!0,wheel:M=!1,scrollbar:P=!1,variant:R="solid",size:N="md",color:T="primary",density:A="default",locale:D,label:W,previousLabel:z,nextLabel:S,className:B,style:F,children:Y,...H}=f(v,["size","density","variant","locale"]),I=l(i,D),X="horizontal"===w,$=Math.max(1,Math.round(g)),q=Math.max(1,Math.round(L)),K=n.useRef(null),_=n.useRef(null),[V,Z]=n.useState({back:!1,forward:!1}),G=n.useCallback(()=>{const e=K.current;if(!e)return;const t=X?e.clientWidth:e.clientHeight,n=X?e.scrollWidth:e.scrollHeight,r=Math.abs(X?e.scrollLeft:e.scrollTop);Z(e=>{const o=r>1,i=n-t-r>1;return e.back===o&&e.forward===i?e:{back:o,forward:i}})},[X]);n.useEffect(()=>{const e=K.current,t=_.current;if(!e)return;G();const n=[u(e,G),t?u(t,G):null];return()=>{for(const e of n)e?.()}},[G]);const J=n.useCallback(()=>{const e=K.current;return e&&X&&"rtl"===getComputedStyle(e).direction?-1:1},[X]),O=n.useCallback((e,t)=>{const n=K.current;if(!n)return;const r=t?a(c)?"auto":"smooth":"auto";n.scrollBy(X?{left:e,behavior:r}:{top:e,behavior:r})},[X]),Q=n.useCallback(()=>{const e=K.current,t=_.current;if(!e||!t)return[];const n=X&&"rtl"===getComputedStyle(e).direction,r=X?n?"right":"left":"top",o=n?-1:1,i=e.getBoundingClientRect()[r],l=[];for(const e of Array.from(t.children)){const t=Math.round((e.getBoundingClientRect()[r]-i)*o);l.includes(t)||l.push(t)}return l.sort((e,t)=>e-t)},[X]),U=n.useCallback((e,t=k)=>{const n=K.current;if(!n)return;const r=J(),o=X?n.clientWidth:n.clientHeight;if("page"===t)return void O(o*(e?1:-1)*r,!0);const i=Q(),l=i.filter(e=>e>1),s=i.filter(e=>e<-1),a=e?l[q-1]:s[s.length-q];O(void 0!==a?a*r:o*(e?1:-1)*r,!0)},[J,X,Q,q,k,O]),ee=n.useRef(null);n.useEffect(()=>()=>ee.current?.(),[]);const te=n.useCallback((e,t)=>{if(ee.current)return;const n=J(),r=performance.now();let o=r,i=0;const l=t=>{const r=t-o;o=t,O(E*r/1e3*(e?1:-1)*n,!1),i=requestAnimationFrame(l)};i=requestAnimationFrame(l);const s=()=>{cancelAnimationFrame(i),ee.current=null,window.removeEventListener(t,s),window.removeEventListener("pointercancel",s),window.removeEventListener("blur",s),performance.now()-r<140&&U(e,"item")};ee.current=s,window.addEventListener(t,s),window.addEventListener("pointercancel",s),window.addEventListener("blur",s)},[U,J,O,E]),ne=n.useRef(null);function re(e){return"hold"!==k?{onClick:()=>U(e)}:{onPointerDown:t=>{0===t.button&&te(e,"pointerup")},onKeyDown:t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),te(e,"keyup"))}}}n.useEffect(()=>()=>ne.current?.(),[]),n.useEffect(()=>{const e=K.current;if(!e||!M||!X)return;const t=t=>{if(t.ctrlKey||Math.abs(t.deltaX)>Math.abs(t.deltaY))return;const n=1===t.deltaMode?16:2===t.deltaMode?e.clientWidth:1,r=t.deltaY*n;if(!r)return;const o=Math.abs(e.scrollLeft);(r>0?e.scrollWidth-e.clientWidth-o>1:o>1)&&(t.preventDefault(),O(r*J(),!1))};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[J,X,O,M]);const oe="none"!==y&&("always"===y||V.back||V.forward),ie="inline"===x;function le(t){const n=t?V.forward:V.back;if("auto"===y&&!n&&!ie)return e("span",{});const o=X?t?"-rotate-90 rtl:rotate-90":"rotate-90 rtl:-rotate-90":t?"":"rotate-180",i=e(r,{variant:R,size:N,color:T,density:A,elevation:1,label:t?S??I.next:z??I.previous,disabled:!n,className:"pointer-events-auto",icon:e("span",{className:d("flex items-center",o),children:e(s,{})}),...re(t)});return ie?e("span",{className:"flex shrink-0 items-center justify-center",children:i}):i}return t("div",{ref:b,className:d("relative flex min-w-0",ie&&X?"flex-row items-stretch":"flex-col",ie?p[N]:"",B),style:{"--n-ring":`var(--neba-${T}-ring)`,...F},...H,children:[oe&&ie?le(!1):null,e("div",{ref:K,tabIndex:0,role:"group","aria-label":W??I.label,className:d("min-h-0 min-w-0 grow",X?"overflow-x-auto overflow-y-hidden":"overflow-y-auto overflow-x-hidden",C?X?"snap-x snap-mandatory":"snap-y snap-mandatory":"",P?"":"[scrollbar-width:none] [&::-webkit-scrollbar]:hidden",j&&(V.back||V.forward)?"cursor-grab data-[dragging]:cursor-grabbing":"","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"),onScroll:G,onPointerDown:function(e){if(!j||"touch"===e.pointerType||0!==e.button)return;ne.current?.();const t=e.currentTarget,n=e.clientX,r=e.clientY,o=t.scrollLeft,i=t.scrollTop;let l=!1;const s=document.body.style.getPropertyValue("-webkit-user-select"),a=e=>{const s=e.clientX-n,a=e.clientY-r;if(!l){if(Math.abs(X?s:a)<4)return;l=!0,t.setPointerCapture(e.pointerId),t.dataset.dragging="true",document.body.style.setProperty("-webkit-user-select","none")}X?t.scrollLeft=o-s:t.scrollTop=i-a},c=()=>{ne.current=null,t.removeEventListener("pointermove",a),t.removeEventListener("pointerup",u),t.removeEventListener("pointercancel",c),delete t.dataset.dragging,s?document.body.style.setProperty("-webkit-user-select",s):document.body.style.removeProperty("-webkit-user-select")},u=()=>{const e=l;if(c(),!e)return;const n=e=>{e.stopPropagation(),e.preventDefault()};t.addEventListener("click",n,{capture:!0,once:!0}),window.setTimeout(()=>t.removeEventListener("click",n,!0),0)};ne.current=c,t.addEventListener("pointermove",a),t.addEventListener("pointerup",u),t.addEventListener("pointercancel",c)},children:e("div",{ref:_,className:d(C?"[&>*]:snap-start":""),style:{display:"grid",gap:o(h),gridAutoFlow:X?"column":"row",...X?{width:"max-content",gridTemplateRows:`repeat(${$}, auto)`,gridAutoColumns:"max-content"}:{gridTemplateColumns:`repeat(${$}, minmax(0, 1fr))`,gridAutoRows:"max-content"}},children:Y})}),oe&&ie?le(!0):null,oe&&!ie?t("div",{className:d("pointer-events-none absolute inset-0 flex justify-between",X?"items-center":"flex-col items-center",m[N]),children:[le(!1),le(!0)]}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Select as l}from"@base-ui/react/select";import{Field as n}from"@base-ui/react/field";import{CheckIcon as r,ChevronIcon as i}from"../../internal/icons.js";import{WidthSizer as s}from"../../internal/sizer.js";import{controlHeightClasses as o,controlTextLeadingClasses as c,cx as d,disabledClasses as m,fieldReadOnlyClasses as u,fieldRestClasses as f,focusWithinRingClasses as h,gapClasses as p,hasContent as b,iconClasses as g,metaTextClasses as x,paddingXClasses as v,radiusClasses as N,stackGapClasses as j,surfaceClasses as w,surfaceSlots as y,transitionClasses as I}from"../../internal/styles.js";import{useStyleDefaults as S}from"../../internal/defaults.js";const z=["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",I,"focus-within:[transition-duration:0ms]",h,g].join(" "),V=[w,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","min-w-[var(--anchor-width)] border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]"].join(" "),k=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",I,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-accent)","data-[selected]:text-(--n-accent) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" ");export const Select=/*@__PURE__*/t.forwardRef(function(h,g){const{variant:w="outline",size:I="md",color:O="primary",density:P="default",elevation:R=0,items:T,value:q,defaultValue:C,onValueChange:M,placeholder:W,label:_,description:D,error:E,invalid:L,startIcon:$,fullWidth:A=!1,disabled:B=!1,readOnly:F=!1,required:G=!1,name:H,id:J,className:K,classNames:Q,style:U,...X}=S(h,["size","density","variant"]),Y=null!=E&&!1!==E&&""!==E,Z=L??Y,ee=Z?"danger":O,ae=t.useMemo(()=>T.map(e=>({label:e.label??String(e.value),value:e.value})),[T]),te=t.useMemo(()=>[...T.map(e=>e.label??String(e.value)),...b(W)?[W]:[]],[T,W]);return a(n.Root,{disabled:B,invalid:Z,className:d("flex-col align-top",j[I],A?"flex w-full":"inline-flex",K??""),style:{...y(ee,R),...U},...X,children:[_?e(n.Label,{className:d(x[I],"font-medium",B?"text-(--neba-disabled-fg)":"text-(--neba-fg)",Q?.label),children:_}):null,a(l.Root,{id:J,name:H,items:ae,value:q,defaultValue:C,onValueChange:e=>M?.(e),disabled:B,readOnly:F,required:G,children:[a(l.Trigger,{ref:g,className:d(z,o[I],c[I],N[I],p[I],v[P][I],B?m[w]:F?`${u[w]} cursor-default`:f[w],Q?.control),children:[$?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:$}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(l.Value,{className:["w-full truncate text-start","data-[placeholder]:text-(--neba-muted-fg)"].join(" "),placeholder:W}),e(s,{samples:te})]}),e(l.Icon,{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(i,{})})]}),e(l.Portal,{children:e(l.Positioner,{className:"neba-portal z-50 [outline:none]",sideOffset:6,alignItemWithTrigger:!1,children:e(l.Popup,{className:d(V,N[I],c[I],Q?.popup),style:y(ee,3),children:T.map(t=>a(l.Item,{value:t.value,disabled:t.disabled,className:d(k,Q?.item),children:[e(l.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(r,{})}),e(l.ItemText,{className:"truncate",children:t.label??String(t.value)})]},String(t.value)))})})})]}),D?e(n.Description,{className:d(x[I],"text-(--neba-muted-fg)",Q?.description),children:D}):null,e(n.Error,Y?{match:!0,className:d(x[I],"text-(--n-accent)",Q?.error),children:E}:{className:d(x[I],"text-(--n-accent)",Q?.error)})]})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Select as l}from"@base-ui/react/select";import{Field as n}from"@base-ui/react/field";import{CheckIcon as r,ChevronIcon as i}from"../../internal/icons.js";import{WidthSizer as s}from"../../internal/sizer.js";import{controlHeightClasses as o,controlTextLeadingClasses as c,cx as d,disabledClasses as m,fieldReadOnlyClasses as u,fieldRestClasses as f,focusWithinRingClasses as h,gapClasses as p,hasContent as b,iconClasses as g,metaTextClasses as x,paddingXClasses as v,popupFadeClasses as N,radiusClasses as j,stackGapClasses as w,surfaceClasses as y,surfaceSlots as I,transitionClasses as S}from"../../internal/styles.js";import{useStyleDefaults as z}from"../../internal/defaults.js";const V=["group relative flex w-full cursor-pointer items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",S,"focus-within:[transition-duration:0ms]",h,g].join(" "),k=[y,"max-h-[min(20rem,var(--available-height))] overflow-y-auto overscroll-contain","min-w-[var(--anchor-width)] border bg-(--n-panel-press) p-1","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",N].join(" "),O=["relative flex cursor-pointer items-center gap-2 select-none","rounded-(--neba-radius-xs) py-1.5 pe-2 ps-7",S,"data-[highlighted]:bg-(--n-soft-hover) data-[highlighted]:text-(--n-accent)","data-[selected]:text-(--n-accent) data-[selected]:font-medium","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]"].join(" ");export const Select=/*@__PURE__*/t.forwardRef(function(h,g){const{variant:N="outline",size:y="md",color:S="primary",density:P="default",elevation:R=0,items:T,value:q,defaultValue:C,onValueChange:M,placeholder:W,label:_,description:D,error:E,invalid:L,startIcon:$,fullWidth:A=!1,disabled:B=!1,readOnly:F=!1,required:G=!1,name:H,id:J,className:K,classNames:Q,style:U,...X}=z(h,["size","density","variant"]),Y=null!=E&&!1!==E&&""!==E,Z=L??Y,ee=Z?"danger":S,ae=t.useMemo(()=>T.map(e=>({label:e.label??String(e.value),value:e.value})),[T]),te=t.useMemo(()=>[...T.map(e=>e.label??String(e.value)),...b(W)?[W]:[]],[T,W]);return a(n.Root,{disabled:B,invalid:Z,className:d("flex-col align-top",w[y],A?"flex w-full":"inline-flex",K??""),style:{...I(ee,R),...U},...X,children:[_?e(n.Label,{className:d(x[y],"font-medium",B?"text-(--neba-disabled-fg)":"text-(--neba-fg)",Q?.label),children:_}):null,a(l.Root,{id:J,name:H,items:ae,value:q,defaultValue:C,onValueChange:e=>M?.(e),disabled:B,readOnly:F,required:G,children:[a(l.Trigger,{ref:g,className:d(V,o[y],c[y],j[y],p[y],v[P][y],B?m[N]:F?`${u[N]} cursor-default`:f[N],Q?.control),children:[$?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:$}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e(l.Value,{className:["w-full truncate text-start","data-[placeholder]:text-(--neba-muted-fg)"].join(" "),placeholder:W}),e(s,{samples:te})]}),e(l.Icon,{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[popup-open]:rotate-180"].join(" "),children:e(i,{})})]}),e(l.Portal,{children:e(l.Positioner,{className:"neba-portal z-50 [outline:none]",sideOffset:6,alignItemWithTrigger:!1,children:e(l.Popup,{className:d(k,j[y],c[y],Q?.popup),style:I(ee,3),children:T.map(t=>a(l.Item,{value:t.value,disabled:t.disabled,className:d(O,Q?.item),children:[e(l.ItemIndicator,{className:"absolute start-1.5 flex size-4 items-center justify-center",children:e(r,{})}),e(l.ItemText,{className:"truncate",children:t.label??String(t.value)})]},String(t.value)))})})})]}),D?e(n.Description,{className:d(x[y],"text-(--neba-muted-fg)",Q?.description),children:D}):null,e(n.Error,Y?{match:!0,className:d(x[y],"text-(--n-accent)",Q?.error),children:E}:{className:d(x[y],"text-(--n-accent)",Q?.error)})]})});
@@ -0,0 +1,60 @@
1
+ import * as React from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import type { NebaBreakpoint } from '../../types.js';
4
+ export interface ShowProps extends React.ComponentPropsWithoutRef<'div'> {
5
+ /**
6
+ * The narrowest width the children are drawn at, inclusive. Below it they
7
+ * are not drawn.
8
+ *
9
+ * `above="md"` is the desktop half of a pair; `xs` is a floor of zero and so
10
+ * means "always", which is what makes it safe to pass a value straight
11
+ * through from a variable.
12
+ */
13
+ above?: NebaBreakpoint;
14
+ /**
15
+ * The width at which the children stop being drawn, exclusive — so
16
+ * `below="md"` is drawn under 48rem and not at it, and pairs exactly with
17
+ * `above="md"` to cover every width once.
18
+ *
19
+ * `below="xs"` draws nothing at all: there is no width under a floor of zero.
20
+ */
21
+ below?: NebaBreakpoint;
22
+ /**
23
+ * Renders something other than a `<div>`: `render={<li />}`,
24
+ * `render={<td />}`. Base UI's own escape hatch, and the way to put this
25
+ * somewhere a `<div>` is not allowed.
26
+ */
27
+ render?: useRender.RenderProp;
28
+ children?: React.ReactNode;
29
+ }
30
+ /**
31
+ * Its children at some widths and not at others.
32
+ *
33
+ * `above` and `below` are a floor and a ceiling on the same ladder every other
34
+ * breakpoint in the library uses, and they compose: `above="sm" below="lg"` is
35
+ * drawn from 40rem up to but not including 64rem. Either alone is the common
36
+ * case — a pair of them, with the same breakpoint in both, is the two halves of
37
+ * one decision and covers every width exactly once.
38
+ *
39
+ * **The children are always rendered.** What changes is `display`, which is
40
+ * deliberate on both sides of it: the answer is right in the first frame the
41
+ * browser paints, so nothing flashes and nothing has to wait for JavaScript to
42
+ * find out how wide the window is, and it is the same answer on a server, where
43
+ * there is no window to ask. It also costs nothing to change — a resize repaints
44
+ * rather than re-rendering React.
45
+ *
46
+ * That is also its limit. A component that must not *run* below a width — one
47
+ * that fetches, or that mounts a map — is a decision CSS cannot make, and
48
+ * `useBreakpoint` is what makes it:
49
+ *
50
+ * ```tsx
51
+ * {useBreakpoint('md') && <Map />}
52
+ * ```
53
+ *
54
+ * The wrapper is `display: contents`, so it adds no box: a `Show` inside a
55
+ * `GridContainer` leaves its children as grid items, and one inside a flex row
56
+ * leaves them as flex items. Nothing it is given to style — padding, a
57
+ * background — would have anywhere to land, so put those on an element inside
58
+ * it or name the element with `render`.
59
+ */
60
+ export declare const Show: React.ForwardRefExoticComponent<ShowProps & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ "use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{hiddenBelowClasses as o,hiddenFromClasses as n}from"../../internal/responsive.js";import{cx as s}from"../../internal/styles.js";export const Show=/*@__PURE__*/e.forwardRef(function({above:e,below:t,render:a,className:i,children:c,...m},l){const f=s("contents",e?o[e]:"",t?n[t]:"",i??"");return r({render:a,ref:l,props:{className:f,children:c,...m}})});
@@ -0,0 +1,2 @@
1
+ export { Show } from './Show.js';
2
+ export type { ShowProps } from './Show.js';
@@ -0,0 +1 @@
1
+ export{Show}from"./Show.js";
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{boxPaddingXClasses as n,boxPaddingYClasses as o}from"../box/Box.js";import{Drawer as a}from"../drawer/Drawer.js";import{beginPointerDrag as i}from"../../internal/drag.js";import{layoutMessages as l,useMessages as s}from"../../internal/i18n.js";import{drawerSide as d,expandedOnlyClasses as c,PageLayoutContext as u,SidebarSideContext as p,useCollapsed as f}from"../../internal/page-layout.js";import{cx as m,surfaceClasses as b,surfaceSlots as v,toLength as g,toPixels as h,transitionClasses as x}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={xs:"11rem",sm:"13rem",md:"16rem",lg:"18rem",xl:"21rem"},j={solid:[b,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[b,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Sidebar=/*@__PURE__*/r.forwardRef(function(b,z){const{side:C,width:R,minWidth:k=160,maxWidth:S=480,resizable:B=!1,onResize:N,onResizeEnd:O,collapseBelow:D,open:M,defaultOpen:A=!1,onOpenChange:E,sticky:I=!0,title:T,variant:W="outline",size:L="md",color:P="primary",density:X="default",elevation:_=0,divider:K=!0,padded:$=!0,label:q,locale:F,className:G,style:H,children:J,...Q}=y(b,["size","density","variant","locale"]),U=r.useContext(u),V=r.useContext(p),Y=C??V??"start",Z=F??U.locale,ee=s(l,Z),te=D??(U.present?U.collapseBelow:"none"),re=f(te),[ne,oe]=r.useState(A),ae=void 0!==M,ie=ae?M:U.present?U.open[Y]:ne,le=e=>{ae||(U.present?U.setOpen(Y,e):oe(e)),E?.(e)},se=g(R)??w[L],de=r.useRef(null),ce=r.useCallback(e=>{de.current=e,"function"==typeof z?z(e):z&&(z.current=e)},[z]),ue=r.useRef(null);r.useEffect(()=>()=>ue.current?.(),[]);const pe=e=>{const t=de.current;if(!t)return e;const r=(e,r)=>null==e?r:"number"==typeof e?e:h(e,{percentOf:"undefined"==typeof window?0:window.innerWidth,relativeTo:t})??r,n=Math.min(r(S,480),Math.max(r(k,160),Math.round(e)));return t.style.setProperty("--n-sidebar-w",`${n}px`),n},fe=e("div",{className:m("min-h-0 flex-1 overflow-y-auto overscroll-contain",$?m(n[X][L],o[X][L]):""),children:J});return re?e(a,{side:d(Y),mode:"overlay",open:ie,onOpenChange:le,title:T,size:L,color:P,density:X,locale:Z,closeLabel:ee.closeSidebar,extent:void 0===R?void 0:se,"aria-label":T?void 0:q??ee.sidebar,className:G,style:H,children:J}):t("aside",{ref:ce,"aria-label":q??ee.sidebar,className:m("relative flex min-w-0 shrink-0 flex-col","w-(--n-sidebar-w)",j[W],K?m("start"===Y?"border-e":"border-s","[border-color:var(--n-line)]"):"","content"===U.scroll?"h-full":I?m("self-start","sticky [top:var(--n-layout-header,0px)]","[height:calc(100dvh-var(--n-layout-header,0px)-var(--n-layout-footer,0px))]"):"",c[te],x,G),style:{...v(P,_),"--n-sidebar-w":se,...H},...Q,children:[fe,B?e("div",{role:"separator","aria-orientation":"vertical","aria-label":ee.resizeSidebar,tabIndex:0,className:m("absolute inset-y-0 z-1 w-2 cursor-col-resize","start"===Y?"end-0 -me-1":"start-0 -ms-1","bg-transparent hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)",x,"[outline:none] focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0"),onPointerDown:e=>{const t=de.current;if(!t||0!==e.button)return;const r=e.currentTarget,n=e.clientX,o=t.getBoundingClientRect().width,a="rtl"===getComputedStyle(t).direction,l="start"===Y===a?-1:1;let s=o;ue.current=i({target:r,pointerId:e.pointerId,onMove:e=>{s=pe(o+(e.clientX-n)*l),N?.(s)},onEnd:()=>{ue.current=null,O?.(s)}})},onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const t="rtl"===getComputedStyle(e.currentTarget).direction,r="start"===Y===t?-1:1;(e=>{const t=de.current;if(!t)return;const r=pe(t.getBoundingClientRect().width+e);N?.(r),O?.(r)})(("ArrowRight"===e.key?16:-16)*r)}}):null]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{boxPaddingXClasses as n,boxPaddingYClasses as o}from"../box/Box.js";import{Drawer as a}from"../drawer/Drawer.js";import{beginPointerDrag as i}from"../../internal/drag.js";import{layoutMessages as l,useMessages as s}from"../../internal/i18n.js";import{drawerSide as d,expandedOnlyClasses as c,PageLayoutContext as u,SidebarSideContext as p,useCollapsed as f}from"../../internal/page-layout.js";import{cx as m,surfaceClasses as b,surfaceSlots as v,toLength as g,toPixels as h,transitionClasses as x}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={xs:"11rem",sm:"13rem",md:"16rem",lg:"18rem",xl:"21rem"},j={solid:[b,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[b,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Sidebar=/*@__PURE__*/r.forwardRef(function(b,z){const{side:C,width:R,minWidth:k=160,maxWidth:S=480,resizable:B=!1,onResize:N,onResizeEnd:O,collapseBelow:D,open:M,defaultOpen:A=!1,onOpenChange:E,sticky:I=!0,title:T,variant:W="outline",size:L="md",color:P="primary",density:X="default",elevation:_=0,divider:K=!0,padded:$=!0,label:q,locale:F,className:G,style:H,children:J,...Q}=y(b,["size","density","variant","locale"]),U=r.useContext(u),V=r.useContext(p),Y=C??V??"start",Z=F??U.locale,ee=s(l,Z),te=D??(U.present?U.collapseBelow:"none"),re=f(te),[ne,oe]=r.useState(A),ae=void 0!==M,ie=ae?M:U.present?U.open[Y]:ne,le=e=>{ae||(U.present?U.setOpen(Y,e):oe(e)),E?.(e)},se=g(R)??w[L],de=r.useRef(null),ce=r.useCallback(e=>{de.current=e,"function"==typeof z?z(e):z&&(z.current=e)},[z]),ue=r.useRef(null);r.useEffect(()=>()=>ue.current?.(),[]);const pe=e=>{const t=de.current;if(!t)return e;const r=(e,r)=>null==e?r:"number"==typeof e?e:h(e,{percentOf:"undefined"==typeof window?0:window.innerWidth,relativeTo:t})??r,n=Math.min(r(S,480),Math.max(r(k,160),Math.round(e)));return t.style.setProperty("--n-sidebar-w",`${n}px`),n},fe=e("div",{className:m("min-h-0 flex-1 overflow-y-auto overscroll-contain",$?m(n[X][L],o[X][L]):""),children:J});return re?e(a,{side:d(Y),mode:"overlay",open:ie,onOpenChange:le,title:T,size:L,color:P,density:X,locale:Z,closeLabel:ee.closeSidebar,extent:void 0===R?void 0:se,"aria-label":T?void 0:q??ee.sidebar,className:G,style:H,...Q,children:J}):t("aside",{ref:ce,"aria-label":q??ee.sidebar,className:m("relative flex min-w-0 shrink-0 flex-col","w-(--n-sidebar-w)",j[W],K?m("start"===Y?"border-e":"border-s","[border-color:var(--n-line)]"):"","content"===U.scroll?"h-full":I?m("self-start","sticky [top:var(--n-layout-header,0px)]","[height:calc(100dvh-var(--n-layout-header,0px)-var(--n-layout-footer,0px))]"):"",c[te],x,G),style:{...v(P,_),"--n-sidebar-w":se,...H},...Q,children:[fe,B?e("div",{role:"separator","aria-orientation":"vertical","aria-label":ee.resizeSidebar,tabIndex:0,className:m("absolute inset-y-0 z-1 w-2 cursor-col-resize","start"===Y?"end-0 -me-1":"start-0 -ms-1","bg-transparent hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)",x,"[outline:none] focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0"),onPointerDown:e=>{const t=de.current;if(!t||0!==e.button)return;const r=e.currentTarget,n=e.clientX,o=t.getBoundingClientRect().width,a="rtl"===getComputedStyle(t).direction,l="start"===Y===a?-1:1;let s=o;ue.current=i({target:r,pointerId:e.pointerId,onMove:e=>{s=pe(o+(e.clientX-n)*l),N?.(s)},onEnd:()=>{ue.current=null,O?.(s)}})},onKeyDown:e=>{if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.preventDefault();const t="rtl"===getComputedStyle(e.currentTarget).direction,r="start"===Y===t?-1:1;(e=>{const t=de.current;if(!t)return;const r=pe(t.getBoundingClientRect().width+e);N?.(r),O?.(r)})(("ArrowRight"===e.key?16:-16)*r)}}):null]})});
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{Button as r}from"../button/Button.js";import{spoilerMessages as i,useMessages as t}from"../../internal/i18n.js";import{boxPaddingClasses as l,boxPaddingXClasses as o,boxPaddingYClasses as s}from"../box/Box.js";import{cx as d,hasContent as c,metaTextClasses as m,radiusClasses as v,surfaceClasses as u,surfaceSlots as f,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const x={solid:[u,"bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[u,"border bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"bg-transparent"},h="[background-color:color-mix(in_oklab,var(--neba-surface)_55%,transparent)]";export const Spoiler=/*@__PURE__*/n.forwardRef(function(u,j){const{revealed:y,defaultRevealed:g=!1,onRevealedChange:w,locale:N,label:z,hideLabel:k,description:_,action:C,reversible:R=!1,maxHeight:B,blur:H=10,padded:S=!0,variant:$="outline",size:I="md",color:L="primary",density:q="default",elevation:A=0,className:D,style:E,children:F,...G}=b(u,["size","density","variant","locale"]),J=t(i,N),K=n.useId(),[M,O]=n.useState(g),P=y??M,Q=e=>{void 0===y&&O(e),w?.(e)},T=!1===_?null:_??J.notice;return a("div",{ref:j,className:d("relative isolate overflow-hidden",v[I],x[$],p,D??""),style:{...f(L,A),...E},...G,children:[e("div",{id:K,className:d("min-w-0",S?l[q][I]:"","[transition:filter_var(--neba-duration-fill)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]",P?"":"select-none"),style:{filter:P?void 0:`blur(${H}px)`,maxHeight:P?void 0:B,overflow:P?void 0:"hidden"},inert:!P,children:F}),P?null:a("div",{className:["absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 text-center",l[q][I],h].join(" "),children:[c(T)?e("p",{className:`m-0 text-(--neba-muted-fg) ${m[I]}`,children:T}):null,C??e(r,{size:I,color:L,density:q,onClick:()=>Q(!0),"aria-expanded":!1,"aria-controls":K,children:z??J.reveal})]}),P&&R?e("div",{className:["flex justify-end",o[q][I],s[q][I],"pt-0"].join(" "),children:e(r,{variant:"text",size:I,color:L,density:q,onClick:()=>Q(!1),"aria-expanded":!0,"aria-controls":K,children:k??J.hide})}):null]})});
1
+ "use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import*as r from"react";import{Button as a}from"../button/Button.js";import{spoilerMessages as n,useMessages as t}from"../../internal/i18n.js";import{boxPaddingClasses as l,boxPaddingXClasses as o,boxPaddingYClasses as s}from"../box/Box.js";import{cx as d,hasContent as c,metaTextClasses as m,radiusClasses as v,surfaceClasses as u,surfaceSlots as f,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const x={solid:[u,"bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[u,"border bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"bg-transparent"};export const Spoiler=/*@__PURE__*/r.forwardRef(function(u,h){const{revealed:g,defaultRevealed:j=!1,onRevealedChange:y,locale:w,label:N,hideLabel:z,description:C,action:R,reversible:k=!1,maxHeight:_,blur:A=10,padded:B=!0,variant:H="outline",size:S="md",color:T="primary",density:$="default",elevation:I=0,className:L,style:q,children:D,...E}=b(u,["size","density","variant","locale"]),F=t(n,w),G=r.useId(),[J,K]=r.useState(j),M=g??J,O=e=>{void 0===g&&K(e),y?.(e)},P=!1===C?null:C??F.notice;return i("div",{ref:h,className:d("isolate grid overflow-hidden",v[S],x[H],p,L??""),style:{gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:k?"auto auto":"auto",...f(T,I),...q},...E,children:[e("div",{id:G,className:d("min-w-0",B?l[$][S]:"","[transition:filter_var(--neba-duration-fill)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]",M?"":"select-none"),style:{gridArea:"1 / 1",filter:M?void 0:`blur(${A}px)`,maxHeight:M?void 0:_,overflow:M?void 0:"hidden"},inert:!M,children:D}),k?e("div",{className:[M?"":"invisible","flex justify-end",o[$][S],s[$][S],"pt-0"].join(" "),style:{gridArea:"2 / 1"},inert:!M,children:e(a,{variant:"text",size:S,color:T,density:$,onClick:()=>O(!1),"aria-expanded":!0,"aria-controls":G,children:z??F.hide})}):null,i("div",{className:d("z-10 flex flex-col items-center justify-center gap-2 text-center",l[$][S],M?"invisible":"[background-color:color-mix(in_oklab,var(--neba-surface)_55%,transparent)]"),style:{gridRow:"1 / -1",gridColumn:"1"},inert:M,children:[c(P)?e("p",{className:`m-0 text-(--neba-muted-fg) ${m[S]}`,children:P}):null,R??e(a,{size:S,color:T,density:$,onClick:()=>O(!0),"aria-expanded":!1,"aria-controls":G,children:N??F.reveal})]})]})});