@thewhatmatters/wmds 0.4.9 → 0.4.27
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/CHANGELOG.md +253 -0
- package/README.md +1 -1
- package/dist/components/atoms/Badge/Badge.d.ts +13 -5
- package/dist/components/atoms/Badge/Badge.d.ts.map +1 -1
- package/dist/components/atoms/Badge/Badge.js +56 -48
- package/dist/components/atoms/Badge/badgeStyles.d.ts +15 -0
- package/dist/components/atoms/Badge/badgeStyles.d.ts.map +1 -1
- package/dist/components/atoms/Badge/badgeStyles.js +38 -16
- package/dist/components/atoms/Button/Button.d.ts +1 -1
- package/dist/components/atoms/Button/Button.d.ts.map +1 -1
- package/dist/components/atoms/Button/Button.js +67 -48
- package/dist/components/atoms/Button/buttonStatusMotion.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStatusMotion.js +6 -1
- package/dist/components/atoms/Button/buttonStyles.d.ts +1 -1
- package/dist/components/atoms/Button/buttonStyles.d.ts.map +1 -1
- package/dist/components/atoms/Button/buttonStyles.js +14 -12
- package/dist/components/atoms/Input/Input.d.ts +3 -1
- package/dist/components/atoms/Input/Input.d.ts.map +1 -1
- package/dist/components/atoms/Input/Input.js +59 -59
- package/dist/components/atoms/Input/inputShellStyles.d.ts +9 -3
- package/dist/components/atoms/Input/inputShellStyles.d.ts.map +1 -1
- package/dist/components/atoms/Input/inputShellStyles.js +38 -38
- package/dist/components/atoms/RiveHand/RiveHand.d.ts.map +1 -1
- package/dist/components/atoms/RiveHand/RiveHand.js +83 -81
- package/dist/components/atoms/Table/Table.d.ts +54 -0
- package/dist/components/atoms/Table/Table.d.ts.map +1 -0
- package/dist/components/atoms/Table/Table.js +66 -0
- package/dist/components/atoms/Table/tableStyles.d.ts +18 -0
- package/dist/components/atoms/Table/tableStyles.d.ts.map +1 -0
- package/dist/components/atoms/Table/tableStyles.js +14 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts +6 -0
- package/dist/components/atoms/TextArea/TextArea.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/TextArea.js +86 -78
- package/dist/components/atoms/TextArea/textareaShellStyles.d.ts +2 -2
- package/dist/components/atoms/TextArea/textareaShellStyles.d.ts.map +1 -1
- package/dist/components/atoms/TextArea/textareaShellStyles.js +2 -2
- package/dist/components/molecules/Card/Card.d.ts +28 -6
- package/dist/components/molecules/Card/Card.d.ts.map +1 -1
- package/dist/components/molecules/Card/Card.js +83 -42
- package/dist/components/molecules/Card/cardStyles.d.ts +16 -1
- package/dist/components/molecules/Card/cardStyles.d.ts.map +1 -1
- package/dist/components/molecules/Card/cardStyles.js +18 -4
- package/dist/components/molecules/Chip/chipStyles.js +9 -9
- package/dist/components/molecules/CopyField/CopyField.d.ts +41 -0
- package/dist/components/molecules/CopyField/CopyField.d.ts.map +1 -0
- package/dist/components/molecules/CopyField/CopyField.js +120 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.d.ts +28 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.d.ts.map +1 -0
- package/dist/components/molecules/CopyField/copyFieldStyles.js +7 -0
- package/dist/components/molecules/DisplayControls/DisplayControls.d.ts +16 -7
- package/dist/components/molecules/DisplayControls/DisplayControls.d.ts.map +1 -1
- package/dist/components/molecules/DisplayControls/DisplayControls.js +41 -39
- package/dist/components/molecules/DisplayControls/displayControlsState.d.ts +21 -0
- package/dist/components/molecules/DisplayControls/displayControlsState.d.ts.map +1 -1
- package/dist/components/molecules/DisplayControls/displayControlsState.js +46 -4
- package/dist/components/molecules/LogView/LogView.d.ts +31 -0
- package/dist/components/molecules/LogView/LogView.d.ts.map +1 -0
- package/dist/components/molecules/LogView/LogView.js +109 -0
- package/dist/components/molecules/LogView/logViewStyles.d.ts +11 -0
- package/dist/components/molecules/LogView/logViewStyles.d.ts.map +1 -0
- package/dist/components/molecules/LogView/logViewStyles.js +6 -0
- package/dist/components/molecules/NavList/NavList.d.ts +23 -4
- package/dist/components/molecules/NavList/NavList.d.ts.map +1 -1
- package/dist/components/molecules/NavList/NavList.js +65 -52
- package/dist/components/molecules/NavList/navListStyles.d.ts +2 -0
- package/dist/components/molecules/NavList/navListStyles.d.ts.map +1 -1
- package/dist/components/molecules/NavList/navListStyles.js +3 -3
- package/dist/components/molecules/PageHeader/PageHeader.js +3 -3
- package/dist/components/molecules/SegmentedControl/segmentedControlStyles.js +7 -7
- package/dist/components/molecules/Stat/Stat.d.ts +31 -5
- package/dist/components/molecules/Stat/Stat.d.ts.map +1 -1
- package/dist/components/molecules/Stat/Stat.js +83 -49
- package/dist/components/molecules/Stat/statStyles.d.ts +23 -3
- package/dist/components/molecules/Stat/statStyles.d.ts.map +1 -1
- package/dist/components/molecules/Stat/statStyles.js +29 -12
- package/dist/components/molecules/TaskRows/TaskRows.d.ts +13 -3
- package/dist/components/molecules/TaskRows/TaskRows.d.ts.map +1 -1
- package/dist/components/molecules/TaskRows/TaskRows.js +81 -57
- package/dist/components/molecules/TaskRows/TaskRowsTable.d.ts +54 -0
- package/dist/components/molecules/TaskRows/TaskRowsTable.d.ts.map +1 -0
- package/dist/components/molecules/TaskRows/TaskRowsTable.js +200 -0
- package/dist/components/molecules/TaskRows/taskRowsStyles.d.ts +19 -1
- package/dist/components/molecules/TaskRows/taskRowsStyles.d.ts.map +1 -1
- package/dist/components/molecules/TaskRows/taskRowsStyles.js +7 -3
- package/dist/components/organisms/AppShell/AppShell.d.ts +82 -0
- package/dist/components/organisms/AppShell/AppShell.d.ts.map +1 -0
- package/dist/components/organisms/AppShell/AppShell.js +222 -0
- package/dist/components/organisms/AppShell/appShellStyles.d.ts +18 -0
- package/dist/components/organisms/AppShell/appShellStyles.d.ts.map +1 -0
- package/dist/components/organisms/AppShell/appShellStyles.js +8 -0
- package/dist/components/organisms/Carousel/Carousel.d.ts +9 -1
- package/dist/components/organisms/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/Carousel.js +220 -182
- package/dist/components/organisms/Carousel/carouselMath.d.ts +5 -0
- package/dist/components/organisms/Carousel/carouselMath.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/carouselMath.js +9 -1
- package/dist/components/organisms/Carousel/carouselStyles.d.ts +2 -0
- package/dist/components/organisms/Carousel/carouselStyles.d.ts.map +1 -1
- package/dist/components/organisms/Carousel/carouselStyles.js +8 -7
- package/dist/components/organisms/Chart/Chart.d.ts +5 -1
- package/dist/components/organisms/Chart/Chart.d.ts.map +1 -1
- package/dist/components/organisms/Chart/Chart.js +126 -62
- package/dist/components/organisms/Chart/ChartLegend.d.ts +8 -1
- package/dist/components/organisms/Chart/ChartLegend.d.ts.map +1 -1
- package/dist/components/organisms/Chart/ChartLegend.js +43 -13
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts +52 -0
- package/dist/components/organisms/Chart/ChartSegmentedRing.d.ts.map +1 -0
- package/dist/components/organisms/Chart/ChartSegmentedRing.js +95 -0
- package/dist/components/organisms/Chart/chartStyles.d.ts +32 -0
- package/dist/components/organisms/Chart/chartStyles.d.ts.map +1 -1
- package/dist/components/organisms/Chart/chartStyles.js +15 -3
- package/dist/components/organisms/ChatDock/ChatDock.d.ts.map +1 -1
- package/dist/components/organisms/ChatDock/ChatDock.js +29 -25
- package/dist/components/organisms/Dialog/OverlayPanelHeader.d.ts.map +1 -1
- package/dist/components/organisms/Dialog/OverlayPanelHeader.js +1 -0
- package/dist/components/organisms/Sheet/Sheet.d.ts +3 -1
- package/dist/components/organisms/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/organisms/Sheet/Sheet.js +74 -68
- package/dist/components/organisms/Sheet/sheetStyles.d.ts +8 -2
- package/dist/components/organisms/Sheet/sheetStyles.d.ts.map +1 -1
- package/dist/components/organisms/Sheet/sheetStyles.js +16 -11
- package/dist/components/organisms/Tab/tabStyles.js +7 -7
- package/dist/index.d.ts +14 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +148 -139
- package/dist/lib/chartTheme.d.ts +11 -0
- package/dist/lib/chartTheme.d.ts.map +1 -1
- package/dist/lib/compositionAudit.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.d.ts +7 -0
- package/dist/lib/dialogOverlay.d.ts.map +1 -1
- package/dist/lib/dialogOverlay.js +16 -1
- package/dist/lib/sheetParam/index.d.ts +3 -0
- package/dist/lib/sheetParam/index.d.ts.map +1 -0
- package/dist/lib/sheetParam/sheetParam.d.ts +15 -0
- package/dist/lib/sheetParam/sheetParam.d.ts.map +1 -0
- package/dist/lib/sheetParam/sheetParam.js +26 -0
- package/dist/lib/sheetParam/useSheetParam.d.ts +25 -0
- package/dist/lib/sheetParam/useSheetParam.d.ts.map +1 -0
- package/dist/lib/sheetParam/useSheetParam.js +29 -0
- package/dist/styles.css +1 -1
- package/docs/README.md +1 -1
- package/docs/component-contracts.md +101 -0
- package/docs/components.md +16 -11
- package/docs/exports.json +88 -15
- package/docs/patterns/components-accordion--flush.tsx +1 -1
- package/docs/patterns/components-appshell--portal-dashboard-pattern.tsx +176 -0
- package/docs/patterns/components-avatar--dropdown-row.tsx +1 -1
- package/docs/patterns/components-badge--outline-tags.tsx +1 -1
- package/docs/patterns/components-badge--status-pill.tsx +31 -0
- package/docs/patterns/components-badge--with-avatar.tsx +1 -1
- package/docs/patterns/components-breadcrumb--editorial.tsx +1 -1
- package/docs/patterns/components-breadcrumb--long-path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--path.tsx +1 -1
- package/docs/patterns/components-breadcrumb--router-links.tsx +1 -1
- package/docs/patterns/components-button-button--copy-button.tsx +1 -1
- package/docs/patterns/components-button-button--destructive-action.tsx +1 -1
- package/docs/patterns/components-button-button--external-link.tsx +1 -1
- package/docs/patterns/components-button-button--ghost-action.tsx +1 -1
- package/docs/patterns/components-button-button--inverse-action.tsx +1 -1
- package/docs/patterns/components-button-button--link-render.tsx +1 -1
- package/docs/patterns/components-button-button--multi-state-badge.tsx +1 -1
- package/docs/patterns/components-button-button--outline-mono.tsx +1 -1
- package/docs/patterns/components-button-button--primary-action.tsx +1 -1
- package/docs/patterns/components-button-button--row-hug.tsx +1 -1
- package/docs/patterns/components-button-button--row-layout.tsx +1 -1
- package/docs/patterns/components-button-button--secondary-action.tsx +1 -1
- package/docs/patterns/components-button-button--suggestion-pills.tsx +1 -1
- package/docs/patterns/components-button-button--with-count.tsx +1 -1
- package/docs/patterns/components-button-button--with-icon.tsx +1 -1
- package/docs/patterns/components-button-floatingactionbutton--vertical-actions.tsx +1 -1
- package/docs/patterns/components-calembed--pattern-skip-in-footer.tsx +1 -1
- package/docs/patterns/components-card-card--body-slot-occupancy-history.tsx +1 -1
- package/docs/patterns/components-card-card--headerless-media.tsx +1 -1
- package/docs/patterns/components-card-card--outlined-layout.tsx +1 -1
- package/docs/patterns/components-card-card--pinned-height.tsx +1 -1
- package/docs/patterns/components-card-card--terminal-frame.tsx +48 -0
- package/docs/patterns/components-card-selectablecard--selectable-cards-pattern.tsx +1 -1
- package/docs/patterns/components-carousel--image-carousel.tsx +1 -1
- package/docs/patterns/components-chart--audience-activity-heatmap.tsx +1 -1
- package/docs/patterns/components-chart--cartesian-no-data-gaps.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-history-in-card.tsx +1 -1
- package/docs/patterns/components-chart--occupancy-in-card.tsx +1 -1
- package/docs/patterns/components-chart--post-reach-distribution.tsx +1 -1
- package/docs/patterns/components-chart--ranked-audience-breakdown.tsx +1 -1
- package/docs/patterns/components-chart--revenue-by-line.tsx +68 -0
- package/docs/patterns/components-chart--segmented-ring-pattern.tsx +144 -0
- package/docs/patterns/components-chart--unit-grid-composition.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-chat-dock.tsx +1 -1
- package/docs/patterns/components-chatdock--pattern-start-project-gate.tsx +1 -1
- package/docs/patterns/components-chatqa--pattern-qa-with-reply.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-count.tsx +1 -1
- package/docs/patterns/components-checkbox-checkbox--with-description.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--default.tsx +1 -1
- package/docs/patterns/components-checkbox-checkboxgroup--option-counts.tsx +1 -1
- package/docs/patterns/components-copyfield--clipboard-blocked.tsx +9 -0
- package/docs/patterns/components-copyfield--copied.tsx +9 -0
- package/docs/patterns/components-copyfield--copy-key.tsx +9 -0
- package/docs/patterns/components-copyfield--on-navy.tsx +29 -0
- package/docs/patterns/components-descriptionlist--details.tsx +1 -1
- package/docs/patterns/components-descriptionlist--post-metadata.tsx +1 -1
- package/docs/patterns/components-dialog--alert-dialog-destructive.tsx +1 -1
- package/docs/patterns/components-dialog--default-dialog.tsx +1 -1
- package/docs/patterns/components-dialog--form-dialog.tsx +1 -1
- package/docs/patterns/components-displaycontrols--page-utilities.tsx +1 -1
- package/docs/patterns/components-displaycontrols--theme-switch.tsx +35 -0
- package/docs/patterns/components-field--horizontal-input.tsx +1 -1
- package/docs/patterns/components-field--horizontal-text-area.tsx +1 -1
- package/docs/patterns/components-field--multi-control.tsx +1 -1
- package/docs/patterns/components-filterpanel--panel.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-ruled-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-footerreveal--marketing-page-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--ruled-grid-footer-pattern.tsx +1 -1
- package/docs/patterns/components-footerreveal--sequenced-marketing-hero.tsx +1 -1
- package/docs/patterns/components-herointro--two-line-intro.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-pattern.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-text-sequence.tsx +1 -1
- package/docs/patterns/components-herotilestack--marketing-hero-with-gallery-intro.tsx +1 -1
- package/docs/patterns/components-indexlist--post-index.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--booked-pattern.tsx +1 -1
- package/docs/patterns/components-intakeconfirmation--emailed-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--about-you-pattern.tsx +1 -1
- package/docs/patterns/components-intakeform--short-form-pattern.tsx +1 -1
- package/docs/patterns/components-intakemodal--intake-modal-pattern.tsx +1 -1
- package/docs/patterns/components-kbd--command-row.tsx +1 -1
- package/docs/patterns/components-kbd--numbered-choices.tsx +1 -1
- package/docs/patterns/components-kbd--shortcut.tsx +1 -1
- package/docs/patterns/components-linktile--resource-tile.tsx +1 -1
- package/docs/patterns/components-linktile--router-link.tsx +1 -1
- package/docs/patterns/components-logview--detail-pane.tsx +80 -0
- package/docs/patterns/components-logview--log-viewer.tsx +20 -0
- package/docs/patterns/components-moremenu--action-menu.tsx +1 -1
- package/docs/patterns/components-moremenu--in-card-header.tsx +1 -1
- package/docs/patterns/components-navlist--app-sidebar.tsx +118 -0
- package/docs/patterns/components-navlist--side-nav-settings.tsx +1 -1
- package/docs/patterns/components-pageheader--app-header-pattern.tsx +1 -1
- package/docs/patterns/components-pageheader--page-section-header.tsx +1 -1
- package/docs/patterns/components-pageheader--toolbar-header.tsx +1 -1
- package/docs/patterns/components-panel--end-detail-rail.tsx +1 -1
- package/docs/patterns/components-pillgroup--pill-group-pattern.tsx +1 -1
- package/docs/patterns/components-promptbar--pattern-prompt-bar.tsx +1 -1
- package/docs/patterns/components-prose--article-body.tsx +1 -1
- package/docs/patterns/components-radio-radiogroup--default.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--project-gallery-pattern.tsx +1 -1
- package/docs/patterns/components-scrollhorizontal--with-intro.tsx +1 -1
- package/docs/patterns/components-sectioncaption--column-caption.tsx +1 -1
- package/docs/patterns/components-sectioncaption--with-action.tsx +1 -1
- package/docs/patterns/components-sheet--bottom-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--end-sheet.tsx +1 -1
- package/docs/patterns/components-sheet--side-sheet-header-actions.tsx +50 -0
- package/docs/patterns/components-sheet--side-sheet-url-deep-link.tsx +51 -0
- package/docs/patterns/components-sheet--side-sheet.tsx +38 -0
- package/docs/patterns/components-sitenav--brand-and-cta.tsx +1 -1
- package/docs/patterns/components-sitenav--centered-links.tsx +1 -1
- package/docs/patterns/components-sitenav--compact.tsx +1 -1
- package/docs/patterns/components-sitenav--marketing-header.tsx +1 -1
- package/docs/patterns/components-sitenav--mega-menu.tsx +1 -1
- package/docs/patterns/components-stat--hero-stat.tsx +54 -0
- package/docs/patterns/components-stat--insights-row.tsx +1 -1
- package/docs/patterns/components-stepprogress--step-progress-pattern.tsx +1 -1
- package/docs/patterns/components-switch--default.tsx +1 -1
- package/docs/patterns/components-switch--settings-row.tsx +1 -1
- package/docs/patterns/components-tab--settings-pages.tsx +1 -1
- package/docs/patterns/components-table--approvals-with-sheet.tsx +81 -0
- package/docs/patterns/components-table--approvals.tsx +223 -0
- package/docs/patterns/components-table--basic.tsx +60 -0
- package/docs/patterns/components-taskrows--action-details.tsx +1 -1
- package/docs/patterns/components-taskrows--capsules.tsx +1 -1
- package/docs/patterns/components-taskrows--card-with-status-rows.tsx +1 -1
- package/docs/patterns/components-taskrows--controlled-expand.tsx +1 -1
- package/docs/patterns/components-taskrows--custom-slots.tsx +1 -1
- package/docs/patterns/components-taskrows--needs-you-table.tsx +62 -0
- package/docs/patterns/components-taskrows--status-list.tsx +1 -1
- package/docs/patterns/components-taskrows--tag-chips.tsx +1 -1
- package/docs/patterns/components-textarea--save-status.tsx +32 -0
- package/docs/patterns/components-textlink--external-destination.tsx +1 -1
- package/docs/patterns/components-textlink--inline-prose.tsx +1 -1
- package/docs/patterns/components-textlink--quiet-title.tsx +1 -1
- package/docs/patterns/components-textlink--supporting-copy.tsx +1 -1
- package/docs/patterns/components-textsequence--default.tsx +1 -1
- package/docs/patterns/components-textsequence--reduced-motion.tsx +1 -1
- package/docs/patterns/components-textsequence--shapes.tsx +1 -1
- package/docs/patterns/components-tilegrid--masonry.tsx +1 -1
- package/docs/patterns/components-toast--stacked-notifications.tsx +1 -1
- package/docs/patterns/components-tooltip--controlled.tsx +1 -1
- package/docs/patterns/components-tooltip--disabled-control.tsx +1 -1
- package/docs/patterns/components-tooltip--icon-action.tsx +1 -1
- package/docs/patterns/components-tooltip--keyboard-shortcut.tsx +1 -1
- package/docs/patterns/components-tooltip--placement.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--horizontal-rail.tsx +1 -1
- package/docs/patterns/foundations-scroll-fade--overflowing-list.tsx +1 -1
- package/docs/patterns/guides-chart-explorations--comparison-gallery.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-grid.tsx +1 -1
- package/docs/patterns/guides-filter-panel--filtered-index.tsx +1 -1
- package/docs/patterns/guides-overlay-flows--notification-preferences.tsx +1 -1
- package/docs/patterns/guides-post-page--post-page.tsx +1 -1
- package/docs/patterns/guides-profile-typography--editorial-profile.tsx +1 -1
- package/docs/patterns/guides-resource-detail--detail.tsx +1 -1
- package/docs/patterns/index.json +177 -1
- package/package.json +1 -1
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
3
|
import { motionTransitionProp as t } from "../../../lib/motion.js";
|
|
4
|
-
import {
|
|
5
|
-
import { carouselBreakpoints as
|
|
6
|
-
import { Children as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { animate as
|
|
4
|
+
import { carouselActiveIndex as n, carouselClamp as r, carouselMaxScroll as i, carouselNearestSnap as a, carouselOverflows as o, carouselOverscrollOffset as s, carouselProgress as c, carouselProgressAtPointer as l, carouselSnapPoints as u, carouselStep as d, carouselThumbShare as f } from "./carouselMath.js";
|
|
5
|
+
import { carouselBreakpoints as p, carouselCounterClasses as m, carouselDefaultItemWidth as h, carouselExtentClasses as ee, carouselFrameClasses as te, carouselItemClasses as ne, carouselProgressClasses as re, carouselProgressPlacementClasses as ie, carouselProgressPlacements as ae, carouselProgressThumbClasses as oe, carouselProgressTrackClasses as se, carouselRootClasses as ce, carouselTrackClasses as le, carouselViewportClasses as ue } from "./carouselStyles.js";
|
|
6
|
+
import { Children as de, createContext as g, isValidElement as fe, useCallback as _, useContext as v, useEffect as y, useLayoutEffect as pe, useMemo as me, useRef as b, useState as he } from "react";
|
|
7
|
+
import { jsx as x, jsxs as ge } from "react/jsx-runtime";
|
|
8
|
+
import { animate as _e, motion as ve, useMotionValue as ye, useMotionValueEvent as be, useReducedMotion as xe, useTransform as Se } from "motion/react";
|
|
9
9
|
//#region src/components/organisms/Carousel/Carousel.tsx
|
|
10
|
-
var
|
|
11
|
-
|
|
10
|
+
var S = g(null), Ce = {
|
|
11
|
+
item: (e, t) => `${e} of ${t}`,
|
|
12
|
+
counter: (e, t) => `${e} of ${t}`
|
|
13
|
+
}, we = 120, Te = 10;
|
|
14
|
+
function Ee(e, t) {
|
|
12
15
|
try {
|
|
13
16
|
e.setPointerCapture(t);
|
|
14
17
|
} catch {}
|
|
15
18
|
}
|
|
16
|
-
function
|
|
19
|
+
function De(e) {
|
|
17
20
|
if (typeof e == "number") return {
|
|
18
21
|
base: e,
|
|
19
22
|
sm: e,
|
|
20
23
|
md: e,
|
|
21
24
|
lg: e
|
|
22
25
|
};
|
|
23
|
-
let t = e.base ??
|
|
26
|
+
let t = e.base ?? h.base, n = e.sm ?? t, r = e.md ?? n;
|
|
24
27
|
return {
|
|
25
28
|
base: t,
|
|
26
29
|
sm: n,
|
|
@@ -28,158 +31,180 @@ function xe(e) {
|
|
|
28
31
|
lg: e.lg ?? r
|
|
29
32
|
};
|
|
30
33
|
}
|
|
31
|
-
function
|
|
34
|
+
function Oe(e, t, n) {
|
|
32
35
|
n ? e.style.removeProperty(t) : e.style.setProperty(t, "0px");
|
|
33
36
|
}
|
|
34
|
-
function
|
|
35
|
-
let
|
|
37
|
+
function C({ "aria-label": p, "aria-labelledby": ne, itemWidth: ae = h, snap: g = !0, bleed: v = !1, fade: me = !0, progress: S = "center", counter: C = !1, onIndexChange: w, activeIndex: T, labels: E, children: Ae, className: je }) {
|
|
38
|
+
let D = xe() ?? !1, O = b(null), k = b(null), A = b(null), j = b(null), Me = b(null), M = b({
|
|
36
39
|
max: 0,
|
|
37
40
|
points: [0],
|
|
41
|
+
offsets: [],
|
|
38
42
|
direction: 1
|
|
39
|
-
}),
|
|
40
|
-
let e =
|
|
43
|
+
}), N = b(null), P = b(null), F = b(null), I = b(null), L = b(!1), [R, Ne] = he(null), [Pe, Fe] = he(0), z = b(void 0), Ie = b(0), B = b(void 0), Le = b(0), Re = b(w), ze = b(() => {}), V = ye(0), H = ye(0), Be = Se(H, (e) => -M.current.direction * s(e)), U = _(() => Math.abs(k.current?.scrollLeft ?? 0), []), W = _(() => {
|
|
44
|
+
let e = O.current, t = k.current;
|
|
41
45
|
if (!e || !t) return;
|
|
42
|
-
let { max:
|
|
43
|
-
e.style.setProperty("--carousel-progress", String(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
let { max: r } = M.current, i = Math.abs(t.scrollLeft);
|
|
47
|
+
e.style.setProperty("--carousel-progress", String(c(i, r))), Oe(t, "--scroll-fade-s", i > 1), Oe(t, "--scroll-fade-e", i < r - 1), window.clearTimeout(z.current), z.current = window.setTimeout(() => {
|
|
48
|
+
let e = n(M.current.offsets, Math.abs(t.scrollLeft), M.current.max);
|
|
49
|
+
Fe(e), e !== Ie.current && (Ie.current = e, Re.current?.(e, Le.current));
|
|
50
|
+
}, we);
|
|
51
|
+
}, []), Ve = _((e) => {
|
|
52
|
+
let t = k.current;
|
|
53
|
+
t && (t.scrollLeft = M.current.direction * e, W());
|
|
54
|
+
}, [W]);
|
|
55
|
+
be(V, "change", (e) => {
|
|
56
|
+
let t = r(e, 0, M.current.max);
|
|
57
|
+
Ve(t), H.set(D ? 0 : e - t);
|
|
51
58
|
});
|
|
52
|
-
function
|
|
53
|
-
let t =
|
|
59
|
+
function G(e) {
|
|
60
|
+
let t = k.current;
|
|
54
61
|
t && (e ? t.dataset.moving = "" : delete t.dataset.moving);
|
|
55
62
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
63
|
+
function K() {
|
|
64
|
+
N.current?.stop(), N.current = null, P.current = null;
|
|
58
65
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
66
|
+
function q() {
|
|
67
|
+
N.current = null, P.current = null, G(!1);
|
|
61
68
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
69
|
+
function He() {
|
|
70
|
+
N.current != null && (K(), V.jump(U()), G(!1));
|
|
64
71
|
}
|
|
65
|
-
function
|
|
66
|
-
let i =
|
|
67
|
-
if (
|
|
68
|
-
|
|
72
|
+
function J(e, n = !0) {
|
|
73
|
+
let i = r(e, 0, M.current.max);
|
|
74
|
+
if (K(), V.jump(U()), D || !n) {
|
|
75
|
+
G(!1), V.jump(i);
|
|
69
76
|
return;
|
|
70
77
|
}
|
|
71
|
-
|
|
78
|
+
P.current = i, G(!0), N.current = _e(V, i, {
|
|
72
79
|
...t("medium"),
|
|
73
|
-
onComplete:
|
|
80
|
+
onComplete: q
|
|
74
81
|
});
|
|
75
82
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
y(() => {
|
|
84
|
+
Re.current = w, ze.current = J;
|
|
85
|
+
});
|
|
86
|
+
function Ue(e) {
|
|
87
|
+
let { max: t, points: n } = M.current, i = (e) => a(n, r(e, 0, t));
|
|
88
|
+
if (K(), D) {
|
|
89
|
+
J(g ? i(V.get()) : V.get(), !1);
|
|
80
90
|
return;
|
|
81
91
|
}
|
|
82
|
-
let o =
|
|
92
|
+
let o = V.get(), s = g ? i(o) : r(o, 0, t);
|
|
83
93
|
if (e === 0 && s === o) {
|
|
84
|
-
|
|
94
|
+
q();
|
|
85
95
|
return;
|
|
86
96
|
}
|
|
87
|
-
|
|
97
|
+
G(!0), N.current = _e(V, s === o ? o + Math.sign(e) : s, {
|
|
88
98
|
type: "inertia",
|
|
89
99
|
velocity: e,
|
|
90
100
|
min: 0,
|
|
91
101
|
max: t,
|
|
92
|
-
modifyTarget:
|
|
93
|
-
onComplete:
|
|
102
|
+
modifyTarget: g ? i : void 0,
|
|
103
|
+
onComplete: q
|
|
94
104
|
});
|
|
95
105
|
}
|
|
96
|
-
let
|
|
97
|
-
let e =
|
|
98
|
-
if (!e || !t || !n ||
|
|
99
|
-
if (
|
|
106
|
+
let Y = _(() => {
|
|
107
|
+
let e = O.current, t = k.current, n = A.current;
|
|
108
|
+
if (!e || !t || !n || H.get() !== 0) return;
|
|
109
|
+
if (v) {
|
|
100
110
|
let t = e.getBoundingClientRect(), n = Math.max(0, Math.floor(t.left)), r = Math.max(0, Math.floor(document.documentElement.clientWidth - t.right));
|
|
101
111
|
e.style.setProperty("--carousel-bleed-left", `${n}px`), e.style.setProperty("--carousel-bleed-right", `${r}px`);
|
|
102
112
|
} else e.style.removeProperty("--carousel-bleed-left"), e.style.removeProperty("--carousel-bleed-right");
|
|
103
|
-
let
|
|
113
|
+
let r = getComputedStyle(t).direction === "rtl" ? -1 : 1, a = t.clientWidth, s = t.scrollWidth, c = i(a, s), l = Array.from(n.querySelectorAll(":scope > [data-carousel-item]")), d = l[0]?.getBoundingClientRect(), p = d == null ? [] : l.map((e) => {
|
|
104
114
|
let t = e.getBoundingClientRect();
|
|
105
|
-
return
|
|
115
|
+
return r === 1 ? t.left - d.left : d.right - t.right;
|
|
106
116
|
});
|
|
107
|
-
|
|
117
|
+
M.current = {
|
|
108
118
|
max: c,
|
|
109
|
-
direction:
|
|
110
|
-
points:
|
|
119
|
+
direction: r,
|
|
120
|
+
points: u(p, c),
|
|
121
|
+
offsets: p
|
|
111
122
|
};
|
|
112
|
-
let m =
|
|
113
|
-
m && e.style.setProperty("--carousel-thumb", String(
|
|
114
|
-
let h = a
|
|
115
|
-
|
|
123
|
+
let m = j.current;
|
|
124
|
+
m && e.style.setProperty("--carousel-thumb", String(f(a, s, m.clientWidth))), W();
|
|
125
|
+
let h = o(a, s);
|
|
126
|
+
Ne((e) => e === h ? e : h);
|
|
116
127
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
v,
|
|
129
|
+
H,
|
|
130
|
+
W
|
|
120
131
|
]);
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
let e = new ResizeObserver(
|
|
132
|
+
pe(() => {
|
|
133
|
+
if (Y(), window.addEventListener("resize", Y), typeof ResizeObserver > "u") return () => window.removeEventListener("resize", Y);
|
|
134
|
+
let e = new ResizeObserver(Y);
|
|
124
135
|
for (let t of [
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
136
|
+
O.current,
|
|
137
|
+
k.current,
|
|
138
|
+
A.current,
|
|
139
|
+
j.current
|
|
129
140
|
]) t && e.observe(t);
|
|
130
141
|
return () => {
|
|
131
|
-
e.disconnect(), window.removeEventListener("resize",
|
|
142
|
+
e.disconnect(), window.removeEventListener("resize", Y);
|
|
132
143
|
};
|
|
133
|
-
}, [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
144
|
+
}, [Y, S]), y(() => () => {
|
|
145
|
+
N.current?.stop(), window.clearTimeout(z.current);
|
|
146
|
+
}, []), y(() => {
|
|
147
|
+
if (T == null || R == null || T === B.current) return;
|
|
148
|
+
let { offsets: e, max: t } = M.current;
|
|
149
|
+
if (e.length === 0) return;
|
|
150
|
+
let n = B.current === void 0;
|
|
151
|
+
B.current = T;
|
|
152
|
+
let i = e[r(Math.round(T), 0, e.length - 1)];
|
|
153
|
+
ze.current(g ? a(M.current.points, i) : r(i, 0, t), !n);
|
|
154
|
+
}, [
|
|
155
|
+
T,
|
|
156
|
+
R,
|
|
157
|
+
g
|
|
158
|
+
]);
|
|
159
|
+
function We(e) {
|
|
160
|
+
if (e.pointerType !== "mouse" || e.button !== 0 || M.current.max <= 0) return;
|
|
161
|
+
let t = N.current != null;
|
|
162
|
+
K(), V.jump(U()), F.current = {
|
|
138
163
|
pointerId: e.pointerId,
|
|
139
164
|
startX: e.clientX,
|
|
140
|
-
startPosition:
|
|
165
|
+
startPosition: U(),
|
|
141
166
|
active: !1,
|
|
142
167
|
interrupted: t
|
|
143
168
|
};
|
|
144
169
|
}
|
|
145
|
-
function
|
|
146
|
-
let t =
|
|
170
|
+
function Ge(e) {
|
|
171
|
+
let t = F.current;
|
|
147
172
|
if (!(!t || t.pointerId !== e.pointerId)) {
|
|
148
173
|
if (e.buttons === 0) {
|
|
149
|
-
|
|
174
|
+
X(e);
|
|
150
175
|
return;
|
|
151
176
|
}
|
|
152
177
|
if (!t.active) {
|
|
153
178
|
if (Math.abs(e.clientX - t.startX) < 4) return;
|
|
154
|
-
t.active = !0, t.startX = e.clientX,
|
|
179
|
+
t.active = !0, t.startX = e.clientX, Ee(e.currentTarget, e.pointerId), e.currentTarget.dataset.dragging = "", G(!0);
|
|
155
180
|
}
|
|
156
|
-
|
|
181
|
+
V.set(t.startPosition - M.current.direction * (e.clientX - t.startX));
|
|
157
182
|
}
|
|
158
183
|
}
|
|
159
|
-
function
|
|
160
|
-
let t =
|
|
184
|
+
function X(e) {
|
|
185
|
+
let t = F.current;
|
|
161
186
|
if (!t || t.pointerId !== e.pointerId) return;
|
|
162
|
-
if (
|
|
163
|
-
t.interrupted &&
|
|
187
|
+
if (F.current = null, !t.active) {
|
|
188
|
+
t.interrupted && Ue(0);
|
|
164
189
|
return;
|
|
165
190
|
}
|
|
166
191
|
let n = e.currentTarget;
|
|
167
|
-
n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), delete n.dataset.dragging,
|
|
168
|
-
|
|
169
|
-
}, 0),
|
|
192
|
+
n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), delete n.dataset.dragging, L.current = !0, window.setTimeout(() => {
|
|
193
|
+
L.current = !1;
|
|
194
|
+
}, 0), Ue(e.type === "pointercancel" ? 0 : V.getVelocity());
|
|
170
195
|
}
|
|
171
|
-
function
|
|
172
|
-
|
|
196
|
+
function Ke(e) {
|
|
197
|
+
L.current && (L.current = !1, e.preventDefault(), e.stopPropagation());
|
|
173
198
|
}
|
|
174
|
-
function
|
|
199
|
+
function qe(e) {
|
|
175
200
|
if (e.target !== e.currentTarget || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
176
|
-
let { max: t, points: n, direction: r } =
|
|
201
|
+
let { max: t, points: n, direction: r } = M.current, i = P.current ?? U(), a;
|
|
177
202
|
switch (e.key) {
|
|
178
203
|
case "ArrowRight":
|
|
179
|
-
a =
|
|
204
|
+
a = d(n, i, r);
|
|
180
205
|
break;
|
|
181
206
|
case "ArrowLeft":
|
|
182
|
-
a =
|
|
207
|
+
a = d(n, i, r === 1 ? -1 : 1);
|
|
183
208
|
break;
|
|
184
209
|
case "Home":
|
|
185
210
|
a = 0;
|
|
@@ -189,122 +214,135 @@ function D({ "aria-label": f, "aria-labelledby": g, itemWidth: _ = p, snap: v =
|
|
|
189
214
|
break;
|
|
190
215
|
default: return;
|
|
191
216
|
}
|
|
192
|
-
e.preventDefault(),
|
|
217
|
+
e.preventDefault(), J(a);
|
|
193
218
|
}
|
|
194
|
-
function
|
|
195
|
-
let t =
|
|
219
|
+
function Je(e) {
|
|
220
|
+
let t = j.current, n = Me.current, { max: r, points: i, direction: o } = M.current;
|
|
196
221
|
if (!t || !n || r <= 0 || e.button !== 0) return;
|
|
197
222
|
e.preventDefault();
|
|
198
|
-
let
|
|
199
|
-
if (e.clientX >= u.left -
|
|
200
|
-
|
|
223
|
+
let s = t.getBoundingClientRect(), u = n.getBoundingClientRect();
|
|
224
|
+
if (e.clientX >= u.left - Te && e.clientX <= u.right + Te) {
|
|
225
|
+
K(), V.jump(U()), G(!0), Ee(e.currentTarget, e.pointerId), e.currentTarget.dataset.scrubbing = "", I.current = {
|
|
201
226
|
pointerId: e.pointerId,
|
|
202
227
|
startX: e.clientX,
|
|
203
|
-
startProgress:
|
|
204
|
-
travel:
|
|
228
|
+
startProgress: c(U(), r),
|
|
229
|
+
travel: s.width - u.width
|
|
205
230
|
};
|
|
206
231
|
return;
|
|
207
232
|
}
|
|
208
|
-
let d = o === 1 ? e.clientX -
|
|
209
|
-
|
|
233
|
+
let d = o === 1 ? e.clientX - s.left : s.right - e.clientX, f = l(d, s.width, u.width) * r;
|
|
234
|
+
J(g ? a(i, f) : f);
|
|
210
235
|
}
|
|
211
|
-
function
|
|
212
|
-
let t =
|
|
236
|
+
function Ye(e) {
|
|
237
|
+
let t = I.current;
|
|
213
238
|
if (!t || t.pointerId !== e.pointerId || t.travel <= 0) return;
|
|
214
|
-
let { max:
|
|
215
|
-
|
|
239
|
+
let { max: n, direction: i } = M.current, a = i * (e.clientX - t.startX) / t.travel;
|
|
240
|
+
V.set(r(t.startProgress + a, 0, 1) * n);
|
|
216
241
|
}
|
|
217
|
-
function
|
|
218
|
-
let t =
|
|
242
|
+
function Xe(e) {
|
|
243
|
+
let t = I.current;
|
|
219
244
|
if (!t || t.pointerId !== e.pointerId) return;
|
|
220
|
-
|
|
245
|
+
I.current = null;
|
|
221
246
|
let n = e.currentTarget;
|
|
222
|
-
n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), delete n.dataset.scrubbing,
|
|
247
|
+
n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), delete n.dataset.scrubbing, g ? J(a(M.current.points, U())) : G(!1);
|
|
223
248
|
}
|
|
224
|
-
let
|
|
225
|
-
"--carousel-item": String(
|
|
226
|
-
"--carousel-item-sm": String(
|
|
227
|
-
"--carousel-item-md": String(
|
|
228
|
-
"--carousel-item-lg": String(
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
249
|
+
let Z = De(ae), Ze = {
|
|
250
|
+
"--carousel-item": String(Z.base),
|
|
251
|
+
"--carousel-item-sm": String(Z.sm),
|
|
252
|
+
"--carousel-item-md": String(Z.md),
|
|
253
|
+
"--carousel-item-lg": String(Z.lg)
|
|
254
|
+
}, Qe = E?.item ?? Ce.item, Q = de.toArray(Ae);
|
|
255
|
+
Le.current = Q.length;
|
|
256
|
+
let $e = (E?.counter ?? Ce.counter)(Math.min(Pe, Math.max(Q.length - 1, 0)) + 1, Q.length), $ = R == null ? void 0 : String(R);
|
|
257
|
+
return /* @__PURE__ */ ge("div", {
|
|
258
|
+
ref: O,
|
|
259
|
+
className: e(ce, je),
|
|
260
|
+
style: Ze,
|
|
234
261
|
"data-carousel": "",
|
|
235
|
-
children: [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ x("div", {
|
|
264
|
+
className: te,
|
|
265
|
+
children: /* @__PURE__ */ x("div", {
|
|
266
|
+
ref: k,
|
|
267
|
+
role: "region",
|
|
268
|
+
"aria-label": p,
|
|
269
|
+
"aria-labelledby": ne,
|
|
270
|
+
tabIndex: R === !1 ? void 0 : 0,
|
|
271
|
+
"data-carousel-viewport": "",
|
|
272
|
+
"data-overflowing": $,
|
|
273
|
+
className: e(ue, g && "snap-x snap-mandatory data-[moving]:snap-none", me && "scroll-fade-x"),
|
|
274
|
+
style: { "--scroll-fade-s": "0px" },
|
|
275
|
+
onScroll: W,
|
|
276
|
+
onKeyDown: qe,
|
|
277
|
+
onPointerDown: We,
|
|
278
|
+
onPointerMove: Ge,
|
|
279
|
+
onPointerUp: X,
|
|
280
|
+
onPointerCancel: X,
|
|
281
|
+
onClickCapture: Ke,
|
|
282
|
+
onDragStart: (e) => e.preventDefault(),
|
|
283
|
+
onWheel: He,
|
|
284
|
+
onTouchStart: He,
|
|
285
|
+
children: /* @__PURE__ */ x("div", {
|
|
286
|
+
className: ee,
|
|
287
|
+
children: /* @__PURE__ */ x(ve.div, {
|
|
288
|
+
ref: A,
|
|
289
|
+
className: le,
|
|
290
|
+
style: { x: Be },
|
|
291
|
+
children: Q.map((e, t) => /* @__PURE__ */ x(ke, {
|
|
292
|
+
label: Qe(t + 1, Q.length),
|
|
293
|
+
children: e
|
|
294
|
+
}, fe(e) && e.key != null ? e.key : t))
|
|
295
|
+
})
|
|
267
296
|
})
|
|
268
297
|
})
|
|
269
|
-
})
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
298
|
+
}),
|
|
299
|
+
S === "none" ? null : /* @__PURE__ */ x("div", {
|
|
300
|
+
"aria-hidden": "true",
|
|
301
|
+
"data-carousel-progress": "",
|
|
302
|
+
"data-overflowing": $,
|
|
303
|
+
className: e(re, ie[S]),
|
|
304
|
+
onPointerDown: Je,
|
|
305
|
+
onPointerMove: Ye,
|
|
306
|
+
onPointerUp: Xe,
|
|
307
|
+
onPointerCancel: Xe,
|
|
308
|
+
children: /* @__PURE__ */ x("div", {
|
|
309
|
+
ref: j,
|
|
310
|
+
className: se,
|
|
311
|
+
children: /* @__PURE__ */ x("div", {
|
|
312
|
+
ref: Me,
|
|
313
|
+
className: oe,
|
|
314
|
+
"data-carousel-progress-thumb": ""
|
|
315
|
+
})
|
|
286
316
|
})
|
|
287
|
-
})
|
|
288
|
-
|
|
317
|
+
}),
|
|
318
|
+
C ? /* @__PURE__ */ x("p", {
|
|
319
|
+
"aria-live": "polite",
|
|
320
|
+
"aria-atomic": "true",
|
|
321
|
+
"data-carousel-counter": "",
|
|
322
|
+
"data-overflowing": $,
|
|
323
|
+
className: m,
|
|
324
|
+
children: $e
|
|
325
|
+
}) : null
|
|
326
|
+
]
|
|
289
327
|
});
|
|
290
328
|
}
|
|
291
|
-
function
|
|
292
|
-
let n =
|
|
293
|
-
return /* @__PURE__ */
|
|
329
|
+
function ke({ label: e, children: t }) {
|
|
330
|
+
let n = me(() => ({ label: e }), [e]);
|
|
331
|
+
return /* @__PURE__ */ x(S.Provider, {
|
|
294
332
|
value: n,
|
|
295
333
|
children: t
|
|
296
334
|
});
|
|
297
335
|
}
|
|
298
|
-
function
|
|
299
|
-
let r =
|
|
300
|
-
return /* @__PURE__ */
|
|
336
|
+
function w({ children: t, className: n }) {
|
|
337
|
+
let r = v(S);
|
|
338
|
+
return /* @__PURE__ */ x("div", {
|
|
301
339
|
role: "group",
|
|
302
340
|
"aria-label": r?.label,
|
|
303
341
|
"data-carousel-item": "",
|
|
304
|
-
className: e(
|
|
342
|
+
className: e(ne, n),
|
|
305
343
|
children: t
|
|
306
344
|
});
|
|
307
345
|
}
|
|
308
|
-
var
|
|
346
|
+
var T = Object.assign(C, { Item: w });
|
|
309
347
|
//#endregion
|
|
310
|
-
export {
|
|
348
|
+
export { T as Carousel, p as carouselBreakpoints, h as carouselDefaultItemWidth, ae as carouselProgressPlacements };
|
|
@@ -36,4 +36,9 @@ export declare function carouselThumbShare(viewWidth: number, contentWidth: numb
|
|
|
36
36
|
export declare function carouselProgressAtPointer(pointer: number, trackWidth: number, thumbWidth: number): number;
|
|
37
37
|
/** How far the row shifts for an overscroll of `overshoot` px. */
|
|
38
38
|
export declare function carouselOverscrollOffset(overshoot: number): number;
|
|
39
|
+
/**
|
|
40
|
+
* The item the row rests on, 0-based: the one whose leading edge is nearest `position`. At the
|
|
41
|
+
* end of the row it is the last item, which can share its resting place with several before it.
|
|
42
|
+
*/
|
|
43
|
+
export declare function carouselActiveIndex(itemOffsets: readonly number[], position: number, maxScroll: number): number;
|
|
39
44
|
//# sourceMappingURL=carouselMath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carouselMath.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Carousel/carouselMath.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qEAAqE;AACrE,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAKxC,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,4DAA4D;AAC5D,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAElF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAS9F;AAED,+CAA+C;AAC/C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMvF;AAED,kGAAkG;AAClG,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAQnG;AAED,yBAAyB;AACzB,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAItG;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIzG;AAED,kEAAkE;AAClE,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE"}
|
|
1
|
+
{"version":3,"file":"carouselMath.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Carousel/carouselMath.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qEAAqE;AACrE,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAKxC,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED,4DAA4D;AAC5D,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,mDAAmD;AACnD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAElF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAS9F;AAED,+CAA+C;AAC/C,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMvF;AAED,kGAAkG;AAClG,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAQnG;AAED,yBAAyB;AACzB,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAItG;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAIzG;AAED,kEAAkE;AAClE,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAS/G"}
|
|
@@ -43,5 +43,13 @@ function l(e, n, r) {
|
|
|
43
43
|
function u(t) {
|
|
44
44
|
return t * e;
|
|
45
45
|
}
|
|
46
|
+
function d(e, t, n) {
|
|
47
|
+
let r = e.length;
|
|
48
|
+
if (r === 0) return 0;
|
|
49
|
+
if (n > 0 && t >= n - 1) return r - 1;
|
|
50
|
+
let i = 0;
|
|
51
|
+
for (let n = 1; n < r; n += 1) Math.abs(e[n] - t) < Math.abs(e[i] - t) && (i = n);
|
|
52
|
+
return i;
|
|
53
|
+
}
|
|
46
54
|
//#endregion
|
|
47
|
-
export { t as carouselClamp, n as carouselMaxScroll, a as carouselNearestSnap, r as carouselOverflows, e as carouselOverscrollElasticity, u as carouselOverscrollOffset, s as carouselProgress, l as carouselProgressAtPointer, i as carouselSnapPoints, o as carouselStep, c as carouselThumbShare };
|
|
55
|
+
export { d as carouselActiveIndex, t as carouselClamp, n as carouselMaxScroll, a as carouselNearestSnap, r as carouselOverflows, e as carouselOverscrollElasticity, u as carouselOverscrollOffset, s as carouselProgress, l as carouselProgressAtPointer, i as carouselSnapPoints, o as carouselStep, c as carouselThumbShare };
|
|
@@ -46,4 +46,6 @@ export declare const carouselProgressPlacementClasses: Record<Exclude<CarouselPr
|
|
|
46
46
|
export declare const carouselProgressTrackClasses: string;
|
|
47
47
|
/** The filled part: its width is the share of the row in view, its place the row's progress. */
|
|
48
48
|
export declare const carouselProgressThumbClasses: string;
|
|
49
|
+
/** The "1 of 6" line under the row. Like the scrubber, it keeps its space when every item fits. */
|
|
50
|
+
export declare const carouselCounterClasses: string;
|
|
49
51
|
//# sourceMappingURL=carouselStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carouselStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Carousel/carouselStyles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"carouselStyles.d.ts","sourceRoot":"","sources":["../../../../src/components/organisms/Carousel/carouselStyles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,8CAA+C,CAAC;AAEvF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpF,eAAO,MAAM,mBAAmB,qCAAsC,CAAC;AAEvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,2GAA2G;AAC3G,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;AAErF,qGAAqG;AACrG,eAAO,MAAM,wBAAwB;;;;CAAoE,CAAC;AAE1G,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,qDAAqD,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAMhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,QAKnC,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,2BAA2B,kDAAkD,CAAC;AAE3F,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,qBAAqB,8FAC2D,CAAC;AAE9F,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,QAGhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAI/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,4IACuG,CAAC;AAE5I,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,OAAO,CAAC,yBAAyB,EAAE,MAAM,CAAC,EAAE,MAAM,CAIvG,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAIxC,CAAC;AAEF,gGAAgG;AAChG,eAAO,MAAM,4BAA4B,QAMxC,CAAC;AAEF,mGAAmG;AACnG,eAAO,MAAM,sBAAsB,QAC4E,CAAC"}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../../lib/cn.js";
|
|
3
|
-
import {
|
|
3
|
+
import { typographyClass as t } from "../../../lib/typography.js";
|
|
4
|
+
import { focusRingTransitionClasses as n, motionTransition as r } from "../../../lib/motion.js";
|
|
4
5
|
//#region src/components/organisms/Carousel/carouselStyles.ts
|
|
5
|
-
var
|
|
6
|
+
var i = [
|
|
6
7
|
"center",
|
|
7
8
|
"start",
|
|
8
9
|
"full",
|
|
9
10
|
"none"
|
|
10
|
-
],
|
|
11
|
+
], a = [
|
|
11
12
|
"base",
|
|
12
13
|
"sm",
|
|
13
14
|
"md",
|
|
14
15
|
"lg"
|
|
15
|
-
],
|
|
16
|
+
], o = {
|
|
16
17
|
base: 80,
|
|
17
18
|
sm: 55,
|
|
18
19
|
lg: 40
|
|
19
|
-
},
|
|
20
|
+
}, s = "@container/carousel flex w-full min-w-0 flex-col", c = e("relative rounded-[var(--radius-card-shell)]", "ml-[calc(var(--carousel-bleed-left,0px)*-1)] mr-[calc(var(--carousel-bleed-right,0px)*-1)]", "has-[>[data-carousel-viewport]:focus-visible]:ring-2 has-[>[data-carousel-viewport]:focus-visible]:ring-focus-ring", "has-[>[data-carousel-viewport]:focus-visible]:ring-offset-2 has-[>[data-carousel-viewport]:focus-visible]:ring-offset-body", n), l = e("-mt-2 -mb-6 overflow-x-auto overflow-y-hidden overscroll-x-contain pt-2 pb-6 outline-none", "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden", "scroll-pl-[var(--carousel-bleed-left,0px)] scroll-pr-[var(--carousel-bleed-right,0px)]", "data-[overflowing=true]:cursor-grab data-[dragging]:cursor-grabbing data-[dragging]:select-none"), u = "snap-x snap-mandatory data-[moving]:snap-none", d = "scroll-fade-x", f = "w-max min-w-full pl-[var(--carousel-bleed-left,0px)] pr-[var(--carousel-bleed-right,0px)]", p = e("flex w-max min-w-full gap-[var(--grid-column-gap,1.5rem)]", "[&_a]:[-webkit-user-drag:none] [&_img]:[-webkit-user-drag:none]"), m = e("min-w-0 shrink-0 grow-0 snap-start", "basis-[calc(var(--carousel-item)*1cqw)] sm:basis-[calc(var(--carousel-item-sm)*1cqw)]", "md:basis-[calc(var(--carousel-item-md)*1cqw)] lg:basis-[calc(var(--carousel-item-lg)*1cqw)]"), h = "group/carousel-progress relative flex h-11 w-full cursor-pointer touch-none select-none items-center data-[overflowing=false]:invisible", g = {
|
|
20
21
|
center: "self-center sm:w-60",
|
|
21
22
|
start: "self-start sm:w-60",
|
|
22
23
|
full: ""
|
|
23
|
-
},
|
|
24
|
+
}, _ = e("relative h-1 w-full rounded-full bg-neutral transition-[height]", "group-data-[scrubbing]/carousel-progress:h-1.5", r("fast")), v = e("absolute inset-y-0 w-[calc(var(--carousel-thumb,0)*100%)] cursor-grab rounded-full bg-muted", "start-[calc(var(--carousel-progress,0)*(1_-_var(--carousel-thumb,0))*100%)]", "transition-colors group-hover/carousel-progress:bg-fg", "group-data-[scrubbing]/carousel-progress:cursor-grabbing group-data-[scrubbing]/carousel-progress:bg-fg", r("fast")), y = e(t("caption"), "mt-2 self-center text-muted tabular-nums data-[overflowing=false]:invisible");
|
|
24
25
|
//#endregion
|
|
25
|
-
export {
|
|
26
|
+
export { a as carouselBreakpoints, y as carouselCounterClasses, o as carouselDefaultItemWidth, f as carouselExtentClasses, c as carouselFrameClasses, m as carouselItemClasses, h as carouselProgressClasses, g as carouselProgressPlacementClasses, i as carouselProgressPlacements, v as carouselProgressThumbClasses, _ as carouselProgressTrackClasses, s as carouselRootClasses, p as carouselTrackClasses, l as carouselViewportClasses, d as carouselViewportFadeClasses, u as carouselViewportSnapClasses };
|