@yahoo/uds 3.23.0 → 3.23.2

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.
@@ -1 +1 @@
1
- "use strict";var e=require("../chunk-7IO5V6PX.cjs"),t=require("../chunk-NW3RYPC2.cjs");Object.defineProperty(exports,"addFontsPlugin",{enumerable:!0,get:function(){return e.addFontsPlugin}}),Object.defineProperty(exports,"getColorModeStyles",{enumerable:!0,get:function(){return e.getColorModeStyles}}),Object.defineProperty(exports,"getFontFaceDeclarations",{enumerable:!0,get:function(){return e.getFontFaceDeclarations}}),Object.defineProperty(exports,"getFontStyles",{enumerable:!0,get:function(){return e.getFontStyles}}),Object.defineProperty(exports,"getMotionStyles",{enumerable:!0,get:function(){return e.getMotionStyles}}),Object.defineProperty(exports,"getResponsiveTextStyles",{enumerable:!0,get:function(){return e.getResponsiveTextStyles}}),Object.defineProperty(exports,"getScaleModeStyles",{enumerable:!0,get:function(){return e.getScaleModeStyles}}),Object.defineProperty(exports,"getShadowStyles",{enumerable:!0,get:function(){return e.getShadowStyles}}),Object.defineProperty(exports,"getShadowLayerValue",{enumerable:!0,get:function(){return t.getShadowLayerValue}}),Object.defineProperty(exports,"getShadowPresetValues",{enumerable:!0,get:function(){return t.getShadowPresetValues}});
1
+ "use strict";var e=require("../chunk-KM3KE3X7.cjs"),t=require("../chunk-NW3RYPC2.cjs");Object.defineProperty(exports,"addFontsPlugin",{enumerable:!0,get:function(){return e.addFontsPlugin}}),Object.defineProperty(exports,"getColorModeStyles",{enumerable:!0,get:function(){return e.getColorModeStyles}}),Object.defineProperty(exports,"getFontFaceDeclarations",{enumerable:!0,get:function(){return e.getFontFaceDeclarations}}),Object.defineProperty(exports,"getFontStyles",{enumerable:!0,get:function(){return e.getFontStyles}}),Object.defineProperty(exports,"getMotionStyles",{enumerable:!0,get:function(){return e.getMotionStyles}}),Object.defineProperty(exports,"getResponsiveTextStyles",{enumerable:!0,get:function(){return e.getResponsiveTextStyles}}),Object.defineProperty(exports,"getScaleModeStyles",{enumerable:!0,get:function(){return e.getScaleModeStyles}}),Object.defineProperty(exports,"getShadowStyles",{enumerable:!0,get:function(){return e.getShadowStyles}}),Object.defineProperty(exports,"getShadowLayerValue",{enumerable:!0,get:function(){return t.getShadowLayerValue}}),Object.defineProperty(exports,"getShadowPresetValues",{enumerable:!0,get:function(){return t.getShadowPresetValues}});
@@ -1 +1 @@
1
- export{addFontsPlugin,getColorModeStyles,getFontFaceDeclarations,getFontStyles,getMotionStyles,getResponsiveTextStyles,getScaleModeStyles,getShadowStyles}from"../chunk-53XKDCYB.js";export{getShadowLayerValue,getShadowPresetValues}from"../chunk-6OYKLY27.js";
1
+ export{addFontsPlugin,getColorModeStyles,getFontFaceDeclarations,getFontStyles,getMotionStyles,getResponsiveTextStyles,getScaleModeStyles,getShadowStyles}from"../chunk-7QKUXXY7.js";export{getShadowLayerValue,getShadowPresetValues}from"../chunk-6OYKLY27.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yahoo/uds",
3
3
  "description": "Yahoo Universal System",
