@spark-ui/components 10.12.0 → 10.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/carousel/index.d.mts +7 -2
- package/dist/carousel/index.d.ts +7 -2
- package/dist/carousel/index.js +57 -20
- package/dist/carousel/index.js.map +1 -1
- package/dist/carousel/index.mjs +57 -20
- package/dist/carousel/index.mjs.map +1 -1
- package/dist/docgen.json +110 -0
- package/package.json +5 -5
|
@@ -51,6 +51,10 @@ interface UseCarouselProps {
|
|
|
51
51
|
scrollBehavior?: 'instant' | 'smooth';
|
|
52
52
|
onPageChange?: (pageIndex: number) => void;
|
|
53
53
|
pagePickerInset?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Maximum number of dots to display in the page picker.
|
|
56
|
+
*/
|
|
57
|
+
maxDots?: number;
|
|
54
58
|
}
|
|
55
59
|
interface ComputedRootProps {
|
|
56
60
|
id: string;
|
|
@@ -120,7 +124,7 @@ interface ComputedIndicatorProps {
|
|
|
120
124
|
'data-part': 'indicator';
|
|
121
125
|
'data-orientation': 'horizontal';
|
|
122
126
|
'data-index': number;
|
|
123
|
-
'data-state': 'active' | '
|
|
127
|
+
'data-state': 'active' | 'edge' | 'hidden' | 'idle';
|
|
124
128
|
tabIndex: 0 | -1;
|
|
125
129
|
onClick: () => void;
|
|
126
130
|
onKeyDown: (event: KeyboardEvent) => void;
|
|
@@ -159,6 +163,7 @@ interface CarouselAPI extends AnatomyPropsSetters {
|
|
|
159
163
|
snapType: UseCarouselProps['snapType'];
|
|
160
164
|
snapStop: UseCarouselProps['snapStop'];
|
|
161
165
|
scrollBehavior: UseCarouselProps['scrollBehavior'];
|
|
166
|
+
maxDots: number;
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
interface Props$4 extends UseCarouselProps, ComponentProps<'div'> {
|
|
@@ -166,7 +171,7 @@ interface Props$4 extends UseCarouselProps, ComponentProps<'div'> {
|
|
|
166
171
|
className?: string;
|
|
167
172
|
}
|
|
168
173
|
declare const Carousel$1: {
|
|
169
|
-
({ className, snapType, snapStop, scrollBehavior, slidesPerMove, pagePickerInset, slidesPerPage, loop, children, gap, defaultPage, page, onPageChange, ...props }: Props$4): react_jsx_runtime.JSX.Element;
|
|
174
|
+
({ className, snapType, snapStop, scrollBehavior, slidesPerMove, pagePickerInset, slidesPerPage, loop, children, gap, defaultPage, page, onPageChange, maxDots, ...props }: Props$4): react_jsx_runtime.JSX.Element;
|
|
170
175
|
displayName: string;
|
|
171
176
|
};
|
|
172
177
|
|
package/dist/carousel/index.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ interface UseCarouselProps {
|
|
|
51
51
|
scrollBehavior?: 'instant' | 'smooth';
|
|
52
52
|
onPageChange?: (pageIndex: number) => void;
|
|
53
53
|
pagePickerInset?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Maximum number of dots to display in the page picker.
|
|
56
|
+
*/
|
|
57
|
+
maxDots?: number;
|
|
54
58
|
}
|
|
55
59
|
interface ComputedRootProps {
|
|
56
60
|
id: string;
|
|
@@ -120,7 +124,7 @@ interface ComputedIndicatorProps {
|
|
|
120
124
|
'data-part': 'indicator';
|
|
121
125
|
'data-orientation': 'horizontal';
|
|
122
126
|
'data-index': number;
|
|
123
|
-
'data-state': 'active' | '
|
|
127
|
+
'data-state': 'active' | 'edge' | 'hidden' | 'idle';
|
|
124
128
|
tabIndex: 0 | -1;
|
|
125
129
|
onClick: () => void;
|
|
126
130
|
onKeyDown: (event: KeyboardEvent) => void;
|
|
@@ -159,6 +163,7 @@ interface CarouselAPI extends AnatomyPropsSetters {
|
|
|
159
163
|
snapType: UseCarouselProps['snapType'];
|
|
160
164
|
snapStop: UseCarouselProps['snapStop'];
|
|
161
165
|
scrollBehavior: UseCarouselProps['scrollBehavior'];
|
|
166
|
+
maxDots: number;
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
interface Props$4 extends UseCarouselProps, ComponentProps<'div'> {
|
|
@@ -166,7 +171,7 @@ interface Props$4 extends UseCarouselProps, ComponentProps<'div'> {
|
|
|
166
171
|
className?: string;
|
|
167
172
|
}
|
|
168
173
|
declare const Carousel$1: {
|
|
169
|
-
({ className, snapType, snapStop, scrollBehavior, slidesPerMove, pagePickerInset, slidesPerPage, loop, children, gap, defaultPage, page, onPageChange, ...props }: Props$4): react_jsx_runtime.JSX.Element;
|
|
174
|
+
({ className, snapType, snapStop, scrollBehavior, slidesPerMove, pagePickerInset, slidesPerPage, loop, children, gap, defaultPage, page, onPageChange, maxDots, ...props }: Props$4): react_jsx_runtime.JSX.Element;
|
|
170
175
|
displayName: string;
|
|
171
176
|
};
|
|
172
177
|
|
package/dist/carousel/index.js
CHANGED
|
@@ -163,6 +163,35 @@ function getSnapPositions({
|
|
|
163
163
|
});
|
|
164
164
|
}).map((slide) => slide.offsetLeft);
|
|
165
165
|
}
|
|
166
|
+
function computeDotState({
|
|
167
|
+
dotIndex,
|
|
168
|
+
pageState,
|
|
169
|
+
totalPages,
|
|
170
|
+
maxDots = 5
|
|
171
|
+
}) {
|
|
172
|
+
if (totalPages <= maxDots) {
|
|
173
|
+
return dotIndex === pageState ? "active" : "idle";
|
|
174
|
+
}
|
|
175
|
+
if (pageState <= Math.floor(maxDots / 2)) {
|
|
176
|
+
if (dotIndex > maxDots - 1) return "hidden";
|
|
177
|
+
if (dotIndex === pageState) return "active";
|
|
178
|
+
if (dotIndex === maxDots - 1) return "edge";
|
|
179
|
+
return "idle";
|
|
180
|
+
}
|
|
181
|
+
if (pageState >= totalPages - Math.ceil(maxDots / 2)) {
|
|
182
|
+
const startIndex2 = totalPages - maxDots;
|
|
183
|
+
if (dotIndex < startIndex2) return "hidden";
|
|
184
|
+
if (dotIndex === pageState) return "active";
|
|
185
|
+
if (dotIndex === startIndex2) return "edge";
|
|
186
|
+
return "idle";
|
|
187
|
+
}
|
|
188
|
+
const startIndex = pageState - Math.floor(maxDots / 2);
|
|
189
|
+
const endIndex = pageState + Math.floor(maxDots / 2);
|
|
190
|
+
if (dotIndex < startIndex || dotIndex > endIndex) return "hidden";
|
|
191
|
+
if (dotIndex === pageState) return "active";
|
|
192
|
+
if (dotIndex === startIndex || dotIndex === endIndex) return "edge";
|
|
193
|
+
return "idle";
|
|
194
|
+
}
|
|
166
195
|
|
|
167
196
|
// src/carousel/useSnapPoints.ts
|
|
168
197
|
function useSnapPoints(initialSnapPoints = [], {
|
|
@@ -199,6 +228,7 @@ var useCarousel = ({
|
|
|
199
228
|
scrollBehavior = "smooth",
|
|
200
229
|
loop = false,
|
|
201
230
|
pagePickerInset = false,
|
|
231
|
+
maxDots = 5,
|
|
202
232
|
// state control
|
|
203
233
|
page: controlledPage,
|
|
204
234
|
onPageChange: onPageChangeProp
|
|
@@ -301,6 +331,7 @@ var useCarousel = ({
|
|
|
301
331
|
scrollBehavior,
|
|
302
332
|
loop,
|
|
303
333
|
pagePickerInset,
|
|
334
|
+
maxDots,
|
|
304
335
|
// computed state
|
|
305
336
|
page: pageState,
|
|
306
337
|
pageSnapPoints,
|
|
@@ -409,17 +440,22 @@ var useCarousel = ({
|
|
|
409
440
|
dir: DIRECTION
|
|
410
441
|
}),
|
|
411
442
|
getIndicatorProps: ({ index }) => {
|
|
412
|
-
const
|
|
443
|
+
const dotState = computeDotState({
|
|
444
|
+
dotIndex: index,
|
|
445
|
+
pageState,
|
|
446
|
+
totalPages: pageSnapPoints.length,
|
|
447
|
+
maxDots
|
|
448
|
+
});
|
|
413
449
|
return {
|
|
414
450
|
role: "radio",
|
|
415
451
|
id: `carousel::${carouselId}::indicator:${index}`,
|
|
416
|
-
"aria-checked":
|
|
452
|
+
"aria-checked": index === pageState,
|
|
417
453
|
"data-scope": DATA_SCOPE,
|
|
418
454
|
"data-part": "indicator",
|
|
419
455
|
"data-orientation": "horizontal",
|
|
420
456
|
"data-index": index,
|
|
421
|
-
"data-state":
|
|
422
|
-
tabIndex:
|
|
457
|
+
"data-state": dotState,
|
|
458
|
+
tabIndex: index === pageState ? 0 : -1,
|
|
423
459
|
onClick: () => {
|
|
424
460
|
scrollTo(index, scrollBehavior);
|
|
425
461
|
},
|
|
@@ -456,6 +492,7 @@ var Carousel = ({
|
|
|
456
492
|
defaultPage,
|
|
457
493
|
page,
|
|
458
494
|
onPageChange,
|
|
495
|
+
maxDots = 5,
|
|
459
496
|
...props
|
|
460
497
|
}) => {
|
|
461
498
|
const carouselApi = useCarousel({
|
|
@@ -469,7 +506,8 @@ var Carousel = ({
|
|
|
469
506
|
snapType,
|
|
470
507
|
page,
|
|
471
508
|
pagePickerInset,
|
|
472
|
-
onPageChange
|
|
509
|
+
onPageChange,
|
|
510
|
+
maxDots
|
|
473
511
|
});
|
|
474
512
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
475
513
|
CarouselContext.Provider,
|
|
@@ -1576,28 +1614,26 @@ var CarouselPageIndicator = ({
|
|
|
1576
1614
|
ctx.pageIndicatorsRefs.current[index] = ref.current;
|
|
1577
1615
|
}
|
|
1578
1616
|
});
|
|
1579
|
-
const
|
|
1580
|
-
"group h-sz-16 relative flex",
|
|
1581
|
-
"hover:cursor-pointer",
|
|
1582
|
-
"w-sz-16 data-[state=active]:w-sz-44"
|
|
1583
|
-
);
|
|
1584
|
-
const dotsStyles = (0, import_class_variance_authority8.cx)(
|
|
1585
|
-
"before:rounded-sm before:block before:size-md",
|
|
1586
|
-
"before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2",
|
|
1587
|
-
"data-[state=active]:before:w-sz-32",
|
|
1588
|
-
intent === "surface" ? "data-[state=active]:before:bg-surface data-[state=inactive]:before:bg-surface/dim-2" : "data-[state=active]:before:bg-basic data-[state=inactive]:before:bg-on-surface/dim-2"
|
|
1589
|
-
);
|
|
1617
|
+
const indicatorProps = ctx.getIndicatorProps({ index });
|
|
1590
1618
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1591
1619
|
"button",
|
|
1592
1620
|
{
|
|
1593
1621
|
"data-spark-component": "carousel-page-indicator",
|
|
1594
1622
|
ref,
|
|
1595
|
-
...
|
|
1623
|
+
...indicatorProps,
|
|
1596
1624
|
"aria-label": ariaLabel,
|
|
1597
1625
|
className: (0, import_class_variance_authority8.cx)(
|
|
1598
1626
|
{
|
|
1599
|
-
[
|
|
1600
|
-
|
|
1627
|
+
[(0, import_class_variance_authority8.cx)(
|
|
1628
|
+
"border-outline group relative flex justify-center border-0 hover:cursor-pointer",
|
|
1629
|
+
"m-sm rounded-sm transition-all duration-[200ms] ease-linear",
|
|
1630
|
+
"w-sz-8 h-sz-8",
|
|
1631
|
+
"data-[state=active]:w-sz-32 data-[state=active]:h-sz-8",
|
|
1632
|
+
"data-[state=edge]:w-sz-4 data-[state=edge]:h-sz-4",
|
|
1633
|
+
"data-[state=hidden]:size-0",
|
|
1634
|
+
intent === "surface" ? "data-[state=active]:bg-surface bg-surface/dim-2" : "data-[state=active]:bg-basic bg-on-surface/dim-2"
|
|
1635
|
+
)]: !unstyled
|
|
1636
|
+
// [dotsStyles]: !unstyled,
|
|
1601
1637
|
},
|
|
1602
1638
|
className
|
|
1603
1639
|
),
|
|
@@ -1619,7 +1655,8 @@ var CarouselPagePicker = ({ children, className }) => {
|
|
|
1619
1655
|
"data-spark-component": "carousel-page-picker",
|
|
1620
1656
|
...ctx.getIndicatorGroupProps(),
|
|
1621
1657
|
className: (0, import_class_variance_authority9.cx)(
|
|
1622
|
-
"
|
|
1658
|
+
"flex-wrap items-center justify-center",
|
|
1659
|
+
"default:min-h-sz-16 flex",
|
|
1623
1660
|
ctx.pagePickerInset && "bottom-sz-12 absolute inset-x-0",
|
|
1624
1661
|
className
|
|
1625
1662
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/carousel/index.ts","../../src/carousel/Carousel.tsx","../../src/carousel/useCarousel.ts","../../src/carousel/useEvent.ts","../../src/carousel/useIsMounted.ts","../../src/carousel/useScrollEnd.ts","../../src/carousel/useSnapPoints.ts","../../src/carousel/useResizeObserver.ts","../../src/carousel/utils.ts","../../src/carousel/CarouselControls.tsx","../../src/carousel/CarouselNextButton.tsx","../../src/icon/Icon.tsx","../../src/slot/Slot.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx","../../src/button/Button.tsx","../../src/spinner/Spinner.styles.tsx","../../src/spinner/Spinner.tsx","../../src/button/Button.styles.tsx","../../src/button/variants/filled.ts","../../src/button/variants/ghost.ts","../../src/button/variants/outlined.ts","../../src/button/variants/tinted.ts","../../src/button/variants/contrast.ts","../../src/icon-button/IconButton.styles.tsx","../../src/icon-button/IconButton.tsx","../../src/carousel/CarouselPageIndicator.tsx","../../src/carousel/CarouselPagePicker.tsx","../../src/carousel/CarouselPrevButton.tsx","../../src/carousel/CarouselSlide.tsx","../../src/carousel/useIsVisible.ts","../../src/carousel/CarouselSlides.tsx","../../src/carousel/CarouselViewport.tsx"],"sourcesContent":["import { Carousel as Root } from './Carousel'\nimport { CarouselControls as Controls } from './CarouselControls'\nimport { CarouselNextButton as NextButton } from './CarouselNextButton'\nimport { CarouselPageIndicator as PageIndicator } from './CarouselPageIndicator'\nimport { CarouselPagePicker as PagePicker } from './CarouselPagePicker'\nimport { CarouselPrevButton as PrevButton } from './CarouselPrevButton'\nimport { CarouselSlide as Slide } from './CarouselSlide'\nimport { CarouselSlides as Slides } from './CarouselSlides'\nimport { CarouselViewport as Viewport } from './CarouselViewport'\n\nexport const Carousel: typeof Root & {\n Controls: typeof Controls\n NextButton: typeof NextButton\n PrevButton: typeof PrevButton\n Slide: typeof Slide\n Slides: typeof Slides\n Viewport: typeof Viewport\n PagePicker: typeof PagePicker\n PageIndicator: typeof PageIndicator\n} = Object.assign(Root, {\n Controls,\n NextButton,\n PrevButton,\n Slide,\n Slides,\n Viewport,\n PagePicker,\n PageIndicator,\n})\n\nCarousel.displayName = 'Carousel'\n","import { cx } from 'class-variance-authority'\nimport { ComponentProps, createContext, ReactNode, useContext } from 'react'\n\nimport { CarouselAPI, UseCarouselProps } from './types'\nimport { useCarousel } from './useCarousel'\n\ninterface Props extends UseCarouselProps, ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nconst CarouselContext = createContext<CarouselAPI | null>(null)\n\nexport const Carousel = ({\n className,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollBehavior = 'smooth',\n slidesPerMove = 'auto',\n pagePickerInset = false,\n slidesPerPage = 1,\n loop = false,\n children,\n gap = 16,\n defaultPage,\n page,\n onPageChange,\n ...props\n}: Props) => {\n const carouselApi = useCarousel({\n defaultPage,\n slidesPerPage,\n slidesPerMove,\n loop,\n gap,\n scrollBehavior,\n snapStop,\n snapType,\n page,\n pagePickerInset,\n onPageChange,\n })\n\n return (\n <CarouselContext.Provider\n value={{\n ...carouselApi,\n scrollBehavior,\n }}\n >\n <div\n data-spark-component=\"carousel\"\n className={cx('gap-lg relative box-border flex flex-col', className)}\n {...carouselApi.getRootProps()}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nCarousel.displayName = 'Carousel'\n\nexport const useCarouselContext = () => {\n const context = useContext(CarouselContext)\n\n if (!context) {\n throw Error('useCarouselContext must be used within a Carousel provider')\n }\n\n return context\n}\n","/* eslint-disable max-lines-per-function */\nimport {\n KeyboardEvent,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\n\nimport {\n CarouselAPI,\n ComputedControlProps,\n ComputedIndicatorGroupProps,\n ComputedIndicatorProps,\n ComputedRootProps,\n ComputedSlideGroupProps,\n ComputedSlideProps,\n ComputedTriggerProps,\n UseCarouselProps,\n} from './types'\nimport { useEvent } from './useEvent'\nimport { useIsMounted } from './useIsMounted'\nimport { useScrollEnd } from './useScrollEnd'\nimport { useSnapPoints } from './useSnapPoints'\nimport { getSnapPositions, isSnapPoint } from './utils'\n\nconst DATA_SCOPE = 'carousel' as const\nconst DIRECTION = 'ltr' as const\n\nexport const useCarousel = ({\n defaultPage,\n gap = 16,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollPadding = 0,\n slidesPerPage = 1,\n slidesPerMove = 'auto',\n scrollBehavior = 'smooth',\n loop = false,\n pagePickerInset = false,\n // state control\n page: controlledPage,\n onPageChange: onPageChangeProp,\n}: UseCarouselProps): CarouselAPI => {\n const carouselId = useId()\n const [pageState, setPageState] = useState(defaultPage || controlledPage || 0)\n\n const carouselRef = useRef<HTMLDivElement>(null)\n const pageIndicatorsRefs = useRef<(HTMLElement | null)[]>([])\n const isMountedRef = useIsMounted()\n const isMounted = isMountedRef.current\n const onPageChange = useEvent(onPageChangeProp)\n\n const [pageSnapPoints] = useSnapPoints([], {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n })\n\n const canScrollPrev = useRef(loop || pageState > 0)\n const canScrollNext = useRef(loop || pageState < pageSnapPoints.length - 1)\n canScrollPrev.current = loop || pageState > 0\n canScrollNext.current = loop || pageState < pageSnapPoints.length - 1\n\n const handlePageChange = useCallback(\n (page: number) => {\n if (page !== pageState) {\n setPageState(page)\n onPageChange?.(page)\n }\n },\n [onPageChange, pageState]\n )\n\n const scrollTo = useCallback(\n (page: number, behavior: 'instant' | 'smooth') => {\n if (carouselRef.current) {\n carouselRef.current.scrollTo({\n left: pageSnapPoints[page],\n behavior: behavior === 'instant' ? 'auto' : 'smooth',\n })\n handlePageChange(page)\n }\n },\n [handlePageChange, pageSnapPoints]\n )\n\n const scrollPrev = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollPrev) {\n const targetPage =\n loop && pageState === 0 ? pageSnapPoints.length - 1 : Math.max(pageState - 1, 0)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n const scrollNext = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollNext) {\n const targetPage =\n loop && pageState === pageSnapPoints.length - 1\n ? 0\n : Math.min(pageState + 1, pageSnapPoints.length - 1)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n useEffect(() => {\n if (controlledPage != null) {\n scrollTo(controlledPage, scrollBehavior)\n }\n }, [controlledPage, scrollBehavior, scrollTo])\n\n /**\n * Set the default scroll position of the carousel based on `defaultPage`.\n * As this operation is done before the snap points are set in the state, we have to get them from the ref directly.\n */\n useLayoutEffect(() => {\n if (defaultPage != null && !isMounted && carouselRef.current) {\n const snapPositions = getSnapPositions({\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n carouselRef.current.scrollTo({\n left: snapPositions[defaultPage],\n behavior: 'instant',\n })\n }\n }, [defaultPage, isMounted, slidesPerMove, slidesPerPage])\n\n /**\n * Monitoring scrollend events inside the scrollable area to sync the carousel active page with current scroll position.\n * Scrollend has been chosen over \"scroll\" for performance reason.\n */\n const syncPageStateWithScrollPosition = useCallback(() => {\n if (!carouselRef.current || pageSnapPoints.length === 0) return\n\n const { scrollLeft } = carouselRef.current\n\n const distances = pageSnapPoints.map(pagePosition => Math.abs(scrollLeft - pagePosition))\n const pageInViewport = distances.indexOf(Math.min(...distances))\n\n if (pageInViewport !== -1) {\n handlePageChange(pageInViewport)\n }\n }, [pageSnapPoints, handlePageChange])\n\n useScrollEnd(carouselRef, syncPageStateWithScrollPosition)\n\n const contextValue: CarouselAPI = {\n ref: carouselRef,\n pageIndicatorsRefs,\n // props\n gap,\n snapType,\n snapStop,\n scrollPadding,\n slidesPerPage,\n slidesPerMove,\n scrollBehavior,\n loop,\n pagePickerInset,\n // computed state\n page: pageState,\n pageSnapPoints,\n canScrollNext: canScrollNext.current,\n canScrollPrev: canScrollPrev.current,\n scrollTo,\n scrollPrev,\n scrollNext,\n // anatomy\n getRootProps: (): ComputedRootProps => ({\n id: `carousel::${carouselId}:`,\n role: 'region',\n 'aria-roledescription': 'carousel',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'root',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n '--slides-per-page': slidesPerPage,\n '--slide-spacing': `${gap}px`,\n '--slide-item-size':\n 'calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))',\n },\n }),\n\n getControlProps: (): ComputedControlProps => ({\n 'data-scope': DATA_SCOPE,\n 'data-part': 'control',\n 'data-orientation': 'horizontal',\n }),\n\n getPrevTriggerProps: (): ComputedTriggerProps<'prev-trigger'> => ({\n id: `carousel::${carouselId}::prev-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'prev-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollPrev.current,\n onClick: () => scrollPrev(),\n }),\n\n getNextTriggerProps: (): ComputedTriggerProps<'next-trigger'> => ({\n id: `carousel::${carouselId}::next-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'next-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollNext.current,\n onClick: () => scrollNext(),\n }),\n\n getSlidesContainerProps: (): ComputedSlideGroupProps => ({\n id: `carousel::${carouselId}::item-group`,\n /**\n * The carousel pattern was originally designed for a single slide.\n * When there is more than one slide, the aria-live region is set to off to avoid announcing the whole list of slides.\n * This is not ideal but we keep it for backwards compatibility.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/carousel/#wai-aria-attributes\n */\n 'aria-live': slidesPerPage > 1 ? 'off' : 'polite',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n tabIndex: 0,\n style: {\n display: 'grid',\n gap: 'var(--slide-spacing)',\n scrollSnapType: `x ${snapType}`,\n gridAutoFlow: 'column',\n scrollbarWidth: 'none',\n gridAutoColumns: 'var(--slide-item-size)',\n overflowX: 'auto',\n },\n ref: carouselRef,\n }),\n\n getSlideProps: ({ index }): ComputedSlideProps => {\n const isStopPoint = isSnapPoint(index, {\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n return {\n id: `carousel::${carouselId}::item:${index}`,\n role: 'group',\n 'aria-roledescription': 'slide',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item',\n 'data-index': index,\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n ...(isStopPoint && {\n scrollSnapAlign: 'start',\n scrollSnapStop: snapStop,\n }),\n },\n }\n },\n\n getIndicatorGroupProps: (): ComputedIndicatorGroupProps => ({\n role: 'radiogroup',\n id: `carousel::${carouselId}::indicator-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n }),\n\n getIndicatorProps: ({ index }): ComputedIndicatorProps => {\n const isActivePage = index === pageState\n\n return {\n role: 'radio',\n id: `carousel::${carouselId}::indicator:${index}`,\n 'aria-checked': isActivePage,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator',\n 'data-orientation': 'horizontal',\n 'data-index': index,\n 'data-state': isActivePage ? 'active' : 'inactive',\n tabIndex: isActivePage ? 0 : -1,\n onClick: () => {\n scrollTo(index, scrollBehavior)\n },\n onKeyDown: (event: KeyboardEvent) => {\n const focusActiveIndicator = (page: number) => {\n pageIndicatorsRefs.current[page]?.focus()\n }\n\n if (event.key === 'ArrowRight' && canScrollNext) {\n scrollNext(focusActiveIndicator)\n } else if (event.key === 'ArrowLeft' && canScrollPrev) {\n scrollPrev(focusActiveIndicator)\n }\n },\n }\n },\n }\n\n return contextValue\n}\n","import { useCallback, useLayoutEffect, useRef } from 'react'\n\ntype AnyFunction = (...args: any[]) => any\n\n/**\n * Directly from this gist: https://gist.github.com/diegohaz/695097a06f038a707c3a1b11e4e40195\n * Until React releases a native `useEvent` hook.\n */\nexport function useEvent<T extends AnyFunction>(callback?: T) {\n const ref = useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.')\n })\n\n useLayoutEffect(() => {\n ref.current = callback\n })\n\n return useCallback<AnyFunction>((...args) => ref.current?.(...args), []) as T\n}\n","import { useEffect, useRef } from 'react'\n\nexport const useIsMounted = () => {\n const isMounted = useRef(false)\n\n useEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","import { useEffect, useRef, RefObject } from 'react'\n\nexport function useScrollEnd(scrollRef: RefObject<HTMLDivElement | null>, callback: () => void) {\n const scrollLeft = useRef(0)\n\n /**\n * Safari (and some smaller browsers) to not yet support the `scrollend` event.\n * For those we must rely on the `scroll` event and and an idle state delay to trigger the \"scroll end\".\n *\n * Caveats:\n * - when using a trackpad or your fingers on a touch device, scrolling then holding the position might trigger the \"scrollend\" callback too early.\n */\n const safariTimeout = useRef<NodeJS.Timeout | null>(null)\n\n useEffect(() => {\n const element = scrollRef.current\n if (!element) return\n\n const supportsScrollend = 'onscrollend' in window\n\n const handleScrollEnd = () => {\n callback()\n }\n\n const handleSafariScroll = () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (scrollRef.current) {\n scrollLeft.current = scrollRef.current.scrollLeft\n\n safariTimeout.current = setTimeout(() => {\n if (scrollRef.current) {\n handleScrollEnd()\n }\n }, 150)\n }\n }\n\n if (supportsScrollend) {\n element.addEventListener('scrollend', handleScrollEnd)\n } else {\n element.addEventListener('scroll', handleSafariScroll)\n }\n\n return () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (supportsScrollend) {\n element.removeEventListener('scrollend', handleScrollEnd)\n } else {\n element.removeEventListener('scroll', handleSafariScroll)\n }\n }\n }, [callback, scrollRef])\n}\n\nexport default useScrollEnd\n","import { useMemo, useState, RefObject } from 'react'\n\nimport { useResizeObserver } from './useResizeObserver'\nimport { getSnapPositions } from './utils'\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * The array is updated when resize event are caught in the carousel.\n */\nexport function useSnapPoints<T extends HTMLDivElement | null>(\n initialSnapPoints: number[] = [],\n {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n }: {\n carouselRef: RefObject<T>\n slidesPerMove: 'auto' | number\n slidesPerPage: number\n }\n) {\n const [pageSnapPoints, setPageSnapPoints] = useState(initialSnapPoints)\n\n const stableSnapPoints = useMemo(() => pageSnapPoints, [pageSnapPoints])\n\n /**\n * On resize, dimensions of the carousel might changes, which requires to update the snap points positions in the state.\n */\n useResizeObserver(carouselRef, () => {\n const newSnapPoints = getSnapPositions({\n slidesPerMove,\n slidesPerPage,\n container: carouselRef.current,\n })\n\n if (JSON.stringify(pageSnapPoints) !== JSON.stringify(newSnapPoints)) {\n setPageSnapPoints(newSnapPoints)\n }\n })\n\n return [stableSnapPoints, setPageSnapPoints] as const\n}\n","import { useLayoutEffect, RefObject } from 'react'\n\nexport function useResizeObserver<T extends HTMLElement | null>(\n ref: RefObject<T>,\n callback: (width: number) => void\n) {\n useLayoutEffect(() => {\n const element = ref.current\n if (!element) return\n\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n callback(entry.contentRect.width)\n }\n })\n\n observer.observe(element)\n\n return () => observer.disconnect() // Cleanup on unmount\n }, [ref, callback])\n}\n","/**\n * Get the indices of each slides that serves as the start of a page\n * @returns number[] (ex: [0, 2, 4])\n */\nfunction getSnapIndices({\n totalSlides,\n slidesPerMove,\n slidesPerPage,\n}: {\n totalSlides: number\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n const slideBy = slidesPerMove === 'auto' ? slidesPerPage : slidesPerMove\n const snapPoints: number[] = []\n\n const lastSnapIndex = Math.floor((totalSlides - slidesPerPage) / slideBy) * slideBy\n\n for (let i = 0; i <= lastSnapIndex; i += slideBy) {\n snapPoints.push(i)\n }\n\n // Adding final snap point if necessary\n if (snapPoints[snapPoints.length - 1] !== totalSlides - slidesPerPage) {\n snapPoints.push(totalSlides - slidesPerPage)\n }\n\n return snapPoints\n}\n\nexport function getSlideElements(container: HTMLDivElement | null): Element[] {\n return container ? Array.from(container.querySelectorAll('[data-part=\"item\"]')) : []\n}\n\nexport function isSnapPoint(\n slideIndex: number,\n {\n container,\n slidesPerMove,\n slidesPerPage,\n }: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n }\n) {\n return getSnapIndices({\n totalSlides: getSlideElements(container).length,\n slidesPerPage,\n slidesPerMove,\n }).includes(slideIndex)\n}\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * @returns number[] (ex for a 400px carousel with no gap: [400, 800, 1200])\n */\nexport function getSnapPositions({\n container,\n slidesPerMove,\n slidesPerPage,\n}: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n if (!container) return []\n\n return getSlideElements(container)\n .filter((_, index) => {\n return isSnapPoint(index, {\n slidesPerMove,\n slidesPerPage,\n container,\n })\n })\n .map(slide => (slide as HTMLElement).offsetLeft)\n}\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface ControlsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n}\n\nexport const CarouselControls = ({ children, className, ...props }: ControlsProps) => {\n const ctx = useCarouselContext()\n\n return (\n <div\n data-spark-component=\"carousel-controls\"\n className={cx(\n 'default:px-lg pointer-events-none absolute inset-0 flex flex-row items-center justify-between',\n className\n )}\n {...ctx.getControlProps()}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselControls.displayName = 'Carousel.Controls'\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselNextButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-next-button\"\n {...ctx.getNextTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselNextButton.displayName = 'Carousel.NextButton'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, type DOMAttributes, Ref, useMemo } from 'react'\n\nimport { Slot, wrapPolymorphicSlot } from '../slot'\nimport { Spinner, type SpinnerProps } from '../spinner'\nimport { buttonStyles, type ButtonStylesProps } from './Button.styles'\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<'button'>, 'disabled'>,\n ButtonStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Display a spinner to indicate to the user that the button is loading something after they interacted with it.\n */\n isLoading?: boolean\n /**\n * If your loading state should only display a spinner, it's better to specify a label for it (a11y).\n */\n loadingLabel?: string\n /**\n * If your loading state should also display a label, you can use this prop instead of `loadingLabel`.\n * **Please note that using this can result in layout shifting when the Button goes from loading state to normal state.**\n */\n loadingText?: string\n ref?: Ref<HTMLButtonElement>\n}\n\ntype DOMAttributesEventHandler = keyof Omit<\n DOMAttributes<HTMLButtonElement>,\n 'children' | 'dangerouslySetInnerHTML'\n>\n\nconst blockedEventHandlers: DOMAttributesEventHandler[] = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onSubmit',\n]\n\nexport const Button = ({\n children,\n design = 'filled',\n disabled = false,\n intent = 'main',\n isLoading = false,\n loadingLabel,\n loadingText,\n shape = 'rounded',\n size = 'md',\n asChild,\n className,\n underline = false,\n ref,\n ...others\n}: ButtonProps) => {\n const Component = asChild ? Slot : 'button'\n\n const shouldNotInteract = !!disabled || isLoading\n\n const disabledEventHandlers = useMemo(() => {\n const result: Partial<Record<DOMAttributesEventHandler, () => void>> = {}\n\n if (shouldNotInteract) {\n blockedEventHandlers.forEach(eventHandler => (result[eventHandler] = undefined))\n }\n\n return result\n }, [shouldNotInteract])\n\n const spinnerProps = {\n size: 'current' as SpinnerProps['size'],\n className: loadingText ? 'inline-block' : 'absolute',\n ...(loadingLabel && { 'aria-label': loadingLabel }),\n }\n\n return (\n <Component\n data-spark-component=\"button\"\n {...(Component === 'button' && { type: 'button' })}\n ref={ref}\n className={buttonStyles({\n className,\n design,\n disabled: shouldNotInteract,\n intent,\n shape,\n size,\n underline,\n })}\n disabled={!!disabled}\n aria-busy={isLoading}\n aria-live={isLoading ? 'assertive' : 'off'}\n {...others}\n {...disabledEventHandlers}\n >\n {wrapPolymorphicSlot(asChild, children, slotted =>\n isLoading ? (\n <>\n <Spinner {...spinnerProps} />\n {loadingText && loadingText}\n\n <div\n aria-hidden\n className={cx('gap-md', loadingText ? 'hidden' : 'inline-flex opacity-0')}\n >\n {slotted}\n </div>\n </>\n ) : (\n slotted\n )\n )}\n </Component>\n )\n}\n\nButton.displayName = 'Button'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nconst defaultVariants = {\n intent: 'current',\n size: 'current',\n isBackgroundVisible: false,\n} as const\n\nexport const spinnerStyles = cva(\n ['inline-block', 'border-solid', 'rounded-full', 'border-md', 'animate-spin'],\n {\n variants: {\n /**\n * Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.\n */\n size: {\n current: ['u-current-font-size'],\n sm: ['w-sz-20', 'h-sz-20'],\n md: ['w-sz-28', 'h-sz-28'],\n full: ['w-full', 'h-full'],\n },\n /**\n * Color scheme of the spinner.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['border-current'],\n main: ['border-main'],\n support: ['border-support'],\n accent: ['border-accent'],\n basic: ['border-basic'],\n success: ['border-success'],\n alert: ['border-alert'],\n error: ['border-error'],\n info: ['border-info'],\n neutral: ['border-neutral'],\n }),\n /**\n * Size of the button.\n */\n isBackgroundVisible: {\n true: ['border-b-neutral-container', 'border-l-neutral-container'],\n false: ['border-b-transparent', 'border-l-transparent'],\n },\n },\n defaultVariants,\n }\n)\n\nexport type SpinnerStylesProps = VariantProps<typeof spinnerStyles>\n","import { ComponentPropsWithRef, PropsWithChildren } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { spinnerStyles, SpinnerStylesProps } from './Spinner.styles'\n\nexport interface SpinnerProps extends ComponentPropsWithRef<'div'>, SpinnerStylesProps {\n /**\n * Use `label` prop for accessibility, it is important to add a fallback loading text. This text will be visible to screen readers.\n */\n label?: string\n}\n\nexport const Spinner = ({\n className,\n size = 'current',\n intent = 'current',\n label,\n isBackgroundVisible,\n ref,\n ...others\n}: PropsWithChildren<SpinnerProps>) => {\n return (\n <span\n role=\"status\"\n data-spark-component=\"spinner\"\n ref={ref}\n className={spinnerStyles({ className, size, intent, isBackgroundVisible })}\n {...others}\n >\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </span>\n )\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport {\n contrastVariants,\n filledVariants,\n ghostVariants,\n outlinedVariants,\n tintedVariants,\n} from './variants'\n\nexport const buttonStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'text-body-1 font-bold',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Main style of the button.\n *\n * - `filled`: Button will be plain.\n *\n * - `outlined`: Button will be transparent with an outline.\n *\n * - `tinted`: Button will be filled but using a lighter color scheme.\n *\n * - `ghost`: Button will look like a link. No borders, plain text.\n *\n * - `contrast`: Button will be surface filled. No borders, plain text.\n *\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted', 'ghost', 'contrast']>({\n filled: [],\n outlined: ['bg-transparent', 'border-sm', 'border-current'],\n tinted: [],\n ghost: ['default:-mx-md px-md hover:bg-main/dim-5'],\n contrast: [],\n }),\n underline: {\n true: ['underline'],\n },\n /**\n * Color scheme of the button.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32', 'h-sz-32'],\n md: ['min-w-sz-44', 'h-sz-44'],\n lg: ['min-w-sz-56', 'h-sz-56'],\n }),\n /**\n * Shape of the button.\n */\n shape: makeVariants<'shape', ['rounded', 'square', 'pill']>({\n rounded: ['rounded-lg'],\n square: ['rounded-0'],\n pill: ['rounded-full'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed', 'opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n compoundVariants: [\n ...filledVariants,\n ...outlinedVariants,\n ...tintedVariants,\n ...ghostVariants,\n ...contrastVariants,\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'main',\n size: 'md',\n shape: 'rounded',\n },\n }\n)\n\nexport type ButtonStylesProps = VariantProps<typeof buttonStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n // Main\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main',\n 'text-on-main',\n 'hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'focus-visible:bg-main-hovered',\n ]),\n },\n // Support\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support',\n 'text-on-support',\n 'hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'focus-visible:bg-support-hovered',\n ]),\n },\n // Accent\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent',\n 'text-on-accent',\n 'hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'focus-visible:bg-accent-hovered',\n ]),\n },\n // Basic\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic',\n 'text-on-basic',\n 'hover:bg-basic-hovered',\n 'enabled:active:bg-basic-hovered',\n 'focus-visible:bg-basic-hovered',\n ]),\n },\n // Success\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success',\n 'text-on-success',\n 'hover:bg-success-hovered',\n 'enabled:active:bg-success-hovered',\n 'focus-visible:bg-success-hovered',\n ]),\n },\n // Alert\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert',\n 'text-on-alert',\n 'hover:bg-alert-hovered',\n 'enabled:active:bg-alert-hovered',\n 'focus-visible:bg-alert-hovered',\n ]),\n },\n // Danger\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error',\n 'hover:bg-error-hovered enabled:active:bg-error-hovered',\n 'focus-visible:bg-error-hovered',\n ]),\n },\n // Info\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info',\n 'hover:bg-info-hovered enabled:active:bg-info-hovered',\n 'focus-visible:bg-info-hovered',\n ]),\n },\n // Neutral\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral',\n 'text-on-neutral',\n 'hover:bg-neutral-hovered',\n 'enabled:active:bg-neutral-hovered',\n 'focus-visible:bg-neutral-hovered',\n ]),\n },\n // Surface\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'filled',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const ghostVariants = [\n {\n intent: 'main',\n design: 'ghost',\n class: tw([\n 'text-main',\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n ]),\n },\n {\n intent: 'support',\n design: 'ghost',\n class: tw([\n 'text-support',\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n ]),\n },\n {\n intent: 'accent',\n design: 'ghost',\n class: tw([\n 'text-accent',\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n ]),\n },\n {\n intent: 'basic',\n design: 'ghost',\n class: tw([\n 'text-basic',\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n ]),\n },\n {\n intent: 'success',\n design: 'ghost',\n class: tw([\n 'text-success',\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n ]),\n },\n {\n intent: 'alert',\n design: 'ghost',\n class: tw([\n 'text-alert',\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n ]),\n },\n {\n intent: 'danger',\n design: 'ghost',\n class: tw([\n 'text-error',\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n ]),\n },\n {\n intent: 'info',\n design: 'ghost',\n class: tw([\n 'text-info',\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n ]),\n },\n {\n intent: 'neutral',\n design: 'ghost',\n class: tw([\n 'text-neutral',\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n ]),\n },\n {\n intent: 'surface',\n design: 'ghost',\n class: tw([\n 'text-surface',\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'ghost',\n class: tw([\n 'text-surface-inverse',\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw([\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n 'text-main',\n ]),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw([\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n 'text-support',\n ]),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw([\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n 'text-accent',\n ]),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw([\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n 'text-basic',\n ]),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw([\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n 'text-success',\n ]),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw([\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n 'text-alert',\n ]),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw([\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n 'text-error',\n ]),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw([\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n 'text-info',\n ]),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw([\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n 'text-neutral',\n ]),\n },\n {\n intent: 'surface',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n 'text-surface',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n 'text-surface-inverse',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container',\n 'text-on-main-container',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container',\n 'text-on-support-container',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container',\n 'text-on-accent-container',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container',\n 'text-on-basic-container',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container',\n 'text-on-success-container',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container',\n 'text-on-alert-container',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container',\n 'text-on-error-container',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container',\n 'text-on-info-container',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container',\n 'text-on-neutral-container',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'tinted',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const contrastVariants = [\n {\n intent: 'main',\n design: 'contrast',\n class: tw([\n 'text-main bg-surface',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'contrast',\n class: tw([\n 'text-support bg-surface',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'contrast',\n class: tw([\n 'text-accent bg-surface',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'contrast',\n class: tw([\n 'text-basic bg-surface',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'contrast',\n class: tw([\n 'text-success bg-surface',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'contrast',\n class: tw([\n 'text-alert bg-surface',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'contrast',\n class: tw([\n 'text-error bg-surface',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'contrast',\n class: tw([\n 'text-info bg-surface',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'contrast',\n class: tw([\n 'text-neutral bg-surface',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'contrast',\n class: tw([\n 'text-on-surface bg-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'contrast',\n class: tw([\n 'text-on-surface-inverse bg-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, useEffect, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface Props {\n children?: ReactNode\n 'aria-label': string\n index: number\n className?: string\n unstyled?: boolean\n intent?: 'basic' | 'surface'\n}\n\nexport const CarouselPageIndicator = ({\n children,\n unstyled = false,\n index,\n 'aria-label': ariaLabel,\n className,\n intent = 'basic',\n}: Props) => {\n const ctx = useCarouselContext()\n\n const ref = useRef<HTMLButtonElement | null>(null)\n\n useEffect(() => {\n if (ctx.pageIndicatorsRefs.current) {\n ctx.pageIndicatorsRefs.current[index] = ref.current\n }\n })\n\n const styles = cx(\n 'group h-sz-16 relative flex',\n 'hover:cursor-pointer',\n 'w-sz-16 data-[state=active]:w-sz-44'\n )\n\n const dotsStyles = cx(\n 'before:rounded-sm before:block before:size-md',\n 'before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',\n 'data-[state=active]:before:w-sz-32',\n intent === 'surface'\n ? 'data-[state=active]:before:bg-surface data-[state=inactive]:before:bg-surface/dim-2'\n : 'data-[state=active]:before:bg-basic data-[state=inactive]:before:bg-on-surface/dim-2'\n )\n\n return (\n <button\n data-spark-component=\"carousel-page-indicator\"\n ref={ref}\n key={index}\n {...ctx.getIndicatorProps({ index })}\n aria-label={ariaLabel}\n className={cx(\n {\n [styles]: !unstyled,\n [dotsStyles]: !unstyled,\n },\n className\n )}\n >\n {children}\n </button>\n )\n}\n\nCarouselPageIndicator.displayName = 'Carousel.PageIndicator'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselAPI } from './types'\n\ninterface RenderProps extends CarouselAPI {\n pages: number[]\n}\n\ninterface Props {\n children: (renderProps: RenderProps) => ReactNode\n className?: string\n}\n\nexport const CarouselPagePicker = ({ children, className }: Props) => {\n const ctx = useCarouselContext()\n\n return (\n <>\n <div\n data-spark-component=\"carousel-page-picker\"\n {...ctx.getIndicatorGroupProps()}\n className={cx(\n 'default:min-h-sz-16 flex w-full flex-wrap items-center justify-center',\n ctx.pagePickerInset && 'bottom-sz-12 absolute inset-x-0',\n className\n )}\n >\n {ctx.pageSnapPoints.length <= 1\n ? null\n : children({\n ...ctx,\n pages: Array.from({ length: ctx.pageSnapPoints.length }, (_, i) => i),\n })}\n </div>\n </>\n )\n}\n\nCarouselPagePicker.displayName = 'Carousel.PagePicker'\n","import { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselPrevButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-prev-button\"\n {...ctx.getPrevTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselPrevButton.displayName = 'Carousel.PrevButton'\n","import { cx } from 'class-variance-authority'\nimport { ComponentProps, ReactNode, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { useIsVisible } from './useIsVisible'\n\nexport interface CarouselSlideProps extends ComponentProps<'div'> {\n isSnapPoint?: boolean\n children?: ReactNode\n index?: number\n totalSlides?: number\n className?: string\n}\n\nexport const CarouselSlide = ({\n children,\n index = 0,\n totalSlides,\n className = '',\n ...props\n}: CarouselSlideProps) => {\n const itemRef = useRef<HTMLDivElement>(null)\n const ctx = useCarouselContext()\n\n const isVisible = useIsVisible(itemRef, ctx.ref)\n\n return (\n <div\n data-spark-component=\"carousel-slide\"\n ref={itemRef}\n {...ctx.getSlideProps({ index, totalSlides: totalSlides as number })}\n className={cx('default:bg-surface relative overflow-hidden', className)}\n aria-hidden={!isVisible}\n inert={!isVisible}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselSlide.displayName = 'Carousel.Slide'\n","import { useLayoutEffect, useState, RefObject } from 'react'\n\nexport function useIsVisible(\n elementRef: RefObject<HTMLElement | null>,\n parentRef: RefObject<HTMLElement | null>\n) {\n const [isVisible, setIsVisible] = useState(true)\n\n useLayoutEffect(() => {\n const el = elementRef.current\n const parent = parentRef.current\n\n if (!parent || !el) return\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry) {\n setIsVisible(entry.isIntersecting)\n }\n },\n { root: parent, threshold: 0.2 }\n )\n\n observer.observe(el)\n\n return () => observer.disconnect()\n })\n\n return isVisible\n}\n","import { cx } from 'class-variance-authority'\nimport { Children, cloneElement, ComponentProps, isValidElement, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselSlideProps } from './CarouselSlide'\n\ninterface Props extends ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nexport const CarouselSlides = ({ children, className = '' }: Props) => {\n const ctx = useCarouselContext()\n\n const childrenElements = Children.toArray(children)\n\n return (\n <div\n data-spark-component=\"carousel-slides\"\n {...ctx.getSlidesContainerProps()}\n className={cx(\n 'focus-visible:u-outline relative w-full',\n '[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n className\n )}\n >\n {childrenElements.map((child, index) =>\n isValidElement<CarouselSlideProps>(child)\n ? cloneElement(child, {\n index,\n totalSlides: childrenElements.length,\n })\n : child\n )}\n </div>\n )\n}\n\nCarouselSlides.displayName = 'Carousel.Slides'\n","import { ReactNode } from 'react'\n\ninterface Props {\n children: ReactNode\n}\n\nexport const CarouselViewport = ({ children }: Props) => {\n return <div className=\"relative flex items-center justify-around p-0\">{children}</div>\n}\n\nCarouselViewport.displayName = 'Carousel.Viewport'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,kBAAAA;AAAA;AAAA;;;ACAA,sCAAmB;AACnB,IAAAC,gBAAqE;;;ACArE,IAAAC,gBAQO;;;ACTP,mBAAqD;AAQ9C,SAAS,SAAgC,UAAc;AAC5D,QAAM,UAAM,qBAAgC,MAAM;AAChD,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE,CAAC;AAED,oCAAgB,MAAM;AACpB,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,aAAO,0BAAyB,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC;AACzE;;;AClBA,IAAAC,gBAAkC;AAE3B,IAAM,eAAe,MAAM;AAChC,QAAM,gBAAY,sBAAO,KAAK;AAE9B,+BAAU,MAAM;AACd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AAC;AAAA,MACP,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,cAAc,cAAc;;;AEzC5B,IAAAC,oCAAmB;AACnB,IAAAC,iBAAkF;AAgB9E,IAAAC,uBAAA;AANG,IAAM,iBAAiB,CAAC,EAAE,UAAU,YAAY,GAAG,MAAa;AACrE,QAAM,MAAM,mBAAmB;AAE/B,QAAM,mBAAmB,wBAAS,QAAQ,QAAQ;AAElD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACpB,GAAG,IAAI,wBAAwB;AAAA,MAChC,eAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC,2BAAiB;AAAA,QAAI,CAAC,OAAO,cAC5B,+BAAmC,KAAK,QACpC,6BAAa,OAAO;AAAA,UAClB;AAAA,UACA,aAAa,iBAAiB;AAAA,QAChC,CAAC,IACD;AAAA,MACN;AAAA;AAAA,EACF;AAEJ;AAEA,eAAe,cAAc;;;AC/BpB,IAAAC,uBAAA;AADF,IAAM,mBAAmB,CAAC,EAAE,SAAS,MAAa;AACvD,SAAO,8CAAC,SAAI,WAAU,iDAAiD,UAAS;AAClF;AAEA,iBAAiB,cAAc;;;AhCAxB,IAAMC,YAST,OAAO,OAAO,UAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,UAAS,cAAc;","names":["Carousel","import_react","import_react","import_react","import_react","import_react","import_react","import_class_variance_authority","import_jsx_runtime","import_react","import_react","import_jsx_runtime","RadixSlot","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_react","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_react","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_jsx_runtime","Carousel"]}
|
|
1
|
+
{"version":3,"sources":["../../src/carousel/index.ts","../../src/carousel/Carousel.tsx","../../src/carousel/useCarousel.ts","../../src/carousel/useEvent.ts","../../src/carousel/useIsMounted.ts","../../src/carousel/useScrollEnd.ts","../../src/carousel/useSnapPoints.ts","../../src/carousel/useResizeObserver.ts","../../src/carousel/utils.ts","../../src/carousel/CarouselControls.tsx","../../src/carousel/CarouselNextButton.tsx","../../src/icon/Icon.tsx","../../src/slot/Slot.tsx","../../src/visually-hidden/VisuallyHidden.tsx","../../src/icon/Icon.styles.tsx","../../src/button/Button.tsx","../../src/spinner/Spinner.styles.tsx","../../src/spinner/Spinner.tsx","../../src/button/Button.styles.tsx","../../src/button/variants/filled.ts","../../src/button/variants/ghost.ts","../../src/button/variants/outlined.ts","../../src/button/variants/tinted.ts","../../src/button/variants/contrast.ts","../../src/icon-button/IconButton.styles.tsx","../../src/icon-button/IconButton.tsx","../../src/carousel/CarouselPageIndicator.tsx","../../src/carousel/CarouselPagePicker.tsx","../../src/carousel/CarouselPrevButton.tsx","../../src/carousel/CarouselSlide.tsx","../../src/carousel/useIsVisible.ts","../../src/carousel/CarouselSlides.tsx","../../src/carousel/CarouselViewport.tsx"],"sourcesContent":["import { Carousel as Root } from './Carousel'\nimport { CarouselControls as Controls } from './CarouselControls'\nimport { CarouselNextButton as NextButton } from './CarouselNextButton'\nimport { CarouselPageIndicator as PageIndicator } from './CarouselPageIndicator'\nimport { CarouselPagePicker as PagePicker } from './CarouselPagePicker'\nimport { CarouselPrevButton as PrevButton } from './CarouselPrevButton'\nimport { CarouselSlide as Slide } from './CarouselSlide'\nimport { CarouselSlides as Slides } from './CarouselSlides'\nimport { CarouselViewport as Viewport } from './CarouselViewport'\n\nexport const Carousel: typeof Root & {\n Controls: typeof Controls\n NextButton: typeof NextButton\n PrevButton: typeof PrevButton\n Slide: typeof Slide\n Slides: typeof Slides\n Viewport: typeof Viewport\n PagePicker: typeof PagePicker\n PageIndicator: typeof PageIndicator\n} = Object.assign(Root, {\n Controls,\n NextButton,\n PrevButton,\n Slide,\n Slides,\n Viewport,\n PagePicker,\n PageIndicator,\n})\n\nCarousel.displayName = 'Carousel'\n","import { cx } from 'class-variance-authority'\nimport { ComponentProps, createContext, ReactNode, useContext } from 'react'\n\nimport { CarouselAPI, UseCarouselProps } from './types'\nimport { useCarousel } from './useCarousel'\n\ninterface Props extends UseCarouselProps, ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nconst CarouselContext = createContext<CarouselAPI | null>(null)\n\nexport const Carousel = ({\n className,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollBehavior = 'smooth',\n slidesPerMove = 'auto',\n pagePickerInset = false,\n slidesPerPage = 1,\n loop = false,\n children,\n gap = 16,\n defaultPage,\n page,\n onPageChange,\n maxDots = 5,\n ...props\n}: Props) => {\n const carouselApi = useCarousel({\n defaultPage,\n slidesPerPage,\n slidesPerMove,\n loop,\n gap,\n scrollBehavior,\n snapStop,\n snapType,\n page,\n pagePickerInset,\n onPageChange,\n maxDots,\n })\n\n return (\n <CarouselContext.Provider\n value={{\n ...carouselApi,\n scrollBehavior,\n }}\n >\n <div\n data-spark-component=\"carousel\"\n className={cx('gap-lg relative box-border flex flex-col', className)}\n {...carouselApi.getRootProps()}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nCarousel.displayName = 'Carousel'\n\nexport const useCarouselContext = () => {\n const context = useContext(CarouselContext)\n\n if (!context) {\n throw Error('useCarouselContext must be used within a Carousel provider')\n }\n\n return context\n}\n","/* eslint-disable max-lines-per-function */\nimport {\n KeyboardEvent,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\n\nimport {\n CarouselAPI,\n ComputedControlProps,\n ComputedIndicatorGroupProps,\n ComputedIndicatorProps,\n ComputedRootProps,\n ComputedSlideGroupProps,\n ComputedSlideProps,\n ComputedTriggerProps,\n UseCarouselProps,\n} from './types'\nimport { useEvent } from './useEvent'\nimport { useIsMounted } from './useIsMounted'\nimport { useScrollEnd } from './useScrollEnd'\nimport { useSnapPoints } from './useSnapPoints'\nimport { computeDotState, getSnapPositions, isSnapPoint } from './utils'\n\nconst DATA_SCOPE = 'carousel' as const\nconst DIRECTION = 'ltr' as const\n\nexport const useCarousel = ({\n defaultPage,\n gap = 16,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollPadding = 0,\n slidesPerPage = 1,\n slidesPerMove = 'auto',\n scrollBehavior = 'smooth',\n loop = false,\n pagePickerInset = false,\n maxDots = 5,\n // state control\n page: controlledPage,\n onPageChange: onPageChangeProp,\n}: UseCarouselProps): CarouselAPI => {\n const carouselId = useId()\n const [pageState, setPageState] = useState(defaultPage || controlledPage || 0)\n\n const carouselRef = useRef<HTMLDivElement>(null)\n const pageIndicatorsRefs = useRef<(HTMLElement | null)[]>([])\n const isMountedRef = useIsMounted()\n const isMounted = isMountedRef.current\n const onPageChange = useEvent(onPageChangeProp)\n\n const [pageSnapPoints] = useSnapPoints([], {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n })\n\n const canScrollPrev = useRef(loop || pageState > 0)\n const canScrollNext = useRef(loop || pageState < pageSnapPoints.length - 1)\n canScrollPrev.current = loop || pageState > 0\n canScrollNext.current = loop || pageState < pageSnapPoints.length - 1\n\n const handlePageChange = useCallback(\n (page: number) => {\n if (page !== pageState) {\n setPageState(page)\n onPageChange?.(page)\n }\n },\n [onPageChange, pageState]\n )\n\n const scrollTo = useCallback(\n (page: number, behavior: 'instant' | 'smooth') => {\n if (carouselRef.current) {\n carouselRef.current.scrollTo({\n left: pageSnapPoints[page],\n behavior: behavior === 'instant' ? 'auto' : 'smooth',\n })\n handlePageChange(page)\n }\n },\n [handlePageChange, pageSnapPoints]\n )\n\n const scrollPrev = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollPrev) {\n const targetPage =\n loop && pageState === 0 ? pageSnapPoints.length - 1 : Math.max(pageState - 1, 0)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n const scrollNext = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollNext) {\n const targetPage =\n loop && pageState === pageSnapPoints.length - 1\n ? 0\n : Math.min(pageState + 1, pageSnapPoints.length - 1)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n useEffect(() => {\n if (controlledPage != null) {\n scrollTo(controlledPage, scrollBehavior)\n }\n }, [controlledPage, scrollBehavior, scrollTo])\n\n /**\n * Set the default scroll position of the carousel based on `defaultPage`.\n * As this operation is done before the snap points are set in the state, we have to get them from the ref directly.\n */\n useLayoutEffect(() => {\n if (defaultPage != null && !isMounted && carouselRef.current) {\n const snapPositions = getSnapPositions({\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n carouselRef.current.scrollTo({\n left: snapPositions[defaultPage],\n behavior: 'instant',\n })\n }\n }, [defaultPage, isMounted, slidesPerMove, slidesPerPage])\n\n /**\n * Monitoring scrollend events inside the scrollable area to sync the carousel active page with current scroll position.\n * Scrollend has been chosen over \"scroll\" for performance reason.\n */\n const syncPageStateWithScrollPosition = useCallback(() => {\n if (!carouselRef.current || pageSnapPoints.length === 0) return\n\n const { scrollLeft } = carouselRef.current\n\n const distances = pageSnapPoints.map(pagePosition => Math.abs(scrollLeft - pagePosition))\n const pageInViewport = distances.indexOf(Math.min(...distances))\n\n if (pageInViewport !== -1) {\n handlePageChange(pageInViewport)\n }\n }, [pageSnapPoints, handlePageChange])\n\n useScrollEnd(carouselRef, syncPageStateWithScrollPosition)\n\n const contextValue: CarouselAPI = {\n ref: carouselRef,\n pageIndicatorsRefs,\n // props\n gap,\n snapType,\n snapStop,\n scrollPadding,\n slidesPerPage,\n slidesPerMove,\n scrollBehavior,\n loop,\n pagePickerInset,\n maxDots,\n // computed state\n page: pageState,\n pageSnapPoints,\n canScrollNext: canScrollNext.current,\n canScrollPrev: canScrollPrev.current,\n scrollTo,\n scrollPrev,\n scrollNext,\n // anatomy\n getRootProps: (): ComputedRootProps => ({\n id: `carousel::${carouselId}:`,\n role: 'region',\n 'aria-roledescription': 'carousel',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'root',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n '--slides-per-page': slidesPerPage,\n '--slide-spacing': `${gap}px`,\n '--slide-item-size':\n 'calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))',\n },\n }),\n\n getControlProps: (): ComputedControlProps => ({\n 'data-scope': DATA_SCOPE,\n 'data-part': 'control',\n 'data-orientation': 'horizontal',\n }),\n\n getPrevTriggerProps: (): ComputedTriggerProps<'prev-trigger'> => ({\n id: `carousel::${carouselId}::prev-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'prev-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollPrev.current,\n onClick: () => scrollPrev(),\n }),\n\n getNextTriggerProps: (): ComputedTriggerProps<'next-trigger'> => ({\n id: `carousel::${carouselId}::next-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'next-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollNext.current,\n onClick: () => scrollNext(),\n }),\n\n getSlidesContainerProps: (): ComputedSlideGroupProps => ({\n id: `carousel::${carouselId}::item-group`,\n /**\n * The carousel pattern was originally designed for a single slide.\n * When there is more than one slide, the aria-live region is set to off to avoid announcing the whole list of slides.\n * This is not ideal but we keep it for backwards compatibility.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/carousel/#wai-aria-attributes\n */\n 'aria-live': slidesPerPage > 1 ? 'off' : 'polite',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n tabIndex: 0,\n style: {\n display: 'grid',\n gap: 'var(--slide-spacing)',\n scrollSnapType: `x ${snapType}`,\n gridAutoFlow: 'column',\n scrollbarWidth: 'none',\n gridAutoColumns: 'var(--slide-item-size)',\n overflowX: 'auto',\n },\n ref: carouselRef,\n }),\n\n getSlideProps: ({ index }): ComputedSlideProps => {\n const isStopPoint = isSnapPoint(index, {\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n return {\n id: `carousel::${carouselId}::item:${index}`,\n role: 'group',\n 'aria-roledescription': 'slide',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item',\n 'data-index': index,\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n ...(isStopPoint && {\n scrollSnapAlign: 'start',\n scrollSnapStop: snapStop,\n }),\n },\n }\n },\n\n getIndicatorGroupProps: (): ComputedIndicatorGroupProps => ({\n role: 'radiogroup',\n id: `carousel::${carouselId}::indicator-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n }),\n\n getIndicatorProps: ({ index }): ComputedIndicatorProps => {\n const dotState = computeDotState({\n dotIndex: index,\n pageState,\n totalPages: pageSnapPoints.length,\n maxDots,\n })\n\n return {\n role: 'radio',\n id: `carousel::${carouselId}::indicator:${index}`,\n 'aria-checked': index === pageState,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator',\n 'data-orientation': 'horizontal',\n 'data-index': index,\n 'data-state': dotState,\n tabIndex: index === pageState ? 0 : -1,\n onClick: () => {\n scrollTo(index, scrollBehavior)\n },\n onKeyDown: (event: KeyboardEvent) => {\n const focusActiveIndicator = (page: number) => {\n pageIndicatorsRefs.current[page]?.focus()\n }\n\n if (event.key === 'ArrowRight' && canScrollNext) {\n scrollNext(focusActiveIndicator)\n } else if (event.key === 'ArrowLeft' && canScrollPrev) {\n scrollPrev(focusActiveIndicator)\n }\n },\n }\n },\n }\n\n return contextValue\n}\n","import { useCallback, useLayoutEffect, useRef } from 'react'\n\ntype AnyFunction = (...args: any[]) => any\n\n/**\n * Directly from this gist: https://gist.github.com/diegohaz/695097a06f038a707c3a1b11e4e40195\n * Until React releases a native `useEvent` hook.\n */\nexport function useEvent<T extends AnyFunction>(callback?: T) {\n const ref = useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.')\n })\n\n useLayoutEffect(() => {\n ref.current = callback\n })\n\n return useCallback<AnyFunction>((...args) => ref.current?.(...args), []) as T\n}\n","import { useEffect, useRef } from 'react'\n\nexport const useIsMounted = () => {\n const isMounted = useRef(false)\n\n useEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","import { useEffect, useRef, RefObject } from 'react'\n\nexport function useScrollEnd(scrollRef: RefObject<HTMLDivElement | null>, callback: () => void) {\n const scrollLeft = useRef(0)\n\n /**\n * Safari (and some smaller browsers) to not yet support the `scrollend` event.\n * For those we must rely on the `scroll` event and and an idle state delay to trigger the \"scroll end\".\n *\n * Caveats:\n * - when using a trackpad or your fingers on a touch device, scrolling then holding the position might trigger the \"scrollend\" callback too early.\n */\n const safariTimeout = useRef<NodeJS.Timeout | null>(null)\n\n useEffect(() => {\n const element = scrollRef.current\n if (!element) return\n\n const supportsScrollend = 'onscrollend' in window\n\n const handleScrollEnd = () => {\n callback()\n }\n\n const handleSafariScroll = () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (scrollRef.current) {\n scrollLeft.current = scrollRef.current.scrollLeft\n\n safariTimeout.current = setTimeout(() => {\n if (scrollRef.current) {\n handleScrollEnd()\n }\n }, 150)\n }\n }\n\n if (supportsScrollend) {\n element.addEventListener('scrollend', handleScrollEnd)\n } else {\n element.addEventListener('scroll', handleSafariScroll)\n }\n\n return () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (supportsScrollend) {\n element.removeEventListener('scrollend', handleScrollEnd)\n } else {\n element.removeEventListener('scroll', handleSafariScroll)\n }\n }\n }, [callback, scrollRef])\n}\n\nexport default useScrollEnd\n","import { useMemo, useState, RefObject } from 'react'\n\nimport { useResizeObserver } from './useResizeObserver'\nimport { getSnapPositions } from './utils'\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * The array is updated when resize event are caught in the carousel.\n */\nexport function useSnapPoints<T extends HTMLDivElement | null>(\n initialSnapPoints: number[] = [],\n {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n }: {\n carouselRef: RefObject<T>\n slidesPerMove: 'auto' | number\n slidesPerPage: number\n }\n) {\n const [pageSnapPoints, setPageSnapPoints] = useState(initialSnapPoints)\n\n const stableSnapPoints = useMemo(() => pageSnapPoints, [pageSnapPoints])\n\n /**\n * On resize, dimensions of the carousel might changes, which requires to update the snap points positions in the state.\n */\n useResizeObserver(carouselRef, () => {\n const newSnapPoints = getSnapPositions({\n slidesPerMove,\n slidesPerPage,\n container: carouselRef.current,\n })\n\n if (JSON.stringify(pageSnapPoints) !== JSON.stringify(newSnapPoints)) {\n setPageSnapPoints(newSnapPoints)\n }\n })\n\n return [stableSnapPoints, setPageSnapPoints] as const\n}\n","import { useLayoutEffect, RefObject } from 'react'\n\nexport function useResizeObserver<T extends HTMLElement | null>(\n ref: RefObject<T>,\n callback: (width: number) => void\n) {\n useLayoutEffect(() => {\n const element = ref.current\n if (!element) return\n\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n callback(entry.contentRect.width)\n }\n })\n\n observer.observe(element)\n\n return () => observer.disconnect() // Cleanup on unmount\n }, [ref, callback])\n}\n","/**\n * Get the indices of each slides that serves as the start of a page\n * @returns number[] (ex: [0, 2, 4])\n */\nfunction getSnapIndices({\n totalSlides,\n slidesPerMove,\n slidesPerPage,\n}: {\n totalSlides: number\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n const slideBy = slidesPerMove === 'auto' ? slidesPerPage : slidesPerMove\n const snapPoints: number[] = []\n\n const lastSnapIndex = Math.floor((totalSlides - slidesPerPage) / slideBy) * slideBy\n\n for (let i = 0; i <= lastSnapIndex; i += slideBy) {\n snapPoints.push(i)\n }\n\n // Adding final snap point if necessary\n if (snapPoints[snapPoints.length - 1] !== totalSlides - slidesPerPage) {\n snapPoints.push(totalSlides - slidesPerPage)\n }\n\n return snapPoints\n}\n\nexport function getSlideElements(container: HTMLDivElement | null): Element[] {\n return container ? Array.from(container.querySelectorAll('[data-part=\"item\"]')) : []\n}\n\nexport function isSnapPoint(\n slideIndex: number,\n {\n container,\n slidesPerMove,\n slidesPerPage,\n }: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n }\n) {\n return getSnapIndices({\n totalSlides: getSlideElements(container).length,\n slidesPerPage,\n slidesPerMove,\n }).includes(slideIndex)\n}\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * @returns number[] (ex for a 400px carousel with no gap: [400, 800, 1200])\n */\nexport function getSnapPositions({\n container,\n slidesPerMove,\n slidesPerPage,\n}: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n if (!container) return []\n\n return getSlideElements(container)\n .filter((_, index) => {\n return isSnapPoint(index, {\n slidesPerMove,\n slidesPerPage,\n container,\n })\n })\n .map(slide => (slide as HTMLElement).offsetLeft)\n}\n\n/**\n * Calculate the state of a dot indicator of a carousel depending on the current page and the total number of pages.\n */\nexport function computeDotState({\n dotIndex,\n pageState,\n totalPages,\n maxDots = 5,\n}: {\n dotIndex: number\n pageState: number\n totalPages: number\n maxDots?: number\n}): 'active' | 'edge' | 'idle' | 'hidden' {\n if (totalPages <= maxDots) {\n return dotIndex === pageState ? 'active' : 'idle'\n }\n\n if (pageState <= Math.floor(maxDots / 2)) {\n if (dotIndex > maxDots - 1) return 'hidden'\n if (dotIndex === pageState) return 'active'\n if (dotIndex === maxDots - 1) return 'edge'\n\n return 'idle'\n }\n\n if (pageState >= totalPages - Math.ceil(maxDots / 2)) {\n const startIndex = totalPages - maxDots\n if (dotIndex < startIndex) return 'hidden'\n if (dotIndex === pageState) return 'active'\n if (dotIndex === startIndex) return 'edge'\n\n return 'idle'\n }\n\n const startIndex = pageState - Math.floor(maxDots / 2)\n const endIndex = pageState + Math.floor(maxDots / 2)\n if (dotIndex < startIndex || dotIndex > endIndex) return 'hidden'\n if (dotIndex === pageState) return 'active'\n if (dotIndex === startIndex || dotIndex === endIndex) return 'edge'\n\n return 'idle'\n}\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface ControlsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n}\n\nexport const CarouselControls = ({ children, className, ...props }: ControlsProps) => {\n const ctx = useCarouselContext()\n\n return (\n <div\n data-spark-component=\"carousel-controls\"\n className={cx(\n 'default:px-lg pointer-events-none absolute inset-0 flex flex-row items-center justify-between',\n className\n )}\n {...ctx.getControlProps()}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselControls.displayName = 'Carousel.Controls'\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselNextButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-next-button\"\n {...ctx.getNextTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselNextButton.displayName = 'Carousel.NextButton'\n","import { Children, cloneElement, ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { iconStyles, IconVariantsProps } from './Icon.styles'\n\nexport interface IconProps extends IconVariantsProps, ComponentPropsWithoutRef<'svg'> {\n /**\n * The svg icon that will be wrapped\n */\n children: ReactNode\n /**\n * The accessible label for the icon. This label will be visually hidden but announced to screen\n * reader users, similar to `alt` text for `img` tags.\n */\n label?: string\n}\n\nexport const Icon = ({\n label,\n className,\n size = 'current',\n intent = 'current',\n children,\n ...others\n}: IconProps) => {\n const child = Children.only(children)\n\n return (\n <>\n {cloneElement(child as ReactElement<Record<string, any>>, {\n className: iconStyles({ className, size, intent }),\n 'data-spark-component': 'icon',\n 'aria-hidden': 'true',\n focusable: 'false',\n ...others,\n })}\n\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </>\n )\n}\n\nIcon.displayName = 'Icon'\n","import { Slot as RadixSlot } from 'radix-ui'\nimport {\n cloneElement,\n HTMLAttributes,\n isValidElement,\n PropsWithChildren,\n ReactNode,\n Ref,\n} from 'react'\n\nexport const Slottable: typeof RadixSlot.Slottable = RadixSlot.Slottable\n\nexport type SlotProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n ref?: Ref<HTMLElement>\n}\n\nexport const Slot = ({ ref, ...props }: SlotProps) => {\n return <RadixSlot.Root ref={ref} {...props} />\n}\n\n/**\n * When using Radix `Slot` component, it will consider its first child to merge its props with.\n * In some cases, you might need to wrap the top child with additional markup without breaking this behaviour.\n */\nexport const wrapPolymorphicSlot = (\n asChild: boolean | undefined,\n children: ReactNode,\n callback: (children: ReactNode) => ReactNode\n) => {\n if (!asChild) return callback(children) // If polymorphic behaviour is not used, we keep the original children\n\n return isValidElement(children)\n ? cloneElement(\n children,\n undefined,\n callback((children.props as { children: ReactNode }).children)\n )\n : null\n}\n","import { HTMLAttributes, PropsWithChildren, Ref } from 'react'\n\nimport { Slot } from '../slot'\n\nexport type VisuallyHiddenProps = PropsWithChildren<HTMLAttributes<HTMLElement>> & {\n /**\n * Change the default rendered element for the one passed as a child, merging their props and behavior.\n */\n asChild?: boolean\n ref?: Ref<HTMLElement>\n}\n\nexport const VisuallyHidden = ({ asChild = false, ref, ...props }: VisuallyHiddenProps) => {\n const Component = asChild ? Slot : 'span'\n\n return (\n <Component\n {...props}\n ref={ref}\n style={{\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: 'absolute',\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: 'hidden',\n clip: 'rect(0, 0, 0, 0)',\n whiteSpace: 'nowrap',\n wordWrap: 'normal',\n ...props.style,\n }}\n />\n )\n}\n\nVisuallyHidden.displayName = 'VisuallyHidden'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nexport const iconStyles = cva(['fill-current shrink-0'], {\n variants: {\n /**\n * Color scheme of the icon.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['text-current'],\n main: ['text-main'],\n support: ['text-support'],\n accent: ['text-accent'],\n basic: ['text-basic'],\n success: ['text-success'],\n alert: ['text-alert'],\n error: ['text-error'],\n info: ['text-info'],\n neutral: ['text-neutral'],\n }),\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['current', 'sm', 'md', 'lg', 'xl']>({\n current: ['u-current-font-size'],\n sm: ['w-sz-16', 'h-sz-16'],\n md: ['w-sz-24', 'h-sz-24'],\n lg: ['w-sz-32', 'h-sz-32'],\n xl: ['w-sz-40', 'h-sz-40'],\n }),\n },\n})\n\nexport type IconVariantsProps = VariantProps<typeof iconStyles>\n","import { cx } from 'class-variance-authority'\nimport { ComponentPropsWithoutRef, type DOMAttributes, Ref, useMemo } from 'react'\n\nimport { Slot, wrapPolymorphicSlot } from '../slot'\nimport { Spinner, type SpinnerProps } from '../spinner'\nimport { buttonStyles, type ButtonStylesProps } from './Button.styles'\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<'button'>, 'disabled'>,\n ButtonStylesProps {\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: boolean\n /**\n * Display a spinner to indicate to the user that the button is loading something after they interacted with it.\n */\n isLoading?: boolean\n /**\n * If your loading state should only display a spinner, it's better to specify a label for it (a11y).\n */\n loadingLabel?: string\n /**\n * If your loading state should also display a label, you can use this prop instead of `loadingLabel`.\n * **Please note that using this can result in layout shifting when the Button goes from loading state to normal state.**\n */\n loadingText?: string\n ref?: Ref<HTMLButtonElement>\n}\n\ntype DOMAttributesEventHandler = keyof Omit<\n DOMAttributes<HTMLButtonElement>,\n 'children' | 'dangerouslySetInnerHTML'\n>\n\nconst blockedEventHandlers: DOMAttributesEventHandler[] = [\n 'onClick',\n 'onMouseDown',\n 'onMouseUp',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseOver',\n 'onMouseOut',\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n 'onSubmit',\n]\n\nexport const Button = ({\n children,\n design = 'filled',\n disabled = false,\n intent = 'main',\n isLoading = false,\n loadingLabel,\n loadingText,\n shape = 'rounded',\n size = 'md',\n asChild,\n className,\n underline = false,\n ref,\n ...others\n}: ButtonProps) => {\n const Component = asChild ? Slot : 'button'\n\n const shouldNotInteract = !!disabled || isLoading\n\n const disabledEventHandlers = useMemo(() => {\n const result: Partial<Record<DOMAttributesEventHandler, () => void>> = {}\n\n if (shouldNotInteract) {\n blockedEventHandlers.forEach(eventHandler => (result[eventHandler] = undefined))\n }\n\n return result\n }, [shouldNotInteract])\n\n const spinnerProps = {\n size: 'current' as SpinnerProps['size'],\n className: loadingText ? 'inline-block' : 'absolute',\n ...(loadingLabel && { 'aria-label': loadingLabel }),\n }\n\n return (\n <Component\n data-spark-component=\"button\"\n {...(Component === 'button' && { type: 'button' })}\n ref={ref}\n className={buttonStyles({\n className,\n design,\n disabled: shouldNotInteract,\n intent,\n shape,\n size,\n underline,\n })}\n disabled={!!disabled}\n aria-busy={isLoading}\n aria-live={isLoading ? 'assertive' : 'off'}\n {...others}\n {...disabledEventHandlers}\n >\n {wrapPolymorphicSlot(asChild, children, slotted =>\n isLoading ? (\n <>\n <Spinner {...spinnerProps} />\n {loadingText && loadingText}\n\n <div\n aria-hidden\n className={cx('gap-md', loadingText ? 'hidden' : 'inline-flex opacity-0')}\n >\n {slotted}\n </div>\n </>\n ) : (\n slotted\n )\n )}\n </Component>\n )\n}\n\nButton.displayName = 'Button'\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nconst defaultVariants = {\n intent: 'current',\n size: 'current',\n isBackgroundVisible: false,\n} as const\n\nexport const spinnerStyles = cva(\n ['inline-block', 'border-solid', 'rounded-full', 'border-md', 'animate-spin'],\n {\n variants: {\n /**\n * Use `size` prop to set the size of the spinner. If you want to set the full size for the spinner, don't forget to add a wrapping container with its own size.\n */\n size: {\n current: ['u-current-font-size'],\n sm: ['w-sz-20', 'h-sz-20'],\n md: ['w-sz-28', 'h-sz-28'],\n full: ['w-full', 'h-full'],\n },\n /**\n * Color scheme of the spinner.\n */\n intent: makeVariants<\n 'intent',\n [\n 'current',\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'error',\n 'info',\n 'neutral',\n ]\n >({\n current: ['border-current'],\n main: ['border-main'],\n support: ['border-support'],\n accent: ['border-accent'],\n basic: ['border-basic'],\n success: ['border-success'],\n alert: ['border-alert'],\n error: ['border-error'],\n info: ['border-info'],\n neutral: ['border-neutral'],\n }),\n /**\n * Size of the button.\n */\n isBackgroundVisible: {\n true: ['border-b-neutral-container', 'border-l-neutral-container'],\n false: ['border-b-transparent', 'border-l-transparent'],\n },\n },\n defaultVariants,\n }\n)\n\nexport type SpinnerStylesProps = VariantProps<typeof spinnerStyles>\n","import { ComponentPropsWithRef, PropsWithChildren } from 'react'\n\nimport { VisuallyHidden } from '../visually-hidden'\nimport { spinnerStyles, SpinnerStylesProps } from './Spinner.styles'\n\nexport interface SpinnerProps extends ComponentPropsWithRef<'div'>, SpinnerStylesProps {\n /**\n * Use `label` prop for accessibility, it is important to add a fallback loading text. This text will be visible to screen readers.\n */\n label?: string\n}\n\nexport const Spinner = ({\n className,\n size = 'current',\n intent = 'current',\n label,\n isBackgroundVisible,\n ref,\n ...others\n}: PropsWithChildren<SpinnerProps>) => {\n return (\n <span\n role=\"status\"\n data-spark-component=\"spinner\"\n ref={ref}\n className={spinnerStyles({ className, size, intent, isBackgroundVisible })}\n {...others}\n >\n {label && <VisuallyHidden>{label}</VisuallyHidden>}\n </span>\n )\n}\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\nimport {\n contrastVariants,\n filledVariants,\n ghostVariants,\n outlinedVariants,\n tintedVariants,\n} from './variants'\n\nexport const buttonStyles = cva(\n [\n 'u-shadow-border-transition',\n 'box-border inline-flex items-center justify-center gap-md whitespace-nowrap',\n 'default:px-lg',\n 'text-body-1 font-bold',\n 'focus-visible:u-outline',\n ],\n {\n variants: {\n /**\n * Main style of the button.\n *\n * - `filled`: Button will be plain.\n *\n * - `outlined`: Button will be transparent with an outline.\n *\n * - `tinted`: Button will be filled but using a lighter color scheme.\n *\n * - `ghost`: Button will look like a link. No borders, plain text.\n *\n * - `contrast`: Button will be surface filled. No borders, plain text.\n *\n */\n design: makeVariants<'design', ['filled', 'outlined', 'tinted', 'ghost', 'contrast']>({\n filled: [],\n outlined: ['bg-transparent', 'border-sm', 'border-current'],\n tinted: [],\n ghost: ['default:-mx-md px-md hover:bg-main/dim-5'],\n contrast: [],\n }),\n underline: {\n true: ['underline'],\n },\n /**\n * Color scheme of the button.\n */\n intent: makeVariants<\n 'intent',\n [\n 'main',\n 'support',\n 'accent',\n 'basic',\n 'success',\n 'alert',\n 'danger',\n 'info',\n 'neutral',\n 'surface',\n 'surfaceInverse',\n ]\n >({\n main: [],\n support: [],\n accent: [],\n basic: [],\n success: [],\n alert: [],\n danger: [],\n info: [],\n neutral: [],\n surface: [],\n surfaceInverse: [],\n }),\n /**\n * Size of the button.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['min-w-sz-32', 'h-sz-32'],\n md: ['min-w-sz-44', 'h-sz-44'],\n lg: ['min-w-sz-56', 'h-sz-56'],\n }),\n /**\n * Shape of the button.\n */\n shape: makeVariants<'shape', ['rounded', 'square', 'pill']>({\n rounded: ['rounded-lg'],\n square: ['rounded-0'],\n pill: ['rounded-full'],\n }),\n /**\n * Disable the button, preventing user interaction and adding opacity.\n */\n disabled: {\n true: ['cursor-not-allowed', 'opacity-dim-3'],\n false: ['cursor-pointer'],\n },\n },\n compoundVariants: [\n ...filledVariants,\n ...outlinedVariants,\n ...tintedVariants,\n ...ghostVariants,\n ...contrastVariants,\n ],\n defaultVariants: {\n design: 'filled',\n intent: 'main',\n size: 'md',\n shape: 'rounded',\n },\n }\n)\n\nexport type ButtonStylesProps = VariantProps<typeof buttonStyles>\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const filledVariants = [\n // Main\n {\n intent: 'main',\n design: 'filled',\n class: tw([\n 'bg-main',\n 'text-on-main',\n 'hover:bg-main-hovered',\n 'enabled:active:bg-main-hovered',\n 'focus-visible:bg-main-hovered',\n ]),\n },\n // Support\n {\n intent: 'support',\n design: 'filled',\n class: tw([\n 'bg-support',\n 'text-on-support',\n 'hover:bg-support-hovered',\n 'enabled:active:bg-support-hovered',\n 'focus-visible:bg-support-hovered',\n ]),\n },\n // Accent\n {\n intent: 'accent',\n design: 'filled',\n class: tw([\n 'bg-accent',\n 'text-on-accent',\n 'hover:bg-accent-hovered',\n 'enabled:active:bg-accent-hovered',\n 'focus-visible:bg-accent-hovered',\n ]),\n },\n // Basic\n {\n intent: 'basic',\n design: 'filled',\n class: tw([\n 'bg-basic',\n 'text-on-basic',\n 'hover:bg-basic-hovered',\n 'enabled:active:bg-basic-hovered',\n 'focus-visible:bg-basic-hovered',\n ]),\n },\n // Success\n {\n intent: 'success',\n design: 'filled',\n class: tw([\n 'bg-success',\n 'text-on-success',\n 'hover:bg-success-hovered',\n 'enabled:active:bg-success-hovered',\n 'focus-visible:bg-success-hovered',\n ]),\n },\n // Alert\n {\n intent: 'alert',\n design: 'filled',\n class: tw([\n 'bg-alert',\n 'text-on-alert',\n 'hover:bg-alert-hovered',\n 'enabled:active:bg-alert-hovered',\n 'focus-visible:bg-alert-hovered',\n ]),\n },\n // Danger\n {\n intent: 'danger',\n design: 'filled',\n class: tw([\n 'text-on-error bg-error',\n 'hover:bg-error-hovered enabled:active:bg-error-hovered',\n 'focus-visible:bg-error-hovered',\n ]),\n },\n // Info\n {\n intent: 'info',\n design: 'filled',\n class: tw([\n 'text-on-error bg-info',\n 'hover:bg-info-hovered enabled:active:bg-info-hovered',\n 'focus-visible:bg-info-hovered',\n ]),\n },\n // Neutral\n {\n intent: 'neutral',\n design: 'filled',\n class: tw([\n 'bg-neutral',\n 'text-on-neutral',\n 'hover:bg-neutral-hovered',\n 'enabled:active:bg-neutral-hovered',\n 'focus-visible:bg-neutral-hovered',\n ]),\n },\n // Surface\n {\n intent: 'surface',\n design: 'filled',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'filled',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const ghostVariants = [\n {\n intent: 'main',\n design: 'ghost',\n class: tw([\n 'text-main',\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n ]),\n },\n {\n intent: 'support',\n design: 'ghost',\n class: tw([\n 'text-support',\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n ]),\n },\n {\n intent: 'accent',\n design: 'ghost',\n class: tw([\n 'text-accent',\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n ]),\n },\n {\n intent: 'basic',\n design: 'ghost',\n class: tw([\n 'text-basic',\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n ]),\n },\n {\n intent: 'success',\n design: 'ghost',\n class: tw([\n 'text-success',\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n ]),\n },\n {\n intent: 'alert',\n design: 'ghost',\n class: tw([\n 'text-alert',\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n ]),\n },\n {\n intent: 'danger',\n design: 'ghost',\n class: tw([\n 'text-error',\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n ]),\n },\n {\n intent: 'info',\n design: 'ghost',\n class: tw([\n 'text-info',\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n ]),\n },\n {\n intent: 'neutral',\n design: 'ghost',\n class: tw([\n 'text-neutral',\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n ]),\n },\n {\n intent: 'surface',\n design: 'ghost',\n class: tw([\n 'text-surface',\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'ghost',\n class: tw([\n 'text-surface-inverse',\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const outlinedVariants = [\n {\n intent: 'main',\n design: 'outlined',\n class: tw([\n 'hover:bg-main/dim-5',\n 'enabled:active:bg-main/dim-5',\n 'focus-visible:bg-main/dim-5',\n 'text-main',\n ]),\n },\n {\n intent: 'support',\n design: 'outlined',\n class: tw([\n 'hover:bg-support/dim-5',\n 'enabled:active:bg-support/dim-5',\n 'focus-visible:bg-support/dim-5',\n 'text-support',\n ]),\n },\n {\n intent: 'accent',\n design: 'outlined',\n class: tw([\n 'hover:bg-accent/dim-5',\n 'enabled:active:bg-accent/dim-5',\n 'focus-visible:bg-accent/dim-5',\n 'text-accent',\n ]),\n },\n {\n intent: 'basic',\n design: 'outlined',\n class: tw([\n 'hover:bg-basic/dim-5',\n 'enabled:active:bg-basic/dim-5',\n 'focus-visible:bg-basic/dim-5',\n 'text-basic',\n ]),\n },\n {\n intent: 'success',\n design: 'outlined',\n class: tw([\n 'hover:bg-success/dim-5',\n 'enabled:active:bg-success/dim-5',\n 'focus-visible:bg-success/dim-5',\n 'text-success',\n ]),\n },\n {\n intent: 'alert',\n design: 'outlined',\n class: tw([\n 'hover:bg-alert/dim-5',\n 'enabled:active:bg-alert/dim-5',\n 'focus-visible:bg-alert/dim-5',\n 'text-alert',\n ]),\n },\n {\n intent: 'danger',\n design: 'outlined',\n class: tw([\n 'hover:bg-error/dim-5',\n 'enabled:active:bg-error/dim-5',\n 'focus-visible:bg-error/dim-5',\n 'text-error',\n ]),\n },\n {\n intent: 'info',\n design: 'outlined',\n class: tw([\n 'hover:bg-info/dim-5',\n 'enabled:active:bg-info/dim-5',\n 'focus-visible:bg-info/dim-5',\n 'text-info',\n ]),\n },\n {\n intent: 'neutral',\n design: 'outlined',\n class: tw([\n 'hover:bg-neutral/dim-5',\n 'enabled:active:bg-neutral/dim-5',\n 'focus-visible:bg-neutral/dim-5',\n 'text-neutral',\n ]),\n },\n {\n intent: 'surface',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface/dim-5',\n 'enabled:active:bg-surface/dim-5',\n 'focus-visible:bg-surface/dim-5',\n 'text-surface',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'outlined',\n class: tw([\n 'hover:bg-surface-inverse/dim-5',\n 'enabled:active:bg-surface-inverse/dim-5',\n 'focus-visible:bg-surface-inverse/dim-5',\n 'text-surface-inverse',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const tintedVariants = [\n {\n intent: 'main',\n design: 'tinted',\n class: tw([\n 'bg-main-container',\n 'text-on-main-container',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'tinted',\n class: tw([\n 'bg-support-container',\n 'text-on-support-container',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'tinted',\n class: tw([\n 'bg-accent-container',\n 'text-on-accent-container',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'tinted',\n class: tw([\n 'bg-basic-container',\n 'text-on-basic-container',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'tinted',\n class: tw([\n 'bg-success-container',\n 'text-on-success-container',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'tinted',\n class: tw([\n 'bg-alert-container',\n 'text-on-alert-container',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'tinted',\n class: tw([\n 'bg-error-container',\n 'text-on-error-container',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'tinted',\n class: tw([\n 'bg-info-container',\n 'text-on-info-container',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'tinted',\n class: tw([\n 'bg-neutral-container',\n 'text-on-neutral-container',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'tinted',\n class: tw([\n 'bg-surface',\n 'text-on-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'tinted',\n class: tw([\n 'bg-surface-inverse',\n 'text-on-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { tw } from '@spark-ui/internal-utils'\n\nexport const contrastVariants = [\n {\n intent: 'main',\n design: 'contrast',\n class: tw([\n 'text-main bg-surface',\n 'hover:bg-main-container-hovered',\n 'enabled:active:bg-main-container-hovered',\n 'focus-visible:bg-main-container-hovered',\n ]),\n },\n {\n intent: 'support',\n design: 'contrast',\n class: tw([\n 'text-support bg-surface',\n 'hover:bg-support-container-hovered',\n 'enabled:active:bg-support-container-hovered',\n 'focus-visible:bg-support-container-hovered',\n ]),\n },\n {\n intent: 'accent',\n design: 'contrast',\n class: tw([\n 'text-accent bg-surface',\n 'hover:bg-accent-container-hovered',\n 'enabled:active:bg-accent-container-hovered',\n 'focus-visible:bg-accent-container-hovered',\n ]),\n },\n {\n intent: 'basic',\n design: 'contrast',\n class: tw([\n 'text-basic bg-surface',\n 'hover:bg-basic-container-hovered',\n 'enabled:active:bg-basic-container-hovered',\n 'focus-visible:bg-basic-container-hovered',\n ]),\n },\n {\n intent: 'success',\n design: 'contrast',\n class: tw([\n 'text-success bg-surface',\n 'hover:bg-success-container-hovered',\n 'enabled:active:bg-success-container-hovered',\n 'focus-visible:bg-success-container-hovered',\n ]),\n },\n {\n intent: 'alert',\n design: 'contrast',\n class: tw([\n 'text-alert bg-surface',\n 'hover:bg-alert-container-hovered',\n 'enabled:active:bg-alert-container-hovered',\n 'focus-visible:bg-alert-container-hovered',\n ]),\n },\n {\n intent: 'danger',\n design: 'contrast',\n class: tw([\n 'text-error bg-surface',\n 'hover:bg-error-container-hovered',\n 'enabled:active:bg-error-container-hovered',\n 'focus-visible:bg-error-container-hovered',\n ]),\n },\n {\n intent: 'info',\n design: 'contrast',\n class: tw([\n 'text-info bg-surface',\n 'hover:bg-info-container-hovered',\n 'enabled:active:bg-info-container-hovered',\n 'focus-visible:bg-info-container-hovered',\n ]),\n },\n {\n intent: 'neutral',\n design: 'contrast',\n class: tw([\n 'text-neutral bg-surface',\n 'hover:bg-neutral-container-hovered',\n 'enabled:active:bg-neutral-container-hovered',\n 'focus-visible:bg-neutral-container-hovered',\n ]),\n },\n {\n intent: 'surface',\n design: 'contrast',\n class: tw([\n 'text-on-surface bg-surface',\n 'hover:bg-surface-hovered',\n 'enabled:active:bg-surface-hovered',\n 'focus-visible:bg-surface-hovered',\n ]),\n },\n {\n intent: 'surfaceInverse',\n design: 'contrast',\n class: tw([\n 'text-on-surface-inverse bg-surface-inverse',\n 'hover:bg-surface-inverse-hovered',\n 'enabled:active:bg-surface-inverse-hovered',\n 'focus-visible:bg-surface-inverse-hovered',\n ]),\n },\n] as const\n","import { makeVariants } from '@spark-ui/internal-utils'\nimport { cva, VariantProps } from 'class-variance-authority'\n\n// override the Button component's px-lg padding by using a more specific class selector (pl-0 pr-0)\nexport const iconButtonStyles = cva(['pl-0 pr-0'], {\n variants: {\n /**\n * Sets the size of the icon.\n */\n size: makeVariants<'size', ['sm', 'md', 'lg']>({\n sm: ['text-body-1'],\n md: ['text-body-1'],\n lg: ['text-display-3'],\n }),\n },\n})\n\nexport type IconButtonStylesProps = VariantProps<typeof iconButtonStyles>\n","import { Ref } from 'react'\n\nimport { Button, ButtonProps } from '../button'\nimport { iconButtonStyles } from './IconButton.styles'\n\nexport interface IconButtonProps extends Omit<ButtonProps, 'loadingText'> {\n 'aria-label': string\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const IconButton = ({\n design = 'filled',\n disabled = false,\n intent = 'main',\n shape = 'rounded',\n size = 'md',\n className,\n ref,\n ...others\n}: IconButtonProps) => {\n return (\n <Button\n data-spark-component=\"icon-button\"\n ref={ref}\n className={iconButtonStyles({ size, className })}\n design={design}\n disabled={disabled}\n intent={intent}\n shape={shape}\n size={size}\n {...others}\n />\n )\n}\n\nIconButton.displayName = 'IconButton'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, useEffect, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface Props {\n children?: ReactNode\n 'aria-label': string\n index: number\n className?: string\n unstyled?: boolean\n intent?: 'basic' | 'surface'\n}\n\nexport const CarouselPageIndicator = ({\n children,\n unstyled = false,\n index,\n 'aria-label': ariaLabel,\n className,\n intent = 'basic',\n}: Props) => {\n const ctx = useCarouselContext()\n\n const ref = useRef<HTMLButtonElement | null>(null)\n\n useEffect(() => {\n if (ctx.pageIndicatorsRefs.current) {\n ctx.pageIndicatorsRefs.current[index] = ref.current\n }\n })\n\n const indicatorProps = ctx.getIndicatorProps({ index })\n\n return (\n <button\n data-spark-component=\"carousel-page-indicator\"\n ref={ref}\n key={index}\n {...indicatorProps}\n aria-label={ariaLabel}\n className={cx(\n {\n [cx(\n 'border-outline group relative flex justify-center border-0 hover:cursor-pointer',\n 'm-sm rounded-sm transition-all duration-[200ms] ease-linear',\n 'w-sz-8 h-sz-8',\n 'data-[state=active]:w-sz-32 data-[state=active]:h-sz-8',\n 'data-[state=edge]:w-sz-4 data-[state=edge]:h-sz-4',\n 'data-[state=hidden]:size-0',\n intent === 'surface'\n ? 'data-[state=active]:bg-surface bg-surface/dim-2'\n : 'data-[state=active]:bg-basic bg-on-surface/dim-2'\n )]: !unstyled,\n // [dotsStyles]: !unstyled,\n },\n className\n )}\n >\n {children}\n </button>\n )\n}\n\nCarouselPageIndicator.displayName = 'Carousel.PageIndicator'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselAPI } from './types'\n\ninterface RenderProps extends CarouselAPI {\n pages: number[]\n}\n\ninterface Props {\n children: (renderProps: RenderProps) => ReactNode\n className?: string\n}\n\nexport const CarouselPagePicker = ({ children, className }: Props) => {\n const ctx = useCarouselContext()\n\n return (\n <>\n <div\n data-spark-component=\"carousel-page-picker\"\n {...ctx.getIndicatorGroupProps()}\n className={cx(\n 'flex-wrap items-center justify-center',\n 'default:min-h-sz-16 flex',\n ctx.pagePickerInset && 'bottom-sz-12 absolute inset-x-0',\n className\n )}\n >\n {ctx.pageSnapPoints.length <= 1\n ? null\n : children({\n ...ctx,\n pages: Array.from({ length: ctx.pageSnapPoints.length }, (_, i) => i),\n })}\n </div>\n </>\n )\n}\n\nCarouselPagePicker.displayName = 'Carousel.PagePicker'\n","import { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselPrevButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-prev-button\"\n {...ctx.getPrevTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselPrevButton.displayName = 'Carousel.PrevButton'\n","import { cx } from 'class-variance-authority'\nimport { ComponentProps, ReactNode, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { useIsVisible } from './useIsVisible'\n\nexport interface CarouselSlideProps extends ComponentProps<'div'> {\n isSnapPoint?: boolean\n children?: ReactNode\n index?: number\n totalSlides?: number\n className?: string\n}\n\nexport const CarouselSlide = ({\n children,\n index = 0,\n totalSlides,\n className = '',\n ...props\n}: CarouselSlideProps) => {\n const itemRef = useRef<HTMLDivElement>(null)\n const ctx = useCarouselContext()\n\n const isVisible = useIsVisible(itemRef, ctx.ref)\n\n return (\n <div\n data-spark-component=\"carousel-slide\"\n ref={itemRef}\n {...ctx.getSlideProps({ index, totalSlides: totalSlides as number })}\n className={cx('default:bg-surface relative overflow-hidden', className)}\n aria-hidden={!isVisible}\n inert={!isVisible}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselSlide.displayName = 'Carousel.Slide'\n","import { useLayoutEffect, useState, RefObject } from 'react'\n\nexport function useIsVisible(\n elementRef: RefObject<HTMLElement | null>,\n parentRef: RefObject<HTMLElement | null>\n) {\n const [isVisible, setIsVisible] = useState(true)\n\n useLayoutEffect(() => {\n const el = elementRef.current\n const parent = parentRef.current\n\n if (!parent || !el) return\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry) {\n setIsVisible(entry.isIntersecting)\n }\n },\n { root: parent, threshold: 0.2 }\n )\n\n observer.observe(el)\n\n return () => observer.disconnect()\n })\n\n return isVisible\n}\n","import { cx } from 'class-variance-authority'\nimport { Children, cloneElement, ComponentProps, isValidElement, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselSlideProps } from './CarouselSlide'\n\ninterface Props extends ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nexport const CarouselSlides = ({ children, className = '' }: Props) => {\n const ctx = useCarouselContext()\n\n const childrenElements = Children.toArray(children)\n\n return (\n <div\n data-spark-component=\"carousel-slides\"\n {...ctx.getSlidesContainerProps()}\n className={cx(\n 'focus-visible:u-outline relative w-full',\n '[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n className\n )}\n >\n {childrenElements.map((child, index) =>\n isValidElement<CarouselSlideProps>(child)\n ? cloneElement(child, {\n index,\n totalSlides: childrenElements.length,\n })\n : child\n )}\n </div>\n )\n}\n\nCarouselSlides.displayName = 'Carousel.Slides'\n","import { ReactNode } from 'react'\n\ninterface Props {\n children: ReactNode\n}\n\nexport const CarouselViewport = ({ children }: Props) => {\n return <div className=\"relative flex items-center justify-around p-0\">{children}</div>\n}\n\nCarouselViewport.displayName = 'Carousel.Viewport'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,kBAAAA;AAAA;AAAA;;;ACAA,sCAAmB;AACnB,IAAAC,gBAAqE;;;ACArE,IAAAC,gBAQO;;;ACTP,mBAAqD;AAQ9C,SAAS,SAAgC,UAAc;AAC5D,QAAM,UAAM,qBAAgC,MAAM;AAChD,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE,CAAC;AAED,oCAAgB,MAAM;AACpB,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,aAAO,0BAAyB,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,GAAG,CAAC,CAAC;AACzE;;;AClBA,IAAAC,gBAAkC;AAE3B,IAAM,eAAe,MAAM;AAChC,QAAM,gBAAY,sBAAO,KAAK;AAE9B,+BAAU,MAAM;AACd,cAAU,UAAU;AAEpB,WAAO,MAAM;AACX,gBAAU,UAAU;AAAA,IACtB;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,SAAO;AACT;;;ACdA,IAAAC,gBAA6C;AAEtC,SAAS,aAAa,WA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QAChC,CAAC,IACD;AAAA,MACN;AAAA;AAAA,EACF;AAEJ;AAEA,eAAe,cAAc;;;AC/BpB,IAAAC,uBAAA;AADF,IAAM,mBAAmB,CAAC,EAAE,SAAS,MAAa;AACvD,SAAO,8CAAC,SAAI,WAAU,iDAAiD,UAAS;AAClF;AAEA,iBAAiB,cAAc;;;AhCAxB,IAAMC,YAST,OAAO,OAAO,UAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,UAAS,cAAc;","names":["Carousel","import_react","import_react","import_react","import_react","import_react","import_react","startIndex","import_class_variance_authority","import_jsx_runtime","import_react","import_react","import_jsx_runtime","RadixSlot","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_class_variance_authority","import_react","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_internal_utils","import_jsx_runtime","import_internal_utils","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_class_variance_authority","import_jsx_runtime","import_jsx_runtime","import_class_variance_authority","import_react","import_react","import_jsx_runtime","import_class_variance_authority","import_react","import_jsx_runtime","import_jsx_runtime","Carousel"]}
|
package/dist/carousel/index.mjs
CHANGED
|
@@ -155,6 +155,35 @@ function getSnapPositions({
|
|
|
155
155
|
});
|
|
156
156
|
}).map((slide) => slide.offsetLeft);
|
|
157
157
|
}
|
|
158
|
+
function computeDotState({
|
|
159
|
+
dotIndex,
|
|
160
|
+
pageState,
|
|
161
|
+
totalPages,
|
|
162
|
+
maxDots = 5
|
|
163
|
+
}) {
|
|
164
|
+
if (totalPages <= maxDots) {
|
|
165
|
+
return dotIndex === pageState ? "active" : "idle";
|
|
166
|
+
}
|
|
167
|
+
if (pageState <= Math.floor(maxDots / 2)) {
|
|
168
|
+
if (dotIndex > maxDots - 1) return "hidden";
|
|
169
|
+
if (dotIndex === pageState) return "active";
|
|
170
|
+
if (dotIndex === maxDots - 1) return "edge";
|
|
171
|
+
return "idle";
|
|
172
|
+
}
|
|
173
|
+
if (pageState >= totalPages - Math.ceil(maxDots / 2)) {
|
|
174
|
+
const startIndex2 = totalPages - maxDots;
|
|
175
|
+
if (dotIndex < startIndex2) return "hidden";
|
|
176
|
+
if (dotIndex === pageState) return "active";
|
|
177
|
+
if (dotIndex === startIndex2) return "edge";
|
|
178
|
+
return "idle";
|
|
179
|
+
}
|
|
180
|
+
const startIndex = pageState - Math.floor(maxDots / 2);
|
|
181
|
+
const endIndex = pageState + Math.floor(maxDots / 2);
|
|
182
|
+
if (dotIndex < startIndex || dotIndex > endIndex) return "hidden";
|
|
183
|
+
if (dotIndex === pageState) return "active";
|
|
184
|
+
if (dotIndex === startIndex || dotIndex === endIndex) return "edge";
|
|
185
|
+
return "idle";
|
|
186
|
+
}
|
|
158
187
|
|
|
159
188
|
// src/carousel/useSnapPoints.ts
|
|
160
189
|
function useSnapPoints(initialSnapPoints = [], {
|
|
@@ -191,6 +220,7 @@ var useCarousel = ({
|
|
|
191
220
|
scrollBehavior = "smooth",
|
|
192
221
|
loop = false,
|
|
193
222
|
pagePickerInset = false,
|
|
223
|
+
maxDots = 5,
|
|
194
224
|
// state control
|
|
195
225
|
page: controlledPage,
|
|
196
226
|
onPageChange: onPageChangeProp
|
|
@@ -293,6 +323,7 @@ var useCarousel = ({
|
|
|
293
323
|
scrollBehavior,
|
|
294
324
|
loop,
|
|
295
325
|
pagePickerInset,
|
|
326
|
+
maxDots,
|
|
296
327
|
// computed state
|
|
297
328
|
page: pageState,
|
|
298
329
|
pageSnapPoints,
|
|
@@ -401,17 +432,22 @@ var useCarousel = ({
|
|
|
401
432
|
dir: DIRECTION
|
|
402
433
|
}),
|
|
403
434
|
getIndicatorProps: ({ index }) => {
|
|
404
|
-
const
|
|
435
|
+
const dotState = computeDotState({
|
|
436
|
+
dotIndex: index,
|
|
437
|
+
pageState,
|
|
438
|
+
totalPages: pageSnapPoints.length,
|
|
439
|
+
maxDots
|
|
440
|
+
});
|
|
405
441
|
return {
|
|
406
442
|
role: "radio",
|
|
407
443
|
id: `carousel::${carouselId}::indicator:${index}`,
|
|
408
|
-
"aria-checked":
|
|
444
|
+
"aria-checked": index === pageState,
|
|
409
445
|
"data-scope": DATA_SCOPE,
|
|
410
446
|
"data-part": "indicator",
|
|
411
447
|
"data-orientation": "horizontal",
|
|
412
448
|
"data-index": index,
|
|
413
|
-
"data-state":
|
|
414
|
-
tabIndex:
|
|
449
|
+
"data-state": dotState,
|
|
450
|
+
tabIndex: index === pageState ? 0 : -1,
|
|
415
451
|
onClick: () => {
|
|
416
452
|
scrollTo(index, scrollBehavior);
|
|
417
453
|
},
|
|
@@ -448,6 +484,7 @@ var Carousel = ({
|
|
|
448
484
|
defaultPage,
|
|
449
485
|
page,
|
|
450
486
|
onPageChange,
|
|
487
|
+
maxDots = 5,
|
|
451
488
|
...props
|
|
452
489
|
}) => {
|
|
453
490
|
const carouselApi = useCarousel({
|
|
@@ -461,7 +498,8 @@ var Carousel = ({
|
|
|
461
498
|
snapType,
|
|
462
499
|
page,
|
|
463
500
|
pagePickerInset,
|
|
464
|
-
onPageChange
|
|
501
|
+
onPageChange,
|
|
502
|
+
maxDots
|
|
465
503
|
});
|
|
466
504
|
return /* @__PURE__ */ jsx(
|
|
467
505
|
CarouselContext.Provider,
|
|
@@ -556,28 +594,26 @@ var CarouselPageIndicator = ({
|
|
|
556
594
|
ctx.pageIndicatorsRefs.current[index] = ref.current;
|
|
557
595
|
}
|
|
558
596
|
});
|
|
559
|
-
const
|
|
560
|
-
"group h-sz-16 relative flex",
|
|
561
|
-
"hover:cursor-pointer",
|
|
562
|
-
"w-sz-16 data-[state=active]:w-sz-44"
|
|
563
|
-
);
|
|
564
|
-
const dotsStyles = cx3(
|
|
565
|
-
"before:rounded-sm before:block before:size-md",
|
|
566
|
-
"before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2",
|
|
567
|
-
"data-[state=active]:before:w-sz-32",
|
|
568
|
-
intent === "surface" ? "data-[state=active]:before:bg-surface data-[state=inactive]:before:bg-surface/dim-2" : "data-[state=active]:before:bg-basic data-[state=inactive]:before:bg-on-surface/dim-2"
|
|
569
|
-
);
|
|
597
|
+
const indicatorProps = ctx.getIndicatorProps({ index });
|
|
570
598
|
return /* @__PURE__ */ jsx4(
|
|
571
599
|
"button",
|
|
572
600
|
{
|
|
573
601
|
"data-spark-component": "carousel-page-indicator",
|
|
574
602
|
ref,
|
|
575
|
-
...
|
|
603
|
+
...indicatorProps,
|
|
576
604
|
"aria-label": ariaLabel,
|
|
577
605
|
className: cx3(
|
|
578
606
|
{
|
|
579
|
-
[
|
|
580
|
-
|
|
607
|
+
[cx3(
|
|
608
|
+
"border-outline group relative flex justify-center border-0 hover:cursor-pointer",
|
|
609
|
+
"m-sm rounded-sm transition-all duration-[200ms] ease-linear",
|
|
610
|
+
"w-sz-8 h-sz-8",
|
|
611
|
+
"data-[state=active]:w-sz-32 data-[state=active]:h-sz-8",
|
|
612
|
+
"data-[state=edge]:w-sz-4 data-[state=edge]:h-sz-4",
|
|
613
|
+
"data-[state=hidden]:size-0",
|
|
614
|
+
intent === "surface" ? "data-[state=active]:bg-surface bg-surface/dim-2" : "data-[state=active]:bg-basic bg-on-surface/dim-2"
|
|
615
|
+
)]: !unstyled
|
|
616
|
+
// [dotsStyles]: !unstyled,
|
|
581
617
|
},
|
|
582
618
|
className
|
|
583
619
|
),
|
|
@@ -599,7 +635,8 @@ var CarouselPagePicker = ({ children, className }) => {
|
|
|
599
635
|
"data-spark-component": "carousel-page-picker",
|
|
600
636
|
...ctx.getIndicatorGroupProps(),
|
|
601
637
|
className: cx4(
|
|
602
|
-
"
|
|
638
|
+
"flex-wrap items-center justify-center",
|
|
639
|
+
"default:min-h-sz-16 flex",
|
|
603
640
|
ctx.pagePickerInset && "bottom-sz-12 absolute inset-x-0",
|
|
604
641
|
className
|
|
605
642
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/carousel/Carousel.tsx","../../src/carousel/useCarousel.ts","../../src/carousel/useEvent.ts","../../src/carousel/useIsMounted.ts","../../src/carousel/useScrollEnd.ts","../../src/carousel/useSnapPoints.ts","../../src/carousel/useResizeObserver.ts","../../src/carousel/utils.ts","../../src/carousel/CarouselControls.tsx","../../src/carousel/CarouselNextButton.tsx","../../src/carousel/CarouselPageIndicator.tsx","../../src/carousel/CarouselPagePicker.tsx","../../src/carousel/CarouselPrevButton.tsx","../../src/carousel/CarouselSlide.tsx","../../src/carousel/useIsVisible.ts","../../src/carousel/CarouselSlides.tsx","../../src/carousel/CarouselViewport.tsx","../../src/carousel/index.ts"],"sourcesContent":["import { cx } from 'class-variance-authority'\nimport { ComponentProps, createContext, ReactNode, useContext } from 'react'\n\nimport { CarouselAPI, UseCarouselProps } from './types'\nimport { useCarousel } from './useCarousel'\n\ninterface Props extends UseCarouselProps, ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nconst CarouselContext = createContext<CarouselAPI | null>(null)\n\nexport const Carousel = ({\n className,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollBehavior = 'smooth',\n slidesPerMove = 'auto',\n pagePickerInset = false,\n slidesPerPage = 1,\n loop = false,\n children,\n gap = 16,\n defaultPage,\n page,\n onPageChange,\n ...props\n}: Props) => {\n const carouselApi = useCarousel({\n defaultPage,\n slidesPerPage,\n slidesPerMove,\n loop,\n gap,\n scrollBehavior,\n snapStop,\n snapType,\n page,\n pagePickerInset,\n onPageChange,\n })\n\n return (\n <CarouselContext.Provider\n value={{\n ...carouselApi,\n scrollBehavior,\n }}\n >\n <div\n data-spark-component=\"carousel\"\n className={cx('gap-lg relative box-border flex flex-col', className)}\n {...carouselApi.getRootProps()}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nCarousel.displayName = 'Carousel'\n\nexport const useCarouselContext = () => {\n const context = useContext(CarouselContext)\n\n if (!context) {\n throw Error('useCarouselContext must be used within a Carousel provider')\n }\n\n return context\n}\n","/* eslint-disable max-lines-per-function */\nimport {\n KeyboardEvent,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\n\nimport {\n CarouselAPI,\n ComputedControlProps,\n ComputedIndicatorGroupProps,\n ComputedIndicatorProps,\n ComputedRootProps,\n ComputedSlideGroupProps,\n ComputedSlideProps,\n ComputedTriggerProps,\n UseCarouselProps,\n} from './types'\nimport { useEvent } from './useEvent'\nimport { useIsMounted } from './useIsMounted'\nimport { useScrollEnd } from './useScrollEnd'\nimport { useSnapPoints } from './useSnapPoints'\nimport { getSnapPositions, isSnapPoint } from './utils'\n\nconst DATA_SCOPE = 'carousel' as const\nconst DIRECTION = 'ltr' as const\n\nexport const useCarousel = ({\n defaultPage,\n gap = 16,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollPadding = 0,\n slidesPerPage = 1,\n slidesPerMove = 'auto',\n scrollBehavior = 'smooth',\n loop = false,\n pagePickerInset = false,\n // state control\n page: controlledPage,\n onPageChange: onPageChangeProp,\n}: UseCarouselProps): CarouselAPI => {\n const carouselId = useId()\n const [pageState, setPageState] = useState(defaultPage || controlledPage || 0)\n\n const carouselRef = useRef<HTMLDivElement>(null)\n const pageIndicatorsRefs = useRef<(HTMLElement | null)[]>([])\n const isMountedRef = useIsMounted()\n const isMounted = isMountedRef.current\n const onPageChange = useEvent(onPageChangeProp)\n\n const [pageSnapPoints] = useSnapPoints([], {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n })\n\n const canScrollPrev = useRef(loop || pageState > 0)\n const canScrollNext = useRef(loop || pageState < pageSnapPoints.length - 1)\n canScrollPrev.current = loop || pageState > 0\n canScrollNext.current = loop || pageState < pageSnapPoints.length - 1\n\n const handlePageChange = useCallback(\n (page: number) => {\n if (page !== pageState) {\n setPageState(page)\n onPageChange?.(page)\n }\n },\n [onPageChange, pageState]\n )\n\n const scrollTo = useCallback(\n (page: number, behavior: 'instant' | 'smooth') => {\n if (carouselRef.current) {\n carouselRef.current.scrollTo({\n left: pageSnapPoints[page],\n behavior: behavior === 'instant' ? 'auto' : 'smooth',\n })\n handlePageChange(page)\n }\n },\n [handlePageChange, pageSnapPoints]\n )\n\n const scrollPrev = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollPrev) {\n const targetPage =\n loop && pageState === 0 ? pageSnapPoints.length - 1 : Math.max(pageState - 1, 0)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n const scrollNext = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollNext) {\n const targetPage =\n loop && pageState === pageSnapPoints.length - 1\n ? 0\n : Math.min(pageState + 1, pageSnapPoints.length - 1)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n useEffect(() => {\n if (controlledPage != null) {\n scrollTo(controlledPage, scrollBehavior)\n }\n }, [controlledPage, scrollBehavior, scrollTo])\n\n /**\n * Set the default scroll position of the carousel based on `defaultPage`.\n * As this operation is done before the snap points are set in the state, we have to get them from the ref directly.\n */\n useLayoutEffect(() => {\n if (defaultPage != null && !isMounted && carouselRef.current) {\n const snapPositions = getSnapPositions({\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n carouselRef.current.scrollTo({\n left: snapPositions[defaultPage],\n behavior: 'instant',\n })\n }\n }, [defaultPage, isMounted, slidesPerMove, slidesPerPage])\n\n /**\n * Monitoring scrollend events inside the scrollable area to sync the carousel active page with current scroll position.\n * Scrollend has been chosen over \"scroll\" for performance reason.\n */\n const syncPageStateWithScrollPosition = useCallback(() => {\n if (!carouselRef.current || pageSnapPoints.length === 0) return\n\n const { scrollLeft } = carouselRef.current\n\n const distances = pageSnapPoints.map(pagePosition => Math.abs(scrollLeft - pagePosition))\n const pageInViewport = distances.indexOf(Math.min(...distances))\n\n if (pageInViewport !== -1) {\n handlePageChange(pageInViewport)\n }\n }, [pageSnapPoints, handlePageChange])\n\n useScrollEnd(carouselRef, syncPageStateWithScrollPosition)\n\n const contextValue: CarouselAPI = {\n ref: carouselRef,\n pageIndicatorsRefs,\n // props\n gap,\n snapType,\n snapStop,\n scrollPadding,\n slidesPerPage,\n slidesPerMove,\n scrollBehavior,\n loop,\n pagePickerInset,\n // computed state\n page: pageState,\n pageSnapPoints,\n canScrollNext: canScrollNext.current,\n canScrollPrev: canScrollPrev.current,\n scrollTo,\n scrollPrev,\n scrollNext,\n // anatomy\n getRootProps: (): ComputedRootProps => ({\n id: `carousel::${carouselId}:`,\n role: 'region',\n 'aria-roledescription': 'carousel',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'root',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n '--slides-per-page': slidesPerPage,\n '--slide-spacing': `${gap}px`,\n '--slide-item-size':\n 'calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))',\n },\n }),\n\n getControlProps: (): ComputedControlProps => ({\n 'data-scope': DATA_SCOPE,\n 'data-part': 'control',\n 'data-orientation': 'horizontal',\n }),\n\n getPrevTriggerProps: (): ComputedTriggerProps<'prev-trigger'> => ({\n id: `carousel::${carouselId}::prev-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'prev-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollPrev.current,\n onClick: () => scrollPrev(),\n }),\n\n getNextTriggerProps: (): ComputedTriggerProps<'next-trigger'> => ({\n id: `carousel::${carouselId}::next-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'next-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollNext.current,\n onClick: () => scrollNext(),\n }),\n\n getSlidesContainerProps: (): ComputedSlideGroupProps => ({\n id: `carousel::${carouselId}::item-group`,\n /**\n * The carousel pattern was originally designed for a single slide.\n * When there is more than one slide, the aria-live region is set to off to avoid announcing the whole list of slides.\n * This is not ideal but we keep it for backwards compatibility.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/carousel/#wai-aria-attributes\n */\n 'aria-live': slidesPerPage > 1 ? 'off' : 'polite',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n tabIndex: 0,\n style: {\n display: 'grid',\n gap: 'var(--slide-spacing)',\n scrollSnapType: `x ${snapType}`,\n gridAutoFlow: 'column',\n scrollbarWidth: 'none',\n gridAutoColumns: 'var(--slide-item-size)',\n overflowX: 'auto',\n },\n ref: carouselRef,\n }),\n\n getSlideProps: ({ index }): ComputedSlideProps => {\n const isStopPoint = isSnapPoint(index, {\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n return {\n id: `carousel::${carouselId}::item:${index}`,\n role: 'group',\n 'aria-roledescription': 'slide',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item',\n 'data-index': index,\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n ...(isStopPoint && {\n scrollSnapAlign: 'start',\n scrollSnapStop: snapStop,\n }),\n },\n }\n },\n\n getIndicatorGroupProps: (): ComputedIndicatorGroupProps => ({\n role: 'radiogroup',\n id: `carousel::${carouselId}::indicator-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n }),\n\n getIndicatorProps: ({ index }): ComputedIndicatorProps => {\n const isActivePage = index === pageState\n\n return {\n role: 'radio',\n id: `carousel::${carouselId}::indicator:${index}`,\n 'aria-checked': isActivePage,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator',\n 'data-orientation': 'horizontal',\n 'data-index': index,\n 'data-state': isActivePage ? 'active' : 'inactive',\n tabIndex: isActivePage ? 0 : -1,\n onClick: () => {\n scrollTo(index, scrollBehavior)\n },\n onKeyDown: (event: KeyboardEvent) => {\n const focusActiveIndicator = (page: number) => {\n pageIndicatorsRefs.current[page]?.focus()\n }\n\n if (event.key === 'ArrowRight' && canScrollNext) {\n scrollNext(focusActiveIndicator)\n } else if (event.key === 'ArrowLeft' && canScrollPrev) {\n scrollPrev(focusActiveIndicator)\n }\n },\n }\n },\n }\n\n return contextValue\n}\n","import { useCallback, useLayoutEffect, useRef } from 'react'\n\ntype AnyFunction = (...args: any[]) => any\n\n/**\n * Directly from this gist: https://gist.github.com/diegohaz/695097a06f038a707c3a1b11e4e40195\n * Until React releases a native `useEvent` hook.\n */\nexport function useEvent<T extends AnyFunction>(callback?: T) {\n const ref = useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.')\n })\n\n useLayoutEffect(() => {\n ref.current = callback\n })\n\n return useCallback<AnyFunction>((...args) => ref.current?.(...args), []) as T\n}\n","import { useEffect, useRef } from 'react'\n\nexport const useIsMounted = () => {\n const isMounted = useRef(false)\n\n useEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","import { useEffect, useRef, RefObject } from 'react'\n\nexport function useScrollEnd(scrollRef: RefObject<HTMLDivElement | null>, callback: () => void) {\n const scrollLeft = useRef(0)\n\n /**\n * Safari (and some smaller browsers) to not yet support the `scrollend` event.\n * For those we must rely on the `scroll` event and and an idle state delay to trigger the \"scroll end\".\n *\n * Caveats:\n * - when using a trackpad or your fingers on a touch device, scrolling then holding the position might trigger the \"scrollend\" callback too early.\n */\n const safariTimeout = useRef<NodeJS.Timeout | null>(null)\n\n useEffect(() => {\n const element = scrollRef.current\n if (!element) return\n\n const supportsScrollend = 'onscrollend' in window\n\n const handleScrollEnd = () => {\n callback()\n }\n\n const handleSafariScroll = () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (scrollRef.current) {\n scrollLeft.current = scrollRef.current.scrollLeft\n\n safariTimeout.current = setTimeout(() => {\n if (scrollRef.current) {\n handleScrollEnd()\n }\n }, 150)\n }\n }\n\n if (supportsScrollend) {\n element.addEventListener('scrollend', handleScrollEnd)\n } else {\n element.addEventListener('scroll', handleSafariScroll)\n }\n\n return () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (supportsScrollend) {\n element.removeEventListener('scrollend', handleScrollEnd)\n } else {\n element.removeEventListener('scroll', handleSafariScroll)\n }\n }\n }, [callback, scrollRef])\n}\n\nexport default useScrollEnd\n","import { useMemo, useState, RefObject } from 'react'\n\nimport { useResizeObserver } from './useResizeObserver'\nimport { getSnapPositions } from './utils'\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * The array is updated when resize event are caught in the carousel.\n */\nexport function useSnapPoints<T extends HTMLDivElement | null>(\n initialSnapPoints: number[] = [],\n {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n }: {\n carouselRef: RefObject<T>\n slidesPerMove: 'auto' | number\n slidesPerPage: number\n }\n) {\n const [pageSnapPoints, setPageSnapPoints] = useState(initialSnapPoints)\n\n const stableSnapPoints = useMemo(() => pageSnapPoints, [pageSnapPoints])\n\n /**\n * On resize, dimensions of the carousel might changes, which requires to update the snap points positions in the state.\n */\n useResizeObserver(carouselRef, () => {\n const newSnapPoints = getSnapPositions({\n slidesPerMove,\n slidesPerPage,\n container: carouselRef.current,\n })\n\n if (JSON.stringify(pageSnapPoints) !== JSON.stringify(newSnapPoints)) {\n setPageSnapPoints(newSnapPoints)\n }\n })\n\n return [stableSnapPoints, setPageSnapPoints] as const\n}\n","import { useLayoutEffect, RefObject } from 'react'\n\nexport function useResizeObserver<T extends HTMLElement | null>(\n ref: RefObject<T>,\n callback: (width: number) => void\n) {\n useLayoutEffect(() => {\n const element = ref.current\n if (!element) return\n\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n callback(entry.contentRect.width)\n }\n })\n\n observer.observe(element)\n\n return () => observer.disconnect() // Cleanup on unmount\n }, [ref, callback])\n}\n","/**\n * Get the indices of each slides that serves as the start of a page\n * @returns number[] (ex: [0, 2, 4])\n */\nfunction getSnapIndices({\n totalSlides,\n slidesPerMove,\n slidesPerPage,\n}: {\n totalSlides: number\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n const slideBy = slidesPerMove === 'auto' ? slidesPerPage : slidesPerMove\n const snapPoints: number[] = []\n\n const lastSnapIndex = Math.floor((totalSlides - slidesPerPage) / slideBy) * slideBy\n\n for (let i = 0; i <= lastSnapIndex; i += slideBy) {\n snapPoints.push(i)\n }\n\n // Adding final snap point if necessary\n if (snapPoints[snapPoints.length - 1] !== totalSlides - slidesPerPage) {\n snapPoints.push(totalSlides - slidesPerPage)\n }\n\n return snapPoints\n}\n\nexport function getSlideElements(container: HTMLDivElement | null): Element[] {\n return container ? Array.from(container.querySelectorAll('[data-part=\"item\"]')) : []\n}\n\nexport function isSnapPoint(\n slideIndex: number,\n {\n container,\n slidesPerMove,\n slidesPerPage,\n }: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n }\n) {\n return getSnapIndices({\n totalSlides: getSlideElements(container).length,\n slidesPerPage,\n slidesPerMove,\n }).includes(slideIndex)\n}\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * @returns number[] (ex for a 400px carousel with no gap: [400, 800, 1200])\n */\nexport function getSnapPositions({\n container,\n slidesPerMove,\n slidesPerPage,\n}: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n if (!container) return []\n\n return getSlideElements(container)\n .filter((_, index) => {\n return isSnapPoint(index, {\n slidesPerMove,\n slidesPerPage,\n container,\n })\n })\n .map(slide => (slide as HTMLElement).offsetLeft)\n}\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface ControlsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n}\n\nexport const CarouselControls = ({ children, className, ...props }: ControlsProps) => {\n const ctx = useCarouselContext()\n\n return (\n <div\n data-spark-component=\"carousel-controls\"\n className={cx(\n 'default:px-lg pointer-events-none absolute inset-0 flex flex-row items-center justify-between',\n className\n )}\n {...ctx.getControlProps()}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselControls.displayName = 'Carousel.Controls'\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselNextButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-next-button\"\n {...ctx.getNextTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselNextButton.displayName = 'Carousel.NextButton'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, useEffect, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface Props {\n children?: ReactNode\n 'aria-label': string\n index: number\n className?: string\n unstyled?: boolean\n intent?: 'basic' | 'surface'\n}\n\nexport const CarouselPageIndicator = ({\n children,\n unstyled = false,\n index,\n 'aria-label': ariaLabel,\n className,\n intent = 'basic',\n}: Props) => {\n const ctx = useCarouselContext()\n\n const ref = useRef<HTMLButtonElement | null>(null)\n\n useEffect(() => {\n if (ctx.pageIndicatorsRefs.current) {\n ctx.pageIndicatorsRefs.current[index] = ref.current\n }\n })\n\n const styles = cx(\n 'group h-sz-16 relative flex',\n 'hover:cursor-pointer',\n 'w-sz-16 data-[state=active]:w-sz-44'\n )\n\n const dotsStyles = cx(\n 'before:rounded-sm before:block before:size-md',\n 'before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',\n 'data-[state=active]:before:w-sz-32',\n intent === 'surface'\n ? 'data-[state=active]:before:bg-surface data-[state=inactive]:before:bg-surface/dim-2'\n : 'data-[state=active]:before:bg-basic data-[state=inactive]:before:bg-on-surface/dim-2'\n )\n\n return (\n <button\n data-spark-component=\"carousel-page-indicator\"\n ref={ref}\n key={index}\n {...ctx.getIndicatorProps({ index })}\n aria-label={ariaLabel}\n className={cx(\n {\n [styles]: !unstyled,\n [dotsStyles]: !unstyled,\n },\n className\n )}\n >\n {children}\n </button>\n )\n}\n\nCarouselPageIndicator.displayName = 'Carousel.PageIndicator'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselAPI } from './types'\n\ninterface RenderProps extends CarouselAPI {\n pages: number[]\n}\n\ninterface Props {\n children: (renderProps: RenderProps) => ReactNode\n className?: string\n}\n\nexport const CarouselPagePicker = ({ children, className }: Props) => {\n const ctx = useCarouselContext()\n\n return (\n <>\n <div\n data-spark-component=\"carousel-page-picker\"\n {...ctx.getIndicatorGroupProps()}\n className={cx(\n 'default:min-h-sz-16 flex w-full flex-wrap items-center justify-center',\n ctx.pagePickerInset && 'bottom-sz-12 absolute inset-x-0',\n className\n )}\n >\n {ctx.pageSnapPoints.length <= 1\n ? null\n : children({\n ...ctx,\n pages: Array.from({ length: ctx.pageSnapPoints.length }, (_, i) => i),\n })}\n </div>\n </>\n )\n}\n\nCarouselPagePicker.displayName = 'Carousel.PagePicker'\n","import { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselPrevButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-prev-button\"\n {...ctx.getPrevTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselPrevButton.displayName = 'Carousel.PrevButton'\n","import { cx } from 'class-variance-authority'\nimport { ComponentProps, ReactNode, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { useIsVisible } from './useIsVisible'\n\nexport interface CarouselSlideProps extends ComponentProps<'div'> {\n isSnapPoint?: boolean\n children?: ReactNode\n index?: number\n totalSlides?: number\n className?: string\n}\n\nexport const CarouselSlide = ({\n children,\n index = 0,\n totalSlides,\n className = '',\n ...props\n}: CarouselSlideProps) => {\n const itemRef = useRef<HTMLDivElement>(null)\n const ctx = useCarouselContext()\n\n const isVisible = useIsVisible(itemRef, ctx.ref)\n\n return (\n <div\n data-spark-component=\"carousel-slide\"\n ref={itemRef}\n {...ctx.getSlideProps({ index, totalSlides: totalSlides as number })}\n className={cx('default:bg-surface relative overflow-hidden', className)}\n aria-hidden={!isVisible}\n inert={!isVisible}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselSlide.displayName = 'Carousel.Slide'\n","import { useLayoutEffect, useState, RefObject } from 'react'\n\nexport function useIsVisible(\n elementRef: RefObject<HTMLElement | null>,\n parentRef: RefObject<HTMLElement | null>\n) {\n const [isVisible, setIsVisible] = useState(true)\n\n useLayoutEffect(() => {\n const el = elementRef.current\n const parent = parentRef.current\n\n if (!parent || !el) return\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry) {\n setIsVisible(entry.isIntersecting)\n }\n },\n { root: parent, threshold: 0.2 }\n )\n\n observer.observe(el)\n\n return () => observer.disconnect()\n })\n\n return isVisible\n}\n","import { cx } from 'class-variance-authority'\nimport { Children, cloneElement, ComponentProps, isValidElement, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselSlideProps } from './CarouselSlide'\n\ninterface Props extends ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nexport const CarouselSlides = ({ children, className = '' }: Props) => {\n const ctx = useCarouselContext()\n\n const childrenElements = Children.toArray(children)\n\n return (\n <div\n data-spark-component=\"carousel-slides\"\n {...ctx.getSlidesContainerProps()}\n className={cx(\n 'focus-visible:u-outline relative w-full',\n '[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n className\n )}\n >\n {childrenElements.map((child, index) =>\n isValidElement<CarouselSlideProps>(child)\n ? cloneElement(child, {\n index,\n totalSlides: childrenElements.length,\n })\n : child\n )}\n </div>\n )\n}\n\nCarouselSlides.displayName = 'Carousel.Slides'\n","import { ReactNode } from 'react'\n\ninterface Props {\n children: ReactNode\n}\n\nexport const CarouselViewport = ({ children }: Props) => {\n return <div className=\"relative flex items-center justify-around p-0\">{children}</div>\n}\n\nCarouselViewport.displayName = 'Carousel.Viewport'\n","import { Carousel as Root } from './Carousel'\nimport { CarouselControls as Controls } from './CarouselControls'\nimport { CarouselNextButton as NextButton } from './CarouselNextButton'\nimport { CarouselPageIndicator as PageIndicator } from './CarouselPageIndicator'\nimport { CarouselPagePicker as PagePicker } from './CarouselPagePicker'\nimport { CarouselPrevButton as PrevButton } from './CarouselPrevButton'\nimport { CarouselSlide as Slide } from './CarouselSlide'\nimport { CarouselSlides as Slides } from './CarouselSlides'\nimport { CarouselViewport as Viewport } from './CarouselViewport'\n\nexport const Carousel: typeof Root & {\n Controls: typeof Controls\n NextButton: typeof NextButton\n PrevButton: typeof PrevButton\n Slide: typeof Slide\n Slides: typeof Slides\n Viewport: typeof Viewport\n PagePicker: typeof PagePicker\n PageIndicator: typeof PageIndicator\n} = Object.assign(Root, {\n Controls,\n NextButton,\n PrevButton,\n Slide,\n Slides,\n Viewport,\n PagePicker,\n PageIndicator,\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cAAc,EAAE,OAAO,YAAmC,CAAC;AAAA,MACnE,WAAWE,IAAG,+CAA+C,SAAS;AAAA,MACtE,eAAa,CAAC;AAAA,MACd,OAAO,CAAC;AAAA,MACP,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;AAEA,cAAc,cAAc;;;AEzC5B,SAAS,MAAAC,WAAU;AACnB,SAAS,UAAU,cAA8B,sBAAiC;AAgB9E,gBAAAC,YAAA;AANG,IAAM,iBAAiB,CAAC,EAAE,UAAU,YAAY,GAAG,MAAa;AACrE,QAAM,MAAM,mBAAmB;AAE/B,QAAM,mBAAmB,SAAS,QAAQ,QAAQ;AAElD,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC,wBAAqB;AAAA,MACpB,GAAG,IAAI,wBAAwB;AAAA,MAChC,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MAEC,2BAAiB;AAAA,QAAI,CAAC,OAAO,UAC5B,eAAmC,KAAK,IACpC,aAAa,OAAO;AAAA,UAClB;AAAA,UACA,aAAa,iBAAiB;AAAA,QAChC,CAAC,IACD;AAAA,MACN;AAAA;AAAA,EACF;AAEJ;AAEA,eAAe,cAAc;;;AC/BpB,gBAAAC,YAAA;AADF,IAAM,mBAAmB,CAAC,EAAE,SAAS,MAAa;AACvD,SAAO,gBAAAA,KAAC,SAAI,WAAU,iDAAiD,UAAS;AAClF;AAEA,iBAAiB,cAAc;;;ACAxB,IAAMC,YAST,OAAO,OAAO,UAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,UAAS,cAAc;","names":["useCallback","useEffect","useLayoutEffect","useRef","useState","useRef","useEffect","useRef","useLayoutEffect","useState","useRef","useCallback","useEffect","useLayoutEffect","cx","jsx","cx","jsx","cx","useEffect","useRef","jsx","useRef","useEffect","cx","cx","jsx","cx","jsx","cx","useRef","useLayoutEffect","useState","jsx","useRef","cx","cx","jsx","cx","jsx","Carousel"]}
|
|
1
|
+
{"version":3,"sources":["../../src/carousel/Carousel.tsx","../../src/carousel/useCarousel.ts","../../src/carousel/useEvent.ts","../../src/carousel/useIsMounted.ts","../../src/carousel/useScrollEnd.ts","../../src/carousel/useSnapPoints.ts","../../src/carousel/useResizeObserver.ts","../../src/carousel/utils.ts","../../src/carousel/CarouselControls.tsx","../../src/carousel/CarouselNextButton.tsx","../../src/carousel/CarouselPageIndicator.tsx","../../src/carousel/CarouselPagePicker.tsx","../../src/carousel/CarouselPrevButton.tsx","../../src/carousel/CarouselSlide.tsx","../../src/carousel/useIsVisible.ts","../../src/carousel/CarouselSlides.tsx","../../src/carousel/CarouselViewport.tsx","../../src/carousel/index.ts"],"sourcesContent":["import { cx } from 'class-variance-authority'\nimport { ComponentProps, createContext, ReactNode, useContext } from 'react'\n\nimport { CarouselAPI, UseCarouselProps } from './types'\nimport { useCarousel } from './useCarousel'\n\ninterface Props extends UseCarouselProps, ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nconst CarouselContext = createContext<CarouselAPI | null>(null)\n\nexport const Carousel = ({\n className,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollBehavior = 'smooth',\n slidesPerMove = 'auto',\n pagePickerInset = false,\n slidesPerPage = 1,\n loop = false,\n children,\n gap = 16,\n defaultPage,\n page,\n onPageChange,\n maxDots = 5,\n ...props\n}: Props) => {\n const carouselApi = useCarousel({\n defaultPage,\n slidesPerPage,\n slidesPerMove,\n loop,\n gap,\n scrollBehavior,\n snapStop,\n snapType,\n page,\n pagePickerInset,\n onPageChange,\n maxDots,\n })\n\n return (\n <CarouselContext.Provider\n value={{\n ...carouselApi,\n scrollBehavior,\n }}\n >\n <div\n data-spark-component=\"carousel\"\n className={cx('gap-lg relative box-border flex flex-col', className)}\n {...carouselApi.getRootProps()}\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n )\n}\n\nCarousel.displayName = 'Carousel'\n\nexport const useCarouselContext = () => {\n const context = useContext(CarouselContext)\n\n if (!context) {\n throw Error('useCarouselContext must be used within a Carousel provider')\n }\n\n return context\n}\n","/* eslint-disable max-lines-per-function */\nimport {\n KeyboardEvent,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\n\nimport {\n CarouselAPI,\n ComputedControlProps,\n ComputedIndicatorGroupProps,\n ComputedIndicatorProps,\n ComputedRootProps,\n ComputedSlideGroupProps,\n ComputedSlideProps,\n ComputedTriggerProps,\n UseCarouselProps,\n} from './types'\nimport { useEvent } from './useEvent'\nimport { useIsMounted } from './useIsMounted'\nimport { useScrollEnd } from './useScrollEnd'\nimport { useSnapPoints } from './useSnapPoints'\nimport { computeDotState, getSnapPositions, isSnapPoint } from './utils'\n\nconst DATA_SCOPE = 'carousel' as const\nconst DIRECTION = 'ltr' as const\n\nexport const useCarousel = ({\n defaultPage,\n gap = 16,\n snapType = 'mandatory',\n snapStop = 'always',\n scrollPadding = 0,\n slidesPerPage = 1,\n slidesPerMove = 'auto',\n scrollBehavior = 'smooth',\n loop = false,\n pagePickerInset = false,\n maxDots = 5,\n // state control\n page: controlledPage,\n onPageChange: onPageChangeProp,\n}: UseCarouselProps): CarouselAPI => {\n const carouselId = useId()\n const [pageState, setPageState] = useState(defaultPage || controlledPage || 0)\n\n const carouselRef = useRef<HTMLDivElement>(null)\n const pageIndicatorsRefs = useRef<(HTMLElement | null)[]>([])\n const isMountedRef = useIsMounted()\n const isMounted = isMountedRef.current\n const onPageChange = useEvent(onPageChangeProp)\n\n const [pageSnapPoints] = useSnapPoints([], {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n })\n\n const canScrollPrev = useRef(loop || pageState > 0)\n const canScrollNext = useRef(loop || pageState < pageSnapPoints.length - 1)\n canScrollPrev.current = loop || pageState > 0\n canScrollNext.current = loop || pageState < pageSnapPoints.length - 1\n\n const handlePageChange = useCallback(\n (page: number) => {\n if (page !== pageState) {\n setPageState(page)\n onPageChange?.(page)\n }\n },\n [onPageChange, pageState]\n )\n\n const scrollTo = useCallback(\n (page: number, behavior: 'instant' | 'smooth') => {\n if (carouselRef.current) {\n carouselRef.current.scrollTo({\n left: pageSnapPoints[page],\n behavior: behavior === 'instant' ? 'auto' : 'smooth',\n })\n handlePageChange(page)\n }\n },\n [handlePageChange, pageSnapPoints]\n )\n\n const scrollPrev = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollPrev) {\n const targetPage =\n loop && pageState === 0 ? pageSnapPoints.length - 1 : Math.max(pageState - 1, 0)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n const scrollNext = useCallback(\n (cb?: (pageIndex: number) => void) => {\n if (canScrollNext) {\n const targetPage =\n loop && pageState === pageSnapPoints.length - 1\n ? 0\n : Math.min(pageState + 1, pageSnapPoints.length - 1)\n\n scrollTo(targetPage, scrollBehavior)\n cb?.(targetPage)\n }\n },\n [loop, pageSnapPoints, pageState, scrollBehavior, scrollTo]\n )\n\n useEffect(() => {\n if (controlledPage != null) {\n scrollTo(controlledPage, scrollBehavior)\n }\n }, [controlledPage, scrollBehavior, scrollTo])\n\n /**\n * Set the default scroll position of the carousel based on `defaultPage`.\n * As this operation is done before the snap points are set in the state, we have to get them from the ref directly.\n */\n useLayoutEffect(() => {\n if (defaultPage != null && !isMounted && carouselRef.current) {\n const snapPositions = getSnapPositions({\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n carouselRef.current.scrollTo({\n left: snapPositions[defaultPage],\n behavior: 'instant',\n })\n }\n }, [defaultPage, isMounted, slidesPerMove, slidesPerPage])\n\n /**\n * Monitoring scrollend events inside the scrollable area to sync the carousel active page with current scroll position.\n * Scrollend has been chosen over \"scroll\" for performance reason.\n */\n const syncPageStateWithScrollPosition = useCallback(() => {\n if (!carouselRef.current || pageSnapPoints.length === 0) return\n\n const { scrollLeft } = carouselRef.current\n\n const distances = pageSnapPoints.map(pagePosition => Math.abs(scrollLeft - pagePosition))\n const pageInViewport = distances.indexOf(Math.min(...distances))\n\n if (pageInViewport !== -1) {\n handlePageChange(pageInViewport)\n }\n }, [pageSnapPoints, handlePageChange])\n\n useScrollEnd(carouselRef, syncPageStateWithScrollPosition)\n\n const contextValue: CarouselAPI = {\n ref: carouselRef,\n pageIndicatorsRefs,\n // props\n gap,\n snapType,\n snapStop,\n scrollPadding,\n slidesPerPage,\n slidesPerMove,\n scrollBehavior,\n loop,\n pagePickerInset,\n maxDots,\n // computed state\n page: pageState,\n pageSnapPoints,\n canScrollNext: canScrollNext.current,\n canScrollPrev: canScrollPrev.current,\n scrollTo,\n scrollPrev,\n scrollNext,\n // anatomy\n getRootProps: (): ComputedRootProps => ({\n id: `carousel::${carouselId}:`,\n role: 'region',\n 'aria-roledescription': 'carousel',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'root',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n '--slides-per-page': slidesPerPage,\n '--slide-spacing': `${gap}px`,\n '--slide-item-size':\n 'calc(100% / var(--slides-per-page) - var(--slide-spacing) * (var(--slides-per-page) - 1) / var(--slides-per-page))',\n },\n }),\n\n getControlProps: (): ComputedControlProps => ({\n 'data-scope': DATA_SCOPE,\n 'data-part': 'control',\n 'data-orientation': 'horizontal',\n }),\n\n getPrevTriggerProps: (): ComputedTriggerProps<'prev-trigger'> => ({\n id: `carousel::${carouselId}::prev-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'prev-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollPrev.current,\n onClick: () => scrollPrev(),\n }),\n\n getNextTriggerProps: (): ComputedTriggerProps<'next-trigger'> => ({\n id: `carousel::${carouselId}::next-trigger`,\n 'aria-controls': `carousel::${carouselId}::item-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'next-trigger',\n 'data-orientation': 'horizontal',\n type: 'button',\n dir: DIRECTION,\n disabled: !canScrollNext.current,\n onClick: () => scrollNext(),\n }),\n\n getSlidesContainerProps: (): ComputedSlideGroupProps => ({\n id: `carousel::${carouselId}::item-group`,\n /**\n * The carousel pattern was originally designed for a single slide.\n * When there is more than one slide, the aria-live region is set to off to avoid announcing the whole list of slides.\n * This is not ideal but we keep it for backwards compatibility.\n *\n * @see https://www.w3.org/WAI/ARIA/apg/patterns/carousel/#wai-aria-attributes\n */\n 'aria-live': slidesPerPage > 1 ? 'off' : 'polite',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n tabIndex: 0,\n style: {\n display: 'grid',\n gap: 'var(--slide-spacing)',\n scrollSnapType: `x ${snapType}`,\n gridAutoFlow: 'column',\n scrollbarWidth: 'none',\n gridAutoColumns: 'var(--slide-item-size)',\n overflowX: 'auto',\n },\n ref: carouselRef,\n }),\n\n getSlideProps: ({ index }): ComputedSlideProps => {\n const isStopPoint = isSnapPoint(index, {\n container: carouselRef.current,\n slidesPerMove,\n slidesPerPage,\n })\n\n return {\n id: `carousel::${carouselId}::item:${index}`,\n role: 'group',\n 'aria-roledescription': 'slide',\n 'data-scope': DATA_SCOPE,\n 'data-part': 'item',\n 'data-index': index,\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n style: {\n ...(isStopPoint && {\n scrollSnapAlign: 'start',\n scrollSnapStop: snapStop,\n }),\n },\n }\n },\n\n getIndicatorGroupProps: (): ComputedIndicatorGroupProps => ({\n role: 'radiogroup',\n id: `carousel::${carouselId}::indicator-group`,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator-group',\n 'data-orientation': 'horizontal',\n dir: DIRECTION,\n }),\n\n getIndicatorProps: ({ index }): ComputedIndicatorProps => {\n const dotState = computeDotState({\n dotIndex: index,\n pageState,\n totalPages: pageSnapPoints.length,\n maxDots,\n })\n\n return {\n role: 'radio',\n id: `carousel::${carouselId}::indicator:${index}`,\n 'aria-checked': index === pageState,\n 'data-scope': DATA_SCOPE,\n 'data-part': 'indicator',\n 'data-orientation': 'horizontal',\n 'data-index': index,\n 'data-state': dotState,\n tabIndex: index === pageState ? 0 : -1,\n onClick: () => {\n scrollTo(index, scrollBehavior)\n },\n onKeyDown: (event: KeyboardEvent) => {\n const focusActiveIndicator = (page: number) => {\n pageIndicatorsRefs.current[page]?.focus()\n }\n\n if (event.key === 'ArrowRight' && canScrollNext) {\n scrollNext(focusActiveIndicator)\n } else if (event.key === 'ArrowLeft' && canScrollPrev) {\n scrollPrev(focusActiveIndicator)\n }\n },\n }\n },\n }\n\n return contextValue\n}\n","import { useCallback, useLayoutEffect, useRef } from 'react'\n\ntype AnyFunction = (...args: any[]) => any\n\n/**\n * Directly from this gist: https://gist.github.com/diegohaz/695097a06f038a707c3a1b11e4e40195\n * Until React releases a native `useEvent` hook.\n */\nexport function useEvent<T extends AnyFunction>(callback?: T) {\n const ref = useRef<AnyFunction | undefined>(() => {\n throw new Error('Cannot call an event handler while rendering.')\n })\n\n useLayoutEffect(() => {\n ref.current = callback\n })\n\n return useCallback<AnyFunction>((...args) => ref.current?.(...args), []) as T\n}\n","import { useEffect, useRef } from 'react'\n\nexport const useIsMounted = () => {\n const isMounted = useRef(false)\n\n useEffect(() => {\n isMounted.current = true\n\n return () => {\n isMounted.current = false\n }\n }, [])\n\n return isMounted\n}\n","import { useEffect, useRef, RefObject } from 'react'\n\nexport function useScrollEnd(scrollRef: RefObject<HTMLDivElement | null>, callback: () => void) {\n const scrollLeft = useRef(0)\n\n /**\n * Safari (and some smaller browsers) to not yet support the `scrollend` event.\n * For those we must rely on the `scroll` event and and an idle state delay to trigger the \"scroll end\".\n *\n * Caveats:\n * - when using a trackpad or your fingers on a touch device, scrolling then holding the position might trigger the \"scrollend\" callback too early.\n */\n const safariTimeout = useRef<NodeJS.Timeout | null>(null)\n\n useEffect(() => {\n const element = scrollRef.current\n if (!element) return\n\n const supportsScrollend = 'onscrollend' in window\n\n const handleScrollEnd = () => {\n callback()\n }\n\n const handleSafariScroll = () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (scrollRef.current) {\n scrollLeft.current = scrollRef.current.scrollLeft\n\n safariTimeout.current = setTimeout(() => {\n if (scrollRef.current) {\n handleScrollEnd()\n }\n }, 150)\n }\n }\n\n if (supportsScrollend) {\n element.addEventListener('scrollend', handleScrollEnd)\n } else {\n element.addEventListener('scroll', handleSafariScroll)\n }\n\n return () => {\n if (safariTimeout.current) {\n clearTimeout(safariTimeout.current)\n }\n\n if (supportsScrollend) {\n element.removeEventListener('scrollend', handleScrollEnd)\n } else {\n element.removeEventListener('scroll', handleSafariScroll)\n }\n }\n }, [callback, scrollRef])\n}\n\nexport default useScrollEnd\n","import { useMemo, useState, RefObject } from 'react'\n\nimport { useResizeObserver } from './useResizeObserver'\nimport { getSnapPositions } from './utils'\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * The array is updated when resize event are caught in the carousel.\n */\nexport function useSnapPoints<T extends HTMLDivElement | null>(\n initialSnapPoints: number[] = [],\n {\n carouselRef,\n slidesPerMove,\n slidesPerPage,\n }: {\n carouselRef: RefObject<T>\n slidesPerMove: 'auto' | number\n slidesPerPage: number\n }\n) {\n const [pageSnapPoints, setPageSnapPoints] = useState(initialSnapPoints)\n\n const stableSnapPoints = useMemo(() => pageSnapPoints, [pageSnapPoints])\n\n /**\n * On resize, dimensions of the carousel might changes, which requires to update the snap points positions in the state.\n */\n useResizeObserver(carouselRef, () => {\n const newSnapPoints = getSnapPositions({\n slidesPerMove,\n slidesPerPage,\n container: carouselRef.current,\n })\n\n if (JSON.stringify(pageSnapPoints) !== JSON.stringify(newSnapPoints)) {\n setPageSnapPoints(newSnapPoints)\n }\n })\n\n return [stableSnapPoints, setPageSnapPoints] as const\n}\n","import { useLayoutEffect, RefObject } from 'react'\n\nexport function useResizeObserver<T extends HTMLElement | null>(\n ref: RefObject<T>,\n callback: (width: number) => void\n) {\n useLayoutEffect(() => {\n const element = ref.current\n if (!element) return\n\n const observer = new ResizeObserver(entries => {\n for (const entry of entries) {\n callback(entry.contentRect.width)\n }\n })\n\n observer.observe(element)\n\n return () => observer.disconnect() // Cleanup on unmount\n }, [ref, callback])\n}\n","/**\n * Get the indices of each slides that serves as the start of a page\n * @returns number[] (ex: [0, 2, 4])\n */\nfunction getSnapIndices({\n totalSlides,\n slidesPerMove,\n slidesPerPage,\n}: {\n totalSlides: number\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n const slideBy = slidesPerMove === 'auto' ? slidesPerPage : slidesPerMove\n const snapPoints: number[] = []\n\n const lastSnapIndex = Math.floor((totalSlides - slidesPerPage) / slideBy) * slideBy\n\n for (let i = 0; i <= lastSnapIndex; i += slideBy) {\n snapPoints.push(i)\n }\n\n // Adding final snap point if necessary\n if (snapPoints[snapPoints.length - 1] !== totalSlides - slidesPerPage) {\n snapPoints.push(totalSlides - slidesPerPage)\n }\n\n return snapPoints\n}\n\nexport function getSlideElements(container: HTMLDivElement | null): Element[] {\n return container ? Array.from(container.querySelectorAll('[data-part=\"item\"]')) : []\n}\n\nexport function isSnapPoint(\n slideIndex: number,\n {\n container,\n slidesPerMove,\n slidesPerPage,\n }: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n }\n) {\n return getSnapIndices({\n totalSlides: getSlideElements(container).length,\n slidesPerPage,\n slidesPerMove,\n }).includes(slideIndex)\n}\n\n/**\n * Get the scroll value of each slides that serves as the start of a page\n * @returns number[] (ex for a 400px carousel with no gap: [400, 800, 1200])\n */\nexport function getSnapPositions({\n container,\n slidesPerMove,\n slidesPerPage,\n}: {\n container: HTMLDivElement | null\n slidesPerMove: number | 'auto'\n slidesPerPage: number\n}) {\n if (!container) return []\n\n return getSlideElements(container)\n .filter((_, index) => {\n return isSnapPoint(index, {\n slidesPerMove,\n slidesPerPage,\n container,\n })\n })\n .map(slide => (slide as HTMLElement).offsetLeft)\n}\n\n/**\n * Calculate the state of a dot indicator of a carousel depending on the current page and the total number of pages.\n */\nexport function computeDotState({\n dotIndex,\n pageState,\n totalPages,\n maxDots = 5,\n}: {\n dotIndex: number\n pageState: number\n totalPages: number\n maxDots?: number\n}): 'active' | 'edge' | 'idle' | 'hidden' {\n if (totalPages <= maxDots) {\n return dotIndex === pageState ? 'active' : 'idle'\n }\n\n if (pageState <= Math.floor(maxDots / 2)) {\n if (dotIndex > maxDots - 1) return 'hidden'\n if (dotIndex === pageState) return 'active'\n if (dotIndex === maxDots - 1) return 'edge'\n\n return 'idle'\n }\n\n if (pageState >= totalPages - Math.ceil(maxDots / 2)) {\n const startIndex = totalPages - maxDots\n if (dotIndex < startIndex) return 'hidden'\n if (dotIndex === pageState) return 'active'\n if (dotIndex === startIndex) return 'edge'\n\n return 'idle'\n }\n\n const startIndex = pageState - Math.floor(maxDots / 2)\n const endIndex = pageState + Math.floor(maxDots / 2)\n if (dotIndex < startIndex || dotIndex > endIndex) return 'hidden'\n if (dotIndex === pageState) return 'active'\n if (dotIndex === startIndex || dotIndex === endIndex) return 'edge'\n\n return 'idle'\n}\n","import { cx } from 'class-variance-authority'\nimport { HTMLAttributes, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface ControlsProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode\n}\n\nexport const CarouselControls = ({ children, className, ...props }: ControlsProps) => {\n const ctx = useCarouselContext()\n\n return (\n <div\n data-spark-component=\"carousel-controls\"\n className={cx(\n 'default:px-lg pointer-events-none absolute inset-0 flex flex-row items-center justify-between',\n className\n )}\n {...ctx.getControlProps()}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselControls.displayName = 'Carousel.Controls'\n","import { ArrowVerticalRight } from '@spark-ui/icons/ArrowVerticalRight'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselNextButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-next-button\"\n {...ctx.getNextTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalRight />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselNextButton.displayName = 'Carousel.NextButton'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode, useEffect, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\n\ninterface Props {\n children?: ReactNode\n 'aria-label': string\n index: number\n className?: string\n unstyled?: boolean\n intent?: 'basic' | 'surface'\n}\n\nexport const CarouselPageIndicator = ({\n children,\n unstyled = false,\n index,\n 'aria-label': ariaLabel,\n className,\n intent = 'basic',\n}: Props) => {\n const ctx = useCarouselContext()\n\n const ref = useRef<HTMLButtonElement | null>(null)\n\n useEffect(() => {\n if (ctx.pageIndicatorsRefs.current) {\n ctx.pageIndicatorsRefs.current[index] = ref.current\n }\n })\n\n const indicatorProps = ctx.getIndicatorProps({ index })\n\n return (\n <button\n data-spark-component=\"carousel-page-indicator\"\n ref={ref}\n key={index}\n {...indicatorProps}\n aria-label={ariaLabel}\n className={cx(\n {\n [cx(\n 'border-outline group relative flex justify-center border-0 hover:cursor-pointer',\n 'm-sm rounded-sm transition-all duration-[200ms] ease-linear',\n 'w-sz-8 h-sz-8',\n 'data-[state=active]:w-sz-32 data-[state=active]:h-sz-8',\n 'data-[state=edge]:w-sz-4 data-[state=edge]:h-sz-4',\n 'data-[state=hidden]:size-0',\n intent === 'surface'\n ? 'data-[state=active]:bg-surface bg-surface/dim-2'\n : 'data-[state=active]:bg-basic bg-on-surface/dim-2'\n )]: !unstyled,\n // [dotsStyles]: !unstyled,\n },\n className\n )}\n >\n {children}\n </button>\n )\n}\n\nCarouselPageIndicator.displayName = 'Carousel.PageIndicator'\n","import { cx } from 'class-variance-authority'\nimport { ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselAPI } from './types'\n\ninterface RenderProps extends CarouselAPI {\n pages: number[]\n}\n\ninterface Props {\n children: (renderProps: RenderProps) => ReactNode\n className?: string\n}\n\nexport const CarouselPagePicker = ({ children, className }: Props) => {\n const ctx = useCarouselContext()\n\n return (\n <>\n <div\n data-spark-component=\"carousel-page-picker\"\n {...ctx.getIndicatorGroupProps()}\n className={cx(\n 'flex-wrap items-center justify-center',\n 'default:min-h-sz-16 flex',\n ctx.pagePickerInset && 'bottom-sz-12 absolute inset-x-0',\n className\n )}\n >\n {ctx.pageSnapPoints.length <= 1\n ? null\n : children({\n ...ctx,\n pages: Array.from({ length: ctx.pageSnapPoints.length }, (_, i) => i),\n })}\n </div>\n </>\n )\n}\n\nCarouselPagePicker.displayName = 'Carousel.PagePicker'\n","import { ArrowVerticalLeft } from '@spark-ui/icons/ArrowVerticalLeft'\n\nimport { Icon } from '../icon'\nimport { IconButton, IconButtonProps } from '../icon-button'\nimport { useCarouselContext } from './Carousel'\n\nexport const CarouselPrevButton = ({\n 'aria-label': ariaLabel,\n ...buttonProps\n}: IconButtonProps) => {\n const ctx = useCarouselContext()\n\n return (\n <IconButton\n data-spark-component=\"carousel-prev-button\"\n {...ctx.getPrevTriggerProps()}\n intent=\"surface\"\n design=\"filled\"\n className=\"pointer-events-auto cursor-pointer shadow-sm disabled:invisible\"\n aria-label={ariaLabel}\n {...buttonProps}\n >\n <Icon>\n <ArrowVerticalLeft />\n </Icon>\n </IconButton>\n )\n}\n\nCarouselPrevButton.displayName = 'Carousel.PrevButton'\n","import { cx } from 'class-variance-authority'\nimport { ComponentProps, ReactNode, useRef } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { useIsVisible } from './useIsVisible'\n\nexport interface CarouselSlideProps extends ComponentProps<'div'> {\n isSnapPoint?: boolean\n children?: ReactNode\n index?: number\n totalSlides?: number\n className?: string\n}\n\nexport const CarouselSlide = ({\n children,\n index = 0,\n totalSlides,\n className = '',\n ...props\n}: CarouselSlideProps) => {\n const itemRef = useRef<HTMLDivElement>(null)\n const ctx = useCarouselContext()\n\n const isVisible = useIsVisible(itemRef, ctx.ref)\n\n return (\n <div\n data-spark-component=\"carousel-slide\"\n ref={itemRef}\n {...ctx.getSlideProps({ index, totalSlides: totalSlides as number })}\n className={cx('default:bg-surface relative overflow-hidden', className)}\n aria-hidden={!isVisible}\n inert={!isVisible}\n {...props}\n >\n {children}\n </div>\n )\n}\n\nCarouselSlide.displayName = 'Carousel.Slide'\n","import { useLayoutEffect, useState, RefObject } from 'react'\n\nexport function useIsVisible(\n elementRef: RefObject<HTMLElement | null>,\n parentRef: RefObject<HTMLElement | null>\n) {\n const [isVisible, setIsVisible] = useState(true)\n\n useLayoutEffect(() => {\n const el = elementRef.current\n const parent = parentRef.current\n\n if (!parent || !el) return\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (entry) {\n setIsVisible(entry.isIntersecting)\n }\n },\n { root: parent, threshold: 0.2 }\n )\n\n observer.observe(el)\n\n return () => observer.disconnect()\n })\n\n return isVisible\n}\n","import { cx } from 'class-variance-authority'\nimport { Children, cloneElement, ComponentProps, isValidElement, ReactNode } from 'react'\n\nimport { useCarouselContext } from './Carousel'\nimport { CarouselSlideProps } from './CarouselSlide'\n\ninterface Props extends ComponentProps<'div'> {\n children?: ReactNode\n className?: string\n}\n\nexport const CarouselSlides = ({ children, className = '' }: Props) => {\n const ctx = useCarouselContext()\n\n const childrenElements = Children.toArray(children)\n\n return (\n <div\n data-spark-component=\"carousel-slides\"\n {...ctx.getSlidesContainerProps()}\n className={cx(\n 'focus-visible:u-outline relative w-full',\n '[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',\n className\n )}\n >\n {childrenElements.map((child, index) =>\n isValidElement<CarouselSlideProps>(child)\n ? cloneElement(child, {\n index,\n totalSlides: childrenElements.length,\n })\n : child\n )}\n </div>\n )\n}\n\nCarouselSlides.displayName = 'Carousel.Slides'\n","import { ReactNode } from 'react'\n\ninterface Props {\n children: ReactNode\n}\n\nexport const CarouselViewport = ({ children }: Props) => {\n return <div className=\"relative flex items-center justify-around p-0\">{children}</div>\n}\n\nCarouselViewport.displayName = 'Carousel.Viewport'\n","import { Carousel as Root } from './Carousel'\nimport { CarouselControls as Controls } from './CarouselControls'\nimport { CarouselNextButton as NextButton } from './CarouselNextButton'\nimport { CarouselPageIndicator as PageIndicator } from './CarouselPageIndicator'\nimport { CarouselPagePicker as PagePicker } from './CarouselPagePicker'\nimport { CarouselPrevButton as PrevButton } from './CarouselPrevButton'\nimport { CarouselSlide as Slide } from './CarouselSlide'\nimport { CarouselSlides as Slides } from './CarouselSlides'\nimport { CarouselViewport as Viewport } from './CarouselViewport'\n\nexport const Carousel: typeof Root & {\n Controls: typeof Controls\n NextButton: typeof NextButton\n PrevButton: typeof PrevButton\n Slide: typeof Slide\n Slides: typeof Slides\n Viewport: typeof Viewport\n PagePicker: typeof PagePicker\n PageIndicator: typeof PageIndicator\n} = Object.assign(Root, {\n Controls,\n NextButton,\n PrevButton,\n Slide,\n Slides,\n Viewport,\n PagePicker,\n PageIndicator,\n})\n\nCarousel.displayName = 'Carousel'\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,UAAU;AACnB,SAAyB,eAA0B,kBAAkB;;;ACArE;AAAA,EAEE,eAAAA;AAAA,EACA,aAAAC;AAAA,EACA;AAAA,EACA,mBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,OACK;;;ACTP,SAAS,aAAa,iBAAiB,cAAc;AAQ9C,SAAS,SAAgC,UAAc;AAC5D,QAAM,MAAM,OAAgC,MAAM;AAChD,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE,CAAC;AAED,kBAAgB,MAAM;AACpB,QAAI,UAAU;AAAA,EAChB,CAAC;AAED,SAAO,YAAyB,IAAI,SAAS,IAAI,UAAU,GAAG,IAAI,G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S;AAClF;AAEA,iBAAiB,cAAc;;;ACAxB,IAAMC,YAST,OAAO,OAAO,UAAM;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEDA,UAAS,cAAc;","names":["useCallback","useEffect","useLayoutEffect","useRef","useState","useRef","useEffect","useRef","useLayoutEffect","startIndex","useState","useRef","useCallback","useEffect","useLayoutEffect","cx","jsx","cx","jsx","cx","useEffect","useRef","jsx","useRef","useEffect","cx","cx","jsx","cx","jsx","cx","useRef","useLayoutEffect","useState","jsx","useRef","cx","cx","jsx","cx","jsx","Carousel"]}
|
package/dist/docgen.json
CHANGED
|
@@ -3153,6 +3153,25 @@
|
|
|
3153
3153
|
"type": {
|
|
3154
3154
|
"name": "boolean"
|
|
3155
3155
|
}
|
|
3156
|
+
},
|
|
3157
|
+
"maxDots": {
|
|
3158
|
+
"defaultValue": null,
|
|
3159
|
+
"description": "Maximum number of dots to display in the page picker.",
|
|
3160
|
+
"name": "maxDots",
|
|
3161
|
+
"parent": {
|
|
3162
|
+
"fileName": "components/src/carousel/types.ts",
|
|
3163
|
+
"name": "UseCarouselProps"
|
|
3164
|
+
},
|
|
3165
|
+
"declarations": [
|
|
3166
|
+
{
|
|
3167
|
+
"fileName": "components/src/carousel/types.ts",
|
|
3168
|
+
"name": "UseCarouselProps"
|
|
3169
|
+
}
|
|
3170
|
+
],
|
|
3171
|
+
"required": false,
|
|
3172
|
+
"type": {
|
|
3173
|
+
"name": "number"
|
|
3174
|
+
}
|
|
3156
3175
|
}
|
|
3157
3176
|
}
|
|
3158
3177
|
},
|
|
@@ -4190,6 +4209,27 @@
|
|
|
4190
4209
|
"type": {
|
|
4191
4210
|
"name": "boolean"
|
|
4192
4211
|
}
|
|
4212
|
+
},
|
|
4213
|
+
"maxDots": {
|
|
4214
|
+
"defaultValue": {
|
|
4215
|
+
"value": 5
|
|
4216
|
+
},
|
|
4217
|
+
"description": "Maximum number of dots to display in the page picker.",
|
|
4218
|
+
"name": "maxDots",
|
|
4219
|
+
"parent": {
|
|
4220
|
+
"fileName": "components/src/carousel/types.ts",
|
|
4221
|
+
"name": "UseCarouselProps"
|
|
4222
|
+
},
|
|
4223
|
+
"declarations": [
|
|
4224
|
+
{
|
|
4225
|
+
"fileName": "components/src/carousel/types.ts",
|
|
4226
|
+
"name": "UseCarouselProps"
|
|
4227
|
+
}
|
|
4228
|
+
],
|
|
4229
|
+
"required": false,
|
|
4230
|
+
"type": {
|
|
4231
|
+
"name": "number"
|
|
4232
|
+
}
|
|
4193
4233
|
}
|
|
4194
4234
|
}
|
|
4195
4235
|
},
|
|
@@ -10531,6 +10571,76 @@
|
|
|
10531
10571
|
}
|
|
10532
10572
|
}
|
|
10533
10573
|
},
|
|
10574
|
+
"computeDotState": {
|
|
10575
|
+
"tags": {},
|
|
10576
|
+
"description": "Calculate the state of a dot indicator of a carousel depending on the current page and the total number of pages.",
|
|
10577
|
+
"displayName": "computeDotState",
|
|
10578
|
+
"methods": [],
|
|
10579
|
+
"props": {
|
|
10580
|
+
"dotIndex": {
|
|
10581
|
+
"defaultValue": null,
|
|
10582
|
+
"description": "",
|
|
10583
|
+
"name": "dotIndex",
|
|
10584
|
+
"declarations": [
|
|
10585
|
+
{
|
|
10586
|
+
"fileName": "components/src/carousel/utils.ts",
|
|
10587
|
+
"name": "TypeLiteral"
|
|
10588
|
+
}
|
|
10589
|
+
],
|
|
10590
|
+
"required": true,
|
|
10591
|
+
"type": {
|
|
10592
|
+
"name": "number"
|
|
10593
|
+
}
|
|
10594
|
+
},
|
|
10595
|
+
"pageState": {
|
|
10596
|
+
"defaultValue": null,
|
|
10597
|
+
"description": "",
|
|
10598
|
+
"name": "pageState",
|
|
10599
|
+
"declarations": [
|
|
10600
|
+
{
|
|
10601
|
+
"fileName": "components/src/carousel/utils.ts",
|
|
10602
|
+
"name": "TypeLiteral"
|
|
10603
|
+
}
|
|
10604
|
+
],
|
|
10605
|
+
"required": true,
|
|
10606
|
+
"type": {
|
|
10607
|
+
"name": "number"
|
|
10608
|
+
}
|
|
10609
|
+
},
|
|
10610
|
+
"totalPages": {
|
|
10611
|
+
"defaultValue": null,
|
|
10612
|
+
"description": "",
|
|
10613
|
+
"name": "totalPages",
|
|
10614
|
+
"declarations": [
|
|
10615
|
+
{
|
|
10616
|
+
"fileName": "components/src/carousel/utils.ts",
|
|
10617
|
+
"name": "TypeLiteral"
|
|
10618
|
+
}
|
|
10619
|
+
],
|
|
10620
|
+
"required": true,
|
|
10621
|
+
"type": {
|
|
10622
|
+
"name": "number"
|
|
10623
|
+
}
|
|
10624
|
+
},
|
|
10625
|
+
"maxDots": {
|
|
10626
|
+
"defaultValue": {
|
|
10627
|
+
"value": 5
|
|
10628
|
+
},
|
|
10629
|
+
"description": "",
|
|
10630
|
+
"name": "maxDots",
|
|
10631
|
+
"declarations": [
|
|
10632
|
+
{
|
|
10633
|
+
"fileName": "components/src/carousel/utils.ts",
|
|
10634
|
+
"name": "TypeLiteral"
|
|
10635
|
+
}
|
|
10636
|
+
],
|
|
10637
|
+
"required": false,
|
|
10638
|
+
"type": {
|
|
10639
|
+
"name": "number"
|
|
10640
|
+
}
|
|
10641
|
+
}
|
|
10642
|
+
}
|
|
10643
|
+
},
|
|
10534
10644
|
"Checkbox": {
|
|
10535
10645
|
"tags": {},
|
|
10536
10646
|
"description": "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-ui/components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.13.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Spark (Leboncoin design system) components.",
|
|
6
6
|
"exports": {
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@react-aria/toast": "^3.0.0-beta.18",
|
|
54
54
|
"@react-stately/numberfield": "3.9.11",
|
|
55
55
|
"@react-stately/toast": "^3.0.0-beta.7",
|
|
56
|
-
"@spark-ui/hooks": "^10.
|
|
57
|
-
"@spark-ui/icons": "^10.
|
|
58
|
-
"@spark-ui/internal-utils": "^10.
|
|
56
|
+
"@spark-ui/hooks": "^10.13.0",
|
|
57
|
+
"@spark-ui/icons": "^10.13.0",
|
|
58
|
+
"@spark-ui/internal-utils": "^10.13.0",
|
|
59
59
|
"@zag-js/pagination": "1.14.0",
|
|
60
60
|
"@zag-js/react": "1.14.0",
|
|
61
61
|
"class-variance-authority": "0.7.1",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"url": "https://github.com/leboncoin/spark-web/issues?q=is%3Aopen+label%3A%22Component%3A+button%22"
|
|
83
83
|
},
|
|
84
84
|
"homepage": "https://sparkui.vercel.app",
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "eb3215722000fa6a200c0fa2793ffd91fa6618f6"
|
|
86
86
|
}
|