neba 1.8.0 → 1.9.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 (222) hide show
  1. package/README.md +13 -7
  2. package/dist/components/accordion/Accordion.js +1 -1
  3. package/dist/components/alert/Alert.js +1 -1
  4. package/dist/components/anchor/Anchor.d.ts +73 -0
  5. package/dist/components/anchor/Anchor.js +1 -0
  6. package/dist/components/anchor/index.d.ts +2 -0
  7. package/dist/components/anchor/index.js +1 -0
  8. package/dist/components/animate-appear/AnimateAppear.js +1 -1
  9. package/dist/components/animate-blink/AnimateBlink.js +1 -1
  10. package/dist/components/animate-fade/AnimateFade.js +1 -1
  11. package/dist/components/animate-grow/AnimateGrow.js +1 -1
  12. package/dist/components/animate-headline/AnimateHeadline.js +1 -1
  13. package/dist/components/animate-lighting/AnimateLighting.js +1 -1
  14. package/dist/components/animate-marquee/AnimateMarquee.js +1 -1
  15. package/dist/components/animate-rotate/AnimateRotate.js +1 -1
  16. package/dist/components/animate-slide/AnimateSlide.js +1 -1
  17. package/dist/components/animate-typing/AnimateTyping.js +1 -1
  18. package/dist/components/animate-zoom/AnimateZoom.js +1 -1
  19. package/dist/components/app-logo/AppLogo.js +1 -1
  20. package/dist/components/area-chart/AreaChart.js +1 -1
  21. package/dist/components/aspect-ratio/AspectRatio.js +1 -1
  22. package/dist/components/avatar/Avatar.js +1 -1
  23. package/dist/components/avatar-group/AvatarGroup.d.ts +47 -0
  24. package/dist/components/avatar-group/AvatarGroup.js +1 -0
  25. package/dist/components/avatar-group/index.d.ts +2 -0
  26. package/dist/components/avatar-group/index.js +1 -0
  27. package/dist/components/badge/Badge.js +1 -1
  28. package/dist/components/bar-chart/BarChart.js +1 -1
  29. package/dist/components/blockquote/Blockquote.js +1 -1
  30. package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
  31. package/dist/components/box/Box.js +1 -1
  32. package/dist/components/breadcrumb/Breadcrumb.js +1 -1
  33. package/dist/components/button/Button.js +1 -1
  34. package/dist/components/button-group/ButtonGroup.js +1 -1
  35. package/dist/components/card/Card.js +1 -1
  36. package/dist/components/carousel/Carousel.js +1 -1
  37. package/dist/components/chat-bubble/ChatBubble.js +1 -1
  38. package/dist/components/checkbox/Checkbox.js +1 -1
  39. package/dist/components/chip/Chip.js +1 -1
  40. package/dist/components/code-block/CodeBlock.js +1 -1
  41. package/dist/components/collapsible/Collapsible.js +1 -1
  42. package/dist/components/color-picker/ColorPicker.js +1 -1
  43. package/dist/components/combobox/Combobox.js +1 -1
  44. package/dist/components/command-palette/CommandPalette.d.ts +88 -0
  45. package/dist/components/command-palette/CommandPalette.js +1 -0
  46. package/dist/components/command-palette/index.d.ts +2 -0
  47. package/dist/components/command-palette/index.js +1 -0
  48. package/dist/components/container/Container.js +1 -1
  49. package/dist/components/data-list/DataList.d.ts +55 -0
  50. package/dist/components/data-list/DataList.js +1 -0
  51. package/dist/components/data-list/index.d.ts +2 -0
  52. package/dist/components/data-list/index.js +1 -0
  53. package/dist/components/data-table/DataTable.js +1 -1
  54. package/dist/components/date-picker/DatePicker.js +1 -1
  55. package/dist/components/date-range-picker/DateRangePicker.js +1 -1
  56. package/dist/components/date-time-picker/DateTimePicker.js +1 -1
  57. package/dist/components/dialog/Dialog.js +1 -1
  58. package/dist/components/divider/Divider.js +1 -1
  59. package/dist/components/drawer/Drawer.js +1 -1
  60. package/dist/components/empty/Empty.js +1 -1
  61. package/dist/components/fieldset/Fieldset.d.ts +33 -0
  62. package/dist/components/fieldset/Fieldset.js +1 -0
  63. package/dist/components/fieldset/index.d.ts +2 -0
  64. package/dist/components/fieldset/index.js +1 -0
  65. package/dist/components/file-picker/FilePicker.js +1 -1
  66. package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
  67. package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
  68. package/dist/components/footer/Footer.js +1 -1
  69. package/dist/components/form/Form.d.ts +58 -0
  70. package/dist/components/form/Form.js +1 -0
  71. package/dist/components/form/index.d.ts +2 -0
  72. package/dist/components/form/index.js +1 -0
  73. package/dist/components/gauge-chart/GaugeChart.d.ts +62 -0
  74. package/dist/components/gauge-chart/GaugeChart.js +1 -0
  75. package/dist/components/gauge-chart/index.d.ts +2 -0
  76. package/dist/components/gauge-chart/index.js +1 -0
  77. package/dist/components/grid/Grid.js +1 -1
  78. package/dist/components/grid-container/GridContainer.js +1 -1
  79. package/dist/components/header/Header.js +1 -1
  80. package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
  81. package/dist/components/highlight/Highlight.js +1 -1
  82. package/dist/components/hover-card/HoverCard.d.ts +78 -0
  83. package/dist/components/hover-card/HoverCard.js +1 -0
  84. package/dist/components/hover-card/index.d.ts +2 -0
  85. package/dist/components/hover-card/index.js +1 -0
  86. package/dist/components/how-to-steps/HowToSteps.d.ts +11 -25
  87. package/dist/components/how-to-steps/HowToSteps.js +1 -1
  88. package/dist/components/icon/Icon.js +1 -1
  89. package/dist/components/icon-button/IconButton.js +1 -1
  90. package/dist/components/line-chart/LineChart.js +1 -1
  91. package/dist/components/list/List.js +1 -1
  92. package/dist/components/menu/Menu.d.ts +16 -4
  93. package/dist/components/menu/Menu.js +1 -1
  94. package/dist/components/menubar/Menubar.d.ts +56 -0
  95. package/dist/components/menubar/Menubar.js +1 -0
  96. package/dist/components/menubar/index.d.ts +2 -0
  97. package/dist/components/menubar/index.js +1 -0
  98. package/dist/components/meter/Meter.d.ts +52 -0
  99. package/dist/components/meter/Meter.js +1 -0
  100. package/dist/components/meter/index.d.ts +2 -0
  101. package/dist/components/meter/index.js +1 -0
  102. package/dist/components/mockup/Mockup.js +1 -1
  103. package/dist/components/navigation-menu/NavigationMenu.d.ts +100 -0
  104. package/dist/components/navigation-menu/NavigationMenu.js +1 -0
  105. package/dist/components/navigation-menu/index.d.ts +2 -0
  106. package/dist/components/navigation-menu/index.js +1 -0
  107. package/dist/components/number-field/NumberField.js +1 -1
  108. package/dist/components/otp-field/OtpField.js +1 -1
  109. package/dist/components/overlay/Overlay.js +1 -1
  110. package/dist/components/page-layout/PageLayout.js +1 -1
  111. package/dist/components/pagination/Pagination.js +1 -1
  112. package/dist/components/panes/Panes.js +1 -1
  113. package/dist/components/pie-chart/PieChart.js +1 -1
  114. package/dist/components/pill/Pill.js +1 -1
  115. package/dist/components/popover/Popover.js +1 -1
  116. package/dist/components/progress-box/ProgressBox.js +1 -1
  117. package/dist/components/progress-circular/ProgressCircular.js +1 -1
  118. package/dist/components/progress-linear/ProgressLinear.js +1 -1
  119. package/dist/components/radio-group/RadioGroup.js +1 -1
  120. package/dist/components/rating/Rating.js +1 -1
  121. package/dist/components/scatter-chart/ScatterChart.js +1 -1
  122. package/dist/components/scroll-area/ScrollArea.d.ts +50 -0
  123. package/dist/components/scroll-area/ScrollArea.js +1 -0
  124. package/dist/components/scroll-area/index.d.ts +2 -0
  125. package/dist/components/scroll-area/index.js +1 -0
  126. package/dist/components/scroll-zone/ScrollZone.d.ts +35 -17
  127. package/dist/components/scroll-zone/ScrollZone.js +1 -1
  128. package/dist/components/segmented-button/SegmentedButton.js +1 -1
  129. package/dist/components/select/Select.js +1 -1
  130. package/dist/components/shortcut/Shortcut.js +1 -1
  131. package/dist/components/sidebar/Sidebar.js +1 -1
  132. package/dist/components/sidebar/SidebarTrigger.js +1 -1
  133. package/dist/components/skeleton/Skeleton.js +1 -1
  134. package/dist/components/slider/Slider.js +1 -1
  135. package/dist/components/sparkline/Sparkline.js +1 -1
  136. package/dist/components/spoiler/Spoiler.js +1 -1
  137. package/dist/components/statistic/Statistic.js +1 -1
  138. package/dist/components/switch/Switch.js +1 -1
  139. package/dist/components/table/Table.js +1 -1
  140. package/dist/components/tabs/Tabs.js +1 -1
  141. package/dist/components/text-field/TextField.js +1 -1
  142. package/dist/components/text-link/TextLink.js +1 -1
  143. package/dist/components/time-picker/TimePicker.js +1 -1
  144. package/dist/components/timeline/Timeline.js +1 -1
  145. package/dist/components/timeline-chart/TimelineChart.js +1 -1
  146. package/dist/components/toast/Toast.js +1 -1
  147. package/dist/components/toggle/Toggle.d.ts +53 -0
  148. package/dist/components/toggle/Toggle.js +1 -0
  149. package/dist/components/toggle/index.d.ts +2 -0
  150. package/dist/components/toggle/index.js +1 -0
  151. package/dist/components/toggle-group/ToggleGroup.d.ts +51 -0
  152. package/dist/components/toggle-group/ToggleGroup.js +1 -0
  153. package/dist/components/toggle-group/index.d.ts +2 -0
  154. package/dist/components/toggle-group/index.js +1 -0
  155. package/dist/components/toolbar/Toolbar.js +1 -1
  156. package/dist/components/tooltip/Tooltip.js +1 -1
  157. package/dist/components/tour/Tour.d.ts +82 -0
  158. package/dist/components/tour/Tour.js +1 -0
  159. package/dist/components/tour/index.d.ts +2 -0
  160. package/dist/components/tour/index.js +1 -0
  161. package/dist/components/transfer/Transfer.d.ts +52 -0
  162. package/dist/components/transfer/Transfer.js +1 -0
  163. package/dist/components/transfer/index.d.ts +2 -0
  164. package/dist/components/transfer/index.js +1 -0
  165. package/dist/components/tree-view/TreeView.js +1 -1
  166. package/dist/components/typography/Typography.js +1 -1
  167. package/dist/components/window-pane/WindowPane.js +1 -1
  168. package/dist/index.d.ts +16 -0
  169. package/dist/index.js +1 -1
  170. package/dist/internal/animate.d.ts +7 -1
  171. package/dist/internal/animate.js +1 -1
  172. package/dist/internal/avatar-group.d.ts +22 -0
  173. package/dist/internal/avatar-group.js +1 -0
  174. package/dist/internal/bottom-navigation.js +1 -1
  175. package/dist/internal/button-group.d.ts +6 -2
  176. package/dist/internal/button-group.js +1 -1
  177. package/dist/internal/calendar.js +1 -1
  178. package/dist/internal/chart-frame.d.ts +18 -1
  179. package/dist/internal/chart-frame.js +1 -1
  180. package/dist/internal/data-table.d.ts +0 -14
  181. package/dist/internal/data-table.js +1 -1
  182. package/dist/internal/drag.d.ts +62 -0
  183. package/dist/internal/drag.js +1 -0
  184. package/dist/internal/highlight.js +1 -1
  185. package/dist/internal/i18n.d.ts +82 -0
  186. package/dist/internal/i18n.js +1 -1
  187. package/dist/internal/link.d.ts +19 -0
  188. package/dist/internal/link.js +1 -0
  189. package/dist/internal/media.d.ts +29 -0
  190. package/dist/internal/media.js +1 -0
  191. package/dist/internal/menu.js +1 -1
  192. package/dist/internal/observe.d.ts +42 -0
  193. package/dist/internal/observe.js +1 -0
  194. package/dist/internal/page-layout.js +1 -1
  195. package/dist/internal/picker.js +1 -1
  196. package/dist/internal/progress.d.ts +5 -0
  197. package/dist/internal/search.d.ts +33 -0
  198. package/dist/internal/search.js +1 -0
  199. package/dist/internal/styles.d.ts +39 -0
  200. package/dist/internal/styles.js +1 -1
  201. package/dist/locales/ar.js +1 -1
  202. package/dist/locales/de.js +1 -1
  203. package/dist/locales/es.js +1 -1
  204. package/dist/locales/fr.js +1 -1
  205. package/dist/locales/hi.js +1 -1
  206. package/dist/locales/id.js +1 -1
  207. package/dist/locales/it.js +1 -1
  208. package/dist/locales/ja.js +1 -1
  209. package/dist/locales/ko.js +1 -1
  210. package/dist/locales/nl.js +1 -1
  211. package/dist/locales/pl.js +1 -1
  212. package/dist/locales/pt.js +1 -1
  213. package/dist/locales/ru.js +1 -1
  214. package/dist/locales/th.js +1 -1
  215. package/dist/locales/tr.js +1 -1
  216. package/dist/locales/vi.js +1 -1
  217. package/dist/locales/zh-hans.js +1 -1
  218. package/dist/locales/zh-hant.js +1 -1
  219. package/dist/styles.css +1 -1
  220. package/dist/tailwind.css +104 -0
  221. package/dist/types.d.ts +16 -0
  222. package/package.json +2 -2
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Button as l}from"../button/Button.js";import{Calendar as o,usePickerLabels as n}from"../../internal/calendar.js";import{CalendarIcon as r}from"../../internal/icons.js";import{PickerFooter as s,PickerShell as i}from"../../internal/picker.js";import{displaySamples as c,formatDate as d,isDayOutside as m,isValidDate as u,localeWeekStart as p,mergeDateAndTime as f,startOfDay as h,startOfMonth as b,toISODate as y,today as x,withPlaceholder as j}from"../../internal/date.js";import{cx as v}from"../../internal/styles.js";export const DatePicker=/*@__PURE__*/t.forwardRef(function({value:D,defaultValue:O,onValueChange:S,open:g,defaultOpen:C,onOpenChange:k,defaultMonth:z,minDate:w,maxDate:M,shouldDisableDate:V,locale:B,weekStartsOn:I,format:R={dateStyle:"medium"},placeholder:E,clearable:F=!1,showTodayButton:N=!0,closeOnSelect:P=!0,labels:T,name:q,size:A="md",color:G="primary",readOnly:H=!1,disabled:J=!1,startIcon:K,...L},Q){const U=n(T),W=I??p(B),[X,Y]=t.useState(O??null),Z=void 0!==D?D:X,[$,_]=t.useState(C??!1),ee=g??$,[ae,te]=t.useState(()=>b(u(Z)?Z:z??x()));t.useEffect(()=>{ee&&te(b(u(Z)?Z:z??x()))},[ee]);const le=e=>{e&&(H||J)||(void 0===g&&_(e),k?.(e))},oe=e=>{void 0===D&&Y(e),S?.(e)},ne=e=>{const a=u(Z)?f(e,Z):h(e);oe(a),te(b(a)),P&&le(!1)},re=x(),se=m(re,w,M)||(V?.(re)??!1),ie=N||F,ce=t.useMemo(()=>j(c(B,R),E),[B,R,E]);return e(i,{...L,size:A,color:G,readOnly:H,disabled:J,triggerRef:Q,startIcon:K??e(r,{}),display:u(Z)?d(Z,B,R):E??"",samples:ce,empty:!u(Z),clearable:F,onClear:()=>oe(null),open:ee,onOpenChange:le,labels:U,hiddenValues:q?[{name:q,value:u(Z)?y(Z):""}]:void 0,children:a("div",{className:v("flex flex-col",ie&&"gap-1.5"),children:[e(o,{size:A,color:G,locale:B,weekStartsOn:W,month:ae,onMonthChange:te,selected:[Z],onSelect:ne,minDate:w,maxDate:M,shouldDisableDate:V,labels:U,autoFocus:!0}),ie?a(s,{size:A,children:[F?e(l,{variant:"text",size:A,color:G,density:"compact",onClick:()=>{oe(null),le(!1)},children:U.clear}):null,N?e(l,{variant:"text",size:A,color:G,density:"compact",disabled:se,onClick:()=>ne(re),children:U.today}):null]}):null]})})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Button as l}from"../button/Button.js";import{Calendar as o,usePickerLabels as n}from"../../internal/calendar.js";import{CalendarIcon as r}from"../../internal/icons.js";import{PickerFooter as s,PickerShell as i}from"../../internal/picker.js";import{displaySamples as c,formatDate as d,isDayOutside as m,isValidDate as u,localeWeekStart as p,mergeDateAndTime as f,startOfDay as h,startOfMonth as b,toISODate as y,today as x,withPlaceholder as j}from"../../internal/date.js";import{cx as v}from"../../internal/styles.js";export const DatePicker=/*@__PURE__*/t.forwardRef(function({value:D,defaultValue:O,onValueChange:S,open:g,defaultOpen:C,onOpenChange:k,defaultMonth:z,minDate:w,maxDate:M,shouldDisableDate:V,locale:B,weekStartsOn:I,format:R={dateStyle:"medium"},placeholder:E,clearable:F=!1,showTodayButton:N=!0,closeOnSelect:P=!0,labels:T,name:q,size:A="md",color:G="primary",readOnly:H=!1,disabled:J=!1,startIcon:K,...L},Q){const U=n(T),W=I??p(B),[X,Y]=t.useState(O??null),Z=void 0!==D?D:X,[$,_]=t.useState(C??!1),ee=g??$,[ae,te]=t.useState(()=>b(u(Z)?Z:z??x()));t.useEffect(()=>{ee&&te(b(u(Z)?Z:z??x()))},[ee]);const le=e=>{e&&(H||J)||(void 0===g&&_(e),k?.(e))},oe=e=>{void 0===D&&Y(e),S?.(e)},ne=e=>{const a=u(Z)?f(e,Z):h(e);oe(a),te(b(a)),P&&le(!1)},re=x(),se=m(re,w,M)||(V?.(re)??!1),ie=N||F,ce=t.useMemo(()=>j(c(B,R),E),[B,R,E]);return e(i,{...L,size:A,color:G,readOnly:H,disabled:J,triggerRef:Q,startIcon:K??e(r,{}),display:u(Z)?d(Z,B,R):E??"",samples:ce,empty:!u(Z),clearable:F,onClear:()=>oe(null),open:ee,onOpenChange:le,labels:U,hiddenValues:q?[{name:q,value:u(Z)?y(Z):""}]:void 0,children:a("div",{className:v("flex flex-col",ie&&"gap-1.5"),children:[e(o,{size:A,color:G,locale:B,weekStartsOn:W,month:ae,onMonthChange:te,selected:[Z],onSelect:ne,minDate:w,maxDate:M,shouldDisableDate:V,labels:U,autoFocus:!0}),ie?a(s,{size:A,children:[F?e(l,{variant:"text",size:A,color:G,density:"compact",onClick:()=>{oe(null),le(!1)},children:U.clear}):null,N?e(l,{variant:"text",size:A,color:G,density:"compact",disabled:se,onClick:()=>ne(re),children:U.today}):null]}):null]})})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{Button as a}from"../button/Button.js";import{Calendar as t,usePickerLabels as s}from"../../internal/calendar.js";import{ArrowRightIcon as r,CalendarIcon as o}from"../../internal/icons.js";import{PickerFooter as i,PickerShell as c}from"../../internal/picker.js";import{WidthSizer as u}from"../../internal/sizer.js";import{addMonths as d,compareDay as m,displaySamples as h,formatDate as p,isValidDate as f,localeWeekStart as x,startOfDay as v,startOfMonth as g,toISODate as b,today as w,withPlaceholder as y}from"../../internal/date.js";import{cx as N,gapClasses as j,metaTextClasses as S}from"../../internal/styles.js";const C={start:null,end:null};export const DateRangePicker=/*@__PURE__*/n.forwardRef(function({value:D,defaultValue:O,onValueChange:k,open:z,defaultOpen:P,onOpenChange:B,defaultMonth:M,minDate:R,maxDate:V,shouldDisableDate:E,locale:I,weekStartsOn:F,format:q={dateStyle:"medium"},monthCount:A=2,startPlaceholder:G,endPlaceholder:H,presets:J,clearable:K=!1,closeOnSelect:L=!0,labels:Q,name:T,size:U="md",color:W="primary",readOnly:X=!1,disabled:Y=!1,startIcon:Z,...$},_){const ee=s(Q),le=F??x(I),[ne,ae]=n.useState(O??C),te=void 0!==D?D??C:ne,se=f(te.start)?te.start:null,re=f(te.end)?te.end:null,[oe,ie]=n.useState(P??!1),ce=z??oe,[ue,de]=n.useState(null),[me,he]=n.useState(null),[pe,fe]=n.useState(()=>g(se??M??w()));n.useEffect(()=>{ce?fe(g(se??M??w())):(de(null),he(null))},[ce]);const xe=e=>{e&&(X||Y)||(void 0===z&&ie(e),B?.(e))},ve=e=>{void 0===D&&ae(e),k?.(e)},ge=ue??se,be=null!==ue?me:re,we=(l,n)=>f(l)?p(l,I,q):e("span",{className:"text-(--neba-muted-fg)",children:n??""}),ye=d(pe,1),Ne=2===A,je=h(I,q),Se=null!==ue?ee.end:null===se?ee.start:null,Ce={size:U,color:W,locale:I,weekStartsOn:le,selected:[se,re,ue],rangeStart:ge,rangeEnd:be,onSelect:e=>{const l=v(e);if(null===ue)return de(l),he(l),void ve({start:l,end:null});const[n,a]=m(l,ue)<0?[l,ue]:[ue,l];de(null),he(null),ve({start:n,end:a}),L&&xe(!1)},onPreviewChange:e=>{null!==ue&&he(e??ue)},minDate:R,maxDate:V,shouldDisableDate:E,showOutsideDays:!1,labels:ee};return e(c,{...$,size:U,color:W,readOnly:X,disabled:Y,triggerRef:_,startIcon:Z??e(o,{}),display:l("span",{className:"flex min-w-0 items-center gap-1.5",children:[l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:we(se,G)}),e(u,{samples:y(je,G)})]}),e("span",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--neba-muted-fg) rtl:rotate-180",children:e(r,{})}),l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:we(re,H)}),e(u,{samples:y(je,H)})]})]}),empty:null===se&&null===re,clearable:K,onClear:()=>ve(C),open:ce,onOpenChange:xe,labels:ee,hiddenValues:T?[{name:T,value:se?b(se):""},{name:T,value:re?b(re):""}]:void 0,children:l("div",{className:"flex flex-col gap-1.5",children:[l("div",{className:N("flex items-stretch",j[U]),children:[J&&J.length>0?e("div",{className:N("flex max-h-[calc(var(--n-cell,2rem)*8)] flex-col overflow-y-auto border-e pe-1.5","[border-color:var(--n-line)]"),children:J.map((l,n)=>e(a,{variant:"text",size:U,color:W,density:"compact",className:"justify-start whitespace-nowrap",onClick:()=>(e=>{const l="function"==typeof e.value?e.value():e.value;de(null),he(null),ve(l),f(l.start)&&fe(g(l.start)),L&&xe(!1)})(l),children:l.label},n))}):null,e(t,{...Ce,month:pe,onMonthChange:fe,showNextButton:!Ne,autoFocus:!0}),Ne?e(t,{...Ce,month:ye,onMonthChange:e=>fe(d(e,-1)),showPreviousButton:!1}):null]}),K||null!==Se?l(i,{size:U,children:[null!==Se?e("span",{className:N("me-auto text-(--neba-muted-fg)",S[U]),children:Se}):null,K?e(a,{variant:"text",size:U,color:W,density:"compact",onClick:()=>{de(null),he(null),ve(C),xe(!1)},children:ee.clear}):null]}):null]})})});
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as n from"react";import{Button as a}from"../button/Button.js";import{Calendar as t,usePickerLabels as s}from"../../internal/calendar.js";import{ArrowRightIcon as r,CalendarIcon as o}from"../../internal/icons.js";import{PickerFooter as i,PickerShell as c}from"../../internal/picker.js";import{WidthSizer as u}from"../../internal/sizer.js";import{addMonths as d,compareDay as m,displaySamples as h,formatDate as p,isValidDate as f,localeWeekStart as x,startOfDay as v,startOfMonth as g,toISODate as b,today as w,withPlaceholder as y}from"../../internal/date.js";import{cx as N,gapClasses as j,metaTextClasses as S}from"../../internal/styles.js";const C={start:null,end:null};export const DateRangePicker=/*@__PURE__*/n.forwardRef(function({value:D,defaultValue:O,onValueChange:k,open:z,defaultOpen:P,onOpenChange:B,defaultMonth:M,minDate:R,maxDate:V,shouldDisableDate:E,locale:I,weekStartsOn:F,format:q={dateStyle:"medium"},monthCount:A=2,startPlaceholder:G,endPlaceholder:H,presets:J,clearable:K=!1,closeOnSelect:L=!0,labels:Q,name:T,size:U="md",color:W="primary",readOnly:X=!1,disabled:Y=!1,startIcon:Z,...$},_){const ee=s(Q),le=F??x(I),[ne,ae]=n.useState(O??C),te=void 0!==D?D??C:ne,se=f(te.start)?te.start:null,re=f(te.end)?te.end:null,[oe,ie]=n.useState(P??!1),ce=z??oe,[ue,de]=n.useState(null),[me,he]=n.useState(null),[pe,fe]=n.useState(()=>g(se??M??w()));n.useEffect(()=>{ce?fe(g(se??M??w())):(de(null),he(null))},[ce]);const xe=e=>{e&&(X||Y)||(void 0===z&&ie(e),B?.(e))},ve=e=>{void 0===D&&ae(e),k?.(e)},ge=ue??se,be=null!==ue?me:re,we=(l,n)=>f(l)?p(l,I,q):e("span",{className:"text-(--neba-muted-fg)",children:n??""}),ye=d(pe,1),Ne=2===A,je=h(I,q),Se=null!==ue?ee.end:null===se?ee.start:null,Ce={size:U,color:W,locale:I,weekStartsOn:le,selected:[se,re,ue],rangeStart:ge,rangeEnd:be,onSelect:e=>{const l=v(e);if(null===ue)return de(l),he(l),void ve({start:l,end:null});const[n,a]=m(l,ue)<0?[l,ue]:[ue,l];de(null),he(null),ve({start:n,end:a}),L&&xe(!1)},onPreviewChange:e=>{null!==ue&&he(e??ue)},minDate:R,maxDate:V,shouldDisableDate:E,showOutsideDays:!1,labels:ee};return e(c,{...$,size:U,color:W,readOnly:X,disabled:Y,triggerRef:_,startIcon:Z??e(o,{}),display:l("span",{className:"flex min-w-0 items-center gap-1.5",children:[l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:we(se,G)}),e(u,{samples:y(je,G)})]}),e("span",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--neba-muted-fg) rtl:rotate-180",children:e(r,{})}),l("span",{className:"flex min-w-0 flex-col",children:[e("span",{className:"truncate",children:we(re,H)}),e(u,{samples:y(je,H)})]})]}),empty:null===se&&null===re,clearable:K,onClear:()=>ve(C),open:ce,onOpenChange:xe,labels:ee,hiddenValues:T?[{name:T,value:se?b(se):""},{name:T,value:re?b(re):""}]:void 0,children:l("div",{className:"flex flex-col gap-1.5",children:[l("div",{className:N("flex items-stretch",j[U]),children:[J&&J.length>0?e("div",{className:N("flex max-h-[calc(var(--n-cell,2rem)*8)] flex-col overflow-y-auto border-e pe-1.5","[border-color:var(--n-line)]"),children:J.map((l,n)=>e(a,{variant:"text",size:U,color:W,density:"compact",className:"justify-start whitespace-nowrap",onClick:()=>(e=>{const l="function"==typeof e.value?e.value():e.value;de(null),he(null),ve(l),f(l.start)&&fe(g(l.start)),L&&xe(!1)})(l),children:l.label},n))}):null,e(t,{...Ce,month:pe,onMonthChange:fe,showNextButton:!Ne,autoFocus:!0}),Ne?e(t,{...Ce,month:ye,onMonthChange:e=>fe(d(e,-1)),showPreviousButton:!1}):null]}),K||null!==Se?l(i,{size:U,children:[null!==Se?e("span",{className:N("me-auto text-(--neba-muted-fg)",S[U]),children:Se}):null,K?e(a,{variant:"text",size:U,color:W,density:"compact",onClick:()=>{de(null),he(null),ve(C),xe(!1)},children:ee.clear}):null]}):null]})})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Button as o}from"../button/Button.js";import{Calendar as n,TimeGrid as a,usePickerLabels as s}from"../../internal/calendar.js";import{CalendarIcon as i}from"../../internal/icons.js";import{PickerDivider as r,PickerFooter as c,PickerShell as d}from"../../internal/picker.js";import{displaySamples as m,formatDate as u,isDayOutside as h,isHour12 as p,isValidDate as f,localeWeekStart as S,mergeDateAndTime as b,startOfDay as y,startOfMonth as D,timeUnitSpan as g,toISODateTime as v,today as x,withPlaceholder as C,withTime as j}from"../../internal/date.js";import{cx as w,gapClasses as k}from"../../internal/styles.js";export const DateTimePicker=/*@__PURE__*/l.forwardRef(function({value:z,defaultValue:O,onValueChange:T,open:N,defaultOpen:V,onOpenChange:B,defaultMonth:I,minDate:M,maxDate:R,shouldDisableDate:E,shouldDisableTime:F,locale:P,weekStartsOn:q,format:A={dateStyle:"medium",timeStyle:"short"},hour12:G,showSeconds:H=!1,hourStep:J=1,minuteStep:K=1,secondStep:L=1,placeholder:Q,clearable:U=!1,showNowButton:W=!0,closeOnSelect:X=!1,labels:Y,name:Z,size:$="md",color:_="primary",density:ee="default",readOnly:te=!1,disabled:le=!1,startIcon:oe,...ne},ae){const se=s(Y),ie=q??S(P),re=G??p(P),[ce,de]=l.useState(O??null),me=void 0!==z?z:ce,[ue,he]=l.useState(V??!1),pe=N??ue,[fe,Se]=l.useState(()=>D(f(me)?me:I??x()));l.useEffect(()=>{pe&&Se(D(f(me)?me:I??x()))},[pe]);const be=e=>{e&&(te||le)||(void 0===N&&he(e),B?.(e))},ye=e=>{void 0===z&&de(e),T?.(e)},De=l.useCallback((e,t)=>{const[l,o]=g(t,e),n=y(e).getTime();return!!(f(M)&&n+1e3*o<M.getTime())||(!!(f(R)&&n+1e3*l>R.getTime())||(F?.(e,t)??!1))},[M,R,F]),ge=new Date,ve=j(ge,{seconds:H?ge.getSeconds():0}),xe=h(ve,M,R)||(E?.(ve)??!1)||De(ve,"second"),Ce=C(m(P,A),Q);return e(d,{...ne,size:$,color:_,density:ee,readOnly:te,disabled:le,triggerRef:ae,startIcon:oe??e(i,{}),display:f(me)?u(me,P,A):Q??"",samples:Ce,empty:!f(me),clearable:U,onClear:()=>ye(null),open:pe,onOpenChange:be,labels:se,hiddenValues:Z?[{name:Z,value:f(me)?v(me,H):""}]:void 0,children:t("div",{className:"flex flex-col gap-1.5",children:[t("div",{className:w("flex items-stretch",k[$]),children:[e(n,{size:$,color:_,locale:P,weekStartsOn:ie,month:fe,onMonthChange:Se,selected:[me],onSelect:e=>{const t=f(me)?b(e,me):y(e);ye(t),Se(D(t)),X&&be(!1)},minDate:M,maxDate:R,shouldDisableDate:E,labels:se,autoFocus:!0}),e(r,{}),e(a,{size:$,density:ee,locale:P,value:f(me)?me:null,referenceDate:f(me)?me:x(),onChange:ye,hour12:re,showSeconds:H,hourStep:J,minuteStep:K,secondStep:L,shouldDisableTime:De,labels:se})]}),t(c,{size:$,children:[U?e(o,{variant:"text",size:$,color:_,density:"compact",onClick:()=>{ye(null),be(!1)},children:se.clear}):null,W?e(o,{variant:"text",size:$,color:_,density:"compact",disabled:xe,onClick:()=>{ye(ve),Se(D(ve))},children:se.now}):null,e(o,{variant:"solid",size:$,color:_,density:"compact",onClick:()=>be(!1),children:se.done})]})]})})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Button as n}from"../button/Button.js";import{Calendar as o,TimeGrid as a,usePickerLabels as s}from"../../internal/calendar.js";import{CalendarIcon as i}from"../../internal/icons.js";import{PickerDivider as r,PickerFooter as c,PickerShell as d}from"../../internal/picker.js";import{displaySamples as m,formatDate as u,isDayOutside as h,isHour12 as p,isValidDate as f,localeWeekStart as S,mergeDateAndTime as b,startOfDay as y,startOfMonth as D,timeUnitSpan as g,toISODateTime as v,today as x,withPlaceholder as C,withTime as j}from"../../internal/date.js";import{cx as w,gapClasses as k}from"../../internal/styles.js";export const DateTimePicker=/*@__PURE__*/l.forwardRef(function({value:z,defaultValue:O,onValueChange:T,open:N,defaultOpen:V,onOpenChange:B,defaultMonth:I,minDate:M,maxDate:R,shouldDisableDate:E,shouldDisableTime:F,locale:P,weekStartsOn:q,format:A={dateStyle:"medium",timeStyle:"short"},hour12:G,showSeconds:H=!1,hourStep:J=1,minuteStep:K=1,secondStep:L=1,placeholder:Q,clearable:U=!1,showNowButton:W=!0,closeOnSelect:X=!1,labels:Y,name:Z,size:$="md",color:_="primary",density:ee="default",readOnly:te=!1,disabled:le=!1,startIcon:ne,...oe},ae){const se=s(Y),ie=q??S(P),re=G??p(P),[ce,de]=l.useState(O??null),me=void 0!==z?z:ce,[ue,he]=l.useState(V??!1),pe=N??ue,[fe,Se]=l.useState(()=>D(f(me)?me:I??x()));l.useEffect(()=>{pe&&Se(D(f(me)?me:I??x()))},[pe]);const be=e=>{e&&(te||le)||(void 0===N&&he(e),B?.(e))},ye=e=>{void 0===z&&de(e),T?.(e)},De=l.useCallback((e,t)=>{const[l,n]=g(t,e),o=y(e).getTime();return!!(f(M)&&o+1e3*n<M.getTime())||(!!(f(R)&&o+1e3*l>R.getTime())||(F?.(e,t)??!1))},[M,R,F]),ge=new Date,ve=j(ge,{seconds:H?ge.getSeconds():0}),xe=h(ve,M,R)||(E?.(ve)??!1)||De(ve,"second"),Ce=C(m(P,A),Q);return e(d,{...oe,size:$,color:_,density:ee,readOnly:te,disabled:le,triggerRef:ae,startIcon:ne??e(i,{}),display:f(me)?u(me,P,A):Q??"",samples:Ce,empty:!f(me),clearable:U,onClear:()=>ye(null),open:pe,onOpenChange:be,labels:se,hiddenValues:Z?[{name:Z,value:f(me)?v(me,H):""}]:void 0,children:t("div",{className:"flex flex-col gap-1.5",children:[t("div",{className:w("flex items-stretch",k[$]),children:[e(o,{size:$,color:_,locale:P,weekStartsOn:ie,month:fe,onMonthChange:Se,selected:[me],onSelect:e=>{const t=f(me)?b(e,me):y(e);ye(t),Se(D(t)),X&&be(!1)},minDate:M,maxDate:R,shouldDisableDate:E,labels:se,autoFocus:!0}),e(r,{}),e(a,{size:$,density:ee,locale:P,value:f(me)?me:null,referenceDate:f(me)?me:x(),onChange:ye,hour12:re,showSeconds:H,hourStep:J,minuteStep:K,secondStep:L,shouldDisableTime:De,labels:se})]}),t(c,{size:$,children:[U?e(n,{variant:"text",size:$,color:_,density:"compact",onClick:()=>{ye(null),be(!1)},children:se.clear}):null,W?e(n,{variant:"text",size:$,color:_,density:"compact",disabled:xe,onClick:()=>{ye(ve),Se(D(ve))},children:se.now}):null,e(n,{variant:"solid",size:$,color:_,density:"compact",onClick:()=>be(!1),children:se.done})]})]})})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as l}from"@base-ui/react/dialog";import{boxPaddingXClasses as n,boxPaddingYClasses as i}from"../box/Box.js";import{actionMessages as o,useMessages as r}from"../../internal/i18n.js";import{CloseIcon as t}from"../../internal/icons.js";import{hasContent as s,metaTextClasses as c,radiusClasses as d,sheetBodyClasses as m,sheetHeaderGapClasses as f,sheetSectionGapClasses as p,sheetTitleClasses as u,surfaceClasses as x,surfaceSlots as b}from"../../internal/styles.js";const h={xs:"max-w-80",sm:"max-w-96",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"},g=[x,"relative flex w-full flex-col overflow-hidden","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(" "),v=["fixed inset-0 z-50 bg-(--neba-scrim)","[backdrop-filter:blur(2px)]","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),y="border-t [border-color:var(--n-line)]";export const DialogClose=l.Close;export function Dialog({size:x="md",color:j="primary",density:w="default",open:$,defaultOpen:_,onOpenChange:N,trigger:k,title:C,description:z,actions:B,dividers:D=!1,showClose:O=!0,locale:P,closeLabel:T,width:W,fullWidth:L=!0,fullScreen:R=!1,modal:S=!0,dismissible:V=!0,className:q,style:A,children:E,...F}){const G=r(o,P),H=n[w][x],I=i[w][x],J=D?`${H} ${I}`:H,K=s(C)||s(z),M=s(B);return a(l.Root,{open:$,defaultOpen:_,modal:S,disablePointerDismissal:!V,onOpenChange:(e,a)=>{V||e||"escape-key"!==a.reason?N?.(e):a.cancel()},children:[k?e(l.Trigger,{render:k}):null,a(l.Portal,{children:[e(l.Backdrop,{className:`neba-portal ${v}`}),e(l.Viewport,{className:["neba-portal fixed inset-0 z-50 flex justify-center",R?"items-stretch":"items-center p-4"].join(" "),children:a(l.Popup,{className:[g,m[x],R?"h-full max-w-none rounded-none":`max-h-full ${d[x]} ${void 0===W?h[x]:""}`,R||L?"":"w-auto",D?"":`${I} ${p[x]}`,q??""].filter(Boolean).join(" "),style:{...b(j,3),...void 0===W?null:{maxWidth:"number"==typeof W?`${W}px`:W},...A},...F,children:[K||O?a("div",{className:`flex shrink-0 items-start gap-3 ${J}`,children:[a("div",{className:`flex min-w-0 flex-1 flex-col ${f[x]}`,children:[s(C)?e(l.Title,{className:`font-semibold ${u[x]} m-0`,children:C}):null,s(z)?e(l.Description,{className:`m-0 text-(--neba-muted-fg) ${c[x]}`,children:z}):null]}),O?e(l.Close,{"aria-label":T??G.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(t,{})}):null]}):null,s(E)?e("div",{className:["min-h-0 flex-1 overflow-y-auto overscroll-contain",J,D&&(K||O)?y:"",D?"":"py-1 -my-1"].filter(Boolean).join(" "),children:E}):null,M?e("div",{className:["flex shrink-0 flex-wrap items-center justify-end gap-2",J,D?y:""].filter(Boolean).join(" "),children:B}):null]})})]})]})}
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as l}from"@base-ui/react/dialog";import{boxPaddingXClasses as n,boxPaddingYClasses as i}from"../box/Box.js";import{actionMessages as o,useMessages as r}from"../../internal/i18n.js";import{CloseIcon as s}from"../../internal/icons.js";import{cx as t,hasContent as c,metaTextClasses as d,radiusClasses as m,sheetBodyClasses as f,sheetHeaderGapClasses as u,sheetSectionGapClasses as p,sheetTitleClasses as x,surfaceClasses as b,surfaceSlots as h}from"../../internal/styles.js";const g={xs:"max-w-80",sm:"max-w-96",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"},v=[b,"relative flex w-full flex-col overflow-hidden","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=["fixed inset-0 z-50 bg-(--neba-scrim)","[backdrop-filter:blur(2px)]","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),w="border-t [border-color:var(--n-line)]";export const DialogClose=l.Close;export function Dialog({size:b="md",color:j="primary",density:$="default",open:_,defaultOpen:N,onOpenChange:k,trigger:C,title:z,description:D,actions:O,dividers:P=!1,showClose:B=!0,locale:T,closeLabel:W,width:L,fullWidth:R=!0,fullScreen:S=!1,modal:V=!0,dismissible:q=!0,className:A,style:E,children:F,...G}){const H=r(o,T),I=n[$][b],J=i[$][b],K=P?`${I} ${J}`:I,M=c(z)||c(D),Q=c(O);return a(l.Root,{open:_,defaultOpen:N,modal:V,disablePointerDismissal:!q,onOpenChange:(e,a)=>{q||e||"escape-key"!==a.reason?k?.(e):a.cancel()},children:[C?e(l.Trigger,{render:C}):null,a(l.Portal,{children:[e(l.Backdrop,{className:`neba-portal ${y}`}),e(l.Viewport,{className:["neba-portal fixed inset-0 z-50 flex justify-center",S?"items-stretch":"items-center p-4"].join(" "),children:a(l.Popup,{className:t(v,f[b],S?"h-full max-w-none rounded-none":`max-h-full ${m[b]} ${void 0===L?g[b]:""}`,S||R?"":"w-auto",P?"":`${J} ${p[b]}`,A??""),style:{...h(j,3),...void 0===L?null:{maxWidth:"number"==typeof L?`${L}px`:L},...E},...G,children:[M||B?a("div",{className:`flex shrink-0 items-start gap-3 ${K}`,children:[a("div",{className:`flex min-w-0 flex-1 flex-col ${u[b]}`,children:[c(z)?e(l.Title,{className:`font-semibold ${x[b]} m-0`,children:z}):null,c(D)?e(l.Description,{className:`m-0 text-(--neba-muted-fg) ${d[b]}`,children:D}):null]}),B?e(l.Close,{"aria-label":W??H.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(s,{})}):null]}):null,c(F)?e("div",{className:t("min-h-0 flex-1 overflow-y-auto overscroll-contain",K,P&&(M||B)?w:"",P?"":"py-1 -my-1"),children:F}):null,Q?e("div",{className:t("flex shrink-0 flex-wrap items-center justify-end gap-2",K,P?w:""),children:O}):null]})})]})]})}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{Separator as n}from"@base-ui/react/separator";import{metaTextClasses as l}from"../../internal/styles.js";const i="[border-color:var(--n-line)]";function a(e){return"number"==typeof e?`${e}px`:e}const o={horizontal:{start:["w-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","w-4 shrink-0"]},vertical:{start:["h-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","h-4 shrink-0"]}},s={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const Divider=/*@__PURE__*/t.forwardRef(function({orientation:t="horizontal",color:c="primary",size:d="md",length:f,thickness:h,textAlign:m="center",className:p,style:u,children:x,...w},b){const v="vertical"===t,g=null!=x&&!1!==x&&""!==x,$={"--n-line":`var(--neba-${c}-line)`,"--n-rule":a(h)??"1px"},j=a(f),y={...$,...void 0===j?null:v?{height:j}:{width:j},...u};if(!g)return e(n,{ref:b,orientation:t,className:[v?"w-0 border-l [border-left-width:var(--n-rule)] "+(void 0===j?"self-stretch":""):"h-0 w-full border-t [border-top-width:var(--n-rule)]",i,p??""].filter(Boolean).join(" "),style:y,...w});const[k,N]=o[t][m],z=v?"w-0 border-l [border-left-width:var(--n-rule)]":"h-0 border-t [border-top-width:var(--n-rule)]";return r(n,{ref:b,orientation:t,"aria-label":"string"==typeof x?x:void 0,className:["flex items-center",v?"w-auto flex-col "+(void 0===j?"self-stretch":""):"w-full",s[d],p??""].filter(Boolean).join(" "),style:y,...w,children:[e("span",{"aria-hidden":"true",className:`${z} ${k} ${i}`}),e("span",{className:["shrink-0 whitespace-nowrap text-(--neba-muted-fg)",l[d],v?"[writing-mode:vertical-rl]":""].filter(Boolean).join(" "),children:x}),e("span",{"aria-hidden":"true",className:`${z} ${N} ${i}`})]})});
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{Separator as l}from"@base-ui/react/separator";import{cx as a,metaTextClasses as n,toLength as i}from"../../internal/styles.js";const s="[border-color:var(--n-line)]",o={horizontal:{start:["w-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","w-4 shrink-0"]},vertical:{start:["h-4 shrink-0","flex-1"],center:["flex-1","flex-1"],end:["flex-1","h-4 shrink-0"]}},d={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-3.5",xl:"gap-4"};export const Divider=/*@__PURE__*/t.forwardRef(function({orientation:t="horizontal",color:c="primary",size:f="md",length:h,thickness:m,textAlign:p="center",className:u,style:x,children:w,...v},b){const g="vertical"===t,$=null!=w&&!1!==w&&""!==w,k={"--n-line":`var(--neba-${c}-line)`,"--n-rule":i(m)??"1px"},y=i(h),N={...k,...void 0===y?null:g?{height:y}:{width:y},...x};if(!$)return e(l,{ref:b,orientation:t,className:a(g?"w-0 border-l [border-left-width:var(--n-rule)] "+(void 0===y?"self-stretch":""):"h-0 w-full border-t [border-top-width:var(--n-rule)]",s,u??""),style:N,...v});const[j,z]=o[t][p],A=g?"w-0 border-l [border-left-width:var(--n-rule)]":"h-0 border-t [border-top-width:var(--n-rule)]";return r(l,{ref:b,orientation:t,"aria-label":"string"==typeof w?w:void 0,className:a("flex items-center",g?"w-auto flex-col "+(void 0===y?"self-stretch":""):"w-full",d[f],u??""),style:N,...v,children:[e("span",{"aria-hidden":"true",className:`${A} ${j} ${s}`}),e("span",{className:["shrink-0 whitespace-nowrap text-(--neba-muted-fg)",n[f],g?"[writing-mode:vertical-rl]":""].filter(Boolean).join(" "),children:w}),e("span",{"aria-hidden":"true",className:`${A} ${z} ${s}`})]})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r,Fragment as a}from"react/jsx-runtime";import{Dialog as l}from"@base-ui/react/dialog";import{boxPaddingXClasses as n,boxPaddingYClasses as o}from"../box/Box.js";import{actionMessages as s,useMessages as i}from"../../internal/i18n.js";import{CloseIcon as d}from"../../internal/icons.js";import{hasContent as t,metaTextClasses as u,sheetBodyClasses as b,sheetHeaderGapClasses as m,sheetSectionGapClasses as c,sheetTitleClasses as f,surfaceClasses as x,surfaceSlots as p}from"../../internal/styles.js";const g={xs:"w-56",sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]"},h={left:{xs:"rounded-r-(--neba-radius-xs)",sm:"rounded-r-(--neba-radius-sm)",md:"rounded-r-(--neba-radius-md)",lg:"rounded-r-(--neba-radius-lg)",xl:"rounded-r-(--neba-radius-xl)"},right:{xs:"rounded-l-(--neba-radius-xs)",sm:"rounded-l-(--neba-radius-sm)",md:"rounded-l-(--neba-radius-md)",lg:"rounded-l-(--neba-radius-lg)",xl:"rounded-l-(--neba-radius-xl)"},top:{xs:"rounded-b-(--neba-radius-xs)",sm:"rounded-b-(--neba-radius-sm)",md:"rounded-b-(--neba-radius-md)",lg:"rounded-b-(--neba-radius-lg)",xl:"rounded-b-(--neba-radius-xl)"},bottom:{xs:"rounded-t-(--neba-radius-xs)",sm:"rounded-t-(--neba-radius-sm)",md:"rounded-t-(--neba-radius-md)",lg:"rounded-t-(--neba-radius-lg)",xl:"rounded-t-(--neba-radius-xl)"}},v={left:"border-r",right:"border-l",top:"border-b",bottom:"border-t"},y={left:"flex-row justify-start",right:"flex-row justify-end",top:"flex-col justify-start",bottom:"flex-col justify-end"},w=[x,"relative flex flex-col overflow-hidden","text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[outline:none]"].join(" "),j=["[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),N=["fixed inset-0 z-50 bg-(--neba-scrim)","[backdrop-filter:blur(2px)]",j].join(" "),$="border-t [border-color:var(--n-line)]",_=["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(" ");export const DrawerClose=l.Close;export function Drawer({side:x="left",mode:k="overlay",size:C="md",color:z="primary",density:B="default",open:D,defaultOpen:O,onOpenChange:P,trigger:T,title:F,description:L,actions:R,dividers:V=!1,showClose:q,locale:A,closeLabel:E,extent:G,rounded:H=!0,modal:I=!0,dismissible:J=!0,className:K,style:M,children:Q,...S}){const U=i(s,A),W="overlay"===k,X="left"===x||"right"===x,Y=q??W,Z=n[B][C],ee=o[B][C],re=V?`${Z} ${ee}`:Z,ae=t(F)||t(L),le=t(R),ne=void 0===G?null:{[X?"width":"height"]:"number"==typeof G?`${G}px`:G},oe=[w,b[C],v[x],H?h[x][C]:"",W?"[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]":"[box-shadow:var(--neba-plate-glass)]",W?j:"",X?`h-full max-w-full ${void 0===G?g[C]:""}`:"w-full "+(void 0===G?"max-h-[85%]":""),V?"":`${ee} ${c[C]}`,K??""].filter(Boolean).join(" "),se=W?l.Title:"h2",ie=W?l.Description:"p",de=r(a,{children:[ae||Y?r("div",{className:`flex shrink-0 items-start gap-3 ${re}`,children:[r("div",{className:`flex min-w-0 flex-1 flex-col ${m[C]}`,children:[t(F)?e(se,{className:`m-0 font-semibold ${f[C]}`,children:F}):null,t(L)?e(ie,{className:`m-0 text-(--neba-muted-fg) ${u[C]}`,children:L}):null]}),Y?W?e(l.Close,{"aria-label":E??U.close,className:_,children:e(d,{})}):e("button",{type:"button","aria-label":E??U.close,className:_,onClick:()=>P?.(!1),children:e(d,{})}):null]}):null,t(Q)?e("div",{className:["min-h-0 flex-1 overflow-y-auto overscroll-contain",re,V&&(ae||Y)?$:"",V?"":"py-1 -my-1"].filter(Boolean).join(" "),children:Q}):null,le?e("div",{className:["flex shrink-0 flex-wrap items-center justify-end gap-2",re,V?$:""].filter(Boolean).join(" "),children:R}):null]});return W?r(l.Root,{open:D,defaultOpen:O,modal:I,disablePointerDismissal:!J,onOpenChange:(e,r)=>{J||e||"escape-key"!==r.reason?P?.(e):r.cancel()},children:[T?e(l.Trigger,{render:T}):null,r(l.Portal,{children:[e(l.Backdrop,{className:`neba-portal ${N}`}),e(l.Viewport,{className:`neba-portal fixed inset-0 z-50 flex ${y[x]}`,children:e(l.Popup,{className:oe,style:{...p(z,3),...ne,...M},...S,children:de})})]})]}):D??O??!0?e("div",{className:oe,style:{...p(z,0),...ne,...M},children:de}):null}
1
+ "use client";import{jsx as e,jsxs as r,Fragment as a}from"react/jsx-runtime";import{Dialog as l}from"@base-ui/react/dialog";import{boxPaddingXClasses as n,boxPaddingYClasses as s}from"../box/Box.js";import{actionMessages as o,useMessages as i}from"../../internal/i18n.js";import{CloseIcon as d}from"../../internal/icons.js";import{cx as t,hasContent as u,metaTextClasses as b,sheetBodyClasses as m,sheetHeaderGapClasses as c,sheetSectionGapClasses as f,sheetTitleClasses as x,surfaceClasses as p,surfaceSlots as g}from"../../internal/styles.js";const h={xs:"w-56",sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]"},v={left:{xs:"rounded-r-(--neba-radius-xs)",sm:"rounded-r-(--neba-radius-sm)",md:"rounded-r-(--neba-radius-md)",lg:"rounded-r-(--neba-radius-lg)",xl:"rounded-r-(--neba-radius-xl)"},right:{xs:"rounded-l-(--neba-radius-xs)",sm:"rounded-l-(--neba-radius-sm)",md:"rounded-l-(--neba-radius-md)",lg:"rounded-l-(--neba-radius-lg)",xl:"rounded-l-(--neba-radius-xl)"},top:{xs:"rounded-b-(--neba-radius-xs)",sm:"rounded-b-(--neba-radius-sm)",md:"rounded-b-(--neba-radius-md)",lg:"rounded-b-(--neba-radius-lg)",xl:"rounded-b-(--neba-radius-xl)"},bottom:{xs:"rounded-t-(--neba-radius-xs)",sm:"rounded-t-(--neba-radius-sm)",md:"rounded-t-(--neba-radius-md)",lg:"rounded-t-(--neba-radius-lg)",xl:"rounded-t-(--neba-radius-xl)"}},y={left:"border-r",right:"border-l",top:"border-b",bottom:"border-t"},w={left:"flex-row justify-start",right:"flex-row justify-end",top:"flex-col justify-start",bottom:"flex-col justify-end"},j=[p,"relative flex flex-col overflow-hidden","text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[outline:none]"].join(" "),N=["[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),$=["fixed inset-0 z-50 bg-(--neba-scrim)","[backdrop-filter:blur(2px)]",N].join(" "),_="border-t [border-color:var(--n-line)]",k=["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(" ");export const DrawerClose=l.Close;export function Drawer({side:p="left",mode:C="overlay",size:z="md",color:D="primary",density:O="default",open:P,defaultOpen:B,onOpenChange:T,trigger:F,title:L,description:R,actions:V,dividers:q=!1,showClose:A,locale:E,closeLabel:G,extent:H,rounded:I=!0,modal:J=!0,dismissible:K=!0,className:M,style:Q,children:S,...U}){const W=i(o,E),X="overlay"===C,Y="left"===p||"right"===p,Z=A??X,ee=n[O][z],re=s[O][z],ae=q?`${ee} ${re}`:ee,le=u(L)||u(R),ne=u(V),se=void 0===H?null:{[Y?"width":"height"]:"number"==typeof H?`${H}px`:H},oe=t(j,m[z],y[p],I?v[p][z]:"",X?"[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]":"[box-shadow:var(--neba-plate-glass)]",X?N:"",Y?`h-full max-w-full ${void 0===H?h[z]:""}`:"w-full "+(void 0===H?"max-h-[85%]":""),q?"":`${re} ${f[z]}`,M??""),ie=X?l.Title:"h2",de=X?l.Description:"p",te=r(a,{children:[le||Z?r("div",{className:`flex shrink-0 items-start gap-3 ${ae}`,children:[r("div",{className:`flex min-w-0 flex-1 flex-col ${c[z]}`,children:[u(L)?e(ie,{className:`m-0 font-semibold ${x[z]}`,children:L}):null,u(R)?e(de,{className:`m-0 text-(--neba-muted-fg) ${b[z]}`,children:R}):null]}),Z?X?e(l.Close,{"aria-label":G??W.close,className:k,children:e(d,{})}):e("button",{type:"button","aria-label":G??W.close,className:k,onClick:()=>T?.(!1),children:e(d,{})}):null]}):null,u(S)?e("div",{className:t("min-h-0 flex-1 overflow-y-auto overscroll-contain",ae,q&&(le||Z)?_:"",q?"":"py-1 -my-1"),children:S}):null,ne?e("div",{className:t("flex shrink-0 flex-wrap items-center justify-end gap-2",ae,q?_:""),children:V}):null]});return X?r(l.Root,{open:P,defaultOpen:B,modal:J,disablePointerDismissal:!K,onOpenChange:(e,r)=>{K||e||"escape-key"!==r.reason?T?.(e):r.cancel()},children:[F?e(l.Trigger,{render:F}):null,r(l.Portal,{children:[e(l.Backdrop,{className:`neba-portal ${$}`}),e(l.Viewport,{className:`neba-portal fixed inset-0 z-50 flex ${w[p]}`,children:e(l.Popup,{className:oe,style:{...g(D,3),...se,...Q},...U,children:te})})]})]}):P??B??!0?e("div",{className:oe,style:{...g(D,0),...se,...Q},children:te}):null}
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{useRender as l}from"@base-ui/react/use-render";import{boxPaddingXClasses as a}from"../box/Box.js";import{transitionProps as o}from"../../internal/animate.js";import{emptyMessages as s,useMessages as i}from"../../internal/i18n.js";import{hasContent as m,iconClasses as c,radiusClasses as d,sheetBodyClasses as x,sheetHeaderGapClasses as p,sheetSectionGapClasses as f,sheetTitleClasses as u,surfaceClasses as h,surfaceSlots as v,transitionClasses as y}from"../../internal/styles.js";const b={default:{xs:"py-5",sm:"py-6",md:"py-8",lg:"py-10",xl:"py-12"},compact:{xs:"py-3",sm:"py-3.5",md:"py-4",lg:"py-5",xl:"py-6"}},g={xs:"text-[1.25rem]",sm:"text-[1.5rem]",md:"text-[1.75rem]",lg:"text-[2.125rem]",xl:"text-[2.5rem]"},j={solid:[h,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[h,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};function N(){return t("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"M1.75 9.75h3l.9 1.6h4.7l.9-1.6h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"m1.75 9.75 2.1-6a1.5 1.5 0 0 1 1.42-1h5.46a1.5 1.5 0 0 1 1.42 1l2.1 6v2a1.5 1.5 0 0 1-1.5 1.5h-9.5a1.5 1.5 0 0 1-1.5-1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]})}export const Empty=/*@__PURE__*/n.forwardRef(function({variant:n="text",size:h="md",color:k="secondary",density:w="default",elevation:$=0,title:B,icon:L,action:C,locale:W,transition:z,render:E,className:F,style:M,children:R,...Z},q){const A=i(s,W),D=void 0===B?A.title:B,G=void 0===L?e(N,{}):L,H=o(z),I=m(D),J=["flex w-full flex-col items-center justify-center text-center",a[w][h],b[w][h],d[h],f[h],y,j[n],H.className,F??""].filter(Boolean).join(" ");return l({render:E,ref:q,props:{role:"status",className:J,style:{...v(k,$),...H.style,...M},children:t(r,{children:[m(G)?e("span",{className:`flex items-center text-(--neba-muted-fg) ${g[h]} ${c}`,children:G}):null,I||m(R)?t("div",{className:`flex max-w-prose flex-col items-center ${p[h]}`,children:[I?e("div",{className:`neba-title font-semibold ${u[h]}`,children:D}):null,m(R)?e("div",{className:`${x[h]} ${I?"text-(--neba-muted-fg)":""}`,children:R}):null]}):null,m(C)?e("div",{className:"flex flex-wrap items-center justify-center gap-2",children:C}):null]}),...Z}})});
1
+ "use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{useRender as l}from"@base-ui/react/use-render";import{boxPaddingXClasses as a}from"../box/Box.js";import{transitionProps as s}from"../../internal/animate.js";import{emptyMessages as o,useMessages as i}from"../../internal/i18n.js";import{cx as m,hasContent as c,iconClasses as d,radiusClasses as x,sheetBodyClasses as p,sheetHeaderGapClasses as f,sheetSectionGapClasses as u,sheetTitleClasses as h,surfaceClasses as v,surfaceSlots as y,transitionClasses as b}from"../../internal/styles.js";const g={default:{xs:"py-5",sm:"py-6",md:"py-8",lg:"py-10",xl:"py-12"},compact:{xs:"py-3",sm:"py-3.5",md:"py-4",lg:"py-5",xl:"py-6"}},j={xs:"text-[1.25rem]",sm:"text-[1.5rem]",md:"text-[1.75rem]",lg:"text-[2.125rem]",xl:"text-[2.5rem]"},N={solid:[v,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[v,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};function k(){return t("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"M1.75 9.75h3l.9 1.6h4.7l.9-1.6h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"m1.75 9.75 2.1-6a1.5 1.5 0 0 1 1.42-1h5.46a1.5 1.5 0 0 1 1.42 1l2.1 6v2a1.5 1.5 0 0 1-1.5 1.5h-9.5a1.5 1.5 0 0 1-1.5-1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]})}export const Empty=/*@__PURE__*/n.forwardRef(function({variant:n="text",size:v="md",color:w="secondary",density:$="default",elevation:L=0,title:B,icon:C,action:W,locale:z,transition:E,render:F,className:M,style:R,children:Z,...q},A){const D=i(o,z),G=void 0===B?D.title:B,H=void 0===C?e(k,{}):C,I=s(E),J=c(G),K=m("flex w-full flex-col items-center justify-center text-center",a[$][v],g[$][v],x[v],u[v],b,N[n],I.className,M??"");return l({render:F,ref:A,props:{role:"status",className:K,style:{...y(w,L),...I.style,...R},children:t(r,{children:[c(H)?e("span",{className:`flex items-center text-(--neba-muted-fg) ${j[v]} ${d}`,children:H}):null,J||c(Z)?t("div",{className:`flex max-w-prose flex-col items-center ${f[v]}`,children:[J?e("div",{className:`neba-title font-semibold ${h[v]}`,children:G}):null,c(Z)?e("div",{className:`${p[v]} ${J?"text-(--neba-muted-fg)":""}`,children:Z}):null]}):null,c(W)?e("div",{className:"flex flex-wrap items-center justify-center gap-2",children:W}):null]}),...q}})});
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import type { NebaSize } from '../../types.js';
3
+ export interface FieldsetProps extends Omit<React.ComponentPropsWithoutRef<'fieldset'>, 'color'> {
4
+ /**
5
+ * What the group is called. It becomes the accessible name of every control
6
+ * inside, so it has to be a phrase that still reads correctly in front of each
7
+ * of them — "Billing address", not "Where should we send it?".
8
+ */
9
+ legend?: React.ReactNode;
10
+ /** A line under the legend. */
11
+ description?: React.ReactNode;
12
+ /** Disables every control inside at once, the way a `<fieldset>` always has. */
13
+ disabled?: boolean;
14
+ /** The type scale of the legend and the gap between the controls. @default 'md' */
15
+ size?: NebaSize;
16
+ children?: React.ReactNode;
17
+ }
18
+ /**
19
+ * A group of controls that answer one question together, with a name on it.
20
+ *
21
+ * It draws no surface, and that is deliberate: a group of fields is a *grouping*
22
+ * and not a sheet, and the sheet already exists — put this inside a
23
+ * [Card](../surfaces/card) or a [Box](../surfaces/box) when one is wanted. What
24
+ * it owns is the legend, the gap the controls stand at, and the one thing only a
25
+ * real `<fieldset>` can do: `disabled` reaches every control inside it,
26
+ * including ones a component three levels down rendered and never heard of it.
27
+ *
28
+ * The legend is a `<div>` pointed at by `aria-labelledby` rather than a
29
+ * `<legend>` — Base UI's decision, and the one that makes the group a normal
30
+ * flex container: a real rendered legend is lifted out of its fieldset's content
31
+ * box by every browser, so a `gap` would put no space under it at all.
32
+ */
33
+ export declare const Fieldset: React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<HTMLFieldSetElement>>;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as e,jsxs as s}from"react/jsx-runtime";import*as l from"react";import{Fieldset as r}from"@base-ui/react/fieldset";import{cx as n,hasContent as a,metaTextClasses as i,sheetHeaderGapClasses as t,sheetSectionGapClasses as o,sheetTitleClasses as c}from"../../internal/styles.js";export const Fieldset=/*@__PURE__*/l.forwardRef(function({legend:l,description:d,disabled:m=!1,size:f="md",className:p,children:u,...x},b){const h=a(l)||a(d);return s(r.Root,{ref:b,disabled:m,className:n("m-0 flex min-w-0 flex-col border-0 p-0",o[f],p??""),...x,children:[h?s(r.Legend,{className:`flex min-w-0 flex-col p-0 ${t[f]}`,children:[a(l)?e("span",{className:`font-semibold ${c[f]}`,children:l}):null,a(d)?e("span",{className:`text-(--neba-muted-fg) ${i[f]}`,children:d}):null]}):null,u]})});
@@ -0,0 +1,2 @@
1
+ export { Fieldset } from './Fieldset.js';
2
+ export type { FieldsetProps } from './Fieldset.js';
@@ -0,0 +1 @@
1
+ export{Fieldset}from"./Fieldset.js";
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as n from"react";import{CloseIcon as t}from"../../internal/icons.js";import{controlTextLeadingClasses as a,disabledClasses as l,gapClasses as o,hasContent as i,iconClasses as s,metaTextClasses as c,radiusClasses as d,readOnlyFilterClasses as u,sheetTitleClasses as f,stackGapClasses as p,surfaceClasses as m,surfaceSlots as h,transitionClasses as b}from"../../internal/styles.js";const v={default:{xs:"p-4",sm:"p-5",md:"p-6",lg:"p-8",xl:"p-10"},compact:{xs:"p-2",sm:"p-3",md:"p-4",lg:"p-5",xl:"p-6"}},x={solid:[m,"border-2 border-dashed text-(--neba-fg) bg-(--n-panel-hover)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),outline:[m,"border-2 border-dashed text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"border-2 border-dashed text-(--neba-fg) bg-transparent [border-color:var(--n-line)]"},g={solid:"hover:bg-(--n-panel-press) hover:[border-color:var(--n-line-hover)]",outline:"hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]",text:"hover:bg-(--n-soft) hover:[border-color:var(--n-line-hover)]"};function y(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"M8 10.5V2.75m0 0L5.25 5.5M8 2.75 10.75 5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M2.75 9.75v1.75a1.75 1.75 0 0 0 1.75 1.75h7a1.75 1.75 0 0 0 1.75-1.75V9.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function formatFileSize(e){if(e<1e3)return`${e} B`;const r=["kB","MB","GB","TB"];let n=e/1e3,t=0;for(;n>=1e3&&t<r.length-1;)n/=1e3,t+=1;return`${n<10?n.toFixed(1):Math.round(n)} ${r[t]}`}function k(e,r){const n=e.name.toLowerCase(),t=e.type.toLowerCase();return r.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean).some(e=>e.startsWith(".")?n.endsWith(e):e.endsWith("/*")?t.startsWith(`${e.slice(0,-1)}`):t===e)}export const FilePicker=/*@__PURE__*/n.forwardRef(function({variant:m="outline",size:N="md",color:j="primary",density:$="default",elevation:w=0,accept:z,multiple:C=!1,maxSize:_,maxFiles:L,value:B,defaultValue:D,onFilesChange:I,onReject:M,label:F,description:W,error:S,invalid:R,title:T,hint:V,icon:E,showList:O=!0,removeLabel:q=e=>`Remove ${e}`,fullWidth:A=!0,disabled:P=!1,readOnly:G=!1,required:H=!1,name:Y,id:J,className:K,style:Q,...U},X){const Z=n.useRef(null);n.useImperativeHandle(X,()=>Z.current);const[ee,re]=n.useState(()=>[...D??[]]),ne=n.useMemo(()=>B?[...B]:ee,[B,ee]),te=n.useRef(0),[ae,le]=n.useState(!1),oe=i(S),ie=R??oe,se=ie?"danger":j,ce=P||G,de=n.useId(),ue=n.useCallback(e=>{B||re(e),I?.(e)},[I,B]),fe=n.useCallback(e=>{const r=[],n=[],t=C?L??Number.POSITIVE_INFINITY:1,a=C?ne.length:0;for(const l of e)z&&!k(l,z)?n.push({file:l,reason:"type"}):void 0!==_&&l.size>_?n.push({file:l,reason:"size"}):a+r.length>=t?n.push({file:l,reason:"count"}):r.push(l);return{kept:r,rejections:n}},[z,ne.length,L,_,C]),pe=n.useCallback(e=>{const{kept:r,rejections:n}=fe(e);n.length>0&&M?.(n),r.length>0&&ue(C?[...ne,...r]:r)},[fe,ue,ne,C,M]),me=["flex w-full flex-col items-center justify-center text-center","cursor-pointer select-none",v[$][N],d[N],o[N],b,s,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2",P?`${l[m]} border-2 border-dashed`:G?`${x[m]} ${u} cursor-default`:x[m],ce?"":g[m],ae&&!ce?"bg-(--n-soft-press) [border-color:var(--n-ring)]":""].filter(Boolean).join(" ");return r("div",{className:["flex-col align-top",p[N],A?"flex w-full":"inline-flex",K??""].filter(Boolean).join(" "),style:{...h(se,w),...Q},...U,children:[i(F)?e("span",{className:[c[N],"font-medium",P?"text-(--neba-disabled-fg)":"text-(--neba-fg)"].join(" "),children:F}):null,r("div",{className:"flex w-full flex-col",onDragEnter:e=>{ce||(e.preventDefault(),te.current+=1,le(!0))},onDragOver:e=>{ce||(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:()=>{ce||(te.current=Math.max(0,te.current-1),0===te.current&&le(!1))},onDrop:e=>{ce||(e.preventDefault(),te.current=0,le(!1),pe(Array.from(e.dataTransfer.files)))},children:[r("button",{type:"button",id:J,disabled:P,"aria-describedby":i(W)||oe?de:void 0,"aria-invalid":ie||void 0,className:me,onClick:()=>{ce||Z.current&&(Z.current.value="",Z.current.click())},children:[void 0===E?e("span",{className:"flex items-center text-(--n-accent) [&_svg]:size-[1.8em]",children:e(y,{})}):i(E)?e("span",{className:"flex items-center text-(--n-accent) [&_svg]:size-[1.8em]",children:E}):null,e("span",{className:`font-medium ${f[N]}`,children:T??"Drop files here, or click to browse"}),i(V)?e("span",{className:`text-(--neba-muted-fg) ${c[N]}`,children:V}):null]}),e("input",{ref:Z,type:"file",name:Y,accept:z,multiple:C,required:H&&0===ne.length,disabled:ce,tabIndex:-1,"aria-hidden":"true",className:"absolute size-px overflow-hidden opacity-0 [clip-path:inset(50%)]",onChange:e=>pe(Array.from(e.target.files??[]))})]}),O&&ne.length>0?e("ul",{role:"list",className:`flex w-full flex-col ${p[N]} m-0 list-none p-0`,children:ne.map((n,l)=>r("li",{className:["flex w-full items-center gap-2 px-2 py-1.5",d.xs,a[N],"bg-(--n-soft) text-(--neba-fg)"].join(" "),children:[e("span",{className:"min-w-0 flex-1 truncate",children:n.name}),e("span",{className:`shrink-0 text-(--neba-muted-fg) tabular-nums ${c[N]}`,children:formatFileSize(n.size)}),ce?null:e("button",{type:"button","aria-label":q(n.name),className:["inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full","size-[1.3em] text-(--neba-muted-fg) opacity-70","[transition:opacity_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)]","[&_svg]:size-[0.9em]","hover:text-(--neba-fg) hover:opacity-100 focus-visible:opacity-100","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"].join(" "),onClick:()=>ue(ne.filter((e,r)=>r!==l)),children:e(t,{})})]},`${n.name}-${n.size}-${n.lastModified}-${l}`))}):null,i(W)&&!oe?e("span",{id:de,className:`${c[N]} text-(--neba-muted-fg)`,children:W}):null,oe?e("span",{id:de,className:`${c[N]} text-(--n-accent)`,children:S}):null]})});
1
+ "use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{CloseIcon as r}from"../../internal/icons.js";import{controlTextLeadingClasses as a,cx as l,disabledClasses as o,gapClasses as s,hasContent as i,iconClasses as c,metaTextClasses as d,radiusClasses as u,readOnlyFilterClasses as f,sheetTitleClasses as p,stackGapClasses as m,surfaceClasses as h,surfaceSlots as v,transitionClasses as b}from"../../internal/styles.js";const x={default:{xs:"p-4",sm:"p-5",md:"p-6",lg:"p-8",xl:"p-10"},compact:{xs:"p-2",sm:"p-3",md:"p-4",lg:"p-5",xl:"p-6"}},g={solid:[h,"border-2 border-dashed text-(--neba-fg) bg-(--n-panel-hover)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),outline:[h,"border-2 border-dashed text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"border-2 border-dashed text-(--neba-fg) bg-transparent [border-color:var(--n-line)]"},y={solid:"hover:bg-(--n-panel-press) hover:[border-color:var(--n-line-hover)]",outline:"hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]",text:"hover:bg-(--n-soft) hover:[border-color:var(--n-line-hover)]"};function k(){return n("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"M8 10.5V2.75m0 0L5.25 5.5M8 2.75 10.75 5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M2.75 9.75v1.75a1.75 1.75 0 0 0 1.75 1.75h7a1.75 1.75 0 0 0 1.75-1.75V9.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function formatFileSize(e){if(e<1e3)return`${e} B`;const n=["kB","MB","GB","TB"];let t=e/1e3,r=0;for(;t>=1e3&&r<n.length-1;)t/=1e3,r+=1;return`${t<10?t.toFixed(1):Math.round(t)} ${n[r]}`}function N(e,n){const t=e.name.toLowerCase(),r=e.type.toLowerCase();return n.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean).some(e=>e.startsWith(".")?t.endsWith(e):e.endsWith("/*")?r.startsWith(`${e.slice(0,-1)}`):r===e)}export const FilePicker=/*@__PURE__*/t.forwardRef(function({variant:h="outline",size:$="md",color:w="primary",density:j="default",elevation:L=0,accept:z,multiple:C=!1,maxSize:_,maxFiles:E,value:D,defaultValue:F,onFilesChange:I,onReject:M,label:B,description:W,error:S,invalid:R,title:T,hint:V,icon:O,showList:q=!0,removeLabel:A=e=>`Remove ${e}`,fullWidth:G=!0,disabled:P=!1,readOnly:H=!1,required:Y=!1,name:J,id:K,className:Q,style:U,...X},Z){const ee=t.useRef(null);t.useImperativeHandle(Z,()=>ee.current);const[ne,te]=t.useState(()=>[...F??[]]),re=t.useMemo(()=>D?[...D]:ne,[D,ne]),ae=t.useRef(0),[le,oe]=t.useState(!1);t.useEffect(()=>{const e=()=>{ae.current=0,oe(!1)};return document.addEventListener("dragend",e,!0),document.addEventListener("drop",e,!0),()=>{document.removeEventListener("dragend",e,!0),document.removeEventListener("drop",e,!0)}},[]);const se=i(S),ie=R??se,ce=ie?"danger":w,de=P||H,ue=t.useId(),fe=t.useCallback(e=>{D||te(e),I?.(e)},[I,D]),pe=t.useCallback(e=>{const n=[],t=[],r=C?E??Number.POSITIVE_INFINITY:1,a=C?re.length:0;for(const l of e)z&&!N(l,z)?t.push({file:l,reason:"type"}):void 0!==_&&l.size>_?t.push({file:l,reason:"size"}):a+n.length>=r?t.push({file:l,reason:"count"}):n.push(l);return{kept:n,rejections:t}},[z,re.length,E,_,C]),me=t.useCallback(e=>{const{kept:n,rejections:t}=pe(e);t.length>0&&M?.(t),n.length>0&&fe(C?[...re,...n]:n)},[pe,fe,re,C,M]),he=l("flex w-full flex-col items-center justify-center text-center","cursor-pointer select-none",x[j][$],u[$],s[$],b,c,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2",P?`${o[h]} border-2 border-dashed`:H?`${g[h]} ${f} cursor-default`:g[h],de?"":y[h],le&&!de?"bg-(--n-soft-press) [border-color:var(--n-ring)]":"");return n("div",{className:l("flex-col align-top",m[$],G?"flex w-full":"inline-flex",Q??""),style:{...v(ce,L),...U},...X,children:[i(B)?e("span",{className:[d[$],"font-medium",P?"text-(--neba-disabled-fg)":"text-(--neba-fg)"].join(" "),children:B}):null,n("div",{className:"flex w-full flex-col",onDragEnter:e=>{de||(e.preventDefault(),ae.current+=1,oe(!0))},onDragOver:e=>{de||(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:()=>{de||(ae.current=Math.max(0,ae.current-1),0===ae.current&&oe(!1))},onDrop:e=>{de||(e.preventDefault(),ae.current=0,oe(!1),me(function(e){const n=[...e.items],t=[...e.files];return n.length!==t.length?t:t.filter((e,t)=>{const r=n[t]?.webkitGetAsEntry?.();return!r||r.isFile})}(e.dataTransfer)))},children:[n("button",{type:"button",id:K,disabled:P,"aria-describedby":i(W)||se?ue:void 0,"aria-invalid":ie||void 0,className:he,onClick:()=>{de||ee.current&&(ee.current.value="",ee.current.click())},children:[void 0===O?e("span",{className:"flex items-center text-(--n-accent) [&_svg]:size-[1.8em]",children:e(k,{})}):i(O)?e("span",{className:"flex items-center text-(--n-accent) [&_svg]:size-[1.8em]",children:O}):null,e("span",{className:`font-medium ${p[$]}`,children:T??"Drop files here, or click to browse"}),i(V)?e("span",{className:`text-(--neba-muted-fg) ${d[$]}`,children:V}):null]}),e("input",{ref:ee,type:"file",name:J,accept:z,multiple:C,required:Y&&0===re.length,disabled:de,tabIndex:-1,"aria-hidden":"true",className:"absolute size-px overflow-hidden opacity-0 [clip-path:inset(50%)]",onChange:e=>me(Array.from(e.target.files??[]))})]}),q&&re.length>0?e("ul",{role:"list",className:`flex w-full flex-col ${m[$]} m-0 list-none p-0`,children:re.map((t,l)=>n("li",{className:["flex w-full items-center gap-2 px-2 py-1.5",u.xs,a[$],"bg-(--n-soft) text-(--neba-fg)"].join(" "),children:[e("span",{className:"min-w-0 flex-1 truncate",children:t.name}),e("span",{className:`shrink-0 text-(--neba-muted-fg) tabular-nums ${d[$]}`,children:formatFileSize(t.size)}),de?null:e("button",{type:"button","aria-label":A(t.name),className:["inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full","size-[1.3em] text-(--neba-muted-fg) opacity-70","[transition:opacity_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)]","[&_svg]:size-[0.9em]","hover:text-(--neba-fg) hover:opacity-100 focus-visible:opacity-100","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"].join(" "),onClick:()=>fe(re.filter((e,n)=>n!==l)),children:e(r,{})})]},`${t.name}-${t.size}-${t.lastModified}-${l}`))}):null,i(W)&&!se?e("span",{id:ue,className:`${d[$]} text-(--neba-muted-fg)`,children:W}):null,se?e("span",{id:ue,className:`${d[$]} text-(--n-accent)`,children:S}):null]})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Button as n}from"../button/Button.js";import{CloseIcon as s,PlusIcon as a}from"../../internal/icons.js";import{cx as r,hasContent as i,metaTextClasses as l,radiusClasses as c,surfaceClasses as d}from"../../internal/styles.js";const f=/*@__PURE__*/o.createContext({variant:"solid",size:"md",color:"primary",density:"default",elevation:1,showLabels:!0,reversed:!0,close:()=>{}}),p={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},m={static:"",absolute:"absolute z-30",sticky:"sticky z-30",fixed:"fixed z-40"},u={"top-start":"top-(--n-fab-offset) start-(--n-fab-offset)","top-end":"top-(--n-fab-offset) end-(--n-fab-offset)","bottom-start":"bottom-(--n-fab-offset) start-(--n-fab-offset)","bottom-end":"bottom-(--n-fab-offset) end-(--n-fab-offset)"},b=r("pointer-events-none max-w-40 truncate select-none","px-2 py-0.5 text-(--neba-fg) bg-(--n-panel)",d,c.xs,"[box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]");export const FloatingActionButton=/*@__PURE__*/o.forwardRef(function({variant:i="solid",size:l="lg",color:c="primary",density:d="default",elevation:b=2,icon:v,label:x,extended:y=!1,openIcon:h,position:g="fixed",corner:w="bottom-end",offset:z=16,direction:C,open:k,defaultOpen:L=!1,onOpenChange:N,openOnHover:j=!0,closeOnAction:E=!0,showLabels:P=!0,disabled:R=!1,className:A,style:I,children:O,onClick:B,onKeyDown:D,onPointerEnter:F,onPointerLeave:K,...T},W){const H=o.useId(),M=o.useRef(null),S=o.useRef(null),[$,q]=o.useState(L),G=void 0!==k,J=o.Children.toArray(O).length>0,Q=(G?k:$)&&J&&!R,U=o.useCallback(e=>{G||q(e),N?.(e)},[G,N]),V=o.useCallback(()=>U(!1),[U]);o.useEffect(()=>{if(!Q)return;const e=e=>{const t=S.current;t&&e.target instanceof Node&&!t.contains(e.target)&&V()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[Q,V]);const X=C??(w.startsWith("bottom")?"top":"bottom"),Y=w.endsWith("end"),Z=o.useMemo(()=>({variant:i,size:p[l],color:c,density:d,elevation:b,showLabels:P,reversed:Y,close:E?V:()=>{}}),[i,l,c,d,b,P,Y,E,V]),_=Q&&!1!==h?h??e(s,{}):v??e(a,{});return t("div",{ref:e=>{S.current=e,"function"==typeof W?W(e):W&&(W.current=e)},className:r("flex w-fit","top"===X?"flex-col-reverse":"flex-col",Y?"items-end":"items-start","xs"===l||"sm"===l?"gap-1.5":"gap-2",m[g],"static"===g?"":u[w],A),style:{"--n-fab-offset":"number"==typeof z?`${z}px`:z,...I},onKeyDown:e=>{"Escape"===e.key&&Q&&(e.stopPropagation(),V(),M.current?.focus()),D?.(e)},onPointerEnter:e=>{j&&J&&!R&&"mouse"===e.pointerType&&U(!0),F?.(e)},onPointerLeave:e=>{j&&"mouse"===e.pointerType&&V(),K?.(e)},...T,children:[e(n,{ref:M,variant:i,size:l,color:c,density:d,elevation:b,disabled:R,"aria-label":x,"aria-expanded":J?Q:void 0,"aria-controls":J&&Q?H:void 0,startIcon:_,style:{borderRadius:"9999px"},onClick:e=>{J&&U(!Q),B?.(e)},children:y?x:void 0}),Q?e("div",{id:H,className:r("flex","top"===X?"flex-col-reverse":"flex-col",Y?"items-end":"items-start","xs"===l||"sm"===l?"gap-1.5":"gap-2"),children:e(f.Provider,{value:Z,children:O})}):null]})});export const FloatingAction=/*@__PURE__*/o.forwardRef(function({icon:s,label:a,disabled:c=!1,className:d,onClick:p,...m},u){const v=o.useContext(f);return t("div",{className:r("flex items-center gap-2",v.reversed?"flex-row-reverse":"flex-row",d),children:[e(n,{ref:u,variant:v.variant,size:v.size,color:v.color,density:v.density,elevation:v.elevation,disabled:c,"aria-label":a,startIcon:s,style:{borderRadius:"9999px"},onClick:e=>{p?.(e),v.close()},...m}),v.showLabels&&i(a)?e("span",{"aria-hidden":"true",className:r(b,l[v.size]),children:a}):null]})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{Button as n}from"../button/Button.js";import{CloseIcon as s,PlusIcon as a}from"../../internal/icons.js";import{cx as r,hasContent as i,metaTextClasses as l,radiusClasses as c,surfaceClasses as d}from"../../internal/styles.js";const f=/*@__PURE__*/o.createContext({variant:"solid",size:"md",color:"primary",density:"default",elevation:1,showLabels:!0,reversed:!0,close:()=>{}}),p={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},m={static:"",absolute:"absolute z-30",sticky:"sticky z-30",fixed:"fixed z-40"},u={"top-start":"top-(--n-fab-offset) start-(--n-fab-offset)","top-end":"top-(--n-fab-offset) end-(--n-fab-offset)","bottom-start":"bottom-(--n-fab-offset) start-(--n-fab-offset)","bottom-end":"bottom-(--n-fab-offset) end-(--n-fab-offset)"},b=r("pointer-events-none max-w-40 truncate select-none","px-2 py-0.5 text-(--neba-fg) bg-(--n-panel)",d,c.xs,"[box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]");export const FloatingActionButton=/*@__PURE__*/o.forwardRef(function({variant:i="solid",size:l="lg",color:c="primary",density:d="default",elevation:b=2,icon:v,label:x,extended:y=!1,openIcon:h,position:g="fixed",corner:w="bottom-end",offset:z=16,direction:C,open:k,defaultOpen:L=!1,onOpenChange:N,openOnHover:j=!0,closeOnAction:E=!0,showLabels:P=!0,disabled:R=!1,className:A,style:I,children:O,onClick:B,onKeyDown:D,onPointerEnter:F,onPointerLeave:K,...T},W){const H=o.useId(),M=o.useRef(null),S=o.useRef(null),[$,q]=o.useState(L),G=void 0!==k,J=o.Children.toArray(O).length>0,Q=(G?k:$)&&J&&!R,U=o.useCallback(e=>{G||q(e),N?.(e)},[G,N]),V=o.useCallback(()=>U(!1),[U]);o.useEffect(()=>{if(!Q)return;const e=e=>{const t=S.current;t&&e.target instanceof Node&&!t.contains(e.target)&&V()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[Q,V]);const X=C??(w.startsWith("bottom")?"top":"bottom"),Y=w.endsWith("end"),Z=o.useMemo(()=>({variant:i,size:p[l],color:c,density:d,elevation:b,showLabels:P,reversed:Y,close:E?V:()=>{}}),[i,l,c,d,b,P,Y,E,V]),_=Q&&!1!==h?h??e(s,{}):v??e(a,{});return t("div",{ref:e=>{S.current=e,"function"==typeof W?W(e):W&&(W.current=e)},className:r("flex w-fit","top"===X?"flex-col-reverse":"flex-col",Y?"items-end":"items-start","xs"===l||"sm"===l?"gap-1.5":"gap-2",m[g],"static"===g?"":u[w],A),style:{"--n-fab-offset":"number"==typeof z?`${z}px`:z,...I},onKeyDown:e=>{"Escape"===e.key&&Q&&(e.stopPropagation(),V(),M.current?.focus()),D?.(e)},onPointerEnter:e=>{j&&J&&!R&&"mouse"===e.pointerType&&U(!0),F?.(e)},onPointerLeave:e=>{j&&"mouse"===e.pointerType&&V(),K?.(e)},...T,children:[e(n,{ref:M,variant:i,size:l,color:c,density:d,elevation:b,disabled:R,"aria-label":x,"aria-expanded":J?Q:void 0,"aria-controls":J&&Q?H:void 0,startIcon:_,style:{borderRadius:"9999px"},onClick:e=>{J&&U(!Q),B?.(e)},children:y?x:void 0}),Q?e("div",{id:H,className:r("flex","top"===X?"flex-col-reverse":"flex-col",Y?"items-end":"items-start","xs"===l||"sm"===l?"gap-1.5":"gap-2"),children:e(f.Provider,{value:Z,children:O})}):null]})});export const FloatingAction=/*@__PURE__*/o.forwardRef(function({icon:s,label:a,disabled:c=!1,className:d,onClick:p,...m},u){const v=o.useContext(f);return t("div",{className:r("flex items-center gap-2",v.reversed?"flex-row-reverse":"flex-row",d),children:[e(n,{ref:u,variant:v.variant,size:v.size,color:v.color,density:v.density,elevation:v.elevation,disabled:c,"aria-label":a,startIcon:s,style:{borderRadius:"9999px"},onClick:e=>{p?.(e),v.close()},...m}),v.showLabels&&i(a)?e("span",{"aria-hidden":"true",className:r(b,l[v.size]),children:a}):null]})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRender as n}from"@base-ui/react/use-render";import{barMinHeightClasses as r,BottomNavigationContext as o}from"../../internal/bottom-navigation.js";import{cx as s,surfaceClasses as l,surfaceSlots as i,transitionClasses as f}from"../../internal/styles.js";const u={solid:[l,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[l,"border text-(--neba-fg) bg-(--n-panel-hover)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},d={static:"relative mx-auto w-fit",absolute:"absolute inset-x-0 bottom-(--n-nav-offset) z-30 mx-auto w-fit",sticky:"sticky bottom-(--n-nav-offset) z-30 mx-auto w-fit",fixed:"fixed inset-x-0 bottom-(--n-nav-offset) z-40 mx-auto w-fit"},p={default:{xs:"p-1",sm:"p-1",md:"p-1.5",lg:"p-1.5",xl:"p-2"},compact:{xs:"p-0.5",sm:"p-0.5",md:"p-1",lg:"p-1",xl:"p-1"}},c={solid:`${l} bg-(--n-panel-hover) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,outline:`${l} bg-(--n-soft-hover) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,text:"bg-(--n-soft-hover)"},b={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const FloatingBottomNavigation=/*@__PURE__*/a.forwardRef(function({variant:l="outline",size:v="md",color:m="primary",density:x="default",elevation:g=2,value:y,defaultValue:h=null,onValueChange:w,position:$="fixed",offset:j=16,labels:z="selected",safeArea:k=!0,disabled:P=!1,label:A,render:C,className:N,style:R,children:E,...L},S){const[V,W]=a.useState(h),q=void 0!==y,B=q?y:V,F=a.useCallback(e=>{q||W(e),w?.(e)},[q,w]),H=a.useMemo(()=>({value:B??null,change:F,size:v,density:x,labels:z,disabled:P,floating:!0}),[B,F,v,x,z,P]),M=a.useRef(null),O=a.useRef(null),T=a.useCallback(e=>{M.current=e,"function"==typeof S?S(e):S&&(S.current=e)},[S]),D=a.useCallback(e=>{const t=M.current,a=O.current;if(!t||!a)return;const n=t.querySelector("[data-nav-item][aria-current]");if(!n)return;const r=!e||!a.hasAttribute("data-ready");r&&a.removeAttribute("data-ready"),a.style.setProperty("--n-nav-x",`${n.offsetLeft}px`),a.style.setProperty("--n-nav-y",`${n.offsetTop}px`),a.style.setProperty("--n-nav-w",`${n.offsetWidth}px`),a.style.setProperty("--n-nav-h",`${n.offsetHeight}px`),r&&a.offsetWidth,a.setAttribute("data-ready","")},[]);a.useLayoutEffect(()=>{D(!0)},[D,B,l,v,x,z,E]),a.useEffect(()=>{const e=M.current;if(!e)return;const t=new ResizeObserver(()=>D(!1));return t.observe(e),()=>t.disconnect()},[D]);const G="number"==typeof j?`${j}px`:j,I=s("flex max-w-full min-w-0 items-center rounded-full",r[v],p[x][v],b[v],u[l],d[$],f,N);return n({render:C??e("nav",{}),ref:T,props:{"aria-label":A,className:I,style:{...i(m,g),"--n-nav-offset":k?`calc(${G} + env(safe-area-inset-bottom))`:G,...R},children:t(o.Provider,{value:H,children:[null!=B?e("span",{ref:O,"aria-hidden":"true",className:s("pointer-events-none absolute rounded-full","top-(--n-nav-y) left-(--n-nav-x) h-(--n-nav-h) w-(--n-nav-w)",c[l],"[transition-property:left,top,width,height]","[transition-timing-function:var(--neba-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--neba-duration)]","motion-reduce:[transition-duration:0ms]")}):null,E]}),...L}})});
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRender as n}from"@base-ui/react/use-render";import{barMinHeightClasses as o,BottomNavigationContext as r}from"../../internal/bottom-navigation.js";import{observeResize as s}from"../../internal/observe.js";import{cx as l,surfaceClasses as i,surfaceSlots as f,transitionClasses as u}from"../../internal/styles.js";const d={solid:[i,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[i,"border text-(--neba-fg) bg-(--n-panel-hover)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},p={static:"relative mx-auto w-fit",absolute:"absolute inset-x-0 bottom-(--n-nav-offset) z-30 mx-auto w-fit",sticky:"sticky bottom-(--n-nav-offset) z-30 mx-auto w-fit",fixed:"fixed inset-x-0 bottom-(--n-nav-offset) z-40 mx-auto w-fit"},b={default:{xs:"p-1",sm:"p-1",md:"p-1.5",lg:"p-1.5",xl:"p-2"},compact:{xs:"p-0.5",sm:"p-0.5",md:"p-1",lg:"p-1",xl:"p-1"}},c={solid:`${i} bg-(--n-panel-hover) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,outline:`${i} bg-(--n-soft-hover) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,text:"bg-(--n-soft-hover)"},m={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const FloatingBottomNavigation=/*@__PURE__*/a.forwardRef(function({variant:i="outline",size:v="md",color:x="primary",density:g="default",elevation:y=2,value:h,defaultValue:w=null,onValueChange:j,position:$="fixed",offset:k=16,labels:z="selected",safeArea:P=!0,disabled:A=!1,label:C,render:N,className:R,style:E,children:L,...S},V){const[W,q]=a.useState(w),B=void 0!==h,F=B?h:W,H=a.useCallback(e=>{B||q(e),j?.(e)},[B,j]),M=a.useMemo(()=>({value:F??null,change:H,size:v,density:g,labels:z,disabled:A,floating:!0}),[F,H,v,g,z,A]),T=a.useRef(null),D=a.useRef(null),G=a.useCallback(e=>{T.current=e,"function"==typeof V?V(e):V&&(V.current=e)},[V]),I=a.useCallback(e=>{const t=T.current,a=D.current;if(!t||!a)return;const n=t.querySelector("[data-nav-item][aria-current]");if(!n)return;const o=!e||!a.hasAttribute("data-ready");o&&a.removeAttribute("data-ready"),a.style.setProperty("--n-nav-x",`${n.offsetLeft}px`),a.style.setProperty("--n-nav-y",`${n.offsetTop}px`),a.style.setProperty("--n-nav-w",`${n.offsetWidth}px`),a.style.setProperty("--n-nav-h",`${n.offsetHeight}px`),o&&a.offsetWidth,a.setAttribute("data-ready","")},[]);a.useLayoutEffect(()=>{I(!0)},[I,F,i,v,g,z,L]),a.useEffect(()=>{const e=T.current;if(e)return s(e,()=>I(!1))},[I]);const J="number"==typeof k?`${k}px`:k,K=l("flex max-w-full min-w-0 items-center rounded-full",o[v],b[g][v],m[v],d[i],p[$],u,R);return n({render:N??e("nav",{}),ref:G,props:{"aria-label":C,className:K,style:{...f(x,y),"--n-nav-offset":P?`calc(${J} + env(safe-area-inset-bottom))`:J,...E},children:t(r.Provider,{value:M,children:[null!=F?e("span",{ref:D,"aria-hidden":"true",className:l("pointer-events-none absolute rounded-full","top-(--n-nav-y) left-(--n-nav-x) h-(--n-nav-h) w-(--n-nav-w)",c[i],"[transition-property:left,top,width,height]","[transition-timing-function:var(--neba-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--neba-duration)]","motion-reduce:[transition-duration:0ms]")}):null,L]}),...S}})});
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useRender as t}from"@base-ui/react/use-render";import{boxPaddingXClasses as a,boxPaddingYClasses as o}from"../box/Box.js";import{PageLayoutContext as n}from"../../internal/page-layout.js";import{cx as s,surfaceClasses as i,surfaceSlots as l,transitionClasses as m}from"../../internal/styles.js";const d={solid:[i,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[i,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},x={static:"",sticky:"sticky bottom-0 z-30",fixed:"fixed inset-x-0 bottom-0 z-40"},c={xs:"max-w-[30rem]",sm:"max-w-[40rem]",md:"max-w-[48rem]",lg:"max-w-[64rem]",xl:"max-w-[80rem]"};export const Footer=/*@__PURE__*/r.forwardRef(function({position:i="static",variant:f="outline",size:p="md",color:b="primary",density:u="default",elevation:v=0,divider:w=!0,maxWidth:g="none",padded:y=!0,label:j,render:h,className:k,style:z,children:N,...C},B){const F=r.useContext(n),{register:R}=F,W=r.useCallback(e=>{R("footer",e),"function"==typeof B?B(e):B&&(B.current=e)},[R,B]),q=s("w-full min-w-0",d[f],w?"border-t [border-color:var(--n-line)]":"",x[i],m,k);return t({render:h??e("footer",{}),ref:W,props:{"aria-label":j,className:q,style:{...l(b,v),...z},children:e("div",{className:s("w-full",y?s(a[u][p],o[u][p]):"","none"===g?"":s(c[g],"mx-auto")),children:N}),...C}})});
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{useRender as t}from"@base-ui/react/use-render";import{boxPaddingXClasses as a,boxPaddingYClasses as o}from"../box/Box.js";import{PageLayoutContext as n}from"../../internal/page-layout.js";import{cx as s,surfaceClasses as i,surfaceSlots as l,transitionClasses as m}from"../../internal/styles.js";const d={solid:[i,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[i,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},x={static:"",sticky:"sticky bottom-0 z-30",fixed:"fixed inset-x-0 bottom-0 z-40"},c={xs:"max-w-[30rem]",sm:"max-w-[40rem]",md:"max-w-[48rem]",lg:"max-w-[64rem]",xl:"max-w-[80rem]"};export const Footer=/*@__PURE__*/r.forwardRef(function({position:i="static",variant:f="outline",size:p="md",color:b="primary",density:u="default",elevation:v=0,divider:w=!0,maxWidth:g="none",padded:y=!0,label:j,render:h,className:k,style:z,children:N,...C},B){const F=r.useContext(n),{register:R}=F,W=r.useCallback(e=>{R("footer",e),"function"==typeof B?B(e):B&&(B.current=e)},[R,B]),q=s("w-full min-w-0",d[f],w?"border-t [border-color:var(--n-line)]":"",x[i],m,k);return t({render:h??e("footer",{}),ref:W,props:{"aria-label":j,className:q,style:{...l(b,v),...z},children:e("div",{className:s("w-full",y?s(a[u][p],o[u][p]):"","none"===g?"":s(c[g],"mx-auto")),children:N}),...C}})});
@@ -0,0 +1,58 @@
1
+ import * as React from 'react';
2
+ import type { NebaSize } from '../../types.js';
3
+ /**
4
+ * When a field decides whether it is valid.
5
+ *
6
+ * Base UI's own three, kept under its own spelling because they are what a
7
+ * caller will read about everywhere else and a nicer synonym would only be a
8
+ * word to translate back.
9
+ */
10
+ export type FormValidationMode = 'onSubmit' | 'onBlur' | 'onChange';
11
+ /** Errors that came from somewhere else, keyed by the field's `name`. */
12
+ export type FormErrors = Record<string, string | string[]>;
13
+ export interface FormProps extends Omit<React.ComponentPropsWithoutRef<'form'>, 'onSubmit'> {
14
+ /**
15
+ * When a field validates.
16
+ *
17
+ * - `onSubmit` — on submit, and on every change afterwards. The default, and
18
+ * the only one that does not tell somebody their email is wrong while they
19
+ * are still typing it.
20
+ * - `onBlur` — when a field loses focus.
21
+ * - `onChange` — on every keystroke.
22
+ * @default 'onSubmit'
23
+ */
24
+ validationMode?: FormValidationMode;
25
+ /**
26
+ * Errors from outside the browser's own validation — a server, a form action,
27
+ * a schema — keyed by the `name` of the field each belongs to. They are shown
28
+ * on the field, and cleared as soon as that field changes.
29
+ */
30
+ errors?: FormErrors;
31
+ /**
32
+ * Called on a valid submit, with the form's values. The native submit event is
33
+ * prevented, so nothing navigates.
34
+ */
35
+ onSubmit?: (values: Record<string, unknown>) => void;
36
+ /**
37
+ * The gap between the form's children. A form is a stack, and this is which
38
+ * rung of the ladder it stacks on.
39
+ * @default 'md'
40
+ */
41
+ size?: NebaSize;
42
+ children?: React.ReactNode;
43
+ }
44
+ /**
45
+ * A `<form>` that knows which of its fields is wrong.
46
+ *
47
+ * On its own, a page of [TextField](./text-field)s validates one field at a
48
+ * time and a failed submit leaves the reader to find the red one. What this
49
+ * adds is the part that has to be owned above the fields: a submit collects
50
+ * every field's validity at once, focuses the first one that failed, and
51
+ * `errors` puts a server's answer back on the field it belongs to rather than
52
+ * in a banner at the top.
53
+ *
54
+ * It is not a form *library*. There is no schema, no resolver and no field
55
+ * array here — a project that wants those keeps them and hands the result to
56
+ * `errors`, which is the seam this is built around.
57
+ */
58
+ export declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as r}from"react/jsx-runtime";import*as o from"react";import{Form as e}from"@base-ui/react/form";import{cx as t,sheetSectionGapClasses as i}from"../../internal/styles.js";export const Form=/*@__PURE__*/o.forwardRef(function({validationMode:o="onSubmit",errors:m,onSubmit:s,size:a="md",className:n,children:l,...c},f){return r(e,{ref:f,validationMode:o,errors:m,onFormSubmit:r=>s?.(r),className:t("flex flex-col",i[a],n??""),...c,children:l})});
@@ -0,0 +1,2 @@
1
+ export { Form } from './Form.js';
2
+ export type { FormErrors, FormProps, FormValidationMode } from './Form.js';
@@ -0,0 +1 @@
1
+ export{Form}from"./Form.js";
@@ -0,0 +1,62 @@
1
+ import * as React from 'react';
2
+ import { type ChartBaseProps } from '../../internal/chart-frame.js';
3
+ import type { NebaThreshold } from '../../types.js';
4
+ export interface GaugeChartProps extends Omit<ChartBaseProps, 'legend' | 'tooltip'> {
5
+ /**
6
+ * The reading. `null` draws the dial with nothing on it, which is the honest
7
+ * picture of an instrument that has not been told anything.
8
+ */
9
+ value: number | null;
10
+ /** @default 0 */
11
+ min?: number;
12
+ /** @default 100 */
13
+ max?: number;
14
+ /**
15
+ * How far round the dial goes, in degrees, opened symmetrically about twelve
16
+ * o'clock. `180` is the half-dial a dashboard tile wants; `270` is the
17
+ * instrument shape; `360` is a ring.
18
+ * @default 180
19
+ */
20
+ sweep?: number;
21
+ /** How thick the arc is, as a fraction of its radius. @default 0.22 */
22
+ thickness?: number;
23
+ /**
24
+ * Where the arc changes colour — the same `{ from, color }` entries a
25
+ * [Meter](../feedback/meter) takes, and with the same rule: the last one the
26
+ * value has reached wins, and below all of them `color` stands.
27
+ */
28
+ thresholds?: readonly NebaThreshold[];
29
+ /**
30
+ * How many marks are drawn around the dial, ends included. `false` — the
31
+ * default — draws none: a gauge on a dashboard is read as a proportion, and
32
+ * ticks are for an instrument somebody takes a *number* off.
33
+ * @default false
34
+ */
35
+ ticks?: number | false;
36
+ /** Writes `min` and `max` at the two ends of the arc. @default true */
37
+ showRange?: boolean;
38
+ /**
39
+ * What goes in the middle. Left out, it is the value written through `format`
40
+ * — which is what the dial is for, so replacing it is for adding to it rather
41
+ * than for taking it away.
42
+ */
43
+ center?: React.ReactNode;
44
+ /** A line under the value: the unit, or what is being measured. */
45
+ caption?: React.ReactNode;
46
+ }
47
+ /**
48
+ * One number on a scale that is known in advance, drawn as a dial.
49
+ *
50
+ * It is a [Meter](../feedback/meter) bent into an arc, and the two are
51
+ * deliberately the same component in two shapes: `value`, `min`, `max` and
52
+ * `thresholds` mean exactly what they mean there, so a page can move a reading
53
+ * from a bar to a dial without changing what it says. Reach for the bar in a
54
+ * row of fields and for this one in a tile of its own, where a dial reads at a
55
+ * glance from across a room and a four-pixel bar does not.
56
+ *
57
+ * It is not a [PieChart](./pie-chart) with `shape="semi"`. A pie is *parts of a
58
+ * whole* and every slice is a category; this is one value against a scale, and
59
+ * the unfilled part of the arc is not a second category — it is the rest of the
60
+ * dial.
61
+ */
62
+ export declare function GaugeChart({ value, min, max, sweep, thickness, thresholds, ticks, showRange, center, caption, height, format, locale, label, empty, size, variant, color, padded, className, ...box }: GaugeChartProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ "use client";import{jsx as t,jsxs as e,Fragment as a}from"react/jsx-runtime";import*as n from"react";import{ChartSurface as l,useMeasuredWidth as r}from"../../internal/chart-frame.js";import{arcPath as i,chartFontSizes as s,compactNumber as o,plotHeights as m}from"../../internal/chart.js";import{numberFormatter as h}from"../../internal/format.js";import{emptyMessages as c,useMessages as d}from"../../internal/i18n.js";import{cx as u,metaTextClasses as f}from"../../internal/styles.js";function x(t,e,a,n){const l=(n-90)*Math.PI/180;return[t+a*Math.cos(l),e+a*Math.sin(l)]}export function GaugeChart({value:p,min:b=0,max:v=100,sweep:g=180,thickness:M=.22,thresholds:y,ticks:N=!1,showRange:j=!0,center:k,caption:$,height:w,format:z,locale:I,label:P,empty:S,size:A="md",variant:C="text",color:R="primary",padded:B=!1,className:F,...G}){const L=n.useRef(null),W=r(L),Y=d(c,I),q=n.useCallback(t=>z?h(I,z).format(t):o(t,I),[z,I]),D=Math.max(1,Math.min(360,g)),E=D/2,H=-E,J=E,K=v-b,O=null===p||Number.isNaN(p)||0===K?null:Math.min(1,Math.max(0,(p-b)/K)),Q=null===p?R:function(t,e,a){if(!a||0===a.length)return e;let n=e;for(const e of a)t>=e.from&&(n=e.color);return n}(p,R,y),T="number"==typeof w?w:m[A],U=s[A],V=D>=360?1:Math.max(0,-Math.cos(E*Math.PI/180)),X=D>=180?1:Math.sin(E*Math.PI/180),Z=U*(j?1.6:.6),_=Math.max(0,Math.min((W-2*Z)/(2*X),(T-Z*(V>0?2:1))/(1+V))),tt=_*(1-Math.min(.9,Math.max(.05,M))),et=W/2,at=Z+_,nt=_<=0||0===K,lt=null===O?H:H+D*O,rt=at-_+_*(1+V)/2,it=!1===N?0:Math.max(2,Math.floor(N));return t(l,{...G,variant:C,color:R,size:A,padded:B,legendSide:"bottom",className:F,legend:null,table:null,children:t("div",{ref:L,className:"relative w-full",style:{height:T},role:void 0===P?void 0:"img","aria-label":void 0===P?void 0:null===p?P:`${P}: ${q(p)} / ${q(v)}`,children:nt?t("div",{className:u("flex h-full items-center justify-center text-(--neba-muted-fg)",f[A]),children:S??Y.title}):W>0?e(a,{children:[e("svg",{width:W,height:T,viewBox:`0 0 ${W} ${T}`,"aria-hidden":"true",className:"block",children:[t("path",{d:i(et,at,_,tt,H,J),fill:`var(--neba-${R}-soft)`}),null!==O&&O>0?t("path",{d:i(et,at,_,tt,H,lt),fill:`var(--neba-${Q}-fill)`,style:{transition:"fill var(--neba-duration) var(--neba-ease)"}}):null,it>0?Array.from({length:it},(e,a)=>{const n=H+D*a/(it-1),[l,r]=x(et,at,_+.25*U,n),[i,s]=x(et,at,_+.6*U,n);return t("line",{x1:l,y1:r,x2:i,y2:s,stroke:"var(--neba-chart-grid)",strokeWidth:1,strokeLinecap:"round"},a)}):null,j?[[b,H,"start"],[v,J,"end"]].map(([e,a,n])=>{const[l,r]=x(et,at,(_+tt)/2,a);return t("text",{x:l+(D>=300?0:"start"===n?.6*-U:.6*U),y:r+U*(D>=300?1.4:.35),textAnchor:D>=300?"middle":"start"===n?"end":"start",fontSize:U,fill:"var(--neba-muted-fg)",children:q(e)},n)}):null]}),e("div",{className:"pointer-events-none absolute inset-x-0 flex flex-col items-center gap-0.5",style:{top:rt,transform:"translateY(-50%)"},children:[t("span",{className:"font-semibold tabular-nums text-(--neba-fg)",style:{fontSize:2*U},children:k??(null===p?"—":q(p))}),$?t("span",{className:u("text-(--neba-muted-fg)",f[A]),children:$}):null]})]}):null})})}
@@ -0,0 +1,2 @@
1
+ export { GaugeChart } from './GaugeChart.js';
2
+ export type { GaugeChartProps } from './GaugeChart.js';
@@ -0,0 +1 @@
1
+ export{GaugeChart}from"./GaugeChart.js";
@@ -1 +1 @@
1
- import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{alignSelfClasses as n,offsetValue as o,responsiveSlots as s,spanValue as t}from"../../internal/grid.js";export const Grid=/*@__PURE__*/e.forwardRef(function({span:e,offset:a,alignSelf:i,render:f,className:l,style:c,children:d,...m},p){const u=["neba-grid-item",i?n[i]:"",l??""].filter(Boolean).join(" ");return r({render:f,ref:p,props:{className:u,style:{...s("span",e,t),...s("offset",a,o),...c},children:d,...m}})});
1
+ "use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{alignSelfClasses as s,offsetValue as t,responsiveSlots as n,spanValue as i}from"../../internal/grid.js";import{cx as o}from"../../internal/styles.js";export const Grid=/*@__PURE__*/e.forwardRef(function({span:e,offset:a,alignSelf:f,render:l,className:m,style:c,children:d,...p},u){const g=o("neba-grid-item",f?s[f]:"",m??"");return r({render:l,ref:u,props:{className:g,style:{...n("span",e,i),...n("offset",a,t),...c},children:d,...p}})});
@@ -1 +1 @@
1
- import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{alignContentClasses as n,alignItemsClasses as a,columnCount as o,justifyContentClasses as t,responsiveSlots as i,spacingValue as s,withBaseline as p}from"../../internal/grid.js";import{boxPaddingClasses as l}from"../box/Box.js";export const GridContainer=/*@__PURE__*/e.forwardRef(function({columns:e,spacing:c,rowSpacing:d,columnSpacing:f,justifyContent:m,alignItems:g,alignContent:x,wrap:u=!0,padded:y=!0,size:w="md",density:j="default",render:b,className:C,style:h,children:B,...N},S){const z=["neba-grid flex",u?"flex-wrap":"flex-nowrap","gap-x-(--n-gap-x) gap-y-(--n-gap-y)",y?l[j][w]:"",m?t[m]:"",g?a[g]:"",x?n[x]:"",C??""].filter(Boolean).join(" ");return r({render:b,ref:S,props:{className:z,style:{...i("cols",p(e,12),o),...i("gap-x",p(f??c,2),s),...i("gap-y",p(d??c,2),s),...h},children:B,...N}})});
1
+ "use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{alignContentClasses as n,alignItemsClasses as a,columnCount as t,justifyContentClasses as o,responsiveSlots as s,spacingValue as i,withBaseline as p}from"../../internal/grid.js";import{boxPaddingClasses as l}from"../box/Box.js";import{cx as c}from"../../internal/styles.js";export const GridContainer=/*@__PURE__*/e.forwardRef(function({columns:e,spacing:m,rowSpacing:d,columnSpacing:f,justifyContent:g,alignItems:u,alignContent:x,wrap:y=!0,padded:w=!0,size:j="md",density:b="default",render:C,className:h,style:N,children:S,...z},B){const G=c("neba-grid flex",y?"flex-wrap":"flex-nowrap","gap-x-(--n-gap-x) gap-y-(--n-gap-y)",w?l[b][j]:"",g?o[g]:"",u?a[u]:"",x?n[x]:"",h??"");return r({render:C,ref:B,props:{className:G,style:{...s("cols",p(e,12),t),...s("gap-x",p(f??m,2),i),...s("gap-y",p(d??m,2),i),...N},children:S,...z}})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useRender as n}from"@base-ui/react/use-render";import{boxPaddingXClasses as t}from"../box/Box.js";import{PageLayoutContext as s}from"../../internal/page-layout.js";import{cx as i,hasContent as l,surfaceClasses as m,surfaceSlots as o,transitionClasses as d}from"../../internal/styles.js";const c={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-20"},x={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-5"},f={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-8",xl:"gap-10"},p={xs:"max-w-[30rem]",sm:"max-w-[40rem]",md:"max-w-[48rem]",lg:"max-w-[64rem]",xl:"max-w-[80rem]"},u={solid:[m,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[m,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},g={static:"",sticky:"sticky top-0 z-30",fixed:"fixed inset-x-0 top-0 z-40"},h={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},b={start:"flex min-w-0 flex-1 items-center justify-start",center:"flex min-w-0 shrink items-center justify-center",end:"flex min-w-0 flex-1 items-center justify-end"};export const Header=/*@__PURE__*/r.forwardRef(function({brand:m,actions:v,align:w="start",position:y="sticky",variant:j="outline",size:N="md",color:k="primary",density:z="default",elevation:C=0,divider:B=!0,maxWidth:H="none",padded:R=!0,label:W,render:q,className:A,style:D,children:E,...F},G){const I=r.useContext(s),{register:J}=I,K=r.useCallback(e=>{J("header",e),"function"==typeof G?G(e):G&&(G.current=e)},[J,G]),L=i("w-full min-w-0",u[j],B?"border-b [border-color:var(--n-line)]":"",g[y],d,A);return n({render:q??e("header",{}),ref:K,props:{"aria-label":W,className:L,style:{...o(k,C),...D},children:a("div",{className:i("flex w-full items-center",c[N],f[N],R?t[z][N]:"","none"===H?"":i(p[H],"mx-auto")),children:[l(m)?e("div",{className:i("flex min-w-0 items-center",h[w],x[N]),children:m}):"center"===w?e("div",{"aria-hidden":"true",className:h[w]}):null,l(E)?e("div",{className:i(b[w],x[N]),children:E}):null,l(v)?e("div",{className:i("flex min-w-0 items-center justify-end",h[w],x[N]),children:v}):"center"===w?e("div",{"aria-hidden":"true",className:h[w]}):null]}),...F}})});
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useRender as n}from"@base-ui/react/use-render";import{boxPaddingXClasses as t}from"../box/Box.js";import{PageLayoutContext as s}from"../../internal/page-layout.js";import{cx as i,hasContent as l,surfaceClasses as m,surfaceSlots as o,transitionClasses as d}from"../../internal/styles.js";const c={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-20"},x={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-5"},f={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-8",xl:"gap-10"},p={xs:"max-w-[30rem]",sm:"max-w-[40rem]",md:"max-w-[48rem]",lg:"max-w-[64rem]",xl:"max-w-[80rem]"},u={solid:[m,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[m,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},g={static:"",sticky:"sticky top-0 z-30",fixed:"fixed inset-x-0 top-0 z-40"},h={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},b={start:"flex min-w-0 flex-1 items-center justify-start",center:"flex min-w-0 shrink items-center justify-center",end:"flex min-w-0 flex-1 items-center justify-end"};export const Header=/*@__PURE__*/r.forwardRef(function({brand:m,actions:v,align:w="start",position:y="sticky",variant:j="outline",size:N="md",color:k="primary",density:z="default",elevation:C=0,divider:B=!0,maxWidth:H="none",padded:R=!0,label:W,render:q,className:A,style:D,children:E,...F},G){const I=r.useContext(s),{register:J}=I,K=r.useCallback(e=>{J("header",e),"function"==typeof G?G(e):G&&(G.current=e)},[J,G]),L=i("w-full min-w-0",u[j],B?"border-b [border-color:var(--n-line)]":"",g[y],d,A);return n({render:q??e("header",{}),ref:K,props:{"aria-label":W,className:L,style:{...o(k,C),...D},children:a("div",{className:i("flex w-full items-center",c[N],f[N],R?t[z][N]:"","none"===H?"":i(p[H],"mx-auto")),children:[l(m)?e("div",{className:i("flex min-w-0 items-center",h[w],x[N]),children:m}):"center"===w?e("div",{"aria-hidden":"true",className:h[w]}):null,l(E)?e("div",{className:i(b[w],x[N]),children:E}):null,l(v)?e("div",{className:i("flex min-w-0 items-center justify-end",h[w],x[N]),children:v}):"center"===w?e("div",{"aria-hidden":"true",className:h[w]}):null]}),...F}})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{ChartScaleLegend as n,ChartSurface as i,ChartTooltipPanel as a,useMeasuredWidth as r}from"../../internal/chart-frame.js";import{categoryAt as o,chartFontSizes as d,compactNumber as h,formatCategory as s,markGap as c,plotHeights as m,rampFill as u,rampInk as x,rampStep as f,rampSteps as g,squarify as p,textWidth as v,toValues as w,truncate as b}from"../../internal/chart.js";import{numberFormatter as y}from"../../internal/format.js";import{cx as M,metaTextClasses as j,srOnlyClasses as k}from"../../internal/styles.js";import{emptyMessages as A,useMessages as N}from"../../internal/i18n.js";export function HeatmapChart({series:z,categories:E,shape:S="grid",scale:B="sequential",midpoint:C=0,min:I,max:_,valueLabels:D="none",height:L,format:P,locale:R,label:q,legend:H,tooltip:K,empty:U,size:W="md",variant:F="text",padded:G=!1,className:J,...O}){const Q=l.useRef(null),T=r(Q),V=N(A,R),X=l.useId(),[Y,Z]=l.useState(null),ee=l.useCallback(e=>P?y(R,P).format(e):h(e,R),[P,R]),te=l.useMemo(()=>w(z),[z]),le=te.reduce((e,t)=>Math.max(e,t.length),0),ne=l.useMemo(()=>Array.from({length:le},(e,t)=>o(t,E,te)),[le,E,te]),ie=l.useMemo(()=>z.map((e,t)=>e.name??`${t+1}`),[z]),ae=l.useMemo(()=>{let e=1/0,t=-1/0,l=!1;for(const n of te)for(const i of n)null!==i.value&&(l=!0,e=Math.min(e,i.value),t=Math.max(t,i.value));return l?{min:e,max:t}:null},[te]),re=I??ae?.min??0,oe=_??ae?.max??1,de=l.useCallback(e=>f(e,re,oe,B,C),[re,oe,B,C]),he="number"==typeof L?L:m[W]??220,se=d[W],ce=!0===H||void 0===H||!1===H?{}:H,me=!1!==H,ue=ce.side??"bottom",xe=!1===K?{mode:"none"}:!0===K||void 0===K?{}:K,fe="none"===xe.mode,ge=null===ae||0===le||0===z.length,pe=l.useMemo(()=>{if("treemap"===S||T<=0)return{texts:[],band:0};const e=Math.min(150,.25*T),t=ie.map(t=>b(t,e,se));return{texts:t,band:t.reduce((e,t)=>Math.max(e,v(t,se)),0)+10}},[S,ie,T,se]),ve="treemap"===S?0:se+8,we={left:pe.band,width:Math.max(0,T-pe.band),height:Math.max(0,he-ve)},be=l.useMemo(()=>{if(we.width<=0||we.height<=0)return[];if("treemap"===S){const e=[];return te.forEach((t,l)=>t.forEach((t,n)=>{null!==t.value&&e.push({row:l,index:n,cell:t})})),p(e.map(e=>Math.max(0,e.cell.value??0)),we.width,we.height).map(t=>({row:e[t.index].row,index:e[t.index].index,cell:e[t.index].cell,x:we.left+t.x,y:t.y,width:t.width,height:t.height}))}const e=we.height/Math.max(1,z.length),t=we.width/Math.max(1,le),l=[];return te.forEach((n,i)=>n.forEach((n,a)=>{null!==n.value&&l.push({row:i,index:a,cell:n,x:we.left+a*t,y:i*e,width:t,height:e})})),l},[S,te,z.length,le,we.left,we.width,we.height]),ye=l.useCallback(e=>s(e.cell.x??E?.[e.index]??ne[e.index]??e.index,R),[E,ne,R]),Me=null===Y?null:be.find(e=>e.row===Y.row&&e.index===Y.index)??null,je=null===Me?[]:[{seriesIndex:Me.row,color:Me.cell.color??u(de(Me.cell.value??0),B),value:Me.cell.value,formatted:ee(Me.cell.value??0),label:Me.cell.label}],ke=Array.from({length:g},(e,t)=>u(t,B));return e(i,{...O,size:W,variant:F,padded:G,className:J,legendSide:ue,legend:me&&!ge?e(n,{steps:ke,from:ee("diverging"===B?-$(re,oe,C)+C:re),to:ee("diverging"===B?$(re,oe,C)+C:oe),middle:"diverging"===B?ee(C):void 0,align:ce.align??"center",vertical:"left"===ue||"right"===ue,size:W}):null,table:ge?null:t("table",{id:X,className:k,children:[q?e("caption",{children:q}):null,e("thead",{children:t("tr",{children:[e("th",{scope:"col"}),ne.map((t,l)=>e("th",{scope:"col",children:s(t,R)},l))]})}),e("tbody",{children:te.map((l,n)=>t("tr",{children:[e("th",{scope:"row",children:ie[n]}),ne.map((t,n)=>{const i=l[n];return e("td",{children:void 0!==i?.label?i.label:null==i?.value?"":ee(i.value)},n)})]},n))})]}),children:t("div",{ref:Q,role:"img",tabIndex:ge?void 0:0,"aria-label":q,"aria-describedby":ge?void 0:X,onPointerLeave:()=>Z(null),onBlur:()=>Z(null),onKeyDown:e=>{if(fe||0===be.length)return;const t=null===Y?-1:be.findIndex(e=>e.row===Y.row&&e.index===Y.index);if("ArrowRight"===e.key||"ArrowDown"===e.key){const e=be[Math.min(be.length-1,t+1)];Z({row:e.row,index:e.index})}else if("ArrowLeft"===e.key||"ArrowUp"===e.key){const e=be[Math.max(0,(-1===t?be.length:t)-1)];Z({row:e.row,index:e.index})}else{if("Escape"!==e.key)return;Z(null)}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:he},children:[ge?e("div",{className:M("flex h-full items-center justify-center text-(--neba-muted-fg)",j[W]),children:U??V.title}):T>0?t("svg",{width:T,height:he,viewBox:`0 0 ${T} ${he}`,"aria-hidden":"true",className:"block",children:[be.map(l=>{const n=de(l.cell.value??0),i=Y?.row===l.row&&Y?.index===l.index,a=Math.max(0,l.width-c),r=Math.max(0,l.height-c);if(a<=0||r<=0)return null;const o=ee(l.cell.value??0),d="treemap"===S?"all"===D?[ye(l),o]:[ye(l)]:"all"===D?[o]:[],h=d.filter(e=>function(e,t,l,n){return l>=1.8*n&&t>=Math.min(v(e,n),2.5*n)+8}(e,a,r/d.length,se)),s=l.cell.color?"var(--neba-surface)":x(n,B);return t("g",{children:[e("rect",{x:l.x+c/2,y:l.y+c/2,width:a,height:r,rx:Math.min(3,a/2,r/2),fill:l.cell.color??u(n,B),opacity:i?1:.94,onPointerEnter:fe?void 0:()=>Z({row:l.row,index:l.index}),className:"[transition:opacity_var(--neba-duration)_var(--neba-ease)]"}),h.map((t,n)=>e("text",{x:l.x+l.width/2,y:l.y+l.height/2+(n-(h.length-1)/2)*(se+2),textAnchor:"middle",dominantBaseline:"central",fontSize:se,fontWeight:0===n?500:400,fill:s,opacity:0===n?1:.85,pointerEvents:"none",className:0===n&&"treemap"===S?void 0:"tabular-nums",children:b(t,l.width-8,se)},n))]},`${l.row}-${l.index}`)}),"grid"===S?pe.texts.map((t,l)=>e("text",{x:we.left-8,y:(l+.5)*we.height/Math.max(1,z.length),textAnchor:"end",dominantBaseline:"central",fontSize:se,fill:"var(--neba-muted-fg)",children:t},`row-${l}`)):null,"grid"===S?ne.map((t,l)=>{const n=we.width/Math.max(1,le),i=s(t,R);return l%Math.max(1,Math.ceil((v(i,se)+8)/Math.max(1,n)))!==0?null:e("text",{x:we.left+(l+.5)*n,y:we.height+se,textAnchor:"middle",fontSize:se,fill:"var(--neba-muted-fg)",children:i},`col-${l}`)}):null]}):null,Me&&!fe?xe.render?e("div",{className:"pointer-events-none absolute z-10",style:{left:Me.x+Me.width/2,top:Me.y},children:xe.render({index:Me.index,category:Me.cell.x??ne[Me.index]??Me.index,items:je})}):e(a,{heading:`${ie[Me.row]} · ${ye(Me)}`,items:je,x:Me.x+Me.width/2,y:Me.y,flip:Me.x+Me.width/2>.6*T,size:W}):null]})})}function $(e,t,l){return Math.max(Math.abs(t-l),Math.abs(l-e))}
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{ChartScaleLegend as n,ChartStatus as i,ChartSurface as a,ChartTooltipPanel as r,useMeasuredWidth as o}from"../../internal/chart-frame.js";import{categoryAt as d,chartFontSizes as h,compactNumber as s,formatCategory as c,markGap as m,plotHeights as u,rampFill as x,rampInk as f,rampStep as g,rampSteps as p,squarify as v,textWidth as w,toValues as b,truncate as y}from"../../internal/chart.js";import{numberFormatter as M}from"../../internal/format.js";import{cx as $,metaTextClasses as j,srOnlyClasses as k}from"../../internal/styles.js";import{chartMessages as A,emptyMessages as N,useMessages as z}from"../../internal/i18n.js";export function HeatmapChart({series:S,categories:B,shape:C="grid",scale:I="sequential",midpoint:_=0,min:D,max:L,valueLabels:P="none",height:R,format:q,locale:H,label:K,legend:U,tooltip:W,empty:F,size:G="md",variant:J="text",padded:O=!1,className:Q,...T}){const V=l.useRef(null),X=o(V),Y=z(N,H),Z=z(A,H),ee=l.useId(),[te,le]=l.useState(null),ne=l.useCallback(e=>q?M(H,q).format(e):s(e,H),[q,H]),ie=l.useMemo(()=>b(S),[S]),ae=ie.reduce((e,t)=>Math.max(e,t.length),0),re=l.useMemo(()=>Array.from({length:ae},(e,t)=>d(t,B,ie)),[ae,B,ie]),oe=l.useMemo(()=>S.map((e,t)=>e.name??`${t+1}`),[S]),de=l.useMemo(()=>{let e=1/0,t=-1/0,l=!1;for(const n of ie)for(const i of n)null!==i.value&&(l=!0,e=Math.min(e,i.value),t=Math.max(t,i.value));return l?{min:e,max:t}:null},[ie]),he=D??de?.min??0,se=L??de?.max??1,ce=l.useCallback(e=>g(e,he,se,I,_),[he,se,I,_]),me="number"==typeof R?R:u[G]??220,ue=h[G],xe=!0===U||void 0===U||!1===U?{}:U,fe=!1!==U,ge=xe.side??"bottom",pe=!1===W?{mode:"none"}:!0===W||void 0===W?{}:W,ve="none"===pe.mode,we=null===de||0===ae||0===S.length,be=l.useMemo(()=>{if("treemap"===C||X<=0)return{texts:[],band:0};const e=Math.min(150,.25*X),t=oe.map(t=>y(t,e,ue));return{texts:t,band:t.reduce((e,t)=>Math.max(e,w(t,ue)),0)+10}},[C,oe,X,ue]),ye="treemap"===C?0:ue+8,Me={left:be.band,width:Math.max(0,X-be.band),height:Math.max(0,me-ye)},$e=l.useMemo(()=>{if(Me.width<=0||Me.height<=0)return[];if("treemap"===C){const e=[];return ie.forEach((t,l)=>t.forEach((t,n)=>{null!==t.value&&e.push({row:l,index:n,cell:t})})),v(e.map(e=>Math.max(0,e.cell.value??0)),Me.width,Me.height).map(t=>({row:e[t.index].row,index:e[t.index].index,cell:e[t.index].cell,x:Me.left+t.x,y:t.y,width:t.width,height:t.height}))}const e=Me.height/Math.max(1,S.length),t=Me.width/Math.max(1,ae),l=[];return ie.forEach((n,i)=>n.forEach((n,a)=>{null!==n.value&&l.push({row:i,index:a,cell:n,x:Me.left+a*t,y:i*e,width:t,height:e})})),l},[C,ie,S.length,ae,Me.left,Me.width,Me.height]),je=l.useCallback(e=>c(e.cell.x??B?.[e.index]??re[e.index]??e.index,H),[B,re,H]),ke=null===te?null:$e.find(e=>e.row===te.row&&e.index===te.index)??null,Ae=null===ke?[]:[{seriesIndex:ke.row,color:ke.cell.color??x(ce(ke.cell.value??0),I),value:ke.cell.value,formatted:ne(ke.cell.value??0),label:ke.cell.label}],Ne=Array.from({length:p},(e,t)=>x(t,I));return t(a,{...T,size:G,variant:J,padded:O,className:Q,legendSide:ge,legend:fe&&!we?e(n,{steps:Ne,from:ne("diverging"===I?-E(he,se,_)+_:he),to:ne("diverging"===I?E(he,se,_)+_:se),middle:"diverging"===I?ne(_):void 0,align:xe.align??"center",vertical:"left"===ge||"right"===ge,size:G}):null,table:we?null:t("table",{id:ee,className:k,children:[K?e("caption",{children:K}):null,e("thead",{children:t("tr",{children:[e("th",{scope:"col"}),re.map((t,l)=>e("th",{scope:"col",children:c(t,H)},l))]})}),e("tbody",{children:ie.map((l,n)=>t("tr",{children:[e("th",{scope:"row",children:oe[n]}),re.map((t,n)=>{const i=l[n];return e("td",{children:void 0!==i?.label?i.label:null==i?.value?"":ne(i.value)},n)})]},n))})]}),children:[t("div",{ref:V,role:"img",tabIndex:we?void 0:0,"aria-label":K??Z.label,"aria-describedby":we?void 0:ee,onPointerLeave:()=>le(null),onBlur:()=>le(null),onKeyDown:e=>{if(ve||0===$e.length)return;const t=null===te?-1:$e.findIndex(e=>e.row===te.row&&e.index===te.index);if("ArrowRight"===e.key||"ArrowDown"===e.key){const e=$e[Math.min($e.length-1,t+1)];le({row:e.row,index:e.index})}else if("ArrowLeft"===e.key||"ArrowUp"===e.key){const e=$e[Math.max(0,(-1===t?$e.length:t)-1)];le({row:e.row,index:e.index})}else{if("Escape"!==e.key)return;le(null)}e.preventDefault()},className:$("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:me},children:[we?e("div",{className:$("flex h-full items-center justify-center text-(--neba-muted-fg)",j[G]),children:F??Y.title}):X>0?t("svg",{width:X,height:me,viewBox:`0 0 ${X} ${me}`,"aria-hidden":"true",className:"block",children:[$e.map(l=>{const n=ce(l.cell.value??0),i=te?.row===l.row&&te?.index===l.index,a=Math.max(0,l.width-m),r=Math.max(0,l.height-m);if(a<=0||r<=0)return null;const o=ne(l.cell.value??0),d="treemap"===C?"all"===P?[je(l),o]:[je(l)]:"all"===P?[o]:[],h=d.filter(e=>function(e,t,l,n){return l>=1.8*n&&t>=Math.min(w(e,n),2.5*n)+8}(e,a,r/d.length,ue)),s=l.cell.color?"var(--neba-surface)":f(n,I);return t("g",{children:[e("rect",{x:l.x+m/2,y:l.y+m/2,width:a,height:r,rx:Math.min(3,a/2,r/2),fill:l.cell.color??x(n,I),opacity:i?1:.94,onPointerEnter:ve?void 0:()=>le({row:l.row,index:l.index}),className:"[transition:opacity_var(--neba-duration)_var(--neba-ease)]"}),h.map((t,n)=>e("text",{x:l.x+l.width/2,y:l.y+l.height/2+(n-(h.length-1)/2)*(ue+2),textAnchor:"middle",dominantBaseline:"central",fontSize:ue,fontWeight:0===n?500:400,fill:s,opacity:0===n?1:.85,pointerEvents:"none",className:0===n&&"treemap"===C?void 0:"tabular-nums",children:y(t,l.width-8,ue)},n))]},`${l.row}-${l.index}`)}),"grid"===C?be.texts.map((t,l)=>e("text",{x:Me.left-8,y:(l+.5)*Me.height/Math.max(1,S.length),textAnchor:"end",dominantBaseline:"central",fontSize:ue,fill:"var(--neba-muted-fg)",children:t},`row-${l}`)):null,"grid"===C?re.map((t,l)=>{const n=Me.width/Math.max(1,ae),i=c(t,H);return l%Math.max(1,Math.ceil((w(i,ue)+8)/Math.max(1,n)))!==0?null:e("text",{x:Me.left+(l+.5)*n,y:Me.height+ue,textAnchor:"middle",fontSize:ue,fill:"var(--neba-muted-fg)",children:i},`col-${l}`)}):null]}):null,ke&&!ve?pe.render?e("div",{className:"pointer-events-none absolute z-10",style:{left:ke.x+ke.width/2,top:ke.y},children:pe.render({index:ke.index,category:ke.cell.x??re[ke.index]??ke.index,items:Ae})}):e(r,{heading:`${oe[ke.row]} · ${je(ke)}`,items:Ae,x:ke.x+ke.width/2,y:ke.y,flip:ke.x+ke.width/2>.6*X,size:G}):null]}),ve?null:e(i,{heading:ke?`${oe[ke.row]} · ${je(ke)}`:void 0,items:Ae})]})}function E(e,t,l){return Math.max(Math.abs(t-l),Math.abs(l-e))}
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import*as e from"react";import{transitionClasses as t}from"../../internal/styles.js";const r={solid:"bg-(--n-fill) text-(--n-on-solid)",outline:"border bg-(--n-panel) text-(--n-accent) [border-color:var(--n-line)]",text:"bg-transparent text-(--n-accent)"},o={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},l=/[\p{L}\p{N}_]/u;function i(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function a(n,e,t){const r=e>0?n[e-1]:"",o=t<n.length?n[t]:"";return!l.test(r)&&!l.test(o)}function s(n,e,t,r){e.lastIndex=0;const o=[];let l,i=0;for(;null!==(l=e.exec(n));){if(""===l[0]){e.lastIndex+=1;continue}const s=l.index,c=s+l[0].length;t&&!a(n,s,c)||(s>i&&o.push(n.slice(i,s)),o.push(r(l[0],`${s}`)),i=c)}return 0===o.length?n:(i<n.length&&o.push(n.slice(i)),o)}function c(n,t,r,o){if("string"==typeof n)return s(n,t,r,o);if("number"==typeof n)return s(String(n),t,r,o);if(Array.isArray(n))return e.Children.map(n,n=>c(n,t,r,o));if(e.isValidElement(n)){const l=n.props.children;return void 0===l||"function"==typeof l?n:e.cloneElement(n,void 0,c(l,t,r,o))}return n}export const Highlight=/*@__PURE__*/e.forwardRef(function({query:l,variant:a="solid",color:s="warning",caseSensitive:u=!1,wholeWord:f=!1,underline:d=!1,weight:m,className:g,style:p,children:h,...b},x){const y=e.useMemo(()=>function(n,e){if(n instanceof RegExp)return new RegExp(n.source,n.global?n.flags:`${n.flags}g`);const t=(Array.isArray(n)?n:[n]).map(n=>n.trim()).filter(Boolean).sort((n,e)=>e.length-n.length);return 0===t.length?null:new RegExp(t.map(i).join("|"),e?"gu":"giu")}(l,u),[l,u]),v=["rounded-[0.25rem] px-0.5 -mx-0.5","box-decoration-clone",r[a],d?"underline decoration-2 underline-offset-2":"",m?o[m]:"",t].filter(Boolean).join(" "),$=y?c(h,y,f,(e,t)=>n("mark",{className:v,children:e},t)):h;return n("span",{ref:x,className:g,style:{"--n-fill":`var(--neba-${s}-fill)`,"--n-on-solid":`var(--neba-${s}-on-solid)`,"--n-accent":`var(--neba-${s}-accent)`,"--n-panel":`var(--neba-${s}-panel)`,"--n-line":`var(--neba-${s}-line)`,...p},...b,children:$})});
1
+ "use client";import{jsx as n}from"react/jsx-runtime";import*as e from"react";import{cx as t,transitionClasses as r}from"../../internal/styles.js";const o={solid:"bg-(--n-fill) text-(--n-on-solid)",outline:"border bg-(--n-panel) text-(--n-accent) [border-color:var(--n-line)]",text:"bg-transparent text-(--n-accent)"},l={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},i=/[\p{L}\p{N}_]/u;function a(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function s(n,e,t){const r=e>0?n[e-1]:"",o=t<n.length?n[t]:"";return!i.test(r)&&!i.test(o)}function c(n,e,t,r){e.lastIndex=0;const o=[];let l,i=0;for(;null!==(l=e.exec(n));){if(""===l[0]){e.lastIndex+=1;continue}const a=l.index,c=a+l[0].length;!t||s(n,a,c)?(a>i&&o.push(n.slice(i,a)),o.push(r(l[0],`${a}`)),i=c):e.lastIndex=a+1}return 0===o.length?n:(i<n.length&&o.push(n.slice(i)),o)}function u(n,t,r,o){if("string"==typeof n)return c(n,t,r,o);if("number"==typeof n)return c(String(n),t,r,o);if(Array.isArray(n))return e.Children.map(n,n=>u(n,t,r,o));if(e.isValidElement(n)){const l=n.props.children;return void 0===l||"function"==typeof l?n:e.cloneElement(n,void 0,u(l,t,r,o))}return n}export const Highlight=/*@__PURE__*/e.forwardRef(function({query:i,variant:s="solid",color:c="warning",caseSensitive:f=!1,wholeWord:d=!1,underline:m=!1,weight:g,className:p,style:h,children:x,...b},y){const v=e.useMemo(()=>function(n,e){if(n instanceof RegExp)return new RegExp(n.source,n.global?n.flags:`${n.flags}g`);const t=(Array.isArray(n)?n:[n]).map(n=>n.trim()).filter(Boolean).sort((n,e)=>e.length-n.length);return 0===t.length?null:new RegExp(t.map(a).join("|"),e?"gu":"giu")}(i,f),[i,f]),$=t("rounded-[0.25rem] px-0.5 -mx-0.5","box-decoration-clone",o[s],m?"underline decoration-2 underline-offset-2":"",g?l[g]:"",r),w=v?u(x,v,d,(e,t)=>n("mark",{className:$,children:e},t)):x;return n("span",{ref:y,className:p,style:{"--n-fill":`var(--neba-${c}-fill)`,"--n-on-solid":`var(--neba-${c}-on-solid)`,"--n-accent":`var(--neba-${c}-accent)`,"--n-panel":`var(--neba-${c}-panel)`,"--n-line":`var(--neba-${c}-line)`,...h},...b,children:w})});