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/internal/i18n.d.ts
CHANGED
|
@@ -65,6 +65,12 @@ export interface ActionMessages {
|
|
|
65
65
|
clear: string;
|
|
66
66
|
/** The × on a Chip. */
|
|
67
67
|
remove: string;
|
|
68
|
+
/**
|
|
69
|
+
* The same ×, on a Chip whose label is a string: a row of chips each named
|
|
70
|
+
* "Remove" gives a screen reader no way to tell them apart. `{label}` is
|
|
71
|
+
* replaced with the label.
|
|
72
|
+
*/
|
|
73
|
+
removeLabel: string;
|
|
68
74
|
}
|
|
69
75
|
/** The `action` namespace, as Alert, Chip, Combobox, Dialog, Drawer, Popover and Toast read it. */
|
|
70
76
|
export declare const actionMessages: MessageTable<ActionMessages>;
|
|
@@ -176,6 +182,19 @@ export interface TableMessages {
|
|
|
176
182
|
* than `empty`'s, which said there was nothing there over rows that were.
|
|
177
183
|
*/
|
|
178
184
|
noGroup: string;
|
|
185
|
+
/**
|
|
186
|
+
* The boundary a keyboard resizes a column by. `{column}` is replaced with
|
|
187
|
+
* the column's label.
|
|
188
|
+
*/
|
|
189
|
+
resizeColumn: string;
|
|
190
|
+
/**
|
|
191
|
+
* What a heading past the first in a multiple sort says about its place in
|
|
192
|
+
* the order, since only the first key can carry `aria-sort`. `{order}` is
|
|
193
|
+
* replaced with the place, already formatted.
|
|
194
|
+
*/
|
|
195
|
+
sortAscending: string;
|
|
196
|
+
/** The same, for a key sorted the other way. */
|
|
197
|
+
sortDescending: string;
|
|
179
198
|
}
|
|
180
199
|
/** The `table` namespace, as Table and DataTable read it. */
|
|
181
200
|
export declare const tableMessages: MessageTable<TableMessages>;
|
|
@@ -191,6 +210,12 @@ export declare const tableMessages: MessageTable<TableMessages>;
|
|
|
191
210
|
export interface ColorMessages {
|
|
192
211
|
/** The saturation/brightness square. */
|
|
193
212
|
area: string;
|
|
213
|
+
/**
|
|
214
|
+
* What the square's position is read as. `{saturation}` and `{brightness}`
|
|
215
|
+
* are replaced with the two percentages, already formatted for the locale —
|
|
216
|
+
* two bare numbers say nothing about which is which.
|
|
217
|
+
*/
|
|
218
|
+
areaValue: string;
|
|
194
219
|
/** The rail beside it. */
|
|
195
220
|
hue: string;
|
|
196
221
|
/** The rail below that, when `alpha` is on. */
|
|
@@ -401,13 +426,19 @@ export interface ChartMessages {
|
|
|
401
426
|
* read on every focus and the hidden table beside the plot holds the rest.
|
|
402
427
|
*/
|
|
403
428
|
summary: string;
|
|
429
|
+
/**
|
|
430
|
+
* The same sentence for the series on a second value axis, which follows the
|
|
431
|
+
* first. Said apart because the two axes are in different units: one range
|
|
432
|
+
* across both, written in the first axis' format, reads "$2 to $246,000".
|
|
433
|
+
*/
|
|
434
|
+
summarySecondary: string;
|
|
404
435
|
/** The button that writes the chart's data out as a file. */
|
|
405
436
|
exportCsv: string;
|
|
406
437
|
}
|
|
407
438
|
/** The `chart` namespace, as every chart reads it. */
|
|
408
439
|
export declare const chartMessages: MessageTable<ChartMessages>;
|
|
409
440
|
/**
|
|
410
|
-
* ScrollZone.
|
|
441
|
+
* ScrollZone, and ScrollArea's `label` fallback.
|
|
411
442
|
*
|
|
412
443
|
* Both buttons are an arrow with nothing else on them, and which way the
|
|
413
444
|
* strip runs is a prop — so the words are logical rather than physical. A
|
|
@@ -428,7 +459,7 @@ export interface ScrollMessages {
|
|
|
428
459
|
previous: string;
|
|
429
460
|
next: string;
|
|
430
461
|
}
|
|
431
|
-
/** The `scroll` namespace, as ScrollZone read it. */
|
|
462
|
+
/** The `scroll` namespace, as ScrollZone and ScrollArea read it. */
|
|
432
463
|
export declare const scrollMessages: MessageTable<ScrollMessages>;
|
|
433
464
|
/** Panes. */
|
|
434
465
|
export interface PanesMessages {
|
|
@@ -479,6 +510,11 @@ export interface TransferMessages {
|
|
|
479
510
|
selectAll: string;
|
|
480
511
|
/** The line where the rows would be, when a list has none. */
|
|
481
512
|
empty: string;
|
|
513
|
+
/**
|
|
514
|
+
* What a screen reader is told after a move. `{count}` is replaced with how
|
|
515
|
+
* many rows moved and `{list}` with the heading of the list they went to.
|
|
516
|
+
*/
|
|
517
|
+
moved: string;
|
|
482
518
|
}
|
|
483
519
|
/** The `transfer` namespace, as Transfer read it. */
|
|
484
520
|
export declare const transferMessages: MessageTable<TransferMessages>;
|
|
@@ -896,10 +932,10 @@ export interface NebaLocale {
|
|
|
896
932
|
* registerMessages('ko', ko);
|
|
897
933
|
* ```
|
|
898
934
|
*
|
|
899
|
-
* Shipping the
|
|
935
|
+
* Shipping the others unconditionally would put them in the bundle of
|
|
900
936
|
* every product that speaks one language, because a bundler cannot drop a key
|
|
901
937
|
* out of an object literal — which is the same reason the namespaces above are
|
|
902
|
-
*
|
|
938
|
+
* separate exports rather than one table. Registering is what makes the cost
|
|
903
939
|
* follow the need.
|
|
904
940
|
*
|
|
905
941
|
* The tag is matched the way a `locale` prop is: by script, then by region,
|
package/dist/internal/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{memoise as s}from"./cache.js";export const actionMessages={"":{close:"Close",dismiss:"Dismiss",clear:"Clear",remove:"Remove"}};export const confirmMessages={"":{confirm:"Confirm",cancel:"Cancel"}};export const linkMessages={"":{newTab:"(opens in a new tab)"}};export const spoilerMessages={"":{reveal:"Reveal",hide:"Hide",notice:"This may contain spoilers"}};export const chatMessages={"":{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing…"}};export const emptyMessages={"":{title:"Nothing here"}};export const tableMessages={"":{search:"Search",selectAll:"Select all rows",selectRow:"Select row",rowsPerPage:"Rows per page",range:"{start}–{end} of {total}",selected:"{count} selected",empty:"No data",exportCsv:"Export CSV",noGroup:"No group"}};export const colorMessages={"":{area:"Saturation and brightness",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Preset colours",clear:"Clear",empty:"Choose a colour"}};export const ratingMessages={"":{label:"Rating",value:"{value} out of {max}",empty:"No rating"}};export const numberMessages={"":{increase:"Increase",decrease:"Decrease"}};export const paginationMessages={"":{label:"Pagination",page:"Page {page}",status:"Page {page} of {total}",previous:"Previous page",next:"Next page",first:"First page",last:"Last page"}};export const carouselMessages={"":{label:"Carousel",slide:"Slide {index} of {total}",previous:"Previous slide",next:"Next slide",pause:"Pause slide show",play:"Play slide show"}};export const pickerMessages={"":{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",thisMonth:"This month",thisYear:"This year",now:"Now",clear:"Clear",done:"Done",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End"}};export const galleryMessages={"":{label:"Gallery",item:"Image {index} of {total}",previous:"Previous image",next:"Next image"}};export const imageMessages={"":{unavailable:"Image unavailable",preview:"Enlarge image"}};export const chartMessages={"":{label:"Chart",size:"Size",title:"Label",start:"Start",end:"End",summary:"Data points: {count}. Range: {min} to {max}.",exportCsv:"Export CSV"}};export const scrollMessages={"":{label:"Scrollable content",previous:"Scroll back",next:"Scroll forward"}};export const panesMessages={"":{handle:"Resize panes"}};export const breadcrumbMessages={"":{label:"Breadcrumb",expand:"Show hidden steps"}};export const commandMessages={"":{label:"Command palette",search:"Type a command or search…",empty:"No commands found"}};export const transferMessages={"":{source:"Available",target:"Selected",toTarget:"Move to selected",toSource:"Move to available",search:"Search",selectAll:"Select all",empty:"Nothing here"}};export const anchorMessages={"":{label:"On this page"}};export const comboboxMessages={"":{empty:"No matches",remove:"Remove {label}",add:"Add “{label}”",open:"Open"}};export const toastMessages={"":{label:"Notifications"}};export const timelineMessages={"":{complete:"Completed",upcoming:"Upcoming"}};export const fileMessages={"":{title:"Drop files here, or click to browse",remove:"Remove {name}"}};export const otpMessages={"":{slot:"Character {index} of {total}"}};export const overlayMessages={"":{label:"Loading"}};export const windowMessages={"":{minimize:"Minimize",maximize:"Maximize",restore:"Restore",resize:"Resize window",resizeHint:"Use the arrow keys to resize the window"}};export const layoutMessages={"":{skipToContent:"Skip to content",sidebar:"Sidebar",openSidebar:"Open sidebar",closeSidebar:"Close sidebar",resizeSidebar:"Resize sidebar"}};export const codeMessages={"":{code:"Code",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",prompt:"Prompt"}};export const stepsMessages={"":{previous:"Previous",next:"Next",done:"Done",skip:"Skip",restart:"Start over",completed:"All steps complete",steps:"Steps",position:"{index} of {total}",step:"Step {index}: {title}"}};export const runMessages={"":{pending:"Waiting",running:"Running",success:"Finished",error:"Failed"}};export const toolMessages={"":{arguments:"Arguments",result:"Result"}};export const approvalMessages={"":{request:"Permission needed",answered:"Answered",low:"Low risk",medium:"Medium risk",high:"High risk"}};export const reasoningMessages={"":{thinking:"Thinking…",thought:"Thought for {duration}",done:"Finished thinking"}};export const contextMessages={"":{label:"Context",input:"Input",output:"Output",reasoning:"Reasoning",cached:"Cached",cost:"Estimated cost",usage:"{used} of {max}"}};export const sourcesMessages={"":{title:"Sources",citation:"Source {index}"}};export const promptMessages={"":{send:"Send",stop:"Stop",drop:"Drop files to attach"}};const o={zh:"zh-hans","zh-cn":"zh-hans","zh-my":"zh-hans","zh-sg":"zh-hans","zh-hk":"zh-hant","zh-mo":"zh-hant","zh-tw":"zh-hant"};const t=new WeakMap;export function resolveMessages(e,a){const r=e[""],n=a?.trim()??"";if(!n)return r;let i=t.get(e);return i||(i=new Map,t.set(e,i)),s(i,n,()=>{const s=function(e){const s=e.toLowerCase().split(/[-_]/).filter(Boolean),o=s[0];if(!o)return[];const t=s.slice(1),a=t.find(e=>/^[a-z]{4}$/.test(e)),r=t.find(e=>/^([a-z]{2}|\d{3})$/.test(e));return[a?`${o}-${a}`:"",r?`${o}-${r}`:"",o].filter(Boolean)}(n).map(s=>{const t=Object.hasOwn(o,s)?o[s]:void 0;return Object.hasOwn(e,s)?e[s]:t&&Object.hasOwn(e,t)?e[t]:void 0}).find(Boolean);return s?{...r,...s}:r})}export function useMessages(s,o){return e.useMemo(()=>resolveMessages(s,o),[s,o])}export function fillMessage(e,s){return e.replace(/\{(\w+)\}/g,(e,o)=>Object.hasOwn(s,o)?s[o]:e)}const a={action:actionMessages,confirm:confirmMessages,link:linkMessages,spoiler:spoilerMessages,chat:chatMessages,empty:emptyMessages,table:tableMessages,color:colorMessages,rating:ratingMessages,number:numberMessages,pagination:paginationMessages,carousel:carouselMessages,picker:pickerMessages,gallery:galleryMessages,image:imageMessages,chart:chartMessages,scroll:scrollMessages,panes:panesMessages,breadcrumb:breadcrumbMessages,anchor:anchorMessages,transfer:transferMessages,command:commandMessages,combobox:comboboxMessages,toast:toastMessages,overlay:overlayMessages,window:windowMessages,layout:layoutMessages,code:codeMessages,steps:stepsMessages,otp:otpMessages,file:fileMessages,timeline:timelineMessages,run:runMessages,tool:toolMessages,approval:approvalMessages,reasoning:reasoningMessages,context:contextMessages,sources:sourcesMessages,prompt:promptMessages};export function registerMessages(e,s){const o=e.trim().toLowerCase();if("__proto__"!==o)for(const[e,r]of Object.entries(s)){const s=Object.hasOwn(a,e)?a[e]:void 0;s&&r&&(s[o]=r,t.delete(s))}}
|
|
1
|
+
import*as e from"react";import{memoise as s}from"./cache.js";export const actionMessages={"":{close:"Close",dismiss:"Dismiss",clear:"Clear",remove:"Remove",removeLabel:"Remove {label}"}};export const confirmMessages={"":{confirm:"Confirm",cancel:"Cancel"}};export const linkMessages={"":{newTab:"(opens in a new tab)"}};export const spoilerMessages={"":{reveal:"Reveal",hide:"Hide",notice:"This may contain spoilers"}};export const chatMessages={"":{sending:"Sending",sent:"Sent",delivered:"Delivered",read:"Read",failed:"Not sent",typing:"Typing…"}};export const emptyMessages={"":{title:"Nothing here"}};export const tableMessages={"":{search:"Search",selectAll:"Select all rows",selectRow:"Select row",rowsPerPage:"Rows per page",range:"{start}–{end} of {total}",selected:"{count} selected",empty:"No data",exportCsv:"Export CSV",noGroup:"No group",resizeColumn:"Resize {column}",sortAscending:"sort {order}, ascending",sortDescending:"sort {order}, descending"}};export const colorMessages={"":{area:"Saturation and brightness",areaValue:"Saturation {saturation}, brightness {brightness}",hue:"Hue",alpha:"Opacity",value:"Colour value",swatches:"Preset colours",clear:"Clear",empty:"Choose a colour"}};export const ratingMessages={"":{label:"Rating",value:"{value} out of {max}",empty:"No rating"}};export const numberMessages={"":{increase:"Increase",decrease:"Decrease"}};export const paginationMessages={"":{label:"Pagination",page:"Page {page}",status:"Page {page} of {total}",previous:"Previous page",next:"Next page",first:"First page",last:"Last page"}};export const carouselMessages={"":{label:"Carousel",slide:"Slide {index} of {total}",previous:"Previous slide",next:"Next slide",pause:"Pause slide show",play:"Play slide show"}};export const pickerMessages={"":{previousMonth:"Previous month",nextMonth:"Next month",previousYear:"Previous year",nextYear:"Next year",previousYears:"Previous years",nextYears:"Next years",chooseMonth:"Choose a month",chooseYear:"Choose a year",today:"Today",thisMonth:"This month",thisYear:"This year",now:"Now",clear:"Clear",done:"Done",hour:"Hour",minute:"Minute",second:"Second",meridiem:"AM/PM",start:"Start",end:"End"}};export const galleryMessages={"":{label:"Gallery",item:"Image {index} of {total}",previous:"Previous image",next:"Next image"}};export const imageMessages={"":{unavailable:"Image unavailable",preview:"Enlarge image"}};export const chartMessages={"":{label:"Chart",size:"Size",title:"Label",start:"Start",end:"End",summary:"Data points: {count}. Range: {min} to {max}.",summarySecondary:"On the second axis, data points: {count}. Range: {min} to {max}.",exportCsv:"Export CSV"}};export const scrollMessages={"":{label:"Scrollable content",previous:"Scroll back",next:"Scroll forward"}};export const panesMessages={"":{handle:"Resize panes"}};export const breadcrumbMessages={"":{label:"Breadcrumb",expand:"Show hidden steps"}};export const commandMessages={"":{label:"Command palette",search:"Type a command or search…",empty:"No commands found"}};export const transferMessages={"":{source:"Available",target:"Selected",toTarget:"Move to selected",toSource:"Move to available",search:"Search",selectAll:"Select all",empty:"Nothing here",moved:"{count} moved to {list}"}};export const anchorMessages={"":{label:"On this page"}};export const comboboxMessages={"":{empty:"No matches",remove:"Remove {label}",add:"Add “{label}”",open:"Open"}};export const toastMessages={"":{label:"Notifications"}};export const timelineMessages={"":{complete:"Completed",upcoming:"Upcoming"}};export const fileMessages={"":{title:"Drop files here, or click to browse",remove:"Remove {name}"}};export const otpMessages={"":{slot:"Character {index} of {total}"}};export const overlayMessages={"":{label:"Loading"}};export const windowMessages={"":{minimize:"Minimize",maximize:"Maximize",restore:"Restore",resize:"Resize window",resizeHint:"Use the arrow keys to resize the window"}};export const layoutMessages={"":{skipToContent:"Skip to content",sidebar:"Sidebar",openSidebar:"Open sidebar",closeSidebar:"Close sidebar",resizeSidebar:"Resize sidebar"}};export const codeMessages={"":{code:"Code",copy:"Copy",copied:"Copied",copyFailed:"Could not copy",raw:"Raw",prompt:"Prompt"}};export const stepsMessages={"":{previous:"Previous",next:"Next",done:"Done",skip:"Skip",restart:"Start over",completed:"All steps complete",steps:"Steps",position:"{index} of {total}",step:"Step {index}: {title}"}};export const runMessages={"":{pending:"Waiting",running:"Running",success:"Finished",error:"Failed"}};export const toolMessages={"":{arguments:"Arguments",result:"Result"}};export const approvalMessages={"":{request:"Permission needed",answered:"Answered",low:"Low risk",medium:"Medium risk",high:"High risk"}};export const reasoningMessages={"":{thinking:"Thinking…",thought:"Thought for {duration}",done:"Finished thinking"}};export const contextMessages={"":{label:"Context",input:"Input",output:"Output",reasoning:"Reasoning",cached:"Cached",cost:"Estimated cost",usage:"{used} of {max}"}};export const sourcesMessages={"":{title:"Sources",citation:"Source {index}"}};export const promptMessages={"":{send:"Send",stop:"Stop",drop:"Drop files to attach"}};const o={zh:"zh-hans","zh-cn":"zh-hans","zh-my":"zh-hans","zh-sg":"zh-hans","zh-hk":"zh-hant","zh-mo":"zh-hant","zh-tw":"zh-hant"};const t=new WeakMap;export function resolveMessages(e,a){const r=e[""],n=a?.trim()??"";if(!n)return r;let i=t.get(e);return i||(i=new Map,t.set(e,i)),s(i,n,()=>{const s=function(e){const s=e.toLowerCase().split(/[-_]/).filter(Boolean),o=s[0];if(!o)return[];const t=s.slice(1),a=t.find(e=>/^[a-z]{4}$/.test(e)),r=t.find(e=>/^([a-z]{2}|\d{3})$/.test(e));return[a?`${o}-${a}`:"",r?`${o}-${r}`:"",o].filter(Boolean)}(n).map(s=>{const t=Object.hasOwn(o,s)?o[s]:void 0;return Object.hasOwn(e,s)?e[s]:t&&Object.hasOwn(e,t)?e[t]:void 0}).find(Boolean);return s?{...r,...s}:r})}export function useMessages(s,o){return e.useMemo(()=>resolveMessages(s,o),[s,o])}export function fillMessage(e,s){return e.replace(/\{(\w+)\}/g,(e,o)=>Object.hasOwn(s,o)?s[o]:e)}const a={action:actionMessages,confirm:confirmMessages,link:linkMessages,spoiler:spoilerMessages,chat:chatMessages,empty:emptyMessages,table:tableMessages,color:colorMessages,rating:ratingMessages,number:numberMessages,pagination:paginationMessages,carousel:carouselMessages,picker:pickerMessages,gallery:galleryMessages,image:imageMessages,chart:chartMessages,scroll:scrollMessages,panes:panesMessages,breadcrumb:breadcrumbMessages,anchor:anchorMessages,transfer:transferMessages,command:commandMessages,combobox:comboboxMessages,toast:toastMessages,overlay:overlayMessages,window:windowMessages,layout:layoutMessages,code:codeMessages,steps:stepsMessages,otp:otpMessages,file:fileMessages,timeline:timelineMessages,run:runMessages,tool:toolMessages,approval:approvalMessages,reasoning:reasoningMessages,context:contextMessages,sources:sourcesMessages,prompt:promptMessages};export function registerMessages(e,s){const o=e.trim().toLowerCase();if("__proto__"!==o)for(const[e,r]of Object.entries(s)){const s=Object.hasOwn(a,e)?a[e]:void 0;s&&r&&(s[o]=r,t.delete(s))}}
|
package/dist/internal/icons.d.ts
CHANGED
|
@@ -135,6 +135,9 @@ export declare function StarOutlineIcon(): React.JSX.Element;
|
|
|
135
135
|
* The arc is a quarter of the circle behind it, and both are stroked at 2 rather
|
|
136
136
|
* than the 1.5 every other glyph here uses: a ring that turns is read as a
|
|
137
137
|
* shape rather than as a line, and at 1.5 it reads as a smudge.
|
|
138
|
+
*
|
|
139
|
+
* It turns on `.neba-ring-spin`, the rate an indeterminate ProgressCircular
|
|
140
|
+
* turns at, which a reduced-motion preference slows rather than stops.
|
|
138
141
|
*/
|
|
139
142
|
export declare function SpinnerIcon(): React.JSX.Element;
|
|
140
143
|
/** The filled dot: the chosen one of a set, where a tick would say "and". */
|
package/dist/internal/icons.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as r,jsxs as e}from"react/jsx-runtime";export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function TrendUpIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 11 6.5 7.5 9 10l4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 6h3.5v3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function TrendDownIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 5 6.5 8.5 9 6l4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 10h3.5V6.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2",y:"3.25",width:"12",height:"10.75",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2 6.75h12",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.25 1.75v2.5M10.75 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CopyIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"5.75",y:"5.75",width:"7.5",height:"7.5",rx:"1.75",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M10.25 3.6a1.85 1.85 0 0 0-1.5-.85h-4a2 2 0 0 0-2 2v4c0 .62.28 1.17.72 1.54",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function CodeIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M5.75 4.5 2.5 8l3.25 3.5m4.5-7L13.5 8l-3.25 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function RestartIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M13 8a5 5 0 1 1-1.6-3.67",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M13.25 2.25v3h-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function PauseIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[r("rect",{x:"4",y:"3",width:"2.75",height:"10",rx:"1"}),r("rect",{x:"9.25",y:"3",width:"2.75",height:"10",rx:"1"})]})}export function PlayIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r("path",{d:"M5.5 3.6a1 1 0 0 1 1.53-.85l6.1 3.9a1.2 1.2 0 0 1 0 2.02l-6.1 3.9a1 1 0 0 1-1.53-.85V3.6Z"})})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}const o="M8 1.4 9.71 5.65 14.28 5.96 10.76 8.9 11.88 13.34 8 10.9 4.12 13.34 5.24 8.9 1.72 5.96 6.29 5.65Z";export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}export function SpinnerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";export function CloseIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 4.5 7 7m0-7-7 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function ChevronIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m4.5 6.5 3.5 3.5 3.5-3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function CheckIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"m3.5 8.5 3 3 6-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})}export function MinusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function PlusIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M8 3.5v9M3.5 8h9",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}export function TrendUpIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 11 6.5 7.5 9 10l4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 6h3.5v3.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function TrendDownIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M3 5 6.5 8.5 9 6l4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"}),r("path",{d:"M9.5 10h3.5V6.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CalendarIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"2",y:"3.25",width:"12",height:"10.75",rx:"2",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M2 6.75h12",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M5.25 1.75v2.5M10.75 1.75v2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ClockIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 4.5V8l2.4 1.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function ArrowRightIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M3 8h10m-3.5-3.5L13 8l-3.5 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function LinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M6.5 9.5a2.75 2.75 0 0 0 4 .25l1.75-1.75a2.75 2.75 0 0 0-3.9-3.9L7.75 5.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 6.5a2.75 2.75 0 0 0-4-.25L3.75 8a2.75 2.75 0 0 0 3.9 3.9l.6-.6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function ExternalLinkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M12.75 9.25v2.5a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5h2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M9.5 2.75h3.75V6.5M7.25 8.75l5.75-5.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function CopyIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("rect",{x:"5.75",y:"5.75",width:"7.5",height:"7.5",rx:"1.75",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M10.25 3.6a1.85 1.85 0 0 0-1.5-.85h-4a2 2 0 0 0-2 2v4c0 .62.28 1.17.72 1.54",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function CodeIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:"M5.75 4.5 2.5 8l3.25 3.5m4.5-7L13.5 8l-3.25 3.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export function RestartIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M13 8a5 5 0 1 1-1.6-3.67",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("path",{d:"M13.25 2.25v3h-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function PauseIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[r("rect",{x:"4",y:"3",width:"2.75",height:"10",rx:"1"}),r("rect",{x:"9.25",y:"3",width:"2.75",height:"10",rx:"1"})]})}export function PlayIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r("path",{d:"M5.5 3.6a1 1 0 0 1 1.53-.85l6.1 3.9a1.2 1.2 0 0 1 0 2.02l-6.1 3.9a1 1 0 0 1-1.53-.85V3.6Z"})})}export function EllipsisIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"3.5",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"8",cy:"8",r:"1.15",fill:"currentColor"}),r("circle",{cx:"12.5",cy:"8",r:"1.15",fill:"currentColor"})]})}const o="M8 1.4 9.71 5.65 14.28 5.96 10.76 8.9 11.88 13.34 8 10.9 4.12 13.34 5.24 8.9 1.72 5.96 6.29 5.65Z";export function StarIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,fill:"currentColor",stroke:"currentColor",strokeLinejoin:"round"})})}export function StarOutlineIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("path",{d:o,stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}export function SpinnerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"neba-ring-spin",children:[r("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"2"}),r("path",{d:"M14.5 8A6.5 6.5 0 0 0 8 1.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}export function DotIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"3.25",fill:"currentColor"})})}export function CircleIcon(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2 2.5",strokeLinecap:"round"})})}export function NoteIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"M8 7.25v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"4.9",r:"0.85",fill:"currentColor"})]})}export function SuccessIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.25 8.25 1.9 1.9 3.6-3.9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}export function WarningIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("path",{d:"M7.13 2.6 1.9 11.7a1 1 0 0 0 .87 1.5h10.46a1 1 0 0 0 .87-1.5L8.87 2.6a1 1 0 0 0-1.74 0Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),r("path",{d:"M8 6.1v3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),r("circle",{cx:"8",cy:"11.2",r:"0.85",fill:"currentColor"})]})}export function DangerIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[r("circle",{cx:"8",cy:"8",r:"6.25",stroke:"currentColor",strokeWidth:"1.5"}),r("path",{d:"m5.9 5.9 4.2 4.2m0-4.2-4.2 4.2",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}export function severityIcon(e){switch(e){case"success":return r(SuccessIcon,{});case"warning":return r(WarningIcon,{});case"danger":return r(DangerIcon,{});default:return r(NoteIcon,{})}}
|
package/dist/internal/link.d.ts
CHANGED
|
@@ -15,4 +15,31 @@
|
|
|
15
15
|
* ` java\tscript:` is caught along with `JavaScript:`.
|
|
16
16
|
*/
|
|
17
17
|
export declare function safeHref(href: string | undefined): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Whether a `target` opens a browsing context other than this tab.
|
|
20
|
+
*
|
|
21
|
+
* `_self` is this tab, and `_parent` and `_top` are frames of the same
|
|
22
|
+
* document; none of the three opens anything that could reach back, and none
|
|
23
|
+
* changes the window under the reader. An empty `target` is `_self`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function opensElsewhere(target: string | undefined): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The `rel` a link gets when it opens somewhere other than this tab.
|
|
28
|
+
*
|
|
29
|
+
* A `target` other than the current tab hands the new page a `window.opener`
|
|
30
|
+
* pointing back at this one, and a `Referer` header naming it. Modern browsers
|
|
31
|
+
* imply `noopener` for `target="_blank"`; none of them implies `noreferrer`,
|
|
32
|
+
* and neither is implied for a named target. So the two tokens are added
|
|
33
|
+
* wherever a component lets a caller choose where a link opens — TextLink, a
|
|
34
|
+
* Menu row, a NavigationMenu link, a ChatBubble's link, an AppLogo, a
|
|
35
|
+
* BottomNavigation destination, a Breadcrumb item, a Sources row and an
|
|
36
|
+
* InlineCitation — and they are added the same way in all of them, because a
|
|
37
|
+
* library where only some are safe is a library whose users cannot tell which.
|
|
38
|
+
*
|
|
39
|
+
* It is a *merge* and not an override, and that is the whole reason this is a
|
|
40
|
+
* function rather than a string. The common reason to write a `rel` by hand is
|
|
41
|
+
* `nofollow` or `sponsored`, which is an SEO decision and has nothing to do
|
|
42
|
+
* with the two tokens above — spelled as a plain default it would silently take
|
|
43
|
+
* the protection off the link that still opens in a new tab.
|
|
44
|
+
*/
|
|
18
45
|
export declare function safeRel(target: string | undefined, rel: string | undefined): string | undefined;
|
package/dist/internal/link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=new Set(["http","https","mailto","tel"]);export function safeHref(t){if(void 0===t)return;let
|
|
1
|
+
const e=new Set(["http","https","mailto","tel"]);export function safeHref(t){if(void 0===t)return;let n=0;for(;n<t.length&&t.charCodeAt(n)<=32;)n+=1;const o=t.slice(n).replace(/[\t\n\r]/g,""),r=/^([a-z][a-z\d+.-]*):/i.exec(o);return null===r||e.has(r[1].toLowerCase())?t:void 0}export function opensElsewhere(e){return Boolean(e)&&"_self"!==e&&"_parent"!==e&&"_top"!==e}export function safeRel(e,t){return opensElsewhere(e)?[...new Set([...(t??"").split(/\s+/).filter(Boolean),"noopener","noreferrer"])].join(" "):t}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The words a link that opens somewhere other than this tab ends with, drawn
|
|
4
|
+
* for nobody and read to everybody.
|
|
5
|
+
*
|
|
6
|
+
* A window changing under the reader is the one thing about a link that is
|
|
7
|
+
* invisible until it has already happened, and TextLink was the only link in
|
|
8
|
+
* the library that said so. Every other component that lets a `target` reach an
|
|
9
|
+
* `<a>` puts this last inside it. The space is a real text node, so the name
|
|
10
|
+
* comes out as the label and then the sentence rather than as one word — and
|
|
11
|
+
* it is inside the hidden span, as TextLink's is, because outside it the space
|
|
12
|
+
* is laid out at the end of any link that is not a flex container.
|
|
13
|
+
*
|
|
14
|
+
* The language is the component's own `locale` where it has one, and the
|
|
15
|
+
* provider's where it has not — a Menu row or a NavigationMenu link takes no
|
|
16
|
+
* `locale` of its own.
|
|
17
|
+
*/
|
|
18
|
+
export declare function NewTabNote({ target, locale }: {
|
|
19
|
+
target: string | undefined;
|
|
20
|
+
locale?: string;
|
|
21
|
+
}): React.JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsxs as t}from"react/jsx-runtime";import*as r from"react";import{DefaultsContext as e}from"./defaults.js";import{linkMessages as o,useMessages as s}from"./i18n.js";import{opensElsewhere as m}from"./link.js";import{srOnlyClasses as a}from"./styles.js";export function NewTabNote({target:n,locale:i}){const l=r.useContext(e),c=s(o,i??l?.locale);return m(n)?t("span",{className:a,children:[" ",c.newTab]}):null}
|
package/dist/internal/notch.d.ts
CHANGED
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import type { NebaDensity, NebaSize, NebaVariant } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The room a field's end adornments take from a resting `float` label, for
|
|
5
|
+
* `restEnd`: each one's width in `em` of the control's text, and the shell's
|
|
6
|
+
* gap in front of it.
|
|
7
|
+
*
|
|
8
|
+
* In `em` because that is what the adornments are sized in — an icon is
|
|
9
|
+
* `1.2em`, a stepper `1.7em` — and the notch that reads the length is set in
|
|
10
|
+
* the control's text, so the two agree at every size without a table per
|
|
11
|
+
* component. Nothing at the end is no length at all.
|
|
12
|
+
*/
|
|
13
|
+
export declare function restEndOf(size: NebaSize, widths: readonly number[]): string | undefined;
|
|
3
14
|
interface NotchGeometry {
|
|
4
15
|
size: NebaSize;
|
|
5
16
|
density: NebaDensity;
|
|
6
17
|
variant: NebaVariant;
|
|
18
|
+
/**
|
|
19
|
+
* What is drawn at the end of the shell, from `restEndOf`. A resting label
|
|
20
|
+
* stops short of it rather than running under a chevron or the steppers.
|
|
21
|
+
*/
|
|
22
|
+
restEnd?: string;
|
|
7
23
|
/**
|
|
8
24
|
* How far the first line of text sits below the shell's inner edge, for a
|
|
9
25
|
* shell whose text starts at the top rather than in the middle — a textarea.
|
|
@@ -16,6 +32,12 @@ export interface NotchFrameProps extends NotchGeometry {
|
|
|
16
32
|
labelClassName?: string;
|
|
17
33
|
/** For a frame the notch sits in, which then answers the hover and focus. */
|
|
18
34
|
className?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The label can rest inside the field, where it is set larger than on the
|
|
37
|
+
* edge. The frame then lays it out at that size too, so a field as wide as
|
|
38
|
+
* its label does not cut the label short the moment it comes down.
|
|
39
|
+
*/
|
|
40
|
+
rests?: boolean;
|
|
19
41
|
children: React.ReactNode;
|
|
20
42
|
}
|
|
21
43
|
/**
|
|
@@ -36,7 +58,7 @@ export interface NotchFrameProps extends NotchGeometry {
|
|
|
36
58
|
*
|
|
37
59
|
* It also carries the geometry every piece inside it reads, once.
|
|
38
60
|
*/
|
|
39
|
-
export declare function NotchFrame({ label, labelClassName, className, children, ...geometry }: NotchFrameProps): React.JSX.Element;
|
|
61
|
+
export declare function NotchFrame({ label, labelClassName, className, rests, children, ...geometry }: NotchFrameProps): React.JSX.Element;
|
|
40
62
|
export interface FieldNotchProps {
|
|
41
63
|
label: React.ReactNode;
|
|
42
64
|
variant: NebaVariant;
|
package/dist/internal/notch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Field as n}from"@base-ui/react/field";import{cx as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Field as n}from"@base-ui/react/field";import{cx as r,metaTextValues as s,paddingXValues as t,readOnlyFilterClasses as l}from"./styles.js";const i={xs:"0.1875rem",sm:"0.1875rem",md:"0.25rem",lg:"0.25rem",xl:"0.3125rem"},m={xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1rem",xl:"1.125rem"},d={xs:{size:"0.6875rem",leading:"0.875rem"},sm:{size:"0.75rem",leading:"1rem"},md:{size:"0.8125rem",leading:"1.25rem"},lg:{size:"0.9375rem",leading:"1.375rem"},xl:{size:"1.0625rem",leading:"1.625rem"}},o={xs:"0.25rem",sm:"0.375rem",md:"0.375rem",lg:"0.5rem",xl:"0.625rem"};export function restEndOf(e,a){if(0===a.length)return;return`calc(${a.reduce((e,a)=>e+a,0)}em + ${a.length} * ${o[e]})`}function c({size:e,density:a,variant:n,firstLine:r,restEnd:l}){const o="outline"===n?"1px":"0px",c=`var(--neba-radius-${e})`,b=i[e],h=d[e];return{"--n-notch-r":c,"--n-notch-gap":b,"--n-float-size":s[e],"--n-float-leading":m[e],"--n-rest-size":h.size,"--n-rest-leading":h.leading,"--n-rest-top":void 0===r?`calc(50% - ${h.leading} / 2)`:`calc(${o} + ${r})`,"--n-rest-x":`calc(${o} + ${t[a][e]} - ${c} - ${b})`,...void 0===l?void 0:{"--n-rest-end":l}}}export function NotchFrame({label:n,labelClassName:s,className:t,rests:l=!1,children:i,...m}){const d=a=>e("span","string"==typeof n?{"aria-hidden":"true","data-sample":n,className:r("neba-notch-sizer font-medium",a,s)}:{"aria-hidden":"true",className:r("neba-notch-sizer font-medium",a,s),children:n});return a("span",{className:r("neba-notch-frame",t),style:c(m),children:[i,d(""),l?d("neba-notch-sizer-rest"):null]})}export function FieldNotch({label:s,variant:t,disabled:i,readOnly:m,rests:d,empty:o,beside:c=!1,labelClassName:b,labelId:h,htmlFor:p}){return a("span",{className:r("neba-notch",d&&"neba-notch-float",c&&m&&!i&&l),"data-variant":t,"data-state":i?"disabled":m?"read-only":void 0,"data-empty":o||void 0,style:c||"outline"!==t?void 0:{"--n-notch-inset":"-1px"},children:[e("span",{className:"neba-notch-start"}),e("span",{className:"neba-notch-gap"}),e("span",{className:"neba-notch-end"}),e(n.Label,{...void 0===h?void 0:{id:h},...void 0===p?void 0:{htmlFor:p},className:r("neba-notch-label font-medium",i?"text-(--neba-disabled-fg)":"text-[var(--n-label-ink,var(--neba-fg))]",b),children:s})]})}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* The two browser observers the library uses, as one each rather than one per
|
|
3
3
|
* component.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `IntersectionObserver`. Neither is free — each is a separate registration the
|
|
5
|
+
* Every component that measures itself was building a `ResizeObserver` of its
|
|
6
|
+
* own, and every `Animate*` wrapper that waits for its element to scroll into
|
|
7
|
+
* view was building an `IntersectionObserver`. Neither is free — each is a separate registration the
|
|
9
8
|
* browser has to walk on every layout, and each delivers its own callback task
|
|
10
9
|
* — and a dashboard of eight charts inside a PageLayout with a Panes and a
|
|
11
10
|
* ScrollZone in it is a page with a dozen of them for no reason at all.
|
|
@@ -46,7 +46,8 @@ export interface PickerShellProps extends NebaStyleProps, Omit<React.ComponentPr
|
|
|
46
46
|
label?: React.ReactNode;
|
|
47
47
|
/**
|
|
48
48
|
* Where the label is drawn: above the trigger, in a notch cut into its top
|
|
49
|
-
* edge, or inside it
|
|
49
|
+
* edge, or inside it while nothing is chosen, the trigger does not hold the
|
|
50
|
+
* focus and the popup is closed. The
|
|
50
51
|
* glyph a picker draws at its start keeps a `float` label in the notch; pass
|
|
51
52
|
* `startIcon={false}` to give it somewhere to rest.
|
|
52
53
|
* @default 'top'
|
|
@@ -88,11 +89,21 @@ interface InternalShellProps extends PickerShellProps {
|
|
|
88
89
|
* defaults it does not use over a label it does.
|
|
89
90
|
*/
|
|
90
91
|
clearLabel: string;
|
|
91
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* What the control submits, one row per value. The first row is the field a
|
|
94
|
+
* `Form` registers — see the note at the end of the shell — and the rest are
|
|
95
|
+
* `<input type="hidden">`, so `FormData.getAll(name)` has every one.
|
|
96
|
+
*/
|
|
92
97
|
hiddenValues?: Array<{
|
|
93
98
|
name: string;
|
|
94
99
|
value: string;
|
|
95
100
|
}>;
|
|
101
|
+
/**
|
|
102
|
+
* The name carries a list — a range's two ends, a multiple TreeSelect's
|
|
103
|
+
* choices — so a `Form` hands `onSubmit` every value under it, as an array,
|
|
104
|
+
* rather than the one a registered field holds.
|
|
105
|
+
*/
|
|
106
|
+
repeats?: boolean;
|
|
96
107
|
/** How far off the trigger the popup sits. */
|
|
97
108
|
sideOffset?: number;
|
|
98
109
|
/**
|
|
@@ -101,6 +112,13 @@ interface InternalShellProps extends PickerShellProps {
|
|
|
101
112
|
* on. Only TreeSelect offers it to a caller so far.
|
|
102
113
|
*/
|
|
103
114
|
popupClassName?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Whether opening moves the focus to the first thing in the popup that takes
|
|
117
|
+
* it. Off for the date pickers, whose calendar focuses its own day; on for a
|
|
118
|
+
* popup that does nothing of the kind, or the focus would stay on the trigger
|
|
119
|
+
* and a reader who opened it from the keyboard would be typing at nothing.
|
|
120
|
+
*/
|
|
121
|
+
initialFocus?: boolean;
|
|
104
122
|
children: React.ReactNode;
|
|
105
123
|
triggerRef?: React.Ref<HTMLButtonElement>;
|
|
106
124
|
}
|
|
@@ -112,7 +130,7 @@ interface InternalShellProps extends PickerShellProps {
|
|
|
112
130
|
* and the way `invalid` re-points the whole colour family at `danger` so the
|
|
113
131
|
* edge, the ring and the message turn over together.
|
|
114
132
|
*/
|
|
115
|
-
export declare function PickerShell({ variant, size, color, density, elevation, label, labelPlacement, description, error, invalid, startIcon, fullWidth, disabled: disabledProp, readOnly, required, id, className, style, display, samples, empty, clearable, onClear, open, onOpenChange, clearLabel, hiddenValues, sideOffset, popupClassName, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
|
|
133
|
+
export declare function PickerShell({ variant, size, color, density, elevation, label, labelPlacement, description, error, invalid, startIcon, fullWidth, disabled: disabledProp, readOnly, required, id, className, style, display, samples, empty, clearable, onClear, open, onOpenChange, clearLabel, hiddenValues, repeats, sideOffset, popupClassName, initialFocus, children, triggerRef, ...props }: InternalShellProps): React.JSX.Element;
|
|
116
134
|
/**
|
|
117
135
|
* The row of shortcuts under a picker's panel.
|
|
118
136
|
*
|
package/dist/internal/picker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Field as n}from"@base-ui/react/field";import{Popover as t}from"@base-ui/react/popover";import{CloseIcon as i}from"./icons.js";import{WidthSizer as r}from"./sizer.js";import{chipRemoveClasses as o,controlTextLeadingClasses as s,cx as d,disabledClasses as c,fieldFocusTransitionClasses as p,fieldHeightClasses as u,fieldReadOnlyClasses as m,fieldRestClasses as f,fieldRingClasses as b,fieldSheetClasses as h,fieldSheetDisabledClasses as v,fieldSheetReadOnlyClasses as x,gapClasses as g,hasContent as y,iconClasses as N,metaTextClasses as $,paddingXClasses as P,popupFadeClasses as j,radiusClasses as w,readOnlyFilterClasses as C,stackGapClasses as k,surfaceClasses as z,surfaceSlots as O,transitionClasses as F}from"./styles.js";import{fieldSpotlightSlot as I,glowClasses as q,trackPointer as R}from"./glow.js";import{useFieldsetDisabled as S}from"./fieldset.js";import{FieldNotch as D,NotchFrame as E}from"./notch.js";export function popupSlots(e,a){return{...O(e,a),"--n-fill":`var(--neba-${e}-fill)`,"--n-fill-hover":`var(--neba-${e}-fill-hover)`,"--n-fill-active":`var(--neba-${e}-fill-active)`,"--n-on-solid":`var(--neba-${e}-on-solid)`}}const L=["group relative flex w-full items-center select-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",F,p,N].join(" ");export const pickerPopupClasses=[z,"border bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",j].join(" ");export const popupPaddingClasses={xs:"p-1.5",sm:"p-2",md:"p-2.5",lg:"p-3",xl:"p-3.5"};export function PickerShell({variant:p="outline",size:N="md",color:j="primary",density:z="default",elevation:F=0,label:B,labelPlacement:M="top",description:T,error:V,invalid:W,startIcon:A,fullWidth:G=!1,disabled:H,readOnly:J=!1,required:K=!1,id:Q,className:U,style:X,display:Y,samples:Z,empty:_,clearable:ee=!1,onClear:ae,open:le,onOpenChange:ne,clearLabel:te,hiddenValues:ie,repeats:re=!1,sideOffset:oe=6,popupClassName:se,initialFocus:de=!1,children:ce,triggerRef:pe,...ue}){const me=S(H),fe=l.useId(),be=Q??`${fe}-trigger`,he=`${fe}-label`,ve=`${fe}-description`,xe=`${fe}-error`,ge=null!=V&&!1!==V&&""!==V,ye=W??ge,Ne=ye?"danger":j,$e=me||J,Pe=d(T?ve:null,ge?xe:null)||void 0,[je,...we]=ie??[],Ce="top"!==M&&y(B),ke=Ce&&"float"===M&&!y(A),ze=a("span",{onPointerMove:R(void 0,!$e),className:d(L,u[N],s[N],w[N],g[N],P[z][N],Ce?"":b,me?(Ce?v:c)[p]:J?Ce?`${x[p]} ${C}`:m[p]:`${(Ce?h:f)[p]} ${q}`),children:[a(t.Trigger,{id:be,ref:pe,disabled:me,"aria-labelledby":B?`${he} ${be}`:void 0,"aria-describedby":Pe,"aria-required":K||void 0,"aria-invalid":ye||void 0,"data-placeholder":_||void 0,className:d("flex min-w-0 flex-1 items-center bg-transparent text-start [font:inherit] text-inherit",g[N],"[outline:none]",$e?"cursor-default":"cursor-pointer",ke?"neba-float-control":""),children:[A?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg) transition-[color] duration-(--neba-duration) group-focus-within:text-(--n-accent)",children:A}):null,a("span",{className:"flex min-w-0 flex-1 flex-col",children:[e("span",{"data-placeholder":_||void 0,className:d("w-full truncate",_?"text-(--neba-muted-fg)":"text-(--neba-fg)"),children:Y}),e(r,{samples:ke?[...Z??[],B]:Z??[]})]})]}),!ee||_||$e?null:e("button",{type:"button","aria-label":te,className:d(o,"text-(--neba-muted-fg)"),onClick:e=>{e.stopPropagation(),ae()},children:e(i,{})}),Ce?e(D,{label:B,variant:p,disabled:me,readOnly:J,rests:ke,labelId:he,htmlFor:be}):null]});return a(n.Root,{disabled:me,invalid:ye,className:d("relative flex-col align-top",k[N],G?"flex w-full":"inline-flex",U),style:{...O(Ne,F),...$e?void 0:I,...X},...ue,children:[B&&!Ce?e(n.Label,{id:he,htmlFor:be,className:d($[N],"font-medium",me?"text-(--neba-disabled-fg)":"text-(--neba-fg)"),children:B}):null,a(t.Root,{open:le,onOpenChange:e=>ne(e),children:[Ce?e(E,{label:B,size:N,density:z,variant:p,children:ze}):ze,e(t.Portal,{children:e(t.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",sideOffset:oe,align:"start",children:e(t.Popup,{initialFocus:de,className:d(pickerPopupClasses,w[N],popupPaddingClasses[N],s[N],se),style:popupSlots(Ne,3),children:ce})})})]}),T?e(n.Description,{id:ve,className:d($[N],"text-(--neba-muted-fg)"),children:T}):null,e(n.Error,ge?{id:xe,match:!0,className:d($[N],"text-(--n-accent)"),children:V}:{className:d($[N],"text-(--n-accent)")}),je||K&&!$e?e(n.Control,{"aria-hidden":"true",tabIndex:-1,name:je?.name,value:je?je.value:_?"":"chosen",required:K&&!$e,readOnly:J,"data-neba-repeats":re&&je?"":void 0,onFocus:()=>document.getElementById(be)?.focus(),className:"pointer-events-none absolute start-0 bottom-0 size-px overflow-hidden opacity-0 [clip-path:inset(50%)]"}):null,we.map((a,l)=>e("input",{type:"hidden",name:a.name,value:a.value,disabled:me},l))]})}export function PickerFooter({size:a,children:l}){return e("div",{className:d("flex items-center justify-end border-t pt-1.5","[border-color:var(--n-line)]",g[a]),children:l})}export function PickerDivider(){return e("div",{"aria-hidden":"true",className:"w-px self-stretch bg-(--n-line)"})}
|
package/dist/internal/run.d.ts
CHANGED
|
@@ -62,10 +62,12 @@ export declare function formatDuration(ms: number, locale?: string): string;
|
|
|
62
62
|
* does not have, and a tool that answers in 300ms would have spent its whole
|
|
63
63
|
* life saying zero.
|
|
64
64
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
65
|
+
* Once the run ends the figure is **measured once more** and kept, which is
|
|
66
|
+
* what turns a live count into a total. Measured rather than left at the last
|
|
67
|
+
* tick: a run of 4.9 seconds would otherwise say 4, and one under a second
|
|
68
|
+
* would say nothing at all, where a `duration` of the same length says "4.9s"
|
|
69
|
+
* or "900ms".
|
|
70
|
+
* It is cleared when a new run starts, so a retried call counts its own attempt
|
|
71
|
+
* rather than carrying the first one's number forward.
|
|
70
72
|
*/
|
|
71
73
|
export declare function useElapsed(running: boolean, duration: number | undefined): number | null;
|
package/dist/internal/run.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import*as t from"react";import{CircleIcon as e,DangerIcon as n,SpinnerIcon as u,SuccessIcon as s}from"./icons.js";import{numberFormatter as
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import*as t from"react";import{CircleIcon as e,DangerIcon as n,SpinnerIcon as u,SuccessIcon as s}from"./icons.js";import{numberFormatter as o}from"./format.js";export function runIcon(t){switch(t){case"running":return r(u,{});case"success":return r(s,{});case"error":return r(n,{});default:return r(e,{})}}export function runColor(r,t){switch(r){case"success":return"success";case"error":return"danger";case"pending":return"secondary";default:return t}}export function formatDuration(r,t){if(!Number.isFinite(r)||r<0)return"";if(r<1e3)return o(t,{style:"unit",unit:"millisecond",unitDisplay:"narrow",maximumFractionDigits:0}).format(Math.round(r));const e=r/1e3;return o(t,{style:"unit",unit:"second",unitDisplay:"narrow",maximumFractionDigits:e<10?1:0}).format(e)}const i="undefined"==typeof document?t.useEffect:t.useLayoutEffect;export function useElapsed(r,e){const n=r&&void 0===e,[u,s]=t.useState(null),[o,c]=t.useState(n);o!==n&&(c(n),n&&s(null));const a=t.useRef(null);return i(()=>{if(!n)return;const r=Date.now(),t=setInterval(()=>s(Date.now()-r),1e3);return()=>{clearInterval(t),a.current=Date.now()-r}},[n]),i(()=>{n||null===a.current||(s(a.current),a.current=null)},[n]),e??u}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What "this matches what I typed" means, once.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* CommandPalette and
|
|
6
|
-
* disagreed: a DataTable found `José` for `jose` and the
|
|
4
|
+
* Four components let a reader type at a list of their own — DataTable,
|
|
5
|
+
* CommandPalette, Transfer and TreeSelect — and each had a `matches` of its
|
|
6
|
+
* own. They disagreed: a DataTable found `José` for `jose` and the others did not,
|
|
7
7
|
* which is not a preference anybody chose. A reader who learns what the search
|
|
8
8
|
* box in one part of a product does has learned the wrong thing about the rest
|
|
9
9
|
* of it.
|
|
@@ -357,6 +357,13 @@ export declare const popupFadeClasses: string;
|
|
|
357
357
|
* stylesheet that has never heard of this library.
|
|
358
358
|
*/
|
|
359
359
|
export declare const focusRingClasses = "[outline:0_solid_transparent] outline-offset-2 focus-visible:[outline:2px_solid_var(--n-ring)]";
|
|
360
|
+
/**
|
|
361
|
+
* The same ring drawn inside the edge, for a control inside a box that clips:
|
|
362
|
+
* an Accordion's header in a sheet, a Pill's button in its lozenge, a
|
|
363
|
+
* HowToSteps row in a rail that scrolls. Two pixels outside would be cut off
|
|
364
|
+
* by the very box the control is in.
|
|
365
|
+
*/
|
|
366
|
+
export declare const insetRingClasses = "[outline:0_solid_transparent] outline-offset-[-2px] focus-visible:[outline:2px_solid_var(--n-ring)]";
|
|
360
367
|
/**
|
|
361
368
|
* The same ring, drawn by whichever descendant actually takes focus.
|
|
362
369
|
*
|
|
@@ -431,6 +438,21 @@ export declare const iconClasses = "[&_svg]:pointer-events-none [&_svg]:size-[1.
|
|
|
431
438
|
export declare const collapsiblePanelClasses = "h-(--collapsible-panel-height) overflow-hidden [transition:height_var(--neba-duration)_var(--neba-ease)] motion-reduce:[transition-duration:0ms] data-[starting-style]:h-0 data-[ending-style]:h-0";
|
|
432
439
|
/** And an **Accordion** section, which measures itself under its own name. */
|
|
433
440
|
export declare const accordionPanelClasses = "h-(--accordion-panel-height) overflow-hidden [transition:height_var(--neba-duration)_var(--neba-ease)] motion-reduce:[transition-duration:0ms] data-[starting-style]:h-0 data-[ending-style]:h-0";
|
|
441
|
+
/**
|
|
442
|
+
* The trigger of one of those panels, named so the chevron inside it can read
|
|
443
|
+
* its state. Base UI writes `data-panel-open` on the trigger and on nothing
|
|
444
|
+
* under it, so a `data-[panel-open]:` variant on the chevron itself never
|
|
445
|
+
* matched, and the chevron of every one of the five never turned.
|
|
446
|
+
*/
|
|
447
|
+
export declare const disclosureTriggerClasses = "group/disclosure";
|
|
448
|
+
/**
|
|
449
|
+
* The chevron at the end of that trigger, turned when the panel is open.
|
|
450
|
+
*
|
|
451
|
+
* Turned, not moved: a chevron is a glyph, so rotating it is the one allowance
|
|
452
|
+
* the no-transform rule makes. Its ink is the caller's, since a trigger whose
|
|
453
|
+
* text is already muted draws it in that.
|
|
454
|
+
*/
|
|
455
|
+
export declare const disclosureChevronClasses: string;
|
|
434
456
|
/**
|
|
435
457
|
* A block of text that arrived already formatted.
|
|
436
458
|
*
|
|
@@ -566,7 +588,9 @@ export declare const fieldSheetClasses: Record<NebaVariant, string>;
|
|
|
566
588
|
* `fieldReadOnlyClasses` without the edge, and without the desaturation: that
|
|
567
589
|
* goes on whichever element holds the notch, with `readOnlyFilterClasses`, so
|
|
568
590
|
* the edge drains with the sheet. It is the shell on every field but a Select,
|
|
569
|
-
* whose notch sits beside its trigger rather than in it
|
|
591
|
+
* whose notch sits beside its trigger rather than in it — so the trigger and
|
|
592
|
+
* the notch take it each, and never the frame around both, which a filter would
|
|
593
|
+
* make the root of the trigger's backdrop blur.
|
|
570
594
|
*/
|
|
571
595
|
export declare const fieldSheetReadOnlyClasses: Record<NebaVariant, string>;
|
|
572
596
|
/** `disabledClasses` without the edge. Only `outline` draws one to take off. */
|
|
@@ -600,6 +624,14 @@ export declare const citationMarkClasses = "inline-flex shrink-0 items-center ju
|
|
|
600
624
|
* way of the word beside it until the pointer is on it.
|
|
601
625
|
*/
|
|
602
626
|
export declare const chipRemoveClasses: string;
|
|
627
|
+
/**
|
|
628
|
+
* The × in the corner of a sheet: a Dialog's, a Popover's, a Drawer's and a
|
|
629
|
+
* Tour step's. Four components drew it from four copies of this string.
|
|
630
|
+
*
|
|
631
|
+
* It is 1.6em across, which at the sheets' own body size is about 20 pixels, so
|
|
632
|
+
* it carries the invisible target the other small controls do.
|
|
633
|
+
*/
|
|
634
|
+
export declare const sheetCloseClasses: string;
|
|
603
635
|
/** `false`, `null`, `undefined` and `''` all mean "this slot is not filled". */
|
|
604
636
|
export declare function hasContent(node: React.ReactNode): boolean;
|
|
605
637
|
/**
|