neba 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -30
- package/dist/a2ui/catalog.json +1466 -0
- package/dist/a2ui/components.d.ts +21 -0
- package/dist/a2ui/components.js +1 -0
- package/dist/a2ui/index.d.ts +62 -0
- package/dist/a2ui/index.js +1 -0
- package/dist/a2ui/schema.d.ts +47 -0
- package/dist/a2ui/schema.js +1 -0
- package/dist/components/accordion/Accordion.d.ts +5 -1
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/agent-steps/AgentSteps.d.ts +80 -0
- package/dist/components/agent-steps/AgentSteps.js +1 -0
- package/dist/components/agent-steps/index.d.ts +2 -0
- package/dist/components/agent-steps/index.js +1 -0
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/anchor/Anchor.d.ts +3 -2
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-appear/AnimateAppear.js +1 -1
- package/dist/components/animate-blink/AnimateBlink.d.ts +3 -0
- package/dist/components/animate-blink/AnimateBlink.js +1 -1
- package/dist/components/animate-counter/AnimateCounter.d.ts +3 -1
- package/dist/components/animate-counter/AnimateCounter.js +1 -1
- package/dist/components/animate-fade/AnimateFade.js +1 -1
- package/dist/components/animate-float/AnimateFloat.js +1 -1
- package/dist/components/animate-grow/AnimateGrow.js +1 -1
- package/dist/components/animate-headline/AnimateHeadline.d.ts +9 -2
- package/dist/components/animate-headline/AnimateHeadline.js +1 -1
- package/dist/components/animate-lighting/AnimateLighting.d.ts +1 -1
- package/dist/components/animate-lighting/AnimateLighting.js +1 -1
- package/dist/components/animate-marquee/AnimateMarquee.d.ts +15 -6
- package/dist/components/animate-marquee/AnimateMarquee.js +1 -1
- package/dist/components/animate-reveal/AnimateReveal.js +1 -1
- package/dist/components/animate-rotate/AnimateRotate.js +1 -1
- package/dist/components/animate-scramble/AnimateScramble.d.ts +5 -3
- package/dist/components/animate-scramble/AnimateScramble.js +1 -1
- package/dist/components/animate-shake/AnimateShake.js +1 -1
- package/dist/components/animate-slide/AnimateSlide.js +1 -1
- package/dist/components/animate-split/AnimateSplit.d.ts +3 -1
- package/dist/components/animate-split/AnimateSplit.js +1 -1
- package/dist/components/animate-typing/AnimateTyping.d.ts +12 -4
- package/dist/components/animate-typing/AnimateTyping.js +1 -1
- package/dist/components/animate-zoom/AnimateZoom.js +1 -1
- package/dist/components/app-logo/AppLogo.js +1 -1
- package/dist/components/approval/Approval.d.ts +115 -0
- package/dist/components/approval/Approval.js +1 -0
- package/dist/components/approval/index.d.ts +2 -0
- package/dist/components/approval/index.js +1 -0
- package/dist/components/area-chart/AreaChart.js +1 -1
- package/dist/components/aspect-ratio/AspectRatio.d.ts +6 -4
- package/dist/components/aspect-ratio/AspectRatio.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/blockquote/Blockquote.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.d.ts +2 -1
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/box/Box.d.ts +5 -0
- package/dist/components/box/Box.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.d.ts +10 -0
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/button/Button.d.ts +11 -0
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button-group/ButtonGroup.js +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/card/Card.js +1 -1
- package/dist/components/carousel/Carousel.d.ts +4 -0
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/chip/Chip.d.ts +3 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/code-block/CodeBlock.d.ts +6 -3
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/collapsible/Collapsible.d.ts +11 -1
- package/dist/components/collapsible/Collapsible.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +11 -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/container/Container.js +1 -1
- package/dist/components/context-window/ContextWindow.d.ts +103 -0
- package/dist/components/context-window/ContextWindow.js +1 -0
- package/dist/components/context-window/index.d.ts +2 -0
- package/dist/components/context-window/index.js +1 -0
- package/dist/components/data-list/DataList.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +12 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +12 -0
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/drawer/Drawer.d.ts +7 -0
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/fieldset/Fieldset.js +1 -1
- package/dist/components/file-picker/FilePicker.d.ts +12 -4
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/flex/Flex.d.ts +8 -2
- package/dist/components/flex/Flex.js +1 -1
- package/dist/components/floating-action-button/FloatingActionButton.d.ts +16 -1
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
- package/dist/components/footer/Footer.d.ts +8 -0
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/form/Form.d.ts +4 -2
- package/dist/components/form/Form.js +1 -1
- package/dist/components/gallery/Gallery.d.ts +56 -3
- package/dist/components/gallery/Gallery.js +1 -1
- package/dist/components/gallery/GalleryViewer.js +1 -1
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/grid/Grid.js +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/highlight/Highlight.js +1 -1
- package/dist/components/how-to-steps/HowToSteps.d.ts +26 -1
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/icon/Icon.js +1 -1
- package/dist/components/icon-button/IconButton.d.ts +0 -20
- package/dist/components/icon-button/IconButton.js +1 -1
- package/dist/components/image/Image.d.ts +137 -11
- package/dist/components/image/Image.js +1 -1
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/inline-citation/InlineCitation.d.ts +53 -0
- package/dist/components/inline-citation/InlineCitation.js +1 -0
- package/dist/components/inline-citation/index.d.ts +2 -0
- package/dist/components/inline-citation/index.js +1 -0
- package/dist/components/list/List.js +1 -1
- package/dist/components/menu/Menu.d.ts +7 -4
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/menubar/Menubar.js +1 -1
- package/dist/components/meter/Meter.d.ts +6 -0
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.d.ts +10 -1
- package/dist/components/navigation-menu/NavigationMenu.js +1 -1
- package/dist/components/number-field/NumberField.d.ts +20 -6
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.d.ts +7 -0
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.d.ts +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/page-layout/PageLayout.d.ts +11 -0
- package/dist/components/page-layout/PageLayout.js +1 -1
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/panes/Panes.d.ts +11 -0
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.d.ts +5 -3
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/pill/Pill.d.ts +8 -0
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/popconfirm/Popconfirm.d.ts +10 -3
- package/dist/components/popconfirm/Popconfirm.js +1 -1
- package/dist/components/popover/Popover.d.ts +8 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/portal/Portal.js +1 -1
- package/dist/components/progress-box/ProgressBox.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/prompt-input/PromptInput.d.ts +104 -0
- package/dist/components/prompt-input/PromptInput.js +1 -0
- package/dist/components/prompt-input/index.d.ts +2 -0
- package/dist/components/prompt-input/index.js +1 -0
- package/dist/components/provider/NebaProvider.d.ts +3 -3
- package/dist/components/provider/NebaProvider.js +1 -1
- package/dist/components/radio-group/RadioGroup.js +1 -1
- package/dist/components/rating/Rating.d.ts +4 -1
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/reasoning/Reasoning.d.ts +78 -0
- package/dist/components/reasoning/Reasoning.js +1 -0
- package/dist/components/reasoning/index.d.ts +2 -0
- package/dist/components/reasoning/index.js +1 -0
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scroll-area/ScrollArea.js +1 -1
- package/dist/components/scroll-zone/ScrollZone.d.ts +10 -0
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/segmented-button/SegmentedButton.js +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/shortcut/Shortcut.js +1 -1
- package/dist/components/show/Show.d.ts +6 -5
- package/dist/components/show/Show.js +1 -1
- package/dist/components/sidebar/Sidebar.d.ts +7 -5
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/sidebar/SidebarTrigger.js +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/slider/Slider.d.ts +13 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/sources/Sources.d.ts +78 -0
- package/dist/components/sources/Sources.js +1 -0
- package/dist/components/sources/index.d.ts +2 -0
- package/dist/components/sources/index.js +1 -0
- package/dist/components/sparkline/Sparkline.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/stack/Stack.d.ts +2 -2
- package/dist/components/stack/Stack.js +1 -1
- package/dist/components/statistic/Statistic.js +1 -1
- package/dist/components/streaming-text/StreamingText.d.ts +75 -0
- package/dist/components/streaming-text/StreamingText.js +1 -0
- package/dist/components/streaming-text/index.d.ts +2 -0
- package/dist/components/streaming-text/index.js +1 -0
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/table/Table.d.ts +8 -2
- package/dist/components/table/Table.js +1 -1
- 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/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline/Timeline.d.ts +8 -0
- package/dist/components/timeline/Timeline.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.d.ts +9 -3
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +1 -1
- package/dist/components/tool-call/ToolCall.d.ts +104 -0
- package/dist/components/tool-call/ToolCall.js +1 -0
- package/dist/components/tool-call/index.d.ts +2 -0
- package/dist/components/tool-call/index.js +1 -0
- package/dist/components/toolbar/Toolbar.d.ts +8 -0
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tour/Tour.d.ts +2 -0
- 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.d.ts +6 -0
- 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 +9 -7
- package/dist/components/visually-hidden/VisuallyHidden.js +1 -1
- package/dist/components/window-pane/WindowPane.d.ts +2 -2
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/hooks/useElementSize.d.ts +3 -1
- package/dist/hooks/useElementSize.js +1 -1
- package/dist/hooks/useOnScreen.d.ts +3 -0
- package/dist/hooks/useOnScreen.js +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +63 -16
- package/dist/internal/animate.js +1 -1
- package/dist/internal/calendar.d.ts +6 -1
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +64 -22
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +55 -4
- package/dist/internal/chart.js +1 -1
- package/dist/internal/children.d.ts +15 -0
- package/dist/internal/children.js +1 -0
- package/dist/internal/color.d.ts +4 -0
- package/dist/internal/color.js +1 -1
- package/dist/internal/csv.d.ts +12 -1
- package/dist/internal/csv.js +1 -1
- package/dist/internal/data-table.d.ts +28 -10
- package/dist/internal/data-table.js +1 -1
- package/dist/internal/date.d.ts +12 -5
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +6 -1
- package/dist/internal/defaults.js +1 -1
- package/dist/internal/drag.d.ts +13 -1
- package/dist/internal/drag.js +1 -1
- package/dist/internal/drop.d.ts +61 -0
- package/dist/internal/drop.js +1 -0
- package/dist/internal/fieldset.d.ts +13 -0
- package/dist/internal/fieldset.js +1 -0
- package/dist/internal/glow.d.ts +58 -0
- package/dist/internal/glow.js +1 -0
- package/dist/internal/highlight.js +1 -1
- package/dist/internal/i18n.d.ts +230 -11
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/icons.d.ts +13 -2
- package/dist/internal/icons.js +1 -1
- package/dist/internal/inert.d.ts +13 -0
- package/dist/internal/inert.js +1 -0
- package/dist/internal/initials.d.ts +8 -3
- package/dist/internal/initials.js +1 -1
- package/dist/internal/keys.d.ts +13 -0
- package/dist/internal/keys.js +1 -1
- package/dist/internal/link.d.ts +13 -15
- package/dist/internal/link.js +1 -1
- package/dist/internal/media.d.ts +9 -17
- package/dist/internal/media.js +1 -1
- package/dist/internal/menu.d.ts +6 -1
- package/dist/internal/mockup.d.ts +5 -4
- package/dist/internal/mockup.js +1 -1
- package/dist/internal/observe.d.ts +12 -0
- package/dist/internal/observe.js +1 -1
- package/dist/internal/page-layout.d.ts +10 -8
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +1 -1
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +11 -5
- package/dist/internal/progress.js +1 -1
- package/dist/internal/responsive.d.ts +0 -8
- package/dist/internal/responsive.js +1 -1
- package/dist/internal/run.d.ts +71 -0
- package/dist/internal/run.js +1 -0
- package/dist/internal/screen.d.ts +12 -0
- package/dist/internal/screen.js +1 -0
- package/dist/internal/styles.d.ts +185 -14
- package/dist/internal/styles.js +1 -1
- package/dist/internal/text.d.ts +3 -3
- package/dist/internal/text.js +1 -1
- package/dist/internal/window.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 +501 -53
- package/dist/types.d.ts +34 -7
- package/dist/types.js +0 -8
- package/package.json +43 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateRotate=/*@__PURE__*/e.forwardRef(function({duration:e=460,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:d,trigger:m="mount",play:c,once:g=!0,threshold:p=.2,stagger:f=0,durationStep:u=0,reverse:y=!1,timeline:h,range:N,mode:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateRotate=/*@__PURE__*/e.forwardRef(function AnimateRotate({duration:e=460,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:d,trigger:m="mount",play:c,once:g=!0,threshold:p=.2,stagger:f=0,durationStep:u=0,reverse:y=!1,timeline:h,range:N,mode:R="in",from:j=-180,to:v=0,origin:A="center",fade:S=!0,render:$,className:b,style:w,children:x,...O},T){const k=a({caller:O,effect:"rotate",duration:e,delay:i,easing:o,repeat:s,alternate:l,mode:R,angle:`${j}deg`,angleTo:`${v}deg`,opacity:S?0:1,trigger:m,play:c,once:g,threshold:p,paused:d,infinite:t(s),timeline:h,range:N,children:x,stagger:f,durationStep:u,reverse:y});return r({render:$,ref:[T,k.ref],props:{...O,className:n(k.className,b),style:{transformOrigin:A,...k.style,...w},...k.props,children:k.children}})});
|
|
@@ -33,9 +33,11 @@ export interface AnimateScrambleProps extends Omit<NebaAnimateProps, 'easing' |
|
|
|
33
33
|
* Text arriving through noise, one character at a time.
|
|
34
34
|
*
|
|
35
35
|
* `AnimateTyping`'s sibling: a typewriter reveals a string from an empty line,
|
|
36
|
-
* this one resolves it out of a line that was already the right length.
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* this one resolves it out of a line that was already the right length. The box
|
|
37
|
+
* is laid out from the final text, so nothing around it reflows and a heading
|
|
38
|
+
* does not push the page down as it lands. In a proportional font the noise can
|
|
39
|
+
* be wider than the text for a moment, and spills past the box without moving
|
|
40
|
+
* anything.
|
|
39
41
|
*
|
|
40
42
|
* Whitespace is never scrambled. A space that flickers into a letter and back
|
|
41
43
|
* reads as the words having moved, which is the one thing this effect is for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{useRender as
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as r}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 m,srOnlyClasses as u}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:I,once:R=!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:I,once:R,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);a.useEffect(()=>{U.current=0},[J]),a.useEffect(()=>{if(!C.started)return void(U.current=0);if(N)return;if(D||0===J)return void L(J);let e,t=Math.min(U.current,J);if(t>=J)return void L(J);const r=()=>{t+=1,U.current=t,L(t),t<J?e=setTimeout(r,Q):clearInterval(a)};L(t);const a=setInterval(P,j);return e=setTimeout(r,0===t?b+Q:Q),()=>{clearTimeout(e),clearInterval(a)}},[C.started,N,D,J,Q,j,b]);const V=v.length>0?v:p,W=H.map((e,t)=>D||t<K||""===e.trim()?e:V[function(e,t,r){let a=Math.imul(e+1,2246822507)^Math.imul(t+1,3266489909);return a^=a>>>15,a=Math.imul(a,625341585),a^=a>>>13,(a>>>0)%r}(O,t,V.length)]).join("");return n({render:A,ref:[h,C.ref],props:{...B,className:m("inline-grid",E),style:F,"data-neba-animation":"scramble","data-state":C.state,...C.handlers,children:r(t,{children:[e("span",{className:u,children:G}),e("span",{"aria-hidden":"true",className:"whitespace-pre-wrap [grid-area:1/1]",children:W}),e("span",{"aria-hidden":"true","data-sample":G,className:"invisible whitespace-pre-wrap [grid-area:1/1] before:content-[attr(data-sample)]"})]})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as a,lengthValue as t,useAnimateElement as n}from"../../internal/animate.js";import{cx as s}from"../../internal/styles.js";export const AnimateShake=/*@__PURE__*/e.forwardRef(function({duration:e=420,delay:i=0,easing:l="ease-in-out",repeat:o=1,alternate:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as a,lengthValue as t,useAnimateElement as n}from"../../internal/animate.js";import{cx as s}from"../../internal/styles.js";export const AnimateShake=/*@__PURE__*/e.forwardRef(function AnimateShake({duration:e=420,delay:i=0,easing:l="ease-in-out",repeat:o=1,alternate:c,paused:d,trigger:m="manual",play:p,once:f=!0,threshold:u=.2,stagger:g=0,durationStep:h=0,reverse:y=!1,timeline:k,range:S,distance:N=6,render:b,className:j,style:v,children:x,...A},w){const C=n({caller:A,effect:null,effectClass:"neba-anim-shake",name:"shake",duration:e,delay:i,easing:l,repeat:o,alternate:c,x:t(N),trigger:m,play:p,once:f,threshold:u,paused:d,infinite:a(o),timeline:k,range:S,children:x,stagger:g,durationStep:h,reverse:y});return r({render:b,ref:[w,C.ref],props:{...A,className:s(C.className,j),style:{...C.style,...v},...C.props,children:C.children}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,slideOffsets as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const AnimateSlide=/*@__PURE__*/e.forwardRef(function({duration:e=380,delay:s=0,easing:o,repeat:l=1,alternate:d,paused:m,trigger:c="mount",play:p,once:f=!0,threshold:g=.2,stagger:u=0,durationStep:y=0,reverse:h=!1,timeline:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,slideOffsets as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const AnimateSlide=/*@__PURE__*/e.forwardRef(function AnimateSlide({duration:e=380,delay:s=0,easing:o,repeat:l=1,alternate:d,paused:m,trigger:c="mount",play:p,once:f=!0,threshold:g=.2,stagger:u=0,durationStep:y=0,reverse:h=!1,timeline:S,range:x,mode:N="in",from:b="bottom",distance:j="100%",fade:v=!0,render:A,className:w,style:R,children:k,...q},z){const{x:B,y:C}=a(b,j),D=n({caller:q,effect:"slide",duration:e,delay:s,easing:o,repeat:l,alternate:d,mode:N,x:B,y:C,opacity:v?0:1,trigger:c,play:p,once:f,threshold:g,paused:m,infinite:t(l),timeline:S,range:x,children:k,stagger:u,durationStep:y,reverse:h});return r({render:A,ref:[z,D.ref],props:{...q,className:i(D.className,w),style:{...D.style,...R},...D.props,children:D.children}})});
|
|
@@ -56,6 +56,8 @@ export interface AnimateSplitProps extends NebaAnimateProps, NebaStaggerProps, N
|
|
|
56
56
|
*
|
|
57
57
|
* Every piece is an `inline-block`, which is what lets it be moved at all — an
|
|
58
58
|
* inline box cannot be translated up. Each keeps the space that followed it, so
|
|
59
|
-
* a line still breaks between words and never inside the gap.
|
|
59
|
+
* a line still breaks between words and never inside the gap. Split by
|
|
60
|
+
* character, the pieces of a word are held in a span that does not wrap, and
|
|
61
|
+
* the space after it is left as text, which is where the line breaks.
|
|
60
62
|
*/
|
|
61
63
|
export declare const AnimateSplit: React.ForwardRefExoticComponent<AnimateSplitProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,
|
|
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 c}from"../../internal/animate.js";import{graphemesOf as p,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=c({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=p(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,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,6 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
3
|
import type { NebaAnimateProps } from '../../types.js';
|
|
3
|
-
export interface AnimateTypingProps extends Omit<NebaAnimateProps, 'alternate' | 'easing'>, Omit<React.ComponentPropsWithoutRef<'
|
|
4
|
+
export interface AnimateTypingProps extends Omit<NebaAnimateProps, 'alternate' | 'easing'>, Omit<React.ComponentPropsWithoutRef<'span'>, 'children'> {
|
|
5
|
+
/**
|
|
6
|
+
* Renders something other than a `<span>`, such as `render={<h1 />}` for a
|
|
7
|
+
* headline being typed. A `<span>` by default, with a block display, so the
|
|
8
|
+
* component can sit inside a paragraph. Base UI's own escape hatch.
|
|
9
|
+
*/
|
|
10
|
+
render?: useRender.RenderProp;
|
|
4
11
|
/**
|
|
5
12
|
* The text, when it is easier to pass than to nest. Overrides `children`.
|
|
6
13
|
*/
|
|
@@ -44,8 +51,9 @@ export interface AnimateTypingProps extends Omit<NebaAnimateProps, 'alternate' |
|
|
|
44
51
|
* for a screen reader, which reads it once and is not made to sit through the
|
|
45
52
|
* performance — and what animates is a visible copy that is `aria-hidden`. So
|
|
46
53
|
* the effect costs a reader who cannot see it nothing, and costs a reader who
|
|
47
|
-
* can nothing either: the box is
|
|
48
|
-
* arrived, so the text around it does not reflow
|
|
54
|
+
* can nothing either: the box is laid out from the whole string rather than
|
|
55
|
+
* from the characters that have arrived, so the text around it does not reflow
|
|
56
|
+
* on every frame.
|
|
49
57
|
*
|
|
50
58
|
* `repeat`, `hold` and `erase` are what make it a loop: type, hold, delete,
|
|
51
59
|
* type again. Without `erase` a repeat clears in one frame, which is right for
|
|
@@ -55,4 +63,4 @@ export interface AnimateTypingProps extends Omit<NebaAnimateProps, 'alternate' |
|
|
|
55
63
|
* contributes its text and nothing about its markup, because there is no honest
|
|
56
64
|
* way to reveal half of a link.
|
|
57
65
|
*/
|
|
58
|
-
export declare const AnimateTyping: React.ForwardRefExoticComponent<AnimateTypingProps & React.RefAttributes<
|
|
66
|
+
export declare const AnimateTyping: React.ForwardRefExoticComponent<AnimateTypingProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{isInfinite 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{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__*/r.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:A=.2,render:C,className:E,style:R,children:S,...k},F){const q=i({caller:k,trigger:N,play:w,once:M,threshold:A,paused:v,infinite:s(b)}),z=o(),B=p??d(S),D=r.useMemo(()=>l(B),[B]),G=D.length,[H,I]=r.useState(0),J=r.useRef({count:0,pass:1,deleting:!1}),K=T&&G>0?T/G:1e3/Math.max(m,1),L=1e3/Math.max(h??2*m,1);r.useEffect(()=>{J.current={count:0,pass:1,deleting:!1}},[B]),r.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(v||q.offscreen)return;let e,t=!1;const a=J.current,r="infinite"===b?1/0:Math.max(1,b);if(a.count>=G&&a.pass>=r&&!a.deleting)return;const n=()=>{if(!t){if(a.deleting)return a.count-=1,I(a.count),a.count<=0&&(a.deleting=!1,a.pass+=1),void(e=setTimeout(n,a.deleting?L:K));if(a.count<G&&(a.count+=1,I(a.count)),a.count<G)e=setTimeout(n,K);else if(!(a.pass>=r))return g?(a.deleting=!0,void(e=setTimeout(n,f))):void(e=setTimeout(()=>{t||(a.count=0,a.pass+=1,I(0),e=setTimeout(n,K))},f))}};return I(a.count),e=setTimeout(n,0===a.count&&1===a.pass?j:a.deleting?L:K),()=>{t=!0,clearTimeout(e)}},[q.started,q.offscreen,v,z,B,G,K,L,j,f,g,b]);const O=q.ref,P=r.useCallback(e=>{O(e),"function"==typeof F?F(e):F&&(F.current=e)},[F,O]);return n({render:C??e("span",{}),ref:P,props:{className:c("grid",E),style:R,"data-neba-animation":"typing","data-state":q.state,...k,...q.handlers,children:t(a,{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*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateZoom=/*@__PURE__*/e.forwardRef(function({duration:e=340,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:m,trigger:d="mount",play:c,once:p=!0,threshold:f=.2,stagger:g=0,durationStep:u=0,reverse:y=!1,timeline:h,range:N,mode:j="in",from:v=.4,fade:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateZoom=/*@__PURE__*/e.forwardRef(function AnimateZoom({duration:e=340,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:m,trigger:d="mount",play:c,once:p=!0,threshold:f=.2,stagger:g=0,durationStep:u=0,reverse:y=!1,timeline:h,range:N,mode:j="in",from:v=.4,fade:A=!0,render:S,className:Z,style:b,children:w,...x},z){const O=a({caller:x,effect:"zoom",duration:e,delay:i,easing:o,repeat:s,alternate:l,mode:j,scale:v,opacity:A?0:1,trigger:d,play:c,once:p,threshold:f,paused:m,infinite:t(s),timeline:h,range:N,children:w,stagger:g,durationStep:u,reverse:y});return r({render:S,ref:[z,O.ref],props:{...x,className:n(O.className,Z),style:{transformOrigin:"center",...O.style,...b},...O.props,children:O.children}})});
|
|
@@ -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
|
|
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 o,controlSlots as m,controlSquareClasses as d,cx as c,gapClasses as u,hasContent as x,srOnlyClasses as f,surfaceClasses as g,tintPlateClasses as p,toLength as h,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const w={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.375rem]",xl:"text-[1.625rem]"},j={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.3125rem]",xl:"text-[1.5625rem]"},N={xs:"rounded-[0.375rem]",sm:"rounded-[0.4375rem]",md:"rounded-[0.5625rem]",lg:"rounded-[0.6875rem]",xl:"rounded-[0.875rem]"},_={solid:[g,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[g,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:`text-(--n-on-tint) ${p} [box-shadow:var(--n-elev)]`};export const AppLogo=/*@__PURE__*/t.forwardRef(function AppLogo(t,g){const{src:p,srcSet:y,alt:k,name:z,initials:A,showName:L=!1,shape:S="bare",variant:$="solid",size:F="md",color:P="primary",elevation:R=0,padded:q=!0,height:B,href:C,target:D,rel:E,imageProps:G,render:H,className:I,style:J,children:K,...M}=b(t,["size","variant"]),O="bare"!==S,Q=x(K)?K:p?"image":null,T=O&&q,U=null===Q&&!O,V=L&&!U&&x(z),W=k??z,X=A??(z?l(z):""),Y="image"===Q&&!V&&x(W),Z=U||Y,ee=!Z&&!V&&x(W),re=h(B),ne=re?{height:re,width:O?re:void 0}:null,te=e("span",{"aria-hidden":!Z||void 0,className:c("flex shrink-0 items-center justify-center overflow-hidden","font-semibold tracking-tight whitespace-nowrap",re?"":o[F],O?c(re?"":d[F],"circle"===S?"rounded-full":N[F],j[F],_[$]):c("w-auto text-(--neba-fg)",w[F]),"[&_svg]:w-auto [&_svg]:shrink-0",T?"[&_svg]:h-[72%] [&_svg]:max-w-[72%]":"[&_svg]:h-full [&_svg]:max-w-full",v),style:{...O?m(P,R,$):null,...ne},children:"image"===Q?e("img",{src:p,srcSet:y,alt:Y?W??"":"",decoding:"async",...G,className:c("w-auto object-contain",T?"h-[72%] max-w-[72%]":"h-full max-w-full",G?.className)}):Q??(U?z:X)}),ae=s(C);return a({render:H??e(ae?"a":"span",{}),ref:g,props:{href:ae,target:D,rel:i(D,E),className:c("inline-flex max-w-full min-w-0 items-center align-middle","text-(--neba-fg) no-underline select-none",u[F],ae?"cursor-pointer rounded-(--neba-radius-sm)":"",ae?"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2":"",I),style:{"--n-ring":`var(--neba-${P}-ring)`,...J},children:n(r,{children:[te,V?e("span",{className:c("min-w-0 truncate font-semibold",w[F]),children:z}):null,ee?e("span",{className:f,children:W}):null]}),...M}})});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ApprovalMessages } from '../../internal/i18n.js';
|
|
3
|
+
import type { NebaColor, NebaElevation, NebaSlots, NebaStyleProps, NebaVariant } from '../../types.js';
|
|
4
|
+
/**
|
|
5
|
+
* How much is at stake if the answer is wrong.
|
|
6
|
+
*
|
|
7
|
+
* Three rather than a number, because what a reader does with this is decide
|
|
8
|
+
* how carefully to read the rest of the card, and a 0-to-10 scale is a decision
|
|
9
|
+
* every product would calibrate differently. It is drawn as a word on a chip
|
|
10
|
+
* and never as a colour alone.
|
|
11
|
+
*/
|
|
12
|
+
export type ApprovalRisk = 'low' | 'medium' | 'high';
|
|
13
|
+
/** One answer the agent is offering. */
|
|
14
|
+
export interface ApprovalOption {
|
|
15
|
+
/** What is reported to `onDecide`, and what identifies the answer afterwards. */
|
|
16
|
+
value: string;
|
|
17
|
+
/** The word on the button. */
|
|
18
|
+
label: React.ReactNode;
|
|
19
|
+
/** A line under the row of buttons, saying what this answer commits to. */
|
|
20
|
+
description?: React.ReactNode;
|
|
21
|
+
/** Overrides the card's family for this one button. */
|
|
22
|
+
color?: NebaColor;
|
|
23
|
+
/**
|
|
24
|
+
* Overrides the weight of this one button. Every option is `outline` by
|
|
25
|
+
* default, and that is the decision rather than the absence of one — see the
|
|
26
|
+
* note on the component.
|
|
27
|
+
*/
|
|
28
|
+
variant?: NebaVariant;
|
|
29
|
+
/** A glyph before the label. */
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
/** Offered but not available — a permission the reader cannot grant. */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The parts an Approval draws behind its root.
|
|
36
|
+
*
|
|
37
|
+
* `details` is the block holding what the agent is actually asking to do, and
|
|
38
|
+
* `actions` the row of answers. Both are parts a caller can see and has no
|
|
39
|
+
* other way to name: a details block with its own scroll and an action row that
|
|
40
|
+
* runs full width on a phone are the two things every product changes.
|
|
41
|
+
*/
|
|
42
|
+
export type ApprovalSlot = 'title' | 'description' | 'details' | 'actions';
|
|
43
|
+
export interface ApprovalProps extends Pick<NebaStyleProps, 'size' | 'variant' | 'color' | 'density'>, Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'title'> {
|
|
44
|
+
/** The answers. At least one; three is the usual shape. */
|
|
45
|
+
options: readonly ApprovalOption[];
|
|
46
|
+
/**
|
|
47
|
+
* What is being asked. Defaults to the `locale`'s "Permission needed", for
|
|
48
|
+
* the reason an [Empty](../feedback/empty) has a default title: a request
|
|
49
|
+
* with nothing written on it still has to say what kind of thing it is.
|
|
50
|
+
*/
|
|
51
|
+
title?: React.ReactNode;
|
|
52
|
+
/** The sentence under the heading, saying why. */
|
|
53
|
+
description?: React.ReactNode;
|
|
54
|
+
/**
|
|
55
|
+
* What the agent is asking to do — a command, a payload, a file path. A
|
|
56
|
+
* string is drawn as preformatted text with its own line breaks kept; a node
|
|
57
|
+
* is rendered as it is, which is where an editable form of the arguments
|
|
58
|
+
* goes.
|
|
59
|
+
*/
|
|
60
|
+
details?: React.ReactNode;
|
|
61
|
+
/**
|
|
62
|
+
* How much is at stake. Drawn as a word on a chip beside the heading, and it
|
|
63
|
+
* takes over the card's colour family: `low` is `info`, `medium` is
|
|
64
|
+
* `warning`, `high` is `danger`.
|
|
65
|
+
*/
|
|
66
|
+
risk?: ApprovalRisk;
|
|
67
|
+
/**
|
|
68
|
+
* Which option was taken. `null` — the default — is a request still waiting
|
|
69
|
+
* for an answer.
|
|
70
|
+
*
|
|
71
|
+
* Pass it to drive the Approval yourself. Left out, the card remembers the
|
|
72
|
+
* button that was pressed, which is enough for a transcript that is not
|
|
73
|
+
* re-rendered from a server.
|
|
74
|
+
*/
|
|
75
|
+
decision?: string | null;
|
|
76
|
+
/** Called with an option's `value` when its button is pressed. */
|
|
77
|
+
onDecide?: (value: string) => void;
|
|
78
|
+
/**
|
|
79
|
+
* The glyph at the start. Defaults to the severity mark that goes with the
|
|
80
|
+
* family; pass `false` to drop it, or a node to replace it.
|
|
81
|
+
*/
|
|
82
|
+
icon?: React.ReactNode | false;
|
|
83
|
+
/** Every option stops answering. The card stays exactly as it is otherwise. */
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Drop shadow depth. `0` (the default) is flat.
|
|
87
|
+
* @default 0
|
|
88
|
+
*/
|
|
89
|
+
elevation?: NebaElevation;
|
|
90
|
+
/** Which language the default heading and the risk chip are written in. */
|
|
91
|
+
locale?: string;
|
|
92
|
+
/** Those words, written out. Overrides the `locale`'s. */
|
|
93
|
+
labels?: Partial<ApprovalMessages>;
|
|
94
|
+
/** Class names for the parts behind the root. */
|
|
95
|
+
classNames?: NebaSlots<ApprovalSlot>;
|
|
96
|
+
/** Anything else the body needs, under the details and above the answers. */
|
|
97
|
+
children?: React.ReactNode;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The agent asking permission, and the record of what was decided.
|
|
101
|
+
*
|
|
102
|
+
* A [Confirm](../feedback/confirm) and a [Popconfirm](./../feedback/popconfirm)
|
|
103
|
+
* are opened by the reader, offer two answers, and are gone the moment one is
|
|
104
|
+
* taken. This is opened by the agent, offers as many answers as the agent has
|
|
105
|
+
* — allow once, always allow, deny — and **stays**: a transcript in which the
|
|
106
|
+
* question disappears once it is answered is a transcript that cannot be read
|
|
107
|
+
* back to find out what was agreed to.
|
|
108
|
+
*
|
|
109
|
+
* **No option is emphasised by default.** Every button is `outline` in the
|
|
110
|
+
* card's own family, and an option's own `variant` is how one is singled out.
|
|
111
|
+
* A permission request whose most prominent button is "Allow" is a request
|
|
112
|
+
* answered by the shape of the buttons rather than by the reader, and the whole
|
|
113
|
+
* point of asking is that the answer should be the reader's.
|
|
114
|
+
*/
|
|
115
|
+
export declare const Approval: React.ForwardRefExoticComponent<ApprovalProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +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 i}from"../button/Button.js";import{boxPaddingClasses as t}from"../box/Box.js";import{CheckIcon as s,severityIcon as r}from"../../internal/icons.js";import{approvalMessages as o,useMessages as d}from"../../internal/i18n.js";import{cx as c,hasContent as m,iconClasses as f,metaTextClasses as p,preformattedClasses as u,radiusClasses as x,sheetBodyClasses as h,sheetHeaderGapClasses as v,sheetSectionGapClasses as b,sheetTitleClasses as g,surfaceClasses as N,surfaceSlots as w,transitionClasses as j}from"../../internal/styles.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const k={low:"info",medium:"warning",high:"danger"},z={solid:[N,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[N,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-(--n-soft)"};export const Approval=/*@__PURE__*/a.forwardRef(function Approval(N,A){const{variant:B="outline",size:I="md",color:q="warning",density:C="default",elevation:D=0,options:F,title:R,description:S,details:E,risk:G,decision:H,onDecide:J,icon:K,disabled:L=!1,locale:M,labels:O,classNames:P,className:Q,style:T,children:U,...V}=y(N,["size","density","variant","locale"]),W={...d(o,M),...O},[X,Y]=a.useState(null),Z=void 0!==H,$=Z?H:X,_=G?k[G]:q,ee=void 0===K?r(_):K,le=m(R)?R:W.request,ne=a.useId(),ae=null===$?void 0:F.find(e=>e.value===$);return l("div",{ref:A,role:"group","aria-labelledby":ne,"data-decided":$??void 0,className:c("flex w-full flex-col",t[C][I],x[I],b[I],h[I],z[B],j,f,Q??""),style:{...w(_,D),...T},...V,children:[l("div",{className:"flex items-start gap-3",children:[m(ee)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--n-accent)",children:ee}):null,l("div",{className:c("flex min-w-0 flex-1 flex-col",v[I]),children:[e("div",{id:ne,className:c("font-semibold text-(--n-accent)",g[I],P?.title??""),children:le}),m(S)?e("div",{className:c("text-(--neba-muted-fg)",P?.description??""),children:S}):null]}),G?e("span",{className:c("shrink-0 rounded-full bg-(--n-soft) px-2 py-0.5 font-medium text-(--n-on-tint)",p[I]),children:W[G]}):null]}),m(E)?e("div",{className:c("min-w-0",P?.details??""),children:"string"==typeof E?e("pre",{className:c(u,"max-h-56"),children:E}):E}):null,U,e("div",{className:c("flex min-w-0 flex-col gap-1.5",P?.actions??""),children:ae?l("div",{className:"flex items-center gap-2 text-(--neba-muted-fg)",children:[e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--n-accent)",children:e(s,{})}),e("span",{className:p[I],children:W.answered}),e("span",{className:"min-w-0 font-medium text-(--neba-fg)",children:ae.label})]}):l(n,{children:[e("div",{className:"flex flex-wrap gap-2",children:F.map(l=>e(i,{size:I,variant:l.variant??"outline",color:l.color??_,startIcon:l.icon,disabled:L||l.disabled,onClick:()=>{Z||Y(l.value),J?.(l.value)},children:l.label},l.value))}),F.some(e=>m(e.description))?e("ul",{className:c("m-0 flex list-none flex-col gap-0.5 p-0 text-(--neba-muted-fg)",p[I]),children:F.filter(e=>m(e.description)).map(n=>l("li",{children:[e("span",{className:"font-medium text-(--neba-fg)",children:n.label})," — ",n.description]},n.value))}):null]})})]})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{Approval}from"./Approval.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{CartesianChart as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as r from"react";import{CartesianChart as t}from"../../internal/chart-frame.js";import{LineSeries as a}from"../../internal/chart-line.js";export function AreaChart({curve:n="linear",stacked:s=!1,markers:i="none",valueLabels:o="none",connectNulls:c=!1,series:l,yAxis:m,format:u,...d}){const f=r.useId().replace(/:/g,""),x="full"===s;return e(t,{...d,series:l,stackedFull:x,format:u,yAxis:x?{min:0,max:100,tickFormat:e=>`${e}%`,...m}:m,stacked:!1!==s,inset:!0,includeZero:!0,headroom:"none"===o?0:10,children:r=>e(a,{context:r,curve:n,filled:!0,stacked:!1!==s,markers:i,valueLabels:o,connectNulls:c,gradient:!1,idPrefix:f})})}
|
|
@@ -8,7 +8,7 @@ import type { NebaSize } from '../../types.js';
|
|
|
8
8
|
* same reason `NebaPosition` keeps `static`/`sticky`/`fixed`: inventing
|
|
9
9
|
* `fill-the-box` would only make a reader look up which CSS it maps to.
|
|
10
10
|
*/
|
|
11
|
-
export type NebaAspectFit = 'cover' | 'contain' | 'fill' | 'none';
|
|
11
|
+
export type NebaAspectFit = 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
12
12
|
export interface AspectRatioProps extends React.ComponentPropsWithoutRef<'div'> {
|
|
13
13
|
/**
|
|
14
14
|
* The proportion the box holds, written the way CSS writes it — a number
|
|
@@ -18,9 +18,11 @@ export interface AspectRatioProps extends React.ComponentPropsWithoutRef<'div'>
|
|
|
18
18
|
ratio?: number | string;
|
|
19
19
|
/**
|
|
20
20
|
* How a single piece of media inside is fitted. Applies to an `img`, a
|
|
21
|
-
* `
|
|
22
|
-
*
|
|
23
|
-
*
|
|
21
|
+
* `picture`, a `video` or a `canvas` that is a direct child, which is
|
|
22
|
+
* stretched to the full box and then fitted. An `svg` or an `iframe` is
|
|
23
|
+
* stretched and lays its own content out, an `svg` through its
|
|
24
|
+
* `preserveAspectRatio`. Anything else is laid out normally and this prop does
|
|
25
|
+
* not reach it.
|
|
24
26
|
* @default 'cover'
|
|
25
27
|
*/
|
|
26
28
|
fit?: NebaAspectFit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as
|
|
1
|
+
"use client";import*as e from"react";import{useRender as o}from"@base-ui/react/use-render";import{cx as i,radiusClasses as c}from"../../internal/styles.js";import{useStyleDefaults as t}from"../../internal/defaults.js";const n=["[&>img]:size-full","[&>video]:size-full","[&>canvas]:size-full","[&>svg]:size-full","[&>iframe]:size-full","[&>picture]:size-full","[&>picture>img]:size-full"].join(" "),l={cover:["[&>img]:object-cover","[&>video]:object-cover","[&>canvas]:object-cover","[&>picture>img]:object-cover"].join(" "),contain:["[&>img]:object-contain","[&>video]:object-contain","[&>canvas]:object-contain","[&>picture>img]:object-contain"].join(" "),fill:["[&>img]:object-fill","[&>video]:object-fill","[&>canvas]:object-fill","[&>picture>img]:object-fill"].join(" "),none:["[&>img]:object-none","[&>video]:object-none","[&>canvas]:object-none","[&>picture>img]:object-none"].join(" "),"scale-down":["[&>img]:object-scale-down","[&>video]:object-scale-down","[&>canvas]:object-scale-down","[&>picture>img]:object-scale-down"].join(" ")};export const AspectRatio=/*@__PURE__*/e.forwardRef(function AspectRatio(e,r){const{ratio:s=1,fit:a="cover",rounded:j=!1,size:f="md",render:m,className:d,style:b,children:u,...v}=t(e,["size"]),p=i("relative block w-full overflow-hidden",n,l[a],j?c[f]:"",d??"");return o({render:m,ref:r,props:{className:p,style:{aspectRatio:s,...b},children:u,...v}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Avatar as t}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 f,tintPlateClasses as u,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const h={xs:"text-[0.5625rem]",sm:"text-[0.6875rem]",md:"text-[0.8125rem]",lg:"text-[1rem]",xl:"text-[1.1875rem]"},p={xs:"rounded-[0.375rem]",sm:"rounded-[0.4375rem]",md:"rounded-[0.5625rem]",lg:"rounded-[0.6875rem]",xl:"rounded-[0.875rem]"},b={solid:[f,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev)]"].join(" "),outline:[f,"border text-(--n-on-tint) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev)]"].join(" "),text:`text-(--n-on-tint) ${u} [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:""},w=["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 n("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,f){const{src:u,srcSet:v,alt:g,name:y,initials:N,shape:z,variant:_,size:S,color:k,elevation:A,delay:C,imageProps:I,onLoadingStatusChange:P,transition:$,className:B,style:L,children:M,...R}=x(a,["size","variant"]),Z=z??"circle",F=_??"text",q=S??"md",D=k??"primary",E=A??0,G=y?o(y):"",H=r($),J=g??y,K=c(M)?M:(N??G)||e(PersonIcon,{}),O=Boolean(J),Q=""===J,T=d(w,i[q],l[q],h[q],"circle"===Z?"rounded-full":p[q],b[F],j[F],H.className,B??"");return n(t.Root,{ref:f,className:T,style:{...s(D,E,F),...H.style,...L},...R,children:[u?e(t.Image,{src:u,srcSet:v,alt:J??"",decoding:"async",onLoadingStatusChange:P,...I,className:d("size-full object-cover [animation:neba-anim-fade_var(--neba-duration-fill)_var(--neba-ease)_both]",I?.className)}):null,n(t.Fallback,{delay:u?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,Fragment as t,jsxs as m}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as m}from"react/jsx-runtime";import*as n from"react";import{controlSlots as s,cx as o,hasContent as a,srOnlyClasses as i,surfaceClasses as l,tintPlateClasses as r,transitionClasses as d}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const b={xs:"h-3.5 min-w-3.5",sm:"h-4 min-w-4",md:"h-4.5 min-w-4.5",lg:"h-5 min-w-5",xl:"h-6 min-w-6"},p={xs:"size-1.5",sm:"size-2",md:"size-2.5",lg:"size-2.5",xl:"size-3"},c={xs:"text-[0.5625rem]",sm:"text-[0.625rem]",md:"text-[0.6875rem]",lg:"text-[0.75rem]",xl:"text-[0.8125rem]"},u={default:{xs:"px-1",sm:"px-1",md:"px-1.5",lg:"px-1.5",xl:"px-2"},compact:{xs:"px-0.5",sm:"px-0.5",md:"px-1",lg:"px-1",xl:"px-1.5"}},g={xs:{badge:"-mt-1.5 -mb-1.5 -ms-1.5 -me-1.5",dot:"-mt-0.5 -mb-0.5 -ms-0.5 -me-0.5"},sm:{badge:"-mt-2 -mb-2 -ms-2 -me-2",dot:"-mt-1 -mb-1 -ms-1 -me-1"},md:{badge:"-mt-2 -mb-2 -ms-2 -me-2",dot:"-mt-1 -mb-1 -ms-1 -me-1"},lg:{badge:"-mt-2.5 -mb-2.5 -ms-2.5 -me-2.5",dot:"-mt-1 -mb-1 -ms-1 -me-1"},xl:{badge:"-mt-3 -mb-3 -ms-3 -me-3",dot:"-mt-1.5 -mb-1.5 -ms-1.5 -me-1.5"}},f={"top-start":"top-0 start-0","top-end":"top-0 end-0","bottom-start":"bottom-0 start-0","bottom-end":"bottom-0 end-0"},h={"top-start":"mt-[7%] ms-[7%]","top-end":"mt-[7%] me-[7%]","bottom-start":"mb-[7%] ms-[7%]","bottom-end":"mb-[7%] me-[7%]"},v={solid:[l,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[l,"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) ${r}`};export const Badge=/*@__PURE__*/n.forwardRef(function Badge(n,l){const{variant:r="solid",size:w="md",color:j="primary",density:y="default",elevation:z=0,content:N,max:$=99,dot:k=!1,showZero:B=!1,invisible:q=!1,placement:F="top-end",overlap:R="square",label:Z,className:A,style:C,children:D,...E}=x(n,["size","density","variant"]),G=a(D),H=0===N&&!B,I=!a(N)||H,J=k||I,K=q||H&&!k,L=K||J&&void 0===Z&&!a(N),M=o("pointer-events-none z-10 inline-flex shrink-0 items-center justify-center","font-semibold tabular-nums whitespace-nowrap","rounded-full",d,v[r],J?p[w]:[b[w],c[w],u[y][w]].join(" "),G?`absolute ${f[F]}`:"relative align-middle",G?J?g[w].dot:g[w].badge:"",G&&"circle"===R?h[F]:"",K?"invisible":"",A??""),O=function(e,t){return"number"==typeof e&&e>t?`${t}+`:e}(N,$),P=e("span",{ref:l,className:M,style:{...s(j,z,r),...C},"aria-hidden":!!L||void 0,...E,children:K?null:m(t,{children:[!J&&!Z||L?null:e("span",{className:i,children:Z??O}),J?null:e("span",{"aria-hidden":!!Z||void 0,children:O})]})});return G?m("span",{className:"relative inline-flex shrink-0 align-middle",children:[D,P]}):P});
|
|
@@ -51,7 +51,7 @@ export interface BarChartProps extends CartesianChartProps {
|
|
|
51
51
|
* Lengths, compared.
|
|
52
52
|
*
|
|
53
53
|
* A bar says *how much*, and it says it by being longer — which is the whole
|
|
54
|
-
* reason its axis
|
|
54
|
+
* reason its axis includes zero unless `yAxis` pins an end. Crop the scale
|
|
55
55
|
* and a bar twice as long stops meaning twice as much, and the reader has no
|
|
56
56
|
* way to know it happened. Reach for a [LineChart](./line-chart) when what
|
|
57
57
|
* matters is the shape of a change rather than the size of each value.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import
|
|
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,labelledPoints as u,markGap as d}from"../../internal/chart.js";import{useStyleDefaults as c}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:h,size:m="md",density:x="default",...v}=c(t,["size","density"]),f="full"===i;return e(a,{...v,series:d,stackedFull:f,size:m,density:x,horizontal:"horizontal"===n,stacked:!1!==i,yAxis:f?{min:0,max:100,tickFormat:e=>`${e}%`,...h}:h,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:c,valueLabels:h,size:m}){const{values:x,visible:v,colors:f,hovered:b,activeIndex:p,plot:y,band:z,horizontal:k,valuePx:g,categoryPx:j,zeroPx:M,format:B}=a,S=x.map((e,t)=>({one:e,index:t})).filter(e=>v[e.index]),A=l?1:Math.max(1,S.length),L=Math.min(c,Math.max(1,(z.band-d*(A-1))/A)),N=L*A+d*(A-1),P=[],W=[],w=s[m];return t("g",{children:[S.map(({one:a,index:s},c)=>{const m=f[s],x=null!==b&&b!==s,v="extremes"===h||"last"===h?u(a,h):null;return e("g",{opacity:x?.28:1,className:n,children:a.map((a,s)=>{if(null===a.value)return null;const u=j(s),x=l?0:c*(L+d)-N/2+L/2,f=l?a.value>=0?P[s]??0:W[s]??0:0,b=g(f),z=g(f+a.value);l&&(a.value>=0?P[s]=f+a.value:W[s]=f+a.value);const M=l&&0!==f?d:0,S=Math.abs(z-b)-M;if(S<=0)return null;const A=z<b,F=s===p,C=k?i(Math.min(b,z)+(A?0:M),y.top+u+x-L/2,S,L,r&&!l?o:r?o/2:0,a.value>=0?"right":"left"):i(y.left+u+x-L/2,Math.min(b,z)+(A?0:M),L,S,r&&!l?o:r?o/2:0,a.value>=0?"up":"down");return t("g",{children:[e("path",{d:C,fill:a.color??m,opacity:F?1:.92,className:n}),"none"===h||v&&!v(s)?null:e("text",{x:k?z+(a.value>=0?5:-5):y.left+u+x,y:k?y.top+u+x:a.value>=0?z-5:z+w+2,textAnchor:k?a.value>=0?"start":"end":"middle",dominantBaseline:k?"central":void 0,fontSize:w,fontWeight:500,fill:"var(--neba-fg)",className:"tabular-nums",children:a.label??B(a.value)})]},s)})},s)}),e("line",k?{x1:M,x2:M,y1:y.top,y2:y.top+y.height,stroke:"var(--neba-chart-baseline)",strokeWidth:1}:{x1:y.left,x2:y.left+y.width,y1:M,y2:M,stroke:"var(--neba-chart-baseline)",strokeWidth:1})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{boxPaddingClasses as n}from"../box/Box.js";import{transitionProps as a}from"../../internal/animate.js";import{cx as l,hasContent as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{boxPaddingClasses as n}from"../box/Box.js";import{transitionProps as a}from"../../internal/animate.js";import{cx as l,hasContent as o,metaTextClasses as s,radiusClasses as i,surfaceClasses as c,surfaceSlots as m,transitionClasses as d}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";const u={xs:"text-[0.75rem]/[1.25rem]",sm:"text-[0.8125rem]/[1.375rem]",md:"text-[0.9375rem]/[1.625rem]",lg:"text-[1.0625rem]/[1.875rem]",xl:"text-[1.25rem]/[2.125rem]"},x={solid:[c,"bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[c,"border border-s-2 bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"bg-transparent"};function QuoteMarkIcon(){return e("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e("path",{d:"M6.4 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6ZM13.3 3.6c-2.3.9-3.7 2.8-3.7 5.1 0 2 1.2 3.3 2.8 3.3 1.4 0 2.5-1 2.5-2.4 0-1.3-.9-2.2-2.1-2.2-.2 0-.4 0-.6.1.3-1 1.1-1.8 2.2-2.3l-1.1-1.6Z",fill:"currentColor"})})}export const Blockquote=/*@__PURE__*/t.forwardRef(function Blockquote(t,c){const{variant:p="text",size:b="md",color:h="primary",density:v="default",elevation:g=0,author:j,source:N,cite:y,icon:k,transition:w,className:z,style:B,children:M,...q}=f(t,["size","density","variant"]),I=a(w),Q=o(j)||o(N),Z=void 0===k?e(QuoteMarkIcon,{}):k,C=l("flex flex-col text-(--neba-fg)","border-s-2 [border-inline-start-color:var(--n-accent)]","text"===p?"":`${i[b]} rounded-s-none`,x[p],n[v][b],d,I.className,z??""),R=r("blockquote",{cite:y,className:u[b],children:[o(Z)?e("span",{"aria-hidden":"true",className:"mb-1 block size-[2em] text-(--n-soft-press) [&>svg]:size-full",children:Z}):null,M]}),$={...m(h,g),...I.style,...B};return Q?r("figure",{ref:c,className:C,style:$,...q,children:[R,r("figcaption",{className:["mt-2 flex flex-wrap items-baseline gap-x-1.5 text-(--neba-muted-fg)",s[b]].join(" "),children:[o(j)?r("span",{className:"font-medium text-(--neba-fg)",children:[e("span",{"aria-hidden":"true",children:"— "}),j]}):null,o(N)?e("cite",{className:"not-italic",children:N}):null]})]}):e("div",{ref:c,className:C,style:$,...q,children:R})});
|
|
@@ -31,7 +31,8 @@ export interface BottomNavigationProps extends NebaStyleProps, Omit<React.Compon
|
|
|
31
31
|
/**
|
|
32
32
|
* Keeps the bar clear of the home indicator on a phone, by adding
|
|
33
33
|
* `env(safe-area-inset-bottom)` under it. The sheet still reaches the bottom
|
|
34
|
-
* of the screen; only the items move up.
|
|
34
|
+
* of the screen; only the items move up. A `static` bar is not at the bottom
|
|
35
|
+
* of the screen, so it is left alone.
|
|
35
36
|
* @default true
|
|
36
37
|
*/
|
|
37
38
|
safeArea?: boolean;
|
|
@@ -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 i from"react";import{useRender as n}from"@base-ui/react/use-render";import{barMinHeightClasses as l,BottomNavigationContext as r}from"../../internal/bottom-navigation.js";import{safeHref as o,safeRel as s}from"../../internal/link.js";import{cx as d,hasContent as c,iconSizeClasses as m,metaTextClasses as u,paddingXClasses as p,radiusClasses as f,srOnlyClasses as g,surfaceClasses as b,surfaceSlots as v,transitionClasses as x}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";const y={solid:[b,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[b,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},w={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},N={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__*/i.forwardRef(function BottomNavigation(t,a){const{variant:o="outline",size:s="md",color:c="primary",density:m="default",elevation:u=0,value:p,defaultValue:g=null,onValueChange:b,position:z="fixed",labels:j="all",divider:k=!0,safeArea:C=!0,disabled:B=!1,label:I,render:R,className:V,style:_,children:A,...D}=h(t,["size","density","variant"]),[F,M]=i.useState(g),P=void 0!==p,S=P?p:F,q=i.useCallback(e=>{P||M(e),b?.(e)},[P,b]),E=i.useMemo(()=>({value:S??null,change:q,size:s,density:m,labels:j,disabled:B,floating:!1}),[S,q,s,m,j,B]),G=d("w-full min-w-0","static"===z?f[s]:"",y[o],"outline"===o&&"static"===z?"border [border-color:var(--n-line)]":"",k?"border-t [border-color:var(--n-line)]":"",w[z],C&&"static"!==z?"pb-[env(safe-area-inset-bottom)]":"",x,V);return n({render:R??e("nav",{}),ref:a,props:{"aria-label":I,className:G,style:{...v(c,u),..._},children:e(r.Provider,{value:E,children:e("div",{className:d("flex w-full items-stretch",l[s],N[m][s]),children:A})}),...D}})});export const BottomNavigationItem=/*@__PURE__*/i.forwardRef(function BottomNavigationItem({value:n,icon:l,href:b,target:v,rel:h,disabled:y=!1,className:w,children:N,onClick:j,...k},C){const B=i.useContext(r),I=y||B.disabled,R=null!==B.value&&B.value===n,V="all"===B.labels||"selected"===B.labels&&R,_=d("flex min-w-0 flex-col items-center justify-center py-1.5",B.floating?d("relative z-10",p[B.density][B.size],"rounded-full"):d("flex-1 px-1",f[B.size]),z[B.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",x,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",I?"cursor-not-allowed text-(--neba-disabled-fg)":R?B.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)",w),A=a(t,{children:[c(l)?e("span",{className:d("flex shrink-0 items-center justify-center",m[B.size]),children:l}):null,c(N)?B.floating&&"selected"===B.labels?e("span",{"data-drawn":V?"":void 0,className:d("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]",V?"[grid-template-columns:1fr] opacity-100":"[grid-template-columns:0fr] opacity-0"),children:e("span",{className:d("min-w-0 truncate leading-tight",u[B.size]),children:N})}):e("span",{"data-drawn":V?"":void 0,className:V?d("max-w-full truncate leading-tight",u[B.size]):"selected"===B.labels?d("max-w-full truncate leading-tight opacity-0",u[B.size]):g,children:N}):null]}),D=e=>{I?e.preventDefault():(B.change(n),j?.(e))},F=o(b);return F?e("a",{ref:C,"data-nav-item":"",href:I?void 0:F,"aria-current":R?"page":void 0,"aria-disabled":I||void 0,className:_,onClick:D,target:v,rel:s(v,h),...k,children:A}):e("button",{ref:C,"data-nav-item":"",type:"button",disabled:I,"aria-current":R?"page":void 0,className:_,onClick:D,...k,children:A})});
|
|
@@ -41,6 +41,11 @@ export interface BoxProps extends NebaStyleProps, Omit<React.ComponentPropsWitho
|
|
|
41
41
|
export declare const boxPaddingClasses: Record<NebaDensity, Record<NebaSize, string>>;
|
|
42
42
|
export declare const boxPaddingXClasses: Record<NebaDensity, Record<NebaSize, string>>;
|
|
43
43
|
export declare const boxPaddingYClasses: Record<NebaDensity, Record<NebaSize, string>>;
|
|
44
|
+
/**
|
|
45
|
+
* The same ladder as lengths, for the one thing a class cannot do with it: add
|
|
46
|
+
* a screen inset to it. Keep the two in step.
|
|
47
|
+
*/
|
|
48
|
+
export declare const boxPaddingYValues: Record<NebaDensity, Record<NebaSize, string>>;
|
|
44
49
|
/**
|
|
45
50
|
* A sheet of acrylic with content on it. The plainest surface in the library:
|
|
46
51
|
* it groups things, and that is all it does.
|
|
@@ -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
|
|
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 o,surfaceSlots as l,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].join(" "),d={solid:[o,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[o,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"};export const Box=/*@__PURE__*/e.forwardRef(function Box(e,t){const{variant:o="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:j,...h}=p(e,["size","density","variant"]),P=a(f),C=r(x,m[n],b?boxPaddingClasses[c][n]:"",d[o],P.className,u??"");return s({render:y,ref:t,props:{className:C,style:{...l(i,g),...P.style,...v},children:j,...h}})});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
2
3
|
import type { NebaColor, NebaDensity, NebaSize } from '../../types.js';
|
|
3
4
|
/**
|
|
4
5
|
* What is drawn between two steps of the trail.
|
|
@@ -82,6 +83,15 @@ export interface BreadcrumbItemProps extends Omit<React.ComponentPropsWithoutRef
|
|
|
82
83
|
href?: string;
|
|
83
84
|
/** Fires when the step is pressed. Renders it as a button when there is no `href`. */
|
|
84
85
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
86
|
+
/**
|
|
87
|
+
* Renders the link as something other than an `<a>` — the `Link` a router
|
|
88
|
+
* brings, so a step moves without reloading the page. `href` still goes
|
|
89
|
+
* through. Only a step that is a link uses it: the current step and a
|
|
90
|
+
* disabled one stay text.
|
|
91
|
+
*/
|
|
92
|
+
render?: useRender.RenderProp;
|
|
93
|
+
/** Where the link opens. Anything but this tab also gets `rel="noopener noreferrer"`. */
|
|
94
|
+
target?: string;
|
|
85
95
|
/** Content before the label — a home glyph, a repository avatar. */
|
|
86
96
|
startIcon?: React.ReactNode;
|
|
87
97
|
/** Content after the label. */
|