@reopt-ai/opt-ui 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/COMPONENT_CATALOG.md +83 -38
  2. package/README.md +28 -7
  3. package/dist/app.css +146 -0
  4. package/dist/core/index.cjs +164 -324
  5. package/dist/core/index.d.cts +3 -6
  6. package/dist/core/index.d.ts +3 -6
  7. package/dist/core/index.js +3 -323
  8. package/dist/docs/01-getting-started.md +25 -5
  9. package/dist/docs/02-components/01-core.md +36 -28
  10. package/dist/docs/02-components/02-visuals.md +1 -1
  11. package/dist/docs/02-components/03-shells.md +40 -12
  12. package/dist/docs/02-components/04-surfaces.md +1 -1
  13. package/dist/docs/02-components/index.md +1 -1
  14. package/dist/docs/03-recipes/03-layouts.md +16 -12
  15. package/dist/docs/05-migration/01-breaking-changes.md +28 -0
  16. package/dist/id-registry.cjs +1899 -1872
  17. package/dist/id-registry.d.cts +13 -10
  18. package/dist/id-registry.d.cts.map +1 -0
  19. package/dist/id-registry.d.ts +13 -10
  20. package/dist/id-registry.d.ts.map +1 -0
  21. package/dist/id-registry.js +1897 -1871
  22. package/dist/id-registry.js.map +1 -0
  23. package/dist/id-registry.json +28 -28
  24. package/dist/index.cjs +8294 -9790
  25. package/dist/index.d.cts +1486 -1442
  26. package/dist/index.d.cts.map +1 -0
  27. package/dist/index.d.ts +1486 -1442
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +7933 -9777
  30. package/dist/index.js.map +1 -0
  31. package/dist/meta.cjs +7461 -6875
  32. package/dist/meta.d.cts.map +1 -0
  33. package/dist/meta.d.ts.map +1 -0
  34. package/dist/meta.js +7460 -6846
  35. package/dist/meta.js.map +1 -0
  36. package/dist/pagination-By7Ozv3U.js +3788 -0
  37. package/dist/pagination-By7Ozv3U.js.map +1 -0
  38. package/dist/pagination-Uv3CnGJz.cjs +4677 -0
  39. package/dist/shader-surface-BK1GMt5_.d.cts +1788 -0
  40. package/dist/shader-surface-BK1GMt5_.d.cts.map +1 -0
  41. package/dist/shader-surface-BWhO2xkk.js +3715 -0
  42. package/dist/shader-surface-BWhO2xkk.js.map +1 -0
  43. package/dist/shader-surface-DIVWtpFl.d.ts +1788 -0
  44. package/dist/shader-surface-DIVWtpFl.d.ts.map +1 -0
  45. package/dist/shader-surface-DxLLfrE6.cjs +4108 -0
  46. package/dist/shells/index.cjs +51 -65
  47. package/dist/shells/index.d.cts +4 -5
  48. package/dist/shells/index.d.ts +4 -5
  49. package/dist/shells/index.js +3 -64
  50. package/dist/tailwind.css +49 -0
  51. package/dist/theme/server.cjs +257 -228
  52. package/dist/theme/server.d.cts +48 -60
  53. package/dist/theme/server.d.cts.map +1 -0
  54. package/dist/theme/server.d.ts +48 -60
  55. package/dist/theme/server.d.ts.map +1 -0
  56. package/dist/theme/server.js +234 -189
  57. package/dist/theme/server.js.map +1 -0
  58. package/dist/types-D0FlcYnM.d.cts +301 -0
  59. package/dist/types-D0FlcYnM.d.cts.map +1 -0
  60. package/dist/types-D0FlcYnM.d.ts +301 -0
  61. package/dist/types-D0FlcYnM.d.ts.map +1 -0
  62. package/dist/visuals/index.cjs +10 -4
  63. package/dist/visuals/index.d.cts +2 -1
  64. package/dist/visuals/index.d.ts +2 -1
  65. package/dist/visuals/index.js +1 -2
  66. package/dist/workflow-canvas-3Jeevkgy.cjs +2599 -0
  67. package/dist/workflow-canvas-BGBAcjf-.js +2403 -0
  68. package/dist/workflow-canvas-BGBAcjf-.js.map +1 -0
  69. package/dist/workflow-canvas-Bar_O2SQ.d.ts +494 -0
  70. package/dist/workflow-canvas-Bar_O2SQ.d.ts.map +1 -0
  71. package/dist/workflow-canvas-DghDRtHn.d.cts +494 -0
  72. package/dist/workflow-canvas-DghDRtHn.d.cts.map +1 -0
  73. package/package.json +11 -6
  74. package/dist/chunk-3GWWZKX7.js +0 -38
  75. package/dist/chunk-3QFYBBL6.cjs +0 -4759
  76. package/dist/chunk-3XD4HIFL.js +0 -3241
  77. package/dist/chunk-AFF2HPE5.cjs +0 -5008
  78. package/dist/chunk-NXZJIHEZ.cjs +0 -3241
  79. package/dist/chunk-ONE3C5RV.cjs +0 -38
  80. package/dist/chunk-RBM2RNC2.js +0 -5008
  81. package/dist/chunk-VBGPEW45.js +0 -4759
  82. package/dist/index-BZ_lBlO1.d.ts +0 -474
  83. package/dist/index-BuvxoWHf.d.cts +0 -474
  84. package/dist/index-DWyqDIkH.d.cts +0 -1689
  85. package/dist/index-Uyijm14M.d.ts +0 -1689
  86. package/dist/types-D4-0lwaE.d.cts +0 -298
  87. package/dist/types-D4-0lwaE.d.ts +0 -298
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","names":[],"sources":["../../src/lib/theme/presets/index.ts","../../src/lib/theme/theme-serialize.ts","../../src/lib/theme/theme-resolution.ts"],"sourcesContent":["/**\n * presets/index.ts\n *\n * Single registry of theme preset metadata. Each entry pairs a stable id\n * (used in `<html data-theme>` and localStorage) with display metadata and an\n * optional `PaletteConfig` that approximates the preset's seed for the\n * ThemeSwitcher swatch row and \"clone to custom\" workflow.\n *\n * Token values themselves currently live in the sibling `*.css` files. A\n * follow-up sub-phase will migrate the full token tables into this file and\n * have a codegen step emit the CSS, but the metadata layer is enough to\n * unblock dynamic ThemeSwitcher rendering and type-safe preset id unions.\n */\n\nimport type { PaletteConfig } from \"@reopt-ai/opt-palette\";\n\nexport interface ThemeDescriptor {\n /** Stable id used in `<html data-theme=\"...\">` and localStorage. */\n readonly id: string;\n /** Human-readable label shown in ThemeSwitcher. */\n readonly label: string;\n /** Short description shown under the label. */\n readonly description: string;\n /**\n * Optional engine input that approximates this preset. Used by\n * ThemeSwitcher to derive swatches when `switcherSwatches` is omitted, and\n * as the starting point when a user clones a preset into a custom palette.\n * Codegen does NOT consume this in the current phase — the static `*.css`\n * file remains the source of token values.\n */\n readonly palette?: PaletteConfig;\n /**\n * Three CSS color strings for the ThemeSwitcher swatch row. Falls back to\n * the live `--opt-accent` / `--opt-surface` / `--opt-text` tokens when\n * omitted.\n */\n readonly switcherSwatches?: readonly [string, string, string];\n /** Disable dark variant generation entirely. */\n readonly forceLightOnly?: boolean;\n}\n\nconst DEFAULT_DESCRIPTOR: ThemeDescriptor = {\n id: \"default\",\n label: \"Default\",\n description: \"Blue accent, balanced radius & shadow\",\n palette: {\n seed: \"#2563eb\",\n harmony: \"split-complementary\",\n radiusScale: \"medium\",\n shadowIntensity: \"subtle\",\n neutralTemperature: \"cool\",\n },\n switcherSwatches: [\"hsl(221 83% 53%)\", \"hsl(142 71% 45%)\", \"hsl(38 92% 50%)\"],\n};\n\nconst MINIMAL_DESCRIPTOR: ThemeDescriptor = {\n id: \"minimal\",\n label: \"Minimal\",\n description: \"Monochrome, no shadow, sharp edges\",\n palette: {\n seed: \"#333333\",\n harmony: \"analogous\",\n radiusScale: \"sharp\",\n shadowIntensity: \"none\",\n neutralTemperature: \"cool\",\n },\n switcherSwatches: [\"hsl(0 0% 20%)\", \"hsl(0 0% 45%)\", \"hsl(0 0% 70%)\"],\n};\n\nconst NATURAL_DESCRIPTOR: ThemeDescriptor = {\n id: \"natural\",\n label: \"Natural\",\n description: \"Always light — sage accent, warm cream\",\n forceLightOnly: true,\n palette: {\n seed: \"#5a9376\",\n harmony: \"complementary\",\n radiusScale: \"medium\",\n shadowIntensity: \"subtle\",\n neutralTemperature: \"warm\",\n },\n switcherSwatches: [\"hsl(155 38% 45%)\", \"hsl(25 65% 55%)\", \"hsl(45 75% 50%)\"],\n};\n\nconst PRO_DESCRIPTOR: ThemeDescriptor = {\n id: \"pro\",\n label: \"Pro\",\n description: \"Neon blue accent, mono headings, ultra-dense\",\n palette: {\n seed: \"#0080ff\",\n harmony: \"tetradic\",\n radiusScale: \"sharp\",\n shadowIntensity: \"subtle\",\n neutralTemperature: \"cool\",\n },\n switcherSwatches: [\n \"hsl(210 100% 55%)\",\n \"hsl(170 90% 48%)\",\n \"hsl(290 85% 60%)\",\n ],\n};\n\nconst MONO_DARK_DESCRIPTOR: ThemeDescriptor = {\n id: \"mono-dark\",\n label: \"Mono Dark\",\n description: \"OLED-friendly black, neon cyan accent, mono headings\",\n palette: {\n seed: \"#00d4ff\",\n harmony: \"tetradic\",\n radiusScale: \"sharp\",\n shadowIntensity: \"subtle\",\n neutralTemperature: \"cool\",\n },\n switcherSwatches: [\"hsl(190 100% 50%)\", \"hsl(0 0% 8%)\", \"hsl(280 90% 65%)\"],\n};\n\nexport const THEME_REGISTRY = {\n default: DEFAULT_DESCRIPTOR,\n minimal: MINIMAL_DESCRIPTOR,\n natural: NATURAL_DESCRIPTOR,\n pro: PRO_DESCRIPTOR,\n \"mono-dark\": MONO_DARK_DESCRIPTOR,\n} as const satisfies Record<string, ThemeDescriptor>;\n\n/** Compile-time-derived union of registered preset ids. */\nexport type ThemePresetId = keyof typeof THEME_REGISTRY;\n\n/** All registered preset ids in declaration order. */\nexport const THEME_PRESET_IDS = Object.keys(THEME_REGISTRY) as ThemePresetId[];\n\n/** Look up a descriptor by id. Returns `undefined` for unknown ids. */\nexport function getThemeDescriptor(id: string): ThemeDescriptor | undefined {\n return (THEME_REGISTRY as Record<string, ThemeDescriptor>)[id];\n}\n\n/** Type guard for a known preset id. */\nexport function isThemePresetId(id: string): id is ThemePresetId {\n return id in THEME_REGISTRY;\n}\n\n/** Preset ids that suppress dark mode generation. */\nexport const FORCE_LIGHT_PRESET_IDS: ReadonlySet<ThemePresetId> = new Set(\n THEME_PRESET_IDS.filter((id) => THEME_REGISTRY[id].forceLightOnly),\n);\n\n/**\n * Map from removed preset ids to the closest surviving preset. Boot script and\n * `readStoredTheme` consult this so users with persisted `corporate`/`playful`\n * values silently land on a working preset on next page load instead of\n * showing the global default fallback for an unknown id.\n *\n * Keep this around indefinitely — localStorage values are forever and the\n * cost of two extra entries is negligible.\n */\nexport const DEPRECATED_PRESET_MIGRATIONS: Readonly<\n Record<string, ThemePresetId>\n> = Object.freeze({\n corporate: \"default\",\n playful: \"default\",\n});\n\n/**\n * Resolve a possibly-deprecated preset id to a registered one. Returns the\n * input unchanged when it is already valid; returns the migration target when\n * it is a known deprecated id; returns `null` when the id is unknown\n * altogether (caller should fall back to its default).\n */\nexport function migrateDeprecatedPresetId(\n id: string | null | undefined,\n): ThemePresetId | null {\n if (!id) return null;\n if (isThemePresetId(id)) return id;\n if (id in DEPRECATED_PRESET_MIGRATIONS) {\n return DEPRECATED_PRESET_MIGRATIONS[id]!;\n }\n return null;\n}\n","/**\n * theme-serialize.ts\n *\n * Pure helpers that turn a `ThemeSpec` into the artifacts the runtime needs:\n * resolved descriptor + mode, computed token maps for generated palettes, and\n * `<style>` CSS strings ready to be injected into `<head>`.\n *\n * Kept side-effect free so the boot script and the provider can share the\n * same logic without dragging React into the client bundle's critical path.\n */\n\nimport {\n generatePalette,\n type PaletteConfig,\n type GeneratedPalette,\n} from \"@reopt-ai/opt-palette\";\nimport {\n THEME_REGISTRY,\n isThemePresetId,\n type ThemeDescriptor,\n type ThemePresetId,\n} from \"./presets\";\nimport {\n isDescriptorSpec,\n isGeneratedSpec,\n isPresetSpec,\n type GeneratedThemeSpec,\n type ThemeOverrides,\n type ThemeSpec,\n} from \"./theme-types\";\n\n/** Element id used for the global generated theme style tag. */\nexport const GLOBAL_THEME_STYLE_ID = \"opt-global-theme\";\n\n/** localStorage key for the persisted ThemeSpec (generated mode). */\nexport const THEME_SPEC_STORAGE_KEY = \"opt-theme-spec\";\n\n/**\n * localStorage key for the cached, pre-serialized token maps that match the\n * spec under `THEME_SPEC_STORAGE_KEY`. The boot script reads this directly so\n * it can inline tokens without invoking opt-palette at startup.\n */\nexport const THEME_TOKENS_STORAGE_KEY = \"opt-theme-tokens\";\n\n/** Stable id used for unnamed generated themes. */\nexport const GENERATED_THEME_ID_DEFAULT = \"generated\";\n\n/** Cached token maps keyed by spec hash. Lazy-built per process. */\nconst generatedCache = new Map<string, GeneratedPalette>();\n\n/** Build a stable cache key for a `PaletteConfig`. */\nfunction paletteCacheKey(config: PaletteConfig): string {\n return JSON.stringify(config);\n}\n\n/** Run opt-palette with caching. */\nexport function generatePaletteCached(config: PaletteConfig): GeneratedPalette {\n const key = paletteCacheKey(config);\n let cached = generatedCache.get(key);\n if (!cached) {\n cached = generatePalette(config);\n generatedCache.set(key, cached);\n }\n return cached;\n}\n\n/** Apply sparse override maps onto a base token record. */\nfunction applyOverrides(\n base: Record<string, string>,\n overrides: ThemeOverrides | undefined,\n mode: \"light\" | \"dark\",\n): Record<string, string> {\n if (!overrides) return base;\n const merged: Record<string, string> = { ...base };\n if (overrides.shared) Object.assign(merged, overrides.shared);\n const modeOverrides = mode === \"light\" ? overrides.light : overrides.dark;\n if (modeOverrides) Object.assign(merged, modeOverrides);\n return merged;\n}\n\n/**\n * Stable id used in `<html data-theme>` and the `<style>` selector.\n * - preset → the preset id (force-light) or `${id}` / `${id}-dark`\n * - generated → `spec.id ?? \"generated\"` with `-dark` suffix when applicable\n * - descriptor → `descriptor.id` with same suffix logic\n */\nexport function getCompoundIdForSpec(\n spec: ThemeSpec,\n resolvedMode: \"light\" | \"dark\",\n forceLightOnly: boolean,\n): string {\n const baseId = baseIdFor(spec);\n if (forceLightOnly) return baseId;\n return resolvedMode === \"dark\" ? `${baseId}-dark` : baseId;\n}\n\nfunction baseIdFor(spec: ThemeSpec): string {\n if (isPresetSpec(spec)) return spec.preset;\n if (isDescriptorSpec(spec)) return spec.descriptor.id;\n return spec.id ?? GENERATED_THEME_ID_DEFAULT;\n}\n\n/** Whether the given spec emits dark variants at all. */\nexport function isForceLightSpec(spec: ThemeSpec): boolean {\n if (isPresetSpec(spec)) {\n const desc = THEME_REGISTRY[spec.preset];\n return desc?.forceLightOnly === true;\n }\n if (isDescriptorSpec(spec)) return spec.descriptor.forceLightOnly === true;\n return spec.forceLightOnly === true;\n}\n\n/** Computed token bundle for a generated theme. `dark` is `null` when force-light. */\nexport interface GeneratedTokens {\n id: string;\n light: Record<string, string>;\n dark: Record<string, string> | null;\n}\n\n/**\n * Compute the inline tokens for a `GeneratedThemeSpec` or\n * `DescriptorThemeSpec` whose descriptor carries a `palette`. Returns `null`\n * for preset specs (their tokens live in the static CSS files).\n */\nexport function computeGeneratedTokens(\n spec: ThemeSpec,\n): GeneratedTokens | null {\n if (isPresetSpec(spec)) return null;\n\n let palette: PaletteConfig | undefined;\n let overrides: ThemeOverrides | undefined;\n let id: string;\n let forceLight: boolean;\n\n if (isGeneratedSpec(spec)) {\n palette = spec.palette;\n overrides = spec.overrides;\n id = spec.id ?? GENERATED_THEME_ID_DEFAULT;\n forceLight = spec.forceLightOnly === true;\n } else {\n // descriptor spec\n palette = spec.descriptor.palette;\n overrides = spec.overrides;\n id = spec.descriptor.id;\n forceLight = spec.descriptor.forceLightOnly === true;\n }\n\n if (!palette) return null;\n\n const generated = generatePaletteCached(palette);\n return {\n id,\n light: applyOverrides(generated.light, overrides, \"light\"),\n dark: forceLight ? null : applyOverrides(generated.dark, overrides, \"dark\"),\n };\n}\n\n/**\n * Serialize a token record into a CSS rule body — `--name:value;...` — without\n * surrounding selector or braces. Values are not escaped; callers are\n * responsible for trusted input. Boot script and provider both rely on this\n * shape.\n */\nexport function serializeTokenBody(tokens: Record<string, string>): string {\n return Object.entries(tokens)\n .map(([k, v]) => `${k}:${v}`)\n .join(\";\");\n}\n\n/**\n * Build a CSS rule scoped to `[data-theme=\"<id>\"]`.\n */\nexport function serializeThemeRule(\n themeId: string,\n tokens: Record<string, string>,\n): string {\n return `[data-theme=\"${themeId}\"]{${serializeTokenBody(tokens)}}`;\n}\n\n/**\n * Build the full CSS for a generated theme style tag — covers light + dark\n * selectors based on the computed tokens. Caller chooses the id used in\n * the selector (typically the spec base id).\n */\nexport function serializeGeneratedTheme(tokens: GeneratedTokens): string {\n const { id, light, dark } = tokens;\n let css = serializeThemeRule(id, light);\n if (dark) {\n css += serializeThemeRule(`${id}-dark`, dark);\n }\n return css;\n}\n\n/**\n * Resolve a spec into its descriptor counterpart. Preset specs map to\n * `THEME_REGISTRY[preset]`. Generated specs are wrapped into a synthetic\n * descriptor so callers can treat them uniformly.\n */\nexport function resolveDescriptor(spec: ThemeSpec): ThemeDescriptor {\n if (isPresetSpec(spec)) {\n const desc = THEME_REGISTRY[spec.preset];\n if (!desc) {\n throw new Error(\n `[opt-ui] Unknown theme preset id: \"${spec.preset}\". ` +\n `Registered ids: ${Object.keys(THEME_REGISTRY).join(\", \")}`,\n );\n }\n return desc;\n }\n if (isDescriptorSpec(spec)) return spec.descriptor;\n return generatedSpecToDescriptor(spec);\n}\n\nfunction generatedSpecToDescriptor(spec: GeneratedThemeSpec): ThemeDescriptor {\n return {\n id: spec.id ?? GENERATED_THEME_ID_DEFAULT,\n label: spec.label ?? \"Custom\",\n description: \"Generated theme\",\n palette: spec.palette,\n forceLightOnly: spec.forceLightOnly,\n };\n}\n\n/**\n * Validate a `ThemeSpec` parsed from localStorage. Returns the spec on\n * success or `null` if any required field is missing or the preset id is\n * unknown. Defensive parsing — never throws.\n */\nexport function safeParseStoredSpec(json: string | null): ThemeSpec | null {\n if (!json) return null;\n try {\n const parsed = JSON.parse(json) as Partial<ThemeSpec> & {\n kind?: unknown;\n };\n if (!parsed || typeof parsed !== \"object\" || !(\"kind\" in parsed)) {\n return null;\n }\n if (parsed.kind === \"preset\") {\n const preset = (parsed as { preset?: unknown }).preset;\n if (typeof preset !== \"string\" || !isThemePresetId(preset)) return null;\n return { kind: \"preset\", preset } as ThemeSpec;\n }\n if (parsed.kind === \"generated\") {\n const palette = (parsed as { palette?: unknown }).palette;\n if (!isPaletteConfig(palette)) return null;\n const out: GeneratedThemeSpec = {\n kind: \"generated\",\n palette,\n id: typeof parsed.id === \"string\" ? parsed.id : undefined,\n label: typeof parsed.label === \"string\" ? parsed.label : undefined,\n forceLightOnly: parsed.forceLightOnly === true,\n overrides: isObjectMap(parsed.overrides)\n ? (parsed.overrides as ThemeOverrides)\n : undefined,\n };\n return out;\n }\n return null;\n } catch {\n return null;\n }\n}\n\nfunction isObjectMap(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\nfunction isPaletteConfig(value: unknown): value is PaletteConfig {\n if (!isObjectMap(value)) return false;\n const v = value as Partial<PaletteConfig>;\n return (\n typeof v.seed === \"string\" &&\n typeof v.harmony === \"string\" &&\n typeof v.radiusScale === \"string\" &&\n typeof v.shadowIntensity === \"string\" &&\n typeof v.neutralTemperature === \"string\"\n );\n}\n\n/** Cached token payload as written to `opt-theme-tokens`. */\nexport interface StoredTokenCache {\n id: string;\n light: Record<string, string>;\n dark?: Record<string, string>;\n}\n\n/**\n * Parse the cached token payload from localStorage. Returns `null` on any\n * shape mismatch — caller will recompute from the spec.\n */\nexport function safeParseStoredTokens(\n json: string | null,\n): StoredTokenCache | null {\n if (!json) return null;\n try {\n const parsed = JSON.parse(json) as Partial<StoredTokenCache>;\n if (\n !parsed ||\n typeof parsed.id !== \"string\" ||\n !isObjectMap(parsed.light)\n ) {\n return null;\n }\n return {\n id: parsed.id,\n light: parsed.light as Record<string, string>,\n dark: isObjectMap(parsed.dark)\n ? (parsed.dark as Record<string, string>)\n : undefined,\n };\n } catch {\n return null;\n }\n}\n\n/** Build the storage payload that pairs with `opt-theme-spec`. */\nexport function buildTokenCache(tokens: GeneratedTokens): StoredTokenCache {\n return {\n id: tokens.id,\n light: tokens.light,\n dark: tokens.dark ?? undefined,\n };\n}\n\n/** Strip caches — used by tests and when switching back to a preset spec. */\nexport function clearGeneratedCache(): void {\n generatedCache.clear();\n}\n\n/** Re-export descriptor lookups for consumers of the serializer. */\nexport { THEME_REGISTRY, isThemePresetId };\nexport type { ThemePresetId };\n","import {\n DEPRECATED_PRESET_MIGRATIONS,\n FORCE_LIGHT_PRESET_IDS,\n THEME_PRESET_IDS,\n migrateDeprecatedPresetId,\n type ThemePresetId,\n} from \"./presets\";\nimport {\n GLOBAL_THEME_STYLE_ID,\n THEME_SPEC_STORAGE_KEY,\n THEME_TOKENS_STORAGE_KEY,\n} from \"./theme-serialize\";\n\n/**\n * Registered preset id list. Preferred for runtime iteration.\n * @deprecated Prefer `THEME_PRESET_IDS` from `./presets`.\n */\nexport const THEME_PRESET_VALUES: readonly ThemePresetId[] = THEME_PRESET_IDS;\n\n/** Theme preset id — alias of `ThemePresetId` from the registry. */\nexport type ThemePreset = ThemePresetId;\n\nexport const THEME_MODE_VALUES = [\"light\", \"dark\", \"system\"] as const;\n/** Type definition for theme mode. */\nexport type ThemeMode = (typeof THEME_MODE_VALUES)[number];\n\n/** Runtime constraints for apps that expose only a subset of opt-ui theming. */\nexport interface ThemeRuntimeOptions {\n /**\n * Force the root theme to one preset regardless of stored preset/generated\n * theme state. Mode is still resolved normally unless constrained.\n */\n lockedPreset?: ThemePreset;\n /**\n * Restrict mode reads/writes to a smaller set, e.g. `[\"light\", \"dark\"]`.\n * The first value becomes the fallback when the stored/default mode is not\n * allowed.\n */\n allowedModes?: readonly ThemeMode[];\n}\n\n/**\n * Compound theme value applied to `<html data-theme>`. Derived from the\n * registered preset ids: `<id>` (light) or `<id>-dark` (dark). Force-light\n * presets only emit the bare id form.\n */\nexport type CompoundTheme = `${ThemePreset}` | `${ThemePreset}-dark`;\n\nexport const LEGACY_THEME_STORAGE_KEY = \"opt-theme\";\nexport const THEME_PRESET_STORAGE_KEY = \"opt-preset\";\nexport const THEME_MODE_STORAGE_KEY = \"opt-mode\";\nexport const DARK_MQ = \"(prefers-color-scheme: dark)\";\n\n/**\n * Presets that force light mode regardless of system dark/light preference.\n * Mirrors `FORCE_LIGHT_PRESET_IDS` from `./presets` — kept as alias for\n * existing imports.\n */\nexport const FORCE_LIGHT_PRESETS: ReadonlySet<ThemePreset> =\n FORCE_LIGHT_PRESET_IDS;\n\n/** All valid compound theme names. Useful for static enumeration. */\nexport const ALL_COMPOUND_THEMES: CompoundTheme[] = THEME_PRESET_IDS.flatMap(\n (id) =>\n FORCE_LIGHT_PRESET_IDS.has(id)\n ? [id satisfies CompoundTheme]\n : [id satisfies CompoundTheme, `${id}-dark` satisfies CompoundTheme],\n);\n\ninterface ThemeStorageReader {\n getItem(key: string): string | null;\n}\n\ninterface ThemeStorageMutator extends ThemeStorageReader {\n setItem(key: string, value: string): void;\n removeItem(key: string): void;\n}\n\nfunction hasStorageMutation(\n storage: ThemeStorageReader,\n): storage is ThemeStorageMutator {\n return (\n typeof (storage as ThemeStorageMutator).setItem === \"function\" &&\n typeof (storage as ThemeStorageMutator).removeItem === \"function\"\n );\n}\n\n/** Handles is theme preset. */\nexport function isThemePreset(value: string | null): value is ThemePreset {\n return (\n typeof value === \"string\" &&\n THEME_PRESET_VALUES.includes(value as ThemePreset)\n );\n}\n\n/** Handles is theme mode. */\nexport function isThemeMode(value: string | null): value is ThemeMode {\n return (\n typeof value === \"string\" && THEME_MODE_VALUES.includes(value as ThemeMode)\n );\n}\n\n/** Compute compound theme name from preset + resolved mode. */\nexport function getCompoundTheme(\n preset: ThemePreset,\n resolvedMode: \"light\" | \"dark\",\n): CompoundTheme {\n if (FORCE_LIGHT_PRESETS.has(preset)) return preset as CompoundTheme;\n return (resolvedMode === \"dark\" ? `${preset}-dark` : preset) as CompoundTheme;\n}\n\n/** Handles resolve theme mode. */\nexport function resolveThemeMode(\n preset: ThemePreset,\n mode: ThemeMode,\n systemDark: boolean,\n): \"light\" | \"dark\" {\n if (FORCE_LIGHT_PRESETS.has(preset)) return \"light\";\n if (mode === \"system\") return systemDark ? \"dark\" : \"light\";\n return mode;\n}\n\n/** Handles read stored theme. */\nexport function readStoredTheme(\n storage: ThemeStorageReader,\n defaultPreset: ThemePreset,\n defaultMode: ThemeMode,\n options: { migrateLegacy?: boolean } = {},\n): { preset: ThemePreset; mode: ThemeMode } {\n const legacy = storage.getItem(LEGACY_THEME_STORAGE_KEY);\n const storedPreset = storage.getItem(THEME_PRESET_STORAGE_KEY);\n const storedMode = storage.getItem(THEME_MODE_STORAGE_KEY);\n\n let preset = defaultPreset;\n // Legacy `opt-theme` key — migrate to `opt-preset` when valid (or deprecated).\n if (typeof legacy === \"string\") {\n const migratedLegacy = migrateDeprecatedPresetId(legacy);\n if (migratedLegacy) {\n if (options.migrateLegacy && hasStorageMutation(storage)) {\n storage.setItem(THEME_PRESET_STORAGE_KEY, migratedLegacy);\n storage.removeItem(LEGACY_THEME_STORAGE_KEY);\n }\n preset = migratedLegacy;\n }\n } else if (typeof storedPreset === \"string\") {\n const migrated = migrateDeprecatedPresetId(storedPreset);\n if (migrated) {\n preset = migrated;\n // If the stored value was a deprecated id, silently rewrite it to the\n // migration target so the next read is a hit on the registered id.\n if (\n hasStorageMutation(storage) &&\n migrated !== storedPreset &&\n storedPreset in DEPRECATED_PRESET_MIGRATIONS\n ) {\n storage.setItem(THEME_PRESET_STORAGE_KEY, migrated);\n }\n }\n }\n\n const mode = isThemeMode(storedMode) ? storedMode : defaultMode;\n return { preset, mode };\n}\n\n/** Normalize a mode against an optional allowed-mode list. */\nexport function coerceThemeMode(\n mode: ThemeMode,\n allowedModes: readonly ThemeMode[] | undefined,\n fallback: ThemeMode = \"system\",\n): ThemeMode {\n if (!allowedModes || allowedModes.length === 0) return mode;\n if (allowedModes.includes(mode)) return mode;\n if (allowedModes.includes(fallback)) return fallback;\n return allowedModes[0] ?? fallback;\n}\n\n/**\n * Build the inline `<head>` boot script that paints the correct theme before\n * React mounts. Two paths:\n *\n * 1. **Generated** — when both `opt-theme-spec` (kind: \"generated\") and\n * `opt-theme-tokens` are present and well-formed, a `<style id=\"…\">` tag\n * is inserted with the cached tokens and `<html data-theme>` is set to the\n * generated id (with optional `-dark` suffix). This bypasses opt-palette\n * at startup so first paint is instant.\n * 2. **Preset (legacy)** — falls through to the existing preset selector,\n * including legacy `opt-theme` → `opt-preset` migration.\n *\n * Returned as a single minified line; intended for `dangerouslySetInnerHTML`.\n */\nexport function createThemeBootScript(\n defaultPreset: ThemePreset = \"default\",\n defaultMode: ThemeMode = \"system\",\n options: ThemeRuntimeOptions = {},\n): string {\n const presetValues = JSON.stringify(THEME_PRESET_VALUES);\n const modeValues = JSON.stringify(THEME_MODE_VALUES);\n const allowedModes = options.allowedModes?.length\n ? options.allowedModes\n : THEME_MODE_VALUES;\n const allowedModeValues = JSON.stringify(allowedModes);\n const forceLightPresets = JSON.stringify(Array.from(FORCE_LIGHT_PRESETS));\n const deprecatedMap = JSON.stringify(DEPRECATED_PRESET_MIGRATIONS);\n const lockedPreset = options.lockedPreset;\n const resolvedDefaultPreset = lockedPreset ?? defaultPreset;\n const defaultPresetLiteral = JSON.stringify(resolvedDefaultPreset);\n const defaultModeLiteral = JSON.stringify(\n coerceThemeMode(defaultMode, allowedModes, allowedModes[0] ?? \"system\"),\n );\n const lockedPresetLiteral = JSON.stringify(lockedPreset ?? null);\n const styleId = JSON.stringify(GLOBAL_THEME_STYLE_ID);\n const specKey = JSON.stringify(THEME_SPEC_STORAGE_KEY);\n const tokensKey = JSON.stringify(THEME_TOKENS_STORAGE_KEY);\n const presetKey = JSON.stringify(THEME_PRESET_STORAGE_KEY);\n const modeKey = JSON.stringify(THEME_MODE_STORAGE_KEY);\n const legacyKey = JSON.stringify(LEGACY_THEME_STORAGE_KEY);\n const darkMq = JSON.stringify(DARK_MQ);\n\n // Multi-line for readability here; collapsed on emit.\n // `mp(v)` resolves a stored preset id: returns the value itself when\n // registered, the migration target when deprecated, or null otherwise.\n const source = `\ntry {\n var pv=${presetValues},mv=${modeValues},am=${allowedModeValues},fp=${forceLightPresets},dm=${deprecatedMap},lk=${lockedPresetLiteral};\n function mp(v){if(typeof v!==\"string\")return null;if(pv.indexOf(v)>=0)return v;return Object.prototype.hasOwnProperty.call(dm,v)?dm[v]:null;}\n var p=${defaultPresetLiteral};\n if(!lk){\n var lp=localStorage.getItem(${legacyKey}),sp=localStorage.getItem(${presetKey});\n var lpm=mp(lp),spm=mp(sp);\n p=lpm||spm||${defaultPresetLiteral};\n if(lpm){localStorage.setItem(${presetKey},lpm);localStorage.removeItem(${legacyKey});}\n else if(sp&&spm&&sp!==spm){localStorage.setItem(${presetKey},spm);}\n }\n var sm=localStorage.getItem(${modeKey});\n var m=(typeof sm===\"string\"&&mv.indexOf(sm)>=0&&am.indexOf(sm)>=0)?sm:${defaultModeLiteral};\n var spec=null,tk=null;\n if(!lk){try{var sj=localStorage.getItem(${specKey});if(sj)spec=JSON.parse(sj);}catch(e){}}\n if(!lk){try{var tj=localStorage.getItem(${tokensKey});if(tj)tk=JSON.parse(tj);}catch(e){}}\n if(!lk&&spec&&spec.kind===\"generated\"&&tk&&typeof tk.id===\"string\"&&tk.light&&typeof tk.light===\"object\"){\n var fld=spec.forceLightOnly===true;\n var dk=!fld&&(m===\"dark\"||(m===\"system\"&&matchMedia(${darkMq}).matches));\n var tt=(dk&&tk.dark)?tk.dark:tk.light;\n var cid=(dk&&tk.dark)?(tk.id+\"-dark\"):tk.id;\n var css=\"\";\n for(var k in tt){if(Object.prototype.hasOwnProperty.call(tt,k))css+=k+\":\"+tt[k]+\";\"}\n var st=document.getElementById(${styleId});\n if(!st){st=document.createElement(\"style\");st.id=${styleId};document.head.appendChild(st);}\n st.textContent='[data-theme=\"'+cid+'\"]{'+css+'}';\n document.documentElement.setAttribute(\"data-theme\",cid);\n } else {\n var d=fp.indexOf(p)<0&&(m===\"dark\"||(m===\"system\"&&matchMedia(${darkMq}).matches));\n document.documentElement.setAttribute(\"data-theme\",d?p+\"-dark\":p);\n }\n} catch(e){}`;\n\n // Collapse leading newlines + indentation. Safe because all string\n // literals in the source are double-quoted with no embedded newlines.\n return source.replace(/\\n\\s*/g, \"\");\n}\n"],"mappings":";AAoHA,MAAa,iBAAiB;CAC5B,SAAS;EA3ET,IAAI;EACJ,OAAO;EACP,aAAa;EACb,SAAS;GACP,MAAM;GACN,SAAS;GACT,aAAa;GACb,iBAAiB;GACjB,oBAAoB;EACtB;EACA,kBAAkB;GAAC;GAAoB;GAAoB;EAAiB;CAiEnE;CACT,SAAS;EA9DT,IAAI;EACJ,OAAO;EACP,aAAa;EACb,SAAS;GACP,MAAM;GACN,SAAS;GACT,aAAa;GACb,iBAAiB;GACjB,oBAAoB;EACtB;EACA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,UAAU,wBAAwB;CACzD,MAAM,UAAU,KAAK,UAAU,sBAAsB;CACrD,MAAM,YAAY,KAAK,UAAU,wBAAwB;CACzD,MAAM,SAAS,KAAK,UAAU,OAAO;CAyCrC,OAAO;;WAlCE,aAAa,MAAM,WAAW,MAAM,kBAAkB,MAAM,kBAAkB,MAAM,cAAc,MAAM,oBAAoB;;UAE7H,qBAAqB;;kCAEG,UAAU,4BAA4B,UAAU;;kBAEhE,qBAAqB;mCACJ,UAAU,gCAAgC,UAAU;sDACjC,UAAU;;gCAEhC,QAAQ;0EACkC,mBAAmB;;4CAEjD,QAAQ;4CACR,UAAU;;;0DAGI,OAAO;;;;;qCAK5B,QAAQ;uDACU,QAAQ;;;;oEAIK,OAAO;;;cAO3D,QAAQ,UAAU,EAAE;AACpC"}
@@ -0,0 +1,301 @@
1
+
2
+ //#region src/lib/types.d.ts
3
+ /** Defines the command shape (data for command palettes / menus). */
4
+ interface CommandDef {
5
+ id: string;
6
+ label: string;
7
+ group: string;
8
+ shortcut?: string;
9
+ action: () => void;
10
+ }
11
+ /** Defines the stat card shape. */
12
+ interface StatCard {
13
+ id: string;
14
+ title: string;
15
+ value: string;
16
+ change: string;
17
+ trend: "up" | "down" | "neutral";
18
+ rawValue?: number;
19
+ format?: "text" | "duration" | "percentage";
20
+ durationUnit?: "ms" | "s";
21
+ }
22
+ /** Defines the nav item shape. */
23
+ interface NavItem {
24
+ id: string;
25
+ label: string;
26
+ href: string;
27
+ }
28
+ /** Defines the faq item shape. */
29
+ interface FaqItem {
30
+ id: string;
31
+ question: string;
32
+ answer: string;
33
+ }
34
+ /** Defines the select option shape. */
35
+ interface SelectOption {
36
+ value: string;
37
+ label: string;
38
+ color?: string;
39
+ }
40
+ /** Defines the menu item shape. */
41
+ interface MenuItemDef {
42
+ id: string;
43
+ label: string;
44
+ type?: "item" | "separator" | "checkbox" | "radio";
45
+ shortcut?: string;
46
+ name?: string;
47
+ value?: string;
48
+ checked?: boolean;
49
+ onChange?: (checked: boolean) => void;
50
+ onClick?: () => void;
51
+ }
52
+ /** Defines the menu shape. */
53
+ interface MenuDef {
54
+ id: string;
55
+ label: string;
56
+ items: MenuItemDef[];
57
+ }
58
+ /** Defines the nav item shape. */
59
+ interface NavItemDef {
60
+ id: string;
61
+ label: string;
62
+ href: string;
63
+ separator?: boolean;
64
+ sectionLabel?: string;
65
+ }
66
+ /** Defines the toolbar button shape. */
67
+ interface ToolbarButtonDef {
68
+ id: string;
69
+ label: string;
70
+ icon: React.ReactNode;
71
+ separator?: boolean;
72
+ }
73
+ /** Defines the tab shape. */
74
+ interface TabDef {
75
+ id: string;
76
+ label: string;
77
+ content: React.ReactNode;
78
+ }
79
+ /** Defines the form field shape. */
80
+ interface FormFieldDef {
81
+ name: string;
82
+ label: string;
83
+ type?: "text" | "email" | "password" | "number" | "checkbox" | "radio" | "textarea" | "select" | "switch" | "tags";
84
+ placeholder?: string;
85
+ defaultValue?: unknown;
86
+ required?: boolean;
87
+ requiredMessage?: string;
88
+ validate?: (value: unknown) => string | undefined;
89
+ options?: {
90
+ value: string;
91
+ label: string;
92
+ }[];
93
+ /** textarea 전용: 표시 줄 수 */
94
+ rows?: number;
95
+ /** textarea 전용: 크기 조절 방향 */
96
+ resize?: "none" | "vertical" | "horizontal" | "both";
97
+ /** textarea 전용: 폰트 스타일 */
98
+ font?: "default" | "mono";
99
+ /** switch 전용: 설명 텍스트 */
100
+ description?: string;
101
+ /** 조건부 필드 표시 — false 또는 함수가 false를 반환하면 필드 숨김 */
102
+ visible?: boolean | ((values: Record<string, unknown>) => boolean);
103
+ }
104
+ /** Defines the deployment step shape. */
105
+ interface DeploymentStep {
106
+ id: string;
107
+ name: string;
108
+ status: "pending" | "running" | "success" | "error" | "skipped";
109
+ duration?: string;
110
+ detail?: string;
111
+ }
112
+ /** Defines the project shape. */
113
+ interface ProjectDef {
114
+ id: string;
115
+ name: string;
116
+ framework: string;
117
+ status: "active" | "paused" | "error";
118
+ domain?: string;
119
+ }
120
+ /** Defines the env var shape. */
121
+ interface EnvVarDef {
122
+ key: string;
123
+ value: string;
124
+ isSecret?: boolean;
125
+ }
126
+ /** Defines the env group shape. */
127
+ interface EnvGroupDef {
128
+ env: string;
129
+ vars: EnvVarDef[];
130
+ }
131
+ /** Defines the branch shape. */
132
+ interface BranchDef {
133
+ name: string;
134
+ isDefault?: boolean;
135
+ lastCommit?: string;
136
+ author?: string;
137
+ }
138
+ /** Defines the domain shape. */
139
+ interface DomainDef {
140
+ domain: string;
141
+ status: "active" | "pending" | "error";
142
+ ssl: "valid" | "expired" | "pending";
143
+ redirect?: string;
144
+ addedAt?: string;
145
+ }
146
+ /** Defines the table column shape. */
147
+ interface TableColumn<T> {
148
+ id: string;
149
+ header: string;
150
+ accessor: keyof T | ((row: T) => React.ReactNode);
151
+ width?: string;
152
+ align?: "left" | "center" | "right";
153
+ }
154
+ /** Defines the toast options shape. */
155
+ interface ToastOptions {
156
+ variant: "info" | "success" | "warning" | "error";
157
+ title?: string;
158
+ message: string;
159
+ duration?: number;
160
+ }
161
+ /** Defines the task shape. */
162
+ interface TaskDef {
163
+ id: string;
164
+ title: string;
165
+ description?: string;
166
+ status: "todo" | "in-progress" | "review" | "done";
167
+ priority: "low" | "medium" | "high" | "urgent";
168
+ assignee?: TeamMemberDef;
169
+ dueDate?: string;
170
+ tags?: string[];
171
+ subtasks?: {
172
+ id: string;
173
+ title: string;
174
+ completed: boolean;
175
+ }[];
176
+ }
177
+ /** Defines the team member shape. */
178
+ interface TeamMemberDef {
179
+ id: string;
180
+ name: string;
181
+ email: string;
182
+ avatar?: string;
183
+ role?: string;
184
+ status?: "online" | "away" | "busy" | "offline";
185
+ }
186
+ /** Defines the activity shape. */
187
+ interface ActivityDef {
188
+ id: string;
189
+ type: "created" | "updated" | "completed" | "commented" | "assigned" | "deployed" | "merged";
190
+ title: string;
191
+ description?: string;
192
+ actor: TeamMemberDef;
193
+ timestamp: string;
194
+ metadata?: Record<string, unknown>;
195
+ variant?: "default" | "error" | "warning";
196
+ }
197
+ /** Defines the filter option shape. */
198
+ interface FilterOption {
199
+ id: string;
200
+ label: string;
201
+ value: string;
202
+ }
203
+ /** Defines the filter group shape. */
204
+ interface FilterGroupDef {
205
+ id: string;
206
+ label: string;
207
+ type: "select" | "multi-select" | "search" | "date-range" | "tag" | "toggle";
208
+ options?: FilterOption[];
209
+ value?: string | string[] | boolean;
210
+ }
211
+ /** Defines the quick action shape. */
212
+ interface QuickActionDef {
213
+ id: string;
214
+ label: string;
215
+ description?: string;
216
+ icon?: React.ReactNode;
217
+ shortcut?: string;
218
+ onClick: () => void;
219
+ disabled?: boolean;
220
+ }
221
+ /** Defines the time preset shape. */
222
+ interface TimePreset {
223
+ label: string;
224
+ days: number;
225
+ }
226
+ /** Type definition for export format. */
227
+ type ExportFormat = "csv" | "json" | "pdf";
228
+ /** Defines the export column shape. */
229
+ interface ExportColumn {
230
+ key: string;
231
+ header: string;
232
+ }
233
+ /** Defines the failure item shape. */
234
+ interface FailureItem {
235
+ id: string;
236
+ title: string;
237
+ message?: string;
238
+ severity: "critical" | "error" | "warning";
239
+ timestamp: string;
240
+ group?: string;
241
+ metadata?: Record<string, unknown>;
242
+ }
243
+ /** Defines the chart data point shape. */
244
+ interface ChartDataPoint {
245
+ name: string;
246
+ [key: string]: string | number;
247
+ }
248
+ /** Defines the chart series shape. */
249
+ interface ChartSeriesDef {
250
+ dataKey: string;
251
+ name: string;
252
+ color?: string;
253
+ type?: "line" | "bar" | "area";
254
+ stackId?: string;
255
+ }
256
+ /** Configuration for chart. */
257
+ interface ChartConfig {
258
+ series: ChartSeriesDef[];
259
+ xAxisKey?: string;
260
+ showGrid?: boolean;
261
+ showTooltip?: boolean;
262
+ showLegend?: boolean;
263
+ animate?: boolean;
264
+ }
265
+ /** Defines the chart margin shape. */
266
+ interface ChartMargin {
267
+ top?: number;
268
+ right?: number;
269
+ bottom?: number;
270
+ left?: number;
271
+ }
272
+ /** Defines the chat conversation shape. */
273
+ interface ChatConversationDef {
274
+ id: string;
275
+ title: string;
276
+ lastMessage?: string;
277
+ timestamp: string;
278
+ unread?: boolean;
279
+ }
280
+ /** Defines the chat message shape. */
281
+ interface ChatMessageDef {
282
+ id: string;
283
+ role: "user" | "assistant";
284
+ content: string;
285
+ timestamp: string;
286
+ }
287
+ /** Defines the chat model shape. */
288
+ interface ChatModelDef {
289
+ id: string;
290
+ label: string;
291
+ description?: string;
292
+ }
293
+ /** Defines the chat style preset shape. */
294
+ interface ChatStylePresetDef {
295
+ id: string;
296
+ label: string;
297
+ systemPrompt?: string;
298
+ }
299
+ //#endregion
300
+ export { StatCard as A, MenuDef as C, ProjectDef as D, NavItemDef as E, TimePreset as F, ToastOptions as I, ToolbarButtonDef as L, TableColumn as M, TaskDef as N, QuickActionDef as O, TeamMemberDef as P, FormFieldDef as S, NavItem as T, ExportFormat as _, ChartMargin as a, FilterGroupDef as b, ChatMessageDef as c, CommandDef as d, DeploymentStep as f, ExportColumn as g, EnvVarDef as h, ChartDataPoint as i, TabDef as j, SelectOption as k, ChatModelDef as l, EnvGroupDef as m, BranchDef as n, ChartSeriesDef as o, DomainDef as p, ChartConfig as r, ChatConversationDef as s, ActivityDef as t, ChatStylePresetDef as u, FailureItem as v, MenuItemDef as w, FilterOption as x, FaqItem as y };
301
+ //# sourceMappingURL=types-D0FlcYnM.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-D0FlcYnM.d.cts","names":[],"sources":["../src/lib/types.ts"],"mappings":";;;UACiB;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ;;;UAIe;EACf;EACA;EACA,OAAO;;;UAIQ;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA,MAAM,MAAM;EACZ;;;UAIe;EACf;EACA;EACA,SAAS,MAAM;;;UAIA;EACf;EACA;EACA;EAWA;EACA;EACA;EACA;EACA,YAAY;EACZ;IAAY;IAAe;;;EAE3B;;EAEA;;EAEA;;EAEA;;EAEA,sBAAsB,QAAQ;;;UAMf;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA,MAAM;;;UAIS;EACf;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;;;UAMe,YAAY;EAC3B;EACA;EACA,gBAAgB,MAAM,KAAK,MAAM,MAAM;EACvC;EACA;;;UAIe;EACf;EACA;EACA;EACA;;;UAMe;EACf;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;IAAa;IAAY;IAAe;;;;UAIzB;EACf;EACA;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EAQA;EACA;EACA,OAAO;EACP;EACA,WAAW;EACX;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,UAAU;EACV;;;UAIe;EACf;EACA;EACA;EACA,OAAO,MAAM;EACb;EACA;EACA;;;UAMe;EACf;EACA;;;KAIU;;UAGK;EACf;EACA;;;UAMe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;;;UAMI;EACf;GACC;;;UAIc;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf,QAAQ;EACR;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;;;UAMe;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA"}
@@ -0,0 +1,301 @@
1
+
2
+ //#region src/lib/types.d.ts
3
+ /** Defines the command shape (data for command palettes / menus). */
4
+ interface CommandDef {
5
+ id: string;
6
+ label: string;
7
+ group: string;
8
+ shortcut?: string;
9
+ action: () => void;
10
+ }
11
+ /** Defines the stat card shape. */
12
+ interface StatCard {
13
+ id: string;
14
+ title: string;
15
+ value: string;
16
+ change: string;
17
+ trend: "up" | "down" | "neutral";
18
+ rawValue?: number;
19
+ format?: "text" | "duration" | "percentage";
20
+ durationUnit?: "ms" | "s";
21
+ }
22
+ /** Defines the nav item shape. */
23
+ interface NavItem {
24
+ id: string;
25
+ label: string;
26
+ href: string;
27
+ }
28
+ /** Defines the faq item shape. */
29
+ interface FaqItem {
30
+ id: string;
31
+ question: string;
32
+ answer: string;
33
+ }
34
+ /** Defines the select option shape. */
35
+ interface SelectOption {
36
+ value: string;
37
+ label: string;
38
+ color?: string;
39
+ }
40
+ /** Defines the menu item shape. */
41
+ interface MenuItemDef {
42
+ id: string;
43
+ label: string;
44
+ type?: "item" | "separator" | "checkbox" | "radio";
45
+ shortcut?: string;
46
+ name?: string;
47
+ value?: string;
48
+ checked?: boolean;
49
+ onChange?: (checked: boolean) => void;
50
+ onClick?: () => void;
51
+ }
52
+ /** Defines the menu shape. */
53
+ interface MenuDef {
54
+ id: string;
55
+ label: string;
56
+ items: MenuItemDef[];
57
+ }
58
+ /** Defines the nav item shape. */
59
+ interface NavItemDef {
60
+ id: string;
61
+ label: string;
62
+ href: string;
63
+ separator?: boolean;
64
+ sectionLabel?: string;
65
+ }
66
+ /** Defines the toolbar button shape. */
67
+ interface ToolbarButtonDef {
68
+ id: string;
69
+ label: string;
70
+ icon: React.ReactNode;
71
+ separator?: boolean;
72
+ }
73
+ /** Defines the tab shape. */
74
+ interface TabDef {
75
+ id: string;
76
+ label: string;
77
+ content: React.ReactNode;
78
+ }
79
+ /** Defines the form field shape. */
80
+ interface FormFieldDef {
81
+ name: string;
82
+ label: string;
83
+ type?: "text" | "email" | "password" | "number" | "checkbox" | "radio" | "textarea" | "select" | "switch" | "tags";
84
+ placeholder?: string;
85
+ defaultValue?: unknown;
86
+ required?: boolean;
87
+ requiredMessage?: string;
88
+ validate?: (value: unknown) => string | undefined;
89
+ options?: {
90
+ value: string;
91
+ label: string;
92
+ }[];
93
+ /** textarea 전용: 표시 줄 수 */
94
+ rows?: number;
95
+ /** textarea 전용: 크기 조절 방향 */
96
+ resize?: "none" | "vertical" | "horizontal" | "both";
97
+ /** textarea 전용: 폰트 스타일 */
98
+ font?: "default" | "mono";
99
+ /** switch 전용: 설명 텍스트 */
100
+ description?: string;
101
+ /** 조건부 필드 표시 — false 또는 함수가 false를 반환하면 필드 숨김 */
102
+ visible?: boolean | ((values: Record<string, unknown>) => boolean);
103
+ }
104
+ /** Defines the deployment step shape. */
105
+ interface DeploymentStep {
106
+ id: string;
107
+ name: string;
108
+ status: "pending" | "running" | "success" | "error" | "skipped";
109
+ duration?: string;
110
+ detail?: string;
111
+ }
112
+ /** Defines the project shape. */
113
+ interface ProjectDef {
114
+ id: string;
115
+ name: string;
116
+ framework: string;
117
+ status: "active" | "paused" | "error";
118
+ domain?: string;
119
+ }
120
+ /** Defines the env var shape. */
121
+ interface EnvVarDef {
122
+ key: string;
123
+ value: string;
124
+ isSecret?: boolean;
125
+ }
126
+ /** Defines the env group shape. */
127
+ interface EnvGroupDef {
128
+ env: string;
129
+ vars: EnvVarDef[];
130
+ }
131
+ /** Defines the branch shape. */
132
+ interface BranchDef {
133
+ name: string;
134
+ isDefault?: boolean;
135
+ lastCommit?: string;
136
+ author?: string;
137
+ }
138
+ /** Defines the domain shape. */
139
+ interface DomainDef {
140
+ domain: string;
141
+ status: "active" | "pending" | "error";
142
+ ssl: "valid" | "expired" | "pending";
143
+ redirect?: string;
144
+ addedAt?: string;
145
+ }
146
+ /** Defines the table column shape. */
147
+ interface TableColumn<T> {
148
+ id: string;
149
+ header: string;
150
+ accessor: keyof T | ((row: T) => React.ReactNode);
151
+ width?: string;
152
+ align?: "left" | "center" | "right";
153
+ }
154
+ /** Defines the toast options shape. */
155
+ interface ToastOptions {
156
+ variant: "info" | "success" | "warning" | "error";
157
+ title?: string;
158
+ message: string;
159
+ duration?: number;
160
+ }
161
+ /** Defines the task shape. */
162
+ interface TaskDef {
163
+ id: string;
164
+ title: string;
165
+ description?: string;
166
+ status: "todo" | "in-progress" | "review" | "done";
167
+ priority: "low" | "medium" | "high" | "urgent";
168
+ assignee?: TeamMemberDef;
169
+ dueDate?: string;
170
+ tags?: string[];
171
+ subtasks?: {
172
+ id: string;
173
+ title: string;
174
+ completed: boolean;
175
+ }[];
176
+ }
177
+ /** Defines the team member shape. */
178
+ interface TeamMemberDef {
179
+ id: string;
180
+ name: string;
181
+ email: string;
182
+ avatar?: string;
183
+ role?: string;
184
+ status?: "online" | "away" | "busy" | "offline";
185
+ }
186
+ /** Defines the activity shape. */
187
+ interface ActivityDef {
188
+ id: string;
189
+ type: "created" | "updated" | "completed" | "commented" | "assigned" | "deployed" | "merged";
190
+ title: string;
191
+ description?: string;
192
+ actor: TeamMemberDef;
193
+ timestamp: string;
194
+ metadata?: Record<string, unknown>;
195
+ variant?: "default" | "error" | "warning";
196
+ }
197
+ /** Defines the filter option shape. */
198
+ interface FilterOption {
199
+ id: string;
200
+ label: string;
201
+ value: string;
202
+ }
203
+ /** Defines the filter group shape. */
204
+ interface FilterGroupDef {
205
+ id: string;
206
+ label: string;
207
+ type: "select" | "multi-select" | "search" | "date-range" | "tag" | "toggle";
208
+ options?: FilterOption[];
209
+ value?: string | string[] | boolean;
210
+ }
211
+ /** Defines the quick action shape. */
212
+ interface QuickActionDef {
213
+ id: string;
214
+ label: string;
215
+ description?: string;
216
+ icon?: React.ReactNode;
217
+ shortcut?: string;
218
+ onClick: () => void;
219
+ disabled?: boolean;
220
+ }
221
+ /** Defines the time preset shape. */
222
+ interface TimePreset {
223
+ label: string;
224
+ days: number;
225
+ }
226
+ /** Type definition for export format. */
227
+ type ExportFormat = "csv" | "json" | "pdf";
228
+ /** Defines the export column shape. */
229
+ interface ExportColumn {
230
+ key: string;
231
+ header: string;
232
+ }
233
+ /** Defines the failure item shape. */
234
+ interface FailureItem {
235
+ id: string;
236
+ title: string;
237
+ message?: string;
238
+ severity: "critical" | "error" | "warning";
239
+ timestamp: string;
240
+ group?: string;
241
+ metadata?: Record<string, unknown>;
242
+ }
243
+ /** Defines the chart data point shape. */
244
+ interface ChartDataPoint {
245
+ name: string;
246
+ [key: string]: string | number;
247
+ }
248
+ /** Defines the chart series shape. */
249
+ interface ChartSeriesDef {
250
+ dataKey: string;
251
+ name: string;
252
+ color?: string;
253
+ type?: "line" | "bar" | "area";
254
+ stackId?: string;
255
+ }
256
+ /** Configuration for chart. */
257
+ interface ChartConfig {
258
+ series: ChartSeriesDef[];
259
+ xAxisKey?: string;
260
+ showGrid?: boolean;
261
+ showTooltip?: boolean;
262
+ showLegend?: boolean;
263
+ animate?: boolean;
264
+ }
265
+ /** Defines the chart margin shape. */
266
+ interface ChartMargin {
267
+ top?: number;
268
+ right?: number;
269
+ bottom?: number;
270
+ left?: number;
271
+ }
272
+ /** Defines the chat conversation shape. */
273
+ interface ChatConversationDef {
274
+ id: string;
275
+ title: string;
276
+ lastMessage?: string;
277
+ timestamp: string;
278
+ unread?: boolean;
279
+ }
280
+ /** Defines the chat message shape. */
281
+ interface ChatMessageDef {
282
+ id: string;
283
+ role: "user" | "assistant";
284
+ content: string;
285
+ timestamp: string;
286
+ }
287
+ /** Defines the chat model shape. */
288
+ interface ChatModelDef {
289
+ id: string;
290
+ label: string;
291
+ description?: string;
292
+ }
293
+ /** Defines the chat style preset shape. */
294
+ interface ChatStylePresetDef {
295
+ id: string;
296
+ label: string;
297
+ systemPrompt?: string;
298
+ }
299
+ //#endregion
300
+ export { StatCard as A, MenuDef as C, ProjectDef as D, NavItemDef as E, TimePreset as F, ToastOptions as I, ToolbarButtonDef as L, TableColumn as M, TaskDef as N, QuickActionDef as O, TeamMemberDef as P, FormFieldDef as S, NavItem as T, ExportFormat as _, ChartMargin as a, FilterGroupDef as b, ChatMessageDef as c, CommandDef as d, DeploymentStep as f, ExportColumn as g, EnvVarDef as h, ChartDataPoint as i, TabDef as j, SelectOption as k, ChatModelDef as l, EnvGroupDef as m, BranchDef as n, ChartSeriesDef as o, DomainDef as p, ChartConfig as r, ChatConversationDef as s, ActivityDef as t, ChatStylePresetDef as u, FailureItem as v, MenuItemDef as w, FilterOption as x, FaqItem as y };
301
+ //# sourceMappingURL=types-D0FlcYnM.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-D0FlcYnM.d.ts","names":[],"sources":["../src/lib/types.ts"],"mappings":";;;UACiB;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,YAAY;EACZ;;;UAIe;EACf;EACA;EACA,OAAO;;;UAIQ;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA,MAAM,MAAM;EACZ;;;UAIe;EACf;EACA;EACA,SAAS,MAAM;;;UAIA;EACf;EACA;EACA;EAWA;EACA;EACA;EACA;EACA,YAAY;EACZ;IAAY;IAAe;;;EAE3B;;EAEA;;EAEA;;EAEA;;EAEA,sBAAsB,QAAQ;;;UAMf;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA,MAAM;;;UAIS;EACf;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;EACA;;;UAMe,YAAY;EAC3B;EACA;EACA,gBAAgB,MAAM,KAAK,MAAM,MAAM;EACvC;EACA;;;UAIe;EACf;EACA;EACA;EACA;;;UAMe;EACf;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;IAAa;IAAY;IAAe;;;;UAIzB;EACf;EACA;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EAQA;EACA;EACA,OAAO;EACP;EACA,WAAW;EACX;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA,UAAU;EACV;;;UAIe;EACf;EACA;EACA;EACA,OAAO,MAAM;EACb;EACA;EACA;;;UAMe;EACf;EACA;;;KAIU;;UAGK;EACf;EACA;;;UAMe;EACf;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;;;UAMI;EACf;GACC;;;UAIc;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf,QAAQ;EACR;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;;;UAMe;EACf;EACA;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;EACA;;;UAIe;EACf;EACA;EACA;;;UAIe;EACf;EACA;EACA"}