@yahoo/uds 3.36.0-beta.4 → 3.37.0-beta.1

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.
Files changed (48) hide show
  1. package/cli/FullWidthClassToProp.mock.tsx +17 -0
  2. package/cli/bin/uds-darwin-arm64-baseline +0 -0
  3. package/cli/bin/uds-darwin-x64 +0 -0
  4. package/cli/bin/uds-linux-arm64 +0 -0
  5. package/cli/bin/uds-linux-x64-baseline +0 -0
  6. package/cli/cli.ts +1 -21
  7. package/cli/commands/uds.ts +1 -4
  8. package/cli/env.d.ts +0 -2
  9. package/cli/utils/analytics.ts +7 -12
  10. package/dist/analytics/server.cjs +1 -1
  11. package/dist/analytics/server.js +1 -1
  12. package/dist/experimental/client/SwitchV2.js +0 -1
  13. package/dist/metafile-cjs.json +1 -1
  14. package/dist/metafile-esm.json +1 -1
  15. package/package.json +1 -1
  16. package/cli/commands/login.ts +0 -30
  17. package/cli/commands/logout.ts +0 -27
  18. package/cli/utils/auth.ts +0 -175
  19. package/dist/Box-B5-iomov.d.ts +0 -34
  20. package/dist/Box-DiAlMwFs.d.cts +0 -34
  21. package/dist/Input-C2JHbAnz.d.cts +0 -54
  22. package/dist/Input-Drdk_VTx.d.ts +0 -54
  23. package/dist/Pressable-BtsR3Qz0.d.cts +0 -44
  24. package/dist/Pressable-DvTJyjgZ.d.ts +0 -44
  25. package/dist/VStack-mmwkcypy.d.cts +0 -83
  26. package/dist/VStack-r7oAc-8J.d.ts +0 -83
  27. package/dist/chunk-4GUXQTU3.cjs +0 -3
  28. package/dist/chunk-5U4J6DA5.cjs +0 -1
  29. package/dist/chunk-6HG5KSL6.cjs +0 -1
  30. package/dist/chunk-CTYIRZ5A.cjs +0 -1
  31. package/dist/chunk-DCZLRK3J.js +0 -2
  32. package/dist/chunk-H62QDZOV.cjs +0 -2
  33. package/dist/chunk-LWGAE6PD.cjs +0 -1
  34. package/dist/chunk-MATTX7AJ.js +0 -1
  35. package/dist/chunk-PVXOGAWH.js +0 -2
  36. package/dist/chunk-QF6YIMT4.js +0 -2
  37. package/dist/chunk-RMRBUBTB.js +0 -3
  38. package/dist/chunk-S5NRWKDP.cjs +0 -1
  39. package/dist/chunk-ST7Z3YRS.js +0 -2
  40. package/dist/chunk-UYLBFQ4P.js +0 -2
  41. package/dist/chunk-VQ4KEVVH.cjs +0 -1
  42. package/dist/chunk-WRE54KQN.js +0 -2
  43. package/dist/chunk-WX4V6S4A.js +0 -1
  44. package/dist/chunk-Y5HRSSOF.cjs +0 -1
  45. package/dist/index-BiFYC5eM.d.ts +0 -245
  46. package/dist/index-CISBacKa.d.cts +0 -245
  47. package/dist/types-BRmrSr-u.d.cts +0 -10585
  48. package/dist/types-BRmrSr-u.d.ts +0 -10585
@@ -0,0 +1,17 @@
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
+ }
Binary file
Binary file
Binary file
Binary file
package/cli/cli.ts CHANGED
@@ -2,13 +2,10 @@
2
2
  // Start bluebun to run the correct CLI command
3
3
  import { parseArgs } from 'node:util';
4
4
 
5
- import { cli, print, red } from 'bluebun';
5
+ import { cli } from 'bluebun';
6
6
  import updateNotifier from 'simple-update-notifier';
7
7
 
8
8
  import packageJson from '../package.json' assert { type: 'json' };
9
- import { getAuthenticatedUser } from './utils/auth';
10
-
11
- const EXEMPT_FROM_AUTH = ['login'];
12
9
 
