blessing-ui 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/README.md +139 -105
- package/dist/blessing-ui.css +97 -1
- package/dist/components/BlessAnnotator.css +1 -0
- package/dist/components/BlessAnnotator.js +6 -0
- package/dist/components/BlessAnnotator.vue.d.ts +71 -0
- package/dist/components/BlessAnnotator.vue_vue_type_script_setup_true_lang.js +264 -0
- package/dist/components/BlessAttachment.vue.d.ts +4 -1
- package/dist/components/BlessAttachment.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessCalendar.vue.d.ts +4 -0
- package/dist/components/BlessCalendar.vue_vue_type_script_setup_true_lang.js +65 -60
- package/dist/components/BlessCarousel.vue.d.ts +3 -0
- package/dist/components/BlessCarousel.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/components/BlessCoachmark.css +1 -0
- package/dist/components/BlessCoachmark.js +6 -0
- package/dist/components/BlessCoachmark.vue.d.ts +40 -0
- package/dist/components/BlessCoachmark.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/components/BlessCodeBlock.css +1 -0
- package/dist/components/BlessCodeBlock.js +6 -0
- package/dist/components/BlessCodeBlock.vue.d.ts +72 -0
- package/dist/components/BlessCodeBlock.vue_vue_type_script_setup_true_lang.js +140 -0
- package/dist/components/BlessCombobox.vue.d.ts +2 -0
- package/dist/components/BlessCombobox.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessCommand.css +1 -1
- package/dist/components/BlessCommand.vue.d.ts +26 -0
- package/dist/components/BlessCommand.vue_vue_type_script_setup_true_lang.js +137 -70
- package/dist/components/BlessConfetti.css +1 -0
- package/dist/components/BlessConfetti.js +6 -0
- package/dist/components/BlessConfetti.vue.d.ts +40 -0
- package/dist/components/BlessConfetti.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/components/BlessCountUp.css +1 -0
- package/dist/components/BlessCountUp.js +6 -0
- package/dist/components/BlessCountUp.vue.d.ts +18 -0
- package/dist/components/BlessCountUp.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/components/BlessCropper.css +1 -0
- package/dist/components/BlessCropper.js +6 -0
- package/dist/components/BlessCropper.vue.d.ts +70 -0
- package/dist/components/BlessCropper.vue_vue_type_script_setup_true_lang.js +220 -0
- package/dist/components/BlessDataTable.vue.d.ts +6 -0
- package/dist/components/BlessDataTable.vue_vue_type_script_setup_true_lang.js +56 -42
- package/dist/components/BlessDataView.vue.d.ts +7 -0
- package/dist/components/BlessDataView.vue_vue_type_script_setup_true_lang.js +38 -31
- package/dist/components/BlessDatePicker.vue.d.ts +3 -0
- package/dist/components/BlessDatePicker.vue_vue_type_script_setup_true_lang.js +46 -45
- package/dist/components/BlessDiff.css +1 -0
- package/dist/components/BlessDiff.js +6 -0
- package/dist/components/BlessDiff.vue.d.ts +22 -0
- package/dist/components/BlessDiff.vue_vue_type_script_setup_true_lang.js +148 -0
- package/dist/components/BlessDock.css +1 -0
- package/dist/components/BlessDock.js +6 -0
- package/dist/components/BlessDock.vue.d.ts +55 -0
- package/dist/components/BlessDock.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BlessEditor.vue.d.ts +2 -0
- package/dist/components/BlessEditor.vue_vue_type_script_setup_true_lang.js +23 -22
- package/dist/components/BlessFileInput.vue.d.ts +2 -0
- package/dist/components/BlessFileInput.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessFormula.css +1 -0
- package/dist/components/BlessFormula.js +6 -0
- package/dist/components/BlessFormula.vue.d.ts +53 -0
- package/dist/components/BlessFormula.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/components/BlessGantt.css +1 -0
- package/dist/components/BlessGantt.js +6 -0
- package/dist/components/BlessGantt.vue.d.ts +81 -0
- package/dist/components/BlessGantt.vue_vue_type_script_setup_true_lang.js +276 -0
- package/dist/components/BlessGauge.css +1 -0
- package/dist/components/BlessGauge.js +6 -0
- package/dist/components/BlessGauge.vue.d.ts +36 -0
- package/dist/components/BlessGauge.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/BlessHeatmapCalendar.css +1 -0
- package/dist/components/BlessHeatmapCalendar.js +6 -0
- package/dist/components/BlessHeatmapCalendar.vue.d.ts +38 -0
- package/dist/components/BlessHeatmapCalendar.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessHotspots.css +1 -0
- package/dist/components/BlessHotspots.js +6 -0
- package/dist/components/BlessHotspots.vue.d.ts +49 -0
- package/dist/components/BlessHotspots.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/components/BlessInfiniteCanvas.css +1 -0
- package/dist/components/BlessInfiniteCanvas.js +6 -0
- package/dist/components/BlessInfiniteCanvas.vue.d.ts +91 -0
- package/dist/components/BlessInfiniteCanvas.vue_vue_type_script_setup_true_lang.js +232 -0
- package/dist/components/BlessInputNumber.vue.d.ts +5 -0
- package/dist/components/BlessInputNumber.vue_vue_type_script_setup_true_lang.js +39 -34
- package/dist/components/BlessKanban.css +1 -0
- package/dist/components/BlessKanban.js +6 -0
- package/dist/components/BlessKanban.vue.d.ts +67 -0
- package/dist/components/BlessKanban.vue_vue_type_script_setup_true_lang.js +195 -0
- package/dist/components/BlessLoadingBar.vue.d.ts +2 -0
- package/dist/components/BlessLoadingBar.vue_vue_type_script_setup_true_lang.js +8 -3
- package/dist/components/BlessLoupe.css +1 -0
- package/dist/components/BlessLoupe.js +6 -0
- package/dist/components/BlessLoupe.vue.d.ts +16 -0
- package/dist/components/BlessLoupe.vue_vue_type_script_setup_true_lang.js +93 -0
- package/dist/components/BlessMarquee.css +1 -0
- package/dist/components/BlessMarquee.js +6 -0
- package/dist/components/BlessMarquee.vue.d.ts +44 -0
- package/dist/components/BlessMarquee.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/components/BlessMasonry.css +1 -0
- package/dist/components/BlessMasonry.js +6 -0
- package/dist/components/BlessMasonry.vue.d.ts +33 -0
- package/dist/components/BlessMasonry.vue_vue_type_script_setup_true_lang.js +79 -0
- package/dist/components/BlessMention.css +1 -0
- package/dist/components/BlessMention.js +6 -0
- package/dist/components/BlessMention.vue.d.ts +32 -0
- package/dist/components/BlessMention.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/BlessNodeGraph.css +1 -0
- package/dist/components/BlessNodeGraph.js +6 -0
- package/dist/components/BlessNodeGraph.vue.d.ts +110 -0
- package/dist/components/BlessNodeGraph.vue_vue_type_script_setup_true_lang.js +321 -0
- package/dist/components/BlessOnboardingChecklist.css +1 -0
- package/dist/components/BlessOnboardingChecklist.js +6 -0
- package/dist/components/BlessOnboardingChecklist.vue.d.ts +72 -0
- package/dist/components/BlessOnboardingChecklist.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/components/BlessOrderList.vue.d.ts +5 -0
- package/dist/components/BlessOrderList.vue_vue_type_script_setup_true_lang.js +62 -56
- package/dist/components/BlessPagination.vue.d.ts +2 -0
- package/dist/components/BlessPagination.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/components/BlessPickList.vue.d.ts +5 -0
- package/dist/components/BlessPickList.vue_vue_type_script_setup_true_lang.js +55 -49
- package/dist/components/BlessRadialMenu.css +1 -0
- package/dist/components/BlessRadialMenu.js +6 -0
- package/dist/components/BlessRadialMenu.vue.d.ts +45 -0
- package/dist/components/BlessRadialMenu.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessRangeCalendar.css +1 -0
- package/dist/components/BlessRangeCalendar.js +6 -0
- package/dist/components/BlessRangeCalendar.vue.d.ts +51 -0
- package/dist/components/BlessRangeCalendar.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/components/BlessScheduler.css +1 -0
- package/dist/components/BlessScheduler.js +6 -0
- package/dist/components/BlessScheduler.vue.d.ts +95 -0
- package/dist/components/BlessScheduler.vue_vue_type_script_setup_true_lang.js +347 -0
- package/dist/components/BlessShortcutRecorder.css +1 -0
- package/dist/components/BlessShortcutRecorder.js +6 -0
- package/dist/components/BlessShortcutRecorder.vue.d.ts +39 -0
- package/dist/components/BlessShortcutRecorder.vue_vue_type_script_setup_true_lang.js +126 -0
- package/dist/components/BlessSignaturePad.vue.d.ts +1 -1
- package/dist/components/BlessSliderCaptcha.css +1 -0
- package/dist/components/BlessSliderCaptcha.js +6 -0
- package/dist/components/BlessSliderCaptcha.vue.d.ts +38 -0
- package/dist/components/BlessSliderCaptcha.vue_vue_type_script_setup_true_lang.js +146 -0
- package/dist/components/BlessSortable.css +1 -0
- package/dist/components/BlessSortable.js +6 -0
- package/dist/components/BlessSortable.vue.d.ts +51 -0
- package/dist/components/BlessSortable.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/components/BlessSparkline.css +1 -0
- package/dist/components/BlessSparkline.js +6 -0
- package/dist/components/BlessSparkline.vue.d.ts +28 -0
- package/dist/components/BlessSparkline.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/components/BlessSplitView.css +1 -0
- package/dist/components/BlessSplitView.js +6 -0
- package/dist/components/BlessSplitView.vue.d.ts +61 -0
- package/dist/components/BlessSplitView.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/components/BlessSteps.vue.d.ts +2 -0
- package/dist/components/BlessSteps.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/components/BlessSwipeDeck.css +1 -0
- package/dist/components/BlessSwipeDeck.js +6 -0
- package/dist/components/BlessSwipeDeck.vue.d.ts +46 -0
- package/dist/components/BlessSwipeDeck.vue_vue_type_script_setup_true_lang.js +200 -0
- package/dist/components/BlessTimer.css +1 -0
- package/dist/components/BlessTimer.js +6 -0
- package/dist/components/BlessTimer.vue.d.ts +74 -0
- package/dist/components/BlessTimer.vue_vue_type_script_setup_true_lang.js +139 -0
- package/dist/components/BlessTour.vue.d.ts +1 -0
- package/dist/components/BlessTour.vue_vue_type_script_setup_true_lang.js +48 -42
- package/dist/components/BlessTreemap.css +1 -0
- package/dist/components/BlessTreemap.js +6 -0
- package/dist/components/BlessTreemap.vue.d.ts +46 -0
- package/dist/components/BlessTreemap.vue_vue_type_script_setup_true_lang.js +137 -0
- package/dist/components/BlessUploader.vue.d.ts +11 -0
- package/dist/components/BlessUploader.vue_vue_type_script_setup_true_lang.js +80 -69
- package/dist/composables/annotate.d.ts +35 -0
- package/dist/composables/annotate.js +33 -0
- package/dist/composables/canvasView.d.ts +21 -0
- package/dist/composables/canvasView.js +23 -0
- package/dist/composables/confetti.d.ts +32 -0
- package/dist/composables/confetti.js +23 -0
- package/dist/composables/cropBox.d.ts +22 -0
- package/dist/composables/cropBox.js +39 -0
- package/dist/composables/dayBlocks.d.ts +11 -0
- package/dist/composables/dayBlocks.js +26 -0
- package/dist/composables/diffLines.d.ts +10 -0
- package/dist/composables/diffLines.js +55 -0
- package/dist/composables/formula.d.ts +28 -0
- package/dist/composables/formula.js +161 -0
- package/dist/composables/graph.d.ts +19 -0
- package/dist/composables/graph.js +16 -0
- package/dist/composables/radial.d.ts +15 -0
- package/dist/composables/radial.js +22 -0
- package/dist/composables/schedule.d.ts +27 -0
- package/dist/composables/schedule.js +54 -0
- package/dist/composables/shortcut.d.ts +12 -0
- package/dist/composables/shortcut.js +35 -0
- package/dist/composables/treemap.d.ts +23 -0
- package/dist/composables/treemap.js +77 -0
- package/dist/composables/useAutoScroll.d.ts +15 -0
- package/dist/composables/useAutoScroll.js +32 -0
- package/dist/composables/useSortable.d.ts +58 -0
- package/dist/composables/useSortable.js +107 -0
- package/dist/index.d.ts +62 -1
- package/dist/index.js +93 -53
- package/package.json +22 -18
|
@@ -10,7 +10,8 @@ var m = ["aria-label"], h = ["aria-current"], g = { "aria-hidden": "true" }, _ =
|
|
|
10
10
|
steps: {},
|
|
11
11
|
orientation: { default: "horizontal" },
|
|
12
12
|
clickable: { type: [Boolean, String] },
|
|
13
|
-
label: { default: "Progress" }
|
|
13
|
+
label: { default: "Progress" },
|
|
14
|
+
goLabel: {}
|
|
14
15
|
}, {
|
|
15
16
|
modelValue: { default: 0 },
|
|
16
17
|
modelModifiers: {}
|
|
@@ -32,7 +33,7 @@ var m = ["aria-label"], h = ["aria-current"], g = { "aria-hidden": "true" }, _ =
|
|
|
32
33
|
}, [(c(), t(u(S(o, a.clickable, b.value) ? "button" : "div"), {
|
|
33
34
|
type: S(o, a.clickable, b.value) ? "button" : void 0,
|
|
34
35
|
class: "bless-steps__marker",
|
|
35
|
-
"aria-label": S(o, a.clickable, b.value) ? `Go to step ${o + 1
|
|
36
|
+
"aria-label": S(o, a.clickable, b.value) ? (a.goLabel ?? ((e, t) => `Go to step ${e}: ${t}`))(o + 1, e.label) : void 0,
|
|
36
37
|
onClick: (e) => S(o, a.clickable, b.value) && (x("select", o), b.value = o)
|
|
37
38
|
}, {
|
|
38
39
|
default: p(() => [i("span", g, d(o < b.value ? "✓" : o + 1), 1)]),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-deck{font-family:var(--bless-font-sans);font-size:var(--bless-text-sm);color:var(--bless-color-text);position:relative}.bless-deck__stage{min-height:240px;display:grid;position:relative}.bless-deck__stage:focus-visible{outline:2px solid var(--bless-color-accent);outline-offset:4px}.bless-deck__card{padding:var(--bless-space-8) var(--bless-space-4) var(--bless-space-4);background:var(--bless-color-bg);border:var(--bless-border-width) solid var(--bless-color-border);box-shadow:var(--bless-shadow-plate);translate:0 calc(var(--bless-deck-depth,0) * 8px);scale:calc(1 - var(--bless-deck-depth,0) * .04);transition:transform var(--bless-duration-slow) var(--bless-ease-out), translate var(--bless-duration-slow) var(--bless-ease-out), scale var(--bless-duration-slow) var(--bless-ease-out), opacity var(--bless-duration-slow) var(--bless-ease-out);-webkit-user-select:none;user-select:none;grid-area:1/1;position:relative}.bless-deck__card--top{z-index:3;cursor:grab;touch-action:none}.bless-deck__card:nth-child(2){z-index:2}.bless-deck__card:nth-child(3){z-index:1}.bless-deck-leave-active{z-index:4;pointer-events:none}.bless-deck-leave-to{opacity:0;translate:calc(var(--bless-deck-x) * 140%) calc(var(--bless-deck-y) * 140%)}.bless-deck-enter-from{opacity:0}.bless-deck__stamp{top:var(--bless-space-3);padding:0 var(--bless-space-2);text-transform:uppercase;pointer-events:none;opacity:0;border:2px solid;font-weight:700;position:absolute}.bless-deck__stamp--accept{inset-inline-start:var(--bless-space-3)}.bless-deck__stamp--reject{inset-inline-end:var(--bless-space-3)}.bless-deck__stamp--skip{inset-inline-start:50%;translate:-50%}.bless-deck__empty{color:var(--bless-color-text-muted);grid-area:1/1;place-items:center;display:grid}.bless-deck__controls{justify-content:center;gap:var(--bless-space-2);margin-top:var(--bless-space-4);flex-wrap:wrap;display:flex}.bless-deck__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:reduce){.bless-deck__card{transition:none}}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type BlessSwipeDecision = "accept" | "reject" | "skip";
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
5
|
+
props: import('vue').PublicProps & __VLS_PrettifyLocal<({
|
|
6
|
+
rowKey?: (item: T) => string | number;
|
|
7
|
+
label?: string;
|
|
8
|
+
/** show the buttons under the deck */
|
|
9
|
+
controls?: boolean;
|
|
10
|
+
/** how far (px) a drag must travel to count */
|
|
11
|
+
threshold?: number;
|
|
12
|
+
labels?: Partial<Record<BlessSwipeDecision | "undo" | "empty", string>>;
|
|
13
|
+
} & {
|
|
14
|
+
/** the cards still to decide, top of the deck first */
|
|
15
|
+
modelValue?: T[];
|
|
16
|
+
}) & {
|
|
17
|
+
"onUpdate:modelValue"?: ((value: T[]) => any) | undefined;
|
|
18
|
+
onDecide?: ((item: T, decision: BlessSwipeDecision) => any) | undefined;
|
|
19
|
+
onUndo?: ((item: T) => any) | undefined;
|
|
20
|
+
}> & (typeof globalThis extends {
|
|
21
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
22
|
+
} ? P : {});
|
|
23
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<{
|
|
24
|
+
accept: () => void;
|
|
25
|
+
reject: () => void;
|
|
26
|
+
skip: () => void;
|
|
27
|
+
undo: () => void;
|
|
28
|
+
}>) => void;
|
|
29
|
+
attrs: any;
|
|
30
|
+
slots: {
|
|
31
|
+
card?: (props: {
|
|
32
|
+
item: T;
|
|
33
|
+
index: number;
|
|
34
|
+
}) => any;
|
|
35
|
+
} & {
|
|
36
|
+
empty?: (props: {}) => any;
|
|
37
|
+
};
|
|
38
|
+
emit: (((evt: "decide", item: T, decision: BlessSwipeDecision) => void) & ((evt: "undo", item: T) => void)) & ((event: "update:modelValue", value: T[]) => void);
|
|
39
|
+
}>) => import('vue').VNode & {
|
|
40
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
41
|
+
};
|
|
42
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
43
|
+
[K in keyof T]: T[K];
|
|
44
|
+
} : {
|
|
45
|
+
[K in keyof T as K]: T[K];
|
|
46
|
+
}) & {};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import e from "./BlessButton.js";
|
|
2
|
+
import { Fragment as t, TransitionGroup as n, computed as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, useModel as v, withCtx as y } from "vue";
|
|
3
|
+
//#region src/components/BlessSwipeDeck.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var b = ["aria-label"], x = [
|
|
5
|
+
"aria-hidden",
|
|
6
|
+
"inert",
|
|
7
|
+
"onPointerdown",
|
|
8
|
+
"onPointermove",
|
|
9
|
+
"onPointerup",
|
|
10
|
+
"onPointercancel"
|
|
11
|
+
], S = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "bless-deck__empty"
|
|
14
|
+
}, C = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "bless-deck__controls"
|
|
17
|
+
}, w = {
|
|
18
|
+
class: "bless-deck__live",
|
|
19
|
+
"aria-live": "polite"
|
|
20
|
+
}, T = /*@__PURE__*/ l({
|
|
21
|
+
name: "BlessSwipeDeck",
|
|
22
|
+
__name: "BlessSwipeDeck",
|
|
23
|
+
props: /*@__PURE__*/ u({
|
|
24
|
+
rowKey: {},
|
|
25
|
+
label: { default: "Cards" },
|
|
26
|
+
controls: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
threshold: { default: 100 },
|
|
31
|
+
labels: {}
|
|
32
|
+
}, {
|
|
33
|
+
modelValue: { default: () => [] },
|
|
34
|
+
modelModifiers: {}
|
|
35
|
+
}),
|
|
36
|
+
emits: /*@__PURE__*/ u(["decide", "undo"], ["update:modelValue"]),
|
|
37
|
+
setup(l, { expose: u, emit: T }) {
|
|
38
|
+
let E = l, D = v(l, "modelValue"), O = T, k = r(() => ({
|
|
39
|
+
accept: "Accept",
|
|
40
|
+
reject: "Reject",
|
|
41
|
+
skip: "Skip",
|
|
42
|
+
undo: "Undo",
|
|
43
|
+
empty: "No cards left",
|
|
44
|
+
...E.labels
|
|
45
|
+
})), A = [], j = m(0), M = m(""), N = {
|
|
46
|
+
accept: [1, 0],
|
|
47
|
+
reject: [-1, 0],
|
|
48
|
+
skip: [0, -1]
|
|
49
|
+
}, P = m([0, 0]);
|
|
50
|
+
function F(e) {
|
|
51
|
+
let [t, ...n] = D.value;
|
|
52
|
+
t !== void 0 && (P.value = N[e], A.push({
|
|
53
|
+
item: t,
|
|
54
|
+
decision: e
|
|
55
|
+
}), j.value = A.length, D.value = n, O("decide", t, e), M.value = `${k.value[e]}. ${n.length} left.`);
|
|
56
|
+
}
|
|
57
|
+
function I() {
|
|
58
|
+
let e = A.pop();
|
|
59
|
+
e && (j.value = A.length, P.value = [0, 0], D.value = [e.item, ...D.value], O("undo", e.item), M.value = `${k.value.undo}. ${D.value.length} left.`);
|
|
60
|
+
}
|
|
61
|
+
u({
|
|
62
|
+
accept: () => F("accept"),
|
|
63
|
+
reject: () => F("reject"),
|
|
64
|
+
skip: () => F("skip"),
|
|
65
|
+
undo: I
|
|
66
|
+
});
|
|
67
|
+
let L = m(null);
|
|
68
|
+
function R(e) {
|
|
69
|
+
e.button || (e.currentTarget.setPointerCapture?.(e.pointerId), L.value = {
|
|
70
|
+
x: 0,
|
|
71
|
+
y: 0,
|
|
72
|
+
sx: e.clientX,
|
|
73
|
+
sy: e.clientY
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function z(e) {
|
|
77
|
+
let t = L.value;
|
|
78
|
+
t && (t.x = e.clientX - t.sx, t.y = e.clientY - t.sy);
|
|
79
|
+
}
|
|
80
|
+
function B() {
|
|
81
|
+
let e = L.value;
|
|
82
|
+
if (!e) return;
|
|
83
|
+
let t = E.threshold, n = Math.abs(e.x), r = Math.abs(e.y), i = n >= r && n > t ? e.x > 0 ? "accept" : "reject" : r > n && e.y < -t ? "skip" : null;
|
|
84
|
+
i && F(i), L.value = null;
|
|
85
|
+
}
|
|
86
|
+
let V = r(() => {
|
|
87
|
+
let e = L.value;
|
|
88
|
+
if (!e) return {
|
|
89
|
+
accept: 0,
|
|
90
|
+
reject: 0,
|
|
91
|
+
skip: 0
|
|
92
|
+
};
|
|
93
|
+
let t = (e) => Math.min(1, Math.max(0, e / E.threshold));
|
|
94
|
+
return {
|
|
95
|
+
accept: t(e.x),
|
|
96
|
+
reject: t(-e.x),
|
|
97
|
+
skip: t(-e.y)
|
|
98
|
+
};
|
|
99
|
+
}), H = r(() => {
|
|
100
|
+
let e = L.value;
|
|
101
|
+
return e ? {
|
|
102
|
+
transform: `translate(${e.x}px, ${e.y}px) rotate(${e.x / 24}deg)`,
|
|
103
|
+
transition: "none"
|
|
104
|
+
} : void 0;
|
|
105
|
+
});
|
|
106
|
+
function U(e) {
|
|
107
|
+
let t = {
|
|
108
|
+
ArrowRight: "accept",
|
|
109
|
+
ArrowLeft: "reject",
|
|
110
|
+
ArrowUp: "skip"
|
|
111
|
+
};
|
|
112
|
+
t[e.key] ? (e.preventDefault(), F(t[e.key])) : (e.key === "Backspace" || (e.ctrlKey || e.metaKey) && e.key === "z") && (e.preventDefault(), I());
|
|
113
|
+
}
|
|
114
|
+
let W = r(() => D.value.slice(0, 3));
|
|
115
|
+
return (r, u) => (p(), a("div", {
|
|
116
|
+
class: "bless-deck",
|
|
117
|
+
style: f({
|
|
118
|
+
"--bless-deck-x": P.value[0],
|
|
119
|
+
"--bless-deck-y": P.value[1]
|
|
120
|
+
})
|
|
121
|
+
}, [
|
|
122
|
+
o("div", {
|
|
123
|
+
class: "bless-deck__stage",
|
|
124
|
+
tabindex: "0",
|
|
125
|
+
role: "group",
|
|
126
|
+
"aria-roledescription": "deck of cards",
|
|
127
|
+
"aria-label": `${l.label}, ${D.value.length} left. Right arrow ${k.value.accept}, left arrow ${k.value.reject}, up arrow ${k.value.skip}, Backspace ${k.value.undo}.`,
|
|
128
|
+
onKeydown: U
|
|
129
|
+
}, [c(n, { name: "bless-deck" }, {
|
|
130
|
+
default: y(() => [(p(!0), a(t, null, h(W.value, (e, n) => (p(), a("div", {
|
|
131
|
+
key: l.rowKey ? l.rowKey(e) : D.value.length - n,
|
|
132
|
+
class: d(["bless-deck__card", { "bless-deck__card--top": n === 0 }]),
|
|
133
|
+
style: f(n === 0 ? H.value : { "--bless-deck-depth": n }),
|
|
134
|
+
"aria-hidden": n > 0 || void 0,
|
|
135
|
+
inert: n > 0 || void 0,
|
|
136
|
+
onPointerdown: (e) => n === 0 && R(e),
|
|
137
|
+
onPointermove: (e) => n === 0 && z(e),
|
|
138
|
+
onPointerup: (e) => n === 0 && B(),
|
|
139
|
+
onPointercancel: (e) => n === 0 && (L.value = null)
|
|
140
|
+
}, [g(r.$slots, "card", {
|
|
141
|
+
item: e,
|
|
142
|
+
index: n
|
|
143
|
+
}, () => [s(_(e), 1)]), n === 0 ? (p(), a(t, { key: 0 }, [
|
|
144
|
+
o("span", {
|
|
145
|
+
class: "bless-deck__stamp bless-deck__stamp--accept",
|
|
146
|
+
"aria-hidden": "true",
|
|
147
|
+
style: f({ opacity: V.value.accept })
|
|
148
|
+
}, _(k.value.accept), 5),
|
|
149
|
+
o("span", {
|
|
150
|
+
class: "bless-deck__stamp bless-deck__stamp--reject",
|
|
151
|
+
"aria-hidden": "true",
|
|
152
|
+
style: f({ opacity: V.value.reject })
|
|
153
|
+
}, _(k.value.reject), 5),
|
|
154
|
+
o("span", {
|
|
155
|
+
class: "bless-deck__stamp bless-deck__stamp--skip",
|
|
156
|
+
"aria-hidden": "true",
|
|
157
|
+
style: f({ opacity: V.value.skip })
|
|
158
|
+
}, _(k.value.skip), 5)
|
|
159
|
+
], 64)) : i("", !0)], 46, x))), 128))]),
|
|
160
|
+
_: 3
|
|
161
|
+
}), D.value.length ? i("", !0) : (p(), a("div", S, [g(r.$slots, "empty", {}, () => [s(_(k.value.empty), 1)])]))], 40, b),
|
|
162
|
+
l.controls ? (p(), a("div", C, [
|
|
163
|
+
c(e, {
|
|
164
|
+
variant: "outline",
|
|
165
|
+
disabled: !j.value,
|
|
166
|
+
onClick: I
|
|
167
|
+
}, {
|
|
168
|
+
default: y(() => [s(_(k.value.undo), 1)]),
|
|
169
|
+
_: 1
|
|
170
|
+
}, 8, ["disabled"]),
|
|
171
|
+
c(e, {
|
|
172
|
+
variant: "outline",
|
|
173
|
+
disabled: !D.value.length,
|
|
174
|
+
onClick: u[0] ||= (e) => F("reject")
|
|
175
|
+
}, {
|
|
176
|
+
default: y(() => [s(_(k.value.reject), 1)]),
|
|
177
|
+
_: 1
|
|
178
|
+
}, 8, ["disabled"]),
|
|
179
|
+
c(e, {
|
|
180
|
+
variant: "outline",
|
|
181
|
+
disabled: !D.value.length,
|
|
182
|
+
onClick: u[1] ||= (e) => F("skip")
|
|
183
|
+
}, {
|
|
184
|
+
default: y(() => [s(_(k.value.skip), 1)]),
|
|
185
|
+
_: 1
|
|
186
|
+
}, 8, ["disabled"]),
|
|
187
|
+
c(e, {
|
|
188
|
+
disabled: !D.value.length,
|
|
189
|
+
onClick: u[2] ||= (e) => F("accept")
|
|
190
|
+
}, {
|
|
191
|
+
default: y(() => [s(_(k.value.accept), 1)]),
|
|
192
|
+
_: 1
|
|
193
|
+
}, 8, ["disabled"])
|
|
194
|
+
])) : i("", !0),
|
|
195
|
+
o("span", w, _(M.value), 1)
|
|
196
|
+
], 4));
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
//#endregion
|
|
200
|
+
export { T as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bless-timer{align-items:center;gap:var(--bless-space-2);font-family:var(--bless-font-sans);color:var(--bless-color-text);flex-direction:column;display:inline-flex;position:relative}.bless-timer__clock{font-size:calc(var(--bless-text-xl) * 1.6);font-variant-numeric:tabular-nums;font-weight:600;line-height:1}.bless-timer__phase{font-size:var(--bless-text-sm);color:var(--bless-color-text-muted)}.bless-timer--done .bless-timer__clock{color:var(--bless-color-danger-text)}.bless-timer__controls{gap:var(--bless-space-2);display:inline-flex}.bless-timer__live{clip-path:inset(50%);width:1px;height:1px;position:absolute;overflow:hidden}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export interface BlessTimerPhase {
|
|
2
|
+
label: string;
|
|
3
|
+
seconds: number;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
declare const __VLS_export: import('vue').DefineComponent<{
|
|
8
|
+
/** `countdown` from `duration`, `stopwatch` up from 0, `interval` through `phases` */
|
|
9
|
+
mode?: "countdown" | "stopwatch" | "interval";
|
|
10
|
+
/** seconds, for a countdown */
|
|
11
|
+
duration?: number;
|
|
12
|
+
/** for `interval`: e.g. `[{ label: "Work", seconds: 25 }, { label: "Rest", seconds: 5 }]` */
|
|
13
|
+
phases?: BlessTimerPhase[];
|
|
14
|
+
/** how many times the phases repeat */
|
|
15
|
+
rounds?: number;
|
|
16
|
+
autostart?: boolean;
|
|
17
|
+
/** show Start / Pause / Reset */
|
|
18
|
+
controls?: boolean;
|
|
19
|
+
label?: string;
|
|
20
|
+
/** button text and the wording said when a phase changes or the time is up */
|
|
21
|
+
labels?: Partial<{
|
|
22
|
+
start: string;
|
|
23
|
+
resume: string;
|
|
24
|
+
pause: string;
|
|
25
|
+
reset: string;
|
|
26
|
+
finished: string;
|
|
27
|
+
round: (round: number, rounds: number) => string;
|
|
28
|
+
}>;
|
|
29
|
+
} & {
|
|
30
|
+
running?: boolean;
|
|
31
|
+
}, {
|
|
32
|
+
start: () => void;
|
|
33
|
+
pause: () => void;
|
|
34
|
+
reset: () => void;
|
|
35
|
+
toggle: () => boolean;
|
|
36
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
37
|
+
"update:running": (value: boolean) => any;
|
|
38
|
+
finish: () => any;
|
|
39
|
+
phase: (phase: BlessTimerPhase, index: number, round: number) => any;
|
|
40
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
41
|
+
/** `countdown` from `duration`, `stopwatch` up from 0, `interval` through `phases` */
|
|
42
|
+
mode?: "countdown" | "stopwatch" | "interval";
|
|
43
|
+
/** seconds, for a countdown */
|
|
44
|
+
duration?: number;
|
|
45
|
+
/** for `interval`: e.g. `[{ label: "Work", seconds: 25 }, { label: "Rest", seconds: 5 }]` */
|
|
46
|
+
phases?: BlessTimerPhase[];
|
|
47
|
+
/** how many times the phases repeat */
|
|
48
|
+
rounds?: number;
|
|
49
|
+
autostart?: boolean;
|
|
50
|
+
/** show Start / Pause / Reset */
|
|
51
|
+
controls?: boolean;
|
|
52
|
+
label?: string;
|
|
53
|
+
/** button text and the wording said when a phase changes or the time is up */
|
|
54
|
+
labels?: Partial<{
|
|
55
|
+
start: string;
|
|
56
|
+
resume: string;
|
|
57
|
+
pause: string;
|
|
58
|
+
reset: string;
|
|
59
|
+
finished: string;
|
|
60
|
+
round: (round: number, rounds: number) => string;
|
|
61
|
+
}>;
|
|
62
|
+
} & {
|
|
63
|
+
running?: boolean;
|
|
64
|
+
}> & Readonly<{
|
|
65
|
+
"onUpdate:running"?: ((value: boolean) => any) | undefined;
|
|
66
|
+
onFinish?: (() => any) | undefined;
|
|
67
|
+
onPhase?: ((phase: BlessTimerPhase, index: number, round: number) => any) | undefined;
|
|
68
|
+
}>, {
|
|
69
|
+
label: string;
|
|
70
|
+
mode: "countdown" | "stopwatch" | "interval";
|
|
71
|
+
duration: number;
|
|
72
|
+
rounds: number;
|
|
73
|
+
controls: boolean;
|
|
74
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import e from "./BlessButton.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, onBeforeUnmount as d, openBlock as f, ref as p, toDisplayString as m, useModel as h, watch as g, withCtx as _ } from "vue";
|
|
3
|
+
//#region src/components/BlessTimer.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var v = ["aria-label"], y = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "bless-timer__phase"
|
|
7
|
+
}, b = { class: "bless-timer__clock" }, x = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "bless-timer__controls"
|
|
10
|
+
}, S = {
|
|
11
|
+
class: "bless-timer__live",
|
|
12
|
+
"aria-live": "polite"
|
|
13
|
+
}, C = /*@__PURE__*/ c({
|
|
14
|
+
name: "BlessTimer",
|
|
15
|
+
__name: "BlessTimer",
|
|
16
|
+
props: /*@__PURE__*/ l({
|
|
17
|
+
mode: { default: "countdown" },
|
|
18
|
+
duration: { default: 60 },
|
|
19
|
+
phases: {},
|
|
20
|
+
rounds: { default: 1 },
|
|
21
|
+
autostart: { type: Boolean },
|
|
22
|
+
controls: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
label: { default: "Timer" },
|
|
27
|
+
labels: {}
|
|
28
|
+
}, {
|
|
29
|
+
running: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
runningModifiers: {}
|
|
34
|
+
}),
|
|
35
|
+
emits: /*@__PURE__*/ l(["finish", "phase"], ["update:running"]),
|
|
36
|
+
setup(c, { expose: l, emit: C }) {
|
|
37
|
+
let w = c, T = t(() => ({
|
|
38
|
+
start: "Start",
|
|
39
|
+
resume: "Resume",
|
|
40
|
+
pause: "Pause",
|
|
41
|
+
reset: "Reset",
|
|
42
|
+
finished: "Finished",
|
|
43
|
+
round: (e, t) => `round ${e} of ${t}`,
|
|
44
|
+
...w.labels
|
|
45
|
+
})), E = h(c, "running"), D = C, O = p(0), k = p(!1), A = p(""), j = 0, M = 0, N, P = t(() => w.mode === "interval" ? w.phases ?? [] : [{
|
|
46
|
+
label: "",
|
|
47
|
+
seconds: w.duration
|
|
48
|
+
}]), F = t(() => w.mode === "interval" ? w.rounds : 1), I = t(() => P.value.reduce((e, t) => e + t.seconds, 0) * 1e3), L = t(() => I.value * F.value), R = t(() => {
|
|
49
|
+
if (w.mode === "stopwatch") return {
|
|
50
|
+
i: 0,
|
|
51
|
+
round: 1,
|
|
52
|
+
left: O.value
|
|
53
|
+
};
|
|
54
|
+
let e = Math.min(O.value, L.value), t = I.value ? e >= L.value ? I.value : e % I.value : 0, n = Math.min(F.value, Math.floor(e / (I.value || 1)) + 1), r = 0;
|
|
55
|
+
for (let i = 0; i < P.value.length; i++) {
|
|
56
|
+
let a = P.value[i].seconds * 1e3;
|
|
57
|
+
if (t < r + a || i === P.value.length - 1) return {
|
|
58
|
+
i,
|
|
59
|
+
round: e >= L.value ? F.value : n,
|
|
60
|
+
left: Math.max(0, r + a - t)
|
|
61
|
+
};
|
|
62
|
+
r += a;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
i: 0,
|
|
66
|
+
round: 1,
|
|
67
|
+
left: 0
|
|
68
|
+
};
|
|
69
|
+
}), z = (e) => String(e).padStart(2, "0"), B = (e, t) => {
|
|
70
|
+
let n = t ? Math.floor(e / 1e3) : Math.ceil(e / 1e3), r = Math.floor(n / 3600), i = Math.floor(n % 3600 / 60);
|
|
71
|
+
return `${r ? `${r}:${z(i)}` : z(i)}:${z(n % 60)}`;
|
|
72
|
+
}, V = t(() => B(R.value.left, w.mode === "stopwatch")), H = t(() => w.mode === "interval" ? P.value[R.value.i] : void 0), U = t(() => H.value ? `${H.value.label} · ${T.value.round(R.value.round, F.value)}` : "");
|
|
73
|
+
function W() {
|
|
74
|
+
O.value = j + (performance.now() - M), w.mode !== "stopwatch" && O.value >= L.value && (O.value = L.value, G(), k.value = !0, E.value = !1, A.value = T.value.finished, D("finish"));
|
|
75
|
+
}
|
|
76
|
+
function G() {
|
|
77
|
+
clearInterval(N), N = void 0;
|
|
78
|
+
}
|
|
79
|
+
function K() {
|
|
80
|
+
N || w.mode !== "stopwatch" && !L.value || (k.value && Y(), j = O.value, M = performance.now(), N = setInterval(W, 100));
|
|
81
|
+
}
|
|
82
|
+
function q() {
|
|
83
|
+
E.value = !0;
|
|
84
|
+
}
|
|
85
|
+
function J() {
|
|
86
|
+
E.value = !1;
|
|
87
|
+
}
|
|
88
|
+
function Y() {
|
|
89
|
+
G(), O.value = 0, j = 0, k.value = !1, A.value = "", E.value && K();
|
|
90
|
+
}
|
|
91
|
+
return g(E, (e) => {
|
|
92
|
+
e ? K() : N && (W(), G());
|
|
93
|
+
}, { immediate: !1 }), w.autostart && (E.value = !0), g(() => [
|
|
94
|
+
w.mode,
|
|
95
|
+
w.duration,
|
|
96
|
+
w.phases,
|
|
97
|
+
w.rounds
|
|
98
|
+
], () => Y()), g(() => `${R.value.i}:${R.value.round}`, (e, t) => {
|
|
99
|
+
let n = P.value[R.value.i];
|
|
100
|
+
t !== void 0 && n && w.mode === "interval" && E.value && (A.value = `${n.label}, ${T.value.round(R.value.round, F.value)}`, D("phase", n, R.value.i, R.value.round));
|
|
101
|
+
}), d(G), l({
|
|
102
|
+
start: q,
|
|
103
|
+
pause: J,
|
|
104
|
+
reset: Y,
|
|
105
|
+
toggle: () => E.value = !E.value
|
|
106
|
+
}), (t, l) => (f(), i("div", {
|
|
107
|
+
class: u(["bless-timer", { "bless-timer--done": k.value }]),
|
|
108
|
+
role: "timer",
|
|
109
|
+
"aria-label": c.label
|
|
110
|
+
}, [
|
|
111
|
+
U.value ? (f(), i("span", y, m(U.value), 1)) : r("", !0),
|
|
112
|
+
a("span", b, m(V.value), 1),
|
|
113
|
+
c.controls ? (f(), i("span", x, [E.value ? (f(), n(e, {
|
|
114
|
+
key: 1,
|
|
115
|
+
variant: "outline",
|
|
116
|
+
onClick: J
|
|
117
|
+
}, {
|
|
118
|
+
default: _(() => [o(m(T.value.pause), 1)]),
|
|
119
|
+
_: 1
|
|
120
|
+
})) : (f(), n(e, {
|
|
121
|
+
key: 0,
|
|
122
|
+
onClick: q
|
|
123
|
+
}, {
|
|
124
|
+
default: _(() => [o(m(O.value && !k.value ? T.value.resume : T.value.start), 1)]),
|
|
125
|
+
_: 1
|
|
126
|
+
})), s(e, {
|
|
127
|
+
variant: "ghost",
|
|
128
|
+
disabled: !O.value,
|
|
129
|
+
onClick: Y
|
|
130
|
+
}, {
|
|
131
|
+
default: _(() => [o(m(T.value.reset), 1)]),
|
|
132
|
+
_: 1
|
|
133
|
+
}, 8, ["disabled"])])) : r("", !0),
|
|
134
|
+
a("span", S, m(A.value), 1)
|
|
135
|
+
], 10, v));
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
//#endregion
|
|
139
|
+
export { C as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import e from "./BlessButton.js";
|
|
2
2
|
import { scrollBehavior as t } from "../composables/useMedia.js";
|
|
3
3
|
import { useFloating as n } from "../composables/useFloating.js";
|
|
4
|
-
import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g,
|
|
4
|
+
import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onMounted as _, openBlock as v, ref as y, toDisplayString as b, unref as x, useModel as S, watch as C, withCtx as w, withKeys as T, withModifiers as E } from "vue";
|
|
5
5
|
//#region src/components/BlessTour.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var D = ["aria-label"], O = { class: "bless-tour__count" }, k = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "bless-tour__title"
|
|
9
|
-
},
|
|
9
|
+
}, A = { class: "bless-tour__text" }, j = { class: "bless-tour__actions" }, M = /*@__PURE__*/ f({
|
|
10
10
|
name: "BlessTour",
|
|
11
11
|
__name: "BlessTour",
|
|
12
12
|
props: /*@__PURE__*/ p({
|
|
@@ -27,34 +27,37 @@ var E = ["aria-label"], D = { class: "bless-tour__count" }, O = {
|
|
|
27
27
|
}),
|
|
28
28
|
emits: /*@__PURE__*/ p(["finish", "skip"], ["update:open", "update:step"]),
|
|
29
29
|
setup(f, { emit: p }) {
|
|
30
|
-
let
|
|
30
|
+
let M = f, N = S(f, "open"), P = S(f, "step"), F = p, I = a(() => ({
|
|
31
31
|
next: "Next",
|
|
32
32
|
prev: "Back",
|
|
33
33
|
done: "Done",
|
|
34
34
|
skip: "Skip",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
step: (e) => `Step ${e}`,
|
|
36
|
+
...M.labels
|
|
37
|
+
})), L = a(() => M.steps[P.value]), R = a(() => P.value >= M.steps.length - 1), z = y(null), B = y(), V = y(null), { x: H, y: U, side: W, update: G } = n(z, B, N, () => ({
|
|
38
|
+
placement: L.value?.placement ?? "bottom",
|
|
38
39
|
offset: 12
|
|
39
40
|
}));
|
|
40
|
-
function
|
|
41
|
-
let e =
|
|
42
|
-
|
|
41
|
+
function K() {
|
|
42
|
+
let e = L.value?.target ? document.querySelector(L.value.target) : null;
|
|
43
|
+
z.value = e, V.value = e?.getBoundingClientRect() ?? null, e?.scrollIntoView?.({
|
|
43
44
|
block: "center",
|
|
44
45
|
behavior: t()
|
|
45
46
|
}), m(() => {
|
|
46
|
-
|
|
47
|
+
G(), V.value = e?.getBoundingClientRect() ?? null, B.value?.focus();
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
e ?
|
|
52
|
-
}),
|
|
53
|
-
function
|
|
54
|
-
|
|
50
|
+
let q = null;
|
|
51
|
+
C(N, (e) => {
|
|
52
|
+
e ? q = document.activeElement : m(() => q?.focus?.());
|
|
53
|
+
}), C([N, P], ([e]) => e && K(), { immediate: !0 });
|
|
54
|
+
function J(e) {
|
|
55
|
+
N.value = !1, F(e ? "finish" : "skip");
|
|
55
56
|
}
|
|
56
|
-
let
|
|
57
|
-
|
|
57
|
+
let Y = y(!1);
|
|
58
|
+
_(() => Y.value = !0);
|
|
59
|
+
let X = a(() => {
|
|
60
|
+
let e = V.value;
|
|
58
61
|
return e ? {
|
|
59
62
|
top: `${e.top - 6}px`,
|
|
60
63
|
left: `${e.left - 6}px`,
|
|
@@ -62,57 +65,60 @@ var E = ["aria-label"], D = { class: "bless-tour__count" }, O = {
|
|
|
62
65
|
height: `${e.height + 12}px`
|
|
63
66
|
} : void 0;
|
|
64
67
|
});
|
|
65
|
-
return (t, n) =>
|
|
68
|
+
return (t, n) => Y.value ? (v(), o(i, {
|
|
66
69
|
key: 0,
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
to: "body"
|
|
71
|
+
}, [N.value && L.value ? (v(), c(r, { key: 0 }, [f.spotlight ? (v(), c("div", {
|
|
72
|
+
key: 0,
|
|
73
|
+
class: h(["bless-tour__spot", { "bless-tour__spot--none": !X.value }]),
|
|
74
|
+
style: g(X.value),
|
|
69
75
|
"aria-hidden": "true"
|
|
70
76
|
}, null, 6)) : s("", !0), l("div", {
|
|
71
77
|
ref_key: "panel",
|
|
72
|
-
ref:
|
|
73
|
-
class: h(["bless-tour", [`bless-tour--${
|
|
78
|
+
ref: B,
|
|
79
|
+
class: h(["bless-tour", [`bless-tour--${x(W)}`, { "bless-tour--centred": !z.value }]]),
|
|
74
80
|
role: "dialog",
|
|
75
81
|
"aria-modal": "false",
|
|
76
|
-
"aria-label":
|
|
82
|
+
"aria-label": L.value.title ?? I.value.step(P.value + 1),
|
|
77
83
|
tabindex: "-1",
|
|
78
|
-
style: g(
|
|
79
|
-
left: `${
|
|
80
|
-
top: `${
|
|
84
|
+
style: g(z.value ? {
|
|
85
|
+
left: `${x(H)}px`,
|
|
86
|
+
top: `${x(U)}px`
|
|
81
87
|
} : void 0),
|
|
82
|
-
onKeydown: n[3] ||=
|
|
88
|
+
onKeydown: n[3] ||= T(E((e) => J(!1), ["prevent"]), ["esc"])
|
|
83
89
|
}, [
|
|
84
|
-
l("span",
|
|
85
|
-
|
|
86
|
-
l("p",
|
|
87
|
-
l("div",
|
|
90
|
+
l("span", O, b(P.value + 1) + " / " + b(f.steps.length), 1),
|
|
91
|
+
L.value.title ? (v(), c("strong", k, b(L.value.title), 1)) : s("", !0),
|
|
92
|
+
l("p", A, b(L.value.text), 1),
|
|
93
|
+
l("div", j, [
|
|
88
94
|
d(e, {
|
|
89
95
|
size: "sm",
|
|
90
96
|
variant: "ghost",
|
|
91
|
-
onClick: n[0] ||= (e) =>
|
|
97
|
+
onClick: n[0] ||= (e) => J(!1)
|
|
92
98
|
}, {
|
|
93
|
-
default:
|
|
99
|
+
default: w(() => [u(b(I.value.skip), 1)]),
|
|
94
100
|
_: 1
|
|
95
101
|
}),
|
|
96
102
|
n[4] ||= l("span", { style: { flex: "1" } }, null, -1),
|
|
97
103
|
d(e, {
|
|
98
104
|
size: "sm",
|
|
99
105
|
variant: "outline",
|
|
100
|
-
disabled:
|
|
101
|
-
onClick: n[1] ||= (e) =>
|
|
106
|
+
disabled: P.value === 0,
|
|
107
|
+
onClick: n[1] ||= (e) => P.value--
|
|
102
108
|
}, {
|
|
103
|
-
default:
|
|
109
|
+
default: w(() => [u(b(I.value.prev), 1)]),
|
|
104
110
|
_: 1
|
|
105
111
|
}, 8, ["disabled"]),
|
|
106
112
|
d(e, {
|
|
107
113
|
size: "sm",
|
|
108
|
-
onClick: n[2] ||= (e) =>
|
|
114
|
+
onClick: n[2] ||= (e) => R.value ? J(!0) : P.value++
|
|
109
115
|
}, {
|
|
110
|
-
default:
|
|
116
|
+
default: w(() => [u(b(R.value ? I.value.done : I.value.next), 1)]),
|
|
111
117
|
_: 1
|
|
112
118
|
})
|
|
113
119
|
])
|
|
114
|
-
], 46,
|
|
120
|
+
], 46, D)], 64)) : s("", !0)])) : s("", !0);
|
|
115
121
|
}
|
|
116
122
|
});
|
|
117
123
|
//#endregion
|
|
118
|
-
export {
|
|
124
|
+
export { M as default };
|