neba 1.17.1 → 1.18.1
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/a2ui/index.d.ts +2 -0
- package/dist/a2ui/schema.d.ts +11 -1
- package/dist/a2ui/schema.js +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/animate-counter/AnimateCounter.d.ts +6 -0
- package/dist/components/animate-counter/AnimateCounter.js +1 -1
- package/dist/components/animate-headline/AnimateHeadline.js +1 -1
- package/dist/components/animate-scramble/AnimateScramble.d.ts +9 -3
- package/dist/components/animate-scramble/AnimateScramble.js +1 -1
- package/dist/components/animate-split/AnimateSplit.d.ts +7 -1
- package/dist/components/animate-split/AnimateSplit.js +1 -1
- package/dist/components/animate-typing/AnimateTyping.d.ts +6 -0
- 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/breadcrumb/Breadcrumb.d.ts +16 -0
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/card/Card.js +1 -1
- package/dist/components/carousel/Carousel.d.ts +3 -2
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.d.ts +6 -0
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/checkbox/Checkbox.js +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/code-block/CodeBlock.d.ts +2 -2
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/code-block/index.d.ts +2 -1
- package/dist/components/code-block/index.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/context-window/ContextWindow.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +13 -1
- package/dist/components/data-table/DataTable.js +1 -1
- 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/drawer/Drawer.d.ts +21 -0
- 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.d.ts +0 -8
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/file-picker/formatFileSize.d.ts +8 -0
- package/dist/components/file-picker/formatFileSize.js +1 -0
- package/dist/components/file-picker/index.d.ts +2 -1
- package/dist/components/file-picker/index.js +1 -1
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.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.d.ts +45 -3
- package/dist/components/gallery/Gallery.js +1 -1
- package/dist/components/gallery/GalleryViewer.js +1 -1
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/how-to-steps/HowToSteps.d.ts +14 -0
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/image/Image.d.ts +31 -6
- package/dist/components/image/Image.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.d.ts +17 -0
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/page-layout/PageLayout.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/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 -22
- package/dist/components/provider/NebaProvider.js +1 -1
- package/dist/components/provider/colorSchemeScript.d.ts +23 -0
- package/dist/components/provider/colorSchemeScript.js +1 -0
- package/dist/components/provider/index.d.ts +2 -1
- package/dist/components/provider/index.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/reasoning/Reasoning.d.ts +21 -0
- package/dist/components/reasoning/Reasoning.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.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.js +1 -1
- package/dist/components/sidebar/Sidebar.d.ts +13 -0
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/sources/Sources.d.ts +11 -0
- package/dist/components/sources/Sources.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 +22 -11
- package/dist/components/streaming-text/StreamingText.js +1 -1
- package/dist/components/tabs/Tabs.d.ts +12 -1
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/text-link/TextLink.d.ts +7 -0
- 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.js +1 -1
- package/dist/components/tool-call/ToolCall.d.ts +11 -0
- package/dist/components/tool-call/ToolCall.js +1 -1
- package/dist/components/tour/Tour.js +1 -1
- package/dist/components/tree-view/TreeView.d.ts +13 -1
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/typography/Typography.d.ts +7 -0
- package/dist/components/typography/Typography.js +1 -1
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/hooks/useElementSize.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/internal/animate.js +1 -1
- package/dist/internal/calendar.d.ts +2 -2
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +59 -2
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/checkbox-group.d.ts +29 -0
- package/dist/internal/checkbox-group.js +1 -0
- package/dist/internal/defaults.d.ts +14 -2
- package/dist/internal/format.d.ts +7 -0
- package/dist/internal/format.js +1 -1
- package/dist/internal/highlight.d.ts +9 -0
- package/dist/internal/highlight.js +1 -1
- package/dist/internal/layout-effect.d.ts +17 -0
- package/dist/internal/layout-effect.js +1 -0
- package/dist/internal/media.d.ts +20 -0
- package/dist/internal/media.js +1 -1
- package/dist/internal/menu.d.ts +5 -0
- package/dist/internal/observe.d.ts +4 -1
- package/dist/internal/observe.js +1 -1
- package/dist/internal/overrides.d.ts +55 -0
- package/dist/internal/overrides.js +1 -0
- package/dist/internal/page-layout.d.ts +26 -1
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/run.d.ts +6 -1
- package/dist/internal/run.js +1 -1
- package/dist/internal/sizer.d.ts +10 -0
- package/dist/internal/sizer.js +1 -1
- package/dist/internal/styles.d.ts +41 -3
- package/dist/internal/styles.js +1 -1
- package/dist/internal/text.d.ts +25 -3
- package/dist/internal/text.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +94 -73
- package/package.json +3 -3
|
@@ -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
|
|
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].join(" "),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",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"].join(" "),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{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 t,progressAriaText as s,progressFraction as n,progressSlots as o,thresholdColor as i}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export const Meter=/*@__PURE__*/l.forwardRef(function Meter(l,
|
|
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 t,progressAriaText as s,progressFraction as n,progressSlots as o,thresholdColor as i}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";import{useIntlLocale as d}from"../../internal/media.js";export const Meter=/*@__PURE__*/l.forwardRef(function Meter(l,b){const{value:h,min:p=0,max:x=100,label:v,showValue:j=!1,format:g,locale:w,thresholds:y,thickness:N,size:k="md",color:M="primary",className:_,style:V,...$}=f(l,["size","locale"]),z=d(w),R=n(h,p,x),T=i(h,M,y),A=void 0!==g;return a(r.Root,{ref:b,value:h,min:p,max:x,format:g,locale:z,getAriaValueText:s(R,A),className:m("flex w-full flex-col",c[k],_??""),style:{...o(T),...V},...$,children:[v||j?a("div",{className:["flex items-baseline gap-2",v?"justify-between":"justify-end",u[k]].join(" "),children:[v?e(r.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:v}):null,j?e(r.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>A?e:`${Math.round(100*(R??0))}%`}):null]}):null,e(r.Track,{className:`relative w-full overflow-hidden rounded-full bg-(--n-soft) ${t[k]}`,style:void 0===N?void 0:{height:`${N}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{ScreenContext as n}from"../../internal/screen.js";import{useRender as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as r from"react";import{useLayoutEffectOnClient as a}from"../../internal/layout-effect.js";import{ScreenContext as n}from"../../internal/screen.js";import{useRender as o}from"@base-ui/react/use-render";import{transitionProps as s}from"../../internal/animate.js";import{MockupCutout as h,defaultNotch as l,elevationFilters as d,finishSlots as c,mockupChrome as u,mockupMetrics as m,resolveOs as f,shellClasses as p}from"../../internal/mockup.js";import{observeResize as g}from"../../internal/observe.js";import{cx as b,surfaceSlots as v}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";export const Mockup=/*@__PURE__*/r.forwardRef(function Mockup(y,x){const{device:k,os:N,hardware:j="monitor",size:M="md",resolution:R,orientation:$="portrait",bezel:z="standard",finish:W="graphite",notch:H,systemUi:P=!0,scroll:S=!1,wallpaper:B,time:C="9:41",width:F,height:I,color:L="primary",elevation:T=0,transition:U,render:q,className:A,style:D,children:E,...G}=w(y,["size"]),J=f(k,N),K=H??l(k,J),O="desktop"!==k&&"landscape"===$,Q=m({device:k,size:M,resolution:R,orientation:$,bezel:z,hardware:j}),{screen:V,frame:X,body:Y,stand:Z,base:_}=Q,ee=r.useRef(null),[te,ie]=r.useState(null),re="number"==typeof F?"number"==typeof I?Math.min(F/X.width,I/X.height):F/X.width:"number"==typeof I&&void 0===F?I/X.height:null,ae=te??re;a(()=>{const e=ee.current;if(!e)return;const t=()=>{const t=e.offsetWidth,i=e.offsetHeight;if(t<=0||i<=0)return;const r=Math.min(t/X.width,i/X.height);ie(e=>null!==e&&Math.abs(e-r)<1e-4?e:r)};return t(),g(e,t)},[X.width,X.height]);const ne=r.useCallback(e=>{ee.current=e,"function"==typeof x?x(e):x&&(x.current=e)},[x]),oe=P?u({os:J,notch:K,landscape:O,time:C}):{},se=s(U),he="none"===z,le=t("div",{className:"neba-mockup-screen relative flex flex-col overflow-hidden",style:{width:V.width,height:V.height,borderRadius:Q.screenRadius,background:B??"var(--neba-surface)",boxShadow:he?void 0:"inset 0 0 0 1px var(--n-shell-shade)"},children:[oe.top?.node,t("div",{className:"flex min-h-0 flex-1",children:[oe.start?.node,e("div",{className:"min-w-0 flex-1 "+(S?"overflow-auto":"overflow-hidden"),style:{containerType:"size",containerName:"neba-screen"},children:e(n.Provider,{value:!0,children:E})})]}),oe.bottom?.node,e(h,{notch:K,screen:V,landscape:O})]}),de=b("neba-mockup relative block overflow-hidden",se.className,A??"");return o({render:q,ref:ne,props:{className:de,style:{...v(L,T),...c[W],...se.style,width:F??(void 0===I?"100%":"auto"),height:I??"auto",aspectRatio:`${X.width} / ${X.height}`,filter:d[T],...D},children:t("div",{className:"absolute top-1/2 left-1/2 flex flex-col items-center",style:{width:X.width,height:X.height,transform:`translate(-50%, -50%) scale(${ae??1})`,visibility:null===ae?"hidden":void 0},children:[e("div",{className:he?"":p,style:{width:Y.width,height:Y.height,borderRadius:Q.frameRadius,paddingBlock:`${Q.bezel.top}px ${Q.bezel.bottom}px`,paddingInline:Q.bezel.x},children:le}),Z?t(i,{children:[e("div",{"aria-hidden":"true",style:{width:Z.neckWidth,height:Z.neckHeight,background:"var(--n-shell-shade)",clipPath:"polygon(16% 0, 84% 0, 100% 100%, 0 100%)"}}),e("div",{"aria-hidden":"true",className:p,style:{width:Z.footWidth,height:Z.footHeight,borderRadius:Z.footHeight/2}})]}):null,_?e("div",{"aria-hidden":"true",className:`relative ${p}`,style:{width:_.width,height:_.height,borderRadius:`0 0 ${Math.round(.55*_.height)}px ${Math.round(.55*_.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:_.lipWidth,height:Math.round(.34*_.height),marginLeft:-_.lipWidth/2,borderRadius:`0 0 ${Math.round(.2*_.height)}px ${Math.round(.2*_.height)}px`,background:"var(--n-shell-shade)"}})}):null]}),...G}})});
|
|
@@ -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
|
|
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].join(" "),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)"].join(" ");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 +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{
|
|
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 f,cx as c,hasContent as p,insetRingClasses as m,toLength as h}from"../../internal/styles.js";import{DefaultsContext as v,useStyleDefaults as y}from"../../internal/defaults.js";import{ScreenContext as x}from"../../internal/screen.js";const b=["header","footer"];export const PageLayout=/*@__PURE__*/l.forwardRef(function PageLayout(w,g){const{header:P,footer:C,sidebar:S,endSidebar:j,headerSpan:k="full",footerSpan:N="full",scroll:O="page",height:$="viewport",collapseBelow:z="md",sidebarOpen:L,defaultSidebarOpen:R=!1,onSidebarOpenChange:B,endSidebarOpen:E,defaultEndSidebarOpen:H=!1,onEndSidebarOpenChange:I,skipLink:M=!0,skipLabel:_,main:T,mainId:q="main",mainProps:A,locale:D,color:F="primary",className:G,style:J,children:K,...Q}=y(w,["locale"]),U=t(n,D),V=l.useContext(x),W=l.useContext(v),X=T??!V,[Y,Z]=l.useState(R),[ee,oe]=l.useState(H),le=l.useMemo(()=>({start:L??Y,end:E??ee}),[L,Y,E,ee]),ne=l.useCallback((e,o)=>{if("start"===e)return void 0===L&&Z(o),void B?.(o);void 0===E&&oe(o),I?.(o)},[L,E,B,I]),te=l.useRef(null),re=l.useCallback(e=>{te.current=e,"function"==typeof g?g(e):g&&(g.current=e)},[g]),ae=l.useRef({header:null,footer:null}),ie=l.useRef({header:null,footer:null}),se=l.useCallback(()=>{const e=te.current;if(e)for(const o of b){const l=ae.current[o],n="header"===o?k:N;if(!l){e.style.setProperty(`--n-layout-${o}`,"0px"),e.style.setProperty(`--n-layout-${o}-inset`,"0px");continue}const t=getComputedStyle(l).position,r=`${l.offsetHeight}px`,a="sticky"===t||"fixed"===t;e.style.setProperty(`--n-layout-${o}`,a&&"full"===n?r:"0px"),e.style.setProperty(`--n-layout-${o}-inset`,"fixed"===t?r:"0px")}},[k,N]),ue=l.useCallback(()=>{for(const e of b){ie.current[e]?.();const o=ae.current[e];ie.current[e]=o?d(o,()=>se()):null}se()},[se]);u(()=>{const e=ie.current;return ue(),()=>{for(const o of b)e[o]?.(),e[o]=null}},[ue]);const de=l.useCallback((e,o)=>{ae.current[e]=o,ue()},[ue]),fe=l.useMemo(()=>({present:!0,register:de,collapseBelow:z,open:le,setOpen:ne,scroll:O,locale:D}),[de,z,le,ne,O,D]),ce="content"===O,pe=r(P,W?.size),me=h("viewport"===$||"auto"===$?void 0:$),he=void 0!==me?"":"auto"===$?ce?"h-full":"min-h-full":ce?"h-dvh":"min-h-dvh",ve=p(P)?e(s.Provider,{value:"header",children:P}):null,ye=p(C)?e(s.Provider,{value:"footer",children:C}):null;return e(a.Provider,{value:fe,children:o("div",{ref:re,className:c("relative flex w-full flex-col",ce?"overflow-hidden":"",he,"full"===k?"[padding-top:var(--n-layout-header-inset,var(--n-layout-header-floor,0px))]":"","full"===N?"[padding-bottom:var(--n-layout-footer-inset,0px)]":"",G),style:{...void 0===pe?void 0:{"--n-layout-header-floor":pe},...void 0===me?void 0:ce?{height:me}:{minHeight:me},...J},...Q,children:[M&&X?e("a",{href:`#${q}`,className:c("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:f(F,2,"solid"),children:_??U.skipToContent}):null,"full"===k?ve:null,o("div",{className:c("flex w-full flex-1",ce?"min-h-0":""),children:[p(S)?e(i.Provider,{value:"start",children:S}):null,o("div",{className:c("flex min-w-0 flex-1 flex-col",ce?"min-h-0":"","content"===k?"[padding-top:var(--n-layout-header-inset,var(--n-layout-header-floor,0px))]":"","content"===N?"[padding-bottom:var(--n-layout-footer-inset,0px)]":""),children:["content"===k?ve:null,X?e("main",{tabIndex:-1,...A,id:q,className:c("min-w-0 flex-1",m,ce?"min-h-0 overflow-y-auto":"",A?.className),children:K}):e("div",{...A,className:c("min-w-0 flex-1",ce?"min-h-0 overflow-y-auto":"",A?.className),children:K}),"content"===N?ye:null]}),p(j)?e(i.Provider,{value:"end",children:j}):null]}),"full"===N?ye:null]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{beginPointerDrag as r,drawnScale as o}from"../../internal/drag.js";import{useLayoutEffectOnClient as i}from"../../internal/layout-effect.js";import{observeResize as a}from"../../internal/observe.js";import{cx as l,toPixels as s,transitionClasses as c}from"../../internal/styles.js";import{useStyleDefaults as u}from"../../internal/defaults.js";import{panesMessages as f,useMessages as m}from"../../internal/i18n.js";const d="1 1 0%",p=/*@__PURE__*/n.createContext({flex:d}),h={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},g={xs:4,sm:6,md:8,lg:10,xl:12};function x(e,t,n){if(null!=e)return"number"==typeof e?t*e/100:s(e,{percentOf:t,relativeTo:n})}function v(e,t,n){const r=e.map(e=>x(e.defaultSize,t,n)),o=r.reduce((e,t)=>e+(t??0),0),i=r.filter(e=>void 0===e).length,a=i>0?Math.max(0,t-o)/i:0,l=r.map(e=>Math.max(0,e??a)),s=l.reduce((e,t)=>e+t,0);return s<=0?l.map(()=>1/Math.max(1,l.length)):l.map(e=>e/s)}function b(e,t){return`calc((100% - ${t}px) * ${e.toFixed(6)})`}function z(e){return"string"==typeof e&&!/%\s*$/.test(e)&&void 0!==s(e,{percentOf:0,relativeTo:null})}function y(e,t){if(z(e))return`0 1 ${e}`;const n="number"==typeof e?e/100:"string"==typeof e?s(e,{percentOf:1}):void 0;return void 0===n?d:`0 1 ${b(Math.max(0,n),t)}`}export const Panes=/*@__PURE__*/n.forwardRef(function Panes(s,d){const{orientation:w="horizontal",resizable:S=!0,color:$="primary",size:M="md",onResize:j,onResizeEnd:R,handleLabel:A,locale:k,className:C,style:E,children:N,...P}=u(s,["size","locale"]),D=n.Children.toArray(N).filter(n.isValidElement),I=D.length,T=m(f,k),L=n.useId(),O=e=>D[e]?.props.id??`${L}-pane-${e}`,F=n.useRef(null),H=n.useCallback(e=>{F.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),W=D.map(e=>e.props),X=n.useRef([]);X.current=W;const Y="horizontal"===w,_=g[M]*Math.max(0,I-1),[K,U]=n.useState(null),V=(K&&K.length===I?K:null)??(W.some(e=>z(e.defaultSize))?null:v(W,100,null)),q=n.useRef(null);function B(e){const t=F.current,n=q.current;if(!S||!t||!n||void 0===n[e+1])return null;const r=(Y?t.offsetWidth:t.offsetHeight)-_;if(r<=0)return null;const o=X.current[e],i=X.current[e+1],a=n[e]*r,l=a+n[e+1]*r,s=Math.max(x(o?.minSize,r,t)??0,l-(x(i?.maxSize,r,t)??l)),c=Math.min(x(o?.maxSize,r,t)??l,l-(x(i?.minSize,r,t)??0));return c<s?null:{root:t,current:n,extent:r,start:a,pair:l,resize(t){const o=Math.min(c,Math.max(s,a+t)),i=[...n];return i[e]=o/r,i[e+1]=(l-o)/r,U(i),j?.(i.map(e=>100*e)),i}}}n.useEffect(()=>{q.current=V}),i(()=>{const e=F.current;if(!e)return;const t=()=>{const t=(Y?e.offsetWidth:e.offsetHeight)-_;t<=0||U(n=>n&&n.length===I?n:v(X.current,t,e))};return t(),a(e,t)},[I,Y,_]);const G=n.useRef(null);n.useEffect(()=>()=>G.current?.(),[]);const J=l("group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",h[M],c,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0",S?l(Y?"cursor-col-resize":"cursor-row-resize","neba-hit","touch-none","hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)"):"");return e("div",{ref:H,className:l("flex h-full w-full",Y?"flex-row":"flex-col","min-h-0 min-w-0",C),style:{"--n-accent":`var(--neba-${$}-accent)`,"--n-soft":`var(--neba-${$}-soft)`,"--n-ring":`var(--neba-${$}-ring)`,...E},...P,children:D.map((i,a)=>t(n.Fragment,{children:[a>0?e("div",{role:"separator","aria-label":"function"==typeof A?A(a-1):A??T.handle,"aria-controls":`${O(a-1)} ${O(a)}`,"aria-orientation":Y?"vertical":"horizontal","aria-valuenow":V?Math.round(100*V[a-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!S||void 0,tabIndex:S?0:-1,className:J,onPointerDown:e=>{0===e.button&&function(e,t){const n=B(e);if(!n)return;const i=t.currentTarget,a=Y?t.clientX:t.clientY,l=Y&&"rtl"===getComputedStyle(n.root).direction?-1:1,s=o(n.root)[Y?"x":"y"];let c=n.current;G.current=r({target:i,pointerId:t.pointerId,onMove:e=>{const t=Y?e.clientX:e.clientY;c=n.resize((t-a)/s*l)},onEnd:()=>{G.current=null,R?.(c.map(e=>100*e))}})}(a-1,e)},onKeyDown:e=>{const t=Y&&"rtl"===getComputedStyle(e.currentTarget).direction,n=Y?t?"ArrowRight":"ArrowLeft":"ArrowUp",r=Y?t?"ArrowLeft":"ArrowRight":"ArrowDown";e.key!==n&&e.key!==r||(e.preventDefault(),function(e,t){const n=B(e);if(!n)return;const r=n.resize(t);R?.(r.map(e=>100*e))}(a-1,e.key===r?16:-16))},children:e("span",{"aria-hidden":"true",className:l("pointer-events-none bg-(--neba-border)",c,Y?"h-full w-px":"h-px w-full",S?"group-hover/handle:bg-(--n-accent) group-focus-visible/handle:bg-(--n-accent) group-data-[dragging]/handle:bg-(--n-accent)":"")})}):null,e(p.Provider,{value:{flex:V?`0 0 ${b(V[a],_)}`:y(i.props.defaultSize,_)},children:void 0===i.props.id?n.cloneElement(i,{id:O(a)}):i})]},i.key??a))})});export const Pane=/*@__PURE__*/n.forwardRef(function Pane({defaultSize:t,minSize:r,maxSize:o,className:i,style:a,children:s,...c},u){const{flex:f}=n.useContext(p);return e("div",{ref:u,className:l("relative min-h-0 min-w-0 overflow-auto",i),style:{flex:f,...a},...c,children:s})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{ChartDataTable as n,ChartExport as a,ChartLegendBar as i,ChartStatus as r,ChartSummary as o,ChartSurface as s,ChartTooltipPanel as u,markTransitionClasses as d,summarise as m,useMeasuredWidth as c,useReleaseOutside as h,useVisibility as f,chartHeight as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as t from"react";import{ChartDataTable as n,ChartExport as a,ChartLegendBar as i,ChartStatus as r,ChartSummary as o,ChartSurface as s,ChartTooltipPanel as u,markTransitionClasses as d,summarise as m,useMeasuredWidth as c,useReleaseOutside as h,useVisibility as f,chartHeight as p,useMeasuredHeight as v}from"../../internal/chart-frame.js";import{arcPath as x,categoryAt as g,chartFontSizes as b,compactNumber as y,formatCategory as M,inkOn as N,markGap as j,seriesColor as w,toValue as k,warnPaletteOverflow as E}from"../../internal/chart.js";import{numberFormatter as I}from"../../internal/format.js";import{cx as z,metaTextClasses as P}from"../../internal/styles.js";import{chartMessages as A,emptyMessages as $,useMessages as L}from"../../internal/i18n.js";import{useStyleDefaults as S}from"../../internal/defaults.js";import{useIntlLocale as B}from"../../internal/media.js";const C={pie:0,donut:.62,semi:.62};export function PieChart(R){const{data:D,categories:O,shape:_="pie",startAngle:F=0,hole:H,gap:K=j,center:T,valueLabels:V="none",height:W,format:q,locale:G,label:J,legend:Q,tooltip:U,empty:X,exportable:Y=!1,exportFileName:Z="chart.csv",onExport:ee,size:le="md",variant:te="text",padded:ne=!1,className:ae,...ie}=S(R,["size","variant","locale"]),re=t.useRef(null),oe=c(re),se=L($,G),ue=L(A,G),de=B(G),me=t.useId(),ce=t.useCallback(e=>q?I(de,q).format(e):y(e,de),[q,de]),he=t.useMemo(()=>D.map(k),[D]),fe=t.useMemo(()=>he.map((e,l)=>({name:M(g(l,O,[he]),de),data:[D[l]],color:e.color})),[he,O,D,de]),pe=f(fe);t.useEffect(()=>{E(fe.length)},[fe.length]);const[ve,xe]=t.useState(null);h(re,null!==ve,()=>xe(null));const ge=t.useId(),be=fe.map((e,l)=>w(e,l)),ye=he.reduce((e,l,t)=>pe.visible[t]&&null!==l.value?e+Math.max(0,l.value):e,0),Me="semi"===_,Ne=v(re,"string"==typeof W),je=p(W,le,Ne),we=b[le],ke=!1===Q?{interactive:!1}:!0===Q||void 0===Q?{}:Q,Ee=!1!==Q&&fe.length>1,Ie=ke.side??"bottom",ze=!1===U?{mode:"none"}:!0===U||void 0===U?{}:U,Pe="none"===ze.mode,Ae=oe/2,$e=Math.max(0,Math.min(oe/2,Me?je:je/2)-2),Le=Me?Math.min(je,je/2+$e/2):je/2,Se=$e*Math.min(.92,Math.max(0,H??C[_])),Be=ye<=0||$e<=0,Ce=$e>0?Math.min(15,Math.max(0,K)/$e*(180/Math.PI)):0,Re=Me?180:360,De=[];let Oe=Me?-90:F;he.forEach((e,l)=>{if(!pe.visible[l]||null===e.value||e.value<=0)return;const t=e.value/ye,n=t*Re;De.push({index:l,start:Oe,end:Oe+n,value:e.value,share:t}),Oe+=n});const _e=null===ve?[]:[{seriesIndex:ve,name:fe[ve]?.name,color:he[ve]?.color??be[ve],value:he[ve]?.value??null,formatted:`${ce(he[ve]?.value??0)} · ${Math.round(10*(Math.max(0,he[ve]?.value??0)/ye*100+Number.EPSILON))/10}%`,label:he[ve]?.label}];return l(s,{...ie,size:le,variant:te,padded:ne,className:ae,legendSide:Ie,legend:Ee?e(i,{series:fe,colors:be,options:ke,visibility:pe,size:le,values:ke.showValue?he.map(e=>null===e.value?void 0:ce(e.value)):void 0}):null,table:Be?null:e(n,{id:me,caption:J,categories:fe.map(e=>e.name??""),series:[{name:J,data:D}],values:[he],format:ce,locale:de}),children:[Y&&!Be?e(a,{rows:()=>[["",J??ue.label],...fe.map((e,l)=>[e.name??"",he[l]?.value??null])],fileName:Z,onExport:ee,label:ue.exportCsv}):null,l("div",{ref:re,role:"img",tabIndex:Be?void 0:0,"aria-label":J??ue.label,"aria-describedby":Be?void 0:ge,onPointerLeave:e=>{"touch"!==e.pointerType&&xe(null)},onBlur:()=>xe(null),onKeyDown:e=>{const l=De.map(e=>e.index);if("Escape"===e.key){if(null===ve)return;xe(null)}else{if(Pe||0===l.length)return;if("Home"===e.key)xe(l[0]);else if("End"===e.key)xe(l[l.length-1]);else{if("ArrowRight"!==e.key&&"ArrowLeft"!==e.key)return;{const t=null===ve?-1:l.indexOf(ve),n="ArrowRight"===e.key?t+1:t-1;xe(l[(n+l.length)%l.length])}}}e.preventDefault()},className:z("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:"string"==typeof W?W:je},children:[Be?e("div",{className:z("flex h-full items-center justify-center text-(--neba-muted-fg)",P[le]),children:X??se.title}):oe>0?l("svg",{width:oe,height:je,viewBox:`0 0 ${oe} ${je}`,"aria-hidden":"true",className:"block",children:[De.map(l=>{const t=null!==pe.hovered&&pe.hovered!==l.index||null!==ve&&ve!==l.index,n=De.length>1&&l.end-l.start>2*Ce?Ce/2:0;return e("path",{d:x(Ae,Le,$e,Se,l.start+n,l.end-n),fill:he[l.index].color??be[l.index],opacity:t?.32:1,onPointerEnter:Pe?void 0:()=>xe(l.index),className:d},l.index)}),"all"===V?De.map(l=>{const t=((l.start+l.end)/2-90)*(Math.PI/180),n=Se>0?(Se+$e)/2:.68*$e,a=`${Math.round(100*l.share)}%`;return(l.end-l.start)*(Math.PI/180)*n<2*we||$e-Se<1.6*we?null:e("text",{x:Ae+n*Math.cos(t),y:Le+n*Math.sin(t),textAnchor:"middle",dominantBaseline:"central",fontSize:we,fontWeight:600,fill:N(he[l.index].color,l.index),className:"tabular-nums",children:a},l.index)}):null]}):null,T&&Se>0?e("div",{className:"pointer-events-none absolute flex flex-col items-center justify-center text-center",style:{left:Ae-Se,top:Le-Se,width:2*Se,height:Me?Se:2*Se},children:T}):null,null===ve||Pe?null:ze.render?e("div",{className:"pointer-events-none absolute top-0 left-1/2 z-10",children:ze.render({index:ve,category:fe[ve]?.name??ve,items:_e})}):e(u,{heading:fe[ve]?.name,items:_e,x:Ae,y:8,flip:!1,size:le})]}),Be?null:e(o,{id:ge,template:ue.summary,locale:de,...m(he.filter((e,l)=>pe.visible[l]).map(e=>[e]),ce)}),Pe?null:e(r,{heading:null===ve?void 0:fe[ve]?.name,items:_e})]})}
|
|
@@ -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{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as o from"react";import{useLayoutEffectOnClient as i}from"../../internal/layout-effect.js";import{trackPointer as l}from"../../internal/glow.js";import{observeResize as s}from"../../internal/observe.js";import{controlSlots as r,controlTextClasses as a,cx as c,gapClasses as m,hasContent as d,iconClasses as f,iconSizeClasses as x,insetRingClasses as p,metaTextClasses as u,paddingXClasses as h,pressTransitionClasses as v,sheetBodyClasses as b,surfaceClasses as g,transitionClasses as w}from"../../internal/styles.js";import{inertValue as j}from"../../internal/inert.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const _={solid:[g,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[g,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:`${g} text-(--n-on-tint) bg-(--n-soft)`},k={solid:"hover:bg-(--n-fill-hover) active:bg-(--n-fill-active)",outline:"hover:bg-(--n-panel-hover) active:bg-(--n-panel-press)",text:"hover:bg-(--n-soft) active:bg-(--n-soft-hover)"},z={xs:"min-h-5.5",sm:"min-h-6.5",md:"min-h-8",lg:"min-h-10",xl:"min-h-12"},N={xs:"rounded-[0.6875rem]",sm:"rounded-[0.8125rem]",md:"rounded-[1rem]",lg:"rounded-[1.25rem]",xl:"rounded-[1.5rem]"},$={default:{xs:"px-3",sm:"px-4",md:"px-5",lg:"px-6",xl:"px-8"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-4"}},I={static:{top:"",bottom:""},sticky:{top:"sticky top-3 z-20",bottom:"sticky bottom-3 z-20"},fixed:{top:"fixed inset-x-0 top-3 z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-3 z-30 mx-auto w-fit"}},P={static:{top:"",bottom:""},sticky:{top:"sticky top-[calc(0.75rem_+_env(safe-area-inset-top))] z-20",bottom:"sticky bottom-[calc(0.75rem_+_env(safe-area-inset-bottom))] z-20"},fixed:{top:"fixed inset-x-0 top-[calc(0.75rem_+_env(safe-area-inset-top))] z-30 mx-auto w-fit",bottom:"fixed inset-x-0 bottom-[calc(0.75rem_+_env(safe-area-inset-bottom))] z-30 mx-auto w-fit"}};export const Pill=/*@__PURE__*/o.forwardRef(function Pill(g,C){const{variant:H="solid",size:R="md",color:A="secondary",density:B="default",elevation:F=2,startIcon:M,endIcon:S,title:q,description:D,details:E,expanded:G=!1,position:J="static",side:K="top",safeArea:L=!0,className:O,style:Q,children:T,onClick:U,...V}=y(g,["size","density","variant"]),W=o.useRef(null),X=o.useId(),[Y,Z]=o.useState(null),ee=d(E);i(()=>{const e=W.current;if(e)return Z(e.scrollHeight),s(e,()=>Z(e.scrollHeight))},[ee]);const te=Boolean(U),ne=h[B][R],oe=t(n,{children:[d(M)?e("span",{className:`flex shrink-0 items-center justify-center overflow-hidden rounded-full [&_img]:size-full [&_img]:object-cover ${x[R]}`,children:M}):null,d(q)||d(D)||d(T)?t("span",{className:["flex min-w-0 flex-1 flex-col items-center justify-center text-center",$[B][R]].join(" "),children:[d(q)?e("span",{className:"max-w-full truncate",children:q}):null,d(D)?e("span",{className:`max-w-full truncate font-normal ${u[R]}`,children:D}):null,T]}):null]});return t("div",{ref:C,className:c("inline-flex max-w-full flex-col overflow-hidden align-middle",N[R],"font-medium whitespace-nowrap select-none",a[R],_[H],w,v,f,(L?P:I)[J][K],O??""),style:{...r(A,F,H),...Q},...V,children:[t("div",{className:["flex shrink-0 items-center py-1",z[R],m[R],te?"ps-0":ne,d(S)?"pe-1":te?"pe-0":""].join(" "),children:[te?e("button",{type:"button",className:["relative flex min-w-0 flex-1 cursor-pointer items-center justify-center self-stretch",N[R],m[R],ne,p,"neba-glow",k[H],w,v].join(" "),onPointerMove:l(void 0,!0),"aria-expanded":ee?G:void 0,"aria-controls":ee?X:void 0,onClick:U,children:oe}):oe,d(S)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:S}):null]}),ee?e("div",{id:X,className:["overflow-hidden","[transition:height_var(--neba-duration)_var(--neba-ease)]","motion-reduce:[transition-duration:0ms]"].join(" "),style:{height:G?Y??"auto":0},inert:j(!G),children:e("div",{ref:W,className:`whitespace-normal ${ne} pb-2 ${b[R]}`,children:E})}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Progress as s}from"@base-ui/react/progress";import{plateGapClasses as r,plateRadiusClasses as t,plateSizeClasses as n,progressAriaText as i,progressFraction as o,progressSlots as m,progressText as c}from"../../internal/progress.js";import{cx as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Progress as s}from"@base-ui/react/progress";import{plateGapClasses as r,plateRadiusClasses as t,plateSizeClasses as n,progressAriaText as i,progressFraction as o,progressSlots as m,progressText as c}from"../../internal/progress.js";import{cx as f,metaTextClasses as u,stackGapClasses as d}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";import{useIntlLocale as b}from"../../internal/media.js";export const ProgressBox=/*@__PURE__*/l.forwardRef(function ProgressBox(l,h){const{size:p="md",color:g="primary",count:v=4,value:j=null,min:y=0,max:w=100,label:N,showValue:M=!1,format:V,locale:k,className:z,style:A,...B}=x(l,["size","locale"]),P=b(k),R=o(j,y,w),T=null===R,$=void 0!==V,_=Number.isFinite(v)?Math.max(1,Math.floor(v)):1;return a(s.Root,{ref:h,value:T?null:j,min:y,max:w,format:V,locale:P,getAriaValueText:i(R,$),className:f("inline-flex flex-col",d[p],z??""),style:{...m(g),...A},...B,children:[N||M?a("div",{className:["flex items-baseline gap-2",N?"justify-between":"justify-end",u[p]].join(" "),children:[N?e(s.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:N}):null,M?e(s.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>c(R,e,$)}):null]}):null,e(s.Track,{className:`flex ${r[p]}`,children:Array.from({length:_},(a,l)=>e("span",{className:f("relative overflow-hidden bg-(--n-soft)","[box-shadow:var(--neba-plate-glass)]",n[p],t[p],T?"neba-plate-wave":""),style:T?{"--n-i":l}:void 0,children:T?null:e("span",{className:"absolute inset-y-0 start-0 bg-(--n-fill) [transition:width_var(--neba-duration-fill)_var(--neba-ease)]",style:{width:`${Math.min(100,Math.max(0,100*(R*_-l)))}%`}})},l))})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Progress as s}from"@base-ui/react/progress";import{progressAriaText as t,progressFraction as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Progress as s}from"@base-ui/react/progress";import{progressAriaText as t,progressFraction as n,progressSlots as i,progressText as l,ringDiameters as o,ringStrokes as c}from"../../internal/progress.js";import{cx as m,gapClasses as f,metaTextClasses as u}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";import{useIntlLocale as d}from"../../internal/media.js";export const ProgressCircular=/*@__PURE__*/a.forwardRef(function ProgressCircular(a,x){const{size:p="md",color:k="primary",value:g=null,min:b=0,max:v=100,label:j,showValue:y=!1,format:$,locale:N,thickness:w,className:M,style:P,...V}=h(a,["size","locale"]),z=d(N),C=n(g,b,v),D=null===C,L=void 0!==$,R=o[p],W=R/2,_=Math.min(Math.max(w??c[p],.5),W/2),A=W-_/2,B=2*Math.PI*A,I=D?`${.28*B} ${B}`:`${B}`,T=D?0:B*(1-C);return r(s.Root,{ref:x,value:D?null:g,min:b,max:v,format:$,locale:z,getAriaValueText:t(C,L),className:m("inline-flex items-center",f[p],u[p],M??""),style:{...i(k),...P},...V,children:[r("svg",{className:D?"neba-ring-spin shrink-0":"shrink-0",width:R,height:R,viewBox:`0 0 ${R} ${R}`,fill:"none","aria-hidden":"true",children:[e("circle",{cx:W,cy:W,r:A,stroke:"var(--n-soft)",strokeWidth:_}),e("circle",{cx:W,cy:W,r:A,stroke:"var(--n-accent)",strokeWidth:_,strokeLinecap:"round",strokeDasharray:I,strokeDashoffset:T,transform:`rotate(-90 ${W} ${W})`,className:"[transition:stroke-dashoffset_var(--neba-duration-fill)_var(--neba-ease)]"})]}),j?e(s.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:j}):null,y?e(s.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>l(C,e,L)}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Progress as r}from"@base-ui/react/progress";import{barThicknessClasses as s,progressAriaText as n,progressFraction as t,progressSlots as i,progressText as o}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export const ProgressLinear=/*@__PURE__*/a.forwardRef(function ProgressLinear(a,
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{Progress as r}from"@base-ui/react/progress";import{barThicknessClasses as s,progressAriaText as n,progressFraction as t,progressSlots as i,progressText as o}from"../../internal/progress.js";import{cx as m,metaTextClasses as u,stackGapClasses as c}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";import{useIntlLocale as d}from"../../internal/media.js";export const ProgressLinear=/*@__PURE__*/a.forwardRef(function ProgressLinear(a,p){const{size:b="md",color:g="primary",value:x=null,min:h=0,max:j=100,label:v,showValue:w=!1,format:y,locale:N,thickness:k,className:L,style:V,...z}=f(a,["size","locale"]),P=d(N),R=t(x,h,j),T=null===R,$=void 0!==y;return l(r.Root,{ref:p,value:T?null:x,min:h,max:j,format:y,locale:P,getAriaValueText:n(R,$),className:m("flex w-full flex-col",c[b],L??""),style:{...i(g),...V},...z,children:[v||w?l("div",{className:["flex items-baseline gap-2",v?"justify-between":"justify-end",u[b]].join(" "),children:[v?e(r.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:v}):null,w?e(r.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>o(R,e,$)}):null]}):null,e(r.Track,{className:`neba-progress-track relative w-full overflow-hidden rounded-full bg-(--n-soft) ${s[b]}`,style:void 0===k?void 0:{height:`${k}px`},children:e(r.Indicator,{className:["neba-progress-indicator absolute rounded-full bg-(--n-fill)",T?"neba-sweep":"top-0 [transition:width_var(--neba-duration-fill)_var(--neba-ease)]"].join(" ")})})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useLayoutEffectOnClient as r}from"../../internal/layout-effect.js";import{IconButton as l}from"../icon-button/IconButton.js";import{useDropZone as o}from"../../internal/drop.js";import{fieldLight as i,fieldSpotlightSlot as a,glowClasses as s}from"../../internal/glow.js";import{matchesShortcut as c}from"../../internal/keys.js";import{observeResize as m}from"../../internal/observe.js";import{promptMessages as d,useMessages as u}from"../../internal/i18n.js";import{controlTextLeadingClasses as f,cx as p,disabledClasses as h,fieldFocusTransitionClasses as g,fieldReadOnlyClasses as x,fieldRestClasses as v,fieldRingClasses as b,hasContent as w,iconClasses as y,metaTextClasses as j,paddingXClasses as $,radiusClasses as N,srOnlyClasses as k,surfaceSlots as I,transitionClasses as S}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";import{useFieldsetDisabled as D}from"../../internal/fieldset.js";function SendIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M8 13V3.5m0 0L3.75 7.75M8 3.5l4.25 4.25",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}function StopIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:e("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1.5"})})}const F={xs:`${N.sm} ${f.xs}`,sm:`${N.md} ${f.sm}`,md:`${N.lg} ${f.md}`,lg:`${N.xl} ${f.lg}`,xl:`${N.xl} ${f.xl}`},z={xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"};export const PromptInput=/*@__PURE__*/n.forwardRef(function PromptInput(f,N){const{variant:E="outline",size:K="md",color:M="primary",density:P="default",elevation:R=0,value:V,defaultValue:W="",onValueChange:A,onSubmit:B,submitting:L=!1,onStop:H,submitKey:O="Enter",onFiles:q,label:T,minRows:G=1,maxRows:J=8,start:Q,end:U,locale:X,labels:Y,classNames:Z,id:_,disabled:ee,readOnly:te=!1,onKeyDown:ne,className:re,style:le,children:oe,...ie}=C(f,["size","density","variant","locale"]),ae=D(ee),se=!ae&&!te,ce={...u(d,X),...Y},[me,de]=n.useState(W),ue=void 0!==V,fe=ue?V:me,{over:pe,handlers:he}=o(se?q:void 0),ge=n.useId(),xe=_??ge,ve=n.useRef(null),be=n.useCallback(e=>{ve.current=e,"function"==typeof N?N(e):N&&(N.current=e)},[N]),we=n.useCallback(()=>{const e=ve.current;e&&(e.style.height="auto",e.style.height=`${e.scrollHeight}px`)},[]);r(we,[we,fe,G,J]),n.useEffect(()=>{const e=ve.current;if(!e)return;let t=e.clientWidth,n=0;const r=m(e,()=>{e.clientWidth!==t&&(t=e.clientWidth,cancelAnimationFrame(n),n=requestAnimationFrame(we))});return()=>{r(),cancelAnimationFrame(n)}},[we]);const ye=()=>{!fe.trim()||ae||te||L||B?.(fe)},je=fe.trim().length>0&&!ae&&!te;return t("form",{onSubmit:e=>{e.preventDefault(),L?H?.():ye()},className:p("flex w-full flex-col",re??""),style:{...I(M,R),...se?a:void 0,...le},children:[w(T)?e("label",{htmlFor:xe,className:k,children:T}):null,t("div",{"data-dropping":pe||void 0,...he,...i(se),onPointerDown:e=>{e.target!==e.currentTarget||ae||(e.preventDefault(),ve.current?.focus())},className:p("relative flex w-full flex-col py-2","[-webkit-tap-highlight-color:transparent]",F[K],z[K],$[P][K],S,g,b,y,ae?h[E]:te?x[E]:`${v[E]} ${s}`,pe?"[border-color:var(--n-ring)] bg-(--n-soft)":"",Z?.shell??""),children:[oe,e("textarea",{ref:be,id:xe,rows:G,value:fe,disabled:ae,readOnly:te,onChange:e=>{ue||de(e.target.value),A?.(e.target.value)},className:p("neba-input block w-full resize-none bg-transparent [font:inherit] text-inherit","[outline:none]","min-h-(--n-min-rows) max-h-(--n-max-rows) overflow-y-auto","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",Z?.control??""),style:{"--n-min-rows":`calc(${Math.max(G,1)} * 1lh)`,"--n-max-rows":`calc(${Math.max(J,G,1)} * 1lh)`},enterKeyHint:"Enter"===O?"send":void 0,...ie,onKeyDown:e=>{ne?.(e),e.defaultPrevented||!e.nativeEvent.isComposing&&c(e,O)&&(e.preventDefault(),ye())}}),t("div",{className:p("flex min-w-0 items-center gap-2",j[K],Z?.toolbar??""),children:[w(Q)?e("div",{className:"flex min-w-0 items-center gap-1",children:Q}):null,t("div",{className:"ms-auto flex shrink-0 items-center gap-2",children:[w(U)?e("div",{className:"flex items-center gap-1",children:U}):null,e(l,{type:"submit",formNoValidate:L||void 0,size:K,color:M,icon:e(L?StopIcon:SendIcon,{}),label:L?ce.stop:ce.send,disabled:!L&&!je,className:Z?.send})]})]}),pe?e("div",{"aria-hidden":"true",className:p("pointer-events-none absolute inset-0 flex items-center justify-center","font-medium text-(--n-accent)",F[K]),children:ce.drop}):null]})]})});
|
|
@@ -19,8 +19,9 @@ export interface NebaProviderProps {
|
|
|
19
19
|
/**
|
|
20
20
|
* Prop values every component under it starts from.
|
|
21
21
|
*
|
|
22
|
-
* `size`, `density`, `variant`, `locale` and `
|
|
23
|
-
* right value is a property of the product rather than of the
|
|
22
|
+
* `size`, `density`, `variant`, `locale`, `labelPlacement` and `spacing` — the
|
|
23
|
+
* axes whose right value is a property of the product rather than of the
|
|
24
|
+
* control. A call site still wins:
|
|
24
25
|
* the order is the caller, then this, then the component's own default.
|
|
25
26
|
*/
|
|
26
27
|
defaults?: NebaDefaults;
|
|
@@ -49,26 +50,6 @@ export interface NebaProviderProps {
|
|
|
49
50
|
*/
|
|
50
51
|
direction?: NebaDirection;
|
|
51
52
|
}
|
|
52
|
-
/**
|
|
53
|
-
* The script to run before the first paint, so a remembered dark page does not
|
|
54
|
-
* flash white on the way in.
|
|
55
|
-
*
|
|
56
|
-
* The one thing a provider cannot do for you: React runs after the document has
|
|
57
|
-
* been painted once, and by then the flash has happened. Inline the string this
|
|
58
|
-
* returns in `<head>`, above everything:
|
|
59
|
-
*
|
|
60
|
-
* ```tsx
|
|
61
|
-
* <script dangerouslySetInnerHTML={{ __html: colorSchemeScript() }} />
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* It reads the same key and writes the same attribute and `color-scheme` the
|
|
65
|
-
* provider does, so the two cannot disagree — which is the reason it is here
|
|
66
|
-
* rather than in a documentation snippet somebody copies once and never updates.
|
|
67
|
-
*/
|
|
68
|
-
export declare function colorSchemeScript(options?: {
|
|
69
|
-
storageKey?: string;
|
|
70
|
-
defaultColorScheme?: NebaColorScheme;
|
|
71
|
-
}): string;
|
|
72
53
|
/**
|
|
73
54
|
* One place to set what every Neba component under it starts from.
|
|
74
55
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{DirectionProvider as r,useDirection as o}from"@base-ui/react/direction-provider";import{DefaultsContext as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{DirectionProvider as r,useDirection as o}from"@base-ui/react/direction-provider";import{DefaultsContext as n}from"../../internal/defaults.js";import{useHydrated as l,useMediaQuery as c}from"../../internal/media.js";import{DEFAULT_STORAGE_KEY as i}from"./colorSchemeScript.js";const s=/*@__PURE__*/t.createContext(null);export function NebaProvider({children:a,defaults:u,colorScheme:m,defaultColorScheme:d="system",onColorSchemeChange:h,storageKey:f=i,colorSchemeElement:p,direction:S}){const v=l(),g=t.useContext(n),b=t.useContext(s),y=o(),[C,E]=t.useState(null),P=t.useMemo(()=>v?function(e){if(!1===e||"undefined"==typeof localStorage)return null;try{const t=localStorage.getItem(e);return"light"===t||"dark"===t||"system"===t?t:null}catch{return null}}(f):null,[v,f]),x=m??C??P??d,k=c("(prefers-color-scheme: dark)"),w="system"===x?k?"dark":"light":x,N=t.useCallback(e=>{if(void 0===m&&E(e),!1!==f)try{localStorage.setItem(f,e)}catch{}h?.(e)},[m,f,h]);t.useEffect(()=>{if(!v)return;const e=p?p():null===b?document.documentElement:null;e&&(e.setAttribute("data-theme",w),e.style.colorScheme=w)},[v,w,p,b]);const j=t.useRef(!1);t.useEffect(()=>{const e=!j.current;if(j.current=!0,!S)return;const t=document.documentElement.dir;"production"!==process.env.NODE_ENV&&e&&(t||"ltr")!==S&&console.warn(`Neba: a NebaProvider has direction="${S}", and <html> ${t?`has dir="${t}"`:"has no dir"}. The provider sets dir only once it has mounted, so the page is drawn the other way round until then and mirrors when it does. Put dir="${S}" on <html> in the HTML itself.`),document.documentElement.setAttribute("dir",S)},[S]);const M=t.useMemo(()=>({colorScheme:x,resolvedColorScheme:w,setColorScheme:N,toggleColorScheme:()=>N("dark"===w?"light":"dark")}),[x,w,N]),$=u?.size??g?.size,z=u?.density??g?.density,A=u?.variant??g?.variant,I=u?.locale??g?.locale,T=u?.labelPlacement??g?.labelPlacement,D=u?.spacing??g?.spacing,H=null!=u||null!==g,K=t.useMemo(()=>H?{size:$,density:z,variant:A,locale:I,labelPlacement:T,spacing:D}:null,[H,$,z,A,I,T,D]);return e(n.Provider,{value:K,children:e(s.Provider,{value:M,children:e(r,{direction:S??y,children:a})})})}export function useColorScheme(){const e=t.useContext(s);if(!e)throw new Error("neba: useColorScheme() needs a <NebaProvider> above it.");return e}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { NebaColorScheme } from './NebaProvider.js';
|
|
2
|
+
/** Where the provider and the script below remember the reader's choice. */
|
|
3
|
+
export declare const DEFAULT_STORAGE_KEY = "neba-color-scheme";
|
|
4
|
+
/**
|
|
5
|
+
* The script to run before the first paint, so a remembered dark page does not
|
|
6
|
+
* flash white on the way in.
|
|
7
|
+
*
|
|
8
|
+
* The one thing a provider cannot do for you: React runs after the document has
|
|
9
|
+
* been painted once, and by then the flash has happened. Inline the string this
|
|
10
|
+
* returns in `<head>`, above everything:
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <script dangerouslySetInnerHTML={{ __html: colorSchemeScript() }} />
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* It reads the same key and writes the same attribute and `color-scheme` the
|
|
17
|
+
* provider does, so the two cannot disagree — which is the reason it is here
|
|
18
|
+
* rather than in a documentation snippet somebody copies once and never updates.
|
|
19
|
+
*/
|
|
20
|
+
export declare function colorSchemeScript(options?: {
|
|
21
|
+
storageKey?: string;
|
|
22
|
+
defaultColorScheme?: NebaColorScheme;
|
|
23
|
+
}): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DEFAULT_STORAGE_KEY="neba-color-scheme";export function colorSchemeScript(t={}){const c=t.storageKey??"neba-color-scheme",r=t.defaultColorScheme??"system";return`(function(){try{var s=localStorage.getItem(${e(c)})||${e(r)};if(s==='system'){s=matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'}var d=document.documentElement;d.setAttribute('data-theme',s);d.style.colorScheme=s}catch(e){}})()`}function e(e){return JSON.stringify(e).replace(/</g,"\\u003c")}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export { colorSchemeScript
|
|
1
|
+
export { colorSchemeScript } from './colorSchemeScript.js';
|
|
2
|
+
export { NebaProvider, useColorScheme } from './NebaProvider.js';
|
|
2
3
|
export type { ColorSchemeState, NebaColorScheme, NebaDirection, NebaProviderProps } from './NebaProvider.js';
|
|
3
4
|
export type { NebaDefaults } from '../../internal/defaults.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{colorSchemeScript
|
|
1
|
+
export{colorSchemeScript}from"./colorSchemeScript.js";export{NebaProvider,useColorScheme}from"./NebaProvider.js";
|
|
@@ -25,6 +25,19 @@ export interface RadioGroupProps extends Omit<React.ComponentPropsWithoutRef<typ
|
|
|
25
25
|
* @default 'vertical'
|
|
26
26
|
*/
|
|
27
27
|
orientation?: NebaOrientation;
|
|
28
|
+
/**
|
|
29
|
+
* The gap between the options, on Tailwind's spacing scale: `3` is
|
|
30
|
+
* `0.75rem`, the same step `gap-3` is. One length on both axes, so a
|
|
31
|
+
* horizontal group that wraps puts its lines as far apart as its options.
|
|
32
|
+
* Left out, a column follows `size` on the ladder a Form stands its fields
|
|
33
|
+
* on, `3` at `md`, and a row keeps `5` along it with the column's step
|
|
34
|
+
* between its lines.
|
|
35
|
+
*
|
|
36
|
+
* Not read from a `NebaProvider`: the provider's `spacing` is the gap between
|
|
37
|
+
* fields, and a product that spreads its fields apart should not spread every
|
|
38
|
+
* set of options with them.
|
|
39
|
+
*/
|
|
40
|
+
spacing?: number;
|
|
28
41
|
/** The question the options answer. Rendered as the group's legend. */
|
|
29
42
|
label?: React.ReactNode;
|
|
30
43
|
/** Helper text under the label. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as i}from"@base-ui/react/field";import{controlTextClasses as o,cx as t,hitAreaClasses as s,metaTextClasses as d,
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{Radio as n}from"@base-ui/react/radio";import{RadioGroup as l}from"@base-ui/react/radio-group";import{Field as i}from"@base-ui/react/field";import{controlTextClasses as o,cx as t,hitAreaClasses as s,metaTextClasses as d,optionGapClasses as c,surfaceClasses as b,tickDotClasses as f,tickRowLeadingClasses as m,tickSizeClasses as h,transitionClasses as p}from"../../internal/styles.js";import{spacingValue as u}from"../../internal/grid.js";import{useStyleDefaults as v}from"../../internal/defaults.js";import{useFieldsetDisabled as g}from"../../internal/fieldset.js";const x=/*@__PURE__*/r.createContext({size:"md",color:"primary",readOnly:!1,disabled:!1}),N=["relative inline-flex shrink-0 items-center justify-center rounded-full border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",p,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),y=[b,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),j=[b,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),k=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" "),z=["neba-radio-dot rounded-full bg-current","[transition:width_var(--neba-duration)_var(--neba-ease),height_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:size-0 data-[ending-style]:size-0"].join(" ");export const Radio=/*@__PURE__*/r.forwardRef(function Radio({label:l,description:s,disabled:c,className:b,classNames:p,style:u,...v},g){const R=r.useContext(x),w=v.readOnly??R.readOnly,$=c??R.disabled;return e(i.Root,{disabled:$,className:t("flex flex-col",b??""),style:u,children:a("div",{className:`flex items-start gap-2 ${o[R.size]} ${m}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(n.Root,{ref:g,className:t(N,h[R.size],$?k:w?j:y,p?.control),disabled:$,...v,children:e(n.Indicator,{className:t(z,f[R.size],p?.indicator)})})}),l||s?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[l?e(i.Label,{className:t("leading-[1.4]",$?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",p?.label),children:l}):null,s?e(i.Description,{className:t(d[R.size],"text-(--neba-muted-fg)",p?.description),children:s}):null]}):null]})})});export const RadioGroup=/*@__PURE__*/r.forwardRef(function RadioGroup(n,o){const{size:s="md",color:b="primary",orientation:f="vertical",spacing:m,label:h,description:p,error:N,invalid:y,disabled:j,readOnly:k=!1,className:z,classNames:R,style:w,children:$,...O}=v(n,["size"]),_=g(j),G=null!=N&&!1!==N&&""!==N,C=y??G,D=C?"danger":b,L={"--n-fill":`var(--neba-${D}-fill)`,"--n-fill-hover":`var(--neba-${D}-fill-hover)`,"--n-on-solid":`var(--neba-${D}-on-solid)`,"--n-accent":`var(--neba-${D}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${D}-line)`,"--n-line-hover":`var(--neba-${D}-line-hover)`,"--n-ring":`var(--neba-${D}-ring)`},E=r.useMemo(()=>({size:s,color:D,readOnly:k,disabled:_}),[s,D,k,_]);return e(x.Provider,{value:E,children:a(i.Root,{disabled:_,invalid:C,className:t("flex flex-col gap-1.5",z??""),style:{...L,...w},children:[h?e(i.Label,{className:t(d[s],"font-medium",_?"text-(--neba-disabled-fg)":"text-(--neba-fg)",R?.label),children:h}):null,p?e(i.Description,{className:t(d[s],"text-(--neba-muted-fg)",R?.description),children:p}):null,e(l,{ref:o,disabled:_,readOnly:k,className:t("flex","horizontal"===f?"flex-row flex-wrap":"flex-col",void 0===m?c[f][s]:"",R?.control),style:void 0===m?void 0:{gap:u(m)},...O,children:$}),e(i.Error,G?{match:!0,className:t(d[s],"text-(--n-accent)",R?.error),children:N}:{className:t(d[s],"text-(--n-accent)",R?.error)})]})})});
|
|
@@ -42,6 +42,27 @@ export interface ReasoningProps extends Pick<NebaStyleProps, 'size' | 'variant'
|
|
|
42
42
|
* @default true
|
|
43
43
|
*/
|
|
44
44
|
autoOpen?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether `autoOpen` also closes the panel when the stream ends.
|
|
47
|
+
*
|
|
48
|
+
* Turn it off to leave the thinking open once it has arrived. A panel that
|
|
49
|
+
* folds itself away moves everything under it up the page with nobody having
|
|
50
|
+
* pressed anything, and where the answer is already being read below it, that
|
|
51
|
+
* jump is worse than the space the thinking takes. Only read while `autoOpen`
|
|
52
|
+
* is on: with it off, the stream moves nothing in either direction.
|
|
53
|
+
* @default true
|
|
54
|
+
*/
|
|
55
|
+
autoClose?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Keeps a closed panel in the DOM, hidden until the browser's own page search
|
|
58
|
+
* finds something in it and opens it.
|
|
59
|
+
*
|
|
60
|
+
* On by default, as on a [Collapsible](../surfaces/collapsible): a panel that
|
|
61
|
+
* is not in the markup is not in a server render either. Turn it off to leave
|
|
62
|
+
* a closed panel out of the DOM.
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
hiddenUntilFound?: boolean;
|
|
45
66
|
/** Replaces what the header says. Otherwise it is the `locale`'s sentence. */
|
|
46
67
|
label?: React.ReactNode;
|
|
47
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{Collapsible as a}from"@base-ui/react/collapsible";import{boxPaddingXClasses as o,boxPaddingYClasses as l}from"../box/Box.js";import{ChevronIcon as r,SpinnerIcon as s}from"../../internal/icons.js";import{formatDuration as i,useElapsed as d}from"../../internal/run.js";import{fillMessage as c,reasoningMessages as m,useMessages as u}from"../../internal/i18n.js";import{collapsiblePanelClasses as f,cx as p,gapClasses as b,hasContent as h,iconClasses as x,radiusClasses as v,sheetBodyClasses as g,sheetTitleClasses as j,surfaceClasses as N,surfaceSlots as y,transitionClasses as w,disclosureChevronClasses as C,disclosureTriggerClasses as O}from"../../internal/styles.js";import{useStyleDefaults as R}from"../../internal/defaults.js";const k={solid:[N,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[N,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Reasoning=/*@__PURE__*/t.forwardRef(function Reasoning(N,z){const{variant:F="text",size:S="md",color:U="secondary",density:_="default",elevation:B=0,streaming:P=!1,duration:T,open:q,defaultOpen:A=!1,onOpenChange:D,autoOpen:E=!0,autoClose:G=!0,hiddenUntilFound:H=!0,label:I,icon:J,locale:K,labels:L,classNames:M,className:Q,style:V,children:W,...X}=R(N,["size","density","variant","locale"]),Y={...u(m,K),...L},[Z,$]=t.useState(A||E&&P),[ee,ne]=t.useState(P),te=void 0!==q,ae=te?q:Z;ee!==P&&(ne(P),E&&!te&&(P||G)&&$(P));const oe=d(P,T),le=null===oe?null:i(oe,K),re=h(I)?I:P?Y.thinking:null===le?Y.done:c(Y.thought,{duration:le}),se=void 0===J?P?e(s,{}):null:J;return n(a.Root,{ref:z,open:ae,onOpenChange:e=>{te||$(e),D?.(e)},"aria-busy":P||void 0,"data-streaming":P||void 0,className:p("flex flex-col overflow-hidden",v[S],k[F],w,x,Q??""),style:{...y(U,B),...V},...X,children:[n(a.Trigger,{className:p("flex w-full cursor-pointer items-center text-start text-(--neba-muted-fg)",O,o[_][S],l[_][S],b[S],j[S],w,"hover:bg-(--n-soft) hover:text-(--n-on-tint)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",M?.header??""),children:[h(se)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:se}):null,e("span",{className:"min-w-0 flex-1 truncate font-medium",children:re}),e("span",{className:C,children:e(r,{})})]}),e(a.Panel,{hiddenUntilFound:H,className:f,children:e("div",{className:p("min-w-0 border-s-2 text-(--neba-muted-fg) [border-color:var(--n-line)]",o[_][S],"compact"===_?"pb-2":"pb-4",g[S],M?.body??""),children:W})})]})});
|