neba 1.16.1 → 1.17.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 +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 +13 -3
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +9 -2
- 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-picker/DatePicker.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/date-time-picker/DateTimePicker.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.d.ts +9 -4
- 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/provider/NebaProvider.d.ts +2 -2
- package/dist/components/provider/NebaProvider.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 +10 -2
- 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.d.ts +13 -5
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/text-link/TextLink.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.d.ts +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/defaults.d.ts +8 -4
- 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 +19 -0
- package/dist/internal/new-tab.js +1 -0
- package/dist/internal/notch.d.ts +102 -0
- package/dist/internal/notch.js +1 -0
- package/dist/internal/observe.d.ts +3 -4
- package/dist/internal/picker.d.ts +30 -4
- 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 +56 -0
- 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 +287 -3
- package/dist/types.d.ts +18 -0
- package/package.json +23 -17
|
@@ -2,7 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { Switch as BaseUISwitch } from '@base-ui/react/switch';
|
|
3
3
|
import type { NebaColor, NebaFieldSlot, NebaSize, NebaSlots } from '../../types.js';
|
|
4
4
|
/** Which side of the track the label sits on. */
|
|
5
|
-
|
|
5
|
+
/** Which side of the track the label sits on. */
|
|
6
|
+
export type SwitchLabelSide = 'start' | 'end';
|
|
7
|
+
/** @deprecated Use `SwitchLabelSide`. */
|
|
8
|
+
export type SwitchLabelPlacement = SwitchLabelSide;
|
|
6
9
|
type BaseSwitchProps = Omit<React.ComponentPropsWithoutRef<typeof BaseUISwitch.Root>, 'className' | 'style' | 'render' | 'children'>;
|
|
7
10
|
/**
|
|
8
11
|
* The parts a Switch draws behind its root.
|
|
@@ -30,7 +33,15 @@ export interface SwitchProps extends BaseSwitchProps {
|
|
|
30
33
|
* switch lines up on the right.
|
|
31
34
|
* @default 'end'
|
|
32
35
|
*/
|
|
33
|
-
|
|
36
|
+
labelSide?: SwitchLabelSide;
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use `labelSide`. On every field `labelPlacement` says where the
|
|
39
|
+
* label is drawn relative to the field — above it, on its edge, inside it —
|
|
40
|
+
* and a `NebaProvider` fills it in for all of them; here it said which side,
|
|
41
|
+
* so one name meant two things. Read only when `labelSide` is left out, and
|
|
42
|
+
* removed in the next minor release.
|
|
43
|
+
*/
|
|
44
|
+
labelPlacement?: SwitchLabelSide;
|
|
34
45
|
/** Class names for the field wrapper, not for the track. */
|
|
35
46
|
className?: string;
|
|
36
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{Switch as l}from"@base-ui/react/switch";import{Field as t}from"@base-ui/react/field";import{controlTextClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a,Fragment as r}from"react/jsx-runtime";import*as n from"react";import{Switch as l}from"@base-ui/react/switch";import{Field as t}from"@base-ui/react/field";import{controlTextClasses as i,cx as o,hitAreaClasses as s,metaTextClasses as c,surfaceClasses as d,tickRowLeadingClasses as b}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";import{useFieldsetDisabled as m}from"../../internal/fieldset.js";const f={xs:"h-3.5 w-6",sm:"h-4 w-7",md:"h-5 w-9",lg:"h-6 w-11",xl:"h-7 w-13"},u={xs:"data-[checked]:start-[calc(100%-0.75rem)]",sm:"data-[checked]:start-[calc(100%-0.875rem)]",md:"data-[checked]:start-[calc(100%-1.125rem)]",lg:"data-[checked]:start-[calc(100%-1.375rem)]",xl:"data-[checked]:start-[calc(100%-1.625rem)]"},v={xs:"",sm:"",md:"py-[calc((1.25rem-1lh)/2)]",lg:"py-[calc((1.5rem-1lh)/2)]",xl:"py-[calc((1.75rem-1lh)/2)]"},g=["relative inline-flex shrink-0 border",s,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]","rounded-full","[transition-property:background-color,border-color,box-shadow]","[transition-duration:var(--neba-duration-fill),var(--neba-duration),var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),p=[d,"cursor-pointer bg-(--neba-groove) [border-color:var(--n-line)]","hover:bg-(--neba-groove-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)"].join(" "),x=[d,"cursor-default bg-(--neba-groove) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:[border-color:transparent]"].join(" "),w=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)] shadow-none","data-[checked]:bg-(--neba-disabled-bg)"].join(" "),k=["absolute inset-y-0.5 start-0.5 aspect-square rounded-full bg-(--neba-surface)","[box-shadow:var(--neba-shadow-1)]","[transition:inset-inline-start_var(--neba-duration)_var(--neba-ease)]"].join(" ");export const Switch=/*@__PURE__*/n.forwardRef(function Switch(n,s){const{size:d="md",color:N="primary",label:j,description:y,error:$,invalid:S,labelSide:_,labelPlacement:R,disabled:z,readOnly:O=!1,className:q,classNames:D,style:E,...F}=h(n,["size"]),L=m(z),P=_??R??"end",T=null!=$&&!1!==$&&""!==$,A=S??T,B=A?"danger":N,C={"--n-fill":`var(--neba-${B}-fill)`,"--n-fill-hover":`var(--neba-${B}-fill-hover)`,"--n-accent":`var(--neba-${B}-accent)`,"--n-line":`var(--neba-${B}-line)`,"--n-line-hover":`var(--neba-${B}-line-hover)`,"--n-ring":`var(--neba-${B}-ring)`},G=e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(l.Root,{ref:s,className:o("neba-switch",g,f[d],L?w:O?x:p,D?.control),disabled:L,readOnly:O,...F,children:e(l.Thumb,{className:o("neba-switch-thumb",k,u[d],D?.thumb)})})}),H=j||y?a("span",{className:o("flex min-w-0 flex-col gap-0.5","start"===P?"flex-1":""),children:[j?e(t.Label,{className:o("leading-[1.4]",L?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",D?.label),children:j}):null,y?e(t.Description,{className:o(c[d],"text-(--neba-muted-fg)",D?.description),children:y}):null]}):null;return a(t.Root,{disabled:L,invalid:A,className:o("inline-flex flex-col gap-1 align-top",q??""),style:{...C,...E},children:[e("div",{className:o("flex items-start gap-2.5",i[d],b,v[d]),children:a(r,"start"===P?{children:[H,G]}:{children:[G,H]})}),e(t.Error,T?{match:!0,className:o(c[d],"text-(--n-accent)",D?.error),children:$}:{className:o(c[d],"text-(--n-accent)",D?.error)})]})});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Switch } from './Switch.js';
|
|
2
|
-
export type { SwitchLabelPlacement, SwitchProps } from './Switch.js';
|
|
2
|
+
export type { SwitchLabelPlacement, SwitchLabelSide, SwitchProps } from './Switch.js';
|
|
@@ -48,8 +48,10 @@ export interface TableColumn<Row> {
|
|
|
48
48
|
* cell's padding, alignment and background are written as **inline styles**,
|
|
49
49
|
* because `.vp-doc td` and `.prose td` outrank any one-class utility. A class
|
|
50
50
|
* handed to `headCell`, `cell` or `empty` can add anything the component does
|
|
51
|
-
* not already set inline — a
|
|
52
|
-
*
|
|
51
|
+
* not already set inline — a font, a border — but to change one of those three
|
|
52
|
+
* it has to be an important one (`p-4!`). A header cell's ink and the empty
|
|
53
|
+
* line's are inline as well and read `--n-cell-ink`, so a class sets that slot:
|
|
54
|
+
* `[--n-cell-ink:var(--neba-fg)]`.
|
|
53
55
|
*/
|
|
54
56
|
export type TableSlot = 'table' | 'caption' | 'head' | 'headCell' | 'body' | 'row' | 'cell' | 'empty';
|
|
55
57
|
export interface TableProps<Row> extends Omit<BoxProps, 'padded' | 'children' | 'render' | 'title'> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{glowClasses as o,spotlightSlot as n,trackPointer as l}from"../../internal/glow.js";import{Tabs as i}from"@base-ui/react/tabs";import{controlHeightClasses as r,controlHeightValues as s,controlTextClasses as c,cx as d,gapClasses as f,hasContent as u,iconClasses as b,paddingXClasses as v,radiusClasses as h,surfaceClasses as p,surfaceSlots as m,transitionClasses as x}from"../../internal/styles.js";import{observeResize as g}from"../../internal/observe.js";import{bindAxisWheel as w}from"../../internal/wheel.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const z=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",orientation:"horizontal",fullWidth:!1,align:"center"}),j={solid:{horizontal:`${p} inline-flex bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`,vertical:`${p} inline-flex flex-col bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`},outline:{horizontal:"flex border-b [border-color:var(--n-line)]",vertical:"flex flex-col border-e [border-color:var(--n-line)]"},text:{horizontal:"flex",vertical:"flex flex-col"}},N={solid:{horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)"},outline:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"},text:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"}},T={horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-b-2 [border-color:var(--n-accent)] !bg-transparent",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-e-2 [border-color:var(--n-accent)] !bg-transparent"},$={solid:`${p} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,outline:"bg-(--n-accent)",text:"bg-(--n-accent)"},k={start:"justify-start",center:"justify-center",end:"justify-end"},M={solid:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",outline:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",text:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)"};export const Tab=/*@__PURE__*/a.forwardRef(function Tab({value:s,startIcon:p,endIcon:m,disabled:g=!1,className:w,style:y,children:j,...N},T){const{variant:$,size:E,density:P,fullWidth:C,align:R}=a.useContext(z);return t(i.Tab,{ref:T,value:s,disabled:g,style:{...g?void 0:n,...y},className:d("relative z-10 inline-flex shrink-0 cursor-pointer items-center select-none","whitespace-nowrap font-medium",k[R],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",r[E],c[E],f[E],v[P][E],"solid"===$?h[E]:"",x,b,M[$],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)",g?"":o,C?"flex-1":"",w??""),...N,onPointerMove:l(N.onPointerMove,!g),children:[u(p)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:p}):null,j,u(m)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:m}):null]})});export const TabPanel=/*@__PURE__*/a.forwardRef(function TabPanel({value:t,keepMounted:o=!1,className:n,children:l,...r},s){const{size:c}=a.useContext(z);return e(i.Panel,{ref:s,value:t,keepMounted:o,className:["min-w-0 flex-1 text-(--neba-fg)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[starting-style]:opacity-0","[transition:opacity_var(--neba-duration)_var(--neba-ease)]",h[c],n??""].filter(Boolean).join(" "),...r,children:l})});export const Tabs=/*@__PURE__*/a.forwardRef(function Tabs(o,n){const{variant:l="outline",size:r="md",color:c="primary",density:f="default",value:u,defaultValue:b,onValueChange:v,orientation:p="horizontal",activateOnFocus:x=!1,loopFocus:k=!0,overflow:M="scroll",lines:E,wheel:P=!0,fullWidth:C=!1,align:R="center",className:V,style:W,children:_,...F}=y(o,["size","density","variant"]),A="horizontal"===p,L="wrap"===M,H=a.useRef(null),I=a.useRef(null),O=a.useMemo(()=>({variant:l,size:r,density:f,orientation:p,fullWidth:C,align:R}),[l,r,f,p,C,R]),B=[],q=[],D=e=>a.Children.forEach(e,e=>{a.isValidElement(e)&&e.type===a.Fragment?D(e.props.children):a.isValidElement(e)&&e.type===TabPanel?q.push(e):null!=e&&!1!==e&&B.push(e)});D(_);const G=B.length;return a.useEffect(()=>{const e=I.current,t=H.current;if(!e||!t)return;const a=()=>{const a=Math.abs(A?e.scrollLeft:e.scrollTop),o=A?e.clientWidth:e.clientHeight,n=A?e.scrollWidth:e.scrollHeight,l=A?"x":"y",i=A?"y":"x";t.toggleAttribute(`data-overflow-${l}-start`,a>1),t.toggleAttribute(`data-overflow-${l}-end`,n-o-a>1),t.removeAttribute(`data-overflow-${i}-start`),t.removeAttribute(`data-overflow-${i}-end`)};a(),e.addEventListener("scroll",a,{passive:!0});const o=g(e,a);return()=>{e.removeEventListener("scroll",a),o()}},[A,G]),a.useEffect(()=>{const e=I.current;if(e&&P)return w(e)},[P]),e(z.Provider,{value:O,children:t(i.Root,{ref:e=>{H.current=e,"function"==typeof n?n(e):n&&(n.current=e)},value:u,defaultValue:b,onValueChange:e=>v?.(e),orientation:p,className:d("flex min-w-0","vertical"===p?"flex-row gap-4":"flex-col gap-4",V??""),style:{...m(c,0),...W},...F,children:[t(i.List,{ref:I,activateOnFocus:x,loopFocus:k,className:d("relative shrink-0",j[l][p],"solid"===l?h[r]:"",C&&"horizontal"===p?"w-full":"",L?"flex-wrap":A?"overflow-x-auto":"",L&&void 0!==E?A?"overflow-y-auto":"overflow-x-auto":"",!L&&A?"overflow-y-hidden":"","overscroll-contain","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","neba-scroll-fade"),style:{"--n-fade":"2rem",maxHeight:L&&void 0!==E?`calc(${s[r]} * ${Math.max(1,Math.round(E))}${"solid"===l?" + 0.5rem":"outline"===l&&A?" + 1px":""})`:void 0},children:[B,e(i.Indicator,{className:["pointer-events-none",L&&"solid"!==l?T[p]:N[l][p],$[l],"solid"===l?h[r]:"rounded-full","[transition-property:left,top,width,height]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]"].join(" ")})]}),q]})})});
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{glowClasses as o,spotlightSlot as n,trackPointer as l}from"../../internal/glow.js";import{Tabs as i}from"@base-ui/react/tabs";import{controlHeightClasses as r,controlHeightValues as s,controlTextClasses as c,cx as d,gapClasses as f,hasContent as u,iconClasses as b,paddingXClasses as v,radiusClasses as h,surfaceClasses as p,surfaceSlots as m,transitionClasses as x}from"../../internal/styles.js";import{observeResize as g}from"../../internal/observe.js";import{bindAxisWheel as w}from"../../internal/wheel.js";import{useStyleDefaults as y}from"../../internal/defaults.js";const z=/*@__PURE__*/a.createContext({variant:"outline",size:"md",density:"default",orientation:"horizontal",fullWidth:!1,align:"center"}),j={solid:{horizontal:`${p} inline-flex bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`,vertical:`${p} inline-flex flex-col bg-(--n-panel) p-1 [box-shadow:var(--neba-plate-glass)]`},outline:{horizontal:"flex border-b [border-color:var(--n-line)]",vertical:"flex flex-col border-e [border-color:var(--n-line)]"},text:{horizontal:"flex",vertical:"flex flex-col"}},N={solid:{horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width)"},outline:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"},text:{horizontal:"absolute bottom-0 left-(--active-tab-left) h-0.5 w-(--active-tab-width)",vertical:"absolute end-0 top-(--active-tab-top) h-(--active-tab-height) w-0.5"}},T={horizontal:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-b-2 [border-color:var(--n-accent)] !bg-transparent",vertical:"absolute left-(--active-tab-left) top-(--active-tab-top) h-(--active-tab-height) w-(--active-tab-width) border-e-2 [border-color:var(--n-accent)] !bg-transparent"},$={solid:`${p} bg-(--n-panel-press) [box-shadow:var(--neba-shadow-1),var(--neba-plate-glass)]`,outline:"bg-(--n-accent)",text:"bg-(--n-accent)"},k={start:"justify-start",center:"justify-center",end:"justify-end"},M={solid:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",outline:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)",text:"text-(--neba-muted-fg) hover:text-(--neba-fg) data-[active]:text-(--n-accent)"};export const Tab=/*@__PURE__*/a.forwardRef(function Tab({value:s,startIcon:p,endIcon:m,disabled:g=!1,className:w,style:y,children:j,...N},T){const{variant:$,size:E,density:P,fullWidth:C,align:R}=a.useContext(z);return t(i.Tab,{ref:T,value:s,disabled:g,style:{...g?void 0:n,...y},className:d("relative z-10 inline-flex shrink-0 cursor-pointer items-center select-none","whitespace-nowrap font-medium",k[R],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",r[E],c[E],f[E],v[P][E],"solid"===$?h[E]:"",x,b,M[$],"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]","data-[disabled]:cursor-not-allowed data-[disabled]:text-(--neba-disabled-fg)",g?"":o,C?"flex-1":"",w??""),...N,onPointerMove:l(N.onPointerMove,!g),children:[u(p)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:p}):null,j,u(m)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:m}):null]})});export const TabPanel=/*@__PURE__*/a.forwardRef(function TabPanel({value:t,keepMounted:o=!1,className:n,children:l,...r},s){const{size:c}=a.useContext(z);return e(i.Panel,{ref:s,value:t,keepMounted:o,className:["min-w-0 flex-1 text-(--neba-fg)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2","data-[starting-style]:opacity-0","[transition:opacity_var(--neba-duration)_var(--neba-ease)]",h[c],n??""].filter(Boolean).join(" "),...r,children:l})});export const Tabs=/*@__PURE__*/a.forwardRef(function Tabs(o,n){const{variant:l="outline",size:r="md",color:c="primary",density:f="default",value:u,defaultValue:b,onValueChange:v,orientation:p="horizontal",activateOnFocus:x=!1,loopFocus:k=!0,overflow:M="scroll",lines:E,wheel:P=!0,fullWidth:C=!1,align:R="center",className:V,style:W,children:_,...F}=y(o,["size","density","variant"]),A="horizontal"===p,L="wrap"===M,H=a.useRef(null),I=a.useRef(null),O=a.useMemo(()=>({variant:l,size:r,density:f,orientation:p,fullWidth:C,align:R}),[l,r,f,p,C,R]),B=[],q=[],D=e=>a.Children.forEach(e,e=>{a.isValidElement(e)&&e.type===a.Fragment?D(e.props.children):a.isValidElement(e)&&e.type===TabPanel?q.push(e):null!=e&&!1!==e&&B.push(e)});D(_);const G=B.length;return a.useEffect(()=>{const e=I.current,t=H.current;if(!e||!t)return;const a=()=>{const a=Math.abs(A?e.scrollLeft:e.scrollTop),o=A?e.clientWidth:e.clientHeight,n=A?e.scrollWidth:e.scrollHeight,l=A?"x":"y",i=A?"y":"x";t.toggleAttribute(`data-overflow-${l}-start`,a>1),t.toggleAttribute(`data-overflow-${l}-end`,n-o-a>1),t.removeAttribute(`data-overflow-${i}-start`),t.removeAttribute(`data-overflow-${i}-end`)};a(),e.addEventListener("scroll",a,{passive:!0});const o=g(e,a);return()=>{e.removeEventListener("scroll",a),o()}},[A,G]),a.useEffect(()=>{const e=I.current;if(e&&P)return w(e)},[P]),e(z.Provider,{value:O,children:t(i.Root,{ref:e=>{H.current=e,"function"==typeof n?n(e):n&&(n.current=e)},value:u,defaultValue:b,onValueChange:e=>v?.(e),orientation:p,className:d("flex min-w-0","vertical"===p?"flex-row gap-4":"flex-col gap-4",V??""),style:{...m(c,0),...W},...F,children:[t(i.List,{ref:I,activateOnFocus:x,loopFocus:k,className:d("relative shrink-0",j[l][p],"solid"===l?h[r]:"",C&&"horizontal"===p?"w-full":"",L?"flex-wrap":A?"overflow-x-auto":"overflow-y-auto",L&&void 0!==E?A?"overflow-y-auto":"overflow-x-auto":"",!L&&A?"overflow-y-hidden":"","overscroll-contain","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","neba-scroll-fade"),style:{"--n-fade":"2rem",maxHeight:L&&void 0!==E?`calc(${s[r]} * ${Math.max(1,Math.round(E))}${"solid"===l?" + 0.5rem":"outline"===l&&A?" + 1px":""})`:void 0},children:[B,e(i.Indicator,{className:["pointer-events-none",L&&"solid"!==l?T[p]:N[l][p],$[l],"solid"===l?h[r]:"rounded-full","[transition-property:left,top,width,height]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]"].join(" ")})]}),q]})})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { NebaElevation, NebaFieldSlot, NebaShortcuts, NebaSlots, NebaStyleProps } from '../../types.js';
|
|
2
|
+
import type { NebaElevation, NebaFieldSlot, NebaLabelPlacement, NebaShortcuts, NebaSlots, NebaStyleProps } from '../../types.js';
|
|
3
3
|
/** How the multiline control may be resized by the user. Ignored when single line. */
|
|
4
4
|
export type TextFieldResize = 'none' | 'vertical' | 'horizontal' | 'both';
|
|
5
5
|
/**
|
|
@@ -39,12 +39,20 @@ export interface TextFieldProps extends NebaStyleProps, NativeControlProps {
|
|
|
39
39
|
* @default 'vertical'
|
|
40
40
|
*/
|
|
41
41
|
resize?: TextFieldResize;
|
|
42
|
+
/** The field's name, wired to the control by Base UI's Field. */
|
|
43
|
+
label?: React.ReactNode;
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
45
|
+
* Where the label is drawn: above the field, in a notch cut into its top
|
|
46
|
+
* edge, or inside it where the placeholder would be until the field is
|
|
47
|
+
* focused or filled, and in the notch from then on.
|
|
48
|
+
*
|
|
49
|
+
* A floating label travels on `top` and changes size on `font-size` rather
|
|
50
|
+
* than on a `transform`, so no frame of it is a scaled picture of the word.
|
|
51
|
+
* With a `startIcon` it stays in the notch, because the icon is where it
|
|
52
|
+
* would rest.
|
|
53
|
+
* @default 'top'
|
|
46
54
|
*/
|
|
47
|
-
|
|
55
|
+
labelPlacement?: NebaLabelPlacement;
|
|
48
56
|
/** Helper text below the control. */
|
|
49
57
|
description?: React.ReactNode;
|
|
50
58
|
/** Error message below the control. Its presence also turns the field invalid. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as l from"react";import{Field as n}from"@base-ui/react/field";import{Input as r}from"@base-ui/react/input";import{fieldLight as a,fieldSpotlightSlot as s,glowClasses as i}from"../../internal/glow.js";import{SpinnerIcon as o}from"../../internal/icons.js";import{controlTextLeadingClasses as c,cx as m,disabledClasses as d,fieldFocusTransitionClasses as p,fieldHeightClasses as x,fieldReadOnlyClasses as f,fieldRestClasses as u,fieldRingClasses as b,fieldSheetClasses as h,fieldSheetDisabledClasses as g,fieldSheetReadOnlyClasses as y,gapClasses as $,hasContent as v,iconClasses as N,metaTextClasses as w,paddingXClasses as j,radiusClasses as z,readOnlyFilterClasses as k,stackGapClasses as D,surfaceSlots as C,transitionClasses as O}from"../../internal/styles.js";import{keyHandler as P}from"../../internal/keys.js";import{FieldNotch as R,NotchFrame as T,restEndOf as E}from"../../internal/notch.js";import{useStyleDefaults as F}from"../../internal/defaults.js";import{useFieldsetDisabled as I}from"../../internal/fieldset.js";const K={xs:`${$.xs} ${z.xs} ${c.xs}`,sm:`${$.sm} ${z.sm} ${c.sm}`,md:`${$.md} ${z.md} ${c.md}`,lg:`${$.lg} ${z.lg} ${c.lg}`,xl:`${$.xl} ${z.xl} ${c.xl}`},L={xs:"min-h-5.5 py-[3px]",sm:"min-h-6.5 py-[4px]",md:"min-h-8 py-[5px]",lg:"min-h-10 py-[8px]",xl:"min-h-12 py-[10px]"},W={xs:"3px",sm:"4px",md:"5px",lg:"8px",xl:"10px"},q={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},A=["group relative flex w-full","[-webkit-tap-highlight-color:transparent]",O,p,N].join(" "),B=u,G=f;export const TextField=/*@__PURE__*/l.forwardRef(function TextField(c,p){const{variant:f="outline",size:u="md",color:$="primary",density:N="default",elevation:z=0,multiline:O=!1,rows:H=3,resize:J="vertical",label:M,labelPlacement:Q="top",description:S,error:U,invalid:V,startIcon:X,endIcon:Y,loading:Z=!1,fullWidth:_=!1,classNames:ee,shortcuts:te,onKeyDown:le,readOnly:ne=!1,disabled:re,type:ae="text",placeholder:se,className:ie,style:oe,...ce}=F(c,["size","density","variant","labelPlacement"]),me=I(re),de=!me&&!ne,pe=null!=U&&!1!==U&&""!==U,xe=V??pe,fe=xe?"danger":$,ue="top"!==Q&&v(M),be=ue&&"float"===Q&&!v(X),he=l.useRef(null),ge=l.useCallback(e=>{he.current=e,"function"==typeof p?p(e):p&&(p.current=e)},[p]),ye=m(A,K[u],O?`${L[u]} items-start`:`${x[u]} items-center`,j[N][u],ue?"":b,me?(ue?g:d)[f]:ne?ue?`${y[f]} ${k}`:G[f]:`${(ue?h:B)[f]} ${i}`,me?"":"cursor-text",ee?.shell),$e=m("neba-input min-w-0 flex-1 bg-transparent [font:inherit] text-inherit","[outline:none]","placeholder:text-(--neba-muted-fg)","caret-(--n-accent) selection:bg-(--n-soft-press)","disabled:cursor-not-allowed",O?`block ${q[J]}`:"self-stretch",be?"neba-float-control":"",ee?.control),ve="inline-flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg) transition-[color] duration-(--neba-duration) group-focus-within:text-(--n-accent)",Ne=t("span",{className:ye,...a(de),onPointerDown:e=>{e.target!==e.currentTarget||me||(e.preventDefault(),he.current?.focus())},children:[X?e("span",{className:ve,children:X}):null,e(r,{ref:ge,className:$e,disabled:me,readOnly:ne,"aria-busy":Z||void 0,"data-loading":Z||void 0,placeholder:be?se||" ":se,...O?{render:e("textarea",{rows:H})}:{type:ae},...ce,onKeyDown:P(te,le)}),Z?e("span",{className:ve,children:e(o,{})}):Y?e("span",{className:ve,children:Y}):null,ue?e(R,{label:M,variant:f,disabled:me,readOnly:ne,rests:be,labelClassName:ee?.label}):null]});return t(n.Root,{disabled:me,invalid:xe,className:m("flex-col align-top",D[u],_?"flex w-full":"inline-flex",ie??""),style:{...C(fe,z),...de?s:void 0,...oe},children:[M&&!ue?e(n.Label,{className:m(w[u],"font-medium",me?"text-(--neba-disabled-fg)":"text-(--neba-fg)",ee?.label),children:M}):null,ue?e(T,{label:M,size:u,density:N,variant:f,firstLine:O?W[u]:void 0,rests:be,restEnd:E(u,Z||Y?[1.2]:[]),labelClassName:ee?.label,children:Ne}):Ne,S?e(n.Description,{className:m(w[u],"text-(--neba-muted-fg)",ee?.description),children:S}):null,e(n.Error,pe?{match:!0,className:m(w[u],"text-(--n-accent)",ee?.error),children:U}:{className:m(w[u],"text-(--n-accent)",ee?.error)})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{useRender as a}from"@base-ui/react/use-render";import{linkMessages as t,useMessages as o}from"../../internal/i18n.js";import{ExternalLinkIcon as l,LinkIcon as s}from"../../internal/icons.js";import{
|
|
1
|
+
"use client";import{jsx as n,Fragment as e,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{useRender as a}from"@base-ui/react/use-render";import{linkMessages as t,useMessages as o}from"../../internal/i18n.js";import{ExternalLinkIcon as l,LinkIcon as s}from"../../internal/icons.js";import{opensElsewhere as c,safeHref as m,safeRel as u}from"../../internal/link.js";import{controlTextLeadingClasses as d,cx as p,focusRingClasses as b,srOnlyClasses as f}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";const k={always:"[&.neba-link]:underline",hover:"[&.neba-link]:no-underline [&.neba-link]:hover:underline",none:"[&.neba-link]:no-underline"},v=["neba-link","cursor-pointer","[&_svg]:pointer-events-none [&_svg]:inline [&_svg]:size-[0.95em] [&_svg]:shrink-0",["[transition-property:color,text-decoration-color]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]"].join(" "),b,"focus-visible:rounded-[0.25rem]"].join(" ");export const TextLink=/*@__PURE__*/i.forwardRef(function TextLink(i,b){const{href:g,underline:j="always",color:x,size:y,newTab:w=!1,icon:_,locale:N,render:T,className:z,style:C,children:L,...$}=h(i,["locale"]),F=o(t,N),R=_??w,q=!0===R?n(w?l:s,{}):R,A=p(v,y?d[y]:"",k[j],x?"[&.neba-link]:text-(--n-accent)":"[&.neba-link]:text-inherit",z??""),B={"--n-underline":"color-mix(in oklab, currentColor 45%, transparent)","--n-underline-hover":"currentColor","--n-ring":`var(--neba-${x??"primary"}-ring)`,...x?{"--n-accent":`var(--neba-${x}-accent)`}:null},{rel:D,target:E,...G}=$,H=w?"_blank":E,I=u(H,D),J=c(H);return a({render:T??n("a",{}),ref:b,props:{href:m(g),target:H,className:A,style:{...B,...C},children:r(e,{children:[L,q?n("span",{className:"ms-[0.25em]",children:q}):null,J?r(e,{children:[" ",n("span",{className:f,children:F.newTab})]}):null]}),...G,rel:I}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as l from"react";import{Button as t}from"../button/Button.js";import{TimeGrid as o,usePickerLabels as s}from"../../internal/calendar.js";import{ClockIcon as a}from"../../internal/icons.js";import{PickerFooter as i,PickerShell as r}from"../../internal/picker.js";import{displaySamples as c,formatDate as u,clampDate as d,isHour12 as m,isValidDate as p,secondsOfDay as h,startOfDay as f,timeUnitSpan as g,toISOTime as S,withPlaceholder as b,withTime as y}from"../../internal/date.js";import{cx as v}from"../../internal/styles.js";import{useStyleDefaults as j}from"../../internal/defaults.js";export const TimePicker=/*@__PURE__*/l.forwardRef(function TimePicker(x,C){const{value:w,defaultValue:z,onValueChange:k,open:D,defaultOpen:O,onOpenChange:T,referenceDate:M,minTime:P,maxTime:V,shouldDisableTime:B,hour12:H,showSeconds:I=!1,hourStep:N=1,minuteStep:R=1,secondStep:F=1,locale:L,format:q,placeholder:A,clearable:E=!1,showNowButton:G=!0,closeOnSelect:J=!1,labels:K,name:Q,size:U="md",color:W="primary",density:X="default",readOnly:Y=!1,disabled:Z=!1,startIcon:$,..._}=j(x,["size","density","variant","locale","labelPlacement"]),ee=s(K,L),ne=H??m(L),[le,te]=l.useState(z??null),oe=void 0!==w?w:le,[se,ae]=l.useState(O??!1),ie=D??se,[re]=l.useState(()=>M??f(new Date)),ce=e=>{e&&(Y||Z)||(void 0===D&&ae(e),T?.(e))},ue=(e,n)=>p(n)?y(e,{hours:n.getHours(),minutes:n.getMinutes(),seconds:n.getSeconds()}):null,de=e=>{const n=null===e?null:d(e,ue(e,P),ue(e,V));void 0===w&&te(n),k?.(n)},me=l.useCallback((e,n)=>{const[l,t]=g(n,e);return!!(p(P)&&t<h(P))||(!!(p(V)&&l>h(V))||(B?.(e,n)??!1))},[P,V,B]),pe=l.useMemo(()=>q??{hour:"numeric",minute:"2-digit",...I?{second:"2-digit"}:{}},[q,I]),he=new Date,fe=y(M??re,{hours:he.getHours(),minutes:he.getMinutes(),seconds:I?he.getSeconds():0}),ge=G||E||!J,Se=l.useMemo(()=>b(c(L,pe),A),[L,pe,A]);return e(r,{..._,size:U,color:W,density:X,readOnly:Y,disabled:Z,triggerRef:C,startIcon:$??e(a,{}),display:p(oe)?u(oe,L,pe):A??"",samples:Se,empty:!p(oe),clearable:E,onClear:()=>de(null),open:ie,onOpenChange:ce,clearLabel:ee.clear,hiddenValues:Q?[{name:Q,value:p(oe)?S(oe,I):""}]:void 0,children:n("div",{className:v("flex flex-col",ge&&"gap-1.5"),children:[e(o,{size:U,density:X,locale:L,value:p(oe)?oe:null,referenceDate:M??re,onChange:e=>{de(e),J&&ce(!1)},hour12:ne,showSeconds:I,hourStep:N,minuteStep:R,secondStep:F,shouldDisableTime:me,labels:ee,autoFocus:!0}),ge?n(i,{size:U,children:[E?e(t,{variant:"text",size:U,color:W,density:"compact",onClick:()=>{de(null),ce(!1)},children:ee.clear}):null,G?e(t,{variant:"text",size:U,color:W,density:"compact",disabled:me(fe,"second"),onClick:()=>{de(fe),ce(!1)},children:ee.now}):null,J?null:e(t,{variant:"solid",size:U,color:W,density:"compact",onClick:()=>ce(!1),children:ee.done})]}):null]})})});
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type CartesianChartProps } from '../../internal/chart-frame.js';
|
|
3
3
|
import type { NebaChartCategory, NebaTimelineSeries } from '../../types.js';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* `brush` is left out because a timeline cannot honour it: the window is cut
|
|
6
|
+
* by row, and every span on a row outside it would still be drawn past the
|
|
7
|
+
* plot. `secondaryAxis` goes with it — there is one axis of time.
|
|
8
|
+
*/
|
|
9
|
+
export interface TimelineChartProps extends Omit<CartesianChartProps, 'series' | 'categories' | 'legend' | 'brush' | 'secondaryAxis'> {
|
|
5
10
|
/**
|
|
6
11
|
* One row per series, and the spans on it. A row's name is what the axis
|
|
7
12
|
* says down the left-hand side.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{CartesianChart as o,markTransitionClasses as r}from"../../internal/chart-frame.js";import{barBandRatio as a,barMaxThickness as s,barRadius as l,formatTimeTicks as i,formatTimeValue as c,markGap as m,resolveColor as u,seriesColor as d,timeScale as f,toNumber as h}from"../../internal/chart.js";import{chartMessages as x,useMessages as p}from"../../internal/i18n.js";import{srOnlyClasses as M}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";export function TimelineChart(t){const{series:r,min:l,max:u,barSize:M,rounded:j=!0,size:$="md",density:C="default",xAxis:T,yAxis:z,locale:A,references:D,...E}=b(t,["size","density","locale"]),P=n.useMemo(()=>r.map(y),[r]),S=n.useMemo(()=>P.map(e=>e.spans),[P]),B=n.useMemo(()=>{let e=1/0,t=-1/0,n=!1;for(const o of S)for(const r of o)r&&(n=!0,e=Math.min(e,r.from),t=Math.max(t,r.to));for(const o of D??[])if("value"===(o.axis??"value"))for(const r of void 0===o.to?[o.value]:[o.value,o.to])n=!0,e=Math.min(e,r),t=Math.max(t,r);return n?{min:e,max:t}:null},[S,D]),F=n.useMemo(()=>f(B,{min:h(l)??void 0,max:h(u)??void 0,tickCount:z?.tickCount}),[B,l,u,z?.tickCount]),I=n.useMemo(()=>i(F.ticks,F.unit,A),[F,A]),N=n.useMemo(()=>r.map((e,t)=>d(e,t)),[r]),R=n.useMemo(()=>[{data:S.map(e=>e.some(Boolean)?1:null)}],[S]),q=n.useMemo(()=>{const e=g(F.unit);return("day"===e||"week"===e)&&S.some(e=>e.some(e=>null!==e&&(v(e.from)||v(e.to))))},[S,F.unit]),Y=n.useMemo(()=>{let e=0,t=1/0,n=-1/0;for(const o of S)for(const r of o)r&&(e+=1,t=Math.min(t,r.from),n=Math.max(n,r.to));return 0===e?{count:e,min:"",max:""}:{count:e,min:c(t,g(F.unit),A,q),max:c(n,g(F.unit),A,q)}},[S,F.unit,A,q]),G=n.useMemo(()=>r.map((e,t)=>e.name??`${t+1}`),[r]),H=M??s[$],J=p(x,A),K=n.useCallback(e=>{const t=[];return P.forEach((n,o)=>{const r=Math.min(H,Math.max(1,(e.band.band-m*(n.lanes-1))/n.lanes)),a=r*n.lanes+m*(n.lanes-1),s=e.plot.top+e.categoryPx(o)-a/2+r/2;n.spans.forEach((n,a)=>{if(!n||n.to<e.scale.min||n.from>e.scale.max)return;const l=e.valuePx(n.from),i=e.valuePx(n.to);t.push({series:o,index:a,x:(l+i)/2,y:s+n.lane*(r+m),r:r/2,rx:Math.max(0,(i-l)/2),ry:r/2})})}),t},[P,H]),L=n.useCallback(e=>{const t=S[e.series]?.[e.index];if(!t)return null;const n=[{seriesIndex:e.series,name:G[e.series],color:t.color??N[e.series],value:t.to-t.from,formatted:`${c(t.from,g(F.unit),A,q)} – ${c(t.to,g(F.unit),A,q)}`}];return{heading:t.span.label??G[e.series],items:n}},[S,G,N,F.unit,A,q]);return e(o,{...E,series:R,categories:G,size:$,density:C,locale:A,horizontal:!0,scale:F,references:D,brush:void 0,secondaryAxis:void 0,xAxis:T,yAxis:{tickFormat:(e,t)=>I[t]??"",...z},legend:!1,bandRatio:a[C],marks:K,markTooltip:L,summary:Y,exportRows:()=>function(e,t,n,o,r){const a=t.some(e=>e.data.some(e=>void 0!==e.label));return[["string"==typeof o?o:"",...a?[r.title]:[],r.start,r.end],...n.flatMap((n,o)=>n.map((n,r)=>[e[o],...a?[k(t[o].data[r]?.label)]:[],n?new Date(n.from):null,n?new Date(n.to):null]))]}(G,r,S,T?.label,J),table:t=>e(w,{id:t,names:G,series:r,spans:S,unit:g(F.unit),clock:q,label:E.label,corner:T?.label,locale:A}),children:t=>e(Spans,{context:t,spans:S,colors:N,rounded:j})})}function y(e){const t=e.data.map(e=>{const t=h(e.start),n=h(e.end);return null===t||null===n?null:{from:Math.min(t,n),to:Math.max(t,n),lane:0,color:e.color?u(e.color):void 0,span:e}}),n=[];return t.map((e,t)=>({one:e,index:t})).filter(e=>Boolean(e.one)).sort((e,t)=>e.one.from-t.one.from).forEach(({one:e})=>{const t=n.findIndex(t=>t<=e.from),o=-1===t?n.length:t;n[o]=e.to,e.lane=o}),{spans:t,lanes:Math.max(1,n.length)}}function Spans({context:t,spans:n,colors:o,rounded:a}){const{marks:s,activeMark:i,plot:c}=t,m=a?l:0;return e("g",{children:s.map(t=>{const a=n[t.series]?.[t.index];if(!a)return null;const s=i?.series===t.series&&i?.index===t.index,l=t.rx??t.r,u=2*(t.ry??t.r),d=Math.max(c.left,t.x-l),f=Math.min(c.left+c.width,t.x+l);if(f<c.left||d>c.left+c.width)return null;const h=Math.max(1,f-d);return e("rect",{x:d,y:t.y-u/2,width:h,height:u,rx:Math.min(m,h/2,u/2),fill:a.color??o[t.series],opacity:s?1:.92,className:r},`${t.series}-${t.index}`)})})}function v(e){const t=new Date(e);return t.getTime()!==new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()}function g(e){return"month"===e||"quarter"===e||"year"===e?"day":e}const k=e=>"string"==typeof e||"number"==typeof e?e:null;const w=/*@__PURE__*/n.memo(function TimelineTable({id:n,names:o,series:r,spans:a,unit:s,clock:l,label:i,corner:m,locale:u}){const d=p(x,u),f=r.some(e=>e.data.some(e=>void 0!==e.label));return t("table",{id:n,className:M,children:[i?e("caption",{children:i}):null,e("thead",{children:t("tr",{children:[e("th",{scope:"col",children:m??""}),f?e("th",{scope:"col",children:d.title}):null,e("th",{scope:"col",children:d.start}),e("th",{scope:"col",children:d.end})]})}),e("tbody",{children:a.flatMap((n,a)=>n.map((n,i)=>t("tr",{children:[e("th",{scope:"row",children:o[a]}),f?e("td",{children:r[a].data[i]?.label??""}):null,e("td",{children:n?c(n.from,s,u,l):""}),e("td",{children:n?c(n.to,s,u,l):""})]},`${a}-${i}`)))})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsxs as e}from"react/jsx-runtime";import*as n from"react";import{Toggle as
|
|
1
|
+
"use client";import{jsxs as e}from"react/jsx-runtime";import*as n from"react";import{Toggle as o}from"@base-ui/react/toggle";import{ButtonGroupContext as t}from"../../internal/button-group.js";import{trackPointer as r}from"../../internal/glow.js";import{controlHeightClasses as a,controlSlots as s,controlSquareClasses as l,controlTextClasses as i,cx as d,disabledClasses as b,focusRingClasses as g,gapClasses as v,iconClasses as p,paddingXClasses as m,pressTransitionClasses as x,radiusClasses as c,surfaceClasses as f,transitionClasses as h}from"../../internal/styles.js";import{useStyleDefaults as u}from"../../internal/defaults.js";const $={xs:`${a.xs} ${v.xs} ${c.xs} ${i.xs}`,sm:`${a.sm} ${v.sm} ${c.sm} ${i.sm}`,md:`${a.md} ${v.md} ${c.md} ${i.md}`,lg:`${a.lg} ${v.lg} ${c.lg} ${i.lg}`,xl:`${a.xl} ${v.xl} ${c.xl} ${i.xl}`},j={xs:`${l.xs} px-0`,sm:`${l.sm} px-0`,md:`${l.md} px-0`,lg:`${l.lg} px-0`,xl:`${l.xl} px-0`},w=["neba-toggle relative inline-flex shrink-0 select-none items-center justify-center","whitespace-nowrap align-middle font-medium leading-none","[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",h,x,g,p].join(" "),y={solid:[f,"text-(--neba-muted-fg) bg-(--neba-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]","hover:bg-(--neba-panel-press) hover:text-(--neba-fg)","active:bg-(--neba-panel-press)"].join(" "),outline:[f,"border text-(--neba-muted-fg) bg-(--neba-panel)","[border-color:var(--neba-border)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]","hover:bg-(--neba-panel-hover) hover:text-(--neba-fg)","active:bg-(--neba-panel-press)"].join(" "),text:["text-(--neba-muted-fg) bg-transparent","hover:bg-(--n-soft) hover:text-(--neba-fg)","active:bg-(--n-soft-hover)"].join(" ")},P={solid:[f,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]","hover:bg-(--n-fill-hover)","active:bg-(--n-fill-active)"].join(" "),outline:[f,"border text-(--n-on-tint) bg-(--n-panel-press)","[border-color:var(--n-line-hover)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]","hover:[border-color:var(--n-accent)] hover:text-(--neba-fg)","active:[border-color:var(--n-accent)]"].join(" "),text:["text-(--n-on-tint) bg-(--n-soft-hover)","hover:bg-(--n-soft-press)","active:bg-(--n-soft-press)"].join(" ")};export const Toggle=/*@__PURE__*/n.forwardRef(function Toggle(a,l){const i=n.useContext(t),{variant:g,size:v,color:p,density:x,elevation:c,pressed:f,defaultPressed:h,onPressedChange:z,value:C,startIcon:T,endIcon:k,fullWidth:I=!1,disabled:M,className:N,style:R,children:W,onPointerMove:q,...A}=u(a,["size","density","variant"],i),B=g??i?.variant??"outline",D=v??i?.size??"md",E=p??i?.color??"primary",F=x??i?.density??"default",G=c??i?.elevation??0,H=M??i?.disabled??!1,J=null==W||!1===W;return e(o,{ref:l,value:C,pressed:f,defaultPressed:h,onPressedChange:e=>z?.(e),disabled:H,className:e=>d(w,$[D],J?j[D]:m[F][D],H?b[B]:e.pressed?P[B]:y[B],H?"":"neba-glow cursor-pointer",I?"w-full":"",N??""),style:{...s(E,G,B),...R},onPointerMove:r(q,!H),...A,children:[T,W,k]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as a,jsxs as n}from"react/jsx-runtime";import*as l from"react";import{Collapsible as
|
|
1
|
+
"use client";import{jsx as e,Fragment as a,jsxs as n}from"react/jsx-runtime";import*as l from"react";import{Collapsible as s}from"@base-ui/react/collapsible";import{boxPaddingXClasses as r,boxPaddingYClasses as t}from"../box/Box.js";import{ChevronIcon as o}from"../../internal/icons.js";import{formatDuration as i,runColor as c,runIcon as m,useElapsed as d}from"../../internal/run.js";import{runMessages as u,toolMessages as f,useMessages as p}from"../../internal/i18n.js";import{collapsiblePanelClasses as x,cx as b,gapClasses as h,hasContent as g,iconClasses as v,metaTextClasses as N,preformattedClasses as j,radiusClasses as w,sheetBodyClasses as y,sheetTitleClasses as k,srOnlyClasses as z,surfaceClasses as C,surfaceSlots as B,transitionClasses as O,disclosureChevronClasses as R,disclosureTriggerClasses as T}from"../../internal/styles.js";import{useStyleDefaults as _}from"../../internal/defaults.js";const E={solid:[C,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[C,"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"},F=k;export const ToolCall=/*@__PURE__*/l.forwardRef(function ToolCall(j,k){const{variant:C="outline",size:P="md",color:S="primary",density:$="default",elevation:q=0,name:A,status:D="pending",args:G,result:H,error:I,duration:J,meta:K,icon:L,open:M,defaultOpen:Q=!1,onOpenChange:U,locale:V,labels:W,classNames:X,className:Y,style:Z,children:ee,...ae}=_(j,["size","density","variant","locale"]),ne=p(u,V),le=p(f,V),se={...ne,...le,...W},[re,te]=l.useState(Q),oe=void 0!==M,ie=oe?M:re,ce=l.useRef(D);l.useEffect(()=>{ce.current===D||"error"!==D||oe||te(!0),ce.current=D},[D,oe]);const me=d("running"===D,J),de=c(D,S),ue=void 0===L?m(D):L,fe=function(e,a,n){return"error"===e&&g(n)?n:a}(D,H,I),pe=g(G)||g(fe)||g(ee),xe=r[$][P],be=t[$][P],he=n(a,{children:[g(ue)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--n-accent)",children:ue}):null,e("span",{className:b("min-w-0 truncate font-mono font-semibold",F[P]),children:A}),e("span",{className:z,children:se[D]}),g(K)?e("span",{className:b("min-w-0 truncate text-(--neba-muted-fg)",N[P]),children:K}):null,e("span",{className:"flex-1"}),null===me?null:e("span",{className:b("shrink-0 tabular-nums text-(--neba-muted-fg)",N[P]),children:i(me,V)})]}),ge=b("flex flex-col overflow-hidden",w[P],E[C],O,v,Y??""),ve={...B(de,q),...Z};return pe?n(s.Root,{ref:k,open:ie,onOpenChange:e=>{oe||te(e),U?.(e)},"data-status":D,className:ge,style:ve,...ae,children:[n(s.Trigger,{className:b("flex w-full cursor-pointer items-center text-start",T,xe,be,h[P],O,"hover:bg-(--n-soft)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",X?.header??""),children:[he,e("span",{className:`${R} text-(--neba-muted-fg)`,children:e(o,{})})]}),e(s.Panel,{className:x,children:n("div",{className:b("flex min-w-0 flex-col gap-2 pb-4",xe,y[P],"compact"===$?"pb-2":"",X?.body??""),children:[g(G)?e(Block,{size:P,label:se.arguments,className:X?.args,value:G}):null,g(fe)?e(Block,{size:P,label:"error"===D&&g(I)?ne.error:se.result,className:X?.result,value:fe,accent:"error"===D}):null,ee]})})]}):e("div",{ref:k,"data-status":D,className:ge,style:ve,...ae,children:e("div",{className:b("flex items-center",xe,be,h[P],X?.header??""),children:he})})});function Block({size:a,label:l,value:s,className:r,accent:t=!1}){return n("div",{className:b("flex min-w-0 flex-col gap-1",r??""),children:[e("span",{className:b("font-medium tracking-wide text-(--neba-muted-fg) uppercase",N[a]),children:l}),"string"==typeof s?e("pre",{className:b(j,"max-h-64",t?"text-(--n-accent)":""),children:s}):e("div",{className:t?"text-(--n-accent)":void 0,children:s})]})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{Popover as s}from"@base-ui/react/popover";import{Button as i}from"../button/Button.js";import{boxPaddingXClasses as o,boxPaddingYClasses as l}from"../box/Box.js";import{actionMessages as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{Popover as s}from"@base-ui/react/popover";import{Button as i}from"../button/Button.js";import{boxPaddingXClasses as o,boxPaddingYClasses as l}from"../box/Box.js";import{actionMessages as a,fillMessage as r,stepsMessages as c,useMessages as d}from"../../internal/i18n.js";import{CloseIcon as m}from"../../internal/icons.js";import{queryMatches as p,reducedMotionQuery as u}from"../../internal/media.js";import{observeResize as h}from"../../internal/observe.js";import{cx as f,hasContent as g,metaTextClasses as x,popupFadeClasses as b,radiusClasses as v,sheetBodyClasses as w,sheetCloseClasses as N,sheetHeaderGapClasses as k,sheetSectionGapClasses as y,sheetTitleClasses as j,srOnlyClasses as S,surfaceClasses as z,surfaceSlots as L}from"../../internal/styles.js";import{useStyleDefaults as C}from"../../internal/defaults.js";const E=[z,"relative flex flex-col","border text-(--neba-fg) bg-(--n-panel-press)","[border-color:var(--n-line)]","[box-shadow:var(--neba-shadow-3),var(--neba-plate-glass)]","[outline:none]",b].join(" "),M={xs:"max-w-56",sm:"max-w-64",md:"max-w-80",lg:"max-w-96",xl:"max-w-lg"},P={xs:"xs",sm:"xs",md:"sm",lg:"sm",xl:"md"};function O(e){try{return document.querySelector(e)}catch{return null}}function Mask({spot:t,radius:n,className:s}){return e("div",null===t?{"aria-hidden":"true",className:f("pointer-events-none fixed inset-0 z-40 bg-(--neba-scrim)",s)}:{"aria-hidden":"true",className:f("pointer-events-none fixed z-40 [box-shadow:0_0_0_9999px_var(--neba-scrim)]",s),style:{top:t.top,left:t.left,width:t.width,height:t.height,borderRadius:n}})}export function Tour(b){const{steps:z,open:_,defaultOpen:B=!1,onOpenChange:F,step:R,defaultStep:T=0,onStepChange:q,onFinish:A,mask:I=!0,skippable:V=!0,dismissible:$=!0,scrollIntoView:D=!0,locale:H,previousLabel:G,nextLabel:J,doneLabel:K,skipLabel:Q,closeLabel:U,size:W="md",color:X="primary",density:Y="default",className:Z,classNames:ee}=C(b,["size","density","locale"]),te=d(c,H),ne=d(a,H),[se,ie]=n.useState(B),[oe,le]=n.useState(T),ae=_??se,re=Math.min(R??oe,Math.max(0,z.length-1)),ce=z[re],[de,me]=n.useState(null),pe=e=>{void 0===_&&ie(e),F?.(e)},ue=e=>{void 0===R&&le(e),q?.(e)},[he,fe]=n.useState(null);if(n.useLayoutEffect(()=>{const e=ce?.target;fe(ae&&e?O(e):null)},[ae,ce?.target]),n.useEffect(()=>{const e=ce?.target;if(!ae||!e)return;const t=O(e);if(!(t instanceof HTMLElement))return;D&&t.scrollIntoView({block:"center",inline:"nearest",behavior:p(u)?"auto":"smooth"});const n=ce?.padding??6;let s=0;const i=()=>{s=0;const i=t.getBoundingClientRect(),o={top:i.top-n,left:i.left-n,width:i.width+2*n,height:i.height+2*n};me(t=>t?.selector===e&&t.spot.top===o.top&&t.spot.left===o.left&&t.spot.width===o.width&&t.spot.height===o.height?t:{selector:e,spot:o})},o=()=>{0===s&&(s=requestAnimationFrame(i))};i();const l=h(t,o);return window.addEventListener("scroll",o,{passive:!0,capture:!0}),window.addEventListener("resize",o,{passive:!0}),()=>{0!==s&&cancelAnimationFrame(s),l(),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[ae,ce?.target,ce?.padding,D]),0===z.length)return null;const ge=ae&&ce?.target&&de?.selector===ce.target?de.spot:null,xe=0===re,be=re===z.length-1,ve=o[Y][W],we=l[Y][W],Ne=P[W],ke=g(ce?.title)||g(ce?.content);return e(s.Root,{open:ae,onOpenChange:(e,t)=>{(e||$||"escape-key"!==t.reason)&&(e||"outside-press"!==t.reason&&"focus-out"!==t.reason)?pe(e):t.cancel()},children:t(s.Portal,{children:[ae&&I?e(Mask,{spot:ge,radius:ge?8:0,className:ee?.mask}):null,e(s.Positioner,{className:"neba-portal z-(--neba-z-portal) [outline:none]",side:ce?.side??"bottom",align:ce?.align??"center",sideOffset:10,collisionPadding:12,anchor:he,children:t(s.Popup,{className:f(E,v[W],w[W],y[W],M[W],ve,we,Z),style:L(X,3),children:[e("span",{className:S,"aria-live":"polite",children:"string"==typeof ce?.title?r(te.step,{index:String(re+1),title:ce.title}):r(te.position,{index:String(re+1),total:String(z.length)})}),ke?t("div",{className:"flex items-start gap-3",children:[t("div",{className:`flex min-w-0 flex-1 flex-col ${k[W]}`,children:[g(ce?.title)?e(s.Title,{className:f("m-0 font-semibold",j[W],ee?.title),children:ce?.title}):null,g(ce?.content)?e(s.Description,{className:f("m-0 min-w-0",ee?.description),children:ce?.content}):null]}),$?e("button",{type:"button","aria-label":U??ne.close,onClick:()=>pe(!1),className:f(N,ee?.close),children:e(m,{})}):null]}):null,t("div",{className:f("flex items-center gap-2",ee?.footer),children:[e("span",{className:`shrink-0 tabular-nums text-(--neba-muted-fg) ${x[W]}`,children:r(te.position,{index:String(re+1),total:String(z.length)})}),t("div",{className:"ms-auto flex items-center gap-2",children:[V&&!be?e(i,{size:Ne,variant:"text",color:"secondary",onClick:()=>pe(!1),children:Q??te.skip}):null,xe?null:e(i,{size:Ne,variant:"outline",color:X,onClick:()=>ue(re-1),children:G??te.previous}),e(i,{size:Ne,color:X,onClick:()=>be?(A?.(),void pe(!1)):ue(re+1),children:be?K??te.done:J??te.next})]})]})]})})]})})}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Checkbox as t}from"../checkbox/Checkbox.js";import{IconButton as s}from"../icon-button/IconButton.js";import{ScrollArea as r}from"../scroll-area/ScrollArea.js";import{TextField as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{Checkbox as t}from"../checkbox/Checkbox.js";import{IconButton as s}from"../icon-button/IconButton.js";import{ScrollArea as r}from"../scroll-area/ScrollArea.js";import{TextField as n}from"../text-field/TextField.js";import{fillMessage as i,transferMessages as o,useMessages as c}from"../../internal/i18n.js";import{ArrowRightIcon as d}from"../../internal/icons.js";import{searchText as u}from"../../internal/search.js";import{cx as m,fieldRestClasses as h,hasContent as f,metaTextClasses as b,paddingXClasses as p,radiusClasses as v,srOnlyClasses as g,surfaceSlots as x,toLength as y}from"../../internal/styles.js";import{useStyleDefaults as S}from"../../internal/defaults.js";const k={xs:"py-1",sm:"py-1.5",md:"py-2",lg:"py-2.5",xl:"py-3"},w={xs:"py-0.5",sm:"py-1",md:"py-1",lg:"py-1.5",xl:"py-2"};function Panel({title:s,rows:i,arrived:o,ticked:c,onTick:d,onTickAll:u,search:f,onSearch:g,searchable:y,disabled:S,height:N,emptyMessage:j,searchLabel:T,selectAllLabel:z,style:M}){const{size:$,variant:A="outline",color:C="primary",density:L="default"}=M,_=i.filter(e=>!e.disabled),P=_.filter(e=>c.has(e.value)),W=_.length>0&&P.length===_.length,D=P.length>0&&!W,I=p[L][$],R=l.useId();return a("div",{role:"group","aria-labelledby":R,className:["flex min-w-0 flex-col overflow-hidden",h[A],v[$]].join(" "),style:x(C,0),children:[a("div",{className:`flex items-center gap-2 border-b [border-color:var(--neba-border)] ${I} ${k[$]}`,children:[e(t,{size:$,color:C,checked:W,indeterminate:D,disabled:S||0===_.length,"aria-label":z,onCheckedChange:e=>u(!0===e)}),e("span",{id:R,className:`min-w-0 flex-1 truncate font-medium ${b[$]}`,children:s}),a("span",{className:`shrink-0 tabular-nums text-(--neba-muted-fg) ${b[$]}`,children:[P.length,"/",i.length]})]}),y?e("div",{className:`${I} ${k[$]}`,children:e(n,{size:$,color:C,density:L,fullWidth:!0,variant:"text",disabled:S,placeholder:T,"aria-label":T,value:f,onChange:e=>g(e.target.value)})}):null,e(r,{size:$,color:C,height:N,fade:!0,children:e("div",{className:`flex flex-col ${I} ${k[$]}`,children:0===i.length?e("span",{className:`text-(--neba-muted-fg) ${b[$]} ${w[$]}`,children:j}):i.map(a=>e(t,{size:$,color:C,className:m(w[$],o.has(a.value)?"[animation:neba-anim-fade_var(--neba-duration-fill)_var(--neba-ease)_both]":""),label:a.label,checked:c.has(a.value),disabled:S||a.disabled,onCheckedChange:e=>d(a.value,!0===e)},a.value))})})]})}function N(e,a,l){const t=u(a);return""===t?e:e.filter(e=>{const a=l.get(e.value);return void 0===a||a.includes(t)})}export const Transfer=/*@__PURE__*/l.forwardRef(function Transfer(t,r){const{items:n,value:h,defaultValue:b,onValueChange:p,sourceLabel:v,targetLabel:x,searchable:k=!1,height:w=220,disabled:j=!1,locale:T,variant:z="outline",size:M="md",color:$="primary",density:A="default",className:C,...L}=S(t,["size","density","variant","locale"]),_=c(o,T),[P,W]=l.useState(b??[]),D=h??P,[I,R]=l.useState(()=>new Set),[V,B]=l.useState(()=>new Set),[E,F]=l.useState(""),[q,G]=l.useState(""),[H,J]=l.useState(""),K=l.useRef(void 0);l.useEffect(()=>()=>clearTimeout(K.current),[]);const O=l.useMemo(()=>new Set(D),[D]),Q=l.useMemo(()=>n.filter(e=>!O.has(e.value)),[n,O]),U=l.useMemo(()=>n.filter(e=>O.has(e.value)),[n,O]),X=(e,a)=>{R(l=>{const t=new Set(l);return a?t.add(e):t.delete(e),t})},Y=(e,a)=>{R(l=>{const t=new Set(l);for(const l of e)l.disabled||(a?t.add(l.value):t.delete(l.value));return t})},Z=(e,a)=>{const l=e.filter(e=>!e.disabled&&I.has(e.value));if(0===l.length)return;const t=new Set(l.map(e=>e.value)),s=new Set(n.map(e=>e.value)),r=D.filter(e=>!s.has(e)),o=a?[...n.filter(e=>O.has(e.value)||t.has(e.value)).map(e=>e.value),...r]:D.filter(e=>!t.has(e));R(e=>new Set([...e].filter(e=>!t.has(e)))),B(t),(e=>{void 0===h&&W(e),p?.(e)})(o);const c=a?x:v,d=i(_.moved,{count:String(l.length),list:"string"==typeof c&&c.trim()?c:a?_.target:_.source});clearTimeout(K.current),J(""),K.current=setTimeout(()=>J(d),100)},ee=l.useMemo(()=>function(e){const a=new Map;for(const l of e)"string"==typeof l.label&&a.set(l.value,u(l.label));return a}(n),[n]),ae=l.useMemo(()=>N(Q,E,ee),[Q,E,ee]),le=l.useMemo(()=>N(U,q,ee),[U,q,ee]),te=ae.some(e=>!e.disabled&&I.has(e.value)),se=le.some(e=>!e.disabled&&I.has(e.value)),re=y(w),ne={variant:z,size:M,color:$,density:A};return a("div",{ref:r,className:m("grid w-full items-center gap-3","[grid-template-columns:minmax(0,1fr)_auto_minmax(0,1fr)]",C??""),...L,children:[e(Panel,{title:f(v)?v:_.source,rows:ae,arrived:V,ticked:I,onTick:X,onTickAll:e=>Y(ae,e),search:E,onSearch:F,searchable:k,disabled:j,height:re,emptyMessage:_.empty,searchLabel:_.search,selectAllLabel:_.selectAll,style:ne}),a("div",{className:"flex flex-col gap-2",children:[e(s,{size:M,color:$,variant:"text"===z?"text":"outline",label:_.toTarget,disabled:j||!te,focusableWhenDisabled:!j,onClick:()=>Z(ae,!0),icon:e("span",{className:"flex rtl:rotate-180",children:e(d,{})})}),e(s,{size:M,color:$,variant:"text"===z?"text":"outline",label:_.toSource,disabled:j||!se,focusableWhenDisabled:!j,onClick:()=>Z(le,!1),icon:e("span",{className:"flex rotate-180 rtl:rotate-0",children:e(d,{})})})]}),e(Panel,{title:f(x)?x:_.target,rows:le,arrived:V,ticked:I,onTick:X,onTickAll:e=>Y(le,e),search:q,onSearch:G,searchable:k,disabled:j,height:re,emptyMessage:_.empty,searchLabel:_.search,selectAllLabel:_.selectAll,style:ne}),e("span",{role:"status",className:g,children:H})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{TreeItem as n,TreeView as r}from"../tree-view/TreeView.js";import{PickerShell as t}from"../../internal/picker.js";import{searchHaystack as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import*as a from"react";import{TreeItem as n,TreeView as r}from"../tree-view/TreeView.js";import{PickerShell as t}from"../../internal/picker.js";import{searchHaystack as i,searchText as o}from"../../internal/search.js";import{actionMessages as s,commandMessages as c,comboboxMessages as d,useMessages as u}from"../../internal/i18n.js";import{useStyleDefaults as p}from"../../internal/defaults.js";function h(e,l=new Map){for(const a of e)l.set(a.value,a),a.children&&h(a.children,l);return l}function m(e,l=new Map){for(const a of e)l.set(a,i([a.searchLabel??("string"==typeof a.label?a.label:String(a.value))])),a.children&&m(a.children,l);return l}function f(e,l,a){if(""===l)return e;const n=[];for(const r of e){const e=r.children?f(r.children,l,a):void 0,t=(a.get(r)??"").includes(l);(t||e&&e.length>0)&&n.push({...r,children:t?r.children:e})}return n}function g(e,l=[]){for(const a of e)a.children&&a.children.length>0&&(l.push(a.value),g(a.children,l));return l}export const TreeSelect=/*@__PURE__*/a.forwardRef(function TreeSelect(i,b){const{items:v=[],value:x,defaultValue:y,onValueChange:S,multiple:w=!1,selectableBranches:C=!1,defaultExpanded:j,expanded:N,onExpandedChange:M,open:O,defaultOpen:z,onOpenChange:T,placeholder:V,clearable:E=!1,clearLabel:L,closeOnSelect:k,searchable:A=!1,searchPlaceholder:I,locale:P,format:R,name:B,size:F="md",color:$="primary",readOnly:q=!1,disabled:D=!1,classNames:G,...H}=p(i,["size","density","variant","locale","labelPlacement"]),J=u(d,P),K=u(c,P),Q=u(s,P),U=e=>null==e?[]:Array.isArray(e)?e:[e],[W,X]=a.useState(()=>U(y)),Y=void 0!==x?U(x):W,[Z,_]=a.useState(z??!1),ee=O??Z,[le,ae]=a.useState(""),ne=a.useMemo(()=>h(v),[v]),re=a.useMemo(()=>m(v),[v]),te=o(le),ie=a.useMemo(()=>f(v,te,re),[v,te,re]),oe=a.useMemo(()=>""===te?void 0:g(ie),[te,ie]),[se,ce]=a.useState(()=>j??[]),de=oe??N??se,ue=e=>{e&&(q||D)||(void 0===O&&_(e),e||ae(""),T?.(e))},pe=e=>{void 0===x&&X(e),S?.(e)},he=e=>e.selectable??(!(e.children&&e.children.length>0)||C),me=Y.map(e=>ne.get(e)).filter(e=>void 0!==e),fe=0===me.length?V??"":R?R(me):me.map(e=>e.label).reduce((e,l,a)=>0===a?[l]:[...e,", ",l],[]),ge=l=>l.map(l=>e(n,{value:l.value,label:l.label,startIcon:l.startIcon,disabled:l.disabled,selectable:he(l),className:G?.item,children:l.children?ge(l.children):null},l.value));return e(t,{...H,size:F,color:$,readOnly:q,disabled:D,triggerRef:b,display:fe,empty:0===me.length,clearable:E,onClear:()=>pe([]),open:ee,onOpenChange:ue,clearLabel:L??Q.clear,popupClassName:G?.popup,initialFocus:!0,hiddenValues:B?Y.map(e=>({name:B,value:String(e)})):void 0,repeats:w,children:l("div",{className:"flex max-h-80 w-64 flex-col gap-2 overflow-hidden",children:[A?e("input",{type:"text",value:le,placeholder:I??K.search,"aria-label":I??K.search,onChange:e=>ae(e.currentTarget.value),className:"neba-input w-full shrink-0 bg-transparent px-1 py-1 [font:inherit] text-(--neba-fg) [outline:none] placeholder:text-(--neba-muted-fg)"}):null,e("div",{className:"min-h-0 flex-1 overflow-auto",children:0===ie.length?e("p",{className:`px-1 py-2 text-(--neba-muted-fg) ${G?.empty??""}`,children:J.empty}):e(r,{size:F,color:$,multiple:w,selected:Y,onSelectedChange:e=>{const l=e.filter(e=>{const l=ne.get(e);return void 0!==l&&he(l)&&!l.disabled});pe(w?l:l.slice(-1)),(k??!w)&&ue(!1)},expanded:de,onExpandedChange:oe?()=>{}:e=>{void 0===N&&ce(e),M?.(e)},className:G?.tree,children:ge(ie)})})]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{inertValue as a}from"../../internal/inert.js";import{safeHref as l}from"../../internal/link.js";import{searchText as s}from"../../internal/search.js";import{ChevronIcon as o}from"../../internal/icons.js";import{controlTextClasses as i,cx as d,gapClasses as c,hasContent as u,iconClasses as m,radiusClasses as f,surfaceClasses as p,surfaceSlots as g,transitionClasses as x}from"../../internal/styles.js";import{useStyleDefaults as b}from"../../internal/defaults.js";const h=/*@__PURE__*/r.createContext({size:"md",density:"default",disabled:!1,multiple:!1,expandedKeys:new Set,selectedKeys:new Set,activeKey:null,toggle:()=>{},select:()=>{},activate:()=>{},register:()=>()=>{}}),v=/*@__PURE__*/r.createContext(!1),y={solid:[p,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[p,"border text-(--neba-fg) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},w={xs:"0.875rem",sm:"1rem",md:"1.25rem",lg:"1.5rem",xl:"1.75rem"},k={xs:"1.375rem",sm:"1.625rem",md:"2rem",lg:"2.5rem",xl:"3rem"},C={default:{xs:"px-1.5",sm:"px-2",md:"px-2.5",lg:"px-3",xl:"px-3.5"},compact:{xs:"px-1",sm:"px-1",md:"px-1.5",lg:"px-2",xl:"px-2.5"}},S={xs:"rounded-[0.3125rem]",sm:"rounded-[0.375rem]",md:"rounded-[0.5rem]",lg:"rounded-[0.625rem]",xl:"rounded-[0.75rem]"},E={none:"",simple:"neba-tree-simple",folder:"neba-tree-folder"};function N(e){return Array.from(e.querySelectorAll('[role="treeitem"]')).filter(e=>null===e.closest("[data-closing]"))}const j=e=>String(e);export const TreeView=/*@__PURE__*/r.forwardRef(function TreeView(t,n){const{variant:a="outline",size:l="md",color:o="primary",density:i="default",elevation:c=0,lines:u="simple",expanded:m,defaultExpanded:p,onExpandedChange:v,selected:C,defaultSelected:S,onSelectedChange:K,multiple:A=!1,disabled:V=!1,label:D,className:R,style:I,children:P,onKeyDown:T,..._}=b(t,["size","density","variant"]),[z,q]=r.useState(p??[]),[F,M]=r.useState(S??[]),[L,H]=r.useState(null),O=m??z,U=C??F,W=r.useRef(null),B=r.useCallback(e=>{W.current=e,"function"==typeof n?n(e):n&&(n.current=e)},[n]),G=r.useRef({expandedValues:O,selectedValues:U,controlledExpanded:void 0!==m,controlledSelected:void 0!==C,multiple:A,onExpandedChange:v,onSelectedChange:K});G.current={expandedValues:O,selectedValues:U,controlledExpanded:void 0!==m,controlledSelected:void 0!==C,multiple:A,onExpandedChange:v,onSelectedChange:K};const J=r.useCallback(e=>{const{expandedValues:t,controlledExpanded:n,onExpandedChange:r}=G.current,a=j(e),l=t.some(e=>j(e)===a)?t.filter(e=>j(e)!==a):[...t,e];n||q(l),r?.(l)},[]),Q=r.useCallback(e=>{const{selectedValues:t,controlledSelected:n,multiple:r,onSelectedChange:a}=G.current,l=j(e),s=t.some(e=>j(e)===l),o=r?s?t.filter(e=>j(e)!==l):[...t,e]:[e];n||M(o),a?.(o)},[]),X=r.useRef(new Map),Y=r.useCallback((e,t)=>(X.current.set(e,t),()=>{X.current.delete(e)}),[]),Z=r.useMemo(()=>O.map(j).join("\0"),[O]),$=r.useMemo(()=>U.map(j).join("\0"),[U]),ee=r.useMemo(()=>({size:l,density:i,disabled:V,multiple:A,expandedKeys:new Set(O.map(j)),selectedKeys:new Set(U.map(j)),activeKey:L,toggle:J,select:Q,activate:H,register:Y}),[l,i,V,A,Z,$,L,J,Q,Y]);r.useEffect(()=>{if(null!==L&&X.current.has(L))return;const e=W.current;if(!e)return;const t=N(e);if(0===t.length)return;const n=t.find(e=>"true"===e.getAttribute("aria-selected"))??t[0];H(n.dataset.nebaValue??null)});const te=d("flex list-none flex-col p-1",f[l],y[a],x,E[u],R);return e(h.Provider,{value:ee,children:e("ul",{ref:B,role:"tree","aria-label":D,"aria-multiselectable":A||void 0,className:te,style:{...g(o,c),"--n-tree-indent":w[l],"--n-tree-row":k[l],...I},onKeyDown:function(e){if(T?.(e),e.defaultPrevented)return;const t=W.current,n=e.target?.closest?.('[role="treeitem"]');if(!t||!n||!t.contains(n))return;if(e.target!==n)return;const r=N(t),a=r.indexOf(n);if(-1===a)return;const l=t=>{t&&(e.preventDefault(),H(t.dataset.nebaValue??null),t.focus())},o=e=>{const t=e.dataset.nebaValue;t&&X.current.get(t)?.toggle()},i="rtl"===getComputedStyle(t).direction,d=i?"ArrowLeft":"ArrowRight",c=i?"ArrowRight":"ArrowLeft",u=n.getAttribute("aria-expanded");switch(e.key){case"ArrowDown":l(r[a+1]);break;case"ArrowUp":l(r[a-1]);break;case"Home":l(r[0]);break;case"End":l(r[r.length-1]);break;case d:"false"===u?(e.preventDefault(),o(n)):"true"===u&&l(r[a+1]);break;case c:"true"===u?(e.preventDefault(),o(n)):l(n.parentElement?.closest('[role="treeitem"]'));break;case"Enter":case" ":e.preventDefault();(("Enter"===e.key?n.querySelector(":scope > div > a[href]"):null)??n).click();break;default:if(1===[...e.key].length&&" "!==e.key&&!e.ctrlKey&&!e.metaKey&&!e.altKey){const t=s(e.key);l([...r.slice(a+1),...r.slice(0,a)].find(e=>s(e.querySelector("[data-neba-label]")?.textContent??"").startsWith(t)))}}},..._,children:P})})});export const TreeItem=/*@__PURE__*/r.forwardRef(function TreeItem({value:s,label:f,startIcon:p,endIcon:g,action:b,href:y,expandable:w,disabled:k=!1,selectable:E=!0,className:N,children:K,onClick:A,...V},D){const{size:R,density:I,disabled:P,expandedKeys:T,selectedKeys:_,activeKey:z,toggle:q,select:F,activate:M,register:L,multiple:H}=r.useContext(h),O=r.useId(),U=s??O,W=j(U),B=r.useRef(null),G=r.useCallback(e=>{B.current=e,"function"==typeof D?D(e):D&&(D.current=e)},[D]),J=r.Children.toArray(K),Q=w??J.length>0,X=Q&&T.has(W),Y=_.has(W),Z=k||P,$=r.useRef({toggle:()=>{}});$.current.toggle=()=>{!Z&&Q&&q(U)};const ee=r.useContext(v);r.useEffect(()=>ee?void 0:L(W,$.current),[ee,W,L]);const[te,ne]=r.useState(X),[re,ae]=r.useState(X),le=r.useRef(null);r.useEffect(()=>{if(X){ne(!0);const e=requestAnimationFrame(()=>ae(!0));return()=>cancelAnimationFrame(e)}ae(!1);const e=le.current;(null===e||getComputedStyle(e).transitionDuration.split(",").every(e=>0===parseFloat(e)))&&ne(!1)},[X]);const se=d("flex min-w-0 flex-1 cursor-pointer items-center text-start","h-(--n-tree-row)",C[I][R],S[R],c[R],i[R],x,m,"group-focus-visible/tree-item:[outline:2px_solid_var(--n-ring)]","group-focus-visible/tree-item:outline-offset-[-2px]",Z?"cursor-not-allowed text-(--neba-disabled-fg)":Y?"bg-(--n-soft-press) font-medium text-(--n-on-tint) hover:bg-(--n-soft-press)":"hover:bg-(--n-soft)"),oe=n(t,{children:[e("span",{"aria-hidden":"true",onClick:e=>{!Z&&Q&&(e.stopPropagation(),e.preventDefault(),B.current?.focus(),M(W),q(U))},className:d("flex h-[1lh] w-[1.15em] shrink-0 items-center justify-center","[transition:rotate_var(--neba-duration)_var(--neba-ease)]",Q?"text-(--neba-muted-fg)":"",X?"rotate-0":"-rotate-90 rtl:rotate-90"),children:Q?e(o,{}):null}),u(p)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:p}):null,e("span",{"data-neba-label":"",className:"min-w-0 flex-1 truncate",children:f}),u(g)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:g}):null]});return n("li",{ref:G,role:"treeitem","aria-expanded":Q?X:void 0,"aria-selected":!!Y||(!H||!E)&&void 0,"aria-disabled":Z||void 0,"data-neba-value":W,tabIndex:z===W?0:-1,className:d("group/tree-item relative block [outline:none]",N),onClick:function(e){e.stopPropagation(),Z?e.preventDefault():(B.current?.focus(),M(W),A?.(e),e.defaultPrevented||(Q&&q(U),E&&F(U)))},...V,children:[n("div",{className:"flex w-full items-center",children:[void 0===l(y)||Z?e("div",{className:se,children:oe}):e("a",{href:l(y),tabIndex:-1,className:se,"aria-current":Y?"page":void 0,children:oe}),u(b)?e("span",{className:d("flex shrink-0 items-center",C[I][R]),onClick:e=>e.stopPropagation(),children:b}):null]}),Q&&te&&J.length>0?e("div",{ref:le,"data-closing":X?void 0:"",inert:a(!X),className:d("grid [transition:grid-template-rows_var(--neba-duration)_var(--neba-ease)]",re?"[grid-template-rows:1fr]":"[grid-template-rows:0fr] pointer-events-none"),onTransitionEnd:e=>{e.target!==e.currentTarget||"grid-template-rows"!==e.propertyName||X||ne(!1)},children:e("ul",{role:"group",className:"min-h-0 list-none overflow-hidden ps-(--n-tree-indent)",children:e(v.Provider,{value:ee||!X,children:K})})}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as a}from"@base-ui/react/use-render";import{transitionProps as t}from"../../internal/animate.js";import{clampClasses as r,clampSlot as n,cx as p}from"../../internal/styles.js";const o={h1:"[&.neba-typography]:text-[1.875rem]/[1.2] [&.neba-typography]:tracking-[-0.02em]",h2:"[&.neba-typography]:text-[1.5rem]/[1.25] [&.neba-typography]:tracking-[-0.015em]",h3:"[&.neba-typography]:text-[1.25rem]/[1.3] [&.neba-typography]:tracking-[-0.01em]",h4:"[&.neba-typography]:text-[1.0625rem]/[1.41176] [&.neba-typography]:tracking-normal",h5:"[&.neba-typography]:text-[0.9375rem]/[1.46667] [&.neba-typography]:tracking-normal",h6:"[&.neba-typography]:text-[0.8125rem]/[1.53846] [&.neba-typography]:tracking-normal",lead:"[&.neba-typography]:text-[1.0625rem]/[1.64706] [&.neba-typography]:tracking-normal",body:"[&.neba-typography]:text-[0.8125rem]/[1.69231] [&.neba-typography]:tracking-normal",caption:"[&.neba-typography]:text-[0.75rem]/[1.5] [&.neba-typography]:tracking-normal",overline:"[&.neba-typography]:text-[0.6875rem]/[1.45455] [&.neba-typography]:tracking-[0.08em] uppercase"},y={h1:"semibold",h2:"semibold",h3:"semibold",h4:"semibold",h5:"semibold",h6:"semibold",lead:"regular",body:"regular",caption:"regular",overline:"medium"},h={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",caption:"span",overline:"span"},b=new Set(["caption","overline"]),m={h1:"[&.neba-typography]:mb-4",h2:"[&.neba-typography]:mb-3.5",h3:"[&.neba-typography]:mb-3",h4:"[&.neba-typography]:mb-2.5",h5:"[&.neba-typography]:mb-2",h6:"[&.neba-typography]:mb-2",lead:"[&.neba-typography]:mb-4",body:"[&.neba-typography]:mb-3",caption:"[&.neba-typography]:mb-2",overline:"[&.neba-typography]:mb-2"},g={regular:"[&.neba-typography]:font-normal",medium:"[&.neba-typography]:font-medium",semibold:"[&.neba-typography]:font-semibold",bold:"[&.neba-typography]:font-bold"},i={start:"text-start",center:"text-center",end:"text-end",justify:"text-justify"};export const Typography=/*@__PURE__*/e.forwardRef(function Typography({level:l="body",color:s,weight:c,align:d,lines:u,gutter:x=!1,transition:f,render:k,className:v,style:j,children:w,...N},T){const E=t(f),R=p("neba-typography",o[l],g[c??y[l]],d?i[d]:"","span"
|
|
1
|
+
"use client";import*as e from"react";import{useRender as a}from"@base-ui/react/use-render";import{transitionProps as t}from"../../internal/animate.js";import{clampClasses as r,clampSlot as n,cx as p}from"../../internal/styles.js";const o={h1:"[&.neba-typography]:text-[1.875rem]/[1.2] [&.neba-typography]:tracking-[-0.02em]",h2:"[&.neba-typography]:text-[1.5rem]/[1.25] [&.neba-typography]:tracking-[-0.015em]",h3:"[&.neba-typography]:text-[1.25rem]/[1.3] [&.neba-typography]:tracking-[-0.01em]",h4:"[&.neba-typography]:text-[1.0625rem]/[1.41176] [&.neba-typography]:tracking-normal",h5:"[&.neba-typography]:text-[0.9375rem]/[1.46667] [&.neba-typography]:tracking-normal",h6:"[&.neba-typography]:text-[0.8125rem]/[1.53846] [&.neba-typography]:tracking-normal",lead:"[&.neba-typography]:text-[1.0625rem]/[1.64706] [&.neba-typography]:tracking-normal",body:"[&.neba-typography]:text-[0.8125rem]/[1.69231] [&.neba-typography]:tracking-normal",caption:"[&.neba-typography]:text-[0.75rem]/[1.5] [&.neba-typography]:tracking-normal",overline:"[&.neba-typography]:text-[0.6875rem]/[1.45455] [&.neba-typography]:tracking-[0.08em] uppercase"},y={h1:"semibold",h2:"semibold",h3:"semibold",h4:"semibold",h5:"semibold",h6:"semibold",lead:"regular",body:"regular",caption:"regular",overline:"medium"},h={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",lead:"p",body:"p",caption:"span",overline:"span"},b=new Set(["caption","overline"]),m={h1:"[&.neba-typography]:mb-4",h2:"[&.neba-typography]:mb-3.5",h3:"[&.neba-typography]:mb-3",h4:"[&.neba-typography]:mb-2.5",h5:"[&.neba-typography]:mb-2",h6:"[&.neba-typography]:mb-2",lead:"[&.neba-typography]:mb-4",body:"[&.neba-typography]:mb-3",caption:"[&.neba-typography]:mb-2",overline:"[&.neba-typography]:mb-2"},g={regular:"[&.neba-typography]:font-normal",medium:"[&.neba-typography]:font-medium",semibold:"[&.neba-typography]:font-semibold",bold:"[&.neba-typography]:font-bold"},i={start:"text-start",center:"text-center",end:"text-end",justify:"text-justify"};export const Typography=/*@__PURE__*/e.forwardRef(function Typography({level:l="body",color:s,weight:c,align:d,lines:u,gutter:x=!1,transition:f,render:k,className:v,style:j,children:w,...N},T){const E=t(f),R=p("neba-typography",o[l],g[c??y[l]],d?i[d]:"","span"!==h[l]||!d&&!x||void 0!==u&&u>1?"":"block",u?r(u):"",x?m[l]:"[&.neba-typography]:my-0",s?"[&.neba-typography]:text-(--n-accent)":b.has(l)?"[&.neba-typography]:text-(--neba-muted-fg)":"",E.className,v??"");return a({render:k??e.createElement(h[l]),ref:T,props:{className:R,style:s?{"--n-accent":`var(--neba-${s}-accent)`,...n(u),...E.style,...j}:{...n(u),...E.style,...j},children:w,...N}})});
|
|
@@ -17,8 +17,8 @@ export interface VisuallyHiddenProps extends React.ComponentPropsWithoutRef<'spa
|
|
|
17
17
|
* Content that is in the accessibility tree and not on the screen.
|
|
18
18
|
*
|
|
19
19
|
* The library has needed this everywhere from the beginning and kept it to
|
|
20
|
-
* itself: the word
|
|
21
|
-
* the page
|
|
20
|
+
* itself: the status word beside a ToolCall's mark, the count behind a
|
|
21
|
+
* Badge's dot, the page a Pagination announces, the table a chart draws for a
|
|
22
22
|
* screen reader instead of a picture. This is the same 1px clipped box, offered
|
|
23
23
|
* so an application's own markup can say the same things.
|
|
24
24
|
*
|