@oztix/roadie-components 2.0.2 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/Accordion.d.ts +6 -8
  2. package/dist/Accordion.d.ts.map +1 -1
  3. package/dist/Accordion.js +1 -1
  4. package/dist/Accordion.js.map +1 -1
  5. package/dist/Autocomplete.d.ts +24 -23
  6. package/dist/Autocomplete.d.ts.map +1 -1
  7. package/dist/Autocomplete.js +1 -1
  8. package/dist/Autocomplete.js.map +1 -1
  9. package/dist/Badge.d.ts +1 -1
  10. package/dist/Breadcrumb.d.ts +12 -14
  11. package/dist/Breadcrumb.d.ts.map +1 -1
  12. package/dist/Breadcrumb.js +1 -1
  13. package/dist/Breadcrumb.js.map +1 -1
  14. package/dist/Button.d.ts +2 -3
  15. package/dist/Button.js +1 -1
  16. package/dist/Card.d.ts +9 -11
  17. package/dist/Card.d.ts.map +1 -1
  18. package/dist/Card.js +1 -1
  19. package/dist/Card.js.map +1 -1
  20. package/dist/Carousel.d.ts +257 -0
  21. package/dist/Carousel.d.ts.map +1 -0
  22. package/dist/Carousel.js +2 -0
  23. package/dist/Carousel.js.map +1 -0
  24. package/dist/Code.d.ts +1 -1
  25. package/dist/Combobox.d.ts +25 -24
  26. package/dist/Combobox.d.ts.map +1 -1
  27. package/dist/Combobox.js +1 -1
  28. package/dist/Combobox.js.map +1 -1
  29. package/dist/Field.d.ts +14 -17
  30. package/dist/Field.d.ts.map +1 -1
  31. package/dist/Field.js +1 -1
  32. package/dist/Field.js.map +1 -1
  33. package/dist/Fieldset.d.ts +11 -14
  34. package/dist/Fieldset.d.ts.map +1 -1
  35. package/dist/Fieldset.js +1 -1
  36. package/dist/Fieldset.js.map +1 -1
  37. package/dist/{Button-DdE0vCfo.js → IconButton-0UdUDm0O.js} +1 -1
  38. package/dist/IconButton-0UdUDm0O.js.map +1 -0
  39. package/dist/{Button-Dt1TGgrL.d.ts → IconButton-BajbaUJ_.d.ts} +15 -3
  40. package/dist/IconButton-BajbaUJ_.d.ts.map +1 -0
  41. package/dist/LinkButton-9nnOzX_0.js.map +1 -1
  42. package/dist/LinkButton.d.ts +1 -1
  43. package/dist/RadioGroup.d.ts +14 -17
  44. package/dist/RadioGroup.d.ts.map +1 -1
  45. package/dist/RadioGroup.js +1 -1
  46. package/dist/RadioGroup.js.map +1 -1
  47. package/dist/Select.d.ts +30 -29
  48. package/dist/Select.d.ts.map +1 -1
  49. package/dist/Select.js +1 -1
  50. package/dist/Select.js.map +1 -1
  51. package/dist/Separator.d.ts +1 -1
  52. package/dist/Steps.d.ts +24 -26
  53. package/dist/Steps.d.ts.map +1 -1
  54. package/dist/Steps.js +1 -1
  55. package/dist/Steps.js.map +1 -1
  56. package/dist/{index-0w-ydb3o.d.ts → index-4M9XZOF1.d.ts} +25 -7
  57. package/dist/index-4M9XZOF1.d.ts.map +1 -0
  58. package/dist/index.d.ts +4 -4
  59. package/dist/index.js +4 -4
  60. package/dist/index.js.map +1 -1
  61. package/package.json +23 -3
  62. package/dist/Button-DdE0vCfo.js.map +0 -1
  63. package/dist/Button-Dt1TGgrL.d.ts.map +0 -1
  64. package/dist/index-0w-ydb3o.d.ts.map +0 -1
  65. package/dist/index-C3_4djmE.d.ts +0 -17
  66. package/dist/index-C3_4djmE.d.ts.map +0 -1
