mirror of
https://github.com/bitbaum/whenkit.git
synced 2026-12-05 09:58:49 +01:00
Day chips, time chips, length chips, a readable date field over the native
picker, and a booking request that resolves to {startsAt, endsAt} in the
provider's zone.
- Core (no React): wall-clock YYYY-MM-DD / HH:MM strings, one zonedToUtc
(DST gaps resolve forward), todayIn(zone), slots inside opening hours,
lengths that fit, resolveRequest / describeRequest for three choices:
slot, days, flexible.
- React: BookingRequestPicker, DayStrip, ChipGroup (real radio groups),
DateField (native input transparent over a readable display).
- styles.css: --wk-* variables defaulting to @bitbaum/design-tokens; 44px
targets, 16px input, strip scrolls inside itself.
- Tests: 15 core + 8 server-render, and a Chromium check at 1280/390,
light/dark that taps bookings end to end. dist/ committed for github: installs.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
66 lines
1.7 KiB
HTML
66 lines
1.7 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<title>whenkit demo</title>
|
|
<link rel="stylesheet" href="../node_modules/@bitbaum/design-tokens/tokens.css" />
|
|
<link rel="stylesheet" href="../styles.css" />
|
|
<style>
|
|
/* Page chrome only — the picker's look comes from styles.css + tokens. */
|
|
body {
|
|
margin: 0;
|
|
font-family: system-ui, sans-serif;
|
|
}
|
|
.theme {
|
|
padding: 24px 16px;
|
|
background: hsl(var(--surface-page, 0 0% 98%));
|
|
color: hsl(var(--text-primary, 0 0% 10%));
|
|
min-height: 100vh;
|
|
box-sizing: border-box;
|
|
}
|
|
.grid {
|
|
display: grid;
|
|
gap: 32px;
|
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
}
|
|
.grid > section {
|
|
min-width: 0;
|
|
}
|
|
h2 {
|
|
font-size: 14px;
|
|
margin: 0 0 12px;
|
|
opacity: 0.6;
|
|
font-weight: 500;
|
|
}
|
|
.resolved {
|
|
font-size: 11px;
|
|
opacity: 0.5;
|
|
white-space: pre-wrap;
|
|
word-break: break-all;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<main class="theme">
|
|
<div class="grid">
|
|
<section>
|
|
<h2>Hourly — a session</h2>
|
|
<div id="hourly"></div>
|
|
</section>
|
|
<section>
|
|
<h2>Daily — a studio by the day</h2>
|
|
<div id="daily"></div>
|
|
</section>
|
|
<section>
|
|
<h2>A plain date field</h2>
|
|
<div id="field"></div>
|
|
</section>
|
|
</div>
|
|
</main>
|
|
<script src="./dist/demo.js"></script>
|
|
</body>
|
|
</html>
|