@yahoo/uds 3.100.0-beta.3 → 3.100.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automated-config/dist/generated/autoVariants.cjs +1 -0
- package/dist/automated-config/dist/generated/autoVariants.d.cts +1 -0
- package/dist/automated-config/dist/generated/autoVariants.d.ts +1 -0
- package/dist/automated-config/dist/generated/autoVariants.js +1 -0
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +56 -1
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +15 -1
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +15 -1
- package/dist/automated-config/dist/generated/generatedConfigs.js +56 -1
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +5 -0
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +5 -0
- package/dist/components/client/Toast/Toast.cjs +1 -1
- package/dist/components/client/Toast/Toast.d.cts +1 -1
- package/dist/components/client/Toast/Toast.d.ts +1 -1
- package/dist/components/client/Toast/Toast.js +1 -1
- package/dist/components/client/Tooltip/Tooltip.cjs +29 -1
- package/dist/components/client/Tooltip/Tooltip.d.cts +30 -1
- package/dist/components/client/Tooltip/Tooltip.d.ts +30 -1
- package/dist/components/client/Tooltip/Tooltip.js +29 -1
- package/dist/components/client/Tooltip/TooltipContent.cjs +47 -32
- package/dist/components/client/Tooltip/TooltipContent.js +47 -32
- package/dist/components/client/Tooltip/TooltipTrigger.d.cts +2 -1
- package/dist/components/client/Tooltip/TooltipTrigger.d.ts +2 -1
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.cjs +3 -4
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.cts +3 -4
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.d.ts +3 -4
- package/dist/components/client/Tooltip/UDSTooltipConfigProvider.js +3 -4
- package/dist/components/client/Tooltip/useTooltipContent.cjs +2 -2
- package/dist/components/client/Tooltip/useTooltipContent.d.cts +4 -1
- package/dist/components/client/Tooltip/useTooltipContent.d.ts +4 -1
- package/dist/components/client/Tooltip/useTooltipContent.js +2 -2
- package/dist/config/dist/index.cjs +5 -0
- package/dist/config/dist/index.d.cts +9 -0
- package/dist/config/dist/index.d.ts +9 -0
- package/dist/config/dist/index.js +5 -0
- package/dist/runtime/tooltipConfig.cjs +2 -1
- package/dist/runtime/tooltipConfig.d.cts +1 -0
- package/dist/runtime/tooltipConfig.d.ts +1 -0
- package/dist/runtime/tooltipConfig.js +2 -1
- package/dist/styles/styler.d.cts +30 -29
- package/dist/styles/styler.d.ts +30 -29
- package/dist/styles/variants.d.cts +3 -0
- package/dist/styles/variants.d.ts +3 -0
- package/dist/tailwind/utils/getTailwindAsUdsColors.d.cts +1 -1
- package/dist/tailwind/utils/getTailwindAsUdsColors.d.ts +1 -1
- package/dist/types/dist/index.d.cts +12 -0
- package/dist/types/dist/index.d.ts +12 -0
- package/dist/uds/generated/tailwindPurge.cjs +4 -3
- package/dist/uds/generated/tailwindPurge.js +4 -3
- package/package.json +1 -1
|
@@ -545,6 +545,7 @@ const autoVariants = {
|
|
|
545
545
|
warning: "uds-toast-variant-warning-root"
|
|
546
546
|
},
|
|
547
547
|
tooltipSizeBody: { default: "uds-tooltip-size-default-body" },
|
|
548
|
+
tooltipSizeEndContent: { default: "uds-tooltip-size-default-endcontent" },
|
|
548
549
|
tooltipSizeIcon: { default: "uds-tooltip-size-default-icon" },
|
|
549
550
|
tooltipSizeRoot: { default: "uds-tooltip-size-default-root" },
|
|
550
551
|
tooltipSizeSvg: { default: "uds-tooltip-size-default-svg" },
|
|
@@ -122,6 +122,7 @@ interface StylePropsVariantsAuto<T> {
|
|
|
122
122
|
toastVariantIcon: Record<'error' | 'info' | 'loading' | 'success' | 'warning', T>;
|
|
123
123
|
toastVariantRoot: Record<'error' | 'info' | 'loading' | 'success' | 'warning', T>;
|
|
124
124
|
tooltipSizeBody: Record<'default', T>;
|
|
125
|
+
tooltipSizeEndContent: Record<'default', T>;
|
|
125
126
|
tooltipSizeIcon: Record<'default', T>;
|
|
126
127
|
tooltipSizeRoot: Record<'default', T>;
|
|
127
128
|
tooltipSizeSvg: Record<'default', T>;
|
|
@@ -122,6 +122,7 @@ interface StylePropsVariantsAuto<T> {
|
|
|
122
122
|
toastVariantIcon: Record<'error' | 'info' | 'loading' | 'success' | 'warning', T>;
|
|
123
123
|
toastVariantRoot: Record<'error' | 'info' | 'loading' | 'success' | 'warning', T>;
|
|
124
124
|
tooltipSizeBody: Record<'default', T>;
|
|
125
|
+
tooltipSizeEndContent: Record<'default', T>;
|
|
125
126
|
tooltipSizeIcon: Record<'default', T>;
|
|
126
127
|
tooltipSizeRoot: Record<'default', T>;
|
|
127
128
|
tooltipSizeSvg: Record<'default', T>;
|
|
@@ -544,6 +544,7 @@ const autoVariants = {
|
|
|
544
544
|
warning: "uds-toast-variant-warning-root"
|
|
545
545
|
},
|
|
546
546
|
tooltipSizeBody: { default: "uds-tooltip-size-default-body" },
|
|
547
|
+
tooltipSizeEndContent: { default: "uds-tooltip-size-default-endcontent" },
|
|
547
548
|
tooltipSizeIcon: { default: "uds-tooltip-size-default-icon" },
|
|
548
549
|
tooltipSizeRoot: { default: "uds-tooltip-size-default-root" },
|
|
549
550
|
tooltipSizeSvg: { default: "uds-tooltip-size-default-svg" },
|
|
@@ -30423,6 +30423,61 @@ const TooltipConfig = {
|
|
|
30423
30423
|
]]
|
|
30424
30424
|
} }
|
|
30425
30425
|
},
|
|
30426
|
+
endContent: {
|
|
30427
|
+
label: "endContent",
|
|
30428
|
+
properties: { textVariant: {
|
|
30429
|
+
defaults: { default: "caption1" },
|
|
30430
|
+
label: "shortcut text variant",
|
|
30431
|
+
name: "textVariant",
|
|
30432
|
+
typeOfFixture: ["textVariants"],
|
|
30433
|
+
values: [[
|
|
30434
|
+
"display1",
|
|
30435
|
+
"display2",
|
|
30436
|
+
"display3",
|
|
30437
|
+
"title1",
|
|
30438
|
+
"title2",
|
|
30439
|
+
"title3",
|
|
30440
|
+
"title4",
|
|
30441
|
+
"headline1",
|
|
30442
|
+
"body1",
|
|
30443
|
+
"label1",
|
|
30444
|
+
"label2",
|
|
30445
|
+
"label3",
|
|
30446
|
+
"label4",
|
|
30447
|
+
"caption1",
|
|
30448
|
+
"caption2",
|
|
30449
|
+
"legal1",
|
|
30450
|
+
"ui1",
|
|
30451
|
+
"ui2",
|
|
30452
|
+
"ui3",
|
|
30453
|
+
"ui4",
|
|
30454
|
+
"ui5",
|
|
30455
|
+
"ui6",
|
|
30456
|
+
"display1/emphasized",
|
|
30457
|
+
"display2/emphasized",
|
|
30458
|
+
"display3/emphasized",
|
|
30459
|
+
"title1/emphasized",
|
|
30460
|
+
"title2/emphasized",
|
|
30461
|
+
"title3/emphasized",
|
|
30462
|
+
"title4/emphasized",
|
|
30463
|
+
"headline1/emphasized",
|
|
30464
|
+
"body1/emphasized",
|
|
30465
|
+
"label1/emphasized",
|
|
30466
|
+
"label2/emphasized",
|
|
30467
|
+
"label3/emphasized",
|
|
30468
|
+
"label4/emphasized",
|
|
30469
|
+
"caption1/emphasized",
|
|
30470
|
+
"caption2/emphasized",
|
|
30471
|
+
"legal1/emphasized",
|
|
30472
|
+
"ui1/emphasized",
|
|
30473
|
+
"ui2/emphasized",
|
|
30474
|
+
"ui3/emphasized",
|
|
30475
|
+
"ui4/emphasized",
|
|
30476
|
+
"ui5/emphasized",
|
|
30477
|
+
"ui6/emphasized"
|
|
30478
|
+
]]
|
|
30479
|
+
} }
|
|
30480
|
+
},
|
|
30426
30481
|
icon: {
|
|
30427
30482
|
label: "icon",
|
|
30428
30483
|
properties: { size: {
|
|
@@ -30443,7 +30498,7 @@ const TooltipConfig = {
|
|
|
30443
30498
|
properties: {
|
|
30444
30499
|
gap: {
|
|
30445
30500
|
defaults: { default: "1" },
|
|
30446
|
-
label: "
|
|
30501
|
+
label: "title/content row gap",
|
|
30447
30502
|
name: "gap",
|
|
30448
30503
|
typeOfFixture: ["spacingAliases"],
|
|
30449
30504
|
values: [[
|
|
@@ -3275,6 +3275,20 @@ declare const TooltipConfig: {
|
|
|
3275
3275
|
};
|
|
3276
3276
|
};
|
|
3277
3277
|
};
|
|
3278
|
+
readonly endContent: {
|
|
3279
|
+
readonly label: "endContent";
|
|
3280
|
+
readonly properties: {
|
|
3281
|
+
readonly textVariant: {
|
|
3282
|
+
readonly defaults: {
|
|
3283
|
+
readonly default: "caption1";
|
|
3284
|
+
};
|
|
3285
|
+
readonly label: "shortcut text variant";
|
|
3286
|
+
readonly name: "textVariant";
|
|
3287
|
+
readonly typeOfFixture: readonly ["textVariants"];
|
|
3288
|
+
readonly values: readonly [readonly ["display1", "display2", "display3", "title1", "title2", "title3", "title4", "headline1", "body1", "label1", "label2", "label3", "label4", "caption1", "caption2", "legal1", "ui1", "ui2", "ui3", "ui4", "ui5", "ui6", "display1/emphasized", "display2/emphasized", "display3/emphasized", "title1/emphasized", "title2/emphasized", "title3/emphasized", "title4/emphasized", "headline1/emphasized", "body1/emphasized", "label1/emphasized", "label2/emphasized", "label3/emphasized", "label4/emphasized", "caption1/emphasized", "caption2/emphasized", "legal1/emphasized", "ui1/emphasized", "ui2/emphasized", "ui3/emphasized", "ui4/emphasized", "ui5/emphasized", "ui6/emphasized"]];
|
|
3289
|
+
};
|
|
3290
|
+
};
|
|
3291
|
+
};
|
|
3278
3292
|
readonly icon: {
|
|
3279
3293
|
readonly label: "icon";
|
|
3280
3294
|
readonly properties: {
|
|
@@ -3296,7 +3310,7 @@ declare const TooltipConfig: {
|
|
|
3296
3310
|
readonly defaults: {
|
|
3297
3311
|
readonly default: "1";
|
|
3298
3312
|
};
|
|
3299
|
-
readonly label: "
|
|
3313
|
+
readonly label: "title/content row gap";
|
|
3300
3314
|
readonly name: "gap";
|
|
3301
3315
|
readonly typeOfFixture: readonly ["spacingAliases"];
|
|
3302
3316
|
readonly values: readonly [readonly ["0", "px", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "7", "8", "9", "10", "11", "12", "14", "16", "20", "24", "28", "32", "36", "40", "44", "48", "52", "56", "60", "64", "72", "80", "96"]];
|
|
@@ -3275,6 +3275,20 @@ declare const TooltipConfig: {
|
|
|
3275
3275
|
};
|
|
3276
3276
|
};
|
|
3277
3277
|
};
|
|
3278
|
+
readonly endContent: {
|
|
3279
|
+
readonly label: "endContent";
|
|
3280
|
+
readonly properties: {
|
|
3281
|
+
readonly textVariant: {
|
|
3282
|
+
readonly defaults: {
|
|
3283
|
+
readonly default: "caption1";
|
|
3284
|
+
};
|
|
3285
|
+
readonly label: "shortcut text variant";
|
|
3286
|
+
readonly name: "textVariant";
|
|
3287
|
+
readonly typeOfFixture: readonly ["textVariants"];
|
|
3288
|
+
readonly values: readonly [readonly ["display1", "display2", "display3", "title1", "title2", "title3", "title4", "headline1", "body1", "label1", "label2", "label3", "label4", "caption1", "caption2", "legal1", "ui1", "ui2", "ui3", "ui4", "ui5", "ui6", "display1/emphasized", "display2/emphasized", "display3/emphasized", "title1/emphasized", "title2/emphasized", "title3/emphasized", "title4/emphasized", "headline1/emphasized", "body1/emphasized", "label1/emphasized", "label2/emphasized", "label3/emphasized", "label4/emphasized", "caption1/emphasized", "caption2/emphasized", "legal1/emphasized", "ui1/emphasized", "ui2/emphasized", "ui3/emphasized", "ui4/emphasized", "ui5/emphasized", "ui6/emphasized"]];
|
|
3289
|
+
};
|
|
3290
|
+
};
|
|
3291
|
+
};
|
|
3278
3292
|
readonly icon: {
|
|
3279
3293
|
readonly label: "icon";
|
|
3280
3294
|
readonly properties: {
|
|
@@ -3296,7 +3310,7 @@ declare const TooltipConfig: {
|
|
|
3296
3310
|
readonly defaults: {
|
|
3297
3311
|
readonly default: "1";
|
|
3298
3312
|
};
|
|
3299
|
-
readonly label: "
|
|
3313
|
+
readonly label: "title/content row gap";
|
|
3300
3314
|
readonly name: "gap";
|
|
3301
3315
|
readonly typeOfFixture: readonly ["spacingAliases"];
|
|
3302
3316
|
readonly values: readonly [readonly ["0", "px", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "7", "8", "9", "10", "11", "12", "14", "16", "20", "24", "28", "32", "36", "40", "44", "48", "52", "56", "60", "64", "72", "80", "96"]];
|
|
@@ -30422,6 +30422,61 @@ const TooltipConfig = {
|
|
|
30422
30422
|
]]
|
|
30423
30423
|
} }
|
|
30424
30424
|
},
|
|
30425
|
+
endContent: {
|
|
30426
|
+
label: "endContent",
|
|
30427
|
+
properties: { textVariant: {
|
|
30428
|
+
defaults: { default: "caption1" },
|
|
30429
|
+
label: "shortcut text variant",
|
|
30430
|
+
name: "textVariant",
|
|
30431
|
+
typeOfFixture: ["textVariants"],
|
|
30432
|
+
values: [[
|
|
30433
|
+
"display1",
|
|
30434
|
+
"display2",
|
|
30435
|
+
"display3",
|
|
30436
|
+
"title1",
|
|
30437
|
+
"title2",
|
|
30438
|
+
"title3",
|
|
30439
|
+
"title4",
|
|
30440
|
+
"headline1",
|
|
30441
|
+
"body1",
|
|
30442
|
+
"label1",
|
|
30443
|
+
"label2",
|
|
30444
|
+
"label3",
|
|
30445
|
+
"label4",
|
|
30446
|
+
"caption1",
|
|
30447
|
+
"caption2",
|
|
30448
|
+
"legal1",
|
|
30449
|
+
"ui1",
|
|
30450
|
+
"ui2",
|
|
30451
|
+
"ui3",
|
|
30452
|
+
"ui4",
|
|
30453
|
+
"ui5",
|
|
30454
|
+
"ui6",
|
|
30455
|
+
"display1/emphasized",
|
|
30456
|
+
"display2/emphasized",
|
|
30457
|
+
"display3/emphasized",
|
|
30458
|
+
"title1/emphasized",
|
|
30459
|
+
"title2/emphasized",
|
|
30460
|
+
"title3/emphasized",
|
|
30461
|
+
"title4/emphasized",
|
|
30462
|
+
"headline1/emphasized",
|
|
30463
|
+
"body1/emphasized",
|
|
30464
|
+
"label1/emphasized",
|
|
30465
|
+
"label2/emphasized",
|
|
30466
|
+
"label3/emphasized",
|
|
30467
|
+
"label4/emphasized",
|
|
30468
|
+
"caption1/emphasized",
|
|
30469
|
+
"caption2/emphasized",
|
|
30470
|
+
"legal1/emphasized",
|
|
30471
|
+
"ui1/emphasized",
|
|
30472
|
+
"ui2/emphasized",
|
|
30473
|
+
"ui3/emphasized",
|
|
30474
|
+
"ui4/emphasized",
|
|
30475
|
+
"ui5/emphasized",
|
|
30476
|
+
"ui6/emphasized"
|
|
30477
|
+
]]
|
|
30478
|
+
} }
|
|
30479
|
+
},
|
|
30425
30480
|
icon: {
|
|
30426
30481
|
label: "icon",
|
|
30427
30482
|
properties: { size: {
|
|
@@ -30442,7 +30497,7 @@ const TooltipConfig = {
|
|
|
30442
30497
|
properties: {
|
|
30443
30498
|
gap: {
|
|
30444
30499
|
defaults: { default: "1" },
|
|
30445
|
-
label: "
|
|
30500
|
+
label: "title/content row gap",
|
|
30446
30501
|
name: "gap",
|
|
30447
30502
|
typeOfFixture: ["spacingAliases"],
|
|
30448
30503
|
values: [[
|
|
@@ -11933,6 +11933,11 @@ const defaultUniversalTokensConfigAuto = {
|
|
|
11933
11933
|
value: "ui3/emphasized",
|
|
11934
11934
|
valueType: "alias"
|
|
11935
11935
|
} } },
|
|
11936
|
+
"size/default/endContent": { textVariant: { rest: {
|
|
11937
|
+
type: "textVariants",
|
|
11938
|
+
value: "caption1",
|
|
11939
|
+
valueType: "alias"
|
|
11940
|
+
} } },
|
|
11936
11941
|
"size/default/icon": { size: { rest: {
|
|
11937
11942
|
type: "iconSizes",
|
|
11938
11943
|
value: "xs",
|
|
@@ -11932,6 +11932,11 @@ const defaultUniversalTokensConfigAuto = {
|
|
|
11932
11932
|
value: "ui3/emphasized",
|
|
11933
11933
|
valueType: "alias"
|
|
11934
11934
|
} } },
|
|
11935
|
+
"size/default/endContent": { textVariant: { rest: {
|
|
11936
|
+
type: "textVariants",
|
|
11937
|
+
value: "caption1",
|
|
11938
|
+
valueType: "alias"
|
|
11939
|
+
} } },
|
|
11935
11940
|
"size/default/icon": { size: { rest: {
|
|
11936
11941
|
type: "iconSizes",
|
|
11937
11942
|
value: "xs",
|
|
@@ -42,7 +42,7 @@ const iconMap = {
|
|
|
42
42
|
* <Toast variant="info" message="This is a toast" />
|
|
43
43
|
*```
|
|
44
44
|
*
|
|
45
|
-
* @related Tooltip
|
|
45
|
+
* @related [Tooltip](https://uds.build/docs/components/tooltip), Popover (coming soon)
|
|
46
46
|
**/
|
|
47
47
|
const Toast = ({ message, onClickCloseButton, size: sizeProp, variant: variantProp, actionButton, onClickActionButton, startIcon, closeIcon = _yahoo_uds_icons.Cross, closeToast, slotProps, className, id, reduceMotion: forceReduceMotion }) => {
|
|
48
48
|
const { iconVariant, iconSize, buttonVariant, buttonSize, size, variant, textVariant, textColor } = require_components_client_Toast_UDSToastConfigProvider.useToastConfig(sizeProp, variantProp);
|
|
@@ -44,7 +44,7 @@ interface ToastProps extends UniversalToastProps, Partial<ReactToastifyContext>
|
|
|
44
44
|
* <Toast variant="info" message="This is a toast" />
|
|
45
45
|
*```
|
|
46
46
|
*
|
|
47
|
-
* @related Tooltip
|
|
47
|
+
* @related [Tooltip](https://uds.build/docs/components/tooltip), Popover (coming soon)
|
|
48
48
|
**/
|
|
49
49
|
declare const Toast: {
|
|
50
50
|
({
|
|
@@ -44,7 +44,7 @@ interface ToastProps extends UniversalToastProps, Partial<ReactToastifyContext>
|
|
|
44
44
|
* <Toast variant="info" message="This is a toast" />
|
|
45
45
|
*```
|
|
46
46
|
*
|
|
47
|
-
* @related Tooltip
|
|
47
|
+
* @related [Tooltip](https://uds.build/docs/components/tooltip), Popover (coming soon)
|
|
48
48
|
**/
|
|
49
49
|
declare const Toast: {
|
|
50
50
|
({
|
|
@@ -40,7 +40,7 @@ const iconMap = {
|
|
|
40
40
|
* <Toast variant="info" message="This is a toast" />
|
|
41
41
|
*```
|
|
42
42
|
*
|
|
43
|
-
* @related Tooltip
|
|
43
|
+
* @related [Tooltip](https://uds.build/docs/components/tooltip), Popover (coming soon)
|
|
44
44
|
**/
|
|
45
45
|
const Toast = ({ message, onClickCloseButton, size: sizeProp, variant: variantProp, actionButton, onClickActionButton, startIcon, closeIcon = Cross, closeToast, slotProps, className, id, reduceMotion: forceReduceMotion }) => {
|
|
46
46
|
const { iconVariant, iconSize, buttonVariant, buttonSize, size, variant, textVariant, textColor } = useToastConfig(sizeProp, variantProp);
|
|
@@ -8,7 +8,35 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
8
8
|
let _ariakit_react = require("@ariakit/react");
|
|
9
9
|
|
|
10
10
|
//#region src/components/client/Tooltip/Tooltip.tsx
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* **⚙️️ A Tooltip component that anchors to a trigger element
|
|
13
|
+
*
|
|
14
|
+
* @componentType Client component
|
|
15
|
+
*
|
|
16
|
+
* @description
|
|
17
|
+
* Tooltips provide short, contextual help for UI elements. They appear on hover, focus, or long-press, and should clarify meaning—not introduce new concepts.
|
|
18
|
+
*
|
|
19
|
+
* Tooltips are not meant for critical information or required actions. If the user must take action, use a Dialog, Popover, or Inline messaging instead.
|
|
20
|
+
*
|
|
21
|
+
* @see
|
|
22
|
+
* Check out the {@link https://uds.build/docs/components/tooltip Tooltip Docs} for more info
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* 'use client';
|
|
27
|
+
* import { Tooltip, TooltipTrigger, TooltipContent, Button } from "@yahoo/uds";
|
|
28
|
+
*
|
|
29
|
+
* <Tooltip>
|
|
30
|
+
* <TooltipTrigger>
|
|
31
|
+
* <Button>Tooltip Trigger</Button>
|
|
32
|
+
* </TooltipTrigger>
|
|
33
|
+
* <TooltipContent>basic tooltip content</TooltipContent>
|
|
34
|
+
* </Tooltip>
|
|
35
|
+
*```
|
|
36
|
+
*
|
|
37
|
+
* @related [Toast](https://uds.build/docs/components/toast), Popover (coming soon).
|
|
38
|
+
**/
|
|
39
|
+
function Tooltip({ children, placement, open, portal = true }) {
|
|
12
40
|
const hideOnHoverOutside = open === void 0;
|
|
13
41
|
const controlledProps = open !== void 0 ? {
|
|
14
42
|
showTimeout: 0,
|
|
@@ -3,12 +3,41 @@ import { UniversalTooltipProps } from "../../../types/dist/index.cjs";
|
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/client/Tooltip/Tooltip.d.ts
|
|
6
|
+
type TooltipProps = UniversalTooltipProps;
|
|
7
|
+
/**
|
|
8
|
+
* **⚙️️ A Tooltip component that anchors to a trigger element
|
|
9
|
+
*
|
|
10
|
+
* @componentType Client component
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Tooltips provide short, contextual help for UI elements. They appear on hover, focus, or long-press, and should clarify meaning—not introduce new concepts.
|
|
14
|
+
*
|
|
15
|
+
* Tooltips are not meant for critical information or required actions. If the user must take action, use a Dialog, Popover, or Inline messaging instead.
|
|
16
|
+
*
|
|
17
|
+
* @see
|
|
18
|
+
* Check out the {@link https://uds.build/docs/components/tooltip Tooltip Docs} for more info
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* 'use client';
|
|
23
|
+
* import { Tooltip, TooltipTrigger, TooltipContent, Button } from "@yahoo/uds";
|
|
24
|
+
*
|
|
25
|
+
* <Tooltip>
|
|
26
|
+
* <TooltipTrigger>
|
|
27
|
+
* <Button>Tooltip Trigger</Button>
|
|
28
|
+
* </TooltipTrigger>
|
|
29
|
+
* <TooltipContent>basic tooltip content</TooltipContent>
|
|
30
|
+
* </Tooltip>
|
|
31
|
+
*```
|
|
32
|
+
*
|
|
33
|
+
* @related [Toast](https://uds.build/docs/components/toast), Popover (coming soon).
|
|
34
|
+
**/
|
|
6
35
|
declare function Tooltip({
|
|
7
36
|
children,
|
|
8
37
|
placement,
|
|
9
38
|
open,
|
|
10
39
|
portal
|
|
11
|
-
}:
|
|
40
|
+
}: TooltipProps): react_jsx_runtime0.JSX.Element;
|
|
12
41
|
declare namespace Tooltip {
|
|
13
42
|
var displayName: string;
|
|
14
43
|
}
|
|
@@ -3,12 +3,41 @@ import { UniversalTooltipProps } from "../../../types/dist/index.js";
|
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/client/Tooltip/Tooltip.d.ts
|
|
6
|
+
type TooltipProps = UniversalTooltipProps;
|
|
7
|
+
/**
|
|
8
|
+
* **⚙️️ A Tooltip component that anchors to a trigger element
|
|
9
|
+
*
|
|
10
|
+
* @componentType Client component
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* Tooltips provide short, contextual help for UI elements. They appear on hover, focus, or long-press, and should clarify meaning—not introduce new concepts.
|
|
14
|
+
*
|
|
15
|
+
* Tooltips are not meant for critical information or required actions. If the user must take action, use a Dialog, Popover, or Inline messaging instead.
|
|
16
|
+
*
|
|
17
|
+
* @see
|
|
18
|
+
* Check out the {@link https://uds.build/docs/components/tooltip Tooltip Docs} for more info
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* 'use client';
|
|
23
|
+
* import { Tooltip, TooltipTrigger, TooltipContent, Button } from "@yahoo/uds";
|
|
24
|
+
*
|
|
25
|
+
* <Tooltip>
|
|
26
|
+
* <TooltipTrigger>
|
|
27
|
+
* <Button>Tooltip Trigger</Button>
|
|
28
|
+
* </TooltipTrigger>
|
|
29
|
+
* <TooltipContent>basic tooltip content</TooltipContent>
|
|
30
|
+
* </Tooltip>
|
|
31
|
+
*```
|
|
32
|
+
*
|
|
33
|
+
* @related [Toast](https://uds.build/docs/components/toast), Popover (coming soon).
|
|
34
|
+
**/
|
|
6
35
|
declare function Tooltip({
|
|
7
36
|
children,
|
|
8
37
|
placement,
|
|
9
38
|
open,
|
|
10
39
|
portal
|
|
11
|
-
}:
|
|
40
|
+
}: TooltipProps): react_jsx_runtime0.JSX.Element;
|
|
12
41
|
declare namespace Tooltip {
|
|
13
42
|
var displayName: string;
|
|
14
43
|
}
|
|
@@ -6,7 +6,35 @@ import { jsx } from "react/jsx-runtime";
|
|
|
6
6
|
import { TooltipProvider } from "@ariakit/react";
|
|
7
7
|
|
|
8
8
|
//#region src/components/client/Tooltip/Tooltip.tsx
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* **⚙️️ A Tooltip component that anchors to a trigger element
|
|
11
|
+
*
|
|
12
|
+
* @componentType Client component
|
|
13
|
+
*
|
|
14
|
+
* @description
|
|
15
|
+
* Tooltips provide short, contextual help for UI elements. They appear on hover, focus, or long-press, and should clarify meaning—not introduce new concepts.
|
|
16
|
+
*
|
|
17
|
+
* Tooltips are not meant for critical information or required actions. If the user must take action, use a Dialog, Popover, or Inline messaging instead.
|
|
18
|
+
*
|
|
19
|
+
* @see
|
|
20
|
+
* Check out the {@link https://uds.build/docs/components/tooltip Tooltip Docs} for more info
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* 'use client';
|
|
25
|
+
* import { Tooltip, TooltipTrigger, TooltipContent, Button } from "@yahoo/uds";
|
|
26
|
+
*
|
|
27
|
+
* <Tooltip>
|
|
28
|
+
* <TooltipTrigger>
|
|
29
|
+
* <Button>Tooltip Trigger</Button>
|
|
30
|
+
* </TooltipTrigger>
|
|
31
|
+
* <TooltipContent>basic tooltip content</TooltipContent>
|
|
32
|
+
* </Tooltip>
|
|
33
|
+
*```
|
|
34
|
+
*
|
|
35
|
+
* @related [Toast](https://uds.build/docs/components/toast), Popover (coming soon).
|
|
36
|
+
**/
|
|
37
|
+
function Tooltip({ children, placement, open, portal = true }) {
|
|
10
38
|
const hideOnHoverOutside = open === void 0;
|
|
11
39
|
const controlledProps = open !== void 0 ? {
|
|
12
40
|
showTimeout: 0,
|
|
@@ -23,7 +23,7 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
23
23
|
const currentPlacement = (0, _ariakit_react.useStoreState)(store, "currentPlacement");
|
|
24
24
|
const placement = (0, _ariakit_react.useStoreState)(store, "placement");
|
|
25
25
|
const effectivePlacement = currentPlacement ?? placement ?? "top";
|
|
26
|
-
const { borderRadius } = require_components_client_Tooltip_UDSTooltipConfigProvider.useTooltipConfig();
|
|
26
|
+
const { borderRadius, animationDuration } = require_components_client_Tooltip_UDSTooltipConfigProvider.useTooltipConfig();
|
|
27
27
|
const defaultBorderRadius = borderRadius["default"];
|
|
28
28
|
const arrowRef = (0, react.useRef)(null);
|
|
29
29
|
const { internalRef, shadowFilterId, maxWidthClass, dimensions, shadows, shadowPadding, svgPath, blurStyle, childTransitionStyle, tooltipShift, onPositionUpdate } = require_components_client_Tooltip_useTooltipContent.useTooltipContent({
|
|
@@ -31,7 +31,8 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
31
31
|
effectivePlacement,
|
|
32
32
|
maxWidth,
|
|
33
33
|
borderRadius: defaultBorderRadius,
|
|
34
|
-
arrowRef
|
|
34
|
+
arrowRef,
|
|
35
|
+
animationDuration
|
|
35
36
|
});
|
|
36
37
|
const mergedRef = require_hooks_useForkRef.useForkRef(ref, internalRef);
|
|
37
38
|
const classNames = {
|
|
@@ -50,10 +51,11 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
50
51
|
position: "absolute",
|
|
51
52
|
width: "full",
|
|
52
53
|
height: "full",
|
|
53
|
-
className: require_styles_styler.cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]", "transition-opacity",
|
|
54
|
+
className: require_styles_styler.cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]", "transition-opacity", `duration-[${animationDuration}ms]`, "ease-in-out")
|
|
54
55
|
}),
|
|
55
56
|
title: require_styles_styler.getStyles({ tooltipSizeTitle: "default" }),
|
|
56
57
|
body: require_styles_styler.getStyles({ tooltipSizeBody: "default" }),
|
|
58
|
+
endContent: require_styles_styler.getStyles({ tooltipSizeEndContent: "default" }),
|
|
57
59
|
icon: require_styles_styler.getStyles({
|
|
58
60
|
tooltipSizeIcon: "default",
|
|
59
61
|
tooltipVariantIcon: "default"
|
|
@@ -89,35 +91,46 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
89
91
|
width: dimensions.width + 2 * (shadowPadding + require_components_client_Tooltip_util.ARROW_HEIGHT),
|
|
90
92
|
height: dimensions.height + 2 * (shadowPadding + require_components_client_Tooltip_util.ARROW_HEIGHT),
|
|
91
93
|
colorInterpolationFilters: "sRGB",
|
|
92
|
-
children: [
|
|
93
|
-
shadow
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
94
|
+
children: [
|
|
95
|
+
shadows.map((shadow, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [
|
|
96
|
+
shadow.spread !== 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("feMorphology", {
|
|
97
|
+
in: "SourceAlpha",
|
|
98
|
+
operator: shadow.spread > 0 ? "dilate" : "erode",
|
|
99
|
+
radius: Math.abs(shadow.spread),
|
|
100
|
+
result: `spread${i}`
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("feGaussianBlur", {
|
|
103
|
+
in: shadow.spread !== 0 ? `spread${i}` : "SourceAlpha",
|
|
104
|
+
stdDeviation: shadow.blur / 2,
|
|
105
|
+
result: `blurred${i}`
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("feOffset", {
|
|
108
|
+
in: `blurred${i}`,
|
|
109
|
+
dx: shadow.x,
|
|
110
|
+
dy: shadow.y,
|
|
111
|
+
result: `offset${i}`
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("feFlood", {
|
|
114
|
+
floodColor: shadow.color,
|
|
115
|
+
result: `color${i}`
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("feComposite", {
|
|
118
|
+
in: `color${i}`,
|
|
119
|
+
in2: `offset${i}`,
|
|
120
|
+
operator: "in",
|
|
121
|
+
result: `shadow${i}`
|
|
122
|
+
})
|
|
123
|
+
] }, i)),
|
|
124
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("feMerge", {
|
|
125
|
+
result: "mergedShadows",
|
|
126
|
+
children: shadows.map((_, i) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("feMergeNode", { in: `shadow${i}` }, i))
|
|
113
127
|
}),
|
|
114
128
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("feComposite", {
|
|
115
|
-
in:
|
|
116
|
-
in2:
|
|
117
|
-
operator: "
|
|
118
|
-
result: `shadow${i}`
|
|
129
|
+
in: "mergedShadows",
|
|
130
|
+
in2: "SourceAlpha",
|
|
131
|
+
operator: "out"
|
|
119
132
|
})
|
|
120
|
-
]
|
|
133
|
+
]
|
|
121
134
|
}) }),
|
|
122
135
|
shadows.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
123
136
|
d: svgPath,
|
|
@@ -133,8 +146,7 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
133
146
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
|
|
134
147
|
position: "relative",
|
|
135
148
|
flexDirection: "column",
|
|
136
|
-
|
|
137
|
-
className: "z-[3]",
|
|
149
|
+
className: "z-[3] gap-[inherit]",
|
|
138
150
|
style: childTransitionStyle,
|
|
139
151
|
id,
|
|
140
152
|
children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
|
|
@@ -146,6 +158,7 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
146
158
|
className: classNames.icon
|
|
147
159
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
148
160
|
className: classNames.title,
|
|
161
|
+
color: "inherit",
|
|
149
162
|
children: title
|
|
150
163
|
})]
|
|
151
164
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_components_Box.Box, {
|
|
@@ -153,9 +166,11 @@ const TooltipContent = (0, react.forwardRef)(function TooltipContent({ children,
|
|
|
153
166
|
columnGap: "1.5",
|
|
154
167
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
155
168
|
className: classNames.body,
|
|
169
|
+
color: "inherit",
|
|
156
170
|
children
|
|
157
171
|
}), endContent && !(0, react.isValidElement)(endContent) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Text.Text, {
|
|
158
|
-
|
|
172
|
+
className: classNames.endContent,
|
|
173
|
+
color: "inherit",
|
|
159
174
|
children: endContent
|
|
160
175
|
}) : endContent]
|
|
161
176
|
})]
|