@yahoo/uds 3.116.0-beta.3 → 3.116.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/dist/automated-config/dist/generated/autoVariants.cjs +0 -10
- package/dist/automated-config/dist/generated/autoVariants.d.cts +0 -10
- package/dist/automated-config/dist/generated/autoVariants.d.ts +0 -10
- package/dist/automated-config/dist/generated/autoVariants.js +0 -10
- package/dist/automated-config/dist/generated/generatedConfigs.cjs +0 -1842
- package/dist/automated-config/dist/generated/generatedConfigs.d.cts +1 -194
- package/dist/automated-config/dist/generated/generatedConfigs.d.ts +1 -194
- package/dist/automated-config/dist/generated/generatedConfigs.js +1 -1842
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.cjs +0 -78
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.cts +1 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.d.ts +1 -2
- package/dist/automated-config/dist/generated/universalTokensConfigAuto.js +0 -78
- package/dist/cli/commands/sync.cjs +0 -6
- package/dist/cli/commands/sync.js +0 -6
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.cts +1 -1
- package/dist/components/client/Menu/Menu.ItemCheckbox.d.ts +1 -1
- package/dist/components/client/Toast/Toast.cjs +3 -3
- 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 +3 -3
- package/dist/components/client/Toast/index.d.cts +1 -1
- package/dist/components/client/Toast/index.d.ts +1 -1
- package/dist/components/client/Tooltip/Tooltip.cjs +6 -6
- package/dist/components/client/Tooltip/Tooltip.d.cts +1 -1
- package/dist/components/client/Tooltip/Tooltip.d.ts +1 -1
- package/dist/components/client/Tooltip/Tooltip.js +6 -6
- package/dist/components/client/Tooltip/TooltipContent.cjs +96 -33
- package/dist/components/client/Tooltip/TooltipContent.js +97 -34
- package/dist/components/client/Tooltip/tooltipContext.cjs +1 -0
- package/dist/components/client/Tooltip/tooltipContext.d.cts +2 -1
- package/dist/components/client/Tooltip/tooltipContext.d.ts +2 -1
- package/dist/components/client/Tooltip/tooltipContext.js +1 -0
- package/dist/components/client/Tooltip/useTooltipContent.cjs +186 -0
- package/dist/components/client/Tooltip/useTooltipContent.d.cts +66 -0
- package/dist/components/client/Tooltip/useTooltipContent.d.ts +66 -0
- package/dist/{hooks/useSvgFloatingContent.js → components/client/Tooltip/useTooltipContent.js} +44 -94
- package/dist/components/client/Tooltip/util.cjs +248 -0
- package/dist/{utils/svgFloatingContentUtils.d.cts → components/client/Tooltip/util.d.cts} +62 -25
- package/dist/{utils/svgFloatingContentUtils.d.ts → components/client/Tooltip/util.d.ts} +62 -25
- package/dist/components/client/Tooltip/util.js +240 -0
- package/dist/components/client/index.cjs +0 -8
- package/dist/components/client/index.d.cts +5 -10
- package/dist/components/client/index.d.ts +5 -10
- package/dist/components/client/index.js +1 -5
- package/dist/components/client/providers/UDSConfigProvider.cjs +2 -6
- package/dist/components/client/providers/UDSConfigProvider.d.cts +1 -2
- package/dist/components/client/providers/UDSConfigProvider.d.ts +1 -2
- package/dist/components/client/providers/UDSConfigProvider.js +2 -6
- package/dist/components/experimental/client/{ExperimentalPopover.cjs → Popover.cjs} +1 -10
- package/dist/components/experimental/client/Popover.d.cts +29 -0
- package/dist/components/experimental/client/Popover.d.ts +29 -0
- package/dist/components/experimental/client/{ExperimentalPopover.js → Popover.js} +1 -10
- package/dist/components/experimental/client/index.cjs +10 -10
- package/dist/components/experimental/client/index.d.cts +2 -2
- package/dist/components/experimental/client/index.d.ts +2 -2
- package/dist/components/experimental/client/index.js +1 -1
- package/dist/components/experimental/index.cjs +19 -19
- package/dist/components/experimental/index.d.cts +2 -2
- package/dist/components/experimental/index.d.ts +2 -2
- package/dist/components/experimental/index.js +1 -1
- package/dist/components/index.cjs +0 -12
- package/dist/components/index.d.cts +5 -9
- package/dist/components/index.d.ts +5 -9
- package/dist/components/index.js +1 -9
- package/dist/config/dist/index.cjs +1 -79
- package/dist/config/dist/index.js +1 -79
- package/dist/index.cjs +10 -21
- package/dist/index.d.cts +10 -15
- package/dist/index.d.ts +10 -15
- package/dist/index.js +11 -16
- package/dist/runtime/index.cjs +0 -2
- package/dist/runtime/index.d.cts +2 -3
- package/dist/runtime/index.d.ts +2 -3
- package/dist/runtime/index.js +1 -2
- package/dist/runtime/udsConfig.cjs +1 -3
- package/dist/runtime/udsConfig.d.cts +1 -3
- package/dist/runtime/udsConfig.d.ts +1 -3
- package/dist/runtime/udsConfig.js +1 -3
- package/dist/styles/styler.d.cts +20 -30
- package/dist/styles/styler.d.ts +20 -30
- package/dist/styles/variants.d.cts +0 -30
- package/dist/styles/variants.d.ts +0 -30
- package/dist/tailwind/dist/commands/css.helpers.cjs +6 -2
- package/dist/tailwind/dist/commands/css.helpers.js +6 -2
- package/dist/tailwind/dist/commands/generateComponentData.cjs +2 -0
- package/dist/tailwind/dist/commands/generateComponentData.js +3 -1
- package/dist/tailwind/dist/commands/generatePurgeCSSData.cjs +3 -8
- package/dist/tailwind/dist/commands/generatePurgeCSSData.js +3 -8
- package/dist/tailwind/dist/commands/purge.cjs +2 -2
- package/dist/tailwind/dist/commands/purge.js +2 -2
- package/dist/tailwind/dist/css/generate.cjs +6 -4
- package/dist/tailwind/dist/css/generate.helpers.cjs +4 -1
- package/dist/tailwind/dist/css/generate.helpers.js +4 -1
- package/dist/tailwind/dist/css/generate.js +7 -5
- package/dist/tailwind/dist/css/nodeUtils.cjs +30 -2
- package/dist/tailwind/dist/css/nodeUtils.js +30 -3
- package/dist/tailwind/dist/css/runner.cjs +52 -19
- package/dist/tailwind/dist/css/runner.helpers.cjs +2 -2
- package/dist/tailwind/dist/css/runner.helpers.js +2 -2
- package/dist/tailwind/dist/css/runner.js +53 -20
- package/dist/tailwind/dist/css/theme.d.cts +2 -2
- package/dist/tailwind/dist/css/theme.d.ts +2 -2
- package/dist/tailwind/dist/purger/legacy/purgeCSS.cjs +19 -8
- package/dist/tailwind/dist/purger/legacy/purgeCSS.js +19 -8
- package/dist/tailwind/dist/purger/optimized/purge.cjs +2 -1
- package/dist/tailwind/dist/purger/optimized/purge.js +2 -1
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.cjs +22 -2
- package/dist/tailwind/dist/purger/optimized/purgeFromCode.js +22 -2
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.cjs +5 -4
- package/dist/tailwind/dist/purger/optimized/utils/componentAnalyzer.js +5 -4
- package/dist/tailwind/dist/purger/optimized/utils/files.cjs +12 -10
- package/dist/tailwind/dist/purger/optimized/utils/files.js +12 -9
- package/dist/tailwind/dist/tailwind/plugins/components.cjs +0 -1
- package/dist/tailwind/dist/tailwind/plugins/components.js +1 -2
- package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.cjs +294 -10
- package/dist/tailwind/dist/tailwind/plugins/getTailwindAsUdsColors.js +294 -9
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.cts +1 -1
- package/dist/tailwind/dist/tailwind/utils/getFontStyles.d.ts +1 -1
- package/dist/tailwind/dist/utils/entryPoints.cjs +63 -0
- package/dist/tailwind/dist/utils/entryPoints.js +55 -0
- package/dist/tokens/automation/configs/index.cjs +0 -1
- package/dist/tokens/automation/configs/index.d.cts +2 -2
- package/dist/tokens/automation/configs/index.d.ts +2 -2
- package/dist/tokens/automation/configs/index.js +2 -2
- package/dist/tokens/automation/index.cjs +0 -1
- package/dist/tokens/automation/index.d.cts +2 -2
- package/dist/tokens/automation/index.d.ts +2 -2
- package/dist/tokens/automation/index.js +2 -2
- package/dist/tokens/index.cjs +1 -2
- package/dist/tokens/index.d.cts +3 -3
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.js +3 -3
- package/dist/tokens/types.d.cts +2 -2
- package/dist/tokens/types.d.ts +2 -2
- package/dist/types/dist/index.d.cts +1 -51
- package/dist/types/dist/index.d.ts +1 -51
- package/dist/uds/generated/componentData.cjs +868 -1012
- package/dist/uds/generated/componentData.js +899 -1013
- package/dist/uds/generated/tailwindPurge.cjs +222 -249
- package/dist/uds/generated/tailwindPurge.js +222 -249
- package/dist/uds/package.cjs +1 -1
- package/dist/uds/package.js +1 -1
- package/generated/componentData.json +1204 -1352
- package/generated/tailwindPurge.ts +5 -4604
- package/package.json +2 -2
- package/dist/components/SvgFloatingOverlay.cjs +0 -122
- package/dist/components/SvgFloatingOverlay.d.cts +0 -42
- package/dist/components/SvgFloatingOverlay.d.ts +0 -42
- package/dist/components/SvgFloatingOverlay.js +0 -120
- package/dist/components/client/Popover/Popover.cjs +0 -96
- package/dist/components/client/Popover/Popover.d.cts +0 -55
- package/dist/components/client/Popover/Popover.d.ts +0 -55
- package/dist/components/client/Popover/Popover.js +0 -94
- package/dist/components/client/Popover/PopoverContent.cjs +0 -174
- package/dist/components/client/Popover/PopoverContent.d.cts +0 -26
- package/dist/components/client/Popover/PopoverContent.d.ts +0 -26
- package/dist/components/client/Popover/PopoverContent.js +0 -172
- package/dist/components/client/Popover/PopoverContext.cjs +0 -11
- package/dist/components/client/Popover/PopoverContext.d.cts +0 -21
- package/dist/components/client/Popover/PopoverContext.d.ts +0 -21
- package/dist/components/client/Popover/PopoverContext.js +0 -9
- package/dist/components/client/Popover/PopoverTrigger.cjs +0 -26
- package/dist/components/client/Popover/PopoverTrigger.d.cts +0 -14
- package/dist/components/client/Popover/PopoverTrigger.d.ts +0 -14
- package/dist/components/client/Popover/PopoverTrigger.js +0 -24
- package/dist/components/client/Popover/UDSPopoverConfigProvider.cjs +0 -40
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.cts +0 -28
- package/dist/components/client/Popover/UDSPopoverConfigProvider.d.ts +0 -28
- package/dist/components/client/Popover/UDSPopoverConfigProvider.js +0 -37
- package/dist/components/client/Popover/index.cjs +0 -12
- package/dist/components/client/Popover/index.d.cts +0 -7
- package/dist/components/client/Popover/index.d.ts +0 -7
- package/dist/components/client/Popover/index.js +0 -8
- package/dist/components/experimental/client/ExperimentalPopover.d.cts +0 -40
- package/dist/components/experimental/client/ExperimentalPopover.d.ts +0 -40
- package/dist/hooks/useSvgFloatingContent.cjs +0 -236
- package/dist/hooks/useSvgFloatingContent.d.cts +0 -74
- package/dist/hooks/useSvgFloatingContent.d.ts +0 -74
- package/dist/runtime/popoverConfig.cjs +0 -41
- package/dist/runtime/popoverConfig.d.cts +0 -24
- package/dist/runtime/popoverConfig.d.ts +0 -24
- package/dist/runtime/popoverConfig.js +0 -40
- package/dist/tailwind/dist/.prettierrc.cjs +0 -13
- package/dist/tailwind/dist/.prettierrc.js +0 -12
- package/dist/utils/parseShadow.cjs +0 -120
- package/dist/utils/parseShadow.d.cts +0 -33
- package/dist/utils/parseShadow.d.ts +0 -33
- package/dist/utils/parseShadow.js +0 -118
- package/dist/utils/svgFloatingContentUtils.cjs +0 -121
- package/dist/utils/svgFloatingContentUtils.js +0 -117
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
-
const require_index = require('../../../fixtures/dist/index.cjs');
|
|
6
|
-
const require_styles_styler = require('../../../styles/styler.cjs');
|
|
7
|
-
const require_components_Box = require('../../Box.cjs');
|
|
8
|
-
const require_components_IconSlot = require('../../IconSlot.cjs');
|
|
9
|
-
const require_components_client_Pressable = require('../Pressable.cjs');
|
|
10
|
-
const require_components_client_Popover_PopoverContext = require('./PopoverContext.cjs');
|
|
11
|
-
const require_components_client_Popover_UDSPopoverConfigProvider = require('./UDSPopoverConfigProvider.cjs');
|
|
12
|
-
const require_hooks_useForkRef = require('../../../hooks/useForkRef.cjs');
|
|
13
|
-
const require_hooks_useSvgFloatingContent = require('../../../hooks/useSvgFloatingContent.cjs');
|
|
14
|
-
const require_components_SvgFloatingOverlay = require('../../SvgFloatingOverlay.cjs');
|
|
15
|
-
let react = require("react");
|
|
16
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
17
|
-
let _yahoo_uds_icons = require("@yahoo/uds-icons");
|
|
18
|
-
let _ariakit_react = require("@ariakit/react");
|
|
19
|
-
|
|
20
|
-
//#region src/components/client/Popover/PopoverContent.tsx
|
|
21
|
-
const ARROW_HEIGHT = 12;
|
|
22
|
-
const ARROW_WIDTH = 22;
|
|
23
|
-
const ARROW_TIP_RADIUS_FRACTION = .3;
|
|
24
|
-
const PopoverContent = (0, react.forwardRef)(function PopoverContent({ children, className, closeIcon = _yahoo_uds_icons.Cross, slotProps, maxWidth, maxHeight }, ref) {
|
|
25
|
-
const store = (0, _ariakit_react.usePopoverContext)();
|
|
26
|
-
const open = (0, _ariakit_react.useStoreState)(store, "open");
|
|
27
|
-
const internalContext = (0, react.useContext)(require_components_client_Popover_PopoverContext.PopoverInternalContext);
|
|
28
|
-
const disableVerticalSpacing = internalContext?.disableVerticalSpacing ?? false;
|
|
29
|
-
const disableHorizontalSpacing = internalContext?.disableHorizontalSpacing ?? false;
|
|
30
|
-
const sameWidth = internalContext?.sameWidth ?? false;
|
|
31
|
-
const gutter = internalContext?.gutter ?? 4;
|
|
32
|
-
const currentPlacement = (0, _ariakit_react.useStoreState)(store, "currentPlacement");
|
|
33
|
-
const placement = (0, _ariakit_react.useStoreState)(store, "placement");
|
|
34
|
-
const effectivePlacement = currentPlacement ?? placement ?? "top";
|
|
35
|
-
const { borderRadius, gap, spacingHorizontal, spacingVertical, dismissButtonSize } = require_components_client_Popover_UDSPopoverConfigProvider.usePopoverConfig();
|
|
36
|
-
const defaultBorderRadius = borderRadius["default"];
|
|
37
|
-
const defaultGap = gap["default"];
|
|
38
|
-
const defaultSpacingHorizontal = spacingHorizontal["default"];
|
|
39
|
-
const defaultSpacingVertical = spacingVertical["default"];
|
|
40
|
-
const defaultDismissButtonSize = dismissButtonSize["default"];
|
|
41
|
-
const arrowRef = (0, react.useRef)(null);
|
|
42
|
-
const reducedMotion = internalContext ? internalContext.reducedMotion : false;
|
|
43
|
-
const animationDuration = reducedMotion || !internalContext ? 0 : internalContext.animationDuration;
|
|
44
|
-
const { internalRef, shift, onPositionUpdate, ...svgFloatingContentProps } = require_hooks_useSvgFloatingContent.useSvgFloatingContent({
|
|
45
|
-
open: open ?? false,
|
|
46
|
-
effectivePlacement,
|
|
47
|
-
borderRadius: defaultBorderRadius,
|
|
48
|
-
arrowRef,
|
|
49
|
-
animationDuration,
|
|
50
|
-
hideArrow: internalContext?.hideArrow,
|
|
51
|
-
arrowWidth: ARROW_WIDTH,
|
|
52
|
-
arrowHeight: ARROW_HEIGHT,
|
|
53
|
-
arrowTipRadiusFraction: ARROW_TIP_RADIUS_FRACTION
|
|
54
|
-
});
|
|
55
|
-
const mergedRef = require_hooks_useForkRef.useForkRef(ref, internalRef);
|
|
56
|
-
const { className: closeIconClassName, ...closeIconProps } = slotProps?.closeIcon ?? {};
|
|
57
|
-
const { className: closeIconContainerClassName, ...closeIconContainerProps } = slotProps?.closeIconContainer ?? {};
|
|
58
|
-
const classNames = {
|
|
59
|
-
root: require_styles_styler.getStyles({
|
|
60
|
-
popoverSizeRoot: "default",
|
|
61
|
-
popoverVariantRoot: "default",
|
|
62
|
-
display: "flex",
|
|
63
|
-
position: "relative",
|
|
64
|
-
className: require_styles_styler.cx("z-[9999]", "outline-none", "focus-visible:outline-none", className)
|
|
65
|
-
}),
|
|
66
|
-
contentWrapper: require_styles_styler.getStyles({
|
|
67
|
-
display: "block",
|
|
68
|
-
spacingTop: disableVerticalSpacing ? "0" : defaultSpacingVertical,
|
|
69
|
-
spacingStart: disableHorizontalSpacing ? "0" : defaultSpacingHorizontal,
|
|
70
|
-
spacingBottom: disableVerticalSpacing ? "0" : defaultSpacingVertical,
|
|
71
|
-
spacingEnd: internalContext?.hideDismissButton ? disableHorizontalSpacing ? "0" : defaultSpacingHorizontal : void 0
|
|
72
|
-
}),
|
|
73
|
-
svgBase: require_styles_styler.getStyles({
|
|
74
|
-
popoverSizeSvgBase: "default",
|
|
75
|
-
popoverVariantSvgBase: "default",
|
|
76
|
-
className: require_styles_styler.cx("uds-bgBlurFillFallback")
|
|
77
|
-
}),
|
|
78
|
-
svgBorder: require_styles_styler.getStyles({
|
|
79
|
-
popoverSizeSvgBorder: "default",
|
|
80
|
-
popoverVariantSvgBorder: "default"
|
|
81
|
-
}),
|
|
82
|
-
blur: require_styles_styler.getStyles({
|
|
83
|
-
popoverVariantBlur: "default",
|
|
84
|
-
position: "absolute",
|
|
85
|
-
width: "full",
|
|
86
|
-
height: "full",
|
|
87
|
-
className: require_styles_styler.cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]")
|
|
88
|
-
}),
|
|
89
|
-
closeIconContainer: require_styles_styler.getStyles({
|
|
90
|
-
flexShrink: "0",
|
|
91
|
-
borderRadius: "full",
|
|
92
|
-
alignItems: "center",
|
|
93
|
-
justifyContent: "center",
|
|
94
|
-
display: "flex",
|
|
95
|
-
className: require_styles_styler.cx(reducedMotion ? "duration-0" : "duration-120", "transition-[background-color]", "bg-carbon-15/0", "hover:bg-carbon-15/10", "active:bg-carbon-15/15")
|
|
96
|
-
}),
|
|
97
|
-
closeIcon: require_styles_styler.getStyles({
|
|
98
|
-
popoverVariantCloseIcon: "default",
|
|
99
|
-
popoverSizeCloseIcon: "default"
|
|
100
|
-
})
|
|
101
|
-
};
|
|
102
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_ariakit_react.Popover, {
|
|
103
|
-
hideOnInteractOutside: (event) => {
|
|
104
|
-
if (internalContext && !internalContext.isControlled) return true;
|
|
105
|
-
internalContext?.onClose?.(event);
|
|
106
|
-
return false;
|
|
107
|
-
},
|
|
108
|
-
ref: mergedRef,
|
|
109
|
-
className: classNames.root,
|
|
110
|
-
portal: internalContext ? internalContext.portal : true,
|
|
111
|
-
gutter: internalContext?.hideArrow ? gutter : ARROW_HEIGHT + gutter,
|
|
112
|
-
updatePosition: onPositionUpdate,
|
|
113
|
-
style: {
|
|
114
|
-
...shift.x !== 0 || shift.y !== 0 ? { transform: `translate(${shift.x}px, ${shift.y}px)` } : {},
|
|
115
|
-
maxWidth,
|
|
116
|
-
maxHeight
|
|
117
|
-
},
|
|
118
|
-
onClose: internalContext?.onClose,
|
|
119
|
-
sameWidth,
|
|
120
|
-
autoFocusOnShow: internalContext?.disableAutoFocus ? false : (element) => {
|
|
121
|
-
element?.focus({ preventScroll: true });
|
|
122
|
-
return false;
|
|
123
|
-
},
|
|
124
|
-
autoFocusOnHide: !internalContext?.disableAutoFocus,
|
|
125
|
-
children: [
|
|
126
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_SvgFloatingOverlay.SvgFloatingOverlay, {
|
|
127
|
-
blurClassName: classNames.blur,
|
|
128
|
-
svgClassNames: {
|
|
129
|
-
base: classNames.svgBase,
|
|
130
|
-
border: classNames.svgBorder
|
|
131
|
-
},
|
|
132
|
-
arrowHeight: ARROW_HEIGHT,
|
|
133
|
-
contentWrapperSlotProps: { alignItems: "flex-start" },
|
|
134
|
-
borderRadius: defaultBorderRadius,
|
|
135
|
-
svgBaseStyle: slotProps?.svgBase?.style,
|
|
136
|
-
svgBorderStyle: slotProps?.svgBorder?.style,
|
|
137
|
-
...svgFloatingContentProps,
|
|
138
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_Box.Box, {
|
|
139
|
-
className: require_styles_styler.cx(classNames.contentWrapper),
|
|
140
|
-
style: { paddingInlineEnd: internalContext?.hideDismissButton || disableHorizontalSpacing ? void 0 : require_index.spacingMap[defaultGap] + require_index.spacingMap[defaultSpacingHorizontal] + defaultDismissButtonSize },
|
|
141
|
-
children
|
|
142
|
-
})
|
|
143
|
-
}),
|
|
144
|
-
!internalContext?.hideDismissButton && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverDismiss, { render: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_client_Pressable.Pressable, {
|
|
145
|
-
className: require_styles_styler.cx(classNames.closeIconContainer, "absolute", "z-[4]", closeIconContainerClassName),
|
|
146
|
-
...closeIconContainerProps,
|
|
147
|
-
style: {
|
|
148
|
-
...closeIconContainerProps?.style,
|
|
149
|
-
top: require_index.spacingMap[defaultSpacingVertical],
|
|
150
|
-
insetInlineEnd: require_index.spacingMap[defaultSpacingHorizontal],
|
|
151
|
-
width: defaultDismissButtonSize,
|
|
152
|
-
height: defaultDismissButtonSize,
|
|
153
|
-
...svgFloatingContentProps.childTransitionStyle
|
|
154
|
-
},
|
|
155
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_IconSlot.IconSlot, {
|
|
156
|
-
icon: closeIcon,
|
|
157
|
-
iconProps: {
|
|
158
|
-
className: require_styles_styler.cx(classNames.closeIcon, closeIconClassName),
|
|
159
|
-
...closeIconProps
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
}) }),
|
|
163
|
-
!internalContext?.hideArrow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverArrow, {
|
|
164
|
-
size: 1,
|
|
165
|
-
ref: arrowRef,
|
|
166
|
-
style: { opacity: 0 }
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
});
|
|
170
|
-
});
|
|
171
|
-
PopoverContent.displayName = "PopoverContent";
|
|
172
|
-
|
|
173
|
-
//#endregion
|
|
174
|
-
exports.PopoverContent = PopoverContent;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconPropsWithSVGProps, UniversalPopoverContentProps } from "../../../types/dist/index.cjs";
|
|
3
|
-
import { PressableProps } from "../Pressable.cjs";
|
|
4
|
-
import "../../../index.cjs";
|
|
5
|
-
import * as react from "react";
|
|
6
|
-
import { CSSProperties } from "react";
|
|
7
|
-
|
|
8
|
-
//#region src/components/client/Popover/PopoverContent.d.ts
|
|
9
|
-
type DataAttributes = {
|
|
10
|
-
[name: `data-${string}`]: string;
|
|
11
|
-
};
|
|
12
|
-
interface PopoverContentProps extends UniversalPopoverContentProps {
|
|
13
|
-
slotProps?: {
|
|
14
|
-
closeIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
15
|
-
closeIconContainer?: Partial<PressableProps & DataAttributes>;
|
|
16
|
-
svgBase?: {
|
|
17
|
-
style?: CSSProperties & Record<`--${string}`, string | undefined>;
|
|
18
|
-
};
|
|
19
|
-
svgBorder?: {
|
|
20
|
-
style?: CSSProperties & Record<`--${string}`, string | undefined>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
declare const PopoverContent: react.ForwardRefExoticComponent<PopoverContentProps & react.RefAttributes<HTMLInputElement>>;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { PopoverContent };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconPropsWithSVGProps, UniversalPopoverContentProps } from "../../../types/dist/index.js";
|
|
3
|
-
import { PressableProps } from "../Pressable.js";
|
|
4
|
-
import "../../../index.js";
|
|
5
|
-
import * as react from "react";
|
|
6
|
-
import { CSSProperties } from "react";
|
|
7
|
-
|
|
8
|
-
//#region src/components/client/Popover/PopoverContent.d.ts
|
|
9
|
-
type DataAttributes = {
|
|
10
|
-
[name: `data-${string}`]: string;
|
|
11
|
-
};
|
|
12
|
-
interface PopoverContentProps extends UniversalPopoverContentProps {
|
|
13
|
-
slotProps?: {
|
|
14
|
-
closeIcon?: Partial<IconPropsWithSVGProps & DataAttributes>;
|
|
15
|
-
closeIconContainer?: Partial<PressableProps & DataAttributes>;
|
|
16
|
-
svgBase?: {
|
|
17
|
-
style?: CSSProperties & Record<`--${string}`, string | undefined>;
|
|
18
|
-
};
|
|
19
|
-
svgBorder?: {
|
|
20
|
-
style?: CSSProperties & Record<`--${string}`, string | undefined>;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
declare const PopoverContent: react.ForwardRefExoticComponent<PopoverContentProps & react.RefAttributes<HTMLInputElement>>;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { PopoverContent };
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
3
|
-
import { spacingMap } from "../../../fixtures/dist/index.js";
|
|
4
|
-
import { cx, getStyles } from "../../../styles/styler.js";
|
|
5
|
-
import { Box } from "../../Box.js";
|
|
6
|
-
import { IconSlot } from "../../IconSlot.js";
|
|
7
|
-
import { Pressable } from "../Pressable.js";
|
|
8
|
-
import { PopoverInternalContext } from "./PopoverContext.js";
|
|
9
|
-
import { usePopoverConfig } from "./UDSPopoverConfigProvider.js";
|
|
10
|
-
import { useForkRef } from "../../../hooks/useForkRef.js";
|
|
11
|
-
import { useSvgFloatingContent } from "../../../hooks/useSvgFloatingContent.js";
|
|
12
|
-
import { SvgFloatingOverlay } from "../../SvgFloatingOverlay.js";
|
|
13
|
-
import { forwardRef, useContext, useRef } from "react";
|
|
14
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
-
import { Cross } from "@yahoo/uds-icons";
|
|
16
|
-
import { Popover, PopoverArrow, PopoverDismiss, usePopoverContext, useStoreState } from "@ariakit/react";
|
|
17
|
-
|
|
18
|
-
//#region src/components/client/Popover/PopoverContent.tsx
|
|
19
|
-
const ARROW_HEIGHT = 12;
|
|
20
|
-
const ARROW_WIDTH = 22;
|
|
21
|
-
const ARROW_TIP_RADIUS_FRACTION = .3;
|
|
22
|
-
const PopoverContent = forwardRef(function PopoverContent({ children, className, closeIcon = Cross, slotProps, maxWidth, maxHeight }, ref) {
|
|
23
|
-
const store = usePopoverContext();
|
|
24
|
-
const open = useStoreState(store, "open");
|
|
25
|
-
const internalContext = useContext(PopoverInternalContext);
|
|
26
|
-
const disableVerticalSpacing = internalContext?.disableVerticalSpacing ?? false;
|
|
27
|
-
const disableHorizontalSpacing = internalContext?.disableHorizontalSpacing ?? false;
|
|
28
|
-
const sameWidth = internalContext?.sameWidth ?? false;
|
|
29
|
-
const gutter = internalContext?.gutter ?? 4;
|
|
30
|
-
const currentPlacement = useStoreState(store, "currentPlacement");
|
|
31
|
-
const placement = useStoreState(store, "placement");
|
|
32
|
-
const effectivePlacement = currentPlacement ?? placement ?? "top";
|
|
33
|
-
const { borderRadius, gap, spacingHorizontal, spacingVertical, dismissButtonSize } = usePopoverConfig();
|
|
34
|
-
const defaultBorderRadius = borderRadius["default"];
|
|
35
|
-
const defaultGap = gap["default"];
|
|
36
|
-
const defaultSpacingHorizontal = spacingHorizontal["default"];
|
|
37
|
-
const defaultSpacingVertical = spacingVertical["default"];
|
|
38
|
-
const defaultDismissButtonSize = dismissButtonSize["default"];
|
|
39
|
-
const arrowRef = useRef(null);
|
|
40
|
-
const reducedMotion = internalContext ? internalContext.reducedMotion : false;
|
|
41
|
-
const animationDuration = reducedMotion || !internalContext ? 0 : internalContext.animationDuration;
|
|
42
|
-
const { internalRef, shift, onPositionUpdate, ...svgFloatingContentProps } = useSvgFloatingContent({
|
|
43
|
-
open: open ?? false,
|
|
44
|
-
effectivePlacement,
|
|
45
|
-
borderRadius: defaultBorderRadius,
|
|
46
|
-
arrowRef,
|
|
47
|
-
animationDuration,
|
|
48
|
-
hideArrow: internalContext?.hideArrow,
|
|
49
|
-
arrowWidth: ARROW_WIDTH,
|
|
50
|
-
arrowHeight: ARROW_HEIGHT,
|
|
51
|
-
arrowTipRadiusFraction: ARROW_TIP_RADIUS_FRACTION
|
|
52
|
-
});
|
|
53
|
-
const mergedRef = useForkRef(ref, internalRef);
|
|
54
|
-
const { className: closeIconClassName, ...closeIconProps } = slotProps?.closeIcon ?? {};
|
|
55
|
-
const { className: closeIconContainerClassName, ...closeIconContainerProps } = slotProps?.closeIconContainer ?? {};
|
|
56
|
-
const classNames = {
|
|
57
|
-
root: getStyles({
|
|
58
|
-
popoverSizeRoot: "default",
|
|
59
|
-
popoverVariantRoot: "default",
|
|
60
|
-
display: "flex",
|
|
61
|
-
position: "relative",
|
|
62
|
-
className: cx("z-[9999]", "outline-none", "focus-visible:outline-none", className)
|
|
63
|
-
}),
|
|
64
|
-
contentWrapper: getStyles({
|
|
65
|
-
display: "block",
|
|
66
|
-
spacingTop: disableVerticalSpacing ? "0" : defaultSpacingVertical,
|
|
67
|
-
spacingStart: disableHorizontalSpacing ? "0" : defaultSpacingHorizontal,
|
|
68
|
-
spacingBottom: disableVerticalSpacing ? "0" : defaultSpacingVertical,
|
|
69
|
-
spacingEnd: internalContext?.hideDismissButton ? disableHorizontalSpacing ? "0" : defaultSpacingHorizontal : void 0
|
|
70
|
-
}),
|
|
71
|
-
svgBase: getStyles({
|
|
72
|
-
popoverSizeSvgBase: "default",
|
|
73
|
-
popoverVariantSvgBase: "default",
|
|
74
|
-
className: cx("uds-bgBlurFillFallback")
|
|
75
|
-
}),
|
|
76
|
-
svgBorder: getStyles({
|
|
77
|
-
popoverSizeSvgBorder: "default",
|
|
78
|
-
popoverVariantSvgBorder: "default"
|
|
79
|
-
}),
|
|
80
|
-
blur: getStyles({
|
|
81
|
-
popoverVariantBlur: "default",
|
|
82
|
-
position: "absolute",
|
|
83
|
-
width: "full",
|
|
84
|
-
height: "full",
|
|
85
|
-
className: cx("uds-bgBlurFallback", "top-0", "left-0", "z-[1]")
|
|
86
|
-
}),
|
|
87
|
-
closeIconContainer: getStyles({
|
|
88
|
-
flexShrink: "0",
|
|
89
|
-
borderRadius: "full",
|
|
90
|
-
alignItems: "center",
|
|
91
|
-
justifyContent: "center",
|
|
92
|
-
display: "flex",
|
|
93
|
-
className: cx(reducedMotion ? "duration-0" : "duration-120", "transition-[background-color]", "bg-carbon-15/0", "hover:bg-carbon-15/10", "active:bg-carbon-15/15")
|
|
94
|
-
}),
|
|
95
|
-
closeIcon: getStyles({
|
|
96
|
-
popoverVariantCloseIcon: "default",
|
|
97
|
-
popoverSizeCloseIcon: "default"
|
|
98
|
-
})
|
|
99
|
-
};
|
|
100
|
-
return /* @__PURE__ */ jsxs(Popover, {
|
|
101
|
-
hideOnInteractOutside: (event) => {
|
|
102
|
-
if (internalContext && !internalContext.isControlled) return true;
|
|
103
|
-
internalContext?.onClose?.(event);
|
|
104
|
-
return false;
|
|
105
|
-
},
|
|
106
|
-
ref: mergedRef,
|
|
107
|
-
className: classNames.root,
|
|
108
|
-
portal: internalContext ? internalContext.portal : true,
|
|
109
|
-
gutter: internalContext?.hideArrow ? gutter : ARROW_HEIGHT + gutter,
|
|
110
|
-
updatePosition: onPositionUpdate,
|
|
111
|
-
style: {
|
|
112
|
-
...shift.x !== 0 || shift.y !== 0 ? { transform: `translate(${shift.x}px, ${shift.y}px)` } : {},
|
|
113
|
-
maxWidth,
|
|
114
|
-
maxHeight
|
|
115
|
-
},
|
|
116
|
-
onClose: internalContext?.onClose,
|
|
117
|
-
sameWidth,
|
|
118
|
-
autoFocusOnShow: internalContext?.disableAutoFocus ? false : (element) => {
|
|
119
|
-
element?.focus({ preventScroll: true });
|
|
120
|
-
return false;
|
|
121
|
-
},
|
|
122
|
-
autoFocusOnHide: !internalContext?.disableAutoFocus,
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */ jsx(SvgFloatingOverlay, {
|
|
125
|
-
blurClassName: classNames.blur,
|
|
126
|
-
svgClassNames: {
|
|
127
|
-
base: classNames.svgBase,
|
|
128
|
-
border: classNames.svgBorder
|
|
129
|
-
},
|
|
130
|
-
arrowHeight: ARROW_HEIGHT,
|
|
131
|
-
contentWrapperSlotProps: { alignItems: "flex-start" },
|
|
132
|
-
borderRadius: defaultBorderRadius,
|
|
133
|
-
svgBaseStyle: slotProps?.svgBase?.style,
|
|
134
|
-
svgBorderStyle: slotProps?.svgBorder?.style,
|
|
135
|
-
...svgFloatingContentProps,
|
|
136
|
-
children: /* @__PURE__ */ jsx(Box, {
|
|
137
|
-
className: cx(classNames.contentWrapper),
|
|
138
|
-
style: { paddingInlineEnd: internalContext?.hideDismissButton || disableHorizontalSpacing ? void 0 : spacingMap[defaultGap] + spacingMap[defaultSpacingHorizontal] + defaultDismissButtonSize },
|
|
139
|
-
children
|
|
140
|
-
})
|
|
141
|
-
}),
|
|
142
|
-
!internalContext?.hideDismissButton && /* @__PURE__ */ jsx(PopoverDismiss, { render: /* @__PURE__ */ jsx(Pressable, {
|
|
143
|
-
className: cx(classNames.closeIconContainer, "absolute", "z-[4]", closeIconContainerClassName),
|
|
144
|
-
...closeIconContainerProps,
|
|
145
|
-
style: {
|
|
146
|
-
...closeIconContainerProps?.style,
|
|
147
|
-
top: spacingMap[defaultSpacingVertical],
|
|
148
|
-
insetInlineEnd: spacingMap[defaultSpacingHorizontal],
|
|
149
|
-
width: defaultDismissButtonSize,
|
|
150
|
-
height: defaultDismissButtonSize,
|
|
151
|
-
...svgFloatingContentProps.childTransitionStyle
|
|
152
|
-
},
|
|
153
|
-
children: /* @__PURE__ */ jsx(IconSlot, {
|
|
154
|
-
icon: closeIcon,
|
|
155
|
-
iconProps: {
|
|
156
|
-
className: cx(classNames.closeIcon, closeIconClassName),
|
|
157
|
-
...closeIconProps
|
|
158
|
-
}
|
|
159
|
-
})
|
|
160
|
-
}) }),
|
|
161
|
-
!internalContext?.hideArrow && /* @__PURE__ */ jsx(PopoverArrow, {
|
|
162
|
-
size: 1,
|
|
163
|
-
ref: arrowRef,
|
|
164
|
-
style: { opacity: 0 }
|
|
165
|
-
})
|
|
166
|
-
]
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
PopoverContent.displayName = "PopoverContent";
|
|
170
|
-
|
|
171
|
-
//#endregion
|
|
172
|
-
export { PopoverContent };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
-
let react = require("react");
|
|
6
|
-
|
|
7
|
-
//#region src/components/client/Popover/PopoverContext.tsx
|
|
8
|
-
const PopoverInternalContext = (0, react.createContext)(null);
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
exports.PopoverInternalContext = PopoverInternalContext;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as react from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/client/Popover/PopoverContext.d.ts
|
|
5
|
-
interface PopoverInternalContextType {
|
|
6
|
-
portal: boolean;
|
|
7
|
-
hideArrow: boolean;
|
|
8
|
-
hideDismissButton: boolean;
|
|
9
|
-
onClose?: (event: Event) => void;
|
|
10
|
-
isControlled: boolean;
|
|
11
|
-
animationDuration: number;
|
|
12
|
-
reducedMotion: boolean;
|
|
13
|
-
disableAutoFocus: boolean;
|
|
14
|
-
disableVerticalSpacing: boolean;
|
|
15
|
-
disableHorizontalSpacing: boolean;
|
|
16
|
-
sameWidth: boolean;
|
|
17
|
-
gutter: number;
|
|
18
|
-
}
|
|
19
|
-
declare const PopoverInternalContext: react.Context<PopoverInternalContextType | null>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { PopoverInternalContext };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import * as react from "react";
|
|
3
|
-
|
|
4
|
-
//#region src/components/client/Popover/PopoverContext.d.ts
|
|
5
|
-
interface PopoverInternalContextType {
|
|
6
|
-
portal: boolean;
|
|
7
|
-
hideArrow: boolean;
|
|
8
|
-
hideDismissButton: boolean;
|
|
9
|
-
onClose?: (event: Event) => void;
|
|
10
|
-
isControlled: boolean;
|
|
11
|
-
animationDuration: number;
|
|
12
|
-
reducedMotion: boolean;
|
|
13
|
-
disableAutoFocus: boolean;
|
|
14
|
-
disableVerticalSpacing: boolean;
|
|
15
|
-
disableHorizontalSpacing: boolean;
|
|
16
|
-
sameWidth: boolean;
|
|
17
|
-
gutter: number;
|
|
18
|
-
}
|
|
19
|
-
declare const PopoverInternalContext: react.Context<PopoverInternalContextType | null>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { PopoverInternalContext };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
3
|
-
import { createContext } from "react";
|
|
4
|
-
|
|
5
|
-
//#region src/components/client/Popover/PopoverContext.tsx
|
|
6
|
-
const PopoverInternalContext = createContext(null);
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { PopoverInternalContext };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
-
const require_components_client_Popover_PopoverContext = require('./PopoverContext.cjs');
|
|
6
|
-
let react = require("react");
|
|
7
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
-
let _ariakit_react = require("@ariakit/react");
|
|
9
|
-
|
|
10
|
-
//#region src/components/client/Popover/PopoverTrigger.tsx
|
|
11
|
-
function PopoverTrigger({ children }) {
|
|
12
|
-
const toggleOnClick = !(0, react.useContext)(require_components_client_Popover_PopoverContext.PopoverInternalContext)?.isControlled;
|
|
13
|
-
if ((0, react.isValidElement)(children) && children.type !== react.Fragment) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverDisclosure, {
|
|
14
|
-
render: children,
|
|
15
|
-
toggleOnClick
|
|
16
|
-
});
|
|
17
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ariakit_react.PopoverDisclosure, {
|
|
18
|
-
className: "inline",
|
|
19
|
-
toggleOnClick,
|
|
20
|
-
children
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
PopoverTrigger.displayName = "PopoverTrigger";
|
|
24
|
-
|
|
25
|
-
//#endregion
|
|
26
|
-
exports.PopoverTrigger = PopoverTrigger;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { UniversalPopoverTriggerProps } from "../../../types/dist/index.cjs";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/components/client/Popover/PopoverTrigger.d.ts
|
|
6
|
-
type PopoverTriggerProps = UniversalPopoverTriggerProps;
|
|
7
|
-
declare function PopoverTrigger({
|
|
8
|
-
children
|
|
9
|
-
}: PopoverTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
-
declare namespace PopoverTrigger {
|
|
11
|
-
var displayName: string;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { PopoverTrigger };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { UniversalPopoverTriggerProps } from "../../../types/dist/index.js";
|
|
3
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
//#region src/components/client/Popover/PopoverTrigger.d.ts
|
|
6
|
-
type PopoverTriggerProps = UniversalPopoverTriggerProps;
|
|
7
|
-
declare function PopoverTrigger({
|
|
8
|
-
children
|
|
9
|
-
}: PopoverTriggerProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
-
declare namespace PopoverTrigger {
|
|
11
|
-
var displayName: string;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { PopoverTrigger };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
3
|
-
import { PopoverInternalContext } from "./PopoverContext.js";
|
|
4
|
-
import { Fragment, isValidElement, useContext } from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
6
|
-
import { PopoverDisclosure } from "@ariakit/react";
|
|
7
|
-
|
|
8
|
-
//#region src/components/client/Popover/PopoverTrigger.tsx
|
|
9
|
-
function PopoverTrigger({ children }) {
|
|
10
|
-
const toggleOnClick = !useContext(PopoverInternalContext)?.isControlled;
|
|
11
|
-
if (isValidElement(children) && children.type !== Fragment) return /* @__PURE__ */ jsx(PopoverDisclosure, {
|
|
12
|
-
render: children,
|
|
13
|
-
toggleOnClick
|
|
14
|
-
});
|
|
15
|
-
return /* @__PURE__ */ jsx(PopoverDisclosure, {
|
|
16
|
-
className: "inline",
|
|
17
|
-
toggleOnClick,
|
|
18
|
-
children
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
PopoverTrigger.displayName = "PopoverTrigger";
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
export { PopoverTrigger };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
|
|
3
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
|
|
5
|
-
let react = require("react");
|
|
6
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
-
|
|
8
|
-
//#region src/components/client/Popover/UDSPopoverConfigProvider.tsx
|
|
9
|
-
const PopoverContext = (0, react.createContext)(void 0);
|
|
10
|
-
const UDSPopoverConfigProvider = ({ children, value }) => {
|
|
11
|
-
const existingContext = (0, react.useContext)(PopoverContext);
|
|
12
|
-
if ("type" in value) {
|
|
13
|
-
if (!existingContext) throw new Error("Cannot merge context values without an existing PopoverContext");
|
|
14
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverContext.Provider, {
|
|
15
|
-
value: {
|
|
16
|
-
...existingContext,
|
|
17
|
-
...value.value
|
|
18
|
-
},
|
|
19
|
-
children
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PopoverContext.Provider, {
|
|
23
|
-
value,
|
|
24
|
-
children
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
UDSPopoverConfigProvider.displayName = "UDSPopoverConfigProvider";
|
|
28
|
-
function usePopoverConfig(options) {
|
|
29
|
-
const context = (0, react.useContext)(PopoverContext);
|
|
30
|
-
if (!context) throw new Error("usePopoverConfig must be used within a UDSConfigProvider or UDSPopoverConfigProvider");
|
|
31
|
-
const { placementMap, placement, ...contextRest } = context;
|
|
32
|
-
return {
|
|
33
|
-
...contextRest,
|
|
34
|
-
ariaKitPlacement: placementMap[options?.placement ?? placement]
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
exports.UDSPopoverConfigProvider = UDSPopoverConfigProvider;
|
|
40
|
-
exports.usePopoverConfig = usePopoverConfig;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { PopoverPlacement } from "../../../types/dist/index.cjs";
|
|
3
|
-
import { UDSPopoverConfigContextType } from "../../../runtime/popoverConfig.cjs";
|
|
4
|
-
import { PropsWithChildren } from "react";
|
|
5
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
-
import { PopoverProviderProps } from "@ariakit/react";
|
|
7
|
-
|
|
8
|
-
//#region src/components/client/Popover/UDSPopoverConfigProvider.d.ts
|
|
9
|
-
interface UDSPopoverConfigProviderProps extends PropsWithChildren {
|
|
10
|
-
value: UDSPopoverConfigContextType | {
|
|
11
|
-
type: 'merge';
|
|
12
|
-
value: Partial<UDSPopoverConfigContextType>;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
declare const UDSPopoverConfigProvider: {
|
|
16
|
-
({
|
|
17
|
-
children,
|
|
18
|
-
value
|
|
19
|
-
}: UDSPopoverConfigProviderProps): react_jsx_runtime0.JSX.Element;
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
22
|
-
declare function usePopoverConfig(options?: {
|
|
23
|
-
placement?: PopoverPlacement;
|
|
24
|
-
}): Omit<UDSPopoverConfigContextType, 'placementMap' | 'placement'> & {
|
|
25
|
-
ariaKitPlacement: PopoverProviderProps['placement'];
|
|
26
|
-
};
|
|
27
|
-
//#endregion
|
|
28
|
-
export { type UDSPopoverConfigContextType, UDSPopoverConfigProvider, type UDSPopoverConfigProviderProps, usePopoverConfig };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { PopoverPlacement } from "../../../types/dist/index.js";
|
|
3
|
-
import { UDSPopoverConfigContextType } from "../../../runtime/popoverConfig.js";
|
|
4
|
-
import { PropsWithChildren } from "react";
|
|
5
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
|
-
import { PopoverProviderProps } from "@ariakit/react";
|
|
7
|
-
|
|
8
|
-
//#region src/components/client/Popover/UDSPopoverConfigProvider.d.ts
|
|
9
|
-
interface UDSPopoverConfigProviderProps extends PropsWithChildren {
|
|
10
|
-
value: UDSPopoverConfigContextType | {
|
|
11
|
-
type: 'merge';
|
|
12
|
-
value: Partial<UDSPopoverConfigContextType>;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
declare const UDSPopoverConfigProvider: {
|
|
16
|
-
({
|
|
17
|
-
children,
|
|
18
|
-
value
|
|
19
|
-
}: UDSPopoverConfigProviderProps): react_jsx_runtime0.JSX.Element;
|
|
20
|
-
displayName: string;
|
|
21
|
-
};
|
|
22
|
-
declare function usePopoverConfig(options?: {
|
|
23
|
-
placement?: PopoverPlacement;
|
|
24
|
-
}): Omit<UDSPopoverConfigContextType, 'placementMap' | 'placement'> & {
|
|
25
|
-
ariaKitPlacement: PopoverProviderProps['placement'];
|
|
26
|
-
};
|
|
27
|
-
//#endregion
|
|
28
|
-
export { type UDSPopoverConfigContextType, UDSPopoverConfigProvider, type UDSPopoverConfigProviderProps, usePopoverConfig };
|