@giddaa-housing/ui 3.4.0 → 3.6.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/components.css +13 -0
- package/css/generated/shared.css +1 -1
- 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.d.ts +5 -1
- package/dist/badge.js +20 -6
- package/dist/bar-chart.d.ts +1 -1
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/bullet-chart.d.ts +1 -1
- package/dist/bullet-chart.js +1 -1
- package/dist/button-BS5KCibF.d.ts +33 -0
- package/dist/button-group.d.ts +1 -1
- package/dist/button-group.js +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +50 -22
- package/dist/calendar.js +2 -2
- package/dist/call-card.js +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.d.ts +4 -2
- package/dist/carousel.js +13 -16
- package/dist/chart.d.ts +1 -1
- package/dist/chart.js +1 -1
- package/dist/chat.d.ts +1 -1
- package/dist/chat.js +1 -1
- package/dist/checkbox.d.ts +2 -2
- package/dist/checkbox.js +21 -7
- package/dist/collapsible.js +1 -1
- package/dist/combobox-CACVdp1R.js +430 -0
- package/dist/combobox.d.ts +9 -4
- package/dist/combobox.js +2 -309
- package/dist/cta.d.ts +1 -1
- package/dist/cta.js +1 -1
- package/dist/currency-selector.js +2 -2
- package/dist/data-table.d.ts +2 -2
- package/dist/data-table.js +1 -1
- package/dist/date-picker.d.ts +6 -5
- package/dist/date-picker.js +7 -17
- package/dist/details-card.js +1 -1
- package/dist/dialog.d.ts +3 -1
- package/dist/dialog.js +10 -6
- package/dist/dropdown-menu.d.ts +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.d.ts +4 -1
- package/dist/field.js +29 -12
- package/dist/file-upload.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/footer.d.ts +2 -2
- package/dist/footer.js +1 -1
- package/dist/funnel-chart.d.ts +1 -1
- package/dist/funnel-chart.js +1 -1
- package/dist/gallery-indicator.js +1 -1
- package/dist/heatmap-chart.d.ts +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.d.ts +6 -6
- package/dist/input-group.js +39 -14
- package/dist/input-otp.d.ts +2 -2
- package/dist/input-otp.js +32 -15
- package/dist/input-size-context-BMhves-J.d.ts +13 -0
- package/dist/input-size-context.d.ts +2 -2
- package/dist/input-size-context.js +9 -2
- package/dist/input.d.ts +20 -2
- package/dist/input.js +31 -12
- package/dist/item.js +1 -1
- package/dist/kpi-card.js +1 -1
- package/dist/label.js +1 -1
- package/dist/line-chart.d.ts +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/mask-input.d.ts +1 -1
- package/dist/match.d.ts +5 -2
- package/dist/match.js +183 -27
- package/dist/media-gallery-hero.js +15 -10
- package/dist/media-player.js +5 -13
- package/dist/message.js +2 -12
- package/dist/mobile-sidebar.js +2 -1
- package/dist/multi-step-form.js +2 -2
- package/dist/number-input.d.ts +2 -2
- package/dist/number-input.js +3 -3
- package/dist/page-header.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-input.js +1 -1
- package/dist/phone-input.d.ts +2 -2
- package/dist/phone-input.js +16 -21
- package/dist/photo-gallery.js +6 -3
- package/dist/picker-BTXBrsl4.js +62 -0
- package/dist/picker-j3txxA5t.d.ts +14 -0
- package/dist/pie-chart.d.ts +1 -1
- package/dist/pie-chart.js +1 -1
- package/dist/popover-CNymD33m.d.ts +20 -0
- package/dist/popover.d.ts +1 -19
- package/dist/popover.js +1 -1
- package/dist/price-tag.d.ts +1 -1
- package/dist/price-tag.js +50 -22
- package/dist/progress.js +1 -1
- package/dist/property-listing-card.d.ts +68 -2
- package/dist/property-listing-card.js +115 -29
- package/dist/purchase-option-card.js +1 -1
- package/dist/radar-chart.d.ts +1 -1
- package/dist/radar-chart.js +1 -1
- package/dist/radio-group.d.ts +2 -2
- package/dist/radio-group.js +24 -10
- package/dist/review-block.js +1 -1
- package/dist/rich-text-editor.d.ts +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/scatter-chart.d.ts +1 -1
- package/dist/scatter-chart.js +1 -1
- package/dist/scroll-spy.d.ts +8 -2
- package/dist/scroll-spy.js +16 -16
- package/dist/search-input.js +1 -1
- package/dist/section-jumper.d.ts +31 -0
- package/dist/section-jumper.js +276 -0
- package/dist/select.d.ts +9 -4
- package/dist/select.js +113 -20
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +3 -1
- package/dist/sheet.js +10 -6
- package/dist/sidebar.d.ts +2 -2
- package/dist/sidebar.js +4 -16
- package/dist/size-context-BVhHduLi.d.ts +33 -0
- package/dist/size-context.d.ts +2 -2
- package/dist/size-context.js +30 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider.d.ts +5 -3
- package/dist/slider.js +26 -11
- package/dist/sonar.d.ts +1 -1
- package/dist/sonar.js +2 -2
- package/dist/sparkline.d.ts +1 -1
- package/dist/sparkline.js +1 -1
- package/dist/stepper.js +1 -1
- package/dist/styles.css +1622 -264
- package/dist/switch.d.ts +2 -2
- package/dist/switch.js +21 -7
- package/dist/table-card.js +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.d.ts +1 -1
- package/dist/tag.js +1 -1
- package/dist/testimonial-block.js +1 -1
- package/dist/textarea.d.ts +17 -1
- package/dist/textarea.js +24 -10
- package/dist/theme-switcher.js +1 -1
- package/dist/time-picker.d.ts +5 -4
- 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.d.ts +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 +50 -9
- package/dist/waterfall-chart.d.ts +1 -1
- package/dist/waterfall-chart.js +1 -1
- package/package.json +13 -1
- package/dist/button-DW5OijoR.d.ts +0 -17
- package/dist/cn-BI_4DMBf.js +0 -23
- package/dist/input-CfoEJ8A6.d.ts +0 -12
- package/dist/input-size-context-C-SFx9sx.d.ts +0 -10
- package/dist/picker-xSTzeYhc.js +0 -50
- package/dist/size-context-BX6kAdVj.d.ts +0 -11
- package/dist/textarea-IS_D8pXf.d.ts +0 -11
package/dist/price-tag.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Check, ChevronDown } from "./icons.js";
|
|
3
|
-
import {
|
|
3
|
+
import { cn } from "./utils/cn.js";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import { Popover } from "@base-ui/react/popover";
|
|
7
7
|
//#region src/price-tag.tsx
|
|
8
|
-
const priceTagVariants = cva("group/price-tag inline-flex w-fit shrink-0 items-center justify-center
|
|
8
|
+
const priceTagVariants = cva("group/price-tag inline-flex w-fit shrink-0 items-center justify-center bg-surface-brand font-bold whitespace-nowrap text-fg-on-brand shadow-none transition-[background-color,box-shadow] outline-none data-[interactive=true]:cursor-pointer data-[interactive=true]:hover:bg-action-primary-hover data-[interactive=true]:focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] data-[interactive=true]:active:bg-action-primary-pressed", {
|
|
9
9
|
variants: {
|
|
10
10
|
size: {
|
|
11
|
-
xxs: "min-h-7 gap-1 px-2.5 py-0.75 text-gdt-subtext [
|
|
12
|
-
xs: "min-h-7.5 gap-1 px-3 py-1 text-gdt-xs [
|
|
13
|
-
sm: "min-h-9 gap-1.5 px-4 py-1.5 text-gdt-sm [
|
|
14
|
-
md: "min-h-10.5 gap-1.5 px-5 py-2 text-gdt-md [
|
|
15
|
-
lg: "min-h-13 gap-2 px-7 py-3 text-gdt-lg [
|
|
11
|
+
xxs: "min-h-7 gap-1 rounded-lg px-2.5 py-0.75 text-gdt-subtext leading-none [&_svg]:size-3",
|
|
12
|
+
xs: "min-h-7.5 gap-1 rounded-lg px-3 py-1 text-gdt-xs leading-none [&_svg]:size-3.5",
|
|
13
|
+
sm: "min-h-9 gap-1.5 rounded-xl px-4 py-1.5 text-gdt-sm leading-none [&_svg]:size-3.5",
|
|
14
|
+
md: "min-h-10.5 gap-1.5 rounded-xl px-5 py-2 text-gdt-md leading-none [&_svg]:size-4",
|
|
15
|
+
lg: "min-h-13 gap-2 rounded-2xl px-7 py-3 text-gdt-lg leading-none [&_svg]:size-4.5"
|
|
16
16
|
},
|
|
17
17
|
/** Two lines sit top-aligned against the chevron rather than centred. */
|
|
18
18
|
hasDescription: {
|
|
@@ -30,13 +30,35 @@ const priceTagVariants = cva("group/price-tag inline-flex w-fit shrink-0 items-c
|
|
|
30
30
|
hasDescription: false
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
/** The
|
|
33
|
+
/** The space between the price and its description, 4px through 12px. */
|
|
34
|
+
const lineGapClassName = {
|
|
35
|
+
xxs: "gap-1",
|
|
36
|
+
xs: "gap-1",
|
|
37
|
+
sm: "gap-1.5",
|
|
38
|
+
md: "gap-2",
|
|
39
|
+
lg: "gap-3"
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The least space the chevron will sit at from the price. It is usually pushed
|
|
43
|
+
* further out than this, to the trailing edge of the wider description.
|
|
44
|
+
*/
|
|
45
|
+
const chevronGapClassName = {
|
|
46
|
+
xxs: "gap-2",
|
|
47
|
+
xs: "gap-2",
|
|
48
|
+
sm: "gap-3",
|
|
49
|
+
md: "gap-3",
|
|
50
|
+
lg: "gap-4"
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The description is quieter than the price, and quietest at the largest size.
|
|
54
|
+
* `leading-none` trails the text size here for the same reason it does above.
|
|
55
|
+
*/
|
|
34
56
|
const descriptionSizeClassName = {
|
|
35
|
-
xxs: "text-gdt-subtext",
|
|
36
|
-
xs: "text-gdt-subtext",
|
|
37
|
-
sm: "text-gdt-subtext",
|
|
38
|
-
md: "text-gdt-subtext",
|
|
39
|
-
lg: "text-gdt-xs"
|
|
57
|
+
xxs: "text-gdt-subtext leading-none",
|
|
58
|
+
xs: "text-gdt-subtext leading-none",
|
|
59
|
+
sm: "text-gdt-subtext leading-none",
|
|
60
|
+
md: "text-gdt-subtext leading-none",
|
|
61
|
+
lg: "text-gdt-xs leading-none"
|
|
40
62
|
};
|
|
41
63
|
function getDisplayAmount({ amount, shortAmount, format }) {
|
|
42
64
|
return format === "shortened" && shortAmount ? shortAmount : amount;
|
|
@@ -84,7 +106,7 @@ function DefaultMenuOption({ option }) {
|
|
|
84
106
|
] });
|
|
85
107
|
}
|
|
86
108
|
/**
|
|
87
|
-
*
|
|
109
|
+
* Rounded-box price display, optionally a trigger for a currency dropdown.
|
|
88
110
|
*
|
|
89
111
|
* Display only: it prints `value` and `description` as given and never
|
|
90
112
|
* composes a sentence, picks a format, or decides that a line is too small to
|
|
@@ -106,9 +128,18 @@ function PriceTag({ value, description, size = "md", currencies, selectedCurrenc
|
|
|
106
128
|
const legacyDescription = monthlyPayment && (size === "md" || size === "lg") ? `${monthlyPaymentLabel} ${monthlyPayment} monthly` : void 0;
|
|
107
129
|
const resolvedDescription = description ?? legacyDescription;
|
|
108
130
|
const pill = /* @__PURE__ */ jsxs("span", {
|
|
109
|
-
className: "flex min-w-0 flex-col
|
|
110
|
-
children: [/* @__PURE__ */
|
|
111
|
-
className: cn("
|
|
131
|
+
className: cn("flex min-w-0 flex-col text-start", lineGapClassName[size]),
|
|
132
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
133
|
+
className: cn("flex items-center justify-between", chevronGapClassName[size]),
|
|
134
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
135
|
+
className: "min-w-0",
|
|
136
|
+
children: resolvedValue
|
|
137
|
+
}), hasDropdown ? /* @__PURE__ */ jsx(ChevronDown, {
|
|
138
|
+
"aria-hidden": "true",
|
|
139
|
+
className: "shrink-0 transition-transform group-data-popup-open/price-tag:rotate-180"
|
|
140
|
+
}) : null]
|
|
141
|
+
}), resolvedDescription ? /* @__PURE__ */ jsx("span", {
|
|
142
|
+
className: cn("font-medium opacity-90", descriptionSizeClassName[size]),
|
|
112
143
|
children: resolvedDescription
|
|
113
144
|
}) : null]
|
|
114
145
|
});
|
|
@@ -127,16 +158,13 @@ function PriceTag({ value, description, size = "md", currencies, selectedCurrenc
|
|
|
127
158
|
open,
|
|
128
159
|
defaultOpen,
|
|
129
160
|
onOpenChange,
|
|
130
|
-
children: [/* @__PURE__ */
|
|
161
|
+
children: [/* @__PURE__ */ jsx(Popover.Trigger, {
|
|
131
162
|
"data-slot": "price-tag",
|
|
132
163
|
"data-interactive": "true",
|
|
133
164
|
type,
|
|
134
165
|
className: pillClassName,
|
|
135
166
|
...props,
|
|
136
|
-
children:
|
|
137
|
-
"aria-hidden": "true",
|
|
138
|
-
className: "transition-transform group-data-popup-open/price-tag:rotate-180"
|
|
139
|
-
})]
|
|
167
|
+
children: pill
|
|
140
168
|
}), /* @__PURE__ */ jsx(Popover.Portal, { children: /* @__PURE__ */ jsx(Popover.Positioner, {
|
|
141
169
|
sideOffset: 10,
|
|
142
170
|
align: "start",
|
package/dist/progress.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { n as ButtonLink, t as Button } from "./button-
|
|
1
|
+
import { n as ButtonLink, t as Button } from "./button-BS5KCibF.js";
|
|
2
|
+
import { Carousel, CarouselIndicator, CarouselItem, CarouselNext, CarouselPrevious } 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,69 @@ 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
|
+
/** Previous-photo control, revealed when the carousel is hovered or focused. */
|
|
62
|
+
declare function PropertyListingCardCarouselPrevious({ className, ...props }: React.ComponentProps<typeof CarouselPrevious>): React.JSX.Element;
|
|
63
|
+
/** Next-photo control, revealed when the carousel is hovered or focused. */
|
|
64
|
+
declare function PropertyListingCardCarouselNext({ className, ...props }: React.ComponentProps<typeof CarouselNext>): React.JSX.Element;
|
|
65
|
+
declare function PropertyListingCardCarouselItem({ className, ...props }: React.ComponentProps<typeof CarouselItem>): React.JSX.Element;
|
|
66
|
+
/**
|
|
67
|
+
* The indicator, lifted clear of the options bar by default. That bar is
|
|
68
|
+
* `min-h-9.5` and the media may carry a price tag above it, so the offset is
|
|
69
|
+
* a starting point rather than a rule — `className="bottom-20"` or any other
|
|
70
|
+
* `bottom-*` moves it.
|
|
71
|
+
*/
|
|
72
|
+
declare function PropertyListingCardCarouselIndicator({ className, size, ...props }: React.ComponentProps<typeof CarouselIndicator>): React.JSX.Element;
|
|
73
|
+
/**
|
|
74
|
+
* A listing photo. Takes everything an `<img>` does — `loading="lazy"`,
|
|
75
|
+
* `fetchPriority`, `sizes`, `srcSet` — and `render` swaps the element for a
|
|
76
|
+
* framework's image component. `ImageProvider` does the same for every image
|
|
77
|
+
* in the tree at once.
|
|
78
|
+
*/
|
|
79
|
+
declare function PropertyListingCardImage({ image, alt, src, className, ...props }: ImageProps & {
|
|
80
|
+
/** @deprecated Pass `src` and `alt` directly. Removed in the next major. */
|
|
81
|
+
image?: PropertyListingImage;
|
|
82
|
+
}): React.JSX.Element;
|
|
83
|
+
/** Stands in for a listing with no photo, filling the well behind the overlays. */
|
|
84
|
+
declare function PropertyListingCardImagePlaceholder({ className, children, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
85
|
declare function PropertyListingCardMediaTop({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
20
86
|
declare function PropertyListingCardOptionsBar({ className, render, ...props }: useRender.ComponentProps<"a">): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
21
87
|
declare function PropertyListingCardDetails({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -26,4 +92,4 @@ declare function PropertyListingCardActions({ className, ...props }: React.Compo
|
|
|
26
92
|
declare function PropertyListingCardActionButton({ className, type, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
27
93
|
declare function PropertyListingCardActionButtonLink({ className, ...props }: React.ComponentProps<typeof ButtonLink>): React.JSX.Element;
|
|
28
94
|
//#endregion
|
|
29
|
-
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardDetails, PropertyListingCardMedia, PropertyListingCardMediaTop, PropertyListingCardOptionsBar, PropertyListingCardOverview, type PropertyListingCardProps, PropertyListingCardTitle, type PropertyListingImage, propertyListingCardVariants };
|
|
95
|
+
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardCarousel, PropertyListingCardCarouselIndicator, PropertyListingCardCarouselItem, PropertyListingCardCarouselNext, PropertyListingCardCarouselPrevious, 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
|
-
import { Carousel, CarouselContent, CarouselIndicator, CarouselItem } from "./carousel.js";
|
|
4
|
+
import { Carousel, CarouselContent, CarouselIndicator, CarouselItem, CarouselNext, CarouselPrevious } 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,124 @@ 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: [
|
|
57
|
+
/* @__PURE__ */ jsx(CarouselContent, { children: images.map((carouselImage, index) => /* @__PURE__ */ jsx(PropertyListingCardCarouselItem, { children: /* @__PURE__ */ jsx(PropertyListingCardImage, { image: carouselImage }) }, carouselImage.id ?? carouselImage.src ?? carouselImage.alt ?? index)) }),
|
|
58
|
+
/* @__PURE__ */ jsx(PropertyListingCardCarouselIndicator, {}),
|
|
59
|
+
/* @__PURE__ */ jsx(PropertyListingCardCarouselPrevious, {}),
|
|
60
|
+
/* @__PURE__ */ jsx(PropertyListingCardCarouselNext, {})
|
|
61
|
+
] });
|
|
62
|
+
if (images[0]?.src) return /* @__PURE__ */ jsx(PropertyListingCardImage, {
|
|
63
|
+
image: images[0],
|
|
64
|
+
className: "absolute inset-0 -z-10"
|
|
65
|
+
});
|
|
66
|
+
return /* @__PURE__ */ jsx(PropertyListingCardImagePlaceholder, {});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The carousel, sized to fill the media well and sunk behind the overlays.
|
|
70
|
+
* Fill it with `CarouselContent` from `@giddaa-housing/ui/carousel` — every
|
|
71
|
+
* carousel part works here, including `CarouselPrevious`/`CarouselNext`.
|
|
72
|
+
*/
|
|
73
|
+
function PropertyListingCardCarousel({ className, opts, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx(Carousel, {
|
|
75
|
+
"data-slot": "property-listing-card-carousel",
|
|
76
|
+
imageSize: "full",
|
|
77
|
+
opts,
|
|
78
|
+
className: cn("group/property-listing-carousel absolute inset-0 -z-10 size-full rounded-none bg-surface", className),
|
|
79
|
+
...props
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const propertyListingCardCarouselControlClassName = "size-9 border-white/35 bg-black/50 text-white opacity-0 shadow-[0_4px_16px_rgb(0_0_0/0.28)] backdrop-blur-md transition-[background-color,opacity,scale] hover:scale-105 hover:bg-black/70 group-hover/property-listing-carousel:opacity-100 group-focus-within/property-listing-carousel:opacity-100 focus-visible:opacity-100 focus-visible:shadow-[0_0_0_2px_var(--color-line-focus),0_4px_16px_rgb(0_0_0/0.28)] active:hover:scale-[0.97] disabled:opacity-0 group-hover/property-listing-carousel:disabled:opacity-40 group-focus-within/property-listing-carousel:disabled:opacity-40 disabled:hover:scale-100 [&_svg]:mx-auto [&_svg]:size-[18px]";
|
|
83
|
+
/** Previous-photo control, revealed when the carousel is hovered or focused. */
|
|
84
|
+
function PropertyListingCardCarouselPrevious({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(CarouselPrevious, {
|
|
86
|
+
className: cn(propertyListingCardCarouselControlClassName, "left-3", className),
|
|
87
|
+
...props
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** Next-photo control, revealed when the carousel is hovered or focused. */
|
|
91
|
+
function PropertyListingCardCarouselNext({ className, ...props }) {
|
|
92
|
+
return /* @__PURE__ */ jsx(CarouselNext, {
|
|
93
|
+
className: cn(propertyListingCardCarouselControlClassName, "right-3", className),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function PropertyListingCardCarouselItem({ className, ...props }) {
|
|
98
|
+
return /* @__PURE__ */ jsx(CarouselItem, {
|
|
99
|
+
"data-slot": "property-listing-card-carousel-item",
|
|
100
|
+
className: cn("relative h-full", className),
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The indicator, lifted clear of the options bar by default. That bar is
|
|
106
|
+
* `min-h-9.5` and the media may carry a price tag above it, so the offset is
|
|
107
|
+
* a starting point rather than a rule — `className="bottom-20"` or any other
|
|
108
|
+
* `bottom-*` moves it.
|
|
109
|
+
*/
|
|
110
|
+
function PropertyListingCardCarouselIndicator({ className, size = "sm", ...props }) {
|
|
111
|
+
return /* @__PURE__ */ jsx(CarouselIndicator, {
|
|
112
|
+
"data-slot": "property-listing-card-carousel-indicator",
|
|
113
|
+
size,
|
|
114
|
+
className: cn("bottom-16", className),
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A listing photo. Takes everything an `<img>` does — `loading="lazy"`,
|
|
120
|
+
* `fetchPriority`, `sizes`, `srcSet` — and `render` swaps the element for a
|
|
121
|
+
* framework's image component. `ImageProvider` does the same for every image
|
|
122
|
+
* in the tree at once.
|
|
123
|
+
*/
|
|
124
|
+
function PropertyListingCardImage({ image, alt, src, className, ...props }) {
|
|
125
|
+
return /* @__PURE__ */ jsx(Image, {
|
|
126
|
+
slot: "property-listing-card-image",
|
|
127
|
+
src: src ?? image?.src,
|
|
128
|
+
alt: alt ?? image?.alt ?? "Property image",
|
|
52
129
|
className: cn("size-full object-cover", className),
|
|
53
130
|
...props
|
|
54
131
|
});
|
|
55
132
|
}
|
|
133
|
+
/** Stands in for a listing with no photo, filling the well behind the overlays. */
|
|
134
|
+
function PropertyListingCardImagePlaceholder({ className, children = "Property Image", ...props }) {
|
|
135
|
+
return /* @__PURE__ */ jsx("div", {
|
|
136
|
+
"data-slot": "property-listing-card-image-placeholder",
|
|
137
|
+
className: cn("absolute inset-0 -z-10 grid place-items-center bg-surface-raised text-gdt-sm font-bold text-fg-caption-placeholder", className),
|
|
138
|
+
...props,
|
|
139
|
+
children
|
|
140
|
+
});
|
|
141
|
+
}
|
|
56
142
|
function PropertyListingCardMediaTop({ className, ...props }) {
|
|
57
143
|
return /* @__PURE__ */ jsx("div", {
|
|
58
144
|
className: cn("absolute inset-x-2 top-2 z-10 flex items-start justify-between gap-3", className),
|
|
@@ -115,4 +201,4 @@ function PropertyListingCardActionButtonLink({ className, ...props }) {
|
|
|
115
201
|
});
|
|
116
202
|
}
|
|
117
203
|
//#endregion
|
|
118
|
-
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardDetails, PropertyListingCardMedia, PropertyListingCardMediaTop, PropertyListingCardOptionsBar, PropertyListingCardOverview, PropertyListingCardTitle, propertyListingCardVariants };
|
|
204
|
+
export { PropertyListingCard, PropertyListingCardActionButton, PropertyListingCardActionButtonLink, PropertyListingCardActions, PropertyListingCardBadges, PropertyListingCardCarousel, PropertyListingCardCarouselIndicator, PropertyListingCardCarouselItem, PropertyListingCardCarouselNext, PropertyListingCardCarouselPrevious, 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.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ComponentSize } from "./size-context-
|
|
1
|
+
import { t as ComponentSize } from "./size-context-BVhHduLi.js";
|
|
2
2
|
import { ChartConfig } from "./chart.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { PolarAngleAxis, PolarGrid, PolarRadiusAxis, Radar, RadarChart as RadarChart$1 } from "recharts";
|
package/dist/radar-chart.js
CHANGED
package/dist/radio-group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as ComponentSizeValue } from "./size-context-BVhHduLi.js";
|
|
2
2
|
import { Radio } from "@base-ui/react/radio";
|
|
3
3
|
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
4
4
|
//#region src/radio-group.d.ts
|
|
@@ -6,7 +6,7 @@ declare function RadioGroup({ className, ...props }: RadioGroup$1.Props): import
|
|
|
6
6
|
declare const radioVariants: (props?: ({
|
|
7
7
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
-
type RadioGroupItemSize =
|
|
9
|
+
type RadioGroupItemSize = ComponentSizeValue;
|
|
10
10
|
type RadioGroupItemProps<Value = unknown> = Radio.Root.Props<Value> & {
|
|
11
11
|
size?: RadioGroupItemSize;
|
|
12
12
|
};
|
package/dist/radio-group.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { cn } from "./utils/cn.js";
|
|
3
|
+
import { responsiveValueClasses, useComponentSizeValue } from "./size-context.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { cva } from "class-variance-authority";
|
|
6
6
|
import { Radio } from "@base-ui/react/radio";
|
|
7
7
|
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
8
8
|
//#region src/radio-group.tsx
|
|
9
|
+
const radioSizeVariants = {
|
|
10
|
+
sm: "size-4 [--radio-dot-size:0.625rem]",
|
|
11
|
+
md: "size-5 [--radio-dot-size:0.75rem]",
|
|
12
|
+
lg: "size-6 [--radio-dot-size:0.875rem]"
|
|
13
|
+
};
|
|
9
14
|
function RadioGroup({ className, ...props }) {
|
|
10
15
|
return /* @__PURE__ */ jsx(RadioGroup$1, {
|
|
11
16
|
"data-slot": "radio-group",
|
|
@@ -13,11 +18,7 @@ function RadioGroup({ className, ...props }) {
|
|
|
13
18
|
...props
|
|
14
19
|
});
|
|
15
20
|
}
|
|
16
|
-
const radioVariants = cva("group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border-2 bg-transparent text-transparent outline-none transition-[background-color,border-color,box-shadow,color,scale] duration-[var(--duration-motion-press)] ease-gdt-out active:scale-[0.97] motion-reduce:active:scale-100 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-line-focus focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] aria-invalid:border-line-danger aria-invalid:ring-3 aria-invalid:ring-line-danger/20 aria-invalid:focus-visible:border-line-danger aria-invalid:focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-danger)] border-line-strong data-checked:border-action-primary data-checked:text-action-primary data-disabled:cursor-not-allowed data-disabled:border-line-subtle data-disabled:bg-surface data-disabled:text-fg-caption-placeholder data-disabled:active:scale-100
|
|
17
|
-
sm: "size-4 [--radio-dot-size:0.625rem]",
|
|
18
|
-
md: "size-5 [--radio-dot-size:0.75rem]",
|
|
19
|
-
lg: "size-6 [--radio-dot-size:0.875rem]"
|
|
20
|
-
} } });
|
|
21
|
+
const radioVariants = cva("group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border-2 bg-transparent text-transparent outline-none transition-[background-color,border-color,box-shadow,color,scale] duration-[var(--duration-motion-press)] ease-gdt-out active:scale-[0.97] motion-reduce:active:scale-100 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-line-focus focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] aria-invalid:border-line-danger aria-invalid:ring-3 aria-invalid:ring-line-danger/20 aria-invalid:focus-visible:border-line-danger aria-invalid:focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-danger)] border-line-strong data-checked:border-action-primary data-checked:text-action-primary data-disabled:cursor-not-allowed data-disabled:border-line-subtle data-disabled:bg-surface data-disabled:text-fg-caption-placeholder data-disabled:active:scale-100", { variants: { size: radioSizeVariants } });
|
|
21
22
|
/**
|
|
22
23
|
* Compose each radio item with the shared field primitives.
|
|
23
24
|
*
|
|
@@ -34,11 +35,11 @@ const radioVariants = cva("group/radio-group-item peer relative flex aspect-squa
|
|
|
34
35
|
* ```
|
|
35
36
|
*/
|
|
36
37
|
function RadioGroupItem({ className, size, ...props }) {
|
|
37
|
-
const resolvedSize =
|
|
38
|
+
const resolvedSize = responsiveValueClasses(useComponentSizeValue(size), responsiveRadioSizes);
|
|
38
39
|
return /* @__PURE__ */ jsx(Radio.Root, {
|
|
39
40
|
"data-slot": "radio-group-item",
|
|
40
|
-
"data-size": resolvedSize,
|
|
41
|
-
className: cn(radioVariants({ size:
|
|
41
|
+
"data-size": resolvedSize.base,
|
|
42
|
+
className: cn(radioVariants({ size: null }), resolvedSize.className, className),
|
|
42
43
|
...props,
|
|
43
44
|
children: /* @__PURE__ */ jsx(Radio.Indicator, {
|
|
44
45
|
"data-slot": "radio-group-indicator",
|
|
@@ -47,5 +48,18 @@ function RadioGroupItem({ className, size, ...props }) {
|
|
|
47
48
|
})
|
|
48
49
|
});
|
|
49
50
|
}
|
|
51
|
+
const responsiveRadioSizes = {
|
|
52
|
+
base: radioSizeVariants,
|
|
53
|
+
md: {
|
|
54
|
+
sm: "md:size-4 md:[--radio-dot-size:0.625rem]",
|
|
55
|
+
md: "md:size-5 md:[--radio-dot-size:0.75rem]",
|
|
56
|
+
lg: "md:size-6 md:[--radio-dot-size:0.875rem]"
|
|
57
|
+
},
|
|
58
|
+
lg: {
|
|
59
|
+
sm: "lg:size-4 lg:[--radio-dot-size:0.625rem]",
|
|
60
|
+
md: "lg:size-5 lg:[--radio-dot-size:0.75rem]",
|
|
61
|
+
lg: "lg:size-6 lg:[--radio-dot-size:0.875rem]"
|
|
62
|
+
}
|
|
63
|
+
};
|
|
50
64
|
//#endregion
|
|
51
65
|
export { RadioGroup, RadioGroupItem, radioVariants };
|
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.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ComponentSize } from "./size-context-
|
|
1
|
+
import { t as ComponentSize } from "./size-context-BVhHduLi.js";
|
|
2
2
|
import { ChartConfig } from "./chart.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { CartesianGrid, Scatter, ScatterChart as ScatterChart$1, XAxis, YAxis } from "recharts";
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ComponentSize } from "./size-context-
|
|
1
|
+
import { t as ComponentSize } from "./size-context-BVhHduLi.js";
|
|
2
2
|
import { TabsListVariant } from "./tabs.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
//#region src/scroll-spy.d.ts
|
|
@@ -11,6 +11,12 @@ import * as React from "react";
|
|
|
11
11
|
* or `Popover` works without threading anything down by hand. `registerSection`
|
|
12
12
|
* is deliberately not exposed: sections are `ScrollSpyContent`'s to own.
|
|
13
13
|
*/
|
|
14
|
+
declare function useOptionalScrollSpy(): {
|
|
15
|
+
activeValue: string | undefined;
|
|
16
|
+
getSectionId: (value: string) => string;
|
|
17
|
+
getTriggerId: (value: string) => string;
|
|
18
|
+
scrollToSection: (value: string) => void;
|
|
19
|
+
} | null;
|
|
14
20
|
declare function useScrollSpy(): {
|
|
15
21
|
activeValue: string | undefined;
|
|
16
22
|
getSectionId: (value: string) => string;
|
|
@@ -73,4 +79,4 @@ type ScrollSpyContentProps = Omit<React.ComponentProps<"section">, "value"> & {
|
|
|
73
79
|
};
|
|
74
80
|
declare function ScrollSpyContent({ className, value, style, tabIndex, ...props }: ScrollSpyContentProps): React.JSX.Element;
|
|
75
81
|
//#endregion
|
|
76
|
-
export { ScrollSpy, ScrollSpyContent, type ScrollSpyContentProps, ScrollSpyList, type ScrollSpyListProps, type ScrollSpyProps, ScrollSpyTrigger, type ScrollSpyTriggerProps, scrollSpyTriggerClassName, useScrollSpy };
|
|
82
|
+
export { ScrollSpy, ScrollSpyContent, type ScrollSpyContentProps, ScrollSpyList, type ScrollSpyListProps, type ScrollSpyProps, ScrollSpyTrigger, type ScrollSpyTriggerProps, scrollSpyTriggerClassName, useOptionalScrollSpy, 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";
|
|
@@ -49,19 +49,19 @@ function useScrollSpyContext(part) {
|
|
|
49
49
|
* or `Popover` works without threading anything down by hand. `registerSection`
|
|
50
50
|
* is deliberately not exposed: sections are `ScrollSpyContent`'s to own.
|
|
51
51
|
*/
|
|
52
|
+
function useOptionalScrollSpy() {
|
|
53
|
+
const context = React.useContext(ScrollSpyContext);
|
|
54
|
+
return React.useMemo(() => context ? {
|
|
55
|
+
activeValue: context.activeValue,
|
|
56
|
+
getSectionId: context.getSectionId,
|
|
57
|
+
getTriggerId: context.getTriggerId,
|
|
58
|
+
scrollToSection: context.scrollToSection
|
|
59
|
+
} : null, [context]);
|
|
60
|
+
}
|
|
52
61
|
function useScrollSpy() {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
getSectionId,
|
|
57
|
-
getTriggerId,
|
|
58
|
-
scrollToSection
|
|
59
|
-
}), [
|
|
60
|
-
activeValue,
|
|
61
|
-
getSectionId,
|
|
62
|
-
getTriggerId,
|
|
63
|
-
scrollToSection
|
|
64
|
-
]);
|
|
62
|
+
const value = useOptionalScrollSpy();
|
|
63
|
+
if (!value) throw new Error("`useScrollSpy` must be used inside `ScrollSpy`.");
|
|
64
|
+
return value;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* `Tabs` for a page that shows everything at once: every section stays mounted
|
|
@@ -315,4 +315,4 @@ function ScrollSpyContent({ className, value, style, tabIndex = -1, ...props })
|
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
//#endregion
|
|
318
|
-
export { ScrollSpy, ScrollSpyContent, ScrollSpyList, ScrollSpyTrigger, scrollSpyTriggerClassName, useScrollSpy };
|
|
318
|
+
export { ScrollSpy, ScrollSpyContent, ScrollSpyList, ScrollSpyTrigger, scrollSpyTriggerClassName, useOptionalScrollSpy, 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";
|