@giddaa-housing/ui 3.3.0 → 3.5.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/css/generated/shared.css +1 -1
- package/css/theme.css +20 -0
- package/dist/accordion.js +1 -1
- package/dist/activity-timeline.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/auth-layout.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge.js +6 -1
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/bullet-chart.js +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar.js +2 -2
- package/dist/call-card.js +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.js +2 -2
- package/dist/chart.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/collapsible.js +1 -1
- package/dist/combobox-B7cKFJ9V.js +398 -0
- package/dist/combobox.d.ts +2 -2
- package/dist/combobox.js +1 -308
- package/dist/cta.js +1 -1
- package/dist/currency-selector.js +2 -2
- package/dist/data-table.d.ts +1 -1
- package/dist/data-table.js +1 -1
- package/dist/date-picker.d.ts +4 -3
- package/dist/date-picker.js +7 -17
- package/dist/details-card.js +1 -1
- package/dist/dialog.js +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/dropzone.js +1 -1
- package/dist/editorial-card.js +2 -4
- package/dist/empty-state.js +1 -1
- package/dist/field.js +1 -1
- package/dist/file-upload.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/footer.js +1 -1
- package/dist/funnel-chart.js +1 -1
- package/dist/gallery-indicator.js +1 -1
- package/dist/icons-C9JXR5Xv.d.ts +111 -0
- package/dist/icons.d.ts +2 -93
- package/dist/icons.js +37 -1
- package/dist/image.d.ts +59 -0
- package/dist/image.js +53 -0
- package/dist/infinite-scroll.js +3 -29
- package/dist/infotip.js +1 -1
- package/dist/input-group.js +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.js +1 -1
- package/dist/item.js +1 -1
- package/dist/kpi-card.js +1 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.js +1 -1
- package/dist/list-item.js +1 -1
- package/dist/map-indicator.js +1 -1
- package/dist/match.js +1 -1
- package/dist/media-gallery-hero.js +6 -3
- package/dist/media-player.js +5 -13
- package/dist/message.js +2 -12
- package/dist/mobile-sidebar.js +1 -1
- package/dist/multi-step-form.js +2 -2
- package/dist/number-input.js +1 -1
- package/dist/page-header.js +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-input.js +1 -1
- package/dist/phone-input.js +11 -17
- package/dist/photo-gallery.js +6 -3
- package/dist/picker-CsnHtbe4.d.ts +14 -0
- package/dist/{picker-xSTzeYhc.js → picker-DmIiQKLJ.js} +2 -7
- package/dist/pie-chart.js +1 -1
- package/dist/popover-DSlPeH7x.d.ts +20 -0
- package/dist/popover.d.ts +1 -19
- package/dist/popover.js +1 -1
- package/dist/price-tag.d.ts +80 -12
- package/dist/price-tag.js +139 -70
- package/dist/progress.js +1 -1
- package/dist/property-listing-card.d.ts +63 -1
- package/dist/property-listing-card.js +97 -28
- package/dist/purchase-option-card.js +1 -1
- package/dist/radar-chart.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/review-block.js +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/scatter-chart.js +1 -1
- package/dist/scroll-spy.d.ts +16 -1
- package/dist/scroll-spy.js +28 -5
- package/dist/search-input.js +1 -1
- package/dist/select.js +1 -1
- package/dist/separator.js +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.js +3 -16
- package/dist/skeleton.js +1 -1
- package/dist/slider.js +1 -1
- package/dist/sonar.d.ts +51 -0
- package/dist/sonar.js +117 -0
- package/dist/sparkline.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/styles.css +85 -2
- package/dist/switch.js +1 -1
- package/dist/table-card.js +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/testimonial-block.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/theme-switcher.js +1 -1
- package/dist/time-picker.d.ts +3 -2
- package/dist/time-picker.js +5 -7
- package/dist/toast.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/top-navbar.js +1 -1
- package/dist/tree-map.js +1 -1
- package/dist/utils/cn.d.ts +5 -0
- package/dist/utils/cn.js +33 -0
- package/dist/utils/format.d.ts +45 -0
- package/dist/utils/format.js +70 -0
- package/dist/utils/phone.d.ts +98 -0
- package/dist/utils/phone.js +93 -0
- package/dist/utils/use-intersection.d.ts +9 -0
- package/dist/utils/use-intersection.js +29 -0
- package/dist/utils/use-is-mobile.d.ts +5 -0
- package/dist/utils/use-is-mobile.js +16 -0
- package/dist/utils/use-reduced-motion.d.ts +5 -0
- package/dist/{use-reduced-motion-BDvOK14x.js → utils/use-reduced-motion.js} +2 -2
- package/dist/utils/use-uncontrolled.d.ts +11 -0
- package/dist/{use-uncontrolled-CLfM1XbB.js → utils/use-uncontrolled.js} +2 -2
- package/dist/video-player-dialog.d.ts +12 -2
- package/dist/video-player-dialog.js +47 -7
- package/dist/waterfall-chart.js +1 -1
- package/package.json +13 -1
- package/dist/cn-BI_4DMBf.js +0 -23
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { n as ButtonLink, t as Button } from "./button-DW5OijoR.js";
|
|
2
|
+
import { Carousel, CarouselIndicator, CarouselItem } from "./carousel.js";
|
|
3
|
+
import { ImageProps } from "./image.js";
|
|
2
4
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
5
|
import { VariantProps } from "class-variance-authority";
|
|
4
6
|
import * as React from "react";
|
|
@@ -6,6 +8,10 @@ import * as React from "react";
|
|
|
6
8
|
declare const propertyListingCardVariants: (props?: ({
|
|
7
9
|
variant?: "default" | "elevated" | null | undefined;
|
|
8
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Render `PropertyListingCardImage` yourself, which takes `src`,
|
|
13
|
+
* `alt` and every other image prop directly. Removed in the next major.
|
|
14
|
+
*/
|
|
9
15
|
type PropertyListingImage = {
|
|
10
16
|
id?: string;
|
|
11
17
|
src?: string;
|
|
@@ -13,9 +19,65 @@ type PropertyListingImage = {
|
|
|
13
19
|
};
|
|
14
20
|
interface PropertyListingCardProps extends React.ComponentProps<"article">, VariantProps<typeof propertyListingCardVariants> {}
|
|
15
21
|
declare function PropertyListingCard({ className, variant, ...props }: PropertyListingCardProps): React.JSX.Element;
|
|
22
|
+
/**
|
|
23
|
+
* The media well: a positioned box the backdrop and the overlays share. The
|
|
24
|
+
* backdrop — one image, a carousel of them, or the placeholder — sits at
|
|
25
|
+
* `-z-10`; everything else stacks above it.
|
|
26
|
+
*
|
|
27
|
+
* Compose the backdrop as children and it stays yours to arrange:
|
|
28
|
+
*
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <PropertyListingCardMedia>
|
|
31
|
+
* <PropertyListingCardCarousel>
|
|
32
|
+
* <CarouselContent>
|
|
33
|
+
* {images.map((image) => (
|
|
34
|
+
* <PropertyListingCardCarouselItem key={image.id}>
|
|
35
|
+
* <PropertyListingCardImage src={image.src} alt={image.alt} loading="lazy" />
|
|
36
|
+
* </PropertyListingCardCarouselItem>
|
|
37
|
+
* ))}
|
|
38
|
+
* </CarouselContent>
|
|
39
|
+
* <PropertyListingCardCarouselIndicator className="bottom-20" />
|
|
40
|
+
* </PropertyListingCardCarousel>
|
|
41
|
+
* <PropertyListingCardMediaTop>…</PropertyListingCardMediaTop>
|
|
42
|
+
* </PropertyListingCardMedia>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
16
45
|
declare function PropertyListingCardMedia({ className, images, children, ...props }: React.ComponentProps<"div"> & {
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Compose the backdrop from `PropertyListingCardCarousel`,
|
|
48
|
+
* `PropertyListingCardImage` and `PropertyListingCardImagePlaceholder`
|
|
49
|
+
* instead. Building it from a list left no way to lazy-load a photo, move
|
|
50
|
+
* the indicator off the options bar, or hand the images to a framework's
|
|
51
|
+
* own image component. Removed in the next major.
|
|
52
|
+
*/
|
|
17
53
|
images?: PropertyListingImage[];
|
|
18
54
|
}): React.JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* The carousel, sized to fill the media well and sunk behind the overlays.
|
|
57
|
+
* Fill it with `CarouselContent` from `@giddaa-housing/ui/carousel` — every
|
|
58
|
+
* carousel part works here, including `CarouselPrevious`/`CarouselNext`.
|
|
59
|
+
*/
|
|
60
|
+
declare function PropertyListingCardCarousel({ className, opts, ...props }: React.ComponentProps<typeof Carousel>): React.JSX.Element;
|
|
61
|
+
declare function PropertyListingCardCarouselItem({ className, ...props }: React.ComponentProps<typeof CarouselItem>): React.JSX.Element;
|
|
62
|
+
/**
|
|
63
|
+
* The indicator, lifted clear of the options bar by default. That bar is
|
|
64
|
+
* `min-h-9.5` and the media may carry a price tag above it, so the offset is
|
|
65
|
+
* a starting point rather than a rule — `className="bottom-20"` or any other
|
|
66
|
+
* `bottom-*` moves it.
|
|
67
|
+
*/
|
|
68
|
+
declare function PropertyListingCardCarouselIndicator({ className, size, ...props }: React.ComponentProps<typeof CarouselIndicator>): React.JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* A listing photo. Takes everything an `<img>` does — `loading="lazy"`,
|
|
71
|
+
* `fetchPriority`, `sizes`, `srcSet` — and `render` swaps the element for a
|
|
72
|
+
* framework's image component. `ImageProvider` does the same for every image
|
|
73
|
+
* in the tree at once.
|
|
74
|
+
*/
|
|
75
|
+
declare function PropertyListingCardImage({ image, alt, src, className, ...props }: ImageProps & {
|
|
76
|
+
/** @deprecated Pass `src` and `alt` directly. Removed in the next major. */
|
|
77
|
+
image?: PropertyListingImage;
|
|
78
|
+
}): React.JSX.Element;
|
|
79
|
+
/** Stands in for a listing with no photo, filling the well behind the overlays. */
|
|
80
|
+
declare function PropertyListingCardImagePlaceholder({ className, children, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
81
|
declare function PropertyListingCardMediaTop({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
20
82
|
declare function PropertyListingCardOptionsBar({ className, render, ...props }: useRender.ComponentProps<"a">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
21
83
|
declare function PropertyListingCardDetails({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -26,4 +88,4 @@ declare function PropertyListingCardActions({ className, ...props }: React.Compo
|
|
|
26
88
|
declare function PropertyListingCardActionButton({ className, type, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
27
89
|
declare function PropertyListingCardActionButtonLink({ className, ...props }: React.ComponentProps<typeof ButtonLink>): React.JSX.Element;
|
|
28
90
|
//#endregion
|
|
29
|
-
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardDetails, PropertyListingCardMedia, PropertyListingCardMediaTop, PropertyListingCardOptionsBar, PropertyListingCardOverview, type PropertyListingCardProps, PropertyListingCardTitle, type PropertyListingImage, propertyListingCardVariants };
|
|
91
|
+
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardCarousel, PropertyListingCardCarouselIndicator, PropertyListingCardCarouselItem, PropertyListingCardDetails, PropertyListingCardImage, PropertyListingCardImagePlaceholder, PropertyListingCardMedia, PropertyListingCardMediaTop, PropertyListingCardOptionsBar, PropertyListingCardOverview, type PropertyListingCardProps, PropertyListingCardTitle, type PropertyListingImage, propertyListingCardVariants };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { Button, ButtonLink } from "./button.js";
|
|
4
4
|
import { Carousel, CarouselContent, CarouselIndicator, CarouselItem } from "./carousel.js";
|
|
5
|
+
import { Image } from "./image.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
7
8
|
import { useRender } from "@base-ui/react/use-render";
|
|
@@ -20,39 +21,107 @@ function PropertyListingCard({ className, variant, ...props }) {
|
|
|
20
21
|
...props
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The media well: a positioned box the backdrop and the overlays share. The
|
|
26
|
+
* backdrop — one image, a carousel of them, or the placeholder — sits at
|
|
27
|
+
* `-z-10`; everything else stacks above it.
|
|
28
|
+
*
|
|
29
|
+
* Compose the backdrop as children and it stays yours to arrange:
|
|
30
|
+
*
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <PropertyListingCardMedia>
|
|
33
|
+
* <PropertyListingCardCarousel>
|
|
34
|
+
* <CarouselContent>
|
|
35
|
+
* {images.map((image) => (
|
|
36
|
+
* <PropertyListingCardCarouselItem key={image.id}>
|
|
37
|
+
* <PropertyListingCardImage src={image.src} alt={image.alt} loading="lazy" />
|
|
38
|
+
* </PropertyListingCardCarouselItem>
|
|
39
|
+
* ))}
|
|
40
|
+
* </CarouselContent>
|
|
41
|
+
* <PropertyListingCardCarouselIndicator className="bottom-20" />
|
|
42
|
+
* </PropertyListingCardCarousel>
|
|
43
|
+
* <PropertyListingCardMediaTop>…</PropertyListingCardMediaTop>
|
|
44
|
+
* </PropertyListingCardMedia>
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
function PropertyListingCardMedia({ className, images, children, ...props }) {
|
|
25
48
|
return /* @__PURE__ */ jsxs("div", {
|
|
26
49
|
className: cn("relative isolate min-h-70 overflow-hidden rounded-t-2xl bg-surface text-fg-primary", className),
|
|
27
50
|
...props,
|
|
28
|
-
children: [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
children: [images ? /* @__PURE__ */ jsx(PropertyListingCardMediaBackdrop, { images }) : null, children]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** The backdrop the deprecated `images` prop builds, unchanged. */
|
|
55
|
+
function PropertyListingCardMediaBackdrop({ images }) {
|
|
56
|
+
if (images.length > 1) return /* @__PURE__ */ jsxs(PropertyListingCardCarousel, { children: [/* @__PURE__ */ jsx(CarouselContent, { children: images.map((carouselImage, index) => /* @__PURE__ */ jsx(PropertyListingCardCarouselItem, { children: /* @__PURE__ */ jsx(PropertyListingCardImage, { image: carouselImage }) }, carouselImage.id ?? carouselImage.src ?? carouselImage.alt ?? index)) }), /* @__PURE__ */ jsx(PropertyListingCardCarouselIndicator, {})] });
|
|
57
|
+
if (images[0]?.src) return /* @__PURE__ */ jsx(PropertyListingCardImage, {
|
|
58
|
+
image: images[0],
|
|
59
|
+
className: "absolute inset-0 -z-10"
|
|
60
|
+
});
|
|
61
|
+
return /* @__PURE__ */ jsx(PropertyListingCardImagePlaceholder, {});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The carousel, sized to fill the media well and sunk behind the overlays.
|
|
65
|
+
* Fill it with `CarouselContent` from `@giddaa-housing/ui/carousel` — every
|
|
66
|
+
* carousel part works here, including `CarouselPrevious`/`CarouselNext`.
|
|
67
|
+
*/
|
|
68
|
+
function PropertyListingCardCarousel({ className, opts, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(Carousel, {
|
|
70
|
+
"data-slot": "property-listing-card-carousel",
|
|
71
|
+
imageSize: "full",
|
|
72
|
+
opts: {
|
|
73
|
+
loop: true,
|
|
74
|
+
...opts
|
|
75
|
+
},
|
|
76
|
+
className: cn("absolute inset-0 -z-10 size-full rounded-none bg-surface", className),
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function PropertyListingCardCarouselItem({ className, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx(CarouselItem, {
|
|
82
|
+
"data-slot": "property-listing-card-carousel-item",
|
|
83
|
+
className: cn("relative h-full", className),
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The indicator, lifted clear of the options bar by default. That bar is
|
|
89
|
+
* `min-h-9.5` and the media may carry a price tag above it, so the offset is
|
|
90
|
+
* a starting point rather than a rule — `className="bottom-20"` or any other
|
|
91
|
+
* `bottom-*` moves it.
|
|
92
|
+
*/
|
|
93
|
+
function PropertyListingCardCarouselIndicator({ className, size = "sm", ...props }) {
|
|
94
|
+
return /* @__PURE__ */ jsx(CarouselIndicator, {
|
|
95
|
+
"data-slot": "property-listing-card-carousel-indicator",
|
|
96
|
+
size,
|
|
97
|
+
className: cn("bottom-16", className),
|
|
98
|
+
...props
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A listing photo. Takes everything an `<img>` does — `loading="lazy"`,
|
|
103
|
+
* `fetchPriority`, `sizes`, `srcSet` — and `render` swaps the element for a
|
|
104
|
+
* framework's image component. `ImageProvider` does the same for every image
|
|
105
|
+
* in the tree at once.
|
|
106
|
+
*/
|
|
107
|
+
function PropertyListingCardImage({ image, alt, src, className, ...props }) {
|
|
108
|
+
return /* @__PURE__ */ jsx(Image, {
|
|
109
|
+
slot: "property-listing-card-image",
|
|
110
|
+
src: src ?? image?.src,
|
|
111
|
+
alt: alt ?? image?.alt ?? "Property image",
|
|
52
112
|
className: cn("size-full object-cover", className),
|
|
53
113
|
...props
|
|
54
114
|
});
|
|
55
115
|
}
|
|
116
|
+
/** Stands in for a listing with no photo, filling the well behind the overlays. */
|
|
117
|
+
function PropertyListingCardImagePlaceholder({ className, children = "Property Image", ...props }) {
|
|
118
|
+
return /* @__PURE__ */ jsx("div", {
|
|
119
|
+
"data-slot": "property-listing-card-image-placeholder",
|
|
120
|
+
className: cn("absolute inset-0 -z-10 grid place-items-center bg-surface-raised text-gdt-sm font-bold text-fg-caption-placeholder", className),
|
|
121
|
+
...props,
|
|
122
|
+
children
|
|
123
|
+
});
|
|
124
|
+
}
|
|
56
125
|
function PropertyListingCardMediaTop({ className, ...props }) {
|
|
57
126
|
return /* @__PURE__ */ jsx("div", {
|
|
58
127
|
className: cn("absolute inset-x-2 top-2 z-10 flex items-start justify-between gap-3", className),
|
|
@@ -115,4 +184,4 @@ function PropertyListingCardActionButtonLink({ className, ...props }) {
|
|
|
115
184
|
});
|
|
116
185
|
}
|
|
117
186
|
//#endregion
|
|
118
|
-
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardDetails, PropertyListingCardMedia, PropertyListingCardMediaTop, PropertyListingCardOptionsBar, PropertyListingCardOverview, PropertyListingCardTitle, propertyListingCardVariants };
|
|
187
|
+
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardCarousel, PropertyListingCardCarouselIndicator, PropertyListingCardCarouselItem, PropertyListingCardDetails, PropertyListingCardImage, PropertyListingCardImagePlaceholder, PropertyListingCardMedia, PropertyListingCardMediaTop, PropertyListingCardOptionsBar, PropertyListingCardOverview, PropertyListingCardTitle, propertyListingCardVariants };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
5
|
import { useRender } from "@base-ui/react/use-render";
|
package/dist/radar-chart.js
CHANGED
package/dist/radio-group.js
CHANGED
package/dist/review-block.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
5
5
|
import { useRender } from "@base-ui/react/use-render";
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { AlignCenter, AlignJustify, AlignLeft, AlignRight, Baseline, Bold, ChevronDown, Code2, Image as Image$1, Italic, Link2, List, ListOrdered, Quote, Redo2, Underline, Undo2 } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { useComponentSize } from "./size-context.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Input } from "./input.js";
|
package/dist/scatter-chart.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { SizeProvider, useComponentSize } from "./size-context.js";
|
|
4
4
|
import { ChartContainer, cartesianAxisProps } from "./chart.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/scroll-spy.d.ts
CHANGED
|
@@ -2,6 +2,21 @@ import { t as ComponentSize } from "./size-context-BX6kAdVj.js";
|
|
|
2
2
|
import { TabsListVariant } from "./tabs.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
//#region src/scroll-spy.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Read and drive the spy from anywhere inside a `ScrollSpy` — an overflow
|
|
7
|
+
* "More" menu, a floating progress rail, a heading that echoes the section
|
|
8
|
+
* being read.
|
|
9
|
+
*
|
|
10
|
+
* Context reaches through portals, so a consumer inside an open `DropdownMenu`
|
|
11
|
+
* or `Popover` works without threading anything down by hand. `registerSection`
|
|
12
|
+
* is deliberately not exposed: sections are `ScrollSpyContent`'s to own.
|
|
13
|
+
*/
|
|
14
|
+
declare function useScrollSpy(): {
|
|
15
|
+
activeValue: string | undefined;
|
|
16
|
+
getSectionId: (value: string) => string;
|
|
17
|
+
getTriggerId: (value: string) => string;
|
|
18
|
+
scrollToSection: (value: string) => void;
|
|
19
|
+
};
|
|
5
20
|
type ScrollSpyProps = Omit<React.ComponentProps<"div">, "onChange"> & {
|
|
6
21
|
orientation?: "horizontal" | "vertical";
|
|
7
22
|
/** Controlled active section. */
|
|
@@ -58,4 +73,4 @@ type ScrollSpyContentProps = Omit<React.ComponentProps<"section">, "value"> & {
|
|
|
58
73
|
};
|
|
59
74
|
declare function ScrollSpyContent({ className, value, style, tabIndex, ...props }: ScrollSpyContentProps): React.JSX.Element;
|
|
60
75
|
//#endregion
|
|
61
|
-
export { ScrollSpy, ScrollSpyContent, type ScrollSpyContentProps, ScrollSpyList, type ScrollSpyListProps, type ScrollSpyProps, ScrollSpyTrigger, type ScrollSpyTriggerProps, scrollSpyTriggerClassName };
|
|
76
|
+
export { ScrollSpy, ScrollSpyContent, type ScrollSpyContentProps, ScrollSpyList, type ScrollSpyListProps, type ScrollSpyProps, ScrollSpyTrigger, type ScrollSpyTriggerProps, scrollSpyTriggerClassName, useScrollSpy };
|
package/dist/scroll-spy.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { useComponentSize } from "./size-context.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useReducedMotion } from "./utils/use-reduced-motion.js";
|
|
5
|
+
import { useUncontrolled } from "./utils/use-uncontrolled.js";
|
|
6
6
|
import { resolveTabsListVariant, tabsIndicatorClassName, tabsListVariants, tabsTriggerClassName } from "./tabs.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import * as React from "react";
|
|
@@ -37,10 +37,33 @@ function getScrollport(element) {
|
|
|
37
37
|
}
|
|
38
38
|
function useScrollSpyContext(part) {
|
|
39
39
|
const context = React.useContext(ScrollSpyContext);
|
|
40
|
-
if (!context) throw new Error(`\`${part}\` must be
|
|
40
|
+
if (!context) throw new Error(`\`${part}\` must be used inside \`ScrollSpy\`.`);
|
|
41
41
|
return context;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
+
* Read and drive the spy from anywhere inside a `ScrollSpy` — an overflow
|
|
45
|
+
* "More" menu, a floating progress rail, a heading that echoes the section
|
|
46
|
+
* being read.
|
|
47
|
+
*
|
|
48
|
+
* Context reaches through portals, so a consumer inside an open `DropdownMenu`
|
|
49
|
+
* or `Popover` works without threading anything down by hand. `registerSection`
|
|
50
|
+
* is deliberately not exposed: sections are `ScrollSpyContent`'s to own.
|
|
51
|
+
*/
|
|
52
|
+
function useScrollSpy() {
|
|
53
|
+
const { activeValue, getSectionId, getTriggerId, scrollToSection } = useScrollSpyContext("useScrollSpy");
|
|
54
|
+
return React.useMemo(() => ({
|
|
55
|
+
activeValue,
|
|
56
|
+
getSectionId,
|
|
57
|
+
getTriggerId,
|
|
58
|
+
scrollToSection
|
|
59
|
+
}), [
|
|
60
|
+
activeValue,
|
|
61
|
+
getSectionId,
|
|
62
|
+
getTriggerId,
|
|
63
|
+
scrollToSection
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
44
67
|
* `Tabs` for a page that shows everything at once: every section stays mounted
|
|
45
68
|
* and visible, the triggers scroll to their section, and the active trigger
|
|
46
69
|
* tracks whichever section the reader is currently on.
|
|
@@ -292,4 +315,4 @@ function ScrollSpyContent({ className, value, style, tabIndex = -1, ...props })
|
|
|
292
315
|
});
|
|
293
316
|
}
|
|
294
317
|
//#endregion
|
|
295
|
-
export { ScrollSpy, ScrollSpyContent, ScrollSpyList, ScrollSpyTrigger, scrollSpyTriggerClassName };
|
|
318
|
+
export { ScrollSpy, ScrollSpyContent, ScrollSpyList, ScrollSpyTrigger, scrollSpyTriggerClassName, useScrollSpy };
|
package/dist/search-input.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Search, X } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import * as React from "react";
|
package/dist/select.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Check, ChevronDown, ChevronUp } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { SizeProvider, useComponentSize } from "./size-context.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { cva } from "class-variance-authority";
|
package/dist/separator.js
CHANGED
package/dist/sheet.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { X } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { SizeProvider } from "./size-context.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { DialogNestingProvider, useDialogNestingDepth } from "./dialog-nesting.js";
|
package/dist/sidebar.js
CHANGED
|
@@ -1,32 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Menu } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { Separator } from "./separator.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Input } from "./input.js";
|
|
7
|
-
import {
|
|
7
|
+
import { useUncontrolled } from "./utils/use-uncontrolled.js";
|
|
8
8
|
import { Skeleton } from "./skeleton.js";
|
|
9
9
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
|
|
10
10
|
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "./sheet.js";
|
|
11
|
+
import { useIsMobile } from "./utils/use-is-mobile.js";
|
|
11
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
13
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
13
14
|
import { useRender } from "@base-ui/react/use-render";
|
|
14
15
|
import { cva } from "class-variance-authority";
|
|
15
16
|
import * as React from "react";
|
|
16
|
-
//#region src/lib/use-mobile.ts
|
|
17
|
-
const DEFAULT_MOBILE_BREAKPOINT = 1024;
|
|
18
|
-
function useIsMobile(breakpoint = DEFAULT_MOBILE_BREAKPOINT) {
|
|
19
|
-
const [isMobile, setIsMobile] = React.useState(false);
|
|
20
|
-
React.useEffect(() => {
|
|
21
|
-
const mediaQuery = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
|
|
22
|
-
const update = () => setIsMobile(window.innerWidth < breakpoint);
|
|
23
|
-
update();
|
|
24
|
-
mediaQuery.addEventListener("change", update);
|
|
25
|
-
return () => mediaQuery.removeEventListener("change", update);
|
|
26
|
-
}, [breakpoint]);
|
|
27
|
-
return isMobile;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
17
|
//#region src/sidebar.tsx
|
|
31
18
|
const SIDEBAR_LS_KEY = "sidebar_state";
|
|
32
19
|
const SIDEBAR_WIDTH = "17.5rem";
|
package/dist/skeleton.js
CHANGED
package/dist/slider.js
CHANGED
package/dist/sonar.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { t as ComponentSize } from "./size-context-BX6kAdVj.js";
|
|
2
|
+
import { VariantProps } from "class-variance-authority";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
//#region src/sonar.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Kept in step with `--animate-sonar-wave` in `css/theme.css`; the waves are
|
|
7
|
+
* staggered by a fraction of one cycle, which only reads as a continuous sonar
|
|
8
|
+
* if this matches the keyframe's duration. `sonar.test.tsx` asserts they agree.
|
|
9
|
+
*/
|
|
10
|
+
declare const SONAR_DURATION_MS = 1500;
|
|
11
|
+
/**
|
|
12
|
+
* Colour rides on `currentColor` so the keyframe stays tone-agnostic: one set
|
|
13
|
+
* of keyframes, one class per tone.
|
|
14
|
+
*/
|
|
15
|
+
declare const sonarWaveVariants: (props?: ({
|
|
16
|
+
tone?: "brand" | "danger" | "info" | "success" | "warning" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
type SonarProps = React.ComponentProps<"span"> & VariantProps<typeof sonarWaveVariants> & {
|
|
19
|
+
/** Stop pulsing without unmounting — the child renders on its own. */
|
|
20
|
+
active?: boolean;
|
|
21
|
+
/** Overlapping rings. More reads as a faster, more urgent sonar. */
|
|
22
|
+
waves?: 1 | 2 | 3;
|
|
23
|
+
/** How far each ring travels. Inherits from `SizeProvider`. */
|
|
24
|
+
size?: ComponentSize;
|
|
25
|
+
/**
|
|
26
|
+
* Skip measurement and use this `border-radius` verbatim. Only needed
|
|
27
|
+
* when the child's shape can't be read off the DOM — an SVG using
|
|
28
|
+
* geometry rather than CSS, say.
|
|
29
|
+
*/
|
|
30
|
+
radius?: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Draws attention to a dot, badge or button by pulsing rings outward from it.
|
|
34
|
+
*
|
|
35
|
+
* The rings trace the child's own shape: `Sonar` reads the child's computed
|
|
36
|
+
* `border-radius` and hands it to the rings, so a pill badge pulses a pill and
|
|
37
|
+
* a rounded button pulses a rounded rectangle, with nothing to keep in sync by
|
|
38
|
+
* hand. That matters because radii in this library are often size-dependent —
|
|
39
|
+
* `Tag` alone moves through `rounded-md`/`lg`/`xl` across its three sizes.
|
|
40
|
+
*
|
|
41
|
+
* Purely decorative: the rings are `aria-hidden` and the child is untouched, so
|
|
42
|
+
* whatever the child announces is what assistive tech hears. A pulse is not a
|
|
43
|
+
* label — if the attention it draws carries meaning, put that meaning in the
|
|
44
|
+
* child.
|
|
45
|
+
*
|
|
46
|
+
* The rings are painted with `box-shadow` spread, which lives outside the
|
|
47
|
+
* element's box, so an ancestor with `overflow: hidden` will clip them.
|
|
48
|
+
*/
|
|
49
|
+
declare function Sonar({ className, children, active, waves, size, tone, radius, style, ...props }: SonarProps): React.JSX.Element;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { SONAR_DURATION_MS, Sonar, type SonarProps, sonarWaveVariants };
|
package/dist/sonar.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
|
+
import { useComponentSize } from "./size-context.js";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
//#region src/sonar.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Kept in step with `--animate-sonar-wave` in `css/theme.css`; the waves are
|
|
10
|
+
* staggered by a fraction of one cycle, which only reads as a continuous sonar
|
|
11
|
+
* if this matches the keyframe's duration. `sonar.test.tsx` asserts they agree.
|
|
12
|
+
*/
|
|
13
|
+
const SONAR_DURATION_MS = 1500;
|
|
14
|
+
const SQUARE = {
|
|
15
|
+
borderTopLeftRadius: "0px",
|
|
16
|
+
borderTopRightRadius: "0px",
|
|
17
|
+
borderBottomRightRadius: "0px",
|
|
18
|
+
borderBottomLeftRadius: "0px"
|
|
19
|
+
};
|
|
20
|
+
function sameCorners(a, b) {
|
|
21
|
+
return a !== null && a.borderTopLeftRadius === b.borderTopLeftRadius && a.borderTopRightRadius === b.borderTopRightRadius && a.borderBottomRightRadius === b.borderBottomRightRadius && a.borderBottomLeftRadius === b.borderBottomLeftRadius;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Colour rides on `currentColor` so the keyframe stays tone-agnostic: one set
|
|
25
|
+
* of keyframes, one class per tone.
|
|
26
|
+
*/
|
|
27
|
+
const sonarWaveVariants = cva(cn("pointer-events-none absolute inset-0 animate-sonar-wave", "motion-reduce:animate-none motion-reduce:opacity-40 motion-reduce:shadow-[0_0_0_2px_currentColor]"), {
|
|
28
|
+
variants: { tone: {
|
|
29
|
+
brand: "text-fg-brand",
|
|
30
|
+
info: "text-status-info",
|
|
31
|
+
success: "text-status-success",
|
|
32
|
+
warning: "text-status-warning",
|
|
33
|
+
danger: "text-status-danger"
|
|
34
|
+
} },
|
|
35
|
+
defaultVariants: { tone: "brand" }
|
|
36
|
+
});
|
|
37
|
+
/**
|
|
38
|
+
* Rings evenly spaced across one cycle, so the last finishes just as the first
|
|
39
|
+
* comes round again. Doubles as each ring's key — the offsets are distinct by
|
|
40
|
+
* construction, which an index would only pretend to be.
|
|
41
|
+
*/
|
|
42
|
+
function waveDelays(waves) {
|
|
43
|
+
return Array.from({ length: waves }, (_, index) => Math.round(index * SONAR_DURATION_MS / waves));
|
|
44
|
+
}
|
|
45
|
+
/** How far the ring travels before it fades out. */
|
|
46
|
+
const sonarSpread = {
|
|
47
|
+
sm: "[--sonar-spread:0.375rem]",
|
|
48
|
+
md: "[--sonar-spread:0.625rem]",
|
|
49
|
+
lg: "[--sonar-spread:0.875rem]"
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Draws attention to a dot, badge or button by pulsing rings outward from it.
|
|
53
|
+
*
|
|
54
|
+
* The rings trace the child's own shape: `Sonar` reads the child's computed
|
|
55
|
+
* `border-radius` and hands it to the rings, so a pill badge pulses a pill and
|
|
56
|
+
* a rounded button pulses a rounded rectangle, with nothing to keep in sync by
|
|
57
|
+
* hand. That matters because radii in this library are often size-dependent —
|
|
58
|
+
* `Tag` alone moves through `rounded-md`/`lg`/`xl` across its three sizes.
|
|
59
|
+
*
|
|
60
|
+
* Purely decorative: the rings are `aria-hidden` and the child is untouched, so
|
|
61
|
+
* whatever the child announces is what assistive tech hears. A pulse is not a
|
|
62
|
+
* label — if the attention it draws carries meaning, put that meaning in the
|
|
63
|
+
* child.
|
|
64
|
+
*
|
|
65
|
+
* The rings are painted with `box-shadow` spread, which lives outside the
|
|
66
|
+
* element's box, so an ancestor with `overflow: hidden` will clip them.
|
|
67
|
+
*/
|
|
68
|
+
function Sonar({ className, children, active = true, waves = 2, size, tone, radius, style, ...props }) {
|
|
69
|
+
const resolvedSize = useComponentSize(size);
|
|
70
|
+
const ref = React.useRef(null);
|
|
71
|
+
const [corners, setCorners] = React.useState(null);
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
if (radius !== void 0 || !active) return;
|
|
74
|
+
const target = ref.current?.querySelector(":scope > :not([data-slot=\"sonar-wave\"])");
|
|
75
|
+
if (!target) {
|
|
76
|
+
setCorners(SQUARE);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const measure = () => {
|
|
80
|
+
const computed = getComputedStyle(target);
|
|
81
|
+
const next = {
|
|
82
|
+
borderTopLeftRadius: computed.borderTopLeftRadius,
|
|
83
|
+
borderTopRightRadius: computed.borderTopRightRadius,
|
|
84
|
+
borderBottomRightRadius: computed.borderBottomRightRadius,
|
|
85
|
+
borderBottomLeftRadius: computed.borderBottomLeftRadius
|
|
86
|
+
};
|
|
87
|
+
setCorners((current) => sameCorners(current, next) ? current : next);
|
|
88
|
+
};
|
|
89
|
+
measure();
|
|
90
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
91
|
+
const observer = new ResizeObserver(measure);
|
|
92
|
+
observer.observe(target);
|
|
93
|
+
return () => observer.disconnect();
|
|
94
|
+
}, [active, radius]);
|
|
95
|
+
const shape = radius !== void 0 ? { borderRadius: radius } : corners;
|
|
96
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
97
|
+
ref,
|
|
98
|
+
"data-slot": "sonar",
|
|
99
|
+
"data-tone": tone ?? "brand",
|
|
100
|
+
"data-size": resolvedSize,
|
|
101
|
+
"data-active": active ? "" : void 0,
|
|
102
|
+
className: cn("relative inline-flex w-fit shrink-0", sonarSpread[resolvedSize], className),
|
|
103
|
+
style,
|
|
104
|
+
...props,
|
|
105
|
+
children: [children, active && shape ? waveDelays(waves).map((delay) => /* @__PURE__ */ jsx("span", {
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
"data-slot": "sonar-wave",
|
|
108
|
+
style: {
|
|
109
|
+
...shape,
|
|
110
|
+
animationDelay: delay === 0 ? void 0 : `${delay}ms`
|
|
111
|
+
},
|
|
112
|
+
className: cn(sonarWaveVariants({ tone }), delay > 0 && "motion-reduce:hidden")
|
|
113
|
+
}, `sonar-wave-${delay}`)) : null]
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
export { SONAR_DURATION_MS, Sonar, sonarWaveVariants };
|
package/dist/sparkline.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
3
|
import { useComponentSize } from "./size-context.js";
|
|
4
4
|
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "./chart.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/stepper.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Check } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import * as React from "react";
|