beez-ui 2.7.1 → 3.0.1
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 +78 -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 +268 -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 +29 -1
- package/dist/constants/avatar.js +25 -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
|
@@ -1,55 +1,71 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Arc's Carousel (https://uiarc.dev, MIT License, see THIRD_PARTY_NOTICES.md) as a closed component: one child per
|
|
3
|
+
* slide, a centered slide row that is dragged, flicked or arrowed through, and a control row under it with an optional
|
|
4
|
+
* rotation control, the indicator tab list and the arrows. Embla runs inside and is never exposed; the beez-ui
|
|
5
|
+
* extensions (`loop`, `duration`, `watchFocus`, `onSettle`, deferred re-initialization, labels and visibility of the
|
|
6
|
+
* controls) cover media viewers that used Embla's API directly.
|
|
6
7
|
*/
|
|
7
8
|
import * as React from "react";
|
|
8
|
-
|
|
9
|
-
import { type CarouselOrientation } from "../constants/carousel.js";
|
|
10
|
-
import { ControlButton } from "./control-button.js";
|
|
11
|
-
type CarouselApi = UseEmblaCarouselType[1];
|
|
12
|
-
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
13
|
-
type CarouselOptions = UseCarouselParameters[0];
|
|
14
|
-
type CarouselPlugin = UseCarouselParameters[1];
|
|
9
|
+
/** Props of {@link Carousel}: Arc's carousel API plus the beez-ui extensions marked below. */
|
|
15
10
|
type CarouselProps = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
declare function useCarousel(): CarouselContextProps;
|
|
30
|
-
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
|
|
31
|
-
/**
|
|
32
|
-
* The clipped viewport and the slide track. While the track can be dragged it shows Arc's grab cursor on fine
|
|
33
|
-
* pointers, and a grabbing cursor while a drag is held.
|
|
34
|
-
*/
|
|
35
|
-
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
36
|
-
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
37
|
-
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof ControlButton>): React.JSX.Element;
|
|
38
|
-
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof ControlButton>): React.JSX.Element;
|
|
39
|
-
type CarouselIndicatorsProps = Omit<React.ComponentProps<"div">, "children"> & {
|
|
40
|
-
/** Accessible name of the indicator list. Defaults to "Elegir una diapositiva". */
|
|
41
|
-
label?: string;
|
|
42
|
-
/** Names each indicator. Defaults to "Diapositiva 2 de 5". */
|
|
11
|
+
/** Names the carousel for assistive technology, for example "Fotos del encuentro". */
|
|
12
|
+
label: string;
|
|
13
|
+
/** One child per slide. Give each a stable `key` when the list can change. */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/** Controlled active slide. Pair with `onIndexChange`. */
|
|
16
|
+
index?: number;
|
|
17
|
+
/** Initial slide when uncontrolled. Defaults to 0. */
|
|
18
|
+
defaultIndex?: number;
|
|
19
|
+
/** Called as soon as the active slide changes, when the scroll toward it starts. */
|
|
20
|
+
onIndexChange?: (index: number) => void;
|
|
21
|
+
/** Width of one slide as a CSS length; `cqw` is a share of the carousel width. Defaults to `min(80cqw, 340px)`. */
|
|
22
|
+
slideSize?: string;
|
|
23
|
+
/** Names each slide and its indicator. Defaults to "Diapositiva 2 de 5". */
|
|
43
24
|
slideLabel?: (index: number, count: number) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Milliseconds per slide. Adds a play control that rotates through the slides; rotation pauses on hover, keyboard
|
|
27
|
+
* focus, drag, offscreen and in hidden tabs; with reduced motion the control stays but is disabled.
|
|
28
|
+
*/
|
|
29
|
+
interval?: number;
|
|
30
|
+
/** Starts rotating on mount. Off by default, so motion begins with the viewer. */
|
|
31
|
+
autoplay?: boolean;
|
|
32
|
+
/** Class of the root section. */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** beez-ui: wraps from the last slide to the first and back. Defaults to `false`. */
|
|
35
|
+
loop?: boolean;
|
|
36
|
+
/** beez-ui: speed of a scroll between slides, in Embla's units (higher is slower). Defaults to Embla's 25. */
|
|
37
|
+
duration?: number;
|
|
38
|
+
/**
|
|
39
|
+
* beez-ui: scrolls to a slide when something inside it receives focus. Defaults to `true`; turn it off when a slide
|
|
40
|
+
* holds content that keeps focus, such as an embedded player, so it never pulls the carousel back.
|
|
41
|
+
*/
|
|
42
|
+
watchFocus?: boolean;
|
|
43
|
+
/** beez-ui: called once a scroll has come to rest on a slide, the moment to mount heavy slide content. */
|
|
44
|
+
onSettle?: (index: number) => void;
|
|
45
|
+
/** beez-ui: accessible name of the previous arrow. Defaults to "Diapositiva anterior". */
|
|
46
|
+
previousLabel?: string;
|
|
47
|
+
/** beez-ui: accessible name of the next arrow. Defaults to "Diapositiva siguiente". */
|
|
48
|
+
nextLabel?: string;
|
|
49
|
+
/** beez-ui: shows the previous and next arrows. Defaults to `true`. */
|
|
50
|
+
showControls?: boolean;
|
|
51
|
+
/** beez-ui: shows the indicator tab list. Defaults to `true`. */
|
|
52
|
+
showIndicators?: boolean;
|
|
53
|
+
/** beez-ui: class added to every slide panel. */
|
|
54
|
+
slideClassName?: string;
|
|
55
|
+
/**
|
|
56
|
+
* beez-ui: class of the clipped, focusable viewport around the slide track, for example to give a media viewer a
|
|
57
|
+
* definite height.
|
|
58
|
+
*/
|
|
59
|
+
viewportClassName?: string;
|
|
60
|
+
/** beez-ui: class of the slide track inside the viewport, which lays the slides out in a row. */
|
|
61
|
+
trackClassName?: string;
|
|
44
62
|
};
|
|
45
63
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* once Embla has measured the slides. Place it inside `Carousel`.
|
|
51
|
-
* @param props - Optional accessible copy plus native attributes of the list.
|
|
52
|
-
* @returns The indicator list, or nothing until there is more than one snap point.
|
|
64
|
+
* A centered row of slides browsed by drag, flick, the arrow keys, Home and End, the arrows or the indicator tabs, with
|
|
65
|
+
* optional rotation. Neighbouring slides stay in view as a hint that there is more, and are inert until selected.
|
|
66
|
+
* @param props - Arc's carousel props plus the beez-ui extensions.
|
|
67
|
+
* @returns The carousel section.
|
|
53
68
|
*/
|
|
54
|
-
declare function
|
|
55
|
-
export {
|
|
69
|
+
declare function Carousel({ label, children, index: controlledIndex, defaultIndex, onIndexChange, slideSize, slideLabel, interval, autoplay, className, loop, duration, watchFocus, onSettle, previousLabel, nextLabel, showControls, showIndicators, slideClassName, viewportClassName, trackClassName, }: CarouselProps): React.JSX.Element;
|
|
70
|
+
export { Carousel };
|
|
71
|
+
export type { CarouselProps };
|