13
10
  async function main() {
14
11
  if (process.env.CI !== '1') {
@@ -38,23 +35,6 @@ async function main() {
38
35
  cliPath,
39
36
  });
40
37
 
41
- // Don't require auth when running root `--help`
42
- const isRootHelp = command.name === 'uds' && props.options.help;
43
- const shouldRequireAuth = !isRootHelp && !EXEMPT_FROM_AUTH.includes(command.name);
44
-
45
- if (shouldRequireAuth) {
46
- const user = await getAuthenticatedUser(cliPath);
47
-
48
- if (!user) {
49
- print(
50
- red(
51
- '🚨 Sign-in required. Please run `uds login` and use a @yahooinc.com email during sign-in.',
52
- ),
53
- );
54
- return;
55
- }
56
- }
57
-
58
38
  await command.run(props);
59
39
  }
60
40
 
@@ -2,7 +2,6 @@ import type { Props } from 'bluebun';
2
2
  import { print, red } from 'bluebun';
3
3
 
4
4
  import { trackEvent } from '../utils/analytics';
5
- import { getAuthenticatedUser } from '../utils/auth';
6
5
  import { getCommandHelp } from '../utils/getCommandHelp';
7
6
 
8
7
  export default {
@@ -13,8 +12,6 @@ export default {
13
12
  print(red(`Unknown command: ${props.first}`));
14
13
  await trackEvent('unknown_cmd', { cmd: props.first });
15
14
  }
16
- const user = await getAuthenticatedUser();
17
- const notes = user ? `🔒 Logged in as ${user.email}` : undefined;
18
- await getCommandHelp({ ...props, notes });
15
+ await getCommandHelp({ ...props });
19
16
  },
20
17
  };
package/cli/env.d.ts CHANGED
@@ -20,7 +20,5 @@ declare module 'bun' {
20
20
  UDS_ID?: string;
21
21
  /** UDS sync command - filename to write the config output */
22
22
  UDS_OUT_FILE?: string;
23
- /** UDS team slug for CLI */
24
- UDS_TEAM_SLUG?: string;
25
23
  }
26
24
  }
@@ -1,19 +1,14 @@
1
1
  import type { EventName } from '@yahoo/uds/analytics/server';
2
2
  import { GA_MEASUREMENT_IDS, GA_MEASUREMENT_SECRETS, track } from '@yahoo/uds/analytics/server';
3
3
 
4
- import { getAuthenticatedUser } from './auth';
5
-
6
4
  export async function setup() {
7
- const user = await getAuthenticatedUser();
8
- if (user) {
9
- await track.init({
10
- appName: 'cli',
11
- apiSecret: GA_MEASUREMENT_SECRETS.cli,
12
- measurementId: GA_MEASUREMENT_IDS.cli,
13
- // @ts-expect-error type is fine
14
- user,
15
- });
16
- }
5
+ // Initialize analytics without user authentication
6
+ // Analytics will work anonymously
7
+ await track.init({
8
+ appName: 'cli',
9
+ apiSecret: GA_MEASUREMENT_SECRETS.cli,
10
+ measurementId: GA_MEASUREMENT_IDS.cli,
11
+ });
17
12
  }
18
13
 
