neba 1.11.0 → 1.13.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/LICENSE +1 -1
- package/README.md +43 -41
- package/dist/components/accordion/Accordion.d.ts +18 -0
- package/dist/components/accordion/Accordion.js +1 -1
- package/dist/components/anchor/Anchor.js +1 -1
- package/dist/components/animate-appear/AnimateAppear.d.ts +2 -13
- package/dist/components/animate-appear/AnimateAppear.js +1 -1
- package/dist/components/animate-blink/AnimateBlink.d.ts +2 -2
- package/dist/components/animate-blink/AnimateBlink.js +1 -1
- package/dist/components/animate-counter/AnimateCounter.d.ts +45 -0
- package/dist/components/animate-counter/AnimateCounter.js +1 -0
- package/dist/components/animate-counter/index.d.ts +1 -0
- package/dist/components/animate-counter/index.js +1 -0
- package/dist/components/animate-fade/AnimateFade.d.ts +2 -2
- package/dist/components/animate-fade/AnimateFade.js +1 -1
- package/dist/components/animate-float/AnimateFloat.d.ts +35 -0
- package/dist/components/animate-float/AnimateFloat.js +1 -0
- package/dist/components/animate-float/index.d.ts +1 -0
- package/dist/components/animate-float/index.js +1 -0
- package/dist/components/animate-grow/AnimateGrow.d.ts +2 -2
- package/dist/components/animate-grow/AnimateGrow.js +1 -1
- package/dist/components/animate-marquee/AnimateMarquee.d.ts +5 -3
- package/dist/components/animate-marquee/AnimateMarquee.js +1 -1
- package/dist/components/animate-reveal/AnimateReveal.d.ts +41 -0
- package/dist/components/animate-reveal/AnimateReveal.js +1 -0
- package/dist/components/animate-reveal/index.d.ts +1 -0
- package/dist/components/animate-reveal/index.js +1 -0
- package/dist/components/animate-rotate/AnimateRotate.d.ts +2 -2
- package/dist/components/animate-rotate/AnimateRotate.js +1 -1
- package/dist/components/animate-scramble/AnimateScramble.d.ts +48 -0
- package/dist/components/animate-scramble/AnimateScramble.js +1 -0
- package/dist/components/animate-scramble/index.d.ts +1 -0
- package/dist/components/animate-scramble/index.js +1 -0
- package/dist/components/animate-shake/AnimateShake.d.ts +39 -0
- package/dist/components/animate-shake/AnimateShake.js +1 -0
- package/dist/components/animate-shake/index.d.ts +1 -0
- package/dist/components/animate-shake/index.js +1 -0
- package/dist/components/animate-slide/AnimateSlide.d.ts +2 -2
- package/dist/components/animate-slide/AnimateSlide.js +1 -1
- package/dist/components/animate-split/AnimateSplit.d.ts +61 -0
- package/dist/components/animate-split/AnimateSplit.js +1 -0
- package/dist/components/animate-split/index.d.ts +1 -0
- package/dist/components/animate-split/index.js +1 -0
- package/dist/components/animate-typing/AnimateTyping.js +1 -1
- package/dist/components/animate-zoom/AnimateZoom.d.ts +2 -2
- package/dist/components/animate-zoom/AnimateZoom.js +1 -1
- package/dist/components/app-logo/AppLogo.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.d.ts +10 -0
- package/dist/components/bottom-navigation/BottomNavigation.js +1 -1
- package/dist/components/button/Button.js +1 -1
- package/dist/components/calendar/Calendar.js +1 -1
- package/dist/components/carousel/Carousel.d.ts +13 -0
- package/dist/components/carousel/Carousel.js +1 -1
- package/dist/components/checkbox/Checkbox.js +1 -1
- package/dist/components/code-block/CodeBlock.js +1 -1
- package/dist/components/color-picker/ColorPicker.js +1 -1
- package/dist/components/combobox/Combobox.d.ts +18 -0
- package/dist/components/combobox/Combobox.js +1 -1
- package/dist/components/command-palette/CommandPalette.js +1 -1
- package/dist/components/container/Container.d.ts +12 -4
- package/dist/components/container/Container.js +1 -1
- package/dist/components/data-table/DataTable.js +1 -1
- package/dist/components/date-picker/DatePicker.js +1 -1
- package/dist/components/date-range-picker/DateRangePicker.js +1 -1
- package/dist/components/date-time-picker/DateTimePicker.js +1 -1
- package/dist/components/dialog/Dialog.js +1 -1
- package/dist/components/drawer/Drawer.js +1 -1
- package/dist/components/flex/Flex.d.ts +93 -0
- package/dist/components/flex/Flex.js +1 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +1 -0
- package/dist/components/floating-action-button/FloatingActionButton.js +1 -1
- package/dist/components/footer/Footer.d.ts +4 -3
- package/dist/components/footer/Footer.js +1 -1
- package/dist/components/gallery/Gallery.d.ts +150 -0
- package/dist/components/gallery/Gallery.js +1 -0
- package/dist/components/gallery/GalleryViewer.d.ts +30 -0
- package/dist/components/gallery/GalleryViewer.js +1 -0
- package/dist/components/gallery/index.d.ts +2 -0
- package/dist/components/gallery/index.js +1 -0
- package/dist/components/gauge-chart/GaugeChart.js +1 -1
- package/dist/components/grid/Grid.d.ts +11 -1
- package/dist/components/grid/Grid.js +1 -1
- package/dist/components/grid-container/GridContainer.js +1 -1
- package/dist/components/header/Header.d.ts +5 -4
- package/dist/components/header/Header.js +1 -1
- package/dist/components/heatmap-chart/HeatmapChart.js +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 +155 -7
- package/dist/components/image/Image.js +1 -1
- package/dist/components/image/index.d.ts +1 -1
- package/dist/components/menu/Menu.js +1 -1
- package/dist/components/meter/Meter.d.ts +7 -0
- package/dist/components/meter/Meter.js +1 -1
- package/dist/components/navigation-menu/NavigationMenu.js +1 -1
- package/dist/components/number-field/NumberField.js +1 -1
- package/dist/components/otp-field/OtpField.js +1 -1
- package/dist/components/overlay/Overlay.js +1 -1
- package/dist/components/panes/Panes.js +1 -1
- package/dist/components/pie-chart/PieChart.js +1 -1
- package/dist/components/popover/Popover.js +1 -1
- package/dist/components/progress-circular/ProgressCircular.d.ts +10 -1
- package/dist/components/progress-circular/ProgressCircular.js +1 -1
- package/dist/components/progress-linear/ProgressLinear.d.ts +7 -1
- package/dist/components/progress-linear/ProgressLinear.js +1 -1
- 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/scatter-chart/ScatterChart.js +1 -1
- package/dist/components/scroll-area/ScrollArea.js +1 -1
- package/dist/components/scroll-zone/ScrollZone.d.ts +17 -11
- package/dist/components/scroll-zone/ScrollZone.js +1 -1
- package/dist/components/select/Select.d.ts +13 -0
- package/dist/components/select/Select.js +1 -1
- package/dist/components/show/Show.d.ts +60 -0
- package/dist/components/show/Show.js +1 -0
- package/dist/components/show/index.d.ts +2 -0
- package/dist/components/show/index.js +1 -0
- package/dist/components/sidebar/Sidebar.js +1 -1
- package/dist/components/slider/Slider.d.ts +37 -2
- package/dist/components/slider/Slider.js +1 -1
- package/dist/components/spoiler/Spoiler.js +1 -1
- package/dist/components/stack/Stack.d.ts +126 -0
- package/dist/components/stack/Stack.js +1 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +1 -0
- package/dist/components/statistic/Statistic.d.ts +8 -3
- package/dist/components/tabs/Tabs.d.ts +46 -0
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/text-field/TextField.js +1 -1
- package/dist/components/time-picker/TimePicker.js +1 -1
- package/dist/components/timeline-chart/TimelineChart.js +1 -1
- package/dist/components/toast/Toast.js +1 -1
- package/dist/components/toggle/Toggle.js +1 -1
- package/dist/components/tooltip/Tooltip.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.d.ts +2 -0
- 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/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useMediaQuery.d.ts +35 -1
- package/dist/hooks/useMediaQuery.js +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +1 -1
- package/dist/internal/animate.d.ts +65 -2
- package/dist/internal/animate.js +1 -1
- package/dist/internal/cache.d.ts +24 -0
- package/dist/internal/cache.js +1 -0
- package/dist/internal/calendar.d.ts +15 -42
- package/dist/internal/calendar.js +1 -1
- package/dist/internal/chart-frame.d.ts +48 -3
- package/dist/internal/chart-frame.js +1 -1
- package/dist/internal/chart-line.js +1 -1
- package/dist/internal/chart.d.ts +16 -0
- package/dist/internal/chart.js +1 -1
- package/dist/internal/date.js +1 -1
- package/dist/internal/drag.d.ts +8 -6
- package/dist/internal/drag.js +1 -1
- package/dist/internal/format.d.ts +21 -7
- package/dist/internal/format.js +1 -1
- package/dist/internal/grid.d.ts +29 -27
- package/dist/internal/grid.js +1 -1
- package/dist/internal/i18n.d.ts +92 -0
- package/dist/internal/i18n.js +1 -1
- package/dist/internal/icons.d.ts +25 -0
- package/dist/internal/icons.js +1 -1
- package/dist/internal/link.d.ts +5 -4
- package/dist/internal/media.d.ts +9 -2
- package/dist/internal/media.js +1 -1
- package/dist/internal/observe.js +1 -1
- package/dist/internal/page-layout.d.ts +11 -9
- package/dist/internal/page-layout.js +1 -1
- package/dist/internal/picker.d.ts +8 -3
- package/dist/internal/picker.js +1 -1
- package/dist/internal/progress.d.ts +24 -1
- package/dist/internal/progress.js +1 -1
- package/dist/internal/responsive.d.ts +97 -0
- package/dist/internal/responsive.js +1 -0
- package/dist/internal/styles.d.ts +140 -2
- package/dist/internal/styles.js +1 -1
- package/dist/internal/text.d.ts +32 -0
- package/dist/internal/text.js +1 -0
- package/dist/internal/wheel.d.ts +38 -0
- package/dist/internal/wheel.js +1 -0
- 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 +411 -30
- package/dist/types.d.ts +119 -6
- package/package.json +19 -18
- package/dist/components/avatar-group/AvatarGroup.d.ts +0 -47
- package/dist/components/avatar-group/AvatarGroup.js +0 -1
- package/dist/components/avatar-group/index.d.ts +0 -2
- package/dist/components/avatar-group/index.js +0 -1
- package/dist/internal/avatar-group.d.ts +0 -22
- package/dist/internal/avatar-group.js +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { NebaAnimateMode, NebaAnimateProps, NebaSide, NebaStaggerProps, NebaTimelineProps } from '../../types.js';
|
|
4
|
+
export interface AnimateRevealProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the content is uncovered or covered again.
|
|
7
|
+
* @default 'in'
|
|
8
|
+
*/
|
|
9
|
+
mode?: NebaAnimateMode;
|
|
10
|
+
/**
|
|
11
|
+
* The edge the wipe travels **from**. `left` uncovers left to right.
|
|
12
|
+
* @default 'left'
|
|
13
|
+
*/
|
|
14
|
+
side?: NebaSide;
|
|
15
|
+
/**
|
|
16
|
+
* Fades as it wipes, from this opacity. `1` — the default — is a wipe and
|
|
17
|
+
* nothing else, which is the point of reaching for one.
|
|
18
|
+
* @default 1
|
|
19
|
+
*/
|
|
20
|
+
from?: number;
|
|
21
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
22
|
+
render?: useRender.RenderProp;
|
|
23
|
+
children?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Content uncovered by an edge travelling across it.
|
|
27
|
+
*
|
|
28
|
+
* The one entrance in the set where the content never moves and never changes
|
|
29
|
+
* colour: it is already in place, at full size and full strength, and what
|
|
30
|
+
* changes is how much of it has been let through. That makes it the effect to
|
|
31
|
+
* reach for on a heading, a rule, a chart's own plot area — anything whose
|
|
32
|
+
* position is the information.
|
|
33
|
+
*
|
|
34
|
+
* It is `clip-path`, so there is no wrapper and no `overflow` box: the element
|
|
35
|
+
* takes exactly the room it always took, and everything around it is laid out
|
|
36
|
+
* against the finished size from the first frame.
|
|
37
|
+
*
|
|
38
|
+
* `mode="out"` runs the same edge backwards and holds it there, which covers
|
|
39
|
+
* the content up.
|
|
40
|
+
*/
|
|
41
|
+
export declare const AnimateReveal: React.ForwardRefExoticComponent<AnimateRevealProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,revealClip as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const AnimateReveal=/*@__PURE__*/e.forwardRef(function({duration:e=620,delay:s=0,easing:l,repeat:o=1,alternate:d,paused:m,trigger:p="mount",play:c,once:f=!0,threshold:g=.2,stagger:u=0,durationStep:y=0,reverse:h=!1,timeline:v,range:N,mode:j="in",side:R="left",from:S=1,render:b,className:w,style:x,children:A,...k},q){const z=n({effect:"reveal",duration:e,delay:s,easing:l,repeat:o,alternate:d,mode:j,opacity:S,clip:a(R),trigger:p,play:c,once:f,threshold:g,paused:m,infinite:t(o),timeline:v,range:N,children:A,stagger:u,durationStep:y,reverse:h});return r({render:b,ref:[q,z.ref],props:{...k,className:i(z.className,w),style:{...z.style,...x},...z.props,children:z.children}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AnimateReveal.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./AnimateReveal.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { NebaAnimateMode, NebaAnimateProps } from '../../types.js';
|
|
4
|
-
export interface AnimateRotateProps extends NebaAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { NebaAnimateMode, NebaAnimateProps, NebaStaggerProps, NebaTimelineProps } from '../../types.js';
|
|
4
|
+
export interface AnimateRotateProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/** Whether the content turns into place or out of it. @default 'in' */
|
|
6
6
|
mode?: NebaAnimateMode;
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateRotate=/*@__PURE__*/e.forwardRef(function({duration:e=460,delay:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateRotate=/*@__PURE__*/e.forwardRef(function({duration:e=460,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:d,trigger:m="mount",play:c,once:g=!0,threshold:p=.2,stagger:f=0,durationStep:u=0,reverse:y=!1,timeline:h,range:N,mode:j="in",from:v=-180,to:R=0,origin:S="center",fade:$=!0,render:b,className:w,style:x,children:A,...O},T){const k=a({effect:"rotate",duration:e,delay:i,easing:o,repeat:s,alternate:l,mode:j,angle:`${v}deg`,angleTo:`${R}deg`,opacity:$?0:1,trigger:m,play:c,once:g,threshold:p,paused:d,infinite:t(s),timeline:h,range:N,children:A,stagger:f,durationStep:u,reverse:y});return r({render:b,ref:[T,k.ref],props:{...O,className:n(k.className,w),style:{transformOrigin:S,...k.style,...x},...k.props,children:k.children}})});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { NebaAnimateProps } from '../../types.js';
|
|
4
|
+
export interface AnimateScrambleProps extends Omit<NebaAnimateProps, 'easing' | 'alternate'>, Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
5
|
+
/** The text, when it is easier to pass than to nest. Overrides `children`. */
|
|
6
|
+
text?: string;
|
|
7
|
+
/**
|
|
8
|
+
* How fast the text settles, in characters per second.
|
|
9
|
+
* @default 18
|
|
10
|
+
*/
|
|
11
|
+
speed?: number;
|
|
12
|
+
/**
|
|
13
|
+
* How often an unsettled character is redrawn, in milliseconds. Lower is
|
|
14
|
+
* busier; below about 30 it stops reading as characters at all.
|
|
15
|
+
* @default 45
|
|
16
|
+
*/
|
|
17
|
+
tick?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The pool an unsettled character is drawn from. Deliberately narrow — a pool
|
|
20
|
+
* with tall and short glyphs in it makes the line jump as it settles.
|
|
21
|
+
*/
|
|
22
|
+
characters?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Which language the text is in, for finding the character boundaries.
|
|
25
|
+
*/
|
|
26
|
+
locale?: string;
|
|
27
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
28
|
+
render?: useRender.RenderProp;
|
|
29
|
+
/** The text to settle. Only text is settled. */
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Text arriving through noise, one character at a time.
|
|
34
|
+
*
|
|
35
|
+
* `AnimateTyping`'s sibling: a typewriter reveals a string from an empty line,
|
|
36
|
+
* this one resolves it out of a line that was already the right length. That is
|
|
37
|
+
* the whole reason to choose it — the box never changes size, so nothing around
|
|
38
|
+
* it reflows and a heading does not push the page down as it lands.
|
|
39
|
+
*
|
|
40
|
+
* Whitespace is never scrambled. A space that flickers into a letter and back
|
|
41
|
+
* reads as the words having moved, which is the one thing this effect is for
|
|
42
|
+
* avoiding.
|
|
43
|
+
*
|
|
44
|
+
* The finished string is in the document from the first frame, in a clipped box
|
|
45
|
+
* for a screen reader; the noise is a visible copy that is `aria-hidden`. A
|
|
46
|
+
* reader who has asked for less motion is shown the text.
|
|
47
|
+
*/
|
|
48
|
+
export declare const AnimateScramble: React.ForwardRefExoticComponent<AnimateScrambleProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import*as a from"react";import{useRender as s}from"@base-ui/react/use-render";import{isInfinite as n,useAnimationRun as i,usePrefersReducedMotion as l}from"../../internal/animate.js";import{graphemesOf as o,textOf as m}from"../../internal/text.js";import{srOnlyClasses as c}from"../../internal/styles.js";const u="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#%&$@*";export const AnimateScramble=/*@__PURE__*/a.forwardRef(function({text:d,speed:h=18,tick:p=45,characters:f=u,duration:g,delay:x=0,repeat:M=1,paused:j,trigger:y="mount",play:v,once:N=!0,threshold:b=.2,locale:I,render:T,className:w,style:R,children:S,...A},E){const F=i({trigger:y,play:v,once:N,threshold:b,paused:j,infinite:n(M)}),k=l(),B=d??m(S),C=a.useMemo(()=>o(B,I),[B,I]),D=C.length,[G,H]=a.useState(0),[J,K]=a.useReducer(e=>e+1,0),L=a.useMemo(()=>void 0!==g&&D>0?Math.max(1,g/D):1e3/Math.max(1,h),[g,h,D]);a.useEffect(()=>{if(!F.started||j)return;if(k||0===D)return void H(D);let e,t=0;const r=()=>{t+=1,H(t),t<D?e=setTimeout(r,L):clearInterval(a)};H(0);const a=setInterval(K,p);return e=setTimeout(r,x+L),()=>{clearTimeout(e),clearInterval(a)}},[F.started,j,k,D,L,p,x]);const O=f.length>0?f:u,P=C.map((e,t)=>t<G||""===e.trim()?e:O[function(e,t,r){let a=Math.imul(e+1,2246822507)^Math.imul(t+1,3266489909);return a^=a>>>15,a=Math.imul(a,625341585),a^=a>>>13,(a>>>0)%r}(J,t,O.length)]).join("");return s({render:T,ref:[E,F.ref],props:{...A,className:w,style:R,"data-neba-animation":"scramble","data-state":F.state,...F.handlers,children:r(t,{children:[e("span",{className:c,children:B}),e("span",{"aria-hidden":"true",className:"whitespace-pre-wrap",children:P})]})}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AnimateScramble.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./AnimateScramble.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { NebaAnimateProps, NebaStaggerProps, NebaTimelineProps } from '../../types.js';
|
|
4
|
+
export interface AnimateShakeProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
|
+
/**
|
|
6
|
+
* How far it travels at the widest point — a CSS length, or a number in
|
|
7
|
+
* pixels. Short: this is a head shaken, not a thing thrown.
|
|
8
|
+
* @default 6
|
|
9
|
+
*/
|
|
10
|
+
distance?: number | string;
|
|
11
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
12
|
+
render?: useRender.RenderProp;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The one effect in the set that says *no*.
|
|
17
|
+
*
|
|
18
|
+
* A password that was wrong, a form that would not send, a row that could not
|
|
19
|
+
* be dropped where it was let go. Every other animation here is about content
|
|
20
|
+
* arriving; this one is an **answer**, and it is the only reason to reach for
|
|
21
|
+
* it — a shake that runs on mount is decoration, and decoration that moves is
|
|
22
|
+
* what a reader learns to ignore.
|
|
23
|
+
*
|
|
24
|
+
* It is therefore almost always `trigger="manual"` with `play` bound to the
|
|
25
|
+
* thing that failed, and it starts and ends exactly where the element sits, so
|
|
26
|
+
* a run that is interrupted leaves nothing off its mark.
|
|
27
|
+
*
|
|
28
|
+
* ## Why this one is allowed to move
|
|
29
|
+
*
|
|
30
|
+
* The house rule is that a control is never transformed: scaling resamples the
|
|
31
|
+
* label, and text that shifts under the cursor is what reads as cheap. That
|
|
32
|
+
* rule is about a control's **resting states** — hover, press, on, off — where
|
|
33
|
+
* the movement is a side effect of saying something colour could say better.
|
|
34
|
+
* A shake is not a state. It is a one-off reply to something the reader just
|
|
35
|
+
* did, it is over in four hundred milliseconds, and there is no colour that
|
|
36
|
+
* says "that did not work" as unmistakably. It is an exception, it is the only
|
|
37
|
+
* one, and it should never be given `repeat`.
|
|
38
|
+
*/
|
|
39
|
+
export declare const AnimateShake: React.ForwardRefExoticComponent<AnimateShakeProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as a,lengthValue as t,useAnimateElement as n}from"../../internal/animate.js";import{cx as s}from"../../internal/styles.js";export const AnimateShake=/*@__PURE__*/e.forwardRef(function({duration:e=420,delay:i=0,easing:l="ease-in-out",repeat:o=1,alternate:d,paused:c,trigger:m="manual",play:p,once:f=!0,threshold:u=.2,stagger:g=0,durationStep:h=0,reverse:y=!1,timeline:k,range:N,distance:S=6,render:b,className:j,style:v,children:x,...w},A){const C=n({effect:null,effectClass:"neba-anim-shake",name:"shake",duration:e,delay:i,easing:l,repeat:o,alternate:d,x:t(S),trigger:m,play:p,once:f,threshold:u,paused:c,infinite:a(o),timeline:k,range:N,children:x,stagger:g,durationStep:h,reverse:y});return r({render:b,ref:[A,C.ref],props:{...w,className:s(C.className,j),style:{...C.style,...v},...C.props,children:C.children}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AnimateShake.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./AnimateShake.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { NebaAnimateMode, NebaAnimateProps, NebaSide } from '../../types.js';
|
|
4
|
-
export interface AnimateSlideProps extends NebaAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { NebaAnimateMode, NebaAnimateProps, NebaSide, NebaStaggerProps, NebaTimelineProps } from '../../types.js';
|
|
4
|
+
export interface AnimateSlideProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content slides in or slides away. `out` leaves by the same edge
|
|
7
7
|
* it would have come from.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,slideOffsets as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,slideOffsets as a,useAnimateElement as n}from"../../internal/animate.js";import{cx as i}from"../../internal/styles.js";export const AnimateSlide=/*@__PURE__*/e.forwardRef(function({duration:e=380,delay:s=0,easing:o,repeat:l=1,alternate:d,paused:m,trigger:c="mount",play:p,once:f=!0,threshold:g=.2,stagger:u=0,durationStep:y=0,reverse:h=!1,timeline:x,range:N,mode:S="in",from:b="bottom",distance:j="100%",fade:v=!0,render:w,className:A,style:R,children:k,...q},z){const{x:B,y:C}=a(b,j),D=n({effect:"slide",duration:e,delay:s,easing:o,repeat:l,alternate:d,mode:S,x:B,y:C,opacity:v?0:1,trigger:c,play:p,once:f,threshold:g,paused:m,infinite:t(l),timeline:x,range:N,children:k,stagger:u,durationStep:y,reverse:h});return r({render:w,ref:[z,D.ref],props:{...q,className:i(D.className,A),style:{...D.style,...R},...D.props,children:D.children}})});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
+
import type { NebaAnimateProps, NebaAnimation, NebaSide, NebaStaggerProps, NebaTimelineProps } from '../../types.js';
|
|
4
|
+
/** What a piece is. */
|
|
5
|
+
export type NebaSplitBy = 'word' | 'character';
|
|
6
|
+
export interface AnimateSplitProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, Omit<React.ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
7
|
+
/** The text, when it is easier to pass than to nest. Overrides `children`. */
|
|
8
|
+
text?: string;
|
|
9
|
+
/**
|
|
10
|
+
* What one piece is. `word` is the default and the one to reach for: a
|
|
11
|
+
* heading of eight words is eight boxes, and the same heading by character is
|
|
12
|
+
* forty-six.
|
|
13
|
+
* @default 'word'
|
|
14
|
+
*/
|
|
15
|
+
by?: NebaSplitBy;
|
|
16
|
+
/**
|
|
17
|
+
* Which effect each piece arrives on — the library's own vocabulary, so a
|
|
18
|
+
* split heading's fade and an `AnimateFade` are the same fade.
|
|
19
|
+
* @default 'slide'
|
|
20
|
+
*/
|
|
21
|
+
effect?: NebaAnimation;
|
|
22
|
+
/** Which edge a `slide` piece comes from. @default 'bottom' */
|
|
23
|
+
from?: NebaSide;
|
|
24
|
+
/** How far a `slide` piece travels. @default '0.4em' */
|
|
25
|
+
distance?: number | string;
|
|
26
|
+
/** Where a `grow` or `zoom` piece starts, as a multiple of its final size. */
|
|
27
|
+
scale?: number;
|
|
28
|
+
/** How far a `rotate` piece turns from, in degrees. */
|
|
29
|
+
angle?: number;
|
|
30
|
+
/** Which edge a `reveal` piece is wiped from. */
|
|
31
|
+
side?: NebaSide;
|
|
32
|
+
/**
|
|
33
|
+
* Which language the text is in, for finding the word and character
|
|
34
|
+
* boundaries. A word boundary is not a space in Japanese, Thai or Chinese.
|
|
35
|
+
*/
|
|
36
|
+
locale?: string;
|
|
37
|
+
/** Renders something other than a `<div>`. Base UI's own escape hatch. */
|
|
38
|
+
render?: useRender.RenderProp;
|
|
39
|
+
/** The text to split. Only text is split — an element contributes its words. */
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A line of text arriving a word — or a letter — at a time.
|
|
44
|
+
*
|
|
45
|
+
* `AnimateAppear` walked down a list a child at a time; this walks along a
|
|
46
|
+
* sentence. The difference is only where the pieces come from, which is why
|
|
47
|
+
* everything below the split is the same machinery: one `@keyframes` per piece,
|
|
48
|
+
* held back by its place in the line.
|
|
49
|
+
*
|
|
50
|
+
* The whole string is in the document from the first frame — in a clipped box
|
|
51
|
+
* for a screen reader, which reads it once and is not made to sit through the
|
|
52
|
+
* performance — and what animates is a visible copy that is `aria-hidden`. That
|
|
53
|
+
* is `AnimateTyping`'s arrangement and it is here for the same two reasons: the
|
|
54
|
+
* effect costs a reader who cannot see it nothing, and a find-in-page still
|
|
55
|
+
* finds the sentence rather than forty-six separate letters.
|
|
56
|
+
*
|
|
57
|
+
* Every piece is an `inline-block`, which is what lets it be moved at all — an
|
|
58
|
+
* inline box cannot be translated up. Each keeps the space that followed it, so
|
|
59
|
+
* a line still breaks between words and never inside the gap.
|
|
60
|
+
*/
|
|
61
|
+
export declare const AnimateSplit: React.ForwardRefExoticComponent<AnimateSplitProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as e,Fragment as a,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{useRender as n}from"@base-ui/react/use-render";import{animBaseClass as s,animationClasses as i,isInfinite as l,staggerChildren as o,transitionParts as d,useAnimationRun as m}from"../../internal/animate.js";import{graphemesOf as c,textOf as p,wordsOf as u}from"../../internal/text.js";import{cx as f,srOnlyClasses as g}from"../../internal/styles.js";export const AnimateSplit=/*@__PURE__*/r.forwardRef(function({text:h,by:y="word",effect:j="slide",duration:x=520,delay:b=0,easing:w,repeat:N=1,alternate:S,paused:v,trigger:$="mount",play:k,once:A=!0,threshold:F=.2,stagger:M=45,durationStep:R=0,reverse:q=!1,timeline:z,range:B,from:C="bottom",distance:D="0.4em",scale:E,angle:G,side:H,locale:I,render:J,className:K,style:L,children:O,...P},Q){const T=m({trigger:$,play:k,once:A,threshold:F,paused:v,infinite:l(N)}),U=h??p(O),V=r.useMemo(()=>"word"===y?u(U,I):c(U,I),[y,U,I]),W=d({type:j,duration:x,delay:b,easing:w,repeat:N,alternate:S,from:C,distance:D,scale:E,angle:G,side:H,timeline:z,range:B}),X=o(W?V.map((a,t)=>e("span",{className:"inline-block whitespace-pre",children:a},t)):null,`${s} ${i[j]}`,W?.slots??{duration:x,delay:b,repeat:N},{stagger:M,durationStep:R,reverse:q});return n({render:J,ref:[Q,T.ref],props:{...P,className:K,style:{"--n-anim-state":T.state,...L},...T.handlers,"data-neba-animation":"split","data-state":T.state,children:t(a,{children:[e("span",{className:f(g),children:U}),e("span",{"aria-hidden":"true",children:X})]})}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AnimateSplit.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./AnimateSplit.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{isInfinite as
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as r from"react";import{isInfinite as a,useAnimationRun as n,usePrefersReducedMotion as i}from"../../internal/animate.js";import{cx as s,srOnlyClasses as o}from"../../internal/styles.js";import{graphemesOf as u,textOf as c}from"../../internal/text.js";export const AnimateTyping=/*@__PURE__*/r.forwardRef(function({text:l,speed:m=24,hold:f=1400,erase:d=!1,eraseSpeed:p,caret:h=!0,caretChar:y="|",duration:x,delay:g=0,repeat:T=1,paused:j,trigger:v="mount",play:N,once:M=!0,threshold:w=.2,className:b,style:E,children:R,...S},A){const C=n({trigger:v,play:N,once:M,threshold:w,paused:j,infinite:a(T)}),k=i(),q=l??c(R),z=r.useMemo(()=>u(q),[q]),B=z.length,[D,F]=r.useState(0),G=r.useRef(0),H=x&&B>0?x/B:1e3/Math.max(m,1),I=1e3/Math.max(p??2*m,1);return r.useEffect(()=>{G.current=0},[B]),r.useEffect(()=>{if(k||0===B)return void F(B);if(!C.started)return G.current=0,void F(0);if(j)return;let e,t=!1,r=G.current,a=1,n=!1;const i="infinite"===T?1/0:Math.max(1,T);if(r>=B&&1===i)return;const s=()=>{if(!t){if(n)return r-=1,G.current=r,F(r),r<=0&&(n=!1,a+=1),void(e=setTimeout(s,n?I:H));if(r+=1,G.current=r,F(r),r<B)e=setTimeout(s,H);else if(!(a>=i)){if(d)return n=!0,void(e=setTimeout(s,f));a+=1,e=setTimeout(()=>{t||(r=0,G.current=0,F(0),e=setTimeout(s,H))},f)}}};return F(r),e=setTimeout(s,0===r?g:H),()=>{t=!0,clearTimeout(e)}},[C.started,j,k,B,H,I,g,f,d,T]),t("div",{ref:e=>{C.ref(e),"function"==typeof A?A(e):A&&(A.current=e)},className:b,style:E,"data-neba-animation":"typing","data-state":C.state,...C.handlers,...S,children:[e("span",{className:o,children:q}),t("span",{"aria-hidden":"true",className:"whitespace-pre-wrap",children:[z.slice(0,D).join(""),h?e("span",{className:s("neba-typing-caret"),children:y}):null]})]})});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useRender } from '@base-ui/react/use-render';
|
|
3
|
-
import type { NebaAnimateMode, NebaAnimateProps } from '../../types.js';
|
|
4
|
-
export interface AnimateZoomProps extends NebaAnimateProps, React.ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
import type { NebaAnimateMode, NebaAnimateProps, NebaStaggerProps, NebaTimelineProps } from '../../types.js';
|
|
4
|
+
export interface AnimateZoomProps extends NebaAnimateProps, NebaStaggerProps, NebaTimelineProps, React.ComponentPropsWithoutRef<'div'> {
|
|
5
5
|
/**
|
|
6
6
|
* Whether the content comes forward or falls away.
|
|
7
7
|
* @default 'in'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateZoom=/*@__PURE__*/e.forwardRef(function({duration:e=340,delay:
|
|
1
|
+
"use client";import*as e from"react";import{useRender as r}from"@base-ui/react/use-render";import{isInfinite as t,useAnimateElement as a}from"../../internal/animate.js";import{cx as n}from"../../internal/styles.js";export const AnimateZoom=/*@__PURE__*/e.forwardRef(function({duration:e=340,delay:i=0,easing:o,repeat:s=1,alternate:l,paused:m,trigger:d="mount",play:c,once:p=!0,threshold:f=.2,stagger:g=0,durationStep:u=0,reverse:y=!1,timeline:h,range:N,mode:j="in",from:v=.4,fade:S=!0,render:b,className:w,style:x,children:z,...A},O){const R=a({effect:"zoom",duration:e,delay:i,easing:o,repeat:s,alternate:l,mode:j,scale:v,opacity:S?0:1,trigger:d,play:c,once:p,threshold:f,paused:m,infinite:t(s),timeline:h,range:N,children:z,stagger:g,durationStep:u,reverse:y});return r({render:b,ref:[O,R.ref],props:{...A,className:n(R.className,w),style:{transformOrigin:"center",...R.style,...x},...R.props,children:R.children}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{useRender as
|
|
1
|
+
"use client";import{jsx as e,Fragment as r,jsxs as n}from"react/jsx-runtime";import*as t from"react";import{useRender as a}from"@base-ui/react/use-render";import{initialsOf as s}from"../../internal/initials.js";import{safeRel as l}from"../../internal/link.js";import{controlHeightClasses as i,controlSlots as o,controlSquareClasses as m,cx as d,gapClasses as c,hasContent as u,srOnlyClasses as x,surfaceClasses as f,toLength as g,transitionClasses as h}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const v={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.375rem]",xl:"text-[1.625rem]"},b={xs:"text-[0.75rem]",sm:"text-[0.875rem]",md:"text-[1.0625rem]",lg:"text-[1.3125rem]",xl:"text-[1.5625rem]"},w={xs:"rounded-[0.375rem]",sm:"rounded-[0.4375rem]",md:"rounded-[0.5625rem]",lg:"rounded-[0.6875rem]",xl:"rounded-[0.875rem]"},j={solid:[f,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[f,"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,f){const{src:_,srcSet:y,alt:N,name:k,initials:z,showName:S=!1,shape:A="bare",variant:F="solid",size:L="md",color:P="primary",elevation:R=0,padded:$=!0,height:q,href:B,target:C,rel:D,imageProps:E,render:G,className:H,style:I,children:J,...K}=p(t,["size","variant"]),M="bare"!==A,O=u(J)?J:_?"image":null,Q=M&&$,T=null===O&&!M,U=S&&!T&&u(k),V=N??k,W=z??(k?s(k):""),X="image"===O&&!U&&u(V),Y=T||X,Z=!Y&&!U&&u(V),ee=g(q),re=ee?{height:ee,width:M?ee:void 0}:null,ne=e("span",{"aria-hidden":!Y||void 0,className:d("flex shrink-0 items-center justify-center overflow-hidden","font-semibold tracking-tight whitespace-nowrap",ee?"":i[L],M?d(ee?"":m[L],"circle"===A?"rounded-full":w[L],b[L],j[F]):d("w-auto text-(--neba-fg)",v[L]),"[&_svg]:w-auto [&_svg]:shrink-0",Q?"[&_svg]:h-[72%] [&_svg]:max-w-[72%]":"[&_svg]:h-full [&_svg]:max-w-full",h),style:{...M?o(P,R,F):null,...re},children:"image"===O?e("img",{src:_,srcSet:y,alt:X?V??"":"",className:d("w-auto object-contain",Q?"h-[72%] max-w-[72%]":"h-full max-w-full"),decoding:"async",...E}):O??(T?k:W)});return a({render:G??e(B?"a":"span",{}),ref:f,props:{href:B,target:C,rel:l(C,D),className:d("inline-flex max-w-full min-w-0 items-center align-middle","text-(--neba-fg) no-underline select-none",c[L],B?"cursor-pointer rounded-(--neba-radius-sm)":"",B?"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2":"",H),style:{"--n-ring":`var(--neba-${P}-ring)`,...I},children:n(r,{children:[ne,U?e("span",{className:d("min-w-0 truncate font-semibold",v[L]),children:k}):null,Z?e("span",{className:x,children:V}):null]}),...K}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{Avatar as t}from"@base-ui/react/avatar";import{transitionProps as r}from"../../internal/animate.js";import{initialsOf as i}from"../../internal/initials.js";import{controlHeightClasses as s,controlSlots as o,controlSquareClasses as l,cx as d,hasContent as c,srOnlyClasses as m,surfaceClasses as f,transitionClasses as u}from"../../internal/styles.js";import{useStyleDefaults as v}from"../../internal/defaults.js";const x={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]"},p={solid:[f,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev)]"].join(" "),outline:[f,"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]",g={solid:`${b} after:[box-shadow:var(--neba-plate-solid)]`,outline:`${b} after:[box-shadow:var(--neba-plate-glass)]`,text:""},j=["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%]",u].join(" ");function w(){return a("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__*/n.forwardRef(function(n,f){const{src:u,srcSet:b,alt:y,name:N,initials:z,shape:_,variant:S,size:k,color:C,elevation:A,delay:B,imageProps:L,onLoadingStatusChange:M,transition:R,className:Z,style:$,children:F,...I}=v(n,["size","variant"]),P=_??"circle",q=S??"text",D=k??"md",E=C??"primary",G=A??0,H=N?i(N):"",J=r(R),K=y??N,O=c(F)?F:(z??H)||e(w,{}),Q=c(F)||Boolean(z??H),T=d(j,s[D],l[D],x[D],"circle"===P?"rounded-full":h[D],p[q],g[q],J.className,Z??"");return a(t.Root,{ref:f,className:T,style:{...o(E,G,q),...J.style,...$},...I,children:[u?e(t.Image,{src:u,srcSet:b,alt:K??"",className:"size-full object-cover [animation:neba-anim-fade_var(--neba-duration-fill)_var(--neba-ease)_both]",decoding:"async",onLoadingStatusChange:M,...L}):null,a(t.Fallback,{delay:u?B:void 0,className:"flex size-full items-center justify-center",children:[K&&Q?e("span",{className:m,children:K}):null,e("span",{"aria-hidden":!(!K||!Q)||void 0,className:"contents",children:O})]})]})});
|
|
@@ -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
|
|
1
|
+
"use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import*as a from"react";import{CartesianChart as n,markTransitionClasses as l}from"../../internal/chart-frame.js";import{barBandRatio as r,barMaxThickness as o,barPath as i,barRadius as s,chartFontSizes as u,markGap as c,toValues as d}from"../../internal/chart.js";import{useStyleDefaults as m}from"../../internal/defaults.js";export function BarChart(t){const{orientation:l="vertical",stacked:i=!1,rounded:s=!0,barSize:u,valueLabels:c="none",series:f,yAxis:v,size:x="md",density:b="default",...p}=m(t,["size","density"]),y="horizontal"===l,z="full"===i,g=a.useMemo(()=>{if(!z)return f;const e=d(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:r[b],headroom:"none"===c?0:12,children:t=>e(h,{context:t,stacked:!1!==i,rounded:s,barSize:u??o[x],valueLabels:c,size:x})})}function h({context:a,stacked:n,rounded:r,barSize:o,valueLabels:d,size:m}){const{values:h,visible:v,colors:x,hovered:b,activeIndex:p,plot:y,band:z,horizontal:g,valuePx:M,categoryPx:k,zeroPx:j,format:S}=a,A=h.map((e,t)=>({one:e,index:t})).filter(e=>v[e.index]),L=n?1:Math.max(1,A.length),N=Math.min(o,Math.max(1,(z.band-c*(L-1))/L)),P=N*L+c*(L-1),W=[],w=[],B=u[m];return t("g",{children:[A.map(({one:a,index:o},u)=>{const m=x[o];return e("g",{opacity:null!==b&&b!==o?.28:1,className:l,children:a.map((o,h)=>{if(null===o.value)return null;const v=k(h),x=n?0:u*(N+c)-P/2+N/2,b=n?o.value>=0?W[h]??0:w[h]??0:0,z=M(b),j=M(b+o.value);n&&(o.value>=0?W[h]=b+o.value:w[h]=b+o.value);const A=n&&0!==b?c:0,L=Math.abs(j-z)-A;if(L<=0)return null;const C=j<z,E=h===p,F=g?i(Math.min(z,j)+(C?0:A),y.top+v+x-N/2,L,N,r&&!n?s:r?s/2:0,o.value>=0?"right":"left"):i(y.left+v+x-N/2,Math.min(z,j)+(C?0:A),N,L,r&&!n?s:r?s/2:0,o.value>=0?"up":"down");return t("g",{children:[e("path",{d:F,fill:o.color??m,opacity:E?1:.92,className:l}),"none"===d||"extremes"===d&&!f(a,h)||"last"===d&&h!==a.length-1?null:e("text",{x:g?j+(o.value>=0?5:-5):y.left+v+x,y:g?y.top+v+x:o.value>=0?j-5:j+B+2,textAnchor:g?o.value>=0?"start":"end":"middle",dominantBaseline:g?"central":void 0,fontSize:B,fontWeight:500,fill:"var(--neba-fg)",className:"tabular-nums",children:o.label??S(o.value)})]},h)})},o)}),e("line",g?{x1:j,x2:j,y1:y.top,y2:y.top+y.height,stroke:"var(--neba-chart-baseline)",strokeWidth:1}:{x1:y.left,x2:y.left+y.width,y1:j,y2:j,stroke:"var(--neba-chart-baseline)",strokeWidth:1})]})}function f(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}
|
|
@@ -61,6 +61,16 @@ export interface BottomNavigationItemProps extends Omit<React.ComponentPropsWith
|
|
|
61
61
|
icon?: React.ReactNode;
|
|
62
62
|
/** Renders the item as a link rather than as a button. */
|
|
63
63
|
href?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Where an `href` opens. Meaningless without one.
|
|
66
|
+
*
|
|
67
|
+
* Anything other than this tab gets `noopener noreferrer` merged into `rel`,
|
|
68
|
+
* so a destination that opens a new window cannot hand it a handle back to
|
|
69
|
+
* the page that opened it.
|
|
70
|
+
*/
|
|
71
|
+
target?: string;
|
|
72
|
+
/** The link's `rel`. Merged with the two tokens above rather than replaced. */
|
|
73
|
+
rel?: string;
|
|
64
74
|
/** Unavailable, but still part of the set. */
|
|
65
75
|
disabled?: boolean;
|
|
66
76
|
/** The destination's name. Read out even when `labels` keeps it undrawn. */
|
|
@@ -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
|
|
1
|
+
"use client";import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{useRender as i}from"@base-ui/react/use-render";import{barMinHeightClasses as r,BottomNavigationContext as l}from"../../internal/bottom-navigation.js";import{safeRel as o}from"../../internal/link.js";import{cx as s,hasContent as d,iconSizeClasses as c,metaTextClasses as m,paddingXClasses as u,radiusClasses as p,srOnlyClasses as f,surfaceClasses as g,surfaceSlots as b,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as x}from"../../internal/defaults.js";const h={solid:[g,"text-(--neba-fg) bg-(--n-panel-hover)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[g,"text-(--neba-fg) bg-(--n-panel)","[box-shadow:var(--n-elev),var(--neba-plate-glass)]"].join(" "),text:"text-(--neba-fg) bg-transparent"},y={static:"",sticky:"sticky bottom-0 z-20",fixed:"fixed inset-x-0 bottom-0 z-30"},w={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"}},j={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:o="outline",size:d="md",color:c="primary",density:m="default",elevation:u=0,value:f,defaultValue:g=null,onValueChange:j,position:z="fixed",labels:N="all",divider:k=!0,safeArea:C=!0,disabled:B=!1,label:R,render:V,className:_,style:A,children:D,...F}=x(t,["size","density","variant"]),[I,M]=n.useState(g),P=void 0!==f,S=P?f:I,q=n.useCallback(e=>{P||M(e),j?.(e)},[P,j]),E=n.useMemo(()=>({value:S??null,change:q,size:d,density:m,labels:N,disabled:B,floating:!1}),[S,q,d,m,N,B]),G=s("w-full min-w-0","static"===z?p[d]:"",h[o],"outline"===o&&"static"===z?"border [border-color:var(--n-line)]":"",k?"border-t [border-color:var(--n-line)]":"",y[z],C?"pb-[env(safe-area-inset-bottom)]":"",v,_);return i({render:V??e("nav",{}),ref:a,props:{"aria-label":R,className:G,style:{...b(c,u),...A},children:e(l.Provider,{value:E,children:e("div",{className:s("flex w-full items-stretch",r[d],w[m][d]),children:D})}),...F}})});export const BottomNavigationItem=/*@__PURE__*/n.forwardRef(function({value:i,icon:r,href:g,target:b,rel:x,disabled:h=!1,className:y,children:w,onClick:z,...N},k){const C=n.useContext(l),B=h||C.disabled,R=null!==C.value&&C.value===i,V="all"===C.labels||"selected"===C.labels&&R,_=s("flex min-w-0 flex-col items-center justify-center py-1.5",C.floating?s("relative z-10",u[C.density][C.size],"rounded-full"):s("flex-1 px-1",p[C.size]),j[C.size],"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",v,"focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:[outline-offset:-2px]",B?"cursor-not-allowed text-(--neba-disabled-fg)":R?C.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)",y),A=a(t,{children:[d(r)?e("span",{className:s("flex shrink-0 items-center justify-center",c[C.size]),children:r}):null,d(w)?C.floating&&"selected"===C.labels?e("span",{"data-drawn":V?"":void 0,className:s("grid justify-items-center [grid-template-rows:1fr]","[transition-property:grid-template-columns,opacity]","[transition-duration:var(--neba-duration)]","[transition-timing-function:var(--neba-ease)]","motion-reduce:[transition-duration:0ms]",V?"[grid-template-columns:1fr] opacity-100":"[grid-template-columns:0fr] opacity-0"),children:e("span",{className:s("min-w-0 truncate leading-tight",m[C.size]),children:w})}):e("span",{"data-drawn":V?"":void 0,className:V?s("max-w-full truncate leading-tight",m[C.size]):f,children:w}):null]}),D=e=>{B?e.preventDefault():(C.change(i),z?.(e))};return g?e("a",{ref:k,"data-nav-item":"",href:B?void 0:g,"aria-current":R?"page":void 0,"aria-disabled":B||void 0,className:_,onClick:D,target:b,rel:o(b,x),...N,children:A}):e("button",{ref:k,"data-nav-item":"",type:"button",disabled:B,"aria-current":R?"page":void 0,className:_,onClick:D,...N,children:A})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,
|
|
1
|
+
"use client";import{jsx as e,Fragment as n,jsxs as o}from"react/jsx-runtime";import*as t from"react";import{Button as r}from"@base-ui/react/button";import{useRender as a}from"@base-ui/react/use-render";import{ButtonGroupContext as l}from"../../internal/button-group.js";import{SpinnerIcon as s}from"../../internal/icons.js";import{controlHeightClasses as i,controlSlots as d,controlSquareClasses as v,controlTextClasses as c,cx as p,disabledClasses as x,focusRingClasses as b,gapClasses as m,iconClasses as u,paddingXClasses as f,pressTransitionClasses as g,radiusClasses as h,readOnlyFilterClasses as $,surfaceClasses as j,transitionClasses as y}from"../../internal/styles.js";import{useStyleDefaults as w}from"../../internal/defaults.js";const P={xs:`${i.xs} ${m.xs} ${h.xs} ${c.xs}`,sm:`${i.sm} ${m.sm} ${h.sm} ${c.sm}`,md:`${i.md} ${m.md} ${h.md} ${c.md}`,lg:`${i.lg} ${m.lg} ${h.lg} ${c.lg}`,xl:`${i.xl} ${m.xl} ${h.xl} ${c.xl}`},k={xs:`${v.xs} px-0`,sm:`${v.sm} px-0`,md:`${v.md} px-0`,lg:`${v.lg} px-0`,xl:`${v.xl} px-0`},z=["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,g,b,u].join(" "),C={solid:[j,"text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--n-elev),var(--neba-plate-solid)]"].join(" "),outline:[j,"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"},B={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)"},E={solid:[j,$,"cursor-default text-(--n-on-solid) bg-(--n-fill)","[box-shadow:var(--neba-plate-solid)]"].join(" "),outline:[j,$,"cursor-default border text-(--n-accent) bg-(--n-panel)","[border-color:var(--n-line)] [box-shadow:var(--neba-plate-glass)]"].join(" "),text:`${$} cursor-default text-(--n-accent) bg-transparent`};export const Button=/*@__PURE__*/t.forwardRef(function(i,v){const{variant:c,size:b,color:m,density:u,elevation:g,startIcon:h,endIcon:$,loading:j=!1,readOnly:y=!1,fullWidth:I=!1,disabled:M,render:N,className:D,style:F,children:O,onClick:R,onPointerMove:T,...W}=w(i,["size","density","variant"]),X=t.useContext(l),Y=c??X?.variant??"solid",q=b??X?.size??"md",A=m??X?.color??"primary",G=u??X?.density??"default",H=g??X?.elevation??0,J=M??X?.disabled??!1,K=j||y,L=p(z,P[q],null==O||!1===O?k[q]:f[G][q],J?x[Y]:y?E[Y]:C[Y],J||K?"":[B[Y],"neba-glow","cursor-pointer"].join(" "),j?"cursor-progress":"",I?"w-full":"",D??"");return a({render:N??e(r,{disabled:J}),ref:v,props:{className:L,style:{...d(A,H,Y),...F},"aria-disabled":K||void 0,"aria-busy":j||void 0,"data-loading":j||void 0,"data-readonly":y||void 0,onClick:e=>{if(K)return e.preventDefault(),void e.stopPropagation();R?.(e)},onPointerMove:e=>{if(!J&&!K){const n=e.currentTarget;n.style.setProperty("--n-mx",`${e.nativeEvent.offsetX}px`),n.style.setProperty("--n-my",`${e.nativeEvent.offsetY}px`)}T?.(e)},...W,children:o(n,{children:[j?e(s,{}):h,O,$]})}})});
|
|
@@ -1 +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})})});
|
|
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,q),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})})});
|
|
@@ -26,6 +26,12 @@ export interface CarouselProps extends NebaStyleProps, Omit<React.ComponentProps
|
|
|
26
26
|
* read is the most complained-about pattern on the web. It pauses on hover,
|
|
27
27
|
* on focus anywhere inside it, while the tab is in the background, and it does
|
|
28
28
|
* not start at all for a reader who has asked for reduced motion.
|
|
29
|
+
*
|
|
30
|
+
* Turning it on draws a button that stops it, in the row under the frame
|
|
31
|
+
* beside the dots. There is no prop to take that button away: hover and focus
|
|
32
|
+
* are not a mechanism for a reader holding a phone or a magnifier, and a
|
|
33
|
+
* caller who wants a control of their own can drive `value` and leave this
|
|
34
|
+
* off.
|
|
29
35
|
* @default false
|
|
30
36
|
*/
|
|
31
37
|
autoPlay?: boolean;
|
|
@@ -47,6 +53,13 @@ export interface CarouselProps extends NebaStyleProps, Omit<React.ComponentProps
|
|
|
47
53
|
label?: string;
|
|
48
54
|
previousLabel?: string;
|
|
49
55
|
nextLabel?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The rotation control's two names — what it says while the slides are
|
|
58
|
+
* advancing, and what it says once they have been stopped. Default to the
|
|
59
|
+
* `locale`'s wording.
|
|
60
|
+
*/
|
|
61
|
+
pauseLabel?: string;
|
|
62
|
+
playLabel?: string;
|
|
50
63
|
/**
|
|
51
64
|
* How one slide is named to a screen reader, and how its dot is labelled.
|
|
52
65
|
* Defaults to the `locale`'s wording.
|
|
@@ -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 r from"react";import{IconButton as n}from"../icon-button/IconButton.js";import{carouselMessages as a,fillMessage as l,useMessages as i}from"../../internal/i18n.js";import{ChevronIcon as o,PauseIcon as s,PlayIcon as c}from"../../internal/icons.js";import{usePrefersReducedMotion as u}from"../../internal/media.js";import{cx as d,radiusClasses as f,srOnlyClasses as m,surfaceClasses as p,surfaceSlots as b,transitionClasses as v}from"../../internal/styles.js";import{useStyleDefaults as h}from"../../internal/defaults.js";const g={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"},x={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"},w={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__*/r.forwardRef(function(p,y){const{variant:N="outline",size:j="md",color:k="primary",density:C="default",elevation:L=0,value:M,defaultValue:R=0,onValueChange:S,loop:_=!0,autoPlay:z=!1,interval:I=5e3,arrows:$=!0,indicators:E=!0,locale:P,label:V,previousLabel:B,nextLabel:T,pauseLabel:W,playLabel:A,slideLabel:F,className:q,style:D,children:G,...H}=h(p,["size","density","variant","locale"]),J=i(a,P),K=F??((e,t)=>l(J.slide,{index:String(e),total:String(t)})),O=r.Children.toArray(G),Q=O.length,[U,X]=r.useState(R),Y=Math.min(Math.max(M??U,0),Math.max(Q-1,0)),Z=r.useRef(null),ee=r.useRef([]),te=r.useRef(!1),re=r.useRef(!1),ne=r.useRef(!1),[ae,le]=r.useState(!1),[ie,oe]=r.useState(!1),se=r.useCallback((e,t=!1)=>{if(0===Q)return;const r=_?(e%Q+Q)%Q:Math.min(Math.max(e,0),Q-1);te.current=t,void 0===M&&X(r),r!==Y&&S?.(r)},[Q,_,M,Y,S]);r.useEffect(()=>{if(te.current)return void(te.current=!1);if(!re.current)return void(re.current=!0);ee.current[Y]?.scrollIntoView({block:"nearest",inline:"start"}),ne.current=!0;const e=window.setTimeout(()=>{ne.current=!1},700);return()=>window.clearTimeout(e)},[Y]);const ce=u();r.useEffect(()=>{if(!z||ie||ae||ce||Q<2)return;const e=window.setInterval(()=>{document.hidden||se(Y+1)},I);return()=>window.clearInterval(e)},[z,ie,ae,ce,Q,I,Y,se]);const ue=Y<=0,de=Y>=Q-1,fe=z&&!ce&&Q>1,me=E&&Q>1;return t("div",{ref:y,role:"region","aria-roledescription":"carousel","aria-label":V??J.label,className:d("flex flex-col",q??""),style:{...b(k,L),...D},onPointerEnter:()=>le(!0),onPointerLeave:()=>le(!1),onFocus:()=>le(!0),onBlur:()=>le(!1),...H,children:[t("div",{className:["relative min-w-0 overflow-hidden",f[j],g[N],v].join(" "),children:[e("div",{ref:Z,tabIndex:0,role:"group","aria-label":V??J.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=Z.current;if(ne.current||!e||0===e.clientWidth)return;const t=Math.round(Math.abs(e.scrollLeft)/e.clientWidth);t!==Y&&t>=0&&t<Q&&se(t,!0)},children:O.map((t,r)=>e("div",{ref:e=>{ee.current[r]=e},role:"group","aria-roledescription":"slide","aria-label":K(r+1,Q),className:"w-full shrink-0 grow-0 basis-full snap-start",children:t},r))}),$&&Q>1?t("div",{className:`pointer-events-none absolute inset-y-0 flex items-center ${x[j]}`,children:[e(n,{variant:"solid",size:j,color:k,density:C,elevation:1,label:B??J.previous,disabled:!_&&ue,className:"pointer-events-auto",icon:e("span",{className:"flex items-center rotate-90 rtl:-rotate-90",children:e(o,{})}),onClick:()=>se(Y-1)}),e("span",{className:"flex-1"}),e(n,{variant:"solid",size:j,color:k,density:C,elevation:1,label:T??J.next,disabled:!_&&de,className:"pointer-events-auto",icon:e("span",{className:"flex items-center -rotate-90 rtl:rotate-90",children:e(o,{})}),onClick:()=>se(Y+1)})]}):null]}),fe||me?t("div",{className:"grid shrink-0 grid-cols-[1fr_auto_1fr] items-center pt-2",children:[e("span",{className:"flex justify-start",children:fe?e(n,{variant:"text",size:j,color:k,density:C,label:ie?A??J.play:W??J.pause,icon:e(ie?c:s,{}),onClick:()=>oe(e=>!e)}):null}),e("span",{className:`flex items-center ${w[j].gap}`,children:me?O.map((t,r)=>e("button",{type:"button","aria-label":K(r+1,Q),"aria-current":r===Y?"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",r===Y?`${w[j].current} bg-(--n-accent)`:`${w[j].rest} bg-(--n-line-hover) hover:bg-(--n-accent)`].join(" "),onClick:()=>se(r)},r)):null}),e("span",{})]}):null,e("span",{className:m,"aria-live":fe&&!ie?"off":"polite",children:Q>0?K(Y+1,Q):""})]})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as
|
|
1
|
+
"use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import*as n from"react";import{Checkbox as r}from"@base-ui/react/checkbox";import{Field as t}from"@base-ui/react/field";import{controlTextClasses as i,cx as o,hitAreaClasses as l,metaTextClasses as s,surfaceClasses as d,tickRadiusClasses as c,tickRowLeadingClasses as h,tickSizeClasses as b,transitionClasses as f}from"../../internal/styles.js";import{useStyleDefaults as p}from"../../internal/defaults.js";const m=["relative inline-flex shrink-0 items-center justify-center border",l,"[-webkit-tap-highlight-color:transparent] [touch-action:manipulation]",f,"active:[transition-duration:0ms]","focus-visible:[outline:2px_solid_var(--n-ring)] focus-visible:outline-offset-2"].join(" "),u=[d,"cursor-pointer bg-(--n-panel) [border-color:var(--n-line)]","hover:bg-(--n-panel-hover) hover:[border-color:var(--n-line-hover)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]","data-[checked]:hover:bg-(--n-fill-hover)","data-[indeterminate]:bg-(--n-fill) data-[indeterminate]:text-(--n-on-solid)","data-[indeterminate]:[border-color:transparent]"].join(" "),v=[d,"cursor-default bg-(--n-panel) [border-color:var(--n-line)]","[filter:saturate(0.55)]","data-[checked]:bg-(--n-fill) data-[checked]:text-(--n-on-solid)","data-[checked]:[border-color:transparent]"].join(" "),g=["cursor-not-allowed bg-transparent [border-color:var(--neba-disabled-border)]","text-(--neba-disabled-fg) shadow-none","data-[checked]:bg-(--neba-disabled-bg)","data-[indeterminate]:bg-(--neba-disabled-bg)"].join(" "),x=["flex size-[70%] items-center justify-center","[transition:opacity_var(--neba-duration)_var(--neba-ease)]","data-[starting-style]:opacity-0 data-[ending-style]:opacity-0","[&_path]:[stroke-dasharray:1]","[&_path]:[transition:stroke-dashoffset_var(--neba-duration)_var(--neba-ease)]","[&[data-starting-style]_path]:[stroke-dashoffset:1]","[&[data-ending-style]_path]:[stroke-dashoffset:1]"].join(" ");function k(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2 6.2 4.6 8.8 10 3.4",pathLength:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function y(){return e("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"size-full",children:e("path",{d:"M2.5 6h7",pathLength:"1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}export const Checkbox=/*@__PURE__*/n.forwardRef(function(n,l){const{size:d="md",color:f="primary",label:j,description:N,error:_,invalid:$,disabled:w=!1,readOnly:L=!1,className:z,classNames:C,style:R,...B}=p(n,["size"]),M=null!=_&&!1!==_&&""!==_,O=$??M,W=O?"danger":f,D={"--n-fill":`var(--neba-${W}-fill)`,"--n-fill-hover":`var(--neba-${W}-fill-hover)`,"--n-on-solid":`var(--neba-${W}-on-solid)`,"--n-accent":`var(--neba-${W}-accent)`,"--n-panel":"var(--neba-panel)","--n-panel-hover":"var(--neba-panel-hover)","--n-line":`var(--neba-${W}-line)`,"--n-line-hover":`var(--neba-${W}-line-hover)`,"--n-ring":`var(--neba-${W}-ring)`},E=[m,b[d],c[d],w?g:L?v:u].join(" ");return a(t.Root,{disabled:w,invalid:O,className:o("inline-flex flex-col gap-1 align-top",z??""),style:{...D,...R},children:[a("div",{className:`flex items-start gap-2 ${i[d]} ${h}`,children:[e("span",{className:"flex h-[1lh] shrink-0 items-center",children:e(r.Root,{ref:l,className:o(E,C?.control),disabled:w,readOnly:L,...B,children:e(r.Indicator,{className:o(x,C?.indicator),children:B.indeterminate?e(y,{}):e(k,{})})})}),j||N?a("span",{className:"flex min-w-0 flex-col gap-0.5",children:[j?e(t.Label,{className:o("leading-[1.4]",w?"text-(--neba-disabled-fg)":"cursor-pointer text-(--neba-fg)",C?.label),children:j}):null,N?e(t.Description,{className:o(s[d],"text-(--neba-muted-fg)",C?.description),children:N}):null]}):null]}),e(t.Error,M?{match:!0,className:o(s[d],"text-(--n-accent)",C?.error),children:_}:{className:o(s[d],"text-(--n-accent)",C?.error)})]})});
|