@mich8060/unified-design-system 0.2.15 → 0.2.16

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.
@@ -10,6 +10,9 @@
10
10
  "@mich8060/unified-design-system/ai/figma-make.json",
11
11
  "@mich8060/unified-design-system/ai/figma-make",
12
12
  "@mich8060/unified-design-system/ai/prompts/figma-make",
13
+ "@mich8060/unified-design-system/ai/prompts/system",
14
+ "@mich8060/unified-design-system/ai/prompts/repair",
15
+ "@mich8060/unified-design-system/ai/prompts/starter",
13
16
  "@mich8060/unified-design-system/ai/templates",
14
17
  "@mich8060/unified-design-system/ai/examples",
15
18
  "@mich8060/unified-design-system/ai/validation",
@@ -23,6 +26,9 @@
23
26
  "figmaMakeContractJson": "@mich8060/unified-design-system/ai/figma-make.json",
24
27
  "figmaMakeContract": "@mich8060/unified-design-system/ai/figma-make",
25
28
  "figmaMakePrompt": "@mich8060/unified-design-system/ai/prompts/figma-make",
29
+ "systemPrompt": "@mich8060/unified-design-system/ai/prompts/system",
30
+ "repairPrompt": "@mich8060/unified-design-system/ai/prompts/repair",
31
+ "starterPrompt": "@mich8060/unified-design-system/ai/prompts/starter",
26
32
  "templatesCatalog": "@mich8060/unified-design-system/ai/templates",
27
33
  "runtimeApi": "@mich8060/unified-design-system/ai",
