@krizaka/ui 3.74.0 → 3.75.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/README.md +2 -6
- package/dist/{chunk-GSQRSWOE.js → chunk-RI3AA2E3.js} +3 -3
- package/dist/{chunk-E4FMPPDL.js → chunk-WC3SO4CE.js} +2 -2
- package/dist/{chunk-KF7UB3LM.js → chunk-YQWYGQTV.js} +11 -9
- package/dist/{chunk-KF7UB3LM.js.map → chunk-YQWYGQTV.js.map} +1 -1
- package/dist/{chunk-M3GEYLMR.js → chunk-ZPOVOEO3.js} +1 -2
- package/dist/data-table.js +3 -3
- package/dist/filter-bar.d.ts +12 -4
- package/dist/filter-bar.js +1 -1
- package/dist/gallery-page.js +3 -3
- package/dist/genui.js +101 -35
- package/dist/genui.js.map +1 -1
- package/dist/language-switch.d.ts +9 -9
- package/dist/{lightbox-D5NAHFEA.js → lightbox-Q45BZ3HW.js} +3 -3
- package/dist/match-dialog.js +2 -2
- package/dist/motion.css +1 -25
- package/dist/native/list.js +1 -1
- package/dist/native/list.js.map +1 -1
- package/dist/native.d.ts +2 -54
- package/dist/native.js +464 -560
- package/dist/native.js.map +1 -1
- package/dist/product-page.js +3 -3
- package/dist/shop-gallery.js +1 -1
- package/dist/tag-selector.js +16 -10
- package/dist/tag-selector.js.map +1 -1
- package/dist/vertical-video.js +1 -1
- package/dist/waveform.js.map +1 -1
- package/package.json +5 -81
- package/registry/account-menu.json +1 -1
- package/registry/account-settings.json +1 -1
- package/registry/achievement.json +1 -1
- package/registry/action-bar.json +1 -1
- package/registry/activity-feed.json +1 -1
- package/registry/agenda.json +1 -1
- package/registry/alert.json +1 -1
- package/registry/analysis-report.json +1 -1
- package/registry/anatomy-plate.json +1 -1
- package/registry/app-frame.json +2 -2
- package/registry/app-header.json +1 -1
- package/registry/app-shell.json +1 -1
- package/registry/argument-card.json +1 -1
- package/registry/auth-layout.json +1 -1
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/bird-plate.json +1 -1
- package/registry/button.json +1 -1
- package/registry/captcha.json +1 -1
- package/registry/card-grid.json +1 -1
- package/registry/card.json +1 -1
- package/registry/catalogue-page.json +1 -1
- package/registry/changelog-page.json +1 -1
- package/registry/chapter.json +1 -1
- package/registry/chat.json +3 -3
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip-row.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/choice-grid.json +1 -1
- package/registry/code-block.json +1 -1
- package/registry/collection-switcher.json +1 -1
- package/registry/combobox.json +1 -1
- package/registry/command.json +1 -1
- package/registry/comparison-table.json +1 -1
- package/registry/component-page.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/contact-page.json +1 -1
- package/registry/continue-prompt.json +1 -1
- package/registry/copy-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/cover-hero.json +1 -1
- package/registry/cta-panel.json +1 -1
- package/registry/dashboard-layout.json +1 -1
- package/registry/data-table.json +1 -1
- package/registry/date-picker.json +1 -1
- package/registry/decision-list.json +1 -1
- package/registry/description-list.json +1 -1
- package/registry/desktop-window.json +1 -1
- package/registry/detail-layout.json +1 -1
- package/registry/dialog.json +1 -1
- package/registry/docs-article-page.json +1 -1
- package/registry/docs-hub-page.json +1 -1
- package/registry/docs-layout.json +1 -1
- package/registry/docs-nav.json +1 -1
- package/registry/document-viewer.json +1 -1
- package/registry/doodle.json +1 -1
- package/registry/drop-overlay.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/elephant.json +1 -1
- package/registry/embed-facade.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/engine-flow.json +1 -1
- package/registry/entity-header.json +1 -1
- package/registry/environment-notice.json +1 -1
- package/registry/error-page.json +1 -1
- package/registry/field.json +1 -1
- package/registry/file-upload.json +1 -1
- package/registry/filter-bar.json +2 -2
- package/registry/flock.json +1 -1
- package/registry/footnote.json +1 -1
- package/registry/force-update-screen.json +1 -1
- package/registry/form.json +1 -1
- package/registry/gallery-page.json +1 -1
- package/registry/genui.json +1 -1
- package/registry/glossary-term.json +1 -1
- package/registry/glossary.json +1 -1
- package/registry/glow-card.json +1 -1
- package/registry/goal-gauge.json +1 -1
- package/registry/grade-stamp.json +1 -1
- package/registry/image-cropper.json +1 -1
- package/registry/index.json +10 -185
- package/registry/kanban.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/kind-config-editor.json +1 -1
- package/registry/kpi-explained.json +1 -1
- package/registry/landing-page.json +1 -1
- package/registry/landscape.json +1 -1
- package/registry/language-switch.json +1 -1
- package/registry/legal-page.json +1 -1
- package/registry/link-card.json +1 -1
- package/registry/list.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/longform-page.json +1 -1
- package/registry/maintenance-screen.json +1 -1
- package/registry/map.json +2 -2
- package/registry/margin-layout.json +1 -1
- package/registry/markdown.json +1 -1
- package/registry/marketing-layout.json +1 -1
- package/registry/mascot-quote.json +1 -1
- package/registry/mascot-state.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/match-dialog.json +1 -1
- package/registry/media-capture.json +1 -1
- package/registry/media-gallery.json +3 -14
- package/registry/meter.json +1 -1
- package/registry/money-input.json +1 -1
- package/registry/nav-bar.json +2 -2
- package/registry/next-actions.json +1 -1
- package/registry/notification-preferences.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/opening-hours.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/page-hero.json +1 -1
- package/registry/page-index.json +1 -1
- package/registry/page.json +1 -1
- package/registry/pagination.json +1 -1
- package/registry/pointer-light.json +1 -1
- package/registry/popover.json +1 -1
- package/registry/price-catalogue-editor.json +1 -1
- package/registry/pricing-page.json +1 -1
- package/registry/product-page.json +2 -6
- package/registry/profile-card.json +1 -1
- package/registry/progress.json +1 -1
- package/registry/promise-card.json +1 -1
- package/registry/promo-code-field.json +1 -1
- package/registry/proposal.json +1 -1
- package/registry/qr-code.json +1 -1
- package/registry/quota-meter.json +1 -1
- package/registry/radio-group.json +1 -1
- package/registry/rail-nav.json +2 -2
- package/registry/recipes.json +1 -1
- package/registry/retro-tv.json +2 -3
- package/registry/reviews.json +1 -1
- package/registry/router.json +1 -1
- package/registry/schema-form.json +1 -1
- package/registry/scroll-stage.json +1 -1
- package/registry/search-field.json +1 -1
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/service-card.json +1 -1
- package/registry/settings-layout.json +1 -1
- package/registry/shop-composer.json +1 -1
- package/registry/shop-gallery.json +3 -8
- package/registry/shop.json +2 -2
- package/registry/showcase.json +2 -7
- package/registry/signature.json +1 -1
- package/registry/site-cahier.json +1 -1
- package/registry/site-footer.json +2 -2
- package/registry/sites.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/skip-link.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot-picker.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/specimen-tag.json +1 -1
- package/registry/speed-lines.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/split-view.json +1 -1
- package/registry/stage-banner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/status-chip.json +1 -1
- package/registry/status-page.json +1 -1
- package/registry/step-progress.json +1 -1
- package/registry/step-showcase.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/sticky-action.json +1 -1
- package/registry/stuck.json +1 -1
- package/registry/swipe-deck.json +3 -4
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +1 -1
- package/registry/tag-selector.json +2 -2
- package/registry/taped-photo.json +1 -1
- package/registry/terminal-replay.json +1 -1
- package/registry/text-style.json +1 -1
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/toc.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/tree-view.json +1 -1
- package/registry/update-prompt.json +1 -1
- package/registry/upload-queue.json +1 -1
- package/registry/usage.json +1 -1
- package/registry/verified-badge.json +1 -1
- package/registry/versus-card.json +1 -1
- package/registry/vertical-video.json +2 -6
- package/registry/video-player.json +2 -7
- package/registry/video-trimmer.json +3 -4
- package/registry/virtual.json +1 -1
- package/registry/wall.json +3 -9
- package/registry/waveform.json +4 -9
- package/dist/audio-player.d.ts +0 -115
- package/dist/audio-player.js +0 -211
- package/dist/audio-player.js.map +0 -1
- package/dist/chunk-YKOLME7R.js +0 -126
- package/dist/chunk-YKOLME7R.js.map +0 -1
- package/dist/how-it-works-page.d.ts +0 -49
- package/dist/how-it-works-page.js +0 -28
- package/dist/how-it-works-page.js.map +0 -1
- package/dist/marquee.d.ts +0 -34
- package/dist/marquee.js +0 -52
- package/dist/marquee.js.map +0 -1
- package/dist/media-grid.d.ts +0 -246
- package/dist/media-grid.js +0 -468
- package/dist/media-grid.js.map +0 -1
- package/dist/photo-grid.d.ts +0 -123
- package/dist/photo-grid.js +0 -94
- package/dist/photo-grid.js.map +0 -1
- package/registry/audio-player.json +0 -300
- package/registry/examples/audio-player/podcast.d.ts +0 -4
- package/registry/examples/audio-player/podcast.js +0 -22
- package/registry/examples/audio-player/podcast.tsx +0 -19
- package/registry/examples/audio-player/voice-note.d.ts +0 -4
- package/registry/examples/audio-player/voice-note.js +0 -12
- package/registry/examples/audio-player/voice-note.tsx +0 -12
- package/registry/examples/how-it-works-page/orazaka.d.ts +0 -4
- package/registry/examples/how-it-works-page/orazaka.js +0 -30
- package/registry/examples/how-it-works-page/orazaka.tsx +0 -26
- package/registry/examples/marquee/cards.d.ts +0 -4
- package/registry/examples/marquee/cards.js +0 -23
- package/registry/examples/marquee/cards.tsx +0 -21
- package/registry/examples/marquee/logos.d.ts +0 -4
- package/registry/examples/marquee/logos.js +0 -12
- package/registry/examples/marquee/logos.tsx +0 -17
- package/registry/examples/media-grid/feed.d.ts +0 -4
- package/registry/examples/media-grid/feed.js +0 -31
- package/registry/examples/media-grid/feed.tsx +0 -30
- package/registry/examples/media-grid/loading.d.ts +0 -4
- package/registry/examples/media-grid/loading.js +0 -28
- package/registry/examples/media-grid/loading.tsx +0 -25
- package/registry/examples/media-grid/uniform.d.ts +0 -4
- package/registry/examples/media-grid/uniform.js +0 -29
- package/registry/examples/media-grid/uniform.tsx +0 -26
- package/registry/examples/photo-grid/native/profile-photos.d.ts +0 -4
- package/registry/examples/photo-grid/native/profile-photos.dark.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.js +0 -27
- package/registry/examples/photo-grid/native/profile-photos.light.png +0 -0
- package/registry/examples/photo-grid/native/profile-photos.tsx +0 -24
- package/registry/examples/photo-grid/profile-photos.d.ts +0 -4
- package/registry/examples/photo-grid/profile-photos.js +0 -28
- package/registry/examples/photo-grid/profile-photos.tsx +0 -25
- package/registry/how-it-works-page.json +0 -258
- package/registry/marquee.json +0 -241
- package/registry/media-grid.json +0 -1034
- package/registry/photo-grid.json +0 -316
- /package/dist/{chunk-GSQRSWOE.js.map → chunk-RI3AA2E3.js.map} +0 -0
- /package/dist/{chunk-E4FMPPDL.js.map → chunk-WC3SO4CE.js.map} +0 -0
- /package/dist/{chunk-M3GEYLMR.js.map → chunk-ZPOVOEO3.js.map} +0 -0
- /package/dist/{lightbox-D5NAHFEA.js.map → lightbox-Q45BZ3HW.js.map} +0 -0
package/dist/audio-player.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
clamp,
|
|
4
|
-
formatClock,
|
|
5
|
-
playSafely,
|
|
6
|
-
useInView
|
|
7
|
-
} from "./chunk-FZBWEDQI.js";
|
|
8
|
-
import {
|
|
9
|
-
PauseGlyph,
|
|
10
|
-
PlayGlyph
|
|
11
|
-
} from "./chunk-PGBF3UBX.js";
|
|
12
|
-
|
|
13
|
-
// src/audio-player/audio-player.tsx
|
|
14
|
-
import * as React from "react";
|
|
15
|
-
import { tv } from "tailwind-variants";
|
|
16
|
-
|
|
17
|
-
// src/waveform/bars.ts
|
|
18
|
-
function resamplePeaks(peaks, count) {
|
|
19
|
-
if (peaks.length === 0) return Array.from({ length: count }, () => 0.15);
|
|
20
|
-
const out = Array.from({ length: count }, (_, i) => {
|
|
21
|
-
const from = Math.floor(i / count * peaks.length);
|
|
22
|
-
const to = Math.max(from + 1, Math.floor((i + 1) / count * peaks.length));
|
|
23
|
-
return Math.max(...peaks.slice(from, to).map(Math.abs));
|
|
24
|
-
});
|
|
25
|
-
const loudest = Math.max(...out, 1e-4);
|
|
26
|
-
return out.map((v) => Math.max(0.08, v / loudest));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// src/audio-player/audio-player.tsx
|
|
30
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
31
|
-
var audioPlayer = tv({
|
|
32
|
-
slots: {
|
|
33
|
-
root: "flex w-full items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3",
|
|
34
|
-
play: "inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-accent text-on-accent transition-colors hover:bg-accent-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-1",
|
|
35
|
-
body: "flex min-w-0 flex-1 flex-col gap-1",
|
|
36
|
-
title: "truncate text-sm font-semibold text-fg",
|
|
37
|
-
wave: "relative flex h-10 w-full cursor-pointer touch-none items-center gap-[2px] rounded-md focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
38
|
-
bar: "min-w-[2px] flex-1 rounded-full bg-border-strong data-[played]:bg-accent",
|
|
39
|
-
meta: "flex items-center justify-between font-mono text-[11px] tabular-nums text-fg-secondary",
|
|
40
|
-
speed: "shrink-0 rounded-md px-2 py-1 text-xs font-semibold tabular-nums text-fg-secondary hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring"
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
var audioPlayerLabels = {
|
|
44
|
-
play: "Play",
|
|
45
|
-
pause: "Pause",
|
|
46
|
-
seek: "Seek",
|
|
47
|
-
speed: (rate) => `Speed ${rate}\xD7`,
|
|
48
|
-
time: (time, duration) => `${time} of ${duration}`
|
|
49
|
-
};
|
|
50
|
-
async function computeAudioPeaks(src, count = 200, signal) {
|
|
51
|
-
const response = await fetch(src, { signal });
|
|
52
|
-
const data = await response.arrayBuffer();
|
|
53
|
-
const Context = window.AudioContext ?? window.webkitAudioContext;
|
|
54
|
-
const context = new Context();
|
|
55
|
-
try {
|
|
56
|
-
const buffer = await context.decodeAudioData(data);
|
|
57
|
-
const channel = buffer.getChannelData(0);
|
|
58
|
-
const size = Math.max(1, Math.floor(channel.length / count));
|
|
59
|
-
return Array.from({ length: count }, (_, i) => {
|
|
60
|
-
let peak = 0;
|
|
61
|
-
for (let j = i * size; j < Math.min(channel.length, (i + 1) * size); j += 1) peak = Math.max(peak, Math.abs(channel[j]));
|
|
62
|
-
return peak;
|
|
63
|
-
});
|
|
64
|
-
} finally {
|
|
65
|
-
void context.close();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function AudioPlayer({
|
|
69
|
-
src,
|
|
70
|
-
title,
|
|
71
|
-
peaks: given,
|
|
72
|
-
computePeaks,
|
|
73
|
-
bars = 48,
|
|
74
|
-
playbackRates = [1, 1.5, 2],
|
|
75
|
-
pauseWhenHidden = true,
|
|
76
|
-
duration: knownDuration = 0,
|
|
77
|
-
onPlayingChange,
|
|
78
|
-
labels: words,
|
|
79
|
-
className
|
|
80
|
-
}) {
|
|
81
|
-
const labels = { ...audioPlayerLabels, ...words };
|
|
82
|
-
const s = audioPlayer();
|
|
83
|
-
const audio = React.useRef(null);
|
|
84
|
-
const root = React.useRef(null);
|
|
85
|
-
const wave = React.useRef(null);
|
|
86
|
-
const dragging = React.useRef(false);
|
|
87
|
-
const [playing, setPlaying] = React.useState(false);
|
|
88
|
-
const [time, setTime] = React.useState(0);
|
|
89
|
-
const [duration, setDuration] = React.useState(knownDuration);
|
|
90
|
-
const [rate, setRate] = React.useState(playbackRates[0] ?? 1);
|
|
91
|
-
const [computed, setComputed] = React.useState(null);
|
|
92
|
-
const [wantPeaks, setWantPeaks] = React.useState(false);
|
|
93
|
-
React.useEffect(() => {
|
|
94
|
-
if (given || !computePeaks || !wantPeaks) return;
|
|
95
|
-
const controller = new AbortController();
|
|
96
|
-
computeAudioPeaks(src, 200, controller.signal).then(setComputed, () => void 0);
|
|
97
|
-
return () => controller.abort();
|
|
98
|
-
}, [given, computePeaks, wantPeaks, src]);
|
|
99
|
-
useInView(root, (visible) => !visible && audio.current && !audio.current.paused && audio.current.pause(), pauseWhenHidden);
|
|
100
|
-
const shape = React.useMemo(() => resamplePeaks(given ?? computed ?? [], bars), [given, computed, bars]);
|
|
101
|
-
const progress = duration > 0 ? time / duration : 0;
|
|
102
|
-
const seek = (to) => {
|
|
103
|
-
if (!audio.current) return;
|
|
104
|
-
const next = clamp(to, 0, duration || audio.current.duration || 0);
|
|
105
|
-
audio.current.currentTime = next;
|
|
106
|
-
setTime(next);
|
|
107
|
-
};
|
|
108
|
-
const at = (clientX) => {
|
|
109
|
-
const box = wave.current?.getBoundingClientRect();
|
|
110
|
-
return box && box.width ? (clientX - box.left) / box.width * duration : 0;
|
|
111
|
-
};
|
|
112
|
-
const toggle = () => {
|
|
113
|
-
setWantPeaks(true);
|
|
114
|
-
if (!audio.current) return;
|
|
115
|
-
if (audio.current.paused) playSafely(audio.current);
|
|
116
|
-
else audio.current.pause();
|
|
117
|
-
};
|
|
118
|
-
return /* @__PURE__ */ jsxs("div", { ref: root, role: "group", "aria-label": title, className: s.root({ className }), children: [
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
"audio",
|
|
121
|
-
{
|
|
122
|
-
ref: audio,
|
|
123
|
-
src,
|
|
124
|
-
preload: "metadata",
|
|
125
|
-
onPlay: () => {
|
|
126
|
-
setPlaying(true);
|
|
127
|
-
onPlayingChange?.(true);
|
|
128
|
-
},
|
|
129
|
-
onPause: () => {
|
|
130
|
-
setPlaying(false);
|
|
131
|
-
onPlayingChange?.(false);
|
|
132
|
-
},
|
|
133
|
-
onTimeUpdate: (event) => setTime(event.currentTarget.currentTime),
|
|
134
|
-
onDurationChange: (event) => Number.isFinite(event.currentTarget.duration) && setDuration(event.currentTarget.duration)
|
|
135
|
-
}
|
|
136
|
-
),
|
|
137
|
-
/* @__PURE__ */ jsx("button", { type: "button", className: s.play(), "aria-label": playing ? labels.pause : labels.play, onClick: toggle, children: playing ? /* @__PURE__ */ jsx(PauseGlyph, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx(PlayGlyph, { className: "ml-0.5 h-5 w-5" }) }),
|
|
138
|
-
/* @__PURE__ */ jsxs("div", { className: s.body(), children: [
|
|
139
|
-
/* @__PURE__ */ jsx("p", { className: s.title(), "aria-hidden": true, children: title }),
|
|
140
|
-
/* @__PURE__ */ jsx(
|
|
141
|
-
"div",
|
|
142
|
-
{
|
|
143
|
-
ref: wave,
|
|
144
|
-
role: "slider",
|
|
145
|
-
tabIndex: 0,
|
|
146
|
-
"aria-label": labels.seek,
|
|
147
|
-
"aria-valuemin": 0,
|
|
148
|
-
"aria-valuemax": Math.round(duration),
|
|
149
|
-
"aria-valuenow": Math.round(time),
|
|
150
|
-
"aria-valuetext": labels.time(formatClock(time), formatClock(duration)),
|
|
151
|
-
className: s.wave(),
|
|
152
|
-
onPointerDown: (event) => {
|
|
153
|
-
dragging.current = true;
|
|
154
|
-
wave.current?.setPointerCapture?.(event.pointerId);
|
|
155
|
-
seek(at(event.clientX));
|
|
156
|
-
},
|
|
157
|
-
onPointerMove: (event) => dragging.current && seek(at(event.clientX)),
|
|
158
|
-
onPointerUp: () => {
|
|
159
|
-
dragging.current = false;
|
|
160
|
-
},
|
|
161
|
-
onKeyDown: (event) => {
|
|
162
|
-
const moves = {
|
|
163
|
-
ArrowLeft: time - 5,
|
|
164
|
-
ArrowDown: time - 5,
|
|
165
|
-
ArrowRight: time + 5,
|
|
166
|
-
ArrowUp: time + 5,
|
|
167
|
-
PageDown: time - 30,
|
|
168
|
-
PageUp: time + 30,
|
|
169
|
-
Home: 0,
|
|
170
|
-
End: duration
|
|
171
|
-
};
|
|
172
|
-
const to = moves[event.key];
|
|
173
|
-
if (to === void 0) return;
|
|
174
|
-
event.preventDefault();
|
|
175
|
-
seek(to);
|
|
176
|
-
},
|
|
177
|
-
children: shape.map((peak, i) => /* @__PURE__ */ jsx("span", { "aria-hidden": true, "data-played": (i + 0.5) / bars <= progress ? "" : void 0, className: s.bar(), style: { height: `${Math.round(peak * 100)}%` } }, i))
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
/* @__PURE__ */ jsxs("div", { className: s.meta(), "aria-hidden": true, children: [
|
|
181
|
-
/* @__PURE__ */ jsx("span", { children: formatClock(time) }),
|
|
182
|
-
/* @__PURE__ */ jsx("span", { children: formatClock(duration) })
|
|
183
|
-
] })
|
|
184
|
-
] }),
|
|
185
|
-
playbackRates.length > 1 && /* @__PURE__ */ jsxs(
|
|
186
|
-
"button",
|
|
187
|
-
{
|
|
188
|
-
type: "button",
|
|
189
|
-
className: s.speed(),
|
|
190
|
-
"aria-label": labels.speed(rate),
|
|
191
|
-
onClick: () => {
|
|
192
|
-
const next = playbackRates[(playbackRates.indexOf(rate) + 1) % playbackRates.length] ?? 1;
|
|
193
|
-
if (audio.current) audio.current.playbackRate = next;
|
|
194
|
-
setRate(next);
|
|
195
|
-
},
|
|
196
|
-
children: [
|
|
197
|
-
rate,
|
|
198
|
-
"\xD7"
|
|
199
|
-
]
|
|
200
|
-
}
|
|
201
|
-
)
|
|
202
|
-
] });
|
|
203
|
-
}
|
|
204
|
-
export {
|
|
205
|
-
AudioPlayer,
|
|
206
|
-
audioPlayer,
|
|
207
|
-
audioPlayerLabels,
|
|
208
|
-
computeAudioPeaks,
|
|
209
|
-
resamplePeaks
|
|
210
|
-
};
|
|
211
|
-
//# sourceMappingURL=audio-player.js.map
|
package/dist/audio-player.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/audio-player/audio-player.tsx","../src/waveform/bars.ts"],"sourcesContent":["// Client. An `<audio>` with a waveform you can seek on: the bars are the sound's peaks (given by the server, or\n// computed here from the file with Web Audio when `computePeaks` — once, on demand), the played part in the accent.\n// The waveform is a `slider` (arrows ± 5 s, Page keys ± 30 s, Home / End) whose value is read as a time; the play\n// button and the speed are named by props. No animation but the played part's colour, and it pauses off screen.\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { PauseGlyph, PlayGlyph } from \"../glyphs\";\nimport { clamp, formatClock, playSafely, useInView } from \"../media\";\nimport { resamplePeaks } from \"../waveform/bars\";\n\nexport { resamplePeaks };\n\nexport const audioPlayer = tv({\n slots: {\n root: \"flex w-full items-center gap-3 rounded-xl border border-border-default bg-surface-1 p-3\",\n play:\n \"inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-accent text-on-accent transition-colors hover:bg-accent-hover \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface-1\",\n body: \"flex min-w-0 flex-1 flex-col gap-1\",\n title: \"truncate text-sm font-semibold text-fg\",\n wave:\n \"relative flex h-10 w-full cursor-pointer touch-none items-center gap-[2px] rounded-md \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n bar: \"min-w-[2px] flex-1 rounded-full bg-border-strong data-[played]:bg-accent\",\n meta: \"flex items-center justify-between font-mono text-[11px] tabular-nums text-fg-secondary\",\n speed:\n \"shrink-0 rounded-md px-2 py-1 text-xs font-semibold tabular-nums text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n },\n});\n\nexport type AudioPlayerLabels = {\n play: string;\n pause: string;\n /** The waveform slider (\"Seek\"). */\n seek: string;\n /** The speed button: `(rate) => \"Speed \" + rate + \"×\"`. */\n speed: (rate: number) => string;\n /** The slider's value: `(time, duration) => \"0:42 of 3:10\"`. */\n time: (time: string, duration: string) => string;\n};\n\nexport const audioPlayerLabels: AudioPlayerLabels = {\n play: \"Play\",\n pause: \"Pause\",\n seek: \"Seek\",\n speed: (rate) => `Speed ${rate}×`,\n time: (time, duration) => `${time} of ${duration}`,\n};\n\nexport type AudioPlayerProps = {\n /** The address of the sound. */\n src: string;\n /** What it is (\"Voice note — Eric, 0:42\"): shown, and the accessible name of the player. */\n title: string;\n /** The peaks, between 0 and 1, as many as you like (they are resampled to `bars`). */\n peaks?: readonly number[];\n /** Without `peaks`: fetches the file and computes them with Web Audio at the first play (same-origin or CORS). */\n computePeaks?: boolean;\n /** How many bars. Default 48. */\n bars?: number;\n /** The speeds of the speed button. Default `[1, 1.5, 2]`; `[]` hides it. */\n playbackRates?: readonly number[];\n /** Pauses when it leaves the screen. Default `true`. */\n pauseWhenHidden?: boolean;\n /** The length, in seconds, before the metadata is loaded (from the server). */\n duration?: number;\n /** Called when playback starts, pauses, ends. */\n onPlayingChange?: (playing: boolean) => void;\n /** The words, passed translated; English by default. */\n labels?: Partial<AudioPlayerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** The peaks of a sound file, computed with Web Audio (`count` of them). */\nexport async function computeAudioPeaks(src: string, count = 200, signal?: AbortSignal): Promise<number[]> {\n const response = await fetch(src, { signal });\n const data = await response.arrayBuffer();\n const Context = window.AudioContext ?? (window as unknown as { webkitAudioContext: typeof AudioContext }).webkitAudioContext;\n const context = new Context();\n try {\n const buffer = await context.decodeAudioData(data);\n const channel = buffer.getChannelData(0);\n const size = Math.max(1, Math.floor(channel.length / count));\n return Array.from({ length: count }, (_, i) => {\n let peak = 0;\n for (let j = i * size; j < Math.min(channel.length, (i + 1) * size); j += 1) peak = Math.max(peak, Math.abs(channel[j]!));\n return peak;\n });\n } finally {\n void context.close();\n }\n}\n\n/** A sound with a seekable waveform: play / pause, time, speed — a voice note, a podcast clip, a track. */\nexport function AudioPlayer({\n src,\n title,\n peaks: given,\n computePeaks,\n bars = 48,\n playbackRates = [1, 1.5, 2],\n pauseWhenHidden = true,\n duration: knownDuration = 0,\n onPlayingChange,\n labels: words,\n className,\n}: AudioPlayerProps) {\n const labels = { ...audioPlayerLabels, ...words };\n const s = audioPlayer();\n const audio = React.useRef<HTMLAudioElement>(null);\n const root = React.useRef<HTMLDivElement>(null);\n const wave = React.useRef<HTMLDivElement>(null);\n const dragging = React.useRef(false);\n const [playing, setPlaying] = React.useState(false);\n const [time, setTime] = React.useState(0);\n const [duration, setDuration] = React.useState(knownDuration);\n const [rate, setRate] = React.useState(playbackRates[0] ?? 1);\n const [computed, setComputed] = React.useState<number[] | null>(null);\n const [wantPeaks, setWantPeaks] = React.useState(false);\n\n React.useEffect(() => {\n if (given || !computePeaks || !wantPeaks) return;\n const controller = new AbortController();\n computeAudioPeaks(src, 200, controller.signal).then(setComputed, () => undefined);\n return () => controller.abort();\n }, [given, computePeaks, wantPeaks, src]);\n\n useInView(root, (visible) => !visible && audio.current && !audio.current.paused && audio.current.pause(), pauseWhenHidden);\n\n const shape = React.useMemo(() => resamplePeaks(given ?? computed ?? [], bars), [given, computed, bars]);\n const progress = duration > 0 ? time / duration : 0;\n\n const seek = (to: number) => {\n if (!audio.current) return;\n const next = clamp(to, 0, duration || audio.current.duration || 0);\n audio.current.currentTime = next;\n setTime(next);\n };\n const at = (clientX: number) => {\n const box = wave.current?.getBoundingClientRect();\n return box && box.width ? ((clientX - box.left) / box.width) * duration : 0;\n };\n const toggle = () => {\n setWantPeaks(true);\n if (!audio.current) return;\n if (audio.current.paused) playSafely(audio.current);\n else audio.current.pause();\n };\n\n return (\n <div ref={root} role=\"group\" aria-label={title} className={s.root({ className })}>\n <audio\n ref={audio}\n src={src}\n preload=\"metadata\"\n onPlay={() => {\n setPlaying(true);\n onPlayingChange?.(true);\n }}\n onPause={() => {\n setPlaying(false);\n onPlayingChange?.(false);\n }}\n onTimeUpdate={(event) => setTime(event.currentTarget.currentTime)}\n onDurationChange={(event) => Number.isFinite(event.currentTarget.duration) && setDuration(event.currentTarget.duration)}\n />\n <button type=\"button\" className={s.play()} aria-label={playing ? labels.pause : labels.play} onClick={toggle}>\n {playing ? <PauseGlyph className=\"h-5 w-5\" /> : <PlayGlyph className=\"ml-0.5 h-5 w-5\" />}\n </button>\n <div className={s.body()}>\n <p className={s.title()} aria-hidden>\n {title}\n </p>\n <div\n ref={wave}\n role=\"slider\"\n tabIndex={0}\n aria-label={labels.seek}\n aria-valuemin={0}\n aria-valuemax={Math.round(duration)}\n aria-valuenow={Math.round(time)}\n aria-valuetext={labels.time(formatClock(time), formatClock(duration))}\n className={s.wave()}\n onPointerDown={(event) => {\n dragging.current = true;\n wave.current?.setPointerCapture?.(event.pointerId);\n seek(at(event.clientX));\n }}\n onPointerMove={(event) => dragging.current && seek(at(event.clientX))}\n onPointerUp={() => {\n dragging.current = false;\n }}\n onKeyDown={(event) => {\n const moves: Record<string, number> = {\n ArrowLeft: time - 5,\n ArrowDown: time - 5,\n ArrowRight: time + 5,\n ArrowUp: time + 5,\n PageDown: time - 30,\n PageUp: time + 30,\n Home: 0,\n End: duration,\n };\n const to = moves[event.key];\n if (to === undefined) return;\n event.preventDefault();\n seek(to);\n }}\n >\n {shape.map((peak, i) => (\n <span key={i} aria-hidden data-played={(i + 0.5) / bars <= progress ? \"\" : undefined} className={s.bar()} style={{ height: `${Math.round(peak * 100)}%` }} />\n ))}\n </div>\n <div className={s.meta()} aria-hidden>\n <span>{formatClock(time)}</span>\n <span>{formatClock(duration)}</span>\n </div>\n </div>\n {playbackRates.length > 1 && (\n <button\n type=\"button\"\n className={s.speed()}\n aria-label={labels.speed(rate)}\n onClick={() => {\n const next = playbackRates[(playbackRates.indexOf(rate) + 1) % playbackRates.length] ?? 1;\n if (audio.current) audio.current.playbackRate = next;\n setRate(next);\n }}\n >\n {rate}×\n </button>\n )}\n </div>\n );\n}\n","// The bars of a waveform, shared by AudioPlayer (the seekable one) and Waveform (the decorative one). Pure: no React.\n\n/** Resamples peaks to `count` bars (the maximum of each slice), normalised to the loudest. No peaks: a flat line at 15 %. */\nexport function resamplePeaks(peaks: readonly number[], count: number): number[] {\n if (peaks.length === 0) return Array.from({ length: count }, () => 0.15);\n const out = Array.from({ length: count }, (_, i) => {\n const from = Math.floor((i / count) * peaks.length);\n const to = Math.max(from + 1, Math.floor(((i + 1) / count) * peaks.length));\n return Math.max(...peaks.slice(from, to).map(Math.abs));\n });\n const loudest = Math.max(...out, 0.0001);\n return out.map((v) => Math.max(0.08, v / loudest));\n}\n"],"mappings":";;;;;;;;;;;;;AAIA,YAAY,WAAW;AACvB,SAAS,UAAU;;;ACFZ,SAAS,cAAc,OAA0B,OAAyB;AAC/E,MAAI,MAAM,WAAW,EAAG,QAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,MAAM,IAAI;AACvE,QAAM,MAAM,MAAM,KAAK,EAAE,QAAQ,MAAM,GAAG,CAAC,GAAG,MAAM;AAClD,UAAM,OAAO,KAAK,MAAO,IAAI,QAAS,MAAM,MAAM;AAClD,UAAM,KAAK,KAAK,IAAI,OAAO,GAAG,KAAK,OAAQ,IAAI,KAAK,QAAS,MAAM,MAAM,CAAC;AAC1E,WAAO,KAAK,IAAI,GAAG,MAAM,MAAM,MAAM,EAAE,EAAE,IAAI,KAAK,GAAG,CAAC;AAAA,EACxD,CAAC;AACD,QAAM,UAAU,KAAK,IAAI,GAAG,KAAK,IAAM;AACvC,SAAO,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,MAAM,IAAI,OAAO,CAAC;AACnD;;;AD8IM,cA8DE,YA9DF;AA7IC,IAAM,cAAc,GAAG;AAAA,EAC5B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,MACE;AAAA,IAEF,MAAM;AAAA,IACN,OAAO;AAAA,IACP,MACE;AAAA,IAEF,KAAK;AAAA,IACL,MAAM;AAAA,IACN,OACE;AAAA,EAEJ;AACF,CAAC;AAaM,IAAM,oBAAuC;AAAA,EAClD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO,CAAC,SAA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e;AAChD,kBAAQ,IAAI;AAAA,QACd;AAAA,QAEC;AAAA;AAAA,UAAK;AAAA;AAAA;AAAA,IACR;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/chunk-YKOLME7R.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
defineRecipe
|
|
4
|
-
} from "./chunk-D3T54RSL.js";
|
|
5
|
-
import {
|
|
6
|
-
cn
|
|
7
|
-
} from "./chunk-NSLXEDIS.js";
|
|
8
|
-
|
|
9
|
-
// src/card/card.tsx
|
|
10
|
-
import { Slot } from "radix-ui";
|
|
11
|
-
import { tv } from "tailwind-variants";
|
|
12
|
-
|
|
13
|
-
// src/card/recipe.ts
|
|
14
|
-
var cardRecipe = defineRecipe({
|
|
15
|
-
slots: {
|
|
16
|
-
root: "group relative flex flex-col overflow-hidden border border-border-default bg-surface-1 text-fg transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
17
|
-
media: "relative overflow-hidden bg-media",
|
|
18
|
-
image: "h-full w-full object-cover",
|
|
19
|
-
fallback: "flex h-full w-full items-center justify-center bg-linear-to-br from-accent/15 via-media to-accent-2/15 text-accent/60",
|
|
20
|
-
overlay: "absolute z-10 flex items-center gap-1.5",
|
|
21
|
-
body: "relative flex flex-1 flex-col gap-3",
|
|
22
|
-
title: "line-clamp-1 text-sm font-semibold text-fg transition-colors group-hover:text-fg-accent",
|
|
23
|
-
description: "line-clamp-2 text-xs text-fg-secondary",
|
|
24
|
-
stat: "min-w-0",
|
|
25
|
-
statLabel: "font-mono text-[11.5px] text-fg-secondary",
|
|
26
|
-
statValue: "font-display text-xl font-black tabular-nums text-fg",
|
|
27
|
-
footer: "relative mt-auto flex items-center gap-2 border-t border-border-subtle pt-3 text-xs text-fg-secondary"
|
|
28
|
-
},
|
|
29
|
-
variants: {
|
|
30
|
-
radius: { md: { root: "rounded-md" }, lg: { root: "rounded-lg" }, xl: { root: "rounded-xl" } },
|
|
31
|
-
tone: { default: {}, elevated: { root: "bg-surface-2 shadow-md" }, glass: { root: "bg-glass border-glass-border" } },
|
|
32
|
-
interactive: { true: { root: "duration-150 hover:border-border-strong hover:bg-surface-2" } },
|
|
33
|
-
padding: { none: { body: "p-0" }, sm: { body: "p-3" }, md: { body: "p-4" }, lg: { body: "p-6" } }
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: { radius: "xl", tone: "default", padding: "md" }
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// src/card/card.tsx
|
|
39
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
40
|
-
var card = tv(cardRecipe);
|
|
41
|
-
var slots = card();
|
|
42
|
-
function CardRoot({ asChild, reveal, radius, tone, interactive, className, style, ...props }) {
|
|
43
|
-
const Comp = asChild ? Slot.Root : "div";
|
|
44
|
-
const revealStyle = reveal === void 0 ? style : { ...style, "--kz-delay": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` };
|
|
45
|
-
return /* @__PURE__ */ jsx(
|
|
46
|
-
Comp,
|
|
47
|
-
{
|
|
48
|
-
"data-reveal": reveal === void 0 ? void 0 : "",
|
|
49
|
-
"data-interactive": interactive ? "" : void 0,
|
|
50
|
-
style: revealStyle,
|
|
51
|
-
className: card({ radius, tone, interactive }).root({ className }),
|
|
52
|
-
...props
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
var ASPECT = { video: "aspect-video", square: "aspect-square", portrait: "aspect-[3/4]", auto: "" };
|
|
57
|
-
function CardMedia({ aspect = "video", className, ...props }) {
|
|
58
|
-
return /* @__PURE__ */ jsx("div", { "data-aspect": aspect, className: slots.media({ className: cn(ASPECT[aspect], className) }), ...props });
|
|
59
|
-
}
|
|
60
|
-
function CardImage({ src, alt = "", fallback, loading = "lazy", className, ...props }) {
|
|
61
|
-
if (!src) {
|
|
62
|
-
return /* @__PURE__ */ jsx("div", { "data-fallback": "", "aria-hidden": true, className: slots.fallback({ className }), children: fallback });
|
|
63
|
-
}
|
|
64
|
-
return /* @__PURE__ */ jsx("img", { src, alt, loading, decoding: "async", className: slots.image({ className }), ...props });
|
|
65
|
-
}
|
|
66
|
-
var CORNER = {
|
|
67
|
-
"top-left": "left-2.5 top-2.5",
|
|
68
|
-
"top-right": "right-2.5 top-2.5",
|
|
69
|
-
"bottom-left": "bottom-2.5 left-2.5",
|
|
70
|
-
"bottom-right": "bottom-2.5 right-2.5"
|
|
71
|
-
};
|
|
72
|
-
function CardOverlay({ corner = "top-left", className, ...props }) {
|
|
73
|
-
return /* @__PURE__ */ jsx("div", { "data-corner": corner, className: slots.overlay({ className: cn(CORNER[corner], className) }), ...props });
|
|
74
|
-
}
|
|
75
|
-
function CardBody({ padding, className, ...props }) {
|
|
76
|
-
return /* @__PURE__ */ jsx("div", { className: card({ padding }).body({ className }), ...props });
|
|
77
|
-
}
|
|
78
|
-
function CardTitle({ as: Tag = "h3", className, ...props }) {
|
|
79
|
-
return /* @__PURE__ */ jsx(Tag, { className: slots.title({ className }), ...props });
|
|
80
|
-
}
|
|
81
|
-
function CardDescription({ className, ...props }) {
|
|
82
|
-
return /* @__PURE__ */ jsx("p", { className: slots.description({ className }), ...props });
|
|
83
|
-
}
|
|
84
|
-
function CardStat({ label, className, children, ...props }) {
|
|
85
|
-
return /* @__PURE__ */ jsxs("div", { className: slots.stat({ className }), ...props, children: [
|
|
86
|
-
/* @__PURE__ */ jsx("p", { className: slots.statLabel(), children: label }),
|
|
87
|
-
/* @__PURE__ */ jsx("p", { className: slots.statValue(), children })
|
|
88
|
-
] });
|
|
89
|
-
}
|
|
90
|
-
function CardFooter({ className, ...props }) {
|
|
91
|
-
return /* @__PURE__ */ jsx("div", { className: slots.footer({ className }), ...props });
|
|
92
|
-
}
|
|
93
|
-
var Card = {
|
|
94
|
-
Root: CardRoot,
|
|
95
|
-
Media: CardMedia,
|
|
96
|
-
Image: CardImage,
|
|
97
|
-
Overlay: CardOverlay,
|
|
98
|
-
Body: CardBody,
|
|
99
|
-
Title: CardTitle,
|
|
100
|
-
Description: CardDescription,
|
|
101
|
-
Stat: CardStat,
|
|
102
|
-
Footer: CardFooter
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
// src/skeleton/skeleton.tsx
|
|
106
|
-
import { tv as tv2 } from "tailwind-variants";
|
|
107
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
108
|
-
var skeletonVariants = tv2({
|
|
109
|
-
base: "kz-skeleton block bg-surface-3",
|
|
110
|
-
variants: {
|
|
111
|
-
shape: { text: "h-3 w-full rounded-sm", circle: "aspect-square h-10 rounded-full", rect: "h-24 w-full rounded-lg" }
|
|
112
|
-
},
|
|
113
|
-
defaultVariants: { shape: "text" }
|
|
114
|
-
});
|
|
115
|
-
function Skeleton({ shape, className, ...props }) {
|
|
116
|
-
return /* @__PURE__ */ jsx2("span", { "aria-hidden": true, "data-shape": shape ?? "text", className: skeletonVariants({ shape, className }), ...props });
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export {
|
|
120
|
-
CardRoot,
|
|
121
|
-
CardBody,
|
|
122
|
-
CardTitle,
|
|
123
|
-
Card,
|
|
124
|
-
Skeleton
|
|
125
|
-
};
|
|
126
|
-
//# sourceMappingURL=chunk-YKOLME7R.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/card/card.tsx","../src/card/recipe.ts","../src/skeleton/skeleton.tsx"],"sourcesContent":["// Server-safe: no hook, no context. One `tv` definition with slots: each part takes its slot, and a product overrides\n// any part through `className` (merged last by tailwind-merge).\nimport { Slot } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nimport { cn } from \"../cn\";\nimport { cardRecipe } from \"./recipe\";\n\nexport const card = tv(cardRecipe);\n\ntype CardVariants = VariantProps<typeof card>;\n/** The parts without a variant read the default slots: no context, so server-safe. */\nconst slots = card();\n\nexport type CardRootProps = React.ComponentProps<\"div\"> &\n Pick<CardVariants, \"radius\" | \"tone\" | \"interactive\"> & {\n /**\n * md · lg · xl.\n * @default \"xl\"\n */\n radius?: CardVariants[\"radius\"];\n /**\n * default (the base surface) · elevated (raised, a shadow) · glass (translucent, blurred).\n * @default \"default\"\n */\n tone?: CardVariants[\"tone\"];\n /** The quiet hover — the hairline and the surface one step up, nothing moves (krizaka-ui#393): for a card that is a link. */\n interactive?: CardVariants[\"interactive\"];\n /** Renders the child (a link, an article) instead of the <div>, with props, classes and ref merged. */\n asChild?: boolean;\n /** Enters on scroll (MotionObserver): the index in the grid becomes the delay (50 ms a step, 8 steps at most). */\n reveal?: number;\n };\n\nexport function CardRoot({ asChild, reveal, radius, tone, interactive, className, style, ...props }: CardRootProps) {\n const Comp = asChild ? Slot.Root : \"div\";\n const revealStyle =\n reveal === undefined ? style : ({ ...style, \"--kz-delay\": `${Math.min(Math.max(reveal, 0), 8) * 50}ms` } as React.CSSProperties);\n return (\n <Comp\n data-reveal={reveal === undefined ? undefined : \"\"}\n data-interactive={interactive ? \"\" : undefined}\n style={revealStyle}\n className={card({ radius, tone, interactive }).root({ className })}\n {...props}\n />\n );\n}\n\nconst ASPECT = { video: \"aspect-video\", square: \"aspect-square\", portrait: \"aspect-[3/4]\", auto: \"\" } as const;\nexport type CardMediaProps = React.ComponentProps<\"div\"> & {\n /** The ratio of the media: video (16:9) · square · portrait (3:4) · auto (the content's). */\n aspect?: keyof typeof ASPECT;\n};\n\nexport function CardMedia({ aspect = \"video\", className, ...props }: CardMediaProps) {\n return <div data-aspect={aspect} className={slots.media({ className: cn(ASPECT[aspect], className) })} {...props} />;\n}\n\nexport type CardImageProps = Omit<React.ComponentProps<\"img\">, \"src\"> & {\n /** The image's URL; `null` or nothing shows the `fallback`. */\n src?: string | null;\n /** Shown when there is no image: an icon, an illustration (decorative). */\n fallback?: React.ReactNode;\n /**\n * When the browser loads it: `lazy` (default, a card in a list or below the fold) or `eager` for the first cards\n * of a page — the image that is the largest contentful paint must not wait (add `fetchPriority=\"high\"`).\n * @default \"lazy\"\n */\n loading?: \"lazy\" | \"eager\";\n};\n\n/** The image of a media, or its `fallback` when there is none. `alt` is empty by default: the title names the card. */\nexport function CardImage({ src, alt = \"\", fallback, loading = \"lazy\", className, ...props }: CardImageProps) {\n if (!src) {\n return (\n <div data-fallback=\"\" aria-hidden className={slots.fallback({ className })}>\n {fallback}\n </div>\n );\n }\n return <img src={src} alt={alt} loading={loading} decoding=\"async\" className={slots.image({ className })} {...props} />;\n}\n\nconst CORNER = {\n \"top-left\": \"left-2.5 top-2.5\",\n \"top-right\": \"right-2.5 top-2.5\",\n \"bottom-left\": \"bottom-2.5 left-2.5\",\n \"bottom-right\": \"bottom-2.5 right-2.5\",\n} as const;\nexport type CardOverlayProps = React.ComponentProps<\"div\"> & {\n /** The corner of the media it sits in. */\n corner?: keyof typeof CORNER;\n};\n\n/** What sits on the media (badges, a caption). `scrim` and `fg-on-media` are invariant: nothing to do for light. */\nexport function CardOverlay({ corner = \"top-left\", className, ...props }: CardOverlayProps) {\n return <div data-corner={corner} className={slots.overlay({ className: cn(CORNER[corner], className) })} {...props} />;\n}\n\nexport type CardBodyProps = React.ComponentProps<\"div\"> & {\n /**\n * none · sm · md · lg.\n * @default \"md\"\n */\n padding?: CardVariants[\"padding\"];\n};\n\nexport function CardBody({ padding, className, ...props }: CardBodyProps) {\n return <div className={card({ padding }).body({ className })} {...props} />;\n}\n\nexport type CardTitleProps = React.ComponentProps<\"h3\"> & {\n /** The heading level, to fit the page's outline. */\n as?: \"h2\" | \"h3\" | \"h4\";\n};\n\nexport function CardTitle({ as: Tag = \"h3\", className, ...props }: CardTitleProps) {\n return <Tag className={slots.title({ className })} {...props} />;\n}\n\nexport function CardDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return <p className={slots.description({ className })} {...props} />;\n}\n\nexport type CardStatProps = React.ComponentProps<\"div\"> & {\n /** What the figure is, in small capitals above it (the figure is the children). */\n label: React.ReactNode;\n};\n\n/** A figure put forward: the label in capitals, the value in tabular digits. */\nexport function CardStat({ label, className, children, ...props }: CardStatProps) {\n return (\n <div className={slots.stat({ className })} {...props}>\n <p className={slots.statLabel()}>{label}</p>\n <p className={slots.statValue()}>{children}</p>\n </div>\n );\n}\n\nexport function CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div className={slots.footer({ className })} {...props} />;\n}\n\n/** `Card.Root/Media/Image/Overlay/Body/Title/Description/Stat/Footer`. */\nexport const Card = {\n Root: CardRoot,\n Media: CardMedia,\n Image: CardImage,\n Overlay: CardOverlay,\n Body: CardBody,\n Title: CardTitle,\n Description: CardDescription,\n Stat: CardStat,\n Footer: CardFooter,\n};\n","// The card's parts, radii, tones and paddings, written once as classes of the Krizaka tokens: the web wears them with\n// `tv(cardRecipe)`, React Native reads the same classes into styles (native/card.tsx): a part of the card that exists only\n// on the web (the hover's tint) is simply ignored there.\nimport { defineRecipe } from \"../recipes/define\";\n\nexport const cardRecipe = defineRecipe({\n slots: {\n root:\n \"group relative flex flex-col overflow-hidden border border-border-default bg-surface-1 text-fg transition-colors \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n media: \"relative overflow-hidden bg-media\",\n image: \"h-full w-full object-cover\",\n fallback: \"flex h-full w-full items-center justify-center bg-linear-to-br from-accent/15 via-media to-accent-2/15 text-accent/60\",\n overlay: \"absolute z-10 flex items-center gap-1.5\",\n body: \"relative flex flex-1 flex-col gap-3\",\n title: \"line-clamp-1 text-sm font-semibold text-fg transition-colors group-hover:text-fg-accent\",\n description: \"line-clamp-2 text-xs text-fg-secondary\",\n stat: \"min-w-0\",\n statLabel: \"font-mono text-[11.5px] text-fg-secondary\",\n statValue: \"font-display text-xl font-black tabular-nums text-fg\",\n footer: \"relative mt-auto flex items-center gap-2 border-t border-border-subtle pt-3 text-xs text-fg-secondary\",\n },\n variants: {\n radius: { md: { root: \"rounded-md\" }, lg: { root: \"rounded-lg\" }, xl: { root: \"rounded-xl\" } },\n tone: { default: {}, elevated: { root: \"bg-surface-2 shadow-md\" }, glass: { root: \"bg-glass border-glass-border\" } },\n interactive: { true: { root: \"duration-150 hover:border-border-strong hover:bg-surface-2\" } },\n padding: { none: { body: \"p-0\" }, sm: { body: \"p-3\" }, md: { body: \"p-4\" }, lg: { body: \"p-6\" } },\n },\n defaultVariants: { radius: \"xl\", tone: \"default\", padding: \"md\" },\n});\n","// Server-safe. A placeholder for content on its way: decorative, so hidden from assistive technology. One reflection of\n// the brand light crosses every skeleton of the page together (`background-attachment: fixed`), instead of each one\n// pulsing on its own; under reduced motion they rest, tinted.\nimport type * as React from \"react\";\nimport { tv, type VariantProps } from \"tailwind-variants\";\n\nexport const skeletonVariants = tv({\n base: \"kz-skeleton block bg-surface-3\",\n variants: {\n shape: { text: \"h-3 w-full rounded-sm\", circle: \"aspect-square h-10 rounded-full\", rect: \"h-24 w-full rounded-lg\" },\n },\n defaultVariants: { shape: \"text\" },\n});\n\nexport type SkeletonProps = React.ComponentProps<\"span\"> & {\n /**\n * text (a line) · circle (an avatar; give it a height) · rect (a media; give it a height).\n * @default \"text\"\n */\n shape?: VariantProps<typeof skeletonVariants>[\"shape\"];\n};\n\n/** A shape the size of what is loading. Announce the wait elsewhere (`LoadingRegion` does it, with `aria-busy`). */\nexport function Skeleton({ shape, className, ...props }: SkeletonProps) {\n return <span aria-hidden data-shape={shape ?? \"text\"} className={skeletonVariants({ shape, className })} {...props} />;\n}\n\nexport type SkeletonTextProps = React.ComponentProps<\"span\"> & {\n /**\n * How many lines.\n * @default 3\n */\n lines?: number;\n};\n\n/** A paragraph on its way: `lines` lines, the last one shorter — like text that wraps. */\nexport function SkeletonText({ lines = 3, className, ...props }: SkeletonTextProps) {\n return (\n <span aria-hidden className={[\"flex w-full flex-col gap-2\", className].filter(Boolean).join(\" \")} {...props}>\n {Array.from({ length: lines }, (_, i) => (\n <Skeleton key={i} className={i === lines - 1 && lines > 1 ? \"w-3/5\" : undefined} />\n ))}\n </span>\n );\n}\n\nexport type SkeletonShapeProps = React.ComponentProps<\"div\">;\n\n/**\n * The skeleton of the real thing: render your component with placeholder data inside, and its text, images and icons\n * become skeleton shapes in place — the exact layout, nothing to draw twice. Inert and hidden from assistive technology.\n */\nexport function SkeletonShape({ className, children, ...props }: SkeletonShapeProps) {\n return (\n <div aria-hidden inert className={[\"kz-skeleton-shape\", className].filter(Boolean).join(\" \")} {...props}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAEA,SAAS,YAAY;AAErB,SAAS,UAA6B;;;ACC/B,IAAM,aAAa,aAAa;AAAA,EACrC,OAAO;AAAA,IACL,MACE;AAAA,IAEF,OAAO;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,IACT,MAAM;AAAA,IACN,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,IACN,WAAW;AAAA,IACX,WAAW;AAAA,IACX,QAAQ;AAAA,EACV;AAAA,EACA,UAAU;AAAA,IACR,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,GAAG,IAAI,EAAE,MAAM,aAAa,GAAG,IAAI,EAAE,MAAM,aAAa,EAAE;AAAA,IAC7F,MAAM,EAAE,SAAS,CAAC,GAAG,UAAU,EAAE,MAAM,yBAAyB,GAAG,OAAO,EAAE,MAAM,+BAA+B,EAAE;AAAA,IACnH,aAAa,EAAE,MAAM,EAAE,MAAM,6DAA6D,EAAE;AAAA,IAC5F,SAAS,EAAE,MAAM,EAAE,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,MAAM,EAAE;AAAA,EAClG;AAAA,EACA,iBAAiB,EAAE,QAAQ,MAAM,MAAM,WAAW,SAAS,KAAK;AAClE,CAAC;;;ADWG,cA8FA,YA9FA;AA/BG,IAAM,OAAO,GAAG,UAAU;AAIjC,IAAM,QAAQ,KAAK;AAsBZ,SAAS,SAAS,EAAE,SAAS,QAAQ,QAAQ,MAAM,a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mBD,IAAG;AAAA,EACjC,MAAM;AAAA,EACN,UAAU;AAAA,IACR,OAAO,EAAE,MAAM,yBAAyB,QAAQ,mCAAmC,MAAM,yBAAyB;AAAA,EACpH;AAAA,EACA,iBAAiB,EAAE,OAAO,OAAO;AACnC,CAAC;AAWM,SAAS,SAAS,EAAE,OAAO,WAAW,GAAG,MAAM,GAAkB;AACtE,SAAO,gBAAAC,KAAC,UAAK,eAAW,MAAC,cAAY,SAAS,QAAQ,WAAW,iBAAiB,EAAE,OAAO,UAAU,CAAC,GAAI,GAAG,OAAO;AACtH;","names":["tv","jsx"]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { LinkComponent } from '@krizaka/ui/page-hero';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
interface HowStep {
|
|
5
|
-
/** A stable key (the step's anchor). */
|
|
6
|
-
id: string;
|
|
7
|
-
/** What happens, in a few words. */
|
|
8
|
-
title: React.ReactNode;
|
|
9
|
-
/** How, in two or three sentences. */
|
|
10
|
-
text: React.ReactNode;
|
|
11
|
-
/** Beside the words: a code block, a schema, a screen. */
|
|
12
|
-
visual?: React.ReactNode;
|
|
13
|
-
}
|
|
14
|
-
type HowItWorksPageProps = Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
15
|
-
/** The brand the page wears (`.brand-<id>`). */
|
|
16
|
-
brand?: string;
|
|
17
|
-
/** The way back to the product. */
|
|
18
|
-
back?: {
|
|
19
|
-
href: string;
|
|
20
|
-
label: string;
|
|
21
|
-
};
|
|
22
|
-
/** A mono line above the title. */
|
|
23
|
-
eyebrow?: React.ReactNode;
|
|
24
|
-
/** The page's `h1`. */
|
|
25
|
-
title: React.ReactNode;
|
|
26
|
-
/** One or two sentences under it. */
|
|
27
|
-
lead?: React.ReactNode;
|
|
28
|
-
/** Beside the hero: the page's bird or an illustration. */
|
|
29
|
-
aside?: React.ReactNode;
|
|
30
|
-
/** The steps' accessible name (`The steps`). */
|
|
31
|
-
stepsLabel: string;
|
|
32
|
-
/** The steps, in order. */
|
|
33
|
-
steps: readonly HowStep[];
|
|
34
|
-
/** After the steps: architecture, guarantees, a module map. */
|
|
35
|
-
children?: React.ReactNode;
|
|
36
|
-
/** The closing call. */
|
|
37
|
-
closing?: {
|
|
38
|
-
title: React.ReactNode;
|
|
39
|
-
body?: React.ReactNode;
|
|
40
|
-
actions: React.ReactNode;
|
|
41
|
-
};
|
|
42
|
-
/** The app's link component (Next's `Link`). */
|
|
43
|
-
linkAs?: LinkComponent;
|
|
44
|
-
};
|
|
45
|
-
/** How a product works: the hero, a numbered timeline of steps with their visuals, then the details. */
|
|
46
|
-
declare function HowItWorksPage({ brand, back, eyebrow, title, lead, aside, stepsLabel, steps, closing, linkAs, className, children, ...props }: HowItWorksPageProps): React.JSX.Element;
|
|
47
|
-
|
|
48
|
-
export { HowItWorksPage };
|
|
49
|
-
export type { HowItWorksPageProps, HowStep };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
cn
|
|
3
|
-
} from "./chunk-KH3JOEPY.js";
|
|
4
|
-
|
|
5
|
-
// src/how-it-works-page/how-it-works-page.tsx
|
|
6
|
-
import { CtaPanel } from "@krizaka/ui/cta-panel";
|
|
7
|
-
import { Section } from "@krizaka/ui/page";
|
|
8
|
-
import { PageHero } from "@krizaka/ui/page-hero";
|
|
9
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
-
function HowItWorksPage({ brand, back, eyebrow, title, lead, aside, stepsLabel, steps, closing, linkAs, className, children, ...props }) {
|
|
11
|
-
return /* @__PURE__ */ jsxs("div", { className: cn(brand && "brand-" + brand, className), ...props, children: [
|
|
12
|
-
/* @__PURE__ */ jsx(PageHero, { back, linkAs, eyebrow, title, lead, aside }),
|
|
13
|
-
/* @__PURE__ */ jsx(Section, { "aria-label": stepsLabel, children: /* @__PURE__ */ jsx("ol", { className: "kz-tpl-timeline", children: steps.map((step, i) => /* @__PURE__ */ jsxs("li", { id: step.id, className: "kz-tpl-step", "data-reveal": "", children: [
|
|
14
|
-
/* @__PURE__ */ jsx("span", { className: "kz-tpl-step-n", "aria-hidden": true, children: i + 1 }),
|
|
15
|
-
/* @__PURE__ */ jsxs("div", { className: "kz-tpl-step-text", children: [
|
|
16
|
-
/* @__PURE__ */ jsx("h2", { children: step.title }),
|
|
17
|
-
/* @__PURE__ */ jsx("p", { children: step.text })
|
|
18
|
-
] }),
|
|
19
|
-
step.visual && /* @__PURE__ */ jsx("div", { className: "kz-tpl-step-visual", children: step.visual })
|
|
20
|
-
] }, step.id)) }) }),
|
|
21
|
-
children,
|
|
22
|
-
closing && /* @__PURE__ */ jsx(Section, { spacing: "sm", "aria-labelledby": "how-closing", children: /* @__PURE__ */ jsx(CtaPanel, { id: "how-closing", title: closing.title, body: closing.body, reveal: true, children: closing.actions }) })
|
|
23
|
-
] });
|
|
24
|
-
}
|
|
25
|
-
export {
|
|
26
|
-
HowItWorksPage
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=how-it-works-page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/how-it-works-page/how-it-works-page.tsx"],"sourcesContent":["// Server-safe. How a product works, told in steps (blocks.css `.kz-tpl-timeline`): the hero, then a numbered line\n// down the page — each step its words beside its visual (a command, a schema, a screen), the sides alternating on a\n// wide screen, one column on a phone — then what is under the hood and the closing call.\nimport { CtaPanel } from \"@krizaka/ui/cta-panel\";\nimport { Section } from \"@krizaka/ui/page\";\nimport type { LinkComponent } from \"@krizaka/ui/page-hero\";\nimport { PageHero } from \"@krizaka/ui/page-hero\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport interface HowStep {\n /** A stable key (the step's anchor). */\n id: string;\n /** What happens, in a few words. */\n title: React.ReactNode;\n /** How, in two or three sentences. */\n text: React.ReactNode;\n /** Beside the words: a code block, a schema, a screen. */\n visual?: React.ReactNode;\n}\n\nexport type HowItWorksPageProps = Omit<React.HTMLAttributes<HTMLElement>, \"title\"> & {\n /** The brand the page wears (`.brand-<id>`). */\n brand?: string;\n /** The way back to the product. */\n back?: { href: string; label: string };\n /** A mono line above the title. */\n eyebrow?: React.ReactNode;\n /** The page's `h1`. */\n title: React.ReactNode;\n /** One or two sentences under it. */\n lead?: React.ReactNode;\n /** Beside the hero: the page's bird or an illustration. */\n aside?: React.ReactNode;\n /** The steps' accessible name (`The steps`). */\n stepsLabel: string;\n /** The steps, in order. */\n steps: readonly HowStep[];\n /** After the steps: architecture, guarantees, a module map. */\n children?: React.ReactNode;\n /** The closing call. */\n closing?: { title: React.ReactNode; body?: React.ReactNode; actions: React.ReactNode };\n /** The app's link component (Next's `Link`). */\n linkAs?: LinkComponent;\n};\n\n/** How a product works: the hero, a numbered timeline of steps with their visuals, then the details. */\nexport function HowItWorksPage({ brand, back, eyebrow, title, lead, aside, stepsLabel, steps, closing, linkAs, className, children, ...props }: HowItWorksPageProps) {\n return (\n <div className={cn(brand && \"brand-\" + brand, className)} {...props}>\n <PageHero back={back} linkAs={linkAs} eyebrow={eyebrow} title={title} lead={lead} aside={aside} />\n <Section aria-label={stepsLabel}>\n <ol className=\"kz-tpl-timeline\">\n {steps.map((step, i) => (\n <li key={step.id} id={step.id} className=\"kz-tpl-step\" data-reveal=\"\">\n <span className=\"kz-tpl-step-n\" aria-hidden>\n {i + 1}\n </span>\n <div className=\"kz-tpl-step-text\">\n <h2>{step.title}</h2>\n <p>{step.text}</p>\n </div>\n {step.visual && <div className=\"kz-tpl-step-visual\">{step.visual}</div>}\n </li>\n ))}\n </ol>\n </Section>\n {children}\n {closing && (\n <Section spacing=\"sm\" aria-labelledby=\"how-closing\">\n <CtaPanel id=\"how-closing\" title={closing.title} body={closing.body} reveal>\n {closing.actions}\n </CtaPanel>\n </Section>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;AAGA,SAAS,gBAAgB;AACzB,SAAS,eAAe;AAExB,SAAS,gBAAgB;AA6CnB,cAQQ,YARR;AAHC,SAAS,eAAe,EAAE,OAAO,MAAM,SAAS,OAAO,MAAM,OAAO,YAAY,OAAO,SAAS,QAAQ,WAAW,UAAU,GAAG,MAAM,GAAwB;AACnK,SACE,qBAAC,SAAI,WAAW,GAAG,SAAS,WAAW,OAAO,SAAS,GAAI,GAAG,OAC5D;AAAA,wBAAC,YAAS,MAAY,QAAgB,SAAkB,OAAc,MAAY,OAAc;AAAA,IAChG,oBAAC,WAAQ,cAAY,YACnB,8BAAC,QAAG,WAAU,mBACX,gBAAM,IAAI,CAAC,MAAM,MAChB,qBAAC,QAAiB,IAAI,KAAK,IAAI,WAAU,eAAc,eAAY,IACjE;AAAA,0BAAC,UAAK,WAAU,iBAAgB,eAAW,MACxC,cAAI,GACP;AAAA,MACA,qBAAC,SAAI,WAAU,oBACb;AAAA,4BAAC,QAAI,eAAK,OAAM;AAAA,QAChB,oBAAC,OAAG,eAAK,MAAK;AAAA,SAChB;AAAA,MACC,KAAK,UAAU,oBAAC,SAAI,WAAU,sBAAsB,eAAK,QAAO;AAAA,SAR1D,KAAK,EASd,CACD,GACH,GACF;AAAA,IACC;AAAA,IACA,WACC,oBAAC,WAAQ,SAAQ,MAAK,mBAAgB,eACpC,8BAAC,YAAS,IAAG,eAAc,OAAO,QAAQ,OAAO,MAAM,QAAQ,MAAM,QAAM,MACxE,kBAAQ,SACX,GACF;AAAA,KAEJ;AAEJ;","names":[]}
|
package/dist/marquee.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
type MarqueeProps = Omit<React.ComponentProps<"section">, "children"> & {
|
|
4
|
-
/** The accessible name of the band (“Our partners”) — passed translated. */
|
|
5
|
-
label: string;
|
|
6
|
-
/** The pause button's name (“Pause the band”) — passed translated. */
|
|
7
|
-
pauseLabel: string;
|
|
8
|
-
/** The same button's name once paused (“Play the band”) — passed translated. */
|
|
9
|
-
playLabel: string;
|
|
10
|
-
/** The items: logos, words, cards. */
|
|
11
|
-
children: React.ReactNode;
|
|
12
|
-
/**
|
|
13
|
-
* Pixels per second.
|
|
14
|
-
* @default 40
|
|
15
|
-
*/
|
|
16
|
-
speed?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Which way it slides.
|
|
19
|
-
* @default "left"
|
|
20
|
-
*/
|
|
21
|
-
direction?: "left" | "right";
|
|
22
|
-
/**
|
|
23
|
-
* The edges fade into the page.
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
|
-
fade?: boolean;
|
|
27
|
-
/** Starts paused. */
|
|
28
|
-
defaultPaused?: boolean;
|
|
29
|
-
};
|
|
30
|
-
/** A band of items sliding forever — pausable, accessible, still under reduced motion. */
|
|
31
|
-
declare function Marquee({ label, pauseLabel, playLabel, children, speed, direction, fade, defaultPaused, className, ...props }: MarqueeProps): React.JSX.Element;
|
|
32
|
-
|
|
33
|
-
export { Marquee };
|
|
34
|
-
export type { MarqueeProps };
|
package/dist/marquee.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
cn
|
|
4
|
-
} from "./chunk-NSLXEDIS.js";
|
|
5
|
-
|
|
6
|
-
// src/marquee/marquee.tsx
|
|
7
|
-
import * as React from "react";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
function Marquee({ label, pauseLabel, playLabel, children, speed = 40, direction = "left", fade = true, defaultPaused = false, className, ...props }) {
|
|
10
|
-
const [paused, setPaused] = React.useState(defaultPaused);
|
|
11
|
-
const track = React.useRef(null);
|
|
12
|
-
React.useEffect(() => {
|
|
13
|
-
const el = track.current;
|
|
14
|
-
if (!el) return;
|
|
15
|
-
const measure = () => el.style.setProperty("--kz-marquee-duration", `${Math.max(4, el.scrollWidth / 2 / Math.max(1, speed))}s`);
|
|
16
|
-
measure();
|
|
17
|
-
const ro = new ResizeObserver(measure);
|
|
18
|
-
ro.observe(el);
|
|
19
|
-
return () => ro.disconnect();
|
|
20
|
-
}, [speed]);
|
|
21
|
-
return /* @__PURE__ */ jsxs("section", { "aria-label": label, "data-paused": paused ? "" : void 0, "data-direction": direction, "data-fade": fade ? "" : void 0, className: cn("kz-band group/marquee relative", className), ...props, children: [
|
|
22
|
-
/* @__PURE__ */ jsx(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
tabIndex: 0,
|
|
26
|
-
className: "kz-band-viewport overflow-hidden rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
27
|
-
children: /* @__PURE__ */ jsxs("div", { ref: track, className: "kz-marquee kz-loop", children: [
|
|
28
|
-
/* @__PURE__ */ jsx("ul", { className: "flex shrink-0 items-center gap-(--kz-band-gap) pr-(--kz-band-gap)", children: wrap(children) }),
|
|
29
|
-
/* @__PURE__ */ jsx("ul", { "aria-hidden": true, className: "kz-band-copy flex shrink-0 items-center gap-(--kz-band-gap) pr-(--kz-band-gap)", children: wrap(children) })
|
|
30
|
-
] })
|
|
31
|
-
}
|
|
32
|
-
),
|
|
33
|
-
/* @__PURE__ */ jsx(
|
|
34
|
-
"button",
|
|
35
|
-
{
|
|
36
|
-
type: "button",
|
|
37
|
-
"aria-pressed": paused,
|
|
38
|
-
"aria-label": paused ? playLabel : pauseLabel,
|
|
39
|
-
onClick: () => setPaused(!paused),
|
|
40
|
-
className: "absolute right-1 top-1/2 inline-flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-full border border-border-default bg-surface-1/90 text-fg-secondary opacity-0 shadow-sm transition-opacity hover:text-fg focus-visible:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring group-hover/marquee:opacity-100 aria-pressed:opacity-100 motion-reduce:hidden",
|
|
41
|
-
children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", className: "h-3.5 w-3.5", fill: "currentColor", "aria-hidden": true, children: paused ? /* @__PURE__ */ jsx("path", { d: "M8 5.5v13l10-6.5Z" }) : /* @__PURE__ */ jsx("path", { d: "M7 5h3.5v14H7zM13.5 5H17v14h-3.5z" }) })
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
] });
|
|
45
|
-
}
|
|
46
|
-
function wrap(children) {
|
|
47
|
-
return React.Children.map(children, (child) => /* @__PURE__ */ jsx("li", { className: "shrink-0", children: child }));
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
Marquee
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=marquee.js.map
|
package/dist/marquee.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/marquee/marquee.tsx"],"sourcesContent":["// Client (a pause button, a measure). A band that slides — and that anyone can stop: it pauses under the pointer and\n// while something inside has the focus, it carries a visible pause button (WCAG 2.2.2: motion longer than 5 s can be\n// paused), its speed is in pixels per second whatever its width (a long band does not race), its copy is hidden from\n// assistive technology (each item is read once), and under reduced motion it is a still row you scroll by hand.\nimport * as React from \"react\";\n\nimport { cn } from \"../cn\";\n\nexport type MarqueeProps = Omit<React.ComponentProps<\"section\">, \"children\"> & {\n /** The accessible name of the band (“Our partners”) — passed translated. */\n label: string;\n /** The pause button's name (“Pause the band”) — passed translated. */\n pauseLabel: string;\n /** The same button's name once paused (“Play the band”) — passed translated. */\n playLabel: string;\n /** The items: logos, words, cards. */\n children: React.ReactNode;\n /**\n * Pixels per second.\n * @default 40\n */\n speed?: number;\n /**\n * Which way it slides.\n * @default \"left\"\n */\n direction?: \"left\" | \"right\";\n /**\n * The edges fade into the page.\n * @default true\n */\n fade?: boolean;\n /** Starts paused. */\n defaultPaused?: boolean;\n};\n\n/** A band of items sliding forever — pausable, accessible, still under reduced motion. */\nexport function Marquee({ label, pauseLabel, playLabel, children, speed = 40, direction = \"left\", fade = true, defaultPaused = false, className, ...props }: MarqueeProps) {\n const [paused, setPaused] = React.useState(defaultPaused);\n const track = React.useRef<HTMLDivElement>(null);\n React.useEffect(() => {\n const el = track.current;\n if (!el) return;\n const measure = () => el.style.setProperty(\"--kz-marquee-duration\", `${Math.max(4, el.scrollWidth / 2 / Math.max(1, speed))}s`);\n measure();\n const ro = new ResizeObserver(measure);\n ro.observe(el);\n return () => ro.disconnect();\n }, [speed]);\n return (\n <section aria-label={label} data-paused={paused ? \"\" : undefined} data-direction={direction} data-fade={fade ? \"\" : undefined} className={cn(\"kz-band group/marquee relative\", className)} {...props}>\n {/* Focusable: the keyboard stops the band (focus-within) and, still under reduced motion, scrolls the row. */}\n <div\n tabIndex={0}\n className=\"kz-band-viewport overflow-hidden rounded-lg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\"\n >\n {/* Each copy ends with the gap: two copies are exactly twice one, so the loop never jumps. */}\n <div ref={track} className=\"kz-marquee kz-loop\">\n <ul className=\"flex shrink-0 items-center gap-(--kz-band-gap) pr-(--kz-band-gap)\">{wrap(children)}</ul>\n <ul aria-hidden className=\"kz-band-copy flex shrink-0 items-center gap-(--kz-band-gap) pr-(--kz-band-gap)\">\n {wrap(children)}\n </ul>\n </div>\n </div>\n <button\n type=\"button\"\n aria-pressed={paused}\n aria-label={paused ? playLabel : pauseLabel}\n onClick={() => setPaused(!paused)}\n className=\"absolute right-1 top-1/2 inline-flex h-7 w-7 -translate-y-1/2 items-center justify-center rounded-full border border-border-default bg-surface-1/90 text-fg-secondary opacity-0 shadow-sm transition-opacity hover:text-fg focus-visible:opacity-100 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring group-hover/marquee:opacity-100 aria-pressed:opacity-100 motion-reduce:hidden\"\n >\n <svg viewBox=\"0 0 24 24\" className=\"h-3.5 w-3.5\" fill=\"currentColor\" aria-hidden>\n {paused ? <path d=\"M8 5.5v13l10-6.5Z\" /> : <path d=\"M7 5h3.5v14H7zM13.5 5H17v14h-3.5z\" />}\n </svg>\n </button>\n </section>\n );\n}\n\nfunction wrap(children: React.ReactNode) {\n return React.Children.map(children, (child) => <li className=\"shrink-0\">{child}</li>);\n}\n"],"mappings":";;;;;;AAIA,YAAY,WAAW;AAqDf,SACE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