{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"c-time-picker-7","type":"registry:block","title":"Unavailable slots","description":"30-minute appointment slots with the lunch hour and booked times disabled.","dependencies":[],"registryDependencies":["field","@reui/time-picker"],"files":[{"path":"c-time-picker-7.tsx","type":"registry:block","content":"\"use client\"\n\nimport { TimePicker } from \"@/components/reui/time-picker\"\n\nimport {\n  Field,\n  FieldDescription,\n  FieldLabel,\n} from \"@/components/ui/field\"\n\nconst BOOKED = new Set([\"10:00\", \"14:30\", \"15:00\"])\n\n/* Values arrive as `HH:mm`, so plain string comparison orders them. Module\n   scope keeps the function stable, and a function prop is also why this file\n   is a client module although it holds no state. */\nfunction isUnavailable(value: string) {\n  return (value >= \"12:00\" && value < \"13:00\") || BOOKED.has(value)\n}\n\nexport function Pattern() {\n  return (\n    <div className=\"w-full max-w-xs\">\n      <Field>\n        <FieldLabel id=\"appointment-time-label\" htmlFor=\"appointment-time\">\n          Appointment\n        </FieldLabel>\n        {/* An hour with no free slot left is disabled whole, like 12. */}\n        <TimePicker\n          id=\"appointment-time\"\n          minuteStep={30}\n          min=\"09:00\"\n          max=\"17:00\"\n          isTimeDisabled={isUnavailable}\n          aria-labelledby=\"appointment-time-label\"\n          aria-describedby=\"appointment-time-description\"\n        />\n        <FieldDescription id=\"appointment-time-description\">\n          Lunch from 12:00 to 13:00 and times already booked are unavailable.\n        </FieldDescription>\n      </Field>\n    </div>\n  )\n}","target":"components/examples/c-time-picker-7.tsx"}],"meta":{"order":7,"label":"Unavailable Slots"}}