@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.
Files changed (168) hide show
  1. package/LICENSE +15 -0
  2. package/dist/DialogPortalContext-C2WZTqJ3.js +47 -0
  3. package/dist/InternalBackdrop-Dm9czgoC.js +6746 -0
  4. package/dist/MenuRoot-9n64jNWP.js +724 -0
  5. package/dist/anchor-context-B9sGQdR5.js +35 -0
  6. package/dist/arrow-down-icon-B-3ldODD.js +27 -0
  7. package/dist/arrow-svg-evmXDI_J.js +29 -0
  8. package/dist/column-manager.js +1241 -0
  9. package/dist/cross-icon-CEMLAlFX.js +20 -0
  10. package/dist/dialog.js +506 -0
  11. package/dist/filter-manager.js +1056 -0
  12. package/dist/getPseudoElementBounds-BSHt6WYm.js +26 -0
  13. package/dist/grid-container.js +18 -0
  14. package/dist/icons.js +512 -0
  15. package/dist/index.js +3730 -0
  16. package/dist/lytenyte-pro.css +1948 -0
  17. package/dist/manage-columns-icon-D4CElo5H.js +146 -0
  18. package/dist/menu.js +1639 -0
  19. package/dist/pill-C4Jhdf8E.js +985 -0
  20. package/dist/pill-manager.js +674 -0
  21. package/dist/plus-icon-ToqW5CC-.js +15 -0
  22. package/dist/popover.js +770 -0
  23. package/dist/row-group-icon-BOOju5Vu.js +205 -0
  24. package/dist/search-icon-CcG1lqsn.js +86 -0
  25. package/dist/select-C6xOZZLq.js +2231 -0
  26. package/dist/sort-manager.js +298 -0
  27. package/dist/tickmark-icon-CoogRMoO.js +51 -0
  28. package/dist/types/cell-selection/cell-selection-containers.d.ts +3 -0
  29. package/dist/types/cell-selection/cell-selection-driver.d.ts +1 -0
  30. package/dist/types/cell-selection/cell-style-row.d.ts +8 -0
  31. package/dist/types/column-manager/column-manager-drag-box-controls.d.ts +1 -0
  32. package/dist/types/column-manager/column-manager-drag-box-expander.d.ts +1 -0
  33. package/dist/types/column-manager/column-manager-drag-box-label.d.ts +5 -0
  34. package/dist/types/column-manager/column-manager-drag-box.d.ts +13 -0
  35. package/dist/types/column-manager/column-manager-drag-placeholder.d.ts +5 -0
  36. package/dist/types/column-manager/column-manager-drop-zone.d.ts +10 -0
  37. package/dist/types/column-manager/column-manager-impl.d.ts +36 -0
  38. package/dist/types/column-manager/column-manager-pill.d.ts +4 -0
  39. package/dist/types/column-manager/column-manager-pivot-mode-toggle.d.ts +1 -0
  40. package/dist/types/column-manager/column-manager-search.d.ts +1 -0
  41. package/dist/types/column-manager/column-manager-state.d.ts +8 -0
  42. package/dist/types/column-manager/column-manager-tree-item.d.ts +6 -0
  43. package/dist/types/column-manager/column-manager-tree.d.ts +11 -0
  44. package/dist/types/column-manager/column-manager-types.d.ts +1 -0
  45. package/dist/types/column-manager/column-manager.d.ts +1 -0
  46. package/dist/types/column-manager/column-mananger-context.d.ts +12 -0
  47. package/dist/types/column-manager/utils/all-leafs.d.ts +3 -0
  48. package/dist/types/column-manager/utils/can-hide-item.d.ts +3 -0
  49. package/dist/types/column-manager/utils/handle-item-hide.d.ts +3 -0
  50. package/dist/types/components-internal/button/button.d.ts +9 -0
  51. package/dist/types/components-internal/grid-frame/grid-frame.d.ts +11 -0
  52. package/dist/types/components-internal/radio/radio.d.ts +5 -0
  53. package/dist/types/components-internal/separator/separator.d.ts +8 -0
  54. package/dist/types/components-internal/toggle/toggle.d.ts +7 -0
  55. package/dist/types/dialog/dialog-driver.d.ts +1 -0
  56. package/dist/types/dialog/dialog-impl.d.ts +6 -0
  57. package/dist/types/dialog/dialog.d.ts +8 -0
  58. package/dist/types/dialog/use-dialog-class.d.ts +1 -0
  59. package/dist/types/external.d.ts +2 -0
  60. package/dist/types/filter-manager/combined-to-flat.d.ts +3 -0
  61. package/dist/types/filter-manager/components/apply-filter-button.d.ts +1 -0
  62. package/dist/types/filter-manager/components/clear-filter-button.d.ts +1 -0
  63. package/dist/types/filter-manager/components/flatten-tree-items.d.ts +4 -0
  64. package/dist/types/filter-manager/components/get-child-values.d.ts +2 -0
  65. package/dist/types/filter-manager/components/in-filter-container.d.ts +1 -0
  66. package/dist/types/filter-manager/components/in-filter-error.d.ts +5 -0
  67. package/dist/types/filter-manager/components/in-filter-loading.d.ts +1 -0
  68. package/dist/types/filter-manager/components/in-filter-root.d.ts +11 -0
  69. package/dist/types/filter-manager/components/in-filter-tree.d.ts +15 -0
  70. package/dist/types/filter-manager/components/simple-filter-additional-switch.d.ts +1 -0
  71. package/dist/types/filter-manager/components/simple-filter-operator/date-operator.d.ts +1 -0
  72. package/dist/types/filter-manager/components/simple-filter-operator/number-operator.d.ts +1 -0
  73. package/dist/types/filter-manager/components/simple-filter-operator/simple-filter-operator.d.ts +1 -0
  74. package/dist/types/filter-manager/components/simple-filter-operator/text-operator.d.ts +1 -0
  75. package/dist/types/filter-manager/components/simple-filter-root.d.ts +9 -0
  76. package/dist/types/filter-manager/components/simple-filter-value/date-value.d.ts +1 -0
  77. package/dist/types/filter-manager/components/simple-filter-value/number-value.d.ts +1 -0
  78. package/dist/types/filter-manager/components/simple-filter-value/simple-filter-value.d.ts +1 -0
  79. package/dist/types/filter-manager/components/simple-filter-value/text-value.d.ts +1 -0
  80. package/dist/types/filter-manager/components/use-date-filter-callbacks.d.ts +9 -0
  81. package/dist/types/filter-manager/components/use-in-filter-item-loader.d.ts +7 -0
  82. package/dist/types/filter-manager/components/use-number-filter-callbacks.d.ts +8 -0
  83. package/dist/types/filter-manager/components/use-text-filter-callbacks.d.ts +8 -0
  84. package/dist/types/filter-manager/filter-manager-impl.d.ts +27 -0
  85. package/dist/types/filter-manager/filter-manager.d.ts +1 -0
  86. package/dist/types/filter-manager/filter-state-context.d.ts +16 -0
  87. package/dist/types/filter-manager/flat-to-combined.d.ts +3 -0
  88. package/dist/types/filter-manager/flatten-combined-filter.d.ts +3 -0
  89. package/dist/types/filter-manager/is-filter-complete.d.ts +2 -0
  90. package/dist/types/filter-manager/types.d.ts +15 -0
  91. package/dist/types/filter-manager/use-in-filter.d.ts +5 -0
  92. package/dist/types/filter-manager/use-simple-filters.d.ts +8 -0
  93. package/dist/types/grid-container/grid-container-impl.d.ts +6 -0
  94. package/dist/types/grid-container/grid-container.d.ts +2 -0
  95. package/dist/types/icons.d.ts +1 -0
  96. package/dist/types/index.d.ts +7 -0
  97. package/dist/types/license.d.ts +12 -0
  98. package/dist/types/list-view/list-view-context.d.ts +21 -0
  99. package/dist/types/list-view/list-view.d.ts +26 -0
  100. package/dist/types/lytenyte-pro.d.ts +7 -0
  101. package/dist/types/menu/arrow-svg.d.ts +1 -0
  102. package/dist/types/menu/column-menu/column-menu-driver.d.ts +4 -0
  103. package/dist/types/menu/context-menu/context-menu-driver.d.ts +1 -0
  104. package/dist/types/menu/context-menu/use-context-menu-listener.d.ts +6 -0
  105. package/dist/types/menu/menu-impl.d.ts +17 -0
  106. package/dist/types/menu/menu.d.ts +18 -0
  107. package/dist/types/menu/use-menu-class-name.d.ts +1 -0
  108. package/dist/types/overlay/load-error-overlay.d.ts +1 -0
  109. package/dist/types/overlay/loading-overlay.d.ts +1 -0
  110. package/dist/types/overlay/no-data-overlay.d.ts +1 -0
  111. package/dist/types/overlay/overlay-driver.d.ts +1 -0
  112. package/dist/types/pill/pill.d.ts +5 -0
  113. package/dist/types/pill-manager/pill-manager-agg-menu.d.ts +7 -0
  114. package/dist/types/pill-manager/pill-manager-controls.d.ts +9 -0
  115. package/dist/types/pill-manager/pill-manager-drag-placeholder.d.ts +5 -0
  116. package/dist/types/pill-manager/pill-manager-expander.d.ts +1 -0
  117. package/dist/types/pill-manager/pill-manager-impl.d.ts +49 -0
  118. package/dist/types/pill-manager/pill-manager-pill.d.ts +4 -0
  119. package/dist/types/pill-manager/pill-manager-pills/pill-manager-pills.d.ts +2 -0
  120. package/dist/types/pill-manager/pill-manager-pills/use-aggregation-source.d.ts +2 -0
  121. package/dist/types/pill-manager/pill-manager-pills/use-column-pivot-source.d.ts +2 -0
  122. package/dist/types/pill-manager/pill-manager-pills/use-column-source.d.ts +2 -0
  123. package/dist/types/pill-manager/pill-manager-pills/use-measures-source.d.ts +2 -0
  124. package/dist/types/pill-manager/pill-manager-pills/use-row-groups-source.d.ts +2 -0
  125. package/dist/types/pill-manager/pill-manager-pills/utils.d.ts +3 -0
  126. package/dist/types/pill-manager/pill-manager-row-label.d.ts +22 -0
  127. package/dist/types/pill-manager/pill-manager-row.d.ts +12 -0
  128. package/dist/types/pill-manager/pill-manager-rows.d.ts +1 -0
  129. package/dist/types/pill-manager/pill-manager-separator.d.ts +1 -0
  130. package/dist/types/pill-manager/pill-manager-types.d.ts +36 -0
  131. package/dist/types/pill-manager/pill-manager.d.ts +1 -0
  132. package/dist/types/popover/anchor-context.d.ts +6 -0
  133. package/dist/types/popover/popover-driver.d.ts +1 -0
  134. package/dist/types/popover/popover-impl.d.ts +8 -0
  135. package/dist/types/popover/popover.d.ts +10 -0
  136. package/dist/types/popover/use-popover-class.d.ts +1 -0
  137. package/dist/types/select/select.d.ts +17 -0
  138. package/dist/types/sort-manager/sort-adder.d.ts +4 -0
  139. package/dist/types/sort-manager/sort-apply.d.ts +1 -0
  140. package/dist/types/sort-manager/sort-cancel.d.ts +1 -0
  141. package/dist/types/sort-manager/sort-clear.d.ts +1 -0
  142. package/dist/types/sort-manager/sort-column-select.d.ts +5 -0
  143. package/dist/types/sort-manager/sort-direction-select.d.ts +5 -0
  144. package/dist/types/sort-manager/sort-items-to-sort-model.d.ts +3 -0
  145. package/dist/types/sort-manager/sort-manager-container.d.ts +53 -0
  146. package/dist/types/sort-manager/sort-manager-context.d.ts +4 -0
  147. package/dist/types/sort-manager/sort-manager-impl.d.ts +30 -0
  148. package/dist/types/sort-manager/sort-manager.d.ts +1 -0
  149. package/dist/types/sort-manager/sort-model-to-sort-items.d.ts +4 -0
  150. package/dist/types/sort-manager/sort-remove.d.ts +4 -0
  151. package/dist/types/sort-manager/sort-sort-select.d.ts +5 -0
  152. package/dist/types/sort-manager/use-sort-state.d.ts +8 -0
  153. package/dist/types/sort-manager/use-sortable-column-items.d.ts +9 -0
  154. package/dist/types/types.d.ts +1 -0
  155. package/dist/types/use-client-data-source.d.ts +6 -0
  156. package/dist/types/use-edge-scroll.d.ts +7 -0
  157. package/dist/types/use-grid.d.ts +6 -0
  158. package/dist/types/use-lytenyte.d.ts +10 -0
  159. package/dist/types/use-tree-data-source.d.ts +3 -0
  160. package/dist/types/watermark.d.ts +3 -0
  161. package/dist/types.js +1 -0
  162. package/dist/use-grid-DKvzGZWc.js +916 -0
  163. package/dist/useAnchorPositioning-Cm44rb7y.js +252 -0
  164. package/dist/useBaseUiId-J66PFGv_.js +48 -0
  165. package/dist/useButton-Cy7tjZ__.js +183 -0
  166. package/dist/useCompositeListItem-I14CpQPi.js +51 -0
  167. package/dist/useScrollLock-D6h5lZYs.js +515 -0
  168. package/package.json +96 -0
