@mich8060/unified-design-system 0.2.13 → 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/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/index.cjs +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai/manifest/components.manifest.cjs +1 -1
- package/dist/ai/manifest/components.manifest.js +1 -1
- 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 -1
- package/dist/ai/manifest/governance.manifest.js +1 -1
- package/dist/ai/manifest/index.cjs +1 -0
- package/dist/ai/manifest/index.js +1 -0
- package/dist/ai/manifest/layout.manifest.cjs +1 -1
- package/dist/ai/manifest/layout.manifest.js +1 -1
- 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 -1
- package/dist/ai/manifest/system.manifest.js +1 -1
- package/dist/ai/manifest.json +2801 -0
- package/dist/ai/policies/policy.engine.cjs +1 -1
- package/dist/ai/policies/policy.engine.js +1 -1
- package/dist/ai/policies/rules/composition.rules.cjs +1 -1
- package/dist/ai/policies/rules/composition.rules.js +1 -1
- package/dist/ai/policies/rules/props.rules.cjs +1 -0
- package/dist/ai/policies/rules/props.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/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/index.cjs +1 -0
- package/dist/ai/validation/index.js +1 -0
- package/dist/ai/validation/validateAIOutput.cjs +1 -1
- package/dist/ai/validation/validateAIOutput.js +1 -1
- 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 +1 -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/index.d.ts +9 -3
- package/dist/design-system/ai/manifest/composition.manifest.d.ts +11 -0
- package/dist/design-system/ai/manifest/governance.manifest.d.ts +5 -0
- package/dist/design-system/ai/manifest/index.d.ts +9 -0
- package/dist/design-system/ai/manifest/prop-aliases.manifest.d.ts +10 -0
- package/dist/design-system/ai/manifest/system.manifest.d.ts +2 -0
- package/dist/design-system/ai/manifest/types.d.ts +3 -0
- package/dist/design-system/ai/policies/rules/props.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/validation/deterministicFeedback.d.ts +15 -0
- package/dist/design-system/ai/validation/index.d.ts +5 -0
- package/dist/design-system/ai/validation/validateAIOutput.d.ts +13 -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/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/package.json +23 -19
- package/dist/components/Accordion/Accordion.spec.cjs +0 -1
- package/dist/components/Accordion/Accordion.spec.js +0 -1
- package/dist/components/ActionMenu/ActionMenu.spec.cjs +0 -1
- package/dist/components/ActionMenu/ActionMenu.spec.js +0 -1
- package/dist/components/Avatar/Avatar.spec.cjs +0 -1
- package/dist/components/Avatar/Avatar.spec.js +0 -1
- package/dist/components/Badge/Badge.spec.cjs +0 -1
- package/dist/components/Badge/Badge.spec.js +0 -1
- package/dist/components/Branding/Branding.spec.cjs +0 -1
- package/dist/components/Branding/Branding.spec.js +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.spec.cjs +0 -1
- package/dist/components/Breadcrumb/Breadcrumb.spec.js +0 -1
- package/dist/components/Button/Button.spec.cjs +0 -1
- package/dist/components/Button/Button.spec.js +0 -1
- package/dist/components/Calendar/Calendar.spec.cjs +0 -1
- package/dist/components/Calendar/Calendar.spec.js +0 -1
- package/dist/components/Card/Card.spec.cjs +0 -1
- package/dist/components/Card/Card.spec.js +0 -1
- package/dist/components/Checkbox/Checkbox.spec.cjs +0 -1
- package/dist/components/Checkbox/Checkbox.spec.js +0 -1
- package/dist/components/Chip/Chip.spec.cjs +0 -1
- package/dist/components/Chip/Chip.spec.js +0 -1
- package/dist/components/Code/Code.spec.cjs +0 -1
- package/dist/components/Code/Code.spec.js +0 -1
- package/dist/components/Container/Container.spec.cjs +0 -1
- package/dist/components/Container/Container.spec.js +0 -1
- package/dist/components/Datepicker/Datepicker.spec.cjs +0 -1
- package/dist/components/Datepicker/Datepicker.spec.js +0 -1
- package/dist/components/Dialog/Dialog.spec.cjs +0 -1
- package/dist/components/Dialog/Dialog.spec.js +0 -1
- package/dist/components/Divider/Divider.spec.cjs +0 -1
- package/dist/components/Divider/Divider.spec.js +0 -1
- package/dist/components/DotStatus/DotStatus.spec.cjs +0 -1
- package/dist/components/DotStatus/DotStatus.spec.js +0 -1
- package/dist/components/Dropdown/Dropdown.spec.cjs +0 -1
- package/dist/components/Dropdown/Dropdown.spec.js +0 -1
- package/dist/components/EmptyState/EmptyState.spec.cjs +0 -1
- package/dist/components/EmptyState/EmptyState.spec.js +0 -1
- package/dist/components/EventCard/EventCard.spec.cjs +0 -1
- package/dist/components/EventCard/EventCard.spec.js +0 -1
- package/dist/components/Field/Field.spec.cjs +0 -1
- package/dist/components/Field/Field.spec.js +0 -1
- package/dist/components/FileUpload/FileUpload.spec.cjs +0 -1
- package/dist/components/FileUpload/FileUpload.spec.js +0 -1
- package/dist/components/Flex/Flex.spec.cjs +0 -1
- package/dist/components/Flex/Flex.spec.js +0 -1
- package/dist/components/Icon/Icon.spec.cjs +0 -1
- package/dist/components/Icon/Icon.spec.js +0 -1
- package/dist/components/ImageAspect/ImageAspect.spec.cjs +0 -1
- package/dist/components/ImageAspect/ImageAspect.spec.js +0 -1
- package/dist/components/Key/Key.spec.cjs +0 -1
- package/dist/components/Key/Key.spec.js +0 -1
- package/dist/components/Menu/Menu.spec.cjs +0 -1
- package/dist/components/Menu/Menu.spec.js +0 -1
- package/dist/components/MicroCalendar/MicroCalendar.spec.cjs +0 -1
- package/dist/components/MicroCalendar/MicroCalendar.spec.js +0 -1
- package/dist/components/Modal/Modal.spec.cjs +0 -1
- package/dist/components/Modal/Modal.spec.js +0 -1
- package/dist/components/Pagination/Pagination.spec.cjs +0 -1
- package/dist/components/Pagination/Pagination.spec.js +0 -1
- package/dist/components/PillToggle/PillToggle.cjs +0 -1
- package/dist/components/PillToggle/PillToggle.js +0 -1
- package/dist/components/PillToggle/PillToggle.spec.cjs +0 -1
- package/dist/components/PillToggle/PillToggle.spec.js +0 -1
- package/dist/components/Playground/Playground.cjs +0 -9
- package/dist/components/Playground/Playground.js +0 -9
- package/dist/components/Playground/Playground.spec.cjs +0 -1
- package/dist/components/Playground/Playground.spec.js +0 -1
- package/dist/components/ProgressCircle/ProgressCircle.spec.cjs +0 -1
- package/dist/components/ProgressCircle/ProgressCircle.spec.js +0 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.spec.cjs +0 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.spec.js +0 -1
- package/dist/components/Radio/Radio.spec.cjs +0 -1
- package/dist/components/Radio/Radio.spec.js +0 -1
- package/dist/components/Slider/Slider.spec.cjs +0 -1
- package/dist/components/Slider/Slider.spec.js +0 -1
- package/dist/components/Status/Status.spec.cjs +0 -1
- package/dist/components/Status/Status.spec.js +0 -1
- package/dist/components/Steps/Steps.spec.cjs +0 -1
- package/dist/components/Steps/Steps.spec.js +0 -1
- package/dist/components/Table/Table.spec.cjs +0 -1
- package/dist/components/Table/Table.spec.js +0 -1
- package/dist/components/Tabs/Tabs.spec.cjs +0 -1
- package/dist/components/Tabs/Tabs.spec.js +0 -1
- package/dist/components/Tag/Tag.spec.cjs +0 -1
- package/dist/components/Tag/Tag.spec.js +0 -1
- package/dist/components/Text/Text.spec.cjs +0 -1
- package/dist/components/Text/Text.spec.js +0 -1
- package/dist/components/TextInput/TextInput.spec.cjs +0 -1
- package/dist/components/TextInput/TextInput.spec.js +0 -1
- package/dist/components/Textarea/Textarea.spec.cjs +0 -1
- package/dist/components/Textarea/Textarea.spec.js +0 -1
- package/dist/components/Toast/Toast.spec.cjs +0 -1
- package/dist/components/Toast/Toast.spec.js +0 -1
- package/dist/components/Toggle/Toggle.spec.cjs +0 -1
- package/dist/components/Toggle/Toggle.spec.js +0 -1
- package/dist/components/Tooltip/Tooltip.spec.cjs +0 -1
- package/dist/components/Tooltip/Tooltip.spec.js +0 -1
- package/dist/design-system/components/Accordion/Accordion.spec.d.ts +0 -4
- package/dist/design-system/components/ActionMenu/ActionMenu.spec.d.ts +0 -4
- package/dist/design-system/components/Avatar/Avatar.spec.d.ts +0 -6
- package/dist/design-system/components/Badge/Badge.spec.d.ts +0 -12
- package/dist/design-system/components/Branding/Branding.spec.d.ts +0 -6
- package/dist/design-system/components/Breadcrumb/Breadcrumb.spec.d.ts +0 -4
- package/dist/design-system/components/Button/Button.spec.d.ts +0 -12
- package/dist/design-system/components/Calendar/Calendar.spec.d.ts +0 -4
- package/dist/design-system/components/Card/Card.spec.d.ts +0 -4
- package/dist/design-system/components/Checkbox/Checkbox.spec.d.ts +0 -4
- package/dist/design-system/components/Chip/Chip.spec.d.ts +0 -13
- package/dist/design-system/components/Code/Code.spec.d.ts +0 -10
- package/dist/design-system/components/Container/Container.spec.d.ts +0 -2
- package/dist/design-system/components/Datepicker/Datepicker.spec.d.ts +0 -6
- package/dist/design-system/components/Dialog/Dialog.spec.d.ts +0 -8
- package/dist/design-system/components/Divider/Divider.spec.d.ts +0 -10
- package/dist/design-system/components/DotStatus/DotStatus.spec.d.ts +0 -10
- package/dist/design-system/components/Dropdown/Dropdown.spec.d.ts +0 -12
- package/dist/design-system/components/EmptyState/EmptyState.spec.d.ts +0 -2
- package/dist/design-system/components/EventCard/EventCard.spec.d.ts +0 -8
- package/dist/design-system/components/Field/Field.spec.d.ts +0 -4
- package/dist/design-system/components/FileUpload/FileUpload.spec.d.ts +0 -6
- package/dist/design-system/components/Flex/Flex.spec.d.ts +0 -2
- package/dist/design-system/components/Icon/Icon.spec.d.ts +0 -6
- package/dist/design-system/components/ImageAspect/ImageAspect.spec.d.ts +0 -8
- package/dist/design-system/components/Key/Key.spec.d.ts +0 -8
- package/dist/design-system/components/Menu/Menu.spec.d.ts +0 -6
- package/dist/design-system/components/MicroCalendar/MicroCalendar.spec.d.ts +0 -4
- package/dist/design-system/components/Modal/Modal.spec.d.ts +0 -8
- package/dist/design-system/components/Pagination/Pagination.spec.d.ts +0 -6
- package/dist/design-system/components/PillToggle/PillToggle.d.ts +0 -13
- package/dist/design-system/components/PillToggle/PillToggle.spec.d.ts +0 -6
- 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.spec.d.ts +0 -6
- 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/ProgressCircle/ProgressCircle.spec.d.ts +0 -10
- package/dist/design-system/components/ProgressIndicator/ProgressIndicator.spec.d.ts +0 -10
- package/dist/design-system/components/Radio/Radio.spec.d.ts +0 -4
- package/dist/design-system/components/Slider/Slider.spec.d.ts +0 -4
- package/dist/design-system/components/Status/Status.spec.d.ts +0 -11
- package/dist/design-system/components/Steps/Steps.spec.d.ts +0 -11
- package/dist/design-system/components/Table/Table.spec.d.ts +0 -4
- package/dist/design-system/components/Tabs/Tabs.spec.d.ts +0 -7
- package/dist/design-system/components/Tag/Tag.spec.d.ts +0 -13
- package/dist/design-system/components/Text/Text.spec.d.ts +0 -2
- package/dist/design-system/components/TextInput/TextInput.spec.d.ts +0 -12
- package/dist/design-system/components/Textarea/Textarea.spec.d.ts +0 -10
- package/dist/design-system/components/Toast/Toast.spec.d.ts +0 -8
- package/dist/design-system/components/Toggle/Toggle.spec.d.ts +0 -8
- package/dist/design-system/components/Tooltip/Tooltip.spec.d.ts +0 -8
- package/dist/design-system/specs/spec.types.d.ts +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UDSGovernance as i}from"../manifest/governance.manifest.js";import{enforceCompositionRule as n}from"./rules/composition.rules.js";import{enforcePrimaryActionLimitRule as
|
|
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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ComponentRegistry as
|
|
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,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,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 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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{UDSGovernance as
|
|
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};
|
|
@@ -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};
|
|
@@ -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 d=require("react/jsx-runtime");;/* empty css */const e="uds-dot-status",r={red:"red",blue:"blue",inverse:"inverse",orange:"orange",sky:"sky",indigo:"indigo",rose:"rose",neutral:"neutral",celery:"celery",lime:"lime",yellow:"yellow",green:"green",cyan:"cyan",purple:"purple",fuchsia:"fuchsia"},t={small:"small",medium:"medium",large:"large"};function m({variant:s="blue",size:l="medium",outline:a=!1,className:u="","aria-label":n,...i}){const o=a===!0||a==="true",c=[e,r[s]&&`${e}--${r[s]}`,t[l]&&`${e}--${t[l]}`,o&&`${e}--outline`,u].filter(Boolean).join(" ");return d.jsx("span",{className:c,role:"status","aria-label":n||`${s} status`,...i})}exports.default=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";/* empty css */const e="uds-dot-status",r={red:"red",blue:"blue",inverse:"inverse",orange:"orange",sky:"sky",indigo:"indigo",rose:"rose",neutral:"neutral",celery:"celery",lime:"lime",yellow:"yellow",green:"green",cyan:"cyan",purple:"purple",fuchsia:"fuchsia"},t={small:"small",medium:"medium",large:"large"};function g({variant:s="blue",size:l="medium",outline:a=!1,className:n="","aria-label":o,...u}){const i=a===!0||a==="true",m=[e,r[s]&&`${e}--${r[s]}`,t[l]&&`${e}--${t[l]}`,i&&`${e}--outline`,n].filter(Boolean).join(" ");return c("span",{className:m,role:"status","aria-label":o||`${s} status`,...u})}export{g as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("../Icon/Icon.cjs");;/* empty css */function o({title:i,description:s,icon:n="Inbox",iconSize:l=32,action:t,secondaryAction:a,align:d="center",className:c="",...r}){const u=["uds-empty-state",`uds-empty-state--${d}`,c].filter(Boolean).join(" ");return e.jsxs("div",{className:u,...r,children:[e.jsx("div",{className:"uds-empty-state__icon","aria-hidden":"true",children:e.jsx(m.default,{name:n,size:l})}),e.jsxs("div",{className:"uds-empty-state__content",children:[e.jsx("div",{className:"uds-empty-state__title",children:i}),s?e.jsx("div",{className:"uds-empty-state__description",children:s}):null]}),t||a?e.jsxs("div",{className:"uds-empty-state__actions",children:[t
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("../Icon/Icon.cjs");;/* empty css */function o({title:i,description:s,icon:n="Inbox",iconSize:l=32,action:t,secondaryAction:a,align:d="center",className:c="",...r}){const u=["uds-empty-state",`uds-empty-state--${d}`,c].filter(Boolean).join(" ");return e.jsxs("div",{className:u,...r,children:[e.jsx("div",{className:"uds-empty-state__icon","aria-hidden":"true",children:e.jsx(m.default,{name:n,size:l})}),e.jsxs("div",{className:"uds-empty-state__content",children:[e.jsx("div",{className:"uds-empty-state__title",children:i}),s?e.jsx("div",{className:"uds-empty-state__description",children:s}):null]}),t||a?e.jsxs("div",{className:"uds-empty-state__actions",children:[a,t]}):null]})}exports.EmptyState=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as t,jsx as e}from"react/jsx-runtime";import p from"../Icon/Icon.js";/* empty css */function y({title:m,description:s,icon:d="Inbox",iconSize:l=32,action:a,secondaryAction:i,align:n="center",className:c="",...r}){const o=["uds-empty-state",`uds-empty-state--${n}`,c].filter(Boolean).join(" ");return t("div",{className:o,...r,children:[e("div",{className:"uds-empty-state__icon","aria-hidden":"true",children:e(p,{name:d,size:l})}),t("div",{className:"uds-empty-state__content",children:[e("div",{className:"uds-empty-state__title",children:m}),s?e("div",{className:"uds-empty-state__description",children:s}):null]}),a||i?t("div",{className:"uds-empty-state__actions",children:[a
|
|
1
|
+
import{jsxs as t,jsx as e}from"react/jsx-runtime";import p from"../Icon/Icon.js";/* empty css */function y({title:m,description:s,icon:d="Inbox",iconSize:l=32,action:a,secondaryAction:i,align:n="center",className:c="",...r}){const o=["uds-empty-state",`uds-empty-state--${n}`,c].filter(Boolean).join(" ");return t("div",{className:o,...r,children:[e("div",{className:"uds-empty-state__icon","aria-hidden":"true",children:e(p,{name:d,size:l})}),t("div",{className:"uds-empty-state__content",children:[e("div",{className:"uds-empty-state__title",children:m}),s?e("div",{className:"uds-empty-state__description",children:s}):null]}),a||i?t("div",{className:"uds-empty-state__actions",children:[i,a]}):null]})}export{y as EmptyState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),m=require("react"),v=require("../Icon/Icon.cjs"),b=require("../Tooltip/Tooltip.cjs");;/* empty css */const s="uds-field";function S({label:r,state:f="default",required:j=!1,helperMessage:i,maxLength:u,value:a,infoIcon:l,onInfoClick:o,id:x,className:p="",children:n,...h}){const c=x||`field-${Math.random().toString(36).substr(2,9)}`,t=typeof o=="function",_=typeof u=="number",$=a==null?0:String(a).length,N=[s,`${s}--${f}`,p].filter(Boolean).join(" ");return e.jsxs("div",{className:N,...h,children:[(r||l)&&e.jsxs("div",{className:`${s}__label-row`,children:[r&&e.jsxs("label",{htmlFor:c,className:`${s}__label`,children:[r,j&&e.jsx("span",{className:`${s}__required`,children:"*"})]}),l&&e.jsxs("div",{className:`${s}__info`,children:[e.jsx("span",{className:`${s}__info-text`,children:"Info"}),e.jsx(b.default,{content:"More information",children:e.jsx("span",{className:`${s}__info-icon`,role:t?"button":void 0,tabIndex:t?0:void 0,"aria-label":t?"More information":void 0,onClick:o,onKeyDown:d=>{t&&(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),o())},children:e.jsx(v.default,{name:l,size:16,appearance:"regular"})})})]})]}),e.jsx("div",{className:`${s}__input-wrapper`,children:m.isValidElement(n)&&c?m.cloneElement(n,{id:c,...n.props}):n}),(i||_)&&e.jsxs("div",{className:`${s}__meta`,children:[i?e.jsx("div",{className:`${s}__helper`,children:i}):e.jsx("span",{}),_&&e.jsxs("div",{className:`${s}__character-count`,children:[$,"/",u]})]})]})}exports.default=S;
|