@mich8060/unified-design-system 0.2.11 → 0.2.14
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.
- package/README.md +8 -0
- package/dist/ai/audit/auditLogger.cjs +2 -0
- package/dist/ai/audit/auditLogger.js +2 -0
- package/dist/ai/discovery.json +33 -0
- package/dist/ai/examples/index.cjs +1 -0
- package/dist/ai/examples/index.js +1 -0
- package/dist/ai/examples/training.examples.cjs +1 -0
- package/dist/ai/examples/training.examples.js +1 -0
- package/dist/ai/examples/trees.example.cjs +1 -0
- package/dist/ai/examples/trees.example.js +1 -0
- package/dist/ai/examples/validation-run.example.cjs +1 -0
- package/dist/ai/examples/validation-run.example.js +1 -0
- package/dist/ai/index.cjs +1 -0
- package/dist/ai/index.js +1 -0
- package/dist/ai/manifest/components.manifest.cjs +1 -0
- package/dist/ai/manifest/components.manifest.js +1 -0
- package/dist/ai/manifest/composition.manifest.cjs +1 -0
- package/dist/ai/manifest/composition.manifest.js +1 -0
- package/dist/ai/manifest/governance.manifest.cjs +1 -0
- package/dist/ai/manifest/governance.manifest.js +1 -0
- package/dist/ai/manifest/index.cjs +1 -0
- package/dist/ai/manifest/index.js +1 -0
- package/dist/ai/manifest/layout.manifest.cjs +1 -0
- package/dist/ai/manifest/layout.manifest.js +1 -0
- package/dist/ai/manifest/patterns.manifest.cjs +1 -0
- package/dist/ai/manifest/patterns.manifest.js +1 -0
- package/dist/ai/manifest/prop-aliases.manifest.cjs +1 -0
- package/dist/ai/manifest/prop-aliases.manifest.js +1 -0
- package/dist/ai/manifest/system.manifest.cjs +1 -0
- package/dist/ai/manifest/system.manifest.js +1 -0
- package/dist/ai/manifest/tokens.intent.manifest.cjs +1 -0
- package/dist/ai/manifest/tokens.intent.manifest.js +1 -0
- package/dist/ai/manifest.json +2801 -0
- package/dist/ai/policies/policy.engine.cjs +1 -0
- package/dist/ai/policies/policy.engine.js +1 -0
- package/dist/ai/policies/rules/accessibility.rules.cjs +1 -0
- package/dist/ai/policies/rules/accessibility.rules.js +1 -0
- package/dist/ai/policies/rules/action.rules.cjs +1 -0
- package/dist/ai/policies/rules/action.rules.js +1 -0
- package/dist/ai/policies/rules/composition.rules.cjs +1 -0
- package/dist/ai/policies/rules/composition.rules.js +1 -0
- package/dist/ai/policies/rules/props.rules.cjs +1 -0
- package/dist/ai/policies/rules/props.rules.js +1 -0
- package/dist/ai/policies/rules/spacing.rules.cjs +1 -0
- package/dist/ai/policies/rules/spacing.rules.js +1 -0
- package/dist/ai/schemas/ai-output.schema.json +71 -0
- package/dist/ai/sdk/index.cjs +1 -0
- package/dist/ai/sdk/index.js +1 -0
- package/dist/ai/sdk/runtime-sdk.cjs +2 -0
- package/dist/ai/sdk/runtime-sdk.js +2 -0
- package/dist/ai/telemetry/usageMetrics.cjs +1 -0
- package/dist/ai/telemetry/usageMetrics.js +1 -0
- package/dist/ai/templates/layouts.json +181 -0
- package/dist/ai/validation/deterministicFeedback.cjs +1 -0
- package/dist/ai/validation/deterministicFeedback.js +1 -0
- package/dist/ai/validation/driftDetection.cjs +1 -0
- package/dist/ai/validation/driftDetection.js +1 -0
- package/dist/ai/validation/index.cjs +1 -0
- package/dist/ai/validation/index.js +1 -0
- package/dist/ai/validation/schemaValidation.cjs +1 -0
- package/dist/ai/validation/schemaValidation.js +1 -0
- package/dist/ai/validation/validateAIOutput.cjs +1 -0
- package/dist/ai/validation/validateAIOutput.js +1 -0
- package/dist/ai/validation/validateTree.cjs +1 -0
- package/dist/ai/validation/validateTree.js +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.js +1 -1
- package/dist/components/Dialog/Dialog.cjs +1 -1
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/DotStatus/DotStatus.cjs +1 -1
- package/dist/components/DotStatus/DotStatus.js +1 -1
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.js +1 -1
- package/dist/components/Field/Field.cjs +1 -1
- package/dist/components/Field/Field.js +1 -1
- package/dist/components/FileUpload/FileUpload.cjs +1 -1
- package/dist/components/FileUpload/FileUpload.js +1 -1
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.js +1 -1
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Pagination/Pagination.cjs +1 -1
- package/dist/components/Pagination/Pagination.js +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.cjs +1 -1
- package/dist/components/ProgressCircle/ProgressCircle.js +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.cjs +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.js +1 -1
- package/dist/components/Steps/Steps.cjs +1 -1
- package/dist/components/Steps/Steps.js +1 -1
- package/dist/components/Text/Text.cjs +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/design-system/ai/audit/audit.types.d.ts +23 -0
- package/dist/design-system/ai/audit/auditLogger.d.ts +2 -0
- package/dist/design-system/ai/examples/index.d.ts +4 -0
- package/dist/design-system/ai/examples/training.examples.d.ts +22 -0
- package/dist/design-system/ai/examples/trees.example.d.ts +3 -0
- package/dist/design-system/ai/examples/validation-run.example.d.ts +3 -0
- package/dist/design-system/ai/index.d.ts +45 -0
- package/dist/design-system/ai/manifest/components.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/composition.manifest.d.ts +11 -0
- package/dist/design-system/ai/manifest/governance.manifest.d.ts +10 -0
- package/dist/design-system/ai/manifest/index.d.ts +9 -0
- package/dist/design-system/ai/manifest/layout.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/patterns.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/prop-aliases.manifest.d.ts +10 -0
- package/dist/design-system/ai/manifest/system.manifest.d.ts +5 -0
- package/dist/design-system/ai/manifest/tokens.intent.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/types.d.ts +136 -0
- package/dist/design-system/ai/policies/policy.engine.d.ts +3 -0
- package/dist/design-system/ai/policies/policy.types.d.ts +14 -0
- package/dist/design-system/ai/policies/rules/accessibility.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/action.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/composition.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/props.rules.d.ts +2 -0
- package/dist/design-system/ai/policies/rules/spacing.rules.d.ts +2 -0
- package/dist/design-system/ai/sdk/index.d.ts +1 -0
- package/dist/design-system/ai/sdk/runtime-sdk.d.ts +21 -0
- package/dist/design-system/ai/telemetry/usageMetrics.d.ts +9 -0
- package/dist/design-system/ai/validation/deterministicFeedback.d.ts +15 -0
- package/dist/design-system/ai/validation/driftDetection.d.ts +3 -0
- package/dist/design-system/ai/validation/index.d.ts +5 -0
- package/dist/design-system/ai/validation/schemaValidation.d.ts +7 -0
- package/dist/design-system/ai/validation/validateAIOutput.d.ts +25 -0
- package/dist/design-system/ai/validation/validateTree.d.ts +2 -0
- package/dist/design-system/components/Button/Button.d.ts +1 -1
- package/dist/design-system/components/Button/Button.types.d.ts +1 -0
- package/dist/design-system/components/Chip/Chip.d.ts +4 -3
- package/dist/design-system/components/Chip/Chip.types.d.ts +13 -9
- package/dist/design-system/components/Dialog/Dialog.types.d.ts +9 -8
- package/dist/design-system/components/Field/Field.d.ts +1 -1
- package/dist/design-system/components/Field/Field.types.d.ts +11 -9
- package/dist/design-system/components/FileUpload/FileUpload.d.ts +1 -1
- package/dist/design-system/components/FileUpload/FileUpload.types.d.ts +2 -0
- package/dist/design-system/components/Pagination/Pagination.d.ts +5 -3
- package/dist/design-system/components/Pagination/Pagination.types.d.ts +4 -1
- package/dist/design-system/components/ProgressCircle/ProgressCircle.d.ts +3 -2
- package/dist/design-system/components/ProgressCircle/ProgressCircle.types.d.ts +7 -3
- package/dist/design-system/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/dist/design-system/components/ProgressIndicator/ProgressIndicator.types.d.ts +8 -4
- package/dist/design-system/components/Tooltip/Tooltip.d.ts +1 -1
- package/dist/design-system/components/Tooltip/Tooltip.types.d.ts +1 -0
- package/dist/design-system/generated/component-api.d.ts +1568 -0
- package/dist/design-system/index.d.ts +1 -2
- package/dist/design-system/tokens/runtime/color.d.ts +40 -0
- package/dist/design-system/tokens/runtime/generateCss.d.ts +2 -0
- package/dist/design-system/tokens/runtime/index.d.ts +476 -0
- package/dist/design-system/tokens/runtime/motion.d.ts +14 -0
- package/dist/design-system/tokens/runtime/radius.d.ts +14 -0
- package/dist/design-system/tokens/runtime/shadow.d.ts +22 -0
- package/dist/design-system/tokens/runtime/spacing.d.ts +21 -0
- package/dist/design-system/tokens/runtime/types.d.ts +21 -0
- package/dist/design-system/tokens/runtime/typography.d.ts +87 -0
- package/dist/design-system/version.d.ts +1 -0
- package/dist/generated/component-api.cjs +1 -0
- package/dist/generated/component-api.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/runtime/color.cjs +1 -0
- package/dist/tokens/runtime/color.js +1 -0
- package/dist/tokens/runtime/index.cjs +1 -0
- package/dist/tokens/runtime/index.js +1 -0
- package/dist/tokens/runtime/radius.cjs +1 -0
- package/dist/tokens/runtime/radius.js +1 -0
- package/dist/tokens/runtime/spacing.cjs +1 -0
- package/dist/tokens/runtime/spacing.js +1 -0
- package/dist/version.cjs +1 -0
- package/dist/version.js +1 -0
- package/package.json +74 -14
- package/dist/components/PillToggle/PillToggle.cjs +0 -1
- package/dist/components/PillToggle/PillToggle.js +0 -1
- package/dist/components/Playground/Playground.cjs +0 -9
- package/dist/components/Playground/Playground.js +0 -9
- package/dist/components/Text/Text.spec.cjs +0 -1
- package/dist/components/Text/Text.spec.js +0 -1
- package/dist/design-system/components/PillToggle/PillToggle.d.ts +0 -13
- package/dist/design-system/components/PillToggle/PillToggle.types.d.ts +0 -9
- package/dist/design-system/components/PillToggle/index.d.ts +0 -3
- package/dist/design-system/components/Playground/Playground.d.ts +0 -12
- package/dist/design-system/components/Playground/Playground.types.d.ts +0 -7
- package/dist/design-system/components/Playground/index.d.ts +0 -3
- package/dist/design-system/components/Text/Text.spec.d.ts +0 -2
- package/dist/design-system/specs/spec.types.d.ts +0 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../manifest/governance.manifest.cjs"),o=require("./rules/composition.rules.cjs"),c=require("./rules/action.rules.cjs"),s=require("./rules/spacing.rules.cjs"),t=require("./rules/accessibility.rules.cjs"),u=require("./rules/props.rules.cjs"),l=[o.enforceCompositionRule,c.enforcePrimaryActionLimitRule,s.enforceSpacingTokenRule,t.enforceAccessibilityRule,u.enforceCanonicalPropsRule];function a(e,n=i.UDSGovernance){return l.flatMap(r=>r({tree:e,governanceConfig:n}))}exports.runPolicyEngine=a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{UDSGovernance as i}from"../manifest/governance.manifest.js";import{enforceCompositionRule as n}from"./rules/composition.rules.js";import{enforcePrimaryActionLimitRule as m}from"./rules/action.rules.js";import{enforceSpacingTokenRule as t}from"./rules/spacing.rules.js";import{enforceAccessibilityRule as c}from"./rules/accessibility.rules.js";import{enforceCanonicalPropsRule as f}from"./rules/props.rules.js";const p=[n,m,t,c,f];function y(o,r=i){return p.flatMap(e=>e({tree:o,governanceConfig:r}))}export{y as runPolicyEngine};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=({tree:c,governanceConfig:s})=>{const l=[],i=(e,t,n)=>{var r,o;n>s.limits.maxNestingDepth&&l.push({severity:"error",code:"RULE_MAX_NESTING_DEPTH",message:`Maximum nesting depth ${s.limits.maxNestingDepth} exceeded.`,path:t,component:e.type}),(((r=e.props)==null?void 0:r.style)!=null||((o=e.props)==null?void 0:o.inlineStyle)!=null)&&!s.enforcement.allowInlineStyles&&l.push({severity:"error",code:"RULE_INLINE_STYLE_DISALLOWED",message:"Inline style values are disallowed by governance policy.",path:t,component:e.type}),(e.children??[]).forEach((y,a)=>i(y,`${t}.children[${a}]`,n+1))};return i(c,"root",0),l};exports.enforceAccessibilityRule=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const m=({tree:c,governanceConfig:s})=>{const l=[],i=(e,t,n)=>{var r,o;n>s.limits.maxNestingDepth&&l.push({severity:"error",code:"RULE_MAX_NESTING_DEPTH",message:`Maximum nesting depth ${s.limits.maxNestingDepth} exceeded.`,path:t,component:e.type}),(((r=e.props)==null?void 0:r.style)!=null||((o=e.props)==null?void 0:o.inlineStyle)!=null)&&!s.enforcement.allowInlineStyles&&l.push({severity:"error",code:"RULE_INLINE_STYLE_DISALLOWED",message:"Inline style values are disallowed by governance policy.",path:t,component:e.type}),(e.children??[]).forEach((y,p)=>i(y,`${t}.children[${p}]`,n+1))};return i(c,"root",0),l};export{m as enforceAccessibilityRule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=(r,t)=>r==="Button"&&String((t==null?void 0:t.appearance)??"primary")==="primary",n=({tree:r,governanceConfig:t})=>{let i=0;const o=e=>{a(e.type,e.props)&&(i+=1),(e.children??[]).forEach(o)};return o(r),i<=t.limits.maxPrimaryActionsPerSection?[]:[{severity:"error",code:"RULE_MAX_PRIMARY_ACTIONS",message:`Expected at most ${t.limits.maxPrimaryActionsPerSection} primary action, found ${i}.`,path:"root",component:"Button"}]};exports.enforcePrimaryActionLimitRule=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=(r,t)=>r==="Button"&&String((t==null?void 0:t.appearance)??"primary")==="primary",o=({tree:r,governanceConfig:t})=>{let i=0;const a=e=>{n(e.type,e.props)&&(i+=1),(e.children??[]).forEach(a)};return a(r),i<=t.limits.maxPrimaryActionsPerSection?[]:[{severity:"error",code:"RULE_MAX_PRIMARY_ACTIONS",message:`Expected at most ${t.limits.maxPrimaryActionsPerSection} primary action, found ${i}.`,path:"root",component:"Button"}]};export{o as enforcePrimaryActionLimitRule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../../manifest/components.manifest.cjs"),r=require("../../manifest/composition.manifest.cjs"),f=new Set(["div","span","button","input","textarea","select","option","label","ul","li","section","article","header","footer","main","nav","form"]),R=({tree:m,governanceConfig:c})=>{const n=[],y=(e,t)=>r.CompositionRules.disallowedPairs.some(o=>o.parent===e&&o.child===t),p=(e,t,o)=>{const u=!!w.ComponentRegistry[e.type],d=f.has(e.type);if(!u&&!c.enforcement.allowUnknownComponents&&n.push({severity:"error",code:"RULE_UNKNOWN_COMPONENT",message:`Unknown component "${e.type}" is not allowed in governed mode.`,path:t,component:e.type}),d&&!c.enforcement.allowAdHocValues&&n.push({severity:"error",code:"RULE_RAW_HTML_DISALLOWED",message:`Raw HTML tag "${e.type}" is disallowed unless policy allows ad-hoc values.`,path:t,component:e.type}),o){const s=r.CompositionRules.allowedParentsByChild[e.type];if(Array.isArray(s)&&!s.includes(o)&&n.push({severity:"error",code:"RULE_INVALID_PARENT_COMPOSITION",message:`${e.type} must be nested under one of: ${s.join(", ")}.`,path:t,component:e.type}),y(o,e.type)){const i=r.CompositionRules.disallowedPairs.find(l=>l.parent===o&&l.child===e.type);n.push({severity:"error",code:"RULE_DISALLOWED_NESTING",message:`${e.type} cannot be nested in ${o}.${i!=null&&i.reason?` ${i.reason}`:""}`,path:t,component:e.type})}}const a=r.CompositionRules.allowedChildrenByParent[e.type];(e.children??[]).forEach((s,i)=>{const l=`${t}.children[${i}]`;Array.isArray(a)&&!a.includes(s.type)&&n.push({severity:"error",code:"RULE_INVALID_COMPOSITION",message:`${s.type} is not an allowed child of ${e.type}. Allowed: ${a.join(", ")}.`,path:l,component:s.type}),p(s,l,e.type)})};return p(m,"root"),n};exports.enforceCompositionRule=R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ComponentRegistry as u}from"../../manifest/components.manifest.js";import{CompositionRules as l}from"../../manifest/composition.manifest.js";const f=new Set(["div","span","button","input","textarea","select","option","label","ul","li","section","article","header","footer","main","nav","form"]),_=({tree:y,governanceConfig:c})=>{const n=[],m=(e,t)=>l.disallowedPairs.some(o=>o.parent===e&&o.child===t),p=(e,t,o)=>{const d=!!u[e.type],w=f.has(e.type);if(!d&&!c.enforcement.allowUnknownComponents&&n.push({severity:"error",code:"RULE_UNKNOWN_COMPONENT",message:`Unknown component "${e.type}" is not allowed in governed mode.`,path:t,component:e.type}),w&&!c.enforcement.allowAdHocValues&&n.push({severity:"error",code:"RULE_RAW_HTML_DISALLOWED",message:`Raw HTML tag "${e.type}" is disallowed unless policy allows ad-hoc values.`,path:t,component:e.type}),o){const s=l.allowedParentsByChild[e.type];if(Array.isArray(s)&&!s.includes(o)&&n.push({severity:"error",code:"RULE_INVALID_PARENT_COMPOSITION",message:`${e.type} must be nested under one of: ${s.join(", ")}.`,path:t,component:e.type}),m(o,e.type)){const r=l.disallowedPairs.find(i=>i.parent===o&&i.child===e.type);n.push({severity:"error",code:"RULE_DISALLOWED_NESTING",message:`${e.type} cannot be nested in ${o}.${r!=null&&r.reason?` ${r.reason}`:""}`,path:t,component:e.type})}}const a=l.allowedChildrenByParent[e.type];(e.children??[]).forEach((s,r)=>{const i=`${t}.children[${r}]`;Array.isArray(a)&&!a.includes(s.type)&&n.push({severity:"error",code:"RULE_INVALID_COMPOSITION",message:`${s.type} is not an allowed child of ${e.type}. Allowed: ${a.join(", ")}.`,path:i,component:s.type}),p(s,i,e.type)})};return p(y,"root"),n};export{_ as enforceCompositionRule};
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../manifest/layout.manifest.cjs"),p=new Set(["gap","spacing","padding","margin","rowGap","columnGap"]),g=({tree:c})=>{const s=[],r=(t,o)=>{const i=t.props??{};Object.entries(i).forEach(([n,e])=>{if(!(!p.has(n)||typeof e!="string")){if(!e.startsWith("--uds-spacing-")){s.push({severity:"error",code:"RULE_SPACING_TOKEN_ONLY",message:`Spacing prop "${n}" must use a --uds-spacing-* token.`,path:`${o}.${n}`,component:t.type});return}a.LayoutRules.spacingSystem.allowedTokens.includes(e)||s.push({severity:"error",code:"RULE_UNKNOWN_SPACING_TOKEN",message:`Unknown spacing token "${e}".`,path:`${o}.${n}`,component:t.type,token:e})}}),(t.children??[]).forEach((n,e)=>r(n,`${o}.children[${e}]`))};return r(c,"root"),s};exports.enforceSpacingTokenRule=g;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LayoutRules as p}from"../../manifest/layout.manifest.js";const a=new Set(["gap","spacing","padding","margin","rowGap","columnGap"]),m=({tree:c})=>{const t=[],r=(s,o)=>{const i=s.props??{};Object.entries(i).forEach(([e,n])=>{if(!(!a.has(e)||typeof n!="string")){if(!n.startsWith("--uds-spacing-")){t.push({severity:"error",code:"RULE_SPACING_TOKEN_ONLY",message:`Spacing prop "${e}" must use a --uds-spacing-* token.`,path:`${o}.${e}`,component:s.type});return}p.spacingSystem.allowedTokens.includes(n)||t.push({severity:"error",code:"RULE_UNKNOWN_SPACING_TOKEN",message:`Unknown spacing token "${n}".`,path:`${o}.${e}`,component:s.type,token:n})}}),(s.children??[]).forEach((e,n)=>r(e,`${o}.children[${n}]`))};return r(c,"root"),t};export{m as enforceSpacingTokenRule};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "UDS AI Output",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"manifestVersion",
|
|
7
|
+
"governanceVersion",
|
|
8
|
+
"policyVersion",
|
|
9
|
+
"tree",
|
|
10
|
+
"audit"
|
|
11
|
+
],
|
|
12
|
+
"properties": {
|
|
13
|
+
"manifestVersion": { "type": "string", "minLength": 1 },
|
|
14
|
+
"governanceVersion": { "type": "string", "minLength": 1 },
|
|
15
|
+
"policyVersion": { "type": "string", "minLength": 1 },
|
|
16
|
+
"tree": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": ["type"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"type": { "type": "string", "minLength": 1 },
|
|
21
|
+
"props": { "type": "object" },
|
|
22
|
+
"children": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "$ref": "#/$defs/node" }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"additionalProperties": true
|
|
28
|
+
},
|
|
29
|
+
"audit": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"required": [
|
|
32
|
+
"timestamp",
|
|
33
|
+
"model",
|
|
34
|
+
"promptHash",
|
|
35
|
+
"udsVersion",
|
|
36
|
+
"manifestVersion",
|
|
37
|
+
"policyVersion",
|
|
38
|
+
"componentsUsed",
|
|
39
|
+
"tokensUsed",
|
|
40
|
+
"violationsCount",
|
|
41
|
+
"validationStatus"
|
|
42
|
+
],
|
|
43
|
+
"properties": {
|
|
44
|
+
"timestamp": { "type": "string" },
|
|
45
|
+
"model": { "type": "string" },
|
|
46
|
+
"promptHash": { "type": "string" },
|
|
47
|
+
"udsVersion": { "type": "string" },
|
|
48
|
+
"manifestVersion": { "type": "string" },
|
|
49
|
+
"policyVersion": { "type": "string" },
|
|
50
|
+
"componentsUsed": { "type": "array", "items": { "type": "string" } },
|
|
51
|
+
"tokensUsed": { "type": "array", "items": { "type": "string" } },
|
|
52
|
+
"violationsCount": { "type": "number", "minimum": 0 },
|
|
53
|
+
"validationStatus": { "type": "string", "enum": ["pass", "fail"] }
|
|
54
|
+
},
|
|
55
|
+
"additionalProperties": true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"$defs": {
|
|
59
|
+
"node": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"required": ["type"],
|
|
62
|
+
"properties": {
|
|
63
|
+
"type": { "type": "string", "minLength": 1 },
|
|
64
|
+
"props": { "type": "object" },
|
|
65
|
+
"children": { "type": "array", "items": { "$ref": "#/$defs/node" } }
|
|
66
|
+
},
|
|
67
|
+
"additionalProperties": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"additionalProperties": true
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./runtime-sdk.cjs");exports.createUDSRuntimeHelperSDK=e.createUDSRuntimeHelperSDK;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createUDSRuntimeHelperSDK as t}from"./runtime-sdk.js";export{t as createUDSRuntimeHelperSDK};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../manifest/components.manifest.cjs"),u=require("../manifest/governance.manifest.cjs"),f=require("../manifest/system.manifest.cjs"),g=require("../manifest/prop-aliases.manifest.cjs"),l=require("../validation/validateAIOutput.cjs");function d(p={}){const s=p.governance??u.UDSGovernance;return{governance:s,getVersionLineage:()=>u.getVersionLineage(),getManifest:()=>f.UDSManifest,getComponent:e=>m.ComponentRegistry[e],canonicalizeProps(e,t){const i={},a={};for(const[n,o]of Object.entries(t)){const r=g.getCanonicalPropName(e,n);i[r]=o,r!==n&&(a[n]=r)}return{canonicalProps:i,aliasesApplied:a}},validate(e){return l.validateAIOutput(e,s)},validateOrThrow(e){var r,c;const t=l.validateAIOutput(e,s);if(t.status==="pass")return t;const i=`Validation failed with ${t.violations.length} error(s).`,a=((r=t.deterministicFeedback)==null?void 0:r.summary)??i,n=(c=t.deterministicFeedback)==null?void 0:c.fingerprint,o=[`[UDS AI SDK] ${a}`];throw n&&o.push(`Fingerprint: ${n}`),new Error(o.join(`
|
|
2
|
+
`))}}}exports.createUDSRuntimeHelperSDK=d;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ComponentRegistry as l}from"../manifest/components.manifest.js";import{UDSGovernance as f,getVersionLineage as g}from"../manifest/governance.manifest.js";import{UDSManifest as u}from"../manifest/system.manifest.js";import{getCanonicalPropName as d}from"../manifest/prop-aliases.manifest.js";import{validateAIOutput as m}from"../validation/validateAIOutput.js";function b(p={}){const s=p.governance??f;return{governance:s,getVersionLineage:()=>g(),getManifest:()=>u,getComponent:e=>l[e],canonicalizeProps(e,n){const i={},o={};for(const[t,a]of Object.entries(n)){const r=d(e,t);i[r]=a,r!==t&&(o[t]=r)}return{canonicalProps:i,aliasesApplied:o}},validate(e){return m(e,s)},validateOrThrow(e){var r,c;const n=m(e,s);if(n.status==="pass")return n;const i=`Validation failed with ${n.violations.length} error(s).`,o=((r=n.deterministicFeedback)==null?void 0:r.summary)??i,t=(c=n.deterministicFeedback)==null?void 0:c.fingerprint,a=[`[UDS AI SDK] ${o}`];throw t&&a.push(`Fingerprint: ${t}`),new Error(a.join(`
|
|
2
|
+
`))}}}export{b as createUDSRuntimeHelperSDK};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={};function s(e){const r=`${e.metricType}:${e.name}`;t[r]=(t[r]??0)+(e.value??1)}function c(){return{...t}}function o(){Object.keys(t).forEach(e=>{delete t[e]})}exports.getUsageMetrics=c;exports.recordUsageMetric=s;exports.resetUsageMetrics=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t={};function n(e){const c=`${e.metricType}:${e.name}`;t[c]=(t[c]??0)+(e.value??1)}function r(){return{...t}}function s(){Object.keys(t).forEach(e=>{delete t[e]})}export{r as getUsageMetrics,n as recordUsageMetric,s as resetUsageMetrics};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractName": "uds.ai.layout-templates",
|
|
3
|
+
"schemaVersion": "1.0.0",
|
|
4
|
+
"templates": [
|
|
5
|
+
{
|
|
6
|
+
"id": "auth-form-card",
|
|
7
|
+
"intent": "Authentication form with one primary action and optional secondary action.",
|
|
8
|
+
"tags": ["form", "auth", "card"],
|
|
9
|
+
"slots": {
|
|
10
|
+
"title": "Sign in",
|
|
11
|
+
"subtitle": "Use your work account",
|
|
12
|
+
"primaryActionLabel": "Sign in",
|
|
13
|
+
"secondaryActionLabel": "Forgot password?"
|
|
14
|
+
},
|
|
15
|
+
"tree": {
|
|
16
|
+
"type": "Container",
|
|
17
|
+
"props": { "gap": "--uds-spacing-24" },
|
|
18
|
+
"children": [
|
|
19
|
+
{
|
|
20
|
+
"type": "Card",
|
|
21
|
+
"children": [
|
|
22
|
+
{ "type": "Text", "props": { "variant": "heading-24", "text": "{{title}}" } },
|
|
23
|
+
{ "type": "Text", "props": { "variant": "body-16", "text": "{{subtitle}}" } },
|
|
24
|
+
{ "type": "Field", "children": [{ "type": "TextInput", "props": { "type": "email" } }] },
|
|
25
|
+
{ "type": "Field", "children": [{ "type": "TextInput", "props": { "type": "password" } }] },
|
|
26
|
+
{
|
|
27
|
+
"type": "Flex",
|
|
28
|
+
"children": [
|
|
29
|
+
{ "type": "Button", "props": { "appearance": "primary", "label": "{{primaryActionLabel}}" } },
|
|
30
|
+
{ "type": "Button", "props": { "appearance": "text", "label": "{{secondaryActionLabel}}" } }
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"constraints": [
|
|
38
|
+
"Keep max one primary Button in the section.",
|
|
39
|
+
"Wrap all form controls with Field."
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"id": "dashboard-table-summary",
|
|
44
|
+
"intent": "Summary header with data table and row actions.",
|
|
45
|
+
"tags": ["dashboard", "table", "summary"],
|
|
46
|
+
"slots": {
|
|
47
|
+
"heading": "Open Requests",
|
|
48
|
+
"primaryActionLabel": "Create request"
|
|
49
|
+
},
|
|
50
|
+
"tree": {
|
|
51
|
+
"type": "Container",
|
|
52
|
+
"props": { "gap": "--uds-spacing-16" },
|
|
53
|
+
"children": [
|
|
54
|
+
{
|
|
55
|
+
"type": "Flex",
|
|
56
|
+
"children": [
|
|
57
|
+
{ "type": "Text", "props": { "variant": "heading-24", "text": "{{heading}}" } },
|
|
58
|
+
{ "type": "Button", "props": { "appearance": "primary", "label": "{{primaryActionLabel}}" } }
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "Table",
|
|
63
|
+
"children": [
|
|
64
|
+
{ "type": "Status", "props": { "variant": "success", "text": "Ready" } },
|
|
65
|
+
{ "type": "Tag", "props": { "color": "blue", "label": "Active" } },
|
|
66
|
+
{ "type": "ActionMenu", "props": { "triggerLabel": "Row actions" } }
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"constraints": [
|
|
72
|
+
"Only use allowed Table children (Tag, Status, Avatar, Button, ActionMenu, ProgressIndicator, DotStatus)."
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"id": "settings-two-column",
|
|
77
|
+
"intent": "Two-column settings page with form area and contextual summary card.",
|
|
78
|
+
"tags": ["settings", "form", "two-column"],
|
|
79
|
+
"slots": {
|
|
80
|
+
"pageTitle": "Account Settings",
|
|
81
|
+
"saveLabel": "Save changes"
|
|
82
|
+
},
|
|
83
|
+
"tree": {
|
|
84
|
+
"type": "Container",
|
|
85
|
+
"props": { "gap": "--uds-spacing-24" },
|
|
86
|
+
"children": [
|
|
87
|
+
{ "type": "Text", "props": { "variant": "heading-24", "text": "{{pageTitle}}" } },
|
|
88
|
+
{
|
|
89
|
+
"type": "Flex",
|
|
90
|
+
"props": { "gap": "--uds-spacing-24" },
|
|
91
|
+
"children": [
|
|
92
|
+
{
|
|
93
|
+
"type": "Card",
|
|
94
|
+
"children": [
|
|
95
|
+
{ "type": "Field", "children": [{ "type": "TextInput", "props": { "type": "text" } }] },
|
|
96
|
+
{ "type": "Field", "children": [{ "type": "Dropdown" }] },
|
|
97
|
+
{ "type": "Button", "props": { "appearance": "primary", "label": "{{saveLabel}}" } }
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "Card",
|
|
102
|
+
"children": [
|
|
103
|
+
{ "type": "Text", "props": { "variant": "body-16", "text": "Changes apply to your profile." } },
|
|
104
|
+
{ "type": "Tag", "props": { "color": "neutral", "label": "Profile" } }
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"constraints": [
|
|
112
|
+
"Avoid multiple primary buttons in the same section.",
|
|
113
|
+
"Use spacing tokens from the governed spacing system."
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "modal-confirmation",
|
|
118
|
+
"intent": "Confirmation flow in modal with primary and dismissive actions.",
|
|
119
|
+
"tags": ["modal", "confirmation", "destructive"],
|
|
120
|
+
"slots": {
|
|
121
|
+
"title": "Delete item?",
|
|
122
|
+
"body": "This action cannot be undone.",
|
|
123
|
+
"confirmLabel": "Delete",
|
|
124
|
+
"cancelLabel": "Cancel"
|
|
125
|
+
},
|
|
126
|
+
"tree": {
|
|
127
|
+
"type": "Modal",
|
|
128
|
+
"children": [
|
|
129
|
+
{ "type": "Text", "props": { "variant": "heading-24", "text": "{{title}}" } },
|
|
130
|
+
{ "type": "Text", "props": { "variant": "body-16", "text": "{{body}}" } },
|
|
131
|
+
{
|
|
132
|
+
"type": "Flex",
|
|
133
|
+
"children": [
|
|
134
|
+
{ "type": "Button", "props": { "appearance": "text", "label": "{{cancelLabel}}" } },
|
|
135
|
+
{ "type": "Button", "props": { "appearance": "destructive", "label": "{{confirmLabel}}" } }
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
"constraints": [
|
|
141
|
+
"Do not nest Modal inside Modal.",
|
|
142
|
+
"Keep one destructive primary-like action."
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "wizard-steps-form",
|
|
147
|
+
"intent": "Multi-step form shell with progress indicator and staged actions.",
|
|
148
|
+
"tags": ["wizard", "steps", "form"],
|
|
149
|
+
"slots": {
|
|
150
|
+
"title": "Create Job Posting",
|
|
151
|
+
"nextLabel": "Next",
|
|
152
|
+
"backLabel": "Back"
|
|
153
|
+
},
|
|
154
|
+
"tree": {
|
|
155
|
+
"type": "Container",
|
|
156
|
+
"children": [
|
|
157
|
+
{ "type": "Text", "props": { "variant": "heading-24", "text": "{{title}}" } },
|
|
158
|
+
{ "type": "Steps" },
|
|
159
|
+
{
|
|
160
|
+
"type": "Card",
|
|
161
|
+
"children": [
|
|
162
|
+
{ "type": "Field", "children": [{ "type": "TextInput", "props": { "type": "text" } }] },
|
|
163
|
+
{ "type": "Field", "children": [{ "type": "Textarea" }] },
|
|
164
|
+
{
|
|
165
|
+
"type": "Flex",
|
|
166
|
+
"children": [
|
|
167
|
+
{ "type": "Button", "props": { "appearance": "text", "label": "{{backLabel}}" } },
|
|
168
|
+
{ "type": "Button", "props": { "appearance": "primary", "label": "{{nextLabel}}" } }
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"constraints": [
|
|
176
|
+
"Fields must contain form controls.",
|
|
177
|
+
"Keep one primary action for each step section."
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m={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_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??"")),a=e=>[e.severity,e.code,e.path,e.component??"",e.token??"",e.message].join("|"),N=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 S(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 d=i(n.component,o.component);if(d!==0)return d;const E=i(n.token,o.token);return E!==0?E:i(n.message,o.message)}),r=[],c=new Set;for(const n of t){const o=a(n);c.has(o)||(c.add(o),r.push(n))}return r}function l(e){const t=S(e),r=t.map(a).join("||"),c=`fb-${N(r)}`,n=t.map(s=>({id:`${s.code}:${s.path}:${N(a(s))}`,code:s.code,path:s.path,message:s.message,fix:m[s.code]??"Apply governance-compliant correction for this violation.",severity:s.severity})),o=`${n.length} deterministic violation(s)`;return{fingerprint:c,summary:o,items:n}}exports.buildDeterministicFeedback=l;exports.sortAndDedupeViolations=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const S={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_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."},c=(e,t)=>String(e??"").localeCompare(String(t??"")),a=e=>[e.severity,e.code,e.path,e.component??"",e.token??"",e.message].join("|"),d=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=c(n.severity,o.severity);if(s!==0)return s;const p=c(n.code,o.code);if(p!==0)return p;const _=c(n.path,o.path);if(_!==0)return _;const E=c(n.component,o.component);if(E!==0)return E;const N=c(n.token,o.token);return N!==0?N:c(n.message,o.message)}),r=[],i=new Set;for(const n of t){const o=a(n);i.has(o)||(i.add(o),r.push(n))}return r}function m(e){const t=R(e),r=t.map(a).join("||"),i=`fb-${d(r)}`,n=t.map(s=>({id:`${s.code}:${s.path}:${d(a(s))}`,code:s.code,path:s.path,message:s.message,fix:S[s.code]??"Apply governance-compliant correction for this violation.",severity:s.severity})),o=`${n.length} deterministic violation(s)`;return{fingerprint:i,summary:o,items:n}}export{m as buildDeterministicFeedback,R as sortAndDedupeViolations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../manifest/components.manifest.cjs"),p=require("../manifest/layout.manifest.cjs"),a=require("../manifest/tokens.intent.manifest.cjs"),f=/#(?:[a-fA-F0-9]{3,8})\b|rgb\(|rgba\(|hsl\(|hsla\(/,y=new Set([...p.LayoutRules.spacingSystem.allowedTokens,...Object.values(a.TokenIntentMap.surface),...Object.values(a.TokenIntentMap.action),...Object.values(a.TokenIntentMap.text),...Object.values(a.TokenIntentMap.border),...Object.values(a.TokenIntentMap.state),"--uds-radius-8","--uds-elevation-overlay"]),i=(l,n,c,t,o,r)=>{l.push({severity:"warning",code:n,message:c,path:t,component:o,token:r})};function T(l){const n=[],c=(t,o,r)=>{d.ComponentRegistry[t.type]||i(n,"DRIFT_UNKNOWN_COMPONENT",`Component "${t.type}" is not in ComponentRegistry.`,o,t.type),r&&p.LayoutRules.disallowedNesting.some(e=>e.parent===r.type&&e.child===t.type)&&i(n,"DRIFT_DISALLOWED_NESTING",`${t.type} nested inside ${r.type} violates layout rules.`,o,t.type);const u=t.props??{};Object.entries(u).forEach(([s,e])=>{s.toLowerCase().startsWith("margin")&&i(n,"DRIFT_MARGIN_USAGE","Margin usage detected. Prefer governed spacing composition tokens.",`${o}.${s}`,t.type),(s==="style"||s==="inlineStyle")&&i(n,"DRIFT_INLINE_STYLE","Inline CSS detected. Use tokenized props or class-based styling.",`${o}.${s}`,t.type),typeof e=="string"&&(e.startsWith("--uds-")&&!y.has(e)&&i(n,"DRIFT_UNKNOWN_TOKEN",`Unknown UDS token "${e}".`,`${o}.${s}`,t.type,e),f.test(e)&&i(n,"DRIFT_HARDCODED_COLOR","Hardcoded color literal detected. Use semantic UDS token values.",`${o}.${s}`,t.type))}),(t.children??[]).forEach((s,e)=>c(s,`${o}.children[${e}]`,t))};return c(l,"root"),n}exports.detectDrift=T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ComponentRegistry as d}from"../manifest/components.manifest.js";import{LayoutRules as p}from"../manifest/layout.manifest.js";import{TokenIntentMap as c}from"../manifest/tokens.intent.manifest.js";const y=/#(?:[a-fA-F0-9]{3,8})\b|rgb\(|rgba\(|hsl\(|hsla\(/,O=new Set([...p.spacingSystem.allowedTokens,...Object.values(c.surface),...Object.values(c.action),...Object.values(c.text),...Object.values(c.border),...Object.values(c.state),"--uds-radius-8","--uds-elevation-overlay"]),n=(l,i,a,t,o,r)=>{l.push({severity:"warning",code:i,message:a,path:t,component:o,token:r})};function m(l){const i=[],a=(t,o,r)=>{d[t.type]||n(i,"DRIFT_UNKNOWN_COMPONENT",`Component "${t.type}" is not in ComponentRegistry.`,o,t.type),r&&p.disallowedNesting.some(e=>e.parent===r.type&&e.child===t.type)&&n(i,"DRIFT_DISALLOWED_NESTING",`${t.type} nested inside ${r.type} violates layout rules.`,o,t.type);const f=t.props??{};Object.entries(f).forEach(([s,e])=>{s.toLowerCase().startsWith("margin")&&n(i,"DRIFT_MARGIN_USAGE","Margin usage detected. Prefer governed spacing composition tokens.",`${o}.${s}`,t.type),(s==="style"||s==="inlineStyle")&&n(i,"DRIFT_INLINE_STYLE","Inline CSS detected. Use tokenized props or class-based styling.",`${o}.${s}`,t.type),typeof e=="string"&&(e.startsWith("--uds-")&&!O.has(e)&&n(i,"DRIFT_UNKNOWN_TOKEN",`Unknown UDS token "${e}".`,`${o}.${s}`,t.type,e),y.test(e)&&n(i,"DRIFT_HARDCODED_COLOR","Hardcoded color literal detected. Use semantic UDS token values.",`${o}.${s}`,t.type))}),(t.children??[]).forEach((s,e)=>a(s,`${o}.children[${e}]`,t))};return a(l,"root"),i}export{m as detectDrift};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./validateTree.cjs"),i=require("./schemaValidation.cjs"),a=require("./driftDetection.cjs"),r=require("./validateAIOutput.cjs"),e=require("./deterministicFeedback.cjs");exports.validateTree=t.validateTree;exports.validateSchema=i.validateSchema;exports.detectDrift=a.detectDrift;exports.validateAIOutput=r.validateAIOutput;exports.buildDeterministicFeedback=e.buildDeterministicFeedback;exports.sortAndDedupeViolations=e.sortAndDedupeViolations;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{validateTree as r}from"./validateTree.js";import{validateSchema as i}from"./schemaValidation.js";import{detectDrift as d}from"./driftDetection.js";import{validateAIOutput as p}from"./validateAIOutput.js";import{buildDeterministicFeedback as l,sortAndDedupeViolations as x}from"./deterministicFeedback.js";export{l as buildDeterministicFeedback,d as detectDrift,x as sortAndDedupeViolations,p as validateAIOutput,i as validateSchema,r as validateTree};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=(r,e,t)=>({severity:"error",code:r,message:e,path:t}),c=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),s=(r,e,t)=>{if(!c(r)){t.push(n("SCHEMA_NODE_OBJECT","Node must be an object.",e));return}if((typeof r.type!="string"||r.type.trim().length===0)&&t.push(n("SCHEMA_NODE_TYPE","Node.type must be a non-empty string.",`${e}.type`)),r.props!=null&&!c(r.props)&&t.push(n("SCHEMA_NODE_PROPS","Node.props must be an object when provided.",`${e}.props`)),r.children!=null&&!Array.isArray(r.children)){t.push(n("SCHEMA_NODE_CHILDREN","Node.children must be an array when provided.",`${e}.children`));return}Array.isArray(r.children)&&r.children.forEach((i,a)=>s(i,`${e}.children[${a}]`,t))};function l(r){const e=[],t=c(r)?r:void 0,i=(t==null?void 0:t.tree)??r;return s(i,"root",e),e.length>0?{valid:!1,violations:e}:{valid:!0,violations:e,tree:i}}exports.validateSchema=l;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=(r,e,t)=>({severity:"error",code:r,message:e,path:t}),s=r=>typeof r=="object"&&r!==null&&!Array.isArray(r),c=(r,e,t)=>{if(!s(r)){t.push(n("SCHEMA_NODE_OBJECT","Node must be an object.",e));return}if((typeof r.type!="string"||r.type.trim().length===0)&&t.push(n("SCHEMA_NODE_TYPE","Node.type must be a non-empty string.",`${e}.type`)),r.props!=null&&!s(r.props)&&t.push(n("SCHEMA_NODE_PROPS","Node.props must be an object when provided.",`${e}.props`)),r.children!=null&&!Array.isArray(r.children)){t.push(n("SCHEMA_NODE_CHILDREN","Node.children must be an array when provided.",`${e}.children`));return}Array.isArray(r.children)&&r.children.forEach((i,o)=>c(i,`${e}.children[${o}]`,t))};function d(r){const e=[],t=s(r)?r:void 0,i=(t==null?void 0:t.tree)??r;return c(i,"root",e),e.length>0?{valid:!1,violations:e}:{valid:!0,violations:e,tree:i}}export{d as validateSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../manifest/governance.manifest.cjs"),k=require("../policies/policy.engine.cjs"),v=require("./driftDetection.cjs"),d=require("./deterministicFeedback.cjs"),S=require("./schemaValidation.cjs"),b=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),g=e=>typeof e=="string"&&e.trim().length>0?e:void 0;function A(e,t){const s=b(e)?e:null;if(!s)return[];const r=[{key:"manifestVersion",expected:t.manifestVersion},{key:"governanceVersion",expected:t.governanceVersion},{key:"policyVersion",expected:t.policyVersion}],n=[];for(const i of r){const o=g(s[i.key]);o&&o!==i.expected&&n.push({severity:"error",code:`RULE_VERSION_MISMATCH_${i.key.toUpperCase()}`,message:`${i.key} "${o}" does not match expected "${i.expected}".`,path:i.key})}return n}function D(e,t=p.UDSGovernance){const s=S.validateSchema(e),r=new Date().toISOString(),n=p.getVersionLineage(),i=[...s.violations],o=[];if(i.push(...A(e,t)),s.tree){const f=k.runPolicyEngine(s.tree,t),h=v.detectDrift(s.tree);for(const a of[...f,...h])a.severity==="error"?i.push(a):o.push(a)}const c=d.sortAndDedupeViolations(i),y=d.sortAndDedupeViolations(o),u=t.enforcement.strictMode,l=c.length>0,V=u&&l?"fail":"pass",m=l?d.buildDeterministicFeedback(c):void 0;return{status:V,violations:c,warnings:y,deterministicFeedback:m,governanceVersionUsed:t.governanceVersion,manifestVersionUsed:t.manifestVersion,policyVersionUsed:t.policyVersion,timestamp:r,versionLineage:n}}exports.validateAIOutput=D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{UDSGovernance as k,getVersionLineage as u}from"../manifest/governance.manifest.js";import{runPolicyEngine as x}from"../policies/policy.engine.js";import{detectDrift as S}from"./driftDetection.js";import{sortAndDedupeViolations as d,buildDeterministicFeedback as v}from"./deterministicFeedback.js";import{validateSchema as U}from"./schemaValidation.js";const A=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),D=e=>typeof e=="string"&&e.trim().length>0?e:void 0;function b(e,t){const i=A(e)?e:null;if(!i)return[];const r=[{key:"manifestVersion",expected:t.manifestVersion},{key:"governanceVersion",expected:t.governanceVersion},{key:"policyVersion",expected:t.policyVersion}],n=[];for(const o of r){const s=D(i[o.key]);s&&s!==o.expected&&n.push({severity:"error",code:`RULE_VERSION_MISMATCH_${o.key.toUpperCase()}`,message:`${o.key} "${s}" does not match expected "${o.expected}".`,path:o.key})}return n}function L(e,t=k){const i=U(e),r=new Date().toISOString(),n=u(),o=[...i.violations],s=[];if(o.push(...b(e,t)),i.tree){const f=x(i.tree,t),h=S(i.tree);for(const a of[...f,...h])a.severity==="error"?o.push(a):s.push(a)}const c=d(o),l=d(s),m=t.enforcement.strictMode,p=c.length>0,y=m&&p?"fail":"pass",V=p?v(c):void 0;return{status:y,violations:c,warnings:l,deterministicFeedback:V,governanceVersionUsed:t.governanceVersion,manifestVersionUsed:t.manifestVersion,policyVersionUsed:t.policyVersion,timestamp:r,versionLineage:n}}export{L as validateAIOutput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../manifest/components.manifest.cjs"),a=require("../manifest/layout.manifest.cjs"),y=["gap","spacing","padding","margin","rowGap","columnGap"],r=(e,t,n,i)=>({code:e,path:t,message:n,meta:i}),m=e=>{var n;return e.type!=="Button"?!1:String(((n=e.props)==null?void 0:n.appearance)??"primary")==="primary"},w=(e,t,n)=>{const i=e.props??{};for(const s of y){const o=i[s];typeof o=="string"&&o.startsWith("--uds-spacing-")&&(a.LayoutRules.spacingSystem.allowedTokens.includes(o)||n.push(r("INVALID_SPACING_TOKEN",`${t}.${s}`,`Invalid spacing token "${o}" for ${e.type}.`,{allowedTokens:a.LayoutRules.spacingSystem.allowedTokens})))}},f=(e,t,n,i)=>{var l,c,d;const s=a.LayoutRules.allowedComposition[e.type];Array.isArray(s)&&!s.includes(t.type)&&i.push(r("INVALID_COMPOSITION",n,`${t.type} is not an allowed child of ${e.type}.`,{allowedChildren:s}));const o=p.ComponentRegistry[e.type];(l=o==null?void 0:o.constraints)!=null&&l.allowedChildren&&!o.constraints.allowedChildren.includes(t.type)&&i.push(r("INVALID_COMPOSITION",n,`${t.type} is outside component-level constraints for ${e.type}.`,{allowedChildren:o.constraints.allowedChildren})),(d=(c=o==null?void 0:o.constraints)==null?void 0:c.disallowedChildren)!=null&&d.includes(t.type)&&i.push(r("DISALLOWED_NESTING",n,`${t.type} is disallowed inside ${e.type}.`,{disallowedChildren:o.constraints.disallowedChildren}))},P=(e,t,n,i)=>{a.LayoutRules.disallowedNesting.some(o=>o.parent===e.type&&o.child===t.type)&&i.push(r("DISALLOWED_NESTING",n,`${t.type} cannot be nested under ${e.type}.`))},u=(e,t,n,i)=>{w(e,t,i),m(e)&&(n.count+=1);const s=e.children??[];for(let o=0;o<s.length;o+=1){const l=s[o],c=`${t}.children[${o}]`;f(e,l,c,i),P(e,l,c,i),u(l,c,n,i)}};function I(e){const t=[],n={count:0};return u(e,"root",n,t),n.count>a.LayoutRules.actionPlacement.maxPrimaryActionsPerSection&&t.push(r("MAX_PRIMARY_ACTIONS","root",`Found ${n.count} primary actions. Maximum allowed is ${a.LayoutRules.actionPlacement.maxPrimaryActionsPerSection}.`,{maxAllowed:a.LayoutRules.actionPlacement.maxPrimaryActionsPerSection})),{valid:t.length===0,errors:t}}exports.validateTree=I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ComponentRegistry as u}from"../manifest/components.manifest.js";import{LayoutRules as a}from"../manifest/layout.manifest.js";const y=["gap","spacing","padding","margin","rowGap","columnGap"],r=(n,o,i,e)=>({code:n,path:o,message:i,meta:e}),m=n=>{var i;return n.type!=="Button"?!1:String(((i=n.props)==null?void 0:i.appearance)??"primary")==="primary"},w=(n,o,i)=>{const e=n.props??{};for(const s of y){const t=e[s];typeof t=="string"&&t.startsWith("--uds-spacing-")&&(a.spacingSystem.allowedTokens.includes(t)||i.push(r("INVALID_SPACING_TOKEN",`${o}.${s}`,`Invalid spacing token "${t}" for ${n.type}.`,{allowedTokens:a.spacingSystem.allowedTokens})))}},f=(n,o,i,e)=>{var l,c,p;const s=a.allowedComposition[n.type];Array.isArray(s)&&!s.includes(o.type)&&e.push(r("INVALID_COMPOSITION",i,`${o.type} is not an allowed child of ${n.type}.`,{allowedChildren:s}));const t=u[n.type];(l=t==null?void 0:t.constraints)!=null&&l.allowedChildren&&!t.constraints.allowedChildren.includes(o.type)&&e.push(r("INVALID_COMPOSITION",i,`${o.type} is outside component-level constraints for ${n.type}.`,{allowedChildren:t.constraints.allowedChildren})),(p=(c=t==null?void 0:t.constraints)==null?void 0:c.disallowedChildren)!=null&&p.includes(o.type)&&e.push(r("DISALLOWED_NESTING",i,`${o.type} is disallowed inside ${n.type}.`,{disallowedChildren:t.constraints.disallowedChildren}))},I=(n,o,i,e)=>{a.disallowedNesting.some(t=>t.parent===n.type&&t.child===o.type)&&e.push(r("DISALLOWED_NESTING",i,`${o.type} cannot be nested under ${n.type}.`))},d=(n,o,i,e)=>{w(n,o,e),m(n)&&(i.count+=1);const s=n.children??[];for(let t=0;t<s.length;t+=1){const l=s[t],c=`${o}.children[${t}]`;f(n,l,c,e),I(n,l,c,e),d(l,c,i,e)}};function N(n){const o=[],i={count:0};return d(n,"root",i,o),i.count>a.actionPlacement.maxPrimaryActionsPerSection&&o.push(r("MAX_PRIMARY_ACTIONS","root",`Found ${i.count} primary actions. Maximum allowed is ${a.actionPlacement.maxPrimaryActionsPerSection}.`,{maxAllowed:a.actionPlacement.maxPrimaryActionsPerSection})),{valid:o.length===0,errors:o}}export{N as validateTree};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),u=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),u=require("react"),b=require("react-router-dom");;/* empty css */const h=[{path:"/app-shell",label:"Application"},{path:"/border-radius",label:"Border Radius"},{path:"/colors",label:"Colors"},{path:"/flex",label:"Flex Layout"},{path:"/icons",label:"Icons"},{path:"/shadows",label:"Shadows"},{path:"/spacing",label:"Spacing"},{path:"/figma-variables",label:"Design Tokens"},{path:"/typography",label:"Typography"},{path:"/utilities",label:"Utility Classes"},{path:"/vertical-rhythm",label:"Vertical Rhythm"}],p=[{path:"/accordion",label:"Accordion"},{path:"/action-menu",label:"Action Menu"},{path:"/avatar",label:"Avatar"},{path:"/badge",label:"Badge"},{path:"/branding",label:"Branding"},{path:"/breadcrumb",label:"Breadcrumb"},{path:"/buttons",label:"Buttons"},{path:"/calendar",label:"Calendar"},{path:"/datepicker",label:"Datepicker"},{path:"/checkbox",label:"Checkbox"},{path:"/chip",label:"Chip"},{path:"/divider",label:"Divider"},{path:"/dot-status",label:"Dot Status"},{path:"/dropdown",label:"Dropdown"},{path:"/event-card",label:"Event Card"},{path:"/field",label:"Field"},{path:"/file-upload",label:"File Upload"},{path:"/image-aspect",label:"Image Aspect"},{path:"/input",label:"Text Input"},{path:"/key",label:"Key"},{path:"/progress-indicator",label:"Progress Indicator"},{path:"/progress-circle",label:"Progress Circle"},{path:"/radio",label:"Radio"},{path:"/slider",label:"Slider"},{path:"/status",label:"Status"},{path:"/steps",label:"Steps"},{path:"/table",label:"Table"},{path:"/tabs",label:"Tabs"},{path:"/tag",label:"Tag"},{path:"/textarea",label:"Textarea"},{path:"/toast",label:"Toast"},{path:"/toggle",label:"Toggle"},{path:"/tooltip",label:"Tooltip"}],d=[{path:"/menu",label:"Menu"}];function m({items:s}){const c=b.useLocation().pathname;if(s&&s.length>0){const e=s.slice(0,5);return a.jsx("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:a.jsx("ol",{className:"breadcrumb__list",children:e.map((l,n)=>{const i=n===e.length-1,o=l.href&&(l.href.startsWith("http://")||l.href.startsWith("https://"));return a.jsxs(u.Fragment,{children:[a.jsx("li",{className:`breadcrumb__item ${i?"breadcrumb__item--current":""}`,children:l.href&&!i?o?a.jsx("a",{href:l.href,className:"breadcrumb__link",target:"_blank",rel:"noopener noreferrer",children:a.jsx("span",{className:"breadcrumb__text",children:l.label})}):a.jsx(b.Link,{to:l.href,className:"breadcrumb__link",children:a.jsx("span",{className:"breadcrumb__text",children:l.label})}):a.jsx("span",{className:"breadcrumb__text",children:l.label})}),!i&&a.jsx("li",{className:"breadcrumb__item",children:a.jsx("span",{className:"breadcrumb__separator","aria-hidden":"true",children:"/"})})]},n)})})})}if(c==="/")return null;const t=[...h,...p,...d].find(e=>c===e.path||c.startsWith(e.path+"/"));if(!t)return null;let r="Design System";return h.some(e=>e.path===t.path)?r="Foundations":p.some(e=>e.path===t.path)?r="Components":d.some(e=>e.path===t.path)&&(r="Patterns"),a.jsx("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:a.jsxs("ol",{className:"breadcrumb__list",children:[a.jsx("li",{className:"breadcrumb__item",children:a.jsx("span",{className:"breadcrumb__text",children:"Unified Design System"})}),a.jsx("li",{className:"breadcrumb__item",children:a.jsx("span",{className:"breadcrumb__separator","aria-hidden":"true",children:"/"})}),a.jsx("li",{className:"breadcrumb__item",children:a.jsx("span",{className:"breadcrumb__text",children:r})}),a.jsx("li",{className:"breadcrumb__item",children:a.jsx("span",{className:"breadcrumb__separator","aria-hidden":"true",children:"/"})}),a.jsx("li",{className:"breadcrumb__item breadcrumb__item--current",children:a.jsx("span",{className:"breadcrumb__text",children:t.label})})]})})}exports.default=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as n}from"react/jsx-runtime";import m from"react";import{useLocation as u,Link as _}from"react-router-dom";/* empty css */const h=[{path:"/app-shell",label:"Application"},{path:"/border-radius",label:"Border Radius"},{path:"/colors",label:"Colors"},{path:"/flex",label:"Flex Layout"},{path:"/icons",label:"Icons"},{path:"/shadows",label:"Shadows"},{path:"/spacing",label:"Spacing"},{path:"/figma-variables",label:"Design Tokens"},{path:"/typography",label:"Typography"},{path:"/utilities",label:"Utility Classes"},{path:"/vertical-rhythm",label:"Vertical Rhythm"}],p=[{path:"/accordion",label:"Accordion"},{path:"/action-menu",label:"Action Menu"},{path:"/avatar",label:"Avatar"},{path:"/badge",label:"Badge"},{path:"/branding",label:"Branding"},{path:"/breadcrumb",label:"Breadcrumb"},{path:"/buttons",label:"Buttons"},{path:"/calendar",label:"Calendar"},{path:"/datepicker",label:"Datepicker"},{path:"/checkbox",label:"Checkbox"},{path:"/chip",label:"Chip"},{path:"/divider",label:"Divider"},{path:"/dot-status",label:"Dot Status"},{path:"/dropdown",label:"Dropdown"},{path:"/event-card",label:"Event Card"},{path:"/field",label:"Field"},{path:"/file-upload",label:"File Upload"},{path:"/image-aspect",label:"Image Aspect"},{path:"/input",label:"Text Input"},{path:"/key",label:"Key"},{path:"/
|
|
1
|
+
import{jsx as a,jsxs as n}from"react/jsx-runtime";import m from"react";import{useLocation as u,Link as _}from"react-router-dom";/* empty css */const h=[{path:"/app-shell",label:"Application"},{path:"/border-radius",label:"Border Radius"},{path:"/colors",label:"Colors"},{path:"/flex",label:"Flex Layout"},{path:"/icons",label:"Icons"},{path:"/shadows",label:"Shadows"},{path:"/spacing",label:"Spacing"},{path:"/figma-variables",label:"Design Tokens"},{path:"/typography",label:"Typography"},{path:"/utilities",label:"Utility Classes"},{path:"/vertical-rhythm",label:"Vertical Rhythm"}],p=[{path:"/accordion",label:"Accordion"},{path:"/action-menu",label:"Action Menu"},{path:"/avatar",label:"Avatar"},{path:"/badge",label:"Badge"},{path:"/branding",label:"Branding"},{path:"/breadcrumb",label:"Breadcrumb"},{path:"/buttons",label:"Buttons"},{path:"/calendar",label:"Calendar"},{path:"/datepicker",label:"Datepicker"},{path:"/checkbox",label:"Checkbox"},{path:"/chip",label:"Chip"},{path:"/divider",label:"Divider"},{path:"/dot-status",label:"Dot Status"},{path:"/dropdown",label:"Dropdown"},{path:"/event-card",label:"Event Card"},{path:"/field",label:"Field"},{path:"/file-upload",label:"File Upload"},{path:"/image-aspect",label:"Image Aspect"},{path:"/input",label:"Text Input"},{path:"/key",label:"Key"},{path:"/progress-indicator",label:"Progress Indicator"},{path:"/progress-circle",label:"Progress Circle"},{path:"/radio",label:"Radio"},{path:"/slider",label:"Slider"},{path:"/status",label:"Status"},{path:"/steps",label:"Steps"},{path:"/table",label:"Table"},{path:"/tabs",label:"Tabs"},{path:"/tag",label:"Tag"},{path:"/textarea",label:"Textarea"},{path:"/toast",label:"Toast"},{path:"/toggle",label:"Toggle"},{path:"/tooltip",label:"Tooltip"}],d=[{path:"/menu",label:"Menu"}];function S({items:s}){const c=u().pathname;if(s&&s.length>0){const e=s.slice(0,5);return a("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:a("ol",{className:"breadcrumb__list",children:e.map((l,i)=>{const b=i===e.length-1,o=l.href&&(l.href.startsWith("http://")||l.href.startsWith("https://"));return n(m.Fragment,{children:[a("li",{className:`breadcrumb__item ${b?"breadcrumb__item--current":""}`,children:l.href&&!b?o?a("a",{href:l.href,className:"breadcrumb__link",target:"_blank",rel:"noopener noreferrer",children:a("span",{className:"breadcrumb__text",children:l.label})}):a(_,{to:l.href,className:"breadcrumb__link",children:a("span",{className:"breadcrumb__text",children:l.label})}):a("span",{className:"breadcrumb__text",children:l.label})}),!b&&a("li",{className:"breadcrumb__item",children:a("span",{className:"breadcrumb__separator","aria-hidden":"true",children:"/"})})]},i)})})})}if(c==="/")return null;const t=[...h,...p,...d].find(e=>c===e.path||c.startsWith(e.path+"/"));if(!t)return null;let r="Design System";return h.some(e=>e.path===t.path)?r="Foundations":p.some(e=>e.path===t.path)?r="Components":d.some(e=>e.path===t.path)&&(r="Patterns"),a("nav",{className:"breadcrumb","aria-label":"Breadcrumb",children:n("ol",{className:"breadcrumb__list",children:[a("li",{className:"breadcrumb__item",children:a("span",{className:"breadcrumb__text",children:"Unified Design System"})}),a("li",{className:"breadcrumb__item",children:a("span",{className:"breadcrumb__separator","aria-hidden":"true",children:"/"})}),a("li",{className:"breadcrumb__item",children:a("span",{className:"breadcrumb__text",children:r})}),a("li",{className:"breadcrumb__item",children:a("span",{className:"breadcrumb__separator","aria-hidden":"true",children:"/"})}),a("li",{className:"breadcrumb__item breadcrumb__item--current",children:a("span",{className:"breadcrumb__text",children:t.label})})]})})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),f=require("../Icon/Icon.cjs");;/* empty css */const e="uds-button",w={"label-only":`${e}--label-only`,"icon-left":`${e}--icon-left`,"icon-right":`${e}--icon-right`,"icon-only":`${e}--icon-only`,only:`${e}--only`},A={primary:`${e}--primary`,soft:`${e}--soft`,outline:`${e}--outline`,text:`${e}--text`,ghost:`${e}--ghost`,disabled:`${e}--disabled`,destructive:`${e}--destructive`},E={large:`${e}--large`,default:`${e}--default`,small:`${e}--small`,xsmall:`${e}--xsmall`};function L({label:t,appearance:u="primary",layout:s="label-only",size:$="default",icon:o,iconSize:p,icons:h,children:b,tracking:a,loading:l=!1,className:y,onClick:d,disabled:x,"aria-label":j,...v}){const _=[e,A[u],w[s],E[$],l&&`${e}--loading`,y].filter(Boolean).join(" "),i=s==="icon-only"||s==="only",g=!!t&&!i,m=(typeof o=="string"?n.jsx(f.default,{name:o,size:p,appearance:"regular"}):o??null)||h||b||null,r=m?n.jsx("span",{className:`${e}__icon`,"aria-hidden":g?"true":void 0,children:m}):null,c=t?n.jsx("span",{className:`${e}__label`,children:t}):null,N=()=>s==="icon-left"?n.jsxs(n.Fragment,{children:[r,c]}):s==="icon-right"?n.jsxs(n.Fragment,{children:[c,r]}):i?r||c:c||r,C=u==="disabled"||!!x||l,B=S=>{if(a){const q={component:"Button",action:"click",label:t,...typeof a=="object"?a:{event:a}};window.dispatchEvent(new CustomEvent("uds:track",{detail:q}))}d==null||d(S)},M=j||(i&&t?t:void 0)||(i&&typeof o=="string"?`${o} icon`:void 0);return n.jsxs("button",{type:"button",className:_,disabled:C,"aria-busy":l?"true":void 0,"aria-label":M,onClick:B,...v,children:[n.jsx("span",{className:`${e}__content`,"aria-hidden":l?"true":void 0,children:N()}),l?n.jsx("span",{className:`${e}__loader`,"aria-hidden":"true",children:n.jsx(f.default,{name:"CircleNotch",size:p,appearance:"regular"})}):null]})}exports.default=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{jsxs as u,jsx as t,Fragment as f}from"react/jsx-runtime";import h from"../Icon/Icon.js";/* empty css */const n="uds-button",z={"label-only":`${n}--label-only`,"icon-left":`${n}--icon-left`,"icon-right":`${n}--icon-right`,"icon-only":`${n}--icon-only`,only:`${n}--only`},I={primary:`${n}--primary`,soft:`${n}--soft`,outline:`${n}--outline`,text:`${n}--text`,ghost:`${n}--ghost`,disabled:`${n}--disabled`,destructive:`${n}--destructive`},S={large:`${n}--large`,default:`${n}--default`,small:`${n}--small`,xsmall:`${n}--xsmall`};function q({label:e,appearance:p="primary",layout:o="label-only",size:b="default",icon:a,iconSize:m,icons:y,children:v,tracking:l,loading:s=!1,className:N,onClick:d,disabled:_,"aria-label":C,...x}){const g=[n,I[p],z[o],S[b],s&&`${n}--loading`,N].filter(Boolean).join(" "),i=o==="icon-only"||o==="only",B=!!e&&!i,$=(typeof a=="string"?t(h,{name:a,size:m,appearance:"regular"}):a??null)||y||v||null,r=$?t("span",{className:`${n}__icon`,"aria-hidden":B?"true":void 0,children:$}):null,c=e?t("span",{className:`${n}__label`,children:e}):null,j=()=>o==="icon-left"?u(f,{children:[r,c]}):o==="icon-right"?u(f,{children:[c,r]}):i?r||c:c||r,w=p==="disabled"||!!_||s,A=L=>{if(l){const M={component:"Button",action:"click",label:e,...typeof l=="object"?l:{event:l}};window.dispatchEvent(new CustomEvent("uds:track",{detail:M}))}d==null||d(L)},E=C||(i&&e?e:void 0)||(i&&typeof a=="string"?`${a} icon`:void 0);return u("button",{type:"button",className:g,disabled:w,"aria-busy":s?"true":void 0,"aria-label":E,onClick:A,...x,children:[t("span",{className:`${n}__content`,"aria-hidden":s?"true":void 0,children:j()}),s?t("span",{className:`${n}__loader`,"aria-hidden":"true",children:t(h,{name:"CircleNotch",size:m,appearance:"regular"})}):null]})}export{q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),C=require("react"),d=require("../Icon/Icon.cjs"),z=require("../Badge/Badge.cjs");;/* empty css */const e="uds-chip",h={default:"default",compact:"compact"},p={both:"icon-both",left:"icon-left",right:"icon-right",none:"icon-none"};function A({label:r,selected:a,rounded:$=!0,size:c="default",iconPlacement:n="none",icon:t,badge:i,badgeVariant:g="sky",className:m="",onClick:o,disabled:l=!1,...j}){const u=typeof a=="boolean",[N,b]=C.useState(a??!1),f=u?a:N,x=$,S=v=>{l||(u||b(B=>!B),o==null||o(v))},I=[e,f&&`${e}--selected`,`${e}--rounded-${x?"true":"false"}`,h[c]&&`${e}--${h[c]}`,p[n]&&`${e}--${p[n]}`,l&&`${e}--disabled`,m].filter(Boolean).join(" "),q=n==="both"||n==="left",y=n==="both"||n==="right",_=typeof t=="string",M=q&&t?_?s.jsx(d.default,{name:t,size:20,appearance:"regular",className:`${e}__icon ${e}__icon--left`}):s.jsx("span",{className:`${e}__icon ${e}__icon--left`,children:t}):null,R=y&&t?_?s.jsx(d.default,{name:t,size:20,appearance:"regular",className:`${e}__icon ${e}__icon--right`}):s.jsx("span",{className:`${e}__icon ${e}__icon--right`,children:t}):null;return s.jsxs("button",{type:"button",className:I,onClick:S,"aria-pressed":f,disabled:l,...j,children:[M,r?s.jsx("span",{className:`${e}__label`,children:r}):null,R,i?s.jsx(z.default,{count:i,variant:g,className:`${e}__badge`}):null]})}exports.default=A;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as M,jsx as n}from"react/jsx-runtime";import{useState as R}from"react";import _ from"../Icon/Icon.js";import v from"../Badge/Badge.js";/* empty css */const t="uds-chip",h={default:"default",compact:"compact"},m={both:"icon-both",left:"icon-left",right:"icon-right",none:"icon-none"};function F({label:l,selected:o,rounded:$=!0,size:c="default",iconPlacement:e="none",icon:s,badge:i,badgeVariant:d="sky",className:g="",onClick:a,disabled:r=!1,...N}){const f=typeof o=="boolean",[I,b]=R(o??!1),p=f?o:I,S=$,y=A=>{r||(f||b(L=>!L),a==null||a(A))},j=[t,p&&`${t}--selected`,`${t}--rounded-${S?"true":"false"}`,h[c]&&`${t}--${h[c]}`,m[e]&&`${t}--${m[e]}`,r&&`${t}--disabled`,g].filter(Boolean).join(" "),x=e==="both"||e==="left",B=e==="both"||e==="right",u=typeof s=="string",C=x&&s?u?n(_,{name:s,size:20,appearance:"regular",className:`${t}__icon ${t}__icon--left`}):n("span",{className:`${t}__icon ${t}__icon--left`,children:s}):null,z=B&&s?u?n(_,{name:s,size:20,appearance:"regular",className:`${t}__icon ${t}__icon--right`}):n("span",{className:`${t}__icon ${t}__icon--right`,children:s}):null;return M("button",{type:"button",className:j,onClick:y,"aria-pressed":p,disabled:r,...N,children:[C,l?n("span",{className:`${t}__label`,children:l}):null,z,i?n(v,{count:i,variant:d,className:`${t}__badge`}):null]})}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),r=require("react"),P=require("react-dom"),H=require("../Icon/Icon.cjs"),E=require("../Button/Button.cjs");;/* empty css */const t="uds-dialog",b=".app-shell",D={info:"Info",success:"CheckCircle",warning:"Warning",destructive:"WarningOctagon"},O={info:"var(--uds-system-action-primary)",success:"var(--uds-system-constructive-primary)",warning:"var(--uds-system-warning-primary)",destructive:"var(--uds-system-destructive-primary)"};function z({open:i=!1,onClose:a,intent:c="info",icon:h,title:l,description:o,confirmLabel:j="Confirm",cancelLabel:x="Cancel",onConfirm:d,onCancel:u,showCancel:N=!0,loading:$=!1,closeOnBackdrop:m=!0,closeOnEscape:f=!0,container:v,className:T="",children:y,...S}){const _=r.useRef(null),g=r.useRef(null);r.useEffect(()=>{if(i)return g.current=document.activeElement instanceof HTMLElement?document.activeElement:null,document.body.style.overflow="hidden",requestAnimationFrame(()=>{var e;(e=_.current)==null||e.focus()}),()=>{var e,n;document.body.style.overflow="",(n=(e=g.current)==null?void 0:e.focus)==null||n.call(e)}},[i]);const k=r.useCallback(e=>{e.key==="Escape"&&f&&a&&(e.stopPropagation(),a())},[f,a]),L=r.useCallback(e=>{e.target===e.currentTarget&&m&&a&&a()},[m,a]),q=r.useCallback(()=>{u?u():a&&a()},[u,a]);if(!i)return null;const R=()=>{if(v instanceof HTMLElement)return v;const e=document.activeElement;if(e instanceof Element){const p=e.closest(b);if(p instanceof HTMLElement)return p}const n=document.querySelector(b);return n instanceof HTMLElement?n:document.body},w=h||D[c],C=O[c],I=[t,`${t}--${c}`,T].filter(Boolean).join(" "),A=c==="destructive"?"destructive":"primary",M=s.jsx("div",{className:`${t}__overlay`,onClick:L,"aria-hidden":"true",children:s.jsxs("div",{ref:_,className:I,role:"alertdialog","aria-modal":"true","aria-labelledby":l?`${t}-title`:void 0,"aria-describedby":o?`${t}-desc`:void 0,tabIndex:-1,onKeyDown:k,...S,children:[s.jsx("div",{className:`${t}__icon`,style:{color:C},children:s.jsx(H.default,{name:w,size:32,appearance:"duotone"})}),s.jsxs("div",{className:`${t}__content`,children:[l&&s.jsx("h2",{id:`${t}-title`,className:`${t}__title`,children:l}),o&&s.jsx("p",{id:`${t}-desc`,className:`${t}__description`,children:o}),y&&s.jsx("div",{className:`${t}__body`,children:y})]}),s.jsxs("div",{className:`${t}__actions`,children:[N&&s.jsx(E.default,{label:x,appearance:"outline",onClick:q,size:"default"}),d&&s.jsx(E.default,{label:j,appearance:A,onClick:d,loading:$,size:"default"})]})]})});return P.createPortal(M,R())}exports.default=z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,jsxs as d}from"react/jsx-runtime";import{useRef as h,useEffect as B,useCallback as u}from"react";import{createPortal as D}from"react-dom";import O from"../Icon/Icon.js";import N from"../Button/Button.js";/* empty css */const t="uds-dialog",$=".app-shell",q={info:"Info",success:"CheckCircle",warning:"Warning",destructive:"WarningOctagon"},K={info:"var(--uds-system-action-primary)",success:"var(--uds-system-constructive-primary)",warning:"var(--uds-system-warning-primary)",destructive:"var(--uds-system-destructive-primary)"};function V({open:i=!1,onClose:r,intent:c="info",icon:b,title:s,description:o,confirmLabel:T="Confirm",cancelLabel:L="Cancel",onConfirm:m,onCancel:l,showCancel:S=!0,loading:k=!1,closeOnBackdrop:f=!0,closeOnEscape:v=!0,container:p,className:w="",children:y,...I}){const _=h(null),E=h(null);B(()=>{if(i)return E.current=document.activeElement instanceof HTMLElement?document.activeElement:null,document.body.style.overflow="hidden",requestAnimationFrame(()=>{var e;(e=_.current)==null||e.focus()}),()=>{var e,n;document.body.style.overflow="",(n=(e=E.current)==null?void 0:e.focus)==null||n.call(e)}},[i]);const A=u(e=>{e.key==="Escape"&&v&&r&&(e.stopPropagation(),r())},[v,r]),C=u(e=>{e.target===e.currentTarget&&f&&r&&r()},[f,r]),H=u(()=>{l?l():r&&r()},[l,r]);if(!i)return null;const P=()=>{if(p instanceof HTMLElement)return p;const e=document.activeElement;if(e instanceof Element){const g=e.closest($);if(g instanceof HTMLElement)return g}const n=document.querySelector($);return n instanceof HTMLElement?n:document.body},R=b||q[c],x=K[c],M=[t,`${t}--${c}`,w].filter(Boolean).join(" "),j=c==="destructive"?"destructive":"primary",z=a("div",{className:`${t}__overlay`,onClick:C,"aria-hidden":"true",children:d("div",{ref:_,className:M,role:"alertdialog","aria-modal":"true","aria-labelledby":s?`${t}-title`:void 0,"aria-describedby":o?`${t}-desc`:void 0,tabIndex:-1,onKeyDown:A,...I,children:[a("div",{className:`${t}__icon`,style:{color:x},children:a(O,{name:R,size:32,appearance:"duotone"})}),d("div",{className:`${t}__content`,children:[s&&a("h2",{id:`${t}-title`,className:`${t}__title`,children:s}),o&&a("p",{id:`${t}-desc`,className:`${t}__description`,children:o}),y&&a("div",{className:`${t}__body`,children:y})]}),d("div",{className:`${t}__actions`,children:[S&&a(N,{label:L,appearance:"outline",onClick:H,size:"default"}),m&&a(N,{label:T,appearance:j,onClick:m,loading:k,size:"default"})]})]})});return D(z,P())}export{V as default};
|