@@ -0,0 +1,20 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ function CrossIcon(props) {
3
+ return /* @__PURE__ */ jsx(
4
+ "svg",
5
+ {
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ fill: "none",
8
+ width: 20,
9
+ height: 20,
10
+ viewBox: "0 0 24 24",
11
+ strokeWidth: 1.5,
12
+ stroke: "currentColor",
13
+ ...props,
14
+ children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18 18 6M6 6l12 12" })
15
+ }
16
+ );
17
+ }
18
+ export {
19
+ CrossIcon as C
20
+ };
package/dist/dialog.js ADDED
@@ -0,0 +1,506 @@
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 { w as popupStateMapping, k as useForkRef, v as useComponentRenderer, P as PropTypes, j as useEventCallback, m as mergeProps, u as useEnhancedEffect, y as useOpenChangeComplete, I as InternalBackdrop, M as FloatingFocusManager, r as refType } from "./InternalBackdrop-Dm9czgoC.js";
6
+ import { u as useDialogRootContext, a as useDialogPortalContext } from "./DialogPortalContext-C2WZTqJ3.js";
7
+ import { t as transitionStatusMapping, u as useBaseUiId } from "./useBaseUiId-J66PFGv_.js";
8
+ import { u as useButton } from "./useButton-Cy7tjZ__.js";
9
+ const customStyleHookMapping$1 = {
10
+ ...popupStateMapping,
11
+ ...transitionStatusMapping
12
+ };
13
+ const DialogBackdrop$1 = /* @__PURE__ */ React.forwardRef(function DialogBackdrop(props, forwardedRef) {
14
+ const {
15
+ render,
16
+ className,
17
+ ...other
18
+ } = props;
19
+ const {
20
+ open,
21
+ nested,
22
+ mounted,
23
+ transitionStatus,
24
+ backdropRef
25
+ } = useDialogRootContext();
26
+ const state2 = React.useMemo(() => ({
27
+ open,
28
+ transitionStatus
29
+ }), [open, transitionStatus]);
30
+ const mergedRef = useForkRef(backdropRef, forwardedRef);
31
+ const {
32
+ renderElement
33
+ } = useComponentRenderer({
34
+ render: render ?? "div",
35
+ className,
36
+ state: state2,
37
+ ref: mergedRef,
38
+ extraProps: {
39
+ role: "presentation",
40
+ hidden: !mounted,
41
+ ...other
42
+ },
43
+ customStyleHookMapping: customStyleHookMapping$1
44
+ });
45
+ const shouldRender = !nested;
46
+ if (!shouldRender) {
47
+ return null;
48
+ }
49
+ return renderElement();
50
+ });
51
+ process.env.NODE_ENV !== "production" ? DialogBackdrop$1.propTypes = {
52
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
53
+ // │ These PropTypes are generated from the TypeScript type definitions. │
54
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
55
+ // └─────────────────────────────────────────────────────────────────────┘
56
+ /**
57
+ * @ignore
58
+ */
59
+ children: PropTypes.node,
60
+ /**
61
+ * CSS class applied to the element, or a function that
62
+ * returns a class based on the component’s state.
63
+ */
64
+ className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
65
+ /**
66
+ * Allows you to replace the component’s HTML element
67
+ * with a different tag, or compose it with another component.
68
+ *
69
+ * Accepts a `ReactElement` or a function that returns the element to render.
70
+ */
71
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
72
+ } : void 0;
73
+ function useDialogClose(params) {
74
+ const {
75
+ open,
76
+ setOpen,
77
+ rootRef: externalRef,
78
+ disabled
79
+ } = params;
80
+ const handleClick = useEventCallback((event) => {
81
+ if (open) {
82
+ setOpen(false, event.nativeEvent, "click");
83
+ }
84
+ });
85
+ const {
86
+ getButtonProps
87
+ } = useButton({
88
+ disabled,
89
+ buttonRef: externalRef
90
+ });
91
+ const getRootProps = (externalProps) => mergeProps({
92
+ onClick: handleClick
93
+ }, externalProps, getButtonProps);
94
+ return {
95
+ getRootProps
96
+ };
97
+ }
98
+ const DialogClose$1 = /* @__PURE__ */ React.forwardRef(function DialogClose(props, forwardedRef) {
99
+ const {
100
+ render,
101
+ className,
102
+ disabled = false,
103
+ ...other
104
+ } = props;
105
+ const {
106
+ open,
107
+ setOpen
108
+ } = useDialogRootContext();
109
+ const {
110
+ getRootProps
111
+ } = useDialogClose({
112
+ disabled,
113
+ open,
114
+ setOpen,
115
+ rootRef: forwardedRef
116
+ });
117
+ const state2 = React.useMemo(() => ({
118
+ disabled
119
+ }), [disabled]);
120
+ const {
121
+ renderElement
122
+ } = useComponentRenderer({
123
+ render: render ?? "button",
124
+ className,
125
+ state: state2,
126
+ propGetter: getRootProps,
127
+ extraProps: other
128
+ });
129
+ return renderElement();
130
+ });
131
+ process.env.NODE_ENV !== "production" ? DialogClose$1.propTypes = {
132
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
133
+ // │ These PropTypes are generated from the TypeScript type definitions. │
134
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
135
+ // └─────────────────────────────────────────────────────────────────────┘
136
+ /**
137
+ * @ignore
138
+ */
139
+ children: PropTypes.node,
140
+ /**
141
+ * CSS class applied to the element, or a function that
142
+ * returns a class based on the component’s state.
143
+ */
144
+ className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
145
+ /**
146
+ * @ignore
147
+ */
148
+ disabled: PropTypes.bool,
149
+ /**
150
+ * Allows you to replace the component’s HTML element
151
+ * with a different tag, or compose it with another component.
152
+ *
153
+ * Accepts a `ReactElement` or a function that returns the element to render.
154
+ */
155
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
156
+ } : void 0;
157
+ const state$1 = {};
158
+ const DialogDescription$1 = /* @__PURE__ */ React.forwardRef(function DialogDescription(props, forwardedRef) {
159
+ const {
160
+ render,
161
+ className,
162
+ id: idProp,
163
+ ...other
164
+ } = props;
165
+ const {
166
+ setDescriptionElementId
167
+ } = useDialogRootContext();
168
+ const id = useBaseUiId(idProp);
169
+ useEnhancedEffect(() => {
170
+ setDescriptionElementId(id);
171
+ return () => {
172
+ setDescriptionElementId(void 0);
173
+ };
174
+ }, [id, setDescriptionElementId]);
175
+ const getProps = React.useCallback((externalProps = {}) => mergeProps({
176
+ id
177
+ }, externalProps), [id]);
178
+ const {
179
+ renderElement
180
+ } = useComponentRenderer({
181
+ propGetter: getProps,
182
+ render: render ?? "p",
183
+ className,
184
+ state: state$1,
185
+ ref: forwardedRef,
186
+ extraProps: other
187
+ });
188
+ return renderElement();
189
+ });
190
+ process.env.NODE_ENV !== "production" ? DialogDescription$1.propTypes = {
191
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
192
+ // │ These PropTypes are generated from the TypeScript type definitions. │
193
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
194
+ // └─────────────────────────────────────────────────────────────────────┘
195
+ /**
196
+ * @ignore
197
+ */
198
+ children: PropTypes.node,
199
+ /**
200
+ * CSS class applied to the element, or a function that
201
+ * returns a class based on the component’s state.
202
+ */
203
+ className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
204
+ /**
205
+ * @ignore
206
+ */
207
+ id: PropTypes.string,
208
+ /**
209
+ * Allows you to replace the component’s HTML element
210
+ * with a different tag, or compose it with another component.
211
+ *
212
+ * Accepts a `ReactElement` or a function that returns the element to render.
213
+ */
214
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
215
+ } : void 0;
216
+ function useDialogPopup(parameters) {
217
+ const {
218
+ descriptionElementId,
219
+ getPopupProps,
220
+ initialFocus,
221
+ modal,
222
+ mounted,
223
+ openMethod,
224
+ ref,
225
+ setPopupElement,
226
+ titleElementId
227
+ } = parameters;
228
+ const popupRef = React.useRef(null);
229
+ const handleRef = useForkRef(ref, popupRef, setPopupElement);
230
+ const defaultInitialFocus = React.useCallback((interactionType) => {
231
+ if (interactionType === "touch") {
232
+ return popupRef;
233
+ }
234
+ return 0;
235
+ }, []);
236
+ const resolvedInitialFocus = React.useMemo(() => {
237
+ if (initialFocus == null) {
238
+ return defaultInitialFocus(openMethod ?? "");
239
+ }
240
+ if (typeof initialFocus === "function") {
241
+ return initialFocus(openMethod ?? "");
242
+ }
243
+ return initialFocus;
244
+ }, [defaultInitialFocus, initialFocus, openMethod]);
245
+ const getRootProps = (externalProps) => mergeProps({
246
+ "aria-labelledby": titleElementId ?? void 0,
247
+ "aria-describedby": descriptionElementId ?? void 0,
248
+ "aria-modal": mounted && modal ? true : void 0,
249
+ role: "dialog",
250
+ tabIndex: -1,
251
+ ...getPopupProps(),
252
+ ref: handleRef,
253
+ hidden: !mounted
254
+ }, externalProps);
255
+ return {
256
+ getRootProps,
257
+ resolvedInitialFocus
258
+ };
259
+ }
260
+ let DialogPopupCssVars = /* @__PURE__ */ function(DialogPopupCssVars2) {
261
+ DialogPopupCssVars2["nestedDialogs"] = "--nested-dialogs";
262
+ return DialogPopupCssVars2;
263
+ }({});
264
+ let DialogPopupDataAttributes = /* @__PURE__ */ function(DialogPopupDataAttributes2) {
265
+ DialogPopupDataAttributes2["open"] = "data-open";
266
+ DialogPopupDataAttributes2["closed"] = "data-closed";
267
+ DialogPopupDataAttributes2["startingStyle"] = "data-starting-style";
268
+ DialogPopupDataAttributes2["endingStyle"] = "data-ending-style";
269
+ DialogPopupDataAttributes2["nested"] = "data-nested";
270
+ DialogPopupDataAttributes2["hasNestedDialogs"] = "data-has-nested-dialogs";
271
+ return DialogPopupDataAttributes2;
272
+ }({});
273
+ const customStyleHookMapping = {
274
+ ...popupStateMapping,
275
+ ...transitionStatusMapping,
276
+ hasNestedDialogs(value) {
277
+ return value ? {
278
+ [DialogPopupDataAttributes.hasNestedDialogs]: ""
279
+ } : null;
280
+ }
281
+ };
282
+ const DialogPopup$1 = /* @__PURE__ */ React.forwardRef(function DialogPopup(props, forwardedRef) {
283
+ const {
284
+ className,
285
+ finalFocus,
286
+ id,
287
+ initialFocus,
288
+ render,
289
+ ...other
290
+ } = props;
291
+ const {
292
+ descriptionElementId,
293
+ dismissible,
294
+ floatingRootContext,
295
+ getPopupProps,
296
+ modal,
297
+ mounted,
298
+ nested,
299
+ nestedOpenDialogCount,
300
+ setOpen,
301
+ open,
302
+ openMethod,
303
+ popupRef,
304
+ setPopupElement,
305
+ titleElementId,
306
+ transitionStatus,
307
+ onOpenChangeComplete,
308
+ internalBackdropRef
309
+ } = useDialogRootContext();
310
+ useDialogPortalContext();
311
+ useOpenChangeComplete({
312
+ open,
313
+ ref: popupRef,
314
+ onComplete() {
315
+ if (open) {
316
+ onOpenChangeComplete?.(true);
317
+ }
318
+ }
319
+ });
320
+ const mergedRef = useForkRef(forwardedRef, popupRef);
321
+ const {
322
+ getRootProps,
323
+ resolvedInitialFocus
324
+ } = useDialogPopup({
325
+ descriptionElementId,
326
+ getPopupProps,
327
+ id,
328
+ initialFocus,
329
+ modal,
330
+ mounted,
331
+ setOpen,
332
+ openMethod,
333
+ ref: mergedRef,
334
+ setPopupElement,
335
+ titleElementId
336
+ });
337
+ const state2 = {
338
+ open,
339
+ nested,
340
+ transitionStatus,
341
+ hasNestedDialogs: nestedOpenDialogCount > 0
342
+ };
343
+ const {
344
+ renderElement
345
+ } = useComponentRenderer({
346
+ render: render ?? "div",
347
+ className,
348
+ state: state2,
349
+ propGetter: getRootProps,
350
+ extraProps: {
351
+ ...other,
352
+ style: {
353
+ ...other.style,
354
+ [DialogPopupCssVars.nestedDialogs]: nestedOpenDialogCount
355
+ }
356
+ },
357
+ customStyleHookMapping
358
+ });
359
+ return /* @__PURE__ */ jsxs(React.Fragment, {
360
+ children: [mounted && modal && /* @__PURE__ */ jsx(InternalBackdrop, {
361
+ ref: internalBackdropRef
362
+ }), /* @__PURE__ */ jsx(FloatingFocusManager, {
363
+ context: floatingRootContext,
364
+ disabled: !mounted,
365
+ closeOnFocusOut: dismissible,
366
+ initialFocus: resolvedInitialFocus,
367
+ returnFocus: finalFocus,
368
+ children: renderElement()
369
+ })]
370
+ });
371
+ });
372
+ process.env.NODE_ENV !== "production" ? DialogPopup$1.propTypes = {
373
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
374
+ // │ These PropTypes are generated from the TypeScript type definitions. │
375
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
376
+ // └─────────────────────────────────────────────────────────────────────┘
377
+ /**
378
+ * @ignore
379
+ */
380
+ children: PropTypes.node,
381
+ /**
382
+ * CSS class applied to the element, or a function that
383
+ * returns a class based on the component’s state.
384
+ */
385
+ className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
386
+ /**
387
+ * Determines the element to focus when the dialog is closed.
388
+ * By default, focus returns to the trigger.
389
+ */
390
+ finalFocus: refType,
391
+ /**
392
+ * @ignore
393
+ */
394
+ id: PropTypes.string,
395
+ /**
396
+ * Determines the element to focus when the dialog is opened.
397
+ * By default, the first focusable element is focused.
398
+ */
399
+ initialFocus: PropTypes.oneOfType([PropTypes.func, refType]),
400
+ /**
401
+ * Allows you to replace the component’s HTML element
402
+ * with a different tag, or compose it with another component.
403
+ *
404
+ * Accepts a `ReactElement` or a function that returns the element to render.
405
+ */
406
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
407
+ /**
408
+ * @ignore
409
+ */
410
+ style: PropTypes.object
411
+ } : void 0;
412
+ const state = {};
413
+ const DialogTitle$1 = /* @__PURE__ */ React.forwardRef(function DialogTitle(props, forwardedRef) {
414
+ const {
415
+ render,
416
+ className,
417
+ id: idProp,
418
+ ...other
419
+ } = props;
420
+ const {
421
+ setTitleElementId
422
+ } = useDialogRootContext();
423
+ const id = useBaseUiId(idProp);
424
+ useEnhancedEffect(() => {
425
+ setTitleElementId(id);
426
+ return () => {
427
+ setTitleElementId(void 0);
428
+ };
429
+ }, [id, setTitleElementId]);
430
+ const getProps = React.useCallback((externalProps = {}) => mergeProps({
431
+ id
432
+ }, externalProps), [id]);
433
+ const {
434
+ renderElement
435
+ } = useComponentRenderer({
436
+ propGetter: getProps,
437
+ render: render ?? "h2",
438
+ className,
439
+ state,
440
+ ref: forwardedRef,
441
+ extraProps: other
442
+ });
443
+ return renderElement();
444
+ });
445
+ process.env.NODE_ENV !== "production" ? DialogTitle$1.propTypes = {
446
+ // ┌────────────────────────────── Warning ──────────────────────────────┐
447
+ // │ These PropTypes are generated from the TypeScript type definitions. │
448
+ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
449
+ // └─────────────────────────────────────────────────────────────────────┘
450
+ /**
451
+ * @ignore
452
+ */
453
+ children: PropTypes.node,
454
+ /**
455
+ * CSS class applied to the element, or a function that
456
+ * returns a class based on the component’s state.
457
+ */
458
+ className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
459
+ /**
460
+ * @ignore
461
+ */
462
+ id: PropTypes.string,
463
+ /**
464
+ * Allows you to replace the component’s HTML element
465
+ * with a different tag, or compose it with another component.
466
+ *
467
+ * Accepts a `ReactElement` or a function that returns the element to render.
468
+ */
469
+ render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
470
+ } : void 0;
471
+ function useDialogClass(name, className) {
472
+ return useMemo(() => {
473
+ if (typeof className !== "function") return clsx(name, className);
474
+ return (p) => clsx(name, className(p));
475
+ }, [className, name]);
476
+ }
477
+ const DialogBackdrop2 = forwardRef(function DialogBackdrop22({ className, ...props }, ref) {
478
+ const cl = useDialogClass("lng1771-dialog__backdrop", className);
479
+ return /* @__PURE__ */ jsx(DialogBackdrop$1, { ...props, ref, className: cl });
480
+ });
481
+ const DialogPopup2 = forwardRef(function DialogPopup22({ className, ...props }, ref) {
482
+ const cl = useDialogClass("lng1771-dialog", className);
483
+ return /* @__PURE__ */ jsx(DialogPopup$1, { ...props, ref, className: cl });
484
+ });
485
+ const DialogTitle2 = forwardRef(function DialogTitle22({ className, ...props }, ref) {
486
+ const cl = useDialogClass("lng1771-dialog__title", className);
487
+ return /* @__PURE__ */ jsx(DialogTitle$1, { ...props, ref, className: cl });
488
+ });
489
+ const DialogDescription2 = forwardRef(function DialogDescription22({ className, ...props }, ref) {
490
+ const cl = useDialogClass("lng1771-dialog__description", className);
491
+ return /* @__PURE__ */ jsx(DialogDescription$1, { ...props, ref, className: cl });
492
+ });
493
+ const DialogClose2 = forwardRef(function DialogClose22({ className, ...props }, ref) {
494
+ const cl = useDialogClass("lng1771-dialog__close", className);
495
+ return /* @__PURE__ */ jsx(DialogClose$1, { ...props, ref, className: cl });
496
+ });
497
+ const Dialog = {
498
+ Backdrop: DialogBackdrop2,
499
+ Close: DialogClose2,
500
+ Description: DialogDescription2,
501
+ Container: DialogPopup2,
502
+ Title: DialogTitle2
503
+ };
504
+ export {
505
+ Dialog
506
+ };