@yahoo/uds 1.4.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
package/cli/README.md CHANGED
@@ -3,6 +3,11 @@ import { Box, VStack } from '@yahoo/uds';
3
3
  import { RequiredChip } from '~/components/RequiredChip';
4
4
  import { DocImage } from '~/components/DocImage';
5
5
  import { PACKAGE_MANAGERS, CommandSnippet } from '~/components/CommandSnippet';
6
+ import { toPageTitle } from '~/utils/toPageTitle';
7
+
8
+ export const metadata = {
9
+ title: toPageTitle({ title: 'CLI', category: 'Tools' }),
10
+ };
6
11
 
7
12
  # Universal CLI
8
13
 
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  "use client";
2
- "use strict";var e=require("../chunk-RILYWBPB.cjs"),t=require("../chunk-PECN66KD.cjs"),n=require("../chunk-WLOEKYUI.cjs"),i=require("../chunk-J6D4HCFT.cjs"),a=require("@yahoo/uds/fixtures"),o=require("react/jsx-runtime"),r=require("framer-motion"),s=require("react"),c={scale:.7,opacity:0},l={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},u={icon:l,hide:c,loading:c},d={loading:l,hide:c,icon:c},m=`var(${i.BUTTON_CSS_VAR_MAP.columnGap})`,h=`var(${i.BUTTON_CSS_VAR_MAP.iconSize})`,p={rest:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.rest})`},hover:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.hover})`},pressed:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:m}},g={hide:{width:"0px",opacity:0,display:"none"},loading:{width:h,display:"flex",opacity:1},icon:{width:h,display:"flex",opacity:1}},f=({size:e,variant:t})=>{if("outline"===t)switch(e){case"sm":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===t)switch(e){case"sm":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return o.jsx(o.Fragment,{})},x=()=>import("../motionFeatures-THWWLQYC.cjs").then((({domAnimation:e})=>e));function v({reducedMotion:e="user",children:i,layoutVariant:a="subtle",layoutSpeed:c="3",colorVariant:l="smooth",colorSpeed:u="3"}){const d=n.motion[a][c],m=n.motion[l][u],[h,p]=s.useState(d),[g,f]=s.useState(m),v={variant:l,speed:u},j=t.getMotionVar({...v,control:"stiffness"}),b=t.getMotionVar({...v,control:"damping"}),S={variant:a,speed:c},y=t.getMotionVar({...S,control:"stiffness"}),M=t.getMotionVar({...S,control:"damping"});s.useEffect((()=>{const e=getComputedStyle(document.documentElement),t={damping:Number(e.getPropertyValue(M)),stiffness:Number(e.getPropertyValue(y))},n={damping:Number(e.getPropertyValue(b)),stiffness:Number(e.getPropertyValue(j))};p(t),f(n)}),[b,j,M,y]);const I=s.useMemo((()=>({type:"spring",mass:1,...h,layout:h,opacity:g,color:g,borderColor:g,backgroundColor:g})),[g,h]);return o.jsx(r.LazyMotion,{features:x,strict:!0,children:o.jsx(r.MotionConfig,{transition:I,reducedMotion:e,children:i})})}var j=e.createSlot(),b=r.m.create(j,{forwardMotionProps:!0}),S=s.forwardRef((function({palette:t,variant:n,size:i,startIcon:c,endIcon:l,iconVariant:m,loading:h,disableEffects:x,children:j,asChild:S,className:y,...M},I){const C=s.useRef(null);s.useImperativeHandle(I,(()=>C.current));const w=l?"icon":"hide",N=(({startIcon:e,endIcon:t,loading:n})=>e||t||n?"withIcon":"withoutIcon")({startIcon:c,endIcon:l,loading:h}),V=(({loading:e,startIcon:t})=>e?"loading":t?"icon":"hide")({loading:h,startIcon:c}),z={button:e.getStyles({buttonSize:i,buttonVariant:n,buttonPalette:t,className:e.cx("uds-button","uds-ring","uds-hit-target",h&&"uds-button-loading",x&&"uds-button-without-effects","withIcon"===N&&"uds-button-with-gap",y)}),iconContainer:"uds-button-icon-container flex overflow-hidden",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},A=r.useReducedMotion()?"smooth":"subtle",P=s.useMemo((()=>o.jsx(r.m.span,{className:z.iconContainer,initial:!1,variants:g,animate:V,children:o.jsxs(r.AnimatePresence,{initial:!1,mode:"popLayout",children:[h&&o.jsx(r.m.span,{variants:d,initial:"hide",animate:"loading",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:f,variant:m,color:"current",className:z.loading})},"loading"),c&&!h&&o.jsx(r.m.span,{variants:u,initial:"hide",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:c,variant:m,color:"current",className:z.start})},c.name)]})})),[z.iconContainer,z.loading,z.start,V,h,m,c]),T=s.useMemo((()=>o.jsx(r.m.span,{className:z.iconContainer,initial:!1,variants:g,animate:w,children:o.jsx(r.AnimatePresence,{initial:!1,mode:"popLayout",children:l&&o.jsx(r.m.span,{variants:u,initial:"hide",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:l,variant:m,color:"current",className:z.start})},l.name)})})),[z.iconContainer,z.start,l,w,m]),_=s.useMemo((()=>x?{...p,rest:{},hover:{},pressed:{}}:p),[x]);return S&&s.isValidElement(j)?o.jsx(v,{layoutSpeed:"3",layoutVariant:A,children:o.jsx(b,{className:z.button,initial:["hide",N],animate:N,variants:_,whileHover:"hover",whileTap:"pressed",...M,children:s.cloneElement(j,j.props,o.jsxs(o.Fragment,{children:[P,j.props.children,T]}))})}):o.jsx(v,{layoutSpeed:"3",layoutVariant:A,children:o.jsxs(r.m.button,{ref:C,className:z.button,initial:["hide",N],animate:N,variants:_,whileHover:"hover",whileTap:"pressed",...M,children:[P,j,T]})})})),y=s.forwardRef((function({palette:t,variant:n,size:i,iconVariant:c,loading:l,disableEffects:m,name:h,className:g,...x},j){const b=s.useRef(null);s.useImperativeHandle(j,(()=>b.current));const S=s.useMemo((()=>({button:e.getStyles({buttonVariant:n,buttonPalette:t,iconButtonSize:i,className:e.cx("uds-icon-button","uds-button","uds-ring","uds-hit-target",l&&"uds-button-loading",m&&"uds-button-without-effects",g)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,n,g,m,i,l]),y=r.useReducedMotion(),M=s.useMemo((()=>y?"smooth":"subtle"),[y]),I=s.useMemo((()=>m?{...p,rest:{},hover:{},pressed:{}}:p),[m]);return o.jsx(v,{layoutSpeed:"3",layoutVariant:M,reducedMotion:m?"always":"user",children:o.jsx(r.m.button,{ref:b,className:S.button,initial:"icon",variants:I,whileHover:"hover",whileTap:"pressed",...x,children:o.jsxs(r.AnimatePresence,{initial:!1,mode:"popLayout",children:[l&&o.jsx(r.m.span,{variants:d,initial:"loading",animate:"loading",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:f,variant:c,color:"current",className:S.loading})},"loading"),h&&!l&&o.jsx(r.m.span,{variants:u,initial:"icon",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:h,variant:c,color:"current",className:S.icon})},h.name)]})})})}));
2
+ "use strict";var e=require("../chunk-RILYWBPB.cjs"),t=require("../chunk-PECN66KD.cjs"),n=require("../chunk-WLOEKYUI.cjs"),i=require("../chunk-J6D4HCFT.cjs"),a=require("@yahoo/uds/fixtures"),o=require("react/jsx-runtime"),r=require("framer-motion"),s=require("react"),c={scale:.7,opacity:0},l={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},u={icon:l,hide:c,loading:c},d={loading:l,hide:c,icon:c},m=`var(${i.BUTTON_CSS_VAR_MAP.columnGap})`,h=`var(${i.BUTTON_CSS_VAR_MAP.iconSize})`,p={rest:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.rest})`},hover:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.hover})`},pressed:{scale:`var(${i.BUTTON_CSS_VAR_MAP.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:m}},g={hide:{width:"0px",opacity:0,display:"none"},loading:{width:h,display:"flex",opacity:1},icon:{width:h,display:"flex",opacity:1}},x=({size:e,variant:t})=>{if("outline"===t)switch(e){case"sm":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===t)switch(e){case"sm":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return o.jsx(o.Fragment,{children:o.jsx("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return o.jsx(o.Fragment,{})},f=()=>import("../motionFeatures-THWWLQYC.cjs").then((({domAnimation:e})=>e));function j({reducedMotion:e="user",children:i,layoutVariant:a="subtle",layoutSpeed:c="3",colorVariant:l="smooth",colorSpeed:u="3"}){const d=n.motion[a][c],m=n.motion[l][u],[h,p]=s.useState(d),[g,x]=s.useState(m),j={variant:l,speed:u},v=t.getMotionVar({...j,control:"stiffness"}),b=t.getMotionVar({...j,control:"damping"}),S={variant:a,speed:c},y=t.getMotionVar({...S,control:"stiffness"}),M=t.getMotionVar({...S,control:"damping"});s.useEffect((()=>{const e=getComputedStyle(document.documentElement),t={damping:Number(e.getPropertyValue(M)),stiffness:Number(e.getPropertyValue(y))},n={damping:Number(e.getPropertyValue(b)),stiffness:Number(e.getPropertyValue(v))};p(t),x(n)}),[b,v,M,y]);const I=s.useMemo((()=>({type:"spring",mass:1,...h,layout:h,opacity:g,color:g,borderColor:g,backgroundColor:g})),[g,h]);return o.jsx(r.LazyMotion,{features:f,strict:!0,children:o.jsx(r.MotionConfig,{transition:I,reducedMotion:e,children:i})})}var v=e.createSlot(),b=r.m.create(v,{forwardMotionProps:!0}),S=s.forwardRef((function({palette:t,variant:n,size:i,startIcon:c,endIcon:l,iconVariant:m,loading:h,disableEffects:f,children:v,asChild:S,className:y,...M},I){const C=s.useRef(null);s.useImperativeHandle(I,(()=>C.current));const N=l?"icon":"hide",w=(({startIcon:e,endIcon:t,loading:n})=>e||t||n?"withIcon":"withoutIcon")({startIcon:c,endIcon:l,loading:h}),V=(({loading:e,startIcon:t})=>e?"loading":t?"icon":"hide")({loading:h,startIcon:c}),z={button:e.getStyles({buttonSize:i,buttonVariant:n,buttonPalette:t,className:e.cx("uds-button","uds-ring","uds-hit-target",h&&"uds-button-loading",f&&"uds-button-without-effects","withIcon"===w&&"uds-button-with-gap",y)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},A=r.useReducedMotion()?"smooth":"subtle",P=s.useMemo((()=>o.jsx(r.m.span,{className:z.iconContainer,initial:!1,variants:g,animate:V,children:o.jsxs(r.AnimatePresence,{initial:!1,mode:"popLayout",children:[h&&o.jsx(r.m.span,{variants:d,initial:"hide",animate:"loading",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:x,variant:m,color:"current",className:z.loading})},"loading"),c&&!h&&o.jsx(r.m.span,{variants:u,initial:"hide",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:c,variant:m,color:"current",className:z.start})},c.name)]})})),[z.iconContainer,z.loading,z.start,V,h,m,c]),T=s.useMemo((()=>o.jsx(r.m.span,{className:z.iconContainer,initial:!1,variants:g,animate:N,children:o.jsx(r.AnimatePresence,{initial:!1,mode:"popLayout",children:l&&o.jsx(r.m.span,{variants:u,initial:"hide",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:l,variant:m,color:"current",className:z.start})},l.name)})})),[z.iconContainer,z.start,l,N,m]),_=s.useMemo((()=>f?{...p,rest:{},hover:{},pressed:{}}:p),[f]);return S&&s.isValidElement(v)?o.jsx(j,{layoutSpeed:"3",layoutVariant:A,children:o.jsx(b,{className:z.button,initial:["hide",w],animate:w,variants:_,whileHover:"hover",whileTap:"pressed",...M,children:s.cloneElement(v,v.props,o.jsxs(o.Fragment,{children:[P,o.jsx("span",{className:z.content,children:v.props.children}),T]}))})}):o.jsx(j,{layoutSpeed:"3",layoutVariant:A,children:o.jsxs(r.m.button,{ref:C,className:z.button,initial:["hide",w],animate:w,variants:_,whileHover:"hover",whileTap:"pressed",...M,children:[P,o.jsx("span",{className:z.content,children:v}),T]})})})),y=s.forwardRef((function({palette:t,variant:n,size:i,iconVariant:c,loading:l,disableEffects:m,name:h,className:g,...f},v){const b=s.useRef(null);s.useImperativeHandle(v,(()=>b.current));const S=s.useMemo((()=>({button:e.getStyles({buttonVariant:n,buttonPalette:t,iconButtonSize:i,className:e.cx("uds-icon-button","uds-button","uds-ring","uds-hit-target",l&&"uds-button-loading",m&&"uds-button-without-effects",g)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,n,g,m,i,l]),y=r.useReducedMotion(),M=s.useMemo((()=>y?"smooth":"subtle"),[y]),I=s.useMemo((()=>m?{...p,rest:{},hover:{},pressed:{}}:p),[m]);return o.jsx(j,{layoutSpeed:"3",layoutVariant:M,reducedMotion:m?"always":"user",children:o.jsx(r.m.button,{ref:b,className:S.button,initial:"icon",variants:I,whileHover:"hover",whileTap:"pressed",...f,children:o.jsxs(r.AnimatePresence,{initial:!1,mode:"popLayout",children:[l&&o.jsx(r.m.span,{variants:d,initial:"loading",animate:"loading",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:x,variant:c,color:"current",className:S.loading})},"loading"),h&&!l&&o.jsx(r.m.span,{variants:u,initial:"icon",animate:"icon",exit:"hide",children:o.jsx(e.Icon,{size:a.buttonIconSvgSize,name:h,variant:c,color:"current",className:S.icon})},h.name)]})})})}));
3
3
  /*! © 2024 Yahoo, Inc. UDS v0.0.0-development */
4
- exports.Button=S,exports.IconButton=y,exports.SpringMotionConfig=v;
4
+ exports.Button=S,exports.IconButton=y,exports.SpringMotionConfig=j;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import{createSlot as t,getStyles as n,cx as e,Icon as i}from"../chunk-KEQTRKKF.js";import{getMotionVar as a}from"../chunk-PSTMMXTR.js";import{motion as o}from"../chunk-YRYDHL65.js";import{BUTTON_CSS_VAR_MAP as r}from"../chunk-33B23P5G.js";import{buttonIconSvgSize as s}from"@yahoo/uds/fixtures";import{jsx as c,jsxs as l,Fragment as d}from"react/jsx-runtime";import{m as u,useReducedMotion as h,AnimatePresence as m,LazyMotion as p,MotionConfig as f}from"framer-motion";import{forwardRef as g,useRef as v,useImperativeHandle as b,useMemo as y,isValidElement as w,cloneElement as N,useState as C,useEffect as S}from"react";
2
+ import{createSlot as t,getStyles as n,cx as e,Icon as a}from"../chunk-KEQTRKKF.js";import{getMotionVar as i}from"../chunk-PSTMMXTR.js";import{motion as o}from"../chunk-YRYDHL65.js";import{BUTTON_CSS_VAR_MAP as r}from"../chunk-33B23P5G.js";import{buttonIconSvgSize as s}from"@yahoo/uds/fixtures";import{jsx as c,jsxs as l,Fragment as d}from"react/jsx-runtime";import{m as u,useReducedMotion as h,AnimatePresence as m,LazyMotion as p,MotionConfig as f}from"framer-motion";import{forwardRef as g,useRef as b,useImperativeHandle as v,useMemo as y,isValidElement as w,cloneElement as N,useState as C,useEffect as S}from"react";
3
3
  /*! © 2024 Yahoo, Inc. UDS v0.0.0-development */
4
- var V={scale:.7,opacity:0},x={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},I={icon:x,hide:V,loading:V},M={loading:x,hide:V,icon:V},z=`var(${r.columnGap})`,P=`var(${r.iconSize})`,j={rest:{scale:`var(${r.effects.scale.rest})`},hover:{scale:`var(${r.effects.scale.hover})`},pressed:{scale:`var(${r.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:z}},T={hide:{width:"0px",opacity:0,display:"none"},loading:{width:P,display:"flex",opacity:1},icon:{width:P,display:"flex",opacity:1}},k=({size:t,variant:n})=>{if("outline"===n)switch(t){case"sm":return c(d,{children:c("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return c(d,{children:c("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return c(d,{children:c("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===n)switch(t){case"sm":return c(d,{children:c("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return c(d,{children:c("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return c(d,{children:c("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return c(d,{})},G=()=>import("../motionFeatures-B5UV2GY2.js").then((({domAnimation:t})=>t));function $({reducedMotion:t="user",children:n,layoutVariant:e="subtle",layoutSpeed:i="3",colorVariant:r="smooth",colorSpeed:s="3"}){const l=o[e][i],d=o[r][s],[u,h]=C(l),[m,g]=C(d),v={variant:r,speed:s},b=a({...v,control:"stiffness"}),w=a({...v,control:"damping"}),N={variant:e,speed:i},V=a({...N,control:"stiffness"}),x=a({...N,control:"damping"});S((()=>{const t=getComputedStyle(document.documentElement),n={damping:Number(t.getPropertyValue(x)),stiffness:Number(t.getPropertyValue(V))},e={damping:Number(t.getPropertyValue(w)),stiffness:Number(t.getPropertyValue(b))};h(n),g(e)}),[w,b,x,V]);const I=y((()=>({type:"spring",mass:1,...u,layout:u,opacity:m,color:m,borderColor:m,backgroundColor:m})),[m,u]);return c(p,{features:G,strict:!0,children:c(f,{transition:I,reducedMotion:t,children:n})})}var A=t(),E=u.create(A,{forwardMotionProps:!0}),H=g((function({palette:t,variant:a,size:o,startIcon:r,endIcon:p,iconVariant:f,loading:g,disableEffects:C,children:S,asChild:V,className:x,...z},P){const G=v(null);b(P,(()=>G.current));const A=p?"icon":"hide",H=(({startIcon:t,endIcon:n,loading:e})=>t||n||e?"withIcon":"withoutIcon")({startIcon:r,endIcon:p,loading:g}),L=(({loading:t,startIcon:n})=>t?"loading":n?"icon":"hide")({loading:g,startIcon:r}),B={button:n({buttonSize:o,buttonVariant:a,buttonPalette:t,className:e("uds-button","uds-ring","uds-hit-target",g&&"uds-button-loading",C&&"uds-button-without-effects","withIcon"===H&&"uds-button-with-gap",x)}),iconContainer:"uds-button-icon-container flex overflow-hidden",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},K=h()?"smooth":"subtle",R=y((()=>c(u.span,{className:B.iconContainer,initial:!1,variants:T,animate:L,children:l(m,{initial:!1,mode:"popLayout",children:[g&&c(u.span,{variants:M,initial:"hide",animate:"loading",exit:"hide",children:c(i,{size:s,name:k,variant:f,color:"current",className:B.loading})},"loading"),r&&!g&&c(u.span,{variants:I,initial:"hide",animate:"icon",exit:"hide",children:c(i,{size:s,name:r,variant:f,color:"current",className:B.start})},r.name)]})})),[B.iconContainer,B.loading,B.start,L,g,f,r]),Y=y((()=>c(u.span,{className:B.iconContainer,initial:!1,variants:T,animate:A,children:c(m,{initial:!1,mode:"popLayout",children:p&&c(u.span,{variants:I,initial:"hide",animate:"icon",exit:"hide",children:c(i,{size:s,name:p,variant:f,color:"current",className:B.start})},p.name)})})),[B.iconContainer,B.start,p,A,f]),F=y((()=>C?{...j,rest:{},hover:{},pressed:{}}:j),[C]);return V&&w(S)?c($,{layoutSpeed:"3",layoutVariant:K,children:c(E,{className:B.button,initial:["hide",H],animate:H,variants:F,whileHover:"hover",whileTap:"pressed",...z,children:N(S,S.props,l(d,{children:[R,S.props.children,Y]}))})}):c($,{layoutSpeed:"3",layoutVariant:K,children:l(u.button,{ref:G,className:B.button,initial:["hide",H],animate:H,variants:F,whileHover:"hover",whileTap:"pressed",...z,children:[R,S,Y]})})})),L=g((function({palette:t,variant:a,size:o,iconVariant:r,loading:d,disableEffects:p,name:f,className:g,...w},N){const C=v(null);b(N,(()=>C.current));const S=y((()=>({button:n({buttonVariant:a,buttonPalette:t,iconButtonSize:o,className:e("uds-icon-button","uds-button","uds-ring","uds-hit-target",d&&"uds-button-loading",p&&"uds-button-without-effects",g)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,a,g,p,o,d]),V=h(),x=y((()=>V?"smooth":"subtle"),[V]),z=y((()=>p?{...j,rest:{},hover:{},pressed:{}}:j),[p]);return c($,{layoutSpeed:"3",layoutVariant:x,reducedMotion:p?"always":"user",children:c(u.button,{ref:C,className:S.button,initial:"icon",variants:z,whileHover:"hover",whileTap:"pressed",...w,children:l(m,{initial:!1,mode:"popLayout",children:[d&&c(u.span,{variants:M,initial:"loading",animate:"loading",exit:"hide",children:c(i,{size:s,name:k,variant:r,color:"current",className:S.loading})},"loading"),f&&!d&&c(u.span,{variants:I,initial:"icon",animate:"icon",exit:"hide",children:c(i,{size:s,name:f,variant:r,color:"current",className:S.icon})},f.name)]})})})}));
4
+ var V={scale:.7,opacity:0},x={scale:[.7,.7,1],opacity:[0,0,1],transition:{times:[0,.5,1]}},I={icon:x,hide:V,loading:V},M={loading:x,hide:V,icon:V},z=`var(${r.columnGap})`,P=`var(${r.iconSize})`,j={rest:{scale:`var(${r.effects.scale.rest})`},hover:{scale:`var(${r.effects.scale.hover})`},pressed:{scale:`var(${r.effects.scale.pressed})`},withoutIcon:{columnGap:"0px"},withIcon:{columnGap:z}},T={hide:{width:"0px",opacity:0,display:"none"},loading:{width:P,display:"flex",opacity:1},icon:{width:P,display:"flex",opacity:1}},k=({size:t,variant:n})=>{if("outline"===n)switch(t){case"sm":return c(d,{children:c("path",{fill:"currentColor",d:"M7.9 2.7a5.2 5.2 0 1 0 5.2 5.2h1.6a6.8 6.8 0 1 1-6.8-6.8.8.8 0 1 1 0 1.6"})});case"md":return c(d,{children:c("path",{fill:"currentColor",d:"M12 4a8 8 0 1 0 8 8h2c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2a1 1 0 1 1 0 2"})});case"lg":return c(d,{children:c("path",{fill:"currentColor",d:"M16.15 4.3C9.605 4.3 4.3 9.605 4.3 16.15S9.605 28 16.15 28 28 22.695 28 16.15h2.3c0 7.815-6.335 14.15-14.15 14.15S2 23.965 2 16.15 8.335 2 16.15 2a1.15 1.15 0 0 1 0 2.3"})})}if("fill"===n)switch(t){case"sm":return c(d,{children:c("path",{fill:"currentColor",d:"M8 2.9A5.1 5.1 0 1 0 13.1 8h1.8A6.9 6.9 0 1 1 8 1.1a.9.9 0 1 1 0 1.8"})});case"md":return c(d,{children:c("path",{fill:"currentColor",d:"M12.15 4.3A7.85 7.85 0 1 0 20 12.15h2.3c0 5.606-4.544 10.15-10.15 10.15S2 17.756 2 12.15 6.544 2 12.15 2a1.15 1.15 0 0 1 0 2.3"})});case"lg":return c(d,{children:c("path",{fill:"currentColor",d:"M16.35 4.7C9.916 4.7 4.7 9.916 4.7 16.35S9.916 28 16.35 28 28 22.784 28 16.35h2.7c0 7.925-6.425 14.35-14.35 14.35S2 24.275 2 16.35 8.425 2 16.35 2a1.35 1.35 0 1 1 0 2.7"})})}return c(d,{})},G=()=>import("../motionFeatures-B5UV2GY2.js").then((({domAnimation:t})=>t));function $({reducedMotion:t="user",children:n,layoutVariant:e="subtle",layoutSpeed:a="3",colorVariant:r="smooth",colorSpeed:s="3"}){const l=o[e][a],d=o[r][s],[u,h]=C(l),[m,g]=C(d),b={variant:r,speed:s},v=i({...b,control:"stiffness"}),w=i({...b,control:"damping"}),N={variant:e,speed:a},V=i({...N,control:"stiffness"}),x=i({...N,control:"damping"});S((()=>{const t=getComputedStyle(document.documentElement),n={damping:Number(t.getPropertyValue(x)),stiffness:Number(t.getPropertyValue(V))},e={damping:Number(t.getPropertyValue(w)),stiffness:Number(t.getPropertyValue(v))};h(n),g(e)}),[w,v,x,V]);const I=y((()=>({type:"spring",mass:1,...u,layout:u,opacity:m,color:m,borderColor:m,backgroundColor:m})),[m,u]);return c(p,{features:G,strict:!0,children:c(f,{transition:I,reducedMotion:t,children:n})})}var A=t(),E=u.create(A,{forwardMotionProps:!0}),H=g((function({palette:t,variant:i,size:o,startIcon:r,endIcon:p,iconVariant:f,loading:g,disableEffects:C,children:S,asChild:V,className:x,...z},P){const G=b(null);v(P,(()=>G.current));const A=p?"icon":"hide",H=(({startIcon:t,endIcon:n,loading:e})=>t||n||e?"withIcon":"withoutIcon")({startIcon:r,endIcon:p,loading:g}),L=(({loading:t,startIcon:n})=>t?"loading":n?"icon":"hide")({loading:g,startIcon:r}),B={button:n({buttonSize:o,buttonVariant:i,buttonPalette:t,className:e("uds-button","uds-ring","uds-hit-target",g&&"uds-button-loading",C&&"uds-button-without-effects","withIcon"===H&&"uds-button-with-gap",x)}),content:"uds-button-content truncate",iconContainer:"uds-button-icon-container flex overflow-clip",loading:"uds-button-icon start-content animate-spin",start:"uds-button-icon start-content",end:"uds-button-icon end-content"},K=h()?"smooth":"subtle",R=y((()=>c(u.span,{className:B.iconContainer,initial:!1,variants:T,animate:L,children:l(m,{initial:!1,mode:"popLayout",children:[g&&c(u.span,{variants:M,initial:"hide",animate:"loading",exit:"hide",children:c(a,{size:s,name:k,variant:f,color:"current",className:B.loading})},"loading"),r&&!g&&c(u.span,{variants:I,initial:"hide",animate:"icon",exit:"hide",children:c(a,{size:s,name:r,variant:f,color:"current",className:B.start})},r.name)]})})),[B.iconContainer,B.loading,B.start,L,g,f,r]),Y=y((()=>c(u.span,{className:B.iconContainer,initial:!1,variants:T,animate:A,children:c(m,{initial:!1,mode:"popLayout",children:p&&c(u.span,{variants:I,initial:"hide",animate:"icon",exit:"hide",children:c(a,{size:s,name:p,variant:f,color:"current",className:B.start})},p.name)})})),[B.iconContainer,B.start,p,A,f]),F=y((()=>C?{...j,rest:{},hover:{},pressed:{}}:j),[C]);return V&&w(S)?c($,{layoutSpeed:"3",layoutVariant:K,children:c(E,{className:B.button,initial:["hide",H],animate:H,variants:F,whileHover:"hover",whileTap:"pressed",...z,children:N(S,S.props,l(d,{children:[R,c("span",{className:B.content,children:S.props.children}),Y]}))})}):c($,{layoutSpeed:"3",layoutVariant:K,children:l(u.button,{ref:G,className:B.button,initial:["hide",H],animate:H,variants:F,whileHover:"hover",whileTap:"pressed",...z,children:[R,c("span",{className:B.content,children:S}),Y]})})})),L=g((function({palette:t,variant:i,size:o,iconVariant:r,loading:d,disableEffects:p,name:f,className:g,...w},N){const C=b(null);v(N,(()=>C.current));const S=y((()=>({button:n({buttonVariant:i,buttonPalette:t,iconButtonSize:o,className:e("uds-icon-button","uds-button","uds-ring","uds-hit-target",d&&"uds-button-loading",p&&"uds-button-without-effects",g)}),loading:"uds-button-icon start-content animate-spin",icon:"uds-button-icon start-content"})),[t,i,g,p,o,d]),V=h(),x=y((()=>V?"smooth":"subtle"),[V]),z=y((()=>p?{...j,rest:{},hover:{},pressed:{}}:j),[p]);return c($,{layoutSpeed:"3",layoutVariant:x,reducedMotion:p?"always":"user",children:c(u.button,{ref:C,className:S.button,initial:"icon",variants:z,whileHover:"hover",whileTap:"pressed",...w,children:l(m,{initial:!1,mode:"popLayout",children:[d&&c(u.span,{variants:M,initial:"loading",animate:"loading",exit:"hide",children:c(a,{size:s,name:k,variant:r,color:"current",className:S.loading})},"loading"),f&&!d&&c(u.span,{variants:I,initial:"icon",animate:"icon",exit:"hide",children:c(a,{size:s,name:f,variant:r,color:"current",className:S.icon})},f.name)]})})})}));
5
5
  /*! © 2024 Yahoo, Inc. UDS v0.0.0-development */
6
6
  export{H as Button,L as IconButton,$ as SpringMotionConfig};