mirror of
https://github.com/bitbaum/whenkit.git
synced 2026-12-04 04:27:25 +01:00
- line-height: normal (the font's own, like a native input) instead of 1.3, and an icon that fits a normal line: the box is now exactly a native input's height (38 vs 38; it was 40 vs 38, a visible step in form rows). - structure rules on span.wk-input so an app's own unlayered class with display:block on the same element cannot collapse the stacked layout. - codemod: an object spread inside onChange is no longer flagged as a JSX prop spread. Both browser checks were first run failing against the old CSS. Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
124 lines
3.8 KiB
HTML
124 lines
3.8 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;
|
|
}
|
|
h2 {
|
|
font-size: 14px;
|
|
margin: 0 0 12px;
|
|
opacity: 0.6;
|
|
font-weight: 500;
|
|
}
|
|
/* Shaped like a modal dialog (shadcn/Radix DialogContent): a grid whose
|
|
column is sized by its content. A picker that props this open
|
|
pushes the dialog's buttons off-screen. */
|
|
.dialog-like {
|
|
display: grid;
|
|
gap: 16px;
|
|
width: calc(100% - 32px);
|
|
max-width: 28rem;
|
|
margin: 32px auto 0;
|
|
padding: 24px;
|
|
border: 1px solid hsl(var(--border-default, 0 0% 82%));
|
|
border-radius: 12px;
|
|
background: hsl(var(--surface-base, 0 0% 100%));
|
|
box-sizing: border-box;
|
|
}
|
|
/* An app's OWN input class, unlayered plain CSS and a layered utility: both
|
|
must beat whenkit's defaults (they live in @layer base). */
|
|
.app-input {
|
|
padding: 2px 6px;
|
|
border: 3px solid rgb(255, 0, 0);
|
|
border-radius: 0;
|
|
}
|
|
/* A dense app input: 12px text, tight padding (e.g. Loki's ui-input-tight). */
|
|
.compact-input {
|
|
font-size: 12px;
|
|
padding: 6px 10px;
|
|
line-height: 1.3;
|
|
}
|
|
@layer utilities {
|
|
.util-input {
|
|
border-width: 5px;
|
|
border-style: dashed;
|
|
border-color: rgb(0, 0, 255);
|
|
}
|
|
}
|
|
/* An app's input, applied to a native input AND to DateInput: they must end up
|
|
the same height (a serif so its natural line height differs from 1.3). */
|
|
.match-input {
|
|
font-family: Georgia, serif;
|
|
font-size: 14px;
|
|
padding: 10px 14px;
|
|
border: 1.5px solid rgb(150, 150, 150);
|
|
border-radius: 10px;
|
|
width: 100%;
|
|
box-sizing: border-box;
|
|
}
|
|
/* A hostile app class: display:block on the same element (unlayered, later). */
|
|
.block-input {
|
|
display: block;
|
|
}
|
|
.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>
|
|
<div class="grid" style="margin-top: 24px">
|
|
<section><div id="own-class"></div></section>
|
|
<section><div id="util-class"></div></section>
|
|
<section><div id="compact-class"></div></section>
|
|
<section>
|
|
<input id="match-native" class="match-input" value="Bello" />
|
|
<div id="match-date" style="margin-top: 8px"></div>
|
|
</section>
|
|
<section><div id="block-class"></div></section>
|
|
</div>
|
|
<div class="dialog-like" id="dialog"></div>
|
|
</main>
|
|
<script src="./dist/demo.js"></script>
|
|
</body>
|
|
</html>
|