@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,480 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as a } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
+
import { t as o } from "./visually-hidden-BJdvqqvn.js";
|
|
7
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { t as c } from "./part-id-D0zksy32.js";
|
|
9
|
+
import { useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
10
|
+
import { vars as p } from "@jfrader/tokens/vars";
|
|
11
|
+
import { Fragment as m, jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
|
|
12
|
+
//#region src/components/stepper/stepper.tsx
|
|
13
|
+
var _ = "Progress", v = "All steps complete", y = {
|
|
14
|
+
complete: "completed",
|
|
15
|
+
current: "current step",
|
|
16
|
+
upcoming: "upcoming",
|
|
17
|
+
error: "error"
|
|
18
|
+
}, ee = (e) => (t, n, r, i) => `${t.label}, step ${e.format(n + 1)} of ${e.format(r)}, ${y[i]}`, b = (e) => (t, n, r) => t ? `Step ${e.format(n + 1)} of ${e.format(r)}: ${t.label}` : v, x = "2px", S = "--stepper-marker-size", C = "--stepper-marker-font", w = "--stepper-detail-font", T = `var(${S})`, E = "@container stepper (max-width: 30rem)", D = (e) => ({
|
|
19
|
+
"[data-compact] &": e,
|
|
20
|
+
[E]: { "[data-auto-compact] &": e }
|
|
21
|
+
});
|
|
22
|
+
function O(e, t) {
|
|
23
|
+
if (e !== void 0) return Number.isFinite(e) ? Math.min(Math.max(Math.floor(e), 0), t) : 0;
|
|
24
|
+
}
|
|
25
|
+
function te(e, t, n) {
|
|
26
|
+
return s(e.error) ? "error" : t < n ? "complete" : t === n ? "current" : "upcoming";
|
|
27
|
+
}
|
|
28
|
+
var ne = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
29
|
+
function re() {
|
|
30
|
+
return /* @__PURE__ */ h("svg", {
|
|
31
|
+
viewBox: "0 0 16 16",
|
|
32
|
+
width: "1em",
|
|
33
|
+
height: "1em",
|
|
34
|
+
fill: "none",
|
|
35
|
+
stroke: "currentColor",
|
|
36
|
+
strokeWidth: "2",
|
|
37
|
+
strokeLinecap: "round",
|
|
38
|
+
strokeLinejoin: "round",
|
|
39
|
+
children: /* @__PURE__ */ h("path", { d: "M3.5 8.5l3 3 6-6.5" })
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function ie() {
|
|
43
|
+
return /* @__PURE__ */ g("svg", {
|
|
44
|
+
viewBox: "0 0 16 16",
|
|
45
|
+
width: "1em",
|
|
46
|
+
height: "1em",
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
strokeWidth: "2",
|
|
50
|
+
strokeLinecap: "round",
|
|
51
|
+
children: [/* @__PURE__ */ h("path", { d: "M8 3.5v5.5" }), /* @__PURE__ */ h("circle", {
|
|
52
|
+
cx: "8",
|
|
53
|
+
cy: "12.5",
|
|
54
|
+
r: "1",
|
|
55
|
+
fill: "currentColor",
|
|
56
|
+
stroke: "none"
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
var ae = e({
|
|
61
|
+
label: "stepper",
|
|
62
|
+
boxSizing: "border-box",
|
|
63
|
+
inlineSize: "100%",
|
|
64
|
+
minInlineSize: 0,
|
|
65
|
+
containerType: "inline-size",
|
|
66
|
+
containerName: "stepper",
|
|
67
|
+
fontFamily: p.font.sans,
|
|
68
|
+
lineHeight: p.lineHeight.base,
|
|
69
|
+
color: p.color.text
|
|
70
|
+
}), oe = {
|
|
71
|
+
sm: e({
|
|
72
|
+
[S]: p.space[6],
|
|
73
|
+
[C]: p.textSize.xs,
|
|
74
|
+
[w]: p.textSize.xs,
|
|
75
|
+
fontSize: p.textSize.sm
|
|
76
|
+
}),
|
|
77
|
+
md: e({
|
|
78
|
+
[S]: p.space[8],
|
|
79
|
+
[C]: p.textSize.sm,
|
|
80
|
+
[w]: p.textSize.sm,
|
|
81
|
+
fontSize: p.textSize.md
|
|
82
|
+
})
|
|
83
|
+
}, se = {
|
|
84
|
+
horizontal: e({
|
|
85
|
+
display: "flex",
|
|
86
|
+
margin: 0,
|
|
87
|
+
padding: 0,
|
|
88
|
+
listStyle: "none"
|
|
89
|
+
}),
|
|
90
|
+
vertical: e({
|
|
91
|
+
display: "flex",
|
|
92
|
+
flexDirection: "column",
|
|
93
|
+
margin: 0,
|
|
94
|
+
padding: 0,
|
|
95
|
+
listStyle: "none"
|
|
96
|
+
})
|
|
97
|
+
}, ce = {
|
|
98
|
+
horizontal: e({
|
|
99
|
+
display: "grid",
|
|
100
|
+
gridTemplateColumns: `minmax(0, max-content) minmax(${p.space[4]}, 1fr)`,
|
|
101
|
+
alignItems: "start",
|
|
102
|
+
flex: "1 1 0",
|
|
103
|
+
minInlineSize: 0,
|
|
104
|
+
"&:last-of-type": {
|
|
105
|
+
gridTemplateColumns: "minmax(0, max-content)",
|
|
106
|
+
flex: "0 1 auto"
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
vertical: e({
|
|
110
|
+
display: "grid",
|
|
111
|
+
gridTemplateColumns: `calc(${T} + 2 * ${p.space[1]}) minmax(0, 1fr)`,
|
|
112
|
+
minInlineSize: 0
|
|
113
|
+
})
|
|
114
|
+
}, k = e({
|
|
115
|
+
boxSizing: "border-box",
|
|
116
|
+
gridRow: 1,
|
|
117
|
+
justifySelf: "start",
|
|
118
|
+
display: "inline-flex",
|
|
119
|
+
alignItems: "flex-start",
|
|
120
|
+
gap: p.space[3],
|
|
121
|
+
maxInlineSize: "100%",
|
|
122
|
+
minInlineSize: p.space[8],
|
|
123
|
+
minBlockSize: p.space[8],
|
|
124
|
+
margin: 0,
|
|
125
|
+
padding: p.space[1],
|
|
126
|
+
border: 0,
|
|
127
|
+
borderRadius: p.radius.sm,
|
|
128
|
+
backgroundColor: "transparent",
|
|
129
|
+
color: "inherit",
|
|
130
|
+
font: "inherit",
|
|
131
|
+
textAlign: "start",
|
|
132
|
+
transitionProperty: "background-color, transform",
|
|
133
|
+
transitionDuration: p.motion.duration.base,
|
|
134
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
135
|
+
[i]: { transitionDuration: "0s" }
|
|
136
|
+
}), A = {
|
|
137
|
+
horizontal: e({ gridColumn: 1 }),
|
|
138
|
+
vertical: e({ gridColumn: "1 / -1" })
|
|
139
|
+
}, le = e({
|
|
140
|
+
cursor: "pointer",
|
|
141
|
+
"&[aria-disabled=\"true\"]": { cursor: "default" },
|
|
142
|
+
"&:not([aria-disabled=\"true\"]):hover": { backgroundColor: p.color.surfaceHover },
|
|
143
|
+
"&:not([aria-disabled=\"true\"]):active": { transform: "scale(0.98)" },
|
|
144
|
+
"&:focus-visible": n,
|
|
145
|
+
[i]: { "&:not([aria-disabled=\"true\"]):active": { transform: "none" } }
|
|
146
|
+
}), j = e({
|
|
147
|
+
boxSizing: "border-box",
|
|
148
|
+
display: "inline-flex",
|
|
149
|
+
alignItems: "center",
|
|
150
|
+
justifyContent: "center",
|
|
151
|
+
flexShrink: 0,
|
|
152
|
+
minInlineSize: T,
|
|
153
|
+
blockSize: T,
|
|
154
|
+
paddingInline: p.space[1],
|
|
155
|
+
border: `${x} solid ${p.color.borderControl}`,
|
|
156
|
+
borderRadius: p.radius.full,
|
|
157
|
+
backgroundColor: "transparent",
|
|
158
|
+
color: p.color.textMuted,
|
|
159
|
+
fontSize: `var(${C})`,
|
|
160
|
+
fontWeight: p.fontWeight.medium,
|
|
161
|
+
fontVariantNumeric: "tabular-nums",
|
|
162
|
+
lineHeight: 1,
|
|
163
|
+
whiteSpace: "nowrap",
|
|
164
|
+
transitionProperty: "background-color, border-color, color",
|
|
165
|
+
transitionDuration: p.motion.duration.base,
|
|
166
|
+
transitionTimingFunction: p.motion.easeStandard,
|
|
167
|
+
"& svg": {
|
|
168
|
+
inlineSize: "1em",
|
|
169
|
+
blockSize: "1em"
|
|
170
|
+
},
|
|
171
|
+
"&[data-numeral]::before": { content: "attr(data-numeral)" },
|
|
172
|
+
"&[data-state=\"complete\"]": {
|
|
173
|
+
borderColor: p.color.accent,
|
|
174
|
+
backgroundColor: p.color.accent,
|
|
175
|
+
color: p.color.accentContrast
|
|
176
|
+
},
|
|
177
|
+
"&[data-state=\"current\"]": {
|
|
178
|
+
borderColor: p.color.accent,
|
|
179
|
+
backgroundColor: p.color.accentSoft,
|
|
180
|
+
color: p.color.text,
|
|
181
|
+
fontWeight: p.fontWeight.semibold,
|
|
182
|
+
outline: `${x} solid ${p.color.accent}`,
|
|
183
|
+
outlineOffset: x
|
|
184
|
+
},
|
|
185
|
+
"&[data-state=\"error\"]": {
|
|
186
|
+
borderColor: p.color.dangerText,
|
|
187
|
+
backgroundColor: p.color.dangerSoft,
|
|
188
|
+
color: p.color.dangerText
|
|
189
|
+
},
|
|
190
|
+
[i]: { transitionDuration: "0s" },
|
|
191
|
+
[r]: {
|
|
192
|
+
borderColor: "CanvasText",
|
|
193
|
+
"&[data-state=\"current\"], &[data-state=\"error\"]": {
|
|
194
|
+
borderColor: "Highlight",
|
|
195
|
+
outlineColor: "Highlight"
|
|
196
|
+
},
|
|
197
|
+
"&[data-state=\"complete\"]": {
|
|
198
|
+
forcedColorAdjust: "none",
|
|
199
|
+
borderColor: "Highlight",
|
|
200
|
+
backgroundColor: "Highlight",
|
|
201
|
+
color: "HighlightText"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}), ue = e({
|
|
205
|
+
display: "flex",
|
|
206
|
+
alignItems: "center",
|
|
207
|
+
minBlockSize: T,
|
|
208
|
+
minInlineSize: 0,
|
|
209
|
+
fontWeight: p.fontWeight.medium,
|
|
210
|
+
overflowWrap: "anywhere",
|
|
211
|
+
"&[data-state=\"current\"]": { fontWeight: p.fontWeight.semibold },
|
|
212
|
+
"&[data-state=\"upcoming\"]": { color: p.color.textMuted },
|
|
213
|
+
"&[data-state=\"error\"]": { color: p.color.dangerText },
|
|
214
|
+
...D({ "&:not([data-state=\"error\"])": { display: "none" } })
|
|
215
|
+
}), de = e({
|
|
216
|
+
gridRow: 2,
|
|
217
|
+
minInlineSize: 0,
|
|
218
|
+
paddingInlineEnd: p.space[2],
|
|
219
|
+
fontSize: `var(${w})`,
|
|
220
|
+
color: p.color.textMuted,
|
|
221
|
+
overflowWrap: "anywhere",
|
|
222
|
+
"&[data-state=\"error\"]": { color: p.color.dangerText },
|
|
223
|
+
...D({ "&:not([data-state=\"error\"])": o })
|
|
224
|
+
}), fe = {
|
|
225
|
+
horizontal: e({
|
|
226
|
+
gridColumn: "1 / -1",
|
|
227
|
+
paddingInlineStart: `calc(${p.space[1]} + ${T} + ${p.space[3]})`
|
|
228
|
+
}),
|
|
229
|
+
vertical: e({
|
|
230
|
+
gridColumn: 2,
|
|
231
|
+
paddingInlineStart: p.space[2],
|
|
232
|
+
paddingBlockEnd: p.space[2]
|
|
233
|
+
})
|
|
234
|
+
}, pe = e({
|
|
235
|
+
position: "relative",
|
|
236
|
+
overflow: "hidden",
|
|
237
|
+
backgroundColor: p.color.border,
|
|
238
|
+
"&::after": {
|
|
239
|
+
content: "\"\"",
|
|
240
|
+
position: "absolute",
|
|
241
|
+
inset: 0,
|
|
242
|
+
backgroundColor: p.color.accent,
|
|
243
|
+
transitionProperty: "transform",
|
|
244
|
+
transitionDuration: p.motion.duration.base,
|
|
245
|
+
transitionTimingFunction: p.motion.easeStandard
|
|
246
|
+
},
|
|
247
|
+
"&[data-state=\"complete\"]::after": { transform: "none" },
|
|
248
|
+
[i]: { "&::after": { transitionDuration: "0s" } },
|
|
249
|
+
[r]: {
|
|
250
|
+
forcedColorAdjust: "none",
|
|
251
|
+
backgroundColor: "CanvasText",
|
|
252
|
+
"&::after": { backgroundColor: "Highlight" }
|
|
253
|
+
}
|
|
254
|
+
}), me = {
|
|
255
|
+
horizontal: e({
|
|
256
|
+
gridColumn: 2,
|
|
257
|
+
gridRow: 1,
|
|
258
|
+
blockSize: x,
|
|
259
|
+
marginInline: p.space[2],
|
|
260
|
+
marginBlockStart: `calc(${p.space[1]} + ${T} / 2 - ${x} / 2)`,
|
|
261
|
+
"&:not([data-state=\"complete\"])::after": { transform: "scaleX(0)" },
|
|
262
|
+
"&::after": { transformOrigin: "left" },
|
|
263
|
+
"&:dir(rtl)::after": { transformOrigin: "right" }
|
|
264
|
+
}),
|
|
265
|
+
vertical: e({
|
|
266
|
+
gridColumn: 1,
|
|
267
|
+
gridRow: 2,
|
|
268
|
+
justifySelf: "center",
|
|
269
|
+
inlineSize: x,
|
|
270
|
+
minBlockSize: p.space[6],
|
|
271
|
+
marginBlock: p.space[1],
|
|
272
|
+
"&:not([data-state=\"complete\"])::after": { transform: "scaleY(0)" },
|
|
273
|
+
"&::after": { transformOrigin: "top" }
|
|
274
|
+
})
|
|
275
|
+
}, M = e({
|
|
276
|
+
marginBlockStart: p.space[3],
|
|
277
|
+
fontSize: p.textSize.sm,
|
|
278
|
+
color: p.color.textMuted,
|
|
279
|
+
overflowWrap: "anywhere",
|
|
280
|
+
"&[data-complete]": {
|
|
281
|
+
color: p.color.text,
|
|
282
|
+
fontWeight: p.fontWeight.medium
|
|
283
|
+
},
|
|
284
|
+
"&:not([data-complete])": { display: "none" },
|
|
285
|
+
...D({ "&:not([data-complete])": { display: "block" } })
|
|
286
|
+
}), he = e({
|
|
287
|
+
display: "block",
|
|
288
|
+
color: p.color.text,
|
|
289
|
+
fontWeight: p.fontWeight.medium
|
|
290
|
+
});
|
|
291
|
+
function N(e) {
|
|
292
|
+
let { ref: n, steps: r, value: i, defaultValue: p = 0, onValueChange: y, interactive: x = !1, orientation: S = "horizontal", details: C = "all", compact: w = !1, responsive: T = !0, size: E = "md", label: D = _, completeLabel: N = v, locale: P, getStepLabel: F, getChangeLabel: I, announceChanges: L = !1, slotProps: R, className: ge, sx: _e, "aria-label": ve, "aria-labelledby": z, ...ye } = e, B = r.length, be = l(), [xe, Se] = a(O(i, B), O(p, B), y), V = O(xe, B) ?? 0, H = r[V] ?? null, Ce = B > 0 && H === null, U = new Intl.NumberFormat(P), W = F ?? ee(U), we = I ?? b(U), [Te, Ee] = f(V), [De, Oe] = f("");
|
|
293
|
+
Te !== V && (Ee(V), L && Oe(we(H, V, B)));
|
|
294
|
+
let ke = (e) => e === V || e < V && r[e]?.disabled !== !0, G = x ? r.flatMap((e, t) => ke(t) ? [t] : []) : [], [Ae, je] = f(null), K = r.findIndex((e) => e.id === Ae), q = G.includes(K) ? K : G.includes(V) ? V : G[0], J = d(/* @__PURE__ */ new Map()), Y = d(!1);
|
|
295
|
+
u(() => {
|
|
296
|
+
if (!Y.current) return;
|
|
297
|
+
Y.current = !1;
|
|
298
|
+
let e = q === void 0 ? void 0 : J.current.get(r[q]?.id ?? ""), t = e?.ownerDocument.activeElement;
|
|
299
|
+
e && (!t || t === e.ownerDocument.body) && e.focus();
|
|
300
|
+
});
|
|
301
|
+
let Me = (e, t) => {
|
|
302
|
+
let n = getComputedStyle(e.currentTarget).direction === "rtl", [i, a] = S === "vertical" ? ["ArrowUp", "ArrowDown"] : n ? ["ArrowRight", "ArrowLeft"] : ["ArrowLeft", "ArrowRight"], o = G.indexOf(G.includes(t) ? t : q ?? -1), s = {
|
|
303
|
+
[i]: G[Math.max(o - 1, 0)],
|
|
304
|
+
[a]: G[Math.min(o + 1, G.length - 1)],
|
|
305
|
+
Home: G[0],
|
|
306
|
+
End: G.at(-1)
|
|
307
|
+
};
|
|
308
|
+
if (!(e.key in s)) return;
|
|
309
|
+
e.preventDefault();
|
|
310
|
+
let c = s[e.key], l = c === void 0 ? void 0 : r[c];
|
|
311
|
+
l && J.current.get(l.id)?.focus();
|
|
312
|
+
}, Ne = (e) => {
|
|
313
|
+
e < V && r[e]?.disabled !== !0 && Se(e);
|
|
314
|
+
}, { className: X, css: Z, onClick: Pe, onKeyDown: Fe, onFocus: Ie, "aria-describedby": Le, ...Re } = R?.head ?? {}, ze = /* @__PURE__ */ h("ol", {
|
|
315
|
+
role: "list",
|
|
316
|
+
"data-ui": "stepper-list",
|
|
317
|
+
className: R?.list?.className,
|
|
318
|
+
css: [se[S], R?.list?.css],
|
|
319
|
+
children: r.map((e, t) => {
|
|
320
|
+
let n = te(e, t, V), r = t === V, i = W(e, t, B, n), a = n === "error", l = a || s(e.description) && (C === "all" || r), u = c(be, "detail", e.id), d = s(e.icon), f = n === "complete" ? /* @__PURE__ */ h(re, {}) : a ? /* @__PURE__ */ h(ie, {}) : null, p = d || f ? void 0 : U.format(t + 1), _ = /* @__PURE__ */ g(m, { children: [
|
|
321
|
+
/* @__PURE__ */ h("span", {
|
|
322
|
+
"aria-hidden": "true",
|
|
323
|
+
"data-ui": "stepper-marker",
|
|
324
|
+
"data-state": n,
|
|
325
|
+
"data-numeral": p,
|
|
326
|
+
className: R?.marker?.className,
|
|
327
|
+
css: [j, R?.marker?.css],
|
|
328
|
+
children: d ? e.icon : f
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ h("span", {
|
|
331
|
+
"aria-hidden": !x || void 0,
|
|
332
|
+
"data-ui": "stepper-label",
|
|
333
|
+
"data-state": n,
|
|
334
|
+
className: R?.label?.className,
|
|
335
|
+
css: [ue, R?.label?.css],
|
|
336
|
+
children: e.label
|
|
337
|
+
}),
|
|
338
|
+
!x && /* @__PURE__ */ h("span", {
|
|
339
|
+
css: o,
|
|
340
|
+
children: i
|
|
341
|
+
})
|
|
342
|
+
] });
|
|
343
|
+
return /* @__PURE__ */ g("li", {
|
|
344
|
+
role: "listitem",
|
|
345
|
+
"data-ui": "stepper-item",
|
|
346
|
+
"data-state": n,
|
|
347
|
+
"aria-current": r ? "step" : void 0,
|
|
348
|
+
"aria-label": i,
|
|
349
|
+
className: R?.item?.className,
|
|
350
|
+
css: [ce[S], R?.item?.css],
|
|
351
|
+
children: [
|
|
352
|
+
x ? /* @__PURE__ */ h("button", {
|
|
353
|
+
...Re,
|
|
354
|
+
ref: (t) => {
|
|
355
|
+
if (t) return J.current.set(e.id, t), () => {
|
|
356
|
+
J.current.delete(e.id), t.ownerDocument.activeElement === t && (Y.current = !0);
|
|
357
|
+
};
|
|
358
|
+
},
|
|
359
|
+
type: "button",
|
|
360
|
+
"data-ui": "stepper-head",
|
|
361
|
+
"data-state": n,
|
|
362
|
+
tabIndex: t === q ? 0 : -1,
|
|
363
|
+
"aria-current": r ? "step" : void 0,
|
|
364
|
+
"aria-disabled": t < V && !e.disabled ? void 0 : !0,
|
|
365
|
+
"aria-label": i,
|
|
366
|
+
"aria-describedby": ne(Le, l && u),
|
|
367
|
+
className: X,
|
|
368
|
+
css: [
|
|
369
|
+
k,
|
|
370
|
+
A[S],
|
|
371
|
+
le,
|
|
372
|
+
Z
|
|
373
|
+
],
|
|
374
|
+
onFocus: (t) => {
|
|
375
|
+
Ie?.(t), je(e.id);
|
|
376
|
+
},
|
|
377
|
+
onKeyDown: (e) => {
|
|
378
|
+
Fe?.(e), e.defaultPrevented || Me(e, t);
|
|
379
|
+
},
|
|
380
|
+
onClick: (e) => {
|
|
381
|
+
Pe?.(e), e.defaultPrevented || Ne(t);
|
|
382
|
+
},
|
|
383
|
+
children: _
|
|
384
|
+
}) : /* @__PURE__ */ h("span", {
|
|
385
|
+
"data-ui": "stepper-head",
|
|
386
|
+
"data-state": n,
|
|
387
|
+
className: X,
|
|
388
|
+
css: [
|
|
389
|
+
k,
|
|
390
|
+
A[S],
|
|
391
|
+
Z
|
|
392
|
+
],
|
|
393
|
+
children: _
|
|
394
|
+
}),
|
|
395
|
+
l && /* @__PURE__ */ h("span", {
|
|
396
|
+
id: u,
|
|
397
|
+
"data-ui": "stepper-description",
|
|
398
|
+
"data-state": n,
|
|
399
|
+
className: R?.description?.className,
|
|
400
|
+
css: [
|
|
401
|
+
de,
|
|
402
|
+
fe[S],
|
|
403
|
+
R?.description?.css
|
|
404
|
+
],
|
|
405
|
+
children: a ? e.error : e.description
|
|
406
|
+
}),
|
|
407
|
+
t < B - 1 && /* @__PURE__ */ h("span", {
|
|
408
|
+
"aria-hidden": "true",
|
|
409
|
+
"data-ui": "stepper-connector",
|
|
410
|
+
"data-state": t < V ? "complete" : "upcoming",
|
|
411
|
+
className: R?.connector?.className,
|
|
412
|
+
css: [
|
|
413
|
+
pe,
|
|
414
|
+
me[S],
|
|
415
|
+
R?.connector?.css
|
|
416
|
+
]
|
|
417
|
+
})
|
|
418
|
+
]
|
|
419
|
+
}, e.id);
|
|
420
|
+
})
|
|
421
|
+
}), Be = Ce ? s(N) && /* @__PURE__ */ h("div", {
|
|
422
|
+
"data-ui": "stepper-caption",
|
|
423
|
+
"data-complete": "",
|
|
424
|
+
className: R?.caption?.className,
|
|
425
|
+
css: [M, R?.caption?.css],
|
|
426
|
+
children: N
|
|
427
|
+
}) : H && /* @__PURE__ */ g("div", {
|
|
428
|
+
"aria-hidden": "true",
|
|
429
|
+
"data-ui": "stepper-caption",
|
|
430
|
+
className: R?.caption?.className,
|
|
431
|
+
css: [M, R?.caption?.css],
|
|
432
|
+
children: [/* @__PURE__ */ h("span", {
|
|
433
|
+
css: he,
|
|
434
|
+
children: H.label
|
|
435
|
+
}), !s(H.error) && s(H.description) && H.description]
|
|
436
|
+
}), Q = {
|
|
437
|
+
...ye,
|
|
438
|
+
"data-ui": "stepper",
|
|
439
|
+
"data-orientation": S,
|
|
440
|
+
"data-size": E,
|
|
441
|
+
"data-compact": w ? "" : void 0,
|
|
442
|
+
"data-auto-compact": T && S === "horizontal" ? "" : void 0,
|
|
443
|
+
"aria-label": ve ?? (z === void 0 ? D : void 0),
|
|
444
|
+
"aria-labelledby": z
|
|
445
|
+
}, $ = /* @__PURE__ */ g(m, { children: [
|
|
446
|
+
ze,
|
|
447
|
+
Be,
|
|
448
|
+
L && /* @__PURE__ */ h("span", {
|
|
449
|
+
"aria-live": "polite",
|
|
450
|
+
"aria-atomic": "true",
|
|
451
|
+
"data-ui": "stepper-live",
|
|
452
|
+
css: o,
|
|
453
|
+
children: De
|
|
454
|
+
})
|
|
455
|
+
] });
|
|
456
|
+
return /* @__PURE__ */ h(t, {
|
|
457
|
+
className: [R?.root?.className, ge].filter(Boolean).join(" ") || void 0,
|
|
458
|
+
styles: [
|
|
459
|
+
ae,
|
|
460
|
+
oe[E],
|
|
461
|
+
R?.root?.css
|
|
462
|
+
],
|
|
463
|
+
sx: _e,
|
|
464
|
+
children: (e) => x ? /* @__PURE__ */ h("nav", {
|
|
465
|
+
...Q,
|
|
466
|
+
ref: n,
|
|
467
|
+
className: e,
|
|
468
|
+
children: $
|
|
469
|
+
}) : /* @__PURE__ */ h("div", {
|
|
470
|
+
...Q,
|
|
471
|
+
ref: n,
|
|
472
|
+
role: "group",
|
|
473
|
+
className: e,
|
|
474
|
+
children: $
|
|
475
|
+
})
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
N.displayName = "Stepper";
|
|
479
|
+
//#endregion
|
|
480
|
+
export { N as t };
|
package/dist/stepper.js
ADDED