@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
|
-
import{jsxs as r,jsx as
|
|
1
|
+
import{jsxs as r,jsx as n}from"react/jsx-runtime";import p from"react";import S from"../Icon/Icon.js";import w from"../Tooltip/Tooltip.js";/* empty css */const e="uds-field";function B({label:t,state:u="default",required:h=!1,helperMessage:o,maxLength:f,value:s,infoIcon:l,onInfoClick:c,id:$,className:N="",children:a,...v}){const d=$||`field-${Math.random().toString(36).substr(2,9)}`,i=typeof c=="function",_=typeof f=="number",b=s==null?0:String(s).length,y=[e,`${e}--${u}`,N].filter(Boolean).join(" ");return r("div",{className:y,...v,children:[(t||l)&&r("div",{className:`${e}__label-row`,children:[t&&r("label",{htmlFor:d,className:`${e}__label`,children:[t,h&&n("span",{className:`${e}__required`,children:"*"})]}),l&&r("div",{className:`${e}__info`,children:[n("span",{className:`${e}__info-text`,children:"Info"}),n(w,{content:"More information",children:n("span",{className:`${e}__info-icon`,role:i?"button":void 0,tabIndex:i?0:void 0,"aria-label":i?"More information":void 0,onClick:c,onKeyDown:m=>{i&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),c())},children:n(S,{name:l,size:16,appearance:"regular"})})})]})]}),n("div",{className:`${e}__input-wrapper`,children:p.isValidElement(a)&&d?p.cloneElement(a,{id:d,...a.props}):a}),(o||_)&&r("div",{className:`${e}__meta`,children:[o?n("div",{className:`${e}__helper`,children:o}):n("span",{}),_&&r("div",{className:`${e}__character-count`,children:[b,"/",f]})]})]})}export{B 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 a=require("react/jsx-runtime"),h=require("react"),q=require("../Icon/Icon.cjs");;/* empty css */const n="uds-file-upload";function E({onFileSelect:u,accept:r=[],maxSize:p=10,acceptText:v,instructionText:D="Drop files here or click to upload",size:g="default",multiple:m=!1,disabled:s=!1,className:_="",...j}){const[x,i]=h.useState(!1),c=h.useRef(null),$=[n,`${n}--${g}`,x&&`${n}--dragging`,s&&`${n}--disabled`,_].filter(Boolean).join(" "),A=e=>{e.preventDefault(),e.stopPropagation(),s||i(!0)},N=e=>{e.preventDefault(),e.stopPropagation(),i(!1)},y=e=>{e.preventDefault(),e.stopPropagation()},C=e=>{if(e.preventDefault(),e.stopPropagation(),i(!1),s)return;const t=e.dataTransfer.files;t&&t.length>0&&d(t)},P=e=>{const t=e.target.files;t&&t.length>0&&d(t),e.target.value=""},d=e=>{const l=Array.from(e).filter(o=>!(r.length>0&&!r.some(f=>o.type.match(f))||o.size>p*1024*1024));if(l.length>0&&u){const o=new DataTransfer;l.forEach(f=>o.items.add(f)),u(o.files)}},T=()=>{!s&&c.current&&c.current.click()},k=v||(r.length>0?r.map(e=>{var l;return((l=e.split("/")[1])==null?void 0:l.toUpperCase())||e}).join(", "):"All files");return a.jsxs("div",{className:$,onDragEnter:A,onDragLeave:N,onDragOver:y,onDrop:C,onClick:T,children:[a.jsx("input",{ref:c,type:"file",className:`${n}__input`,accept:r.length>0?r.join(","):void 0,multiple:m,disabled:s,onChange:P,...j}),a.jsxs("div",{className:`${n}__content`,children:[a.jsx("div",{className:`${n}__icon`,children:a.jsx(q.default,{name:"Upload",size:g==="small"?24:32,appearance:"regular"})}),a.jsx("p",{className:`${n}__instruction`,children:D}),a.jsxs("p",{className:`${n}__accept`,children:[k," up to ",p,"MB"]})]})]})}exports.default=E;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as p,jsx as
|
|
1
|
+
import{jsxs as p,jsx as o}from"react/jsx-runtime";import{useState as P,useRef as T}from"react";import B from"../Icon/Icon.js";/* empty css */const t="uds-file-upload";function R({onFileSelect:u,accept:a=[],maxSize:g=10,acceptText:m,instructionText:D="Drop files here or click to upload",size:d="default",multiple:v=!1,disabled:r=!1,className:_="",...$}){const[A,i]=P(!1),f=T(null),N=[t,`${t}--${d}`,A&&`${t}--dragging`,r&&`${t}--disabled`,_].filter(Boolean).join(" "),C=e=>{e.preventDefault(),e.stopPropagation(),r||i(!0)},j=e=>{e.preventDefault(),e.stopPropagation(),i(!1)},x=e=>{e.preventDefault(),e.stopPropagation()},y=e=>{if(e.preventDefault(),e.stopPropagation(),i(!1),r)return;const n=e.dataTransfer.files;n&&n.length>0&&h(n)},k=e=>{const n=e.target.files;n&&n.length>0&&h(n),e.target.value=""},h=e=>{const s=Array.from(e).filter(l=>!(a.length>0&&!a.some(c=>l.type.match(c))||l.size>g*1024*1024));if(s.length>0&&u){const l=new DataTransfer;s.forEach(c=>l.items.add(c)),u(l.files)}},E=()=>{!r&&f.current&&f.current.click()},I=m||(a.length>0?a.map(e=>{var s;return((s=e.split("/")[1])==null?void 0:s.toUpperCase())||e}).join(", "):"All files");return p("div",{className:N,onDragEnter:C,onDragLeave:j,onDragOver:x,onDrop:y,onClick:E,children:[o("input",{ref:f,type:"file",className:`${t}__input`,accept:a.length>0?a.join(","):void 0,multiple:v,disabled:r,onChange:k,...$}),p("div",{className:`${t}__content`,children:[o("div",{className:`${t}__icon`,children:o(B,{name:"Upload",size:d==="small"?24:32,appearance:"regular"})}),o("p",{className:`${t}__instruction`,children:D}),p("p",{className:`${t}__accept`,children:[I," up to ",g,"MB"]})]})]})}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react");;/* empty css */const N=require("react-router-dom"),_=require("../Icon/Icon.cjs"),Y=require("../Avatar/Avatar.cjs"),p=require("../Button/Button.cjs"),Z=require("../TextInput/TextInput.cjs"),L=require("../Branding/Branding.cjs"),ee=require("../Dropdown/Dropdown.cjs"),ae=require("../Toggle/Toggle.cjs"),ne=require("../ActionMenu/ActionMenu.cjs"),se=require("../Text/Text.cjs"),te=t=>{if(typeof t!="object"||t===null)return!1;const l=t;return typeof l.label=="string"&&typeof l.path=="string"},le=t=>{if(typeof t!="object"||t===null)return!1;const l=t;return!(typeof l.label!="string"||typeof l.icon!="string"||l.path!==void 0&&typeof l.path!="string"||l.children!==void 0&&(!Array.isArray(l.children)||!l.children.every(te)))},re=t=>t==="dark"?"dark":"light";function $({title:t,className:l="",navItems:k=[],brands:C=[],activeBrand:M,onBrandChange:A,activeMode:I,onModeChange:d,showBrand:w=!0,showSearch:E=!0,showBrandSwitcher:O=!0,showNav:P=!0,showModeToggle:B=!0,showUser:R=!0,userName:x="Jane Doe",userInitials:G="JD",userAvatarSrc:J,accountMenuItems:b=[],identity:F="design-system",defaultExpanded:U=!0}){const h=N.useLocation(),[V,g]=s.useState({}),[r,q]=s.useState(U),j=s.useMemo(()=>k.filter(le),[k]),v=s.useMemo(()=>C.filter(a=>typeof a=="string"),[C]),H=typeof t=="string"?t:"Menu",y=typeof M=="string"?M:v[0],z=y==="default"?"design-system":y??F,c=re(I),K=s.useMemo(()=>Array.isArray(b)?b:[],[b]);s.useEffect(()=>{const a=j.filter(n=>Array.isArray(n.children)&&n.children.some(o=>h.pathname===o.path)).map(n=>n.label);a.length!==0&&g(n=>{let o=!1;const i={...n};return a.forEach(f=>{i[f]||(i[f]=!0,o=!0)}),o?i:n})},[h.pathname,j]);const S=s.useCallback(a=>{g(n=>({...n,[a]:!n[a]}))},[]),Q=s.useCallback(()=>q(a=>!a),[]),u=s.useCallback(()=>q(!0),[]),W=s.useCallback(a=>{r||(a.preventDefault(),a.stopPropagation(),u())},[u,r]),X=s.useCallback(a=>{if(!r){u(),g(n=>({...n,[a]:!0}));return}S(a)},[u,r,S]),D=s.useCallback(()=>{r||u()},[u,r]),T=s.useCallback(a=>d==null?void 0:d(a),[d]);return e.jsxs("aside",{className:`uds-menu${r?" uds-menu--expanded":""} ${l}`,"aria-label":H,onClickCapture:W,children:[w&&e.jsxs("div",{className:"uds-menu_brand",children:[e.jsx(p.default,{appearance:"text",icon:"List",size:"
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),s=require("react");;/* empty css */const N=require("react-router-dom"),_=require("../Icon/Icon.cjs"),Y=require("../Avatar/Avatar.cjs"),p=require("../Button/Button.cjs"),Z=require("../TextInput/TextInput.cjs"),L=require("../Branding/Branding.cjs"),ee=require("../Dropdown/Dropdown.cjs"),ae=require("../Toggle/Toggle.cjs"),ne=require("../ActionMenu/ActionMenu.cjs"),se=require("../Text/Text.cjs"),te=t=>{if(typeof t!="object"||t===null)return!1;const l=t;return typeof l.label=="string"&&typeof l.path=="string"},le=t=>{if(typeof t!="object"||t===null)return!1;const l=t;return!(typeof l.label!="string"||typeof l.icon!="string"||l.path!==void 0&&typeof l.path!="string"||l.children!==void 0&&(!Array.isArray(l.children)||!l.children.every(te)))},re=t=>t==="dark"?"dark":"light";function $({title:t,className:l="",navItems:k=[],brands:C=[],activeBrand:M,onBrandChange:A,activeMode:I,onModeChange:d,showBrand:w=!0,showSearch:E=!0,showBrandSwitcher:O=!0,showNav:P=!0,showModeToggle:B=!0,showUser:R=!0,userName:x="Jane Doe",userInitials:G="JD",userAvatarSrc:J,accountMenuItems:b=[],identity:F="design-system",defaultExpanded:U=!0}){const h=N.useLocation(),[V,g]=s.useState({}),[r,q]=s.useState(U),j=s.useMemo(()=>k.filter(le),[k]),v=s.useMemo(()=>C.filter(a=>typeof a=="string"),[C]),H=typeof t=="string"?t:"Menu",y=typeof M=="string"?M:v[0],z=y==="default"?"design-system":y??F,c=re(I),K=s.useMemo(()=>Array.isArray(b)?b:[],[b]);s.useEffect(()=>{const a=j.filter(n=>Array.isArray(n.children)&&n.children.some(o=>h.pathname===o.path)).map(n=>n.label);a.length!==0&&g(n=>{let o=!1;const i={...n};return a.forEach(f=>{i[f]||(i[f]=!0,o=!0)}),o?i:n})},[h.pathname,j]);const S=s.useCallback(a=>{g(n=>({...n,[a]:!n[a]}))},[]),Q=s.useCallback(()=>q(a=>!a),[]),u=s.useCallback(()=>q(!0),[]),W=s.useCallback(a=>{r||(a.preventDefault(),a.stopPropagation(),u())},[u,r]),X=s.useCallback(a=>{if(!r){u(),g(n=>({...n,[a]:!0}));return}S(a)},[u,r,S]),D=s.useCallback(()=>{r||u()},[u,r]),T=s.useCallback(a=>d==null?void 0:d(a),[d]);return e.jsxs("aside",{className:`uds-menu${r?" uds-menu--expanded":""} ${l}`,"aria-label":H,onClickCapture:W,children:[w&&e.jsxs("div",{className:"uds-menu_brand",children:[e.jsx(p.default,{appearance:"text",icon:"List",size:"default",label:r?"Collapse menu":"Expand menu",layout:"icon-only","aria-label":r?"Collapse menu":"Expand menu",className:"uds-menu_brand__toggle",onClick:Q}),e.jsx("div",{className:"uds-menu_brand__symbol",children:e.jsx(L.default,{brand:z,symbol:!0})}),e.jsx("div",{className:"uds-menu_brand__full",children:e.jsx(L.default,{brand:z})})]}),E&&e.jsxs("div",{className:"uds-menu_search",children:[e.jsx(p.default,{appearance:"text",icon:"MagnifyingGlass",label:"Search",layout:"icon-only","aria-label":"Search",className:"uds-menu_search__button"}),e.jsx("div",{className:"uds-menu_search__field",children:e.jsx(Z.default,{type:"text",placeholder:"Search",icon:"MagnifyingGlass",iconPosition:"right",className:"uds-menu_search__input",size:"compact"})})]}),O&&v.length>0&&A&&e.jsxs("div",{className:"uds-menu_brands",children:[e.jsx(p.default,{appearance:"text",icon:"PlusCircle",label:"Brand",layout:"icon-only","aria-label":"Switch brand",className:"uds-menu_brands__button"}),e.jsx("div",{className:"uds-menu_brands__dropdown",children:e.jsx(ee.default,{options:v.map(a=>({value:a,label:a})),value:y,onChange:a=>{typeof a=="string"&&A(a)},placeholder:"Select brand",placement:"bottom-start",size:"compact"})})]}),P&&e.jsx("nav",{className:"uds-menu_nav",children:j.map(a=>{const n=a.children??[],o=n.length>0,i=V[a.label],f=r&&i;return o?e.jsxs("div",{className:`uds-menu_nav__item uds-menu_nav__item--accordion${i?" uds-menu_nav__item--open":""}`,children:[e.jsxs("button",{type:"button",className:"uds-menu_nav__item-link",onClick:()=>X(a.label),title:a.label,children:[e.jsx("span",{className:"uds-menu_nav__item-icon",children:e.jsx(_.default,{name:a.icon,size:24,appearance:"duotone"})}),e.jsx("div",{className:"uds-menu_nav__item-label",children:a.label}),e.jsx("span",{className:`uds-menu_nav__item-caret${i?" uds-menu_nav__item-caret--open":""}`,children:e.jsx(_.default,{name:"CaretDown",size:16})})]}),f?e.jsx("div",{className:"uds-menu_nav__children uds-menu_nav__children--open",children:n.map(m=>e.jsx(N.Link,{className:`uds-menu_nav__child-link${h.pathname===m.path?" uds-menu_nav__child-link--active":""}`,to:m.path,onClick:D,title:m.label,children:m.label},m.path))}):null]},a.label):e.jsx("div",{className:`uds-menu_nav__item${h.pathname===a.path?" uds-menu_nav__item--active":""}`,children:e.jsxs(N.Link,{className:"uds-menu_nav__item-link",to:a.path??"/",onClick:D,title:a.label,children:[e.jsx("span",{className:"uds-menu_nav__item-icon",children:e.jsx(_.default,{name:a.icon,size:24,appearance:"duotone"})}),e.jsx("div",{className:"uds-menu_nav__item-label",children:a.label})]})},a.path??a.label)})}),B&&d&&e.jsx("div",{className:"uds-menu_footer",children:e.jsxs("div",{className:"uds-menu_mode",children:[e.jsx(p.default,{appearance:"text",icon:c==="light"?"Sun":"Moon",label:c==="light"?"Light mode":"Dark mode",layout:"icon-only",size:"default","aria-label":"Toggle light/dark mode",className:"uds-menu_mode__button",onClick:()=>T(c==="light"?"dark":"light")}),e.jsxs("div",{className:"uds-menu_mode__controls",children:[e.jsx(_.default,{name:c==="light"?"Sun":"Moon",size:20,appearance:"duotone"}),e.jsx("span",{className:"uds-menu_mode__label",children:c==="light"?"Light":"Dark"}),e.jsx(ae.default,{checked:c==="dark",onChange:a=>T(a?"dark":"light"),className:"uds-menu_mode__toggle"})]})]})}),R&&e.jsxs("div",{className:"uds-menu_account",children:[e.jsx(Y.default,{src:J,initials:G,alt:x?`${x} avatar`:"User avatar",size:"default"}),r&&e.jsxs(e.Fragment,{children:[e.jsx(se.Text,{as:"p",variant:"body-16",weight:"semibold",leading:"regular",className:"uds-menu_account__name",children:x}),e.jsx(ne.default,{placement:"top-start",items:K,trigger:e.jsx(p.default,{appearance:"text",icon:e.jsx(_.default,{name:"DotsThreeVertical",appearance:"bold"}),label:"Account Menu",layout:"icon-only","aria-label":"Account menu"})})]})]})]})}$.defaultProps={title:"Menu"};const ie=s.memo($);exports.default=ie;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as r,jsx as n,Fragment as ne}from"react/jsx-runtime";import ae,{useState as E,useMemo as
|
|
1
|
+
import{jsxs as r,jsx as n,Fragment as ne}from"react/jsx-runtime";import ae,{useState as E,useMemo as x,useEffect as te,useCallback as o}from"react";/* empty css */import{useLocation as le,Link as T}from"react-router-dom";import _ from"../Icon/Icon.js";import se from"../Avatar/Avatar.js";import h from"../Button/Button.js";import re from"../TextInput/TextInput.js";import j from"../Branding/Branding.js";import ie from"../Dropdown/Dropdown.js";import oe from"../Toggle/Toggle.js";import ce from"../ActionMenu/ActionMenu.js";import{Text as de}from"../Text/Text.js";const ue=t=>{if(typeof t!="object"||t===null)return!1;const l=t;return typeof l.label=="string"&&typeof l.path=="string"},me=t=>{if(typeof t!="object"||t===null)return!1;const l=t;return!(typeof l.label!="string"||typeof l.icon!="string"||l.path!==void 0&&typeof l.path!="string"||l.children!==void 0&&(!Array.isArray(l.children)||!l.children.every(ue)))},pe=t=>t==="dark"?"dark":"light";function O({title:t,className:l="",navItems:C=[],brands:M=[],activeBrand:z,onBrandChange:D,activeMode:P,onModeChange:m,showBrand:B=!0,showSearch:G=!0,showBrandSwitcher:J=!0,showNav:F=!0,showModeToggle:R=!0,showUser:U=!0,userName:g="Jane Doe",userInitials:V="JD",userAvatarSrc:q,accountMenuItems:v=[],identity:H="design-system",defaultExpanded:K=!0}){const f=le(),[Q,y]=E({}),[s,S]=E(K),N=x(()=>C.filter(me),[C]),k=x(()=>M.filter(e=>typeof e=="string"),[M]),W=typeof t=="string"?t:"Menu",A=typeof z=="string"?z:k[0],$=A==="default"?"design-system":A??H,c=pe(P),X=x(()=>Array.isArray(v)?v:[],[v]);te(()=>{const e=N.filter(a=>Array.isArray(a.children)&&a.children.some(u=>f.pathname===u.path)).map(a=>a.label);e.length!==0&&y(a=>{let u=!1;const i={...a};return e.forEach(b=>{i[b]||(i[b]=!0,u=!0)}),u?i:a})},[f.pathname,N]);const I=o(e=>{y(a=>({...a,[e]:!a[e]}))},[]),Y=o(()=>S(e=>!e),[]),d=o(()=>S(!0),[]),Z=o(e=>{s||(e.preventDefault(),e.stopPropagation(),d())},[d,s]),ee=o(e=>{if(!s){d(),y(a=>({...a,[e]:!0}));return}I(e)},[d,s,I]),L=o(()=>{s||d()},[d,s]),w=o(e=>m==null?void 0:m(e),[m]);return r("aside",{className:`uds-menu${s?" uds-menu--expanded":""} ${l}`,"aria-label":W,onClickCapture:Z,children:[B&&r("div",{className:"uds-menu_brand",children:[n(h,{appearance:"text",icon:"List",size:"default",label:s?"Collapse menu":"Expand menu",layout:"icon-only","aria-label":s?"Collapse menu":"Expand menu",className:"uds-menu_brand__toggle",onClick:Y}),n("div",{className:"uds-menu_brand__symbol",children:n(j,{brand:$,symbol:!0})}),n("div",{className:"uds-menu_brand__full",children:n(j,{brand:$})})]}),G&&r("div",{className:"uds-menu_search",children:[n(h,{appearance:"text",icon:"MagnifyingGlass",label:"Search",layout:"icon-only","aria-label":"Search",className:"uds-menu_search__button"}),n("div",{className:"uds-menu_search__field",children:n(re,{type:"text",placeholder:"Search",icon:"MagnifyingGlass",iconPosition:"right",className:"uds-menu_search__input",size:"compact"})})]}),J&&k.length>0&&D&&r("div",{className:"uds-menu_brands",children:[n(h,{appearance:"text",icon:"PlusCircle",label:"Brand",layout:"icon-only","aria-label":"Switch brand",className:"uds-menu_brands__button"}),n("div",{className:"uds-menu_brands__dropdown",children:n(ie,{options:k.map(e=>({value:e,label:e})),value:A,onChange:e=>{typeof e=="string"&&D(e)},placeholder:"Select brand",placement:"bottom-start",size:"compact"})})]}),F&&n("nav",{className:"uds-menu_nav",children:N.map(e=>{const a=e.children??[],u=a.length>0,i=Q[e.label],b=s&&i;return u?r("div",{className:`uds-menu_nav__item uds-menu_nav__item--accordion${i?" uds-menu_nav__item--open":""}`,children:[r("button",{type:"button",className:"uds-menu_nav__item-link",onClick:()=>ee(e.label),title:e.label,children:[n("span",{className:"uds-menu_nav__item-icon",children:n(_,{name:e.icon,size:24,appearance:"duotone"})}),n("div",{className:"uds-menu_nav__item-label",children:e.label}),n("span",{className:`uds-menu_nav__item-caret${i?" uds-menu_nav__item-caret--open":""}`,children:n(_,{name:"CaretDown",size:16})})]}),b?n("div",{className:"uds-menu_nav__children uds-menu_nav__children--open",children:a.map(p=>n(T,{className:`uds-menu_nav__child-link${f.pathname===p.path?" uds-menu_nav__child-link--active":""}`,to:p.path,onClick:L,title:p.label,children:p.label},p.path))}):null]},e.label):n("div",{className:`uds-menu_nav__item${f.pathname===e.path?" uds-menu_nav__item--active":""}`,children:r(T,{className:"uds-menu_nav__item-link",to:e.path??"/",onClick:L,title:e.label,children:[n("span",{className:"uds-menu_nav__item-icon",children:n(_,{name:e.icon,size:24,appearance:"duotone"})}),n("div",{className:"uds-menu_nav__item-label",children:e.label})]})},e.path??e.label)})}),R&&m&&n("div",{className:"uds-menu_footer",children:r("div",{className:"uds-menu_mode",children:[n(h,{appearance:"text",icon:c==="light"?"Sun":"Moon",label:c==="light"?"Light mode":"Dark mode",layout:"icon-only",size:"default","aria-label":"Toggle light/dark mode",className:"uds-menu_mode__button",onClick:()=>w(c==="light"?"dark":"light")}),r("div",{className:"uds-menu_mode__controls",children:[n(_,{name:c==="light"?"Sun":"Moon",size:20,appearance:"duotone"}),n("span",{className:"uds-menu_mode__label",children:c==="light"?"Light":"Dark"}),n(oe,{checked:c==="dark",onChange:e=>w(e?"dark":"light"),className:"uds-menu_mode__toggle"})]})]})}),U&&r("div",{className:"uds-menu_account",children:[n(se,{src:q,initials:V,alt:g?`${g} avatar`:"User avatar",size:"default"}),s&&r(ne,{children:[n(de,{as:"p",variant:"body-16",weight:"semibold",leading:"regular",className:"uds-menu_account__name",children:g}),n(ce,{placement:"top-start",items:X,trigger:n(h,{appearance:"text",icon:n(_,{name:"DotsThreeVertical",appearance:"bold"}),label:"Account Menu",layout:"icon-only","aria-label":"Account menu"})})]})]})]})}O.defaultProps={title:"Menu"};const ze=ae.memo(O);export{ze 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 t=require("react/jsx-runtime"),a=require("react"),C=require("react-dom"),D=require("../Button/Button.cjs");;/* empty css */const e="uds-modal",d={small:"small",default:"default",large:"large",fullscreen:"fullscreen"};function n(l){return l==null||typeof l=="boolean"?null:a.isValidElement(l)||typeof l=="string"||typeof l=="number"?l:null}function H({open:l=!1,onClose:r,title:y,subtitle:$,badge:j,header:g,footer:x,size:o="default",closeOnBackdrop:u=!0,closeOnEscape:f=!0,container:m,className:p="",children:N,...E}){const _=a.useRef(null),v=a.useRef(null),M=n(g),i=n(y),c=n($),b=n(j),h=n(x),k=n(N),q=E;a.useEffect(()=>{if(l)return v.current=document.activeElement instanceof HTMLElement?document.activeElement:null,document.body.style.overflow="hidden",requestAnimationFrame(()=>{var s;(s=_.current)==null||s.focus()}),()=>{var s;document.body.style.overflow="",(s=v.current)==null||s.focus()}},[l]);const R=a.useCallback(s=>{s.key==="Escape"&&f&&r&&(s.stopPropagation(),r())},[f,r]),S=a.useCallback(s=>{s.target===s.currentTarget&&u&&r&&r()},[u,r]);if(!l)return null;const w=typeof o=="string"&&o in d?d[o]:d.default,B=[e,`${e}--${w}`,p].filter(Boolean).join(" "),T=[`${e}__overlay`,o==="fullscreen"&&`${e}__overlay--fullscreen`].filter(Boolean).join(" "),A=t.jsx("div",{className:T,onClick:S,"aria-hidden":"true",children:t.jsxs("div",{ref:_,className:B,role:"dialog","aria-modal":"true","aria-labelledby":i?`${e}-title`:void 0,"aria-describedby":c?`${e}-subtitle`:void 0,tabIndex:-1,onKeyDown:R,...q,children:[t.jsx("div",{className:`${e}__header`,children:M||t.jsxs("div",{className:`${e}__header-content`,children:[t.jsxs("div",{className:`${e}__header-info`,children:[t.jsxs("div",{className:`${e}__header-title-row`,children:[i&&t.jsx("h2",{id:`${e}-title`,className:`${e}__title`,children:i}),b&&t.jsx("span",{className:`${e}__badge`,children:b})]}),c&&t.jsx("p",{id:`${e}-subtitle`,className:`${e}__subtitle`,children:c})]}),t.jsx(D.default,{appearance:"text",layout:"icon-only",size:"default",icon:"X",label:"Close modal",onClick:()=>r==null?void 0:r()})]})}),t.jsx("div",{className:`${e}__body`,children:k}),h&&t.jsx("div",{className:`${e}__footer`,children:h})]})}),P=m instanceof HTMLElement?m:document.body;return C.createPortal(A,P)}const L=a.memo(H);exports.default=L;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as a,jsxs as i}from"react/jsx-runtime";import $,{useRef as b,useEffect as F,useCallback as p}from"react";import{createPortal as K}from"react-dom";import q from"../Button/Button.js";/* empty css */const e="uds-modal",c={small:"small",default:"default",large:"large",fullscreen:"fullscreen"};function n(t){return t==null||typeof t=="boolean"?null:$.isValidElement(t)||typeof t=="string"||typeof t=="number"?t:null}function I({open:t=!1,onClose:r,title:g,subtitle:N,badge:E,header:k,footer:w,size:o="default",closeOnBackdrop:u=!0,closeOnEscape:f=!0,container:m,className:x="",children:B,...M}){const _=b(null),h=b(null),j=n(k),s=n(g),d=n(N),v=n(E),y=n(w),A=n(B),R=M;F(()=>{if(t)return h.current=document.activeElement instanceof HTMLElement?document.activeElement:null,document.body.style.overflow="hidden",requestAnimationFrame(()=>{var l;(l=_.current)==null||l.focus()}),()=>{var l;document.body.style.overflow="",(l=h.current)==null||l.focus()}},[t]);const S=p(l=>{l.key==="Escape"&&f&&r&&(l.stopPropagation(),r())},[f,r]),T=p(l=>{l.target===l.currentTarget&&u&&r&&r()},[u,r]);if(!t)return null;const H=typeof o=="string"&&o in c?c[o]:c.default,L=[e,`${e}--${H}`,x].filter(Boolean).join(" "),P=[`${e}__overlay`,o==="fullscreen"&&`${e}__overlay--fullscreen`].filter(Boolean).join(" "),C=a("div",{className:P,onClick:T,"aria-hidden":"true",children:i("div",{ref:_,className:L,role:"dialog","aria-modal":"true","aria-labelledby":s?`${e}-title`:void 0,"aria-describedby":d?`${e}-subtitle`:void 0,tabIndex:-1,onKeyDown:S,...R,children:[a("div",{className:`${e}__header`,children:j||i("div",{className:`${e}__header-content`,children:[i("div",{className:`${e}__header-info`,children:[i("div",{className:`${e}__header-title-row`,children:[s&&a("h2",{id:`${e}-title`,className:`${e}__title`,children:s}),v&&a("span",{className:`${e}__badge`,children:v})]}),d&&a("p",{id:`${e}-subtitle`,className:`${e}__subtitle`,children:d})]}),a(q,{appearance:"text",layout:"icon-only",size:"default",icon:"X",label:"Close modal",onClick:()=>r==null?void 0:r()})]})}),a("div",{className:`${e}__body`,children:A}),y&&a("div",{className:`${e}__footer`,children:y})]})}),D=m instanceof HTMLElement?m:document.body;return K(C,D)}const Q=$.memo(I);export{Q 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"),q=require("react"),l=require("../Icon/Icon.cjs");;/* empty css */function z({currentPage:c=1,totalPages:e=10,onPageChange:m,variant:f="default",showJumpInput:j=!1,showDoubleButtons:x=!1,showFirstLast:N=!1,className:g=""}){const[_,h]=q.useState(c.toString()),s=Math.max(1,Math.min(c,e)),v=()=>{const i=[];if(e<=5)for(let t=1;t<=e;t++)i.push(t);else{i.push(1);let t=Math.max(2,s-1),d=Math.min(e-1,s+1);s<=3&&(d=Math.min(4,e-1)),s>=e-2&&(t=Math.max(2,e-3)),t>2&&i.push("ellipsis-start");for(let o=t;o<=d;o++)i.push(o);d<e-1&&i.push("ellipsis-end"),e>1&&i.push(e)}return i},u=i=>{i!==s&&i>=1&&i<=e&&m&&m(i)},C=()=>{s>1&&u(s-1)},y=()=>{s<e&&u(s+1)},M=()=>{u(1)},$=()=>{u(e)},S=i=>{i.preventDefault();const a=parseInt(_,10);a>=1&&a<=e?u(a):h(s.toString())},k=i=>{h(i.target.value)},r=v(),b=f==="line",I=j,p=x||N,J=r.some(i=>i==="ellipsis-start"||i==="ellipsis-end"),L=(()=>{if(!I||!J)return r;let i=!1;return r.reduce((a,t)=>t==="ellipsis-start"||t==="ellipsis-end"?(i||(a.push("jump"),i=!0),a):(a.push(t),a),[])})();return n.jsx("nav",{className:`uds-pagination ${g}`,"aria-label":"Pagination",children:n.jsxs("div",{className:`uds-pagination__container ${b?"uds-pagination__container--underline":""} ${p?"uds-pagination__container--double":""}`,children:[p&&n.jsx("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--first",onClick:M,disabled:s===1,"aria-label":"First page",children:n.jsx(l.default,{name:"CaretDoubleLeft",size:16})}),n.jsx("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--prev",onClick:C,disabled:s===1,"aria-label":"Previous page",children:n.jsx(l.default,{name:"CaretLeft",size:16})}),L.map((i,a)=>{if(i==="jump")return n.jsxs("div",{className:"uds-pagination__jump",children:[n.jsx("form",{onSubmit:S,children:n.jsx("input",{type:"number",className:"uds-pagination__jump-input",value:_,onChange:k,min:"1",max:e,"aria-label":"Jump to page"})}),n.jsxs("span",{className:"uds-pagination__jump-label",children:["of ",e]})]},`jump-${a}`);if(i==="ellipsis-start"||i==="ellipsis-end")return n.jsx("button",{type:"button",className:"uds-pagination__item uds-pagination__item--ellipsis",disabled:!0,"aria-hidden":"true",children:"..."},`ellipsis-${a}`);const t=i===s;return n.jsx("button",{type:"button",className:`uds-pagination__item ${t?"uds-pagination__item--active":""} ${b?"uds-pagination__item--underline":""}`,onClick:()=>u(i),"aria-label":`Page ${i}`,"aria-current":t?"page":void 0,children:i},i)}),n.jsx("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--next",onClick:y,disabled:s===e,"aria-label":"Next page",children:n.jsx(l.default,{name:"CaretRight",size:16})}),p&&n.jsx("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--last",onClick:$,disabled:s===e,"aria-label":"Last page",children:n.jsx(l.default,{name:"CaretDoubleRight",size:16})})]})})}exports.default=z;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a,jsxs as
|
|
1
|
+
import{jsx as a,jsxs as c}from"react/jsx-runtime";import{useState as D}from"react";import l from"../Icon/Icon.js";/* empty css */function A({currentPage:m=1,totalPages:n=10,onPageChange:h,variant:N="default",showJumpInput:g=!1,showDoubleButtons:v=!1,showFirstLast:C=!1,className:x=""}){const[_,b]=D(m.toString()),e=Math.max(1,Math.min(m,n)),j=()=>{const i=[];if(n<=5)for(let t=1;t<=n;t++)i.push(t);else{i.push(1);let t=Math.max(2,e-1),o=Math.min(n-1,e+1);e<=3&&(o=Math.min(4,n-1)),e>=n-2&&(t=Math.max(2,n-3)),t>2&&i.push("ellipsis-start");for(let d=t;d<=o;d++)i.push(d);o<n-1&&i.push("ellipsis-end"),n>1&&i.push(n)}return i},u=i=>{i!==e&&i>=1&&i<=n&&h&&h(i)},$=()=>{e>1&&u(e-1)},y=()=>{e<n&&u(e+1)},k=()=>{u(1)},M=()=>{u(n)},I=i=>{i.preventDefault();const s=parseInt(_,10);s>=1&&s<=n?u(s):b(e.toString())},J=i=>{b(i.target.value)},r=j(),f=N==="line",L=g,p=v||C,S=r.some(i=>i==="ellipsis-start"||i==="ellipsis-end"),z=(()=>{if(!L||!S)return r;let i=!1;return r.reduce((s,t)=>t==="ellipsis-start"||t==="ellipsis-end"?(i||(s.push("jump"),i=!0),s):(s.push(t),s),[])})();return a("nav",{className:`uds-pagination ${x}`,"aria-label":"Pagination",children:c("div",{className:`uds-pagination__container ${f?"uds-pagination__container--underline":""} ${p?"uds-pagination__container--double":""}`,children:[p&&a("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--first",onClick:k,disabled:e===1,"aria-label":"First page",children:a(l,{name:"CaretDoubleLeft",size:16})}),a("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--prev",onClick:$,disabled:e===1,"aria-label":"Previous page",children:a(l,{name:"CaretLeft",size:16})}),z.map((i,s)=>{if(i==="jump")return c("div",{className:"uds-pagination__jump",children:[a("form",{onSubmit:I,children:a("input",{type:"number",className:"uds-pagination__jump-input",value:_,onChange:J,min:"1",max:n,"aria-label":"Jump to page"})}),c("span",{className:"uds-pagination__jump-label",children:["of ",n]})]},`jump-${s}`);if(i==="ellipsis-start"||i==="ellipsis-end")return a("button",{type:"button",className:"uds-pagination__item uds-pagination__item--ellipsis",disabled:!0,"aria-hidden":"true",children:"..."},`ellipsis-${s}`);const t=i===e;return a("button",{type:"button",className:`uds-pagination__item ${t?"uds-pagination__item--active":""} ${f?"uds-pagination__item--underline":""}`,onClick:()=>u(i),"aria-label":`Page ${i}`,"aria-current":t?"page":void 0,children:i},i)}),a("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--next",onClick:y,disabled:e===n,"aria-label":"Next page",children:a(l,{name:"CaretRight",size:16})}),p&&a("button",{type:"button",className:"uds-pagination__cap uds-pagination__cap--last",onClick:M,disabled:e===n,"aria-label":"Last page",children:a(l,{name:"CaretDoubleRight",size:16})})]})})}export{A 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 e=require("react/jsx-runtime");;/* empty css */const s="uds-progress-circle",$={xxs:"xxs",xs:"xs",sm:"sm",md:"md",lg:"lg"},p={circle:"circle","half-circle":"half-circle"};function M({value:d=40,max:f=100,size:l="md",shape:c="circle",label:r,valueLabel:z,showLabel:_=!0,className:S="","aria-label":v,...W}){const h=Math.min(Math.max(d/f*100,0),100),g=Math.round(h),k=c==="half-circle",t={xxs:{size:64,strokeWidth:3,fontSize:14,labelFontSize:12},xs:{size:160,strokeWidth:8,fontSize:24,labelFontSize:12},sm:{size:200,strokeWidth:10,fontSize:32,labelFontSize:12},md:{size:240,strokeWidth:12,fontSize:36,labelFontSize:12},lg:{size:280,strokeWidth:14,fontSize:48,labelFontSize:12}}[l],i=(t.size-t.strokeWidth)/2,j=100-h,b=100-h,y=[s,$[l]&&`${s}--${$[l]}`,p[c]&&`${s}--${p[c]}`,S].filter(Boolean).join(" "),C=`progress-circle-${Math.random().toString(36).substr(2,9)}`,m=r?`${C}-label`:void 0,N=v??(typeof r=="string"||typeof r=="number"?String(r):`Progress: ${g}%`),a=t.size,o=a/2,L=a/2,u=k?a/2+t.strokeWidth:a,n=L,x=`M ${o-i} ${n} A ${i} ${i} 0 0 1 ${o+i} ${n}`;return e.jsxs("div",{className:y,role:"progressbar","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":f,"aria-label":N,"aria-labelledby":m,...W,children:[e.jsx("svg",{className:`${s}__svg`,width:t.size,height:u,viewBox:`0 0 ${a} ${u}`,children:k?e.jsxs(e.Fragment,{children:[e.jsx("path",{className:`${s}__track`,d:x,fill:"none",strokeWidth:t.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:0,strokeLinecap:"round"}),e.jsx("path",{className:`${s}__fill`,d:x,fill:"none",strokeWidth:t.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:b,strokeLinecap:"round"})]}):e.jsxs(e.Fragment,{children:[e.jsx("circle",{className:`${s}__track`,cx:o,cy:n,r:i,fill:"none",strokeWidth:t.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:0}),e.jsx("circle",{className:`${s}__fill`,cx:o,cy:n,r:i,fill:"none",strokeWidth:t.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:j,strokeLinecap:"round",transform:`rotate(-90 ${o} ${n})`})]})}),e.jsxs("div",{className:`${s}__content`,children:[r&&_&&e.jsx("span",{id:m,className:`${s}__label`,children:r}),e.jsx("span",{className:`${s}__value`,children:z??`${g}%`})]})]})}exports.default=M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as l,jsx as t,Fragment as u}from"react/jsx-runtime";/* empty css */const e="uds-progress-circle",x={xxs:"xxs",xs:"xs",sm:"sm",md:"md",lg:"lg"},_={circle:"circle","half-circle":"half-circle"};function j({value:f=40,max:k=100,size:c="md",shape:h="circle",label:r,valueLabel:S,showLabel:W=!0,className:v="","aria-label":b,...C}){const d=Math.min(Math.max(f/k*100,0),100),g=Math.round(d),m=h==="half-circle",s={xxs:{size:64,strokeWidth:3,fontSize:14,labelFontSize:12},xs:{size:160,strokeWidth:8,fontSize:24,labelFontSize:12},sm:{size:200,strokeWidth:10,fontSize:32,labelFontSize:12},md:{size:240,strokeWidth:12,fontSize:36,labelFontSize:12},lg:{size:280,strokeWidth:14,fontSize:48,labelFontSize:12}}[c],a=(s.size-s.strokeWidth)/2,y=100-d,N=100-d,L=[e,x[c]&&`${e}--${x[c]}`,_[h]&&`${e}--${_[h]}`,v].filter(Boolean).join(" "),D=`progress-circle-${Math.random().toString(36).substr(2,9)}`,$=r?`${D}-label`:void 0,M=b??(typeof r=="string"||typeof r=="number"?String(r):`Progress: ${g}%`),o=s.size,i=o/2,F=o/2,p=m?o/2+s.strokeWidth:o,n=F,z=`M ${i-a} ${n} A ${a} ${a} 0 0 1 ${i+a} ${n}`;return l("div",{className:L,role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":k,"aria-label":M,"aria-labelledby":$,...C,children:[t("svg",{className:`${e}__svg`,width:s.size,height:p,viewBox:`0 0 ${o} ${p}`,children:m?l(u,{children:[t("path",{className:`${e}__track`,d:z,fill:"none",strokeWidth:s.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:0,strokeLinecap:"round"}),t("path",{className:`${e}__fill`,d:z,fill:"none",strokeWidth:s.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:N,strokeLinecap:"round"})]}):l(u,{children:[t("circle",{className:`${e}__track`,cx:i,cy:n,r:a,fill:"none",strokeWidth:s.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:0}),t("circle",{className:`${e}__fill`,cx:i,cy:n,r:a,fill:"none",strokeWidth:s.strokeWidth,pathLength:100,strokeDasharray:100,strokeDashoffset:y,strokeLinecap:"round",transform:`rotate(-90 ${i} ${n})`})]})}),l("div",{className:`${e}__content`,children:[r&&W&&t("span",{id:$,className:`${e}__label`,children:r}),t("span",{className:`${e}__value`,children:S??`${g}%`})]})]})}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime");;/* empty css */const e="uds-progress-indicator",
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),S=require("react"),V=require("../Tooltip/Tooltip.cjs");;/* empty css */const e="uds-progress-indicator",b={default:"default",blue:"blue",green:"green",success:"green",orange:"orange",warning:"orange",red:"red",error:"red",purple:"purple"},p={small:"small",medium:"medium",large:"large"},f={false:"label-false",right:"label-right",bottom:"label-bottom","top-floating":"label-top-floating","bottom-floating":"label-bottom-floating"};function C({value:i=0,max:r=100,variant:c="default",size:d="medium",label:l,showValue:h=!1,labelPosition:_,showLabel:u=!0,className:$="","aria-label":x,...v}){const o=Math.min(Math.max(i/r*100,0),100),s=`${Math.round(o)}%`,t=_??(h?"right":"false"),n=t==="right",j=t==="bottom",N=t==="top-floating"||t==="bottom-floating",m=t==="bottom-floating"?"bottom":"top",y={position:"absolute",left:`${Math.min(Math.max(o,4),96)}%`,top:t==="bottom-floating"?"100%":"0",transform:"translateX(-50%)",width:"10px",height:"10px",display:"inline-flex",alignItems:"center",justifyContent:"center",zIndex:1},M=S.useId(),g=l?`${M}-label`:void 0,P=[e,b[c]&&`${e}--${b[c]}`,p[d]&&`${e}--${p[d]}`,f[t]&&`${e}--${f[t]}`,$].filter(Boolean).join(" "),I=x||(typeof l=="string"?l:`Progress: ${s}`);return a.jsxs("div",{className:P,...v,children:[l&&u||n?a.jsxs("div",{className:`${e}__header`,children:[l&&u&&a.jsx("span",{id:g,className:`${e}__label`,children:l}),n&&a.jsx("span",{className:`${e}__value`,children:s})]}):null,a.jsxs("div",{className:`${e}__bar`,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":r,"aria-label":I,"aria-labelledby":g,children:[a.jsx("div",{className:`${e}__track`,children:a.jsx("div",{className:`${e}__fill`,style:{width:`${o}%`}})}),j&&!n&&a.jsx("span",{className:[`${e}__value`,`${e}__value--bottom`].join(" "),children:s}),N&&a.jsx(V.default,{content:s,placement:m,defaultVisible:!0,className:`${e}__tooltip-anchor`,style:y,children:a.jsx("span",{className:`${e}__marker ${e}__marker--${m==="bottom"?"up":"down"}`,"aria-hidden":"true"})})]})]})}exports.default=C;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as
|
|
1
|
+
import{jsxs as i,jsx as t}from"react/jsx-runtime";import C from"react";import w from"../Tooltip/Tooltip.js";/* empty css */const a="uds-progress-indicator",b={default:"default",blue:"blue",green:"green",success:"green",orange:"orange",warning:"orange",red:"red",error:"red",purple:"purple"},f={small:"small",medium:"medium",large:"large"},h={false:"label-false",right:"label-right",bottom:"label-bottom","top-floating":"label-top-floating","bottom-floating":"label-bottom-floating"};function T({value:r=0,max:c=100,variant:m="default",size:d="medium",label:o,showValue:_=!1,labelPosition:$,showLabel:u=!0,className:v="","aria-label":N,...x}){const s=Math.min(Math.max(r/c*100,0),100),l=`${Math.round(s)}%`,e=$??(_?"right":"false"),n=e==="right",y=e==="bottom",M=e==="top-floating"||e==="bottom-floating",p=e==="bottom-floating"?"bottom":"top",I={position:"absolute",left:`${Math.min(Math.max(s,4),96)}%`,top:e==="bottom-floating"?"100%":"0",transform:"translateX(-50%)",width:"10px",height:"10px",display:"inline-flex",alignItems:"center",justifyContent:"center",zIndex:1},P=C.useId(),g=o?`${P}-label`:void 0,V=[a,b[m]&&`${a}--${b[m]}`,f[d]&&`${a}--${f[d]}`,h[e]&&`${a}--${h[e]}`,v].filter(Boolean).join(" "),j=N||(typeof o=="string"?o:`Progress: ${l}`);return i("div",{className:V,...x,children:[o&&u||n?i("div",{className:`${a}__header`,children:[o&&u&&t("span",{id:g,className:`${a}__label`,children:o}),n&&t("span",{className:`${a}__value`,children:l})]}):null,i("div",{className:`${a}__bar`,role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":c,"aria-label":j,"aria-labelledby":g,children:[t("div",{className:`${a}__track`,children:t("div",{className:`${a}__fill`,style:{width:`${s}%`}})}),y&&!n&&t("span",{className:[`${a}__value`,`${a}__value--bottom`].join(" "),children:l}),M&&t(w,{content:l,placement:p,defaultVisible:!0,className:`${a}__tooltip-anchor`,style:I,children:t("span",{className:`${a}__marker ${a}__marker--${p==="bottom"?"up":"down"}`,"aria-hidden":"true"})})]})]})}export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),B=require("react"),_=require("../Icon/Icon.cjs");;/* empty css */const t="uds-steps",p={horizontal:"horizontal",vertical:"vertical"},l={complete:"complete",active:"active",incomplete:"incomplete",disabled:"disabled",error:"error"},m={default:"default",compact:"compact"},L=n=>typeof n=="string"&&n in l;function P({steps:n=[],orientation:a="horizontal",size:o="default",displayLabel:$=!0,className:S="",...v}){const i=Array.isArray(n)?n:[];if(i.length===0)return null;const h=typeof a=="string"&&a in p?a:"horizontal",j=typeof o=="string"&&o in m?o:"default",f=[t,`${t}--${p[h]}`,`${t}--${m[j]}`,S].filter(Boolean).join(" "),b=(e,s)=>e===0?"start":e===s-1?"end":"middle",N=e=>{const s=e==null?void 0:e.status;return L(s)?s:"incomplete"},x=(e,s)=>e<s-1,d=e=>e==="complete",g=e=>e==="active",C=e=>e==="incomplete",z=e=>e==="error",y=e=>e==="disabled",A=e=>d(e)?"active":"inactive";return c.jsx("div",{className:f,...v,children:i.map((e,s)=>{const r=N(e),M=b(s,i.length),u=x(s,i.length),q=u?A(r):null,w=[`${t}__step`,l[r]&&`${t}__step--${l[r]}`,`${t}__step--${M}`].filter(Boolean).join(" ");return c.jsxs(B.Fragment,{children:[c.jsxs("div",{className:w,children:[c.jsxs("div",{className:`${t}__indicator`,children:[d(r)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--complete`,children:c.jsx(_.default,{name:"Check",size:12,appearance:"bold",className:`${t}__check-icon`})}),g(r)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--active`}),C(r)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--incomplete`}),z(r)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--error`,children:c.jsx(_.default,{name:"X",size:12,appearance:"bold",className:`${t}__error-icon`})}),y(r)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--disabled`})]}),$&&c.jsxs("div",{className:`${t}__label-container`,children:[e.label&&c.jsx("span",{className:`${t}__label`,children:e.label}),e.optionalLabel&&c.jsx("span",{className:`${t}__optional-label`,children:e.optionalLabel})]})]}),u&&c.jsx("div",{className:`${t}__connector ${t}__connector--${q}`})]},s)})})}exports.default=P;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as c,jsxs as i}from"react/jsx-runtime";import E from"react";import p from"../Icon/Icon.js";/* empty css */const t="uds-steps",u={horizontal:"horizontal",vertical:"vertical"},d={complete:"complete",active:"active",incomplete:"incomplete",disabled:"disabled",error:"error"},$={default:"default",compact:"compact"},I=o=>typeof o=="string"&&o in d;function R({steps:o=[],orientation:s="horizontal",size:l="default",displayLabel:h=!0,className:S="",...v}){const a=Array.isArray(o)?o:[];if(a.length===0)return null;const f=typeof s=="string"&&s in u?s:"horizontal",N=typeof l=="string"&&l in $?l:"default",b=[t,`${t}--${u[f]}`,`${t}--${$[N]}`,S].filter(Boolean).join(" "),g=(e,r)=>e===0?"start":e===r-1?"end":"middle",C=e=>{const r=e==null?void 0:e.status;return I(r)?r:"incomplete"},z=(e,r)=>e<r-1,_=e=>e==="complete",y=e=>e==="active",A=e=>e==="incomplete",j=e=>e==="error",w=e=>e==="disabled",B=e=>_(e)?"active":"inactive";return c("div",{className:b,...v,children:a.map((e,r)=>{const n=C(e),L=g(r,a.length),m=z(r,a.length),M=m?B(n):null,k=[`${t}__step`,d[n]&&`${t}__step--${d[n]}`,`${t}__step--${L}`].filter(Boolean).join(" ");return i(E.Fragment,{children:[i("div",{className:k,children:[i("div",{className:`${t}__indicator`,children:[_(n)&&c("div",{className:`${t}__indicator-circle ${t}__indicator-circle--complete`,children:c(p,{name:"Check",size:12,appearance:"bold",className:`${t}__check-icon`})}),y(n)&&c("div",{className:`${t}__indicator-circle ${t}__indicator-circle--active`}),A(n)&&c("div",{className:`${t}__indicator-circle ${t}__indicator-circle--incomplete`}),j(n)&&c("div",{className:`${t}__indicator-circle ${t}__indicator-circle--error`,children:c(p,{name:"X",size:12,appearance:"bold",className:`${t}__error-icon`})}),w(n)&&c("div",{className:`${t}__indicator-circle ${t}__indicator-circle--disabled`})]}),h&&i("div",{className:`${t}__label-container`,children:[e.label&&c("span",{className:`${t}__label`,children:e.label}),e.optionalLabel&&c("span",{className:`${t}__optional-label`,children:e.optionalLabel})]})]}),m&&c("div",{className:`${t}__connector ${t}__connector--${M}`})]},r)})})}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime");;/* empty css */const n={regular:"ds-text--weight-regular",medium:"ds-text--weight-medium",semibold:"ds-text--weight-semibold",bold:"ds-text--weight-bold"},a={tight:"ds-text--leading-tight",regular:"ds-text--leading-regular",loose:"ds-text--leading-loose"};function u({as:e,variant:t,weight:s="regular",leading:i="regular",className:l="",children:r,...o}){const d=e??"p";return g.jsx(d,{className:["ds-text",`ds-text--${t}`,n[s],a[i],l].filter(Boolean).join(" "),...o,children:r})}exports.Text=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";/* empty css */const g={regular:"ds-text--weight-regular",medium:"ds-text--weight-medium",semibold:"ds-text--weight-semibold",bold:"ds-text--weight-bold"},n={tight:"ds-text--leading-tight",regular:"ds-text--leading-regular",loose:"ds-text--leading-loose"};function u({as:t,variant:e,weight:o="regular",leading:s="regular",className:l="",children:i,...d}){return r(t??"p",{className:["ds-text",`ds-text--${e}`,g[o],n[s],l].filter(Boolean).join(" "),...d,children:i})}export{u as Text};
|
|
@@ -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 h=require("react/jsx-runtime"),n=require("react");;/* empty css */const g="uds-tooltip",m={top:"top",bottom:"bottom",left:"left",right:"right"};function $({children:w,content:b,placement:l="top",disabled:M=!1,defaultVisible:c=!1,className:j="",...x}){const[u,a]=n.useState(c),f=n.useRef(null),p=n.useRef(null);if(n.useEffect(()=>{a(c)},[c]),n.useEffect(()=>{if(!u||!p.current||!f.current)return;const d=p.current,e=f.current.getBoundingClientRect(),t=d.getBoundingClientRect();let o=0,i=0;switch(l){case"top":o=-t.height-8,i=e.width/2-t.width/2;break;case"bottom":o=e.height+8,i=e.width/2-t.width/2;break;case"left":o=e.height/2-t.height/2,i=-t.width-8;break;case"right":o=e.height/2-t.height/2,i=e.width+8;break}const R=window.innerWidth,v=window.innerHeight;let s=e.left+i,r=e.top+o;s<8&&(i+=8-s,s=8),s+t.width>R-8&&(i-=s+t.width-(R-8)),r<8&&(o+=8-r,r=8),r+t.height>v-8&&(o-=r+t.height-(v-8)),d.style.top=`${o}px`,d.style.left=`${i}px`},[u,l]),!b||M)return h.jsx(h.Fragment,{children:w});const S=()=>{a(!0)},E=()=>{c||a(!1)},_=[g,m[l]&&`${g}--${m[l]}`,j].filter(Boolean).join(" ");return h.jsxs("div",{ref:f,className:_,onMouseEnter:S,onMouseLeave:E,...x,children:[w,u&&h.jsx("div",{ref:p,className:`${g}__content`,role:"tooltip",children:b})]})}exports.default=$;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as b,Fragment as L,jsxs as S}from"react/jsx-runtime";import{useState as j,useRef as v,useEffect as R}from"react";/* empty css */const u="uds-tooltip",x={top:"top",bottom:"bottom",left:"left",right:"right"};function H({children:d,content:g,placement:n="top",disabled:M=!1,defaultVisible:h=!1,className:$="",...k}){const[l,c]=j(h),a=v(null),p=v(null);if(R(()=>{c(h)},[h]),R(()=>{if(!l||!p.current||!a.current)return;const f=p.current,e=a.current.getBoundingClientRect(),t=f.getBoundingClientRect();let o=0,i=0;switch(n){case"top":o=-t.height-8,i=e.width/2-t.width/2;break;case"bottom":o=e.height+8,i=e.width/2-t.width/2;break;case"left":o=e.height/2-t.height/2,i=-t.width-8;break;case"right":o=e.height/2-t.height/2,i=e.width+8;break}const w=window.innerWidth,m=window.innerHeight;let r=e.left+i,s=e.top+o;r<8&&(i+=8-r,r=8),r+t.width>w-8&&(i-=r+t.width-(w-8)),s<8&&(o+=8-s,s=8),s+t.height>m-8&&(o-=s+t.height-(m-8)),f.style.top=`${o}px`,f.style.left=`${i}px`},[l,n]),!g||M)return b(L,{children:d});const B=()=>{c(!0)},C=()=>{h||c(!1)},E=[u,x[n]&&`${u}--${x[n]}`,$].filter(Boolean).join(" ");return S("div",{ref:a,className:E,onMouseEnter:B,onMouseLeave:C,...k,children:[d,l&&b("div",{ref:p,className:`${u}__content`,role:"tooltip",children:g})]})}export{H as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ValidAuthFormTree, InvalidPrimaryActionTree } from "./trees.example";
|
|
2
|
+
export { StrictModeFailureTree, strictModeFailureExample } from "./validation-run.example";
|
|
3
|
+
export { UDS_TRAINING_EXAMPLES } from "./training.examples";
|
|
4
|
+
export type { AITrainingExample } from "./training.examples";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UINodeTree } from "../manifest/types";
|
|
2
|
+
export interface AITrainingExample {
|
|
3
|
+
id: string;
|
|
4
|
+
scenario: string;
|
|
5
|
+
kind: "valid" | "invalid";
|
|
6
|
+
tags: string[];
|
|
7
|
+
output: {
|
|
8
|
+
tree: UINodeTree;
|
|
9
|
+
manifestVersion?: string;
|
|
10
|
+
governanceVersion?: string;
|
|
11
|
+
policyVersion?: string;
|
|
12
|
+
};
|
|
13
|
+
expected: {
|
|
14
|
+
status: "pass" | "fail";
|
|
15
|
+
violationCodes?: string[];
|
|
16
|
+
};
|
|
17
|
+
rationale: {
|
|
18
|
+
why: string;
|
|
19
|
+
fix?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export declare const UDS_TRAINING_EXAMPLES: readonly AITrainingExample[];
|
|
@@ -2,19 +2,23 @@ import { ComponentRegistry } from "./manifest/components.manifest";
|
|
|
2
2
|
import { getVersionLineage, UDSGovernance } from "./manifest/governance.manifest";
|
|
3
3
|
import { LayoutRules } from "./manifest/layout.manifest";
|
|
4
4
|
import { PatternRegistry } from "./manifest/patterns.manifest";
|
|
5
|
-
import {
|
|
5
|
+
import { PropAliasRules } from "./manifest/prop-aliases.manifest";
|
|
6
|
+
import { UDSAIContract, UDSManifest, UDS_AI_CONTRACT, UDS_AI_MANIFEST } from "./manifest/system.manifest";
|
|
6
7
|
import { TokenIntentMap } from "./manifest/tokens.intent.manifest";
|
|
7
|
-
export { UDSManifest, UDS_AI_MANIFEST };
|
|
8
|
-
export { ComponentRegistry, PatternRegistry, LayoutRules, TokenIntentMap, UDSGovernance, getVersionLineage };
|
|
8
|
+
export { UDSManifest, UDSAIContract, UDS_AI_CONTRACT, UDS_AI_MANIFEST };
|
|
9
|
+
export { ComponentRegistry, PatternRegistry, LayoutRules, PropAliasRules, TokenIntentMap, UDSGovernance, getVersionLineage };
|
|
9
10
|
export { runPolicyEngine } from "./policies/policy.engine";
|
|
11
|
+
export { createUDSRuntimeHelperSDK } from "./sdk";
|
|
10
12
|
export { validateTree } from "./validation/validateTree";
|
|
11
13
|
export { validateAIOutput } from "./validation/validateAIOutput";
|
|
12
14
|
export { validateSchema } from "./validation/schemaValidation";
|
|
13
15
|
export { detectDrift } from "./validation/driftDetection";
|
|
16
|
+
export { buildDeterministicFeedback, sortAndDedupeViolations } from "./validation/deterministicFeedback";
|
|
14
17
|
export { logAIGeneration } from "./audit/auditLogger";
|
|
15
18
|
export { recordUsageMetric, getUsageMetrics, resetUsageMetrics } from "./telemetry/usageMetrics";
|
|
16
19
|
export { ValidAuthFormTree, InvalidPrimaryActionTree } from "./examples/trees.example";
|
|
17
20
|
export { StrictModeFailureTree, strictModeFailureExample } from "./examples/validation-run.example";
|
|
21
|
+
export { UDS_TRAINING_EXAMPLES } from "./examples/training.examples";
|
|
18
22
|
export declare const AI_COMPONENT_METADATA: import(".").ComponentRegistryType;
|
|
19
23
|
export declare const BUTTON_METADATA: import(".").ComponentMetadata;
|
|
20
24
|
export declare const TABLE_METADATA: import(".").ComponentMetadata;
|
|
@@ -34,6 +38,8 @@ export declare const UDS_LAYOUT_RULES: {
|
|
|
34
38
|
export declare const UDS_GLOBAL_ANTI_PATTERNS: string[];
|
|
35
39
|
export type { ComponentManifestItem as ComponentMetadata, ComponentRegistryType, LayoutManifestRules, PatternManifestItem as FlowPattern, PatternRegistryType, TokenIntentMapType as TokenIntentItem, UDSManifestType as AIManifest, UINodeTree, ValidationError, ValidationResult, GovernanceConfig, VersionLineage, } from "./manifest/types";
|
|
36
40
|
export type { PolicyViolation } from "./policies/policy.types";
|
|
41
|
+
export type { UDSRuntimeHelperSDK, CreateUDSRuntimeHelperSDKOptions, CanonicalizedPropsResult } from "./sdk";
|
|
37
42
|
export type { AuditEvent, AuditTransport } from "./audit/audit.types";
|
|
38
43
|
export type { AIValidationResult } from "./validation/validateAIOutput";
|
|
39
44
|
export type { UsageMetric } from "./telemetry/usageMetrics";
|
|
45
|
+
export type { AITrainingExample } from "./examples/training.examples";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface CompositionPairConstraint {
|
|
2
|
+
parent: string;
|
|
3
|
+
child: string;
|
|
4
|
+
reason?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CompositionConstraints {
|
|
7
|
+
allowedChildrenByParent: Record<string, string[]>;
|
|
8
|
+
allowedParentsByChild: Record<string, string[]>;
|
|
9
|
+
disallowedPairs: CompositionPairConstraint[];
|
|
10
|
+
}
|
|
11
|
+
export declare const CompositionRules: CompositionConstraints;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { GovernanceConfig, VersionLineage } from "./types";
|
|
2
2
|
export declare const AI_MANIFEST_VERSION = "1.0.0";
|
|
3
|
+
export declare const AI_GOVERNANCE_VERSION = "1.0.0";
|
|
3
4
|
export declare const AI_POLICY_VERSION = "1.0.0";
|
|
5
|
+
export declare const AI_CONTRACT_SCHEMA_VERSION = "1.0.0";
|
|
6
|
+
export declare const AI_COMPONENT_API_SCHEMA_VERSION = "1.0.0";
|
|
7
|
+
export declare const AI_SCHEMA_VERSION = "1.0.0";
|
|
8
|
+
export declare const AI_API_SCHEMA_VERSION = "1.0.0";
|
|
4
9
|
export declare const UDSGovernance: GovernanceConfig;
|
|
5
10
|
export declare function getVersionLineage(): VersionLineage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { UDSManifest, UDS_AI_MANIFEST } from "./system.manifest";
|
|
2
|
+
export { UDSGovernance, getVersionLineage, AI_MANIFEST_VERSION, AI_GOVERNANCE_VERSION, AI_POLICY_VERSION, AI_CONTRACT_SCHEMA_VERSION, AI_COMPONENT_API_SCHEMA_VERSION, AI_SCHEMA_VERSION, AI_API_SCHEMA_VERSION, } from "./governance.manifest";
|
|
3
|
+
export { ComponentRegistry } from "./components.manifest";
|
|
4
|
+
export { PatternRegistry } from "./patterns.manifest";
|
|
5
|
+
export { LayoutRules } from "./layout.manifest";
|
|
6
|
+
export { CompositionRules } from "./composition.manifest";
|
|
7
|
+
export { PropAliasRules, getCanonicalPropName, getAliasEntries } from "./prop-aliases.manifest";
|
|
8
|
+
export { TokenIntentMap } from "./tokens.intent.manifest";
|
|
9
|
+
export type { ComponentManifestItem, ComponentRegistryType, LayoutManifestRules, ManifestGovernance, PatternManifestItem, PatternRegistryType, TokenIntentMapType, UDSManifestType, UINodeTree, ValidationError, ValidationResult, GovernanceConfig, VersionLineage, } from "./types";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface PropAliasManifest {
|
|
2
|
+
global: Record<string, string>;
|
|
3
|
+
byComponent: Record<string, Record<string, string>>;
|
|
4
|
+
}
|
|
5
|
+
export declare const PropAliasRules: PropAliasManifest;
|
|
6
|
+
export declare function getCanonicalPropName(componentName: string, propName: string): string;
|
|
7
|
+
export declare function getAliasEntries(componentName: string): Array<{
|
|
8
|
+
alias: string;
|
|
9
|
+
canonical: string;
|
|
10
|
+
}>;
|
|
@@ -58,6 +58,7 @@ export interface LayoutManifestRules {
|
|
|
58
58
|
compactGapToken: string;
|
|
59
59
|
};
|
|
60
60
|
allowedComposition: Record<string, string[]>;
|
|
61
|
+
allowedParents: Record<string, string[]>;
|
|
61
62
|
disallowedNesting: Array<{
|
|
62
63
|
parent: string;
|
|
63
64
|
child: string;
|
|
@@ -108,6 +109,7 @@ export interface GovernanceConfig {
|
|
|
108
109
|
systemVersion: string;
|
|
109
110
|
tokenVersion: string;
|
|
110
111
|
manifestVersion: string;
|
|
112
|
+
governanceVersion: string;
|
|
111
113
|
policyVersion: string;
|
|
112
114
|
enforcement: {
|
|
113
115
|
strictMode: boolean;
|
|
@@ -129,5 +131,6 @@ export interface VersionLineage {
|
|
|
129
131
|
udsVersion: string;
|
|
130
132
|
tokenVersion: string;
|
|
131
133
|
manifestVersion: string;
|
|
134
|
+
governanceVersion: string;
|
|
132
135
|
policyVersion: string;
|
|
133
136
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createUDSRuntimeHelperSDK, type UDSRuntimeHelperSDK, type CreateUDSRuntimeHelperSDKOptions, type CanonicalizedPropsResult, } from "./runtime-sdk";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentRegistry } from "../manifest/components.manifest";
|
|
2
|
+
import { UDSManifest } from "../manifest/system.manifest";
|
|
3
|
+
import type { GovernanceConfig, VersionLineage } from "../manifest/types";
|
|
4
|
+
import { type AIValidationResult } from "../validation/validateAIOutput";
|
|
5
|
+
export interface CanonicalizedPropsResult {
|
|
6
|
+
canonicalProps: Record<string, unknown>;
|
|
7
|
+
aliasesApplied: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface UDSRuntimeHelperSDK {
|
|
10
|
+
readonly governance: GovernanceConfig;
|
|
11
|
+
getVersionLineage(): VersionLineage;
|
|
12
|
+
getManifest(): typeof UDSManifest;
|
|
13
|
+
getComponent(componentName: string): (typeof ComponentRegistry)[string] | undefined;
|
|
14
|
+
canonicalizeProps(componentName: string, props: Record<string, unknown>): CanonicalizedPropsResult;
|
|
15
|
+
validate(output: unknown): AIValidationResult;
|
|
16
|
+
validateOrThrow(output: unknown): AIValidationResult;
|
|
17
|
+
}
|
|
18
|
+
export interface CreateUDSRuntimeHelperSDKOptions {
|
|
19
|
+
governance?: GovernanceConfig;
|
|
20
|
+
}
|
|
21
|
+
export declare function createUDSRuntimeHelperSDK(options?: CreateUDSRuntimeHelperSDKOptions): UDSRuntimeHelperSDK;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { PolicyViolation } from "../policies/policy.types";
|
|
2
|
+
export interface DeterministicViolationFeedback {
|
|
3
|
+
id: string;
|
|
4
|
+
code: string;
|
|
5
|
+
path: string;
|
|
6
|
+
message: string;
|
|
7
|
+
fix: string;
|
|
8
|
+
severity: "error" | "warning";
|
|
9
|
+
}
|
|
10
|
+
export declare function sortAndDedupeViolations(violations: PolicyViolation[]): PolicyViolation[];
|
|
11
|
+
export declare function buildDeterministicFeedback(violations: PolicyViolation[]): {
|
|
12
|
+
fingerprint: string;
|
|
13
|
+
summary: string;
|
|
14
|
+
items: DeterministicViolationFeedback[];
|
|
15
|
+
};
|