@yahoo/uds 3.36.0-beta.3 → 3.36.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/cli/bin/uds-darwin-arm64-baseline +0 -0
- package/cli/bin/uds-darwin-x64 +0 -0
- package/cli/bin/uds-linux-arm64 +0 -0
- package/cli/bin/uds-linux-x64-baseline +0 -0
- package/cli/cli.ts +1 -21
- package/cli/commands/uds.ts +1 -4
- package/cli/env.d.ts +0 -2
- package/cli/utils/analytics.ts +7 -12
- package/dist/analytics/server.cjs +1 -1
- package/dist/analytics/server.js +1 -1
- package/dist/{chunk-H62QDZOV.cjs → chunk-266TEOBW.cjs} +1 -1
- package/dist/{chunk-QZIQVD63.js → chunk-3Q2RRNEV.js} +3 -3
- package/dist/{chunk-UYLBFQ4P.js → chunk-532FA5T4.js} +1 -1
- package/dist/{chunk-EXYFDTFM.js → chunk-6EDDHN2V.js} +1 -1
- package/dist/{chunk-MATTX7AJ.js → chunk-6T6RXVSC.js} +1 -1
- package/dist/chunk-7WIBH2QA.cjs +1 -0
- package/dist/{chunk-5U4J6DA5.cjs → chunk-AWLTZBG2.cjs} +1 -1
- package/dist/{chunk-MZKL2XHU.js → chunk-BP3AJRW6.js} +2 -2
- package/dist/{chunk-ST7Z3YRS.js → chunk-BV4WMKCN.js} +2 -2
- package/dist/{chunk-QQ7BRHDQ.js → chunk-BWLVHK35.js} +1 -1
- package/dist/{chunk-QXAMOFS3.cjs → chunk-CFZ3UOPU.cjs} +1 -1
- package/dist/chunk-DHFUGPYW.js +2 -0
- package/dist/{chunk-I7ZFG4YT.js → chunk-EJWE4ZDD.js} +2 -2
- package/dist/{chunk-Y5HRSSOF.cjs → chunk-EQ45R5CT.cjs} +1 -1
- package/dist/{chunk-6SQQBVSA.js → chunk-FEVGF4MB.js} +1 -1
- package/dist/{chunk-GJLQAO4M.cjs → chunk-GQ27QLWT.cjs} +1 -1
- package/dist/{chunk-LWGAE6PD.cjs → chunk-HKTEJW4O.cjs} +1 -1
- package/dist/{chunk-KPGAKQEP.js → chunk-IGSZSMZ3.js} +1 -1
- package/dist/chunk-JEM5Q5ZV.js +2 -0
- package/dist/{chunk-JM4WTJDB.cjs → chunk-JNCCDUC5.cjs} +2 -2
- package/dist/{chunk-4GUXQTU3.cjs → chunk-JXGXYM2J.cjs} +3 -3
- package/dist/{chunk-WX4V6S4A.js → chunk-KSMNVEEZ.js} +1 -1
- package/dist/{chunk-PVXOGAWH.js → chunk-LVNVY7D5.js} +1 -1
- package/dist/{chunk-RMRBUBTB.js → chunk-NOHU3JAB.js} +3 -3
- package/dist/{chunk-CTYIRZ5A.cjs → chunk-OJ3E5CMW.cjs} +1 -1
- package/dist/{chunk-SVO6TMF5.js → chunk-P5SQNXWX.js} +1 -1
- package/dist/{chunk-F7LPH2UL.cjs → chunk-PHE2SHFZ.cjs} +1 -1
- package/dist/{chunk-QF6YIMT4.js → chunk-QRMOGL7I.js} +1 -1
- package/dist/{chunk-WRE54KQN.js → chunk-QY4DHKAZ.js} +2 -2
- package/dist/{chunk-6HG5KSL6.cjs → chunk-R53FHPNV.cjs} +1 -1
- package/dist/{chunk-S5NRWKDP.cjs → chunk-RQQFTFXX.cjs} +1 -1
- package/dist/{chunk-VQV2OVOZ.cjs → chunk-S6UCK6XC.cjs} +1 -1
- package/dist/{chunk-4A2ZIK3D.cjs → chunk-SOXILHRS.cjs} +1 -1
- package/dist/chunk-XLYF7ZHQ.cjs +1 -0
- package/dist/{chunk-PNL4K4BQ.cjs → chunk-XUE7PBWU.cjs} +1 -1
- package/dist/{chunk-YBIQ3S5G.cjs → chunk-YBNT52RR.cjs} +1 -1
- package/dist/client/Menu.cjs +2 -2
- package/dist/client/Menu.js +2 -2
- package/dist/client/index.cjs +1 -1
- package/dist/client/index.js +1 -1
- package/dist/experimental/client/SwitchV2.cjs +1 -1
- package/dist/experimental/client/SwitchV2.js +1 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/tailwind/plugin.cjs +1 -1
- package/dist/tailwind/plugin.js +2 -1
- package/dist/tailwind/purger.cjs +1 -1
- package/dist/tailwind/purger.js +2 -2
- package/dist/tailwind/tsMorph.cjs +1 -1
- package/dist/tailwind/tsMorph.js +2 -2
- package/dist/tailwind/utils.cjs +1 -1
- package/dist/tailwind/utils.d.cts +8 -6
- package/dist/tailwind/utils.d.ts +8 -6
- package/dist/tailwind/utils.js +1 -1
- package/dist/tokens/automation/configs.cjs +1 -1
- package/dist/tokens/automation/configs.js +1 -1
- package/dist/tokens/automation/properties.cjs +1 -1
- package/dist/tokens/automation/properties.js +1 -1
- package/dist/tokens/index.cjs +1 -1
- package/dist/tokens/index.js +1 -1
- package/package.json +1 -1
- package/cli/FullWidthClassToProp.mock.tsx +0 -17
- package/cli/commands/login.ts +0 -30
- package/cli/commands/logout.ts +0 -27
- package/cli/utils/auth.ts +0 -175
- package/dist/chunk-5D2A6RFS.js +0 -2
- package/dist/chunk-74BWCTGT.cjs +0 -1
- package/dist/chunk-DCZLRK3J.js +0 -2
- package/dist/chunk-VQ4KEVVH.cjs +0 -1
package/dist/tokens/index.cjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var e=require("../chunk-
|
1
|
+
"use strict";var e=require("../chunk-CFZ3UOPU.cjs"),t=require("../chunk-J7PUOUXC.cjs"),r=require("../chunk-GQ27QLWT.cjs"),n=require("../chunk-3AYBRPUC.cjs");Object.defineProperty(exports,"DEFAULT_COLOR_MODE",{enumerable:!0,get:function(){return e.DEFAULT_COLOR_MODE}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE_FOR_APP",{enumerable:!0,get:function(){return e.DEFAULT_COLOR_MODE_FOR_APP}}),Object.defineProperty(exports,"DEFAULT_HIGH_CONTRAST_MODE",{enumerable:!0,get:function(){return e.DEFAULT_HIGH_CONTRAST_MODE}}),Object.defineProperty(exports,"DEFAULT_REGION_MODE",{enumerable:!0,get:function(){return e.DEFAULT_REGION_MODE}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE",{enumerable:!0,get:function(){return e.DEFAULT_SCALE_MODE}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE_FOR_APP",{enumerable:!0,get:function(){return e.DEFAULT_SCALE_MODE_FOR_APP}}),Object.defineProperty(exports,"FONT_DECLARATIONS_MAP",{enumerable:!0,get:function(){return e.FONT_DECLARATIONS_MAP}}),Object.defineProperty(exports,"alwaysPalette",{enumerable:!0,get:function(){return e.alwaysPalette}}),Object.defineProperty(exports,"button",{enumerable:!0,get:function(){return e.button}}),Object.defineProperty(exports,"cartesianProduct",{enumerable:!0,get:function(){return e.cartesianProduct}}),Object.defineProperty(exports,"coalesceConfigVariant",{enumerable:!0,get:function(){return e.coalesceConfigVariant}}),Object.defineProperty(exports,"configurableProperties",{enumerable:!0,get:function(){return e.configurableProperties}}),Object.defineProperty(exports,"createComponentStateConfig",{enumerable:!0,get:function(){return e.createComponentStateConfig}}),Object.defineProperty(exports,"createComponentStates",{enumerable:!0,get:function(){return e.createComponentStates}}),Object.defineProperty(exports,"createConfigurableProperty",{enumerable:!0,get:function(){return e.createConfigurableProperty}}),Object.defineProperty(exports,"createLayerConfig",{enumerable:!0,get:function(){return e.createLayerConfig}}),Object.defineProperty(exports,"createSubComponentConfig",{enumerable:!0,get:function(){return e.createSubComponentConfig}}),Object.defineProperty(exports,"createVariantConfig",{enumerable:!0,get:function(){return e.createVariantConfig}}),Object.defineProperty(exports,"createVariantConfigWithComponentStates",{enumerable:!0,get:function(){return e.createVariantConfigWithComponentStates}}),Object.defineProperty(exports,"createVariantConfigWithProperties",{enumerable:!0,get:function(){return e.createVariantConfigWithProperties}}),Object.defineProperty(exports,"findFixtureType",{enumerable:!0,get:function(){return e.findFixtureType}}),Object.defineProperty(exports,"fontWeightMap",{enumerable:!0,get:function(){return e.fontWeightMap}}),Object.defineProperty(exports,"fromEntries",{enumerable:!0,get:function(){return e.fromEntries}}),Object.defineProperty(exports,"generateClassName",{enumerable:!0,get:function(){return e.generateClassName}}),Object.defineProperty(exports,"generateDeclaration",{enumerable:!0,get:function(){return e.generateDeclaration}}),Object.defineProperty(exports,"generateKeyFromFlatConfigPath",{enumerable:!0,get:function(){return e.generateKeyFromFlatConfigPath}}),Object.defineProperty(exports,"generateSchemaKey",{enumerable:!0,get:function(){return e.generateSchemaKey}}),Object.defineProperty(exports,"generateStyles",{enumerable:!0,get:function(){return e.generateStyles}}),Object.defineProperty(exports,"getConfigDefaultValue",{enumerable:!0,get:function(){return e.getConfigDefaultValue}}),Object.defineProperty(exports,"getConfigPseudoStateVariables",{enumerable:!0,get:function(){return e.getConfigPseudoStateVariables}}),Object.defineProperty(exports,"getConfigPseudoStateVariablesWithSetter",{enumerable:!0,get:function(){return e.getConfigPseudoStateVariablesWithSetter}}),Object.defineProperty(exports,"getConfigSubcomponents",{enumerable:!0,get:function(){return e.getConfigSubcomponents}}),Object.defineProperty(exports,"getConfigVariantComponentStates",{enumerable:!0,get:function(){return e.getConfigVariantComponentStates}}),Object.defineProperty(exports,"getConfigVariantComponentStatesMatrix",{enumerable:!0,get:function(){return e.getConfigVariantComponentStatesMatrix}}),Object.defineProperty(exports,"getConfigVariantProperties",{enumerable:!0,get:function(){return e.getConfigVariantProperties}}),Object.defineProperty(exports,"getConfigVariantPseudoStates",{enumerable:!0,get:function(){return e.getConfigVariantPseudoStates}}),Object.defineProperty(exports,"getConfigVariants",{enumerable:!0,get:function(){return e.getConfigVariants}}),Object.defineProperty(exports,"getDefaultButtonBaseMap",{enumerable:!0,get:function(){return e.getDefaultButtonBaseMap}}),Object.defineProperty(exports,"isConfigDefaultValue",{enumerable:!0,get:function(){return e.isConfigDefaultValue}}),Object.defineProperty(exports,"parseButtonVariantFlat",{enumerable:!0,get:function(){return e.parseButtonVariantFlat}}),Object.defineProperty(exports,"parseDeprecatedButtonPaletteVariant",{enumerable:!0,get:function(){return e.parseDeprecatedButtonPaletteVariant}}),Object.defineProperty(exports,"setConfigPseudoStateVariable",{enumerable:!0,get:function(){return e.setConfigPseudoStateVariable}}),Object.defineProperty(exports,"shadow",{enumerable:!0,get:function(){return e.shadow}}),Object.defineProperty(exports,"statePseudoMapDocsMode",{enumerable:!0,get:function(){return e.statePseudoMapDocsMode}}),Object.defineProperty(exports,"toMinimalDbConfigObject",{enumerable:!0,get:function(){return e.toMinimalDbConfigObject}}),Object.defineProperty(exports,"entries",{enumerable:!0,get:function(){return t.entries}}),Object.defineProperty(exports,"mapValues",{enumerable:!0,get:function(){return t.mapValues}}),Object.defineProperty(exports,"variants",{enumerable:!0,get:function(){return r.variants}}),Object.defineProperty(exports,"AVATAR_SIZE_PREFIX",{enumerable:!0,get:function(){return n.AVATAR_SIZE_PREFIX}}),Object.defineProperty(exports,"BORDER_RADIUS_PREFIX",{enumerable:!0,get:function(){return n.BORDER_RADIUS_PREFIX}}),Object.defineProperty(exports,"BORDER_WIDTH_PREFIX",{enumerable:!0,get:function(){return n.BORDER_WIDTH_PREFIX}}),Object.defineProperty(exports,"BUTTON_CSS_VAR_MAP",{enumerable:!0,get:function(){return n.BUTTON_CSS_VAR_MAP}}),Object.defineProperty(exports,"DARK_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.DARK_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"DEFAULT_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.DEFAULT_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"DEFAULT_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.DEFAULT_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"FONT_FAMILY_PREFIX",{enumerable:!0,get:function(){return n.FONT_FAMILY_PREFIX}}),Object.defineProperty(exports,"FONT_SIZE_PREFIX",{enumerable:!0,get:function(){return n.FONT_SIZE_PREFIX}}),Object.defineProperty(exports,"FONT_SLANT_PREFIX",{enumerable:!0,get:function(){return n.FONT_SLANT_PREFIX}}),Object.defineProperty(exports,"FONT_WEIGHT_PREFIX",{enumerable:!0,get:function(){return n.FONT_WEIGHT_PREFIX}}),Object.defineProperty(exports,"FONT_WIDTH_PREFIX",{enumerable:!0,get:function(){return n.FONT_WIDTH_PREFIX}}),Object.defineProperty(exports,"ICON_BUTTON_CSS_VAR_MAP",{enumerable:!0,get:function(){return n.ICON_BUTTON_CSS_VAR_MAP}}),Object.defineProperty(exports,"ICON_SIZE_PREFIX",{enumerable:!0,get:function(){return n.ICON_SIZE_PREFIX}}),Object.defineProperty(exports,"INVERT_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.INVERT_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"LARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.LARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"LIGHT_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.LIGHT_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"LINE_HEIGHT_PREFIX",{enumerable:!0,get:function(){return n.LINE_HEIGHT_PREFIX}}),Object.defineProperty(exports,"MEDIUM_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.MEDIUM_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"MOTION_PREFIX",{enumerable:!0,get:function(){return n.MOTION_PREFIX}}),Object.defineProperty(exports,"PSEUDO_STYLE_SELECTOR_MAP",{enumerable:!0,get:function(){return n.PSEUDO_STYLE_SELECTOR_MAP}}),Object.defineProperty(exports,"SMALL_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.SMALL_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"SPECTRUM_COLOR_PREFIX",{enumerable:!0,get:function(){return n.SPECTRUM_COLOR_PREFIX}}),Object.defineProperty(exports,"SYSTEM_COLOR_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.SYSTEM_COLOR_MODE_CLASSNAME}}),Object.defineProperty(exports,"TEXT_RESPONSIVE_CLASSNAME",{enumerable:!0,get:function(){return n.TEXT_RESPONSIVE_CLASSNAME}}),Object.defineProperty(exports,"TEXT_TRANSFORM_PREFIX",{enumerable:!0,get:function(){return n.TEXT_TRANSFORM_PREFIX}}),Object.defineProperty(exports,"UDS_PREFIX",{enumerable:!0,get:function(){return n.UDS_PREFIX}}),Object.defineProperty(exports,"XLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XSMALL_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XSMALL_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XXLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XXLARGE_SCALE_MODE_CLASSNAME}}),Object.defineProperty(exports,"XXXLARGE_SCALE_MODE_CLASSNAME",{enumerable:!0,get:function(){return n.XXXLARGE_SCALE_MODE_CLASSNAME}});
|
package/dist/tokens/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export{DEFAULT_COLOR_MODE,DEFAULT_COLOR_MODE_FOR_APP,DEFAULT_HIGH_CONTRAST_MODE,DEFAULT_REGION_MODE,DEFAULT_SCALE_MODE,DEFAULT_SCALE_MODE_FOR_APP,FONT_DECLARATIONS_MAP,alwaysPalette,button,cartesianProduct,coalesceConfigVariant,configurableProperties,createComponentStateConfig,createComponentStates,createConfigurableProperty,createLayerConfig,createSubComponentConfig,createVariantConfig,createVariantConfigWithComponentStates,createVariantConfigWithProperties,findFixtureType,fontWeightMap,fromEntries,generateClassName,generateDeclaration,generateKeyFromFlatConfigPath,generateSchemaKey,generateStyles,getConfigDefaultValue,getConfigPseudoStateVariables,getConfigPseudoStateVariablesWithSetter,getConfigSubcomponents,getConfigVariantComponentStates,getConfigVariantComponentStatesMatrix,getConfigVariantProperties,getConfigVariantPseudoStates,getConfigVariants,getDefaultButtonBaseMap,isConfigDefaultValue,parseButtonVariantFlat,parseDeprecatedButtonPaletteVariant,setConfigPseudoStateVariable,shadow,statePseudoMapDocsMode,toMinimalDbConfigObject}from"../chunk-
|
1
|
+
export{DEFAULT_COLOR_MODE,DEFAULT_COLOR_MODE_FOR_APP,DEFAULT_HIGH_CONTRAST_MODE,DEFAULT_REGION_MODE,DEFAULT_SCALE_MODE,DEFAULT_SCALE_MODE_FOR_APP,FONT_DECLARATIONS_MAP,alwaysPalette,button,cartesianProduct,coalesceConfigVariant,configurableProperties,createComponentStateConfig,createComponentStates,createConfigurableProperty,createLayerConfig,createSubComponentConfig,createVariantConfig,createVariantConfigWithComponentStates,createVariantConfigWithProperties,findFixtureType,fontWeightMap,fromEntries,generateClassName,generateDeclaration,generateKeyFromFlatConfigPath,generateSchemaKey,generateStyles,getConfigDefaultValue,getConfigPseudoStateVariables,getConfigPseudoStateVariablesWithSetter,getConfigSubcomponents,getConfigVariantComponentStates,getConfigVariantComponentStatesMatrix,getConfigVariantProperties,getConfigVariantPseudoStates,getConfigVariants,getDefaultButtonBaseMap,isConfigDefaultValue,parseButtonVariantFlat,parseDeprecatedButtonPaletteVariant,setConfigPseudoStateVariable,shadow,statePseudoMapDocsMode,toMinimalDbConfigObject}from"../chunk-BP3AJRW6.js";export{entries,mapValues}from"../chunk-EWJ3J526.js";export{variants}from"../chunk-P5SQNXWX.js";export{AVATAR_SIZE_PREFIX,BORDER_RADIUS_PREFIX,BORDER_WIDTH_PREFIX,BUTTON_CSS_VAR_MAP,DARK_COLOR_MODE_CLASSNAME,DEFAULT_COLOR_MODE_CLASSNAME,DEFAULT_SCALE_MODE_CLASSNAME,FONT_FAMILY_PREFIX,FONT_SIZE_PREFIX,FONT_SLANT_PREFIX,FONT_WEIGHT_PREFIX,FONT_WIDTH_PREFIX,ICON_BUTTON_CSS_VAR_MAP,ICON_SIZE_PREFIX,INVERT_COLOR_MODE_CLASSNAME,LARGE_SCALE_MODE_CLASSNAME,LIGHT_COLOR_MODE_CLASSNAME,LINE_HEIGHT_PREFIX,MEDIUM_SCALE_MODE_CLASSNAME,MOTION_PREFIX,PSEUDO_STYLE_SELECTOR_MAP,SMALL_SCALE_MODE_CLASSNAME,SPECTRUM_COLOR_PREFIX,SYSTEM_COLOR_MODE_CLASSNAME,TEXT_RESPONSIVE_CLASSNAME,TEXT_TRANSFORM_PREFIX,UDS_PREFIX,XLARGE_SCALE_MODE_CLASSNAME,XSMALL_SCALE_MODE_CLASSNAME,XXLARGE_SCALE_MODE_CLASSNAME,XXXLARGE_SCALE_MODE_CLASSNAME}from"../chunk-24RMELG3.js";
|
package/package.json
CHANGED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { Box, Button, HStack } from '@yahoo/uds';
|
2
|
-
import { VStack } from 'another-package';
|
3
|
-
|
4
|
-
export const PageA = () => {
|
5
|
-
return (
|
6
|
-
<HStack height="screen" width="full" className="max-h-screen">
|
7
|
-
<Button width="full">Click me</Button>
|
8
|
-
<Box width="full">Click me</Button>
|
9
|
-
<Box className="dont_touch_me">Box</Box>
|
10
|
-
</HStack>
|
11
|
-
<Box>Empty</Box>
|
12
|
-
<div className="w-full h-full">shouldn't be touched</div>
|
13
|
-
<VStack className="w-full">shouldn't be touched</VStack>
|
14
|
-
<Box height="full" width="full" className="foo bar">Box</Box>
|
15
|
-
<Box height="full">Box</Box>
|
16
|
-
);
|
17
|
-
}
|
package/cli/commands/login.ts
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
import { magenta, print, red } from 'bluebun';
|
2
|
-
|
3
|
-
import { trackEvent } from '../utils/analytics';
|
4
|
-
import { login } from '../utils/auth';
|
5
|
-
|
6
|
-
export default {
|
7
|
-
name: 'login',
|
8
|
-
description: '👤 Log in to UDS CLI',
|
9
|
-
alias: ['auth'],
|
10
|
-
run: async () => {
|
11
|
-
try {
|
12
|
-
const user = await login();
|
13
|
-
if (user) {
|
14
|
-
print(magenta(`🔒 Logged in as ${user.email}`));
|
15
|
-
return await trackEvent('login');
|
16
|
-
}
|
17
|
-
} catch (error) {
|
18
|
-
if (error instanceof Error) {
|
19
|
-
print(red(error.message));
|
20
|
-
} else {
|
21
|
-
print(
|
22
|
-
red(
|
23
|
-
`❌ An error occurred while logging in. Please ask in the #uds-ask channel for support.`,
|
24
|
-
),
|
25
|
-
);
|
26
|
-
process.exitCode = 1;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
},
|
30
|
-
};
|
package/cli/commands/logout.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
import { magenta, print, red } from 'bluebun';
|
2
|
-
|
3
|
-
import { trackEvent } from '../utils/analytics';
|
4
|
-
import { logout } from '../utils/auth';
|
5
|
-
|
6
|
-
export default {
|
7
|
-
name: 'logout',
|
8
|
-
description: '👤 Sign out of UDS CLI',
|
9
|
-
run: async () => {
|
10
|
-
try {
|
11
|
-
// Track logout event before logout is run. Otherwise, there's no user object to track.
|
12
|
-
await trackEvent('logout');
|
13
|
-
await logout();
|
14
|
-
print(magenta('👋 You have been logged out.'));
|
15
|
-
} catch (error) {
|
16
|
-
if (error instanceof Error) {
|
17
|
-
print(red(error.message));
|
18
|
-
} else {
|
19
|
-
print(
|
20
|
-
red(
|
21
|
-
`❌ An error occurred while logging out. Please ask in the #uds-ask channel for support.`,
|
22
|
-
),
|
23
|
-
);
|
24
|
-
}
|
25
|
-
}
|
26
|
-
},
|
27
|
-
};
|
package/cli/utils/auth.ts
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
import child_process from 'node:child_process';
|
2
|
-
import { unlink } from 'node:fs/promises';
|
3
|
-
import path from 'node:path';
|
4
|
-
import util from 'node:util';
|
5
|
-
|
6
|
-
import { ask, print, red } from 'bluebun';
|
7
|
-
import Bun from 'bun';
|
8
|
-
import type { FirebaseUser } from 'root/database/firebase';
|
9
|
-
import { v5 as uuidv5 } from 'uuid';
|
10
|
-
|
11
|
-
const exec = util.promisify(child_process.exec);
|
12
|
-
|
13
|
-
type User = Partial<FirebaseUser>;
|
14
|
-
|
15
|
-
const CACHE_FILEPATH = '.uds/user.json';
|
16
|
-
const DEFAULT_CLI_PATH = path.resolve(import.meta.dir, '..');
|
17
|
-
const CACHED_USER_FILE = path.resolve(DEFAULT_CLI_PATH, CACHE_FILEPATH);
|
18
|
-
|
19
|
-
async function getGitEmail(scope: 'local' | 'global' | 'system' = 'global') {
|
20
|
-
let email;
|
21
|
-
try {
|
22
|
-
const { stdout, stderr } = await exec(`git config --${scope} user.email`);
|
23
|
-
|
24
|
-
if (stderr) {
|
25
|
-
throw new Error(`Git config error: ${stderr}`);
|
26
|
-
}
|
27
|
-
email = stdout.trim();
|
28
|
-
if (!isYahooEmployee({ email })) {
|
29
|
-
throw new Error(`Git config email is not a @yahooinc.com email address.`);
|
30
|
-
}
|
31
|
-
} catch {
|
32
|
-
email = await ask('Please enter your @yahooinc.com email address:', {
|
33
|
-
validation: (answer) => {
|
34
|
-
const warning = red(`🚨 Email was not a @yahooinc.com address.`);
|
35
|
-
return isYahooEmployee({ email: answer }) || warning;
|
36
|
-
},
|
37
|
-
});
|
38
|
-
}
|
39
|
-
|
40
|
-
return email ?? buildCIUser().email; // fallback to CI user if don't have an email for some reason.
|
41
|
-
}
|
42
|
-
|
43
|
-
function isYahooEmployee(user?: User) {
|
44
|
-
return Boolean(user?.email?.endsWith('@yahooinc.com'));
|
45
|
-
}
|
46
|
-
|
47
|
-
/**
|
48
|
-
* Opens a browser window to authenticate the user using Google OAuth2 flow.
|
49
|
-
* The id token is exchanged for Firebase user credentials.
|
50
|
-
* @returns
|
51
|
-
*/
|
52
|
-
async function authenticateUser(): Promise<User> {
|
53
|
-
// Fetch firebase user data from the configurator.
|
54
|
-
const email = await getGitEmail();
|
55
|
-
const resp = await Bun.fetch(`https://config.uds.build/api/cli-analytics?email=${email}`);
|
56
|
-
if (resp.status !== 200) {
|
57
|
-
throw new Error(`Failed to fetch firebase user data from endpoint. Status ${resp.status}`);
|
58
|
-
}
|
59
|
-
|
60
|
-
return (await resp.json()) as User;
|
61
|
-
}
|
62
|
-
|
63
|
-
async function logout(cachePath?: string) {
|
64
|
-
// 1. TODO: Revoke token access
|
65
|
-
try {
|
66
|
-
// 2. Remove cached user data.
|
67
|
-
return await unlink(cachePath ?? CACHED_USER_FILE);
|
68
|
-
} catch {
|
69
|
-
// noop
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Takes the user through the OAuth2 flow, creating a server for the oauth callback.
|
75
|
-
* If the user has previously authenticated, it returns the cached user.
|
76
|
-
* @returns
|
77
|
-
*/
|
78
|
-
async function login() {
|
79
|
-
let user = await getAuthenticatedUser();
|
80
|
-
// Authenticate if there's no user cached.
|
81
|
-
if (!user) {
|
82
|
-
try {
|
83
|
-
user = await authenticateUser();
|
84
|
-
await Bun.write(CACHED_USER_FILE, JSON.stringify(user, null, 2));
|
85
|
-
} catch (err) {
|
86
|
-
console.error((err as NodeJS.ErrnoException).message);
|
87
|
-
}
|
88
|
-
}
|
89
|
-
|
90
|
-
return user;
|
91
|
-
}
|
92
|
-
|
93
|
-
/**
|
94
|
-
* Builds a firebase user object for a Continuous Integration (CI) user.
|
95
|
-
*
|
96
|
-
* This function generates a CI user with an email based on the UDS_TEAM_SLUG
|
97
|
-
* environment variable. If the UDS_TEAM_SLUG is not defined, it defaults to 'unknown'.
|
98
|
-
* The generated user has a predefined first name, display name, and an empty avatar.
|
99
|
-
* The analytics context includes the team and a role set to 'other'.
|
100
|
-
*
|
101
|
-
* @returns {user} The generated CI user object.
|
102
|
-
*/
|
103
|
-
function buildCIUser(): User {
|
104
|
-
const team = process.env.UDS_TEAM_SLUG;
|
105
|
-
|
106
|
-
if (!team) {
|
107
|
-
print(
|
108
|
-
red(
|
109
|
-
`🚨 CI=1 also requires a 'UDS_TEAM_SLUG' env variable. Please see https://www.uds.build/docs/tools/cli#circumventing-login.`,
|
110
|
-
),
|
111
|
-
);
|
112
|
-
process.exit(0);
|
113
|
-
}
|
114
|
-
|
115
|
-
const email = `ci-user-${team}@yahooinc.com`;
|
116
|
-
const id = uuidv5(email, '6ba7b810-9dad-11d1-80b4-00c04fd430c8'); // DNS namespace
|
117
|
-
|
118
|
-
return {
|
119
|
-
id,
|
120
|
-
email,
|
121
|
-
teams: team ? [team] : [],
|
122
|
-
avatar: '',
|
123
|
-
firstName: 'CI',
|
124
|
-
displayName: 'CI',
|
125
|
-
analyticsContext: {
|
126
|
-
team,
|
127
|
-
role: 'ci',
|
128
|
-
},
|
129
|
-
};
|
130
|
-
}
|
131
|
-
|
132
|
-
/**
|
133
|
-
* The authenticated user or undefined if the user is not authenticated.
|
134
|
-
* @param cliPath Root folder of cli commands. Defaults to 'packages/uds/cli'.
|
135
|
-
* Note: this is only needed when calling this method in cli.ts. The compiled
|
136
|
-
* platform-specific binaries create a virtual file system and we need
|
137
|
-
* to forward the package libPath from exec.ts.
|
138
|
-
* @returns user info
|
139
|
-
*/
|
140
|
-
|
141
|
-
async function getAuthenticatedUser(cliPath = DEFAULT_CLI_PATH): Promise<User | undefined> {
|
142
|
-
if (process.env.CI) {
|
143
|
-
return buildCIUser();
|
144
|
-
}
|
145
|
-
|
146
|
-
try {
|
147
|
-
const cachePath = path.resolve(cliPath, CACHE_FILEPATH);
|
148
|
-
const file = Bun.file(cachePath);
|
149
|
-
const user = await file.json();
|
150
|
-
|
151
|
-
if (isYahooEmployee(user)) {
|
152
|
-
return user;
|
153
|
-
}
|
154
|
-
|
155
|
-
await logout(cachePath); // remove cached user if they're not a @yahooinc.com email.
|
156
|
-
} catch (err) {
|
157
|
-
if ((err as NodeJS.ErrnoException).code !== 'ENOENT') {
|
158
|
-
console.error(err);
|
159
|
-
}
|
160
|
-
}
|
161
|
-
|
162
|
-
return undefined;
|
163
|
-
}
|
164
|
-
|
165
|
-
export {
|
166
|
-
authenticateUser,
|
167
|
-
buildCIUser,
|
168
|
-
exec,
|
169
|
-
getAuthenticatedUser,
|
170
|
-
getGitEmail,
|
171
|
-
isYahooEmployee,
|
172
|
-
login,
|
173
|
-
logout,
|
174
|
-
type User,
|
175
|
-
};
|
package/dist/chunk-5D2A6RFS.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
import{getMotionVar as r}from"./chunk-KYESDN2J.js";import{FONT_DECLARATIONS_MAP as t,fromEntries as a}from"./chunk-MZKL2XHU.js";import{entries as n}from"./chunk-EWJ3J526.js";import{require_baseGetTag as o,require_isArray as e,require_isObjectLike as s}from"./chunk-SVO6TMF5.js";import{TEXT_TRANSFORM_PREFIX as i,LINE_HEIGHT_PREFIX as d,FONT_SIZE_PREFIX as f,FONT_WIDTH_PREFIX as c,FONT_SLANT_PREFIX as l,FONT_WEIGHT_PREFIX as u,FONT_FAMILY_PREFIX as m,TEXT_RESPONSIVE_CLASSNAME as p,UDS_PREFIX as h}from"./chunk-24RMELG3.js";import{__commonJS as $,__toESM as g}from"./chunk-GF4A6TFM.js";import{textVariants as v,motionSpringConfigOptions as w}from"@yahoo/uds/fixtures";import x from"tailwindcss/plugin.js";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
|
2
|
-
var M=$({"../../node_modules/lodash/isString.js"(r,t){var a=o(),n=e(),i=s();t.exports=function(r){return"string"==typeof r||!n(r)&&i(r)&&"[object String]"==a(r)}}}),b=g(M(),1),k=r=>{throw new Error("Didn't expect to get here")};var y=(r,t,a,n)=>{const o=r.typography[t]?.[a];if(!o)throw new Error(`Missing typography data for variant "${t}" and key "${a}"`);const e="base"===n?o.base:o.breakpoints?.[n];if(!e)throw new Error(`Missing value for variant "${t}", key "${a}", and breakpoint "${n}"`);if((0,b.default)(e))return e;switch(e.type){case"px":return e.value/16+"rem";case"unitless":return String(e.value)}return k()},S=(r,t)=>t in r.font?`var(--${m}-${t})`:t,j=(r,t)=>Object.fromEntries(v.flatMap(a=>[[`--${m}-${a}`,S(r,y(r,a,"fontFamily",t))],[`--${f}-${a}`,y(r,a,"fontSize",t)],[`--${u}-${a}`,y(r,a,"fontWeight",t)],[`--${l}-${a}`,y(r,a,"fontSlant",t)],[`--${c}-${a}`,y(r,a,"fontWidth",t)],[`--${d}-${a}`,y(r,a,"lineHeight",t)],[`--${i}-${a}`,y(r,a,"textTransform",t)]])),E=r=>Object.fromEntries(v.map(t=>[t,`var(--${r}-${t})`])),F={fontFamily:E(m),fontWeight:E(u),fontSlant:E(l),fontWidth:E(c),fontSize:E(f),lineHeight:E(d),textTransform:E(i)},L=r=>j(r,"base"),O=r=>{const t=(a=r.breakpoints,Object.entries(a)).sort(([,{value:r}],[,{value:t}])=>r-t);var a;return{[`.${p}`]:Object.fromEntries(t.map(([t,{value:a}])=>[`@media (min-width: ${a}px)`,j(r,t)])),".uds-text-base":j(r,"base"),...Object.fromEntries(t.map(([t])=>[`.uds-text-${t}`,j(r,t)]))}};function _(r,{addBase:t}){const a=z(r);for(const r of a)t({"@font-face":r})}var W=x.withOptions(function({fontIds:r}){return function({addBase:t}){_(r,{addBase:t})}});function T(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 z(r){return r.flatMap(r=>{const{declarations:a,fontFamily:n}=t[r];return a.map(r=>({fontFamily:n,fontDisplay:"swap",...r}))})}function B(r){return`"${r}"`}function D(r){return a(n(r).map(([r,a])=>{const n=`--${m}-${r}`,o=t[a];return[n,[o.fontFamily,...o.fallback].map(B).join(", ")]}))}function H(t){const o=n(t).flatMap(([t,a])=>n(a).flatMap(([a,n])=>w.map(o=>[r({variant:t,speed:a,control:o}),`${n[o]}`])));return a(o)}function J(r){return{...r.borderRadius._vars,...r.borderWidth._vars,...r.avatarSizes._vars,...r.iconSizes._vars}}function G(r){return{xSmall:J(r.scaleMode.xSmall),small:J(r.scaleMode.small),medium:J(r.scaleMode.medium),large:J(r.scaleMode.large),xLarge:J(r.scaleMode.xLarge),xxLarge:J(r.scaleMode.xxLarge),xxxLarge:J(r.scaleMode.xxxLarge)}}function K({config:r,shadowType:t}){const o=r.shadow[t],e=n(o).map(([r])=>[`.uds-${t}-shadow-${r}`,{[`--uds-${t}-shadow`]:`var(--${h}-${t}-shadow-${r})`,boxShadow:`var(--${h}-drop-shadow, 0 0 transparent), var(--${h}-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(e)}export{F as RESPONSIVE_TAILWIND_CONFIG_MAP,_ as addFontFaceDeclarations,W as addFontsPlugin,k as assertUnreachable,L as getBaseTextVars,T as getColorModeStyles,z as getFontFaceDeclarations,D as getFontStyles,H as getMotionStyles,O as getResponsiveTextStyles,G as getScaleModeStyles,K as getShadowStyles,M as require_isString};
|
package/dist/chunk-74BWCTGT.cjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";var e=require("./chunk-NQ7BFO3S.cjs"),t=require("./chunk-QXAMOFS3.cjs"),r=require("./chunk-J7PUOUXC.cjs"),n=require("./chunk-GJLQAO4M.cjs"),a=require("./chunk-3AYBRPUC.cjs"),o=require("./chunk-QLXJH36U.cjs"),s=require("@yahoo/uds/fixtures");function i(e){return e&&e.__esModule?e:{default:e}}var c=i(require("tailwindcss/plugin.js")),d=o.__commonJS({"../../node_modules/lodash/isString.js"(e,t){var r=n.require_baseGetTag(),a=n.require_isArray(),o=n.require_isObjectLike();t.exports=function(e){return"string"==typeof e||!a(e)&&o(e)&&"[object String]"==r(e)}}}),u=o.__toESM(d(),1),l=e=>{throw new Error("Didn't expect to get here")};/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var f=(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 o="base"===n?a.base:a.breakpoints?.[n];if(!o)throw new Error(`Missing value for variant "${t}", key "${r}", and breakpoint "${n}"`);if((0,u.default)(o))return o;switch(o.type){case"px":return o.value/16+"rem";case"unitless":return String(o.value)}return l()},_=(e,t)=>t in e.font?`var(--${a.FONT_FAMILY_PREFIX}-${t})`:t,p=(e,t)=>Object.fromEntries(s.textVariants.flatMap(r=>[[`--${a.FONT_FAMILY_PREFIX}-${r}`,_(e,f(e,r,"fontFamily",t))],[`--${a.FONT_SIZE_PREFIX}-${r}`,f(e,r,"fontSize",t)],[`--${a.FONT_WEIGHT_PREFIX}-${r}`,f(e,r,"fontWeight",t)],[`--${a.FONT_SLANT_PREFIX}-${r}`,f(e,r,"fontSlant",t)],[`--${a.FONT_WIDTH_PREFIX}-${r}`,f(e,r,"fontWidth",t)],[`--${a.LINE_HEIGHT_PREFIX}-${r}`,f(e,r,"lineHeight",t)],[`--${a.TEXT_TRANSFORM_PREFIX}-${r}`,f(e,r,"textTransform",t)]])),F=e=>Object.fromEntries(s.textVariants.map(t=>[t,`var(--${e}-${t})`])),E={fontFamily:F(a.FONT_FAMILY_PREFIX),fontWeight:F(a.FONT_WEIGHT_PREFIX),fontSlant:F(a.FONT_SLANT_PREFIX),fontWidth:F(a.FONT_WIDTH_PREFIX),fontSize:F(a.FONT_SIZE_PREFIX),lineHeight:F(a.LINE_HEIGHT_PREFIX),textTransform:F(a.TEXT_TRANSFORM_PREFIX)};function S(e,{addBase:t}){const r=h(e);for(const e of r)t({"@font-face":e})}var g=c.default.withOptions(function({fontIds:e}){return function({addBase:t}){S(e,{addBase:t})}});function h(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 m(e){return`"${e}"`}function x(e){return{...e.borderRadius._vars,...e.borderWidth._vars,...e.avatarSizes._vars,...e.iconSizes._vars}}exports.RESPONSIVE_TAILWIND_CONFIG_MAP=E,exports.addFontFaceDeclarations=S,exports.addFontsPlugin=g,exports.assertUnreachable=l,exports.getBaseTextVars=e=>p(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=h,exports.getFontStyles=function(e){return t.fromEntries(r.entries(e).map(([e,r])=>{const n=`--${a.FONT_FAMILY_PREFIX}-${e}`,o=t.FONT_DECLARATIONS_MAP[r];return[n,[o.fontFamily,...o.fallback].map(m).join(", ")]}))},exports.getMotionStyles=function(n){const a=r.entries(n).flatMap(([t,n])=>r.entries(n).flatMap(([r,n])=>s.motionSpringConfigOptions.map(a=>[e.getMotionVar({variant:t,speed:r,control:a}),`${n[a]}`])));return t.fromEntries(a)},exports.getResponsiveTextStyles=e=>{const t=(r=e.breakpoints,Object.entries(r)).sort(([,{value:e}],[,{value:t}])=>e-t);var r;return{[`.${a.TEXT_RESPONSIVE_CLASSNAME}`]:Object.fromEntries(t.map(([t,{value:r}])=>[`@media (min-width: ${r}px)`,p(e,t)])),".uds-text-base":p(e,"base"),...Object.fromEntries(t.map(([t])=>[`.uds-text-${t}`,p(e,t)]))}},exports.getScaleModeStyles=function(e){return{xSmall:x(e.scaleMode.xSmall),small:x(e.scaleMode.small),medium:x(e.scaleMode.medium),large:x(e.scaleMode.large),xLarge:x(e.scaleMode.xLarge),xxLarge:x(e.scaleMode.xxLarge),xxxLarge:x(e.scaleMode.xxxLarge)}},exports.getShadowStyles=function({config:e,shadowType:n}){const o=e.shadow[n],s=r.entries(o).map(([e])=>[`.uds-${n}-shadow-${e}`,{[`--uds-${n}-shadow`]:`var(--${a.UDS_PREFIX}-${n}-shadow-${e})`,boxShadow:`var(--${a.UDS_PREFIX}-drop-shadow, 0 0 transparent), var(--${a.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)},exports.require_isString=d;
|
package/dist/chunk-DCZLRK3J.js
DELETED
@@ -1,2 +0,0 @@
|
|
1
|
-
import{getMotionVar as r}from"./chunk-KYESDN2J.js";import{FONT_DECLARATIONS_MAP as t,fromEntries as a}from"./chunk-ST7Z3YRS.js";import{entries as n}from"./chunk-EWJ3J526.js";import{require_baseGetTag as o,require_isArray as e,require_isObjectLike as s}from"./chunk-QF6YIMT4.js";import{TEXT_TRANSFORM_PREFIX as i,LINE_HEIGHT_PREFIX as d,FONT_SIZE_PREFIX as f,FONT_WIDTH_PREFIX as c,FONT_SLANT_PREFIX as l,FONT_WEIGHT_PREFIX as u,FONT_FAMILY_PREFIX as m,TEXT_RESPONSIVE_CLASSNAME as p,UDS_PREFIX as h}from"./chunk-24RMELG3.js";import{__commonJS as $,__toESM as g}from"./chunk-GF4A6TFM.js";import{textVariants as v,motionSpringConfigOptions as w}from"@yahoo/uds/fixtures";import x from"tailwindcss/plugin.js";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */
|
2
|
-
var b=$({"../../node_modules/lodash/isString.js"(r,t){var a=o(),n=e(),i=s();t.exports=function(r){return"string"==typeof r||!n(r)&&i(r)&&"[object String]"==a(r)}}}),M=g(b(),1),k=r=>{throw new Error("Didn't expect to get here")};var S=(r,t,a,n)=>{const o=r.typography[t]?.[a];if(!o)throw new Error(`Missing typography data for variant "${t}" and key "${a}"`);const e="base"===n?o.base:o.breakpoints?.[n];if(!e)throw new Error(`Missing value for variant "${t}", key "${a}", and breakpoint "${n}"`);if((0,M.default)(e))return e;switch(e.type){case"px":return e.value/16+"rem";case"unitless":return String(e.value)}return k()},y=(r,t)=>t in r.font?`var(--${m}-${t})`:t,j=(r,t)=>Object.fromEntries(v.flatMap(a=>[[`--${m}-${a}`,y(r,S(r,a,"fontFamily",t))],[`--${f}-${a}`,S(r,a,"fontSize",t)],[`--${u}-${a}`,S(r,a,"fontWeight",t)],[`--${l}-${a}`,S(r,a,"fontSlant",t)],[`--${c}-${a}`,S(r,a,"fontWidth",t)],[`--${d}-${a}`,S(r,a,"lineHeight",t)],[`--${i}-${a}`,S(r,a,"textTransform",t)]])),E=r=>Object.fromEntries(v.map(t=>[t,`var(--${r}-${t})`])),F={fontFamily:E(m),fontWeight:E(u),fontSlant:E(l),fontWidth:E(c),fontSize:E(f),lineHeight:E(d),textTransform:E(i)},L=r=>j(r,"base"),_=r=>{const t=(a=r.breakpoints,Object.entries(a)).sort(([,{value:r}],[,{value:t}])=>r-t);var a;return{[`.${p}`]:Object.fromEntries(t.map(([t,{value:a}])=>[`@media (min-width: ${a}px)`,j(r,t)])),".uds-text-base":j(r,"base"),...Object.fromEntries(t.map(([t])=>[`.uds-text-${t}`,j(r,t)]))}};function O(r,{addBase:t}){const a=z(r);for(const r of a)t({"@font-face":r})}var T=x.withOptions(function({fontIds:r}){return function({addBase:t}){O(r,{addBase:t})}});function W(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 z(r){return r.flatMap(r=>{const{declarations:a,fontFamily:n}=t[r];return a.map(r=>({fontFamily:n,fontDisplay:"swap",...r}))})}function B(r){return`"${r}"`}function D(r){return a(n(r).map(([r,a])=>{const n=`--${m}-${r}`,o=t[a];return[n,[o.fontFamily,...o.fallback].map(B).join(", ")]}))}function J(t){const o=n(t).flatMap(([t,a])=>n(a).flatMap(([a,n])=>w.map(o=>[r({variant:t,speed:a,control:o}),`${n[o]}`])));return a(o)}function R(r){return{...r.borderRadius._vars,...r.borderWidth._vars,...r.avatarSizes._vars,...r.iconSizes._vars}}function Y(r){return{xSmall:R(r.scaleMode.xSmall),small:R(r.scaleMode.small),medium:R(r.scaleMode.medium),large:R(r.scaleMode.large),xLarge:R(r.scaleMode.xLarge),xxLarge:R(r.scaleMode.xxLarge),xxxLarge:R(r.scaleMode.xxxLarge)}}function G({config:r,shadowType:t}){const o=r.shadow[t],e=n(o).map(([r])=>[`.uds-${t}-shadow-${r}`,{[`--uds-${t}-shadow`]:`var(--${h}-${t}-shadow-${r})`,boxShadow:`var(--${h}-drop-shadow, 0 0 transparent), var(--${h}-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(e)}export{F as RESPONSIVE_TAILWIND_CONFIG_MAP,O as addFontFaceDeclarations,T as addFontsPlugin,k as assertUnreachable,L as getBaseTextVars,W as getColorModeStyles,z as getFontFaceDeclarations,D as getFontStyles,J as getMotionStyles,_ as getResponsiveTextStyles,Y as getScaleModeStyles,G as getShadowStyles,b as require_isString};
|
package/dist/chunk-VQ4KEVVH.cjs
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";var e=require("./chunk-NQ7BFO3S.cjs"),t=require("./chunk-S5NRWKDP.cjs"),r=require("./chunk-J7PUOUXC.cjs"),n=require("./chunk-Y5HRSSOF.cjs"),a=require("./chunk-3AYBRPUC.cjs"),o=require("./chunk-QLXJH36U.cjs"),s=require("@yahoo/uds/fixtures");function i(e){return e&&e.__esModule?e:{default:e}}var c=i(require("tailwindcss/plugin.js")),d=o.__commonJS({"../../node_modules/lodash/isString.js"(e,t){var r=n.require_baseGetTag(),a=n.require_isArray(),o=n.require_isObjectLike();t.exports=function(e){return"string"==typeof e||!a(e)&&o(e)&&"[object String]"==r(e)}}}),u=o.__toESM(d(),1),l=e=>{throw new Error("Didn't expect to get here")};/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var f=(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 o="base"===n?a.base:a.breakpoints?.[n];if(!o)throw new Error(`Missing value for variant "${t}", key "${r}", and breakpoint "${n}"`);if((0,u.default)(o))return o;switch(o.type){case"px":return o.value/16+"rem";case"unitless":return String(o.value)}return l()},_=(e,t)=>t in e.font?`var(--${a.FONT_FAMILY_PREFIX}-${t})`:t,p=(e,t)=>Object.fromEntries(s.textVariants.flatMap(r=>[[`--${a.FONT_FAMILY_PREFIX}-${r}`,_(e,f(e,r,"fontFamily",t))],[`--${a.FONT_SIZE_PREFIX}-${r}`,f(e,r,"fontSize",t)],[`--${a.FONT_WEIGHT_PREFIX}-${r}`,f(e,r,"fontWeight",t)],[`--${a.FONT_SLANT_PREFIX}-${r}`,f(e,r,"fontSlant",t)],[`--${a.FONT_WIDTH_PREFIX}-${r}`,f(e,r,"fontWidth",t)],[`--${a.LINE_HEIGHT_PREFIX}-${r}`,f(e,r,"lineHeight",t)],[`--${a.TEXT_TRANSFORM_PREFIX}-${r}`,f(e,r,"textTransform",t)]])),F=e=>Object.fromEntries(s.textVariants.map(t=>[t,`var(--${e}-${t})`])),E={fontFamily:F(a.FONT_FAMILY_PREFIX),fontWeight:F(a.FONT_WEIGHT_PREFIX),fontSlant:F(a.FONT_SLANT_PREFIX),fontWidth:F(a.FONT_WIDTH_PREFIX),fontSize:F(a.FONT_SIZE_PREFIX),lineHeight:F(a.LINE_HEIGHT_PREFIX),textTransform:F(a.TEXT_TRANSFORM_PREFIX)};function S(e,{addBase:t}){const r=h(e);for(const e of r)t({"@font-face":e})}var g=c.default.withOptions(function({fontIds:e}){return function({addBase:t}){S(e,{addBase:t})}});function h(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 m(e){return`"${e}"`}function x(e){return{...e.borderRadius._vars,...e.borderWidth._vars,...e.avatarSizes._vars,...e.iconSizes._vars}}exports.RESPONSIVE_TAILWIND_CONFIG_MAP=E,exports.addFontFaceDeclarations=S,exports.addFontsPlugin=g,exports.assertUnreachable=l,exports.getBaseTextVars=e=>p(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=h,exports.getFontStyles=function(e){return t.fromEntries(r.entries(e).map(([e,r])=>{const n=`--${a.FONT_FAMILY_PREFIX}-${e}`,o=t.FONT_DECLARATIONS_MAP[r];return[n,[o.fontFamily,...o.fallback].map(m).join(", ")]}))},exports.getMotionStyles=function(n){const a=r.entries(n).flatMap(([t,n])=>r.entries(n).flatMap(([r,n])=>s.motionSpringConfigOptions.map(a=>[e.getMotionVar({variant:t,speed:r,control:a}),`${n[a]}`])));return t.fromEntries(a)},exports.getResponsiveTextStyles=e=>{const t=(r=e.breakpoints,Object.entries(r)).sort(([,{value:e}],[,{value:t}])=>e-t);var r;return{[`.${a.TEXT_RESPONSIVE_CLASSNAME}`]:Object.fromEntries(t.map(([t,{value:r}])=>[`@media (min-width: ${r}px)`,p(e,t)])),".uds-text-base":p(e,"base"),...Object.fromEntries(t.map(([t])=>[`.uds-text-${t}`,p(e,t)]))}},exports.getScaleModeStyles=function(e){return{xSmall:x(e.scaleMode.xSmall),small:x(e.scaleMode.small),medium:x(e.scaleMode.medium),large:x(e.scaleMode.large),xLarge:x(e.scaleMode.xLarge),xxLarge:x(e.scaleMode.xxLarge),xxxLarge:x(e.scaleMode.xxxLarge)}},exports.getShadowStyles=function({config:e,shadowType:n}){const o=e.shadow[n],s=r.entries(o).map(([e])=>[`.uds-${n}-shadow-${e}`,{[`--uds-${n}-shadow`]:`var(--${a.UDS_PREFIX}-${n}-shadow-${e})`,boxShadow:`var(--${a.UDS_PREFIX}-drop-shadow, 0 0 transparent), var(--${a.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)},exports.require_isString=d;
|