@mich8060/unified-design-system 0.2.8 → 0.2.10
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/LICENSE +21 -0
- package/README.md +11 -0
- package/dist/_virtual/_commonjsHelpers.cjs +1 -0
- package/dist/_virtual/_commonjsHelpers.js +1 -0
- package/dist/_virtual/prism.cjs +1 -0
- package/dist/_virtual/prism.js +1 -0
- package/dist/_virtual/prism2.cjs +1 -0
- package/dist/_virtual/prism2.js +1 -0
- package/dist/assets/svg/comphealth-symbol.svg.cjs +6 -0
- package/dist/assets/svg/comphealth-symbol.svg.js +6 -0
- package/dist/assets/svg/comphealth.svg.cjs +15 -0
- package/dist/assets/svg/comphealth.svg.js +15 -0
- package/dist/assets/svg/connect-symbol.svg.cjs +5 -0
- package/dist/assets/svg/connect-symbol.svg.js +5 -0
- package/dist/assets/svg/connect.svg.cjs +15 -0
- package/dist/assets/svg/connect.svg.js +15 -0
- package/dist/assets/svg/design-system-symbol.svg.cjs +4 -0
- package/dist/assets/svg/design-system-symbol.svg.js +4 -0
- package/dist/assets/svg/design-system.svg.cjs +13 -0
- package/dist/assets/svg/design-system.svg.js +13 -0
- package/dist/assets/svg/locumsmart-symbol.svg.cjs +8 -0
- package/dist/assets/svg/locumsmart-symbol.svg.js +8 -0
- package/dist/assets/svg/locumsmart.svg.cjs +18 -0
- package/dist/assets/svg/locumsmart.svg.js +18 -0
- package/dist/assets/svg/modio-symbol.svg.cjs +4 -0
- package/dist/assets/svg/modio-symbol.svg.js +4 -0
- package/dist/assets/svg/modio.svg.cjs +9 -0
- package/dist/assets/svg/modio.svg.js +9 -0
- package/dist/assets/svg/weatherby-symbol.svg.cjs +5 -0
- package/dist/assets/svg/weatherby-symbol.svg.js +5 -0
- package/dist/assets/svg/weatherby.svg.cjs +14 -0
- package/dist/assets/svg/weatherby.svg.js +14 -0
- package/dist/assets/svg/wireframe-symbol.svg.cjs +7 -0
- package/dist/assets/svg/wireframe-symbol.svg.js +7 -0
- package/dist/assets/svg/wireframe.svg.cjs +17 -0
- package/dist/assets/svg/wireframe.svg.js +17 -0
- package/dist/components/Accordion/Accordion.cjs +1 -0
- package/dist/components/Accordion/Accordion.js +1 -0
- package/dist/components/ActionMenu/ActionMenu.cjs +1 -0
- package/dist/components/ActionMenu/ActionMenu.js +1 -0
- package/dist/components/Avatar/Avatar.cjs +1 -0
- package/dist/components/Avatar/Avatar.js +1 -0
- package/dist/components/Badge/Badge.cjs +1 -0
- package/dist/components/Badge/Badge.js +1 -0
- package/dist/components/Branding/Branding.cjs +1 -0
- package/dist/components/Branding/Branding.js +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.cjs +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -0
- package/dist/components/Button/Button.cjs +1 -0
- package/dist/components/Button/Button.js +1 -0
- package/dist/components/Calendar/Calendar.cjs +1 -0
- package/dist/components/Calendar/Calendar.js +1 -0
- package/dist/components/Card/Card.cjs +1 -0
- package/dist/components/Card/Card.js +1 -0
- package/dist/components/Checkbox/Checkbox.cjs +1 -0
- package/dist/components/Checkbox/Checkbox.js +1 -0
- package/dist/components/Chip/Chip.cjs +1 -0
- package/dist/components/Chip/Chip.js +1 -0
- package/dist/components/Code/Code.cjs +1 -0
- package/dist/components/Code/Code.js +1 -0
- package/dist/components/Container/Container.cjs +1 -0
- package/dist/components/Container/Container.js +1 -0
- package/dist/components/Datepicker/Datepicker.cjs +1 -0
- package/dist/components/Datepicker/Datepicker.js +1 -0
- package/dist/components/Dialog/Dialog.cjs +1 -0
- package/dist/components/Dialog/Dialog.js +1 -0
- package/dist/components/Divider/Divider.cjs +1 -0
- package/dist/components/Divider/Divider.js +1 -0
- package/dist/components/DotStatus/DotStatus.cjs +1 -0
- package/dist/components/DotStatus/DotStatus.js +1 -0
- package/dist/components/Dropdown/Dropdown.cjs +1 -0
- package/dist/components/Dropdown/Dropdown.js +1 -0
- package/dist/components/EmptyState/EmptyState.cjs +1 -0
- package/dist/components/EmptyState/EmptyState.js +1 -0
- package/dist/components/EventCard/EventCard.cjs +1 -0
- package/dist/components/EventCard/EventCard.js +1 -0
- package/dist/components/Field/Field.cjs +1 -0
- package/dist/components/Field/Field.js +1 -0
- package/dist/components/FileUpload/FileUpload.cjs +1 -0
- package/dist/components/FileUpload/FileUpload.js +1 -0
- package/dist/components/Flex/Flex.cjs +1 -0
- package/dist/components/Flex/Flex.js +1 -0
- package/dist/components/Icon/Icon.cjs +1 -0
- package/dist/components/Icon/Icon.js +1 -0
- package/dist/components/ImageAspect/ImageAspect.cjs +1 -0
- package/dist/components/ImageAspect/ImageAspect.js +1 -0
- package/dist/components/Key/Key.cjs +1 -0
- package/dist/components/Key/Key.js +1 -0
- package/dist/components/Menu/Menu.cjs +1 -0
- package/dist/components/Menu/Menu.js +1 -0
- package/dist/components/MicroCalendar/MicroCalendar.cjs +1 -0
- package/dist/components/MicroCalendar/MicroCalendar.js +1 -0
- package/dist/components/Modal/Modal.cjs +1 -0
- package/dist/components/Modal/Modal.js +1 -0
- package/dist/components/Pagination/Pagination.cjs +1 -0
- package/dist/components/Pagination/Pagination.js +1 -0
- package/dist/components/PillToggle/PillToggle.cjs +1 -0
- package/dist/components/PillToggle/PillToggle.js +1 -0
- package/dist/components/Playground/Playground.cjs +9 -0
- package/dist/components/Playground/Playground.js +9 -0
- package/dist/components/ProgressCircle/ProgressCircle.cjs +1 -0
- package/dist/components/ProgressCircle/ProgressCircle.js +1 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.cjs +1 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.js +1 -0
- package/dist/components/Radio/Radio.cjs +1 -0
- package/dist/components/Radio/Radio.js +1 -0
- package/dist/components/Slider/Slider.cjs +1 -0
- package/dist/components/Slider/Slider.js +1 -0
- package/dist/components/Status/Status.cjs +1 -0
- package/dist/components/Status/Status.js +1 -0
- package/dist/components/Steps/Steps.cjs +1 -0
- package/dist/components/Steps/Steps.js +1 -0
- package/dist/components/Table/Table.cjs +1 -0
- package/dist/components/Table/Table.js +1 -0
- package/dist/components/Tabs/TabItem.cjs +1 -0
- package/dist/components/Tabs/TabItem.js +1 -0
- package/dist/components/Tabs/Tabs.cjs +1 -0
- package/dist/components/Tabs/Tabs.js +1 -0
- package/dist/components/Tag/Tag.cjs +1 -0
- package/dist/components/Tag/Tag.js +1 -0
- package/dist/components/Text/Text.cjs +1 -0
- package/dist/components/Text/Text.js +1 -0
- package/dist/components/Text/Text.spec.cjs +1 -0
- package/dist/components/Text/Text.spec.js +1 -0
- package/dist/components/TextInput/TextInput.cjs +1 -0
- package/dist/components/TextInput/TextInput.js +1 -0
- package/dist/components/Textarea/Textarea.cjs +1 -0
- package/dist/components/Textarea/Textarea.js +1 -0
- package/dist/components/Toast/Toast.cjs +1 -0
- package/dist/components/Toast/Toast.js +1 -0
- package/dist/components/Toggle/Toggle.cjs +1 -0
- package/dist/components/Toggle/Toggle.js +1 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.js +1 -0
- package/dist/constants.cjs +1 -0
- package/dist/constants.js +1 -0
- package/dist/design-system/components/Badge/Badge.d.ts +4 -2
- package/dist/design-system/components/Badge/Badge.types.d.ts +5 -1
- package/dist/design-system/components/Container/Container.d.ts +3 -0
- package/dist/design-system/components/Container/Container.types.d.ts +7 -0
- package/dist/design-system/components/Container/index.d.ts +2 -0
- package/dist/design-system/components/Dropdown/Dropdown.d.ts +4 -1
- package/dist/design-system/components/EmptyState/EmptyState.d.ts +3 -0
- package/dist/design-system/components/EmptyState/EmptyState.types.d.ts +11 -0
- package/dist/design-system/components/EmptyState/index.d.ts +2 -0
- package/dist/design-system/components/Icon/Icon.d.ts +8 -1
- package/dist/design-system/components/Menu/Menu.d.ts +1 -30
- package/dist/design-system/components/Menu/Menu.types.d.ts +2 -0
- package/dist/design-system/components/Modal/Modal.d.ts +3 -1
- package/dist/design-system/components/Table/Table.d.ts +6 -11
- package/dist/design-system/components/Tabs/TabItem.d.ts +4 -2
- package/dist/design-system/components/Tabs/Tabs.d.ts +4 -1
- package/dist/design-system/components/TextInput/index.d.ts +1 -0
- package/dist/design-system/index.d.ts +3 -0
- package/dist/design-system/theme/ThemeProvider.d.ts +13 -0
- package/dist/design-system/theme/createBrand.d.ts +7 -0
- package/dist/design-system/theme/createTheme.d.ts +2 -0
- package/dist/design-system/theme/index.d.ts +4 -0
- package/dist/design-system/theme/theme.types.d.ts +55 -0
- package/dist/index.cjs +1 -162
- package/dist/index.js +1 -6677
- package/dist/node_modules/prismjs/prism.cjs +9 -0
- package/dist/node_modules/prismjs/prism.js +9 -0
- package/dist/src/app-shell/AppShell.cjs +1 -0
- package/dist/src/app-shell/AppShell.js +1 -0
- package/dist/src/app-shell/layout.types.cjs +1 -0
- package/dist/src/app-shell/layout.types.js +1 -0
- package/dist/style.css +1 -0
- package/dist/theme/ThemeProvider.cjs +1 -0
- package/dist/theme/ThemeProvider.js +1 -0
- package/dist/theme/createBrand.cjs +1 -0
- package/dist/theme/createBrand.js +1 -0
- package/dist/theme/createTheme.cjs +1 -0
- package/dist/theme/createTheme.js +1 -0
- package/dist/tokens/color.d.ts +40 -0
- package/dist/tokens/color.js +81 -0
- package/dist/tokens/generateCss.d.ts +2 -0
- package/dist/tokens/generateCss.js +34 -0
- package/dist/tokens/index.d.ts +475 -0
- package/dist/tokens/index.js +29 -0
- package/dist/tokens/motion.d.ts +14 -0
- package/dist/tokens/motion.js +15 -0
- package/dist/tokens/radius.d.ts +14 -0
- package/dist/tokens/radius.js +15 -0
- package/dist/tokens/shadow.d.ts +22 -0
- package/dist/tokens/shadow.js +24 -0
- package/dist/tokens/spacing.d.ts +21 -0
- package/dist/tokens/spacing.js +22 -0
- package/dist/tokens/tokens.css +421 -0
- package/dist/tokens/types.d.ts +21 -0
- package/dist/tokens/types.js +1 -0
- package/dist/tokens/typography.d.ts +87 -0
- package/dist/tokens/typography.js +95 -0
- package/package.json +330 -11
- package/dist/unified-design-system.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as S}from"react/jsx-runtime";import h from"react";/* empty css */const g=new Set(["0","2","4","6","8","10","12","14","16","18","24","32","48","64","80"]);function v(n){return n===!0?"wrap":n===!1||n==null?"nowrap":n}function a(n){return n.replace(/\s+/g,"-")}function G(n){var e;if(n==null)return;const i=String(n).trim(),o=((e=i.match(/^spacing-(\d+)$/))==null?void 0:e[1])??i;return g.has(o)?`var(--uds-spacing-${o})`:n}const A=h.forwardRef(function({as:i="div",direction:o="row",justifyContent:e,alignItems:t,wrap:c=!1,gap:l,fullWidth:u=!1,inline:s=!1,className:d,style:r,children:x,...p},m){const w=v(c),$=["ds-flex",`ds-flex--direction-${o}`,e&&`ds-flex--justify-${a(e)}`,t&&`ds-flex--align-${a(t)}`,`ds-flex--wrap-${a(w)}`,s&&"ds-flex--inline",u&&"ds-flex--full-width",d].filter(Boolean).join(" "),f={};return l!=null&&(r==null?void 0:r.gap)==null&&(f.gap=G(l)),u&&(r==null?void 0:r.width)==null&&(f.width="100%"),S(i,{ref:m,className:$,style:{...f,...r},...p,children:x})});export{A as Flex};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react"),a=require("@phosphor-icons/react");;/* empty css */function f(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const c=f(a),i=e=>typeof e=="function"||typeof e=="object"&&e!==null,d=e=>e.split(/(?=[A-Z])|[-_\s]/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),g=e=>{const t=c[e];if(i(t))return t;const o=c[`${e}Icon`];return i(o)?o:null};function p({name:e,size:t=24,appearance:o="regular",...n}){const r=e?d(String(e)):"",l=r?g(r):null,u={regular:"regular",bold:"bold",thin:"thin",light:"light",duotone:"duotone",fill:"fill",solid:"fill",outline:"regular"}[o]||"regular";return l?s.createElement(l,{size:t,weight:u,...n}):null}const b=s.memo(p);exports.default=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c from"react";import*as l from"@phosphor-icons/react";/* empty css */const i=o=>typeof o=="function"||typeof o=="object"&&o!==null,u=o=>o.split(/(?=[A-Z])|[-_\s]/).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),f=o=>{const t=l[o];if(i(t))return t;const n=l[`${o}Icon`];return i(n)?n:null};function p({name:o,size:t=24,appearance:n="regular",...s}){const e=o?u(String(o)):"",r=e?f(e):null,a={regular:"regular",bold:"bold",thin:"thin",light:"light",duotone:"duotone",fill:"fill",solid:"fill",outline:"regular"}[n]||"regular";return r?c.createElement(r,{size:t,weight:a,...s}):null}const m=c.memo(p);export{m as default};
|
|
@@ -0,0 +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-image-aspect",i={square:"square",video:"video","4-3":"4-3","3-2":"3-2","21-9":"21-9",portrait:"portrait",auto:"auto"};function u({ratio:s="square",src:t,alt:r="",className:l="",...o}){const c=[e,i[s]&&`${e}--${i[s]}`,l].filter(Boolean).join(" ");return a.jsx("div",{className:c,children:t?a.jsx("img",{src:t,alt:r,className:`${e}__image`,...o}):a.jsx("div",{className:`${e}__placeholder`,children:a.jsx("span",{className:`${e}__placeholder-text`,children:"Image"})})})}exports.default=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";/* empty css */const a="uds-image-aspect",o={square:"square",video:"video","4-3":"4-3","3-2":"3-2","21-9":"21-9",portrait:"portrait",auto:"auto"};function p({ratio:s="square",src:t,alt:i="",className:r="",...c}){const l=[a,o[s]&&`${a}--${o[s]}`,r].filter(Boolean).join(" ");return e("div",{className:l,children:t?e("img",{src:t,alt:i,className:`${a}__image`,...c}):e("div",{className:`${a}__placeholder`,children:e("span",{className:`${a}__placeholder-text`,children:"Image"})})})}export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime");;/* empty css */const t="uds-key",s={light:"light",dark:"dark"};function o({label:l,appearance:e="light",className:r="",...i}){const a=[t,s[e]&&`${t}--${s[e]}`,r].filter(Boolean).join(" ");return n.jsx("kbd",{className:a,...i,children:l})}exports.default=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";/* empty css */const t="uds-key",a={light:"light",dark:"dark"};function d({label:o,appearance:s="light",className:e="",...l}){const r=[t,a[s]&&`${t}--${a[s]}`,e].filter(Boolean).join(" ");return i("kbd",{className:r,...l,children:o})}export{d as default};
|
|
@@ -0,0 +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:"xsmall",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)})}),e.jsx("div",{className:"uds-menu_footer",children:B&&d&&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","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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as r,jsx as n,Fragment as ne}from"react/jsx-runtime";import ae,{useState as E,useMemo as A,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=A(()=>C.filter(me),[C]),k=A(()=>M.filter(e=>typeof e=="string"),[M]),W=typeof t=="string"?t:"Menu",x=typeof z=="string"?z:k[0],$=x==="default"?"design-system":x??H,c=pe(P),X=A(()=>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:"xsmall",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:x,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)})}),n("div",{className:"uds-menu_footer",children:R&&m&&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","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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("react"),Q=require("../Icon/Icon.cjs"),N=require("../Button/Button.cjs");;/* empty css */const s="uds-micro-calendar",V=["S","M","T","W","T","F","S"],b=["January","February","March","April","May","June","July","August","September","October","November","December"];function X({value:x,month:M,onDateSelect:v,unavailableDates:A=[],dateData:F={},defaultExpanded:S=!0,showLegend:k=!0,showExpandCollapse:C=!0,className:E="",...T}){const[f,$]=g.useState(M||new Date),[o,O]=g.useState(S),u=g.useMemo(()=>{const n=new Date;return n.setHours(0,0,0,0),n},[]),l=f.getFullYear(),r=f.getMonth(),q=new Date(l,r,1),w=new Date(l,r+1,0).getDate(),p=q.getDay(),d=g.useMemo(()=>{const n=[];for(let t=0;t<p;t++)n.push(null);for(let t=1;t<=w;t++){const a=new Date(l,r,t);a.setHours(0,0,0,0),n.push(a)}return n},[l,r,p,w]),B=n=>n?n.getTime()===u.getTime():!1,L=n=>{if(!n)return!1;if(x){const t=new Date(x);return t.setHours(0,0,0,0),n.getTime()===t.getTime()}return!1},j=n=>n?A.some(t=>{const a=new Date(t);return a.setHours(0,0,0,0),n.getTime()===a.getTime()}):!1,_=n=>{if(!n)return null;const t=n.toISOString().split("T")[0];return F[t]||null},H=(n,t)=>{var a,i;if(!n||!((a=_(n))!=null&&a.onAssignment))return!1;if(t>0){const c=d[t-1];if(c&&((i=_(c))!=null&&i.onAssignment))return!1}return!0},Y=(n,t)=>{var a,i;if(!n||!((a=_(n))!=null&&a.onAssignment))return!1;if(t<d.length-1){const c=d[t+1];if(c&&((i=_(c))!=null&&i.onAssignment))return!1}return!0},I=n=>{n&&!j(n)&&v&&v(n)},W=()=>{$(new Date(l,r-1,1))},z=()=>{$(new Date(l,r+1,1))},J=()=>{O(!o)},y=g.useMemo(()=>{const n=u.getMonth(),t=u.getFullYear();return r===n&&l===t},[r,l,u]),D=g.useMemo(()=>{if(o||!y)return 0;const n=d.findIndex(a=>a?a.getTime()===u.getTime():!1);return n===-1?0:Math.floor(n/7)*7/7},[o,d,u,y]),P=d,R=g.useMemo(()=>Math.ceil(d.length/7),[d]),U=[s,E].filter(Boolean).join(" ");return e.jsxs("div",{className:U,...T,children:[e.jsxs("div",{className:`${s}__header`,children:[e.jsx(N.default,{icon:"ArrowLeft",size:"small",appearance:"text",onClick:W,"aria-label":"Previous month"}),e.jsxs("h3",{className:`${s}__title`,children:[b[r]," ",l]}),e.jsx(N.default,{icon:"ArrowRight",size:"small",appearance:"text",onClick:z,"aria-label":"Next month"})]}),e.jsx("div",{className:`${s}__weekdays`,children:V.map((n,t)=>e.jsx("div",{className:`${s}__weekday`,children:n},t))}),e.jsx("div",{className:`${s}__grid-wrapper ${o?`${s}__grid-wrapper--expanded`:`${s}__grid-wrapper--collapsed}`}`,style:o?{height:`${R*64.3}px`}:{},children:e.jsx("div",{className:`${s}__grid`,style:{transform:o||D===0?"translateY(0px)":`translateY(-${D*64.3-1}px)`},children:P.map((n,t)=>{if(!n)return e.jsx("div",{className:`${s}__day ${s}__day--empty`},`empty-${t}`);const a=_(n),i=(a==null?void 0:a.travel)||!1,c=(a==null?void 0:a.onAssignment)||!1,h=j(n),Z=B(n),K=L(n);H(n,t);const G=Y(n,t)&&i&&c;let m="available";return h?m="unavailable":K?m="selected":c&&!i&&(m="on-assignment"),e.jsxs("button",{type:"button",className:[`${s}__day`,`${s}__day--${m}`,Z&&`${s}__day--today`].filter(Boolean).join(" "),onClick:()=>I(n),disabled:h,"aria-label":`${n.getDate()} ${b[r]} ${l}`,children:[e.jsx("span",{className:`${s}__day-number`,children:n.getDate()}),h&&e.jsx("span",{className:`${s}__day-unavailable-line`}),(i||c)&&e.jsx("div",{className:`${s}__icons`,children:G?e.jsxs(e.Fragment,{children:[c&&e.jsx("span",{className:`${s}__icon ${s}__icon--assignment`,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("circle",{cx:"8",cy:"8",r:"7.5",fill:"#DBEAFF",stroke:"#1D4ED7"})})}),i&&e.jsx("span",{className:`${s}__icon ${s}__icon--travel`,children:e.jsx("svg",{width:"19",height:"16",viewBox:"0 0 19 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.5791 15.4736H0.865265L9.22171 1L17.5791 15.4736Z",fill:"#DCFCE7",stroke:"#157F3D"})})})]}):e.jsxs(e.Fragment,{children:[i&&e.jsx("span",{className:`${s}__icon ${s}__icon--travel`,children:e.jsx("svg",{width:"19",height:"16",viewBox:"0 0 19 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.5791 15.4736H0.865265L9.22171 1L17.5791 15.4736Z",fill:"#DCFCE7",stroke:"#157F3D"})})}),c&&e.jsx("span",{className:`${s}__icon ${s}__icon--assignment`,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("circle",{cx:"8",cy:"8",r:"7.5",fill:"#DBEAFF",stroke:"#1D4ED7"})})})]})})]},n.toISOString())})})},`grid-${l}-${r}`),k&&o&&e.jsxs("div",{className:`${s}__legend`,children:[e.jsxs("div",{className:`${s}__legend-column`,children:[e.jsxs("div",{className:`${s}__legend-item`,children:[e.jsx("div",{className:`${s}__legend-square ${s}__legend-square--available`}),e.jsx("span",{className:`${s}__legend-label`,children:"Available"})]}),e.jsxs("div",{className:`${s}__legend-item`,children:[e.jsx("div",{className:`${s}__legend-square ${s}__legend-square--unavailable`,children:e.jsx("span",{className:`${s}__legend-unavailable-line`})}),e.jsx("span",{className:`${s}__legend-label`,children:"Unavailable"})]})]}),e.jsxs("div",{className:`${s}__legend-column`,children:[e.jsxs("div",{className:`${s}__legend-item`,children:[e.jsx("div",{className:`${s}__legend-square ${s}__legend-square--assignment`,children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`${s}__legend-icon ${s}__legend-icon--assignment`,children:e.jsx("circle",{cx:"8",cy:"8",r:"7.5",fill:"#DBEAFF",stroke:"#1D4ED7"})})}),e.jsx("span",{className:`${s}__legend-label`,children:"On Assignment"})]}),e.jsxs("div",{className:`${s}__legend-item`,children:[e.jsx("div",{className:`${s}__legend-square ${s}__legend-square--available`,children:e.jsx("svg",{width:"19",height:"16",viewBox:"0 0 19 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`${s}__legend-icon`,children:e.jsx("path",{d:"M17.5791 15.4736H0.865265L9.22171 1L17.5791 15.4736Z",fill:"#DCFCE7",stroke:"#157F3D"})})}),e.jsx("span",{className:`${s}__legend-label`,children:"Travel"})]})]})]}),C&&e.jsx("button",{type:"button",className:`${s}__toggle`,onClick:J,"aria-label":o?"Collapse calendar":"Expand calendar",children:e.jsx(Q.default,{name:o?"CaretUp":"CaretDown",size:16})})]})}exports.default=X;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as l,jsx as s,Fragment as A}from"react/jsx-runtime";import{useState as F,useMemo as h}from"react";import ee from"../Icon/Icon.js";import M from"../Button/Button.js";/* empty css */const e="uds-micro-calendar",ne=["S","M","T","W","T","F","S"],k=["January","February","March","April","May","June","July","August","September","October","November","December"];function oe({value:f,month:C,onDateSelect:v,unavailableDates:E=[],dateData:S={},defaultExpanded:T=!0,showLegend:B=!0,showExpandCollapse:O=!0,className:L="",...q}){const[$,w]=F(C||new Date),[d,H]=F(T),g=h(()=>{const n=new Date;return n.setHours(0,0,0,0),n},[]),r=$.getFullYear(),i=$.getMonth(),Y=new Date(r,i,1),D=new Date(r,i+1,0).getDate(),y=Y.getDay(),m=h(()=>{const n=[];for(let t=0;t<y;t++)n.push(null);for(let t=1;t<=D;t++){const a=new Date(r,i,t);a.setHours(0,0,0,0),n.push(a)}return n},[r,i,y,D]),I=n=>n?n.getTime()===g.getTime():!1,j=n=>{if(!n)return!1;if(f){const t=new Date(f);return t.setHours(0,0,0,0),n.getTime()===t.getTime()}return!1},N=n=>n?E.some(t=>{const a=new Date(t);return a.setHours(0,0,0,0),n.getTime()===a.getTime()}):!1,_=n=>{if(!n)return null;const t=n.toISOString().split("T")[0];return S[t]||null},W=(n,t)=>{var a,c;if(!n||!((a=_(n))!=null&&a.onAssignment))return!1;if(t>0){const o=m[t-1];if(o&&((c=_(o))!=null&&c.onAssignment))return!1}return!0},z=(n,t)=>{var a,c;if(!n||!((a=_(n))!=null&&a.onAssignment))return!1;if(t<m.length-1){const o=m[t+1];if(o&&((c=_(o))!=null&&c.onAssignment))return!1}return!0},J=n=>{n&&!N(n)&&v&&v(n)},U=()=>{w(new Date(r,i-1,1))},Z=()=>{w(new Date(r,i+1,1))},K=()=>{H(!d)},x=h(()=>{const n=g.getMonth(),t=g.getFullYear();return i===n&&r===t},[i,r,g]),b=h(()=>{if(d||!x)return 0;const n=m.findIndex(a=>a?a.getTime()===g.getTime():!1);return n===-1?0:Math.floor(n/7)*7/7},[d,m,g,x]),P=m,R=h(()=>Math.ceil(m.length/7),[m]),G=[e,L].filter(Boolean).join(" ");return l("div",{className:G,...q,children:[l("div",{className:`${e}__header`,children:[s(M,{icon:"ArrowLeft",size:"small",appearance:"text",onClick:U,"aria-label":"Previous month"}),l("h3",{className:`${e}__title`,children:[k[i]," ",r]}),s(M,{icon:"ArrowRight",size:"small",appearance:"text",onClick:Z,"aria-label":"Next month"})]}),s("div",{className:`${e}__weekdays`,children:ne.map((n,t)=>s("div",{className:`${e}__weekday`,children:n},t))}),s("div",{className:`${e}__grid-wrapper ${d?`${e}__grid-wrapper--expanded`:`${e}__grid-wrapper--collapsed}`}`,style:d?{height:`${R*64.3}px`}:{},children:s("div",{className:`${e}__grid`,style:{transform:d||b===0?"translateY(0px)":`translateY(-${b*64.3-1}px)`},children:P.map((n,t)=>{if(!n)return s("div",{className:`${e}__day ${e}__day--empty`},`empty-${t}`);const a=_(n),c=(a==null?void 0:a.travel)||!1,o=(a==null?void 0:a.onAssignment)||!1,p=N(n),Q=I(n),V=j(n);W(n,t);const X=z(n,t)&&c&&o;let u="available";return p?u="unavailable":V?u="selected":o&&!c&&(u="on-assignment"),l("button",{type:"button",className:[`${e}__day`,`${e}__day--${u}`,Q&&`${e}__day--today`].filter(Boolean).join(" "),onClick:()=>J(n),disabled:p,"aria-label":`${n.getDate()} ${k[i]} ${r}`,children:[s("span",{className:`${e}__day-number`,children:n.getDate()}),p&&s("span",{className:`${e}__day-unavailable-line`}),(c||o)&&s("div",{className:`${e}__icons`,children:X?l(A,{children:[o&&s("span",{className:`${e}__icon ${e}__icon--assignment`,children:s("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("circle",{cx:"8",cy:"8",r:"7.5",fill:"#DBEAFF",stroke:"#1D4ED7"})})}),c&&s("span",{className:`${e}__icon ${e}__icon--travel`,children:s("svg",{width:"19",height:"16",viewBox:"0 0 19 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M17.5791 15.4736H0.865265L9.22171 1L17.5791 15.4736Z",fill:"#DCFCE7",stroke:"#157F3D"})})})]}):l(A,{children:[c&&s("span",{className:`${e}__icon ${e}__icon--travel`,children:s("svg",{width:"19",height:"16",viewBox:"0 0 19 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("path",{d:"M17.5791 15.4736H0.865265L9.22171 1L17.5791 15.4736Z",fill:"#DCFCE7",stroke:"#157F3D"})})}),o&&s("span",{className:`${e}__icon ${e}__icon--assignment`,children:s("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("circle",{cx:"8",cy:"8",r:"7.5",fill:"#DBEAFF",stroke:"#1D4ED7"})})})]})})]},n.toISOString())})})},`grid-${r}-${i}`),B&&d&&l("div",{className:`${e}__legend`,children:[l("div",{className:`${e}__legend-column`,children:[l("div",{className:`${e}__legend-item`,children:[s("div",{className:`${e}__legend-square ${e}__legend-square--available`}),s("span",{className:`${e}__legend-label`,children:"Available"})]}),l("div",{className:`${e}__legend-item`,children:[s("div",{className:`${e}__legend-square ${e}__legend-square--unavailable`,children:s("span",{className:`${e}__legend-unavailable-line`})}),s("span",{className:`${e}__legend-label`,children:"Unavailable"})]})]}),l("div",{className:`${e}__legend-column`,children:[l("div",{className:`${e}__legend-item`,children:[s("div",{className:`${e}__legend-square ${e}__legend-square--assignment`,children:s("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`${e}__legend-icon ${e}__legend-icon--assignment`,children:s("circle",{cx:"8",cy:"8",r:"7.5",fill:"#DBEAFF",stroke:"#1D4ED7"})})}),s("span",{className:`${e}__legend-label`,children:"On Assignment"})]}),l("div",{className:`${e}__legend-item`,children:[s("div",{className:`${e}__legend-square ${e}__legend-square--available`,children:s("svg",{width:"19",height:"16",viewBox:"0 0 19 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:`${e}__legend-icon`,children:s("path",{d:"M17.5791 15.4736H0.865265L9.22171 1L17.5791 15.4736Z",fill:"#DCFCE7",stroke:"#157F3D"})})}),s("span",{className:`${e}__legend-label`,children:"Travel"})]})]})]}),O&&s("button",{type:"button",className:`${e}__toggle`,onClick:K,"aria-label":d?"Collapse calendar":"Expand calendar",children:s(ee,{name:d?"CaretUp":"CaretDown",size:16})})]})}export{oe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),r=require("react"),C=require("react-dom"),M=require("../Icon/Icon.cjs");;/* empty css */const e="uds-modal",v={small:"small",default:"default",large:"large",fullscreen:"fullscreen"};function R({open:t=!1,onClose:s,title:c,subtitle:i,badge:n,header:$,footer:d,size:o="default",closeOnBackdrop:u=!0,closeOnEscape:m=!0,container:b,className:j="",children:y,...x}){const f=r.useRef(null),_=r.useRef(null);r.useEffect(()=>{if(t)return _.current=document.activeElement,document.body.style.overflow="hidden",requestAnimationFrame(()=>{var a;(a=f.current)==null||a.focus()}),()=>{var a,h;document.body.style.overflow="",(h=(a=_.current)==null?void 0:a.focus)==null||h.call(a)}},[t]);const N=r.useCallback(a=>{a.key==="Escape"&&m&&s&&(a.stopPropagation(),s())},[m,s]),g=r.useCallback(a=>{a.target===a.currentTarget&&u&&s&&s()},[u,s]);if(!t)return null;const p=v[o]||v.default,k=[e,`${e}--${p}`,j].filter(Boolean).join(" "),q=[`${e}__overlay`,o==="fullscreen"&&`${e}__overlay--fullscreen`].filter(Boolean).join(" "),w=l.jsx("div",{className:q,onClick:g,"aria-hidden":"true",children:l.jsxs("div",{ref:f,className:k,role:"dialog","aria-modal":"true","aria-labelledby":c?`${e}-title`:void 0,"aria-describedby":i?`${e}-subtitle`:void 0,tabIndex:-1,onKeyDown:N,...x,children:[l.jsx("div",{className:`${e}__header`,children:$||l.jsxs("div",{className:`${e}__header-content`,children:[l.jsxs("div",{className:`${e}__header-info`,children:[l.jsxs("div",{className:`${e}__header-title-row`,children:[c&&l.jsx("h2",{id:`${e}-title`,className:`${e}__title`,children:c}),n&&l.jsx("span",{className:`${e}__badge`,children:n})]}),i&&l.jsx("p",{id:`${e}-subtitle`,className:`${e}__subtitle`,children:i})]}),l.jsx("button",{type:"button",className:`${e}__close`,onClick:s,"aria-label":"Close modal",children:l.jsx(M.default,{name:"X",size:16,appearance:"regular"})})]})}),l.jsx("div",{className:`${e}__body`,children:y}),d&&l.jsx("div",{className:`${e}__footer`,children:d})]})});return C.createPortal(w,b||document.body)}const S=r.memo(R);exports.default=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as l,jsxs as t}from"react/jsx-runtime";import B,{useRef as v,useEffect as M,useCallback as $}from"react";import{createPortal as R}from"react-dom";import S from"../Icon/Icon.js";/* empty css */const e="uds-modal",y={small:"small",default:"default",large:"large",fullscreen:"fullscreen"};function z({open:s=!1,onClose:r,title:i,subtitle:c,badge:d,header:b,footer:o,size:n="default",closeOnBackdrop:u=!0,closeOnEscape:m=!0,container:p,className:N="",children:g,...k}){const f=v(null),_=v(null);M(()=>{if(s)return _.current=document.activeElement,document.body.style.overflow="hidden",requestAnimationFrame(()=>{var a;(a=f.current)==null||a.focus()}),()=>{var a,h;document.body.style.overflow="",(h=(a=_.current)==null?void 0:a.focus)==null||h.call(a)}},[s]);const w=$(a=>{a.key==="Escape"&&m&&r&&(a.stopPropagation(),r())},[m,r]),j=$(a=>{a.target===a.currentTarget&&u&&r&&r()},[u,r]);if(!s)return null;const x=y[n]||y.default,A=[e,`${e}--${x}`,N].filter(Boolean).join(" "),C=[`${e}__overlay`,n==="fullscreen"&&`${e}__overlay--fullscreen`].filter(Boolean).join(" "),E=l("div",{className:C,onClick:j,"aria-hidden":"true",children:t("div",{ref:f,className:A,role:"dialog","aria-modal":"true","aria-labelledby":i?`${e}-title`:void 0,"aria-describedby":c?`${e}-subtitle`:void 0,tabIndex:-1,onKeyDown:w,...k,children:[l("div",{className:`${e}__header`,children:b||t("div",{className:`${e}__header-content`,children:[t("div",{className:`${e}__header-info`,children:[t("div",{className:`${e}__header-title-row`,children:[i&&l("h2",{id:`${e}-title`,className:`${e}__title`,children:i}),d&&l("span",{className:`${e}__badge`,children:d})]}),c&&l("p",{id:`${e}-subtitle`,className:`${e}__subtitle`,children:c})]}),l("button",{type:"button",className:`${e}__close`,onClick:r,"aria-label":"Close modal",children:l(S,{name:"X",size:16,appearance:"regular"})})]})}),l("div",{className:`${e}__body`,children:g}),o&&l("div",{className:`${e}__footer`,children:o})]})});return R(E,p||document.body)}const F=B.memo(z);export{F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),$=require("react"),o=require("../Icon/Icon.cjs");;/* empty css */function k({currentPage:d=1,totalPages:i=10,onPageChange:m,variant:s="default",showFirstLast:f=!1,className:j=""}){const[h,b]=$.useState(d.toString()),t=Math.max(1,Math.min(d,i)),x=()=>{const e=[];if(i<=5)for(let a=1;a<=i;a++)e.push(a);else{e.push(1);let a=Math.max(2,t-1),p=Math.min(i-1,t+1);t<=3&&(p=Math.min(4,i-1)),t>=i-2&&(a=Math.max(2,i-3)),a>2&&e.push("ellipsis-start");for(let c=a;c<=p;c++)e.push(c);p<i-1&&e.push("ellipsis-end"),i>1&&e.push(i)}return e},l=e=>{e!==t&&e>=1&&e<=i&&m&&m(e)},g=()=>{t>1&&l(t-1)},N=()=>{t<i&&l(t+1)},C=()=>{l(1)},y=()=>{l(i)},M=e=>{e.preventDefault();const u=parseInt(h,10);u>=1&&u<=i?l(u):b(t.toString())},v=e=>{b(e.target.value)},w=x(),_=s==="underline"||s==="underline-with-jump"||s==="underline-double",S=s==="with-jump"||s==="underline-with-jump",r=s==="with-jump"||s==="underline-with-jump"||s==="underline-double"||f;return n.jsx("nav",{className:`pagination ${j}`,"aria-label":"Pagination",children:n.jsxs("div",{className:`pagination__container ${_?"pagination__container--underline":""} ${r?"pagination__container--double":""}`,children:[r&&n.jsx("button",{type:"button",className:"pagination__cap pagination__cap--first",onClick:C,disabled:t===1,"aria-label":"First page",children:n.jsx(o.default,{name:"CaretDoubleLeft",size:16})}),n.jsx("button",{type:"button",className:"pagination__cap pagination__cap--prev",onClick:g,disabled:t===1,"aria-label":"Previous page",children:n.jsx(o.default,{name:"CaretLeft",size:16})}),w.map((e,u)=>{if(e==="ellipsis-start"||e==="ellipsis-end")return n.jsx("button",{type:"button",className:"pagination__item pagination__item--ellipsis",disabled:!0,"aria-hidden":"true",children:"..."},`ellipsis-${u}`);const a=e===t;return n.jsx("button",{type:"button",className:`pagination__item ${a?"pagination__item--active":""} ${_?"pagination__item--underline":""}`,onClick:()=>l(e),"aria-label":`Page ${e}`,"aria-current":a?"page":void 0,children:e},e)}),S&&n.jsxs("div",{className:"pagination__jump",children:[n.jsx("form",{onSubmit:M,children:n.jsx("input",{type:"number",className:"pagination__jump-input",value:h,onChange:v,min:"1",max:i,"aria-label":"Jump to page"})}),n.jsxs("span",{className:"pagination__jump-label",children:["of ",i]})]}),n.jsx("button",{type:"button",className:"pagination__cap pagination__cap--next",onClick:N,disabled:t===i,"aria-label":"Next page",children:n.jsx(o.default,{name:"CaretRight",size:16})}),r&&n.jsx("button",{type:"button",className:"pagination__cap pagination__cap--last",onClick:y,disabled:t===i,"aria-label":"Last page",children:n.jsx(o.default,{name:"CaretDoubleRight",size:16})})]})})}exports.default=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as a,jsxs as m}from"react/jsx-runtime";import{useState as J}from"react";import p from"../Icon/Icon.js";/* empty css */function I({currentPage:d=1,totalPages:n=10,onPageChange:h,variant:s="default",showFirstLast:g=!1,className:N=""}){const[b,_]=J(d.toString()),e=Math.max(1,Math.min(d,n)),x=()=>{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),r=Math.min(n-1,e+1);e<=3&&(r=Math.min(4,n-1)),e>=n-2&&(t=Math.max(2,n-3)),t>2&&i.push("ellipsis-start");for(let c=t;c<=r;c++)i.push(c);r<n-1&&i.push("ellipsis-end"),n>1&&i.push(n)}return i},l=i=>{i!==e&&i>=1&&i<=n&&h&&h(i)},C=()=>{e>1&&l(e-1)},j=()=>{e<n&&l(e+1)},w=()=>{l(1)},y=()=>{l(n)},$=i=>{i.preventDefault();const o=parseInt(b,10);o>=1&&o<=n?l(o):_(e.toString())},k=i=>{_(i.target.value)},M=x(),f=s==="underline"||s==="underline-with-jump"||s==="underline-double",v=s==="with-jump"||s==="underline-with-jump",u=s==="with-jump"||s==="underline-with-jump"||s==="underline-double"||g;return a("nav",{className:`pagination ${N}`,"aria-label":"Pagination",children:m("div",{className:`pagination__container ${f?"pagination__container--underline":""} ${u?"pagination__container--double":""}`,children:[u&&a("button",{type:"button",className:"pagination__cap pagination__cap--first",onClick:w,disabled:e===1,"aria-label":"First page",children:a(p,{name:"CaretDoubleLeft",size:16})}),a("button",{type:"button",className:"pagination__cap pagination__cap--prev",onClick:C,disabled:e===1,"aria-label":"Previous page",children:a(p,{name:"CaretLeft",size:16})}),M.map((i,o)=>{if(i==="ellipsis-start"||i==="ellipsis-end")return a("button",{type:"button",className:"pagination__item pagination__item--ellipsis",disabled:!0,"aria-hidden":"true",children:"..."},`ellipsis-${o}`);const t=i===e;return a("button",{type:"button",className:`pagination__item ${t?"pagination__item--active":""} ${f?"pagination__item--underline":""}`,onClick:()=>l(i),"aria-label":`Page ${i}`,"aria-current":t?"page":void 0,children:i},i)}),v&&m("div",{className:"pagination__jump",children:[a("form",{onSubmit:$,children:a("input",{type:"number",className:"pagination__jump-input",value:b,onChange:k,min:"1",max:n,"aria-label":"Jump to page"})}),m("span",{className:"pagination__jump-label",children:["of ",n]})]}),a("button",{type:"button",className:"pagination__cap pagination__cap--next",onClick:j,disabled:e===n,"aria-label":"Next page",children:a(p,{name:"CaretRight",size:16})}),u&&a("button",{type:"button",className:"pagination__cap pagination__cap--last",onClick:y,disabled:e===n,"aria-label":"Last page",children:a(p,{name:"CaretDoubleRight",size:16})})]})})}export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime");;/* empty css */const e="uds-pill-toggle";function h({label:o="Label States",selected:s=!1,onChange:a,id:c,disabled:l=!1,className:i="",...r}){const n=c||`pill-toggle-${Math.random().toString(36).substr(2,9)}`,u=d=>{!l&&a&&a(d.target.checked)},g=[e,s&&`${e}--selected`,l&&`${e}--disabled`,i].filter(Boolean).join(" ");return t.jsxs("label",{className:g,htmlFor:n,...r,children:[t.jsx("input",{type:"checkbox",id:n,className:`${e}__input`,checked:s,onChange:u,disabled:l}),t.jsx("span",{className:`${e}__label`,children:o})]})}exports.default=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as p,jsx as o}from"react/jsx-runtime";/* empty css */const e="uds-pill-toggle";function u({label:n="Label States",selected:t=!1,onChange:s,id:c,disabled:l=!1,className:i="",...r}){const a=c||`pill-toggle-${Math.random().toString(36).substr(2,9)}`,g=m=>{!l&&s&&s(m.target.checked)},h=[e,t&&`${e}--selected`,l&&`${e}--disabled`,i].filter(Boolean).join(" ");return p("label",{className:h,htmlFor:a,...r,children:[o("input",{type:"checkbox",id:a,className:`${e}__input`,checked:t,onChange:g,disabled:l}),o("span",{className:`${e}__label`,children:n})]})}export{u as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),g=require("react"),h=require("../Icon/Icon.cjs"),N=require("../Button/Button.cjs"),z=require("../ActionMenu/ActionMenu.cjs");;/* empty css */const J=["Placeholder","ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Check","Close","X","Plus","Minus","Edit","Pencil","Trash","Search","MagnifyingGlass","Settings","Gear","User","Users","Home","House","Star","Heart","Bookmark","Share","Download","Upload","Copy","CopySimple","Code","GearSix","List","SquaresFour","DiamondsFour","CirclesThree","CaretDown","CaretUp","CaretLeft","CaretRight","Info","Warning","CheckCircle","XCircle","Bell","Notification","Mail","Phone","Calendar","Clock","Image","File","Folder","Lock","Unlock","Eye","EyeSlash","Filter","Sort","Grid","Menu","More","DotsThree"];function V({component:t,propDefinitions:u={},title:X="Playground",initialProps:I={},renderComponent:v}){const[m,C]=g.useState("inspector"),S=()=>{const a={...I};return Object.keys(u).forEach(l=>{if(a[l]===void 0){const o=l.toLowerCase().includes("icon")||u[l].type==="icon",s=u[l].default;o&&(s===void 0||s==="")?a[l]="Placeholder":s!==void 0&&(a[l]=s)}}),a},[i,$]=g.useState(S),_=g.useCallback((a,l)=>{$(o=>({...o,[a]:l}))},[]);g.useCallback(()=>{$(S())},[]);const A=g.useCallback(()=>{const a=(t==null?void 0:t.name)||"Component",l=Object.entries(i).filter(([s,r])=>r!=null&&r!==""&&r!=="Placeholder").map(([s,r])=>typeof r=="string"?`${s}="${r}"`:typeof r=="boolean"?r?s:`${s}={false}`:`${s}={${JSON.stringify(r)}}`).join(" "),o=`<${a}${l?" "+l:""} />`;navigator.clipboard.writeText(o)},[i,t]),w=(a,l)=>{const{type:o,label:s,options:r,min:T,max:U,step:G,placeholder:D}=l,j=a.toLowerCase().includes("icon")||o==="icon",y=l.default,E=j&&(y===void 0||y==="")?"Placeholder":y??"",c=i[a]??E,M=j&&!r?J.map(d=>({value:d,label:d})):r;switch(o){case"icon":case"select":const d=M||r||[],b=d.find(n=>n.value===c)||d[0],H=b?b.label||b.value:c||"Select...",R=d.map(n=>({id:n.value,label:n.label||n.value,onClick:()=>_(a,n.value)}));return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx(z.default,{trigger:e.jsxs("button",{type:"button",className:"playground__select-trigger","aria-label":s||a,children:[e.jsx("span",{className:"playground__select-value",children:H}),e.jsx(h.default,{name:"CaretDown",size:16,appearance:"regular"})]}),items:R,placement:"bottom-start"})})]},a);case"boolean":return e.jsxs("div",{className:"playground__state-item",children:[e.jsx("label",{className:"playground__state-label",children:s||a}),e.jsx("input",{type:"checkbox",className:"playground__checkbox",checked:c,onChange:n=>_(a,n.target.checked)})]},a);case"number":return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx("input",{id:`playground-${a}`,type:"number",className:"playground__input",value:c,min:T,max:U,step:G,onChange:n=>_(a,Number(n.target.value))})})]},a);case"text":case"string":default:if(j){const n=M||[],f=n.find(p=>p.value===c)||n[0],Z=f?f.label||f.value:c||"Placeholder",B=n.map(p=>({id:p.value,label:p.label||p.value,onClick:()=>_(a,p.value)}));return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx(z.default,{trigger:e.jsxs("button",{type:"button",className:"playground__select-trigger","aria-label":s||a,children:[e.jsx("span",{className:"playground__select-value",children:Z}),e.jsx(h.default,{name:"CaretDown",size:16,appearance:"regular"})]}),items:B,placement:"bottom-start"})})]},a)}return e.jsxs("div",{className:"playground__field",children:[e.jsx("div",{className:"playground__field-head",children:e.jsx("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:s||a})}),e.jsx("div",{className:"playground__field-body",children:e.jsx("input",{id:`playground-${a}`,type:"text",className:"playground__input",value:c,placeholder:D,onChange:n=>_(a,n.target.value)})})]},a)}},P=Object.entries(u).filter(([a,l])=>l.type!=="boolean"),O=Object.entries(u).filter(([a,l])=>l.type==="boolean"),x=(t==null?void 0:t.name)||"Component",F=Object.entries(i).filter(([a,l])=>l!=null&&l!==""&&l!=="Placeholder").map(([a,l])=>typeof l=="string"?` ${a}="${l}"`:typeof l=="boolean"?l?` ${a}`:` ${a}={false}`:` ${a}={${JSON.stringify(l)}}`).join(`
|
|
2
|
+
`),q=`import { ${x} } from '@/components/${x}';
|
|
3
|
+
|
|
4
|
+
export function Example() {
|
|
5
|
+
return (
|
|
6
|
+
<${x}${F?`
|
|
7
|
+
`+F+`
|
|
8
|
+
`:" "}/> );
|
|
9
|
+
}`,L=a=>{let l=a;return l=l.replace(/\b(import|export|function|return|from)\b/g,'<span style="color: #c085fd;">$1</span>'),l=l.replace(/(['"])((?:\\.|(?!\1)[^\\])*?)\1/g,'<span style="color: #4ade80;">$1$2$1</span>'),l=l.replace(/<(\/?)([A-Z][a-zA-Z0-9]*)/g,'<span style="color: #f87070;"><$1$2</span>'),l=l.replace(/\b([A-Z][a-zA-Z0-9]*)\b(?=\s*[={])/g,'<span style="color: #61a5fa;">$1</span>'),l=l.replace(/(\w+)=/g,'<span style="color: #ca8a04;">$1</span>='),l};return e.jsx("div",{className:"playground",children:e.jsxs("div",{className:"playground__container",children:[e.jsxs("div",{className:"playground__canvas",children:[e.jsx("div",{className:"playground__canvas-content",children:v?v(i):e.jsx(t,{...i})}),e.jsxs("div",{className:"playground__actions",children:[e.jsx(N.default,{appearance:m==="code"?"primary":"text",layout:"icon-only",size:"small",icon:"Code","aria-label":"Show code",onClick:()=>C("code")}),e.jsx("div",{className:"playground__actions-divider"}),e.jsx(N.default,{appearance:m==="inspector"?"primary":"text",layout:"icon-only",size:"small",icon:"GearSix","aria-label":"Show inspector",onClick:()=>C("inspector")})]})]}),e.jsx("div",{className:"playground__panel",children:m==="inspector"?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"playground__panel-header",children:e.jsxs("div",{className:"playground__panel-header-content",children:[e.jsxs("div",{className:"playground__panel-title-row",children:[e.jsx(h.default,{name:"GearSix",size:16,appearance:"bold"}),e.jsx("h3",{className:"playground__panel-title",children:"Inspector"})]}),e.jsx("p",{className:"playground__panel-subtitle",children:"Customize component properties"})]})}),e.jsxs("div",{className:"playground__panel-content",children:[P.length>0&&e.jsxs("div",{className:"playground__section",children:[e.jsxs("div",{className:"playground__section-title",children:[e.jsx(h.default,{name:"SquaresFour",size:16,appearance:"bold"}),e.jsx("span",{children:"Properties"})]}),e.jsx("div",{className:"playground__section-content",children:P.map(([a,l])=>w(a,l))})]}),O.length>0&&e.jsxs("div",{className:"playground__section",children:[e.jsxs("div",{className:"playground__section-title",children:[e.jsx(h.default,{name:"SquaresFour",size:16,appearance:"bold"}),e.jsx("span",{children:"States"})]}),e.jsx("div",{className:"playground__section-content",children:e.jsx("div",{className:"playground__states-list",children:O.map(([a,l])=>w(a,l))})})]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"playground__panel-header",children:[e.jsxs("div",{className:"playground__panel-header-content",children:[e.jsx("div",{className:"playground__panel-title-row",children:e.jsx("h3",{className:"playground__panel-title",children:"Component Code"})}),e.jsx("p",{className:"playground__panel-subtitle",children:"Copy and paste into your project"})]}),e.jsx(N.default,{appearance:"outline",layout:"icon-left",size:"small",icon:"CopySimple",label:"Copy",onClick:A})]}),e.jsx("div",{className:"playground__code-container",children:e.jsx("div",{className:"playground__code-block",children:e.jsx("pre",{className:"playground__code-pre",children:e.jsx("code",{className:"playground__code",dangerouslySetInnerHTML:{__html:L(q)}})})})}),e.jsxs("div",{className:"playground__pro-tips",children:[e.jsx("p",{className:"playground__pro-tips-title",children:"Pro Tips:"}),e.jsxs("ul",{className:"playground__pro-tips-list",children:[e.jsx("li",{children:"Customize props in the inspector to update the code"}),e.jsx("li",{children:"All components are fully typed with TypeScript"}),e.jsx("li",{children:"Use Cmd/Ctrl + K to toggle the panel"})]})]})]})})]})})}exports.default=V;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{jsx as e,jsxs as n,Fragment as j}from"react/jsx-runtime";import{useState as A,useCallback as C}from"react";import h from"../Icon/Icon.js";import $ from"../Button/Button.js";import L from"../ActionMenu/ActionMenu.js";/* empty css */const K=["Placeholder","ArrowRight","ArrowLeft","ArrowUp","ArrowDown","Check","Close","X","Plus","Minus","Edit","Pencil","Trash","Search","MagnifyingGlass","Settings","Gear","User","Users","Home","House","Star","Heart","Bookmark","Share","Download","Upload","Copy","CopySimple","Code","GearSix","List","SquaresFour","DiamondsFour","CirclesThree","CaretDown","CaretUp","CaretLeft","CaretRight","Info","Warning","CheckCircle","XCircle","Bell","Notification","Mail","Phone","Calendar","Clock","Image","File","Folder","Lock","Unlock","Eye","EyeSlash","Filter","Sort","Grid","Menu","More","DotsThree"];function ne({component:s,propDefinitions:m={},title:W="Playground",initialProps:T={},renderComponent:S}){const[g,w]=A("inspector"),x=()=>{const a={...T};return Object.keys(m).forEach(l=>{if(a[l]===void 0){const c=l.toLowerCase().includes("icon")||m[l].type==="icon",r=m[l].default;c&&(r===void 0||r==="")?a[l]="Placeholder":r!==void 0&&(a[l]=r)}}),a},[d,P]=A(x),_=C((a,l)=>{P(c=>({...c,[a]:l}))},[]);C(()=>{P(x())},[]);const U=C(()=>{const a=(s==null?void 0:s.name)||"Component",l=Object.entries(d).filter(([r,t])=>t!=null&&t!==""&&t!=="Placeholder").map(([r,t])=>typeof t=="string"?`${r}="${t}"`:typeof t=="boolean"?t?r:`${r}={false}`:`${r}={${JSON.stringify(t)}}`).join(" "),c=`<${a}${l?" "+l:""} />`;navigator.clipboard.writeText(c)},[d,s]),O=(a,l)=>{const{type:c,label:r,options:t,min:E,max:H,step:Z,placeholder:q}=l,N=a.toLowerCase().includes("icon")||c==="icon",b=l.default,B=N&&(b===void 0||b==="")?"Placeholder":b??"",i=d[a]??B,M=N&&!t?K.map(p=>({value:p,label:p})):t;switch(c){case"icon":case"select":const p=M||t||[],f=p.find(o=>o.value===i)||p[0],J=f?f.label||f.value:i||"Select...",R=p.map(o=>({id:o.value,label:o.label||o.value,onClick:()=>_(a,o.value)}));return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e(L,{trigger:n("button",{type:"button",className:"playground__select-trigger","aria-label":r||a,children:[e("span",{className:"playground__select-value",children:J}),e(h,{name:"CaretDown",size:16,appearance:"regular"})]}),items:R,placement:"bottom-start"})})]},a);case"boolean":return n("div",{className:"playground__state-item",children:[e("label",{className:"playground__state-label",children:r||a}),e("input",{type:"checkbox",className:"playground__checkbox",checked:i,onChange:o=>_(a,o.target.checked)})]},a);case"number":return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e("input",{id:`playground-${a}`,type:"number",className:"playground__input",value:i,min:E,max:H,step:Z,onChange:o=>_(a,Number(o.target.value))})})]},a);case"text":case"string":default:if(N){const o=M||[],v=o.find(u=>u.value===i)||o[0],V=v?v.label||v.value:i||"Placeholder",X=o.map(u=>({id:u.value,label:u.label||u.value,onClick:()=>_(a,u.value)}));return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e(L,{trigger:n("button",{type:"button",className:"playground__select-trigger","aria-label":r||a,children:[e("span",{className:"playground__select-value",children:V}),e(h,{name:"CaretDown",size:16,appearance:"regular"})]}),items:X,placement:"bottom-start"})})]},a)}return n("div",{className:"playground__field",children:[e("div",{className:"playground__field-head",children:e("label",{className:"playground__field-label",htmlFor:`playground-${a}`,children:r||a})}),e("div",{className:"playground__field-body",children:e("input",{id:`playground-${a}`,type:"text",className:"playground__input",value:i,placeholder:q,onChange:o=>_(a,o.target.value)})})]},a)}},z=Object.entries(m).filter(([a,l])=>l.type!=="boolean"),F=Object.entries(m).filter(([a,l])=>l.type==="boolean"),y=(s==null?void 0:s.name)||"Component",I=Object.entries(d).filter(([a,l])=>l!=null&&l!==""&&l!=="Placeholder").map(([a,l])=>typeof l=="string"?` ${a}="${l}"`:typeof l=="boolean"?l?` ${a}`:` ${a}={false}`:` ${a}={${JSON.stringify(l)}}`).join(`
|
|
2
|
+
`),G=`import { ${y} } from '@/components/${y}';
|
|
3
|
+
|
|
4
|
+
export function Example() {
|
|
5
|
+
return (
|
|
6
|
+
<${y}${I?`
|
|
7
|
+
`+I+`
|
|
8
|
+
`:" "}/> );
|
|
9
|
+
}`,D=a=>{let l=a;return l=l.replace(/\b(import|export|function|return|from)\b/g,'<span style="color: #c085fd;">$1</span>'),l=l.replace(/(['"])((?:\\.|(?!\1)[^\\])*?)\1/g,'<span style="color: #4ade80;">$1$2$1</span>'),l=l.replace(/<(\/?)([A-Z][a-zA-Z0-9]*)/g,'<span style="color: #f87070;"><$1$2</span>'),l=l.replace(/\b([A-Z][a-zA-Z0-9]*)\b(?=\s*[={])/g,'<span style="color: #61a5fa;">$1</span>'),l=l.replace(/(\w+)=/g,'<span style="color: #ca8a04;">$1</span>='),l};return e("div",{className:"playground",children:n("div",{className:"playground__container",children:[n("div",{className:"playground__canvas",children:[e("div",{className:"playground__canvas-content",children:S?S(d):e(s,{...d})}),n("div",{className:"playground__actions",children:[e($,{appearance:g==="code"?"primary":"text",layout:"icon-only",size:"small",icon:"Code","aria-label":"Show code",onClick:()=>w("code")}),e("div",{className:"playground__actions-divider"}),e($,{appearance:g==="inspector"?"primary":"text",layout:"icon-only",size:"small",icon:"GearSix","aria-label":"Show inspector",onClick:()=>w("inspector")})]})]}),e("div",{className:"playground__panel",children:g==="inspector"?n(j,{children:[e("div",{className:"playground__panel-header",children:n("div",{className:"playground__panel-header-content",children:[n("div",{className:"playground__panel-title-row",children:[e(h,{name:"GearSix",size:16,appearance:"bold"}),e("h3",{className:"playground__panel-title",children:"Inspector"})]}),e("p",{className:"playground__panel-subtitle",children:"Customize component properties"})]})}),n("div",{className:"playground__panel-content",children:[z.length>0&&n("div",{className:"playground__section",children:[n("div",{className:"playground__section-title",children:[e(h,{name:"SquaresFour",size:16,appearance:"bold"}),e("span",{children:"Properties"})]}),e("div",{className:"playground__section-content",children:z.map(([a,l])=>O(a,l))})]}),F.length>0&&n("div",{className:"playground__section",children:[n("div",{className:"playground__section-title",children:[e(h,{name:"SquaresFour",size:16,appearance:"bold"}),e("span",{children:"States"})]}),e("div",{className:"playground__section-content",children:e("div",{className:"playground__states-list",children:F.map(([a,l])=>O(a,l))})})]})]})]}):n(j,{children:[n("div",{className:"playground__panel-header",children:[n("div",{className:"playground__panel-header-content",children:[e("div",{className:"playground__panel-title-row",children:e("h3",{className:"playground__panel-title",children:"Component Code"})}),e("p",{className:"playground__panel-subtitle",children:"Copy and paste into your project"})]}),e($,{appearance:"outline",layout:"icon-left",size:"small",icon:"CopySimple",label:"Copy",onClick:U})]}),e("div",{className:"playground__code-container",children:e("div",{className:"playground__code-block",children:e("pre",{className:"playground__code-pre",children:e("code",{className:"playground__code",dangerouslySetInnerHTML:{__html:D(G)}})})})}),n("div",{className:"playground__pro-tips",children:[e("p",{className:"playground__pro-tips-title",children:"Pro Tips:"}),n("ul",{className:"playground__pro-tips-list",children:[e("li",{children:"Customize props in the inspector to update the code"}),e("li",{children:"All components are fully typed with TypeScript"}),e("li",{children:"Use Cmd/Ctrl + K to toggle the panel"})]})]})]})})]})})}export{ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime");;/* empty css */const e="uds-progress-circle",$={xxs:"xxs",xs:"xs",sm:"sm",md:"md",lg:"lg"},k={circle:"circle","half-circle":"half-circle"};function y({value:h=40,max:f=100,size:a="md",shape:s="circle",label:l,showLabel:_=!0,className:v="","aria-label":b,...j}){const m=Math.min(Math.max(h/f*100,0),100),g=Math.round(m),u={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}},r=u[a]||u.md,o=(r.size-r.strokeWidth)/2,t=s==="half-circle"?Math.PI*o:2*Math.PI*o,x=t-m/100*t,M=[e,$[a]&&`${e}--${$[a]}`,k[s]&&`${e}--${k[s]}`,v].filter(Boolean).join(" "),W=`progress-circle-${Math.random().toString(36).substr(2,9)}`,z=l?`${W}-label`:void 0,i=r.size,n=i/2,p=i/2,S=s==="half-circle"?i/2:i,d=s==="half-circle"?i:p;return c.jsxs("div",{className:M,role:"progressbar","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":f,"aria-label":b||l||`Progress: ${g}%`,"aria-labelledby":z,...j,children:[c.jsxs("svg",{className:`${e}__svg`,width:r.size,height:S,viewBox:`0 ${s==="half-circle"?i/2:0} ${i} ${S}`,children:[c.jsx("circle",{className:`${e}__track`,cx:n,cy:d,r:o,fill:"none",strokeWidth:r.strokeWidth,strokeDasharray:t,strokeDashoffset:s==="half-circle"?t/2:0,pathLength:t}),c.jsx("circle",{className:`${e}__fill`,cx:n,cy:d,r:o,fill:"none",strokeWidth:r.strokeWidth,strokeDasharray:t,strokeDashoffset:s==="half-circle"?t/2+x:x,pathLength:t,strokeLinecap:"round",transform:`rotate(-90 ${n} ${d})`})]}),c.jsxs("div",{className:`${e}__content`,children:[l&&_&&c.jsx("span",{id:z,className:`${e}__label`,children:l}),c.jsxs("span",{className:`${e}__value`,style:{fontSize:`${r.fontSize}px`},children:[g,"%"]})]})]})}exports.default=y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as c,jsx as h}from"react/jsx-runtime";/* empty css */const e="uds-progress-circle",u={xxs:"xxs",xs:"xs",sm:"sm",md:"md",lg:"lg"},_={circle:"circle","half-circle":"half-circle"};function w({value:f=40,max:m=100,size:l="md",shape:s="circle",label:o,showLabel:v=!0,className:b="","aria-label":p,...W}){const g=Math.min(Math.max(f/m*100,0),100),z=Math.round(g),$={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}},r=$[l]||$.md,a=(r.size-r.strokeWidth)/2,t=s==="half-circle"?Math.PI*a:2*Math.PI*a,x=t-g/100*t,M=[e,u[l]&&`${e}--${u[l]}`,_[s]&&`${e}--${_[s]}`,b].filter(Boolean).join(" "),N=`progress-circle-${Math.random().toString(36).substr(2,9)}`,S=o?`${N}-label`:void 0,i=r.size,n=i/2,y=i/2,k=s==="half-circle"?i/2:i,d=s==="half-circle"?i:y;return c("div",{className:M,role:"progressbar","aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":m,"aria-label":p||o||`Progress: ${z}%`,"aria-labelledby":S,...W,children:[c("svg",{className:`${e}__svg`,width:r.size,height:k,viewBox:`0 ${s==="half-circle"?i/2:0} ${i} ${k}`,children:[h("circle",{className:`${e}__track`,cx:n,cy:d,r:a,fill:"none",strokeWidth:r.strokeWidth,strokeDasharray:t,strokeDashoffset:s==="half-circle"?t/2:0,pathLength:t}),h("circle",{className:`${e}__fill`,cx:n,cy:d,r:a,fill:"none",strokeWidth:r.strokeWidth,strokeDasharray:t,strokeDashoffset:s==="half-circle"?t/2+x:x,pathLength:t,strokeLinecap:"round",transform:`rotate(-90 ${n} ${d})`})]}),c("div",{className:`${e}__content`,children:[o&&v&&h("span",{id:S,className:`${e}__label`,children:o}),c("span",{className:`${e}__value`,style:{fontSize:`${r.fontSize}px`},children:[z,"%"]})]})]})}export{w as default};
|
|
@@ -0,0 +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",m={default:"default",blue:"blue",green:"green",success:"green",orange:"orange",warning:"orange",red:"red",error:"red",purple:"purple"},g={small:"small",medium:"medium",large:"large"};function h({value:r=0,max:l=100,variant:n="default",size:i="medium",label:s,showValue:t=!1,showLabel:d=!0,className:p="","aria-label":_,...$}){const o=Math.min(Math.max(r/l*100,0),100),u=Math.round(o),v=[e,m[n]&&`${e}--${m[n]}`,g[i]&&`${e}--${g[i]}`,p].filter(Boolean).join(" "),f=`progress-${Math.random().toString(36).substr(2,9)}`,c=s?`${f}-label`:void 0;return a.jsxs("div",{className:v,...$,children:[s&&d||t?a.jsxs("div",{className:`${e}__header`,children:[s&&d&&a.jsx("span",{id:c,className:`${e}__label`,children:s}),t&&a.jsxs("span",{className:`${e}__value`,children:[u,"%"]})]}):null,a.jsx("div",{className:`${e}__track`,children:a.jsx("div",{className:`${e}__fill`,role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":l,"aria-label":_||s||`Progress: ${u}%`,"aria-labelledby":c,style:{width:`${o}%`}})})]})}exports.default=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as r,jsx as s}from"react/jsx-runtime";/* empty css */const a="uds-progress-indicator",g={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"};function M({value:l=0,max:n=100,variant:i="default",size:d="medium",label:e,showValue:o=!1,showLabel:t=!0,className:$="","aria-label":_,...f}){const c=Math.min(Math.max(l/n*100,0),100),m=Math.round(c),h=[a,g[i]&&`${a}--${g[i]}`,p[d]&&`${a}--${p[d]}`,$].filter(Boolean).join(" "),v=`progress-${Math.random().toString(36).substr(2,9)}`,u=e?`${v}-label`:void 0;return r("div",{className:h,...f,children:[e&&t||o?r("div",{className:`${a}__header`,children:[e&&t&&s("span",{id:u,className:`${a}__label`,children:e}),o&&r("span",{className:`${a}__value`,children:[m,"%"]})]}):null,s("div",{className:`${a}__track`,children:s("div",{className:`${a}__fill`,role:"progressbar","aria-valuenow":l,"aria-valuemin":0,"aria-valuemax":n,"aria-label":_||e||`Progress: ${m}%`,"aria-labelledby":u,style:{width:`${c}%`}})})]})}export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime");;/* empty css */function m({checked:s=!1,onChange:r,name:t,id:n,value:l,label:i,disabled:e=!1,className:d="",...u}){const o=n||`radio-${Math.random().toString(36).substr(2,9)}`,c=_=>{!e&&r&&r(_)};return a.jsxs("label",{className:`radio ${e?"radio--disabled":""} ${d}`,htmlFor:o,children:[a.jsx("input",{type:"radio",id:o,name:t,value:l,className:"radio__input",checked:s,onChange:c,disabled:e,...u}),a.jsx("span",{className:"radio__circle",children:s&&a.jsx("span",{className:"radio__dot"})}),i&&a.jsx("span",{className:"radio__label",children:i})]})}exports.default=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as _,jsx as a}from"react/jsx-runtime";/* empty css */function u({checked:s=!1,onChange:i,name:t,id:d,value:e,label:o,disabled:r=!1,className:l="",...c}){const n=d||`radio-${Math.random().toString(36).substr(2,9)}`,m=p=>{!r&&i&&i(p)};return _("label",{className:`radio ${r?"radio--disabled":""} ${l}`,htmlFor:n,children:[a("input",{type:"radio",id:n,name:t,value:e,className:"radio__input",checked:s,onChange:m,disabled:r,...c}),a("span",{className:"radio__circle",children:s&&a("span",{className:"radio__dot"})}),o&&a("span",{className:"radio__label",children:o})]})}export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),M=require("react");;/* empty css */const s="uds-slider";function H({value:S,onChange:_,min:a=0,max:r=100,step:o=1,range:c=!1,showLabels:I=!1,label:h,disabled:i=!1,className:V="","aria-label":g,...E}){const[P,b]=M.useState(c?[a,r]:a),[f,D]=M.useState(null),N=M.useRef(null),$=S!==void 0,p=$?S:P,d=c?p[0]:a,u=c?p[1]:p,x=`slider-${Math.random().toString(36).substr(2,9)}`,F=t=>(t-a)/(r-a)*100,R=t=>{if(!N.current)return a;const l=N.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(t-l.left)/l.width)),m=a+n*(r-a);return Math.round(m/o)*o},w=(t,l)=>{i||(t.preventDefault(),D(l))},q=t=>{if(!f||i)return;const l=R(t.clientX);let n;c?f==="min"?n=[Math.min(l,u-o),u]:n=[d,Math.max(l,d+o)]:n=l,$||b(n),_&&_(n)},B=()=>{D(null)};M.useEffect(()=>{if(f){const t=n=>q(n),l=()=>B();return document.addEventListener("mousemove",t),document.addEventListener("mouseup",l),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",l)}}},[f,d,u,c,o,i,$,_]);const y=(t,l)=>{if(i)return;const n=parseFloat(t.target.value);let m;c?l==="min"?m=[Math.min(n,u-o),u]:m=[d,Math.max(n,d+o)]:m=n,$||b(m),_&&_(m)},j=F(d),v=F(u),C=j,L=v-j,A=[s,c&&`${s}--range`,i&&`${s}--disabled`,V].filter(Boolean).join(" ");return e.jsxs("div",{className:A,...E,children:[h&&e.jsx("div",{className:`${s}__header`,children:e.jsx("label",{htmlFor:x,className:`${s}__label`,children:h})}),e.jsxs("div",{className:`${s}__container`,ref:N,children:[e.jsx("div",{className:`${s}__track`,children:c?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${s}__fill`,style:{left:`${C}%`,width:`${L}%`}}),e.jsx("input",{type:"range",id:`${x}-min`,min:a,max:r,step:o,value:d,onChange:t=>y(t,"min"),disabled:i,className:`${s}__input ${s}__input--min`,"aria-label":g||`${h||"Slider"} minimum value`}),e.jsx("input",{type:"range",id:`${x}-max`,min:a,max:r,step:o,value:u,onChange:t=>y(t,"max"),disabled:i,className:`${s}__input ${s}__input--max`,"aria-label":g||`${h||"Slider"} maximum value`}),e.jsx("div",{className:`${s}__thumb ${s}__thumb--min`,style:{left:`${j}%`},onMouseDown:t=>w(t,"min"),role:"slider","aria-valuemin":a,"aria-valuemax":r,"aria-valuenow":d,tabIndex:i?-1:0}),e.jsx("div",{className:`${s}__thumb ${s}__thumb--max`,style:{left:`${v}%`},onMouseDown:t=>w(t,"max"),role:"slider","aria-valuemin":a,"aria-valuemax":r,"aria-valuenow":u,tabIndex:i?-1:0})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${s}__fill`,style:{width:`${v}%`}}),e.jsx("input",{type:"range",id:x,min:a,max:r,step:o,value:u,onChange:t=>y(t,"single"),disabled:i,className:`${s}__input`,"aria-label":g||h||"Slider"}),e.jsx("div",{className:`${s}__thumb`,style:{left:`${v}%`},onMouseDown:t=>w(t,"single"),role:"slider","aria-valuemin":a,"aria-valuemax":r,"aria-valuenow":u,tabIndex:i?-1:0})]})}),I&&e.jsx("div",{className:`${s}__labels`,children:c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:`${s}__label-value`,style:{left:`${j}%`},children:[Math.round((d-a)/(r-a)*100),"%"]}),e.jsxs("span",{className:`${s}__label-value`,style:{left:`${v}%`},children:[Math.round((u-a)/(r-a)*100),"%"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:`${s}__label-value`,children:"0%"}),e.jsxs("span",{className:`${s}__label-value`,style:{left:`${v}%`},children:[Math.round((u-a)/(r-a)*100),"%"]})]})})]})]})}exports.default=H;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as m,jsx as s,Fragment as g}from"react/jsx-runtime";import{useState as P,useRef as X,useEffect as q}from"react";/* empty css */const t="uds-slider";function K({value:I,onChange:h,min:a=0,max:r=100,step:o=1,range:c=!1,showLabels:F=!1,label:f,disabled:u=!1,className:j="","aria-label":w,...B}){const[C,V]=P(c?[a,r]:a),[$,E]=P(null),y=X(null),p=I!==void 0,x=p?I:C,d=c?x[0]:a,i=c?x[1]:x,M=`slider-${Math.random().toString(36).substr(2,9)}`,b=e=>(e-a)/(r-a)*100,L=e=>{if(!y.current)return a;const l=y.current.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e-l.left)/l.width)),v=a+n*(r-a);return Math.round(v/o)*o},S=(e,l)=>{u||(e.preventDefault(),E(l))},R=e=>{if(!$||u)return;const l=L(e.clientX);let n;c?$==="min"?n=[Math.min(l,i-o),i]:n=[d,Math.max(l,d+o)]:n=l,p||V(n),h&&h(n)},A=()=>{E(null)};q(()=>{if($){const e=n=>R(n),l=()=>A();return document.addEventListener("mousemove",e),document.addEventListener("mouseup",l),()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",l)}}},[$,d,i,c,o,u,p,h]);const D=(e,l)=>{if(u)return;const n=parseFloat(e.target.value);let v;c?l==="min"?v=[Math.min(n,i-o),i]:v=[d,Math.max(n,d+o)]:v=n,p||V(v),h&&h(v)},N=b(d),_=b(i),H=N,k=_-N,U=[t,c&&`${t}--range`,u&&`${t}--disabled`,j].filter(Boolean).join(" ");return m("div",{className:U,...B,children:[f&&s("div",{className:`${t}__header`,children:s("label",{htmlFor:M,className:`${t}__label`,children:f})}),m("div",{className:`${t}__container`,ref:y,children:[s("div",{className:`${t}__track`,children:c?m(g,{children:[s("div",{className:`${t}__fill`,style:{left:`${H}%`,width:`${k}%`}}),s("input",{type:"range",id:`${M}-min`,min:a,max:r,step:o,value:d,onChange:e=>D(e,"min"),disabled:u,className:`${t}__input ${t}__input--min`,"aria-label":w||`${f||"Slider"} minimum value`}),s("input",{type:"range",id:`${M}-max`,min:a,max:r,step:o,value:i,onChange:e=>D(e,"max"),disabled:u,className:`${t}__input ${t}__input--max`,"aria-label":w||`${f||"Slider"} maximum value`}),s("div",{className:`${t}__thumb ${t}__thumb--min`,style:{left:`${N}%`},onMouseDown:e=>S(e,"min"),role:"slider","aria-valuemin":a,"aria-valuemax":r,"aria-valuenow":d,tabIndex:u?-1:0}),s("div",{className:`${t}__thumb ${t}__thumb--max`,style:{left:`${_}%`},onMouseDown:e=>S(e,"max"),role:"slider","aria-valuemin":a,"aria-valuemax":r,"aria-valuenow":i,tabIndex:u?-1:0})]}):m(g,{children:[s("div",{className:`${t}__fill`,style:{width:`${_}%`}}),s("input",{type:"range",id:M,min:a,max:r,step:o,value:i,onChange:e=>D(e,"single"),disabled:u,className:`${t}__input`,"aria-label":w||f||"Slider"}),s("div",{className:`${t}__thumb`,style:{left:`${_}%`},onMouseDown:e=>S(e,"single"),role:"slider","aria-valuemin":a,"aria-valuemax":r,"aria-valuenow":i,tabIndex:u?-1:0})]})}),F&&s("div",{className:`${t}__labels`,children:c?m(g,{children:[m("span",{className:`${t}__label-value`,style:{left:`${N}%`},children:[Math.round((d-a)/(r-a)*100),"%"]}),m("span",{className:`${t}__label-value`,style:{left:`${_}%`},children:[Math.round((i-a)/(r-a)*100),"%"]})]}):m(g,{children:[s("span",{className:`${t}__label-value`,children:"0%"}),m("span",{className:`${t}__label-value`,style:{left:`${_}%`},children:[Math.round((i-a)/(r-a)*100),"%"]})]})})]})]})}export{K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),p=require("../DotStatus/DotStatus.cjs");;/* empty css */const e="uds-status",o={"light-gray":"light-gray",white:"white"},u={pill:"pill",rounded:"rounded"};function h({label:l,variant:r="blue",appearance:a="light-gray",shape:n="pill",className:c="",onClick:i,disabled:s=!1,...d}){const g=[e,o[a]&&`${e}--${o[a]}`,u[n]&&`${e}--${u[n]}`,s&&`${e}--disabled`,c].filter(Boolean).join(" "),m=i?"button":"span";return t.jsxs(m,{className:g,onClick:s?void 0:i,disabled:s,...d,children:[t.jsx(p.default,{variant:r,size:"small",className:`${e}__dot`}),l&&t.jsx("span",{className:`${e}__label`,children:l})]})}exports.default=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as d,jsx as n}from"react/jsx-runtime";import h from"../DotStatus/DotStatus.js";/* empty css */const s="uds-status",i={"light-gray":"light-gray",white:"white"},r={pill:"pill",rounded:"rounded"};function _({label:l,variant:c="blue",appearance:a="light-gray",shape:e="pill",className:m="",onClick:o,disabled:t=!1,...p}){const u=[s,i[a]&&`${s}--${i[a]}`,r[e]&&`${s}--${r[e]}`,t&&`${s}--disabled`,m].filter(Boolean).join(" ");return d(o?"button":"span",{className:u,onClick:t?void 0:o,disabled:t,...p,children:[n(h,{variant:c,size:"small",className:`${s}__dot`}),l&&n("span",{className:`${s}__label`,children:l})]})}export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("react/jsx-runtime"),A=require("react"),r=require("../Icon/Icon.cjs");;/* empty css */const t="uds-steps",u={horizontal:"horizontal",vertical:"vertical"},m={complete:"complete",active:"active",incomplete:"incomplete",disabled:"disabled",error:"error",warning:"warning"},p={default:"default",compact:"compact"};function B({steps:i=[],orientation:s="horizontal",size:l="default",displayLabel:$=!0,className:v="",...h}){if(!i||i.length===0)return null;const j=[t,u[s]&&`${t}--${u[s]}`,p[l]&&`${t}--${p[l]}`,v].filter(Boolean).join(" "),S=(e,a)=>e===0?"start":e===a-1?"end":"middle",N=e=>e.status||"incomplete",b=(e,a)=>e<a-1,o=e=>e==="complete",d=e=>e==="active",g=e=>e==="incomplete",x=e=>e==="error",f=e=>e==="warning",C=e=>e==="disabled",w=(e,a)=>o(e)||d(e)?"active":"inactive";return c.jsx("div",{className:j,...h,children:i.map((e,a)=>{const n=N(e),z=S(a,i.length),_=b(a,i.length),M=_?w(n):null,q=[`${t}__step`,m[n]&&`${t}__step--${m[n]}`,`${t}__step--${z}`].filter(Boolean).join(" ");return c.jsxs(A.Fragment,{children:[c.jsxs("div",{className:q,children:[c.jsxs("div",{className:`${t}__indicator`,children:[o(n)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--complete`,children:c.jsx(r.default,{name:"Check",size:12,appearance:"bold",className:`${t}__check-icon`})}),d(n)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--active`}),g(n)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--incomplete`}),x(n)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--error`,children:c.jsx(r.default,{name:"X",size:12,appearance:"bold",className:`${t}__error-icon`})}),f(n)&&c.jsx("div",{className:`${t}__indicator-circle ${t}__indicator-circle--warning`,children:c.jsx(r.default,{name:"WarningCircle",size:12,appearance:"bold",className:`${t}__warning-icon`})}),C(n)&&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})]})]}),_&&c.jsx("div",{className:`${t}__connector ${t}__connector--${M}`})]},a)})})}exports.default=B;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as r}from"react/jsx-runtime";import k from"react";import o from"../Icon/Icon.js";/* empty css */const c="uds-steps",p={horizontal:"horizontal",vertical:"vertical"},u={complete:"complete",active:"active",incomplete:"incomplete",disabled:"disabled",error:"error",warning:"warning"},$={default:"default",compact:"compact"};function x({steps:i=[],orientation:l="horizontal",size:s="default",displayLabel:h=!0,className:v="",...N}){if(!i||i.length===0)return null;const S=[c,p[l]&&`${c}--${p[l]}`,$[s]&&`${c}--${$[s]}`,v].filter(Boolean).join(" "),b=(e,a)=>e===0?"start":e===a-1?"end":"middle",f=e=>e.status||"incomplete",g=(e,a)=>e<a-1,d=e=>e==="complete",_=e=>e==="active",C=e=>e==="incomplete",w=e=>e==="error",z=e=>e==="warning",j=e=>e==="disabled",A=(e,a)=>d(e)||_(e)?"active":"inactive";return t("div",{className:S,...N,children:i.map((e,a)=>{const n=f(e),B=b(a,i.length),m=g(a,i.length),L=m?A(n):null,M=[`${c}__step`,u[n]&&`${c}__step--${u[n]}`,`${c}__step--${B}`].filter(Boolean).join(" ");return r(k.Fragment,{children:[r("div",{className:M,children:[r("div",{className:`${c}__indicator`,children:[d(n)&&t("div",{className:`${c}__indicator-circle ${c}__indicator-circle--complete`,children:t(o,{name:"Check",size:12,appearance:"bold",className:`${c}__check-icon`})}),_(n)&&t("div",{className:`${c}__indicator-circle ${c}__indicator-circle--active`}),C(n)&&t("div",{className:`${c}__indicator-circle ${c}__indicator-circle--incomplete`}),w(n)&&t("div",{className:`${c}__indicator-circle ${c}__indicator-circle--error`,children:t(o,{name:"X",size:12,appearance:"bold",className:`${c}__error-icon`})}),z(n)&&t("div",{className:`${c}__indicator-circle ${c}__indicator-circle--warning`,children:t(o,{name:"WarningCircle",size:12,appearance:"bold",className:`${c}__warning-icon`})}),j(n)&&t("div",{className:`${c}__indicator-circle ${c}__indicator-circle--disabled`})]}),h&&r("div",{className:`${c}__label-container`,children:[e.label&&t("span",{className:`${c}__label`,children:e.label}),e.optionalLabel&&t("span",{className:`${c}__optional-label`,children:e.optionalLabel})]})]}),m&&t("div",{className:`${c}__connector ${c}__connector--${L}`})]},a)})})}export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),h=require("react"),j=require("../Icon/Icon.cjs");;/* empty css */const e="uds-table";function p({columns:i=[],data:d=[],className:a="",bodyWeight:n="medium",..._}){const o=[e,`${e}--body-weight-${n}`,a].filter(Boolean).join(" ");return l.jsx("div",{className:`${e}__wrapper`,children:l.jsxs("table",{className:o,..._,children:[i.length>0&&l.jsx("thead",{className:`${e}__head`,children:l.jsx("tr",{className:`${e}__row`,children:i.map((s,r)=>l.jsx(b,{type:"header",column:s,index:r},s.key||r))})}),l.jsx("tbody",{className:`${e}__body`,children:d.map((s,r)=>l.jsx("tr",{className:`${e}__row`,children:i.map((t,c)=>l.jsx(b,{type:"cell",column:t,row:s,rowIndex:r,colIndex:c},t.key||c))},r))})]})})}const b=h.memo(function({type:d,column:a,row:n,rowIndex:_,colIndex:o}){const s=d==="header",r=s?"th":"td",t=s?a.label:n==null?void 0:n[a.key],c=[`${e}__cell`,s&&`${e}__cell--header`,a.align&&`${e}__cell--${a.align}`,a.className].filter(Boolean).join(" "),$=()=>!s&&a.render?a.render(n,_,o):h.isValidElement(t)?t:s?l.jsxs("div",{className:`${e}__cell-content`,children:[a.icon&&l.jsx(j.default,{name:a.icon,size:16,appearance:"regular",className:`${e}__cell-icon`}),a.label&&l.jsx("span",{className:`${e}__cell-label`,children:a.label}),a.sortable&&l.jsx(j.default,{name:"CaretUpDown",size:16,appearance:"regular",className:`${e}__cell-sort-icon`}),a.filterable&&l.jsx(j.default,{name:"Funnel",size:16,appearance:"regular",className:`${e}__cell-filter-icon`})]}):l.jsx("div",{className:`${e}__cell-content`,children:t!=null?String(t):""});return l.jsx(r,{className:c,children:$()})}),m=h.memo(p);m.Cell=b;exports.default=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as l,jsxs as $}from"react/jsx-runtime";import p from"react";import m from"../Icon/Icon.js";/* empty css */const e="uds-table";function N({columns:i=[],data:d=[],className:a="",bodyWeight:n="medium",..._}){const o=[e,`${e}--body-weight-${n}`,a].filter(Boolean).join(" ");return l("div",{className:`${e}__wrapper`,children:$("table",{className:o,..._,children:[i.length>0&&l("thead",{className:`${e}__head`,children:l("tr",{className:`${e}__row`,children:i.map((r,s)=>l(h,{type:"header",column:r,index:s},r.key||s))})}),l("tbody",{className:`${e}__body`,children:d.map((r,s)=>l("tr",{className:`${e}__row`,children:i.map((t,c)=>l(h,{type:"cell",column:t,row:r,rowIndex:s,colIndex:c},t.key||c))},s))})]})})}const h=p.memo(function({type:d,column:a,row:n,rowIndex:_,colIndex:o}){const r=d==="header",s=r?"th":"td",t=r?a.label:n==null?void 0:n[a.key],c=[`${e}__cell`,r&&`${e}__cell--header`,a.align&&`${e}__cell--${a.align}`,a.className].filter(Boolean).join(" ");return l(s,{className:c,children:!r&&a.render?a.render(n,_,o):p.isValidElement(t)?t:r?$("div",{className:`${e}__cell-content`,children:[a.icon&&l(m,{name:a.icon,size:16,appearance:"regular",className:`${e}__cell-icon`}),a.label&&l("span",{className:`${e}__cell-label`,children:a.label}),a.sortable&&l(m,{name:"CaretUpDown",size:16,appearance:"regular",className:`${e}__cell-sort-icon`}),a.filterable&&l(m,{name:"Funnel",size:16,appearance:"regular",className:`${e}__cell-filter-icon`})]}):l("div",{className:`${e}__cell-content`,children:t!=null?String(t):""})})}),b=p.memo(N);b.Cell=h;export{b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),d=require("react"),x=require("../Badge/Badge.cjs"),y=require("../Icon/Icon.cjs"),S="uds-tabs-item";function g({label:e,active:i=!1,icon:r,tag:t,tagVariant:f="red",className:m="",onClick:s,...c}){const b=[S,i&&"active",m].filter(Boolean).join(" "),j=s?"button":"div",p=!!r&&typeof r=="string",v=!!t&&(typeof t=="number"||typeof t=="string");let n="";e!=null&&(typeof e=="string"?n=e:n=String(e));const u={};return Object.keys(c).forEach(l=>{const o=c[l];(o==null||typeof o!="object"||d.isValidElement(o))&&(u[l]=o)}),a.jsxs(j,{className:b,onClick:s,role:s?"tab":void 0,"aria-selected":s?i:void 0,...u,children:[p&&a.jsx(y.default,{name:r,size:16,appearance:"bold"}),n&&a.jsx("span",{children:n}),v&&a.jsx(x.default,{count:t,variant:f})]})}const h=d.memo(g);exports.default=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as v,jsx as r}from"react/jsx-runtime";import l from"react";import y from"../Badge/Badge.js";import x from"../Icon/Icon.js";const E="uds-tabs-item";function I({label:e,active:i=!1,icon:a,tag:t,tagVariant:d="red",className:p="",onClick:o,...m}){const u=[E,i&&"active",p].filter(Boolean).join(" "),b=o?"button":"div",h=!!a&&typeof a=="string",j=!!t&&(typeof t=="number"||typeof t=="string");let s="";e!=null&&(typeof e=="string"?s=e:s=String(e));const f={};return Object.keys(m).forEach(c=>{const n=m[c];(n==null||typeof n!="object"||l.isValidElement(n))&&(f[c]=n)}),v(b,{className:u,onClick:o,role:o?"tab":void 0,"aria-selected":o?i:void 0,...f,children:[h&&r(x,{name:a,size:16,appearance:"bold"}),s&&r("span",{children:s}),j&&r(y,{count:t,variant:d})]})}const A=l.memo(I);export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),n=require("react"),_=require("./TabItem.cjs"),R=require("../Button/Button.cjs");;/* empty css */const i="uds-tabs",W={underline:"underline",block:"block","block-inverted":"block-inverted"};function z({tabs:c=[],appearance:S="underline",activeTab:f,fill:$=!1,scrollable:r=!1,onTabChange:y,className:E="",...k}){const v=n.useRef(null),l=n.useRef(null),[A,B]=n.useState(!1),[N,V]=n.useState(!1),g=f!=null&&f>=0&&f<c.length?f:0,j=[i,W[S]&&`${i}--${W[S]}`,$&&`${i}--fill`,r&&`${i}--scrollable`,E].filter(Boolean).join(" "),L=n.useCallback((t,e)=>{e.onClick&&e.onClick(t,e),y&&y(t,e)},[y]),d=n.useCallback(()=>{if(!r||!v.current||!l.current)return;const t=v.current,e=l.current,o=t.offsetWidth,u=e.scrollWidth,s=e.scrollLeft;B(s>0),V(s<u-o-1)},[r]),m=n.useCallback(()=>{if(!r||!l.current||g===void 0)return;const t=l.current,e=v.current,o=t.children[g];if(!o||!e)return;const u=e.offsetWidth,s=o.offsetLeft,p=o.offsetWidth,h=t.scrollLeft,C=s+p,M=h,O=h+u;s<M?t.scrollTo({left:s-16,behavior:"smooth"}):C>O&&t.scrollTo({left:C-u+16,behavior:"smooth"})},[g,r]),q=n.useCallback(()=>{if(!l.current)return;const t=l.current.offsetWidth*.75;l.current.scrollBy({left:-t,behavior:"smooth"})},[]),w=n.useCallback(()=>{if(!l.current)return;const t=l.current.offsetWidth*.75;l.current.scrollBy({left:t,behavior:"smooth"})},[]);if(n.useEffect(()=>{if(!r)return;d(),m();const t=v.current,e=l.current;if(!t||!e)return;const o=new ResizeObserver(()=>{d(),m()});return o.observe(t),o.observe(e),e.addEventListener("scroll",d),()=>{o.disconnect(),e.removeEventListener("scroll",d)}},[d,m,r,c.length]),n.useEffect(()=>{f==null&&y&&c.length>0&&y(0,c[0])},[]),n.useEffect(()=>{r&&setTimeout(()=>{m(),d()},100)},[d,g,m,r]),!c||c.length===0)return null;const x=a.jsx("div",{ref:l,className:`${i}__list`,role:"tablist",...k,children:c.map((t,e)=>{if(!t||typeof t!="object")return null;const o=t.label!=null&&typeof t.label=="string"?t.label:t.label!=null&&typeof t.label!="object"?String(t.label):"",u=typeof t.icon=="string"?t.icon:void 0,s=typeof t.tag=="number"||typeof t.tag=="string"?t.tag:void 0,p=typeof t.tagVariant=="string"?t.tagVariant:void 0,h=t.id!=null&&typeof t.id!="object"?typeof t.id=="string"||typeof t.id=="number"?t.id:String(t.id):e;return a.jsx(_.default,{label:o,appearance:S,active:e===g,icon:u,tag:s,tagVariant:p,onClick:()=>L(e,t)},h)})});return r?a.jsxs("div",{ref:v,className:j,children:[A&&a.jsx(R.default,{appearance:"ghost",layout:"icon-only",icon:"CaretLeft",onClick:q,className:`${i}__scroll-button ${i}__scroll-button--left`,"aria-label":"Scroll tabs left"}),x,N&&a.jsx(R.default,{appearance:"ghost",layout:"icon-only",icon:"CaretRight",onClick:w,className:`${i}__scroll-button ${i}__scroll-button--right`,"aria-label":"Scroll tabs right"})]}):a.jsx("div",{className:j,role:"tablist",...k,children:c.map((t,e)=>{if(!t||typeof t!="object")return null;const o=t.label!=null&&typeof t.label=="string"?t.label:t.label!=null&&typeof t.label!="object"?String(t.label):"",u=typeof t.icon=="string"?t.icon:void 0,s=typeof t.tag=="number"||typeof t.tag=="string"?t.tag:void 0,p=typeof t.tagVariant=="string"?t.tagVariant:void 0,h=t.id!=null&&typeof t.id!="object"?typeof t.id=="string"||typeof t.id=="number"?t.id:String(t.id):e;return a.jsx(_.default,{label:o,appearance:S,active:e===g,icon:u,tag:s,tagVariant:p,onClick:()=>L(e,t)},h)})})}const K=n.memo(z);exports.default=K;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as g,jsxs as D}from"react/jsx-runtime";import F,{useRef as W,useState as j,useCallback as v,useEffect as L}from"react";import $ from"./TabItem.js";import A from"../Button/Button.js";/* empty css */const i="uds-tabs",B={underline:"underline",block:"block","block-inverted":"block-inverted"};function G({tabs:s=[],appearance:S="underline",activeTab:f,fill:N=!1,scrollable:l=!1,onTabChange:a,className:V="",...k}){const m=W(null),n=W(null),[w,E]=j(!1),[z,K]=j(!1),d=f!=null&&f>=0&&f<s.length?f:0,_=[i,B[S]&&`${i}--${B[S]}`,N&&`${i}--fill`,l&&`${i}--scrollable`,V].filter(Boolean).join(" "),R=v((t,e)=>{e.onClick&&e.onClick(t,e),a&&a(t,e)},[a]),u=v(()=>{if(!l||!m.current||!n.current)return;const t=m.current,e=n.current,o=t.offsetWidth,c=e.scrollWidth,r=e.scrollLeft;E(r>0),K(r<c-o-1)},[l]),y=v(()=>{if(!l||!n.current||d===void 0)return;const t=n.current,e=m.current,o=t.children[d];if(!o||!e)return;const c=e.offsetWidth,r=o.offsetLeft,p=o.offsetWidth,h=t.scrollLeft,C=r+p,T=h,q=h+c;r<T?t.scrollTo({left:r-16,behavior:"smooth"}):C>q&&t.scrollTo({left:C-c+16,behavior:"smooth"})},[d,l]),O=v(()=>{if(!n.current)return;const t=n.current.offsetWidth*.75;n.current.scrollBy({left:-t,behavior:"smooth"})},[]),I=v(()=>{if(!n.current)return;const t=n.current.offsetWidth*.75;n.current.scrollBy({left:t,behavior:"smooth"})},[]);if(L(()=>{if(!l)return;u(),y();const t=m.current,e=n.current;if(!t||!e)return;const o=new ResizeObserver(()=>{u(),y()});return o.observe(t),o.observe(e),e.addEventListener("scroll",u),()=>{o.disconnect(),e.removeEventListener("scroll",u)}},[u,y,l,s.length]),L(()=>{f==null&&a&&s.length>0&&a(0,s[0])},[]),L(()=>{l&&setTimeout(()=>{y(),u()},100)},[u,d,y,l]),!s||s.length===0)return null;const M=g("div",{ref:n,className:`${i}__list`,role:"tablist",...k,children:s.map((t,e)=>{if(!t||typeof t!="object")return null;const o=t.label!=null&&typeof t.label=="string"?t.label:t.label!=null&&typeof t.label!="object"?String(t.label):"",c=typeof t.icon=="string"?t.icon:void 0,r=typeof t.tag=="number"||typeof t.tag=="string"?t.tag:void 0,p=typeof t.tagVariant=="string"?t.tagVariant:void 0,h=t.id!=null&&typeof t.id!="object"?typeof t.id=="string"||typeof t.id=="number"?t.id:String(t.id):e;return g($,{label:o,appearance:S,active:e===d,icon:c,tag:r,tagVariant:p,onClick:()=>R(e,t)},h)})});return l?D("div",{ref:m,className:_,children:[w&&g(A,{appearance:"ghost",layout:"icon-only",icon:"CaretLeft",onClick:O,className:`${i}__scroll-button ${i}__scroll-button--left`,"aria-label":"Scroll tabs left"}),M,z&&g(A,{appearance:"ghost",layout:"icon-only",icon:"CaretRight",onClick:I,className:`${i}__scroll-button ${i}__scroll-button--right`,"aria-label":"Scroll tabs right"})]}):g("div",{className:_,role:"tablist",...k,children:s.map((t,e)=>{if(!t||typeof t!="object")return null;const o=t.label!=null&&typeof t.label=="string"?t.label:t.label!=null&&typeof t.label!="object"?String(t.label):"",c=typeof t.icon=="string"?t.icon:void 0,r=typeof t.tag=="number"||typeof t.tag=="string"?t.tag:void 0,p=typeof t.tagVariant=="string"?t.tagVariant:void 0,h=t.id!=null&&typeof t.id!="object"?typeof t.id=="string"||typeof t.id=="number"?t.id:String(t.id):e;return g($,{label:o,appearance:S,active:e===d,icon:c,tag:r,tagVariant:p,onClick:()=>R(e,t)},h)})})}const X=F.memo(G);export{X as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),b=require("../Icon/Icon.cjs");;/* empty css */const e="uds-tag",u={"label-only":"label-only","icon-left":"icon-left"},i={compact:"compact",default:"default"},d={transparent:"transparent",neutral:"neutral",red:"red",orange:"orange",yellow:"yellow",emerald:"emerald",green:"green",sky:"sky",cyan:"cyan",blue:"blue",indigo:"indigo",purple:"purple",fuchsia:"fuchsia",magenta:"magenta",inverse:"inverse"};function _({label:t="Label",appearance:s="label-only",size:l="compact",color:r="transparent",rounded:p=!0,solid:m=!1,icon:a,className:f="",onClick:o,...g}){const y=[e,u[s]&&`${e}--${u[s]}`,i[l]&&`${e}--${i[l]}`,d[r]&&`${e}--${d[r]}`,p&&`${e}--rounded`,m&&`${e}--solid`,f].filter(Boolean).join(" "),$=o?"button":"span",c=s==="icon-left"&&a;return n.jsxs($,{className:y,onClick:o,...g,children:[c&&typeof a=="string"&&n.jsx(b.default,{name:a,size:l==="compact"?10:12,appearance:"regular",className:`${e}__icon`}),c&&typeof a!="string"&&n.jsx("span",{className:`${e}__icon`,children:a}),t&&n.jsx("span",{className:`${e}__label`,children:t})]})}exports.default=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as b,jsx as l}from"react/jsx-runtime";import _ from"../Icon/Icon.js";/* empty css */const e="uds-tag",p={"label-only":"label-only","icon-left":"icon-left"},i={compact:"compact",default:"default"},m={transparent:"transparent",neutral:"neutral",red:"red",orange:"orange",yellow:"yellow",emerald:"emerald",green:"green",sky:"sky",cyan:"cyan",blue:"blue",indigo:"indigo",purple:"purple",fuchsia:"fuchsia",magenta:"magenta",inverse:"inverse"};function x({label:t="Label",appearance:n="label-only",size:s="compact",color:r="transparent",rounded:u=!0,solid:d=!1,icon:a,className:f="",onClick:o,...g}){const y=[e,p[n]&&`${e}--${p[n]}`,i[s]&&`${e}--${i[s]}`,m[r]&&`${e}--${m[r]}`,u&&`${e}--rounded`,d&&`${e}--solid`,f].filter(Boolean).join(" "),$=o?"button":"span",c=n==="icon-left"&&a;return b($,{className:y,onClick:o,...g,children:[c&&typeof a=="string"&&l(_,{name:a,size:s==="compact"?10:12,appearance:"regular",className:`${e}__icon`}),c&&typeof a!="string"&&l("span",{className:`${e}__icon`,children:a}),t&&l("span",{className:`${e}__label`,children:t})]})}export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),e=require("./Text.spec.cjs");;/* empty css */const g={regular:"ds-text--weight-regular",medium:"ds-text--weight-medium",semibold:"ds-text--weight-semibold",bold:"ds-text--weight-bold"},u={tight:"ds-text--leading-tight",regular:"ds-text--leading-regular",loose:"ds-text--leading-loose"};function x({as:t,variant:s,weight:i=e.TextSpec.variants.weight.default,leading:l=e.TextSpec.variants.leading.default,className:d="",children:o,...r}){const a=t??"p";return n.jsx(a,{className:["ds-text",`ds-text--${s}`,g[i],u[l],d].filter(Boolean).join(" "),...r,children:o})}exports.Text=x;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{TextSpec as t}from"./Text.spec.js";/* empty css */const r={regular:"ds-text--weight-regular",medium:"ds-text--weight-medium",semibold:"ds-text--weight-semibold",bold:"ds-text--weight-bold"},g={tight:"ds-text--leading-tight",regular:"ds-text--leading-regular",loose:"ds-text--leading-loose"};function p({as:e,variant:i,weight:o=t.variants.weight.default,leading:s=t.variants.leading.default,className:d="",children:l,...a}){return n(e??"p",{className:["ds-text",`ds-text--${i}`,r[o],g[s],d].filter(Boolean).join(" "),...a,children:l})}export{p as Text};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={variants:{weight:{default:"regular"},leading:{default:"regular"}}};exports.TextSpec=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={variants:{weight:{default:"regular"},leading:{default:"regular"}}};export{e as TextSpec};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),G=require("react"),O=require("../Icon/Icon.cjs");;/* empty css */const e="uds-input",j={compact:"compact",default:"default"},I={default:"default",focused:"focused",error:"error",disabled:"disabled"};function R({value:x,onChange:v,placeholder:g,type:N="text",size:l="default",state:h="default",disabled:c=!1,icon:n,iconPosition:d="right",onIconClick:u,id:B,label:i,helperText:a,errorText:r,className:S="","aria-describedby":y,...C}){const s=c?"disabled":h,q=G.useId().replace(/:/g,""),o=B??(!!i||!!a||!!r?`${e}-${q}`:void 0),p=a?`${o}-helper-text`:void 0,$=r?`${o}-error-text`:void 0,M=[y,s==="error"?$:p].filter(Boolean).join(" ")||void 0,w=[e,j[l]&&`${e}--${j[l]}`,I[s]&&`${e}--${I[s]}`,n&&`${e}--has-icon-${d}`].filter(Boolean).join(" "),f=[`${e}-wrapper`,n&&`${e}-wrapper--icon-${d}`,S].filter(Boolean).join(" "),_=t.jsx("input",{id:o,type:N,className:w,value:x,onChange:v,placeholder:g,disabled:c||s==="disabled","aria-invalid":s==="error"?!0:void 0,"aria-describedby":M,...C}),m=()=>{if(!n)return t.jsx("div",{className:f,children:_});const E=l==="compact"?16:20,b=typeof n=="string"?t.jsx(O.default,{name:n,size:E}):n,A=u?t.jsx("button",{type:"button",className:`${e}__icon ${e}__icon--${d} ${e}__icon--clickable`,onClick:u,disabled:c||s==="disabled",tabIndex:-1,"aria-label":"Input action",children:b}):t.jsx("span",{className:`${e}__icon ${e}__icon--${d}`,children:b});return t.jsxs("div",{className:f,children:[_,A]})};return!i&&!a&&!r?m():t.jsxs("div",{className:`${e}-field`,children:[i?t.jsx("label",{className:`${e}__label`,htmlFor:o,children:i}):null,m(),s==="error"&&r?t.jsx("p",{id:$,className:`${e}__supporting-text ${e}__supporting-text--error`,children:r}):null,s!=="error"&&a?t.jsx("p",{id:p,className:`${e}__supporting-text`,children:a}):null]})}exports.default=R;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as b,jsx as a}from"react/jsx-runtime";import M from"react";import k from"../Icon/Icon.js";/* empty css */const e="uds-input",N={compact:"compact",default:"default"},h={default:"default",focused:"focused",error:"error",disabled:"disabled"};function D({value:v,onChange:g,placeholder:B,type:x="text",size:c="default",state:S="default",disabled:l=!1,icon:n,iconPosition:o="right",onIconClick:p,id:j,label:d,helperText:s,errorText:r,className:y="","aria-describedby":C,...w}){const t=l?"disabled":S,E=M.useId().replace(/:/g,""),i=j??(!!d||!!s||!!r?`${e}-${E}`:void 0),u=s?`${i}-helper-text`:void 0,m=r?`${i}-error-text`:void 0,z=[C,t==="error"?m:u].filter(Boolean).join(" ")||void 0,A=[e,N[c]&&`${e}--${N[c]}`,h[t]&&`${e}--${h[t]}`,n&&`${e}--has-icon-${o}`].filter(Boolean).join(" "),$=[`${e}-wrapper`,n&&`${e}-wrapper--icon-${o}`,y].filter(Boolean).join(" "),f=a("input",{id:i,type:x,className:A,value:v,onChange:g,placeholder:B,disabled:l||t==="disabled","aria-invalid":t==="error"?!0:void 0,"aria-describedby":z,...w}),_=()=>{if(!n)return a("div",{className:$,children:f});const I=typeof n=="string"?a(k,{name:n,size:c==="compact"?16:20}):n,G=p?a("button",{type:"button",className:`${e}__icon ${e}__icon--${o} ${e}__icon--clickable`,onClick:p,disabled:l||t==="disabled",tabIndex:-1,"aria-label":"Input action",children:I}):a("span",{className:`${e}__icon ${e}__icon--${o}`,children:I});return b("div",{className:$,children:[f,G]})};return!d&&!s&&!r?_():b("div",{className:`${e}-field`,children:[d?a("label",{className:`${e}__label`,htmlFor:i,children:d}):null,_(),t==="error"&&r?a("p",{id:m,className:`${e}__supporting-text ${e}__supporting-text--error`,children:r}):null,t!=="error"&&s?a("p",{id:u,className:`${e}__supporting-text`,children:s}):null]})}export{D as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const S=require("react/jsx-runtime");;/* empty css */const e="uds-textarea",l={compact:"compact",default:"default"},r={default:"default",focused:"focused",error:"error",disabled:"disabled"};function p({value:o,onChange:u,placeholder:d,size:a="default",state:c="default",resize:i=!0,disabled:s=!1,id:f,className:n="",...b}){const t=s?"disabled":c,m=[e,l[a]&&`${e}--${l[a]}`,r[t]&&`${e}--${r[t]}`,!i&&`${e}--no-resize`,n].filter(Boolean).join(" ");return S.jsx("textarea",{id:f,className:m,value:o,onChange:u,placeholder:d,disabled:s||t==="disabled",...b})}exports.default=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as x}from"react/jsx-runtime";/* empty css */const e="uds-textarea",o={compact:"compact",default:"default"},d={default:"default",focused:"focused",error:"error",disabled:"disabled"};function S({value:l,onChange:r,placeholder:c,size:t="default",state:f="default",resize:u=!0,disabled:s=!1,id:i,className:n="",...m}){const a=s?"disabled":f,p=[e,o[t]&&`${e}--${o[t]}`,d[a]&&`${e}--${d[a]}`,!u&&`${e}--no-resize`,n].filter(Boolean).join(" ");return x("textarea",{id:i,className:p,value:l,onChange:r,placeholder:c,disabled:s||a==="disabled",...m})}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),i=require("../Icon/Icon.cjs");;/* empty css */const s="uds-toast",o={success:"success",error:"error",warning:"warning",info:"info"},m={success:"CheckCircle",error:"XCircle",warning:"Warning",info:"Info"};function j({message:a,variant:n="info",title:r,showIcon:l=!0,showClose:t=!0,onClose:c,className:u="",...d}){const f=[s,o[n]&&`${s}--${o[n]}`,u].filter(Boolean).join(" "),_=m[n]||"Info";return e.jsxs("div",{className:f,role:"alert",...d,children:[l&&e.jsx("div",{className:`${s}__icon`,children:e.jsx(i.default,{name:_,size:20,appearance:"fill"})}),e.jsxs("div",{className:`${s}__content`,children:[r&&e.jsx("div",{className:`${s}__title`,children:r}),a&&e.jsx("div",{className:`${s}__message`,children:a})]}),t&&c&&e.jsx("button",{type:"button",className:`${s}__close`,onClick:c,"aria-label":"Close toast",children:e.jsx(i.default,{name:"X",size:16,appearance:"regular"})})]})}exports.default=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as o,jsx as s}from"react/jsx-runtime";import i from"../Icon/Icon.js";/* empty css */const e="uds-toast",l={success:"success",error:"error",warning:"warning",info:"info"},_={success:"CheckCircle",error:"XCircle",warning:"Warning",info:"Info"};function C({message:a,variant:n="info",title:r,showIcon:t=!0,showClose:m=!0,onClose:c,className:d="",...f}){const u=[e,l[n]&&`${e}--${l[n]}`,d].filter(Boolean).join(" "),p=_[n]||"Info";return o("div",{className:u,role:"alert",...f,children:[t&&s("div",{className:`${e}__icon`,children:s(i,{name:p,size:20,appearance:"fill"})}),o("div",{className:`${e}__content`,children:[r&&s("div",{className:`${e}__title`,children:r}),a&&s("div",{className:`${e}__message`,children:a})]}),m&&c&&s("button",{type:"button",className:`${e}__close`,onClick:c,"aria-label":"Close toast",children:s(i,{name:"X",size:16,appearance:"regular"})})]})}export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=require("react");;/* empty css */const e="uds-toggle",u={large:"large",small:"small"};function j({checked:s,state:d,size:i="large",onChange:l,disabled:n=!1,id:c,className:m="",...f}){const r=o.useRef(null),t=d??(s?"on":"off");o.useEffect(()=>{r.current&&(r.current.indeterminate=t==="indeterminate")},[t]);const g=t==="indeterminate"?"mixed":t==="on"||!!s,h=[e,u[i]&&`${e}--${u[i]}`,t==="indeterminate"&&`${e}--indeterminate`,n&&`${e}--disabled`,m].filter(Boolean).join(" "),_=p=>{!n&&l&&l(p.target.checked)};return a.jsxs("label",{className:h,htmlFor:c,children:[a.jsx("input",{ref:r,type:"checkbox",role:"switch",id:c,className:`${e}__input`,checked:s||t==="on","aria-checked":g,"aria-disabled":n||void 0,onChange:_,disabled:n,...f}),a.jsx("span",{className:`${e}__slider`,"aria-hidden":"true",children:t==="indeterminate"?a.jsx("span",{className:`${e}__dash`}):a.jsx("span",{className:`${e}__thumb`})})]})}exports.default=j;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as _,jsx as n}from"react/jsx-runtime";import{useRef as $,useEffect as N}from"react";/* empty css */const e="uds-toggle",c={large:"large",small:"small"};function j({checked:s,state:m,size:i="large",onChange:l,disabled:t=!1,id:o,className:d="",...f}){const r=$(null),a=m??(s?"on":"off");N(()=>{r.current&&(r.current.indeterminate=a==="indeterminate")},[a]);const u=a==="indeterminate"?"mixed":a==="on"||!!s,h=[e,c[i]&&`${e}--${c[i]}`,a==="indeterminate"&&`${e}--indeterminate`,t&&`${e}--disabled`,d].filter(Boolean).join(" "),p=g=>{!t&&l&&l(g.target.checked)};return _("label",{className:h,htmlFor:o,children:[n("input",{ref:r,type:"checkbox",role:"switch",id:o,className:`${e}__input`,checked:s||a==="on","aria-checked":u,"aria-disabled":t||void 0,onChange:p,disabled:t,...f}),n("span",{className:`${e}__slider`,"aria-hidden":"true",children:a==="indeterminate"?n("span",{className:`${e}__dash`}):n("span",{className:`${e}__thumb`})})]})}export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),n=require("react");;/* empty css */const a="uds-tooltip",b={top:"top",bottom:"bottom",left:"left",right:"right"};function S({children:f,content:p,placement:s="top",disabled:R=!1,className:m="",...v}){const[l,d]=n.useState(!1),c=n.useRef(null),h=n.useRef(null);if(n.useEffect(()=>{if(!l||!h.current||!c.current)return;const u=h.current,t=c.current.getBoundingClientRect(),e=u.getBoundingClientRect();let o=0,i=0;switch(s){case"top":o=t.top-e.height-8,i=t.left+t.width/2-e.width/2;break;case"bottom":o=t.bottom+8,i=t.left+t.width/2-e.width/2;break;case"left":o=t.top+t.height/2-e.height/2,i=t.left-e.width-8;break;case"right":o=t.top+t.height/2-e.height/2,i=t.right+8;break}const g=window.innerWidth,w=window.innerHeight;i<8&&(i=8),i+e.width>g-8&&(i=g-e.width-8),o<8&&(o=8),o+e.height>w-8&&(o=w-e.height-8),u.style.top=`${o}px`,u.style.left=`${i}px`},[l,s]),!p||R)return r.jsx(r.Fragment,{children:f});const M=()=>{d(!0)},j=()=>{d(!1)},x=[a,b[s]&&`${a}--${b[s]}`,m].filter(Boolean).join(" ");return r.jsxs("div",{ref:c,className:x,onMouseEnter:M,onMouseLeave:j,...v,children:[f,l&&r.jsx("div",{ref:h,className:`${a}__content`,role:"tooltip",children:p})]})}exports.default=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as g,Fragment as k,jsxs as B}from"react/jsx-runtime";import{useState as C,useRef as w,useEffect as E}from"react";/* empty css */const c="uds-tooltip",m={top:"top",bottom:"bottom",left:"left",right:"right"};function _({children:a,content:f,placement:s="top",disabled:b=!1,className:v="",...R}){const[r,p]=C(!1),n=w(null),l=w(null);if(E(()=>{if(!r||!l.current||!n.current)return;const h=l.current,t=n.current.getBoundingClientRect(),e=h.getBoundingClientRect();let o=0,i=0;switch(s){case"top":o=t.top-e.height-8,i=t.left+t.width/2-e.width/2;break;case"bottom":o=t.bottom+8,i=t.left+t.width/2-e.width/2;break;case"left":o=t.top+t.height/2-e.height/2,i=t.left-e.width-8;break;case"right":o=t.top+t.height/2-e.height/2,i=t.right+8;break}const u=window.innerWidth,d=window.innerHeight;i<8&&(i=8),i+e.width>u-8&&(i=u-e.width-8),o<8&&(o=8),o+e.height>d-8&&(o=d-e.height-8),h.style.top=`${o}px`,h.style.left=`${i}px`},[r,s]),!f||b)return g(k,{children:a});const x=()=>{p(!0)},M=()=>{p(!1)},$=[c,m[s]&&`${c}--${m[s]}`,v].filter(Boolean).join(" ");return B("div",{ref:n,className:$,onMouseEnter:x,onMouseLeave:M,...R,children:[a,r&&g("div",{ref:l,className:`${c}__content`,role:"tooltip",children:f})]})}export{_ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=["primary","soft","outline","text","ghost","disabled","destructive"],e=["label-only","icon-left","icon-right","icon-only","only"],E=["large","default","small","xsmall"],t=["display-128","display-96","display-72","display-60","display-48","display-36","heading-32","heading-28","heading-24","body-20","body-16","body-14","body-12"],o=["regular","medium","semibold","bold"],_=["tight","regular","loose"],l=["row","column"],s=["flex-start","center","flex-end","space-between","space-around","space-evenly"],S=["stretch","flex-start","center","flex-end","baseline"],n=["nowrap","wrap","wrap-reverse"],N=["0","2","4","8","12","16","24","32"],a=["default","compact"],d=["default","focused","error","disabled"],I=["left","right"],c=["regular","bold","thin","light","duotone","fill","solid","outline"],i=["light","dark"];exports.BUTTON_APPEARANCES=T;exports.BUTTON_LAYOUTS=e;exports.BUTTON_SIZES=E;exports.FLEX_ALIGN_ITEMS=S;exports.FLEX_DIRECTIONS=l;exports.FLEX_GAP_TOKENS=N;exports.FLEX_JUSTIFY_CONTENT=s;exports.FLEX_WRAP_VALUES=n;exports.ICON_APPEARANCES=c;exports.MENU_MODES=i;exports.TEXT_INPUT_ICON_POSITIONS=I;exports.TEXT_INPUT_SIZES=a;exports.TEXT_INPUT_STATES=d;exports.TEXT_LEADINGS=_;exports.TEXT_VARIANTS=t;exports.TEXT_WEIGHTS=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=["primary","soft","outline","text","ghost","disabled","destructive"],t=["label-only","icon-left","icon-right","icon-only","only"],o=["large","default","small","xsmall"],l=["display-128","display-96","display-72","display-60","display-48","display-36","heading-32","heading-28","heading-24","body-20","body-16","body-14","body-12"],s=["regular","medium","semibold","bold"],n=["tight","regular","loose"],a=["row","column"],T=["flex-start","center","flex-end","space-between","space-around","space-evenly"],d=["stretch","flex-start","center","flex-end","baseline"],c=["nowrap","wrap","wrap-reverse"],i=["0","2","4","8","12","16","24","32"],r=["default","compact"],E=["default","focused","error","disabled"],_=["left","right"],S=["regular","bold","thin","light","duotone","fill","solid","outline"],N=["light","dark"];export{e as BUTTON_APPEARANCES,t as BUTTON_LAYOUTS,o as BUTTON_SIZES,d as FLEX_ALIGN_ITEMS,a as FLEX_DIRECTIONS,i as FLEX_GAP_TOKENS,T as FLEX_JUSTIFY_CONTENT,c as FLEX_WRAP_VALUES,S as ICON_APPEARANCES,N as MENU_MODES,_ as TEXT_INPUT_ICON_POSITIONS,r as TEXT_INPUT_SIZES,E as TEXT_INPUT_STATES,n as TEXT_LEADINGS,l as TEXT_VARIANTS,s as TEXT_WEIGHTS};
|
|
@@ -3,9 +3,11 @@ import type { BadgeProps } from "./Badge.types";
|
|
|
3
3
|
/**
|
|
4
4
|
* Badge component for displaying badges
|
|
5
5
|
* @param {number|string} count - The count to display (will be formatted with + if over maxCount)
|
|
6
|
-
* @param {string} variant - Color variant: '
|
|
6
|
+
* @param {string} variant - Color variant: 'blue', 'cyan', 'green', 'magenta', 'indigo', 'rose', 'neutral', 'orange', 'purple', 'red', 'sky', 'yellow', 'inverse', 'lime'
|
|
7
|
+
* @param {string} appearance - Visual style variant: 'solid' or 'outlined'
|
|
8
|
+
* @param {boolean} rounded - Whether badge corners are fully rounded
|
|
7
9
|
* @param {number} maxCount - Maximum count to display before showing "+" (default: 99)
|
|
8
10
|
* @param {string} className - Additional CSS classes
|
|
9
11
|
* @param {object} props - Additional props to pass to the badge element
|
|
10
12
|
*/
|
|
11
|
-
export default function Badge({ count, variant, maxCount, className, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export default function Badge({ count, variant, appearance, rounded, maxCount, className, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { HTMLAttributes } from "react";
|
|
2
|
+
export type BadgeVariant = "blue" | "cyan" | "green" | "magenta" | "indigo" | "rose" | "neutral" | "orange" | "purple" | "red" | "sky" | "yellow" | "inverse" | "lime";
|
|
3
|
+
export type BadgeAppearance = "solid" | "outlined";
|
|
2
4
|
export interface BadgeProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
5
|
count?: unknown;
|
|
4
|
-
variant?:
|
|
6
|
+
variant?: BadgeVariant;
|
|
7
|
+
appearance?: BadgeAppearance;
|
|
8
|
+
rounded?: boolean;
|
|
5
9
|
maxCount?: number;
|
|
6
10
|
className?: string;
|
|
7
11
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
export type ContainerAppearance = "default" | "transparent";
|
|
3
|
+
export type ContainerPadding = "none" | "xsmall" | "small" | "default" | "large" | "xlarge";
|
|
4
|
+
export interface ContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
appearance?: ContainerAppearance;
|
|
6
|
+
padding?: ContainerPadding;
|
|
7
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "./_dropdown.scss";
|
|
2
3
|
import type { DropdownProps } from "./Dropdown.types";
|
|
3
4
|
/**
|
|
@@ -18,4 +19,6 @@ import type { DropdownProps } from "./Dropdown.types";
|
|
|
18
19
|
* @param {boolean} disabled - Whether the dropdown is disabled
|
|
19
20
|
* @param {object} props - Additional props to pass to the trigger button
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
declare function Dropdown({ options, value, onChange, placeholder, size, state, placement, id, label, className, disabled, ...props }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare const _default: React.MemoExoticComponent<typeof Dropdown>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "./_empty-state.scss";
|
|
2
|
+
import type { EmptyStateProps } from "./EmptyState.types";
|
|
3
|
+
export declare function EmptyState({ title, description, icon, iconSize, action, secondaryAction, align, className, ...props }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|