@yahoo/uds 3.47.0 → 3.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/experimental/client/SwitchV2.cjs +0 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +1 -1
- package/dist/Box-CVbnF3KY.d.cts +0 -34
- package/dist/Box-KZ1-_3Y1.d.ts +0 -34
- package/dist/Pressable-BCKijzW4.d.ts +0 -44
- package/dist/Pressable-DM2L9PzA.d.cts +0 -44
- package/dist/Text-774Va3iq.d.ts +0 -88
- package/dist/Text-C58YvnSu.d.cts +0 -88
- package/dist/VStack-4KrkGBKP.d.ts +0 -83
- package/dist/VStack-AyF9g6Xi.d.cts +0 -83
- package/dist/chunk-3XMORCA6.cjs +0 -1
- package/dist/chunk-42TM364I.cjs +0 -1
- package/dist/chunk-4SWOQUGX.cjs +0 -1
- package/dist/chunk-53KBVJPZ.cjs +0 -2
- package/dist/chunk-6IIFFVGC.js +0 -1
- package/dist/chunk-6OLYHKI2.js +0 -2
- package/dist/chunk-7IYNK6VF.js +0 -3
- package/dist/chunk-D4G2CCD4.js +0 -2
- package/dist/chunk-D7XPTBPO.js +0 -2
- package/dist/chunk-HPXOQ4QK.js +0 -1
- package/dist/chunk-JD7PX7BB.cjs +0 -2
- package/dist/chunk-K7DHGT5F.cjs +0 -1
- package/dist/chunk-MEM4DBEJ.cjs +0 -1
- package/dist/chunk-ND5BLCNY.js +0 -2
- package/dist/chunk-O4TV6UVI.cjs +0 -1
- package/dist/chunk-QCLXCOEJ.js +0 -2
- package/dist/chunk-W7AQRGI5.cjs +0 -1
- package/dist/chunk-XWRSYGZJ.js +0 -2
- package/dist/index-BtKE9zn1.d.ts +0 -245
- package/dist/index-cZ0qEwcJ.d.cts +0 -245
- package/dist/types-D6kYghpa.d.cts +0 -10589
- package/dist/types-D6kYghpa.d.ts +0 -10589
@@ -1,2 +1 @@
|
|
1
|
-
"use client";
|
2
1
|
"use strict";var e=require("../../chunk-MQ5HBFA2.cjs"),t=require("../../chunk-TWH2EAVG.cjs"),a=require("../../chunk-3VUEFW4X.cjs"),o=require("motion/react-m"),i=require("react"),r=require("react/jsx-runtime");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var c=()=>import("../../domMax-7KVFVNKB.cjs").then(({domMax:e})=>e),s=n(o).create(a.Box),l=i.forwardRef(function({id:o,isOn:n,defaultIsOn:l,onChange:d,label:u,labelPosition:h="start",size:f="md",onIcon:x,offIcon:m,reduceMotion:p,disabled:y,required:b,onFocus:w,onBlur:v,className:g,layerClassNames:j,...S},N){const C=i.useId(),V=o??`uds-input-${C}`,k=i.useRef(null),I=void 0!==n,[q,B]=i.useState(I?n:l),M=i.useCallback(e=>{d?.(e),I||B(e.target.checked)},[I,d]),z=i.useCallback(e=>{w?.(e)},[w]),A=i.useCallback(e=>{v?.(e)},[v]),H=p?"always":"user",O=p?"duration-0":"duration-120 motion-reduce:duration-0";i.useEffect(()=>{I&&B(n)},[n,I]);const F={root:a.getStyles({switchSizeRoot:f,switchVariantRoot:"default",switchVariantActiveRoot:q?"on":"off",className:a.cx("group","flex","items-center","start"===h?"flex-row":"flex-row-reverse",...y?["cursor-default","opacity-50"]:["cursor-pointer"],j?.root,g)}),switch:a.getStyles({switchVariantSwitch:"default",switchSizeSwitch:f,switchVariantActiveSwitch:q?"on":"off",className:a.cx("uds-ring","uds-ring-within","relative","rounded-full","items-center",O,"transition-[background-color,box-shadow]",j?.switch)}),handleContainer:a.cx("pointer-events-none","relative","w-full","h-full"),handle:a.getStyles({switchSizeHandle:f,className:a.cx("absolute","top-0","bottom-0",q?"right-0":"left-0",j?.handle)}),handleContents:a.cx("relative","w-full","h-full","rounded-full","overflow-hidden",!y&&"group-hover:scale-105","opacity-95",!y&&"group-hover:opacity-100",O,"transition-[transform,opacity]"),handleCircle:a.getStyles({switchVariantActiveHandle:q?"on":"off",switchVariantHandle:"default",className:a.cx("absolute","top-0","left-0","right-0","bottom-0")}),handleIcon:a.getStyles({switchSizeHandleIcon:f,switchVariantHandleIcon:"default",switchVariantActiveHandleIcon:q?"on":"off",className:a.cx("absolute","opacity-0","top-1/2","left-1/2","transform","translate-x-[-50%]","translate-y-[-50%]",O,"transition-opacity")}),htmlCheckbox:a.cx("cursor-[inherit]","absolute","opacity-0","top-1/2","left-1/2","w-[calc(100%+2px)]","h-[calc(100%+2px)]","transform","translate-x-[-50%]","translate-y-[-50%]"),label:a.cx("start"===h?"text-start":"text-end",j?.label)},P=u?"label":"div";return r.jsx(t.SpringMotionConfig,{reducedMotion:H,loadFeatures:c,layoutVariant:"bouncy",layoutSpeed:"4",children:r.jsxs(P,{className:F.root,"data-testid":"switch-root",tabIndex:-1,children:[r.jsxs(a.Box,{className:F.switch,children:[r.jsx("input",{type:"checkbox",...S,ref:e=>{k.current=e,"function"==typeof N?N(e):null!==N&&(N.current=e)},onFocus:z,onBlur:A,id:V,disabled:y,required:b,checked:I?q:void 0,defaultChecked:I?void 0:l,onChange:M,className:F.htmlCheckbox,style:{}}),r.jsx(a.Box,{className:F.handleContainer,children:r.jsx(s,{className:F.handle,layout:"position",layoutDependency:q,children:r.jsxs(a.Box,{className:F.handleContents,children:[r.jsx(a.Box,{className:F.handleCircle}),x&&r.jsx(a.IconSlot,{icon:x,iconProps:{variant:"fill",size:"sm"},"data-testid":"on-icon",className:a.cx(F.handleIcon,q?"opacity-100":"opacity-0")}),m&&r.jsx(a.IconSlot,{icon:m,iconProps:{variant:"fill",size:"sm"},"data-testid":"off-icon",className:a.cx(F.handleIcon,q?"opacity-0":"opacity-100")})]})})})]}),u&&r.jsx(e.FormLabel,{as:"div",variant:"inherit",color:"inherit",required:b,label:u,className:F.label})]})})});/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */l.displayName="SwitchV2";var d=t.AvoidMotionLibraryProvider;exports.SwitchV2=l,exports.SwitchV2AvoidMotionLibraryProvider=d;
|