@1771technologies/lytenyte-pro 0.0.39
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/LICENSE +15 -0
- package/dist/DialogPortalContext-C2WZTqJ3.js +47 -0
- package/dist/InternalBackdrop-Dm9czgoC.js +6746 -0
- package/dist/MenuRoot-9n64jNWP.js +724 -0
- package/dist/anchor-context-B9sGQdR5.js +35 -0
- package/dist/arrow-down-icon-B-3ldODD.js +27 -0
- package/dist/arrow-svg-evmXDI_J.js +29 -0
- package/dist/column-manager.js +1241 -0
- package/dist/cross-icon-CEMLAlFX.js +20 -0
- package/dist/dialog.js +506 -0
- package/dist/filter-manager.js +1056 -0
- package/dist/getPseudoElementBounds-BSHt6WYm.js +26 -0
- package/dist/grid-container.js +18 -0
- package/dist/icons.js +512 -0
- package/dist/index.js +3730 -0
- package/dist/lytenyte-pro.css +1948 -0
- package/dist/manage-columns-icon-D4CElo5H.js +146 -0
- package/dist/menu.js +1639 -0
- package/dist/pill-C4Jhdf8E.js +985 -0
- package/dist/pill-manager.js +674 -0
- package/dist/plus-icon-ToqW5CC-.js +15 -0
- package/dist/popover.js +770 -0
- package/dist/row-group-icon-BOOju5Vu.js +205 -0
- package/dist/search-icon-CcG1lqsn.js +86 -0
- package/dist/select-C6xOZZLq.js +2231 -0
- package/dist/sort-manager.js +298 -0
- package/dist/tickmark-icon-CoogRMoO.js +51 -0
- package/dist/types/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/types/cell-selection/cell-selection-driver.d.ts +1 -0
- package/dist/types/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/types/column-manager/column-manager-drag-box-controls.d.ts +1 -0
- package/dist/types/column-manager/column-manager-drag-box-expander.d.ts +1 -0
- package/dist/types/column-manager/column-manager-drag-box-label.d.ts +5 -0
- package/dist/types/column-manager/column-manager-drag-box.d.ts +13 -0
- package/dist/types/column-manager/column-manager-drag-placeholder.d.ts +5 -0
- package/dist/types/column-manager/column-manager-drop-zone.d.ts +10 -0
- package/dist/types/column-manager/column-manager-impl.d.ts +36 -0
- package/dist/types/column-manager/column-manager-pill.d.ts +4 -0
- package/dist/types/column-manager/column-manager-pivot-mode-toggle.d.ts +1 -0
- package/dist/types/column-manager/column-manager-search.d.ts +1 -0
- package/dist/types/column-manager/column-manager-state.d.ts +8 -0
- package/dist/types/column-manager/column-manager-tree-item.d.ts +6 -0
- package/dist/types/column-manager/column-manager-tree.d.ts +11 -0
- package/dist/types/column-manager/column-manager-types.d.ts +1 -0
- package/dist/types/column-manager/column-manager.d.ts +1 -0
- package/dist/types/column-manager/column-mananger-context.d.ts +12 -0
- package/dist/types/column-manager/utils/all-leafs.d.ts +3 -0
- package/dist/types/column-manager/utils/can-hide-item.d.ts +3 -0
- package/dist/types/column-manager/utils/handle-item-hide.d.ts +3 -0
- package/dist/types/components-internal/button/button.d.ts +9 -0
- package/dist/types/components-internal/grid-frame/grid-frame.d.ts +11 -0
- package/dist/types/components-internal/radio/radio.d.ts +5 -0
- package/dist/types/components-internal/separator/separator.d.ts +8 -0
- package/dist/types/components-internal/toggle/toggle.d.ts +7 -0
- package/dist/types/dialog/dialog-driver.d.ts +1 -0
- package/dist/types/dialog/dialog-impl.d.ts +6 -0
- package/dist/types/dialog/dialog.d.ts +8 -0
- package/dist/types/dialog/use-dialog-class.d.ts +1 -0
- package/dist/types/external.d.ts +2 -0
- package/dist/types/filter-manager/combined-to-flat.d.ts +3 -0
- package/dist/types/filter-manager/components/apply-filter-button.d.ts +1 -0
- package/dist/types/filter-manager/components/clear-filter-button.d.ts +1 -0
- package/dist/types/filter-manager/components/flatten-tree-items.d.ts +4 -0
- package/dist/types/filter-manager/components/get-child-values.d.ts +2 -0
- package/dist/types/filter-manager/components/in-filter-container.d.ts +1 -0
- package/dist/types/filter-manager/components/in-filter-error.d.ts +5 -0
- package/dist/types/filter-manager/components/in-filter-loading.d.ts +1 -0
- package/dist/types/filter-manager/components/in-filter-root.d.ts +11 -0
- package/dist/types/filter-manager/components/in-filter-tree.d.ts +15 -0
- package/dist/types/filter-manager/components/simple-filter-additional-switch.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/date-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/number-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/simple-filter-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-operator/text-operator.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-root.d.ts +9 -0
- package/dist/types/filter-manager/components/simple-filter-value/date-value.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-value/number-value.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-value/simple-filter-value.d.ts +1 -0
- package/dist/types/filter-manager/components/simple-filter-value/text-value.d.ts +1 -0
- package/dist/types/filter-manager/components/use-date-filter-callbacks.d.ts +9 -0
- package/dist/types/filter-manager/components/use-in-filter-item-loader.d.ts +7 -0
- package/dist/types/filter-manager/components/use-number-filter-callbacks.d.ts +8 -0
- package/dist/types/filter-manager/components/use-text-filter-callbacks.d.ts +8 -0
- package/dist/types/filter-manager/filter-manager-impl.d.ts +27 -0
- package/dist/types/filter-manager/filter-manager.d.ts +1 -0
- package/dist/types/filter-manager/filter-state-context.d.ts +16 -0
- package/dist/types/filter-manager/flat-to-combined.d.ts +3 -0
- package/dist/types/filter-manager/flatten-combined-filter.d.ts +3 -0
- package/dist/types/filter-manager/is-filter-complete.d.ts +2 -0
- package/dist/types/filter-manager/types.d.ts +15 -0
- package/dist/types/filter-manager/use-in-filter.d.ts +5 -0
- package/dist/types/filter-manager/use-simple-filters.d.ts +8 -0
- package/dist/types/grid-container/grid-container-impl.d.ts +6 -0
- package/dist/types/grid-container/grid-container.d.ts +2 -0
- package/dist/types/icons.d.ts +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/license.d.ts +12 -0
- package/dist/types/list-view/list-view-context.d.ts +21 -0
- package/dist/types/list-view/list-view.d.ts +26 -0
- package/dist/types/lytenyte-pro.d.ts +7 -0
- package/dist/types/menu/arrow-svg.d.ts +1 -0
- package/dist/types/menu/column-menu/column-menu-driver.d.ts +4 -0
- package/dist/types/menu/context-menu/context-menu-driver.d.ts +1 -0
- package/dist/types/menu/context-menu/use-context-menu-listener.d.ts +6 -0
- package/dist/types/menu/menu-impl.d.ts +17 -0
- package/dist/types/menu/menu.d.ts +18 -0
- package/dist/types/menu/use-menu-class-name.d.ts +1 -0
- package/dist/types/overlay/load-error-overlay.d.ts +1 -0
- package/dist/types/overlay/loading-overlay.d.ts +1 -0
- package/dist/types/overlay/no-data-overlay.d.ts +1 -0
- package/dist/types/overlay/overlay-driver.d.ts +1 -0
- package/dist/types/pill/pill.d.ts +5 -0
- package/dist/types/pill-manager/pill-manager-agg-menu.d.ts +7 -0
- package/dist/types/pill-manager/pill-manager-controls.d.ts +9 -0
- package/dist/types/pill-manager/pill-manager-drag-placeholder.d.ts +5 -0
- package/dist/types/pill-manager/pill-manager-expander.d.ts +1 -0
- package/dist/types/pill-manager/pill-manager-impl.d.ts +49 -0
- package/dist/types/pill-manager/pill-manager-pill.d.ts +4 -0
- package/dist/types/pill-manager/pill-manager-pills/pill-manager-pills.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-aggregation-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-column-pivot-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-column-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-measures-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/use-row-groups-source.d.ts +2 -0
- package/dist/types/pill-manager/pill-manager-pills/utils.d.ts +3 -0
- package/dist/types/pill-manager/pill-manager-row-label.d.ts +22 -0
- package/dist/types/pill-manager/pill-manager-row.d.ts +12 -0
- package/dist/types/pill-manager/pill-manager-rows.d.ts +1 -0
- package/dist/types/pill-manager/pill-manager-separator.d.ts +1 -0
- package/dist/types/pill-manager/pill-manager-types.d.ts +36 -0
- package/dist/types/pill-manager/pill-manager.d.ts +1 -0
- package/dist/types/popover/anchor-context.d.ts +6 -0
- package/dist/types/popover/popover-driver.d.ts +1 -0
- package/dist/types/popover/popover-impl.d.ts +8 -0
- package/dist/types/popover/popover.d.ts +10 -0
- package/dist/types/popover/use-popover-class.d.ts +1 -0
- package/dist/types/select/select.d.ts +17 -0
- package/dist/types/sort-manager/sort-adder.d.ts +4 -0
- package/dist/types/sort-manager/sort-apply.d.ts +1 -0
- package/dist/types/sort-manager/sort-cancel.d.ts +1 -0
- package/dist/types/sort-manager/sort-clear.d.ts +1 -0
- package/dist/types/sort-manager/sort-column-select.d.ts +5 -0
- package/dist/types/sort-manager/sort-direction-select.d.ts +5 -0
- package/dist/types/sort-manager/sort-items-to-sort-model.d.ts +3 -0
- package/dist/types/sort-manager/sort-manager-container.d.ts +53 -0
- package/dist/types/sort-manager/sort-manager-context.d.ts +4 -0
- package/dist/types/sort-manager/sort-manager-impl.d.ts +30 -0
- package/dist/types/sort-manager/sort-manager.d.ts +1 -0
- package/dist/types/sort-manager/sort-model-to-sort-items.d.ts +4 -0
- package/dist/types/sort-manager/sort-remove.d.ts +4 -0
- package/dist/types/sort-manager/sort-sort-select.d.ts +5 -0
- package/dist/types/sort-manager/use-sort-state.d.ts +8 -0
- package/dist/types/sort-manager/use-sortable-column-items.d.ts +9 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/use-client-data-source.d.ts +6 -0
- package/dist/types/use-edge-scroll.d.ts +7 -0
- package/dist/types/use-grid.d.ts +6 -0
- package/dist/types/use-lytenyte.d.ts +10 -0
- package/dist/types/use-tree-data-source.d.ts +3 -0
- package/dist/types/watermark.d.ts +3 -0
- package/dist/types.js +1 -0
- package/dist/use-grid-DKvzGZWc.js +916 -0
- package/dist/useAnchorPositioning-Cm44rb7y.js +252 -0
- package/dist/useBaseUiId-J66PFGv_.js +48 -0
- package/dist/useButton-Cy7tjZ__.js +183 -0
- package/dist/useCompositeListItem-I14CpQPi.js +51 -0
- package/dist/useScrollLock-D6h5lZYs.js +515 -0
- package/package.json +96 -0
package/dist/popover.js
ADDED
|
@@ -0,0 +1,770 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useMemo, forwardRef } from "react";
|
|
4
|
+
import { clsx } from "@1771technologies/js-utils";
|
|
5
|
+
import { A as ArrowSvg } from "./arrow-svg-evmXDI_J.js";
|
|
6
|
+
import { u as usePopoverRootContext, a as usePopoverPortalContext, b as useAnchor } from "./anchor-context-B9sGQdR5.js";
|
|
7
|
+
import { m as mergeProps, k as useForkRef, v as useComponentRenderer, w as popupStateMapping, I as InternalBackdrop, P as PropTypes, H as HTMLElementType, r as refType, y as useOpenChangeComplete, M as FloatingFocusManager, u as useEnhancedEffect, j as useEventCallback } from "./InternalBackdrop-Dm9czgoC.js";
|
|
8
|
+
import { t as transitionStatusMapping, u as useBaseUiId } from "./useBaseUiId-J66PFGv_.js";
|
|
9
|
+
import { u as useAnchorPositioning } from "./useAnchorPositioning-Cm44rb7y.js";
|
|
10
|
+
function usePopoverPositioner(params) {
|
|
11
|
+
const {
|
|
12
|
+
open,
|
|
13
|
+
mounted
|
|
14
|
+
} = usePopoverRootContext();
|
|
15
|
+
const positioning = useAnchorPositioning(params);
|
|
16
|
+
const getPositionerProps = React.useCallback((externalProps = {}) => {
|
|
17
|
+
const hiddenStyles = {};
|
|
18
|
+
if (!open) {
|
|
19
|
+
hiddenStyles.pointerEvents = "none";
|
|
20
|
+
}
|
|
21
|
+
return mergeProps({
|
|
22
|
+
role: "presentation",
|
|
23
|
+
hidden: !mounted,
|
|
24
|
+
style: {
|
|
25
|
+
...positioning.positionerStyles,
|
|
26
|
+
...hiddenStyles
|
|
27
|
+
}
|
|
28
|
+
}, externalProps);
|
|
29
|
+
}, [open, mounted, positioning.positionerStyles]);
|
|
30
|
+
return React.useMemo(() => ({
|
|
31
|
+
getPositionerProps,
|
|
32
|
+
...positioning
|
|
33
|
+
}), [getPositionerProps, positioning]);
|
|
34
|
+
}
|
|
35
|
+
const PopoverPositionerContext = /* @__PURE__ */ React.createContext(void 0);
|
|
36
|
+
if (process.env.NODE_ENV !== "production") {
|
|
37
|
+
PopoverPositionerContext.displayName = "PopoverPositionerContext";
|
|
38
|
+
}
|
|
39
|
+
function usePopoverPositionerContext() {
|
|
40
|
+
const context = React.useContext(PopoverPositionerContext);
|
|
41
|
+
if (context === void 0) {
|
|
42
|
+
throw new Error("Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.");
|
|
43
|
+
}
|
|
44
|
+
return context;
|
|
45
|
+
}
|
|
46
|
+
const PopoverPositioner$1 = /* @__PURE__ */ React.forwardRef(function PopoverPositioner(props, forwardedRef) {
|
|
47
|
+
const {
|
|
48
|
+
render,
|
|
49
|
+
className,
|
|
50
|
+
anchor,
|
|
51
|
+
positionMethod = "absolute",
|
|
52
|
+
side = "bottom",
|
|
53
|
+
align = "center",
|
|
54
|
+
sideOffset = 0,
|
|
55
|
+
alignOffset = 0,
|
|
56
|
+
collisionBoundary = "clipping-ancestors",
|
|
57
|
+
collisionPadding = 5,
|
|
58
|
+
arrowPadding = 5,
|
|
59
|
+
sticky = false,
|
|
60
|
+
trackAnchor = true,
|
|
61
|
+
...otherProps
|
|
62
|
+
} = props;
|
|
63
|
+
const {
|
|
64
|
+
floatingRootContext,
|
|
65
|
+
open,
|
|
66
|
+
mounted,
|
|
67
|
+
setPositionerElement,
|
|
68
|
+
modal,
|
|
69
|
+
openReason,
|
|
70
|
+
openMethod
|
|
71
|
+
} = usePopoverRootContext();
|
|
72
|
+
const keepMounted = usePopoverPortalContext();
|
|
73
|
+
const positioner = usePopoverPositioner({
|
|
74
|
+
anchor,
|
|
75
|
+
floatingRootContext,
|
|
76
|
+
positionMethod,
|
|
77
|
+
mounted,
|
|
78
|
+
open,
|
|
79
|
+
side,
|
|
80
|
+
sideOffset,
|
|
81
|
+
align,
|
|
82
|
+
alignOffset,
|
|
83
|
+
arrowPadding,
|
|
84
|
+
collisionBoundary,
|
|
85
|
+
collisionPadding,
|
|
86
|
+
sticky,
|
|
87
|
+
trackAnchor,
|
|
88
|
+
keepMounted
|
|
89
|
+
});
|
|
90
|
+
const state2 = React.useMemo(() => ({
|
|
91
|
+
open,
|
|
92
|
+
side: positioner.side,
|
|
93
|
+
align: positioner.align,
|
|
94
|
+
anchorHidden: positioner.anchorHidden
|
|
95
|
+
}), [open, positioner.side, positioner.align, positioner.anchorHidden]);
|
|
96
|
+
const mergedRef = useForkRef(forwardedRef, setPositionerElement);
|
|
97
|
+
const {
|
|
98
|
+
renderElement
|
|
99
|
+
} = useComponentRenderer({
|
|
100
|
+
propGetter: positioner.getPositionerProps,
|
|
101
|
+
render: render ?? "div",
|
|
102
|
+
className,
|
|
103
|
+
state: state2,
|
|
104
|
+
ref: mergedRef,
|
|
105
|
+
extraProps: otherProps,
|
|
106
|
+
customStyleHookMapping: popupStateMapping
|
|
107
|
+
});
|
|
108
|
+
return /* @__PURE__ */ jsxs(PopoverPositionerContext.Provider, {
|
|
109
|
+
value: positioner,
|
|
110
|
+
children: [mounted && modal && openReason !== "hover" && openMethod !== "touch" && /* @__PURE__ */ jsx(InternalBackdrop, {
|
|
111
|
+
inert: !open
|
|
112
|
+
}), renderElement()]
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
process.env.NODE_ENV !== "production" ? PopoverPositioner$1.propTypes = {
|
|
116
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
117
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
118
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
119
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
120
|
+
/**
|
|
121
|
+
* How to align the popup relative to the specified side.
|
|
122
|
+
* @default 'center'
|
|
123
|
+
*/
|
|
124
|
+
align: PropTypes.oneOf(["center", "end", "start"]),
|
|
125
|
+
/**
|
|
126
|
+
* Additional offset along the alignment axis in pixels.
|
|
127
|
+
* Also accepts a function that returns the offset to read the dimensions of the anchor
|
|
128
|
+
* and positioner elements, along with its side and alignment.
|
|
129
|
+
*
|
|
130
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
131
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
132
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
133
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
134
|
+
* @default 0
|
|
135
|
+
*/
|
|
136
|
+
alignOffset: PropTypes.oneOfType([PropTypes.func, PropTypes.number]),
|
|
137
|
+
/**
|
|
138
|
+
* An element to position the popup against.
|
|
139
|
+
* By default, the popup will be positioned against the trigger.
|
|
140
|
+
*/
|
|
141
|
+
anchor: PropTypes.oneOfType([HTMLElementType, refType, PropTypes.object, PropTypes.func]),
|
|
142
|
+
/**
|
|
143
|
+
* Minimum distance to maintain between the arrow and the edges of the popup.
|
|
144
|
+
*
|
|
145
|
+
* Use it to prevent the arrow element from hanging out of the rounded corners of a popup.
|
|
146
|
+
* @default 5
|
|
147
|
+
*/
|
|
148
|
+
arrowPadding: PropTypes.number,
|
|
149
|
+
/**
|
|
150
|
+
* @ignore
|
|
151
|
+
*/
|
|
152
|
+
children: PropTypes.node,
|
|
153
|
+
/**
|
|
154
|
+
* CSS class applied to the element, or a function that
|
|
155
|
+
* returns a class based on the component’s state.
|
|
156
|
+
*/
|
|
157
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
158
|
+
/**
|
|
159
|
+
* An element or a rectangle that delimits the area that the popup is confined to.
|
|
160
|
+
* @default 'clipping-ancestors'
|
|
161
|
+
*/
|
|
162
|
+
collisionBoundary: PropTypes.oneOfType([HTMLElementType, PropTypes.arrayOf(HTMLElementType), PropTypes.string, PropTypes.shape({
|
|
163
|
+
height: PropTypes.number,
|
|
164
|
+
width: PropTypes.number,
|
|
165
|
+
x: PropTypes.number,
|
|
166
|
+
y: PropTypes.number
|
|
167
|
+
})]),
|
|
168
|
+
/**
|
|
169
|
+
* Additional space to maintain from the edge of the collision boundary.
|
|
170
|
+
* @default 5
|
|
171
|
+
*/
|
|
172
|
+
collisionPadding: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({
|
|
173
|
+
bottom: PropTypes.number,
|
|
174
|
+
left: PropTypes.number,
|
|
175
|
+
right: PropTypes.number,
|
|
176
|
+
top: PropTypes.number
|
|
177
|
+
})]),
|
|
178
|
+
/**
|
|
179
|
+
* Determines which CSS `position` property to use.
|
|
180
|
+
* @default 'absolute'
|
|
181
|
+
*/
|
|
182
|
+
positionMethod: PropTypes.oneOf(["absolute", "fixed"]),
|
|
183
|
+
/**
|
|
184
|
+
* Allows you to replace the component’s HTML element
|
|
185
|
+
* with a different tag, or compose it with another component.
|
|
186
|
+
*
|
|
187
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
188
|
+
*/
|
|
189
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
190
|
+
/**
|
|
191
|
+
* Which side of the anchor element to align the popup against.
|
|
192
|
+
* May automatically change to avoid collisions.
|
|
193
|
+
* @default 'bottom'
|
|
194
|
+
*/
|
|
195
|
+
side: PropTypes.oneOf(["bottom", "inline-end", "inline-start", "left", "right", "top"]),
|
|
196
|
+
/**
|
|
197
|
+
* Distance between the anchor and the popup in pixels.
|
|
198
|
+
* Also accepts a function that returns the distance to read the dimensions of the anchor
|
|
199
|
+
* and positioner elements, along with its side and alignment.
|
|
200
|
+
*
|
|
201
|
+
* - `data.anchor`: the dimensions of the anchor element with properties `width` and `height`.
|
|
202
|
+
* - `data.positioner`: the dimensions of the positioner element with properties `width` and `height`.
|
|
203
|
+
* - `data.side`: which side of the anchor element the positioner is aligned against.
|
|
204
|
+
* - `data.align`: how the positioner is aligned relative to the specified side.
|
|
205
|
+
* @default 0
|
|
206
|
+
*/
|
|
207
|
+
sideOffset: PropTypes.oneOfType([PropTypes.func, PropTypes.number]),
|
|
208
|
+
/**
|
|
209
|
+
* Whether to maintain the popup in the viewport after
|
|
210
|
+
* the anchor element was scrolled out of view.
|
|
211
|
+
* @default false
|
|
212
|
+
*/
|
|
213
|
+
sticky: PropTypes.bool,
|
|
214
|
+
/**
|
|
215
|
+
* Whether the popup tracks any layout shift of its positioning anchor.
|
|
216
|
+
* @default true
|
|
217
|
+
*/
|
|
218
|
+
trackAnchor: PropTypes.bool
|
|
219
|
+
} : void 0;
|
|
220
|
+
function usePopoverPopup(params) {
|
|
221
|
+
const {
|
|
222
|
+
getProps,
|
|
223
|
+
titleId,
|
|
224
|
+
descriptionId,
|
|
225
|
+
initialFocus
|
|
226
|
+
} = params;
|
|
227
|
+
const {
|
|
228
|
+
popupRef,
|
|
229
|
+
openMethod
|
|
230
|
+
} = usePopoverRootContext();
|
|
231
|
+
const getPopupProps = React.useCallback((externalProps = {}) => {
|
|
232
|
+
return mergeProps({
|
|
233
|
+
"aria-labelledby": titleId,
|
|
234
|
+
"aria-describedby": descriptionId
|
|
235
|
+
}, getProps(externalProps));
|
|
236
|
+
}, [getProps, titleId, descriptionId]);
|
|
237
|
+
const defaultInitialFocus = React.useCallback((interactionType) => {
|
|
238
|
+
if (interactionType === "touch") {
|
|
239
|
+
return popupRef;
|
|
240
|
+
}
|
|
241
|
+
return 0;
|
|
242
|
+
}, [popupRef]);
|
|
243
|
+
const resolvedInitialFocus = React.useMemo(() => {
|
|
244
|
+
if (initialFocus == null) {
|
|
245
|
+
return defaultInitialFocus(openMethod ?? "");
|
|
246
|
+
}
|
|
247
|
+
if (typeof initialFocus === "function") {
|
|
248
|
+
return initialFocus(openMethod ?? "");
|
|
249
|
+
}
|
|
250
|
+
return initialFocus;
|
|
251
|
+
}, [defaultInitialFocus, initialFocus, openMethod]);
|
|
252
|
+
return React.useMemo(() => ({
|
|
253
|
+
getPopupProps,
|
|
254
|
+
resolvedInitialFocus
|
|
255
|
+
}), [getPopupProps, resolvedInitialFocus]);
|
|
256
|
+
}
|
|
257
|
+
const customStyleHookMapping$1 = {
|
|
258
|
+
...popupStateMapping,
|
|
259
|
+
...transitionStatusMapping
|
|
260
|
+
};
|
|
261
|
+
const PopoverPopup$1 = /* @__PURE__ */ React.forwardRef(function PopoverPopup(props, forwardedRef) {
|
|
262
|
+
const {
|
|
263
|
+
className,
|
|
264
|
+
render,
|
|
265
|
+
initialFocus,
|
|
266
|
+
finalFocus,
|
|
267
|
+
...otherProps
|
|
268
|
+
} = props;
|
|
269
|
+
const {
|
|
270
|
+
open,
|
|
271
|
+
instantType,
|
|
272
|
+
transitionStatus,
|
|
273
|
+
getRootPopupProps,
|
|
274
|
+
titleId,
|
|
275
|
+
descriptionId,
|
|
276
|
+
popupRef,
|
|
277
|
+
mounted,
|
|
278
|
+
openReason,
|
|
279
|
+
onOpenChangeComplete
|
|
280
|
+
} = usePopoverRootContext();
|
|
281
|
+
const positioner = usePopoverPositionerContext();
|
|
282
|
+
useOpenChangeComplete({
|
|
283
|
+
open,
|
|
284
|
+
ref: popupRef,
|
|
285
|
+
onComplete() {
|
|
286
|
+
if (open) {
|
|
287
|
+
onOpenChangeComplete?.(true);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
const {
|
|
292
|
+
getPopupProps,
|
|
293
|
+
resolvedInitialFocus
|
|
294
|
+
} = usePopoverPopup({
|
|
295
|
+
getProps: getRootPopupProps,
|
|
296
|
+
titleId,
|
|
297
|
+
descriptionId,
|
|
298
|
+
initialFocus
|
|
299
|
+
});
|
|
300
|
+
const state2 = React.useMemo(() => ({
|
|
301
|
+
open,
|
|
302
|
+
side: positioner.side,
|
|
303
|
+
align: positioner.align,
|
|
304
|
+
instant: instantType,
|
|
305
|
+
transitionStatus
|
|
306
|
+
}), [open, positioner.side, positioner.align, instantType, transitionStatus]);
|
|
307
|
+
const mergedRef = useForkRef(popupRef, forwardedRef);
|
|
308
|
+
const {
|
|
309
|
+
renderElement
|
|
310
|
+
} = useComponentRenderer({
|
|
311
|
+
propGetter: getPopupProps,
|
|
312
|
+
ref: mergedRef,
|
|
313
|
+
render: render ?? "div",
|
|
314
|
+
className,
|
|
315
|
+
state: state2,
|
|
316
|
+
extraProps: transitionStatus === "starting" ? mergeProps({
|
|
317
|
+
style: {
|
|
318
|
+
transition: "none"
|
|
319
|
+
}
|
|
320
|
+
}, otherProps) : otherProps,
|
|
321
|
+
customStyleHookMapping: customStyleHookMapping$1
|
|
322
|
+
});
|
|
323
|
+
return /* @__PURE__ */ jsx(FloatingFocusManager, {
|
|
324
|
+
context: positioner.context,
|
|
325
|
+
modal: false,
|
|
326
|
+
disabled: !mounted || openReason === "hover",
|
|
327
|
+
initialFocus: resolvedInitialFocus,
|
|
328
|
+
returnFocus: finalFocus,
|
|
329
|
+
children: renderElement()
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
process.env.NODE_ENV !== "production" ? PopoverPopup$1.propTypes = {
|
|
333
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
334
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
335
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
336
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
337
|
+
/**
|
|
338
|
+
* @ignore
|
|
339
|
+
*/
|
|
340
|
+
children: PropTypes.node,
|
|
341
|
+
/**
|
|
342
|
+
* CSS class applied to the element, or a function that
|
|
343
|
+
* returns a class based on the component’s state.
|
|
344
|
+
*/
|
|
345
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
346
|
+
/**
|
|
347
|
+
* Determines the element to focus when the popover is closed.
|
|
348
|
+
* By default, focus returns to the trigger.
|
|
349
|
+
*/
|
|
350
|
+
finalFocus: refType,
|
|
351
|
+
/**
|
|
352
|
+
* Determines the element to focus when the popover is opened.
|
|
353
|
+
* By default, the first focusable element is focused.
|
|
354
|
+
*/
|
|
355
|
+
initialFocus: PropTypes.oneOfType([PropTypes.func, refType]),
|
|
356
|
+
/**
|
|
357
|
+
* Allows you to replace the component’s HTML element
|
|
358
|
+
* with a different tag, or compose it with another component.
|
|
359
|
+
*
|
|
360
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
361
|
+
*/
|
|
362
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
363
|
+
} : void 0;
|
|
364
|
+
const PopoverArrow$1 = /* @__PURE__ */ React.forwardRef(function PopoverArrow(props, forwardedRef) {
|
|
365
|
+
const {
|
|
366
|
+
className,
|
|
367
|
+
render,
|
|
368
|
+
...otherProps
|
|
369
|
+
} = props;
|
|
370
|
+
const {
|
|
371
|
+
open
|
|
372
|
+
} = usePopoverRootContext();
|
|
373
|
+
const {
|
|
374
|
+
arrowRef,
|
|
375
|
+
side,
|
|
376
|
+
align,
|
|
377
|
+
arrowUncentered,
|
|
378
|
+
arrowStyles
|
|
379
|
+
} = usePopoverPositionerContext();
|
|
380
|
+
const getArrowProps = React.useCallback((externalProps = {}) => {
|
|
381
|
+
return mergeProps({
|
|
382
|
+
style: arrowStyles,
|
|
383
|
+
"aria-hidden": true
|
|
384
|
+
}, externalProps);
|
|
385
|
+
}, [arrowStyles]);
|
|
386
|
+
const state2 = React.useMemo(() => ({
|
|
387
|
+
open,
|
|
388
|
+
side,
|
|
389
|
+
align,
|
|
390
|
+
uncentered: arrowUncentered
|
|
391
|
+
}), [open, side, align, arrowUncentered]);
|
|
392
|
+
const mergedRef = useForkRef(arrowRef, forwardedRef);
|
|
393
|
+
const {
|
|
394
|
+
renderElement
|
|
395
|
+
} = useComponentRenderer({
|
|
396
|
+
propGetter: getArrowProps,
|
|
397
|
+
render: render ?? "div",
|
|
398
|
+
className,
|
|
399
|
+
state: state2,
|
|
400
|
+
ref: mergedRef,
|
|
401
|
+
extraProps: otherProps,
|
|
402
|
+
customStyleHookMapping: popupStateMapping
|
|
403
|
+
});
|
|
404
|
+
return renderElement();
|
|
405
|
+
});
|
|
406
|
+
process.env.NODE_ENV !== "production" ? PopoverArrow$1.propTypes = {
|
|
407
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
408
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
409
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
410
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
411
|
+
/**
|
|
412
|
+
* @ignore
|
|
413
|
+
*/
|
|
414
|
+
children: PropTypes.node,
|
|
415
|
+
/**
|
|
416
|
+
* CSS class applied to the element, or a function that
|
|
417
|
+
* returns a class based on the component’s state.
|
|
418
|
+
*/
|
|
419
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
420
|
+
/**
|
|
421
|
+
* Allows you to replace the component’s HTML element
|
|
422
|
+
* with a different tag, or compose it with another component.
|
|
423
|
+
*
|
|
424
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
425
|
+
*/
|
|
426
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
427
|
+
} : void 0;
|
|
428
|
+
const customStyleHookMapping = {
|
|
429
|
+
...popupStateMapping,
|
|
430
|
+
...transitionStatusMapping
|
|
431
|
+
};
|
|
432
|
+
const PopoverBackdrop$1 = /* @__PURE__ */ React.forwardRef(function PopoverBackdrop(props, forwardedRef) {
|
|
433
|
+
const {
|
|
434
|
+
className,
|
|
435
|
+
render,
|
|
436
|
+
...other
|
|
437
|
+
} = props;
|
|
438
|
+
const {
|
|
439
|
+
open,
|
|
440
|
+
mounted,
|
|
441
|
+
transitionStatus,
|
|
442
|
+
openReason
|
|
443
|
+
} = usePopoverRootContext();
|
|
444
|
+
const state2 = React.useMemo(() => ({
|
|
445
|
+
open,
|
|
446
|
+
transitionStatus
|
|
447
|
+
}), [open, transitionStatus]);
|
|
448
|
+
const {
|
|
449
|
+
renderElement
|
|
450
|
+
} = useComponentRenderer({
|
|
451
|
+
render: render ?? "div",
|
|
452
|
+
className,
|
|
453
|
+
state: state2,
|
|
454
|
+
ref: forwardedRef,
|
|
455
|
+
extraProps: mergeProps({
|
|
456
|
+
role: "presentation",
|
|
457
|
+
hidden: !mounted,
|
|
458
|
+
style: openReason === "hover" ? {
|
|
459
|
+
pointerEvents: "none"
|
|
460
|
+
} : {}
|
|
461
|
+
}, other),
|
|
462
|
+
customStyleHookMapping
|
|
463
|
+
});
|
|
464
|
+
return renderElement();
|
|
465
|
+
});
|
|
466
|
+
process.env.NODE_ENV !== "production" ? PopoverBackdrop$1.propTypes = {
|
|
467
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
468
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
469
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
470
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
471
|
+
/**
|
|
472
|
+
* @ignore
|
|
473
|
+
*/
|
|
474
|
+
children: PropTypes.node,
|
|
475
|
+
/**
|
|
476
|
+
* CSS class applied to the element, or a function that
|
|
477
|
+
* returns a class based on the component’s state.
|
|
478
|
+
*/
|
|
479
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
480
|
+
/**
|
|
481
|
+
* Allows you to replace the component’s HTML element
|
|
482
|
+
* with a different tag, or compose it with another component.
|
|
483
|
+
*
|
|
484
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
485
|
+
*/
|
|
486
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
487
|
+
} : void 0;
|
|
488
|
+
function usePopoverTitle(params) {
|
|
489
|
+
const {
|
|
490
|
+
titleId,
|
|
491
|
+
setTitleId
|
|
492
|
+
} = params;
|
|
493
|
+
const id = useBaseUiId(titleId);
|
|
494
|
+
const getTitleProps = React.useCallback((externalProps = {}) => {
|
|
495
|
+
return mergeProps({
|
|
496
|
+
id
|
|
497
|
+
}, externalProps);
|
|
498
|
+
}, [id]);
|
|
499
|
+
useEnhancedEffect(() => {
|
|
500
|
+
setTitleId(id);
|
|
501
|
+
return () => {
|
|
502
|
+
setTitleId(void 0);
|
|
503
|
+
};
|
|
504
|
+
}, [setTitleId, id]);
|
|
505
|
+
return React.useMemo(() => ({
|
|
506
|
+
getTitleProps
|
|
507
|
+
}), [getTitleProps]);
|
|
508
|
+
}
|
|
509
|
+
const state$2 = {};
|
|
510
|
+
const PopoverTitle$1 = /* @__PURE__ */ React.forwardRef(function PopoverTitle(props, forwardedRef) {
|
|
511
|
+
const {
|
|
512
|
+
render,
|
|
513
|
+
className,
|
|
514
|
+
...otherProps
|
|
515
|
+
} = props;
|
|
516
|
+
const {
|
|
517
|
+
setTitleId
|
|
518
|
+
} = usePopoverRootContext();
|
|
519
|
+
const {
|
|
520
|
+
getTitleProps
|
|
521
|
+
} = usePopoverTitle({
|
|
522
|
+
titleId: otherProps.id,
|
|
523
|
+
setTitleId
|
|
524
|
+
});
|
|
525
|
+
const {
|
|
526
|
+
renderElement
|
|
527
|
+
} = useComponentRenderer({
|
|
528
|
+
propGetter: getTitleProps,
|
|
529
|
+
render: render ?? "h2",
|
|
530
|
+
className,
|
|
531
|
+
state: state$2,
|
|
532
|
+
ref: forwardedRef,
|
|
533
|
+
extraProps: otherProps
|
|
534
|
+
});
|
|
535
|
+
return renderElement();
|
|
536
|
+
});
|
|
537
|
+
process.env.NODE_ENV !== "production" ? PopoverTitle$1.propTypes = {
|
|
538
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
539
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
540
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
541
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
542
|
+
/**
|
|
543
|
+
* @ignore
|
|
544
|
+
*/
|
|
545
|
+
children: PropTypes.node,
|
|
546
|
+
/**
|
|
547
|
+
* CSS class applied to the element, or a function that
|
|
548
|
+
* returns a class based on the component’s state.
|
|
549
|
+
*/
|
|
550
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
551
|
+
/**
|
|
552
|
+
* @ignore
|
|
553
|
+
*/
|
|
554
|
+
id: PropTypes.string,
|
|
555
|
+
/**
|
|
556
|
+
* Allows you to replace the component’s HTML element
|
|
557
|
+
* with a different tag, or compose it with another component.
|
|
558
|
+
*
|
|
559
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
560
|
+
*/
|
|
561
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
562
|
+
} : void 0;
|
|
563
|
+
function usePopoverDescription(params) {
|
|
564
|
+
const {
|
|
565
|
+
descriptionId,
|
|
566
|
+
setDescriptionId
|
|
567
|
+
} = params;
|
|
568
|
+
const id = useBaseUiId(descriptionId);
|
|
569
|
+
const getDescriptionProps = React.useCallback((externalProps = {}) => {
|
|
570
|
+
return mergeProps({
|
|
571
|
+
id
|
|
572
|
+
}, externalProps);
|
|
573
|
+
}, [id]);
|
|
574
|
+
useEnhancedEffect(() => {
|
|
575
|
+
setDescriptionId(id);
|
|
576
|
+
return () => {
|
|
577
|
+
setDescriptionId(void 0);
|
|
578
|
+
};
|
|
579
|
+
}, [setDescriptionId, id]);
|
|
580
|
+
return React.useMemo(() => ({
|
|
581
|
+
getDescriptionProps
|
|
582
|
+
}), [getDescriptionProps]);
|
|
583
|
+
}
|
|
584
|
+
const state$1 = {};
|
|
585
|
+
const PopoverDescription$1 = /* @__PURE__ */ React.forwardRef(function PopoverDescription(props, forwardedRef) {
|
|
586
|
+
const {
|
|
587
|
+
render,
|
|
588
|
+
className,
|
|
589
|
+
...otherProps
|
|
590
|
+
} = props;
|
|
591
|
+
const {
|
|
592
|
+
setDescriptionId
|
|
593
|
+
} = usePopoverRootContext();
|
|
594
|
+
const {
|
|
595
|
+
getDescriptionProps
|
|
596
|
+
} = usePopoverDescription({
|
|
597
|
+
descriptionId: otherProps.id,
|
|
598
|
+
setDescriptionId
|
|
599
|
+
});
|
|
600
|
+
const {
|
|
601
|
+
renderElement
|
|
602
|
+
} = useComponentRenderer({
|
|
603
|
+
propGetter: getDescriptionProps,
|
|
604
|
+
render: render ?? "p",
|
|
605
|
+
className,
|
|
606
|
+
state: state$1,
|
|
607
|
+
ref: forwardedRef,
|
|
608
|
+
extraProps: otherProps
|
|
609
|
+
});
|
|
610
|
+
return renderElement();
|
|
611
|
+
});
|
|
612
|
+
process.env.NODE_ENV !== "production" ? PopoverDescription$1.propTypes = {
|
|
613
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
614
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
615
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
616
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
617
|
+
/**
|
|
618
|
+
* @ignore
|
|
619
|
+
*/
|
|
620
|
+
children: PropTypes.node,
|
|
621
|
+
/**
|
|
622
|
+
* CSS class applied to the element, or a function that
|
|
623
|
+
* returns a class based on the component’s state.
|
|
624
|
+
*/
|
|
625
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
626
|
+
/**
|
|
627
|
+
* @ignore
|
|
628
|
+
*/
|
|
629
|
+
id: PropTypes.string,
|
|
630
|
+
/**
|
|
631
|
+
* Allows you to replace the component’s HTML element
|
|
632
|
+
* with a different tag, or compose it with another component.
|
|
633
|
+
*
|
|
634
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
635
|
+
*/
|
|
636
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
637
|
+
} : void 0;
|
|
638
|
+
function usePopoverClose(params) {
|
|
639
|
+
const {
|
|
640
|
+
onClose: onCloseProp
|
|
641
|
+
} = params;
|
|
642
|
+
const onClose = useEventCallback(onCloseProp);
|
|
643
|
+
const getCloseProps = React.useCallback((externalProps = {}) => {
|
|
644
|
+
return mergeProps({
|
|
645
|
+
onClick: onClose
|
|
646
|
+
}, externalProps);
|
|
647
|
+
}, [onClose]);
|
|
648
|
+
return React.useMemo(() => ({
|
|
649
|
+
getCloseProps
|
|
650
|
+
}), [getCloseProps]);
|
|
651
|
+
}
|
|
652
|
+
const state = {};
|
|
653
|
+
const PopoverClose$1 = /* @__PURE__ */ React.forwardRef(function PopoverClose(props, forwardedRef) {
|
|
654
|
+
const {
|
|
655
|
+
render,
|
|
656
|
+
className,
|
|
657
|
+
...otherProps
|
|
658
|
+
} = props;
|
|
659
|
+
const {
|
|
660
|
+
setOpen
|
|
661
|
+
} = usePopoverRootContext();
|
|
662
|
+
const {
|
|
663
|
+
getCloseProps
|
|
664
|
+
} = usePopoverClose({
|
|
665
|
+
onClose() {
|
|
666
|
+
setOpen(false);
|
|
667
|
+
}
|
|
668
|
+
});
|
|
669
|
+
const {
|
|
670
|
+
renderElement
|
|
671
|
+
} = useComponentRenderer({
|
|
672
|
+
propGetter: getCloseProps,
|
|
673
|
+
render: render ?? "button",
|
|
674
|
+
className,
|
|
675
|
+
state,
|
|
676
|
+
extraProps: otherProps,
|
|
677
|
+
ref: forwardedRef
|
|
678
|
+
});
|
|
679
|
+
return renderElement();
|
|
680
|
+
});
|
|
681
|
+
process.env.NODE_ENV !== "production" ? PopoverClose$1.propTypes = {
|
|
682
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
683
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
684
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
685
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
686
|
+
/**
|
|
687
|
+
* @ignore
|
|
688
|
+
*/
|
|
689
|
+
children: PropTypes.node,
|
|
690
|
+
/**
|
|
691
|
+
* CSS class applied to the element, or a function that
|
|
692
|
+
* returns a class based on the component’s state.
|
|
693
|
+
*/
|
|
694
|
+
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
695
|
+
/**
|
|
696
|
+
* Allows you to replace the component’s HTML element
|
|
697
|
+
* with a different tag, or compose it with another component.
|
|
698
|
+
*
|
|
699
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
700
|
+
*/
|
|
701
|
+
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
702
|
+
} : void 0;
|
|
703
|
+
function usePopoverClass(name, className) {
|
|
704
|
+
return useMemo(() => {
|
|
705
|
+
if (typeof className !== "function") return clsx(name, className);
|
|
706
|
+
return (p) => clsx(name, className(p));
|
|
707
|
+
}, [className, name]);
|
|
708
|
+
}
|
|
709
|
+
const PopoverBackdrop2 = forwardRef(function PopoverBackdrop22({ className, ...props }, ref) {
|
|
710
|
+
const cl = usePopoverClass("lng1771-popover__backdrop", className);
|
|
711
|
+
return /* @__PURE__ */ jsx(PopoverBackdrop$1, { ...props, ref, className: cl });
|
|
712
|
+
});
|
|
713
|
+
const PopoverPopup2 = forwardRef(function PopoverPopup22({ className, ...props }, ref) {
|
|
714
|
+
const cl = usePopoverClass("lng1771-popover", className);
|
|
715
|
+
return /* @__PURE__ */ jsx(PopoverPopup$1, { ...props, ref, className: cl });
|
|
716
|
+
});
|
|
717
|
+
const PopoverTitle2 = forwardRef(function PopoverTitle22({ className, ...props }, ref) {
|
|
718
|
+
const cl = usePopoverClass("lng1771-popover__title", className);
|
|
719
|
+
return /* @__PURE__ */ jsx(PopoverTitle$1, { ...props, ref, className: cl });
|
|
720
|
+
});
|
|
721
|
+
const PopoverDescription2 = forwardRef(function PopoverDescription22({ className, ...props }, ref) {
|
|
722
|
+
const cl = usePopoverClass("lng1771-popover__description", className);
|
|
723
|
+
return /* @__PURE__ */ jsx(PopoverDescription$1, { ...props, ref, className: cl });
|
|
724
|
+
});
|
|
725
|
+
const PopoverClose2 = forwardRef(function PopoverClose22({ className, ...props }, ref) {
|
|
726
|
+
const cl = usePopoverClass("lng1771-popover__close", className);
|
|
727
|
+
return /* @__PURE__ */ jsx(PopoverClose$1, { ...props, ref, className: cl });
|
|
728
|
+
});
|
|
729
|
+
const PopoverPositioner2 = forwardRef(function PopoverPositioner22({ className, ...props }, ref) {
|
|
730
|
+
const target = useAnchor();
|
|
731
|
+
const cl = usePopoverClass("lng1771-popover__positioner", className);
|
|
732
|
+
return /* @__PURE__ */ jsx(
|
|
733
|
+
PopoverPositioner$1,
|
|
734
|
+
{
|
|
735
|
+
anchor: target ? "getBoundingClientRect" in target ? target : {
|
|
736
|
+
getBoundingClientRect: () => ({
|
|
737
|
+
x: target.x,
|
|
738
|
+
y: target.y,
|
|
739
|
+
width: target.width,
|
|
740
|
+
height: target.height,
|
|
741
|
+
top: target.y,
|
|
742
|
+
left: target.x,
|
|
743
|
+
bottom: target.y,
|
|
744
|
+
right: target.x,
|
|
745
|
+
toJSON: () => ""
|
|
746
|
+
})
|
|
747
|
+
} : void 0,
|
|
748
|
+
sideOffset: 8,
|
|
749
|
+
...props,
|
|
750
|
+
ref,
|
|
751
|
+
className: cl
|
|
752
|
+
}
|
|
753
|
+
);
|
|
754
|
+
});
|
|
755
|
+
const PopoverArrow2 = forwardRef(function PopoverArrow22({ className, ...props }, ref) {
|
|
756
|
+
const cl = usePopoverClass("lng1771-popover__arrow", className);
|
|
757
|
+
return /* @__PURE__ */ jsx(PopoverArrow$1, { ...props, ref, className: cl, children: props.children ?? /* @__PURE__ */ jsx(ArrowSvg, {}) });
|
|
758
|
+
});
|
|
759
|
+
const Popover = {
|
|
760
|
+
Arrow: PopoverArrow2,
|
|
761
|
+
Backdrop: PopoverBackdrop2,
|
|
762
|
+
Close: PopoverClose2,
|
|
763
|
+
Description: PopoverDescription2,
|
|
764
|
+
Container: PopoverPopup2,
|
|
765
|
+
Positioner: PopoverPositioner2,
|
|
766
|
+
Title: PopoverTitle2
|
|
767
|
+
};
|
|
768
|
+
export {
|
|
769
|
+
Popover
|
|
770
|
+
};
|