@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.
Files changed (190) hide show
  1. package/css/components.css +13 -0
  2. package/css/generated/shared.css +1 -1
  3. package/dist/accordion.js +1 -1
  4. package/dist/activity-timeline.js +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/auth-layout.js +1 -1
  7. package/dist/avatar.js +1 -1
  8. package/dist/badge.d.ts +5 -1
  9. package/dist/badge.js +20 -6
  10. package/dist/bar-chart.d.ts +1 -1
  11. package/dist/bar-chart.js +1 -1
  12. package/dist/breadcrumb.js +1 -1
  13. package/dist/bullet-chart.d.ts +1 -1
  14. package/dist/bullet-chart.js +1 -1
  15. package/dist/button-BS5KCibF.d.ts +33 -0
  16. package/dist/button-group.d.ts +1 -1
  17. package/dist/button-group.js +1 -1
  18. package/dist/button.d.ts +1 -1
  19. package/dist/button.js +50 -22
  20. package/dist/calendar.js +2 -2
  21. package/dist/call-card.js +1 -1
  22. package/dist/card.js +1 -1
  23. package/dist/carousel.d.ts +4 -2
  24. package/dist/carousel.js +13 -16
  25. package/dist/chart.d.ts +1 -1
  26. package/dist/chart.js +1 -1
  27. package/dist/chat.d.ts +1 -1
  28. package/dist/chat.js +1 -1
  29. package/dist/checkbox.d.ts +2 -2
  30. package/dist/checkbox.js +21 -7
  31. package/dist/collapsible.js +1 -1
  32. package/dist/combobox-CACVdp1R.js +430 -0
  33. package/dist/combobox.d.ts +9 -4
  34. package/dist/combobox.js +2 -309
  35. package/dist/cta.d.ts +1 -1
  36. package/dist/cta.js +1 -1
  37. package/dist/currency-selector.js +2 -2
  38. package/dist/data-table.d.ts +2 -2
  39. package/dist/data-table.js +1 -1
  40. package/dist/date-picker.d.ts +6 -5
  41. package/dist/date-picker.js +7 -17
  42. package/dist/details-card.js +1 -1
  43. package/dist/dialog.d.ts +3 -1
  44. package/dist/dialog.js +10 -6
  45. package/dist/dropdown-menu.d.ts +1 -1
  46. package/dist/dropdown-menu.js +1 -1
  47. package/dist/dropzone.js +1 -1
  48. package/dist/editorial-card.js +2 -4
  49. package/dist/empty-state.js +1 -1
  50. package/dist/field.d.ts +4 -1
  51. package/dist/field.js +29 -12
  52. package/dist/file-upload.js +1 -1
  53. package/dist/filter.js +1 -1
  54. package/dist/footer.d.ts +2 -2
  55. package/dist/footer.js +1 -1
  56. package/dist/funnel-chart.d.ts +1 -1
  57. package/dist/funnel-chart.js +1 -1
  58. package/dist/gallery-indicator.js +1 -1
  59. package/dist/heatmap-chart.d.ts +1 -1
  60. package/dist/icons-C9JXR5Xv.d.ts +111 -0
  61. package/dist/icons.d.ts +2 -93
  62. package/dist/icons.js +37 -1
  63. package/dist/image.d.ts +59 -0
  64. package/dist/image.js +53 -0
  65. package/dist/infinite-scroll.js +3 -29
  66. package/dist/infotip.js +1 -1
  67. package/dist/input-group.d.ts +6 -6
  68. package/dist/input-group.js +39 -14
  69. package/dist/input-otp.d.ts +2 -2
  70. package/dist/input-otp.js +32 -15
  71. package/dist/input-size-context-BMhves-J.d.ts +13 -0
  72. package/dist/input-size-context.d.ts +2 -2
  73. package/dist/input-size-context.js +9 -2
  74. package/dist/input.d.ts +20 -2
  75. package/dist/input.js +31 -12
  76. package/dist/item.js +1 -1
  77. package/dist/kpi-card.js +1 -1
  78. package/dist/label.js +1 -1
  79. package/dist/line-chart.d.ts +1 -1
  80. package/dist/line-chart.js +1 -1
  81. package/dist/list-item.js +1 -1
  82. package/dist/map-indicator.js +1 -1
  83. package/dist/mask-input.d.ts +1 -1
  84. package/dist/match.d.ts +5 -2
  85. package/dist/match.js +183 -27
  86. package/dist/media-gallery-hero.js +15 -10
  87. package/dist/media-player.js +5 -13
  88. package/dist/message.js +2 -12
  89. package/dist/mobile-sidebar.js +2 -1
  90. package/dist/multi-step-form.js +2 -2
  91. package/dist/number-input.d.ts +2 -2
  92. package/dist/number-input.js +3 -3
  93. package/dist/page-header.js +1 -1
  94. package/dist/pagination.d.ts +1 -1
  95. package/dist/pagination.js +1 -1
  96. package/dist/password-input.js +1 -1
  97. package/dist/phone-input.d.ts +2 -2
  98. package/dist/phone-input.js +16 -21
  99. package/dist/photo-gallery.js +6 -3
  100. package/dist/picker-BTXBrsl4.js +62 -0
  101. package/dist/picker-j3txxA5t.d.ts +14 -0
  102. package/dist/pie-chart.d.ts +1 -1
  103. package/dist/pie-chart.js +1 -1
  104. package/dist/popover-CNymD33m.d.ts +20 -0
  105. package/dist/popover.d.ts +1 -19
  106. package/dist/popover.js +1 -1
  107. package/dist/price-tag.d.ts +1 -1
  108. package/dist/price-tag.js +50 -22
  109. package/dist/progress.js +1 -1
  110. package/dist/property-listing-card.d.ts +68 -2
  111. package/dist/property-listing-card.js +115 -29
  112. package/dist/purchase-option-card.js +1 -1
  113. package/dist/radar-chart.d.ts +1 -1
  114. package/dist/radar-chart.js +1 -1
  115. package/dist/radio-group.d.ts +2 -2
  116. package/dist/radio-group.js +24 -10
  117. package/dist/review-block.js +1 -1
  118. package/dist/rich-text-editor.d.ts +1 -1
  119. package/dist/rich-text-editor.js +1 -1
  120. package/dist/scatter-chart.d.ts +1 -1
  121. package/dist/scatter-chart.js +1 -1
  122. package/dist/scroll-spy.d.ts +8 -2
  123. package/dist/scroll-spy.js +16 -16
  124. package/dist/search-input.js +1 -1
  125. package/dist/section-jumper.d.ts +31 -0
  126. package/dist/section-jumper.js +276 -0
  127. package/dist/select.d.ts +9 -4
  128. package/dist/select.js +113 -20
  129. package/dist/separator.js +1 -1
  130. package/dist/sheet.d.ts +3 -1
  131. package/dist/sheet.js +10 -6
  132. package/dist/sidebar.d.ts +2 -2
  133. package/dist/sidebar.js +4 -16
  134. package/dist/size-context-BVhHduLi.d.ts +33 -0
  135. package/dist/size-context.d.ts +2 -2
  136. package/dist/size-context.js +30 -1
  137. package/dist/skeleton.js +1 -1
  138. package/dist/slider.d.ts +5 -3
  139. package/dist/slider.js +26 -11
  140. package/dist/sonar.d.ts +1 -1
  141. package/dist/sonar.js +2 -2
  142. package/dist/sparkline.d.ts +1 -1
  143. package/dist/sparkline.js +1 -1
  144. package/dist/stepper.js +1 -1
  145. package/dist/styles.css +1622 -264
  146. package/dist/switch.d.ts +2 -2
  147. package/dist/switch.js +21 -7
  148. package/dist/table-card.js +1 -1
  149. package/dist/table.js +1 -1
  150. package/dist/tabs.d.ts +1 -1
  151. package/dist/tabs.js +1 -1
  152. package/dist/tag.d.ts +1 -1
  153. package/dist/tag.js +1 -1
  154. package/dist/testimonial-block.js +1 -1
  155. package/dist/textarea.d.ts +17 -1
  156. package/dist/textarea.js +24 -10
  157. package/dist/theme-switcher.js +1 -1
  158. package/dist/time-picker.d.ts +5 -4
  159. package/dist/time-picker.js +5 -7
  160. package/dist/toast.js +1 -1
  161. package/dist/tooltip.js +1 -1
  162. package/dist/top-navbar.js +1 -1
  163. package/dist/tree-map.d.ts +1 -1
  164. package/dist/tree-map.js +1 -1
  165. package/dist/utils/cn.d.ts +5 -0
  166. package/dist/utils/cn.js +33 -0
  167. package/dist/utils/format.d.ts +45 -0
  168. package/dist/utils/format.js +70 -0
  169. package/dist/utils/phone.d.ts +98 -0
  170. package/dist/utils/phone.js +93 -0
  171. package/dist/utils/use-intersection.d.ts +9 -0
  172. package/dist/utils/use-intersection.js +29 -0
  173. package/dist/utils/use-is-mobile.d.ts +5 -0
  174. package/dist/utils/use-is-mobile.js +16 -0
  175. package/dist/utils/use-reduced-motion.d.ts +5 -0
  176. package/dist/{use-reduced-motion-BDvOK14x.js → utils/use-reduced-motion.js} +2 -2
  177. package/dist/utils/use-uncontrolled.d.ts +11 -0
  178. package/dist/{use-uncontrolled-CLfM1XbB.js → utils/use-uncontrolled.js} +2 -2
  179. package/dist/video-player-dialog.d.ts +12 -2
  180. package/dist/video-player-dialog.js +50 -9
  181. package/dist/waterfall-chart.d.ts +1 -1
  182. package/dist/waterfall-chart.js +1 -1
  183. package/package.json +13 -1
  184. package/dist/button-DW5OijoR.d.ts +0 -17
  185. package/dist/cn-BI_4DMBf.js +0 -23
  186. package/dist/input-CfoEJ8A6.d.ts +0 -12
  187. package/dist/input-size-context-C-SFx9sx.d.ts +0 -10
  188. package/dist/picker-xSTzeYhc.js +0 -50
  189. package/dist/size-context-BX6kAdVj.d.ts +0 -11
  190. 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 { t as cn } from "./cn-BI_4DMBf.js";
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 rounded-4xl bg-surface-brand font-bold leading-none 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", {
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 [&>svg]:size-3",
12
- xs: "min-h-7.5 gap-1 px-3 py-1 text-gdt-xs [&>svg]:size-3.5",
13
- sm: "min-h-9 gap-1.5 px-4 py-1.5 text-gdt-sm [&>svg]:size-3.5",
14
- md: "min-h-10.5 gap-1.5 px-5 py-2 text-gdt-md [&>svg]:size-4",
15
- lg: "min-h-13 gap-2 px-7 py-3 text-gdt-lg [&>svg]:size-4.5"
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 description is quieter than the price, and quietest at the largest size. */
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
- * Pill-shaped price display, optionally a trigger for a currency dropdown.
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 gap-1",
110
- children: [/* @__PURE__ */ jsx("span", { children: resolvedValue }), resolvedDescription ? /* @__PURE__ */ jsx("span", {
111
- className: cn("font-medium leading-none opacity-90", descriptionSizeClassName[size]),
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__ */ jsxs(Popover.Trigger, {
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: [pill, /* @__PURE__ */ jsx(ChevronDown, {
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,5 +1,5 @@
1
1
  "use client";
2
- import { t as cn } from "./cn-BI_4DMBf.js";
2
+ import { cn } from "./utils/cn.js";
3
3
  import { SizeProvider, useComponentSize } from "./size-context.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { cva } from "class-variance-authority";
@@ -1,4 +1,6 @@
1
- import { n as ButtonLink, t as Button } from "./button-DW5OijoR.js";
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 { t as cn } from "./cn-BI_4DMBf.js";
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
- function PropertyListingCardMedia({ className, images = [], children, ...props }) {
24
- const hasMultipleImages = images.length > 1;
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: [hasMultipleImages ? /* @__PURE__ */ jsxs(Carousel, {
29
- imageSize: "full",
30
- opts: { loop: true },
31
- className: "absolute inset-0 -z-10 size-full rounded-none bg-surface",
32
- children: [/* @__PURE__ */ jsx(CarouselContent, { children: images.map((carouselImage, index) => /* @__PURE__ */ jsx(CarouselItem, {
33
- className: "relative h-full",
34
- children: /* @__PURE__ */ jsx(PropertyListingCardImage, { image: carouselImage })
35
- }, carouselImage.id ?? carouselImage.src ?? carouselImage.alt ?? index)) }), /* @__PURE__ */ jsx(CarouselIndicator, {
36
- size: "sm",
37
- className: "bottom-16"
38
- })]
39
- }) : images[0]?.src ? /* @__PURE__ */ jsx(PropertyListingCardImage, {
40
- image: images[0],
41
- className: "absolute inset-0 -z-10"
42
- }) : /* @__PURE__ */ jsx("div", {
43
- className: "absolute inset-0 -z-10 grid place-items-center bg-surface-raised text-gdt-sm font-bold text-fg-caption-placeholder",
44
- children: "Property Image"
45
- }), children]
46
- });
47
- }
48
- function PropertyListingCardImage({ image, className, ...props }) {
49
- return /* @__PURE__ */ jsx("img", {
50
- src: image.src,
51
- alt: image.alt ?? "Property image",
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 { t as cn } from "./cn-BI_4DMBf.js";
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";
@@ -1,4 +1,4 @@
1
- import { t as ComponentSize } from "./size-context-BX6kAdVj.js";
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";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as cn } from "./cn-BI_4DMBf.js";
2
+ import { cn } from "./utils/cn.js";
3
3
  import { SizeProvider, useComponentSize } from "./size-context.js";
4
4
  import { ChartContainer } from "./chart.js";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- import { VariantProps } from "class-variance-authority";
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 = NonNullable<VariantProps<typeof radioVariants>["size"]>;
9
+ type RadioGroupItemSize = ComponentSizeValue;
10
10
  type RadioGroupItemProps<Value = unknown> = Radio.Root.Props<Value> & {
11
11
  size?: RadioGroupItemSize;
12
12
  };
@@ -1,11 +1,16 @@
1
1
  "use client";
2
- import { t as cn } from "./cn-BI_4DMBf.js";
3
- import { useComponentSize } from "./size-context.js";
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 size-5 [--radio-dot-size:0.75rem] group-data-[size=sm]/field:size-4 group-data-[size=sm]/field:[--radio-dot-size:0.625rem] group-data-[size=md]/field:size-5 group-data-[size=md]/field:[--radio-dot-size:0.75rem] group-data-[size=lg]/field:size-6 group-data-[size=lg]/field:[--radio-dot-size:0.875rem]", { variants: { size: {
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 = useComponentSize(size);
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: resolvedSize }), className),
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 };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as cn } from "./cn-BI_4DMBf.js";
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";
@@ -1,4 +1,4 @@
1
- import { t as ComponentSize } from "./size-context-BX6kAdVj.js";
1
+ import { t as ComponentSize } from "./size-context-BVhHduLi.js";
2
2
  import * as React from "react";
3
3
  //#region src/rich-text-editor.d.ts
4
4
  interface RichTextEditorProps {
@@ -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 { t as cn } from "./cn-BI_4DMBf.js";
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";
@@ -1,4 +1,4 @@
1
- import { t as ComponentSize } from "./size-context-BX6kAdVj.js";
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";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { t as cn } from "./cn-BI_4DMBf.js";
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";
@@ -1,4 +1,4 @@
1
- import { t as ComponentSize } from "./size-context-BX6kAdVj.js";
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 };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { t as cn } from "./cn-BI_4DMBf.js";
2
+ import { cn } from "./utils/cn.js";
3
3
  import { useComponentSize } from "./size-context.js";
4
- import { t as useReducedMotion } from "./use-reduced-motion-BDvOK14x.js";
5
- import { t as useUncontrolled } from "./use-uncontrolled-CLfM1XbB.js";
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 { 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
- ]);
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 };
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { Search, X } from "./icons.js";
3
- import { t as cn } from "./cn-BI_4DMBf.js";
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";