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 l}from"react/jsx-runtime";import{Dialog as n}from"@base-ui/react/dialog";import{boxPaddingXClasses as o,boxPaddingYClasses as a}from"../box/Box.js";import{actionMessages as s,useMessages as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Dialog as n}from"@base-ui/react/dialog";import{boxPaddingXClasses as o,boxPaddingYClasses as a}from"../box/Box.js";import{actionMessages as s,useMessages as r}from"../../internal/i18n.js";import{CloseIcon as i}from"../../internal/icons.js";import{cx as t,hasContent as c,metaTextClasses as d,popupFadeClasses as m,radiusClasses as p,sheetBodyClasses as f,sheetCloseClasses as x,sheetHeaderGapClasses as u,sheetSectionGapClasses as b,sheetTitleClasses as h,surfaceClasses as g,surfaceSlots as v}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";const y={xs:"max-w-80",sm:"max-w-96",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"},N=g+" relative flex w-full flex-col overflow-hidden border text-(--neba-fg) bg-(--n-panel-press) [border-color:var(--n-line)] [box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)] [outline:none] "+m,j="fixed inset-0 z-(--neba-z-portal) bg-(--neba-scrim) [backdrop-filter:blur(2px)] "+m,$="border-t [border-color:var(--n-line)]";export const DialogClose=n.Close;export function Dialog(m){const{size:g="md",color:k="primary",density:z="default",open:C,defaultOpen:D,onOpenChange:O,trigger:P,title:B,description:T,actions:W,dividers:L=!1,showClose:R=!0,locale:S,closeLabel:V,width:q,fullWidth:A=!0,fullScreen:E=!1,modal:F=!0,dismissible:G=!0,className:H,classNames:I,style:J,children:K,...M}=w(m,["size","density","locale"]),Q=r(s,S),U=o[z][g],X=a[z][g],Y=L?`${U} ${X}`:U,Z=c(B)||c(T),_=c(W);return l(n.Root,{open:C,defaultOpen:D,modal:F,disablePointerDismissal:!G,onOpenChange:(e,l)=>{G||e||"escape-key"!==l.reason?O?.(e):l.cancel()},children:[P?e(n.Trigger,{render:P}):null,l(n.Portal,{children:[e(n.Backdrop,{className:t("neba-portal",j,!0===F?"":"pointer-events-none",I?.backdrop)}),e(n.Viewport,{className:t("neba-portal fixed inset-0 z-(--neba-z-portal) flex justify-center",E?"items-stretch":"items-center p-4",!0===F?"":"pointer-events-none",I?.viewport),children:l(n.Popup,{className:t(N,!0===F?"":"pointer-events-auto",f[g],E?"h-full max-w-none rounded-none":`max-h-full ${p[g]} ${void 0===q?y[g]:""}`,E||A?"":"w-auto",L?"":`${X} ${b[g]}`,H??""),style:{...v(k,3),...void 0===q?null:{maxWidth:"number"==typeof q?`${q}px`:q},...J},...M,children:[Z||R?l("div",{className:`flex shrink-0 items-start gap-3 ${Y}`,children:[l("div",{className:`flex min-w-0 flex-1 flex-col ${u[g]}`,children:[c(B)?e(n.Title,{className:t("font-semibold",h[g],"m-0",I?.title),children:B}):null,c(T)?e(n.Description,{className:t("m-0 text-(--neba-muted-fg)",d[g],I?.description),children:T}):null]}),R?e(n.Close,{"aria-label":V??Q.close,className:t(x,I?.close),children:e(i,{})}):null]}):null,c(K)?e("div",{className:t("min-h-0 flex-1 overflow-y-auto overscroll-contain",Y,L&&(Z||R)?$:"",L?"":"py-1 -my-1",I?.body),children:K}):null,_?e("div",{className:t("flex shrink-0 flex-wrap items-center justify-end gap-2",Y,L?$:"",I?.actions),children:W}):null]})})]})]})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Dialog, DialogClose } from './Dialog.js';
|
|
2
|
-
export type { DialogCloseProps, DialogProps } from './Dialog.js';
|
|
2
|
+
export type { DialogCloseProps, DialogProps, DialogSlot } from './Dialog.js';
|
|
@@ -176,4 +176,4 @@ export declare const DrawerClose: React.ForwardRefExoticComponent<Omit<import("@
|
|
|
176
176
|
* scroll lock, the `aria-labelledby` / `aria-describedby` wiring, restoring
|
|
177
177
|
* focus to the trigger, and the inert page behind.
|
|
178
178
|
*/
|
|
179
|
-
export declare
|
|
179
|
+
export declare const Drawer: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r,Fragment as a}from"react/jsx-runtime";import*as t from"react";import{Dialog as n}from"@base-ui/react/dialog";import{boxPaddingXClasses as l,boxPaddingYClasses as s}from"../box/Box.js";import{actionMessages as d,useMessages as o}from"../../internal/i18n.js";import{CloseIcon as i}from"../../internal/icons.js";import{cx as b,hasContent as m,headingTitleClasses as u,metaTextClasses as c,popupFadeClasses as f,sheetBodyClasses as p,sheetCloseClasses as h,sheetHeaderGapClasses as x,sheetSectionGapClasses as g,surfaceClasses as v,surfaceSlots as y}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";const N={xs:"w-56",sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]"},j={left:{xs:"rounded-r-(--neba-radius-xs)",sm:"rounded-r-(--neba-radius-sm)",md:"rounded-r-(--neba-radius-md)",lg:"rounded-r-(--neba-radius-lg)",xl:"rounded-r-(--neba-radius-xl)"},right:{xs:"rounded-l-(--neba-radius-xs)",sm:"rounded-l-(--neba-radius-sm)",md:"rounded-l-(--neba-radius-md)",lg:"rounded-l-(--neba-radius-lg)",xl:"rounded-l-(--neba-radius-xl)"},top:{xs:"rounded-b-(--neba-radius-xs)",sm:"rounded-b-(--neba-radius-sm)",md:"rounded-b-(--neba-radius-md)",lg:"rounded-b-(--neba-radius-lg)",xl:"rounded-b-(--neba-radius-xl)"},bottom:{xs:"rounded-t-(--neba-radius-xs)",sm:"rounded-t-(--neba-radius-sm)",md:"rounded-t-(--neba-radius-md)",lg:"rounded-t-(--neba-radius-lg)",xl:"rounded-t-(--neba-radius-xl)"}},$={left:"border-r",right:"border-l",top:"border-b",bottom:"border-t"},_={left:"data-[starting-style]:[translate:-100%_0] data-[ending-style]:[translate:-100%_0]",right:"data-[starting-style]:[translate:100%_0] data-[ending-style]:[translate:100%_0]",top:"data-[starting-style]:[translate:0_-100%] data-[ending-style]:[translate:0_-100%]",bottom:"data-[starting-style]:[translate:0_100%] data-[ending-style]:[translate:0_100%]"},k={left:"flex-row justify-start",right:"flex-row justify-end",top:"flex-col justify-start",bottom:"flex-col justify-end"},C=v+" relative flex flex-col overflow-hidden [&[hidden]]:hidden text-(--neba-fg) bg-(--n-panel-press) [border-color:var(--n-line)] [outline:none]",z="fixed inset-0 z-(--neba-z-portal) bg-(--neba-scrim) [backdrop-filter:blur(2px)] "+f,D="env(safe-area-inset-top) solid transparent",B="env(safe-area-inset-bottom) solid transparent",L="env(safe-area-inset-left) solid transparent",R="env(safe-area-inset-right) solid transparent",T={top:{borderTop:D,borderLeft:L,borderRight:R},bottom:{borderBottom:B,borderLeft:L,borderRight:R},left:{borderTop:D,borderBottom:B,borderLeft:L},right:{borderTop:D,borderBottom:B,borderRight:R}},O="border-t [border-color:var(--n-line)]";export const DrawerClose=n.Close;export const Drawer=/*@__PURE__*/t.forwardRef(function Drawer(f,v){const{side:D="left",mode:B="overlay",size:L="md",color:R="primary",density:P="default",open:E,defaultOpen:M,onOpenChange:A,trigger:F,title:S,headingLevel:V=2,description:q,actions:G,dividers:H=!1,showClose:I,locale:J,closeLabel:K,extent:Q,rounded:U=!0,modal:W=!0,dismissible:X=!0,safeArea:Y=!0,keepMounted:Z=!1,className:ee,style:re,children:ae,...te}=w(f,["size","density","locale"]),ne=o(d,J),le="overlay"===B,se="left"===D||"right"===D,de=I??le,[oe,ie]=t.useState(M??!0),be=l[P][L],me=s[P][L],ue=H?`${be} ${me}`:be,ce=m(S)||m(q),fe=m(G),pe=void 0===Q?null:{[se?"width":"height"]:"number"==typeof Q?`${Q}px`:Q},he=b(C,p[L],$[D],U?j[D][L]:"",le?"[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]":"[box-shadow:var(--neba-plate-glass)]",le?`[transition:translate_var(--neba-duration)_var(--neba-ease)] ${_[D]}`:"",se?`h-full max-w-full ${void 0===Q?N[L]:""}`:"w-full "+(void 0===Q?"max-h-[85%]":""),H?"":`${me} ${g[L]}`,ee??""),xe=`h${V}`,ge=le?n.Description:"p",ve=b("neba-heading","[&.neba-heading]:m-0 [&.neba-heading]:font-semibold [&.neba-heading]:text-inherit",u[L]),ye=r(a,{children:[ce||de?r("div",{className:`flex shrink-0 items-start gap-3 ${ue}`,children:[r("div",{className:`flex min-w-0 flex-1 flex-col ${x[L]}`,children:[m(S)?le?e(n.Title,{render:t.createElement(xe),className:ve,children:S}):t.createElement(xe,{className:ve},S):null,m(q)?e(ge,{className:`m-0 text-(--neba-muted-fg) ${c[L]}`,children:q}):null]}),de?le?e(n.Close,{"aria-label":K??ne.close,className:h,children:e(i,{})}):e("button",{type:"button","aria-label":K??ne.close,className:h,onClick:()=>{void 0===E&&ie(!1),A?.(!1)},children:e(i,{})}):null]}):null,m(ae)?e("div",{className:b("min-h-0 flex-1 overflow-y-auto overscroll-contain",ue,H&&(ce||de)?O:"",H?"":"py-1 -my-1"),children:ae}):null,fe?e("div",{className:b("flex shrink-0 flex-wrap items-center justify-end gap-2",ue,H?O:""),children:G}):null]});if(!le){const r=E??oe;return r||Z?e("div",{ref:v,hidden:!r||void 0,className:he,style:{...y(R,0),...pe,...re},...te,children:ye}):null}return r(n.Root,{open:E,defaultOpen:M,modal:W,disablePointerDismissal:!X,onOpenChange:(e,r)=>{X||e||"escape-key"!==r.reason?A?.(e):r.cancel()},children:[F?e(n.Trigger,{render:F}):null,r(n.Portal,{keepMounted:Z,children:[e(n.Backdrop,{className:b("neba-portal",z,!0===W?"":"pointer-events-none")}),e(n.Viewport,{className:b("neba-portal fixed inset-0 z-(--neba-z-portal) flex [&[hidden]]:hidden",k[D],!0===W?"":"pointer-events-none"),children:e(n.Popup,{ref:v,className:b(he,!0===W?"":"pointer-events-auto"),style:{...y(R,3),...pe,...Y?T[D]:null,...re},...te,children:ye})})]})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as l from"react";import{useRender as n}from"@base-ui/react/use-render";import{boxPaddingXClasses as a}from"../box/Box.js";import{transitionProps as s}from"../../internal/animate.js";import{emptyMessages as o,useMessages as i}from"../../internal/i18n.js";import{cx as m,hasContent as c,iconClasses as d,radiusClasses as p,sheetBodyClasses as x,sheetHeaderGapClasses as f,sheetSectionGapClasses as u,sheetTitleClasses as y,sheetTitleHeadingClasses as h,surfaceClasses as v,surfaceSlots as b,transitionClasses as g}from"../../internal/styles.js";import{useStyleDefaults as j}from"../../internal/defaults.js";const N={default:{xs:"py-5",sm:"py-6",md:"py-8",lg:"py-10",xl:"py-12"},compact:{xs:"py-3",sm:"py-3.5",md:"py-4",lg:"py-5",xl:"py-6"}},k={xs:"text-[1.25rem]",sm:"text-[1.5rem]",md:"text-[1.75rem]",lg:"text-[2.125rem]",xl:"text-[2.5rem]"},w={solid:v+" text-(--neba-fg) bg-(--n-panel-hover) [box-shadow:var(--n-elev),var(--neba-plate-solid)]",outline:v+" 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 TrayIcon(){return t("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"M1.75 9.75h3l.9 1.6h4.7l.9-1.6h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"m1.75 9.75 2.1-6a1.5 1.5 0 0 1 1.42-1h5.46a1.5 1.5 0 0 1 1.42 1l2.1 6v2a1.5 1.5 0 0 1-1.5 1.5h-9.5a1.5 1.5 0 0 1-1.5-1.5Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]})}export const Empty=/*@__PURE__*/l.forwardRef(function Empty(v,$){const{variant:E="text",size:L="md",color:z="secondary",density:B="default",elevation:C=0,title:I,icon:T,action:W,locale:F,transition:M,render:R,className:V,style:Z,children:q,...A}=j(v,["size","density","variant","locale"]),D=i(o,F),G=void 0===I?D.title:I,H=void 0===T?e(TrayIcon,{}):T,J=s(M),K=c(G),O=l.isValidElement(R)&&("td"===R.type||"th"===R.type),{role:P,...Q}=A,S="role"in A?P:"status",U=m("flex w-full flex-col items-center justify-center text-center",a[B][L],N[B][L],p[L],u[L],g,w[E],J.className),X={...b(z,C),...J.style},Y=t(r,{children:[c(H)?e("span",{className:`flex items-center text-(--neba-muted-fg) ${k[L]} ${d}`,children:H}):null,K||c(q)?t("div",{className:`flex max-w-prose flex-col items-center ${f[L]}`,children:[K?e("div",{className:`${h} font-semibold ${y[L]}`,children:G}):null,c(q)?e("div",{className:`${x[L]} ${K?"text-(--neba-muted-fg)":""}`,children:q}):null]}):null,c(W)?e("div",{className:"flex flex-wrap items-center justify-center gap-2",children:W}):null]});return n({render:R,ref:$,props:O?{className:V,style:Z,children:e("div",{role:S,className:U,style:X,children:Y}),...Q}:{role:S,className:m(U,V??""),style:{...X,...Z},children:Y,...Q}})});
|
|
@@ -11,8 +11,19 @@ export interface FieldsetProps extends Omit<React.ComponentPropsWithoutRef<'fiel
|
|
|
11
11
|
description?: React.ReactNode;
|
|
12
12
|
/** Disables every control inside at once, the way a `<fieldset>` always has. */
|
|
13
13
|
disabled?: boolean;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* The type scale of the legend, and the gap between the controls when
|
|
16
|
+
* `spacing` is not given.
|
|
17
|
+
* @default 'md'
|
|
18
|
+
*/
|
|
15
19
|
size?: NebaSize;
|
|
20
|
+
/**
|
|
21
|
+
* The gap between the controls as an exact length, on Tailwind's spacing
|
|
22
|
+
* scale: `5` is `1.25rem`, the same step `gap-5` is. Takes over from the gap
|
|
23
|
+
* `size` picks, leaves the legend's type scale alone, and a `NebaProvider` can
|
|
24
|
+
* set it for every Fieldset.
|
|
25
|
+
*/
|
|
26
|
+
spacing?: number;
|
|
16
27
|
children?: React.ReactNode;
|
|
17
28
|
}
|
|
18
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import*as s from"react";import{Fieldset as
|
|
1
|
+
"use client";import{jsx as e,jsxs as i}from"react/jsx-runtime";import*as s from"react";import{Fieldset as r}from"@base-ui/react/fieldset";import{cx as l,hasContent as a,metaTextClasses as d,sheetHeaderGapClasses as t,sheetSectionGapClasses as n,sheetTitleClasses as o}from"../../internal/styles.js";import{spacingValue as m}from"../../internal/grid.js";import{useStyleDefaults as c}from"../../internal/defaults.js";import{FieldsetDisabledContext as f,useFieldsetDisabled as p}from"../../internal/fieldset.js";export const Fieldset=/*@__PURE__*/s.forwardRef(function Fieldset(u,b){const{legend:x,description:j,disabled:g,size:v="md",spacing:h,className:y,style:N,children:w,"aria-describedby":F,...$}=c(u,["size","spacing"]),z=p(g),R=s.useId(),B=a(x),I=a(j);return e(f.Provider,{value:z,children:i(r.Root,{ref:b,disabled:z,className:l("m-0 flex min-w-0 flex-col border-0 p-0",void 0===h?n[v]:"",y??""),style:void 0===h?N:{gap:m(h),...N},"aria-describedby":[F,I?R:void 0].filter(Boolean).join(" ")||void 0,...$,children:[B||I?i("div",{className:`flex min-w-0 flex-col ${t[v]}`,children:[B?e(r.Legend,{className:`p-0 font-semibold ${o[v]}`,children:x}):null,I?e("span",{id:R,className:`text-(--neba-muted-fg) ${d[v]}`,children:j}):null]}):null,w]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{formatFileSize as t}from"./formatFileSize.js";import{useLayoutEffectOnClient as l}from"../../internal/layout-effect.js";import{useDropZone as a}from"../../internal/drop.js";import{glowClasses as o,spotlightSlot as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{formatFileSize as t}from"./formatFileSize.js";import{useLayoutEffectOnClient as l}from"../../internal/layout-effect.js";import{useDropZone as a}from"../../internal/drop.js";import{glowClasses as o,spotlightSlot as s,trackPointer as i}from"../../internal/glow.js";import{CloseIcon as c}from"../../internal/icons.js";import{fileMessages as d,fillMessage as u,useMessages as f}from"../../internal/i18n.js";import{controlTextLeadingClasses as m,cx as p,disabledClasses as b,gapClasses as h,hasContent as v,hitAreaClasses as x,iconClasses as g,metaTextClasses as y,radiusClasses as k,readOnlyFilterClasses as N,sheetTitleClasses as j,stackGapClasses as $,surfaceClasses as w,surfaceSlots as z,transitionClasses as C}from"../../internal/styles.js";import{useStyleDefaults as I}from"../../internal/defaults.js";import{useFieldsetDisabled as _}from"../../internal/fieldset.js";const L={default:{xs:"p-4",sm:"p-5",md:"p-6",lg:"p-8",xl:"p-10"},compact:{xs:"p-2",sm:"p-3",md:"p-4",lg:"p-5",xl:"p-6"}},M={solid:w+" border-2 border-dashed text-(--neba-fg) bg-(--n-panel-hover) [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]",outline:w+" border-2 border-dashed text-(--neba-fg) bg-(--n-panel) [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]",text:"border-2 border-dashed text-(--neba-fg) bg-transparent [border-color:var(--n-line)]"},W={solid:"hover:bg-(--n-panel-press) hover:[border-color:var(--n-line-hover)]",outline:"hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]",text:"hover:bg-(--n-soft) hover:[border-color:var(--n-line-hover)]"};function UploadIcon(){return n("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[e("path",{d:"M8 10.5V2.75m0 0L5.25 5.5M8 2.75 10.75 5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M2.75 9.75v1.75a1.75 1.75 0 0 0 1.75 1.75h7a1.75 1.75 0 0 0 1.75-1.75V9.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}function E(e,n){const r=e.name.toLowerCase(),t=e.type.toLowerCase();return n.split(",").map(e=>e.trim().toLowerCase()).filter(Boolean).some(e=>e.startsWith(".")?r.endsWith(e):e.endsWith("/*")?t.startsWith(`${e.slice(0,-1)}`):t===e)}export const FilePicker=/*@__PURE__*/r.forwardRef(function FilePicker(w,F){const{variant:R="outline",size:S="md",color:T="primary",density:P="default",elevation:V=0,accept:q,multiple:A=!1,maxSize:B,maxFiles:D,value:O,defaultValue:U,onFilesChange:H,onReject:Y,label:G,description:J,error:K,invalid:Q,title:X,hint:Z,icon:ee,showList:ne=!0,removeLabel:re,fullWidth:te=!0,disabled:le,readOnly:ae=!1,required:oe=!1,name:se,id:ie,locale:ce,className:de,style:ue,...fe}=I(w,["size","density","variant","locale"]),me=_(le),pe=f(d,ce),be=re??(e=>u(pe.remove,{name:e})),he=r.useRef(null);r.useImperativeHandle(F,()=>he.current);const[ve,xe]=r.useState(()=>[...U??[]]),ge=r.useMemo(()=>O?[...O]:ve,[O,ve]),ye=v(K),ke=Q??ye,Ne=ke?"danger":T,je=me||ae,$e=r.useId(),we=r.useId(),ze=r.useId(),Ce=ie??ze,Ie=r.useCallback(e=>{O||xe(e),H?.(e)},[H,O]),_e=r.useCallback(e=>{const n=[],r=[],t=A?D??Number.POSITIVE_INFINITY:1,l=A?ge.length:0;for(const a of e)q&&!E(a,q)?r.push({file:a,reason:"type"}):void 0!==B&&a.size>B?r.push({file:a,reason:"size"}):l+n.length>=t?r.push({file:a,reason:"count"}):n.push(a);return{kept:n,rejections:r}},[q,ge.length,D,B,A]),Le=r.useCallback(e=>{const{kept:n,rejections:r}=_e(e);r.length>0&&Y?.(r),n.length>0&&Ie(A?[...ge,...n]:n)},[_e,Ie,ge,A,Y]),{over:Me,handlers:We}=a(je?void 0:Le),Ee=r.useRef(null),Fe=r.useRef(null),Re=r.useRef(null);l(()=>{const e=Re.current;if(null===e)return;Re.current=null;const n=Fe.current?.querySelectorAll("li button")??[],r=n[Math.min(e,n.length-1)]??Ee.current;r?.focus()},[ge]);const Se=r.useCallback(()=>{const e=he.current;if(e&&"undefined"!=typeof DataTransfer)try{const n=new DataTransfer;ge.forEach(e=>n.items.add(e)),e.files=n.files}catch{}},[ge]);r.useEffect(()=>{Se();const e=he.current;return e?.addEventListener("cancel",Se),()=>e?.removeEventListener("cancel",Se)},[Se]);const Te=p("flex w-full flex-col items-center justify-center text-center","cursor-pointer select-none",L[P][S],k[S],h[S],C,g,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2",me?`${b[R]} border-2 border-dashed`:ae?`${M[R]} ${N} cursor-default`:M[R],je?"":`${W[R]} ${o}`,Me&&!je?"bg-(--n-soft-press) [border-color:var(--n-ring)]":"");return n("div",{className:p("flex-col align-top",$[S],te?"flex w-full":"inline-flex",de??""),style:{...z(Ne,V),...je?void 0:s,...ue},...fe,children:[v(G)?e("span",{id:we,className:y[S]+" font-medium "+(me?"text-(--neba-disabled-fg)":"text-(--neba-fg)"),children:G}):null,n("div",{className:"flex w-full flex-col",...We,children:[n("button",{ref:Ee,onPointerMove:i(void 0,!je),type:"button",id:Ce,disabled:me,"aria-labelledby":v(G)?`${we} ${Ce}`:void 0,"aria-describedby":v(J)||ye?$e:void 0,"aria-invalid":ke||void 0,className:Te,onClick:()=>{je||he.current&&(he.current.value="",he.current.click())},children:[void 0===ee?e("span",{className:"flex items-center text-(--n-accent) [&_svg]:size-[1.8em]",children:e(UploadIcon,{})}):v(ee)?e("span",{className:"flex items-center text-(--n-accent) [&_svg]:size-[1.8em]",children:ee}):null,e("span",{className:`font-medium ${j[S]}`,children:X??pe.title}),v(Z)?e("span",{className:`text-(--neba-muted-fg) ${y[S]}`,children:Z}):null]}),e("input",{ref:he,type:"file",name:se,accept:q,multiple:A,required:oe&&0===ge.length,disabled:me,tabIndex:-1,"aria-hidden":"true",className:"absolute size-px overflow-hidden opacity-0 [clip-path:inset(50%)]",onChange:e=>Le(Array.from(e.target.files??[]))})]}),ne&&ge.length>0?e("ul",{ref:Fe,role:"list",className:`flex w-full flex-col ${$[S]} m-0 list-none p-0`,children:ge.map((r,l)=>n("li",{className:"flex w-full items-center gap-2 px-2 py-1.5 "+k.xs+" "+m[S]+" bg-(--n-soft) text-(--neba-fg)",children:[e("span",{className:"min-w-0 flex-1 truncate",children:r.name}),e("span",{className:`shrink-0 text-(--neba-muted-fg) tabular-nums ${y[S]}`,children:t(r.size)}),je?null:e("button",{type:"button","aria-label":be(r.name),className:"relative inline-flex shrink-0 cursor-pointer items-center justify-center rounded-full "+x+" size-[1.3em] text-(--neba-muted-fg) opacity-70 [transition:opacity_var(--neba-duration)_var(--neba-ease),color_var(--neba-duration)_var(--neba-ease)] [&_svg]:size-[0.9em] hover:text-(--neba-fg) hover:opacity-100 focus-visible:opacity-100 focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1",onClick:e=>{Re.current=e.currentTarget===document.activeElement?l:null,Ie(ge.filter((e,n)=>n!==l))},children:e(c,{})})]},`${r.name}-${r.size}-${r.lastModified}-${l}`))}):null,v(J)&&!ye?e("span",{id:$e,className:`${y[S]} text-(--neba-muted-fg)`,children:J}):null,ye?e("span",{id:$e,className:`${y[S]} text-(--n-accent)`,children:K}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as o from"react";import{useMergedRef as n}from"../../internal/refs.js";import{Button as s}from"../button/Button.js";import{CloseIcon as a,PlusIcon as r}from"../../internal/icons.js";import{cx as i,hasContent as l,metaTextClasses as f,radiusClasses as c,surfaceClasses as d}from"../../internal/styles.js";import{useStyleDefaults as m}from"../../internal/defaults.js";const b=/*@__PURE__*/o.createContext({variant:"solid",size:"md",color:"primary",density:"default",elevation:1,showLabels:!0,reversed:!0,close:()=>{},closesOnAction:!1,focusTrigger:()=>{}}),u={xs:"xs",sm:"xs",md:"sm",lg:"md",xl:"lg"},p="lg",v={static:"",absolute:"absolute z-30",sticky:"sticky z-30",fixed:"fixed z-40"},x={"top-start":"top-(--n-fab-offset) start-(--n-fab-offset)","top-end":"top-(--n-fab-offset) end-(--n-fab-offset)","bottom-start":"bottom-(--n-fab-offset) start-(--n-fab-offset)","bottom-end":"bottom-(--n-fab-offset) end-(--n-fab-offset)"},g={"top-start":"top-[calc(var(--n-fab-offset)_+_env(safe-area-inset-top))] start-(--n-fab-offset)","top-end":"top-[calc(var(--n-fab-offset)_+_env(safe-area-inset-top))] end-(--n-fab-offset)","bottom-start":"bottom-[calc(var(--n-fab-offset)_+_env(safe-area-inset-bottom))] start-(--n-fab-offset)","bottom-end":"bottom-[calc(var(--n-fab-offset)_+_env(safe-area-inset-bottom))] end-(--n-fab-offset)"},y=i("pointer-events-none max-w-40 truncate select-none","px-2 py-0.5 text-(--neba-fg) bg-(--n-panel)",d,c.xs,"[box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]");export const FloatingActionButton=/*@__PURE__*/o.forwardRef(function FloatingActionButton(l,f){const{variant:c="solid",size:d=p,color:y="primary",density:h="default",elevation:w=2,icon:z,label:_,extended:k=!1,openIcon:A,position:C="fixed",corner:N="bottom-end",offset:j=16,safeArea:L=!0,direction:E,open:O,defaultOpen:R=!1,onOpenChange:P,openOnHover:T=!0,closeOnAction:F=!0,showLabels:I=!0,disabled:B=!1,className:D,classNames:K,style:W,children:H,onClick:M,onKeyDown:S,onPointerEnter:$,onPointerLeave:q,...G}=m(l,["size","density","variant"]),J=o.useId(),Q=o.useRef(null),U=o.useRef(null),V=n(U,f),[X,Y]=o.useState(R),Z=void 0!==O,ee=o.Children.toArray(H).length>0,te=(Z?O:X)&&ee&&!B,oe=o.useCallback(e=>{Z||Y(e),P?.(e)},[Z,P]),ne=o.useCallback(()=>oe(!1),[oe]),se=o.useRef(!1);o.useEffect(()=>{if(!te)return;const e=e=>{const t=U.current;t&&e.target instanceof Node&&!t.contains(e.target)&&ne()};return document.addEventListener("pointerdown",e),()=>document.removeEventListener("pointerdown",e)},[te,ne]);const ae=E??(N.startsWith("bottom")?"top":"bottom"),re=N.endsWith("end"),ie=o.useMemo(()=>({variant:c,size:u[d],color:y,density:h,elevation:w,showLabels:I,reversed:re,close:F?ne:()=>{},closesOnAction:F,focusTrigger:()=>Q.current?.focus()}),[c,d,y,h,w,I,re,F,ne]),le=te&&!1!==A?A??e(a,{}):z??e(r,{});return t("div",{ref:V,className:i("flex w-fit","top"===ae?"flex-col-reverse":"flex-col",re?"items-end":"items-start","xs"===d||"sm"===d?"gap-1.5":"gap-2",v[C],"static"===C?"":!L||"fixed"!==C&&"sticky"!==C?x[N]:g[N],K?.frame),style:{"--n-fab-offset":"number"==typeof j?`${j}px`:j},onKeyDown:e=>{"Escape"===e.key&&te&&(e.stopPropagation(),ne(),Q.current?.focus()),S?.(e)},onPointerEnter:e=>{T&&ee&&!B&&"mouse"===e.pointerType&&(se.current=!te,oe(!0)),$?.(e)},onPointerLeave:e=>{T&&"mouse"===e.pointerType&&(se.current=!1,ne()),q?.(e)},...G,children:[e(s,{ref:Q,variant:c,size:d,color:y,density:h,elevation:w,disabled:B,"aria-label":_,"aria-expanded":ee?te:void 0,"aria-controls":ee&&te?J:void 0,startIcon:le,className:D,style:{borderRadius:"9999px",...W},onClick:e=>{ee&&(te&&se.current?se.current=!1:oe(!te)),M?.(e)},children:k?_:void 0}),te?e("div",{id:J,className:i("flex","top"===ae?"flex-col-reverse":"flex-col",re?"items-end":"items-start","xs"===d||"sm"===d?"gap-1.5":"gap-2","[animation:neba-anim-fade_var(--neba-duration)_var(--neba-ease)_both]"),children:e(b.Provider,{value:ie,children:H})}):null]})});export const FloatingAction=/*@__PURE__*/o.forwardRef(function FloatingAction({icon:n,label:a,disabled:r=!1,className:c,style:d,onClick:m,...u},p){const v=o.useContext(b);return t("div",{className:i("flex items-center gap-2",v.reversed?"flex-row-reverse":"flex-row",c),children:[e(s,{ref:p,variant:v.variant,size:v.size,color:v.color,density:v.density,elevation:v.elevation,disabled:r,"aria-label":a,startIcon:n,style:{borderRadius:"9999px",...d},onClick:e=>{const t=e.currentTarget===document.activeElement;m?.(e),v.close(),t&&v.closesOnAction&&v.focusTrigger()},...u}),v.showLabels&&l(a)?e("span",{"aria-hidden":"true",className:i(y,f[v.size]),children:a}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useMergedRef as n}from"../../internal/refs.js";import{useLayoutEffectOnClient as r}from"../../internal/layout-effect.js";import{useRender as o}from"@base-ui/react/use-render";import{barMinHeightClasses as s,BottomNavigationContext as i}from"../../internal/bottom-navigation.js";import{watchTile as l}from"../../internal/tile.js";import{cx as d,surfaceClasses as u,surfaceSlots as f,transitionClasses as m}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const v={solid:u+" text-(--neba-fg) bg-(--n-panel-press) [box-shadow:var(--n-elev),var(--neba-plate-solid)]",outline:u+" border text-(--neba-fg) bg-(--n-panel-hover) [border-color:var(--n-line)] [box-shadow:var(--n-elev),var(--neba-plate-glass)]",text:"text-(--neba-fg) bg-transparent"},c={static:"relative mx-auto w-fit",absolute:"absolute inset-x-0 bottom-(--n-nav-offset) z-30 mx-auto w-fit",sticky:"sticky bottom-(--n-nav-offset) z-30 mx-auto w-fit",fixed:"fixed inset-x-0 bottom-(--n-nav-offset) z-40 mx-auto w-fit"},b={default:{xs:"p-1",sm:"p-1",md:"p-1.5",lg:"p-1.5",xl:"p-2"},compact:{xs:"p-0.5",sm:"p-0.5",md:"p-1",lg:"p-1",xl:"p-1"}},x={solid:`${u} bg-(--n-panel-hover) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,outline:`${u} bg-(--n-soft-hover) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,text:"bg-(--n-soft-hover)"},g={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const FloatingBottomNavigation=/*@__PURE__*/a.forwardRef(function FloatingBottomNavigation(u,h){const{variant:y="outline",size:w="md",color:$="primary",density:j="default",elevation:z=2,value:A,defaultValue:N=null,onValueChange:P,position:k="fixed",offset:R=16,labels:C="selected",safeArea:E=!0,disabled:L=!1,label:B,render:F,className:S,style:V,children:W,...q}=p(u,["size","density","variant"]),[H,M]=a.useState(N),T=void 0!==A,D=T?A:H,G=a.useCallback(e=>{T||M(e),P?.(e)},[T,P]),I=a.useMemo(()=>({value:D??null,change:G,size:w,density:j,labels:C,disabled:L,floating:!0}),[D,G,w,j,C,L]),J=a.useRef(null),K=a.useRef(null),O=a.useRef(null),Q=n(J,h),U=a.useCallback(e=>{const t=J.current,a=K.current;if(!t||!a)return;const n=t.querySelector("[data-nav-item][aria-current]");if(!n)return a.hidden=!0,a.removeAttribute("data-ready"),void(O.current=null);const r=n.offsetLeft,o=n.offsetTop,s=n.offsetWidth,i=n.offsetHeight,l=`${r} ${o} ${s} ${i}`;if(O.current?.tile===a&&O.current.box===l&&!a.hidden&&a.hasAttribute("data-ready"))return;a.hidden&&(a.hidden=!1);const d=!e||!a.hasAttribute("data-ready");d&&a.removeAttribute("data-ready"),a.style.setProperty("--n-nav-x",`${r}px`),a.style.setProperty("--n-nav-y",`${o}px`),a.style.setProperty("--n-nav-w",`${s}px`),a.style.setProperty("--n-nav-h",`${i}px`),O.current={tile:a,box:l},d&&a.offsetWidth,a.setAttribute("data-ready","")},[]);r(()=>{U(!0)},[U,D,y,w,j,C]),a.useEffect(()=>{const e=J.current;if(!e)return;const t=e=>{"grid-template-columns"===e.propertyName&&U(!0)},a=l(e,"[data-nav-item]","aria-current",U);return e.addEventListener("transitionend",t),()=>{a(),e.removeEventListener("transitionend",t)}},[U]);const X="number"==typeof R?`${R}px`:R,Y=d("flex max-w-full min-w-0 items-center rounded-full",s[w],b[j][w],g[w],v[y],c[k],m,S);return o({render:F??e("nav",{}),ref:Q,props:{"aria-label":B,className:Y,style:{...f($,z),"--n-nav-offset":E?`calc(${X} + env(safe-area-inset-bottom))`:X,...V},children:t(i.Provider,{value:I,children:[null!=D?e("span",{ref:K,"aria-hidden":"true",className:d("pointer-events-none absolute rounded-full","top-(--n-nav-y) left-(--n-nav-x) h-(--n-nav-h) w-(--n-nav-w)",x[y],"[transition-property:left,top,width,height]","[transition-timing-function:var(--neba-ease)]","[transition-duration:0ms] data-[ready]:[transition-duration:var(--neba-duration)]","motion-reduce:[transition-duration:0ms]")}):null,W]}),...q}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{useRender as r}from"@base-ui/react/use-render";import{boxPaddingXClasses as a,boxPaddingYClasses as o}from"../box/Box.js";import{
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{useRender as r}from"@base-ui/react/use-render";import{boxPaddingXClasses as a,boxPaddingYClasses as o}from"../box/Box.js";import{useBarRef as s}from"../../internal/page-layout.js";import{cx as n,measureValue as i,surfaceClasses as l,surfaceSlots as m,transitionClasses as d}from"../../internal/styles.js";import{responsiveSlots as f}from"../../internal/responsive.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const b={solid:l+" text-(--neba-fg) bg-(--n-panel-press) [box-shadow:var(--n-elev),var(--neba-plate-solid)]",outline:l+" text-(--neba-fg) bg-(--n-panel) [box-shadow:var(--n-elev),var(--neba-plate-glass)]",text:"text-(--neba-fg) bg-transparent"},c={static:"",sticky:"sticky bottom-0 z-30",fixed:"fixed inset-x-0 bottom-0 z-40"};export const Footer=/*@__PURE__*/t.forwardRef(function Footer(t,l){const{position:x="static",safeArea:u=!0,variant:v="outline",size:y="md",color:w="primary",density:g="default",elevation:j=0,divider:h=!0,maxWidth:z,padded:N=!0,label:k,render:F,className:A,style:B,children:R,...W}=p(t,["size","density","variant"]),q=s("footer",l,x),C=n("w-full min-w-0",b[v],h?"border-t [border-color:var(--n-line)]":"",c[x],u&&"static"!==x?"pb-[env(safe-area-inset-bottom)]":"",d,A);return r({render:F??e("footer",{}),ref:q,props:{"aria-label":k,className:C,style:{...m(w,j),...B},children:e("div",{className:n("w-full",N?n(a[g][y],o[g][y]):"","neba-measure mx-auto max-w-(--n-max-w)"),style:f("max-w",z,i),children:R}),...W}})});
|
|
@@ -36,11 +36,17 @@ export interface FormProps extends Omit<React.ComponentPropsWithoutRef<'form'>,
|
|
|
36
36
|
*/
|
|
37
37
|
onSubmit?: (values: Record<string, unknown>) => void;
|
|
38
38
|
/**
|
|
39
|
-
* The gap between the form's children
|
|
40
|
-
* rung of the ladder it stacks on.
|
|
39
|
+
* The gap between the form's children, when `spacing` is not given. A form is
|
|
40
|
+
* a stack, and this is which rung of the ladder it stacks on.
|
|
41
41
|
* @default 'md'
|
|
42
42
|
*/
|
|
43
43
|
size?: NebaSize;
|
|
44
|
+
/**
|
|
45
|
+
* The gap between the form's children as an exact length, on Tailwind's
|
|
46
|
+
* spacing scale: `5` is `1.25rem`, the same step `gap-5` is. Takes over from
|
|
47
|
+
* the gap `size` picks, and a `NebaProvider` can set it for every Form.
|
|
48
|
+
*/
|
|
49
|
+
spacing?: number;
|
|
44
50
|
children?: React.ReactNode;
|
|
45
51
|
}
|
|
46
52
|
export declare const Form: React.ForwardRefExoticComponent<FormProps & React.RefAttributes<HTMLFormElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{Form as t}from"@base-ui/react/form";import{cx as o,sheetSectionGapClasses as n}from"../../internal/styles.js";import{useStyleDefaults as a}from"../../internal/defaults.js";export const Form=/*@__PURE__*/r.forwardRef(function Form(r,
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{Form as t}from"@base-ui/react/form";import{cx as o,sheetSectionGapClasses as n}from"../../internal/styles.js";import{spacingValue as i}from"../../internal/grid.js";import{useStyleDefaults as a}from"../../internal/defaults.js";export const Form=/*@__PURE__*/r.forwardRef(function Form(r,s){const{validationMode:m="onSubmit",errors:l,onSubmit:c,size:f="md",spacing:d,className:u,style:p,children:g,...b}=a(r,["size","spacing"]);return e(t,{ref:s,validationMode:m,errors:l,onFormSubmit:c?(e,r)=>c(function(e,r){if(!(r instanceof HTMLFormElement))return e;const t=r.querySelectorAll("input[data-neba-repeats][name]:not(:disabled)");if(0===t.length)return e;const o=new FormData(r),n={...e};for(const e of t)n[e.name]=o.getAll(e.name);return n}(e,r.event.target)):void 0,className:o("flex flex-col",void 0===d?n[f]:"",u??""),style:void 0===d?p:{gap:i(d),...p},...b,children:g})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as o from"react";import{Image as r}from"../image/Image.js";import{breakpoints as a,hiddenBelowClasses as l,hiddenFromClasses as n,responsiveSlots as s,valueAt as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as o from"react";import{Image as r}from"../image/Image.js";import{breakpoints as a,hiddenBelowClasses as l,hiddenFromClasses as n,responsiveSlots as s,valueAt as c,withBaseline as u}from"../../internal/responsive.js";import{useBreakpointValue as d}from"../../hooks/useMediaQuery.js";import{useHydrated as m}from"../../internal/media.js";import{fillMessage as p,galleryMessages as f,useMessages as h}from"../../internal/i18n.js";import{cx as g,hasContent as b,metaTextClasses as x,radiusClasses as v,sheetTitleClasses as w,toLength as y,transitionClasses as k}from"../../internal/styles.js";import{useStyleDefaults as j}from"../../internal/defaults.js";let M;export const viewerChunk={load:()=>(M??=import("./GalleryViewer.js").then(e=>({default:e.GalleryViewer})).catch(e=>{throw M=void 0,e}),M)};const N=o.lazy(()=>viewerChunk.load()),$={xs:2,sm:3,lg:4},S={xs:"0.25rem",sm:"0.375rem",md:"0.5rem",lg:"0.75rem",xl:"1rem"};function _(e,t){if(void 0===e)return t;if("number"==typeof e)return e>0?e:t;const[i,o]=e.split("/"),r=void 0===o?Number(i):Number(i)/Number(o);return Number.isFinite(r)&&r>0?r:t}export function isSideways(e){return Math.abs(Math.round((e.rotate??0)/90))%2==1}export function shownRatioOf(e,t){const i=_(e.ratio,t);return void 0!==e.ratio&&isSideways(e)?1/i:i}const R={none:"",lift:"group-hover/tile:[box-shadow:var(--neba-shadow-2)] group-has-[:focus-visible]/tile:[box-shadow:var(--neba-shadow-2)] supports-[not_selector(:has(*))]:group-focus-within/tile:[box-shadow:var(--neba-shadow-2)]",dim:"",zoom:""},z={none:"",lift:"",dim:"group-hover/tile:[filter:brightness(0.82)] group-has-[:focus-visible]/tile:[filter:brightness(0.82)] supports-[not_selector(:has(*))]:group-focus-within/tile:[filter:brightness(0.82)]",zoom:"group-hover/tile:[transform:scale(1.06)] group-has-[:focus-visible]/tile:[transform:scale(1.06)] supports-[not_selector(:has(*))]:group-focus-within/tile:[transform:scale(1.06)]"};function MasonryLanes({items:t,lanes:i,fallbackRatio:o,space:r,tile:s}){const u=Math.max(1,d(i)??2),p=m(),f=t.map(e=>shownRatioOf(e,o)),h=(i,o)=>function(e,t){const i=Array.from({length:t},()=>[]),o=new Array(t).fill(0);return e.forEach((e,r)=>{let a=0;for(let e=1;e<t;e+=1)o[e]<o[a]&&(a=e);i[a].push(r),o[a]+=1/e}),i}(f,i).map((a,l)=>e("li",{className:g("m-0 flex min-w-0 flex-1 list-none flex-col",o),style:{gap:r},children:e("ul",{className:"m-0 flex list-none flex-col p-0",style:{gap:r},children:a.map(e=>s(t[e],e,{}))})},`${i}-${l}`)),b=a.map(e=>({breakpoint:e,count:Math.max(1,Math.round(c(i,e)??2))})),x=b.filter((e,t)=>0===t||e.count!==b[t-1].count);return p||1===x.length?h(Math.max(1,Math.round(u)),""):x.flatMap((e,t)=>{const i=x[t+1];return h(e.count,g(l[e.breakpoint],i?n[i.breakpoint]:""))})}export const Gallery=/*@__PURE__*/o.forwardRef(function Gallery(a,l){const{items:n,layout:c="grid",columns:d,gap:m="md",ratio:M=1,rowHeight:C=220,rounded:q="md",fit:F="cover",letterbox:G,loading:A="lazy",priority:I=0,caption:O="none",hover:E="lift",preview:T=!1,onItemSelect:L,filter:P,frame:V,watermark:B,protect:H=!1,label:Q,locale:W,empty:D,className:J,classNames:K,style:U,onPointerEnter:X,onFocus:Y,onTouchStart:Z,...ee}=j(a,["locale"]),te=h(f,W),ie=o.useId(),[oe,re]=o.useState(null),[ae,le]=o.useState(!1),ne=o.useRef(!1),se=()=>{T&&!ne.current&&(ne.current=!0,viewerChunk.load().catch(()=>{}))},ce=u(d??$,2),ue="string"==typeof m&&m in S?S[m]:y(m)??S.md,de=!1===q?"":v[!0===q?"md":q],me=_(M,1),pe=(o,a,l)=>{const s=b(o.title)||b(o.description),u="none"!==O&&s,d="overlay"===O||"hover"===O,m=`${ie}-${a}-title`,f=`${ie}-${a}-description`,h=`${ie}-${a}-position`,v=p(te.item,{index:String(a+1),total:String(n.length)}),y=a<I,j=e(r,{src:o.src,srcSet:o.srcSet,sizes:o.sizes,alt:o.alt,ratio:"grid"===c?M:"quilted"===c?"auto":void 0!==o.ratio&&isSideways(o)?shownRatioOf(o,me):o.ratio??M,fit:F,position:o.position,letterbox:G,rotate:o.rotate,flip:o.flip,placeholder:o.placeholder,loading:y?void 0:A,priority:y,rounded:!1,filter:P,frame:V,watermark:B,protect:H,className:g("size-full",K?.image),classNames:{image:g("motion-reduce:[transition-duration:0ms]",z[E])}}),N=u?t("span",{className:g("min-w-0",d?g("pointer-events-none absolute inset-x-0 bottom-0 flex flex-col gap-0.5 p-2.5 text-white","[background:linear-gradient(to_top,color-mix(in_oklab,#000_72%,transparent),transparent)]","hover"===O?"opacity-0 group-hover/tile:opacity-100 group-has-[:focus-visible]/tile:opacity-100 supports-[not_selector(:has(*))]:group-focus-within/tile:opacity-100 [@media(hover:none)]:opacity-100 [transition:opacity_var(--neba-duration-fill)_var(--neba-ease)]":""):"flex flex-col gap-0.5 pt-1.5",K?.caption),children:[b(o.title)?e("span",{id:m,className:g("truncate font-medium",w.sm,d?"":"text-(--neba-fg)",K?.title),children:o.title}):null,b(o.description)?e("span",{id:f,className:g("truncate",x.md,d?"text-white/80":"text-(--neba-muted-fg)",K?.description),children:o.description}):null]}):null,$=t("span",{className:g("relative block overflow-hidden",de,"quilted"===c||"justified"===c?"size-full":"","[transition:box-shadow_var(--neba-duration)_var(--neba-ease)]",R[E]),children:[j,d?N:null]}),S=d||!u?$:t(i,{children:[$,N]});return e("li",{className:g("group/tile relative m-0 min-w-0 list-none","justified"===c?"flex flex-col":"",K?.item),style:l,children:T||L?t("button",{type:"button","aria-label":u?void 0:`${o.alt} — ${v}`,"aria-labelledby":u?`${b(o.title)?m:f} ${h}`:void 0,"aria-haspopup":T?"dialog":void 0,"aria-describedby":u&&b(o.title)&&b(o.description)?f:void 0,className:g("block w-full text-start",T?"cursor-zoom-in":"cursor-pointer",k,"focus-visible:[outline:2px_solid_var(--n-ring,var(--neba-primary-ring))] focus-visible:[outline-offset:2px]",de,"justified"===c?"flex-1":""),onClick:()=>(e=>{L?.(n[e],e),T&&(le(!0),re(e))})(a),children:[S,u?e("span",{id:h,hidden:!0,children:v}):null]}):S},o.id??o.src)},fe=g("neba-gallery m-0 list-none p-0","justified"===c?"neba-gallery-justified flex flex-wrap":"","masonry"===c?"flex items-start":"","grid"===c||"quilted"===c?"grid":"",J??""),he={gap:ue,...s("cols",ce,e=>String(Math.max(1,Math.round(e)))),..."grid"===c||"quilted"===c?{gridTemplateColumns:"repeat(var(--n-cols), minmax(0, 1fr))"}:null,..."quilted"===c?{gridAutoRows:`${C}px`,gridAutoFlow:"dense"}:null,...U};let ge;return ge="masonry"===c?e(MasonryLanes,{items:n,lanes:ce,fallbackRatio:me,space:ue,tile:pe}):"justified"===c?n.map((e,t)=>{const i=shownRatioOf(e,me);return pe(e,t,{flexGrow:i,flexBasis:i*C+"px",maxWidth:"100%"})}):n.map((e,t)=>pe(e,t,"quilted"===c?{gridColumn:`span ${Math.max(1,Math.round(e.cols??1))}`,gridRow:`span ${Math.max(1,Math.round(e.rows??1))}`}:{})),0===n.length&&b(D)?e(i,{children:D}):t(i,{children:[e("ul",{ref:l,role:"list","aria-label":Q??te.label,className:fe,style:he,...ee,onPointerEnter:e=>{se(),X?.(e)},onFocus:e=>{se(),Y?.(e)},onTouchStart:e=>{se(),Z?.(e)},children:ge}),T&&ae?e(o.Suspense,{fallback:null,children:e(N,{items:n,index:oe,onIndexChange:re,locale:W,watermark:B,protect:H,messages:te})}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import*as n from"react";import{ChartSurface as r,useMeasuredWidth as l,chartHeight as s,useMeasuredHeight as
|
|
1
|
+
"use client";import{jsx as t,jsxs as a,Fragment as e}from"react/jsx-runtime";import*as n from"react";import{ChartSurface as r,useMeasuredWidth as l,chartHeight as i,initialWidthFor as s,useMeasuredHeight as o}from"../../internal/chart-frame.js";import{arcPath as m,chartFontSizes as h,compactNumber as c,ringPath as f,textWidth as u,truncate as d}from"../../internal/chart.js";import{numberFormatter as x}from"../../internal/format.js";import{emptyMessages as p,useMessages as M}from"../../internal/i18n.js";import{thresholdColor as g}from"../../internal/progress.js";import{cx as b,hasContent as v,metaTextClasses as y}from"../../internal/styles.js";import{useStyleDefaults as j}from"../../internal/defaults.js";import{useIntlLocale as N}from"../../internal/media.js";function k(t,a,e,n){const r=(n-90)*Math.PI/180;return[t+e*Math.cos(r),a+e*Math.sin(r)]}export function GaugeChart(w){const{value:z,min:S=0,max:W=100,sweep:$=180,thickness:q=.22,thresholds:A,ticks:B=!1,showRange:C=!0,center:D,caption:I,height:L,initialWidth:P,format:R,locale:F,label:G,empty:Y,size:E="md",variant:H="text",color:J="primary",padded:K=!1,className:O,...Q}=j(w,["size","variant","locale"]),T=n.useRef(null),U=l(T,{initial:s(P,L)}),V=M(p,F),X=N(F),Z=n.useCallback(t=>R?x(X,R).format(t):c(t,X),[R,X]),_=Math.max(1,Math.min(360,$)),tt=_/2,at=-tt,et=tt,nt=W-S,rt=null===z||Number.isNaN(z)||0===nt?null:Math.min(1,Math.max(0,(z-S)/nt)),lt=null===z?J:g(z,J,A),it=o(T,"string"==typeof L),st=i(L,E,it),ot=h[E],mt=Math.min(.9,Math.max(.05,q)),ht=tt*Math.PI/180,ct=_>=360?1:Math.max(0,-Math.cos(ht)),ft=_>=180?1:Math.sin(ht),ut=Math.sin(ht),dt=-Math.cos(ht),xt=C&&_<330?[S,W].map(t=>d(Z(t),Math.max(0,.28*U),ot)):[],pt=xt.reduce((t,a)=>Math.max(t,u(a,ot)),0),Mt=.35*ot,gt=!1===B?0:.85*ot,bt=dt<=.25,vt=bt?0:.5*ot,yt=bt?ot:ot*(.35+.55*dt),jt=xt.length>0?dt*vt+yt+.25*ot:0,Nt=Math.max(Mt,gt),kt=Math.max(Mt,gt),wt=Math.max(Mt,gt,jt),zt=[(U/2-Nt)/Math.max(.05,ft),(st-kt-wt)/(1+ct)];if(pt>0&&ut>.05){const t=bt?pt/2:pt;zt.push(Math.max(0,U/2-Mt-t)/ut-vt)}const St=Math.max(0,Math.min(...zt)),Wt=St*(1-mt),$t=U/2,qt=kt+St*(1+ct)+wt,At=kt+St+Math.max(0,(st-qt)/2),Bt=U>0,Ct=0===nt||Bt&&St<=0,Dt=v(I)?1.85*ot:0,It=At-Wt*(1-Math.min(1,ct))/2,Lt=Math.min(Wt,Math.abs(At-It)),Pt=Math.min(Wt,Math.abs(At-It-Dt/2)),Rt=2*Math.sqrt(Math.max(0,Wt*Wt-Pt*Pt)),Ft=D??(null===z?"—":Z(z)),Gt="string"==typeof Ft?u(Ft,1):0,Yt=Gt>0?Math.max(ot,Math.min(2*ot,function(t,a,e,n,r){const l=t*t/(4*r*r)+n*n,i=2*a*n,s=a*a-e*e;return l<=0||s>=0?0:(Math.sqrt(i*i-4*l*s)-i)/(2*l)}(Gt,Lt,Wt,.42,.86))):2*ot,Et=!1===B?0:Math.max(2,Math.floor(B));return t(r,{...Q,variant:H,color:J,size:E,padded:K,legendSide:"bottom",className:O,legend:null,table:null,children:t("div",{ref:T,className:"relative w-full",style:{height:"string"==typeof L?L:st},...void 0===G?{}:null===rt||null===z?{role:"img","aria-label":G}:{role:"meter","aria-label":G,"aria-valuenow":z,"aria-valuemin":S,"aria-valuemax":W,"aria-valuetext":["string"==typeof Ft||"number"==typeof Ft?String(Ft):Z(z),"string"==typeof I||"number"==typeof I?String(I):""].filter(Boolean).join(" ")},children:Ct?t("div",{className:b("flex h-full items-center justify-center text-(--neba-muted-fg)",y[E]),children:Y??V.title}):Bt?a(e,{children:[a("svg",{width:U,height:st,viewBox:`0 0 ${U} ${st}`,"aria-hidden":"true",className:"block",children:[t("path",{d:m($t,At,St,Wt,at,et),fill:`var(--neba-${J}-soft)`}),null!==rt?t("path",{d:f($t,At,(St+Wt)/2,at,et),fill:"none",stroke:`var(--neba-${lt}-fill)`,strokeWidth:St-Wt,pathLength:"1",strokeDasharray:"1",strokeDashoffset:1-rt,style:{transition:"stroke-dashoffset var(--neba-duration-fill) var(--neba-ease), stroke var(--neba-duration) var(--neba-ease)"}}):null,Et>0?Array.from({length:Et},(a,e)=>{const n=at+_*e/(Et-1),[r,l]=k($t,At,St+.25*ot,n),[i,s]=k($t,At,St+.6*ot,n);return t("line",{x1:r,y1:l,x2:i,y2:s,stroke:"var(--neba-chart-grid)",strokeWidth:1,strokeLinecap:"round"},e)}):null,xt.length>0?[[xt[0],at,"start"],[xt[1],et,"end"]].map(([a,e,n])=>{const[r,l]=k($t,At,St+vt,e);return t("text",{x:r,y:l+yt,textAnchor:bt?"middle":"start"===n?"end":"start",fontSize:ot,fill:"var(--neba-muted-fg)",children:a},n)}):null]}),a("div",{className:"pointer-events-none absolute inset-x-0 mx-auto flex flex-col items-center gap-0.5 text-center",style:{top:It+Dt/2,maxWidth:Rt,transform:"translateY(-50%)"},children:[t("span",{className:"font-semibold tabular-nums text-(--neba-fg)",style:{fontSize:Yt},children:Ft}),I?t("span",{className:b("text-(--neba-muted-fg)",y[E]),children:I}):null]})]}):a("div",{className:"flex h-full flex-col items-center justify-center gap-0.5 text-center",children:[t("span",{className:"font-semibold tabular-nums text-(--neba-fg)",style:{fontSize:2*ot},children:Ft}),I?t("span",{className:b("text-(--neba-muted-fg)",y[E]),children:I}):null]})})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useRender as t}from"@base-ui/react/use-render";import{boxPaddingXClasses as n}from"../box/Box.js";import{useBarRef as s}from"../../internal/page-layout.js";import{cx as i,hasContent as l,measureValue as m,surfaceClasses as d,surfaceSlots as o,transitionClasses as c}from"../../internal/styles.js";import{responsiveSlots as x}from"../../internal/responsive.js";import{useStyleDefaults as f}from"../../internal/defaults.js";const p={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-20"},u={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-5"},g={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-8",xl:"gap-10"},h={solid:d+" text-(--neba-fg) bg-(--n-panel-press) [box-shadow:var(--n-elev),var(--neba-plate-solid)]",outline:d+" text-(--neba-fg) bg-(--n-panel) [box-shadow:var(--n-elev),var(--neba-plate-glass)]",text:"text-(--neba-fg) bg-transparent"},b={static:"",sticky:"sticky top-0 z-30",fixed:"fixed inset-x-0 top-0 z-40"},v={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},y={start:"flex min-w-0 flex-1 items-center justify-start",center:"flex min-w-0 shrink items-center justify-center",end:"flex min-w-0 flex-1 items-center justify-end"};export const Header=/*@__PURE__*/r.forwardRef(function Header(r,d){const{brand:w,actions:j,align:N="start",position:k="sticky",variant:z="outline",size:H="md",color:B="primary",density:R="default",elevation:W=0,divider:q=!0,maxWidth:A,padded:C=!0,label:D,render:E,className:F,style:G,children:I,...J}=f(r,["size","density","variant"]),K=s("header",d,k),L=i("w-full min-w-0",h[z],q?"border-b [border-color:var(--n-line)]":"",b[k],c,F);return t({render:E??e("header",{}),ref:K,props:{"aria-label":D,className:L,style:{...o(B,W),...G},children:a("div",{className:i("flex w-full items-center",p[H],g[H],C?n[R][H]:"","neba-measure mx-auto max-w-(--n-max-w)"),style:x("max-w",A,m),children:[l(w)?e("div",{className:i("flex min-w-0 items-center",v[N],u[H]),children:w}):"center"===N?e("div",{"aria-hidden":"true",className:v[N]}):null,l(I)?e("div",{className:i(y[N],u[H]),children:I}):null,l(j)?e("div",{className:i("flex min-w-0 items-center justify-end",v[N],u[H]),children:j}):"center"===N?e("div",{"aria-hidden":"true",className:v[N]}):null]}),...J}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{chartTableClasses as l,ChartExport as i,ChartScaleLegend as a,ChartStatus as r,ChartSummary as o,ChartSurface as d,ChartTooltipPanel as s,markTransitionClasses as h,summarise as m,useDeferredRows as c,useMeasuredWidth as u,useReleaseOutside as x,chartHeight as f,useMeasuredHeight as p}from"../../internal/chart-frame.js";import{categoryAt as g,chartFontSizes as w,compactNumber as v,formatCategory as b,markGap as y,rampFill as M,rampInk as k,rampStep as A,rampSteps as $,squarify as N,textWidth as j,toValues as z,truncate as E,turnedAxis as S}from"../../internal/chart.js";import{numberFormatter as B}from"../../internal/format.js";import{cx as C,metaTextClasses as D}from"../../internal/styles.js";import{chartMessages as I,emptyMessages as F,useMessages as L}from"../../internal/i18n.js";import{useStyleDefaults as W}from"../../internal/defaults.js";import{useIntlLocale as H}from"../../internal/media.js";export function HeatmapChart(l){const{series:c,categories:T,shape:U="grid",scale:_="sequential",midpoint:q=0,min:J,max:K,valueLabels:O="none",xAxis:G,yAxis:Q,height:V,format:X,locale:Y,label:Z,legend:ee,tooltip:te,empty:ne,exportable:le=!1,exportFileName:ie="chart.csv",onExport:ae,size:re="md",variant:oe="text",padded:de=!1,className:se,...he}=W(l,["size","variant","locale"]),me=n.useRef(null),ce=u(me),ue=L(F,Y),xe=L(I,Y),fe=H(Y),pe=n.useId(),[ge,we]=n.useState(null);x(me,null!==ge,()=>we(null));const ve=n.useId(),be=X?JSON.stringify(X):"",ye=n.useCallback(e=>X?B(fe,X).format(e):v(e,fe),[be,fe]),Me=n.useMemo(()=>z(c),[c]),ke=Me.reduce((e,t)=>Math.max(e,t.length),0),Ae=n.useMemo(()=>Array.from({length:ke},(e,t)=>g(t,T,Me)),[ke,T,Me]),$e=n.useMemo(()=>c.map((e,t)=>e.name??`${t+1}`),[c]),Ne=n.useMemo(()=>{let e=1/0,t=-1/0,n=!1;for(const l of Me)for(const i of l)null!==i.value&&(n=!0,e=Math.min(e,i.value),t=Math.max(t,i.value));return n?{min:e,max:t}:null},[Me]),je=J??Ne?.min??0,ze=K??Ne?.max??1,Ee=n.useCallback(e=>A(e,je,ze,_,q),[je,ze,_,q]),Se=p(me,"string"==typeof V),Be=f(V,re,Se),Ce=w[re],De=!0===ee||void 0===ee||!1===ee?{}:ee,Ie=!1!==ee,Fe=De.side??"bottom",Le=!1===te?{mode:"none"}:!0===te||void 0===te?{}:te,We="none"===Le.mode,He=null===Ne||0===ke||0===c.length,Pe=Q?.tickFormat,Re="treemap"===U||Q?.hidden,Te=n.useMemo(()=>{if(Re||ce<=0)return{texts:[],band:0};const e=Math.min(150,.25*ce),t=$e.map((t,n)=>E(Pe?String(Pe(t,n)):t,e,Ce));return{texts:t,band:t.reduce((e,t)=>Math.max(e,j(t,Ce)),0)+10}},[Re,$e,Pe,ce,Ce]),Ue="treemap"===U?0:G?.tickAngle,_e=n.useMemo(()=>S(Ue,Ce),[Ue,Ce]),qe=G?.tickFormat,Je=n.useMemo(()=>Ae.map((e,t)=>qe?String(qe(e,t)):b(e,fe)),[Ae,qe,fe]),Ke=Math.min(140,.4*Be),Oe=n.useMemo(()=>0===_e.angle?Je:Je.map(e=>E(e,_e.cut(Ke),Ce)),[Je,_e,Ke,Ce]),Ge=Oe.reduce((e,t)=>Math.max(e,j(t,Ce)),0),Qe=Ce+6,Ve="treemap"===U||G?.hidden?0:_e.depth(Ge)+8+(G?.label?Qe:0),Xe=Boolean(Q?.label)&&!Re,Ye=(Xe?Qe+2:0)+(le?20:0),Ze={left:Q?.thickness??Te.band,top:Ye,width:Math.max(0,ce-(Q?.thickness??Te.band)),height:Math.max(0,Be-(G?.thickness??Ve)-Ye)},et=n.useMemo(()=>{if(Ze.width<=0||Ze.height<=0)return[];if("treemap"===U){const e=[];return Me.forEach((t,n)=>t.forEach((t,l)=>{null!==t.value&&e.push({row:n,index:l,cell:t})})),N(e.map(e=>Math.max(0,e.cell.value??0)),Ze.width,Ze.height).map(t=>({row:e[t.index].row,index:e[t.index].index,cell:e[t.index].cell,x:Ze.left+t.x,y:Ze.top+t.y,width:t.width,height:t.height}))}const e=Ze.height/Math.max(1,c.length),t=Ze.width/Math.max(1,ke),n=[];return Me.forEach((l,i)=>l.forEach((l,a)=>{null!==l.value&&n.push({row:i,index:a,cell:l,x:Ze.left+a*t,y:Ze.top+i*e,width:t,height:e})})),n},[U,Me,c.length,ke,Ze.left,Ze.top,Ze.width,Ze.height]),tt=n.useCallback(e=>b(e.cell.x??T?.[e.index]??Ae[e.index]??e.index,fe),[T,Ae,fe]),nt=n.useMemo(()=>{const e=Me.reduce((e,t)=>e+t.length,0);if("treemap"!==U)return{heads:Ae.map(e=>b(e,fe)),rows:Me.map(e=>Ae.map((t,n)=>e[n])),points:e};const t=[],n=new Map,l=Me.map(e=>{const l=[];return e.forEach((e,i)=>{const a=b(e.x??T?.[i]??Ae[i]??i,fe);let r=n.get(a);void 0===r&&(r=t.length,n.set(a,r),t.push(a)),l[r]=e}),l});return{heads:t,rows:l,points:e}},[U,Ae,Me,T,fe]),lt=null===ge?null:et.find(e=>e.row===ge.row&&e.index===ge.index)??null,it=null===lt?[]:[{seriesIndex:lt.row,color:lt.cell.color??M(Ee(lt.cell.value??0),_),value:lt.cell.value,formatted:ye(lt.cell.value??0),label:lt.cell.label}],at=Array.from({length:$},(e,t)=>M(t,_));return t(d,{...he,size:re,variant:oe,padded:de,className:se,legendSide:Fe,legend:Ie&&!He?e(a,{steps:at,from:ye("diverging"===_?-R(je,ze,q)+q:je),to:ye("diverging"===_?R(je,ze,q)+q:ze),middle:"diverging"===_?ye(q):void 0,align:De.align??"center",vertical:"left"===Fe||"right"===Fe,size:re}):null,table:He?null:e(P,{id:pe,caption:Z,heads:nt.heads,rows:nt.rows,names:$e,points:nt.points,format:ye}),children:[le&&!He?e(i,{rows:()=>[["",...nt.heads],...nt.rows.map((e,t)=>[$e[t],...nt.heads.map((t,n)=>e[n]?.value??null)])],fileName:ie,onExport:ae,label:xe.exportCsv}):null,t("div",{ref:me,role:"img",tabIndex:He?void 0:0,"aria-label":Z??xe.label,"aria-describedby":He?void 0:ve,onPointerLeave:e=>{"touch"!==e.pointerType&&we(null)},onBlur:()=>we(null),onKeyDown:e=>{if(We||0===et.length)return;const t=null===ge?-1:et.findIndex(e=>e.row===ge.row&&e.index===ge.index),n="treemap"!==U&&-1!==t,l="ArrowRight"===e.key||"ArrowDown"===e.key;if(!n||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)if(l||"ArrowLeft"===e.key||"ArrowUp"===e.key){const e=l?et[Math.min(et.length-1,t+1)]:et[Math.max(0,(-1===t?et.length:t)-1)];we({row:e.row,index:e.index})}else{if("Escape"!==e.key)return;we(null)}else{const n=et[t],l="ArrowDown"===e.key,i=et.filter(e=>e.index===n.index&&(l?e.row>n.row:e.row<n.row)).sort((e,t)=>l?e.row-t.row:t.row-e.row)[0];i&&we({row:i.row,index:i.index})}e.preventDefault()},className:C("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:"string"==typeof V?V:Be},children:[He?e("div",{className:C("flex h-full items-center justify-center text-(--neba-muted-fg)",D[re]),children:ne??ue.title}):ce>0?t("svg",{width:ce,height:Be,viewBox:`0 0 ${ce} ${Be}`,"aria-hidden":"true",className:"block",children:[et.map(n=>{const l=Ee(n.cell.value??0),i=ge?.row===n.row&&ge?.index===n.index,a=Math.max(0,n.width-y),r=Math.max(0,n.height-y);if(a<=0||r<=0)return null;const o=ye(n.cell.value??0),d="treemap"===U?"all"===O?[tt(n),o]:[tt(n)]:"all"===O?[o]:[],s=d.filter(e=>function(e,t,n,l){return n>=1.8*l&&t>=Math.min(j(e,l),2.5*l)+8}(e,a,r/d.length,Ce)),m=n.cell.color?"var(--neba-surface)":k(l,_);return t("g",{children:[e("rect",{x:n.x+y/2,y:n.y+y/2,width:a,height:r,rx:Math.min(3,a/2,r/2),fill:n.cell.color??M(l,_),opacity:i?1:.94,onPointerEnter:We?void 0:()=>we({row:n.row,index:n.index}),className:h}),s.map((t,l)=>e("text",{x:n.x+n.width/2,y:n.y+n.height/2+(l-(s.length-1)/2)*(Ce+2),textAnchor:"middle",dominantBaseline:"central",fontSize:Ce,fontWeight:0===l?500:400,fill:m,opacity:0===l?1:.85,pointerEvents:"none",className:0===l&&"treemap"===U?void 0:"tabular-nums",children:E(t,n.width-8,Ce)},l))]},`${n.row}-${n.index}`)}),"grid"!==U||Q?.hidden?null:Te.texts.map((t,n)=>e("text",{x:Ze.left-8,y:Ze.top+(n+.5)*Ze.height/Math.max(1,c.length),textAnchor:"end",dominantBaseline:"central",fontSize:Ce,fill:"var(--neba-muted-fg)",children:t},`row-${n}`)),"grid"!==U||G?.hidden?null:Oe.map((t,n)=>{const l=Ze.width/Math.max(1,ke);if(n%Math.max(1,Math.ceil(_e.room(Ge)/Math.max(1,l)))!==0)return null;const i=Ze.left+(n+.5)*l,a=Ze.top+Ze.height+_e.offset-6;return e("text",{x:i,y:a,textAnchor:_e.anchor,transform:0===_e.angle?void 0:`rotate(${_e.angle} ${i} ${a})`,dominantBaseline:0===_e.angle?void 0:"central",fontSize:Ce,fill:"var(--neba-muted-fg)",children:t},`col-${n}`)}),Xe?e("text",{x:Ze.left,y:Ce+2,textAnchor:"start",fontSize:Ce,fill:"var(--neba-muted-fg)",fontWeight:500,children:Q?.label}):null,"grid"===U&&G?.label&&!G.hidden?e("text",{x:Ze.left+Ze.width,y:Ze.top+Ze.height+_e.depth(Ge)+Ce+8,textAnchor:"end",fontSize:Ce,fill:"var(--neba-muted-fg)",fontWeight:500,children:G.label}):null]}):null,lt&&!We?Le.render?e("div",{className:"pointer-events-none absolute z-10",style:{left:lt.x+lt.width/2,top:lt.y},children:Le.render({index:lt.index,category:lt.cell.x??Ae[lt.index]??lt.index,items:it})}):e(s,{heading:`${$e[lt.row]} · ${tt(lt)}`,items:it,x:lt.x+lt.width/2,y:lt.y,flip:lt.x+lt.width/2>.6*ce,size:re}):null]}),He?null:e(o,{id:ve,template:xe.summary,locale:fe,...m(Me,ye)}),We?null:e(r,{heading:lt?`${$e[lt.row]} · ${tt(lt)}`:void 0,items:it})]})}const P=/*@__PURE__*/n.memo(function HeatmapTable({id:n,caption:i,heads:a,rows:r,names:o,points:d,format:s}){const h=c({rows:r.length,points:d,columns:a.length+1});return t("table",{id:n,className:l,"aria-busy":h<r.length||void 0,children:[i?e("caption",{children:i}):null,e("thead",{children:t("tr",{children:[e("th",{scope:"col"}),a.map((t,n)=>e("th",{scope:"col",children:t},n))]})}),e("tbody",{children:r.slice(0,h).map((n,l)=>t("tr",{children:[e("th",{scope:"row",children:o[l]}),a.map((t,l)=>{const i=n[l];return e("td",{children:void 0!==i?.label?i.label:null==i?.value?"":s(i.value)},l)})]},l))})]})});function R(e,t,n){return Math.max(Math.abs(t-n),Math.abs(n-e))}
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as l from"react";import{chartTableClasses as i,ChartExport as r,ChartScaleLegend as a,ChartStatus as o,ChartSummary as s,ChartSurface as d,ChartTooltipPanel as h,markTransitionClasses as c,summarise as m,tableRuns as u,useDeferredRows as f,useMeasuredWidth as x,useReleaseOutside as p,chartHeight as g,initialWidthFor as w,useMeasuredHeight as v}from"../../internal/chart-frame.js";import{categoryAt as b,chartFontSizes as y,compactNumber as M,formatCategory as k,markGap as A,rampFill as N,rampInk as $,rampStep as z,rampSteps as S,squarify as j,textWidth as E,toValues as B,truncate as C,turnedAxis as D}from"../../internal/chart.js";import{numberFormatter as I}from"../../internal/format.js";import{cx as F,metaTextClasses as W}from"../../internal/styles.js";import{chartMessages as L,emptyMessages as H,useMessages as O}from"../../internal/i18n.js";import{useStyleDefaults as P}from"../../internal/defaults.js";import{useIntlLocale as R}from"../../internal/media.js";export function HeatmapChart(n){const{series:i,categories:c,shape:u="grid",scale:f="sequential",midpoint:K=0,min:G,max:Q,valueLabels:V="none",xAxis:X,yAxis:Y,height:Z,initialWidth:ee,format:te,locale:ne,label:le,legend:ie,tooltip:re,empty:ae,exportable:oe=!1,exportFileName:se="chart.csv",onExport:de,size:he="md",variant:ce="text",padded:me=!1,className:ue,...fe}=P(n,["size","variant","locale"]),xe=l.useRef(null),pe=x(xe,{initial:w(ee,Z)}),ge=O(H,ne),we=O(L,ne),ve=R(ne),be=l.useId(),[ye,Me]=l.useState(null);p(xe,null!==ye,()=>Me(null));const ke=l.useId(),Ae=te?JSON.stringify(te):"",Ne=l.useCallback(e=>te?I(ve,te).format(e):M(e,ve),[Ae,ve]),$e=l.useMemo(()=>B(i),[i]),ze=$e.reduce((e,t)=>Math.max(e,t.length),0),Se=l.useMemo(()=>Array.from({length:ze},(e,t)=>b(t,c,$e)),[ze,c,$e]),je=l.useMemo(()=>i.map((e,t)=>e.name??`${t+1}`),[i]),Ee=l.useMemo(()=>{let e=1/0,t=-1/0,n=!1;for(const l of $e)for(const i of l)null!==i.value&&(n=!0,e=Math.min(e,i.value),t=Math.max(t,i.value));return n?{min:e,max:t}:null},[$e]),Be=G??Ee?.min??0,Ce=Q??Ee?.max??1,De=l.useCallback(e=>z(e,Be,Ce,f,K),[Be,Ce,f,K]),Ie=v(xe,"string"==typeof Z),Fe=g(Z,he,Ie),We=y[he],Le=!0===ie||void 0===ie||!1===ie?{}:ie,He=!1!==ie,Oe=Le.side??"bottom",Pe=!1===re?{mode:"none"}:!0===re||void 0===re?{}:re,Re="none"===Pe.mode,Te=null===Ee||0===ze||0===i.length,Ue=Y?.tickFormat,_e="treemap"===u||Y?.hidden,qe=l.useMemo(()=>{if(_e||pe<=0)return{texts:[],band:0};const e=Math.min(150,.25*pe),t=je.map((t,n)=>C(Ue?String(Ue(t,n)):t,e,We));return{texts:t,band:t.reduce((e,t)=>Math.max(e,E(t,We)),0)+10}},[_e,je,Ue,pe,We]),Je="treemap"===u?0:X?.tickAngle,Ke=l.useMemo(()=>D(Je,We),[Je,We]),Ge=X?.tickFormat,Qe=l.useMemo(()=>Se.map((e,t)=>Ge?String(Ge(e,t)):k(e,ve)),[Se,Ge,ve]),Ve=Math.min(140,.4*Fe),Xe=l.useMemo(()=>0===Ke.angle?Qe:Qe.map(e=>C(e,Ke.cut(Ve),We)),[Qe,Ke,Ve,We]),Ye=Xe.reduce((e,t)=>Math.max(e,E(t,We)),0),Ze=We+6,et="treemap"===u||X?.hidden?0:Ke.depth(Ye)+8+(X?.label?Ze:0),tt=Boolean(Y?.label)&&!_e,nt=(tt?Ze+2:0)+(oe?20:0),lt={left:Y?.thickness??qe.band,top:nt,width:Math.max(0,pe-(Y?.thickness??qe.band)),height:Math.max(0,Fe-(X?.thickness??et)-nt)},it=l.useMemo(()=>{if(lt.width<=0||lt.height<=0)return[];if("treemap"===u){const e=[];return $e.forEach((t,n)=>t.forEach((t,l)=>{null!==t.value&&e.push({row:n,index:l,cell:t})})),j(e.map(e=>Math.max(0,e.cell.value??0)),lt.width,lt.height).map(t=>({row:e[t.index].row,index:e[t.index].index,cell:e[t.index].cell,x:lt.left+t.x,y:lt.top+t.y,width:t.width,height:t.height}))}const e=lt.height/Math.max(1,i.length),t=lt.width/Math.max(1,ze),n=[];return $e.forEach((l,i)=>l.forEach((l,r)=>{null!==l.value&&n.push({row:i,index:r,cell:l,x:lt.left+r*t,y:lt.top+i*e,width:t,height:e})})),n},[u,$e,i.length,ze,lt.left,lt.top,lt.width,lt.height]),rt=l.useCallback(e=>k(e.cell.x??c?.[e.index]??Se[e.index]??e.index,ve),[c,Se,ve]),at=l.useMemo(()=>{const e=$e.reduce((e,t)=>e+t.length,0);if("treemap"!==u)return{heads:Se.map(e=>k(e,ve)),rows:$e.map(e=>Se.map((t,n)=>e[n])),points:e};const t=[],n=new Map,l=$e.map(e=>{const l=[];return e.forEach((e,i)=>{const r=k(e.x??c?.[i]??Se[i]??i,ve);let a=n.get(r);void 0===a&&(a=t.length,n.set(r,a),t.push(r)),l[a]=e}),l});return{heads:t,rows:l,points:e}},[u,Se,$e,c,ve]),ot="treemap"===u,st=l.useMemo(()=>{const e=[];for(const t of it){const n=Math.max(0,t.width-A),l=Math.max(0,t.height-A);if(n<=0||l<=0)continue;const i=De(t.cell.value??0),r="all"===V?Ne(t.cell.value??0):"",a=ot?"all"===V?[rt(t),r]:[rt(t)]:"all"===V?[r]:[];e.push({key:`${t.row}-${t.index}`,row:t.row,index:t.index,x:t.x,y:t.y,width:t.width,height:t.height,w:n,h:l,fill:t.cell.color??N(i,f),ink:t.cell.color?"var(--neba-surface)":$(i,f),lines:a.filter(e=>J(e,n,l/a.length,We)).map(e=>C(e,t.width-8,We))})}return e},[it,De,f,V,Ne,ot,rt,We]),dt=l.useMemo(()=>{const e=[];for(let t=0;t<st.length;t+=U)e.push(st.slice(t,t+U));return e},[st]),ht=l.useMemo(()=>{const e=new Map;for(const t of dt)for(const n of t)e.set(n.key,t);return e},[dt]),ct=null===ye?null:`${ye.row}-${ye.index}`,mt=null===ct?void 0:ht.get(ct),ut=null===ye?null:it.find(e=>e.row===ye.row&&e.index===ye.index)??null,ft=null===ut?[]:[{seriesIndex:ut.row,color:ut.cell.color??N(De(ut.cell.value??0),f),value:ut.cell.value,formatted:Ne(ut.cell.value??0),label:ut.cell.label}],xt=Array.from({length:S},(e,t)=>N(t,f));return t(d,{...fe,size:he,variant:ce,padded:me,className:ue,legendSide:Oe,legend:He&&!Te?e(a,{steps:xt,from:Ne("diverging"===f?-q(Be,Ce,K)+K:Be),to:Ne("diverging"===f?q(Be,Ce,K)+K:Ce),middle:"diverging"===f?Ne(K):void 0,align:Le.align??"center",vertical:"left"===Oe||"right"===Oe,size:he}):null,table:Te?null:e(T,{id:be,caption:le,heads:at.heads,rows:at.rows,names:je,points:at.points,format:Ne}),children:[oe&&!Te?e(r,{rows:()=>[["",...at.heads],...at.rows.map((e,t)=>[je[t],...at.heads.map((t,n)=>e[n]?.value??null)])],fileName:se,onExport:de,label:we.exportCsv}):null,t("div",{ref:xe,role:"img",tabIndex:Te?void 0:0,"aria-label":le??we.label,"aria-describedby":Te?void 0:ke,onPointerLeave:e=>{"touch"!==e.pointerType&&Me(null)},onBlur:()=>Me(null),onKeyDown:e=>{if(Re||0===it.length)return;const t=null===ye?-1:it.findIndex(e=>e.row===ye.row&&e.index===ye.index),n="treemap"!==u&&-1!==t,l="ArrowRight"===e.key||"ArrowDown"===e.key;if(!n||"ArrowDown"!==e.key&&"ArrowUp"!==e.key)if(l||"ArrowLeft"===e.key||"ArrowUp"===e.key){const e=l?it[Math.min(it.length-1,t+1)]:it[Math.max(0,(-1===t?it.length:t)-1)];Me({row:e.row,index:e.index})}else{if("Escape"!==e.key)return;Me(null)}else{const n=it[t],l="ArrowDown"===e.key,i=it.filter(e=>e.index===n.index&&(l?e.row>n.row:e.row<n.row)).sort((e,t)=>l?e.row-t.row:t.row-e.row)[0];i&&Me({row:i.row,index:i.index})}e.preventDefault()},className:F("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:"string"==typeof Z?Z:Fe},children:[Te?e("div",{className:F("flex h-full items-center justify-center text-(--neba-muted-fg)",W[he]),children:ae??ge.title}):pe>0?t("svg",{width:pe,height:Fe,viewBox:`0 0 ${pe} ${Fe}`,"aria-hidden":"true",className:"block",onPointerOver:Re?void 0:e=>{const t=e.target,n=t.getAttribute("data-row"),l=t.getAttribute("data-index");null!==n&&null!==l&&(ye?.row===Number(n)&&ye?.index===Number(l)||Me({row:Number(n),index:Number(l)}))},children:[dt.map((t,n)=>e(_,{cells:t,active:t===mt?ct:null,treemap:ot,fontSize:We},n)),"grid"!==u||Y?.hidden?null:qe.texts.map((t,n)=>e("text",{x:lt.left-8,y:lt.top+(n+.5)*lt.height/Math.max(1,i.length),textAnchor:"end",dominantBaseline:"central",fontSize:We,fill:"var(--neba-muted-fg)",children:t},`row-${n}`)),"grid"!==u||X?.hidden?null:Xe.map((t,n)=>{const l=lt.width/Math.max(1,ze);if(n%Math.max(1,Math.ceil(Ke.room(Ye)/Math.max(1,l)))!==0)return null;const i=lt.left+(n+.5)*l,r=lt.top+lt.height+Ke.offset-6;return e("text",{x:i,y:r,textAnchor:Ke.anchor,transform:0===Ke.angle?void 0:`rotate(${Ke.angle} ${i} ${r})`,dominantBaseline:0===Ke.angle?void 0:"central",fontSize:We,fill:"var(--neba-muted-fg)",children:t},`col-${n}`)}),tt?e("text",{x:lt.left,y:We+2,textAnchor:"start",fontSize:We,fill:"var(--neba-muted-fg)",fontWeight:500,children:Y?.label}):null,"grid"===u&&X?.label&&!X.hidden?e("text",{x:lt.left+lt.width,y:lt.top+lt.height+Ke.depth(Ye)+We+8,textAnchor:"end",fontSize:We,fill:"var(--neba-muted-fg)",fontWeight:500,children:X.label}):null]}):null,ut&&!Re?Pe.render?e("div",{className:"pointer-events-none absolute z-10",style:{left:ut.x+ut.width/2,top:ut.y},children:Pe.render({index:ut.index,category:ut.cell.x??Se[ut.index]??ut.index,items:ft})}):e(h,{heading:`${je[ut.row]} · ${rt(ut)}`,items:ft,x:ut.x+ut.width/2,y:ut.y,flip:ut.x+ut.width/2>.6*pe,size:he}):null]}),Te?null:e(s,{id:ke,template:we.summary,locale:ve,...m($e,Ne)}),Re?null:e(o,{heading:ut?`${je[ut.row]} · ${rt(ut)}`:void 0,items:ft})]})}const T=/*@__PURE__*/l.memo(function HeatmapTable({id:n,caption:r,heads:a,rows:o,names:s,points:d,format:h}){const{shown:c,run:m}=f({rows:o.length,points:d,columns:a.length+1}),x=l.useCallback((n,l)=>o.slice(n,l).map((l,i)=>{const r=n+i;return t("tr",{children:[e("th",{scope:"row",children:s[r]}),a.map((t,n)=>{const i=l[n];return e("td",{children:void 0!==i?.label?i.label:null==i?.value?"":h(i.value)},n)})]},r)}),[o,a,s,h]);return t("table",{id:n,className:i,"aria-busy":c<o.length||void 0,children:[r?e("caption",{children:r}):null,e("thead",{children:t("tr",{children:[e("th",{scope:"col"}),a.map((t,n)=>e("th",{scope:"col",children:t},n))]})}),e("tbody",{children:u(c,m,x)})]})}),U=128,_=/*@__PURE__*/l.memo(function CellBlock({cells:l,active:i,treemap:r,fontSize:a}){return e(n,{children:l.map(n=>t("g",{children:[e("rect",{"data-row":n.row,"data-index":n.index,x:n.x+A/2,y:n.y+A/2,width:n.w,height:n.h,rx:Math.min(3,n.w/2,n.h/2),fill:n.fill,opacity:n.key===i?1:.94,className:c}),n.lines.map((t,l)=>e("text",{x:n.x+n.width/2,y:n.y+n.height/2+(l-(n.lines.length-1)/2)*(a+2),textAnchor:"middle",dominantBaseline:"central",fontSize:a,fontWeight:0===l?500:400,fill:n.ink,opacity:0===l?1:.85,pointerEvents:"none",className:0===l&&r?void 0:"tabular-nums",children:t},l))]},n.key))})});function q(e,t,n){return Math.max(Math.abs(t-n),Math.abs(n-e))}function J(e,t,n,l){return n>=1.8*l&&t>=Math.min(E(e,l),2.5*l)+8}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n}from"react/jsx-runtime";import*as e from"react";import{cx as
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import*as e from"react";import{memoise as t}from"../../internal/cache.js";import{cx as r,transitionClasses as o}from"../../internal/styles.js";import{useStyleDefaults as i}from"../../internal/defaults.js";const l={solid:"bg-(--n-fill) text-(--n-on-solid)",outline:"border bg-(--n-panel) text-(--n-on-tint) [border-color:var(--n-line)]",text:"bg-transparent text-(--n-on-tint)"},s={solid:"px-0.5 -mx-0.5",outline:"px-0.5 -mx-[calc(0.125rem+1px)]",text:"px-0.5 -mx-0.5"},a={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},c=/[\p{L}\p{N}_]/u,u=/[\u0300-\u036f]/g,f=new Map;function d(n){return t(f,n,()=>n.normalize("NFD").replace(u,"").normalize("NFC"),4096)}function m(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function p(n,e,t){const r=e>0?n[e-1]:"",o=t<n.length?n[t]:"";return!c.test(r)&&!c.test(o)}function g(n,e,t,r,o){e.lastIndex=0;const i=r?function(n){if(/^[\u0020-\u007e\s]*$/.test(n))return null;const e=[],t=[];let r="",o=0;for(const i of n){const n=o+i.length,l=d(i);if(""===l)for(let e=t.length-1;e>=0&&t[e]===o;e-=1)t[e]=n;else{for(let r=0;r<l.length;r+=1)e.push(o),t.push(n);r+=l}o=n}return{text:r,starts:e,ends:t}}(n):null,l=i?i.text:n,s=[];let a,c=0;for(;null!==(a=e.exec(l));){if(""===a[0]){e.lastIndex+=1;continue}const r=i?i.starts[a.index]:a.index,l=i?i.ends[a.index+a[0].length-1]:a.index+a[0].length;!t||p(n,r,l)?(r>c&&s.push(n.slice(c,r)),s.push(o(n.slice(r,l),`${r}`)),c=l):e.lastIndex=a.index+1}return 0===s.length?n:(c<n.length&&s.push(n.slice(c)),s)}function x(n,t,r,o,i){if("string"==typeof n)return g(n,t,r,o,i);if("number"==typeof n)return g(String(n),t,r,o,i);if(Array.isArray(n)){const e=n.map(n=>x(n,t,r,o,i));return e.every((e,t)=>e===n[t])?n:e}if(e.isValidElement(n)){const l=n.props.children;if(void 0===l||"function"==typeof l)return n;const s=x(l,t,r,o,i);return s===l?n:e.cloneElement(n,void 0,...h(s))}return n}function h(n){return Array.isArray(n)?n:[n]}export const Highlight=/*@__PURE__*/e.forwardRef(function Highlight(t,c){const{query:u,variant:f="solid",color:p="warning",caseSensitive:g=!1,wholeWord:b=!1,underline:y=!1,weight:v,className:$,style:E,children:j,...w}=i(t,["variant"]),A=e.useMemo(()=>function(n,e){if(n instanceof RegExp)return new RegExp(n.source,n.global?n.flags:`${n.flags}g`);const t=(Array.isArray(n)?n:[n]).map(n=>Array.from(n.trim(),d).join("")).filter(Boolean).sort((n,e)=>e.length-n.length);return 0===t.length?null:new RegExp(t.map(m).join("|"),e?"gu":"giu")}(u,g),[u,g]),N=r("rounded-[0.25rem]",s[f],"box-decoration-clone",l[f],y?"underline decoration-2 underline-offset-2":"",v?a[v]:"",o),R=b&&!(u instanceof RegExp),I=A?x(j,A,R,!(u instanceof RegExp),(e,t)=>n("mark",{className:N,children:e},t)):j;return e.createElement("span",{ref:c,className:$,style:{"--n-fill":`var(--neba-${p}-fill)`,"--n-on-solid":`var(--neba-${p}-on-solid)`,"--n-accent":`var(--neba-${p}-accent)`,"--n-on-tint":`var(--neba-${p}-on-tint)`,"--n-panel":`var(--neba-${p}-panel)`,"--n-line":`var(--neba-${p}-line)`,...E},...w},...h(I))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{PreviewCard as t}from"@base-ui/react/preview-card";import{boxPaddingXClasses as l,boxPaddingYClasses as i}from"../box/Box.js";import{cx as n,hasContent as r,metaTextClasses as s,popupFadeClasses as o,radiusClasses as d,sheetBodyClasses as m,sheetHeaderGapClasses as c,sheetSectionGapClasses as f,sheetTitleClasses as p,surfaceClasses as x,surfaceSlots as h,toLength as g}from"../../internal/styles.js";import{useStyleDefaults as u}from"../../internal/defaults.js";const b={xs:"max-w-64",sm:"max-w-72",md:"max-w-84",lg:"max-w-md",xl:"max-w-xl"},v=
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{PreviewCard as t}from"@base-ui/react/preview-card";import{boxPaddingXClasses as l,boxPaddingYClasses as i}from"../box/Box.js";import{cx as n,hasContent as r,metaTextClasses as s,popupFadeClasses as o,radiusClasses as d,sheetBodyClasses as m,sheetHeaderGapClasses as c,sheetSectionGapClasses as f,sheetTitleClasses as p,surfaceClasses as x,surfaceSlots as h,toLength as g}from"../../internal/styles.js";import{useStyleDefaults as u}from"../../internal/defaults.js";const b={xs:"max-w-64",sm:"max-w-72",md:"max-w-84",lg:"max-w-md",xl:"max-w-xl"},v=x+" relative flex flex-col border text-(--neba-fg) bg-(--n-panel-press) [border-color:var(--n-line)] [box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)] [outline:none] "+o,w={xs:8,sm:9,md:10,lg:11,xl:12};export function HoverCard(o){const{size:x="md",color:y="primary",density:N="default",trigger:O,title:j,description:z,children:k,side:C="bottom",align:P="center",sideOffset:$=6,alignOffset:B=0,arrow:D=!1,open:M,defaultOpen:W,onOpenChange:A,delay:E,closeDelay:H,width:L,className:R,style:T,...q}=u(o,["size","density"]),F=l[N][x],G=i[N][x],I=w[x],J=r(j)||r(z),K=g(L);return a(t.Root,{open:M,defaultOpen:W,onOpenChange:e=>A?.(e),children:[e(t.Trigger,{render:O,delay:E,closeDelay:H}),e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:C,align:P,sideOffset:$,alignOffset:B,children:a(t.Popup,{className:n(v,d[x],m[x],f[x],F,G,void 0===K?b[x]:"",R??""),style:{...h(y,3),...void 0===K?null:{maxWidth:K},...T},...q,children:[D?e(t.Arrow,{className:"data-[side=top]:bottom-[-1px] data-[side=bottom]:top-[-1px] data-[side=bottom]:rotate-180 data-[side=left]:right-[-1px] data-[side=left]:-rotate-90 data-[side=right]:left-[-1px] data-[side=right]:rotate-90",children:a("svg",{width:I,height:I/2,viewBox:"0 0 10 5","aria-hidden":"true",className:"block",children:[e("path",{d:"M0 0h10L5 5z",fill:"var(--n-panel-press)"}),e("path",{d:"M0 0 5 5 10 0",fill:"none",stroke:"var(--n-line)",strokeWidth:"1",vectorEffect:"non-scaling-stroke"})]})}):null,J?a("div",{className:`flex min-w-0 flex-col ${c[x]}`,children:[r(j)?e("div",{className:`m-0 font-semibold ${p[x]}`,children:j}):null,r(z)?e("div",{className:`m-0 text-(--neba-muted-fg) ${s[x]}`,children:z}):null]}):null,r(k)?e("div",{className:"min-w-0",children:k}):null]})})})]})}
|
|
@@ -123,6 +123,9 @@ export interface HowToStepsProps extends Omit<React.ComponentPropsWithoutRef<'di
|
|
|
123
123
|
* and the list rows hold still, and what animates is the content they
|
|
124
124
|
* changed.
|
|
125
125
|
*
|
|
126
|
+
* The step the guide is first drawn with arrives with the page and has no
|
|
127
|
+
* entrance: only a step the reader moves to does.
|
|
128
|
+
*
|
|
126
129
|
* A reduced-motion preference cuts it to its last frame, as it does every
|
|
127
130
|
* other effect in the library.
|
|
128
131
|
* @default 'fade'
|