neba 1.16.2 → 1.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/a2ui/adapter-catalog.json +1 -0
- package/dist/a2ui/catalog.json +632 -145
- package/dist/a2ui/components.js +1 -1
- package/dist/a2ui/index.d.ts +22 -10
- package/dist/a2ui/index.js +1 -1
- package/dist/a2ui/schema.d.ts +8 -6
- package/dist/a2ui/schema.js +1 -1
- 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.d.ts +3 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-counter/AnimateCounter.d.ts +11 -4
- package/dist/components/animate-counter/AnimateCounter.js +1 -1
- package/dist/components/animate-scramble/AnimateScramble.d.ts +6 -3
- package/dist/components/animate-scramble/AnimateScramble.js +1 -1
- package/dist/components/animate-split/AnimateSplit.d.ts +6 -3
- package/dist/components/animate-split/AnimateSplit.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/avatar/Avatar.js +1 -1
- package/dist/components/bar-chart/BarChart.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.d.ts +3 -3
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/card/Card.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/chip/Chip.d.ts +4 -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.d.ts +3 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/confirm/Confirm.js +1 -1
- package/dist/components/context-window/ContextWindow.d.ts +4 -1
- package/dist/components/context-window/ContextWindow.js +1 -1
- package/dist/components/data-list/DataList.d.ts +3 -2
- package/dist/components/data-list/DataList.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +11 -5
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.d.ts +3 -2
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/fieldset/Fieldset.js +1 -1
- package/dist/components/file-picker/FilePicker.d.ts +4 -0
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/footer/Footer.d.ts +4 -2
- package/dist/components/form/Form.d.ts +0 -14
- package/dist/components/form/Form.js +1 -1
- package/dist/components/gallery/Gallery.js +1 -1
- package/dist/components/gallery/GalleryViewer.js +1 -1
- package/dist/components/header/Header.d.ts +4 -3
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/hover-card/HoverCard.d.ts +1 -1
- package/dist/components/how-to-steps/HowToSteps.d.ts +2 -1
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/image/Image.d.ts +4 -1
- package/dist/components/image/Image.js +1 -1
- package/dist/components/inline-citation/InlineCitation.d.ts +4 -2
- package/dist/components/inline-citation/InlineCitation.js +1 -1
- package/dist/components/menu/Menu.d.ts +6 -2
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.d.ts +1 -1
- package/dist/components/navigation-menu/NavigationMenu.js +1 -1
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/overlay/Overlay.d.ts +1 -1
- package/dist/components/page-layout/PageLayout.js +1 -1
- package/dist/components/pagination/Pagination.d.ts +3 -2
- 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/prompt-input/PromptInput.d.ts +5 -3
- package/dist/components/prompt-input/PromptInput.js +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/reasoning/Reasoning.d.ts +7 -4
- package/dist/components/reasoning/Reasoning.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.d.ts +7 -1
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scroll-area/ScrollArea.d.ts +12 -0
- 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 +2 -1
- package/dist/components/select/Select.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/sources/Sources.d.ts +1 -1
- package/dist/components/sources/Sources.js +1 -1
- package/dist/components/stack/Stack.js +1 -1
- package/dist/components/streaming-text/StreamingText.js +1 -1
- package/dist/components/switch/Switch.d.ts +13 -2
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/table/Table.d.ts +4 -2
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/text-link/TextLink.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.d.ts +6 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/tool-call/ToolCall.js +1 -1
- package/dist/components/tour/Tour.js +1 -1
- 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/typography/Typography.js +1 -1
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +2 -2
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/hooks/useElementSize.d.ts +6 -2
- package/dist/hooks/useElementSize.js +1 -1
- package/dist/hooks/useMediaQuery.d.ts +3 -2
- package/dist/hooks/useOnScreen.d.ts +2 -2
- package/dist/hooks/useShortcut.d.ts +11 -3
- package/dist/hooks/useShortcut.js +1 -1
- package/dist/internal/animate.d.ts +8 -0
- package/dist/internal/animate.js +1 -1
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-brush.d.ts +3 -1
- package/dist/internal/chart-brush.js +1 -1
- package/dist/internal/chart-frame.d.ts +28 -2
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +21 -0
- package/dist/internal/chart.js +1 -1
- package/dist/internal/drag.d.ts +15 -0
- package/dist/internal/drag.js +1 -1
- package/dist/internal/drop.d.ts +12 -8
- package/dist/internal/drop.js +1 -1
- package/dist/internal/highlight.js +1 -1
- package/dist/internal/i18n.d.ts +40 -4
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/icons.d.ts +3 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/link.d.ts +27 -0
- package/dist/internal/link.js +1 -1
- package/dist/internal/new-tab.d.ts +21 -0
- package/dist/internal/new-tab.js +1 -0
- package/dist/internal/notch.d.ts +23 -1
- package/dist/internal/notch.js +1 -1
- package/dist/internal/observe.d.ts +3 -4
- package/dist/internal/picker.d.ts +21 -3
- package/dist/internal/picker.js +1 -1
- package/dist/internal/run.d.ts +7 -5
- package/dist/internal/run.js +1 -1
- package/dist/internal/search.d.ts +3 -3
- package/dist/internal/styles.d.ts +33 -1
- package/dist/internal/styles.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/tailwind.css +31 -4
- package/package.json +9 -3
package/dist/a2ui/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as i}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,Fragment as i,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{createComponentImplementation as o}from"@a2ui/react/v0_9";import{Alert as l}from"../components/alert/Alert.js";import{Avatar as n}from"../components/avatar/Avatar.js";import{Button as s}from"../components/button/Button.js";import{Card as a}from"../components/card/Card.js";import{Checkbox as d}from"../components/checkbox/Checkbox.js";import{Chip as c}from"../components/chip/Chip.js";import{DataList as p,DataListItem as u}from"../components/data-list/DataList.js";import{Divider as m}from"../components/divider/Divider.js";import{Flex as b}from"../components/flex/Flex.js";import{Image as h}from"../components/image/Image.js";import{NumberField as v}from"../components/number-field/NumberField.js";import{Radio as y,RadioGroup as A}from"../components/radio-group/RadioGroup.js";import{Select as x}from"../components/select/Select.js";import{Slider as f}from"../components/slider/Slider.js";import{Statistic as g}from"../components/statistic/Statistic.js";import{Switch as C}from"../components/switch/Switch.js";import{TextField as z}from"../components/text-field/TextField.js";import{Typography as j}from"../components/typography/Typography.js";import S from"./adapter-catalog.json"with{type:"json"};import{componentSchema as k}from"./schema.js";function Children({list:t,buildChild:o}){if(!Array.isArray(t))return null;const l=new Map;return e(i,{children:t.map(i=>{const t="string"==typeof i?i:i.id,n="string"==typeof i?void 0:i.basePath,s=void 0===n?t:`${t}@${n}`,a=l.get(s)??0;return l.set(s,a+1),e(r.Fragment,{children:o(t,n)},0===a?s:`${s}#${a}`)})})}function F(i){const t=r.useId(),o=i.accessibility?.label||void 0,l=i.accessibility?.description||void 0;return{label:o,describedBy:l?t:void 0,note:l?e("span",{id:t,hidden:!0,children:l}):null}}function w(e,i){const[t,o]=r.useState(e),[l,n]=r.useState(e);return Object.is(e,l)||(n(e),o(e)),[t,e=>{o(e),i?.(e)}]}function V(e){return e.validationErrors?.[0]}function q(e,i){const t={name:e,schema:k(e,S.components[e])};return o(t,i)}export const A2uiFlex=q("Flex",({props:r,buildChild:o})=>{const l=r,n=F(l);return t(i,{children:[e(b,{role:n.label?"group":void 0,"aria-label":n.label,"aria-describedby":n.describedBy,direction:l.direction,spacing:l.spacing,justifyContent:l.justifyContent,alignItems:l.alignItems,wrap:l.wrap,children:e(Children,{list:l.children,buildChild:o})}),n.note]})});export const A2uiCard=q("Card",({props:r,buildChild:o})=>{const l=r,n=F(l);return t(i,{children:[e(a,{role:n.label?"group":void 0,"aria-label":n.label,"aria-describedby":n.describedBy,title:l.title,subtitle:l.subtitle,variant:l.variant,size:l.size,color:l.color,density:l.density,elevation:l.elevation,children:l.child?o(l.child):null}),n.note]})});export const A2uiDivider=q("Divider",({props:i})=>{const t=i;return e(m,{orientation:t.orientation,size:t.size,children:t.label})});export const A2uiAlert=q("Alert",({props:i,buildChild:t})=>{const r=i;return e(l,{title:r.title,color:r.color,variant:r.variant,size:r.size,density:r.density,children:r.child?t(r.child):null})});export const A2uiTypography=q("Typography",({props:i})=>{const t=i;return e(j,{level:t.level,weight:t.weight,align:t.align,color:t.color,lines:t.lines,children:t.text})});export const A2uiImage=q("Image",({props:r})=>{const o=r,l=F(o);return t(i,{children:[e(h,{src:o.src??"",alt:o.alt??"","aria-describedby":l.describedBy,ratio:o.ratio,fit:o.fit,rounded:o.rounded}),l.note]})});export const A2uiChip=q("Chip",({props:i})=>{const t=i;return e(c,{variant:t.variant,size:t.size,color:t.color,count:t.count,selected:t.selected,children:t.text})});export const A2uiAvatar=q("Avatar",({props:i})=>{const t=i;return e(n,{src:t.src,name:t.name,shape:t.shape,size:t.size,color:t.color})});export const A2uiStatistic=q("Statistic",({props:i})=>{const t=i,r=t.value??"",o=void 0!==t.previousValue&&/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i.test(r.trim())?Number(r):r;return e(g,{label:t.label,value:o,unit:t.unit,caption:t.caption,previousValue:t.previousValue,delta:t.delta,betterWhen:t.betterWhen,size:t.size,align:t.align})});export const A2uiDataList=q("DataList",({props:i})=>{const t=i;return e(p,{orientation:t.orientation,dividers:t.dividers,size:t.size,density:t.density,children:(t.items??[]).map((i,t)=>e(u,{label:i.label,children:i.value},`${i.label}-${t}`))})});export const A2uiButton=q("Button",({props:r})=>{const o=r,l=F(o);return t(i,{children:[e(s,{"aria-label":o.text?void 0:l.label,"aria-describedby":l.describedBy,onClick:o.action,variant:o.variant,size:o.size,color:o.color,density:o.density,elevation:o.elevation,loading:o.loading,disabled:o.disabled||!1===o.isValid,fullWidth:o.fullWidth,children:o.text}),l.note]})});export const A2uiTextField=q("TextField",({props:i})=>{const t=i,[r,o]=w(t.value??"",t.setValue);return e(z,{label:t.label,value:r,onChange:e=>o(e.target.value),placeholder:t.placeholder,description:t.description,error:V(t),multiline:t.multiline,rows:t.rows,variant:t.variant,size:t.size,color:t.color,density:t.density,required:t.required,disabled:t.disabled,readOnly:t.readOnly,fullWidth:t.fullWidth})});export const A2uiNumberField=q("NumberField",({props:i})=>{const t=i,[r,o]=w(t.value??null,t.setValue);return e(v,{label:t.label,value:r,onValueChange:o,description:t.description,error:V(t),min:t.min,max:t.max,step:t.step,variant:t.variant,size:t.size,color:t.color,density:t.density,required:t.required,disabled:t.disabled,readOnly:t.readOnly})});export const A2uiCheckbox=q("Checkbox",({props:i})=>{const t=i,[r,o]=w(t.checked??!1,t.setChecked);return e(d,{label:t.label,checked:r,onCheckedChange:o,description:t.description,error:V(t),size:t.size,color:t.color,required:t.required,disabled:t.disabled})});export const A2uiSwitch=q("Switch",({props:i})=>{const t=i,[r,o]=w(t.checked??!1,t.setChecked);return e(C,{label:t.label,checked:r,onCheckedChange:o,description:t.description,size:t.size,color:t.color,disabled:t.disabled})});export const A2uiRadioGroup=q("RadioGroup",({props:i})=>{const t=i,[r,o]=w(t.value??null,e=>t.setValue?.(e??""));return e(A,{label:t.label,value:r,onValueChange:e=>o(String(e)),description:t.description,error:V(t),orientation:t.orientation,size:t.size,color:t.color,required:t.required,disabled:t.disabled,children:(t.options??[]).map(i=>e(y,{value:i.value,label:i.label??i.value,description:i.description,disabled:i.disabled},i.value))})});export const A2uiSelect=q("Select",({props:i})=>{const t=i,[r,o]=w(t.value??null,e=>t.setValue?.(e??""));return e(x,{label:t.label,value:r,onValueChange:e=>o(null===e?null:String(e)),placeholder:t.placeholder,items:(t.options??[]).map(e=>({value:e.value,label:e.label,group:e.group,disabled:e.disabled})),description:t.description,error:V(t),variant:t.variant,size:t.size,color:t.color,density:t.density,required:t.required,disabled:t.disabled,fullWidth:t.fullWidth})});export const A2uiSlider=q("Slider",({props:i})=>{const t=i,[r,o]=w(t.value??t.min??0,t.setValue);return e(f,{label:t.label,value:r,onValueChange:e=>o(Array.isArray(e)?e[0]:e),min:t.min,max:t.max,step:t.step,description:t.description,size:t.size,color:t.color,disabled:t.disabled})});export const nebaComponents=[A2uiFlex,A2uiCard,A2uiDivider,A2uiTypography,A2uiImage,A2uiChip,A2uiAvatar,A2uiStatistic,A2uiDataList,A2uiAlert,A2uiButton,A2uiTextField,A2uiNumberField,A2uiCheckbox,A2uiSwitch,A2uiRadioGroup,A2uiSelect,A2uiSlider];
|
package/dist/a2ui/index.d.ts
CHANGED
|
@@ -24,10 +24,13 @@
|
|
|
24
24
|
* The catalog is written against **A2UI v1.0** and `@a2ui/react` 0.11's newest
|
|
25
25
|
* renderer is **v0.9**, so this registers with `@a2ui/react/v0_9`. The eighteen
|
|
26
26
|
* components only use constructs the two versions share, which is what makes
|
|
27
|
-
* the bridge a rename rather than a translation, and
|
|
28
|
-
* exist
|
|
29
|
-
* the envelope, which `schema.ts` puts
|
|
30
|
-
*
|
|
27
|
+
* the bridge a rename rather than a translation, and none of the three
|
|
28
|
+
* differences that exist makes the renderer refuse a message: v1.0 moved
|
|
29
|
+
* `accessibility` from the catalog entry to the envelope, which `schema.ts` puts
|
|
30
|
+
* back; v1.0 lets a check leave out the `message` v0.9 requires, which
|
|
31
|
+
* `schema.ts` accepts; and v1.0's `Action` gained a `userMessage` that the v0.9
|
|
32
|
+
* renderer accepts and never passes on — the action a host receives is built
|
|
33
|
+
* from the event's `name` and `context` alone.
|
|
31
34
|
*
|
|
32
35
|
* There is no v1.0 React renderer to register with yet. When there is, what
|
|
33
36
|
* changes is this file's import and nothing in `catalog.json`.
|
|
@@ -36,20 +39,29 @@ import { Catalog, type FunctionImplementation } from '@a2ui/web_core/v0_9';
|
|
|
36
39
|
import { nebaComponents } from './components.js';
|
|
37
40
|
export { nebaComponents } from './components.js';
|
|
38
41
|
export { componentSchema, type CatalogSchema } from './schema.js';
|
|
42
|
+
/** What `createNebaCatalog` takes. */
|
|
43
|
+
export interface NebaCatalogOptions {
|
|
44
|
+
/**
|
|
45
|
+
* The language `formatNumber`, `formatCurrency` and `pluralize` write in.
|
|
46
|
+
* Pass the one the components are in — a `NebaProvider`'s `locale` — or the
|
|
47
|
+
* three follow the runtime's language while the components follow the
|
|
48
|
+
* provider. Left out, they follow the runtime.
|
|
49
|
+
*/
|
|
50
|
+
locale?: string;
|
|
51
|
+
}
|
|
39
52
|
/**
|
|
40
53
|
* The catalog, ready to hand to a `MessageProcessor`.
|
|
41
54
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* the `MessageProcessor` holds on to it.
|
|
55
|
+
* The components' Zod schemas are built when this module is evaluated, since
|
|
56
|
+
* `nebaComponents` is exported as they are. Call this once and keep what it
|
|
57
|
+
* gives you: a `Catalog` is immutable and the `MessageProcessor` holds on to it.
|
|
46
58
|
*
|
|
47
59
|
* ```tsx
|
|
48
60
|
* import { MessageProcessor } from '@a2ui/web_core/v0_9';
|
|
49
61
|
* import { A2uiSurface } from '@a2ui/react/v0_9';
|
|
50
62
|
* import { createNebaCatalog } from 'neba/a2ui';
|
|
51
63
|
*
|
|
52
|
-
* const catalog = createNebaCatalog();
|
|
64
|
+
* const catalog = createNebaCatalog({ locale: 'ko' });
|
|
53
65
|
* const processor = new MessageProcessor([catalog]);
|
|
54
66
|
* ```
|
|
55
67
|
*
|
|
@@ -57,6 +69,6 @@ export { componentSchema, type CatalogSchema } from './schema.js';
|
|
|
57
69
|
* is served from — so the id a surface names and the schema an agent was given
|
|
58
70
|
* are the same string without anybody having to keep them in step.
|
|
59
71
|
*/
|
|
60
|
-
export declare function createNebaCatalog(): Catalog<(typeof nebaComponents)[number], FunctionImplementation>;
|
|
72
|
+
export declare function createNebaCatalog(options?: NebaCatalogOptions): Catalog<(typeof nebaComponents)[number], FunctionImplementation>;
|
|
61
73
|
/** The catalog's own id, for a `createSurface` message written by hand. */
|
|
62
74
|
export declare const nebaCatalogId: string;
|
package/dist/a2ui/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Catalog as
|
|
1
|
+
import{Catalog as e,createBasicCatalogFunctions as o}from"@a2ui/web_core/v0_9";import t from"./adapter-catalog.json"with{type:"json"};import{nebaComponents as n}from"./components.js";export{nebaComponents}from"./components.js";export{componentSchema}from"./schema.js";function a(e){const n=o({locale:e}),a=new Set(Object.keys(t.functions)),r=n.filter(e=>a.has(e.name));if(r.length!==a.size){const e=[...a].filter(e=>!n.some(o=>o.name===e));throw new Error(`neba/a2ui: the catalog declares ${e.join(", ")}, which @a2ui/web_core does not implement`)}return r.map(e=>{return"openUrl"===e.name?(o=e,{...o,execute:(e,t,n)=>{if("undefined"==typeof navigator||!("userActivation"in navigator)||navigator.userActivation.isActive)return o.execute(e,t,n)}}):e;var o})}export function createNebaCatalog(o={}){return new e(t.catalogId,n,a(o.locale))}export const nebaCatalogId=t.catalogId;
|
package/dist/a2ui/schema.d.ts
CHANGED
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
* It handles the subset `catalog.json` actually uses and nothing more. That is
|
|
12
12
|
* deliberate: a general JSON-Schema-to-Zod converter is a dependency, and a
|
|
13
13
|
* partial one that quietly returns `z.any()` for a construct it has not met is
|
|
14
|
-
* how a prop stops being validated without anybody noticing.
|
|
15
|
-
*
|
|
16
|
-
* in the catalog so the
|
|
14
|
+
* how a prop stops being validated without anybody noticing. A keyword it does
|
|
15
|
+
* not know throws, and so does a `type` or a `$ref` it has not met;
|
|
16
|
+
* `test/a2ui/adapter.test.tsx` converts every component in the catalog so the
|
|
17
|
+
* throw happens there rather than in someone's renderer.
|
|
17
18
|
*
|
|
18
19
|
* The `$ref`s are the load-bearing part. `componentId()` and `childList()` are
|
|
19
20
|
* not decoration over `z.string()`: the node layer reads a marker off those
|
|
@@ -25,7 +26,7 @@ import { z } from 'zod';
|
|
|
25
26
|
export interface CatalogSchema {
|
|
26
27
|
$ref?: string;
|
|
27
28
|
type?: string;
|
|
28
|
-
enum?: readonly string[];
|
|
29
|
+
enum?: readonly (string | number)[];
|
|
29
30
|
const?: string;
|
|
30
31
|
default?: unknown;
|
|
31
32
|
description?: string;
|
|
@@ -41,7 +42,8 @@ export interface CatalogSchema {
|
|
|
41
42
|
*
|
|
42
43
|
* `accessibility` is added rather than read, because v1.0 moved it out of the
|
|
43
44
|
* catalog and into the envelope while the renderer this adapter registers with
|
|
44
|
-
* still expects a component to declare it.
|
|
45
|
-
* are bridged rather than
|
|
45
|
+
* still expects a component to declare it. That and a check's optional
|
|
46
|
+
* `message`, above, are the two places the versions are bridged rather than
|
|
47
|
+
* mapped.
|
|
46
48
|
*/
|
|
47
49
|
export declare function componentSchema(name: string, definition: CatalogSchema): z.ZodTypeAny;
|
package/dist/a2ui/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import{childList as t,CommonSchemas as r,componentId as
|
|
1
|
+
import{z as e}from"zod";import{childList as t,CommonSchemas as r,componentId as i}from"@a2ui/web_core/v0_9";const n="https://a2ui.org/specification/v1_0/common_types.json#/$defs/",o=new Set(["$ref","type","enum","default","description","properties","required","items","minimum","additionalProperties"]),a=new Set(["type","description","properties","required","additionalProperties"]);function s(e,t,r){for(const i of Object.keys(e))if(!r.has(i))throw new Error(`a2ui: ${t} uses \`${i}\`, which this adapter does not know`)}const c={Action:()=>r.Action,Child:()=>i(),ChildList:()=>t(),DynamicBoolean:()=>r.DynamicBoolean,DynamicNumber:()=>r.DynamicNumber,DynamicString:()=>r.DynamicString};function u(t,r){if(s(t,r,o),t.$ref){const e=t.$ref.startsWith(n)?t.$ref.slice(61):"",i=c[e];if(!i)throw new Error(`a2ui: ${r} refers to ${t.$ref}, which this adapter does not know`);return i()}if(t.enum){const r=t.enum;if(r.every(e=>"string"==typeof e))return e.enum(r);const i=r.map(t=>e.literal(t));return 1===i.length?i[0]:e.union(i)}if(void 0!==t.minimum&&"number"!==t.type&&"integer"!==t.type)throw new Error(`a2ui: ${r} has a minimum but is not a number`);switch(t.type){case"string":return e.string();case"number":case"integer":{const r="integer"===t.type?e.number().int():e.number();return void 0===t.minimum?r:r.min(t.minimum)}case"boolean":return e.boolean();case"array":if(!t.items)throw new Error(`a2ui: ${r} is an array with no items`);return e.array(u(t.items,`${r}[]`));case"object":return m(t,r);default:throw new Error(`a2ui: ${r} has a type this adapter does not know`)}}function m(t,r){if(!0===t.additionalProperties)throw new Error(`a2ui: ${r} allows any property, which this adapter cannot check`);const i=new Set(t.required??[]),n={};for(const[e,o]of Object.entries(t.properties??{})){if("component"===e)continue;const t=u(o,`${r}.${e}`);n[e]=void 0===o.default?i.has(e)?t:t.optional():t.default(o.default).optional()}return e.object(n)}const p=(()=>{const t=r.Checkable,i=r.CheckRule.extend({message:e.string().optional()}),n=t.shape.checks;return t.extend({checks:e.array(i).optional().describe(n.description??"")})})();export function componentSchema(t,i){const o=i.allOf??[i];let c=e.object({accessibility:r.AccessibilityAttributes.optional()});for(const e of o)if(e.$ref!==`${n}Checkable`){if(e.$ref)throw new Error(`a2ui: ${t} is composed with ${e.$ref}, which this adapter cannot merge`);s(e,t,a),c=c.merge(m(e,t))}else c=c.merge(p);return c}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Accordion as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Accordion as l}from"@base-ui/react/accordion";import{boxPaddingXClasses as t,boxPaddingYClasses as i}from"../box/Box.js";import{ChevronIcon as s}from"../../internal/icons.js";import{accordionPanelClasses as r,clampClasses as d,clampSlot as o,cx as c,focusRingClasses as m,gapClasses as f,hasContent as u,iconClasses as x,insetRingClasses as b,metaTextClasses as h,radiusClasses as v,sheetBodyClasses as p,sheetHeaderGapClasses as g,sheetTitleClasses as N,surfaceClasses as y,surfaceSlots as j,transitionClasses as w,disclosureChevronClasses as z,disclosureTriggerClasses as A}from"../../internal/styles.js";import{useStyleDefaults as k}from"../../internal/defaults.js";const C=/*@__PURE__*/a.createContext({size:"md",density:"default",dividers:!0,headingLevel:3,disabled:!1}),I={solid:[y,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[y,"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"},L={xs:v.xs,sm:v.xs,md:v.sm,lg:v.sm,xl:v.md};export const Accordion=/*@__PURE__*/a.forwardRef(function Accordion(n,t){const{variant:i="outline",size:s="md",color:r="primary",density:d="default",elevation:o=0,multiple:m=!1,value:f,defaultValue:u,onValueChange:x,dividers:b=!0,headingLevel:h=3,disabled:p=!1,hiddenUntilFound:g=!0,keepMounted:N=!1,className:y,style:z,children:A,...L}=k(n,["size","density","variant"]),V=a.useMemo(()=>({size:s,density:d,dividers:b,headingLevel:h,disabled:p}),[s,d,b,h,p]),$=c("flex flex-col",v[s],I[i],w,b?"overflow-hidden [&>div+div]:border-t [&>div+div]:[border-color:var(--n-line)]":"p-1",y??"");return e(C.Provider,{value:V,children:e(l.Root,{ref:t,multiple:m,value:f,defaultValue:u,onValueChange:e=>x?.(e),disabled:p,hiddenUntilFound:g,keepMounted:N,className:$,style:{...j(r,o),...z},...L,children:A})})});export const AccordionItem=/*@__PURE__*/a.forwardRef(function AccordionItem({value:v,title:y,subtitle:j,startIcon:k,action:I,lines:V,disabled:$=!1,className:M,children:R,...F},P){const U=a.useContext(C),{size:B,density:E,dividers:H,headingLevel:T}=U,q=$||U.disabled,D=V?d(V):"",G=o(V),J=t[E][B],K=i[E][B];return n(l.Item,{ref:P,value:v,disabled:$,className:c("flex flex-col",M??""),...F,children:[n("div",{className:"flex w-full items-center",children:[e(l.Header,{className:"neba-heading flex min-w-0 flex-1 items-center [&.neba-heading]:m-0 [&.neba-heading]:[font:inherit]",render:a.createElement(`h${T}`),children:n(l.Trigger,{className:c("flex min-w-0 flex-1 items-center text-start",A,q?"":"cursor-pointer",J,K,f[B],w,x,H?b:m,H?"":L[B],q?"cursor-not-allowed bg-transparent text-(--neba-disabled-fg)":"hover:bg-(--n-soft) data-[panel-open]:text-(--n-on-tint)"),children:[u(k)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:k}):null,n("span",{className:`flex min-w-0 flex-1 flex-col ${g[B]}`,children:[u(y)?e("span",{className:c("font-semibold",N[B],D),style:G,children:y}):null,u(j)?e("span",{className:c("text-(--neba-muted-fg)",h[B],D),style:G,children:j}):null]}),e("span",{className:`${z} text-(--neba-muted-fg)`,children:e(s,{})})]})}),u(I)?e("span",{className:`flex shrink-0 items-center ${J}`,children:I}):null]}),e(l.Panel,{className:r,children:e("div",{className:["text-(--neba-muted-fg)",p[B],J,"compact"===E?"pb-2":"pb-4"].join(" "),children:R})})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import*as t from"react";import{useRender as l}from"@base-ui/react/use-render";import{childKey as s}from"../../internal/children.js";import{formatDuration as a,runColor as i,runIcon as c,useElapsed as o}from"../../internal/run.js";import{runMessages as m,useMessages as d}from"../../internal/i18n.js";import{cx as u,hasContent as p,metaTextClasses as f,sheetBodyClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import*as t from"react";import{useRender as l}from"@base-ui/react/use-render";import{childKey as s}from"../../internal/children.js";import{formatDuration as a,runColor as i,runIcon as c,useElapsed as o}from"../../internal/run.js";import{runMessages as m,useMessages as d}from"../../internal/i18n.js";import{cx as u,hasContent as p,metaTextClasses as f,sheetBodyClasses as g,sheetTitleClasses as x,srOnlyClasses as b,surfaceSlots as h,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const N=/*@__PURE__*/t.createContext(null),j=/*@__PURE__*/t.createContext({last:!0}),w={xs:"0.875rem",sm:"1rem",md:"1.125rem",lg:"1.25rem",xl:"1.5rem"},z={xs:"gap-2",sm:"gap-2.5",md:"gap-3",lg:"gap-3.5",xl:"gap-4"},k={default:{xs:"pb-3",sm:"pb-3.5",md:"pb-4",lg:"pb-5",xl:"pb-6"},compact:{xs:"pb-1.5",sm:"pb-2",md:"pb-2.5",lg:"pb-3",xl:"pb-3.5"}},A={pending:"text-(--neba-muted-fg)",running:"text-(--n-accent)",success:"text-(--neba-fg)",error:"text-(--n-accent)"};export const AgentStep=/*@__PURE__*/t.forwardRef(function AgentStep({title:r,status:l="success",duration:s,meta:y,icon:C,color:S,className:P,style:_,children:M,...R},F){const q=t.useContext(N),{last:B}=t.useContext(j),D=q?.size??"md",E=q?.density??"default",G=d(m),H=q?.labels??G,I=i(l,S??q?.color??"primary"),J=o("running"===l,s),K=void 0===C?c(l):C;return n("li",{ref:F,"aria-current":"running"===l?"step":void 0,"data-status":l,className:u("relative flex",z[D],B?"":k[E][D],P),style:{"--n-mark":w[D],...h(I,0),..._},...R,children:[B?null:e("span",{"aria-hidden":"true",className:u("pointer-events-none absolute start-[calc(var(--n-mark)/2_-_1px)] top-(--n-mark)","bottom-0 border-s-2 [border-color:var(--neba-border)]")}),e("span",{"aria-hidden":"true",className:u("relative z-10 flex size-(--n-mark) shrink-0 items-center justify-center","rounded-full bg-(--neba-surface) text-(--n-accent)","[&_svg]:size-full",v),children:K}),n("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[n("div",{className:"flex min-w-0 items-baseline gap-2",children:[e("span",{className:b,children:H[l]}),p(r)?e("span",{className:u("min-w-0 font-medium",x[D],A[l],v),children:r}):null,p(y)?e("span",{className:u("min-w-0 truncate text-(--neba-muted-fg)",f[D]),children:y}):null,null===J?null:e("span",{className:u("ms-auto shrink-0 tabular-nums text-(--neba-muted-fg)",f[D]),children:a(J,q?.locale)})]}),p(M)?e("div",{className:u("min-w-0 text-(--neba-muted-fg)",g[D]),children:M}):null]})]})});export const AgentSteps=/*@__PURE__*/t.forwardRef(function AgentSteps(a,i){const{size:c="md",color:o="primary",density:p="default",running:f=!1,locale:g,labels:x,render:b,className:v,style:w,children:z,...k}=y(a,["size","density","locale"]),A=d(m,g),C=t.useMemo(()=>({...A,...x}),[A,x?.pending,x?.running,x?.success,x?.error]),S=t.Children.toArray(z),P=!1!==f&&null!=f,_=S.length+(P?1:0),M=t.useMemo(()=>({size:c,density:p,color:o,locale:g,labels:C}),[c,p,o,g,C]),R=l({render:b??e("ol",{}),ref:i,props:{role:"list",className:u("flex flex-col",v),style:{...h(o,0),...w},children:n(r,{children:[S.map((n,r)=>e(j.Provider,{value:{last:r===_-1},children:n},s(n,r))),P?e(j.Provider,{value:{last:!0},children:e(AgentStep,{status:"running",title:!0===f?void 0:f})},S.length):null]}),...k}});return e(N.Provider,{value:M,children:R})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{boxPaddingClasses as l}from"../box/Box.js";import{actionMessages as i,useMessages as s}from"../../internal/i18n.js";import{CloseIcon as a,severityIcon as o}from"../../internal/icons.js";import{transitionProps as r}from"../../internal/animate.js";import{controlSlots as c,cx as d,hasContent as m,hitAreaClasses as f,iconClasses as u,radiusClasses as x,sheetBodyClasses as b,sheetHeaderGapClasses as v,sheetSectionGapClasses as p,sheetTitleClasses as h,surfaceClasses as y,transitionClasses as j}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const N={solid:[y,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[y,"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-(--n-soft)"},w={solid:"",outline:"text-(--n-accent)",text:"text-(--n-accent)"},k={solid:"",outline:"text-(--neba-muted-fg)",text:"text-(--neba-muted-fg)"},$={primary:"status",secondary:"status",info:"status",success:"status",warning:"alert",danger:"alert"};export const Alert=/*@__PURE__*/n.forwardRef(function Alert(n,y){const{variant:_="outline",size:z="md",color:A="info",density:C="default",elevation:B=0,title:L,icon:R,action:q,onClose:D,locale:E,closeLabel:F,transition:G,
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{boxPaddingClasses as l}from"../box/Box.js";import{actionMessages as i,useMessages as s}from"../../internal/i18n.js";import{CloseIcon as a,severityIcon as o}from"../../internal/icons.js";import{transitionProps as r}from"../../internal/animate.js";import{controlSlots as c,cx as d,hasContent as m,hitAreaClasses as f,iconClasses as u,radiusClasses as x,sheetBodyClasses as b,sheetHeaderGapClasses as v,sheetSectionGapClasses as p,sheetTitleClasses as h,surfaceClasses as y,transitionClasses as j}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const N={solid:[y,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[y,"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-(--n-soft)"},w={solid:"",outline:"text-(--n-accent)",text:"text-(--n-accent)"},k={solid:"",outline:"text-(--neba-muted-fg)",text:"text-(--neba-muted-fg)"},$={primary:"status",secondary:"status",info:"status",success:"status",warning:"alert",danger:"alert"};export const Alert=/*@__PURE__*/n.forwardRef(function Alert(n,y){const{variant:_="outline",size:z="md",color:A="info",density:C="default",elevation:B=0,title:L,icon:R,action:q,onClose:D,locale:E,closeLabel:F,transition:G,role:H,className:I,style:J,children:K,...M}=g(n,["size","density","variant","locale"]),O=s(i,E),P=void 0===R?o(A):R,Q=w[_],S=m(L),T=r(G);return t("div",{ref:y,className:d("flex w-full items-start",l[C][z],x[z],p[z],b[z],j,N[_],u,T.className,I??""),style:{...c(A,B,_),...T.style,...J},...M,children:[m(P)?e("span",{className:`flex h-[1lh] shrink-0 items-center ${Q}`,children:P}):null,t("div",{role:H??$[A],className:`flex min-w-0 flex-1 flex-col ${v[z]}`,children:[S?e("div",{className:`neba-title font-semibold ${h[z]} ${Q}`,children:L}):null,m(K)?e("div",{className:S?k[_]:void 0,children:K}):null]}),m(q)?e("div",{className:"flex h-[1lh] shrink-0 items-center",children:q}):null,D?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e("button",{type:"button","aria-label":F??O.dismiss,onClick:D,className:["relative inline-flex size-[1.15em] cursor-pointer items-center justify-center rounded-full",f,"opacity-70 [transition:opacity_var(--neba-duration)_var(--neba-ease)]","hover:opacity-100 focus-visible:opacity-100","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),children:e(a,{})})}):null]})});
|
|
@@ -31,7 +31,9 @@ export interface AnchorProps extends Omit<React.ComponentPropsWithoutRef<'nav'>,
|
|
|
31
31
|
/**
|
|
32
32
|
* How far below the top of the scrollport a heading counts as reached, in
|
|
33
33
|
* pixels. Set it to the height of a sticky header, or the heading under the
|
|
34
|
-
* bar is never the one marked.
|
|
34
|
+
* bar is never the one marked. A pressed row on a page that scrolls the
|
|
35
|
+
* document is the browser's own jump, which does not read this: give that
|
|
36
|
+
* page a `scroll-padding-top` of the same height.
|
|
35
37
|
* @default 0
|
|
36
38
|
*/
|
|
37
39
|
offset?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{safeHref as n}from"../../internal/link.js";import{anchorMessages as r,useMessages as o}from"../../internal/i18n.js";import{controlTextLeadingClasses as l,cx as i,focusRingClasses as c,transitionClasses as a}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";const d={default:{xs:"py-1",sm:"py-1",md:"py-1.5",lg:"py-1.5",xl:"py-2"},compact:{xs:"py-0.5",sm:"py-0.5",md:"py-1",lg:"py-1",xl:"py-1"}},u={xs:8,sm:10,md:12,lg:14,xl:16},m=["block min-w-0 truncate no-underline","text-(--neba-muted-fg)",a,c,"hover:text-(--neba-fg)","aria-[current=location]:font-medium aria-[current=location]:text-(--n-accent)"].join(" "),f=["border-s [border-color:transparent]","[transition:border-color_var(--neba-duration)_var(--neba-ease)]","aria-[current=location]:[border-color:var(--n-accent)]"].join(" ");function p(e,t){const n=t.get(e);if(n?.isConnected)return n;const r=document.getElementById(e.replace(/^#/,""));return r?t.set(e,r):t.delete(e),r}export const Anchor=/*@__PURE__*/t.forwardRef(function Anchor(c,a){const{items:h,activeHref:g,onActiveChange:b,offset:v=0,container:y,rail:x=!0,size:w="md",color:E="primary",density:j="default",locale:H,label:A,className:C,style:R,...B}=s(c,["size","density","locale"]),N=o(r,H),[z,I]=t.useState(null),K=void 0!==g?g:z,L=t.useRef(b),S=t.useRef(h);t.useEffect(()=>{L.current=b,S.current=h});const $=h.map(e=>e.href).join("\0");return t.useEffect(()=>{const e=y?.current??window,t=new Map;let n=0,r=null;const o=()=>{n=0;const e=function(e,t,n,r){const o=(n?n.getBoundingClientRect().top:0)+t+1;let l=null;for(const t of e){const e=p(t.href,r);e&&e.getBoundingClientRect().top<=o&&(l=t.href)}if((n?n.scrollHeight-n.clientHeight:document.documentElement.scrollHeight-window.innerHeight)<=2){const t=e[0];return t&&p(t.href,r)?t.href:l}return(n?n.scrollTop+n.clientHeight>=n.scrollHeight-2:window.innerHeight+window.scrollY>=document.documentElement.scrollHeight-2)&&e.length>0?e[e.length-1].href:l}(S.current,v,y?.current??null,t);e!==r&&(r=e,I(e),L.current?.(e))},l=()=>{0===n&&(n=requestAnimationFrame(o))};return o(),e.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{0!==n&&cancelAnimationFrame(n),e.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[$,v,y]),e("nav",{ref:a,"aria-label":A??N.label,className:i("min-w-0",C??""),style:{"--n-accent":`var(--neba-${E}-accent)`,"--n-ring":`var(--neba-${E}-ring)`,...R},...B,children:e("ul",{className:i("m-0 flex list-none flex-col p-0",x?"border-s [border-color:var(--neba-border)]":""),children:h.map(t=>e("li",{className:x?"[margin-inline-start:-1px]":"",children:e("a",{href:n(t.href),"aria-current":K===t.href?"location":void 0,onClick:e=>function(e,t,n,r){if(!n||e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const o=document.getElementById(t.replace(/^#/,""));if(!o)return;e.preventDefault();const l=n.scrollTop+o.getBoundingClientRect().top-n.getBoundingClientRect().top-r;n.scrollTo({top:l}),o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.focus({preventScroll:!0})}(e,t.href,y?.current??null,v),className:i(m,l[w],d[j][w],x?`${f} ps-3`:""),style:t.depth?x?{paddingInlineStart:`calc(0.75rem + ${t.depth*u[w]}px)`}:{marginInlineStart:t.depth*u[w]}:void 0,children:t.label})},t.href))})})});
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{safeHref as n}from"../../internal/link.js";import{anchorMessages as r,useMessages as o}from"../../internal/i18n.js";import{controlTextLeadingClasses as l,cx as i,focusRingClasses as c,transitionClasses as a}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";const d={default:{xs:"py-1",sm:"py-1",md:"py-1.5",lg:"py-1.5",xl:"py-2"},compact:{xs:"py-0.5",sm:"py-0.5",md:"py-1",lg:"py-1",xl:"py-1"}},u={xs:8,sm:10,md:12,lg:14,xl:16},m=["block min-w-0 truncate no-underline","text-(--neba-muted-fg)",a,c,"hover:text-(--neba-fg)","aria-[current=location]:font-medium aria-[current=location]:text-(--n-accent)"].join(" "),f=["border-s [border-color:transparent]","[transition:border-color_var(--neba-duration)_var(--neba-ease)]","aria-[current=location]:[border-color:var(--n-accent)]"].join(" ");function p(e,t){const n=t.get(e);if(n?.isConnected)return n;const r=document.getElementById(e.replace(/^#/,""));return r?t.set(e,r):t.delete(e),r}export const Anchor=/*@__PURE__*/t.forwardRef(function Anchor(c,a){const{items:h,activeHref:g,onActiveChange:b,offset:v=0,container:y,rail:x=!0,size:w="md",color:E="primary",density:j="default",locale:H,label:A,className:C,style:R,...B}=s(c,["size","density","locale"]),N=o(r,H),[z,I]=t.useState(null),K=void 0!==g?g:z,L=t.useRef(b),S=t.useRef(h);t.useEffect(()=>{L.current=b,S.current=h});const $=h.map(e=>e.href).join("\0");return t.useEffect(()=>{const e=y?.current??window,t=new Map;let n=0,r=null;const o=()=>{n=0;const e=function(e,t,n,r){const o=(n?n.getBoundingClientRect().top:0)+t+1;let l=null;for(const t of e){const e=p(t.href,r);e&&e.getBoundingClientRect().top<=o&&(l=t.href)}if((n?n.scrollHeight-n.clientHeight:document.documentElement.scrollHeight-window.innerHeight)<=2){const t=e[0];return t&&p(t.href,r)?t.href:l}return(n?n.scrollTop+n.clientHeight>=n.scrollHeight-2:window.innerHeight+window.scrollY>=document.documentElement.scrollHeight-2)&&e.length>0?e[e.length-1].href:l}(S.current,v,y?.current??null,t);e!==r&&(r=e,I(e),L.current?.(e))},l=()=>{0===n&&(n=requestAnimationFrame(o))};return o(),e.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l,{passive:!0}),()=>{0!==n&&cancelAnimationFrame(n),e.removeEventListener("scroll",l),window.removeEventListener("resize",l)}},[$,v,y]),e("nav",{ref:a,"aria-label":A??N.label,className:i("min-w-0",C??""),style:{"--n-accent":`var(--neba-${E}-accent)`,"--n-ring":`var(--neba-${E}-ring)`,...R},...B,children:e("ul",{className:i("m-0 flex list-none flex-col p-0",x?"border-s [border-color:var(--neba-border)]":""),children:h.map(t=>e("li",{className:x?"[margin-inline-start:-1px]":"",children:e("a",{href:n(t.href),"aria-current":K===t.href?"location":void 0,onClick:e=>function(e,t,n,r){if(!n||e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const o=document.getElementById(t.replace(/^#/,""));if(!o)return;e.preventDefault();const l=n.scrollTop+o.getBoundingClientRect().top-n.getBoundingClientRect().top-r;n.scrollTo({top:Math.round(l)}),o.hasAttribute("tabindex")||o.setAttribute("tabindex","-1"),o.focus({preventScroll:!0})}(e,t.href,y?.current??null,v),className:i(m,l[w],d[j][w],x?`${f} ps-3`:""),style:t.depth?x?{paddingInlineStart:`calc(0.75rem + ${t.depth*u[w]}px)`}:{marginInlineStart:t.depth*u[w]}:void 0,children:t.label})},t.href))})})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
3
|
import type { NebaAnimateProps } from '../../types.js';
|
|
4
|
-
export interface AnimateCounterProps extends Omit<NebaAnimateProps, 'easing' | 'repeat' | 'alternate' | 'paused'>, Omit<React.ComponentPropsWithoutRef<'
|
|
4
|
+
export interface AnimateCounterProps extends Omit<NebaAnimateProps, 'easing' | 'repeat' | 'alternate' | 'paused'>, Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
5
5
|
/** Where it lands. */
|
|
6
6
|
value: number;
|
|
7
7
|
/**
|
|
@@ -21,9 +21,16 @@ export interface AnimateCounterProps extends Omit<NebaAnimateProps, 'easing' | '
|
|
|
21
21
|
* whichever has more.
|
|
22
22
|
*/
|
|
23
23
|
format?: Intl.NumberFormatOptions;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Which language it is written in. Defaults to the language of wherever it
|
|
26
|
+
* renders, so a server-rendered page passes it, or the server's number and
|
|
27
|
+
* the reader's may disagree when the page hydrates.
|
|
28
|
+
*/
|
|
25
29
|
locale?: string;
|
|
26
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Renders something other than a `<span>`. A `<span>` by default, so it can
|
|
32
|
+
* sit inside a sentence or a Statistic's value. Base UI's own escape hatch.
|
|
33
|
+
*/
|
|
27
34
|
render?: useRender.RenderProp;
|
|
28
35
|
}
|
|
29
36
|
/**
|
|
@@ -44,4 +51,4 @@ export interface AnimateCounterProps extends Omit<NebaAnimateProps, 'easing' | '
|
|
|
44
51
|
* intermediate ones, and a reader who has asked for less motion is shown the
|
|
45
52
|
* answer too.
|
|
46
53
|
*/
|
|
47
|
-
export declare const AnimateCounter: React.ForwardRefExoticComponent<AnimateCounterProps & React.RefAttributes<
|
|
54
|
+
export declare const AnimateCounter: React.ForwardRefExoticComponent<AnimateCounterProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,Fragment as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useRender as a}from"@base-ui/react/use-render";import{useAnimationRun as i,usePrefersReducedMotion as s}from"../../internal/animate.js";import{numberFormatter as o}from"../../internal/format.js";import{cx as u,srOnlyClasses as m}from"../../internal/styles.js";import{useStyleDefaults as c}from"../../internal/defaults.js";function l(r){if(!Number.isFinite(r))return 0;const[e,t="0"]=String(Math.abs(r)).split("e"),n=(e.split(".")[1]?.length??0)-Number(t);return Math.min(20,Math.max(0,n))}export const AnimateCounter=/*@__PURE__*/n.forwardRef(function AnimateCounter(f,d){const{value:h,from:p=0,duration:g=1200,delay:j=0,trigger:y="mount",play:M,once:b=!0,threshold:x=.2,format:A,locale:F,render:N,className:v,style:q
|
|
1
|
+
"use client";import{jsx as r,Fragment as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{useRender as a}from"@base-ui/react/use-render";import{useAnimationRun as i,usePrefersReducedMotion as s}from"../../internal/animate.js";import{numberFormatter as o}from"../../internal/format.js";import{cx as u,srOnlyClasses as m}from"../../internal/styles.js";import{useStyleDefaults as c}from"../../internal/defaults.js";function l(r){if(!Number.isFinite(r))return 0;const[e,t="0"]=String(Math.abs(r)).split("e"),n=(e.split(".")[1]?.length??0)-Number(t);return Math.min(20,Math.max(0,n))}export const AnimateCounter=/*@__PURE__*/n.forwardRef(function AnimateCounter(f,d){const{value:h,from:p=0,duration:g=1200,delay:j=0,trigger:y="mount",play:M,once:b=!0,threshold:x=.2,format:A,locale:F,render:N,className:v,style:R,...q}=c(f,["locale"]),S=i({caller:q,trigger:y,play:M,once:b,threshold:x,infinite:!1}),C=s(),[w,E]=n.useState(p),J=void 0===A?"":JSON.stringify(A),O=n.useMemo(()=>o(F,A),[F,J]),k=n.useRef(p),z=n.useRef(!1),B=n.useRef(S.run);n.useEffect(()=>{if(!S.started&&!C)return z.current=!1,k.current=p,void E(p);if(C||g<=0)return k.current=h,void E(h);B.current!==S.run&&(B.current=S.run,z.current=!1);const r=z.current?k.current:p,e=z.current?0:j;z.current=!0;let t=0,n=null;const a=i=>{null===n&&(n=i);const s=i-n-e;if(s<0)return void(t=requestAnimationFrame(a));const o=Math.min(1,s/g),u=r+(h-r)*function(r){return 1-(1-r)**3}(o);k.current=u,E(u),o<1&&(t=requestAnimationFrame(a))};return k.current=r,E(r),t=requestAnimationFrame(a),()=>cancelAnimationFrame(t)},[S.started,S.run,C,h,p,g,j]);const D=Math.max(l(h),l(p)),G=Math.round(w*10**D)/10**D;return a({render:N??r("span",{}),ref:[d,S.ref],props:{...q,className:u("tabular-nums",v),style:R,"data-neba-animation":"counter","data-state":S.state,...S.handlers,children:t(e,{children:[r("span",{className:m,children:O.format(h)}),r("span",{"aria-hidden":"true",children:O.format(C?h:G)})]})}})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
3
|
import type { NebaAnimateProps } from '../../types.js';
|
|
4
|
-
export interface AnimateScrambleProps extends Omit<NebaAnimateProps, 'easing' | 'alternate'>, Omit<React.ComponentPropsWithoutRef<'
|
|
4
|
+
export interface AnimateScrambleProps extends Omit<NebaAnimateProps, 'easing' | 'alternate'>, Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
5
5
|
/** The text, when it is easier to pass than to nest. Overrides `children`. */
|
|
6
6
|
text?: string;
|
|
7
7
|
/**
|
|
@@ -24,7 +24,10 @@ export interface AnimateScrambleProps extends Omit<NebaAnimateProps, 'easing' |
|
|
|
24
24
|
* Which language the text is in, for finding the character boundaries.
|
|
25
25
|
*/
|
|
26
26
|
locale?: string;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Renders something other than a `<span>`. A `<span>` by default, so it can
|
|
29
|
+
* sit inside a sentence or a Statistic's value. Base UI's own escape hatch.
|
|
30
|
+
*/
|
|
28
31
|
render?: useRender.RenderProp;
|
|
29
32
|
/** The text to settle. Only text is settled. */
|
|
30
33
|
children?: React.ReactNode;
|
|
@@ -47,4 +50,4 @@ export interface AnimateScrambleProps extends Omit<NebaAnimateProps, 'easing' |
|
|
|
47
50
|
* for a screen reader; the noise is a visible copy that is `aria-hidden`. A
|
|
48
51
|
* reader who has asked for less motion is shown the text.
|
|
49
52
|
*/
|
|
50
|
-
export declare const AnimateScramble: React.ForwardRefExoticComponent<AnimateScrambleProps & React.RefAttributes<
|
|
53
|
+
export declare const AnimateScramble: React.ForwardRefExoticComponent<AnimateScrambleProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as
|
|
1
|
+
"use client";import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{useRender as n}from"@base-ui/react/use-render";import{isInfinite as s,useAnimationRun as i,usePrefersReducedMotion as l}from"../../internal/animate.js";import{graphemesOf as c,textOf as o}from"../../internal/text.js";import{cx as u,srOnlyClasses as m}from"../../internal/styles.js";import{useStyleDefaults as d}from"../../internal/defaults.js";const p="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&$@*";export const AnimateScramble=/*@__PURE__*/a.forwardRef(function AnimateScramble(f,h){const{text:g,speed:M=18,tick:j=45,characters:v=p,duration:x,delay:b=0,repeat:y=1,paused:N,trigger:w="mount",play:R,once:I=!0,threshold:S=.2,locale:T,render:A,className:E,style:F,children:k,...B}=d(f,["locale"]),C=i({caller:B,trigger:w,play:R,once:I,threshold:S,paused:N,infinite:s(y)}),D=l(),G=g??o(k),H=a.useMemo(()=>c(G,T),[G,T]),J=H.length,[K,L]=a.useState(0),[O,P]=a.useReducer(e=>e+1,0),Q=a.useMemo(()=>void 0!==x&&J>0?Math.max(1,x/J):1e3/Math.max(1,M),[x,M,J]),U=a.useRef(0),V=a.useRef(C.run);a.useEffect(()=>{U.current=0},[J]),a.useEffect(()=>{if(!C.started)return void(U.current=0);if(V.current!==C.run&&(V.current=C.run,U.current=0),N)return;if(D||0===J)return void L(J);let e,r=Math.min(U.current,J);if(r>=J)return void L(J);const t=()=>{r+=1,U.current=r,L(r),r<J?e=setTimeout(t,Q):clearInterval(a)};L(r);const a=setInterval(P,j);return e=setTimeout(t,0===r?b+Q:Q),()=>{clearTimeout(e),clearInterval(a)}},[C.started,C.run,N,D,J,Q,j,b]);const W=v.length>0?v:p,X=H.map((e,r)=>D||r<K||""===e.trim()?e:W[function(e,r,t){let a=Math.imul(e+1,2246822507)^Math.imul(r+1,3266489909);return a^=a>>>15,a=Math.imul(a,625341585),a^=a>>>13,(a>>>0)%t}(O,r,W.length)]).join("");return n({render:A??e("span",{}),ref:[h,C.ref],props:{...B,className:u("inline-grid",E),style:F,"data-neba-animation":"scramble","data-state":C.state,...C.handlers,children:t(r,{children:[e("span",{className:m,children:G}),e("span",{"aria-hidden":"true",className:"whitespace-pre-wrap [grid-area:1/1]",children:X}),e("span",{"aria-hidden":"true","data-sample":G,className:"invisible whitespace-pre-wrap [grid-area:1/1] before:content-[attr(data-sample)]"})]})}})});
|
|
@@ -3,7 +3,7 @@ import { useRender } from '@base-ui/react/use-render';
|
|
|
3
3
|
import type { NebaAnimateProps, NebaAnimation, NebaSide, NebaStaggerProps, NebaTimelineProps } from '../../types.js';
|
|
4
4
|
/** What a piece is. */
|
|
5
5
|
export type NebaSplitBy = 'word' | 'character';
|
|
6
|
-
export interface AnimateSplitProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, Omit<React.ComponentPropsWithoutRef<'
|
|
6
|
+
export interface AnimateSplitProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
7
7
|
/** The text, when it is easier to pass than to nest. Overrides `children`. */
|
|
8
8
|
text?: string;
|
|
9
9
|
/**
|
|
@@ -34,7 +34,10 @@ export interface AnimateSplitProps extends NebaAnimateProps, NebaStaggerProps, N
|
|
|
34
34
|
* boundaries. A word boundary is not a space in Japanese, Thai or Chinese.
|
|
35
35
|
*/
|
|
36
36
|
locale?: string;
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Renders something other than a `<span>`. A `<span>` by default, so it can
|
|
39
|
+
* sit inside a sentence or a Statistic's value. Base UI's own escape hatch.
|
|
40
|
+
*/
|
|
38
41
|
render?: useRender.RenderProp;
|
|
39
42
|
/** The text to split. Only text is split — an element contributes its words. */
|
|
40
43
|
children?: React.ReactNode;
|
|
@@ -60,4 +63,4 @@ export interface AnimateSplitProps extends NebaAnimateProps, NebaStaggerProps, N
|
|
|
60
63
|
* character, the pieces of a word are held in a span that does not wrap, and
|
|
61
64
|
* the space after it is left as text, which is where the line breaks.
|
|
62
65
|
*/
|
|
63
|
-
export declare const AnimateSplit: React.ForwardRefExoticComponent<AnimateSplitProps & React.RefAttributes<
|
|
66
|
+
export declare const AnimateSplit: React.ForwardRefExoticComponent<AnimateSplitProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as r from"react";import{useRender as n}from"@base-ui/react/use-render";import{animBaseClass as s,animationClasses as i,isInfinite as l,staggerChildren as o,transitionParts as m,useAnimationRun as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import*as r from"react";import{useRender as n}from"@base-ui/react/use-render";import{animBaseClass as s,animationClasses as i,isInfinite as l,staggerChildren as o,transitionParts as m,useAnimationRun as p}from"../../internal/animate.js";import{graphemesOf as c,textOf as d,wordsOf as g}from"../../internal/text.js";import{cx as u,srOnlyClasses as h}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";export const AnimateSplit=/*@__PURE__*/r.forwardRef(function AnimateSplit(y,b){const{text:j,by:w="word",effect:x="slide",duration:N=520,delay:M=0,easing:S,repeat:v,alternate:$,paused:k,trigger:A="mount",play:F,once:R=!0,threshold:q=.2,stagger:z=45,durationStep:B=0,reverse:C=!1,timeline:D,range:E,from:G="bottom",distance:H="0.4em",scale:I,angle:J,side:K,locale:L,render:O,className:P,style:Q,children:T,...U}=f(y,["locale"]),V=v??("blink"===x?"infinite":1),W=p({caller:U,parts:":scope > [aria-hidden] .neba-anim",trigger:A,play:F,once:R,threshold:q,paused:k,infinite:l(V)}),X="view"===D?"running":W.state,Y=j??d(T),Z=r.useMemo(()=>g(Y,L),[Y,L]),_=r.useMemo(()=>{if("word"===w)return null;let e=0;return Z.map(t=>{const a=/\s*$/.exec(t)?.[0]??"",r=c(t.slice(0,t.length-a.length),L),n={start:e,letters:r,gap:a};return e+=r.length,n})},[w,Z,L]),ee=r.useMemo(()=>_?_.flatMap(e=>e.letters):Z,[_,Z]),te=m({type:x,duration:N,delay:M,easing:S,repeat:V,alternate:$,from:G,distance:H,scale:I,angle:J,side:K,timeline:D,range:E}),ae=o(ee.map((t,a)=>e("span",{className:"inline-block whitespace-pre",children:t},a)),`${s} ${i[x]}`,te.slots,{stagger:z,durationStep:B,reverse:C}),re=_?_.map((a,n)=>t(r.Fragment,{children:[a.letters.length>0?e("span",{className:"whitespace-nowrap",children:ae.slice(a.start,a.start+a.letters.length)}):null,a.gap]},n)):ae;return n({render:O??e("span",{}),ref:[b,W.ref],props:{...U,className:P,style:{"--n-anim-state":X,...Q},...W.handlers,"data-neba-animation":"split","data-state":X,children:t(a,{children:[e("span",{className:u(h),children:Y}),e("span",{"aria-hidden":"true",children:re})]})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{useRender as a}from"@base-ui/react/use-render";import{isInfinite as s,useAnimationRun as i,usePrefersReducedMotion as o}from"../../internal/animate.js";import{cx as c,srOnlyClasses as u}from"../../internal/styles.js";import{graphemesOf as l,textOf as d}from"../../internal/text.js";export const AnimateTyping=/*@__PURE__*/n.forwardRef(function AnimateTyping({text:p,speed:m=24,hold:f=1400,erase:g=!1,eraseSpeed:h,caret:y=!0,caretChar:x="|",duration:T,delay:j=0,repeat:b=1,paused:v,trigger:N="mount",play:w,once:M=!0,threshold:R=.2,render:A,className:C,style:E,children:S,...k},F){const q=i({caller:k,trigger:N,play:w,once:M,threshold:R,paused:v,infinite:s(b)}),z=o(),B=p??d(S),D=n.useMemo(()=>l(B),[B]),G=D.length,[H,I]=n.useState(0),J=n.useRef({count:0,pass:1,deleting:!1}),K=n.useRef(q.run),L=T&&G>0?T/G:1e3/Math.max(m,1),O=1e3/Math.max(h??2*m,1);n.useEffect(()=>{J.current={count:0,pass:1,deleting:!1}},[B]),n.useEffect(()=>{if(z||0===G)return void I(G);if(!q.started)return J.current={count:0,pass:1,deleting:!1},void I(0);if(K.current!==q.run&&(K.current=q.run,J.current={count:0,pass:1,deleting:!1}),v||q.offscreen)return;let e,t=!1;const r=J.current,n="infinite"===b?1/0:Math.max(1,b);if(r.count>=G&&r.pass>=n&&!r.deleting)return;const a=()=>{if(!t){if(r.deleting)return r.count-=1,I(r.count),r.count<=0&&(r.deleting=!1,r.pass+=1),void(e=setTimeout(a,r.deleting?O:L));if(r.count<G&&(r.count+=1,I(r.count)),r.count<G)e=setTimeout(a,L);else if(!(r.pass>=n))return g?(r.deleting=!0,void(e=setTimeout(a,f))):void(e=setTimeout(()=>{t||(r.count=0,r.pass+=1,I(0),e=setTimeout(a,L))},f))}};return I(r.count),e=setTimeout(a,0===r.count&&1===r.pass?j:r.deleting?O:L),()=>{t=!0,clearTimeout(e)}},[q.started,q.run,q.offscreen,v,z,B,G,L,O,j,f,g,b]);const P=q.ref,Q=n.useCallback(e=>{P(e),"function"==typeof F?F(e):F&&(F.current=e)},[F,P]);return a({render:A??e("span",{}),ref:Q,props:{className:c("grid",C),style:E,"data-neba-animation":"typing","data-state":q.state,...k,...q.handlers,children:t(r,{children:[e("span",{className:u,children:B}),t("span",{"aria-hidden":"true",className:"whitespace-pre-wrap [grid-area:1/1]",children:[D.slice(0,H).join(""),y?e("span",{className:c("neba-typing-caret"),children:x}):null]}),e("span",{"aria-hidden":"true","data-sample":B,className:"invisible whitespace-pre-wrap [grid-area:1/1] before:content-[attr(data-sample)]"})]})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{useRender as a}from"@base-ui/react/use-render";import{initialsOf as l}from"../../internal/initials.js";import{safeHref as s,safeRel as i}from"../../internal/link.js";import{controlHeightClasses as
|
|
1
|
+
"use client";import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{useRender as a}from"@base-ui/react/use-render";import{initialsOf as l}from"../../internal/initials.js";import{safeHref as s,safeRel as i}from"../../internal/link.js";import{NewTabNote as o}from"../../internal/new-tab.js";import{controlHeightClasses as m,controlSlots as d,controlSquareClasses as c,cx as u,gapClasses as x,hasContent as f,srOnlyClasses as g,surfaceClasses as p,tintPlateClasses as h,toLength as v,transitionClasses as b}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";const j={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.375rem]",xl:"text-[1.625rem]"},N={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.3125rem]",xl:"text-[1.5625rem]"},_={xs:"rounded-[0.375rem]",sm:"rounded-[0.4375rem]",md:"rounded-[0.5625rem]",lg:"rounded-[0.6875rem]",xl:"rounded-[0.875rem]"},y={solid:[p,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[p,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:`text-(--n-on-tint) ${h} [box-shadow:var(--n-elev)]`};export const AppLogo=/*@__PURE__*/t.forwardRef(function AppLogo(t,p){const{src:h,srcSet:k,alt:z,name:A,initials:L,showName:S=!1,shape:$="bare",variant:F="solid",size:P="md",color:R="primary",elevation:q=0,padded:B=!0,height:C,href:D,target:E,rel:G,imageProps:H,render:I,className:J,style:K,children:M,...O}=w(t,["size","variant"]),Q="bare"!==$,T=f(M)?M:h?"image":null,U=Q&&B,V=null===T&&!Q,W=S&&!V&&f(A),X=z??A,Y=L??(A?l(A):""),Z="image"===T&&!W&&f(X),ee=V||Z,re=!ee&&!W&&f(X),ne=v(C),te=ne?{height:ne,width:Q?ne:void 0}:null,ae=e("span",{"aria-hidden":!ee||void 0,className:u("flex shrink-0 items-center justify-center overflow-hidden","font-semibold tracking-tight whitespace-nowrap",ne?"":m[P],Q?u(ne?"":c[P],"circle"===$?"rounded-full":_[P],N[P],y[F]):u("w-auto text-(--neba-fg)",j[P]),"[&_svg]:w-auto [&_svg]:shrink-0",U?"[&_svg]:h-[72%] [&_svg]:max-w-[72%]":"[&_svg]:h-full [&_svg]:max-w-full",b),style:{...Q?d(R,q,F):null,...te},children:"image"===T?e("img",{src:h,srcSet:k,alt:Z?X??"":"",decoding:"async",...H,className:u("w-auto object-contain",U?"h-[72%] max-w-[72%]":"h-full max-w-full",H?.className)}):T??(V?A:Y)}),le=s(D);return a({render:I??e(le?"a":"span",{}),ref:p,props:{href:le,target:E,rel:i(E,G),className:u("inline-flex max-w-full min-w-0 items-center align-middle","text-(--neba-fg) no-underline select-none",x[P],le?"cursor-pointer rounded-(--neba-radius-sm)":"",le?"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2":"",J),style:{"--n-ring":`var(--neba-${R}-ring)`,...K},children:n(r,{children:[ae,W?e("span",{className:u("min-w-0 truncate font-semibold",j[P]),children:A}):null,re?e("span",{className:g,children:X}):null,le?e(o,{target:E}):null]}),...O}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l,Fragment as n}from"react/jsx-runtime";import*as a from"react";import{Button as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l,Fragment as n}from"react/jsx-runtime";import*as a from"react";import{Button as t}from"../button/Button.js";import{boxPaddingClasses as i}from"../box/Box.js";import{CheckIcon as s,severityIcon as r}from"../../internal/icons.js";import{approvalMessages as o,useMessages as c}from"../../internal/i18n.js";import{cx as d,focusRingClasses as m,hasContent as f,iconClasses as u,metaTextClasses as p,preformattedClasses as x,radiusClasses as v,sheetBodyClasses as h,sheetHeaderGapClasses as b,sheetSectionGapClasses as g,sheetTitleClasses as N,surfaceClasses as w,surfaceSlots as j,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as k}from"../../internal/defaults.js";const z={low:"info",medium:"warning",high:"danger"},I={solid:[w,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[w,"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-(--n-soft)"};export const Approval=/*@__PURE__*/a.forwardRef(function Approval(w,R){const{variant:A="outline",size:B="md",color:E="warning",density:q="default",elevation:C=0,options:D,title:F,description:L,details:S,risk:G,decision:H,onDecide:J,icon:K,disabled:M=!1,locale:O,labels:P,classNames:Q,className:T,style:U,children:V,...W}=k(w,["size","density","variant","locale"]),X={...c(o,O),...P},[Y,Z]=a.useState(null),$=void 0!==H,_=$?H:Y,ee=G?z[G]:E,le=void 0===K?r(ee):K,ne=f(F)?F:X.request,ae=a.useId(),te=null===_?void 0:D.find(e=>e.value===_),ie=void 0!==te,se=a.useRef(!1),re=a.useRef(null);return a.useLayoutEffect(()=>{if(!ie||!se.current)return;se.current=!1;const e=document.activeElement;null!==e&&e!==document.body||re.current?.focus()},[ie]),l("div",{ref:R,role:"group","aria-labelledby":ae,"data-decided":_??void 0,className:d("flex w-full flex-col",i[q][B],v[B],g[B],h[B],I[A],y,u,T??""),style:{...j(ee,C),...U},...W,children:[l("div",{className:"flex items-start gap-3",children:[f(le)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--n-accent)",children:le}):null,l("div",{className:d("flex min-w-0 flex-1 flex-col",b[B]),children:[e("div",{id:ae,className:d("font-semibold text-(--n-accent)",N[B],Q?.title??""),children:ne}),f(L)?e("div",{className:d("text-(--neba-muted-fg)",Q?.description??""),children:L}):null]}),G?e("span",{className:d("shrink-0 rounded-full bg-(--n-soft) px-2 py-0.5 font-medium text-(--n-on-tint)",p[B]),children:X[G]}):null]}),f(S)?e("div",{className:d("min-w-0",Q?.details??""),children:"string"==typeof S?e("pre",{className:d(x,"max-h-56"),children:S}):S}):null,V,e("div",{className:d("flex min-w-0 flex-col gap-1.5",Q?.actions??""),children:te?l("div",{ref:re,tabIndex:-1,className:d("flex items-center gap-2 rounded-(--neba-radius-xs) text-(--neba-muted-fg)",m),children:[e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--n-accent)",children:e(s,{})}),e("span",{className:p[B],children:X.answered}),e("span",{className:"min-w-0 font-medium text-(--neba-fg)",children:te.label})]}):l(n,{children:[e("div",{className:"flex flex-wrap gap-2",children:D.map(l=>e(t,{size:B,variant:l.variant??"outline",color:l.color??ee,startIcon:l.icon,disabled:M||l.disabled,onClick:()=>{se.current=!0,$||Z(l.value),J?.(l.value)},children:l.label},l.value))}),D.some(e=>f(e.description))?e("ul",{className:d("m-0 flex list-none flex-col gap-0.5 p-0 text-(--neba-muted-fg)",p[B]),children:D.filter(e=>f(e.description)).map(n=>l("li",{children:[e("span",{className:"font-medium text-(--neba-fg)",children:n.label})," — ",n.description]},n.value))}):null]})})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{Avatar as n}from"@base-ui/react/avatar";import{transitionProps as r}from"../../internal/animate.js";import{initialsOf as o}from"../../internal/initials.js";import{controlHeightClasses as i,controlSlots as s,controlSquareClasses as l,cx as d,hasContent as c,srOnlyClasses as m,surfaceClasses as u,tintPlateClasses as f,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const p={xs:"text-[0.5625rem]",sm:"text-[0.6875rem]",md:"text-[0.8125rem]",lg:"text-[1rem]",xl:"text-[1.1875rem]"},h={xs:"rounded-[0.375rem]",sm:"rounded-[0.4375rem]",md:"rounded-[0.5625rem]",lg:"rounded-[0.6875rem]",xl:"rounded-[0.875rem]"},b={solid:[u,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev)]"].join(" "),outline:[u,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev)]"].join(" "),text:`text-(--n-on-tint) ${f} [box-shadow:var(--n-elev)]`},g="after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]",j={solid:`${g} after:[box-shadow:var(--neba-plate-solid)]`,outline:`${g} after:[box-shadow:var(--neba-plate-glass)]`,text:""},y=["relative inline-flex shrink-0 select-none items-center justify-center overflow-hidden","align-middle font-semibold tracking-wide whitespace-nowrap leading-none","[&_svg]:pointer-events-none [&_svg]:size-[55%]",v].join(" ");function PersonIcon(){return t("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M12 12a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Z"}),e("path",{d:"M12 14.25c-4.28 0-7.75 2.42-7.75 5.4 0 .75.6 1.35 1.35 1.35h12.8c.75 0 1.35-.6 1.35-1.35 0-2.98-3.47-5.4-7.75-5.4Z"})]})}export const Avatar=/*@__PURE__*/a.forwardRef(function Avatar(a,u){const{src:f,srcSet:v,alt:g,name:w,initials:N,shape:z,variant:k,size:S,color:_,elevation:A,delay:C,imageProps:I,onLoadingStatusChange:M,transition:P,className:$,style:B,children:L,...R}=x(a,["size","variant"]),Z=z??"circle",F=k??"text",q=S??"md",D=_??"primary",E=A??0,G=w?o(w):"",H=r(P),J=g??w,K=c(L)?L:(N??G)||e(PersonIcon,{}),O=Boolean(J),Q=""===J,T=d(y,i[q],l[q],p[q],"circle"===Z?"rounded-full":h[q],b[F],j[F],H.className,$??"");return t(n.Root,{ref:u,className:T,style:{...s(D,E,F),...H.style,...B},...R,children:[f?e(n.Image,{src:f,srcSet:v,alt:J??"",decoding:"async",onLoadingStatusChange:M,keepMounted:!0,...I,className:d("absolute inset-0 size-full object-cover [transition:opacity_var(--neba-duration-fill)_var(--neba-ease)] data-[error]:opacity-0 data-[loading]:opacity-0",I?.className)}):null,t(n.Fallback,{delay:f?C:void 0,className:"flex size-full items-center justify-center",children:[O?e("span",{className:m,children:J}):null,e("span",{"aria-hidden":!(!O&&!Q)||void 0,className:"contents",children:K})]})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CartesianChart as a,markTransitionClasses as n}from"../../internal/chart-frame.js";import{barBandRatio as l,barMaxThickness as r,barPath as i,barRadius as o,chartFontSizes as s,labelInk as u,labelledPoints as d,markGap as c}from"../../internal/chart.js";import{useStyleDefaults as h}from"../../internal/defaults.js";export function BarChart(t){const{orientation:n="vertical",stacked:i=!1,rounded:o=!0,barSize:s,valueLabels:u="none",series:d,yAxis:c,size:m="md",density:x="default",...f}=h(t,["size","density"]),v="full"===i;return e(a,{...f,series:d,stackedFull:v,size:m,density:x,horizontal:"horizontal"===n,stacked:!1!==i,yAxis:v?{min:0,max:100,tickFormat:e=>`${e}%`,...c}:c,includeZero:!0,bandRatio:l[x],headroom:"none"===u?0:12,children:t=>e(Bars,{context:t,stacked:!1!==i,rounded:o,barSize:s??r[m],valueLabels:u,size:m})})}function Bars({context:a,stacked:l,rounded:r,barSize:h,valueLabels:m,size:x}){const{values:f,visible:v,colors:b,hovered:p,activeIndex:z,plot:y,band:k,horizontal:g,valuePx:j,categoryPx:M,zeroPx:B,zeroPxOf:P,
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{CartesianChart as a,markTransitionClasses as n}from"../../internal/chart-frame.js";import{barBandRatio as l,barMaxThickness as r,barPath as i,barRadius as o,chartFontSizes as s,labelInk as u,labelledPoints as d,markGap as c}from"../../internal/chart.js";import{useStyleDefaults as h}from"../../internal/defaults.js";export function BarChart(t){const{orientation:n="vertical",stacked:i=!1,rounded:o=!0,barSize:s,valueLabels:u="none",series:d,yAxis:c,size:m="md",density:x="default",...f}=h(t,["size","density"]),v="full"===i;return e(a,{...f,series:d,stackedFull:v,size:m,density:x,horizontal:"horizontal"===n,stacked:!1!==i,yAxis:v?{min:0,max:100,tickFormat:e=>`${e}%`,...c}:c,includeZero:!0,bandRatio:l[x],headroom:"none"===u?0:12,children:t=>e(Bars,{context:t,stacked:!1!==i,rounded:o,barSize:s??r[m],valueLabels:u,size:m})})}function Bars({context:a,stacked:l,rounded:r,barSize:h,valueLabels:m,size:x}){const{values:f,visible:v,colors:b,hovered:p,activeIndex:z,plot:y,band:k,horizontal:g,valuePx:j,categoryPx:M,zeroPx:B,zeroPxOf:P,formatFor:S}=a,A=f.map((e,t)=>({one:e,index:t})).filter(e=>v[e.index]),F=l?1:Math.max(1,A.length),L=Math.min(h,Math.max(1,(k.band-c*(F-1))/F)),N=L*F+c*(F-1),W=[],w=[],C=s[x];return t("g",{children:[A.map(({one:a,index:s},h)=>{const x=b[s],f=null!==p&&p!==s,v="extremes"===m||"last"===m?d(a,m):null;return e("g",{opacity:f?.28:1,className:n,children:a.map((a,d)=>{if(null===a.value)return null;const f=M(d),b=l?0:h*(L+c)-N/2+L/2,p=l?a.value>=0?W[d]??0:w[d]??0:0,k=0===p?P(s):j(p,s),B=j(p+a.value,s);l&&(a.value>=0?W[d]=p+a.value:w[d]=p+a.value);const A=l&&0!==p?c:0,F=Math.abs(B-k)-A;if(F<=0)return null;const I=B<k,O=d===z,R=g?i(Math.min(k,B)+(I?0:A),y.top+f+b-L/2,F,L,r&&!l?o:r?o/2:0,a.value>=0?"right":"left"):i(y.left+f+b-L/2,Math.min(k,B)+(I?0:A),L,F,r&&!l?o:r?o/2:0,a.value>=0?"up":"down");return t("g",{children:[e("path",{d:R,fill:a.color??x,opacity:O?1:.92,className:n}),"none"===m||v&&!v(d)?null:e("text",{x:g?B+(a.value>=0?5:-5):y.left+f+b,y:g?y.top+f+b:a.value>=0?B-5:B+C+2,textAnchor:g?a.value>=0?"start":"end":"middle",dominantBaseline:g?"central":void 0,fontSize:C,fontWeight:500,fill:u(a.color??x),className:"tabular-nums",children:a.label??S(s)(a.value)})]},d)})},s)}),e("line",g?{x1:B,x2:B,y1:y.top,y2:y.top+y.height,stroke:"var(--neba-chart-baseline)",strokeWidth:1}:{x1:y.left,x2:y.left+y.width,y1:B,y2:B,stroke:"var(--neba-chart-baseline)",strokeWidth:1})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{useRender as i}from"@base-ui/react/use-render";import{barMinHeightClasses as r,BottomNavigationContext as l}from"../../internal/bottom-navigation.js";import{safeHref as o,safeRel as s}from"../../internal/link.js";import{NewTabNote as d}from"../../internal/new-tab.js";import{cx as c,hasContent as m,iconSizeClasses as u,metaTextClasses as p,paddingXClasses as f,radiusClasses as g,srOnlyClasses as b,surfaceClasses as v,surfaceSlots as x,transitionClasses as h}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const w={solid:[v,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[v,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},N={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},j={default:{xs:"p-1",sm:"p-1",md:"p-1.5",lg:"p-2",xl:"p-2.5"},compact:{xs:"p-0.5",sm:"p-0.5",md:"p-1",lg:"p-1",xl:"p-1.5"}},z={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const BottomNavigation=/*@__PURE__*/n.forwardRef(function BottomNavigation(t,a){const{variant:o="outline",size:s="md",color:d="primary",density:m="default",elevation:u=0,value:p,defaultValue:f=null,onValueChange:b,position:v="fixed",labels:z="all",divider:k=!0,safeArea:C=!0,disabled:B=!1,label:I,render:R,className:V,style:_,children:A,...D}=y(t,["size","density","variant"]),[F,M]=n.useState(f),P=void 0!==p,S=P?p:F,q=n.useCallback(e=>{P||M(e),b?.(e)},[P,b]),E=n.useMemo(()=>({value:S??null,change:q,size:s,density:m,labels:z,disabled:B,floating:!1}),[S,q,s,m,z,B]),G=c("w-full min-w-0","static"===v?g[s]:"",w[o],"outline"===o&&"static"===v?"border [border-color:var(--n-line)]":"",k?"border-t [border-color:var(--n-line)]":"",N[v],C&&"static"!==v?"pb-[env(safe-area-inset-bottom)]":"",h,V);return i({render:R??e("nav",{}),ref:a,props:{"aria-label":I,className:G,style:{...x(d,u),..._},children:e(l.Provider,{value:E,children:e("div",{className:c("flex w-full items-stretch",r[s],j[m][s]),children:A})}),...D}})});export const BottomNavigationItem=/*@__PURE__*/n.forwardRef(function BottomNavigationItem({value:i,icon:r,href:v,target:x,rel:y,disabled:w=!1,className:N,children:j,onClick:k,...C},B){const I=n.useContext(l),R=w||I.disabled,V=null!==I.value&&I.value===i,_="all"===I.labels||"selected"===I.labels&&V,A=c("neba-nav-item flex min-w-0 flex-col items-center justify-center py-1.5",I.floating?c("relative z-10",f[I.density][I.size],"rounded-full"):c("flex-1 px-1",g[I.size]),z[I.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",h,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",R?"cursor-not-allowed text-(--neba-disabled-fg)":V?I.floating?"cursor-pointer font-medium text-(--n-on-tint)":"cursor-pointer font-medium text-(--n-on-tint) bg-(--n-soft) hover:bg-(--n-soft-hover)":"cursor-pointer text-(--neba-muted-fg) hover:text-(--neba-fg) hover:bg-(--n-panel-hover)",N),D=a(t,{children:[m(r)?e("span",{className:c("flex shrink-0 items-center justify-center",u[I.size]),children:r}):null,m(j)?I.floating&&"selected"===I.labels?e("span",{"data-drawn":_?"":void 0,className:c("grid justify-items-center [grid-template-rows:1fr]","[transition-property:grid-template-columns,opacity]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","motion-reduce:[transition-duration:0ms]",_?"[grid-template-columns:1fr] opacity-100":"[grid-template-columns:0fr] opacity-0"),children:e("span",{className:c("min-w-0 truncate leading-tight",p[I.size]),children:j})}):e("span",{"data-drawn":_?"":void 0,className:_?c("max-w-full truncate leading-tight",p[I.size]):"selected"===I.labels?c("max-w-full truncate leading-tight opacity-0",p[I.size]):b,children:j}):null]}),F=e=>{R?e.preventDefault():(I.change(i),k?.(e))},M=o(v);return M?a("a",{ref:B,"data-nav-item":"",href:R?void 0:M,"aria-current":V?"page":void 0,"aria-disabled":R||void 0,className:A,onClick:F,target:x,rel:s(x,y),...C,children:[D,e(d,{target:x})]}):e("button",{ref:B,"data-nav-item":"",type:"button",disabled:R,"aria-current":V?"page":void 0,className:A,onClick:F,...C,children:D})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as s}from"@base-ui/react/use-render";import{transitionProps as a}from"../../internal/animate.js";import{cx as r,radiusClasses as t,surfaceClasses as
|
|
1
|
+
"use client";import*as e from"react";import{useRender as s}from"@base-ui/react/use-render";import{transitionProps as a}from"../../internal/animate.js";import{cx as r,radiusClasses as t,surfaceClasses as l,surfaceSlots as o,transitionClasses as n}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const m=t;export const boxPaddingClasses={default:{xs:"p-2",sm:"p-3",md:"p-4",lg:"p-5",xl:"p-6"},compact:{xs:"p-1.5",sm:"p-2",md:"p-2.5",lg:"p-3",xl:"p-4"}};export const boxPaddingXClasses={default:{xs:"px-2",sm:"px-3",md:"px-4",lg:"px-5",xl:"px-6"},compact:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-4"}};export const boxPaddingYClasses={default:{xs:"py-2",sm:"py-3",md:"py-4",lg:"py-5",xl:"py-6"},compact:{xs:"py-1.5",sm:"py-2",md:"py-2.5",lg:"py-3",xl:"py-4"}};export const boxPaddingYValues={default:{xs:"0.5rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},compact:{xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.75rem",xl:"1rem"}};const x=`block ${n}`,d={solid:`${l} text-(--neba-fg) bg-(--n-panel-hover) [box-shadow:var(--n-elev),var(--neba-plate-solid)]`,outline:`${l} 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"};export const Box=/*@__PURE__*/e.forwardRef(function Box(e,t){const{variant:l="outline",size:n="md",color:i="primary",density:c="default",elevation:g=0,padded:b=!0,transition:f,render:y,className:u,style:v,children:h,...P}=p(e,["size","density","variant"]),C=a(f),j=r(x,m[n],b?boxPaddingClasses[c][n]:"",d[l],C.className,u??"");return s({render:y,ref:t,props:{className:j,style:{...o(i,g),...C.style,...v},children:h,...P}})});
|