neba 1.10.0 → 1.11.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/README.md +35 -5
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-lighting/AnimateLighting.js +1 -1
- package/dist/components/app-logo/AppLogo.js +1 -1
- package/dist/components/aspect-ratio/AspectRatio.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/avatar-group/AvatarGroup.js +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bar-chart/BarChart.d.ts +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/box/Box.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.d.ts +72 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/Card.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/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 +14 -2
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +1 -1
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/confirm/Confirm.d.ts +83 -0
- package/dist/components/confirm/Confirm.js +1 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- package/dist/components/container/Container.js +1 -1
- package/dist/components/data-list/DataList.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +104 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +40 -8
- 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.d.ts +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/divider/Divider.js +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/file-picker/FilePicker.js +1 -1
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/gauge-chart/GaugeChart.d.ts +1 -1
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.d.ts +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.d.ts +1 -1
- package/dist/components/hover-card/HoverCard.js +1 -1
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/image/Image.d.ts +70 -0
- package/dist/components/image/Image.js +1 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/list/List.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/number-field/NumberField.d.ts +12 -2
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.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.d.ts +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/popconfirm/Popconfirm.d.ts +71 -0
- package/dist/components/popconfirm/Popconfirm.js +1 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/portal/Portal.d.ts +48 -0
- package/dist/components/portal/Portal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- 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/provider/NebaProvider.d.ts +99 -0
- package/dist/components/provider/NebaProvider.js +1 -0
- package/dist/components/provider/index.d.ts +3 -0
- package/dist/components/provider/index.js +1 -0
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.d.ts +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/select/Select.js +1 -1
- package/dist/components/shortcut/Shortcut.d.ts +2 -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/sparkline/Sparkline.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/statistic/Statistic.js +1 -1
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +1 -1
- package/dist/components/text-field/TextField.d.ts +12 -1
- package/dist/components/text-field/TextField.js +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.d.ts +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +1 -1
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tour/Tour.d.ts +1 -1
- package/dist/components/tour/Tour.js +1 -1
- package/dist/components/transfer/Transfer.js +1 -1
- package/dist/components/tree-select/TreeSelect.d.ts +88 -0
- package/dist/components/tree-select/TreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +37 -0
- package/dist/components/visually-hidden/VisuallyHidden.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDisclosure.d.ts +21 -0
- package/dist/hooks/useDisclosure.js +1 -0
- package/dist/hooks/useElementSize.d.ts +23 -0
- package/dist/hooks/useElementSize.js +1 -0
- package/dist/hooks/useMediaQuery.d.ts +27 -0
- package/dist/hooks/useMediaQuery.js +1 -0
- package/dist/hooks/useOnScreen.d.ts +24 -0
- package/dist/hooks/useOnScreen.js +1 -0
- package/dist/hooks/useShortcut.d.ts +34 -0
- package/dist/hooks/useShortcut.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/internal/calendar.d.ts +31 -5
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/csv.d.ts +40 -0
- package/dist/internal/csv.js +1 -0
- package/dist/internal/date.d.ts +39 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +46 -0
- package/dist/internal/defaults.js +1 -0
- package/dist/internal/i18n.d.ts +23 -0
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/keys.d.ts +92 -0
- package/dist/internal/keys.js +1 -0
- package/dist/internal/media.d.ts +27 -0
- package/dist/internal/media.js +1 -1
- package/dist/internal/page-layout.d.ts +7 -0
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +7 -1
- package/dist/internal/picker.js +1 -1
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.js +1 -1
- package/dist/locales/zh-hant.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +34 -0
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as r from"react";import{useRender 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{PageLayoutContext as s}from"../../internal/page-layout.js";import{cx as i,hasContent as l,surfaceClasses as m,surfaceSlots as o,transitionClasses as d}from"../../internal/styles.js";import{useStyleDefaults as c}from"../../internal/defaults.js";const x={xs:"min-h-10",sm:"min-h-12",md:"min-h-14",lg:"min-h-16",xl:"min-h-20"},f={xs:"gap-1.5",sm:"gap-2",md:"gap-3",lg:"gap-4",xl:"gap-5"},p={xs:"gap-3",sm:"gap-4",md:"gap-6",lg:"gap-8",xl:"gap-10"},u={xs:"max-w-[30rem]",sm:"max-w-[40rem]",md:"max-w-[48rem]",lg:"max-w-[64rem]",xl:"max-w-[80rem]"},g={solid:[m,"text-(--neba-fg) bg-(--n-panel-press)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[m,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},h={static:"",sticky:"sticky top-0 z-30",fixed:"fixed inset-x-0 top-0 z-40"},b={start:"shrink-0",center:"flex-1 basis-0",end:"shrink-0"},v={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(m,w){const{brand:y,actions:j,align:N="start",position:k="sticky",variant:z="outline",size:C="md",color:B="primary",density:H="default",elevation:R=0,divider:W=!0,maxWidth:q="none",padded:A=!0,label:D,render:E,className:F,style:G,children:I,...J}=c(m,["size","density","variant"]),K=r.useContext(s),{register:L}=K,M=r.useCallback(e=>{L("header",e),"function"==typeof w?w(e):w&&(w.current=e)},[L,w]),O=i("w-full min-w-0",g[z],W?"border-b [border-color:var(--n-line)]":"",h[k],d,F);return t({render:E??e("header",{}),ref:M,props:{"aria-label":D,className:O,style:{...o(B,R),...G},children:a("div",{className:i("flex w-full items-center",x[C],p[C],A?n[H][C]:"","none"===q?"":i(u[q],"mx-auto")),children:[l(y)?e("div",{className:i("flex min-w-0 items-center",b[N],f[C]),children:y}):"center"===N?e("div",{"aria-hidden":"true",className:b[N]}):null,l(I)?e("div",{className:i(v[N],f[C]),children:I}):null,l(j)?e("div",{className:i("flex min-w-0 items-center justify-end",b[N],f[C]),children:j}):"center"===N?e("div",{"aria-hidden":"true",className:b[N]}):null]}),...J}})});
|
|
@@ -66,4 +66,4 @@ export interface HeatmapChartProps extends Omit<ChartBaseProps, 'legend'> {
|
|
|
66
66
|
* rather than off the categorical palette — a heatmap in eight hues says its
|
|
67
67
|
* cells are eight unrelated things.
|
|
68
68
|
*/
|
|
69
|
-
export declare function HeatmapChart(
|
|
69
|
+
export declare function HeatmapChart(rawProps: HeatmapChartProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{ChartScaleLegend as n,ChartStatus as i,ChartSurface as a,ChartTooltipPanel as r,useMeasuredWidth as o}from"../../internal/chart-frame.js";import{categoryAt as d,chartFontSizes as h,compactNumber as s,formatCategory as c,markGap as m,plotHeights as u,rampFill as x,rampInk as f,rampStep as g,rampSteps as p,squarify as v,textWidth as w,toValues as b,truncate as y}from"../../internal/chart.js";import{numberFormatter as M}from"../../internal/format.js";import{cx as $,metaTextClasses as j,srOnlyClasses as k}from"../../internal/styles.js";import{chartMessages as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{ChartScaleLegend as n,ChartStatus as i,ChartSurface as a,ChartTooltipPanel as r,useMeasuredWidth as o}from"../../internal/chart-frame.js";import{categoryAt as d,chartFontSizes as h,compactNumber as s,formatCategory as c,markGap as m,plotHeights as u,rampFill as x,rampInk as f,rampStep as g,rampSteps as p,squarify as v,textWidth as w,toValues as b,truncate as y}from"../../internal/chart.js";import{numberFormatter as M}from"../../internal/format.js";import{cx as $,metaTextClasses as j,srOnlyClasses as k}from"../../internal/styles.js";import{chartMessages as z,emptyMessages as A,useMessages as N}from"../../internal/i18n.js";import{useStyleDefaults as E}from"../../internal/defaults.js";export function HeatmapChart(B){const{series:C,categories:I,shape:_="grid",scale:D="sequential",midpoint:L=0,min:P,max:R,valueLabels:q="none",height:H,format:K,locale:U,label:W,legend:F,tooltip:G,empty:J,size:O="md",variant:Q="text",padded:T=!1,className:V,...X}=E(B,["size","variant","locale"]),Y=l.useRef(null),Z=o(Y),ee=N(A,U),te=N(z,U),le=l.useId(),[ne,ie]=l.useState(null),ae=l.useCallback(e=>K?M(U,K).format(e):s(e,U),[K,U]),re=l.useMemo(()=>b(C),[C]),oe=re.reduce((e,t)=>Math.max(e,t.length),0),de=l.useMemo(()=>Array.from({length:oe},(e,t)=>d(t,I,re)),[oe,I,re]),he=l.useMemo(()=>C.map((e,t)=>e.name??`${t+1}`),[C]),se=l.useMemo(()=>{let e=1/0,t=-1/0,l=!1;for(const n of re)for(const i of n)null!==i.value&&(l=!0,e=Math.min(e,i.value),t=Math.max(t,i.value));return l?{min:e,max:t}:null},[re]),ce=P??se?.min??0,me=R??se?.max??1,ue=l.useCallback(e=>g(e,ce,me,D,L),[ce,me,D,L]),xe="number"==typeof H?H:u[O]??220,fe=h[O],ge=!0===F||void 0===F||!1===F?{}:F,pe=!1!==F,ve=ge.side??"bottom",we=!1===G?{mode:"none"}:!0===G||void 0===G?{}:G,be="none"===we.mode,ye=null===se||0===oe||0===C.length,Me=l.useMemo(()=>{if("treemap"===_||Z<=0)return{texts:[],band:0};const e=Math.min(150,.25*Z),t=he.map(t=>y(t,e,fe));return{texts:t,band:t.reduce((e,t)=>Math.max(e,w(t,fe)),0)+10}},[_,he,Z,fe]),$e="treemap"===_?0:fe+8,je={left:Me.band,width:Math.max(0,Z-Me.band),height:Math.max(0,xe-$e)},ke=l.useMemo(()=>{if(je.width<=0||je.height<=0)return[];if("treemap"===_){const e=[];return re.forEach((t,l)=>t.forEach((t,n)=>{null!==t.value&&e.push({row:l,index:n,cell:t})})),v(e.map(e=>Math.max(0,e.cell.value??0)),je.width,je.height).map(t=>({row:e[t.index].row,index:e[t.index].index,cell:e[t.index].cell,x:je.left+t.x,y:t.y,width:t.width,height:t.height}))}const e=je.height/Math.max(1,C.length),t=je.width/Math.max(1,oe),l=[];return re.forEach((n,i)=>n.forEach((n,a)=>{null!==n.value&&l.push({row:i,index:a,cell:n,x:je.left+a*t,y:i*e,width:t,height:e})})),l},[_,re,C.length,oe,je.left,je.width,je.height]),ze=l.useCallback(e=>c(e.cell.x??I?.[e.index]??de[e.index]??e.index,U),[I,de,U]),Ae=null===ne?null:ke.find(e=>e.row===ne.row&&e.index===ne.index)??null,Ne=null===Ae?[]:[{seriesIndex:Ae.row,color:Ae.cell.color??x(ue(Ae.cell.value??0),D),value:Ae.cell.value,formatted:ae(Ae.cell.value??0),label:Ae.cell.label}],Ee=Array.from({length:p},(e,t)=>x(t,D));return t(a,{...X,size:O,variant:Q,padded:T,className:V,legendSide:ve,legend:pe&&!ye?e(n,{steps:Ee,from:ae("diverging"===D?-S(ce,me,L)+L:ce),to:ae("diverging"===D?S(ce,me,L)+L:me),middle:"diverging"===D?ae(L):void 0,align:ge.align??"center",vertical:"left"===ve||"right"===ve,size:O}):null,table:ye?null:t("table",{id:le,className:k,children:[W?e("caption",{children:W}):null,e("thead",{children:t("tr",{children:[e("th",{scope:"col"}),de.map((t,l)=>e("th",{scope:"col",children:c(t,U)},l))]})}),e("tbody",{children:re.map((l,n)=>t("tr",{children:[e("th",{scope:"row",children:he[n]}),de.map((t,n)=>{const i=l[n];return e("td",{children:void 0!==i?.label?i.label:null==i?.value?"":ae(i.value)},n)})]},n))})]}),children:[t("div",{ref:Y,role:"img",tabIndex:ye?void 0:0,"aria-label":W??te.label,"aria-describedby":ye?void 0:le,onPointerLeave:()=>ie(null),onBlur:()=>ie(null),onKeyDown:e=>{if(be||0===ke.length)return;const t=null===ne?-1:ke.findIndex(e=>e.row===ne.row&&e.index===ne.index);if("ArrowRight"===e.key||"ArrowDown"===e.key){const e=ke[Math.min(ke.length-1,t+1)];ie({row:e.row,index:e.index})}else if("ArrowLeft"===e.key||"ArrowUp"===e.key){const e=ke[Math.max(0,(-1===t?ke.length:t)-1)];ie({row:e.row,index:e.index})}else{if("Escape"!==e.key)return;ie(null)}e.preventDefault()},className:$("relative w-full rounded-(--neba-radius-xs)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"),style:{height:xe},children:[ye?e("div",{className:$("flex h-full items-center justify-center text-(--neba-muted-fg)",j[O]),children:J??ee.title}):Z>0?t("svg",{width:Z,height:xe,viewBox:`0 0 ${Z} ${xe}`,"aria-hidden":"true",className:"block",children:[ke.map(l=>{const n=ue(l.cell.value??0),i=ne?.row===l.row&&ne?.index===l.index,a=Math.max(0,l.width-m),r=Math.max(0,l.height-m);if(a<=0||r<=0)return null;const o=ae(l.cell.value??0),d="treemap"===_?"all"===q?[ze(l),o]:[ze(l)]:"all"===q?[o]:[],h=d.filter(e=>function(e,t,l,n){return l>=1.8*n&&t>=Math.min(w(e,n),2.5*n)+8}(e,a,r/d.length,fe)),s=l.cell.color?"var(--neba-surface)":f(n,D);return t("g",{children:[e("rect",{x:l.x+m/2,y:l.y+m/2,width:a,height:r,rx:Math.min(3,a/2,r/2),fill:l.cell.color??x(n,D),opacity:i?1:.94,onPointerEnter:be?void 0:()=>ie({row:l.row,index:l.index}),className:"[transition:opacity_var(--neba-duration)_var(--neba-ease)]"}),h.map((t,n)=>e("text",{x:l.x+l.width/2,y:l.y+l.height/2+(n-(h.length-1)/2)*(fe+2),textAnchor:"middle",dominantBaseline:"central",fontSize:fe,fontWeight:0===n?500:400,fill:s,opacity:0===n?1:.85,pointerEvents:"none",className:0===n&&"treemap"===_?void 0:"tabular-nums",children:y(t,l.width-8,fe)},n))]},`${l.row}-${l.index}`)}),"grid"===_?Me.texts.map((t,l)=>e("text",{x:je.left-8,y:(l+.5)*je.height/Math.max(1,C.length),textAnchor:"end",dominantBaseline:"central",fontSize:fe,fill:"var(--neba-muted-fg)",children:t},`row-${l}`)):null,"grid"===_?de.map((t,l)=>{const n=je.width/Math.max(1,oe),i=c(t,U);return l%Math.max(1,Math.ceil((w(i,fe)+8)/Math.max(1,n)))!==0?null:e("text",{x:je.left+(l+.5)*n,y:je.height+fe,textAnchor:"middle",fontSize:fe,fill:"var(--neba-muted-fg)",children:i},`col-${l}`)}):null]}):null,Ae&&!be?we.render?e("div",{className:"pointer-events-none absolute z-10",style:{left:Ae.x+Ae.width/2,top:Ae.y},children:we.render({index:Ae.index,category:Ae.cell.x??de[Ae.index]??Ae.index,items:Ne})}):e(r,{heading:`${he[Ae.row]} · ${ze(Ae)}`,items:Ne,x:Ae.x+Ae.width/2,y:Ae.y,flip:Ae.x+Ae.width/2>.6*Z,size:O}):null]}),be?null:e(i,{heading:Ae?`${he[Ae.row]} · ${ze(Ae)}`:void 0,items:Ne})]})}function S(e,t,l){return Math.max(Math.abs(t-l),Math.abs(l-e))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n}from"react/jsx-runtime";import*as e from"react";import{cx as t,transitionClasses as r}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import*as e from"react";import{cx as t,transitionClasses as r}from"../../internal/styles.js";import{useStyleDefaults as o}from"../../internal/defaults.js";const l={solid:"bg-(--n-fill) text-(--n-on-solid)",outline:"border bg-(--n-panel) text-(--n-accent) [border-color:var(--n-line)]",text:"bg-transparent text-(--n-accent)"},i={regular:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},a=/[\p{L}\p{N}_]/u;function s(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function c(n,e,t){const r=e>0?n[e-1]:"",o=t<n.length?n[t]:"";return!a.test(r)&&!a.test(o)}function u(n,e,t,r){e.lastIndex=0;const o=[];let l,i=0;for(;null!==(l=e.exec(n));){if(""===l[0]){e.lastIndex+=1;continue}const a=l.index,s=a+l[0].length;!t||c(n,a,s)?(a>i&&o.push(n.slice(i,a)),o.push(r(l[0],`${a}`)),i=s):e.lastIndex=a+1}return 0===o.length?n:(i<n.length&&o.push(n.slice(i)),o)}function f(n,t,r,o){if("string"==typeof n)return u(n,t,r,o);if("number"==typeof n)return u(String(n),t,r,o);if(Array.isArray(n))return e.Children.map(n,n=>f(n,t,r,o));if(e.isValidElement(n)){const l=n.props.children;return void 0===l||"function"==typeof l?n:e.cloneElement(n,void 0,f(l,t,r,o))}return n}export const Highlight=/*@__PURE__*/e.forwardRef(function(a,c){const{query:u,variant:d="solid",color:m="warning",caseSensitive:p=!1,wholeWord:g=!1,underline:h=!1,weight:x,className:b,style:v,children:y,...$}=o(a,["variant"]),w=e.useMemo(()=>function(n,e){if(n instanceof RegExp)return new RegExp(n.source,n.global?n.flags:`${n.flags}g`);const t=(Array.isArray(n)?n:[n]).map(n=>n.trim()).filter(Boolean).sort((n,e)=>e.length-n.length);return 0===t.length?null:new RegExp(t.map(s).join("|"),e?"gu":"giu")}(u,p),[u,p]),j=t("rounded-[0.25rem] px-0.5 -mx-0.5","box-decoration-clone",l[d],h?"underline decoration-2 underline-offset-2":"",x?i[x]:"",r),E=w?f(y,w,g,(e,t)=>n("mark",{className:j,children:e},t)):y;return n("span",{ref:c,className:b,style:{"--n-fill":`var(--neba-${m}-fill)`,"--n-on-solid":`var(--neba-${m}-on-solid)`,"--n-accent":`var(--neba-${m}-accent)`,"--n-panel":`var(--neba-${m}-panel)`,"--n-line":`var(--neba-${m}-line)`,...v},...$,children:E})});
|
|
@@ -75,4 +75,4 @@ export interface HoverCardProps extends Pick<NebaStyleProps, 'size' | 'color' |
|
|
|
75
75
|
* without hover, a touchscreen with no pointer at all, and a screen reader all
|
|
76
76
|
* arrive by that route instead.
|
|
77
77
|
*/
|
|
78
|
-
export declare function HoverCard(
|
|
78
|
+
export declare function HoverCard(rawProps: HoverCardProps): React.JSX.Element;
|
|
@@ -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
|
|
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 s,metaTextClasses as r,radiusClasses as o,sheetBodyClasses as d,sheetHeaderGapClasses as m,sheetSectionGapClasses as c,sheetTitleClasses as p,surfaceClasses as f,surfaceSlots as x,toLength as h}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const u={xs:"max-w-64",sm:"max-w-72",md:"max-w-84",lg:"max-w-md",xl:"max-w-xl"},b=[f,"relative flex flex-col","border text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" "),v={xs:8,sm:9,md:10,lg:11,xl:12};export function HoverCard(f){const{size:w="md",color:y="primary",density:N="default",trigger:j,title:O,description:k,children:z,side:C="bottom",align:P="center",sideOffset:$=6,alignOffset:B=0,arrow:D=!1,open:M,defaultOpen:W,onOpenChange:_,delay:A,closeDelay:E,width:H,className:L,style:R,...T}=g(f,["size","density"]),q=l[N][w],F=i[N][w],G=v[w],I=s(O)||s(k),J=h(H);return a(t.Root,{open:M,defaultOpen:W,onOpenChange:e=>_?.(e),children:[e(t.Trigger,{render:j,delay:A,closeDelay:E}),e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-50 [outline:none]",side:C,align:P,sideOffset:$,alignOffset:B,children:a(t.Popup,{className:n(b,o[w],d[w],c[w],q,F,void 0===J?u[w]:"",L??""),style:{...x(y,3),...void 0===J?null:{maxWidth:J},...R},...T,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"].join(" "),children:a("svg",{width:G,height:G/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,I?a("div",{className:`flex min-w-0 flex-col ${m[w]}`,children:[s(O)?e("div",{className:`m-0 font-semibold ${p[w]}`,children:O}):null,s(k)?e("div",{className:`m-0 text-(--neba-muted-fg) ${r[w]}`,children:k}):null]}):null,s(z)?e("div",{className:"min-w-0",children:z}):null]})})})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as l from"react";import{Button as a}from"../button/Button.js";import{boxPaddingClasses as r}from"../box/Box.js";import{CheckIcon as i,ChevronIcon as o,RestartIcon as s,SuccessIcon as c}from"../../internal/icons.js";import{fill as m,stepsMessages as d,useMessages as p}from"../../internal/i18n.js";import{transitionProps as f}from"../../internal/animate.js";import{cx as x,hasContent as u,iconClasses as b,metaTextClasses as h,radiusClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as l from"react";import{Button as a}from"../button/Button.js";import{boxPaddingClasses as r}from"../box/Box.js";import{CheckIcon as i,ChevronIcon as o,RestartIcon as s,SuccessIcon as c}from"../../internal/icons.js";import{fill as m,stepsMessages as d,useMessages as p}from"../../internal/i18n.js";import{transitionProps as f}from"../../internal/animate.js";import{cx as x,hasContent as u,iconClasses as b,metaTextClasses as h,radiusClasses as v,sheetBodyClasses as g,sheetSectionGapClasses as N,sheetTitleClasses as w,srOnlyClasses as y,surfaceClasses as k,surfaceSlots as j,toLength as C,transitionClasses as z}from"../../internal/styles.js";import{useStyleDefaults as S}from"../../internal/defaults.js";const L={xs:{box:"1.25rem",text:"text-[0.625rem]"},sm:{box:"1.5rem",text:"text-[0.6875rem]"},md:{box:"1.75rem",text:"text-[0.75rem]"},lg:{box:"2rem",text:"text-[0.8125rem]"},xl:{box:"2.25rem",text:"text-[0.875rem]"}},I={default:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"},compact:{xs:"gap-0",sm:"gap-0",md:"gap-0.5",lg:"gap-0.5",xl:"gap-1"}},M={solid:[k,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[k,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};function R(e){return"string"==typeof e?e:""}function B({level:e,...t}){return l.createElement(`h${Math.min(6,Math.max(1,e))}`,t)}export const HowToSteps=/*@__PURE__*/l.forwardRef(function(k,_){const{steps:H,title:T,headingLevel:$=3,step:E,defaultStep:A=0,onStepChange:F,completed:W,defaultCompleted:q=!1,onCompletedChange:D,orientation:G="vertical",maxHeight:J,railWidth:K="15rem",navigation:O=!0,divider:P=!0,transition:Q="fade",completion:U=!0,completedContent:V,variant:X="outline",size:Y="md",color:Z="primary",density:ee="default",elevation:te=0,locale:ne,previousLabel:le,nextLabel:ae,doneLabel:re,restartLabel:ie,className:oe,style:se,...ce}=S(k,["size","density","variant","locale"]),me=p(d,ne),de=l.useId(),[pe,fe]=l.useState(A),[xe,ue]=l.useState(q),be=void 0!==E,he=void 0!==W,ve=H.length,ge=Math.min(Math.max(be?E:pe,0),Math.max(ve-1,0)),Ne=U&&(he?W:xe),we=void 0!==J,ye="vertical"===G,ke=l.useRef(null),je=l.useRef(null);if(l.useEffect(()=>{const e=ke.current,t=je.current;if(!e||!t)return;const n=e.getBoundingClientRect(),l=t.getBoundingClientRect();ye?l.top<n.top?e.scrollTop-=n.top-l.top:l.bottom>n.bottom&&(e.scrollTop+=l.bottom-n.bottom):l.left<n.left?e.scrollLeft-=n.left-l.left:l.right>n.right&&(e.scrollLeft+=l.right-n.right)},[ge,ye]),0===ve)return null;const Ce=(e,t=!1)=>{he||ue(t),Ne!==t&&D?.(t),t||(be||fe(e),e!==ge&&F?.(e))},ze=0===ge,Se=ge===ve-1,Le="none"===Q?null:f(Q),Ie=t=>{const n=Ne||t<ge,l=!Ne&&t===ge;return e("span",{"aria-hidden":"true",className:x("z-1 flex shrink-0 items-center justify-center rounded-full border font-medium","size-(--n-step-mark) [&_svg]:size-[1.15em]",L[Y].text,z,n?"bg-(--n-fill) text-(--n-on-solid) [border-color:transparent]":l?"bg-(--neba-surface) text-(--n-accent) [border-color:var(--n-accent)]":"bg-(--neba-surface) text-(--neba-muted-fg) [border-color:var(--n-line)]"),children:n?e(i,{}):t+1})},Me=e("ol",{ref:ke,"aria-label":me.steps,className:x("m-0 flex list-none p-0",ye?"flex-col":"flex-row",I[ee][Y],we&&ye?"min-h-0 overflow-y-auto overscroll-contain":"",ye?"":"overflow-x-auto overscroll-contain"),children:H.map((n,l)=>{const a=Ne||l<ge,r=!Ne&&l===ge;return t("li",{ref:r?je:void 0,className:x("relative",ye?"":"min-w-0 flex-1"),children:[l<ve-1?e("span",{"aria-hidden":"true",className:x("absolute",z,a?"bg-(--n-fill)":"bg-(--n-line)",ye?["w-px","[inset-inline-start:calc(0.25rem+var(--n-step-mark)/2)]","[top:calc(0.25rem+var(--n-step-mark))]","[height:calc(100%-var(--n-step-mark))]"].join(" "):["h-px","[inset-inline-start:calc(50%+var(--n-step-mark)/2)]","[top:calc(0.25rem+var(--n-step-mark)/2)]","[width:calc(100%-var(--n-step-mark))]"].join(" "))}):null,t("button",{type:"button",onClick:()=>Ce(l),"aria-current":r?"step":void 0,className:x("flex w-full cursor-pointer items-center p-1 text-start",ye?"gap-3":"flex-col gap-1.5 text-center",v.sm,"hover:bg-(--n-soft)",z,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"),children:[Ie(l),e("span",{className:x("min-w-0",ye?"truncate":"",h[Y],r?"font-medium text-(--neba-fg)":"text-(--neba-muted-fg)"),children:n.title}),e("span",{className:y,children:m(me.step,{index:String(l+1),title:R(n.title)})})]})]},l)})}),Re=t("div",{className:x("grid flex-1 grid-cols-1",we?"min-h-0":""),children:[H.map((n,l)=>{const a=Ne||l!==ge;return t("div",{"aria-hidden":a,inert:a||void 0,className:x("col-start-1 row-start-1 min-w-0",we?"overflow-y-auto overscroll-contain":"",a?"invisible":Le?.className??""),style:a?void 0:Le?.style,children:[t("div",{className:"mb-3 flex items-baseline gap-3",children:[u(n.icon)?e("span",{"aria-hidden":"true",className:x("flex h-[1lh] shrink-0 items-center text-(--n-accent)",w[Y],b),children:n.icon}):null,e(B,{level:$+1,className:x("m-0 min-w-0 flex-1 font-medium",w[Y]),children:n.title}),e("span",{className:x("shrink-0 text-(--neba-muted-fg) tabular-nums",h[Y]),children:m(me.position,{index:String(l+1),total:String(ve)})})]}),n.image?e("img",{src:n.image,alt:n.imageAlt??R(n.title),loading:"lazy",decoding:"async",className:x("mb-3 max-h-72 w-full object-contain",v[Y])}):null,u(n.content)?e("div",{className:x("min-w-0",g[Y]),children:n.content}):null]},l)}),U?t("div",{"aria-hidden":!Ne,inert:!Ne||void 0,className:x("col-start-1 row-start-1 flex min-w-0 flex-col items-center justify-center gap-2 py-4 text-center",Ne?Le?.className??"":"invisible"),style:Ne?Le?.style:void 0,children:[e("span",{"aria-hidden":"true",className:"text-(--n-accent) [&_svg]:size-9",children:e(c,{})}),e("p",{className:x("m-0 font-medium",g[Y]),children:V??me.completed})]}):null]});return t("div",{ref:_,"aria-labelledby":u(T)?de:void 0,className:x("flex min-w-0 flex-col",v[Y],r[ee][Y],N[Y],M[X],z,oe),style:{...j(Z,te),"--n-fill":`var(--neba-${Z}-fill)`,"--n-on-solid":`var(--neba-${Z}-on-solid)`,"--n-step-mark":L[Y].box,"--n-step-rail":C(K),...we?{maxHeight:C(J)}:null,...se},...ce,children:[u(T)?e(B,{level:$,id:de,className:x("m-0 shrink-0 font-medium",w[Y]),children:T}):null,t("div",{className:x("flex min-w-0 flex-1 flex-col",we?"min-h-0":"",ye?"gap-4 sm:flex-row sm:gap-5":"gap-4"),children:[e("div",{className:x("flex min-w-0 flex-col",we?"min-h-0":"",ye?"sm:w-(--n-step-rail) sm:shrink-0":"",P?ye?"border-b pb-4 sm:border-b-0 sm:border-e sm:pb-0 sm:pe-5":"border-b pb-4":"",P?"[border-color:var(--n-line)]":""),children:Me}),t("div",{className:x("flex min-w-0 flex-1 flex-col",we?"min-h-0":"",N[Y]),children:[Re,O?e("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-2",children:Ne?e(a,{size:Y,variant:"outline",color:Z,startIcon:e(s,{}),onClick:()=>Ce(0),children:ie??me.restart}):t(n,{children:[e(a,{size:Y,variant:"outline",color:Z,disabled:ze,startIcon:e("span",{className:"rotate-90 rtl:-rotate-90",children:e(o,{})}),onClick:()=>Ce(ge-1),children:le??me.previous}),e(a,Se&&U?{size:Y,variant:"solid",color:Z,startIcon:e(i,{}),onClick:()=>Ce(ge,!0),children:re??me.done}:{size:Y,variant:"solid",color:Z,disabled:Se,endIcon:e("span",{className:"-rotate-90 rtl:rotate-90",children:e(o,{})}),onClick:()=>Ce(ge+1),children:ae??me.next})]})}):null]})]})]})});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { NebaAspectFit } from '../aspect-ratio/AspectRatio.js';
|
|
3
|
+
import type { NebaSize, NebaSlots } from '../../types.js';
|
|
4
|
+
/** The parts an Image draws behind its root. */
|
|
5
|
+
export type ImageSlot = 'image' | 'placeholder' | 'fallback';
|
|
6
|
+
/** Where the picture is in its own life. */
|
|
7
|
+
type Phase = 'loading' | 'loaded' | 'failed';
|
|
8
|
+
export interface ImageProps extends Omit<React.ComponentPropsWithoutRef<'img'>, 'width' | 'height' | 'children'> {
|
|
9
|
+
/** Required, and required to be right. See the note on the component. */
|
|
10
|
+
alt: string;
|
|
11
|
+
/**
|
|
12
|
+
* The proportion to hold while the file is still arriving.
|
|
13
|
+
*
|
|
14
|
+
* This is the whole reason to use this over an `<img>`: a picture with no
|
|
15
|
+
* reserved box is a picture that pushes the page down when it lands, which is
|
|
16
|
+
* the single largest source of layout shift on most sites. `'auto'` opts out
|
|
17
|
+
* and lets the file decide, which is right only when the space around it can
|
|
18
|
+
* absorb the jump.
|
|
19
|
+
* @default 'auto'
|
|
20
|
+
*/
|
|
21
|
+
ratio?: number | string | 'auto';
|
|
22
|
+
/** How the picture fills that box. @default 'cover' */
|
|
23
|
+
fit?: NebaAspectFit;
|
|
24
|
+
/** Rounds the corners at this step of the radius ladder. `false` for square. */
|
|
25
|
+
rounded?: NebaSize | boolean;
|
|
26
|
+
/**
|
|
27
|
+
* What stands in while the file is arriving. A Skeleton of the right shape by
|
|
28
|
+
* default, `false` for nothing at all.
|
|
29
|
+
*/
|
|
30
|
+
placeholder?: React.ReactNode | false;
|
|
31
|
+
/**
|
|
32
|
+
* What is drawn instead when the file does not arrive.
|
|
33
|
+
*
|
|
34
|
+
* Something rather than nothing by default: a broken image icon is the
|
|
35
|
+
* browser telling the reader that the *page* is broken, and a box that says
|
|
36
|
+
* what was meant to be there is a better answer than a blank space.
|
|
37
|
+
*/
|
|
38
|
+
fallback?: React.ReactNode;
|
|
39
|
+
/** Called when the file fails. Useful for swapping a `src` you control. */
|
|
40
|
+
onLoadingStatusChange?: (status: Phase) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Opens the full picture in a Dialog when it is clicked.
|
|
43
|
+
*
|
|
44
|
+
* The picture becomes a button when this is on, so it is reachable by
|
|
45
|
+
* keyboard — an image you can only enlarge with a pointer is an image half
|
|
46
|
+
* the readers cannot enlarge.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
preview?: boolean;
|
|
50
|
+
/** Class names for the parts behind the root. */
|
|
51
|
+
classNames?: NebaSlots<ImageSlot>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A picture that holds its space, says when it is loading and says when it
|
|
55
|
+
* failed.
|
|
56
|
+
*
|
|
57
|
+
* An `<img>` does none of those three, and each is a real defect rather than a
|
|
58
|
+
* nicety: an unsized picture shoves the page down when it lands, a slow one
|
|
59
|
+
* leaves a hole with no explanation, and a broken one draws the browser's own
|
|
60
|
+
* torn-page glyph, which tells a reader the site is broken rather than that one
|
|
61
|
+
* file is missing.
|
|
62
|
+
*
|
|
63
|
+
* `alt` is required by the type, which is deliberate and is the one place this
|
|
64
|
+
* component is stricter than the tag it wraps. A missing `alt` and an empty one
|
|
65
|
+
* mean different things — "nobody wrote this" and "this picture says nothing a
|
|
66
|
+
* reader needs" — and only the second is ever correct. Being made to type
|
|
67
|
+
* `alt=""` is being made to say which one you meant.
|
|
68
|
+
*/
|
|
69
|
+
export declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
70
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as a,Fragment as l}from"react/jsx-runtime";import*as o from"react";import{AspectRatio as t}from"../aspect-ratio/AspectRatio.js";import{Dialog as s}from"../dialog/Dialog.js";import{Skeleton as n}from"../skeleton/Skeleton.js";import{cx as i,radiusClasses as c,transitionClasses as r}from"../../internal/styles.js";const m={cover:"object-cover",contain:"object-contain",fill:"object-fill",none:"object-none"};export const Image=/*@__PURE__*/o.forwardRef(function({alt:d,ratio:f="auto",fit:u="cover",rounded:p=!1,placeholder:b,fallback:g,onLoadingStatusChange:h,preview:x=!1,className:v,classNames:j,style:N,src:k,...y},w){const[z,S]=o.useState("loading"),[C,E]=o.useState(!1);o.useEffect(()=>{S("loading")},[k]);const I=e=>{S(e),h?.(e)},L=!1===p?"":c[!0===p?"md":p],R=e("img",{ref:w,src:k,alt:d,className:i("block size-full",m[u],L,r,"loaded"===z?"opacity-100":"opacity-0",j?.image),onLoad:()=>I("loaded"),onError:()=>I("failed"),...y}),_="failed"===z?e("span",{className:i("absolute inset-0 flex items-center justify-center","bg-(--neba-disabled-bg) text-(--neba-muted-fg)",L,j?.fallback),children:g??e("span",{className:"px-2 text-center text-sm",children:d||"Image unavailable"})}):"loading"===z&&!1!==b?e("span",{className:i("absolute inset-0",j?.placeholder),children:b??e(n,{shape:"rect",className:i("size-full",L)})}):null,A=a("span",{className:"relative block size-full",children:[R,_]}),D="auto"===f?e("span",{className:i("relative block overflow-hidden",L,v),style:N,children:A}):e(t,{ratio:f,className:i("overflow-hidden",L,v),style:N,children:A});return x?a(l,{children:[e("button",{type:"button","aria-label":d,className:i("block w-full cursor-zoom-in [outline:none]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:2px]",L),onClick:()=>E(!0),children:D}),e(s,{open:C,onOpenChange:E,size:"xl",title:d,children:e("img",{src:k,alt:d,className:"mx-auto block max-h-[70vh] w-auto max-w-full"})})]}):D});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{Image}from"./Image.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r,Fragment as s}from"react/jsx-runtime";import*as n from"react";import{useRender as t}from"@base-ui/react/use-render";import{boxPaddingXClasses as l}from"../box/Box.js";import{cx as a,focusRingClasses as i,gapClasses as o,hasContent as d,iconClasses as c,metaTextClasses as m,radiusClasses as f,sheetBodyClasses as x,surfaceClasses as p,surfaceSlots as u,transitionClasses as h}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as e,jsxs as r,Fragment as s}from"react/jsx-runtime";import*as n from"react";import{useRender as t}from"@base-ui/react/use-render";import{boxPaddingXClasses as l}from"../box/Box.js";import{cx as a,focusRingClasses as i,gapClasses as o,hasContent as d,iconClasses as c,metaTextClasses as m,radiusClasses as f,sheetBodyClasses as x,surfaceClasses as p,surfaceSlots as u,transitionClasses as h}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const v=/*@__PURE__*/n.createContext({size:"md",density:"default",dividers:!1}),y={solid:[p,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[p,"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"},g={default:{xs:"py-1",sm:"py-1.5",md:"py-2",lg:"py-2.5",xl:"py-3"},compact:{xs:"py-0.5",sm:"py-0.5",md:"py-1",lg:"py-1.5",xl:"py-2"}},N={xs:f.xs,sm:f.xs,md:f.sm,lg:f.sm,xl:f.md};export const List=/*@__PURE__*/n.forwardRef(function(r,s){const{variant:l="outline",size:i="md",color:o="primary",density:d="default",elevation:c=0,dividers:m=!1,render:x,className:p,style:g,children:N,...w}=b(r,["size","density","variant"]),j=n.useMemo(()=>({size:i,density:d,dividers:m}),[i,d,m]),k=a("flex flex-col",f[i],y[l],h,m?"overflow-hidden [&>li+li]:border-t [&>li+li]:[border-color:var(--n-line)]":"p-1",p??""),z=t({render:x,ref:s,props:{role:"list",className:k,style:{...u(o,c),...g},children:N,...w}});return e(v.Provider,{value:j,children:z})});export const ListItem=/*@__PURE__*/n.forwardRef(function({startIcon:t,endIcon:f,description:p,action:u,href:b,selected:y=!1,disabled:w=!1,className:j,children:k,onClick:z,...C},I){const{size:$,density:B,dividers:L}=n.useContext(v),R=Boolean(z||b)&&!w,F=l[B][$],M=g[B][$],P=a("flex min-w-0 flex-1 items-center text-start",F,M,o[$],x[$],h,c,L?"":N[$],w?"cursor-not-allowed text-(--neba-disabled-fg)":y?"bg-(--n-soft-press) font-medium text-(--n-accent)":"",R?`cursor-pointer ${i}`:"",R&&!y?"hover:bg-(--n-soft)":"",R&&y?"hover:bg-(--n-soft-press)":""),q=r(s,{children:[d(t)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:t}):null,r("span",{className:"flex min-w-0 flex-1 flex-col",children:[d(k)?e("span",{className:"truncate",children:k}):null,d(p)?e("span",{className:`truncate text-(--neba-muted-fg) ${m[$]}`,children:p}):null]}),d(f)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:f}):null]});return r("li",{ref:I,className:a("flex w-full items-center",j??""),...C,children:[R&&b?e("a",{href:b,className:P,"aria-current":y?"page":void 0,onClick:z,children:q}):R?e("button",{type:"button",className:P,"aria-current":!!y||void 0,onClick:z,children:q}):e("div",{className:P,"aria-disabled":w||void 0,children:q}),d(u)?e("div",{className:`flex shrink-0 items-center ${F}`,children:u}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as e,jsx as
|
|
1
|
+
"use client";import{jsxs as e,jsx as t}from"react/jsx-runtime";import*as n from"react";import{Menubar as o}from"@base-ui/react/menubar";import{Menu as r}from"../menu/Menu.js";import{MenuContext as s}from"../../internal/menu.js";import{controlTextClasses as i,cx as a,gapClasses as l,hasContent as c,iconClasses as d,paddingXClasses as u,radiusClasses as f,transitionClasses as m}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const b={xs:"h-4.5",sm:"h-5.5",md:"h-6.5",lg:"h-8",xl:"h-10"},h=["inline-flex shrink-0 cursor-pointer select-none items-center justify-center","whitespace-nowrap font-medium leading-none","text-(--neba-fg) bg-transparent","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",m,d,"hover:bg-(--n-soft)","data-[popup-open]:bg-(--n-soft-hover) data-[popup-open]:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","disabled:cursor-not-allowed disabled:text-(--neba-disabled-fg) disabled:hover:bg-transparent"].join(" ");export function MenubarMenu({label:o,startIcon:a,disabled:d=!1,children:m}){const{size:p,color:x,density:v}=n.useContext(s);return t(r,{size:p,color:x,density:v,disabled:d,openOnHover:!0,sideOffset:4,trigger:e("button",{type:"button",disabled:d,className:[h,b[p],i[p],l[p],u["default"===v?"compact":v][p],f[p]].join(" "),children:[c(a)?a:null,o]}),children:m})}export const Menubar=/*@__PURE__*/n.forwardRef(function(e,r){const{size:i="md",color:c="primary",density:d="default",orientation:u="horizontal",modal:f=!0,loopFocus:m=!0,disabled:b=!1,className:h,style:x,children:v,...g}=p(e,["size","density"]),y=n.useMemo(()=>({size:i,color:c,density:d}),[i,c,d]);return t(s.Provider,{value:y,children:t(o,{ref:r,orientation:u,modal:f,loopFocus:m,disabled:b,className:a("flex items-center","vertical"===u?"flex-col items-stretch":"flex-row",l[i],h??""),style:{"--n-soft":`var(--neba-${c}-soft)`,"--n-soft-hover":`var(--neba-${c}-soft-hover)`,"--n-accent":`var(--neba-${c}-accent)`,"--n-ring":`var(--neba-${c}-ring)`,...x},...g,children:v})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Meter as l}from"@base-ui/react/meter";import{barThicknessClasses as t,progressFraction as n,progressSlots as s}from"../../internal/progress.js";import{cx as o,metaTextClasses as i,stackGapClasses as m}from"../../internal/styles.js";export const Meter=/*@__PURE__*/a.forwardRef(function({value:
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{Meter as l}from"@base-ui/react/meter";import{barThicknessClasses as t,progressFraction as n,progressSlots as s}from"../../internal/progress.js";import{cx as o,metaTextClasses as i,stackGapClasses as m}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export const Meter=/*@__PURE__*/a.forwardRef(function(a,u){const{value:c,min:d=0,max:b=100,label:h,showValue:p=!1,format:x,thresholds:v,size:j="md",color:g="primary",className:w,style:N,...y}=f(a,["size"]),_=n(c,d,b),k=function(e,r,a){if(!a||0===a.length)return r;let l=r;for(const r of a)e>=r.from&&(l=r.color);return l}(c,g,v),M=void 0!==x;return r(l.Root,{ref:u,value:c,min:d,max:b,format:x,className:o("flex w-full flex-col",m[j],w??""),style:{...s(k),...N},...y,children:[h||p?r("div",{className:["flex items-baseline gap-2",h?"justify-between":"justify-end",i[j]].join(" "),children:[h?e(l.Label,{className:"min-w-0 truncate text-(--neba-fg)",children:h}):null,p?e(l.Value,{className:"shrink-0 tabular-nums text-(--neba-muted-fg)",children:e=>M?e:`${Math.round(100*(_??0))}%`}):null]}):null,e(l.Track,{className:`relative w-full overflow-hidden rounded-full bg-(--n-soft) ${t[j]}`,children:e(l.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{useRender as a}from"@base-ui/react/use-render";import{transitionProps as n}from"../../internal/animate.js";import{MockupCutout as o,defaultNotch as s,elevationFilters as h,finishSlots as d,mockupChrome as l,mockupMetrics as c,resolveOs as u,shellClasses as m}from"../../internal/mockup.js";import{observeResize as p}from"../../internal/observe.js";import{cx as f,surfaceSlots as g}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import*as r from"react";import{useRender as a}from"@base-ui/react/use-render";import{transitionProps as n}from"../../internal/animate.js";import{MockupCutout as o,defaultNotch as s,elevationFilters as h,finishSlots as d,mockupChrome as l,mockupMetrics as c,resolveOs as u,shellClasses as m}from"../../internal/mockup.js";import{observeResize as p}from"../../internal/observe.js";import{cx as f,surfaceSlots as g}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const v="undefined"==typeof document?r.useEffect:r.useLayoutEffect;export const Mockup=/*@__PURE__*/r.forwardRef(function(w,y){const{device:x,os:k,hardware:N="monitor",size:R="md",resolution:$,orientation:z="portrait",bezel:j="standard",finish:M="graphite",notch:W,systemUi:H=!0,scroll:B=!1,wallpaper:C,time:E="9:41",width:L,height:P,color:S="primary",elevation:F=0,transition:I,render:T,className:U,style:q,children:A,...D}=b(w,["size"]),G=u(x,k),J=W??s(x,G),K="desktop"!==x&&"landscape"===z,O=c({device:x,size:R,resolution:$,orientation:z,bezel:j,hardware:N}),{screen:Q,frame:V,body:X,stand:Y,base:Z}=O,_=r.useRef(null),[ee,te]=r.useState(null);v(()=>{const e=_.current;if(!e)return;const t=()=>{const t=e.getBoundingClientRect();if(t.width<=0||t.height<=0)return;const i=Math.min(t.width/V.width,t.height/V.height);te(e=>null!==e&&Math.abs(e-i)<1e-4?e:i)};return t(),p(e,t)},[V.width,V.height]);const ie=r.useCallback(e=>{_.current=e,"function"==typeof y?y(e):y&&(y.current=e)},[y]),re=H?l({os:G,notch:J,landscape:K,time:E}):{},ae=n(I),ne="none"===j,oe=t("div",{className:"neba-mockup-screen relative flex flex-col overflow-hidden",style:{width:Q.width,height:Q.height,borderRadius:O.screenRadius,background:C??"var(--neba-surface)",boxShadow:ne?void 0:"inset 0 0 0 1px var(--n-shell-shade)"},children:[re.top?.node,t("div",{className:"flex min-h-0 flex-1",children:[re.start?.node,e("div",{className:"min-w-0 flex-1 "+(B?"overflow-auto":"overflow-hidden"),style:{containerType:"size",containerName:"neba-screen"},children:A})]}),re.bottom?.node,e(o,{notch:J,screen:Q,landscape:K})]}),se=f("neba-mockup relative block",ae.className,U??"");return a({render:T,ref:ie,props:{className:se,style:{...g(S,F),...d[M],...ae.style,width:L??(void 0===P?"100%":"auto"),height:P??"auto",aspectRatio:`${V.width} / ${V.height}`,filter:h[F],...q},children:t("div",{className:"absolute top-1/2 left-1/2 flex flex-col items-center",style:{width:V.width,height:V.height,transform:`translate(-50%, -50%) scale(${ee??1})`,visibility:null===ee?"hidden":void 0},children:[e("div",{className:ne?"":m,style:{width:X.width,height:X.height,borderRadius:O.frameRadius,paddingBlock:`${O.bezel.top}px ${O.bezel.bottom}px`,paddingInline:O.bezel.x},children:oe}),Y?t(i,{children:[e("div",{"aria-hidden":"true",style:{width:Y.neckWidth,height:Y.neckHeight,background:"var(--n-shell-shade)",clipPath:"polygon(16% 0, 84% 0, 100% 100%, 0 100%)"}}),e("div",{"aria-hidden":"true",className:m,style:{width:Y.footWidth,height:Y.footHeight,borderRadius:Y.footHeight/2}})]}):null,Z?e("div",{"aria-hidden":"true",className:`relative ${m}`,style:{width:Z.width,height:Z.height,borderRadius:`0 0 ${Math.round(.55*Z.height)}px ${Math.round(.55*Z.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:Z.lipWidth,height:Math.round(.34*Z.height),marginLeft:-Z.lipWidth/2,borderRadius:`0 0 ${Math.round(.2*Z.height)}px ${Math.round(.2*Z.height)}px`,background:"var(--n-shell-shade)"}})}):null]}),...D}})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { NebaElevation, NebaFieldSlot, NebaSlots, NebaStyleProps } from '../../types.js';
|
|
2
|
+
import type { NebaElevation, NebaFieldSlot, NebaShortcuts, NebaSlots, NebaStyleProps } from '../../types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Where the two steppers sit.
|
|
5
5
|
*
|
|
@@ -114,6 +114,16 @@ export interface NumberFieldProps extends NebaStyleProps, Omit<React.ComponentPr
|
|
|
114
114
|
* `<input>` itself is `classNames.control`.
|
|
115
115
|
*/
|
|
116
116
|
classNames?: NebaSlots<NumberFieldSlot>;
|
|
117
|
+
/**
|
|
118
|
+
* Key combinations to act on, spelled the way
|
|
119
|
+
* [Shortcut](../display/shortcut) draws them — `{ Enter: commit }`.
|
|
120
|
+
*
|
|
121
|
+
* Bound to the `<input>` rather than to the root, which is the difference
|
|
122
|
+
* that makes it worth having here: a plain `onKeyDown` lands on the column
|
|
123
|
+
* the label and the messages are in, so `event.currentTarget` is not the
|
|
124
|
+
* field and the arrow keys the steppers use never reach it as themselves.
|
|
125
|
+
*/
|
|
126
|
+
shortcuts?: NebaShortcuts<HTMLInputElement>;
|
|
117
127
|
}
|
|
118
128
|
/**
|
|
119
129
|
* A field that only holds a number.
|
|
@@ -129,4 +139,4 @@ export interface NumberFieldProps extends NebaStyleProps, Omit<React.ComponentPr
|
|
|
129
139
|
* clamping, the press-and-hold repeat on the steppers, and the hidden input
|
|
130
140
|
* that submits with a form.
|
|
131
141
|
*/
|
|
132
|
-
export declare function NumberField(
|
|
142
|
+
export declare function NumberField(rawProps: NumberFieldProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{NumberField as t}from"@base-ui/react/number-field";import{Field as a}from"@base-ui/react/field";import{numberMessages as l,useMessages as r}from"../../internal/i18n.js";import{MinusIcon as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import{NumberField as t}from"@base-ui/react/number-field";import{Field as a}from"@base-ui/react/field";import{numberMessages as l,useMessages as r}from"../../internal/i18n.js";import{MinusIcon as s,PlusIcon as i}from"../../internal/icons.js";import{keyHandler as o}from"../../internal/keys.js";import{controlHeightClasses as c,controlTextLeadingClasses as d,cx as m,disabledClasses as u,fieldReadOnlyClasses as p,fieldRestClasses as f,focusWithinRingClasses as b,gapClasses as h,hasContent as x,iconClasses as g,metaTextClasses as v,paddingXClasses as N,radiusClasses as j,stackGapClasses as y,surfaceSlots as w,transitionClasses as k}from"../../internal/styles.js";import{useStyleDefaults as S}from"../../internal/defaults.js";const _=["group relative flex w-full cursor-text items-center","[-webkit-tap-highlight-color:transparent]",k,"focus-within:[transition-duration:0ms]",b,g].join(" "),V=["inline-flex size-[1.7em] shrink-0 cursor-pointer items-center justify-center","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-accent)","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 function NumberField(b){const{variant:g="outline",size:k="md",color:z="primary",density:C="default",elevation:I=0,value:O,defaultValue:D,onValueChange:L,onValueCommitted:W,min:q,max:F,step:R,largeStep:B,smallStep:E,snapOnStep:G,allowWheelScrub:K=!1,format:$,locale:A,steppers:H="end",incrementLabel:J,decrementLabel:M,label:P,description:Q,error:T,invalid:U,startIcon:X,endIcon:Y,fullWidth:Z=!1,disabled:ee=!1,readOnly:ne=!1,required:te=!1,name:ae,placeholder:le,id:re,className:se,classNames:ie,shortcuts:oe,style:ce,...de}=S(b,["size","density","variant","locale"]),me=r(l,"string"==typeof A?A:void 0),ue=x(T),pe=U??ue,fe=pe?"danger":z,be=N[C][k],he={end:`${be} pe-1`,split:"px-1",none:be},xe=e(t.Decrement,{"aria-label":M??me.decrease,className:m(V,ie?.stepper),children:e(s,{})}),ge=e(t.Increment,{"aria-label":J??me.increase,className:m(V,ie?.stepper),children:e(i,{})}),ve="none"!==H&&!ne;return n(a.Root,{disabled:ee,invalid:pe,className:m("flex-col align-top",y[k],Z?"flex w-full":"inline-flex",se??""),style:{...w(fe,I),...ce},...de,children:[P?e(a.Label,{className:m(v[k],"font-medium",ee?"text-(--neba-disabled-fg)":"text-(--neba-fg)",ie?.label),children:P}):null,e(t.Root,{id:re,name:ae,className:"contents",value:O,defaultValue:D,onValueChange:e=>L?.(e),onValueCommitted:e=>W?.(e),min:q,max:F,step:R,largeStep:B,smallStep:E,snapOnStep:G,allowWheelScrub:K,format:$,locale:A,disabled:ee,readOnly:ne,required:te,children:n(t.Group,{className:m(_,c[k],d[k],j[k],h[k],ve?he[H]:be,ee?u[g]:ne?p[g]:f[g],ie?.shell),children:[ve&&"split"===H?xe:null,X?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:X}):null,e(t.Input,{onKeyDown:o(oe),placeholder:le,className:["min-w-0 flex-1 self-stretch bg-transparent [font:inherit] text-inherit","[outline:none]","tabular-nums","split"===H&&ve?"text-center":"","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",ie?.control].filter(Boolean).join(" ")}),Y?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:Y}):null,ve&&"end"===H?n("span",{className:"flex shrink-0 items-center gap-0.5",children:[xe,ge]}):null,ve&&"split"===H?ge:null]})}),Q?e(a.Description,{className:m(v[k],"text-(--neba-muted-fg)",ie?.description),children:Q}):null,e(a.Error,ue?{match:!0,className:m(v[k],"text-(--n-accent)",ie?.error),children:T}:{className:m(v[k],"text-(--n-accent)",ie?.error)})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Field as n}from"@base-ui/react/field";import{OTPField as l}from"@base-ui/react/otp-field";import{cx as r,disabledClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as t from"react";import{Field as n}from"@base-ui/react/field";import{OTPField as l}from"@base-ui/react/otp-field";import{cx as r,disabledClasses as i,fieldReadOnlyClasses as s,fieldRestClasses as o,metaTextClasses as m,stackGapClasses as d,surfaceSlots as u,transitionClasses as c}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const f={xs:"h-7 w-6",sm:"h-8 w-7",md:"h-10 w-8",lg:"h-12 w-10",xl:"h-14 w-12"},x={xs:"rounded-[0.3125rem]",sm:"rounded-[0.375rem]",md:"rounded-[0.4375rem]",lg:"rounded-[0.5625rem]",xl:"rounded-[0.6875rem]"},g={xs:"text-[0.8125rem]",sm:"text-[0.9375rem]",md:"text-[1.0625rem]",lg:"text-[1.25rem]",xl:"text-[1.5rem]"},h={default:{xs:"gap-1",sm:"gap-1",md:"gap-1.5",lg:"gap-2",xl:"gap-2.5"},compact:{xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"}},b={numeric:"numeric",alpha:"alpha",alphanumeric:"alphanumeric",any:"none"};export const OtpField=/*@__PURE__*/t.forwardRef(function(y,v){const{variant:N="outline",size:V="md",color:w="primary",density:j="default",elevation:C=0,length:F=6,charset:M="numeric",mask:z=!1,groupSize:I,separator:O="–",value:R,defaultValue:S,onValueChange:k,onComplete:q,onValueInvalid:_,autoSubmit:A=!1,label:D,description:E,error:L,invalid:T,name:B,required:G=!1,disabled:H=!1,readOnly:J=!1,autoFocus:K=!1,className:P,style:Q,...U}=p(y,["size","density","variant"]),W=Math.min(12,Math.max(2,Math.round(F))),X=null!=L&&!1!==L&&""!==L,Y=T??X,Z=Y?"danger":w,$=r("text-center font-medium [font-family:inherit]",f[V],g[V],x[V],c,"caret-(--n-accent) selection:bg-(--n-soft-press)","focus:[outline:2px_solid_var(--n-ring)] focus:outline-offset-1","focus:[transition-duration:0ms]",H?i[N]:J?s[N]:o[N]),ee=I&&I>0?Math.round(I):0;return a(n.Root,{disabled:H,invalid:Y,className:r("inline-flex flex-col align-top",d[V],P),style:{...u(Z,C),...Q},children:[D?e(n.Label,{className:r(m[V],"font-medium",H?"text-(--neba-disabled-fg)":"text-(--neba-fg)"),children:D}):null,e(l.Root,{ref:v,length:W,validationType:b[M],mask:z,name:B,required:G,disabled:H,readOnly:J,autoSubmit:A,value:R,defaultValue:S,onValueChange:e=>k?.(e),onValueComplete:e=>q?.(e),onValueInvalid:e=>_?.(e),className:r("flex items-center",h[j][V]),...U,children:Array.from({length:W},(n,i)=>a(t.Fragment,{children:[ee>0&&i>0&&i%ee===0?e("span",{"aria-hidden":"true",className:r("select-none px-0.5 text-(--neba-muted-fg)",g[V]),children:O}):null,e(l.Input,{className:$,autoFocus:K&&0===i})]},i))}),E?e(n.Description,{className:r(m[V],"text-(--neba-muted-fg)"),children:E}):null,e(n.Error,X?{match:!0,className:r(m[V],"text-(--n-accent)"),children:L}:{className:r(m[V],"text-(--n-accent)")})]})});
|
|
@@ -87,4 +87,4 @@ export interface OverlayProps extends Omit<React.ComponentPropsWithoutRef<'div'>
|
|
|
87
87
|
* held inside, the page behind going inert, and focus returning to wherever it
|
|
88
88
|
* came from when the overlay closes.
|
|
89
89
|
*/
|
|
90
|
-
export declare function Overlay(
|
|
90
|
+
export declare function Overlay(rawProps: OverlayProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as r}from"@base-ui/react/dialog";import{overlayMessages as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Dialog as r}from"@base-ui/react/dialog";import{overlayMessages as t,useMessages as l}from"../../internal/i18n.js";import{cx as n,surfaceSlots as i}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";const o={scrim:"bg-(--neba-scrim) [backdrop-filter:blur(2px)]",blur:"[background-color:color-mix(in_oklab,var(--neba-scrim)_55%,transparent)] [backdrop-filter:blur(14px)_saturate(1.4)]",solid:"bg-(--neba-surface)",clear:""},c={start:"items-start",center:"items-center",end:"items-end"},m={xs:"p-3",sm:"p-4",md:"p-6",lg:"p-8",xl:"p-10"},p=["[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"].join(" ");export function Overlay(d){const{open:b,defaultOpen:f,onOpenChange:u,tone:x="scrim",dismissible:y=!1,modal:g=!0,align:j="center",size:h="md",color:k="primary",locale:O,label:_,className:v,style:z,children:N,...P}=s(d,["size","locale"]),w=l(t,O);return e(r.Root,{open:b,defaultOpen:f,modal:g,disablePointerDismissal:!y,onOpenChange:(e,a)=>{y||e||"escape-key"!==a.reason?u?.(e):a.cancel()},children:a(r.Portal,{children:[e(r.Backdrop,{className:`neba-portal fixed inset-0 z-50 ${p} ${o[x]}`}),e(r.Viewport,{className:["neba-portal fixed inset-0 z-50 flex justify-center",c[j],m[h]].join(" "),children:e(r.Popup,{"aria-label":_??w.label,className:n("flex max-h-full max-w-full flex-col items-center justify-center","[outline:none]",p,v??""),style:{...i(k,0),...z},...P,children:N})})]})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as o from"react";import{layoutMessages as n,useMessages as t}from"../../internal/i18n.js";import{PageLayoutContext as r,SidebarSideContext as a}from"../../internal/page-layout.js";import{observeResize as s}from"../../internal/observe.js";import{controlSlots as i,cx as u,hasContent as f,toLength as c}from"../../internal/styles.js";import{useStyleDefaults as d}from"../../internal/defaults.js";const p=["header","footer"];export const PageLayout=/*@__PURE__*/o.forwardRef(function(m,h){const{header:v,footer:x,sidebar:y,endSidebar:b,headerSpan:g="full",footerSpan:w="full",scroll:S="page",height:k="viewport",collapseBelow:C="md",sidebarOpen:P,defaultSidebarOpen:j=!1,onSidebarOpenChange:N,endSidebarOpen:O,defaultEndSidebarOpen:$=!1,onEndSidebarOpenChange:R,skipLink:z=!0,skipLabel:E,mainId:L="main",mainProps:B,locale:H,color:M="primary",className:_,style:I,children:T,...q}=d(m,["locale"]),A=t(n,H),[D,F]=o.useState(j),[G,J]=o.useState($),K=o.useMemo(()=>({start:P??D,end:O??G}),[P,D,O,G]),Q=o.useCallback((e,l)=>{if("start"===e)return void 0===P&&F(l),void N?.(l);void 0===O&&J(l),R?.(l)},[P,O,N,R]),U=o.useRef(null),V=o.useCallback(e=>{U.current=e,"function"==typeof h?h(e):h&&(h.current=e)},[h]),W=o.useRef({header:null,footer:null}),X=o.useRef({header:null,footer:null}),Y=o.useCallback(()=>{const e=U.current;if(e)for(const l of p){const o=W.current[l],n="header"===l?g:w;if(!o){e.style.setProperty(`--n-layout-${l}`,"0px"),e.style.setProperty(`--n-layout-${l}-inset`,"0px");continue}const t=getComputedStyle(o).position,r=`${o.offsetHeight}px`,a="sticky"===t||"fixed"===t;e.style.setProperty(`--n-layout-${l}`,a&&"full"===n?r:"0px"),e.style.setProperty(`--n-layout-${l}-inset`,"fixed"===t?r:"0px")}},[g,w]),Z=o.useCallback(()=>{for(const e of p){X.current[e]?.();const l=W.current[e];X.current[e]=l?s(l,()=>Y()):null}Y()},[Y]);o.useEffect(()=>{const e=X.current;return Z(),()=>{for(const l of p)e[l]?.(),e[l]=null}},[Z]);const ee=o.useCallback((e,l)=>{W.current[e]=l,Z()},[Z]),le=o.useMemo(()=>({present:!0,register:ee,collapseBelow:C,open:K,setOpen:Q,scroll:S,locale:H}),[ee,C,K,Q,S,H]),oe="content"===S,ne=c("viewport"===k||"auto"===k?void 0:k),te=void 0!==ne?"":"auto"===k?oe?"h-full":"min-h-full":oe?"h-dvh":"min-h-dvh",re=f(v)?v:null,ae=f(x)?x:null;return e(r.Provider,{value:le,children:l("div",{ref:V,className:u("relative flex w-full flex-col",oe?"overflow-hidden":"",te,"full"===g?"[padding-top:var(--n-layout-header-inset,0px)]":"","full"===w?"[padding-bottom:var(--n-layout-footer-inset,0px)]":"",_),style:void 0===ne?I:{...oe?{height:ne}:{minHeight:ne},...I},...q,children:[z?e("a",{href:`#${L}`,className:u("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:i(M,2,"solid"),children:E??A.skipToContent}):null,"full"===g?re:null,l("div",{className:u("flex w-full flex-1",oe?"min-h-0":""),children:[f(y)?e(a.Provider,{value:"start",children:y}):null,l("div",{className:u("flex min-w-0 flex-1 flex-col",oe?"min-h-0":"","content"===g?"[padding-top:var(--n-layout-header-inset,0px)]":"","content"===w?"[padding-bottom:var(--n-layout-footer-inset,0px)]":""),children:["content"===g?re:null,e("main",{...B,id:L,className:u("min-w-0 flex-1",oe?"min-h-0 overflow-y-auto":"",B?.className),children:T}),"content"===w?ae:null]}),f(b)?e(a.Provider,{value:"end",children:b}):null]}),"full"===w?ae:null]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Button as n}from"../button/Button.js";import{fillMessage as r,paginationMessages as l,useMessages as i}from"../../internal/i18n.js";import{ChevronIcon as s}from"../../internal/icons.js";import{controlTextClasses as o,cx as m,gapClasses as c,srOnlyClasses as u}from"../../internal/styles.js";function
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Button as n}from"../button/Button.js";import{fillMessage as r,paginationMessages as l,useMessages as i}from"../../internal/i18n.js";import{ChevronIcon as s}from"../../internal/icons.js";import{controlTextClasses as o,cx as m,gapClasses as c,srOnlyClasses as u}from"../../internal/styles.js";import{useStyleDefaults as d}from"../../internal/defaults.js";function h(e,t){return Array.from({length:Math.max(0,t-e+1)},(t,a)=>e+a)}function f(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"m7.5 4.5 3.5 3.5-3.5 3.5M3.5 4.5 7 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const p={xs:"h-5.5 min-w-5.5",sm:"h-6.5 min-w-6.5",md:"h-8 min-w-8",lg:"h-10 min-w-10",xl:"h-12 min-w-12"};export const Pagination=/*@__PURE__*/a.forwardRef(function(x,g){const{variant:b="text",size:v="md",color:y="primary",density:M="compact",elevation:j=0,count:w,page:N,defaultPage:L=1,onPageChange:k,siblingCount:C=1,boundaryCount:z=1,showEdges:K=!1,showArrows:P=!0,disabled:S=!1,getPageHref:$,locale:A,label:B,pageLabel:D,previousLabel:E,nextLabel:H,firstLabel:I,lastLabel:R,className:W,children:q,...F}=d(x,["size","density","variant","locale"]),G=i(l,A),J=D??(e=>r(G.page,{page:String(e)})),[O,Q]=a.useState(L),T=Math.min(Math.max(N??O,1),Math.max(w,1));if(w<2)return null;const U=function(e,t,a,n){const r=h(1,Math.min(n,e)),l=h(Math.max(e-n+1,n+1),e),i=Math.max(Math.min(t-a,e-n-2*a-1),n+2),s=Math.min(Math.max(t+a,n+2*a+2),l.length>0?l[0]-2:e-1);return[...r,...i>n+2?["start-ellipsis"]:n+1<e-n?[n+1]:[],...h(i,s),...s<e-n-1?["end-ellipsis"]:e-n>n?[e-n]:[],...l]}(w,T,C,z),V=T<=1,X=T>=w,Y=(t,a,n)=>$&&!a?{render:e("a",{href:$(t),rel:n})}:null,Z=(e,t)=>{e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||$&&!k||(e.preventDefault(),(e=>{const t=Math.min(Math.max(e,1),w);t!==T&&(void 0===N&&Q(t),k?.(t))})(t))},_=(t,a,r,l,i,s,o)=>e("li",{className:"flex",children:e(n,{variant:b,size:v,color:y,density:M,elevation:j,disabled:S||l,"aria-label":a,startIcon:e("span",{className:`flex items-center ${i}`,children:s}),onClick:e=>Z(e,r),...Y(r,S||l,o)})},t);return t("nav",{ref:g,"aria-label":B??G.label,className:m("flex items-center",W??""),...F,children:[t("ul",{role:"list",className:`m-0 flex list-none items-center p-0 ${c[v]}`,children:[K?_("first",I??G.first,1,V,"rotate-180 rtl:rotate-0",e(f,{})):null,P?_("previous",E??G.previous,T-1,V,"rotate-90 rtl:-rotate-90",e(s,{}),"prev"):null,U.map((t,a)=>e("li","number"==typeof t?{className:"flex",children:e(n,{variant:t===T?"solid":b,size:v,color:y,density:M,elevation:j,disabled:S,"aria-label":J(t),"aria-current":t===T?"page":void 0,className:"tabular-nums",onClick:e=>Z(e,t),...Y(t,S||t===T),children:t})}:{"aria-hidden":"true",className:["flex select-none items-center justify-center","text-(--neba-muted-fg)",o[v],p[v]].join(" "),children:"…"},`slot-${a}`)),P?_("next",H??G.next,T+1,X,"-rotate-90 rtl:rotate-90",e(s,{}),"next"):null,K?_("last",R??G.last,w,X,"rtl:rotate-180",e(f,{})):null]}),e("span",{className:u,"aria-live":"polite",children:r(G.status,{page:String(T),total:String(w)})}),q]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{beginPointerDrag as r}from"../../internal/drag.js";import{observeResize as i}from"../../internal/observe.js";import{cx as o,toPixels as a,transitionClasses as l}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{beginPointerDrag as r}from"../../internal/drag.js";import{observeResize as i}from"../../internal/observe.js";import{cx as o,toPixels as a,transitionClasses as l}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";const c=/*@__PURE__*/t.createContext({basis:null}),u={xs:"basis-1",sm:"basis-1.5",md:"basis-2",lg:"basis-2.5",xl:"basis-3"},f={xs:4,sm:6,md:8,lg:10,xl:12};function m(e,n,t){if(null!=e)return"number"==typeof e?n*e/100:a(e,{percentOf:n,relativeTo:t})}export const Panes=/*@__PURE__*/t.forwardRef(function(a,d){const{orientation:h="horizontal",resizable:p=!0,color:g="primary",size:x="md",onResize:v,onResizeEnd:b,className:z,style:w,children:y,...R}=s(a,["size"]),M=t.Children.toArray(y).filter(t.isValidElement),S=M.length,j=t.useRef(null),C=t.useCallback(e=>{j.current=e,"function"==typeof d?d(e):d&&(d.current=e)},[d]),k=t.useRef([]);k.current=M.map(e=>e.props);const[N,$]=t.useState(null),A=N&&N.length===S?N:null,E=t.useRef(null);E.current=A;const D="horizontal"===h,P=f[x]*Math.max(0,S-1);function I(e){const n=j.current,t=E.current;if(!p||!n||!t||void 0===t[e+1])return null;const r=n.getBoundingClientRect(),i=(D?r.width:r.height)-P;if(i<=0)return null;const o=k.current[e],a=k.current[e+1],l=t[e]*i,s=l+t[e+1]*i,c=Math.max(m(o?.minSize,i,n)??0,s-(m(a?.maxSize,i,n)??s)),u=Math.min(m(o?.maxSize,i,n)??s,s-(m(a?.minSize,i,n)??0));return u<c?null:{root:n,current:t,extent:i,start:l,pair:s,resize(n){const r=Math.min(u,Math.max(c,l+n)),o=[...t];return o[e]=r/i,o[e+1]=(s-r)/i,$(o),v?.(o.map(e=>100*e)),o}}}t.useEffect(()=>{const e=j.current;if(!e)return;const n=()=>{const n=e.getBoundingClientRect(),t=(D?n.width:n.height)-P;t<=0||$(n=>n&&n.length===S?n:function(e,n,t){const r=e.map(e=>m(e.defaultSize,n,t)),i=r.reduce((e,n)=>e+(n??0),0),o=r.filter(e=>void 0===e).length,a=o>0?Math.max(0,n-i)/o:0,l=r.map(e=>Math.max(0,e??a)),s=l.reduce((e,n)=>e+n,0);return s<=0?l.map(()=>1/Math.max(1,l.length)):l.map(e=>e/s)}(k.current,t,e))};return n(),i(e,n)},[S,D,P]);const B=t.useRef(null);t.useEffect(()=>()=>B.current?.(),[]);const F=o("group/handle relative z-1 flex shrink-0 grow-0 items-center justify-center",u[x],l,"[outline:none] focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-0",p?o(D?"cursor-col-resize":"cursor-row-resize","hover:bg-(--n-soft) data-[dragging]:bg-(--n-soft)"):"");return e("div",{ref:C,className:o("flex h-full w-full",D?"flex-row":"flex-col","min-h-0 min-w-0",z),style:{"--n-accent":`var(--neba-${g}-accent)`,"--n-soft":`var(--neba-${g}-soft)`,"--n-ring":`var(--neba-${g}-ring)`,...w},...R,children:M.map((i,a)=>n(t.Fragment,{children:[a>0?e("div",{role:"separator","aria-orientation":D?"vertical":"horizontal","aria-valuenow":A?Math.round(100*A[a-1]):void 0,"aria-valuemin":0,"aria-valuemax":100,"aria-disabled":!p||void 0,tabIndex:p?0:-1,className:F,onPointerDown:e=>{0===e.button&&function(e,n){const t=I(e);if(!t)return;const i=n.currentTarget,o=D?n.clientX:n.clientY,a=D&&"rtl"===getComputedStyle(t.root).direction?-1:1;let l=t.current;B.current=r({target:i,pointerId:n.pointerId,onMove:e=>{const n=D?e.clientX:e.clientY;l=t.resize((n-o)*a)},onEnd:()=>{B.current=null,b?.(l.map(e=>100*e))}})}(a-1,e)},onKeyDown:e=>{const n=D?"ArrowLeft":"ArrowUp",t=D?"ArrowRight":"ArrowDown";e.key!==n&&e.key!==t||(e.preventDefault(),function(e,n){const t=I(e);if(!t)return;const r=t.resize(n);b?.(r.map(e=>100*e))}(a-1,e.key===t?16:-16))},children:e("span",{"aria-hidden":"true",className:o("pointer-events-none bg-(--neba-border)",l,D?"h-full w-px":"h-px w-full",p?"group-hover/handle:bg-(--n-accent) group-focus-visible/handle:bg-(--n-accent) group-data-[dragging]/handle:bg-(--n-accent)":"")})}):null,e(c.Provider,{value:{basis:A?`calc((100% - ${P}px) * ${A[a].toFixed(6)})`:null},children:i})]},i.key??a))})});export const Pane=/*@__PURE__*/t.forwardRef(function({defaultSize:n,minSize:r,maxSize:i,className:a,style:l,children:s,...u},f){const{basis:m}=t.useContext(c);return e("div",{ref:f,className:o("relative min-h-0 min-w-0 overflow-auto",a),style:{flex:m?`0 0 ${m}`:"1 1 0%",...l},...u,children:s})});
|
|
@@ -55,4 +55,4 @@ export interface PieChartProps extends ChartBaseProps {
|
|
|
55
55
|
* A slice's colour follows the slice and not its size, so a chart that is
|
|
56
56
|
* refiltered or resorted keeps every category the colour it had.
|
|
57
57
|
*/
|
|
58
|
-
export declare function PieChart(
|
|
58
|
+
export declare function PieChart(rawProps: PieChartProps): React.JSX.Element;
|