"use client"; import "./components/ui/tidal.css"; import { useId, useState } from "react"; import { TidalTimePicker } from "./components/ui/time-picker"; import "./components/ui/time-picker.css"; const tidalExampleStyles = ".tidal-scope .time-picker-demo,\n.tidal-scope .time-picker-demo * {\n box-sizing: border-box;\n}\n\n.tidal-scope .time-picker-demo {\n container: tidal-time-demo / inline-size;\n display: grid;\n width: min(100%, 760px);\n min-width: 0;\n gap: 22px;\n margin-inline: auto;\n padding: clamp(16px, 4vw, 42px);\n color: var(--t-ink);\n}\n\n.tidal-scope .time-picker-demo-heading {\n display: grid;\n min-width: 0;\n gap: 8px;\n}\n\n.tidal-scope .time-picker-demo-heading :is(h2, p) {\n margin: 0;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .time-picker-demo-heading h2 {\n font-size: clamp(27px, 5vw, 42px);\n font-weight: 570;\n letter-spacing: -0.05em;\n line-height: 1;\n}\n\n.tidal-scope .time-picker-demo-heading p,\n.tidal-scope .time-picker-demo-footer {\n color: var(--t-muted);\n font-size: 11px;\n line-height: 1.5;\n}\n\n.tidal-scope .time-picker-demo-form {\n display: grid;\n min-width: 0;\n gap: 20px;\n padding: clamp(16px, 4vw, 28px);\n border: 1px solid var(--t-border);\n border-radius: 18px;\n background: var(--t-surface);\n}\n\n.tidal-scope .time-picker-demo-toolbar {\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);\n min-width: 0;\n gap: 12px;\n}\n\n.tidal-scope .time-picker-demo-toolbar fieldset {\n display: flex;\n flex-wrap: wrap;\n min-width: 0;\n gap: 6px;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n.tidal-scope .time-picker-demo-toolbar legend {\n width: 100%;\n margin-bottom: 4px;\n font-size: 11px;\n font-weight: 650;\n}\n\n.tidal-scope .time-picker-demo-toolbar label {\n position: relative;\n display: inline-flex;\n min-width: 0;\n}\n\n.tidal-scope .time-picker-demo-toolbar input {\n position: absolute;\n width: 1px;\n height: 1px;\n opacity: 0;\n}\n\n.tidal-scope .time-picker-demo-toolbar label span {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 11px;\n border: 1px solid var(--t-border);\n border-radius: 10px;\n background: var(--t-surface);\n font-size: 11px;\n overflow-wrap: anywhere;\n}\n\n.tidal-scope .time-picker-demo-toolbar input:checked + span {\n border-color: var(--t-ink);\n background: var(--t-ink);\n color: var(--t-surface);\n}\n\n.tidal-scope .time-picker-demo-toolbar input:focus-visible + span {\n outline: 2px solid var(--t-ink);\n outline-offset: 3px;\n}\n\n.tidal-scope .time-picker-demo-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.tidal-scope .time-picker-demo-actions button {\n min-width: 44px;\n min-height: 44px;\n padding: 0 14px;\n border: 1px solid var(--t-ink);\n border-radius: 10px;\n background: var(--t-ink);\n color: var(--t-surface);\n font: inherit;\n font-size: 11px;\n font-weight: 650;\n}\n\n.tidal-scope .time-picker-demo-actions button[type=\"reset\"] {\n border-color: var(--t-border);\n background: var(--t-surface);\n color: var(--t-ink);\n}\n\n.tidal-scope .time-picker-demo-actions button:focus-visible {\n outline: 2px solid var(--t-ink);\n outline-offset: 3px;\n}\n\n.tidal-scope .time-picker-demo-footer {\n display: grid;\n min-width: 0;\n gap: 4px;\n}\n\n.tidal-scope .time-picker-demo-footer :is(p, span) {\n margin: 0;\n overflow-wrap: anywhere;\n}\n\n@container tidal-time-demo (max-width: 500px) {\n .tidal-scope .time-picker-demo-toolbar {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .tidal-scope .time-picker-demo-actions button {\n flex: 1 1 120px;\n }\n}\n\n@media (pointer: coarse) {\n .tidal-scope .time-picker-demo-toolbar label span,\n .tidal-scope .time-picker-demo-actions button {\n font-size: 16px;\n }\n}"; type FieldMode = "editable" | "readonly" | "disabled"; const INITIAL_TIME = "09:30"; export function TimePickerDemo() { const demoId = useId().replace(/:/g, ""); const headingId = `${demoId}-daily-review`; const [value, setValue] = useState(INITIAL_TIME); const [hourCycle, setHourCycle] = useState<12 | 24>(12); const [mode, setMode] = useState("editable"); const [status, setStatus] = useState("Choose a local review time."); return (

Daily review

Choose a time and review it in 12-hour or 24-hour format.

{ event.preventDefault(); const submittedValue = new FormData(event.currentTarget).get( "reviewTime", ); setStatus( typeof submittedValue === "string" && submittedValue ? `Local preview prepared for ${submittedValue}.` : "The disabled field was not included in the local preview.", ); }} onReset={() => { setValue(INITIAL_TIME); setHourCycle(12); setMode("editable"); setStatus("The local sample was reset."); }} >
Field state {(["editable", "readonly", "disabled"] as const).map((option) => ( ))}
Display {([12, 24] as const).map((option) => ( ))}
{ setValue(nextValue); setStatus("The local time value changed."); }} hourCycle={hourCycle} readOnly={mode === "readonly"} disabled={mode === "disabled"} hint="Uses the time value shown by this field. No time zone is applied." inputProps={{ name: "reviewTime", required: true, min: "00:00", step: 300, }} />

{status}

Local sample only. Nothing is scheduled or saved.
); } export default function AgentExample() { return (
); }