{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-settings",
  "type": "registry:block",
  "title": "Settings",
  "description": "A settings block: profile fields validated on blur and save, notification switches, a colorway and density, and a save bar that counts unsaved changes.",
  "dependencies": [
    "@unlocalhosted/metalui@^0.4.0"
  ],
  "registryDependencies": [
    "https://metalui.dev/r/tokens.json"
  ],
  "files": [
    {
      "path": "apps/docs/src/blocks/settings/settings.tsx",
      "type": "registry:block",
      "target": "components/metalui/screens/settings/settings.tsx",
      "content": "'use client';\n\nimport * as React from 'react';\nimport { motionReduced as reduced } from '@unlocalhosted/metalui';\nimport {\n  Avatar, Button, Field, FormField, Led, Radio, RadioGroup, Select, Tabs, TabList, TabPanel, SwapText, Switch, Switcher, Textarea,\n} from '@unlocalhosted/metalui';\nimport { Icon, MorphIcon } from '@unlocalhosted/metalui/icons';\n\n/* ─────────────────────────────────────────────────────────\n * SETTINGS · a workspace's preferences: who you are, what reaches you, how it looks\n *\n *   rest      a raised slab: the title and workspace; a section nav on the left (Profile,\n *             Notifications, Appearance) under one lifted highlight; the section's panel beside it\n *\n *   section   choosing one: the highlight glides to it (settle spring, the Tabs track's own); the new\n *             panel comes in one nest from the side the highlight went, fading (settle); the old\n *             one leaves at once. Edits are kept: nothing is lost by leaving a section.\n *\n *   edit      the first value that differs from what's saved:\n *      0 ms   the save bar rises from the block's bottom edge on the object spring (its own height\n *             and a nest, fading in); \"Unsaved changes\" and the count, \"1 change\"\n *   more      the count turns on the drum (\"1 change\" → \"2 changes\"); undoing an edit by hand\n *             counts down, and at none the bar leaves (release spring)\n *\n *   invalid   on leaving a field, or on Save: the field's ring turns red and its error row grows\n *             open under it (FormField, settle); typing a good value closes it\n *   refused   Save with a field not accepted: the section turns to Profile if it has to, focus goes\n *             to the first field not accepted, and the status says why. Nothing is saved.\n *\n *   save      the Save key, or ⌘S / Ctrl+S anywhere in the block\n *      0 ms   the key goes down and stays down; its glyph morphs document → clock and the label\n *             turns to \"Saving…\" on the drum; Discard is held off\n *   ~700 ms   (the sample wait, or your onSave) the glyph morphs clock → check, \"Saved\"; the title\n *             says \"Changes saved\"\n *   +900 ms   the bar sinks away on the release spring; focus, if it was in the bar, goes to the\n *             section's title\n *\n *   discard   every value returns to what's saved at once; errors close; the bar leaves (release)\n *\n *   colorway  Bone / Graphite paints the block itself (data-mu-colorway on its root), at once\n *   density   Compact tightens the rows and takes the compact field and switch sizes\n *   motion    Reduce motion (data-mu-motion on its root) makes every change in the block instant\n *\n * Reduce Motion (the system's, the site's, or the block's own switch): everything changes at once;\n * the bar is there or not; the drum crossfades.\n * Layout follows the block's own width (a container): from 36rem the nav sits on the left; under\n * that it is a Select at the top, and the save bar keeps only its count.\n * ───────────────────────────────────────────────────────── */\n\nconst TIMING = {\n  saving:    700,  // ms of the sample wait before \"Saved\" (onSave replaces it)\n  savedHold: 900,  // ms \"Saved\" holds before the bar leaves\n};\n\nconst LIMITS = {\n  bio: 160, // characters\n};\n\n/* ── Data ──────────────────────────────────────────────────── */\n\ntype Section = 'profile' | 'notifications' | 'appearance';\n\n/**\n * A section's glyph, with a waiting lamp on its corner while the section holds unsaved edits.\n * Inert: in Chrome a tab's svg takes a Tab stop of its own.\n */\nfunction Glyph({ name, dirty }: { name: 'me' | 'clock' | 'layout'; dirty: boolean }) {\n  return (\n    <span inert className=\"relative inline-grid\">\n      <Icon name={name} size={16} />\n      {dirty && <Led kind=\"waiting\" size=\"small\" gesture=\"rise\" className=\"absolute -top-1 -right-2\" />}\n    </span>\n  );\n}\ntype Frequency = 'hourly' | 'daily' | 'twice-weekly';\ntype Colorway = 'bone' | 'graphite';\ntype Density = 'comfortable' | 'compact';\n\nexport interface SettingsValues {\n  photo: string | null;\n  name: string;\n  email: string;\n  bio: string;\n  digests: boolean;\n  mentions: boolean;\n  weekly: boolean;\n  frequency: Frequency;\n  colorway: Colorway;\n  density: Density;\n  reduceMotion: boolean;\n}\n\nconst SECTIONS: { value: Section; label: string; about: string; glyph: 'me' | 'clock' | 'layout'; keys: (keyof SettingsValues)[] }[] = [\n  { value: 'profile', label: 'Profile', about: 'How people in Lisbon Studio see you.', glyph: 'me', keys: ['photo', 'name', 'email', 'bio'] },\n  { value: 'notifications', label: 'Notifications', about: 'What reaches your inbox, and how often.', glyph: 'clock', keys: ['digests', 'mentions', 'weekly', 'frequency'] },\n  { value: 'appearance', label: 'Appearance', about: 'How this workspace looks and moves for you.', glyph: 'layout', keys: ['colorway', 'density', 'reduceMotion'] },\n];\n\nconst FREQUENCIES: { value: Frequency; label: string }[] = [\n  { value: 'hourly', label: 'Every hour' },\n  { value: 'daily', label: 'Once a day' },\n  { value: 'twice-weekly', label: 'Twice a week' },\n];\n\nconst COLORWAYS: { value: Colorway; label: string }[] = [\n  { value: 'bone', label: 'Bone' },\n  { value: 'graphite', label: 'Graphite' },\n];\n\nconst SAVED: SettingsValues = {\n  photo: null,\n  name: 'Marta Silva',\n  email: 'marta@lisbonstudio.com',\n  bio: 'Designs the booking flow. Mostly on Lisbon time, sometimes on São Paulo’s.',\n  digests: true,\n  mentions: true,\n  weekly: false,\n  frequency: 'daily',\n  colorway: 'bone',\n  density: 'comfortable',\n  reduceMotion: false,\n};\n\nconst KEYS = Object.keys(SAVED) as (keyof SettingsValues)[];\nconst EMAIL = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\ntype Checked = 'name' | 'email';\nconst CHECKED: Checked[] = ['name', 'email']; // in the order they sit, for focus on a refused save\n\nfunction errorsOf(v: SettingsValues): Record<Checked, string> {\n  const email = v.email.trim();\n  return {\n    name: v.name.trim() ? '' : 'Enter your name.',\n    email: !email ? 'Enter your email address.' : EMAIL.test(email) ? '' : 'Enter an email address, like marta@example.com.',\n  };\n}\n\nconst plural = (n: number, one: string, many: string) => `${n} ${n === 1 ? one : many}`;\n\n/* ── Motion helpers ────────────────────────────────────────── */\n\n\n\n/** A spring's duration (ms, zero under Reduce Motion) and curve, read from the element's own tokens. */\nfunction spring(el: Element, name: 'settle' | 'object' | 'release') {\n  const s = getComputedStyle(el);\n  const ms = reduced(el) ? 0 : parseFloat(s.getPropertyValue(`--mu-spring-${name}-d`)) * 1000 * (parseFloat(s.getPropertyValue(`--mu-travel-${name}`)) || 0);\n  return { ms, easing: s.getPropertyValue(`--mu-spring-${name}`).trim() || 'ease-out' };\n}\n\nconst nestOf = (el: Element) => parseFloat(getComputedStyle(el).getPropertyValue('--mu-motion-nest')) || 6;\n\n/* ── Parts ─────────────────────────────────────────────────── */\n\n/** A setting that is on or off: its words on the left (clicking them toggles), the switch on the right. */\nfunction SwitchRow({ id, title, about, checked, onChange, small }: {\n  id: string; title: string; about: string; checked: boolean; onChange: (on: boolean) => void; small: boolean;\n}) {\n  return (\n    <div className=\"flex items-center justify-between gap-16\">\n      <span className=\"grid min-w-0 gap-2\">\n        <label htmlFor={id} id={`${id}-t`} className=\"cursor-pointer select-none type-ui text-ink\">{title}</label>\n        <span id={`${id}-d`} className=\"type-meta text-ink3\">{about}</span>\n      </span>\n      <Switch id={id} size={small ? 'small' : 'regular'} checked={checked} onCheckedChange={onChange} aria-labelledby={`${id}-t`} aria-describedby={`${id}-d`} />\n    </div>\n  );\n}\n\n/** A group's words above it, the way a FormField labels a single control. */\nfunction GroupLabel({ id, children, about }: { id: string; children: React.ReactNode; about?: React.ReactNode }) {\n  return (\n    <span className=\"grid gap-2\">\n      <span id={id} className=\"type-ui text-ink\">{children}</span>\n      {about && <span id={`${id}-d`} className=\"type-meta text-ink3\">{about}</span>}\n    </span>\n  );\n}\n\n/* ── The block ─────────────────────────────────────────────── */\n\nexport interface SettingsProps {\n  /** What's saved when it opens. The sample data by default; its colorway follows `colorway`. */\n  initial?: SettingsValues;\n  /** The block's colorway before anything is changed (the page's own, usually). */\n  colorway?: Colorway;\n  /** Saves the values; the key waits while it runs. Without it, a short sample wait. */\n  onSave?: (values: SettingsValues) => Promise<void> | void;\n  className?: string;\n}\n\n/** A workspace's preferences: profile, notifications and appearance, saved together from one bar. */\nexport function Settings({ initial, colorway = 'bone', onSave, className }: SettingsProps) {\n  const ids = React.useId();\n  const start = React.useMemo(() => initial ?? { ...SAVED, colorway }, [initial, colorway]);\n  const [saved, setSaved] = React.useState<SettingsValues>(start);\n  const [draft, setDraft] = React.useState<SettingsValues>(start);\n  const [section, setSection] = React.useState<Section>('profile');\n  const [touched, setTouched] = React.useState<Record<Checked, boolean>>({ name: false, email: false });\n  const [phase, setPhase] = React.useState<'editing' | 'saving' | 'saved'>('editing');\n  const [status, setStatus] = React.useState('');\n\n  const root = React.useRef<HTMLElement>(null);\n  const heading = React.useRef<HTMLHeadingElement>(null);\n  const bar = React.useRef<HTMLDivElement>(null);\n  const photoInput = React.useRef<HTMLInputElement>(null);\n  const fields = { name: React.useRef<HTMLInputElement>(null), email: React.useRef<HTMLInputElement>(null) };\n  const focusNext = React.useRef<Checked | null>(null);\n\n  // The page's colorway, until this block's own is changed and saved.\n  React.useEffect(() => {\n    if (initial) return;\n    setSaved((s) => ({ ...s, colorway }));\n    setDraft((d) => (d.colorway === saved.colorway ? { ...d, colorway } : d));\n  }, [colorway]); // eslint-disable-line react-hooks/exhaustive-deps\n\n  const set = <K extends keyof SettingsValues>(key: K, value: SettingsValues[K]) => setDraft((d) => ({ ...d, [key]: value }));\n  const changed = KEYS.filter((k) => draft[k] !== saved[k]);\n  const count = changed.length;\n  const dirty = (s: Section) => SECTIONS.find((x) => x.value === s)!.keys.some((k) => changed.includes(k));\n  const errors = errorsOf(draft);\n  const shown = { name: touched.name ? errors.name : '', email: touched.email ? errors.email : '' };\n  const compact = draft.density === 'compact';\n\n  // Tabs owns panel motion; focus after validation remains the host's responsibility.\n  React.useLayoutEffect(() => {\n    if (focusNext.current) {\n      fields[focusNext.current].current?.focus();\n      focusNext.current = null;\n    }\n  }, [section]); // eslint-disable-line react-hooks/exhaustive-deps\n\n  /* The bar: here while anything differs, or while a save runs and says so. */\n  const wanted = count > 0 || phase !== 'editing';\n  const [present, setPresent] = React.useState(wanted);\n  const held = React.useRef({ count, phase }); // what the bar says as it leaves\n  if (wanted) held.current = { count, phase };\n  React.useEffect(() => { if (wanted) setPresent(true); }, [wanted]);\n  React.useLayoutEffect(() => {\n    const el = bar.current;\n    if (!el) return;\n    const nest = nestOf(el);\n    if (wanted) {\n      const { ms, easing } = spring(el, 'object');\n      if (ms && !el.dataset.risen) el.animate([{ opacity: 0, transform: `translateY(calc(100% + ${nest}px))` }, { opacity: 1, transform: 'none' }], { duration: ms, easing });\n      el.dataset.risen = '';\n      return;\n    }\n    // Leaving: focus in the bar goes to the section's title first, never to the page.\n    const hadFocus = el.contains(document.activeElement);\n    if (hadFocus) heading.current?.focus();\n    const { ms, easing } = spring(el, 'release');\n    if (!ms) { setPresent(false); return; }\n    el.style.pointerEvents = 'none';\n    const a = el.animate([{ opacity: 1, transform: 'none' }, { opacity: 0, transform: `translateY(calc(100% + ${nest}px))` }], { duration: ms, easing, fill: 'forwards' });\n    a.finished.then(() => setPresent(false), () => {});\n    return () => { a.cancel(); el.style.pointerEvents = ''; };\n  }, [wanted, present]);\n\n  React.useEffect(() => {\n    if (phase !== 'saved') return;\n    const t = window.setTimeout(() => setPhase('editing'), TIMING.savedHold);\n    return () => window.clearTimeout(t);\n  }, [phase]);\n\n  const save = async () => {\n    if (phase === 'saving') return;\n    if (!count) { setStatus('Nothing to save'); return; }\n    setTouched({ name: true, email: true });\n    const first = CHECKED.find((k) => errors[k]);\n    if (first) {\n      setStatus(`Not saved. ${errors[first]}`);\n      if (section !== 'profile') { focusNext.current = first; setSection('profile'); }\n      else fields[first].current?.focus();\n      return;\n    }\n    const snapshot = draft;\n    setPhase('saving');\n    setStatus(`Saving ${plural(count, 'change', 'changes')}…`);\n    if (onSave) await onSave(snapshot);\n    else await new Promise((done) => window.setTimeout(done, TIMING.saving));\n    setSaved(snapshot);\n    setPhase('saved');\n    setStatus(`Saved ${plural(count, 'change', 'changes')}`);\n  };\n\n  const discard = () => {\n    if (phase === 'saving' || !count) return;\n    setDraft(saved);\n    setTouched({ name: false, email: false });\n    setStatus(`Discarded ${plural(count, 'change', 'changes')}`);\n  };\n\n  const choosePhoto = (e: React.ChangeEvent<HTMLInputElement>) => {\n    const file = e.target.files?.[0];\n    e.target.value = '';\n    if (!file) return;\n    set('photo', URL.createObjectURL(file));\n    setStatus(`Photo changed to ${file.name}`);\n  };\n\n  const onKeyDown = (e: React.KeyboardEvent) => {\n    if ((e.metaKey || e.ctrlKey) && !e.altKey && e.key.toLowerCase() === 's') {\n      e.preventDefault(); // not the browser's Save Page\n      void save();\n    }\n  };\n\n  const about = SECTIONS.find((s) => s.value === section)!;\n  const busy = phase === 'saving';\n  const saying = held.current;\n  const fieldSize = compact ? 'compact' : 'regular';\n  const rows = compact ? 'gap-12' : 'gap-20';\n\n  return (\n    <section\n      ref={root}\n      aria-labelledby={`${ids}-title`}\n      data-mu-colorway={draft.colorway}\n      data-mu-motion={draft.reduceMotion ? 'reduce' : undefined}\n      data-density={draft.density}\n      onKeyDown={onKeyDown}\n      className={`block-settings @container/block relative grid w-full max-w-[52rem] overflow-clip rounded-surface-radius-hero text-ink recipe-surface-raise ${className ?? ''}`}\n    >\n      <header className=\"grid gap-2 border-b border-rule px-20 pt-20 pb-16\">\n        <h2 id={`${ids}-title`} className=\"m-0 type-display text-ink\">Settings</h2>\n        <p className=\"m-0 type-meta text-ink2\">Lisbon Studio · your account</p>\n      </header>\n\n      <Tabs orientation=\"vertical\" value={section} onValueChange={setSection} className=\"grid! min-w-0 gap-0! @xl/block:grid-cols-[11rem_minmax(0,1fr)]\">\n        {/* Sections: a list on the left from 36rem, a Select above the panel under it */}\n        <div className=\"hidden border-r border-rule py-8 @xl/block:block\">\n          <TabList aria-label=\"Settings sections\" className=\"w-full\" size={compact ? 'compact' : 'regular'} items={SECTIONS.map(s => ({\n            value: s.value, label: s.label, icon: <Glyph name={s.glyph} dirty={dirty(s.value)} />,\n            'aria-describedby': dirty(s.value) ? `${ids}-dirty` : undefined,\n          }))} />\n          <span id={`${ids}-dirty`} hidden>Has unsaved changes</span>\n        </div>\n\n        <div className=\"@container/panel grid min-w-0 content-start gap-16 px-20 pt-16 pb-[5.5rem]\">\n          <div className=\"@xl/block:hidden\">\n            <Select\n              aria-label=\"Settings section\"\n              className=\"w-full\"\n              value={section}\n              onValueChange={setSection}\n              options={SECTIONS.map((s) => ({ value: s.value, label: s.label, lead: <Glyph name={s.glyph} dirty={dirty(s.value)} /> }))}\n            />\n          </div>\n\n          <TabPanel value={section} className={`grid min-w-0 content-start ${rows}`}>\n            <div className=\"grid gap-2\">\n              {/* Narrow, the Select above already names the section; the title stays for assistive tech and focus. */}\n              <h3 ref={heading} tabIndex={-1} id={`${ids}-section`} className=\"m-0 type-title text-ink outline-none sr-only @xl/block:not-sr-only\">{about.label}</h3>\n              <p className=\"m-0 type-meta text-ink3\">{about.about}</p>\n            </div>\n\n            {section === 'profile' && (\n              <>\n                <div className=\"flex items-center gap-16\">\n                  {/* While the name is empty, the disc keeps the saved one's initials rather than guessing. */}\n                  <Avatar name={draft.name.trim() || saved.name} src={draft.photo ?? undefined} size=\"large\" />\n                  <div className=\"grid justify-items-start gap-6\">\n                    <Button size=\"compact\" icon={<Icon name=\"image\" />} onClick={() => photoInput.current?.click()}>Change photo</Button>\n                    <span className=\"type-meta text-ink3\">JPG or PNG, square works best</span>\n                    <input ref={photoInput} type=\"file\" accept=\"image/*\" aria-label=\"Profile photo\" tabIndex={-1} className=\"sr-only\" onChange={choosePhoto} />\n                  </div>\n                </div>\n\n                <div className={`grid ${compact ? 'gap-12' : 'gap-16'} @md/panel:grid-cols-2`}>\n                  <FormField invalid={!!shown.name}>\n                    <FormField.Label>Name</FormField.Label>\n                    <Field size={fieldSize}>\n                      <Field.Input ref={fields.name} autoComplete=\"name\" value={draft.name} onChange={(e) => set('name', e.target.value)} onBlur={() => setTouched((t) => ({ ...t, name: true }))} />\n                    </Field>\n                    <FormField.Error match={!!shown.name}>{shown.name}</FormField.Error>\n                  </FormField>\n                  <FormField invalid={!!shown.email}>\n                    <FormField.Label>Email</FormField.Label>\n                    <Field size={fieldSize}>\n                      <Field.Input ref={fields.email} type=\"email\" inputMode=\"email\" autoComplete=\"email\" value={draft.email} onChange={(e) => set('email', e.target.value)} onBlur={() => setTouched((t) => ({ ...t, email: true }))} />\n                    </Field>\n                    <FormField.Error match={!!shown.email}>{shown.email}</FormField.Error>\n                  </FormField>\n                </div>\n\n                <FormField>\n                  <FormField.Label>Bio</FormField.Label>\n                  <FormField.Description>A line or two on your profile card.</FormField.Description>\n                  <Textarea\n                    size={compact ? 'compact' : 'regular'}\n                    counterThreshold={0}\n                    maxLength={LIMITS.bio}\n                    minRows={compact ? 2 : 3}\n                    value={draft.bio}\n                    onChange={(e) => set('bio', e.target.value)}\n                  />\n                </FormField>\n              </>\n            )}\n\n            {section === 'notifications' && (\n              <>\n                <div className={`grid ${rows}`}>\n                  <SwitchRow id={`${ids}-digests`} small={compact} title=\"Email digests\" about=\"A roundup of what you missed.\" checked={draft.digests} onChange={(v) => set('digests', v)} />\n                  <SwitchRow id={`${ids}-mentions`} small={compact} title=\"Mentions\" about=\"An email when someone mentions you.\" checked={draft.mentions} onChange={(v) => set('mentions', v)} />\n                  <SwitchRow id={`${ids}-weekly`} small={compact} title=\"Weekly summary\" about=\"Monday morning: the workspace’s week in one email.\" checked={draft.weekly} onChange={(v) => set('weekly', v)} />\n                </div>\n                <div className={`grid gap-10 border-t border-rule ${compact ? 'pt-12' : 'pt-16'}`}>\n                  <GroupLabel id={`${ids}-freq`} about={<SwapText value={draft.digests ? 'How often the digest comes.' : 'Turn on email digests to choose.'} />}>Digest frequency</GroupLabel>\n                  <RadioGroup\n                    aria-labelledby={`${ids}-freq`}\n                    aria-describedby={`${ids}-freq-d`}\n                    orientation=\"horizontal\"\n                    disabled={!draft.digests}\n                    value={draft.frequency}\n                    onValueChange={(v) => set('frequency', v as Frequency)}\n                  >\n                    {FREQUENCIES.map((f) => <Radio key={f.value} value={f.value}>{f.label}</Radio>)}\n                  </RadioGroup>\n                </div>\n              </>\n            )}\n\n            {section === 'appearance' && (\n              <>\n                <div className=\"grid gap-10\">\n                  <GroupLabel id={`${ids}-colorway`} about=\"Paints this block now; saved, it’s yours everywhere.\">Colorway</GroupLabel>\n                  <div>\n                    <Switcher aria-label=\"Colorway\" size={compact ? 'compact' : 'regular'} value={draft.colorway} onValueChange={(v) => set('colorway', v)} options={COLORWAYS} />\n                  </div>\n                </div>\n                <div className=\"grid gap-10\">\n                  <GroupLabel id={`${ids}-density`} about=\"Compact fits more on a screen.\">Density</GroupLabel>\n                  <RadioGroup aria-labelledby={`${ids}-density`} orientation=\"horizontal\" value={draft.density} onValueChange={(v) => set('density', v as Density)}>\n                    <Radio value=\"comfortable\">Comfortable</Radio>\n                    <Radio value=\"compact\">Compact</Radio>\n                  </RadioGroup>\n                </div>\n                <div className={`border-t border-rule ${compact ? 'pt-12' : 'pt-16'}`}>\n                  <SwitchRow id={`${ids}-motion`} small={compact} title=\"Reduce motion\" about=\"Everything changes at once; nothing travels or springs.\" checked={draft.reduceMotion} onChange={(v) => set('reduceMotion', v)} />\n                </div>\n              </>\n            )}\n          </TabPanel>\n        </div>\n      </Tabs>\n\n      {/* The save bar: pinned to the bottom of the block, or of the window while the block runs past it */}\n      <div className=\"pointer-events-none sticky bottom-0 z-10 h-0\">\n        {present && (\n          <div\n            ref={bar}\n            role=\"region\"\n            aria-label=\"Unsaved changes\"\n            className=\"pointer-events-auto absolute inset-x-12 bottom-12 flex items-center justify-between gap-12 rounded-pill py-6 pr-6 pl-18 recipe-surface-pop\"\n          >\n            <span className=\"flex min-w-0 items-baseline gap-8\">\n              <span className=\"sr-only type-ui text-ink @md/block:not-sr-only\">\n                <SwapText value={saying.phase === 'saved' ? 'Changes saved' : saying.phase === 'saving' ? 'Saving changes' : 'Unsaved changes'} />\n              </span>\n              <span className=\"truncate type-meta text-ink2 tabular-nums\"><SwapText value={plural(saying.count, 'change', 'changes')} /></span>\n            </span>\n            <span className=\"flex flex-none items-center gap-6\">\n              <Button icon={<Icon name=\"undo\" />} onClick={discard} aria-disabled={busy || saying.phase === 'saved' || undefined}>Discard</Button>\n              <Button\n                cap=\"primary\"\n                onClick={() => void save()}\n                state={phase === 'saving' ? 'waiting' : phase === 'saved' ? 'done' : 'idle'}\n                waitingLabel=\"Saving…\" doneLabel=\"Saved\"\n                aria-keyshortcuts=\"Meta+S Control+S\"\n                icon={<MorphIcon name={saying.phase === 'saved' ? 'check' : saying.phase === 'saving' ? 'clock' : 'document'} />}\n              >\n                Save\n              </Button>\n            </span>\n          </div>\n        )}\n      </div>\n\n      <p role=\"status\" className=\"sr-only\">{status}</p>\n    </section>\n  );\n}\n"
    }
  ],
  "docs": "Docs: https://metalui.dev/blocks/settings. Import it from components/metalui/screens/settings/settings. Needs @unlocalhosted/metalui@^0.4.0."
}