28
34
  "manifestModule": "@mich8060/unified-design-system/ai/manifest",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=[{id:"valid-auth-form",scenario:"Simple authentication card with semantic layout and one primary action.",kind:"valid",tags:["form","auth","field-wrapping"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-24"},children:[{type:"Card",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Field",children:[{type:"TextInput",props:{type:"email",iconPosition:"left"}}]},{type:"Field",children:[{type:"TextInput",props:{type:"password"}}]},{type:"Flex",children:[{type:"Button",props:{appearance:"primary",label:"Sign in"}},{type:"Button",props:{appearance:"text",label:"Forgot password?"}}]}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed composition (Container > Card > Field/Text/Button), valid spacing token, and a single primary action."}},{id:"valid-table-summary",scenario:"Data summary area with table-related indicators and a single primary action.",kind:"valid",tags:["table","status","dashboard"],output:{tree:{type:"Container",children:[{type:"Flex",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Button",props:{appearance:"primary",label:"Create row"}}]},{type:"Table",children:[{type:"Status",props:{variant:"success",text:"Ready"}},{type:"Tag",props:{variant:"blue",label:"Active"}},{type:"DotStatus",props:{status:"positive"}},{type:"ActionMenu",props:{triggerLabel:"Row actions"}}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed Table children and keeps primary action count within limit."}},{id:"invalid-two-primary-actions",scenario:"Section contains two primary buttons.",kind:"invalid",tags:["actions","policy"],output:{tree:{type:"Container",children:[{type:"Button",props:{appearance:"primary",label:"Save"}},{type:"Button",props:{appearance:"primary",label:"Publish"}}]}},expected:{status:"fail",violationCodes:["RULE_MAX_PRIMARY_ACTIONS"]},rationale:{why:"Violates max primary actions per section.",fix:"Keep one primary action and convert the rest to secondary appearances."}},{id:"invalid-raw-html-and-inline-style",scenario:"Output includes raw HTML and inline style values.",kind:"invalid",tags:["raw-html","inline-style","governance"],output:{tree:{type:"Container",children:[{type:"div",props:{style:{color:"#ff0000"}},children:[{type:"Text",props:{variant:"body-16"}}]}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_COMPONENT","RULE_RAW_HTML_DISALLOWED","RULE_INLINE_STYLE_DISALLOWED"]},rationale:{why:"Governance forbids raw HTML tags and inline styling in generated output.",fix:"Replace raw HTML with UDS components and use tokenized component props."}},{id:"invalid-spacing-token",scenario:"Spacing prop uses a non-system token.",kind:"invalid",tags:["tokens","spacing"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-999"},children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_SPACING_TOKEN"]},rationale:{why:"Spacing token is outside allowed spacing system.",fix:"Use an allowed token such as --uds-spacing-8/12/16/24."}},{id:"invalid-custom-css-variable",scenario:"Uses non-UDS CSS variable references in component props.",kind:"invalid",tags:["tokens","css-variables","governance"],output:{tree:{type:"Container",props:{surfaceColor:"var(--brand-primary-500)"},children:[{type:"Text",props:{color:"--custom-text-color",variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_CUSTOM_CSS_VAR_DISALLOWED"]},rationale:{why:"Generated output must not introduce custom CSS variables outside --uds-* namespace.",fix:"Use --uds-* references or hardcoded literal values."}},{id:"invalid-tailwind-classname",scenario:"Output includes Tailwind utility classes.",kind:"invalid",tags:["tailwind","className","governance"],output:{tree:{type:"Container",props:{className:"p-4 bg-blue-600 text-white"},children:[{type:"Text",props:{variant:"body-16",text:"Example"}}]}},expected:{status:"fail",violationCodes:["RULE_TAILWIND_CLASS_DISALLOWED"]},rationale:{why:"Figma Make output must not fall back to Tailwind utility classes.",fix:"Use UDS components and governed tokenized props instead of className utilities."}},{id:"invalid-composition-parent-child",scenario:"Composition places a form field directly inside Menu.",kind:"invalid",tags:["composition","parent-child","layout"],output:{tree:{type:"Menu",children:[{type:"Field",children:[{type:"TextInput",props:{type:"text"}}]}]}},expected:{status:"fail",violationCodes:["RULE_INVALID_COMPOSITION","RULE_INVALID_PARENT_COMPOSITION"]},rationale:{why:"Field is not an allowed Menu child and Field requires a form/container context.",fix:"Use Menu-approved children or move Field under Container/Card/Modal/Tabs."}},{id:"invalid-ambiguous-prop-alias",scenario:"Uses an ambiguous legacy alias prop instead of canonical prop.",kind:"invalid",tags:["props","aliases","governance"],output:{tree:{type:"Chip",props:{label:"Demo",iconplacement:"left",icon:"User"}}},expected:{status:"fail",violationCodes:["RULE_AMBIGUOUS_PROP_ALIAS"]},rationale:{why:"Alias props create inconsistent generation behavior across models.",fix:"Use canonical prop name `iconPlacement`."}},{id:"invalid-version-mismatch",scenario:"Output version fields do not match current governance contract.",kind:"invalid",tags:["versioning","contract","governance"],output:{manifestVersion:"0.0.1",governanceVersion:"0.0.1",policyVersion:"0.0.1",tree:{type:"Container",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_VERSION_MISMATCH_MANIFESTVERSION","RULE_VERSION_MISMATCH_GOVERNANCEVERSION","RULE_VERSION_MISMATCH_POLICYVERSION"]},rationale:{why:"Generated output must declare versions that match the active AI contract.",fix:"Use the current manifest/governance/policy versions from UDSGovernance."}},{id:"invalid-schema-node-type",scenario:"Malformed output with missing node type.",kind:"invalid",tags:["schema","malformed"],output:{tree:{type:"",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["SCHEMA_NODE_TYPE"]},rationale:{why:"Schema requires each node to have a non-empty string `type`.",fix:"Set a valid UDS component type for every node."}}];exports.UDS_TRAINING_EXAMPLES=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=[{id:"valid-auth-form",scenario:"Simple authentication card with semantic layout and one primary action.",kind:"valid",tags:["form","auth","field-wrapping"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-24"},children:[{type:"Card",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Field",children:[{type:"TextInput",props:{type:"email",iconPosition:"left"}}]},{type:"Field",children:[{type:"TextInput",props:{type:"password"}}]},{type:"Flex",children:[{type:"Button",props:{appearance:"primary",label:"Sign in"}},{type:"Button",props:{appearance:"text",label:"Forgot password?"}}]}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed composition (Container > Card > Field/Text/Button), valid spacing token, and a single primary action."}},{id:"valid-table-summary",scenario:"Data summary area with table-related indicators and a single primary action.",kind:"valid",tags:["table","status","dashboard"],output:{tree:{type:"Container",children:[{type:"Flex",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Button",props:{appearance:"primary",label:"Create row"}}]},{type:"Table",children:[{type:"Status",props:{variant:"success",text:"Ready"}},{type:"Tag",props:{variant:"blue",label:"Active"}},{type:"DotStatus",props:{status:"positive"}},{type:"ActionMenu",props:{triggerLabel:"Row actions"}}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed Table children and keeps primary action count within limit."}},{id:"invalid-two-primary-actions",scenario:"Section contains two primary buttons.",kind:"invalid",tags:["actions","policy"],output:{tree:{type:"Container",children:[{type:"Button",props:{appearance:"primary",label:"Save"}},{type:"Button",props:{appearance:"primary",label:"Publish"}}]}},expected:{status:"fail",violationCodes:["RULE_MAX_PRIMARY_ACTIONS"]},rationale:{why:"Violates max primary actions per section.",fix:"Keep one primary action and convert the rest to secondary appearances."}},{id:"invalid-raw-html-and-inline-style",scenario:"Output includes raw HTML and inline style values.",kind:"invalid",tags:["raw-html","inline-style","governance"],output:{tree:{type:"Container",children:[{type:"div",props:{style:{color:"#ff0000"}},children:[{type:"Text",props:{variant:"body-16"}}]}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_COMPONENT","RULE_RAW_HTML_DISALLOWED","RULE_INLINE_STYLE_DISALLOWED"]},rationale:{why:"Governance forbids raw HTML tags and inline styling in generated output.",fix:"Replace raw HTML with UDS components and use tokenized component props."}},{id:"invalid-spacing-token",scenario:"Spacing prop uses a non-system token.",kind:"invalid",tags:["tokens","spacing"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-999"},children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_SPACING_TOKEN"]},rationale:{why:"Spacing token is outside allowed spacing system.",fix:"Use an allowed token such as --uds-spacing-8/12/16/24."}},{id:"invalid-custom-css-variable",scenario:"Uses non-UDS CSS variable references in component props.",kind:"invalid",tags:["tokens","css-variables","governance"],output:{tree:{type:"Container",props:{surfaceColor:"var(--brand-primary-500)"},children:[{type:"Text",props:{color:"--custom-text-color",variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_CUSTOM_CSS_VAR_DISALLOWED"]},rationale:{why:"Generated output must not introduce custom CSS variables outside --uds-* namespace.",fix:"Use --uds-* references or hardcoded literal values."}},{id:"invalid-tailwind-classname",scenario:"Output includes Tailwind utility classes.",kind:"invalid",tags:["tailwind","className","governance"],output:{tree:{type:"Container",props:{className:"p-4 bg-blue-600 text-white"},children:[{type:"Text",props:{variant:"body-16",text:"Example"}}]}},expected:{status:"fail",violationCodes:["RULE_TAILWIND_CLASS_DISALLOWED"]},rationale:{why:"Figma Make output must not fall back to Tailwind utility classes.",fix:"Use UDS components and governed tokenized props instead of className utilities."}},{id:"invalid-menu-ant-props",scenario:"Menu uses Ant-style props that are not part of the UDS contract.",kind:"invalid",tags:["menu","props","contract-drift"],output:{tree:{type:"Menu",props:{items:[{label:"Dashboard",icon:"House",path:"/"}],selectedKeys:["/"],mode:"inline"}}},expected:{status:"fail",violationCodes:["RULE_FORBIDDEN_PROP"]},rationale:{why:"Menu must use UDS canonical props, not Ant-style API props.",fix:"Use navItems plus activeMode/app state driven selection."}},{id:"invalid-flex-ant-props",scenario:"Flex uses vertical/justify/align aliases from non-UDS APIs.",kind:"invalid",tags:["flex","props","contract-drift"],output:{tree:{type:"Flex",props:{vertical:!0,justify:"space-between",align:"center"},children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_FORBIDDEN_PROP"]},rationale:{why:"Flex layout must use canonical props for deterministic cross-model behavior.",fix:"Use direction, justifyContent, and alignItems props."}},{id:"invalid-composition-parent-child",scenario:"Composition places a form field directly inside Menu.",kind:"invalid",tags:["composition","parent-child","layout"],output:{tree:{type:"Menu",children:[{type:"Field",children:[{type:"TextInput",props:{type:"text"}}]}]}},expected:{status:"fail",violationCodes:["RULE_INVALID_COMPOSITION","RULE_INVALID_PARENT_COMPOSITION"]},rationale:{why:"Field is not an allowed Menu child and Field requires a form/container context.",fix:"Use Menu-approved children or move Field under Container/Card/Modal/Tabs."}},{id:"invalid-ambiguous-prop-alias",scenario:"Uses an ambiguous legacy alias prop instead of canonical prop.",kind:"invalid",tags:["props","aliases","governance"],output:{tree:{type:"Chip",props:{label:"Demo",iconplacement:"left",icon:"User"}}},expected:{status:"fail",violationCodes:["RULE_AMBIGUOUS_PROP_ALIAS"]},rationale:{why:"Alias props create inconsistent generation behavior across models.",fix:"Use canonical prop name `iconPlacement`."}},{id:"invalid-version-mismatch",scenario:"Output version fields do not match current governance contract.",kind:"invalid",tags:["versioning","contract","governance"],output:{manifestVersion:"0.0.1",governanceVersion:"0.0.1",policyVersion:"0.0.1",tree:{type:"Container",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_VERSION_MISMATCH_MANIFESTVERSION","RULE_VERSION_MISMATCH_GOVERNANCEVERSION","RULE_VERSION_MISMATCH_POLICYVERSION"]},rationale:{why:"Generated output must declare versions that match the active AI contract.",fix:"Use the current manifest/governance/policy versions from UDSGovernance."}},{id:"invalid-schema-node-type",scenario:"Malformed output with missing node type.",kind:"invalid",tags:["schema","malformed"],output:{tree:{type:"",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["SCHEMA_NODE_TYPE"]},rationale:{why:"Schema requires each node to have a non-empty string `type`.",fix:"Set a valid UDS component type for every node."}}];exports.UDS_TRAINING_EXAMPLES=e;
@@ -1 +1 @@
1
- const e=[{id:"valid-auth-form",scenario:"Simple authentication card with semantic layout and one primary action.",kind:"valid",tags:["form","auth","field-wrapping"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-24"},children:[{type:"Card",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Field",children:[{type:"TextInput",props:{type:"email",iconPosition:"left"}}]},{type:"Field",children:[{type:"TextInput",props:{type:"password"}}]},{type:"Flex",children:[{type:"Button",props:{appearance:"primary",label:"Sign in"}},{type:"Button",props:{appearance:"text",label:"Forgot password?"}}]}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed composition (Container > Card > Field/Text/Button), valid spacing token, and a single primary action."}},{id:"valid-table-summary",scenario:"Data summary area with table-related indicators and a single primary action.",kind:"valid",tags:["table","status","dashboard"],output:{tree:{type:"Container",children:[{type:"Flex",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Button",props:{appearance:"primary",label:"Create row"}}]},{type:"Table",children:[{type:"Status",props:{variant:"success",text:"Ready"}},{type:"Tag",props:{variant:"blue",label:"Active"}},{type:"DotStatus",props:{status:"positive"}},{type:"ActionMenu",props:{triggerLabel:"Row actions"}}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed Table children and keeps primary action count within limit."}},{id:"invalid-two-primary-actions",scenario:"Section contains two primary buttons.",kind:"invalid",tags:["actions","policy"],output:{tree:{type:"Container",children:[{type:"Button",props:{appearance:"primary",label:"Save"}},{type:"Button",props:{appearance:"primary",label:"Publish"}}]}},expected:{status:"fail",violationCodes:["RULE_MAX_PRIMARY_ACTIONS"]},rationale:{why:"Violates max primary actions per section.",fix:"Keep one primary action and convert the rest to secondary appearances."}},{id:"invalid-raw-html-and-inline-style",scenario:"Output includes raw HTML and inline style values.",kind:"invalid",tags:["raw-html","inline-style","governance"],output:{tree:{type:"Container",children:[{type:"div",props:{style:{color:"#ff0000"}},children:[{type:"Text",props:{variant:"body-16"}}]}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_COMPONENT","RULE_RAW_HTML_DISALLOWED","RULE_INLINE_STYLE_DISALLOWED"]},rationale:{why:"Governance forbids raw HTML tags and inline styling in generated output.",fix:"Replace raw HTML with UDS components and use tokenized component props."}},{id:"invalid-spacing-token",scenario:"Spacing prop uses a non-system token.",kind:"invalid",tags:["tokens","spacing"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-999"},children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_SPACING_TOKEN"]},rationale:{why:"Spacing token is outside allowed spacing system.",fix:"Use an allowed token such as --uds-spacing-8/12/16/24."}},{id:"invalid-custom-css-variable",scenario:"Uses non-UDS CSS variable references in component props.",kind:"invalid",tags:["tokens","css-variables","governance"],output:{tree:{type:"Container",props:{surfaceColor:"var(--brand-primary-500)"},children:[{type:"Text",props:{color:"--custom-text-color",variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_CUSTOM_CSS_VAR_DISALLOWED"]},rationale:{why:"Generated output must not introduce custom CSS variables outside --uds-* namespace.",fix:"Use --uds-* references or hardcoded literal values."}},{id:"invalid-tailwind-classname",scenario:"Output includes Tailwind utility classes.",kind:"invalid",tags:["tailwind","className","governance"],output:{tree:{type:"Container",props:{className:"p-4 bg-blue-600 text-white"},children:[{type:"Text",props:{variant:"body-16",text:"Example"}}]}},expected:{status:"fail",violationCodes:["RULE_TAILWIND_CLASS_DISALLOWED"]},rationale:{why:"Figma Make output must not fall back to Tailwind utility classes.",fix:"Use UDS components and governed tokenized props instead of className utilities."}},{id:"invalid-composition-parent-child",scenario:"Composition places a form field directly inside Menu.",kind:"invalid",tags:["composition","parent-child","layout"],output:{tree:{type:"Menu",children:[{type:"Field",children:[{type:"TextInput",props:{type:"text"}}]}]}},expected:{status:"fail",violationCodes:["RULE_INVALID_COMPOSITION","RULE_INVALID_PARENT_COMPOSITION"]},rationale:{why:"Field is not an allowed Menu child and Field requires a form/container context.",fix:"Use Menu-approved children or move Field under Container/Card/Modal/Tabs."}},{id:"invalid-ambiguous-prop-alias",scenario:"Uses an ambiguous legacy alias prop instead of canonical prop.",kind:"invalid",tags:["props","aliases","governance"],output:{tree:{type:"Chip",props:{label:"Demo",iconplacement:"left",icon:"User"}}},expected:{status:"fail",violationCodes:["RULE_AMBIGUOUS_PROP_ALIAS"]},rationale:{why:"Alias props create inconsistent generation behavior across models.",fix:"Use canonical prop name `iconPlacement`."}},{id:"invalid-version-mismatch",scenario:"Output version fields do not match current governance contract.",kind:"invalid",tags:["versioning","contract","governance"],output:{manifestVersion:"0.0.1",governanceVersion:"0.0.1",policyVersion:"0.0.1",tree:{type:"Container",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_VERSION_MISMATCH_MANIFESTVERSION","RULE_VERSION_MISMATCH_GOVERNANCEVERSION","RULE_VERSION_MISMATCH_POLICYVERSION"]},rationale:{why:"Generated output must declare versions that match the active AI contract.",fix:"Use the current manifest/governance/policy versions from UDSGovernance."}},{id:"invalid-schema-node-type",scenario:"Malformed output with missing node type.",kind:"invalid",tags:["schema","malformed"],output:{tree:{type:"",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["SCHEMA_NODE_TYPE"]},rationale:{why:"Schema requires each node to have a non-empty string `type`.",fix:"Set a valid UDS component type for every node."}}];export{e as UDS_TRAINING_EXAMPLES};
1
+ const e=[{id:"valid-auth-form",scenario:"Simple authentication card with semantic layout and one primary action.",kind:"valid",tags:["form","auth","field-wrapping"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-24"},children:[{type:"Card",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Field",children:[{type:"TextInput",props:{type:"email",iconPosition:"left"}}]},{type:"Field",children:[{type:"TextInput",props:{type:"password"}}]},{type:"Flex",children:[{type:"Button",props:{appearance:"primary",label:"Sign in"}},{type:"Button",props:{appearance:"text",label:"Forgot password?"}}]}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed composition (Container > Card > Field/Text/Button), valid spacing token, and a single primary action."}},{id:"valid-table-summary",scenario:"Data summary area with table-related indicators and a single primary action.",kind:"valid",tags:["table","status","dashboard"],output:{tree:{type:"Container",children:[{type:"Flex",children:[{type:"Text",props:{variant:"heading-24"}},{type:"Button",props:{appearance:"primary",label:"Create row"}}]},{type:"Table",children:[{type:"Status",props:{variant:"success",text:"Ready"}},{type:"Tag",props:{variant:"blue",label:"Active"}},{type:"DotStatus",props:{status:"positive"}},{type:"ActionMenu",props:{triggerLabel:"Row actions"}}]}]}},expected:{status:"pass"},rationale:{why:"Uses allowed Table children and keeps primary action count within limit."}},{id:"invalid-two-primary-actions",scenario:"Section contains two primary buttons.",kind:"invalid",tags:["actions","policy"],output:{tree:{type:"Container",children:[{type:"Button",props:{appearance:"primary",label:"Save"}},{type:"Button",props:{appearance:"primary",label:"Publish"}}]}},expected:{status:"fail",violationCodes:["RULE_MAX_PRIMARY_ACTIONS"]},rationale:{why:"Violates max primary actions per section.",fix:"Keep one primary action and convert the rest to secondary appearances."}},{id:"invalid-raw-html-and-inline-style",scenario:"Output includes raw HTML and inline style values.",kind:"invalid",tags:["raw-html","inline-style","governance"],output:{tree:{type:"Container",children:[{type:"div",props:{style:{color:"#ff0000"}},children:[{type:"Text",props:{variant:"body-16"}}]}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_COMPONENT","RULE_RAW_HTML_DISALLOWED","RULE_INLINE_STYLE_DISALLOWED"]},rationale:{why:"Governance forbids raw HTML tags and inline styling in generated output.",fix:"Replace raw HTML with UDS components and use tokenized component props."}},{id:"invalid-spacing-token",scenario:"Spacing prop uses a non-system token.",kind:"invalid",tags:["tokens","spacing"],output:{tree:{type:"Container",props:{gap:"--uds-spacing-999"},children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_UNKNOWN_SPACING_TOKEN"]},rationale:{why:"Spacing token is outside allowed spacing system.",fix:"Use an allowed token such as --uds-spacing-8/12/16/24."}},{id:"invalid-custom-css-variable",scenario:"Uses non-UDS CSS variable references in component props.",kind:"invalid",tags:["tokens","css-variables","governance"],output:{tree:{type:"Container",props:{surfaceColor:"var(--brand-primary-500)"},children:[{type:"Text",props:{color:"--custom-text-color",variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_CUSTOM_CSS_VAR_DISALLOWED"]},rationale:{why:"Generated output must not introduce custom CSS variables outside --uds-* namespace.",fix:"Use --uds-* references or hardcoded literal values."}},{id:"invalid-tailwind-classname",scenario:"Output includes Tailwind utility classes.",kind:"invalid",tags:["tailwind","className","governance"],output:{tree:{type:"Container",props:{className:"p-4 bg-blue-600 text-white"},children:[{type:"Text",props:{variant:"body-16",text:"Example"}}]}},expected:{status:"fail",violationCodes:["RULE_TAILWIND_CLASS_DISALLOWED"]},rationale:{why:"Figma Make output must not fall back to Tailwind utility classes.",fix:"Use UDS components and governed tokenized props instead of className utilities."}},{id:"invalid-menu-ant-props",scenario:"Menu uses Ant-style props that are not part of the UDS contract.",kind:"invalid",tags:["menu","props","contract-drift"],output:{tree:{type:"Menu",props:{items:[{label:"Dashboard",icon:"House",path:"/"}],selectedKeys:["/"],mode:"inline"}}},expected:{status:"fail",violationCodes:["RULE_FORBIDDEN_PROP"]},rationale:{why:"Menu must use UDS canonical props, not Ant-style API props.",fix:"Use navItems plus activeMode/app state driven selection."}},{id:"invalid-flex-ant-props",scenario:"Flex uses vertical/justify/align aliases from non-UDS APIs.",kind:"invalid",tags:["flex","props","contract-drift"],output:{tree:{type:"Flex",props:{vertical:!0,justify:"space-between",align:"center"},children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_FORBIDDEN_PROP"]},rationale:{why:"Flex layout must use canonical props for deterministic cross-model behavior.",fix:"Use direction, justifyContent, and alignItems props."}},{id:"invalid-composition-parent-child",scenario:"Composition places a form field directly inside Menu.",kind:"invalid",tags:["composition","parent-child","layout"],output:{tree:{type:"Menu",children:[{type:"Field",children:[{type:"TextInput",props:{type:"text"}}]}]}},expected:{status:"fail",violationCodes:["RULE_INVALID_COMPOSITION","RULE_INVALID_PARENT_COMPOSITION"]},rationale:{why:"Field is not an allowed Menu child and Field requires a form/container context.",fix:"Use Menu-approved children or move Field under Container/Card/Modal/Tabs."}},{id:"invalid-ambiguous-prop-alias",scenario:"Uses an ambiguous legacy alias prop instead of canonical prop.",kind:"invalid",tags:["props","aliases","governance"],output:{tree:{type:"Chip",props:{label:"Demo",iconplacement:"left",icon:"User"}}},expected:{status:"fail",violationCodes:["RULE_AMBIGUOUS_PROP_ALIAS"]},rationale:{why:"Alias props create inconsistent generation behavior across models.",fix:"Use canonical prop name `iconPlacement`."}},{id:"invalid-version-mismatch",scenario:"Output version fields do not match current governance contract.",kind:"invalid",tags:["versioning","contract","governance"],output:{manifestVersion:"0.0.1",governanceVersion:"0.0.1",policyVersion:"0.0.1",tree:{type:"Container",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["RULE_VERSION_MISMATCH_MANIFESTVERSION","RULE_VERSION_MISMATCH_GOVERNANCEVERSION","RULE_VERSION_MISMATCH_POLICYVERSION"]},rationale:{why:"Generated output must declare versions that match the active AI contract.",fix:"Use the current manifest/governance/policy versions from UDSGovernance."}},{id:"invalid-schema-node-type",scenario:"Malformed output with missing node type.",kind:"invalid",tags:["schema","malformed"],output:{tree:{type:"",children:[{type:"Text",props:{variant:"body-16"}}]}},expected:{status:"fail",violationCodes:["SCHEMA_NODE_TYPE"]},rationale:{why:"Schema requires each node to have a non-empty string `type`.",fix:"Set a valid UDS component type for every node."}}];export{e as UDS_TRAINING_EXAMPLES};
@@ -15,6 +15,10 @@
15
15
  "@mich8060/unified-design-system",
16
16
  "@mich8060/unified-design-system/figma-make"
17
17
  ],
18
+ "importRules": {
19
+ "allowPackageLevelImportsOnly": true,
20
+ "disallowDeepComponentImports": true
21
+ },
18
22
  "disallowedPatterns": [
19
23
  "tailwind-utility-class",
20
24
  "className-utility-styling",
@@ -29,6 +33,14 @@
29
33
  "layoutGovernance": {
30
34
  "useAppShellForRootLayout": true,
31
35
  "maxPrimaryActionsPerSection": 1
36
+ },
37
+ "forbiddenPropsByComponent": {
38
+ "Menu": ["items", "selectedKeys", "mode"],
39
+ "Flex": ["vertical", "justify", "align"],
40
+ "Text": ["type", "strong"],
41
+ "Button": ["type"],
42
+ "Badge": ["status", "color"],
43
+ "Statistics": ["title", "prefix", "suffix", "valueStyle"]
32
44
  }
33
45
  },
34
46
  "componentContracts": {
@@ -175,4 +187,4 @@
175
187
  "validation": "@mich8060/unified-design-system/ai/validation",
176
188
  "adapter": "@mich8060/unified-design-system/figma-make"
177
189
  }
178
- }
190
+ }
@@ -5,6 +5,7 @@ Use this contract when generating interfaces from Figma Make into code for `@mic
5
5
  ## Required Stack
6
6
 
7
7
  - Use only imports from `@mich8060/unified-design-system` (or `@mich8060/unified-design-system/figma-make`).
8
+ - Do not deep import from internal paths (for example `@/.../components/Menu`).
8
9
  - Compose UI with UDS components.
9
10
  - Style only with `--uds-*` tokens or hardcoded literals when necessary.
10
11
 
@@ -14,6 +15,13 @@ Use this contract when generating interfaces from Figma Make into code for `@mic
14
15
  - No `className` utility styling.
15
16
  - No raw HTML layout wrappers when a UDS component exists (`div`, `section`, `main`, etc.).
16
17
  - No custom CSS variables (`--brand-*`, `--custom-*`, `--foo-*`).
18
+ - No Ant-style prop APIs on UDS components:
19
+ - `Menu.items`, `Menu.selectedKeys`, `Menu.mode`
20
+ - `Flex.vertical`, `Flex.justify`, `Flex.align`
21
+ - `Button.type`
22
+ - `Text.type`, `Text.strong`
23
+ - `Badge.status`, `Badge.color`
24
+ - `Statistics.title`, `Statistics.prefix`, `Statistics.suffix`, `Statistics.valueStyle`
17
25
 
18
26
  ## Output Requirements
19
27
 
@@ -48,3 +56,16 @@ Use this contract when generating interfaces from Figma Make into code for `@mic
48
56
 
49
57
  - Generation is validated by AI policy rules.
50
58
  - Any Tailwind utility or custom variable usage will fail validation.
59
+ - Forbidden non-UDS props fail validation (`RULE_FORBIDDEN_PROP`).
60
+
61
+ ## Contract Examples
62
+
63
+ Bad (rejected):
64
+ - `Menu` with `items`/`selectedKeys`/`mode`
65
+ - `Flex` with `vertical`/`justify`/`align`
66
+ - `Button` with `type="primary"`
67
+
68
+ Good (accepted):
69
+ - `Menu` with `navItems` and `activeMode`
70
+ - `Flex` with `direction`, `justifyContent`, `alignItems`
71
+ - `Button` with `appearance="primary"`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../manifest/prop-aliases.manifest.cjs"),l=r=>({...a.PropAliasRules.global??{},...a.PropAliasRules.byComponent[r]??{}}),u=({tree:r})=>{const n=[],t=(o,p)=>{const c=l(o.type),i=o.props??{};for(const e of Object.keys(i)){const s=c[e];s&&n.push({severity:"error",code:"RULE_AMBIGUOUS_PROP_ALIAS",message:`Prop "${e}" is ambiguous for ${o.type}. Use canonical prop "${s}".`,path:`${p}.props.${e}`,component:o.type})}(o.children??[]).forEach((e,s)=>t(e,`${p}.children[${s}]`))};return t(r,"root"),n};exports.enforceCanonicalPropsRule=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../../manifest/prop-aliases.manifest.cjs"),g=a=>({...l.PropAliasRules.global??{},...l.PropAliasRules.byComponent[a]??{}}),y={Menu:{items:{replacement:"navItems",reason:"Menu uses navItems contract, not Ant-style items."},selectedKeys:{reason:"Menu selection is route-driven via nav item paths and app state."},mode:{replacement:"activeMode",reason:"Menu mode is governed by activeMode light/dark values."}},Flex:{vertical:{replacement:"direction",reason:"Flex direction is governed by row/column direction prop."},justify:{replacement:"justifyContent",reason:"Flex alignment uses justifyContent canonical prop."},align:{replacement:"alignItems",reason:"Flex alignment uses alignItems canonical prop."}},Text:{type:{replacement:"variant",reason:"Text semantics use UDS typography variant tokens."},strong:{replacement:"weight",reason:"Text weight should be controlled by weight prop."}},Button:{type:{replacement:"appearance",reason:"Button style is governed by appearance variants."}},Badge:{status:{replacement:"variant",reason:"Badge uses variant semantic color names, not status."},color:{replacement:"variant",reason:"Badge color intent is governed through variant values."}},Statistics:{title:{replacement:"label",reason:"Statistics title maps to label in UDS contract."},suffix:{replacement:"helperText",reason:"Use helperText/statusLabel/changeText fields for supporting copy."},prefix:{replacement:"helperText",reason:"Use helperText/statusLabel/changeText fields for supporting copy."},valueStyle:{reason:"Styling is token-governed; avoid inline styling props."}}},d=({tree:a})=>{const o=[],r=(e,s)=>{const p=g(e.type),c=y[e.type]??{},u=e.props??{};for(const t of Object.keys(u)){const n=c[t];if(n){const m=n.replacement?` Use "${n.replacement}" instead.`:"";o.push({severity:"error",code:"RULE_FORBIDDEN_PROP",message:`Prop "${t}" is disallowed on ${e.type}. ${n.reason}${m}`,path:`${s}.props.${t}`,component:e.type})}const i=p[t];i&&o.push({severity:"error",code:"RULE_AMBIGUOUS_PROP_ALIAS",message:`Prop "${t}" is ambiguous for ${e.type}. Use canonical prop "${i}".`,path:`${s}.props.${t}`,component:e.type})}(e.children??[]).forEach((t,n)=>r(t,`${s}.children[${n}]`))};return r(a,"root"),o};exports.enforceCanonicalPropsRule=d;
@@ -1 +1 @@
1
- import{PropAliasRules as c}from"../../manifest/prop-aliases.manifest.js";const l=p=>({...c.global??{},...c.byComponent[p]??{}}),f=({tree:p})=>{const n=[],t=(o,e)=>{const a=l(o.type),i=o.props??{};for(const r of Object.keys(i)){const s=a[r];s&&n.push({severity:"error",code:"RULE_AMBIGUOUS_PROP_ALIAS",message:`Prop "${r}" is ambiguous for ${o.type}. Use canonical prop "${s}".`,path:`${e}.props.${r}`,component:o.type})}(o.children??[]).forEach((r,s)=>t(r,`${e}.children[${s}]`))};return t(p,"root"),n};export{f as enforceCanonicalPropsRule};
1
+ import{PropAliasRules as p}from"../../manifest/prop-aliases.manifest.js";const g=a=>({...p.global??{},...p.byComponent[a]??{}}),y={Menu:{items:{replacement:"navItems",reason:"Menu uses navItems contract, not Ant-style items."},selectedKeys:{reason:"Menu selection is route-driven via nav item paths and app state."},mode:{replacement:"activeMode",reason:"Menu mode is governed by activeMode light/dark values."}},Flex:{vertical:{replacement:"direction",reason:"Flex direction is governed by row/column direction prop."},justify:{replacement:"justifyContent",reason:"Flex alignment uses justifyContent canonical prop."},align:{replacement:"alignItems",reason:"Flex alignment uses alignItems canonical prop."}},Text:{type:{replacement:"variant",reason:"Text semantics use UDS typography variant tokens."},strong:{replacement:"weight",reason:"Text weight should be controlled by weight prop."}},Button:{type:{replacement:"appearance",reason:"Button style is governed by appearance variants."}},Badge:{status:{replacement:"variant",reason:"Badge uses variant semantic color names, not status."},color:{replacement:"variant",reason:"Badge color intent is governed through variant values."}},Statistics:{title:{replacement:"label",reason:"Statistics title maps to label in UDS contract."},suffix:{replacement:"helperText",reason:"Use helperText/statusLabel/changeText fields for supporting copy."},prefix:{replacement:"helperText",reason:"Use helperText/statusLabel/changeText fields for supporting copy."},valueStyle:{reason:"Styling is token-governed; avoid inline styling props."}}},v=({tree:a})=>{const o=[],r=(e,s)=>{const l=g(e.type),c=y[e.type]??{},m=e.props??{};for(const t of Object.keys(m)){const n=c[t];if(n){const u=n.replacement?` Use "${n.replacement}" instead.`:"";o.push({severity:"error",code:"RULE_FORBIDDEN_PROP",message:`Prop "${t}" is disallowed on ${e.type}. ${n.reason}${u}`,path:`${s}.props.${t}`,component:e.type})}const i=l[t];i&&o.push({severity:"error",code:"RULE_AMBIGUOUS_PROP_ALIAS",message:`Prop "${t}" is ambiguous for ${e.type}. Use canonical prop "${i}".`,path:`${s}.props.${t}`,component:e.type})}(e.children??[]).forEach((t,n)=>r(t,`${s}.children[${n}]`))};return r(a,"root"),o};export{v as enforceCanonicalPropsRule};
@@ -2,10 +2,13 @@ You are implementing UI from Figma Make using `@mich8060/unified-design-system`.
2
2
 
3
3
  Hard requirements:
4
4
  - Use only UDS components and UDS exports.
5
+ - Use only package-level imports from `@mich8060/unified-design-system` (or `/figma-make`).
6
+ - Never deep import `@/.../components/*`.
5
7
  - Do not use Tailwind classes or utility CSS.
6
8
  - Do not use ad-hoc `className` styling.
7
9
  - Do not create custom CSS variables.
8
10
  - Use only `--uds-*` variables or hardcoded literals.
11
+ - Use canonical prop names only (reject Ant-style aliases like `Menu.items`, `Flex.vertical`, `Button.type`).
9
12
  - Return deterministic JSON only.
10
13
 
11
14
  Preferred flow:
@@ -15,6 +18,14 @@ Preferred flow:
15
18
  4. Keep canonical prop names.
16
19
  5. Validate against `@mich8060/unified-design-system/ai/validation`.
17
20
 
21
+ Invalid to valid prop examples:
22
+ - `Menu.items` -> `Menu.navItems`
23
+ - `Menu.mode` -> `Menu.activeMode`
24
+ - `Flex.vertical` -> `Flex.direction`
25
+ - `Flex.justify` -> `Flex.justifyContent`
26
+ - `Flex.align` -> `Flex.alignItems`
27
+ - `Button.type` -> `Button.appearance`
28
+
18
29
  Starter scaffold:
19
30
  ```json
20
31
  {
@@ -0,0 +1,13 @@
1
+ You must repair the JSON tree and return corrected JSON only.
2
+
3
+ Rules:
4
+ - Do not add prose.
5
+ - Preserve intent.
6
+ - Fix all violations.
7
+ - Keep output deterministic and policy-compliant.
8
+ - Use canonical prop names (no alias props).
9
+ - Keep version fields aligned with current governance (`manifestVersion`, `governanceVersion`, `policyVersion`).
10
+ - Do not define custom CSS variables; use `--uds-*` references or hardcoded literals only.
11
+
12
+ Violations:
13
+ {{violations_json}}
@@ -0,0 +1,59 @@
1
+ Set up this repository from scratch so `@mich8060/unified-design-system` is used end-to-end with no Tailwind fallback.
2
+
3
+ Execution order:
4
+ 1. Install and verify toolchain.
5
+ 2. Build and validate AI contract artifacts.
6
+ 3. Implement UI using UDS components and tokens only.
7
+ 4. Ensure root layout uses `AppShell`.
8
+
9
+ Hard rules:
10
+ - Use package exports from `@mich8060/unified-design-system`.
11
+ - Never deep import component internals.
12
+ - Never use Tailwind classes/utilities.
13
+ - Never invent CSS variables. Use `--uds-*` tokens or hardcoded literals.
14
+ - Prefer canonical props from the AI manifest and component contracts.
15
+
16
+ Required layout scaffold:
17
+ - Root must be:
18
+ - `AppShell`
19
+ - `AppShell.Menu`
20
+ - `AppShell.Content`
21
+ - `AppShell.Main`
22
+ - Place route/page content in `AppShell.Main`.
23
+
24
+ Brand menu requirements:
25
+ - `comphealth`, `gms`, `weatherby`:
26
+ - Dashboard (`Layout`)
27
+ - Schedule (`CalendarBlank`)
28
+ - Job Board (`Briefcase`)
29
+ - Application (`NotePencil`)
30
+ - Documents (`FolderOpen`) -> Credentialing, Financial
31
+ - Time Entry (`Clock`)
32
+ - Travel (`Airplane`)
33
+ - `locumsmart`:
34
+ - Dashboard (`Layout`)
35
+ - Workflow (`FolderOpen`)
36
+ - CRM (`Users`)
37
+ - Analytics (`ChartBar`)
38
+ - Administration (`BuildingApartment`)
39
+ - `modio`:
40
+ - Dashboard (`Layout`)
41
+ - Reports (`FolderOpen`)
42
+ - Providers (`Users`)
43
+ - Facilities (`Buildings`)
44
+ - Payors (`Wallet`)
45
+ - Tracking (`GpsFix`)
46
+ - `connect`:
47
+ - Dashboard (`Layout`)
48
+ - Requests (`Briefcase`)
49
+ - Providers (`Users`)
50
+ - Calendar (`CalendarBlank`)
51
+ - Invoices (`Invoice`)
52
+ - Reporting (`ChartBar`)
53
+ - `wireframe`:
54
+ - Five placeholder links labeled `Menu Item`.
55
+
56
+ Output guidance:
57
+ - Return code that imports UDS components directly from package exports.
58
+ - Prefer `Flex`, `Container`, `Card`, `Text`, `Button`, `Menu`, `Toolbar`, `Statistics`, and `Checklist` where appropriate.
59
+ - Ensure no Tailwind tokens/classes appear anywhere in source.
@@ -0,0 +1,33 @@
1
+ You are generating UI JSON for `@mich8060/unified-design-system`.
2
+
3
+ Contract discovery order:
4
+ - `@mich8060/unified-design-system/ai/discovery.json`
5
+ - `@mich8060/unified-design-system/ai/manifest.json`
6
+ - `@mich8060/unified-design-system/ai/schema`
7
+ - `@mich8060/unified-design-system/ai/icons`
8
+ - `@mich8060/unified-design-system/ai/templates`
9
+
10
+ Hard constraints:
11
+ - Return JSON only.
12
+ - Use only components from `ai/manifest/components.manifest.ts`.
13
+ - Use spacing tokens from `ai/manifest/layout.manifest.ts`.
14
+ - Use semantic token intents from `ai/manifest/tokens.intent.manifest.ts`.
15
+ - Resolve UI intents using `ai/manifest/intent-mappings.manifest.ts` before freeform composition.
16
+ - Respect governance limits from `ai/manifest/governance.manifest.ts`.
17
+ - Use icon names from the icon catalog (`ai/icons/catalog.json`) when adding icons.
18
+ - Maximum one primary button per section.
19
+ - No raw HTML tags.
20
+ - No inline styles.
21
+ - Never create custom CSS variables (no `--brand-*`, `--foo-*`, etc.).
22
+ - Only use `--uds-*` variables (for example `--uds-spacing-16`, `var(--uds-text-primary)`) or hardcoded literal values.
23
+ - Never use deep component imports (`@/.../components/*`) in generated guidance/output.
24
+ - Reject non-UDS prop APIs (for example `Menu.items`, `Flex.vertical`, `Button.type`).
25
+
26
+ Output contract:
27
+ {
28
+ "manifestVersion": "...",
29
+ "governanceVersion": "...",
30
+ "policyVersion": "...",
31
+ "tree": {...},
32
+ "audit": {...}
33
+ }
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I={SCHEMA_NODE_OBJECT:"Return each tree node as an object with type/props/children keys.",SCHEMA_NODE_TYPE:"Set node.type to a non-empty UDS component name.",SCHEMA_NODE_PROPS:"Provide node.props as a plain object.",SCHEMA_NODE_CHILDREN:"Provide node.children as an array of child nodes.",RULE_UNKNOWN_COMPONENT:"Replace unknown components with supported UDS components.",RULE_RAW_HTML_DISALLOWED:"Use UDS components instead of raw HTML tags.",RULE_INVALID_COMPOSITION:"Use only allowed child components for the parent component.",RULE_INVALID_PARENT_COMPOSITION:"Move the component under one of its allowed parent components.",RULE_DISALLOWED_NESTING:"Remove or refactor disallowed parent/child nesting.",RULE_MAX_PRIMARY_ACTIONS:"Keep at most one primary Button per section.",RULE_SPACING_TOKEN_ONLY:"Use --uds-spacing-* tokens for spacing-related props.",RULE_UNKNOWN_SPACING_TOKEN:"Replace unknown spacing token with an allowed spacing token.",RULE_CUSTOM_CSS_VAR_DISALLOWED:"Use only --uds-* CSS variables or hardcoded literals.",RULE_CSS_VAR_DEFINITION_DISALLOWED:"Do not define CSS custom properties in generated output.",RULE_TAILWIND_CLASS_DISALLOWED:"Remove Tailwind utilities and use UDS components/tokens instead.",RULE_AMBIGUOUS_PROP_ALIAS:"Replace ambiguous alias props with canonical prop names.",RULE_VERSION_MISMATCH_MANIFESTVERSION:"Set manifestVersion to the current manifest contract version.",RULE_VERSION_MISMATCH_GOVERNANCEVERSION:"Set governanceVersion to the current governance version.",RULE_VERSION_MISMATCH_POLICYVERSION:"Set policyVersion to the current policy version.",RULE_MAX_NESTING_DEPTH:"Reduce UI nesting depth to stay within governance limits.",RULE_INLINE_STYLE_DISALLOWED:"Remove inline styles and use tokenized component props.",DRIFT_UNKNOWN_COMPONENT:"Align with ComponentRegistry component names.",DRIFT_DISALLOWED_NESTING:"Align nesting with layout disallowed pair rules.",DRIFT_MARGIN_USAGE:"Replace margin usage with composition spacing tokens.",DRIFT_INLINE_STYLE:"Replace inline style usage with UDS tokenized styling.",DRIFT_UNKNOWN_TOKEN:"Use a known token from the published UDS token contract.",DRIFT_HARDCODED_COLOR:"Replace color literals with semantic UDS tokens."},r=(e,t)=>String(e??"").localeCompare(String(t??"")),c=e=>[e.severity,e.code,e.path,e.component??"",e.token??"",e.message].join("|"),E=e=>{let t=2166136261;for(let i=0;i<e.length;i+=1)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")};function N(e){const t=[...e].sort((n,o)=>{const s=r(n.severity,o.severity);if(s!==0)return s;const p=r(n.code,o.code);if(p!==0)return p;const _=r(n.path,o.path);if(_!==0)return _;const d=r(n.component,o.component);if(d!==0)return d;const S=r(n.token,o.token);return S!==0?S:r(n.message,o.message)}),i=[],a=new Set;for(const n of t){const o=c(n);a.has(o)||(a.add(o),i.push(n))}return i}function l(e){const t=N(e),i=t.map(c).join("||"),a=`fb-${E(i)}`,n=t.map(s=>({id:`${s.code}:${s.path}:${E(c(s))}`,code:s.code,path:s.path,message:s.message,fix:I[s.code]??"Apply governance-compliant correction for this violation.",severity:s.severity})),o=`${n.length} deterministic violation(s)`;return{fingerprint:a,summary:o,items:n}}exports.buildDeterministicFeedback=l;exports.sortAndDedupeViolations=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R={SCHEMA_NODE_OBJECT:"Return each tree node as an object with type/props/children keys.",SCHEMA_NODE_TYPE:"Set node.type to a non-empty UDS component name.",SCHEMA_NODE_PROPS:"Provide node.props as a plain object.",SCHEMA_NODE_CHILDREN:"Provide node.children as an array of child nodes.",RULE_UNKNOWN_COMPONENT:"Replace unknown components with supported UDS components.",RULE_RAW_HTML_DISALLOWED:"Use UDS components instead of raw HTML tags.",RULE_INVALID_COMPOSITION:"Use only allowed child components for the parent component.",RULE_INVALID_PARENT_COMPOSITION:"Move the component under one of its allowed parent components.",RULE_DISALLOWED_NESTING:"Remove or refactor disallowed parent/child nesting.",RULE_MAX_PRIMARY_ACTIONS:"Keep at most one primary Button per section.",RULE_SPACING_TOKEN_ONLY:"Use --uds-spacing-* tokens for spacing-related props.",RULE_UNKNOWN_SPACING_TOKEN:"Replace unknown spacing token with an allowed spacing token.",RULE_CUSTOM_CSS_VAR_DISALLOWED:"Use only --uds-* CSS variables or hardcoded literals.",RULE_CSS_VAR_DEFINITION_DISALLOWED:"Do not define CSS custom properties in generated output.",RULE_TAILWIND_CLASS_DISALLOWED:"Remove Tailwind utilities and use UDS components/tokens instead.",RULE_FORBIDDEN_PROP:"Replace forbidden props with UDS canonical contract props for that component.",RULE_AMBIGUOUS_PROP_ALIAS:"Replace ambiguous alias props with canonical prop names.",RULE_VERSION_MISMATCH_MANIFESTVERSION:"Set manifestVersion to the current manifest contract version.",RULE_VERSION_MISMATCH_GOVERNANCEVERSION:"Set governanceVersion to the current governance version.",RULE_VERSION_MISMATCH_POLICYVERSION:"Set policyVersion to the current policy version.",RULE_MAX_NESTING_DEPTH:"Reduce UI nesting depth to stay within governance limits.",RULE_INLINE_STYLE_DISALLOWED:"Remove inline styles and use tokenized component props.",DRIFT_UNKNOWN_COMPONENT:"Align with ComponentRegistry component names.",DRIFT_DISALLOWED_NESTING:"Align nesting with layout disallowed pair rules.",DRIFT_MARGIN_USAGE:"Replace margin usage with composition spacing tokens.",DRIFT_INLINE_STYLE:"Replace inline style usage with UDS tokenized styling.",DRIFT_UNKNOWN_TOKEN:"Use a known token from the published UDS token contract.",DRIFT_HARDCODED_COLOR:"Replace color literals with semantic UDS tokens."},r=(e,t)=>String(e??"").localeCompare(String(t??"")),c=e=>[e.severity,e.code,e.path,e.component??"",e.token??"",e.message].join("|"),E=e=>{let t=2166136261;for(let i=0;i<e.length;i+=1)t^=e.charCodeAt(i),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")};function N(e){const t=[...e].sort((n,o)=>{const s=r(n.severity,o.severity);if(s!==0)return s;const p=r(n.code,o.code);if(p!==0)return p;const _=r(n.path,o.path);if(_!==0)return _;const d=r(n.component,o.component);if(d!==0)return d;const S=r(n.token,o.token);return S!==0?S:r(n.message,o.message)}),i=[],a=new Set;for(const n of t){const o=c(n);a.has(o)||(a.add(o),i.push(n))}return i}function l(e){const t=N(e),i=t.map(c).join("||"),a=`fb-${E(i)}`,n=t.map(s=>({id:`${s.code}:${s.path}:${E(c(s))}`,code:s.code,path:s.path,message:s.message,fix:R[s.code]??"Apply governance-compliant correction for this violation.",severity:s.severity})),o=`${n.length} deterministic violation(s)`;return{fingerprint:a,summary:o,items:n}}exports.buildDeterministicFeedback=l;exports.sortAndDedupeViolations=N;
@@ -1 +1 @@
1
- const N={SCHEMA_NODE_OBJECT:"Return each tree node as an object with type/props/children keys.",SCHEMA_NODE_TYPE:"Set node.type to a non-empty UDS component name.",SCHEMA_NODE_PROPS:"Provide node.props as a plain object.",SCHEMA_NODE_CHILDREN:"Provide node.children as an array of child nodes.",RULE_UNKNOWN_COMPONENT:"Replace unknown components with supported UDS components.",RULE_RAW_HTML_DISALLOWED:"Use UDS components instead of raw HTML tags.",RULE_INVALID_COMPOSITION:"Use only allowed child components for the parent component.",RULE_INVALID_PARENT_COMPOSITION:"Move the component under one of its allowed parent components.",RULE_DISALLOWED_NESTING:"Remove or refactor disallowed parent/child nesting.",RULE_MAX_PRIMARY_ACTIONS:"Keep at most one primary Button per section.",RULE_SPACING_TOKEN_ONLY:"Use --uds-spacing-* tokens for spacing-related props.",RULE_UNKNOWN_SPACING_TOKEN:"Replace unknown spacing token with an allowed spacing token.",RULE_CUSTOM_CSS_VAR_DISALLOWED:"Use only --uds-* CSS variables or hardcoded literals.",RULE_CSS_VAR_DEFINITION_DISALLOWED:"Do not define CSS custom properties in generated output.",RULE_TAILWIND_CLASS_DISALLOWED:"Remove Tailwind utilities and use UDS components/tokens instead.",RULE_AMBIGUOUS_PROP_ALIAS:"Replace ambiguous alias props with canonical prop names.",RULE_VERSION_MISMATCH_MANIFESTVERSION:"Set manifestVersion to the current manifest contract version.",RULE_VERSION_MISMATCH_GOVERNANCEVERSION:"Set governanceVersion to the current governance version.",RULE_VERSION_MISMATCH_POLICYVERSION:"Set policyVersion to the current policy version.",RULE_MAX_NESTING_DEPTH:"Reduce UI nesting depth to stay within governance limits.",RULE_INLINE_STYLE_DISALLOWED:"Remove inline styles and use tokenized component props.",DRIFT_UNKNOWN_COMPONENT:"Align with ComponentRegistry component names.",DRIFT_DISALLOWED_NESTING:"Align nesting with layout disallowed pair rules.",DRIFT_MARGIN_USAGE:"Replace margin usage with composition spacing tokens.",DRIFT_INLINE_STYLE:"Replace inline style usage with UDS tokenized styling.",DRIFT_UNKNOWN_TOKEN:"Use a known token from the published UDS token contract.",DRIFT_HARDCODED_COLOR:"Replace color literals with semantic UDS tokens."},i=(e,t)=>String(e??"").localeCompare(String(t??"")),c=e=>[e.severity,e.code,e.path,e.component??"",e.token??"",e.message].join("|"),E=e=>{let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")};function I(e){const t=[...e].sort((n,o)=>{const s=i(n.severity,o.severity);if(s!==0)return s;const p=i(n.code,o.code);if(p!==0)return p;const _=i(n.path,o.path);if(_!==0)return _;const S=i(n.component,o.component);if(S!==0)return S;const d=i(n.token,o.token);return d!==0?d:i(n.message,o.message)}),r=[],a=new Set;for(const n of t){const o=c(n);a.has(o)||(a.add(o),r.push(n))}return r}function R(e){const t=I(e),r=t.map(c).join("||"),a=`fb-${E(r)}`,n=t.map(s=>({id:`${s.code}:${s.path}:${E(c(s))}`,code:s.code,path:s.path,message:s.message,fix:N[s.code]??"Apply governance-compliant correction for this violation.",severity:s.severity})),o=`${n.length} deterministic violation(s)`;return{fingerprint:a,summary:o,items:n}}export{R as buildDeterministicFeedback,I as sortAndDedupeViolations};
1
+ const N={SCHEMA_NODE_OBJECT:"Return each tree node as an object with type/props/children keys.",SCHEMA_NODE_TYPE:"Set node.type to a non-empty UDS component name.",SCHEMA_NODE_PROPS:"Provide node.props as a plain object.",SCHEMA_NODE_CHILDREN:"Provide node.children as an array of child nodes.",RULE_UNKNOWN_COMPONENT:"Replace unknown components with supported UDS components.",RULE_RAW_HTML_DISALLOWED:"Use UDS components instead of raw HTML tags.",RULE_INVALID_COMPOSITION:"Use only allowed child components for the parent component.",RULE_INVALID_PARENT_COMPOSITION:"Move the component under one of its allowed parent components.",RULE_DISALLOWED_NESTING:"Remove or refactor disallowed parent/child nesting.",RULE_MAX_PRIMARY_ACTIONS:"Keep at most one primary Button per section.",RULE_SPACING_TOKEN_ONLY:"Use --uds-spacing-* tokens for spacing-related props.",RULE_UNKNOWN_SPACING_TOKEN:"Replace unknown spacing token with an allowed spacing token.",RULE_CUSTOM_CSS_VAR_DISALLOWED:"Use only --uds-* CSS variables or hardcoded literals.",RULE_CSS_VAR_DEFINITION_DISALLOWED:"Do not define CSS custom properties in generated output.",RULE_TAILWIND_CLASS_DISALLOWED:"Remove Tailwind utilities and use UDS components/tokens instead.",RULE_FORBIDDEN_PROP:"Replace forbidden props with UDS canonical contract props for that component.",RULE_AMBIGUOUS_PROP_ALIAS:"Replace ambiguous alias props with canonical prop names.",RULE_VERSION_MISMATCH_MANIFESTVERSION:"Set manifestVersion to the current manifest contract version.",RULE_VERSION_MISMATCH_GOVERNANCEVERSION:"Set governanceVersion to the current governance version.",RULE_VERSION_MISMATCH_POLICYVERSION:"Set policyVersion to the current policy version.",RULE_MAX_NESTING_DEPTH:"Reduce UI nesting depth to stay within governance limits.",RULE_INLINE_STYLE_DISALLOWED:"Remove inline styles and use tokenized component props.",DRIFT_UNKNOWN_COMPONENT:"Align with ComponentRegistry component names.",DRIFT_DISALLOWED_NESTING:"Align nesting with layout disallowed pair rules.",DRIFT_MARGIN_USAGE:"Replace margin usage with composition spacing tokens.",DRIFT_INLINE_STYLE:"Replace inline style usage with UDS tokenized styling.",DRIFT_UNKNOWN_TOKEN:"Use a known token from the published UDS token contract.",DRIFT_HARDCODED_COLOR:"Replace color literals with semantic UDS tokens."},i=(e,t)=>String(e??"").localeCompare(String(t??"")),c=e=>[e.severity,e.code,e.path,e.component??"",e.token??"",e.message].join("|"),E=e=>{let t=2166136261;for(let r=0;r<e.length;r+=1)t^=e.charCodeAt(r),t=Math.imul(t,16777619);return(t>>>0).toString(16).padStart(8,"0")};function R(e){const t=[...e].sort((n,o)=>{const s=i(n.severity,o.severity);if(s!==0)return s;const p=i(n.code,o.code);if(p!==0)return p;const _=i(n.path,o.path);if(_!==0)return _;const S=i(n.component,o.component);if(S!==0)return S;const d=i(n.token,o.token);return d!==0?d:i(n.message,o.message)}),r=[],a=new Set;for(const n of t){const o=c(n);a.has(o)||(a.add(o),r.push(n))}return r}function I(e){const t=R(e),r=t.map(c).join("||"),a=`fb-${E(r)}`,n=t.map(s=>({id:`${s.code}:${s.path}:${E(c(s))}`,code:s.code,path:s.path,message:s.message,fix:N[s.code]??"Apply governance-compliant correction for this violation.",severity:s.severity})),o=`${n.length} deterministic violation(s)`;return{fingerprint:a,summary:o,items:n}}export{I as buildDeterministicFeedback,R as sortAndDedupeViolations};