neba 1.18.0 → 1.19.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.
- package/dist/a2ui/adapter-catalog.json +1 -1
- package/dist/a2ui/catalog.json +2 -2
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/agent-steps/AgentSteps.js +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-counter/AnimateCounter.js +1 -1
- package/dist/components/animate-headline/AnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/AnimateLighting.js +1 -1
- package/dist/components/animate-marquee/AnimateMarquee.js +1 -1
- package/dist/components/animate-scramble/AnimateScramble.js +1 -1
- package/dist/components/animate-typing/AnimateTyping.js +1 -1
- package/dist/components/app-logo/AppLogo.js +1 -1
- package/dist/components/approval/Approval.js +1 -1
- package/dist/components/aspect-ratio/AspectRatio.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/blockquote/Blockquote.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button-group/ButtonGroup.js +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/checkbox-group/CheckboxGroup.d.ts +84 -0
- package/dist/components/checkbox-group/CheckboxGroup.js +1 -0
- package/dist/components/checkbox-group/index.d.ts +2 -0
- package/dist/components/checkbox-group/index.js +1 -0
- package/dist/components/chip/Chip.d.ts +32 -3
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/collapsible/Collapsible.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +11 -0
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/combobox/index.d.ts +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +21 -5
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/command-palette/CommandPaletteSheet.d.ts +27 -0
- package/dist/components/command-palette/CommandPaletteSheet.js +1 -0
- package/dist/components/command-palette/index.d.ts +1 -1
- package/dist/components/confirm/Confirm.d.ts +7 -5
- package/dist/components/confirm/Confirm.js +1 -1
- package/dist/components/data-list/DataList.js +1 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/data-table/RowsPerPage.d.ts +43 -0
- package/dist/components/data-table/RowsPerPage.js +1 -0
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/dialog/index.d.ts +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/fieldset/Fieldset.d.ts +12 -1
- package/dist/components/fieldset/Fieldset.js +1 -1
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/floating-action-button/index.d.ts +1 -0
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/form/Form.d.ts +8 -2
- package/dist/components/form/Form.js +1 -1
- package/dist/components/gallery/Gallery.js +1 -1
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/highlight/Highlight.js +1 -1
- package/dist/components/hover-card/HoverCard.js +1 -1
- package/dist/components/how-to-steps/HowToSteps.d.ts +3 -0
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/image/Image.js +1 -1
- package/dist/components/inline-citation/InlineCitation.d.ts +24 -0
- package/dist/components/inline-citation/InlineCitation.js +1 -1
- package/dist/components/list/List.d.ts +9 -0
- package/dist/components/list/List.js +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/menubar/Menubar.js +1 -1
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.d.ts +2 -1
- package/dist/components/navigation-menu/NavigationMenu.js +1 -1
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/number-field/index.d.ts +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/page-layout/PageLayout.js +1 -1
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/progress-box/ProgressBox.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/prompt-input/PromptInput.js +1 -1
- package/dist/components/provider/NebaProvider.d.ts +3 -2
- package/dist/components/provider/NebaProvider.js +1 -1
- package/dist/components/radio-group/RadioGroup.d.ts +13 -0
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/radio-group/index.d.ts +1 -1
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/reasoning/Reasoning.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scroll-area/ScrollArea.js +1 -1
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/segmented-button/SegmentedButton.js +1 -1
- package/dist/components/select/Select.d.ts +12 -0
- package/dist/components/select/Select.js +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/shortcut/Shortcut.js +1 -1
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/sidebar/SidebarTrigger.js +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/slider/index.d.ts +1 -1
- package/dist/components/sources/Sources.js +1 -1
- package/dist/components/sparkline/Sparkline.d.ts +7 -0
- package/dist/components/sparkline/Sparkline.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/statistic/Statistic.js +1 -1
- package/dist/components/streaming-text/StreamingText.d.ts +10 -6
- package/dist/components/streaming-text/StreamingText.js +1 -1
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/table/Table.js +1 -1
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/text-field/index.d.ts +1 -1
- package/dist/components/text-link/TextLink.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.d.ts +38 -5
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toast/index.d.ts +2 -2
- package/dist/components/toast/index.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +1 -1
- package/dist/components/tool-call/ToolCall.js +1 -1
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tour/Tour.js +1 -1
- package/dist/components/tour/index.d.ts +1 -1
- package/dist/components/transfer/Transfer.d.ts +7 -0
- package/dist/components/transfer/Transfer.js +1 -1
- package/dist/components/tree-select/TreeSelect.js +1 -1
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +34 -2
- package/dist/internal/animate.js +1 -1
- package/dist/internal/cache.d.ts +7 -1
- package/dist/internal/cache.js +1 -1
- package/dist/internal/calendar.d.ts +40 -1
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +86 -8
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +13 -0
- package/dist/internal/chart.js +1 -1
- package/dist/internal/checkbox-group.d.ts +29 -0
- package/dist/internal/checkbox-group.js +1 -0
- package/dist/internal/data-table.d.ts +7 -1
- package/dist/internal/data-table.js +1 -1
- package/dist/internal/date.d.ts +10 -0
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +14 -2
- package/dist/internal/idle.d.ts +10 -0
- package/dist/internal/idle.js +1 -0
- package/dist/internal/link.d.ts +4 -3
- package/dist/internal/media.js +1 -1
- package/dist/internal/observe.d.ts +4 -0
- package/dist/internal/observe.js +1 -1
- package/dist/internal/page-layout.d.ts +30 -2
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +17 -0
- package/dist/internal/progress.js +1 -1
- package/dist/internal/refs.d.ts +18 -0
- package/dist/internal/refs.js +1 -0
- package/dist/internal/run.d.ts +34 -19
- package/dist/internal/run.js +1 -1
- package/dist/internal/sizer.d.ts +9 -4
- package/dist/internal/sizer.js +1 -1
- package/dist/internal/styles.d.ts +27 -1
- package/dist/internal/styles.js +1 -1
- package/dist/internal/tile.d.ts +34 -0
- package/dist/internal/tile.js +1 -0
- package/dist/internal/wheel.d.ts +24 -1
- package/dist/internal/wheel.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +369 -62
- package/dist/types.d.ts +4 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as a from"react";import{Button as l}from"../button/Button.js";import{boxPaddingClasses as r}from"../box/Box.js";import{CheckIcon as i,ChevronIcon as o,RestartIcon as s,SuccessIcon as c}from"../../internal/icons.js";import{fillMessage as m,stepsMessages as d,useMessages as p}from"../../internal/i18n.js";import{transitionProps as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as a from"react";import{Button as l}from"../button/Button.js";import{boxPaddingClasses as r}from"../box/Box.js";import{CheckIcon as i,ChevronIcon as o,RestartIcon as s,SuccessIcon as c}from"../../internal/icons.js";import{fillMessage as m,stepsMessages as d,useMessages as p}from"../../internal/i18n.js";import{transitionProps as u}from"../../internal/animate.js";import{cx as f,hasContent as g,headingTitleClasses as h,iconClasses as x,insetRingClasses as b,metaTextClasses as v,radiusClasses as w,sheetBodyClasses as N,sheetSectionGapClasses as y,sheetTitleClasses as k,srOnlyClasses as S,surfaceClasses as j,surfaceSlots as C,toLength as z,transitionClasses as H}from"../../internal/styles.js";import{inertValue as L}from"../../internal/inert.js";import{useStyleDefaults as R}from"../../internal/defaults.js";const I={xs:{box:"1.25rem",text:"text-[0.625rem]"},sm:{box:"1.5rem",text:"text-[0.6875rem]"},md:{box:"1.75rem",text:"text-[0.75rem]"},lg:{box:"2rem",text:"text-[0.8125rem]"},xl:{box:"2.25rem",text:"text-[0.875rem]"}},M={default:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"},compact:{xs:"gap-0",sm:"gap-0",md:"gap-0.5",lg:"gap-0.5",xl:"gap-1"}},T={solid:j+" text-(--neba-fg) bg-(--n-panel-hover) [box-shadow:var(--n-elev),var(--neba-plate-solid)]",outline:j+" border text-(--neba-fg) bg-(--n-panel) [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]",text:"text-(--neba-fg) bg-transparent"};function B(e){return"string"==typeof e?e:""}function StepHeading({level:e,...t}){return a.createElement(`h${Math.min(6,Math.max(1,e))}`,t)}export const HowToSteps=/*@__PURE__*/a.forwardRef(function HowToSteps(j,E){const{steps:W,title:$,headingLevel:D=3,step:_,defaultStep:A=0,onStepChange:F,completed:q,defaultCompleted:G=!1,onCompletedChange:J,orientation:K="vertical",maxHeight:O,railWidth:P="15rem",navigation:Q=!0,divider:U=!0,transition:V="fade",completion:X=!0,completedContent:Y,variant:Z="outline",size:ee="md",color:te="primary",density:ne="default",elevation:ae=0,locale:le,previousLabel:re,nextLabel:ie,doneLabel:oe,restartLabel:se,className:ce,style:me,...de}=R(j,["size","density","variant","locale"]),pe=p(d,le),ue=a.useId(),fe=g($),[ge,he]=a.useState(A),[xe,be]=a.useState(G),ve=void 0!==_,we=void 0!==q,Ne=W.length,ye=Math.min(Math.max(ve?_:ge,0),Math.max(Ne-1,0)),ke=X&&(we?q:xe),[Se,je]=a.useState(!1),[Ce]=a.useState({active:ye,completed:ke});Se||ye===Ce.active&&ke===Ce.completed||je(!0);const ze=void 0!==O,He="vertical"===K,Le=a.useRef(null),Re=a.useRef(null);a.useEffect(()=>{const e=Le.current,t=Re.current;if(!e||!t)return;const n=e.getBoundingClientRect(),a=t.getBoundingClientRect();He?a.top<n.top?e.scrollTop-=n.top-a.top:a.bottom>n.bottom&&(e.scrollTop+=a.bottom-n.bottom):a.left<n.left?e.scrollLeft-=n.left-a.left:a.right>n.right&&(e.scrollLeft+=a.right-n.right)},[ye,He]);const Ie=a.useRef(null),Me=a.useRef(null),Te=a.useRef(null);if(a.useEffect(()=>{null!==Te.current&&Te.current===ke&&(Te.current=null,(ke?Ie:Me).current?.focus())},[ke]),0===Ne)return null;const Be=(e,t=!1)=>{we||be(t),ke!==t&&J?.(t),t||(ve||he(e),e!==ye&&F?.(e))},Ee=0===ye,We=ye===Ne-1,$e=(e,t)=>{Te.current=e.currentTarget===document.activeElement?t:null},De="none"!==V&&Se?u(V):null,_e=t=>{const n=ke||t<ye,a=!ke&&t===ye;return e("span",{"aria-hidden":"true",className:f("z-1 flex shrink-0 items-center justify-center rounded-full border font-medium","size-(--n-step-mark) [&_svg]:size-[1.15em]",I[ee].text,H,n?"bg-(--n-fill) text-(--n-on-solid) [border-color:transparent]":a?"bg-(--neba-surface) text-(--n-accent) [border-color:var(--n-accent)]":"bg-(--neba-surface) text-(--neba-muted-fg) [border-color:var(--n-line)]"),children:n?e(i,{}):t+1})},Ae=e("ol",{ref:Le,role:"list","aria-label":pe.steps,className:f("m-0 flex list-none p-0",He?"flex-col":"flex-row",M[ne][ee],ze&&He?"min-h-0 overflow-y-auto overscroll-contain":"",He?"":"overflow-x-auto overscroll-contain"),children:W.map((n,a)=>{const l=ke||a<ye,r=!ke&&a===ye,i=B(n.title);return t("li",{ref:r?Re:void 0,className:f("relative",He?"":"min-w-0 flex-1"),children:[a<Ne-1?e("span",{"aria-hidden":"true",className:f("absolute",H,l?"bg-(--n-fill)":"bg-(--n-line)",He?"w-px [inset-inline-start:calc(0.25rem+var(--n-step-mark)/2)] [top:calc(0.25rem+var(--n-step-mark))] [height:calc(100%-var(--n-step-mark))]":"h-px [inset-inline-start:calc(50%+var(--n-step-mark)/2)] [top:calc(0.25rem+var(--n-step-mark)/2)] [width:calc(100%-var(--n-step-mark))]")}):null,t("button",{type:"button",onClick:()=>Be(a),"aria-current":r?"step":void 0,"aria-label":i?m(pe.step,{index:String(a+1),title:i}):void 0,className:f("flex w-full cursor-pointer items-center p-1 text-start",He?"gap-3":"flex-col gap-1.5 text-center",w.sm,"hover:bg-(--n-soft)",H,b),children:[_e(a),e("span",{className:f("min-w-0",He?"truncate":"",v[ee],r?"font-medium text-(--neba-fg)":"text-(--neba-muted-fg)"),children:n.title})]})]},a)})}),Fe=t("div",{className:f("grid flex-1 grid-cols-1",ze?"min-h-0":""),children:[W.map((n,a)=>{const l=ke||a!==ye;return t("div",{"aria-hidden":l,inert:L(l),className:f("col-start-1 row-start-1 min-w-0",ze?"overflow-y-auto overscroll-contain":"",l?"invisible":De?.className??""),style:l?void 0:De?.style,children:[t("div",{className:"mb-3 flex items-baseline gap-3",children:[g(n.icon)?e("span",{"aria-hidden":"true",className:f("flex h-[1lh] shrink-0 items-center text-(--n-accent)",k[ee],x),children:n.icon}):null,e(StepHeading,{level:fe?D+1:D,className:f("neba-heading min-w-0 flex-1","[&.neba-heading]:m-0 [&.neba-heading]:font-medium [&.neba-heading]:text-inherit",h[ee]),children:n.title}),e("span",{className:f("shrink-0 text-(--neba-muted-fg) tabular-nums",v[ee]),children:m(pe.position,{index:String(a+1),total:String(Ne)})})]}),n.image?e("img",{alt:n.imageAlt??B(n.title),width:n.imageWidth,height:n.imageHeight,className:f("mb-3 h-auto max-h-72 w-full object-contain",w[ee]),loading:n.imageLoading??"lazy",decoding:"async",src:n.image}):null,g(n.content)?e("div",{className:f("min-w-0",N[ee]),children:n.content}):null]},a)}),X?t("div",{"aria-hidden":!ke,inert:L(!ke),className:f("col-start-1 row-start-1 flex min-w-0 flex-col items-center justify-center gap-2 py-4 text-center",ke?De?.className??"":"invisible"),style:ke?De?.style:void 0,children:[e("span",{"aria-hidden":"true",className:"text-(--n-accent) [&_svg]:size-9",children:e(c,{})}),e("p",{className:f("m-0 font-medium",N[ee]),children:Y??pe.completed})]}):null]});return t("div",{ref:E,role:fe?"group":void 0,"aria-labelledby":fe?ue:void 0,className:f("flex min-w-0 flex-col",w[ee],r[ne][ee],y[ee],T[Z],H,ce),style:{...C(te,ae),"--n-fill":`var(--neba-${te}-fill)`,"--n-on-solid":`var(--neba-${te}-on-solid)`,"--n-step-mark":I[ee].box,"--n-step-rail":z(P),...ze?{maxHeight:z(O)}:null,...me},...de,children:[fe?e(StepHeading,{level:D,id:ue,className:f("neba-heading shrink-0","[&.neba-heading]:m-0 [&.neba-heading]:font-medium [&.neba-heading]:text-inherit",h[ee]),children:$}):null,e("span",{className:S,"aria-live":"polite",children:ke?"":"string"==typeof W[ye]?.title?m(pe.step,{index:String(ye+1),title:W[ye].title}):m(pe.position,{index:String(ye+1),total:String(Ne)})}),t("div",{className:f("flex min-w-0 flex-1 flex-col",ze?"min-h-0":"",He?"gap-4 sm:flex-row sm:gap-5":"gap-4"),children:[e("div",{className:f("flex min-w-0 flex-col",ze?"min-h-0":"",He?"sm:w-(--n-step-rail) sm:shrink-0":"",U?He?"border-b pb-4 sm:border-b-0 sm:border-e sm:pb-0 sm:pe-5":"border-b pb-4":"",U?"[border-color:var(--n-line)]":""),children:Ae}),t("div",{className:f("flex min-w-0 flex-1 flex-col",ze?"min-h-0":"",y[ee]),children:[Fe,Q?e("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:ke?e(l,{ref:Ie,size:ee,variant:"outline",color:te,startIcon:e(s,{}),onClick:e=>{$e(e,!1),Be(0)},children:se??pe.restart}):t(n,{children:[e(l,{size:ee,variant:"outline",color:te,disabled:Ee,focusableWhenDisabled:!0,startIcon:e("span",{className:"rotate-90 rtl:-rotate-90",children:e(o,{})}),onClick:()=>Be(ye-1),children:re??pe.previous}),e(l,We&&X?{ref:Me,size:ee,variant:"solid",color:te,startIcon:e(i,{}),onClick:e=>{$e(e,!0),Be(ye,!0)},children:oe??pe.done}:{ref:Me,size:ee,variant:"solid",color:te,disabled:We,focusableWhenDisabled:!0,endIcon:e("span",{className:"-rotate-90 rtl:rotate-90",children:e(o,{})}),onClick:()=>Be(ye+1),children:ie??pe.next})]})}):null]})]})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{AspectRatio as r}from"../aspect-ratio/AspectRatio.js";import{Skeleton as i}from"../skeleton/Skeleton.js";import{useStyleDefaults as a}from"../../internal/defaults.js";import{imageMessages as l,useMessages as s}from"../../internal/i18n.js";import{useHydrated as c}from"../../internal/media.js";import{cx as u,metaTextValues as d,radiusClasses as f,toLength as h,transitionClasses as p}from"../../internal/styles.js";const b={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},m={none:"none",grayscale:"grayscale(1)",sepia:"sepia(0.72)",invert:"invert(1)",saturate:"saturate(1.5)",mute:"saturate(0.45)",contrast:"contrast(1.25)"},g={"top-start":"items-start justify-start","top-end":"items-start justify-end","bottom-start":"items-end justify-start","bottom-end":"items-end justify-end",center:"items-center justify-center"},v=Number.parseInt(o.version,10)>=19?"fetchPriority":"fetchpriority";let y;export const previewChunk={load:()=>(y??=import("../dialog/Dialog.js").then(e=>({default:e.Dialog})).catch(e=>{throw y=void 0,e}),y)};const x=o.lazy(()=>previewChunk.load());function w(e){const t="number"==typeof e?e:""===e.trim()?NaN:Number(e);return Number.isFinite(t)?`${t}px`:String(e)}const k=/^(-?\d*\.?\d+)%$/;function $(e,t,n){const o=function(e){let t=.5,n=.5;for(const[o,r]of e.trim().toLowerCase().split(/\s+/).entries()){const e=k.exec(r);if("left"===r||"right"===r)t="left"===r?0:1;else if("top"===r||"bottom"===r)n="top"===r?0:1;else if(null!==e)0===o?t=Number(e[1])/100:n=Number(e[1])/100;else if("center"!==r)return null}return[t,n]}(e);if(null===o)return e;let[r,i]=o;"horizontal"!==n&&"both"!==n||(r=1-r),"vertical"!==n&&"both"!==n||(i=1-i);for(let e=0;e<t;e+=1)[r,i]=[i,1-r];const a=e=>Math.round(1e4*e)/100+"%";return`${a(r)} ${a(i)}`}function N(e,t,n){const o=e=>0===n?e:`calc(${e} + ${2*n}px)`;return t?{...e,width:o("100cqh"),height:o("100cqw")}:{...e,position:"absolute",top:-n+"px",left:-n+"px",width:o("100%"),height:o("100%"),maxWidth:"none"}}function j(e,t){switch(e){case"rect":return{borderRadius:"0px"};case"circle":return{borderRadius:"50%"};case"arch":return{borderRadius:`50% 50% ${t} ${t} / 55% 55% ${t} ${t}`};case"cut":return{clipPath:`polygon(${t} 0, calc(100% - ${t}) 0, 100% ${t}, 100% calc(100% - ${t}), calc(100% - ${t}) 100%, ${t} 100%, 0 calc(100% - ${t}), 0 ${t})`};default:return{borderRadius:t}}}function S(e){const t=t=>`linear-gradient(to ${t}, transparent, #000 ${e}, #000 calc(100% - ${e}), transparent)`,n=`${t("right")}, ${t("bottom")}`;return{maskImage:n,maskComposite:"intersect",WebkitMaskImage:n,WebkitMaskComposite:"source-in"}}function TiledMark({text:n,color:r,opacity:i,rotate:a,fontSize:l,slot:s}){const c=`neba-mark-${o.useId().replace(/[^\w-]/g,"")}`,d=function(e){let t=0;for(const n of e)t+=/[ᄀ-ᇿ⺀-가-豈-︰-﹏]/.test(n)?1:.6;return{width:Math.max(16,Math.round(16*(t+2.4))),height:52}}(n);return t("svg",{"aria-hidden":"true",className:u("pointer-events-none absolute select-none",s),style:{top:"-40%",left:"-40%",width:"180%",height:"180%",opacity:i,fontSize:l,transform:`rotate(${a}deg)`},children:[e("defs",{children:e("pattern",{id:c,patternUnits:"userSpaceOnUse",width:d.width/16+"em",height:d.height/16+"em",children:e("text",{x:"0",y:"2em",style:{fill:r,fontFamily:"system-ui, sans-serif",stroke:"rgba(0, 0, 0, 0.28)",strokeWidth:"0.0375em",paintOrder:"stroke"},children:n})})}),e("rect",{width:"100%",height:"100%",fill:`url(#${c})`})]})}export const Image=/*@__PURE__*/o.forwardRef(function Image(y,k){const{alt:C,ratio:R="auto",width:M,height:_,fit:W="cover",position:P,letterbox:L="none",rounded:O=!1,placeholder:T,fallback:D,onLoadingStatusChange:E,preview:F=!1,priority:I=!1,filter:U="none",rotate:q=0,flip:H="none",frame:B,watermark:A,protect:V=!1,locale:G,unavailableLabel:J,className:K,classNames:Q,style:X,src:Y,srcSet:Z,sizes:ee,loading:te,decoding:ne,fetchPriority:oe,onLoad:re,onError:ie,onContextMenu:ae,onDragStart:le,draggable:se,...ce}=a(y,["locale"]),ue=s(l,G),de=!1!==T&&function(e){return"object"==typeof e&&null!==e&&!o.isValidElement(e)&&"src"in e}(T)?T:null,fe=function(e){const[t,n]=o.useState(null);return o.useEffect(()=>{if("undefined"==typeof Blob||!(e instanceof Blob))return;const t=URL.createObjectURL(e);return n({blob:e,url:t}),()=>URL.revokeObjectURL(t)},[e]),"string"==typeof e?e:null!==t&&t.blob===e?t.url:void 0}(de?.src),[he,pe]=o.useState("loading"),[be,me]=o.useState(!1),[ge,ve]=o.useState(!1),ye=o.useRef(!1),xe=()=>{ye.current||(ye.current=!0,previewChunk.load().catch(()=>{}))},we=c(),[ke]=o.useState(()=>!we),[$e,Ne]=o.useState(null),je=o.useRef(null),Se=o.useRef(E);o.useEffect(()=>{Se.current=E});const ze=o.useCallback(e=>{je.current=e,"function"==typeof k?k(e):k&&(k.current=e)},[k]);o.useEffect(()=>{const e=je.current,t=(Y||Z)&&e?.complete?e.naturalWidth>0?"loaded":"failed":null;pe(t??"loading"),Ne("loaded"===t&&e?{width:e.naturalWidth,height:e.naturalHeight}:null),Se.current?.(t??"loading")},[Y,Z]);const Ce=(e,t)=>{pe(e),"loaded"===e&&Ne({width:t.naturalWidth,height:t.naturalHeight}),E?.(e)},Re=!1===O?"":f[!0===O?"md":O],Me=U in m?m[U]:U,_e=!0===V?{}:!1===V?null:V,We=null!==_e&&!1!==_e.contextMenu,Pe=null!==_e&&!1!==_e.drag,Le=null!==_e&&!1!==_e.select,Oe=e=>e.preventDefault(),Te=function(e){return Number.isFinite(e)?(Math.round(e/90)%4+4)%4:0}(q),De=Te%2==1,Ee=function(e,t){const n=e%2==1,o="horizontal"===t||"both"===t,r="vertical"===t||"both"===t,i=n?r:o,a=n?o:r;return{scale:i||a?`${i?-1:1} ${a?-1:1}`:void 0,rotate:0===e?void 0:90*e+"deg",...n?{position:"absolute",top:"50%",left:"50%",width:"100cqh",height:"100cqw",maxWidth:"none",translate:"-50% -50%"}:null}}(Te,H),Fe=void 0===P?void 0:$(P,Te,H),Ie="blur"===L&&"cover"!==W&&"fill"!==W,Ue="none"!==L&&"blur"!==L?L:void 0,qe=_e?{onContextMenu:We?Oe:void 0,onDragStart:Pe?Oe:void 0,draggable:!Pe&&void 0,className:Le?"select-none":"",style:Le?{WebkitTouchCallout:"none"}:void 0}:null,He=oe??ce.fetchpriority??(I?"high":void 0),Be={loading:te??(I?"eager":void 0),decoding:ne,...void 0===He?null:{[v]:He},sizes:ee,srcSet:Z,src:Y},Ae=e("img",{ref:ze,alt:C,width:M,height:_,className:u("block size-full",b[W],Re,"[transition:opacity_var(--neba-duration-fill)_var(--neba-ease),filter_var(--neba-duration-fill)_var(--neba-ease),transform_var(--neba-duration-fill)_var(--neba-ease)]",I||ke||"loaded"===he?"opacity-100":"opacity-0",Ie||null!==de||ke?"relative":"",qe?.className,Q?.image),style:{filter:"none"===Me?void 0:Me,objectPosition:Fe,...Ee,...qe?.style},onLoad:e=>{Ce("loaded",e.currentTarget),re?.(e)},onError:e=>{Ce("failed",e.currentTarget),ie?.(e)},onContextMenu:e=>{We&&Oe(e),ae?.(e)},onDragStart:e=>{Pe&&Oe(e),le?.(e)},draggable:!Pe&&se,...ce,...Be}),Ve=Ie?e("img",{alt:"","aria-hidden":"true",draggable:!1,className:u("pointer-events-none block object-cover select-none","[transition:opacity_var(--neba-duration-fill)_var(--neba-ease)]",ke||"loaded"===he?"opacity-100":"opacity-0"),style:{...N(Ee,De,48),objectPosition:Fe,filter:("none"===Me?"":`${Me} `)+"blur(24px)"},crossOrigin:ce.crossOrigin,referrerPolicy:ce.referrerPolicy,loading:te,decoding:ne,sizes:ee,srcSet:Z,src:Y}):null,Ge=null!==de&&de.blur?!0===de.blur?20:de.blur:0,Je=null===de||"failed"===he||void 0===fe?null:e("img",{src:fe,alt:"","aria-hidden":"true",draggable:!1,className:u("pointer-events-none block select-none",b[W],"loaded"===he?"opacity-0 [transition:opacity_0ms_linear_var(--neba-duration-fill)]":"opacity-100",Q?.placeholder),style:{...N(Ee,De,2*Ge),objectPosition:Fe,filter:0===Ge?void 0:`blur(${Ge}px)`}}),Ke="failed"===he?e("span",{className:u("absolute inset-0 flex items-center justify-center","bg-(--neba-disabled-bg) text-(--neba-muted-fg)",Re,Q?.fallback),children:D??e("span",{className:"px-2 text-center text-sm","aria-hidden":!!C||void 0,children:C||J||ue.unavailable})}):null,Qe="loading"!==he||!1===T||null!==de||I?null:e("span",{className:u("absolute inset-0",Q?.placeholder),children:T??e(i,{render:e("span",{}),shape:"rect",className:u("block size-full",Re)})}),Xe=void 0===A?null:function(t,n){const o="string"==typeof t?{content:t}:t,{content:r,position:i="bottom-end",repeat:a=!1,opacity:l=.35,size:s="xs",color:c="#ffffff"}=o,f="string"==typeof s&&s in d?d[s]:h(s)??d.xs,p=o.rotate??(a&&"string"==typeof r?-24:0);if(a&&"string"==typeof r)return e(TiledMark,{text:r,color:c,opacity:l,rotate:p,fontSize:f,slot:n});return e("span",{"aria-hidden":"true",className:u("pointer-events-none absolute inset-0 flex select-none p-2",g[i],n),children:e("span",{style:{color:c,opacity:l,fontSize:f,lineHeight:1.2,textShadow:"0 1px 2px rgba(0, 0, 0, 0.45)",transform:p?`rotate(${p}deg)`:void 0},children:r})})}(A,Q?.watermark),Ye=t("span",{className:"relative block size-full",style:De||void 0!==Ue?{containerType:De?"size":void 0,background:Ue}:void 0,children:[Ve,Je,ke?Qe:null,Ae,ke?null:Qe,Ke,Xe]}),Ze=function(e,t){const n="number"==typeof e?e:Number(e),o="number"==typeof t?t:Number(t);return Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0?{width:n,height:o}:null}(M,_),et="auto"===R&&null!==Ze?Ze.width/Ze.height:null,tt=null===et?R:De?1/et:et,nt=void 0===_&&void 0!==M?w(M):void 0,ot=void 0===M&&void 0!==_?w(_):void 0,rt=void 0!==nt?{width:nt,maxWidth:"100%"}:void 0!==ot?{height:ot,..."auto"===tt?null:{width:"auto",maxWidth:"100%"}}:null,it=void 0!==nt||void 0!==ot&&"auto"!==tt,at="auto"===tt&&De&&null!==$e&&void 0===ot?$e.height/$e.width:null,lt=void 0===B?null:function(e,t){const n=!0===t?"md":t;return{shape:"rounded",corner:!1===n?"md":n,..."string"==typeof e?{shape:e}:e}}(B,O),st=null===lt?"0px":function(e){return"string"==typeof e&&e in f?`var(--neba-radius-${e})`:h(e)??"0px"}(lt.corner??"md"),ct=null===lt?void 0:h(lt.mat),ut=null===lt?void 0:h(lt.feather),dt={...rt,...null===lt?null:j(lt.shape,st),...void 0===ut?null:S(ut),...null!==lt||F?null:X},ft="auto"===tt?e("span",{className:u("relative block overflow-hidden",null===lt?Re:"",null!==lt||F?"":K),style:null===at?dt:{aspectRatio:at,...dt},children:Ye}):e(r,{render:e("span",{}),ratio:tt,className:u("block overflow-hidden",null===lt?Re:"",null!==lt||F?"":K),style:dt,children:Ye}),ht=null===lt?void 0:function(e){if(void 0===e.border||!1===e.border)return;const t=!0===e.border?"1px":h(e.border);return`inset 0 0 0 ${t} ${e.borderColor??"var(--neba-line)"}`}(lt),pt=void 0===ct?st:`calc(${st} + ${ct})`,bt=null===lt?ft:t("span",{className:u("relative block",Q?.frame,F?"":K),style:{...j(lt.shape,pt),padding:ct,background:lt.background??(void 0===ct?void 0:"var(--neba-surface)"),boxShadow:lt.elevation?`var(--neba-shadow-${lt.elevation})`:void 0,width:it?"fit-content":void 0,maxWidth:it?"100%":void 0,...F?null:X},children:[ft,void 0===ht?null:e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",style:{...j(lt.shape,pt),boxShadow:ht}})]});return F?t(n,{children:[e("button",{type:"button","aria-label":C||ue.preview,"aria-haspopup":"dialog",className:u("block cursor-zoom-in",p,it?"[:where(&)]:w-fit [:where(&)]:max-w-full":"[:where(&)]:w-full","focus-visible:[outline:2px_solid_var(--n-ring,var(--neba-primary-ring))] focus-visible:[outline-offset:2px]",Re,K),style:X,onPointerEnter:xe,onFocus:xe,onTouchStart:xe,onClick:()=>{ve(!0),me(!0)},children:bt}),ge?e(o.Suspense,{fallback:null,children:e(x,{open:be,onOpenChange:me,size:"xl",title:C||ue.preview,children:t("span",{className:u("relative mx-auto block",De?"":"w-fit"),style:De?z($e??Ze):void 0,children:[e("img",{alt:C,className:u(De?"block object-contain":"mx-auto block max-h-[70vh] w-auto max-w-full",qe?.className),style:{filter:"none"===Me?void 0:Me,...Ee,...qe?.style},onContextMenu:qe?.onContextMenu,onDragStart:qe?.onDragStart,draggable:qe?.draggable,crossOrigin:ce.crossOrigin,referrerPolicy:ce.referrerPolicy,srcSet:Z,src:Y}),Xe]})})}):null]}):bt});function z(e){if(null===e)return{aspectRatio:"1",width:"min(100%, 70vh)",containerType:"size"};const t=e.height/e.width;return{aspectRatio:`${e.height} / ${e.width}`,width:`min(100%, ${e.height}px, calc(70vh * ${t}))`,containerType:"size"}}
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{useMergedRef as r}from"../../internal/refs.js";import{AspectRatio as i}from"../aspect-ratio/AspectRatio.js";import{Skeleton as a}from"../skeleton/Skeleton.js";import{useStyleDefaults as l}from"../../internal/defaults.js";import{imageMessages as s,useMessages as c}from"../../internal/i18n.js";import{useHydrated as u}from"../../internal/media.js";import{cx as d,metaTextValues as h,radiusClasses as f,toLength as p,transitionClasses as b}from"../../internal/styles.js";const m={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none","scale-down":"object-scale-down"},g={none:"none",grayscale:"grayscale(1)",sepia:"sepia(0.72)",invert:"invert(1)",saturate:"saturate(1.5)",mute:"saturate(0.45)",contrast:"contrast(1.25)"},v={"top-start":"items-start justify-start","top-end":"items-start justify-end","bottom-start":"items-end justify-start","bottom-end":"items-end justify-end",center:"items-center justify-center"},y=Number.parseInt(o.version,10)>=19?"fetchPriority":"fetchpriority";let w;export const previewChunk={load:()=>(w??=import("../dialog/Dialog.js").then(e=>({default:e.Dialog})).catch(e=>{throw w=void 0,e}),w)};const x=o.lazy(()=>previewChunk.load());function $(e){const t="number"==typeof e?e:""===e.trim()?NaN:Number(e);return Number.isFinite(t)?`${t}px`:String(e)}const k=/^(-?\d*\.?\d+)%$/;function N(e,t,n){const o=function(e){let t=.5,n=.5;for(const[o,r]of e.trim().toLowerCase().split(/\s+/).entries()){const e=k.exec(r);if("left"===r||"right"===r)t="left"===r?0:1;else if("top"===r||"bottom"===r)n="top"===r?0:1;else if(null!==e)0===o?t=Number(e[1])/100:n=Number(e[1])/100;else if("center"!==r)return null}return[t,n]}(e);if(null===o)return e;let[r,i]=o;"horizontal"!==n&&"both"!==n||(r=1-r),"vertical"!==n&&"both"!==n||(i=1-i);for(let e=0;e<t;e+=1)[r,i]=[i,1-r];const a=e=>Math.round(1e4*e)/100+"%";return`${a(r)} ${a(i)}`}function j(e,t,n){const o=e=>0===n?e:`calc(${e} + ${2*n}px)`;return t?{...e,width:o("100cqh"),height:o("100cqw")}:{...e,position:"absolute",top:-n+"px",left:-n+"px",width:o("100%"),height:o("100%"),maxWidth:"none"}}function S(e,t){switch(e){case"rect":return{borderRadius:"0px"};case"circle":return{borderRadius:"50%"};case"arch":return{borderRadius:`50% 50% ${t} ${t} / 55% 55% ${t} ${t}`};case"cut":return{clipPath:`polygon(${t} 0, calc(100% - ${t}) 0, 100% ${t}, 100% calc(100% - ${t}), calc(100% - ${t}) 100%, ${t} 100%, 0 calc(100% - ${t}), 0 ${t})`};default:return{borderRadius:t}}}function z(e){const t=t=>`linear-gradient(to ${t}, transparent, #000 ${e}, #000 calc(100% - ${e}), transparent)`,n=`${t("right")}, ${t("bottom")}`;return{maskImage:n,maskComposite:"intersect",WebkitMaskImage:n,WebkitMaskComposite:"source-in"}}function TiledMark({text:n,color:r,opacity:i,rotate:a,fontSize:l,slot:s}){const c=`neba-mark-${o.useId().replace(/[^\w-]/g,"")}`,u=function(e){let t=0;for(const n of e)t+=/[ᄀ-ᇿ⺀-가-豈-︰-﹏]/.test(n)?1:.6;return{width:Math.max(16,Math.round(16*(t+2.4))),height:52}}(n);return t("svg",{"aria-hidden":"true",className:d("pointer-events-none absolute select-none",s),style:{top:"-40%",left:"-40%",width:"180%",height:"180%",opacity:i,fontSize:l,transform:`rotate(${a}deg)`},children:[e("defs",{children:e("pattern",{id:c,patternUnits:"userSpaceOnUse",width:u.width/16+"em",height:u.height/16+"em",children:e("text",{x:"0",y:"2em",style:{fill:r,fontFamily:"system-ui, sans-serif",stroke:"rgba(0, 0, 0, 0.28)",strokeWidth:"0.0375em",paintOrder:"stroke"},children:n})})}),e("rect",{width:"100%",height:"100%",fill:`url(#${c})`})]})}export const Image=/*@__PURE__*/o.forwardRef(function Image(w,k){const{alt:R,ratio:M="auto",width:_,height:W,fit:P="cover",position:L,letterbox:O="none",rounded:T=!1,placeholder:D,fallback:E,onLoadingStatusChange:F,preview:I=!1,priority:U=!1,filter:q="none",rotate:H=0,flip:B="none",frame:A,watermark:V,protect:G=!1,locale:J,unavailableLabel:K,className:Q,classNames:X,style:Y,src:Z,srcSet:ee,sizes:te,loading:ne,decoding:oe,fetchPriority:re,onLoad:ie,onError:ae,onContextMenu:le,onDragStart:se,draggable:ce,...ue}=l(w,["locale"]),de=c(s,J),he=!1!==D&&function(e){return"object"==typeof e&&null!==e&&!o.isValidElement(e)&&"src"in e}(D)?D:null,fe=function(e){const[t,n]=o.useState(null);return o.useEffect(()=>{if("undefined"==typeof Blob||!(e instanceof Blob))return;const t=URL.createObjectURL(e);return n({blob:e,url:t}),()=>URL.revokeObjectURL(t)},[e]),"string"==typeof e?e:null!==t&&t.blob===e?t.url:void 0}(he?.src),[pe,be]=o.useState("loading"),[me,ge]=o.useState(!1),[ve,ye]=o.useState(!1),we=o.useRef(!1),xe=()=>{we.current||(we.current=!0,previewChunk.load().catch(()=>{}))},$e=u(),[ke]=o.useState(()=>!$e),[Ne,je]=o.useState(null),Se=o.useRef(null),ze=o.useRef(F);o.useEffect(()=>{ze.current=F});const Ce=r(Se,k);o.useEffect(()=>{const e=Se.current,t=(Z||ee)&&e?.complete?e.naturalWidth>0?"loaded":"failed":null;be(t??"loading"),je("loaded"===t&&e?{width:e.naturalWidth,height:e.naturalHeight}:null),ze.current?.(t??"loading")},[Z,ee]);const Re=(e,t)=>{if(be(e),"loaded"===e){const e=t.naturalWidth,n=t.naturalHeight;je(t=>t?.width===e&&t.height===n?t:{width:e,height:n})}F?.(e)},Me=!1===T?"":f[!0===T?"md":T],_e=q in g?g[q]:q,We=!0===G?{}:!1===G?null:G,Pe=null!==We&&!1!==We.contextMenu,Le=null!==We&&!1!==We.drag,Oe=null!==We&&!1!==We.select,Te=e=>e.preventDefault(),De=function(e){return Number.isFinite(e)?(Math.round(e/90)%4+4)%4:0}(H),Ee=De%2==1,Fe=function(e,t){const n=e%2==1,o="horizontal"===t||"both"===t,r="vertical"===t||"both"===t,i=n?r:o,a=n?o:r;return{scale:i||a?`${i?-1:1} ${a?-1:1}`:void 0,rotate:0===e?void 0:90*e+"deg",...n?{position:"absolute",top:"50%",left:"50%",width:"100cqh",height:"100cqw",maxWidth:"none",translate:"-50% -50%"}:null}}(De,B),Ie=void 0===L?void 0:N(L,De,B),Ue="blur"===O&&"cover"!==P&&"fill"!==P,qe="none"!==O&&"blur"!==O?O:void 0,He=We?{onContextMenu:Pe?Te:void 0,onDragStart:Le?Te:void 0,draggable:!Le&&void 0,className:Oe?"select-none":"",style:Oe?{WebkitTouchCallout:"none"}:void 0}:null,Be=re??ue.fetchpriority??(U?"high":void 0),Ae={loading:ne??(U?"eager":void 0),decoding:oe,...void 0===Be?null:{[y]:Be},sizes:te,srcSet:ee,src:Z},Ve=e("img",{ref:Ce,alt:R,width:_,height:W,className:d("block size-full",m[P],Me,"[transition:opacity_var(--neba-duration-fill)_var(--neba-ease),filter_var(--neba-duration-fill)_var(--neba-ease),transform_var(--neba-duration-fill)_var(--neba-ease)]",U||ke||"loaded"===pe?"opacity-100":"opacity-0",Ue||null!==he||ke?"relative":"",He?.className,X?.image),style:{filter:"none"===_e?void 0:_e,objectPosition:Ie,...Fe,...He?.style},onLoad:e=>{Re("loaded",e.currentTarget),ie?.(e)},onError:e=>{Re("failed",e.currentTarget),ae?.(e)},onContextMenu:e=>{Pe&&Te(e),le?.(e)},onDragStart:e=>{Le&&Te(e),se?.(e)},draggable:!Le&&ce,...ue,...Ae}),Ge=Ue?e("img",{alt:"","aria-hidden":"true",draggable:!1,className:d("pointer-events-none block object-cover select-none","[transition:opacity_var(--neba-duration-fill)_var(--neba-ease)]",ke||"loaded"===pe?"opacity-100":"opacity-0"),style:{...j(Fe,Ee,48),objectPosition:Ie,filter:("none"===_e?"":`${_e} `)+"blur(24px)"},crossOrigin:ue.crossOrigin,referrerPolicy:ue.referrerPolicy,...Ae}):null,Je=null!==he&&he.blur?!0===he.blur?20:he.blur:0,Ke=null===he||"failed"===pe||void 0===fe?null:e("img",{alt:"","aria-hidden":"true",draggable:!1,className:d("pointer-events-none block select-none",m[P],"loaded"===pe?"opacity-0 [transition:opacity_0ms_linear_var(--neba-duration-fill)]":"opacity-100",X?.placeholder),style:{...j(Fe,Ee,2*Je),objectPosition:Ie,filter:0===Je?void 0:`blur(${Je}px)`},loading:Ae.loading,src:fe}),Qe="failed"===pe?e("span",{className:d("absolute inset-0 flex items-center justify-center","bg-(--neba-disabled-bg) text-(--neba-muted-fg)",Me,X?.fallback),children:E??e("span",{className:"px-2 text-center text-sm","aria-hidden":!!R||void 0,children:R||K||de.unavailable})}):null,Xe="loading"!==pe||!1===D||null!==he||U?null:e("span",{className:d("absolute inset-0",X?.placeholder),children:D??e(a,{render:e("span",{}),shape:"rect",className:d("block size-full",Me)})}),Ye=void 0===V?null:function(t,n){const o="string"==typeof t?{content:t}:t,{content:r,position:i="bottom-end",repeat:a=!1,opacity:l=.35,size:s="xs",color:c="#ffffff"}=o,u="string"==typeof s&&s in h?h[s]:p(s)??h.xs,f=o.rotate??(a&&"string"==typeof r?-24:0);if(a&&"string"==typeof r)return e(TiledMark,{text:r,color:c,opacity:l,rotate:f,fontSize:u,slot:n});return e("span",{"aria-hidden":"true",className:d("pointer-events-none absolute inset-0 flex select-none p-2",v[i],n),children:e("span",{style:{color:c,opacity:l,fontSize:u,lineHeight:1.2,textShadow:"0 1px 2px rgba(0, 0, 0, 0.45)",transform:f?`rotate(${f}deg)`:void 0},children:r})})}(V,X?.watermark),Ze=t("span",{className:"relative block size-full",style:Ee||void 0!==qe?{containerType:Ee?"size":void 0,background:qe}:void 0,children:[Ge,Ke,ke?Xe:null,Ve,ke?null:Xe,Qe,Ye]}),et=function(e,t){const n="number"==typeof e?e:Number(e),o="number"==typeof t?t:Number(t);return Number.isFinite(n)&&Number.isFinite(o)&&n>0&&o>0?{width:n,height:o}:null}(_,W),tt="auto"===M&&null!==et?et.width/et.height:null,nt=null===tt?M:Ee?1/tt:tt,ot=void 0===W&&void 0!==_?$(_):void 0,rt=void 0===_&&void 0!==W?$(W):void 0,it=void 0!==ot?{width:ot,maxWidth:"100%"}:void 0!==rt?{height:rt,..."auto"===nt?null:{width:"auto",maxWidth:"100%"}}:null,at=void 0!==ot||void 0!==rt&&"auto"!==nt,lt="auto"===nt&&Ee&&null!==Ne&&void 0===rt?Ne.height/Ne.width:null,st=void 0===A?null:function(e,t){const n=!0===t?"md":t;return{shape:"rounded",corner:!1===n?"md":n,..."string"==typeof e?{shape:e}:e}}(A,T),ct=null===st?"0px":function(e){return"string"==typeof e&&e in f?`var(--neba-radius-${e})`:p(e)??"0px"}(st.corner??"md"),ut=null===st?void 0:p(st.mat),dt=null===st?void 0:p(st.feather),ht={...it,...null===st?null:S(st.shape,ct),...void 0===dt?null:z(dt),...null!==st||I?null:Y},ft="auto"===nt?e("span",{className:d("relative block overflow-hidden",null===st?Me:"",null!==st||I?"":Q),style:null===lt?ht:{aspectRatio:lt,...ht},children:Ze}):e(i,{render:e("span",{}),ratio:nt,className:d("block overflow-hidden",null===st?Me:"",null!==st||I?"":Q),style:ht,children:Ze}),pt=null===st?void 0:function(e){if(void 0===e.border||!1===e.border)return;const t=!0===e.border?"1px":p(e.border);return`inset 0 0 0 ${t} ${e.borderColor??"var(--neba-line)"}`}(st),bt=void 0===ut?ct:`calc(${ct} + ${ut})`,mt=null===st?ft:t("span",{className:d("relative block",X?.frame,I?"":Q),style:{...S(st.shape,bt),padding:ut,background:st.background??(void 0===ut?void 0:"var(--neba-surface)"),boxShadow:st.elevation?`var(--neba-shadow-${st.elevation})`:void 0,width:at?"fit-content":void 0,maxWidth:at?"100%":void 0,...I?null:Y},children:[ft,void 0===pt?null:e("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",style:{...S(st.shape,bt),boxShadow:pt}})]});return I?t(n,{children:[e("button",{type:"button","aria-label":R||de.preview,"aria-haspopup":"dialog",className:d("block cursor-zoom-in",b,at?"[:where(&)]:w-fit [:where(&)]:max-w-full":"[:where(&)]:w-full","focus-visible:[outline:2px_solid_var(--n-ring,var(--neba-primary-ring))] focus-visible:[outline-offset:2px]",Me,Q),style:Y,onPointerEnter:xe,onFocus:xe,onTouchStart:xe,onClick:()=>{ye(!0),ge(!0)},children:mt}),ve?e(o.Suspense,{fallback:null,children:e(x,{open:me,onOpenChange:ge,size:"xl",title:R||de.preview,children:t("span",{className:d("relative mx-auto block",Ee?"":"w-fit"),style:Ee?C(Ne??et):void 0,children:[e("img",{alt:R,className:d(Ee?"block object-contain":"mx-auto block max-h-[70vh] w-auto max-w-full",He?.className),style:{filter:"none"===_e?void 0:_e,...Fe,...He?.style},onContextMenu:He?.onContextMenu,onDragStart:He?.onDragStart,draggable:He?.draggable,crossOrigin:ue.crossOrigin,referrerPolicy:ue.referrerPolicy,srcSet:ee,src:Z}),Ye]})})}):null]}):mt});function C(e){if(null===e)return{aspectRatio:"1",width:"min(100%, 70vh)",containerType:"size"};const t=e.height/e.width;return{aspectRatio:`${e.height} / ${e.width}`,width:`min(100%, ${e.height}px, calc(70vh * ${t}))`,containerType:"size"}}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type SourcesMessages } from '../../internal/i18n.js';
|
|
3
3
|
import type { NebaColor, NebaSize } from '../../types.js';
|
|
4
|
+
type HoverCardModule = typeof import('../hover-card/HoverCard.js');
|
|
5
|
+
/**
|
|
6
|
+
* The preview's card, fetched only when somebody reaches for a citation.
|
|
7
|
+
*
|
|
8
|
+
* A HoverCard is Base UI's preview card and everything it positions with, which
|
|
9
|
+
* was 34 kB of the 39 kB a citation weighed against the 5.6 kB of a TextLink —
|
|
10
|
+
* carried by every answer with a footnote in it, whether anybody hovered one or
|
|
11
|
+
* not. So this is the Image viewer's arrangement: the mark is drawn bare, and
|
|
12
|
+
* the chunk is asked for when a pointer arrives over it, when the focus reaches
|
|
13
|
+
* it or when a finger lands on it. The card's own delay before it opens is
|
|
14
|
+
* longer than the fetch usually takes. A request that fails is forgotten, so
|
|
15
|
+
* the next reach tries again rather than failing for good.
|
|
16
|
+
*
|
|
17
|
+
* An object rather than a function so a test can spy on it. Exported for that,
|
|
18
|
+
* and deliberately left out of the barrel.
|
|
19
|
+
*/
|
|
20
|
+
export declare const hoverCardChunk: {
|
|
21
|
+
load(): Promise<HoverCardModule>;
|
|
22
|
+
};
|
|
4
23
|
export interface InlineCitationProps extends Omit<React.ComponentPropsWithoutRef<'a'>, 'color' | 'title' | 'children'> {
|
|
5
24
|
/**
|
|
6
25
|
* Which source this is, and the only thing the mark itself says. It is the
|
|
@@ -51,5 +70,10 @@ export interface InlineCitationProps extends Omit<React.ComponentPropsWithoutRef
|
|
|
51
70
|
* paragraph and the list it points at is somewhere else on the page, so there
|
|
52
71
|
* is no parent that could number it — and a component that numbered itself by
|
|
53
72
|
* render order would renumber the whole answer whenever a sentence moved.
|
|
73
|
+
*
|
|
74
|
+
* The preview arrives in a chunk of its own, on the first reach — see
|
|
75
|
+
* `hoverCardChunk`. Until then the mark is drawn bare, which is also what a
|
|
76
|
+
* server renders.
|
|
54
77
|
*/
|
|
55
78
|
export declare const InlineCitation: React.ForwardRefExoticComponent<InlineCitationProps & React.RefAttributes<HTMLElement>>;
|
|
79
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{useMergedRef as r}from"../../internal/refs.js";import{TextLink as o}from"../text-link/TextLink.js";import{fillMessage as i,linkMessages as a,sourcesMessages as s,useMessages as l}from"../../internal/i18n.js";import{opensElsewhere as c,safeHref as u,safeRel as d}from"../../internal/link.js";import{citationMarkClasses as m,cx as v,focusRingClasses as f,hasContent as p,metaTextClasses as h,srOnlyClasses as g,transitionClasses as x}from"../../internal/styles.js";import{useStyleDefaults as E}from"../../internal/defaults.js";let b,j;export const hoverCardChunk={load:()=>(j??=import("../hover-card/HoverCard.js").then(e=>(b=e,e),e=>{throw j=void 0,e}),j)};let w=null;const y=new WeakSet;export const InlineCitation=/*@__PURE__*/t.forwardRef(function InlineCitation(j,C){const{index:T,title:L,description:k,site:$,href:N,target:P,rel:S,preview:R=!0,size:X="md",color:Y="primary",locale:z,labels:D,className:F,style:I,...B}=E(j,["size","locale"]),[H,M]=t.useState(!1),W=t.useRef(!1),q=t.useRef(!1),A=()=>{hoverCardChunk.load().then(()=>M(!0),()=>{})},G={onPointerEnter:e=>{var n,t,r;B.onPointerEnter?.(e),q.current="mouse"===e.pointerType||"pen"===e.pointerType,q.current&&(n=e.currentTarget.ownerDocument,t=e.clientX,r=e.clientY,w={x:t,y:r},y.has(n)||(y.add(n),n.addEventListener("pointermove",e=>{w={x:e.clientX,y:e.clientY}},{capture:!0,passive:!0}))),A()},onPointerLeave:e=>{B.onPointerLeave?.(e),q.current=!1},onTouchStart:e=>{B.onTouchStart?.(e),A()},onFocus:e=>{B.onFocus?.(e),W.current=!0,A()},onBlur:e=>{B.onBlur?.(e),W.current=!1}},J=t.useRef(null),K=r(J,C);t.useEffect(()=>{const e=J.current;if(!H||!e)return;const n=e.ownerDocument;W.current&&n.activeElement!==e&&e.focus();const t=q.current&&w?n.elementFromPoint(w.x,w.y):null;return t&&e.contains(t)?function(e){const n=e.ownerDocument,t=r=>{n.removeEventListener("pointermove",t,!0),r.target instanceof Node&&e.contains(r.target)||e.dispatchEvent(new MouseEvent("mouseleave",{clientX:r.clientX,clientY:r.clientY,relatedTarget:r.target}))};return e.dispatchEvent(new MouseEvent("mouseenter")),n.addEventListener("pointermove",t,!0),()=>n.removeEventListener("pointermove",t,!0)}(e):void 0},[H]);const O=l(s,z),Q=l(a,z),U={...O,...D},V=i(U.citation,{index:String(T)}),Z=u(N),_=R&&p(L),ee={className:v(m,"align-[0.15em] no-underline",Z?"cursor-pointer":"cursor-default","hover:bg-(--n-soft-hover)",f,x,F??""),style:{"--n-soft":`var(--neba-${Y}-soft)`,"--n-soft-hover":`var(--neba-${Y}-soft-hover)`,"--n-on-tint":`var(--neba-${Y}-on-tint)`,"--n-ring":`var(--neba-${Y}-ring)`,...I}},ne=Z?e("a",{ref:K,href:Z,target:P,rel:d(P,S),"aria-label":c(P)?`${V} ${Q.newTab}`:V,...ee,...B,..._?G:null,children:T}):n("span",{ref:K,tabIndex:_?0:void 0,...ee,...B,..._?G:null,children:[e("span",{className:g,children:V}),e("span",{"aria-hidden":"true",children:T})]}),te=H?b?.HoverCard:void 0;return _&&te?e(te,{size:X,color:Y,trigger:ne,title:Z?e(o,{href:Z,underline:"hover",target:P,rel:d(P,S),locale:z,children:L}):L,description:$,children:p(k)?e("span",{className:v("text-(--neba-muted-fg)",h[X]),children:k}):null}):ne});
|
|
@@ -17,6 +17,15 @@ export interface ListProps extends NebaStyleProps, Omit<React.ComponentPropsWith
|
|
|
17
17
|
* @default false
|
|
18
18
|
*/
|
|
19
19
|
dividers?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The gap between the rows, on Tailwind's spacing scale: `1` is `0.25rem`,
|
|
22
|
+
* the same step `gap-1` is. Left out, the rows touch, and the padding inside
|
|
23
|
+
* each one is what keeps their text apart.
|
|
24
|
+
*
|
|
25
|
+
* Ignored with `dividers`, where the rule is what separates the rows: a rule
|
|
26
|
+
* with a gap on either side of it is a line floating between two tiles.
|
|
27
|
+
*/
|
|
28
|
+
spacing?: number;
|
|
20
29
|
/**
|
|
21
30
|
* Renders something other than a `<ul>` — `render={<ol />}` for a list where
|
|
22
31
|
* the order is the point. Base UI's own escape hatch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import*as t from"react";import{safeHref as s}from"../../internal/link.js";import{useRender as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import*as t from"react";import{safeHref as s}from"../../internal/link.js";import{useRender as i}from"@base-ui/react/use-render";import{boxPaddingXClasses as l}from"../box/Box.js";import{cx as a,focusRingClasses as o,gapClasses as d,hasContent as c,iconClasses as m,metaTextClasses as f,radiusClasses as p,sheetBodyClasses as x,surfaceClasses as u,surfaceSlots as h,transitionClasses as v}from"../../internal/styles.js";import{spacingValue as b}from"../../internal/grid.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const y=/*@__PURE__*/t.createContext({size:"md",density:"default",dividers:!1}),N={solid:u+" text-(--neba-fg) bg-(--n-panel-hover) [box-shadow:var(--n-elev),var(--neba-plate-solid)]",outline:u+" border text-(--neba-fg) bg-(--n-panel) [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]",text:"text-(--neba-fg) bg-transparent"},w={default:{xs:"py-1",sm:"py-1.5",md:"py-2",lg:"py-2.5",xl:"py-3"},compact:{xs:"py-0.5",sm:"py-0.5",md:"py-1",lg:"py-1.5",xl:"py-2"}},j={xs:p.xs,sm:p.xs,md:p.sm,lg:p.sm,xl:p.md};export const List=/*@__PURE__*/t.forwardRef(function List(n,r){const{variant:s="outline",size:l="md",color:o="primary",density:d="default",elevation:c=0,dividers:m=!1,spacing:f,render:x,className:u,style:w,children:j,...k}=g(n,["size","density","variant"]),z=t.useMemo(()=>({size:l,density:d,dividers:m}),[l,d,m]),C=a("flex flex-col",p[l],N[s],v,m?"overflow-hidden [&>li+li]:border-t [&>li+li]:[border-color:var(--n-line)]":"p-1",u??""),I=i({render:x,ref:r,props:{role:"list",className:C,style:{...h(o,c),...void 0===f||m?null:{gap:b(f)},...w},children:j,...k}});return e(y.Provider,{value:z,children:I})});export const ListItem=/*@__PURE__*/t.forwardRef(function ListItem({startIcon:i,endIcon:p,description:u,action:h,href:b,selected:g=!1,disabled:N=!1,className:k,children:z,onClick:C,...I},L){const{size:_,density:B,dividers:R}=t.useContext(y),$=s(b),F=Boolean(C||$)&&!N,M=l[B][_],P=w[B][_],q=a("flex min-w-0 flex-1 items-center text-start no-underline",M,P,d[_],x[_],v,m,R?"":j[_],N?"cursor-not-allowed text-(--neba-disabled-fg)":g?"bg-(--n-soft-press) font-medium text-(--n-on-tint)":"text-inherit",F?`cursor-pointer ${R?"[outline:0_solid_var(--n-ring)] outline-offset-[-2px] focus-visible:[outline:2px_solid_var(--n-ring)]":o}`:"",F&&!g?"hover:bg-(--n-soft)":"",F&&g?"hover:bg-(--n-soft-press)":""),A=n(r,{children:[c(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:i}):null,n("span",{className:"flex min-w-0 flex-1 flex-col",children:[c(z)?e("span",{className:"truncate",children:z}):null,c(u)?e("span",{className:a("truncate",f[_],g?"":"text-(--neba-muted-fg)"),children:u}):null]}),c(p)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:p}):null]});return n("li",{ref:L,className:a("flex w-full items-center",k??""),...I,children:[F&&$?e("a",{href:$,className:q,"aria-current":g?"page":void 0,onClick:C,children:A}):F?e("button",{type:"button",className:q,"aria-current":!!g||void 0,onClick:C,children:A}):e("div",{className:q,"aria-disabled":N||void 0,"aria-current":!!g||void 0,children:A}),c(h)?e("div",{className:`flex shrink-0 items-center ${M}`,children:h}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import*as l from"react";import{glowClasses as a,spotlightSlot as s,trackPointer as o}from"../../internal/glow.js";import{Menu as r}from"@base-ui/react/menu";import{useDirection as i}from"@base-ui/react/direction-provider";import{ContextMenu as c}from"@base-ui/react/context-menu";import{MenuContext as d}from"../../internal/menu.js";import{CheckIcon as u,ChevronIcon as m,DotIcon as p}from"../../internal/icons.js";import{safeHref as h,safeRel as f}from"../../internal/link.js";import{NewTabNote as x}from"../../internal/new-tab.js";import{controlTextLeadingClasses as b,cx as g,gapClasses as y,hasContent as N,iconClasses as k,metaTextClasses as v,popupFadeClasses as C,radiusClasses as M,surfaceClasses as z,surfaceSlots as O,transitionClasses as w}from"../../internal/styles.js";import{useStyleDefaults as I}from"../../internal/defaults.js";const P=
|
|
1
|
+
"use client";import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import*as l from"react";import{glowClasses as a,spotlightSlot as s,trackPointer as o}from"../../internal/glow.js";import{Menu as r}from"@base-ui/react/menu";import{useDirection as i}from"@base-ui/react/direction-provider";import{ContextMenu as c}from"@base-ui/react/context-menu";import{MenuContext as d}from"../../internal/menu.js";import{CheckIcon as u,ChevronIcon as m,DotIcon as p}from"../../internal/icons.js";import{safeHref as h,safeRel as f}from"../../internal/link.js";import{NewTabNote as x}from"../../internal/new-tab.js";import{controlTextLeadingClasses as b,cx as g,gapClasses as y,hasContent as N,iconClasses as k,metaTextClasses as v,popupFadeClasses as C,radiusClasses as M,surfaceClasses as z,surfaceSlots as O,transitionClasses as w}from"../../internal/styles.js";import{useStyleDefaults as I}from"../../internal/defaults.js";const P=z+" max-h-[min(24rem,var(--available-height))] min-w-40 overflow-y-auto overscroll-contain border bg-(--n-panel-press) p-1 [border-color:var(--n-line)] [box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)] [outline:none] "+C,j={default:{xs:"px-1.5 py-0.5",sm:"px-2 py-1",md:"px-2.5 py-1.5",lg:"px-3 py-2",xl:"px-3.5 py-2.5"},compact:{xs:"px-1 py-0.5",sm:"px-1.5 py-0.5",md:"px-2 py-1",lg:"px-2.5 py-1",xl:"px-3 py-1.5"}},R={xs:M.xs,sm:M.xs,md:M.sm,lg:M.sm,xl:M.md};function $(e,n,t,l,s){return g("relative flex w-full cursor-pointer items-center select-none no-underline",l?a:"",t?"text-(--n-on-tint)":"text-(--neba-fg)",j[n][e],R[e],y[e],b[e],w,k,"data-[highlighted]:bg-(--n-soft-hover)","data-[popup-open]:bg-(--n-soft)","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)","[outline:none]",s??"")}const B="flex h-[1lh] w-[1.2em] shrink-0 items-center justify-center";function RowBody({children:t,description:l,size:a}){return N(l)?n("span",{className:"flex min-w-0 flex-1 flex-col text-start",children:[e("span",{className:"truncate",children:t}),e("span",{className:`truncate text-(--neba-muted-fg) ${v[a]}`,children:l})]}):e("span",{className:"min-w-0 flex-1 truncate text-start",children:t})}export function MenuItem({onClick:a,href:i,target:c,rel:u,startIcon:m,endIcon:p,shortcut:b,description:g,color:y,closeOnClick:k=!0,disabled:C=!1,label:M,children:z,className:w,style:I}){const P=l.useContext(d),{size:j,density:R}=P,F=n(t,{children:[N(m)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:m}):null,e(RowBody,{description:g,size:j,children:z}),N(p)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:p}):null,N(b)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${v[j]}`,children:b}):null]}),G={...y?O(y,0):void 0,...s,...I},S=h(i);return void 0===S||C?e(r.Item,{disabled:C,label:M,closeOnClick:k,onClick:a,className:$(j,R,Boolean(y),!C,w),style:G,onPointerMove:o(void 0,!C),children:F}):n(r.LinkItem,{href:S,target:c,rel:f(c,u),label:M,closeOnClick:k,onClick:a,className:$(j,R,Boolean(y),!C,w),style:G,onPointerMove:o(void 0,!0),children:[F,e(x,{target:c})]})}export function MenuCheckboxItem({checked:t,defaultChecked:a,onCheckedChange:i,endIcon:c,shortcut:m,description:p,color:h,closeOnClick:f=!1,disabled:x=!1,label:b,children:g,className:y,style:k}){const{size:C,density:M}=l.useContext(d),z=h?O(h,0):void 0;return n(r.CheckboxItem,{checked:t,defaultChecked:a,onCheckedChange:e=>i?.(e),disabled:x,label:b,closeOnClick:f,className:$(C,M,Boolean(h),!x,y),style:{...z,...s,...k},onPointerMove:o(void 0,!x),children:[e("span",{className:`${B} text-(--n-accent)`,children:e(r.CheckboxItemIndicator,{className:"flex items-center justify-center",children:e(u,{})})}),e(RowBody,{description:p,size:C,children:g}),N(c)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:c}):null,N(m)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${v[C]}`,children:m}):null]})}export function MenuRadioGroup({value:n,defaultValue:t,onValueChange:l,disabled:a=!1,children:s,className:o}){return e(r.RadioGroup,{value:n,defaultValue:t,onValueChange:e=>l?.(e),disabled:a,className:o,children:s})}export function MenuRadioItem({value:t,endIcon:a,shortcut:i,description:c,color:u,closeOnClick:m=!1,disabled:h=!1,label:f,children:x,className:b,style:g}){const{size:y,density:k}=l.useContext(d),C=u?O(u,0):void 0;return n(r.RadioItem,{value:t,disabled:h,label:f,closeOnClick:m,className:$(y,k,Boolean(u),!h,b),style:{...C,...s,...g},onPointerMove:o(void 0,!h),children:[e("span",{className:`${B} text-(--n-accent)`,children:e(r.RadioItemIndicator,{className:"flex items-center justify-center",children:e(p,{})})}),e(RowBody,{description:c,size:y,children:x}),N(a)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:a}):null,N(i)?e("span",{className:`ms-2 shrink-0 text-(--neba-muted-fg) tabular-nums ${v[y]}`,children:i}):null]})}export function MenuGroup({label:t,children:a,className:s}){const{size:o,density:i}=l.useContext(d);return n(r.Group,{className:s,children:[N(t)?e(r.GroupLabel,{className:j[i][o]+" "+v[o]+" font-semibold tracking-wide text-(--neba-muted-fg) uppercase",children:t}):null,a]})}export function MenuSeparator({className:n,...t}){return e(r.Separator,{className:g("-mx-1 my-1 h-px bg-(--n-line)",n??""),...t})}export function MenuSubmenu({label:t,startIcon:a,disabled:c=!1,side:u,sideOffset:p=4,children:h,className:f,style:x}){const y=l.useContext(d),{size:k,density:v,color:C,keepMounted:z}=y,w=i();return n(r.SubmenuRoot,{children:[n(r.SubmenuTrigger,{disabled:c,className:$(k,v,!1,!c),style:s,onPointerMove:o(void 0,!c),children:[N(a)?e("span",{className:`${B} text-(--neba-muted-fg)`,children:a}):null,e("span",{className:"min-w-0 flex-1 truncate text-start",children:t}),e("span",{className:`${B} text-(--neba-muted-fg) ${"rtl"===w?"rotate-90":"-rotate-90"}`,children:e(m,{})})]}),e(r.Portal,{keepMounted:z,children:e(r.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:u??"inline-end",sideOffset:p,align:"start",children:e(r.Popup,{className:g(P,M[k],b[k],f??""),style:{...O(C,3),...x},children:h})})})]})}export function Menu(t){const{size:a="md",color:s="primary",density:o="default",trigger:i,open:c,defaultOpen:u,onOpenChange:m,side:p="bottom",align:h="start",sideOffset:f=6,modal:x,openOnHover:y=!1,loopFocus:N=!0,disabled:k=!1,keepMounted:v=!1,className:C,style:z,children:w}=I(t,["size","density"]),j=l.useMemo(()=>({size:a,color:s,density:o,keepMounted:v}),[a,s,o,v]);return e(d.Provider,{value:j,children:n(r.Root,{open:c,defaultOpen:u,onOpenChange:e=>m?.(e),modal:x,loopFocus:N,disabled:k,children:[i?e(r.Trigger,{render:i,openOnHover:y,disabled:k}):null,e(r.Portal,{keepMounted:v,children:e(r.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:p,align:h,sideOffset:f,children:e(r.Popup,{className:g(P,M[a],b[a],C??""),style:{...O(s,3),...z},children:w})})})]})})}export const ContextMenu=/*@__PURE__*/l.forwardRef(function ContextMenu(t,a){const{size:s="md",color:o="primary",density:r="default",content:i,children:u,open:m,defaultOpen:p,onOpenChange:h,loopFocus:f=!0,disabled:x=!1,keepMounted:y=!1,className:N,style:k,...v}=I(t,["size","density"]),C=l.useMemo(()=>({size:s,color:o,density:r,keepMounted:y}),[s,o,r,y]);return e(d.Provider,{value:C,children:n(c.Root,{open:m,defaultOpen:p,onOpenChange:e=>h?.(e),loopFocus:f,disabled:x,children:[e(c.Trigger,{ref:a,render:u,...v}),e(c.Portal,{keepMounted:y,children:e(c.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",children:e(c.Popup,{className:g(P,M[s],b[s],N??""),style:{...O(o,3),...k},children:i})})})]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import*as n from"react";import{useDirection as o}from"@base-ui/react/direction-provider";import{Menubar as r}from"@base-ui/react/menubar";import{Menu as i}from"../menu/Menu.js";import{MenuContext as a}from"../../internal/menu.js";import{controlTextClasses as s,cx as l,gapClasses as c,hasContent as d,iconClasses as u,paddingXClasses as f,radiusClasses as m,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const h={xs:"h-4.5",sm:"h-5.5",md:"h-6.5",lg:"h-8",xl:"h-10"},v=
|
|
1
|
+
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import*as n from"react";import{useDirection as o}from"@base-ui/react/direction-provider";import{Menubar as r}from"@base-ui/react/menubar";import{Menu as i}from"../menu/Menu.js";import{MenuContext as a}from"../../internal/menu.js";import{controlTextClasses as s,cx as l,gapClasses as c,hasContent as d,iconClasses as u,paddingXClasses as f,radiusClasses as m,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const h={xs:"h-4.5",sm:"h-5.5",md:"h-6.5",lg:"h-8",xl:"h-10"},v="inline-flex shrink-0 cursor-pointer select-none items-center justify-center whitespace-nowrap font-medium leading-none text-(--neba-fg) bg-transparent [-webkit-tap-highlight-color:transparent] [touch-action:manipulation] "+p+" "+u+" hover:bg-(--n-soft) data-[popup-open]:bg-(--n-soft-hover) data-[popup-open]:text-(--n-on-tint) focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px] disabled:cursor-not-allowed disabled:text-(--neba-disabled-fg) disabled:hover:bg-transparent";export function MenubarMenu({label:r,startIcon:l,disabled:u=!1,children:p}){const{size:b,color:x,density:g,orientation:y}=n.useContext(a),j=o();return t(i,{size:b,color:x,density:g,disabled:u,side:"vertical"===y?"rtl"===j?"left":"right":void 0,openOnHover:!0,sideOffset:4,trigger:e("button",{type:"button",disabled:u,className:v+" "+h[b]+" "+s[b]+" "+c[b]+" "+f["default"===g?"compact":g][b]+" "+m[b],children:[d(l)?l:null,r]}),children:p})}export const Menubar=/*@__PURE__*/n.forwardRef(function Menubar(e,o){const{size:i="md",color:s="primary",density:d="default",orientation:u="horizontal",modal:f=!0,loopFocus:m=!0,disabled:p=!1,className:h,style:v,children:x,...g}=b(e,["size","density"]),y=n.useMemo(()=>({size:i,color:s,density:d,orientation:u}),[i,s,d,u]);return t(a.Provider,{value:y,children:t(r,{ref:o,orientation:u,modal:f,loopFocus:m,disabled:p,className:l("flex items-center","vertical"===u?"flex-col items-stretch":"flex-row",c[i],h??""),style:{"--n-soft":`var(--neba-${s}-soft)`,"--n-soft-hover":`var(--neba-${s}-soft-hover)`,"--n-accent":`var(--neba-${s}-accent)`,"--n-on-tint":`var(--neba-${s}-on-tint)`,"--n-ring":`var(--neba-${s}-ring)`,...v},...g,children:x})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Meter as r}from"@base-ui/react/meter";import{barThicknessClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Meter as r}from"@base-ui/react/meter";import{barThicknessClasses as s,progressAriaText as t,progressFraction as o,progressLabelClasses as i,progressSlots as n,thresholdColor as m}from"../../internal/progress.js";import{cx as d,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";import{useIntlLocale as b}from"../../internal/media.js";export const Meter=/*@__PURE__*/l.forwardRef(function Meter(h,p){const{value:v,min:x=0,max:j=100,label:g,showValue:y=!1,format:w,locale:N,thresholds:k,thickness:M,size:_="md",color:V="primary",className:$,style:z,...I}=f(h,["size","locale"]),R=b(N),T=l.useId(),A=o(v,x,j),q=m(v,V,k),B=void 0!==w;return a(r.Root,{ref:p,value:v,min:x,max:j,format:w,locale:R,getAriaValueText:t(A,B),className:d("flex w-full flex-col",c[_],$??""),style:{...n(q),...z},"aria-labelledby":g?T:void 0,...I,children:[g||y?a("div",{className:"flex items-baseline gap-2 "+(g?"justify-between":"justify-end")+" "+u[_],children:[g?e("span",{id:T,role:"presentation",className:i,children:g}):null,y?e(r.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>B?e:`${Math.round(100*(A??0))}%`}):null]}):null,e(r.Track,{className:`relative w-full overflow-hidden rounded-full bg-(--n-soft) ${s[_]}`,style:void 0===M?void 0:{height:`${M}px`},children:e(r.Indicator,{className:"absolute top-0 rounded-full bg-(--n-fill) [transition:width_var(--neba-duration-fill)_var(--neba-ease),background-color_var(--neba-duration)_var(--neba-ease)]"})})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as r from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as r from"react";import{useMergedRef as a}from"../../internal/refs.js";import{useLayoutEffectOnClient as o}from"../../internal/layout-effect.js";import{ScreenContext as n}from"../../internal/screen.js";import{useRender as d}from"@base-ui/react/use-render";import{transitionProps as h}from"../../internal/animate.js";import{MockupCutout as s,defaultNotch as l,elevationFilters as c,finishSlots as p,mockupChrome as m,mockupMetrics as u,resolveOs as f,shellClasses as g}from"../../internal/mockup.js";import{observeResize as b}from"../../internal/observe.js";import{cx as w,surfaceSlots as v}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";export const Mockup=/*@__PURE__*/r.forwardRef(function Mockup(y,k){const{device:N,os:R,hardware:$="monitor",size:j="md",resolution:z,orientation:M="portrait",bezel:W="standard",finish:F="graphite",notch:S,systemUi:T=!0,scroll:B=!1,wallpaper:H,time:L="9:41",width:P,height:q,color:C="primary",elevation:I=0,transition:U,render:A,className:D,style:E,children:G,...J}=x(y,["size"]),K=f(N,R),O=S??l(N,K),Q="desktop"!==N&&"landscape"===M,V=u({device:N,size:j,resolution:z,orientation:M,bezel:W,hardware:$}),{screen:X,frame:Y,body:Z,stand:_,base:ee}=V,te=r.useRef(null),[ie,re]=r.useState(null),ae="number"==typeof P?"number"==typeof q?Math.min(P/Y.width,q/Y.height):P/Y.width:"number"==typeof q&&void 0===P?q/Y.height:null,oe=ie??ae,ne=`min(tan(atan2(100cqw, ${Y.width}px)), tan(atan2(100cqh, ${Y.height}px)))`;o(()=>{const e=te.current;if(!e)return;const t=()=>{const t=getComputedStyle(e),i=(e,t)=>parseFloat(e)+parseFloat(t),r="border-box"===t.boxSizing,a=parseFloat(t.width)-(r?i(t.paddingLeft,t.paddingRight)+i(t.borderLeftWidth,t.borderRightWidth):0),o=parseFloat(t.height)-(r?i(t.paddingTop,t.paddingBottom)+i(t.borderTopWidth,t.borderBottomWidth):0);if(!(a>0&&o>0))return;const n=Math.min(a/Y.width,o/Y.height);re(e=>null!==e&&Math.abs(e-n)<1e-4?e:n)};return t(),b(e,t)},[Y.width,Y.height]);const de=a(te,k),he=T?m({os:K,notch:O,landscape:Q,time:L}):{},se=h(U),le="none"===W,ce=t("div",{className:"neba-mockup-screen relative flex flex-col overflow-hidden",style:{width:X.width,height:X.height,borderRadius:V.screenRadius,background:H??"var(--neba-surface)",boxShadow:le?void 0:"inset 0 0 0 1px var(--n-shell-shade)"},children:[he.top?.node,t("div",{className:"flex min-h-0 flex-1",children:[he.start?.node,e("div",{className:"min-w-0 flex-1 "+(B?"overflow-auto":"overflow-hidden"),style:{containerType:"size",containerName:"neba-screen"},children:e(n.Provider,{value:!0,children:G})})]}),he.bottom?.node,e(s,{notch:O,screen:X,landscape:Q})]}),pe=w("neba-mockup relative block overflow-hidden",se.className,D??"");return d({render:A,ref:de,props:{className:pe,style:{...v(C,I),...p[F],...se.style,width:P??(void 0===q?"100%":"auto"),height:q??"auto",aspectRatio:`${Y.width} / ${Y.height}`,...null===oe?{containerType:"size"}:null,filter:c[I],...E},children:t("div",{className:"absolute top-1/2 left-1/2 flex flex-col items-center",style:{width:Y.width,height:Y.height,transform:`translate(-50%, -50%) scale(${oe??ne})`},children:[e("div",{className:le?"":g,style:{width:Z.width,height:Z.height,borderRadius:V.frameRadius,paddingBlock:`${V.bezel.top}px ${V.bezel.bottom}px`,paddingInline:V.bezel.x},children:ce}),_?t(i,{children:[e("div",{"aria-hidden":"true",style:{width:_.neckWidth,height:_.neckHeight,background:"var(--n-shell-shade)",clipPath:"polygon(16% 0, 84% 0, 100% 100%, 0 100%)"}}),e("div",{"aria-hidden":"true",className:g,style:{width:_.footWidth,height:_.footHeight,borderRadius:_.footHeight/2}})]}):null,ee?e("div",{"aria-hidden":"true",className:`relative ${g}`,style:{width:ee.width,height:ee.height,borderRadius:`0 0 ${Math.round(.55*ee.height)}px ${Math.round(.55*ee.height)}px`,clipPath:"polygon(0 0, 100% 0, 98.5% 100%, 1.5% 100%)"},children:e("div",{className:"absolute top-0 left-1/2",style:{width:ee.lipWidth,height:Math.round(.34*ee.height),marginLeft:-ee.lipWidth/2,borderRadius:`0 0 ${Math.round(.2*ee.height)}px ${Math.round(.2*ee.height)}px`,background:"var(--n-shell-shade)"}})}):null]}),...J}})});
|
|
@@ -27,7 +27,8 @@ export interface NavigationMenuItemProps {
|
|
|
27
27
|
/**
|
|
28
28
|
* Makes the item a plain link rather than something that opens a panel. An
|
|
29
29
|
* item with an `href` and no children is a destination, and it is announced as
|
|
30
|
-
* one — which is the whole reason a site nav is not a Menu.
|
|
30
|
+
* one — which is the whole reason a site nav is not a Menu. With children it
|
|
31
|
+
* is not used, and a development build says so in the console.
|
|
31
32
|
*/
|
|
32
33
|
href?: string;
|
|
33
34
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n,Fragment as a}from"react/jsx-runtime";import*as t from"react";import{NavigationMenu as i}from"@base-ui/react/navigation-menu";import{ChevronIcon as r}from"../../internal/icons.js";import{safeHref as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n,Fragment as a}from"react/jsx-runtime";import*as t from"react";import{NavigationMenu as i}from"@base-ui/react/navigation-menu";import{ChevronIcon as r}from"../../internal/icons.js";import{safeHref as s,safeRel as o}from"../../internal/link.js";import{NewTabNote as l}from"../../internal/new-tab.js";import{controlHeightClasses as d,controlTextClasses as c,controlTextLeadingClasses as u,cx as p,gapClasses as m,hasContent as f,iconClasses as h,metaTextClasses as b,paddingXClasses as g,popupFadeStateClasses as v,radiusClasses as x,surfaceClasses as N,surfaceSlots as y,transitionClasses as w}from"../../internal/styles.js";import{useStyleDefaults as k}from"../../internal/defaults.js";const _=/*@__PURE__*/t.createContext({size:"md",density:"default"}),M="inline-flex shrink-0 cursor-pointer select-none items-center justify-center whitespace-nowrap font-medium leading-none no-underline text-(--neba-fg) bg-transparent [-webkit-tap-highlight-color:transparent] [touch-action:manipulation] "+w+" "+h+" hover:bg-(--n-soft) data-[popup-open]:bg-(--n-soft-hover) data-[popup-open]:text-(--n-on-tint) focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2 data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg) data-[disabled]:hover:bg-transparent",j=N+" relative border text-(--neba-fg) bg-(--n-panel-press) [border-color:var(--n-line)] [box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)] [outline:none] overflow-hidden [transition:opacity_var(--neba-duration)_var(--neba-ease),width_var(--neba-duration)_var(--neba-ease),height_var(--neba-duration)_var(--neba-ease)] "+v,z="flex min-w-0 cursor-pointer items-start no-underline text-(--neba-fg) bg-transparent "+w+" "+h+" hover:bg-(--n-soft) focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",C={xs:"p-1",sm:"p-1.5",md:"p-2",lg:"p-2.5",xl:"p-3"};export const NavigationMenuLink=/*@__PURE__*/t.forwardRef(function NavigationMenuLink({href:a,title:r,description:d,startIcon:c,target:h,rel:v,className:N,children:y,...w},k){const{size:M,density:j}=t.useContext(_);return n(i.Link,{ref:k,href:s(a),target:h,rel:o(h,v),className:p(z,x[M],m[M],g[j??"default"][M],"py-2",N??""),...w,children:[f(c)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:c}):null,n("span",{className:"flex min-w-0 flex-col gap-0.5",children:[e("span",{className:`font-medium ${u[M]}`,children:r}),f(d)?e("span",{className:`text-(--neba-muted-fg) ${b[M]}`,children:d}):null,y,e(l,{target:h})]})]})});export function NavigationMenuItem({label:u,href:p,target:h,rel:b,startIcon:v,value:N,disabled:y=!1,columns:w=1,keepMounted:k=!0,children:j}){const{size:z,density:$}=t.useContext(_),I=s(p),L=f(j),P=void 0!==I&&!L;t.useEffect(()=>{"production"!==process.env.NODE_ENV&&void 0!==p&&L&&console.warn(`Neba: a NavigationMenuItem has both children and href="${p}". An item with children opens a panel and is drawn as a button, so the href is not used. Put the destination in the panel as a NavigationMenuLink, or drop the children to make the item a link.`)},[p,L]);const V=M+" "+d[z]+" "+c[z]+" "+m[z]+" "+g[$??"default"][z]+" "+x[z];return e(i.Item,{value:N,children:P&&y?n("span",{"aria-disabled":"true","data-disabled":"",className:V,children:[f(v)?v:null,u]}):P?n(i.Link,{href:I,target:h,rel:o(h,b),className:V,children:[f(v)?v:null,u,e(l,{target:h})]}):n(a,{children:[n(i.Trigger,{disabled:y,className:V,children:[f(v)?v:null,u,e(i.Icon,{className:"flex items-center [transition:rotate_var(--neba-duration)_var(--neba-ease)] data-[popup-open]:rotate-180",children:e(r,{})})]}),e(i.Content,{keepMounted:k,className:`grid gap-1 [&[hidden]]:hidden ${C[z]}`,style:w>1?{gridTemplateColumns:`repeat(${w}, minmax(0, 1fr))`}:void 0,children:j})]})})}export const NavigationMenu=/*@__PURE__*/t.forwardRef(function NavigationMenu(a,r){const{size:s="md",color:o="primary",density:l="default",orientation:d="horizontal",value:c,defaultValue:u,onValueChange:p,delay:f,closeDelay:h,sideOffset:b=8,className:g,style:v,children:N,...w}=k(a,["size","density"]),M=t.useMemo(()=>({size:s,density:l}),[s,l]),z=y(o,3);return e(_.Provider,{value:M,children:n(i.Root,{ref:r,orientation:d,value:c,defaultValue:u,onValueChange:e=>p?.(e),delay:f,closeDelay:h,className:g,style:{...z,...v},...w,children:[e(i.List,{className:"flex items-center "+("vertical"===d?"flex-col items-stretch":"flex-row")+" "+m[s],children:N}),e(i.Portal,{children:e(i.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:"vertical"===d?"inline-end":"bottom",sideOffset:b,collisionPadding:12,children:e(i.Popup,{className:`${j} ${x[s]}`,style:z,children:e(i.Viewport,{})})})})]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{NumberField as t}from"@base-ui/react/number-field";import{Field as n}from"@base-ui/react/field";import{numberMessages as r,useMessages as i}from"../../internal/i18n.js";import{MinusIcon as s,PlusIcon as o}from"../../internal/icons.js";import{keyHandler as c}from"../../internal/keys.js";import{FieldNotch as d,NotchFrame as m,restEndOf as p}from"../../internal/notch.js";import{controlTextLeadingClasses as u,cx as b,disabledClasses as f,fieldFocusTransitionClasses as h,fieldHeightClasses as g,fieldReadOnlyClasses as x,fieldRestClasses as v,fieldRingClasses as N,fieldSheetClasses as y,fieldSheetDisabledClasses as j,fieldSheetReadOnlyClasses as w,gapClasses as k,hasContent as _,iconClasses as S,metaTextClasses as C,paddingXClasses as V,radiusClasses as z,readOnlyFilterClasses as O,stackGapClasses as $,surfaceSlots as I,transitionClasses as D}from"../../internal/styles.js";import{useStyleDefaults as F}from"../../internal/defaults.js";import{useIntlLocale as L}from"../../internal/media.js";import{fieldLight as R,fieldSpotlightSlot as q,glowClasses as E}from"../../internal/glow.js";import{useFieldsetDisabled as P}from"../../internal/fieldset.js";const W=
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{NumberField as t}from"@base-ui/react/number-field";import{Field as n}from"@base-ui/react/field";import{numberMessages as r,useMessages as i}from"../../internal/i18n.js";import{MinusIcon as s,PlusIcon as o}from"../../internal/icons.js";import{keyHandler as c}from"../../internal/keys.js";import{FieldNotch as d,NotchFrame as m,restEndOf as p}from"../../internal/notch.js";import{controlTextLeadingClasses as u,cx as b,disabledClasses as f,fieldFocusTransitionClasses as h,fieldHeightClasses as g,fieldReadOnlyClasses as x,fieldRestClasses as v,fieldRingClasses as N,fieldSheetClasses as y,fieldSheetDisabledClasses as j,fieldSheetReadOnlyClasses as w,gapClasses as k,hasContent as _,iconClasses as S,metaTextClasses as C,paddingXClasses as V,radiusClasses as z,readOnlyFilterClasses as O,stackGapClasses as $,surfaceSlots as I,transitionClasses as D}from"../../internal/styles.js";import{useStyleDefaults as F}from"../../internal/defaults.js";import{useIntlLocale as L}from"../../internal/media.js";import{fieldLight as R,fieldSpotlightSlot as q,glowClasses as E}from"../../internal/glow.js";import{useFieldsetDisabled as P}from"../../internal/fieldset.js";const W="group relative flex w-full items-center [-webkit-tap-highlight-color:transparent] "+D+" "+h+" "+S,B="relative inline-flex size-[1.7em] shrink-0 cursor-pointer items-center justify-center neba-hit-row rounded-(--neba-radius-xs) text-(--neba-muted-fg) select-none [&_svg]:size-[0.9em] [&_svg]:shrink-0 [-webkit-tap-highlight-color:transparent] [touch-action:manipulation] [transition:background-color_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)] active:[transition-duration:0ms] hover:bg-(--n-soft) hover:text-(--n-on-tint) active:bg-(--n-soft-press) focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1 disabled:cursor-not-allowed disabled:bg-transparent disabled:text-(--neba-disabled-fg)";export const NumberField=/*@__PURE__*/l.forwardRef(function NumberField(l,h){const{variant:S="outline",size:D="md",color:G="primary",density:K="default",elevation:A=0,value:H,defaultValue:J,onValueChange:M,onValueCommitted:Q,min:T,max:U,step:X,largeStep:Y,smallStep:Z,snapOnStep:ee,wheel:ae=!0,format:le,locale:te,steppers:ne="end",incrementLabel:re,decrementLabel:ie,label:se,labelPlacement:oe="top",description:ce,error:de,invalid:me,startIcon:pe,endIcon:ue,fullWidth:be=!1,disabled:fe,readOnly:he=!1,required:ge=!1,name:xe,placeholder:ve,id:Ne,className:ye,classNames:je,shortcuts:we,style:ke,"aria-label":_e,"aria-labelledby":Se,...Ce}=F(l,["size","density","variant","locale","labelPlacement"]),Ve=P(fe),ze=!Ve&&!he,Oe=i(r,"string"==typeof te?te:void 0),$e=L(void 0),Ie=_(de),De=me??Ie,Fe=De?"danger":G,Le=V[K][D],Re={end:`${Le} pe-1`,split:"px-1",none:Le},qe=e(t.Decrement,{"aria-label":ie??Oe.decrease,className:b(B,je?.stepper),children:e(s,{})}),Ee=e(t.Increment,{"aria-label":re??Oe.increase,className:b(B,je?.stepper),children:e(o,{})}),Pe="none"!==ne&&!he,We="top"!==oe&&_(se),Be=We&&"float"===oe&&!_(pe)&&!(Pe&&"split"===ne),Ge=a(t.Group,{...R(ze),className:b(W,g[D],u[D],z[D],k[D],Pe?Re[ne]:Le,We?"":N,Ve?(We?j:f)[S]:he?We?`${w[S]} ${O}`:x[S]:`${(We?y:v)[S]} ${E}`,Ve?"":"cursor-text",je?.shell),children:[Pe&&"split"===ne?qe:null,pe?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:pe}):null,e(t.Input,{ref:h,"aria-label":_e,"aria-labelledby":Se,onKeyDown:c(we),placeholder:Be?ve||" ":ve,className:["neba-input min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","tabular-nums","split"===ne&&Pe?"text-center":"","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Be?"neba-float-control":"",je?.control].filter(Boolean).join(" ")}),ue?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:ue}):null,Pe&&"end"===ne?a("span",{className:"flex shrink-0 items-center gap-0.5",style:{"--n-hit-gap":"0.125rem"},children:[qe,Ee]}):null,Pe&&"split"===ne?Ee:null,We?e(d,{label:se,variant:S,disabled:Ve,readOnly:he,rests:Be,labelClassName:je?.label}):null]});return a(n.Root,{disabled:Ve,invalid:De,className:b("flex-col align-top",$[D],be?"flex w-full":"inline-flex",ye??""),style:{...I(Fe,A),...ze?q:void 0,...ke},...Ce,children:[se&&!We?e(n.Label,{className:b(C[D],"font-medium",Ve?"text-(--neba-disabled-fg)":"text-(--neba-fg)",je?.label),children:se}):null,e(t.Root,{id:Ne,name:xe,className:"contents",value:H,defaultValue:J,onValueChange:e=>M?.(e),onValueCommitted:e=>Q?.(e),min:T,max:U,step:X,largeStep:Y,smallStep:Z,snapOnStep:ee,allowWheelScrub:ae,format:le,locale:te??$e,disabled:Ve,readOnly:he,required:ge,children:We?e(m,{label:se,size:D,density:K,variant:S,rests:Be,restEnd:p(D,[...ue?[1.2]:[],...Pe&&"end"===ne?[3.55]:[]]),labelClassName:je?.label,children:Ge}):Ge}),ce?e(n.Description,{className:b(C[D],"text-(--neba-muted-fg)",je?.description),children:ce}):null,e(n.Error,Ie?{match:!0,className:b(C[D],"text-(--n-accent)",je?.error),children:de}:{className:b(C[D],"text-(--n-accent)",je?.error)})]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { NumberField } from './NumberField.js';
|
|
2
|
-
export type { NumberFieldProps, NumberFieldSteppers } from './NumberField.js';
|
|
2
|
+
export type { NumberFieldProps, NumberFieldSlot, NumberFieldSteppers } from './NumberField.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as r}from"@base-ui/react/dialog";import{overlayMessages as n,useMessages as l}from"../../internal/i18n.js";import{cx as t,popupFadeClasses as s,surfaceSlots as o}from"../../internal/styles.js";import{useStyleDefaults as i}from"../../internal/defaults.js";const c={scrim:"bg-(--neba-scrim) [backdrop-filter:blur(2px)]",blur:"[background-color:color-mix(in_oklab,var(--neba-scrim)_55%,transparent)] [backdrop-filter:blur(14px)_saturate(1.4)]",solid:"bg-(--neba-surface)",clear:""},p={start:"items-start",center:"items-center",end:"items-end"},m={xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8",xl:"p-10"};export function Overlay(d){const{open:b,defaultOpen:f,onOpenChange:u,tone:x="scrim",dismissible:g=!1,modal:h=!0,align:j="center",size:y="md",color:k="primary",locale:z,label:v,className:O,style:N,children:P,..._}=i(d,["size","locale"]),w=l(n,z);return e(r.Root,{open:b,defaultOpen:f,modal:h,disablePointerDismissal:!g,onOpenChange:(e,a)=>{g||e||"escape-key"!==a.reason?u?.(e):a.cancel()},children:a(r.Portal,{children:[e(r.Backdrop,{className:t("neba-portal fixed inset-0 z-(--neba-z-portal)",s,c[x],!0===h?"":"pointer-events-none")}),e(r.Viewport,{className:"neba-portal fixed inset-0 z-(--neba-z-portal) flex justify-center "+p[j]+" "+m[y]+" "+(!0===h?"":"pointer-events-none"),children:e(r.Popup,{"aria-label":v??w.label,className:t("flex max-h-full max-w-full flex-col items-center justify-center","[outline:none]",!0===h?"":"pointer-events-auto",s,O??""),style:{...o(k,0),...N},..._,children:P})})]})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as l from"react";import{layoutMessages as n,useMessages as t}from"../../internal/i18n.js";import{headerFloor as r,PageLayoutContext as a,SidebarSideContext as i,PageLayoutSlotContext as s}from"../../internal/page-layout.js";import{useLayoutEffectOnClient as u}from"../../internal/layout-effect.js";import{observeResize as d}from"../../internal/observe.js";import{controlSlots as
|
|
1
|
+
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import*as l from"react";import{layoutMessages as n,useMessages as t}from"../../internal/i18n.js";import{headerFloor as r,PageLayoutContext as a,SidebarSideContext as i,PageLayoutSlotContext as s}from"../../internal/page-layout.js";import{useLayoutEffectOnClient as u}from"../../internal/layout-effect.js";import{observeResize as d}from"../../internal/observe.js";import{useMergedRef as f}from"../../internal/refs.js";import{controlSlots as c,cx as p,hasContent as m,insetRingClasses as h,toLength as v}from"../../internal/styles.js";import{DefaultsContext as x,useStyleDefaults as y}from"../../internal/defaults.js";import{ScreenContext as b}from"../../internal/screen.js";const g=["header","footer"];export const PageLayout=/*@__PURE__*/l.forwardRef(function PageLayout(w,j){const{header:S,footer:C,sidebar:P,endSidebar:k,headerSpan:N="full",footerSpan:O="full",scroll:$="page",height:z="viewport",collapseBelow:L="md",sidebarOpen:R,defaultSidebarOpen:B=!1,onSidebarOpenChange:E,endSidebarOpen:H,defaultEndSidebarOpen:I=!1,onEndSidebarOpenChange:M,skipLink:_=!0,skipLabel:T,main:V,mainId:q="main",mainProps:A,locale:D,color:F="primary",className:G,style:J,children:K,...Q}=y(w,["locale"]),U=t(n,D),W=l.useContext(b),X=l.useContext(x),Y=V??!W,[Z,ee]=l.useState(B),[oe,le]=l.useState(I),ne=l.useMemo(()=>({start:R??Z,end:H??oe}),[R,Z,H,oe]),te=l.useCallback((e,o)=>{if("start"===e)return void 0===R&&ee(o),void E?.(o);void 0===H&&le(o),M?.(o)},[R,H,E,M]),re=l.useRef(null),ae=f(re,j),ie=l.useRef({header:null,footer:null}),se=l.useRef({header:null,footer:null}),ue=l.useCallback(()=>{const e=re.current;if(!e)return;const o=[];for(const e of g){const l=ie.current[e],n="header"===e?N:O;if(!l){o.push([`--n-layout-${e}`,"0px"],[`--n-layout-${e}-inset`,"0px"]);continue}const t=getComputedStyle(l).position,r=`${l.offsetHeight}px`,a="sticky"===t||"fixed"===t;o.push([`--n-layout-${e}`,a&&"full"===n?r:"0px"],[`--n-layout-${e}-inset`,"fixed"===t?r:"0px"])}for(const[l,n]of o)e.style.getPropertyValue(l)!==n&&e.style.setProperty(l,n)},[N,O]),de=l.useCallback(()=>{for(const e of g){se.current[e]?.();const o=ie.current[e];se.current[e]=o?d(o,()=>ue()):null}ue()},[ue]);u(()=>{const e=se.current;return de(),()=>{for(const o of g)e[o]?.(),e[o]=null}},[de]);const fe=l.useCallback((e,o)=>{ie.current[e]=o,de()},[de]),ce=l.useMemo(()=>({present:!0,register:fe,collapseBelow:L,open:ne,setOpen:te,scroll:$,locale:D}),[fe,L,ne,te,$,D]),pe="content"===$,me=r(S,X?.size),he=v("viewport"===z||"auto"===z?void 0:z),ve=void 0!==he?"":"auto"===z?pe?"h-full":"min-h-full":pe?"h-dvh":"min-h-dvh",xe=m(S)?e(s.Provider,{value:"header",children:S}):null,ye=m(C)?e(s.Provider,{value:"footer",children:C}):null;return e(a.Provider,{value:ce,children:o("div",{ref:ae,className:p("relative flex w-full flex-col",pe?"overflow-hidden":"",ve,"full"===N?"[padding-top:var(--n-layout-header-inset,var(--n-layout-header-floor,0px))]":"","full"===O?"[padding-bottom:var(--n-layout-footer-inset,0px)]":"",G),style:{...void 0===me?void 0:{"--n-layout-header-floor":me},...void 0===he?void 0:pe?{height:he}:{minHeight:he},...J},...Q,children:[_&&Y?e("a",{href:`#${q}`,className:p("absolute start-3 top-3 z-50 size-px overflow-hidden whitespace-nowrap","[clip-path:inset(50%)] focus:size-auto focus:overflow-visible focus:[clip-path:none]","focus:rounded-(--neba-radius-md) focus:bg-(--n-fill) focus:px-4 focus:py-2","focus:font-medium focus:text-(--n-on-solid) focus:no-underline","focus:[box-shadow:var(--neba-shadow-2),var(--neba-plate-solid)]","focus:[outline:2px_solid_var(--n-ring)] focus:outline-offset-2"),style:c(F,2,"solid"),children:T??U.skipToContent}):null,"full"===N?xe:null,o("div",{className:p("flex w-full flex-1",pe?"min-h-0":""),children:[m(P)?e(i.Provider,{value:"start",children:P}):null,o("div",{className:p("flex min-w-0 flex-1 flex-col",pe?"min-h-0":"","content"===N?"[padding-top:var(--n-layout-header-inset,var(--n-layout-header-floor,0px))]":"","content"===O?"[padding-bottom:var(--n-layout-footer-inset,0px)]":""),children:["content"===N?xe:null,Y?e("main",{tabIndex:-1,...A,id:q,className:p("min-w-0 flex-1",h,pe?"min-h-0 overflow-y-auto":"",A?.className),children:K}):e("div",{...A,className:p("min-w-0 flex-1",pe?"min-h-0 overflow-y-auto":"",A?.className),children:K}),"content"===O?ye:null]}),m(k)?e(i.Provider,{value:"end",children:k}):null]}),"full"===O?ye:null]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{safeHref as n}from"../../internal/link.js";import{Button as r}from"../button/Button.js";import{fillMessage as l,paginationMessages as i,useMessages as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{safeHref as n}from"../../internal/link.js";import{Button as r}from"../button/Button.js";import{fillMessage as l,paginationMessages as i,useMessages as s}from"../../internal/i18n.js";import{ChevronIcon as o}from"../../internal/icons.js";import{controlTextClasses as m,cx as c,gapClasses as u,srOnlyClasses as d}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";function f(e,t){return Array.from({length:Math.max(0,t-e+1)},(t,a)=>e+a)}function DoubleChevronIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"m7.5 4.5 3.5 3.5-3.5 3.5M3.5 4.5 7 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const p={xs:"h-5.5 min-w-5.5",sm:"h-6.5 min-w-6.5",md:"h-8 min-w-8",lg:"h-10 min-w-10",xl:"h-12 min-w-12"};export const Pagination=/*@__PURE__*/a.forwardRef(function Pagination(x,b){const{variant:g="text",size:v="md",color:y="primary",density:M="compact",elevation:j=0,count:w,page:C,defaultPage:N=1,onPageChange:k,siblingCount:L=1,boundaryCount:D=1,showEdges:I=!1,showArrows:P=!0,disabled:z=!1,getPageHref:K,locale:S,label:$,pageLabel:A,previousLabel:B,nextLabel:W,firstLabel:E,lastLabel:H,className:R,children:q,...F}=h(x,["size","density","variant","locale"]),G=s(i,S),J=A??(e=>l(G.page,{page:String(e)})),[O,Q]=a.useState(N),T=Math.min(Math.max(C??O,1),Math.max(w,1));if(w<2)return null;const U=function(e,t,a,n){const r=f(1,Math.min(n,e)),l=f(Math.max(e-n+1,n+1),e),i=Math.max(Math.min(t-a,e-n-2*a-1),n+2),s=Math.min(Math.max(t+a,n+2*a+2),l.length>0?l[0]-2:e-1);return[...r,...i>n+2?["start-ellipsis"]:n+1<e-n?[n+1]:[],...f(i,s),...s<e-n-1?["end-ellipsis"]:e-n>n?[e-n]:[],...l]}(w,T,L,D),V=T<=1,X=T>=w,Y=(t,a,r)=>!K||z?null:a?{render:e("a",{role:"link","aria-disabled":"true",tabIndex:0})}:{render:e("a",{href:n(K(t)),rel:r})},Z=(e,t)=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||K&&!k||(e.preventDefault(),(e=>{const t=Math.min(Math.max(e,1),w);t!==T&&(void 0===C&&Q(t),k?.(t))})(t))},_=(t,a,n,l,i,s,o)=>e("li",{className:"flex",children:e(r,{variant:g,size:v,color:y,density:M,elevation:j,disabled:z||l,focusableWhenDisabled:!z,"aria-label":a,startIcon:e("span",{className:`flex items-center ${i}`,children:s}),onClick:e=>Z(e,n),...Y(n,l,o)})},t);return t("nav",{ref:b,"aria-label":$??G.label,className:c("flex items-center",R??""),...F,children:[t("ul",{role:"list",className:`m-0 flex list-none items-center p-0 ${u[v]}`,children:[I?_("first",E??G.first,1,V,"rotate-180 rtl:rotate-0",e(DoubleChevronIcon,{})):null,P?_("previous",B??G.previous,T-1,V,"rotate-90 rtl:-rotate-90",e(o,{}),"prev"):null,U.map((t,a)=>e("li","number"==typeof t?{className:"flex",children:e(r,{variant:t===T?"solid":g,size:v,color:y,density:M,elevation:j,disabled:z,"aria-label":J(t),"aria-current":t===T?"page":void 0,className:"tabular-nums",onClick:e=>Z(e,t),...Y(t,t===T),children:t})}:{"aria-hidden":"true",className:"flex select-none items-center justify-center text-(--neba-muted-fg) "+m[v]+" "+p[v],children:"…"},`slot-${a}`)),P?_("next",W??G.next,T+1,X,"-rotate-90 rtl:rotate-90",e(o,{}),"next"):null,I?_("last",H??G.last,w,X,"rtl:rotate-180",e(DoubleChevronIcon,{})):null]}),e("span",{className:d,"aria-live":"polite",children:l(G.status,{page:String(T),total:String(w)})}),q]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{useMergedRef as r}from"../../internal/refs.js";import{beginPointerDrag as o,drawnScale as i}from"../../internal/drag.js";import{useLayoutEffectOnClient as a}from"../../internal/layout-effect.js";import{observeResize as l}from"../../internal/observe.js";import{cx as s,lengthUnit as c,toPixels as u,transitionClasses as f}from"../../internal/styles.js";import{useStyleDefaults as m}from"../../internal/defaults.js";import{panesMessages as d,useMessages as p}from"../../internal/i18n.js";const h="1 1 0%",g=/*@__PURE__*/t.createContext({flex:h}),x={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},v={xs:4,sm:6,md:8,lg:10,xl:12};function b(e,n,t){if(null!=e)return"number"==typeof e?n*e/100:u(e,{percentOf:n,relativeTo:t})}function z(e,n,t){const r=e.map(e=>b(e.defaultSize,n,t)),o=r.reduce((e,n)=>e+(n??0),0),i=r.filter(e=>void 0===e).length,a=i>0?Math.max(0,n-o)/i:0,l=r.map(e=>Math.max(0,e??a)),s=l.reduce((e,n)=>e+n,0);return s<=0?l.map(()=>1/Math.max(1,l.length)):l.map(e=>e/s)}function y(e,n){return`calc((100% - ${n}px) * ${e.toFixed(6)})`}function w(e){if("string"!=typeof e)return!1;const n=c(e);return void 0!==n&&"%"!==n}function S(e,n){if(w(e))return`0 1 ${e}`;const t="number"==typeof e?e/100:"string"==typeof e?u(e,{percentOf:1}):void 0;return void 0===t?h:`0 1 ${y(Math.max(0,t),n)}`}export const Panes=/*@__PURE__*/t.forwardRef(function Panes(c,u){const{orientation:h="horizontal",resizable:$=!0,color:j="primary",size:M="md",onResize:R,onResizeEnd:A,handleLabel:E,locale:N,className:P,style:k,children:C,...D}=m(c,["size","locale"]),I=t.Children.toArray(C).filter(t.isValidElement),L=I.length,T=p(d,N),F=t.useId(),H=e=>I[e]?.props.id??`${F}-pane-${e}`,O=t.useRef(null),W=r(O,u),X=I.map(e=>e.props),Y=t.useRef([]);Y.current=X;const _="horizontal"===h,K=v[M]*Math.max(0,L-1),[U,V]=t.useState(null),q=(U&&U.length===L?U:null)??(X.some(e=>w(e.defaultSize))?null:z(X,100,null)),B=t.useRef(null);function G(e){const n=O.current,t=B.current;if(!$||!n||!t||void 0===t[e+1])return null;const r=(_?n.offsetWidth:n.offsetHeight)-K;if(r<=0)return null;const o=Y.current[e],i=Y.current[e+1],a=t[e]*r,l=a+t[e+1]*r,s=Math.max(b(o?.minSize,r,n)??0,l-(b(i?.maxSize,r,n)??l)),c=Math.min(b(o?.maxSize,r,n)??l,l-(b(i?.minSize,r,n)??0));return c<s?null:{root:n,current:t,extent:r,start:a,pair:l,resize(n){const o=Math.min(c,Math.max(s,a+n)),i=[...t];return i[e]=o/r,i[e+1]=(l-o)/r,V(i),R?.(i.map(e=>100*e)),i}}}t.useEffect(()=>{B.current=q}),a(()=>{const e=O.current;if(!e)return;const n=()=>{const n=(_?e.offsetWidth:e.offsetHeight)-K;n<=0||V(t=>t&&t.length===L?t:z(Y.current,n,e))};return n(),l(e,n)},[L,_,K]);const J=t.useRef(null);t.useEffect(()=>()=>J.current?.(),[]);const Q=s("group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",x[M],f,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0",$?s(_?"cursor-col-resize":"cursor-row-resize","neba-hit","touch-none","hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)"):"");return e("div",{ref:W,className:s("flex h-full w-full",_?"flex-row":"flex-col","min-h-0 min-w-0",P),style:{"--n-accent":`var(--neba-${j}-accent)`,"--n-soft":`var(--neba-${j}-soft)`,"--n-ring":`var(--neba-${j}-ring)`,...k},...D,children:I.map((r,a)=>n(t.Fragment,{children:[a>0?e("div",{role:"separator","aria-label":"function"==typeof E?E(a-1):E??T.handle,"aria-controls":`${H(a-1)} ${H(a)}`,"aria-orientation":_?"vertical":"horizontal","aria-valuenow":q?Math.round(100*q[a-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!$||void 0,tabIndex:$?0:-1,className:Q,onPointerDown:e=>{0===e.button&&function(e,n){const t=G(e);if(!t)return;const r=n.currentTarget,a=_?n.clientX:n.clientY,l=_&&"rtl"===getComputedStyle(t.root).direction?-1:1,s=i(t.root)[_?"x":"y"];let c=t.current;J.current=o({target:r,pointerId:n.pointerId,onMove:e=>{const n=_?e.clientX:e.clientY;c=t.resize((n-a)/s*l)},onEnd:()=>{J.current=null,A?.(c.map(e=>100*e))}})}(a-1,e)},onKeyDown:e=>{const n=_&&"rtl"===getComputedStyle(e.currentTarget).direction,t=_?n?"ArrowRight":"ArrowLeft":"ArrowUp",r=_?n?"ArrowLeft":"ArrowRight":"ArrowDown";e.key!==t&&e.key!==r||(e.preventDefault(),function(e,n){const t=G(e);if(!t)return;const r=t.resize(n);A?.(r.map(e=>100*e))}(a-1,e.key===r?16:-16))},children:e("span",{"aria-hidden":"true",className:s("pointer-events-none bg-(--neba-border)",f,_?"h-full w-px":"h-px w-full",$?"group-hover/handle:bg-(--n-accent) group-focus-visible/handle:bg-(--n-accent) group-data-[dragging]/handle:bg-(--n-accent)":"")})}):null,e(g.Provider,{value:{flex:q?`0 0 ${y(q[a],K)}`:S(r.props.defaultSize,K)},children:void 0===r.props.id?t.cloneElement(r,{id:H(a)}):r})]},r.key??a))})});export const Pane=/*@__PURE__*/t.forwardRef(function Pane({defaultSize:n,minSize:r,maxSize:o,className:i,style:a,children:l,...c},u){const{flex:f}=t.useContext(g);return e("div",{ref:u,className:s("relative min-h-0 min-w-0 overflow-auto",i),style:{flex:f,...a},...c,children:l})});
|