19
14
  export async function trackEvent(...args: Parameters<typeof track.event<EventName['cli']>>) {
@@ -1 +1 @@
1
- "use strict";var e=require("os"),t=require("child_process"),i=require("uuid");function r(e){return e&&e.__esModule?e:{default:e}}var n=r(e),s=r(t),a=/^(\w+)\:\s+flags=/,o=/^(\w+)\s{2,}link encap:\w+/i,c=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,l=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function u(){let e="eth";const t=n.default.platform();return"darwin"===t?e="en":"win32"===t&&(e=void 0),e}function d(e,t){return"IPv4"===t?"IPv4"===e||4===e:"IPv6"===t?"IPv6"===e||6===e:e===t}function f(e,t,i=!1){let r;for(const n of e)if(d(n.family,t)){if(i&&n.address.startsWith("127."))continue;if("IPv6"!==t)return n;if(0===n.scopeid)return n;r||(r=n)}return r}function m(e,t){let i;i=e,i=i||u();const r=function(e,t){const i=n.default.networkInterfaces(),r=!t;if(e=e||"IPv4",t=t||u())for(let r=-1;r<8;r++){const n=i[t+(r>=0?r:"")];if(n){const t=f(n,e);if(t)return t}}if(r)for(const t in i){const r=i[t];if(r){const t=f(r,e,!0);if(t)return t}}}("IPv4",i);return r?(process.env.CI||"ff:00:00:00:00:00"!==r.mac&&"00:00:00:00:00:00"!==r.mac||(r.mac=""),r.mac?t(null,r.mac):void s.default.exec("win32"===n.default.platform()?"ipconfig/all":"/sbin/ifconfig",{timeout:5e3},(e,n)=>{if(e||!n)return t(e);if(!i)return t();const s=function(e,t,i){const r=e.split("\n");for(let e=0;e<r.length;e++){let n=r[e].trimEnd();const s=a.exec(n)||o.exec(n);if(!s)continue;if(0!==s[1].indexOf(t))continue;let u=null,d=null,f=c.exec(n);for(f&&(d=f[1]),e++;;){if(n=r[e],!n||a.exec(n)||o.exec(n)){e--;break}d||(f=c.exec(n),f&&(d=f[1])),u||(f=l.exec(n),f&&(u=f[1])),e++}if(u===i)return d}return null}(n||"",i,r.address);t(null,s)})):t()}async function h(){const e=await new Promise((e,t)=>{m("",(i,r)=>{if(i)return t(i);e(r||null)})})??n.default.hostname();return i.v5(e,"6ba7b810-9dad-11d1-80b4-00c04fd430c8")}var p={all:"G-0C2FBF3K5Y",docs:"G-6HSWE4WFFV",cli:"G-4N1G785K8W","figma-plugin":"G-Q1PFL2R17E","figma-dev-mode":"G-ZD8YHG3NWV",metrics:"G-1JW6B5D3JH",configurator:"G-JEHT4QPKB0",create:"G-YQKTV5NWTC"},w={all:"GwoNoIVUQwy-AP5hKnoskw",cli:"lrds1CjyTGimkKEA9hvmmQ","figma-plugin":"CgJ4b2ISS8KArcJHihE9og","figma-dev-mode":"Ns1whhmxTE-QIpDdbZr45Q"},g=["development","test"].includes(process.env.NODE_ENV??""),v=new class{#e;#t;#i;#r=!1;appName;user;debugMode;async init({appName:e,measurementId:t,apiSecret:i,debugMode:r,user:n}){if(!this.#r)return this.#e=t,this.#t=i,this.user=n,this.appName=e,this.debugMode=r??g,h().then(e=>{this.#i=e,this.#r=!0,this.#n()});console.info("UDS analytics: already initialized.")}getClientId(){return this.#i}#n(){if(!this.#r)throw new Error("UDS analytics: not been initialized. Have you called init()?");if(!this.#e)throw new Error("UDS analytics: measurement property ID has not been set.");if(!this.#i)throw new Error("UDS analytics - client ID has not been set.");if(!this.user)throw new Error("UDS analytics: user has not been set.");if(!this.user.analyticsContext)throw new Error("UDS analytics: user is missing analyticsContext.")}pageview(e={}){return this.event("page_view",e)}event(e,t={}){return this.#s(e,t)}error(e={}){return this.#s("error",e)}async#s(e,t={}){this.#n();const{role:i,team:r}=this.user.analyticsContext??{},n=i&&r?{role:{value:i},team:{value:r}}:void 0,s={client_id:this.#i,user_id:this.user.id,user_properties:n,events:[{name:e,params:{app_name:this.appName,engagement_time_msec:"0",...this.debugMode&&{debug_mode:!0},...t}}]},a=[{id:this.#e,apiSecret:this.#t},{id:p.all,apiSecret:w.all}].map(async({id:t,apiSecret:i})=>{try{const r=new URL("https://www.google-analytics.com/mp/collect");r.searchParams.set("measurement_id",t),r.searchParams.set("api_secret",i);const n=await fetch(r.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!n.ok)throw new Error(`HTTP error status: ${n.status}`);g&&console.log(`UDS analytics: event "${e}" sent successfully to ${t}.`)}catch(e){console.error(`UDS analytics: error sending event to ${t}:`,e)}});return Promise.allSettled(a)}};exports.GA_MEASUREMENT_IDS=p,exports.GA_MEASUREMENT_SECRETS=w,exports.track=v;
1
+ "use strict";var e=require("os"),t=require("child_process"),i=require("uuid");function r(e){return e&&e.__esModule?e:{default:e}}var n=r(e),s=r(t),a=/^(\w+)\:\s+flags=/,o=/^(\w+)\s{2,}link encap:\w+/i,c=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,l=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function d(){let e="eth";const t=n.default.platform();return"darwin"===t?e="en":"win32"===t&&(e=void 0),e}function u(e,t){return"IPv4"===t?"IPv4"===e||4===e:"IPv6"===t?"IPv6"===e||6===e:e===t}function f(e,t,i=!1){let r;for(const n of e)if(u(n.family,t)){if(i&&n.address.startsWith("127."))continue;if("IPv6"!==t)return n;if(0===n.scopeid)return n;r||(r=n)}return r}function m(e,t){let i;i=e,i=i||d();const r=function(e,t){const i=n.default.networkInterfaces(),r=!t;if(e=e||"IPv4",t=t||d())for(let r=-1;r<8;r++){const n=i[t+(r>=0?r:"")];if(n){const t=f(n,e);if(t)return t}}if(r)for(const t in i){const r=i[t];if(r){const t=f(r,e,!0);if(t)return t}}}("IPv4",i);return r?(process.env.CI||"ff:00:00:00:00:00"!==r.mac&&"00:00:00:00:00:00"!==r.mac||(r.mac=""),r.mac?t(null,r.mac):void s.default.exec("win32"===n.default.platform()?"ipconfig/all":"/sbin/ifconfig",{timeout:5e3},(e,n)=>{if(e||!n)return t(e);if(!i)return t();const s=function(e,t,i){const r=e.split("\n");for(let e=0;e<r.length;e++){let n=r[e].trimEnd();const s=a.exec(n)||o.exec(n);if(!s)continue;if(0!==s[1].indexOf(t))continue;let d=null,u=null,f=c.exec(n);for(f&&(u=f[1]),e++;;){if(n=r[e],!n||a.exec(n)||o.exec(n)){e--;break}u||(f=c.exec(n),f&&(u=f[1])),d||(f=l.exec(n),f&&(d=f[1])),e++}if(d===i)return u}return null}(n||"",i,r.address);t(null,s)})):t()}async function h(){const e=await new Promise((e,t)=>{m("",(i,r)=>{if(i)return t(i);e(r||null)})})??n.default.hostname();return i.v5(e,"6ba7b810-9dad-11d1-80b4-00c04fd430c8")}var p={all:"G-0C2FBF3K5Y",docs:"G-6HSWE4WFFV",cli:"G-4N1G785K8W","figma-plugin":"G-Q1PFL2R17E","figma-dev-mode":"G-ZD8YHG3NWV",metrics:"G-1JW6B5D3JH",configurator:"G-JEHT4QPKB0",create:"G-YQKTV5NWTC"},v={all:"GwoNoIVUQwy-AP5hKnoskw",cli:"lrds1CjyTGimkKEA9hvmmQ","figma-plugin":"CgJ4b2ISS8KArcJHihE9og","figma-dev-mode":"Ns1whhmxTE-QIpDdbZr45Q"},g=["development","test"].includes(process.env.NODE_ENV??""),w=new class{#e;#t;#i;#r=!1;appName;user;debugMode;async init({appName:e,measurementId:t,apiSecret:i,debugMode:r,user:n}){if(!this.#r)return this.#e=t,this.#t=i,this.user=n,this.appName=e,this.debugMode=r??g,h().then(e=>{this.#i=e,this.#r=!0,this.#n()});console.info("UDS analytics: already initialized.")}getClientId(){return this.#i}#n(){if(!this.#r)throw new Error("UDS analytics: not been initialized. Have you called init()?");if(!this.#e)throw new Error("UDS analytics: measurement property ID has not been set.");if(!this.#i)throw new Error("UDS analytics - client ID has not been set.")}pageview(e={}){return this.event("page_view",e)}event(e,t={}){return this.#s(e,t)}error(e={}){return this.#s("error",e)}async#s(e,t={}){this.#n();const{role:i,team:r}=this.user?.analyticsContext??{},n=i&&r?{role:{value:i},team:{value:r}}:void 0,s={client_id:this.#i,user_id:this.user?.id??void 0,user_properties:n,events:[{name:e,params:{app_name:this.appName,engagement_time_msec:"0",...this.debugMode&&{debug_mode:!0},...t}}]},a=[{id:this.#e,apiSecret:this.#t},{id:p.all,apiSecret:v.all}].map(async({id:t,apiSecret:i})=>{try{const r=new URL("https://www.google-analytics.com/mp/collect");r.searchParams.set("measurement_id",t),r.searchParams.set("api_secret",i);const n=await fetch(r.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!n.ok)throw new Error(`HTTP error status: ${n.status}`);g&&console.log(`UDS analytics: event "${e}" sent successfully to ${t}.`)}catch(e){console.error(`UDS analytics: error sending event to ${t}:`,e)}});return Promise.allSettled(a)}};exports.GA_MEASUREMENT_IDS=p,exports.GA_MEASUREMENT_SECRETS=v,exports.track=w;
@@ -1 +1 @@
1
- import e from"os";import t from"child_process";import{v5 as i}from"uuid";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var n=/^(\w+)\:\s+flags=/,r=/^(\w+)\s{2,}link encap:\w+/i,s=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,a=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function o(){let t="eth";const i=e.platform();return"darwin"===i?t="en":"win32"===i&&(t=void 0),t}function c(e,t){return"IPv4"===t?"IPv4"===e||4===e:"IPv6"===t?"IPv6"===e||6===e:e===t}function l(e,t,i=!1){let n;for(const r of e)if(c(r.family,t)){if(i&&r.address.startsWith("127."))continue;if("IPv6"!==t)return r;if(0===r.scopeid)return r;n||(n=r)}return n}function d(i,c){let d;d=i,d=d||o();const u=function(t,i){const n=e.networkInterfaces(),r=!i;if(t=t||"IPv4",i=i||o())for(let e=-1;e<8;e++){const r=n[i+(e>=0?e:"")];if(r){const e=l(r,t);if(e)return e}}if(r)for(const e in n){const i=n[e];if(i){const e=l(i,t,!0);if(e)return e}}}("IPv4",d);return u?(process.env.CI||"ff:00:00:00:00:00"!==u.mac&&"00:00:00:00:00:00"!==u.mac||(u.mac=""),u.mac?c(null,u.mac):void t.exec("win32"===e.platform()?"ipconfig/all":"/sbin/ifconfig",{timeout:5e3},(e,t)=>{if(e||!t)return c(e);if(!d)return c();const i=function(e,t,i){const o=e.split("\n");for(let e=0;e<o.length;e++){let c=o[e].trimEnd();const l=n.exec(c)||r.exec(c);if(!l)continue;if(0!==l[1].indexOf(t))continue;let d=null,u=null,m=s.exec(c);for(m&&(u=m[1]),e++;;){if(c=o[e],!c||n.exec(c)||r.exec(c)){e--;break}u||(m=s.exec(c),m&&(u=m[1])),d||(m=a.exec(c),m&&(d=m[1])),e++}if(d===i)return u}return null}(t||"",d,u.address);c(null,i)})):c()}async function u(){const t=await new Promise((e,t)=>{d("",(i,n)=>{if(i)return t(i);e(n||null)})})??e.hostname();return i(t,"6ba7b810-9dad-11d1-80b4-00c04fd430c8")}var m={all:"G-0C2FBF3K5Y",docs:"G-6HSWE4WFFV",cli:"G-4N1G785K8W","figma-plugin":"G-Q1PFL2R17E","figma-dev-mode":"G-ZD8YHG3NWV",metrics:"G-1JW6B5D3JH",configurator:"G-JEHT4QPKB0",create:"G-YQKTV5NWTC"},f={all:"GwoNoIVUQwy-AP5hKnoskw",cli:"lrds1CjyTGimkKEA9hvmmQ","figma-plugin":"CgJ4b2ISS8KArcJHihE9og","figma-dev-mode":"Ns1whhmxTE-QIpDdbZr45Q"},h=["development","test"].includes(process.env.NODE_ENV??""),p=new class{#e;#t;#i;#n=!1;appName;user;debugMode;async init({appName:e,measurementId:t,apiSecret:i,debugMode:n,user:r}){if(!this.#n)return this.#e=t,this.#t=i,this.user=r,this.appName=e,this.debugMode=n??h,u().then(e=>{this.#i=e,this.#n=!0,this.#r()});console.info("UDS analytics: already initialized.")}getClientId(){return this.#i}#r(){if(!this.#n)throw new Error("UDS analytics: not been initialized. Have you called init()?");if(!this.#e)throw new Error("UDS analytics: measurement property ID has not been set.");if(!this.#i)throw new Error("UDS analytics - client ID has not been set.");if(!this.user)throw new Error("UDS analytics: user has not been set.");if(!this.user.analyticsContext)throw new Error("UDS analytics: user is missing analyticsContext.")}pageview(e={}){return this.event("page_view",e)}event(e,t={}){return this.#s(e,t)}error(e={}){return this.#s("error",e)}async#s(e,t={}){this.#r();const{role:i,team:n}=this.user.analyticsContext??{},r=i&&n?{role:{value:i},team:{value:n}}:void 0,s={client_id:this.#i,user_id:this.user.id,user_properties:r,events:[{name:e,params:{app_name:this.appName,engagement_time_msec:"0",...this.debugMode&&{debug_mode:!0},...t}}]},a=[{id:this.#e,apiSecret:this.#t},{id:m.all,apiSecret:f.all}].map(async({id:t,apiSecret:i})=>{try{const n=new URL("https://www.google-analytics.com/mp/collect");n.searchParams.set("measurement_id",t),n.searchParams.set("api_secret",i);const r=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!r.ok)throw new Error(`HTTP error status: ${r.status}`);h&&console.log(`UDS analytics: event "${e}" sent successfully to ${t}.`)}catch(e){console.error(`UDS analytics: error sending event to ${t}:`,e)}});return Promise.allSettled(a)}};export{m as GA_MEASUREMENT_IDS,f as GA_MEASUREMENT_SECRETS,p as track};
1
+ import e from"os";import t from"child_process";import{v5 as i}from"uuid";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var n=/^(\w+)\:\s+flags=/,r=/^(\w+)\s{2,}link encap:\w+/i,s=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,a=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function o(){let t="eth";const i=e.platform();return"darwin"===i?t="en":"win32"===i&&(t=void 0),t}function c(e,t){return"IPv4"===t?"IPv4"===e||4===e:"IPv6"===t?"IPv6"===e||6===e:e===t}function l(e,t,i=!1){let n;for(const r of e)if(c(r.family,t)){if(i&&r.address.startsWith("127."))continue;if("IPv6"!==t)return r;if(0===r.scopeid)return r;n||(n=r)}return n}function d(i,c){let d;d=i,d=d||o();const u=function(t,i){const n=e.networkInterfaces(),r=!i;if(t=t||"IPv4",i=i||o())for(let e=-1;e<8;e++){const r=n[i+(e>=0?e:"")];if(r){const e=l(r,t);if(e)return e}}if(r)for(const e in n){const i=n[e];if(i){const e=l(i,t,!0);if(e)return e}}}("IPv4",d);return u?(process.env.CI||"ff:00:00:00:00:00"!==u.mac&&"00:00:00:00:00:00"!==u.mac||(u.mac=""),u.mac?c(null,u.mac):void t.exec("win32"===e.platform()?"ipconfig/all":"/sbin/ifconfig",{timeout:5e3},(e,t)=>{if(e||!t)return c(e);if(!d)return c();const i=function(e,t,i){const o=e.split("\n");for(let e=0;e<o.length;e++){let c=o[e].trimEnd();const l=n.exec(c)||r.exec(c);if(!l)continue;if(0!==l[1].indexOf(t))continue;let d=null,u=null,m=s.exec(c);for(m&&(u=m[1]),e++;;){if(c=o[e],!c||n.exec(c)||r.exec(c)){e--;break}u||(m=s.exec(c),m&&(u=m[1])),d||(m=a.exec(c),m&&(d=m[1])),e++}if(d===i)return u}return null}(t||"",d,u.address);c(null,i)})):c()}async function u(){const t=await new Promise((e,t)=>{d("",(i,n)=>{if(i)return t(i);e(n||null)})})??e.hostname();return i(t,"6ba7b810-9dad-11d1-80b4-00c04fd430c8")}var m={all:"G-0C2FBF3K5Y",docs:"G-6HSWE4WFFV",cli:"G-4N1G785K8W","figma-plugin":"G-Q1PFL2R17E","figma-dev-mode":"G-ZD8YHG3NWV",metrics:"G-1JW6B5D3JH",configurator:"G-JEHT4QPKB0",create:"G-YQKTV5NWTC"},f={all:"GwoNoIVUQwy-AP5hKnoskw",cli:"lrds1CjyTGimkKEA9hvmmQ","figma-plugin":"CgJ4b2ISS8KArcJHihE9og","figma-dev-mode":"Ns1whhmxTE-QIpDdbZr45Q"},h=["development","test"].includes(process.env.NODE_ENV??""),p=new class{#e;#t;#i;#n=!1;appName;user;debugMode;async init({appName:e,measurementId:t,apiSecret:i,debugMode:n,user:r}){if(!this.#n)return this.#e=t,this.#t=i,this.user=r,this.appName=e,this.debugMode=n??h,u().then(e=>{this.#i=e,this.#n=!0,this.#r()});console.info("UDS analytics: already initialized.")}getClientId(){return this.#i}#r(){if(!this.#n)throw new Error("UDS analytics: not been initialized. Have you called init()?");if(!this.#e)throw new Error("UDS analytics: measurement property ID has not been set.");if(!this.#i)throw new Error("UDS analytics - client ID has not been set.")}pageview(e={}){return this.event("page_view",e)}event(e,t={}){return this.#s(e,t)}error(e={}){return this.#s("error",e)}async#s(e,t={}){this.#r();const{role:i,team:n}=this.user?.analyticsContext??{},r=i&&n?{role:{value:i},team:{value:n}}:void 0,s={client_id:this.#i,user_id:this.user?.id??void 0,user_properties:r,events:[{name:e,params:{app_name:this.appName,engagement_time_msec:"0",...this.debugMode&&{debug_mode:!0},...t}}]},a=[{id:this.#e,apiSecret:this.#t},{id:m.all,apiSecret:f.all}].map(async({id:t,apiSecret:i})=>{try{const n=new URL("https://www.google-analytics.com/mp/collect");n.searchParams.set("measurement_id",t),n.searchParams.set("api_secret",i);const r=await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!r.ok)throw new Error(`HTTP error status: ${r.status}`);h&&console.log(`UDS analytics: event "${e}" sent successfully to ${t}.`)}catch(e){console.error(`UDS analytics: error sending event to ${t}:`,e)}});return Promise.allSettled(a)}};export{m as GA_MEASUREMENT_IDS,f as GA_MEASUREMENT_SECRETS,p as track};
@@ -1,2 +1 @@
1
- "use client";
2
1
  import{FormLabel as t}from"../../chunk-I7ZFG4YT.js";import{SpringMotionConfig as e,AvoidMotionLibraryProvider as a}from"../../chunk-Z44HLHNN.js";import{Box as o,cx as i,getStyles as n,IconSlot as r}from"../../chunk-QZIQVD63.js";import*as l from"motion/react-m";import{forwardRef as c,useId as s,useRef as d,useState as h,useCallback as u,useEffect as m}from"react";import{jsx as f,jsxs as p}from"react/jsx-runtime";/*! © 2025 Yahoo, Inc. UDS v0.0.0-development */var w=()=>import("../../domMax-XRPNJ6D3.js").then(({domMax:t})=>t),y=l.create(o),b=c(function({id:a,isOn:l,defaultIsOn:c,onChange:b,label:v,labelPosition:N="start",size:x="md",onIcon:C,offIcon:I,reduceMotion:g,disabled:V,required:k,onFocus:S,onBlur:H,className:z,layerClassNames:j,...A},F){const M=s(),P=a??`uds-input-${M}`,R=d(null),q=void 0!==l,[D,Z]=h(q?l:c),B=u(t=>{b?.(t),q||Z(t.target.checked)},[q,b]),O=u(t=>{S?.(t)},[S]),Q=u(t=>{H?.(t)},[H]),G=g?"always":"user",J=g?"duration-0":"duration-120 motion-reduce:duration-0";m(()=>{q&&Z(l)},[l,q]);const L={root:n({switchSizeRoot:x,switchVariantRoot:"default",switchVariantActiveRoot:D?"on":"off",className:i("group","flex","items-center","start"===N?"flex-row":"flex-row-reverse",...V?["cursor-default","opacity-50"]:["cursor-pointer"],j?.root,z)}),switch:n({switchVariantSwitch:"default",switchSizeSwitch:x,switchVariantActiveSwitch:D?"on":"off",className:i("uds-ring","uds-ring-within","relative","rounded-full","items-center",J,"transition-[background-color,box-shadow]",j?.switch)}),handleContainer:i("pointer-events-none","relative","w-full","h-full"),handle:n({switchSizeHandle:x,className:i("absolute","top-0","bottom-0",D?"right-0":"left-0",j?.handle)}),handleContents:i("relative","w-full","h-full","rounded-full","overflow-hidden",!V&&"group-hover:scale-105","opacity-95",!V&&"group-hover:opacity-100",J,"transition-[transform,opacity]"),handleCircle:n({switchVariantActiveHandle:D?"on":"off",switchVariantHandle:"default",className:i("absolute","top-0","left-0","right-0","bottom-0")}),handleIcon:n({switchSizeHandleIcon:x,switchVariantHandleIcon:"default",switchVariantActiveHandleIcon:D?"on":"off",className:i("absolute","opacity-0","top-1/2","left-1/2","transform","translate-x-[-50%]","translate-y-[-50%]",J,"transition-opacity")}),htmlCheckbox:i("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:i("start"===N?"text-start":"text-end",j?.label)};return f(e,{reducedMotion:G,loadFeatures:w,layoutVariant:"bouncy",layoutSpeed:"4",children:p(v?"label":"div",{className:L.root,"data-testid":"switch-root",tabIndex:-1,children:[p(o,{className:L.switch,children:[f("input",{type:"checkbox",...A,ref:t=>{R.current=t,"function"==typeof F?F(t):null!==F&&(F.current=t)},onFocus:O,onBlur:Q,id:P,disabled:V,required:k,checked:q?D:void 0,defaultChecked:q?void 0:c,onChange:B,className:L.htmlCheckbox,style:{}}),f(o,{className:L.handleContainer,children:f(y,{className:L.handle,layout:"position",layoutDependency:D,children:p(o,{className:L.handleContents,children:[f(o,{className:L.handleCircle}),C&&f(r,{icon:C,iconProps:{variant:"fill",size:"sm"},"data-testid":"on-icon",className:i(L.handleIcon,D?"opacity-100":"opacity-0")}),I&&f(r,{icon:I,iconProps:{variant:"fill",size:"sm"},"data-testid":"off-icon",className:i(L.handleIcon,D?"opacity-0":"opacity-100")})]})})})]}),v&&f(t,{as:"div",variant:"inherit",color:"inherit",required:k,label:v,className:L.label})]})})});b.displayName="SwitchV2";var v=a;export{b as SwitchV2,v as SwitchV2AvoidMotionLibraryProvider};