{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "segmented-period",
  "title": "Segmented control: sales by period",
  "description": "An example of Segmented control: sales by period.",
  "dependencies": [],
  "registryDependencies": [
    "@keyline-ui/keyline",
    "@keyline-ui/segmented"
  ],
  "files": [
    {
      "path": "src/registry/keyline/examples/segmented-period.tsx",
      "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { Segmented, SegmentedItem } from \"../ui/segmented\";\n\nconst PERIODS = [\n  { value: \"today\", label: \"Today\", reams: 340, vs: \"Tuesdays usually do 290\" },\n  { value: \"week\", label: \"This week\", reams: 1_810, vs: \"112% of target\" },\n  { value: \"month\", label: \"This month\", reams: 6_420, vs: \"Stamford's best month was 6,100\" },\n  { value: \"quarter\", label: \"This quarter\", reams: 19_880, vs: \"Ahead of Nashua and Utica\" },\n  { value: \"year\", label: \"Year to date\", reams: 71_240, vs: \"Top branch in the northeast\" },\n];\n\nexport function SalesByPeriod() {\n  const [period, setPeriod] = useState(\"week\");\n  const p = PERIODS.find((x) => x.value === period)!;\n\n  return (\n    <div className=\"grid gap-4\">\n      <Segmented aria-label=\"Period\" value={period} onValueChange={setPeriod} className=\"justify-self-start\">\n        {PERIODS.map((x) => (\n          <SegmentedItem key={x.value} value={x.value}>\n            {x.label}\n          </SegmentedItem>\n        ))}\n      </Segmented>\n      <p role=\"status\" className=\"m-0 grid gap-1\">\n        <span className=\"text-[28px] leading-none font-semibold tabular-nums\">\n          {p.reams.toLocaleString(\"en-US\")} reams\n        </span>\n        <span className=\"text-[14px] text-kl-ink-2\">\n          Scranton, {p.label.toLowerCase()}. {p.vs}.\n        </span>\n      </p>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/keyline/examples/segmented-period.tsx"
    }
  ],
  "categories": [
    "segmented"
  ],
  "type": "registry:block"
}