beez-ui 2.7.1 → 3.0.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/CHANGELOG.md +72 -0
- package/README.md +43 -13
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/components/account-menu.d.ts +4 -3
- package/dist/components/account-menu.js +63 -54
- package/dist/components/alert.d.ts +15 -15
- package/dist/components/alert.js +289 -270
- package/dist/components/animated-theme-toggler.js +1 -1
- package/dist/components/avatar.d.ts +56 -31
- package/dist/components/avatar.js +394 -277
- package/dist/components/badge.d.ts +8 -28
- package/dist/components/badge.js +55 -108
- package/dist/components/calendar.d.ts +36 -26
- package/dist/components/calendar.js +132 -1227
- package/dist/components/card.d.ts +36 -25
- package/dist/components/card.js +895 -72
- package/dist/components/carousel.d.ts +63 -47
- package/dist/components/carousel.js +496 -777
- package/dist/components/data-table.d.ts +5 -4
- package/dist/components/data-table.js +7 -6
- package/dist/components/dialog-surface.d.ts +23 -1
- package/dist/components/dialog-surface.js +99 -3
- package/dist/components/dialog.d.ts +80 -45
- package/dist/components/dialog.js +258 -503
- package/dist/components/dropdown-menu.d.ts +56 -73
- package/dist/components/dropdown-menu.js +79 -714
- package/dist/components/field.d.ts +3 -1
- package/dist/components/field.js +49 -39
- package/dist/components/filter-presets-bar.js +2 -2
- package/dist/components/filter-query-bar.js +1 -1
- package/dist/components/hover-card.d.ts +42 -41
- package/dist/components/hover-card.js +57 -483
- package/dist/components/pagination.d.ts +53 -31
- package/dist/components/pagination.js +176 -412
- package/dist/components/popover.d.ts +11 -23
- package/dist/components/popover.js +19 -304
- package/dist/components/{alert-dialog.d.ts → primitives/alert-dialog.d.ts} +17 -5
- package/dist/components/{alert-dialog.js → primitives/alert-dialog.js} +102 -54
- package/dist/components/primitives/avatar.d.ts +46 -0
- package/dist/components/primitives/avatar.js +267 -0
- package/dist/components/primitives/calendar.d.ts +37 -0
- package/dist/components/primitives/calendar.js +1250 -0
- package/dist/components/primitives/carousel.d.ts +106 -0
- package/dist/components/primitives/carousel.js +928 -0
- package/dist/components/primitives/dialog.d.ts +62 -0
- package/dist/components/primitives/dialog.js +490 -0
- package/dist/components/primitives/dropdown-menu-items.d.ts +59 -0
- package/dist/components/primitives/dropdown-menu-items.js +265 -0
- package/dist/components/primitives/dropdown-menu.d.ts +64 -0
- package/dist/components/primitives/dropdown-menu.js +557 -0
- package/dist/components/primitives/hover-card.d.ts +50 -0
- package/dist/components/primitives/hover-card.js +507 -0
- package/dist/components/primitives/pagination.d.ts +65 -0
- package/dist/components/primitives/pagination.js +373 -0
- package/dist/components/primitives/popover.d.ts +22 -0
- package/dist/components/primitives/popover.js +213 -0
- package/dist/components/primitives/select.d.ts +36 -0
- package/dist/components/primitives/select.js +407 -0
- package/dist/components/primitives/tooltip.d.ts +30 -0
- package/dist/components/primitives/tooltip.js +277 -0
- package/dist/components/radio-group.d.ts +30 -17
- package/dist/components/radio-group.js +266 -315
- package/dist/components/rich-link-editor.js +1 -1
- package/dist/components/select.d.ts +51 -42
- package/dist/components/select.js +163 -495
- package/dist/components/skeleton.d.ts +16 -15
- package/dist/components/skeleton.js +99 -205
- package/dist/components/split-button.js +1 -1
- package/dist/components/switch.d.ts +3 -6
- package/dist/components/switch.js +163 -170
- package/dist/components/tabs.d.ts +3 -11
- package/dist/components/tabs.js +61 -75
- package/dist/components/themed-toaster.d.ts +1 -1
- package/dist/components/themed-toaster.js +1 -1
- package/dist/components/toaster.d.ts +1 -1
- package/dist/components/toaster.js +1 -1
- package/dist/components/tooltip.d.ts +36 -31
- package/dist/components/tooltip.js +44 -284
- package/dist/constants/alert.d.ts +5 -1
- package/dist/constants/alert.js +5 -1
- package/dist/constants/avatar.d.ts +24 -1
- package/dist/constants/avatar.js +19 -0
- package/dist/constants/calendar.d.ts +12 -0
- package/dist/constants/calendar.js +12 -0
- package/dist/constants/card.d.ts +23 -0
- package/dist/constants/card.js +20 -0
- package/dist/constants/carousel.d.ts +31 -13
- package/dist/constants/carousel.js +32 -11
- package/dist/constants/dialog.d.ts +6 -1
- package/dist/constants/dialog.js +5 -1
- package/dist/constants/dropdown-menu.d.ts +2 -2
- package/dist/constants/dropdown-menu.js +2 -2
- package/dist/constants/pagination.d.ts +13 -2
- package/dist/constants/pagination.js +13 -2
- package/dist/constants/select.d.ts +4 -2
- package/dist/constants/select.js +4 -2
- package/dist/constants/switch.d.ts +5 -16
- package/dist/constants/switch.js +6 -14
- package/dist/hooks/use-today.d.ts +7 -0
- package/dist/hooks/use-today.js +50 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.js +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/motion/glide-indicator.d.ts +1 -1
- package/dist/motion/glide-indicator.js +1 -1
- package/dist/motion/presence.d.ts +0 -1
- package/dist/motion/presence.js +0 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -6
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal carousel composition on Embla with Arc's carousel design (https://uiarc.dev, MIT License, see
|
|
3
|
+
* THIRD_PARTY_NOTICES.md): a focusable, draggable slide area with Arc's grab cursor, round outlined controls on the
|
|
4
|
+
* surface that answer hover on fine pointers and press in, Home and End to reach the edges, and Arc's indicator tab list
|
|
5
|
+
* whose pill stretches and travels with the slides frame by frame. Embla keeps dragging, snapping and looping.
|
|
6
|
+
*
|
|
7
|
+
* Not exported from the package: the public `Carousel` (`../carousel.tsx`) composes these parts behind Arc's closed API.
|
|
8
|
+
*/
|
|
9
|
+
import * as React from "react";
|
|
10
|
+
import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react";
|
|
11
|
+
import type { MotionValue } from "motion/react";
|
|
12
|
+
import { ControlButton } from "../control-button.js";
|
|
13
|
+
/** Embla's API, kept inside beez-ui. */
|
|
14
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
15
|
+
/** Embla options the public carousel forwards. */
|
|
16
|
+
type CarouselOptions = Parameters<typeof useEmblaCarousel>[0];
|
|
17
|
+
type CarouselProps = {
|
|
18
|
+
/** Embla options. Keep the object's values stable: Embla re-initializes when they change. */
|
|
19
|
+
opts?: CarouselOptions;
|
|
20
|
+
/** Receives Embla's API once it is created, and `undefined` when it is destroyed. */
|
|
21
|
+
setApi?: (api: CarouselApi) => void;
|
|
22
|
+
};
|
|
23
|
+
type CarouselContextProps = {
|
|
24
|
+
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
25
|
+
api: CarouselApi;
|
|
26
|
+
opts?: CarouselOptions;
|
|
27
|
+
scrollPrev: () => void;
|
|
28
|
+
scrollNext: () => void;
|
|
29
|
+
canScrollPrev: boolean;
|
|
30
|
+
canScrollNext: boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Reads the carousel the part is rendered in.
|
|
34
|
+
* @returns The shared Embla API, scroll actions and edge state.
|
|
35
|
+
*/
|
|
36
|
+
declare function useCarousel(): CarouselContextProps;
|
|
37
|
+
/**
|
|
38
|
+
* The carousel root: a named section that owns the arrow, Home and End keys pressed inside it.
|
|
39
|
+
* @param props - Embla options and API callback plus native section attributes.
|
|
40
|
+
* @returns The carousel section.
|
|
41
|
+
*/
|
|
42
|
+
declare function Carousel({ opts, setApi, className, children, ...props }: React.ComponentProps<"section"> & CarouselProps): React.JSX.Element;
|
|
43
|
+
type CarouselContentProps = React.ComponentProps<"div"> & {
|
|
44
|
+
/** Accessible name of the focusable slide area. */
|
|
45
|
+
viewportLabel?: string;
|
|
46
|
+
/** Class of the clipped viewport around the slide track. */
|
|
47
|
+
viewportClassName?: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The clipped, focusable viewport and the slide track. While the track can be dragged it shows Arc's grab cursor on
|
|
51
|
+
* fine pointers, and a grabbing cursor while a drag is held. A click on a neighbouring slide selects it, as in Arc.
|
|
52
|
+
* @param props - Viewport copy and class plus native attributes of the track.
|
|
53
|
+
* @returns The viewport holding the track.
|
|
54
|
+
*/
|
|
55
|
+
declare function CarouselContent({ className, viewportLabel, viewportClassName, ...props }: CarouselContentProps): React.JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* One slide. Its trailing margin is the gap to the next slide, so Embla measures it and centers the slide itself. It is
|
|
58
|
+
* a group described as a slide; pass `role="tabpanel"` only when indicator tabs control it.
|
|
59
|
+
* @param props - Native attributes of the slide panel.
|
|
60
|
+
* @returns The slide panel.
|
|
61
|
+
*/
|
|
62
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
63
|
+
/**
|
|
64
|
+
* Moves to the previous slide. It stays focusable and reports `aria-disabled` at the first slide, so focus is never
|
|
65
|
+
* lost when the carousel reaches its edge.
|
|
66
|
+
* @param props - Control button attributes; `aria-label` defaults to "Diapositiva anterior".
|
|
67
|
+
* @returns The previous control.
|
|
68
|
+
*/
|
|
69
|
+
declare function CarouselPrevious({ className, onClick, ...props }: React.ComponentProps<typeof ControlButton>): React.JSX.Element;
|
|
70
|
+
/**
|
|
71
|
+
* Moves to the next slide. It stays focusable and reports `aria-disabled` at the last slide.
|
|
72
|
+
* @param props - Control button attributes; `aria-label` defaults to "Diapositiva siguiente".
|
|
73
|
+
* @returns The next control.
|
|
74
|
+
*/
|
|
75
|
+
declare function CarouselNext({ className, onClick, ...props }: React.ComponentProps<typeof ControlButton>): React.JSX.Element;
|
|
76
|
+
/**
|
|
77
|
+
* Default accessible name of one slide and its indicator, for example "Diapositiva 2 de 5".
|
|
78
|
+
* @param index - Zero-based slide position.
|
|
79
|
+
* @param count - Number of slides.
|
|
80
|
+
* @returns The Spanish slide label.
|
|
81
|
+
*/
|
|
82
|
+
declare function defaultCarouselSlideLabel(index: number, count: number): string;
|
|
83
|
+
type CarouselIndicatorsProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
84
|
+
/** Accessible name of the indicator tab list. Defaults to "Elegir una diapositiva". */
|
|
85
|
+
label?: string;
|
|
86
|
+
/** Names each indicator. Defaults to "Diapositiva 2 de 5". */
|
|
87
|
+
slideLabel?: (index: number, count: number) => string;
|
|
88
|
+
/** Id of the slide panel an indicator controls. */
|
|
89
|
+
getSlideId?: (index: number) => string;
|
|
90
|
+
/** Rotation time spent on the selected slide, from 0 to 1; it drains the selected pill from its end. */
|
|
91
|
+
drain?: MotionValue<number>;
|
|
92
|
+
/** Snap points expected before Embla measures, so server-rendered tabs keep their place. Defaults to 0. */
|
|
93
|
+
initialCount?: number;
|
|
94
|
+
/** Selected snap expected before Embla measures. Defaults to 0. */
|
|
95
|
+
initialIndex?: number;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Arc's page indicator: a tab per snap point, where the selected one stretches into a pill that follows the track frame
|
|
99
|
+
* by frame while it is dragged or scrolled. Only the selected tab is in the tab order; activating a tab scrolls to its
|
|
100
|
+
* slide, and while a tab has focus the carousel's arrow, Home and End keys move the focus to the tab of the new slide.
|
|
101
|
+
* It renders once Embla has measured the slides, or from `initialCount` until then. Place it inside `Carousel`.
|
|
102
|
+
* @param props - Optional accessible copy, slide ids and rotation drain plus native attributes of the list.
|
|
103
|
+
* @returns The indicator tab list, or nothing until there is more than one snap point.
|
|
104
|
+
*/
|
|
105
|
+
declare function CarouselIndicators({ className, label, slideLabel, getSlideId, drain, initialCount, initialIndex, ...props }: CarouselIndicatorsProps): React.JSX.Element | null;
|
|
106
|
+
export { type CarouselApi, type CarouselOptions, type CarouselIndicatorsProps, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, CarouselIndicators, defaultCarouselSlideLabel, useCarousel, };
|