@@ -0,0 +1,257 @@
1
+ import { n as IconButtonProps } from "./IconButton-BajbaUJ_.js";
2
+ import { VariantProps } from "class-variance-authority";
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+ import { ComponentProps, ElementType, ReactNode } from "react";
5
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
6
+ import { EmblaCarouselType, EmblaOptionsType } from "embla-carousel";
7
+
8
+ //#region src/components/Carousel/index.d.ts
9
+ type CarouselDirection = 'horizontal' | 'vertical';
10
+ type CarouselActions = {
11
+ goToPrev: () => void;
12
+ goToNext: () => void;
13
+ goTo: (index: number) => void;
14
+ play: () => void;
15
+ pause: () => void;
16
+ toggle: () => void;
17
+ };
18
+ type CarouselState = {
19
+ direction: CarouselDirection; /** Selected snap index (0-based). Note: a snap may cover multiple slides. */
20
+ selectedIndex: number; /** Number of `Carousel.Item` children. Used for "N of M" slide labels. */
21
+ slideCount: number;
22
+ /**
23
+ * Number of distinct Embla scroll snap positions. May be smaller than
24
+ * `slideCount` for multi-visible layouts (e.g. `basis-1/3` with 4 cards
25
+ * creates 2 snaps), or equal to it for single-slide layouts. Falls back
26
+ * to `slideCount` in environments where Embla can't measure (jsdom).
27
+ */
28
+ snapCount: number;
29
+ canGoToPrev: boolean;
30
+ canGoToNext: boolean;
31
+ /**
32
+ * True when there is somewhere to scroll to. False when every slide
33
+ * already fits in the viewport (snapCount <= 1) — in which case
34
+ * Previous / Next / Dots / Controls all hide themselves.
35
+ */
36
+ canScroll: boolean;
37
+ isPlaying: boolean;
38
+ userPaused: boolean;
39
+ labelId: string | undefined;
40
+ rootAriaLabel: string | undefined;
41
+ };
42
+ type UseCarouselReturn = {
43
+ state: CarouselState;
44
+ actions: CarouselActions;
45
+ };
46
+ /**
47
+ * Access the carousel's state and actions. Must be called inside a
48
+ * `<Carousel>` tree.
49
+ *
50
+ * For escape-hatch access to the underlying Embla instance, use
51
+ * `useCarouselUnsafeEmbla()` — it is intentionally separate so raw-Embla
52
+ * coupling is greppable.
53
+ */
54
+ declare function useCarousel(): UseCarouselReturn;
55
+ /**
56
+ * Escape hatch: read the underlying Embla `api` instance directly.
57
+ *
58
+ * Returning Embla's API hard-couples your code to a specific major version
59
+ * of `embla-carousel`. Prefer `useCarousel()` whenever the public state and
60
+ * actions are sufficient. This hook exists so you can grep for raw-Embla
61
+ * usage when planning an upgrade.
62
+ */
63
+ declare function useCarouselUnsafeEmbla(): EmblaCarouselType | undefined;
64
+ declare const carouselContentVariants: (props?: ({
65
+ direction?: "horizontal" | "vertical" | null | undefined;
66
+ overflow?: "subtle" | "hidden" | "visible" | null | undefined;
67
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
68
+ declare const carouselContainerVariants: (props?: ({
69
+ direction?: "horizontal" | "vertical" | null | undefined;
70
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
71
+ declare const carouselItemVariants: (props?: ({
72
+ direction?: "horizontal" | "vertical" | null | undefined;
73
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
74
+ declare const carouselDotsVariants: (props?: ({
75
+ direction?: "horizontal" | "vertical" | null | undefined;
76
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
77
+ interface CarouselProps extends Omit<ComponentProps<'div'>, 'onBlur'> {
78
+ /** Pass-through options for the Embla instance. */
79
+ opts?: EmblaOptionsType;
80
+ /** Scroll direction. @default 'horizontal' */
81
+ direction?: CarouselDirection;
82
+ /**
83
+ * Autoplay delay in milliseconds, or `false` to disable. When set, an
84
+ * autoplay plugin is wired internally and pauses on hover / focus / pointer
85
+ * interaction. A persistent pause control via `<Carousel.PlayPause>` is
86
+ * strongly recommended for WCAG 2.2.2 compliance.
87
+ * @default false
88
+ */
89
+ autoPlay?: number | false;
90
+ /** Accessible name for the carousel region. */
91
+ 'aria-label'?: string;
92
+ }
93
+ declare function Carousel({
94
+ opts,
95
+ direction,
96
+ autoPlay,
97
+ children,
98
+ className,
99
+ 'aria-label': ariaLabel,
100
+ ...props
101
+ }: CarouselProps): _$react_jsx_runtime0.JSX.Element;
102
+ declare namespace Carousel {
103
+ var displayName: string;
104
+ var Header: typeof CarouselHeader;
105
+ var Title: typeof CarouselTitle;
106
+ var TitleLink: typeof CarouselTitleLink;
107
+ var Controls: typeof CarouselControls;
108
+ var Content: typeof CarouselContent;
109
+ var Item: typeof CarouselItem;
110
+ var Previous: typeof CarouselPrevious;
111
+ var Next: typeof CarouselNext;
112
+ var PlayPause: typeof CarouselPlayPause;
113
+ var Dots: typeof CarouselDots;
114
+ }
115
+ type CarouselHeaderProps = ComponentProps<'div'>;
116
+ declare function CarouselHeader({
117
+ className,
118
+ ...props
119
+ }: CarouselHeaderProps): _$react_jsx_runtime0.JSX.Element;
120
+ declare namespace CarouselHeader {
121
+ var displayName: string;
122
+ }
123
+ type CarouselControlsProps = ComponentProps<'div'> & {
124
+ /**
125
+ * Render the controls even when there's nothing to scroll to. Useful
126
+ * when the slot contains custom buttons (filters, share) that aren't
127
+ * gated on slide count.
128
+ */
129
+ forceVisible?: boolean;
130
+ };
131
+ declare function CarouselControls({
132
+ className,
133
+ forceVisible,
134
+ ...props
135
+ }: CarouselControlsProps): _$react_jsx_runtime0.JSX.Element | null;
136
+ declare namespace CarouselControls {
137
+ var displayName: string;
138
+ }
139
+ type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
140
+ type CarouselTitleProps = ComponentProps<'h2'> & {
141
+ /** Heading level. Defaults to `<h2>`. */as?: HeadingLevel;
142
+ };
143
+ declare function CarouselTitle({
144
+ as: Component,
145
+ className,
146
+ children,
147
+ id,
148
+ ...props
149
+ }: CarouselTitleProps): _$react_jsx_runtime0.JSX.Element;
150
+ declare namespace CarouselTitle {
151
+ var displayName: string;
152
+ }
153
+ type CarouselTitleLinkOwnProps<T extends ElementType> = {
154
+ /**
155
+ * Render the link as a custom element/component (e.g. Next.js `Link`).
156
+ * Defaults to `<a>`.
157
+ */
158
+ as?: T; /** DOM id for `aria-labelledby`. Defaults to a generated id. */
159
+ id?: string;
160
+ };
161
+ type CarouselTitleLinkProps<T extends ElementType = 'a'> = CarouselTitleLinkOwnProps<T> & Omit<ComponentProps<T>, keyof CarouselTitleLinkOwnProps<T>>;
162
+ declare function CarouselTitleLink<T extends ElementType = 'a'>({
163
+ as,
164
+ className,
165
+ children,
166
+ id,
167
+ ...props
168
+ }: CarouselTitleLinkProps<T>): _$react_jsx_runtime0.JSX.Element;
169
+ declare namespace CarouselTitleLink {
170
+ var displayName: string;
171
+ }
172
+ type CarouselContentOverflow = 'hidden' | 'visible' | 'subtle';
173
+ type CarouselContentProps = ComponentProps<'div'> & {
174
+ /** Props to forward to the inner Embla container (flex row/col). */containerProps?: ComponentProps<'div'>;
175
+ /**
176
+ * How slides escape the viewport box.
177
+ *
178
+ * - `subtle` (default): slides bleed past the edges by the gutter width
179
+ * and fade to the page background via `::before` / `::after`
180
+ * gradients. Good for most carousels — gives a clear scroll hint
181
+ * without half-clipped cards.
182
+ * - `hidden`: slides are hard-clipped at the viewport edge.
183
+ * - `visible`: slides can extend indefinitely. Useful on wide screens
184
+ * where you deliberately want peeking slides to remain fully
185
+ * rendered in the surrounding margin area.
186
+ *
187
+ * @default 'subtle'
188
+ */
189
+ overflow?: 'hidden' | 'visible' | 'subtle';
190
+ };
191
+ declare function CarouselContent({
192
+ className,
193
+ children,
194
+ containerProps,
195
+ onKeyDown,
196
+ overflow,
197
+ ...props
198
+ }: CarouselContentProps): _$react_jsx_runtime0.JSX.Element;
199
+ declare namespace CarouselContent {
200
+ var displayName: string;
201
+ }
202
+ type CarouselItemProps = ComponentProps<'div'>;
203
+ declare function CarouselItem({
204
+ className,
205
+ children,
206
+ ...props
207
+ }: CarouselItemProps): _$react_jsx_runtime0.JSX.Element;
208
+ declare namespace CarouselItem {
209
+ var displayName: string;
210
+ }
211
+ type CarouselNavButtonProps = Omit<IconButtonProps, 'aria-label' | 'children'> & {
212
+ /**
213
+ * Override the default accessible label.
214
+ * Defaults to "Previous slide" / "Next slide" / "Pause carousel" / "Play carousel".
215
+ */
216
+ 'aria-label'?: string; /** Override the default caret/play/pause icon. */
217
+ children?: ReactNode;
218
+ };
219
+ declare function CarouselPrevious({
220
+ className,
221
+ 'aria-label': ariaLabel,
222
+ children,
223
+ ...props
224
+ }: CarouselNavButtonProps): _$react_jsx_runtime0.JSX.Element | null;
225
+ declare namespace CarouselPrevious {
226
+ var displayName: string;
227
+ }
228
+ declare function CarouselNext({
229
+ className,
230
+ 'aria-label': ariaLabel,
231
+ children,
232
+ ...props
233
+ }: CarouselNavButtonProps): _$react_jsx_runtime0.JSX.Element | null;
234
+ declare namespace CarouselNext {
235
+ var displayName: string;
236
+ }
237
+ declare function CarouselPlayPause({
238
+ className,
239
+ 'aria-label': ariaLabel,
240
+ children,
241
+ ...props
242
+ }: CarouselNavButtonProps): _$react_jsx_runtime0.JSX.Element | null;
243
+ declare namespace CarouselPlayPause {
244
+ var displayName: string;
245
+ }
246
+ type CarouselDotsProps = ComponentProps<'div'>;
247
+ declare function CarouselDots({
248
+ className,
249
+ ...props
250
+ }: CarouselDotsProps): _$react_jsx_runtime0.JSX.Element | null;
251
+ declare namespace CarouselDots {
252
+ var displayName: string;
253
+ }
254
+ type CarouselVariantProps = VariantProps<typeof carouselContentVariants>;
255
+ //#endregion
256
+ export { Carousel, CarouselActions, CarouselContent, CarouselContentOverflow, CarouselContentProps, CarouselControls, CarouselControlsProps, CarouselDots, CarouselDotsProps, CarouselHeader, CarouselHeaderProps, CarouselItem, CarouselItemProps, CarouselNavButtonProps, CarouselNext, CarouselPlayPause, CarouselPrevious, CarouselProps, CarouselState, CarouselTitle, CarouselTitleLink, CarouselTitleLinkProps, CarouselTitleProps, CarouselVariantProps, UseCarouselReturn, carouselContainerVariants, carouselContentVariants, carouselDotsVariants, carouselItemVariants, useCarousel, useCarouselUnsafeEmbla };
257
+ //# sourceMappingURL=Carousel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Carousel.d.ts","names":[],"sources":["../src/components/Carousel/index.tsx"],"mappings":";;;;;;;;KA2GK,iBAAA;AAAA,KAEO,eAAA;EACV,QAAA;EACA,QAAA;EACA,IAAA,GAAO,KAAA;EACP,IAAA;EACA,KAAA;EACA,MAAA;AAAA;AAAA,KAGU,aAAA;EACV,SAAA,EAAW,iBAAA;EAEX,aAAA,UAXA;EAaA,UAAA;EAXA;;;;;;EAkBA,SAAA;EACA,WAAA;EACA,WAAA;;;;;;EAMA,SAAA;EACA,SAAA;EACA,UAAA;EACA,OAAA;EACA,aAAA;AAAA;AAAA,KAGU,iBAAA;EACV,KAAA,EAAO,aAAA;EACP,OAAA,EAAS,eAAA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;AAAA,iBAYG,gBAAA,CAAA;EACd,SAAA;EAAA,cACc,SAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,sBAAA,GAAsB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBALT,gBAAA;EAAA,IAAgB,WAAA;AAAA;AAAA,iBA0BhB,YAAA,CAAA;EACd,SAAA;EAAA,cACc,SAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,sBAAA,GAAsB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBALT,YAAA;EAAA,IAAY,WAAA;AAAA;AAAA,iBA4BZ,iBAAA,CAAA;EACd,SAAA;EAAA,cACc,SAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,sBAAA,GAAsB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBALT,iBAAA;EAAA,IAAiB,WAAA;AAAA;AAAA,KAgCrB,iBAAA,GAAoB,cAAA;AAAA,iBAEhB,YAAA,CAAA;EAAe,SAAA;EAAA,GAAc;AAAA,GAAS,iBAAA,GAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAvD,YAAA;EAAA,IAAY,WAAA;AAAA;AAAA,KAuDhB,oBAAA,GAAuB,YAAA,QAAoB,uBAAA"}
@@ -0,0 +1,2 @@
1
+ "use client";import{t as e}from"./IconButton-0UdUDm0O.js";import{cva as t}from"class-variance-authority";import{cn as n}from"@oztix/roadie-core/utils";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{Children as a,createContext as o,isValidElement as s,use as c,useCallback as l,useEffect as u,useId as d,useLayoutEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{ArrowRightIcon as g,CaretDownIcon as _,CaretLeftIcon as v,CaretRightIcon as y,CaretUpIcon as b,PauseIcon as x,PlayIcon as S}from"@phosphor-icons/react/ssr";import C from"embla-carousel-autoplay";import w from"embla-carousel-react";function T(){return typeof process<`u`&&process?.env?.NODE_ENV!==`production`}function E(e){try{e()}catch(e){T()&&console.warn(`[Carousel] Autoplay plugin call failed:`,e)}}function D(){let[e,t]=h(!1);return u(()=>{if(typeof window>`u`||!window.matchMedia)return;let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);t(e.matches);let n=e=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}const O=o(null),k=o(null);function A(){let e=c(O);if(!e)throw Error(`Carousel subcomponent must be used inside <Carousel>`);return e}function j(){let e=c(k);if(!e)throw Error(`<Carousel.Item> must be a direct child of <Carousel.Content>`);return e}function M(){let e=A();return{state:p(()=>({direction:e.direction,selectedIndex:e.selectedIndex,slideCount:e.slideCount,snapCount:e.snapCount,canGoToPrev:e.canGoToPrev,canGoToNext:e.canGoToNext,canScroll:e.canScroll,isPlaying:e.isPlaying,userPaused:e.userPaused,labelId:e.labelId,rootAriaLabel:e.rootAriaLabel}),[e.direction,e.selectedIndex,e.slideCount,e.snapCount,e.canGoToPrev,e.canGoToNext,e.canScroll,e.isPlaying,e.userPaused,e.labelId,e.rootAriaLabel]),actions:p(()=>({goToPrev:e.goToPrev,goToNext:e.goToNext,goTo:e.goTo,play:e.play,pause:e.pause,toggle:e.toggle}),[e.goToPrev,e.goToNext,e.goTo,e.play,e.pause,e.toggle])}}function N(){return A().api}const P=t(`relative focus-visible:outline-none`,{variants:{direction:{horizontal:`-my-4 py-4`,vertical:``},overflow:{hidden:`overflow-clip`,visible:`overflow-visible`,subtle:`overflow-clip`}},compoundVariants:[{overflow:`subtle`,direction:`horizontal`,class:[`-mx-4 px-4 sm:-mx-6 sm:px-6`,`before:pointer-events-none before:absolute before:inset-y-0 before:left-0 before:z-10`,`before:w-4 sm:before:w-6`,`before:bg-linear-to-r before:from-[var(--intent-bg-normal)] before:to-transparent`,`after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:z-10`,`after:w-4 sm:after:w-6`,`after:bg-linear-to-l after:from-[var(--intent-bg-normal)] after:to-transparent`].join(` `)},{overflow:`subtle`,direction:`vertical`,class:[`py-4`,`before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-10`,`before:h-4`,`before:bg-linear-to-b before:from-[var(--intent-bg-normal)] before:to-transparent`,`after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:z-10`,`after:h-4`,`after:bg-linear-to-t after:from-[var(--intent-bg-normal)] after:to-transparent`].join(` `)}],defaultVariants:{direction:`horizontal`,overflow:`subtle`}}),F=t(`flex`,{variants:{direction:{horizontal:`-ml-4`,vertical:`-mt-4 h-full flex-col`}},defaultVariants:{direction:`horizontal`}}),I=t(`min-h-0 min-w-0 shrink-0 grow-0 basis-full`,{variants:{direction:{horizontal:`pl-4`,vertical:`pt-4`}},defaultVariants:{direction:`horizontal`}}),L=t(`flex items-center justify-center`,{variants:{direction:{horizontal:`flex-row gap-1.5`,vertical:`flex-col gap-1.5`}},defaultVariants:{direction:`horizontal`}});function R({opts:e,direction:t=`horizontal`,autoPlay:i=!1,children:a,className:o,"aria-label":s,...c}){let d=D(),f=t===`vertical`?`y`:`x`,g=i!==!1;u(()=>{T()&&i!==!1&&i<2e3&&console.warn(`[Carousel] autoPlay delay < 2000ms may fail WCAG 2.2.1 timing; prefer >= 4000ms.`)},[i]),u(()=>{T()&&e?.axis&&e.axis!==f&&console.warn(`[Carousel] opts.axis="${e.axis}" conflicts with direction="${t}". direction wins.`)},[e?.axis,f,t]);let _=p(()=>!g||d?[]:[C({delay:i,stopOnLastSnap:!1})],[i,d,g]),[v,y]=w(p(()=>({align:`start`,slidesToScroll:`auto`,...e,axis:f,duration:d?0:e?.duration??25}),[e,f,d]),_),[b,x]=h(0),[S,k]=h(0),[A,j]=h(0),[M,N]=h(void 0),[P,F]=h([0]),[I,L]=h(()=>g&&!d),[R,z]=h(!1),B=m(!1),V=e?.loop===!0,H=m(!1),U=l(e=>{H.current=!0,x(e.selectedSnap())},[]);u(()=>{if(y)return U(y),y.on(`reinit`,U).on(`select`,U),()=>{y.off(`reinit`,U).off(`select`,U)}},[y,U]);let W=l(e=>{let t=e.slidesInView();F(t.length>0?t:[e.selectedSnap()]),j(e.snapList().length)},[]);u(()=>{if(y)return W(y),y.on(`reinit`,W).on(`slidesinview`,W).on(`resize`,W).on(`slideschanged`,W),()=>{y.off(`reinit`,W).off(`slidesinview`,W).off(`resize`,W).off(`slideschanged`,W)}},[y,W]),u(()=>{if(!y)return;let e=e=>{if(typeof document>`u`)return;let t=document.activeElement;if(!t||!t.isConnected)return;let n=t.closest(`[aria-roledescription="slide"]`);if(!n||t===n)return;let r=e.selectedSnap();requestAnimationFrame(()=>{e.slideNodes()[r]?.focus({preventScroll:!0})})};return y.on(`select`,e),()=>{y.off(`select`,e)}},[y]),u(()=>{if(!y)return;let e=y.plugins().autoplay;e&&(B.current||E(e.play))},[y,_]),u(()=>{L(g&&!d),(!g||d)&&(z(!1),B.current=!1)},[g,d]),u(()=>{y?.reInit()},[y,S]);let G=A>0?A:S,K=G>0?Math.min(Math.max(0,b),G-1):0,q=G>1&&(V||K>0),J=G>1&&(V||K<G-1),Y=G>1,X=p(()=>({goToPrev:()=>{H.current=!1,y?.goToPrev(),!H.current&&x(e=>e>0?e-1:V?Math.max(0,G-1):e)},goToNext:()=>{H.current=!1,y?.goToNext(),!H.current&&x(e=>e<G-1?e+1:V?0:e)},goTo:e=>{H.current=!1,y?.goTo(e),!H.current&&x(Math.max(0,Math.min(e,G-1)))},play:()=>{if(!g)return;B.current=!1,z(!1),L(!0);let e=y?.plugins().autoplay;e&&E(e.play)},pause:()=>{if(!g)return;B.current=!0,z(!0),L(!1);let e=y?.plugins().autoplay;e&&E(e.stop)},toggle:()=>{if(!g)return;let e=!I;B.current=!e,z(!e),L(e);let t=y?.plugins().autoplay;t&&E(e?t.play:t.stop)}}),[y,g,I,V,G]),Z=l(()=>{if(B.current)return;let e=y?.plugins().autoplay;e&&E(e.pause)},[y]),Q=l(()=>{if(B.current)return;let e=y?.plugins().autoplay;e&&E(e.play)},[y]),$=l(()=>{if(B.current)return;let e=y?.plugins().autoplay;e&&E(e.pause)},[y]),ee=l(e=>{if(B.current)return;let t=e.relatedTarget,n=e.currentTarget,r=()=>{let e=y?.plugins().autoplay;e&&E(e.play)};if(!t){requestAnimationFrame(()=>{n.isConnected&&!n.contains(document.activeElement)&&r()});return}n.contains(t)||r()},[y]),te=p(()=>({direction:t,selectedIndex:K,slideCount:S,snapCount:G,canGoToPrev:q,canGoToNext:J,canScroll:Y,isPlaying:I,userPaused:R,labelId:M,rootAriaLabel:s,goToPrev:X.goToPrev,goToNext:X.goToNext,goTo:X.goTo,play:X.play,pause:X.pause,toggle:X.toggle,api:y,emblaRef:v,setSlideCount:k,setLabelId:N,loop:V,autoPlay:i,slidesInView:P}),[t,K,S,q,J,Y,I,R,M,s,X,y,v,V,i,P]);return r(O.Provider,{value:te,children:r(`div`,{role:`region`,"aria-roledescription":`carousel`,"aria-label":M?void 0:s,"aria-labelledby":M,onMouseEnter:Z,onMouseLeave:Q,onFocus:$,onBlur:ee,className:n(`relative`,o),...c,children:a})})}R.displayName=`Carousel`;function z({className:e,...t}){return r(`div`,{className:n(`mb-4 flex items-center justify-between gap-4`,`md:grid md:grid-cols-[1fr_auto_1fr]`,`md:[&>*:first-child]:justify-self-start`,`md:[&>*:last-child:not(:first-child)]:col-start-3`,`md:[&>*:last-child:not(:first-child)]:justify-self-end`,`md:[&>*:nth-child(2):not(:last-child)]:col-start-2`,`md:[&>*:nth-child(2):not(:last-child)]:justify-self-center`,e),...t})}z.displayName=`Carousel.Header`;function B({className:e,forceVisible:t=!1,...i}){let{canScroll:a}=A();return!t&&!a?null:r(`div`,{className:n(`hidden items-center gap-2 md:flex`,e),...i})}B.displayName=`Carousel.Controls`;function V(e){let{setLabelId:t}=A();u(()=>(t(e),()=>{t(t=>t===e?void 0:t)}),[e,t])}function H({as:e=`h2`,className:t,children:i,id:a,...o}){let s=d(),c=a??s;return V(c),r(e,{id:c,className:n(`text-display-ui-5 text-strong`,t),...o,children:i})}H.displayName=`Carousel.Title`;function U({as:e,className:t,children:a,id:o,...s}){let c=d(),l=o??c;return V(l),i(e??`a`,{id:l,className:n(`group/title is-interactive flex items-center gap-1 text-display-ui-5 text-strong`,t),...s,children:[a,r(g,{weight:`bold`,className:`size-5 text-subtle transition-transform group-hover/title:translate-x-1 group-hover/title:intent-accent`})]})}U.displayName=`Carousel.TitleLink`;function W({className:e,children:t,containerProps:i,onKeyDown:o,overflow:c=`subtle`,...u}){let{direction:d,selectedIndex:m,snapCount:h,slidesInView:g,isPlaying:_,labelId:v,rootAriaLabel:y,goToPrev:b,goToNext:x,goTo:S,emblaRef:C,setSlideCount:w}=A(),T=_?`off`:`polite`,E=a.count(t);f(()=>{w(E)},[E,w]);let D=p(()=>new Set(g),[g]),O=a.map(t,(e,t)=>{if(!s(e))return e;let n={index:t,total:E,isActive:t===m,isInView:D.has(t)};return r(k.Provider,{value:n,children:e},e.key??t)});return r(`div`,{ref:C,tabIndex:0,onKeyDown:l(e=>{if(o?.(e),e.defaultPrevented)return;let t=e.target;if(t!==e.currentTarget){let e=t.closest(`[role="group"][aria-roledescription="slide"]`),n=t.matches(`button, a, input, textarea, select, [tabindex]:not([tabindex="-1"])`);if(e&&n)return}let n=d===`horizontal`,r=n?`ArrowLeft`:`ArrowUp`,i=n?`ArrowRight`:`ArrowDown`;e.key===r?(e.preventDefault(),b()):e.key===i?(e.preventDefault(),x()):e.key===`Home`?(e.preventDefault(),S(0)):e.key===`End`&&(e.preventDefault(),S(Math.max(0,h-1)))},[d,b,x,S,h,o]),"aria-live":T,"aria-label":v?void 0:y,"aria-labelledby":v,className:n(P({direction:d,overflow:c}),e),...u,children:r(`div`,{...i,className:n(F({direction:d}),i?.className),children:O})})}W.displayName=`Carousel.Content`;function G({className:e,children:t,...i}){let{direction:a}=A(),{index:o,total:s,isInView:c}=j();return r(`div`,{role:`group`,"aria-roledescription":`slide`,"aria-label":`${o+1} of ${s}`,tabIndex:-1,inert:!c,className:n(I({direction:a}),e),...i,children:t})}G.displayName=`Carousel.Item`;function K({className:t,"aria-label":n=`Previous slide`,children:i,...a}){let{direction:o,canScroll:s,canGoToPrev:c,goToPrev:l}=A();if(!s)return null;let u=o===`vertical`?b:v;return r(e,{size:`icon-sm`,className:t,"aria-label":n,"aria-disabled":!c||void 0,"data-disabled":!c||void 0,onClick:c?l:void 0,...a,children:i??r(u,{weight:`bold`,className:`size-4`})})}K.displayName=`Carousel.Previous`;function q({className:t,"aria-label":n=`Next slide`,children:i,...a}){let{direction:o,canScroll:s,canGoToNext:c,goToNext:l}=A();if(!s)return null;let u=o===`vertical`?_:y;return r(e,{size:`icon-sm`,className:t,"aria-label":n,"aria-disabled":!c||void 0,"data-disabled":!c||void 0,onClick:c?l:void 0,...a,children:i??r(u,{weight:`bold`,className:`size-4`})})}q.displayName=`Carousel.Next`;function J({className:t,"aria-label":n,children:i,...a}){let{autoPlay:o,isPlaying:s,toggle:c}=A();if(o===!1)return null;let l=n??(s?`Pause carousel`:`Play carousel`);return r(e,{size:`icon-sm`,className:t,"aria-label":l,"aria-pressed":!s,onClick:c,...a,children:i??r(s?x:S,{weight:`bold`,className:`size-4 text-subtle`})})}J.displayName=`Carousel.PlayPause`;function Y({className:e,...t}){let{direction:i,snapCount:a,selectedIndex:o,canScroll:s,goTo:c}=A();return s?r(`div`,{role:`group`,"aria-label":`Choose slide to display`,className:n(L({direction:i}),e),...t,children:Array.from({length:a},(e,t)=>{let i=t===o;return r(`button`,{type:`button`,"aria-label":`Go to slide ${t+1}`,"aria-current":i?`true`:void 0,"aria-disabled":i||void 0,onClick:()=>c(t),className:n(`is-interactive h-2 rounded-full transition-all`,i?`w-5 emphasis-strong intent-accent`:`w-2 emphasis-normal`)},t)})}):null}Y.displayName=`Carousel.Dots`,R.Header=z,R.Title=H,R.TitleLink=U,R.Controls=B,R.Content=W,R.Item=G,R.Previous=K,R.Next=q,R.PlayPause=J,R.Dots=Y;export{R as Carousel,W as CarouselContent,B as CarouselControls,Y as CarouselDots,z as CarouselHeader,G as CarouselItem,q as CarouselNext,J as CarouselPlayPause,K as CarouselPrevious,H as CarouselTitle,U as CarouselTitleLink,F as carouselContainerVariants,P as carouselContentVariants,L as carouselDotsVariants,I as carouselItemVariants,M as useCarousel,N as useCarouselUnsafeEmbla};
2
+ //# sourceMappingURL=Carousel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Carousel.js","names":[],"sources":["../src/components/Carousel/index.tsx"],"sourcesContent":["'use client'\n\nimport {\n Children,\n type ComponentProps,\n type Dispatch,\n type ElementType,\n type FocusEvent as ReactFocusEvent,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type Ref,\n type SetStateAction,\n createContext,\n isValidElement,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState\n} from 'react'\n\nimport {\n ArrowRightIcon,\n CaretDownIcon,\n CaretLeftIcon,\n CaretRightIcon,\n CaretUpIcon,\n PauseIcon,\n PlayIcon\n} from '@phosphor-icons/react/ssr'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type {\n EmblaCarouselType,\n EmblaOptionsType,\n EmblaPluginType\n} from 'embla-carousel'\nimport AutoplayPlugin from 'embla-carousel-autoplay'\nimport useEmblaCarousel from 'embla-carousel-react'\n\nimport { cn } from '@oztix/roadie-core/utils'\n\nimport { IconButton, type IconButtonProps } from '../Button/IconButton'\n\n/**\n * Development-mode check that works across consumer bundlers.\n *\n * Uses `process.env.NODE_ENV` rather than `import.meta.env.DEV` because\n * the latter is Vite-specific — Next.js, Webpack, Rollup, and friends\n * don't populate it, so the dev-only warnings would never fire in those\n * consumer runtimes. Every mainstream bundler replaces\n * `process.env.NODE_ENV` with a string literal at build time; the\n * `typeof process` guard covers the case where a consumer bundler hasn't\n * shimmed `process` on the client. The minimal ambient `process`\n * declaration below keeps us from pulling `@types/node` into the\n * package-wide `types` array, which would otherwise leak Node-only\n * globals into DOM code.\n */\ndeclare const process: { env?: { NODE_ENV?: string } } | undefined\n\nfunction isDevEnvironment(): boolean {\n return (\n typeof process !== 'undefined' && process?.env?.NODE_ENV !== 'production'\n )\n}\n\n/**\n * Embla v9's autoplay plugin can throw from its own methods if `init()`\n * bailed out (e.g. snapList was empty at init time in a test environment).\n * Wrap direct plugin calls so a defensive bail-out doesn't crash the host,\n * and surface the failure via `console.warn` in dev so it isn't swallowed\n * silently — Roadie's React state stays authoritative for isPlaying /\n * userPaused regardless, but the warning makes plugin regressions\n * debuggable.\n */\nfunction safePluginCall(fn: () => void): void {\n try {\n fn()\n } catch (error) {\n if (isDevEnvironment()) {\n console.warn('[Carousel] Autoplay plugin call failed:', error)\n }\n }\n}\n\n/* ─── prefers-reduced-motion hook ─── */\n\nfunction usePrefersReducedMotion(): boolean {\n // SSR + first client render always see `false` so server / client markup\n // matches. The real value is applied on the first client effect tick;\n // Embla re-inits if it flips.\n const [prefers, setPrefers] = useState(false)\n useEffect(() => {\n if (typeof window === 'undefined' || !window.matchMedia) return\n const mql = window.matchMedia('(prefers-reduced-motion: reduce)')\n setPrefers(mql.matches)\n const listener = (e: MediaQueryListEvent) => setPrefers(e.matches)\n mql.addEventListener('change', listener)\n return () => mql.removeEventListener('change', listener)\n }, [])\n return prefers\n}\n\n/* ─── Types ─── */\n\ntype CarouselDirection = 'horizontal' | 'vertical'\n\nexport type CarouselActions = {\n goToPrev: () => void\n goToNext: () => void\n goTo: (index: number) => void\n play: () => void\n pause: () => void\n toggle: () => void\n}\n\nexport type CarouselState = {\n direction: CarouselDirection\n /** Selected snap index (0-based). Note: a snap may cover multiple slides. */\n selectedIndex: number\n /** Number of `Carousel.Item` children. Used for \"N of M\" slide labels. */\n slideCount: number\n /**\n * Number of distinct Embla scroll snap positions. May be smaller than\n * `slideCount` for multi-visible layouts (e.g. `basis-1/3` with 4 cards\n * creates 2 snaps), or equal to it for single-slide layouts. Falls back\n * to `slideCount` in environments where Embla can't measure (jsdom).\n */\n snapCount: number\n canGoToPrev: boolean\n canGoToNext: boolean\n /**\n * True when there is somewhere to scroll to. False when every slide\n * already fits in the viewport (snapCount <= 1) — in which case\n * Previous / Next / Dots / Controls all hide themselves.\n */\n canScroll: boolean\n isPlaying: boolean\n userPaused: boolean\n labelId: string | undefined\n rootAriaLabel: string | undefined\n}\n\nexport type UseCarouselReturn = {\n state: CarouselState\n actions: CarouselActions\n}\n\n/* ─── Context ─── */\n//\n// Single root context. The previous design split state / actions / refs /\n// internal across four contexts; in practice every subcomponent reads from\n// most of them, render-perf isn't a concern at this scale, and the four-way\n// split was pure boilerplate. The per-item context (CarouselItemContext)\n// stays separate because its lifecycle is driven by Carousel.Content's\n// children loop, not the root.\n\ntype CarouselContextValue = CarouselState &\n CarouselActions & {\n api: EmblaCarouselType | undefined\n emblaRef: (node: HTMLElement | null) => void\n setSlideCount: (count: number) => void\n setLabelId: Dispatch<SetStateAction<string | undefined>>\n loop: boolean\n autoPlay: number | false\n /** Indices of slides currently intersecting the viewport. */\n slidesInView: number[]\n }\n\nconst CarouselContext = createContext<CarouselContextValue | null>(null)\n\ntype CarouselItemContextValue = {\n index: number\n total: number\n /** True when this slide is the carousel's selected snap point. */\n isActive: boolean\n /**\n * True when this slide currently intersects the viewport. Multi-visible\n * layouts (e.g. `basis-1/3`) have several in-view slides at once;\n * `inert` should follow visibility, not just selection, so every visible\n * slide remains interactive.\n */\n isInView: boolean\n}\n\nconst CarouselItemContext = createContext<CarouselItemContextValue | null>(null)\n\nfunction useCarouselContext(): CarouselContextValue {\n const ctx = use(CarouselContext)\n if (!ctx)\n throw new Error('Carousel subcomponent must be used inside <Carousel>')\n return ctx\n}\n\nfunction useCarouselItem(): CarouselItemContextValue {\n const ctx = use(CarouselItemContext)\n if (!ctx)\n throw new Error(\n '<Carousel.Item> must be a direct child of <Carousel.Content>'\n )\n return ctx\n}\n\n/**\n * Access the carousel's state and actions. Must be called inside a\n * `<Carousel>` tree.\n *\n * For escape-hatch access to the underlying Embla instance, use\n * `useCarouselUnsafeEmbla()` — it is intentionally separate so raw-Embla\n * coupling is greppable.\n */\nexport function useCarousel(): UseCarouselReturn {\n const ctx = useCarouselContext()\n const state = useMemo<CarouselState>(\n () => ({\n direction: ctx.direction,\n selectedIndex: ctx.selectedIndex,\n slideCount: ctx.slideCount,\n snapCount: ctx.snapCount,\n canGoToPrev: ctx.canGoToPrev,\n canGoToNext: ctx.canGoToNext,\n canScroll: ctx.canScroll,\n isPlaying: ctx.isPlaying,\n userPaused: ctx.userPaused,\n labelId: ctx.labelId,\n rootAriaLabel: ctx.rootAriaLabel\n }),\n [\n ctx.direction,\n ctx.selectedIndex,\n ctx.slideCount,\n ctx.snapCount,\n ctx.canGoToPrev,\n ctx.canGoToNext,\n ctx.canScroll,\n ctx.isPlaying,\n ctx.userPaused,\n ctx.labelId,\n ctx.rootAriaLabel\n ]\n )\n const actions = useMemo<CarouselActions>(\n () => ({\n goToPrev: ctx.goToPrev,\n goToNext: ctx.goToNext,\n goTo: ctx.goTo,\n play: ctx.play,\n pause: ctx.pause,\n toggle: ctx.toggle\n }),\n [ctx.goToPrev, ctx.goToNext, ctx.goTo, ctx.play, ctx.pause, ctx.toggle]\n )\n return { state, actions }\n}\n\n/**\n * Escape hatch: read the underlying Embla `api` instance directly.\n *\n * Returning Embla's API hard-couples your code to a specific major version\n * of `embla-carousel`. Prefer `useCarousel()` whenever the public state and\n * actions are sufficient. This hook exists so you can grep for raw-Embla\n * usage when planning an upgrade.\n */\nexport function useCarouselUnsafeEmbla(): EmblaCarouselType | undefined {\n return useCarouselContext().api\n}\n\n/* ─── Variants ─── */\n\n// The `overflow` variant controls how slides escape the viewport box:\n//\n// `hidden` — slides are clipped at the viewport edge. Classic behaviour.\n// `visible` — slides can extend indefinitely. Useful on wide screens\n// where you deliberately want peeking slides to remain fully\n// rendered in the margin area.\n// `subtle` — the default. Slides bleed past the viewport edges by the\n// same amount as the inner gutter, and fade to the page\n// background via `::before` / `::after` gradient overlays.\n// Gives the scroll hint of `visible` without the reading\n// noise of half-clipped cards at the edges.\n//\n// Horizontal subtle bleeds with `-mx-4 px-4` (sm+: `-mx-6 px-6`); the\n// gradients cover those padding strips. Vertical subtle is the same idea\n// rotated to the block axis.\n//\n// The `-my-4 py-4` on horizontal preserves the small vertical overflow\n// bleed needed to let `shadow-md` (~6–10px) escape the viewport box on\n// `Card` slides without the clip region eating the tint.\nexport const carouselContentVariants = cva(\n 'relative focus-visible:outline-none',\n {\n variants: {\n direction: {\n horizontal: '-my-4 py-4',\n vertical: ''\n },\n overflow: {\n hidden: 'overflow-clip',\n visible: 'overflow-visible',\n subtle: 'overflow-clip'\n }\n },\n compoundVariants: [\n {\n overflow: 'subtle',\n direction: 'horizontal',\n class: [\n '-mx-4 px-4 sm:-mx-6 sm:px-6',\n 'before:pointer-events-none before:absolute before:inset-y-0 before:left-0 before:z-10',\n 'before:w-4 sm:before:w-6',\n 'before:bg-linear-to-r before:from-[var(--intent-bg-normal)] before:to-transparent',\n 'after:pointer-events-none after:absolute after:inset-y-0 after:right-0 after:z-10',\n 'after:w-4 sm:after:w-6',\n 'after:bg-linear-to-l after:from-[var(--intent-bg-normal)] after:to-transparent'\n ].join(' ')\n },\n {\n // Vertical subtle intentionally omits the negative block-axis\n // margin — its axis collides with Carousel.Header sitting above\n // it, and pulling Content upward would overlap the header. The\n // py-4 padding creates the fade area inside Content's own box\n // and the Embla container's -mt-4 still lets items scroll\n // through that padding during transitions.\n overflow: 'subtle',\n direction: 'vertical',\n class: [\n 'py-4',\n 'before:pointer-events-none before:absolute before:inset-x-0 before:top-0 before:z-10',\n 'before:h-4',\n 'before:bg-linear-to-b before:from-[var(--intent-bg-normal)] before:to-transparent',\n 'after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:z-10',\n 'after:h-4',\n 'after:bg-linear-to-t after:from-[var(--intent-bg-normal)] after:to-transparent'\n ].join(' ')\n }\n ],\n defaultVariants: { direction: 'horizontal', overflow: 'subtle' }\n }\n)\n\nexport const carouselContainerVariants = cva('flex', {\n variants: {\n direction: {\n horizontal: '-ml-4',\n vertical: '-mt-4 h-full flex-col'\n }\n },\n defaultVariants: { direction: 'horizontal' }\n})\n\nexport const carouselItemVariants = cva(\n 'min-h-0 min-w-0 shrink-0 grow-0 basis-full',\n {\n variants: {\n direction: {\n horizontal: 'pl-4',\n vertical: 'pt-4'\n }\n },\n defaultVariants: { direction: 'horizontal' }\n }\n)\n\nexport const carouselDotsVariants = cva('flex items-center justify-center', {\n variants: {\n direction: {\n horizontal: 'flex-row gap-1.5',\n vertical: 'flex-col gap-1.5'\n }\n },\n defaultVariants: { direction: 'horizontal' }\n})\n\n/* ─── Root ─── */\n\nexport interface CarouselProps extends Omit<ComponentProps<'div'>, 'onBlur'> {\n /** Pass-through options for the Embla instance. */\n opts?: EmblaOptionsType\n /** Scroll direction. @default 'horizontal' */\n direction?: CarouselDirection\n /**\n * Autoplay delay in milliseconds, or `false` to disable. When set, an\n * autoplay plugin is wired internally and pauses on hover / focus / pointer\n * interaction. A persistent pause control via `<Carousel.PlayPause>` is\n * strongly recommended for WCAG 2.2.2 compliance.\n * @default false\n */\n autoPlay?: number | false\n /** Accessible name for the carousel region. */\n 'aria-label'?: string\n}\n\nexport function Carousel({\n opts,\n direction = 'horizontal',\n autoPlay = false,\n children,\n className,\n 'aria-label': ariaLabel,\n ...props\n}: CarouselProps) {\n const prefersReducedMotion = usePrefersReducedMotion()\n const axis: 'x' | 'y' = direction === 'vertical' ? 'y' : 'x'\n const hasAutoPlay = autoPlay !== false\n\n // Dev warnings — moved to effects so React 19 strict-mode double-invoke\n // doesn't fire them twice during render.\n useEffect(() => {\n if (!isDevEnvironment()) return\n if (autoPlay !== false && autoPlay < 2000) {\n console.warn(\n '[Carousel] autoPlay delay < 2000ms may fail WCAG 2.2.1 timing; prefer >= 4000ms.'\n )\n }\n }, [autoPlay])\n\n useEffect(() => {\n if (!isDevEnvironment()) return\n if (opts?.axis && opts.axis !== axis) {\n console.warn(\n `[Carousel] opts.axis=\"${opts.axis}\" conflicts with direction=\"${direction}\". direction wins.`\n )\n }\n }, [opts?.axis, axis, direction])\n\n const plugins = useMemo<EmblaPluginType[]>(() => {\n if (!hasAutoPlay || prefersReducedMotion) return []\n return [\n AutoplayPlugin({\n delay: autoPlay as number,\n stopOnLastSnap: false\n })\n ]\n }, [autoPlay, prefersReducedMotion, hasAutoPlay])\n\n const resolvedOpts = useMemo<EmblaOptionsType>(\n () => ({\n // Roadie defaults that a consumer can still override via `opts`.\n //\n // `align: 'start'` — Embla's own default is `center`, which reads\n // badly for a card list because partial slides peek in from both\n // edges simultaneously. `start` lines up with how Roadie carousels\n // are meant to be composed (content flows from the left).\n //\n // `slidesToScroll: 'auto'` — Embla's own default is `1`, which\n // forces Prev / Next to advance one slide at a time. For\n // multi-visible layouts (`basis-1/3`, `basis-1/4`, etc.) that\n // feels sluggish — users expect a full viewport to flip per\n // click. `'auto'` makes Embla derive the group size from whatever\n // currently fits, so responsive `basis-full md:basis-1/3\n // lg:basis-1/4` carousels automatically scroll 1 / 3 / 4 at a\n // time without any breakpoint-specific config. The dot count\n // collapses to match because `Carousel.Dots` renders one per snap.\n align: 'start',\n slidesToScroll: 'auto',\n ...opts,\n axis,\n duration: prefersReducedMotion ? 0 : (opts?.duration ?? 25)\n }),\n [opts, axis, prefersReducedMotion]\n )\n\n const [emblaRef, api] = useEmblaCarousel(resolvedOpts, plugins)\n\n // slideCount is the authoritative count of Carousel.Item children, used\n // for \"N of M\" labels on each slide. snapCount is the count of *Embla\n // snap positions*, which can be smaller — e.g. a basis-1/3 carousel\n // with 4 cards has 4 slides but 2 navigable snap positions. Nav buttons\n // and dots use snapCount; slide labels use slideCount.\n //\n // jsdom note: Embla's `scrollSnapList()` returns `[]` in jsdom because\n // measurements are zero, so snapCount stays 0 there. We treat 0 as\n // \"unknown\" and fall back to slideCount, which makes default basis-full\n // tests behave identically to a real browser.\n const [selectedIndex, setSelectedIndex] = useState(0)\n const [slideCount, setSlideCount] = useState(0)\n const [snapCount, setSnapCount] = useState(0)\n const [labelId, setLabelId] = useState<string | undefined>(undefined)\n // Indices of slides currently intersecting the viewport. Initialized to\n // [0] so the first paint marks slide 0 as in-view (jsdom never fires the\n // slidesinview event, so this also covers the default test fixture).\n // Real browsers update via the slidesinview event below.\n const [slidesInView, setSlidesInView] = useState<number[]>([0])\n\n // isPlaying / userPaused are React state. The actions and hover/focus\n // handlers update userPausedRef *synchronously* alongside setUserPaused,\n // so any read in the same tick sees the latest value (no one-frame stale\n // window from waiting on an effect commit).\n const [isPlaying, setIsPlaying] = useState(\n () => hasAutoPlay && !prefersReducedMotion\n )\n const [userPaused, setUserPaused] = useState(false)\n const userPausedRef = useRef(false)\n\n const loop = opts?.loop === true\n\n // ── Embla state sync ──\n // In real browsers, Embla's `select` event fires synchronously after a\n // navigation call and `onSelect` updates `selectedIndex` authoritatively.\n // In jsdom, snapList() is empty and `select` never fires, so the\n // action handlers below also poke state optimistically as a fallback\n // — but only when `onSelect` did NOT run during the call. We detect\n // that via `onSelectFiredRef`, which is reset to false before each\n // navigation call and flipped true inside `onSelect`. This is\n // deterministic regardless of what Embla's `selectedSnap()` returns\n // (which varies between bundlers / versions / environments).\n const onSelectFiredRef = useRef(false)\n const onSelect = useCallback((emblaApi: EmblaCarouselType) => {\n onSelectFiredRef.current = true\n setSelectedIndex(emblaApi.selectedSnap())\n }, [])\n\n useEffect(() => {\n if (!api) return\n onSelect(api)\n api.on('reinit', onSelect).on('select', onSelect)\n return () => {\n api.off('reinit', onSelect).off('select', onSelect)\n }\n }, [api, onSelect])\n\n // ── Embla in-view + snap-count sync ──\n // For multi-visible layouts (basis-1/3 etc.) every slide that intersects\n // the viewport must stay interactive — gating `inert` on the selected\n // snap alone leaves the other visible slides un-clickable. Embla emits\n // `slidesinview` whenever the set changes.\n //\n // We also track the snap-count here so navigation logic uses Embla's\n // actual snap positions instead of the React children count. A\n // basis-1/3 carousel with 4 cards has 4 slides but 2 snap positions;\n // dots, prev/next, and the can-scroll check should all reflect the 2.\n const onSlidesInView = useCallback((emblaApi: EmblaCarouselType) => {\n const next = emblaApi.slidesInView()\n setSlidesInView(next.length > 0 ? next : [emblaApi.selectedSnap()])\n setSnapCount(emblaApi.snapList().length)\n }, [])\n\n useEffect(() => {\n if (!api) return\n onSlidesInView(api)\n api\n .on('reinit', onSlidesInView)\n .on('slidesinview', onSlidesInView)\n .on('resize', onSlidesInView)\n .on('slideschanged', onSlidesInView)\n return () => {\n api\n .off('reinit', onSlidesInView)\n .off('slidesinview', onSlidesInView)\n .off('resize', onSlidesInView)\n .off('slideschanged', onSlidesInView)\n }\n }, [api, onSlidesInView])\n\n // ── Focus drop guard ──\n // When a select event fires, if focus was inside the previous (about-to-\n // become-inert) slide, move focus to the new slide's wrapper so it\n // doesn't drop to <body>. The focus call is deferred via\n // requestAnimationFrame so React can commit the inert flip first —\n // otherwise we'd .focus() a still-inert element and browsers would\n // silently drop the call.\n useEffect(() => {\n if (!api) return\n const handleSelect = (emblaApi: EmblaCarouselType) => {\n if (typeof document === 'undefined') return\n const activeEl = document.activeElement as HTMLElement | null\n if (!activeEl || !activeEl.isConnected) return\n const prevSlide = activeEl.closest('[aria-roledescription=\"slide\"]')\n if (!prevSlide || activeEl === prevSlide) return\n const newSlideIndex = emblaApi.selectedSnap()\n requestAnimationFrame(() => {\n const newSlide = emblaApi.slideNodes()[newSlideIndex]\n newSlide?.focus({ preventScroll: true })\n })\n }\n api.on('select', handleSelect)\n return () => {\n api.off('select', handleSelect)\n }\n }, [api])\n\n // ── Autoplay startup ──\n // Roadie owns isPlaying entirely in React state. We don't subscribe to\n // Embla's autoplay:play/autoplay:stop events because (a) v9's autoplay\n // plugin doesn't auto-start, and (b) if our effect runs twice (React 19\n // strict-mode double-invoke), the cleanup's stop() call would emit\n // autoplay:stop and clobber our state. Instead we call plugin.play()\n // imperatively when api becomes available, defensively wrapped because\n // v9's plugin can throw if its own init bailed out (e.g. snapList empty\n // in jsdom).\n useEffect(() => {\n if (!api) return\n const plugin = api.plugins().autoplay\n if (!plugin) return\n if (userPausedRef.current) return\n safePluginCall(plugin.play)\n }, [api, plugins])\n\n // Reset isPlaying when autoplay configuration changes.\n useEffect(() => {\n setIsPlaying(hasAutoPlay && !prefersReducedMotion)\n if (!hasAutoPlay || prefersReducedMotion) {\n setUserPaused(false)\n userPausedRef.current = false\n }\n }, [hasAutoPlay, prefersReducedMotion])\n\n // ── Re-init on slide count change ──\n useEffect(() => {\n api?.reInit()\n }, [api, slideCount])\n\n // Effective snap count = Embla's snap positions when known, falling\n // back to slideCount when Embla hasn't measured yet (jsdom or pre-init).\n // All navigation derivations work in *snap space*, not slide space.\n const effectiveSnapCount = snapCount > 0 ? snapCount : slideCount\n const clampedIndex =\n effectiveSnapCount > 0\n ? Math.min(Math.max(0, selectedIndex), effectiveSnapCount - 1)\n : 0\n const canGoToPrev = effectiveSnapCount > 1 && (loop || clampedIndex > 0)\n const canGoToNext =\n effectiveSnapCount > 1 && (loop || clampedIndex < effectiveSnapCount - 1)\n // True only when there is somewhere to scroll to. When every slide\n // already fits in the viewport, snapCount collapses to 1 and the whole\n // nav UI hides itself.\n const canScroll = effectiveSnapCount > 1\n\n // ── Actions ──\n // Navigation actions delegate to Embla AND update selectedIndex\n // optimistically. In real browsers Embla's select event fires\n // synchronously and re-asserts the same value via onSelect; in jsdom\n // (where select doesn't fire) the optimistic update is the only path\n // that keeps state in sync. play/pause/toggle drive React state directly\n // and call the plugin defensively. userPausedRef is updated synchronously\n // inside each action so any read in the same tick sees the latest value.\n const actions = useMemo<CarouselActions>(\n () => ({\n // Navigation actions delegate to Embla and fall back to a manual\n // optimistic update only when `onSelect` didn't run during the\n // call. Reset the ref right before `api.goTo*()` and check it\n // immediately after: in real browsers Embla emits `select`\n // synchronously inside `goToNext()` so the ref is already true\n // and we short-circuit before the updater can double-increment;\n // in jsdom Embla never emits select, so the ref stays false and\n // the fallback advances state.\n goToPrev: () => {\n onSelectFiredRef.current = false\n api?.goToPrev()\n if (onSelectFiredRef.current) return\n setSelectedIndex((current) => {\n if (current > 0) return current - 1\n return loop ? Math.max(0, effectiveSnapCount - 1) : current\n })\n },\n goToNext: () => {\n onSelectFiredRef.current = false\n api?.goToNext()\n if (onSelectFiredRef.current) return\n setSelectedIndex((current) => {\n if (current < effectiveSnapCount - 1) return current + 1\n return loop ? 0 : current\n })\n },\n goTo: (index: number) => {\n onSelectFiredRef.current = false\n api?.goTo(index)\n if (onSelectFiredRef.current) return\n setSelectedIndex(Math.max(0, Math.min(index, effectiveSnapCount - 1)))\n },\n play: () => {\n if (!hasAutoPlay) return\n userPausedRef.current = false\n setUserPaused(false)\n setIsPlaying(true)\n const plugin = api?.plugins().autoplay\n if (plugin) safePluginCall(plugin.play)\n },\n pause: () => {\n if (!hasAutoPlay) return\n userPausedRef.current = true\n setUserPaused(true)\n setIsPlaying(false)\n const plugin = api?.plugins().autoplay\n if (plugin) safePluginCall(plugin.stop)\n },\n toggle: () => {\n if (!hasAutoPlay) return\n const next = !isPlaying\n userPausedRef.current = !next\n setUserPaused(!next)\n setIsPlaying(next)\n const plugin = api?.plugins().autoplay\n if (plugin) safePluginCall(next ? plugin.play : plugin.stop)\n }\n }),\n [api, hasAutoPlay, isPlaying, loop, effectiveSnapCount]\n )\n\n // ── Hover / focus pause handlers (on the root wrapper) ──\n // These pause the *plugin* (transient — `pause()` not `stop()`), but\n // do not touch React state. The aria-live mode only flips on explicit\n // user pause via PlayPause — transient pauses don't retrigger\n // announcements. All plugin calls are defensive.\n const handleMouseEnter = useCallback(() => {\n if (userPausedRef.current) return\n const plugin = api?.plugins().autoplay\n if (plugin) safePluginCall(plugin.pause)\n }, [api])\n\n const handleMouseLeave = useCallback(() => {\n if (userPausedRef.current) return\n const plugin = api?.plugins().autoplay\n if (plugin) safePluginCall(plugin.play)\n }, [api])\n\n const handleFocusIn = useCallback(() => {\n if (userPausedRef.current) return\n const plugin = api?.plugins().autoplay\n if (plugin) safePluginCall(plugin.pause)\n }, [api])\n\n const handleFocusOut = useCallback(\n (e: ReactFocusEvent<HTMLDivElement>) => {\n if (userPausedRef.current) return\n const related = e.relatedTarget as Node | null\n const currentTarget = e.currentTarget\n const resume = () => {\n const plugin = api?.plugins().autoplay\n if (plugin) safePluginCall(plugin.play)\n }\n // Safari quirk: relatedTarget can be null for some blur events.\n // Defer one RAF and re-read document.activeElement instead of\n // trusting the synthetic event payload.\n if (!related) {\n requestAnimationFrame(() => {\n if (\n currentTarget.isConnected &&\n !currentTarget.contains(document.activeElement)\n ) {\n resume()\n }\n })\n return\n }\n if (!currentTarget.contains(related)) {\n resume()\n }\n },\n [api]\n )\n\n const contextValue = useMemo<CarouselContextValue>(\n () => ({\n // State\n direction,\n selectedIndex: clampedIndex,\n slideCount,\n snapCount: effectiveSnapCount,\n canGoToPrev,\n canGoToNext,\n canScroll,\n isPlaying,\n userPaused,\n labelId,\n rootAriaLabel: ariaLabel,\n // Actions\n goToPrev: actions.goToPrev,\n goToNext: actions.goToNext,\n goTo: actions.goTo,\n play: actions.play,\n pause: actions.pause,\n toggle: actions.toggle,\n // Refs / internal\n api,\n emblaRef,\n setSlideCount,\n setLabelId,\n loop,\n autoPlay,\n slidesInView\n }),\n [\n direction,\n clampedIndex,\n slideCount,\n canGoToPrev,\n canGoToNext,\n canScroll,\n isPlaying,\n userPaused,\n labelId,\n ariaLabel,\n actions,\n api,\n emblaRef,\n loop,\n autoPlay,\n slidesInView\n ]\n )\n\n return (\n <CarouselContext.Provider value={contextValue}>\n <div\n role='region'\n aria-roledescription='carousel'\n aria-label={labelId ? undefined : ariaLabel}\n aria-labelledby={labelId}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n onFocus={handleFocusIn}\n onBlur={handleFocusOut}\n className={cn('relative', className)}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nCarousel.displayName = 'Carousel'\n\n/* ─── Header ─── */\n//\n// Mobile (default): a flex `justify-between` row. With the recommended\n// `<Title /><Dots /><Controls hidden on mobile />` arrangement that puts\n// the Title on the left and the Dots on the right — Controls vanish via\n// their own responsive `hidden md:flex`.\n//\n// Desktop (md+): a three-column grid (`1fr auto 1fr`). Children are placed\n// by position in source order:\n//\n// 1 child → left only (e.g. just a Title)\n// 2 children → left + right (Title + Controls)\n// 3 children → left + centre + right (Title + Dots + Controls)\n//\n// Selectors target position rather than component type so consumers can\n// drop in custom nodes (a search box in the middle, an extra link on the\n// right) without losing the layout.\n\nexport type CarouselHeaderProps = ComponentProps<'div'>\n\nexport function CarouselHeader({ className, ...props }: CarouselHeaderProps) {\n return (\n <div\n className={cn(\n 'mb-4 flex items-center justify-between gap-4',\n 'md:grid md:grid-cols-[1fr_auto_1fr]',\n 'md:[&>*:first-child]:justify-self-start',\n 'md:[&>*:last-child:not(:first-child)]:col-start-3',\n 'md:[&>*:last-child:not(:first-child)]:justify-self-end',\n 'md:[&>*:nth-child(2):not(:last-child)]:col-start-2',\n 'md:[&>*:nth-child(2):not(:last-child)]:justify-self-center',\n className\n )}\n {...props}\n />\n )\n}\n\nCarouselHeader.displayName = 'Carousel.Header'\n\n/* ─── Controls ─── */\n//\n// Layout shell that groups Carousel.PlayPause / Previous / Next (or any\n// other inline controls) into a consistently spaced flex row.\n//\n// Hidden on mobile by default (`hidden md:flex`) — touch users navigate by\n// swipe + dots, so Previous/Next/PlayPause buttons are redundant noise on\n// small screens. Override with `className='flex'` if a particular carousel\n// needs them visible on mobile.\n//\n// Hidden entirely when there's nothing to scroll to — every slide already\n// fits in the viewport, so the buttons would be no-ops. Use the explicit\n// `forceVisible` prop if a consumer wants to keep custom children rendered\n// even when nav is unavailable.\n\nexport type CarouselControlsProps = ComponentProps<'div'> & {\n /**\n * Render the controls even when there's nothing to scroll to. Useful\n * when the slot contains custom buttons (filters, share) that aren't\n * gated on slide count.\n */\n forceVisible?: boolean\n}\n\nexport function CarouselControls({\n className,\n forceVisible = false,\n ...props\n}: CarouselControlsProps) {\n const { canScroll } = useCarouselContext()\n if (!forceVisible && !canScroll) return null\n return (\n <div\n className={cn('hidden items-center gap-2 md:flex', className)}\n {...props}\n />\n )\n}\n\nCarouselControls.displayName = 'Carousel.Controls'\n\n/* ─── Title ─── */\n//\n// Two sibling components instead of one polymorphic generic:\n//\n// <Carousel.Title>Featured</Carousel.Title>\n// → renders an <h2> (or another heading via `as`).\n//\n// <Carousel.TitleLink href='/events'>Featured</Carousel.TitleLink>\n// → renders an <a> (or framework Link via `as`) with a trailing arrow\n// icon and link styling.\n//\n// The previous polymorphic <Carousel.Title as={…} href={…}> shape allowed\n// `<Title as='h2' href='/x'>` which produced invalid HTML at runtime.\n// Splitting kills the type unsoundness and the runtime branch.\n\ntype HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\nexport type CarouselTitleProps = ComponentProps<'h2'> & {\n /** Heading level. Defaults to `<h2>`. */\n as?: HeadingLevel\n}\n\nfunction useRegisterTitleLabel(titleId: string) {\n const { setLabelId } = useCarouselContext()\n // Register this title as the carousel's accessible name. The cleanup\n // only clears labelId if it still points at *this* title — guards\n // against responsive remounts where two titles fight over labelId.\n useEffect(() => {\n setLabelId(titleId)\n return () => {\n setLabelId((current) => (current === titleId ? undefined : current))\n }\n }, [titleId, setLabelId])\n}\n\nexport function CarouselTitle({\n as: Component = 'h2',\n className,\n children,\n id,\n ...props\n}: CarouselTitleProps) {\n const generatedId = useId()\n const titleId = id ?? generatedId\n useRegisterTitleLabel(titleId)\n\n return (\n <Component\n id={titleId}\n className={cn('text-display-ui-5 text-strong', className)}\n {...props}\n >\n {children}\n </Component>\n )\n}\n\nCarouselTitle.displayName = 'Carousel.Title'\n\ntype CarouselTitleLinkOwnProps<T extends ElementType> = {\n /**\n * Render the link as a custom element/component (e.g. Next.js `Link`).\n * Defaults to `<a>`.\n */\n as?: T\n /** DOM id for `aria-labelledby`. Defaults to a generated id. */\n id?: string\n}\n\nexport type CarouselTitleLinkProps<T extends ElementType = 'a'> =\n CarouselTitleLinkOwnProps<T> &\n Omit<ComponentProps<T>, keyof CarouselTitleLinkOwnProps<T>>\n\nexport function CarouselTitleLink<T extends ElementType = 'a'>({\n as,\n className,\n children,\n id,\n ...props\n}: CarouselTitleLinkProps<T>) {\n const generatedId = useId()\n const titleId = id ?? generatedId\n useRegisterTitleLabel(titleId)\n\n const Component = (as ?? 'a') as ElementType\n\n return (\n <Component\n id={titleId}\n className={cn(\n 'group/title is-interactive flex items-center gap-1 text-display-ui-5 text-strong',\n className\n )}\n {...props}\n >\n {children}\n <ArrowRightIcon\n weight='bold'\n className='size-5 text-subtle transition-transform group-hover/title:translate-x-1 group-hover/title:intent-accent'\n />\n </Component>\n )\n}\n\nCarouselTitleLink.displayName = 'Carousel.TitleLink'\n\n/* ─── Content ─── */\n\n// Literal union (rather than `VariantProps<typeof carouselContentVariants>`)\n// so that `react-docgen-typescript` — which can't drill into CVA's\n// conditional types — can extract the three values and surface them in\n// the docs site's <PropsDefinitions> table.\nexport type CarouselContentOverflow = 'hidden' | 'visible' | 'subtle'\n\nexport type CarouselContentProps = ComponentProps<'div'> & {\n /** Props to forward to the inner Embla container (flex row/col). */\n containerProps?: ComponentProps<'div'>\n /**\n * How slides escape the viewport box.\n *\n * - `subtle` (default): slides bleed past the edges by the gutter width\n * and fade to the page background via `::before` / `::after`\n * gradients. Good for most carousels — gives a clear scroll hint\n * without half-clipped cards.\n * - `hidden`: slides are hard-clipped at the viewport edge.\n * - `visible`: slides can extend indefinitely. Useful on wide screens\n * where you deliberately want peeking slides to remain fully\n * rendered in the surrounding margin area.\n *\n * @default 'subtle'\n */\n overflow?: 'hidden' | 'visible' | 'subtle'\n}\n\nexport function CarouselContent({\n className,\n children,\n containerProps,\n onKeyDown,\n overflow = 'subtle',\n ...props\n}: CarouselContentProps) {\n const {\n direction,\n selectedIndex,\n snapCount,\n slidesInView,\n isPlaying,\n labelId,\n rootAriaLabel,\n goToPrev,\n goToNext,\n goTo,\n emblaRef,\n setSlideCount\n } = useCarouselContext()\n\n // aria-live is `off` while autoplay is actively running, `polite`\n // otherwise. Transient hover/focus pauses don't change isPlaying, so\n // they don't retrigger announcements either.\n const ariaLive: 'off' | 'polite' = isPlaying ? 'off' : 'polite'\n\n // Authoritative slide count comes from Carousel.Content's own children.\n // useLayoutEffect ensures the count is set before paint so the first\n // render of Dots / Previous / Next sees the correct value.\n const childCount = Children.count(children)\n useLayoutEffect(() => {\n setSlideCount(childCount)\n }, [childCount, setSlideCount])\n\n // Intentionally no dev-mode child-shape warning here. A `displayName`\n // string compare was tried earlier and produced false positives for\n // legitimate wrappers (`memo(Carousel.Item)`, `forwardRef`, and user\n // wrapper components that render an Item internally), with no clean\n // way to walk through them. The runtime `useCarouselItem()` throw is\n // the real guardrail — any wrapper that doesn't render an Item as its\n // output hits that error with a clear message on the first render.\n\n // Inject per-item context so each <Carousel.Item> can read its index /\n // total without lifting state. `isInView` drives the inert attribute so\n // every visible slide stays interactive in multi-visible layouts; the\n // selectedSnap is exposed separately as `isActive`.\n //\n // The wrapping provider uses `child.key ?? index` so consumers who pass\n // stable keys on their slides (e.g. mapping from an array of events)\n // keep React's reconciler identity on reorder / insert / delete, which\n // means any stateful slide content (forms, videos, uncontrolled inputs)\n // survives instead of remounting on every change.\n const inViewSet = useMemo(() => new Set(slidesInView), [slidesInView])\n const wrappedChildren = Children.map(children, (child, index) => {\n if (!isValidElement(child)) return child\n const itemContext: CarouselItemContextValue = {\n index,\n total: childCount,\n isActive: index === selectedIndex,\n isInView: inViewSet.has(index)\n }\n return (\n <CarouselItemContext.Provider\n key={child.key ?? index}\n value={itemContext}\n >\n {child}\n </CarouselItemContext.Provider>\n )\n })\n\n const handleKeyDown = useCallback(\n (e: ReactKeyboardEvent<HTMLDivElement>) => {\n onKeyDown?.(e)\n if (e.defaultPrevented) return\n\n // Ignore arrow keys when focus is on an interactive element inside a\n // slide — the user is likely navigating within slide content.\n const target = e.target as HTMLElement\n if (target !== e.currentTarget) {\n const isInSlide = target.closest(\n '[role=\"group\"][aria-roledescription=\"slide\"]'\n )\n const isInteractive = target.matches(\n 'button, a, input, textarea, select, [tabindex]:not([tabindex=\"-1\"])'\n )\n if (isInSlide && isInteractive) return\n }\n\n const isHorizontal = direction === 'horizontal'\n const prevKey = isHorizontal ? 'ArrowLeft' : 'ArrowUp'\n const nextKey = isHorizontal ? 'ArrowRight' : 'ArrowDown'\n\n if (e.key === prevKey) {\n e.preventDefault()\n goToPrev()\n } else if (e.key === nextKey) {\n e.preventDefault()\n goToNext()\n } else if (e.key === 'Home') {\n e.preventDefault()\n goTo(0)\n } else if (e.key === 'End') {\n e.preventDefault()\n goTo(Math.max(0, snapCount - 1))\n }\n },\n [direction, goToPrev, goToNext, goTo, snapCount, onKeyDown]\n )\n\n return (\n <div\n ref={emblaRef as Ref<HTMLDivElement>}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n aria-live={ariaLive}\n aria-label={labelId ? undefined : rootAriaLabel}\n aria-labelledby={labelId}\n className={cn(\n carouselContentVariants({ direction, overflow }),\n className\n )}\n {...props}\n >\n <div\n {...containerProps}\n className={cn(\n carouselContainerVariants({ direction }),\n containerProps?.className\n )}\n >\n {wrappedChildren}\n </div>\n </div>\n )\n}\n\nCarouselContent.displayName = 'Carousel.Content'\n\n/* ─── Item ─── */\n\nexport type CarouselItemProps = ComponentProps<'div'>\n\nexport function CarouselItem({\n className,\n children,\n ...props\n}: CarouselItemProps) {\n const { direction } = useCarouselContext()\n const { index, total, isInView } = useCarouselItem()\n return (\n <div\n role='group'\n aria-roledescription='slide'\n aria-label={`${index + 1} of ${total}`}\n tabIndex={-1}\n inert={!isInView}\n className={cn(carouselItemVariants({ direction }), className)}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselItem.displayName = 'Carousel.Item'\n\n/* ─── Previous / Next ─── */\n\nexport type CarouselNavButtonProps = Omit<\n IconButtonProps,\n 'aria-label' | 'children'\n> & {\n /**\n * Override the default accessible label.\n * Defaults to \"Previous slide\" / \"Next slide\" / \"Pause carousel\" / \"Play carousel\".\n */\n 'aria-label'?: string\n /** Override the default caret/play/pause icon. */\n children?: ReactNode\n}\n\n// Use `data-disabled` (which `is-interactive` already styles identically\n// to native `:disabled`) rather than the native `disabled` attribute.\n// Native `disabled` removes the button from the tab order entirely, which\n// means screen-reader users at a scroll boundary lose their place in the\n// carousel region. `data-disabled` keeps the button focusable + dims it +\n// disables pointer events via the Roadie styling, and the conditional\n// `onClick` guards against keyboard (Space/Enter) activation when the\n// nav direction is unavailable.\n\nexport function CarouselPrevious({\n className,\n 'aria-label': ariaLabel = 'Previous slide',\n children,\n ...props\n}: CarouselNavButtonProps) {\n const { direction, canScroll, canGoToPrev, goToPrev } = useCarouselContext()\n if (!canScroll) return null\n const Icon = direction === 'vertical' ? CaretUpIcon : CaretLeftIcon\n return (\n <IconButton\n size='icon-sm'\n className={className}\n aria-label={ariaLabel}\n aria-disabled={!canGoToPrev || undefined}\n data-disabled={!canGoToPrev || undefined}\n onClick={canGoToPrev ? goToPrev : undefined}\n {...props}\n >\n {children ?? <Icon weight='bold' className='size-4' />}\n </IconButton>\n )\n}\n\nCarouselPrevious.displayName = 'Carousel.Previous'\n\nexport function CarouselNext({\n className,\n 'aria-label': ariaLabel = 'Next slide',\n children,\n ...props\n}: CarouselNavButtonProps) {\n const { direction, canScroll, canGoToNext, goToNext } = useCarouselContext()\n if (!canScroll) return null\n const Icon = direction === 'vertical' ? CaretDownIcon : CaretRightIcon\n return (\n <IconButton\n size='icon-sm'\n className={className}\n aria-label={ariaLabel}\n aria-disabled={!canGoToNext || undefined}\n data-disabled={!canGoToNext || undefined}\n onClick={canGoToNext ? goToNext : undefined}\n {...props}\n >\n {children ?? <Icon weight='bold' className='size-4' />}\n </IconButton>\n )\n}\n\nCarouselNext.displayName = 'Carousel.Next'\n\n/* ─── PlayPause ─── */\n\nexport function CarouselPlayPause({\n className,\n 'aria-label': ariaLabel,\n children,\n ...props\n}: CarouselNavButtonProps) {\n const { autoPlay, isPlaying, toggle } = useCarouselContext()\n if (autoPlay === false) return null\n const label = ariaLabel ?? (isPlaying ? 'Pause carousel' : 'Play carousel')\n return (\n <IconButton\n size='icon-sm'\n className={className}\n aria-label={label}\n aria-pressed={!isPlaying}\n onClick={toggle}\n {...props}\n >\n {children ??\n (isPlaying ? (\n <PauseIcon weight='bold' className='size-4 text-subtle' />\n ) : (\n <PlayIcon weight='bold' className='size-4 text-subtle' />\n ))}\n </IconButton>\n )\n}\n\nCarouselPlayPause.displayName = 'Carousel.PlayPause'\n\n/* ─── Dots ─── */\n\nexport type CarouselDotsProps = ComponentProps<'div'>\n\nexport function CarouselDots({ className, ...props }: CarouselDotsProps) {\n const { direction, snapCount, selectedIndex, canScroll, goTo } =\n useCarouselContext()\n if (!canScroll) return null\n return (\n <div\n role='group'\n aria-label='Choose slide to display'\n className={cn(carouselDotsVariants({ direction }), className)}\n {...props}\n >\n {Array.from({ length: snapCount }, (_, index) => {\n const isActive = index === selectedIndex\n return (\n <button\n key={index}\n type='button'\n aria-label={`Go to slide ${index + 1}`}\n aria-current={isActive ? 'true' : undefined}\n aria-disabled={isActive || undefined}\n onClick={() => goTo(index)}\n className={cn(\n 'is-interactive h-2 rounded-full transition-all',\n isActive\n ? 'w-5 emphasis-strong intent-accent'\n : 'w-2 emphasis-normal'\n )}\n />\n )\n })}\n </div>\n )\n}\n\nCarouselDots.displayName = 'Carousel.Dots'\n\n/* ─── Compound attachment ─── */\n//\n// Direct property assignment (instead of Object.assign + cast) keeps the\n// `Carousel` symbol a plain function declaration, which means\n// `react-docgen-typescript` can extract the full CarouselProps interface\n// for the docs site. TypeScript widens `typeof Carousel` automatically to\n// include each attached subcomponent.\n\nCarousel.Header = CarouselHeader\nCarousel.Title = CarouselTitle\nCarousel.TitleLink = CarouselTitleLink\nCarousel.Controls = CarouselControls\nCarousel.Content = CarouselContent\nCarousel.Item = CarouselItem\nCarousel.Previous = CarouselPrevious\nCarousel.Next = CarouselNext\nCarousel.PlayPause = CarouselPlayPause\nCarousel.Dots = CarouselDots\n\nexport type CarouselVariantProps = VariantProps<typeof carouselContentVariants>\n"],"mappings":"+mBA8DA,SAAS,GAA4B,CACnC,OACE,OAAO,QAAY,KAAe,SAAS,KAAK,WAAa,aAajE,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AY,EACrB,EAAS,SAAW,EACpB,EAAS,QAAU,EACnB,EAAS,KAAO,EAChB,EAAS,SAAW,EACpB,EAAS,KAAO,EAChB,EAAS,UAAY,EACrB,EAAS,KAAO"}
package/dist/Code.d.ts CHANGED
@@ -6,7 +6,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
6
6
  //#region src/components/Code/index.d.ts
7
7
  declare const codeVariants: (props?: ({
8
8
  intent?: "neutral" | "brand" | "brand-secondary" | "accent" | "danger" | "success" | "warning" | "info" | null | undefined;
9
- emphasis?: "normal" | "strong" | "subtle" | "subtler" | null | undefined;
9
+ emphasis?: "normal" | "subtle" | "subtler" | "strong" | null | undefined;
10
10
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
11
11
  interface CodeProps extends ComponentProps<'code'>, VariantProps<typeof codeVariants> {}
12
12
  declare function Code({
@@ -11,10 +11,30 @@ declare const comboboxInputGroupVariants: (props?: ({
11
11
  emphasis?: "normal" | "subtle" | null | undefined;
12
12
  size?: "sm" | "md" | "lg" | null | undefined;
13
13
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
14
- type ComboboxRootProps = Combobox$1.Root.Props<unknown>;
15
- declare function ComboboxRoot(props: ComboboxRootProps): _$react_jsx_runtime0.JSX.Element;
16
- declare namespace ComboboxRoot {
17
- var displayName: string;
14
+ type ComboboxProps = Combobox$1.Root.Props<unknown>;
15
+ /**
16
+ * @deprecated Use `ComboboxProps` instead.
17
+ */
18
+ type ComboboxRootProps = ComboboxProps;
19
+ declare function Combobox(props: ComboboxProps): _$react_jsx_runtime0.JSX.Element;
20
+ declare namespace Combobox {
21
+ var displayName: string;
22
+ var Label: typeof ComboboxLabel;
23
+ var InputGroup: typeof ComboboxInputGroup;
24
+ var Input: typeof ComboboxInput;
25
+ var Trigger: typeof ComboboxTrigger;
26
+ var Clear: typeof ComboboxClear;
27
+ var Portal: typeof ComboboxPortal;
28
+ var Positioner: typeof ComboboxPositioner;
29
+ var Popup: typeof ComboboxPopup;
30
+ var List: typeof ComboboxList;
31
+ var Item: typeof ComboboxItem;
32
+ var Collection: typeof ComboboxCollection;
33
+ var ItemIndicator: typeof ComboboxItemIndicator;
34
+ var Group: typeof ComboboxGroup;
35
+ var GroupLabel: typeof ComboboxGroupLabel;
36
+ var Empty: typeof ComboboxEmpty;
37
+ var Status: typeof ComboboxStatus;
18
38
  }
19
39
  type ComboboxLabelProps = Combobox$1.Label.Props & RefAttributes<HTMLDivElement>;
20
40
  declare function ComboboxLabel({
@@ -144,25 +164,6 @@ declare function ComboboxStatus({
144
164
  declare namespace ComboboxStatus {
145
165
  var displayName: string;
146
166
  }
147
- declare const Combobox: typeof ComboboxRoot & {
148
- Label: typeof ComboboxLabel;
149
- InputGroup: typeof ComboboxInputGroup;
150
- Input: typeof ComboboxInput;
151
- Trigger: typeof ComboboxTrigger;
152
- Clear: typeof ComboboxClear;
153
- Portal: typeof ComboboxPortal;
154
- Positioner: typeof ComboboxPositioner;
155
- Popup: typeof ComboboxPopup;
156
- List: typeof ComboboxList;
157
- Item: typeof ComboboxItem;
158
- Collection: typeof ComboboxCollection;
159
- ItemIndicator: typeof ComboboxItemIndicator;
160
- Group: typeof ComboboxGroup;
161
- GroupLabel: typeof ComboboxGroupLabel;
162
- Empty: typeof ComboboxEmpty;
163
- Status: typeof ComboboxStatus;
164
- };
165
- type ComboboxProps = ComboboxRootProps;
166
167
  //#endregion
167
- export { Combobox, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPortalProps, ComboboxPositioner, ComboboxPositionerProps, ComboboxProps, ComboboxRoot, ComboboxRootProps, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, type ComboboxFilter as Filter, type ComboboxFilterOptions as FilterOptions, comboboxInputGroupVariants, useFilter };
168
+ export { Combobox, ComboboxClear, ComboboxClearProps, ComboboxCollection, ComboboxCollectionProps, ComboboxEmpty, ComboboxEmptyProps, ComboboxGroup, ComboboxGroupLabel, ComboboxGroupLabelProps, ComboboxGroupProps, ComboboxInput, ComboboxInputGroup, ComboboxInputGroupProps, ComboboxInputProps, ComboboxItem, ComboboxItemIndicator, ComboboxItemIndicatorProps, ComboboxItemProps, ComboboxLabel, ComboboxLabelProps, ComboboxList, ComboboxListProps, ComboboxPopup, ComboboxPopupProps, ComboboxPortal, ComboboxPortalProps, ComboboxPositioner, ComboboxPositionerProps, ComboboxProps, ComboboxRootProps, ComboboxStatus, ComboboxStatusProps, ComboboxTrigger, ComboboxTriggerProps, type ComboboxFilter as Filter, type ComboboxFilterOptions as FilterOptions, comboboxInputGroupVariants, useFilter };
168
169
  //# sourceMappingURL=Combobox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.d.ts","names":[],"sources":["../src/components/Combobox/index.tsx"],"mappings":";;;;;;;cAiBa,SAAA,SAAS,UAAA,CAAA,SAAA;AAAA,cAKT,0BAAA,GAA0B,KAAA;;;;IAsBtC,iCAAA,CAAA,SAAA;AAAA,KAIW,iBAAA,GAAoB,UAAA,CAAkB,IAAA,CAAK,KAAA;AAAA,iBAEvC,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAArC,YAAA;EAAA,IAAY,WAAA;AAAA;AAAA,KAQhB,kBAAA,GAAqB,UAAA,CAAkB,KAAA,CAAM,KAAA,GACvD,aAAA,CAAc,cAAA;AAAA,iBAEA,aAAA,CAAA;EAAgB,SAAA;EAAA,GAAc;AAAA,GAAS,kBAAA,GAAkB,oBAAA,CAAA,GA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AAA;AAAA,KAmBtB,kBAAA,GAAqB,UAAA,CAAkB,KAAA,CAAM,KAAA,GACvD,aAAA,CAAc,cAAA;AAAA,iBAEA,aAAA,CAAA;EAAgB,SAAA;EAAA,GAAc;AAAA,GAAS,kBAAA,GAAkB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAzD,aAAA;EAAA,IAAa,WAAA;AAAA;AAAA,KAgBjB,mBAAA,GAAsB,UAAA,CAAkB,MAAA,CAAO,KAAA,GACzD,aAAA,CAAc,cAAA;AAAA,iBAEA,cAAA,CAAA;EAAiB,SAAA;EAAA,GAAc;AAAA,GAAS,mBAAA,GAAmB,oBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAA3D,cAAA;EAAA,IAAc,WAAA;AAAA"}
package/dist/Combobox.js CHANGED
@@ -1,2 +1,2 @@
1
- "use client";import{t as e}from"./variants-DTAwzBl3.js";import{useFieldContext as t}from"./Field.js";import{cva as n}from"class-variance-authority";import{cn as r}from"@oztix/roadie-core/utils";import{jsx as i}from"react/jsx-runtime";import{CaretDownIcon as a,CheckIcon as o,XIcon as s}from"@phosphor-icons/react";import{Combobox as c}from"@base-ui/react/combobox";const l=c.useFilter,u=n(`inline-flex w-full items-center rounded-lg font-sans`,{variants:{intent:e,emphasis:{normal:`emphasis-sunken border border-subtle is-interactive-field-group`,subtle:`bg-subtle text-normal border border-transparent is-interactive-field-group`},size:{sm:`h-8 px-1.5 text-base`,md:`h-10 px-2 text-base`,lg:`h-12 px-2 text-base`}},defaultVariants:{emphasis:`normal`,size:`md`}});function d(e){return i(c.Root,{...e})}d.displayName=`Combobox`;function f({className:e,...t}){return i(c.Label,{className:r(`text-sm font-medium text-normal`,e),...t})}f.displayName=`Combobox.Label`;function p({className:e,intent:n,emphasis:a,size:o,...s}){let l=t(),d=!!l.fieldId;return i(c.InputGroup,{className:r(u({intent:n,emphasis:a,size:o,className:e})),"aria-invalid":d&&l.invalid||void 0,...s})}p.displayName=`Combobox.InputGroup`;function m({className:e,...n}){let a=t(),o=!!a.fieldId;return i(c.Input,{className:r(`min-w-0 flex-1 bg-transparent outline-none placeholder:text-subtle`,e),...o&&{id:a.fieldId,"aria-invalid":a.invalid||void 0,"aria-required":a.required||void 0,"aria-describedby":a.invalid?a.errorTextId||void 0:a.helperTextId||void 0},...n})}m.displayName=`Combobox.Input`;function h({className:e,children:t,...n}){return i(c.Trigger,{className:r(`duration-moderate shrink-0 text-subtle transition-transform data-[popup-open]:rotate-180`,e),...n,children:t??i(a,{weight:`bold`,className:`size-4`})})}h.displayName=`Combobox.Trigger`;function g({className:e,children:t,...n}){return i(c.Clear,{className:r(`shrink-0 cursor-pointer text-subtle hover:text-normal`,e),...n,children:t??i(s,{weight:`bold`,className:`size-4`})})}g.displayName=`Combobox.Clear`;function _(e){return i(c.Portal,{...e})}_.displayName=`Combobox.Portal`;function v({className:e,...t}){return i(c.Positioner,{className:r(`z-50`,e),sideOffset:4,...t})}v.displayName=`Combobox.Positioner`;function y({className:e,...t}){return i(c.Popup,{className:r(`max-h-[var(--available-height)] max-w-[var(--available-width)] min-w-[var(--anchor-width)] overflow-y-auto rounded-xl border border-[var(--intent-border-subtle)] bg-raised p-1 shadow-lg`,`origin-[var(--transform-origin)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0`,e),...t})}y.displayName=`Combobox.Popup`;function b({className:e,...t}){return i(c.List,{className:e,...t})}b.displayName=`Combobox.List`;function x({className:e,...t}){return i(c.Item,{className:r(`flex w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 py-1.5 text-sm text-normal outline-none select-none`,`data-[highlighted]:bg-subtle`,e),...t})}x.displayName=`Combobox.Item`;function S(e){return i(c.Collection,{...e})}S.displayName=`Combobox.Collection`;function C({className:e,children:t,...n}){return i(c.ItemIndicator,{className:r(`shrink-0 text-subtle`,e),...n,children:t??i(o,{weight:`bold`,className:`size-4`})})}C.displayName=`Combobox.ItemIndicator`;function w({className:e,...t}){return i(c.Group,{className:r(`[&+&]:mt-1`,e),...t})}w.displayName=`Combobox.Group`;function T({className:e,...t}){return i(c.GroupLabel,{className:r(`px-2 py-1.5 text-xs font-medium text-subtle select-none`,e),...t})}T.displayName=`Combobox.GroupLabel`;function E({className:e,...t}){return i(c.Empty,{className:r(`text-center text-sm text-subtle empty:hidden [&:not(:empty)]:px-3 [&:not(:empty)]:py-4`,e),...t})}E.displayName=`Combobox.Empty`;function D({className:e,...t}){return i(c.Status,{className:r(`sr-only`,e),...t})}D.displayName=`Combobox.Status`;const O=Object.assign(d,{Label:f,InputGroup:p,Input:m,Trigger:h,Clear:g,Portal:_,Positioner:v,Popup:y,List:b,Item:x,Collection:S,ItemIndicator:C,Group:w,GroupLabel:T,Empty:E,Status:D});export{O as Combobox,g as ComboboxClear,S as ComboboxCollection,E as ComboboxEmpty,w as ComboboxGroup,T as ComboboxGroupLabel,m as ComboboxInput,p as ComboboxInputGroup,x as ComboboxItem,C as ComboboxItemIndicator,f as ComboboxLabel,b as ComboboxList,y as ComboboxPopup,_ as ComboboxPortal,v as ComboboxPositioner,d as ComboboxRoot,D as ComboboxStatus,h as ComboboxTrigger,u as comboboxInputGroupVariants,l as useFilter};
1
+ "use client";import{t as e}from"./variants-DTAwzBl3.js";import{useFieldContext as t}from"./Field.js";import{cva as n}from"class-variance-authority";import{cn as r}from"@oztix/roadie-core/utils";import{jsx as i}from"react/jsx-runtime";import{CaretDownIcon as a,CheckIcon as o,XIcon as s}from"@phosphor-icons/react";import{Combobox as c}from"@base-ui/react/combobox";const l=c.useFilter,u=n(`inline-flex w-full items-center rounded-lg font-sans`,{variants:{intent:e,emphasis:{normal:`emphasis-sunken border border-subtle is-interactive-field-group`,subtle:`bg-subtle text-normal border border-transparent is-interactive-field-group`},size:{sm:`h-8 px-1.5 text-base`,md:`h-10 px-2 text-base`,lg:`h-12 px-2 text-base`}},defaultVariants:{emphasis:`normal`,size:`md`}});function d(e){return i(c.Root,{...e})}d.displayName=`Combobox`;function f({className:e,...t}){return i(c.Label,{className:r(`text-sm font-medium text-normal`,e),...t})}f.displayName=`Combobox.Label`;function p({className:e,intent:n,emphasis:a,size:o,...s}){let l=t(),d=!!l.fieldId;return i(c.InputGroup,{className:r(u({intent:n,emphasis:a,size:o,className:e})),"aria-invalid":d&&l.invalid||void 0,...s})}p.displayName=`Combobox.InputGroup`;function m({className:e,...n}){let a=t(),o=!!a.fieldId;return i(c.Input,{className:r(`min-w-0 flex-1 bg-transparent outline-none placeholder:text-subtle`,e),...o&&{id:a.fieldId,"aria-invalid":a.invalid||void 0,"aria-required":a.required||void 0,"aria-describedby":a.invalid?a.errorTextId||void 0:a.helperTextId||void 0},...n})}m.displayName=`Combobox.Input`;function h({className:e,children:t,...n}){return i(c.Trigger,{className:r(`duration-moderate shrink-0 text-subtle transition-transform data-[popup-open]:rotate-180`,e),...n,children:t??i(a,{weight:`bold`,className:`size-4`})})}h.displayName=`Combobox.Trigger`;function g({className:e,children:t,...n}){return i(c.Clear,{className:r(`shrink-0 cursor-pointer text-subtle hover:text-normal`,e),...n,children:t??i(s,{weight:`bold`,className:`size-4`})})}g.displayName=`Combobox.Clear`;function _(e){return i(c.Portal,{...e})}_.displayName=`Combobox.Portal`;function v({className:e,...t}){return i(c.Positioner,{className:r(`z-50`,e),sideOffset:4,...t})}v.displayName=`Combobox.Positioner`;function y({className:e,...t}){return i(c.Popup,{className:r(`max-h-[var(--available-height)] max-w-[var(--available-width)] min-w-[var(--anchor-width)] overflow-y-auto rounded-xl border border-[var(--intent-border-subtle)] bg-raised p-1 shadow-lg`,`origin-[var(--transform-origin)] transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0`,e),...t})}y.displayName=`Combobox.Popup`;function b({className:e,...t}){return i(c.List,{className:e,...t})}b.displayName=`Combobox.List`;function x({className:e,...t}){return i(c.Item,{className:r(`flex w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-lg px-2 py-1.5 text-sm text-normal outline-none select-none`,`data-[highlighted]:bg-subtle`,e),...t})}x.displayName=`Combobox.Item`;function S(e){return i(c.Collection,{...e})}S.displayName=`Combobox.Collection`;function C({className:e,children:t,...n}){return i(c.ItemIndicator,{className:r(`shrink-0 text-subtle`,e),...n,children:t??i(o,{weight:`bold`,className:`size-4`})})}C.displayName=`Combobox.ItemIndicator`;function w({className:e,...t}){return i(c.Group,{className:r(`[&+&]:mt-1`,e),...t})}w.displayName=`Combobox.Group`;function T({className:e,...t}){return i(c.GroupLabel,{className:r(`px-2 py-1.5 text-xs font-medium text-subtle select-none`,e),...t})}T.displayName=`Combobox.GroupLabel`;function E({className:e,...t}){return i(c.Empty,{className:r(`text-center text-sm text-subtle empty:hidden [&:not(:empty)]:px-3 [&:not(:empty)]:py-4`,e),...t})}E.displayName=`Combobox.Empty`;function D({className:e,...t}){return i(c.Status,{className:r(`sr-only`,e),...t})}D.displayName=`Combobox.Status`,d.Label=f,d.InputGroup=p,d.Input=m,d.Trigger=h,d.Clear=g,d.Portal=_,d.Positioner=v,d.Popup=y,d.List=b,d.Item=x,d.Collection=S,d.ItemIndicator=C,d.Group=w,d.GroupLabel=T,d.Empty=E,d.Status=D;export{d as Combobox,g as ComboboxClear,S as ComboboxCollection,E as ComboboxEmpty,w as ComboboxGroup,T as ComboboxGroupLabel,m as ComboboxInput,p as ComboboxInputGroup,x as ComboboxItem,C as ComboboxItemIndicator,f as ComboboxLabel,b as ComboboxList,y as ComboboxPopup,_ as ComboboxPortal,v as ComboboxPositioner,D as ComboboxStatus,h as ComboboxTrigger,u as comboboxInputGroupVariants,l as useFilter};
2
2
  //# sourceMappingURL=Combobox.js.map