@jfrader/ui 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/copy-button-DCSLcYS-.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-DgWqyU75.js +802 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-BCw4zZom.js +262 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/time-picker-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +2 -2
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +68 -7
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./surface-DZ4d-2aL.js";
|
|
4
|
+
import { createContext as r, useContext as i } from "react";
|
|
5
|
+
import { vars as a } from "@jfrader/tokens/vars";
|
|
6
|
+
import { jsx as o } from "@emotion/react/jsx-runtime";
|
|
7
|
+
//#region src/components/card/card.tsx
|
|
8
|
+
var s = r(void 0);
|
|
9
|
+
function c(...e) {
|
|
10
|
+
return e.filter(Boolean).join(" ") || void 0;
|
|
11
|
+
}
|
|
12
|
+
var l = e({
|
|
13
|
+
...n,
|
|
14
|
+
minInlineSize: 0,
|
|
15
|
+
borderRadius: a.radius.lg,
|
|
16
|
+
paddingBlock: a.space[4],
|
|
17
|
+
paddingInline: a.space[5]
|
|
18
|
+
}), u = {
|
|
19
|
+
flat: e({ boxShadow: "none" }),
|
|
20
|
+
raised: e({ boxShadow: a.shadow.raised })
|
|
21
|
+
}, d = e({
|
|
22
|
+
display: "grid",
|
|
23
|
+
gap: a.space[1],
|
|
24
|
+
marginBlockEnd: a.space[4]
|
|
25
|
+
}), f = e({
|
|
26
|
+
margin: 0,
|
|
27
|
+
fontSize: a.textSize.md,
|
|
28
|
+
fontWeight: a.fontWeight.semibold,
|
|
29
|
+
lineHeight: a.lineHeight.tight,
|
|
30
|
+
color: a.color.text
|
|
31
|
+
}), p = e({
|
|
32
|
+
margin: 0,
|
|
33
|
+
fontSize: a.textSize.sm,
|
|
34
|
+
color: a.color.textMuted
|
|
35
|
+
}), m = e({
|
|
36
|
+
fontSize: a.textSize.sm,
|
|
37
|
+
color: a.color.text
|
|
38
|
+
}), h = e({
|
|
39
|
+
display: "flex",
|
|
40
|
+
flexWrap: "wrap",
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
justifyContent: "space-between",
|
|
43
|
+
gap: a.space[2],
|
|
44
|
+
marginBlockStart: a.space[4],
|
|
45
|
+
paddingBlockStart: a.space[4],
|
|
46
|
+
borderBlockStart: `1px solid ${a.color.borderSubtle}`,
|
|
47
|
+
"& > :only-child": { marginInlineStart: "auto" }
|
|
48
|
+
});
|
|
49
|
+
function g({ ref: e, variant: n = "raised", slotProps: r, className: i, sx: a, ...d }) {
|
|
50
|
+
return /* @__PURE__ */ o(s.Provider, {
|
|
51
|
+
value: r,
|
|
52
|
+
children: /* @__PURE__ */ o(t, {
|
|
53
|
+
className: c(r?.root?.className, i),
|
|
54
|
+
styles: [
|
|
55
|
+
l,
|
|
56
|
+
u[n],
|
|
57
|
+
r?.root?.css
|
|
58
|
+
],
|
|
59
|
+
sx: a,
|
|
60
|
+
children: (t) => /* @__PURE__ */ o("div", {
|
|
61
|
+
...d,
|
|
62
|
+
ref: e,
|
|
63
|
+
"data-ui": "card",
|
|
64
|
+
"data-variant": n,
|
|
65
|
+
className: t
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
g.displayName = "Card";
|
|
71
|
+
function _({ ref: e, className: n, sx: r, ...a }) {
|
|
72
|
+
let l = i(s)?.header;
|
|
73
|
+
return /* @__PURE__ */ o(t, {
|
|
74
|
+
className: c(l?.className, n),
|
|
75
|
+
styles: [d, l?.css],
|
|
76
|
+
sx: r,
|
|
77
|
+
children: (t) => /* @__PURE__ */ o("div", {
|
|
78
|
+
...a,
|
|
79
|
+
ref: e,
|
|
80
|
+
"data-ui": "card-header",
|
|
81
|
+
className: t
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
_.displayName = "Card.Header";
|
|
86
|
+
function v({ ref: e, level: n = 3, className: r, sx: a, ...l }) {
|
|
87
|
+
let u = i(s)?.title, d = `h${n}`;
|
|
88
|
+
return /* @__PURE__ */ o(t, {
|
|
89
|
+
className: c(u?.className, r),
|
|
90
|
+
styles: [f, u?.css],
|
|
91
|
+
sx: a,
|
|
92
|
+
children: (t) => /* @__PURE__ */ o(d, {
|
|
93
|
+
...l,
|
|
94
|
+
ref: e,
|
|
95
|
+
"data-ui": "card-title",
|
|
96
|
+
className: t
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
v.displayName = "Card.Title";
|
|
101
|
+
function y({ ref: e, className: n, sx: r, ...a }) {
|
|
102
|
+
let l = i(s)?.description;
|
|
103
|
+
return /* @__PURE__ */ o(t, {
|
|
104
|
+
className: c(l?.className, n),
|
|
105
|
+
styles: [p, l?.css],
|
|
106
|
+
sx: r,
|
|
107
|
+
children: (t) => /* @__PURE__ */ o("p", {
|
|
108
|
+
...a,
|
|
109
|
+
ref: e,
|
|
110
|
+
"data-ui": "card-description",
|
|
111
|
+
className: t
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
y.displayName = "Card.Description";
|
|
116
|
+
function b({ ref: e, className: n, sx: r, ...a }) {
|
|
117
|
+
let l = i(s)?.content;
|
|
118
|
+
return /* @__PURE__ */ o(t, {
|
|
119
|
+
className: c(l?.className, n),
|
|
120
|
+
styles: [m, l?.css],
|
|
121
|
+
sx: r,
|
|
122
|
+
children: (t) => /* @__PURE__ */ o("div", {
|
|
123
|
+
...a,
|
|
124
|
+
ref: e,
|
|
125
|
+
"data-ui": "card-content",
|
|
126
|
+
className: t
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
b.displayName = "Card.Content";
|
|
131
|
+
function x({ ref: e, className: n, sx: r, ...a }) {
|
|
132
|
+
let l = i(s)?.footer;
|
|
133
|
+
return /* @__PURE__ */ o(t, {
|
|
134
|
+
className: c(l?.className, n),
|
|
135
|
+
styles: [h, l?.css],
|
|
136
|
+
sx: r,
|
|
137
|
+
children: (t) => /* @__PURE__ */ o("div", {
|
|
138
|
+
...a,
|
|
139
|
+
ref: e,
|
|
140
|
+
"data-ui": "card-footer",
|
|
141
|
+
className: t
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
x.displayName = "Card.Footer";
|
|
146
|
+
var S = Object.assign(g, {
|
|
147
|
+
Header: _,
|
|
148
|
+
Title: v,
|
|
149
|
+
Description: y,
|
|
150
|
+
Content: b,
|
|
151
|
+
Footer: x
|
|
152
|
+
});
|
|
153
|
+
//#endregion
|
|
154
|
+
export { S as t };
|
package/dist/card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Card } from "./card-
|
|
2
|
+
export { t as Card } from "./card-Ca4KQKYQ.js";
|
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n, t as r } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as i, r as a } from "./media-8yrN85VT.js";
|
|
5
|
+
import { n as o } from "./roving-focus-CYlo_Kf8.js";
|
|
6
|
+
import { t as s } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
|
+
import { t as c } from "./button-NLY0h6EJ.js";
|
|
8
|
+
import { Children as ee, isValidElement as l, useEffect as u, useId as te, useLayoutEffect as ne, useMemo as re, useRef as d, useState as f, useSyncExternalStore as ie } from "react";
|
|
9
|
+
import { vars as p } from "@jfrader/tokens/vars";
|
|
10
|
+
import { createElement as ae } from "@emotion/react";
|
|
11
|
+
import { jsx as m, jsxs as oe } from "@emotion/react/jsx-runtime";
|
|
12
|
+
import { useMergeRefs as h } from "@floating-ui/react";
|
|
13
|
+
//#region src/components/carousel/carousel.tsx
|
|
14
|
+
var se = "min(80cqw, 21rem)", g = "min(var(--carousel-slide-size), 100cqw)", ce = 6, le = 120, _ = "(prefers-reduced-motion: reduce)", ue = "a[href], button, input, select, textarea, label, summary, [contenteditable]:not([contenteditable=\"false\"]), [tabindex], [role=\"slider\"]", de = {
|
|
15
|
+
itemSelector: "[role=\"tab\"]",
|
|
16
|
+
ownerSelector: "[role=\"tablist\"]"
|
|
17
|
+
}, v = () => {};
|
|
18
|
+
function fe(e) {
|
|
19
|
+
if (typeof window > "u" || !window.matchMedia) return v;
|
|
20
|
+
let t = window.matchMedia(_);
|
|
21
|
+
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
22
|
+
}
|
|
23
|
+
var pe = () => typeof window < "u" && window.matchMedia?.(_).matches === !0;
|
|
24
|
+
function me(e) {
|
|
25
|
+
return typeof document > "u" ? v : (document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e));
|
|
26
|
+
}
|
|
27
|
+
var he = () => typeof document < "u" && document.hidden, ge = () => !1;
|
|
28
|
+
function _e(e, t) {
|
|
29
|
+
return t === 0 ? 0 : Math.min(Math.max(Number.isFinite(e) ? Math.trunc(e) : 0, 0), t - 1);
|
|
30
|
+
}
|
|
31
|
+
function y(e, t) {
|
|
32
|
+
return (n) => {
|
|
33
|
+
e?.(n), n.defaultPrevented || t(n);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
var ve = (...e) => e.filter(Boolean).join(" ") || void 0, b = (e, t) => l(e) && e.key !== null ? e.key : `slide-${t}`, ye = e({
|
|
37
|
+
label: "carousel",
|
|
38
|
+
containerType: "inline-size",
|
|
39
|
+
boxSizing: "border-box",
|
|
40
|
+
inlineSize: "100%",
|
|
41
|
+
minInlineSize: 0,
|
|
42
|
+
display: "grid",
|
|
43
|
+
gap: p.space[3],
|
|
44
|
+
fontFamily: p.font.sans,
|
|
45
|
+
color: p.color.text,
|
|
46
|
+
"&:focus-visible": n
|
|
47
|
+
}), be = e({ justifySelf: "start" }), xe = e({
|
|
48
|
+
overflowX: "auto",
|
|
49
|
+
overflowY: "hidden",
|
|
50
|
+
scrollSnapType: "inline mandatory",
|
|
51
|
+
overscrollBehaviorInline: "contain",
|
|
52
|
+
scrollbarWidth: "none",
|
|
53
|
+
borderRadius: p.radius.lg,
|
|
54
|
+
"&:focus-visible": n,
|
|
55
|
+
"&[data-disabled]": { overflowX: "hidden" },
|
|
56
|
+
"&[data-dragging]": {
|
|
57
|
+
cursor: "grabbing",
|
|
58
|
+
userSelect: "none"
|
|
59
|
+
}
|
|
60
|
+
}), Se = e({
|
|
61
|
+
display: "flex",
|
|
62
|
+
gap: p.space[3],
|
|
63
|
+
inlineSize: "max-content",
|
|
64
|
+
paddingInline: `calc((100cqw - ${g}) / 2)`
|
|
65
|
+
}), Ce = e({
|
|
66
|
+
flex: "none",
|
|
67
|
+
boxSizing: "border-box",
|
|
68
|
+
inlineSize: g,
|
|
69
|
+
minInlineSize: 0,
|
|
70
|
+
scrollSnapAlign: "center",
|
|
71
|
+
scrollSnapStop: "always"
|
|
72
|
+
}), we = e({
|
|
73
|
+
display: "flex",
|
|
74
|
+
flexWrap: "wrap",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
gap: p.space[2]
|
|
77
|
+
}), Te = e({
|
|
78
|
+
display: "flex",
|
|
79
|
+
flex: "1 1 auto",
|
|
80
|
+
minInlineSize: 0,
|
|
81
|
+
overflowX: "auto",
|
|
82
|
+
scrollbarWidth: "none"
|
|
83
|
+
}), Ee = e({
|
|
84
|
+
appearance: "none",
|
|
85
|
+
display: "inline-grid",
|
|
86
|
+
placeItems: "center",
|
|
87
|
+
flex: "none",
|
|
88
|
+
minInlineSize: p.space[8],
|
|
89
|
+
blockSize: p.space[8],
|
|
90
|
+
padding: 0,
|
|
91
|
+
border: 0,
|
|
92
|
+
borderRadius: p.radius.full,
|
|
93
|
+
background: "transparent",
|
|
94
|
+
cursor: "pointer",
|
|
95
|
+
"&:hover:not([aria-disabled=\"true\"]):not([aria-selected=\"true\"]) > span": { backgroundColor: p.color.textMuted },
|
|
96
|
+
"&[aria-selected=\"true\"] > span": {
|
|
97
|
+
inlineSize: p.space[6],
|
|
98
|
+
backgroundColor: p.color.accent
|
|
99
|
+
},
|
|
100
|
+
"&[aria-disabled=\"true\"]": {
|
|
101
|
+
cursor: "not-allowed",
|
|
102
|
+
opacity: .55
|
|
103
|
+
},
|
|
104
|
+
"&:focus-visible": r,
|
|
105
|
+
[i]: {
|
|
106
|
+
"& > span": {
|
|
107
|
+
forcedColorAdjust: "none",
|
|
108
|
+
backgroundColor: "CanvasText"
|
|
109
|
+
},
|
|
110
|
+
"&[aria-selected=\"true\"] > span": { backgroundColor: "Highlight" }
|
|
111
|
+
}
|
|
112
|
+
}), De = e({
|
|
113
|
+
display: "block",
|
|
114
|
+
inlineSize: p.space[2],
|
|
115
|
+
blockSize: p.space[2],
|
|
116
|
+
borderRadius: p.radius.full,
|
|
117
|
+
backgroundColor: p.color.borderControl,
|
|
118
|
+
transitionProperty: "inline-size, background-color",
|
|
119
|
+
transitionDuration: p.motion.duration.fast,
|
|
120
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
121
|
+
[a]: { transitionDuration: "0s" }
|
|
122
|
+
}), Oe = e({
|
|
123
|
+
inlineSize: p.space[8],
|
|
124
|
+
paddingInline: 0
|
|
125
|
+
}), ke = e({
|
|
126
|
+
inlineSize: p.space[4],
|
|
127
|
+
blockSize: p.space[4],
|
|
128
|
+
"&:dir(rtl)": { transform: "scaleX(-1)" }
|
|
129
|
+
}), Ae = e({
|
|
130
|
+
margin: 0,
|
|
131
|
+
textAlign: "center",
|
|
132
|
+
fontSize: p.textSize.sm,
|
|
133
|
+
lineHeight: p.lineHeight.base,
|
|
134
|
+
color: p.color.textMuted,
|
|
135
|
+
fontVariantNumeric: "tabular-nums"
|
|
136
|
+
}), je = e({
|
|
137
|
+
display: "grid",
|
|
138
|
+
placeItems: "center",
|
|
139
|
+
padding: p.space[8],
|
|
140
|
+
border: `1px dashed ${p.color.borderControl}`,
|
|
141
|
+
borderRadius: p.radius.lg,
|
|
142
|
+
fontSize: p.textSize.sm,
|
|
143
|
+
lineHeight: p.lineHeight.base,
|
|
144
|
+
color: p.color.textMuted
|
|
145
|
+
});
|
|
146
|
+
function Me({ direction: e }) {
|
|
147
|
+
return /* @__PURE__ */ m("svg", {
|
|
148
|
+
viewBox: "0 0 16 16",
|
|
149
|
+
"aria-hidden": "true",
|
|
150
|
+
focusable: "false",
|
|
151
|
+
css: ke,
|
|
152
|
+
children: /* @__PURE__ */ m("path", {
|
|
153
|
+
d: e === "previous" ? "M10 3 5 8l5 5" : "m6 3 5 5-5 5",
|
|
154
|
+
fill: "none",
|
|
155
|
+
stroke: "currentColor",
|
|
156
|
+
strokeWidth: "1.5",
|
|
157
|
+
strokeLinecap: "round",
|
|
158
|
+
strokeLinejoin: "round"
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function x({ ref: e, children: n, value: r, defaultValue: i = 0, onValueChange: a, slideSize: l = se, getSlideLabel: p, activation: g = "auto", interval: _, autoPlay: ke = !1, playingValue: x, defaultPlayingValue: Ne, onPlayingValueChange: Pe, locale: Fe, labels: Ie, disabled: S = !1, slotProps: C, className: Le, sx: Re, style: ze, role: Be = "region", "aria-roledescription": Ve, onFocus: He, onBlur: Ue, onPointerEnter: We, onPointerLeave: Ge, ...Ke }) {
|
|
163
|
+
let qe = te(), Je = re(() => new Intl.NumberFormat(Fe), [Fe]), w = {
|
|
164
|
+
slides: "Slides",
|
|
165
|
+
chooseSlide: "Choose slide",
|
|
166
|
+
previous: "Previous slide",
|
|
167
|
+
next: "Next slide",
|
|
168
|
+
startRotation: "Start slide rotation",
|
|
169
|
+
stopRotation: "Stop slide rotation",
|
|
170
|
+
empty: "No slides",
|
|
171
|
+
carouselRole: "carousel",
|
|
172
|
+
slideCount: (e, t) => `Slide ${Je.format(e + 1)} of ${Je.format(t)}`,
|
|
173
|
+
...Ie
|
|
174
|
+
}, Ye = p ?? w.slideCount, T = ee.toArray(n), E = T.length, Xe = JSON.stringify(T.map(b)), D = E > 1, [Ze, O] = s(r, i, a), k = Ze ?? 0, A = _e(k, E), j = D && !S, M = typeof _ == "number" && Number.isFinite(_) && _ > 0 ? _ : void 0, N = M !== void 0 && D, [Qe, $e] = s(x, Ne ?? ke, Pe), [et, P] = f(!1), [F, tt] = f(null), I = ie(fe, pe, ge), nt = ie(me, he, ge), [rt, it] = f(!1), [at, ot] = f(!1), [st, ct] = f(!1), L = N && Qe && !et && !I && !S, R = L && !rt && !at && !nt && !st, [z, lt] = f(null), ut = z !== null && z < E ? z : A, [dt, ft] = f(0), B = d(null), V = d(null), H = d(null), pt = d(null), mt = h([e, B]), ht = h([C?.viewport?.ref, V]), gt = h([C?.tabList?.ref, pt]), U = d(null), W = d(null), _t = d(null), G = d(null), vt = d(null), K = d(null), yt = d(!0), bt = d(0), xt = d(void 0), St = (e) => `${qe}-panel-${e}`, Ct = (e) => `${qe}-tab-${e}`;
|
|
175
|
+
u(() => {
|
|
176
|
+
Number.isFinite(k) || console.warn(`Carousel: value ${k} is not a finite index; showing the first slide.`);
|
|
177
|
+
}, [k]), u(() => {
|
|
178
|
+
I && P(!0);
|
|
179
|
+
}, [I]), u(() => {
|
|
180
|
+
let e = B.current;
|
|
181
|
+
if (!N || !e || typeof IntersectionObserver > "u") return;
|
|
182
|
+
let t = new IntersectionObserver(([e]) => ct(e ? !e.isIntersecting : !1));
|
|
183
|
+
return t.observe(e), () => t.disconnect();
|
|
184
|
+
}, [N]), u(() => {
|
|
185
|
+
if (!R || M === void 0) return;
|
|
186
|
+
let e = setTimeout(() => {
|
|
187
|
+
tt(A), O((A + 1) % E);
|
|
188
|
+
}, M);
|
|
189
|
+
return () => clearTimeout(e);
|
|
190
|
+
}, [
|
|
191
|
+
R,
|
|
192
|
+
M,
|
|
193
|
+
A,
|
|
194
|
+
E,
|
|
195
|
+
O
|
|
196
|
+
]), u(() => {
|
|
197
|
+
F !== null && (tt(null), F === A && P(!0));
|
|
198
|
+
}, [F, A]), u(() => () => clearTimeout(xt.current), []);
|
|
199
|
+
let wt = (e) => H.current?.children[e], Tt = (e, t) => {
|
|
200
|
+
let n = V.current, r = wt(e);
|
|
201
|
+
if (!n || !r) return;
|
|
202
|
+
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = a.left + a.width / 2 - (i.left + i.width / 2);
|
|
203
|
+
Math.abs(o) < 1 || (K.current = n.scrollLeft + o, n.scrollTo({
|
|
204
|
+
left: K.current,
|
|
205
|
+
behavior: t
|
|
206
|
+
}));
|
|
207
|
+
}, Et = () => {
|
|
208
|
+
let e = V.current, t = H.current;
|
|
209
|
+
if (!e || !t) return A;
|
|
210
|
+
let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = A, a = Infinity;
|
|
211
|
+
return Array.from(t.children).forEach((e, t) => {
|
|
212
|
+
let n = e.getBoundingClientRect(), o = Math.abs(n.left + n.width / 2 - r);
|
|
213
|
+
o < a && (a = o, i = t);
|
|
214
|
+
}), i;
|
|
215
|
+
};
|
|
216
|
+
ne(() => {
|
|
217
|
+
bt.current = A;
|
|
218
|
+
let e = V.current, t = e ?? B.current;
|
|
219
|
+
if (!t) return;
|
|
220
|
+
let { activeElement: n, body: r } = t.ownerDocument, i = U.current, a = (t) => e?.contains(t) && t.closest("[inert]") !== null, o = n !== null && a(n), s = n === r && i !== null && (!i.isConnected || a(i));
|
|
221
|
+
(o || s) && t.focus({ preventScroll: !0 }), pt.current?.contains(n) || lt(null), !W.current?.active && (Tt(A, yt.current || I ? "instant" : "smooth"), yt.current = !1);
|
|
222
|
+
}, [
|
|
223
|
+
A,
|
|
224
|
+
Xe,
|
|
225
|
+
dt
|
|
226
|
+
]), u(() => {
|
|
227
|
+
let e = V.current;
|
|
228
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
229
|
+
let t = new ResizeObserver(() => {
|
|
230
|
+
W.current?.active || Tt(bt.current, "instant");
|
|
231
|
+
});
|
|
232
|
+
return t.observe(e), () => t.disconnect();
|
|
233
|
+
}, [E > 0]);
|
|
234
|
+
let q = (e) => {
|
|
235
|
+
if (!j) return;
|
|
236
|
+
let t = _e(e, E);
|
|
237
|
+
t !== A && O(t);
|
|
238
|
+
}, Dt = (e) => {
|
|
239
|
+
_t.current = e, q(e), ft((e) => e + 1);
|
|
240
|
+
}, Ot = () => {
|
|
241
|
+
let e = V.current, t = K.current;
|
|
242
|
+
if (e && t !== null) {
|
|
243
|
+
Math.abs(e.scrollLeft - t) < 2 && (K.current = null);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (!j || W.current) return;
|
|
247
|
+
let n = Et();
|
|
248
|
+
n !== A && n !== _t.current && Dt(n);
|
|
249
|
+
}, kt = () => {
|
|
250
|
+
clearTimeout(xt.current), xt.current = setTimeout(Ot, le);
|
|
251
|
+
}, At = typeof window < "u" && "onscrollend" in window, jt = () => {
|
|
252
|
+
N && !et && (P(!0), $e(!1));
|
|
253
|
+
}, Mt = y(He, (e) => {
|
|
254
|
+
U.current = e.target, jt();
|
|
255
|
+
}), Nt = y(Ue, (e) => {
|
|
256
|
+
let t = e.relatedTarget;
|
|
257
|
+
t !== null && !e.currentTarget.contains(t) && (U.current = null);
|
|
258
|
+
}), Pt = () => {
|
|
259
|
+
let e = vt.current ?? (L ? "stop" : "start");
|
|
260
|
+
vt.current = null, P(e === "stop"), $e(e === "start");
|
|
261
|
+
}, Ft = () => {
|
|
262
|
+
_t.current = null, K.current = null;
|
|
263
|
+
}, It = (e) => {
|
|
264
|
+
if (Ft(), e.target !== e.currentTarget || !j) return;
|
|
265
|
+
let t = getComputedStyle(e.currentTarget).direction === "rtl", n = {
|
|
266
|
+
ArrowRight: A + (t ? -1 : 1),
|
|
267
|
+
ArrowLeft: A + (t ? 1 : -1),
|
|
268
|
+
Home: 0,
|
|
269
|
+
End: E - 1
|
|
270
|
+
}[e.key];
|
|
271
|
+
n !== void 0 && (e.preventDefault(), q(n));
|
|
272
|
+
}, Lt = (e) => {
|
|
273
|
+
if (Ft(), !j || e.pointerType !== "mouse" || e.button !== 0) return;
|
|
274
|
+
let t = e.currentTarget, n = e.target.closest(ue);
|
|
275
|
+
n && n !== t && t.contains(n) || (W.current = {
|
|
276
|
+
pointerId: e.pointerId,
|
|
277
|
+
startX: e.clientX,
|
|
278
|
+
startY: e.clientY,
|
|
279
|
+
startScroll: t.scrollLeft,
|
|
280
|
+
active: !1
|
|
281
|
+
});
|
|
282
|
+
}, Rt = (e) => {
|
|
283
|
+
let t = W.current;
|
|
284
|
+
if (!t || t.pointerId !== e.pointerId) return;
|
|
285
|
+
let n = e.currentTarget, r = e.clientX - t.startX, i = e.clientY - t.startY;
|
|
286
|
+
if (!t.active) {
|
|
287
|
+
if (Math.abs(i) >= ce && Math.abs(i) > Math.abs(r)) {
|
|
288
|
+
W.current = null;
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
if (Math.abs(r) < ce) return;
|
|
292
|
+
t.active = !0, n.setPointerCapture(e.pointerId), n.style.scrollSnapType = "none", n.ownerDocument.getSelection()?.removeAllRanges(), ot(!0);
|
|
293
|
+
}
|
|
294
|
+
n.scrollLeft = t.startScroll - r;
|
|
295
|
+
}, zt = (e, t) => {
|
|
296
|
+
let n = W.current;
|
|
297
|
+
if (!n || n.pointerId !== e.pointerId || (W.current = null, !n.active)) return;
|
|
298
|
+
let r = e.currentTarget;
|
|
299
|
+
if (r.style.scrollSnapType = "", ot(!1), !t) {
|
|
300
|
+
ft((e) => e + 1);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
let i = (e) => {
|
|
304
|
+
e.preventDefault(), e.stopPropagation();
|
|
305
|
+
};
|
|
306
|
+
r.addEventListener("click", i, {
|
|
307
|
+
capture: !0,
|
|
308
|
+
once: !0
|
|
309
|
+
}), setTimeout(() => r.removeEventListener("click", i, { capture: !0 })), Dt(Et());
|
|
310
|
+
}, Bt = (e) => {
|
|
311
|
+
lt(e), g === "auto" && (G.current = e, q(e));
|
|
312
|
+
}, Vt = (e) => {
|
|
313
|
+
let t = G.current === e;
|
|
314
|
+
G.current = null, !(g === "auto" && t) && q(e);
|
|
315
|
+
}, Ht = (e) => {
|
|
316
|
+
G.current = null, o(e, e.currentTarget, "horizontal", de);
|
|
317
|
+
}, Ut = {
|
|
318
|
+
...ze,
|
|
319
|
+
"--carousel-slide-size": typeof l == "number" ? `${l}px` : l
|
|
320
|
+
}, { viewport: J, track: Wt, slide: Gt, controls: Kt, tabList: Y, indicator: X, rotationButton: Z, previousButton: Q, nextButton: $, status: qt, empty: Jt } = C ?? {};
|
|
321
|
+
return /* @__PURE__ */ m(t, {
|
|
322
|
+
className: Le,
|
|
323
|
+
styles: ye,
|
|
324
|
+
sx: Re,
|
|
325
|
+
children: (e) => /* @__PURE__ */ oe("section", {
|
|
326
|
+
...Ke,
|
|
327
|
+
ref: mt,
|
|
328
|
+
tabIndex: Ke.tabIndex ?? -1,
|
|
329
|
+
role: Be,
|
|
330
|
+
"aria-roledescription": Ve ?? w.carouselRole,
|
|
331
|
+
"data-ui": "carousel",
|
|
332
|
+
"data-disabled": S || void 0,
|
|
333
|
+
"data-rotating": R || void 0,
|
|
334
|
+
className: e,
|
|
335
|
+
style: Ut,
|
|
336
|
+
onFocus: Mt,
|
|
337
|
+
onBlur: Nt,
|
|
338
|
+
onPointerEnter: y(We, (e) => {
|
|
339
|
+
e.pointerType !== "touch" && it(!0);
|
|
340
|
+
}),
|
|
341
|
+
onPointerLeave: y(Ge, () => it(!1)),
|
|
342
|
+
children: [
|
|
343
|
+
N && /* @__PURE__ */ m(c, {
|
|
344
|
+
size: "sm",
|
|
345
|
+
variant: "outline",
|
|
346
|
+
...Z,
|
|
347
|
+
css: [be, Z?.css],
|
|
348
|
+
"data-ui": "carousel-rotation",
|
|
349
|
+
"aria-disabled": S || I || void 0,
|
|
350
|
+
onPointerDown: y(Z?.onPointerDown, () => {
|
|
351
|
+
vt.current = L ? "stop" : "start";
|
|
352
|
+
}),
|
|
353
|
+
onClick: y(Z?.onClick, Pt),
|
|
354
|
+
children: L ? w.stopRotation : w.startRotation
|
|
355
|
+
}),
|
|
356
|
+
E === 0 ? /* @__PURE__ */ m("div", {
|
|
357
|
+
...Jt,
|
|
358
|
+
"data-ui": "carousel-empty",
|
|
359
|
+
css: [je, Jt?.css],
|
|
360
|
+
children: w.empty
|
|
361
|
+
}) : /* @__PURE__ */ m("div", {
|
|
362
|
+
...J,
|
|
363
|
+
ref: ht,
|
|
364
|
+
role: "group",
|
|
365
|
+
"aria-label": J?.["aria-label"] ?? (J?.["aria-labelledby"] ? void 0 : w.slides),
|
|
366
|
+
tabIndex: j ? 0 : -1,
|
|
367
|
+
"data-ui": "carousel-viewport",
|
|
368
|
+
"data-disabled": S || void 0,
|
|
369
|
+
"data-dragging": at || void 0,
|
|
370
|
+
css: [xe, J?.css],
|
|
371
|
+
onKeyDown: y(J?.onKeyDown, It),
|
|
372
|
+
onWheel: y(J?.onWheel, Ft),
|
|
373
|
+
onPointerDown: y(J?.onPointerDown, Lt),
|
|
374
|
+
onPointerMove: y(J?.onPointerMove, Rt),
|
|
375
|
+
onPointerUp: y(J?.onPointerUp, (e) => zt(e, !0)),
|
|
376
|
+
onPointerCancel: y(J?.onPointerCancel, (e) => zt(e, !1)),
|
|
377
|
+
onScroll: y(J?.onScroll, At ? v : kt),
|
|
378
|
+
onScrollEnd: y(J?.onScrollEnd, Ot),
|
|
379
|
+
children: /* @__PURE__ */ m("div", {
|
|
380
|
+
...Wt,
|
|
381
|
+
ref: H,
|
|
382
|
+
"data-ui": "carousel-track",
|
|
383
|
+
css: [Se, Wt?.css],
|
|
384
|
+
children: T.map((e, t) => {
|
|
385
|
+
let n = t === A;
|
|
386
|
+
return /* @__PURE__ */ ae("div", {
|
|
387
|
+
...Gt,
|
|
388
|
+
key: b(e, t),
|
|
389
|
+
role: D ? "tabpanel" : void 0,
|
|
390
|
+
id: St(t),
|
|
391
|
+
"aria-labelledby": ve(Gt?.["aria-labelledby"], D ? Ct(t) : void 0),
|
|
392
|
+
"aria-hidden": !n || void 0,
|
|
393
|
+
inert: !n,
|
|
394
|
+
"data-ui": "carousel-slide",
|
|
395
|
+
"data-state": n ? "active" : "inactive",
|
|
396
|
+
css: [Ce, Gt?.css]
|
|
397
|
+
}, e);
|
|
398
|
+
})
|
|
399
|
+
})
|
|
400
|
+
}),
|
|
401
|
+
D && /* @__PURE__ */ oe("div", {
|
|
402
|
+
...Kt,
|
|
403
|
+
"data-ui": "carousel-controls",
|
|
404
|
+
css: [we, Kt?.css],
|
|
405
|
+
children: [
|
|
406
|
+
/* @__PURE__ */ m("div", {
|
|
407
|
+
...Y,
|
|
408
|
+
ref: gt,
|
|
409
|
+
role: "tablist",
|
|
410
|
+
"aria-label": Y?.["aria-label"] ?? (Y?.["aria-labelledby"] ? void 0 : w.chooseSlide),
|
|
411
|
+
"aria-orientation": "horizontal",
|
|
412
|
+
"data-ui": "carousel-tablist",
|
|
413
|
+
css: [Te, Y?.css],
|
|
414
|
+
onKeyDown: y(Y?.onKeyDown, Ht),
|
|
415
|
+
children: T.map((e, t) => /* @__PURE__ */ ae("button", {
|
|
416
|
+
...X,
|
|
417
|
+
key: b(e, t),
|
|
418
|
+
type: "button",
|
|
419
|
+
role: "tab",
|
|
420
|
+
id: Ct(t),
|
|
421
|
+
"aria-label": Ye(t, E),
|
|
422
|
+
"aria-selected": t === A,
|
|
423
|
+
"aria-controls": St(t),
|
|
424
|
+
"aria-disabled": S || void 0,
|
|
425
|
+
tabIndex: t === ut ? 0 : -1,
|
|
426
|
+
"data-ui": "carousel-indicator",
|
|
427
|
+
css: [Ee, X?.css],
|
|
428
|
+
onPointerDown: y(X?.onPointerDown, () => {
|
|
429
|
+
G.current = null;
|
|
430
|
+
}),
|
|
431
|
+
onFocus: y(X?.onFocus, () => Bt(t)),
|
|
432
|
+
onClick: y(X?.onClick, () => Vt(t))
|
|
433
|
+
}, /* @__PURE__ */ m("span", { css: De })))
|
|
434
|
+
}),
|
|
435
|
+
/* @__PURE__ */ m(c, {
|
|
436
|
+
size: "sm",
|
|
437
|
+
variant: "outline",
|
|
438
|
+
...Q,
|
|
439
|
+
css: [Oe, Q?.css],
|
|
440
|
+
"data-ui": "carousel-previous",
|
|
441
|
+
"aria-label": Q?.["aria-label"] ?? w.previous,
|
|
442
|
+
"aria-disabled": !j || A === 0 || void 0,
|
|
443
|
+
onClick: y(Q?.onClick, () => q(A - 1)),
|
|
444
|
+
children: /* @__PURE__ */ m(Me, { direction: "previous" })
|
|
445
|
+
}),
|
|
446
|
+
/* @__PURE__ */ m(c, {
|
|
447
|
+
size: "sm",
|
|
448
|
+
variant: "outline",
|
|
449
|
+
...$,
|
|
450
|
+
css: [Oe, $?.css],
|
|
451
|
+
"data-ui": "carousel-next",
|
|
452
|
+
"aria-label": $?.["aria-label"] ?? w.next,
|
|
453
|
+
"aria-disabled": !j || A === E - 1 || void 0,
|
|
454
|
+
onClick: y($?.onClick, () => q(A + 1)),
|
|
455
|
+
children: /* @__PURE__ */ m(Me, { direction: "next" })
|
|
456
|
+
})
|
|
457
|
+
]
|
|
458
|
+
}),
|
|
459
|
+
D && /* @__PURE__ */ m("div", {
|
|
460
|
+
...qt,
|
|
461
|
+
role: "status",
|
|
462
|
+
"aria-live": R ? "off" : "polite",
|
|
463
|
+
"aria-atomic": "true",
|
|
464
|
+
"data-ui": "carousel-status",
|
|
465
|
+
css: [Ae, qt?.css],
|
|
466
|
+
children: Ye(A, E)
|
|
467
|
+
})
|
|
468
|
+
]
|
|
469
|
+
})
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
x.displayName = "Carousel";
|
|
473
|
+
//#endregion
|
|
474
|
+
export { x as t };
|
package/dist/carousel.js
ADDED