4
- "version": "3.23.0",
4
+ "version": "3.23.2",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "uds": "./cli/uds-cli.js"
@@ -1,2 +0,0 @@
1
- import{getMotionVar as r}from"./chunk-IA3LJKDY.js";import{FONT_DECLARATIONS_MAP as t,fromEntries as a}from"./chunk-6OYKLY27.js";import{entries as o}from"./chunk-EWJ3J526.js";import{TEXT_TRANSFORM_PREFIX as e,LINE_HEIGHT_PREFIX as n,FONT_SIZE_PREFIX as s,FONT_WIDTH_PREFIX as i,FONT_SLANT_PREFIX as d,FONT_WEIGHT_PREFIX as c,FONT_FAMILY_PREFIX as f,TEXT_RESPONSIVE_CLASSNAME as l,UDS_PREFIX as u}from"./chunk-5EWXEQJ3.js";import{textVariants as m,motionSpringConfigOptions as p}from"@yahoo/uds/fixtures";import{isString as h}from"lodash-es";import $ from"tailwindcss/plugin.js";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
2
- var v=r=>{throw new Error("Didn't expect to get here")};var g=(r,t,a,o)=>{const e=r.typography[t]?.[a];if(!e)throw new Error(`Missing typography data for variant "${t}" and key "${a}"`);const n="base"===o?e.base:e.breakpoints?.[o];if(!n)throw new Error(`Missing value for variant "${t}", key "${a}", and breakpoint "${o}"`);if(h(n))return n;switch(n.type){case"px":return n.value/16+"rem";case"unitless":return String(n.value)}return v()},w=(r,t)=>t in r.font?`var(--${f}-${t})`:t,x=(r,t)=>Object.fromEntries(m.flatMap(a=>[[`--${f}-${a}`,w(r,g(r,a,"fontFamily",t))],[`--${s}-${a}`,g(r,a,"fontSize",t)],[`--${c}-${a}`,g(r,a,"fontWeight",t)],[`--${n}-${a}`,g(r,a,"lineHeight",t)],[`--${e}-${a}`,g(r,a,"textTransform",t)]])),b=r=>Object.fromEntries(m.map(t=>[t,`var(--${r}-${t})`])),k={fontFamily:b(f),fontWeight:b(c),fontSlant:b(d),fontWidth:b(i),fontSize:b(s),lineHeight:b(n),textTransform:b(e)},y=r=>({":root":x(r,"base")}),M=r=>{const t=(a=r.breakpoints,Object.entries(a)).sort(([,{value:r}],[,{value:t}])=>r-t);var a;return{[`.${l}`]:Object.fromEntries(t.map(([t,{value:a}])=>[`@media (min-width: ${a}px)`,x(r,t)])),".uds-text-base":x(r,"base"),...Object.fromEntries(t.map(([t])=>[`.uds-text-${t}`,x(r,t)]))}};function j(r,t){const a=L(r);for(const r of a)t({"@font-face":r})}var S=$.withOptions(function({fontIds:r}){return function({addBase:t}){j(r,t)}});function E(r){return{light:{colorScheme:"light","--uds-light-mode-icon":"inline","--uds-dark-mode-icon":"none",...r.colorMode.light._vars},dark:{colorScheme:"dark","--uds-light-mode-icon":"none","--uds-dark-mode-icon":"inline",...r.colorMode.dark._vars}}}function L(r){return r.flatMap(r=>{const{declarations:a,fontFamily:o}=t[r];return a.map(r=>({fontFamily:o,fontDisplay:"swap",...r}))})}function O(r){return`"${r}"`}function W(r){return a(o(r).map(([r,a])=>{const o=`--${f}-${r}`,e=t[a];return[o,[e.fontFamily,...e.fallback].map(O).join(", ")]}))}function _(t){const e=o(t).flatMap(([t,a])=>o(a).flatMap(([a,o])=>p.map(e=>[r({variant:t,speed:a,control:e}),`${o[e]}`])));return a(e)}function F(r){return{...r.borderRadius._vars,...r.borderWidth._vars,...r.avatarSizes._vars,...r.iconSizes._vars}}function z(r){return{xSmall:F(r.scaleMode.xSmall),small:F(r.scaleMode.small),medium:F(r.scaleMode.medium),large:F(r.scaleMode.large),xLarge:F(r.scaleMode.xLarge),xxLarge:F(r.scaleMode.xxLarge),xxxLarge:F(r.scaleMode.xxxLarge)}}function J({config:r,shadowType:t}){const e=r.shadow[t],n=o(e).map(([r])=>[`.uds-${t}-shadow-${r}`,{[`--uds-${t}-shadow`]:`var(--${u}-${t}-shadow-${r})`,boxShadow:`var(--${u}-drop-shadow, 0 0 transparent), var(--${u}-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)`}]);return a(n)}export{k as RESPONSIVE_TAILWIND_CONFIG_MAP,j as addFontFaceDeclarations,S as addFontsPlugin,v as assertUnreachable,y as getBaseTextStyles,E as getColorModeStyles,L as getFontFaceDeclarations,W as getFontStyles,_ as getMotionStyles,M as getResponsiveTextStyles,z as getScaleModeStyles,J as getShadowStyles};
@@ -1 +0,0 @@
1
- "use strict";var e=require("./chunk-3JOCJE4R.cjs"),t=require("./chunk-NW3RYPC2.cjs"),r=require("./chunk-J7PUOUXC.cjs"),n=require("./chunk-HFSPK2LG.cjs"),a=require("@yahoo/uds/fixtures"),o=require("lodash-es");function s(e){return e&&e.__esModule?e:{default:e}}var i=s(require("tailwindcss/plugin.js")),l=e=>{throw new Error("Didn't expect to get here")};/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var c=(e,t,r,n)=>{const a=e.typography[t]?.[r];if(!a)throw new Error(`Missing typography data for variant "${t}" and key "${r}"`);const s="base"===n?a.base:a.breakpoints?.[n];if(!s)throw new Error(`Missing value for variant "${t}", key "${r}", and breakpoint "${n}"`);if(o.isString(s))return s;switch(s.type){case"px":return s.value/16+"rem";case"unitless":return String(s.value)}return l()},d=(e,t)=>t in e.font?`var(--${n.FONT_FAMILY_PREFIX}-${t})`:t,u=(e,t)=>Object.fromEntries(a.textVariants.flatMap(r=>[[`--${n.FONT_FAMILY_PREFIX}-${r}`,d(e,c(e,r,"fontFamily",t))],[`--${n.FONT_SIZE_PREFIX}-${r}`,c(e,r,"fontSize",t)],[`--${n.FONT_WEIGHT_PREFIX}-${r}`,c(e,r,"fontWeight",t)],[`--${n.LINE_HEIGHT_PREFIX}-${r}`,c(e,r,"lineHeight",t)],[`--${n.TEXT_TRANSFORM_PREFIX}-${r}`,c(e,r,"textTransform",t)]])),f=e=>Object.fromEntries(a.textVariants.map(t=>[t,`var(--${e}-${t})`])),p={fontFamily:f(n.FONT_FAMILY_PREFIX),fontWeight:f(n.FONT_WEIGHT_PREFIX),fontSlant:f(n.FONT_SLANT_PREFIX),fontWidth:f(n.FONT_WIDTH_PREFIX),fontSize:f(n.FONT_SIZE_PREFIX),lineHeight:f(n.LINE_HEIGHT_PREFIX),textTransform:f(n.TEXT_TRANSFORM_PREFIX)};function F(e,t){const r=E(e);for(const e of r)t({"@font-face":e})}var _=i.default.withOptions(function({fontIds:e}){return function({addBase:t}){F(e,t)}});function E(e){return e.flatMap(e=>{const{declarations:r,fontFamily:n}=t.FONT_DECLARATIONS_MAP[e];return r.map(e=>({fontFamily:n,fontDisplay:"swap",...e}))})}function h(e){return`"${e}"`}function g(e){return{...e.borderRadius._vars,...e.borderWidth._vars,...e.avatarSizes._vars,...e.iconSizes._vars}}exports.RESPONSIVE_TAILWIND_CONFIG_MAP=p,exports.addFontFaceDeclarations=F,exports.addFontsPlugin=_,exports.assertUnreachable=l,exports.getBaseTextStyles=e=>({":root":u(e,"base")}),exports.getColorModeStyles=function(e){return{light:{colorScheme:"light","--uds-light-mode-icon":"inline","--uds-dark-mode-icon":"none",...e.colorMode.light._vars},dark:{colorScheme:"dark","--uds-light-mode-icon":"none","--uds-dark-mode-icon":"inline",...e.colorMode.dark._vars}}},exports.getFontFaceDeclarations=E,exports.getFontStyles=function(e){return t.fromEntries(r.entries(e).map(([e,r])=>{const a=`--${n.FONT_FAMILY_PREFIX}-${e}`,o=t.FONT_DECLARATIONS_MAP[r];return[a,[o.fontFamily,...o.fallback].map(h).join(", ")]}))},exports.getMotionStyles=function(n){const o=r.entries(n).flatMap(([t,n])=>r.entries(n).flatMap(([r,n])=>a.motionSpringConfigOptions.map(a=>[e.getMotionVar({variant:t,speed:r,control:a}),`${n[a]}`])));return t.fromEntries(o)},exports.getResponsiveTextStyles=e=>{const t=(r=e.breakpoints,Object.entries(r)).sort(([,{value:e}],[,{value:t}])=>e-t);var r;return{[`.${n.TEXT_RESPONSIVE_CLASSNAME}`]:Object.fromEntries(t.map(([t,{value:r}])=>[`@media (min-width: ${r}px)`,u(e,t)])),".uds-text-base":u(e,"base"),...Object.fromEntries(t.map(([t])=>[`.uds-text-${t}`,u(e,t)]))}},exports.getScaleModeStyles=function(e){return{xSmall:g(e.scaleMode.xSmall),small:g(e.scaleMode.small),medium:g(e.scaleMode.medium),large:g(e.scaleMode.large),xLarge:g(e.scaleMode.xLarge),xxLarge:g(e.scaleMode.xxLarge),xxxLarge:g(e.scaleMode.xxxLarge)}},exports.getShadowStyles=function({config:e,shadowType:a}){const o=e.shadow[a],s=r.entries(o).map(([e])=>[`.uds-${a}-shadow-${e}`,{[`--uds-${a}-shadow`]:`var(--${n.UDS_PREFIX}-${a}-shadow-${e})`,boxShadow:`var(--${n.UDS_PREFIX}-drop-shadow, 0 0 transparent), var(--${n.UDS_PREFIX}-inset-shadow, 0 0 transparent), var(--tw-ring-offset-shadow, 0 0 transparent), var(--tw-ring-shadow, 0 0 transparent), var(--tw-shadow, 0 0 transparent)`}]);return t.fromEntries(s)};