// Generated from tokens/ui-foundation.v1.json. DO NOT EDIT.
// Contract reits.ui-foundation/v1@1.0.1; source-sha256 f5d5b7e37ea61f9fd6b35b0e287e29db5d7771c4a9f8cf54bd1aa62835788b82
export const uiFoundation = {
  "$schema": "https://design-tokens.github.io/community-group/format/",
  "schemaVersion": "reits.ui-foundation/v1",
  "version": "1.0.1",
  "owner": {
    "team": "Design Systems",
    "repository": "reits/im-ui",
    "path": "tokens/ui-foundation.v1.json"
  },
  "spacing": {
    "hairline": 1,
    "xxs": 2,
    "xs": 4,
    "sm": 8,
    "md": 12,
    "lg": 16,
    "xl": 20,
    "xxl": 24,
    "xxxl": 32,
    "section": 48,
    "page": 60
  },
  "radius": {
    "xs": 4,
    "sm": 8,
    "md": 12,
    "lg": 16,
    "panel": 20,
    "full": 9999
  },
  "size": {
    "minimumTouchTarget": 44,
    "actionButton": 48,
    "field": 44,
    "compactRow": 52,
    "regularRow": 72
  },
  "typography": {
    "display": {
      "size": 40,
      "lineHeight": 48,
      "weight": 700,
      "dynamicRole": "largeTitle"
    },
    "heading1": {
      "size": 28,
      "lineHeight": 36,
      "weight": 700,
      "dynamicRole": "title"
    },
    "heading2": {
      "size": 22,
      "lineHeight": 30,
      "weight": 700,
      "dynamicRole": "title2"
    },
    "heading3": {
      "size": 18,
      "lineHeight": 26,
      "weight": 650,
      "dynamicRole": "headline"
    },
    "body": {
      "size": 16,
      "lineHeight": 24,
      "weight": 400,
      "dynamicRole": "body"
    },
    "bodySmall": {
      "size": 14,
      "lineHeight": 21,
      "weight": 400,
      "dynamicRole": "subheadline"
    },
    "caption": {
      "size": 12,
      "lineHeight": 18,
      "weight": 600,
      "dynamicRole": "caption"
    },
    "mono": {
      "size": 12,
      "lineHeight": 18,
      "weight": 600,
      "dynamicRole": "caption"
    }
  },
  "motion": {
    "instant": 0,
    "fast": 120,
    "standard": 180,
    "deliberate": 260,
    "reducedMotionDuration": 1,
    "easing": "cubic-bezier(0.2, 0, 0, 1)"
  },
  "themes": {
    "developer": {
      "color": {
        "canvas": "#F7F8FA",
        "surface": "#FFFFFF",
        "surfaceSubtle": "#F1F4F8",
        "textPrimary": "#171A1F",
        "textSecondary": "#475467",
        "textMuted": "#667085",
        "border": "#D0D5DD",
        "actionPrimary": "#0B63E5",
        "actionOnPrimary": "#FFFFFF",
        "focus": "#176BFF",
        "success": "#0E766E",
        "warning": "#9A4D05",
        "critical": "#B42318",
        "disabled": "#98A2B3"
      }
    },
    "open-platform": {
      "color": {
        "canvas": "#0B1020",
        "surface": "#141D33",
        "surfaceSubtle": "#11182B",
        "textPrimary": "#E8EDF7",
        "textSecondary": "#B8C4D6",
        "textMuted": "#9AA8C7",
        "border": "#31405F",
        "actionPrimary": "#176BFF",
        "actionOnPrimary": "#FFFFFF",
        "focus": "#8EC5FF",
        "success": "#4EE8BD",
        "warning": "#FFD27D",
        "critical": "#FF7068",
        "disabled": "#667085"
      }
    },
    "booking": {
      "color": {
        "canvas": "#F5F5F5",
        "surface": "#FFFFFF",
        "surfaceSubtle": "#FFF8E7",
        "textPrimary": "#222222",
        "textSecondary": "#4B5563",
        "textMuted": "#6B7280",
        "border": "#D8DEE8",
        "actionPrimary": "#8A4F00",
        "actionOnPrimary": "#FFFFFF",
        "focus": "#8A4F00",
        "success": "#08786C",
        "warning": "#9A4D05",
        "critical": "#B42318",
        "disabled": "#9CA3AF"
      }
    },
    "operations": {
      "color": {
        "canvas": "#F5F7FB",
        "surface": "#FFFFFF",
        "surfaceSubtle": "#EFF3F8",
        "textPrimary": "#111827",
        "textSecondary": "#4B5563",
        "textMuted": "#6B7280",
        "border": "#D6DCE6",
        "actionPrimary": "#2563EB",
        "actionOnPrimary": "#FFFFFF",
        "focus": "#1D4ED8",
        "success": "#08786C",
        "warning": "#9A4D05",
        "critical": "#B42318",
        "disabled": "#9CA3AF"
      }
    },
    "matrix-x": {
      "color": {
        "canvas": "#F5F8FC",
        "surface": "#FFFFFF",
        "surfaceSubtle": "#F0F4FA",
        "textPrimary": "#1A1A2E",
        "textSecondary": "#5A6177",
        "textMuted": "#6D7488",
        "border": "#D8DEE8",
        "actionPrimary": "#176BFF",
        "actionOnPrimary": "#FFFFFF",
        "focus": "#176BFF",
        "success": "#278A20",
        "warning": "#9A5A00",
        "critical": "#C5000A",
        "disabled": "#8E95A9"
      }
    },
    "quant-paper": {
      "color": {
        "canvas": "#FBF8F1",
        "surface": "#FFFFFF",
        "surfaceSubtle": "#F5F0E5",
        "textPrimary": "#171F21",
        "textSecondary": "#344649",
        "textMuted": "#627174",
        "border": "#D9D1C2",
        "actionPrimary": "#08786C",
        "actionOnPrimary": "#FFFFFF",
        "focus": "#075F58",
        "success": "#08786C",
        "warning": "#875000",
        "critical": "#A81F0F",
        "disabled": "#8A9495"
      }
    }
  },
  "states": [
    {
      "id": "READY",
      "tone": "neutral",
      "live": "off",
      "writePolicy": "allowed",
      "meaning": "主任务可完成，权限与真值可见"
    },
    {
      "id": "LOADING",
      "tone": "info",
      "live": "polite",
      "writePolicy": "blocked",
      "meaning": "保留结构、焦点与返回上下文"
    },
    {
      "id": "EMPTY",
      "tone": "neutral",
      "live": "polite",
      "writePolicy": "contextual",
      "meaning": "解释合法空集合并给出下一步"
    },
    {
      "id": "PARTIAL_ERROR",
      "tone": "warning",
      "live": "polite",
      "writePolicy": "bounded",
      "meaning": "保留可用区域，只重试失败区域"
    },
    {
      "id": "ERROR",
      "tone": "critical",
      "live": "assertive",
      "writePolicy": "blocked",
      "meaning": "显示稳定错误码、request_id 与恢复动作"
    },
    {
      "id": "OFFLINE",
      "tone": "warning",
      "live": "polite",
      "writePolicy": "blocked",
      "meaning": "显示快照时间并暂停不安全写入"
    },
    {
      "id": "FORBIDDEN",
      "tone": "critical",
      "live": "assertive",
      "writePolicy": "blocked",
      "meaning": "显示服务端拒绝边界与安全返回"
    },
    {
      "id": "CONFIRM",
      "tone": "warning",
      "live": "polite",
      "writePolicy": "explicit-confirmation",
      "meaning": "明确对象、影响、不可逆性与审计"
    },
    {
      "id": "SUCCESS",
      "tone": "success",
      "live": "polite",
      "writePolicy": "receipt-only",
      "meaning": "展示 receipt、下一步与可用撤销"
    }
  ],
  "shells": [
    {
      "id": "S01",
      "name": "Public Editorial",
      "density": "comfortable",
      "regions": [
        "global-nav",
        "story",
        "proof",
        "related"
      ]
    },
    {
      "id": "S02",
      "name": "Community",
      "density": "balanced",
      "regions": [
        "primary-nav",
        "feed",
        "context",
        "composer"
      ]
    },
    {
      "id": "S03",
      "name": "Transaction",
      "density": "touch",
      "regions": [
        "context",
        "steps",
        "summary",
        "fixed-cta"
      ]
    },
    {
      "id": "S04",
      "name": "Control Plane",
      "density": "compact",
      "regions": [
        "sidebar",
        "toolbar",
        "work-area",
        "drawer"
      ]
    },
    {
      "id": "S05",
      "name": "Native",
      "density": "platform",
      "regions": [
        "system-nav",
        "task",
        "sheet",
        "tab"
      ]
    },
    {
      "id": "S06",
      "name": "Embedded Runtime",
      "density": "adaptive",
      "regions": [
        "host-bar",
        "trust-state",
        "canvas",
        "recovery"
      ]
    }
  ],
  "accessibility": {
    "contrast": {
      "normalText": 4.5,
      "largeText": 3,
      "nonText": 3
    },
    "keyboard": {
      "focusVisible": true,
      "minimumOutline": 2
    },
    "dynamicType": {
      "required": true,
      "maximumTestCategory": "accessibilityExtraExtraExtraLarge"
    },
    "voiceOver": {
      "required": true,
      "stateNeverColorOnly": true
    },
    "reducedMotion": {
      "required": true,
      "preserveMeaning": true
    }
  },
  "sourceSha256": "f5d5b7e37ea61f9fd6b35b0e287e29db5d7771c4a9f8cf54bd1aa62835788b82"
} as const;

export type REITSRuntimeState = typeof uiFoundation.states[number]["id"];
export type REITSTheme = keyof typeof uiFoundation.themes;
export type REITSShell = typeof uiFoundation.shells[number]["id"];

export function stateContract(state: REITSRuntimeState) {
  return uiFoundation.states.find((candidate) => candidate.id === state)!;
}
