@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
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yahoo/uds",
3
3
  "description": "Yahoo Universal System",
4
- "version": "3.36.0-beta.4",
4
+ "version": "3.37.0-beta.1",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "uds": "./cli/uds-cli.js"
@@ -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
- };
@@ -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
- };
@@ -1,34 +0,0 @@
1
- import * as react from 'react';
2
- import { b as UniversalBoxProps } from './types-BRmrSr-u.js';
3
-
4
- type DivProps = React.HTMLAttributes<HTMLDivElement>;
5
- interface BoxProps extends UniversalBoxProps, DivProps {
6
- }
7
- /**
8
- * **📦 A layout component that can be used to compose other components**
9
- *
10
- * @description
11
- * The most simple component we ship - a div. But with all the power of the UDS design system.
12
- * By default, `Box` is a flexbox container. When working with vertical or horizontal layouts,
13
- * consider using [VStack](./v-stack) or [HStack](./h-stack) respectively.
14
- *
15
- * @example
16
- * ```tsx
17
- * import { Box } from '@yahoo/uds';
18
- *
19
- * <Box backgroundColor="primary" spacing="6">
20
- * Any kind of content can go here!
21
- * </Box>
22
- * ```
23
- *
24
- * @usage
25
- * - If you need to div-like container to apply padding, shapes, or other styling.
26
- * - If you're creating card components.
27
- *
28
- * @see The {@link https://uds.build/docs/components/box Box Docs} for more info
29
- *
30
- * @related [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
31
- */
32
- declare const Box: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLDivElement>>;
33
-
34
- export { type BoxProps as B, type DivProps as D, Box as a };
@@ -1,34 +0,0 @@
1
- import * as react from 'react';
2
- import { b as UniversalBoxProps } from './types-BRmrSr-u.cjs';
3
-
4
- type DivProps = React.HTMLAttributes<HTMLDivElement>;
5
- interface BoxProps extends UniversalBoxProps, DivProps {
6
- }
7
- /**
8
- * **📦 A layout component that can be used to compose other components**
9
- *
10
- * @description
11
- * The most simple component we ship - a div. But with all the power of the UDS design system.
12
- * By default, `Box` is a flexbox container. When working with vertical or horizontal layouts,
13
- * consider using [VStack](./v-stack) or [HStack](./h-stack) respectively.
14
- *
15
- * @example
16
- * ```tsx
17
- * import { Box } from '@yahoo/uds';
18
- *
19
- * <Box backgroundColor="primary" spacing="6">
20
- * Any kind of content can go here!
21
- * </Box>
22
- * ```
23
- *
24
- * @usage
25
- * - If you need to div-like container to apply padding, shapes, or other styling.
26
- * - If you're creating card components.
27
- *
28
- * @see The {@link https://uds.build/docs/components/box Box Docs} for more info
29
- *
30
- * @related [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
31
- */
32
- declare const Box: react.ForwardRefExoticComponent<BoxProps & react.RefAttributes<HTMLDivElement>>;
33
-
34
- export { type BoxProps as B, type DivProps as D, Box as a };
@@ -1,54 +0,0 @@
1
- import * as react from 'react';
2
- import { InputHTMLAttributes } from 'react';
3
- import { U as UniversalInputProps, I as IconPropsWithSVGProps } from './types-BRmrSr-u.cjs';
4
- import { HTMLMotionProps } from 'motion/react';
5
- import { B as BoxProps } from './Box-DiAlMwFs.cjs';
6
-
7
- type HtmlInputProps = React.InputHTMLAttributes<HTMLInputElement> & HTMLMotionProps<'input'>;
8
- type NativeInputProps = Omit<HtmlInputProps, 'height' | 'size' | 'width' | 'color' | 'required'>;
9
- type DataAttributes = {
10
- [name: `data-${string}`]: string;
11
- };
12
- interface InputProps extends NativeInputProps, UniversalInputProps {
13
- /** The type of the input element. Reduced set of options from the HTML input type attribute.
14
- * @default 'text'
15
- */
16
- type?: Exclude<NativeInputProps['type'], 'button' | 'checkbox' | 'color' | 'file' | 'radio' | 'range' | 'reset' | 'submit' | 'search'>;
17
- /** Props to be passed into various slots within the component. */
18
- slotProps?: {
19
- input?: Partial<InputHTMLAttributes<HTMLInputElement> & DataAttributes>;
20
- inputWrapper?: Partial<BoxProps & DataAttributes>;
21
- startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
22
- endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
23
- };
24
- }
25
- /**
26
- * **📦 An input that allows users to enter text and collect data.**
27
- *
28
- * @componentType Client component
29
- *
30
- * @description
31
- * An input field is a component that takes text typed into it. It can also serve as a way to display a selection and trigger a dropdown menu. Inputs are interactive elements that users can click, tap, or otherwise engage with to collect data and open dropdowns, or both.
32
- *
33
- * @see
34
- * Check out the {@link https://uds.build/docs/components/input Input Docs} for more info
35
- *
36
- * @usage
37
- * - Forms: For collecting data like names, emails, passwords, etc. (e.g., sign-up, login, or contact forms).
38
- * - Search Bars: Allowing users to enter search queries to find content.
39
- * - Filters/Settings: When users need to specify preferences, like selecting a date or adjusting a number value.
40
- * - Feedback/Comments: Letting users leave reviews, comments, or feedback.
41
- *
42
- * @example
43
- * ```tsx
44
- * 'use client';
45
- * import { Input } from "@yahoo/uds";
46
- *
47
- * <Input label="Name" placeholder="Enter your name" required />
48
- *```
49
- *
50
- * @related [Checkbox](https://uds.build/docs/components/checkbox), [Radio](https://uds.build/docs/components/radio).
51
- **/
52
- declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
53
-
54
- export { type InputProps as I, Input as a };
@@ -1,54 +0,0 @@
1
- import * as react from 'react';
2
- import { InputHTMLAttributes } from 'react';
3
- import { U as UniversalInputProps, I as IconPropsWithSVGProps } from './types-BRmrSr-u.js';
4
- import { HTMLMotionProps } from 'motion/react';
5
- import { B as BoxProps } from './Box-B5-iomov.js';
6
-
7
- type HtmlInputProps = React.InputHTMLAttributes<HTMLInputElement> & HTMLMotionProps<'input'>;
8
- type NativeInputProps = Omit<HtmlInputProps, 'height' | 'size' | 'width' | 'color' | 'required'>;
9
- type DataAttributes = {
10
- [name: `data-${string}`]: string;
11
- };
12
- interface InputProps extends NativeInputProps, UniversalInputProps {
13
- /** The type of the input element. Reduced set of options from the HTML input type attribute.
14
- * @default 'text'
15
- */
16
- type?: Exclude<NativeInputProps['type'], 'button' | 'checkbox' | 'color' | 'file' | 'radio' | 'range' | 'reset' | 'submit' | 'search'>;
17
- /** Props to be passed into various slots within the component. */
18
- slotProps?: {
19
- input?: Partial<InputHTMLAttributes<HTMLInputElement> & DataAttributes>;
20
- inputWrapper?: Partial<BoxProps & DataAttributes>;
21
- startIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
22
- endIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
23
- };
24
- }
25
- /**
26
- * **📦 An input that allows users to enter text and collect data.**
27
- *
28
- * @componentType Client component
29
- *
30
- * @description
31
- * An input field is a component that takes text typed into it. It can also serve as a way to display a selection and trigger a dropdown menu. Inputs are interactive elements that users can click, tap, or otherwise engage with to collect data and open dropdowns, or both.
32
- *
33
- * @see
34
- * Check out the {@link https://uds.build/docs/components/input Input Docs} for more info
35
- *
36
- * @usage
37
- * - Forms: For collecting data like names, emails, passwords, etc. (e.g., sign-up, login, or contact forms).
38
- * - Search Bars: Allowing users to enter search queries to find content.
39
- * - Filters/Settings: When users need to specify preferences, like selecting a date or adjusting a number value.
40
- * - Feedback/Comments: Letting users leave reviews, comments, or feedback.
41
- *
42
- * @example
43
- * ```tsx
44
- * 'use client';
45
- * import { Input } from "@yahoo/uds";
46
- *
47
- * <Input label="Name" placeholder="Enter your name" required />
48
- *```
49
- *
50
- * @related [Checkbox](https://uds.build/docs/components/checkbox), [Radio](https://uds.build/docs/components/radio).
51
- **/
52
- declare const Input: react.ForwardRefExoticComponent<Omit<InputProps, "ref"> & react.RefAttributes<HTMLInputElement>>;
53
-
54
- export { type InputProps as I, Input as a };
@@ -1,44 +0,0 @@
1
- import * as react from 'react';
2
- import { a as UniversalPressableProps } from './types-BRmrSr-u.cjs';
3
-
4
- type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
5
- interface PressableProps extends UniversalPressableProps, HtmlButtonProps {
6
- }
7
- /**
8
- * **🖲️ A primitive component for creating button interactions with accessibility support**
9
- *
10
- * @componentType Client component
11
- *
12
- * @description
13
- * The Pressable component is a primitive component that can be used
14
- * to create button interactions with accessibility support. It can be used
15
- * to trigger an action, such as submitting a form, navigating to a new page,
16
- * or adding interactivity to a section or card.
17
- *
18
- * @example
19
- * ```tsx
20
- * import { Pressable } from '@yahoo/uds';
21
- *
22
- * <Pressable
23
- * backgroundColor="secondary"
24
- * borderWidth="thin"
25
- * borderColor="primary"
26
- * borderRadius="lg"
27
- * onPress={() => console.log('Pressed!')}
28
- * >
29
- * <Text variant="body1" color="primary" spacingHorizontal="7" spacingVertical="5">Click me...</Text>
30
- * </Pressable>
31
- * ```
32
- *
33
- * @usage
34
- * - If you need to add interactivity to a section or card.
35
- * - If you need a highly customized version of [Button](./button)
36
- *
37
- * @see The {@link https://uds.build/docs/components/pressable Pressable Docs} for more info
38
- *
39
- * @related [Button](https://uds.build/docs/components/button), [IconButton](https://uds.build/docs/components/icon-button)
40
- *
41
- */
42
- declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<HTMLButtonElement>>;
43
-
44
- export { type PressableProps as P, Pressable as a };
@@ -1,44 +0,0 @@
1
- import * as react from 'react';
2
- import { a as UniversalPressableProps } from './types-BRmrSr-u.js';
3
-
4
- type HtmlButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'name'>;
5
- interface PressableProps extends UniversalPressableProps, HtmlButtonProps {
6
- }
7
- /**
8
- * **🖲️ A primitive component for creating button interactions with accessibility support**
9
- *
10
- * @componentType Client component
11
- *
12
- * @description
13
- * The Pressable component is a primitive component that can be used
14
- * to create button interactions with accessibility support. It can be used
15
- * to trigger an action, such as submitting a form, navigating to a new page,
16
- * or adding interactivity to a section or card.
17
- *
18
- * @example
19
- * ```tsx
20
- * import { Pressable } from '@yahoo/uds';
21
- *
22
- * <Pressable
23
- * backgroundColor="secondary"
24
- * borderWidth="thin"
25
- * borderColor="primary"
26
- * borderRadius="lg"
27
- * onPress={() => console.log('Pressed!')}
28
- * >
29
- * <Text variant="body1" color="primary" spacingHorizontal="7" spacingVertical="5">Click me...</Text>
30
- * </Pressable>
31
- * ```
32
- *
33
- * @usage
34
- * - If you need to add interactivity to a section or card.
35
- * - If you need a highly customized version of [Button](./button)
36
- *
37
- * @see The {@link https://uds.build/docs/components/pressable Pressable Docs} for more info
38
- *
39
- * @related [Button](https://uds.build/docs/components/button), [IconButton](https://uds.build/docs/components/icon-button)
40
- *
41
- */
42
- declare const Pressable: react.ForwardRefExoticComponent<PressableProps & react.RefAttributes<HTMLButtonElement>>;
43
-
44
- export { type PressableProps as P, Pressable as a };
@@ -1,83 +0,0 @@
1
- import * as react from 'react';
2
- import { o as UniversalStackProps, p as UniversalDividerProps } from './types-BRmrSr-u.cjs';
3
- import { B as BoxProps, D as DivProps } from './Box-DiAlMwFs.cjs';
4
-
5
- interface DividerCoreProps extends Omit<BoxProps, 'color' | 'borderColor' | 'borderWidth'>, Omit<UniversalStackProps, 'separator' | 'asChild'>, Omit<UniversalDividerProps, 'variant'> {
6
- layerClassNames?: {
7
- root?: string;
8
- text?: string;
9
- line?: string;
10
- };
11
- }
12
-
13
- type VariantWithInherit = Exclude<UniversalDividerProps['variant'], undefined> | 'inherit';
14
- interface DividerInternalProps extends DividerCoreProps {
15
- variant?: VariantWithInherit;
16
- }
17
-
18
- type DividerProps = Omit<DividerInternalProps, 'layerClassNames'>;
19
- /**
20
- * **📦 A divider component that can be used to visually separate components**
21
- *
22
- * @description
23
- * The Divider component is a visual element used to separate content and create clear groupings within a layout. It helps establish hierarchy, improve readability, and guide users through sections of an interface. Dividers can appear as horizontal or vertical lines and are commonly used between related content blocks, within menus, or in dense UI areas to reduce visual clutter.
24
- *
25
- * @example
26
- * ```tsx
27
- * import { Divider } from '@yahoo/uds';
28
- *
29
- * // Default primary horizontal divider. Similar to <hr />
30
- * <Divider />
31
- *
32
- * // A vertical divider.
33
- * <Divider vertical />
34
- *
35
- * // A horizontal divider with the secondary styling.
36
- * <Divider variant="secondary" />
37
- *
38
- * // A vertical divider with the tertiary styling.
39
- * <Divider vertical variant="tertiary" />
40
- * ```
41
- *
42
- * @usage
43
- * - Visually separating parts of a page. Usually used in conjuction with [HStack](./h-stack) or [VStack](./v-stack).
44
- *
45
- * @see The {@link https://uds.build/docs/components/divider Divider Docs} for more info
46
- *
47
- * @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
48
- */
49
- declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
50
-
51
- type VStackProps = UniversalStackProps & DivProps;
52
- /**
53
- * **🥞 A layout component that arranges its children in rows using flexbox**
54
- *
55
- * @description
56
- * VStack is a layout component that arranges its children in rows using [flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox)
57
- * and can be used to compose larger layouts. VStack is similar to [Box](./box) but provides additional features like a `gap` property to
58
- * add spacing between children.
59
- *
60
- * @example
61
- * ```tsx
62
- * import { VStack, Text } from '@yahoo/uds';
63
- *
64
- * <VStack gap="6">
65
- * <Text variant="body1" color="primary">First</Text>
66
- * <Text variant="body1" color="primary">Second</Text>
67
- * <Text variant="body1" color="primary">Third</Text>
68
- * </VStack>
69
- * ```
70
- *
71
- * @usage
72
- * - Create a column of items, optionally with gaps between.
73
- * - Create rows that are sized to their content (height only). By default each child will fill the width of the VStack.
74
- * - Create rows that fill the available space within the parent container.
75
- * - Create rows of proportionate size to each other (also known as a ratio-based layout).
76
- *
77
- * @see The {@link https://uds.build/docs/components/v-stack VStack Docs} for more info
78
- *
79
- * @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack)
80
- **/
81
- declare const VStack: react.ForwardRefExoticComponent<UniversalStackProps & DivProps & react.RefAttributes<HTMLDivElement>>;
82
-
83
- export { type DividerProps as D, type VStackProps as V, Divider as a, VStack as b };
@@ -1,83 +0,0 @@
1
- import * as react from 'react';
2
- import { o as UniversalStackProps, p as UniversalDividerProps } from './types-BRmrSr-u.js';
3
- import { B as BoxProps, D as DivProps } from './Box-B5-iomov.js';
4
-
5
- interface DividerCoreProps extends Omit<BoxProps, 'color' | 'borderColor' | 'borderWidth'>, Omit<UniversalStackProps, 'separator' | 'asChild'>, Omit<UniversalDividerProps, 'variant'> {
6
- layerClassNames?: {
7
- root?: string;
8
- text?: string;
9
- line?: string;
10
- };
11
- }
12
-
13
- type VariantWithInherit = Exclude<UniversalDividerProps['variant'], undefined> | 'inherit';
14
- interface DividerInternalProps extends DividerCoreProps {
15
- variant?: VariantWithInherit;
16
- }
17
-
18
- type DividerProps = Omit<DividerInternalProps, 'layerClassNames'>;
19
- /**
20
- * **📦 A divider component that can be used to visually separate components**
21
- *
22
- * @description
23
- * The Divider component is a visual element used to separate content and create clear groupings within a layout. It helps establish hierarchy, improve readability, and guide users through sections of an interface. Dividers can appear as horizontal or vertical lines and are commonly used between related content blocks, within menus, or in dense UI areas to reduce visual clutter.
24
- *
25
- * @example
26
- * ```tsx
27
- * import { Divider } from '@yahoo/uds';
28
- *
29
- * // Default primary horizontal divider. Similar to <hr />
30
- * <Divider />
31
- *
32
- * // A vertical divider.
33
- * <Divider vertical />
34
- *
35
- * // A horizontal divider with the secondary styling.
36
- * <Divider variant="secondary" />
37
- *
38
- * // A vertical divider with the tertiary styling.
39
- * <Divider vertical variant="tertiary" />
40
- * ```
41
- *
42
- * @usage
43
- * - Visually separating parts of a page. Usually used in conjuction with [HStack](./h-stack) or [VStack](./v-stack).
44
- *
45
- * @see The {@link https://uds.build/docs/components/divider Divider Docs} for more info
46
- *
47
- * @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack), [VStack](https://uds.build/docs/components/v-stack)
48
- */
49
- declare const Divider: react.ForwardRefExoticComponent<DividerProps & react.RefAttributes<HTMLDivElement>>;
50
-
51
- type VStackProps = UniversalStackProps & DivProps;
52
- /**
53
- * **🥞 A layout component that arranges its children in rows using flexbox**
54
- *
55
- * @description
56
- * VStack is a layout component that arranges its children in rows using [flexbox](https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox)
57
- * and can be used to compose larger layouts. VStack is similar to [Box](./box) but provides additional features like a `gap` property to
58
- * add spacing between children.
59
- *
60
- * @example
61
- * ```tsx
62
- * import { VStack, Text } from '@yahoo/uds';
63
- *
64
- * <VStack gap="6">
65
- * <Text variant="body1" color="primary">First</Text>
66
- * <Text variant="body1" color="primary">Second</Text>
67
- * <Text variant="body1" color="primary">Third</Text>
68
- * </VStack>
69
- * ```
70
- *
71
- * @usage
72
- * - Create a column of items, optionally with gaps between.
73
- * - Create rows that are sized to their content (height only). By default each child will fill the width of the VStack.
74
- * - Create rows that fill the available space within the parent container.
75
- * - Create rows of proportionate size to each other (also known as a ratio-based layout).
76
- *
77
- * @see The {@link https://uds.build/docs/components/v-stack VStack Docs} for more info
78
- *
79
- * @related [Box](https://uds.build/docs/components/box), [HStack](https://uds.build/docs/components/h-stack)
80
- **/
81
- declare const VStack: react.ForwardRefExoticComponent<UniversalStackProps & DivProps & react.RefAttributes<HTMLDivElement>>;
82
-
83
- export { type DividerProps as D, type VStackProps as V, Divider as a, VStack as b };