Sari la conținut

Catalog JSON schema

Acest conținut nu este încă disponibil în limba selectată.

Each component entry is one JSON file under design/catalog/<id>.json. Files starting with _ are ignored by the builder (schema / docs).

Build: npm run portal:build → design/components/<id>.html + index.html + catalog.json.

{
"id": "alert",
"selector": "gds-alert",
"blockKind": "alert",
"package": "@gstack/gds-angular",
"dataType": "AlertData",
"status": "stable",
"description": { "ro": "...", "en": "..." },
"properties": [
{
"name": "data",
"type": "AlertData",
"required": true,
"description": { "ro": "..." },
"fields": [
{ "name": "severity", "type": "'info' | 'warning' | 'success' | 'error'", "description": { "ro": "..." } },
{ "name": "text", "type": "string", "required": true, "description": { "ro": "..." } }
]
}
],
"ai": {
"notes": ["..."],
"fields": ["text", "title?"],
"doNot": ["hex hardcodat"]
},
"example": {
"block": { "id": "demo-1", "kind": "alert", "data": { "severity": "info", "text": "..." } },
"meta": { "lang": "ro", "accent": "indigo", "font": "ibm-plex" }
},
"code": {
"angular": "<gds-alert ... />",
"block": "<gds-block [block]=\"{...}\" />"
}
}

Required fields (builder validates loosely)

Section titled “Required fields (builder validates loosely)”
FieldRule
idstring, non-empty; should match filename stem
selectorstring (e.g. gds-alert)
blockKindstring — must be a real BlockKind from @gstack/gds-core
example.blockobject with kind + data — required for BlockKind entries; renderBlock() must succeed
example.sidenavalternative for STRUCTURE (gds-sidenav) — rendered via renderSidenav()
example.metaoptional; lang / accent / font default to ro / indigo / ibm-plex
  • package, dataType, status (stable | beta | draft)
  • description.ro / description.en
  • properties[] with nested fields[]
  • ai.notes / ai.fields / ai.doNot
  • code.angular / code.block
  • Do not invent BlockKind or props outside projects/gds-core/src/lib/blocks.ts.
  • Accent only via --gds-accent / --gds-primary tokens — no hardcoded hex in examples.
  • One JSON per catalog entry; id is the URL slug (/components/<id>.html).