neba 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -5
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/alert/Alert.js +1 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-lighting/AnimateLighting.js +1 -1
- package/dist/components/app-logo/AppLogo.js +1 -1
- package/dist/components/aspect-ratio/AspectRatio.js +1 -1
- package/dist/components/avatar/Avatar.js +1 -1
- package/dist/components/avatar-group/AvatarGroup.js +1 -1
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/bar-chart/BarChart.d.ts +1 -1
- package/dist/components/bar-chart/BarChart.js +1 -1
- package/dist/components/blockquote/Blockquote.js +1 -1
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/box/Box.js +1 -1
- package/dist/components/breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button-group/ButtonGroup.js +1 -1
- package/dist/components/calendar/Calendar.d.ts +72 -0
- package/dist/components/calendar/Calendar.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/calendar/index.js +1 -0
- package/dist/components/card/Card.js +1 -1
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/chat-bubble/ChatBubble.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/collapsible/Collapsible.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +14 -2
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +1 -1
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/confirm/Confirm.d.ts +83 -0
- package/dist/components/confirm/Confirm.js +1 -0
- package/dist/components/confirm/index.d.ts +2 -0
- package/dist/components/confirm/index.js +1 -0
- package/dist/components/container/Container.js +1 -1
- package/dist/components/data-list/DataList.js +1 -1
- package/dist/components/data-table/DataTable.d.ts +104 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +40 -8
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js +1 -1
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/drawer/Drawer.d.ts +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/empty/Empty.js +1 -1
- package/dist/components/file-picker/FilePicker.js +1 -1
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/floating-bottom-navigation/FloatingBottomNavigation.js +1 -1
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/gauge-chart/GaugeChart.d.ts +1 -1
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.d.ts +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +1 -1
- package/dist/components/highlight/Highlight.js +1 -1
- package/dist/components/hover-card/HoverCard.d.ts +1 -1
- package/dist/components/hover-card/HoverCard.js +1 -1
- package/dist/components/how-to-steps/HowToSteps.js +1 -1
- package/dist/components/image/Image.d.ts +70 -0
- package/dist/components/image/Image.js +1 -0
- package/dist/components/image/index.d.ts +2 -0
- package/dist/components/image/index.js +1 -0
- package/dist/components/list/List.js +1 -1
- package/dist/components/menubar/Menubar.js +1 -1
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/mockup/Mockup.js +1 -1
- package/dist/components/number-field/NumberField.d.ts +12 -2
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.d.ts +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/page-layout/PageLayout.js +1 -1
- package/dist/components/pagination/Pagination.js +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.d.ts +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/pill/Pill.js +1 -1
- package/dist/components/popconfirm/Popconfirm.d.ts +71 -0
- package/dist/components/popconfirm/Popconfirm.js +1 -0
- package/dist/components/popconfirm/index.d.ts +2 -0
- package/dist/components/popconfirm/index.js +1 -0
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/portal/Portal.d.ts +48 -0
- package/dist/components/portal/Portal.js +1 -0
- package/dist/components/portal/index.d.ts +2 -0
- package/dist/components/portal/index.js +1 -0
- package/dist/components/progress-box/ProgressBox.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- package/dist/components/provider/NebaProvider.d.ts +99 -0
- package/dist/components/provider/NebaProvider.js +1 -0
- package/dist/components/provider/index.d.ts +3 -0
- package/dist/components/provider/index.js +1 -0
- package/dist/components/rating/Rating.js +1 -1
- package/dist/components/scatter-chart/ScatterChart.d.ts +1 -1
- package/dist/components/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scroll-area/ScrollArea.js +1 -1
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/shortcut/Shortcut.d.ts +2 -1
- package/dist/components/shortcut/Shortcut.js +1 -1
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/sidebar/SidebarTrigger.js +1 -1
- package/dist/components/skeleton/Skeleton.js +1 -1
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/sparkline/Sparkline.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/statistic/Statistic.js +1 -1
- package/dist/components/switch/Switch.js +1 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +1 -1
- package/dist/components/text-field/TextField.d.ts +12 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/text-link/TextLink.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.d.ts +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/toggle-group/ToggleGroup.js +1 -1
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/tooltip/Tooltip.js +1 -1
- package/dist/components/tour/Tour.d.ts +1 -1
- package/dist/components/tour/Tour.js +1 -1
- package/dist/components/transfer/Transfer.js +1 -1
- package/dist/components/tree-select/TreeSelect.d.ts +88 -0
- package/dist/components/tree-select/TreeSelect.js +1 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +1 -0
- package/dist/components/tree-view/TreeView.js +1 -1
- package/dist/components/visually-hidden/VisuallyHidden.d.ts +37 -0
- package/dist/components/visually-hidden/VisuallyHidden.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +2 -0
- package/dist/components/visually-hidden/index.js +1 -0
- package/dist/components/window-pane/WindowPane.js +1 -1
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDisclosure.d.ts +21 -0
- package/dist/hooks/useDisclosure.js +1 -0
- package/dist/hooks/useElementSize.d.ts +23 -0
- package/dist/hooks/useElementSize.js +1 -0
- package/dist/hooks/useMediaQuery.d.ts +27 -0
- package/dist/hooks/useMediaQuery.js +1 -0
- package/dist/hooks/useOnScreen.d.ts +24 -0
- package/dist/hooks/useOnScreen.js +1 -0
- package/dist/hooks/useShortcut.d.ts +34 -0
- package/dist/hooks/useShortcut.js +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/internal/calendar.d.ts +31 -5
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/csv.d.ts +40 -0
- package/dist/internal/csv.js +1 -0
- package/dist/internal/date.d.ts +39 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/defaults.d.ts +46 -0
- package/dist/internal/defaults.js +1 -0
- package/dist/internal/i18n.d.ts +23 -0
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/keys.d.ts +92 -0
- package/dist/internal/keys.js +1 -0
- package/dist/internal/media.d.ts +27 -0
- package/dist/internal/media.js +1 -1
- package/dist/internal/page-layout.d.ts +7 -0
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +7 -1
- package/dist/internal/picker.js +1 -1
- package/dist/locales/ar.js +1 -1
- package/dist/locales/de.js +1 -1
- package/dist/locales/es.js +1 -1
- package/dist/locales/fr.js +1 -1
- package/dist/locales/hi.js +1 -1
- package/dist/locales/id.js +1 -1
- package/dist/locales/it.js +1 -1
- package/dist/locales/ja.js +1 -1
- package/dist/locales/ko.js +1 -1
- package/dist/locales/nl.js +1 -1
- package/dist/locales/pl.js +1 -1
- package/dist/locales/pt.js +1 -1
- package/dist/locales/ru.js +1 -1
- package/dist/locales/th.js +1 -1
- package/dist/locales/tr.js +1 -1
- package/dist/locales/vi.js +1 -1
- package/dist/locales/zh-hans.js +1 -1
- package/dist/locales/zh-hant.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +34 -0
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -125,6 +125,36 @@ A registered language costs about 1.9 kB gzipped and you pay only for the ones y
|
|
|
125
125
|
|
|
126
126
|
Anything the platform already knows — month names, weekday names, AM/PM, number and date formats — comes from `Intl` and needs no registration. And every string a component invents also has a prop that overrides it, so a language Neba does not carry is never a dead end.
|
|
127
127
|
|
|
128
|
+
### One place for your defaults
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import { NebaProvider } from 'neba';
|
|
132
|
+
|
|
133
|
+
<NebaProvider
|
|
134
|
+
defaults={{ size: 'sm', density: 'compact', locale: 'ko' }}
|
|
135
|
+
defaultColorScheme="system"
|
|
136
|
+
>
|
|
137
|
+
<App />
|
|
138
|
+
</NebaProvider>;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Optional, and every component works without it. It fills in `size`, `density`, `variant` and `locale` where a call site left them out — the call site always wins — owns the colour scheme (`useColorScheme()`, plus a `colorSchemeScript()` for the first-paint flash), and sets the writing direction. `color` and `elevation` are deliberately not defaultable; [the guide](https://neba.cdget.com/guide/provider) says why.
|
|
142
|
+
|
|
143
|
+
### Hooks
|
|
144
|
+
|
|
145
|
+
The hooks the components already run on, from `neba/hooks` (or from the package root):
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
import { useDisclosure, useBreakpoint, useShortcut } from 'neba/hooks';
|
|
149
|
+
|
|
150
|
+
const { open, onOpen, setOpen } = useDisclosure();
|
|
151
|
+
const desktop = useBreakpoint('lg');
|
|
152
|
+
|
|
153
|
+
useShortcut('Mod+K', onOpen);
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
`useDisclosure`, `useMediaQuery`, `useBreakpoint`, `usePrefersReducedMotion`, `useElementSize`, `useOnScreen`, `useShortcut`. Everything here is machinery the library needed for itself — there is no general-purpose hook collection, and there is not going to be one. Full notes in [the hooks guide](https://neba.cdget.com/guide/hooks).
|
|
157
|
+
|
|
128
158
|
### The shared prop vocabulary
|
|
129
159
|
|
|
130
160
|
The reason a Neba screen looks composed rather than assembled is that the props mean one thing across the library. They live in [`src/types.ts`](src/types.ts) and every component draws from the same list:
|
|
@@ -146,21 +176,21 @@ Placement props are logical, not physical — `start`/`end` rather than `left`/`
|
|
|
146
176
|
|
|
147
177
|
### Components
|
|
148
178
|
|
|
149
|
-
**Inputs** — Button, IconButton, ButtonGroup, SegmentedButton, Toggle, ToggleGroup, Form, Fieldset, FloatingActionButton (with FloatingAction), TextField, NumberField, OtpField, Select, Combobox, Checkbox, RadioGroup, Switch, Slider, Rating, Menu (with submenus, checkbox and radio items), ContextMenu, Menubar, NavigationMenu, CommandPalette, FilePicker, Transfer, Pagination, BottomNavigation, FloatingBottomNavigation, ColorPicker, DatePicker, TimePicker, DateTimePicker, DateRangePicker
|
|
179
|
+
**Inputs** — Button, IconButton, ButtonGroup, SegmentedButton, Toggle, ToggleGroup, Form, Fieldset, FloatingActionButton (with FloatingAction), TextField, NumberField, OtpField, Select, Combobox, TreeSelect, Checkbox, RadioGroup, Switch, Slider, Rating, Menu (with submenus, checkbox and radio items), ContextMenu, Menubar, NavigationMenu, CommandPalette, FilePicker, Transfer, Pagination, BottomNavigation, FloatingBottomNavigation, ColorPicker, Calendar, DatePicker, TimePicker, DateTimePicker, DateRangePicker
|
|
150
180
|
|
|
151
181
|
**Surfaces** — Box, Card, Accordion, Collapsible, Tabs, Carousel, Toolbar, Pill, Spoiler, HowToSteps, ChatBubble, Drawer, Popover, Mockup, WindowPane, HoverCard
|
|
152
182
|
|
|
153
|
-
**Display** — Typography, TextLink, Blockquote, Highlight, Divider, Chip, Badge, Avatar, AvatarGroup, AppLogo, Icon, Shortcut, List, DataList, Table, DataTable, CodeBlock, Timeline, Breadcrumb, Anchor, TreeView
|
|
183
|
+
**Display** — Typography, TextLink, Blockquote, Highlight, Divider, Chip, Badge, Avatar, AvatarGroup, AppLogo, Icon, Image, Shortcut, List, DataList, Table, DataTable, CodeBlock, Timeline, Breadcrumb, Anchor, TreeView, VisuallyHidden
|
|
154
184
|
|
|
155
185
|
**Charts** — Statistic, Sparkline, LineChart, AreaChart, BarChart, PieChart, ScatterChart, TimelineChart, HeatmapChart, GaugeChart
|
|
156
186
|
|
|
157
|
-
**Feedback** — Alert, Dialog, Toast, Tooltip, Overlay, Skeleton, Empty, ProgressLinear, ProgressCircular, ProgressBox, Meter, Tour
|
|
187
|
+
**Feedback** — Alert, Dialog, Confirm, Popconfirm, Toast, Tooltip, Overlay, Skeleton, Empty, ProgressLinear, ProgressCircular, ProgressBox, Meter, Tour
|
|
158
188
|
|
|
159
|
-
**Layout** — PageLayout (with Header, Footer and Sidebar), Container, Grid (with GridContainer), Panes, AspectRatio, ScrollZone, ScrollArea
|
|
189
|
+
**Layout** — PageLayout (with Header, Footer and Sidebar), Container, Grid (with GridContainer), Panes, AspectRatio, Portal, ScrollZone, ScrollArea
|
|
160
190
|
|
|
161
191
|
**Transitions** — AnimateFade, AnimateGrow, AnimateZoom, AnimateSlide, AnimateRotate, AnimateBlink, AnimateAppear, AnimateTyping, AnimateLighting, AnimateMarquee, AnimateHeadline
|
|
162
192
|
|
|
163
|
-
**Recently added** — GaugeChart, CommandPalette, Tour, Transfer, Anchor, DataList, AvatarGroup, NavigationMenu, Menubar, Form (with Fieldset), ScrollArea, HoverCard, Meter, Toggle (with ToggleGroup), CodeBlock, HowToSteps, ScrollZone, FloatingBottomNavigation, WindowPane, Collapsible, Rating, BottomNavigation, FloatingActionButton, the charts (Sparkline, LineChart, AreaChart, BarChart, PieChart, ScatterChart, TimelineChart, HeatmapChart), DataTable, Empty, Mockup, the eleven `Animate*` wrappers, ColorPicker, Drawer, Popover, Skeleton, AspectRatio
|
|
193
|
+
**Recently added** — TreeSelect, Calendar, Image, Confirm, Popconfirm, VisuallyHidden, Portal, GaugeChart, CommandPalette, Tour, Transfer, Anchor, DataList, AvatarGroup, NavigationMenu, Menubar, Form (with Fieldset), ScrollArea, HoverCard, Meter, Toggle (with ToggleGroup), CodeBlock, HowToSteps, ScrollZone, FloatingBottomNavigation, WindowPane, Collapsible, Rating, BottomNavigation, FloatingActionButton, the charts (Sparkline, LineChart, AreaChart, BarChart, PieChart, ScatterChart, TimelineChart, HeatmapChart), DataTable, Empty, Mockup, the eleven `Animate*` wrappers, ColorPicker, Drawer, Popover, Skeleton, AspectRatio
|
|
164
194
|
|
|
165
195
|
Each one has its own page — live previews, every prop, and the variations worth seeing — under [**All components**](https://neba.cdget.com/components/).
|
|
166
196
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Accordion as t}from"@base-ui/react/accordion";import{boxPaddingXClasses as l,boxPaddingYClasses as r}from"../box/Box.js";import{ChevronIcon as
|
|
1
|
+
"use client";import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as a from"react";import{Accordion as t}from"@base-ui/react/accordion";import{boxPaddingXClasses as l,boxPaddingYClasses as r}from"../box/Box.js";import{ChevronIcon as i}from"../../internal/icons.js";import{cx as s,focusRingClasses as o,gapClasses as d,hasContent as c,iconClasses as m,metaTextClasses as f,radiusClasses as u,sheetBodyClasses as h,sheetHeaderGapClasses as b,sheetTitleClasses as x,surfaceClasses as p,surfaceSlots as v,transitionClasses as g}from"../../internal/styles.js";import{useStyleDefaults as N}from"../../internal/defaults.js";const j=/*@__PURE__*/a.createContext({size:"md",density:"default",dividers:!0}),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:u.xs,sm:u.xs,md:u.sm,lg:u.sm,xl:u.md};export const Accordion=/*@__PURE__*/a.forwardRef(function(n,l){const{variant:r="outline",size:i="md",color:o="primary",density:d="default",elevation:c=0,multiple:m=!1,value:f,defaultValue:h,onValueChange:b,dividers:x=!0,disabled:p=!1,hiddenUntilFound:w=!1,keepMounted:k=!1,className:z,style:C,children:V,...$}=N(n,["size","density","variant"]),_=a.useMemo(()=>({size:i,density:d,dividers:x}),[i,d,x]),A=s("flex flex-col",u[i],y[r],g,x?"overflow-hidden [&>div+div]:border-t [&>div+div]:[border-color:var(--n-line)]":"p-1",z??"");return e(j.Provider,{value:_,children:e(t.Root,{ref:l,multiple:m,value:f,defaultValue:h,onValueChange:e=>b?.(e),disabled:p,hiddenUntilFound:w,keepMounted:k,className:A,style:{...v(o,c),...C},...$,children:V})})});export const AccordionItem=/*@__PURE__*/a.forwardRef(function({value:u,title:p,subtitle:v,startIcon:N,action:y,disabled:k=!1,className:z,children:C,...V},$){const{size:_,density:A,dividers:I}=a.useContext(j),M=l[A][_],R=r[A][_];return n(t.Item,{ref:$,value:u,disabled:k,className:s("flex flex-col",z??""),...V,children:[n(t.Header,{className:"m-0 flex w-full items-center [font:inherit]",children:[n(t.Trigger,{className:s("flex min-w-0 flex-1 cursor-pointer items-center text-start",M,R,d[_],g,m,o,I?"":w[_],"hover:bg-(--n-soft)","data-[panel-open]:text-(--n-accent)","disabled:cursor-not-allowed disabled:bg-transparent disabled:text-(--neba-disabled-fg)"),children:[c(N)?e("span",{className:"flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)",children:N}):null,n("span",{className:`flex min-w-0 flex-1 flex-col ${b[_]}`,children:[c(p)?e("span",{className:`truncate font-semibold ${x[_]}`,children:p}):null,c(v)?e("span",{className:`truncate text-(--neba-muted-fg) ${f[_]}`,children:v}):null]}),e("span",{className:["flex h-[1lh] shrink-0 items-center text-(--neba-muted-fg)","[transition:rotate_var(--neba-duration)_var(--neba-ease)]","data-[panel-open]:rotate-180"].join(" "),children:e(i,{})})]}),c(y)?e("span",{className:`flex shrink-0 items-center ${M}`,children:y}):null]}),e(t.Panel,{className:["h-(--accordion-panel-height) overflow-hidden","[transition:height_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:h-0 data-[ending-style]:h-0"].join(" "),children:e("div",{className:["text-(--neba-muted-fg)",h[_],M,"compact"===A?"pb-2":"pb-4"].join(" "),children:C})})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{boxPaddingClasses as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as n from"react";import{boxPaddingClasses as i}from"../box/Box.js";import{actionMessages as l,useMessages as s}from"../../internal/i18n.js";import{CloseIcon as a,severityIcon as o}from"../../internal/icons.js";import{transitionProps as r}from"../../internal/animate.js";import{controlSlots as c,cx as d,hasContent as m,iconClasses as f,radiusClasses as u,sheetBodyClasses as x,sheetHeaderGapClasses as b,sheetSectionGapClasses as v,sheetTitleClasses as p,surfaceClasses as h,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as j}from"../../internal/defaults.js";const g={solid:[h,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[h,"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)"},N={solid:"",outline:"text-(--n-accent)",text:"text-(--n-accent)"},w={solid:"",outline:"text-(--neba-muted-fg)",text:"text-(--neba-muted-fg)"},k={primary:"status",secondary:"status",info:"status",success:"status",warning:"alert",danger:"alert"};export const Alert=/*@__PURE__*/n.forwardRef(function(n,h){const{variant:$="outline",size:_="md",color:z="info",density:C="default",elevation:A=0,title:B,icon:L,action:R,onClose:q,locale:D,closeLabel:E,transition:F,className:G,style:H,children:I,...J}=j(n,["size","density","variant","locale"]),K=s(l,D),M=void 0===L?o(z):L,O=N[$],P=m(B),Q=r(F);return t("div",{ref:h,role:k[z],className:d("flex w-full items-start",i[C][_],u[_],v[_],x[_],y,g[$],f,Q.className,G??""),style:{...c(z,A,$),...Q.style,...H},...J,children:[m(M)?e("span",{className:`flex h-[1lh] shrink-0 items-center ${O}`,children:M}):null,t("div",{className:`flex min-w-0 flex-1 flex-col ${b[_]}`,children:[P?e("div",{className:`neba-title font-semibold ${p[_]} ${O}`,children:B}):null,m(I)?e("div",{className:P?w[$]:void 0,children:I}):null]}),m(R)?e("div",{className:"flex h-[1lh] shrink-0 items-center",children:R}):null,q?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e("button",{type:"button","aria-label":E??K.dismiss,onClick:q,className:["inline-flex size-[1.15em] cursor-pointer items-center justify-center rounded-full","opacity-70 [transition:opacity_var(--neba-duration)_var(--neba-ease)]","hover:opacity-100 focus-visible:opacity-100","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),children:e(a,{})})}):null]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{anchorMessages as r,useMessages as t}from"../../internal/i18n.js";import{controlTextLeadingClasses as o,cx as a,focusRingClasses as l,transitionClasses as i}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as n from"react";import{anchorMessages as r,useMessages as t}from"../../internal/i18n.js";import{controlTextLeadingClasses as o,cx as a,focusRingClasses as l,transitionClasses as i}from"../../internal/styles.js";import{useStyleDefaults as c}from"../../internal/defaults.js";const s={default:{xs:"py-1",sm:"py-1",md:"py-1.5",lg:"py-1.5",xl:"py-2"},compact:{xs:"py-0.5",sm:"py-0.5",md:"py-1",lg:"py-1",xl:"py-1"}},m={xs:8,sm:10,md:12,lg:14,xl:16},d=["block min-w-0 truncate no-underline","text-(--neba-muted-fg)",i,l,"hover:text-(--neba-fg)","aria-[current=location]:font-medium aria-[current=location]:text-(--n-accent)"].join(" "),u=["border-s [border-color:transparent]","[transition:border-color_var(--neba-duration)_var(--neba-ease)]","aria-[current=location]:[border-color:var(--n-accent)]"].join(" ");export const Anchor=/*@__PURE__*/n.forwardRef(function(l,i){const{items:f,activeHref:p,onActiveChange:h,offset:g=0,container:v,rail:b=!0,size:y="md",color:x="primary",density:w="default",locale:j,label:E,className:H,style:N,...R}=c(l,["size","density","locale"]),z=t(r,j),[A,L]=n.useState(null),B=void 0!==p,C=B?p:A,$=n.useRef(h);$.current=h;const F=n.useRef(f);F.current=f;const I=f.map(e=>e.href).join("\0");return n.useEffect(()=>{if(B)return;const e=v?.current??window;let n=0,r=null;const t=()=>{n=0;const e=function(e,n,r){const t=(r?r.getBoundingClientRect().top:0)+n+1;let o=null;for(const n of e){const e=document.getElementById(n.href.replace(/^#/,""));e&&e.getBoundingClientRect().top<=t&&(o=n.href)}return(r?r.scrollTop+r.clientHeight>=r.scrollHeight-2:window.innerHeight+window.scrollY>=document.documentElement.scrollHeight-2)&&e.length>0?e[e.length-1].href:o}(F.current,g,v?.current??null);e!==r&&(r=e,L(e),$.current?.(e))},o=()=>{0===n&&(n=requestAnimationFrame(t))};return t(),e.addEventListener("scroll",o,{passive:!0}),window.addEventListener("resize",o,{passive:!0}),()=>{0!==n&&cancelAnimationFrame(n),e.removeEventListener("scroll",o),window.removeEventListener("resize",o)}},[I,g,v,B]),e("nav",{ref:i,"aria-label":E??z.label,className:a("min-w-0",H??""),style:{"--n-accent":`var(--neba-${x}-accent)`,"--n-ring":`var(--neba-${x}-ring)`,...N},...R,children:e("ul",{className:a("m-0 flex list-none flex-col p-0",b?"border-s [border-color:var(--neba-border)]":""),children:f.map(n=>e("li",{className:b?"[margin-inline-start:-1px]":"",children:e("a",{href:n.href,"aria-current":C===n.href?"location":void 0,className:a(d,o[y],s[w][y],b?`${u} ps-3`:""),style:{marginInlineStart:n.depth?n.depth*m[y]:void 0},children:n.label})},n.href))})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as n,useAnimateElement as a}from"../../internal/animate.js";import{cx as t,radiusClasses as i}from"../../internal/styles.js";export const AnimateLighting=/*@__PURE__*/e.forwardRef(function({duration:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as n,useAnimateElement as a}from"../../internal/animate.js";import{cx as t,radiusClasses as i}from"../../internal/styles.js";import{useStyleDefaults as o}from"../../internal/defaults.js";export const AnimateLighting=/*@__PURE__*/e.forwardRef(function(e,l){const{duration:s=3e3,delay:m=0,easing:d,repeat:p="infinite",alternate:c,paused:g,trigger:f="mount",play:u,once:h=!0,threshold:y=.2,color:w="primary",glow:b,size:$="md",spread:j=3,arc:x=50,blur:v=4,reverse:z=!1,render:N,className:A,style:L,children:R,...k}=o(e,["size"]),q=a({effect:null,duration:s,delay:m,easing:d,repeat:p,alternate:c,mode:z?"out":"in",trigger:f,play:u,once:h,threshold:y,paused:g,infinite:n(p)});return r({render:N,ref:[l,q.ref],props:{...k,className:t("neba-anim-lighting",i[$],A),style:{...q.style,"--n-anim-glow":b??`var(--neba-${w}-accent)`,"--n-anim-glow-width":`${j}px`,"--n-anim-glow-arc":`${x}deg`,"--n-anim-glow-blur":`${v}px`,...L},...q.props,"data-neba-animation":"lighting",children:R}})});
|
|
@@ -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 s}from"@base-ui/react/use-render";import{initialsOf as a}from"../../internal/initials.js";import{controlHeightClasses as l,controlSlots as i,controlSquareClasses as o,cx as m,gapClasses as d,hasContent as c,srOnlyClasses as u,surfaceClasses as x,toLength as f,transitionClasses as g}from"../../internal/styles.js";const
|
|
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 s}from"@base-ui/react/use-render";import{initialsOf as a}from"../../internal/initials.js";import{controlHeightClasses as l,controlSlots as i,controlSquareClasses as o,cx as m,gapClasses as d,hasContent as c,srOnlyClasses as u,surfaceClasses as x,toLength as f,transitionClasses as g}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";const p={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.375rem]",xl:"text-[1.625rem]"},v={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.3125rem]",xl:"text-[1.5625rem]"},b={xs:"rounded-[0.375rem]",sm:"rounded-[0.4375rem]",md:"rounded-[0.5625rem]",lg:"rounded-[0.6875rem]",xl:"rounded-[0.875rem]"},w={solid:[x,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[x,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-(--n-soft-press) [box-shadow:var(--n-elev)]"};export const AppLogo=/*@__PURE__*/t.forwardRef(function(t,x){const{src:j,srcSet:_,alt:y,name:N,initials:k,showName:z=!1,shape:S="bare",variant:A="solid",size:F="md",color:L="primary",elevation:P=0,padded:R=!0,height:$,href:q,imageProps:B,render:C,className:D,style:E,children:G,...H}=h(t,["size","variant"]),I="bare"!==S,J=c(G)?G:j?"image":null,K=I&&R,M=null===J&&!I,O=z&&!M&&c(N),Q=y??N,T=k??(N?a(N):""),U="image"===J&&!O&&c(Q),V=M||U,W=!V&&!O&&c(Q),X=f($),Y=X?{height:X,width:I?X:void 0}:null,Z=e("span",{"aria-hidden":!V||void 0,className:m("flex shrink-0 items-center justify-center overflow-hidden","font-semibold tracking-tight whitespace-nowrap",X?"":l[F],I?m(X?"":o[F],"circle"===S?"rounded-full":b[F],v[F],w[A]):m("w-auto text-(--neba-fg)",p[F]),"[&_svg]:w-auto [&_svg]:shrink-0",K?"[&_svg]:h-[72%] [&_svg]:max-w-[72%]":"[&_svg]:h-full [&_svg]:max-w-full",g),style:{...I?i(L,P,A):null,...Y},children:"image"===J?e("img",{src:j,srcSet:_,alt:U?Q??"":"",className:m("w-auto object-contain",K?"h-[72%] max-w-[72%]":"h-full max-w-full"),decoding:"async",...B}):J??(M?N:T)});return s({render:C??e(q?"a":"span",{}),ref:x,props:{href:q,className:m("inline-flex max-w-full min-w-0 items-center align-middle","text-(--neba-fg) no-underline select-none",d[F],q?"cursor-pointer rounded-(--neba-radius-sm)":"",q?"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2":"",D),style:{"--n-ring":`var(--neba-${L}-ring)`,...E},children:n(r,{children:[Z,O?e("span",{className:m("min-w-0 truncate font-semibold",p[F]),children:N}):null,W?e("span",{className:u,children:Q}):null]}),...H}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as i}from"@base-ui/react/use-render";import{cx as o,radiusClasses as t}from"../../internal/styles.js";const c=["[&>img]:size-full","[&>video]:size-full","[&>canvas]:size-full","[&>svg]:size-full","[&>iframe]:size-full","[&>picture]:size-full","[&>picture>img]:size-full"].join(" "),
|
|
1
|
+
"use client";import*as e from"react";import{useRender as i}from"@base-ui/react/use-render";import{cx as o,radiusClasses as t}from"../../internal/styles.js";import{useStyleDefaults as r}from"../../internal/defaults.js";const c=["[&>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 [&>picture>img]:object-cover",contain:"[&>img]:object-contain [&>video]:object-contain [&>picture>img]:object-contain",fill:"[&>img]:object-fill [&>video]:object-fill [&>picture>img]:object-fill",none:"[&>img]:object-none [&>video]:object-none [&>picture>img]:object-none"};export const AspectRatio=/*@__PURE__*/e.forwardRef(function(e,n){const{ratio:s=1,fit:a="cover",rounded:f=!1,size:m="md",render:u,className:d,style:j,children:p,...b}=r(e,["size"]),v=o("relative block w-full overflow-hidden",c,l[a],f?t[m]:"",d??"");return i({render:u,ref:n,props:{className:v,style:{aspectRatio:s,...j},children:p,...b}})});
|
|
@@ -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 a from"react";import{Avatar as n}from"@base-ui/react/avatar";import{transitionProps as r}from"../../internal/animate.js";import{AvatarGroupContext as o}from"../../internal/avatar-group.js";import{initialsOf as s}from"../../internal/initials.js";import{controlHeightClasses as i,controlSlots as l,controlSquareClasses as d,cx as c,hasContent as m,srOnlyClasses as f,surfaceClasses as u,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const p={xs:"text-[0.5625rem]",sm:"text-[0.6875rem]",md:"text-[0.8125rem]",lg:"text-[1rem]",xl:"text-[1.1875rem]"},h={xs:"rounded-[0.375rem]",sm:"rounded-[0.4375rem]",md:"rounded-[0.5625rem]",lg:"rounded-[0.6875rem]",xl:"rounded-[0.875rem]"},g={solid:[u,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev)]"].join(" "),outline:[u,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev)]"].join(" "),text:"text-(--n-accent) bg-(--n-soft-press) [box-shadow:var(--n-elev)]"},b="after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]",j={solid:`${b} after:[box-shadow:var(--neba-plate-solid)]`,outline:`${b} 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 y(){return t("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:[e("path",{d:"M12 12a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9Z"}),e("path",{d:"M12 14.25c-4.28 0-7.75 2.42-7.75 5.4 0 .75.6 1.35 1.35 1.35h12.8c.75 0 1.35-.6 1.35-1.35 0-2.98-3.47-5.4-7.75-5.4Z"})]})}export const Avatar=/*@__PURE__*/a.forwardRef(function(u,v){const{src:b,srcSet:N,alt:z,name:C,initials:S,shape:k,variant:A,size:B,color:L,elevation:M,delay:R,imageProps:Z,onLoadingStatusChange:$,transition:_,className:F,style:I,children:P,...q}=x(u,["size","variant"]),D=a.useContext(o),E=k??D?.shape??"circle",G=A??D?.variant??"text",H=B??D?.size??"md",J=L??D?.color??"primary",K=M??D?.elevation??0,O=C?s(C):"",Q=r(_),T=z??C,U=m(P)?P:(S??O)||e(y,{}),V=m(P)||Boolean(S??O),W=c(w,i[H],d[H],p[H],"circle"===E?"rounded-full":h[H],g[G],j[G],Q.className,F??"");return t(n.Root,{ref:v,className:W,style:{...l(J,K,G),...Q.style,...I},...q,children:[b?e(n.Image,{src:b,srcSet:N,alt:T??"",className:"size-full object-cover",decoding:"async",onLoadingStatusChange:$,...Z}):null,t(n.Fallback,{delay:b?R:void 0,className:"flex size-full items-center justify-center",children:[T&&V?e("span",{className:f,children:T}):null,e("span",{"aria-hidden":!(!T||!V)||void 0,className:"contents",children:U})]})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{Avatar as t}from"../avatar/Avatar.js";import{AvatarGroupContext as i}from"../../internal/avatar-group.js";import{cx as n}from"../../internal/styles.js";const l={xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.75rem",xl:"0.875rem"};export const AvatarGroup=/*@__PURE__*/a.forwardRef(function({max:
|
|
1
|
+
"use client";import{jsx as r,jsxs as e}from"react/jsx-runtime";import*as a from"react";import{Avatar as t}from"../avatar/Avatar.js";import{AvatarGroupContext as i}from"../../internal/avatar-group.js";import{cx as n}from"../../internal/styles.js";import{useStyleDefaults as s}from"../../internal/defaults.js";const l={xs:"0.375rem",sm:"0.5rem",md:"0.625rem",lg:"0.75rem",xl:"0.875rem"};export const AvatarGroup=/*@__PURE__*/a.forwardRef(function(o,m){const{max:c,total:v,overlap:p,size:f="md",shape:d="circle",variant:u="text",color:x="primary",elevation:h=0,className:g,style:j,children:y,...z}=s(o,["size","variant"]),A=a.useMemo(()=>({size:f,shape:d,variant:u,color:x,elevation:h}),[f,d,u,x,h]),M=a.Children.toArray(y),b=void 0===c?M:M.slice(0,Math.max(0,c)),N=v??M.length,$=Math.max(0,N-b.length);return r(i.Provider,{value:A,children:e("div",{ref:m,className:n("isolate inline-flex items-center","[&>*:not(:first-child)]:[margin-inline-start:calc(var(--n-overlap)*-1)]","[&>*]:ring-2 [&>*]:ring-(--neba-surface)",g??""),style:{"--n-overlap":void 0===p?l[f]:"number"==typeof p?`${p}px`:p,...j},...z,children:[b,$>0?r(t,{initials:`+${$}`}):null]})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as m}from"react/jsx-runtime";import*as s from"react";import{controlSlots as n,cx as
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as m}from"react/jsx-runtime";import*as s from"react";import{controlSlots as n,cx as a,hasContent as o,srOnlyClasses as l,surfaceClasses as i,transitionClasses as r}from"../../internal/styles.js";import{useStyleDefaults as d}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"},x={xs:"size-1.5",sm:"size-2",md:"size-2.5",lg:"size-2.5",xl:"size-3"},p={xs:"text-[0.5625rem]",sm:"text-[0.625rem]",md:"text-[0.6875rem]",lg:"text-[0.75rem]",xl:"text-[0.8125rem]"},c={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"}},u={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"},g={"top-start":"mt-[7%] ms-[7%]","top-end":"mt-[7%] me-[7%]","bottom-start":"mb-[7%] ms-[7%]","bottom-end":"mb-[7%] me-[7%]"},h={solid:[i,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[i,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-(--n-soft-press)"};export const Badge=/*@__PURE__*/s.forwardRef(function(s,i){const{variant:v="solid",size:w="md",color:j="primary",density:y="default",elevation:z=0,content:N,max:k=99,dot:$=!1,showZero:q=!1,invisible:B=!1,placement:F="top-end",overlap:R="square",label:Z,className:A,style:C,children:D,...E}=d(s,["size","density","variant"]),G=o(D),H=!o(N)||0===N&&!q,I=$||H,J=B||H&&!$,K=a("pointer-events-none z-10 inline-flex shrink-0 items-center justify-center","font-semibold tabular-nums whitespace-nowrap","rounded-full",r,h[v],I?x[w]:[b[w],p[w],c[y][w]].join(" "),G?`absolute ${f[F]}`:"relative align-middle",G?I?u[w].dot:u[w].badge:"",G&&"circle"===R?g[F]:"",J?"invisible":"",A??""),L=function(e,t){return"number"==typeof e&&e>t?`${t}+`:e}(N,k),M=e("span",{ref:i,className:K,style:{...n(j,z,v),...C},"aria-hidden":!!J||void 0,...E,children:J?null:m(t,{children:[I||Z?e("span",{className:l,children:Z??L}):null,I?null:e("span",{"aria-hidden":!!Z||void 0,children:L})]})});return G?m("span",{className:"relative inline-flex shrink-0 align-middle",children:[D,M]}):M});
|
|
@@ -60,4 +60,4 @@ export interface BarChartProps extends CartesianChartProps {
|
|
|
60
60
|
* is this total made of". They are different questions and the chart should be
|
|
61
61
|
* asked only one of them at a time.
|
|
62
62
|
*/
|
|
63
|
-
export declare function BarChart(
|
|
63
|
+
export declare function BarChart(rawProps: BarChartProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as n}from"../../internal/chart-frame.js";import{barBandRatio as l,barMaxThickness as r,barPath as o,barRadius as i,chartFontSizes as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as n}from"../../internal/chart-frame.js";import{barBandRatio as l,barMaxThickness as r,barPath as o,barRadius as i,chartFontSizes as s,markGap as u,toValues as c}from"../../internal/chart.js";import{useStyleDefaults as d}from"../../internal/defaults.js";export function BarChart(t){const{orientation:o="vertical",stacked:i=!1,rounded:s=!0,barSize:u,valueLabels:m="none",series:f,yAxis:v,size:x="md",density:b="default",...p}=d(t,["size","density"]),y="horizontal"===o,z="full"===i,g=a.useMemo(()=>{if(!z)return f;const e=c(f),t=[];for(const a of e)a.forEach((e,a)=>{t[a]=(t[a]??0)+Math.abs(e.value??0)});return f.map((a,n)=>({...a,data:e[n].map((e,a)=>{if(null===e.value)return null;const n=t[a];return{x:e.x,y:0===n?0:e.value/n*100,color:e.color,label:e.label??String(e.value)}})}))},[f,z]);return e(n,{...p,series:g,size:x,density:b,horizontal:y,stacked:!1!==i,yAxis:z?{min:0,max:100,tickFormat:e=>`${e}%`,...v}:v,includeZero:!0,bandRatio:l[b],headroom:"none"===m?0:12,children:t=>e(h,{context:t,stacked:!1!==i,rounded:s,barSize:u??r[x],valueLabels:m,size:x})})}function h({context:a,stacked:n,rounded:l,barSize:r,valueLabels:c,size:d}){const{values:h,visible:f,colors:v,hovered:x,activeIndex:b,plot:p,band:y,horizontal:z,valuePx:g,categoryPx:M,zeroPx:k,format:j}=a,S=h.map((e,t)=>({one:e,index:t})).filter(e=>f[e.index]),A=n?1:Math.max(1,S.length),L=Math.min(r,Math.max(1,(y.band-u*(A-1))/A)),P=L*A+u*(A-1),W=[],w=[],B=s[d];return t("g",{children:[S.map(({one:a,index:r},s)=>{const d=v[r];return e("g",{opacity:null!==x&&x!==r?.28:1,children:a.map((r,h)=>{if(null===r.value)return null;const f=M(h),v=n?0:s*(L+u)-P/2+L/2,x=n?r.value>=0?W[h]??0:w[h]??0:0,y=g(x),k=g(x+r.value);n&&(r.value>=0?W[h]=x+r.value:w[h]=x+r.value);const S=n&&0!==x?u:0,A=Math.abs(k-y)-S;if(A<=0)return null;const C=k<y,E=h===b,F=z?o(Math.min(y,k)+(C?0:S),p.top+f+v-L/2,A,L,l&&!n?i:l?i/2:0,r.value>=0?"right":"left"):o(p.left+f+v-L/2,Math.min(y,k)+(C?0:S),L,A,l&&!n?i:l?i/2:0,r.value>=0?"up":"down");return t("g",{children:[e("path",{d:F,fill:r.color??d,opacity:E?1:.92}),"none"===c||"extremes"===c&&!m(a,h)||"last"===c&&h!==a.length-1?null:e("text",{x:z?k+(r.value>=0?5:-5):p.left+f+v,y:z?p.top+f+v:r.value>=0?k-5:k+B+2,textAnchor:z?r.value>=0?"start":"end":"middle",dominantBaseline:z?"central":void 0,fontSize:B,fontWeight:500,fill:"var(--neba-fg)",className:"tabular-nums",children:r.label??j(r.value)})]},h)})},r)}),e("line",z?{x1:k,x2:k,y1:p.top,y2:p.top+p.height,stroke:"var(--neba-chart-baseline)",strokeWidth:1}:{x1:p.left,x2:p.left+p.width,y1:k,y2:k,stroke:"var(--neba-chart-baseline)",strokeWidth:1})]})}function m(e,t){const a=e[t].value;if(null===a)return!1;let n=1/0,l=-1/0;for(const t of e)null!==t.value&&(n=Math.min(n,t.value),l=Math.max(l,t.value));return a===n||a===l}
|
|
@@ -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 s,metaTextClasses as i,radiusClasses as o,surfaceClasses as c,surfaceSlots as m,transitionClasses as d}from"../../internal/styles.js";const x={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]"},
|
|
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 s,metaTextClasses as i,radiusClasses as o,surfaceClasses as c,surfaceSlots as m,transitionClasses as d}from"../../internal/styles.js";import{useStyleDefaults as f}from"../../internal/defaults.js";const x={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]"},u={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 p(){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(t,c){const{variant:b="text",size:h="md",color:v="primary",density:g="default",elevation:j=0,author:N,source:y,cite:w,icon:z,transition:k,className:B,style:q,children:M,...Z}=f(t,["size","density","variant"]),C=a(k),R=s(N)||s(y),$=void 0===z?e(p,{}):z,A=l("flex flex-col text-(--neba-fg)","border-s-2 [border-inline-start-color:var(--n-accent)]","text"===b?"":`${o[h]} rounded-s-none`,u[b],n[g][h],d,C.className,B??""),D=r("blockquote",{cite:w,className:x[h],children:[s($)?e("span",{"aria-hidden":"true",className:"mb-1 block size-[2em] text-(--n-soft-press) [&>svg]:size-full",children:$}):null,M]}),E={...m(v,j),...C.style,...q};return R?r("figure",{ref:c,className:A,style:E,...Z,children:[D,r("figcaption",{className:["mt-2 flex flex-wrap items-baseline gap-x-1.5 text-(--neba-muted-fg)",i[h]].join(" "),children:[s(N)?r("span",{className:"font-medium text-(--neba-fg)",children:[e("span",{"aria-hidden":"true",children:"— "}),N]}):null,s(y)?e("cite",{className:"not-italic",children:y}):null]})]}):e("div",{ref:c,className:A,style:E,...Z,children:D})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{useRender as i}from"@base-ui/react/use-render";import{barMinHeightClasses as l,BottomNavigationContext as r}from"../../internal/bottom-navigation.js";import{cx as o,hasContent as s,iconSizeClasses as d,metaTextClasses as c,paddingXClasses as u,radiusClasses as m,srOnlyClasses as p,surfaceClasses as f,surfaceSlots as b,transitionClasses as g}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{useRender as i}from"@base-ui/react/use-render";import{barMinHeightClasses as l,BottomNavigationContext as r}from"../../internal/bottom-navigation.js";import{cx as o,hasContent as s,iconSizeClasses as d,metaTextClasses as c,paddingXClasses as u,radiusClasses as m,srOnlyClasses as p,surfaceClasses as f,surfaceSlots as b,transitionClasses as g}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";const x={solid:[f,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[f,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},h={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},y={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"}},w={xs:"gap-0.5",sm:"gap-0.5",md:"gap-1",lg:"gap-1",xl:"gap-1.5"};export const BottomNavigation=/*@__PURE__*/n.forwardRef(function(t,a){const{variant:s="outline",size:d="md",color:c="primary",density:u="default",elevation:p=0,value:f,defaultValue:w=null,onValueChange:z,position:N="fixed",labels:j="all",divider:k=!0,safeArea:C=!0,disabled:B=!1,label:R,render:V,className:_,style:A,children:D,...F}=v(t,["size","density","variant"]),[I,M]=n.useState(w),P=void 0!==f,S=P?f:I,q=n.useCallback(e=>{P||M(e),z?.(e)},[P,z]),E=n.useMemo(()=>({value:S??null,change:q,size:d,density:u,labels:j,disabled:B,floating:!1}),[S,q,d,u,j,B]),G=o("w-full min-w-0","static"===N?m[d]:"",x[s],"outline"===s&&"static"===N?"border [border-color:var(--n-line)]":"",k?"border-t [border-color:var(--n-line)]":"",h[N],C?"pb-[env(safe-area-inset-bottom)]":"",g,_);return i({render:V??e("nav",{}),ref:a,props:{"aria-label":R,className:G,style:{...b(c,p),...A},children:e(r.Provider,{value:E,children:e("div",{className:o("flex w-full items-stretch",l[d],y[u][d]),children:D})}),...F}})});export const BottomNavigationItem=/*@__PURE__*/n.forwardRef(function({value:i,icon:l,href:f,disabled:b=!1,className:v,children:x,onClick:h,...y},z){const N=n.useContext(r),j=b||N.disabled,k=null!==N.value&&N.value===i,C="all"===N.labels||"selected"===N.labels&&k,B=o("flex min-w-0 flex-col items-center justify-center py-1.5",N.floating?o("relative z-10",u[N.density][N.size],"rounded-full"):o("flex-1 px-1",m[N.size]),w[N.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",g,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",j?"cursor-not-allowed text-(--neba-disabled-fg)":k?N.floating?"cursor-pointer font-medium text-(--n-accent)":"cursor-pointer font-medium text-(--n-accent) bg-(--n-soft) hover:bg-(--n-soft-hover)":"cursor-pointer text-(--neba-muted-fg) hover:text-(--neba-fg) hover:bg-(--n-panel-hover)",v),R=a(t,{children:[s(l)?e("span",{className:o("flex shrink-0 items-center justify-center",d[N.size]),children:l}):null,s(x)?N.floating&&"selected"===N.labels?e("span",{"data-drawn":C?"":void 0,className:o("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]",C?"[grid-template-columns:1fr] opacity-100":"[grid-template-columns:0fr] opacity-0"),children:e("span",{className:o("min-w-0 truncate leading-tight",c[N.size]),children:x})}):e("span",{"data-drawn":C?"":void 0,className:C?o("max-w-full truncate leading-tight",c[N.size]):p,children:x}):null]}),V=e=>{j?e.preventDefault():(N.change(i),h?.(e))};return f?e("a",{ref:z,"data-nav-item":"",href:j?void 0:f,"aria-current":k?"page":void 0,"aria-disabled":j||void 0,className:B,onClick:V,...y,children:R}):e("button",{ref:z,"data-nav-item":"",type:"button",disabled:j,"aria-current":k?"page":void 0,className:B,onClick:V,...y,children:R})});
|
|
@@ -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 t,radiusClasses 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 t,radiusClasses as n,surfaceClasses as o,surfaceSlots as r,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as l}from"../../internal/defaults.js";const d=n;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"}};const x=["block",p].join(" "),i={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(e,n){const{variant:o="outline",size:p="md",color:m="primary",density:c="default",elevation:b=0,padded:f=!0,transition:g,render:y,className:u,style:v,children:j,...h}=l(e,["size","density","variant"]),C=a(g),P=t(x,d[p],f?boxPaddingClasses[c][p]:"",i[o],C.className,u??"");return s({render:y,ref:n,props:{className:P,style:{...r(m,b),...C.style,...v},children:j,...h}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from"react";import{breadcrumbMessages as a,useMessages as s}from"../../internal/i18n.js";import{ArrowRightIcon as l,ChevronIcon as i,EllipsisIcon as c}from"../../internal/icons.js";import{controlTextClasses as o,cx as m,gapClasses as d,hasContent as u,iconClasses as p,radiusClasses as f,transitionClasses as h}from"../../internal/styles.js";const
|
|
1
|
+
"use client";import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as r from"react";import{breadcrumbMessages as a,useMessages as s}from"../../internal/i18n.js";import{ArrowRightIcon as l,ChevronIcon as i,EllipsisIcon as c}from"../../internal/icons.js";import{controlTextClasses as o,cx as m,gapClasses as d,hasContent as u,iconClasses as p,radiusClasses as f,transitionClasses as h}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const g=/*@__PURE__*/r.createContext({size:"md",last:!1}),b={default:{xs:"gap-1",sm:"gap-1.5",md:"gap-2",lg:"gap-2.5",xl:"gap-3"},compact:{xs:"gap-0.5",sm:"gap-1",md:"gap-1",lg:"gap-1.5",xl:"gap-2"}},v={xs:f.xs,sm:f.xs,md:f.xs,lg:f.sm,xl:f.sm};const y=["chevron","arrow","slash","dot"];function N(e){return"string"==typeof e||"number"==typeof e?String(e):Array.isArray(e)?e.map(N).join(""):r.isValidElement(e)?N(e.props.children):""}function w(e,t){if(!t)return e;try{return new URL(e,t).href}catch{return e}}function j(e,t){const n=e.map((e,n)=>{const{href:r,children:a}=e.props;return{"@type":"ListItem",position:n+1,name:N(a),...r?{item:w(r,t)}:null}});return JSON.stringify({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:n}).replace(/</g,"\\u003c")}export const Breadcrumb=/*@__PURE__*/r.forwardRef(function(n,d){const{size:u="md",color:f="primary",density:v="default",separator:N="chevron",maxItems:w,itemsBeforeCollapse:k=1,itemsAfterCollapse:C=1,expandable:I=!0,locale:L,label:_,expandLabel:z,structuredData:B=!1,baseUrl:A,className:M,style:S,children:E,...R}=x(n,["size","density","locale"]),$=s(a,L),[F,U]=r.useState(!1),V=r.Children.toArray(E).filter(r.isValidElement),D=V.length,H=V.some(e=>!0===e.props.current),J=!F&&void 0!==w&&D>Math.max(w,1)&&D-k-C>1?[...V.slice(0,Math.max(0,k)),null,...V.slice(D-Math.max(0,C))]:V,O="string"==typeof(P=N)&&y.includes(P)?function(t){switch(t){case"chevron":return e("span",{className:"flex -rotate-90 items-center rtl:rotate-90",children:e(i,{})});case"arrow":return e("span",{className:"flex items-center rtl:rotate-180",children:e(l,{})});case"slash":return e("span",{className:"opacity-70",children:"/"});case"dot":return e("span",{className:"opacity-70",children:"·"});default:return null}}(N):N;var P;const T=m("inline-flex items-center rounded-(--neba-radius-xs) px-0.5","text-(--neba-muted-fg)",h,p,I?m("cursor-pointer hover:bg-(--n-soft) hover:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"):"");return t("nav",{ref:d,"aria-label":_??$.label,className:m("flex",o[u],p,M),style:{"--n-accent":`var(--neba-${f}-accent)`,"--n-soft":`var(--neba-${f}-soft)`,"--n-ring":`var(--neba-${f}-ring)`,...S},...R,children:[B&&D>0?e("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:j(V,A)}}):null,e("ol",{role:"list",className:m("flex list-none flex-wrap items-center p-0",b[v][u]),children:J.map((n,a)=>t(r.Fragment,{children:[a>0?e("li",{"aria-hidden":"true",className:"flex shrink-0 items-center text-(--neba-muted-fg) select-none",children:O}):null,n?e(g.Provider,{value:{size:u,last:!H&&a===J.length-1},children:n}):e("li",{className:"flex shrink-0 items-center",children:I?e("button",{type:"button",className:T,"aria-label":z??$.expand,onClick:()=>U(!0),children:e(c,{})}):e("span",{className:T,"aria-hidden":"true",children:e(c,{})})})]},n?n.key??a:"fold"))})]})});export const BreadcrumbItem=/*@__PURE__*/r.forwardRef(function({href:a,onClick:s,startIcon:l,endIcon:i,current:c,disabled:o=!1,className:p,children:f,...x},b){const{size:y,last:N}=r.useContext(g),w=c??N,j=Boolean(a||s)&&!w&&!o,k=m("inline-flex min-w-0 items-center px-1",d[y],v[y],h,o?"cursor-not-allowed text-(--neba-disabled-fg)":w?"font-medium text-(--neba-fg)":j?m("cursor-pointer text-(--neba-muted-fg)","hover:bg-(--n-soft) hover:text-(--n-accent)","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-1"):"text-(--neba-muted-fg)"),C=t(n,{children:[u(l)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:l}):null,e("span",{className:"truncate",children:f}),u(i)?e("span",{className:"flex h-[1lh] shrink-0 items-center",children:i}):null]});return e("li",{ref:b,className:m("flex min-w-0 items-center",p),...x,children:j&&a?e("a",{href:a,className:k,onClick:s,children:C}):j?e("button",{type:"button",className:k,onClick:s,children:C}):e("span",{className:k,"aria-current":w?"page":void 0,"aria-disabled":o||void 0,children:C})})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import*as t from"react";import{Button as n}from"@base-ui/react/button";import{useRender as a}from"@base-ui/react/use-render";import{ButtonGroupContext as s}from"../../internal/button-group.js";import{controlHeightClasses as l,controlSlots as i,controlSquareClasses as d,controlTextClasses as c,cx as v,disabledClasses as p,focusRingClasses as x,gapClasses as b,iconClasses as m,paddingXClasses as u,pressTransitionClasses as f,radiusClasses as g,readOnlyFilterClasses as h,surfaceClasses as $,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as j}from"../../internal/defaults.js";const w={xs:`${l.xs} ${b.xs} ${g.xs} ${c.xs}`,sm:`${l.sm} ${b.sm} ${g.sm} ${c.sm}`,md:`${l.md} ${b.md} ${g.md} ${c.md}`,lg:`${l.lg} ${b.lg} ${g.lg} ${c.lg}`,xl:`${l.xl} ${b.xl} ${g.xl} ${c.xl}`},k={xs:`${d.xs} px-0`,sm:`${d.sm} px-0`,md:`${d.md} px-0`,lg:`${d.lg} px-0`,xl:`${d.xl} px-0`},C=["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]",y,f,x,m].join(" "),P={solid:[$,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[$,"border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)]","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--n-accent) bg-transparent"},z={solid:["hover:bg-(--n-fill-hover)","hover:[box-shadow:var(--n-elev-hover),var(--neba-plate-solid)]","active:bg-(--n-fill-active)","active:[box-shadow:var(--n-elev-press),var(--neba-plate-solid)]"].join(" "),outline:["hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","hover:[box-shadow:var(--n-elev-hover),var(--neba-plate-glass)]","active:bg-(--n-panel-press)","active:[box-shadow:var(--n-elev-press),var(--neba-plate-glass)]"].join(" "),text:"hover:bg-(--n-soft) active:bg-(--n-soft-hover)"},B={solid:[$,h,"cursor-default text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--neba-plate-solid)]"].join(" "),outline:[$,h,"cursor-default border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)] [box-shadow:var(--neba-plate-glass)]"].join(" "),text:`${h} cursor-default text-(--n-accent) bg-transparent`};function M(){return r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",className:"animate-spin",children:[e("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"2"}),e("path",{d:"M14.5 8A6.5 6.5 0 0 0 8 1.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}export const Button=/*@__PURE__*/t.forwardRef(function(l,d){const{variant:c,size:x,color:b,density:m,elevation:f,startIcon:g,endIcon:h,loading:$=!1,readOnly:y=!1,fullWidth:N=!1,disabled:W,render:E,className:I,style:O,children:A,onClick:D,onPointerMove:F,...L}=j(l,["size","density","variant"]),R=t.useContext(s),T=c??R?.variant??"solid",X=x??R?.size??"md",Y=b??R?.color??"primary",q=m??R?.density??"default",G=f??R?.elevation??0,H=W??R?.disabled??!1,J=$||y,K=v(C,w[X],null==A||!1===A?k[X]:u[q][X],H?p[T]:y?B[T]:P[T],H||J?"":[z[T],"neba-glow","cursor-pointer"].join(" "),$?"cursor-progress":"",N?"w-full":"",I??"");return a({render:E??e(n,{disabled:H}),ref:d,props:{className:K,style:{...i(Y,G,T),...O},"aria-disabled":J||void 0,"aria-busy":$||void 0,"data-loading":$||void 0,"data-readonly":y||void 0,onClick:e=>{if(J)return e.preventDefault(),void e.stopPropagation();D?.(e)},onPointerMove:e=>{if(!H&&!J){const r=e.currentTarget;r.style.setProperty("--n-mx",`${e.nativeEvent.offsetX}px`),r.style.setProperty("--n-my",`${e.nativeEvent.offsetY}px`)}F?.(e)},...L,children:r(o,{children:[$?e(M,{}):g,A,h]})}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as i from"react";import{ButtonGroupContext as o}from"../../internal/button-group.js";import{cx as t}from"../../internal/styles.js";import{useStyleDefaults as n}from"../../internal/defaults.js";const r={horizontal:"[&>*:not(:first-child)]:rounded-s-none [&>*:not(:last-child)]:rounded-e-none",vertical:"[&>*:not(:first-child)]:rounded-t-none [&>*:not(:last-child)]:rounded-b-none"},l={horizontal:"[&>*:not(:first-child)]:-ms-px",vertical:"[&>*:not(:first-child)]:-mt-px"},s=["inline-flex align-middle","[&>*]:relative [&>*:hover]:z-10 [&>*:focus-visible]:z-10","[&>*]:shrink-0"].join(" ");export const ButtonGroup=/*@__PURE__*/i.forwardRef(function(a,d){const{variant:c,size:f,color:u,density:m,elevation:h,orientation:v="horizontal",disabled:p,fullWidth:x=!1,className:z,children:j,...b}=n(a,["size","density","variant"]),y=i.useMemo(()=>({variant:c,size:f,color:u,density:m,elevation:h,disabled:p}),[c,f,u,m,h,p]);return e(o.Provider,{value:y,children:e("div",{ref:d,role:"group",className:t(s,"vertical"===v?"flex-col":"flex-row",r[v],"outline"===(c??"solid")?l[v]:"",x?"flex w-full [&>*]:flex-1":"",z??""),...b,children:j})})});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type PickerLabels } from '../../internal/calendar.js';
|
|
3
|
+
import type { NebaColor, NebaDateGranularity, NebaElevation, NebaSize, NebaWeekday } from '../../types.js';
|
|
4
|
+
/** Both ends of a span. Either may be missing while one is being chosen. */
|
|
5
|
+
export interface CalendarRange {
|
|
6
|
+
start: Date | null;
|
|
7
|
+
end: Date | null;
|
|
8
|
+
}
|
|
9
|
+
/** How many days the reader may be holding at once. */
|
|
10
|
+
export type CalendarMode = 'single' | 'multiple' | 'range';
|
|
11
|
+
/** What the value is, for each of the three. */
|
|
12
|
+
export interface CalendarValueByMode {
|
|
13
|
+
single: Date | null;
|
|
14
|
+
multiple: Date[];
|
|
15
|
+
range: CalendarRange;
|
|
16
|
+
}
|
|
17
|
+
interface CalendarBaseProps extends Omit<React.ComponentPropsWithoutRef<'div'>, 'color' | 'defaultValue' | 'onSelect'> {
|
|
18
|
+
size?: NebaSize;
|
|
19
|
+
color?: NebaColor;
|
|
20
|
+
/** Drop shadow depth. `0` is flat — a calendar in a page is not floating. */
|
|
21
|
+
elevation?: NebaElevation;
|
|
22
|
+
/** Draws the sheet the picker's popup draws. `false` for the bare grid. */
|
|
23
|
+
bordered?: boolean;
|
|
24
|
+
/** The month on screen. Use with `onMonthChange` to control it. */
|
|
25
|
+
month?: Date;
|
|
26
|
+
/** Which month it opens on. @default the month of the value, or this one */
|
|
27
|
+
defaultMonth?: Date;
|
|
28
|
+
onMonthChange?: (month: Date) => void;
|
|
29
|
+
/** Which unit a click chooses: a day, a whole month, a whole year. */
|
|
30
|
+
granularity?: NebaDateGranularity;
|
|
31
|
+
minDate?: Date | null;
|
|
32
|
+
maxDate?: Date | null;
|
|
33
|
+
/** Blocks cells inside the range. Handed the value that cell would produce. */
|
|
34
|
+
shouldDisableDate?: (date: Date) => boolean;
|
|
35
|
+
/** BCP 47 tag deciding the month and weekday names and the header's order. */
|
|
36
|
+
locale?: string;
|
|
37
|
+
weekStartsOn?: NebaWeekday;
|
|
38
|
+
/** Draws the leading and trailing days of the neighbouring months. */
|
|
39
|
+
showOutsideDays?: boolean;
|
|
40
|
+
/** What a day cell draws under its number — a dot, a count, a bar. */
|
|
41
|
+
renderDay?: (date: Date) => React.ReactNode;
|
|
42
|
+
/** The strings a screen reader hears. Every one has an English default. */
|
|
43
|
+
labels?: Partial<PickerLabels>;
|
|
44
|
+
}
|
|
45
|
+
interface ModeProps<Mode extends CalendarMode> {
|
|
46
|
+
mode?: Mode;
|
|
47
|
+
value?: CalendarValueByMode[Mode] | null;
|
|
48
|
+
defaultValue?: CalendarValueByMode[Mode] | null;
|
|
49
|
+
onValueChange?: (value: CalendarValueByMode[Mode]) => void;
|
|
50
|
+
}
|
|
51
|
+
export type CalendarProps = CalendarBaseProps & (ModeProps<'single'> | ModeProps<'multiple'> | ModeProps<'range'>);
|
|
52
|
+
/**
|
|
53
|
+
* A month, inline, with the days it is holding lit up.
|
|
54
|
+
*
|
|
55
|
+
* The same grid the four pickers open, without a popup around it. It has been
|
|
56
|
+
* in `internal/` since the first picker shipped, and keeping it there meant a
|
|
57
|
+
* page that wanted a month on it — a booking sheet, a schedule, a filter that
|
|
58
|
+
* is always visible — had to open a DatePicker and never close it.
|
|
59
|
+
*
|
|
60
|
+
* What it is *not* is a scheduler. The cells are the control ladder's heights,
|
|
61
|
+
* so `renderDay` is room for a dot, a count or a bar under the number, and not
|
|
62
|
+
* for a day's worth of entries. A component that drew those would be a
|
|
63
|
+
* different component with a different grid, and calling this one that would be
|
|
64
|
+
* a promise the sizes cannot keep.
|
|
65
|
+
*
|
|
66
|
+
* `mode` decides what the value is: one day, an array of them, or a
|
|
67
|
+
* `{ start, end }` span. Range mode fills the near end first and then the far
|
|
68
|
+
* one, and a click below the start begins again rather than inverting the span
|
|
69
|
+
* — inverting is the behaviour that makes a reader believe they mis-clicked.
|
|
70
|
+
*/
|
|
71
|
+
export declare const Calendar: React.ForwardRefExoticComponent<CalendarProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{Calendar as n,usePickerLabels as r}from"../../internal/calendar.js";import{compareDay as a,isSameDay as l,isValidDate as s,localeWeekStart as o,startOfMonth as i,startOfUnit as d,today as u}from"../../internal/date.js";import{cx as m,radiusClasses as c,surfaceSlots as f}from"../../internal/styles.js";import{useStyleDefaults as g}from"../../internal/defaults.js";const h={single:null,multiple:[],range:{start:null,end:null}};function p(e,t){if("multiple"===e)return t??[];if("range"===e){const e=t??h.range;return[e.start,e.end]}return[t]}export const Calendar=/*@__PURE__*/t.forwardRef(function(D,y){const{mode:v="single",value:b,defaultValue:j,onValueChange:S,size:w="md",color:x="primary",elevation:C=0,bordered:O=!0,month:k,defaultMonth:z,onMonthChange:M,granularity:N="day",minDate:V,maxDate:E,shouldDisableDate:R,locale:q,weekStartsOn:A,showOutsideDays:B=!0,renderDay:F,labels:G,className:H,style:I,...J}=g(D,["size","locale"]),K=r(G),L=A??o(q),[P,Q]=t.useState(()=>j??h[v]),T=void 0!==b?b:P,U=p(v,T).find(s),[W,X]=t.useState(()=>i(U??z??u())),Y=k??W,Z=e=>{void 0===b&&Q(e),S?.(e)},$="range"===v?T??h.range:h.range;return e("div",{ref:y,className:m("inline-block",O&&"border p-3 [border-color:var(--n-line)] bg-(--n-panel-press)",O&&c[w],H),style:{...f(x,C),...I},...J,children:e(n,{size:w,color:x,locale:q,weekStartsOn:L,month:Y,onMonthChange:e=>{void 0===k&&X(e),M?.(e)},selected:p(v,T),rangeStart:$.start,rangeEnd:$.end,onSelect:e=>{const t=d(e,N);if("multiple"===v){const e=T??[],n=e.filter(e=>!l(e,t));return void Z(n.length===e.length?[...e,t]:n)}if("range"===v){const e=T??h.range;return!s(e.start)||s(e.end)?void Z({start:t,end:null}):void Z(a(t,e.start)<0?{start:t,end:null}:{start:e.start,end:t})}Z(t)},granularity:N,minDate:V,maxDate:E,shouldDisableDate:R,showOutsideDays:B,renderDay:F,labels:K})})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{Calendar}from"./Calendar.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import*as s from"react";import{Box as n,boxPaddingXClasses as a,boxPaddingYClasses as r}from"../box/Box.js";import{cx as i,hasContent as
|
|
1
|
+
"use client";import{jsx as e,jsxs as l,Fragment as t}from"react/jsx-runtime";import*as s from"react";import{Box as n,boxPaddingXClasses as a,boxPaddingYClasses as r}from"../box/Box.js";import{cx as i,hasContent as o,metaTextClasses as c,sheetBodyClasses as d,sheetHeaderGapClasses as m,sheetSectionGapClasses as f,sheetTitleClasses as u}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";export const Card=/*@__PURE__*/s.forwardRef(function(s,h){const{size:p="md",density:N="default",title:y,subtitle:$,headerAction:b,footer:v,dividers:j=!1,className:k,children:g,...w}=x(s,["size","density"]),z=a[N][p],A=r[N][p],B=j?`${z} ${A}`:z,C=o(y)||o($)||o(b),F=l(t,{children:[o(y)||o($)?l("div",{className:`flex min-w-0 flex-1 flex-col ${m[p]}`,children:[o(y)?e("div",{className:`neba-title font-semibold ${u[p]}`,children:y}):null,o($)?e("div",{className:`text-(--neba-muted-fg) ${c[p]}`,children:$}):null]}):null,o(b)?e("div",{className:"ml-auto shrink-0",children:b}):null]}),R=[C?{key:"header",className:"flex items-start gap-3",content:F}:null,o(g)?{key:"content",className:d[p],content:g}:null,o(v)?{key:"footer",className:`flex flex-wrap items-center gap-2 ${d[p]}`,content:v}:null].filter(e=>null!==e);return e(n,{ref:h,size:p,density:N,padded:!1,className:i("flex flex-col",j?"":`${A} ${f[p]}`,k??""),...w,children:R.map((l,t)=>e("div",{className:i(B,l.className,j&&t>0?"border-t [border-color:var(--n-line)]":""),children:l.content},l.key))})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{IconButton as n}from"../icon-button/IconButton.js";import{carouselMessages as a,fillMessage as o,useMessages as l}from"../../internal/i18n.js";import{ChevronIcon as i}from"../../internal/icons.js";import{usePrefersReducedMotion as s}from"../../internal/media.js";import{cx as c,radiusClasses as u,srOnlyClasses as d,surfaceClasses as f,surfaceSlots as m,transitionClasses as p}from"../../internal/styles.js";const b={solid:[f,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[f,"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"},
|
|
1
|
+
"use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as t from"react";import{IconButton as n}from"../icon-button/IconButton.js";import{carouselMessages as a,fillMessage as o,useMessages as l}from"../../internal/i18n.js";import{ChevronIcon as i}from"../../internal/icons.js";import{usePrefersReducedMotion as s}from"../../internal/media.js";import{cx as c,radiusClasses as u,srOnlyClasses as d,surfaceClasses as f,surfaceSlots as m,transitionClasses as p}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";const b={solid:[f,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[f,"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"},h={xs:"start-1 end-1",sm:"start-1.5 end-1.5",md:"start-2 end-2",lg:"start-3 end-3",xl:"start-4 end-4"},g={xs:{rest:"h-1 w-1",current:"h-1 w-3",gap:"gap-1"},sm:{rest:"h-1 w-1",current:"h-1 w-3.5",gap:"gap-1"},md:{rest:"h-1.5 w-1.5",current:"h-1.5 w-4",gap:"gap-1.5"},lg:{rest:"h-1.5 w-1.5",current:"h-1.5 w-5",gap:"gap-2"},xl:{rest:"h-2 w-2",current:"h-2 w-6",gap:"gap-2"}};export const Carousel=/*@__PURE__*/t.forwardRef(function(f,x){const{variant:w="outline",size:j="md",color:y="primary",density:N="default",elevation:k=0,value:C,defaultValue:M=0,onValueChange:R,loop:I=!0,autoPlay:L=!1,interval:S=5e3,arrows:z=!0,indicators:$=!0,locale:_,label:E,previousLabel:P,nextLabel:V,slideLabel:B,className:T,style:W,children:A,...F}=v(f,["size","density","variant","locale"]),q=l(a,_),D=B??((e,r)=>o(q.slide,{index:String(e),total:String(r)})),G=t.Children.toArray(A),H=G.length,[J,K]=t.useState(M),O=Math.min(Math.max(C??J,0),Math.max(H-1,0)),Q=t.useRef(null),U=t.useRef([]),X=t.useRef(!1),Y=t.useRef(!1),Z=t.useRef(!1),[ee,re]=t.useState(!1),te=t.useCallback((e,r=!1)=>{if(0===H)return;const t=I?(e%H+H)%H:Math.min(Math.max(e,0),H-1);X.current=r,void 0===C&&K(t),t!==O&&R?.(t)},[H,I,C,O,R]);t.useEffect(()=>{if(X.current)return void(X.current=!1);if(!Y.current)return void(Y.current=!0);U.current[O]?.scrollIntoView({block:"nearest",inline:"start"}),Z.current=!0;const e=window.setTimeout(()=>{Z.current=!1},700);return()=>window.clearTimeout(e)},[O]);const ne=s();t.useEffect(()=>{if(!L||ee||ne||H<2)return;const e=window.setInterval(()=>{document.hidden||te(O+1)},S);return()=>window.clearInterval(e)},[L,ee,ne,H,S,O,te]);const ae=O<=0,oe=O>=H-1;return r("div",{ref:x,role:"region","aria-roledescription":"carousel","aria-label":E??q.label,className:c("flex flex-col",T??""),style:{...m(y,k),...W},onPointerEnter:()=>re(!0),onPointerLeave:()=>re(!1),onFocus:()=>re(!0),onBlur:()=>re(!1),...F,children:[r("div",{className:["relative min-w-0 overflow-hidden",u[j],b[w],p].join(" "),children:[e("div",{ref:Q,tabIndex:0,role:"group","aria-label":E??q.label,className:["flex min-w-0 snap-x snap-mandatory overflow-x-auto scroll-smooth","motion-reduce:scroll-auto","[scrollbar-width:none] [&::-webkit-scrollbar]:hidden","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]"].join(" "),onScroll:()=>{const e=Q.current;if(Z.current||!e||0===e.clientWidth)return;const r=Math.round(Math.abs(e.scrollLeft)/e.clientWidth);r!==O&&r>=0&&r<H&&te(r,!0)},children:G.map((r,t)=>e("div",{ref:e=>{U.current[t]=e},role:"group","aria-roledescription":"slide","aria-label":D(t+1,H),className:"w-full shrink-0 grow-0 basis-full snap-start",children:r},t))}),z&&H>1?r("div",{className:`pointer-events-none absolute inset-y-0 flex items-center ${h[j]}`,children:[e(n,{variant:"solid",size:j,color:y,density:N,elevation:1,label:P??q.previous,disabled:!I&&ae,className:"pointer-events-auto",icon:e("span",{className:"flex items-center rotate-90 rtl:-rotate-90",children:e(i,{})}),onClick:()=>te(O-1)}),e("span",{className:"flex-1"}),e(n,{variant:"solid",size:j,color:y,density:N,elevation:1,label:V??q.next,disabled:!I&&oe,className:"pointer-events-auto",icon:e("span",{className:"flex items-center -rotate-90 rtl:rotate-90",children:e(i,{})}),onClick:()=>te(O+1)})]}):null]}),$&&H>1?e("div",{className:`flex shrink-0 items-center justify-center pt-2 ${g[j].gap}`,children:G.map((r,t)=>e("button",{type:"button","aria-label":D(t+1,H),"aria-current":t===O?"true":void 0,className:["cursor-pointer rounded-full","[transition-property:width,background-color]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2",t===O?`${g[j].current} bg-(--n-accent)`:`${g[j].rest} bg-(--n-line-hover) hover:bg-(--n-accent)`].join(" "),onClick:()=>te(t)},t))}):null,e("span",{className:d,"aria-live":L?"off":"polite",children:H>0?D(O+1,H):""})]})});
|